Sophie

Sophie

distrib > Mandriva > 9.0 > i586 > media > contrib-src > by-pkgid > db1c80ec145b307bff8be5d40e77c8bb > files > 2

xtoolplaces-1.3.1-2mdk.src.rpm

--- CHANGES
+++ CHANGES	1998/09/14 09:46:08
@@ -1,3 +1,22 @@
+
+From 1.3.1 (patchlevel 3.1.toolwait-0.1) -> 1.3.1.toolwait (patchlevel 3.1.toolwait-0.2):
+-------------------------------------------------
+
+  - Added option to use other programs than "xtoolwait".
+    Command line option is "-p" and X-resource
+    "xtoolplaces.toolwaitprog". Also, edited the manual a little
+    to reflect the new options and recources.
+    (This entry by Peter Bollerman <bollerma@math.ruu.nl>, 13-9-95)
+
+From 1.3.1 (patchlevel 3) -> 1.3.1.toolwait (patchlevel 3.1.toolwait-0.1):
+-------------------------------------------------
+
+  - Added option -w to use "xtoolwait", a Sun OpenWindows "toolwait"
+    look-alike. Command line option is "-w" and X-resource
+    "xtoolplaces.toolwait". Also, when named "owplaces" the program will
+    automatically assume the use of "xtoolwait".
+    (This entry by Peter Bollerman <bollerma@math.ruu.nl>, 13-9-95)
+
 From 1.3 (patchlevel 3) -> 1.3.1 (patchlevel 3.1):
 -------------------------------------------------
 
--- Makefile.Linux
+++ Makefile.Linux	1998/09/14 09:40:59
@@ -0,0 +1,24 @@
+#
+#
+#
+# Makefile.Linux to integrate package into source tree of S.u.S.E.-Linux.
+#
+# Copyright (c) 1995 S.u.S.E. Gmbh Fuerth, Germany.  All rights reserved.
+#
+#
+XTOOLWAIT=xtoolwait-0.3
+
+extract:
+	tar xzfp ../$(XTOOLWAIT).tar.gz
+
+compile: 
+	xmkmf -a
+	make
+#	cd $(XTOOLWAIT) && xmkmf -a
+#	cd $(XTOOLWAIT) && make
+
+install:
+	make install
+	make install.man
+#	cd $(XTOOLWAIT) && make install
+#	cd $(XTOOLWAIT) && make install.man
--- Xtoolplaces.ad
+++ Xtoolplaces.ad	1998/09/14 09:46:08
@@ -25,5 +25,12 @@
 xtoolplaces.display:	:0
 xtoolplaces.remote:	rsh
 xtoolplaces.saveto:	.xtoolplaces
+! saveto file for use with XView
+!xtoolplaces.saveto:	.openwin-init
 xtoolplaces.screens:	all
+! uncomment this for making xtoolplaces prepend "xtoolwait" command
+!xtoolplaces.toolwait
+xtoolplaces.toolwaitprog	xtoolwait
+! uncomment this for making xtoolplaces use alternative toolwait program
+!xtoolplaces.toolwaitprog	toolwait
 
--- addon.c
+++ addon.c	1998/09/14 09:48:20
@@ -83,7 +83,10 @@
 {
 	register char *pointer;
 	register ADDON *next;
-	char *calloc(),*strdup();
+	char *calloc();
+#ifndef strdup
+	char *strdup();
+#endif
 
 	/*Find colon to make it a NULL thereby making line equal to just
 	  the program name.  Syntax error if the colon isn't found*/
--- getargs.c
+++ getargs.c	1998/09/14 09:46:08
@@ -23,7 +23,7 @@
 #include "xtoolplaces.h"
 #include "patchlevel.h"
 
-int num_op_entries = 8;			/*Number of entries in OP table*/
+int num_op_entries = 10;		/*Number of entries in OP table*/
 char use_display[256];			/*Display to use*/
 XrmDatabase cmmd_line_db;		/*Command line arguments*/
 XrmDatabase database;			/*Database containing ALL resources*/
@@ -35,7 +35,9 @@
 		{"-m", ".missing",   XrmoptionSepArg, (caddr_t) NULL},
 		{"-r", ".remote",    XrmoptionSepArg, (caddr_t) NULL},
 		{"-s", ".screens",   XrmoptionSepArg, (caddr_t) NULL},
-		{"-v", ".version",   XrmoptionIsArg,  (caddr_t) NULL}
+		{"-v", ".version",   XrmoptionIsArg,  (caddr_t) NULL},
+		{"-w", ".toolwait",  XrmoptionIsArg,  (caddr_t) NULL},
+		{"-p", ".toolwaitprog",    XrmoptionSepArg, (caddr_t) NULL}
 };
 extern char *program;
 extern Display *display;
