--- xwit-3.4.orig/ClientWin.c +++ xwit-3.4/ClientWin.c @@ -17,14 +17,13 @@ #include #include +#include "ClientWin.h" -static Window TryChildren(); +static Window TryChildren(Display *,Window,Atom); /* Find a window with WM_STATE, else return win itself, as per ICCCM */ -Window XmuClientWindow (dpy, win) - Display *dpy; - Window win; +Window XmuClientWindow (Display *dpy,Window win) { Atom WM_STATE; Atom type = None; @@ -47,10 +46,7 @@ } static -Window TryChildren (dpy, win, WM_STATE) - Display *dpy; - Window win; - Atom WM_STATE; +Window TryChildren (Display *dpy, Window win, Atom WM_STATE) { Window root, parent; Window *children; --- xwit-3.4.orig/dsimple.c +++ xwit-3.4/dsimple.c @@ -1,25 +1,47 @@ -/* $XConsortium: dsimple.c,v 1.12 91/05/11 21:01:36 gildea Exp $ */ -/* $Id: dsimple.c,v 3.2 95/10/18 16:58:55 dd Exp $ */ +/* $Xorg: dsimple.c,v 1.4 2001/02/09 02:05:54 xorgcvs Exp $ */ +/* + +Copyright 1993, 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR +OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall +not be used in advertising or otherwise to promote the sale, use or +other dealings in this Software without prior written authorization +from The Open Group. + +*/ +/* $XFree86: xc/programs/xlsfonts/dsimple.c,v 3.6 2001/12/14 20:02:09 dawes Exp $ */ + #include #include #include #include #include +#include +#include /* * Other_stuff.h: Definitions of routines in other_stuff. * * Written by Mark Lillibridge. Last updated 7/1/87 - * - * Send bugs, etc. to chariot@athena.mit.edu. */ -unsigned long Resolve_Color(); -Pixmap Bitmap_To_Pixmap(); -Window Select_Window(); -void out(); -void blip(); -Window Window_With_Name(); -void Fatal_Error(); +#include "dsimple.h" /* * Just_display: A group of routines designed to make the writting of simple @@ -29,24 +51,22 @@ * and screen already defined on entry. * * Written by Mark Lillibridge. Last updated 7/1/87 - * - * Send bugs, etc. to chariot@athena.mit.edu. */ /* This stuff is defined in the calling program by just_display.h */ -extern char *program_name; -extern Display *dpy; -extern int screen; +char *program_name = "unknown_program"; +Display *dpy; +int screen; +static void _bitmap_error(int, char *); /* * Malloc: like malloc but handles out of memory using Fatal_Error. */ -char *Malloc(size) - unsigned size; +char *Malloc(size_t size) { - char *data, *malloc(); + char *data; if (!(data = malloc(size))) Fatal_Error("Out of memory!"); @@ -58,11 +78,9 @@ /* * Realloc: like Malloc except for realloc, handles NULL using Malloc. */ -char *Realloc(ptr, size) - char *ptr; - int size; +char *Realloc(void *ptr,size_t size) { - char *new_ptr, *realloc(); + void *new_ptr; if (!ptr) return(Malloc(size)); @@ -78,9 +96,7 @@ * Get_Display_Name (argc, argv) Look for -display, -d, or host:dpy (obselete) * If found, remove it from command line. Don't go past a lone -. */ -char *Get_Display_Name(pargc, argv) - int *pargc; /* MODIFIED */ - char **argv; /* MODIFIED */ +char *Get_Display_Name(int *pargc, char **argv) { int argc = *pargc; char **pargv = argv+1; @@ -138,9 +154,7 @@ * for this display is then stored in screen. * Does not require dpy or screen defined. */ -void Setup_Display_And_Screen(argc, argv) -int *argc; /* MODIFIED */ -char **argv; /* MODIFIED */ +void Setup_Display_And_Screen(int *argc, char **argv) { dpy = Open_Display (Get_Display_Name(argc, argv)); screen = DefaultScreen(dpy); @@ -259,7 +273,7 @@ #define OPTION argv[0] #define NXTOPTP ++argv, --argc>0 #define NXTOPT if (++argv, --argc==0) usage() -#define COPYOPT nargv++[0]=OPTION; nargc++ +#define COPYOPT nargv++[0]=OPTION, nargc++ while (NXTOPTP) { if (!strcmp(OPTION, "-")) { @@ -285,7 +299,7 @@ w=0; sscanf(OPTION, "0x%lx", &w); if (!w) - sscanf(OPTION, "%ld", &w); + sscanf(OPTION, "%lu", &w); if (!w) Fatal_Error("Invalid window id format: %s.", OPTION); continue; @@ -301,13 +315,8 @@ * Other_stuff: A group of routines which do common X11 tasks. * * Written by Mark Lillibridge. Last updated 7/1/87 - * - * Send bugs, etc. to chariot@athena.mit.edu. */ -extern Display *dpy; -extern int screen; - /* * Resolve_Color: This routine takes a color name and returns the pixel # * that when used in the window w will be of color name. @@ -381,7 +390,9 @@ */ void blip() { - outl("blip!"); + fflush(stdout); + fprintf(stderr, "blip!\n"); + fflush(stderr); } @@ -447,7 +458,7 @@ { Window *children, dummy; unsigned int nchildren; - int i; + unsigned int i; Window w=0; char *window_name; @@ -467,36 +478,18 @@ } /* - * outl: a debugging routine. Flushes stdout then prints a message on stderr - * and flushes stderr. Used to print messages when past certain points - * in code so we can tell where we are. Outl may be invoked like - * printf with up to 7 arguments. - */ -/* VARARGS1 */ -outl(msg, arg0,arg1,arg2,arg3,arg4,arg5,arg6) - char *msg; - char *arg0, *arg1, *arg2, *arg3, *arg4, *arg5, *arg6; -{ - fflush(stdout); - fprintf(stderr, msg, arg0, arg1, arg2, arg3, arg4, arg5, arg6); - fprintf(stderr, "\n"); - fflush(stderr); -} - - -/* * Standard fatal error routine - call like printf but maximum of 7 arguments. * Does not require dpy or screen defined. */ -/* VARARGS1 */ -void Fatal_Error(msg, arg0,arg1,arg2,arg3,arg4,arg5,arg6) -char *msg; -char *arg0, *arg1, *arg2, *arg3, *arg4, *arg5, *arg6; +void Fatal_Error(char *msg, ...) { + va_list args; fflush(stdout); fflush(stderr); fprintf(stderr, "%s: error: ", program_name); - fprintf(stderr, msg, arg0, arg1, arg2, arg3, arg4, arg5, arg6); + va_start(args, msg); + vfprintf(stderr, msg, args); + va_end(args); fprintf(stderr, "\n"); exit(2); } --- xwit-3.4.orig/dsimple.h +++ xwit-3.4/dsimple.h @@ -12,26 +12,26 @@ /* Global variables used by routines in just_display.c */ -char *program_name = "unknown_program"; /* Name of this program */ -Display *dpy; /* The current display */ -int screen; /* The current screen */ +extern char *program_name; /* Name of this program */ +extern Display *dpy; /* The current display */ +extern int screen; /* The current screen */ #define INIT_NAME program_name=argv[0] /* use this in main to setup program_name */ /* Declaritions for functions in just_display.c */ -void Fatal_Error(); -char *Malloc(); -char *Realloc(); -char *Get_Display_Name(); -Display *Open_Display(); -void Setup_Display_And_Screen(); -XFontStruct *Open_Font(); -void Beep(); -Pixmap ReadBitmapFile(); -void WriteBitmapFile(); -Window Select_Window_Args(); +void Fatal_Error(char *msg, ...); +char *Malloc(size_t); +char *Realloc(void*,size_t); +char *Get_Display_Name(int*,char **); +Display *Open_Display(char *); +void Setup_Display_And_Screen(int *, char **); +XFontStruct *Open_Font(char *); +void Beep(void); +Pixmap ReadBitmapFile(Drawable,char *,int*,int*,int*,int*); +void WriteBitmapFile(char *,Pixmap,int,int,int,int); +Window Select_Window_Args(int *,char **); #define X_USAGE "[host:display]" /* X arguments handled by Get_Display_Name */ @@ -45,9 +45,10 @@ * Send bugs, etc. to chariot@athena.mit.edu. */ -unsigned long Resolve_Color(); -Pixmap Bitmap_To_Pixmap(); -Window Select_Window(); -void out(); -void blip(); -Window Window_With_Name(); +unsigned long Resolve_Color(Window,char *); +Pixmap Bitmap_To_Pixmap(Display *,Drawable,GC,Pixmap,int,int); +Window Select_Window(Display *); +void out(void); +void blip(void); +Window Window_With_Name(Display *,Window,char *); +void usage(void); --- xwit-3.4.orig/xwit.c +++ xwit-3.4/xwit.c @@ -26,15 +26,19 @@ * * This version by David DiGiacomo, david@slack.com. */ +#include #include #include #include #include #include +#include #include #include "dsimple.h" +#include "ClientWin.h" /* note: called by dsimple.c code, must be global */ +void usage() { static char Revision[] = "$Revision: 3.4 $"; @@ -58,21 +62,24 @@ fprintf(stderr, "usage: %s -display -sync\n\ - -pop -iconify -unmap\n\ + -pop -focus -iconify -unmap -print \n\ + -raise -lower -opposite -[un]circulate\n\ -resize w h -rows r -columns c -[r]move x y\n\ -[r]warp x y -colormap -[no]save\n\ - -name -iconname \n\ + -name -iconname -property \n\ -bitmap -mask -[r]iconmove x y\n\ -[no]backingstore -[no]saveunder\n\ -[no]keyrepeat keycode ... keycode - keycode\n\ - -id -root -current -select\n\ + -id -root -current -select -all\n\ -names ... [must be last]\n", program_name); exit(2); } enum functions { - pop, icon, unmap, colormap, + pop, focus, icon, unmap, colormap, + print, + raise, lower, opposite, circulate, uncirculate, move, rmove, warp, rwarp, resize, save, nosave, keyrepeat, nokeyrepeat, @@ -114,6 +121,7 @@ static int Giconx, Gicony; static int nrows; static int ncolumns; +static int nbuffer; static char *bitmapname; static char *maskname; static int Gbs, Gsu; @@ -122,35 +130,62 @@ static int Gwinfound; /* forward declarations */ -static void doit(); +static void doit(Window); /* * sleep for given millisecs for those without usleep */ -static -mssleep(ms) -int ms; +static void +mssleep(int ms) { struct timeval tv; tv.tv_sec = ms/1000; tv.tv_usec = (ms%1000)*1000; - select(0,(int*)0,(int*)0,(int*)0,&tv); + select(0,NULL,NULL,NULL,&tv); +} + +static Atom property = XA_WM_NAME; + +static Bool MyFetchName(Display *display, Window w, unsigned char **name) +{ + Atom returnedType; + int returnedFormat; + unsigned long number; + unsigned long bytesAfterReturn; + unsigned char *data; + + if( Success != XGetWindowProperty(display, w, property, + 0, (long)BUFSIZ, False, + XA_STRING, + &returnedType, &returnedFormat, + &number, &bytesAfterReturn, &data)) { + *name = NULL; + return False; + } else if( returnedType != XA_STRING || returnedFormat != 8 ) { + if(data) + XFree(data); + *name = NULL; + return False; + } else { + *name = data; + return (data!=NULL)?True:False; + } } /* * find all windows below this and if name matches call doit on it */ -static -downtree(top) -Window top; +static void +downtree(Window top) { Window *child, dummy; unsigned int children, i; - char **cpp, *name; + char **cpp; + unsigned char *name; if (XQueryTree(dpy, top, &dummy, &dummy, &child, &children)==0) Fatal_Error("XQueryTree failed"); for (i=0; i= ' ' && ((*name)&0x80)== 0 ) { + putchar(*name); + } else + printf("\\%03hho",*name); + name++; + } + putchar('\''); + putchar('\n'); + } +} + +/* * set window size */ -static -doresize(window, w, h) - Window window; - int w, h; +static void +doresize(Window window, int w, int h) { XWindowChanges values; unsigned int value_mask; @@ -343,10 +402,8 @@ /* * set row/column size */ -static -rcresize(what, window) - enum functions what; - Window window; +static void +rcresize(enum functions what, Window window) { XSizeHints *hints; long supplied; @@ -375,11 +432,8 @@ XFree(hints); } -static -loadbitmap(window, file, pmp) - Window window; - char *file; - Pixmap *pmp; +static void +loadbitmap(Window window, const char *file, Pixmap *pmp) { unsigned int w, h; int xhot, yhot; @@ -389,9 +443,8 @@ Fatal_Error("XReadBitmapFile failed"); } -static -setbitmap(window) - Window window; +static void +setbitmap(Window window) { static XWMHints *hints; static Pixmap bitmap_pm; @@ -418,7 +471,7 @@ XSetCloseDownMode(dpy, RetainTemporary); } - if (ohints = XGetWMHints(dpy, window)) { + if ((ohints = XGetWMHints(dpy, window)) != NULL ) { if (ohints->icon_pixmap && hints->icon_pixmap) XFreePixmap(dpy, ohints->icon_pixmap); if (ohints->icon_mask && hints->icon_mask) @@ -429,9 +482,8 @@ XSetWMHints(dpy, window, hints); } -static -setwinattr(window) - Window window; +static void +setwinattr(Window window) { XSetWindowAttributes swa; unsigned long valuemask; @@ -455,8 +507,7 @@ * iconify the given window, or map and raise it, or whatever */ static void -doit(window) - Window window; +doit(Window window) { XWindowChanges values; unsigned int value_mask; @@ -498,9 +549,36 @@ case colormap: XSetWindowColormap(dpy, window, cmap); break; + case print: + doprint(window); + break; case pop: XMapRaised(dpy, window); break; + case focus: + XSetInputFocus(dpy, window, CurrentTime, RevertToNone); + break; + case raise: + values.stack_mode = Above; + value_mask = CWStackMode; + XConfigureWindow(dpy, window, value_mask, &values); + break; + case lower: + values.stack_mode = Below; + value_mask = CWStackMode; + XConfigureWindow(dpy, window, value_mask, &values); + break; + case opposite: + values.stack_mode = Opposite; + value_mask = CWStackMode; + XConfigureWindow(dpy, window, value_mask, &values); + break; + case circulate: + XCirculateSubwindowsUp(dpy, window); + break; + case uncirculate: + XCirculateSubwindowsDown(dpy, window); + break; case unmap: XUnmapWindow(dpy, window); break; @@ -591,9 +669,7 @@ /* based on xwininfo.c */ static Window -xwit_select_window(dpy, current) - Display *dpy; - int current; +xwit_select_window(Display *dpy, int current) { Window window = None; Window wroot; @@ -622,8 +698,7 @@ } static Window -getxid(s) - char *s; +getxid(const char *s) { XID id; @@ -633,18 +708,16 @@ return id; Fatal_Error("Invalid ID format: %s", s); /* NOTREACHED */ + return -1; } static int -matchopt(key, nargs, argc, argv) - char *key; - int nargs; - int *argc; - char **argv; +matchopt(const char *key, int nargs, int *argc, char **argv) { int enough = 0; int match = 1; - char *ap, *kp; + char *ap; + const char *kp; ap = *argv; if (*ap == '-') @@ -709,9 +782,42 @@ return match; } -main(argc, argv) - int argc; - char **argv; +static void +FetchBuffer(Display *dpy, int nbuf) +{ + char *buf; + int size; + + buf = XFetchBuffer(dpy, &size, nbuf); + + if( size == 0 ) + fprintf( stderr, "Could not fetch cutbuffer %d\n", nbuf ); + else + fwrite( buf, 1, size, stdout ); +} + +static void +StoreBuffer(Display *dpy, int nbuf) +{ + char *buf = NULL; + int bufsize, nread, total=0; + + bufsize = 10; + buf = malloc( bufsize ); + while( (nread=read(0,buf+total,bufsize-total)) > 0 ) + { + total+=nread; + bufsize *= 2; + buf = realloc( buf, bufsize ); + } + XStoreBuffer(dpy, buf, total, nbuf); + free(buf); +} + +char *allwindows[] = {""}; + +int +main(int argc, char *argv[]) { Window window = 0; int *pargc = &argc; @@ -727,7 +833,12 @@ while (argv++, --argc > 0) { /* argv[0] = next argument */ /* argc = # of arguments left */ - if (matchopt("ba*ckingstore", 0, pargc, argv) || + if (matchopt("a*ll", 0, pargc, argv)) { + Winidmode = WID_names; + names = allwindows; + numnames = 1; + } + else if (matchopt("ba*ckingstore", 0, pargc, argv) || matchopt("bs", 0, pargc, argv)) { function |= FBIT(F_winattr); Gbs = 1; @@ -745,6 +856,14 @@ function |= FBIT(columns); ncolumns = atoi(*++argv); } + else if (matchopt("store*buffer", 1, pargc, argv)) { + nbuffer = atoi(*++argv); + StoreBuffer( dpy, nbuffer ); + } + else if (matchopt("fetch*buffer", 1, pargc, argv)) { + nbuffer = atoi(*++argv); + FetchBuffer( dpy, nbuffer ); + } else if (matchopt("c*urrent", 0, pargc, argv)) { Winidmode = WID_curr; } @@ -845,6 +964,27 @@ else if (matchopt("p*op", 0, pargc, argv)) { function |= FBIT(pop); } + else if (matchopt("pr*int", 0, pargc, argv)) { + function |= FBIT(print); + } + else if (matchopt("f*ocus", 0, pargc, argv)) { + function |= FBIT(focus); + } + else if (matchopt("ra*ise", 0, pargc, argv)) { + function |= FBIT(raise); + } + else if (matchopt("lo*wer", 0, pargc, argv)) { + function |= FBIT(lower); + } + else if (matchopt("op*posite", 0, pargc, argv)) { + function |= FBIT(opposite); + } + else if (matchopt("cir*culate", 0, pargc, argv)) { + function |= FBIT(circulate); + } + else if (matchopt("uncir*culate", 0, pargc, argv)) { + function |= FBIT(uncirculate); + } else if (matchopt("ri*conmove", 2, pargc, argv)) { function |= FBIT(riconmove); Giconx = atoi(argv[1]); @@ -898,6 +1038,12 @@ warpx = atoi(argv[1]); warpy = atoi(argv[2]); argv += 2; + } else if(matchopt("prop*erty",1, pargc,argv)) { + property = XInternAtom(dpy,argv[1],False); + if( None == property ) { + Fatal_Error("Unknown atom %s",argv[1]); + } + argv++; } else usage(); @@ -916,7 +1062,6 @@ case WID_env: { char *s; - extern char *getenv(); s = getenv("WINDOWID"); if (s != 0) @@ -938,6 +1083,8 @@ case WID_select: window = xwit_select_window(dpy, 0); break; + default: + break; } switch (Winidmode) { @@ -956,5 +1103,6 @@ XSync(dpy, True); (void) XCloseDisplay(dpy); - exit(!Gwinfound); + return(!Gwinfound); } + --- xwit-3.4.orig/xwit.man +++ xwit-3.4/xwit.man @@ -1,57 +1,63 @@ -.\" $Id: xwit.man,v 3.4 97/10/20 18:32:54 dd Exp $ -.TH XWIT 1X +.TH XWIT 1 "2 Dec 2005" .SH NAME xwit \- window interface tool: pop or iconify this xterm window or named windows .SH SYNOPSIS .B xwit 'in \n(.iu+\w'\fBxwit \fR'u -.RB [ -display +.RB [ \-display .IR display ] -.RB [ -sync ] -.RB [ -pop ] -.RB [ -iconify ] -.RB [ -unmap ] +.RB [ \-sync ] +.RB [ \-pop ] +.RB [ \-focus ] +.RB [ \-iconify ] +.RB [ \-unmap ] +.br +.RB [ \-raise ] +.RB [ \-lower ] +.RB [ \-opposite ] +.RB [ \- [ un ] circulate ] .br -.RB [ -resize +.RB [ \-resize .IR w\ h ] -.RB [ -rows +.RB [ \-rows .IR r ] -.RB [ -columns +.RB [ \-columns .IR c ] -.RB [ - [ r ] move +.RB [ \- [ r ] move .IR x\ y ] .br -.RB [ - [ r ] warp +.RB [ \- [ r ] warp .IR x\ y ] -.RB [ -colormap +.RB [ \-colormap .IR colormapid ] -.RB [ - [ no ] save ] +.RB [ \- [ no ] save ] .br -.RB [ -name +.RB [ \-name .IR name ] -.RB [ -iconname +.RB [ \-iconname .IR name ] .br -.RB [ -bitmap +.RB [ \-bitmap .IR file ] -.RB [ -mask +.RB [ \-mask .IR file ] -.RB [ - [ r ] iconmove +.RB [ \- [ r ] iconmove .IR x\ y ] .br -.RB [ - [ no ] backingstore ] -.RB [ - [ no ] saveunder ] +.RB [ \- [ no ] backingstore ] +.RB [ \- [ no ] saveunder ] .br -.RB [ - [ no ] keyrepeat -.IR "keycode ... keycode - keycode ..." ] +.RB [ \- [ no ] keyrepeat +.IR "keycode ... keycode \- keycode ..." ] .br -.RB [ -id +.RB [ \-id .IR windowid ] -.RB [ -root ] -.RB [ -current ] -.RB [ -select ] -.RB [ -names +.RB [ \-root ] +.RB [ \-current ] +.RB [ \-select ] +.RB [ \-all ] +.RB [ \-names .IR initialsubstring... ] .in .SH DESCRIPTION @@ -64,135 +70,168 @@ strings, or a particular window id given, or the window id found in the environment variable .B WINDOWID -(which is set by xterm for the program it runs). +(which is set by xterm for the program it runs), or the window under the mouse cursor. .SH OPTIONS .TP --display +\-display is followed by the display to open. .TP --sync +\-sync causes all X requests to be performed synchronously. .TP --pop +\-property property +causes the specified property to be used instead of the windows +name (which is WM_NAME). +Some possible values are: WM_CLASS, WM_COMMAND, WM_ICON_NAME, WM_CLIENT_MACHINE. +.TP +\-pop is the default action. It need only be given if it is wanted as well as some other function. .TP --iconify +\-focus +will give the input focus to the specified window. +.TP +\-iconify will iconify the windows instead of popping them. .TP --unmap +\-unmap will iconify windows by unmapping with a non ICCCM compliant window manager. (Beware, this option is not usually what you want). .TP --resize w h +\-raise +raise windows (but do not map them if unmapped). +.TP +\-lower +lower windows. +.TP +\-opposite +toggle the stacking of windows from top to bottom among any overlapping +windows. +.TP +\-circulate +circulate a window's subwindows forward. Use this with \-root. +.TP +\-uncirculate +circulate a window's subwindows backward. Use this with \-root. +.TP +\-resize w h resize windows to the given pixel size. .TP --rows r +\-rows r resize windows to the given number of rows. .TP --columns c +\-columns c resize windows to the given number of columns. .TP --move x y +\-move x y move windows to the given absolute position relative to its parent. (If the x or y value is negative it is taken relative to the right or bottom edge of the parent.) .TP --rmove x y +\-rmove x y move windows by the given relative amount. .TP --warp x y +\-warp x y move the cursor to the given position relative to the specified window. -Add -root to warp to an absolute position. +Add \-root to warp to an absolute position. .TP --rwarp x y +\-rwarp x y move the cursor by the given relative amount. .TP --colormap colormapid +\-colormap colormapid install the given colormap into the given window. --save -nosave +\-save \-nosave immediately enable or disable the screen saver. .TP --name name +\-name name set the WM_NAME property to the given string. .TP --iconname name +\-iconname name set the WM_ICON_NAME property to the given string. .TP --bitmap file +\-bitmap file use the given bitmap file as the icon bitmap for the window. .TP --mask file +\-mask file use the given bitmap file as the icon mask for the window. .TP --iconmove x y +\-iconmove x y move icons to the given absolute position. (Will not work with some window managers.) .TP --riconmove x y +\-riconmove x y move icons by the given relative amount. (Will not work with some window managers.) .TP --backingstore -bs -nobackingstore -nobs +\-backingstore \-bs \-nobackingstore \-nobs enable or disable backing store for the window. .TP --saveunder -su -nosaveunder -nosu +\-saveunder \-su \-nosaveunder \-nosu enable or disable saveunders for the window. .TP --keyrepeat -nokeyrepeat +\-keyrepeat \-nokeyrepeat is followed by a list of keycodes (decimal numbers, see xmodmap(1)). -A range can be specified as a lower number, ``-'', and upper number +A range can be specified as a lower number, ``\-'', and upper number as three separate arguments. The individual setting of auto-repeat for those keycodes is set on or off. The global setting of auto-repeat can be set with xset(1). When off, no keys will repeat. .TP +\-print +will print the id, the coordinates, the depth and the name of all +selected windows. +If \-property is given, that one will be printed instead of the name. +.TP Window Selection .br If no window is specified, $WINDOWID will be used if set; otherwise the window under the cursor will be selected. .TP --id +\-id is followed by a single window number, in decimal; or, if it begins with 0x, in hexadecimal. .TP --root +\-root selects the root window. .TP --current +\-current selects the window under the cursor (default if no window specified and $WINDOWID not set). .TP --select +\-select allows the user to interactively select a window with the mouse. .TP --names +\-all +is equivalent to \-names '', as easier to remember. +.TP +\-names if given must be the last option and is followed by a list of strings. All windows that have a name that begins exactly like one of the strings will be acted upon. -By using a null string (-names ''), all names will be matched. +If \-property is given, this property is used instead of the name. +By using a null string (\-names ''), all names will be matched. .SH EXAMPLES .\" DD 10/97: seems to crash olvwm, sigh .\" To iconify all windows (probably not quite what you want to do) .\" .ta 1i -.\" xwit -names '' +.\" xwit \-names '' To de-iconify and pop ``this'' xterm and warp the cursor into it: - xwit -pop -warp 50 50 + xwit \-pop \-warp 50 50 To interactively select an xterm, and resize it to 34 rows and 80 columns: - xwit -select -rows 34 -columns 80 + xwit \-select \-rows 34 \-columns 80 To gently agitate your oclock on the screen: - while xwit -rmove 0 10 -name oclock - do xwit -rmove 0 -10 -name oclock + while xwit \-rmove 0 10 \-name oclock + do xwit \-rmove 0 -10 \-name oclock done .SH DIAGNOSTICS Exit status is 0 if any action is taken, 1 if no window matches the list -supplied to -names, 2 if an error occurs. +supplied to \-names, 2 if an error occurs. .SH LIMITATIONS Since each application is supposed to request these functions of the window manager, some of them may not like other clients mapping and unmapping @@ -204,5 +243,6 @@ .br David DiGiacomo, david@slack.com .SH ACKNOWLEDGEMENTS -Thanks to Andre Delafontaine, Norman R. McBride, Keith Thompson, and -Glen R. Walker for bug reports and suggestions. +Thanks to Andre Delafontaine, Norman R. McBride, Keith Thompson, +Glen R. Walker, Michael Mauch, Dima Barsky and Decklin Foster +for bug reports, suggestions and/or patches. --- xwit-3.4.orig/debian/changelog +++ xwit-3.4/debian/changelog @@ -0,0 +1,69 @@ +xwit (3.4-9) unstable; urgency=low + + * some code cleanup + * add an -property option to specify something different than + the name of the window to use (Closes: #109313) + * add an -print command to print the windows geometry and name + * add an -all alias to -names '' + * correctly escape dashes in the manpage + + -- Bernhard R. Link Fri, 2 Dec 2005 16:18:14 +0100 + +xwit (3.4-8) unstable; urgency=low + + * Adopting this package (Closes: #327628) + * repackage + - getting rid of dpatch + - make description more like I like it + - build with custom Makefile, getting rid of imake + * adding patch from Decklin Foster (Closes: #334921) + + -- Bernhard R. Link Fri, 21 Oct 2005 12:08:33 +0200 + +xwit (3.4-7) unstable; urgency=low + + * QA Group upload orphaning this package + * debian/control: build-depend on dpatch + * debian/rules: add dpatch support + * Added patch from Andreas Jochens to fix FTBFS with gcc-3.4 (closes: + #263209) + + -- Andrew Pollock Tue, 4 Oct 2005 21:45:57 +1000 + +xwit (3.4-6) unstable; urgency=low + + * Added -focus option (Thanks to Michael Mauch for the patch) + + -- Dima Barsky Sun, 22 Jun 2003 00:13:10 +0100 + +xwit (3.4-5) unstable; urgency=low + + * Modified long description to comply with the policy (Closes: #110207) + * Added Build-Depends: xlibs-dev (Closes: #105375) + * Some code clean-up to get rid of compilation warnings + + -- Dima Barsky Sat, 8 Sep 2001 12:38:34 +0100 + +xwit (3.4-4) unstable; urgency=low + + * Added xutils and debhelper to Build-Depends (Closes: #82884) + + -- Dima Barsky Fri, 19 Jan 2001 20:06:16 +0000 + +xwit (3.4-3) unstable; urgency=low + + * Added -fetch and -store options to access cutbuffers (Closes: #38379) + + -- Dima Barsky Sat, 6 Jan 2001 17:02:55 +0000 + +xwit (3.4-2) unstable; urgency=low + + * Changed Architecture: from i386 to any + + -- Dima Barsky Wed, 07 Oct 1998 11:23:48 +0100 + +xwit (3.4-1) unstable; urgency=low + + * Initial Release. + + -- Dima Barsky Fri, 24 Jul 1998 23:39:26 +0100 --- xwit-3.4.orig/debian/compat +++ xwit-3.4/debian/compat @@ -0,0 +1 @@ +4 --- xwit-3.4.orig/debian/patches/morecleanup.patch +++ xwit-3.4/debian/patches/morecleanup.patch @@ -0,0 +1,340 @@ + +This patch makes xwit compile cleanly with +-Wstrict-prototypes -Wmissing-prototypes and -W + + brl + +diff -r -u -N o/prev/ClientWin.c xwit-3.4/ClientWin.c +--- o/prev/ClientWin.c 2005-12-02 13:58:53.000000000 +0100 ++++ xwit-3.4/ClientWin.c 2005-12-02 14:19:20.000000000 +0100 +@@ -17,14 +17,13 @@ + + #include + #include ++#include "ClientWin.h" + +-static Window TryChildren(); ++static Window TryChildren(Display *,Window,Atom); + + /* Find a window with WM_STATE, else return win itself, as per ICCCM */ + +-Window XmuClientWindow (dpy, win) +- Display *dpy; +- Window win; ++Window XmuClientWindow (Display *dpy,Window win) + { + Atom WM_STATE; + Atom type = None; +@@ -47,10 +46,7 @@ + } + + static +-Window TryChildren (dpy, win, WM_STATE) +- Display *dpy; +- Window win; +- Atom WM_STATE; ++Window TryChildren (Display *dpy, Window win, Atom WM_STATE) + { + Window root, parent; + Window *children; +diff -r -u -N o/prev/ClientWin.h xwit-3.4/ClientWin.h +--- o/prev/ClientWin.h 1970-01-01 01:00:00.000000000 +0100 ++++ xwit-3.4/ClientWin.h 2005-12-02 14:19:27.000000000 +0100 +@@ -0,0 +1,2 @@ ++ ++Window XmuClientWindow (Display *dpy,Window win); +diff -r -u -N o/prev/dsimple.c xwit-3.4/dsimple.c +--- o/prev/dsimple.c 2005-12-02 13:58:53.000000000 +0100 ++++ xwit-3.4/dsimple.c 2005-12-02 14:29:22.000000000 +0100 +@@ -458,7 +458,7 @@ + { + Window *children, dummy; + unsigned int nchildren; +- int i; ++ unsigned int i; + Window w=0; + char *window_name; + +@@ -478,25 +478,6 @@ + } + + /* +- * outl: a debugging routine. Flushes stdout then prints a message on stderr +- * and flushes stderr. Used to print messages when past certain points +- * in code so we can tell where we are. Outl may be invoked like +- * printf with up to 7 arguments. +- */ +-void +-outl(char *msg, ...) +-{ +- va_list args; +- fflush(stdout); +- va_start(args, msg); +- vfprintf(stderr, msg, args); +- va_end(args); +- fprintf(stderr, "\n"); +- fflush(stderr); +-} +- +- +-/* + * Standard fatal error routine - call like printf but maximum of 7 arguments. + * Does not require dpy or screen defined. + */ +diff -r -u -N o/prev/Makefile xwit-3.4/Makefile +--- o/prev/Makefile 2005-12-02 13:58:53.000000000 +0100 ++++ xwit-3.4/Makefile 2005-12-02 14:32:29.000000000 +0100 +@@ -1,7 +1,9 @@ +-CFLAGS ?= -Wall -O2 -g +-LDFLAGS ?= -L/usr/X11R6/lib ++CFLAGS ?= -Wall -O2 -g -Wstrict-prototypes -Wmissing-prototypes ++LDFLAGS ?= -L/usr/X11R6/lib -Wl,-z,defs + LIBRARIES = -lX11 + ++all: xwit ++ + xwit: xwit.o ClientWin.o dsimple.o + gcc $(CFLAGS) $(LDFLAGS) $(LIBRARIES) -o $@ $^ + +@@ -10,7 +12,8 @@ + + # Headers needed + dsimple.o: dsimple.h +-xwit.o: dsimple.h ++xwit.o: dsimple.h ClientWin.h ++ClientWin.o: ClientWin.h + + clean: + -rm xwit *.o +diff -r -u -N o/prev/xwit.c xwit-3.4/xwit.c +--- o/prev/xwit.c 2005-12-02 13:58:53.000000000 +0100 ++++ xwit-3.4/xwit.c 2005-12-02 14:19:04.000000000 +0100 +@@ -34,8 +34,7 @@ + #include + #include + #include "dsimple.h" +- +-Window XmuClientWindow(); ++#include "ClientWin.h" + + /* note: called by dsimple.c code, must be global */ + void +@@ -129,14 +128,13 @@ + static int Gwinfound; + + /* forward declarations */ +-static void doit(); ++static void doit(Window); + + /* + * sleep for given millisecs for those without usleep + */ + static void +-mssleep(ms) +-int ms; ++mssleep(int ms) + { + struct timeval tv; + tv.tv_sec = ms/1000; +@@ -148,8 +146,7 @@ + * find all windows below this and if name matches call doit on it + */ + static void +-downtree(top) +-Window top; ++downtree(Window top) + { + Window *child, dummy; + unsigned int children, i; +@@ -172,7 +169,7 @@ + * [un]set autorepeat for individual keys + */ + static void +-setrepeat() ++setrepeat(void) + { + unsigned long value_mask; + XKeyboardControl values; +@@ -194,9 +191,7 @@ + * (based on xwininfo.c) + */ + static void +-getpos(window, xp, yp) +- Window window; +- int *xp, *yp; ++getpos(Window window, int *xp, int *yp) + { + XWindowAttributes attributes; + int rx, ry; +@@ -217,9 +212,7 @@ + * get window size + */ + static void +-getsize(window, wp, hp) +- Window window; +- int *wp, *hp; ++getsize(Window window, int *wp, int *hp) + { + XWindowAttributes attributes; + +@@ -234,10 +227,7 @@ + * set window position + */ + static void +-domove(window, x, y, right, bottom) +- Window window; +- int x, y; +- int right, bottom; ++domove(Window window, int x, int y, int right, int bottom) + { + XWindowChanges values; + unsigned int value_mask; +@@ -307,9 +297,7 @@ + * set window size + */ + static void +-doresize(window, w, h) +- Window window; +- int w, h; ++doresize(Window window, int w, int h) + { + XWindowChanges values; + unsigned int value_mask; +@@ -351,9 +339,7 @@ + * set row/column size + */ + static void +-rcresize(what, window) +- enum functions what; +- Window window; ++rcresize(enum functions what, Window window) + { + XSizeHints *hints; + long supplied; +@@ -383,10 +369,7 @@ + } + + static void +-loadbitmap(window, file, pmp) +- Window window; +- char *file; +- Pixmap *pmp; ++loadbitmap(Window window, const char *file, Pixmap *pmp) + { + unsigned int w, h; + int xhot, yhot; +@@ -397,8 +380,7 @@ + } + + static void +-setbitmap(window) +- Window window; ++setbitmap(Window window) + { + static XWMHints *hints; + static Pixmap bitmap_pm; +@@ -437,8 +419,7 @@ + } + + static void +-setwinattr(window) +- Window window; ++setwinattr(Window window) + { + XSetWindowAttributes swa; + unsigned long valuemask; +@@ -462,8 +443,7 @@ + * iconify the given window, or map and raise it, or whatever + */ + static void +-doit(window) +- Window window; ++doit(Window window) + { + XWindowChanges values; + unsigned int value_mask; +@@ -622,9 +602,7 @@ + + /* based on xwininfo.c */ + static Window +-xwit_select_window(dpy, current) +- Display *dpy; +- int current; ++xwit_select_window(Display *dpy, int current) + { + Window window = None; + Window wroot; +@@ -653,8 +631,7 @@ + } + + static Window +-getxid(s) +- char *s; ++getxid(const char *s) + { + XID id; + +@@ -668,15 +645,12 @@ + } + + static int +-matchopt(key, nargs, argc, argv) +- char *key; +- int nargs; +- int *argc; +- char **argv; ++matchopt(const char *key, int nargs, int *argc, char **argv) + { + int enough = 0; + int match = 1; +- char *ap, *kp; ++ char *ap; ++ const char *kp; + + ap = *argv; + if (*ap == '-') +@@ -741,10 +715,8 @@ + return match; + } + +-void +-FetchBuffer( dpy, nbuf ) +- Display *dpy; +- int nbuf; ++static void ++FetchBuffer(Display *dpy, int nbuf) + { + char *buf; + int size; +@@ -757,10 +729,8 @@ + fwrite( buf, 1, size, stdout ); + } + +-void +-StoreBuffer( dpy, nbuf ) +- Display *dpy; +- int nbuf; ++static void ++StoreBuffer(Display *dpy, int nbuf) + { + char *buf = NULL; + int bufsize, nread, total=0; +@@ -778,9 +748,7 @@ + } + + int +-main(argc, argv) +- int argc; +- char **argv; ++main(int argc, char *argv[]) + { + Window window = 0; + int *pargc = &argc; +@@ -1011,7 +979,6 @@ + case WID_env: + { + char *s; +- extern char *getenv(); + + s = getenv("WINDOWID"); + if (s != 0) --- xwit-3.4.orig/debian/patches/old.patch +++ xwit-3.4/debian/patches/old.patch @@ -0,0 +1,290 @@ +This is the patch from the old xwit package from Dima Barsky . + +The relevant changelog entries are: +Added -focus option (Thanks to Michael Mauch for the patch) +Added -fetch and -store options to access cutbuffers (Closes: #38379) +Some code clean-up to get rid of compilation warnings + +diff -u xwit-3.4.orig/xwit.c xwit-3.4/xwit.c +--- xwit-3.4.orig/xwit.c 1997-10-21 03:32:54.000000000 +0200 ++++ xwit-3.4/xwit.c 2005-10-21 12:38:48.000000000 +0200 +@@ -31,10 +31,14 @@ + #include + #include + #include ++#include + #include + #include "dsimple.h" + ++Window XmuClientWindow(); ++ + /* note: called by dsimple.c code, must be global */ ++void + usage() + { + static char Revision[] = "$Revision: 3.4 $"; +@@ -58,7 +62,7 @@ + + fprintf(stderr, + "usage: %s -display -sync\n\ +- -pop -iconify -unmap\n\ ++ -pop -focus -iconify -unmap\n\ + -resize w h -rows r -columns c -[r]move x y\n\ + -[r]warp x y -colormap -[no]save\n\ + -name -iconname \n\ +@@ -72,7 +76,7 @@ + } + + enum functions { +- pop, icon, unmap, colormap, ++ pop, focus, icon, unmap, colormap, + move, rmove, warp, rwarp, + resize, save, nosave, + keyrepeat, nokeyrepeat, +@@ -114,6 +118,7 @@ + static int Giconx, Gicony; + static int nrows; + static int ncolumns; ++static int nbuffer; + static char *bitmapname; + static char *maskname; + static int Gbs, Gsu; +@@ -127,20 +132,20 @@ + /* + * sleep for given millisecs for those without usleep + */ +-static ++static void + mssleep(ms) + int ms; + { + struct timeval tv; + tv.tv_sec = ms/1000; + tv.tv_usec = (ms%1000)*1000; +- select(0,(int*)0,(int*)0,(int*)0,&tv); ++ select(0,NULL,NULL,NULL,&tv); + } + + /* + * find all windows below this and if name matches call doit on it + */ +-static ++static void + downtree(top) + Window top; + { +@@ -164,7 +169,7 @@ + /* + * [un]set autorepeat for individual keys + */ +-static ++static void + setrepeat() + { + unsigned long value_mask; +@@ -186,7 +191,7 @@ + * get window position, compensating for decorations + * (based on xwininfo.c) + */ +-static ++static void + getpos(window, xp, yp) + Window window; + int *xp, *yp; +@@ -209,7 +214,7 @@ + /* + * get window size + */ +-static ++static void + getsize(window, wp, hp) + Window window; + int *wp, *hp; +@@ -226,7 +231,7 @@ + /* + * set window position + */ +-static ++static void + domove(window, x, y, right, bottom) + Window window; + int x, y; +@@ -299,7 +304,7 @@ + /* + * set window size + */ +-static ++static void + doresize(window, w, h) + Window window; + int w, h; +@@ -343,7 +348,7 @@ + /* + * set row/column size + */ +-static ++static void + rcresize(what, window) + enum functions what; + Window window; +@@ -375,7 +380,7 @@ + XFree(hints); + } + +-static ++static void + loadbitmap(window, file, pmp) + Window window; + char *file; +@@ -389,7 +394,7 @@ + Fatal_Error("XReadBitmapFile failed"); + } + +-static ++static void + setbitmap(window) + Window window; + { +@@ -418,7 +423,7 @@ + XSetCloseDownMode(dpy, RetainTemporary); + } + +- if (ohints = XGetWMHints(dpy, window)) { ++ if ((ohints = XGetWMHints(dpy, window)) != NULL ) { + if (ohints->icon_pixmap && hints->icon_pixmap) + XFreePixmap(dpy, ohints->icon_pixmap); + if (ohints->icon_mask && hints->icon_mask) +@@ -429,7 +434,7 @@ + XSetWMHints(dpy, window, hints); + } + +-static ++static void + setwinattr(window) + Window window; + { +@@ -501,6 +506,9 @@ + case pop: + XMapRaised(dpy, window); + break; ++ case focus: ++ XSetInputFocus(dpy, window, CurrentTime, RevertToNone); ++ break; + case unmap: + XUnmapWindow(dpy, window); + break; +@@ -633,6 +641,7 @@ + return id; + Fatal_Error("Invalid ID format: %s", s); + /* NOTREACHED */ ++ return -1; + } + + static int +@@ -709,6 +718,43 @@ + return match; + } + ++void ++FetchBuffer( dpy, nbuf ) ++ Display *dpy; ++ int nbuf; ++{ ++ char *buf; ++ int size; ++ ++ buf = XFetchBuffer(dpy, &size, nbuf); ++ ++ if( size == 0 ) ++ fprintf( stderr, "Could not fetch cutbuffer %d\n", nbuf ); ++ else ++ fwrite( buf, 1, size, stdout ); ++} ++ ++void ++StoreBuffer( dpy, nbuf ) ++ Display *dpy; ++ int nbuf; ++{ ++ char *buf = NULL; ++ int bufsize, nread, total=0; ++ ++ bufsize = 10; ++ buf = malloc( bufsize ); ++ while( (nread=read(0,buf+total,bufsize-total)) > 0 ) ++ { ++ total+=nread; ++ bufsize *= 2; ++ buf = realloc( buf, bufsize ); ++ } ++ XStoreBuffer(dpy, buf, total, nbuf); ++ free(buf); ++} ++ ++int + main(argc, argv) + int argc; + char **argv; +@@ -745,6 +791,14 @@ + function |= FBIT(columns); + ncolumns = atoi(*++argv); + } ++ else if (matchopt("store*buffer", 1, pargc, argv)) { ++ nbuffer = atoi(*++argv); ++ StoreBuffer( dpy, nbuffer ); ++ } ++ else if (matchopt("fetch*buffer", 1, pargc, argv)) { ++ nbuffer = atoi(*++argv); ++ FetchBuffer( dpy, nbuffer ); ++ } + else if (matchopt("c*urrent", 0, pargc, argv)) { + Winidmode = WID_curr; + } +@@ -845,6 +899,9 @@ + else if (matchopt("p*op", 0, pargc, argv)) { + function |= FBIT(pop); + } ++ else if (matchopt("f*ocus", 0, pargc, argv)) { ++ function |= FBIT(focus); ++ } + else if (matchopt("ri*conmove", 2, pargc, argv)) { + function |= FBIT(riconmove); + Giconx = atoi(argv[1]); +@@ -938,6 +995,8 @@ + case WID_select: + window = xwit_select_window(dpy, 0); + break; ++ default: ++ break; + } + + switch (Winidmode) { +@@ -956,5 +1015,6 @@ + + XSync(dpy, True); + (void) XCloseDisplay(dpy); +- exit(!Gwinfound); ++ return(!Gwinfound); + } ++ +diff -u xwit-3.4.orig/xwit.man xwit-3.4/xwit.man +--- xwit-3.4.orig/xwit.man 1997-11-12 08:32:56.000000000 +0100 ++++ xwit-3.4/xwit.man 2005-10-21 12:38:48.000000000 +0200 +@@ -10,6 +10,7 @@ + .IR display ] + .RB [ -sync ] + .RB [ -pop ] ++.RB [ -focus ] + .RB [ -iconify ] + .RB [ -unmap ] + .br +@@ -77,6 +78,9 @@ + is the default action. + It need only be given if it is wanted as well as some other function. + .TP ++-focus ++will give the input focus to the specified window. ++.TP + -iconify + will iconify the windows instead of popping them. + .TP --- xwit-3.4.orig/debian/patches/manpage.patch +++ xwit-3.4/debian/patches/manpage.patch @@ -0,0 +1,293 @@ +diff -r -u previous/xwit.man new/xwit.man +--- previous/xwit.man 2005-12-02 14:35:57.000000000 +0100 ++++ new/xwit.man 2005-12-02 15:30:42.000000000 +0100 +@@ -1,62 +1,62 @@ +-.TH XWIT 1 "22 Oct 2005" ++.TH XWIT 1 "2 Dec 2005" + .SH NAME + xwit \- window interface tool: pop or iconify this xterm window or named windows + .SH SYNOPSIS + .B + xwit + 'in \n(.iu+\w'\fBxwit \fR'u +-.RB [ -display ++.RB [ \-display + .IR display ] +-.RB [ -sync ] +-.RB [ -pop ] +-.RB [ -focus ] +-.RB [ -iconify ] +-.RB [ -unmap ] +-.br +-.RB [ -raise ] +-.RB [ -lower ] +-.RB [ -opposite ] +-.RB [ - [ un ] circulate ] ++.RB [ \-sync ] ++.RB [ \-pop ] ++.RB [ \-focus ] ++.RB [ \-iconify ] ++.RB [ \-unmap ] ++.br ++.RB [ \-raise ] ++.RB [ \-lower ] ++.RB [ \-opposite ] ++.RB [ \- [ un ] circulate ] + .br +-.RB [ -resize ++.RB [ \-resize + .IR w\ h ] +-.RB [ -rows ++.RB [ \-rows + .IR r ] +-.RB [ -columns ++.RB [ \-columns + .IR c ] +-.RB [ - [ r ] move ++.RB [ \- [ r ] move + .IR x\ y ] + .br +-.RB [ - [ r ] warp ++.RB [ \- [ r ] warp + .IR x\ y ] +-.RB [ -colormap ++.RB [ \-colormap + .IR colormapid ] +-.RB [ - [ no ] save ] ++.RB [ \- [ no ] save ] + .br +-.RB [ -name ++.RB [ \-name + .IR name ] +-.RB [ -iconname ++.RB [ \-iconname + .IR name ] + .br +-.RB [ -bitmap ++.RB [ \-bitmap + .IR file ] +-.RB [ -mask ++.RB [ \-mask + .IR file ] +-.RB [ - [ r ] iconmove ++.RB [ \- [ r ] iconmove + .IR x\ y ] + .br +-.RB [ - [ no ] backingstore ] +-.RB [ - [ no ] saveunder ] ++.RB [ \- [ no ] backingstore ] ++.RB [ \- [ no ] saveunder ] + .br +-.RB [ - [ no ] keyrepeat +-.IR "keycode ... keycode - keycode ..." ] ++.RB [ \- [ no ] keyrepeat ++.IR "keycode ... keycode \- keycode ..." ] + .br +-.RB [ -id ++.RB [ \-id + .IR windowid ] +-.RB [ -root ] +-.RB [ -current ] +-.RB [ -select ] +-.RB [ -names ++.RB [ \-root ] ++.RB [ \-current ] ++.RB [ \-select ] ++.RB [ \-names + .IR initialsubstring... ] + .in + .SH DESCRIPTION +@@ -72,100 +72,100 @@ + (which is set by xterm for the program it runs), or the window under the mouse cursor. + .SH OPTIONS + .TP +--display ++\-display + is followed by the display to open. + .TP +--sync ++\-sync + causes all X requests to be performed synchronously. + .TP +--pop ++\-pop + is the default action. + It need only be given if it is wanted as well as some other function. + .TP +--focus ++\-focus + will give the input focus to the specified window. + .TP +--iconify ++\-iconify + will iconify the windows instead of popping them. + .TP +--unmap ++\-unmap + will iconify windows by unmapping with a non ICCCM compliant window manager. + (Beware, this option is not usually what you want). + .TP +--raise ++\-raise + raise windows (but do not map them if unmapped). + .TP +--lower ++\-lower + lower windows. + .TP +--opposite ++\-opposite + toggle the stacking of windows from top to bottom among any overlapping + windows. + .TP +--circulate +-circulate a window's subwindows forward. Use this with -root. ++\-circulate ++circulate a window's subwindows forward. Use this with \-root. + .TP +--uncirculate +-circulate a window's subwindows backward. Use this with -root. ++\-uncirculate ++circulate a window's subwindows backward. Use this with \-root. + .TP +--resize w h ++\-resize w h + resize windows to the given pixel size. + .TP +--rows r ++\-rows r + resize windows to the given number of rows. + .TP +--columns c ++\-columns c + resize windows to the given number of columns. + .TP +--move x y ++\-move x y + move windows to the given absolute position relative to its parent. + (If the x or y value is negative it is taken relative to the right or + bottom edge of the parent.) + .TP +--rmove x y ++\-rmove x y + move windows by the given relative amount. + .TP +--warp x y ++\-warp x y + move the cursor to the given position relative to the specified window. +-Add -root to warp to an absolute position. ++Add \-root to warp to an absolute position. + .TP +--rwarp x y ++\-rwarp x y + move the cursor by the given relative amount. + .TP +--colormap colormapid ++\-colormap colormapid + install the given colormap into the given window. +--save -nosave ++\-save \-nosave + immediately enable or disable the screen saver. + .TP +--name name ++\-name name + set the WM_NAME property to the given string. + .TP +--iconname name ++\-iconname name + set the WM_ICON_NAME property to the given string. + .TP +--bitmap file ++\-bitmap file + use the given bitmap file as the icon bitmap for the window. + .TP +--mask file ++\-mask file + use the given bitmap file as the icon mask for the window. + .TP +--iconmove x y ++\-iconmove x y + move icons to the given absolute position. (Will not work with some + window managers.) + .TP +--riconmove x y ++\-riconmove x y + move icons by the given relative amount. (Will not work with some + window managers.) + .TP +--backingstore -bs -nobackingstore -nobs ++\-backingstore \-bs \-nobackingstore \-nobs + enable or disable backing store for the window. + .TP +--saveunder -su -nosaveunder -nosu ++\-saveunder \-su \-nosaveunder \-nosu + enable or disable saveunders for the window. + .TP +--keyrepeat -nokeyrepeat ++\-keyrepeat \-nokeyrepeat + is followed by a list of keycodes (decimal numbers, see xmodmap(1)). +-A range can be specified as a lower number, ``-'', and upper number ++A range can be specified as a lower number, ``\-'', and upper number + as three separate arguments. + The individual setting of auto-repeat for those keycodes is set on or off. + The global setting of auto-repeat can be set with xset(1). +@@ -176,47 +176,47 @@ + If no window is specified, $WINDOWID will be used if set; + otherwise the window under the cursor will be selected. + .TP +--id ++\-id + is followed by a single window number, in decimal; or, if it begins with + 0x, in hexadecimal. + .TP +--root ++\-root + selects the root window. + .TP +--current ++\-current + selects the window under the cursor (default if no window specified and + $WINDOWID not set). + .TP +--select ++\-select + allows the user to interactively select a window with the mouse. + .TP +--names ++\-names + if given must be the last option and is followed by a list of strings. + All windows that have a name that begins exactly like one of the strings + will be acted upon. +-By using a null string (-names ''), all names will be matched. ++By using a null string (\-names ''), all names will be matched. + .SH EXAMPLES + .\" DD 10/97: seems to crash olvwm, sigh + .\" To iconify all windows (probably not quite what you want to do) + .\" + .ta 1i +-.\" xwit -names '' ++.\" xwit \-names '' + To de-iconify and pop ``this'' xterm and warp the cursor into it: + +- xwit -pop -warp 50 50 ++ xwit \-pop \-warp 50 50 + + To interactively select an xterm, and resize it to 34 rows and 80 columns: + +- xwit -select -rows 34 -columns 80 ++ xwit \-select \-rows 34 \-columns 80 + + To gently agitate your oclock on the screen: + +- while xwit -rmove 0 10 -name oclock +- do xwit -rmove 0 -10 -name oclock ++ while xwit \-rmove 0 10 \-name oclock ++ do xwit \-rmove 0 -10 \-name oclock + done + .SH DIAGNOSTICS + Exit status is 0 if any action is taken, 1 if no window matches the list +-supplied to -names, 2 if an error occurs. ++supplied to \-names, 2 if an error occurs. + .SH LIMITATIONS + Since each application is supposed to request these functions of the + window manager, some of them may not like other clients mapping and unmapping --- xwit-3.4.orig/debian/patches/raise_lower.patch +++ xwit-3.4/debian/patches/raise_lower.patch @@ -0,0 +1,112 @@ +This patch is from Decklin Foster + +"This implements a few more window management actions which are somewhat + obscure, but useful to me." + +diff -urNad xwit-3.4~/xwit.c xwit-3.4/xwit.c +--- xwit-3.4~/xwit.c 2005-10-20 15:27:53.000000000 -0400 ++++ xwit-3.4/xwit.c 2005-10-20 15:27:57.000000000 -0400 +@@ -63,6 +63,7 @@ + fprintf(stderr, + "usage: %s -display -sync\n\ + -pop -focus -iconify -unmap\n\ ++ -raise -lower -opposite -[un]circulate\n\ + -resize w h -rows r -columns c -[r]move x y\n\ + -[r]warp x y -colormap -[no]save\n\ + -name -iconname \n\ +@@ -77,6 +78,7 @@ + + enum functions { + pop, focus, icon, unmap, colormap, ++ raise, lower, opposite, circulate, uncirculate, + move, rmove, warp, rwarp, + resize, save, nosave, + keyrepeat, nokeyrepeat, +@@ -509,6 +511,27 @@ + case focus: + XSetInputFocus(dpy, window, CurrentTime, RevertToNone); + break; ++ case raise: ++ values.stack_mode = Above; ++ value_mask = CWStackMode; ++ XConfigureWindow(dpy, window, value_mask, &values); ++ break; ++ case lower: ++ values.stack_mode = Below; ++ value_mask = CWStackMode; ++ XConfigureWindow(dpy, window, value_mask, &values); ++ break; ++ case opposite: ++ values.stack_mode = Opposite; ++ value_mask = CWStackMode; ++ XConfigureWindow(dpy, window, value_mask, &values); ++ break; ++ case circulate: ++ XCirculateSubwindowsUp(dpy, window); ++ break; ++ case uncirculate: ++ XCirculateSubwindowsDown(dpy, window); ++ break; + case unmap: + XUnmapWindow(dpy, window); + break; +@@ -902,6 +925,21 @@ + else if (matchopt("f*ocus", 0, pargc, argv)) { + function |= FBIT(focus); + } ++ else if (matchopt("ra*ise", 0, pargc, argv)) { ++ function |= FBIT(raise); ++ } ++ else if (matchopt("lo*wer", 0, pargc, argv)) { ++ function |= FBIT(lower); ++ } ++ else if (matchopt("op*posite", 0, pargc, argv)) { ++ function |= FBIT(opposite); ++ } ++ else if (matchopt("cir*culate", 0, pargc, argv)) { ++ function |= FBIT(circulate); ++ } ++ else if (matchopt("uncir*culate", 0, pargc, argv)) { ++ function |= FBIT(uncirculate); ++ } + else if (matchopt("ri*conmove", 2, pargc, argv)) { + function |= FBIT(riconmove); + Giconx = atoi(argv[1]); +diff -urNad xwit-3.4~/xwit.man xwit-3.4/xwit.man +--- xwit-3.4~/xwit.man 2005-10-20 15:27:53.000000000 -0400 ++++ xwit-3.4/xwit.man 2005-10-20 15:29:45.000000000 -0400 +@@ -14,6 +14,11 @@ + .RB [ -iconify ] + .RB [ -unmap ] + .br ++.RB [ -raise ] ++.RB [ -lower ] ++.RB [ -opposite ] ++.RB [ - [ un ] circulate ] ++.br + .RB [ -resize + .IR w\ h ] + .RB [ -rows +@@ -88,6 +93,22 @@ + will iconify windows by unmapping with a non ICCCM compliant window manager. + (Beware, this option is not usually what you want). + .TP ++-raise ++raise windows (but do not map them if unmapped). ++.TP ++-lower ++lower windows. ++.TP ++-opposite ++toggle the stacking of windows from top to bottom among any overlapping ++windows. ++.TP ++-circulate ++circulate a window's subwindows forward. Use this with -root. ++.TP ++-uncirculate ++circulate a window's subwindows backward. Use this with -root. ++.TP + -resize w h + resize windows to the given pixel size. + .TP --- xwit-3.4.orig/debian/patches/all_prop_print.patch +++ xwit-3.4/debian/patches/all_prop_print.patch @@ -0,0 +1,247 @@ +This patch adds a -print action, +an -property option (to tell what -names is looking for and -print is printing) +and an alias -all for -names '' + brl + +diff -u -r o/previous/xwit.c xwit-3.4/xwit.c +--- o/previous/xwit.c 2005-12-02 15:27:01.000000000 +0100 ++++ xwit-3.4/xwit.c 2005-12-02 16:15:28.000000000 +0100 +@@ -26,6 +26,7 @@ + * + * This version by David DiGiacomo, david@slack.com. + */ ++#include + #include + #include + #include +@@ -61,15 +62,15 @@ + + fprintf(stderr, + "usage: %s -display -sync\n\ +- -pop -focus -iconify -unmap\n\ ++ -pop -focus -iconify -unmap -print \n\ + -raise -lower -opposite -[un]circulate\n\ + -resize w h -rows r -columns c -[r]move x y\n\ + -[r]warp x y -colormap -[no]save\n\ +- -name -iconname \n\ ++ -name -iconname -property \n\ + -bitmap -mask -[r]iconmove x y\n\ + -[no]backingstore -[no]saveunder\n\ + -[no]keyrepeat keycode ... keycode - keycode\n\ +- -id -root -current -select\n\ ++ -id -root -current -select -all\n\ + -names ... [must be last]\n", + program_name); + exit(2); +@@ -77,6 +78,7 @@ + + enum functions { + pop, focus, icon, unmap, colormap, ++ print, + raise, lower, opposite, circulate, uncirculate, + move, rmove, warp, rwarp, + resize, save, nosave, +@@ -142,6 +144,34 @@ + select(0,NULL,NULL,NULL,&tv); + } + ++static Atom property = XA_WM_NAME; ++ ++static Bool MyFetchName(Display *display, Window w, unsigned char **name) ++{ ++ Atom returnedType; ++ int returnedFormat; ++ unsigned long number; ++ unsigned long bytesAfterReturn; ++ unsigned char *data; ++ ++ if( Success != XGetWindowProperty(display, w, property, ++ 0, (long)BUFSIZ, False, ++ XA_STRING, ++ &returnedType, &returnedFormat, ++ &number, &bytesAfterReturn, &data)) { ++ *name = NULL; ++ return False; ++ } else if( returnedType != XA_STRING || returnedFormat != 8 ) { ++ if(data) ++ XFree(data); ++ *name = NULL; ++ return False; ++ } else { ++ *name = data; ++ return (data!=NULL)?True:False; ++ } ++} ++ + /* + * find all windows below this and if name matches call doit on it + */ +@@ -150,11 +180,12 @@ + { + Window *child, dummy; + unsigned int children, i; +- char **cpp, *name; ++ char **cpp; ++ unsigned char *name; + if (XQueryTree(dpy, top, &dummy, &dummy, &child, &children)==0) + Fatal_Error("XQueryTree failed"); + for (i=0; i= ' ' && ((*name)&0x80)== 0 ) { ++ putchar(*name); ++ } else ++ printf("\\%03hho",*name); ++ name++; ++ } ++ putchar('\''); ++ putchar('\n'); ++ } ++} ++ ++/* + * set window size + */ + static void +@@ -485,6 +549,9 @@ + case colormap: + XSetWindowColormap(dpy, window, cmap); + break; ++ case print: ++ doprint(window); ++ break; + case pop: + XMapRaised(dpy, window); + break; +@@ -747,6 +814,8 @@ + free(buf); + } + ++char *allwindows[] = {""}; ++ + int + main(int argc, char *argv[]) + { +@@ -764,7 +833,12 @@ + while (argv++, --argc > 0) { + /* argv[0] = next argument */ + /* argc = # of arguments left */ +- if (matchopt("ba*ckingstore", 0, pargc, argv) || ++ if (matchopt("a*ll", 0, pargc, argv)) { ++ Winidmode = WID_names; ++ names = allwindows; ++ numnames = 1; ++ } ++ else if (matchopt("ba*ckingstore", 0, pargc, argv) || + matchopt("bs", 0, pargc, argv)) { + function |= FBIT(F_winattr); + Gbs = 1; +@@ -890,6 +964,9 @@ + else if (matchopt("p*op", 0, pargc, argv)) { + function |= FBIT(pop); + } ++ else if (matchopt("pr*int", 0, pargc, argv)) { ++ function |= FBIT(print); ++ } + else if (matchopt("f*ocus", 0, pargc, argv)) { + function |= FBIT(focus); + } +@@ -961,6 +1038,12 @@ + warpx = atoi(argv[1]); + warpy = atoi(argv[2]); + argv += 2; ++ } else if(matchopt("prop*erty",1, pargc,argv)) { ++ property = XInternAtom(dpy,argv[1],False); ++ if( None == property ) { ++ Fatal_Error("Unknown atom %s",argv[1]); ++ } ++ argv++; + } + else + usage(); +diff -u -r o/previous/xwit.man xwit-3.4/xwit.man +--- o/previous/xwit.man 2005-12-02 15:30:42.000000000 +0100 ++++ xwit-3.4/xwit.man 2005-12-02 16:09:57.000000000 +0100 +@@ -56,6 +56,7 @@ + .RB [ \-root ] + .RB [ \-current ] + .RB [ \-select ] ++.RB [ \-all ] + .RB [ \-names + .IR initialsubstring... ] + .in +@@ -78,6 +79,11 @@ + \-sync + causes all X requests to be performed synchronously. + .TP ++\-property property ++causes the specified property to be used instead of the windows ++name (which is WM_NAME). ++Some possible values are: WM_CLASS, WM_COMMAND, WM_ICON_NAME, WM_CLIENT_MACHINE. ++.TP + \-pop + is the default action. + It need only be given if it is wanted as well as some other function. +@@ -171,6 +177,11 @@ + The global setting of auto-repeat can be set with xset(1). + When off, no keys will repeat. + .TP ++\-print ++will print the id, the coordinates, the depth and the name of all ++selected windows. ++If \-property is given, that one will be printed instead of the name. ++.TP + Window Selection + .br + If no window is specified, $WINDOWID will be used if set; +@@ -190,10 +201,14 @@ + \-select + allows the user to interactively select a window with the mouse. + .TP ++\-all ++is equivalent to \-names '', as easier to remember. ++.TP + \-names + if given must be the last option and is followed by a list of strings. + All windows that have a name that begins exactly like one of the strings + will be acted upon. ++If \-property is given, this property is used instead of the name. + By using a null string (\-names ''), all names will be matched. + .SH EXAMPLES + .\" DD 10/97: seems to crash olvwm, sigh +Nur in o/previous: xwit.o. --- xwit-3.4.orig/debian/patches/cleanup.patch +++ xwit-3.4/debian/patches/cleanup.patch @@ -0,0 +1,331 @@ +This patch replaces dpatch.c with a newer version of +that file from the xorg cvs. +Additionally it makes dsimple.h contain proper prototypes +and adds a Makefile and changes the manpage. + +diff -r -u -N xwit-3.4/dsimple.c d/xwit-3.4/dsimple.c +--- xwit-3.4/dsimple.c 1995-10-19 00:59:17.000000000 +0100 ++++ d/xwit-3.4/dsimple.c 2005-10-21 20:11:26.000000000 +0200 +@@ -1,25 +1,47 @@ +-/* $XConsortium: dsimple.c,v 1.12 91/05/11 21:01:36 gildea Exp $ */ +-/* $Id: dsimple.c,v 3.2 95/10/18 16:58:55 dd Exp $ */ ++/* $Xorg: dsimple.c,v 1.4 2001/02/09 02:05:54 xorgcvs Exp $ */ ++/* ++ ++Copyright 1993, 1998 The Open Group ++ ++Permission to use, copy, modify, distribute, and sell this software and its ++documentation for any purpose is hereby granted without fee, provided that ++the above copyright notice appear in all copies and that both that ++copyright notice and this permission notice appear in supporting ++documentation. ++ ++The above copyright notice and this permission notice shall be included ++in all copies or substantial portions of the Software. ++ ++THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ++OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF ++MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. ++IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR ++OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ++ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR ++OTHER DEALINGS IN THE SOFTWARE. ++ ++Except as contained in this notice, the name of The Open Group shall ++not be used in advertising or otherwise to promote the sale, use or ++other dealings in this Software without prior written authorization ++from The Open Group. ++ ++*/ ++/* $XFree86: xc/programs/xlsfonts/dsimple.c,v 3.6 2001/12/14 20:02:09 dawes Exp $ */ ++ + #include + #include + #include + #include + #include ++#include ++#include + /* + * Other_stuff.h: Definitions of routines in other_stuff. + * + * Written by Mark Lillibridge. Last updated 7/1/87 +- * +- * Send bugs, etc. to chariot@athena.mit.edu. + */ + +-unsigned long Resolve_Color(); +-Pixmap Bitmap_To_Pixmap(); +-Window Select_Window(); +-void out(); +-void blip(); +-Window Window_With_Name(); +-void Fatal_Error(); ++#include "dsimple.h" + + /* + * Just_display: A group of routines designed to make the writting of simple +@@ -29,24 +51,22 @@ + * and screen already defined on entry. + * + * Written by Mark Lillibridge. Last updated 7/1/87 +- * +- * Send bugs, etc. to chariot@athena.mit.edu. + */ + + + /* This stuff is defined in the calling program by just_display.h */ +-extern char *program_name; +-extern Display *dpy; +-extern int screen; ++char *program_name = "unknown_program"; ++Display *dpy; ++int screen; + ++static void _bitmap_error(int, char *); + + /* + * Malloc: like malloc but handles out of memory using Fatal_Error. + */ +-char *Malloc(size) +- unsigned size; ++char *Malloc(size_t size) + { +- char *data, *malloc(); ++ char *data; + + if (!(data = malloc(size))) + Fatal_Error("Out of memory!"); +@@ -58,11 +78,9 @@ + /* + * Realloc: like Malloc except for realloc, handles NULL using Malloc. + */ +-char *Realloc(ptr, size) +- char *ptr; +- int size; ++char *Realloc(void *ptr,size_t size) + { +- char *new_ptr, *realloc(); ++ void *new_ptr; + + if (!ptr) + return(Malloc(size)); +@@ -78,9 +96,7 @@ + * Get_Display_Name (argc, argv) Look for -display, -d, or host:dpy (obselete) + * If found, remove it from command line. Don't go past a lone -. + */ +-char *Get_Display_Name(pargc, argv) +- int *pargc; /* MODIFIED */ +- char **argv; /* MODIFIED */ ++char *Get_Display_Name(int *pargc, char **argv) + { + int argc = *pargc; + char **pargv = argv+1; +@@ -138,9 +154,7 @@ + * for this display is then stored in screen. + * Does not require dpy or screen defined. + */ +-void Setup_Display_And_Screen(argc, argv) +-int *argc; /* MODIFIED */ +-char **argv; /* MODIFIED */ ++void Setup_Display_And_Screen(int *argc, char **argv) + { + dpy = Open_Display (Get_Display_Name(argc, argv)); + screen = DefaultScreen(dpy); +@@ -259,7 +273,7 @@ + #define OPTION argv[0] + #define NXTOPTP ++argv, --argc>0 + #define NXTOPT if (++argv, --argc==0) usage() +-#define COPYOPT nargv++[0]=OPTION; nargc++ ++#define COPYOPT nargv++[0]=OPTION, nargc++ + + while (NXTOPTP) { + if (!strcmp(OPTION, "-")) { +@@ -285,7 +299,7 @@ + w=0; + sscanf(OPTION, "0x%lx", &w); + if (!w) +- sscanf(OPTION, "%ld", &w); ++ sscanf(OPTION, "%lu", &w); + if (!w) + Fatal_Error("Invalid window id format: %s.", OPTION); + continue; +@@ -301,13 +315,8 @@ + * Other_stuff: A group of routines which do common X11 tasks. + * + * Written by Mark Lillibridge. Last updated 7/1/87 +- * +- * Send bugs, etc. to chariot@athena.mit.edu. + */ + +-extern Display *dpy; +-extern int screen; +- + /* + * Resolve_Color: This routine takes a color name and returns the pixel # + * that when used in the window w will be of color name. +@@ -381,7 +390,9 @@ + */ + void blip() + { +- outl("blip!"); ++ fflush(stdout); ++ fprintf(stderr, "blip!\n"); ++ fflush(stderr); + } + + +@@ -472,13 +483,14 @@ + * in code so we can tell where we are. Outl may be invoked like + * printf with up to 7 arguments. + */ +-/* VARARGS1 */ +-outl(msg, arg0,arg1,arg2,arg3,arg4,arg5,arg6) +- char *msg; +- char *arg0, *arg1, *arg2, *arg3, *arg4, *arg5, *arg6; ++void ++outl(char *msg, ...) + { ++ va_list args; + fflush(stdout); +- fprintf(stderr, msg, arg0, arg1, arg2, arg3, arg4, arg5, arg6); ++ va_start(args, msg); ++ vfprintf(stderr, msg, args); ++ va_end(args); + fprintf(stderr, "\n"); + fflush(stderr); + } +@@ -488,15 +500,15 @@ + * Standard fatal error routine - call like printf but maximum of 7 arguments. + * Does not require dpy or screen defined. + */ +-/* VARARGS1 */ +-void Fatal_Error(msg, arg0,arg1,arg2,arg3,arg4,arg5,arg6) +-char *msg; +-char *arg0, *arg1, *arg2, *arg3, *arg4, *arg5, *arg6; ++void Fatal_Error(char *msg, ...) + { ++ va_list args; + fflush(stdout); + fflush(stderr); + fprintf(stderr, "%s: error: ", program_name); +- fprintf(stderr, msg, arg0, arg1, arg2, arg3, arg4, arg5, arg6); ++ va_start(args, msg); ++ vfprintf(stderr, msg, args); ++ va_end(args); + fprintf(stderr, "\n"); + exit(2); + } +diff -r -u -N xwit-3.4/dsimple.h d/xwit-3.4/dsimple.h +--- xwit-3.4/dsimple.h 1995-08-25 02:26:37.000000000 +0200 ++++ d/xwit-3.4/dsimple.h 2005-10-21 20:12:30.000000000 +0200 +@@ -12,26 +12,26 @@ + + /* Global variables used by routines in just_display.c */ + +-char *program_name = "unknown_program"; /* Name of this program */ +-Display *dpy; /* The current display */ +-int screen; /* The current screen */ ++extern char *program_name; /* Name of this program */ ++extern Display *dpy; /* The current display */ ++extern int screen; /* The current screen */ + + #define INIT_NAME program_name=argv[0] /* use this in main to setup + program_name */ + + /* Declaritions for functions in just_display.c */ + +-void Fatal_Error(); +-char *Malloc(); +-char *Realloc(); +-char *Get_Display_Name(); +-Display *Open_Display(); +-void Setup_Display_And_Screen(); +-XFontStruct *Open_Font(); +-void Beep(); +-Pixmap ReadBitmapFile(); +-void WriteBitmapFile(); +-Window Select_Window_Args(); ++void Fatal_Error(char *msg, ...); ++char *Malloc(size_t); ++char *Realloc(void*,size_t); ++char *Get_Display_Name(int*,char **); ++Display *Open_Display(char *); ++void Setup_Display_And_Screen(int *, char **); ++XFontStruct *Open_Font(char *); ++void Beep(void); ++Pixmap ReadBitmapFile(Drawable,char *,int*,int*,int*,int*); ++void WriteBitmapFile(char *,Pixmap,int,int,int,int); ++Window Select_Window_Args(int *,char **); + + #define X_USAGE "[host:display]" /* X arguments handled by + Get_Display_Name */ +@@ -45,9 +45,10 @@ + * Send bugs, etc. to chariot@athena.mit.edu. + */ + +-unsigned long Resolve_Color(); +-Pixmap Bitmap_To_Pixmap(); +-Window Select_Window(); +-void out(); +-void blip(); +-Window Window_With_Name(); ++unsigned long Resolve_Color(Window,char *); ++Pixmap Bitmap_To_Pixmap(Display *,Drawable,GC,Pixmap,int,int); ++Window Select_Window(Display *); ++void out(void); ++void blip(void); ++Window Window_With_Name(Display *,Window,char *); ++void usage(void); +diff -r -u -N xwit-3.4/Makefile d/xwit-3.4/Makefile +--- xwit-3.4/Makefile 1970-01-01 01:00:00.000000000 +0100 ++++ d/xwit-3.4/Makefile 2005-10-22 00:21:19.000000000 +0200 +@@ -0,0 +1,20 @@ ++CFLAGS ?= -Wall -O2 -g ++LDFLAGS ?= -L/usr/X11R6/lib ++LIBRARIES = -lX11 ++ ++xwit: xwit.o ClientWin.o dsimple.o ++ gcc $(CFLAGS) $(LDFLAGS) $(LIBRARIES) -o $@ $^ ++ ++%.o: %.c ++ gcc $(CFLAGS) -c -o $@ $< ++ ++# Headers needed ++dsimple.o: dsimple.h ++xwit.o: dsimple.h ++ ++clean: ++ -rm xwit *.o ++ ++install: xwit ++ install xwit $(DESTDIR)/usr/bin/ ++ +diff -r -u -N xwit-3.4/xwit.man d/xwit-3.4/xwit.man +--- xwit-3.4/xwit.man 2005-10-21 19:38:35.000000000 +0200 ++++ d/xwit-3.4/xwit.man 2005-10-22 12:10:49.000000000 +0200 +@@ -1,5 +1,4 @@ +-.\" $Id: xwit.man,v 3.4 97/10/20 18:32:54 dd Exp $ +-.TH XWIT 1X ++.TH XWIT 1 "22 Oct 2005" + .SH NAME + xwit \- window interface tool: pop or iconify this xterm window or named windows + .SH SYNOPSIS +@@ -70,7 +69,7 @@ + strings, or a particular window id given, or the window id found + in the environment variable + .B WINDOWID +-(which is set by xterm for the program it runs). ++(which is set by xterm for the program it runs), or the window under the mouse cursor. + .SH OPTIONS + .TP + -display +@@ -229,5 +228,6 @@ + .br + David DiGiacomo, david@slack.com + .SH ACKNOWLEDGEMENTS +-Thanks to Andre Delafontaine, Norman R. McBride, Keith Thompson, and +-Glen R. Walker for bug reports and suggestions. ++Thanks to Andre Delafontaine, Norman R. McBride, Keith Thompson, ++Glen R. Walker, Michael Mauch, Dima Barsky and Decklin Foster ++for bug reports, suggestions and/or patches. --- xwit-3.4.orig/debian/watch +++ xwit-3.4/debian/watch @@ -0,0 +1,5 @@ +# Example watch control file for uscan +# See uscan(1) for format +version=2 + +http://ftp.x.org/contrib/utilities/xwit-(.*)\.tar\.gz --- xwit-3.4.orig/debian/dirs +++ xwit-3.4/debian/dirs @@ -0,0 +1 @@ +usr/bin --- xwit-3.4.orig/debian/copyright +++ xwit-3.4/debian/copyright @@ -0,0 +1,92 @@ +This package was debianized by Bernhard R. Link on +Fri, 21 Oct 2005 12:06:15 +0200. + +The .orig.tar.gz was repackaged by my predecessor as maintainer +without any changes from a .tar.gz from ftp://ftp.x.org/contrib/utilities/ + +xwit is written by +Mark M Martin mmm@cetia.fr +and +David DiGiacomo david@slack.com + +The actual license is a bit unclear, the README file states: + +| The program is released into the public domain. The considerate +| will leave credit for the authors. + +while xwit.c contains the following notice: + + * Copyright 1991 CETIA + * Permission to use, copy, modify, distribute, and sell this software and its + * documentation for any purpose is hereby granted without fee, provided that + * the above copyright notice appear in all copies and that both that + * copyright notice and this permission notice appear in supporting + * documentation, and that the name of CETIA not be used in advertising or + * publicity pertaining to distribution of the software without specific, + * written prior permission. CETIA makes no representations about the + * suitability of this software for any purpose. It is provided "as is" + * without express or implied warranty. + * + * CETIA DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL CETIA + * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION + * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + * Original by Mark M Martin. cetia 93/08/13 r1.6 mmm@cetia.fr + * + * This version by David DiGiacomo, david@slack.com. + +The file ClientWin.c contain the following notice: + + * Copyright 1989 by the Massachusetts Institute of Technology + * + * Permission to use, copy, modify, and distribute this software and its + * documentation for any purpose and without fee is hereby granted, provided + * that the above copyright notice appear in all copies and that both that + * copyright notice and this permission notice appear in supporting + * documentation, and that the name of M.I.T. not be used in advertising + * or publicity pertaining to distribution of the software without specific, + * written prior permission. M.I.T. makes no representations about the + * suitability of this software for any purpose. It is provided "as is" + * without express or implied warranty. + +Additionally, xwit is compiled using a file named dsimple.c, which +has no license notice in the .tar.gz, and is replaced in the .diff.gz +by a almost identically file available from the X sources with the following +license notice: + +| Copyright 1993, 1998 The Open Group +| +| Permission to use, copy, modify, distribute, and sell this software and its +| documentation for any purpose is hereby granted without fee, provided that +| the above copyright notice appear in all copies and that both that +| copyright notice and this permission notice appear in supporting +| documentation. +| +| The above copyright notice and this permission notice shall be included +| in all copies or substantial portions of the Software. +| +| THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +| OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +| MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +| IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR +| OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +| ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +| OTHER DEALINGS IN THE SOFTWARE. +| +| Except as contained in this notice, the name of The Open Group shall +| not be used in advertising or otherwise to promote the sale, use or +| other dealings in this Software without prior written authorization +| from The Open Group. + +Additionally included are + +- a patch to add -fetch and -store and may clean-ups + (most likely from Dima Barsky ) +- a patch to add a -focus option from + Michael Mauch +- a patch to add -raise, -lower, -opposite, -circulate from + Decklin Foster +- some cleanup by me (Bernhard R. Link ) --- xwit-3.4.orig/debian/control +++ xwit-3.4/debian/control @@ -0,0 +1,18 @@ +Source: xwit +Section: x11 +Priority: optional +Maintainer: Bernhard R. Link +Build-Depends: debhelper (>= 4.0.0), libx11-dev, x-dev +Standards-Version: 3.6.2 + +Package: xwit +Architecture: any +Depends: ${shlibs:Depends} +Description: a collection of simple routines to call some X11 functions + xwit allows to call some X11 functions from the command line or + a shell script. + . + xwit will resize, iconify, pop, and move windows given + by name or id, change an icon, title or name, set the screen saver + going, and change individual key autorepeat settings, move the + mouse cursor, etc. --- xwit-3.4.orig/debian/rules +++ xwit-3.4/debian/rules @@ -0,0 +1,67 @@ +#!/usr/bin/make -f +# -*- makefile -*- +# Sample debian/rules that uses debhelper. +# This file was originally written by Joey Hess and Craig Small. +# As a special exception, when this file is copied by dh-make into a +# dh-make output file, you may use that output file without restriction. +# This special exception was added by Craig Small in version 0.37 of dh-make. + +# Uncomment this to turn on verbose mode. +#export DH_VERBOSE=1 + +CFLAGS = -Wall -g + +ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) + CFLAGS += -O0 +else + CFLAGS += -O2 +endif + +configure: + +build: build-stamp + +build-stamp: + dh_testdir + $(MAKE) CFLAGS="$(CFLAGS)" + touch build-stamp + +clean: + dh_testdir + dh_testroot + rm -f build-stamp + -$(MAKE) clean + dh_clean + +install: build + dh_testdir + dh_testroot + dh_clean -k + dh_installdirs + $(MAKE) install DESTDIR=$(CURDIR)/debian/xwit + + +# Build architecture-independent files here. +binary-indep: build install +# We have nothing to do by default. + +# Build architecture-dependent files here. +binary-arch: build install + dh_testdir + dh_testroot + dh_installchangelogs + dh_installdocs + dh_installexamples + dh_installman xwit.man + dh_link + dh_strip + dh_compress + dh_fixperms + dh_installdeb + dh_shlibdeps + dh_gencontrol + dh_md5sums + dh_builddeb + +binary: binary-indep binary-arch +.PHONY: build clean binary-indep binary-arch binary install configure --- xwit-3.4.orig/debian/docs +++ xwit-3.4/debian/docs @@ -0,0 +1 @@ +README --- xwit-3.4.orig/ClientWin.h +++ xwit-3.4/ClientWin.h @@ -0,0 +1,2 @@ + +Window XmuClientWindow (Display *dpy,Window win); --- xwit-3.4.orig/Makefile +++ xwit-3.4/Makefile @@ -0,0 +1,23 @@ +CFLAGS ?= -Wall -O2 -g -Wstrict-prototypes -Wmissing-prototypes +LDFLAGS ?= -L/usr/X11R6/lib -Wl,-z,defs +LIBRARIES = -lX11 + +all: xwit + +xwit: xwit.o ClientWin.o dsimple.o + gcc $(CFLAGS) $(LDFLAGS) $(LIBRARIES) -o $@ $^ + +%.o: %.c + gcc $(CFLAGS) -c -o $@ $< + +# Headers needed +dsimple.o: dsimple.h +xwit.o: dsimple.h ClientWin.h +ClientWin.o: ClientWin.h + +clean: + -rm xwit *.o + +install: xwit + install xwit $(DESTDIR)/usr/bin/ +