# HG changeset patch # User paulo@thepaulopc # Date 1252475157 25200 # Node ID ab8a496afb67970f5ce04ed7cef77ec42379405d initial hg commit of my version of keynav diff -r 000000000000 -r ab8a496afb67 Imakefile --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Imakefile Tue Sep 08 22:45:57 2009 -0700 @@ -0,0 +1,10 @@ +DEPLIBS = $(DEPXTESTLIB) $(DEPEXTENSIONLIB) $(DEPXLIB) +LOCAL_LIBRARIES = $(XTESTLIB) $(EXTENSIONLIB) $(XLIB) + +SRCS = keynav.c +OBJS = keynav.o + +CC = gcc + +ComplexProgramTarget(keynav) + diff -r 000000000000 -r ab8a496afb67 Makefile --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Makefile Tue Sep 08 22:45:57 2009 -0700 @@ -0,0 +1,1290 @@ +# Makefile generated by imake - do not edit! +# $Xorg: imake.c,v 1.6 2001/02/09 02:03:15 xorgcvs Exp $ + +# ---------------------------------------------------------------------- +# Makefile generated from "Imake.tmpl" and +# $Xorg: Imake.tmpl,v 1.4 2000/08/17 19:41:46 cpqbld Exp $ +# $XdotOrg: xc/config/cf/Imake.tmpl,v 1.6 2004/07/28 03:24:29 gisburn Exp $ +# +# +# +# +# $XFree86: xc/config/cf/Imake.tmpl,v 3.155 2003/12/24 18:58:41 dickey Exp $ +# ---------------------------------------------------------------------- + +all:: + +.SUFFIXES: .i + +# $XdotOrg: xc/config/cf/Imake.cf,v 1.4 2004/08/11 21:14:01 kem Exp $ +# $Xorg: Imake.cf,v 1.4 2000/08/17 19:41:45 cpqbld Exp $ + +# $XFree86: xc/config/cf/Imake.cf,v 3.88 2003/12/16 21:30:21 herrb Exp $ + +# Keep cpp from replacing path elements containing i486/i586/i686 + +# ----------------------------------------------------------------------- +# site-specific configuration parameters that need to come before +# the platform-specific parameters - edit site.def to change + +# site: $TOG: site.sample /main/r64_final/1 1998/02/05 16:28:49 kaleb $ + +# site: $XFree86: xc/config/cf/site.def,v 3.24 2000/06/25 20:17:29 dawes Exp $ + +# $XFree86: xc/config/cf/xf86site.def,v 3.186 2003/06/25 18:06:22 eich Exp $ + +# ---------------------------------------------------------------------- +# platform-specific configuration parameters - edit linux.cf to change + +# $XdotOrg: xc/config/cf/linux.cf,v 1.13 2004/08/11 21:14:01 kem Exp $ +# platform: $Xorg: linux.cf,v 1.3 2000/08/17 19:41:47 cpqbld Exp $ + +# platform: $XFree86: xc/config/cf/linux.cf,v 3.220 2003/12/30 22:38:33 tsi Exp $ + +# operating system: Linux 2.6.17.8 i686 [ELF] (2.6.17) +# libc: (6.3.5) +# binutils: (215) + +# $Xorg: lnxLib.rules,v 1.3 2000/08/17 19:41:47 cpqbld Exp $ +# $XFree86: xc/config/cf/lnxLib.rules,v 3.52 2003/10/31 20:49:03 herrb Exp $ + +# $XdotOrg: xc/config/cf/xorg.cf,v 1.27.2.6 2005/01/24 03:11:42 gisburn Exp $ + +# $Xorg: xfree86.cf,v 1.4 2000/08/17 19:41:49 cpqbld Exp $ + +XORG_VERSION_CURRENT = (((6) * 10000000) + ((8) * 100000) + ((2) * 1000) + 0) +RELEASE_VERSION = RELEASE-1 + +AFB_DEFS = -DUSE_AFB + +DRIVERSDKDIR = $(USRLIBDIR)/Server +DRIVERSDKMODULEDIR = $(USRLIBDIR)/Server/modules +DRIVERSDKINCLUDEDIR = $(USRLIBDIR)/Server/include + + XF86SRC = $(SERVERSRC)/hw/xfree86 + XF86COMSRC = $(XF86SRC)/common + XF86PARSERSRC = $(XF86SRC)/parser + XF86OSSRC = $(XF86SRC)/os-support + XF86DRIVERSRC = $(XF86SRC)/drivers + DRIVERSRC = $(XF86DRIVERSRC) + + XFREE86DOCDIR = $(DOCDIR) + XFREE86PSDOCDIR = $(DOCPSDIR) + XFREE86PDFDOCDIR = $(DOCPDFDIR) + XFREE86HTMLDOCDIR = $(DOCHTMLDIR) +XFREE86JAPANESEDOCDIR = $(DOCDIR)/Japanese + +# $Xorg: xf86.rules,v 1.3 2000/08/17 19:41:48 cpqbld Exp $ + +# $XFree86: xc/config/cf/xf86.rules,v 3.34tsi Exp $ + +# ---------------------------------------------------------------------- +# site-specific configuration parameters that go after +# the platform-specific parameters - edit site.def to change + +# site: $TOG: site.sample /main/r64_final/1 1998/02/05 16:28:49 kaleb $ + +# site: $XFree86: xc/config/cf/site.def,v 3.24 2000/06/25 20:17:29 dawes Exp $ + +# --------------------------------------------------------------------- +# Imake rules for building libraries, programs, scripts, and data files +# rules: $Xorg: Imake.rules,v 1.3 2000/08/17 19:41:46 cpqbld Exp $ +# rules: $XdotOrg: xc/config/cf/Imake.rules,v 1.6 2004/08/13 17:21:43 krh Exp $ +# +# +# +# +# rules: $XFree86: xc/config/cf/Imake.rules,v 3.128 2003/11/15 03:25:17 dawes Exp $ + +.PHONY: all interfaces install install.man install.lib install.sdk depend includes cleandir + + _NULLCMD_ = @ echo -n + +X_BYTE_ORDER = X_LITTLE_ENDIAN + +GLIDE2INCDIR = + +GLIDE3INCDIR = + +GLIDE3LIBNAME = + +TKLIBNAME = + +TKLIBDIR = + +TCLLIBNAME = + +TCLIBDIR = + + PATHSEP = / + SHELL = /bin/sh -e + + TOP = . + CURRENT_DIR = . + + IMAKE = imake + DEPEND = gccmakedep + MKDIRHIER = mkdir -p + REVPATH = revpath + EXPORTLISTGEN = + RMAN = rman + RMANBASENAME = rman + RMANOPTIONS = -f HTML + CONFIGSRC = $(TOP)/config + IMAKESRC = $(CONFIGSRC)/imake + DEPENDSRC = $(CONFIGSRC)/util + + INCROOT = /usr/X11R6/include + USRLIBDIR = /usr/X11R6/lib + VARDIR = /var + VARLIBDIR = $(VARDIR)/lib + SYSTEMUSRLIBDIR = /usr/lib + SYSTEMUSRINCDIR = /usr/include + SHLIBDIR = /usr/X11R6/lib + LINTLIBDIR = $(USRLIBDIR)/lint + MANPATH = /usr/X11R6/man + MANSOURCEPATH = $(MANPATH)/man + MANDIR = $(MANSOURCEPATH)1 + LIBMANDIR = $(MANSOURCEPATH)3 + FILEMANDIR = $(MANSOURCEPATH)5 + MISCMANDIR = $(MANSOURCEPATH)$(MISCMANSUFFIX) + DRIVERMANDIR = $(MANSOURCEPATH)$(DRIVERMANSUFFIX) + LOGDIRECTORY = $(VARDIR)/log + + VARRUNDIR = $(VARDIR)/run + + VARDBDIR = $(VARDIR)/lib + + AR = ar clq + +# Nice try but useless: make will inherit BOOTSTRAPCFLAGS +# from top Makefile + BOOTSTRAPCFLAGS = + + CC = gcc -m32 + AS = gcc -m32 -c -x assembler + +.SUFFIXES: .cc + + CXX = c++ -m32 + + CXXFILT = c++filt + + CXXLIB = -lstdc++ + + CXXDEBUGFLAGS = -O2 -fno-strength-reduce -fno-strict-aliasing +CXXDEPENDINCLUDES = + CXXEXTRA_DEFINES = +CXXEXTRA_INCLUDES = + CXXSTD_DEFINES = -Dlinux -D__i386__ -D_POSIX_C_SOURCE=199309L -D_POSIX_SOURCE -D_XOPEN_SOURCE -D_BSD_SOURCE -D_SVID_SOURCE $(CXXPROJECT_DEFINES) + CXXOPTIONS = + CXXINCLUDES = $(INCLUDES) $(TOP_INCLUDES) $(CXXEXTRA_INCLUDES) + CXXDEFINES = $(CXXINCLUDES) $(CXXSTD_DEFINES) $(THREADS_CXXDEFINES) $(DEFINES) $(CXXEXTRA_DEFINES) + CXXFLAGS = $(CXXDEBUGFLAGS) $(CXXOPTIONS) $(THREADS_CXXFLAGS) $(CXXDEFINES) + + COMPRESS = compress + GZIPCMD = gzip + + CPP = cpp $(STD_CPP_DEFINES) + RAWCPP = cpp -undef $(STD_CPP_OPTIONS) + PREPROCESSCMD = gcc -m32 -E $(STD_CPP_DEFINES) + + INSTALL = install + INSTALLFLAGS = -c + + LD = gcc -m32 -nostdlib + + LEX = flex -l + M4 = m4 + M4FLAGS = + LEXLIB = -lfl + YACC = bison -y + CCYACC = bison -y + + LINT = lint + + LINTLIBFLAG = -C + LINTOPTS = -axz + LN = ln -s + MAKE = make + MV = mv -f + CP = cp + + RANLIB = ranlib + + RANLIBINSTFLAGS = + + RM = rm -f + PERL = perl + PERLOPTS = + PERLENVSETUP = env LC_ALL=C + MANSUFFIX = 1x + LIBMANSUFFIX = 3x + FILEMANSUFFIX = 5x + MISCMANSUFFIX = 7 + DRIVERMANSUFFIX = 4 + ADMINMANSUFFIX = 8 + MANSRCSUFFIX = man + MANNEWSUFFIX = _man + 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) + + COMPRESSMANCMD = gzip -n + + TROFF = groff -Tps + NROFF = nroff + + MSMACROS = -ms + MANMACROS = -man + TBL = tbl + EQN = eqn + NEQN = neqn + COL = col + COLFLAGS = -b + + MODCC = gcc -m32 + + MODCPP = cpp + MODCFLAGS = $(CFLAGS) + MODAS = gcc -m32 -c -x assembler + MODASFLAGS = + + MODLD = gcc -m32 -nostdlib + + MODLDFLAGS = +MODLDCOMBINEFLAGS = -r + MODAR = ar clq + + MODRANLIB = ranlib + + STD_INCLUDES = + STD_CPP_OPTIONS = -traditional + 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) + STD_DEFINES = -Dlinux -D__i386__ -D_POSIX_C_SOURCE=199309L -D_POSIX_SOURCE -D_XOPEN_SOURCE -D_BSD_SOURCE -D_SVID_SOURCE $(PROJECT_DEFINES) + EXTRA_LOAD_FLAGS = + EXTRA_LDOPTIONS = + EXTRA_LIBRARIES = + TAGS = ctags + + PARALLELMFLAGS = + + SHAREDCODEDEF = + SHLIBDEF = + + SHLIBLDFLAGS = -shared $(SHLIBGLOBALSFLAGS) + + PICFLAGS = -fPIC + + CXXPICFLAGS = -fPIC + + PROTO_DEFINES = -DFUNCPROTO=15 -DNARROWPROTO + + INSTPGMFLAGS = + + INSTBINFLAGS = -m 0755 + INSTUIDFLAGS = -m 4711 + INSTLIBFLAGS = -m 0644 + INSTINCFLAGS = -m 0444 + INSTMANFLAGS = -m 0444 + INSTDATFLAGS = -m 0444 + INSTKMEMFLAGS = -m 4711 + + PROJECTROOT = /usr/X11R6 + + CDEBUGFLAGS = -O2 -fno-strength-reduce -fno-strict-aliasing + CCOPTIONS = + + ALLINCLUDES = $(INCLUDES) $(EXTRA_INCLUDES) $(TOP_INCLUDES) $(INSTALLED_INCLUDES) $(STD_INCLUDES) + ALLDEFINES = $(ALLINCLUDES) $(STD_DEFINES) $(PROTO_DEFINES) $(THREADS_DEFINES) $(MODULE_DEFINES) $(DEFINES) $(EXTRA_DEFINES) + CFLAGS = $(CDEBUGFLAGS) $(CCOPTIONS) $(THREADS_CFLAGS) $(MODULE_CFLAGS) $(ALLDEFINES) + LINTFLAGS = $(LINTOPTS) -DLINT $(ALLDEFINES) $(DEPEND_DEFINES) + LDPRELIB = -L$(USRLIBDIR) $(INSTALLED_LIBS) + LDPOSTLIB = + LDOPTIONS = $(CDEBUGFLAGS) $(CCOPTIONS) $(EXTRA_LDOPTIONS) $(THREADS_LDFLAGS) $(LOCAL_LDFLAGS) $(LDPRELIBS) + CXXLDOPTIONS = $(CXXDEBUGFLAGS) $(CXXOPTIONS) $(EXTRA_LDOPTIONS) $(THREADS_CXXLDFLAGS) $(LOCAL_LDFLAGS) $(LDPRELIBS) + + LDLIBS = $(LDPOSTLIBS) $(THREADS_LIBS) $(SYS_LIBRARIES) $(EXTRA_LIBRARIES) + + CCLINK = $(CC) + + CXXLINK = $(CXX) + + LDSTRIPFLAGS = -x + LDCOMBINEFLAGS = -r + DEPENDFLAGS = + DEPEND_DEFINES = + +# Not sure this belongs here + TKLIBDIR = + TKINCDIR = + TKLIBNAME = + TKLIBRARY = -L$(TKLIBDIR) -l$(TKLIBNAME) + TCLLIBDIR = + TCLINCDIR = + TCLLIBNAME = + TCLLIBRARY = -L$(TCLLIBDIR) -l$(TCLLIBNAME) + + MACROFILE = linux.cf + RM_CMD = $(RM) + + IMAKE_DEFINES = + IMAKE_WARNINGS = -Wundef + + IRULESRC = $(CONFIGDIR) + IMAKE_CMD = $(IMAKE) -DUseInstalled -I$(IRULESRC) $(IMAKE_DEFINES) $(IMAKE_WARNINGS) + + 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) + +# $TOG: Motif.rules /main/4 1998/02/06 10:53:37 kaleb $ + +# $Id: LessTif.rules,v 1.2 2000/08/29 21:59:19 dannybackx Exp $ + +# $Xorg: X11.rules,v 1.4 2000/08/17 19:41:46 cpqbld Exp $ + +# $XFree86: xc/config/cf/X11.rules,v 1.6 2001/01/17 16:22:31 dawes Exp $ + +# $TOG: Motif.tmpl /main/5 1998/02/06 10:53:46 kaleb $ + +# $Id: LessTif.tmpl.in,v 1.3 2001/03/26 19:12:10 amai Exp $ + +# ---------------------------------------------------------------------- +# X Window System Build Parameters and Rules +# $XdotOrg: xc/config/cf/X11.tmpl,v 1.35.2.3 2005/02/01 04:07:39 gisburn Exp $ +# $Xorg: X11.tmpl,v 1.6 2000/08/17 19:41:46 cpqbld Exp $ +# +# +# +# +# $XFree86: xc/config/cf/X11.tmpl,v 1.248 2004/02/16 04:07:37 dawes Exp $ + +STICKY_DEFINES = -DHAS_STICKY_DIR_BIT + +FCHOWN_DEFINES = -DHAS_FCHOWN + +# ----------------------------------------------------------------------- +# X Window System make variables; these need to be coordinated with rules + + XTOP = $(TOP) + BINDIR = /usr/X11R6/bin + BUILDINCROOT = $(TOP)/exports + BUILDINCDIR = $(BUILDINCROOT)/include + BUILDINCTOP = ../.. + BUILDLIBDIR = $(TOP)/exports/lib + BUILDLIBTOP = ../.. + BUILDBINDIR = $(TOP)/exports/bin + BUILDBINTOP = ../.. + BUILDMODULEDIR = $(BUILDLIBDIR)/modules + BUILDI18NDIR = $(BUILDLIBDIR)/locale + BUILDMODULETOP = $(BUILDLIBTOP)/.. + XBUILDINCROOT = $(XTOP)/exports + XBUILDINCDIR = $(XBUILDINCROOT)/include/X11 + XBUILDINCTOP = ../../.. + XBUILDBINDIR = $(XBUILDINCROOT)/bin + INCDIR = $(INCROOT) + ADMDIR = /usr/adm + LIBDIR = /usr/X11R6/lib/X11 + LIBEXECDIR = /usr/X11R6/libexec + MODULEDIR = $(USRLIBDIR)/modules + TOP_X_INCLUDES = + XBINDIR = $(PROJECTROOT)/bin + + INSTSRCDIR = /usr/X11R6/src + + ETCX11DIR = /etc/X11 + + CONFDIR = $(ETCX11DIR) + + DOCDIR = $(LIBDIR)/doc + DOCHTMLDIR = $(DOCDIR)/html + DOCPSDIR = $(DOCDIR)/PostScript + DOCPDFDIR = $(DOCDIR)/PDF + FONTDIR = $(LIBDIR)/fonts + ENCODINGSDIR = $(FONTDIR)/encodings + XINITDIR = $(LIBDIR)/xinit + XDMDIR = $(LIBDIR)/xdm + XDMVARDIR = $(VARLIBDIR)/xdm + TWMDIR = $(LIBDIR)/twm + XSMDIR = $(LIBDIR)/xsm + NLSDIR = $(LIBDIR)/nls + XLOCALEDIR = $(LIBDIR)/locale + LBXPROXYDIR = $(LIBDIR)/lbxproxy + PROXYMANAGERDIR = $(LIBDIR)/proxymngr + XPRINTDIR = $(LIBDIR)/xserver + XAPPLOADDIR = $(LIBDIR)/app-defaults + FONTCFLAGS = -t + + INSTAPPFLAGS = $(INSTDATFLAGS) + + RGB = $(XBINDIR)/rgb + FONTC = $(XBINDIR)/bdftopcf + MKFONTSCALE = $(XBINDIR)/mkfontscale + MKFONTDIR = $(XBINDIR)/mkfontdir + MKHTMLINDEX = $(XBINDIR)/mkhtmlindex + UCS2ANY = $(XBINDIR)/ucs2any + BDFTRUNCATE = $(XBINDIR)/bdftruncate + UCSMAPPREFIX = $(FONTDIR)/util/map- + XCURSORGEN = $(XBINDIR)/xcursorgen + + HTMLINDEXCMD = $(MKHTMLINDEX) + + DOCUTILSRC = $(XTOP)/doc/util + CLIENTSRC = $(TOP)/clients + DEMOSRC = $(TOP)/demos + XDOCMACROS = $(DOCUTILSRC)/macros.t + XIDXMACROS = $(DOCUTILSRC)/indexmacros.t + PROGRAMSRC = $(TOP)/programs + LIBSRC = $(XTOP)/lib + FONTSRC = $(XTOP)/fonts + ENCODINGSSRC = $(FONTSRC)/encodings + INCLUDESRC = $(BUILDINCROOT)/include + XINCLUDESRC = $(INCLUDESRC)/X11 + SERVERSRC = $(XTOP)/programs/Xserver + CONTRIBSRC = $(XTOP)/../contrib + UNSUPPORTEDSRC = $(XTOP)/unsupported + DOCSRC = $(XTOP)/doc + RGBSRC = $(XTOP)/programs/rgb + BDFTOPCFSRC = $(PROGRAMSRC)/bdftopcf + MKFONTDIRSRC = $(PROGRAMSRC)/mkfontdir + FONTSERVERSRC = $(PROGRAMSRC)/xfs + FONTINCSRC = $(XTOP)/include/fonts + EXTINCSRC = $(XTOP)/include/extensions + FTSOURCEDIR = FreeTypeSrcDir + DRMSRCDIR = $(TOP)/extras/drm + MESASRCDIR = $(TOP)/extras/Mesa + OGLSAMPLESRCDIR = $(TOP)/extras/ogl-sample + PSWRAPSRC = $(XTOP)/config/pswrap + TRANSCOMMSRC = $(LIBSRC)/xtrans + TRANS_INCLUDES = -I$(TRANSCOMMSRC) + CONNECTION_FLAGS = -DUNIXCONN -DTCPCONN $(STICKY_DEFINES) $(FCHOWN_DEFINES) -DIPv6 +XTRANS_FAILDEFINES = -DFAIL_HARD + + VENDORMANNAME = X.Org + VENDORMANVERSION = `echo 6 8 2 | sed -e 's/ /./g' -e 's/^/Version\\\ /'` + XORGMANDEFS = -D__xorgversion__='"$(XORGRELSTRING)" "$(XORGMANNAME)"' + VENDORMANDEFS = -D__vendorversion__="$(VENDORMANVERSION) $(VENDORMANNAME)" + VENDORNAME = The X.Org Foundation + VENDORNAMESHORT = X.Org + + VENDORWEBSUPPORT = http://wiki.X.Org + +VENDORSUPPORTDEFS = -D__VENDORDWEBSUPPORT__='"$(VENDORWEBSUPPORT)"' + + XKBDEFRULES = xorg + XKBDEFRULESDEFS = -D__XKBDEFRULES__='"$(XKBDEFRULES)"' + + XCONFIGFILE = xorg.conf + XCONFIGDIR = $(LIBDIR) + XLOGFILE = Xorg + XSERVERNAME = Xorg + + XENVLIBDIR = $(USRLIBDIR) + CLIENTENVSETUP = LD_LIBRARY_PATH=$(MOTIFENVLIBDIR):$(XENVLIBDIR) XLOCALEDIR=$(BUILDLIBDIR)/locale + +# $Xorg: lnxLib.tmpl,v 1.3 2000/08/17 19:41:47 cpqbld Exp $ +# $XFree86: xc/config/cf/lnxLib.tmpl,v 3.19 2003/10/15 22:47:48 herrb Exp $ + + XLIBSRC = $(LIBSRC)/X11 + +SOXLIBREV = 6.2 +DEPXONLYLIB = +XONLYLIB = -lX11 + +LINTXONLY = $(LINTLIBDIR)/llib-lX11.ln + + DEPXLIBONLY = $(DEPXONLYLIB) + XLIBONLY = $(XONLYLIB) + LINTXONLYLIB = $(LINTXONLY) + + XEXTLIBSRC = $(LIBSRC)/Xext + +SOXEXTREV = 6.4 +DEPEXTENSIONLIB = +EXTENSIONLIB = -lXext + +LINTEXTENSION = $(LINTLIBDIR)/llib-lXext.ln + +LINTEXTENSIONLIB = $(LINTEXTENSION) + DEPXLIB = $(DEPEXTENSIONLIB) $(DEPXONLYLIB) + XLIB = $(EXTENSIONLIB) $(XONLYLIB) + LINTXLIB = $(LINTXONLYLIB) + + XSSLIBSRC = $(LIBSRC)/Xss + +SOXSSREV = 1.0 +DEPXSSLIB = +XSSLIB = -lXss + +LINTXSS = $(LINTLIBDIR)/llib-lXss.ln + + XXF86MISCLIBSRC = $(LIBSRC)/Xxf86misc + +SOXXF86MISCREV = 1.1 +DEPXXF86MISCLIB = +XXF86MISCLIB = -lXxf86misc + +LINTXXF86MISC = $(LINTLIBDIR)/llib-lXxf86misc.ln + + XXF86VMLIBSRC = $(LIBSRC)/Xxf86vm + +SOXXF86VMREV = 1.0 +DEPXXF86VMLIB = +XXF86VMLIB = -lXxf86vm + +LINTXXF86VM = $(LINTLIBDIR)/llib-lXxf86vm.ln + + XXF86DGALIBSRC = $(LIBSRC)/Xxf86dga + +SOXXF86DGAREV = 1.0 +DEPXXF86DGALIB = +XXF86DGALIB = -lXxf86dga + +LINTXXF86DGA = $(LINTLIBDIR)/llib-lXxf86dga.ln + + XXF86RUSHLIBSRC = $(LIBSRC)/Xxf86rush + +SOXXF86RUSHREV = 1.0 +DEPXXF86RUSHLIB = +XXF86RUSHLIB = -lXxf86rush + +LINTXXF86RUSH = $(LINTLIBDIR)/llib-lXxf86rush.ln + + XVLIBSRC = $(LIBSRC)/Xv + +SOXVREV = 1.0 +DEPXVLIB = +XVLIB = -lXv + +LINTXV = $(LINTLIBDIR)/llib-lXv.ln + + XVMCLIBSRC = $(LIBSRC)/XvMC + +SOXVMCREV = 1.0 +DEPXVMCLIB = +XVMCLIB = -lXvMC + +LINTXVMC = $(LINTLIBDIR)/llib-lXvMC.ln + + XINERAMALIBSRC = $(LIBSRC)/Xinerama + +SOXINERAMAREV = 1.0 +DEPXINERAMALIB = +XINERAMALIB = -lXinerama + +LINTXINERAMA = $(LINTLIBDIR)/llib-lXinerama.ln + + XRESLIBSRC = $(LIBSRC)/XRes + +SOXRESREV = 1.0 +DEPXRESLIB = +XRESLIB = -lXRes + +LINTXRES = $(LINTLIBDIR)/llib-lXRes.ln + + DMXLIBSRC = $(LIBSRC)/dmx + +DEPDMXLIB = $(USRLIBDIR)/libdmx.a +DMXLIB = -ldmx + +LINTDMX = $(LINTLIBDIR)/llib-ldmx.ln + + DPSLIBSRC = $(LIBSRC)/dps + +SODPSREV = 1.0 +DEPDPSLIB = +DPSLIB = -ldps + +LINTDPS = $(LINTLIBDIR)/llib-ldps.ln + + DPSTKLIBSRC = $(LIBSRC)/dpstk + +SODPSTKREV = 1.0 +DEPDPSTKLIB = +DPSTKLIB = -ldpstk + +LINTDPSTK = $(LINTLIBDIR)/llib-ldpstk.ln + + PSRESLIBSRC = $(LIBSRC)/psres + +SOPSRESREV = 1.0 +DEPPSRESLIB = +PSRESLIB = -lpsres + +LINTPSRES = $(LINTLIBDIR)/llib-lpsres.ln + + GLULIBSRC = $(LIBSRC)/GLU + +SOGLUREV = 1.3 +DEPGLULIB = +GLULIB = -lGLU + +LINTGLU = $(LINTLIBDIR)/llib-lGLU.ln + + GLXLIBSRC = $(LIBSRC)/GL + +SOGLREV = 1.2 +DEPGLXLIB = +GLXLIB = -lGL + +LINTGLX = $(LINTLIBDIR)/llib-lGL.ln + + GLWIDGETSRC = $(LIBSRC)/GLw + +SOGLWREV = 1.0 +DEPGLWLIB = +GLWLIB = -lGLw + +LINTGLW = $(LINTLIBDIR)/llib-lGLw.ln + + XRENDERLIBSRC = $(LIBSRC)/Xrender + +SOXRENDERREV = 1.2.2 +DEPXRENDERLIB = +XRENDERLIB = -lXrender + +LINTXRENDER = $(LINTLIBDIR)/llib-lXrender.ln + + XRANDRLIBSRC = $(LIBSRC)/Xrandr + +SOXRANDRREV = 2.0 +DEPXRANDRLIB = +XRANDRLIB = -lXrandr + +LINTXRANDR = $(LINTLIBDIR)/llib-lXrandr.ln + + XFIXESLIBSRC = $(LIBSRC)/Xfixes + +SOXFIXESREV = 3.0 +DEPXFIXESLIB = +XFIXESLIB = -lXfixes + +LINTXFIXES = $(LINTLIBDIR)/llib-lXfixes.ln + + XDAMAGELIBSRC = $(LIBSRC)/Xdamage + +SOXDAMAGEREV = 1.0 +DEPXDAMAGELIB = +XDAMAGELIB = -lXdamage + +LINTXDAMAGE = $(LINTLIBDIR)/llib-lXdamage.ln + +XCOMPOSITELIBSRC = $(LIBSRC)/Xcomposite + +SOXCOMPOSITEREV = 1.0 +DEPXCOMPOSITELIB = +XCOMPOSITELIB = -lXcomposite + +LINTXCOMPOSITE = $(LINTLIBDIR)/llib-lXcomposite.ln + +XEVIELIBSRC = $(LIBSRC)/Xevie + +SOXEVIEREV = 1.0 +DEPXEVIELIB = +XEVIELIB = -lXevie + +LINTXEVIE = $(LINTLIBDIR)/llib-lXevie.ln + + XCURSORLIBSRC = $(LIBSRC)/Xcursor + +SOXCURSORREV = 1.0.2 +DEPXCURSORLIB = +XCURSORLIB = -lXcursor + +LINTXCURSOR = $(LINTLIBDIR)/llib-lXcursor.ln + + APPLEWMLIBSRC = $(LIBSRC)/apple + +DEPAPPLEWMLIB = $(USRLIBDIR)/libAppleWM.a +APPLEWMLIB = -lAppleWM + +LINTAPPLEWM = $(LINTLIBDIR)/llib-lAppleWM.ln + + WINDOWSWMLIBSRC = $(LIBSRC)/windows + +DEPWINDOWSWMLIB = $(USRLIBDIR)/libWindowsWM.a +WINDOWSWMLIB = -lWindowsWM + +LINTWINDOWSWM = $(LINTLIBDIR)/llib-lWindowsWM.ln + + XFONTCACHELIBSRC = $(LIBSRC)/Xfontcache + +SOXFONTCACHEREV = 1.2 +DEPXFONTCACHELIB = +XFONTCACHELIB = -lXfontcache + +LINTXFONTCACHE = $(LINTLIBDIR)/llib-lXfontcache.ln + + XAUTHSRC = $(LIBSRC)/Xau + +DEPXAUTHLIB = $(USRLIBDIR)/libXau.a +XAUTHLIB = -lXau + +LINTXAUTH = $(LINTLIBDIR)/llib-lXau.ln + + XDMCPLIBSRC = $(LIBSRC)/Xdmcp + +DEPXDMCPLIB = $(USRLIBDIR)/libXdmcp.a +XDMCPLIB = -lXdmcp + +LINTXDMCP = $(LINTLIBDIR)/llib-lXdmcp.ln + + XMUSRC = $(LIBSRC)/Xmu + +SOXMUREV = 6.2 +DEPXMULIB = +XMULIB = -lXmu + +LINTXMU = $(LINTLIBDIR)/llib-lXmu.ln + + XMUUSRC = $(LIBSRC)/Xmuu + +SOXMUUREV = 1.0 +DEPXMUULIB = +XMUULIB = -lXmuu + +LINTXMUU = $(LINTLIBDIR)/llib-lXmuu.ln + + OLDXLIBSRC = $(LIBSRC)/oldX + +DEPOLDXLIB = $(USRLIBDIR)/liboldX.a +OLDXLIB = -loldX + +LINTOLDX = $(LINTLIBDIR)/llib-loldX.ln + + XPLIBSRC = $(LIBSRC)/Xp + +SOXPREV = 6.2 +DEPXPLIB = +XPLIB = -lXp + +LINTXP = $(LINTLIBDIR)/llib-lXp.ln + + TOOLKITSRC = $(LIBSRC)/Xt + +SOXTREV = 6.0 +DEPXTOOLONLYLIB = +XTOOLONLYLIB = -lXt + +LINTXTOOLONLY = $(LINTLIBDIR)/llib-lXt.ln + + DEPXTOOLLIB = $(DEPXTOOLONLYLIB) $(DEPSMLIB) $(DEPICELIB) + XTOOLLIB = $(XTOOLONLYLIB) $(SMLIB) $(ICELIB) + LINTXTOOLLIB = $(LINTXTOOLONLYLIB) + + XALIBSRC = $(LIBSRC)/Xa + +SOXAREV = 1.0 +DEPXALIB = +XALIB = -lXa + +LINTXA = $(LINTLIBDIR)/llib-lXa.ln + + AWIDGETSRC = $(LIBSRC)/Xaw + +SOXAWREV = 8.0 +DEPXAWLIB = +XAWLIB = -lXaw + +LINTXAW = $(LINTLIBDIR)/llib-lXaw.ln + + AWIDGET7SRC = $(LIBSRC)/Xaw7 + +SOXAW7REV = 7.0 +DEPXAW7LIB = +XAW7LIB = -lXaw + +LINTXAW7 = $(LINTLIBDIR)/llib-lXaw.ln + + AWIDGET6SRC = $(LIBSRC)/Xaw6 + +SOXAW6REV = 6.1 +DEPXAW6LIB = +XAW6LIB = -lXaw + +LINTXAW6 = $(LINTLIBDIR)/llib-lXaw.ln + + XILIBSRC = $(LIBSRC)/Xi + +SOXINPUTREV = 6.0 +DEPXILIB = +XILIB = -lXi + +LINTXI = $(LINTLIBDIR)/llib-lXi.ln + + XTESTLIBSRC = $(LIBSRC)/Xtst + +SOXTESTREV = 6.1 +DEPXTESTLIB = +XTESTLIB = -lXtst + +LINTXTEST = $(LINTLIBDIR)/llib-lXtst.ln + +DEPXBSDLIB = $(USRLIBDIR)/libXbsd.a +XBSDLIB = -lXbsd + +LINTXBSD = $(LINTLIBDIR)/llib-lXbsd.ln + + ICESRC = $(LIBSRC)/ICE + +SOICEREV = 6.3 +DEPICELIB = +ICELIB = -lICE + +LINTICE = $(LINTLIBDIR)/llib-lICE.ln + + SMSRC = $(LIBSRC)/SM + +SOSMREV = 6.0 +DEPSMLIB = +SMLIB = -lSM + +LINTSM = $(LINTLIBDIR)/llib-lSM.ln + + XKEYSRC = $(LIBSRC)/Xkey + +SOXKEYREV = 6.0 +DEPXKEYLIB = +XKEYLIB = -lXkey + +LINTXKEY = $(LINTLIBDIR)/llib-lXkey.ln + + FSLIBSRC = $(LIBSRC)/FS + +SOFSREV = 6.0 +DEPFSLIB = +FSLIB = -lFS + +LINTFS = $(LINTLIBDIR)/llib-lFS.ln + + FONTLIBSRC = $(LIBSRC)/font + +SOFONTREV = 1.5 +DEPFONTLIB = +FONTLIB = -L$(FREETYPELIBDIR) -L$(FONTLIBSRC) -lXfont + +LINTXFONT = $(LINTLIBDIR)/llib-lXfont.ln +# +SOFONTREV = 1.5 +DEPXFONTLIB = +XFONTLIB = -lXfont + +LINTXFONT = $(LINTLIBDIR)/llib-lXfont.ln + + FONTSTUBLIBSRC = $(FONTLIBSRC)/stubs + +DEPFONTSTUBLIB = $(USRLIBDIR)/libfntstubs.a +FONTSTUBLIB = -lfntstubs + +LINTFONTSTUB = $(LINTLIBDIR)/llib-lfntstubs.ln + DEPFONTLIB = $(DEPXFONTLIB) $(DEPFONTSTUBLIB) + FONTLIB = $(XFONTLIB) $(FONTSTUBLIB) $(FREETYPE2LIB) + + FONTENCLIBSRC = $(LIBSRC)/fontenc + +SOFONTENCREV = 1.0 +DEPXFONTENCLIB = +XFONTENCLIB = -lfontenc + +LINTXFONTENC = $(LINTLIBDIR)/llib-lfontenc.ln + + XPMLIBSRC = $(LIBSRC)/Xpm + +SOXPMREV = 4.11 +DEPXPMLIB = +XPMLIB = -lXpm + +LINTXPM = $(LINTLIBDIR)/llib-lXpm.ln + +FREETYPE2DIR = /usr +FREETYPE2LIBDIR = /usr/lib +FREETYPE2INCDIR = /usr/include + +FREETYPE2LIB = -lfreetype + +FREETYPE2INCLUDES = -I$(FREETYPE2INCDIR)/freetype2 -I$(FREETYPE2INCDIR)/freetype2/config + +FREETYPE2DEFINES = -DFREETYPE2 + + EXPATLIBSRC = $(LIBSRC)/expat + +SOEXPATREV = 0.4 +DEPEXPATLIB = +EXPATLIB = -lexpat + +LINTEXPAT = $(LINTLIBDIR)/llib-lexpat.ln + +EXPATDIR = /usr +EXPATLIBDIR = /usr/lib +EXPATINCDIR = /usr/include + +EXPATINCLUDES = + +EXPATLIB = -lexpat + +EXPATDEFINES = -DEXPAT + + XFT1LIBSRC = $(LIBSRC)/Xft1 + +SOXFT1REV = 1.1 +DEPXFT1LIB = +XFT1LIB = -lXft + +LINTXFT1 = $(LINTLIBDIR)/llib-lXft.ln + + XFTLIBSRC = $(LIBSRC)/Xft + +SOXFTREV = 2.1.2 +DEPXFTLIB = +XFTLIB = -lXft + +LINTXFT = $(LINTLIBDIR)/llib-lXft.ln + + FONTCONFIGLIBSRC = $(LIBSRC)/fontconfig + +SOFONTCONFIGREV = 1.0.4 +DEPFONTCONFIGLIB = +FONTCONFIGLIB = -lfontconfig + +LINTFONTCONFIG = $(LINTLIBDIR)/llib-lfontconfig.ln + +FONTCONFIGINCDIR=$(INCDIR) + +FONTCONFIGINCLUDES = -I$(FONTCONFIGINCDIR) + +FCCACHE = $(BINDIR)/fc-cache + +FONTCONFIGDEFINES = -DFONTCONFIG + +XFTINCLUDES=$(FONTCONFIGINCLUDES) $(FREETYPE2INCLUDES) + +LIBPNGINCDIR = /usr/include + +LIBPNGINC= + +LIBPNGDIR = /usr +LIBPNGLIBDIR = /usr/lib +LIBPNGINCDIR = /usr/include + +LIBPNGLIB = -lpng + + XKBFILELIBSRC = $(LIBSRC)/xkbfile + +SOXKBFILEREV = 1.0 +DEPXKBFILELIB = +XKBFILELIB = -lxkbfile + +LINTXKBFILE = $(LINTLIBDIR)/llib-lxkbfile.ln + + XKBCOMPCMD = $(XBINDIR)/xkbcomp + + XKBUILIBSRC = $(LIBSRC)/xkbui + +SOXKBUIREV = 1.0 +DEPXKBUILIB = +XKBUILIB = -lxkbui + +LINTXKBUI = $(LINTLIBDIR)/llib-lxkbui.ln + +EXTRAXAWREQS = $(XPLIB) + +EXTRAXAWCLIENTDEPLIBS = $(DEPXPLIB) + +EXTRAXAWCLIENTLIBS = $(XPLIB) + + XTRAPLIBSRC = $(LIBSRC)/XTrap + +SOXTRAPREV = 6.4 +DEPXTRAPLIB = +XTRAPLIB = -lXTrap + +LINTXTRAP = $(LINTLIBDIR)/llib-lXTrap.ln + + DEPLIBS = $(DEPXAWLIB) $(DEPXMULIB) $(DEPXTOOLLIB) $(DEPXLIB) + + DEPLIBS1 = $(DEPLIBS) + DEPLIBS2 = $(DEPLIBS) + DEPLIBS3 = $(DEPLIBS) + DEPLIBS4 = $(DEPLIBS) + DEPLIBS5 = $(DEPLIBS) + DEPLIBS6 = $(DEPLIBS) + DEPLIBS7 = $(DEPLIBS) + DEPLIBS8 = $(DEPLIBS) + DEPLIBS9 = $(DEPLIBS) + DEPLIBS10 = $(DEPLIBS) + + FCPRELOADPATTERN = libfontconfig.so.? + + XFTPRELOADPATTERN = libXft.so.? + XRENDERPRELOADPATTERN = libXrender.so.? + XFONTPRELOADPATTERN = libXfont*.so.? + + MTOP = $(TOP) +TOP_MOTIF_INCLUDES = + + UIL_INCLUDES = -I$(USRINCDIR)/uil + + MOTIFENVLIBDIR = $(USRLIBDIR) + + USRINCDIR = /usr/X11R6/include + UIDDIR = $(LIBDIR)/uid + TESTSRC = $(MTOP)/tests + TESTLIB = $(TESTSRC)/lib + GENERALSRCLIB = $(TESTSRC)/General/lib + GENERALSRCBIN = $(TESTSRC)/General/bin + MANUALSRCLIB = $(TESTSRC)/Manual/lib + MANUALSRCBIN = $(TESTSRC)/Manual/bin + AUTOSRCLIB = $(TESTSRC)/Auto/lib + AUTOSRCBIN = $(TESTSRC)/Auto/bin + COMMONPP = $(GENERALSRCBIN)/Commonpp + GENRUN = $(GENERALSRCBIN)/Genrun + MANRUN = $(GENERALSRCBIN)/Manrun + + TESTCOMSRC = $(MANUALSRCLIB)/Common + + BUILDDOCDIR = $(BUILDINCROOT)/doc + BUILDLOCDIR = $(BUILDINCROOT)/localized + + MTOOLKITSRC = $(TOOLKITSRC) + + MINCLUDESRC = $(MTOP)/include + MDOCSRC = $(MTOP)/doc + MLOCSRC = $(MTOP)/localized + + MLIBSRC = $(MTOP)/lib + MCLIENTSRC = $(MTOP)/clients + MDEMOSRC = $(MTOP)/demos + MWIDGETSRC = $(MLIBSRC)/Xm + MRESOURCESRC = $(MLIBSRC)/Mrm + UILSRC = $(MCLIENTSRC)/uil + + UIL = uil + DEPUIL = $(BINDIR)/uil + + XMEXTRA_LIBS = + +SOXMREV = 2.1 +DEPXMLIB = +XMLIB = -lXm + +LINTXM = $(LINTLIBDIR)/llib-lXm.ln + +SOMRMREV = 2.1 +DEPMRESOURCELIB = +MRESOURCELIB = -lMrm + +LINTMRESOURCE = $(LINTLIBDIR)/llib-lMrm.ln + +SOUILREV = 2.1 +DEPUILLIB = +UILLIB = -lUil + +LINTUIL = $(LINTLIBDIR)/llib-lUil.ln + +SOMCOMMONREV = 2.1 +DEPTESTCOMLIB = +TESTCOMLIB = -lMCommon + +LINTTESTCOM = $(LINTLIBDIR)/llib-lMCommon.ln + +TESTUILCOMLIB = $(TESTCOMSRC)/libMCommonUil.a + + LINTMRESOURCE = $(MRESOURCESRC)/libMrm.a +LINTXMWIDGETLIB = $(MWIDGETSRC)/llib-l/Xm.ln + LINTXMTOOL = $(MTOOLKITSRC)/llib-lXt.ln + LINTUILLIB = $(UILSRC)/llib-lUil.ln + + YACCFLAGS = + UILFLAGS = + GENCATFLAGS = + GENCAT = gencat $(GENCATFLAGS) + MKCATTOOL = $(MLOCSRC)/util/mkcatdefs + + RM_CMD = $(RM) *.CKP *.ln *.BAK *.bak *.o core errs ,* *~ *.a .emacs_* tags TAGS make.log MakeOut *.Dat + + DEPLIBS = $(DEPXMLIB) $(DEPXTOOLLIB) $(DEPXPLIB) $(DEPXLIB) + + DEPLIBS1 = $(DEPLIBS) + DEPLIBS2 = $(DEPLIBS) + DEPLIBS3 = $(DEPLIBS) + +XMULIBONLY = -lXmu +XMULIB = $(XMULIBONLY) $(XTOOLLIB) $(XLIB) + + CONFIGDIR = $(LIBDIR)/config + + USRLIBDIRPATH = $(USRLIBDIR) + LDPRELIBS = -L$(USRLIBDIR) $(INSTALLED_LIBS) + LDPOSTLIBS = + TOP_INCLUDES = $(TOP_MOTIF_INCLUDES) -I$(INCROOT) $(TOP_X_INCLUDES) + PROJECT_DEFINES = -DNO_MESSAGE_CATALOG + VENDOR_DEFINES = -DXVENDORNAME='"$(VENDORNAME)"' -DXVENDORNAMESHORT='"$(VENDORNAMESHORT)"' + +CXXPROJECT_DEFINES = -DNO_MESSAGE_CATALOG + +# ---------------------------------------------------------------------- +# start of Imakefile + +DEPLIBS = $(DEPXTESTLIB) $(DEPEXTENSIONLIB) $(DEPXLIB) +LOCAL_LIBRARIES = $(XTESTLIB) $(EXTENSIONLIB) $(XLIB) + +SRCS = keynav.c +OBJS = keynav.o + +CC = gcc + + PROGRAM = keynav + +all:: keynav + +keynav: $(OBJS) $(DEPLIBS) + $(RM) $@ + $(CCLINK) -o $@ $(LDOPTIONS) $(OBJS) $(LOCAL_LIBRARIES) $(LDLIBS) $(EXTRA_LOAD_FLAGS) + +install:: keynav + @if [ -d $(DESTDIR)$(BINDIR) ]; then \ + set +x; \ + else \ + if [ -h $(DESTDIR)$(BINDIR) ]; then \ + (set -x; rm -f $(DESTDIR)$(BINDIR)); \ + fi; \ + (set -x; $(MKDIRHIER) $(DESTDIR)$(BINDIR)); \ + fi + $(INSTALL) $(INSTALLFLAGS) $(INSTPGMFLAGS) keynav $(DESTDIR)$(BINDIR)/keynav + +all:: keynav.$(MANSUFFIX).html + +keynav.$(MANSUFFIX).html: keynav.$(MANNEWSUFFIX) + $(RM) keynav.$(MANSUFFIX).html keynav.$(MANSUFFIX)-html + $(RMAN) $(RMANOPTIONS) < keynav.$(MANNEWSUFFIX) \ + > keynav.$(MANSUFFIX)-html && $(MV) keynav.$(MANSUFFIX)-html $@ + +install.man:: keynav.$(MANSUFFIX).html + @if [ -d $(DESTDIR)$(DOCHTMLDIR) ]; then \ + set +x; \ + else \ + if [ -h $(DESTDIR)$(DOCHTMLDIR) ]; then \ + (set -x; rm -f $(DESTDIR)$(DOCHTMLDIR)); \ + fi; \ + (set -x; $(MKDIRHIER) $(DESTDIR)$(DOCHTMLDIR)); \ + fi + @(SUF=`expr $(MANSUFFIX) \: '\(.\)'`; \ + set -x; \ + $(INSTALL) $(INSTALLFLAGS) $(INSTMANFLAGS) keynav.$(MANSUFFIX).html $(DESTDIR)$(DOCHTMLDIR)/keynav.$$SUF.html) + +cleandir:: + $(RM) keynav.$(MANSUFFIX).html keynav.$(MANSUFFIX)-html + +all:: keynav.$(MANNEWSUFFIX) + +keynav.$(MANNEWSUFFIX): keynav.$(MANSRCSUFFIX) + $(RM) $@ + if test -z "$(PREPROCESSMANPAGES)" ; then \ + cd `dirname keynav` && \ + $(LN) `basename keynav.$(MANSRCSUFFIX)` `basename $@`; \ + else \ + $(RAWCPP) $(MANDEFS) $(EXTRAMANDEFS) \ + < 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/\@\@$$/\\/' >$@; \ + fi + +cleandir:: + $(RM) keynav.$(MANNEWSUFFIX) + +install.man:: keynav.$(MANNEWSUFFIX) + @if [ -d $(DESTDIR)$(MANDIR) ]; then \ + set +x; \ + else \ + if [ -h $(DESTDIR)$(MANDIR) ]; then \ + (set -x; rm -f $(DESTDIR)$(MANDIR)); \ + fi; \ + (set -x; $(MKDIRHIER) $(DESTDIR)$(MANDIR)); \ + fi + $(INSTALL) $(INSTALLFLAGS) $(INSTMANFLAGS) keynav.$(MANNEWSUFFIX) $(DESTDIR)$(MANDIR)/keynav.$(MANSUFFIX) + +depend:: + $(DEPEND) $(DEPENDFLAGS) -- $(ALLDEFINES) $(DEPEND_DEFINES) -- $(SRCS) + +lint: + $(LINT) $(LINTFLAGS) $(SRCS) $(LINTLIBS) +lint1: + $(LINT) $(LINTFLAGS) $(FILE) $(LINTLIBS) + +cleandir:: + $(RM) keynav + +# ---------------------------------------------------------------------- +# common rules for all Makefiles - do not edit + +.c.i: + $(RM) $@ + $(CC) -E $(CFLAGS) $(_NOOP_) $*.c > $@ + +.SUFFIXES: .ii + +.cc.ii: + $(RM) $@ + $(CC) -E $(CFLAGS) $(_NOOP_) $*.cc > $@ + +.SUFFIXES: .s + +.c.s: + $(RM) $@ + $(CC) -S $(CFLAGS) $(_NOOP_) $*.c + +.cc.s: + $(RM) $@ + $(CC) -S $(CFLAGS) $(_NOOP_) $*.cc + +emptyrule:: + +cleandir:: + $(RM) *.CKP *.ln *.BAK *.bak *.o core errs ,* *~ *.a .emacs_* tags TAGS make.log MakeOut "#"* + +Makefile:: + -@if [ -f Makefile ]; then set -x; \ + $(RM) Makefile.bak; $(MV) Makefile Makefile.bak; \ + else exit 0; fi + $(IMAKE_CMD) -DTOPDIR=$(TOP) -DCURDIR=$(CURRENT_DIR) + +tags:: + $(TAGS) -w *.[ch] + $(TAGS) -xw *.[ch] > TAGS + +man_keywords:: + +html_index:: + @if [ -d $(DESTDIR)$(DOCHTMLDIR) ]; then \ + set +x; \ + else \ + if [ -h $(DESTDIR)$(DOCHTMLDIR) ]; then \ + (set -x; rm -f $(DESTDIR)$(DOCHTMLDIR)); \ + fi; \ + (set -x; $(MKDIRHIER) $(DESTDIR)$(DOCHTMLDIR)); \ + fi + $(HTMLINDEXCMD) $(DESTDIR)$(DOCHTMLDIR) + +clean:: cleandir + +distclean:: cleandir + +# ---------------------------------------------------------------------- +# empty rules for directories that do not have SUBDIRS - do not edit + +install:: + @echo "install in $(CURRENT_DIR) done" + +install.man:: + @echo "install.man in $(CURRENT_DIR) done" + +install.sdk:: + @echo "install.sdk in $(CURRENT_DIR) done" + +Makefiles:: + +includes:: + +depend:: + +distclean:: + $(RM) Makefile Makefile.dep + +# ---------------------------------------------------------------------- +# dependencies generated by makedepend + diff -r 000000000000 -r ab8a496afb67 README --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/README Tue Sep 08 22:45:57 2009 -0700 @@ -0,0 +1,62 @@ +2008-05-06 + +This is Jordan Sissel's 'keynav', modified by Paulo Ang. + +http://www.semicomplete.com/projects/keynav +http://iacs5.ucsd.edu/~pbang/mouseless.htm + +Note that this is based on an earlier release of 'keynav', not the +latest 'xdotool' based code. + + +To build: + +Run 'xmkmf', then 'make keynav'. + +To run: + +Simply run 'keynav'. For a list of the default keys see 'config.h'. + +To configure keys: + +Modify 'config.h' and recompile. + +To configure even more: + +Modify 'keynav.c' and recompile. + + +Hints: + +It's faster to use the "diagonal" movement keys, since they split the +mouse area into four accessible parts, but the binary vi-keys is easier +when you're just starting out or fine-tuning a small area. + +A good tactic would be to use the diagonal keys until the point you want to +click on is exactly on the crosshairs (or the selection area is too small), +then just use vi-keys to hone in. + +The nine-grid mode is even faster than the regular four-grid mode. +Enable it by default by specifying '-n ' parameters to keynav, where + is the number of moves before it automatically switches back to +four-grid mode. Or press Shift-[center]. But you may want to hold off on +using it until you get the hang of the four-grid mode first. + +You can have two instances of 'keynav' running simulataneously, as long as +they have different trigger keys. You may want to do this to be able to use +both home row keys and the numeric keypad to 'keynav', for example. + + +About the statistics: + +'keynav' outputs debug messages to stderr, and stats to stdout. Simply +redirect to taste. 'hits' are the number of keys you've hit, 'moves' are the +number of movements made, and 'clicks' are the number of mouseclicks + not including simple clicks (ie, clicks that don't end the movement mode). + + +If 'keynav' appears to hang: + +It's probably because of the drag mode, which can be buggy with some apps. +A click from your real mouse will probably restore keyboard control, where +you can kill 'keynav' and start it up again. diff -r 000000000000 -r ab8a496afb67 config.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/config.h Tue Sep 08 22:45:57 2009 -0700 @@ -0,0 +1,48 @@ +/* + * + * This is the C header configuration file for changing some of + * the internal variables in 'keynav'. + * + */ + +/* window appearances */ +#define BORDER 5 /* pixels */ +#define PEN 3 /* pixels */ +#define LINEWIDTH 3 /* pixels */ +#define DRAG_COLOR "red" /* color when dragging*/ +#define NORM_COLOR "yellow" /* color, normal */ + +/* keys -- see 'xev' for keysym strings */ +#define TRIGGERMASK Mod4Mask /* X modifier key -- see 'xmodmap' */ +#define KEY_LEFT "h" /* single characters */ +#define KEY_DOWN "j" +#define KEY_UP "k" +#define KEY_RIGHT "l" +#define KEY_UPLEFT "a" +#define KEY_DOWNLEFT "s" +#define KEY_UPRIGHT "d" +#define KEY_DOWNRIGHT "f" +#define KEY_CENTER "g" /* shift this toggles nine grid manually */ +#define KEY_ONE "1" /* left mouse button (simple click) */ +#define KEY_TWO "2" /* middle mouse button (simple click) */ +#define KEY_THREE "3" /* right mouse button (simple click) */ +#define KEY_TRIGGER "semicolon" /* trigger key */ +#define KEY_Q_CLICK "semicolon" /* quick click (no warp) */ +#define KEY_Q_RCLICK "apostrophe" /* quick right click (no warp) */ +#define KEY_Q_MCLICK "backslash" /* quick middle click (no warp) */ +#define KEY_QW_CLICK "space" /* quick click (warp) */ +#define KEY_QW_RCLICK "Return" /* quick right click (warp) */ +#define KEY_ESCAPE "Escape" /* cancel */ +#define KEY_UNDO "u" /* undo */ +#define KEY_HIDE "q" /* hide mouse cursor away to the lower right corner of screen */ + +/* more mod masks */ +#define CAPSLOCKMASK LockMask +#define NUMLOCKMASK Mod2Mask +#define SHIFTMASK ShiftMask /* shifting instead of splitting */ +#define DRAGMASK ShiftMask /* dragging */ +#define WARPMASK Mod4Mask /* warp during splitting/shifting */ + +/* undo options */ +#define N_UNDO 15 /* max number of undo history -- must be at least 1 */ +#define SHIFT_N_UNDO 2 /* number of undo history to jump back through when holding shift */ diff -r 000000000000 -r ab8a496afb67 config.h.default --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/config.h.default Tue Sep 08 22:45:57 2009 -0700 @@ -0,0 +1,47 @@ +/* + * + * This is the C header configuration file for changing some of + * the internal variables in 'keynav'. + * + */ + +/* window appearances */ +#define BORDER 5 /* pixels */ +#define PEN 3 /* pixels */ +#define LINEWIDTH 3 /* pixels */ +#define DRAG_COLOR "red" /* color when dragging*/ +#define NORM_COLOR "yellow" /* color, normal */ + +/* keys -- see 'xev' for keysym strings */ +#define TRIGGERMASK Mod4Mask /* X modifier key -- see 'xmodmap' */ +#define KEY_LEFT "h" /* single characters */ +#define KEY_DOWN "j" +#define KEY_UP "k" +#define KEY_RIGHT "l" +#define KEY_UPLEFT "a" +#define KEY_DOWNLEFT "s" +#define KEY_UPRIGHT "d" +#define KEY_DOWNRIGHT "f" +#define KEY_CENTER "g" /* shift this toggles nine grid manually */ +#define KEY_ONE "1" /* left mouse button (simple click) */ +#define KEY_TWO "2" /* middle mouse button (simple click) */ +#define KEY_THREE "3" /* right mouse button (simple click) */ +#define KEY_TRIGGER "semicolon" /* trigger key */ +#define KEY_Q_CLICK "semicolon" /* quick click (no warp) */ +#define KEY_Q_RCLICK "apostrophe" /* quick right click (no warp) */ +#define KEY_Q_MCLICK "backslash" /* quick middle click (no warp) */ +#define KEY_QW_CLICK "space" /* quick click (warp) */ +#define KEY_QW_RCLICK "Return" /* quick right click (warp) */ +#define KEY_ESCAPE "Escape" /* cancel */ +#define KEY_UNDO "u" /* undo */ + +/* more mod masks */ +#define CAPSLOCKMASK LockMask +#define NUMLOCKMASK Mod2Mask +#define SHIFTMASK ShiftMask /* shifting instead of splitting */ +#define DRAGMASK ShiftMask /* dragging */ +#define WARPMASK Mod4Mask /* warp during splitting/shifting */ + +/* undo options */ +#define N_UNDO 15 /* max number of undo history -- must be at least 1 */ +#define SHIFT_N_UNDO 2 /* number of undo history to jump back through when holding shift */ diff -r 000000000000 -r ab8a496afb67 config.h.keypad --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/config.h.keypad Tue Sep 08 22:45:57 2009 -0700 @@ -0,0 +1,47 @@ +/* + * + * This is the C header configuration file for changing some of + * the internal variables in 'keynav'. + * + */ + +/* window appearances */ +#define BORDER 5 /* pixels */ +#define PEN 3 /* pixels */ +#define LINEWIDTH 3 /* pixels */ +#define DRAG_COLOR "red" /* color when dragging*/ +#define NORM_COLOR "yellow" /* color, normal */ + +/* keys -- see 'xev' for keysym strings */ +#define TRIGGERMASK Mod4Mask /* X modifier key -- see 'xmodmap' */ +#define KEY_LEFT "KP_Left" +#define KEY_DOWN "KP_Down" +#define KEY_UP "KP_Up" +#define KEY_RIGHT "KP_Right" +#define KEY_UPLEFT "KP_Home" +#define KEY_DOWNLEFT "KP_End" +#define KEY_UPRIGHT "KP_Prior" +#define KEY_DOWNRIGHT "KP_Next" +#define KEY_CENTER "KP_Begin" /* shift this toggles nine grid manually */ +#define KEY_ONE "1" /* left mouse button (simple click) */ +#define KEY_TWO "2" /* middle mouse button (simple click) */ +#define KEY_THREE "3" /* right mouse button (simple click) */ +#define KEY_TRIGGER "KP_Begin" /* trigger key */ +#define KEY_Q_CLICK "KP_Divide" /* quick click (no warp) */ +#define KEY_Q_RCLICK "KP_Multiply" /* quick right click (no warp) */ +#define KEY_Q_MCLICK "KP_Subtract" /* quick middle click (no warp) */ +#define KEY_QW_CLICK "KP_Enter" /* quick click (warp) */ +#define KEY_QW_RCLICK "KP_Add" /* quick right click (warp) */ +#define KEY_ESCAPE "Escape" /* cancel */ +#define KEY_UNDO "KP_Insert" /* undo */ + +/* more mod masks */ +#define CAPSLOCKMASK LockMask +#define NUMLOCKMASK Mod2Mask +#define SHIFTMASK ShiftMask /* shifting instead of splitting */ +#define DRAGMASK ShiftMask /* dragging */ +#define WARPMASK Mod4Mask /* warp during splitting/shifting */ + +/* undo options */ +#define N_UNDO 15 /* max number of undo history -- must be at least 1 */ +#define SHIFT_N_UNDO 2 /* number of undo history to jump back through when holding shift */ diff -r 000000000000 -r ab8a496afb67 keynav.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/keynav.c Tue Sep 08 22:45:57 2009 -0700 @@ -0,0 +1,523 @@ +/* + * Visual user-directed binary search for something to point your mouse at. + */ + +#include "config.h" + +#include +#include +#include + +#include +#include +#include +#include +#include + +Display *dpy; +Window root; +XWindowAttributes attr; +int drag = 0; +int allmoves = 0; +int allhits = 0; +int allclicks = 0; +int ninegrid_default = 0; +int ninegrid_n_switch = 0; +int ninegrid = 0; + +struct /* undo stack */ +{ + int x[N_UNDO]; + int y[N_UNDO]; + int w[N_UNDO]; + int h[N_UNDO]; + int ninegrid[N_UNDO]; +} u; + +void toggleninegrid() { + if (ninegrid) + ninegrid = 0; + else + ninegrid = 1; +} + +void stats(int hits, int moves) { + allhits += hits; + allmoves += moves; + allclicks++; + printf("hits=%d, moves=%d \n", hits, moves); + 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); + fflush(stdout); fflush(stderr); // force buffers to write out +} + +void grab(char *keyname, int mods) { + int key; + + key = XKeysymToKeycode(dpy, XStringToKeysym(keyname)); + XGrabKey(dpy, key, mods, root, False, + GrabModeAsync, GrabModeAsync); + XGrabKey(dpy, key, mods | CAPSLOCKMASK, root, False, + GrabModeAsync, GrabModeAsync); + XGrabKey(dpy, key, mods | NUMLOCKMASK, root, False, + GrabModeAsync, GrabModeAsync); + XGrabKey(dpy, key, mods | CAPSLOCKMASK | NUMLOCKMASK, root, False, + GrabModeAsync, GrabModeAsync); +} + +void ungrab(char *keyname, int mod) { + int key; + + key = XKeysymToKeycode(dpy, XStringToKeysym(keyname)); + XUngrabKey(dpy, key, mod, root); + XUngrabKey(dpy, key, mod | CAPSLOCKMASK, root); + XUngrabKey(dpy, key, mod | NUMLOCKMASK, root); + XUngrabKey(dpy, key, mod | CAPSLOCKMASK | NUMLOCKMASK, root); +} + +void buttondown(int i) { + XTestFakeButtonEvent(dpy, i, True, 50); +} + +void buttonup(int i) { + XTestFakeButtonEvent(dpy, i, False, 50); +} + +void warppointer(int x, int y, int w, int h) { + XWarpPointer(dpy, None, root, 0, 0, 0, 0, x + w/2, y + h/2); +} + +/* operations for undo */ +void undo_stack_push(int x, int y, int w, int h) { + int i; + + if (x >= 0 && y >= 0 && w > 0 && h > 0) { + fprintf(stderr,"undo_stack_push success: @(%d,%d) #(%d,%d)\n", x, y, w, h); + for (i=N_UNDO-1; i>0; i--) { + u.x[i] = u.x[i-1]; + u.y[i] = u.y[i-1]; + u.w[i] = u.w[i-1]; + u.h[i] = u.h[i-1]; + u.ninegrid[i] = u.ninegrid[i-1]; + } + u.x[0] = x; + u.y[0] = y; + u.w[0] = w; + u.h[0] = h; + u.ninegrid[0] = ninegrid; + } +} + +int undo_stack_pop(int *x, int *y, int *w, int *h, int *ninegrid) { + int i; + int ret = 0; + + int rx = u.x[0]; + int ry = u.y[0]; + int rw = u.w[0]; + int rh = u.h[0]; + int rninegrid = u.ninegrid[0]; + + if (rx >= 0 && ry >= 0 && rw > 0 && rh > 0) { + fprintf(stderr,"undo_stack_pop success: @(%d,%d) #(%d,%d)\n", *x, *y, *w, *h); + ret = 1; // return success + for (i=0; i 0) *x -= *w; // shift left + } + if (chk_keysym(keysym, KEY_DOWN) || chk_keysym(keysym, KEY_DOWNLEFT) || chk_keysym(keysym, KEY_DOWNRIGHT)) { + if ((*y + *h) < attr.height) *y += *h; // shift down + } + if (chk_keysym(keysym, KEY_UP) || chk_keysym(keysym, KEY_UPLEFT) || chk_keysym(keysym, KEY_UPRIGHT)) { + if (*y > 0) *y -= *h; // shift up + } + if (chk_keysym(keysym, KEY_RIGHT) || chk_keysym(keysym, KEY_UPRIGHT) || chk_keysym(keysym, KEY_DOWNRIGHT)) { + if ((*x + *w) < attr.width) *x += *w; // shift right + } + } else { + if (ninegrid) { + if (chk_keysym(keysym, KEY_UPLEFT)) { + *w /= 3; *h /= 3; // split upper left + } else if (chk_keysym(keysym, KEY_UP)) { + *w /= 3; *h /= 3; // split up + *x += *w; + } else if (chk_keysym(keysym, KEY_UPRIGHT)) { + *w /= 3; *h /= 3; // split upper right + *x += *w * 2; + } else if (chk_keysym(keysym, KEY_LEFT)) { + *w /= 3; *h /= 3; // split left + *y += *h; + } else if (chk_keysym(keysym, KEY_CENTER)) { + *w /= 3; *h /= 3; // split center + *x += *w; *y += *h; + } else if (chk_keysym(keysym, KEY_RIGHT)) { + *w /= 3; *h /= 3; // split right + *x += *w * 2; *y += *h; + } else if (chk_keysym(keysym, KEY_DOWNLEFT)) { + *w /= 3; *h /= 3; // split bottom left + *y += *h * 2; + } else if (chk_keysym(keysym, KEY_DOWN)) { + *w /= 3; *h /= 3; // split down + *x += *w; *y += *h * 2; + } else if (chk_keysym(keysym, KEY_DOWNRIGHT)) { + *w /= 3; *h /= 3; // split bottom right + *x += *w * 2; *y += *h * 2; + } + } else { + if (chk_keysym(keysym, KEY_LEFT) || chk_keysym(keysym, KEY_UPLEFT) || chk_keysym(keysym, KEY_DOWNLEFT)) { + *w /= 2; // split left + } + if (chk_keysym(keysym, KEY_DOWN) || chk_keysym(keysym, KEY_DOWNLEFT) || chk_keysym(keysym, KEY_DOWNRIGHT)) { + *h /= 2; // split down + *y += *h; + } + if (chk_keysym(keysym, KEY_UP) || chk_keysym(keysym, KEY_UPLEFT) || chk_keysym(keysym, KEY_UPRIGHT)) { + *h /= 2; // split up + } + if (chk_keysym(keysym, KEY_RIGHT) || chk_keysym(keysym, KEY_UPRIGHT) || chk_keysym(keysym, KEY_DOWNRIGHT)) { + *w /= 2; // split right + *x += *w; + } + } + } + + if (ox != *x || oy != *y || ow != *w || oh != *h) { + undo_stack_push(ox, oy, ow, oh); + *moves += 1; + } + else if (chk_keysym(keysym, KEY_UNDO)) { + int i, j; + + if (mod & SHIFTMASK) j = 0; + else j = SHIFT_N_UNDO-1; + + for (i=j; i= ninegrid_n_switch) + ninegrid = 0; + hits++; + XMoveResizeWindow(dpy, zone, x, y, w, h); + drawquadrants(zone, w, h); + } else + done++; + } + } + } + + // end mouse key + XUngrabKeyboard(dpy, CurrentTime); + XDestroyWindow(dpy, zone); + undo_stack_push(x, y, w, h); + + if (warp) + warppointer(x, y, w, h); + if (click == 1) { + if (!drag) + buttondown(1); + if (mod & DRAGMASK && !drag) + drag = 1; + else if (mod & DRAGMASK) { + buttonup(1); + buttondown(1); + } else { + buttonup(1); + drag = 0; + } + } else if (click) { + buttondown(click); + buttonup(click); + } + + if (click) stats(hits, moves); + + // loop back if in drag mode + if (drag) { + usleep(50); + startmousekey(0); + } + + // re-enable trigger keygrabs + grab(KEY_TRIGGER, TRIGGERMASK); + grab(KEY_UNDO, TRIGGERMASK); +} + +int main(int argc, char **argv) { + char *pcDisplay; + + if ((dpy = XOpenDisplay(pcDisplay = getenv("DISPLAY"))) == NULL) { + fprintf(stderr,"Error: Can't open display: %s", pcDisplay); + exit(1); + } + fprintf(stderr,"Display: %s\n", pcDisplay); + + // parse options + if (argc > 1) + if (argv[1][0] && argv[1][0] == '-') + if (argv[1][1] && argv[1][1] == 'n') { + ninegrid_default = 1; + fprintf(stderr,"nine-grid default mode \n"); + if (argv[2]) { + ninegrid_n_switch = atoi(argv[2]); + fprintf(stderr,"nine-grid autoswitch num: %d \n", ninegrid_n_switch); + } + } + + root = XDefaultRootWindow(dpy); + XGetWindowAttributes(dpy, root, &attr); + + // these are the trigger keygrabs + grab(KEY_TRIGGER, TRIGGERMASK); + grab(KEY_UNDO, TRIGGERMASK); + + while (1) { + XEvent e; + XNextEvent(dpy, &e); + if (e.type == KeyPress) + if (chk_keysym(XKeycodeToKeysym(dpy, e.xkey.keycode, 0), KEY_UNDO)) + startmousekey(1); + else + startmousekey(0); + } +} diff -r 000000000000 -r ab8a496afb67 keynav.c.old --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/keynav.c.old Tue Sep 08 22:45:57 2009 -0700 @@ -0,0 +1,282 @@ +/* + * Visual user-directed binary search for something to point your mouse at. + */ + +/* XXX: fine-tuning once you're zoomed in? (done?) + * XXX: "cancel" action (done) + * XXX: vi-keys half-split (done) + * XXX: use XGrabKeyboard instead of XGrabKey for the movement mode? +*/ + +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +Display *dpy; +Window root; +XWindowAttributes attr; + +void grab(char *keyname, int mods) { + int key; + + key = XKeysymToKeycode(dpy, XStringToKeysym(keyname)); + XGrabKey(dpy, key, mods, root, False, + GrabModeAsync, GrabModeAsync); +} + +GC creategc(Window win) { + GC gc; + XGCValues values; + + gc = XCreateGC(dpy, win, 0, &values); + XSetForeground(dpy, gc, BlackPixel(dpy, 0)); + XSetBackground(dpy, gc, WhitePixel(dpy, 0)); + XSetLineAttributes(dpy, gc, 4, LineSolid, CapButt, JoinBevel); + XSetFillStyle(dpy, gc, FillSolid); + //XSetFillStyle(dpy, gc, FillStippled); + + return gc; +} + +void drawquadrants(Window win, int w, int h) { + GC gc; + XRectangle clip[20]; + int idx = 0; + Colormap colormap; + XColor red; + + gc = creategc(win); + colormap = DefaultColormap(dpy, 0); + + XAllocNamedColor(dpy, colormap, "darkred", &red, &red); + +# define BORDER 6 +# define PEN 4 + + /*left*/ clip[idx].x = 0; clip[idx].y = 0; clip[idx].width = BORDER; clip[idx].height = h; + idx++; + /*right*/ clip[idx].x = w-BORDER; clip[idx].y = 0; clip[idx].width = BORDER; clip[idx].height = h; + idx++; + /*top*/ clip[idx].x = 0; clip[idx].y = 0; clip[idx].width = w; clip[idx].height = BORDER; + idx++; + /*bottom*/ clip[idx].x = 0; clip[idx].y = h-BORDER; clip[idx].width = w; clip[idx].height = BORDER; + idx++; + /*horiz*/ + clip[idx].x = 0; clip[idx].y = h/2 - BORDER/2; + clip[idx].width = w; clip[idx].height = BORDER; + idx++; + /*vert*/ + clip[idx].x = w/2 - BORDER/2; clip[idx].y = 0; + clip[idx].width = BORDER; clip[idx].height = h; + idx++; + + XShapeCombineRectangles(dpy, win, ShapeBounding, 0, 0, clip, idx, ShapeSet, 0); + + XSetForeground(dpy, gc, WhitePixel(dpy, 0)); + XFillRectangle(dpy, win, gc, 0, 0, w, h); + + XSetForeground(dpy, gc, red.pixel); + XDrawLine(dpy, win, gc, w/2, 0, w/2, h); // vert line + XDrawLine(dpy, win, gc, 0, h/2, w, h/2); // horiz line + XDrawLine(dpy, win, gc, BORDER - PEN, BORDER - PEN, w - PEN, BORDER - PEN); //top line + XDrawLine(dpy, win, gc, BORDER - PEN, h - PEN, w - PEN, h - PEN); //bottom line + XDrawLine(dpy, win, gc, BORDER - PEN, BORDER - PEN, BORDER - PEN, h - PEN); //left line + XDrawLine(dpy, win, gc, w - PEN, BORDER - PEN, w - PEN, h - PEN); //left line + XFlush(dpy); +} + +void ungrab(char *keyname, int mod) { + int key; + + key = XKeysymToKeycode(dpy, XStringToKeysym(keyname)); + XUngrabKey(dpy, key, mod, root); +} + +void endmousekey() { + ungrab("h",0); ungrab("j",0); ungrab("k",0); ungrab("l",0); + ungrab("h",ControlMask); ungrab("j",ControlMask); ungrab("k",ControlMask); ungrab("l",ControlMask); + ungrab("h",ShiftMask); ungrab("j",ShiftMask); ungrab("k",ShiftMask); ungrab("l",ShiftMask); + ungrab("space", 0); + ungrab("semicolon", 0); + ungrab("Escape", 0); + XSync(dpy, 0); + grab("semicolon", ControlMask); +} + +int handlekey(int keysym, int mod, int *x, int *y, int *w, int *h) { + char *keyname; + + keyname = XKeysymToString(keysym); + +#if 0 + if (!strcmp(keyname, "a")) { // up and left + //*x -= *w; + //*y -= *h; + } else if (!strcmp(keyname, "s")) { // up and right + *x += *w; + //*y += *h; + } else if (!strcmp(keyname, "d")) { // down and left + //*x += *w; + *y += *h; + } else if (!strcmp(keyname, "f")) { // down and right + *x += *w; + *y += *h; + } +#endif + + if (mod & ControlMask || !mod) { + if (*keyname == 'h') { // go left or split left + *w /= 2; + } else if (*keyname == 'j') { //go down or split down + *h /= 2; + *y += *h; + } else if (*keyname == 'k') { //go up or split up + *h /= 2; + } else if (*keyname == 'l') { //go right or split right + *w /= 2; + *x += *w; + } + } else if (mod & ShiftMask) { + if (*keyname == 'h') { // shift left + if (*x > 0) *x -= *w; + } else if (*keyname == 'j') { //shift down + if ((*y + *h) < attr.height) *y += *h; + } else if (*keyname == 'k') { //shift up + if (*y > 0) *y -= *h; + } else if (*keyname == 'l') { //shift right + if ((*x + *w) < attr.width) *x += *w; + } + } + + if (*w < 1 || *h < 1) { + printf( "OOPS. Area too small. Giving up :(\n"); + return 0; + } + + printf("Box: @(%d,%d) #(%d,%d)\n", *x, *y, *w, *h); + return 1; +} + +void startmousekey() { + int hits = 0; + int keysym; + int done = 0; + int x,y,w,h; + int warp = 1; + int click = 0; + + Window zone; + + grab("h",ShiftMask); grab("j",ShiftMask); grab("k",ShiftMask); grab("l",ShiftMask); + grab("h",ControlMask); grab("j",ControlMask); grab("k",ControlMask); grab("l",ControlMask); + grab("h",0); grab("j",0); grab("k",0); grab("l",0); + grab("semicolon", 0); grab("space", 0); grab("Escape", 0); + + x = y = 0; + w = attr.width; + h = attr.height; + + zone = XCreateSimpleWindow(dpy, root, x, y, w, h, 1, BlackPixel(dpy, 0), WhitePixel(dpy, 0)); + + { /* Tell the window manager not to manage us */ + unsigned long valuemask; + XSetWindowAttributes winattr; + winattr.override_redirect = 1; + XChangeWindowAttributes(dpy, zone, CWOverrideRedirect, &winattr); + } + + drawquadrants(zone, w, h); + XMapWindow(dpy, zone); + drawquadrants(zone, w, h); + + printf("Starting quadrants...\n"); + while (!done) { + XEvent e; + XNextEvent(dpy, &e); + switch (e.type) { + case KeyPress: + keysym = XKeycodeToKeysym(dpy, e.xkey.keycode, 0); + + if (XStringToKeysym("semicolon") == keysym) + done++; + else if (XStringToKeysym("space") == keysym) { + done++; + click = 1; + } else if (XStringToKeysym("Escape") == keysym) { + warp = 0; + done++; + } else { + if (handlekey(keysym, e.xkey.state, &x, &y, &w, &h)) { + hits++; + //if (hits > 5) + //done++; + //else { + XMoveResizeWindow(dpy, zone, x, y, w, h); + drawquadrants(zone, w, h); + //} + } else { + done++; + } + } + break; + case KeyRelease: + default: + break; + } + } + + endmousekey(); + XDestroyWindow(dpy, zone); + if (warp) + XWarpPointer(dpy, None, root, 0, 0, 0, 0, x + w/2, y + h/2); + if (click) { + XTestFakeButtonEvent(dpy, 1, True, CurrentTime); // button down + XTestFakeButtonEvent(dpy, 1, False, CurrentTime); // button release + } +} + +int main(int argc, char **argv) { + char *pcDisplay; + int ret; + + if ( (pcDisplay = getenv("DISPLAY")) == NULL) { + fprintf(stderr, "Error: DISPLAY environment variable not set\n"); + exit(1); + } + + printf("Display: %s\n", pcDisplay); + + if ( (dpy = XOpenDisplay(pcDisplay)) == NULL) { + fprintf(stderr, "Error: Can't open display: %s", pcDisplay); + exit(1); + } + + root = XDefaultRootWindow(dpy); + XGetWindowAttributes(dpy, root, &attr); + + XGrabKey(dpy, XKeysymToKeycode(dpy, XStringToKeysym("semicolon")), + ControlMask, root, False, GrabModeAsync, GrabModeAsync); + + while (1) { + XEvent e; + XNextEvent(dpy, &e); + switch (e.type) { + case KeyPress: + startmousekey(); + break; + case KeyRelease: + default: + break; + } + } +} + +