@@ -115,9 +117,9 @@
 	register char *str_type[20],*resource;
 	XrmValue value;
 
-	/*Allocate space for the names of the 2 resources we'll be looking
-	  for (the display and version resources)*/
-	if((resource = malloc(strlen(program)+9)) == NULL) {
+	/*Allocate space for the name of the largest resource
+		we'll be looking for (the "toolwaitprog" resource)*/
+	if((resource = malloc(strlen(program)+14)) == NULL) {
 	  perror(program);
 	  exit(1);
 	}
@@ -267,7 +269,7 @@
 */
 extract_options()
 {
-	register char *resource,*str_type[20],*filename;
+	register char *resource,*str_type[20],*filename, *tw_program;
 	XrmValue value;
 	char *malloc();
 	extern int console_checking;
@@ -337,6 +339,26 @@
 	    perror(program);
 	    exit(1);
 	  }
+
+	/*Get toolwait option (-w)*/
+	sprintf(resource,"%s.toolwait",program);
+	if(XrmGetResource(database,resource,"xtoolplaces.toolwait",
+			  str_type,&value) == True)
+	  do_toolwait = 1;
+
+	/*Get program to start applications with (-p)*/
+	tw_program = NULL;
+	sprintf(resource,"%s.toolwaitprog",program);
+	if(XrmGetResource(database,resource,"xtoolplaces.toolwaitprog",
+			  str_type,&value) == True)
+	  if(value.addr && ((tw_program = strdup(value.addr)) == NULL)) {
+	    perror(program);
+	    exit(1);
+	  }
+	if (tw_program)
+		tw_str=tw_program;
+	else
+		tw_str=DEFAULT_PROGRAM;
 }
 
 /*This function will get the user's home directory, either from the HOME
--- getgeom.c
+++ getgeom.c	1998/09/14 10:11:51
@@ -18,9 +18,10 @@
 #include <stdio.h>
 #include <X11/Xos.h>
 #include <X11/Xlib.h>
+#include <X11/Xlibint.h>
 #include <X11/Xutil.h>
 
-char *strip_arg2(),*malloc(),*index();
+char *strip_arg2(),*malloc();
 extern char *program;
 extern Display *display;
 
@@ -68,10 +69,12 @@
 	register char *icon_arg,*geom_arg,geometry_args[100],*rearrange,*ptr;
 	register Status status;
 	Window root,dummywin;
-	XSizeHints hints;
+	XSizeHints hints, hulp;
 	register XWMHints *icon_hints;
 	char *strip_geometry(),*strip_xterm_geometry(),*strip_emacs_geometry();
+#ifndef strdup
 	char *strdup();
+#endif
 
 	/*Get icon position*/
 	icon_x = icon_y = -1;
@@ -110,7 +113,7 @@
 	    height_inc = hints.height_inc;
 	    icon_arg = "#";
 
-	    XFree(hints);
+/*	    XFree(hints);*/
 
 	    /*Strip old geometry arguments out of command line (if the
 	      command line has any geometry arguments)*/
@@ -126,7 +129,7 @@
 		   icon_x = -1;				/*No icon arg*/
 		   geom_arg = "-w";			/*Figures...*/
 
-		   XFree(hints);
+/*		   XFree(hints);*/
 
 		   /*Strip old geometry arguments out of command line (if the
 		     command line has any geometry arguments)*/
@@ -148,7 +151,7 @@
 	    sprintf(geometry_args," %s %dx%d+%d+%d %s+%d+%d",geom_arg,width/width_inc,height/height_inc,tx-x,ty-y,icon_arg,icon_x,icon_y);
 
 	  /*Add window and icon geometry as first arguments*/
