changeset 0:ab8a496afb67

initial hg commit of my version of keynav
author paulo@thepaulopc
date Tue, 08 Sep 2009 22:45:57 -0700
parents
children 0d5dc7c29c78
files Imakefile Makefile README config.h config.h.default config.h.keypad keynav.c keynav.c.old
diffstat 8 files changed, 2309 insertions(+), 0 deletions(-) [+]
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/Imakefile	Tue Sep 08 22:45:57 2009 -0700
     1.3 @@ -0,0 +1,10 @@
     1.4 +DEPLIBS = $(DEPXTESTLIB) $(DEPEXTENSIONLIB) $(DEPXLIB)
     1.5 +LOCAL_LIBRARIES = $(XTESTLIB) $(EXTENSIONLIB) $(XLIB)
     1.6 +
     1.7 +SRCS = keynav.c
     1.8 +OBJS = keynav.o
     1.9 +
    1.10 +CC = gcc
    1.11 +
    1.12 +ComplexProgramTarget(keynav)
    1.13 +
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/Makefile	Tue Sep 08 22:45:57 2009 -0700
     2.3 @@ -0,0 +1,1290 @@
     2.4 +# Makefile generated by imake - do not edit!
     2.5 +# $Xorg: imake.c,v 1.6 2001/02/09 02:03:15 xorgcvs Exp $
     2.6 +
     2.7 +# ----------------------------------------------------------------------
     2.8 +# Makefile generated from "Imake.tmpl" and <Imakefile>
     2.9 +# $Xorg: Imake.tmpl,v 1.4 2000/08/17 19:41:46 cpqbld Exp $
    2.10 +# $XdotOrg: xc/config/cf/Imake.tmpl,v 1.6 2004/07/28 03:24:29 gisburn Exp $
    2.11 +#
    2.12 +#
    2.13 +#
    2.14 +#
    2.15 +# $XFree86: xc/config/cf/Imake.tmpl,v 3.155 2003/12/24 18:58:41 dickey Exp $
    2.16 +# ----------------------------------------------------------------------
    2.17 +
    2.18 +all::
    2.19 +
    2.20 +.SUFFIXES: .i
    2.21 +
    2.22 +# $XdotOrg: xc/config/cf/Imake.cf,v 1.4 2004/08/11 21:14:01 kem Exp $
    2.23 +# $Xorg: Imake.cf,v 1.4 2000/08/17 19:41:45 cpqbld Exp $
    2.24 +
    2.25 +# $XFree86: xc/config/cf/Imake.cf,v 3.88 2003/12/16 21:30:21 herrb Exp $
    2.26 +
    2.27 +# Keep cpp from replacing path elements containing i486/i586/i686
    2.28 +
    2.29 +# -----------------------------------------------------------------------
    2.30 +# site-specific configuration parameters that need to come before
    2.31 +# the platform-specific parameters - edit site.def to change
    2.32 +
    2.33 +# site:  $TOG: site.sample /main/r64_final/1 1998/02/05 16:28:49 kaleb $
    2.34 +
    2.35 +# site:  $XFree86: xc/config/cf/site.def,v 3.24 2000/06/25 20:17:29 dawes Exp $
    2.36 +
    2.37 +# $XFree86: xc/config/cf/xf86site.def,v 3.186 2003/06/25 18:06:22 eich Exp $
    2.38 +
    2.39 +# ----------------------------------------------------------------------
    2.40 +# platform-specific configuration parameters - edit linux.cf to change
    2.41 +
    2.42 +# $XdotOrg: xc/config/cf/linux.cf,v 1.13 2004/08/11 21:14:01 kem Exp $
    2.43 +# platform:  $Xorg: linux.cf,v 1.3 2000/08/17 19:41:47 cpqbld Exp $
    2.44 +
    2.45 +# platform:  $XFree86: xc/config/cf/linux.cf,v 3.220 2003/12/30 22:38:33 tsi Exp $
    2.46 +
    2.47 +# operating system:  Linux 2.6.17.8 i686 [ELF] (2.6.17)
    2.48 +# libc:	(6.3.5)
    2.49 +# binutils:	(215)
    2.50 +
    2.51 +# $Xorg: lnxLib.rules,v 1.3 2000/08/17 19:41:47 cpqbld Exp $
    2.52 +# $XFree86: xc/config/cf/lnxLib.rules,v 3.52 2003/10/31 20:49:03 herrb Exp $
    2.53 +
    2.54 +# $XdotOrg: xc/config/cf/xorg.cf,v 1.27.2.6 2005/01/24 03:11:42 gisburn Exp $
    2.55 +
    2.56 +# $Xorg: xfree86.cf,v 1.4 2000/08/17 19:41:49 cpqbld Exp $
    2.57 +
    2.58 +XORG_VERSION_CURRENT = (((6) * 10000000) + ((8) * 100000) + ((2) * 1000) + 0)
    2.59 +RELEASE_VERSION = RELEASE-1
    2.60 +
    2.61 +AFB_DEFS = -DUSE_AFB
    2.62 +
    2.63 +DRIVERSDKDIR = $(USRLIBDIR)/Server
    2.64 +DRIVERSDKMODULEDIR = $(USRLIBDIR)/Server/modules
    2.65 +DRIVERSDKINCLUDEDIR = $(USRLIBDIR)/Server/include
    2.66 +
    2.67 +       XF86SRC = $(SERVERSRC)/hw/xfree86
    2.68 +    XF86COMSRC = $(XF86SRC)/common
    2.69 + XF86PARSERSRC = $(XF86SRC)/parser
    2.70 +     XF86OSSRC = $(XF86SRC)/os-support
    2.71 + XF86DRIVERSRC = $(XF86SRC)/drivers
    2.72 +     DRIVERSRC = $(XF86DRIVERSRC)
    2.73 +
    2.74 +        XFREE86DOCDIR = $(DOCDIR)
    2.75 +      XFREE86PSDOCDIR = $(DOCPSDIR)
    2.76 +     XFREE86PDFDOCDIR = $(DOCPDFDIR)
    2.77 +    XFREE86HTMLDOCDIR = $(DOCHTMLDIR)
    2.78 +XFREE86JAPANESEDOCDIR = $(DOCDIR)/Japanese
    2.79 +
    2.80 +# $Xorg: xf86.rules,v 1.3 2000/08/17 19:41:48 cpqbld Exp $
    2.81 +
    2.82 +# $XFree86: xc/config/cf/xf86.rules,v 3.34tsi Exp $
    2.83 +
    2.84 +# ----------------------------------------------------------------------
    2.85 +# site-specific configuration parameters that go after
    2.86 +# the platform-specific parameters - edit site.def to change
    2.87 +
    2.88 +# site:  $TOG: site.sample /main/r64_final/1 1998/02/05 16:28:49 kaleb $
    2.89 +
    2.90 +# site:  $XFree86: xc/config/cf/site.def,v 3.24 2000/06/25 20:17:29 dawes Exp $
    2.91 +
    2.92 +# ---------------------------------------------------------------------
    2.93 +# Imake rules for building libraries, programs, scripts, and data files
    2.94 +# rules:  $Xorg: Imake.rules,v 1.3 2000/08/17 19:41:46 cpqbld Exp $
    2.95 +# rules:  $XdotOrg: xc/config/cf/Imake.rules,v 1.6 2004/08/13 17:21:43 krh Exp $
    2.96 +#
    2.97 +#
    2.98 +#
    2.99 +#
   2.100 +# rules:  $XFree86: xc/config/cf/Imake.rules,v 3.128 2003/11/15 03:25:17 dawes Exp $
   2.101 +
   2.102 +.PHONY: all interfaces install install.man install.lib install.sdk 	depend includes cleandir
   2.103 +
   2.104 + _NULLCMD_ = @ echo -n
   2.105 +
   2.106 +X_BYTE_ORDER = X_LITTLE_ENDIAN
   2.107 +
   2.108 +GLIDE2INCDIR =
   2.109 +
   2.110 +GLIDE3INCDIR =
   2.111 +
   2.112 +GLIDE3LIBNAME =
   2.113 +
   2.114 +TKLIBNAME =
   2.115 +
   2.116 +TKLIBDIR =
   2.117 +
   2.118 +TCLLIBNAME =
   2.119 +
   2.120 +TCLIBDIR =
   2.121 +
   2.122 +          PATHSEP = /
   2.123 +            SHELL = /bin/sh -e
   2.124 +
   2.125 +              TOP = .
   2.126 +      CURRENT_DIR = .
   2.127 +
   2.128 +            IMAKE = imake
   2.129 +           DEPEND = gccmakedep
   2.130 +        MKDIRHIER = mkdir -p
   2.131 +          REVPATH = revpath
   2.132 +    EXPORTLISTGEN =
   2.133 +             RMAN = rman
   2.134 +     RMANBASENAME = rman
   2.135 +      RMANOPTIONS = -f HTML
   2.136 +        CONFIGSRC = $(TOP)/config
   2.137 +         IMAKESRC = $(CONFIGSRC)/imake
   2.138 +        DEPENDSRC = $(CONFIGSRC)/util
   2.139 +
   2.140 +          INCROOT = /usr/X11R6/include
   2.141 +        USRLIBDIR = /usr/X11R6/lib
   2.142 +           VARDIR = /var
   2.143 +        VARLIBDIR = $(VARDIR)/lib
   2.144 +  SYSTEMUSRLIBDIR = /usr/lib
   2.145 +  SYSTEMUSRINCDIR = /usr/include
   2.146 +         SHLIBDIR = /usr/X11R6/lib
   2.147 +       LINTLIBDIR = $(USRLIBDIR)/lint
   2.148 +          MANPATH = /usr/X11R6/man
   2.149 +    MANSOURCEPATH = $(MANPATH)/man
   2.150 +           MANDIR = $(MANSOURCEPATH)1
   2.151 +        LIBMANDIR = $(MANSOURCEPATH)3
   2.152 +       FILEMANDIR = $(MANSOURCEPATH)5
   2.153 +       MISCMANDIR = $(MANSOURCEPATH)$(MISCMANSUFFIX)
   2.154 +     DRIVERMANDIR = $(MANSOURCEPATH)$(DRIVERMANSUFFIX)
   2.155 +     LOGDIRECTORY = $(VARDIR)/log
   2.156 +
   2.157 +        VARRUNDIR = $(VARDIR)/run
   2.158 +
   2.159 +         VARDBDIR = $(VARDIR)/lib
   2.160 +
   2.161 +               AR = ar clq
   2.162 +
   2.163 +# Nice try but useless: make will inherit BOOTSTRAPCFLAGS
   2.164 +# from  top Makefile
   2.165 +  BOOTSTRAPCFLAGS =
   2.166 +
   2.167 +               CC = gcc -m32
   2.168 +               AS = gcc -m32 -c -x assembler
   2.169 +
   2.170 +.SUFFIXES: .cc
   2.171 +
   2.172 +              CXX = c++ -m32
   2.173 +
   2.174 +          CXXFILT = c++filt
   2.175 +
   2.176 +           CXXLIB = -lstdc++
   2.177 +
   2.178 +    CXXDEBUGFLAGS = -O2 -fno-strength-reduce -fno-strict-aliasing
   2.179 +CXXDEPENDINCLUDES =
   2.180 + CXXEXTRA_DEFINES =
   2.181 +CXXEXTRA_INCLUDES =
   2.182 +   CXXSTD_DEFINES = -Dlinux -D__i386__ -D_POSIX_C_SOURCE=199309L 				-D_POSIX_SOURCE -D_XOPEN_SOURCE 				-D_BSD_SOURCE -D_SVID_SOURCE 				  				 $(CXXPROJECT_DEFINES)
   2.183 +       CXXOPTIONS =
   2.184 +      CXXINCLUDES = $(INCLUDES) $(TOP_INCLUDES) $(CXXEXTRA_INCLUDES)
   2.185 +       CXXDEFINES = $(CXXINCLUDES) $(CXXSTD_DEFINES) $(THREADS_CXXDEFINES) $(DEFINES) $(CXXEXTRA_DEFINES)
   2.186 +         CXXFLAGS = $(CXXDEBUGFLAGS) $(CXXOPTIONS) $(THREADS_CXXFLAGS) $(CXXDEFINES)
   2.187 +
   2.188 +         COMPRESS = compress
   2.189 +          GZIPCMD = gzip
   2.190 +
   2.191 +              CPP = cpp $(STD_CPP_DEFINES)
   2.192 +           RAWCPP = cpp -undef $(STD_CPP_OPTIONS)
   2.193 +    PREPROCESSCMD = gcc -m32 -E $(STD_CPP_DEFINES)
   2.194 +
   2.195 +          INSTALL = install
   2.196 +     INSTALLFLAGS = -c
   2.197 +
   2.198 +               LD = gcc -m32 -nostdlib
   2.199 +
   2.200 +              LEX = flex -l
   2.201 +               M4 = m4
   2.202 +          M4FLAGS =
   2.203 +           LEXLIB = -lfl
   2.204 +             YACC = bison -y
   2.205 +           CCYACC = bison -y
   2.206 +
   2.207 +             LINT = lint
   2.208 +
   2.209 +      LINTLIBFLAG = -C
   2.210 +         LINTOPTS = -axz
   2.211 +               LN = ln -s
   2.212 +             MAKE = make
   2.213 +               MV = mv -f
   2.214 +               CP = cp
   2.215 +
   2.216 +           RANLIB = ranlib
   2.217 +
   2.218 +  RANLIBINSTFLAGS =
   2.219 +
   2.220 +               RM = rm -f
   2.221 +             PERL = perl
   2.222 +         PERLOPTS =
   2.223 +     PERLENVSETUP = env LC_ALL=C
   2.224 +        MANSUFFIX = 1x
   2.225 +     LIBMANSUFFIX = 3x
   2.226 +    FILEMANSUFFIX = 5x
   2.227 +    MISCMANSUFFIX = 7
   2.228 +  DRIVERMANSUFFIX = 4
   2.229 +   ADMINMANSUFFIX = 8
   2.230 +     MANSRCSUFFIX = man
   2.231 +     MANNEWSUFFIX = _man
   2.232 +          MANDEFS = -D__apploaddir__=$(XAPPLOADDIR) -D__appmansuffix__=$(MANSUFFIX) -D__filemansuffix__=$(FILEMANSUFFIX) -D__libmansuffix__=$(LIBMANSUFFIX) -D__miscmansuffix__=$(MISCMANSUFFIX) -D__drivermansuffix__=$(DRIVERMANSUFFIX) -D__adminmansuffix__=$(ADMINMANSUFFIX) -D__projectroot__=$(PROJECTROOT) -D__xconfigfile__=$(XCONFIGFILE) -D__xconfigdir__=$(XCONFIGDIR) -D__xlogfile__=$(XLOGFILE) -D__xservername__=$(XSERVERNAME) $(XORGMANDEFS) $(VENDORMANDEFS)
   2.233 +
   2.234 +   COMPRESSMANCMD = gzip -n
   2.235 +
   2.236 +            TROFF = groff -Tps
   2.237 +            NROFF = nroff
   2.238 +
   2.239 +         MSMACROS = -ms
   2.240 +        MANMACROS = -man
   2.241 +              TBL = tbl
   2.242 +              EQN = eqn
   2.243 +             NEQN = neqn
   2.244 +              COL = col
   2.245 +         COLFLAGS = -b
   2.246 +
   2.247 +            MODCC = gcc -m32
   2.248 +
   2.249 +           MODCPP = cpp
   2.250 +        MODCFLAGS = $(CFLAGS)
   2.251 +            MODAS = gcc -m32 -c -x assembler
   2.252 +       MODASFLAGS =
   2.253 +
   2.254 +            MODLD = gcc -m32 -nostdlib
   2.255 +
   2.256 +       MODLDFLAGS =
   2.257 +MODLDCOMBINEFLAGS = -r
   2.258 +            MODAR = ar clq
   2.259 +
   2.260 +        MODRANLIB = ranlib
   2.261 +
   2.262 +     STD_INCLUDES =
   2.263 +  STD_CPP_OPTIONS = -traditional
   2.264 +  STD_CPP_DEFINES = -traditional -Dlinux -D__i386__ -D_POSIX_C_SOURCE=199309L 				-D_POSIX_SOURCE -D_XOPEN_SOURCE 				-D_BSD_SOURCE -D_SVID_SOURCE 				  				 $(PROJECT_DEFINES)
   2.265 +      STD_DEFINES = -Dlinux -D__i386__ -D_POSIX_C_SOURCE=199309L 				-D_POSIX_SOURCE -D_XOPEN_SOURCE 				-D_BSD_SOURCE -D_SVID_SOURCE 				  				 $(PROJECT_DEFINES)
   2.266 + EXTRA_LOAD_FLAGS =
   2.267 +  EXTRA_LDOPTIONS =
   2.268 +  EXTRA_LIBRARIES =
   2.269 +             TAGS = ctags
   2.270 +
   2.271 +   PARALLELMFLAGS =
   2.272 +
   2.273 +    SHAREDCODEDEF =
   2.274 +         SHLIBDEF =
   2.275 +
   2.276 +     SHLIBLDFLAGS = -shared $(SHLIBGLOBALSFLAGS)
   2.277 +
   2.278 +         PICFLAGS = -fPIC
   2.279 +
   2.280 +      CXXPICFLAGS = -fPIC
   2.281 +
   2.282 +    PROTO_DEFINES = -DFUNCPROTO=15 -DNARROWPROTO
   2.283 +
   2.284 +     INSTPGMFLAGS =
   2.285 +
   2.286 +     INSTBINFLAGS = -m 0755
   2.287 +     INSTUIDFLAGS = -m 4711
   2.288 +     INSTLIBFLAGS = -m 0644
   2.289 +     INSTINCFLAGS = -m 0444
   2.290 +     INSTMANFLAGS = -m 0444
   2.291 +     INSTDATFLAGS = -m 0444
   2.292 +    INSTKMEMFLAGS = -m 4711
   2.293 +
   2.294 +      PROJECTROOT = /usr/X11R6
   2.295 +
   2.296 +      CDEBUGFLAGS = -O2 -fno-strength-reduce -fno-strict-aliasing
   2.297 +        CCOPTIONS =
   2.298 +
   2.299 +      ALLINCLUDES = $(INCLUDES) $(EXTRA_INCLUDES) $(TOP_INCLUDES) $(INSTALLED_INCLUDES) $(STD_INCLUDES)
   2.300 +       ALLDEFINES = $(ALLINCLUDES) $(STD_DEFINES) $(PROTO_DEFINES) $(THREADS_DEFINES) $(MODULE_DEFINES) $(DEFINES) $(EXTRA_DEFINES)
   2.301 +           CFLAGS = $(CDEBUGFLAGS) $(CCOPTIONS) $(THREADS_CFLAGS) $(MODULE_CFLAGS) $(ALLDEFINES)
   2.302 +        LINTFLAGS = $(LINTOPTS) -DLINT $(ALLDEFINES) $(DEPEND_DEFINES)
   2.303 +         LDPRELIB = -L$(USRLIBDIR) $(INSTALLED_LIBS)
   2.304 +        LDPOSTLIB =
   2.305 +        LDOPTIONS = $(CDEBUGFLAGS) $(CCOPTIONS)  $(EXTRA_LDOPTIONS) $(THREADS_LDFLAGS) $(LOCAL_LDFLAGS) $(LDPRELIBS)
   2.306 +     CXXLDOPTIONS = $(CXXDEBUGFLAGS) $(CXXOPTIONS) $(EXTRA_LDOPTIONS) $(THREADS_CXXLDFLAGS) $(LOCAL_LDFLAGS) $(LDPRELIBS)
   2.307 +
   2.308 +           LDLIBS = $(LDPOSTLIBS) $(THREADS_LIBS) $(SYS_LIBRARIES) $(EXTRA_LIBRARIES)
   2.309 +
   2.310 +           CCLINK = $(CC)
   2.311 +
   2.312 +          CXXLINK = $(CXX)
   2.313 +
   2.314 +     LDSTRIPFLAGS = -x
   2.315 +   LDCOMBINEFLAGS = -r
   2.316 +      DEPENDFLAGS =
   2.317 +   DEPEND_DEFINES =
   2.318 +
   2.319 +# Not sure this belongs here
   2.320 +         TKLIBDIR =
   2.321 +         TKINCDIR =
   2.322 +        TKLIBNAME =
   2.323 +        TKLIBRARY = -L$(TKLIBDIR) -l$(TKLIBNAME)
   2.324 +        TCLLIBDIR =
   2.325 +        TCLINCDIR =
   2.326 +       TCLLIBNAME =
   2.327 +       TCLLIBRARY = -L$(TCLLIBDIR) -l$(TCLLIBNAME)
   2.328 +
   2.329 +        MACROFILE = linux.cf
   2.330 +           RM_CMD = $(RM)
   2.331 +
   2.332 +    IMAKE_DEFINES =
   2.333 +   IMAKE_WARNINGS = -Wundef
   2.334 +
   2.335 +         IRULESRC = $(CONFIGDIR)
   2.336 +        IMAKE_CMD = $(IMAKE) -DUseInstalled -I$(IRULESRC) $(IMAKE_DEFINES) 		    $(IMAKE_WARNINGS)
   2.337 +
   2.338 +     ICONFIGFILES = $(IRULESRC)/Imake.tmpl $(IRULESRC)/X11.tmpl 			$(IRULESRC)/site.def $(IRULESRC)/$(MACROFILE) 			$(IRULESRC)/xfree86.cf $(IRULESRC)/xf86.rules $(IRULESRC)/xorgsite.def $(IRULESRC)/host.def $(EXTRA_ICONFIGFILES)
   2.339 +
   2.340 +# $TOG: Motif.rules /main/4 1998/02/06 10:53:37 kaleb $
   2.341 +
   2.342 +# $Id: LessTif.rules,v 1.2 2000/08/29 21:59:19 dannybackx Exp $
   2.343 +
   2.344 +# $Xorg: X11.rules,v 1.4 2000/08/17 19:41:46 cpqbld Exp $
   2.345 +
   2.346 +# $XFree86: xc/config/cf/X11.rules,v 1.6 2001/01/17 16:22:31 dawes Exp $
   2.347 +
   2.348 +# $TOG: Motif.tmpl /main/5 1998/02/06 10:53:46 kaleb $
   2.349 +
   2.350 +# $Id: LessTif.tmpl.in,v 1.3 2001/03/26 19:12:10 amai Exp $
   2.351 +
   2.352 +# ----------------------------------------------------------------------
   2.353 +# X Window System Build Parameters and Rules
   2.354 +# $XdotOrg: xc/config/cf/X11.tmpl,v 1.35.2.3 2005/02/01 04:07:39 gisburn Exp $
   2.355 +# $Xorg: X11.tmpl,v 1.6 2000/08/17 19:41:46 cpqbld Exp $
   2.356 +#
   2.357 +#
   2.358 +#
   2.359 +#
   2.360 +# $XFree86: xc/config/cf/X11.tmpl,v 1.248 2004/02/16 04:07:37 dawes Exp $
   2.361 +
   2.362 +STICKY_DEFINES = -DHAS_STICKY_DIR_BIT
   2.363 +
   2.364 +FCHOWN_DEFINES = -DHAS_FCHOWN
   2.365 +
   2.366 +# -----------------------------------------------------------------------
   2.367 +# X Window System make variables; these need to be coordinated with rules
   2.368 +
   2.369 +             XTOP = $(TOP)
   2.370 +           BINDIR = /usr/X11R6/bin
   2.371 +     BUILDINCROOT = $(TOP)/exports
   2.372 +      BUILDINCDIR = $(BUILDINCROOT)/include
   2.373 +      BUILDINCTOP = ../..
   2.374 +      BUILDLIBDIR = $(TOP)/exports/lib
   2.375 +      BUILDLIBTOP = ../..
   2.376 +      BUILDBINDIR = $(TOP)/exports/bin
   2.377 +      BUILDBINTOP = ../..
   2.378 +   BUILDMODULEDIR = $(BUILDLIBDIR)/modules
   2.379 +     BUILDI18NDIR = $(BUILDLIBDIR)/locale
   2.380 +   BUILDMODULETOP = $(BUILDLIBTOP)/..
   2.381 +    XBUILDINCROOT = $(XTOP)/exports
   2.382 +     XBUILDINCDIR = $(XBUILDINCROOT)/include/X11
   2.383 +     XBUILDINCTOP = ../../..
   2.384 +     XBUILDBINDIR = $(XBUILDINCROOT)/bin
   2.385 +           INCDIR = $(INCROOT)
   2.386 +           ADMDIR = /usr/adm
   2.387 +           LIBDIR = /usr/X11R6/lib/X11
   2.388 +       LIBEXECDIR = /usr/X11R6/libexec
   2.389 +        MODULEDIR = $(USRLIBDIR)/modules
   2.390 +   TOP_X_INCLUDES =
   2.391 +          XBINDIR = $(PROJECTROOT)/bin
   2.392 +
   2.393 +       INSTSRCDIR = /usr/X11R6/src
   2.394 +
   2.395 +        ETCX11DIR = /etc/X11
   2.396 +
   2.397 +          CONFDIR = $(ETCX11DIR)
   2.398 +
   2.399 +           DOCDIR = $(LIBDIR)/doc
   2.400 +       DOCHTMLDIR = $(DOCDIR)/html
   2.401 +         DOCPSDIR = $(DOCDIR)/PostScript
   2.402 +        DOCPDFDIR = $(DOCDIR)/PDF
   2.403 +          FONTDIR = $(LIBDIR)/fonts
   2.404 +     ENCODINGSDIR = $(FONTDIR)/encodings
   2.405 +         XINITDIR = $(LIBDIR)/xinit
   2.406 +           XDMDIR = $(LIBDIR)/xdm
   2.407 +        XDMVARDIR = $(VARLIBDIR)/xdm
   2.408 +           TWMDIR = $(LIBDIR)/twm
   2.409 +           XSMDIR = $(LIBDIR)/xsm
   2.410 +           NLSDIR = $(LIBDIR)/nls
   2.411 +       XLOCALEDIR = $(LIBDIR)/locale
   2.412 +      LBXPROXYDIR = $(LIBDIR)/lbxproxy
   2.413 +  PROXYMANAGERDIR = $(LIBDIR)/proxymngr
   2.414 +        XPRINTDIR = $(LIBDIR)/xserver
   2.415 +      XAPPLOADDIR = $(LIBDIR)/app-defaults
   2.416 +       FONTCFLAGS = -t
   2.417 +
   2.418 +     INSTAPPFLAGS = $(INSTDATFLAGS)
   2.419 +
   2.420 +              RGB = $(XBINDIR)/rgb
   2.421 +            FONTC = $(XBINDIR)/bdftopcf
   2.422 +      MKFONTSCALE = $(XBINDIR)/mkfontscale
   2.423 +        MKFONTDIR = $(XBINDIR)/mkfontdir
   2.424 +      MKHTMLINDEX = $(XBINDIR)/mkhtmlindex
   2.425 +          UCS2ANY = $(XBINDIR)/ucs2any
   2.426 +      BDFTRUNCATE = $(XBINDIR)/bdftruncate
   2.427 +     UCSMAPPREFIX = $(FONTDIR)/util/map-
   2.428 +       XCURSORGEN = $(XBINDIR)/xcursorgen
   2.429 +
   2.430 +     HTMLINDEXCMD = $(MKHTMLINDEX)
   2.431 +
   2.432 +       DOCUTILSRC = $(XTOP)/doc/util
   2.433 +        CLIENTSRC = $(TOP)/clients
   2.434 +          DEMOSRC = $(TOP)/demos
   2.435 +       XDOCMACROS = $(DOCUTILSRC)/macros.t
   2.436 +       XIDXMACROS = $(DOCUTILSRC)/indexmacros.t
   2.437 +       PROGRAMSRC = $(TOP)/programs
   2.438 +           LIBSRC = $(XTOP)/lib
   2.439 +          FONTSRC = $(XTOP)/fonts
   2.440 +     ENCODINGSSRC = $(FONTSRC)/encodings
   2.441 +       INCLUDESRC = $(BUILDINCROOT)/include
   2.442 +      XINCLUDESRC = $(INCLUDESRC)/X11
   2.443 +        SERVERSRC = $(XTOP)/programs/Xserver
   2.444 +       CONTRIBSRC = $(XTOP)/../contrib
   2.445 +   UNSUPPORTEDSRC = $(XTOP)/unsupported
   2.446 +           DOCSRC = $(XTOP)/doc
   2.447 +           RGBSRC = $(XTOP)/programs/rgb
   2.448 +      BDFTOPCFSRC = $(PROGRAMSRC)/bdftopcf
   2.449 +     MKFONTDIRSRC = $(PROGRAMSRC)/mkfontdir
   2.450 +    FONTSERVERSRC = $(PROGRAMSRC)/xfs
   2.451 +       FONTINCSRC = $(XTOP)/include/fonts
   2.452 +        EXTINCSRC = $(XTOP)/include/extensions
   2.453 +      FTSOURCEDIR = FreeTypeSrcDir
   2.454 +        DRMSRCDIR = $(TOP)/extras/drm
   2.455 +       MESASRCDIR = $(TOP)/extras/Mesa
   2.456 +  OGLSAMPLESRCDIR = $(TOP)/extras/ogl-sample
   2.457 +        PSWRAPSRC = $(XTOP)/config/pswrap
   2.458 +     TRANSCOMMSRC = $(LIBSRC)/xtrans
   2.459 +   TRANS_INCLUDES = -I$(TRANSCOMMSRC)
   2.460 + CONNECTION_FLAGS = -DUNIXCONN -DTCPCONN $(STICKY_DEFINES) $(FCHOWN_DEFINES) -DIPv6
   2.461 +XTRANS_FAILDEFINES = -DFAIL_HARD
   2.462 +
   2.463 +    VENDORMANNAME = X.Org
   2.464 + VENDORMANVERSION = `echo 6 8 2 | sed -e 's/ /./g' -e 's/^/Version\\\ /'`
   2.465 +      XORGMANDEFS = -D__xorgversion__='"$(XORGRELSTRING)" "$(XORGMANNAME)"'
   2.466 +    VENDORMANDEFS = -D__vendorversion__="$(VENDORMANVERSION) $(VENDORMANNAME)"
   2.467 +       VENDORNAME = The X.Org Foundation
   2.468 +  VENDORNAMESHORT = X.Org
   2.469 +
   2.470 + VENDORWEBSUPPORT = http://wiki.X.Org
   2.471 +
   2.472 +VENDORSUPPORTDEFS = -D__VENDORDWEBSUPPORT__='"$(VENDORWEBSUPPORT)"'
   2.473 +
   2.474 +      XKBDEFRULES = xorg
   2.475 +  XKBDEFRULESDEFS = -D__XKBDEFRULES__='"$(XKBDEFRULES)"'
   2.476 +
   2.477 +     XCONFIGFILE = xorg.conf
   2.478 +      XCONFIGDIR = $(LIBDIR)
   2.479 +        XLOGFILE = Xorg
   2.480 +     XSERVERNAME = Xorg
   2.481 +
   2.482 +       XENVLIBDIR = $(USRLIBDIR)
   2.483 +   CLIENTENVSETUP = LD_LIBRARY_PATH=$(MOTIFENVLIBDIR):$(XENVLIBDIR) XLOCALEDIR=$(BUILDLIBDIR)/locale
   2.484 +
   2.485 +# $Xorg: lnxLib.tmpl,v 1.3 2000/08/17 19:41:47 cpqbld Exp $
   2.486 +# $XFree86: xc/config/cf/lnxLib.tmpl,v 3.19 2003/10/15 22:47:48 herrb Exp $
   2.487 +
   2.488 +          XLIBSRC = $(LIBSRC)/X11
   2.489 +
   2.490 +SOXLIBREV = 6.2
   2.491 +DEPXONLYLIB =
   2.492 +XONLYLIB =  -lX11
   2.493 +
   2.494 +LINTXONLY = $(LINTLIBDIR)/llib-lX11.ln
   2.495 +
   2.496 +      DEPXLIBONLY = $(DEPXONLYLIB)
   2.497 +         XLIBONLY = $(XONLYLIB)
   2.498 +     LINTXONLYLIB = $(LINTXONLY)
   2.499 +
   2.500 +      XEXTLIBSRC = $(LIBSRC)/Xext
   2.501 +
   2.502 +SOXEXTREV = 6.4
   2.503 +DEPEXTENSIONLIB =
   2.504 +EXTENSIONLIB =  -lXext
   2.505 +
   2.506 +LINTEXTENSION = $(LINTLIBDIR)/llib-lXext.ln
   2.507 +
   2.508 +LINTEXTENSIONLIB = $(LINTEXTENSION)
   2.509 +          DEPXLIB = $(DEPEXTENSIONLIB) $(DEPXONLYLIB)
   2.510 +             XLIB = $(EXTENSIONLIB) $(XONLYLIB)
   2.511 +         LINTXLIB = $(LINTXONLYLIB)
   2.512 +
   2.513 +    XSSLIBSRC = $(LIBSRC)/Xss
   2.514 +
   2.515 +SOXSSREV = 1.0
   2.516 +DEPXSSLIB =
   2.517 +XSSLIB =  -lXss
   2.518 +
   2.519 +LINTXSS = $(LINTLIBDIR)/llib-lXss.ln
   2.520 +
   2.521 +    XXF86MISCLIBSRC = $(LIBSRC)/Xxf86misc
   2.522 +
   2.523 +SOXXF86MISCREV = 1.1
   2.524 +DEPXXF86MISCLIB =
   2.525 +XXF86MISCLIB =  -lXxf86misc
   2.526 +
   2.527 +LINTXXF86MISC = $(LINTLIBDIR)/llib-lXxf86misc.ln
   2.528 +
   2.529 +    XXF86VMLIBSRC = $(LIBSRC)/Xxf86vm
   2.530 +
   2.531 +SOXXF86VMREV = 1.0
   2.532 +DEPXXF86VMLIB =
   2.533 +XXF86VMLIB =  -lXxf86vm
   2.534 +
   2.535 +LINTXXF86VM = $(LINTLIBDIR)/llib-lXxf86vm.ln
   2.536 +
   2.537 +    XXF86DGALIBSRC = $(LIBSRC)/Xxf86dga
   2.538 +
   2.539 +SOXXF86DGAREV = 1.0
   2.540 +DEPXXF86DGALIB =
   2.541 +XXF86DGALIB =  -lXxf86dga
   2.542 +
   2.543 +LINTXXF86DGA = $(LINTLIBDIR)/llib-lXxf86dga.ln
   2.544 +
   2.545 +    XXF86RUSHLIBSRC = $(LIBSRC)/Xxf86rush
   2.546 +
   2.547 +SOXXF86RUSHREV = 1.0
   2.548 +DEPXXF86RUSHLIB =
   2.549 +XXF86RUSHLIB =  -lXxf86rush
   2.550 +
   2.551 +LINTXXF86RUSH = $(LINTLIBDIR)/llib-lXxf86rush.ln
   2.552 +
   2.553 +    XVLIBSRC = $(LIBSRC)/Xv
   2.554 +
   2.555 +SOXVREV = 1.0
   2.556 +DEPXVLIB =
   2.557 +XVLIB =  -lXv
   2.558 +
   2.559 +LINTXV = $(LINTLIBDIR)/llib-lXv.ln
   2.560 +
   2.561 +    XVMCLIBSRC = $(LIBSRC)/XvMC
   2.562 +
   2.563 +SOXVMCREV = 1.0
   2.564 +DEPXVMCLIB =
   2.565 +XVMCLIB =  -lXvMC
   2.566 +
   2.567 +LINTXVMC = $(LINTLIBDIR)/llib-lXvMC.ln
   2.568 +
   2.569 +    XINERAMALIBSRC = $(LIBSRC)/Xinerama
   2.570 +
   2.571 +SOXINERAMAREV = 1.0
   2.572 +DEPXINERAMALIB =
   2.573 +XINERAMALIB =  -lXinerama
   2.574 +
   2.575 +LINTXINERAMA = $(LINTLIBDIR)/llib-lXinerama.ln
   2.576 +
   2.577 +    XRESLIBSRC = $(LIBSRC)/XRes
   2.578 +
   2.579 +SOXRESREV = 1.0
   2.580 +DEPXRESLIB =
   2.581 +XRESLIB =  -lXRes
   2.582 +
   2.583 +LINTXRES = $(LINTLIBDIR)/llib-lXRes.ln
   2.584 +
   2.585 +    DMXLIBSRC = $(LIBSRC)/dmx
   2.586 +
   2.587 +DEPDMXLIB = $(USRLIBDIR)/libdmx.a
   2.588 +DMXLIB =  -ldmx
   2.589 +
   2.590 +LINTDMX = $(LINTLIBDIR)/llib-ldmx.ln
   2.591 +
   2.592 +    DPSLIBSRC = $(LIBSRC)/dps
   2.593 +
   2.594 +SODPSREV = 1.0
   2.595 +DEPDPSLIB =
   2.596 +DPSLIB =  -ldps
   2.597 +
   2.598 +LINTDPS = $(LINTLIBDIR)/llib-ldps.ln
   2.599 +
   2.600 +    DPSTKLIBSRC = $(LIBSRC)/dpstk
   2.601 +
   2.602 +SODPSTKREV = 1.0
   2.603 +DEPDPSTKLIB =
   2.604 +DPSTKLIB =  -ldpstk
   2.605 +
   2.606 +LINTDPSTK = $(LINTLIBDIR)/llib-ldpstk.ln
   2.607 +
   2.608 +    PSRESLIBSRC = $(LIBSRC)/psres
   2.609 +
   2.610 +SOPSRESREV = 1.0
   2.611 +DEPPSRESLIB =
   2.612 +PSRESLIB =  -lpsres
   2.613 +
   2.614 +LINTPSRES = $(LINTLIBDIR)/llib-lpsres.ln
   2.615 +
   2.616 +    GLULIBSRC = $(LIBSRC)/GLU
   2.617 +
   2.618 +SOGLUREV = 1.3
   2.619 +DEPGLULIB =
   2.620 +GLULIB =  -lGLU
   2.621 +
   2.622 +LINTGLU = $(LINTLIBDIR)/llib-lGLU.ln
   2.623 +
   2.624 +    GLXLIBSRC = $(LIBSRC)/GL
   2.625 +
   2.626 +SOGLREV = 1.2
   2.627 +DEPGLXLIB =
   2.628 +GLXLIB =  -lGL
   2.629 +
   2.630 +LINTGLX = $(LINTLIBDIR)/llib-lGL.ln
   2.631 +
   2.632 +    GLWIDGETSRC = $(LIBSRC)/GLw
   2.633 +
   2.634 +SOGLWREV = 1.0
   2.635 +DEPGLWLIB =
   2.636 +GLWLIB =  -lGLw
   2.637 +
   2.638 +LINTGLW = $(LINTLIBDIR)/llib-lGLw.ln
   2.639 +
   2.640 +    XRENDERLIBSRC = $(LIBSRC)/Xrender
   2.641 +
   2.642 +SOXRENDERREV = 1.2.2
   2.643 +DEPXRENDERLIB =
   2.644 +XRENDERLIB =  -lXrender
   2.645 +
   2.646 +LINTXRENDER = $(LINTLIBDIR)/llib-lXrender.ln
   2.647 +
   2.648 +    XRANDRLIBSRC = $(LIBSRC)/Xrandr
   2.649 +
   2.650 +SOXRANDRREV = 2.0
   2.651 +DEPXRANDRLIB =
   2.652 +XRANDRLIB =  -lXrandr
   2.653 +
   2.654 +LINTXRANDR = $(LINTLIBDIR)/llib-lXrandr.ln
   2.655 +
   2.656 +    XFIXESLIBSRC = $(LIBSRC)/Xfixes
   2.657 +
   2.658 +SOXFIXESREV = 3.0
   2.659 +DEPXFIXESLIB =
   2.660 +XFIXESLIB =  -lXfixes
   2.661 +
   2.662 +LINTXFIXES = $(LINTLIBDIR)/llib-lXfixes.ln
   2.663 +
   2.664 +   XDAMAGELIBSRC = $(LIBSRC)/Xdamage
   2.665 +
   2.666 +SOXDAMAGEREV = 1.0
   2.667 +DEPXDAMAGELIB =
   2.668 +XDAMAGELIB =  -lXdamage
   2.669 +
   2.670 +LINTXDAMAGE = $(LINTLIBDIR)/llib-lXdamage.ln
   2.671 +
   2.672 +XCOMPOSITELIBSRC = $(LIBSRC)/Xcomposite
   2.673 +
   2.674 +SOXCOMPOSITEREV = 1.0
   2.675 +DEPXCOMPOSITELIB =
   2.676 +XCOMPOSITELIB =  -lXcomposite
   2.677 +
   2.678 +LINTXCOMPOSITE = $(LINTLIBDIR)/llib-lXcomposite.ln
   2.679 +
   2.680 +XEVIELIBSRC = $(LIBSRC)/Xevie
   2.681 +
   2.682 +SOXEVIEREV = 1.0
   2.683 +DEPXEVIELIB =
   2.684 +XEVIELIB =  -lXevie
   2.685 +
   2.686 +LINTXEVIE = $(LINTLIBDIR)/llib-lXevie.ln
   2.687 +
   2.688 +   XCURSORLIBSRC = $(LIBSRC)/Xcursor
   2.689 +
   2.690 +SOXCURSORREV = 1.0.2
   2.691 +DEPXCURSORLIB =
   2.692 +XCURSORLIB =  -lXcursor
   2.693 +
   2.694 +LINTXCURSOR = $(LINTLIBDIR)/llib-lXcursor.ln
   2.695 +
   2.696 +   APPLEWMLIBSRC = $(LIBSRC)/apple
   2.697 +
   2.698 +DEPAPPLEWMLIB = $(USRLIBDIR)/libAppleWM.a
   2.699 +APPLEWMLIB =  -lAppleWM
   2.700 +
   2.701 +LINTAPPLEWM = $(LINTLIBDIR)/llib-lAppleWM.ln
   2.702 +
   2.703 +   WINDOWSWMLIBSRC = $(LIBSRC)/windows
   2.704 +
   2.705 +DEPWINDOWSWMLIB = $(USRLIBDIR)/libWindowsWM.a
   2.706 +WINDOWSWMLIB =  -lWindowsWM
   2.707 +
   2.708 +LINTWINDOWSWM = $(LINTLIBDIR)/llib-lWindowsWM.ln
   2.709 +
   2.710 +    XFONTCACHELIBSRC = $(LIBSRC)/Xfontcache
   2.711 +
   2.712 +SOXFONTCACHEREV = 1.2
   2.713 +DEPXFONTCACHELIB =
   2.714 +XFONTCACHELIB =  -lXfontcache
   2.715 +
   2.716 +LINTXFONTCACHE = $(LINTLIBDIR)/llib-lXfontcache.ln
   2.717 +
   2.718 +         XAUTHSRC = $(LIBSRC)/Xau
   2.719 +
   2.720 +DEPXAUTHLIB = $(USRLIBDIR)/libXau.a
   2.721 +XAUTHLIB =  -lXau
   2.722 +
   2.723 +LINTXAUTH = $(LINTLIBDIR)/llib-lXau.ln
   2.724 +
   2.725 +      XDMCPLIBSRC = $(LIBSRC)/Xdmcp
   2.726 +
   2.727 +DEPXDMCPLIB = $(USRLIBDIR)/libXdmcp.a
   2.728 +XDMCPLIB =  -lXdmcp
   2.729 +
   2.730 +LINTXDMCP = $(LINTLIBDIR)/llib-lXdmcp.ln
   2.731 +
   2.732 +           XMUSRC = $(LIBSRC)/Xmu
   2.733 +
   2.734 +SOXMUREV = 6.2
   2.735 +DEPXMULIB =
   2.736 +XMULIB =  -lXmu
   2.737 +
   2.738 +LINTXMU = $(LINTLIBDIR)/llib-lXmu.ln
   2.739 +
   2.740 +           XMUUSRC = $(LIBSRC)/Xmuu
   2.741 +
   2.742 +SOXMUUREV = 1.0
   2.743 +DEPXMUULIB =
   2.744 +XMUULIB =  -lXmuu
   2.745 +
   2.746 +LINTXMUU = $(LINTLIBDIR)/llib-lXmuu.ln
   2.747 +
   2.748 +       OLDXLIBSRC = $(LIBSRC)/oldX
   2.749 +
   2.750 +DEPOLDXLIB = $(USRLIBDIR)/liboldX.a
   2.751 +OLDXLIB =  -loldX
   2.752 +
   2.753 +LINTOLDX = $(LINTLIBDIR)/llib-loldX.ln
   2.754 +
   2.755 +         XPLIBSRC = $(LIBSRC)/Xp
   2.756 +
   2.757 +SOXPREV = 6.2
   2.758 +DEPXPLIB =
   2.759 +XPLIB =  -lXp
   2.760 +
   2.761 +LINTXP = $(LINTLIBDIR)/llib-lXp.ln
   2.762 +
   2.763 +       TOOLKITSRC = $(LIBSRC)/Xt
   2.764 +
   2.765 +SOXTREV = 6.0
   2.766 +DEPXTOOLONLYLIB =
   2.767 +XTOOLONLYLIB =  -lXt
   2.768 +
   2.769 +LINTXTOOLONLY = $(LINTLIBDIR)/llib-lXt.ln
   2.770 +
   2.771 +      DEPXTOOLLIB = $(DEPXTOOLONLYLIB) $(DEPSMLIB) $(DEPICELIB)
   2.772 +         XTOOLLIB = $(XTOOLONLYLIB) $(SMLIB) $(ICELIB)
   2.773 +     LINTXTOOLLIB = $(LINTXTOOLONLYLIB)
   2.774 +
   2.775 +       XALIBSRC = $(LIBSRC)/Xa
   2.776 +
   2.777 +SOXAREV = 1.0
   2.778 +DEPXALIB =
   2.779 +XALIB =  -lXa
   2.780 +
   2.781 +LINTXA = $(LINTLIBDIR)/llib-lXa.ln
   2.782 +
   2.783 +       AWIDGETSRC = $(LIBSRC)/Xaw
   2.784 +
   2.785 +SOXAWREV = 8.0
   2.786 +DEPXAWLIB =
   2.787 +XAWLIB =  -lXaw
   2.788 +
   2.789 +LINTXAW = $(LINTLIBDIR)/llib-lXaw.ln
   2.790 +
   2.791 +       AWIDGET7SRC = $(LIBSRC)/Xaw7
   2.792 +
   2.793 +SOXAW7REV = 7.0
   2.794 +DEPXAW7LIB =
   2.795 +XAW7LIB =  -lXaw
   2.796 +
   2.797 +LINTXAW7 = $(LINTLIBDIR)/llib-lXaw.ln
   2.798 +
   2.799 +       AWIDGET6SRC = $(LIBSRC)/Xaw6
   2.800 +
   2.801 +SOXAW6REV = 6.1
   2.802 +DEPXAW6LIB =
   2.803 +XAW6LIB =  -lXaw
   2.804 +
   2.805 +LINTXAW6 = $(LINTLIBDIR)/llib-lXaw.ln
   2.806 +
   2.807 +         XILIBSRC = $(LIBSRC)/Xi
   2.808 +
   2.809 +SOXINPUTREV = 6.0
   2.810 +DEPXILIB =
   2.811 +XILIB =  -lXi
   2.812 +
   2.813 +LINTXI = $(LINTLIBDIR)/llib-lXi.ln
   2.814 +
   2.815 +      XTESTLIBSRC = $(LIBSRC)/Xtst
   2.816 +
   2.817 +SOXTESTREV = 6.1
   2.818 +DEPXTESTLIB =
   2.819 +XTESTLIB =  -lXtst
   2.820 +
   2.821 +LINTXTEST = $(LINTLIBDIR)/llib-lXtst.ln
   2.822 +
   2.823 +DEPXBSDLIB = $(USRLIBDIR)/libXbsd.a
   2.824 +XBSDLIB =  -lXbsd
   2.825 +
   2.826 +LINTXBSD = $(LINTLIBDIR)/llib-lXbsd.ln
   2.827 +
   2.828 +           ICESRC = $(LIBSRC)/ICE
   2.829 +
   2.830 +SOICEREV = 6.3
   2.831 +DEPICELIB =
   2.832 +ICELIB =  -lICE
   2.833 +
   2.834 +LINTICE = $(LINTLIBDIR)/llib-lICE.ln
   2.835 +
   2.836 +            SMSRC = $(LIBSRC)/SM
   2.837 +
   2.838 +SOSMREV = 6.0
   2.839 +DEPSMLIB =
   2.840 +SMLIB =  -lSM
   2.841 +
   2.842 +LINTSM = $(LINTLIBDIR)/llib-lSM.ln
   2.843 +
   2.844 +           XKEYSRC = $(LIBSRC)/Xkey
   2.845 +
   2.846 +SOXKEYREV = 6.0
   2.847 +DEPXKEYLIB =
   2.848 +XKEYLIB =  -lXkey
   2.849 +
   2.850 +LINTXKEY = $(LINTLIBDIR)/llib-lXkey.ln
   2.851 +
   2.852 +         FSLIBSRC = $(LIBSRC)/FS
   2.853 +
   2.854 +SOFSREV = 6.0
   2.855 +DEPFSLIB =
   2.856 +FSLIB =  -lFS
   2.857 +
   2.858 +LINTFS = $(LINTLIBDIR)/llib-lFS.ln
   2.859 +
   2.860 +         FONTLIBSRC = $(LIBSRC)/font
   2.861 +
   2.862 +SOFONTREV = 1.5
   2.863 +DEPFONTLIB =
   2.864 +FONTLIB = -L$(FREETYPELIBDIR) -L$(FONTLIBSRC)  -lXfont
   2.865 +
   2.866 +LINTXFONT = $(LINTLIBDIR)/llib-lXfont.ln
   2.867 +#
   2.868 +SOFONTREV = 1.5
   2.869 +DEPXFONTLIB =
   2.870 +XFONTLIB =  -lXfont
   2.871 +
   2.872 +LINTXFONT = $(LINTLIBDIR)/llib-lXfont.ln
   2.873 +
   2.874 +     FONTSTUBLIBSRC = $(FONTLIBSRC)/stubs
   2.875 +
   2.876 +DEPFONTSTUBLIB = $(USRLIBDIR)/libfntstubs.a
   2.877 +FONTSTUBLIB =  -lfntstubs
   2.878 +
   2.879 +LINTFONTSTUB = $(LINTLIBDIR)/llib-lfntstubs.ln
   2.880 +         DEPFONTLIB = $(DEPXFONTLIB) $(DEPFONTSTUBLIB)
   2.881 +            FONTLIB = $(XFONTLIB) $(FONTSTUBLIB) $(FREETYPE2LIB)
   2.882 +
   2.883 +         FONTENCLIBSRC = $(LIBSRC)/fontenc
   2.884 +
   2.885 +SOFONTENCREV = 1.0
   2.886 +DEPXFONTENCLIB =
   2.887 +XFONTENCLIB =  -lfontenc
   2.888 +
   2.889 +LINTXFONTENC = $(LINTLIBDIR)/llib-lfontenc.ln
   2.890 +
   2.891 +          XPMLIBSRC = $(LIBSRC)/Xpm
   2.892 +
   2.893 +SOXPMREV = 4.11
   2.894 +DEPXPMLIB =
   2.895 +XPMLIB =  -lXpm
   2.896 +
   2.897 +LINTXPM = $(LINTLIBDIR)/llib-lXpm.ln
   2.898 +
   2.899 +FREETYPE2DIR = /usr
   2.900 +FREETYPE2LIBDIR = /usr/lib
   2.901 +FREETYPE2INCDIR = /usr/include
   2.902 +
   2.903 +FREETYPE2LIB = -lfreetype
   2.904 +
   2.905 +FREETYPE2INCLUDES = -I$(FREETYPE2INCDIR)/freetype2 -I$(FREETYPE2INCDIR)/freetype2/config
   2.906 +
   2.907 +FREETYPE2DEFINES = -DFREETYPE2
   2.908 +
   2.909 +          EXPATLIBSRC = $(LIBSRC)/expat
   2.910 +
   2.911 +SOEXPATREV = 0.4
   2.912 +DEPEXPATLIB =
   2.913 +EXPATLIB =  -lexpat
   2.914 +
   2.915 +LINTEXPAT = $(LINTLIBDIR)/llib-lexpat.ln
   2.916 +
   2.917 +EXPATDIR = /usr
   2.918 +EXPATLIBDIR = /usr/lib
   2.919 +EXPATINCDIR = /usr/include
   2.920 +
   2.921 +EXPATINCLUDES =
   2.922 +
   2.923 +EXPATLIB = -lexpat
   2.924 +
   2.925 +EXPATDEFINES = -DEXPAT
   2.926 +
   2.927 +          XFT1LIBSRC = $(LIBSRC)/Xft1
   2.928 +
   2.929 +SOXFT1REV = 1.1
   2.930 +DEPXFT1LIB =
   2.931 +XFT1LIB =  -lXft
   2.932 +
   2.933 +LINTXFT1 = $(LINTLIBDIR)/llib-lXft.ln
   2.934 +
   2.935 +          XFTLIBSRC = $(LIBSRC)/Xft
   2.936 +
   2.937 +SOXFTREV = 2.1.2
   2.938 +DEPXFTLIB =
   2.939 +XFTLIB =  -lXft
   2.940 +
   2.941 +LINTXFT = $(LINTLIBDIR)/llib-lXft.ln
   2.942 +
   2.943 +          FONTCONFIGLIBSRC = $(LIBSRC)/fontconfig
   2.944 +
   2.945 +SOFONTCONFIGREV = 1.0.4
   2.946 +DEPFONTCONFIGLIB =
   2.947 +FONTCONFIGLIB =  -lfontconfig
   2.948 +
   2.949 +LINTFONTCONFIG = $(LINTLIBDIR)/llib-lfontconfig.ln
   2.950 +
   2.951 +FONTCONFIGINCDIR=$(INCDIR)
   2.952 +
   2.953 +FONTCONFIGINCLUDES = -I$(FONTCONFIGINCDIR)
   2.954 +
   2.955 +FCCACHE = $(BINDIR)/fc-cache
   2.956 +
   2.957 +FONTCONFIGDEFINES = -DFONTCONFIG
   2.958 +
   2.959 +XFTINCLUDES=$(FONTCONFIGINCLUDES) $(FREETYPE2INCLUDES)
   2.960 +
   2.961 +LIBPNGINCDIR = /usr/include
   2.962 +
   2.963 +LIBPNGINC=
   2.964 +
   2.965 +LIBPNGDIR = /usr
   2.966 +LIBPNGLIBDIR = /usr/lib
   2.967 +LIBPNGINCDIR = /usr/include
   2.968 +
   2.969 +LIBPNGLIB = -lpng
   2.970 +
   2.971 +    XKBFILELIBSRC = $(LIBSRC)/xkbfile
   2.972 +
   2.973 +SOXKBFILEREV =  1.0
   2.974 +DEPXKBFILELIB =
   2.975 +XKBFILELIB =  -lxkbfile
   2.976 +
   2.977 +LINTXKBFILE = $(LINTLIBDIR)/llib-lxkbfile.ln
   2.978 +
   2.979 +     XKBCOMPCMD = $(XBINDIR)/xkbcomp
   2.980 +
   2.981 +    XKBUILIBSRC = $(LIBSRC)/xkbui
   2.982 +
   2.983 +SOXKBUIREV =  1.0
   2.984 +DEPXKBUILIB =
   2.985 +XKBUILIB =  -lxkbui
   2.986 +
   2.987 +LINTXKBUI = $(LINTLIBDIR)/llib-lxkbui.ln
   2.988 +
   2.989 +EXTRAXAWREQS = $(XPLIB)
   2.990 +
   2.991 +EXTRAXAWCLIENTDEPLIBS = $(DEPXPLIB)
   2.992 +
   2.993 +EXTRAXAWCLIENTLIBS = $(XPLIB)
   2.994 +
   2.995 +        XTRAPLIBSRC = $(LIBSRC)/XTrap
   2.996 +
   2.997 +SOXTRAPREV = 6.4
   2.998 +DEPXTRAPLIB =
   2.999 +XTRAPLIB =  -lXTrap
  2.1000 +
  2.1001 +LINTXTRAP = $(LINTLIBDIR)/llib-lXTrap.ln
  2.1002 +
  2.1003 +          DEPLIBS = $(DEPXAWLIB) $(DEPXMULIB) $(DEPXTOOLLIB) $(DEPXLIB)
  2.1004 +
  2.1005 +         DEPLIBS1 = $(DEPLIBS)
  2.1006 +         DEPLIBS2 = $(DEPLIBS)
  2.1007 +         DEPLIBS3 = $(DEPLIBS)
  2.1008 +         DEPLIBS4 = $(DEPLIBS)
  2.1009 +         DEPLIBS5 = $(DEPLIBS)
  2.1010 +         DEPLIBS6 = $(DEPLIBS)
  2.1011 +         DEPLIBS7 = $(DEPLIBS)
  2.1012 +         DEPLIBS8 = $(DEPLIBS)
  2.1013 +         DEPLIBS9 = $(DEPLIBS)
  2.1014 +         DEPLIBS10 = $(DEPLIBS)
  2.1015 +
  2.1016 +       FCPRELOADPATTERN = libfontconfig.so.?
  2.1017 +
  2.1018 +      XFTPRELOADPATTERN = libXft.so.?
  2.1019 +  XRENDERPRELOADPATTERN = libXrender.so.?
  2.1020 +    XFONTPRELOADPATTERN = libXfont*.so.?
  2.1021 +
  2.1022 +              MTOP = $(TOP)
  2.1023 +TOP_MOTIF_INCLUDES =
  2.1024 +
  2.1025 +      UIL_INCLUDES = -I$(USRINCDIR)/uil
  2.1026 +
  2.1027 +    MOTIFENVLIBDIR = $(USRLIBDIR)
  2.1028 +
  2.1029 +      USRINCDIR = /usr/X11R6/include
  2.1030 +         UIDDIR = $(LIBDIR)/uid
  2.1031 +        TESTSRC = $(MTOP)/tests
  2.1032 +        TESTLIB = $(TESTSRC)/lib
  2.1033 +  GENERALSRCLIB = $(TESTSRC)/General/lib
  2.1034 +  GENERALSRCBIN = $(TESTSRC)/General/bin
  2.1035 +   MANUALSRCLIB = $(TESTSRC)/Manual/lib
  2.1036 +   MANUALSRCBIN = $(TESTSRC)/Manual/bin
  2.1037 +     AUTOSRCLIB = $(TESTSRC)/Auto/lib
  2.1038 +     AUTOSRCBIN = $(TESTSRC)/Auto/bin
  2.1039 +       COMMONPP = $(GENERALSRCBIN)/Commonpp
  2.1040 +         GENRUN = $(GENERALSRCBIN)/Genrun
  2.1041 +         MANRUN = $(GENERALSRCBIN)/Manrun
  2.1042 +
  2.1043 +     TESTCOMSRC = $(MANUALSRCLIB)/Common
  2.1044 +
  2.1045 +    BUILDDOCDIR = $(BUILDINCROOT)/doc
  2.1046 +    BUILDLOCDIR = $(BUILDINCROOT)/localized
  2.1047 +
  2.1048 +    MTOOLKITSRC = $(TOOLKITSRC)
  2.1049 +
  2.1050 +    MINCLUDESRC = $(MTOP)/include
  2.1051 +        MDOCSRC = $(MTOP)/doc
  2.1052 +        MLOCSRC = $(MTOP)/localized
  2.1053 +
  2.1054 +        MLIBSRC = $(MTOP)/lib
  2.1055 +     MCLIENTSRC = $(MTOP)/clients
  2.1056 +       MDEMOSRC = $(MTOP)/demos
  2.1057 +     MWIDGETSRC = $(MLIBSRC)/Xm
  2.1058 +   MRESOURCESRC = $(MLIBSRC)/Mrm
  2.1059 +         UILSRC = $(MCLIENTSRC)/uil
  2.1060 +
  2.1061 +            UIL = uil
  2.1062 +         DEPUIL = $(BINDIR)/uil
  2.1063 +
  2.1064 +   XMEXTRA_LIBS =
  2.1065 +
  2.1066 +SOXMREV = 2.1
  2.1067 +DEPXMLIB =
  2.1068 +XMLIB =  -lXm
  2.1069 +
  2.1070 +LINTXM = $(LINTLIBDIR)/llib-lXm.ln
  2.1071 +
  2.1072 +SOMRMREV = 2.1
  2.1073 +DEPMRESOURCELIB =
  2.1074 +MRESOURCELIB =  -lMrm
  2.1075 +
  2.1076 +LINTMRESOURCE = $(LINTLIBDIR)/llib-lMrm.ln
  2.1077 +
  2.1078 +SOUILREV = 2.1
  2.1079 +DEPUILLIB =
  2.1080 +UILLIB =  -lUil
  2.1081 +
  2.1082 +LINTUIL = $(LINTLIBDIR)/llib-lUil.ln
  2.1083 +
  2.1084 +SOMCOMMONREV = 2.1
  2.1085 +DEPTESTCOMLIB =
  2.1086 +TESTCOMLIB =  -lMCommon
  2.1087 +
  2.1088 +LINTTESTCOM = $(LINTLIBDIR)/llib-lMCommon.ln
  2.1089 +
  2.1090 +TESTUILCOMLIB = $(TESTCOMSRC)/libMCommonUil.a
  2.1091 +
  2.1092 +  LINTMRESOURCE = $(MRESOURCESRC)/libMrm.a
  2.1093 +LINTXMWIDGETLIB = $(MWIDGETSRC)/llib-l/Xm.ln
  2.1094 +     LINTXMTOOL = $(MTOOLKITSRC)/llib-lXt.ln
  2.1095 +     LINTUILLIB = $(UILSRC)/llib-lUil.ln
  2.1096 +
  2.1097 +      YACCFLAGS =
  2.1098 +       UILFLAGS =
  2.1099 +    GENCATFLAGS =
  2.1100 +         GENCAT = gencat $(GENCATFLAGS)
  2.1101 +      MKCATTOOL = $(MLOCSRC)/util/mkcatdefs
  2.1102 +
  2.1103 +         RM_CMD = $(RM) *.CKP *.ln *.BAK *.bak *.o core errs ,* *~ *.a .emacs_* tags TAGS make.log MakeOut  *.Dat
  2.1104 +
  2.1105 +        DEPLIBS = $(DEPXMLIB) $(DEPXTOOLLIB) $(DEPXPLIB) $(DEPXLIB)
  2.1106 +
  2.1107 +        DEPLIBS1 = $(DEPLIBS)
  2.1108 +        DEPLIBS2 = $(DEPLIBS)
  2.1109 +        DEPLIBS3 = $(DEPLIBS)
  2.1110 +
  2.1111 +XMULIBONLY = -lXmu
  2.1112 +XMULIB = $(XMULIBONLY) $(XTOOLLIB) $(XLIB)
  2.1113 +
  2.1114 +        CONFIGDIR = $(LIBDIR)/config
  2.1115 +
  2.1116 +    USRLIBDIRPATH = $(USRLIBDIR)
  2.1117 +        LDPRELIBS =  -L$(USRLIBDIR)  $(INSTALLED_LIBS)
  2.1118 +       LDPOSTLIBS =
  2.1119 +     TOP_INCLUDES = $(TOP_MOTIF_INCLUDES) -I$(INCROOT) $(TOP_X_INCLUDES)
  2.1120 +  PROJECT_DEFINES =   -DNO_MESSAGE_CATALOG
  2.1121 +   VENDOR_DEFINES = -DXVENDORNAME='"$(VENDORNAME)"' -DXVENDORNAMESHORT='"$(VENDORNAMESHORT)"'
  2.1122 +
  2.1123 +CXXPROJECT_DEFINES =   -DNO_MESSAGE_CATALOG
  2.1124 +
  2.1125 +# ----------------------------------------------------------------------
  2.1126 +# start of Imakefile
  2.1127 +
  2.1128 +DEPLIBS = $(DEPXTESTLIB) $(DEPEXTENSIONLIB) $(DEPXLIB)
  2.1129 +LOCAL_LIBRARIES = $(XTESTLIB) $(EXTENSIONLIB) $(XLIB)
  2.1130 +
  2.1131 +SRCS = keynav.c
  2.1132 +OBJS = keynav.o
  2.1133 +
  2.1134 +CC = gcc
  2.1135 +
  2.1136 +        PROGRAM = keynav
  2.1137 +
  2.1138 +all:: keynav
  2.1139 +
  2.1140 +keynav: $(OBJS) $(DEPLIBS)
  2.1141 +	$(RM) $@
  2.1142 +	$(CCLINK) -o $@ $(LDOPTIONS) $(OBJS) $(LOCAL_LIBRARIES) $(LDLIBS)  $(EXTRA_LOAD_FLAGS)
  2.1143 +
  2.1144 +install:: keynav
  2.1145 +	@if [ -d $(DESTDIR)$(BINDIR) ]; then \
  2.1146 +		set +x; \
  2.1147 +	else \
  2.1148 +		if [ -h $(DESTDIR)$(BINDIR) ]; then \
  2.1149 +			(set -x; rm -f $(DESTDIR)$(BINDIR)); \
  2.1150 +		fi; \
  2.1151 +		(set -x; $(MKDIRHIER) $(DESTDIR)$(BINDIR)); \
  2.1152 +	fi
  2.1153 +	$(INSTALL) $(INSTALLFLAGS) $(INSTPGMFLAGS)  keynav $(DESTDIR)$(BINDIR)/keynav
  2.1154 +
  2.1155 +all:: keynav.$(MANSUFFIX).html
  2.1156 +
  2.1157 +keynav.$(MANSUFFIX).html: keynav.$(MANNEWSUFFIX)
  2.1158 +	$(RM) keynav.$(MANSUFFIX).html keynav.$(MANSUFFIX)-html
  2.1159 +	$(RMAN) $(RMANOPTIONS) < keynav.$(MANNEWSUFFIX) \
  2.1160 +	  > keynav.$(MANSUFFIX)-html && $(MV) keynav.$(MANSUFFIX)-html $@
  2.1161 +
  2.1162 +install.man:: keynav.$(MANSUFFIX).html
  2.1163 +	@if [ -d $(DESTDIR)$(DOCHTMLDIR) ]; then \
  2.1164 +		set +x; \
  2.1165 +	else \
  2.1166 +		if [ -h $(DESTDIR)$(DOCHTMLDIR) ]; then \
  2.1167 +			(set -x; rm -f $(DESTDIR)$(DOCHTMLDIR)); \
  2.1168 +		fi; \
  2.1169 +		(set -x; $(MKDIRHIER) $(DESTDIR)$(DOCHTMLDIR)); \
  2.1170 +	fi
  2.1171 +	@(SUF=`expr $(MANSUFFIX) \: '\(.\)'`; \
  2.1172 +	 set -x; \
  2.1173 +	 $(INSTALL) $(INSTALLFLAGS) $(INSTMANFLAGS) keynav.$(MANSUFFIX).html $(DESTDIR)$(DOCHTMLDIR)/keynav.$$SUF.html)
  2.1174 +
  2.1175 +cleandir::
  2.1176 +	$(RM) keynav.$(MANSUFFIX).html keynav.$(MANSUFFIX)-html
  2.1177 +
  2.1178 +all:: keynav.$(MANNEWSUFFIX)
  2.1179 +
  2.1180 +keynav.$(MANNEWSUFFIX): keynav.$(MANSRCSUFFIX)
  2.1181 +	$(RM) $@
  2.1182 +	if test -z "$(PREPROCESSMANPAGES)" ; then \
  2.1183 +	   cd `dirname keynav` && \
  2.1184 +	   $(LN) `basename keynav.$(MANSRCSUFFIX)` `basename $@`; \
  2.1185 +	else \
  2.1186 +	      	     $(RAWCPP)  $(MANDEFS) $(EXTRAMANDEFS) \
  2.1187 +	     < keynav.$(MANSRCSUFFIX) | sed -e '/^#  *[0-9][0-9]*  *.*$$/d' 			-e '/^#line  *[0-9][0-9]*  *.*$$/d' 			-e '/^[ 	]*XCOMM$$/s/XCOMM/#/' 			-e '/^[ 	]*XCOMM[^a-zA-Z0-9_]/s/XCOMM/#/' 			-e '/^[ 	]*XHASH/s/XHASH/#/' 			-e '/\@\@$$/s/\@\@$$/\\/' >$@; \
  2.1188 +	fi
  2.1189 +
  2.1190 +cleandir::
  2.1191 +	$(RM) keynav.$(MANNEWSUFFIX)
  2.1192 +
  2.1193 +install.man:: keynav.$(MANNEWSUFFIX)
  2.1194 +	@if [ -d $(DESTDIR)$(MANDIR) ]; then \
  2.1195 +		set +x; \
  2.1196 +	else \
  2.1197 +		if [ -h $(DESTDIR)$(MANDIR) ]; then \
  2.1198 +			(set -x; rm -f $(DESTDIR)$(MANDIR)); \
  2.1199 +		fi; \
  2.1200 +		(set -x; $(MKDIRHIER) $(DESTDIR)$(MANDIR)); \
  2.1201 +	fi
  2.1202 +	$(INSTALL) $(INSTALLFLAGS) $(INSTMANFLAGS) keynav.$(MANNEWSUFFIX) $(DESTDIR)$(MANDIR)/keynav.$(MANSUFFIX)
  2.1203 +
  2.1204 +depend::
  2.1205 +	$(DEPEND) $(DEPENDFLAGS) -- $(ALLDEFINES) $(DEPEND_DEFINES) -- $(SRCS)
  2.1206 +
  2.1207 +lint:
  2.1208 +	$(LINT) $(LINTFLAGS) $(SRCS) $(LINTLIBS)
  2.1209 +lint1:
  2.1210 +	$(LINT) $(LINTFLAGS) $(FILE) $(LINTLIBS)
  2.1211 +
  2.1212 +cleandir::
  2.1213 +	$(RM) keynav
  2.1214 +
  2.1215 +# ----------------------------------------------------------------------
  2.1216 +# common rules for all Makefiles - do not edit
  2.1217 +
  2.1218 +.c.i:
  2.1219 +	$(RM) $@
  2.1220 +	 	$(CC) -E $(CFLAGS) $(_NOOP_) $*.c > $@
  2.1221 +
  2.1222 +.SUFFIXES: .ii
  2.1223 +
  2.1224 +.cc.ii:
  2.1225 +	$(RM) $@
  2.1226 +	 	$(CC) -E $(CFLAGS) $(_NOOP_) $*.cc > $@
  2.1227 +
  2.1228 +.SUFFIXES: .s
  2.1229 +
  2.1230 +.c.s:
  2.1231 +	$(RM) $@
  2.1232 +	 	$(CC) -S $(CFLAGS) $(_NOOP_) $*.c
  2.1233 +
  2.1234 +.cc.s:
  2.1235 +	$(RM) $@
  2.1236 +	 	$(CC) -S $(CFLAGS) $(_NOOP_) $*.cc
  2.1237 +
  2.1238 +emptyrule::
  2.1239 +
  2.1240 +cleandir::
  2.1241 +	$(RM) *.CKP *.ln *.BAK *.bak *.o core errs ,* *~ *.a .emacs_* tags TAGS make.log MakeOut   "#"*
  2.1242 +
  2.1243 +Makefile::
  2.1244 +	-@if [ -f Makefile ]; then set -x; \
  2.1245 +	$(RM) Makefile.bak; $(MV) Makefile Makefile.bak; \
  2.1246 +	else exit 0; fi
  2.1247 +	$(IMAKE_CMD) -DTOPDIR=$(TOP) -DCURDIR=$(CURRENT_DIR)
  2.1248 +
  2.1249 +tags::
  2.1250 +	$(TAGS) -w *.[ch]
  2.1251 +	$(TAGS) -xw *.[ch] > TAGS
  2.1252 +
  2.1253 +man_keywords::
  2.1254 +
  2.1255 +html_index::
  2.1256 +	@if [ -d $(DESTDIR)$(DOCHTMLDIR) ]; then \
  2.1257 +		set +x; \
  2.1258 +	else \
  2.1259 +		if [ -h $(DESTDIR)$(DOCHTMLDIR) ]; then \
  2.1260 +			(set -x; rm -f $(DESTDIR)$(DOCHTMLDIR)); \
  2.1261 +		fi; \
  2.1262 +		(set -x; $(MKDIRHIER) $(DESTDIR)$(DOCHTMLDIR)); \
  2.1263 +	fi
  2.1264 +	$(HTMLINDEXCMD) $(DESTDIR)$(DOCHTMLDIR)
  2.1265 +
  2.1266 +clean:: cleandir
  2.1267 +
  2.1268 +distclean:: cleandir
  2.1269 +
  2.1270 +# ----------------------------------------------------------------------
  2.1271 +# empty rules for directories that do not have SUBDIRS - do not edit
  2.1272 +
  2.1273 +install::
  2.1274 +	@echo "install in $(CURRENT_DIR) done"
  2.1275 +
  2.1276 +install.man::
  2.1277 +	@echo "install.man in $(CURRENT_DIR) done"
  2.1278 +
  2.1279 +install.sdk::
  2.1280 +	@echo "install.sdk in $(CURRENT_DIR) done"
  2.1281 +
  2.1282 +Makefiles::
  2.1283 +
  2.1284 +includes::
  2.1285 +
  2.1286 +depend::
  2.1287 +
  2.1288 +distclean::
  2.1289 +	$(RM) Makefile Makefile.dep
  2.1290 +
  2.1291 +# ----------------------------------------------------------------------
  2.1292 +# dependencies generated by makedepend
  2.1293 +
     3.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.2 +++ b/README	Tue Sep 08 22:45:57 2009 -0700
     3.3 @@ -0,0 +1,62 @@
     3.4 +2008-05-06
     3.5 +
     3.6 +This is Jordan Sissel's 'keynav', modified by Paulo Ang.
     3.7 +
     3.8 +http://www.semicomplete.com/projects/keynav
     3.9 +http://iacs5.ucsd.edu/~pbang/mouseless.htm
    3.10 +
    3.11 +Note that this is based on an earlier release of 'keynav', not the
    3.12 +latest 'xdotool' based code. 
    3.13 +
    3.14 +
    3.15 +To build:
    3.16 +
    3.17 +Run 'xmkmf', then 'make keynav'.
    3.18 +
    3.19 +To run: 
    3.20 +
    3.21 +Simply run 'keynav'. For a list of the default keys see 'config.h'.
    3.22 +
    3.23 +To configure keys:
    3.24 +
    3.25 +Modify 'config.h' and recompile.
    3.26 +
    3.27 +To configure even more:
    3.28 +
    3.29 +Modify 'keynav.c' and recompile.
    3.30 +
    3.31 +
    3.32 +Hints:
    3.33 +
    3.34 +It's faster to use the "diagonal" movement keys, since they split the 
    3.35 +mouse area into four accessible parts, but the binary vi-keys is easier 
    3.36 +when you're just starting out or fine-tuning a small area.
    3.37 +
    3.38 +A good tactic would be to use the diagonal keys until the point you want to
    3.39 +click on is exactly on the crosshairs (or the selection area is too small),
    3.40 +then just use vi-keys to hone in.
    3.41 +
    3.42 +The nine-grid mode is even faster than the regular four-grid mode. 
    3.43 +Enable it by default by specifying '-n <num>' parameters to keynav, where
    3.44 +<num> is the number of moves before it automatically switches back to 
    3.45 +four-grid mode. Or press Shift-[center]. But you may want to hold off on 
    3.46 +using it until you get the hang of the four-grid mode first.
    3.47 +
    3.48 +You can have two instances of 'keynav' running simulataneously, as long as 
    3.49 +they have different trigger keys. You may want to do this to be able to use
    3.50 +both home row keys and the numeric keypad to 'keynav', for example.
    3.51 +
    3.52 +
    3.53 +About the statistics:
    3.54 +
    3.55 +'keynav' outputs debug messages to stderr, and stats to stdout. Simply
    3.56 +redirect to taste. 'hits' are the number of keys you've hit, 'moves' are the
    3.57 +number of movements made, and 'clicks' are the number of mouseclicks
    3.58 + not including simple clicks (ie, clicks that don't end the movement mode).
    3.59 +
    3.60 +
    3.61 +If 'keynav' appears to hang:
    3.62 +
    3.63 +It's probably because of the drag mode, which can be buggy with some apps.
    3.64 +A click from your real mouse will probably restore keyboard control, where
    3.65 +you can kill 'keynav' and start it up again.
     4.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.2 +++ b/config.h	Tue Sep 08 22:45:57 2009 -0700
     4.3 @@ -0,0 +1,48 @@
     4.4 +/*
     4.5 + * 
     4.6 + * This is the C header configuration file for changing some of
     4.7 + * the internal variables in 'keynav'.
     4.8 + *
     4.9 + */
    4.10 +
    4.11 +/* window appearances */
    4.12 +#define BORDER 5			/* pixels */
    4.13 +#define PEN 3				/* pixels */
    4.14 +#define LINEWIDTH 3		/* pixels */
    4.15 +#define DRAG_COLOR "red"			/* color when dragging*/
    4.16 +#define NORM_COLOR "yellow"			/* color, normal */
    4.17 +
    4.18 +/* keys -- see 'xev' for keysym strings */
    4.19 +#define TRIGGERMASK Mod4Mask			/* X modifier key -- see 'xmodmap' */
    4.20 +#define KEY_LEFT "h"			/* single characters */
    4.21 +#define KEY_DOWN "j"
    4.22 +#define KEY_UP "k"
    4.23 +#define KEY_RIGHT "l"
    4.24 +#define KEY_UPLEFT "a"
    4.25 +#define KEY_DOWNLEFT "s"
    4.26 +#define KEY_UPRIGHT "d"
    4.27 +#define KEY_DOWNRIGHT "f"
    4.28 +#define KEY_CENTER "g" 		/* shift this toggles nine grid manually */	
    4.29 +#define KEY_ONE "1"			/* left mouse button (simple click) */
    4.30 +#define KEY_TWO "2"			/* middle mouse button (simple click) */
    4.31 +#define KEY_THREE "3"			/* right mouse button (simple click) */
    4.32 +#define KEY_TRIGGER "semicolon"			/* trigger key */
    4.33 +#define KEY_Q_CLICK "semicolon"			/* quick click (no warp) */
    4.34 +#define KEY_Q_RCLICK "apostrophe"			/* quick right click (no warp) */
    4.35 +#define KEY_Q_MCLICK "backslash"			/* quick middle click (no warp) */
    4.36 +#define KEY_QW_CLICK "space"			/* quick click (warp) */
    4.37 +#define KEY_QW_RCLICK "Return"			/* quick right click (warp) */
    4.38 +#define KEY_ESCAPE "Escape"			/* cancel */
    4.39 +#define KEY_UNDO "u"			/* undo */
    4.40 +#define KEY_HIDE "q"			/* hide mouse cursor away to the lower right corner of screen */
    4.41 +
    4.42 +/* more mod masks */
    4.43 +#define CAPSLOCKMASK LockMask
    4.44 +#define NUMLOCKMASK Mod2Mask
    4.45 +#define SHIFTMASK ShiftMask			/* shifting instead of splitting */
    4.46 +#define DRAGMASK ShiftMask			/* dragging */
    4.47 +#define WARPMASK Mod4Mask			/* warp during splitting/shifting */
    4.48 +
    4.49 +/* undo options */
    4.50 +#define N_UNDO 15		/* max number of undo history -- must be at least 1 */
    4.51 +#define SHIFT_N_UNDO 2 		/* number of undo history to jump back through when holding shift */
     5.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     5.2 +++ b/config.h.default	Tue Sep 08 22:45:57 2009 -0700
     5.3 @@ -0,0 +1,47 @@
     5.4 +/*
     5.5 + * 
     5.6 + * This is the C header configuration file for changing some of
     5.7 + * the internal variables in 'keynav'.
     5.8 + *
     5.9 + */
    5.10 +
    5.11 +/* window appearances */
    5.12 +#define BORDER 5			/* pixels */
    5.13 +#define PEN 3				/* pixels */
    5.14 +#define LINEWIDTH 3		/* pixels */
    5.15 +#define DRAG_COLOR "red"			/* color when dragging*/
    5.16 +#define NORM_COLOR "yellow"			/* color, normal */
    5.17 +
    5.18 +/* keys -- see 'xev' for keysym strings */
    5.19 +#define TRIGGERMASK Mod4Mask			/* X modifier key -- see 'xmodmap' */
    5.20 +#define KEY_LEFT "h"			/* single characters */
    5.21 +#define KEY_DOWN "j"
    5.22 +#define KEY_UP "k"
    5.23 +#define KEY_RIGHT "l"
    5.24 +#define KEY_UPLEFT "a"
    5.25 +#define KEY_DOWNLEFT "s"
    5.26 +#define KEY_UPRIGHT "d"
    5.27 +#define KEY_DOWNRIGHT "f"
    5.28 +#define KEY_CENTER "g" 		/* shift this toggles nine grid manually */	
    5.29 +#define KEY_ONE "1"			/* left mouse button (simple click) */
    5.30 +#define KEY_TWO "2"			/* middle mouse button (simple click) */
    5.31 +#define KEY_THREE "3"			/* right mouse button (simple click) */
    5.32 +#define KEY_TRIGGER "semicolon"			/* trigger key */
    5.33 +#define KEY_Q_CLICK "semicolon"			/* quick click (no warp) */
    5.34 +#define KEY_Q_RCLICK "apostrophe"			/* quick right click (no warp) */
    5.35 +#define KEY_Q_MCLICK "backslash"			/* quick middle click (no warp) */
    5.36 +#define KEY_QW_CLICK "space"			/* quick click (warp) */
    5.37 +#define KEY_QW_RCLICK "Return"			/* quick right click (warp) */
    5.38 +#define KEY_ESCAPE "Escape"			/* cancel */
    5.39 +#define KEY_UNDO "u"			/* undo */
    5.40 +
    5.41 +/* more mod masks */
    5.42 +#define CAPSLOCKMASK LockMask
    5.43 +#define NUMLOCKMASK Mod2Mask
    5.44 +#define SHIFTMASK ShiftMask			/* shifting instead of splitting */
    5.45 +#define DRAGMASK ShiftMask			/* dragging */
    5.46 +#define WARPMASK Mod4Mask			/* warp during splitting/shifting */
    5.47 +
    5.48 +/* undo options */
    5.49 +#define N_UNDO 15		/* max number of undo history -- must be at least 1 */
    5.50 +#define SHIFT_N_UNDO 2 		/* number of undo history to jump back through when holding shift */
     6.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     6.2 +++ b/config.h.keypad	Tue Sep 08 22:45:57 2009 -0700
     6.3 @@ -0,0 +1,47 @@
     6.4 +/*
     6.5 + * 
     6.6 + * This is the C header configuration file for changing some of
     6.7 + * the internal variables in 'keynav'.
     6.8 + *
     6.9 + */
    6.10 +
    6.11 +/* window appearances */
    6.12 +#define BORDER 5			/* pixels */
    6.13 +#define PEN 3				/* pixels */
    6.14 +#define LINEWIDTH 3		/* pixels */
    6.15 +#define DRAG_COLOR "red"			/* color when dragging*/
    6.16 +#define NORM_COLOR "yellow"			/* color, normal */
    6.17 +
    6.18 +/* keys -- see 'xev' for keysym strings */
    6.19 +#define TRIGGERMASK Mod4Mask			/* X modifier key -- see 'xmodmap' */
    6.20 +#define KEY_LEFT "KP_Left"
    6.21 +#define KEY_DOWN "KP_Down"
    6.22 +#define KEY_UP "KP_Up"
    6.23 +#define KEY_RIGHT "KP_Right"
    6.24 +#define KEY_UPLEFT "KP_Home"
    6.25 +#define KEY_DOWNLEFT "KP_End"
    6.26 +#define KEY_UPRIGHT "KP_Prior"
    6.27 +#define KEY_DOWNRIGHT "KP_Next"
    6.28 +#define KEY_CENTER "KP_Begin" 		/* shift this toggles nine grid manually */	
    6.29 +#define KEY_ONE "1"			/* left mouse button (simple click) */
    6.30 +#define KEY_TWO "2"			/* middle mouse button (simple click) */
    6.31 +#define KEY_THREE "3"			/* right mouse button (simple click) */
    6.32 +#define KEY_TRIGGER "KP_Begin"			/* trigger key */
    6.33 +#define KEY_Q_CLICK "KP_Divide"			/* quick click (no warp) */
    6.34 +#define KEY_Q_RCLICK "KP_Multiply"			/* quick right click (no warp) */
    6.35 +#define KEY_Q_MCLICK "KP_Subtract"			/* quick middle click (no warp) */
    6.36 +#define KEY_QW_CLICK "KP_Enter"			/* quick click (warp) */
    6.37 +#define KEY_QW_RCLICK "KP_Add"			/* quick right click (warp) */
    6.38 +#define KEY_ESCAPE "Escape"			/* cancel */
    6.39 +#define KEY_UNDO "KP_Insert"			/* undo */
    6.40 +
    6.41 +/* more mod masks */
    6.42 +#define CAPSLOCKMASK LockMask
    6.43 +#define NUMLOCKMASK Mod2Mask
    6.44 +#define SHIFTMASK ShiftMask			/* shifting instead of splitting */
    6.45 +#define DRAGMASK ShiftMask			/* dragging */
    6.46 +#define WARPMASK Mod4Mask			/* warp during splitting/shifting */
    6.47 +
    6.48 +/* undo options */
    6.49 +#define N_UNDO 15		/* max number of undo history -- must be at least 1 */
    6.50 +#define SHIFT_N_UNDO 2 		/* number of undo history to jump back through when holding shift */
     7.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     7.2 +++ b/keynav.c	Tue Sep 08 22:45:57 2009 -0700
     7.3 @@ -0,0 +1,523 @@
     7.4 +/*
     7.5 + * Visual user-directed binary search for something to point your mouse at.
     7.6 + */
     7.7 +
     7.8 +#include "config.h"
     7.9 +
    7.10 +#include <stdio.h>
    7.11 +#include <stdlib.h>
    7.12 +#include <string.h>
    7.13 +
    7.14 +#include <X11/Xlib.h>
    7.15 +#include <X11/Xresource.h>
    7.16 +#include <X11/Xutil.h>
    7.17 +#include <X11/extensions/shape.h>
    7.18 +#include <X11/extensions/XTest.h>
    7.19 +
    7.20 +Display *dpy;
    7.21 +Window root;
    7.22 +XWindowAttributes attr;
    7.23 +int drag = 0;
    7.24 +int allmoves = 0;
    7.25 +int allhits = 0;
    7.26 +int allclicks = 0;
    7.27 +int ninegrid_default = 0;
    7.28 +int ninegrid_n_switch = 0;
    7.29 +int ninegrid = 0;
    7.30 +
    7.31 +struct  /* undo stack */
    7.32 +{
    7.33 +  int x[N_UNDO];
    7.34 +  int y[N_UNDO];
    7.35 +  int w[N_UNDO];
    7.36 +  int h[N_UNDO];
    7.37 +  int ninegrid[N_UNDO];
    7.38 +} u;
    7.39 +
    7.40 +void toggleninegrid() {
    7.41 +  if (ninegrid)
    7.42 +	ninegrid = 0;
    7.43 +  else 
    7.44 +	ninegrid = 1;
    7.45 +}
    7.46 +
    7.47 +void stats(int hits, int moves) {
    7.48 +  allhits += hits;
    7.49 +  allmoves += moves;
    7.50 +  allclicks++;
    7.51 +  printf("hits=%d, moves=%d \n", hits, moves);
    7.52 +  printf("total hits=%d, total moves=%d, total clicks=%d, avg. hit/click=%.2f, avg. moves/click=%.2f \n", allhits, allmoves, allclicks, (float)allhits/(float)allclicks, (float)allmoves/(float)allclicks);
    7.53 +  fflush(stdout); fflush(stderr); // force buffers to write out
    7.54 +}
    7.55 + 
    7.56 +void grab(char *keyname, int mods) {
    7.57 +  int key;
    7.58 +
    7.59 +  key = XKeysymToKeycode(dpy, XStringToKeysym(keyname));
    7.60 +  XGrabKey(dpy, key, mods, root, False,
    7.61 +	       GrabModeAsync, GrabModeAsync);
    7.62 +  XGrabKey(dpy, key, mods | CAPSLOCKMASK, root, False,
    7.63 +	       GrabModeAsync, GrabModeAsync);
    7.64 +  XGrabKey(dpy, key, mods | NUMLOCKMASK, root, False,
    7.65 +	       GrabModeAsync, GrabModeAsync);
    7.66 +  XGrabKey(dpy, key, mods | CAPSLOCKMASK | NUMLOCKMASK, root, False,
    7.67 +	       GrabModeAsync, GrabModeAsync);
    7.68 +}
    7.69 +
    7.70 +void ungrab(char *keyname, int mod) {
    7.71 +  int key;
    7.72 +
    7.73 +  key = XKeysymToKeycode(dpy, XStringToKeysym(keyname));
    7.74 +  XUngrabKey(dpy, key, mod, root);
    7.75 +  XUngrabKey(dpy, key, mod | CAPSLOCKMASK, root);
    7.76 +  XUngrabKey(dpy, key, mod | NUMLOCKMASK, root);
    7.77 +  XUngrabKey(dpy, key, mod | CAPSLOCKMASK | NUMLOCKMASK, root);
    7.78 +}
    7.79 +
    7.80 +void buttondown(int i) {
    7.81 +  XTestFakeButtonEvent(dpy, i, True, 50);
    7.82 +}
    7.83 +
    7.84 +void buttonup(int i) {
    7.85 +  XTestFakeButtonEvent(dpy, i, False, 50);
    7.86 +}
    7.87 +
    7.88 +void warppointer(int x, int y, int w, int h) {
    7.89 +  XWarpPointer(dpy, None, root, 0, 0, 0, 0, x + w/2, y + h/2);
    7.90 +}
    7.91 +
    7.92 +/* operations for undo */
    7.93 +void undo_stack_push(int x, int y, int w, int h) {
    7.94 +  int i;
    7.95 +
    7.96 +  if (x >= 0 && y >= 0 && w > 0 && h > 0) {
    7.97 +	fprintf(stderr,"undo_stack_push success: @(%d,%d) #(%d,%d)\n", x, y, w, h);
    7.98 +	for (i=N_UNDO-1; i>0; i--) {
    7.99 +	  u.x[i] = u.x[i-1]; 
   7.100 +	  u.y[i] = u.y[i-1]; 
   7.101 +	  u.w[i] = u.w[i-1]; 
   7.102 +	  u.h[i] = u.h[i-1]; 
   7.103 +	  u.ninegrid[i] = u.ninegrid[i-1]; 
   7.104 +	}
   7.105 +	u.x[0] = x;
   7.106 +	u.y[0] = y;
   7.107 +	u.w[0] = w;
   7.108 +	u.h[0] = h;
   7.109 +	u.ninegrid[0] = ninegrid;
   7.110 +  }
   7.111 +}
   7.112 +
   7.113 +int undo_stack_pop(int *x, int *y, int *w, int *h, int *ninegrid) {
   7.114 +  int i;
   7.115 +  int ret = 0;
   7.116 +
   7.117 +  int rx = u.x[0];
   7.118 +  int ry = u.y[0];
   7.119 +  int rw = u.w[0];
   7.120 +  int rh = u.h[0];
   7.121 +  int rninegrid = u.ninegrid[0];
   7.122 +
   7.123 +  if (rx >= 0 && ry >= 0 && rw > 0 && rh > 0) {
   7.124 +	fprintf(stderr,"undo_stack_pop success: @(%d,%d) #(%d,%d)\n", *x, *y, *w, *h);
   7.125 +	ret = 1; 	// return success
   7.126 +	for (i=0; i<N_UNDO-1; i++) {
   7.127 +	  u.x[i] = u.x[i+1];
   7.128 +	  u.y[i] = u.y[i+1];
   7.129 +	  u.w[i] = u.w[i+1];
   7.130 +	  u.h[i] = u.h[i+1];
   7.131 +	  u.ninegrid[i] = u.ninegrid[i+1];
   7.132 +	}
   7.133 +	u.x[N_UNDO-1] = -1;
   7.134 +	u.y[N_UNDO-1] = -1;
   7.135 +	u.w[N_UNDO-1] = -1;
   7.136 +	u.h[N_UNDO-1] = -1;
   7.137 +	u.ninegrid[N_UNDO-1] = -1;
   7.138 +	*x = rx;
   7.139 +	*y = ry;
   7.140 +	*w = rw;
   7.141 +	*h = rh;
   7.142 +	*ninegrid = rninegrid;
   7.143 +  }
   7.144 +  return ret;
   7.145 +}
   7.146 +
   7.147 +void undo_stack_reset() {
   7.148 +  int i;
   7.149 +
   7.150 +  for (i=0; i<N_UNDO; i++) {
   7.151 +	u.x[i] = -1;
   7.152 +	u.y[i] = -1;
   7.153 +	u.w[i] = -1;
   7.154 +	u.h[i] = -1;
   7.155 +  }
   7.156 +}
   7.157 +/* =-=-=-=-=-= */
   7.158 +
   7.159 +int chk_keysym(int keysym, char *str) {
   7.160 +  int ret = 0;
   7.161 +
   7.162 +  if (XStringToKeysym(str) == keysym)
   7.163 +	ret = 1;
   7.164 +
   7.165 +  return ret;
   7.166 +}
   7.167 +
   7.168 +GC creategc(Window win) {
   7.169 +  GC gc;
   7.170 +  XGCValues values;
   7.171 +
   7.172 +  gc = XCreateGC(dpy, win, 0, &values);
   7.173 +  XSetForeground(dpy, gc, BlackPixel(dpy, 0));
   7.174 +  XSetBackground(dpy, gc, WhitePixel(dpy, 0));
   7.175 +  XSetLineAttributes(dpy, gc, LINEWIDTH, LineSolid, CapButt, JoinBevel);
   7.176 +  XSetFillStyle(dpy, gc, FillSolid);
   7.177 +
   7.178 +  return gc;
   7.179 +}
   7.180 +
   7.181 +void drawquadrants(Window win, int w, int h) {
   7.182 +  GC gc;
   7.183 +  XRectangle clip[20];
   7.184 +  int idx = 0;
   7.185 +  Colormap colormap;
   7.186 +  XColor color;
   7.187 +
   7.188 +  gc = creategc(win);
   7.189 +  colormap = DefaultColormap(dpy, 0);
   7.190 +
   7.191 +  if (drag)  
   7.192 +	XAllocNamedColor(dpy, colormap, DRAG_COLOR, &color, &color);
   7.193 +  else
   7.194 +	XAllocNamedColor(dpy, colormap, NORM_COLOR, &color, &color);
   7.195 +
   7.196 +  /*left*/ clip[idx].x = 0; clip[idx].y = 0; clip[idx].width = BORDER; clip[idx].height = h;
   7.197 +  idx++;
   7.198 +  /*right*/ clip[idx].x = w-BORDER; clip[idx].y = 0; clip[idx].width = BORDER; clip[idx].height = h;
   7.199 +  idx++;
   7.200 +  /*top*/ clip[idx].x = 0; clip[idx].y = 0; clip[idx].width = w; clip[idx].height = BORDER;
   7.201 +  idx++;
   7.202 +  /*bottom*/ clip[idx].x = 0; clip[idx].y = h-BORDER; clip[idx].width = w; clip[idx].height = BORDER;
   7.203 +  idx++;
   7.204 +
   7.205 +  if (ninegrid) {
   7.206 +	/*1st horiz*/  
   7.207 +	clip[idx].x = 0; clip[idx].y = h/3 - BORDER/2;
   7.208 +	clip[idx].width = w; clip[idx].height = BORDER;
   7.209 +	idx++;
   7.210 +	/*2nd horiz*/
   7.211 +	clip[idx].x = 0; clip[idx].y = h*2/3 - BORDER/2;
   7.212 +	clip[idx].width = w; clip[idx].height = BORDER;
   7.213 +	idx++;
   7.214 +	/*1st vert*/
   7.215 +	clip[idx].x = w/3 - BORDER/2; clip[idx].y = 0;
   7.216 +	clip[idx].width = BORDER; clip[idx].height = h;
   7.217 +	idx++;
   7.218 +	/*2nd vert*/
   7.219 +	clip[idx].x = w*2/3 - BORDER/2; clip[idx].y = 0;
   7.220 +	clip[idx].width = BORDER; clip[idx].height = h;
   7.221 +	idx++;
   7.222 +  } else {
   7.223 +	/*horiz*/
   7.224 +	clip[idx].x = 0; clip[idx].y = h/2 - BORDER/2;
   7.225 +	clip[idx].width = w; clip[idx].height = BORDER;
   7.226 +	idx++;
   7.227 +	/*vert*/
   7.228 +	clip[idx].x = w/2 - BORDER/2; clip[idx].y = 0;
   7.229 +	clip[idx].width = BORDER; clip[idx].height = h;
   7.230 +	idx++;
   7.231 +  }
   7.232 +
   7.233 +  XShapeCombineRectangles(dpy, win, ShapeBounding, 0, 0, clip, idx, ShapeSet, 0);
   7.234 +
   7.235 +  XFillRectangle(dpy, win, gc, 0, 0, w, h);
   7.236 +
   7.237 +  XSetForeground(dpy, gc, color.pixel);
   7.238 +  XDrawLine(dpy, win, gc, BORDER - PEN, BORDER - PEN, w - PEN, BORDER - PEN); //top line
   7.239 +  XDrawLine(dpy, win, gc, BORDER - PEN, h - PEN, w - PEN, h - PEN); //bottom line
   7.240 +  XDrawLine(dpy, win, gc, BORDER - PEN, BORDER - PEN, BORDER - PEN, h - PEN); //left line
   7.241 +  XDrawLine(dpy, win, gc, w - PEN, BORDER - PEN, w - PEN, h - PEN); //left line
   7.242 +
   7.243 +  if (ninegrid) {
   7.244 +	XDrawLine(dpy, win, gc, w/3, 0, w/3, h); // 1st vert line
   7.245 +	XDrawLine(dpy, win, gc, w*2/3, 0, w*2/3, h); // 2nd vert line
   7.246 +	XDrawLine(dpy, win, gc, 0, h/3, w, h/3); // 1st horiz line
   7.247 +	XDrawLine(dpy, win, gc, 0, h*2/3, w, h*2/3); // 2nd horiz line
   7.248 +  } else {
   7.249 +	XDrawLine(dpy, win, gc, w/2, 0, w/2, h); // vert line
   7.250 +	XDrawLine(dpy, win, gc, 0, h/2, w, h/2); // horiz line
   7.251 +  }
   7.252 +
   7.253 +  XFlush(dpy);
   7.254 +}
   7.255 +
   7.256 +int handlekey(int keysym, int mod, int *moves,  int *x, int *y, int *w, int *h) {
   7.257 +  int ret = 1;
   7.258 +  int ox = *x;
   7.259 +  int oy = *y;
   7.260 +  int ow = *w;
   7.261 +  int oh = *h;;
   7.262 +
   7.263 +  if (mod & SHIFTMASK || mod & SHIFTMASK & NUMLOCKMASK || mod & SHIFTMASK & CAPSLOCKMASK || mod & SHIFTMASK & CAPSLOCKMASK & NUMLOCKMASK) {
   7.264 +	if (chk_keysym(keysym, KEY_CENTER))
   7.265 +	  toggleninegrid();
   7.266 +	if (chk_keysym(keysym, KEY_LEFT) || chk_keysym(keysym, KEY_UPLEFT) || chk_keysym(keysym, KEY_DOWNLEFT)) {
   7.267 +	  if (*x > 0) *x -= *w; // shift left
   7.268 +	} 
   7.269 +	 if (chk_keysym(keysym, KEY_DOWN) || chk_keysym(keysym, KEY_DOWNLEFT) || chk_keysym(keysym, KEY_DOWNRIGHT)) {
   7.270 +	  if ((*y + *h) < attr.height) *y += *h; // shift down
   7.271 +	} 
   7.272 +	if (chk_keysym(keysym, KEY_UP) || chk_keysym(keysym, KEY_UPLEFT) || chk_keysym(keysym, KEY_UPRIGHT)) {
   7.273 +	  if (*y > 0) *y -= *h; // shift up
   7.274 +	} 
   7.275 +	if (chk_keysym(keysym, KEY_RIGHT) || chk_keysym(keysym, KEY_UPRIGHT) || chk_keysym(keysym, KEY_DOWNRIGHT)) {
   7.276 +	  if ((*x + *w) < attr.width) *x += *w; // shift right
   7.277 +	}
   7.278 +  } else {
   7.279 +	if (ninegrid) {
   7.280 +	  if (chk_keysym(keysym, KEY_UPLEFT)) {
   7.281 +	    *w /= 3; *h /= 3; // split upper left
   7.282 +	  } else if (chk_keysym(keysym, KEY_UP)) {
   7.283 +	    *w /= 3; *h /= 3; // split up 
   7.284 +	    *x += *w;
   7.285 +	  } else if (chk_keysym(keysym, KEY_UPRIGHT)) {
   7.286 +	    *w /= 3; *h /= 3; // split upper right 
   7.287 +	    *x += *w * 2;
   7.288 +	  } else if (chk_keysym(keysym, KEY_LEFT)) {
   7.289 +	    *w /= 3; *h /= 3; // split left
   7.290 +	    *y += *h;
   7.291 +	  } else if (chk_keysym(keysym, KEY_CENTER)) {
   7.292 +	    *w /= 3; *h /= 3; // split center
   7.293 +	    *x += *w; *y += *h;
   7.294 +	  } else if (chk_keysym(keysym, KEY_RIGHT)) {
   7.295 +	    *w /= 3; *h /= 3; // split right
   7.296 +	    *x += *w * 2; *y += *h;
   7.297 +	  } else if (chk_keysym(keysym, KEY_DOWNLEFT)) {
   7.298 +	    *w /= 3; *h /= 3; // split bottom left
   7.299 +	    *y += *h * 2;
   7.300 +	  } else if (chk_keysym(keysym, KEY_DOWN)) {
   7.301 +	    *w /= 3; *h /= 3; // split down
   7.302 +	    *x += *w; *y += *h * 2;
   7.303 +	  } else if (chk_keysym(keysym, KEY_DOWNRIGHT)) {
   7.304 +	    *w /= 3; *h /= 3; // split bottom right
   7.305 +	    *x += *w * 2; *y += *h * 2;
   7.306 +	  }
   7.307 +	} else {
   7.308 +	  if (chk_keysym(keysym, KEY_LEFT) || chk_keysym(keysym, KEY_UPLEFT) || chk_keysym(keysym, KEY_DOWNLEFT)) {
   7.309 +	    *w /= 2; // split left
   7.310 +	  }
   7.311 +	   if (chk_keysym(keysym, KEY_DOWN) || chk_keysym(keysym, KEY_DOWNLEFT) || chk_keysym(keysym, KEY_DOWNRIGHT)) {
   7.312 +	    *h /= 2; // split down
   7.313 +	    *y += *h;
   7.314 +	  }
   7.315 +	   if (chk_keysym(keysym, KEY_UP) || chk_keysym(keysym, KEY_UPLEFT) || chk_keysym(keysym, KEY_UPRIGHT)) {
   7.316 +	    *h /= 2; // split up
   7.317 +	  } 
   7.318 +	   if (chk_keysym(keysym, KEY_RIGHT) || chk_keysym(keysym, KEY_UPRIGHT) || chk_keysym(keysym, KEY_DOWNRIGHT)) {
   7.319 +	    *w /= 2; // split right
   7.320 +	    *x += *w;
   7.321 +	  }
   7.322 +	}
   7.323 +  }
   7.324 +
   7.325 +  if (ox != *x || oy != *y || ow != *w || oh != *h) {
   7.326 +	undo_stack_push(ox, oy, ow, oh);
   7.327 +	*moves += 1;
   7.328 +  }
   7.329 +  else if (chk_keysym(keysym, KEY_UNDO)) {
   7.330 +	int i, j;
   7.331 +
   7.332 +	if (mod & SHIFTMASK) j = 0;
   7.333 +	else j = SHIFT_N_UNDO-1; 
   7.334 +
   7.335 +	for (i=j; i<SHIFT_N_UNDO; i++) {
   7.336 +	  undo_stack_pop(x, y, w, h, &ninegrid);
   7.337 +	  *moves -= 1;
   7.338 +	}
   7.339 +	ret = 2;
   7.340 +  }
   7.341 +
   7.342 +  if (*w < 1 || *h < 1) {
   7.343 +	fprintf(stderr,"OOPS. Area too small. Giving up :(\n");
   7.344 +	return 0;
   7.345 +  }
   7.346 +
   7.347 +  if (drag && !(mod & WARPMASK) || !drag && (mod & WARPMASK))
   7.348 +	warppointer(*x, *y, *w, *h);
   7.349 +
   7.350 +  fprintf(stderr,"Box: @(%d,%d) #(%d,%d)\n", *x, *y, *w, *h);
   7.351 +
   7.352 +  return ret;
   7.353 +}
   7.354 +
   7.355 +void startmousekey(int from_undo) {
   7.356 +  int keysym;
   7.357 +  int done = 0;
   7.358 +  int x,y,w,h;
   7.359 +  int warp = 0;
   7.360 +  int click = 0;
   7.361 +  int k, hits, moves;
   7.362 +  int mod;
   7.363 +
   7.364 +  Window zone;
   7.365 +
   7.366 +  // disable trigger keygrab
   7.367 +  ungrab(KEY_TRIGGER, TRIGGERMASK);
   7.368 +  ungrab(KEY_UNDO, TRIGGERMASK);
   7.369 +
   7.370 +  // grab keyboard
   7.371 +  XGrabKeyboard(dpy, root, False, GrabModeAsync, GrabModeAsync, CurrentTime);
   7.372 +
   7.373 +  // init stuff
   7.374 +  hits = moves = 0;
   7.375 +  if (from_undo && undo_stack_pop(&x, &y, &w, &h, &ninegrid));
   7.376 +	/* null -- only check for undo_stack_pop success */
   7.377 +  else {
   7.378 +	undo_stack_reset();
   7.379 +	if (ninegrid_default)
   7.380 +	  ninegrid = 1;
   7.381 +	x = y = 0;
   7.382 +	w = attr.width;
   7.383 +	h = attr.height;
   7.384 +  }
   7.385 +
   7.386 +  zone = XCreateSimpleWindow(dpy, root, x, y, w, h, 1, BlackPixel(dpy, 0), WhitePixel(dpy, 0));
   7.387 +
   7.388 +  { /* Tell the window manager not to manage us */
   7.389 +	unsigned long valuemask;
   7.390 +	XSetWindowAttributes winattr;
   7.391 +	winattr.override_redirect = 1;
   7.392 +	XChangeWindowAttributes(dpy, zone, CWOverrideRedirect, &winattr);
   7.393 +  }
   7.394 +
   7.395 +  drawquadrants(zone, w, h);
   7.396 +  XMapWindow(dpy, zone);
   7.397 +  drawquadrants(zone, w, h);
   7.398 +
   7.399 +  fprintf(stderr,"Starting quadrants...\n");
   7.400 +  while (!done) {
   7.401 +	XEvent e;
   7.402 +	XNextEvent(dpy, &e);
   7.403 +	if (e.type == KeyPress) {
   7.404 +	  keysym = XKeycodeToKeysym(dpy, e.xkey.keycode, 0);
   7.405 +	  mod = e.xkey.state;
   7.406 +	  if (chk_keysym(keysym, KEY_Q_CLICK)) {
   7.407 +	    done++;
   7.408 +	    click = 1;
   7.409 +	  } else if (chk_keysym(keysym, KEY_Q_RCLICK)) {
   7.410 +	    done++;
   7.411 +	    click = 3;
   7.412 +	  } else if (chk_keysym(keysym, KEY_QW_CLICK)) {
   7.413 +	    done++;
   7.414 +	    warp = 1;
   7.415 +	    click = 1;
   7.416 +	  } else if (chk_keysym(keysym, KEY_Q_MCLICK)) {
   7.417 +	    done++;
   7.418 +	    click = 2;
   7.419 +	  } else if (chk_keysym(keysym, KEY_QW_RCLICK)) {
   7.420 +	    done++;
   7.421 +	    warp = 1;
   7.422 +	    click = 3;
   7.423 +	  } else if (chk_keysym(keysym, KEY_HIDE)) {
   7.424 +	    done++;
   7.425 +	    warp = 1;
   7.426 +	    x = w; y = h;
   7.427 +	  } else if (chk_keysym(keysym, KEY_ESCAPE)) {
   7.428 +	    warp = 0;
   7.429 +	    done++;
   7.430 +	  } else if (!drag && chk_keysym(keysym, KEY_ONE)) {
   7.431 +	      buttondown(1);
   7.432 +	      buttonup(1);
   7.433 +	  } else if (!drag && chk_keysym(keysym, KEY_TWO)) {
   7.434 +	      buttondown(2);
   7.435 +	      buttonup(2);
   7.436 +	  } else if (!drag && chk_keysym(keysym, KEY_THREE)) {
   7.437 +	      buttondown(3);
   7.438 +	      buttonup(3);
   7.439 +	  } else {
   7.440 +	    	if (k = handlekey(keysym, mod, &moves, &x, &y, &w, &h)) {
   7.441 +	      	if (ninegrid_default && ninegrid_n_switch && k < 2 && moves >= ninegrid_n_switch)
   7.442 +	        		ninegrid = 0;
   7.443 +	      	hits++;
   7.444 +	      	XMoveResizeWindow(dpy, zone, x, y, w, h);
   7.445 +	      	drawquadrants(zone, w, h);
   7.446 +	    	} else 
   7.447 +	      	done++;
   7.448 +			}
   7.449 +		}
   7.450 +  }
   7.451 +
   7.452 +  // end mouse key
   7.453 +  XUngrabKeyboard(dpy, CurrentTime);
   7.454 +  XDestroyWindow(dpy, zone);
   7.455 +  undo_stack_push(x, y, w, h);
   7.456 +
   7.457 +  if (warp)
   7.458 +	warppointer(x, y, w, h);
   7.459 +  if (click == 1) {
   7.460 +	if (!drag)
   7.461 +	  buttondown(1);
   7.462 +	if (mod & DRAGMASK && !drag) 
   7.463 +	  drag = 1;
   7.464 +	else if (mod & DRAGMASK) {
   7.465 +	  buttonup(1);
   7.466 +	  buttondown(1);
   7.467 +	} else {
   7.468 +	  buttonup(1);
   7.469 +	  drag = 0;
   7.470 +	}
   7.471 +  } else if (click) {
   7.472 +	buttondown(click);
   7.473 +	buttonup(click);
   7.474 +  } 
   7.475 +
   7.476 +  if (click) stats(hits, moves); 
   7.477 +
   7.478 +  // loop back if in drag mode
   7.479 +  if (drag) {
   7.480 +	usleep(50); 
   7.481 +	startmousekey(0);
   7.482 +  }
   7.483 +
   7.484 +  // re-enable trigger keygrabs
   7.485 +  grab(KEY_TRIGGER, TRIGGERMASK);
   7.486 +  grab(KEY_UNDO, TRIGGERMASK);
   7.487 +}
   7.488 +
   7.489 +int main(int argc, char **argv) {
   7.490 +  char *pcDisplay;
   7.491 +
   7.492 +  if ((dpy = XOpenDisplay(pcDisplay = getenv("DISPLAY"))) == NULL) {
   7.493 +	fprintf(stderr,"Error: Can't open display: %s", pcDisplay);
   7.494 +	exit(1);
   7.495 +  }
   7.496 +  fprintf(stderr,"Display: %s\n", pcDisplay);
   7.497 +
   7.498 +  // parse options
   7.499 +  if (argc > 1) 
   7.500 +	if (argv[1][0] && argv[1][0] == '-') 
   7.501 +	  if (argv[1][1] && argv[1][1] == 'n') {
   7.502 +	    ninegrid_default = 1;
   7.503 +	    fprintf(stderr,"nine-grid default mode \n");
   7.504 +	    if (argv[2]) {
   7.505 +	      ninegrid_n_switch = atoi(argv[2]);
   7.506 +	      fprintf(stderr,"nine-grid autoswitch num: %d \n", ninegrid_n_switch);
   7.507 +	    }
   7.508 +	  }
   7.509 +
   7.510 +  root = XDefaultRootWindow(dpy);
   7.511 +  XGetWindowAttributes(dpy, root, &attr);
   7.512 +
   7.513 +  // these are the trigger keygrabs
   7.514 +  grab(KEY_TRIGGER, TRIGGERMASK);
   7.515 +  grab(KEY_UNDO, TRIGGERMASK);
   7.516 +
   7.517 +  while (1) {
   7.518 +	XEvent e;
   7.519 +	XNextEvent(dpy, &e);
   7.520 +	if (e.type == KeyPress)
   7.521 +	  if (chk_keysym(XKeycodeToKeysym(dpy, e.xkey.keycode, 0), KEY_UNDO))
   7.522 +	    startmousekey(1);
   7.523 +	  else
   7.524 +	    startmousekey(0);
   7.525 +  }
   7.526 +}
     8.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     8.2 +++ b/keynav.c.old	Tue Sep 08 22:45:57 2009 -0700
     8.3 @@ -0,0 +1,282 @@
     8.4 +/*
     8.5 + * Visual user-directed binary search for something to point your mouse at.
     8.6 + */
     8.7 +
     8.8 +/* XXX: fine-tuning once you're zoomed in? (done?)
     8.9 + * XXX: "cancel" action (done)
    8.10 + * XXX: vi-keys half-split (done)
    8.11 + * XXX: use XGrabKeyboard instead of XGrabKey for the movement mode? 
    8.12 +*/
    8.13 +
    8.14 +#include <stdio.h>
    8.15 +#include <stdlib.h>
    8.16 +#include <unistd.h>
    8.17 +#include <string.h>
    8.18 +#include <errno.h>
    8.19 +
    8.20 +#include <X11/Xlib.h>
    8.21 +#include <X11/Xresource.h>
    8.22 +#include <X11/Xutil.h>
    8.23 +#include <X11/extensions/shape.h>
    8.24 +#include <X11/extensions/XTest.h>
    8.25 +
    8.26 +Display *dpy;
    8.27 +Window root;
    8.28 +XWindowAttributes attr;
    8.29 +
    8.30 +void grab(char *keyname, int mods) {
    8.31 +  int key;
    8.32 +
    8.33 +  key = XKeysymToKeycode(dpy, XStringToKeysym(keyname));
    8.34 +  XGrabKey(dpy, key, mods, root, False,
    8.35 +           GrabModeAsync, GrabModeAsync);
    8.36 +}
    8.37 +
    8.38 +GC creategc(Window win) {
    8.39 +  GC gc;
    8.40 +  XGCValues values;
    8.41 +
    8.42 +  gc = XCreateGC(dpy, win, 0, &values);
    8.43 +  XSetForeground(dpy, gc, BlackPixel(dpy, 0));
    8.44 +  XSetBackground(dpy, gc, WhitePixel(dpy, 0));
    8.45 +  XSetLineAttributes(dpy, gc, 4, LineSolid, CapButt, JoinBevel);
    8.46 +  XSetFillStyle(dpy, gc, FillSolid);
    8.47 +  //XSetFillStyle(dpy, gc, FillStippled);
    8.48 +
    8.49 +  return gc;
    8.50 +}
    8.51 +
    8.52 +void drawquadrants(Window win, int w, int h) {
    8.53 +  GC gc;
    8.54 +  XRectangle clip[20];
    8.55 +  int idx = 0;
    8.56 +  Colormap colormap;
    8.57 +  XColor red;
    8.58 +
    8.59 +  gc = creategc(win);
    8.60 +  colormap = DefaultColormap(dpy, 0);
    8.61 +
    8.62 +  XAllocNamedColor(dpy, colormap, "darkred", &red, &red);
    8.63 +
    8.64 +# define BORDER 6
    8.65 +# define PEN 4
    8.66 +
    8.67 +  /*left*/ clip[idx].x = 0; clip[idx].y = 0; clip[idx].width = BORDER; clip[idx].height = h;
    8.68 +  idx++;
    8.69 +  /*right*/ clip[idx].x = w-BORDER; clip[idx].y = 0; clip[idx].width = BORDER; clip[idx].height = h;
    8.70 +  idx++;
    8.71 +  /*top*/ clip[idx].x = 0; clip[idx].y = 0; clip[idx].width = w; clip[idx].height = BORDER;
    8.72 +  idx++;
    8.73 +  /*bottom*/ clip[idx].x = 0; clip[idx].y = h-BORDER; clip[idx].width = w; clip[idx].height = BORDER;
    8.74 +  idx++;
    8.75 +  /*horiz*/
    8.76 +  clip[idx].x = 0; clip[idx].y = h/2 - BORDER/2;
    8.77 +  clip[idx].width = w; clip[idx].height = BORDER;
    8.78 +  idx++;
    8.79 +  /*vert*/
    8.80 +  clip[idx].x = w/2 - BORDER/2; clip[idx].y = 0;
    8.81 +  clip[idx].width = BORDER; clip[idx].height = h;
    8.82 +  idx++;
    8.83 +
    8.84 +  XShapeCombineRectangles(dpy, win, ShapeBounding, 0, 0, clip, idx, ShapeSet, 0);
    8.85 +
    8.86 +  XSetForeground(dpy, gc, WhitePixel(dpy, 0));
    8.87 +  XFillRectangle(dpy, win, gc, 0, 0, w, h);
    8.88 +
    8.89 +  XSetForeground(dpy, gc, red.pixel);
    8.90 +  XDrawLine(dpy, win, gc, w/2, 0, w/2, h); // vert line
    8.91 +  XDrawLine(dpy, win, gc, 0, h/2, w, h/2); // horiz line
    8.92 +  XDrawLine(dpy, win, gc, BORDER - PEN, BORDER - PEN, w - PEN, BORDER - PEN); //top line
    8.93 +  XDrawLine(dpy, win, gc, BORDER - PEN, h - PEN, w - PEN, h - PEN); //bottom line
    8.94 +  XDrawLine(dpy, win, gc, BORDER - PEN, BORDER - PEN, BORDER - PEN, h - PEN); //left line
    8.95 +  XDrawLine(dpy, win, gc, w - PEN, BORDER - PEN, w - PEN, h - PEN); //left line
    8.96 +  XFlush(dpy);
    8.97 +}
    8.98 +
    8.99 +void ungrab(char *keyname, int mod) {
   8.100 +  int key;
   8.101 +
   8.102 +  key = XKeysymToKeycode(dpy, XStringToKeysym(keyname));
   8.103 +  XUngrabKey(dpy, key, mod, root);
   8.104 +}
   8.105 +
   8.106 +void endmousekey() {
   8.107 +  ungrab("h",0); ungrab("j",0); ungrab("k",0); ungrab("l",0);
   8.108 +  ungrab("h",ControlMask); ungrab("j",ControlMask); ungrab("k",ControlMask); ungrab("l",ControlMask);
   8.109 +  ungrab("h",ShiftMask); ungrab("j",ShiftMask); ungrab("k",ShiftMask); ungrab("l",ShiftMask);
   8.110 +  ungrab("space", 0);
   8.111 +  ungrab("semicolon", 0);
   8.112 +  ungrab("Escape", 0);
   8.113 +  XSync(dpy, 0);
   8.114 +  grab("semicolon", ControlMask);
   8.115 +}
   8.116 +
   8.117 +int handlekey(int keysym, int mod, int *x, int *y, int *w, int *h) {
   8.118 +  char *keyname;
   8.119 +
   8.120 +  keyname = XKeysymToString(keysym);
   8.121 +
   8.122 +#if 0
   8.123 +  if (!strcmp(keyname, "a")) { // up and left
   8.124 +    //*x -= *w;
   8.125 +    //*y -= *h;
   8.126 +  } else if (!strcmp(keyname, "s")) { // up and right
   8.127 +    *x += *w;
   8.128 +    //*y += *h;
   8.129 +  } else if (!strcmp(keyname, "d")) { // down and left
   8.130 +    //*x += *w;
   8.131 +    *y += *h;
   8.132 +  } else if (!strcmp(keyname, "f")) { // down and right
   8.133 +    *x += *w;
   8.134 +    *y += *h;
   8.135 +  }
   8.136 +#endif
   8.137 +
   8.138 +  if (mod & ControlMask || !mod) {
   8.139 +    if (*keyname == 'h') { // go left or split left
   8.140 +      *w /= 2;
   8.141 +    } else if (*keyname == 'j') { //go down or split down
   8.142 +      *h /= 2;
   8.143 +      *y += *h;
   8.144 +    } else if (*keyname == 'k') { //go up or split up
   8.145 +      *h /= 2;
   8.146 +    } else if (*keyname == 'l') { //go right or split right
   8.147 +      *w /= 2;
   8.148 +      *x += *w;
   8.149 +    }
   8.150 +  } else if (mod & ShiftMask) {
   8.151 +    if (*keyname == 'h') { // shift left
   8.152 +      if (*x > 0) *x -= *w;
   8.153 +    } else if (*keyname == 'j') { //shift down
   8.154 +      if ((*y + *h) < attr.height) *y += *h;
   8.155 +    } else if (*keyname == 'k') { //shift up
   8.156 +      if (*y > 0) *y -= *h;
   8.157 +    } else if (*keyname == 'l') { //shift right
   8.158 +      if ((*x + *w) < attr.width) *x += *w;
   8.159 +    }
   8.160 +  }
   8.161 +
   8.162 +  if (*w < 1 || *h < 1) {
   8.163 +    printf( "OOPS. Area too small. Giving up :(\n");
   8.164 +    return 0;
   8.165 +  }
   8.166 +
   8.167 +  printf("Box: @(%d,%d) #(%d,%d)\n", *x, *y, *w, *h);
   8.168 +  return 1;
   8.169 +}
   8.170 +
   8.171 +void startmousekey() {
   8.172 +  int hits = 0;
   8.173 +  int keysym;
   8.174 +  int done = 0;
   8.175 +  int x,y,w,h;
   8.176 +  int warp = 1;
   8.177 +  int click = 0;
   8.178 +
   8.179 +  Window zone;
   8.180 +
   8.181 +  grab("h",ShiftMask); grab("j",ShiftMask); grab("k",ShiftMask); grab("l",ShiftMask);
   8.182 +  grab("h",ControlMask); grab("j",ControlMask); grab("k",ControlMask); grab("l",ControlMask);
   8.183 +  grab("h",0); grab("j",0); grab("k",0); grab("l",0);
   8.184 +  grab("semicolon", 0); grab("space", 0); grab("Escape", 0);
   8.185 +
   8.186 +  x = y = 0;
   8.187 +  w = attr.width;
   8.188 +  h = attr.height;
   8.189 +
   8.190 +  zone = XCreateSimpleWindow(dpy, root, x, y, w, h, 1, BlackPixel(dpy, 0), WhitePixel(dpy, 0));
   8.191 +
   8.192 +  { /* Tell the window manager not to manage us */
   8.193 +    unsigned long valuemask;
   8.194 +    XSetWindowAttributes winattr;
   8.195 +    winattr.override_redirect = 1;
   8.196 +    XChangeWindowAttributes(dpy, zone, CWOverrideRedirect, &winattr);
   8.197 +  }
   8.198 +
   8.199 +  drawquadrants(zone, w, h);
   8.200 +  XMapWindow(dpy, zone);
   8.201 +  drawquadrants(zone, w, h);
   8.202 +
   8.203 +  printf("Starting quadrants...\n");
   8.204 +  while (!done) {
   8.205 +    XEvent e;
   8.206 +    XNextEvent(dpy, &e);
   8.207 +    switch (e.type) {
   8.208 +      case KeyPress:
   8.209 +        keysym = XKeycodeToKeysym(dpy, e.xkey.keycode, 0);
   8.210 +
   8.211 +        if (XStringToKeysym("semicolon") == keysym)
   8.212 +          done++;
   8.213 +        else if (XStringToKeysym("space") == keysym) {
   8.214 +          done++;
   8.215 +          click = 1;
   8.216 +        } else if (XStringToKeysym("Escape") == keysym) {
   8.217 +          warp = 0;
   8.218 +          done++;
   8.219 +        } else {
   8.220 +          if (handlekey(keysym, e.xkey.state, &x, &y, &w, &h)) {
   8.221 +            hits++;
   8.222 +            //if (hits > 5)
   8.223 +              //done++;
   8.224 +            //else {
   8.225 +            XMoveResizeWindow(dpy, zone, x, y, w, h);
   8.226 +            drawquadrants(zone, w, h);
   8.227 +            //}
   8.228 +          } else {
   8.229 +            done++;
   8.230 +          }
   8.231 +        }
   8.232 +        break;
   8.233 +      case KeyRelease:
   8.234 +      default:
   8.235 +        break;
   8.236 +    }
   8.237 +  }
   8.238 +
   8.239 +  endmousekey();
   8.240 +  XDestroyWindow(dpy, zone);
   8.241 +  if (warp)
   8.242 +    XWarpPointer(dpy, None, root, 0, 0, 0, 0, x + w/2, y + h/2);
   8.243 +  if (click) {
   8.244 +    XTestFakeButtonEvent(dpy, 1, True, CurrentTime); // button down
   8.245 +    XTestFakeButtonEvent(dpy, 1, False, CurrentTime); // button release
   8.246 +  }
   8.247 +}
   8.248 +
   8.249 +int main(int argc, char **argv) {
   8.250 +  char *pcDisplay;
   8.251 +  int ret;
   8.252 +
   8.253 +  if ( (pcDisplay = getenv("DISPLAY")) == NULL) {
   8.254 +    fprintf(stderr, "Error: DISPLAY environment variable not set\n");
   8.255 +    exit(1);
   8.256 +  }
   8.257 +
   8.258 +  printf("Display: %s\n", pcDisplay);
   8.259 +
   8.260 +  if ( (dpy = XOpenDisplay(pcDisplay)) == NULL) {
   8.261 +    fprintf(stderr, "Error: Can't open display: %s", pcDisplay);
   8.262 +    exit(1);
   8.263 +  }
   8.264 +
   8.265 +  root = XDefaultRootWindow(dpy);
   8.266 +  XGetWindowAttributes(dpy, root, &attr);
   8.267 +
   8.268 +  XGrabKey(dpy, XKeysymToKeycode(dpy, XStringToKeysym("semicolon")),
   8.269 +           ControlMask, root, False, GrabModeAsync, GrabModeAsync);
   8.270 +
   8.271 +  while (1) {
   8.272 +    XEvent e;
   8.273 +    XNextEvent(dpy, &e);
   8.274 +    switch (e.type) {
   8.275 +      case KeyPress:
   8.276 +        startmousekey();
   8.277 +        break;
   8.278 +      case KeyRelease:
   8.279 +      default:
   8.280 +        break;
   8.281 +    }
   8.282 +  }
   8.283 +}
   8.284 +
   8.285 +