-	  if((rearrange = malloc(command_line,strlen(command_line) +
+	  if((rearrange = malloc(strlen(command_line) +
 				 strlen(geometry_args) + 1)) == NULL) {
 	    perror(program);
 	    exit(1);
@@ -237,7 +240,9 @@
 {
 	register int numbytes;
 	register char *pointer1,*pointer2,*new_command_line;
+#ifndef strstr
 	char *strstr();
+#endif
 
 	/*If the argument to strip isn't here, then just return the original
 	  string*/
--- getinfo.c
+++ getinfo.c	1998/09/14 10:28:56
@@ -18,10 +18,13 @@
 #include <stdio.h>
 #include <signal.h>
 #include <X11/Xlib.h>
+#include <X11/Xlibint.h>
 #include <X11/Xutil.h>
 #include <X11/cursorfont.h>
 #include <X11/Xatom.h>
 
+#include "xtoolplaces.h"
+
 int mult_screens,screen_number,display_number;
 char hostname[50];
 Atom wm_save_yourself,wm_protocols,wm_client_machine;
@@ -198,7 +201,6 @@
 	register XWMHints *hints;
 	char *combine(),*getgeom(),*getname(),*lower();
 
-
 	/*If a child had children of it's own, loop thru it's children
 	  recursively*/
 	if(XQueryTree(display,window,&root,&parent,&child,&num_child)) {
@@ -303,7 +305,10 @@
 	    screen*/
 
 	  /*Write out all the arguments in WM_COMMAND*/
-	  fprintf(fp,"%s ",command_line);
+	  if (do_toolwait)
+		fprintf(fp,"%s %s ", tw_str, command_line);
+	  else
+		fprintf(fp,"%s ",command_line);
 
 	  if(mult_screens) adddisplay(command_line,screen_number);
 
@@ -311,7 +316,10 @@
 	  if(addon) addto(command_line);
 
 	  /*Write out ampersand to put command into the background*/
-	  fputs("&\n",fp);
+	  if (do_toolwait)
+		fputs("\n",fp);
+	  else
+		fputs("&\n",fp);
 
 	  if(console)
 	    fputs("fi\n",fp);
@@ -336,7 +344,10 @@
 {
 	register int loop;
 	register char *pointer,*newstring;
-	char *rindex(),*strdup();
+	char *rindex();
+#ifndef strdup
+	char *strdup();
+#endif
 
 	if((pointer = rindex(string,'/')) == NULL) pointer = string;
 	else ++pointer;
--- missing.c
+++ missing.c	1998/09/14 11:29:23
@@ -41,7 +41,9 @@
 {
 	register char line[200];
 	register FILE *fp;
+#ifndef strdup
 	char *strdup();
+#endif
 
 	/*Open the file for reading*/
 	if((fp = fopen(missing,"r")) == NULL) {
--- xtoolplaces.c
+++ xtoolplaces.c	1998/09/14 09:46:08
@@ -25,6 +25,8 @@
 char *remote;				/*Command to use for remote apps*/
 char *program;				/*Program name*/
 FILE *fp;				/*File pointer to write to*/
+unsigned int do_toolwait=0;		/*Whether to use SuN's "toolwait"*/
+char *tw_str;				/*Name of alternative "toolwait" program*/
 
 /*This program will write the current state of every window on an X desktop to
   a file (or stdout).  It is the X equivalent to Sunview's toolplaces program.
@@ -44,7 +46,17 @@
 register int argc;
 register char *argv[];
 {
+	char *pr_ptr;
+
 	program = argv[0];
+	if ((pr_ptr=rindex(program,'/')))
+	{
+	    if (strcmp(pr_ptr+1,"owplaces") == 0)
+		do_toolwait=1;
+	}
+	else
+	    if (strcmp(program,"owplaces") == 0)
+		do_toolwait=1;
 
 	/*Get and parse arguments and resources*/
 	getargs(argc,argv);
--- xtoolplaces.h
+++ xtoolplaces.h	1998/09/14 09:46:08
@@ -16,13 +16,14 @@
 */
 
 /*User modifiable defines*/
-#define APPSDIR "/usr/lib/X11/app-defaults"	/*Default resource directory*/
+#define APPSDIR "/usr/X11R6/lib/X11/app-defaults"	/*Default resource directory*/
 #define APPSFILENAME "Xtoolplaces"		/*Class name*/
 #define CONSOLE_CLASS "XConsole"		/*Class of console windows*/
 #define DEFAULT_FILENAME ".xtoolplaces"		/*Default name to save to*/
 #define DEFAULT_REMOTE "rsh -n"			/*Default remote command*/
 #define HOME "HOME"				/*Home environment variable*/
 #define USER "USER"				/*User environment variable*/
+#define DEFAULT_PROGRAM "xtoolwait"		/*Default toolwait program*/
 
 /*3 popular console terminal windows and the method to identify when
   they are present and in console mode since there is no console class*/
@@ -30,10 +31,12 @@
 #define SUN_TOOLS_ICON_NAME "CONSOLE"		/*Icon name for sun consoles*/
 #define XTERM_OPTION "-C"			/*Console option for xterm*/
 
+extern unsigned int do_toolwait;
+extern char *tw_str;
 
 /*Do not modify anything below this line*/
 
 /*Global definitions*/
-#define USAGE "[-a filename] [-c] [-display host:display.screen] [-f filename] [-m filename] [-r command] [-s {list | all}] [-v]"
+#define USAGE "[-a filename] [-c] [-display host:display.screen] [-f filename] [-m filename] [-r command] [-s {list | all}] [-v] [-w] [-p program]"
 #define VERSION "1.3.1"				/*Version*/
 
--- xtoolplaces.man
+++ xtoolplaces.man	1998/09/14 09:46:08
@@ -3,7 +3,90 @@
 .SH NAME
 xtoolplaces - save current X desktop window information
 .SH SYNOPSIS
-xtoolplaces [-a filename] [-c] [-display host:display.screen] [-f filename] [-m filename] [-r command] [-s {list | all}] [-v]
+.B xtoolplaces
+[
+.BR \- a  " \c"
+.I "filename"
+]
+[
+.BR \- c
+]
+[
+.BR \- f " \c"
+.I filename
+]
+[
+.BR \- v
+]
+[
+.BR \- display "   \c"
+.I host:display.screen
+]
+[
+.BR \- w
+]
+[
+.BR \- p "   \c"
+.I "program"
+]
+[
+.BR \- m " \c"
+.I filename
+]
+[
+.BR \- r " \c"
+.I command
+]
+[
+.BR \- s " \c"
+{
+.I list
+|
+.I all
+}
+]
+.B owplaces "  \c"
+[
+.BR \- a  " \c"
+.I "filename"
+]
+[
+.BR \- c
+]
+[
+.BR \- f "  \c"
+.I filename
+]
+[
+.BR \- v
+]
+[
+.BR \- display "   \c"
+.I host:display.screen
+]
+[
+.BR \- w
+]
+[
+.BR \- p "   \c"
+.I "program"
+]
+[
+.BR \- m " \c"
+.I filename
+]
+[
+.BR \- r " \c"
+.I command
+]
+[
+.BR \- s " \c"
+{
+.I list
+|
+.I all
+}
+]
 .SH DESCRIPTION
 Xtoolplaces collects current state information for all windows running on
 an X display at the time of execution.  This information can then be saved
@@ -45,6 +128,9 @@
 state in WM_COMMAND.  Since I needed different initialization files depending
 on what machine I was on and I used applications that weren't "well-behaved",
 this became a little limited.  Therefore, xtoolplaces was made.
+
+Instead of xtoolplaces one might want to use owplaces. It is identical to
+xtoolplaces -w.
 .SH OPTIONS
 Descriptions of the '-a', '-c', '-m', and '-s' options are listed in greater
 detail in following sections.  A description of resources is listed in
@@ -78,6 +164,10 @@
 .IP -v
 Print the current version number and patchlevel and quit.  No processing is
 done.
+.IP -w
+Use the xtoolwait command so that processes will start one at the time.
+.IP "-p program"
+Use \f2program\f1 as a replacement of xtoolwait command with the -w option.
 .SH ADDING ARGUMENTS (-a)
 The '-a' option was added because of a possible xview problem.  For some
 reason, some windows don't fill in the WM_COMMAND string completely.  For
@@ -218,6 +308,10 @@
 -r option (i.e. xtoolplaces.remote: rsh)
 .IP xtoolplaces.screens
 -s option (i.e. xtoolplaces.screens: 1 3 4)
+.IP xtoolplaces.toolwait
+-w option (i.e. xtoolplaces.toolwait:)
+.IP xtoolplaces.toolwaitprog
+-f option (i.e. xtoolplaces.toolwaitprog: toolwait)
 .SH FILES
 .IP "/usr/lib/X11/app-defaults/Xtoolplaces" 2i
 default resource file
@@ -233,6 +327,8 @@
 resource file for a specific machine
 .IP "~/.xtoolplaces" 2i
 default file to store window information
+.IP "~/.openwin-menu" 2i
+default file to store window information for owplaces. 
 .SH SEE ALSO
 toolplaces(1), xprop(1), xwininfo(1), xplaces(X)
 .SH BUGS