diff options
author | Matthieu Herrb <matthieu@cvs.openbsd.org> | 2012-03-18 17:17:15 +0000 |
---|---|---|
committer | Matthieu Herrb <matthieu@cvs.openbsd.org> | 2012-03-18 17:17:15 +0000 |
commit | 0d3b2137aa3a296d63e778798d7a15346d8e4932 (patch) | |
tree | d0ff35e4a09df14f7a2f95a2cea7a83c120807aa /app/fvwm | |
parent | 7dd2502ca8320bd98b446f1106b0e23c334f1569 (diff) |
Remove the whole extras directory, not used in OpenBSD builds.
Noticed by fgsch@ a while ago.
Diffstat (limited to 'app/fvwm')
141 files changed, 0 insertions, 34419 deletions
diff --git a/app/fvwm/extras/ChangeLog b/app/fvwm/extras/ChangeLog deleted file mode 100644 index f30ff2976..000000000 --- a/app/fvwm/extras/ChangeLog +++ /dev/null @@ -1,209 +0,0 @@ -1999-11-30 Dominik Vogt <dominik.vogt@gmx.de> - - * FvwmTaskBar/Goodies.c: - added #ifdef SHAPE - -1999-11-29 Dominik Vogt <dominik.vogt@gmx.de> - - * FvwmWharf/FvwmWharf.c (My_XNextEvent): - * FvwmTaskBar/FvwmTaskBar.c (EndLessLoop): - * FvwmScript/Widgets/Menu.c (EvtMouseMenu): - * FvwmScript/Widgets/List.c (EvtMouseList): - * FvwmScript/Instructions.c (Quit): - * FvwmScript/FvwmScript.c (MainLoop): - * FvwmPipe/FvwmPipe.c: - * FvwmGoodStuff/FvwmGoodStuff.c (My_XNextEvent): - * FvwmConsole/FvwmConsole.c: - fixed select arguments - -1999-02-15 Bob Woodside <proteus@pcnet.com> - - * FvwmConsole/FvwmConsole.h: Switched the order of the includes for - un.h and sockets.h, to correct a compile failure under Linux 2.2.1. - -1999-02-14 Dominik Vogt <dominik_vogt@hp.com> - - * FvwmGoodStuff/FvwmGoodStuff.c (RelieveWindow): - * FvwmGoodStuff/FvwmGoodStuff.h: removed inline from declaration of - RelieveWindow - -1999-01-26 Steven Michael ROBBINS <stever@jeff.cs.mcgill.ca> - - * FvwmConfig/WinBase.C: Removed include of strings.h, moved - include of config.h to top. - -1999-01-13 Steven Michael ROBBINS <stever@jeff.cs.mcgill.ca> - - * FvwmTaskBar/FvwmTaskBar.c (ParseConfigLine): Made argument just - "char", since "unsigned char" caused problems on systems with - signed chars. - - * FvwmConsole/FvwmConsole.c: Removed non-constant pointer from - initializer of xterm_a. - -Sun Jan 10 23:13:45 1999 Steve Robbins <steve@nyongwa.montreal.qc.ca> - - * FvwmGoodStuff/FvwmGoodStuff.c (main): Inserted parentheses - around && within ||. - -Sun Jan 10 23:06:00 1999 Steve Robbins <steve@nyongwa.montreal.qc.ca> - - * FvwmWharf/FvwmWharf.c: - * FvwmTaskBar/FvwmTaskBar.c: - * FvwmDebug/FvwmDebug.c: Removed unused variables. - -Sun Jan 10 21:11:09 1999 Steve Robbins <steve@nyongwa.montreal.qc.ca> - - * FvwmWharf/FvwmWharf.c (main): - * FvwmTaskBar/FvwmTaskBar.c (main): - * FvwmScript/FvwmScript.c (main): - * FvwmPipe/FvwmPipe.c (main): - * FvwmGoodStuff/FvwmGoodStuff.c (main): - * FvwmDebug/FvwmDebug.c (main): Fixed "control reaches end of - non-void function" bug. - -Sun Jan 10 15:14:22 1999 Steve Robbins <steve@nyongwa.montreal.qc.ca> - - * FvwmTaskBar/Colors.c: - * FvwmGoodStuff/FvwmGoodStuff.c (GetHilite): Removed min & max - macros; they are already in config.h. - -Sun Jan 10 15:11:15 1999 Steve Robbins <steve@nyongwa.montreal.qc.ca> - - * FvwmCommand/FvwmCommand.c: - * FvwmCommand/FvwmCommand.h: Replaced select() code conditional on - __hpux with code that uses SELECT_TYPE_ARG234. - -Sun Jan 10 15:08:43 1999 Steve Robbins <steve@nyongwa.montreal.qc.ca> - - * FvwmCommand/FvwmCommand.h: Replaced __linux with HAVE_GETOPT_H. - -Sun Jan 10 15:05:33 1999 Steve Robbins <steve@nyongwa.montreal.qc.ca> - - * FvwmWharf/icons.c: - * FvwmGoodStuff/icons.c: Replaced NeXT with HAVE_FNCTL_H. - -Sun Jan 10 15:03:26 1999 Steve Robbins <steve@nyongwa.montreal.qc.ca> - - * FvwmGoodStuff/FvwmGoodStuff.c: - * FvwmTaskBar/FvwmTaskBar.c: - * FvwmWharf/FvwmWharf.c: Replaced messy set of symbols with - HAVE_SYS_SELECT_H. - -Sun Jan 10 15:01:37 1999 Steve Robbins <steve@nyongwa.montreal.qc.ca> - - * FvwmWharf/FvwmWharf.c: - * FvwmTaskBar/FvwmTaskBar.c: - * FvwmGoodStuff/FvwmGoodStuff.c: Replaced symbol ISC with - HAVE_SYS_BSDTYPES_H. - -1999-01-08 Dominik Vogt <dominik_vogt@hp.com> - - * FvwmTaskBar/**: some general cleanup - - * FvwmTaskBar/FvwmTaskBar.c (ErrorHandler): added missing return value - - * FvwmTaskBar/FvwmTaskBar.c (ReadFvwmPipe): - (ProcessMessage): - * FvwmTaskBar/ButtonArray.c (ButtonNew): - (DrawButtonArray): - (LocateButton): - removed unused variables - - * FvwmTaskBar/Goodies.c: Applied a RedHat bugfix for "mailbox" - -1999-01-06 Paul D. Smith <psmith@gnu.org> - - * FvwmConsole/Makefile.am: Use X_EXTRA_LIBS instead of socket_LIBS. - -1998-12-02 Paul D. Smith <psmith@gnu.org> - - * FvwmCommand/Makefile.am: Put FvwmCommand into bindir, not the - module directory. FvwmCommandS still goes in the module dir. - -1998-12-02 Dan Espen <dane@mk.bellcore.com> - - * FvwmTaskBar/FvwmTaskBar.h: Update prototype for ParseConfig. - - * FvwmTaskBar/FvwmTaskBar.1: Update config file reading note, bugs - info, and remove references to fvwm95. - - * FvwmTaskBar/FvwmTaskBar.c: Use GetConfigLine to read the config. - -1998-11-24 Paul D. Smith <psmith@gnu.org> - - * FvwmScript/types.h: Remove headers that are duplicated (and - better tested for by autoconf) in the config.h file. - - * FvwmConsole/FvwmConsole.h: Move sys/types.h include nearer the - top, before sys/select.h. - -1998-11-20 Dominik Vogt <dominik_vogt@hp.com> - - * FvwmGoodStuff/FvwmGoodStuff.c (CreateWindow): border size bugfix - -Tue Nov 10 10:23:11 1998 Steve Robbins <steve@nyongwa.montreal.qc.ca> - - * FvwmScript: Added the yacc & lex output (scanner.c, script.c and - script.h) to the CVS tree, so you can build without having these - tools. Removed the old version of the yacc/lex input (the - Compilers subdirectory). - -Tue Nov 10 10:05:05 1998 Steve Robbins <steve@nyongwa.montreal.qc.ca> - - * FvwmScript/Makefile.am (EXTRA_DIST): Added script.h. - -Tue Nov 10 08:44:34 1998 Steve Robbins <steve@nyongwa.montreal.qc.ca> - - * FvwmScript: Copied the yacc & lex source files from the Compiler - subdirectory, and changed the makefile to build the .c and .h - files from scanner.l and script.y. - -Mon Nov 9 18:56:50 1998 Steve Robbins <steve@nyongwa.montreal.qc.ca> - - * Makefile.am (SUBDIRS): Removed fvwmperl, since this version is - known to be obsolete. Removed fvwmpython on suspicion of being - obsolete. - -1998-11-06 Paul D. Smith <psmith@gnu.org> - - * FvwmWharf/Makefile.am (FvwmWharf_DEPENDENCIES): - * FvwmTaskBar/Makefile.am (FvwmTaskBar_DEPENDENCIES): - * FvwmScript/Makefile.am (FvwmScript_DEPENDENCIES): - * FvwmPipe/Makefile.am (FvwmPipe_DEPENDENCIES): - * FvwmGoodStuff/Makefile.am (FvwmGoodStuff_DEPENDENCIES): - * FvwmCommand/Makefile.am (FvwmCommand_DEPENDENCIES,FvwmCommandS_DEPENDENCIES): - * FvwmConfig/Makefile.am (FvwmConfig_DEPENDENCIES): - * FvwmConsole/Makefile.am (FvwmConsole_DEPENDENCIES,FvwmConsoleC_DEPENDENCIES): - * FvwmDebug/Makefile.am (FvwmDebug_DEPENDENCIES): - Added a dependency on libfvwm.a. - - * FvwmConsole/FvwmConsole.h: Remove reference to internal Linux - include files. - -1998-11-05 Paul D. Smith <psmith@gnu.org> - - * FvwmScript/FvwmScript.c: Change DEBUG surrounding bounds checker - code to MEMDEBUG, so you don't need the special library to enable - debugging. - - * FvwmCommand/FvwmCommand.h: Remove reference to internal Linux - include files. - * FvwmCommand/FvwmCommand.c: Include getopt.h. - - * FvwmScript/Instructions.c (RemainderOfDiv): If the host doesn't - have div(), just return an error message. - -1998-11-05 Steven Michael ROBBINS <stever@jeff.cs.mcgill.ca> - - * FvwmWharf/Wharf.h: Made icon_info.depth a signed char, because - it is sometimes compared with -1. - - * FvwmDebug/FvwmDebug.h (setvbuf): Checks for HAVE_SETVBUF and - SETVBUF_REVERSED. - - * FvwmTaskBar/Makefile.am (INCLUDES): - * FvwmPipe/Makefile.am (INCLUDES): - * FvwmDebug/Makefile.am (INCLUDES): - * FvwmConsole/Makefile.am (INCLUDES): Added xpm_CFLAGS, since - xpm.h is included by fvwmlib.h. diff --git a/app/fvwm/extras/FvwmCommand/FvwmCommand.1 b/app/fvwm/extras/FvwmCommand/FvwmCommand.1 deleted file mode 100644 index 711682be5..000000000 --- a/app/fvwm/extras/FvwmCommand/FvwmCommand.1 +++ /dev/null @@ -1,322 +0,0 @@ -.\" t -.\" @(#)FvwmCommand.1 4/6/98 -.de EX \"Begin example -.ne 5 -.if n .sp 1 -.if t .sp .5 -.nf -.in +.25i -.. -.de EE -.fi -.in -.25i -.if n .sp 1 -.if t .sp .5 -.. -.ta .2i .4i .6i .8i -.TH FvwmCommand 1x "May 11 1998" -.UC -.SH NAME -FvwmCommand \- FVWM2 command external interface - -.SH SYNOPSIS -FvwmCommand [-mrvw] [-S name] [-i level] [-f name] [-F level] [command...] - -.SH DESCRIPTION - -FvwmCommand lets you monitor fvwm2 transaction and issue fvwm2 command -from a shell command line or scripts. -FvwmCommand takes each argument as a fvwm2 command. Quotes can be -used to send commands including spaces. -.EX -FvwmCommand 'FvwmPager 0 1' -.EE -.br -.SH INVOCATION -FvwmCommandS should be spawned once by fvwm2, either in .fvwm2rc file, -from menu, or from FvwmConsole. -From then on, FvwmCommand -can be called from a shell or script to execute fvwm2 commands. - -From within .fvwm2rc file: -.EX -Module FvwmCommandS - - or - -AddToFunc "InitFunction" "I" Module FvwmBanner -+ "I" Module FvwmPager 0 8 -+ "I" Module FvwmCommandS - -AddToFunc "RestartFunction" "I" Module FvwmCommandS -+ "I" Module FvwmPager 0 8 -.EE - -Then, in script file or from shell: - -.EX -FvwmCommand 'popup "Utilities"' -.EE - -.SH OPTIONS -.IP "\fI-F <level>\fR" 0.4i -Specifies the level of fvwm2 window flags FvwmCommand outputs. -.sp -.RS -.IP 0 0.4i -No window flags will be printed. -.RE -.RS -.IP 2 0.4i -Full window flags will be printed if information level, -i -option, is 2 or 3. -.sp -.RE - -.IP "\fI-f <name>\fR" 0.4i -Specifies an alternative FIFO set to communicate with a server. -The default FIFO set is ~/.FvwmCommand, in which -~/.FvwmCommandC is used to send commands and ~/.FvwmCommandM is to receive -messages. -FvwmCommandS must have been invoked with the same <name> as its first argument -prior to FvwmCommand invocation. -Alternatively, option -S can be used. Refer option -S. -This option -f is useful when a dedicated connection is necessary -to run a background job while another connection is kept for -interactive use. - -.IP "\fI-i <level>\fR" -Specifies the level of information that FvwmCommand outputs. -.sp -.RS -.IP 0 0.4i -Error messages only. -.EX -FvwmCommand -i0 FvwmBanner -.EE -will show a banner without any output. On the other hand, -.EX -FvwmCommand -i 0 foobar -.EE -will return, -.EX -[FVWM][executeModule]: <<ERROR>> No such module -\'foobar\' in ModulePath '/usr/lib/X11/fvwm2' -.EE - -Note that Fvwm2 doesn't return any error messages in -cases like below since 'windowid' itself is a valid command. -.sp -.EX -FvwmCommand -i 0 'windowid foo bar' -.EE -.IP 1 -Errors and window configuration information. This is the default. -.EX -FvwmCommand send_windowlist -.EE -Information like below will show up. -.EX - -0x02000014 window FvwmConsole -0x02000014 icon FvwmConsole -0x02000014 class XTerm -0x02000014 resource FvwmConsole -0x01c00014 window console -0x01c00014 icon console -0x01c00014 class XTerm -0x01c00014 resource console -0x01000003 window Fvwm Pager -0x01000003 icon -0x01000003 class FvwmModule -0x01000003 resource FvwmPager -0x00c0002c window emacs: FvwmCommand.man -0x00c0002c icon FvwmCommand.man -0x00c0002c icon file xemacs.xpm -0x00c0002c class Emacs -0x00c0002c resource emacs -end windowlist -.EE -The first column shows the window ID number, which can be used in 'windowid' command. -The second column shows the information types. -The last column shows the information contents. -If no information is returned, add -w <time> or -r option. -This might be needed in heavily loaded systems. -.IP 2 -Above and static window information. -.EX -FvwmCommand -i2 'FvwmPager 0 1' -.EE -The below is its output. -.EX - -0x03c00003 frame x 962, y 743, width 187, height 114 -0x03c00003 desktop 0 -0x03c00003 StartIconic no -0x03c00003 OnTop yes -0x03c00003 Sticky yes -0x03c00003 WindowListSkip yes -0x03c00003 SuppressIcon no -0x03c00003 NoiconTitle no -0x03c00003 Lenience no -0x03c00003 StickyIcon no -0x03c00003 CirculateSkipIcon no -0x03c00003 CirculateSkip no -0x03c00003 ClickToFocus no -0x03c00003 SloppyFocus no -0x03c00003 SkipMapping no -0x03c00003 Handles no -0x03c00003 Title no -0x03c00003 Mapped no -0x03c00003 Iconified no -0x03c00003 Transient no -0x03c00003 Raised no -0x03c00003 Visible no -0x03c00003 IconOurs no -0x03c00003 PixmapOurs no -0x03c00003 ShapedIcon no -0x03c00003 Maximized no -0x03c00003 WmTakeFocus no -0x03c00003 WmDeleteWindow yes -0x03c00003 IconMoved no -0x03c00003 IconUnmapped no -0x03c00003 MapPending no -0x03c00003 HintOverride yes -0x03c00003 MWMButtons no -0x03c00003 MWMBorders no -0x03c00003 title height 0 -0x03c00003 border width 4 -0x03c00003 base size width 8, height 7 -0x03c00003 size increment width 9, height 9 -0x03c00003 min size width 8, height 7 -0x03c00003 max size width 32767, height 32767 -0x03c00003 gravity SouthEast -0x03c00003 pixel text 0xffffff, back 0x7f7f7f -0x03c00003 window Fvwm Pager -0x03c00003 icon Fvwm Pager -0x03c00003 class FvwmModule -0x03c00003 resource FvwmPager -.EE -.IP 3 -All information available. -.EX -FvwmCommand -i3 'Killmodule Fvwm*' -.EE -This will report which windows are closed. -.EX -0x03400003 destroy -0x02400002 destroy -.EE -.RE - -.IP "\fI-m\fR" -Monitors fvwm2 window information transaction. FvwmCommand continuously outputs -information that it receives without exiting. -This option can be used in a -background job often combined with -i3 option in order to control windows -dynamically. -.EX -FvwmCommand -mi3 | grep 'iconify' -.EE -It will report when windows are iconified or deiconified. -.sp -Note: FvwmCommand does not block buffer its output but many utilities such as -grep or sed use block buffer. The output of the next example will not show up -until either FvwmCommand is terminated or stdout buffer from -grep is filled. -.EX -FvwmCommand -mi3 | grep ' map' | -sed 's/\(0x[0-9a-f]*\).*/windowid \1 move 0 0/' -.EE -Instead, use tools with buffer control such as pty or perl. -The below will iconify new windows when opened. -.EX -Fvwm -mi3 | perl -ne ' -$|=1; -print "windowid $1 iconify\\n" if /^(0x\\S+) add/; -\' > ~/\.FvwmCommandC -.EE -.IP "\fI-r\fR" -Waits for a reply before it exits. -FvwmCommand exits if no information or error is returned in a fixed amount of -time period. (Refer option -w.) -The option -r overrides this time limit and wait for at least one message -back. -After the initial message, it will wait for another message for the time -limit. -This option is useful when the system is too loaded to make any predition -when the system is responding AND the command causes some -message to be sent back. - -.IP "\fI-S <name>\fR" 0.4i -Invokes another server, FvwmCommandS, with FIFO set <name>. -.br -If -f option is not used with this option, -the invoking FvwmCommand uses the default FIFO to communicate -the default server to invoke a new server. -.br -If -f option is used with this option, -the invoking FvwmCommand uses the default FIFO to communicate -the default server to invoke a new server. Then, switch the FIFO -set and start communicating the new server. -.br -This option -S is useful when a dedicated connection is necessary -to run a background -job while another connection is kept for interactive use. - -If the <name> is a relative path name, that is relative from where -fvwm2 is running, not from where FvwmCommand is invoked. - -.IP "\fI-v\fR" -Returns FvwmCommand version number and exits. - -.IP "\fI-w <time>\fR" -Waits for <time> micro seconds for a message. -FvwmCommand exits if no information or error is returned in a fixed amount of -time period unless option -m is used. -The default is 500 ms. This option overrides this default value. - -.SH WRAPPER -.sp -.sp -FvwmCommand.sh has bourne shell function definitions -to keep the syntax similar to fvwm2 configuration file. -This file is to be sourced: -.EX -\&. FvwmCommand.sh -.br -DesktopSize 5x5 -.EE -.br -FvwmCommand.pm is for perl in order -to keep the syntax similar to fvwm2 configuration file. -Commas can be used to separate Fvwm2 commands' arguments. -.EX -use FvwmCommand; -if( $ARGV[0] eq 'home' ) { - Desk 0,0; GotoPage '1 1'; -}elsif( $ARGV[0] eq 'jump' ) { - Desk "0 2"; GotoPage 0, 1; -} -.EE -Although arguments in FvwmCommand are not case sensitive as fvwm2, -the functions defined in FvwmCommand.sh and FvwmCommand.pl are case sensitive. - - -.SH ERRORS -If the following error message show up, it is most likely that FvwmCommandS -is not running. -.EX -FvwmCommand error in opening message fifo ---No such file or directory-- -.EE -Fvwm2 modules don't return error messages to fvwm2 but output on -stderr. These error messages will not be shown as FvwmCommand messages. - -.SH SEE ALSO -fvwm2 - -.SH AUTHOR -Toshi Isogai isogai@ucsub.colorado.edu - - diff --git a/app/fvwm/extras/FvwmCommand/FvwmCommand.c b/app/fvwm/extras/FvwmCommand/FvwmCommand.c deleted file mode 100644 index b34262193..000000000 --- a/app/fvwm/extras/FvwmCommand/FvwmCommand.c +++ /dev/null @@ -1,757 +0,0 @@ -/* $Id: FvwmCommand.c,v 1.2 2012/03/04 12:07:01 fgsch Exp $ - * $Source: /cvs/OpenBSD/xenocara/app/fvwm/extras/FvwmCommand/Attic/FvwmCommand.c,v $ - * - * Fvwm2 command input interface. - * - * Copyright 1998, Toshi Isogai. - * Use this program at your own risk. - * Permission to use this program for any purpose is given, - * as long as the copyright is kept intact. - * - */ - -#include "FvwmCommand.h" - -#define MYNAME "FvwmCommand" - -int Fdr, Fdw; /* file discriptor for fifo */ -FILE *Frun; /* File contains pid */ -char *Fr_name; -int Pfd; -char *get_line(); -fd_set fdset; - -struct timeval Tv; -int Opt_reply; /* wait for replay */ -int Opt_monitor; -int Opt_info; -int Opt_Serv; -int Opt_flags; -FILE *Fp; -int Rc; /* return code */ -int Bg; /* FvwmCommand in background */ - -void err_msg( char *msg ); -void err_quit( char *msg ); -void sendit( char *cmd ); -void receive( void ); -void sig_ttin ( int ); -void sig_pipe ( int ); -void sig_quit ( int ); -void usage(void); -int read_f (int fd, char *p, int len); -void close_fifos (void); - -void process_message( void ) ; -void list( unsigned long *body, char *) ; -void list_configure(unsigned long *body); -void list_focus_change(unsigned long *body) ; -void list_header(unsigned long *body, char *) ; -void list_icon_loc(unsigned long *body) ; -void list_iconify(unsigned long *body); -void list_mini_icon(unsigned long *body) ; -void list_new_desk(unsigned long *body) ; -void list_new_page(unsigned long *body) ; -void list_string (char *str); -void spawn_child( void ); - - -/******************************************************* - * - * send command to and receive message from the server - * - *******************************************************/ -int main ( int argc, char *argv[]) { - char cmd[MAX_COMMAND_SIZE]; - char *home; - char *f_stem, *fc_name, *fm_name; - char *sf_stem; - int i; - int opt; - int ncnt; - int count; - struct timeval tv2; - extern char *optarg; - extern int optind, opterr, optopt; - - signal (SIGINT, sig_quit); - signal (SIGHUP, sig_quit); - signal (SIGQUIT, sig_quit); - signal (SIGTERM, sig_quit); - signal (SIGTTIN, sig_ttin); - signal (SIGTTOU, sig_ttin); - - Opt_reply = 0; - Opt_info = 1; - f_stem = NULL; - sf_stem = NULL; - Opt_monitor = 0; - Opt_Serv = 0; - Opt_flags = 2; - Tv.tv_sec = 0; - Tv.tv_usec = 500000; - Rc = 0; - Bg = 0; - - - while( (opt = getopt( argc, argv, "S:hvF:f:w:i:rm" )) != EOF ) { - switch(opt) { - case 'h': - usage(); - exit(0); - break; - case 'f': - f_stem = optarg; - break; - case 'F': - Opt_flags = atoi (optarg); - break; - case 'S': - sf_stem = optarg; - Opt_Serv = 1; - break; - case 'i': - Opt_info = atoi( optarg ); - break; - case 'v': - printf("%s %s\n", MYNAME, MYVERSION ); - exit(0); - case 'w': - Tv.tv_usec = atoi( optarg ) % 1000000; - Tv.tv_sec = atoi( optarg ) / 1000000; - break; - case 'm': - Opt_monitor = 1; - break; - case 'r': - Opt_reply = 1; - break; - case '?': - exit(3); - } - } - - - if( f_stem == NULL ) { - home = getenv("HOME"); - f_stem = safemalloc( strlen(home)+ strlen(F_NAME) + 3); - strcpy (f_stem, home); - if (f_stem[strlen(f_stem)-1] != '/') { - strcat (f_stem, "/"); - } - strcat (f_stem, F_NAME); - } - - /* create 2 fifos */ - fm_name = safemalloc( strlen(f_stem) + 2 ); - strcpy(fm_name,f_stem); - strcat(fm_name, "M"); - fc_name = safemalloc( strlen(f_stem) + 2 ); - strcpy(fc_name,f_stem); - strcat(fc_name, "C"); - Fr_name = safemalloc( strlen(f_stem) + 2 ); - strcpy(Fr_name,f_stem); - strcat(Fr_name, "R"); - - if ((Frun = fopen (Fr_name,"r" )) !=NULL) { - if (fgets (cmd, 20, Frun) != NULL) { - fprintf (stderr, "\nFvwmCommand lock file %sR is detected. " - "This may indicate another FvwmCommand is running. " - "It appears to be running under process ID:\n%s\n", - f_stem, cmd ); - fprintf (stderr, "You may either kill the process or run FvwmCommand " - "with another FIFO set using option -S and -f. " - "If the process doesn't exist, simply remove file:\n%sR\n\n", - f_stem); - exit(1); - } - fclose (Frun); - unlink (Fr_name); - } - - if( Opt_Serv ) { - sprintf (cmd,"%s '%sS %s'", argv[0], MYNAME, sf_stem); - system (cmd); - } - - if ((Frun = fopen (Fr_name,"w" )) != NULL) { - fprintf (Frun, "%d\n", (int) getpid()); - fclose (Frun); - }else { - err_quit ("writing lock file"); - } - - Fdr = Fdw = -1; - count = 0; - while ((Fdr=open (fm_name, O_RDONLY)) < 0) { - if (count++>5) { - err_quit ("opening message fifo"); - } - sleep(1); - } - count = 0; - while ((Fdw=open (fc_name, O_WRONLY)) < 0) { - if (count++>2) { - err_quit ("opening command fifo"); - } - sleep(1); - } - - strcpy (cmd, CMD_CONNECT); - sendit (cmd); - - i = optind; - if( Opt_monitor ) { - - /* test if its stdin is closed for coprocess */ - tv2.tv_sec = 0; - tv2.tv_usec = 5; - FD_ZERO(&fdset); - FD_SET(STDIN_FILENO, &fdset); - ncnt = select(FD_SETSIZE,SELECT_TYPE_ARG234 &fdset, 0, 0, &tv2); - if( ncnt && (fgets( cmd, 1, stdin )==0 || cmd[0] == 0)) { - Bg = 1; - } - - /* line buffer stdout for coprocess */ - setvbuf( stdout, NULL, _IOLBF, 0); - - /* send arguments first */ - for( ;i < argc; i++ ) { - strncpy( cmd, argv[i], MAX_COMMAND_SIZE-2 ); - sendit( cmd ); - } - - - while(1) { - FD_ZERO(&fdset); - FD_SET(Fdr, &fdset); - if( Bg == 0 ) { - FD_SET(STDIN_FILENO, &fdset); - } - ncnt = select(FD_SETSIZE,SELECT_TYPE_ARG234 &fdset, 0, 0, NULL); - - /* message from fvwm */ - if (FD_ISSET(Fdr, &fdset)){ - process_message(); - } - - if( Bg == 0 ) { - /* command input */ - if( FD_ISSET(STDIN_FILENO, &fdset) ) { - if( fgets( cmd, MAX_COMMAND_SIZE-2, stdin ) == 0 ) { - if( Bg == 0 ) { - /* other than SIGTTIN */ - break; - }else{ - continue; - } - } - sendit( cmd ); - } - } - } - }else { - for( ;i < argc; i++ ) { - strncpy( cmd, argv[i], MAX_COMMAND_SIZE-2 ); - sendit( cmd ); - receive(); - } - } - close_fifos(); - exit( Rc ); -} - -/* - * send exit notice and close fifos - */ -void close_fifos (void) { - char cmd[10]; - - if (Fdw >= 0) { - strcpy (cmd, CMD_EXIT); - sendit (cmd); - } - close(Fdr); - close(Fdw); - unlink (Fr_name); -} - -/****************************************** - * signal handlers - ******************************************/ -void sig_quit (int dummy) { - close_fifos(); - err_msg("receiving signal\n" ); - exit(1); -} - -void sig_ttin( int dummy ) { - Bg = 1; - signal( SIGTTIN, SIG_IGN ); -} - -/************************************/ -/* print error message on stderr */ -/************************************/ -void err_quit( char *msg ) { - fprintf (stderr, "%s ", strerror(errno)); - err_msg(msg); - close_fifos(); - exit(1); -} - -void err_msg( char *msg ) { - fprintf( stderr, "%s error in %s\n", MYNAME , msg ); -} - -/*************************************/ -/* add cr to the command and send it */ -/*************************************/ -void sendit( char *cmd ) { - int clen; - - if( cmd[0] != '\0' ) { - clen = strlen(cmd); - - /* add cr */ - if( cmd[clen-1] != '\n' ) { - strcat(cmd, "\n"); - clen++; - } - if( clen != 1 ) { - write( Fdw, cmd, clen ); - } - } -} - -void receive () { - int ncnt; - struct timeval tv; - - if( Opt_reply ) { - /* wait indefinitely */ - FD_ZERO(&fdset); - FD_SET( Fdr, &fdset); - ncnt = select(FD_SETSIZE, SELECT_TYPE_ARG234 &fdset, 0, 0, NULL); - } - - - while (1){ - tv.tv_sec = Tv.tv_sec; - tv.tv_usec = Tv.tv_usec; - FD_ZERO(&fdset); - FD_SET(Fdr, &fdset); - - ncnt = select(FD_SETSIZE, SELECT_TYPE_ARG234 &fdset, 0, 0, &tv); - - if( ncnt < 0 ) { - err_quit("receive"); - break; - } - if( ncnt == 0 ) { - /* timeout */ - break; - } - if (FD_ISSET(Fdr, &fdset)) { - process_message(); - } - } -} - - -/******************************* - * print usage - *******************************/ -void usage(void) { - fprintf (stderr, "Usage: %s [OPTION] [COMMAND]...\n", MYNAME); - fprintf (stderr, "Send commands to fvwm2 via %sS\n\n", MYNAME); - fprintf (stderr, - " -F <flag info> 0 - no flag info\n"); - fprintf (stderr, - " 2 - full flag info (default)\n"); - fprintf (stderr, - " -S <file name> " - "invoke another %s server with fifo <file name>\n", - MYNAME); - fprintf (stderr, - " -f <file name> use fifo <file name> to connect to %sS\n", - MYNAME); - fprintf (stderr, - " -i <info level> 0 - error only\n" ); - fprintf (stderr, - " 1 - above and config info (default)\n" ); - fprintf (stderr, - " 2 - above and static info\n" ); - fprintf (stderr, - " 3 - above and dynamic info\n" ); - fprintf (stderr, - " -m monitor fvwm2 message transaction\n"); - fprintf (stderr, - " -r " - "wait for a reply (overrides waiting time)\n"); - fprintf (stderr, - " -v print version number\n"); - fprintf (stderr, - " -w <micro sec> waiting time for the reponse from fvwm\n"); - fprintf (stderr, "\nDefault fifo names are ~/.%sC and ~/.%sM\n", - MYNAME, MYNAME); - fprintf (stderr, "Default waiting time is 500,000 us\n"); -} - -/* - * read fifo - */ -int read_f (int fd, char *p, int len) { - int i, n; - for (i=0; i<len; ) { - n = read (fd, &p[i], len-i); - if (n<0 && errno!=EAGAIN) { - err_quit("reading message"); - } - if (n==0) { - /* eof */ - close_fifos(); - exit( Rc ); - } - i += n; - } - return len; -} - -/* - * process message - */ -void process_message( void ) { - unsigned long type, length, body[24*SOL]; - - read_f( Fdr, (char*)&type, SOL); - read_f( Fdr, (char*)&length, SOL); - read_f( Fdr, (char*)body, length ); - - if( type==M_ERROR ) { - fprintf( stderr,"%s", (char *)&body[3] ); - Rc = 1; - }else if( Opt_info >= 1 ) { - - switch( type ) { - - case M_WINDOW_NAME: - list( body, "window"); - break; - case M_ICON_NAME: - list(body, "icon"); - break; - case M_RES_CLASS: - list(body, "class" ); - break; - case M_RES_NAME: - list(body, "resource"); - break; - - case M_END_WINDOWLIST: - list_string("end windowlist"); - break; - - case M_ICON_FILE: - list(body, "icon file"); - break; - case M_ICON_LOCATION: - list_icon_loc(body); - break; - - case M_END_CONFIG_INFO: - list_string("end configinfo"); - break; - - case M_DEFAULTICON: - list(body, "default icon"); - break; - - case M_MINI_ICON: - list_mini_icon( body ); - break; - - case M_CONFIG_INFO: - printf( "%s", (char *)&body[3] ); - break; - - default: - if( Opt_info >=2 ) { - - switch(type) { - - case M_CONFIGURE_WINDOW: - list_configure( body); - break; - case M_STRING: - list(body, "string"); - break; - - default: - if( Opt_info >= 3 ) { - switch( type ) { - case M_NEW_PAGE: - list_new_page(body); - break; - case M_NEW_DESK: - list_new_desk(body); - break; - case M_ADD_WINDOW: - list_header(body, "add"); - list_configure( body); - break; - case M_RAISE_WINDOW: - list_header(body, "raise"); - break; - case M_LOWER_WINDOW: - list_header(body, "lower"); - break; - case M_FOCUS_CHANGE: - list_focus_change( body ); - break; - case M_DESTROY_WINDOW: - list_header(body, "destroy"); - break; - case M_ICONIFY: - list_iconify( body ); - break; - case M_DEICONIFY: - list_header(body, "deiconify"); - break; - case M_MAP: - list_header(body, "map"); - break; - case M_WINDOWSHADE: - list_header(body, "windowshade"); - break; - case M_DEWINDOWSHADE: - list_header(body, "dewindowshade"); - break; - default: - printf("0x%lx type 0x%lx\n", body[0], type ); - } - } - } - } - } - } -} - - -/********************************** - * - * print configuration info - * - **********************************/ - -void list_configure(unsigned long *body) { - unsigned long i; - char *flag; - char *grav; - char *flagstr[32] = { - "StartIconic", - "OnTop", - "Sticky", - "WindowListSkip", - "SuppressIcon", - "NoiconTitle", - "Lenience", - "StickyIcon", - "CirculateSkipIcon", - "CirculateSkip", - "ClickToFocus", - "SloppyFocus", - "SkipMapping", - "Handles", - "Title", - "Mapped", - "Iconified", - "Transient", - "Raised", /* ??? */ - "Visible", - "IconOurs", - "PixmapOurs", - "ShapedIcon", - "Maximized", - "WmTakeFocus", - "WmDeleteWindow", - "IconMoved", - "IconUnmapped", - "MapPending", - "HintOverride", - "MWMButtons", - "MWMBorders" - }; - - - printf( "0x%08lx %-20s x %ld, y %ld, width %ld, height %ld\n", - body[0], "frame", body[3], body[4], body[5], body[6] ); - printf( "0x%08lx %-20s %ld\n" ,body[0], "desktop", body[7]); - - if (Opt_flags == 2) { - for( i=0; i<=31; i++ ) { - if( body[8] & (1<<i) ) { - flag = "yes"; - }else{ - flag = "no"; - } - printf( "0x%08lx %-20s %s\n", body[0], flagstr[i], flag ); - } - } - - printf( "0x%08lx %-20s %ld\n", - body[0], "title height", body[9]); - printf( "0x%08lx %-20s %ld\n", - body[0], "border width", body[10]); - printf( "0x%08lx %-20s width %ld, height %ld\n", - body[0], "base size", body[11], body[12]); - printf( "0x%08lx %-20s width %ld, height %ld\n", - body[0], "size increment", body[13], body[14]); - printf( "0x%08lx %-20s width %ld, height %ld\n", - body[0], "min size", body[15], body[16]); - printf( "0x%08lx %-20s width %ld, height %ld\n", - body[0], "max size", body[17], body[18]); - - - switch(body[21]) { - case ForgetGravity: - grav = "Forget"; - break; - case NorthWestGravity: - grav = "NorthWest"; - break; - case NorthGravity: - grav = "North"; - break; - case NorthEastGravity: - grav = "NorthEast"; - break; - case WestGravity: - grav = "West"; - break; - case CenterGravity: - grav = "Center"; - break; - case EastGravity: - grav = "East"; - break; - case SouthWestGravity: - grav = "SouthWest"; - break; - case SouthGravity: - grav = "South"; - break; - case SouthEastGravity: - grav = "SouthEast"; - break; - case StaticGravity: - grav = "Static"; - break; - default: - grav = "Unknown"; - break; - } - printf( "0x%08lx %-20s %s\n", body[0], "gravity", grav); - - printf( "0x%08lx %-20s text 0x%lx, back 0x%lx\n", - body[0], "pixel", body[22], body[23]); -} - -/************************************************************************* - * - * print info icon location - * - ************************************************************************/ -void list_icon_loc(unsigned long *body) { - - printf( "0x%08lx %-20s x %ld, y %ld, width %ld, height%ld\n", - body[0], "icon location", body[3], body[4], body[5], body[6] ); -} - -/************************************************************************* - * - * print info mini icon - * - ************************************************************************/ -void list_mini_icon(unsigned long *body) { - - printf( "0x%08lx %-20s width %ld, height %ld, depth %ld\n", - body[0], "mini icon",body[5], body[6], body[7] ); -} - -/************************************************************************* - * - * print info message body[3] - * - ************************************************************************/ -void list( unsigned long *body, char *text ) { - - printf( "0x%08lx %-20s %s\n", body[0], text, (char *)&body[3] ); -} - - -/************************************************************************* - * - * print info new page - * - ************************************************************************/ -void list_new_page(unsigned long *body) { - - printf( " %-20s x %ld, y %ld, desk %ld, max x %ld, max y %ld\n", - "new page", - body[0], body[0], body[2], body[3], body[4]); -} - -/************************************************************************* - * - * print info new desk - * - ************************************************************************/ -void list_new_desk(unsigned long *body) { - - printf( " %-20s %ld\n", "new desk", body[0] ); -} - -/************************************************************************* - * - * print string - * - ************************************************************************/ -void list_string (char *str) { - printf( "%-20s\n", str ); -} - -/************************************************************************* - * - * print info header - * - ************************************************************************/ -void list_header(unsigned long *body, char *text) { - - printf("0x%08lx %s\n", body[0], text); - -} - -/************************************************************************* - * - * print info focus change - * - ************************************************************************/ -void list_focus_change(unsigned long *body) { - - printf( "0x%08lx %-20s highlight 0x%lx, foreground 0x%lx, background 0x%lx\n", - body[0], "focus change", body[3], body[4], body[5] ); -} - -/************************************************************************* - * - * print info iconify - * - ************************************************************************/ -void list_iconify(unsigned long *body) { - - printf( "0x%08lx %-20s x %ld, y %ld, width %ld, hight %ld\n", - body[0], "iconify", body[3], body[4], body[5], body[6] ); -} - diff --git a/app/fvwm/extras/FvwmCommand/FvwmCommand.h b/app/fvwm/extras/FvwmCommand/FvwmCommand.h deleted file mode 100644 index bdc167838..000000000 --- a/app/fvwm/extras/FvwmCommand/FvwmCommand.h +++ /dev/null @@ -1,46 +0,0 @@ -#include "config.h" -#include "fvwmlib.h" - -#if HAVE_SYS_SELECT_H -#include <sys/select.h> -#endif - -#include <unistd.h> -#include <stdlib.h> -#include <stdio.h> -#include <sys/stat.h> -#include <fcntl.h> -#include <sys/types.h> -#include <sys/time.h> -#include <sys/wait.h> - -#if HAVE_GETOPT_H -#include <getopt.h> -#endif - -#include <signal.h> -#include <errno.h> -#include <string.h> - -#include "../../fvwm/module.h" - -#ifndef HAVE_STRERROR -extern char *sys_errlist[]; -#define strerror(_e) (sys_errlist[_e]) -#endif - - -#define F_NAME ".FvwmCommand" - -#define MAX_COMMAND_SIZE 768 - -#define CMD_KILL_NOUNLINK "#@killme\n" -#define CMD_CONNECT "#@connect" -#define CMD_EXIT "#@exit\n" - -/* number of default arguments when invoked from fvwm2 */ -#define FARGS 6 - -#define SOL sizeof( unsigned long ) - -#define MYVERSION "1.5" diff --git a/app/fvwm/extras/FvwmCommand/FvwmCommandS.c b/app/fvwm/extras/FvwmCommand/FvwmCommandS.c deleted file mode 100644 index 5a34d2b66..000000000 --- a/app/fvwm/extras/FvwmCommand/FvwmCommandS.c +++ /dev/null @@ -1,406 +0,0 @@ -/* $Id: FvwmCommandS.c,v 1.1 2006/11/26 10:53:10 matthieu Exp $ - * $Source: /cvs/OpenBSD/xenocara/app/fvwm/extras/FvwmCommand/Attic/FvwmCommandS.c,v $ - * - * Fvwm command input interface. - * - * Copyright 1997, Toshi Isogai. No guarantees or warantees or anything - * are provided. Use this program at your own risk. Permission to use - * this program for any purpose is given, - * as long as the copyright is kept intact. - * - */ - -#include "FvwmCommand.h" - -#define MYNAME "FvwmCommandS" - -int Fd[2]; /* pipe to fvwm */ -int Ffdr; /* command fifo file discriptors */ -int Ffdw; /* message fifo file discriptors */ -char *F_name, *Fc_name, *Fm_name; /* fifo name */ -char Nounlink; /* don't delete fifo when true */ -char Connect; /* client is connected */ - -int open_fifos (char *f_stem); -void close_fifos(); -void close_pipes(); -void DeadPipe( int ); -void err_msg( char *msg ); -void err_quit( char *msg ); -void process_message(unsigned long type,unsigned long *body); -void relay_packet( unsigned long, unsigned long, unsigned long *); -void server( char * ); -void sig_handler( int ); -int write_f (int fd, char *p, int len); - -int main(int argc, char *argv[]) { - char *fifoname; - - if(argc < FARGS) { - fprintf(stderr,"%s Version %s should only be executed by fvwm!\n", - MYNAME, MYVERSION); - exit(1); - } - - if( argc == FARGS+1 ) { - fifoname = argv[FARGS]; - }else{ - fifoname = NULL; - } - - signal (SIGPIPE, DeadPipe); - signal (SIGINT, sig_handler); - signal (SIGQUIT, sig_handler); - signal (SIGHUP, sig_handler); - signal (SIGTERM, sig_handler); - - Fd[0] = atoi(argv[1]); - Fd[1] = atoi(argv[2]); - - Nounlink = 0; - - server( fifoname ); - exit(1); -} - -/* - * signal handler - */ -void DeadPipe( int dummy ) { - fprintf(stderr,"%s: dead pipe\n", MYNAME); - close_pipes(); - exit(0); - -} - -void sig_handler(int signo) { - close_pipes(); - exit(1); -} - -/* - * setup server and communicate with fvwm and the client - */ -void server ( char *name ) { - char *home; - char *f_stem; - int len; - fd_set fdset; - unsigned long *body; - unsigned long header[HEADER_SIZE]; - char buf[MAX_COMMAND_SIZE]; /* command receiving buffer */ - char cmd[MAX_COMMAND_SIZE]; - int ix,cix; - - if( name == NULL ) { - /* default name */ - home = getenv("HOME"); - f_stem = safemalloc( strlen(home)+ strlen(F_NAME) + 3); - strcpy (f_stem, home); - if (f_stem[strlen(f_stem)-1] != '/') { - strcat (f_stem, "/"); - } - strcat (f_stem, F_NAME); - }else{ - f_stem = name; - } - - if (open_fifos (f_stem) < 0) { - exit (-1); - } - SendText(Fd," ",0); /* tell fvwm that we are here */ - - cix = 0; - - while (1){ - FD_ZERO(&fdset); - FD_SET(Ffdr, &fdset); - FD_SET(Fd[1], &fdset); - - if (select(FD_SETSIZE, SELECT_TYPE_ARG234 &fdset, 0, 0, NULL) < 0) { - if (errno == EINTR) { - continue; - } - } - - if (FD_ISSET(Fd[1], &fdset)){ - if( ReadFvwmPacket(Fd[1],header,&body) > 0) { - if (Connect) { - process_message(header[1], body); - } - free(body); - } - } - - if (FD_ISSET(Ffdr, &fdset)){ - len = read( Ffdr, buf, MAX_COMMAND_SIZE-1 ); - if (len == 0) { - continue; - } - if (len < 0) { - if (errno != EAGAIN && errno != EINTR) { - err_quit("reading fifo"); - } - } - - Connect = 1; - /* in case of multiple long lines */ - for (ix=0; ix<len; ix++) { - cmd[cix] = buf[ix]; - if (cmd[cix] == '\n') { - cmd[cix+1] = '\0'; - cix = 0; - if (!strncmp (cmd, CMD_CONNECT, strlen(CMD_CONNECT))) { - /* do nothing */ - } else if (!strcmp (cmd, CMD_EXIT)) { - Connect = 0; - break; - } else { - if (!strcmp (cmd, CMD_KILL_NOUNLINK)) { - Nounlink = 1; - strcpy (cmd, "killme" ); - } - SendText (Fd,cmd,0); - } - }else{ - if (cix >= MAX_COMMAND_SIZE-1) { - err_msg ("command too long"); - cix = 0; - } else { - cix++; - } - } - } - } - } -} - -/* - * close fifos and pipes - */ -void close_pipes() { - close (Fd[0]); - close (Fd[1]); - close_fifos(); -} - -void close_fifos () { - close (Ffdw); - close (Ffdr); - if (!Nounlink) { - strcat (F_name,"C"); - unlink (F_name); - F_name[strlen(F_name)-1] = 'M'; - unlink (F_name); - F_name[strlen(F_name)-1] = 'R'; - unlink (F_name); - } - free (F_name); - Ffdr = -1; - Ffdw = -1; -} - -/* - * open fifos - */ -int open_fifos (char *f_stem) { - char *fc_name, *fm_name; - - /* create 2 fifos */ - fc_name = malloc( strlen(f_stem) + 2 ); - if (fc_name == NULL) { - err_msg( "allocating command" ); - return -1; - } - fm_name = malloc( strlen(f_stem) + 2 ); - if (fm_name == NULL) { - err_msg( "allocating message" ); - return -1; - } - strcpy(fc_name,f_stem); - strcpy(fm_name,f_stem); - strcat(fc_name, "C"); - strcat(fm_name, "M"); - - if( (Ffdw = open(fc_name, O_RDWR | O_NONBLOCK ) ) > 0) { - write_f( Ffdw, CMD_KILL_NOUNLINK, strlen(CMD_KILL_NOUNLINK) ); - close( Ffdw ); - } - - unlink( fm_name ); - unlink( fc_name ); - - if( mkfifo( fm_name, S_IRUSR | S_IWUSR ) < 0 ) { - err_msg( fm_name ); - return -1; - } - if( mkfifo( fc_name, S_IRUSR | S_IWUSR ) < 0 ) { - err_msg( fc_name ); - return -1; - } - - Ffdr = open(fc_name, O_RDWR | O_NONBLOCK | O_TRUNC); - if (Ffdr < 0) { - err_msg( "opening command fifo" ); - return -1; - } - free(fc_name); - Ffdw = open(fm_name, O_RDWR | O_NONBLOCK | O_TRUNC); - if (Ffdw < 0) { - err_msg( "opening message fifo" ); - return -1; - } - free(fm_name); - - F_name = malloc (strlen (f_stem) + 2); - if (F_name == NULL) { - err_msg( "allocating name string" ); - return -1; - } - strcpy (F_name, f_stem); - - return 0; -} - - -/* - * Process window list messages - */ - -void process_message(unsigned long type,unsigned long *body){ - int msglen; - - switch(type) { - - case M_CONFIGURE_WINDOW: - relay_packet( type, 24*SOL, body ); - break; - - case M_WINDOW_NAME: - case M_ICON_NAME: - case M_RES_CLASS: - case M_RES_NAME: - case M_ICON_FILE: - case M_DEFAULTICON: - msglen = strlen( (char *)&body[3] ); - relay_packet( type, msglen+1+3*SOL, body ); - break; - - case M_END_WINDOWLIST: - case M_END_CONFIG_INFO: - relay_packet( type, 0*SOL, body ); - break; - - case M_ICON_LOCATION: - relay_packet( type, 7*SOL, body ); - break; - - case M_ERROR: - case M_STRING: - case M_CONFIG_INFO: - msglen = strlen( (char *)&body[3] ); - relay_packet( type, msglen+1+3*SOL, body ); - break; - - - case M_MINI_ICON: - relay_packet( type, 6*SOL, body ); - break; - - - case M_NEW_PAGE: - relay_packet( type, 5*SOL, body ); - break; - - case M_NEW_DESK: - relay_packet( type, 1*SOL, body ); - break; - - case M_ADD_WINDOW: - relay_packet( type, 24*SOL, body ); - break; - - case M_RAISE_WINDOW: - case M_LOWER_WINDOW: - case M_FOCUS_CHANGE: - case M_DESTROY_WINDOW: - case M_DEICONIFY: - case M_MAP: - case M_WINDOWSHADE: - case M_DEWINDOWSHADE: - relay_packet( type, 4*SOL, body ); - break; - - case M_ICONIFY: - relay_packet( type, 7*SOL, body ); - - break; - - default: - relay_packet( type, 4*SOL, body ); - } -} - - - -/* - * print error message on stderr and exit - */ - -void err_msg( char *msg ) { - fprintf( stderr, "%s server error in %s, %s\n", - MYNAME, msg, strerror(errno) ); -} - -void err_quit( char *msg ) { - err_msg (msg); - close_pipes(); - exit(1); -} - -/* - * relay packet to front-end - */ -void relay_packet( unsigned long type, - unsigned long length, unsigned long *body) { - write_f( Ffdw, (char*)&type, SOL ); - write_f( Ffdw, (char*)&length, SOL ); - write_f( Ffdw, (char*)body, length ); -} - -/* - * write to fifo - */ -int write_f (int fd, char *p, int len) { - int i, n; - struct timeval tv; - int again; - static int giveup=0; - - again = 0; - tv.tv_sec = 0; - tv.tv_usec = 50000; - - for (i=0; i<len; ) { - n = write (fd, &p[i], len-i); - if (n<0) { - if( errno==EINTR) { - continue; - } else if (errno==EAGAIN ) { - if (again++ < 5) { - select(0, 0, 0, 0, &tv); - continue; - }else{ - if (giveup++ > 20) { - Connect = 0; - } - return -1; /* give up this message */ - } - } - err_quit ("writing fifo"); - } - i += n; - } - giveup = 0; - return 0; -} diff --git a/app/fvwm/extras/FvwmCommand/INSTALL b/app/fvwm/extras/FvwmCommand/INSTALL deleted file mode 100644 index 0a8597008..000000000 --- a/app/fvwm/extras/FvwmCommand/INSTALL +++ /dev/null @@ -1,19 +0,0 @@ -Installation - -0. Un-tar the tar file under fvwm2/extras directory. - -1. Edit Imake file to specify directory names to install - function collection files. - -2. Make Makefile by, - xmkmf - -3. Compile source files, - make - -4. To install binary files, - make install - -5. To install man page, - make install.man - diff --git a/app/fvwm/extras/FvwmCommand/README b/app/fvwm/extras/FvwmCommand/README deleted file mode 100644 index 5f14fd433..000000000 --- a/app/fvwm/extras/FvwmCommand/README +++ /dev/null @@ -1,65 +0,0 @@ -FvwmCommand is an interface to send commands to and receive -information from Fvwm2 from processes which are not Fvwm modules. - - -Examples - - test1.pl - takes 1 argument 't' to invoke FvwmTalk - 'td' to kill FvwmTalk - '' to move windows - test2.sh - takes 1 argument 'b' to invoke FvwmButtons - 'kb' to kill FvwmButtons - 'r' to change # of button rows - 'c' to change # of button columns - ex-auto.pl - auto raise small windows. It will keep them visible. - ex-cascade.pl - cascade windows, then move them back. - ex-grpmv.pl - choose a group of windows to move together. - - Above examples are not meant to be practical but to show how it can - be done. - - - - focus-link.pl - This is a user programmable window focus script. - Default behavior is: - 1. When a window is opened up, focus the window and move the pointer - to it. The parent window regains focus when a window is closed. - Parenthood is determined when a window is opened. It is the last - focused window with the same X class. - 2. #1 would not occur to AcroRead opening window. - 3. #1 would not occur when SkipMapping is set and the window is the - only window of its class. - 4. For Netscape find dialog window, addition to #1, resize the window - to 300x150 pixels and move it to East edge of the screen. - Download/upload windows will not be focused nor be in focus link - list. - 5. Move appletviewer to NorthWest corner. - 6. Xterm won't focus back to its parent after closed. - 7. When a window is de-iconified, focus it and move the pointer. - - focus-Netscape.pl - Focuses pop-up windows, such as 'open URL' or 'find' whenever - opened up. This let the user to type in immediately without - moving mouse. This script also moves 'download' window to the - right edge to keep it visible. If this is invoked from - .fvwm2rc, use as: - - AddToFunc "InitFunction" "I" Module FvwmCommandS - + "I" Exec $HOME/scripts/focus-Netscape.pl - - push-away.pl <direction> <window name> - Pushes windows away to avoid overlapping. use as: - - push-away.pl up 'Fvwm Pager' - - - -Your comments will be appreciated. - - -Toshi Isogai - isogai@ucsub.colorado.edu - - -May 11 '98 diff --git a/app/fvwm/extras/FvwmCommand/ex-auto.pl b/app/fvwm/extras/FvwmCommand/ex-auto.pl deleted file mode 100644 index 0be416bf4..000000000 --- a/app/fvwm/extras/FvwmCommand/ex-auto.pl +++ /dev/null @@ -1,51 +0,0 @@ -#!/usr/bin/perl -# FvwmCommand example - auto raise small windows -# arg1 - size ( w * h in pixel) (default 60000) -# arg2 - delay (second) (default 1) - -open( FCM, "FvwmCommand -m -i3 send_windowlist |" ) || die "FCM"; -open( FCC, ">$ENV{'HOME'}/.FvwmCommandC" ) || die "FCC"; - -select( FCC ); $| = 1; -select( STDOUT ); $| = 1; - - -$Size = shift; -if( $Size <= 0 ) { - $Size = 60000; -} - -if( $#ARGV >= 0) { - $Delay = shift; -}else{ - $Delay = 1; -} - - -LOOP1:while( <FCM> ) { - if( /^0x(\S+) frame .*width (\d+), height (\d+)/ ) { - $Config{$1}{'area'} = $2 * $3; - }elsif( /^0x(\S+) (focus change|end windowlist)/ ) { - - if( $1 != 0 ) { - # delay longer than FvwmAuto - select(undef,undef,undef,$Delay); - - foreach $w (keys %Config) { - if( $Config{$w}{'area'} < $Size ) { - print FCC "windowid 0x$w Raise\n"; - - # ignore - while(<FCM>) { - last if /^0x$w raise/; - redo LOOP1 if /^0x\S+ focus change/; - } - select(undef,undef,undef,0.1); - } - } - } - } -} - - - diff --git a/app/fvwm/extras/FvwmCommand/ex-cascade.pl b/app/fvwm/extras/FvwmCommand/ex-cascade.pl deleted file mode 100644 index ef854047a..000000000 --- a/app/fvwm/extras/FvwmCommand/ex-cascade.pl +++ /dev/null @@ -1,41 +0,0 @@ -#!/usr/bin/perl -# FvwmCommand example - cascade windows - -open( F, "FvwmCommand -ri2 send_windowlist |" ) || die "command" ; -while( <F> ) { - if( /^(0x[0-9a-f]+) frame *x (\d+), y (\d+), width (\d+), height (\d+)/ ) { - $config{$1}{'area'} = $4 * $5; - $config{$1}{'x'} = $2; - $config{$1}{'y'} = $3; - }elsif( /^(0x[0-9a-f]+) Sticky +(yes|no)$/ ) { - $config{$1}{'sticky'} = $2; - }elsif( /^(0x[0-9a-f]+) desktop +(\d+)/ ) { - $config{$1}{'desktop'} = $2; - } -} -close F; - - -$x = $y = 0; - -$delay = 3000; #need bigger number for slower machine - -foreach $i (keys %config) { - next if( $config{$i}{'sticky'} =~ /yes/ ) ; - system("FvwmCommand -w $delay 'windowid $i windowsdesk 0' " ); - system("FvwmCommand -w 0 'windowid $i move ${x}p ${y}p' " ); - system("FvwmCommand -w 0 'windowid $i raise' " ); - $x += 50; - $y += 50; -} - -print( 'hit return to move them back!' ); -<>; -foreach $i (keys %config) { - next if( $config{$i}{'sticky'} =~ /yes/ ) ; - system("FvwmCommand -w 0 'windowid $i windowsdesk $config{$i}{desktop}'>/dev/null"); - system("FvwmCommand -w $delay 'gotopage 0 0' 'windowid $i move $config{$i}{x}p $config{$i}{y}p' >/dev/null" ); -} - - - diff --git a/app/fvwm/extras/FvwmCommand/ex-grpmv.pl b/app/fvwm/extras/FvwmCommand/ex-grpmv.pl deleted file mode 100644 index 23c57d04d..000000000 --- a/app/fvwm/extras/FvwmCommand/ex-grpmv.pl +++ /dev/null @@ -1,90 +0,0 @@ -#!/usr/bin/perl -# FvwmCommand example - move a group of windows - - -ask(); - - -open( FCM, "FvwmCommand -m -i3 |" ) || die "$! FvwmCommand"; -open( FCC, ">$ENV{'HOME'}/.FvwmCommandC" ) || die "FCC"; -select( FCC ); $| = 1; -select( STDOUT ); $| = 1; - -while( <FCM> ) { - if( /^0x(\S+) frame +x (\d+), y (\d+)/ ) { - # check if a member window is moved - ($id,$x,$y) = ($1,$2,$3); - - if( defined $Config{$id} ) { - foreach $w (keys %Config) { - $newx = $x + $Config{$w}{'x'}-$Config{$id}{'x'}; - $newy = $y + $Config{$w}{'y'}-$Config{$id}{'y'}; - if( $newx < 0 ) { - $newx = 0; - } - if( $newy < 0 ) { - $newy = 0; - } - print FCC "windowid 0x$w move ${newx}p ${newy}p\n"; - - # ignore - pixel info is the last info for move - while(<FCM>) { - last if /^0x$w pixel/; - } - select(undef,undef,undef,0.1); - } - } - } -} - - - -sub ask { - my($k,$c,$w, $mark); - - # list up windows - open( FCM, "FvwmCommand -i2 send_windowlist |" ) || die "$! FvwmCommand"; - while( <FCM> ) { - if( /^0x(\S+) (id|window) +(.*)/ ) { - $Config{$1}{$2} = $3; - }elsif( /^0x(\S+) frame +x (\d+), y (\d+)/ ) { - $Config{$1}{'x'} = $2; - $Config{$1}{'y'} = $3; - } - } - close( FCM ); - - $k = 'a'; - foreach $w (keys %Config) { - $win{$k++} = $w; - $Config{$w}{'grp'} = 0; - } - while(1) { - print "\nWhich windwow to group (* for all, ENTER to Start)?\n"; - foreach $k (keys %win) { - $mark = $Config{$win{$k}}{'grp'} ? 'X':' '; - print "($k) ($mark) $Config{$win{$k}}{'window'}\n"; - } - - system "stty -icanon min 1 time 0"; - $c = getc(); - system "stty icanon"; - - if( $c eq '*' ) { - foreach(keys %win) { - $Config{$_}{'grp'} = 1; - } - }elsif( $c eq "\n" ) { - last; - }elsif( !grep( /$c/,keys %win) ) { - print "\aUndefine process\n"; - }else{ - $Config{$win{$c}}{'grp'} = ! $Config{$win{$c}}{'grp'}; - } - } - - print "Group move on effect\n"; - foreach $w (keys %Config) { - delete $Config{$w} if $Config{$w}{'grp'}!=1; - } -} diff --git a/app/fvwm/extras/FvwmCommand/findcmd b/app/fvwm/extras/FvwmCommand/findcmd deleted file mode 100644 index 018598e59..000000000 --- a/app/fvwm/extras/FvwmCommand/findcmd +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh -# Find fvwm commands from function.c struct functions -# Written by Toshi Isogai - -ff="FvwmCommand.sh"; -fc="../../fvwm/functions.c"; - - -echo "# $ff" > $ff; -echo "# Collection of fvwm2 builtin commands for FvwmCommand" >> $ff -echo "" >> $ff; - -echo "alias FvwmCommand='$1/FvwmCommand'" >> $ff; -echo 'AM () { ' >> $ff -echo 'FvwmCommand "+ $*"' >> $ff -echo '}' >> $ff; - - -awk 'OFS=""; - /struct function/,/""/ { - - if( $0 ~ /\{ *"[a-zA-Z_]/ ) { - sub(/^ *\{ *"/,"",$0); - sub(/".*/,"",$0); - print $0," () {" - print "FvwmCommand \"",$0," $*\"" - print "}" ; - } -}' $fc >> $ff; - - - diff --git a/app/fvwm/extras/FvwmCommand/findcmd.pl b/app/fvwm/extras/FvwmCommand/findcmd.pl deleted file mode 100644 index 3d5ef9cca..000000000 --- a/app/fvwm/extras/FvwmCommand/findcmd.pl +++ /dev/null @@ -1,61 +0,0 @@ -#!/usr/bin/perl -# Find fvwm commands from function.c struct functions -# Written by Toshi Isogai - -sub getcmd { - $/ = "\n\n"; - while(<FF>) { - #find "struct functions func_config[] =" in various spacing - if (s/struct\s+functions.*\[\]\s+=(\s|\n)+\{// ) { - return listcmd(); - } - } - print stderr "Can't find struct functions\n"; - exit 1; -} - -sub listcmd { -my($cmd,@cmd); - while( /"(.*)"/g ) { - $cmd = $1; - next if $cmd =~ /^\+?$/; - push @cmd, $cmd; - } -@cmd; -} - -sub create_pm { - my(@cmd,$i,@ln); - my( $fvwmdir ) = $ARGV[0]; - my( $fc); - my( $pm ) = "FvwmCommand.pm"; - - $fc = "../../fvwm/functions.c"; - - open(FF, $fc) || die "$fc $!"; - @cmd = getcmd(); - close(FF); - open(FPL,">$pm") || die "$pm: $!"; - - print FPL "# $pm\n"; - print FPL "# Collection of fvwm2 builtin commands for FvwmCommand\n"; - print FPL "package FvwmCommand;\nuse Exporter;\n"; - print FPL "\@ISA=qw(Exporter);\n\@EXPORT=qw("; - for( $i=0; $i<=$#cmd; $i++) { - if( $i % 5 == 0 ) { - print FPL "\n $cmd[$i]"; - }else{ - print FPL " $cmd[$i]"; - } - } - print FPL "\n);\n"; - print FPL "\nsub FvwmCommand { system \"$fvwmdir/FvwmCommand '\@_'\"}\n\n"; - foreach $i (@cmd) { - print FPL "sub $i { FvwmCommand \"$i \@_ \" }\n"; - } - print FPL "sub AM { FvwmCommand \"+ \@_ \" }\n"; - print FPL "1;\n"; - print "$pm created\n"; -} - -create_pm(); diff --git a/app/fvwm/extras/FvwmCommand/focus-Netscape.pl b/app/fvwm/extras/FvwmCommand/focus-Netscape.pl deleted file mode 100644 index b31ab3d22..000000000 --- a/app/fvwm/extras/FvwmCommand/focus-Netscape.pl +++ /dev/null @@ -1,89 +0,0 @@ -#!/usr/bin/perl -# FvwmCommand script -# Written by Toshi Isogai -# -# 1. auto focus Netscape dialog when opened -# 2. move download/upload window to right edge of the screen - -# screen width -if( `xwininfo -root` =~ /Width: (\d+)/ ) { - $SW = $1; -}else{ - # some resonable number if xwininfo doesn't work - $SW = 1024; -} - -# start a dedicated server -$fifo = "$ENV{'HOME'}/.FCMfocus"; -system( "FvwmCommand 'FvwmCommandS $fifo'"); -#for slow machine -select(undef,undef,undef,1); - -# we need this to run this script in background job -$SIG{'TTIN'} = "IGNORE"; - -# start monitoring (-m option ) all fvwm transaction (-i3 option ) -open( FCM, "FvwmCommand -f $fifo -m -i3 |" ) || die "FCM $fifo"; - -# send command through the new fifo which is "$fifo" + "C" -open( FCC, ">${fifo}C" ) || die "FCC $fifo" ; - -# appearantly, it has be unbuffered -select( FCC ); $| = 1; -select( STDOUT ); $| = 1; - - -LOOP1: while( <FCM> ) { - if( /^(0x[\da-f]+) add/ ) { - $id = $1; - - while( <FCM> ) { - - # keep window frame - if( /^$id frame\s+x -?\d+, y (-?\d+), width (\d+)/ ) { - $y = $1; - $width = $2; - - # search for class line - }elsif( /^$id class/ ) { - - if( !/\sNetscape/ ) { - # not Netscape - last; - } - - # the next line should be resource line - $_ = <FCM>; - - # resource line tells what the window is - if( /^$id resource/ ) { - - # search for Netscape popups - if( /\s+\w+popup/ ) { - - # fvwm doesn't like commands from modules too fast - select(undef,undef,undef, 0.4 ); - - # focus it - print FCC "windowid $id focus\n"; - - } - # search for Netscape download or upload window - elsif( /\s+(Down|Up)load/ ) { - select(undef,undef,undef, 0.4 ); - - # move to the right edge, keep the whole window in screen - $x = $SW - $width; - print FCC "windowid $id move ${x}p ${y}p\n"; - } - last; - } - } - } - } -} -print "end\n"; - - - - diff --git a/app/fvwm/extras/FvwmCommand/push-away.pl b/app/fvwm/extras/FvwmCommand/push-away.pl deleted file mode 100644 index 697681f58..000000000 --- a/app/fvwm/extras/FvwmCommand/push-away.pl +++ /dev/null @@ -1,188 +0,0 @@ -#!/usr/bin/perl -# FvwmCommand script -# Written by Toshi Isogai -# -# push-away -# push other windows back when they overlap -# usage: push-away <direction> <window name> -# direction - direction (down,up,left,right) to push away -# window name - windows to be protected, name can be regular expression -# icons are ignored - - -$Dir = shift; -$Wn = shift; - -if( $Dir =~ /down/i ) { - $Dir = 1; -}elsif( $Dir =~ /up/i ) { - $Dir = 2; -}elsif( $Dir =~ /left/i ) { - $Dir = 3; -}elsif( $Dir =~ /right/i ) { - $Dir = 4; -} - -if( $Dir == 0 || $Wn eq '' ) { - print STDERR "push other windows back when they overlap\n"; - print STDERR "usage: push-away <direction> <window name>\n"; - print STDERR " direction - direction (down,up,left,right) to push away\n"; - print STDERR " window name - windows to be protected\n"; - print STDERR " name can be regular expression\n"; - exit(1); -} - - -# start a dedicated server -$fifo = "$ENV{'HOME'}/.FCMpb"; -system( "FvwmCommand 'FvwmCommandS $fifo'"); - -# larger number for slow machine -select(undef,undef,undef,0.5); - -# we need this to run this script in background job -$SIG{'TTIN'} = "IGNORE"; - -# start monitoring (-m option ) all fvwm transaction (-i3 option ) -open( FCM, "FvwmCommand -f $fifo -m -i3 |" ) || die "FCM $fifo"; - -# send command through the new fifo which is "$fifo" + "C" -open( FCC, ">${fifo}C" ) || die "FCC $fifo" ; - -# non blocking outputs -select( FCC ); $| = 1; -select( STDOUT ); $| = 1; - - -# some delay for slow one -select(undef,undef,undef,0.1); -print FCC "send_windowlist\n"; -# yet some more delay for slow one -select(undef,undef,undef,0.1); - -$endlist = 0; -while( <FCM> ) { - - if( /^(0x\S+) frame\s+x (-?\d+), y (-?\d+), width (\d+), height (\d+)/ ) { - $id = $1; - $Config{$id}{'x'} = $2; - $Config{$id}{'y'} = $3; - $Config{$id}{'w'} = $4; - $Config{$id}{'h'} = $5; - - next if ! $endlist ; - - # move other windows if necessary - if( $Config{$id}{'protect'} ) { - foreach $w (keys %Config) { - if( $id ne $w ) { - move_if_overlap( $w, $id ); - } - } - }else{ - foreach $w (keys %Config) { - if( $Config{$w}{'protect'} ) { - move_if_overlap( $id, $w ); - } - } - } - - }elsif( /^(0x\S+) desktop +(-?\d+)/ ) { - $Config{$1}{'desk'} = $2; - - }elsif( /^(0x\S+) Iconified +(yes|no)/ ) { - $Config{$1}{'Iconified'} = $2; - - }elsif( /^(0x\S+) window +(.*)/ ) { - $id = $1; - $window = $2; - - if( $window =~ /$Wn/ ) { - $Config{$id}{'protect'} = 1; - } - - }elsif( /end windowlist/ ) { - $endlist = 1; - foreach $id (keys %Config) { - if( $Config{$id}{'protect'} ) { - foreach $w (keys %Config) { - if( $id ne $w ) { - move_if_overlap( $w, $id ); - } - } - } - } - - }elsif( /^(0x\S+) destroy/ ) { - delete $Config{$1}; - - } -} - - -sub move_if_overlap { - my($id1, $id2) = @_; - my($ov); - my($c1xl,$c1xh,$c1yl,$c1yh); - my($c2xl,$c2xh,$c2yl,$c2yh); - - - - if( $Config{$id1}{'desk'} != $Config{$id2}{'desk'} - || $Config{$id1}{'Iconified'} eq 'yes' - || $Config{$id2}{'Iconified'} eq 'yes' ) { - return; - } - - - $ov = 0; - - $c1xl = $Config{$id1}{'x'}; - $c1yl = $Config{$id1}{'y'}; - $c1xh = $Config{$id1}{'x'}+$Config{$id1}{'w'}; - $c1yh = $Config{$id1}{'y'}+$Config{$id1}{'h'}; - - $c2xl = $Config{$id2}{'x'}; - $c2yl = $Config{$id2}{'y'}; - $c2xh = $Config{$id2}{'x'}+$Config{$id2}{'w'}; - $c2yh = $Config{$id2}{'y'}+$Config{$id2}{'h'}; - - - if( $c2xl >= $c1xl && $c2xl <= $c1xh - || $c2xh >= $c1xl && $c2xh <= $c1xh ) { - if($c2yl >= $c1yl && $c2yl <= $c1yh - || $c2yh >= $c1yl && $c2yh <= $c1yh ) { - $ov = 1; - } - }elsif( $c1xl >= $c2xl && $c1xl <= $c2xh - || $c1xh >= $c2xl && $c1xh <= $c2xh ) { - if($c1yl >= $c2yl && $c1yl <= $c2yh - || $c1yh >= $c2yl && $c1yh <= $c2yh ) { - $ov = 1; - } - } - - if( $ov ) { - $x = $c1xl; - $y = $c1yl; - if( $Dir==1 ) { - $y = $c2yh+1; - }elsif( $Dir==2 ) { - $y = $c2yl-($c1yh-$c1yl)-1; - }elsif( $Dir==3 ) { - $x = $c2xl-($c1xh-$c1xl)-1; - }elsif( $Dir==4 ) { - $x = $c2xh+1; - } - - - print FCC "windowid $id1 move ${x}p ${y}p\n"; - - # ignore - pixel info is the last info for move - while(<FCM>) { - last if /^0x\S+ pixel/; - } - - select(undef,undef,undef,0.1); - } -} diff --git a/app/fvwm/extras/FvwmCommand/test1.pl b/app/fvwm/extras/FvwmCommand/test1.pl deleted file mode 100644 index d42ff6cc6..000000000 --- a/app/fvwm/extras/FvwmCommand/test1.pl +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/perl -# arg1 t to invoke FvwmTalk -# td to kill FvwmTalk -# none to move windows - -use FvwmCommand; - - -if( $ARGV[0] eq 't' ) { - Desk ( 0,1); - GotoPage (1, 1); - Module (FvwmTalk); -}elsif( $ARGV[0] eq 'td' ) { - KillModule (FvwmTalk); -}else { - Move ; -} diff --git a/app/fvwm/extras/FvwmCommand/test2.sh b/app/fvwm/extras/FvwmCommand/test2.sh deleted file mode 100644 index faa4d5be5..000000000 --- a/app/fvwm/extras/FvwmCommand/test2.sh +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/sh -# FvwmCommand test -# arg1 b to invoke FvwmButtons -# kb to kill FvwmButtons -# r to change button rows -# c to change button columns - -. ./FvwmCommand.sh - -if [ "$1" = 'b' ] ; then - Module FvwmButtons; -elif [ "$1" = 'kb' ] ; then - KillModule FvwmButtons; -elif [ "$1" = 'r' ] ; then - n=$2 - DestroyModuleConfig '*FvwmButtonsRows' - AddModuleConfig "*FvwmButtonsRows $n" -elif [ "$1" = 'c' ] ; then - n=$2 - DestroyModuleConfig '*FvwmButtonsColumns' - AddModuleConfig "*FvwmButtonsColumns $n" -else - echo " arg1 b to invoke FvwmButtons" - echo " kb to kill FvwmButtons" - ehco " r to change button rows" - echo " c to change button columns" - -fi - diff --git a/app/fvwm/extras/FvwmConfig/FvwmConfig.1 b/app/fvwm/extras/FvwmConfig/FvwmConfig.1 deleted file mode 100644 index c6575c893..000000000 --- a/app/fvwm/extras/FvwmConfig/FvwmConfig.1 +++ /dev/null @@ -1,58 +0,0 @@ -.\" t -.\" @(#)FvwmConfig.1 1/12/94 -.TH FvwmConfig 1.20 "Mar 16 1994" -.UC -.SH NAME -FvwmConfig \- the FVWM Configuration Aid (Braindead) -.SH SYNOPSIS -FvwmConfig is spawned by fvwm, so no command line invocation will work. -From within the .fvwmrc file, FvwmConfig is spawned as follows: -.nf -.sp -Module FvwmConfig -.sp -.fi -or from within an fvwm pop-up menu: -.nf -.sp - AddToMenu Module-Popup "Modules" Title - + "Configure" Module FvwmConfig - + "FvwmIdentify" Module FvwmIdent - + "Banner" Module FvwmBanner - + "SaveDesktop" Module FvwmSave -.sp -.fi - -.SH DESCRIPTION -The FvwmConfig helps users make very simple, basic changes to the -current fvwm configuration. - -In order for FvwmConfig to make changes which will take effect for -future X sessions, the user's or system's .fvwmrc file must -end with the line "Read .fvwmrc-config". FvwmConfig will write its -configuration out to the file $HOME/.fvwmrc-config, thus minimizing -conflicts with other portions of the user's configuration. - -Since FvwmConfig is used to edit the user's configuration, it doesn't -make much sense for it to be very configurable itself. There are no -user-specifiable configuration options for FvwmConfig. - -Use of this module is discouraged, since the options it allows are -far less in variety than fvwm itself can allow. - -FvwmConfig will not work as intended if ANY styles other than the -default styles are applied to it. - -.SH COPYRIGHTS -The FvwmConfig program, and the concept for interfacing this module to -the Window Manager, are all original work by Robert Nation. - -Copyright 1994, Robert Nation. No guarantees or warranties or anything -are provided or implied in any way whatsoever. Use this program at your -own risk. Permission to use this program for any purpose is given, -as long as the copyright is kept intact. - - -.SH AUTHOR -Robert Nation - diff --git a/app/fvwm/extras/FvwmConfig/FvwmConfig.C b/app/fvwm/extras/FvwmConfig/FvwmConfig.C deleted file mode 100644 index 6e36c6c05..000000000 --- a/app/fvwm/extras/FvwmConfig/FvwmConfig.C +++ /dev/null @@ -1,574 +0,0 @@ -#include "config.h" - -#include <stdio.h> -#include <iostream.h> -#include <stdlib.h> -#include <math.h> -#include <string.h> - -#include "WinBase.h" -#include "WinButton.h" -#include "WinButton.h" -#include "WinInput.h" -#include "WinColorSelector.h" - -extern "C" { -#include "fvwmlib.h" -} -#include "../../fvwm/module.h" - -#define ClickToFocus (1<<10) -#define SloppyFocus (1<<11) -int fd[2]; -char *MyName; - -extern "C" void SetupPipeHandler(void); - - -WinInput *inwin; -WinButton * cfocus, *cmouse,*fmouse, *fclick, *fsloppy, *nescroll, *escroll; -WinColorSelector *hibackselwin, *hiforeselwin, *backselwin, *foreselwin; -WinBase *base; -Window pwin; - -void finish(WinBase *which) -{ - exit(0); -} - -void abortaction(int newstate, WinButton *which) -{ - exit(0); -} - -char tmp[2000]; -int focus = -1; -int colormap = -1; -int edgescroll = -1; -float back_red = -1; -float back_green = -1; -float back_blue = -1; -float fore_red = -1; -float fore_green = -1; -float fore_blue = -1; - -float hi_back_red = -1; -float hi_back_green = -1; -float hi_back_blue = -1; -float hi_fore_red = -1; -float hi_fore_green = -1; -float hi_fore_blue = -1; -int size_read = -1; - - -void testaction(int newstate, WinButton *which) -{ - int i; - char *t; - - if(focus == 1) - SendInfo(fd,"Style \"*\" ClickToFocus\n",0); - else if(focus == 0) - SendInfo(fd,"Style \"*\" MouseFocus\n",0); - else if(focus == 2) - SendInfo(fd,"Style \"*\" SloppyFocus\n",0); - - if(colormap == 1) - SendInfo(fd,"ColormapFocus FollowsFocus",0); - else if (colormap == 0) - SendInfo(fd,"ColormapFocus FollowsMouse",0); - - t = inwin->GetLine(); - if(strlen(inwin->GetLine()) > 2) - { - if(sscanf(t,"%dx%d", &i, &i) == 2) - { - sprintf(tmp,"DeskTopSize %s\n",t); - SendInfo(fd,tmp,0); - } - else - { - inwin->SetLabel(""); - inwin->RedrawWindow(1); - } - } - else - { - inwin->SetLabel(""); - inwin->RedrawWindow(1); - } - - if(fore_red >= 0) - { - sprintf(tmp,"Style \"*\" ForeColor #%04x%04x%04x",(int)fore_red, - (int)fore_green, (int)fore_blue); - SendInfo(fd,tmp,0); - } - if(back_red >= 0) - { - sprintf(tmp,"Style \"*\" BackColor #%04x%04x%04x",(int)back_red, - (int)back_green, (int)back_blue); - SendInfo(fd,tmp,0); - } - - if((hi_fore_red >= 0)||(hi_back_red >= 0)) - { - sprintf(tmp,"HilightColor #%04x%04x%04x #%04x%04x%04x",(int)hi_fore_red, - (int)hi_fore_green, (int)hi_fore_blue,(int)hi_back_red, - (int)hi_back_green, (int)hi_back_blue); - SendInfo(fd,tmp,0); - } - if(edgescroll == 1) - SendInfo(fd,"EdgeScroll 100 100",0); - else if (edgescroll == 0) - SendInfo(fd,"EdgeScroll 0 0",0); - - if((focus == 1)||(focus == 0)||(fore_red >= 0)||(back_red >=0)) - SendInfo(fd,"Recapture",0); -} - -void commitaction(int newstate, WinButton *which) -{ - char fname[2000]; - char *homedir; - FILE *nfd; - char *t; - int i; - - testaction(newstate, which); - homedir = getenv("HOME"); - if(homedir == NULL) - fname[0] = 0; - else - strcpy(fname,homedir); - strcat(fname,"/.fvwmrc-config"); - - nfd = fopen(fname,"w"); - if(nfd) - { - if(focus == 1) - fprintf(nfd,"Style \"*\" ClickToFocus\n"); - else if(focus == 0) - fprintf(nfd,"Style \"*\" MouseFocus\n"); - else if(focus == 2) - fprintf(nfd,"Style \"*\" SloppyFocus\n"); - - if(colormap == 1) - fprintf(nfd,"ColormapFocus FollowsFocus\n"); - else if (colormap == 0) - fprintf(nfd,"ColormapFocus FollowsMouse\n"); - - t = inwin->GetLine(); - if(strlen(inwin->GetLine()) > 2) - { - if(sscanf(t,"%dx%d", &i, &i) == 2) - fprintf(nfd,"DeskTopSize %s\n",inwin->GetLine()); - } - - if(edgescroll == 1) - fprintf(nfd,"EdgeScroll 100 100\n"); - else if (edgescroll == 0) - fprintf(nfd,"EdgeScroll 0 0\n"); - if(fore_red >= 0) - { - fprintf(nfd,"Style \"*\" ForeColor #%04x%04x%04x\n",(int)fore_red, - (int)fore_green, (int)fore_blue); - } - if(back_red >= 0) - { - fprintf(nfd,"Style \"*\" BackColor #%04x%04x%04x\n",(int)back_red, - (int)back_green, (int)back_blue); - } - if((hi_fore_red >= 0)||(hi_back_red >= 0)) - { - fprintf(nfd,"HilightColor #%04x%04x%04x #%04x%04x%04x\n", - (int)hi_fore_red,(int)hi_fore_green, (int)hi_fore_blue, - (int)hi_back_red, (int)hi_back_green, (int)hi_back_blue); - } - fclose(nfd); - } - exit(0); -} - -void backcolorhandler(float red, float green, float blue, - WinColorSelector *which) -{ - back_red = red; - back_green = green; - back_blue = blue; -} - -void forecolorhandler(float red, float green, float blue, - WinColorSelector *which) -{ - fore_red = red; - fore_green = green; - fore_blue = blue; -} - -void hibackcolorhandler(float red, float green, float blue, - WinColorSelector *which) -{ - hi_back_red = red; - hi_back_green = green; - hi_back_blue = blue; -} - -void hiforecolorhandler(float red, float green, float blue, - WinColorSelector *which) -{ - hi_fore_red = red; - hi_fore_green = green; - hi_fore_blue = blue; -} - -void colormapmouseaction(int newstate, WinButton *which) -{ - if(newstate == 1) - { - if(colormap == 0) - colormap = -1; - } - else - { - cfocus->PopOut(); - colormap = 0; - cfocus->RedrawWindow(0); - } - -} - -void Scrollaction(int newstate, WinButton *which) -{ - if(newstate == 1) - { - if(edgescroll == 1) - edgescroll = -1; - } - else - { - nescroll->PopOut(); - edgescroll = 1; - nescroll->RedrawWindow(0); - } -} -void Noscrollaction(int newstate, WinButton *which) -{ - if(newstate == 1) - { - if(edgescroll == 0) - edgescroll= -1; - } - else - { - escroll->PopOut(); - edgescroll = 0; - escroll->RedrawWindow(0); - } -} -void colormapfocusaction(int newstate, WinButton *which) -{ - if(newstate == 1) - { - if(colormap==1) - colormap = -1; - } - else - { - cmouse->PopOut(); - colormap = 1; - cmouse->RedrawWindow(0); - } -} - -void focusmouseaction(int newstate, WinButton *which) -{ - if(newstate == 1) - { - if(focus == 0) - focus = -1; - } - else - { - fclick->PopOut(); - focus = 0; - fclick->RedrawWindow(0); - fsloppy->PopOut(); - fsloppy->RedrawWindow(0); - } -} -void focusclickaction(int newstate, WinButton *which) -{ - if(newstate == 1) - { - if(focus == 1) - focus = -1; - } - else - { - fmouse->PopOut(); - focus = 1; - fmouse->RedrawWindow(0); - fsloppy->PopOut(); - fsloppy->RedrawWindow(0); - } -} -void focussloppyaction(int newstate, WinButton *which) -{ - if(newstate == 1) - { - if(focus == 2) - focus = -1; - } - else - { - focus = 2; - fmouse->PopOut(); - fmouse->RedrawWindow(0); - fclick->PopOut(); - fclick->RedrawWindow(0); - } -} - -void ReadPacket(int fd) -{ - unsigned long header[HEADER_SIZE]; - unsigned long *body; - Pixel hipixel, hibackpixel; - XColor colorcell; - int n; - - ReadFvwmPacket(fd, header, &body); - - if(header[1] == M_FOCUS_CHANGE) - { - if(hi_fore_red < 0) - { - hipixel = body[3]; - hibackpixel = body[4]; - colorcell.pixel = hipixel; - n = XQueryColor(hiforeselwin->dpy, - DefaultColormap(hiforeselwin->dpy, - hiforeselwin->Screen), - &colorcell); - hi_fore_red = colorcell.red & 0xffff; - hi_fore_green = colorcell.green & 0xffff; - hi_fore_blue = colorcell.blue & 0xffff; - hiforeselwin->SetCurrentValue(hi_fore_red, hi_fore_green, hi_fore_blue); - colorcell.pixel = hibackpixel; - XQueryColor(hibackselwin->dpy, - DefaultColormap(hiforeselwin->dpy, - hiforeselwin->Screen), - &colorcell); - hi_back_red = colorcell.red & 0xffff; - hi_back_green = colorcell.green & 0xffff; - hi_back_blue = colorcell.blue & 0xffff; - hibackselwin->SetCurrentValue(hi_back_red, hi_back_green, hi_back_blue); - } - } - else if((header[1] == M_CONFIGURE_WINDOW)&&(body[0] == pwin)) - { - if(fore_red < 0) - { - hipixel = body[22]; - hibackpixel = body[23]; - colorcell.pixel = hipixel; - XQueryColor(foreselwin->dpy, - DefaultColormap(hiforeselwin->dpy, - hiforeselwin->Screen), - &colorcell); - fore_red = colorcell.red & 0xffff; - fore_green = colorcell.green & 0xffff; - fore_blue = colorcell.blue & 0xffff; - foreselwin->SetCurrentValue(fore_red, fore_green, fore_blue); - colorcell.pixel = hibackpixel; - XQueryColor(backselwin->dpy, - DefaultColormap(hiforeselwin->dpy, - hiforeselwin->Screen), - &colorcell); - back_red = colorcell.red & 0xffff; - back_green = colorcell.green & 0xffff; - back_blue = colorcell.blue & 0xffff; - backselwin->SetCurrentValue(back_red, back_green, back_blue); - if(body[8] & ClickToFocus) - focus = 1; - if(body[8] & SloppyFocus) - focus = 2; - if(focus == 1) - { - fclick->PushIn(); - fclick->RedrawWindow(0); - fmouse->PopOut(); - fmouse->RedrawWindow(0); - fsloppy->PopOut(); - fsloppy->RedrawWindow(0); - } - else if (focus == 2) - { - fclick->PopOut(); - fclick->RedrawWindow(0); - fmouse->PopOut(); - fmouse->RedrawWindow(0); - fsloppy->PushIn(); - fsloppy->RedrawWindow(0); - } - else - { - fclick->PopOut(); - fclick->RedrawWindow(0); - fmouse->PushIn(); - fmouse->RedrawWindow(0); - fsloppy->PopOut(); - fsloppy->RedrawWindow(0); - } - - } - } - else if(header[1] == M_NEW_PAGE) - { - char size[100]; - int vxmax, vymax, sx,sy,nx,ny; - - if(size_read < 0) - { - vxmax = body[3]; - vymax = body[4]; - sx = base->ScreenWidth(); - sy = base->ScreenHeight(); - nx = vxmax/sx + 1; - ny = vymax/sy + 1; - sprintf(size,"%dx%d",nx,ny); - inwin->SetLabel(size); - size_read = 1; - } - } - free((char *)body); -} - -#define WINDOW_HEIGHT 400 -int main(int argc, char **argv) -{ - char *temp, *s; - - /* Save our program name - for error messages */ - temp = argv[0]; - s=strrchr(argv[0], '/'); - if (s != NULL) - temp = s + 1; - - MyName = safemalloc(strlen(temp)+2); - strcpy(MyName, temp); - - if(argc < 6) - { - fprintf(stderr,"%s Version %s should only be executed by fvwm!\n",MyName, - VERSION); - exit(1); - } - - /* Dead pipe == Fvwm died */ - SetupPipeHandler(); - fd[0] = atoi(argv[1]); - fd[1] = atoi(argv[2]); - - WinInitialize(argv,argc); - WinAddInput(fd[1],ReadPacket); - SendInfo(fd,"Send_WindowList",0); - WinBase a(NULL,300,WINDOW_HEIGHT,0,0); - pwin = a.win; - base = &a; - a.SetWindowName("Braindead Fvwm Configuration Editor"); - a.SetIconName("Braindead"); - a.SetBevelWidth(3); - a.SetGeometry((a.ScreenWidth() - 200)/2,(a.ScreenHeight()-200)/2, - 300,WINDOW_HEIGHT, - 1,1,500,500,1,1,1,1,CenterGravity); - - WinText keyboard(&a,280,20,10,6,"Keyboard Focus"); - keyboard.SetBevelWidth(0); - WinButton focusclick(&a,90,20,15,32,"Click"); - WinButton focusmouse(&a,90,20,105,32,"Follows Mouse"); - WinButton focussloppy(&a,90,20,195,32,"Trails Mouse"); - focusmouse.SetToggleAction(focusmouseaction); - focusclick.SetToggleAction(focusclickaction); - focussloppy.SetToggleAction(focussloppyaction); - - WinBase divider1(&a,290,4,5,58); - divider1.SetBevelWidth(2); - WinText colormap(&a,280,20,10,62,"Colormap Focus"); - colormap.SetBevelWidth(0); - WinButton colormapfocus(&a,100,20,50,88,"Follows Focus"); - WinButton colormapmouse(&a,100,20,150,88,"Follows Mouse"); - colormapmouse.SetToggleAction(colormapmouseaction); - colormapfocus.SetToggleAction(colormapfocusaction); - - WinBase divider2(&a,290,4,5,114); - divider2.SetBevelWidth(2); - WinText desktop(&a,280,20,10,120,"Desktop"); - desktop.SetBevelWidth(0); - WinText desktopsize(&a,30,20,20,144,"Size"); - desktopsize.SetBevelWidth(0); - WinInput deskinput(&a,40,20,50,144,NULL); - deskinput.SetBevelWidth(2); - - WinButton EdgeScroll(&a,80,20,110,144,"Edge Scroll"); - WinButton NoEdgeScroll(&a,100,20,190,144,"No Edge Scroll"); - EdgeScroll.SetToggleAction(Scrollaction); - NoEdgeScroll.SetToggleAction(Noscrollaction); - - WinBase divider3(&a,290,4,5,170); - divider3.SetBevelWidth(2); - WinText backcolorlabel(&a,140,20,5,176,"Default Back Color"); - WinText forecolorlabel(&a,140,20,155,176,"Default Fore Color"); - WinColorSelector defaultbackcolor(&a,140,70,5,196); - WinColorSelector defaultforecolor(&a,140,70,155,196); - backselwin = &defaultbackcolor; - foreselwin = &defaultforecolor; - defaultbackcolor.SetBevelWidth(0); - defaultforecolor.SetBevelWidth(0); - backcolorlabel.SetBevelWidth(0); - forecolorlabel.SetBevelWidth(0); - defaultbackcolor.SetMotionAction(backcolorhandler); - defaultforecolor.SetMotionAction(forecolorhandler); - - WinBase divider4(&a,290,4,5,272); - divider4.SetBevelWidth(2); - WinText hibackcolorlabel(&a,140,20,5,278,"Hilight Back Color"); - WinText hiforecolorlabel(&a,140,20,155,278,"Hilight Fore Color"); - - WinColorSelector hibackcolor(&a,140,70,5,298); - WinColorSelector hiforecolor(&a,140,70,155,298); - hibackselwin = &hibackcolor; - hiforeselwin = &hiforecolor; - hibackcolor.SetBevelWidth(0); - hiforecolor.SetBevelWidth(0); - hibackcolorlabel.SetBevelWidth(0); - hiforecolorlabel.SetBevelWidth(0); - hibackcolor.SetMotionAction(hibackcolorhandler); - hiforecolor.SetMotionAction(hiforecolorhandler); - - - WinButton testbutton(&a,60,20,30,WINDOW_HEIGHT-30,"Test"); - WinButton commitbutton(&a,60,20,120,WINDOW_HEIGHT-30,"Commit"); - testbutton.MakeMomentary(); - WinButton abortbutton(&a,60,20,210,WINDOW_HEIGHT-30,"Abort"); - - commitbutton.SetToggleAction(commitaction); - testbutton.SetToggleAction(testaction); - abortbutton.SetToggleAction(abortaction); - fclick = &focusclick; - fsloppy = &focussloppy; - fmouse = &focusmouse; - cmouse = &colormapmouse; - cfocus = &colormapfocus; - escroll = &EdgeScroll; - nescroll = &NoEdgeScroll; - inwin = &deskinput; - a.Map(); - - while(1) - { - WinLoop(); - } - return 0; -} diff --git a/app/fvwm/extras/FvwmConfig/WinBase.C b/app/fvwm/extras/FvwmConfig/WinBase.C deleted file mode 100644 index 129a33cd8..000000000 --- a/app/fvwm/extras/FvwmConfig/WinBase.C +++ /dev/null @@ -1,1006 +0,0 @@ -#include "config.h" - -#include <iostream.h> -#include <stdlib.h> -#include <math.h> -#include <X11/X.h> -#include <X11/Xlib.h> -#include <X11/Xutil.h> -#include <X11/Xresource.h> -#include <stdio.h> -#include <stdlib.h> -#include <unistd.h> -#include <sys/types.h> -#include <sys/time.h> -#include "WinBase.h" - -char *def_geom_string = NULL; -char *def_fg_string = DEFAULT_FORECOLOR; -char *def_bg_string = DEFAULT_BACKCOLOR; -char *def_font = DEFAULT_FONT; -char *def_bw = DEFAULT_BEVEL; -char *def_resname = "XThing"; -char *def_display = NULL; -char **orig_argv = NULL; -int orig_argc = 0; - -/************************************************************************ - * ReapChildren - wait() for all dead child processes - ************************************************************************/ -#include <sys/wait.h> -#ifdef HAVE_WAITPID -#define ReapChildren() while ((waitpid(-1, NULL, WNOHANG)) > 0); -#else -#define ReapChildren() while ((wait3(NULL, WNOHANG, NULL)) > 0); -#endif - -int GetFdWidth(void) -{ -#ifdef HAVE_SYSCONF - return sysconf(_SC_OPEN_MAX); -#else - return getdtablesize(); -#endif -} - -int My_XNextEvent(Display *dpy, XEvent *event); -static int MyXAllocColor(Display *dpy,Colormap cmap,int screen, XColor *color); -/************************************************************************** - * - * Standard options - * - *************************************************************************/ -struct res_list -{ - char **dataptr; - char *keyword; -}; - - -struct res_list string_resource_list[] = -{ - {&def_geom_string, "geometry"}, - {&def_geom_string, "geom"}, - {&def_fg_string, "foreground"}, - {&def_fg_string, "fg"}, - {&def_bg_string, "background"}, - {&def_bg_string, "bg"}, - {&def_font, "font"}, - {&def_bw, "bevelwidth"}, - {&def_bw, "bw"}, - {0, NULL} -}; - - -/*************************************************************************** - * - * Declarations for static members of WinBase - * - ***************************************************************************/ -Display *WinBase::dpy = 0; -Window WinBase::Root = None; -int WinBase::Screen; -GC WinBase::DefaultReliefGC; -GC WinBase::DefaultShadowGC; -GC WinBase::DefaultForeGC; -XFontStruct *WinBase::DefaultFont; -Pixel WinBase::DefaultBackColor; -Pixel WinBase::DefaultReliefColor; -Pixel WinBase::DefaultShadowColor; -Pixel WinBase::DefaultForeColor; -Colormap WinBase::cmap; - -static Atom wm_del_win; -static int fd_width; -static int x_fd; -struct iodesc -{ - int fd; - void (*func)(int); -}; -struct iodesc *wininputdesc; -struct iodesc *winoutputdesc; -static int wininputcount; -static int winoutputcount; - -void WinInitialize(char **argv, int argc) -{ - int i = 0,j,done; - char *tmp; - - orig_argv = argv; - orig_argc = argc; - - for(i=1;i<argc;i++) - { - if(strcmp(argv[i],"-display")==0) - def_display = argv[i+1]; - } - - - WinBase::dpy = XOpenDisplay(def_display); - if(WinBase::dpy == 0) - { - cerr <<"Can't open display\n"; - exit(-1); - } - - fd_width = GetFdWidth(); - wininputdesc = new struct iodesc[fd_width]; - winoutputdesc = new struct iodesc[fd_width]; - wininputcount = 0; - winoutputcount = 0; - for(i=0;i<fd_width;i++) - { - wininputdesc[i].fd = -1; - winoutputdesc[i].fd = -1; - } - x_fd = XConnectionNumber(WinBase::dpy); - - if(argv[0] !=0) - def_resname = argv[0]; - - /* Check for defaults in .Xdefaults. */ - i=0; - while(string_resource_list[i].keyword != NULL) - { - if((tmp = XGetDefault(WinBase::dpy,def_resname, - string_resource_list[i].keyword)) != (char *)0) - { - *string_resource_list[i].dataptr = tmp; - } - - i++; - } - - /* Check for command line options */ - for(i=1;i<argc;i++) - { - if(argv[i][0] == '-') - { - j=0; - done = 0; - while((string_resource_list[j].keyword != NULL)&&(!done)) - { - if(strcmp(&argv[i][1],string_resource_list[j].keyword)==0) - { - *string_resource_list[j].dataptr = &argv[i+1][0]; - i++; - done = 1; - } - j++; - } - } - } -} - -int WinAddInput(int fd, void (*readfunc)(int)) -{ - if(wininputcount < fd_width) - { - wininputdesc[wininputcount].func = readfunc; - wininputdesc[wininputcount].fd = fd; - wininputcount++; - return 0; - } - else - return 1; -} - -int WinAddOutput(int fd, void (*writefunc)(int)) -{ - if(winoutputcount < fd_width) - { - winoutputdesc[winoutputcount].func = writefunc; - winoutputdesc[winoutputcount].fd = fd; - winoutputcount++; - return 0; - } - else - return 1; -} - -WinBase::WinBase(WinBase* ParentW, int width,int height,int x_loc, int y_loc) -{ - Window pwindow; - XGCValues gcv; - XSetWindowAttributes attributes; /* attributes for creating window */ - unsigned long mask; - int create_defaults = 0; - - Parent = ParentW; - if(Root == None) - { - /* This is the first window opened. */ - create_defaults = 1; - - /* Open X connection */ - if(dpy == 0) - { - dpy = XOpenDisplay(def_display); - if(dpy == 0) - { - cerr <<"Can't open display\n"; - if(def_display != NULL) - cerr <<def_display; - cerr <<"\n"; - - exit(-1); - } - } - Screen = DefaultScreen(dpy); - Root = RootWindow(dpy,Screen); - - } - if(create_defaults) - { - cmap = DefaultColormap(dpy,Screen); - DefaultBackColor = GetColor(def_bg_string,dpy,cmap,Screen); - GetColor("black",dpy,cmap,Screen); - GetColor("white",dpy,cmap,Screen); - if(DefaultBackColor == 0xffffffff) - DefaultBackColor = WhitePixel(dpy,Screen); - DefaultReliefColor = GetHilite(DefaultBackColor,dpy,Screen, cmap); - DefaultShadowColor = GetShadow(DefaultBackColor,dpy,Screen, cmap); - DefaultForeColor = GetColor(def_fg_string,dpy,cmap,Screen); - if(DefaultForeColor == 0xffffffff) - DefaultForeColor = BlackPixel(dpy,Screen); - - } - - if(Parent == NULL) - pwindow = Root; - else - pwindow = Parent->win; - x = x_loc; - y = y_loc; - w = width; - h = height; - - if(Parent == NULL) - { - BackColor = DefaultBackColor; - ForeColor = DefaultForeColor; - ReliefColor = DefaultReliefColor; - ShadowColor = DefaultShadowColor; - bw = atoi(def_bw); - } - else - { - BackColor = Parent->BackColor; - ForeColor = Parent->ForeColor; - ReliefColor = Parent->ReliefColor; - ShadowColor = Parent->ShadowColor; - bw = Parent->bw; - } - popped_out = 1; - - name_set = 0; - icon_name_set = 0; - - CloseWindowAction = NULL; - - mask = CWBackPixel | CWEventMask; - attributes.background_pixel = BackColor; - attributes.event_mask = - ButtonPressMask|ButtonReleaseMask|ExposureMask|KeyPressMask| - StructureNotifyMask; - win = XCreateWindow(dpy,pwindow,x_loc,y_loc,width,height,0, - CopyFromParent,InputOutput,CopyFromParent, - mask,&attributes); - if(create_defaults) - { - DefaultFont = XLoadQueryFont(dpy, def_font); - if(DefaultFont == NULL) - { - cerr <<"Can't load font "<<def_font<<"\n"; - DefaultFont = XLoadQueryFont(dpy, "fixed"); - } - if(DefaultFont == NULL) - { - cerr <<"Giving up\n"; - exit(1); - } - - mask = GCFunction|GCPlaneMask|GCGraphicsExposures|GCLineWidth| - GCForeground|GCBackground| GCFont; - gcv.background = DefaultBackColor; - gcv.line_width = 0; - gcv.function = GXcopy; - gcv.font = DefaultFont->fid; - gcv.plane_mask = AllPlanes; - gcv.graphics_exposures = False; - - gcv.foreground = DefaultReliefColor; - DefaultReliefGC = XCreateGC(dpy,win,mask,&gcv); - gcv.foreground = DefaultShadowColor; - DefaultShadowGC = XCreateGC(dpy,win,mask,&gcv); - gcv.foreground = DefaultForeColor; - DefaultForeGC = XCreateGC(dpy,win,mask,&gcv); - } - if(Parent == NULL) - { - XClassHint classhints; - XWMHints wmhints; - XSizeHints normal_hints; - XTextProperty name; - - main_window = this; - ReliefGC = DefaultReliefGC; - ShadowGC = DefaultShadowGC; - ForeGC = DefaultForeGC; - Font = DefaultFont; - normal_hints.flags = PWinGravity|PMinSize|PResizeInc; - normal_hints.width_inc = 1; - normal_hints.height_inc = 1; - normal_hints.min_width = 1; - normal_hints.min_height = 1; - normal_hints.win_gravity = NorthWestGravity; - wmhints.input = True; - wmhints.initial_state = NormalState; - wmhints.flags = InputHint|StateHint; - classhints.res_name = def_resname; - classhints.res_class = def_resname; - - if (XStringListToTextProperty(&def_resname,1,&name) == 0) - { - cerr <<"cannot allocate window name"; - return; - } - - XSetWMProperties(dpy,win, &name, &name,orig_argv, - orig_argc, &normal_hints,&wmhints,&classhints); - } - else - { - main_window = Parent->main_window; - mask = GCFunction|GCPlaneMask|GCGraphicsExposures|GCLineWidth| - GCForeground|GCBackground| GCFont; - if(Parent->ReliefGC == DefaultReliefGC) - ReliefGC = DefaultReliefGC; - else - { - XGetGCValues(dpy,Parent->ReliefGC,mask,&gcv); - ReliefGC = XCreateGC(dpy,win,mask,&gcv); - } - if(Parent->ShadowGC == DefaultShadowGC) - ShadowGC = DefaultShadowGC; - else - { - XGetGCValues(dpy,Parent->ShadowGC,mask,&gcv); - ShadowGC = XCreateGC(dpy,win,mask,&gcv); - } - - if(Parent->ForeGC == DefaultForeGC) - ForeGC = DefaultForeGC; - else - { - XGetGCValues(dpy,Parent->ForeGC,mask,&gcv); - ForeGC = XCreateGC(dpy,win,mask,&gcv); - } - Font = Parent->DefaultFont; - } - RegisterWindow(win,this); - - if(wm_del_win == 0) - wm_del_win = XInternAtom(dpy,"WM_DELETE_WINDOW",False); - XSetWMProtocols(dpy,win,&wm_del_win,1); -} - - -WinBase::~WinBase() -{ - XDestroyWindow(dpy,win); - UnregisterWindow(this); -} - -void WinBase::Map() -{ - XMapSubwindows(dpy,win); - XMapRaised(dpy,win); - XSync(dpy,0); -} - -void WinBase::RedrawWindow(int clear) -{ - if(clear) - XClearWindow(dpy,win); - DrawCallback(NULL); -} - -void WinBase::DrawCallback(XEvent *event) -{ - int i; - GC gc1; - GC gc2; - - if((!event)||(event->xexpose.count == 0)) - { - if(popped_out) - { - gc1 = ShadowGC; - gc2 = ReliefGC; - } - else - { - gc2 = ShadowGC; - gc1 = ReliefGC; - } - for(i=0;i<bw;i++) - { - XDrawLine(dpy,win,gc1,i,h-1-i,w-1-i,h-1-i); - XDrawLine(dpy,win,gc1,w-1-i,i,w-1-i,h-1-i); - XDrawLine(dpy,win,gc2,i,i,w-1-i,i); - XDrawLine(dpy,win,gc2,i,i,i,h-1-i); - } - } - - -} - -void WinBase::BPressCallback(XEvent *event) -{ -} - -void WinBase::KPressCallback(XEvent *event) -{ -} - -void WinBase::BReleaseCallback(XEvent *event) -{ -} - -void WinBase::ResizeCallback(int new_w, int new_h, XEvent *event) -{ - w = new_w; - h = new_h; - RedrawWindow(1); -} - -void WinBase::MotionCallback(XEvent *event) -{ -} - -void WinBase::SetSize(int new_w, int new_h) -{ - XResizeWindow(dpy,win,new_w,new_h); - w = new_w; - h = new_h; -} - - - -void WinBase::SetPosition(int new_x, int new_y) -{ - XMoveWindow(dpy,win,new_x,new_y); - x = new_x; - y = new_y; -} - -void WinBase::SetGeometry(int new_x, int new_y, int new_w, int new_h, - int min_width, int min_height, - int max_width, int max_height, - int resize_inc_w, int resize_inc_h, - int base_width, int base_height, - int gravity) -{ - XSizeHints normal_hints; - - normal_hints.flags = USPosition|USSize| - PMinSize|PMaxSize|PResizeInc|PBaseSize|PWinGravity; - normal_hints.x = new_x; - normal_hints.y = new_y; - normal_hints.width = new_w; - normal_hints.height = new_h; - normal_hints.min_width = min_width; - normal_hints.min_height = min_height; - normal_hints.max_width = max_width; - normal_hints.max_height = max_height; - normal_hints.width_inc = resize_inc_w; - normal_hints.height_inc = resize_inc_h; - normal_hints.base_width = base_width; - normal_hints.base_height = base_height; - normal_hints.win_gravity = gravity; - XSetWMNormalHints(dpy,win, &normal_hints); - SetPosition(new_x,new_y); - SetSize(new_w, new_h); -} - -void WinBase::SetCloseWindowAction(void (*NewAction)(WinBase *which)) -{ - CloseWindowAction = NewAction; -} -void WinBase::SetBackColor(char *newcolor = DEFAULT_BACKCOLOR) -{ - XGCValues gcv; - XSetWindowAttributes attributes; /* attributes for creating window */ - unsigned long mask; - - BackColor = GetColor(newcolor,dpy,cmap,Screen); - if(BackColor == 0xffffffff) - BackColor = DefaultBackColor; - ReliefColor = GetHilite(BackColor,dpy,Screen, cmap); - ShadowColor = GetShadow(BackColor,dpy,Screen, cmap); - if(ForeGC != DefaultForeGC) - { - XFreeGC(dpy,ForeGC); - } - if(ShadowGC != DefaultShadowGC) - { - XFreeGC(dpy,ShadowGC); - } - if(ReliefGC != DefaultReliefGC) - { - XFreeGC(dpy,ReliefGC); - } - - mask = GCFunction|GCPlaneMask|GCGraphicsExposures|GCLineWidth| - GCForeground|GCBackground|GCFont; - gcv.background = BackColor; - gcv.line_width = 0; - gcv.function = GXcopy; - gcv.plane_mask = AllPlanes; - gcv.font = Font->fid; - gcv.graphics_exposures = False; - - gcv.foreground = ReliefColor; - ReliefGC = XCreateGC(dpy,win,mask,&gcv); - gcv.foreground = ShadowColor; - ShadowGC = XCreateGC(dpy,win,mask,&gcv); - gcv.foreground = ForeColor; - ForeGC = XCreateGC(dpy,win,mask,&gcv); - mask = CWBackPixel; - attributes.background_pixel = BackColor; - XChangeWindowAttributes(dpy,win, mask,&attributes); - XClearWindow(dpy,win); -} -void WinBase::SetBevelWidth(int new_bw) -{ - bw = new_bw; -} -void WinBase::PushIn() -{ - popped_out = 0; - -} - -void WinBase::PopOut() -{ - popped_out = 1; -} - -void WinBase::MakeTransient(WinBase *TransientFor) -{ - XSetTransientForHint(dpy,win,TransientFor->win); -} - -void WinBase::SetForeColor(char *newcolor = DEFAULT_FORECOLOR) -{ - XGCValues gcv; - unsigned long mask; - - ForeColor = GetColor(newcolor,dpy,cmap,Screen); - if(ForeColor == 0xffffffff) - ForeColor = DefaultForeColor; - if(ForeGC!= DefaultForeGC) - XFreeGC(dpy,ShadowGC); - - mask = GCFunction|GCPlaneMask|GCGraphicsExposures|GCLineWidth| - GCForeground|GCBackground|GCFont; - gcv.background = BackColor; - gcv.line_width = 0; - gcv.function = GXcopy; - gcv.plane_mask = AllPlanes; - gcv.graphics_exposures = False; - gcv.foreground = DefaultForeColor; - gcv.font = Font->fid; - ForeGC = XCreateGC(dpy,win,mask,&gcv); -} -void WinBase::SetFont(char *newfont=DEFAULT_FONT) -{ - XGCValues gcv; - unsigned long mask; - - Font = XLoadQueryFont(dpy, newfont); - if(Font == NULL) - Font = DefaultFont; - - if(ForeGC != DefaultForeGC) - { - XFreeGC(dpy,ForeGC); - } - if(ShadowGC != DefaultShadowGC) - { - XFreeGC(dpy,ShadowGC); - } - if(ReliefGC != DefaultReliefGC) - { - XFreeGC(dpy,ReliefGC); - } - - mask = GCFunction|GCPlaneMask|GCGraphicsExposures|GCLineWidth| - GCForeground|GCBackground|GCFont; - gcv.background = BackColor; - gcv.line_width = 0; - gcv.function = GXcopy; - gcv.plane_mask = AllPlanes; - gcv.font = Font->fid; - gcv.graphics_exposures = False; - - gcv.foreground = ReliefColor; - ReliefGC = XCreateGC(dpy,win,mask,&gcv); - gcv.foreground = ShadowColor; - ShadowGC = XCreateGC(dpy,win,mask,&gcv); - gcv.foreground = ForeColor; - ForeGC = XCreateGC(dpy,win,mask,&gcv); -} - -void WinBase::SetWindowName(char *new_name) -{ - XTextProperty name; - - if (XStringListToTextProperty(&new_name,1,&name) == 0) - { - cerr <<"cannot allocate window name"; - return; - } - XSetWMName(dpy,win,&name); - XFree(name.value); - if(icon_name_set == 0) - { - SetIconName(new_name); - icon_name_set = 0; - } - name_set = 1; -} -void WinBase::SetIconName(char *new_name) -{ - XTextProperty name; - - if (XStringListToTextProperty(&new_name,1,&name) == 0) - { - cerr<<"cannot allocate icon name"; - return; - } - XSetWMIconName(dpy,win,&name); - XFree(name.value); - icon_name_set = 1; -} - -void WinBase::SetWindowClass(char *resclass) -{ - XClassHint class_hint; - - class_hint.res_name = def_resname; - class_hint.res_class = resclass; - XSetClassHint(dpy,win,&class_hint); -} - -/**************************************************************************** - * - * This routine computes the shadow color from the background color - * - ****************************************************************************/ -Pixel GetShadow(Pixel background, Display *dpy, int Screen, Colormap cmap) -{ - XColor bg_color, white_p; - - bg_color.pixel = background; - XQueryColor(dpy,cmap,&bg_color); - - white_p.pixel = WhitePixel(dpy,Screen); - XQueryColor(dpy,cmap,&white_p); - - if((bg_color.red < white_p.red/5)&& - (bg_color.green < white_p.green/5)&& - (bg_color.blue < white_p.blue/5)) - { - bg_color.red = white_p.red/4; - bg_color.green = white_p.green/4; - bg_color.blue = white_p.blue/4; - } - else - { - bg_color.red = (bg_color.red*50)/100; - bg_color.green = (bg_color.green*50)/100; - bg_color.blue = (bg_color.blue*50)/100; - } - - if(!MyXAllocColor(dpy,cmap,Screen,&bg_color)) - { - cout <<"Can't allocate shadow color\n"; - bg_color.pixel = BlackPixel(dpy,Screen); - } - return bg_color.pixel; -} - -/**************************************************************************** - * - * This routine computes the hilight color from the background color - * - ****************************************************************************/ -Pixel GetHilite(Pixel background, Display *dpy, int Screen, Colormap cmap) -{ - XColor bg_color, white_p; - int r,g,b; - bg_color.pixel = background; - XQueryColor(dpy,cmap,&bg_color); - - white_p.pixel = WhitePixel(dpy,Screen); - XQueryColor(dpy,cmap,&white_p); - - - if((bg_color.red > 2*white_p.red/3)&& - (bg_color.green > 2*white_p.green/3)&& - (bg_color.blue > 2*white_p.blue/3)) - { - r = white_p.red*3/4; - g = white_p.green*3/4; - b = white_p.blue*3/4; - } - else - { - r = bg_color.red + (white_p.red - bg_color.red)/2; - g = bg_color.green + (white_p.green - bg_color.green)/2; - b = bg_color.blue + (white_p.blue - bg_color.blue)/2; - } - if(r > white_p.red) - bg_color.red = white_p.red; - else - bg_color.red = r; - if(g > white_p.green) - bg_color.green = white_p.green; - else - bg_color.green = g; - if(b > white_p.blue) - bg_color.blue = white_p.blue; - else - bg_color.blue = b; - - if(!MyXAllocColor(dpy,cmap,Screen,&bg_color)) - { - cout <<"Can't allocate highlight color\n"; - bg_color.pixel = WhitePixel(dpy,Screen);; - } - return bg_color.pixel; -} - -/**************************************************************************** - * - * Loads a single color - * - ****************************************************************************/ -Pixel GetColor(char *name, Display *dpy, Colormap cmap, int Screen) -{ - XColor color; - - color.pixel = 0xffffffff; - if (!XParseColor (dpy, cmap, name, &color)) - { - cerr<< "Can't parse color "<<name<<"\n"; - } - else if(!MyXAllocColor (dpy, cmap, Screen,&color)) - { - cerr<< "Can't allocate color "<<name<<"\n"; - } - return color.pixel; -} - -static int MyXAllocColor(Display *dpy,Colormap cmap,int screen, XColor *color) -{ - XColor *allcolors; - int ncolors,i; - int bestpixel = 0; - float rdist, bdist, gdist, distance,bestdistance = 2e10; - - if(XAllocColor (dpy, cmap, color)) - return 1; - - ncolors = DisplayCells(dpy,screen); - allcolors = new XColor[ncolors]; - for(i=0;i<ncolors;i++) - allcolors[i].pixel = i; - XQueryColors(dpy,cmap,allcolors,ncolors); - for(i=0;i<ncolors;i++) - { - rdist = color->red- allcolors[i].red; - bdist = color->blue- allcolors[i].blue; - gdist = color->green- allcolors[i].green; - distance = rdist*rdist+bdist*bdist+gdist*gdist; - if(distance < bestdistance) - { - bestdistance = distance; - bestpixel = i; - } - } - color->red = allcolors[bestpixel].red; - color->green = allcolors[bestpixel].green; - color->blue = allcolors[bestpixel].blue; - if(XAllocColor (dpy, cmap, color)) - return 1; - else - return 0; -} - -struct registered -{ - Window win; - WinBase *thing; - int occupied; -}; -static struct registered thinglist[100]; - - - -void RegisterWindow(Window win, WinBase *a) -{ - static int firsttime = 1; - int i; - - if(firsttime) - { - firsttime = 0; - for(i=0;i<100;i++) - { - thinglist[i].occupied = 0; - } - } - - for(i=0;i<100;i++) - { - if(thinglist[i].occupied == 0) - { - thinglist[i].occupied = 1; - thinglist[i].win = win; - thinglist[i].thing = a; - return; - } - } - cout <<"Too many windows\n"; - exit(-1); -} - - -void UnregisterWindow(WinBase *thing) -{ - int i; - for(i=0;i<100;i++) - { - if((thinglist[i].occupied ==1)&& - (thinglist[i].thing == thing)) - { - thinglist[i].occupied = 0; - return; - } - } -} - -void WinLoop() -{ - XEvent event; - int i; - Display *dpy; - - i=0; - while((thinglist[i].occupied == 0)&&(i<100)) - { - i++; - } - if(i<100) - dpy = thinglist[i].thing->dpy; - else - return; - - while(!My_XNextEvent(dpy,&event)); - - for(i=0;i<100;i++) - { - if((thinglist[i].occupied)&&(event.xany.window == thinglist[i].win)) - { - switch(event.type) - { - case Expose: - case GraphicsExpose: - thinglist[i].thing->DrawCallback(&event); - break; - case ButtonPress: - thinglist[i].thing->BPressCallback(&event); - break; - case ButtonRelease: - thinglist[i].thing->BReleaseCallback(&event); - break; - case KeyPress: - thinglist[i].thing->KPressCallback(&event); - break; - case ConfigureNotify: - if((thinglist[i].thing->w!= event.xconfigure.width)|| - (thinglist[i].thing->h!= event.xconfigure.height)) - thinglist[i].thing->ResizeCallback(event.xconfigure.width, - event.xconfigure.height,&event); - break; - case ClientMessage: - if (event.xclient.format == 32 && event.xclient.data.l[0] == wm_del_win) - { - if(thinglist[i].thing->CloseWindowAction == NULL) - exit(0); - else - thinglist[i].thing->CloseWindowAction(thinglist[i].thing); - } - break; - case MotionNotify: - thinglist[i].thing->MotionCallback(&event); - break; - default: - break; - } - return; - } - } -} - - -/*************************************************************************** - * - * Waits for next X event, or for an auto-raise timeout. - * - ****************************************************************************/ -int My_XNextEvent(Display *dpy, XEvent *event) -{ - fd_set in_fdset,out_fdset; - Window child; - Window targetWindow; - int i,count; - int retval; - - FD_ZERO(&in_fdset); - FD_SET(x_fd,&in_fdset); - FD_ZERO(&out_fdset); - for(i=0; i<wininputcount; i++) - { - FD_SET(wininputdesc[i].fd, &in_fdset); - } - - for(i=0; i<winoutputcount; i++) - { - FD_SET(winoutputdesc[i].fd, &out_fdset); - } - - /* Do this IMMEDIATELY prior to select, to prevent any nasty - * queued up X events from just hanging around waiting to be - * flushed */ - XFlush(dpy); - if(XPending(dpy)) - { - XNextEvent(dpy,event); - return 1; - } - - /* Zap all those zombies! */ - /* If we get to here, then there are no X events waiting to be processed. - * Just take a moment to check for dead children. */ - ReapChildren(); - - XFlush(dpy); -#ifdef __hpux - retval=select(fd_width,(int *)&in_fdset, (int *)&out_fdset,0, NULL); -#else - retval=select(fd_width,&in_fdset, &out_fdset, 0, NULL); -#endif - - /* Check for module input. */ - for(i=0;i<fd_width;i++) - { - if((wininputdesc[i].fd >= 0)&&(FD_ISSET(wininputdesc[i].fd, &in_fdset))) - { - wininputdesc[i].func(wininputdesc[i].fd); - } - if((winoutputdesc[i].fd>=0)&&(FD_ISSET(winoutputdesc[i].fd, &out_fdset))) - { - winoutputdesc[i].func(winoutputdesc[i].fd); - } - } - return 0; -} - - - diff --git a/app/fvwm/extras/FvwmConfig/WinBase.h b/app/fvwm/extras/FvwmConfig/WinBase.h deleted file mode 100644 index adb567f76..000000000 --- a/app/fvwm/extras/FvwmConfig/WinBase.h +++ /dev/null @@ -1,115 +0,0 @@ -#ifndef win_h -#define win_h - -#include <X11/X.h> -#include <X11/Xlib.h> - -/* let's define Pixel if it is not done yet */ -#if ! defined(_XtIntrinsic_h) && ! defined(PIXEL_ALREADY_TYPEDEFED) -typedef unsigned long Pixel; /* Index into colormap */ -#define PIXEL_ALREADY_TYPEDEFED -#endif - -#define DEFAULT_BEVEL "2" -#define DEFAULT_WIDTH 100 -#define DEFAULT_HEIGHT 100 -#define DEFAULT_X 0 -#define DEFAULT_Y 0 -#define DEFAULT_BACKCOLOR "#908090" -#define DEFAULT_FORECOLOR "black" -#define DEFAULT_FONT "fixed" - - - -class WinBase -{ - public: - static Display *dpy; - static Window Root; - static int Screen; - static Pixel DefaultBackColor; - static Pixel DefaultReliefColor; - static Pixel DefaultShadowColor; - static Pixel DefaultForeColor; - static GC DefaultReliefGC; - static GC DefaultShadowGC; - static GC DefaultForeGC; - static XFontStruct *DefaultFont; - static Colormap cmap; - - Window win; - WinBase *Parent; - WinBase *main_window; - int name_set; - int icon_name_set; - int x; - int y; - int w; - int h; - int bw; - char popped_out; - Pixel BackColor; - Pixel ReliefColor; - Pixel ShadowColor; - Pixel ForeColor; - GC ReliefGC; - GC ShadowGC; - GC ForeGC; - XFontStruct *Font; - void (*CloseWindowAction)(WinBase *which); - - WinBase(WinBase *Parent = NULL, - int width = DEFAULT_WIDTH,int height=DEFAULT_HEIGHT, - int x_loc=DEFAULT_X, int y_loc=DEFAULT_Y); - ~WinBase(); - void Map(); - - /* These routines are called in response to X Events. */ - virtual void DrawCallback(XEvent *event = NULL); - virtual void BPressCallback(XEvent *event = NULL); - virtual void BReleaseCallback(XEvent *event = NULL); - virtual void KPressCallback(XEvent *event = NULL); - virtual void ResizeCallback(int new_w, int new_h, XEvent *event = NULL); - virtual void MotionCallback(XEvent *event = NULL); - - /* These are user-callable routines */ - void SetSize(int width = DEFAULT_WIDTH, int height = DEFAULT_HEIGHT); - void SetPosition(int x = DEFAULT_X, int y = DEFAULT_Y); - void SetGeometry(int new_x, int new_y, int new_w, int new_h, - int min_width=1, int min_height=1, - int max_width=32767, int max_height=32767, - int resize_inc_w=1, int resize_inc_h=1, - int base_width=1, int base_height=1, - int gravity=NorthWestGravity); - void SetCloseWindowAction(void (*CloseWindowAction)(WinBase *which)); - void SetBackColor(char *bcolor); - void SetForeColor(char *fcolor); - void SetBevelWidth(int bw); - void SetFont(char *font); - void PushIn(void); - void PopOut(void); - void MakeTransient(WinBase *TransientFor); - void SetWindowName(char *name); - void SetIconName(char *name); - void SetWindowClass(char *resclass); - void RedrawWindow(int clear); - inline int ScreenWidth(){return XDisplayWidth(dpy,Screen);}; - inline int ScreenHeight(){return XDisplayHeight(dpy,Screen);}; -}; - - -void WinInitialize(char **argv, int argc); -int WinAddInput(int fd, void (*readfunc)(int)); -int WinAddOutput(int fd, void (*writefunc)(int)); -void WinLoop(void); -Pixel GetColor(char *name, Display *dpy, Colormap cmap,int Screen); -void RegisterWindow(Window win, WinBase *a); -void UnregisterWindow(WinBase *thing); -Pixel GetShadow(Pixel background, Display *dpy, int Screen, Colormap cmap) ; -Pixel GetHilite(Pixel background, Display *dpy, int Screen, Colormap cmap) ; - - -#endif - - - diff --git a/app/fvwm/extras/FvwmConfig/WinButton.C b/app/fvwm/extras/FvwmConfig/WinButton.C deleted file mode 100644 index c9bca5013..000000000 --- a/app/fvwm/extras/FvwmConfig/WinButton.C +++ /dev/null @@ -1,66 +0,0 @@ -#include <iostream.h> -#include <stdlib.h> -#include <math.h> -#include "WinButton.h" - -WinButton::WinButton(WinBase *Parent, int new_w,int new_h, - int new_x, int new_y, char *new_label): - WinText(Parent,new_w, new_h, new_x,new_y, new_label) -{ - label = new_label; - action = 0; - momentary = 0; - ToggleAction = NULL; -} - -WinButton::~WinButton() -{ -} - -void WinButton::SetToggleAction(void (*NewToggleAction)(int newstate, - WinButton *which)) -{ - ToggleAction = NewToggleAction; -} - -void WinButton::MakeMomentary() -{ - momentary = 1; -} - -void WinButton::BPressCallback(XEvent *event) -{ - action = popped_out; - popped_out = 0; - RedrawWindow(0); -} - - -void WinButton::BReleaseCallback(XEvent *event) -{ - if((event->xbutton.x > w)||(event->xbutton.x <0)|| - (event->xbutton.y > h)||(event->xbutton.y <0)) - { - popped_out = action; - action = 0; - } - else - { - if(momentary) - { - popped_out = 1; - if(ToggleAction != NULL) - ToggleAction(popped_out,this); - } - else - { - popped_out = 1-action; - if(ToggleAction != NULL) - ToggleAction(popped_out,this); - } - } - RedrawWindow(0); -} - - - diff --git a/app/fvwm/extras/FvwmConfig/WinButton.h b/app/fvwm/extras/FvwmConfig/WinButton.h deleted file mode 100644 index 4bb67df7b..000000000 --- a/app/fvwm/extras/FvwmConfig/WinButton.h +++ /dev/null @@ -1,23 +0,0 @@ -#ifndef winbutton_h -#define winbutton_h - -#include <X11/Xlib.h> -#include "WinText.h" - -class WinButton: public WinText -{ - public: - char momentary; - char action; - void (*ToggleAction)(int newstate, WinButton *which); - - WinButton(WinBase *Parent, int w, int h, int x, int y, char *label); - ~WinButton(); - - void SetToggleAction(void (*ToggleAction)(int newstate, WinButton *which)); - void MakeMomentary(); - void BPressCallback(XEvent *event = NULL); - void BReleaseCallback(XEvent *event = NULL); -}; - -#endif diff --git a/app/fvwm/extras/FvwmConfig/WinColorSelector.C b/app/fvwm/extras/FvwmConfig/WinColorSelector.C deleted file mode 100644 index a8b2dea50..000000000 --- a/app/fvwm/extras/FvwmConfig/WinColorSelector.C +++ /dev/null @@ -1,148 +0,0 @@ -#include <iostream.h> -#include <stdlib.h> -#include <math.h> -#include <X11/Intrinsic.h> -#include "WinBase.h" -#include "WinColorSelector.h" -#include "WinSlider.h" - -static void positioncallback(float loc, WinSlider *which); - -WinColorSelector::WinColorSelector(WinBase *Parent, int new_w,int new_h, - int new_x, int new_y) - : WinBase(Parent,new_w, new_h, new_x,new_y) -{ - int slider_width; - int slider_height; - XColor color; - - - MotionAction = NULL; - slider_width = new_w/2 - 5; - slider_height = (new_h-5)/3 - 5; - if(slider_height < 20) - slider_height = 20; - - red_value = 32000.0; - green_value = 32000.0; - blue_value = 32000.0; - - red_slider = new WinSlider(this,slider_width,slider_height, - 5,5,0.0,65535.0,red_value); - green_slider = new WinSlider(this,slider_width,slider_height, - 5,slider_height+10,0.0,65535.0,green_value); - blue_slider = new WinSlider(this,slider_width,slider_height, - 5,2*slider_height+15,0.0,65535.0,blue_value); - red_slider->SetMotionAction(positioncallback); - green_slider->SetMotionAction(positioncallback); - blue_slider->SetMotionAction(positioncallback); - red_slider->SetBevelWidth(0); - green_slider->SetBevelWidth(0); - blue_slider->SetBevelWidth(0); - colorpanel = new WinBase(this,new_w/2-20,new_h-20,new_w/2+10,10); - colorpanel->PushIn(); - if(!XAllocColorCells(dpy,cmap,False,&private_planes,0,&private_pixel,1)) - { - cerr <<"Couldn't alloc r/w color cell. Trying new map\n"; - cmap = XCopyColormapAndFree(dpy,cmap); - if(!XAllocColorCells(dpy,cmap,False,&private_planes,0,&private_pixel,1)) - { - cerr <<"Couldn't alloc r/w color cell. giving up\n"; - private_pixel = 0; - } - else - { - XSetWindowColormap(dpy,main_window->win,cmap); - } - } - - - XSetWindowBackground(dpy,colorpanel->win,private_pixel); - - if(private_pixel != 0) - { - color.pixel = private_pixel; - color.red = (int)red_value; - color.green = (int)green_value; - color.blue = (int)blue_value; - color.flags = DoRed | DoGreen| DoBlue; - XStoreColor(dpy,cmap,&color); - } - colorpanel->Map(); - red_slider->Map(); - green_slider->Map(); - blue_slider->Map(); -} - -WinColorSelector::~WinColorSelector() -{ - delete red_slider; - delete green_slider; - delete blue_slider; - XFreeColors(dpy,cmap,&private_pixel,1,private_planes); - delete colorpanel; -} - - - - -void WinColorSelector::SetCurrentValue(float new_red, - float new_green, - float new_blue) -{ - red_value = new_red; - green_value = new_green; - blue_value = new_blue; - positioncallback(red_value, red_slider); - positioncallback(green_value, green_slider); - positioncallback(blue_value, blue_slider); - red_slider->SetCurrentValue(red_value); - red_slider->RedrawWindow(1); - green_slider->SetCurrentValue(green_value); - green_slider->RedrawWindow(1); - blue_slider->SetCurrentValue(blue_value); - blue_slider->RedrawWindow(1); - - -} - -void WinColorSelector::SetMotionAction(void (*NewMotionAction) - (float new_red, float new_green, - float new_blue, - WinColorSelector *which)) -{ - MotionAction = NewMotionAction; -} - -static void positioncallback(float loc, WinSlider *which) -{ - XColor color; - WinColorSelector *t; - - t = (WinColorSelector *)(which->Parent); - if(which == t->red_slider) - { - t->red_value = loc; - } - else if(which == t->blue_slider) - { - t->blue_value = loc; - } - else - { - t->green_value = loc; - } - if(t->private_pixel != 0) - { - color.pixel = t->private_pixel; - color.red = (int)t->red_value; - color.green = (int)t->green_value; - color.blue = (int)t->blue_value; - color.flags = DoRed | DoGreen| DoBlue; - XStoreColor(which->dpy,which->cmap,&color); - } - if(t->MotionAction != NULL) - t->MotionAction(t->red_value, t->green_value, - t->blue_value, - (WinColorSelector *)which->Parent); -} diff --git a/app/fvwm/extras/FvwmConfig/WinColorSelector.h b/app/fvwm/extras/FvwmConfig/WinColorSelector.h deleted file mode 100644 index 98f1dcb1f..000000000 --- a/app/fvwm/extras/FvwmConfig/WinColorSelector.h +++ /dev/null @@ -1,35 +0,0 @@ -#ifndef winColorSelector_h -#define winColorSelector_h - -#include <X11/Xlib.h> -#include "WinBase.h" -#include "WinSlider.h" - -class WinColorSelector: public WinBase -{ - public: - float red_value; - float green_value; - float blue_value; - unsigned long private_planes; - unsigned long private_pixel; - WinSlider *red_slider; - WinSlider *green_slider; - WinSlider *blue_slider; - WinBase *colorpanel; - - void (*MotionAction)(float new_red, float new_green, float new_blue, - WinColorSelector *which); - - WinColorSelector(WinBase *Parent, int w, int h, int x, int y); - ~WinColorSelector(); - - void SetCurrentValue(float new_red, float new_green, float new_blue); - void UpdatePosition(int newx, int newy); - void SetMotionAction(void (*MotionAction)(float new_red, float new_green, - float new_blue, - WinColorSelector *which)); - -}; - -#endif diff --git a/app/fvwm/extras/FvwmConfig/WinInput.C b/app/fvwm/extras/FvwmConfig/WinInput.C deleted file mode 100644 index 0a0134ac9..000000000 --- a/app/fvwm/extras/FvwmConfig/WinInput.C +++ /dev/null @@ -1,455 +0,0 @@ -#include <iostream.h> -#include <stdlib.h> -#include <math.h> -#include <string.h> -#include <X11/X.h> -#include <X11/Xlib.h> -#include <X11/Xutil.h> -#include <X11/keysym.h> -#include "WinInput.h" - -static char *lookup_key(XEvent *ev,int *pcount); -void addchar(char c, char *buffer, int bufsize, int &ptr, int& endptr); -#define KBUFSIZE 100 - -WinInput::WinInput(WinBase *Parent, int new_w,int new_h, - int new_x, int new_y, char *initlabel): - WinText(Parent,new_w, new_h, new_x,new_y, NULL) -{ - int i; - - text_offset = bw+4; - NewLineAction = NULL; - if(initlabel) - { - label_size = (int)((strlen(initlabel)+1)/100) + 100; - label = new char[label_size]; - num_chars =strlen(initlabel); - ptr = num_chars; - endptr = num_chars; - strcpy(label,initlabel); - } - else - { - num_chars = 0; - label_size = 100; - label = new char[label_size]; - label[0] = 0; - - ptr = 0; - endptr = 0; - } -} - -WinInput::~WinInput() -{ - delete label; -} - -void WinInput::SetNewLineAction(void (*new_NewLineAction)(int numchars, - char *newdata)) -{ - NewLineAction = new_NewLineAction; -} - -char * WinInput::GetLine() -{ - return label; -} - -void WinInput::SetLabel(char *text) -{ - if(!text) - return; - if(strlen(text) < label_size) - { - strcpy(label,text); - ptr = strlen(text); - endptr = ptr; - num_chars = ptr; - } -} -void WinInput::KPressCallback(XEvent *event) -{ - int count; - char *s; - char *newlabel; - int i; - - s = lookup_key(event,&count); - if(num_chars + count + 1>= label_size) - { - newlabel = new char [label_size + 100]; - if(newlabel == NULL) - { - cerr <<"Can't allocate buffer space\n"; - return; - } - strcpy(newlabel, label); - label_size = label_size + 100; - delete label; - label = newlabel; - } - for(i=0;i<count;i++) - addchar(s[i],label,label_size,ptr,endptr); - - if((s[0] == '\n')||(s[0] == '\r')) - { - if(NewLineAction) - NewLineAction(num_chars,label); - } - num_chars = strlen(label); - RedrawWindow(1); -} - -void WinInput::DrawCallback(XEvent *event) -{ - int xoff,yoff,twidth,twidth2; - GC gc1; - GC gc2; - - WinBase::DrawCallback(event); - - if(((!event)||(event->xexpose.count == 0))&&(label != NULL)) - { - twidth = XTextWidth(Font,label,strlen(label)); - twidth2 = XTextWidth(Font,label,ptr); - if(text_offset + twidth2 > w - bw - 4) - { - text_offset = w - bw - 4 - twidth2; - } - if(text_offset + twidth2 < bw+4) - { - text_offset += bw +4 - (text_offset + twidth2); - } - yoff = h - 1 - (h - Font->ascent - Font->descent)/2 -Font->descent; - XDrawString(dpy,twin,ForeGC, text_offset-bw,yoff-bw,label,strlen(label)); - - xoff = text_offset + XTextWidth(Font,label,ptr)-1; - XDrawLine(dpy,twin,ForeGC,xoff-bw,yoff-Font->ascent-bw, - xoff-bw,yoff+Font->descent - bw); - } -} - -/* Convert the keypress event into a string. - */ -static char *lookup_key(XEvent *ev,int *pcount) -{ - KeySym keysym; - static XComposeStatus compose = {NULL,0}; - int count; - static char kbuf[KBUFSIZE]; - char *s, *c; - int meta; - int app_cur_keys = 0; - int app_kp_keys = 0; - - count = XLookupString(&ev->xkey,kbuf,KBUFSIZE-1,&keysym,&compose); - kbuf[count] = (unsigned char)0; - meta = ev->xkey.state & Mod1Mask; - s = NULL; - - switch(keysym) - { - case XK_Up : - strcpy(kbuf,(app_cur_keys ? "\033OA" : "\033[A")); - count = strlen(kbuf); - break; - case XK_Down : - strcpy(kbuf,app_cur_keys ? "\033OB" : "\033[B"); - count = strlen(kbuf); - break; - case XK_Right : - strcpy(kbuf,app_cur_keys ? "\033OC" : "\033[C"); - count = strlen(kbuf); - break; - case XK_Left : - strcpy(kbuf,app_cur_keys ? "\033OD" : "\033[D"); - count = strlen(kbuf); - break; - case XK_KP_F1 : - strcpy(kbuf,"\033OP"); - count = 3; - break; - case XK_KP_F2 : - strcpy(kbuf,"\033OQ"); - count = 3; - break; - case XK_KP_F3 : - strcpy(kbuf,"\033OR"); - count = 3; - break; - case XK_KP_F4 : - strcpy(kbuf,"\033OS"); - count = 3; - break; - case XK_KP_0 : - strcpy(kbuf,app_kp_keys ? "\033Op" : "0"); - count = strlen(kbuf); - break; - case XK_KP_1 : - strcpy(kbuf,app_kp_keys ? "\033Oq" : "1"); - count = strlen(kbuf); - break; - case XK_KP_2 : - strcpy(kbuf,app_kp_keys ? "\033Or" : "2"); - count = strlen(kbuf); - break; - case XK_KP_3 : - strcpy(kbuf,app_kp_keys ? "\033Os" : "3"); - count = strlen(kbuf); - break; - case XK_KP_4 : - strcpy(kbuf,app_kp_keys ? "\033Ot" : "4"); - count = strlen(kbuf); - break; - case XK_KP_5 : - strcpy(kbuf,app_kp_keys ? "\033Ou" : "5"); - count = strlen(kbuf); - break; - case XK_KP_6 : - strcpy(kbuf,app_kp_keys ? "\033Ov" : "6"); - count = strlen(kbuf); - break; - case XK_KP_7 : - strcpy(kbuf,app_kp_keys ? "\033Ow" : "7"); - count = strlen(kbuf); - break; - case XK_KP_8 : - strcpy(kbuf,app_kp_keys ? "\033Ox" : "8"); - count = strlen(kbuf); - break; - case XK_KP_9 : - strcpy(kbuf,app_kp_keys ? "\033Oy" : "9"); - count = strlen(kbuf); - break; - case XK_KP_Add: - strcpy(kbuf,app_kp_keys ? "\033Ok" : "-"); - count = strlen(kbuf); - break; - case XK_KP_Subtract : - strcpy(kbuf,app_kp_keys ? "\033Om" : "-"); - count = strlen(kbuf); - break; - case XK_KP_Multiply : - strcpy(kbuf,app_kp_keys ? "\033Oj" : "-"); - count = strlen(kbuf); - break; - case XK_KP_Divide : - strcpy(kbuf,app_kp_keys ? "\033Oo" : "-"); - count = strlen(kbuf); - break; - case XK_KP_Separator : - strcpy(kbuf,app_kp_keys ? "\033Ol" : ","); - count = strlen(kbuf); - break; - case XK_KP_Decimal : - strcpy(kbuf,app_kp_keys ? "\033On" : "."); - count = strlen(kbuf); - break; - case XK_KP_Enter : - strcpy(kbuf,app_kp_keys ? "\033OM" : "\r"); - count = strlen(kbuf); - break; - case XK_Home : - strcpy(kbuf,"\033[H"); - count = 3; - break; - case XK_End : - strcpy(kbuf,"\033Ow"); - count = 3; - break; - case XK_F1 : - strcpy(kbuf,"\033[11~"); - count = 5; - break; - case XK_F2 : - strcpy(kbuf,"\033[12~"); - count = 5; - break; - case XK_F3 : - strcpy(kbuf,"\033[13~"); - count = 5; - break; - case XK_F4 : - strcpy(kbuf,"\033[14~"); - count = 5; - break; - case XK_F5 : - strcpy(kbuf,"\033[15~"); - count = 5; - break; - case XK_F6 : - strcpy(kbuf,"\033[17~"); - count = 5; - break; - case XK_F7 : - strcpy(kbuf,"\033[18~"); - count = 5; - break; - case XK_F8 : - strcpy(kbuf,"\033[19~"); - count = 5; - break; - case XK_F9 : - strcpy(kbuf,"\033[20~"); - count = 5; - break; - case XK_F10 : - strcpy(kbuf,"\033[21~"); - count = 5; - break; - case XK_F11 : - strcpy(kbuf,"\033[23~"); - count = 5; - break; - case XK_F12 : - strcpy(kbuf,"\033[24~"); - count = 5; - break; - case XK_F13 : - strcpy(kbuf,"\033[25~"); - count = 5; - break; - case XK_F14 : - strcpy(kbuf,"\033[26~"); - count = 5; - break; - case XK_Help: - case XK_F15: - strcpy(kbuf,"\033[28~"); - count = 5; - break; - case XK_Menu: - case XK_F16: - strcpy(kbuf,"\033[29~"); - count = 5; - break; - case XK_F17 : - strcpy(kbuf,"\033[31~"); - count = 5; - break; - case XK_F18 : - strcpy(kbuf,"\033[32~"); - count = 5; - break; - case XK_F19 : - strcpy(kbuf,"\033[33~"); - count = 5; - break; - case XK_F20 : - strcpy(kbuf,"\033[34~"); - count = 5; - break; - case XK_Find : - strcpy(kbuf,"\033[1~"); - count = 4; - break; - case XK_Insert : - strcpy(kbuf,"\033[2~"); - count = 4; - break; - case XK_Execute : - strcpy(kbuf,"\033[3~"); - count = 4; - break; - case XK_Select : - strcpy(kbuf,"\033[4~"); - count = 4; - break; - case XK_Prior : - strcpy(kbuf,"\033[5~"); - count = 4; - break; - case XK_Next: - strcpy(kbuf,"\033[6~"); - count = 4; - break; -#ifdef BACKSPACE_SUCKS - case XK_BackSpace: - strcpy(kbuf,"\177"); - count = 1; - break; -#endif - } - *pcount = count; - - if(meta &&(count > 0)) - { - for(c = kbuf; c < kbuf+count ; c++) - { - *c = *c | 0x80 ; - } - *(kbuf+count)=0; - } - else - *(kbuf+count) = 0; - return (kbuf); -} - - -void addchar(char c, char *buffer, int bufsize, int &ptr, int& endptr) -{ - int i; - - if((c!= '\n')&&(c!='\r')&&(c!=0)&&(ptr < (bufsize-1))) - { - if(((c=='\b')||(c=='\177'))&&(ptr > 0)) - { - ptr--; - endptr--; - for(i=ptr; i<endptr;i++) - buffer[i] = buffer[i+1]; - } - /* ctrl-b - go back one space*/ - else if((c=='b'-'a'+1)&&(ptr > 0)) - { - ptr--; - } - /* ctrl-d - delete current char, or quit if ptr = endptr=0 */ - else if(c=='d'-'a'+1) - { - if((ptr==endptr)&&(endptr == 0)) - exit(0); - if(endptr > 0) - { - endptr--; - for(i=ptr; i<endptr;i++) - buffer[i] = buffer[i+1]; - } - } - /* ctrl-k - delete current char, to end of line */ - else if(c=='k'-'a'+1) - { - buffer[ptr] = 0; - endptr = ptr; - } - /* ctrl-f - go forward one space*/ - else if((c=='f'-'a'+1)&&(ptr < endptr)) - { - ptr++; - } - /* ctrl-a - go to start of line */ - else if(c=='a'-'a'+1) - { - ptr=0; - } - /* ctrl-e - go to end of line */ - else if(c=='e'-'a'+1) - { - ptr=endptr; - } - else if((c >= ' ')&&(c <= '~'))/* Regular text */ - { - endptr++; - for(i=endptr; i>ptr;i--) - { - buffer[i] = buffer[i-1]; - } - buffer[ptr] = c; - ptr++; - } - if(ptr > endptr)endptr = ptr; - } - buffer[endptr] = 0; -} diff --git a/app/fvwm/extras/FvwmConfig/WinInput.h b/app/fvwm/extras/FvwmConfig/WinInput.h deleted file mode 100644 index a5237072a..000000000 --- a/app/fvwm/extras/FvwmConfig/WinInput.h +++ /dev/null @@ -1,30 +0,0 @@ -#ifndef wininput_h -#define wininput_h - -#include <X11/Xlib.h> -#include "WinText.h" - -#define HISTORY_LENGTH 100 - -class WinInput: public WinText -{ - public: - int text_offset; - int num_chars; - int label_size; - int ptr; - int endptr; - - void (*NewLineAction)(int numchars, char *newdata); - - WinInput(WinBase *Parent, int w, int h, int x, int y, char *initlabel= NULL); - ~WinInput(); - - char *GetLine(void); - void DrawCallback(XEvent *event); - void KPressCallback(XEvent *event = NULL); - void SetNewLineAction(void (*NewLineAction)(int numchars, char *newdata)); - void SetLabel(char *text); -}; - -#endif diff --git a/app/fvwm/extras/FvwmConfig/WinRadioButton.C b/app/fvwm/extras/FvwmConfig/WinRadioButton.C deleted file mode 100644 index 74581de74..000000000 --- a/app/fvwm/extras/FvwmConfig/WinRadioButton.C +++ /dev/null @@ -1,81 +0,0 @@ -#include <iostream.h> -#include <stdlib.h> -#include <math.h> -#include <string.h> -#include "WinRadioButton.h" - -WinRadioButton::WinRadioButton(WinBase *Parent, int new_w,int new_h, - int new_x, int new_y, char *new_label): - WinButton(Parent,new_w, new_h, new_x,new_y, new_label) -{ - int xoff; - - button_size = 10; - if(button_size > w) - button_size = w; - if(button_size > h) - button_size = h; - xoff = button_size+4; - XMoveResizeWindow(dpy,twin,xoff,0,w-xoff,h); -} - -void WinRadioButton::DrawCallback(XEvent *event) -{ - int xoff,yoff,i; - GC gc1; - GC gc2; - int y1,y2; - - if((!event)||(event->xexpose.count == 0)) - { - y1 = (h-button_size)/2-1; - y2 = button_size + (h-button_size)/2-1; - - if(popped_out) - { - gc1 = ShadowGC; - gc2 = ReliefGC; - } - else - { - gc2 = ShadowGC; - gc1 = ReliefGC; - } - for(i=0;i<bw;i++) - { - XDrawLine(dpy,win,gc1,i, y2-i,button_size-1-i,y2-i); - XDrawLine(dpy,win,gc1,button_size-1-i,y1+i,button_size-1-i,y2-i); - XDrawLine(dpy,win,gc2,i, y1+i,button_size-1-i,y1+i); - XDrawLine(dpy,win,gc2,i, y1+i,i, y2-i); - } - if(label != NULL) - { - yoff = h -1 - (h - Font->ascent - Font->descent)/2 -Font->descent; - XDrawString(dpy,twin,ForeGC, 0,yoff,label,strlen(label)); - } - } -} - -void WinRadioButton::ResizeCallback(int new_w, int new_h, XEvent *event) -{ - int xoff; - w = new_w; - h = new_h; - - button_size = 10; - if(button_size > w) - button_size = w; - if(button_size > h) - button_size = h; - - xoff = button_size+4; - XMoveResizeWindow(dpy,twin,xoff,0,w-xoff,h); - RedrawWindow(1); -} - -void WinRadioButton::SetBevelWidth(int new_bw) -{ - bw = new_bw; - RedrawWindow(1); - -} diff --git a/app/fvwm/extras/FvwmConfig/WinRadioButton.h b/app/fvwm/extras/FvwmConfig/WinRadioButton.h deleted file mode 100644 index 564026868..000000000 --- a/app/fvwm/extras/FvwmConfig/WinRadioButton.h +++ /dev/null @@ -1,17 +0,0 @@ -#ifndef winradiobutton_h -#define winradiobutton_h - -#include <X11/Xlib.h> -#include "WinButton.h" - -class WinRadioButton: public WinButton -{ - int button_size; - public: - WinRadioButton(WinBase *Parent, int w, int h, int x, int y, char *label); - void DrawCallback(XEvent *event = NULL); - void ResizeCallback(int new_w, int new_h, XEvent *event); - void SetBevelWidth(int new_bw); -}; - -#endif diff --git a/app/fvwm/extras/FvwmConfig/WinSlider.C b/app/fvwm/extras/FvwmConfig/WinSlider.C deleted file mode 100644 index 34c4e0123..000000000 --- a/app/fvwm/extras/FvwmConfig/WinSlider.C +++ /dev/null @@ -1,148 +0,0 @@ -#include <iostream.h> -#include <stdlib.h> -#include <math.h> -#include <X11/Intrinsic.h> -#include "WinBase.h" -#include "WinSlider.h" - -WinSlider::WinSlider(WinBase *Parent, int new_w,int new_h, - int new_x, int new_y, - float min_val, float max_val, float init_val) - : WinBase(Parent,new_w, new_h, new_x,new_y) -{ - min_value = min_val; - max_value = max_val; - MotionAction = NULL; - current_value = init_val; - - XSetWindowAttributes attributes; /* attributes for creating window */ - unsigned long mask; - - mask = CWEventMask; - attributes.event_mask = ButtonPressMask|ButtonReleaseMask|ButtonMotionMask| - ExposureMask|KeyPressMask|StructureNotifyMask; - XChangeWindowAttributes(dpy,win,mask,&attributes); -} - -WinSlider::~WinSlider() -{ -} - - -void WinSlider::SetMinValue(float new_val) -{ - min_value = new_val; -} - - -void WinSlider::SetMaxValue(float new_val) -{ - max_value = new_val; -} - - -void WinSlider::SetCurrentValue(float new_val) -{ - current_value = new_val; -} - -void WinSlider::SetMotionAction(void (*NewMotionAction)(float new_location, - WinSlider *which)) -{ - MotionAction = NewMotionAction; -} - -void WinSlider::DrawCallback(XEvent *event) -{ - int xoff,yoff,x1,x2,x3,x4,y1,y2,y3,y4; - GC gc1; - GC gc2; - - WinBase::DrawCallback(event); - if((!event)||(event->xexpose.count == 0)) - { - x1 = (int)(w * 0.1); - x2 = (int)(w * 0.9); - y1 = h-15; - y2 = h-11; - XDrawLine(dpy,win,ShadowGC,x1+1,y1,x2-1,y1); - XDrawLine(dpy,win,ShadowGC,x1,y1+1,x1,y2-1); - XDrawLine(dpy,win,ReliefGC,x1+1,y2,x2-1,y2); - XDrawLine(dpy,win,ReliefGC,x2,y1+1,x2,y2-1); - - x3 = (int)((current_value - min_value)/(max_value - min_value) * w * 0.8 - 2 + x1); - x4 = x3+5; - y3 = h-20; - y4 = h-6; - XDrawLine(dpy,win,ShadowGC,x3+1,y3,x4-1,y3); - XDrawLine(dpy,win,ShadowGC,x3,y3+1,x3,y4-1); - XDrawLine(dpy,win,ReliefGC,x3+1,y4,x4-1,y4); - XDrawLine(dpy,win,ReliefGC,x4,y3+1,x4,y4-1); - - if(x3 > x1) - { - XDrawLine(dpy,win,ShadowGC,x1+1,y1+2,x3-1,y1+2); - XDrawLine(dpy,win,ShadowGC,x1+1,y1+3,x3-1,y1+3); - XDrawLine(dpy,win,ShadowGC,x1+1,y1+4,x3-1,y1+4); - } - XClearArea(dpy,win,x3+1,y3+1,x4-x3-1,y4-y3-1,0); - } -} - - - -void WinSlider::BPressCallback(XEvent *event) -{ - int newx, newy; - newx = event->xbutton.x; - newy = event->xbutton.y; - UpdatePosition(newx,newy); -} - -void WinSlider::BReleaseCallback(XEvent *event) -{ - int newx, newy; - - newx = event->xbutton.x; - newy = event->xbutton.y; - - UpdatePosition(newx,newy); -} -void WinSlider::MotionCallback(XEvent *event) -{ - int newx, newy; - newx = event->xmotion.x; - newy = event->xmotion.y; - - UpdatePosition(newx,newy); -} - - -void WinSlider::UpdatePosition(int newx,int newy) -{ - int x3,x4,y3,y4,x1,y1; - - x1 = (int)(w * 0.1); - x3 = (int)((current_value - min_value)/(max_value - min_value) * w * 0.8 - - 2 + x1); - x4 = x3+5; - y3 = h-20; - y4 = h-6; - y1 = h-15; - XClearArea(dpy,win,x3,y3,x4-x3+1,y4-y3+1,0); - XClearArea(dpy,win,x1,y1+2,x3-x1,3,0); - - - current_value = (max_value - min_value)*(newx - w*0.1)/(w*0.8) + min_value; - if(current_value < min_value) - current_value = min_value; - if(current_value > max_value) - current_value = max_value; - - - DrawCallback(NULL); - if(MotionAction != NULL) - { - MotionAction(current_value, this); - } -} diff --git a/app/fvwm/extras/FvwmConfig/WinSlider.h b/app/fvwm/extras/FvwmConfig/WinSlider.h deleted file mode 100644 index 94ede90ec..000000000 --- a/app/fvwm/extras/FvwmConfig/WinSlider.h +++ /dev/null @@ -1,33 +0,0 @@ -#ifndef winslider_h -#define winslider_h - -#include <X11/Xlib.h> -#include "WinBase.h" - -class WinSlider: public WinBase -{ - public: - float min_value; - float max_value; - float current_value; - - void (*MotionAction)(float new_location, WinSlider *which); - - WinSlider(WinBase *Parent, int w, int h, int x, int y, - float min_val=0, float max_val=100, - float init_val=50); - ~WinSlider(); - - void SetMinValue(float new_val); - void SetMaxValue(float new_val); - void SetCurrentValue(float new_val); - void UpdatePosition(int newx, int newy); - void SetMotionAction(void (*NewMotionAction)(float new_location, - WinSlider *which)); - void DrawCallback(XEvent *event = NULL); - void BPressCallback(XEvent *event = NULL); - void BReleaseCallback(XEvent *event = NULL); - void MotionCallback(XEvent *event = NULL); -}; - -#endif diff --git a/app/fvwm/extras/FvwmConfig/WinText.C b/app/fvwm/extras/FvwmConfig/WinText.C deleted file mode 100644 index c17d92eea..000000000 --- a/app/fvwm/extras/FvwmConfig/WinText.C +++ /dev/null @@ -1,93 +0,0 @@ -#include <iostream.h> -#include <stdlib.h> -#include <math.h> -#include <string.h> -#include "WinBase.h" -#include "WinButton.h" - -WinText::WinText(WinBase *Parent, int new_w,int new_h, - int new_x, int new_y, char *new_label): - WinBase(Parent,new_w, new_h, new_x,new_y) -{ - XSetWindowAttributes attributes; /* attributes for creating window */ - unsigned long mask; - - label = new_label; - mask = CWBackPixel | CWEventMask; - attributes.background_pixel = BackColor; - attributes.event_mask = ExposureMask; - twin = XCreateWindow(dpy,win,bw,bw,w-2*bw,h-2*bw,0, - CopyFromParent,InputOutput,CopyFromParent, - mask,&attributes); - XMapWindow(dpy,twin); - RegisterWindow(twin,this); -} - -WinText::~WinText() -{ -} - -void WinText::SetLabel(char *new_label) -{ - label = new_label; -} - - - -void WinText::DrawCallback(XEvent *event) -{ - int xoff,yoff; - GC gc1; - GC gc2; - - WinBase::DrawCallback(event); - if(((!event)||(event->xexpose.count == 0))&&(label != NULL)) - { - xoff = (w - XTextWidth(Font,label,strlen(label)))/2; - yoff = h - 1 - (h - Font->ascent - Font->descent)/2 -Font->descent; - XDrawString(dpy,twin,ForeGC, xoff-bw,yoff-bw,label,strlen(label)); - } -} - -void WinText::ResizeCallback(int new_w, int new_h, XEvent *event) -{ - w = new_w; - h = new_h; - XResizeWindow(dpy,twin,new_w-2*bw,new_h-2*bw); - RedrawWindow(1); -} - -void WinText::SetBevelWidth(int new_bw) -{ - bw = new_bw; - XMoveResizeWindow(dpy,twin,bw,bw,w-2*bw,h-2*bw); - RedrawWindow(1); -} - - -void WinText::SetBackColor(char *newcolor = DEFAULT_BACKCOLOR) -{ - XSetWindowAttributes attributes; /* attributes for creating window */ - unsigned long mask; - - mask = CWBackPixel; - attributes.background_pixel = BackColor; - XChangeWindowAttributes(dpy,twin, mask,&attributes); - XClearWindow(dpy,twin); - XChangeWindowAttributes(dpy,win, mask,&attributes); - XClearWindow(dpy,win); -} - -void WinText::RedrawWindow(int clear) -{ - if(clear) - { - XClearWindow(dpy,win); - XClearWindow(dpy,twin); - } - DrawCallback(NULL); -} - - - - diff --git a/app/fvwm/extras/FvwmConfig/WinText.h b/app/fvwm/extras/FvwmConfig/WinText.h deleted file mode 100644 index b5b0e2498..000000000 --- a/app/fvwm/extras/FvwmConfig/WinText.h +++ /dev/null @@ -1,24 +0,0 @@ -#ifndef wintext_h -#define wintext_h - -#include <X11/Xlib.h> -#include "WinBase.h" - -class WinText: public WinBase -{ - public: - char *label; - Window twin; - - WinText(WinBase *Parent, int w, int h, int x, int y, char *label); - ~WinText(); - - void SetLabel(char *new_label); - void SetBackColor(char *newcolor); - void DrawCallback(XEvent *event = NULL); - virtual void ResizeCallback(int new_w, int new_h, XEvent *event = NULL); - void SetBevelWidth(int bw); - void RedrawWindow(int clear); -}; - -#endif diff --git a/app/fvwm/extras/FvwmConfig/dead.c b/app/fvwm/extras/FvwmConfig/dead.c deleted file mode 100644 index 923f5e03b..000000000 --- a/app/fvwm/extras/FvwmConfig/dead.c +++ /dev/null @@ -1,19 +0,0 @@ -#include <signal.h> -#include <stdlib.h> - -/*********************************************************************** - * - * Procedure: - * SIGPIPE handler - SIGPIPE means fvwm is dying - * - ***********************************************************************/ -void DeadPipe(int nonsense) -{ - exit(0); -} - - -void SetupPipeHandler(void) -{ - signal(SIGPIPE,DeadPipe); -} diff --git a/app/fvwm/extras/FvwmConsole/.fvwm2rc.sample b/app/fvwm/extras/FvwmConsole/.fvwm2rc.sample deleted file mode 100644 index 0a543b941..000000000 --- a/app/fvwm/extras/FvwmConsole/.fvwm2rc.sample +++ /dev/null @@ -1,24 +0,0 @@ -# open big xterm -*FvwmConsoleSubst '^bigx' 'Exec xterm -g 120x60+0+0 -fn 10x20 -fg black -bg lemonchiffon' - -*FvwmConsoleSubst '^fb' 'FvwmButtons' - -# jump to desk 0, page 0 <argument>, and focus -*FvwmConsoleSubst '^g\s*(\d+)' 'Desk 0 0\nGotoPage 0 $1 \nFocus' - -# open xterm with console -*FvwmConsoleSubst '^XC' 'Exec xterm -g 40x6-0+200 -fn 7x14 -C &' - -# open xterm with console and FvwmConsole - XCF at the begining -*FvwmConsoleSubst '^XCF' 'FvwmConsole -C -e /usr/lib/X11/fvwm2/FvwmConsoleC.pl' - -# list functions -*FvwmConsoleKey \mc list_func - -# execute last command - meta cntrol a -*FvwmConsoleKey \m\ca 'prev_line(); enter();' - -# some common style -# substitute BARE with non-word char surrounding it to bare window style -*FvwmConsoleSubst '(\W)BARE($|\W)' '$1NoTitle, NoHandles, Sticky, WindowListSkip, Borderwidth 0 ' - diff --git a/app/fvwm/extras/FvwmConsole/Changes b/app/fvwm/extras/FvwmConsole/Changes deleted file mode 100644 index 7e4082e3d..000000000 --- a/app/fvwm/extras/FvwmConsole/Changes +++ /dev/null @@ -1,51 +0,0 @@ -Changes on 1.3 --- 02/05/97 -- --- 08/22/97 -- 1.3.1 --- 08/28/97 -- 1.3.2 - - 1. moved socket in home directory from /tmp in order to avoid - remote chance of connecting to somebody else's fvwm (this - could be interesting). - 2. command history is kept in a file from the previous session. - 3. The maximum command length is now 1000, up from 255. - This should be used with fvwm2 with this limit (greater than - but not equal to 2.0.45). Long module path and such can be - input now. - 4. FvwmConsoleC.pl (1.2) looks slightly smoother. (08/22/97) - - With patch from Paul D Smith - - 1. changed ADD_INCLUDE variable to EXTRA_INCLUDES in Imakefile. - 2. changed the man page. It makes sense now! - 3. added Tab key binding as tab insertion to make cut-and- - paste easier. - 4. Handles backslashed command lines. Long lines are hard to - type and hard to read. - - With patch from Al Bolduc (08/28/97) - - 1. runs on BSD/OS which has another element in the sockaddr_un - structure. - -Changes on 1.2 --- 08/22/96 --- - - 1. Deleted unneccessary defines and headers. The less, the better. - 2. Changed maximum command size to 255 to prevent module - termination. - 3. One less process. The less , the better. - -Changes on 1.1 - - 1. Fixed the bug that didn't allocate enough memory for the child - process arguments. - - 2. Get module configuration from Fvwm and pass them to the - client. - -Changes on FvwmConsoleC.pl 1.1 - - 1. Added substitution and other editing functions. - - 2. Keybindings can be configured through module configuration. - diff --git a/app/fvwm/extras/FvwmConsole/FvwmConsole.1 b/app/fvwm/extras/FvwmConsole/FvwmConsole.1 deleted file mode 100644 index fce734968..000000000 --- a/app/fvwm/extras/FvwmConsole/FvwmConsole.1 +++ /dev/null @@ -1,145 +0,0 @@ -.\" t -.\" @(#)FvwmConsole.1x 7/16/96 -.TH FvwmConsole 1x "July 16 1996" -.UC - -.SH NAME -FvwmConsole \- an FVWM command input interface - -.SH SYNOPSIS -FvwmConsole is spawned by fvwm, so no command line invocation will work. - -.SH DESCRIPTION -FvwmConsole allows the user to type fvwm configuration commands -interactively, and have them executed immediately. This tool is -particularly useful for testing new configuration ideas, or for -implementing temporary changes to your environment. - -.SH INVOCATION -FvwmConsole must be spawned as a module by fvwm. FvwmConsole takes all -\fIxterm\fP(1) options, except -name and -title. -.PP -FvwmConsole can be invoked by inserting the line 'Module FvwmConsole' in -the .fvwm2rc file. This can be placed on a line by itself, if -FvwmConsole is to be spawned during fvwm's initialization, or can be -bound to a menu or mouse button or keystroke to invoke it later. Fvwm -will search directory specified in the ModulePath configuration option -to attempt to locate FvwmConsole. - -.SH CONFIGURATION OPTIONS -FvwmConsole uses \fIxterm\fP(1). All resources set for xterm are -inherited unless overridden by command line options. - -.RS -Module FvwmConsole -g 40x10 -fg black -bg green3 -.RE - -The option -e can be used to choose an alternate front-end: - -.RS -Module FvwmConsole -e /usr/X11/lib/fvwm2/FvwmConsoleC.pl -.RE - -(see \fIFvwmConsoleC.pl\fP(1)). -.PP -Also X resources can be set in your ~/.Xdefaults file: - -.RS -FvwmConsole*VT100*geometry: 40x4 -.br -FvwmConsole*font: 7x14 -.RE - - -.SH "COMMAND EDITING" - -There are a few options. If the GNU readline library is available, it -can be used. -.PP -If Perl5 is installed, FvwmConsoleC.pl can be used as a command editor. -This can be accomplished by either copying FvwmConsoleC.pl -to fvwmlib directory as FvwmConsoleC or -invoking FvwmConsole with -e option. -For example: - -.RS -Module FvwmConsole -e /usr/lib/X11/fvwm2/FvwmConsoleC.pl -.RE - -If neither one is installed, a simple input reading function which -doesn't have editing capabilities is used. -.P -GNU readline and FvwmConsoleC.pl have some frequent used commands -in common as default. -These commands are similar to emacs. -For more details, refer GNU readline man and info pages, and -FvwmConsoleC.pl man page. - -.RS -.PD 0 -.TP 8 -Cntl-A -- beginning of line -.TP -Cntl-B -- previous char -.TP -Cntl-D -- delete char -.TP -Cntl-E -- end of line -.TP -Cntl-F -- next char -.TP -Cntl-H -- backspace -.TP -Cntl-K -- erase to the end of line -.TP -Cntl-N -- next line -.TP -Cntl-P -- previous line -.TP -Cntl-R -- search reverse -.TP -Cntl-U -- delete line -.TP -Meta-B -- previous word -.TP -Meta-F -- next word -.TP -Esc < -- beginning of history -.TP -Esc > -- end of history -.RE -.PD - -.SH EXITING - -FvwmConsole can be stopped by entering the command "killme" at the command -line, or the EOF character (usually CTRL-D). -.PP -\fBNote!\fP Do not use the "quit" command, as this is an fvwm builtin: -typing "quit" at the FvwmConsole command line will cause fvwm to exit. - -.SH COPYRIGHTS -Copyright 1996, Toshi Isogai. No guarantees or warranties are provided. -Use this program at your own risk. Permission to use this program for -any purpose is given, as long as the copyright is kept intact. - -.SH SEE ALSO -\fIxterm\fP(1), \fIFvwmConsoleC.pl\fP(1), GNU Readline library - -.SH AUTHOR -Toshi Isogai diff --git a/app/fvwm/extras/FvwmConsole/FvwmConsole.c b/app/fvwm/extras/FvwmConsole/FvwmConsole.c deleted file mode 100644 index 75923f6df..000000000 --- a/app/fvwm/extras/FvwmConsole/FvwmConsole.c +++ /dev/null @@ -1,246 +0,0 @@ -/* - Fvwm command input interface. - - Copyright 1996, Toshi Isogai. No guarantees or warantees or anything - are provided. Use this program at your own risk. Permission to use - this program for any purpose is given, - as long as the copyright is kept intact. -*/ - -#include "FvwmConsole.h" - -#define MYVERSION "1.3" - -char *MyName; - -int Fd[2]; /* pipe to fvwm */ -int Ns; /* socket handles */ -char Name[80]; /* name of this program in executable format */ -char *S_name; /* socket name */ - -void server( void ); -void DeadPipe( int ); -void CloseSocket(); -void ErrMsg( char *msg ); -void SigHandler( int ); - -int main(int argc, char *argv[]){ - char *tmp, *s; - char client[120]; - char **eargv; - int i,j,k; - char *xterm_a[] = { "-title", Name, "-name", Name, "-e", NULL, NULL }; - int clpid; - - /* Why is this not just put in the initializer of xterm_a? - Apparently, it is a non-standard extension to use a non-constant address (of client) - in an initializer (of xterm_a). */ - xterm_a[5] = client; - - /* Save the program name - its used for error messages and option parsing */ - tmp = argv[0]; - - s=strrchr(argv[0], '/'); - if (s != NULL) - tmp = s + 1; - - strcpy( Name, tmp ); - - MyName = safemalloc(strlen(tmp)+2); - strcpy(MyName,"*"); - strcat(MyName, tmp); - - /* construct client's name */ - strcpy( client, argv[0] ); - strcat( client, "C" ); - - if(argc < FARGS) { - fprintf(stderr,"%s Version %s should only be executed by fvwm!\n",MyName, - MYVERSION); - exit(1); - } - - if( ( eargv =(char **)safemalloc((argc+12)*sizeof(char *)) ) == NULL ) { - ErrMsg( "allocation" ); - } - - /* copy arguments */ - eargv[0] = XTERM; - j = 1; - for ( i=FARGS ; i<argc; i++ ) { - if( !strcmp ( argv[i], "-e" ) ) { - i++; - break; - } else { - eargv[j++] = argv[i]; - } - } - - for ( k=0 ; xterm_a[k] != NULL ; j++, k++ ) { - eargv[j] = xterm_a[k]; - } - - /* copy rest of -e args */ - for( ; i<argc; i++, j++ ) { - eargv[j-1] = argv[i]; - } - - eargv[j] = NULL; - - /* Dead pipes mean fvwm died */ - signal (SIGPIPE, DeadPipe); - signal (SIGINT, SigHandler); - signal (SIGQUIT, SigHandler); - - Fd[0] = atoi(argv[1]); - Fd[1] = atoi(argv[2]); - - /* launch xterm with client */ - clpid = fork(); - if( clpid < 0) { - ErrMsg("client forking"); - }else if(clpid == 0 ) { - execvp( *eargv, eargv ); - ErrMsg("exec"); - } - - server(); -return (0); -} - -/*********************************************************************** - * signal handler - ***********************************************************************/ -void DeadPipe( int dummy ) { - fprintf(stderr,"%s: dead pipe\n", Name); - CloseSocket(); - exit(0); -} - -void SigHandler(int dummy) { - CloseSocket(); - exit(1); -} - -/*********************************************************/ -/* close sockets and spawned process */ -/*********************************************************/ -void CloseSocket() { - send(Ns, C_CLOSE, strlen(C_CLOSE), 0); - close(Ns); /* remove the socket */ - unlink( S_name ); - -} - -/*********************************************************/ -/* setup server and communicate with fvwm and the client */ -/*********************************************************/ -void server ( void ) { - struct sockaddr_un sas, csas; - int len, clen; /* length of sockaddr */ - char buf[MAX_COMMAND_SIZE]; /* command line buffer */ - char *tline; - char ver[40]; - fd_set fdset; - unsigned long *body; - unsigned long header[HEADER_SIZE]; - char *home; - int s; - int msglen; - - /* make a socket */ - if( (s = socket(AF_UNIX, SOCK_STREAM, 0 )) < 0 ) { - ErrMsg( "socket"); - exit(1); - } - - /* name the socket */ - home = getenv("HOME"); - S_name = safemalloc( strlen(home)+ 16); - strcpy(S_name,home); - strcat(S_name,S_NAME); - - sas.sun_family = AF_UNIX; - strcpy( sas.sun_path, S_name ); - - /* bind the above name to the socket */ - /* first, erase the old socket */ - unlink( S_name ); - len = sizeof(sas) - sizeof( sas.sun_path) + strlen( sas.sun_path ); - - if( bind(s, (struct sockaddr *)&sas,len) < 0 ) { - ErrMsg( "bind" ); - exit(1); - } - - /* listen to the socket */ - /* set backlog to 5 */ - if ( listen(s,5) < 0 ) { - ErrMsg( "listen" ); - exit(1); - } - - /* accept connections */ - clen = sizeof(csas); - if(( Ns = accept(s, (struct sockaddr *)&csas, &clen)) < 0 ) { - ErrMsg( "accept"); - exit(1); - } - - /* send config lines to Client */ - tline = NULL; - send(Ns, C_BEG, strlen(C_BEG), 0); - GetConfigLine(Fd,&tline); - while(tline != NULL) { - if(strlen(tline)>1) { - send(Ns, tline, strlen(tline),0); - } - GetConfigLine(Fd,&tline); - } - send(Ns, C_END, strlen(C_END), 0); - strcpy( ver, MyName); - strcat( ver, " Ver. " ); - strcat( ver, MYVERSION); - strcat( ver, "\n" ); - send(Ns, ver, strlen(ver), 0 ); - - while (1){ - FD_ZERO(&fdset); - FD_SET(Ns, &fdset); - FD_SET(Fd[1], &fdset); - - select(FD_SETSIZE,SELECT_TYPE_ARG234 &fdset, 0, 0, NULL); - if (FD_ISSET(Fd[1], &fdset)){ - if( ReadFvwmPacket(Fd[1],header,&body) > 0) { - if(header[1] == M_PASS) { - msglen = strlen((char *)&body[3]); - if( msglen > MAX_MESSAGE_SIZE-2 ) { - msglen = MAX_MESSAGE_SIZE-2; - } - send( Ns, (char *)&body[3], msglen, 0 ); - } - free(body); - } - } - if (FD_ISSET(Ns, &fdset)){ - if( recv( Ns, buf, MAX_COMMAND_SIZE,0 ) == 0 ) { - /* client is terminated */ - break; - } - - /* process the own unique commands */ - SendText(Fd,buf,0); /* send command */ - } - } - CloseSocket(); - exit(0); -} - -/******************************************/ -/* print error message on stderr and exit */ -/******************************************/ -void ErrMsg( char *msg ) { - fprintf( stderr, "%s server error in %s, errno %d\n", Name, msg, errno ); - CloseSocket(); - exit(1); -} diff --git a/app/fvwm/extras/FvwmConsole/FvwmConsole.h b/app/fvwm/extras/FvwmConsole/FvwmConsole.h deleted file mode 100644 index 8beeeea9e..000000000 --- a/app/fvwm/extras/FvwmConsole/FvwmConsole.h +++ /dev/null @@ -1,50 +0,0 @@ -#include "config.h" - -#include <sys/types.h> - -#if HAVE_SYS_BSDTYPES_H -#include <sys/bsdtypes.h> -#endif - -#if HAVE_SYS_SELECT_H -#include <sys/select.h> -#endif - -#include <unistd.h> -#include <stdlib.h> -#include <stdio.h> -#include <sys/stat.h> -#include <fcntl.h> -#include <sys/time.h> -#include <sys/socket.h> -#include <sys/un.h> -#include <signal.h> -#include <errno.h> -#include <string.h> - -#include "fvwmlib.h" -#include "../../fvwm/module.h" - -#define S_NAME "/.FvConSocket" -/* Prompts for readline support */ -#define PS1 "" -#define PS2 ">" - -#define HISTSIZE 50 /* readline history file size */ -#define HISTFILE "/.FvConHist" - -/* #define M_PASS M_ERROR */ -#define M_PASS M_ERROR - -/* number of default arguments when invoked from fvwm */ -#define FARGS 6 - -#define XTERM "xterm" - -/* message to client */ -#define C_BEG "_C_Config_Line_Begin_\n" -#define C_END "_C_Config_Line_End_\n" -#define C_CLOSE "_C_Socket_Close_\n" - -#define MAX_COMMAND_SIZE 1000 -#define MAX_MESSAGE_SIZE 260 diff --git a/app/fvwm/extras/FvwmConsole/FvwmConsoleC.c b/app/fvwm/extras/FvwmConsole/FvwmConsoleC.c deleted file mode 100644 index 8ec790da6..000000000 --- a/app/fvwm/extras/FvwmConsole/FvwmConsoleC.c +++ /dev/null @@ -1,114 +0,0 @@ -#include "FvwmConsole.h" - -int s; /* socket handle */ -FILE *sp; -char *name; /* name of this program at executing time */ -char *get_line(); - - -/******************************************/ -/* close socket and exit */ -/******************************************/ -void sclose () { - fclose(sp); - exit(0); -} - -/************************************/ -/* print error message on stderr */ -/************************************/ -void ErrMsg( char *msg ) { - fprintf( stderr, "%s error in %s\n", name , msg ); - fclose(sp); - exit(1); -} - - -/*******************************************************/ -/* setup socket. */ -/* send command to and receive message from the server */ -/*******************************************************/ -int main ( int argc, char *argv[]) { - char *cmd; - unsigned char data[MAX_MESSAGE_SIZE]; - int len; /* length of socket address */ - struct sockaddr_un sas; - int clen; /* command length */ - int pid; /* child process id */ - char *home; - char *s_name; - - signal (SIGINT, sclose); - signal (SIGQUIT, sclose); - - name=strrchr(argv[0], '/'); - if (name != NULL) { - name++; - } - - /* make a socket */ - home = getenv("HOME"); - s_name = safemalloc( strlen(home)+ 14); - strcpy(s_name,home); - strcat(s_name,S_NAME); - if( (s = socket(AF_UNIX, SOCK_STREAM, 0)) < 0 ) { - ErrMsg ("socket"); - } - - /* name the socket and obtain the size of it*/ - sas.sun_family = AF_UNIX; - strcpy( sas.sun_path, s_name ); - len = sizeof(sas) - sizeof( sas.sun_path) + strlen( sas.sun_path ); - - if( connect( s, (struct sockaddr *)&sas, len )< 0 ) { - ErrMsg( "connect" ); - } - - sp = fdopen( s, "r" ); - - pid = fork(); - if( pid == -1 ) { - ErrMsg( "fork"); - } - if( pid == 0 ) { - /* loop of get user's command and send it to server */ - while( 1 ) { - - cmd = get_line(); - if (cmd == NULL) { - break; - } - - clen = strlen(cmd); - if( clen == 1 ) { - continue; /* empty line */ - } - - /* send the command including null to the server */ - send( s, cmd, strlen(cmd)+1, 0 ); - - } - kill( getppid(), SIGKILL ); - sclose(); - } - while( fgets( data, MAX_MESSAGE_SIZE, sp ) ) { - /* get the response */ - /* ignore config lines */ - if( !strcmp( data, C_BEG ) ) { - while( fgets( data, MAX_MESSAGE_SIZE, sp) ) { - if( *data == '\0' || !strcmp(data,C_END) ) { - break; - } - } - if( *data != '\0' ) { - continue; - } - } - if( *data == '\0' ) { - break; - } - printf( "%s",data ); - } -return (0); -} - diff --git a/app/fvwm/extras/FvwmConsole/FvwmConsoleC.pl b/app/fvwm/extras/FvwmConsole/FvwmConsoleC.pl deleted file mode 100644 index 1a3e352d8..000000000 --- a/app/fvwm/extras/FvwmConsole/FvwmConsoleC.pl +++ /dev/null @@ -1,869 +0,0 @@ -#!/usr/local/bin/perl -# $0 - Front end of FvwmConsole -# FvwmConsole server must be running - -# Copyright 1997, Toshi Isogai -# You may use this code for any purpose, as long as the original -# copyright remains in the source code and all documentation - -require 5.002; -use Socket; - -$ESC = "\e"; -$HISTFILE = "$ENV{HOME}/.FvConHist0"; -$SOCKET_NAME = "$ENV{HOME}/.FvConSocket"; -$VERSION = '1.2'; - - - -if( -c "/dev/console" ) { - close STDERR; - open (STDERR,">/dev/console") || die "/dev/console: ",$!; -} - -($Filename = $0) =~ s@.*/@@; -($Sname = $Filename) =~ s/C(\.pl)?$//; - - -$tty = `tty`; -$tty =~ s/\n//; -$org_stty = &stty('-g'); - -@Hist = (); -@Histall = (); -$HIST_SIZE = 50; -$MAX_COMMAND_SIZE = 1000; - -main(); -exit; - - -sub main::default_key { -#------------ default key bindings ---------- -# these can be overidden by config lines -# -# It may need these lines in .Xdefault to make home and end key work -# FvwmConsole*VT100*Translations: #override \n \ -# <Key> Home: string(0x1b) string("[1~" ) \n \ -# <Key> Delete: string(0x1b) string("[3~" ) \n -# <Key> End: string(0x1b) string("[4~" ) \n - - package User; - - $ESC = $main::ESC; - $Key{"$ESC\[1~"} = 'bol'; #home Key - $Key{"$ESC\[3~"} = 'del_char'; - $Key{"$ESC\[4~"} = 'eol'; #end key - $Key{"$ESC\[A"}= 'prev_line'; #up - $Key{"$ESC\[B"}= 'next_line'; #down - $Key{"$ESC\[C"}= 'next_char'; #right - $Key{"$ESC\[D"}= 'prev_char'; #left - $Key{"${ESC}f"}= 'next_word'; - $Key{"${ESC}b"} = 'prev_word'; - - $Key{"$ESC"} = 'prefix'; - $Key{"\cD"} = 'del_char'; - $Key{"\c?"} = 'del_char'; - $Key{"\cH"} = 'bs'; - $Key{"\cq"} = 'quote'; - $Key{"\cU"} = 'del_line'; - $Key{"\cs"} = 'search'; - $Key{"\cR"} = 'search_rev'; - $Key{"\cK"} = 'del_forw_line'; - $Key{"\ca"} = 'bol'; - $Key{"\ce"} = 'eol'; - $Key{"\cp"} = 'prev_line'; - $Key{"\cn"} = 'next_line'; - $Key{"\cf"} = 'next_char'; - $Key{"\cb"} = 'prev_char'; - $Key{"\cx"} = 'prefix'; - $Key{"\cx\cb"} = 'bind'; - $Key{"\cx\ck"} = 'cancel'; - $Key{"\cw"} = 'del_back_word'; - $Key{"\x8d"} = 'enter_wo_subst'; # alt enter - $Key{"\n"} = 'enter'; - $Key{"\ci"} = 'ins_char (" ")'; - $Key{"\xE4"} = 'del_forw_word'; # alt_d - $Key{"\xE6"} = 'next_word'; # alt_f - $Key{"\xEB"} = 'bind'; # alt_k - $Key{"\xEC"} = 'list_func'; # alt_k - $Key{"\xF3"} = 'subst'; # alt_s - $Key{"\xF4"} = 'termsize'; # alt_t - $Key{"\xE2"} = 'prev_word'; # alt_b - $Key{"\xb1"} = 'ins_nth_word(1)'; - $Key{"\xb2"} = 'ins_nth_word(2)'; - $Key{"\xb3"} = 'ins_nth_word(3)'; - $Key{"\xb4"} = 'ins_nth_word(4)'; - $Key{"\xb5"} = 'ins_nth_word(5)'; - $Key{"\xb6"} = 'ins_nth_word(6)'; - $Key{"\xb7"} = 'ins_nth_word(7)'; - $Key{"\xb8"} = 'ins_nth_word(8)'; - $Key{"\xb9"} = 'ins_nth_word(9)'; - $Key{"${ESC}b"} = 'prev_word'; # esc_b - $Key{"${ESC}f"} = 'next_word'; # esc_f - $Key{"${ESC}>"} = 'eoh_ign_mode'; # end of history, ignore mode - $Key{"${ESC}<"} = 'boh_ign_mode'; # begining of history, ignore mode - $Key{"${ESC}."} = 'ins_last_word'; - - $Key{EOF} = "\cD"; #eof work only when line is empty - $Subst{'^#.*'} = ''; # ignore comments -#---------------- end of key binding ----------------- - -#---------------- Terminal control ------------------- - $TERM_EEOL = "$ESC\[K"; # erase to end of line - $TERM_RIGHT = "$ESC\[C"; # move cursor right - $TERM_LEFT = "$ESC\[D"; # move cursor left - $TERM_DOWN = "$ESC\[B"; # move cursor up - $TERM_UP = "$ESC\[A"; # move cursor up -} - -sub read_config { - my( $hash,@keys,$key,@vals,$val); - while(<SH>) { - last if $_ eq "_C_Config_Line_End_\n"; - next if !s/^\*${Sname}//; - ($hash,@keys[0..3],@vals) = - (/ - ^(\w+)\s+ #hash name - ('([^\']*)'|"([^\"]*)"|(\S+)) #key quoted or bare word - (\s+('([^\']*)'|"([^\"]*)"|(\S+)))? #value - /x); - $key = $keys[1].$keys[2].$keys[3]; - $val = $vals[2].$vals[3].$vals[4]; - - if( defined %{$User::{$hash}} ) { - User::bind( $hash, $key, $val ); - } - } -} - -sub main { - my($sin, $cmd); - my($name, $ppid, $cpid); - - socket(SH, PF_UNIX, SOCK_STREAM, 0) || die "$! "; - $sun = sockaddr_un($SOCKET_NAME); - connect(SH,$sun) || die "$sun:", $!; - print "$Filename $VERSION\n"; - default_key(); - read_config(); #must be done before forking - - $ppid = $$; - if( $cpid = fork() ) { - &input_open($tty,$tty,$HISTFILE,1); - while( $cmd = &input('','',1) ) { - next if $cmd =~/^\s*$/; - last if $cmd eq "\0"; - if( length($cmd) > $MAX_COMMMAND_SIZE ) { - print User::OUT "\a"; - } - send( SH, $cmd."\0", 0 ); - } - dokill( $cpid ); - } else { - #child handles output - while(<SH>) { - last if $_ eq ''; - if( $_ eq "_C_Socket_Close_\n" ) { - dokill( $ppid ); - } - print; - } - dokill( $ppid ); - } - -} - -sub dokill { - my($pid) = @_; - unlink SH; - kill -9,$pid if $pid; - exit; -} - -sub input_open { - # arg0 input device - # arg1 output device - # arg2 history file - # arg3 key selection - bit0 - # bit1 - # bit2 return undef esc code as it is - - ($Dev_in,$Dev_out,$File,$Ksel) = @_; - if( !$Dev_in ) {$Dev_in = $tty;} - elsif( $Dev_in eq "not a tty" ) { $Dev_in = $ENV{'TTY'};} - if( !$Dev_out ) {$Dev_out = $tty;} - if( !$File ) { $File = '/tmp/input.tmp';} - open(User::IN,"<$Dev_in") || die "open in at input_open '$Dev_in' $!\n"; - open(User::OUT,">$Dev_out") || die "can't open input at 'input_open' $!\n"; - select((select(User::OUT), $| = 1)[0]); # unbuffer pipe - if( defined $File ) { - if( open(INITF,"$File") ) { - do "$File"; - @Histall=<INITF>; close(INITF); $#Histall--; - }else{ - print STDERR "Can't open history file $File\n"; - } - } -} - -sub input_close { - close(User::IN); - close(User::OUT); -} - -sub getchar { - # get char from input - # if esc , check for more char - my($c,$s,$rin,$rout); - sysread(User::IN, $c, 1); - if( $c ne $ESC ) { - $s = $c; - }else { - $rin = ''; - vec( $rin, fileno(User::IN),1) = 1; - $n= select( $rout=$rin, undef, undef, 0.1 ); - $s = $ESC; - if($n) { - while($n= select( $rout=$rin, undef, undef, 0.1 ) ) { - sysread( User::IN, $c, 1 ); - $s .= $c; - last if $c =~ /[A-Dz~]/; # end of escape seq - } - } - } - $s; -} - -sub insert_char { - local($c,*len,*ix,*hist) =@_; - local($clen); - $clen = length $c; - if( $init_in ) { - $len = $ix = $clen; # new hist - clear old one - $hist[$#hist] = $c; - }else{ - substr($hist[$#hist],$ix,0) = $c; #insert char - $len += $clen; - $ix += $clen; - } -} -sub stty { - my($arg) = @_; - `/bin/stty $arg <$tty 2>&1`; -# if( -x "/usr/5bin/stty" ) { -# `/usr/5bin/stty $arg <$tty`; -# }elsif( -x "/usr/bin/stty" ) { -# `/usr/bin/stty $arg `; -# }else { -# `/bin/stty $arg `; -# } -} - -sub add_hist { - # add input into history file - local($type,*cmd) = @_; #not my - my( $t )= sprintf("%s",$type); - my($h) = $cmd[$#cmd]; - return if !defined $File; - if( $#cmd ==0 || $h ne $cmd[$#cmd-1] ) { - $h =~ s/([\"@\$\\])/\\$1/g; - $t =~ s/^\*//; - push(@Histall, "push (\@$t, \"$h\");\n" ); - @Histall = splice( @Histall, -$HIST_SIZE, $HIST_SIZE ); # take last HIST_SIZE commands - if( open( FILE, ">$File" ) ){ - print FILE @Histall; - print FILE "1;\n"; - close(FILE); - } - }else { - $#cmd--; - } -} - -#---------------- -# print mini help -#---------------- -sub usage_error { - open( THIS, "$0"); - while(<THIS>) { - s/\$0/$Filename/; - if( /^\#/ ) { - print STDERR $_; - }else{ - last; - } - } - close THIS; -sleep 3; -exit 1; -} - -sub search_mode { - local(*c, *s, *prompt, *mode, *isp, *hist ) =@_; - my($p_save, $isp_cur); - if($c eq "\n"){ - $prompt = $p_save; - $mode = 'normal'; - last IN_STACK; - } - $isp_cur = $isp; - if( $User::Key{$c} =~ /^search/ ) { - #search furthur - $mode = $User::Key{$c}; - while(1) { - if( $mode eq 'search_rev' && --$isp<0 || - $mode eq 'search' && ++$isp>$#hist-1 ) { - print User::OUT "\a"; # couldn't find one - $isp = $isp_cur; - last; - } - last if( index($hist[$isp],$s) >=0); - } - }elsif( $User::Key{$c} eq 'bs' ) { - $s =~ s/.$//; - }elsif( ord($c) < 32 ) { - #non-printable char, get back to normal mode - print User::OUT "\a"; - $prompt = $p_save; - $mode = 'normal'; - return; - }else{ - $s .= $c; - while(1) { - last if (index($hist[$isp],$s) >=0); - if( $mode eq 'search_rev' && --$isp<0 || - $mode eq 'search' && ++$isp>$#hist ) { - print User::OUT "\a"; #couldn't find one - chop($s); - $isp = $isp_cur; - last; - } - } - } - $prompt = "($mode)'$s':"; -} - -sub calcxy { - my( $mode, $prompt, $len, $ix, $off, $wd ) = @_; - my($plen); - my( $y_len, $y_ix, $col); - my($adjust); # 1 when the last char is on right edge - - $plen = length($prompt); - $y_len = int (($plen+$len+$off) / $wd ); - $adjust = ( (($plen+$len+$off) % $wd == 0) && ($y_len > 0 )) ? 1:0; - if( $mode =~ /^search/ ) { - #move cursor to search string - $y_ix = int (($plen-2+$off) / $wd ); - $col = ($plen-2+$off) % $wd; - }else{ - #normal mode - move cursor back to $ix - $y_ix = int (($plen+$ix+$off) / $wd ); - $col = ($plen+$ix+$off) % $wd; - } - ($y_len, $y_ix, $col, $adjust); -} - -package User; - -sub move_cursor { - my($x,$y, $x_prev,$y_prev) = @_; - my($termcode); - - $termcode = ''; - if($y > $y_prev ) { - $termcode = $TERM_DOWN x ($y-$y_prev); - }elsif( $y < $y_prev ) { - $termcode = $TERM_UP x ($y_prev-$y); - } - if( $x > $x_prev ) { - $termcode .= $TERM_RIGHT x ($x-$x_prev); - }elsif( $x < $x_prev ) { - $termcode .= $TERM_LEFT x ($x_prev-$x); - } - print OUT $termcode; -} - -sub another_line { - $init_in = 1-$app; - ($hist[$#hist] = $hist[$isp]) =~ s/\n//; - $ix = length($hist[$#hist]); -} - -sub main::input { - # arg0 - prompt - # arg1 - input stack - # arg2 - append input to command if 1 - # arg3 - # of column offset - local($prompt,*hist,$app,$off) = @_; - local($len,$ix); - local($c,$isp,$s,$wisp); - local($mode); - local(%lastop); - - local($init_in); - local($print_line); #0-none, 1-whole, 2-from cursor - my($y_ix,$y_ix0,$y_len,$wd,$ht,$col,$col0); - my($term); - my($init_in,$op); - - $off = 0 if( !defined $off ); - *hist = *main::Hist if( ! defined @hist ); - $isp = ++$#hist ; - $wisp = $isp; - if( -f "/vmunix" ) { - &main::stty("-echo -icanon min 1 time 0 stop ''"); - }else { - &main::stty(" -echo -icanon eol \001 stop ''"); - } - ($ht,$wd) = &termsize(); - $y_ix = $y_len = 0; - $mode = 'normal'; - another_line(); - $print_line = 1; - - IN_STACK:while(1){ - - if( $print_line==0 ) { - #just move cursor - ($y_len,$y_ix,$col,$adjust) = - &main::calcxy($mode,$prompt,$len,$ix,$off,$wd); - move_cursor( $col,$y_ix, $col0,$y_ix0); - - }elsif($print_line==2 || $print_line==3 ) { - # delete - print cursor to eol - $len = length($hist[$#hist]); - ($y_len,$y_ix,$col,$adjust) = - &main::calcxy($mode,$prompt,$len,$ix,$off,$wd); - - if( $print_line==3 ) { - # delete backward - move_cursor( $col,$y_ix, $col0,$y_ix0); - } - - if( $y_len0 > $y_ix && ($adjust || $y_len0 > $y_len) ) { - print( OUT "\n$TERM_EEOL" x ($y_len0-$y_ix), - $TERM_UP x ($y_len0-$y_ix), - "\r", $TERM_RIGHT x $col, ); - } - print( OUT substr("$prompt$hist[$#hist]", $ix), - $adjust ? '':$TERM_EEOL, - "\r", $TERM_RIGHT x $col, - $TERM_UP x ($y_len-$y_ix) , - ($adjust && $ix!=$len)? $TERM_DOWN : '' ); - - - }elsif($print_line==4) { - # insert - $len = length($hist[$#hist]); - ($y_len,$y_ix,$col,$adjust) = - &main::calcxy($mode,$prompt,$len,$ix,$off,$wd); - - print( OUT substr("$prompt$hist[$#hist]", $ix), - $TERM_UP x ($y_len-$y_ix) ,"\r", $TERM_RIGHT x $col, - $TERM_DOWN x $adjust ); - - }else{ - # print whole line - $len = length($hist[$#hist]); - #move cursor to bol on screen, erase prev printout - print (OUT $TERM_DOWN x ($y_len-$y_ix), - "\r$TERM_EEOL$TERM_UP" x ($y_len), - "\r$TERM_EEOL\r", - $TERM_RIGHT x $off,"$prompt$hist[$#hist]"); - ($y_len,$y_ix,$col,$adjust) = - &main::calcxy($mode,$prompt,$len,$ix,$off,$wd); - - #mv cursor to cur pos - print( OUT $TERM_UP x ($y_len-$y_ix) ,"\r", $TERM_RIGHT x $col, - $TERM_DOWN x $adjust); - } - - - GETC:{ - ($col0, $y_ix0, $y_len0) = ($col, $y_ix, $y_len); - $print_line=1; - - $c = main::getchar(); - while($Key{$c} eq "prefix" ) { - $c .= main::getchar(); - } - - ($op = $Key{$c}) =~ s/(.*)\s*[\(;].*/$1/; - $op =~ /(\w+)$/; - $op = $1; - - if( $Key{$c} =~ /ign_mode/ ) { - # ignore mode and execute command - eval "&{$Key{$c}}"; - }elsif( $mode =~ /^search/ ) { - main::search_mode(*c,*s,*prompt,*mode,*isp, *hist); - another_line(); - }elsif( $c eq $Key{EOF} && $len==0 ) { - return ''; # eof return null - }elsif( defined $Key{$c} ) { - eval "&{$Key{$c}}"; - $lastop{op} = $op; - }elsif( ord ($c) < 32 ) { - #undefined control char - print OUT "\a"; - $print_line = 0; - }else { - $lastop{op} = 'ins_char'; - &ins_char( $c ); - print OUT $c; - } - $init_in = 0; - } - } - - if( $y_ix != $y_len ) { - print OUT "\n" x ($y_len-$y_ix); - } - &main::stty($org_stty); - - print OUT "\n"; - if( $hist[$#hist] eq '' ) { - pop(@hist); - return "\n"; - } - if( $#hist>0 && $hist[$#hist] eq $hist[$#hist-1] ) { - pop(@hist); # if it is the same, delete - }else{ - &main::add_hist( *hist, *hist ); - } - $hist[$#hist]."\n"; -} - -#----------------------------- -# editinig command functions -# -# functions must be below here to be listed by list_func -# -# the variables below are local to sub input -# $prompt,$hist,$app,$off -# $len,$ix -# $c,$isp,$wisp,$s -# $mode -#----------------------------- -sub prefix { } # it's only here to be listed by list_func -sub boh { - $isp = 0; - another_line(); -} -sub boh_ign_mode { - boh(); -} -sub bol { - $ix = 0 ; - $print_line=0; -} -sub bs { - my($l) = @_; - $l = 1 if $l eq ''; - if( $len && $ix ) { - $ix-=$l; # mv left - substr($hist[$#hist],$ix,$l) = ""; # del char - } - $print_line = 3; -} -sub del_back_line { - substr($hist[$#hist],0,$ix) = ""; - $ix = 0; - $print_line = 3; -} -sub del_forw_line { - substr($hist[$#hist],$ix) = ""; - $print_line = 2; -} -sub del_char { - my($l) = @_; - $l = 1 if $l eq ''; - if( $len > $ix ) { - substr($hist[$#hist],$ix,$l) = ""; # del char - } - $print_line = 2; -} -sub del_line { - $ix = 0; - $hist[$#hist] = ""; - $print_line = 3; -} -sub del_back_word { - my($tmp); - $tmp = substr($hist[$#hist],0,$ix); - $tmp =~ s/(^|\S+)\s*$//; - $tmp = length $tmp; - substr($hist[$#hist],$tmp,$ix-$tmp) = ""; - $ix = $tmp; - $print_line = 3; -} -sub del_forw_word { - $hist[$#hist] =~ s/^(.{$ix})\s*\S+/$1/; - $print_line = 2; -} -sub enter { - subst(); - enter_wo_subst(); -} -sub eoh { - if( $isp==$#hist ) { - print OUT "\a"; - }else{ - $hist[$#hist] = '' - } - $isp = $#hist; - another_line(); - $print_line = 1; -} -sub eoh_ign_mode { - eoh(); - $print_line = 1; -} -sub eol { - $ix = $len; - $print_line=0; -} -sub execute { - eval "$hist[$#hist]"; - if( $#hist>0 && $hist[$#hist] eq $hist[$#hist-1] ) { - pop(@hist); # if it is the same, delete - }else{ - &main::add_hist( *hist, *hist ); - } - push( @hist, ''); # deceive 'input' it is an empty line - last IN_STACK; -} -sub ins_char { - my($c) = @_; - &main::insert_char($c,*len,*ix,*hist); - $print_line = 4; -} -sub ins_last_word { - if( $lastop{op} =~ /^ins_(nth|last)_word/ ) { - return if $wisp < 1; - #delete last last_word - bs(length $lastop{word}); - }else { - $wisp = $#hist; - return if $wisp < 1; - } - $hist[--$wisp] =~ /(\S+)\s*$/; - $lastop{word} = $1; - ins_char($lastop{word}); -} -sub ins_nth_word { - my($n) = @_; - if( $lastop{op} =~ /^ins_(nth|last)_word/ ) { - return if $wisp < 1; - #delete last last_word - bs(length $lastop{word}); - }else { - $wisp = $#hist; - return if $wisp < 1; - } - $hist[--$wisp] =~ /((\S+)\s*){1,$n}/; - $lastop{word} = $2; - ins_char($lastop{word}); -} -sub list_func { - my( $s, @cmds, $cmd, $func); - $func = 0; - open( THIS, "$0" ) || return; #shouldn't occur - while( $s = <THIS> ) { - if( $s =~ /^\s*sub\s+main::input\s*\{/ ) { - $func = 1; - next; - } - next if !$func; - if( $s =~ s/^\s*sub\s+// ) { - $s =~ s/\s*[\{].*//; - push @cmds,$s; - } - } - close THIS; - foreach $cmd (sort @cmds) { - print OUT $cmd; - } -} - -sub bind { - # bind Key or Subst - # if there is no arguments, then list them - my($hash,$key,$val) = @_; - my( $mod,$chr,$v2,$k,$cnt ); - if( defined %{$hash} ) { - $k = $key; - if( $hash eq "Key" ) { - ($v2 = $val) =~ s/\s*[\(;].*//; - if( !defined &{$v2} ) { - print STDERR "Unknown function $v2\n"; - return; - } - $mod = 0; $cnt =0; $k = ''; - for( $i=0; $i<length $key; $i++ ) { - $chr = substr($key,$i,1); - if( $chr eq "\\" ) { - $chr = substr($key,++$i,1); - if( $chr=~/m/i ) { - $mod = 0x80; - }elsif( $chr=~/c/i ) { - $cnt = 1; - }elsif( $chr=~/e/i ) { - $chr = $ESC; - $chr = pack("c",ord($chr)+$mod); - $mod = 0 ; $cnt = 0; - $k .= $chr; - }else { - print "Unknown char $key\n"; - } - }else { - if( $cnt ) { - eval "\$chr = \"\\c$chr\" "; - } - $chr = pack("c",ord($chr)+$mod); - $mod = 0 ; $cnt = 0; - $k .= $chr; - } - } - } - if( $val eq '' ) { - delete ${$hash}{$k}; - }else { - ${$hash}{$k} = $val; - } - - - }else { - foreach $key (sort(keys(%Key) )){ - $val = $Key{$key}; - $mod = ''; - while( $key =~ s/(.|\s)// ) { - $chr = $1; - if( ord($chr) >= 0x80 ) { - $mod .= '\M'; - $chr = pack("c", ord($chr)-0x80); - } - if( $chr eq $ESC ) { - $chr = '\E'; - }elsif( ord($chr) < 0x20 ) { - $mod .= '\C'; - $chr = pack("c", ord($chr)+0x40); - }elsif( ord($chr) == 0x7f ) { - $chr = '\C?'; - } - $mod .= $chr; - } - if( ord($val) < 0x20 ) { - $val = '\C'.pack("c", ord($val)+0x40); - } - print OUT "Key $mod $val\n"; - } - while( ($key,$val) = each(%Subst) ) { - print OUT "Subst $key $val\n"; - } - } -} -sub next_char { - $ix++ if ($ix<$len); - $print_line=0; -} - -sub next_line { - if($isp<$#hist) { - $isp++; - if( $isp==$#hist ) { - $hist[$isp] = ''; - } - }else { - $isp = $#hist; - print OUT "\a"; - } - another_line(); -} - -sub next_word { - $hist[$#hist] =~ /^(.{$ix}\S*(\s+|$))/; - $ix = length($1); - $print_line=0; -} - -sub enter_wo_subst { - last IN_STACK; -} - -sub prev_char { - $ix-- if $ix>0; - $print_line=0; -} - -sub prev_line { - if($isp>0) { - $isp--; - }else { - $isp = 0; - print OUT "\a"; - } - another_line(); -} - -sub prev_word { - my($tmp); - $tmp = substr($hist[$#hist],0,$ix); - $tmp =~ s/(^|\S+)\s*$//; - $ix = length($tmp); - $print_line=0; -} - -sub cancel { - $hist[$#hist] = ""; - $len = 0; - last IN_STACK; -} -sub quote { - my($c); - sysread(IN, $c, 1); -# $c = getc(IN); - ins_char($c); -} - -sub search_rev { - $s = ''; - $mode = 'search_rev'; - $p_save = $prompt; - $prompt = "($mode)'$s':"; - $hist[$#hist] = $hist[$isp]; - another_line(); -} - -sub search { - $s = ''; - $mode = 'search'; - $p_save = $prompt; - $prompt = "($mode)'$s':"; - $hist[$#hist] = $hist[$isp]; - another_line(); -} - -sub subst { - my($key,$val); - $done = 0; - while( ($key,$val) = each(%Subst) ) { - last if( eval "\$hist[\$#hist] =~ s\$key$val" ) ; - } - $ix = $len = length($hist[$#hist]); -} - -sub termsize { - my($row, $col,$s); - if( -f "/vmunix" ) { - $s =&main::stty ("everything"); - ($row,$col) = ($s =~ /(\d+)\s+rows[,\s]+(\d+)\s+columns/ ); - } else { - $s =&main::stty ("-a"); - ($row,$col) = ($s =~ /rows[=\s]+(\d+)[,;\s]+columns[=\s]+(\d+)/ ); - } - ($row,$col); -} - diff --git a/app/fvwm/extras/FvwmConsole/FvwmConsoleC.pl.1 b/app/fvwm/extras/FvwmConsole/FvwmConsoleC.pl.1 deleted file mode 100644 index ce29c6ef5..000000000 --- a/app/fvwm/extras/FvwmConsole/FvwmConsoleC.pl.1 +++ /dev/null @@ -1,188 +0,0 @@ -.\" t -.\" @(#)FvwmConsoleC.pl.1x 7/16/96 -.TH FvwmConsoleC.pl 1x "July 16 1996" -.UC - -.SH NAME -FvwmConsoleC.pl \- Command editor for FVWM command input interface -.SH SYNOPSIS -FvwmConsole -e /usr/X11/lib/fvwm2/FvwmConsoleC.pl - -.SH COPYRIGHT -Copyright 1996, Toshi Isogai. No guarantees or warranties are provided. -Use this program at your own risk. Permission to use this program for -any purpose is given, as long as the copyright is kept intact. - - -.SH DESCRIPTION -FvwmConsoleC.pl offers editing capabilities while the user is -entering the line. By default, the line editing commands -are similar to those of emacs. It also offers -.B substitution -, which replaces a pattern to a string before it sends the command. - -.SH FUNCTIONS -Functions are bound to a key or key combination to be -invoked. The followings are functions available and their -default key bindings. -.RS -.IP \fBbind\fP -\fIMeta-k, Cntl-x Cntl-b\fP -.br -.\"Bind key to function or bind pattern to string for substitution. -List up key bindings and substitutions. -.IP \fBboh\fP -.br -Move to the beginning of history. -.IP "\fBboh_ign_mode\fP \fIEsc-<\fP" -.br -Move to the beginning of history. If it is in search mode, -continue. -.IP \fBbol\fP -\fIHome, Cntl-a\fP -.br -Move cursor to the beginning of the line. -.IP "\fBbs[(n)]\fP \fIBackSpace, Cntl-h\fP" -.br -Backspace n times. default of n is 1. -.IP \fBcancel\fP -\fICntl-x Cntl-k\fP -.br -Cancel the current input. -.IP \fBdel_back_line\fP -.br -Delete the line from the beginning to the cursor. -.IP "\fBdel_back_word\fP \fICntl-w\fP" -.br -Delete the word from the beginning to the cursor. -.IP "\fBdel_char [(n)]\fP \fIDelete, Cntl-d\fP" -Delete n characters from the cursor to the right. Default of n -is 1. -.IP "\fBdel_forw_line\fP \fICntl-k\fP" -.br -Delete the line from the cursor to the end. -.IP "\fBdel_forw_word\fP \fIMeta-d\fP" -.br -Delete the word from the cursor to the end. -.IP "\fBdel_line\fP \fICntl-u\fP" -.br -Delete the entire line. -.IP \fBenter\fP -\fIEnter, Cntl-j, Cntl-m\fP -.br -Perform substitution if applicable and send the line to Fvwm. -.IP "\fBenter_wo_subst\fP \fIMeta-Enter\fP" -.br -Send the line to Fvwm without any substitution. -.IP \fBeoh\fP -.br -Move to the end of history. -.IP "\fBeoh_ign_mode\fP \fIEsc->\fP" -.br -Move to the end of history. If it is in search mode, continue. -.IP \fBeol\fP -\fIEnd, Cntl-e\fP -.br -Move the cursor to the end of line. -.IP "\fBins_char (str)\fP" -.br -Insert string at the cursor. -.IP "\fBins_last_word\fP \fIEsc-.\fP" -.br -Insert the last argument of the previous command at the cursor. -.IP "\fBins_nth_word\fP \fIMeta-[1..9]\fP" -.br -Insert the n-th argument of the previous command at the cursor. -.IP "\fBlist_func\fP \fIMeta-l\fP" -.br -List up available editing functions. -.IP "\fBnext_char\fP \fIRight, Cntl-f\fP" -.br -Move the cursor to the next character. -.IP "\fBnext_line\fP \fIDown, Cntl-n\fP" -.br -Move to the next line in history. -.IP "\fBnext_word\fP \fIMeta-f\fP" -.br -Move the cursor to the next word. -.IP \fBprefix\fP -.br -Wait for the next character typed in for multi-key binding. -.IP "\fBprev_char\fP \fILeft, Cntl-b\fP" -.br -Move the cursor to the previous character. -.IP "\fBprev_line\fP \fIUp, Cntl-p\fP" -.br -Move to the previous line in history. -.IP "\fBprev_word\fP \fIMeta-b\fP" -.br -Move the cursor to the previous word. -.IP \fBquote\fP -\fICntl-q\fP -.br -Insert the next character typed into the buffer literally. -.IP \fBsearch\fP -\fICntl-s\fP -.br -Search pattern in history. -.IP "\fBsearch_rev\fP \fICntl-r\fP" -.br -Search pattern in history in reverse order. -.IP \fBsubst\fP -\fIMeta-s\fP -.br -Substitute all patterns to strings and reprint the line. -The substitutions are not nested and performed in the order -that they are defined. -.RE - -.SH CONFIGURATION -The key binding can be overridden or defined -in fvwm module configuration. - -.RS -*FvwmConsoleKey \\ck prev_line -.RE - -Non-space character sequence need not be quoted. -In order to undefine, omit the last argument. - -.RS -*FvwmConsoleKey \ck -.RE - -Note that non-meta character is case sensitive. -\\c means control key, \\e means escape, and \\m is alt key. -.br -It also accepts Subst configuration. Users often input long fvwm command -repeatedly. Subst will replace particular input sequence to user defined -string. Example: - -.RS -*FvwmConsoleSubst '^bigx' 'Exec xterm -g 120x60+0+0 -fn 10x20 -fg black -bg lemonchiffon' -.RE - -Typing 'bigx<return>' in FvwmConsole will launch xterm. '^' denotes -the beginning of line in -.B regular expression. -\'pl\' in the middle -of the command will not be replaced. Although the format looks different, -it takes Perl regular expression. -It just uses single or double quote as the delimiter. -Single or double quotes have no difference, although they have to match, -and cannot include itself in the string. - -.RS -*FvwmConsoleSubst '^g\\s*(\\d+)' 'Desk 0 0\\nGotoPage 0 $1\\nFocus' -.RE - -Entering 'g4' or 'g 4' will jump to desk 0 page 0 4 and focus. - -.SH INVOCATION -FvwmConsoleC.pl should be invoked by FvwmConsole. - -.SH SEE ALSO -FvwmConsole(1x), perlre(1) - -.SH AUTHOR -Toshi Isogai diff --git a/app/fvwm/extras/FvwmConsole/INSTALL b/app/fvwm/extras/FvwmConsole/INSTALL deleted file mode 100644 index 8dea3e9ea..000000000 --- a/app/fvwm/extras/FvwmConsole/INSTALL +++ /dev/null @@ -1,17 +0,0 @@ -0. Restore the files under fvwm/modules - -1. Change the current directory to FvwmConsole - -2. Modify your Imakefile - - Comment out the line, '#define HAVE_READLINE', if you don't - have GNU readline library. - - If you have Perl 5.002 or later and want to use FvwmConsoleC.pl - editor, insert '#define HAVE_PERL5.002 - -3. Run 'xmkmf;make'. - -4. Run 'make install'. - -5. Run 'make install.man' to install man pages. diff --git a/app/fvwm/extras/FvwmConsole/README b/app/fvwm/extras/FvwmConsole/README deleted file mode 100644 index 4d1b3f931..000000000 --- a/app/fvwm/extras/FvwmConsole/README +++ /dev/null @@ -1,24 +0,0 @@ - FvwmConsole allows the user to type fvwm commands into - xterm, and have them executed immediately. These commands - are usually specfified in the .fvwmrc file, or are bound to - menu/mouse items as specified in that file. This tools is - particularly useful for testing new configuration ideas, or - for implementing temporary changes to your environment. - - GNU readline library is called to edit command line. - A perl script is supplied as an alternative command editor - for those who don't have the readline library. - - Any comments will be appreciated. - - Feb '97 - - - - Thanks to Makoto `MAR_kun' MATSUSHITA for advice and testing - Paul D Smith for fixes - - Toshi Isogai isogai@kentek.com - - - diff --git a/app/fvwm/extras/FvwmConsole/getline.c b/app/fvwm/extras/FvwmConsole/getline.c deleted file mode 100644 index b3ddca604..000000000 --- a/app/fvwm/extras/FvwmConsole/getline.c +++ /dev/null @@ -1,112 +0,0 @@ -#include "FvwmConsole.h" - -#ifndef HAVE_READLINE -static char cmd[MAX_COMMAND_SIZE]; - -/* no readline - starts here */ -char *get_line() { - if( fgets(cmd,MAX_COMMAND_SIZE,stdin) == NULL ) { - return(NULL); - } - return(cmd); -} - -#else -/* readline - starts here */ -#include <readline/readline.h> -#include <readline/history.h> - -extern int rl_bind_key(); - - -static char cmd[MAX_COMMAND_SIZE]; -static char *line = (char *)NULL; -static int done_init = 0; -static char *h_file; - -char *get_line() -{ - char *prompt; - int len; - char *home; - int fdh; - - /* If initialization hasn't been done, do it now: - * - We don't want TAB completion - */ - if (!done_init) { - rl_bind_key('\t', rl_insert); - - /* get history from file */ - home = getenv("HOME"); - h_file = safemalloc( strlen(home)+ 14); - strcpy(h_file,home); - strcat(h_file,HISTFILE); - if( access( h_file, F_OK) < 0) { - /* if it doesn't exist create it */ - fdh = creat( h_file, S_IRUSR | S_IWUSR ); - if( fdh != -1 ) { - close( fdh ); - } - } else { - read_history_range( h_file, 0, HISTSIZE ); - } - done_init = 1; - } - - /* Empty out the previous info */ - len = 0; - *cmd = '\0'; - prompt = PS1; - - while (1) { - int linelen = 0; - - /* If the buffer has already been allocated, free the memory. */ - if (line != (char *)NULL) - free(line); - - /* Get a line from the user. */ - line = readline(prompt); - if (line == NULL) - return (NULL); - - /* Make sure we have enough space for the new line */ - linelen = strlen(line); - if (len + linelen > MAX_COMMAND_SIZE-2 ) { - fprintf( stderr, "line too long %d chars max %d \a\n", - len+linelen, MAX_COMMAND_SIZE-2 ); - strncat(cmd, line, MAX_COMMAND_SIZE-len-2); - add_history(cmd); - break; - } - - /* Copy the new line onto the end of the current line */ - strcat(cmd, line); - - /* If the current line doesn't end with a backslash, we're done */ - len = strlen(cmd); - if (cmd[len-1] != '\\') - break; - - /* Otherwise, remove it and wait for more (add a space if needed) */ - prompt = PS2; - cmd[len-1] = (cmd[len-2]==' ' || cmd[len-2]=='\t') ? '\0' : ' '; - } - - /* If the command has any text in it, save it on the history. */ - if (*cmd != '\0') { - add_history(cmd); - append_history( 1,h_file ); - history_truncate_file( h_file, HISTSIZE ); - } - - cmd[len] = '\n'; - cmd[len+1] = '\0'; - - return (cmd); -} -/* readline - end here */ -#endif - - diff --git a/app/fvwm/extras/FvwmDebug/FvwmDebug.1 b/app/fvwm/extras/FvwmDebug/FvwmDebug.1 deleted file mode 100644 index f92a09eb1..000000000 --- a/app/fvwm/extras/FvwmDebug/FvwmDebug.1 +++ /dev/null @@ -1,44 +0,0 @@ -.\" t -.\" @(#)FvwmDebug.1 1/28/94 -.TH FvwmDebug 1.20 "Jan 28 1994" -.UC -.SH NAME -FvwmDebug \- the FVWM module debugger -.SH SYNOPSIS -FvwmDebug is spawned by fvwm, so no command line invocation will work. - -.SH DESCRIPTION -The FvwmDebug captures the stream of module packets coming from -fvwm, and displays them on stderr. - -.SH COPYRIGHTS -The FvwmDebug program, and the concept for -interfacing this module to the Window Manager, are all original work -by Robert Nation - -Copyright 1994, Robert Nation. No guarantees or warranties or anything -are provided or implied in any way whatsoever. Use this program at your -own risk. Permission to use this program for any purpose is given, -as long as the copyright is kept intact. - - -.SH INITIALIZATION -During initialization, the FvwmDebug requests that fvwm dump a -complete window list into its pipe. These packets are terminated with -and "end Send_WindowList" message. - -.SH INVOCATION -FvwmDebug can be invoked by inserting the line 'Module FvwmDebug' in -the .fvwmrc file. This can be placed on a line by itself, if FvwmDebug -is to be spawned during fvwm's initialization, or can be bound to a -menu or mouse button or keystroke to invoke it later. Fvwm will search -directory specified in the ModulePath configuration option to attempt -to locate FvwmDebug. - -.SH CONFIGURATION OPTIONS -There are no configuration options. - - -.SH AUTHOR -Robert Nation - diff --git a/app/fvwm/extras/FvwmDebug/FvwmDebug.c b/app/fvwm/extras/FvwmDebug/FvwmDebug.c deleted file mode 100644 index 64b60a1fb..000000000 --- a/app/fvwm/extras/FvwmDebug/FvwmDebug.c +++ /dev/null @@ -1,539 +0,0 @@ -/* This module, and the entire FvwmDebug program, and the concept for - * interfacing this module to the Window Manager, are all original work - * by Robert Nation - * - * Copyright 1994, Robert Nation. No guarantees or warantees or anything - * are provided or implied in any way whatsoever. Use this program at your - * own risk. Permission to use this program for any purpose is given, - * as long as the copyright is kept intact. */ - -#include "config.h" - -#include <stdio.h> -#include <signal.h> -#include <fcntl.h> -#include <string.h> -#include <sys/wait.h> -#include <sys/time.h> -#include <unistd.h> -#include <ctype.h> -#include <stdlib.h> -#include "../../fvwm/module.h" - -#include "FvwmDebug.h" - -char *MyName; -int fd_width; -int fd[2]; - -/* -** spawn_xtee - code to execute xtee from a running executable & -** redirect stdout & stderr to it. Currently sends both to same xtee, -** but you rewrite this to spawn off 2 xtee's - one for each stream. -*/ - -pid_t spawn_xtee(void) -{ - pid_t pid; - int PIPE[2]; - char *argarray[256]; - - setvbuf(stdout,NULL,_IOLBF,0); /* line buffered */ - - if (pipe(PIPE)) - { - perror("spawn_xtee"); - fprintf(stderr, "ERROR ERRATA -- Failed to create pipe for xtee.\n"); - return 0; - } - - argarray[0] = "xtee"; - argarray[1] = "-nostdout"; - argarray[2] = NULL; - - if (!(pid = fork())) /* child */ - { - dup2(PIPE[0], STDIN_FILENO); - close(PIPE[0]); - close(PIPE[1]); - execvp("xtee",argarray); - exit(1); /* shouldn't get here... */ - } - else /* parent */ - { - if (ReapChildrenPid(pid) != pid) - { - dup2(PIPE[1], STDOUT_FILENO); - dup2(PIPE[1], STDERR_FILENO); - close(PIPE[0]); - close(PIPE[1]); - } - } - - return pid; -} /* spawn_xtee */ - -/*********************************************************************** - * - * Procedure: - * main - start of module - * - ***********************************************************************/ -int main(int argc, char **argv) -{ - char *temp, *s; - - /* Save our program name - for error messages */ - temp = argv[0]; - s=strrchr(argv[0], '/'); - if (s != NULL) - temp = s + 1; - - MyName = safemalloc(strlen(temp)+2); - strcpy(MyName,"*"); - strcat(MyName, temp); - - if((argc != 6)&&(argc != 7)) - { - fprintf(stderr,"%s Version %s should only be executed by fvwm!\n",MyName, - VERSION); - exit(1); - } - - /* Dead pipe == Fvwm died */ - signal (SIGPIPE, DeadPipe); - - fd[0] = atoi(argv[1]); - fd[1] = atoi(argv[2]); - -#if 0 - spawn_xtee(); -#endif - - /* Data passed in command line */ - fprintf(stderr,"Application Window 0x%s\n",argv[4]); - fprintf(stderr,"Application Context %s\n",argv[5]); - - fd_width = GetFdWidth(); - - /* Create a list of all windows */ - /* Request a list of all windows, - * wait for ConfigureWindow packets */ - SendInfo(fd,"Send_WindowList",0); - - Loop(fd); - return 0; -} - - -/*********************************************************************** - * - * Procedure: - * Loop - wait for data to process - * - ***********************************************************************/ -void Loop(int *fd) -{ - unsigned long header[3], *body; - - while(1) - { - if(ReadFvwmPacket(fd[1],header,&body) > 0) - { - process_message(header[1],body); - free(body); - } - } -} - - -/*********************************************************************** - * - * Procedure: - * Process message - examines packet types, and takes appropriate action - * - ***********************************************************************/ -void process_message(unsigned long type,unsigned long *body) -{ - switch(type) - { - case M_ADD_WINDOW: - list_add(body); - case M_CONFIGURE_WINDOW: - list_configure(body); - break; - case M_DESTROY_WINDOW: - list_destroy(body); - break; - case M_FOCUS_CHANGE: - list_focus(body); - break; - case M_NEW_PAGE: - list_new_page(body); - break; - case M_NEW_DESK: - list_new_desk(body); - break; - case M_RAISE_WINDOW: - list_raise(body); - break; - case M_LOWER_WINDOW: - list_lower(body); - break; - case M_ICONIFY: - list_iconify(body); - break; - case M_MAP: - list_map(body); - break; - case M_ICON_LOCATION: - list_icon_loc(body); - break; - case M_DEICONIFY: - list_deiconify(body); - break; - case M_WINDOW_NAME: - list_window_name(body); - break; - case M_ICON_NAME: - list_icon_name(body); - break; - case M_RES_CLASS: - list_class(body); - break; - case M_RES_NAME: - list_res_name(body); - break; - case M_END_WINDOWLIST: - list_end(); - break; - case M_DEFAULTICON: - case M_ICON_FILE: - default: - list_unknown(body); - break; - } -} - - - -/*********************************************************************** - * - * Procedure: - * SIGPIPE handler - SIGPIPE means fvwm is dying - * - ***********************************************************************/ -void DeadPipe(int nonsense) -{ - fprintf(stderr,"FvwmDebug: DeadPipe\n"); - exit(0); -} - -/*********************************************************************** - * - * Procedure: - * list_add - displays packet contents to stderr - * - ***********************************************************************/ -void list_add(unsigned long *body) -{ - fprintf(stderr,"Add Window\n"); - fprintf(stderr,"\t ID %lx\n",body[0]); - fprintf(stderr,"\t frame ID %lx\n",body[1]); - fprintf(stderr,"\t fvwm ptr %lx\n",body[2]); - fprintf(stderr,"\t frame x %ld\n",(long)body[3]); - fprintf(stderr,"\t frame y %ld\n",(long)body[4]); - fprintf(stderr,"\t frame w %ld\n",(long)body[5]); - fprintf(stderr,"\t frame h %ld\n",(long)body[6]); - fprintf(stderr,"\t desk %ld\n",(long)body[7]); - fprintf(stderr,"\t flags %lx\n",body[8]); - fprintf(stderr,"\t title height %ld\n",(long)body[9]); - fprintf(stderr,"\t border width %ld\n",(long)body[10]); - fprintf(stderr,"\t window base width %ld\n",(long)body[11]); - fprintf(stderr,"\t window base height %ld\n",(long)body[12]); - fprintf(stderr,"\t window resize width increment %ld\n",(long)body[13]); - fprintf(stderr,"\t window resize height increment %ld\n",(long)body[14]); - fprintf(stderr,"\t window min width %ld\n",(long)body[15]); - fprintf(stderr,"\t window min height %ld\n",(long)body[16]); - fprintf(stderr,"\t window max %ld\n",(long)body[17]); - fprintf(stderr,"\t window max %ld\n",(long)body[18]); - fprintf(stderr,"\t icon label window %lx\n",body[19]); - fprintf(stderr,"\t icon pixmap window %lx\n",body[20]); - fprintf(stderr,"\t window gravity %lx\n",body[21]); -} - -/*********************************************************************** - * - * Procedure: - * list_configure - displays packet contents to stderr - * - ***********************************************************************/ -void list_configure(unsigned long *body) -{ - fprintf(stderr,"Configure Window\n"); - fprintf(stderr,"\t ID %lx\n",body[0]); - fprintf(stderr,"\t frame ID %lx\n",body[1]); - fprintf(stderr,"\t fvwm ptr %lx\n",body[2]); - fprintf(stderr,"\t frame x %ld\n",(long)body[3]); - fprintf(stderr,"\t frame y %ld\n",(long)body[4]); - fprintf(stderr,"\t frame w %ld\n",(long)body[5]); - fprintf(stderr,"\t frame h %ld\n",(long)body[6]); - fprintf(stderr,"\t desk %ld\n",(long)body[7]); - fprintf(stderr,"\t flags %lx\n",body[8]); - fprintf(stderr,"\t title height %ld\n",(long)body[9]); - fprintf(stderr,"\t border width %ld\n",(long)body[10]); - fprintf(stderr,"\t window base width %ld\n",(long)body[11]); - fprintf(stderr,"\t window base height %ld\n",(long)body[12]); - fprintf(stderr,"\t window resize width increment %ld\n",(long)body[13]); - fprintf(stderr,"\t window resize height increment %ld\n",(long)body[14]); - fprintf(stderr,"\t window min width %ld\n",(long)body[15]); - fprintf(stderr,"\t window min height %ld\n",(long)body[16]); - fprintf(stderr,"\t window max %ld\n",(long)body[17]); - fprintf(stderr,"\t window max %ld\n",(long)body[18]); - fprintf(stderr,"\t icon label window %lx\n",body[19]); - fprintf(stderr,"\t icon pixmap window %lx\n",body[20]); - fprintf(stderr,"\t window gravity %lx\n",body[21]); -} - -/*********************************************************************** - * - * Procedure: - * list_destroy - displays packet contents to stderr - * - ***********************************************************************/ -void list_destroy(unsigned long *body) -{ - fprintf(stderr,"destroy\n"); - fprintf(stderr,"\t ID %lx\n",body[0]); - fprintf(stderr,"\t frame ID %lx\n",body[1]); - fprintf(stderr,"\t fvwm ptr %lx\n",body[2]); -} - -/*********************************************************************** - * - * Procedure: - * list_focus - displays packet contents to stderr - * - ***********************************************************************/ -void list_focus(unsigned long *body) -{ - fprintf(stderr,"focus\n"); - fprintf(stderr,"\t ID %lx\n",body[0]); - fprintf(stderr,"\t frame ID %lx\n",body[1]); - fprintf(stderr,"\t fvwm ptr %lx\n",body[2]); - -} - -/*********************************************************************** - * - * Procedure: - * list_new_page - displays packet contents to stderr - * - ***********************************************************************/ -void list_new_page(unsigned long *body) -{ - fprintf(stderr,"new page\n"); - fprintf(stderr,"\t x %ld\n",(long)body[0]); - fprintf(stderr,"\t y %ld\n",(long)body[1]); - fprintf(stderr,"\t desk %ld\n",(long)body[2]); -} - -/*********************************************************************** - * - * Procedure: - * list_new_desk - displays packet contents to stderr - * - ***********************************************************************/ -void list_new_desk(unsigned long *body) -{ - fprintf(stderr,"new desk\n"); - fprintf(stderr,"\t desk %ld\n",(long)body[0]); -} - -/*********************************************************************** - * - * Procedure: - * list_raise - displays packet contents to stderr - * - ***********************************************************************/ -void list_raise(unsigned long *body) -{ - fprintf(stderr,"raise\n"); - fprintf(stderr,"\t ID %lx\n",body[0]); - fprintf(stderr,"\t frame ID %lx\n",body[1]); - fprintf(stderr,"\t fvwm ptr %lx\n",body[2]); -} - - -/*********************************************************************** - * - * Procedure: - * list_lower - displays packet contents to stderr - * - ***********************************************************************/ -void list_lower(unsigned long *body) -{ - fprintf(stderr,"lower\n"); - fprintf(stderr,"\t ID %lx\n",body[0]); - fprintf(stderr,"\t frame ID %lx\n",body[1]); - fprintf(stderr,"\t fvwm ptr %lx\n",body[2]); -} - - -/*********************************************************************** - * - * Procedure: - * list_unknow - handles an unrecognized packet. - * - ***********************************************************************/ -void list_unknown(unsigned long *body) -{ - fprintf(stderr,"Unknown packet type\n"); -} - -/*********************************************************************** - * - * Procedure: - * list_iconify - displays packet contents to stderr - * - ***********************************************************************/ -void list_iconify(unsigned long *body) -{ - fprintf(stderr,"iconify\n"); - fprintf(stderr,"\t ID %lx\n",body[0]); - fprintf(stderr,"\t frame ID %lx\n",body[1]); - fprintf(stderr,"\t fvwm ptr %lx\n",body[2]); - fprintf(stderr,"\t icon x %ld\n",(long)body[3]); - fprintf(stderr,"\t icon y %ld\n",(long)body[4]); - fprintf(stderr,"\t icon w %ld\n",(long)body[5]); - fprintf(stderr,"\t icon h %ld\n",(long)body[6]); -} - - -/*********************************************************************** - * - * Procedure: - * list_map - displays packet contents to stderr - * - ***********************************************************************/ -void list_map(unsigned long *body) -{ - fprintf(stderr,"map\n"); - fprintf(stderr,"\t ID %lx\n",body[0]); - fprintf(stderr,"\t frame ID %lx\n",body[1]); - fprintf(stderr,"\t fvwm ptr %lx\n",body[2]); -} - - -/*********************************************************************** - * - * Procedure: - * list_icon_loc - displays packet contents to stderr - * - ***********************************************************************/ -void list_icon_loc(unsigned long *body) -{ - fprintf(stderr,"icon location\n"); - fprintf(stderr,"\t ID %lx\n",body[0]); - fprintf(stderr,"\t frame ID %lx\n",body[1]); - fprintf(stderr,"\t fvwm ptr %lx\n",body[2]); - fprintf(stderr,"\t icon x %ld\n",(long)body[3]); - fprintf(stderr,"\t icon y %ld\n",(long)body[4]); - fprintf(stderr,"\t icon w %ld\n",(long)body[5]); - fprintf(stderr,"\t icon h %ld\n",(long)body[6]); -} - - - -/*********************************************************************** - * - * Procedure: - * list_deiconify - displays packet contents to stderr - * - ***********************************************************************/ - -void list_deiconify(unsigned long *body) -{ - fprintf(stderr,"de-iconify\n"); - fprintf(stderr,"\t ID %lx\n",body[0]); - fprintf(stderr,"\t frame ID %lx\n",body[1]); - fprintf(stderr,"\t fvwm ptr %lx\n",body[2]); -} - -/*********************************************************************** - * - * Procedure: - * list_window_name - displays packet contents to stderr - * - ***********************************************************************/ - -void list_window_name(unsigned long *body) -{ - fprintf(stderr,"window name\n"); - fprintf(stderr,"\t ID %lx\n",body[0]); - fprintf(stderr,"\t frame ID %lx\n",body[1]); - fprintf(stderr,"\t fvwm ptr %lx\n",body[2]); - fprintf(stderr,"\t window name %s\n",(char *)(&body[3])); - -} - - -/*********************************************************************** - * - * Procedure: - * list_icon_name - displays packet contents to stderr - * - ***********************************************************************/ -void list_icon_name(unsigned long *body) -{ - fprintf(stderr,"icon name\n"); - fprintf(stderr,"\t ID %lx\n",body[0]); - fprintf(stderr,"\t frame ID %lx\n",body[1]); - fprintf(stderr,"\t fvwm ptr %lx\n",body[2]); - fprintf(stderr,"\t icon name %s\n",(char *)(&body[3])); -} - - - -/*********************************************************************** - * - * Procedure: - * list_class - displays packet contents to stderr - * - ***********************************************************************/ -void list_class(unsigned long *body) -{ - fprintf(stderr,"window class\n"); - fprintf(stderr,"\t ID %lx\n",body[0]); - fprintf(stderr,"\t frame ID %lx\n",body[1]); - fprintf(stderr,"\t fvwm ptr %lx\n",body[2]); - fprintf(stderr,"\t window class %s\n",(char *)(&body[3])); -} - - -/*********************************************************************** - * - * Procedure: - * list_res_name - displays packet contents to stderr - * - ***********************************************************************/ -void list_res_name(unsigned long *body) -{ - fprintf(stderr,"class resource name\n"); - fprintf(stderr,"\t ID %lx\n",body[0]); - fprintf(stderr,"\t frame ID %lx\n",body[1]); - fprintf(stderr,"\t fvwm ptr %lx\n",body[2]); - fprintf(stderr,"\t resource name %s\n",(char *)(&body[3])); -} - -/*********************************************************************** - * - * Procedure: - * list_end - displays packet contents to stderr - * - ***********************************************************************/ -void list_end(void) -{ - fprintf(stderr,"Send_WindowList End\n"); -} - diff --git a/app/fvwm/extras/FvwmDebug/FvwmDebug.h b/app/fvwm/extras/FvwmDebug/FvwmDebug.h deleted file mode 100644 index 93e83baf4..000000000 --- a/app/fvwm/extras/FvwmDebug/FvwmDebug.h +++ /dev/null @@ -1,50 +0,0 @@ -#include "config.h" -#include "fvwmlib.h" - -/************************************************************************* - * - * Subroutine Prototypes - * - *************************************************************************/ -void Loop(int *fd); -void SendInfo(int *fd,char *message,unsigned long window); -char *safemalloc(int length); -void DeadPipe(int nonsense); -void process_message(unsigned long type,unsigned long *body); - -void list_add(unsigned long *body); -void list_configure(unsigned long *body); -void list_destroy(unsigned long *body); -void list_focus(unsigned long *body); -void list_toggle(unsigned long *body); -void list_new_page(unsigned long *body); -void list_new_desk(unsigned long *body); -void list_raise(unsigned long *body); -void list_lower(unsigned long *body); -void list_unknown(unsigned long *body); -void list_iconify(unsigned long *body); -void list_icon_loc(unsigned long *body); -void list_deiconify(unsigned long *body); -void list_map(unsigned long *body); -void list_window_name(unsigned long *body); -void list_icon_name(unsigned long *body); -void list_class(unsigned long *body); -void list_res_name(unsigned long *body); -void list_end(void); - - -#ifdef HAVE_WAITPID -# define ReapChildrenPid(pid) waitpid(pid, NULL, WNOHANG) -#elif HAVE_WAIT4 -# define ReapChildrenPid(pid) wait4(pid, NULL, WNOHANG, NULL) -#else -# error One of waitpid or wait4 is needed. -#endif - -#if HAVE_SETVBUF -# if SETVBUF_REVERSED -# define setvbuf(stream,buf,mode,size) setvbuf(stream,mode,buf,size) -# endif -#else -# define setvbuf(a,b,c,d) setlinebuf(a) -#endif diff --git a/app/fvwm/extras/FvwmGoodStuff/FvwmGoodStuff.1 b/app/fvwm/extras/FvwmGoodStuff/FvwmGoodStuff.1 deleted file mode 100644 index 35384b296..000000000 --- a/app/fvwm/extras/FvwmGoodStuff/FvwmGoodStuff.1 +++ /dev/null @@ -1,172 +0,0 @@ -.\" t -.\" @(#)FvwmGoodStuff.1 1/28/94 -.TH FvwmGoodStuff 1.20 "Jan 28 1994" -.UC -.SH NAME -FvwmGoodStuff \- the FVWM button panel module -.SH SYNOPSIS -FvwmGoodStuff is spawned by fvwm, so no command line invocation will work. - -.SH DESCRIPTION -The FvwmGoodStuff module provides a button panel which sits on the X -terminal's root window. The user can press the buttons at any time, -and trigger invocation of a user-specified command by the window -manager. FvwmGoodStuff only works when fvwm is used as the window -manager. - -The button panel can be of any configuration or geometry, and can have -monochrome or color icons to represent the actions which would be -invoked. - -Note that this is the older version of FvwmButtons (decended from fvwm -1.xx GoodStuff module), which was rewritten as of fvwm beta 2.0.42 to -have more powerful configuration capabilities (see it's man page). If -you don't want to exploit these new capabilities, or the new version -gives you troubles, you may want to use this older module instead. - -.SH COPYRIGHTS -The FvwmGoodStuff program, and the concept for interfacing this module -to the Window Manager, are all original work by Robert Nation - -Copyright 1993, Robert Nation. No guarantees or warranties or anything -are provided or implied in any way whatsoever. Use this program at -your own risk. Permission to use this program for any purpose is -given, as long as the copyright is kept intact. - - -.SH INITIALIZATION -During initialization, \fIFvwmGoodStuff\fP will search for a -configuration file which describes the button panel geometry, color, -icons, and actions. The format of this files will be described -later. The configuration file will be the one which fvwm used during -its initialization. - -If the FvwmGoodStuff executable is linked to another name, ie ln -s -FvwmGoodStuff TermStuff, or if FvwmGoodStuff is invoked with a -parameter, ie Module FvwmGoodStuff TermStuff, then another module -called TermStuff can be started with a completely different -configuration than FvwmGoodStuff, simply by changing the keywords -FvwmGoodStuff??? to TermStuff???. This way multiple button-bars can -be used. - -.SH INVOCATION -FvwmGoodStuff can be invoked by inserting the line 'Module FvwmGoodStuff' -in the .fvwmrc file. This can be placed on a line by itself, if -FvwmGoodStuff is to be spawned during fvwm's initialization, or can be -bound to a menu or mouse button or keystroke to invoke it later. Fvwm -will search directory specified in the ModulePath configuration option -to attempt to locate FvwmGoodStuff. - -.SH CONFIGURATION OPTIONS -The following options can be placed in the .fvwmrc file - -.IP "*FvwmGoodStuffGeometry \fIgeometry\fP" -Specifies the FvwmGoodStuff window location and/or size. If the size is -not specified, FvwmGoodStuff will auto-size itself in a reasonable -manner. The geometry is a standard X11 window geometry specification. - -.IP "*FvwmGoodStuffFont \fIfont\fP" -Specifies the font to be used for labeling the buttons. - -.IP "*FvwmGoodStuffRows \fIrows\fP" -Specifies the number of rows of buttons to be created. If unspecified, -2 rows will be used. - -.IP "*FvwmGoodStuffColumns \fIcolumns\fP" -Specifies the number of columns of buttons to be created. If -unspecified, the number of columns will be set to the number of -buttons requested, divided by the number of rows. If both the rows and -columns are specified, but do not specify as many buttons as are -defined, then the users columns specification will be ignored. - -.IP "*FvwmGoodStuffFore \fIcolor\fP" -Specifies the color for button label text and monochrome icons. - -.IP "*FvwmGoodStuffBack \fIcolor\fP" -Specifies the color for the buttons. - -.IP "*FvwmGoodStuff\fI[(w x h)]\fP \fIlabel icon command\fP" -Specifies a window manager built-in command, as described in the fvwm -man page, which should be executed when a button is pressed. The -label field is the text which will be written on the button. The icon -field specifies an X11 bitmap file or XPM color icon file, containing -the icon to display on the button. FvwmGoodStuff will search through -the path specified in the fvwm IconPath or PixmapPath configuration -items to find the icon file. If the optional \fI(w x h)\fP is -specified, then this button will be \fIw\fP times the normal button -width and \fIh\fP times the normal button height. If label is "-" -then the button label will not be displayed. - -If \fIcommand\fP is an fvwm Exec command, then the button will remain -pushed in until a window whose name or class matches the qouted -portion of the command is encountered. This is intended to provide -visual feedback to the user that the action he has requested will be -performed. If the qouted portion contains no characters, then the -button will pop out immediately. Note that users can continue -pressing the button, and re-executing the command, even when it looks -"pressed in." - -A single extension to the fvwm built-in command set is provided. A -command of the form: '*FvwmGoodStuff junk clock.xpm Swallow "Clock" Exec -rclock' will cause FvwmGoodStuff to spawn an rclock process, and capture -the first window whose name or resource is "Clock", and display it in -the button-bar. This is handy for applications like xclock, xbiff, -and xload. Modules can be swallowed by specifying the module instead -of 'Exec whatever', like: '*FvwmGoodStuff - foobar Swallow "FvwmPager" -FvwmPager 0 0'. - -NOTE: if you use xclock for this application, you will want to specify -xclock -padding 0. - - -.SH SAMPLE CONFIGURATION -The following are excepts from a .fvwmrc file which describe -FvwmGoodStuff initialization commands: - -.nf -.sp -############################################################## -# Load any modules which should be started during -# fvwm initialization -ModulePath /usr/lib/X11/fvwm:/usr/bin/X11 -Module FvwmGoodStuff - -# Make FvwmGoodStuff title-bar-less, sticky, and give it an icon -NoTitle FvwmGoodStuff -Sticky FvwmGoodStuff -Icon "FvwmGoodStuff" toolbox.xpm - -############################################################## -############################################################## -#Definitions used by the modules -*FvwmGoodStuffFore Black -*FvwmGoodStuffBack #908090 - -*FvwmGoodStuffGeometry -135-5 -*FvwmGoodStuffRows 1 -*FvwmGoodStuffFont -adobe-helvetica-medium-r-*-*-12-*-*-*-*-*-*-* - -*FvwmGoodStuff Resize resize.xpm Resize -*FvwmGoodStuff Move arrows2.xpm Move -*FvwmGoodStuff Lower Down Lower -*FvwmGoodStuff Raise Up Raise -*FvwmGoodStuff Kill bomb.xpm Destroy - -*FvwmGoodStuff Dopey rterm.xpm Exec "big_win" xterm -T big_win -geometry 80x50 -*FvwmGoodStuff Snoopy rterm.xpm Exec "small_win" xterm -T small_wi -*FvwmGoodStuff Xcalc rcalc.xpm Exec "Calculator" xcalc -*FvwmGoodStuff XMag magnifying_glass2.xpm Exec "xmag" xmag -*FvwmGoodStuff Mail mail2.xpm Exec "xmh" xmh -*FvwmGoodStuff(4x1) - whatever SwallowModule "Fvwm Pager" FvwmPager 0 3 -.sp -.fi - -The last line is a little tricky - it spawns an FvwmPager module, and -captures it to display in a quadruple width button. Since "-" is used -for the button label, the Pager will be resized to be as big as -possible within the button's borders. "whatever", of course, is a -non-existent icon file, and will be ignored by FvwmGoodStuff. - -.SH AUTHOR -Robert Nation - diff --git a/app/fvwm/extras/FvwmGoodStuff/FvwmGoodStuff.c b/app/fvwm/extras/FvwmGoodStuff/FvwmGoodStuff.c deleted file mode 100644 index a043a5eb9..000000000 --- a/app/fvwm/extras/FvwmGoodStuff/FvwmGoodStuff.c +++ /dev/null @@ -1,1644 +0,0 @@ -/* This module, and the entire GoodStuff program, and the concept for - * interfacing this module to the Window Manager, are all original work - * by Robert Nation - * - * Copyright 1993, Robert Nation. No guarantees or warantees or anything - * are provided or implied in any way whatsoever. Use this program at your - * own risk. Permission to use this program for any purpose is given, - * as long as the copyright is kept intact. */ - -#define TRUE 1 -#define FALSE - -#include "config.h" - -#ifdef HAVE_SYS_BSDTYPES_H -#include <sys/bsdtypes.h> /* Saul */ -#endif - -#include <stdio.h> -#include <signal.h> -#include <fcntl.h> -#include <string.h> -#include <sys/wait.h> -#include <sys/time.h> - -#if HAVE_SYS_SELECT_H -#include <sys/select.h> -#endif - -#include <unistd.h> -#include <ctype.h> -#include <stdlib.h> -#include "../../fvwm/module.h" - -#include <X11/keysym.h> -#include <X11/Xlib.h> -#include <X11/Xutil.h> -#include <X11/Xproto.h> -#include <X11/Xatom.h> -#include <X11/Intrinsic.h> - -#include "FvwmGoodStuff.h" -char *MyName; - -XFontStruct *font; - -Display *dpy; /* which display are we talking to */ -int x_fd,fd_width; - -Window Root; -int screen; -int d_depth; - -char *GoodStuffBack = "#908090"; -char *GoodStuffFore = "black"; -char *font_string = "fixed"; - -Pixel hilite_pix, back_pix, shadow_pix, fore_pix; -GC NormalGC,ShadowGC,ReliefGC; -Window main_win; -int Width, Height,win_x,win_y; - -#define MW_EVENTS (ExposureMask | StructureNotifyMask| ButtonReleaseMask |\ - ButtonPressMask|KeyReleaseMask|KeyPressMask) - -int num_buttons = 0; -int num_rows = 0; -int num_columns = 0; -int max_internal_width = 30,max_internal_height = 0; -int ButtonWidth,ButtonHeight; -int x= -100000,y= -100000,w= -1,h= -1,gravity = NorthWestGravity; -int new_desk = 0; -int ready = 0; -int xneg = 0, yneg = 0; -int xpad = 2, ypad = 4, framew = 2; - -int CurrentButton = -1; -int fd[2]; - -struct button_info Buttons[MAX_BUTTONS]; -char *iconPath = NULL; -char *pixmapPath = NULL; - -static Atom wm_del_win; -Atom _XA_WM_PROTOCOLS; -Atom _XA_WM_NORMAL_HINTS; -Atom _XA_WM_NAME; - -/*********************************************************************** - * - * Procedure: - * main - start of fvwm - * - *********************************************************************** -*/ -int main(int argc, char **argv) -{ - char *display_name = NULL; - int i,j; - Window root; - int x,y,border_width,depth,button; - char *temp, *s; - - if((argc != 6)&&(argc != 7)) - { - fprintf(stderr,"%s Version %s should only be executed by fvwm!\n",argv[0], - VERSION); - exit(1); - } - - temp = argv[0]; - - s=strrchr(argv[0], '/'); - if (s != NULL) - temp = s + 1; - - /* - ** if name passed in, use that instead - */ - if (argc > 6) - temp = argv[6]; - - MyName = safemalloc(strlen(temp)+1); - strcpy(MyName, temp); - - for(i=0;i<MAX_BUTTONS;i++) - { - Buttons[i].title = NULL; - Buttons[i].action = NULL; - Buttons[i].icon_file = NULL; - Buttons[i].icon_w = 0; - Buttons[i].icon_h = 0; - Buttons[i].BWidth = 1; - Buttons[i].BHeight = 1; - Buttons[i].IconWin = None; - Buttons[i].icon_maskPixmap = None; /* pixmap for the icon mask */ - Buttons[i].iconPixmap = None; - Buttons[i].icon_depth = 0; - Buttons[i].up = 1; /* Buttons start up */ - Buttons[i].hangon = NULL; /* don't wait on anything yet*/ - } - signal (SIGPIPE, DeadPipe); - - signal (SIGINT, DeadPipe); /* cleanup on other ways of closing too */ - signal (SIGHUP, DeadPipe); - signal (SIGQUIT, DeadPipe); - signal (SIGTERM, DeadPipe); - - fd[0] = atoi(argv[1]); - fd[1] = atoi(argv[2]); - - if (!(dpy = XOpenDisplay(display_name))) - { - fprintf(stderr,"%s: can't open display %s", MyName, - XDisplayName(display_name)); - exit (1); - } - x_fd = XConnectionNumber(dpy); - - fd_width = GetFdWidth(); - - screen= DefaultScreen(dpy); - Root = RootWindow(dpy, screen); - if(Root == None) - { - fprintf(stderr,"%s: Screen %d is not valid ", MyName, screen); - exit(1); - } - d_depth = DefaultDepth(dpy, screen); - - SetMessageMask(fd, M_NEW_DESK | M_END_WINDOWLIST| - M_MAP| M_RES_NAME| M_RES_CLASS| M_CONFIG_INFO| - M_END_CONFIG_INFO| M_WINDOW_NAME); - - ParseOptions(); - if(num_buttons == 0) - { - fprintf(stderr,"%s: No Buttons defined. Quitting\n", MyName); - exit(0); - } - - /* load the font, or none */ - if (strncasecmp(font_string,"none",4)==0) - { - font=NULL; - } - else - { - if ((font = XLoadQueryFont(dpy, font_string)) == NULL) - { - if ((font = XLoadQueryFont(dpy, "fixed")) == NULL) - { - fprintf(stderr,"%s: No fonts available\n",MyName); - exit(1); - } - } - }; - for(i=0;i<num_buttons;i++) - { - LoadIconFile(i); - if(Buttons[i].icon_w/Buttons[i].BWidth > max_internal_width) - max_internal_width = Buttons[i].icon_w/Buttons[i].BWidth; - if( (Buttons[i].title && strcmp(Buttons[i].title,"-")==0) || - font==NULL ) - { - if(Buttons[i].icon_h/Buttons[i].BHeight > max_internal_height) - max_internal_height = Buttons[i].icon_h/Buttons[i].BHeight; - } - else - { - if(Buttons[i].icon_h/Buttons[i].BHeight + font->ascent + font->descent > max_internal_height) - max_internal_height=Buttons[i].icon_h/Buttons[i].BHeight + font->ascent + font->descent; - }; - } - - CreateWindow(); - for(i=0;i<num_buttons;i++) - { - CreateIconWindow(i); - } - - XGetGeometry(dpy,main_win,&root,&x,&y, - (unsigned int *)&Width,(unsigned int *)&Height, - (unsigned int *)&border_width,(unsigned int *)&depth); - ButtonWidth = (Width+1) / num_columns; - ButtonHeight = (Height+1) / num_rows; - - for(i=0;i<num_rows;i++) - for(j=0;j<num_columns; j++) - { - button = i*num_columns + j; - ConfigureIconWindow(button,i,j); - } - XMapSubwindows(dpy,main_win); - XMapWindow(dpy,main_win); - - /* request a window list, since this triggers a response which - * will tell us the current desktop and paging status, needed to - * indent buttons correctly */ - SendText(fd,"Send_WindowList",0); - - Loop(); - return 0; -} - -/*********************************************************************** - * - * Procedure: - * Loop - wait for data to process - * - ***********************************************************************/ -void Loop(void) -{ - Window root; - int x,y,border_width,depth,CurrentRow,CurrentColumn; - XEvent Event; - int NewButton,i,j,button,tw,th,i2,ih,iw,i3; - char *temp,*tmp; - - char buffer[10]; - KeySym keysym; - int blah; - - while(1) - { - if(My_XNextEvent(dpy,&Event)) - { - switch(Event.type) - { - case Expose: - if((Event.xexpose.count == 0)&& - (Event.xany.window == main_win)) - { - if(ready < 1) - ready ++; - RedrawWindow(-1); - } - break; - - case ConfigureNotify: - XGetGeometry(dpy,main_win,&root,&x,&y, - (unsigned int *)&tw,(unsigned int *)&th, - (unsigned int *)&border_width, - (unsigned int *)&depth); - if((tw != Width)||(th!= Height)) - { - Width = tw; - Height = th; - ButtonWidth = (Width+1) / num_columns; - ButtonHeight = (Height+1) / num_rows; - XClearWindow(dpy,main_win); - - for(i=0;i<num_rows;i++) - for(j=0;j<num_columns; j++) - { - button = i*num_columns + j; - if(Buttons[button].swallow == 0) - ConfigureIconWindow(button,i,j); - else if(Buttons[button].swallow == 3) - { - ih = Buttons[button].BHeight*ButtonHeight; - iw = Buttons[button].BWidth*ButtonWidth; - Buttons[button].icon_w = - iw - 2*framew; - if(strcmp(Buttons[button].title,"-")==0||font==NULL) - { - Buttons[button].icon_h = - ih - 2*framew; - } - else - { - Buttons[button].icon_h = - ih - 2*framew - font->ascent - font->descent; - ih -= font->ascent + font->descent; - } - - ConstrainSize(&Buttons[button].hints, - &Buttons[button].icon_w, - &Buttons[button].icon_h); - - XResizeWindow(dpy,Buttons[button].IconWin, - Buttons[button].icon_w, - Buttons[button].icon_h); - XMoveWindow(dpy,Buttons[button].IconWin, - j*ButtonWidth + - ((iw - Buttons[button].icon_w)>>1), - i*ButtonHeight + - ((ih - Buttons[button].icon_h)>>1)); - - - } - } - RedrawWindow(-1); - } - break; - - case KeyPress: - blah = XLookupString(&Event.xkey, buffer, 10, - &keysym, 0); - if ((keysym != XK_Return) && (keysym != XK_KP_Enter) - && (keysym != XK_Linefeed)) - break; - /* fall through */ - case ButtonPress: - CurrentRow = (Event.xbutton.y/ButtonHeight); - CurrentColumn = (Event.xbutton.x/ButtonWidth); - CurrentButton = CurrentColumn + CurrentRow*num_columns; - for(i=0;i<=CurrentRow;i++) - for(j=0;j<= CurrentColumn; j++) - if(Buttons[i*num_columns+j].title!= NULL) - { - if(((CurrentRow - i)< Buttons[i*num_columns+j].BHeight)&& - (CurrentColumn-j)< Buttons[i*num_columns+j].BWidth) - { - CurrentButton = i*num_columns+j; - } - } - RedrawWindow(CurrentButton); - break; - - case KeyRelease: - case ButtonRelease: - CurrentRow = (Event.xbutton.y/ButtonHeight); - CurrentColumn = (Event.xbutton.x/ButtonWidth); - NewButton = CurrentColumn + CurrentRow*num_columns; - for(i=0;i<=CurrentRow;i++) - for(j=0;j<= CurrentColumn; j++) - if(Buttons[i*num_columns+j].title!= NULL) - { - if(((CurrentRow - i)< Buttons[i*num_columns+j].BHeight)&& - (CurrentColumn-j)< Buttons[i*num_columns+j].BWidth) - { - NewButton = i*num_columns+j; - } - } - if(NewButton == CurrentButton) - { - if((Buttons[CurrentButton].action)&& - (strncasecmp(Buttons[CurrentButton].action,"exec",4)== 0)) - { - /* Look for Exec "identifier", in which - * case the button stays down until window - * "identifier" materializes */ - i=4; - while((Buttons[CurrentButton].action[i] != 0)&& - (Buttons[CurrentButton].action[i] != '"')&& - isspace(Buttons[CurrentButton].action[i])) - i++; - if(Buttons[CurrentButton].action[i] == '"') - { - i2=i+1; - while((Buttons[CurrentButton].action[i2] != 0)&& - (Buttons[CurrentButton].action[i2] != '"')) - i2++; - } - else - i2 = i; - - if(i2 - i >1) - { - Buttons[CurrentButton].hangon = safemalloc(i2-i); - strncpy(Buttons[CurrentButton].hangon, - &Buttons[CurrentButton].action[i+1],i2-i-1); - Buttons[CurrentButton].hangon[i2-i-1] = 0; - Buttons[CurrentButton].up = 0; - Buttons[CurrentButton].swallow = 0; - } - else - { -#if 0 - i2 = 4; /* ckh - should this be i2++ instead? */ -#else - i2++; -#endif - } - tmp=safemalloc(strlen(Buttons[CurrentButton].action)); - strcpy(tmp,"Exec "); - i3= i2+1; - while((Buttons[CurrentButton].action[i3] != 0)&& - (isspace(Buttons[CurrentButton].action[i3]))) - i3++; - strcat(tmp,&Buttons[CurrentButton].action[i3]); - SendInfo(fd,tmp,0); - free(tmp); -/* } - else - SendInfo(fd,Buttons[CurrentButton].action,0); -*/ - } - else - { - /* fprintf(stderr,"sending action to fvwm\n"); */ - SendInfo(fd,Buttons[CurrentButton].action,0); - } - } - CurrentButton = -1; - RedrawWindow(CurrentButton); - break; - case ClientMessage: - if ((Event.xclient.format==32) && - (Event.xclient.data.l[0]==wm_del_win)) - { - DeadPipe(1); - } - break; - case PropertyNotify: - for(i=0;i<num_rows;i++) - for(j=0;j<num_columns; j++) - { - button = i*num_columns + j; - if((Buttons[button].swallow == 3)&& - (Event.xany.window == Buttons[button].IconWin)&& - (Event.xproperty.atom == XA_WM_NAME)) - { - XFetchName(dpy, Buttons[button].IconWin, &temp); - if(strcmp(Buttons[button].title,"-")!=0) - CopyString(&Buttons[button].title, temp); - XFree(temp); - XClearArea(dpy,main_win,j*ButtonWidth, - i*ButtonHeight, ButtonWidth,ButtonHeight,0); - RedrawWindow(button); - } - if((Buttons[button].swallow == 3)&& - (Event.xany.window == Buttons[button].IconWin)&& - (Event.xproperty.atom == XA_WM_NORMAL_HINTS)) - { - int iw,ih; - long supplied; - - if (!XGetWMNormalHints (dpy, Buttons[button].IconWin, - &Buttons[button].hints, - &supplied)) - Buttons[button].hints.flags = 0; - ih = Buttons[button].icon_h + 2*framew; - iw = Buttons[button].icon_w + 2*framew; - ConstrainSize(&Buttons[button].hints, - &Buttons[button].icon_w, - &Buttons[button].icon_h); - - XResizeWindow(dpy,Buttons[button].IconWin, - Buttons[button].icon_w, - Buttons[button].icon_h); - XMoveWindow(dpy,Buttons[button].IconWin, - j*ButtonWidth + - ((iw - Buttons[button].icon_w)>>1), - i*ButtonHeight + - ((ih - Buttons[button].icon_h)>>1)); - } - } - break; - - default: - break; - } - } - } - return; -} - -/************************************************************************ - * - * Draw the window - * - ***********************************************************************/ -void RedrawWindow(int newbutton) -{ - int i,j,w,button,len,yoff2,BW,BH; - XEvent dummy; - int val1,val2; - - if(ready < 1) - return; - - while (XCheckTypedWindowEvent (dpy, main_win, Expose, &dummy)); - - for(i=0;i<num_rows;i++) - for(j=0;j<num_columns; j++) - { - button = i*num_columns + j; - BW = ButtonWidth*Buttons[button].BWidth; - BH = ButtonHeight*Buttons[button].BHeight; - if((newbutton == -1)||(newbutton == button)) - { - if((Buttons[button].swallow == 3)&& - (Buttons[button].IconWin != None)) - XSetWindowBorderWidth(dpy,Buttons[button].IconWin,0); - if(Buttons[button].title != NULL) - { - if(strcmp(Buttons[button].title,"-")!=0 && font) - { - len = strlen(Buttons[button].title); - w=XTextWidth(font,Buttons[button].title,len); - while((w > (BW-2*framew))&&(len>0)) - { - len--; - w=XTextWidth(font,Buttons[button].title,len); - } - if(len>0) - { - if((Buttons[button].icon_w>0)&& - (Buttons[button].icon_h>0)) - { - yoff2 = BH - font->descent - 2*framew; - XDrawString(dpy,main_win,NormalGC, - j*ButtonWidth+((BW - w)>>1), - i*ButtonHeight+yoff2, - Buttons[button].title, len); - } - else - { - XDrawString(dpy,main_win,NormalGC, - j*ButtonWidth+((BW - w)>>1), - i*ButtonHeight+((ButtonHeight + - font->ascent - font->descent)>>1), - Buttons[button].title, len); - } - } - } - if((Buttons[button].action)&& - (strncasecmp(Buttons[button].action,"Desk",4)==0)) - { - sscanf(&Buttons[button].action[4],"%d %d",&val1,&val2); - if((val1 == 0)&&(val2 == new_desk)) - { - RelieveWindow(main_win,j*ButtonWidth, i*ButtonHeight, - BW, BH, ShadowGC,ReliefGC); - } - else - RelieveWindow(main_win,j*ButtonWidth, i*ButtonHeight, - BW, BH, - (CurrentButton==button)?ShadowGC:ReliefGC, - (CurrentButton==button)?ReliefGC:ShadowGC); - } - else if(Buttons[button].up == 1) - { - RelieveWindow(main_win,j*ButtonWidth, i*ButtonHeight, - BW, BH, - (CurrentButton == button)?ShadowGC:ReliefGC, - (CurrentButton == button)?ReliefGC:ShadowGC); - } - else - { - RelieveWindow(main_win,j*ButtonWidth, i*ButtonHeight, - BW, BH, ShadowGC,ReliefGC); - } - } - } - } -} - -/**************************************************************************** - * - * Draws the relief pattern around a window - * - ****************************************************************************/ -void RelieveWindow(Window win,int x,int y,int w,int h, GC rgc,GC sgc) -{ - XSegment seg[4]; - int i; - - i=0; - seg[i].x1 = x; seg[i].y1 = y; - seg[i].x2 = w+x-1; seg[i++].y2 = y; - - seg[i].x1 = x; seg[i].y1 = y; - seg[i].x2 = x; seg[i++].y2 = h+y-1; - - seg[i].x1 = x+1; seg[i].y1 = y+1; - seg[i].x2 = x+w-2; seg[i++].y2 = y+1; - - seg[i].x1 = x+1; seg[i].y1 = y+1; - seg[i].x2 = x+1; seg[i++].y2 = y+h-2; - XDrawSegments(dpy, win, rgc, seg, i); - - i=0; - seg[i].x1 = x; seg[i].y1 = y+h-1; - seg[i].x2 = w+x-1; seg[i++].y2 = y+h-1; - - seg[i].x1 = x+w-1; seg[i].y1 = y; - seg[i].x2 = x+w-1; seg[i++].y2 = y+h-1; - if(d_depth<2) - XDrawSegments(dpy, win, ShadowGC, seg, i); - else - XDrawSegments(dpy, win, sgc, seg, i); - - i=0; - seg[i].x1 = x+1; seg[i].y1 = y+h-2; - seg[i].x2 = x+w-2; seg[i++].y2 = y+h-2; - - seg[i].x1 = x+w-2; seg[i].y1 = y+1; - seg[i].x2 = x+w-2; seg[i++].y2 = y+h-2; - - XDrawSegments(dpy, win, sgc, seg, i); -} - -/************************************************************************ - * - * Sizes and creates the window - * - ***********************************************************************/ -XSizeHints mysizehints; -void CreateWindow(void) -{ - XGCValues gcv; - unsigned long gcm; - int actual_buttons_used,first_avail_button,i,j,k,sb,tb; - - wm_del_win = XInternAtom(dpy,"WM_DELETE_WINDOW",False); - _XA_WM_PROTOCOLS = XInternAtom (dpy, "WM_PROTOCOLS", False); - - /* Allow for multi-width/height buttons */ - actual_buttons_used = 0; - first_avail_button = num_buttons; - for(i=0;i<num_buttons;i++) - actual_buttons_used += Buttons[i].BWidth*Buttons[i].BHeight; - - if(actual_buttons_used > MAX_BUTTONS) - { - fprintf(stderr,"%s: Out of Buttons!\n",MyName); - exit(0); - } - num_buttons = actual_buttons_used; - - /* size and create the window */ - if((num_rows == 0)&&(num_columns == 0)) - num_rows = 2; - if(num_columns == 0) - { - num_columns = num_buttons/num_rows; - while(num_rows * num_columns < num_buttons) - num_columns++; - } - if(num_rows == 0) - { - num_rows = num_buttons/num_columns; - while(num_rows * num_columns < num_buttons) - num_rows++; - } - - while(num_rows * num_columns < num_buttons) - num_columns++; - - /* Now have allocated enough space for the buttons, need to shuffle to - * make room for the big ones. */ - for(i=0;i<num_buttons;i++) - { - if((Buttons[i].BHeight > 1)||(Buttons[i].BWidth > 1)) - { - /* if not enough room underneath, give up */ - if(num_rows - (i/num_columns) < Buttons[i].BHeight) - { - fprintf(stderr,"%s: Button too tall. Giving up\n",MyName); - fprintf(stderr,"Button = %d num_rows = %d bheight = %d h = %d\n", - i,num_rows,Buttons[i].BHeight, - num_rows - (i/num_columns)); - Buttons[i].BHeight = 1; - } - if(num_columns - (i %num_columns) < Buttons[i].BWidth) - { - fprintf(stderr,"%s: Button too wide. Giving up.\n",MyName); - fprintf(stderr,"Button = %d num_columns = %d bwidth = %d w = %d\n", - i,num_columns,Buttons[i].BWidth, - num_columns - (i%num_rows)); - Buttons[i].BWidth = 1; - } - for(k=0;k<Buttons[i].BHeight;k++) - for(j=0;j<Buttons[i].BWidth;j++) - { - if((j>0)||(k>0)) - { - if((Buttons[i+j+k*num_columns].title== NULL)&& - (Buttons[i+j+k*num_columns].action== NULL)&& - (Buttons[i+j+k*num_columns].icon_file== NULL)) - { - Buttons[i+j+k*num_columns].BWidth = 0; - Buttons[i+j+k*num_columns].BHeight = 0; - } - else - { - first_avail_button = i+1; - while((first_avail_button<num_buttons)&& - ((Buttons[first_avail_button].BWidth == 0)|| - (Buttons[first_avail_button].title!= NULL)|| - (Buttons[first_avail_button].action!= NULL)|| - (Buttons[first_avail_button].icon_file!= NULL)|| - (first_avail_button == i+j+k*num_columns))) - first_avail_button++; - - if(first_avail_button >= num_buttons) - { - fprintf(stderr,"%s: Button Confusion!\n",MyName); - exit(1); - } - /* NO! I think you should shift the List to get the free space */ - /* Shifting First_Avail-1 --> First_Avail :: downwards */ - /* Attention: exclude the buttons allready freed for the Bigs */ - /* I don't know how to determine such a freed button. */ - /* That's why I used this full WHILE-Codelines */ - /* tb := TARGET_BOTTON sb := SOURCE_BOTTON for shifting */ - /* palme@elphy.irz.hu-berlin.de */ - - tb=first_avail_button; - sb=tb-1; - while(sb>=(i+j+k*num_columns)) - { - while( - (Buttons[sb].action == NULL) && - (Buttons[sb].title == NULL) && - (Buttons[sb].icon_file == NULL) && - (Buttons[sb].IconWin == None) && - (Buttons[sb].iconPixmap == None) && - (Buttons[sb].icon_maskPixmap == None) && - (Buttons[sb].icon_w == 0) && - (Buttons[sb].icon_h == 0) && - (Buttons[sb].icon_depth == 0) && - (Buttons[sb].swallow == 0) && - (Buttons[sb].module == 0) && - (Buttons[sb].hangon == NULL) && - (Buttons[sb].up == 1) && - (Buttons[sb].BWidth == 0) && - (Buttons[sb].BHeight == 0) - ) sb--; /* ignore already freed SourceBotton */ - Buttons[tb].action = Buttons[sb].action; - Buttons[tb].title = Buttons[sb].title; - Buttons[tb].icon_file = Buttons[sb].icon_file; - Buttons[tb].BWidth = Buttons[sb].BWidth; - Buttons[tb].BHeight = Buttons[sb].BHeight; - Buttons[tb].icon_w = Buttons[sb].icon_w; - Buttons[tb].icon_h = Buttons[sb].icon_h; - Buttons[tb].iconPixmap = Buttons[sb].iconPixmap; - Buttons[tb].icon_maskPixmap = Buttons[sb].icon_maskPixmap; - Buttons[tb].IconWin = Buttons[sb].IconWin; - Buttons[tb].hints = Buttons[sb].hints; - Buttons[tb].icon_depth = Buttons[sb].icon_depth; - Buttons[tb].hangon = Buttons[sb].hangon; - Buttons[tb].swallow = Buttons[sb].swallow; - tb--; - while( - (Buttons[tb].action == NULL) && - (Buttons[tb].title == NULL) && - (Buttons[tb].icon_file == NULL) && - (Buttons[tb].IconWin == None) && - (Buttons[tb].iconPixmap == None) && - (Buttons[tb].icon_maskPixmap == None) && - (Buttons[tb].icon_w == 0) && - (Buttons[tb].icon_h == 0) && - (Buttons[tb].icon_depth == 0) && - (Buttons[tb].swallow == 0) && - (Buttons[tb].module == 0) && - (Buttons[tb].hangon == NULL) && - (Buttons[tb].up == 1) && - (Buttons[tb].BWidth == 0) && - (Buttons[tb].BHeight == 0) - ) tb--; /* ignore Targed_Botton if this is a freed one */ - sb--; - } - - /* No follows the Original Code which frees the current Botton */ - -/* Buttons[first_avail_button].action = - Buttons[i+j+k*num_columns].action; - Buttons[first_avail_button].title = - Buttons[i+j+k*num_columns].title; - Buttons[first_avail_button].icon_file = - Buttons[i+j+k*num_columns].icon_file; - Buttons[first_avail_button].BWidth = - Buttons[i+j+k*num_columns].BWidth; - Buttons[first_avail_button].BHeight = - Buttons[i+j+k*num_columns].BHeight; - Buttons[first_avail_button].icon_w = - Buttons[i+j+k*num_columns].icon_w; - Buttons[first_avail_button].icon_h = - Buttons[i+j+k*num_columns].icon_h; - Buttons[first_avail_button].iconPixmap = - Buttons[i+j+k*num_columns].iconPixmap; - Buttons[first_avail_button].icon_maskPixmap = - Buttons[i+j+k*num_columns].icon_maskPixmap; - Buttons[first_avail_button].IconWin = - Buttons[i+j+k*num_columns].IconWin; - Buttons[first_avail_button].hints = - Buttons[i+j+k*num_columns].hints; - Buttons[first_avail_button].icon_depth = - Buttons[i+j+k*num_columns].icon_depth; - Buttons[first_avail_button].hangon = - Buttons[i+j+k*num_columns].hangon; - Buttons[first_avail_button].swallow = - Buttons[i+j+k*num_columns].swallow; -*/ - Buttons[i+j+k*num_columns].action = NULL; - Buttons[i+j+k*num_columns].title = NULL; - Buttons[i+j+k*num_columns].icon_file = NULL; - Buttons[i+j+k*num_columns].IconWin = None; - Buttons[i+j+k*num_columns].iconPixmap = None; - Buttons[i+j+k*num_columns].icon_maskPixmap = None; - Buttons[i+j+k*num_columns].icon_w = 0; - Buttons[i+j+k*num_columns].icon_h = 0; - Buttons[i+j+k*num_columns].icon_depth = 0; - Buttons[i+j+k*num_columns].swallow = 0; - Buttons[i+j+k*num_columns].module = 0; - Buttons[i+j+k*num_columns].hangon = NULL; - Buttons[i+j+k*num_columns].up = 1; - Buttons[i+j+k*num_columns].BWidth = 0; - Buttons[i+j+k*num_columns].BHeight = 0; - - } - } - } - } - } - - - mysizehints.flags = PWinGravity| PResizeInc | PBaseSize; - /* subtract one for the right/bottom border */ /* But that ruins it! Jarl */ - mysizehints.width = (max_internal_width+2*(xpad+framew))*num_columns; - mysizehints.height= (max_internal_height+2*(ypad+framew))*num_rows; - mysizehints.width_inc = num_columns; - mysizehints.height_inc = num_rows; -/* Stupid thing to do? Makes the window too small on my Xservers. Jarl - mysizehints.base_height = num_rows - 1; - mysizehints.base_width = num_columns - 1; -*/ - mysizehints.base_height = num_rows; - mysizehints.base_width = num_columns; - - if(w > -1) - { - w = w - w%num_columns; - mysizehints.width = w; - h = h - h%num_rows; - mysizehints.height = h; - mysizehints.flags |= USSize; - } - - if(x > -100000) - { - if (xneg) - { - mysizehints.x = DisplayWidth(dpy,screen) + x - mysizehints.width; - gravity = NorthEastGravity; - } - else - mysizehints.x = x; - if (yneg) - { - mysizehints.y = DisplayHeight(dpy,screen) + y - mysizehints.height; - gravity = SouthWestGravity; - } - else - mysizehints.y = y; - - if(xneg && yneg) - gravity = SouthEastGravity; - mysizehints.flags |= USPosition; - } - - mysizehints.win_gravity = gravity; - - if(d_depth < 2) - { - back_pix = GetColor("white"); - fore_pix = GetColor("black"); - hilite_pix = back_pix; - shadow_pix = fore_pix; - } - else - { - back_pix = GetColor(GoodStuffBack); - fore_pix = GetColor(GoodStuffFore); - hilite_pix = GetHilite(back_pix); - shadow_pix = GetShadow(back_pix); - - } - - main_win = XCreateSimpleWindow(dpy,Root,mysizehints.x,mysizehints.y, - mysizehints.width,mysizehints.height, - 0,fore_pix,back_pix); - XSetWMProtocols(dpy,main_win,&wm_del_win,1); - - XSetWMNormalHints(dpy,main_win,&mysizehints); - XSelectInput(dpy,main_win,MW_EVENTS); - change_window_name(MyName); - - gcm = GCForeground|GCBackground; - gcv.foreground = hilite_pix; - gcv.background = back_pix; - ReliefGC = XCreateGC(dpy, Root, gcm, &gcv); - - gcm = GCForeground|GCBackground; - gcv.foreground = shadow_pix; - gcv.background = back_pix; - ShadowGC = XCreateGC(dpy, Root, gcm, &gcv); - - gcm = GCForeground|GCBackground; - if(font) - { - gcv.font = font->fid; - gcm |= GCFont; - } - gcv.foreground = fore_pix; - gcv.background = back_pix; - NormalGC = XCreateGC(dpy, Root, gcm, &gcv); -} - - - - - - - -/**************************************************************************** - * - * This routine computes the shadow color from the background color - * - ****************************************************************************/ -Pixel GetShadow(Pixel background) -{ - XColor bg_color; - XWindowAttributes attributes; - - XGetWindowAttributes(dpy,Root,&attributes); - - bg_color.pixel = background; - XQueryColor(dpy,attributes.colormap,&bg_color); - - bg_color.red = (unsigned short)((bg_color.red*50)/100); - bg_color.green = (unsigned short)((bg_color.green*50)/100); - bg_color.blue = (unsigned short)((bg_color.blue*50)/100); - - if(!XAllocColor(dpy,attributes.colormap,&bg_color)) - nocolor("alloc shadow",""); - - return bg_color.pixel; -} - -/**************************************************************************** - * - * This routine computes the hilight color from the background color - * - ****************************************************************************/ -Pixel GetHilite(Pixel background) -{ - XColor bg_color, white_p; - XWindowAttributes attributes; - - XGetWindowAttributes(dpy,Root,&attributes); - - bg_color.pixel = background; - XQueryColor(dpy,attributes.colormap,&bg_color); - - white_p.pixel = GetColor("white"); - XQueryColor(dpy,attributes.colormap,&white_p); - - bg_color.red = max((white_p.red/5), bg_color.red); - bg_color.green = max((white_p.green/5), bg_color.green); - bg_color.blue = max((white_p.blue/5), bg_color.blue); - - bg_color.red = min(white_p.red, (bg_color.red*140)/100); - bg_color.green = min(white_p.green, (bg_color.green*140)/100); - bg_color.blue = min(white_p.blue, (bg_color.blue*140)/100); - - if(!XAllocColor(dpy,attributes.colormap,&bg_color)) - nocolor("alloc hilight",""); - - return bg_color.pixel; -} - - -void nocolor(char *a, char *b) -{ - fprintf(stderr,"%s: can't %s %s\n", MyName, a,b); -} - - -/**************************************************************************** - * - * Loads a single color - * - ****************************************************************************/ -Pixel GetColor(char *name) -{ - XColor color; - XWindowAttributes attributes; - - XGetWindowAttributes(dpy,Root,&attributes); - color.pixel = 0; - if (!XParseColor (dpy, attributes.colormap, name, &color)) - { - nocolor("parse",name); - } - else if(!XAllocColor (dpy, attributes.colormap, &color)) - { - nocolor("alloc",name); - } - return color.pixel; -} - - -/************************************************************************ - * - * Dead pipe handler - * - ***********************************************************************/ -void DeadPipe(int nonsense) -{ - int i,j,button; - - signal(SIGPIPE, SIG_IGN);/* Xsync may cause SIGPIPE */ - for(i=0;i<num_rows;i++) - for(j=0;j<num_columns; j++) - { - button = i*num_columns + j; - /* delete swallowed windows, but not modules (fvwm handles those) */ - /* if((Buttons[button].swallow == 3)&&(Buttons[button].module == 0)) */ - /* the above doesn't seem to hold true any more - CKH */ - if(Buttons[button].swallow == 3) - { - send_clientmessage(dpy,Buttons[button].IconWin,wm_del_win,CurrentTime); - XSync(dpy,0); - } - } - XSync(dpy,0); - exit(0); -} - -/***************************************************************************** - * - * This routine is responsible for reading and parsing the config file - * - ****************************************************************************/ -void ParseOptions(void) -{ - char *tline,*tmp; - int Clength, len; - - Clength = strlen(MyName); - - GetConfigLine(fd,&tline); - while(tline != (char *)0) - { - int g_x, g_y, flags; - unsigned width,height; - - if((strlen(&tline[0])>1)&& - (strncasecmp(tline,CatString3("*", MyName, "Geometry"),Clength+9)==0)) - { - tmp = &tline[Clength+9]; - while(((isspace(*tmp))&&(*tmp != '\n'))&&(*tmp != 0)) - { - tmp++; - } - tmp[strlen(tmp)-1] = 0; - - flags = XParseGeometry(tmp,&g_x,&g_y,&width,&height); - if (flags & WidthValue) - w = width; - if (flags & HeightValue) - h = height; - if (flags & XValue) - x = g_x; - if (flags & YValue) - y = g_y; - if (flags & XNegative) - xneg = 1; - if (flags & YNegative) - yneg = 1; - } - else if((strlen(&tline[0])>1)&& - (strncasecmp(tline,CatString3("*",MyName,"Font"),Clength+5)==0)) - { - CopyString(&font_string,&tline[Clength+5]); - } - else if((strlen(&tline[0])>1)&& - (strncasecmp(tline,CatString3("*",MyName,"Rows"),Clength+5)==0)) - { - len=sscanf(&tline[Clength+5],"%d",&num_rows); - if(len < 1) - num_rows = 0; - } - else if((strlen(&tline[0])>1)&& - (strncasecmp(tline,CatString3("*",MyName,"Columns"),Clength+8)==0)) - { - len=sscanf(&tline[Clength+8],"%d",&num_columns); - if(len < 1) - num_columns = 0; - } - else if((strlen(&tline[0])>1)&& - (strncasecmp(tline,CatString3("*",MyName,"Padding"),Clength+8)==0)) - { - len=sscanf(&tline[Clength+8],"%d %d",&xpad,&ypad); - if(len < 2) - ypad=xpad; - if(len < 1) - { - xpad = 2; - ypad = 4; - } - } -/* else if((strlen(&tline[0])>1)&& - (strncasecmp(tline,CatString3("*",MyName,"PadY"),Clength+5)==0)) - { - len=sscanf(&tline[Clength+5],"%d",&ypad); - if(len < 1) - ypad = 3; - } -*/ - else if((strlen(&tline[0])>1)&& - (strncasecmp(tline,CatString3("*",MyName,"Fore"),Clength+5)==0)) - { - CopyString(&GoodStuffFore,&tline[Clength+5]); - } - else if((strlen(&tline[0])>1)&& - (strncasecmp(tline,CatString3("*",MyName, "Back"),Clength+5)==0)) - { - CopyString(&GoodStuffBack,&tline[Clength+5]); - } - else if((strlen(&tline[0])>1)&& - (strncasecmp(tline,CatString3("*", MyName, ""),Clength+1)==0)&& - (num_buttons < MAX_BUTTONS)) - { - match_string(&tline[Clength+1]); - } - else if((strlen(&tline[0])>1)&&(strncasecmp(tline,"IconPath",8)==0)) - { - CopyString(&iconPath,&tline[8]); - } - else if((strlen(&tline[0])>1)&&(strncasecmp(tline,"PixmapPath",10)==0)) - { - CopyString(&pixmapPath,&tline[10]); - } - GetConfigLine(fd,&tline); - } - return; -} - - -/************************************************************************** - * - * Parses a button command line from the config file - * - *************************************************************************/ -void match_string(char *tline) -{ - int len,i,i2; - char *ptr,*start,*end,*tmp; - - /* Get a size argument, if any */ - while(isspace(*tline)&&(*tline != '\n')&&(*tline != 0)) - tline++; - if( *tline == '(') - { - int thisw= 0,thish = 0; - - tline++; - sscanf((tline),"%dx%d",&thisw,&thish); - while((*tline != ')')&&(*tline != '\n')&&(*tline != 0)) - tline++; - tline++; - if(thisw > 0) - Buttons[num_buttons].BWidth = thisw; - if(thish > 0) - Buttons[num_buttons].BHeight = thish; - } - - /* skip spaces */ - while(isspace(*tline)&&(*tline != '\n')&&(*tline != 0)) - tline++; - - /* read next word. Its the button label. Users can specify "" - * NoIcon, or whatever to skip the label */ - /* read to next space */ - start = tline; - end = tline; - while((!isspace(*end))&&(*end!='\n')&&(*end!=0)) - end++; - len = end - start; - ptr = safemalloc(len+1); - strncpy(ptr,start,len); - ptr[len] = 0; - Buttons[num_buttons].title = ptr; - - /* read next word. Its the icon bitmap/pixmap label. Users can specify "" - * NoIcon, or whatever to skip the label */ - /* read to next space */ - start = end; - /* skip spaces */ - while(isspace(*start)&&(*start != '\n')&&(*start != 0)) - start++; - end = start; - while((!isspace(*end))&&(*end!='\n')&&(*end!=0)) - end++; - len = end - start; - ptr = safemalloc(len+1); - strncpy(ptr,start,len); - ptr[len] = 0; - Buttons[num_buttons].icon_file = ptr; - - tline = end; - /* skip spaces */ - while(isspace(*tline)&&(*tline != '\n')&&(*tline != 0)) - tline++; - - if(strncasecmp(tline,"swallow",7)==0) - { - /* Look for swallow "identifier", in which - * case GoodStuff spawns and gobbles up window */ - i=7; - while((tline[i] != 0)&& - (tline[i] != '"')) - i++; - i2=i+1; - while((tline[i2] != 0)&& - (tline[i2] != '"')) - i2++; - if(i2 - i >1) - { - Buttons[num_buttons].hangon = safemalloc(i2-i); - strncpy(Buttons[num_buttons].hangon,&tline[i+1],i2-i-1); - Buttons[num_buttons].hangon[i2-i-1] = 0; - Buttons[num_buttons].swallow = 1; - } - i2++; - while((isspace(tline[i2]))&&(tline[i2]!=0)) - i2++; - len = strlen(&tline[i2]); - tmp = tline + i2 + len -1; - while(((isspace(*tmp))||(*tmp == '\n'))&&(tmp >=(tline + i2))) - { - tmp--; - len--; - } - ptr = safemalloc(len+1); - if(strncasecmp(&tline[i2],"Module",6)==0) - { - Buttons[num_buttons].module = 1; - } - - strncpy(ptr,&tline[i2],len); - ptr[len]=0; - SendText(fd,ptr,0); - free(ptr); - Buttons[num_buttons++].action = NULL; - } - else - { - len = strlen(tline); - tmp = tline + len -1; - while(((isspace(*tmp))||(*tmp == '\n'))&&(tmp >=tline)) - { - tmp--; - len--; - } - ptr = safemalloc(len+1); - strncpy(ptr,tline,len); - ptr[len]=0; - Buttons[num_buttons++].action = ptr; - } - return; -} - -/************************************************************************** - * Change the window name displayed in the title bar. - **************************************************************************/ -void change_window_name(char *str) -{ - XTextProperty name; - - if (XStringListToTextProperty(&str,1,&name) == 0) - { - fprintf(stderr,"%s: cannot allocate window name",MyName); - return; - } - XSetWMName(dpy,main_win,&name); - XSetWMIconName(dpy,main_win,&name); - XFree(name.value); -} - - - -/*************************************************************************** - * - * Waits for next X event, or for an auto-raise timeout. - * - ****************************************************************************/ -int My_XNextEvent(Display *dpy, XEvent *event) -{ - fd_set in_fdset; - unsigned long header[HEADER_SIZE]; - static int miss_counter = 0; - unsigned long *body; - - if(XPending(dpy)) - { - XNextEvent(dpy,event); - return 1; - } - - FD_ZERO(&in_fdset); - FD_SET(x_fd,&in_fdset); - FD_SET(fd[1],&in_fdset); - - select(fd_width,SELECT_TYPE_ARG234 &in_fdset, 0, 0, NULL); - - if(FD_ISSET(x_fd, &in_fdset)) - { - if(XPending(dpy)) - { - XNextEvent(dpy,event); - miss_counter = 0; - return 1; - } - else - miss_counter++; - if(miss_counter > 100) - DeadPipe(0); - } - - if(FD_ISSET(fd[1], &in_fdset)) - { - if(ReadFvwmPacket(fd[1], header, &body) > 0) - { - process_message(header[1],body); - free(body); - } - } - return 0; -} - -void CheckForHangon(unsigned long *body) -{ - int button,i,j; - char *cbody; - - cbody = (char *)&body[3]; - for(i=0;i<num_rows;i++) - for(j=0;j<num_columns; j++) - { - button = i*num_columns + j; - if(Buttons[button].hangon != NULL) - { - if(strcmp(cbody,Buttons[button].hangon)==0) - { - if(Buttons[button].swallow == 1) - { - Buttons[button].swallow = 2; - if(Buttons[button].IconWin != None) - { - XDestroyWindow(dpy,Buttons[button].IconWin); - } - Buttons[button].IconWin = (Window)body[0]; - free(Buttons[button].hangon); - Buttons[button].hangon = NULL; - } - else - { - Buttons[button].up = 1; - free(Buttons[button].hangon); - Buttons[button].hangon = NULL; - RedrawWindow(button); - } - } - } - } -} - -/************************************************************************** - * - * Process window list messages - * - *************************************************************************/ -void process_message(unsigned long type,unsigned long *body) -{ - switch(type) - { - case M_NEW_DESK: - new_desk = body[0]; - RedrawWindow(-1); - break; - case M_END_WINDOWLIST: - RedrawWindow(-1); - case M_MAP: - swallow(body); - case M_RES_NAME: - case M_RES_CLASS: - case M_WINDOW_NAME: - CheckForHangon(body); - break; - default: - break; - } -} - - - - - -void swallow(unsigned long *body) -{ - char *temp; - int button,i,j,iw,ih; - long supplied; - - for(i=0;i<num_rows;i++) - for(j=0;j<num_columns; j++) - { - button = i*num_columns + j; - if((Buttons[button].IconWin == (Window)body[0])&& - (Buttons[button].swallow == 2)) - { - Buttons[button].swallow = 3; - /* "Swallow" the window! */ - XReparentWindow(dpy,Buttons[button].IconWin, main_win, - j*ButtonWidth+2, i*ButtonHeight+2); - XMapWindow(dpy,Buttons[button].IconWin); - XSelectInput(dpy,(Window)body[0], - PropertyChangeMask|StructureNotifyMask); - Buttons[button].icon_w = - Buttons[button].BWidth * ButtonWidth - 4; - if(strcmp(Buttons[button].title,"-")==0 || font==NULL) - { - Buttons[button].icon_h = - Buttons[button].BHeight*ButtonHeight - 4; - } - else - { - Buttons[button].icon_h = - Buttons[button].BHeight*ButtonHeight - 4 - - font->ascent - font->descent; - } - if (!XGetWMNormalHints (dpy, Buttons[button].IconWin, - &Buttons[button].hints, - &supplied)) - Buttons[button].hints.flags = 0; - ih = Buttons[button].icon_h + 4; - iw = Buttons[button].icon_w + 4; - ConstrainSize(&Buttons[button].hints, &Buttons[button].icon_w, - &Buttons[button].icon_h); - - XResizeWindow(dpy,(Window)body[0], Buttons[button].icon_w, - Buttons[button].icon_h); - XMoveWindow(dpy,Buttons[button].IconWin, - j*ButtonWidth + - (iw - Buttons[button].icon_w)/2, - i*ButtonHeight + - (ih - Buttons[button].icon_h)/2); - - XFetchName(dpy, Buttons[button].IconWin, &temp); - XClearArea(dpy,main_win,j*ButtonWidth, i*ButtonHeight, - ButtonWidth,ButtonHeight,0); - if(strcmp(Buttons[button].title,"-")!=0) - CopyString(&Buttons[button].title, temp); - RedrawWindow(-1); - XFree(temp); - } - } -} - - - -/*********************************************************************** - * - * Procedure: - * ConstrainSize - adjust the given width and height to account for the - * constraints imposed by size hints - * - * The general algorithm, especially the aspect ratio stuff, is - * borrowed from uwm's CheckConsistency routine. - * - ***********************************************************************/ -void ConstrainSize (XSizeHints *hints, int *widthp, int *heightp) -{ -#define makemult(a,b) ((b==1) ? (a) : (((int)((a)/(b))) * (b)) ) -#define _min(a,b) (((a) < (b)) ? (a) : (b)) - - - int minWidth, minHeight, maxWidth, maxHeight, xinc, yinc, delta; - int baseWidth, baseHeight; - int dwidth = *widthp, dheight = *heightp; - - if(hints->flags & PMinSize) - { - minWidth = hints->min_width; - minHeight = hints->min_height; - if(hints->flags & PBaseSize) - { - baseWidth = hints->base_width; - baseHeight = hints->base_height; - } - else - { - baseWidth = hints->min_width; - baseHeight = hints->min_height; - } - } - else if(hints->flags & PBaseSize) - { - minWidth = hints->base_width; - minHeight = hints->base_height; - baseWidth = hints->base_width; - baseHeight = hints->base_height; - } - else - { - minWidth = 1; - minHeight = 1; - baseWidth = 1; - baseHeight = 1; - } - - if(hints->flags & PMaxSize) - { - maxWidth = hints->max_width; - maxHeight = hints->max_height; - } - else - { - maxWidth = 10000; - maxHeight = 10000; - } - if(hints->flags & PResizeInc) - { - xinc = hints->width_inc; - yinc = hints->height_inc; - } - else - { - xinc = 1; - yinc = 1; - } - - /* - * First, clamp to min and max values - */ - if (dwidth < minWidth) dwidth = minWidth; - if (dheight < minHeight) dheight = minHeight; - - if (dwidth > maxWidth) dwidth = maxWidth; - if (dheight > maxHeight) dheight = maxHeight; - - - /* - * Second, fit to base + N * inc - */ - dwidth = ((dwidth - baseWidth) / xinc * xinc) + baseWidth; - dheight = ((dheight - baseHeight) / yinc * yinc) + baseHeight; - - - /* - * Third, adjust for aspect ratio - */ -#define maxAspectX hints->max_aspect.x -#define maxAspectY hints->max_aspect.y -#define minAspectX hints->min_aspect.x -#define minAspectY hints->min_aspect.y - /* - * The math looks like this: - * - * minAspectX dwidth maxAspectX - * ---------- <= ------- <= ---------- - * minAspectY dheight maxAspectY - * - * If that is multiplied out, then the width and height are - * invalid in the following situations: - * - * minAspectX * dheight > minAspectY * dwidth - * maxAspectX * dheight < maxAspectY * dwidth - * - */ - - if (hints->flags & PAspect) - { - if (minAspectX * dheight > minAspectY * dwidth) - { - delta = makemult(minAspectX * dheight / minAspectY - dwidth, - xinc); - if (dwidth + delta <= maxWidth) - dwidth += delta; - else - { - delta = makemult(dheight - dwidth*minAspectY/minAspectX, - yinc); - if (dheight - delta >= minHeight) dheight -= delta; - } - } - - if (maxAspectX * dheight < maxAspectY * dwidth) - { - delta = makemult(dwidth * maxAspectY / maxAspectX - dheight, - yinc); - if (dheight + delta <= maxHeight) - dheight += delta; - else - { - delta = makemult(dwidth - maxAspectX*dheight/maxAspectY, - xinc); - if (dwidth - delta >= minWidth) dwidth -= delta; - } - } - } - - *widthp = dwidth; - *heightp = dheight; - return; -} - diff --git a/app/fvwm/extras/FvwmGoodStuff/FvwmGoodStuff.h b/app/fvwm/extras/FvwmGoodStuff/FvwmGoodStuff.h deleted file mode 100644 index 0e95ff5fe..000000000 --- a/app/fvwm/extras/FvwmGoodStuff/FvwmGoodStuff.h +++ /dev/null @@ -1,70 +0,0 @@ -#include "fvwmlib.h" - -/************************************************************************* - * - * Subroutine Prototypes - * - *************************************************************************/ -extern void CreateWindow(void); -extern Pixel GetColor(char *name); -extern Pixel GetHilite(Pixel background); -extern Pixel GetShadow(Pixel background); -extern void nocolor(char *a, char *b); -extern void RedrawWindow(int); -extern void match_string(char *tline); -extern void Loop(void); -extern void ParseOptions(void); -extern char *safemalloc(int length); -extern void change_window_name(char *str); -extern int My_XNextEvent(Display *dpy, XEvent *event); -extern void RelieveWindow(Window win,int x,int y,int w,int h,GC rGC,GC sGC); -extern void DeadPipe(int nonsense); -extern void LoadIconFile(int button); -extern void CreateIconWindow(int button); -extern void ConfigureIconWindow(int button,int row, int column); -extern void DrawIconWindow(int button); -extern void GetBitmapFile(int button); -extern void GetXPMFile(int button); -void process_message(unsigned long type,unsigned long *body); -extern void send_clientmessage (Display *disp, Window w, Atom a, Time timestamp); -void swallow(unsigned long *body); -void ConstrainSize (XSizeHints *hints, int *widthp, int *height); - -extern Display *dpy; /* which display are we talking to */ -extern Window Root; -extern Window main_win; -extern int screen; -extern int d_depth; -extern Pixel back_pix, fore_pix; -extern GC NormalGC; -extern GC ReliefGC; -extern int ButtonWidth,ButtonHeight; -extern XFontStruct *font; -#define MAX_BUTTONS 100 - -struct button_info -{ - char *action; - char *title; - char *icon_file; - int BWidth; /* Width of this button in "buttons" */ - int BHeight; - int icon_w; - int icon_h; - Pixmap iconPixmap; /* pixmap for the icon */ - Pixmap icon_maskPixmap; /* pixmap for the icon mask */ - Window IconWin; - XSizeHints hints; - int icon_depth; - char *hangon; - char up; - char swallow; - char module; - char used; -}; - -extern struct button_info Buttons[MAX_BUTTONS]; - -extern char *iconPath; -extern char *pixmapPath; - diff --git a/app/fvwm/extras/FvwmGoodStuff/icons.c b/app/fvwm/extras/FvwmGoodStuff/icons.c deleted file mode 100644 index df867da63..000000000 --- a/app/fvwm/extras/FvwmGoodStuff/icons.c +++ /dev/null @@ -1,242 +0,0 @@ -/* This module, and the entire GoodStuff program, and the concept for - * interfacing this module to the Window Manager, are all original work - * by Robert Nation - * - * Copyright 1993, Robert Nation. No guarantees or warantees or anything - * are provided or implied in any way whatsoever. Use this program at your - * own risk. Permission to use this program for any purpose is given, - * as long as the copyright is kept intact. */ -/*********************************************************************** - * - * Derived from fvwm icon code - * - ***********************************************************************/ - -#include "config.h" - -#include <stdio.h> -#include <unistd.h> -#include <signal.h> -#include <string.h> -#include <stdlib.h> - -#include <X11/Xlib.h> -#include <X11/Xutil.h> -#include <X11/Xproto.h> -#include <X11/Xatom.h> -#include <X11/Intrinsic.h> - -#ifdef HAVE_FNCTL_H -#include <fcntl.h> -#endif - -#include "FvwmGoodStuff.h" - -#ifdef XPM -#include <X11/xpm.h> -#endif /* XPM */ -#ifdef SHAPE -#include <X11/extensions/shape.h> -#endif /* SHAPE */ - -extern int xpad; -extern int ypad; -extern int framew; - -/**************************************************************************** - * - * Loads an icon file into a pixmap - * - ****************************************************************************/ -void LoadIconFile(int button) -{ -#ifndef NO_ICONS - /* First, check for a monochrome bitmap */ - if(Buttons[button].icon_file != NULL) - GetBitmapFile(button); - - /* Next, check for a color pixmap */ - if((Buttons[button].icon_file != NULL)&& - (Buttons[button].icon_w == 0)&&(Buttons[button].icon_h == 0)) - GetXPMFile(button); -#endif -} - -/**************************************************************************** - * - * Creates an Icon Window - * - ****************************************************************************/ -void CreateIconWindow(int button) -{ -#ifndef NO_ICONS - unsigned long valuemask; /* mask for create windows */ - XSetWindowAttributes attributes; /* attributes for create windows */ - - if((Buttons[button].icon_w == 0)&&(Buttons[button].icon_h == 0)) - return; - - attributes.background_pixel = back_pix; - attributes.event_mask = ExposureMask; - valuemask = CWEventMask | CWBackPixel; - - Buttons[button].IconWin = - XCreateWindow(dpy, main_win, 0, 0, Buttons[button].icon_w, - Buttons[button].icon_w, 0, CopyFromParent, - CopyFromParent,CopyFromParent,valuemask,&attributes); - return; -#endif -} - -/**************************************************************************** - * - * Combines icon shape masks after a resize - * - ****************************************************************************/ -void ConfigureIconWindow(int button,int row, int column) -{ -#ifndef NO_ICONS - int x,y,w,h; - int xoff,yoff; - Pixmap temp; - - if((Buttons[button].icon_w == 0)&&(Buttons[button].icon_h == 0)) - return; - - if(Buttons[button].swallow != 0) - return; - - w = Buttons[button].icon_w; - h = Buttons[button].icon_h; - if(w > Buttons[button].BWidth*ButtonWidth - 2*(xpad+framew)) - w = Buttons[button].BWidth*ButtonWidth - 2*(xpad+framew); - if(strcmp(Buttons[button].title,"-")==0 || font==NULL) - { - if(h>Buttons[button].BHeight*ButtonHeight-2*(ypad+framew)) - h= Buttons[button].BHeight*ButtonHeight-2*(ypad+framew); - } - else - { - if(h>Buttons[button].BHeight*ButtonHeight-2*(ypad+framew)-font->ascent-font->descent) - h= Buttons[button].BHeight*ButtonHeight-2*(ypad+framew)-font->ascent-font->descent; - } - - if(w < 1) - w = 1; - if(h < 1) - h = 1; - - x = column*ButtonWidth; - y = row*ButtonHeight; - xoff = (Buttons[button].BWidth*ButtonWidth - w)>>1; - if(strcmp(Buttons[button].title,"-")==0 || font==NULL) - { - yoff = (Buttons[button].BHeight*ButtonHeight - h)>>1; - } - else - { - yoff = (Buttons[button].BHeight*ButtonHeight - (h + font->ascent + font->descent))>>1; - } - - if(xoff < 2) - xoff = 2; - if(yoff < 2) - yoff = 2; - x += xoff; - y += yoff; - - XMoveResizeWindow(dpy, Buttons[button].IconWin, x,y,w,h); - -#ifdef XPM -#ifdef SHAPE - if (Buttons[button].icon_maskPixmap != None) - { - xoff = (w - Buttons[button].icon_w)>>1; - yoff = (h - Buttons[button].icon_h)>>1; - XShapeCombineMask(dpy, Buttons[button].IconWin, ShapeBounding, 0, 0, - Buttons[button].icon_maskPixmap, ShapeSet); - } -#endif -#endif - if(Buttons[button].icon_depth == -1) - { - temp = Buttons[button].iconPixmap; - Buttons[button].iconPixmap = - XCreatePixmap(dpy,Root, Buttons[button].icon_w, - Buttons[button].icon_h,d_depth); - XCopyPlane(dpy,temp,Buttons[button].iconPixmap,NormalGC, - 0,0,Buttons[button].icon_w,Buttons[button].icon_h, - 0,0,1); - } - XSetWindowBackgroundPixmap(dpy, Buttons[button].IconWin,Buttons[button].iconPixmap); - - XClearWindow(dpy,Buttons[button].IconWin); -#endif -} - -/*************************************************************************** - * - * Looks for a monochrome icon bitmap file - * - **************************************************************************/ -void GetBitmapFile(int button) -{ -#ifndef NO_ICONS - char *path = NULL; - int HotX,HotY; - - path = findIconFile(Buttons[button].icon_file, iconPath,R_OK); - if(path == NULL)return; - - if(XReadBitmapFile (dpy, Root,path,(unsigned int *)&Buttons[button].icon_w, - (unsigned int *)&Buttons[button].icon_h, - &Buttons[button].iconPixmap, - (int *)&HotX, - (int *)&HotY) != BitmapSuccess) - { - Buttons[button].icon_w = 0; - Buttons[button].icon_h = 0; - } - else - { - Buttons[button].icon_depth = -1; - } - Buttons[button].icon_maskPixmap = None; - free(path); -#endif -} - - -/**************************************************************************** - * - * Looks for a color XPM icon file - * - ****************************************************************************/ -void GetXPMFile(int button) -{ -#ifndef NO_ICONS -#ifdef XPM - XWindowAttributes root_attr; - XpmAttributes xpm_attributes; - char *path = NULL; - - path = findIconFile(Buttons[button].icon_file, pixmapPath,R_OK); - if(path == NULL)return; - - XGetWindowAttributes(dpy,Root,&root_attr); - xpm_attributes.colormap = root_attr.colormap; - xpm_attributes.valuemask = XpmSize | XpmReturnPixels|XpmColormap; - if(XpmReadFileToPixmap(dpy, Root, path, - &Buttons[button].iconPixmap, - &Buttons[button].icon_maskPixmap, - &xpm_attributes) == XpmSuccess) - { - Buttons[button].icon_w = xpm_attributes.width; - Buttons[button].icon_h = xpm_attributes.height; - Buttons[button].icon_depth = d_depth; - } - free(path); -#endif /* XPM */ -#endif -} - diff --git a/app/fvwm/extras/FvwmPipe/FvwmPipe.c b/app/fvwm/extras/FvwmPipe/FvwmPipe.c deleted file mode 100644 index ed3384560..000000000 --- a/app/fvwm/extras/FvwmPipe/FvwmPipe.c +++ /dev/null @@ -1,187 +0,0 @@ -/* - FvwmPipe v0.1 Copyright 1996 Matthias Ettrich - (ettrich@informatik.uni-tuebingen.de) - Permission is granted to distribute this software freely - for any purpose as long as the copyright and this - copyright notice remain intact. - - Simple hacked module to control fvwm from outside. - When invoked this module creates a pipe "$HOME/.fvwmpipe.in". - Whatever you write to this pipe will be passed through to fvwm. - For example: - echo "restart" > $HOME/.fvwmpipe.in - (restarts fvwm) - or - echo "AddtoMenu \"StartMenu\" \"Emacs\" Exec emacs " > $HOME/.fvwmpipe.in - (adds emacs to the StartMenu) - or - echo "DestroyMenu \"StartMenu\" " > $HOME/.fvwmpipe.in - (destroys the StartMenu) - - The module makes it possible to write config-tools for fvwm - in any language, for example TCL/TK. - - The code is somewhat based on the FvwmTalk module. - */ - -/* This module, and the entire NoClutter program, and the concept for - * interfacing this module to the Window Manager, are all original work - * by Robert Nation - * - * Copyright 1994, Robert Nation. No guarantees or warantees or anything - * are provided or implied in any way whatsoever. Use this program at your - * own risk. Permission to use this program for any purpose is given, - * as long as the copyright is kept intact. */ - - -#define TRUE 1 -#define FALSE - -#define UPDATE_ONLY 1 -#define ALL 2 -#define PROP_SIZE 1024 - -#include "config.h" - -#if HAVE_SYS_BSDTYPES -#include <sys/bsdtypes.h> /* Saul */ -#endif - -#include <stdio.h> -#include <signal.h> -#include <fcntl.h> -#include <string.h> -#include <sys/wait.h> -#include <sys/time.h> - -#if HAVE_SYS_SELECT_H -#include <sys/select.h> -#endif - -#include <unistd.h> -#include <ctype.h> -#include <stdlib.h> - -#include "fvwmlib.h" -#include "../../fvwm/module.h" - -char *MyName; -int fd_width; -int fd[2]; - -/*********************************************************************** - * - * Procedure: - * SIGPIPE handler - SIGPIPE means fvwm is dying - * - ***********************************************************************/ -void DeadPipe(int nonsense) -{ - fprintf(stderr,"FvwmPipe: dead pipe\n"); - exit(0); -} - - -void Loop(int *fvwmfd){ - int fd; - int res; - char s[256]; - int a,i; - char* Home; - int HomeLen; - char* inpipename; - fd_set fdset; - - Home = getenv("HOME"); - if (Home == NULL) - Home = "./"; - HomeLen = strlen(Home); - inpipename = safemalloc(HomeLen + 17); - strcpy(inpipename,Home); - strcat(inpipename,"/.fvwmpipe.in"); - - fd = open(inpipename, O_RDWR|O_NONBLOCK); - if (fd){ - /* send an empty message to end elder FvwmPipes */ - write (fd, "\n", 1); - close(fd); - } - - mkfifo(inpipename, 0600); - fd = open(inpipename, O_RDONLY|O_NONBLOCK); - if (fd<0){ - fprintf(stderr,"FvwmPipe: cannot create %s\n", inpipename); - exit(0); - } - FD_ZERO(&fdset); - FD_SET(fd, &fdset); - FD_SET(fvwmfd[1], &fdset); - while (1){ - select(fd_width,SELECT_TYPE_ARG234 &fdset, 0, 0, NULL); - if (FD_ISSET(fd, &fdset)){ - /* read from the fvwmpipe.in and send the stuff to fvwm */ - res = read(fd, s, 255); - if(res>=0) { - s[res] = '\0'; - a = 0; - for (i=0; i<res;i++) - if (s[i] == '\n'){ - s[i] = '\0'; - SendText(fvwmfd,(s+a),0); - a = i+1; - } - } - } - else { - /* ignore what comes from fvwm but empty the pipe */ - do { - res = read(fvwmfd[1], s, 99); - } while (res >= 0); - } - } -} - - -int main(int argc, char **argv) -{ - char *temp, *s; - - /* Save the program name - its used for error messages and option parsing */ - temp = argv[0]; - - s=strrchr(argv[0], '/'); - if (s != NULL) - temp = s + 1; - - MyName = safemalloc(strlen(temp)+2); - strcpy(MyName,"*"); - strcat(MyName, temp); - - if((argc != 6)&&(argc != 7)) - { - fprintf(stderr,"%s Version %s should only be executed by fvwm!\n",MyName, - VERSION); - exit(1); - } - - /* Save the program name - its used for error messages and option parsing */ - temp = argv[0]; - - s=strrchr(argv[0], '/'); - if (s != NULL) - temp = s + 1; - - MyName = safemalloc(strlen(temp)+2); - strcpy(MyName,"*"); - strcat(MyName, temp); - - /* Dead pipes mean fvwm died */ - signal (SIGPIPE, DeadPipe); - - fd[0] = atoi(argv[1]); - fd[1] = atoi(argv[2]); - - fd_width = GetFdWidth(); - Loop(fd); - return 0; -} diff --git a/app/fvwm/extras/FvwmScript/BUGS b/app/fvwm/extras/FvwmScript/BUGS deleted file mode 100644 index ccd267bb9..000000000 --- a/app/fvwm/extras/FvwmScript/BUGS +++ /dev/null @@ -1,7 +0,0 @@ -Bugs detected with Bounds Checking: - - FvwmScript.c:146 XOpenDisplay - FvwmScript.c:231 XAllocNamedColor, XParseColor - Only works with colors named "#??????" - FvwmScript.c:315 XSetWMProtocols - PushButton.c:31 XCreateFontCursor diff --git a/app/fvwm/extras/FvwmScript/FvwmScript.1 b/app/fvwm/extras/FvwmScript/FvwmScript.1 deleted file mode 100644 index ba468ab47..000000000 --- a/app/fvwm/extras/FvwmScript/FvwmScript.1 +++ /dev/null @@ -1,373 +0,0 @@ -.\" t -.\" @(#)fvwm.1 17/2/97 -.de EX \"Begin example -.ne 5 -.if n .sp 1 -.if t .sp .5 -.nf -.in +.5i -.. -.de EE -.fi -.in -.5i -.if n .sp 1 -.if t .sp .5 -.. -.ta .3i .6i .9i 1.2i 1.5i 1.8i -.TH FVWM 2.xx "late 20th century" -.UC -.TH FvwmScript 3.1 -.SH NAME -FvwmScript - module to build graphic user interface -.SH SYNOPSIS -FvwmScript must be spawned by Fvwm. -It will not work from the command line. -.SH DESCRIPTION -FvwmScript is a module which allows to build many graphical -applications such as desktop accessories, button panel with popup -menu, modal dialog... At the startup, FvwmScript reads -the file which is specified in the command line. This file contains the script. -This script is not included in the configuration file of Fvwm. - -.SH INVOCATION -FvwmScript can be invoked by inserting the line `Module -FvwmScript name_of_script' in the .fvwmrc file. All scripts used by FvwmScript are -located in a directory whom is specified in .fvwmrc by the -command line `*FvwmScriptPath path_of_the_script_directory'. -This can be placed on a line by itself, if FvwmScript is to be spawned during -fvwm's initialization, or can be bound to a menu or mouse -button or keystroke to invoke it later. Fvwm will search -directory specified in the ModulePath configuration option -to attempt to locate FvwmScript. - -Be sure to set ModulePath in your .fvwmrc file to include FvwmScript's path. -.SH ANATOMY OF A SCRIPT -FvwmScript uses a particular programming langage. A script is composed of four -parts. Heading contains general characteristics of the window and default properties -for all widgets. The second part contains instructions whom are executed at the -startup of the script. The third part contains periodic tasks whom is executed every 1 -second. And the last one contains the description of widgets. -A widget consists of eleven types of items: text labels, single-line text inputs, -radio buttons, checkbox, push buttons, horizontal and vertical scrollbars, rectangles, -popup-menus, swallowexecs and mini scrollbars. -.SH HEADING OF A SCRIPT -The syntaxe is as follow: - -.IP "WindowTitle \fIstring\fP" -This option sets the window title. - -.IP "WindowSize \fIwidth height\fP" -This option sets window size. \fIwidth\fP and \fIheight\fP are numerical value. - -.IP "WindowPosition \fIx y\fP" -This option sets window position. \fIx\fP and \fIy\fP are numerical value. - -.IP "ForeColor {\fIcolor\fP}" -This option sets the default foreground color for all widgets. - -.IP "BackColor {\fIcolor\fP}" -This option sets the default background color for all widgets. - -.IP "HilightColor {\fIcolor\fP}" -This option sets the default hilight color for all widgets. - -.IP "ShadowColor {\fIcolor\fP}" -This option sets the default shadow color for all widgets. - -.IP "Font {\fIfont\fP}" -This option sets the default font color for all widgets. - -.SH INITIALISATION -This part contains instructions which will be executed at the startup. -For example: -.EX -Init - Begin - Do "Exec cat tada.voc > /dev/dsp" - WarpPointer 1 - Set $ToDo=Restart - End -.EE -These instructions are used to play a sound, move the pointer -to widget 1 and to initialize $ToDo to "Restart" at every startup. - -.SH PERIODIC TASKS -This part of the script contains some instructions whom are executed every second. -For example: -.EX -Periodic Task - Begin - If (RemainderOfDiv (GetTime) 10)==0 Then - Do {Exec xcalc} - End -.EE -This example shows how to launch xcalc every 10 seconds. - -.SH MAIN OF A SCRIPT -The second part of the script contains the description for every widget -which will be used in the program. A description of widget is composed of -two parts. Fisrt part describes initial properties and second part contains -instructions which will be executed when the widget receives messages. -All widgets can send and receive messages. All message are identify by -a number. The message "UserAction" is sent to a widget when user has -altered this one. The syntax is as following: -.EX -Widget id # Set the id widget -Property - Type string - Size width height - Position x y - Title { string } - Value int - MaxValue int - MinValue int - Font string - ForeColor { color } - BackColor { color } - HilightColor { color } - ShadowColor { Color } - Flags Hidden and/or NoReliefString -.EE -The option 'Flags` is used to specify if the widget is hidden or not and -if strings are drew with relief or not. - -.EX -Main - Case Message of - SingleClic: - Begin - # list of instructions which will be - # executed when widget receives - # message "SingleClic". This message is - # generated by the user. - End - 1: - Begin - # list of instructions which will be - # executed when widget receives - # message 1 - End - End -.EE - -.SH LIST OF WIDGETS -There is fifteen types of widgets. - -.IP "\fBItemDraw\fP: Display an icon and/or a string." - -\fBTitle\fP: string to display. - -\fBIcon\fP: icon to display. - -.IP "\fBPushButton\fP: Display push button with an icon and/or a string." - -\fBTitle\fP: this string has the following syntax {Title of the button|Option 1|Option 2| -Option3|...|Option N}. "Option 1|Option 2|...|Option N" is the popup menu which is -displayed when pressing the right button. - -\fBIcon\fP: icon to display. - -.IP "\fBRadioButton\fP: Display radio button with a string." - -\fBTitle\fP: title of the radio button. - -\fBValue\fP: if Value is equal to 1, the box is checked else it is not. - -.IP "\fBCheckBox\fP: Display check box with a string." - -\fBTitle\fP: title of the check box. - -\fBValue\fP: if Value is equal to 1, the box is checked else it is not. - -.IP "\fBTextField\fP: Display a text input field. The text input field can be used to edit a single-line string." - -\fBTitle\fP: content of text field. - -\fBValue\fP: position of the insert point. - -.IP "\fBHScrollBar\fP: Display an horizontal scrollbar." - -\fBValue\fP: position of the thumb. - -\fBMaxValue\fP: upper limit of Value. - -\fBMinValue\fP: lower limit of Value. - -.IP "\fBVScrollBar\fP: Display a vertical scrollbar." - -\fBValue\fP: position of the thumb. - -\fBMaxValue\fP: upper limit of Value. - -\fBMinValue\fP: lower limit of Value. - -.IP "\fBMiniScrollBar\fP: Display a very small vertical scrollbar." - -\fBValue\fP: position of the thumb. - -\fBMaxValue\fP: upper limit of Value. - -\fBMinValue\fP: lower limit of Value. - -.IP "\fBRectangle\fP: Display a rectangle. This type of widget can be used to decorate window." - -.IP "\fBSwallowExec\fP: This type of widget causes FvwmScript to spawn an process, and capture the first window whose name or resource is equal to Title, and display it in the script window." - -\fBTitle\fP: specify the window name which be captured and displayed in the script window. - -\fBSwallowExec\fP: specify the command line to execute to spawn the process. Modules canalso be swallowed. - -\fBValue\fP: specify the looking of the border. Possible value: -1, 0, 1. - -.IP "\fBPopupMenu\fP: Display a popup menu." - -\fBValue\fP: specify what option is selected. - -\fBTitle\fP: the title has the following syntax: {Option 1|Option 2|...|Option N}."Option 1|Option 2|...|Option N" is the popup menu which is displayed when pressing mouse button. - -.IP "\fBHDipstick\fP: Display a horizontal dipstick. This widget can be used to display disk usage." - -\fBValue\fP: specify the current value of the dipstick. - -\fBMinValue\fP: specify the minimum value of the dipstick. - -\fBMaxValue\fP: specify the maximum value of the dipstick. - -.IP "\fBVDipstick\fP: Display a vertical dipstick." - -\fBValue\fP: specify the current value of the dipstick. - -\fBMinValue\fP: specify the minimum value of the dipstick. - -\fBMaxValue\fP: specify the maximum value of the dipstick. - -.IP "\fBList\fP: Display a list. List lets user to choose between various options." - -\fBValue\fP: specify which option is selected. - -\fBTitle\fP: title contains options displayed in the list. The syntaxe is the following: -{Option 1|Option 2|...|Option N}. All menus are displayed at the top of window. - -.IP "\fBMenu\fP: Display a menu whom lets user to choose a option." - -\fBValue\fP: specify which option is selected. - -\fBTitle\fP: title contains options displayed in the menu. The syntaxe is the following: -{Option 1|Option 2|...|Option N}. - -.SH INSTRUCTIONS - -Here is the description of all instructions. - -.IP "HideWidget \fIid\fP : hide the widget numbered \fIid\fP." - -.IP "ShowWidget \fIid\fP: show the widget numbered \fIid\fP." - -.IP "ChangeValue \fIid1 id2\fP: set the value of the widget numbered \fIid1\fP to \fIid2\fP." - -.IP "ChangeMaxValue \fIid1 id2\fP: set the maximum value of the widget numbered \fIid1\fP to \fIid2\fP." - -.IP "ChangeMinValue \fIid1 id2\fP: set the minimum value of the widget numbered \fIid1\fP to \fIid2\fP." - -.IP "ChangeTitle \fIid1 id2\fP: set the title of the widget numbered \fIid1\fP to \fIid2\fP." - -.IP "ChangeIcon \fIid1 id2\fP: set the icon of the widget numbered \fIid1\fP to \fIid2\fP." - -.IP "ChangeForeColor \fIid1\fP {\fIcolor\fP}: set the foreground color of the widget numbered \fIid1\fP to {\fIcolor\fP}." - -.IP "ChangeBackColor \fIid1\fP {\fIcolor\fP}: set the background color of the widget numbered \fIid1\fP to {\fIcolor\fP}. - - -.IP "ChangePosition \fIid1 x y\fP: move the widget numbered \fIid1\fP to position (\fIx\fP,\fIy\fP)." - -.IP "ChangeSize \fIid1 width height\fP: set the size of the widget numbered \fIid1\fP to (\fIwidth\fP,\fIheight\fP)." - -.IP "ChangeFont \fIid1 newfont\fP: set the font of the widget numbered \fIid1\fP to \fInewfont\fP." - -.IP "WarpPointer \fIid\fP: warp the mouse pointer into the widget numbered \fIid\fP." - -.IP "WriteToFile \fIfilename\fP {\fIstr1\fP} {\fIstr2\fP} etc: write to the file \fIfilename\fP the string which is the concatenation of all arguments \fIstr1\fP, \fIstr2\fP, etc." - -.IP "Do {\fIstr1\fP} {\fIstr2\fP} etc: execute the command which is the concatenation of all arguments \fIstr1\fP, \fIstr2\fP, etc." - -.IP "Set $\fIvar\fP={\fIstr\fP1} {\fIstr2\fP} etc: concatenate all arguments to a string and set the variable $\fIvar\fP to this string." - -.IP "Quit: quit the program." - -.IP "SendSignal \fIid1 id2\fP: send a message numbered \fIid2\fP to widget \fIid1\fP." - -.IP "SendToScript \fIid_script\fP {\fIstr1\fP1} {\fIstr2\fP} etc: send a message to the script identified by id_script. The message is the concatenation of str1, str2... - -.SH ARGUMENTS -Most of commands use arguments. There is two kinds of argument: numbers and strings. -A numerical argument is a value which is between -32000 and +32000. A string is always -surrounded with brace. Variables always begin with the character "$" and can contains both -number and string. - -.SH FUNCTIONS -All functions are used as argument. Functions can return both string and number. -The syntax is: -.EX -(function argument1 argument2 etc) -.EE -Here is the complete list of arguments: - -.IP "(GetTitle \fIid\fP): return the title of the widget numbered \fIid\fP." - -.IP "(GetValue \fIid\fP): return the current value of the widget numbered \fIid\fP." - -.IP "(GetOutput {\fIstr\fP} \fIint1 int2\fP): executes the command \fIstr\fP, gets the standart output and returns the word which is in the line \fIint1\fP and in the position \fIint2\fP. If \fIint2\fP is equal to -1, GetOutput returns the complete line." - -.IP "(NumToHex \fIint\fP): return the hexadecimal value of \fIint\fP." - -.IP "(HexToNum {\fIstr\fP}): return the decimal value of \fIstr\fP, \fIstr\fP must be an hexadecimal value." - -.IP "(Add \fIint1 int2\fP): return the result of (\fIint1\fP+\fIint2\fP)." - -.IP "(Mult \fIint1 int2\fP): return the result of (\fIint1\fP*\fIint2\fP)." - -.IP "(Div \fIint1 int2\fP): return the result of (\fIint1\fP/\fIint2\fP)." - -.IP "(StrCopy {\fIstr\fP} \fIint1 int2\fP): return the string whom is between position int1 and int2. For example, (StrCopy {Hello} 1 2) returns {He}" - -.IP "(LaunchScript {\fIstr\fP}): this function launch the script named str and return an identification number. This number is necessary to use these functions SendToScript and ReceivFromScript. The string str contains the script name and some arguments." - -.IP "(GetScriptArgument {\fIint\fP}): this function return the argument script used in the function LaunchScript. If int is equal to zero, GetScriptArgument return the name of the script." - -.IP "(GetScriptFather): this function return the identification number of the script father." - -.IP "(ReceivFromScript {\fIint\fP}): this function return the message sended by the script numbered int." - -.IP "(RemainderOfDiv {\fIint1 int2\fP}): this function return the remainder of the division (\fIint1\fP/\fIint2\fP)." - -.IP "(GetTime): this function return the time in second." - -.SH CONDITIONAL LOOPS -There is three kind of conditional loops. The instruction "If-Then-Else" has the following syntax: -.EX -If $ToDo=={Open xcalc} Then - Do {Exec xcalc &} # List of instructions -Else -Begin - Do {Exec killall xcalc &} # List of instructions - Do {Exec echo xcalc killed > /dev/console} -End -.EE -The second part "Else-Begin-End" is optional. If the loop contains only one instruction, Begin and End can be omitted. The instruction "While-Do" as the following syntax: -.EX -While $i<5 Do -Begin - Set $i=(Add i 1) # List of instructions -End -.EE -Two strings can be compared with "==" and two numbers can be compared with "<", "<=", "==", ">=", ">". The loop "For-Do-Begin-End" has the following syntax: -.EX -For $i=1 To 20 Do -Begin - Do {Exec xcalc &} # List of instructions -End -.EE -.SH AUTHOR - Frederic Cordier (cordie97@cui.unige.ch or f-cord96@univ-lyon1.fr). -.SH CONTRIBUTOR - Eddy J. Gurney (eddy@gizmo.aa.ans.net). diff --git a/app/fvwm/extras/FvwmScript/FvwmScript.c b/app/fvwm/extras/FvwmScript/FvwmScript.c deleted file mode 100644 index 4d87654bf..000000000 --- a/app/fvwm/extras/FvwmScript/FvwmScript.c +++ /dev/null @@ -1,756 +0,0 @@ -/* Copyright May 1996, Frederic Cordier. No guarantees or warantees are - * provided or implied in any way whatsoever. Use this program at your own - * risk. Permission to use, modify, and redistribute this program is hereby - * given, provided that this copyright is kept intact. - */ - -#include "types.h" - -#ifdef MEMDEBUG /* For debugging */ -#include <unchecked.h> -#endif - -/* Variables utilise par l'analyseur syntaxique */ -extern ScriptProp *scriptprop; -extern int nbobj; /* Nombre d'objets */ -extern int numligne; /* Numero de ligne */ -extern TabObj *tabobj; /* Tableau d'objets, limite=100 */ -extern char **TabVVar; /* Tableau des variables du sript */ -extern int TabIdObj[101]; -extern Bloc **TabIObj; -extern CaseObj *TabCObj; -#ifdef MEMDEBUG -extern int __bounds_debug_no_checking; -#endif - -/* Constante de couleurs utilise dans le tableau TabColor */ -#define black 0 -#define white 1 -#define back 2 -#define fore 3 -#define shad 4 -#define li 5 - - -/* Variables globales */ -char *ScriptName; /* Nom du fichier contenat le script decrivant le GUI */ -char *ScriptPath; -char *ModuleName; -int fd[2]; /* pipe pair */ -int fd_err; -int x_fd; /* fd for X */ -Window ref; - - -extern void (*TabCom[30]) (int NbArg,long *TabArg); - -X11base *x11base; /* Pour le serveur X */ -TypeBuffSend BuffSend; /* Pour les communication entre script */ -int grab_server = 0; -struct XObj *tabxobj[100]; -char *Scrapt; -Atom propriete,type; -static Atom wm_del_win; -char *pixmapPath = NULL; - -extern void InitCom(); - -void Debug() -{ - int i,j; - - for (j=1;j<=nbobj;j++) - for (i=0;i<=TabCObj[TabIdObj[j]].NbCase;i++) - { - /* Execution du bloc d'instruction */ - fprintf(stderr,"Id de l'objet %d\n",TabIdObj[j]); - fprintf(stderr,"Nb Instruction %d\n",TabIObj[TabIdObj[j]][i].NbInstr); - } - -} - -/* Lecture du fichier contenant le scipt */ -void ReadConfig (char *ScriptName) -{ - extern FILE *yyin; - char s[255]; - - sprintf(s,"%s/%s",ScriptPath,ScriptName); - yyin=fopen(s,"r"); - if (yyin == NULL) - { - fprintf(stderr,"Can't open the script %s",s); - exit(1); - } - /* On ne redefini pas yyout qui est la sortie standard */ - - /* Application de l'analyseur syntaxique et lexical */ - yyparse(); - /* Fermeture du script */ - - fclose(yyin); -} - -/* Quitter par l'option Delete du bouton de la fenetre */ -void DeadPipe(int nonsense) -{ - Quit (0,NULL); -} - -/* Lecture du fichier system.fvwmrc ou .fvwmrc */ -void ParseOptions(void) -{ - char *tline; - - GetConfigLine(fd,&tline); - while(tline != (char *)0) - { - if((strlen(&tline[0])>1)&&(strncasecmp(tline,"PixmapPath",10)==0)) - { - CopyString(&pixmapPath,&tline[10]); - } - - if((strlen(&tline[0])>1)&&(strncasecmp(tline,"*FvwmScriptPath",15)==0)) - { - CopyString(&ScriptPath,&tline[15]); - } - GetConfigLine(fd,&tline); - } -} - - -/* Procedure d'initialisation du serveur X et des variables globales*/ -void Xinit(int IsFather) -{ - char *name; - Atom myatom; - int i=16; - - /* Connextion au serveur X */ -#ifdef MEMDEBUG - __bounds_debug_no_checking=True; -#endif - - x11base->display=XOpenDisplay(NULL); - if (x11base->display==NULL) - { - fprintf(stderr,"Enable to open display.\n"); - exit(1); - } - -#ifdef MEMDEBUG - __bounds_debug_no_checking=False; -#endif - - if (IsFather) - { - name=(char*)calloc(sizeof(char),strlen("FvwmScript")+5); - do - { - sprintf(name,"%c%xFvwmScript",161,i); - i++; - myatom=XInternAtom(x11base->display,name,False); - } - while (XGetSelectionOwner(x11base->display,myatom)!=None); - x11base->TabScriptId[1]=name; - x11base->TabScriptId[0]=NULL; - } - - x11base->NbChild=0; - x11base->screen=DefaultScreen(x11base->display); - x11base->WhitePix=WhitePixel(x11base->display,x11base->screen); - x11base->BlackPix=BlackPixel(x11base->display,x11base->screen); - x11base->depth=XDefaultDepth(x11base->display,x11base->screen); - x11base->colormap = DefaultColormap(x11base->display,x11base->screen); - x11base->root = RootWindow(x11base->display,x11base->screen); - x_fd = XConnectionNumber(x11base->display); -} - -/***********************/ -/* Lecture d'un icone */ -/***********************/ -void LoadIcon(struct XObj *xobj) -{ - char *path = NULL; - XWindowAttributes root_attr; - XpmAttributes xpm_attributes; - - if ((xobj->icon)!=NULL) - { - path = (char*)findIconFile(xobj->icon, pixmapPath,4); - if(path == NULL)return; - XGetWindowAttributes(xobj->display,RootWindow(xobj->display,DefaultScreen(xobj->display)),&root_attr); - xpm_attributes.colormap = root_attr.colormap; - xpm_attributes.valuemask = XpmSize | XpmReturnPixels|XpmColormap; - if(XpmReadFileToPixmap(xobj->display, RootWindow(xobj->display,DefaultScreen(xobj->display)), - path, - &xobj->iconPixmap, - &xobj->icon_maskPixmap, - &xpm_attributes) == XpmSuccess) - { - xobj->icon_w = xpm_attributes.width; - xobj->icon_h = xpm_attributes.height; - } - else - { - fprintf(stderr,"Enable to load pixmap %s\n",xobj->icon); - xobj->iconPixmap=None; - xobj->icon_maskPixmap=None; - } - free(path); - } -} - -int MyAllocNamedColor(Display *display,Colormap colormap,char* colorname,XColor* color) -{ - static XColor TempColor; - - if (colorname[0]=='#') - { - if (XParseColor(display,colormap,colorname,color)) - return XAllocColor(display,colormap,color); - else - return 0; - } - else - { - if (XLookupColor(display,colormap,colorname,&TempColor,color)) - return XAllocColor(display,colormap,color); - else - return 0; - } - return 0; -} - -/* Ouvre une fenetre pour l'affichage du GUI */ -void OpenWindow () -{ - XTextProperty Name; - XWMHints *IndicWM; - XSizeHints *IndicNorm; - unsigned long mask; - XSetWindowAttributes Attr; - - /* Allocation des couleurs */ - MyAllocNamedColor(x11base->display,x11base->colormap,x11base->forecolor,&x11base->TabColor[fore]); - MyAllocNamedColor(x11base->display,x11base->colormap,x11base->backcolor,&x11base->TabColor[back]); - MyAllocNamedColor(x11base->display,x11base->colormap,x11base->shadcolor,&x11base->TabColor[shad]); - MyAllocNamedColor(x11base->display,x11base->colormap,x11base->licolor,&x11base->TabColor[li]); - MyAllocNamedColor(x11base->display,x11base->colormap,"#000000",&x11base->TabColor[black]); - MyAllocNamedColor(x11base->display,x11base->colormap,"#FFFFFF",&x11base->TabColor[white]); - - /* Definition des caracteristiques de la fentre */ - mask=0; - mask|=CWBackPixel; - Attr.background_pixel=x11base->TabColor[back].pixel; - - x11base->win=XCreateWindow(x11base->display, - DefaultRootWindow(x11base->display), - x11base->size.x, - x11base->size.y, - x11base->size.width, - x11base->size.height,0, - CopyFromParent, - InputOutput, - CopyFromParent, - mask,&Attr); - - XSetWindowColormap(x11base->display,x11base->win,x11base->colormap); - x11base->gc=XCreateGC(x11base->display,x11base->win,0,NULL); - - /* Choix des evts recus par la fenetre */ - XSelectInput(x11base->display,x11base->win,KeyPressMask|ButtonPressMask| - ExposureMask|ButtonReleaseMask|EnterWindowMask|LeaveWindowMask|ButtonMotionMask); - XSelectInput(x11base->display,x11base->root,PropertyChangeMask); - - /* Specification des parametres utilises par le gestionnaire de fenetre */ - if (XStringListToTextProperty(&x11base->title,1,&Name)==0) - fprintf(stderr,"Can't use icon name\n"); - IndicNorm=XAllocSizeHints(); - if (x11base->size.x!=-1) - { - IndicNorm->x=x11base->size.x; - IndicNorm->y=x11base->size.y; - IndicNorm->flags=PSize|PMinSize|PMaxSize|PResizeInc|PBaseSize|PPosition; - } - else - IndicNorm->flags=PSize|PMinSize|PMaxSize|PResizeInc|PBaseSize; - IndicNorm->width=x11base->size.width; - IndicNorm->height=x11base->size.height; - IndicNorm->min_width=x11base->size.width; - IndicNorm->min_height=x11base->size.height; - IndicNorm->max_width=x11base->size.width; - IndicNorm->max_height=x11base->size.height; - IndicWM=XAllocWMHints(); - IndicWM->input=True; - IndicWM->initial_state=NormalState; - IndicWM->flags=InputHint|StateHint; - XSetWMProperties(x11base->display,x11base->win,&Name, - &Name,NULL,0,IndicNorm,IndicWM,NULL); - Scrapt=(char*)calloc(sizeof(char),1); - - /* Construction des atomes pour la communication inter-application */ - propriete=XInternAtom(x11base->display,"Prop_selection",False); - wm_del_win = XInternAtom(x11base->display,"WM_DELETE_WINDOW",False); - XSetWMProtocols(x11base->display,x11base->win,&wm_del_win,1); - -} - -/***********************************************/ -/* Execution d'une sequence d'instruction */ -/***********************************************/ -void ExecBloc(Bloc *bloc) -{ - int i; - - for (i=0;i<=bloc->NbInstr;i++) - { - TabCom[bloc->TabInstr[i].Type](bloc->TabInstr[i].NbArg,bloc->TabInstr[i].TabArg); - } -} - - -/* Construction de l'interface graphique */ -void BuildGUI(int IsFather) -{ - int i; - - - if (scriptprop->font==NULL) - x11base->font=strdup("fixed"); - else - x11base->font=scriptprop->font; - - if (scriptprop->forecolor==NULL) - x11base->forecolor=strdup("black"); - else - x11base->forecolor=scriptprop->forecolor; - - if (scriptprop->backcolor==NULL) - x11base->backcolor=strdup("white"); - else - x11base->backcolor=scriptprop->backcolor; - - if (scriptprop->shadcolor==NULL) - x11base->shadcolor=strdup("black"); - else - x11base->shadcolor=scriptprop->shadcolor; - - if (scriptprop->licolor==NULL) - x11base->licolor=strdup("black"); - else - x11base->licolor=scriptprop->licolor; - - x11base->icon=scriptprop->icon; - - x11base->size.x=scriptprop->x; - x11base->size.y=scriptprop->y; - x11base->size.width=scriptprop->width; - x11base->size.height=scriptprop->height; - x11base->title=scriptprop->titlewin; - - /* Initialisation du serveur X et de la fenetre */ - - Xinit(IsFather); - OpenWindow(); - - - /* Parcour de tous les objets graphiques */ - nbobj++; - for (i=0;i<nbobj;i++) - { - tabxobj[i]=(struct XObj*)calloc(1,sizeof(struct XObj)); - tabxobj[i]->id=(*tabobj)[i].id; - tabxobj[i]->x=(*tabobj)[i].x; - tabxobj[i]->y=(*tabobj)[i].y; - tabxobj[i]->width=(*tabobj)[i].width; - tabxobj[i]->height=(*tabobj)[i].height; - if (tabxobj[i]->width==0) tabxobj[i]->width=1; - if (tabxobj[i]->height==0) tabxobj[i]->height=1; - tabxobj[i]->value=(*tabobj)[i].value; - tabxobj[i]->value2=(*tabobj)[i].value2; - tabxobj[i]->value3=(*tabobj)[i].value3; - tabxobj[i]->flags[0]=(*tabobj)[i].flags[0]; - tabxobj[i]->flags[1]=(*tabobj)[i].flags[1]; - tabxobj[i]->flags[2]=(*tabobj)[i].flags[2]; - tabxobj[i]->icon=(*tabobj)[i].icon; - tabxobj[i]->swallow=(*tabobj)[i].swallow; - - if ((*tabobj)[i].title==NULL) - tabxobj[i]->title=(char*)calloc(1,200); - else - tabxobj[i]->title=(*tabobj)[i].title; - - if ((*tabobj)[i].font==NULL) - tabxobj[i]->font=(char*)strdup(x11base->font); - else - tabxobj[i]->font=(*tabobj)[i].font; - - if ((*tabobj)[i].forecolor==NULL) - tabxobj[i]->forecolor=(char*)strdup(x11base->forecolor); - else - tabxobj[i]->forecolor=(*tabobj)[i].forecolor; - - if ((*tabobj)[i].backcolor==NULL) - tabxobj[i]->backcolor=(char*)strdup(x11base->backcolor); - else - tabxobj[i]->backcolor=(*tabobj)[i].backcolor; - - if ((*tabobj)[i].shadcolor==NULL) - tabxobj[i]->shadcolor=(char*)strdup(x11base->shadcolor); - else - tabxobj[i]->shadcolor=(*tabobj)[i].shadcolor; - - if ((*tabobj)[i].licolor==NULL) - tabxobj[i]->licolor=strdup(x11base->licolor); - else - tabxobj[i]->licolor=(*tabobj)[i].licolor; - - ChooseFunction(tabxobj[i],(*tabobj)[i].type); - tabxobj[i]->gc=x11base->gc; - tabxobj[i]->display=x11base->display; - tabxobj[i]->ParentWin=&(x11base->win); - tabxobj[i]->Screen=x11base->screen; - tabxobj[i]->colormap=&(x11base->colormap); - tabxobj[i]->iconPixmap=None; - tabxobj[i]->icon_maskPixmap=None; - - LoadIcon(tabxobj[i]); /* Chargement de l'icone du widget */ - - tabxobj[i]->InitObj(tabxobj[i]); - } - - /* Enregistrement du bloc de taches periodic */ - x11base->periodictasks=scriptprop->periodictasks; - - /*Si un bloc d'initialisation du script existe, on l'execute ici */ - if (scriptprop->initbloc!=NULL) - { - ExecBloc(scriptprop->initbloc); - free(scriptprop->initbloc->TabInstr); - free(scriptprop->initbloc); - } - - free(tabobj); - free(scriptprop); - XMapRaised(x11base->display,x11base->win); - for (i=0;i<nbobj;i++) - if (tabxobj[i]->flags[0]!=True) - XMapWindow(x11base->display,tabxobj[i]->win); - -} - - -/***********************************************/ -/* Fonction de traitement des msg entre objets */ -/***********************************************/ -void SendMsg(struct XObj *xobj,int TypeMsg) -{ - int i; - - for (i=0;i<=TabCObj[TabIdObj[xobj->id]].NbCase;i++) - if (TabCObj[TabIdObj[xobj->id]].LstCase[i]==TypeMsg) - { - /* Execution du bloc d'instruction */ - ExecBloc(&TabIObj[TabIdObj[xobj->id]][i]); - } -} - -/*******************************************/ -/* Appeler lors d'une demande de selection */ -/*******************************************/ -void SendMsgToScript(XEvent event) -{ - Atom Sender,Receiver=None; - static XEvent evnt_sel; - int i; - - Sender=XInternAtom(x11base->display,x11base->TabScriptId[1],True); - - if (event.xselectionrequest.selection==Sender) - { - i=0; - while ((i<BuffSend.NbMsg)&&(event.xselectionrequest.target!=Receiver)) - { - Receiver=XInternAtom(x11base->display,BuffSend.TabMsg[i].R,True); - i++; - } - i--; - - evnt_sel.type=SelectionNotify; - evnt_sel.xselection.requestor=event.xselectionrequest.requestor; - evnt_sel.xselection.selection=event.xselectionrequest.selection; - evnt_sel.xselection.target=Receiver; - evnt_sel.xselection.time=event.xselectionrequest.time; - - if (event.xselectionrequest.target==Receiver) /* On a trouve le recepteur */ - { - evnt_sel.xselection.property=event.xselectionrequest.property; - XChangeProperty(x11base->display,evnt_sel.xselection.requestor, - evnt_sel.xselection.property, - evnt_sel.xselection.target, - 8,PropModeReplace,BuffSend.TabMsg[i].Msg,strlen(BuffSend.TabMsg[i].Msg)+1); - BuffSend.NbMsg--; - free(BuffSend.TabMsg[i].Msg); - if (BuffSend.NbMsg>0) - { - memmove(&BuffSend.TabMsg[i],&BuffSend.TabMsg[i+1],(BuffSend.NbMsg-i)*sizeof(TypeName)); - } - } - else - { /* Cas ou le recepteur demande un message et qu'il n'y en a pas */ - evnt_sel.xselection.property=None; - } - XSendEvent(x11base->display,evnt_sel.xselection.requestor,False,0,&evnt_sel); - } -} - -/* read an X event */ -void ReadXServer () -{ - static XEvent event,evnt_sel; - int i; - char *octet; - - while (XEventsQueued(x11base->display, QueuedAfterReading)) - { - XNextEvent(x11base->display, &event); - switch (event.type) - { - case Expose: - if (event.xexpose.count==0) - for (i=0;i<nbobj;i++) - tabxobj[i]->DrawObj(tabxobj[i]); - break; - case KeyPress: - /* Touche presse dans un objet */ - if (event.xkey.subwindow!=0) - { - /* Envoi de l'evt à l'objet */ - for (i=0;i<nbobj;i++) - if (tabxobj[i]->win==event.xkey.subwindow) - tabxobj[i]->EvtKey(tabxobj[i],&event.xkey); - } - break; - case ButtonPress: - /* Clique dans quel fenetre? */ - if (event.xbutton.subwindow!=0) - { - i=0; - while ((tabxobj[i]->win!=event.xbutton.subwindow)&&(i<nbobj-1)) - i++; - tabxobj[i]->EvtMouse(tabxobj[i],&event.xbutton); - } - break; - case ButtonRelease: - break; - case EnterNotify: - break; - case LeaveNotify: - break; - case MotionNotify: - break; - case MappingNotify: - XRefreshKeyboardMapping((XMappingEvent*)&event); - break; - case SelectionRequest: - if (event.xselectionrequest.selection==XA_PRIMARY) - { - evnt_sel.type=SelectionNotify; - evnt_sel.xselection.requestor=event.xselectionrequest.requestor; - evnt_sel.xselection.selection=event.xselectionrequest.selection; - evnt_sel.xselection.target=event.xselectionrequest.target; - evnt_sel.xselection.time=event.xselectionrequest.time; - evnt_sel.xselection.property=event.xselectionrequest.property; - switch (event.xselectionrequest.target) - { - case XA_STRING: - XChangeProperty(x11base->display,evnt_sel.xselection.requestor, - evnt_sel.xselection.property, - evnt_sel.xselection.target, - 8,PropModeReplace,Scrapt,strlen(Scrapt)+1); - break; - default:evnt_sel.xselection.property=None; - } - XSendEvent(x11base->display,evnt_sel.xselection.requestor,False,0,&evnt_sel); - } - else - SendMsgToScript(event); - break; - case SelectionClear: - if (event.xselectionclear.selection==XA_PRIMARY) - UnselectAllTextField(tabxobj); - break; - case ClientMessage: - if ((event.xclient.format==32) && (event.xclient.data.l[0]==wm_del_win)) - DeadPipe(1); - break; - case PropertyNotify: - if (event.xproperty.atom==XA_CUT_BUFFER0) - octet=XFetchBuffer(x11base->display,&i,0); - else if (event.xproperty.atom==XA_CUT_BUFFER1) - octet=XFetchBuffer(x11base->display,&i,1); - else if (event.xproperty.atom==XA_CUT_BUFFER2) - octet=XFetchBuffer(x11base->display,&i,2); - else if (event.xproperty.atom==XA_CUT_BUFFER3) - octet=XFetchBuffer(x11base->display,&i,3); - else if (event.xproperty.atom==XA_CUT_BUFFER4) - octet=XFetchBuffer(x11base->display,&i,4); - else if (event.xproperty.atom==XA_CUT_BUFFER5) - octet=XFetchBuffer(x11base->display,&i,5); - else if (event.xproperty.atom==XA_CUT_BUFFER6) - octet=XFetchBuffer(x11base->display,&i,6); - else if (event.xproperty.atom==XA_CUT_BUFFER7) - octet=XFetchBuffer(x11base->display,&i,7); - else break; - if (i>0) - { - Scrapt=(char*)realloc((void*)Scrapt,sizeof(char)*(i+1)); - Scrapt=strcpy(Scrapt,octet); - } - break; - } - } -} - -/* main event loop */ -void MainLoop () -{ - fd_set in_fdset; - unsigned long header[HEADER_SIZE]; - unsigned long *body; - int count,i; - struct timeval tv; - int res; - - while (1) - { - FD_ZERO(&in_fdset); - FD_SET(x_fd,&in_fdset); - FD_SET(fd[1],&in_fdset); - - XFlush(x11base->display); - - tv.tv_sec = 1; - tv.tv_usec = 0; - - if (x11base->periodictasks!=NULL) - res=select(32, SELECT_TYPE_ARG234 &in_fdset, NULL, NULL, &tv); - else - res=select(32, SELECT_TYPE_ARG234 &in_fdset, NULL, NULL, NULL); - - if (res > 0) - { - if (FD_ISSET(x_fd, &in_fdset)) - ReadXServer(); - - if(FD_ISSET(fd[1], &in_fdset)) - { - if((count = ReadFvwmPacket(fd[1], header, &body)) > 0) - { - for (i=0;i<nbobj;i++) - tabxobj[i]->ProcessMsg(tabxobj[i],header[1],body); - free(body); - } - } - } - if (x11base->periodictasks!=NULL) /* Execution des taches periodics */ - ExecBloc(x11base->periodictasks); - } -} - -void ReadFvwmScriptArg(int argc, char **argv,int IsFather) -{ - int i; - Atom myatom; - int FisrtArg; - - BuffSend.NbMsg=0; /* Aucun message dans le buffer */ - - for (i=2;i<98;i++) - x11base->TabScriptId[i]=NULL; - - if (IsFather) /* Cas du pere */ - { - myatom=XInternAtom(x11base->display,x11base->TabScriptId[1],True); - XSetSelectionOwner(x11base->display,myatom,x11base->win,CurrentTime); - FisrtArg=9; - } - else - { /* Cas du fils */ - x11base->TabScriptId[0]=(char*)calloc(sizeof(char),strlen(argv[7])); - x11base->TabScriptId[0]=strncpy(x11base->TabScriptId[0],argv[7],strlen("FvwmScript")+3); - x11base->TabScriptId[1]=argv[7]; - myatom=XInternAtom(x11base->display,x11base->TabScriptId[1],True); - XSetSelectionOwner(x11base->display,myatom,x11base->win,CurrentTime); - FisrtArg=8; - } -} - -/* main procedure */ -int main (int argc, char **argv) -{ - int IsFather; - int i; - - /* we get rid of the path from program name */ - ModuleName = argv[0]; - - /* On determine si le script a un pere */ - if (argc>=8) - IsFather=(argv[7][0]!=(char)161); - else - IsFather=1; - - - signal (SIGPIPE, DeadPipe); - signal (SIGINT, DeadPipe); /* cleanup on other ways of closing too */ - signal (SIGHUP, DeadPipe); - signal (SIGQUIT, DeadPipe); - signal (SIGTERM, DeadPipe); - - if (argc < 6) - { - fprintf(stderr,"%s must be started by Fvwm.\n", ModuleName); - exit(1); - } - else - if(argc>=7) - { - ScriptName = argv[6]; - ref = strtol(argv[4], NULL, 16); - if (ref == 0) ref = None; - fd[0] = atoi(argv[1]); - fd[1] = atoi(argv[2]); - SetMessageMask(fd, M_NEW_DESK | M_END_WINDOWLIST| - M_MAP| M_RES_NAME| M_RES_CLASS| M_CONFIG_INFO| - M_END_CONFIG_INFO| M_WINDOW_NAME); - - /* Enregistrement des arguments du script */ - x11base=(X11base*) calloc(1,sizeof(X11base)); - x11base->TabArg[0]=ModuleName; - for (i=8-IsFather;i<argc;i++) - x11base->TabArg[i-7+IsFather]=argv[i]; - - } - else - { - fprintf(stderr,"%s requires only the path of the script.\n", ModuleName); - exit(1); - } - - ParseOptions(); - - SendText(fd,"Send_WindowList",0); - - ReadConfig(ScriptName); /* Lecture et analyse du script */ - - InitCom(); /* Fonction d'initialisation de TabCom et TabFunc */ - - BuildGUI(IsFather); /* Construction des boutons et de la fenetre */ - - ReadFvwmScriptArg(argc,argv,IsFather); - - MainLoop(); - return 0; -} diff --git a/app/fvwm/extras/FvwmScript/INSTALL b/app/fvwm/extras/FvwmScript/INSTALL deleted file mode 100644 index 5915e810d..000000000 --- a/app/fvwm/extras/FvwmScript/INSTALL +++ /dev/null @@ -1,11 +0,0 @@ - -How to install FvwmScript in the fvwm-2.0.45 tree. - -1) Untar the distribution inside fvwm-2.0.45/modules/FvwmButtons - -3) In that directory, type - xmkmf; make Makefiles; make install -This will install FvwmScript and script examples in the module directory. -You can copy the file FvwmScript/Scripts/system.fvwmrc to ~/.fvwmrc. -This is an example of the Fvwm configuration file. This one is necessary -for using the script "DeskSetup". diff --git a/app/fvwm/extras/FvwmScript/Instructions.c b/app/fvwm/extras/FvwmScript/Instructions.c deleted file mode 100644 index 29aa2f083..000000000 --- a/app/fvwm/extras/FvwmScript/Instructions.c +++ /dev/null @@ -1,1266 +0,0 @@ -#include "types.h" - -extern int fd[2]; -extern Window ref; - -void (*TabCom[30]) (int NbArg,long *TabArg); -char *(*TabFunc[20]) (int *NbArg, long *TabArg); -int (*TabComp[15]) (char *arg1,char *arg2); - -extern X11base *x11base; -extern int grab_serve; -extern struct XObj *tabxobj[100]; -extern void LoadIcon(struct XObj *xobj); - -extern int nbobj; -extern char **TabVVar; -extern int TabIdObj[101]; -extern char *ScriptName; -extern char *ModuleName; -extern TypeBuffSend BuffSend; -extern Atom propriete; - -char *BufCom; -char Command[255]="None"; -time_t TimeCom=0; - -/*************************************************************/ -/* Ensemble de fonction de comparaison de deux entiers */ -/*************************************************************/ -int Inf(char *arg1,char *arg2) -{ - int an1,an2; - an1=atoi(arg1); - an2=atoi(arg2); - return (an1<an2); -} - -int InfEq(char *arg1,char *arg2) -{ - int an1,an2; - an1=atoi(arg1); - an2=atoi(arg2); - return (an1<=an2); -} - -int Equal(char *arg1,char *arg2) -{ - int an1,an2; - an1=atoi(arg1); - an2=atoi(arg2); - return (strcmp(arg1,arg2)==0); -} - -int SupEq(char *arg1,char *arg2) -{ - int an1,an2; - an1=atoi(arg1); - an2=atoi(arg2); - return (an1>=an2); -} - -int Sup(char *arg1,char *arg2) -{ - int an1,an2; - an1=atoi(arg1); - an2=atoi(arg2); - return (an1>an2); -} - -int Diff(char *arg1,char *arg2) -{ - int an1,an2; - an1=atoi(arg1); - an2=atoi(arg2); - return (strcmp(arg1,arg2)!=0); -} - -/*****************************************************/ -/* Fonction qui retourne la valeur d'un argument */ -/*****************************************************/ -char *CalcArg (long *TabArg,int *Ix) -{ - char *TmpStr; - int i; - - if (TabArg[*Ix]>100000) /* Cas du codage d'un nombre */ - { - i=(int)TabArg[*Ix]-200000; - TmpStr=(char*)calloc(1,sizeof(char)*10); - sprintf(TmpStr,"%d",i); - } - else if (TabArg[*Ix]<-200000)/* Cas d'un id de fonction de comparaison */ - { - i=TabArg[*Ix]+250000; - TmpStr=(char*)calloc(1,sizeof(char)*10); - sprintf(TmpStr,"%d",i); - } - else if (TabArg[*Ix]< -100000) /* Cas d'un id de fonction */ - { - TmpStr=TabFunc[TabArg[*Ix]+150000](Ix,TabArg); - } - else /* Cas d'une variable */ - { - TmpStr=strdup(TabVVar[TabArg[*Ix]]); - } - return (TmpStr); -} - -/*************************************************************/ -/* Ensemble des fonctions pour recuperer les prop d'un objet */ -/*************************************************************/ -char *FuncGetValue(int *NbArg, long *TabArg) -{ - char *tmp; - long Id; - - (*NbArg)++; /* La fonction GetValue n'a qu'un seul argument */ - tmp=CalcArg(TabArg,NbArg); - Id=atoi(tmp); - free(tmp); - tmp=(char*)calloc(1,sizeof(char)*10); - sprintf(tmp,"%d",tabxobj[TabIdObj[Id]]->value); - return tmp; -} - -/* Fonction qui retourne le titre d'un objet */ -char *FuncGetTitle(int *NbArg, long *TabArg) -{ - char *tmp; - long Id; - - (*NbArg)++; - tmp=CalcArg(TabArg,NbArg); - Id=atoi(tmp); - free(tmp); - if (TabIdObj[Id]!=-1) - tmp=strdup(tabxobj[TabIdObj[Id]]->title); - else - { - fprintf(stderr,"Widget %d doesn't exist\n",(int)Id); - tmp=(char*)calloc(1,sizeof(char)); - tmp[0]='\0'; - } - return tmp; -} - -/* Fonction qui retourne la sortie d'une commande */ -char *FuncGetOutput(int *NbArg, long *TabArg) -{ - char *cmndbuf; - char *str; - int line,index,i=2,j=0,k,NewWord; - FILE *f; - int maxsize=32000; - int size; - - (*NbArg)++; - cmndbuf=CalcArg(TabArg,NbArg); - (*NbArg)++; - str=CalcArg(TabArg,NbArg); - line=atoi(str); - free(str); - (*NbArg)++; - str=CalcArg(TabArg,NbArg); - index=atoi(str); - free(str); - - if ((strcmp(Command,cmndbuf))||((time(NULL)-TimeCom)>1)||(TimeCom==0)) - { - if ((f = popen(cmndbuf,"r")) == NULL) - { - fprintf(stderr,"%s: can't run %s\n",ScriptName,cmndbuf); - str=(char*)calloc(sizeof(char),10); - free(cmndbuf); - return str; - } - else - { - if (strcmp(Command,"None")) - free(BufCom); - BufCom=(char*)calloc(sizeof(char),maxsize); - size=fread(BufCom,1,maxsize,f); - pclose(f); - strcpy(Command,cmndbuf); - TimeCom=time(NULL); - } - } - - /* Recherche de la ligne */ - while ((i<=line)&&(BufCom[j]!='\0')) - { - j++; - if (BufCom[j]=='\n') i++; - } - - /* Recherche du mot */ - if (index!=-1) - { - if (i!=2) j++; - i=1; - NewWord=0; - while ((i<index)&&(BufCom[j]!='\n')&&(BufCom[j]!='\0')) - { - j++; - if (BufCom[j]==' ') - { - if (NewWord) - { - i++; - NewWord=0; - } - } - else - if (!NewWord) NewWord=1; - } - str=(char*)calloc(sizeof(char),255); - sscanf(&BufCom[j],"%s",str); - } - else /* Lecture de la ligne complete */ - { - if (i!=2) j++; - k=j; - while ((BufCom[k]!='\n')&&(BufCom[k]!='\0')) - k++; - str=(char*)calloc(sizeof(char),k-j+1); - memmove(str,&BufCom[j],k-j); - str[k-j]='\0'; - } - - free(cmndbuf); - return str; -} - -/* Convertion decimal vers hexadecimal */ -char *FuncNumToHex(int *NbArg, long *TabArg) -{ - char *str; - int value,nbchar; - int i,j; - - (*NbArg)++; - str=CalcArg(TabArg,NbArg); - value=atoi(str); - free(str); - (*NbArg)++; - str=CalcArg(TabArg,NbArg); - nbchar=atoi(str); - free(str); - - str=(char*)calloc(1,nbchar+10); - sprintf(str,"%X",value); - j=strlen(str); - if (j<nbchar) - { - memmove(&str[nbchar-j],str,j); - for (i=0;i<(nbchar-j);i++) - str[i]='0'; - } - - return str; -} - -/* Convertion hexadecimal vers decimal */ -char *FuncHexToNum(int *NbArg, long *TabArg) -{ - char *str,*str2; - int k; - - (*NbArg)++; - str=CalcArg(TabArg,NbArg); - if (str[0]=='#') - memmove(str,&str[1],strlen(str)); - k=(int)strtol(str,NULL,16); - free(str); - - str2=(char*)calloc(1,20); - sprintf(str2,"%d",k); - return str2; -} - -char *FuncAdd(int *NbArg, long *TabArg) -{ - char *str; - int val1,val2; - - (*NbArg)++; - str=CalcArg(TabArg,NbArg); - val1=atoi(str); - free(str); - (*NbArg)++; - str=CalcArg(TabArg,NbArg); - val2=atoi(str); - free(str); - str=(char*)calloc(1,20); - sprintf(str,"%d",val1+val2); - return str; -} - -char *FuncMult(int *NbArg, long *TabArg) -{ - char *str; - int val1,val2; - - (*NbArg)++; - str=CalcArg(TabArg,NbArg); - val1=atoi(str); - free(str); - (*NbArg)++; - str=CalcArg(TabArg,NbArg); - val2=atoi(str); - free(str); - str=(char*)calloc(1,20); - sprintf(str,"%d",val1*val2); - return str; -} - -char *FuncDiv(int *NbArg, long *TabArg) -{ - char *str; - int val1,val2; - - (*NbArg)++; - str=CalcArg(TabArg,NbArg); - val1=atoi(str); - free(str); - (*NbArg)++; - str=CalcArg(TabArg,NbArg); - val2=atoi(str); - free(str); - str=(char*)calloc(1,20); - sprintf(str,"%d",val1/val2); - return str; -} - -char *RemainderOfDiv(int *NbArg, long *TabArg) -{ -#ifndef HAVE_DIV - return strdup("Unsupported function: div"); -#else - char *str; - int val1,val2; - div_t res; - - (*NbArg)++; - str=CalcArg(TabArg,NbArg); - val1=atoi(str); - free(str); - (*NbArg)++; - str=CalcArg(TabArg,NbArg); - val2=atoi(str); - free(str); - str=(char*)calloc(1,20); - res=div(val1,val2); - sprintf(str,"%d",res.rem); - return str; -#endif -} - - -char *FuncStrCopy(int *NbArg, long *TabArg) -{ - char *str,*strsrc; - int i1,i2; - - (*NbArg)++; - strsrc=CalcArg(TabArg,NbArg); - (*NbArg)++; - str=CalcArg(TabArg,NbArg); - i1=atoi(str); - if (i1<1) i1=1; - free(str); - (*NbArg)++; - str=CalcArg(TabArg,NbArg); - i2=atoi(str); - if (i2<1) i2=1; - free(str); - - if ((i1<=i2)&&(i1<=strlen(strsrc))) - { - if (i2>strlen(strsrc)) i2=strlen(strsrc); - str=(char*)calloc(1,i2-i1+2); - memmove(str,&strsrc[i1-1],i2-i1+1); - } - else - { - str=(char*)calloc(1,1); - } - - free(strsrc); - return str; -} - -/* Lancement d'un script avec pipe */ -char *LaunchScript (int *NbArg,long *TabArg) -{ - char *arg,*execstr,*str,*scriptarg,*scriptname; - int leng,i; - Atom MyAtom; - - /* Lecture des arguments */ - (*NbArg)++; - arg=CalcArg(TabArg,NbArg); - - str=(char*)calloc(100,sizeof(char)); - - /* Calcul du nom du script fils */ - x11base->TabScriptId[x11base->NbChild+2]=(char*)calloc(strlen(x11base->TabScriptId[1])+4,sizeof(char)); - - if (x11base->NbChild<98) - { - i=16; - do - { - sprintf(x11base->TabScriptId[x11base->NbChild+2],"%s%x",x11base->TabScriptId[1],i); - MyAtom=XInternAtom(x11base->display,x11base->TabScriptId[x11base->NbChild+2],False); - i++; - } - while (XGetSelectionOwner(x11base->display,MyAtom)!=None); - } - else - { - fprintf(stderr,"Too many launched script\n"); - sprintf(str,"-1"); - return str; - } - - /* Construction de la commande */ - execstr=(char*)calloc(strlen(ModuleName)+strlen(arg)+ - strlen(x11base->TabScriptId[x11base->NbChild+2])+5,sizeof(char)); - scriptname=(char*)calloc(sizeof(char),100); - sscanf(arg,"%s",scriptname); - scriptarg=(char*)calloc(sizeof(char),strlen(arg)); - scriptarg=(char*)strncpy(scriptarg,&arg[strlen(scriptname)],strlen(arg)-strlen(scriptname)); - sprintf(execstr,"%s %s %s %s",ModuleName,scriptname, - x11base->TabScriptId[x11base->NbChild+2],scriptarg); - free(scriptname); - free(scriptarg); - free(arg); - - /* Envoi de la commande */ - write(fd[0], &ref, sizeof(Window)); - leng = strlen(execstr); - write(fd[0], &leng, sizeof(int)); - write(fd[0], execstr, leng); - leng = 1; - write(fd[0], &leng, sizeof(int)); - free(execstr); - - /* Retourne l'id du fils */ - sprintf(str,"%d",x11base->NbChild+2); - x11base->NbChild++; - return str; -} - -char *GetScriptFather (int *NbArg,long *TabArg) -{ - char *str; - - str=(char*)calloc(10,sizeof(char)); - sprintf(str,"0"); - return str; -} - -char *GetTime (int *NbArg,long *TabArg) -{ - char *str; - time_t t; - - str=(char*)calloc(20,sizeof(char)); - t=time(NULL); - sprintf(str,"%ld",(long)t-x11base->BeginTime); - return str; -} - -char *GetScriptArg (int *NbArg,long *TabArg) -{ - char *str; - int val1; - - (*NbArg)++; - str=CalcArg(TabArg,NbArg); - val1=atoi(str); - free(str); - - str=(char*)calloc(strlen(x11base->TabArg[val1])+1,sizeof(char)); - str=strcpy(str,x11base->TabArg[val1]); - - return str; -} - -char *ReceivFromScript (int *NbArg,long *TabArg) -{ - char *arg,*msg; - int send; - Atom AReceiv,ASend,type; - static XEvent event; - unsigned long longueur,octets_restant; - unsigned char *donnees=""; - int format; - int NbEssai=0; - - (*NbArg)++; - arg=CalcArg(TabArg,NbArg); - send=(int)atoi(arg); - free(arg); - - msg=(char*)calloc(256,sizeof(char)); - sprintf(msg,"No message"); - - /* Recuperation des atomes */ - AReceiv=XInternAtom(x11base->display,x11base->TabScriptId[1],True); - if (AReceiv==None) - { - fprintf(stderr,"Error with atome\n"); - return msg; - } - - if ((send>=0)&&(send<99)) - if (x11base->TabScriptId[send]!=NULL) - { - ASend=XInternAtom(x11base->display,x11base->TabScriptId[send],True); - if (ASend==None) - fprintf(stderr,"Error with atome\n"); - } - else - return msg; - else - return msg; - - /* Recuperation du message */ - XConvertSelection(x11base->display,ASend,AReceiv,propriete,x11base->win,CurrentTime); - while ((!XCheckTypedEvent(x11base->display,SelectionNotify,&event))&&(NbEssai<25000)) - NbEssai++; - if (event.xselection.property!=None) - if (event.xselection.selection==ASend) - { - XGetWindowProperty(x11base->display,event.xselection.requestor,event.xselection.property,0, - 8192,False,event.xselection.target,&type,&format,&longueur,&octets_restant, - &donnees); - if (longueur>0) - { - msg=(char*)realloc((void*)msg,(longueur+1)*sizeof(char)); - msg=strcpy(msg,donnees); - XDeleteProperty(x11base->display,event.xselection.requestor,event.xselection.property); - XFree(donnees); - } - } - - return msg; -} - - -/***********************************************/ -/* Ensemble des commandes possible pour un obj */ -/***********************************************/ - -void Exec (int NbArg,long *TabArg) -{ - int leng; - char *execstr; - char *tempstr; - int i; - - execstr=(char*)calloc(1,256); - for (i=0;i<NbArg;i++) - { - tempstr=CalcArg(TabArg,&i); - execstr=strcat(execstr,tempstr); - free(tempstr); - } - - write(fd[0], &ref, sizeof(Window)); - leng = strlen(execstr); - write(fd[0], &leng, sizeof(int)); - write(fd[0], execstr, leng); - leng = 1; - write(fd[0], &leng, sizeof(int)); - - - free(execstr); -} - -void HideObj (int NbArg,long *TabArg) -{ - char *arg[1]; - int IdItem; - int i=0; - - arg[0]=CalcArg(TabArg,&i); - IdItem= TabIdObj[atoi(arg[0])]; - - tabxobj[IdItem]->flags[0]=True; - /* On cache la fentre pour la faire disparaitre */ - XUnmapWindow(x11base->display,tabxobj[IdItem]->win); - free(arg[0]); -} - -void ShowObj (int NbArg,long *TabArg) -{ - char *arg[1]; - int IdItem; - int i=0; - - arg[0]=CalcArg(TabArg,&i); - IdItem= TabIdObj[atoi(arg[0])]; - - tabxobj[IdItem]->flags[0]=False; - XMapWindow(x11base->display,tabxobj[IdItem]->win); - tabxobj[IdItem]->DrawObj(tabxobj[IdItem]); - free(arg[0]); -} - -void ChangeValue (int NbArg,long *TabArg) -{ - int i=0; - char *arg[2]; - - arg[0]=CalcArg(TabArg,&i); - i++; - arg[1]=CalcArg(TabArg,&i); - - tabxobj[TabIdObj[atoi(arg[0])]]->value=atoi(arg[1]); - /* On redessine l'objet pour le mettre a jour */ - tabxobj[TabIdObj[atoi(arg[0])]]->DrawObj(tabxobj[TabIdObj[atoi(arg[0])]]); - free(arg[0]); - free(arg[1]); -} - -void ChangeValueMax (int NbArg,long *TabArg) -{ - int i=0; - char *arg[2]; - int j; - - arg[0]=CalcArg(TabArg,&i); - j=atoi(arg[0]); - i++; - arg[1]=CalcArg(TabArg,&i); - - tabxobj[TabIdObj[j]]->value3=atoi(arg[1]); - /* On redessine l'objet pour le mettre a jour */ - if (tabxobj[TabIdObj[j]]->value>tabxobj[TabIdObj[j]]->value3) - { - tabxobj[TabIdObj[j]]->value=atoi(arg[1]); - tabxobj[TabIdObj[j]]->DrawObj(tabxobj[TabIdObj[j]]); - } - free(arg[0]); - free(arg[1]); -} - -void ChangeValueMin (int NbArg,long *TabArg) -{ - int i=0; - char *arg[2]; - int j; - - arg[0]=CalcArg(TabArg,&i); - i++; - arg[1]=CalcArg(TabArg,&i); - j=atoi(arg[0]); - - tabxobj[TabIdObj[j]]->value2=atoi(arg[1]); - /* On redessine l'objet pour le mettre a jour */ - if (tabxobj[TabIdObj[j]]->value<tabxobj[TabIdObj[j]]->value2) - { - tabxobj[TabIdObj[j]]->value=atoi(arg[1]); - tabxobj[TabIdObj[j]]->DrawObj(tabxobj[TabIdObj[j]]); - } - free(arg[0]); - free(arg[1]); -} - -void ChangePos (int NbArg,long *TabArg) -{ - int i=0; - char *arg[3]; - int an[3]; - int IdItem; - - arg[0]=CalcArg(TabArg,&i); - i++; - arg[1]=CalcArg(TabArg,&i); - i++; - arg[2]=CalcArg(TabArg,&i); - - IdItem= TabIdObj[atoi(arg[0])]; - for (i=1;i<3;i++) - an[i]=atoi(arg[i]); - tabxobj[IdItem]->x=an[1]; - tabxobj[IdItem]->y=an[2]; - XMoveWindow(x11base->display,tabxobj[IdItem]->win,an[1],an[2]); - - free(arg[0]); - free(arg[1]); - free(arg[2]); - -} - -void ChangeFont (int NbArg,long *TabArg) -{ - int i=0; - char *arg[2]; - int IdItem; - XFontStruct *xfont; - - arg[0]=CalcArg(TabArg,&i); - i++; - arg[1]=CalcArg(TabArg,&i); - IdItem= TabIdObj[atoi(arg[0])]; - - tabxobj[IdItem]->font=strdup(arg[1]); - if ((xfont=XLoadQueryFont(tabxobj[IdItem]->display,tabxobj[IdItem]->font))==NULL) - { - fprintf(stderr,"Can't load font %s\n",tabxobj[IdItem]->font); - } - else - { - XFreeFont(tabxobj[IdItem]->display,tabxobj[IdItem]->xfont); - tabxobj[IdItem]->xfont=xfont; - XSetFont(tabxobj[IdItem]->display,tabxobj[IdItem]->gc,tabxobj[IdItem]->xfont->fid); - } - tabxobj[IdItem]->DrawObj(tabxobj[IdItem]); - free(arg[0]); - free(arg[1]); -} - -void ChangeSize (int NbArg,long *TabArg) -{ - int i=0; - char *arg[3]; - int an[3]; - int IdItem; - - arg[0]=CalcArg(TabArg,&i); - i++; - arg[1]=CalcArg(TabArg,&i); - i++; - arg[2]=CalcArg(TabArg,&i); - - IdItem= TabIdObj[atoi(arg[0])]; - for (i=1;i<3;i++) - an[i]=atoi(arg[i]); - tabxobj[IdItem]->width=an[1]; - tabxobj[IdItem]->height=an[2]; - XResizeWindow(x11base->display,tabxobj[IdItem]->win,an[1],an[2]); - tabxobj[IdItem]->DrawObj(tabxobj[IdItem]); - free(arg[0]); - free(arg[1]); - free(arg[2]); -} - -void ChangeTitle (int NbArg,long *TabArg) -{ - int i=0; - char *arg[2]; - int IdItem; - - arg[0]=CalcArg(TabArg,&i); - i++; - arg[1]=CalcArg(TabArg,&i); - IdItem= TabIdObj[atoi(arg[0])]; - - tabxobj[IdItem]->title=strdup(arg[1]); - tabxobj[IdItem]->DrawObj(tabxobj[IdItem]); - free(arg[0]); - free(arg[1]); -} - -void ChangeIcon (int NbArg,long *TabArg) -{ - int i=0; - char *arg[2]; - int IdItem; - - arg[0]=CalcArg(TabArg,&i); - i++; - arg[1]=CalcArg(TabArg,&i); - IdItem= TabIdObj[atoi(arg[0])]; -/* if (tabxobj[IdItem]->icon!=NULL) - { - free(tabxobj[IdItem]->icon); - if (tabxobj[IdItem]->iconPixmap!=None) - XFreePixmap(tabxobj[IdItem]->display,tabxobj[IdItem]->iconPixmap); - if (tabxobj[IdItem]->icon_maskPixmap!=None) - XFreePixmap(tabxobj[IdItem]->display,tabxobj[IdItem]->icon_maskPixmap); - }*/ - tabxobj[IdItem]->icon=strdup(arg[1]); - LoadIcon(tabxobj[IdItem]); - tabxobj[IdItem]->DrawObj(tabxobj[IdItem]); - free(arg[0]); - free(arg[1]); -} - -void ChangeForeColor (int NbArg,long *TabArg) -{ - int i=0; - char *arg[2]; - int IdItem; - - arg[0]=CalcArg(TabArg,&i); - i++; - arg[1]=CalcArg(TabArg,&i); - IdItem= TabIdObj[atoi(arg[0])]; - - /* Liberation de la couleur */ - XFreeColors(tabxobj[IdItem]->display,*(tabxobj[IdItem])->colormap, - (void*)(&(tabxobj[IdItem])->TabColor[fore]),1,0); - - tabxobj[IdItem]->forecolor=(char*)calloc(100,sizeof(char)); - sprintf(tabxobj[IdItem]->forecolor,"%s",arg[1]); - - MyAllocNamedColor(tabxobj[IdItem]->display,*(tabxobj[IdItem])->colormap, - tabxobj[IdItem]->forecolor,&(tabxobj[IdItem])->TabColor[fore]); - - tabxobj[IdItem]->DrawObj(tabxobj[IdItem]); - - free(arg[0]); - free(arg[1]); - -} - -void ChangeBackColor (int NbArg,long *TabArg) -{ - int i=0; - char *arg[2]; - int IdItem; - - arg[0]=CalcArg(TabArg,&i); - i++; - arg[1]=CalcArg(TabArg,&i); - IdItem= TabIdObj[atoi(arg[0])]; - - /* Liberation de la couleur */ - XFreeColors(tabxobj[IdItem]->display,*(tabxobj[IdItem])->colormap, - (void*)(&(tabxobj[IdItem])->TabColor[back]),1,0); - - tabxobj[IdItem]->backcolor=(char*)calloc(100,sizeof(char)); - sprintf(tabxobj[IdItem]->backcolor,"%s",arg[1]); - - MyAllocNamedColor(tabxobj[IdItem]->display,*(tabxobj[IdItem])->colormap, - tabxobj[IdItem]->backcolor,&(tabxobj[IdItem])->TabColor[back]); - - tabxobj[IdItem]->DrawObj(tabxobj[IdItem]); - - free(arg[0]); - free(arg[1]); -} - -void SetVar (int NbArg,long *TabArg) -{ - int i; - char *str,*tempstr; - - str=(char*)calloc(sizeof(char),1); - for (i=1;i<NbArg;i++) - { - tempstr=CalcArg(TabArg,&i); - str=(char*)realloc((void*)str,sizeof(char)*(1+strlen(str)+strlen(tempstr))); - str=strcat(str,tempstr); - free(tempstr); - } - - free(TabVVar[TabArg[0]]); - TabVVar[TabArg[0]]=str; -} - -void SendSign (int NbArg,long *TabArg) -{ - int i=0; - char *arg[2]; - int IdItem; - int TypeMsg; - - arg[0]=CalcArg(TabArg,&i); - i++; - arg[1]=CalcArg(TabArg,&i); - IdItem= TabIdObj[atoi(arg[0])]; - TypeMsg=atoi(arg[1]); - SendMsg(tabxobj[IdItem],TypeMsg); - free(arg[0]); - free(arg[1]); -} - -void WarpPointer(int NbArg,long *TabArg) -{ - int i=0; - char *arg; - int IdItem; - - arg=CalcArg(TabArg,&i); - IdItem= TabIdObj[atoi(arg)]; - /* Deplacement du pointeur sur l'objet */ - XWarpPointer(x11base->display,None,tabxobj[IdItem]->win,0,0,0,0, - tabxobj[IdItem]->width/2,tabxobj[IdItem]->height+10); - free(arg); -} - -void Quit (int NbArg,long *TabArg) -{ - int i; - static XEvent event; - fd_set in_fdset; - extern int x_fd; - Atom MyAtom; - int NbEssai=0; - struct timeval tv; - -#ifdef DEBUG /* For debugging */ - XSync(x11base->display,0); -#endif - - /* On cache la fenetre */ - XUnmapWindow(x11base->display,x11base->win); - XFlush(x11base->display); - - /* Le script ne possede plus la propriete */ - MyAtom=XInternAtom(x11base->display,x11base->TabScriptId[1],False); - XSetSelectionOwner(x11base->display,MyAtom,x11base->root,CurrentTime); - - /* On verifie si tous les messages ont ete envoyes */ - while((BuffSend.NbMsg>0)&&(NbEssai<10000)) - { - tv.tv_sec = 1; - tv.tv_usec = 0; - FD_ZERO(&in_fdset); - FD_SET(x_fd,&in_fdset); - select(32, SELECT_TYPE_ARG234 &in_fdset, NULL, NULL, &tv); - if (FD_ISSET(x_fd, &in_fdset)) - { - if (XCheckTypedEvent(x11base->display,SelectionRequest,&event)) - SendMsgToScript(event); - else - NbEssai++; - } - } - XFlush(x11base->display); - - /* Attente de deux secondes afin d'etre sur que tous */ - /* les messages soient arrives a destination */ - /* On quitte proprement le serveur X */ - for (i=0;i<nbobj;i++) - tabxobj[i]->DestroyObj(tabxobj[i]); - XFlush(x11base->display); -/* XSync(x11base->display,True);*/ - sleep(2); - XFreeGC(x11base->display,x11base->gc); - XFreeColormap(x11base->display,x11base->colormap); - XDestroyWindow(x11base->display,x11base->win); - XCloseDisplay(x11base->display); - exit(0); -} - -void IfThen (int NbArg,long *TabArg) -{ - char *arg[10]; - int i,j; - int CurrArg=0; - int IdFuncComp = 0; - - /* Verification de la condition */ - for (j=0;j<NbArg-2;j++) - { - if (TabArg[j]>100000) /* Cas du codage d'un nombre */ - { - i=(int)TabArg[j]-200000; - arg[CurrArg]=(char*)calloc(1,sizeof(char)*10); - sprintf(arg[CurrArg],"%d",i); - CurrArg++; - } - else if (TabArg[j]<-200000)/* Cas d'un id de fonction de comparaison */ - { - IdFuncComp=TabArg[j]+250000; - } - else if (TabArg[j]<-100000) /* Cas d'un id de fonction */ - { - arg[CurrArg]=TabFunc[TabArg[j]+150000](&j,TabArg); - CurrArg++; - } - else /* Cas d'une variable */ - { - arg[CurrArg]=strdup(TabVVar[TabArg[j]]); - CurrArg++; - } - } - - /* Comparaison des arguments */ - if (TabComp[IdFuncComp](arg[0],arg[1])) - ExecBloc((Bloc*)TabArg[NbArg-2]); - else if (TabArg[NbArg-1]!=0) - ExecBloc((Bloc*)TabArg[NbArg-1]); - - free(arg[0]); - free(arg[1]); -} - -/* Instruction boucle */ -void Loop (int NbArg,long *TabArg) -{ - int IdVar; - char *arg[2]; - int limit[2]; - int i; - int CurrArg=0; - - /* le premier argument est une variable */ - IdVar=TabArg[0]; - /*On ajuste la taille de la var pour contenir un nombre */ - TabVVar[TabArg[0]]=(char*)realloc(TabVVar[TabArg[0]],sizeof(char)*10); - /* Calcul des 2 autres arguments */ - for (i=1;i<NbArg-1;i++) - { - if (TabArg[i]>100000) /* Cas du codage d'un nombre */ - { - i=(int)TabArg[i]-200000; - arg[CurrArg]=(char*)calloc(1,sizeof(char)*10); - sprintf(arg[CurrArg],"%d",i); - } - else if (TabArg[i]<-100000) /* Cas d'un id de fonction */ - { - arg[CurrArg]=TabFunc[TabArg[i]+150000](&i,TabArg); - } - else /* Cas d'une variable */ - arg[CurrArg]=strdup(TabVVar[TabArg[i]]); - CurrArg++; - } - limit[0]=atoi(arg[0]); - limit[1]=atoi(arg[1]); - if (limit[0]<limit[1]) - for (i=limit[0];i<=limit[1];i++) - { - /* On met a jour la variable */ - sprintf(TabVVar[TabArg[0]],"%d",i); - ExecBloc((Bloc*)TabArg[NbArg-1]); - } - else - for (i=limit[0];i<=limit[1];i++) - { - sprintf(TabVVar[TabArg[0]],"%d",i); - ExecBloc((Bloc*)TabArg[NbArg-1]); - } - - free(arg[0]); - free(arg[1]); -} - -/* Instruction While */ -void While (int NbArg,long *TabArg) -{ - char *arg[3],*str; - int i; - int Loop=1; - int IdFuncComp; - - while (Loop) - { - i=0; - arg[0]=CalcArg(TabArg,&i); - i++; - str=CalcArg(TabArg,&i); - IdFuncComp=atoi(str); - free(str); - i++; - arg[1]=CalcArg(TabArg,&i); - - Loop=TabComp[IdFuncComp](arg[0],arg[1]); - if (Loop) ExecBloc((Bloc*)TabArg[NbArg-1]); - free(arg[0]); - free(arg[1]); - } -} - - -void WriteToFile (int NbArg,long *TabArg) -{ - int i=0; - char *arg[2],str[50],*tempstr,*home,*file; - FILE *f; - char StrBegin[100]; - char StrEnd[10]; - size_t size; - char *buf; - int maxsize=32000; - int CurrPos=0,CurrPos2; - int OldPID; - - arg[0]=CalcArg(TabArg,&i); - arg[1]=(char*)calloc(1,256); - for (i=1;i<NbArg;i++) - { - tempstr=CalcArg(TabArg,&i); - arg[1]=strcat(arg[1],tempstr); - free(tempstr); - } - if (arg[1][strlen(arg[1])-1]!='\n') - { - i=strlen(arg[1]); - arg[1]=(char*)realloc(arg[1],strlen(arg[1])+2); - arg[1][i]='\n'; - arg[1][i+1]='\0'; - } - - sprintf(StrEnd,"#end\n"); - sprintf(StrBegin,"#%s,",ScriptName); - - buf=(char*)calloc(1,maxsize); - - if (arg[0][0]!='/') - { - file=strdup(arg[0]); - home=getenv("HOME"); - arg[0]=(char*)realloc(arg[0],sizeof(char)*(strlen(arg[0])+4+strlen(home))); - sprintf(arg[0],"%s/%s",home,file); -/* free(home);*/ /* BUG */ - free(file); - } - f=fopen(arg[0],"a+"); - fseek(f,0,SEEK_SET); - size=fread(buf,1,maxsize,f); - while(((strncmp(StrBegin,&buf[CurrPos],strlen(StrBegin)))!=0)&&(CurrPos<size)) - CurrPos++; - if (CurrPos==size) - { - sprintf(buf,"%s\n%s%d\n",buf,StrBegin,getpid()); - sprintf(buf,"%s%s",buf,arg[1]); - sprintf(buf,"%s%s\n",buf,StrEnd); - } - else - { - sscanf(&buf[CurrPos+strlen(StrBegin)],"%d",&OldPID); - if (OldPID==getpid()) - { - sprintf(str,"%d\n",OldPID); - while(((strncmp(StrEnd,&buf[CurrPos],strlen(StrEnd)))!=0)&&(CurrPos<size)) - CurrPos++; - memmove(&buf[CurrPos+strlen(arg[1])],&buf[CurrPos],strlen(buf)-CurrPos); - memmove(&buf[CurrPos],arg[1],strlen(arg[1])); - } - else /* Remplacement des anciennes commandes */ - { - CurrPos=CurrPos+strlen(StrBegin); - CurrPos2=CurrPos; - while(((strncmp(StrEnd,&buf[CurrPos2],strlen(StrEnd)))!=0)&&(CurrPos2<size)) - CurrPos2++; - sprintf(str,"%d\n%s",getpid(),arg[1]); - memmove(&buf[CurrPos+strlen(str)],&buf[CurrPos2],strlen(buf)-CurrPos2); - buf[strlen(buf)-((CurrPos2-CurrPos)-strlen(str))]='\0'; - memmove(&buf[CurrPos],str,strlen(str)); - } - } - - fclose(f); - f=fopen(arg[0],"w"); - if (f==NULL) - { - fprintf(stderr,"Enable to open file %s\n",arg[0]); - return; - } - fwrite(buf,1,strlen(buf),f); - fclose(f); - - free(arg[0]); - free(arg[1]); -} - -void SendToScript (int NbArg,long *TabArg) -{ - char *tempstr,*Msg,*R; - int dest; - int j=0; - Atom myatom; - - /* Calcul destinataire */ - tempstr=CalcArg(TabArg,&j); - dest=(int)atoi(tempstr); - free(tempstr); - - /* Calcul contenu */ - Msg=(char*)calloc(256,sizeof(char)); - for (j=1;j<NbArg;j++) - { - tempstr=CalcArg(TabArg,&j); - Msg=(char*)realloc((void*)Msg,strlen(Msg)+strlen(tempstr)+1); - Msg=strcat(Msg,tempstr); - free(tempstr); - } - - /* Calcul recepteur */ - R=(char*)calloc(strlen(x11base->TabScriptId[dest])+1,sizeof(char)); - sprintf(R,"%s",x11base->TabScriptId[dest]); - myatom=XInternAtom(x11base->display,R,True); - - if ((BuffSend.NbMsg<40)&&(XGetSelectionOwner(x11base->display,myatom)!=None)) - { - /* Enregistrement dans le buffer du message */ - BuffSend.TabMsg[BuffSend.NbMsg].Msg=Msg; - /* Enregistrement dans le buffer du destinataire */ - BuffSend.TabMsg[BuffSend.NbMsg].R=R; - /* Enregistrement du message */ - BuffSend.NbMsg++; - - /* Reveil du destinataire */ - XConvertSelection(x11base->display,XInternAtom(x11base->display,x11base->TabScriptId[dest],True) - ,propriete,propriete,x11base->win,CurrentTime); - } - else - { - fprintf(stderr,"Too many messages sended\n"); - free(Msg); - } -} - -/****************************************************/ -/* Fonction d'initialisation de TabCom et TabFunc */ -/****************************************************/ -void InitCom() -{ - /* commande */ - TabCom[1]=Exec; - TabCom[2]=HideObj; - TabCom[3]=ShowObj; - TabCom[4]=ChangeValue; - TabCom[5]=ChangePos; - TabCom[6]=ChangeSize; - TabCom[7]=ChangeIcon; - TabCom[8]=ChangeTitle; - TabCom[9]=ChangeFont; - TabCom[10]=ChangeForeColor; - TabCom[11]=SetVar; - TabCom[12]=SendSign; - TabCom[13]=Quit; - TabCom[14]=IfThen; - TabCom[15]=Loop; - TabCom[16]=While; - TabCom[17]=WarpPointer; - TabCom[18]=WriteToFile; - TabCom[19]=ChangeBackColor; - TabCom[21]=ChangeValueMax; - TabCom[22]=ChangeValueMin; - TabCom[23]=SendToScript; - - /* Fonction */ - TabFunc[1]=FuncGetValue; - TabFunc[2]=FuncGetTitle; - TabFunc[3]=FuncGetOutput; - TabFunc[4]=FuncNumToHex; - TabFunc[5]=FuncHexToNum; - TabFunc[6]=FuncAdd; - TabFunc[7]=FuncMult; - TabFunc[8]=FuncDiv; - TabFunc[9]=FuncStrCopy; - TabFunc[10]=LaunchScript; - TabFunc[11]=GetScriptFather; - TabFunc[12]=ReceivFromScript; - TabFunc[13]=RemainderOfDiv; - TabFunc[14]=GetTime; - TabFunc[15]=GetScriptArg; - - /* Fonction de comparaison */ - TabComp[1]=Inf; - TabComp[2]=InfEq; - TabComp[3]=Equal; - TabComp[4]=SupEq; - TabComp[5]=Sup; - TabComp[6]=Diff; - -} diff --git a/app/fvwm/extras/FvwmScript/Scripts/BellSetup b/app/fvwm/extras/FvwmScript/Scripts/BellSetup deleted file mode 100644 index 6920a2454..000000000 --- a/app/fvwm/extras/FvwmScript/Scripts/BellSetup +++ /dev/null @@ -1,169 +0,0 @@ -WindowTitle {Bell} -WindowSize 360 230 # Taille -WindowPosition 191 50 # Position -ForeColor {black} -BackColor {grey85} -ShadowColor {grey55} -HilightColor {grey100} -Font -adobe-helvetica-bold-r-*-*-12-* - -Init - Begin - WarpPointer 2 - ChangeValue 4 (GetOutput {xset -q} 7 3) - ChangeTitle 6 (GetOutput {xset -q } 7 6) - ChangeTitle 8 (GetOutput {xset -q} 7 9) - End - -Widget 1 -Property - Size 50 30 - Position 100 180 - Type PushButton - Title {Apply} -Main - Case message of - SingleClic : - Begin - Do {Exec xset b } (GetValue 4) { } (GetTitle 6) { } (GetTitle 8) - End -End - -Widget 2 -Property - Size 50 30 - Position 190 180 - Type PushButton - Title {OK} -Main - Case message of - SingleClic : - Begin - Do {Exec xset b } (GetValue 4) { } (GetTitle 6) { } (GetTitle 8) - WriteToFile .xinitrc-fvwm {xset b } (GetValue 4) { } (GetTitle 6) { } (GetTitle 8) - Quit - End -End - -Widget 3 -Property - Size 50 30 - Position 280 180 - Type PushButton - Title {Cancel} -Main - Case message of - SingleClic : - Begin - Quit - End -End - -Widget 4 -Property - Size 250 1 - Position 90 30 - Type HScrollBar - MinValue 0 - MaxValue 100 - Value 0 -Main - Case message of - SingleClic : - Begin - End -End - -Widget 5 -Property - Position 20 53 - Type ItemDraw - Title {Volume:} -Main - Case message of - SingleClic : - Begin - End -End - -Widget 6 -Property - Size 60 1 - Position 90 90 - Type TextField -Main - Case message of - SingleClic : - Begin - End -End - -Widget 7 -Property - Position 20 95 - Type ItemDraw - Title {Pitch(Hz):} -Main - Case message of - SingleClic : - Begin - End -End - -Widget 8 -Property - Size 60 1 - Position 280 90 - Type TextField -Main - Case message of - SingleClic : - Begin - End -End - -Widget 9 -Property - Position 190 95 - Type ItemDraw - Title {Duration(ms):} -Main - Case message of - SingleClic : - Begin - End -End - -Widget 10 -Property - Size 340 130 - Position 10 10 - Type Rectangle -Main - Case message of - SingleClic : - Begin - End -End - -Widget 11 -Property - Position 15 3 - Type ItemDraw - Title {Bell} -Main - Case message of - SingleClic : - Begin - End -End - - - - - - - - - - diff --git a/app/fvwm/extras/FvwmScript/Scripts/Buttons b/app/fvwm/extras/FvwmScript/Scripts/Buttons deleted file mode 100644 index aae0c8315..000000000 --- a/app/fvwm/extras/FvwmScript/Scripts/Buttons +++ /dev/null @@ -1,289 +0,0 @@ -WindowTitle {FvwmButtons} -WindowSize 548 95 # Taille -WindowPosition 0 0 # Position -ForeColor {#000000} -BackColor {#d0d0d0} -ShadowColor {#858585} -HilightColor {#FFFFFF} -Font -adobe-helvetica-bold-r-*-*-12-* - -Init - Begin - End - -Widget 1 -Property - Size 65 65 - Position 15 15 - Type SwallowExec - Title {xclock} - Value -1 - SwallowExec {exec xclock -analog -padding 0 -geometry 70x56-1500-1500 -fg MidnightBlue -hd Blue -hl Blue -bg Grey85 &} -Main - Case message of - SingleClic : - Begin - End -End - -Widget 2 -Property - Size 40 71 - Position 88 12 - Type SwallowExec - Title {xload} - SwallowExec {exec xload -nolabel -bg Grey85 -fg Yellow -update 3 -geometry 30x56-1500-1500 &} -Main - Case message of - SingleClic : - Begin - End -End - -Widget 3 -Property - Size 140 65 - Position 136 15 - Type SwallowExec - Title {FvwmPager} - Value -1 - SwallowExec {Module FvwmPager 0 0} -Main - Case message of - SingleClic : - Begin - End -End - -Widget 4 -Property - Size 281 85 - Position 5 5 - Type Rectangle -Main - Case message of - SingleClic : - Begin - End -End - -Widget 5 -Property - Size 251 85 - Position 291 5 - Type Rectangle -Main - Case message of - SingleClic : - Begin - End -End - - -Widget 7 -Property - Size 1 1 - Position 296 10 - Type PushButton - Title {|XV|XPaint|Image Magic|XFig|XMag|Screen Dump} - Icon small.Paint2.xpm -Main - Case message of - SingleClic : - Begin - If (GetValue 7)==1 Then - Do {Exec xv &} - If (GetValue 7)==2 Then - Do {Exec xpaint &} - If (GetValue 7)==3 Then - Do {Exec xterm -geometry -5000-5000 -e display &} - If (GetValue 7)==4 Then - Do {Exec xfig &} - If (GetValue 7)==5 Then - Do {Exec xmag &} - If (GetValue 7)==6 Then - Do {Module FvwmScript ScreenDump} - End -End - -Widget 8 -Property - Size 1 1 - Position 331 10 - Type PushButton - Title {|XCalc|HP 48GX} - Icon small.calc.next.xpm -Main - Case message of - SingleClic : - Begin - If (GetValue 8)==1 Then - Do {exec xcalc &} - If (GetValue 8)==2 Then - Do {exec x48 &} - End -End - -Widget 9 -Property - Size 1 1 - Position 366 10 - Type PushButton - Title {|TextEdit|MEdit|XEdit|Axe|Netscape|Clipboard|Plan} - Icon small.note.next.xpm -Main - Case message of - SingleClic : - Begin - If (GetValue 9)==1 Then - Do {Exec textedit -En 30 &} - If (GetValue 9)==2 Then - Do {Exec medit &} - If (GetValue 9)==3 Then - Do {Exec xedit &} - If (GetValue 9)==4 Then - Do {Exec coaxe &} - If (GetValue 9)==5 Then - Do {Exec bash -c "netscape" &} - If (GetValue 9)==6 Then - Do {Exec xclipboard &} - If (GetValue 9)==7 Then - Do {Exec plan &} - End -End - -Widget 10 -Property - Size 1 1 - Position 471 10 - Type PushButton - Title {|Random|Bat|Blot|Bouboule|Bounce|Flame|Galaxy|Grav|Helix|Hop|Maze} - Icon small.lock.xpm -Main - Case message of - SingleClic : - Begin - If (GetValue 10)==1 Then - Do {Exec xlock -nolock -nice 0 -mode random &} - If (GetValue 10)==2 Then - Do {Exec xlock -nolock -nice 0 -mode bat &} - If (GetValue 10)==3 Then - Do {Exec xlock -nolock -nice 0 -mode blot &} - If (GetValue 10)==4 Then - Do {Exec xlock -nolock -nice 0 -mode bouboule &} - If (GetValue 10)==5 Then - Do {Exec xlock -nolock -nice 0 -mode bounce &} - If (GetValue 10)==6 Then - Do {Exec xlock -nolock -nice 0 -mode flame &} - If (GetValue 10)==7 Then - Do {Exec xlock -nolock -nice 0 -mode galaxy &} - If (GetValue 10)==8 Then - Do {Exec xlock -nolock -nice 0 -mode grav &} - If (GetValue 10)==9 Then - Do {Exec xlock -nolock -nice 0 -mode helix &} - If (GetValue 10)==10 Then - Do {Exec xlock -nolock -nice 0 -mode hop &} - If (GetValue 10)==11 Then - Do {Exec xlock -nolock -nice 0 -mode maze &} - End -End - -Widget 11 -Property - Size 1 1 - Position 506 10 - Type PushButton - Icon small.exit.xpm -Main - Case message of - SingleClic : - Begin - Do {Module FvwmScript Quit} - End -End - -Widget 12 -Property - Size 1 1 - Position 436 10 - Type PushButton - Title {|Display|Bell|Keyboard|Pointer|Date|Desktop} - Icon small.tools2_3d.xpm -Main - Case message of - SingleClic : - Begin - If (GetValue 12)==1 Then - Do {Module FvwmScript ScreenSetup} - If (GetValue 12)==2 Then - Do {Module FvwmScript BellSetup} - If (GetValue 12)==3 Then - Do {Module FvwmScript KeyboardSetup} - If (GetValue 12)==4 Then - Do {Module FvwmScript PointerSetup} - If (GetValue 12)==5 Then - Do {Module FvwmScript Date} - If (GetValue 12)==6 Then - Do {Module FvwmScript DeskSetup} - End -End - -Widget 13 -Property - Size 1 1 - Position 401 10 - Type PushButton - Title {|TkMan|XMan} - Icon small.man.next.xpm -Main - Case message of - SingleClic : - Begin - If (GetValue 13)==1 Then - Do {Exec tkman &} - If (GetValue 13)==2 Then - Do {Exec xman -notopbox &} - End -End - -Widget 6 -Property - Size 240 40 - Position 296 45 - Type SwallowExec - Title {TkDesk Application Bar} - SwallowExec {exec tkdesk &} -Main - Case message of - SingleClic : - Begin - End -End - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/app/fvwm/extras/FvwmScript/Scripts/Date b/app/fvwm/extras/FvwmScript/Scripts/Date deleted file mode 100644 index a276161f5..000000000 --- a/app/fvwm/extras/FvwmScript/Scripts/Date +++ /dev/null @@ -1,416 +0,0 @@ -WindowTitle {Date} -WindowSize 360 330 # Taille -WindowPosition 191 50 # Position -ForeColor {black} -BackColor {grey85} -ShadowColor {grey55} -HilightColor {grey100} -Font -adobe-helvetica-bold-r-*-*-12-* - -Init - Begin - WarpPointer 1 - Set $NHour=(GetOutput {date '+%d %m %Y %H %M'} 1 4) - ChangeValue 10 $NHour - ChangeTitle 8 $NHour - - Set $NMinu=(GetOutput {date '+%d %m %Y %H %M'} 1 5) - ChangeValue 14 $NMinu - ChangeTitle 12 $NMinu - - Set $Day=(GetOutput {date '+%d %m %Y %H %M'} 1 1) - ChangeValue 20 $Day - ChangeTitle 18 $Day - - Set $Year=(GetOutput {date '+%d %m %Y %H %M'} 1 3) - ChangeValue 24 $Year - ChangeTitle 22 $Year - - Set $Month=(GetOutput {date '+%d %m %Y %H %M'} 1 2) - ChangeValue 26 $Month - - Set $MaxDay=31 - Set $cmd={date --date '} $Month {/} $MaxDay {/} $Year {' +%d} - While (GetOutput $cmd 1 1)=={} Do - Begin - Set $MaxDay=(Add $MaxDay -1) - Set $cmd={date --date '} $Month {/} $MaxDay {/} $Year {' +%d} - End - ChangeMaxValue 20 $MaxDay - - End - -Widget 1 -Property - Size 50 30 - Position 190 280 - Type PushButton - Title {OK} -Main - Case message of - SingleClic : - Begin - Do {Exec date -s '} $NHour {:} $NMinu { } $Month {/} $Day {/} $Year{'} - Quit - End -End - -Widget 2 -Property - Size 50 30 - Position 280 280 - Type PushButton - Title {Cancel} -Main - Case message of - SingleClic : - Begin - Do {Exec xset s } $TimeOut - Quit - End -End - -Widget 3 -Property - Size 340 130 - Position 10 10 - Type Rectangle -Main - Case message of - SingleClic : - Begin - End -End - -Widget 4 -Property - Position 15 2 - Type ItemDraw - Title {Time} -Main - Case message of - SingleClic : - Begin - End -End - -Widget 5 -Property - Size 80 80 - Position 240 35 - Type SwallowExec - Title {xclock} - SwallowExec {exec xclock -analog -padding 0 -geometry 70x56-1500-1500 -fg MidnightBlue -hd Blue -hl Blue -bg Grey85 -update 1 &} -Main - Case message of - SingleClic : - Begin - End -End - -Widget 6 -Property - Size 100 100 - Position 230 25 - Type Rectangle -Main - Case message of - SingleClic : - Begin - End -End - -Widget 7 -Property - Position 35 40 - Type ItemDraw - Title {Hours:} -Main - Case message of - SingleClic : - Begin - End -End - -Widget 8 -Property - Position 100 40 - Type ItemDraw - Title {00} -Main - Case message of - SingleClic : - Begin - End -End - -Widget 9 -Property - Size 26 26 - Position 95 35 - Type Rectangle -Main - Case message of - SingleClic : - Begin - End -End - -Widget 10 -Property - Position 125 32 - Type MiniScroll - Value 15 - MaxValue 23 - MinValue 0 -Main - Case message of - SingleClic : - Begin - Set $NHour=(GetValue 10) - If $NHour<10 Then - Set $NHour=0 $NHour - ChangeTitle 8 $NHour - End -End - -Widget 11 -Property - Position 35 90 - Type ItemDraw - Title {Minutes:} -Main - Case message of - SingleClic : - Begin - End -End - -Widget 12 -Property - Position 100 90 - Type ItemDraw - Title {00} -Main - Case message of - SingleClic : - Begin - End -End - -Widget 13 -Property - Size 26 26 - Position 95 85 - Type Rectangle -Main - Case message of - SingleClic : - Begin - End -End - -Widget 14 -Property - Position 125 82 - Type MiniScroll - Value 15 - MaxValue 59 - MinValue 0 -Main - Case message of - SingleClic : - Begin - Set $NMinu=(GetValue 14) - If $NMinu<10 Then - Set $NMinu=0 $NMinu - ChangeTitle 12 $NMinu - End -End - -Widget 15 -Property - Size 340 110 - Position 10 155 - Type Rectangle -Main - Case message of - SingleClic : - Begin - End -End - -Widget 16 -Property - Position 15 147 - Type ItemDraw - Title {Date} -Main - Case message of - SingleClic : - Begin - End -End - -Widget 17 -Property - Position 30 180 - Type ItemDraw - Title {Day:} -Main - Case message of - SingleClic : - Begin - End -End - -Widget 18 -Property - Position 80 180 - Type ItemDraw - Title {00} -Main - Case message of - SingleClic : - Begin - End -End - -Widget 19 -Property - Size 26 26 - Position 75 175 - Type Rectangle -Main - Case message of - SingleClic : - Begin - End -End - -Widget 20 -Property - Position 105 172 - Type MiniScroll - Value 1 - MaxValue 1 - MinValue 1 -Main - Case message of - SingleClic : - Begin - Set $Day=(GetValue 20) - If $Day<10 Then - Set $Day=0 $Day - ChangeTitle 18 $Day - End -End - -Widget 21 -Property - Position 200 180 - Type ItemDraw - Title {Year:} -Main - Case message of - SingleClic : - Begin - End -End - -Widget 22 -Property - Position 250 180 - Type ItemDraw - Title {1996} -Main - Case message of - SingleClic : - Begin - End -End - -Widget 23 -Property - Size 41 26 - Position 245 175 - Type Rectangle -Main - Case message of - SingleClic : - Begin - End -End - -Widget 24 -Property - Position 290 172 - Type MiniScroll - Value 1996 - MaxValue 1999 - MinValue 1970 -Main - Case message of - SingleClic : - Begin - Set $Year=(GetValue 24) - ChangeTitle 22 $Year - Set $MaxDay=31 - Set $cmd={date --date '} $Month {/} $MaxDay {/} $Year {' +%d} - While (GetOutput $cmd 1 1)=={} Do - Begin - Set $MaxDay=(Add $MaxDay -1) - Set $cmd={date --date '} $Month {/} $MaxDay {/} $Year {' +%d} - End - ChangeMaxValue 20 $MaxDay - Set $Day=(GetValue 20) - If $Day<10 Then - Set $Day=0 $Day - ChangeTitle 18 $Day - End -End - -Widget 25 -Property - Position 30 225 - Type ItemDraw - Title {Month:} -Main - Case message of - SingleClic : - Begin - End -End - -Widget 26 -Property - Position 100 220 - Type PopupMenu - Title {January|February|March|April|May|June|July|August|September|October|November|December} -Main - Case message of - SingleClic : - Begin - Set $Month=(GetValue 26) - If $Month<10 Then - Set $Month=0 $Month - Set $MaxDay=31 - Set $cmd={date --date '} $Month {/} $MaxDay {/} $Year {' +%d} - While (GetOutput $cmd 1 1)=={} Do - Begin - Set $MaxDay=(Add $MaxDay -1) - Set $cmd={date --date '} $Month {/} $MaxDay {/} $Year {' +%d} - End - ChangeMaxValue 20 $MaxDay - Set $Day=(GetValue 20) - If $Day<10 Then - Set $Day=0 $Day - ChangeTitle 18 $Day - End -End - - - - - - diff --git a/app/fvwm/extras/FvwmScript/Scripts/DeskSetup b/app/fvwm/extras/FvwmScript/Scripts/DeskSetup deleted file mode 100644 index 826f073f0..000000000 --- a/app/fvwm/extras/FvwmScript/Scripts/DeskSetup +++ /dev/null @@ -1,429 +0,0 @@ -WindowTitle {Desktop} -WindowSize 360 400 # Taille -WindowPosition 191 50 # Position -ForeColor {black} -BackColor {grey85} -ShadowColor {grey55} -HilightColor {grey100} -Font -adobe-helvetica-bold-r-*-*-12-* - -Init - Begin - WarpPointer 1 - Set $RAISE=(GetOutput {cat ~/.fvwmrc} 6 -1) - If $RAISE=={KillModule FvwmAuto} Then - ChangeValue 6 0 - Else - ChangeValue 6 1 - - Set $FOCUS=(GetOutput {cat ~/.fvwmrc} 7 -1) - If $FOCUS=={ChangeDefaultFocus SloppyFocus} Then - ChangeValue 8 1 - If $FOCUS=={ChangeDefaultFocus ClickToFocus} Then - ChangeValue 8 2 - If $FOCUS=={ChangeDefaultFocus FocusFollowsMouse} Then - ChangeValue 8 3 - - Set $PAGE=(GetOutput {cat ~/.fvwmrc} 8 -1) - If $PAGE == {EdgeScroll 100 100} Then - ChangeValue 12 1 - If $PAGE == {EdgeScroll 0 0} Then - ChangeValue 12 2 - If $PAGE == {EdgeScroll 100 0} Then - ChangeValue 12 3 - If $PAGE == {EdgeScroll 0 100} Then - ChangeValue 12 4 - If $PAGE == {EdgeScroll 50 50} Then - ChangeValue 12 5 - If $PAGE == {EdgeScroll 100000 100000} Then - ChangeValue 12 6 - - Set $COLOR=(GetOutput {cat ~/.fvwmrc} 9 -1) - If $COLOR=={ColormapFocus FollowsMouse} Then - ChangeValue 10 1 - Else - ChangeValue 10 2 - - Set $NBROW=(GetOutput {cat ~/.fvwmrc} 11 3) - Set $NBCOL=(GetOutput {cat ~/.fvwmrc} 11 2) - ChangeTitle 21 $NBROW - ChangeTitle 20 $NBCOL - ChangeValue 19 $NBROW - ChangeValue 18 $NBCOL - - Set $OPAQ=(GetOutput {cat ~/.fvwmrc} 10 2) - ChangeValue 23 $OPAQ - ChangeTitle 25 $OPAQ - - End - -Widget 1 -Property - Size 50 30 - Position 100 340 - Type PushButton - Title {OK} -Main - Case message of - SingleClic : - Begin - Do $RAISE - WriteToFile .fvwmrc $RAISE - - Do $FOCUS - WriteToFile .fvwmrc $FOCUS - - Do $PAGE - WriteToFile .fvwmrc $PAGE - - Do $COLOR - WriteToFile .fvwmrc $COLOR - - Do {OpaqueMoveSize } (GetValue 23) - WriteToFile .fvwmrc {OpaqueMoveSize } (GetValue 23) - - Do {DeskTopSize } (GetValue 18) { } (GetValue 19) - WriteToFile .fvwmrc {DeskTopSize } (GetValue 18) { } (GetValue 19) - - Quit - End -End - -Widget 2 -Property - Size 50 30 - Position 190 340 - Type PushButton - Title {Apply} -Main - Case message of - SingleClic : - Begin - Do $RAISE - Do $FOCUS - Do $PAGE - Do $COLOR - Do {DeskTopSize } (GetValue 18) { } (GetValue 19) - Do {OpaqueMoveSize } (GetValue 23) - End -End - -Widget 3 -Property - Size 30 30 - Position 280 340 - Type PushButton - Title {Cancel} -Main - Case message of - SingleClic : - Begin - Quit - End -End - -Widget 4 -Property - Size 340 310 - Position 10 10 - Type Rectangle -Main - Case message of - SingleClic : - Begin - End -End - -Widget 5 -Property - Position 30 40 - Type ItemDraw - Title {Auto raise:} -Main - Case message of - SingleClic : - Begin - End -End - - -Widget 6 -Property - Position 110 40 - Type CheckBox - Title {On} -Main - Case message of - SingleClic : - Begin - If (GetValue 6) == 1 Then - Set $RAISE={Module FvwmAuto 2000 Raise Nop} - Else - Set $RAISE={KillModule FvwmAuto} - End -End - -Widget 7 -Property - Position 30 75 - Type ItemDraw - Title {Focus:} -Main - Case message of - SingleClic : - Begin - End -End - -Widget 8 -Property - Position 110 70 - Type PopupMenu - Title {Sloppy Focus|Click To Focus|Focus Follows Mouse} -Main - Case message of - SingleClic : - Begin - If (GetValue 8) == 1 Then - Set $FOCUS={ChangeDefaultFocus SloppyFocus} - If (GetValue 8) == 2 Then - Set $FOCUS={ChangeDefaultFocus ClickToFocus} - If (GetValue 8) == 3 Then - Set $FOCUS={ChangeDefaultFocus FocusFollowsMouse} - End -End - -Widget 11 -Property - Position 30 155 - Type ItemDraw - Title {Paging:} -Main - Case message of - SingleClic : - Begin - End -End - -Widget 12 -Property - Position 110 150 - Type PopupMenu - Title {Full Paging ON|All Paging OFF|Horizontal Paging Only|Vertical Paging Only|Partial Paging|Full Paging && Edge Wrap} -Main - Case message of - SingleClic : - Begin - If (GetValue 12) == 1 Then - Set $PAGE={EdgeScroll 100 100} - If (GetValue 12) == 2 Then - Set $PAGE={EdgeScroll 0 0} - If (GetValue 12) == 3 Then - Set $PAGE={EdgeScroll 100 0} - If (GetValue 12) == 4 Then - Set $PAGE={EdgeScroll 0 100} - If (GetValue 12) == 5 Then - Set $PAGE={EdgeScroll 50 50} - If (GetValue 12) == 6 Then - Set $PAGE={EdgeScroll 100000 100000} - End -End - -Widget 9 -Property - Position 30 115 - Type ItemDraw - Title {Colormap:} -Main - Case message of - SingleClic : - Begin - End -End - -Widget 10 -Property - Position 110 110 - Type PopupMenu - Title {Colormap Follows Mouse|Colormap Follows Focus} -Main - Case message of - SingleClic : - Begin - If (GetValue 10) == 1 Then - Set $COLOR={ColormapFocus FollowsMouse} - Else - Set $COLOR={ColormapFocus FollowsFocus} - End -End - -Widget 13 -Property - Position 30 210 - Type ItemDraw - Title {Desktop size} -Main - Case message of - SingleClic : - Begin - End -End - -Widget 14 -Property - Position 120 195 - Type ItemDraw - Title {Nb of column:} -Main - Case message of - SingleClic : - Begin - End -End - -Widget 15 -Property - Position 139 228 - Type ItemDraw - Title {Nb of row:} -Main - Case message of - SingleClic : - Begin - End -End - -Widget 16 -Property - Size 25 25 - Position 210 190 - Type Rectangle -Main - Case message of - SingleClic : - Begin - End -End - -Widget 17 -Property - Size 25 25 - Position 210 225 - Type Rectangle -Main - Case message of - SingleClic : - Begin - End -End - -Widget 18 -Property - Size 25 25 - Position 240 187 - Value 1 - MaxValue 9 - MinValue 1 - Type MiniScroll -Main - Case message of - SingleClic : - Begin - ChangeTitle 20 (GetValue 18) - End -End - -Widget 19 -Property - Size 25 25 - Position 240 222 - Type MiniScroll - Value 1 - MaxValue 9 - MinValue 1 -Main - Case message of - SingleClic : - Begin - ChangeTitle 21 (GetValue 19) - End -End - -Widget 20 -Property - Position 218 195 - Type ItemDraw - Title {4} -Main - Case message of - SingleClic : - Begin - End -End - -Widget 21 -Property - Position 218 228 - Type ItemDraw - Title {2} -Main - Case message of - SingleClic : - Begin - End -End - -Widget 22 -Property - Size 35 25 - Position 200 272 - Type Rectangle -Main - Case message of - SingleClic : - Begin - End -End - -Widget 23 -Property - Size 25 25 - Position 240 268 - Value 100 - MaxValue 100 - MinValue 0 - Type MiniScroll -Main - Case message of - SingleClic : - Begin - ChangeTitle 25 (GetValue 23) - End -End - -Widget 24 -Property - Size 25 25 - Position 30 277 - Type ItemDraw - Title {Opaque move size (%):} -Main - Case message of - SingleClic : - Begin - End -End - -Widget 25 -Property - Position 206 277 - Type ItemDraw - Title {100} -Main - Case message of - SingleClic : - Begin - End -End - - diff --git a/app/fvwm/extras/FvwmScript/Scripts/FileBrowser b/app/fvwm/extras/FvwmScript/Scripts/FileBrowser deleted file mode 100644 index d4a21d7c7..000000000 --- a/app/fvwm/extras/FvwmScript/Scripts/FileBrowser +++ /dev/null @@ -1,258 +0,0 @@ -WindowTitle {File Browser} -WindowSize 360 340 # Taille -WindowPosition 191 50 # Position -ForeColor {black} -BackColor {grey85} -ShadowColor {grey55} -HilightColor {grey100} -Font -adobe-helvetica-bold-r-*-*-12-* - -Init - Begin - Set $PWD=(GetScriptArgument 1) - Set $POS=50 - Set $LOOP=1 - While $LOOP==1 Do - Begin - If (StrCopy $PWD $POS $POS)=={/} Then - Set $LOOP=0 - If $POS==0 Then - Set $LOOP=0 - Set $POS=(Add $POS -1) - End - Set $PWD=(StrCopy $PWD 1 $POS) - Set $CMD2={bash -c "cd;cd } $PWD {; pwd"} - Set $PWD=(GetOutput $CMD2 0 0) - Do {Exec echo } $PWD - Set $OPT={ } - Set $CMD={bash -c "cd } $PWD {; ls} $OPT {-1 -F"} - Set $LS=(GetOutput $CMD 1 -1) - Set $ID=2 - While (GetOutput $CMD $ID -1) <> {} Do - Begin - Set $LS=$LS {|} (GetOutput $CMD $ID -1) - Set $ID=(Add $ID 1) - End - ChangeTitle 7 $LS - ChangeTitle 5 $PWD - ChangeTitle 9 {} - End - -Widget 1 -Property - Size 50 30 - Position 190 300 - Type PushButton - Title {OK} -Main - Case message of - SingleClic : - Begin - SendToScript (GetScriptFather) $PWD {/} (GetTitle 9) - Quit - End -End - -Widget 2 -Property - Size 50 30 - Position 280 300 - Type PushButton - Title {Cancel} -Main - Case message of - SingleClic : - Begin - Quit - End -End - -Widget 3 -Property - Position 10 10 - Size 340 280 - Type Rectangle -Main - Case message of - SingleClic : - Begin - End -End - -Widget 4 -Property - Position 20 42 - Type ItemDraw - Title {Path:} -Main - Case message of - SingleClic : - Begin - End -End - -Widget 5 -Property - Position 65 42 - Size 270 0 - Type ItemDraw - Title {*} -Main - Case message of - SingleClic : - Begin - End -End - -Widget 10 -Property - Position 60 40 - Size 279 20 - Type Rectangle -Main - Case message of - SingleClic : - Begin - End -End - - -Widget 6 -Property - Position 21 67 - Size 50 18 - Icon up.xpm - Type PushButton -Main - Case message of - SingleClic : - Begin - Set $CMD={bash -c "cd } $PWD {/..; pwd"} - Set $PWD=(GetOutput $CMD 0 0) - Set $CMD={bash -c "cd } $PWD {; ls} $OPT {-1 -F"} - Set $LS=(GetOutput $CMD 1 -1) - Set $ID=2 - While (GetOutput $CMD $ID -1) <> {} Do - Begin - Set $LS=$LS {|} (GetOutput $CMD $ID -1) - Set $ID=(Add $ID 1) - End - ChangeTitle 7 $LS - ChangeTitle 5 $PWD - ChangeTitle 9 {} - End -End - -Widget 11 -Property - Position 91 67 - Size 50 18 - Icon home.xpm - Type PushButton -Main - Case message of - SingleClic : - Begin - Set $PWD={~} - Set $CMD={bash -c "cd } $PWD {; ls} $OPT {-1 -F"} - Set $LS=(GetOutput $CMD 1 -1) - Set $ID=2 - While (GetOutput $CMD $ID -1) <> {} Do - Begin - Set $LS=$LS {|} (GetOutput $CMD $ID -1) - Set $ID=(Add $ID 1) - End - ChangeTitle 7 $LS - ChangeTitle 5 $PWD - ChangeTitle 9 {} - End -End - -Widget 12 -Property - Position 180 72 - Type CheckBox - Title { Show hidden files} -Main - Case message of - SingleClic : - Begin - If (GetValue 12) == 1 Then - Set $OPT={ -A } - Else - Set $OPT={ } - Set $CMD={bash -c "cd } $PWD {; ls} $OPT {-1 -F"} - Set $LS=(GetOutput $CMD 1 -1) - Set $ID=2 - While (GetOutput $CMD $ID -1) <> {} Do - Begin - Set $LS=$LS {|} (GetOutput $CMD $ID -1) - Set $ID=(Add $ID 1) - End - ChangeTitle 7 $LS - ChangeTitle 5 $PWD - ChangeTitle 9 {} - End -End - -Widget 7 -Property - Position 20 100 - Size 320 115 - Type List - Title {} -Main - Case message of - SingleClic : - Begin - Set $CMD3={bash -c "cd } $PWD {; ls} $OPT {-1"} - Set $PWD2=$PWD {/} (GetOutput $CMD3 (GetValue 7) -1) - Set $CMD2={bash -c "cd } $PWD {;cd } $PWD2 {; pwd"} - Set $PWD2=(GetOutput $CMD2 0 0) - If $PWD2 <> $PWD Then - Begin - Set $PWD = $PWD2 - Set $CMD={bash -c "cd } $PWD {; ls} $OPT {-1 -F"} - Set $LS=(GetOutput $CMD 1 -1) - Set $ID=2 - While (GetOutput $CMD $ID -1) <> {} Do - Begin - Set $LS=$LS {|} (GetOutput $CMD $ID -1) - Set $ID=(Add $ID 1) - End - ChangeTitle 7 $LS - ChangeTitle 5 $PWD - ChangeTitle 9 {} - End - Else - Begin - ChangeTitle 9 (GetOutput $CMD3 (GetValue 7) -1) - End - End -End - -Widget 8 -Property - Position 20 220 - Type ItemDraw - Title {Selected file:} -Main - Case message of - SingleClic : - Begin - End -End - -Widget 9 -Property - Position 20 240 - Size 320 20 - Type TextField - Title {} -Main - Case message of - SingleClic : - Begin - End -End - diff --git a/app/fvwm/extras/FvwmScript/Scripts/KeyboardSetup b/app/fvwm/extras/FvwmScript/Scripts/KeyboardSetup deleted file mode 100644 index e9d62bb7d..000000000 --- a/app/fvwm/extras/FvwmScript/Scripts/KeyboardSetup +++ /dev/null @@ -1,172 +0,0 @@ -WindowTitle {Keyboard} -WindowSize 360 250 # Taille -WindowPosition 191 50 # Position -ForeColor {black} -BackColor {grey85} -ShadowColor {grey55} -HilightColor {grey100} -Font -adobe-helvetica-bold-r-*-*-12-* - -Init - Begin - WarpPointer 2 - ChangeValue 4 (GetOutput {xset -q} 2 7) - If (GetOutput {xset -q } 2 3)==on Then - ChangeValue 6 1 - End - -Widget 1 -Property - Size 50 30 - Position 100 200 - Type PushButton - Title {Apply} -Main - Case message of - SingleClic : - Begin - Do {Exec xset c } (GetValue 4) - If (GetValue 6) == 1 Then - Do {Exec xset r on} - Else - Do {Exec xset r off} - End -End - -Widget 2 -Property - Size 50 30 - Position 190 200 - Type PushButton - Title {OK} -Main - Case message of - SingleClic : - Begin - Do {Exec xset c } (GetValue 4) - If (GetValue 6) == 1 Then - Begin - Do {Exec xset r on} - WriteToFile .xinitrc-fvwm {xset r on c } (GetValue 4) - End - Else - Begin - Do {Exec xset r off} - WriteToFile .xinitrc-fvwm {xset r off c } (GetValue 4) - End - Quit - End -End - -Widget 3 -Property - Size 50 30 - Position 280 200 - Type PushButton - Title {Cancel} -Main - Case message of - SingleClic : - Begin - Quit - End -End - -Widget 4 -Property - Size 300 1 - Position 30 120 - Type HScrollBar - MinValue 0 - MaxValue 100 - Value 0 -Main - Case message of - SingleClic : - Begin - End -End - -Widget 5 -Property - Position 130 100 - Type ItemDraw - Title {Click Volume (%)} -Main - Case message of - SingleClic : - Begin - End -End - -Widget 6 -Property - Position 30 40 - Type CheckBox - Title {On} -Main - Case message of - SingleClic : - Begin - End -End - -Widget 7 -Property - Position 250 35 - Type PopupMenu - Title {English|French|German|Italian} -Main - Case message of - SingleClic : - Begin - End -End - -Widget 8 -Property - Position 170 40 - Type ItemDraw - Title {Nationnality:} -Main - Case message of - SingleClic : - Begin - End -End - -Widget 10 -Property - Size 340 180 - Position 10 10 - Type Rectangle -Main - Case message of - SingleClic : - Begin - End -End - -Widget 11 -Property - Position 15 3 - Type ItemDraw - Title {Keyboard} -Main - Case message of - SingleClic : - Begin - End -End - - - - - - - - - - - - diff --git a/app/fvwm/extras/FvwmScript/Scripts/PointerSetup b/app/fvwm/extras/FvwmScript/Scripts/PointerSetup deleted file mode 100644 index d234ebbe9..000000000 --- a/app/fvwm/extras/FvwmScript/Scripts/PointerSetup +++ /dev/null @@ -1,191 +0,0 @@ -WindowTitle {Pointer} -WindowSize 320 290 # Taille -WindowPosition 191 50 # Position -ForeColor {black} -BackColor {grey85} -ShadowColor {grey55} -HilightColor {grey100} -Font -adobe-helvetica-bold-r-*-*-12-* - -Init - Begin - WarpPointer 2 - Set $tmp=(GetOutput {xset -q} 9 2) - Set $pos=1 - While (StrCopy $tmp $pos $pos)<>{/} Do - Set $pos=(Add $pos 1) - Set $pos=(Add $pos -1) - - ChangeValue 6 (Div (Mult (StrCopy $tmp 1 $pos) 20) (StrCopy $tmp (Add $pos 2) 256)) - ChangeTitle 8 (GetOutput {xset -q} 9 4) - End - -Widget 1 -Property - Size 50 30 - Position 70 230 - Type PushButton - Title {Apply} -Main - Case message of - SingleClic : - Begin - Do {Exec xset m } (GetValue 6) {/20 } (GetTitle 8) - If (GetValue 4) == 1 Then - Do {Exec xmodmap -e "pointer = 1 2 3"} - Else - Do {Exec xmodmap -e "pointer = 3 2 1"} - End -End - -Widget 2 -Property - Size 50 30 - Position 160 230 - Type PushButton - Title {OK} -Main - Case message of - SingleClic : - Begin - Do {Exec xset m } (GetValue 6) {/20 } (GetTitle 8) - WriteToFile .xinitrc-fvwm {xset m } (GetValue 6) {/20 } (GetTitle 8) - If (GetValue 4) == 1 Then - Begin - Do {Exec xmodmap -e "pointer = 1 2 3"} - WriteToFile .xinitrc-fvwm {xmodmap -e "pointer = 1 2 3"} - End - Else - Begin - Do {Exec xmodmap -e "pointer = 3 2 1"} - WriteToFile .xinitrc-fvwm {xmodmap -e "pointer = 3 2 1"} - End - Quit - End -End - -Widget 3 -Property - Size 50 30 - Position 250 230 - Type PushButton - Title {Cancel} -Main - Case message of - SingleClic : - Begin - Quit - End -End - -Widget 4 -Property - Position 150 140 - Type PopupMenu - Title {Right-handed user|Left-handed user} - Value 1 -Main - Case message of - SingleClic : - Begin - End -End - -Widget 5 -Property - Position 20 145 - Type ItemDraw - Title {Mouse configuration:} -Main - Case message of - SingleClic : - Begin - End -End - -Widget 6 -Property - Size 188 1 - Position 110 25 - MinValue 5 - MaxValue 100 - Type HScrollBar -Main - Case message of - SingleClic : - Begin - End -End - -Widget 7 -Property - Position 20 45 - Type ItemDraw - Title {Acceleration:} -Main - Case message of - SingleClic : - Begin - End -End - -Widget 8 -Property - Size 60 1 - Position 150 90 - Type TextField -Main - Case message of - SingleClic : - Begin - End -End - -Widget 9 -Property - Size 110 1 - Position 20 95 - Type ItemDraw - Title {Threshold (pixels):} -Main - Case message of - SingleClic : - Begin - End -End - -Widget 10 -Property - Size 300 190 - Position 10 10 - Type Rectangle -Main - Case message of - SingleClic : - Begin - End -End - -Widget 11 -Property - Position 15 3 - Type ItemDraw - Title {Pointer} -Main - Case message of - SingleClic : - Begin - End -End - - - - - - - - - - - - diff --git a/app/fvwm/extras/FvwmScript/Scripts/Quit b/app/fvwm/extras/FvwmScript/Scripts/Quit deleted file mode 100644 index e2fbc32cd..000000000 --- a/app/fvwm/extras/FvwmScript/Scripts/Quit +++ /dev/null @@ -1,164 +0,0 @@ -WindowTitle {Logout} -WindowSize 400 250 # Taille -WindowPosition 191 143 # Position -ForeColor {black} -BackColor {grey85} -ShadowColor {grey55} -HilightColor {grey100} -Font -adobe-helvetica-bold-r-*-*-12-* - -Init - Begin - Do {Exec sync &} - WarpPointer 1 - Do {Exec cat /usr/X11R6/lib/TkDesk/sounds/metal.voc > /dev/dsp &} - Set $ToDo = Restart - End - -Widget 8 -Property - Position 40 40 - Type ItemDraw - Icon shutdown.xpm -Main - Case message of - SingleClic : - Begin - End -End - -Widget 7 -Property - Size 370 220 - Position 15 15 - Type Rectangle -Main - Case message of - SingleClic : - Begin - End -End - -Widget 6 -Property - Title {Are you sure to:} - Position 100 50 - Type ItemDraw - Value 0 - Font -adobe-helvetica-bold-r-*-*-12-* -Main - Case message of - SingleClic : - Begin - End -End - -Widget 1 -Property - Title {OK} - Size 60 28 - Position 280 190 - Type PushButton - Value 1 -Main - Case message of - SingleClic : - Begin - If $ToDo == Logout Then - Do {Quit} - Else - Begin - If $ToDo == Restart Then - Begin - Do {Exec sync} - Do {Exec xterm -geometry 80x12+150+130 -bg grey85 -fg red -cr red -e pauseme /sbin/shutdown -r -f now} - Quit - End - Else - Begin - Do {Exec sync} - Do {Exec xterm -geometry 80x12+150+130 -bg grey85 -fg red -cr red -e pauseme /sbin/shutdown -h -f now} - Quit - End - End - End -End - -Widget 2 -Property - Title {Cancel} - Size 60 28 - Position 190 190 - Type PushButton - Value 1 -Main - Case message of - SingleClic : - Begin - Quit - End -End - -Widget 3 -Property - Title {Shut down the computer} - Position 110 90 - Type RadioButton - Value 0 -Main - Case message of - SingleClic : - Begin - ChangeValue 4 0 - ChangeValue 5 0 - Set $ToDo = Halt - End -End - -Widget 4 -Property - Title {Restart the computer} - Position 110 120 - Type RadioButton - Value 1 -Main - Case message of - SingleClic : - Begin - ChangeValue 3 0 - ChangeValue 5 0 - Set $ToDo = Restart - End -End - -Widget 5 -Property - Title {Logout} - Position 110 150 - Type RadioButton - Value 0 -Main - Case message of - SingleClic : - Begin - ChangeValue 3 0 - ChangeValue 4 0 - Set $ToDo = Logout - End -End - - - - - - - - - - - - - - - - diff --git a/app/fvwm/extras/FvwmScript/Scripts/README b/app/fvwm/extras/FvwmScript/Scripts/README deleted file mode 100644 index cdaa87158..000000000 --- a/app/fvwm/extras/FvwmScript/Scripts/README +++ /dev/null @@ -1,28 +0,0 @@ -The directory ./Examples contains some examples of what can we do with -FvwmScript: - - - BellSetup: desk accessory to modify bell. This script -requires xsetup. - - Buttons: buttons panel wich can replace FvwmButtons. -This script support popup menu and requires xload, xclock, -FvwmPager, TkDesk and some icons wich are located in ./some_nice_icons. - - Date: desk accessory to setup date and time, requires -xclock and date. - - KeyboardSetup: desk accessory to setup keyboard, requires -xsetup. - - Quit: scritp to confirm "Logout" or "Restart computer" - - ScreenSetup: desk accessory to customize background display -and screen saver. - - fvwmrc: my preferred fvwm config wich use all the six scripts. - - -N.B. BellSetup, KeyBoardSetup and ScreenSetup save preferences to -~/.xinit-fvwmrc. If you want to load these preferences at every startup, -you have to include the line ".xinit-fvwmrc" in your .xinitrc before -the line "fvwm". - -I hope that FvwmScript will interest you. In any case, please send me a short email and -tell me what you think about FvwmScript. - -Frederic Cordier -e-mail f-cord96@bat710.univ-lyon1.fr
\ No newline at end of file diff --git a/app/fvwm/extras/FvwmScript/Scripts/ScreenDump b/app/fvwm/extras/FvwmScript/Scripts/ScreenDump deleted file mode 100644 index a3155b6a3..000000000 --- a/app/fvwm/extras/FvwmScript/Scripts/ScreenDump +++ /dev/null @@ -1,279 +0,0 @@ -WindowTitle {Screen Grabber} -WindowSize 360 360 # Taille -WindowPosition 191 50 # Position -ForeColor {black} -BackColor {grey85} -ShadowColor {grey55} -HilightColor {grey100} -Font -adobe-helvetica-bold-r-*-*-12-* - -Init - Begin - WarpPointer 1 - Set $Ext = {.gif} - Set $Format = {| ppmtogif} - End - -Widget 1 -Property - Size 50 30 - Position 190 320 - Type PushButton - Title {OK} -Main - Case message of - SingleClic : - Begin - If (GetValue 5)==1 Then - Do {Exec xwd } $Opt1 { } $Opt2 { | xwdtopnm } $Format { > } (GetTitle 7) $Ext - Else - Do {Exec xwd } $Opt1 { } $Opt2 { | xwdtopnm | ppmtopgm | pnmtops | } (GetTitle 11) - Quit - End -End - -Widget 2 -Property - Size 50 30 - Position 280 320 - Type PushButton - Title {Cancel} -Main - Case message of - SingleClic : - Begin - Do {Exec xset s } $TimeOut - Quit - End -End - -Widget 3 -Property - Size 340 170 - Position 10 10 - Type Rectangle -Main - Case message of - SingleClic : - Begin - End -End - -Widget 4 -Property - Position 15 2 - Type ItemDraw - Title {Dump to:} -Main - Case message of - SingleClic : - Begin - End -End - -Widget 5 -Property - Size 50 30 - Position 30 30 - Type RadioButton - Title {File} - Value 1 -Main - Case message of - SingleClic : - Begin - ChangeValue 6 0 - End -End - -Widget 6 -Property - Size 50 30 - Position 30 110 - Type RadioButton - Title {Printer} - Value 0 -Main - Case message of - SingleClic : - Begin - ChangeValue 5 0 - End -End - -Widget 7 -Property - Size 250 30 - Position 75 27 - Type TextField - Title {~/picture} - Value 200 -Main - Case message of - SingleClic : - Begin - End -End - -Widget 8 -Property - Position 74 65 - Type ItemDraw - Title {Format} - Value 1 -Main - Case message of - SingleClic : - Begin - End -End - -Widget 9 -Property - Position 130 60 - Type PopupMenu - Title {GIF|PostScript|Tiff|X11 Pixmap|Pgm|Bmp|Sun rasterfile} - Value 1 -Main - Case message of - SingleClic : - Begin - If (GetValue 9)==1 Then - Begin - Set $Ext = {.gif} - Set $Format = {| ppmtogif} - End - Else - Begin - If (GetValue 9)==2 Then - Begin - Set $Ext = {.ps} - Set $Format = {| pnmtops} - End - Else - Begin - If (GetValue 9)==3 Then - Begin - Set $Ext = {.tif} - Set $Format = {| pnmtotiff} - End - Else - Begin - If (GetValue 9)==4 Then - Begin - Set $Ext = {.xpm} - Set $Format = {| ppmtoxpm} - End - Else - Begin - If (GetValue 9)==5 Then - Begin - Set $Ext = {.pgm} - Set $Format = { } - End - Else - Begin - If (GetValue 9)==6 Then - Begin - Set $Ext = {.bmp} - Set $Format = {| ppmtobmp} - End - Else - Begin - Set $Ext = {.ras} - Set $Format = {| pnmtorast} - End - End - End - End - End - End - End -End - -Widget 10 -Property - Position 74 138 - Type ItemDraw - Title {Command line} - Value 1 -Main - Case message of - SingleClic : - Begin - End -End - - -Widget 11 -Property - Size 150 30 - Position 175 135 - Type TextField - Title {lpr} - Value 200 -Main - Case message of - SingleClic : - Begin - End -End - -Widget 12 -Property - Size 340 100 - Position 10 200 - Type Rectangle -Main - Case message of - SingleClic : - Begin - End -End - -Widget 13 -Property - Position 15 192 - Type ItemDraw - Title {Options:} -Main - Case message of - SingleClic : - Begin - End -End - -Widget 14 -Property - Position 30 220 - Type CheckBox - Title {Include frame} -Main - Case message of - SingleClic : - Begin - If (GetValue 14)==1 Then - Set $Opt1 = {-frame} - Else - Set $Opt1 = { } - End -End - -Widget 15 -Property - Position 30 260 - Type CheckBox - Title {Select the root window} -Main - Case message of - SingleClic : - Begin - If (GetValue 15)==1 Then - Set $Opt2 = {-root} - Else - Set $Opt2 = { } - End -End - - - diff --git a/app/fvwm/extras/FvwmScript/Scripts/ScreenSetup b/app/fvwm/extras/FvwmScript/Scripts/ScreenSetup deleted file mode 100644 index 128b2a156..000000000 --- a/app/fvwm/extras/FvwmScript/Scripts/ScreenSetup +++ /dev/null @@ -1,437 +0,0 @@ -WindowTitle {Screen} -WindowSize 430 530 # Taille -WindowPosition 191 15 # Position -ForeColor {black} -BackColor {grey85} -ShadowColor {grey55} -HilightColor {grey100} -Font -adobe-helvetica-bold-r-*-*-12-* - -Init - Begin - WarpPointer 2 - If (GetOutput {xset -q} 11 3) == yes Then - ChangeValue 10 1 - Else - ChangeValue 11 1 - ChangeTitle 14 (GetOutput {xset -q} 12 2) - ChangeTitle 15 (GetOutput {xset -q} 12 4) - Set $BColor=(StrCopy (GetOutput {cat ~/.xinitrc-fvwm} 15 3) 2 8) - Do {Exec echo } (StrCopy (GetOutput {cat ~/.xinitrc-fvwm} 15 3) 2 8) {>/dev/console} - If (StrCopy $BColor 1 1)<>{#} Then - Begin - Set $BColor={#0EC4B8} - ChangeTitle 7 (GetOutput {cat ~/.xinitrc-fvwm} 15 2) - ChangeIcon 8 (GetTitle 7) - ChangeValue 4 0 - ChangeValue 5 1 - End - ChangeBackColor 6 $BColor - ChangeValue 20 (HexToNum (StrCopy $BColor 2 3)) - ChangeValue 21 (HexToNum (StrCopy $BColor 4 5)) - ChangeValue 22 (HexToNum (StrCopy $BColor 6 7)) - End - -PeriodicTasks - Begin - Set $MSG=(ReceivFromScript $BROWSER) - If $MSG <> {No message} Then - Begin - ChangeTitle 7 $MSG - ChangeIcon 8 $MSG - End - End - -Widget 1 -Property - Size 50 30 - Position 100 480 - Type PushButton - Title {Apply} -Main - Case message of - SingleClic : - Begin - Do {Exec xset s } (GetTitle 14) { } (GetTitle 15) - If (GetValue 10)==1 Then - Do {Exec xset s blank} - Else - Do {Exec xset s noblank} - If (GetValue 5) == 1 Then - Do {Exec xpmroot } (GetTitle 7) - Else - Do {Exec xsetroot -solid "} $BColor {"} - End -End - -Widget 2 -Property - Size 50 30 - Position 190 480 - Type PushButton - Title {OK} -Main - Case message of - SingleClic : - Begin - If (GetValue 10)==1 Then - Set $tmp2 = { s blank} - Else - Set $tmp2 = { s noblank} - Do {Exec xset s } (GetTitle 14) { } (GetTitle 15) $tmp2 - WriteToFile .xinitrc-fvwm {Exec xset s } (GetTitle 14) { } (GetTitle 15) $tmp2 - If (GetValue 5) == 1 Then - Begin - Do {Exec xpmroot } (GetTitle 7) - WriteToFile .xinitrc-fvwm {xpmroot } (GetTitle 7) - End - Else - Begin - Do {Exec xsetroot -solid "} $BColor {"} - WriteToFile .xinitrc-fvwm {xsetroot -solid "} $BColor {"} - End - WriteToFile .xinitrc-fvwm {xset s } (GetTitle 14) { } (GetTitle 15) $tmp2 - Quit - End -End - -Widget 3 -Property - Size 50 30 - Position 280 480 - Type PushButton - Title {Cancel} -Main - Case message of - SingleClic : - Begin - Quit - End -End - -Widget 4 -Property - Position 30 30 - Type RadioButton - Title {Uniform colour:} - Value 1 -Main - Case message of - SingleClic : - Begin - ChangeValue 5 0 - End -End - -Widget 5 -Property - Position 30 240 - Type RadioButton - Title {Pixmap:} - Value 0 -Main - Case message of - SingleClic : - Begin - ChangeValue 4 0 - End -End - -Widget 6 -Property - Size 50 50 - Position 60 80 - Type ItemDraw - BackColor {#0EC4B8} -Main - Case message of - SingleClic : - Begin - End -End - -Widget 23 -Property - Size 60 60 - Position 55 75 - Type Rectangle -Main - Case message of - SingleClic : - Begin - End -End - -Widget 24 -Property - Size 50 50 - Position 58 140 - Type ItemDraw - Title {#0EC4B8} -Main - Case message of - SingleClic : - Begin - End -End - -Widget 20 -Property - Size 250 1 - Position 155 20 - Type HScrollBar - Value 14 - MinValue 0 - MaxValue 255 -Main - Case message of - SingleClic : - Begin - Set $BColor = {#} (NumToHex (GetValue 20) 2) (NumToHex (GetValue 21) 2) (NumToHex (GetValue 22) 2) - ChangeTitle 24 $BColor - ChangeBackColor 6 $BColor - End -End - -Widget 21 -Property - Size 250 1 - Position 155 75 - Type HScrollBar - Value 196 - MinValue 0 - MaxValue 255 -Main - Case message of - SingleClic : - Begin - Set $BColor = {#} (NumToHex (GetValue 20) 2) (NumToHex (GetValue 21) 2) (NumToHex (GetValue 22) 2) - ChangeTitle 24 $BColor - ChangeBackColor 6 $BColor - End -End - -Widget 22 -Property - Size 250 1 - Position 155 130 - Type HScrollBar - Value 184 - MinValue 0 - MaxValue 255 -Main - Case message of - SingleClic : - Begin - Set $BColor = {#} (NumToHex (GetValue 20) 2) (NumToHex (GetValue 21) 2) (NumToHex (GetValue 22) 2) - ChangeTitle 24 $BColor - ChangeBackColor 6 $BColor - End -End - -Widget 7 -Property - Size 280 30 - Position 30 300 - Type TextField - Title {/usr/X11/include/X11/pixmaps/fvwm2.xpm} - Value 200 -Main - Case message of - SingleClic : - Begin - ChangeIcon 8 (GetTitle 7) - End -End - -Widget 25 -Property - Position 327 299 - Type PushButton - Title {Browser...} -Main - Case message of - SingleClic : - Begin - Set $ARG={FileBrowser } (GetTitle 7) { Hello word} - Set $BROWSER=(LaunchScript $ARG ) - End -End - -Widget 8 -Property - Size 175 75 - Position 120 215 - Type ItemDraw - Icon /usr/X11/include/X11/pixmaps/fvwm2.xpm -Main - Case message of - SingleClic : - Begin - End -End - -Widget 9 -Property - Size 179 79 - Position 118 213 - Type Rectangle -Main - Case message of - SingleClic : - Begin - End -End - -Widget 10 -Property - Position 50 380 - Type RadioButton - Title {Blank} -Main - Case message of - SingleClic : - Begin - ChangeValue 11 0 - End -End - -Widget 11 -Property - Position 50 425 - Type RadioButton - Title {Pattern} -Main - Case message of - SingleClic : - Begin - ChangeValue 10 0 - End -End - -Widget 12 -Property - Position 230 380 - Type ItemDraw - Title {Timeout(s):} -Main - Case message of - SingleClic : - Begin - End -End - -Widget 13 -Property - Position 230 425 - Type ItemDraw - Title {Cycle(s):} -Main - Case message of - SingleClic : - Begin - ChangeValue 10 0 - End -End - -Widget 14 -Property - Size 80 79 - Position 310 375 - Type TextField -Main - Case message of - SingleClic : - Begin - End -End - -Widget 15 -Property - Size 80 79 - Position 310 420 - Type TextField -Main - Case message of - SingleClic : - Begin - ChangeValue 10 0 - End -End - -Widget 16 -Property - Size 410 330 - Position 10 13 - Type Rectangle -Main - Case message of - SingleClic : - Begin - End -End - - -Widget 17 -Property - Size 410 105 - Position 10 355 - Type Rectangle -Main - Case message of - SingleClic : - Begin - End -End - -Widget 18 -Property - Position 15 5 - Type ItemDraw - Title {Background} -Main - Case message of - SingleClic : - Begin - End -End - - -Widget 19 -Property - Position 15 347 - Type ItemDraw - Title {Screen-saver} -Main - Case message of - SingleClic : - Begin - End -End - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/app/fvwm/extras/FvwmScript/Scripts/some_nice_icons/bell.xpm b/app/fvwm/extras/FvwmScript/Scripts/some_nice_icons/bell.xpm deleted file mode 100644 index fe878841b..000000000 --- a/app/fvwm/extras/FvwmScript/Scripts/some_nice_icons/bell.xpm +++ /dev/null @@ -1,57 +0,0 @@ -/* XPM */ -static char * a_xpm[] = { -"56 46 8 1", -" c None", -". c #FFFFFFFFFFFF", -"X c #000000000000", -"o c #000008080808", -"O c #52525555FFFF", -"+ c #7B7B86869C9C", -"@ c #737379798484", -"# c #949496969494", -" ", -" ", -" ", -" ", -" ", -" ", -" ", -" ", -" ", -" ", -" .. ", -" ..XX. ", -" ..XX.X. ", -" ..XX...X. ", -" .XX.. .X. ", -" .X.. .X. ", -" .X. .X. oXXXXXoX ", -" .X. .X. XX. . . XX ", -" .X. ...X. oX........XX ", -" .X. .XXXX. X...XXXX.. X ", -" .X. .X..OX. XX..XXXXXX..X ", -" .X. .X.OOX. X .XX ++XX . ", -" .X. .XOOOX. X .X . @XX ", -" ...X. .XXX. X .X... XX ", -" .XXXX. ... X ...XXXX ", -" .X..OX. X ..X ... ", -" .X.OOX. X ..X#... ", -" .XOOOX. X ..X+ .. ", -" .XXX. X+ ..X+ + ", -" ... XXXXXXX X+ ..X+@XX ", -" ....... XX+ ..XXX.. ", -" XX+ ...... ", -" XXXXXXXXXXX XX+ .... ", -" ........... XX+ +X ", -" XX+@+@X ", -" XXXXXXXXXXXX XXXXX ", -" ............ ", -" ", -" ", -" ", -" ", -" ", -" ", -" ", -" ", -" "}; diff --git a/app/fvwm/extras/FvwmScript/Scripts/some_nice_icons/date.xpm b/app/fvwm/extras/FvwmScript/Scripts/some_nice_icons/date.xpm deleted file mode 100644 index 4fb905495..000000000 --- a/app/fvwm/extras/FvwmScript/Scripts/some_nice_icons/date.xpm +++ /dev/null @@ -1,61 +0,0 @@ -/* XPM */ -static char * date_xpm[] = { -"56 46 12 1", -" c None", -". c #FFFFFFFFFFFF", -"X c #8C8C8E8E8C8C", -"o c #DEDEDBDBDEDE", -"O c #000000000000", -"+ c #FFFF14144242", -"@ c #CECE55552929", -"# c #ADAD61616363", -"$ c #B5B545455A5A", -"% c #DEDEAEAE6B6B", -"& c #FFFF8E8E0808", -"* c #A5A579798C8C", -" ", -" ", -" ", -" ", -" ", -" ", -" ", -" ", -" ", -" ............................... ", -" .XXXXXXXXXXXXXXXXXXXXXXXXXXXX.X ", -" .XoooooooooooooOooooooooooooo.X ", -" .XoooooooooooooOooooooooooooo.X ", -" .Xo+++++++++++oOo+++++++++++o.X ", -" .XoooooooooooooOooooooooooooo.X ", -" .XoooooooooooOOoOOooooooooooo.X ", -" .Xooooo@@#oooOOOOOooo@@#@oooo.X ", -" .Xoooo#@$@oooooOoooo#@$@@@ooo.X ", -" .Xooo@@%@@oooooOoooo@%o@%$ooo.X ", -" .Xooo@o@$@oooooOooooooo@$@ooo.X ", -" .Xooooo@%$oooooOoooooo@$@oooo.X ", -" .Xoooo...............$@@%oooo.X ", -" .Xooo.oooooooooooooooX@&ooooo.X ", -" .Xooo.oXXXXXXXXXXXX.oX*oooooo.X ", -" .Xooo.oXooooooooooo.oX@oooooo.X ", -" .Xooo.oXoooooOooooo.oX@oooooo.X ", -" .Xooo.oXoooooOooooo.oX@$@#ooo.X ", -" .Xooo.oXoooooOooooo.oX$%@@ooo.X ", -" .Xooo.oXoooooOooooo.oXooooooo.X ", -" .Xooo.oXoooooOOOOoo.oXooooooo.X ", -" .X....oXoooo@oooooo.oX........X ", -" .oooo.oXooo@ooooooo.oXooooooooX ", -" .XXXX.oXoo@oooooooo.oXXXXXXXXXX ", -" .oXooooooooooo.oX ", -" .oXooooooooooo.oX ", -" .o.............oX ", -" .oooooooooooooooX ", -" .XXXXXXXXXXXXXXXX ", -" XXXXXXXXXXXXXXX ", -" ", -" ", -" ", -" ", -" ", -" ", -" "}; diff --git a/app/fvwm/extras/FvwmScript/Scripts/some_nice_icons/desktop.xpm b/app/fvwm/extras/FvwmScript/Scripts/some_nice_icons/desktop.xpm deleted file mode 100644 index f16630dc7..000000000 --- a/app/fvwm/extras/FvwmScript/Scripts/some_nice_icons/desktop.xpm +++ /dev/null @@ -1,65 +0,0 @@ -/* XPM */ -static char * window_xpm[] = { -"48 48 14 1", -" c None", -". c #E7E7E3E3E7E7", -"X c #C6C6C3C3C6C6", -"o c #848482828484", -"O c #A5A5A2A2A5A5", -"+ c #636361616363", -"@ c #00000000FFFF", -"# c #FFFFFFFFFFFF", -"$ c #DEDEDBDBDEDE", -"% c #8C8C8E8E8C8C", -"& c #4A4AD7D7BDBD", -"* c #0000FFFF0000", -"= c #21218A8A2121", -"- c #212120202121", -" ..................XXXXXXXXXXXXoo ", -" .............XXXXXXXXXXOOOOOOO++oo ", -" .............XXXXXXXXXOOOOOOOO++++oo ", -" ..XOoOOOOOOOOOOOOOOOOOOOOOOOOO+++++++ ", -" ..X@@@@@@@@@@@@@@@@@@@@@@@@OOO+++++++ ", -" ..X@@@@@@@@@@@@@@@@@@@@@@@@OOO+++++++ ", -" ..X@@@@@@@@@@@@@@@@@@@@@@@@OOO+++++++ ", -" ..X@@@##################@@@OOO+++++++ ", -" ..X@@@#$$#$$$$$$$$$#$$#%@@@OOO+++++++ ", -" ..X@@@#%%%%%%%%%%%%%%%%%@@@OOO+++++++ ", -" ..X@@@#&&&&&&&&&&&&&&&&%@@@OOO+++++++ ", -" ..X@@@#&&&&&&&&&&&&&&&&%@@@OOO+++++++ ", -" ..X@@@#&&&&&&&&&&&&&&&&%@@@OOO+++++++ ", -" ..X@@@#&&&&&&&&&&&&&&&&%@@@OOO+++++++ ", -" ..X@@@#&&&&&&&&&&&&&&&&%@@@OOO+++++++ ", -" ..X@@@#&&&&&&&&&&&&&&&&%@@@OOO+++++++ ", -" ..X@@@#&&&&&&&&&&&&&&&&%@@@OOO++++++ ", -" ..X@@@#&&&&&&&&&&&&&&&&%@@@OOO++++++ ", -" ..X@@@#%%%%%%%%%%%%%%%%%@@@OOO+++++ ", -" ..X@@@@@@@@@@@@@@@@@@@@@@@@OOO+++++ ", -" .XX@@@@@@@@@@@@@@@@@@@@@@@@OOO++++ ", -" .XX@@@@@@@@@@@@@@@@@@@@@@@@OOO++++ ", -" .XX@@@@@@@@@@@@@@@@@@@@@@@@OOO++++ ", -" .XXOOOOOOO@@@@@@@@@@@@@@@@@OOO++++ ", -" .XXXXXXXXXXXXXXXXXXXXOOOOOOOOO+++ ", -" .XXXXXXXXXXXXXOOOOOOOOOO**OOOO+++ ", -" OOOOOOOOOOOOOOOOOOOOOOOOOOOOOO+++ ", -" .#.XXOOOOOOOOOOOOOOOOOO++ ", -" .#..XOOoo+++++++++++++++++++++oooo+", -" .##..XOOoooooo++++++++++++++++++oooo++", -" ......OOOooooooooo+++++++++++++ooooo++++", -" .XOOOOXXXXXXXXOOOoooo++++++++ooooo++++++", -" .XOOOOOOOOOOOOXXXXXXXXXOOOOOOOOO++++++++", -" .XO**=OOOOOOOOOOOOOOOOOXXXXXXXX+++++++++", -" .XO===OOOOOOOOOOOOOOOOOOOOOOOOO+++++++++", -" .XOOOOOOOOOOOOOOOOOOOoooooOOOOO+++++++++", -" #XOOOOOOOOOOOOOOOOOooo++++OoooO+++++++++", -" XXXOXOOOOOOOOOOOOOOOOXXXXXXOOOO+++++++++", -" OOXXOOXOXXOXXOOOOOOOOOOOOOOOOOOOO+++++++++", -" OO..XOOXOOXOOXXOXXOXXOOOOOOOOOOOOOO+++++++ ", -" OO...XoOXoOXoOOXOOXOOXOOoXXOXXOXOOOOO+++++ ", -"oOX..OXoOXoO.oO.XoOXoOXoOX.XOOXOOXOoXO+-++ ", -"oOOOXX......OOXXoOXoOXoOX.XoOXOOXOoXX++- ", -" ooooOOOOXXXX#......XOOXXOoOOoOOOoXO++- ", -" ooooooOOOOXXXX###...XXOOOOO.O++- ", -" ooooooOOOOXXXX......Oo+- ", -" ooooooOOOXXXOo+- ", -" oooooo++ "}; diff --git a/app/fvwm/extras/FvwmScript/Scripts/some_nice_icons/display.xpm b/app/fvwm/extras/FvwmScript/Scripts/some_nice_icons/display.xpm deleted file mode 100644 index 86bc1240d..000000000 --- a/app/fvwm/extras/FvwmScript/Scripts/some_nice_icons/display.xpm +++ /dev/null @@ -1,66 +0,0 @@ -/* XPM */ -static char * monitor_xpm[] = { -"48 48 15 1", -" s None c None", -". c grey64", -"X c white", -"o c grey89", -"O c grey76", -"+ c grey51", -"@ c magenta4", -"# c grey39", -"$ c grey13", -"% c grey7", -"& c grey4", -"* c turquoise4", -"= c blue4", -"- c grey26", -"; c green1", -" ............................................. ", -".XoXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXoO. ", -".ooooooooooooooooooooooooooooooooooooOoOOOOOo.+ ", -".XoooooooooooooooooooooooooooooooooooooOOOOOO@# ", -".XoooooooooooooooooooooooooooooooooOoOOOOOOOO+$ ", -".XoooooooooooooooooooooooooooooooooooOOOOOOOO@% ", -".Xoooo&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&.OOO*$ ", -".Xoooo&#=#=###=#=#=#=#=#=#=#=#=#=#=#=#=#=XOOO@% ", -".Xoooo&##=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#XOOO#% ", -".Xoooo&#=XXXXXX#=XX#=XXXXX=#=#=#=#=#=#=##XOOO@% ", -".Xoooo&=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#XOOO#% ", -".Xoooo&#=XXX=XX#XXXXX#=XXXXXX#XXX#=#=#=#-XOO.@% ", -".Xoooo&##=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=-XO.O#% ", -".Xoooo&#=XXXX#XXXXXXX#XXXX=#=#=#=#=#=#=#-X...@% ", -".Xoooo&=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=-XO..#% ", -".Xoooo&#=XX#XXXX=XXXXX=XXXXX=#=#=#=#=#=#-X...=% ", -".Xoooo&=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=-X...#% ", -".Xoooo&#=XXXXX=#=#=#=#=#=#=#=#=#=#=#=#=#-X...#& ", -".Xoooo&=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=-X...#% ", -".Xoooo&#=XX#=#=#=#=#=#=#=#=#=#=#=#=#=#=#-X...#& ", -".Xoooo&@#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=-X...#% ", -".Xoooo&#=XXXX#XX=XXX=#=#=#=#=#=#=#=#=#=#-X...#& ", -".Xoooo&=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=-X...#& ", -".Xoooo&#=XXX=XXXX#=XXXX#=#=#=#=#=#=#=#=#-X...#& ", -".Xoooo&=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=-X...#& ", -".Xoooo&#=XX#=#=#=#=#=#=#=#=#=#=#=#=#=#=#-X...#& ", -".Xoooo&=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=-X..+#& ", -".Xoooo&#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#-X..+#& ", -".Xoooo&=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=-X+++#& ", -".Xoooo&#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#-X+++-& ", -".Xoooo&##=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#X+++-& ", -".Xoooo&#####=#=#=#=#=#@@=#=@=#=#=#####=#=X+++-& ", -".Xoooo.XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX+++-& ", -".XoooooOoOOOOOOOOOOOOO................---++++-& ", -".XoooOoOOOOOOOOOOOOOO...............++-;;O+++-& ", -".XoooOOOOOOOOOOOOOOO................+++OOO+++-& ", -".X.+@+@+@@@#@#@#################-#------------& ", -".*&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& ", -" .X#----$OO..+##--$$%%%$$--- ", -" .X.######-#+*+##---%$$--####$ ", -" .Xo++++++++##---------#++++++#$ ", -" .XX............................#$ ", -" .XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX#$ ", -" .X................................& ", -" .X................................& ", -" #&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& ", -" ", -" "}; diff --git a/app/fvwm/extras/FvwmScript/Scripts/some_nice_icons/keyboard.xpm b/app/fvwm/extras/FvwmScript/Scripts/some_nice_icons/keyboard.xpm deleted file mode 100644 index 94cae495f..000000000 --- a/app/fvwm/extras/FvwmScript/Scripts/some_nice_icons/keyboard.xpm +++ /dev/null @@ -1,64 +0,0 @@ -/* XPM */ -static char * keyboard_xpm[] = { -"56 46 15 1", -" c None", -". c #000000000000", -"X c #29295D5D4A4A", -"o c #BDBDBABABDBD", -"O c #E7E7E7E7EFEF", -"+ c #BDBDC3C3BDBD", -"@ c #7B7B86869C9C", -"# c #C6C6BABAC6C6", -"$ c #94949696ADAD", -"% c #737379798484", -"& c #7B7B9292B5B5", -"* c #BDBDC3C3CECE", -"= c #000000001010", -"- c #BDBDB6B6BDBD", -"; c #8C8C8A8A8C8C", -" ", -" ", -" ", -" ", -" ", -" ", -" ", -" ", -" ", -" ", -" ", -" ", -" ................................ ", -" XoO+oO+ooOo..XOo+oO+ooOo..XO+oOo ", -" +OOOOOOOOO@..oOOOOOOOOO@..oOOOOO ", -" oO@@@@@@@@X..oO@@@@@@@@X..oO@@@@ ", -" oO@XXXXX@@X..oO@XXXXX@@X..oO@XXX ", -" oO@XX@@@#@X..oO@XX@@@#@X..oO@XX@ ", -" OO@X@$%&o@X..OO@X@$%&o@X..OO@X@@ ", -" #O@X&%@@O@X..#O@X&%@@#@X..#O@X@@ ", -" oO@X%$%#*@X..oO@X%$%*O@X..+O@X@@ ", -" oO@@#**+o@X..oO@@#**oo@X..#O@@#o ", -" OO@@@@%&@@X..OO@@@@@@@@X..OO@@@@ ", -" #@XXXXXXXXX..#@XXXXXXXXX..o@XXXX ", -" ..=.=..........=...........=.=.. ", -" ................................ ", -" o..XoOooOo+oOo..XoOo+Oo+oOo..X+O ", -" @..oOOOOOOOOO@..oOOOOOOOOO@..oOO ", -" X..OO@@@@@@@@X..oO@@@@@@@@X..oO@ ", -" X..oO@XXXXX@@X..oO@XXXXX@@X..OO@ ", -" X..oO@XX@@$-@X..OO@XX@@$-@X..oO@ ", -" X..oO@X$%&%*@X..#O@X$%&%*@X..#O@ ", -" X..oO@X%&%$-@X..+O%X&%$%*@X..oO@ ", -" X..oO@X&@@oO@X..#O&X%&%*O@X..OO@ ", -" X..OO@%##ooo@X..+O%$*#*oo@X..oO@ ", -" X..#O;&@@@@@@X..OO&%@%@@@@X..#O@ ", -" X..+@XXXXXXXXX..#@XXXXXXXXX..o@X ", -" .....=..=.=.=.....=.=.=.=....... ", -" ................................ ", -" ", -" ", -" ", -" ", -" ", -" ", -" "}; diff --git a/app/fvwm/extras/FvwmScript/Scripts/some_nice_icons/menu.xpm b/app/fvwm/extras/FvwmScript/Scripts/some_nice_icons/menu.xpm deleted file mode 100644 index 863b5368a..000000000 --- a/app/fvwm/extras/FvwmScript/Scripts/some_nice_icons/menu.xpm +++ /dev/null @@ -1,54 +0,0 @@ -/* XPM */ -static char * menu_xpm[] = { -"56 46 5 1", -" c None", -". c #FFFFFFFFFFFF", -"X c #DEDEDBDBDEDE", -"o c #8C8C8E8E8C8C", -"O c #000000000000", -" ", -" ", -" ................................................. ", -" .XXXXXXXXXXXXXoXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX ", -" .XXXXooooXXXoXXXoXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX ", -" .XXXXXoXXXXooXoXooXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX ", -" .XXXXXooXXoXoXoXoXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX ", -" .XXXXXoXXXoXoXoXoXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX ", -" .XXXXooooXXooXoXXoXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX ", -" .XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX ", -" ooooooooooooooooooooooooooooooooooooooooooooooooo ", -" ............................ ", -" .XXXXXXXXXXXXXXXXXXXXXXXXXXo ", -" .XXXoooXXXXXXoXXXXXXXXXXXXXo ", -" .XXoXXXoXoXoXooXXXXXXXXXXXXo ", -" .XXoXXXXXoXoXoXXXXXXXXXXXXXo ", -" .XXoXXXoXoXoXoXXXXXXXXXXXXXo ", -" .XXXoooXXXooXXoXXXXXXXXXXXXo ", -" .XXXXXXXXXXXXXXXXXXXXXXXXXXo ", -" ...........................o ", -" ..XXoooXXXXXXXXXXXXXXXXXXXoo ", -" ..XoXXXoXXoXXooXXoXoXXXXXXoo ", -" ..XoXXXXXoXoXoXoXoXoXXXXXXoo ", -" ..XoXXXoXoXoXoXoXoXoXXXOOOOOOO ", -" ..XXoooXXXoXXooXXXoXXXXXOOOOO ", -" ..XXXXXXXXXXXoXXXXoXXXXXXOOOOO ", -" ..XXXXXXXXXXXoXXXoXXXXXXXXOO OOO ", -" ..oooooooooooooooooooooooooO OO ", -" .XXXXXXXXXXXXXXXXXXXXXXXXXXo ", -" .XXooooXXXXXXXoXXXXXXXXXXXXo ", -" .XXXoXXooXXooXooXXoXXXXXXXXo ", -" .XXXoooXXoXoXXoXXoooXXXXXXXo ", -" .XXXoXXXooXXoXoXXoXXXXXXXXXo ", -" .XXooXXXooXooXXoXXoXXXXXXXXo ", -" .XXXXXXXXXXXXXXXXXXXXXXXXXXo ", -" .XXXXXXXXXXXXXXXXXXXXXXXXXXo ", -" .XXXXXXXXXXXXXXXXXXXXXXXXXXo ", -" .XXXoooXXoXXXXXXXXXXXXXXXXXo ", -" .XXoXXXoXoXXXoXXoXXoXoXXXXXo ", -" .XXoXXXXXoXXoooXXoXooXXXXXXo ", -" .XXoXXXoXoXXoXXXooXoXXXXXXXo ", -" .XXXoooXXoXXXoXXooXoXXXXXXXo ", -" .XXXXXXXXXXXXXXXXXXXXXXXXXXo ", -" .ooooooooooooooooooooooooooo ", -" ", -" "}; diff --git a/app/fvwm/extras/FvwmScript/Scripts/some_nice_icons/pointer.xpm b/app/fvwm/extras/FvwmScript/Scripts/some_nice_icons/pointer.xpm deleted file mode 100644 index e66dfb82c..000000000 --- a/app/fvwm/extras/FvwmScript/Scripts/some_nice_icons/pointer.xpm +++ /dev/null @@ -1,62 +0,0 @@ -/* XPM */ -static char * pointer_xpm[] = { -"56 46 13 1", -" c None", -". c #000000000000", -"X c #BDBDBABABDBD", -"o c #ADADAAAAADAD", -"O c #ADADAEAEADAD", -"+ c #E7E7E7E7EFEF", -"@ c #7B7B86869C9C", -"# c #080804040808", -"$ c #94949696ADAD", -"% c #737379798484", -"& c #7B7B9292B5B5", -"* c #BDBDC3C3BDBD", -"= c #000000001010", -" ", -" ", -" ", -" ", -" ", -" ", -" ", -" . . . .... ", -" . ", -" . ", -" . ", -" . ", -" .... ", -" XoXO ", -" ...... ", -" .++++++. ", -" ....++++++++.... ", -" .+++++++++++++++@. ", -" .+++..........+@@. ", -" .+...++++++++..#@. ", -" .+.X..........X.@. ", -" .+.+.@@@@@@@@.+.@. ", -" .+.X.@@@$%&@@#X.@. ", -" .+.X.#####....X#@. ", -" .+.+XX+XXX+XX+X.@. ", -" .+.*X*XX+*X*X*X#@. ", -" .+.X+X*XXX*+XX+.@# ", -" .+.*XX*X*+XXX*X.@. ", -" .+.X+X+XXX*X+X*.@. ", -" .+.X*X*X*X+X*XX#@. ", -" .+.X+X*+X*X*+X+.@# ", -" .+.*X*XXX+*XX*X#@. ", -" .+.+XX+*XXX+XX*.@. ", -" .+.XX*XX*X*X*X+#@. ", -" .+.*+X*+X+XX*+X.@# ", -" .+@....#..#...#@@. ", -" .@@@@@@@@@@@@@@@@# ", -" .$%&%$@@@@&%$%&@@. ", -" .=.######.=##..# ", -" ", -" ", -" ", -" ", -" ", -" ", -" "}; diff --git a/app/fvwm/extras/FvwmScript/Scripts/some_nice_icons/shutdown.xpm b/app/fvwm/extras/FvwmScript/Scripts/some_nice_icons/shutdown.xpm deleted file mode 100644 index 952cb745e..000000000 --- a/app/fvwm/extras/FvwmScript/Scripts/some_nice_icons/shutdown.xpm +++ /dev/null @@ -1,119 +0,0 @@ -/* XPM */ -static char *shutdown[] = { -/* width height num_colors chars_per_pixel */ -" 48 48 62 1", -/* colors */ -". c #000000", -"# c #00000f", -"a c None", -"b c #0f000f", -"c c #0f001f", -"d c #0f0f0f", -"e c #0f0f1f", -"f c #1f001f", -"g c #1f002f", -"h c #1f0f1f", -"i c #1f0f2f", -"j c #2f0040", -"k c #2f0f40", -"l c #400040", -"m c #400050", -"n c #400f40", -"o c #400f50", -"p c #400f60", -"q c #500060", -"r c #500f60", -"s c #500f70", -"t c #50402f", -"u c #50502f", -"v c #505040", -"w c #505050", -"x c #600070", -"y c #600f80", -"z c #600f90", -"A c #60402f", -"B c #604040", -"C c #606750", -"D c #700f90", -"E c #700fa0", -"F c #7020a0", -"G c #705050", -"H c #705060", -"I c #706750", -"J c #706760", -"K c #800fa0", -"L c #800fb0", -"M c #800fcf", -"N c #8020cf", -"O c #900fb0", -"P c #900fcf", -"Q c #900fdf", -"R c #9020cf", -"S c #a00fdf", -"T c #a00fef", -"U c #a020df", -"V c #a020ef", -"W c #a08770", -"X c #a09770", -"Y c #a0a8a0", -"Z c #b00fef", -"0 c #b00fff", -"1 c #b020ef", -"2 c #b020ff", -"3 c #b08770", -"4 c #b08780", -"5 c #cf0fff", -"6 c #ffc8a0", -"7 c #ffffff", -/* pixels */ -"aaaaaaaaaaaaaaaaaaaaaaaaYIGIGIGIGIGwwIaaaaaaaaaa", -"aaaaaaaaaaaaaaaaaaaaaaCHw66666666666X3Cwaaaaaaaa", -"aaaaaaaaaaaaaaaaaaaaGC666666666666666666Gaaaaaaa", -"aaaaaaaaaaaaaaaaaaaI666666666666666666666Jaaaaaa", -"aaaaaaaaaaaaaaaaaaG66666666666366666666666GIaaaa", -"aaaaaaaaaaaaaaaaaJ66666663X4X3X4X3X4vBX66666CJaa", -"aaaaaaaaaaaaaaaaG666666tBuBtBuBtBuBt3X66666666GI", -"aaaaaaaaaaaaaaaI6666vBv6666666666666666666666666", -"aaaaaaaaaaaaaaGX66Bu6666666666666666666666666666", -"aaaaaaaaaaaaaJX66B666666666666666666666666666666", -"aaaaaaaaaaaaGX666u666666666666666666666666666666", -"aaaaaaaaaaaIX666XB666666666666666666666666666666", -".................ABX3WBXB.BuBABX3666666666666666", -"77777777777777777YvB...........Bv366666666666666", -"YYYYYYYYYYYYYYYYYYYwwwwww.........36666666666666", -"YYYYYYYYYYYYYYYYYYYYYYYww..........6666666666666", -"YYYYYYY77777777777777.YYw...........666666666666", -"YYYYYYY7YYYYYYYYYYYYw.YYw............36666666666", -"YYYYYYY7Y.wYYYYYYw.Yw.YYw..............666666666", -"YYYYYYY7Yw.wYYYYw.wYw.YYw...............X6666666", -"YYYYYYY7YYw.wYYw.wYYw.YYw................A3X6666", -"YYYYYYY7YYYw.ww.wYYYw.YYw..................BX666", -"YYYYYYY7YYYYw..wYYYYw.YYw................uBt3X6W", -"YYYYYYY7YYYYw..wYYYYw.YYw......Bw.....vBvBX3X6X6", -"YYYYYYY7YYYw.ww.wYYYw.YYw.....BaaAB....uBWBX3W6X", -"YYYYYYY7YYw.wYYw.wYYw.YYw......aaaaavBvB.BvBXBX4", -"YYYYYYY7Yw.wYYYYw.wYw.YYw.B....aaaaaaaaaauBtBuBt", -"YYYYYYY7Y.wYYYYYYw.Yw.YYw.vB...aaaaaaaaaaaaavBvB", -"YYYYYYY7YYYYYYYYYYYYw.YYw.auB.aaaaaaaaaaaaaaaaaa", -"YYYYYYY7wwwwwwwwwwwww.YYw.aaaaaaaaaaaaaaaaaaaaaa", -"YYYYYYY...............YYw.aaaaaaaaaaaaaaaaaaaaaa", -"YYYYYYYYYYYYYYYYYYYYYYYYw.aaaaaaaaaaaaaaaaaaaaaa", -"YYYYYYYYYYYYYYYYYYYYYYYYw.aaaaaaaaaaaaaaaaaaaaaa", -"wwwwwwwwwwwwwwwwwwwwwwwww.aaaaaaaaaaaaaaaaaaaaaa", -"..........................aaaaaaaaaaaaaaaaaaaaaa", -"YYYYYYYYYYYYYYYYYYYYYYYYY.aaaaaaaaaaaaaaaaaaaaaa", -"YYYYYYYYYYYYYYYYYYYYYYYYY.aaaaaaaaaaaaaaaaaaaaaa", -"YYYYYYYYYYYYYYYYYYYYYYYYY.aaaaaaaaaaaaaaaaaaaaaa", -"YYYYYYYYYYYYYYYYYYYYYYYYY.aaaaaaaaaaaaaaaaaaaaaa", -"YYYYYYYYYYYYYYYYYYYYYYYYY.aaaaaaaaaaaaaaaaaaaaaa", -"YYYYYYYYYYYYYYYYYYYYYYYYY.aaaaaaaaaaaaaaaaaaaaaa", -"wwwwwwwwwwwwwwwwwwww7YYYY.aaaaaaaaaaaaaaaaaaaaaa", -"...................Y7YYYY.aaaaaaaaaaaaaaaaaaaaaa", -"#chjkmossyzEELRSUZ2Y7YYYY.aaaaaaaaaaaaaaaaaaaaaa", -"bbgilnqrxyDDKLPRS15Y7YYYY.aaaaaaaaaaaaaaaaaaaaaa", -"dfejkmpssyzEFONQU22Y7YYYY.aaaaaaaaaaaaaaaaaaaaaa", -"bbggjoqrxyDDLLPPTV5Y7YYYY.aaaaaaaaaaaaaaaaaaaaaa", -"#chjkmpsszzEEMRSU02Y7YYYY.aaaaaaaaaaaaaaaaaaaaaa" -}; -SIMPLE = T BITPIX = 8 NAXIS = 2 NAXIS1 = 48 NAXIS2 = 48 HISTORY Written by XV 3.10 END -
\ No newline at end of file diff --git a/app/fvwm/extras/FvwmScript/Scripts/some_nice_icons/small.Paint2.xpm b/app/fvwm/extras/FvwmScript/Scripts/some_nice_icons/small.Paint2.xpm deleted file mode 100644 index c2a22c73b..000000000 --- a/app/fvwm/extras/FvwmScript/Scripts/some_nice_icons/small.Paint2.xpm +++ /dev/null @@ -1,86 +0,0 @@ -/* XPM */ -static char * image_name[] = { -"20 20 63 1", -" c #DCDCDCDCDCDC", -". c #D7D7D3D3D7D7", -"X c #9E9E9A9A9E9E", -"o c #CFCFC7C7CFCF", -"O c #B6B6AEAEB6B6", -"+ c #BEBEB6B6BEBE", -"@ c #C7C7BABAC7C7", -"# c #AEAEAEAEB6B6", -"$ c #8E8E8A8A8E8E", -"% c #AEAEB2B2CFCF", -"& c #C4C4C4C4C4C4", -"* c #B6B6B2B2B6B6", -"= c #717175757171", -"- c #717179798686", -"; c #181820202020", -": c #000000000000", -"> c #797986869E9E", -", c #515171718E8E", -"< c #2F2F4F4F5050", -"1 c #000000001010", -"2 c #080804040808", -"3 c #000000001818", -"4 c #28282C2C3030", -"5 c #B0B0B0B0B0B0", -"6 c #B9B9B9B9B9B9", -"7 c #202028285151", -"8 c #2B2B2B2B2B2B", -"9 c #5F5F5F5F5F5F", -"0 c #96969696AEAE", -"q c #494949495151", -"w c #000008080808", -"e c #69698686BEBE", -"r c #696969697171", -"t c #A6A6A6A6A6A6", -"y c #BEBEBEBEBEBE", -"u c #A6A6A2A2A6A6", -"i c #AEAEA6A6AEAE", -"p c #969692929696", -"a c #999999999999", -"s c #6B6B69696B6B", -"d c #202020202020", -"f c #555555555555", -"g c #A9A9A9A9A9A9", -"h c #79799292B6B6", -"j c #5959A2A2D7D7", -"k c #616161616161", -"l c #A6A69E9EA6A6", -"z c #D2D2B4B48C8C", -"x c #F7F7B2B2AEAE", -"c c #F5F5DEDEB3B3", -"v c #FFFFE7E7BEBE", -"b c #F0F0F0F0F0F0", -"n c #FFFFFBFBFFFF", -"m c #797979797979", -"M c #BEBEBABABEBE", -"N c #F7F7F3F3F7F7", -"B c #FFFFFFFFFFFF", -"V c #D7D7DFDFE7E7", -"C c #525252525252", -"Z c #666666666666", -"A c #AEAEAAAAAEAE", -"S c #909090909090", -"D c #303034343030", -" ..................X", -"oO+++@#$%&++**++*Oo=", -"oO+@#-;:;>&&+*++++o=", -"oO+#,<122345o*++*+o=", -"o+6-<<;74::8o+O**Oo=", -"o+-<,9:;2:;10@OOOOo=", -"&+,,,q,,3we7qoOOOOor", -"@tee,q,,,:9<qyOOOO%r", -"@u0uipas7d%eq+OOO#@s", -"@u+o%%%0d9%>f+iigO+7", -"@i#0heej:9h,k+iilz,9", -"@l+xxx@o2l%r$Og0x90s", -"@0icxvb.7n%=Oiu@m-os", -"Mll#NBVC:C0uOX#$,O+Z", -"+Xuai=:::p0iur7r#u*Z", -"+XllA07q>u,*r,;*ul*Z", -"6XlllO-S0#0072mOll*Z", -"*plXXArrAX077SAl0lOk", -"+iOOO6#0*O*Oy6OOOO@Z", -"mffffffffffffffffffD"}; diff --git a/app/fvwm/extras/FvwmScript/Scripts/some_nice_icons/small.Shell2.xpm b/app/fvwm/extras/FvwmScript/Scripts/some_nice_icons/small.Shell2.xpm deleted file mode 100644 index 348e08ee2..000000000 --- a/app/fvwm/extras/FvwmScript/Scripts/some_nice_icons/small.Shell2.xpm +++ /dev/null @@ -1,83 +0,0 @@ -/* XPM */ -static char * image_name[] = { -"20 20 60 1", -" c #E9E9E9E9E9E9", -". c #D7D7D3D3D7D7", -"X c #DCDCD8D8DCDC", -"o c #9E9E9A9A9E9E", -"O c #CCCCCCCCCCCC", -"+ c #B0B0B0B0B0B0", -"@ c #B6B6B2B2B6B6", -"# c #B9B9B9B9B9B9", -"$ c #717175757171", -"% c #D7D7DFDFE7E7", -"& c #E7E7E7E7EFEF", -"* c #D3D3D3D3D3D3", -"= c #BEBEC3C3CFCF", -"- c #A9A9A9A9A9A9", -"; c #C7C7BABAC7C7", -": c #AEAEAEAEB6B6", -"> c #515171718E8E", -", c #8E8E8A8A8E8E", -"< c #38386D6DA6A6", -"1 c #28284D4D9696", -"2 c #717179798686", -"3 c #202028285151", -"4 c #CFCFC7C7CFCF", -"5 c #BFBFC2C2BFBF", -"6 c #6B6B69696B6B", -"7 c #797979797979", -"8 c #AEAE61616161", -"9 c #868679798686", -"0 c #8E8E86867979", -"q c #3D3D3B3B3D3D", -"w c #CFCFD3D3CFCF", -"e c #AEAEB2B2CFCF", -"r c #C4C4C4C4C4C4", -"t c #DCDCDCDCDCDC", -"y c #494949495151", -"u c #BEBEBEBEBEBE", -"i c #A0A0A0A0A0A0", -"p c #555555555555", -"a c #999999999999", -"s c #5F5F5F5F5F5F", -"d c #707080809090", -"f c #2F2F4F4F5050", -"g c #666666666666", -"h c #696969697171", -"j c #BEBEB6B6BEBE", -"k c #BEBEBABABEBE", -"l c #969692929696", -"z c #535353535353", -"x c #AAAAAAAAAAAA", -"c c #7F7F7F7F7F7F", -"v c #909090909090", -"b c #A6A6A2A2A6A6", -"n c #A6A6A6A6A6A6", -"m c #96969696AEAE", -"M c #A3A3D1D1F2F2", -"N c #A6A69E9EA6A6", -"B c #AEAEAAAAAEAE", -"V c #B6B6AEAEB6B6", -"C c #AEAEA6A6AEAE", -"Z c #303034343030", -" .................Xo", -"O+@@@@########@###O$", -"O#%%&%%%%%%*%%&=%-*$", -"O;:>,>>>>>>><123>34$", -"O5$67$$7$$789770,qw$", -"Oe,r*wt tt tt*4X%yw$", -"ru,@urip2a2sdO#r=fO$", -"ru,@X.g::,7e$@Xw=fOh", -"rj,k$77jkalk@z$x4frh", -"r#,+c;vbOao4i,*,=fr6", -";@,x-rk,*an.7u5mMfr6", -"r@,@,@*c#vNB,O,r=fr6", -";@,#r,OOOO*rrl-4=fu6", -"k@,+O+v#@rOO6brOefk6", -"kV,@=eOk@kr+g4#rMfu6", -"kB,+k#esyzpyvr#ref#g", -"#B,OtXX XX Mfjg", -"#Ccg66666h66666$p3#g", -"j:@CC::C:::C::::@#4g", -"7pppppspppppppppppsZ"}; diff --git a/app/fvwm/extras/FvwmScript/Scripts/some_nice_icons/small.exit.xpm b/app/fvwm/extras/FvwmScript/Scripts/some_nice_icons/small.exit.xpm deleted file mode 100644 index bfeaca0a1..000000000 --- a/app/fvwm/extras/FvwmScript/Scripts/some_nice_icons/small.exit.xpm +++ /dev/null @@ -1,76 +0,0 @@ -/* XPM */ -static char * image_name[] = { -"20 20 53 1", -" c #DCDCD8D8DCDC", -". c #D3D3D3D3D3D3", -"X c #CFCFC7C7CFCF", -"o c #CCCCCCCCCCCC", -"O c #999999999999", -"+ c #C4C4C4C4C4C4", -"@ c #B6B6AEAEB6B6", -"# c #717175757171", -"$ c #B6B6B2B2B6B6", -"% c #696969697171", -"& c #AEAEAEAEB6B6", -"* c #B0B0B0B0B0B0", -"= c #C7C7BABAC7C7", -"- c #AEAEAEAEAEAE", -"; c #6B6B69696B6B", -": c #A6A6A2A2A6A6", -"> c #666666666666", -", c #AEAEAAAAAEAE", -"< c #080804040808", -"1 c #BEBEBABABEBE", -"2 c #8E8E8A8A8E8E", -"3 c #000000000000", -"4 c #B9B9B9B9B9B9", -"5 c #E9E9E9E9E9E9", -"6 c #5F5F5F5F5F5F", -"7 c #797979797979", -"8 c #FFFFFFFFFFFF", -"9 c #202020202020", -"0 c #303034343030", -"q c #535353535353", -"w c #2B2B2B2B2B2B", -"e c #494949495151", -"r c #868679798686", -"t c #A9A9A9A9A9A9", -"y c #DCDCDCDCDCDC", -"u c #D7D7D3D3D7D7", -"i c #3D3D3B3B3D3D", -"p c #EDEDEDEDEDED", -"a c #F0F0F0F0F0F0", -"s c #F7F7F3F3F7F7", -"d c #909090909090", -"f c #BEBEB6B6BEBE", -"g c #A6A69E9EA6A6", -"h c #181820202020", -"j c #9E9E9A9A9E9E", -"k c #CFCFD3D3CFCF", -"l c #AAAAAAAAAAAA", -"z c #616161616161", -"x c #969692929696", -"c c #969696969696", -"v c #A0A0A0A0A0A0", -"b c #A6A6A6A6A6A6", -"n c #555555555555", -" .XXXoXXXXXXXXXXXX.O", -"+@@@@@@@@@@@@@@@@@+#", -"+@@@$@@@$$@@$$$$@@X%", -"+@@@@@@@@@@@@&@*@@+%", -"+@=++=@@-@@$==$@@@+;", -"=:##%>@@,@@$<<11$$+;", -"+23333+=4141;25634X;", -"=2378529220=q6=33w@;", -"=23e2rt3<37y33u33w.;", -"=2333i e3wp13<a03 u>", -"1237syod3wXf3<5w3+=>", -"123e2;gh33#+335w32@>", -"173333w<13hf3<u733$>", -"4j+..k+o+@+=lk4t1o z", -"4xjjjjOOOjjjjjOOjO,z", -"$dxOcjcOOcOOOxOOOc,6", -"$dOOOcccOcccOcxOOO,z", -"*dxxxOxcxxccxccxxxt6", -"$vtltbltb,btlttltt16", -"7qqqqqnqqnnqqnnnqqn0"}; diff --git a/app/fvwm/extras/FvwmScript/Scripts/some_nice_icons/small.lock.xpm b/app/fvwm/extras/FvwmScript/Scripts/some_nice_icons/small.lock.xpm deleted file mode 100644 index 6bb38fb9c..000000000 --- a/app/fvwm/extras/FvwmScript/Scripts/some_nice_icons/small.lock.xpm +++ /dev/null @@ -1,90 +0,0 @@ -/* XPM */ -static char * image_name[] = { -"20 20 67 1", -" c #DCDCD8D8DCDC", -". c #CFCFC7C7CFCF", -"X c #999999999999", -"o c #C4C4C4C4C4C4", -"O c #AEAEAAAAAEAE", -"+ c #B6B6AEAEB6B6", -"@ c #AEAEAEAEB6B6", -"# c #717175757171", -"$ c #B6B6B2B2B6B6", -"% c #B0B0B0B0B0B0", -"& c #BEBEB6B6BEBE", -"* c #AEAEA6A6AEAE", -"= c #BEBEBABABEBE", -"- c #FFFFFBFBFFFF", -"; c #FFFFFFFFFFFF", -": c #666666666666", -"> c #A6A69E9EA6A6", -", c #B9B9B9B9B9B9", -"< c #696969697171", -"1 c #AEAEB2B2CFCF", -"2 c #CCCCCCCCCCCC", -"3 c #DCDCDCDCDCDC", -"4 c #303034343030", -"5 c #96969696AEAE", -"6 c #3D3D3B3B3D3D", -"7 c #515155554949", -"8 c #909090909090", -"9 c #D7D7D3D3D7D7", -"0 c #000008080808", -"q c #5F5F5F5F5F5F", -"w c #8E8E8A8A8E8E", -"e c #C7C7BABAC7C7", -"r c #A6A6A2A2A6A6", -"t c #6B6B69696B6B", -"y c #DFDFBABA8E8E", -"u c #DFDFAEAE6969", -"i c #AEAE61616161", -"p c #595951512828", -"a c #616161616161", -"s c #F0F0F0F0F0F0", -"d c #BEBEBEBEBEBE", -"f c #A9A9A9A9A9A9", -"g c #AEAE9E9E5959", -"h c #E7E7D7D79E9E", -"j c #9E9E9A9A9E9E", -"k c #F7F7F3F3F7F7", -"l c #717179798686", -"z c #A6A6A6A6A6A6", -"x c #AEAEA6A67171", -"c c #969692929696", -"v c #7F7F7F7F7F7F", -"b c #D2D2B4B48C8C", -"n c #AAAAAAAAAAAA", -"m c #797979797979", -"M c #BFBFC2C2BFBF", -"N c #525252525252", -"B c #8E8E91918E8E", -"V c #2F2F4F4F4F4F", -"C c #28282C2C3030", -"Z c #2B2B2B2B2B2B", -"A c #8E8E86867979", -"S c #555555555555", -"D c #868679798686", -"F c #969696969696", -"G c #404042424040", -"H c #AEAEAEAEAEAE", -"J c #535353535353", -" ..................X", -"oO+++++++++@OO+++@o#", -"o+$$%$$%$$OO+++&$+o#", -"oO@$+++++*=-;;:>,+o<", -"o*@+++,$@1;2+334++o<", -"o*OO+$567890q#;ww$o<", -"erO*+@tyuipaoXsdw$e<", -"=rff+wgh:5qw$jk$l+=<", -"=rfz$#xhiii<fcs%vO&<", -"=>rf@tbhhhtk;;;;;f$<", -",jrnmuxixpwM$%+%f#,t", -"=j@wxgNBnVCCCCCZtm,:", -",j8Ax4S=;XiAwwwicm,:", -",Xibp6X$;D:####twm$:", -"$c:77F5n;a6GGpG6mv+:", -"%Xwwwrcf;zjrr>rr>m+a", -"$cj>5Xcn$#wwwwwwm#Oa", -"%wcccXcc8888c8ccccna", -"$rffnffffHnfOnnnfn,q", -"mJJJJSSJJJJJSSSJSJS6"}; diff --git a/app/fvwm/extras/FvwmScript/Scripts/some_nice_icons/small.man.next.xpm b/app/fvwm/extras/FvwmScript/Scripts/some_nice_icons/small.man.next.xpm deleted file mode 100644 index 05ce40ec6..000000000 --- a/app/fvwm/extras/FvwmScript/Scripts/some_nice_icons/small.man.next.xpm +++ /dev/null @@ -1,84 +0,0 @@ -/* XPM */ -static char * image_name[] = { -"20 20 61 1", -" c #F7F7F3F3F7F7", -". c #DCDCDCDCDCDC", -"X c #6B6B69696B6B", -"o c #E9E9E9E9E9E9", -"O c #999999999999", -"+ c #A6A6A2A2A6A6", -"@ c #C7C7BABAC7C7", -"# c #555555555555", -"$ c #A6A69E9EA6A6", -"% c #AEAEAAAAAEAE", -"& c #B6B6AEAEB6B6", -"* c #B6B6B2B2B6B6", -"= c #AEAEAEAEB6B6", -"- c #AAAAAAAAAAAA", -"; c #C4C4C4C4C4C4", -": c #5F5F5F5F5F5F", -"> c #A0A0A0A0A0A0", -", c #666666666666", -"< c #B0B0B0B0B0B0", -"1 c #B9B9B9B9B9B9", -"2 c #7F7F7F7F7F7F", -"3 c #D3D3D3D3D3D3", -"4 c #CCCCCCCCCCCC", -"5 c #000000000000", -"6 c #969696969696", -"7 c #BEBEBABABEBE", -"8 c #BEBEBEBEBEBE", -"9 c #8E8E8A8A8E8E", -"0 c #F0F0F0F0F0F0", -"q c #181820202020", -"w c #FFFFFFFFFFFF", -"e c #404042424040", -"r c #AEAEA6A6AEAE", -"t c #515155554949", -"y c #616161616161", -"u c #909090909090", -"i c #DCDCD8D8DCDC", -"p c #AEAEB2B2CFCF", -"a c #3D3D3B3B3D3D", -"s c #CFCFC7C7CFCF", -"d c #9E9E9A9A9E9E", -"f c #717175757171", -"g c #969692929696", -"h c #5151A2A24949", -"j c #707080809090", -"k c #202020202020", -"l c #797979797979", -"z c #868679798686", -"x c #A6A6A6A6A6A6", -"c c #494949495151", -"v c #080804040808", -"b c #A9A9A9A9A9A9", -"n c #BEBEB6B6BEBE", -"m c #525252525252", -"M c #303034343030", -"N c #595951512828", -"B c #8E8E86867979", -"V c #8E8E91918E8E", -"C c #96969696AEAE", -"Z c #535353535353", -"A c #2B2B2B2B2B2B", -" ..................X", -"oO++++++++++++++++@#", -"o$%%&%**%=--%%%%&&;:", -"o>&&&,o#$*<*&&1>&23:", -"o$&&43&5+@+ X67o;X@:", -"o$%%89,59=70q+1we5;:", -"or64<#t5<y>u52ipa5s:", -"o*8:9dX5fe>g5h ,-q;:", -"o7j5+7952e1+q:f#4k@:", -"o@l5+dz5xc1$v9by4k@:", -"on+v+b95*m1%vlOy7q@:", -"o*1MxOl5*m1%qNt:sk;:", -"on>v%1B5bc8nqNNy7k;:", -"o7f5$pf5Oe;nvyf,uv;:", -"o@95Xfc59c6,qVnXe5s:", -"o&lv9V:5fe+9v:l#y5;:", -"o+$r+Xet9ljfNNM:9l4#", -"o+**xC+n@8<*7@7@714:", -"on;4ssss4ssss4sss;.:", -"dZZZ###ZZZmZ#Z#####A"}; diff --git a/app/fvwm/extras/FvwmScript/Scripts/some_nice_icons/small.note.next.xpm b/app/fvwm/extras/FvwmScript/Scripts/some_nice_icons/small.note.next.xpm deleted file mode 100644 index d22442fad..000000000 --- a/app/fvwm/extras/FvwmScript/Scripts/some_nice_icons/small.note.next.xpm +++ /dev/null @@ -1,81 +0,0 @@ -/* XPM */ -static char * image_name[] = { -"20 20 58 1", -" c #F7F7F3F3F7F7", -". c #DCDCDCDCDCDC", -"X c #DCDCD8D8DCDC", -"o c #6B6B69696B6B", -"O c #E9E9E9E9E9E9", -"+ c #999999999999", -"@ c #A6A69E9EA6A6", -"# c #A6A6A2A2A6A6", -"$ c #B6B6AEAEB6B6", -"% c #717175757171", -"& c #8E8E8A8A8E8E", -"* c #CCCCCCCCCCCC", -"= c #555555555555", -"- c #AEAEAAAAAEAE", -"; c #AEAEAEAEAEAE", -": c #B6B6B2B2B6B6", -"> c #AAAAAAAAAAAA", -", c #A9A9A9A9A9A9", -"< c #A6A6A6A6A6A6", -"1 c #BEBEBABABEBE", -"2 c #494949495151", -"3 c #C7C7BABAC7C7", -"4 c #696969697171", -"5 c #797979797979", -"6 c #707080809090", -"7 c #5151A2A24949", -"8 c #525252525252", -"9 c #5F5F5F5F5F5F", -"0 c #C4C4C4C4C4C4", -"q c #969692929696", -"w c #AEAEA6A6AEAE", -"e c #D7D7D3D3D7D7", -"r c #535353535353", -"t c #CFCFC7C7CFCF", -"y c #9E9E9A9A9E9E", -"u c #BEBEB6B6BEBE", -"i c #D3D3D3D3D3D3", -"p c #868679798686", -"a c #96969696AEAE", -"s c #181820202020", -"d c #8E8E91918E8E", -"f c #515155554949", -"g c #8E8E86867979", -"h c #A0A0A0A0A0A0", -"j c #B9B9B9B9B9B9", -"k c #AEAEB2B2CFCF", -"l c #FFFFFFFFFFFF", -"z c #616161616161", -"x c #404042424040", -"c c #D7D7DFDFE7E7", -"v c #FFFFFBFBFFFF", -"b c #EDEDEDEDEDED", -"n c #F0F0F0F0F0F0", -"m c #202028285151", -"M c #2F2F4F4F4F4F", -"N c #303034343030", -"B c #AEAE61616161", -"V c #2B2B2B2B2B2B", -" .XXXXXXXXXXXXXX...o", -"O+@@@@#@@#@@#@#$%&*=", -"O@-;::$->$$,<$1%o23=", -"O@-$@4o5&67&&:89$=0=", -"O@$3q&3w-,>1eqr#&+t=", -"Oy0tu3tttiiO&=p#3$0=", -"Oyta&&qwwow&sd2f3-0=", -"Oy0++d+gh$52aj2=3-0=", -"Oyk#lllll&zlllx=3-0=", -"Oy3hllll%rllllx=3$0=", -"Oa3yllc=zlllllx=3-0=", -"Oykyll==llvv lx=3$0=", -"Oak#l%9lvX. lx=3-09", -"Oyk#<2bnOn lllx=3-0=", -"Oa3h. lllllll2=k-0=", -"Oy0:llllllllll==3$0=", -"O#>mMNNNNNNNN2s=3$0=", -"O#>zr==========B:w0=", -"OuteXXcXXXcXXXXett.=", -"arrrrrrrrrrrrrrrrr=V"}; diff --git a/app/fvwm/extras/FvwmScript/Scripts/some_nice_icons/small.tools2_3d.xpm b/app/fvwm/extras/FvwmScript/Scripts/some_nice_icons/small.tools2_3d.xpm deleted file mode 100644 index de17bf64a..000000000 --- a/app/fvwm/extras/FvwmScript/Scripts/some_nice_icons/small.tools2_3d.xpm +++ /dev/null @@ -1,70 +0,0 @@ -/* XPM */ -static char * image_name[] = { -"20 20 47 1", -" c #E9E9E9E9E9E9", -". c #D7D7D3D3D7D7", -"X c #DCDCD8D8DCDC", -"o c #96969696AEAE", -"O c #CCCCCCCCCCCC", -"+ c #B9B9B9B9B9B9", -"@ c #B6B6B2B2B6B6", -"# c #797979797979", -"$ c #D3D3D3D3D3D3", -"% c #BEBEBABABEBE", -"& c #C4C4C4C4C4C4", -"* c #C7C7BABAC7C7", -"= c #CFCFD3D3CFCF", -"- c #717175757171", -"; c #404042424040", -": c #A6A69E9EA6A6", -"> c #666666666666", -", c #6B6B69696B6B", -"< c #555555555555", -"1 c #A6A6A6A6A6A6", -"2 c #BEBEBEBEBEBE", -"3 c #B0B0B0B0B0B0", -"4 c #A6A6A2A2A6A6", -"5 c #5F5F5F5F5F5F", -"6 c #8E8E8A8A8E8E", -"7 c #AEAEAEAEB6B6", -"8 c #AEAEB2B2CFCF", -"9 c #B6B6AEAEB6B6", -"0 c #9E9E9A9A9E9E", -"q c #717179798686", -"w c #AEAEAAAAAEAE", -"e c #999999999999", -"r c #909090909090", -"t c #303034343030", -"y c #AAAAAAAAAAAA", -"u c #969696969696", -"i c #494949495151", -"p c #696969697171", -"a c #A9A9A9A9A9A9", -"s c #AEAEAEAEAEAE", -"d c #2F2F4F4F4F4F", -"f c #969692929696", -"g c #BEBEB6B6BEBE", -"h c #696908080808", -"j c #515155554949", -"k c #404040400000", -"l c #202028285151", -" .................Xo", -"O++@++@++++++++++@O#", -"O@++++++++++++++++$#", -"O@@%+@&&&&&&&**%@+=-", -"O@+@++%;:>-,<<12+3O-", -"O@@@+%456#1788#3+@O-", -"&9@@@%0#6<,,<-6q*@&-", -"&w999@+;e+*rt2,-%9&-", -"&y999@@;r%%ui%+@@9&p", -"&awws@+df%gud+@www&p", -"*4wyy@uh,88,hf@wwy*p", -"&4awa8jhh77khj8aay%p", -"*4aaa8jhk77kh<8aaa%p", -"%4aaa8<hk77kh<8a4a%p", -"%:444+jhk77khj+444+,", -"+04:4@jhh11khj@44:@>", -"+0:::y6h>77,h6y:::@>", -"@e00::ao4444ea:0009>", -"%w9@@9@@@@9@+3@@9@&>", -"q<<<<<<<<<<<<<<<<<<l"}; diff --git a/app/fvwm/extras/FvwmScript/Scripts/some_nice_icons/window.xpm b/app/fvwm/extras/FvwmScript/Scripts/some_nice_icons/window.xpm deleted file mode 100644 index 960b113b7..000000000 --- a/app/fvwm/extras/FvwmScript/Scripts/some_nice_icons/window.xpm +++ /dev/null @@ -1,58 +0,0 @@ -/* XPM */ -static char * window_xpm[] = { -"56 46 9 1", -" c None", -". c #FFFFFFFFFFFF", -"X c #FFFFFBFBFFFF", -"o c #DEDEDBDBDEDE", -"O c #8C8C8E8E8C8C", -"+ c #FFFFF3F3FFFF", -"@ c #BDBDB6B6BDBD", -"# c #00000000FFFF", -"$ c #4A4AD7D7BDBD", -" ", -" ", -" ", -" ", -" ", -" ........................................... ", -" XoooOXoooooooooooooooooooooooooooOXoooOXoooO ", -" XoOoO+oooooooooooooooooooooooooooOXoOoOXoOoO ", -" XoooOXoooooooooooooooooooooooooooOXoooOXoooO ", -" @OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO ", -" XO######################################...O ", -" XO######################################.ooO ", -" XO######################################.ooO ", -" XO######################################.ooO ", -" XO######################################.ooO ", -" XO######################################.ooO ", -" XO######################################.ooO ", -" XO######################################.ooO ", -" XO##############.................................. ", -" XO##############.oooO.oooooooooooooooooO.oooO.ooo. ", -" XO##############.oOoO.oooooooooooooooooO.oOoO.oOo. ", -" XO##############.oooO.oooooooooooooooooO.oooO.ooo. ", -" XO##############.OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO ", -" XO##############.O$$$$$$$$$$$$$$$$$$$$$$$$$$$$...O ", -" XO##############.O$$$$$$$$$$$$$$$$$$$$$$$$$$$$.ooO ", -" XO##############.O$$$$$$$$$$$$$$$$$$$$$$$$$$$$.ooO ", -" +O##############.O$$$$$$$$$$$$$$$$$$$$$$$$$$$$.ooO ", -" XO##############.O$$$$$$$$$$$$$$$$$$$$$$$$$$$$.ooO ", -" XO##############.O$$$$$$$$$$$$$$$$$$$$$$$$$$$$.ooO ", -" XO##############.O$$$$$$$$$$$$$$$$$$$$$$$$$$$$.ooO ", -" +O##############.O$$$$$$$$$$$$$$$$$$$$$$$$$$$$.ooO ", -" XO##############.O$$$$$$$$$$$$$$$$$$$$$$$$$$$$.ooO ", -" +O##############.O$$$$$$$$$$$$$$$$$$$$$$$$$$$$.ooO ", -" XO##############.O$$$$$$$$$$$$$$$$$$$$$$$$$$$$.ooO ", -" +O##############.O$$$$$$$$$$$$$$$$$$$$$$$$$$$$.ooO ", -" XOXXXXXXXXXXXXXX.O$$$$$$$$$$$$$$$$$$$$$$$$$$$$.ooO ", -" +OOOOOOOOOOOOOOO.O$$$$$$$$$$$$$$$$$$$$$$$$$$$$.ooO ", -" .O$$$$$$$$$$$$$$$$$$$$$$$$$$$$.ooO ", -" .O$$$$$$$$$$$$$$$$$$$$$$$$$$$$.ooO ", -" .O$$$$$$$$$$$$$$$$$$$$$$$$$$$$.ooO ", -" .OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO ", -" ", -" ", -" ", -" ", -" "}; diff --git a/app/fvwm/extras/FvwmScript/Scripts/system.fvwmrc b/app/fvwm/extras/FvwmScript/Scripts/system.fvwmrc deleted file mode 100644 index 22eb2d462..000000000 --- a/app/fvwm/extras/FvwmScript/Scripts/system.fvwmrc +++ /dev/null @@ -1,411 +0,0 @@ -############################################## -# Don't change the beginning of this file !!!# -############################################## - -#DeskSetup,4749 -KillModule FvwmAuto -ChangeDefaultFocus SloppyFocus -EdgeScroll 0 0 -ColormapFocus FollowsMouse -OpaqueMoveSize 10 -DeskTopSize 4 2 -#end - -#MenuSetup,1 -MenuStyle #000000 #d0d0d0 Black -adobe-times-bold-r-*-*-12-*-*-*-*-*-*-* mwm -#end - -#WinSetup,1 -WindowFont -adobe-times-bold-r-*-*-14-*-*-*-*-*-*-* -IconFont -adobe-helvetica-bold-r-*-*-10-*-*-*-*-*-*-* -HilightColor Yellow #5c54c0 -Style "*" BorderWidth 10, HandleWidth 10,IconBox 580x400-0-0 -Style "*" Icon unknown1.xpm, Color #AAFF00/RoyalBlue -Style "*" ActivePlacement, SmartPlacement,SkipMapping -Style "*" MWMFunctions,HintOverride,MWMBorder -Style "*" DecorateTransient -#end - - -############################################## -# Here, you can modify this file # -############################################## - - -# small up triangle -ButtonStyle 2 4 50x35@1 65x65@0 35x65@0 50x35@1 -# small down triangle -ButtonStyle 4 4 50x65@1 35x35@1 65x35@1 50x65@0 - -# some other ButtonStyles: -# large up triangle -#ButtonStyle 2 4 50x25@1 75x75@0 25x75@0 50x25@1 -# large down triangle -#ButtonStyle 4 4 50x75@1 25x25@1 75x25@1 50x75@0 -# big box -#ButtonStyle 2 5 25x25@1 25x75@1 75x75@0 75x25@0 25x25@1 -# little box -#ButtonStyle 8 5 40x40@1 60x40@1 60x60@0 40x60@0 40x40@1 -# tall box -#ButtonStyle 6 5 40x25@1 60x25@1 60x75@0 40x75@0 40x25@1 -# dot -#ButtonStyle 4 5 45x45@1 55x45@1 55x55@0 45x55@0 45x45@1 -# an up arrow: -#ButtonStyle 2 8 40x80@1 40x50@1 20x50@1 50x20@1 80x50@0 60x50@0 60x80@0 40x80@0 -# an X -#ButtonStyle 3 13 26x29@1 34x21@1 50x35@1 70x21@1 79x29@1 63x48@0 79x65@1 70x75@0 50x61@0 34x75@0 26x65@0 44x48@1 26x29@0 - - - -ModulePath /usr/lib/X11/fvwm -PixmapPath /usr/X11/lib/TkDesk/images/next/:/usr/include/X11/pixmaps/:/usr/X11R6/include/X11/mini-icons/:/usr/X11R6/include/X11/3dpixmaps/normal:/usr/X11R6/include/X11/3dpixmaps/next/:/usr/X11R6/include/X11/3dpixmaps/small -IconPath /usr/X11/lib/TkDesk/images/next/:/usr/X11R6/include/X11/pixmaps/:/usr/X11R6/include/X11/mini-icons/ - -*FvwmScriptPath /usr/X11/lib/X11/fvwm - -ClickTime 750 -# EdgeResistance 0 0 - - -Style "Fvwm*" NoHandles, Sticky, WindowListSkip, -Style "Fvwm*" BorderWidth 8,CirculateSkipIcon -Style "FvwmButtons" NoTitle, NoHandles, Sticky, WindowListSkip -Style "FvwmButtons" BorderWidth 8, CirculateSkip -Style "FvwmButtons" Icon toolbox.xpm -Style "FvwmIdent" Title -Style "xbiff" NoTitle, Sticky, WindowListSkip -Style "Maker" StartsOnDesk 1,RandomPlacement -Style "rxvt" Icon term.xpm,SloppyFocus -Style "XTerm" Icon xterm.xpm -Style "Appointment" Icon datebook.xpm, NoButton 2, NoButton 4 -Style "xcalc" Icon xcalc.xpm, NoButton 2 -Style "xmh" Icon mail1.xpm, NoIconTitle,StickyIcon -Style "xmh" RandomPlacement, StartsOnDesk 2, NoButton 2 -Style "xman" Icon xman.xpm,RandomPlacement -Style "xvgr" Icon graphs.xpm,RandomPlacement -Style "matlab" Icon math4.xpm -Style "xmag" Icon mag_glass.xpm,RandomPlacement -Style "xgraph" Icon graphs.xpm,RandomPlacement -Style "sppeed6" Icon math3.xpm,NoTitle -Style "sppeed6_user" Icon math4.xpm,NoTitle -Style "xmosaic" NoPPosition, color Green/Yellow -Style "textedit" Icon editor.xpm -Style "Edit" BorderWidth 5, HandleWidth 2,NoHandles, NoButton 2, NoButton 4 -Style "Edit" SloppyFocus,StaysOnTop, WindowListSkip -Style "/mnt/floppy/" Icon floppy.xpm -Style "/mnt/cdrom/" Icon cdisc.xpm -Style "TkDesk Application Bar" Sticky, WindowListSkip, CirculateSkip,BorderWidth 0,NoTitle, NoHandles -Style "Disk Usage" NoHandles, BorderWidth 8, NoButton 4,NoButton 2 -Style "Background #1" NoHandles, BorderWidth 8, NoButton 4,NoButton 2 -Style "Job Control" NoHandles, BorderWidth 8, NoButton 4,NoButton 2 -Style "Find Files" NoHandles, BorderWidth 8, NoButton 4,NoButton 2 -Style "Delete Files" NoHandles, BorderWidth 8, NoButton 4,NoButton 2 -Style "File Information" NoHandles, BorderWidth 8, NoButton 4,NoButton 2 -Style "Rename File" NoHandles, BorderWidth 8, NoButton 4,NoButton 2 -Style "Copy, Move, Link Files" NoHandles, BorderWidth 8, NoButton 4,NoButton 2 -Style "New File" NoHandles, BorderWidth 8, NoButton 4,NoButton 2 -Style "New Directory" NoHandles, BorderWidth 8, NoButton 4,NoButton 2 -Style "Info" NoHandles, BorderWidth 8, NoButton 4,NoButton 2 -Style "Execute" NoHandles, BorderWidth 8, NoButton 4,NoButton 2 -Style "Control" NoHandles, BorderWidth 8, NoButton 4,NoButton 2 -Style "File modified" NoHandles, BorderWidth 8, NoButton 4,NoButton 2 -Style "Starting..." NoHandles, BorderWidth 8, NoButton 4,NoButton 2,NoButton 1 -Style "File exists" NoHandles, BorderWidth 8, NoButton 4,NoButton 2,NoButton 1 -Style "TkMan v1.7.3" Icon xman.xpm -Style "Logout" NoHandles, BorderWidth 8, NoButton 4,NoButton 2,Sticky,StaysOnTop -Style "shutdown" NoHandles, NoTitle, BorderWidth 8, NoButton 4,NoButton 1,NoButton 2 ,Sticky,StaysOnTop -Style "Screen Setup" NoHandles, BorderWidth 8, NoButton 4,NoButton 2 -Style "Bell Setup" NoHandles, BorderWidth 8, NoButton 4,NoButton 2 -Style "Keyboard Setup" NoHandles, BorderWidth 8, NoButton 4,NoButton 2 -Style "Pointer Setup" NoHandles, BorderWidth 8, NoButton 4,NoButton 2 -Style "Date" NoHandles, BorderWidth 8, NoButton 4,NoButton 2 -Style "Confirmation" NoHandles, BorderWidth 8, NoButton 4,NoButton 2 - - -Mouse 1 R A Menu Utilities Nop -Mouse 2 R A Menu Window-Ops Nop -Mouse 3 R A WindowList -Mouse 1 1 A Raise-or-Delete -Mouse 2 1 A Menu Window-Ops2 -Mouse 3 1 A RaiseLower -Mouse 0 2 A Maximize-Func -Mouse 0 4 A Iconify -Mouse 1 F A Resize-or-Raise -Mouse 1 T A Move-or-Raise -Mouse 1 S A Resize-or-Raise -Mouse 1 I A Move-or-Iconify -Mouse 2 I A Menu Window-Ops Nop -Mouse 2 FST A Menu Window-Ops2 Nop -Mouse 3 TSIF A RaiseLower - - -########################Initialization Functions ############################ -AddToFunc InitFunction "I" Module FvwmScript Buttons -#+ "I" Module FvwmButtons -#+ "I" Module FvwmBacker -#+ "I" Module FvwmAudio - -AddToFunc RestartFunction "I" Module FvwmScript Buttons -#+ "I" Module FvwmBacker -#+ "I" Module FvwmAudio -########################Menus ######################################## - -# The following menus form the bulk of the menu system I have hanging -# off the GoodStuff module; they contain most of my commonly used -# X-based tools. Note that I use rxvt instead of xterm for most of my -# shells due to memory constraints; if you use xterms or some variant -# thereof (aixterm, cxterm, kxterm, etc.) you'll need to change quite -# a few things. --tabaer@magnus - -# A menu of VT100 size shells -AddToMenu "80x25" "80x25 Shells" Nop -+ "" Nop -+ "Black on white" Exec exec color_xterm -sb -ls -geometry 80x25 -fg Black -bg White & -+ "Gold on black" Exec exec color_xterm -sb -ls -geometry 80x25 -fg gold1 -bg Black & -+ "Green on black" Exec exec color_xterm -sb -ls -geomtery 80x25 -fg green2 -bg Black & -+ "White on black" Exec exec color_xterm -sb -ls -geometry 80x25 -fg White -bg Black & -+ "Yellow on blue" Exec exec color_xterm -sb -ls -geometry 80x25 -fg Yellow -bg Blue & - -# A menu of slightly larger shells -AddToMenu "80x40" "80x40 Shells" Nop -+ "" Nop -+ "Black on gray" Exec exec color_xterm -sb -ls -geometry 80x40 -fg Black -bg LightGray & -+ "Black on white" Exec exec color_xterm -sb -ls -geometry 80x40 -fg Black -bg White & -+ "Gold on black" Exec exec color_xterm -sb -ls -geometry 80x40 -fg gold1 -bg Black & -+ "Green on black" Exec exec color_xterm -sb -ls -geometry 80x40 -fg green2 -bg Black & -+ "White on black" Exec exec xterm -sb -ls -geometry 80x40 -fg White -bg Black & -+ "Yellow on blue" Exec exec xterm -sb -ls -geometry 80x40 -fg Yellow -bg Blue & - -AddToMenu "Pict" "Pict viewer" Nop -+ "" Nop -+ "Loupe" Exec exec xmag & -+ "Bitmap Viewer" Exec exec bitmap & -+ "PostScript Previewer" Exec exec ghostview -magstep 1 & -+ "XV" Exec exec xv & -+ "XFigure" Exec exec xfig & -+ "XPaint" Exec exec xpaint & - -AddToMenu "Prog" "Development" Nop -+ "" Nop -+ "EditRes" Exec exec editres & -+ "Lisp" Exec exec xterm -sb -bg grey -e clisp & -+ "XXGdb" Exec exec xxgdb & -+ "Environnement C" Exec exec xwpe & - -# A set of NASTY time killers... -AddToMenu "Games" "Games" Nop -+ "" Nop -+ "GnuChess" Exec exec xboard & -+ "Lander" Exec exec xlander & -+ "Xgalaga" Exec exec xgal & -+ "Xeyes" Exec exec xeyes & -+ "Xhextris" Exec exec xhextris & -+ "Xlogo" Exec exec xlogo & -+ "Xmahjongg" Exec exec xmahjongg & -+ "Xtetris" Exec exec xtetris & -+ "Xvier" Exec exec xvier & -+ "Doom" Exec exec xdoom & - -AddToMenu "ScreenSaver" "Screen Saver" Nop -+ "" Nop -+ "Bat" Exec exec xlock -nolock -nice 0 -mode bat & -+ "Blank" Exec exec xlock -nolock -nice 0 -mode blank & -+ "Blot" Exec exec xlock -nolock -nice 0 -mode blot & -+ "Bob" Exec exec xlock -nolock -nice 0 -mode bob & -+ "Bounce" Exec exec xlock -nolock -nice 0 -mode bounce & -+ "Flame" Exec exec xlock -nolock -nice 0 -mode flame & -+ "Galaxy" Exec exec xlock -nolock -nice 0 -mode galaxy & -+ "Grav" Exec exec xlock -nolock -nice 0 -mode grav & -+ "Helix" Exec exec xlock -nolock -nice 0 -mode helix & -+ "Hop" Exec exec xlock -nolock -nice 0 -mode hop & -+ "Hyper" Exec exec xlock -nolock -nice 0 -mode hyper & -+ "Kaleid" Exec exec xlock -nolock -nice 0 -mode kaleid & -+ "Life" Exec exec xlock -nolock -nice 0 -mode life & -+ "Life3d" Exec exec xlock -nolock -nice 0 -mode life3d & -+ "Maze" Exec exec xlock -nolock -nice 0 -mode maze & -+ "Pyro" Exec exec xlock -nolock -nice 0 -mode pyro & -+ "Qix" Exec exec xlock -nolock -nice 0 -mode qix & -+ "Random" Exec exec xlock -nolock -nice 0 -mode random & -+ "Rect" Exec exec xlock -nolock -nice 0 -mode rect & -+ "Rock" Exec exec xlock -nolock -nice 0 -mode rock & -+ "Rotor" Exec exec xlock -nolock -nice 0 -mode rotor & - -# Menu of silly things every X setup should have -AddToMenu "Toys" "Toys" Nop -+ "" Nop -+ "X-Eyes" Exec exec xeyes & -+ "X-Roaches" Exec exec xroach & - -# Here are the top-level menus hanging off GoodStuff. As you'll see, -# they call other menus a lot. --tabaer@magnus - -AddToMenu "Shells" "Shells" Nop -+ "" Nop -+ "80x25" PopUp 80x25 -+ "80x40" PopUp 80x40 -# This defines the most common window operations -# As with the key bindings (see below), these were appropriated from -# a stock SGI .4Dwmrc file - -AddToMenu "Utilities" "Tools" Nop -+ "" Nop -+ "Clipboard" Exec exec xclipboard & -+ "Lecture CD audio" Exec exec workman & -+ "Eject CD Rom" Exec exec eject & -+ "Réglage son" Exec exec xmix & -+ "Format disquette" Exec exec /sbin/formatdos & -+ "MemInfo" Exec meminfo & -+ "Restart fvwm" Restart fvwm -+ "Shells" PopUp Shells -+ "Pict viewer" PopUp Pict -+ "Development" PopUp Prog -+ "Modules" Popup Module-Popup -+ "Demos" Popup Demos -+ "ScreenSavers" Popup ScreenSaver - - -AddToMenu "Demos" "Demos" Nop -+ "" Nop -+ "X Demos and Toys" PopUp Toys -+ "X Games" PopUp Games - - - -AddToMenu Window-Ops "Window Ops" Title -+ "Move%mini.move.xpm%" Move-or-Raise2 -+ "Resize%mini.resize.xpm%" Resize-or-Raise2 -+ "Raise%mini.raise.xpm%" Raise -+ "Lower%mini.lower.xpm%" Lower -+ "(De)Iconify" Iconify -+ "(Un)Stick" Stick -+ "(Un)Maximize" maximize_func -+ "" Nop -+ "Delete%mini.destroy.xpm%" Delete -+ "Close%mini.destroy.xpm%" Close -+ "Destroy%mini.destroy.xpm%" Destroy -+ "" Nop -+ "Refresh Screen" Refresh -AddToMenu Window-Ops2 "Move%mini.move.xpm%" Move-or-Raise2 -+ "Resize%mini.resize.xpm%" Resize-or-Raise2 -+ "Raise%mini.raise.xpm%" Raise -+ "Lower%mini.lower.xpm%" Lower -+ "(De)Iconify" Iconify -+ "(Un)Stick" Stick -+ "(Un)Maximize" maximize_func -+ "" Nop -+ "Delete%mini.destroy.xpm%" Delete -+ "Close%mini.destroy.xpm%" Close -+ "Destroy%mini.destroy.xpm%" Destroy -+ "" Nop -+ "ScrollBar" Module FvwmScroll 2 2 -+ "Print" PrintFunction - -AddToMenu Module-Popup "Modules" Title -+ "Button-Bar" Module FvwmButtons -+ "Clean-Up" Module FvwmClean -+ "Identify" Module FvwmIdent -+ "SaveDesktop" Module FvwmSave -+ "WinList" Module FvwmWinList -+ "Background" Module FvwmBacker -+ "IconBox" Module FvwmIconBox -+ "Banner" Module FvwmBanner -+ "Talk" Module FvwmConsole -+ "Configuration" Module FvwmConfig - -########################Functions ######################################## - -AddToFunc MailFunction "I" Next [$0] Iconify -1 -+ "I" Next [$0] focus -+ "I" None [$0] Exec $0 $1 - -AddToFunc Move-or-Raise "I" Raise -+ "M" Move -+ "D" Maximize 100 100 - -AddToFunc Move-or-Raise2 "M" Raise -+ "M" Move -+ "D" Lower - -AddToFunc Maximize-Func "M" Maximize 0 100 -+ "C" Maximize 0 80 -+ "D" Maximize 100 100 - -AddToFunc Move-or-Iconify "I" Raise -+ "M" Move -+ "D" Iconify - -AddToFunc Resize-or-Raise "I" Raise -+ "M" Resize -+ "D" Lower - -AddToFunc Resize-or-Raise2 "M" Raise -+ "M" Resize -+ "D" Lower - -AddToFunc PrintFunction "I" Raise -+ "I" Exec xdpr -id $w - -AddToFunc Iconify-and-Raise "I" Iconify -+ "I" Raise - -AddToFunc Raise-or-Delete "D" Close - - -########################## Window-Identifier ############################### -# Just choose colors and a fonts -*FvwmIdentBack MidnightBlue -*FvwmIdentFore Yellow -*FvwmIdentFont -adobe-helvetica-medium-r-*-*-12-*-*-*-*-*-*-* - -########################### Pager ######################################### -*FvwmPagerBack Grey85 -*FvwmPagerFore Black -*FvwmPagerFont -adobe-helvetica-bold-r-*-*-10-*-*-*-*-*-*-* -*FvwmPagerHilight Grey70 -*FvwmPagerGeometry 130x56-1500-1500 -*FvwmPagerLabel 0 FvwmPager -*FvwmPagerSmallFont 5x8 - - - -*FvwmBackerDesk 0 xpmroot /usr/X11/include/X11/pixmaps/Xlogo.xpm -*FvwmBackerDesk 1 xpmroot /usr/X11/include/X11/pixmaps/fond1.xpm - -*FvwmScrollBack grey40 -*FvwmScrollFore green - -############################################################ -############################################################ -# Note that icons are shown in the module -# only if NoIcon commnand is applied. -#Style "*" NoIcon - -############################################################ - - - - - -#*FvwmAudioPlayCmd playsnd -#*FvwmAudioDir /usr/lib/sounds -#*FvwmAudioDelay 0 -#*FvwmAudio startup exit.raw -#*FvwmAudio shutdown exit.raw -#*FvwmAudio iconify icon.raw -#*FvwmAudio deiconify deicon.raw -#*FvwmAudio unknown defaut.raw -#*FvwmAudio destroy_window close.raw - - - -*FvwmWinListBack DarkOliveGreen -*FvwmWinListFore PaleGoldenRod -*FvwmWinListFont -*-new century schoolbook-bold-r-*-*-*-120-*-*-*-*-*-* -*FvwmWinListAction Click1 Focus,Iconify -1,Focus -*FvwmWinListAction Click2 Iconify -*FvwmWinListAction Click3 Module "FvwmIdent" FvwmIdent -*FvwmWinListUseSkipList -*FvwmWinListUseIconNames -*FvwmWinListGeometry -50-85 -# I like it achored -*FvwmWinListNoAnchor diff --git a/app/fvwm/extras/FvwmScript/TODO b/app/fvwm/extras/FvwmScript/TODO deleted file mode 100644 index 9533c9e39..000000000 --- a/app/fvwm/extras/FvwmScript/TODO +++ /dev/null @@ -1,7 +0,0 @@ -Write many new scripts for - - printer manager - - kernel modules - - disk manager - - customize Fvwm options - - choose color (similar to FileBrowser) - - ...
\ No newline at end of file diff --git a/app/fvwm/extras/FvwmScript/Widgets/CheckBox.c b/app/fvwm/extras/FvwmScript/Widgets/CheckBox.c deleted file mode 100644 index c530267e6..000000000 --- a/app/fvwm/extras/FvwmScript/Widgets/CheckBox.c +++ /dev/null @@ -1,204 +0,0 @@ -#include "Tools.h" - -/***********************************************/ -/* Fonction pour CheckBox */ -/***********************************************/ -void InitCheckBox(struct XObj *xobj) -{ - unsigned long mask; - XSetWindowAttributes Attr; - int asc,desc,dir; - XCharStruct struc; - - /* Enregistrement des couleurs et de la police */ - MyAllocNamedColor(xobj->display,*xobj->colormap,xobj->forecolor,&xobj->TabColor[fore]); - MyAllocNamedColor(xobj->display,*xobj->colormap,xobj->backcolor,&xobj->TabColor[back]); - MyAllocNamedColor(xobj->display,*xobj->colormap,xobj->licolor,&xobj->TabColor[li]); - MyAllocNamedColor(xobj->display,*xobj->colormap,xobj->shadcolor,&xobj->TabColor[shad]); - MyAllocNamedColor(xobj->display,*xobj->colormap,"#000000",&xobj->TabColor[black]); - MyAllocNamedColor(xobj->display,*xobj->colormap,"#FFFFFF",&xobj->TabColor[white]); - - mask=0; - Attr.background_pixel=xobj->TabColor[back].pixel; - mask|=CWBackPixel; - Attr.cursor=XCreateFontCursor(xobj->display,XC_hand2); - mask|=CWCursor; /* Curseur pour la fenetre */ - - xobj->win=XCreateWindow(xobj->display,*xobj->ParentWin, - xobj->x,xobj->y,xobj->width,xobj->height,0, - CopyFromParent,InputOutput,CopyFromParent, - mask,&Attr); - xobj->gc=XCreateGC(xobj->display,xobj->win,0,NULL); - XSetForeground(xobj->display,xobj->gc,xobj->TabColor[fore].pixel); - XSetBackground(xobj->display,xobj->gc,xobj->TabColor[back].pixel); - if ((xobj->xfont=XLoadQueryFont(xobj->display,xobj->font))==NULL) - fprintf(stderr,"Can't load font %s\n",xobj->font); - else - XSetFont(xobj->display,xobj->gc,xobj->xfont->fid); - - XSetLineAttributes(xobj->display,xobj->gc,1,LineSolid,CapRound,JoinMiter); - - /* Redimensionnement du widget */ - XTextExtents(xobj->xfont,"lp",strlen("lp"),&dir,&asc,&desc,&struc); - xobj->height=asc+desc+5; - xobj->width=XTextWidth(xobj->xfont,xobj->title,strlen(xobj->title))+30; - XResizeWindow(xobj->display,xobj->win,xobj->width,xobj->height); -} - -void DestroyCheckBox(struct XObj *xobj) -{ - XFreeFont(xobj->display,xobj->xfont); - XFreeGC(xobj->display,xobj->gc); - XDestroyWindow(xobj->display,xobj->win); -} - -void DrawCheckBox(struct XObj *xobj) -{ - XSegment segm[2]; - int asc,desc,dir; - XCharStruct struc; - - /* Dessin du rectangle arrondi */ - XTextExtents(xobj->xfont,"lp",strlen("lp"),&dir,&asc,&desc,&struc); - DrawReliefRect(0,asc-11,15,15,xobj,xobj->TabColor[li].pixel, - xobj->TabColor[shad].pixel,xobj->TabColor[black].pixel,0); - - /* Calcul de la position de la chaine de charactere */ - DrawString(xobj->display,xobj->gc,xobj->win,23, - asc,xobj->title, - strlen(xobj->title),xobj->TabColor[fore].pixel, - xobj->TabColor[li].pixel,xobj->TabColor[back].pixel, - !xobj->flags[1]); - /* Dessin de la croix */ - if (xobj->value) - { - XSetLineAttributes(xobj->display,xobj->gc,2,LineSolid,CapProjecting,JoinMiter); - segm[0].x1=5; - segm[0].y1=5+asc-11; - segm[0].x2=9; - segm[0].y2=9+asc-11; - segm[1].x1=5; - segm[1].y1=9+asc-11; - segm[1].x2=9; - segm[1].y2=5+asc-11; - XSetForeground(xobj->display,xobj->gc,xobj->TabColor[black].pixel); - XDrawSegments(xobj->display,xobj->win,xobj->gc,segm,2); - XSetLineAttributes(xobj->display,xobj->gc,1,LineSolid,CapRound,JoinMiter); - } -} - -void EvtMouseCheckBox(struct XObj *xobj,XButtonEvent *EvtButton) -{ - static XEvent event; - int End=1; - unsigned int modif; - int x1,x2,y1,y2; - Window Win1,Win2; - Window WinBut=0; - int In; - XSegment segm[2]; - int asc,desc,dir; - XCharStruct struc; - - while (End) - { - XNextEvent(xobj->display, &event); - switch (event.type) - { - case EnterNotify: - XQueryPointer(xobj->display,*xobj->ParentWin, - &Win1,&Win2,&x1,&y1,&x2,&y2,&modif); - if (WinBut==0) - { - WinBut=Win2; - /* Mouse on button */ - XTextExtents(xobj->xfont,"lp",strlen("lp"),&dir,&asc,&desc,&struc); - DrawReliefRect(0,asc-11,15,15,xobj,xobj->TabColor[shad].pixel, - xobj->TabColor[li].pixel,xobj->TabColor[black].pixel,0); - In=1; - } - else - { - if (Win2==WinBut) - { - /* Mouse on button */ - DrawReliefRect(0,asc-11,15,15,xobj,xobj->TabColor[shad].pixel, - xobj->TabColor[li].pixel,xobj->TabColor[black].pixel,0); - In=1; - } - else if (In) - { - In=0; - /* Mouse not on button */ - DrawReliefRect(0,asc-11,15,15,xobj,xobj->TabColor[li].pixel, - xobj->TabColor[shad].pixel,xobj->TabColor[black].pixel,0); - } - } - break; - case LeaveNotify: - XQueryPointer(xobj->display,*xobj->ParentWin, - &Win1,&Win2,&x1,&y1,&x2,&y2,&modif); - if (Win2==WinBut) - { - In=1; - /* Mouse on button */ - DrawReliefRect(0,asc-11,15,15,xobj,xobj->TabColor[shad].pixel, - xobj->TabColor[li].pixel,xobj->TabColor[black].pixel,0); - } - else if (In) - { - /* Mouse not on button */ - DrawReliefRect(0,asc-11,15,15,xobj,xobj->TabColor[li].pixel, - xobj->TabColor[shad].pixel,xobj->TabColor[black].pixel,0); - In=0; - } - break; - case ButtonRelease: - End=0; - /* Mouse not on button */ - if (In) - { - /* Envoie d'un message vide de type SingleClic pour un clique souris */ - xobj->value=!xobj->value; - DrawReliefRect(0,asc-11,15,15,xobj,xobj->TabColor[li].pixel, - xobj->TabColor[shad].pixel,xobj->TabColor[black].pixel,0); - SendMsg(xobj,SingleClic); - } - if (xobj->value) - { - XSetLineAttributes(xobj->display,xobj->gc,2,LineSolid,CapProjecting,JoinMiter); - segm[0].x1=5; - segm[0].y1=5+asc-11; - segm[0].x2=9; - segm[0].y2=9+asc-11; - segm[1].x1=5; - segm[1].y1=9+asc-11; - segm[1].x2=9; - segm[1].y2=5+asc-11; - XSetForeground(xobj->display,xobj->gc,xobj->TabColor[black].pixel); - XDrawSegments(xobj->display,xobj->win,xobj->gc,segm,2); - XSetLineAttributes(xobj->display,xobj->gc,1,LineSolid,CapRound,JoinMiter); - } - else - { - XSetForeground(xobj->display,xobj->gc,xobj->TabColor[back].pixel); - XFillRectangle(xobj->display,xobj->win,xobj->gc,3,asc-8,9,9); - } - break; - } - } -} - -void EvtKeyCheckBox(struct XObj *xobj,XKeyEvent *EvtKey) -{ -} - - -void ProcessMsgCheckBox(struct XObj *xobj,unsigned long type,unsigned long *body) -{ -} - - - - - diff --git a/app/fvwm/extras/FvwmScript/Widgets/HDipstick.c b/app/fvwm/extras/FvwmScript/Widgets/HDipstick.c deleted file mode 100644 index 54f1884e3..000000000 --- a/app/fvwm/extras/FvwmScript/Widgets/HDipstick.c +++ /dev/null @@ -1,85 +0,0 @@ -#include "Tools.h" - - -/***********************************************/ -/* Fonction pour HDipstick */ -/* Création d'une jauge horizontale */ -/* plusieurs options */ -/***********************************************/ -void InitHDipstick(struct XObj *xobj) -{ - unsigned long mask; - XSetWindowAttributes Attr; - - /* Enregistrement des couleurs et de la police */ - MyAllocNamedColor(xobj->display,*xobj->colormap,xobj->forecolor,&xobj->TabColor[fore]); - MyAllocNamedColor(xobj->display,*xobj->colormap,xobj->backcolor,&xobj->TabColor[back]); - MyAllocNamedColor(xobj->display,*xobj->colormap,xobj->licolor,&xobj->TabColor[li]); - MyAllocNamedColor(xobj->display,*xobj->colormap,xobj->shadcolor,&xobj->TabColor[shad]); - MyAllocNamedColor(xobj->display,*xobj->colormap,"#000000",&xobj->TabColor[black]); - MyAllocNamedColor(xobj->display,*xobj->colormap,"#FFFFFF",&xobj->TabColor[white]); - - /* Minimum size */ - if (xobj->width<30) - xobj->width=30; - if (xobj->height<11) - xobj->height=11; - - mask=0; - Attr.background_pixel=x11base->TabColor[back].pixel; - mask|=CWBackPixel; - xobj->win=XCreateWindow(xobj->display,*xobj->ParentWin, - xobj->x,xobj->y,xobj->width,xobj->height,0, - CopyFromParent,InputOutput,CopyFromParent, - mask,&Attr); - xobj->gc=XCreateGC(xobj->display,xobj->win,0,NULL); - XSetForeground(xobj->display,xobj->gc,xobj->TabColor[fore].pixel); - XSetBackground(xobj->display,xobj->gc,x11base->TabColor[back].pixel); - XSetLineAttributes(xobj->display,xobj->gc,1,LineSolid,CapRound,JoinMiter); - - if (xobj->value2>xobj->value3) - xobj->value3=xobj->value2+50; - if (xobj->value<xobj->value2) - xobj->value=xobj->value2; - if (xobj->value>xobj->value3) - xobj->value=xobj->value3; -} - -void DestroyHDipstick(struct XObj *xobj) -{ - XFreeGC(xobj->display,xobj->gc); - XDestroyWindow(xobj->display,xobj->win); -} - -void DrawHDipstick(struct XObj *xobj) -{ - int i; - - i=(xobj->width-4)*(xobj->value-xobj->value2)/(xobj->value3-xobj->value2); - - DrawReliefRect(0,0,xobj->width,xobj->height,xobj, - x11base->TabColor[shad].pixel,x11base->TabColor[li].pixel, - x11base->TabColor[black].pixel,-1); - if (i!=0) - { - DrawReliefRect(2,2,i,xobj->height-4,xobj, - xobj->TabColor[li].pixel,xobj->TabColor[shad].pixel, - xobj->TabColor[black].pixel,-1); - XSetForeground(xobj->display,xobj->gc,xobj->TabColor[back].pixel); - XFillRectangle(xobj->display,xobj->win,xobj->gc,5,5,i-6,xobj->height-10); - } - -} - -void EvtMouseHDipstick(struct XObj *xobj,XButtonEvent *EvtButton) -{ -} - -void EvtKeyHDipstick(struct XObj *xobj,XKeyEvent *EvtKey) -{ -} - - -void ProcessMsgHDipstick(struct XObj *xobj,unsigned long type,unsigned long *body) -{ -} diff --git a/app/fvwm/extras/FvwmScript/Widgets/HScrollBar.c b/app/fvwm/extras/FvwmScript/Widgets/HScrollBar.c deleted file mode 100644 index d406ddb29..000000000 --- a/app/fvwm/extras/FvwmScript/Widgets/HScrollBar.c +++ /dev/null @@ -1,216 +0,0 @@ -#include "Tools.h" - - - -/***********************************************/ -/* Fonction pour HScrollBar */ -/***********************************************/ -void DrawThumbH(struct XObj *xobj) -{ - int x,y,w,h; - XSegment segm; - char str[20]; - int asc,desc,dir; - XCharStruct struc; - - x=3+(xobj->width-36)*(xobj->value-xobj->value2)/(xobj->value3-xobj->value2); - y=xobj->height/2-9; - w=30; - h=18; - DrawReliefRect(x,y,w,h,xobj,xobj->TabColor[li].pixel,xobj->TabColor[shad].pixel, - xobj->TabColor[black].pixel,-1); - segm.x1=x+15; - segm.y1=y+3; - segm.x2=x+15; - segm.y2=y+h-3; - XSetForeground(xobj->display,xobj->gc,xobj->TabColor[shad].pixel); - XDrawSegments(xobj->display,xobj->win,xobj->gc,&segm,1); - segm.x1=x+16; - segm.y1=y+3; - segm.x2=x+16; - segm.y2=y+h-3; - XSetForeground(xobj->display,xobj->gc,xobj->TabColor[li].pixel); - XDrawSegments(xobj->display,xobj->win,xobj->gc,&segm,1); - XSetForeground(xobj->display,xobj->gc,xobj->TabColor[fore].pixel); - - sprintf(str,"%d",xobj->value); - x=x+15-(XTextWidth(xobj->xfont,str,strlen(str))/2); - XTextExtents(xobj->xfont,"lp",strlen("lp"),&dir,&asc,&desc,&struc); - y=y-desc-4; - DrawString(xobj->display,xobj->gc,xobj->win,x,y,str, - strlen(str),xobj->TabColor[fore].pixel, - xobj->TabColor[li].pixel,xobj->TabColor[back].pixel, - !xobj->flags[1]); - -} - -void HideThumbH(struct XObj *xobj) -{ - int x,y; - int asc,desc,dir; - XCharStruct struc; - - x=4+(xobj->width-36)*(xobj->value-xobj->value2)/(xobj->value3-xobj->value2); - y=xobj->height/2-8; - XSetForeground(xobj->display,xobj->gc,xobj->TabColor[back].pixel); - XFillRectangle(xobj->display,xobj->win,xobj->gc,x,y,28,16); - XTextExtents(xobj->xfont,"lp",strlen("lp"),&dir,&asc,&desc,&struc); - XFillRectangle(xobj->display,xobj->win,xobj->gc,x-asc - -desc,y-asc-10,90,asc+desc+2); -} - -void InitHScrollBar(struct XObj *xobj) -{ - unsigned long mask; - XSetWindowAttributes Attr; - int i; - int asc,desc,dir; - XCharStruct struc; - char str[20]; - - /* Enregistrement des couleurs et de la police */ - MyAllocNamedColor(xobj->display,*xobj->colormap,xobj->forecolor,&xobj->TabColor[fore]); - MyAllocNamedColor(xobj->display,*xobj->colormap,xobj->backcolor,&xobj->TabColor[back]); - MyAllocNamedColor(xobj->display,*xobj->colormap,xobj->licolor,&xobj->TabColor[li]); - MyAllocNamedColor(xobj->display,*xobj->colormap,xobj->shadcolor,&xobj->TabColor[shad]); - MyAllocNamedColor(xobj->display,*xobj->colormap,"#000000",&xobj->TabColor[black]); - MyAllocNamedColor(xobj->display,*xobj->colormap,"#FFFFFF",&xobj->TabColor[white]); - - mask=0; - Attr.background_pixel=xobj->TabColor[back].pixel; - mask|=CWBackPixel; - Attr.cursor=XCreateFontCursor(xobj->display,XC_hand2); - mask|=CWCursor; /* Curseur pour la fenetre */ - - xobj->win=XCreateWindow(xobj->display,*xobj->ParentWin, - xobj->x,xobj->y,xobj->width,xobj->height,0, - CopyFromParent,InputOutput,CopyFromParent, - mask,&Attr); - xobj->gc=XCreateGC(xobj->display,xobj->win,0,NULL); - XSetForeground(xobj->display,xobj->gc,xobj->TabColor[fore].pixel); - XSetBackground(xobj->display,xobj->gc,xobj->TabColor[back].pixel); - if ((xobj->xfont=XLoadQueryFont(xobj->display,xobj->font))==NULL) - fprintf(stderr,"Can't load font %s\n",xobj->font); - else - XSetFont(xobj->display,xobj->gc,xobj->xfont->fid); - - XSetLineAttributes(xobj->display,xobj->gc,1,LineSolid,CapRound,JoinMiter); - - if ((xobj->value3-xobj->value2)<=0) - xobj->value3=xobj->value2+10; - if (!((xobj->value>=xobj->value2)&&(xobj->value<=xobj->value3))) - xobj->value=xobj->value2; - XTextExtents(xobj->xfont,"lp",strlen("lp"),&dir,&asc,&desc,&struc); - xobj->height=(asc+desc)*2+30; - sprintf(str,"%d",xobj->value2); - i=XTextWidth(xobj->xfont,str,strlen(str)); - sprintf(str,"%d",xobj->value3); - i=XTextWidth(xobj->xfont,str,strlen(str))+i+20; - if (xobj->width<i) - xobj->width=i; - XResizeWindow(xobj->display,xobj->win,xobj->width,xobj->height); -} - -void DestroyHScrollBar(struct XObj *xobj) -{ - XFreeFont(xobj->display,xobj->xfont); - XFreeGC(xobj->display,xobj->gc); - XDestroyWindow(xobj->display,xobj->win); -} - -void DrawHScrollBar(struct XObj *xobj) -{ - int x,y,w,h; - char str[20]; - int asc,desc,dir; - XCharStruct struc; - - /* Calcul de la taille de l'ascenseur */ - x=0; - y=xobj->height/2-12; - w=xobj->width; - h=24; - DrawReliefRect(x,y,w,h,xobj,xobj->TabColor[shad].pixel,xobj->TabColor[li].pixel, - xobj->TabColor[black].pixel,1); - DrawThumbH(xobj); - - /* Ecriture des valeurs */ - sprintf(str,"%d",xobj->value2); - x=4; - XTextExtents(xobj->xfont,"lp",strlen("lp"),&dir,&asc,&desc,&struc); - y=y+asc+h; - DrawString(xobj->display,xobj->gc,xobj->win,x,y,str, - strlen(str),xobj->TabColor[fore].pixel, - xobj->TabColor[li].pixel,xobj->TabColor[back].pixel, - !xobj->flags[1]); - sprintf(str,"%d",xobj->value3); - x=w-XTextWidth(xobj->xfont,str,strlen(str))-4; - DrawString(xobj->display,xobj->gc,xobj->win,x,y,str, - strlen(str),xobj->TabColor[fore].pixel, - xobj->TabColor[li].pixel,xobj->TabColor[back].pixel, - !xobj->flags[1]); -} - -void EvtMouseHScrollBar(struct XObj *xobj,XButtonEvent *EvtButton) -{ - static XEvent event; - int x,y,w,h; - int oldx=0; - int oldvalue=-1; - int newvalue; - int x1,y1,x2,y2; - Window Win1,Win2; - unsigned int modif; - - x=3+((xobj->width-36)*xobj->value)/(xobj->value3-xobj->value2); - y=xobj->height/2-9; - w=30; - h=18; - - - do - { - /* On suit les mouvements de la souris */ - XQueryPointer(xobj->display,*xobj->ParentWin,&Win1,&Win2,&x1,&y1,&x2,&y2,&modif); - x2=x2-xobj->x; - if (x2<15) x2=15; - if (x2>xobj->width-21) x2=xobj->width-21; - if (oldx!=x2) - { - oldx=x2; - /* calcule de xobj->value */ - newvalue=(x2-15)*xobj->width/(xobj->width-36)*(xobj->value3-xobj->value2)/(xobj->width)+xobj->value2; - if (newvalue!=oldvalue) - { - HideThumbH(xobj); - xobj->value=newvalue; - DrawThumbH(xobj); - oldvalue=newvalue; - SendMsg(xobj,SingleClic); - } - } - } - while (!XCheckTypedEvent(xobj->display,ButtonRelease,&event)); -} - -void EvtKeyHScrollBar(struct XObj *xobj,XKeyEvent *EvtKey) -{ -} - -void ProcessMsgHScrollBar(struct XObj *xobj,unsigned long type,unsigned long *body) -{ -} - - - - - - - - - - - - - - diff --git a/app/fvwm/extras/FvwmScript/Widgets/ItemDraw.c b/app/fvwm/extras/FvwmScript/Widgets/ItemDraw.c deleted file mode 100644 index 4aa30f01a..000000000 --- a/app/fvwm/extras/FvwmScript/Widgets/ItemDraw.c +++ /dev/null @@ -1,110 +0,0 @@ -#include "Tools.h" - - -/***********************************************/ -/* Fonction pour ItemDraw */ -/***********************************************/ -void InitItemDraw(struct XObj *xobj) -{ - unsigned long mask; - XSetWindowAttributes Attr; - int minHeight,minWidth; - int asc,desc,dir; - XCharStruct struc; - - /* Enregistrement des couleurs et de la police */ - MyAllocNamedColor(xobj->display,*xobj->colormap,xobj->forecolor,&xobj->TabColor[fore]); - MyAllocNamedColor(xobj->display,*xobj->colormap,xobj->backcolor,&xobj->TabColor[back]); - MyAllocNamedColor(xobj->display,*xobj->colormap,xobj->licolor,&xobj->TabColor[li]); - MyAllocNamedColor(xobj->display,*xobj->colormap,xobj->shadcolor,&xobj->TabColor[shad]); - MyAllocNamedColor(xobj->display,*xobj->colormap,"#000000",&xobj->TabColor[black]); - MyAllocNamedColor(xobj->display,*xobj->colormap,"#FFFFFF",&xobj->TabColor[white]); - - mask=0; - Attr.background_pixel=xobj->TabColor[back].pixel; - mask|=CWBackPixel; - - xobj->win=XCreateWindow(xobj->display,*xobj->ParentWin, - xobj->x,xobj->y,xobj->width,xobj->height,0, - CopyFromParent,InputOutput,CopyFromParent, - mask,&Attr); - xobj->gc=XCreateGC(xobj->display,xobj->win,0,NULL); - XSetForeground(xobj->display,xobj->gc,xobj->TabColor[fore].pixel); - XSetBackground(xobj->display,xobj->gc,xobj->TabColor[back].pixel); - if ((xobj->xfont=XLoadQueryFont(xobj->display,xobj->font))==NULL) - fprintf(stderr,"Can't load font %s\n",xobj->font); - else - XSetFont(xobj->display,xobj->gc,xobj->xfont->fid); - - XSetLineAttributes(xobj->display,xobj->gc,1,LineSolid,CapRound,JoinMiter); - - /* Redimensionnement du widget */ - if (xobj->icon==NULL) - { - if (strlen(xobj->title)!=0) - { - XTextExtents(xobj->xfont,"lp",strlen("lp"),&dir,&asc,&desc,&struc); - minHeight=asc+desc+2; - minWidth=XTextWidth(xobj->xfont,xobj->title,strlen(xobj->title))+2; - if (xobj->height < minHeight) - xobj->height = minHeight; - if (xobj->width < minWidth) - xobj->width = minWidth; - } - } - else if (strlen(xobj->title)==0) - { - if (xobj->height<xobj->icon_h) - xobj->height=xobj->icon_h; - if (xobj->width<xobj->icon_w) - xobj->width=xobj->icon_w; - } - else - { - if (xobj->icon_w>XTextWidth(xobj->xfont,xobj->title,strlen(xobj->title))+2) - { - if (xobj->width<xobj->icon_w) - xobj->width=xobj->icon_w; - } - else - xobj->width=XTextWidth(xobj->xfont,xobj->title,strlen(xobj->title))+2; - xobj->height=xobj->icon_h+2*(asc+desc+15); - } - XResizeWindow(xobj->display,xobj->win,xobj->width,xobj->height); -} - -void DestroyItemDraw(struct XObj *xobj) -{ - XFreeFont(xobj->display,xobj->xfont); - XFreeGC(xobj->display,xobj->gc); - XDestroyWindow(xobj->display,xobj->win); -} - -void DrawItemDraw(struct XObj *xobj) -{ - - /* Calcul de la position de la chaine de charactere */ - XSetForeground(xobj->display,xobj->gc,xobj->TabColor[back].pixel); - XFillRectangle(xobj->display,xobj->win,xobj->gc,0,0,xobj->width,xobj->height); - DrawIconStr(0,xobj,False); -} - -void EvtMouseItemDraw(struct XObj *xobj,XButtonEvent *EvtButton) -{ -} - -void EvtKeyItemDraw(struct XObj *xobj,XKeyEvent *EvtKey) -{ -} - -void ProcessMsgItemDraw(struct XObj *xobj,unsigned long type,unsigned long *body) -{ -} - - - - - - - - diff --git a/app/fvwm/extras/FvwmScript/Widgets/List.c b/app/fvwm/extras/FvwmScript/Widgets/List.c deleted file mode 100644 index 4d600cc7b..000000000 --- a/app/fvwm/extras/FvwmScript/Widgets/List.c +++ /dev/null @@ -1,446 +0,0 @@ -#include "Tools.h" - -#define BdWidth 2 /* Border width */ -#define SbWidth 15 /* ScrollBar width */ - -/***********************************************/ -/* Fonction pour Liste */ -/***********************************************/ -void InitList(struct XObj *xobj) -{ - unsigned long mask; - XSetWindowAttributes Attr; - int asc,desc,dir; - XCharStruct struc; - int minw,minh,resize=0; - int NbVisCell,NbCell; - - /* Enregistrement des couleurs et de la police */ - MyAllocNamedColor(xobj->display,*xobj->colormap,xobj->forecolor,&xobj->TabColor[fore]); - MyAllocNamedColor(xobj->display,*xobj->colormap,xobj->backcolor,&xobj->TabColor[back]); - MyAllocNamedColor(xobj->display,*xobj->colormap,xobj->licolor,&xobj->TabColor[li]); - MyAllocNamedColor(xobj->display,*xobj->colormap,xobj->shadcolor,&xobj->TabColor[shad]); - MyAllocNamedColor(xobj->display,*xobj->colormap,"#000000",&xobj->TabColor[black]); - MyAllocNamedColor(xobj->display,*xobj->colormap,"#FFFFFF",&xobj->TabColor[white]); - - - mask=0; - Attr.background_pixel=xobj->TabColor[back].pixel; - mask|=CWBackPixel; - Attr.cursor=XCreateFontCursor(xobj->display,XC_hand2); - mask|=CWCursor; /* Curseur pour la fenetre */ - xobj->win=XCreateWindow(xobj->display,*xobj->ParentWin, - xobj->x,xobj->y,xobj->width,xobj->height,0, - CopyFromParent,InputOutput,CopyFromParent, - mask,&Attr); - - xobj->gc=XCreateGC(xobj->display,xobj->win,0,NULL); - XSetForeground(xobj->display,xobj->gc,xobj->TabColor[fore].pixel); - XSetBackground(xobj->display,xobj->gc,xobj->TabColor[back].pixel); - XSetLineAttributes(xobj->display,xobj->gc,1,LineSolid,CapRound,JoinMiter); - if ((xobj->xfont=XLoadQueryFont(xobj->display,xobj->font))==NULL) - fprintf(stderr,"Can't load font %s\n",xobj->font); - else - XSetFont(xobj->display,xobj->gc,xobj->xfont->fid); - - /* Calcul de la taille du widget */ - /* Taille minimum: une ligne ou ascenseur visible */ - XTextExtents(xobj->xfont,"lp",strlen("lp"),&dir,&asc,&desc,&struc); - minh=8+3*BdWidth+3*(asc+desc+3); - if (xobj->height<minh) - { - xobj->height=minh; - resize=1; - } - minw=12+3*BdWidth+SbWidth+75; - if (xobj->width<minw) - { - xobj->width=minw; - resize=1; - } - if (resize) - XResizeWindow(xobj->display,xobj->win,xobj->width,xobj->height); - - /* Calcul de la premiere cellule visible */ - NbVisCell=(xobj->height-2-3*BdWidth)/(asc+desc+3); - NbCell=CountOption(xobj->title); - if (NbCell>NbVisCell) - { - if (xobj->value2>(NbCell-NbVisCell+1)) - xobj->value2=NbCell-NbVisCell+1; - if ((xobj->value2<1)||(xobj->value2<0)) - xobj->value2=1; - } - else - xobj->value2=1; -} - -void DrawVSbList(struct XObj *xobj,int NbCell,int NbVisCell,int press) -{ - XRectangle r; - int PosTh,SizeTh; - - r.y=2+BdWidth; - r.x=xobj->width-(6+BdWidth)-SbWidth; - r.height=xobj->height-r.y-2*BdWidth; - r.width=SbWidth+4; - DrawReliefRect(r.x,r.y,r.width,r.height,xobj,xobj->TabColor[shad].pixel, - xobj->TabColor[li].pixel,xobj->TabColor[fore].pixel,-1); - - /* Calcul du rectangle pour les fleches*/ - r.x=r.x+2; - r.y=r.y+2; - r.width=r.width-4; - r.height=r.height-4; - - /* Dessin de la fleche haute */ - DrawArrowN(xobj,r.x+1,r.y+1,press==1); - DrawArrowS(xobj,r.x+1,r.y+r.height-14,press==2); - - /* Calcul du rectangle pour le pouce*/ - r.y=r.y+13; - r.height=r.height-26; - - /* Effacement */ - XSetForeground(xobj->display,xobj->gc,xobj->TabColor[back].pixel); - XFillRectangle(xobj->display,xobj->win,xobj->gc,r.x+1,r.y+1,r.width-2,r.height-2); - - /* Dessin du pouce */ - if (NbVisCell<NbCell) - SizeTh=(NbVisCell*(r.height-8)/NbCell)+8; - else - SizeTh=r.height; - PosTh=(xobj->value2-1)*(r.height-8)/NbCell; - DrawReliefRect(r.x,r.y+PosTh,r.width,SizeTh,xobj,xobj->TabColor[li].pixel, - xobj->TabColor[shad].pixel,xobj->TabColor[fore].pixel,-1); -} - -void DrawCellule(struct XObj *xobj,int NbCell,int NbVisCell,int HeightCell,int asc) -{ - XRectangle r; - char *Title; - int i; - - r.x=4+BdWidth; - r.y=r.x; - r.width=xobj->width-r.x-10-2*BdWidth-SbWidth; - r.height=xobj->height-r.y-4-2*BdWidth; - - /* Dessin des cellules */ - XSetClipRectangles(xobj->display,xobj->gc,0,0,&r,1,Unsorted); - for (i=xobj->value2;i<xobj->value2+NbVisCell;i++) - { - Title=GetMenuTitle(xobj->title,i); - if (strlen(Title)!=0) - if (xobj->value==i) - { - XSetForeground(xobj->display,xobj->gc,xobj->TabColor[shad].pixel); - XFillRectangle(xobj->display,xobj->win,xobj->gc,r.x+2,r.y+(i-xobj->value2)*HeightCell+2, - xobj->width-2,HeightCell-2); - DrawString(xobj->display,xobj->gc,xobj->win,5+r.x,(i-xobj->value2)*HeightCell+asc+2+r.y,Title, - strlen(Title),xobj->TabColor[fore].pixel,xobj->TabColor[back].pixel, - xobj->TabColor[shad].pixel,!xobj->flags[1]); - } - else - { - XSetForeground(xobj->display,xobj->gc,xobj->TabColor[back].pixel); - XFillRectangle(xobj->display,xobj->win,xobj->gc,r.x+2,r.y+(i-xobj->value2)*HeightCell+2, - xobj->width-2,HeightCell-2); - DrawString(xobj->display,xobj->gc,xobj->win,5+r.x,(i-xobj->value2)*HeightCell+asc+2+r.y,Title, - strlen(Title),xobj->TabColor[fore].pixel,xobj->TabColor[li].pixel, - xobj->TabColor[back].pixel,!xobj->flags[1]); - } - else - { - XSetForeground(xobj->display,xobj->gc,xobj->TabColor[back].pixel); - XFillRectangle(xobj->display,xobj->win,xobj->gc,r.x+2,r.y+(i-xobj->value2)*HeightCell+2, - xobj->width-2,HeightCell-2); - } - } - XSetClipMask(xobj->display,xobj->gc,None); -} - -void DestroyList(struct XObj *xobj) -{ - XFreeGC(xobj->display,xobj->gc); - XDestroyWindow(xobj->display,xobj->win); -} - -void DrawList(struct XObj *xobj) -{ - int asc,desc,dir,HeightCell; - XCharStruct struc; - int NbVisCell,NbCell; - XRectangle r; - - /* Dessin du contour */ - DrawReliefRect(0,0,xobj->width,xobj->height,xobj, - xobj->TabColor[li].pixel,xobj->TabColor[shad].pixel,xobj->TabColor[fore].pixel,-1); - - /* Dessin du contour de la liste */ - r.x=2+BdWidth; - r.y=r.x; - r.width=xobj->width-r.x-4-2*BdWidth-SbWidth; - r.height=xobj->height-r.y-2*BdWidth; - DrawReliefRect(r.x,r.y,r.width,r.height,xobj,xobj->TabColor[shad].pixel, - xobj->TabColor[li].pixel,xobj->TabColor[fore].pixel,-1); - - /* Calcul du nombre de cellules visibles */ - XTextExtents(xobj->xfont,"lp",strlen("lp"),&dir,&asc,&desc,&struc); - HeightCell=asc+desc+3; - NbVisCell=r.height/HeightCell; - NbCell=CountOption(xobj->title); - if (NbCell>NbVisCell) - { - if (xobj->value2>(NbCell-NbVisCell+1)) - xobj->value2=NbCell-NbVisCell+1; - if ((xobj->value2<1)||(xobj->value2<0)) - xobj->value2=1; - } - else - xobj->value2=1; - - - /* Dessin des cellules */ - DrawCellule(xobj,NbCell,NbVisCell,HeightCell,asc); - - /* Dessin de l'ascenseur vertical */ - DrawVSbList(xobj,NbCell,NbVisCell,0); - -} - -void EvtMouseList(struct XObj *xobj,XButtonEvent *EvtButton) -{ - XRectangle rect,rectT; - XPoint pt; - XCharStruct struc; - int x1,y1,x2,y2; - Window Win1,Win2; - unsigned int modif; - int In=1; - static XEvent event; - int asc,desc,dir; - int NbVisCell,NbCell,HeightCell,NPosCell,PosMouse; - fd_set in_fdset; - - pt.x=EvtButton->x-xobj->x; - pt.y=EvtButton->y-xobj->y; - - /* Clic dans une cellule */ - rect.x=4+BdWidth; - rect.y=rect.x; - rect.width=xobj->width-rect.x-10-2*BdWidth-SbWidth; - rect.height=xobj->height-rect.y-4-2*BdWidth; - if(PtInRect(pt,rect)) - { - /* Determination de la cellule */ - pt.y=pt.y-rect.y; - XTextExtents(xobj->xfont,"lp",strlen("lp"),&dir,&asc,&desc,&struc); - NPosCell=xobj->value2+(pt.y/(asc+desc+3)); - if (NPosCell>CountOption(xobj->title)) - NPosCell=0; - if (NPosCell!=xobj->value) - { - xobj->value=NPosCell; - DrawList(xobj); - } -/* if (IsItDoubleClic(xobj)) - SendMsg(xobj,DoubleClic); - else*/ - SendMsg(xobj,SingleClic); - return ; - } - - XTextExtents(xobj->xfont,"lp",strlen("lp"),&dir,&asc,&desc,&struc); - HeightCell=asc+desc+3; - NbVisCell=(xobj->height-6-BdWidth)/HeightCell; - NbCell=CountOption(xobj->title); - - /* Clic fleche haute asc vertical */ - rect.y=5+BdWidth; - rect.x=xobj->width-(6+BdWidth)-SbWidth+3; - rect.height=12; - rect.width=12; - if(PtInRect(pt,rect)) - { - DrawVSbList(xobj,NbCell,NbVisCell,1); - do - { - XQueryPointer(xobj->display,*xobj->ParentWin,&Win1,&Win2,&x1,&y1,&x2,&y2,&modif); - pt.y=y2-xobj->y; - pt.x=x2-xobj->x; - if (PtInRect(pt,rect)) - { - if (In) - { - Wait(8); - xobj->value2--; - if (xobj->value2<1) - xobj->value2=1; - else - { - DrawCellule(xobj,NbCell,NbVisCell,HeightCell,asc); - DrawVSbList(xobj,NbCell,NbVisCell,1); - } - } - else - { - In=1; - DrawVSbList(xobj,NbCell,NbVisCell,1); - xobj->value2--; - if (xobj->value2<1) - xobj->value2=1; - else - DrawCellule(xobj,NbCell,NbVisCell,HeightCell,asc); - } - } - else - { - if (In) - { - In=0; - DrawVSbList(xobj,NbCell,NbVisCell,0); - } - } - FD_ZERO(&in_fdset); - FD_SET(x_fd,&in_fdset); - select(32, SELECT_TYPE_ARG234 &in_fdset, NULL, NULL, NULL); - } - while (!XCheckTypedEvent(xobj->display,ButtonRelease,&event)); - DrawVSbList(xobj,NbCell,NbVisCell,0); - return; - } - - /* Clic flache basse asc vertical */ - rect.y=xobj->height-2*BdWidth-16; - if(PtInRect(pt,rect)) - { - DrawVSbList(xobj,NbCell,NbVisCell,2); - do - { - XQueryPointer(xobj->display,*xobj->ParentWin,&Win1,&Win2,&x1,&y1,&x2,&y2,&modif); - pt.y=y2-xobj->y; - pt.x=x2-xobj->x; - if (PtInRect(pt,rect)) - { - if (In) - { - Wait(8); - if (xobj->value2<=NbCell-NbVisCell) - { - xobj->value2++; - DrawCellule(xobj,NbCell,NbVisCell,HeightCell,asc); - DrawVSbList(xobj,NbCell,NbVisCell,2); - } - } - else - { - In=1; - DrawVSbList(xobj,NbCell,NbVisCell,2); - if (xobj->value2<=NbCell-NbVisCell) - { - xobj->value2++; - DrawCellule(xobj,NbCell,NbVisCell,HeightCell,asc); - } - } - } - else - { - if (In) - { - In=0; - DrawVSbList(xobj,NbCell,NbVisCell,0); - } - } - FD_ZERO(&in_fdset); - FD_SET(x_fd,&in_fdset); - select(32, SELECT_TYPE_ARG234 &in_fdset, NULL, NULL, NULL); - } - while (!XCheckTypedEvent(xobj->display,ButtonRelease,&event)); - DrawVSbList(xobj,NbCell,NbVisCell,0); - return; - } - - /* clic sur la zone pouce de l'ascenseur de l'ascenseur */ - rect.y=17+BdWidth; - rect.x=xobj->width-(6+BdWidth)-SbWidth+2; - rect.height=xobj->height-rect.y-19-2*BdWidth; - rect.width=SbWidth; - if(PtInRect(pt,rect)) - { - /* Clic dans le pouce */ - rectT.x=rect.x; - rectT.y=rect.y+(xobj->value2-1)*(rect.height-8)/NbCell; - if (NbVisCell<NbCell) - rectT.height=NbVisCell*(rect.height-8)/NbCell+8; - rectT.width=rect.width; - if(PtInRect(pt,rectT)) - { - PosMouse=pt.y-rectT.y-HeightCell/2+2; - do - { - XQueryPointer(xobj->display,*xobj->ParentWin,&Win1,&Win2,&x1,&y1,&x2,&y2,&modif); - /* Calcul de l'id de la premiere cellule */ - pt.y=y2-xobj->y-PosMouse; - NPosCell=(pt.y-rect.y)*NbCell/(rect.height); - - if (NPosCell<1) NPosCell=1; - if (NbCell>NbVisCell) - { - if (NPosCell>(NbCell-NbVisCell+1)) - NPosCell=NbCell-NbVisCell+1; - } - else - NPosCell=1; - if (xobj->value2!=NPosCell) - { - xobj->value2=NPosCell; - DrawCellule(xobj,NbCell,NbVisCell,HeightCell,asc); - DrawVSbList(xobj,NbCell,NbVisCell,0); - } - FD_ZERO(&in_fdset); - FD_SET(x_fd,&in_fdset); - select(32, SELECT_TYPE_ARG234 &in_fdset, NULL, NULL, NULL); - } - while (!XCheckTypedEvent(xobj->display,ButtonRelease,&event)); - } - else if (pt.y<rectT.y) - { - NPosCell=xobj->value2-NbVisCell; - if (NPosCell<1) NPosCell=1; - if (xobj->value2!=NPosCell) - { - xobj->value2=NPosCell; - DrawCellule(xobj,NbCell,NbVisCell,HeightCell,asc); - DrawVSbList(xobj,NbCell,NbVisCell,0); - } - } - else if (pt.y>rectT.y+rectT.height) - { - NPosCell=xobj->value2+NbVisCell; - if (NbCell>NbVisCell) - { - if (NPosCell>(NbCell-NbVisCell+1)) - NPosCell=NbCell-NbVisCell+1; - } - else NPosCell=1; - if (xobj->value2!=NPosCell) - { - xobj->value2=NPosCell; - DrawCellule(xobj,NbCell,NbVisCell,HeightCell,asc); - DrawVSbList(xobj,NbCell,NbVisCell,0); - } - } - } -} - -void EvtKeyList(struct XObj *xobj,XKeyEvent *EvtKey) -{ -} - - -void ProcessMsgList(struct XObj *xobj,unsigned long type,unsigned long *body) -{ -} - - diff --git a/app/fvwm/extras/FvwmScript/Widgets/Menu.c b/app/fvwm/extras/FvwmScript/Widgets/Menu.c deleted file mode 100644 index f76375ff8..000000000 --- a/app/fvwm/extras/FvwmScript/Widgets/Menu.c +++ /dev/null @@ -1,227 +0,0 @@ -#include "Tools.h" - - -/***********************************************/ -/* Fonction pour Menu */ -/***********************************************/ -void InitMenu(struct XObj *xobj) -{ - unsigned long mask; - XSetWindowAttributes Attr; - int asc,desc,dir; - XCharStruct struc; - int i; - char *Option; - - /* Enregistrement des couleurs et de la police */ - MyAllocNamedColor(xobj->display,*xobj->colormap,xobj->forecolor,&xobj->TabColor[fore]); - MyAllocNamedColor(xobj->display,*xobj->colormap,xobj->backcolor,&xobj->TabColor[back]); - MyAllocNamedColor(xobj->display,*xobj->colormap,xobj->licolor,&xobj->TabColor[li]); - MyAllocNamedColor(xobj->display,*xobj->colormap,xobj->shadcolor,&xobj->TabColor[shad]); - MyAllocNamedColor(xobj->display,*xobj->colormap,"#000000",&xobj->TabColor[black]); - MyAllocNamedColor(xobj->display,*xobj->colormap,"#FFFFFF",&xobj->TabColor[white]); - - mask=0; - Attr.background_pixel=xobj->TabColor[back].pixel; - mask|=CWBackPixel; - Attr.cursor=XCreateFontCursor(xobj->display,XC_hand2); - mask|=CWCursor; - xobj->win=XCreateWindow(xobj->display,*xobj->ParentWin, - xobj->x,xobj->y,xobj->width,xobj->height,0, - CopyFromParent,InputOutput,CopyFromParent, - mask,&Attr); - xobj->gc=XCreateGC(xobj->display,xobj->win,0,NULL); - XSetForeground(xobj->display,xobj->gc,xobj->TabColor[fore].pixel); - XSetBackground(xobj->display,xobj->gc,xobj->TabColor[back].pixel); - - XSetLineAttributes(xobj->display,xobj->gc,1,LineSolid,CapRound,JoinMiter); - if ((xobj->xfont=XLoadQueryFont(xobj->display,xobj->font))==NULL) - fprintf(stderr,"Can't load font %s\n",xobj->font); - else - XSetFont(xobj->display,xobj->gc,xobj->xfont->fid); - - /* Size */ - Option=GetMenuTitle(xobj->title,0); - xobj->width=XTextWidth(xobj->xfont,Option,strlen(Option))+6; - XTextExtents(xobj->xfont,"lp",strlen("lp"),&dir,&asc,&desc,&struc); - xobj->height=asc+desc+4; - free(Option); - - /* Position */ - xobj->y=3; - xobj->x=2; - i=0; - while (xobj!=tabxobj[i]) - { - if (tabxobj[i]->TypeWidget==Menu) - { - Option=GetMenuTitle(tabxobj[i]->title,0); - xobj->x=xobj->x+XTextWidth(tabxobj[i]->xfont,Option,strlen(Option))+10; - free(Option); - } - i++; - } - XResizeWindow(xobj->display,xobj->win,xobj->width,xobj->height); - XMoveWindow(xobj->display,xobj->win,xobj->x,xobj->y); -} - -void DestroyMenu(struct XObj *xobj) -{ - XFreeFont(xobj->display,xobj->xfont); - XFreeGC(xobj->display,xobj->gc); - XDestroyWindow(xobj->display,xobj->win); -} - -void DrawMenu(struct XObj *xobj) -{ - XSegment segm[2]; - int i; - - /* Si c'est le premier menu, on dessine la bar de menu */ - if (xobj->x==2) - { - for (i=0;i<2;i++) - { - segm[0].x1=i; - segm[0].y1=i; - segm[0].x2=x11base->size.width-i-1; - segm[0].y2=i; - - segm[1].x1=i; - segm[1].y1=i; - segm[1].x2=i; - segm[1].y2=xobj->height-i+5; - XSetForeground(xobj->display,xobj->gc,xobj->TabColor[li].pixel); - XDrawSegments(xobj->display,x11base->win,xobj->gc,segm,2); - - segm[0].x1=1+i; - segm[0].y1=xobj->height-i+5; - segm[0].x2=x11base->size.width-i-1; - segm[0].y2=xobj->height-i+5; - - segm[1].x1=x11base->size.width-i-1; - segm[1].y1=i; - segm[1].x2=x11base->size.width-i-1; - segm[1].y2=xobj->height-i+5; - XSetForeground(xobj->display,xobj->gc,xobj->TabColor[shad].pixel); - XDrawSegments(xobj->display,x11base->win,xobj->gc,segm,2); - } - - } - DrawIconStr(0,xobj,True); -} - -void EvtMouseMenu(struct XObj *xobj,XButtonEvent *EvtButton) -{ - static XEvent event; - unsigned int modif; - int x1,x2,y1,y2,i,oldy; - Window Win1,Win2,WinPop; - char *str; - int x,y,hOpt,yMenu,hMenu,wMenu; - int oldvalue = 0,newvalue; - unsigned long mask; - XSetWindowAttributes Attr; - int asc,desc,dir; - XCharStruct struc; - fd_set in_fdset; - - DrawReliefRect(0,0,xobj->width,xobj->height,xobj, - xobj->TabColor[shad].pixel,xobj->TabColor[li].pixel,xobj->TabColor[black].pixel,-1); - - XTextExtents(xobj->xfont,"lp",strlen("lp"),&dir,&asc,&desc,&struc); - hOpt=asc+desc+10; - xobj->value3=CountOption(xobj->title); - hMenu=(xobj->value3-1)*hOpt; /* Hauteur totale du menu */ - yMenu=xobj->y+xobj->height+1; - wMenu=0; - for (i=2;i<=xobj->value3;i++) - { - str=(char*)GetMenuTitle(xobj->title,i); - if (wMenu<XTextWidth(xobj->xfont,str,strlen(str))+20) - wMenu=XTextWidth(xobj->xfont,str,strlen(str))+20; - free(str); - } - - /* Creation de la fenetre menu */ - XTranslateCoordinates(xobj->display,*xobj->ParentWin, - XRootWindow(xobj->display,XDefaultScreen(xobj->display)),xobj->x,yMenu,&x,&y,&Win1); - if (x<0) x=0; - if (y<0) y=0; - if (x+wMenu>XDisplayWidth(xobj->display,XDefaultScreen(xobj->display))) - x=XDisplayWidth(xobj->display,XDefaultScreen(xobj->display))-wMenu; - if (y+hMenu>XDisplayHeight(xobj->display,XDefaultScreen(xobj->display))) - { - y=y-hMenu-xobj->height; - } - - mask=0; - Attr.background_pixel=xobj->TabColor[back].pixel; - mask|=CWBackPixel; - Attr.cursor=XCreateFontCursor(xobj->display,XC_hand2); - mask|=CWCursor; /* Curseur pour la fenetre */ - Attr.override_redirect=True; - mask|=CWOverrideRedirect; - WinPop=XCreateWindow(xobj->display,XRootWindow(xobj->display,XDefaultScreen(xobj->display)), - x,y,wMenu-5,hMenu,0,CopyFromParent,InputOutput,CopyFromParent,mask,&Attr); - XMapRaised(xobj->display,WinPop); - - /* Dessin du menu */ - DrawPMenu(xobj,WinPop,hOpt,2); - do - { - XQueryPointer(xobj->display,XRootWindow(xobj->display,XDefaultScreen(xobj->display)), - &Win1,&Win2,&x1,&y1,&x2,&y2,&modif); - /* Determiner l'option courante */ - y2=y2-y; - x2=x2-x; - { - oldy=y2; - /* calcule de xobj->value */ - if ((x2>0)&&(x2<wMenu)&&(y2>0)&&(y2<hMenu)) - newvalue=y2/hOpt+1; - else - newvalue=0; - if (newvalue!=oldvalue) - { - SelectMenu(xobj,WinPop,hOpt,oldvalue,0); - SelectMenu(xobj,WinPop,hOpt,newvalue,1); - oldvalue=newvalue; - } - } - FD_ZERO(&in_fdset); - FD_SET(x_fd,&in_fdset); - select(32, SELECT_TYPE_ARG234 &in_fdset, NULL, NULL, NULL); - } - while (!XCheckTypedEvent(xobj->display,ButtonRelease,&event)); - XDestroyWindow(xobj->display,WinPop); - if (newvalue!=0) - { - xobj->value=newvalue; - SendMsg(xobj,SingleClic); - xobj->value=0; - } - XSetForeground(xobj->display,xobj->gc,xobj->TabColor[back].pixel); - XFillRectangle(xobj->display,xobj->win,xobj->gc,0,0,xobj->width,xobj->height); - DrawIconStr(0,xobj,True); - for (i=0;i<nbobj;i++) - tabxobj[i]->DrawObj(tabxobj[i]); - -} - -void EvtKeyMenu(struct XObj *xobj,XKeyEvent *EvtKey) -{ -} - -void ProcessMsgMenu(struct XObj *xobj,unsigned long type,unsigned long *body) -{ -} - - - - - - - - - diff --git a/app/fvwm/extras/FvwmScript/Widgets/MiniScroll.c b/app/fvwm/extras/FvwmScript/Widgets/MiniScroll.c deleted file mode 100644 index e6f92b119..000000000 --- a/app/fvwm/extras/FvwmScript/Widgets/MiniScroll.c +++ /dev/null @@ -1,157 +0,0 @@ -#include "Tools.h" - - -/***********************************************/ -/* Fonction pour MiniScroll */ -/***********************************************/ -void InitMiniScroll(struct XObj *xobj) -{ - unsigned long mask; - XSetWindowAttributes Attr; - int i; - - /* Enregistrement des couleurs et de la police */ - MyAllocNamedColor(xobj->display,*xobj->colormap,xobj->forecolor,&xobj->TabColor[fore]); - MyAllocNamedColor(xobj->display,*xobj->colormap,xobj->backcolor,&xobj->TabColor[back]); - MyAllocNamedColor(xobj->display,*xobj->colormap,xobj->licolor,&xobj->TabColor[li]); - MyAllocNamedColor(xobj->display,*xobj->colormap,xobj->shadcolor,&xobj->TabColor[shad]); - MyAllocNamedColor(xobj->display,*xobj->colormap,"#000000",&xobj->TabColor[black]); - MyAllocNamedColor(xobj->display,*xobj->colormap,"#FFFFFF",&xobj->TabColor[white]); - - - mask=0; - Attr.background_pixel=xobj->TabColor[back].pixel; - mask|=CWBackPixel; - - /* La taille du widget est fixe */ - xobj->width=19; - xobj->height=34; - xobj->win=XCreateWindow(xobj->display,*xobj->ParentWin, - xobj->x,xobj->y,xobj->width,xobj->height,1, - CopyFromParent,InputOutput,CopyFromParent, - mask,&Attr); - xobj->gc=XCreateGC(xobj->display,xobj->win,0,NULL); - XSetForeground(xobj->display,xobj->gc,xobj->TabColor[fore].pixel); - XSetBackground(xobj->display,xobj->gc,xobj->TabColor[back].pixel); - if ((xobj->xfont=XLoadQueryFont(xobj->display,xobj->font))==NULL) - fprintf(stderr,"Can't load font %s\n",xobj->font); - else - XSetFont(xobj->display,xobj->gc,xobj->xfont->fid); - XSetLineAttributes(xobj->display,xobj->gc,1,LineSolid,CapRound,JoinMiter); - if (xobj->value2>xobj->value3) - { - i=xobj->value2; - xobj->value2=xobj->value3; - xobj->value3=i; - } - if ((xobj->value<xobj->value2)||(xobj->value>xobj->value3)) - xobj->value=xobj->value2; -} - -void DestroyMiniScroll(struct XObj *xobj) -{ - XFreeFont(xobj->display,xobj->xfont); - XFreeGC(xobj->display,xobj->gc); - XDestroyWindow(xobj->display,xobj->win); -} - -void DrawMiniScroll(struct XObj *xobj) -{ - - DrawReliefRect(-1,-1,xobj->width+2,xobj->height+2,xobj,xobj->TabColor[li].pixel, - xobj->TabColor[shad].pixel,xobj->TabColor[black].pixel,-1); - - /* Dessin de la fleche du haut */ - DrawArrowN(xobj,3,3,0); - DrawArrowS(xobj,3,18,0); - -} - -void EvtMouseMiniScroll(struct XObj *xobj,XButtonEvent *EvtButton) -{ - static XEvent event; - int x1,y1,x2,y2; - Window Win1,Win2; - unsigned int modif; - int Pos=0; - struct timeval *tv; - long tus,ts; - - do - { - XQueryPointer(xobj->display,*xobj->ParentWin,&Win1,&Win2,&x1,&y1,&x2,&y2,&modif); - /* Determiner l'option courante */ - y2=y2-xobj->y; - x2=x2-xobj->x; - if ((x2>0)&&(x2<xobj->width)&&(y2>0)&&(y2<xobj->height/2)) - { - if (Pos==1) - { - tv=(struct timeval*)calloc(1,sizeof(struct timeval)); - gettimeofday(tv,NULL); - tus=tv->tv_usec; - ts=tv->tv_sec; - while (((tv->tv_usec-tus)+(tv->tv_sec-ts)*1000000)<16667*8) - gettimeofday(tv,NULL); - free(tv); - } - else - { - DrawArrowN(xobj,3,3,1); - Pos=1; - } - xobj->value++; - if (xobj->value>xobj->value3) - xobj->value=xobj->value2; - SendMsg(xobj,SingleClic); - - } - else if ((x2>0)&&(x2<xobj->width)&&(y2>xobj->height/2)&&(y2<xobj->height)) - { - if (Pos==-1) - { - tv=(struct timeval*)calloc(1,sizeof(struct timeval)); - gettimeofday(tv,NULL); - tus=tv->tv_usec; - ts=tv->tv_sec; - while (((tv->tv_usec-tus)+(tv->tv_sec-ts)*1000000)<16667*8) - gettimeofday(tv,NULL); - free(tv); - } - else - { - DrawArrowS(xobj,3,18,1); - Pos=-1; - } - xobj->value--; - if (xobj->value<xobj->value2) - xobj->value=xobj->value3; - SendMsg(xobj,SingleClic); - } - else if (Pos!=0) - { - Pos=0; - DrawArrowN(xobj,3,3,0); - DrawArrowS(xobj,3,18,0); - } - } - while (!XCheckTypedEvent(xobj->display,ButtonRelease,&event)); - DrawArrowN(xobj,3,3,0); - DrawArrowS(xobj,3,18,0); -} - -void EvtKeyMiniScroll(struct XObj *xobj,XKeyEvent *EvtKey) -{ -} - -void ProcessMsgMiniScroll(struct XObj *xobj,unsigned long type,unsigned long *body) -{ -} - - - - - - - - diff --git a/app/fvwm/extras/FvwmScript/Widgets/PopupMenu.c b/app/fvwm/extras/FvwmScript/Widgets/PopupMenu.c deleted file mode 100644 index 7efff96c2..000000000 --- a/app/fvwm/extras/FvwmScript/Widgets/PopupMenu.c +++ /dev/null @@ -1,223 +0,0 @@ -#include "Tools.h" - -/***********************************************/ -/***********************************************/ -/* Fonction pour PopupMenu */ -/***********************************************/ -/***********************************************/ - - - -void InitPopupMenu(struct XObj *xobj) -{ - unsigned long mask; - XSetWindowAttributes Attr; - int i; - char *str; - int asc,desc,dir; - XCharStruct struc; - - /* Enregistrement des couleurs et de la police */ - MyAllocNamedColor(xobj->display,*xobj->colormap,xobj->forecolor,&xobj->TabColor[fore]); - MyAllocNamedColor(xobj->display,*xobj->colormap,xobj->backcolor,&xobj->TabColor[back]); - MyAllocNamedColor(xobj->display,*xobj->colormap,xobj->licolor,&xobj->TabColor[li]); - MyAllocNamedColor(xobj->display,*xobj->colormap,xobj->shadcolor,&xobj->TabColor[shad]); - MyAllocNamedColor(xobj->display,*xobj->colormap,"#000000",&xobj->TabColor[black]); - MyAllocNamedColor(xobj->display,*xobj->colormap,"#FFFFFF",&xobj->TabColor[white]); - - - mask=0; - Attr.background_pixel=xobj->TabColor[back].pixel; - mask|=CWBackPixel; - Attr.cursor=XCreateFontCursor(xobj->display,XC_hand2); - mask|=CWCursor; /* Curseur pour la fenetre */ - - xobj->win=XCreateWindow(xobj->display,*xobj->ParentWin, - xobj->x,xobj->y,xobj->width,xobj->height,0, - CopyFromParent,InputOutput,CopyFromParent, - mask,&Attr); - xobj->gc=XCreateGC(xobj->display,xobj->win,0,NULL); - XSetForeground(xobj->display,xobj->gc,xobj->TabColor[fore].pixel); - XSetBackground(xobj->display,xobj->gc,xobj->TabColor[back].pixel); - if ((xobj->xfont=XLoadQueryFont(xobj->display,xobj->font))==NULL) - fprintf(stderr,"Can't load font %s\n",xobj->font); - else - XSetFont(xobj->display,xobj->gc,xobj->xfont->fid); - - XSetLineAttributes(xobj->display,xobj->gc,1,LineSolid,CapRound,JoinMiter); - xobj->value3=CountOption(xobj->title); - if (xobj->value>xobj->value3) - xobj->value=xobj->value3; - if (xobj->value<1) - xobj->value=1; - - /* Redimensionnement du widget */ - XTextExtents(xobj->xfont,"lp",strlen("lp"),&dir,&asc,&desc,&struc); - xobj->height=asc+desc+12; - xobj->width=30; - for (i=1;i<=xobj->value3;i++) - { - str=(char*)GetMenuTitle(xobj->title,i); - if (xobj->width<XTextWidth(xobj->xfont,str,strlen(str))+34) - xobj->width=XTextWidth(xobj->xfont,str,strlen(str))+34; - free(str); - } - XResizeWindow(xobj->display,xobj->win,xobj->width,xobj->height); -} - -void DestroyPopupMenu(struct XObj *xobj) -{ - XFreeFont(xobj->display,xobj->xfont); - XFreeGC(xobj->display,xobj->gc); - XDestroyWindow(xobj->display,xobj->win); -} - -void DrawPopupMenu(struct XObj *xobj) -{ - XSegment segm[4]; - char* str; - int x,y; - int asc,desc,dir; - XCharStruct struc; - - XTextExtents(xobj->xfont,"lp",strlen("lp"),&dir,&asc,&desc,&struc); - DrawReliefRect(0,0,xobj->width,xobj->height,xobj, - xobj->TabColor[li].pixel,xobj->TabColor[shad].pixel,xobj->TabColor[black].pixel,0); - - /* Dessin de la fleche */ - segm[0].x1=7; - segm[0].y1=asc; - segm[0].x2=19; - segm[0].y2=asc; - segm[1].x1=8; - segm[1].y1=asc; - segm[1].x2=13; - segm[1].y2=5+asc; - segm[2].x1=6; - segm[2].y1=asc-1; - segm[2].x2=19; - segm[2].y2=0+asc-1; - segm[3].x1=7; - segm[3].y1=asc; - segm[3].x2=12; - segm[3].y2=5+asc; - XSetForeground(xobj->display,xobj->gc,xobj->TabColor[shad].pixel); - XDrawSegments(xobj->display,xobj->win,xobj->gc,segm,4); - segm[0].x1=17; - segm[0].y1=asc+1; - segm[0].x2=13; - segm[0].y2=5+asc; - segm[1].x1=19; - segm[1].y1=asc; - segm[1].x2=14; - segm[1].y2=5+asc; - XSetForeground(xobj->display,xobj->gc,xobj->TabColor[li].pixel); - XDrawSegments(xobj->display,xobj->win,xobj->gc,segm,2); - - /* Dessin du titre du popup menu */ - str=(char*)GetMenuTitle(xobj->title,xobj->value); - x=25; - y=asc+5; - DrawString(xobj->display,xobj->gc,xobj->win,x,y,str, - strlen(str),xobj->TabColor[fore].pixel,xobj->TabColor[li].pixel, - xobj->TabColor[back].pixel, - !xobj->flags[1]); - - free(str); -} - -void EvtMousePopupMenu(struct XObj *xobj,XButtonEvent *EvtButton) -{ - static XEvent event; - int x,y,hOpt,yMenu,hMenu; - int x1,y1,x2,y2,oldy; - int oldvalue = 0,newvalue; - Window Win1,Win2,WinPop; - unsigned int modif; - unsigned long mask; - XSetWindowAttributes Attr; - int asc,desc,dir; - XCharStruct struc; - - XTextExtents(xobj->xfont,"lp",strlen("lp"),&dir,&asc,&desc,&struc); - hOpt=asc+desc+10; - yMenu=xobj->y-((xobj->value-1)*hOpt); - hMenu=xobj->value3*hOpt; - - /* Creation de la fenetre menu */ - XTranslateCoordinates(xobj->display,*xobj->ParentWin, - XRootWindow(xobj->display,XDefaultScreen(xobj->display)),xobj->x,yMenu,&x,&y,&Win1); - if (x<0) x=0; - if (y<0) y=0; - if (x+xobj->width>XDisplayWidth(xobj->display,XDefaultScreen(xobj->display))) - x=XDisplayWidth(xobj->display,XDefaultScreen(xobj->display))-xobj->width; - if (y+hMenu>XDisplayHeight(xobj->display,XDefaultScreen(xobj->display))) - y=XDisplayHeight(xobj->display,XDefaultScreen(xobj->display))-hMenu; - mask=0; - Attr.background_pixel=xobj->TabColor[back].pixel; - mask|=CWBackPixel; - Attr.cursor=XCreateFontCursor(xobj->display,XC_hand2); - mask|=CWCursor; /* Curseur pour la fenetre */ - Attr.override_redirect=True; - mask|=CWOverrideRedirect; - WinPop=XCreateWindow(xobj->display,XRootWindow(xobj->display,XDefaultScreen(xobj->display)), - x,y,xobj->width-2,hMenu,1, - CopyFromParent,InputOutput,CopyFromParent,mask,&Attr); - XMapRaised(xobj->display,WinPop); - - /* Dessin du menu */ - DrawPMenu(xobj,WinPop,hOpt,1); - do - { - XQueryPointer(xobj->display,XRootWindow(xobj->display,XDefaultScreen(xobj->display)), - &Win1,&Win2,&x1,&y1,&x2,&y2,&modif); - /* Determiner l'option courante */ - y2=y2-y; - x2=x2-x; - { - oldy=y2; - /* calcule de xobj->value */ - if ((x2>0)&&(x2<xobj->width)&&(y2>0)&&(y2<hMenu)) - newvalue=y2/hOpt+1; - else - newvalue=0; - if (newvalue!=oldvalue) - { - SelectMenu(xobj,WinPop,hOpt,oldvalue,0); - SelectMenu(xobj,WinPop,hOpt,newvalue,1); - oldvalue=newvalue; - } - } - } - while (!XCheckTypedEvent(xobj->display,ButtonRelease,&event)); - XDestroyWindow(xobj->display,WinPop); - if (newvalue!=0) - { - xobj->value=newvalue; - SendMsg(xobj,SingleClic); - } - xobj->DrawObj(xobj); -} - - -void EvtKeyPopupMenu(struct XObj *xobj,XKeyEvent *EvtKey) -{ -} - -void ProcessMsgPopupMenu(struct XObj *xobj,unsigned long type,unsigned long *body) -{ -} - - - - - - - - - - - - - - diff --git a/app/fvwm/extras/FvwmScript/Widgets/PushButton.c b/app/fvwm/extras/FvwmScript/Widgets/PushButton.c deleted file mode 100644 index 0b0c83b71..000000000 --- a/app/fvwm/extras/FvwmScript/Widgets/PushButton.c +++ /dev/null @@ -1,304 +0,0 @@ -#include "Tools.h" - -/***********************************************/ -/***********************************************/ -/* Fonction pour PushButton */ -/***********************************************/ -/***********************************************/ -void InitPushButton(struct XObj *xobj) -{ - unsigned long mask; - XSetWindowAttributes Attr; - int i; - char *str; - int asc,desc,dir; - XCharStruct struc; - - /* Enregistrement des couleurs et de la police */ - MyAllocNamedColor(xobj->display,*xobj->colormap,xobj->forecolor,&xobj->TabColor[fore]); - MyAllocNamedColor(xobj->display,*xobj->colormap,xobj->backcolor,&xobj->TabColor[back]); - MyAllocNamedColor(xobj->display,*xobj->colormap,xobj->licolor,&xobj->TabColor[li]); - MyAllocNamedColor(xobj->display,*xobj->colormap,xobj->shadcolor,&xobj->TabColor[shad]); - MyAllocNamedColor(xobj->display,*xobj->colormap,"#000000",&xobj->TabColor[black]); - MyAllocNamedColor(xobj->display,*xobj->colormap,"#FFFFFF",&xobj->TabColor[white]); - - - mask=0; - Attr.cursor=XCreateFontCursor(xobj->display,XC_hand2); - mask|=CWCursor; - Attr.background_pixel=xobj->TabColor[back].pixel; - mask|=CWBackPixel; - - - /* Epaisseur de la fenetre = 0 */ - xobj->win=XCreateWindow(xobj->display,*xobj->ParentWin, - xobj->x,xobj->y,xobj->width,xobj->height,0, - CopyFromParent,InputOutput,CopyFromParent, - mask,&Attr); - xobj->gc=XCreateGC(xobj->display,xobj->win,0,NULL); - XSetForeground(xobj->display,xobj->gc,xobj->TabColor[fore].pixel); - XSetBackground(xobj->display,xobj->gc,xobj->TabColor[back].pixel); - if ((xobj->xfont=XLoadQueryFont(xobj->display,xobj->font))==NULL) - { - fprintf(stderr,"Can't load font %s\n",xobj->font); - } - else - XSetFont(xobj->display,xobj->gc,xobj->xfont->fid); - XSetLineAttributes(xobj->display,xobj->gc,1,LineSolid,CapRound,JoinMiter); - - /* Redimensionnement du widget */ - str=(char*)GetMenuTitle(xobj->title,1); - if (xobj->icon==NULL) - { - XTextExtents(xobj->xfont,"lp",strlen("lp"),&dir,&asc,&desc,&struc); - i=asc+desc+12; - if (xobj->height<i) - xobj->height=i; - i=XTextWidth(xobj->xfont,str,strlen(str))+16; - if (xobj->width<i) - xobj->width=i; - } - else if (strlen(str)==0) - { - if (xobj->height<xobj->icon_h+10) - xobj->height=xobj->icon_h+10; - if (xobj->width<xobj->icon_w+10) - xobj->width=xobj->icon_w+10; - } - else - { - if (xobj->icon_w+10>XTextWidth(xobj->xfont,str,strlen(str))+16) - i=xobj->icon_w+10; - else - i=XTextWidth(xobj->xfont,str,strlen(str))+16; - if (xobj->width<i) - xobj->width=i; - i=xobj->icon_h+2*(asc+desc+10); - if (xobj->height<i) - xobj->height=i; - } - XResizeWindow(xobj->display,xobj->win,xobj->width,xobj->height); - xobj->value3=CountOption(xobj->title); -} - -void DestroyPushButton(struct XObj *xobj) -{ - XFreeFont(xobj->display,xobj->xfont); - XFreeGC(xobj->display,xobj->gc); - XDestroyWindow(xobj->display,xobj->win); -} - - -void DrawPushButton(struct XObj *xobj) -{ - DrawReliefRect(0,0,xobj->width,xobj->height,xobj, - xobj->TabColor[li].pixel,xobj->TabColor[shad].pixel,xobj->TabColor[black].pixel,0); - DrawIconStr(0,xobj,True); -} - -void EvtMousePushButton(struct XObj *xobj,XButtonEvent *EvtButton) -{ - static XEvent event; - int End=1; - unsigned int modif; - int x1,x2,y1,y2,i,j,oldy; - Window Win1,Win2,WinPop; - Window WinBut=0; - int In = 0; - char *str; - int x,y,hOpt,yMenu,hMenu,wMenu; - int oldvalue = 0,newvalue; - unsigned long mask; - XSetWindowAttributes Attr; - int asc,desc,dir; - XCharStruct struc; - - - if (EvtButton->button==Button1) - { - j=xobj->height/2+3; - i=(xobj->width-XTextWidth(xobj->xfont,xobj->title,strlen(xobj->title)))/2; - - while (End) - { - XNextEvent(xobj->display, &event); - switch (event.type) - { - case EnterNotify: - XQueryPointer(xobj->display,*xobj->ParentWin, - &Win1,&Win2,&x1,&y1,&x2,&y2,&modif); - if (WinBut==0) - { - WinBut=Win2; - DrawReliefRect(0,0,xobj->width,xobj->height,xobj, - xobj->TabColor[shad].pixel,xobj->TabColor[li].pixel,xobj->TabColor[black].pixel,0); - DrawIconStr(1,xobj,True); - In=1; - } - else - { - if (Win2==WinBut) - { - DrawReliefRect(0,0,xobj->width,xobj->height,xobj, - xobj->TabColor[shad].pixel,xobj->TabColor[li].pixel,xobj->TabColor[black].pixel,0); - DrawIconStr(1,xobj,True); - In=1; - } - else if (In) - { - In=0; - DrawReliefRect(0,0,xobj->width,xobj->height,xobj, - xobj->TabColor[li].pixel,xobj->TabColor[shad].pixel,xobj->TabColor[black].pixel,0); - DrawIconStr(0,xobj,True); - } - } - break; - case LeaveNotify: - XQueryPointer(xobj->display,*xobj->ParentWin, - &Win1,&Win2,&x1,&y1,&x2,&y2,&modif); - if (Win2==WinBut) - { - In=1; - DrawReliefRect(0,0,xobj->width,xobj->height,xobj, - xobj->TabColor[shad].pixel,xobj->TabColor[li].pixel,xobj->TabColor[black].pixel,0); - DrawIconStr(1,xobj,True); - } - else if (In) - { - DrawReliefRect(0,0,xobj->width,xobj->height,xobj, - xobj->TabColor[li].pixel,xobj->TabColor[shad].pixel,xobj->TabColor[black].pixel,0); - DrawIconStr(0,xobj,True); - In=0; - } - break; - case ButtonRelease: - End=0; - DrawReliefRect(0,0,xobj->width,xobj->height,xobj, - xobj->TabColor[li].pixel,xobj->TabColor[shad].pixel,xobj->TabColor[black].pixel,0); - DrawIconStr(0,xobj,True); - if (In) - { - /* Envoie d'un message vide de type SingleClic pour un clique souris */ - xobj->value=1; - SendMsg(xobj,SingleClic); - xobj->value=0; - } - break; - } - } - } - else if (EvtButton->button==Button3) /* affichage du popup menu */ - if (xobj->value3>1) - { - XTextExtents(xobj->xfont,"lp",strlen("lp"),&dir,&asc,&desc,&struc); - hOpt=asc+desc+10; - hMenu=(xobj->value3-1)*hOpt; /* Hauteur totale du menu */ - yMenu=xobj->y+xobj->height; - wMenu=0; - for (i=2;i<=xobj->value3;i++) - { - str=(char*)GetMenuTitle(xobj->title,i); - if (wMenu<XTextWidth(xobj->xfont,str,strlen(str))+34) - wMenu=XTextWidth(xobj->xfont,str,strlen(str))+34; - free(str); - } - - /* Creation de la fenetre menu */ - XTranslateCoordinates(xobj->display,*xobj->ParentWin, - XRootWindow(xobj->display,XDefaultScreen(xobj->display)),xobj->x,yMenu,&x,&y,&Win1); - if (x<0) x=0; - if (y<0) y=0; - if (x+wMenu>XDisplayWidth(xobj->display,XDefaultScreen(xobj->display))) - x=XDisplayWidth(xobj->display,XDefaultScreen(xobj->display))-wMenu; - if (y+hMenu>XDisplayHeight(xobj->display,XDefaultScreen(xobj->display))) - { - /*y=XDisplayHeight(xobj->display,XDefaultScreen(xobj->display))-hMenu;*/ - y=y-hMenu-xobj->height; - } - - mask=0; - Attr.background_pixel=xobj->TabColor[back].pixel; - mask|=CWBackPixel; - Attr.cursor=XCreateFontCursor(xobj->display,XC_hand2); - mask|=CWCursor; /* Curseur pour la fenetre */ - Attr.override_redirect=True; - mask|=CWOverrideRedirect; - WinPop=XCreateWindow(xobj->display,XRootWindow(xobj->display,XDefaultScreen(xobj->display)), - x,y,wMenu-5,hMenu,1, - CopyFromParent,InputOutput,CopyFromParent,mask,&Attr); - XMapRaised(xobj->display,WinPop); - - /* Dessin du menu */ - DrawPMenu(xobj,WinPop,hOpt,2); - do - { - XQueryPointer(xobj->display,XRootWindow(xobj->display,XDefaultScreen(xobj->display)), - &Win1,&Win2,&x1,&y1,&x2,&y2,&modif); - /* Determiner l'option courante */ - y2=y2-y; - x2=x2-x; - { - oldy=y2; - /* calcule de xobj->value */ - if ((x2>0)&&(x2<wMenu)&&(y2>0)&&(y2<hMenu)) - newvalue=y2/hOpt+1; - else - newvalue=0; - if (newvalue!=oldvalue) - { - SelectMenu(xobj,WinPop,hOpt,oldvalue,0); - SelectMenu(xobj,WinPop,hOpt,newvalue,1); - oldvalue=newvalue; - } - } - } - while (!XCheckTypedEvent(xobj->display,ButtonRelease,&event)); - XDestroyWindow(xobj->display,WinPop); - if (newvalue!=0) - { - xobj->value=newvalue; - SendMsg(xobj,SingleClic); - xobj->value=0; - } - xobj->DrawObj(xobj); - - } -} - -void EvtKeyPushButton(struct XObj *xobj,XKeyEvent *EvtKey) -{ - char car[11]; - char *carks2; - char *carks; - KeySym ks; - int Size; - - Size=XLookupString(EvtKey,car,10,&ks,NULL); - car[Size]='\0'; - carks2=XKeysymToString(ks); - if (carks2!=NULL) - { - carks=(char*)calloc(sizeof(char),30); - sprintf(carks,"%s",carks2); - if (strcmp(carks,"Return")==0) - { - xobj->value=1; - SendMsg(xobj,SingleClic); - xobj->value=0; - } - free(carks); - } -} - -void ProcessMsgPushButton(struct XObj *xobj,unsigned long type,unsigned long *body) -{ -} - - - - - - - - - diff --git a/app/fvwm/extras/FvwmScript/Widgets/RadioButton.c b/app/fvwm/extras/FvwmScript/Widgets/RadioButton.c deleted file mode 100644 index 840d4fcb7..000000000 --- a/app/fvwm/extras/FvwmScript/Widgets/RadioButton.c +++ /dev/null @@ -1,188 +0,0 @@ -#include "Tools.h" - - - -/***********************************************/ -/* Fonction pour RadioButton */ -/***********************************************/ -void InitRadioButton(struct XObj *xobj) -{ - unsigned long mask; - XSetWindowAttributes Attr; - int asc,desc,dir; - XCharStruct struc; - - /* Enregistrement des couleurs et de la police */ - MyAllocNamedColor(xobj->display,*xobj->colormap,xobj->forecolor,&xobj->TabColor[fore]); - MyAllocNamedColor(xobj->display,*xobj->colormap,xobj->backcolor,&xobj->TabColor[back]); - MyAllocNamedColor(xobj->display,*xobj->colormap,xobj->licolor,&xobj->TabColor[li]); - MyAllocNamedColor(xobj->display,*xobj->colormap,xobj->shadcolor,&xobj->TabColor[shad]); - MyAllocNamedColor(xobj->display,*xobj->colormap,"#000000",&xobj->TabColor[black]); - MyAllocNamedColor(xobj->display,*xobj->colormap,"#FFFFFF",&xobj->TabColor[white]); - - mask=0; - Attr.cursor=XCreateFontCursor(xobj->display,XC_hand2); - mask|=CWCursor; /* Curseur pour la fenetre */ - Attr.background_pixel=xobj->TabColor[back].pixel; - mask|=CWBackPixel; - - xobj->win=XCreateWindow(x11base->display,*xobj->ParentWin, - xobj->x,xobj->y,xobj->width,xobj->height,0, - CopyFromParent,InputOutput,CopyFromParent, - mask,&Attr); - - xobj->gc=XCreateGC(xobj->display,xobj->win,0,NULL); - XSetForeground(xobj->display,xobj->gc,xobj->TabColor[fore].pixel); - XSetBackground(xobj->display,xobj->gc,xobj->TabColor[back].pixel); - - if ((xobj->xfont=XLoadQueryFont(xobj->display,xobj->font))==NULL) - { - fprintf(stderr,"Can't load font %s\n",xobj->font); - } - else - XSetFont(xobj->display,xobj->gc,xobj->xfont->fid); - - XSetLineAttributes(xobj->display,xobj->gc,1,LineSolid,CapRound,JoinMiter); - - /* Redimensionnement du widget */ - XTextExtents(xobj->xfont,"lp",strlen("lp"),&dir,&asc,&desc,&struc); - xobj->height=asc+desc+5; - xobj->width=XTextWidth(xobj->xfont,xobj->title,strlen(xobj->title))+20; - XResizeWindow(xobj->display,xobj->win,xobj->width,xobj->height); - -} - -void DestroyRadioButton(struct XObj *xobj) -{ - XFreeFont(xobj->display,xobj->xfont); - XFreeGC(xobj->display,xobj->gc); - XDestroyWindow(xobj->display,xobj->win); -} - -void DrawRadioButton(struct XObj *xobj) -{ - int i,j; - - j=xobj->height/2+3; - i=16; - /* Dessin du cercle arrondi */ - XSetForeground(xobj->display,xobj->gc,xobj->TabColor[shad].pixel); - XDrawArc(xobj->display,xobj->win,xobj->gc,1,j-11,11,11,45*64,180*64); - XSetForeground(xobj->display,xobj->gc,xobj->TabColor[li].pixel); - XDrawArc(xobj->display,xobj->win,xobj->gc,1,j-11,11,11,225*64,180*64); - XSetForeground(xobj->display,xobj->gc,xobj->TabColor[white].pixel); - XFillArc(xobj->display,xobj->win,xobj->gc,2,j-10,9,9,0*64,360*64); - XSetForeground(xobj->display,xobj->gc,xobj->TabColor[black].pixel); - XDrawArc(xobj->display,xobj->win,xobj->gc,2,j-10,9,9,0*64,360*64); - if (xobj->value) - { - XSetForeground(xobj->display,xobj->gc,xobj->TabColor[black].pixel); - XFillArc(xobj->display,xobj->win,xobj->gc,3,j-9,7,7,0*64,360*64); - } - - /* Calcul de la position de la chaine de charactere */ - DrawString(xobj->display,xobj->gc,xobj->win,i,j,xobj->title, - strlen(xobj->title),xobj->TabColor[fore].pixel, - xobj->TabColor[li].pixel,xobj->TabColor[back].pixel, - !xobj->flags[1]); -} - -void EvtMouseRadioButton(struct XObj *xobj,XButtonEvent *EvtButton) -{ - static XEvent event; - int End=1; - unsigned int modif; - int x1,x2,y1,y2,i,j; - Window Win1,Win2; - Window WinBut=0; - int In = 0; - - j=xobj->height/2+3; - i=(xobj->width-XTextWidth(xobj->xfont,xobj->title,strlen(xobj->title)))/2; - - while (End) - { - XNextEvent(xobj->display, &event); - switch (event.type) - { - case EnterNotify: - XQueryPointer(xobj->display,*xobj->ParentWin, - &Win1,&Win2,&x1,&y1,&x2,&y2,&modif); - if (WinBut==0) - { - WinBut=Win2; - /* Mouse on button */ - XSetForeground(xobj->display,xobj->gc,xobj->TabColor[back].pixel); - XFillArc(xobj->display,xobj->win,xobj->gc,3,j-9,7,7,0*64,360*64); - In=1; - } - else - { - if (Win2==WinBut) - { - /* Mouse on button */ - XSetForeground(xobj->display,xobj->gc,xobj->TabColor[back].pixel); - XFillArc(xobj->display,xobj->win,xobj->gc,3,j-9,7,7,0*64,360*64); - In=1; - } - else if (In) - { - In=0; - /* Mouse not on button */ - XSetForeground(xobj->display,xobj->gc,xobj->TabColor[white].pixel); - XFillArc(xobj->display,xobj->win,xobj->gc,3,j-9,7,7,0*64,360*64); - } - } - break; - case LeaveNotify: - XQueryPointer(xobj->display,*xobj->ParentWin, - &Win1,&Win2,&x1,&y1,&x2,&y2,&modif); - if (Win2==WinBut) - { - In=1; - /* Mouse on button */ - XSetForeground(xobj->display,xobj->gc,xobj->TabColor[back].pixel); - XFillArc(xobj->display,xobj->win,xobj->gc,3,j-9,7,7,0*64,360*64); - } - else if (In) - { - /* Mouse not on button */ - XSetForeground(xobj->display,xobj->gc,xobj->TabColor[white].pixel); - XFillArc(xobj->display,xobj->win,xobj->gc,3,j-9,7,7,0*64,360*64); - In=0; - } - break; - case ButtonRelease: - End=0; - /* Mouse not on button */ - if (In) - { - /* Envoie d'un message vide de type SingleClic pour un clique souris */ - xobj->value=1; - XSetForeground(xobj->display,xobj->gc,xobj->TabColor[black].pixel); - XFillArc(xobj->display,xobj->win,xobj->gc,3,j-9,7,7,0*64,360*64); - SendMsg(xobj,SingleClic); - } - else if (xobj->value) - { - XSetForeground(xobj->display,xobj->gc,xobj->TabColor[black].pixel); - XFillArc(xobj->display,xobj->win,xobj->gc,3,j-9,7,7,0*64,360*64); - } - break; - } - } -} - -void EvtKeyRadioButton(struct XObj *xobj,XKeyEvent *EvtKey) -{ -} - -void ProcessMsgRadioButton(struct XObj *xobj,unsigned long type,unsigned long *body) -{ -} - - - - - - diff --git a/app/fvwm/extras/FvwmScript/Widgets/Rectangle.c b/app/fvwm/extras/FvwmScript/Widgets/Rectangle.c deleted file mode 100644 index 290421df2..000000000 --- a/app/fvwm/extras/FvwmScript/Widgets/Rectangle.c +++ /dev/null @@ -1,102 +0,0 @@ -#include "Tools.h" - - -/***********************************************/ -/* Fonction pour Rectangle */ -/***********************************************/ -void InitRectangle(struct XObj *xobj) -{ - unsigned long mask; - XSetWindowAttributes Attr; - - /* Enregistrement des couleurs et de la police */ - MyAllocNamedColor(xobj->display,*xobj->colormap,xobj->forecolor,&xobj->TabColor[fore]); - MyAllocNamedColor(xobj->display,*xobj->colormap,xobj->backcolor,&xobj->TabColor[back]); - MyAllocNamedColor(xobj->display,*xobj->colormap,xobj->licolor,&xobj->TabColor[li]); - MyAllocNamedColor(xobj->display,*xobj->colormap,xobj->shadcolor,&xobj->TabColor[shad]); - MyAllocNamedColor(xobj->display,*xobj->colormap,"#000000",&xobj->TabColor[black]); - MyAllocNamedColor(xobj->display,*xobj->colormap,"#FFFFFF",&xobj->TabColor[white]); - - xobj->gc=XCreateGC(xobj->display,*xobj->ParentWin,0,NULL); - XSetForeground(xobj->display,xobj->gc,xobj->TabColor[fore].pixel); - XSetBackground(xobj->display,xobj->gc,xobj->TabColor[back].pixel); - XSetLineAttributes(xobj->display,xobj->gc,1,LineSolid,CapRound,JoinMiter); - - mask=0; - xobj->win=XCreateWindow(xobj->display,*xobj->ParentWin, - -1000,-1000,xobj->width,xobj->height,0, - CopyFromParent,InputOutput,CopyFromParent, - mask,&Attr); -} - -void DestroyRectangle(struct XObj *xobj) -{ - XFreeGC(xobj->display,xobj->gc); - XDestroyWindow(xobj->display,xobj->win); -} - -void DrawRectangle(struct XObj *xobj) -{ - XSegment segm[4]; - - segm[0].x1=xobj->x; - segm[0].y1=xobj->y; - segm[0].x2=xobj->width+xobj->x-1; - segm[0].y2=xobj->y; - - segm[1].x1=xobj->x; - segm[1].y1=xobj->y; - segm[1].x2=xobj->x; - segm[1].y2=xobj->height+xobj->y-1; - - segm[2].x1=2+xobj->x; - segm[2].y1=xobj->height-2+xobj->y; - segm[2].x2=xobj->width-2+xobj->x; - segm[2].y2=xobj->height-2+xobj->y; - - segm[3].x1=xobj->width-2+xobj->x; - segm[3].y1=2+xobj->y; - segm[3].x2=xobj->width-2+xobj->x; - segm[3].y2=xobj->height-2+xobj->y; - - XSetForeground(xobj->display,xobj->gc,xobj->TabColor[shad].pixel); - XDrawSegments(xobj->display,*xobj->ParentWin,xobj->gc,segm,4); - - - segm[0].x1=1+xobj->x; - segm[0].y1=1+xobj->y; - segm[0].x2=xobj->width-1+xobj->x; - segm[0].y2=1+xobj->y; - - segm[1].x1=1+xobj->x; - segm[1].y1=1+xobj->y; - segm[1].x2=1+xobj->x; - segm[1].y2=xobj->height-1+xobj->y; - - segm[2].x1=1+xobj->x; - segm[2].y1=xobj->height-1+xobj->y; - segm[2].x2=xobj->width-1+xobj->x; - segm[2].y2=xobj->height-1+xobj->y; - - segm[3].x1=xobj->width-1+xobj->x; - segm[3].y1=1+xobj->y; - segm[3].x2=xobj->width-1+xobj->x; - segm[3].y2=xobj->height-1+xobj->y; - - XSetForeground(xobj->display,xobj->gc,xobj->TabColor[li].pixel); - XDrawSegments(xobj->display,*xobj->ParentWin,xobj->gc,segm,4); - -} - -void EvtMouseRectangle(struct XObj *xobj,XButtonEvent *EvtButton) -{ -} - -void EvtKeyRectangle(struct XObj *xobj,XKeyEvent *EvtKey) -{ -} - - -void ProcessMsgRectangle(struct XObj *xobj,unsigned long type,unsigned long *body) -{ -} diff --git a/app/fvwm/extras/FvwmScript/Widgets/Swallow.c b/app/fvwm/extras/FvwmScript/Widgets/Swallow.c deleted file mode 100644 index d5e70075b..000000000 --- a/app/fvwm/extras/FvwmScript/Widgets/Swallow.c +++ /dev/null @@ -1,158 +0,0 @@ -#include "Tools.h" - -extern int fd[2]; - -/***********************************************/ -/* Fonction pour Swallow */ -/***********************************************/ - -void DrawRelief(struct XObj *xobj) -{ - XSegment segm[2]; - int i; - - if (xobj->value!=0) - { - for (i=1;i<4;i++) - { - segm[0].x1=xobj->x-i; - segm[0].y1=xobj->y-i; - segm[0].x2=xobj->x+xobj->width+i-2; - segm[0].y2=xobj->y-i; - segm[1].x1=xobj->x-i; - segm[1].y1=xobj->y-i; - segm[1].x2=xobj->x-i; - segm[1].y2=xobj->y+xobj->height+i-2; - if (xobj->value==-1) - XSetForeground(xobj->display,xobj->gc,xobj->TabColor[shad].pixel); - else - XSetForeground(xobj->display,xobj->gc,xobj->TabColor[li].pixel); - XDrawSegments(xobj->display,*xobj->ParentWin,xobj->gc,segm,2); - - segm[0].x1=xobj->x-i; - segm[0].y1=xobj->y+xobj->height+i-1; - segm[0].x2=xobj->x+xobj->width+i-1; - segm[0].y2=xobj->y+xobj->height+i-1; - segm[1].x1=xobj->x+xobj->width+i-1; - segm[1].y1=xobj->y-i; - segm[1].x2=xobj->x+xobj->width+i-1; - segm[1].y2=xobj->y+xobj->height+i-1; - if (xobj->value==-1) - XSetForeground(xobj->display,xobj->gc,xobj->TabColor[li].pixel); - else - XSetForeground(xobj->display,xobj->gc,xobj->TabColor[shad].pixel); - XDrawSegments(xobj->display,*xobj->ParentWin,xobj->gc,segm,2); - } - } - -} - -void InitSwallow(struct XObj *xobj) -{ - unsigned long mask; - XSetWindowAttributes Attr; - - /* Enregistrement des couleurs et de la police */ - MyAllocNamedColor(xobj->display,*xobj->colormap,xobj->forecolor,&xobj->TabColor[fore]); - MyAllocNamedColor(xobj->display,*xobj->colormap,xobj->backcolor,&xobj->TabColor[back]); - MyAllocNamedColor(xobj->display,*xobj->colormap,xobj->licolor,&xobj->TabColor[li]); - MyAllocNamedColor(xobj->display,*xobj->colormap,xobj->shadcolor,&xobj->TabColor[shad]); - MyAllocNamedColor(xobj->display,*xobj->colormap,"#000000",&xobj->TabColor[black]); - MyAllocNamedColor(xobj->display,*xobj->colormap,"#FFFFFF",&xobj->TabColor[white]); - - mask=0; - xobj->win=XCreateWindow(xobj->display,*xobj->ParentWin, - -1000,-1000,xobj->width,xobj->height,0, - CopyFromParent,InputOutput,CopyFromParent, - mask,&Attr); - - /* Redimensionnement du widget */ - if (xobj->height<30) - xobj->height=30; - if (xobj->width<30) - xobj->width=30; - - if (xobj->swallow!=NULL) - { - SendText(fd,xobj->swallow,0); - } - else - fprintf(stderr,"Error\n"); - -} - -void DestroySwallow(struct XObj *xobj) -{ - XSetCloseDownMode(xobj->display,DestroyAll); - /* Arrete le programme swallow */ - if (xobj->win!=None) - XKillClient(xobj->display, xobj->win); -} - -void DrawSwallow(struct XObj *xobj) -{ - DrawRelief(xobj); -} - -void EvtMouseSwallow(struct XObj *xobj,XButtonEvent *EvtButton) -{ -} - -void EvtKeySwallow(struct XObj *xobj,XKeyEvent *EvtKey) -{ -} - -/* Recupere le pointeur de la fenetre Swallow */ -void CheckForHangon(struct XObj *xobj,unsigned long *body) -{ - char *cbody; - - cbody=(char*)calloc(100,sizeof(char)); - sprintf(cbody,"%s",(char *)&body[3]); - if(strcmp(cbody,xobj->title)==0) - { - xobj->win = (Window)body[0]; - free(xobj->title); - xobj->title=(char*)calloc(sizeof(char),20); - sprintf(xobj->title,"No window"); - XUnmapWindow(xobj->display,xobj->win); - XSetWindowBorderWidth(xobj->display,xobj->win,0); - } - free(cbody); -} - -void swallow(struct XObj *xobj,unsigned long *body) -{ - - if(xobj->win == (Window)body[0]) - { - XReparentWindow(xobj->display,xobj->win,*xobj->ParentWin,xobj->x,xobj->y); - XResizeWindow(xobj->display,xobj->win,xobj->width,xobj->height); - XMapWindow(xobj->display,xobj->win); - } -} - -void ProcessMsgSwallow(struct XObj *xobj,unsigned long type,unsigned long *body) -{ - switch(type) - { - case M_MAP: - swallow(xobj,body); - break; - case M_RES_NAME: - break; - case M_RES_CLASS: - break; - case M_WINDOW_NAME: - CheckForHangon(xobj,body); - break; - default: - break; - } -} - - - - - - diff --git a/app/fvwm/extras/FvwmScript/Widgets/TextField.c b/app/fvwm/extras/FvwmScript/Widgets/TextField.c deleted file mode 100644 index b0edf8ffa..000000000 --- a/app/fvwm/extras/FvwmScript/Widgets/TextField.c +++ /dev/null @@ -1,409 +0,0 @@ -#include "Tools.h" - - -/***********************************************/ -/* Fonction for TextField */ -/***********************************************/ -void InitTextField(struct XObj *xobj) -{ - unsigned long mask; - XSetWindowAttributes Attr; - int i; - int asc,desc,dir; - XCharStruct struc; - - /* Enregistrement des couleurs et de la police */ - MyAllocNamedColor(xobj->display,*xobj->colormap,xobj->forecolor,&xobj->TabColor[fore]); - MyAllocNamedColor(xobj->display,*xobj->colormap,xobj->backcolor,&xobj->TabColor[back]); - MyAllocNamedColor(xobj->display,*xobj->colormap,xobj->licolor,&xobj->TabColor[li]); - MyAllocNamedColor(xobj->display,*xobj->colormap,xobj->shadcolor,&xobj->TabColor[shad]); - MyAllocNamedColor(xobj->display,*xobj->colormap,"#000000",&xobj->TabColor[black]); - MyAllocNamedColor(xobj->display,*xobj->colormap,"#FFFFFF",&xobj->TabColor[white]); - - mask=0; - Attr.cursor=XCreateFontCursor(xobj->display,XC_xterm); - mask|=CWCursor; /* Curseur pour la fenetre */ - Attr.background_pixel=xobj->TabColor[back].pixel; - mask|=CWBackPixel; - - xobj->win=XCreateWindow(xobj->display,*xobj->ParentWin, - xobj->x,xobj->y,xobj->width,xobj->height,0, - CopyFromParent,InputOutput,CopyFromParent, - mask,&Attr); - xobj->gc=XCreateGC(xobj->display,xobj->win,0,NULL); - XSetForeground(xobj->display,xobj->gc,xobj->TabColor[fore].pixel); - XSetBackground(xobj->display,xobj->gc,xobj->TabColor[back].pixel); - if ((xobj->xfont=XLoadQueryFont(xobj->display,xobj->font))==NULL) - fprintf(stderr,"Can't load font %s\n",xobj->font); - else - XSetFont(xobj->display,xobj->gc,xobj->xfont->fid); - - XSetLineAttributes(xobj->display,xobj->gc,1,LineSolid,CapRound,JoinMiter); - /* value2 représente la fin de la zone selectionnee */ - if (xobj->value>strlen(xobj->title)) - xobj->value=strlen(xobj->title); - xobj->value2=xobj->value; - - /* Redimensionnement du widget */ - XTextExtents(xobj->xfont,"lp",strlen("lp"),&dir,&asc,&desc,&struc); - xobj->height=asc+desc+10; - i=XTextWidth(xobj->xfont,xobj->title,strlen(xobj->title))+40; - if (xobj->width<i) - xobj->width=i; - XResizeWindow(xobj->display,xobj->win,xobj->width,xobj->height); - -} - -void DestroyTextField(struct XObj *xobj) -{ - XFreeFont(xobj->display,xobj->xfont); - XFreeGC(xobj->display,xobj->gc); - XDestroyWindow(xobj->display,xobj->win); -} - -/* Dessin du curseur du texte */ -void DrawPointTxt(struct XObj *xobj,unsigned int color) -{ -#define dec 2 - int x,y; - XSegment segm[2]; - int asc,desc,dir; - XCharStruct struc; - - XTextExtents(xobj->xfont,"lp",strlen("lp"),&dir,&asc,&desc,&struc); - x=XTextWidth(xobj->xfont,xobj->title,xobj->value)+5; - y=asc+5; - - segm[0].x1=x; - segm[0].y1=y; - segm[0].x2=x-dec; - segm[0].y2=y+dec; - segm[1].x1=x; - segm[1].y1=y; - segm[1].x2=x+dec; - segm[1].y2=y+dec; - XSetForeground(xobj->display,xobj->gc,color); - XDrawSegments(xobj->display,xobj->win,xobj->gc,segm,2); -} - -/* Dessin du contenu du champs texte */ -void DrawTextField(struct XObj *xobj) -{ - int x1,y1; - int x2,l; - int desc,dir,asc; - XCharStruct struc; - - l=strlen(xobj->title); - if (xobj->value>l) - xobj->value=l; - if (xobj->value2>l) - xobj->value2=l; - DrawReliefRect(0,0,xobj->width,xobj->height,xobj, - xobj->TabColor[shad].pixel,xobj->TabColor[li].pixel,xobj->TabColor[black].pixel,1); - XSetForeground(xobj->display,xobj->gc,xobj->TabColor[back].pixel); - XFillRectangle(xobj->display,xobj->win,xobj->gc,3,3,xobj->width-6,xobj->height-6); - XSetForeground(xobj->display,xobj->gc,xobj->TabColor[fore].pixel); - XTextExtents(xobj->xfont,"lp",strlen("lp"),&dir,&y1,&desc,&struc); - XDrawImageString(xobj->display,xobj->win,xobj->gc,5,y1+5,xobj->title,strlen(xobj->title)); - - /* Dessin de la zone selectionnee */ - XSetFunction(xobj->display,xobj->gc,GXinvert); - if (xobj->value2>xobj->value) /* Curseur avant la souris */ - { - x1=XTextWidth(xobj->xfont,&xobj->title[0],xobj->value); - x2=XTextWidth(xobj->xfont,&xobj->title[xobj->value],xobj->value2-xobj->value); - } - else /* Curseur apres la souris */ - { - x1=XTextWidth(xobj->xfont,&xobj->title[0],xobj->value2); - x2=XTextWidth(xobj->xfont,&xobj->title[xobj->value2],xobj->value-xobj->value2); - } - XTextExtents(xobj->xfont,"lp",strlen("lp"),&dir,&asc,&desc,&struc); - XFillRectangle(xobj->display,xobj->win,xobj->gc,x1+5,7,x2,y1+desc-2); - XSetFunction(xobj->display,xobj->gc,GXcopy); - - /* Dessin du point d'insertion */ - DrawPointTxt(xobj,xobj->TabColor[fore].pixel); -} - -void EvtMouseTextField(struct XObj *xobj,XButtonEvent *EvtButton) -{ - unsigned int modif; - int x1,x2,y1,y2,i; - Window Win1,Win2; - int PosCurs=0; - int SizeBuf; - char *str; - int NewPos; - Atom type; - XEvent event; - int ButPress=1; - int format; - unsigned long longueur,octets_restant; - unsigned char *donnees=""; - XRectangle rect; - - /* On deplace le curseur a la position de la souris */ - /* On recupere la position de la souris */ - switch (EvtButton->button) - { - case Button1: - XQueryPointer(xobj->display,*xobj->ParentWin,&Win1,&Win2,&x1,&y1,&x2,&y2,&modif); - x2=x2-xobj->x; - PosCurs=0; - while ((PosCurs<strlen(xobj->title))&&(x2>XTextWidth(xobj->xfont,xobj->title,PosCurs)+8)) - PosCurs++; - DrawPointTxt(xobj,xobj->TabColor[back].pixel); - xobj->value=PosCurs; - xobj->value2=PosCurs; - DrawPointTxt(xobj,xobj->TabColor[fore].pixel); - DrawTextField(xobj); - - while (ButPress) - { - XNextEvent(xobj->display, &event); - switch (event.type) - { - case MotionNotify: - XQueryPointer(xobj->display,*xobj->ParentWin,&Win1,&Win2,&x1,&y1,&x2,&y2,&modif); - x2=x2-xobj->x; - PosCurs=0; - while ((PosCurs<strlen(xobj->title))&&(x2>XTextWidth(xobj->xfont,xobj->title,PosCurs)+8)) - PosCurs++; - /* Limitation de la zone de dessin */ - if (PosCurs>xobj->value2) - { - rect.x=XTextWidth(xobj->xfont,xobj->title,xobj->value2); - rect.y=0; - rect.width=XTextWidth(xobj->xfont,xobj->title,PosCurs+1)-rect.x+1; - rect.height=xobj->height; - XSetClipRectangles(xobj->display,xobj->gc,0,0,&rect,1,Unsorted); - xobj->value2=PosCurs; - DrawTextField(xobj); - XSetClipMask(xobj->display,xobj->gc,None); - } - else - if (PosCurs<xobj->value2) - { - rect.x=XTextWidth(xobj->xfont,xobj->title,PosCurs)-1; - rect.y=0; - rect.width=XTextWidth(xobj->xfont,xobj->title,xobj->value2+1)-rect.x+2; - rect.height=xobj->height; - XSetClipRectangles(xobj->display,xobj->gc,0,0,&rect,1,Unsorted); - xobj->value2=PosCurs; - DrawTextField(xobj); - XSetClipMask(xobj->display,xobj->gc,None); - } - - break; - case ButtonRelease: - ButPress=0; - break; - } - } - XSetClipMask(xobj->display,xobj->gc,None); - /* Enregistrement de la selection dans le presse papier */ - /* Le programme devient proprietaire de la selection */ - if (xobj->value!=xobj->value2) - { - str=(char*)GetText(xobj,xobj->value2); - for (i=0;i<=7;i++) - XStoreBuffer(xobj->display,str,strlen(str),i); - Scrapt=(char*)realloc((void*)Scrapt,(strlen(str)+2)*sizeof(char)); - Scrapt=strcpy(Scrapt,str); - free(str); - x11base->HaveXSelection=True; - XSetSelectionOwner(x11base->display,XA_PRIMARY,x11base->win,EvtButton->time); - SelectOneTextField(xobj); - } - break; - - case Button2: /* Colle le texte */ - /* Si l'application possede pas la selection, elle la demande */ - /* sinon elle lit son presse papier */ - if (!x11base->HaveXSelection) - { - /* Demande de la selection */ - XConvertSelection(xobj->display,XA_PRIMARY,XA_STRING,propriete,*xobj->ParentWin, - EvtButton->time); - while (!(XCheckTypedEvent(xobj->display,SelectionNotify,&event))) - ; - if (event.xselection.property!=None) - if (event.xselection.selection==XA_PRIMARY) - { - XGetWindowProperty(xobj->display,event.xselection.requestor,event.xselection.property,0, - 8192,False,event.xselection.target,&type,&format,&longueur,&octets_restant, - &donnees); - if (longueur>0) - { - Scrapt=(char*)realloc((void*)Scrapt,(longueur+1)*sizeof(char)); - Scrapt=strcpy(Scrapt,donnees); - XDeleteProperty(xobj->display,event.xselection.requestor,event.xselection.property); - XFree(donnees); - } - } - } - SizeBuf=strlen(Scrapt); - if (SizeBuf>0) - { - NewPos=InsertText(xobj,Scrapt,SizeBuf); - DrawPointTxt(xobj,xobj->TabColor[back].pixel); - xobj->value=NewPos; - xobj->value2=NewPos; - DrawPointTxt(xobj,xobj->TabColor[fore].pixel); - DrawTextField(xobj); - SendMsg(xobj,SingleClic); - } - break; - - case Button3: /* Appuie sur le troisieme bouton */ - XQueryPointer(xobj->display,*xobj->ParentWin,&Win1,&Win2,&x1,&y1,&x2,&y2,&modif); - x2=x2-xobj->x; - PosCurs=0; - while ((PosCurs<strlen(xobj->title))&& - (x2>XTextWidth(xobj->xfont,xobj->title,PosCurs)+8)) - PosCurs++; - if ((PosCurs<xobj->value) && (xobj->value<xobj->value2)) - xobj->value=xobj->value2; - if ((PosCurs>xobj->value) && (xobj->value>xobj->value2)) - xobj->value=xobj->value2; - xobj->value2=PosCurs; - DrawTextField(xobj); - - while (ButPress) - { - XNextEvent(xobj->display, &event); - switch (event.type) - { - case MotionNotify: - XQueryPointer(xobj->display,*xobj->ParentWin,&Win1,&Win2,&x1,&y1,&x2,&y2,&modif); - x2=x2-xobj->x; - while ((PosCurs<strlen(xobj->title))&&(x2>XTextWidth(xobj->xfont,xobj->title,PosCurs)+8)) - PosCurs++; - if (PosCurs>xobj->value2) - { - rect.x=XTextWidth(xobj->xfont,xobj->title,xobj->value2); - rect.y=0; - rect.width=XTextWidth(xobj->xfont,xobj->title,PosCurs+1)-rect.x+1; - rect.height=xobj->height; - XSetClipRectangles(xobj->display,xobj->gc,0,0,&rect,1,Unsorted); - xobj->value2=PosCurs; - DrawTextField(xobj); - XSetClipMask(xobj->display,xobj->gc,None); - } - else - if (PosCurs<xobj->value2) - { - rect.x=XTextWidth(xobj->xfont,xobj->title,PosCurs)-1; - rect.y=0; - rect.width=XTextWidth(xobj->xfont,xobj->title,xobj->value2+1)-rect.x+2; - rect.height=xobj->height; - XSetClipRectangles(xobj->display,xobj->gc,0,0,&rect,1,Unsorted); - xobj->value2=PosCurs; - DrawTextField(xobj); - XSetClipMask(xobj->display,xobj->gc,None); - } - PosCurs=0; - break; - case ButtonRelease: - ButPress=0; - break; - } - } - if (xobj->value!=xobj->value2) - { - str=(char*)GetText(xobj,xobj->value2); - for (i=0;i<=7;i++) - XStoreBuffer(xobj->display,str,strlen(str),i); - Scrapt=(char*)realloc((void*)Scrapt,(strlen(str)+2)*sizeof(char)); - Scrapt=strcpy(Scrapt,str); - free(str); - x11base->HaveXSelection=True; - XSetSelectionOwner(x11base->display,XA_PRIMARY,x11base->win,EvtButton->time); - } - break; - } -} - -void EvtKeyTextField(struct XObj *xobj,XKeyEvent *EvtKey) -{ - int i,x2; - char car[11]; - char* carks2; - char* carks = NULL; - KeySym ks; - int Size; - int NewPos; - - /* Recherche du charactere */ - i=XLookupString(EvtKey,car,10,&ks,NULL); - NewPos=xobj->value; - car[i]='\0'; - carks2=XKeysymToString(ks); - - if (carks2!=NULL) - { - carks=(char*)calloc(sizeof(char),30); - sprintf(carks,"%s",carks2); - if (strcmp(carks,"Right")==0) - { - NewPos++; - if (NewPos>strlen(xobj->title)) - NewPos=strlen(xobj->title); - } - else if (strcmp(carks,"Left")==0) - { - NewPos--; - if (NewPos<0) - NewPos=0; - } - else if (strcmp(carks,"Return")==0) - { - ; - } - else if ((strcmp(carks,"Delete")==0)||(strcmp(carks,"BackSpace")==0)) - { - if (NewPos>0) - { - Size=strlen(xobj->title); - memmove(&xobj->title[NewPos-1],&xobj->title[NewPos], - Size-NewPos+1); - xobj->title=(char*)realloc(xobj->title,(Size)*sizeof(char)); - NewPos--; - SendMsg(xobj,SingleClic); - } - } - else if (i!=0) /* Cas d'un caractere normal */ - { - /* Insertion du caractere dans le titre */ - Size=strlen(xobj->title); - xobj->title=(char*)realloc(xobj->title,(2+Size)*sizeof(char)); - memmove(&xobj->title[NewPos+1],&xobj->title[NewPos], - Size-NewPos+1); - xobj->title[NewPos]=car[0]; - NewPos++; - SendMsg(xobj,SingleClic); - } - - } - - if ((xobj->value!=NewPos)||(xobj->value2!=NewPos)) - { - XSetForeground(xobj->display,xobj->gc,xobj->TabColor[back].pixel); - x2=XTextWidth(xobj->xfont,xobj->title,strlen(xobj->title)); - XFillRectangle(xobj->display,xobj->win,xobj->gc,x2+4,4,xobj->width-x2-8,xobj->height-8); - xobj->value=NewPos; - xobj->value2=NewPos; - DrawPointTxt(xobj,xobj->TabColor[fore].pixel); - DrawTextField(xobj); - } - free(carks); -} - -void ProcessMsgTextField(struct XObj *xobj,unsigned long type,unsigned long *body) -{ -} - - - diff --git a/app/fvwm/extras/FvwmScript/Widgets/Tools.c b/app/fvwm/extras/FvwmScript/Widgets/Tools.c deleted file mode 100644 index 7d0f28645..000000000 --- a/app/fvwm/extras/FvwmScript/Widgets/Tools.c +++ /dev/null @@ -1,572 +0,0 @@ -#include "Tools.h" - -/***********************************************/ -/* Fonction d'ecriture en relief */ -/***********************************************/ -void DrawString(Display *dpy,GC gc,Window win,int x,int y,char *str, - int strl,unsigned long ForeC,unsigned long HiC, - unsigned long BackC,int WithRelief) -{ - if (WithRelief) - { - XSetBackground(dpy,gc,BackC); - XSetForeground(dpy,gc,HiC); - XDrawImageString(dpy,win,gc,x+1,y+1,str,strl); - XSetForeground(dpy,gc,ForeC); - XDrawString(dpy,win,gc,x,y,str,strl); - } - else - { - XSetBackground(dpy,gc,BackC); - XSetForeground(dpy,gc,ForeC); - XDrawImageString(dpy,win,gc,x,y+1,str,strl); - } -} - - -/**************************************************/ -/* Retourne le titre de l'option id du menu */ -/**************************************************/ -char* GetMenuTitle(char *str,int id) -{ - int i=1; - int w=0; - int w2=0; - char* TempStr; - - while ((str[w+w2]!='\0')&&(str[w+w2]!='|')) - w2++; - - while ((i<id)&&(str[w]!='\0')) - { - i++; - if (str[w+w2]=='|') w2++; - w=w+w2; - w2=0; - while ((str[w+w2]!='\0')&&(str[w+w2]!='|')) - w2++; - } - TempStr=(char*)calloc(sizeof(char),w2+1); - TempStr=strncpy(TempStr,&str[w],w2); - return TempStr; -} - -/***********************************************************/ -/* Dessine le contenu de la fenetre du popup-menu */ -/***********************************************************/ -void DrawPMenu(struct XObj *xobj,Window WinPop,int h,int StrtOpt) -{ - XSegment segm[2]; - int i; - char *str; - int x,y; - int width,height; - Window Root; - int asc,desc,dir; - XCharStruct struc; - - XGetGeometry(xobj->display,WinPop,&Root,&x,&y,&width,&height,&i,&i); - for (i=0;i<2;i++) - { - segm[0].x1=i; - segm[0].y1=i; - segm[0].x2=width-i-1; - segm[0].y2=i; - - segm[1].x1=i; - segm[1].y1=i; - segm[1].x2=i; - segm[1].y2=height-i-1; - XSetForeground(xobj->display,xobj->gc,xobj->TabColor[li].pixel); - XDrawSegments(xobj->display,WinPop,xobj->gc,segm,2); - - segm[0].x1=1+i; - segm[0].y1=height-i-1; - segm[0].x2=width-i-1; - segm[0].y2=height-i-1; - - segm[1].x1=width-i-1; - segm[1].y1=i; - segm[1].x2=width-i-1; - segm[1].y2=height-i-1; - XSetForeground(xobj->display,xobj->gc,xobj->TabColor[shad].pixel); - XDrawSegments(xobj->display,WinPop,xobj->gc,segm,2); - } - /* Ecriture des options */ - x=0; - for (i=StrtOpt;i<=xobj->value3;i++) - { - str=(char*)GetMenuTitle(xobj->title,i); - if (x<XTextWidth(xobj->xfont,str,strlen(str))) - x=XTextWidth(xobj->xfont,str,strlen(str)); - free(str); - } - for (i=StrtOpt;i<=xobj->value3;i++) - { - str=(char*)GetMenuTitle(xobj->title,i); - XTextExtents(xobj->xfont,"lp",strlen("lp"),&dir,&asc,&desc,&struc); - y=h*(i-StrtOpt)+asc+4; - DrawString(xobj->display,xobj->gc,WinPop,width-x-8,y,str, - strlen(str),xobj->TabColor[fore].pixel, - xobj->TabColor[li].pixel,xobj->TabColor[back].pixel, - !xobj->flags[1]); - free(str); - } -} - -/***********************************************************/ -/* Dessine l'option active d'un menu */ -/***********************************************************/ -void SelectMenu(struct XObj *xobj,Window WinPop,int hOpt,int newvalue,int Show) -{ - XSegment segm[2]; - int i; - int x,y; - int width,height; - Window Root; - - XGetGeometry(xobj->display,WinPop,&Root,&x,&y,&width,&height,&i,&i); - y=hOpt*(newvalue-1); - for (i=0;i<2;i++) - { - segm[0].x1=i+2; - segm[0].y1=i+y+2; - segm[0].x2=width-i-3; - segm[0].y2=i+y+2; - - segm[1].x1=i+2; - segm[1].y1=i+y+2; - segm[1].x2=i+2; - segm[1].y2=y+hOpt-4-i; - if (Show) - XSetForeground(xobj->display,xobj->gc,xobj->TabColor[li].pixel); - else - XSetForeground(xobj->display,xobj->gc,xobj->TabColor[back].pixel); - XDrawSegments(xobj->display,WinPop,xobj->gc,segm,2); - - segm[0].x1=i+3; - segm[0].y1=y-i-3+hOpt; - segm[0].x2=width-i-3; - segm[0].y2=y-i-3+hOpt; - - segm[1].x1=width-i-3; - segm[1].y1=i+y+2; - segm[1].x2=width-i-3; - segm[1].y2=i+y-4+hOpt; - if (Show) - XSetForeground(xobj->display,xobj->gc,xobj->TabColor[shad].pixel); - else - XSetForeground(xobj->display,xobj->gc,xobj->TabColor[back].pixel); - XDrawSegments(xobj->display,WinPop,xobj->gc,segm,2); - } -} - -/**************************************************/ -/* Compte le nombre d'option contenu dans un menu */ -/**************************************************/ -int CountOption(char *str) -{ - int i=1; - int w=0; - - while (str[w]!='\0') - { - if (str[w]=='|') i++; - w++; - } - - return i; -} - - -/*****************************************/ -/* Dessine l'icone et le titre du widget */ -/*****************************************/ -void DrawIconStr(int offset,struct XObj *xobj,int DoRedraw) -{ - int i,j; - char *str; - int asc,desc,dir; - XCharStruct struc; - - XTextExtents(xobj->xfont,"lp",strlen("lp"),&dir,&asc,&desc,&struc); - if (DoRedraw) - { - XSetForeground(xobj->display,xobj->gc,xobj->TabColor[back].pixel); - XFillRectangle(xobj->display,xobj->win,xobj->gc,4,4,xobj->width-8,xobj->height-8); - } - - if (xobj->iconPixmap==None) /* Si l'icone n'existe pas */ - { - str=GetMenuTitle(xobj->title,1); - j=xobj->height/2+(asc+desc)/2+offset-3; - i=(xobj->width-XTextWidth(xobj->xfont,str,strlen(str)))/2+offset; - DrawString(xobj->display,xobj->gc,xobj->win,i,j,str, - strlen(str),xobj->TabColor[fore].pixel,xobj->TabColor[li].pixel, - xobj->TabColor[back].pixel,!xobj->flags[1]); - free(str); - } - else /* Si l'icone existe */ - { - if (xobj->title!=NULL) - { - str=GetMenuTitle(xobj->title,1); - if (strlen(str)!=0) - { - i=(xobj->width-XTextWidth(xobj->xfont,str,strlen(str)))/2+offset; - j=((xobj->height - xobj->icon_h)/4)*3 + xobj->icon_h+offset+(asc+desc)/2-3; - DrawString(xobj->display,xobj->gc,xobj->win,i,j,str, - strlen(str),xobj->TabColor[fore].pixel,xobj->TabColor[li].pixel, - xobj->TabColor[back].pixel,!xobj->flags[1]); - } - free(str); - } - /* Dessin de l'icone */ - if (xobj->icon_maskPixmap!=None) - XSetClipMask(xobj->display,xobj->gc,xobj->icon_maskPixmap); - j=(xobj->height - xobj->icon_h)/2+offset; - i=(xobj->width - xobj->icon_w)/2+offset; - XSetClipOrigin(xobj->display,xobj->gc,i,j); - XSetForeground(xobj->display,xobj->gc,xobj->TabColor[fore].pixel); - XCopyArea(xobj->display,xobj->iconPixmap,xobj->win,xobj->gc,0,0, - xobj->icon_w,xobj->icon_h,i,j); - XSetClipMask(xobj->display,xobj->gc,None); - } -} - -/***********************************************/ -/* Fonction de dessin d'un rectangle en relief */ -/***********************************************/ -void DrawReliefRect(int x,int y,int width,int height,struct XObj *xobj, - unsigned int LiC, unsigned int ShadC,unsigned int ForeC,int RectIn) -{ - XSegment segm[2]; - int i; - int j; - -/* XSetForeground(xobj->display,xobj->gc,xobj->TabColor[back].pixel); - XFillRectangle(xobj->display,xobj->win,xobj->gc,x,y,width,height);*/ - width--; - height--; - - for (i=1;i<3;i++) - { - j=-1-i; - segm[0].x1=i+x; - segm[0].y1=i+y; - segm[0].x2=i+x; - segm[0].y2=height+j+y+1; - segm[1].x1=i+x; - segm[1].y1=i+y; - segm[1].x2=width+j+x+1; - segm[1].y2=i+y; - XSetForeground(xobj->display,xobj->gc,LiC); - XDrawSegments(xobj->display,xobj->win,xobj->gc,segm,2); - - segm[0].x1=width+j+x+1; - segm[0].y1=i+1+y; - segm[0].x2=width+j+x+1; - segm[0].y2=height+j+y+1; - segm[1].x1=i+1+x; - segm[1].y1=height+j+y+1; - segm[1].x2=width+j+x+1; - segm[1].y2=height+j+y+1; - XSetForeground(xobj->display,xobj->gc,ShadC); - XDrawSegments(xobj->display,xobj->win,xobj->gc,segm,2); - } - XSetForeground(xobj->display,xobj->gc,ForeC); - if (RectIn==1) /* Rectangle a l'interieur */ - XDrawRectangle(xobj->display,xobj->win,xobj->gc,x+3,y+3, - width-6,height-6); - else if (RectIn==0) /* Rectangle a l'exterieur */ - XDrawRectangle(xobj->display,xobj->win,xobj->gc,x,y,width,height); - XSetForeground(xobj->display,xobj->gc,xobj->TabColor[fore].pixel); -} - -/***********************************************/ -/* Calcul ascent de la police */ -/***********************************************/ -int GetAscFont(XFontStruct *xfont) -{ - int asc,desc,dir; - XCharStruct struc; - - XTextExtents(xfont,"lp",strlen("lp"),&dir,&asc,&desc,&struc); - return asc; -} - -/***********************************************/ -/* Insertion d'un str dans le titre d'un objet */ -/***********************************************/ -int InsertText(struct XObj *xobj,char *str,int SizeStr) -{ - int Size; - int NewPos; - int i; - - /* Insertion du caractere dans le titre */ - NewPos=xobj->value; - Size=strlen(xobj->title); - xobj->title=(char*)realloc(xobj->title,(1+SizeStr+Size)*sizeof(char)); - memmove(&xobj->title[NewPos+SizeStr],&xobj->title[NewPos], - Size-NewPos+1); - for (i=NewPos;i<NewPos+SizeStr;i++) - xobj->title[i]=str[i-NewPos]; - NewPos=NewPos+SizeStr; - return NewPos; -} - -/******************************************************/ -/* Lecture d'un morceau de texte de xobj->value à End */ -/******************************************************/ -char *GetText(struct XObj *xobj,int End) -{ - char *str; - int a,b; - - if (End>xobj->value) - { - a=xobj->value; - b=End; - } - else - { - b=xobj->value; - a=End; - } - str=(char*)calloc(b-a+2,1); - memcpy(str,&xobj->title[a],b-a); - str[b-a+1]='\0'; - return str; -} - -void UnselectAllTextField(struct XObj **txobj) -{ - int i; - - for (i=0;i<nbobj;i++) - if (txobj[i]->TypeWidget==TextField) - if (txobj[i]->value2!=txobj[i]->value) - { - txobj[i]->value2=txobj[i]->value; - txobj[i]->DrawObj(txobj[i]); - return; - } -} - -void SelectOneTextField(struct XObj *xobj) -{ - int i; - - for (i=0;i<nbobj;i++) - if ((tabxobj[i]->TypeWidget==TextField)&&(xobj!=tabxobj[i])) - if (tabxobj[i]->value2!=tabxobj[i]->value) - { - tabxobj[i]->value2=tabxobj[i]->value; - tabxobj[i]->DrawObj(tabxobj[i]); - return; - } -} - -/************************************************************/ -/* Dessine une fleche direction nord */ -/************************************************************/ -void DrawArrowN(struct XObj *xobj,int x,int y,int Press) -{ - XSegment segm[4]; - - segm[0].x1=5+x; - segm[0].y1=1+y; - segm[0].x2=0+x; - segm[0].y2=12+y; - segm[1].x1=5+x; - segm[1].y1=3+y; - segm[1].x2=1+x; - segm[1].y2=12+y; - if (Press==1) - XSetForeground(xobj->display,xobj->gc,xobj->TabColor[shad].pixel); - else - XSetForeground(xobj->display,xobj->gc,xobj->TabColor[li].pixel); - XDrawSegments(xobj->display,xobj->win,xobj->gc,segm,2); - - segm[0].x1=2+x; - segm[0].y1=11+y; - segm[0].x2=11+x; - segm[0].y2=11+y; - segm[1].x1=1+x; - segm[1].y1=12+y; - segm[1].x2=12+x; - segm[1].y2=12+y; - - segm[2].x1=6+x; - segm[2].y1=0+y; - segm[2].x2=12+x; - segm[2].y2=12+y; - segm[3].x1=6+x; - segm[3].y1=2+y; - segm[3].x2=10+x; - segm[3].y2=11+y; - if (Press==1) - XSetForeground(xobj->display,xobj->gc,xobj->TabColor[li].pixel); - else - XSetForeground(xobj->display,xobj->gc,xobj->TabColor[shad].pixel); - XDrawSegments(xobj->display,xobj->win,xobj->gc,segm,4); -} - -/************************************************************/ -/* Dessine une fleche direction sud */ -/************************************************************/ -void DrawArrowS(struct XObj *xobj,int x,int y,int Press) -{ - XSegment segm[4]; - - segm[0].x1=0+x; - segm[0].y1=0+y; - segm[0].x2=12+x; - segm[0].y2=0+y; - segm[1].x1=1+x; - segm[1].y1=1+y; - segm[1].x2=11+x; - segm[1].y2=1+y; - - segm[2].x1=1+x; - segm[2].y1=1+y; - segm[2].x2=5+x; - segm[2].y2=10+y; - segm[3].x1=2+x; - segm[3].y1=1+y; - segm[3].x2=5+x; - segm[3].y2=8+y; - if (Press==1) - XSetForeground(xobj->display,xobj->gc,xobj->TabColor[shad].pixel); - else - XSetForeground(xobj->display,xobj->gc,xobj->TabColor[li].pixel); - XDrawSegments(xobj->display,xobj->win,xobj->gc,segm,4); - - segm[0].x1=6+x; - segm[0].y1=11+y; - segm[0].x2=12+x; - segm[0].y2=1+y; - segm[1].x1=6+x; - segm[1].y1=10+y; - segm[1].x2=10+x; - segm[1].y2=2+y; - if (Press==1) - XSetForeground(xobj->display,xobj->gc,xobj->TabColor[li].pixel); - else - XSetForeground(xobj->display,xobj->gc,xobj->TabColor[shad].pixel); - XDrawSegments(xobj->display,xobj->win,xobj->gc,segm,2); -} - -void DrawArrowE(struct XObj *xobj,int x,int y,int Press) -{ - XSegment segm[4]; - - segm[0].x1=12+x; - segm[0].y1=6+y; - segm[0].x2=1+x; - segm[0].y2=12+y; - segm[1].x1=10+x; - segm[1].y1=6+y; - segm[1].x2=2+x; - segm[1].y2=10+y; - if (Press==1) - XSetForeground(xobj->display,xobj->gc,xobj->TabColor[li].pixel); - else - XSetForeground(xobj->display,xobj->gc,xobj->TabColor[shad].pixel); - XDrawSegments(xobj->display,xobj->win,xobj->gc,segm,2); - - segm[0].x1=0+x; - segm[0].y1=0+y; - segm[0].x2=0+x; - segm[0].y2=12+y; - segm[1].x1=1+x; - segm[1].y1=0+y; - segm[1].x2=1+x; - segm[1].y2=11+y; - - segm[2].x1=0+x; - segm[2].y1=0+y; - segm[2].x2=11+x; - segm[2].y2=5+y; - segm[3].x1=0+x; - segm[3].y1=1+y; - segm[3].x2=9+x; - segm[3].y2=5+y; - if (Press==1) - XSetForeground(xobj->display,xobj->gc,xobj->TabColor[shad].pixel); - else - XSetForeground(xobj->display,xobj->gc,xobj->TabColor[li].pixel); - XDrawSegments(xobj->display,xobj->win,xobj->gc,segm,4); -} - -void DrawArrowW(struct XObj *xobj,int x,int y,int Press) -{ - XSegment segm[4]; - - segm[0].x1=2+x; - segm[0].y1=5+y; - segm[0].x2=12+x; - segm[0].y2=0+y; - segm[1].x1=4+x; - segm[1].y1=5+y; - segm[1].x2=10+x; - segm[1].y2=2+y; - if (Press==1) - XSetForeground(xobj->display,xobj->gc,xobj->TabColor[shad].pixel); - else - XSetForeground(xobj->display,xobj->gc,xobj->TabColor[li].pixel); - XDrawSegments(xobj->display,xobj->win,xobj->gc,segm,2); - - segm[0].x1=0+x; - segm[0].y1=6+y; - segm[0].x2=12+x; - segm[0].y2=12+y; - segm[1].x1=2+x; - segm[1].y1=6+y; - segm[1].x2=11+x; - segm[1].y2=10+y; - - segm[2].x1=12+x; - segm[2].y1=1+y; - segm[2].x2=12+x; - segm[2].y2=12+y; - segm[3].x1=11+x; - segm[3].y1=2+y; - segm[3].x2=11+x; - segm[3].y2=11+y; - if (Press==1) - XSetForeground(xobj->display,xobj->gc,xobj->TabColor[li].pixel); - else - XSetForeground(xobj->display,xobj->gc,xobj->TabColor[shad].pixel); - XDrawSegments(xobj->display,xobj->win,xobj->gc,segm,4); - } - -int PtInRect(XPoint pt,XRectangle rect) -{ - return ((pt.x>=rect.x)&&(pt.y>=rect.y)&& - (pt.x<=rect.x+rect.width)&&(pt.y<=rect.y+rect.height)); -} - -/* Arret pendant t*1/60 de secondes */ -void Wait(int t) -{ - struct timeval *tv; - long tus,ts; - - tv=(struct timeval*)calloc(1,sizeof(struct timeval)); - gettimeofday(tv,NULL); - tus=tv->tv_usec; - ts=tv->tv_sec; - while (((tv->tv_usec-tus)+(tv->tv_sec-ts)*1000000)<16667*t) - gettimeofday(tv,NULL); - free(tv); -} - -int IsItDoubleClic(struct XObj *xobj) -{ - XEvent Event; - XFlush(xobj->display); - Wait(12); - return (XCheckTypedEvent(xobj->display,ButtonPress,&Event)); -} diff --git a/app/fvwm/extras/FvwmScript/Widgets/Tools.h b/app/fvwm/extras/FvwmScript/Widgets/Tools.h deleted file mode 100644 index ab63fd9b5..000000000 --- a/app/fvwm/extras/FvwmScript/Widgets/Tools.h +++ /dev/null @@ -1,55 +0,0 @@ -#include "../types.h" - -extern char *Scrapt; -extern Atom propriete; -extern Atom type; -extern char *pixmapPath; -extern X11base *x11base; -extern int nbobj; -extern struct XObj *tabxobj[100]; -extern int x_fd; - -/* Constante pour les type de message envoie entre objets */ -/* <0 valeur reserve pour les messages internes */ -/* >0 message envoie par l'utilisateur */ -#define SingleClic -1 -#define DoubleClic -2 - -void DrawString(Display *dpy,GC gc,Window win,int x,int y,char *str, - int strl,unsigned long ForeC,unsigned long HiC, - unsigned long BackC,int WithRelief); - -char* GetMenuTitle(char *str,int id); - -void DrawPMenu(struct XObj *xobj,Window WinPop,int h,int StrtOpt); - -void SelectMenu(struct XObj *xobj,Window WinPop,int hOpt,int newvalue,int Show); - -int CountOption(char *str); - -void DrawIconStr(int offset,struct XObj *xobj,int DoRedraw); - -void DrawReliefRect(int x,int y,int width,int height,struct XObj *xobj, - unsigned int LiC, unsigned int ShadC,unsigned int ForeC,int RectIn); - -int GetAscFont(XFontStruct *xfont); - -int InsertText(struct XObj *xobj,char *str,int SizeStr); - -char *GetText(struct XObj *xobj,int End); - -void SelectOneTextField(struct XObj *xobj); - -void DrawArrowN(struct XObj *xobj,int x,int y,int Press); - -void DrawArrowS(struct XObj *xobj,int x,int y,int Press); - -void DrawArrowE(struct XObj *xobj,int x,int y,int Press); - -void DrawArrowW(struct XObj *xobj,int x,int y,int Press); - -int PtInRect(XPoint pt,XRectangle rect); - -void Wait(int t); - -int IsItDoubleClic(struct XObj *xobj); diff --git a/app/fvwm/extras/FvwmScript/Widgets/VDipstick.c b/app/fvwm/extras/FvwmScript/Widgets/VDipstick.c deleted file mode 100644 index 4357fec6d..000000000 --- a/app/fvwm/extras/FvwmScript/Widgets/VDipstick.c +++ /dev/null @@ -1,86 +0,0 @@ -#include "Tools.h" - - -/***********************************************/ -/* Fonction pour VDipstick */ -/* Création d'une jauge verticale */ -/* plusieurs options */ -/***********************************************/ -void InitVDipstick(struct XObj *xobj) -{ - unsigned long mask; - XSetWindowAttributes Attr; - - /* Enregistrement des couleurs et de la police */ - MyAllocNamedColor(xobj->display,*xobj->colormap,xobj->forecolor,&xobj->TabColor[fore]); - MyAllocNamedColor(xobj->display,*xobj->colormap,xobj->backcolor,&xobj->TabColor[back]); - MyAllocNamedColor(xobj->display,*xobj->colormap,xobj->licolor,&xobj->TabColor[li]); - MyAllocNamedColor(xobj->display,*xobj->colormap,xobj->shadcolor,&xobj->TabColor[shad]); - MyAllocNamedColor(xobj->display,*xobj->colormap,"#000000",&xobj->TabColor[black]); - MyAllocNamedColor(xobj->display,*xobj->colormap,"#FFFFFF",&xobj->TabColor[white]); - - /* Minimum size */ - if (xobj->width<11) - xobj->width=11; - if (xobj->height<30) - xobj->height=30; - - mask=0; - Attr.background_pixel=x11base->TabColor[back].pixel; - mask|=CWBackPixel; - xobj->win=XCreateWindow(xobj->display,*xobj->ParentWin, - xobj->x,xobj->y,xobj->width,xobj->height,0, - CopyFromParent,InputOutput,CopyFromParent, - mask,&Attr); - xobj->gc=XCreateGC(xobj->display,xobj->win,0,NULL); - XSetForeground(xobj->display,xobj->gc,xobj->TabColor[fore].pixel); - XSetBackground(xobj->display,xobj->gc,x11base->TabColor[back].pixel); - XSetLineAttributes(xobj->display,xobj->gc,1,LineSolid,CapRound,JoinMiter); - - if (xobj->value2>xobj->value3) - xobj->value3=xobj->value2+50; - if (xobj->value<xobj->value2) - xobj->value=xobj->value2; - if (xobj->value>xobj->value3) - xobj->value=xobj->value3; -} - -void DestroyVDipstick(struct XObj *xobj) -{ - XFreeGC(xobj->display,xobj->gc); - XDestroyWindow(xobj->display,xobj->win); -} - -void DrawVDipstick(struct XObj *xobj) -{ - int i,j; - - i=(xobj->height-4)*(xobj->value-xobj->value2)/(xobj->value3-xobj->value2); - j=xobj->height-i; - - DrawReliefRect(0,0,xobj->width,xobj->height,xobj, - x11base->TabColor[shad].pixel,x11base->TabColor[li].pixel, - x11base->TabColor[black].pixel,-1); - if (i!=0) - { - DrawReliefRect(2,j-2,xobj->width-4,i,xobj, - xobj->TabColor[li].pixel,xobj->TabColor[shad].pixel, - xobj->TabColor[black].pixel,-1); - XSetForeground(xobj->display,xobj->gc,xobj->TabColor[back].pixel); - XFillRectangle(xobj->display,xobj->win,xobj->gc,5,j+1,xobj->width-10,i-6); - } - -} - -void EvtMouseVDipstick(struct XObj *xobj,XButtonEvent *EvtButton) -{ -} - -void EvtKeyVDipstick(struct XObj *xobj,XKeyEvent *EvtKey) -{ -} - - -void ProcessMsgVDipstick(struct XObj *xobj,unsigned long type,unsigned long *body) -{ -} diff --git a/app/fvwm/extras/FvwmScript/Widgets/VScrollBar.c b/app/fvwm/extras/FvwmScript/Widgets/VScrollBar.c deleted file mode 100644 index 8e8f06074..000000000 --- a/app/fvwm/extras/FvwmScript/Widgets/VScrollBar.c +++ /dev/null @@ -1,210 +0,0 @@ -#include "Tools.h" - - - -/***********************************************/ -/* Fonction pour VScrollBar */ -/***********************************************/ -void DrawThumbV(struct XObj *xobj) -{ - int x,y,w,h; - XSegment segm; - char str[20]; - int asc,desc,dir; - XCharStruct struc; - - x=xobj->width/2-9; - y=3+(xobj->height-36)*(xobj->value-xobj->value3)/(xobj->value2-xobj->value3); - w=18; - h=30; - DrawReliefRect(x,y,w,h,xobj,xobj->TabColor[li].pixel,xobj->TabColor[shad].pixel, - xobj->TabColor[black].pixel,-1); - segm.x1=x+3; - segm.y1=y+15; - segm.x2=x+w-3; - segm.y2=y+15; - XSetForeground(xobj->display,xobj->gc,xobj->TabColor[shad].pixel); - XDrawSegments(xobj->display,xobj->win,xobj->gc,&segm,1); - segm.x1=x+3; - segm.y1=y+16; - segm.x2=x+w-3; - segm.y2=y+16; - XSetForeground(xobj->display,xobj->gc,xobj->TabColor[li].pixel); - XDrawSegments(xobj->display,xobj->win,xobj->gc,&segm,1); - XSetForeground(xobj->display,xobj->gc,xobj->TabColor[fore].pixel); - - sprintf(str,"%d",xobj->value); - x=x-XTextWidth(xobj->xfont,str,strlen(str))-6; - XTextExtents(xobj->xfont,"lp",strlen("lp"),&dir,&asc,&desc,&struc); - y=y+13+asc/2; - DrawString(xobj->display,xobj->gc,xobj->win,x,y,str, - strlen(str),xobj->TabColor[fore].pixel, - xobj->TabColor[li].pixel,xobj->TabColor[back].pixel, - !xobj->flags[1]); - -} - -void HideThumbV(struct XObj *xobj) -{ - int x,y; - char str[20]; - int asc,desc,dir; - XCharStruct struc; - - x=xobj->width/2-8; - y=4+(xobj->height-36)*(xobj->value-xobj->value3)/(xobj->value2-xobj->value3); - XSetForeground(xobj->display,xobj->gc,xobj->TabColor[back].pixel); - XFillRectangle(xobj->display,xobj->win,xobj->gc,x,y,16,28); - sprintf(str,"%d",xobj->value); - x=x-XTextWidth(xobj->xfont,str,strlen(str))-7; - XTextExtents(xobj->xfont,"lp",strlen("lp"),&dir,&asc,&desc,&struc); - XFillRectangle(xobj->display,xobj->win,xobj->gc,x,y,XTextWidth(xobj->xfont, - str,strlen(str)),asc+desc+8); -} - -void InitVScrollBar(struct XObj *xobj) -{ - unsigned long mask; - XSetWindowAttributes Attr; - int i,j; - char str[20]; - int asc,desc,dir; - XCharStruct struc; - - /* Enregistrement des couleurs et de la police */ - MyAllocNamedColor(xobj->display,*xobj->colormap,xobj->forecolor,&xobj->TabColor[fore]); - MyAllocNamedColor(xobj->display,*xobj->colormap,xobj->backcolor,&xobj->TabColor[back]); - MyAllocNamedColor(xobj->display,*xobj->colormap,xobj->licolor,&xobj->TabColor[li]); - MyAllocNamedColor(xobj->display,*xobj->colormap,xobj->shadcolor,&xobj->TabColor[shad]); - MyAllocNamedColor(xobj->display,*xobj->colormap,"#000000",&xobj->TabColor[black]); - MyAllocNamedColor(xobj->display,*xobj->colormap,"#FFFFFF",&xobj->TabColor[white]); - - - mask=0; - Attr.background_pixel=xobj->TabColor[back].pixel; - mask|=CWBackPixel; - Attr.cursor=XCreateFontCursor(xobj->display,XC_hand2); - mask|=CWCursor; /* Curseur pour la fenetre */ - - xobj->win=XCreateWindow(xobj->display,*xobj->ParentWin, - xobj->x,xobj->y,xobj->width,xobj->height,0, - CopyFromParent,InputOutput,CopyFromParent, - mask,&Attr); - xobj->gc=XCreateGC(xobj->display,xobj->win,0,NULL); - XSetForeground(xobj->display,xobj->gc,xobj->TabColor[fore].pixel); - XSetBackground(xobj->display,xobj->gc,xobj->TabColor[back].pixel); - if ((xobj->xfont=XLoadQueryFont(xobj->display,xobj->font))==NULL) - fprintf(stderr,"Can't load font %s\n",xobj->font); - else - XSetFont(xobj->display,xobj->gc,xobj->xfont->fid); - - XSetLineAttributes(xobj->display,xobj->gc,1,LineSolid,CapRound,JoinMiter); - - if ((xobj->value3-xobj->value2)<=0) - xobj->value3=xobj->value2+10; - if (!((xobj->value>=xobj->value2)&&(xobj->value<=xobj->value3))) - xobj->value=xobj->value2; - - XTextExtents(xobj->xfont,"lp",strlen("lp"),&dir,&asc,&desc,&struc); - i=(asc+desc)*2+30; - if (xobj->height<i) - xobj->height=i; - sprintf(str,"%d",xobj->value2); - i=XTextWidth(xobj->xfont,str,strlen(str)); - sprintf(str,"%d",xobj->value3); - j=XTextWidth(xobj->xfont,str,strlen(str)); - if (i<j) - i=j*2+30; - else - i=i*2+30; - xobj->width=i; - XResizeWindow(xobj->display,xobj->win,xobj->width,xobj->height); - -} - -void DestroyVScrollBar(struct XObj *xobj) -{ - XFreeFont(xobj->display,xobj->xfont); - XFreeGC(xobj->display,xobj->gc); - XDestroyWindow(xobj->display,xobj->win); -} - -void DrawVScrollBar(struct XObj *xobj) -{ - int x,y,w,h; - char str[20]; - int asc,desc,dir; - XCharStruct struc; - - /* Calcul de la taille de l'ascenseur */ - x=xobj->width/2-12; - y=0; - w=24; - h=xobj->height; - DrawReliefRect(x,y,w,h,xobj,xobj->TabColor[shad].pixel,xobj->TabColor[li].pixel, - xobj->TabColor[black].pixel,1); - DrawThumbV(xobj); - - /* Ecriture des valeurs */ - sprintf(str,"%d",xobj->value3); - x=x+26; - y=asc+2; - XTextExtents(xobj->xfont,"lp",strlen("lp"),&dir,&asc,&desc,&struc); - DrawString(xobj->display,xobj->gc,xobj->win,x,y,str, - strlen(str),xobj->TabColor[fore].pixel, - xobj->TabColor[li].pixel,xobj->TabColor[back].pixel, - !xobj->flags[1]); - sprintf(str,"%d",xobj->value2); - y=h-desc-2; - DrawString(xobj->display,xobj->gc,xobj->win,x,y,str, - strlen(str),xobj->TabColor[fore].pixel, - xobj->TabColor[li].pixel,xobj->TabColor[back].pixel, - !xobj->flags[1]); -} - -void EvtMouseVScrollBar(struct XObj *xobj,XButtonEvent *EvtButton) -{ - static XEvent event; - int oldy=0; - int oldvalue=-1; - int newvalue; - int x1,y1,x2,y2; - Window Win1,Win2; - unsigned int modif; - - do - { - /* On suit les mouvements de la souris */ - XQueryPointer(xobj->display,*xobj->ParentWin,&Win1,&Win2,&x1,&y1,&x2,&y2,&modif); - y2=y2-xobj->y; - if (y2<15) y2=15; - if (y2>xobj->height-21) y2=xobj->height-21; - if (oldy!=y2) - { - oldy=y2; - /* calcule de xobj->value */ - newvalue=(y2-15)*xobj->height/(xobj->height-36)*(xobj->value2-xobj->value3)/ - (xobj->height)+xobj->value3; - if (newvalue!=oldvalue) - { - HideThumbV(xobj); - xobj->value=newvalue; - DrawThumbV(xobj); - oldvalue=newvalue; - SendMsg(xobj,SingleClic); - } - } - } - while (!XCheckTypedEvent(xobj->display,ButtonRelease,&event)); -} - -void EvtKeyVScrollBar(struct XObj *xobj,XKeyEvent *EvtKey) -{ -} - -void ProcessMsgVScrollBar(struct XObj *xobj,unsigned long type,unsigned long *body) -{ -} - - - diff --git a/app/fvwm/extras/FvwmScript/Widgets/Widget.c b/app/fvwm/extras/FvwmScript/Widgets/Widget.c deleted file mode 100644 index f3093752f..000000000 --- a/app/fvwm/extras/FvwmScript/Widgets/Widget.c +++ /dev/null @@ -1,273 +0,0 @@ -/*******************************************************************/ -/* Fichier contenant les fonctions attachees aux objets graphiques */ -/*******************************************************************/ - -#include "Tools.h" - -extern void InitPushButton(struct XObj *xobj); -extern void DestroyPushButton(struct XObj *xobj); -extern void DrawPushButton(struct XObj *xobj); -extern void EvtMousePushButton(struct XObj *xobj,XButtonEvent *EvtButton); -extern void EvtKeyPushButton(struct XObj *xobj,XKeyEvent *EvtKey); -extern void ProcessMsgPushButton(struct XObj *xobj,unsigned long type,unsigned long *body); - -extern void InitRadioButton(struct XObj *xobj); -extern void DestroyRadioButton(struct XObj *xobj); -extern void DrawRadioButton(struct XObj *xobj); -extern void EvtMouseRadioButton(struct XObj *xobj,XButtonEvent *EvtButton); -extern void EvtKeyRadioButton(struct XObj *xobj,XKeyEvent *EvtKey); -extern void ProcessMsgRadioButton(struct XObj *xobj,unsigned long type,unsigned long *body); - -extern void InitItemDraw(struct XObj *xobj); -extern void DestroyItemDraw(struct XObj *xobj); -extern void DrawItemDraw(struct XObj *xobj); -extern void EvtMouseItemDraw(struct XObj *xobj,XButtonEvent *EvtButton); -extern void EvtKeyItemDraw(struct XObj *xobj,XKeyEvent *EvtKey); -extern void ProcessMsgItemDraw(struct XObj *xobj,unsigned long type,unsigned long *body); - -extern void InitCheckBox(struct XObj *xobj); -extern void DestroyCheckBox(struct XObj *xobj); -extern void DrawCheckBox(struct XObj *xobj); -extern void EvtMouseCheckBox(struct XObj *xobj,XButtonEvent *EvtButton); -extern void EvtKeyCheckBox(struct XObj *xobj,XKeyEvent *EvtKey); -extern void ProcessMsgCheckBox(struct XObj *xobj,unsigned long type,unsigned long *body); - -extern void InitTextField(struct XObj *xobj); -extern void DestroyTextField(struct XObj *xobj); -extern void DrawTextField(struct XObj *xobj); -extern void EvtMouseTextField(struct XObj *xobj,XButtonEvent *EvtButton); -extern void EvtKeyTextField(struct XObj *xobj,XKeyEvent *EvtKey); -extern void ProcessMsgTextField(struct XObj *xobj,unsigned long type,unsigned long *body); - -extern void InitHScrollBar(struct XObj *xobj); -extern void DestroyHScrollBar(struct XObj *xobj); -extern void DrawHScrollBar(struct XObj *xobj); -extern void EvtMouseHScrollBar(struct XObj *xobj,XButtonEvent *EvtButton); -extern void EvtKeyHScrollBar(struct XObj *xobj,XKeyEvent *EvtKey); -extern void ProcessMsgHScrollBar(struct XObj *xobj,unsigned long type,unsigned long *body); - -extern void InitVScrollBar(struct XObj *xobj); -extern void DestroyVScrollBar(struct XObj *xobj); -extern void DrawVScrollBar(struct XObj *xobj); -extern void EvtMouseVScrollBar(struct XObj *xobj,XButtonEvent *EvtButton); -extern void EvtKeyVScrollBar(struct XObj *xobj,XKeyEvent *EvtKey); -extern void ProcessMsgVScrollBar(struct XObj *xobj,unsigned long type,unsigned long *body); - -extern void InitPopupMenu(struct XObj *xobj); -extern void DestroyPopupMenu(struct XObj *xobj); -extern void DrawPopupMenu(struct XObj *xobj); -extern void EvtMousePopupMenu(struct XObj *xobj,XButtonEvent *EvtButton); -extern void EvtKeyPopupMenu(struct XObj *xobj,XKeyEvent *EvtKey); -extern void ProcessMsgPopupMenu(struct XObj *xobj,unsigned long type,unsigned long *body); - -extern void InitRectangle(struct XObj *xobj); -extern void DestroyRectangle(struct XObj *xobj); -extern void DrawRectangle(struct XObj *xobj); -extern void EvtMouseRectangle(struct XObj *xobj,XButtonEvent *EvtButton); -extern void EvtKeyRectangle(struct XObj *xobj,XKeyEvent *EvtKey); -extern void ProcessMsgRectangle(struct XObj *xobj,unsigned long type,unsigned long *body); - -extern void InitMiniScroll(struct XObj *xobj); -extern void DestroyMiniScroll(struct XObj *xobj); -extern void DrawMiniScroll(struct XObj *xobj); -extern void EvtMouseMiniScroll(struct XObj *xobj,XButtonEvent *EvtButton); -extern void EvtKeyMiniScroll(struct XObj *xobj,XKeyEvent *EvtKey); -extern void ProcessMsgMiniScroll(struct XObj *xobj,unsigned long type,unsigned long *body); - -extern void InitSwallow(struct XObj *xobj); -extern void DestroySwallow(struct XObj *xobj); -extern void DrawSwallow(struct XObj *xobj); -extern void EvtMouseSwallow(struct XObj *xobj,XButtonEvent *EvtButton); -extern void EvtKeySwallow(struct XObj *xobj,XKeyEvent *EvtKey); -extern void ProcessMsgSwallow(struct XObj *xobj,unsigned long type,unsigned long *body); - -extern void InitHDipstick(struct XObj *xobj); -extern void DestroyHDipstick(struct XObj *xobj); -extern void DrawHDipstick(struct XObj *xobj); -extern void EvtMouseHDipstick(struct XObj *xobj,XButtonEvent *EvtButton); -extern void EvtKeyHDipstick(struct XObj *xobj,XKeyEvent *EvtKey); -extern void ProcessMsgHDipstick(struct XObj *xobj,unsigned long type,unsigned long *body); - -extern void InitVDipstick(struct XObj *xobj); -extern void DestroyVDipstick(struct XObj *xobj); -extern void DrawVDipstick(struct XObj *xobj); -extern void EvtMouseVDipstick(struct XObj *xobj,XButtonEvent *EvtButton); -extern void EvtKeyVDipstick(struct XObj *xobj,XKeyEvent *EvtKey); -extern void ProcessMsgVDipstick(struct XObj *xobj,unsigned long type,unsigned long *body); - -extern void InitList(struct XObj *xobj); -extern void DestroyList(struct XObj *xobj); -extern void DrawList(struct XObj *xobj); -extern void EvtMouseList(struct XObj *xobj,XButtonEvent *EvtButton); -extern void EvtKeyList(struct XObj *xobj,XKeyEvent *EvtKey); -extern void ProcessMsgList(struct XObj *xobj,unsigned long type,unsigned long *body); - -extern void InitMenu(struct XObj *xobj); -extern void DestroyMenu(struct XObj *xobj); -extern void DrawMenu(struct XObj *xobj); -extern void EvtMouseMenu(struct XObj *xobj,XButtonEvent *EvtButton); -extern void EvtKeyMenu(struct XObj *xobj,XKeyEvent *EvtKey); -extern void ProcessMsgMenu(struct XObj *xobj,unsigned long type,unsigned long *body); - -/***********************************************/ -/*Choix des fonctions suivant le type de bouton*/ -/***********************************************/ - -void ChooseFunction(struct XObj *xobj,char *type) -{ - if (strcmp(type,"PushButton")==0) - { - xobj->TypeWidget=PushButton; - xobj->InitObj=InitPushButton; - xobj->DestroyObj=DestroyPushButton; - xobj->DrawObj=DrawPushButton; - xobj->EvtMouse=EvtMousePushButton; - xobj->EvtKey=EvtKeyPushButton; - xobj->ProcessMsg=ProcessMsgPushButton; - } - else if (strcmp(type,"RadioButton")==0) - { - xobj->TypeWidget=RadioButton; - xobj->InitObj=InitRadioButton; - xobj->DestroyObj=DestroyRadioButton; - xobj->DrawObj=DrawRadioButton; - xobj->EvtMouse=EvtMouseRadioButton; - xobj->EvtKey=EvtKeyRadioButton; - xobj->ProcessMsg=ProcessMsgRadioButton; - } - else if (strcmp(type,"ItemDraw")==0) - { - xobj->TypeWidget=ItemDraw; - xobj->InitObj=InitItemDraw; - xobj->DestroyObj=DestroyItemDraw; - xobj->DrawObj=DrawItemDraw; - xobj->EvtMouse=EvtMouseItemDraw; - xobj->EvtKey=EvtKeyItemDraw; - xobj->ProcessMsg=ProcessMsgItemDraw; - } - else if (strcmp(type,"CheckBox")==0) - { - xobj->TypeWidget=CheckBox; - xobj->InitObj=InitCheckBox; - xobj->DestroyObj=DestroyCheckBox; - xobj->DrawObj=DrawCheckBox; - xobj->EvtMouse=EvtMouseCheckBox; - xobj->EvtKey=EvtKeyCheckBox; - xobj->ProcessMsg=ProcessMsgCheckBox; - } - else if (strcmp(type,"TextField")==0) - { - xobj->TypeWidget=TextField; - xobj->InitObj=InitTextField; - xobj->DestroyObj=DestroyTextField; - xobj->DrawObj=DrawTextField; - xobj->EvtMouse=EvtMouseTextField; - xobj->EvtKey=EvtKeyTextField; - xobj->ProcessMsg=ProcessMsgTextField; - } - else if (strcmp(type,"HScrollBar")==0) - { - xobj->TypeWidget=HScrollBar; - xobj->InitObj=InitHScrollBar; - xobj->DestroyObj=DestroyHScrollBar; - xobj->DrawObj=DrawHScrollBar; - xobj->EvtMouse=EvtMouseHScrollBar; - xobj->EvtKey=EvtKeyHScrollBar; - xobj->ProcessMsg=ProcessMsgHScrollBar; - } - else if (strcmp(type,"VScrollBar")==0) - { - xobj->TypeWidget=VScrollBar; - xobj->InitObj=InitVScrollBar; - xobj->DestroyObj=DestroyVScrollBar; - xobj->DrawObj=DrawVScrollBar; - xobj->EvtMouse=EvtMouseVScrollBar; - xobj->EvtKey=EvtKeyVScrollBar; - xobj->ProcessMsg=ProcessMsgVScrollBar; - } - else if (strcmp(type,"PopupMenu")==0) - { - xobj->TypeWidget=PopupMenu; - xobj->InitObj=InitPopupMenu; - xobj->DestroyObj=DestroyPopupMenu; - xobj->DrawObj=DrawPopupMenu; - xobj->EvtMouse=EvtMousePopupMenu; - xobj->EvtKey=EvtKeyPopupMenu; - xobj->ProcessMsg=ProcessMsgPopupMenu; - } - else if (strcmp(type,"Rectangle")==0) - { - xobj->TypeWidget=Rectangle; - xobj->InitObj=InitRectangle; - xobj->DestroyObj=DestroyRectangle; - xobj->DrawObj=DrawRectangle; - xobj->EvtMouse=EvtMouseRectangle; - xobj->EvtKey=EvtKeyRectangle; - xobj->ProcessMsg=ProcessMsgRectangle; - } - else if (strcmp(type,"MiniScroll")==0) - { - xobj->TypeWidget=MiniScroll; - xobj->InitObj=InitMiniScroll; - xobj->DestroyObj=DestroyMiniScroll; - xobj->DrawObj=DrawMiniScroll; - xobj->EvtMouse=EvtMouseMiniScroll; - xobj->EvtKey=EvtKeyMiniScroll; - xobj->ProcessMsg=ProcessMsgMiniScroll; - } - else if (strcmp(type,"SwallowExec")==0) - { - xobj->TypeWidget=SwallowExec; - xobj->InitObj=InitSwallow; - xobj->DestroyObj=DestroySwallow; - xobj->DrawObj=DrawSwallow; - xobj->EvtMouse=EvtMouseSwallow; - xobj->EvtKey=EvtKeySwallow; - xobj->ProcessMsg=ProcessMsgSwallow; - } - else if (strcmp(type,"HDipstick")==0) - { - xobj->TypeWidget=HDipstick; - xobj->InitObj=InitHDipstick; - xobj->DestroyObj=DestroyHDipstick; - xobj->DrawObj=DrawHDipstick; - xobj->EvtMouse=EvtMouseHDipstick; - xobj->EvtKey=EvtKeyHDipstick; - xobj->ProcessMsg=ProcessMsgHDipstick; - } - else if (strcmp(type,"VDipstick")==0) - { - xobj->TypeWidget=VDipstick; - xobj->InitObj=InitVDipstick; - xobj->DestroyObj=DestroyVDipstick; - xobj->DrawObj=DrawVDipstick; - xobj->EvtMouse=EvtMouseVDipstick; - xobj->EvtKey=EvtKeyVDipstick; - xobj->ProcessMsg=ProcessMsgVDipstick; - } - else if (strcmp(type,"List")==0) - { - xobj->TypeWidget=List; - xobj->InitObj=InitList; - xobj->DestroyObj=DestroyList; - xobj->DrawObj=DrawList; - xobj->EvtMouse=EvtMouseList; - xobj->EvtKey=EvtKeyList; - xobj->ProcessMsg=ProcessMsgList; - } - else if (strcmp(type,"Menu")==0) - { - xobj->TypeWidget=Menu; - xobj->InitObj=InitMenu; - xobj->DestroyObj=DestroyMenu; - xobj->DrawObj=DrawMenu; - xobj->EvtMouse=EvtMouseMenu; - xobj->EvtKey=EvtKeyMenu; - xobj->ProcessMsg=ProcessMsgMenu; - } - else - { - fprintf(stderr,"Item %s unknow\n",type); - exit(1); - } -} diff --git a/app/fvwm/extras/FvwmScript/libyywrap.c b/app/fvwm/extras/FvwmScript/libyywrap.c deleted file mode 100644 index cf15f60fe..000000000 --- a/app/fvwm/extras/FvwmScript/libyywrap.c +++ /dev/null @@ -1,8 +0,0 @@ -/* libyywrap - flex run-time support library "yywrap" function */ - -/* $Header: /cvs/OpenBSD/xenocara/app/fvwm/extras/FvwmScript/Attic/libyywrap.c,v 1.1 2006/11/26 10:53:14 matthieu Exp $ */ - -int yywrap() - { - return 1; - } diff --git a/app/fvwm/extras/FvwmScript/scanner.c b/app/fvwm/extras/FvwmScript/scanner.c deleted file mode 100644 index 568716f6d..000000000 --- a/app/fvwm/extras/FvwmScript/scanner.c +++ /dev/null @@ -1,2438 +0,0 @@ -/* A lexical scanner generated by flex */ - -/* Scanner skeleton version: - * $Header: /cvs/OpenBSD/xenocara/app/fvwm/extras/FvwmScript/Attic/scanner.c,v 1.1 2006/11/26 10:53:15 matthieu Exp $ - */ - -#define FLEX_SCANNER -#define YY_FLEX_MAJOR_VERSION 2 -#define YY_FLEX_MINOR_VERSION 5 - -#include <stdio.h> - - -/* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */ -#ifdef c_plusplus -#ifndef __cplusplus -#define __cplusplus -#endif -#endif - - -#ifdef __cplusplus - -#include <stdlib.h> -#include <unistd.h> - -/* Use prototypes in function declarations. */ -#define YY_USE_PROTOS - -/* The "const" storage-class-modifier is valid. */ -#define YY_USE_CONST - -#else /* ! __cplusplus */ - -#if __STDC__ - -#define YY_USE_PROTOS -#define YY_USE_CONST - -#endif /* __STDC__ */ -#endif /* ! __cplusplus */ - -#ifdef __TURBOC__ - #pragma warn -rch - #pragma warn -use -#include <io.h> -#include <stdlib.h> -#define YY_USE_CONST -#define YY_USE_PROTOS -#endif - -#ifdef YY_USE_CONST -#define yyconst const -#else -#define yyconst -#endif - - -#ifdef YY_USE_PROTOS -#define YY_PROTO(proto) proto -#else -#define YY_PROTO(proto) () -#endif - -/* Returned upon end-of-file. */ -#define YY_NULL 0 - -/* Promotes a possibly negative, possibly signed char to an unsigned - * integer for use as an array index. If the signed char is negative, - * we want to instead treat it as an 8-bit unsigned char, hence the - * double cast. - */ -#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) - -/* Enter a start condition. This macro really ought to take a parameter, - * but we do it the disgusting crufty way forced on us by the ()-less - * definition of BEGIN. - */ -#define BEGIN yy_start = 1 + 2 * - -/* Translate the current start state into a value that can be later handed - * to BEGIN to return to the state. The YYSTATE alias is for lex - * compatibility. - */ -#define YY_START ((yy_start - 1) / 2) -#define YYSTATE YY_START - -/* Action number for EOF rule of a given start state. */ -#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) - -/* Special action meaning "start processing a new file". */ -#define YY_NEW_FILE yyrestart( yyin ) - -#define YY_END_OF_BUFFER_CHAR 0 - -/* Size of default input buffer. */ -#define YY_BUF_SIZE 16384 - -typedef struct yy_buffer_state *YY_BUFFER_STATE; - -extern int yyleng; -extern FILE *yyin, *yyout; - -#define EOB_ACT_CONTINUE_SCAN 0 -#define EOB_ACT_END_OF_FILE 1 -#define EOB_ACT_LAST_MATCH 2 - -/* The funky do-while in the following #define is used to turn the definition - * int a single C statement (which needs a semi-colon terminator). This - * avoids problems with code like: - * - * if ( condition_holds ) - * yyless( 5 ); - * else - * do_something_else(); - * - * Prior to using the do-while the compiler would get upset at the - * "else" because it interpreted the "if" statement as being all - * done when it reached the ';' after the yyless() call. - */ - -/* Return all but the first 'n' matched characters back to the input stream. */ - -#define yyless(n) \ - do \ - { \ - /* Undo effects of setting up yytext. */ \ - *yy_cp = yy_hold_char; \ - YY_RESTORE_YY_MORE_OFFSET \ - yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \ - YY_DO_BEFORE_ACTION; /* set up yytext again */ \ - } \ - while ( 0 ) - -#define unput(c) yyunput( c, yytext_ptr ) - -/* The following is because we cannot portably get our hands on size_t - * (without autoconf's help, which isn't available because we want - * flex-generated scanners to compile on their own). - */ -typedef unsigned int yy_size_t; - - -struct yy_buffer_state - { - FILE *yy_input_file; - - char *yy_ch_buf; /* input buffer */ - char *yy_buf_pos; /* current position in input buffer */ - - /* Size of input buffer in bytes, not including room for EOB - * characters. - */ - yy_size_t yy_buf_size; - - /* Number of characters read into yy_ch_buf, not including EOB - * characters. - */ - int yy_n_chars; - - /* Whether we "own" the buffer - i.e., we know we created it, - * and can realloc() it to grow it, and should free() it to - * delete it. - */ - int yy_is_our_buffer; - - /* Whether this is an "interactive" input source; if so, and - * if we're using stdio for input, then we want to use getc() - * instead of fread(), to make sure we stop fetching input after - * each newline. - */ - int yy_is_interactive; - - /* Whether we're considered to be at the beginning of a line. - * If so, '^' rules will be active on the next match, otherwise - * not. - */ - int yy_at_bol; - - /* Whether to try to fill the input buffer when we reach the - * end of it. - */ - int yy_fill_buffer; - - int yy_buffer_status; -#define YY_BUFFER_NEW 0 -#define YY_BUFFER_NORMAL 1 - /* When an EOF's been seen but there's still some text to process - * then we mark the buffer as YY_EOF_PENDING, to indicate that we - * shouldn't try reading from the input source any more. We might - * still have a bunch of tokens to match, though, because of - * possible backing-up. - * - * When we actually see the EOF, we change the status to "new" - * (via yyrestart()), so that the user can continue scanning by - * just pointing yyin at a new input file. - */ -#define YY_BUFFER_EOF_PENDING 2 - }; - -static YY_BUFFER_STATE yy_current_buffer = 0; - -/* We provide macros for accessing buffer states in case in the - * future we want to put the buffer states in a more general - * "scanner state". - */ -#define YY_CURRENT_BUFFER yy_current_buffer - - -/* yy_hold_char holds the character lost when yytext is formed. */ -static char yy_hold_char; - -static int yy_n_chars; /* number of characters read into yy_ch_buf */ - - -int yyleng; - -/* Points to current character in buffer. */ -static char *yy_c_buf_p = (char *) 0; -static int yy_init = 1; /* whether we need to initialize */ -static int yy_start = 0; /* start state number */ - -/* Flag which is used to allow yywrap()'s to do buffer switches - * instead of setting up a fresh yyin. A bit of a hack ... - */ -static int yy_did_buffer_switch_on_eof; - -void yyrestart YY_PROTO(( FILE *input_file )); - -void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer )); -void yy_load_buffer_state YY_PROTO(( void )); -YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size )); -void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b )); -void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file )); -void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b )); -#define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer ) - -YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size )); -YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str )); -YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len )); - -static void *yy_flex_alloc YY_PROTO(( yy_size_t )); -static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t )); -static void yy_flex_free YY_PROTO(( void * )); - -#define yy_new_buffer yy_create_buffer - -#define yy_set_interactive(is_interactive) \ - { \ - if ( ! yy_current_buffer ) \ - yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \ - yy_current_buffer->yy_is_interactive = is_interactive; \ - } - -#define yy_set_bol(at_bol) \ - { \ - if ( ! yy_current_buffer ) \ - yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \ - yy_current_buffer->yy_at_bol = at_bol; \ - } - -#define YY_AT_BOL() (yy_current_buffer->yy_at_bol) - -typedef unsigned char YY_CHAR; -FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0; -typedef int yy_state_type; -extern char *yytext; -#define yytext_ptr yytext - -static yy_state_type yy_get_previous_state YY_PROTO(( void )); -static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state )); -static int yy_get_next_buffer YY_PROTO(( void )); -static void yy_fatal_error YY_PROTO(( yyconst char msg[] )); - -/* Done after the current pattern has been matched and before the - * corresponding action - sets up yytext. - */ -#define YY_DO_BEFORE_ACTION \ - yytext_ptr = yy_bp; \ - yyleng = (int) (yy_cp - yy_bp); \ - yy_hold_char = *yy_cp; \ - *yy_cp = '\0'; \ - yy_c_buf_p = yy_cp; - -#define YY_NUM_RULES 90 -#define YY_END_OF_BUFFER 91 -static yyconst short int yy_accept[819] = - { 0, - 1, 1, 91, 88, 1, 89, 2, 88, 83, 84, - 85, 85, 82, 72, 78, 75, 88, 88, 88, 88, - 88, 88, 88, 88, 88, 88, 88, 88, 90, 90, - 1, 88, 88, 88, 88, 88, 88, 88, 88, 88, - 88, 88, 88, 88, 88, 88, 1, 2, 2, 86, - 86, 85, 73, 76, 77, 74, 88, 88, 88, 68, - 88, 88, 88, 88, 88, 88, 88, 88, 88, 88, - 88, 67, 0, 87, 1, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 88, - 88, 88, 88, 28, 88, 88, 88, 88, 88, 69, - - 88, 88, 88, 88, 88, 88, 88, 88, 88, 88, - 88, 88, 88, 88, 88, 88, 88, 88, 39, 88, - 41, 88, 88, 88, 88, 88, 88, 88, 88, 88, - 88, 88, 88, 0, 0, 0, 0, 28, 0, 0, - 0, 0, 0, 69, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 88, 88, 88, 88, 88, 13, 88, 88, - 61, 88, 88, 88, 88, 88, 88, 88, 88, 88, - 88, 88, 88, 56, 88, 88, 88, 88, 88, 88, - 88, 88, 88, 88, 88, 88, 88, 88, 71, 88, - - 88, 88, 88, 88, 88, 88, 40, 88, 88, 88, - 88, 88, 70, 0, 0, 0, 0, 0, 13, 0, - 0, 61, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 56, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 88, 88, - 88, 88, 88, 88, 14, 88, 88, 88, 23, 59, - 12, 88, 88, 88, 88, 88, 58, 88, 88, 88, - 88, 16, 88, 88, 15, 88, 88, 88, 88, 88, - 88, 88, 88, 88, 88, 88, 88, 88, 88, 88, - 88, 88, 88, 88, 0, 0, 0, 0, 0, 0, - - 14, 0, 0, 0, 23, 59, 12, 0, 0, 0, - 0, 0, 58, 0, 0, 0, 0, 16, 0, 0, - 15, 0, 0, 0, 0, 0, 0, 88, 81, 0, - 88, 88, 24, 88, 88, 88, 88, 88, 88, 88, - 88, 88, 88, 88, 88, 88, 88, 21, 18, 88, - 79, 88, 88, 88, 88, 88, 88, 88, 88, 88, - 88, 25, 88, 88, 88, 88, 88, 88, 0, 81, - 0, 0, 24, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 21, 18, 0, - 79, 0, 0, 0, 88, 0, 88, 88, 88, 88, - - 88, 88, 88, 88, 88, 88, 88, 88, 88, 88, - 88, 88, 88, 10, 88, 88, 88, 88, 88, 47, - 88, 88, 88, 88, 88, 88, 88, 88, 42, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, - 88, 0, 88, 88, 88, 88, 88, 88, 88, 88, - 88, 88, 88, 88, 88, 88, 88, 88, 88, 88, - 88, 88, 88, 88, 88, 88, 88, 88, 88, 88, - 88, 88, 88, 34, 35, 38, 88, 88, 37, 88, - 88, 0, 0, 0, 0, 0, 0, 0, 0, 0, - - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 88, 0, 88, 88, 88, 88, 88, 88, 88, 88, - 88, 88, 88, 88, 88, 20, 19, 88, 17, 11, - 88, 88, 88, 88, 88, 88, 88, 88, 88, 88, - 88, 88, 36, 88, 88, 88, 88, 88, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 20, 19, 0, 17, 11, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, - 88, 88, 88, 88, 88, 88, 88, 88, 88, 88, - - 88, 6, 88, 88, 88, 88, 88, 88, 88, 88, - 88, 88, 88, 88, 88, 88, 88, 88, 88, 88, - 88, 88, 88, 7, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 88, 53, 88, 52, 88, 88, 88, 50, 88, - 88, 66, 29, 88, 88, 57, 88, 88, 30, 65, - 88, 88, 88, 4, 88, 88, 88, 88, 88, 88, - 88, 88, 88, 0, 53, 0, 52, 0, 0, 0, - 50, 0, 0, 66, 29, 0, 0, 57, 0, 0, - - 30, 65, 0, 0, 0, 4, 0, 0, 0, 88, - 88, 88, 88, 88, 51, 31, 88, 88, 88, 8, - 22, 62, 88, 3, 63, 88, 88, 88, 43, 88, - 88, 88, 0, 0, 0, 0, 0, 51, 31, 0, - 0, 0, 8, 22, 62, 0, 3, 63, 0, 88, - 88, 88, 88, 88, 9, 88, 64, 88, 26, 88, - 88, 88, 88, 88, 0, 0, 0, 0, 0, 9, - 0, 64, 0, 0, 88, 88, 88, 88, 88, 60, - 88, 88, 88, 27, 88, 46, 0, 0, 0, 0, - 0, 60, 0, 0, 88, 88, 32, 33, 49, 5, - - 88, 44, 88, 0, 0, 32, 33, 49, 5, 80, - 55, 54, 88, 45, 55, 54, 48, 0 - } ; - -static yyconst int yy_ec[256] = - { 0, - 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 2, 1, 1, 4, 5, 1, 1, 1, 6, - 7, 1, 8, 1, 8, 1, 1, 9, 9, 9, - 9, 9, 9, 9, 9, 9, 9, 10, 1, 11, - 12, 13, 1, 1, 14, 15, 16, 17, 18, 19, - 20, 21, 22, 1, 1, 23, 24, 25, 26, 27, - 28, 29, 30, 31, 1, 32, 33, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 34, 35, 36, 37, - - 38, 39, 40, 41, 42, 1, 43, 44, 45, 46, - 47, 48, 1, 49, 50, 51, 52, 53, 54, 55, - 56, 57, 58, 1, 59, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1 - } ; - -static yyconst int yy_meta[60] = - { 0, - 1, 2, 3, 1, 1, 2, 2, 1, 1, 1, - 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 4, 2 - } ; - -static yyconst short int yy_base[824] = - { 0, - 0, 58, 890, 0, 887, 891, 59, 883, 891, 891, - 878, 877, 0, 50, 873, 872, 846, 848, 22, 837, - 842, 45, 845, 826, 45, 839, 825, 37, 64, 891, - 122, 60, 59, 54, 58, 59, 57, 69, 77, 78, - 823, 94, 115, 840, 79, 0, 871, 157, 0, 0, - 867, 862, 891, 891, 891, 891, 833, 823, 815, 0, - 817, 815, 810, 827, 811, 818, 832, 815, 86, 810, - 820, 0, 106, 891, 0, 76, 92, 810, 810, 114, - 813, 136, 100, 129, 802, 139, 118, 819, 145, 816, - 811, 101, 816, 797, 811, 813, 139, 129, 799, 0, - - 803, 26, 798, 794, 792, 794, 798, 61, 149, 138, - 805, 787, 789, 792, 786, 792, 152, 791, 0, 817, - 0, 793, 171, 799, 792, 782, 776, 788, 794, 786, - 789, 806, 775, 784, 779, 768, 783, 764, 778, 780, - 158, 155, 766, 891, 770, 158, 765, 761, 759, 761, - 765, 159, 172, 163, 772, 754, 756, 759, 753, 759, - 171, 758, 756, 756, 759, 750, 760, 0, 754, 742, - 754, 153, 749, 744, 738, 742, 755, 754, 743, 742, - 735, 731, 744, 0, 743, 725, 738, 739, 732, 731, - 736, 721, 724, 727, 730, 732, 717, 729, 0, 714, - - 729, 722, 729, 715, 723, 724, 0, 715, 711, 715, - 714, 708, 0, 711, 711, 714, 705, 715, 891, 709, - 697, 709, 708, 703, 698, 692, 696, 709, 708, 697, - 696, 689, 685, 698, 891, 697, 679, 692, 693, 686, - 685, 690, 675, 678, 681, 684, 686, 671, 705, 674, - 209, 679, 674, 667, 0, 700, 682, 674, 0, 0, - 0, 679, 678, 664, 659, 671, 0, 191, 661, 674, - 662, 0, 661, 666, 0, 665, 675, 663, 662, 652, - 660, 667, 645, 646, 167, 650, 668, 646, 650, 648, - 668, 635, 641, 638, 669, 638, 212, 643, 638, 631, - - 891, 664, 646, 638, 891, 891, 891, 643, 642, 628, - 623, 635, 891, 193, 625, 638, 626, 891, 625, 630, - 891, 629, 639, 627, 626, 616, 624, 614, 0, 223, - 622, 621, 0, 611, 615, 615, 611, 610, 616, 610, - 602, 608, 602, 594, 605, 608, 598, 0, 0, 597, - 0, 592, 588, 610, 602, 591, 596, 599, 592, 583, - 582, 0, 603, 594, 593, 611, 592, 572, 580, 891, - 588, 587, 891, 577, 581, 581, 577, 576, 582, 576, - 568, 574, 568, 560, 571, 574, 564, 891, 891, 563, - 891, 558, 554, 576, 562, 567, 211, 588, 559, 565, - - 550, 548, 547, 556, 550, 545, 555, 564, 577, 555, - 575, 536, 547, 0, 201, 541, 543, 534, 537, 0, - 546, 545, 537, 545, 541, 524, 529, 539, 0, 532, - 229, 559, 530, 536, 521, 519, 518, 527, 521, 516, - 526, 535, 548, 526, 546, 507, 518, 891, 209, 512, - 511, 507, 522, 508, 518, 195, 506, 510, 509, 516, - 505, 501, 507, 530, 507, 506, 507, 496, 485, 494, - 503, 491, 497, 492, 517, 488, 486, 490, 489, 511, - 491, 477, 476, 0, 0, 0, 477, 495, 0, 477, - 474, 475, 487, 473, 483, 212, 471, 475, 474, 481, - - 470, 466, 472, 495, 472, 471, 472, 461, 450, 459, - 468, 456, 462, 457, 482, 453, 451, 455, 454, 476, - 445, 443, 456, 203, 444, 435, 443, 438, 430, 435, - 441, 442, 434, 444, 434, 0, 0, 449, 0, 0, - 445, 429, 433, 438, 433, 419, 422, 422, 414, 419, - 427, 432, 0, 243, 425, 415, 420, 438, 414, 426, - 209, 414, 405, 413, 408, 400, 405, 411, 412, 404, - 414, 404, 891, 891, 419, 891, 891, 415, 399, 403, - 408, 403, 389, 392, 392, 384, 389, 397, 0, 404, - 394, 385, 397, 388, 401, 400, 389, 392, 385, 376, - - 391, 0, 375, 381, 390, 379, 380, 374, 369, 383, - 380, 379, 374, 377, 370, 369, 361, 362, 376, 361, - 359, 377, 367, 891, 362, 353, 365, 356, 369, 368, - 357, 360, 353, 344, 359, 891, 343, 349, 357, 86, - 185, 187, 194, 227, 226, 227, 224, 229, 225, 226, - 231, 256, 0, 257, 0, 240, 241, 225, 0, 239, - 240, 0, 0, 232, 230, 0, 233, 233, 0, 0, - 247, 235, 234, 0, 248, 249, 250, 249, 239, 240, - 250, 257, 277, 279, 891, 280, 891, 263, 264, 248, - 891, 262, 263, 891, 891, 255, 253, 891, 256, 256, - - 891, 891, 270, 258, 257, 891, 271, 272, 273, 265, - 266, 270, 271, 274, 0, 0, 268, 275, 268, 0, - 0, 0, 278, 0, 0, 284, 270, 282, 0, 278, - 276, 284, 280, 281, 285, 286, 289, 891, 891, 283, - 290, 283, 891, 891, 891, 293, 891, 891, 334, 293, - 294, 287, 288, 294, 0, 292, 0, 296, 0, 299, - 307, 306, 305, 295, 305, 306, 299, 300, 306, 891, - 304, 891, 308, 309, 310, 311, 321, 322, 315, 0, - 316, 325, 315, 0, 317, 0, 319, 320, 330, 331, - 324, 891, 325, 334, 325, 326, 0, 0, 0, 0, - - 330, 0, 326, 329, 330, 891, 891, 891, 891, 891, - 0, 0, 329, 0, 891, 891, 0, 891, 380, 381, - 383, 385, 388 - } ; - -static yyconst short int yy_def[824] = - { 0, - 818, 1, 818, 819, 818, 818, 820, 821, 818, 818, - 819, 819, 819, 818, 818, 818, 819, 819, 819, 819, - 819, 819, 819, 819, 819, 819, 819, 819, 822, 818, - 818, 819, 819, 819, 819, 819, 819, 819, 819, 819, - 819, 819, 819, 819, 819, 819, 818, 820, 823, 821, - 821, 819, 818, 818, 818, 818, 819, 819, 819, 819, - 819, 819, 819, 819, 819, 819, 819, 819, 819, 819, - 819, 819, 822, 818, 31, 818, 818, 818, 818, 818, - 818, 818, 818, 818, 818, 818, 818, 818, 818, 819, - 819, 819, 819, 819, 819, 819, 819, 819, 819, 819, - - 819, 819, 819, 819, 819, 819, 819, 819, 819, 819, - 819, 819, 819, 819, 819, 819, 819, 819, 819, 819, - 819, 819, 819, 819, 819, 819, 819, 819, 819, 819, - 819, 819, 819, 818, 818, 818, 818, 818, 818, 818, - 818, 818, 818, 818, 818, 818, 818, 818, 818, 818, - 818, 818, 818, 818, 818, 818, 818, 818, 818, 818, - 818, 818, 819, 819, 819, 819, 819, 819, 819, 819, - 819, 819, 819, 819, 819, 819, 819, 819, 819, 819, - 819, 819, 819, 819, 819, 819, 819, 819, 819, 819, - 819, 819, 819, 819, 819, 819, 819, 819, 819, 819, - - 819, 819, 819, 819, 819, 819, 819, 819, 819, 819, - 819, 819, 819, 818, 818, 818, 818, 818, 818, 818, - 818, 818, 818, 818, 818, 818, 818, 818, 818, 818, - 818, 818, 818, 818, 818, 818, 818, 818, 818, 818, - 818, 818, 818, 818, 818, 818, 818, 818, 819, 819, - 819, 819, 819, 819, 819, 819, 819, 819, 819, 819, - 819, 819, 819, 819, 819, 819, 819, 819, 819, 819, - 819, 819, 819, 819, 819, 819, 819, 819, 819, 819, - 819, 819, 819, 819, 819, 819, 819, 819, 819, 819, - 819, 819, 819, 819, 818, 818, 818, 818, 818, 818, - - 818, 818, 818, 818, 818, 818, 818, 818, 818, 818, - 818, 818, 818, 818, 818, 818, 818, 818, 818, 818, - 818, 818, 818, 818, 818, 818, 818, 819, 819, 818, - 819, 819, 819, 819, 819, 819, 819, 819, 819, 819, - 819, 819, 819, 819, 819, 819, 819, 819, 819, 819, - 819, 819, 819, 819, 819, 819, 819, 819, 819, 819, - 819, 819, 819, 819, 819, 819, 819, 819, 818, 818, - 818, 818, 818, 818, 818, 818, 818, 818, 818, 818, - 818, 818, 818, 818, 818, 818, 818, 818, 818, 818, - 818, 818, 818, 818, 819, 818, 819, 819, 819, 819, - - 819, 819, 819, 819, 819, 819, 819, 819, 819, 819, - 819, 819, 819, 819, 819, 819, 819, 819, 819, 819, - 819, 819, 819, 819, 819, 819, 819, 819, 819, 818, - 818, 818, 818, 818, 818, 818, 818, 818, 818, 818, - 818, 818, 818, 818, 818, 818, 818, 818, 818, 818, - 819, 818, 819, 819, 819, 819, 819, 819, 819, 819, - 819, 819, 819, 819, 819, 819, 819, 819, 819, 819, - 819, 819, 819, 819, 819, 819, 819, 819, 819, 819, - 819, 819, 819, 819, 819, 819, 819, 819, 819, 819, - 819, 818, 818, 818, 818, 818, 818, 818, 818, 818, - - 818, 818, 818, 818, 818, 818, 818, 818, 818, 818, - 818, 818, 818, 818, 818, 818, 818, 818, 818, 818, - 819, 818, 819, 819, 819, 819, 819, 819, 819, 819, - 819, 819, 819, 819, 819, 819, 819, 819, 819, 819, - 819, 819, 819, 819, 819, 819, 819, 819, 819, 819, - 819, 819, 819, 819, 819, 819, 819, 819, 818, 818, - 818, 818, 818, 818, 818, 818, 818, 818, 818, 818, - 818, 818, 818, 818, 818, 818, 818, 818, 818, 818, - 818, 818, 818, 818, 818, 818, 818, 818, 819, 818, - 819, 819, 819, 819, 819, 819, 819, 819, 819, 819, - - 819, 819, 819, 819, 819, 819, 819, 819, 819, 819, - 819, 819, 819, 819, 819, 819, 819, 819, 819, 819, - 819, 819, 819, 818, 818, 818, 818, 818, 818, 818, - 818, 818, 818, 818, 818, 818, 818, 818, 818, 818, - 818, 818, 818, 818, 818, 818, 818, 818, 818, 818, - 818, 819, 819, 819, 819, 819, 819, 819, 819, 819, - 819, 819, 819, 819, 819, 819, 819, 819, 819, 819, - 819, 819, 819, 819, 819, 819, 819, 819, 819, 819, - 819, 819, 819, 818, 818, 818, 818, 818, 818, 818, - 818, 818, 818, 818, 818, 818, 818, 818, 818, 818, - - 818, 818, 818, 818, 818, 818, 818, 818, 818, 819, - 819, 819, 819, 819, 819, 819, 819, 819, 819, 819, - 819, 819, 819, 819, 819, 819, 819, 819, 819, 819, - 819, 819, 818, 818, 818, 818, 818, 818, 818, 818, - 818, 818, 818, 818, 818, 818, 818, 818, 818, 819, - 819, 819, 819, 819, 819, 819, 819, 819, 819, 819, - 819, 819, 819, 819, 818, 818, 818, 818, 818, 818, - 818, 818, 818, 818, 819, 819, 819, 819, 819, 819, - 819, 819, 819, 819, 819, 819, 818, 818, 818, 818, - 818, 818, 818, 818, 819, 819, 819, 819, 819, 819, - - 819, 819, 819, 818, 818, 818, 818, 818, 818, 818, - 819, 819, 819, 819, 818, 818, 819, 0, 818, 818, - 818, 818, 818 - } ; - -static yyconst short int yy_nxt[951] = - { 0, - 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, - 14, 15, 16, 17, 4, 18, 19, 20, 4, 21, - 22, 4, 23, 24, 25, 4, 4, 4, 26, 27, - 28, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 4, 4, 29, 30, 31, - 49, 53, 54, 59, 49, 49, 74, 176, 60, 49, - 49, 49, 32, 33, 34, 35, 36, 71, 37, 38, - 177, 39, 63, 72, 40, 41, 64, 42, 43, 44, - 45, 67, 92, 90, 63, 59, 68, 91, 98, 93, - - 94, 61, 96, 95, 99, 97, 183, 100, 74, 134, - 102, 184, 115, 135, 101, 104, 49, 49, 103, 116, - 117, 130, 74, 75, 105, 136, 106, 118, 66, 698, - 131, 108, 137, 146, 109, 110, 76, 77, 78, 79, - 80, 147, 81, 82, 70, 83, 120, 111, 84, 85, - 165, 86, 87, 88, 89, 71, 112, 140, 49, 156, - 141, 72, 49, 49, 74, 172, 148, 49, 49, 49, - 113, 143, 173, 157, 144, 149, 152, 150, 159, 153, - 154, 145, 185, 187, 170, 160, 161, 171, 195, 205, - 257, 223, 155, 162, 188, 186, 200, 196, 224, 227, - - 201, 202, 203, 221, 234, 236, 222, 246, 238, 235, - 330, 358, 228, 330, 49, 49, 247, 359, 237, 239, - 342, 343, 382, 383, 330, 453, 699, 477, 526, 454, - 478, 479, 455, 700, 456, 517, 527, 457, 518, 519, - 458, 459, 460, 493, 701, 563, 251, 494, 592, 297, - 495, 593, 496, 564, 626, 497, 618, 627, 498, 499, - 500, 619, 702, 703, 704, 705, 706, 396, 707, 708, - 709, 710, 711, 712, 713, 714, 715, 716, 717, 718, - 719, 720, 721, 722, 723, 724, 725, 726, 727, 728, - 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, - - 739, 740, 741, 742, 743, 744, 745, 746, 747, 748, - 749, 750, 751, 752, 753, 754, 755, 756, 757, 758, - 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, - 769, 770, 771, 772, 773, 774, 775, 776, 777, 778, - 779, 780, 781, 782, 783, 784, 785, 786, 787, 788, - 789, 790, 791, 792, 793, 794, 795, 796, 797, 798, - 799, 800, 801, 802, 803, 804, 805, 806, 807, 808, - 809, 749, 810, 811, 812, 813, 814, 815, 816, 817, - 46, 48, 48, 50, 48, 73, 73, 73, 49, 49, - 697, 49, 696, 695, 694, 693, 692, 691, 690, 689, - - 688, 687, 686, 685, 684, 683, 682, 681, 680, 679, - 678, 677, 676, 675, 674, 673, 672, 671, 670, 669, - 668, 667, 666, 665, 664, 663, 662, 661, 660, 659, - 658, 657, 656, 655, 654, 653, 652, 651, 650, 649, - 648, 647, 646, 645, 644, 643, 642, 641, 640, 639, - 638, 637, 636, 635, 634, 633, 632, 631, 630, 629, - 628, 625, 624, 623, 622, 621, 620, 617, 616, 615, - 614, 613, 612, 611, 610, 609, 608, 607, 606, 605, - 604, 603, 602, 601, 600, 599, 598, 597, 596, 595, - 594, 591, 590, 589, 588, 587, 586, 585, 584, 583, - - 582, 581, 580, 579, 578, 577, 576, 575, 574, 573, - 572, 571, 570, 569, 568, 567, 566, 565, 562, 561, - 560, 559, 558, 557, 556, 555, 554, 553, 552, 551, - 550, 549, 548, 547, 546, 545, 544, 543, 542, 541, - 540, 539, 538, 537, 536, 535, 534, 533, 532, 531, - 530, 529, 528, 525, 524, 523, 522, 521, 520, 516, - 515, 514, 513, 512, 511, 510, 509, 508, 507, 506, - 505, 504, 503, 502, 501, 492, 491, 490, 489, 488, - 487, 486, 485, 484, 483, 482, 481, 480, 476, 475, - 474, 473, 472, 471, 470, 469, 468, 467, 466, 465, - - 464, 463, 462, 461, 452, 451, 450, 449, 448, 447, - 446, 445, 444, 443, 442, 441, 440, 439, 438, 437, - 436, 435, 434, 433, 432, 431, 430, 429, 428, 427, - 426, 425, 424, 423, 422, 421, 420, 419, 418, 417, - 416, 415, 414, 413, 412, 411, 410, 409, 408, 407, - 406, 405, 404, 403, 402, 401, 400, 399, 398, 397, - 395, 394, 393, 392, 391, 390, 389, 388, 387, 386, - 385, 384, 381, 380, 379, 378, 377, 376, 375, 374, - 373, 372, 371, 370, 369, 368, 367, 366, 365, 364, - 363, 362, 361, 360, 357, 356, 355, 354, 353, 352, - - 351, 350, 349, 348, 347, 346, 345, 344, 341, 340, - 339, 338, 337, 336, 335, 334, 333, 332, 331, 329, - 328, 327, 326, 325, 324, 323, 322, 321, 320, 319, - 318, 317, 316, 315, 314, 313, 312, 311, 310, 309, - 308, 307, 306, 305, 304, 303, 302, 301, 300, 299, - 298, 297, 296, 295, 294, 293, 292, 291, 290, 289, - 288, 287, 286, 285, 284, 283, 282, 281, 280, 279, - 278, 277, 276, 275, 274, 273, 272, 271, 270, 269, - 268, 267, 266, 265, 264, 263, 262, 261, 260, 259, - 258, 256, 255, 254, 253, 252, 251, 250, 249, 248, - - 245, 244, 243, 242, 241, 240, 233, 232, 231, 230, - 229, 226, 225, 220, 219, 218, 217, 216, 215, 214, - 213, 212, 211, 210, 209, 208, 207, 206, 205, 204, - 199, 198, 197, 194, 193, 192, 191, 190, 189, 182, - 181, 180, 179, 178, 175, 174, 169, 168, 167, 166, - 164, 163, 158, 151, 142, 139, 138, 133, 132, 129, - 128, 127, 126, 125, 124, 123, 122, 121, 120, 119, - 52, 51, 47, 114, 107, 70, 69, 66, 65, 62, - 61, 58, 57, 56, 55, 52, 52, 51, 47, 818, - 3, 818, 818, 818, 818, 818, 818, 818, 818, 818, - - 818, 818, 818, 818, 818, 818, 818, 818, 818, 818, - 818, 818, 818, 818, 818, 818, 818, 818, 818, 818, - 818, 818, 818, 818, 818, 818, 818, 818, 818, 818, - 818, 818, 818, 818, 818, 818, 818, 818, 818, 818, - 818, 818, 818, 818, 818, 818, 818, 818, 818, 818 - } ; - -static yyconst short int yy_chk[951] = - { 0, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, - 7, 14, 14, 19, 7, 7, 29, 102, 19, 7, - 7, 7, 2, 2, 2, 2, 2, 28, 2, 2, - 102, 2, 22, 28, 2, 2, 22, 2, 2, 2, - 2, 25, 33, 32, 37, 34, 25, 32, 37, 33, - - 34, 35, 36, 35, 38, 36, 108, 38, 73, 76, - 39, 108, 45, 76, 38, 40, 7, 7, 39, 45, - 45, 69, 29, 31, 40, 77, 40, 45, 39, 640, - 69, 42, 77, 83, 42, 42, 31, 31, 31, 31, - 31, 83, 31, 31, 42, 31, 92, 42, 31, 31, - 92, 31, 31, 31, 31, 43, 43, 80, 48, 87, - 80, 43, 48, 48, 73, 98, 84, 48, 48, 48, - 43, 82, 98, 87, 82, 84, 86, 84, 89, 86, - 86, 82, 109, 110, 97, 89, 89, 97, 117, 172, - 172, 142, 86, 89, 110, 109, 123, 117, 142, 146, - - 123, 123, 123, 141, 152, 153, 141, 161, 154, 152, - 251, 285, 146, 297, 48, 48, 161, 285, 153, 154, - 268, 268, 314, 314, 330, 397, 641, 415, 456, 397, - 415, 415, 397, 642, 397, 449, 456, 397, 449, 449, - 397, 397, 397, 431, 643, 496, 251, 431, 524, 297, - 431, 524, 431, 496, 561, 431, 554, 561, 431, 431, - 431, 554, 644, 645, 646, 647, 648, 330, 649, 650, - 651, 652, 654, 656, 657, 658, 660, 661, 664, 665, - 667, 668, 671, 672, 673, 675, 676, 677, 678, 679, - 680, 681, 682, 683, 684, 686, 688, 689, 690, 692, - - 693, 696, 697, 699, 700, 703, 704, 705, 707, 708, - 709, 710, 711, 712, 713, 714, 717, 718, 719, 723, - 726, 727, 728, 730, 731, 732, 733, 734, 735, 736, - 737, 740, 741, 742, 746, 749, 750, 751, 752, 753, - 754, 756, 758, 760, 761, 762, 763, 764, 765, 766, - 767, 768, 769, 771, 773, 774, 775, 776, 777, 778, - 779, 781, 782, 783, 785, 787, 788, 789, 790, 791, - 793, 749, 794, 795, 796, 801, 803, 804, 805, 813, - 819, 820, 820, 821, 820, 822, 822, 822, 823, 823, - 639, 823, 638, 637, 635, 634, 633, 632, 631, 630, - - 629, 628, 627, 626, 625, 623, 622, 621, 620, 619, - 618, 617, 616, 615, 614, 613, 612, 611, 610, 609, - 608, 607, 606, 605, 604, 603, 601, 600, 599, 598, - 597, 596, 595, 594, 593, 592, 591, 590, 588, 587, - 586, 585, 584, 583, 582, 581, 580, 579, 578, 575, - 572, 571, 570, 569, 568, 567, 566, 565, 564, 563, - 562, 560, 559, 558, 557, 556, 555, 552, 551, 550, - 549, 548, 547, 546, 545, 544, 543, 542, 541, 538, - 535, 534, 533, 532, 531, 530, 529, 528, 527, 526, - 525, 523, 522, 521, 520, 519, 518, 517, 516, 515, - - 514, 513, 512, 511, 510, 509, 508, 507, 506, 505, - 504, 503, 502, 501, 500, 499, 498, 497, 495, 494, - 493, 492, 491, 490, 488, 487, 483, 482, 481, 480, - 479, 478, 477, 476, 475, 474, 473, 472, 471, 470, - 469, 468, 467, 466, 465, 464, 463, 462, 461, 460, - 459, 458, 457, 455, 454, 453, 452, 451, 450, 447, - 446, 445, 444, 443, 442, 441, 440, 439, 438, 437, - 436, 435, 434, 433, 432, 430, 428, 427, 426, 425, - 424, 423, 422, 421, 419, 418, 417, 416, 413, 412, - 411, 410, 409, 408, 407, 406, 405, 404, 403, 402, - - 401, 400, 399, 398, 396, 395, 394, 393, 392, 390, - 387, 386, 385, 384, 383, 382, 381, 380, 379, 378, - 377, 376, 375, 374, 372, 371, 369, 368, 367, 366, - 365, 364, 363, 361, 360, 359, 358, 357, 356, 355, - 354, 353, 352, 350, 347, 346, 345, 344, 343, 342, - 341, 340, 339, 338, 337, 336, 335, 334, 332, 331, - 328, 327, 326, 325, 324, 323, 322, 320, 319, 317, - 316, 315, 312, 311, 310, 309, 308, 304, 303, 302, - 300, 299, 298, 296, 295, 294, 293, 292, 291, 290, - 289, 288, 287, 286, 284, 283, 282, 281, 280, 279, - - 278, 277, 276, 274, 273, 271, 270, 269, 266, 265, - 264, 263, 262, 258, 257, 256, 254, 253, 252, 250, - 249, 248, 247, 246, 245, 244, 243, 242, 241, 240, - 239, 238, 237, 236, 234, 233, 232, 231, 230, 229, - 228, 227, 226, 225, 224, 223, 222, 221, 220, 218, - 217, 216, 215, 214, 212, 211, 210, 209, 208, 206, - 205, 204, 203, 202, 201, 200, 198, 197, 196, 195, - 194, 193, 192, 191, 190, 189, 188, 187, 186, 185, - 183, 182, 181, 180, 179, 178, 177, 176, 175, 174, - 173, 171, 170, 169, 167, 166, 165, 164, 163, 162, - - 160, 159, 158, 157, 156, 155, 151, 150, 149, 148, - 147, 145, 143, 140, 139, 138, 137, 136, 135, 134, - 133, 132, 131, 130, 129, 128, 127, 126, 125, 124, - 122, 120, 118, 116, 115, 114, 113, 112, 111, 107, - 106, 105, 104, 103, 101, 99, 96, 95, 94, 93, - 91, 90, 88, 85, 81, 79, 78, 71, 70, 68, - 67, 66, 65, 64, 63, 62, 61, 59, 58, 57, - 52, 51, 47, 44, 41, 27, 26, 24, 23, 21, - 20, 18, 17, 16, 15, 12, 11, 8, 5, 3, - 818, 818, 818, 818, 818, 818, 818, 818, 818, 818, - - 818, 818, 818, 818, 818, 818, 818, 818, 818, 818, - 818, 818, 818, 818, 818, 818, 818, 818, 818, 818, - 818, 818, 818, 818, 818, 818, 818, 818, 818, 818, - 818, 818, 818, 818, 818, 818, 818, 818, 818, 818, - 818, 818, 818, 818, 818, 818, 818, 818, 818, 818 - } ; - -static yy_state_type yy_last_accepting_state; -static char *yy_last_accepting_cpos; - -/* The intent behind this definition is that it'll catch - * any uses of REJECT which flex missed. - */ -#define REJECT reject_used_but_not_detected -#define yymore() yymore_used_but_not_detected -#define YY_MORE_ADJ 0 -#define YY_RESTORE_YY_MORE_OFFSET -char *yytext; -#line 1 "../../../extras/FvwmScript/scanner.l" -#define INITIAL 0 -#line 2 "../../../extras/FvwmScript/scanner.l" -# include "script.h" -# include "types.h" - -int numligne=1; -#line 848 "lex.yy.c" - -/* Macros after this point can all be overridden by user definitions in - * section 1. - */ - -#ifndef YY_SKIP_YYWRAP -#ifdef __cplusplus -extern "C" int yywrap YY_PROTO(( void )); -#else -extern int yywrap YY_PROTO(( void )); -#endif -#endif - -#ifndef YY_NO_UNPUT -static void yyunput YY_PROTO(( int c, char *buf_ptr )); -#endif - -#ifndef yytext_ptr -static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int )); -#endif - -#ifdef YY_NEED_STRLEN -static int yy_flex_strlen YY_PROTO(( yyconst char * )); -#endif - -#ifndef YY_NO_INPUT -#ifdef __cplusplus -static int yyinput YY_PROTO(( void )); -#else -static int input YY_PROTO(( void )); -#endif -#endif - -#if YY_STACK_USED -static int yy_start_stack_ptr = 0; -static int yy_start_stack_depth = 0; -static int *yy_start_stack = 0; -#ifndef YY_NO_PUSH_STATE -static void yy_push_state YY_PROTO(( int new_state )); -#endif -#ifndef YY_NO_POP_STATE -static void yy_pop_state YY_PROTO(( void )); -#endif -#ifndef YY_NO_TOP_STATE -static int yy_top_state YY_PROTO(( void )); -#endif - -#else -#define YY_NO_PUSH_STATE 1 -#define YY_NO_POP_STATE 1 -#define YY_NO_TOP_STATE 1 -#endif - -#ifdef YY_MALLOC_DECL -YY_MALLOC_DECL -#else -#if __STDC__ -#ifndef __cplusplus -#include <stdlib.h> -#endif -#else -/* Just try to get by without declaring the routines. This will fail - * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int) - * or sizeof(void*) != sizeof(int). - */ -#endif -#endif - -/* Amount of stuff to slurp up with each read. */ -#ifndef YY_READ_BUF_SIZE -#define YY_READ_BUF_SIZE 8192 -#endif - -/* Copy whatever the last rule matched to the standard output. */ - -#ifndef ECHO -/* This used to be an fputs(), but since the string might contain NUL's, - * we now use fwrite(). - */ -#define ECHO (void) fwrite( yytext, yyleng, 1, yyout ) -#endif - -/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, - * is returned in "result". - */ -#ifndef YY_INPUT -#define YY_INPUT(buf,result,max_size) \ - if ( yy_current_buffer->yy_is_interactive ) \ - { \ - int c = '*', n; \ - for ( n = 0; n < max_size && \ - (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ - buf[n] = (char) c; \ - if ( c == '\n' ) \ - buf[n++] = (char) c; \ - if ( c == EOF && ferror( yyin ) ) \ - YY_FATAL_ERROR( "input in flex scanner failed" ); \ - result = n; \ - } \ - else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \ - && ferror( yyin ) ) \ - YY_FATAL_ERROR( "input in flex scanner failed" ); -#endif - -/* No semi-colon after return; correct usage is to write "yyterminate();" - - * we don't want an extra ';' after the "return" because that will cause - * some compilers to complain about unreachable statements. - */ -#ifndef yyterminate -#define yyterminate() return YY_NULL -#endif - -/* Number of entries by which start-condition stack grows. */ -#ifndef YY_START_STACK_INCR -#define YY_START_STACK_INCR 25 -#endif - -/* Report a fatal error. */ -#ifndef YY_FATAL_ERROR -#define YY_FATAL_ERROR(msg) yy_fatal_error( msg ) -#endif - -/* Default declaration of generated scanner - a define so the user can - * easily add parameters. - */ -#ifndef YY_DECL -#define YY_DECL int yylex YY_PROTO(( void )) -#endif - -/* Code executed at the beginning of each rule, after yytext and yyleng - * have been set up. - */ -#ifndef YY_USER_ACTION -#define YY_USER_ACTION -#endif - -/* Code executed at the end of each rule. */ -#ifndef YY_BREAK -#define YY_BREAK break; -#endif - -#define YY_RULE_SETUP \ - if ( yyleng > 0 ) \ - yy_current_buffer->yy_at_bol = \ - (yytext[yyleng - 1] == '\n'); \ - YY_USER_ACTION - -YY_DECL - { - register yy_state_type yy_current_state; - register char *yy_cp, *yy_bp; - register int yy_act; - -#line 23 "../../../extras/FvwmScript/scanner.l" - -#line 1004 "lex.yy.c" - - if ( yy_init ) - { - yy_init = 0; - -#ifdef YY_USER_INIT - YY_USER_INIT; -#endif - - if ( ! yy_start ) - yy_start = 1; /* first start state */ - - if ( ! yyin ) - yyin = stdin; - - if ( ! yyout ) - yyout = stdout; - - if ( ! yy_current_buffer ) - yy_current_buffer = - yy_create_buffer( yyin, YY_BUF_SIZE ); - - yy_load_buffer_state(); - } - - while ( 1 ) /* loops until end-of-file is reached */ - { - yy_cp = yy_c_buf_p; - - /* Support of yytext. */ - *yy_cp = yy_hold_char; - - /* yy_bp points to the position in yy_ch_buf of the start of - * the current run. - */ - yy_bp = yy_cp; - - yy_current_state = yy_start; - yy_current_state += YY_AT_BOL(); -yy_match: - do - { - register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; - if ( yy_accept[yy_current_state] ) - { - yy_last_accepting_state = yy_current_state; - yy_last_accepting_cpos = yy_cp; - } - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) - { - yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 819 ) - yy_c = yy_meta[(unsigned int) yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - ++yy_cp; - } - while ( yy_base[yy_current_state] != 891 ); - -yy_find_action: - yy_act = yy_accept[yy_current_state]; - if ( yy_act == 0 ) - { /* have to back up */ - yy_cp = yy_last_accepting_cpos; - yy_current_state = yy_last_accepting_state; - yy_act = yy_accept[yy_current_state]; - } - - YY_DO_BEFORE_ACTION; - - -do_action: /* This label is used only to access EOF actions. */ - - - switch ( yy_act ) - { /* beginning of action switch */ - case 0: /* must back up */ - /* undo the effects of YY_DO_BEFORE_ACTION */ - *yy_cp = yy_hold_char; - yy_cp = yy_last_accepting_cpos; - yy_current_state = yy_last_accepting_state; - goto yy_find_action; - -case 1: -YY_RULE_SETUP -#line 24 "../../../extras/FvwmScript/scanner.l" -; - YY_BREAK -case 2: -YY_RULE_SETUP -#line 25 "../../../extras/FvwmScript/scanner.l" -; - YY_BREAK -case 3: -YY_RULE_SETUP -#line 27 "../../../extras/FvwmScript/scanner.l" -{ return WINDOWTITLE; } - YY_BREAK -case 4: -YY_RULE_SETUP -#line 28 "../../../extras/FvwmScript/scanner.l" -{ return WINDOWSIZE; } - YY_BREAK -case 5: -YY_RULE_SETUP -#line 29 "../../../extras/FvwmScript/scanner.l" -{ return WINDOWPOSITION; } - YY_BREAK -case 6: -YY_RULE_SETUP -#line 30 "../../../extras/FvwmScript/scanner.l" -{ return FORECOLOR; } - YY_BREAK -case 7: -YY_RULE_SETUP -#line 31 "../../../extras/FvwmScript/scanner.l" -{ return BACKCOLOR; } - YY_BREAK -case 8: -YY_RULE_SETUP -#line 32 "../../../extras/FvwmScript/scanner.l" -{ return SHADCOLOR; } - YY_BREAK -case 9: -YY_RULE_SETUP -#line 33 "../../../extras/FvwmScript/scanner.l" -{ return LICOLOR; } - YY_BREAK -case 10: -YY_RULE_SETUP -#line 34 "../../../extras/FvwmScript/scanner.l" -{ return OBJECT; } - YY_BREAK -case 11: -YY_RULE_SETUP -#line 35 "../../../extras/FvwmScript/scanner.l" -{ return PROP; } - YY_BREAK -case 12: -YY_RULE_SETUP -#line 36 "../../../extras/FvwmScript/scanner.l" -{ return MAIN; } - YY_BREAK -case 13: -YY_RULE_SETUP -#line 37 "../../../extras/FvwmScript/scanner.l" -{ return END; } - YY_BREAK -case 14: -YY_RULE_SETUP -#line 38 "../../../extras/FvwmScript/scanner.l" -{ return FONT; } - YY_BREAK -case 15: -YY_RULE_SETUP -#line 40 "../../../extras/FvwmScript/scanner.l" -{ return TYPE; } - YY_BREAK -case 16: -YY_RULE_SETUP -#line 41 "../../../extras/FvwmScript/scanner.l" -{ return SIZE; } - YY_BREAK -case 17: -YY_RULE_SETUP -#line 42 "../../../extras/FvwmScript/scanner.l" -{ return POSITION; } - YY_BREAK -case 18: -YY_RULE_SETUP -#line 43 "../../../extras/FvwmScript/scanner.l" -{ return VALUE; } - YY_BREAK -case 19: -YY_RULE_SETUP -#line 44 "../../../extras/FvwmScript/scanner.l" -{ return VALUEMIN; } - YY_BREAK -case 20: -YY_RULE_SETUP -#line 45 "../../../extras/FvwmScript/scanner.l" -{ return VALUEMAX; } - YY_BREAK -case 21: -YY_RULE_SETUP -#line 46 "../../../extras/FvwmScript/scanner.l" -{ return TITLE; } - YY_BREAK -case 22: -YY_RULE_SETUP -#line 47 "../../../extras/FvwmScript/scanner.l" -{ return SWALLOWEXEC; } - YY_BREAK -case 23: -YY_RULE_SETUP -#line 48 "../../../extras/FvwmScript/scanner.l" -{ return ICON; } - YY_BREAK -case 24: -YY_RULE_SETUP -#line 49 "../../../extras/FvwmScript/scanner.l" -{ return FLAGS; } - YY_BREAK -case 25: -YY_RULE_SETUP -#line 50 "../../../extras/FvwmScript/scanner.l" -{ return HIDDEN; } - YY_BREAK -case 26: -YY_RULE_SETUP -#line 51 "../../../extras/FvwmScript/scanner.l" -{ return CANBESELECTED; } - YY_BREAK -case 27: -YY_RULE_SETUP -#line 52 "../../../extras/FvwmScript/scanner.l" -{ return NORELIEFSTRING; } - YY_BREAK -case 28: -YY_RULE_SETUP -#line 54 "../../../extras/FvwmScript/scanner.l" -{ return EXEC; } - YY_BREAK -case 29: -YY_RULE_SETUP -#line 55 "../../../extras/FvwmScript/scanner.l" -{ return HIDE; } - YY_BREAK -case 30: -YY_RULE_SETUP -#line 56 "../../../extras/FvwmScript/scanner.l" -{ return SHOW; } - YY_BREAK -case 31: -YY_RULE_SETUP -#line 57 "../../../extras/FvwmScript/scanner.l" -{ return CHVALUE; } - YY_BREAK -case 32: -YY_RULE_SETUP -#line 58 "../../../extras/FvwmScript/scanner.l" -{ return CHVALUEMAX; } - YY_BREAK -case 33: -YY_RULE_SETUP -#line 59 "../../../extras/FvwmScript/scanner.l" -{ return CHVALUEMIN; } - YY_BREAK -case 34: -YY_RULE_SETUP -#line 60 "../../../extras/FvwmScript/scanner.l" -{ return GETTITLE; } - YY_BREAK -case 35: -YY_RULE_SETUP -#line 61 "../../../extras/FvwmScript/scanner.l" -{ return GETVALUE; } - YY_BREAK -case 36: -YY_RULE_SETUP -#line 62 "../../../extras/FvwmScript/scanner.l" -{ return GETOUTPUT; } - YY_BREAK -case 37: -YY_RULE_SETUP -#line 63 "../../../extras/FvwmScript/scanner.l" -{ return NUMTOHEX; } - YY_BREAK -case 38: -YY_RULE_SETUP -#line 64 "../../../extras/FvwmScript/scanner.l" -{ return HEXTONUM; } - YY_BREAK -case 39: -YY_RULE_SETUP -#line 65 "../../../extras/FvwmScript/scanner.l" -{ return ADD;} - YY_BREAK -case 40: -YY_RULE_SETUP -#line 66 "../../../extras/FvwmScript/scanner.l" -{ return MULT;} - YY_BREAK -case 41: -YY_RULE_SETUP -#line 67 "../../../extras/FvwmScript/scanner.l" -{ return DIV;} - YY_BREAK -case 42: -YY_RULE_SETUP -#line 68 "../../../extras/FvwmScript/scanner.l" -{ return STRCOPY; } - YY_BREAK -case 43: -YY_RULE_SETUP -#line 69 "../../../extras/FvwmScript/scanner.l" -{ return LAUNCHSCRIPT; } - YY_BREAK -case 44: -YY_RULE_SETUP -#line 70 "../../../extras/FvwmScript/scanner.l" -{ return GETSCRIPTFATHER; } - YY_BREAK -case 45: -YY_RULE_SETUP -#line 71 "../../../extras/FvwmScript/scanner.l" -{ return RECEIVFROMSCRIPT; } - YY_BREAK -case 46: -YY_RULE_SETUP -#line 72 "../../../extras/FvwmScript/scanner.l" -{ return REMAINDEROFDIV; } - YY_BREAK -case 47: -YY_RULE_SETUP -#line 73 "../../../extras/FvwmScript/scanner.l" -{ return GETTIME; } - YY_BREAK -case 48: -YY_RULE_SETUP -#line 74 "../../../extras/FvwmScript/scanner.l" -{ return GETSCRIPTARG; } - YY_BREAK -case 49: -YY_RULE_SETUP -#line 75 "../../../extras/FvwmScript/scanner.l" -{ return POSITION; } - YY_BREAK -case 50: -YY_RULE_SETUP -#line 76 "../../../extras/FvwmScript/scanner.l" -{ return SIZE; } - YY_BREAK -case 51: -YY_RULE_SETUP -#line 77 "../../../extras/FvwmScript/scanner.l" -{ return TITLE; } - YY_BREAK -case 52: -YY_RULE_SETUP -#line 78 "../../../extras/FvwmScript/scanner.l" -{ return ICON; } - YY_BREAK -case 53: -YY_RULE_SETUP -#line 79 "../../../extras/FvwmScript/scanner.l" -{ return FONT; } - YY_BREAK -case 54: -YY_RULE_SETUP -#line 80 "../../../extras/FvwmScript/scanner.l" -{ return CHFORECOLOR; } - YY_BREAK -case 55: -YY_RULE_SETUP -#line 81 "../../../extras/FvwmScript/scanner.l" -{ return CHBACKCOLOR; } - YY_BREAK -case 56: -YY_RULE_SETUP -#line 82 "../../../extras/FvwmScript/scanner.l" -{ return SET; } - YY_BREAK -case 57: -YY_RULE_SETUP -#line 83 "../../../extras/FvwmScript/scanner.l" -{ return SENDSIGN; } - YY_BREAK -case 58: -YY_RULE_SETUP -#line 84 "../../../extras/FvwmScript/scanner.l" -{ return QUIT; } - YY_BREAK -case 59: -YY_RULE_SETUP -#line 85 "../../../extras/FvwmScript/scanner.l" -{ return INIT; } - YY_BREAK -case 60: -YY_RULE_SETUP -#line 86 "../../../extras/FvwmScript/scanner.l" -{ return PERIODICTASK; } - YY_BREAK -case 61: -YY_RULE_SETUP -#line 87 "../../../extras/FvwmScript/scanner.l" -{ return FOR; } - YY_BREAK -case 62: -YY_RULE_SETUP -#line 88 "../../../extras/FvwmScript/scanner.l" -{ return WARP; } - YY_BREAK -case 63: -YY_RULE_SETUP -#line 89 "../../../extras/FvwmScript/scanner.l" -{ return WRITETOFILE; } - YY_BREAK -case 64: -YY_RULE_SETUP -#line 90 "../../../extras/FvwmScript/scanner.l" -{ return SENDTOSCRIPT; } - YY_BREAK -case 65: -YY_RULE_SETUP -#line 91 "../../../extras/FvwmScript/scanner.l" -{ return SINGLECLIC; } - YY_BREAK -case 66: -YY_RULE_SETUP -#line 92 "../../../extras/FvwmScript/scanner.l" -{ return DOUBLECLIC; } - YY_BREAK -case 67: -YY_RULE_SETUP -#line 93 "../../../extras/FvwmScript/scanner.l" -{ return TO; } - YY_BREAK -case 68: -YY_RULE_SETUP -#line 94 "../../../extras/FvwmScript/scanner.l" -{ return DO; } - YY_BREAK -case 69: -YY_RULE_SETUP -#line 95 "../../../extras/FvwmScript/scanner.l" -{ return IF; } - YY_BREAK -case 70: -YY_RULE_SETUP -#line 96 "../../../extras/FvwmScript/scanner.l" -{ return THEN; } - YY_BREAK -case 71: -YY_RULE_SETUP -#line 97 "../../../extras/FvwmScript/scanner.l" -{ return ELSE; } - YY_BREAK -case 72: -YY_RULE_SETUP -#line 99 "../../../extras/FvwmScript/scanner.l" -{ return INF; } - YY_BREAK -case 73: -YY_RULE_SETUP -#line 100 "../../../extras/FvwmScript/scanner.l" -{ return INFEQ; } - YY_BREAK -case 74: -YY_RULE_SETUP -#line 101 "../../../extras/FvwmScript/scanner.l" -{ return SUPEQ; } - YY_BREAK -case 75: -YY_RULE_SETUP -#line 102 "../../../extras/FvwmScript/scanner.l" -{ return SUP; } - YY_BREAK -case 76: -YY_RULE_SETUP -#line 103 "../../../extras/FvwmScript/scanner.l" -{ return DIFF; } - YY_BREAK -case 77: -YY_RULE_SETUP -#line 104 "../../../extras/FvwmScript/scanner.l" -{ return EQUAL; } - YY_BREAK -case 78: -YY_RULE_SETUP -#line 105 "../../../extras/FvwmScript/scanner.l" -{ return GET; } - YY_BREAK -case 79: -YY_RULE_SETUP -#line 107 "../../../extras/FvwmScript/scanner.l" -{ return WHILE; } - YY_BREAK -case 80: -YY_RULE_SETUP -#line 108 "../../../extras/FvwmScript/scanner.l" -{ return CASE; } - YY_BREAK -case 81: -YY_RULE_SETUP -#line 109 "../../../extras/FvwmScript/scanner.l" -{ return BEG; } - YY_BREAK -case 82: -YY_RULE_SETUP -#line 110 "../../../extras/FvwmScript/scanner.l" -{ return POINT; } - YY_BREAK -case 83: -YY_RULE_SETUP -#line 111 "../../../extras/FvwmScript/scanner.l" -{ return BEGF; } - YY_BREAK -case 84: -YY_RULE_SETUP -#line 112 "../../../extras/FvwmScript/scanner.l" -{ return ENDF; } - YY_BREAK -case 85: -YY_RULE_SETUP -#line 115 "../../../extras/FvwmScript/scanner.l" -{ yylval.number=atoi(yytext); - return NUMBER; - } - YY_BREAK -case 86: -YY_RULE_SETUP -#line 119 "../../../extras/FvwmScript/scanner.l" -{ - yylval.str=(char*) strdup(yytext+1); - yylval.str[yyleng-1]='\0'; - return VAR; - } - YY_BREAK -case 87: -YY_RULE_SETUP -#line 124 "../../../extras/FvwmScript/scanner.l" -{ /* Str entre "" */ - yylval.str=(char*) strdup(yytext+1); - yylval.str[yyleng-2]='\0'; - return GSTR; - } - YY_BREAK -case 88: -YY_RULE_SETUP -#line 130 "../../../extras/FvwmScript/scanner.l" -{ yylval.str=(char*) strdup(yytext); - yylval.str[yyleng]='\0'; - return STR; - } - YY_BREAK -case 89: -YY_RULE_SETUP -#line 136 "../../../extras/FvwmScript/scanner.l" -{ numligne++; } - YY_BREAK -case 90: -YY_RULE_SETUP -#line 153 "../../../extras/FvwmScript/scanner.l" -ECHO; - YY_BREAK -#line 1551 "lex.yy.c" -case YY_STATE_EOF(INITIAL): - yyterminate(); - - case YY_END_OF_BUFFER: - { - /* Amount of text matched not including the EOB char. */ - int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1; - - /* Undo the effects of YY_DO_BEFORE_ACTION. */ - *yy_cp = yy_hold_char; - YY_RESTORE_YY_MORE_OFFSET - - if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW ) - { - /* We're scanning a new file or input source. It's - * possible that this happened because the user - * just pointed yyin at a new source and called - * yylex(). If so, then we have to assure - * consistency between yy_current_buffer and our - * globals. Here is the right place to do so, because - * this is the first action (other than possibly a - * back-up) that will match for the new input source. - */ - yy_n_chars = yy_current_buffer->yy_n_chars; - yy_current_buffer->yy_input_file = yyin; - yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL; - } - - /* Note that here we test for yy_c_buf_p "<=" to the position - * of the first EOB in the buffer, since yy_c_buf_p will - * already have been incremented past the NUL character - * (since all states make transitions on EOB to the - * end-of-buffer state). Contrast this with the test - * in input(). - */ - if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] ) - { /* This was really a NUL. */ - yy_state_type yy_next_state; - - yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text; - - yy_current_state = yy_get_previous_state(); - - /* Okay, we're now positioned to make the NUL - * transition. We couldn't have - * yy_get_previous_state() go ahead and do it - * for us because it doesn't know how to deal - * with the possibility of jamming (and we don't - * want to build jamming into it because then it - * will run more slowly). - */ - - yy_next_state = yy_try_NUL_trans( yy_current_state ); - - yy_bp = yytext_ptr + YY_MORE_ADJ; - - if ( yy_next_state ) - { - /* Consume the NUL. */ - yy_cp = ++yy_c_buf_p; - yy_current_state = yy_next_state; - goto yy_match; - } - - else - { - yy_cp = yy_c_buf_p; - goto yy_find_action; - } - } - - else switch ( yy_get_next_buffer() ) - { - case EOB_ACT_END_OF_FILE: - { - yy_did_buffer_switch_on_eof = 0; - - if ( yywrap() ) - { - /* Note: because we've taken care in - * yy_get_next_buffer() to have set up - * yytext, we can now set up - * yy_c_buf_p so that if some total - * hoser (like flex itself) wants to - * call the scanner after we return the - * YY_NULL, it'll still work - another - * YY_NULL will get returned. - */ - yy_c_buf_p = yytext_ptr + YY_MORE_ADJ; - - yy_act = YY_STATE_EOF(YY_START); - goto do_action; - } - - else - { - if ( ! yy_did_buffer_switch_on_eof ) - YY_NEW_FILE; - } - break; - } - - case EOB_ACT_CONTINUE_SCAN: - yy_c_buf_p = - yytext_ptr + yy_amount_of_matched_text; - - yy_current_state = yy_get_previous_state(); - - yy_cp = yy_c_buf_p; - yy_bp = yytext_ptr + YY_MORE_ADJ; - goto yy_match; - - case EOB_ACT_LAST_MATCH: - yy_c_buf_p = - &yy_current_buffer->yy_ch_buf[yy_n_chars]; - - yy_current_state = yy_get_previous_state(); - - yy_cp = yy_c_buf_p; - yy_bp = yytext_ptr + YY_MORE_ADJ; - goto yy_find_action; - } - break; - } - - default: - YY_FATAL_ERROR( - "fatal flex scanner internal error--no action found" ); - } /* end of action switch */ - } /* end of scanning one token */ - } /* end of yylex */ - - -/* yy_get_next_buffer - try to read in a new buffer - * - * Returns a code representing an action: - * EOB_ACT_LAST_MATCH - - * EOB_ACT_CONTINUE_SCAN - continue scanning from current position - * EOB_ACT_END_OF_FILE - end of file - */ - -static int yy_get_next_buffer() - { - register char *dest = yy_current_buffer->yy_ch_buf; - register char *source = yytext_ptr; - register int number_to_move, i; - int ret_val; - - if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] ) - YY_FATAL_ERROR( - "fatal flex scanner internal error--end of buffer missed" ); - - if ( yy_current_buffer->yy_fill_buffer == 0 ) - { /* Don't try to fill the buffer, so this is an EOF. */ - if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 ) - { - /* We matched a single character, the EOB, so - * treat this as a final EOF. - */ - return EOB_ACT_END_OF_FILE; - } - - else - { - /* We matched some text prior to the EOB, first - * process it. - */ - return EOB_ACT_LAST_MATCH; - } - } - - /* Try to read more data. */ - - /* First move last chars to start of buffer. */ - number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1; - - for ( i = 0; i < number_to_move; ++i ) - *(dest++) = *(source++); - - if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING ) - /* don't do the read, it's not guaranteed to return an EOF, - * just force an EOF - */ - yy_current_buffer->yy_n_chars = yy_n_chars = 0; - - else - { - int num_to_read = - yy_current_buffer->yy_buf_size - number_to_move - 1; - - while ( num_to_read <= 0 ) - { /* Not enough room in the buffer - grow it. */ -#ifdef YY_USES_REJECT - YY_FATAL_ERROR( -"input buffer overflow, can't enlarge buffer because scanner uses REJECT" ); -#else - - /* just a shorter name for the current buffer */ - YY_BUFFER_STATE b = yy_current_buffer; - - int yy_c_buf_p_offset = - (int) (yy_c_buf_p - b->yy_ch_buf); - - if ( b->yy_is_our_buffer ) - { - int new_size = b->yy_buf_size * 2; - - if ( new_size <= 0 ) - b->yy_buf_size += b->yy_buf_size / 8; - else - b->yy_buf_size *= 2; - - b->yy_ch_buf = (char *) - /* Include room in for 2 EOB chars. */ - yy_flex_realloc( (void *) b->yy_ch_buf, - b->yy_buf_size + 2 ); - } - else - /* Can't grow it, we don't own it. */ - b->yy_ch_buf = 0; - - if ( ! b->yy_ch_buf ) - YY_FATAL_ERROR( - "fatal error - scanner input buffer overflow" ); - - yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset]; - - num_to_read = yy_current_buffer->yy_buf_size - - number_to_move - 1; -#endif - } - - if ( num_to_read > YY_READ_BUF_SIZE ) - num_to_read = YY_READ_BUF_SIZE; - - /* Read in more data. */ - YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]), - yy_n_chars, num_to_read ); - - yy_current_buffer->yy_n_chars = yy_n_chars; - } - - if ( yy_n_chars == 0 ) - { - if ( number_to_move == YY_MORE_ADJ ) - { - ret_val = EOB_ACT_END_OF_FILE; - yyrestart( yyin ); - } - - else - { - ret_val = EOB_ACT_LAST_MATCH; - yy_current_buffer->yy_buffer_status = - YY_BUFFER_EOF_PENDING; - } - } - - else - ret_val = EOB_ACT_CONTINUE_SCAN; - - yy_n_chars += number_to_move; - yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR; - yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR; - - yytext_ptr = &yy_current_buffer->yy_ch_buf[0]; - - return ret_val; - } - - -/* yy_get_previous_state - get the state just before the EOB char was reached */ - -static yy_state_type yy_get_previous_state() - { - register yy_state_type yy_current_state; - register char *yy_cp; - - yy_current_state = yy_start; - yy_current_state += YY_AT_BOL(); - - for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp ) - { - register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); - if ( yy_accept[yy_current_state] ) - { - yy_last_accepting_state = yy_current_state; - yy_last_accepting_cpos = yy_cp; - } - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) - { - yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 819 ) - yy_c = yy_meta[(unsigned int) yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - } - - return yy_current_state; - } - - -/* yy_try_NUL_trans - try to make a transition on the NUL character - * - * synopsis - * next_state = yy_try_NUL_trans( current_state ); - */ - -#ifdef YY_USE_PROTOS -static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state ) -#else -static yy_state_type yy_try_NUL_trans( yy_current_state ) -yy_state_type yy_current_state; -#endif - { - register int yy_is_jam; - register char *yy_cp = yy_c_buf_p; - - register YY_CHAR yy_c = 1; - if ( yy_accept[yy_current_state] ) - { - yy_last_accepting_state = yy_current_state; - yy_last_accepting_cpos = yy_cp; - } - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) - { - yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 819 ) - yy_c = yy_meta[(unsigned int) yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - yy_is_jam = (yy_current_state == 818); - - return yy_is_jam ? 0 : yy_current_state; - } - - -#ifndef YY_NO_UNPUT -#ifdef YY_USE_PROTOS -static void yyunput( int c, register char *yy_bp ) -#else -static void yyunput( c, yy_bp ) -int c; -register char *yy_bp; -#endif - { - register char *yy_cp = yy_c_buf_p; - - /* undo effects of setting up yytext */ - *yy_cp = yy_hold_char; - - if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) - { /* need to shift things up to make room */ - /* +2 for EOB chars. */ - register int number_to_move = yy_n_chars + 2; - register char *dest = &yy_current_buffer->yy_ch_buf[ - yy_current_buffer->yy_buf_size + 2]; - register char *source = - &yy_current_buffer->yy_ch_buf[number_to_move]; - - while ( source > yy_current_buffer->yy_ch_buf ) - *--dest = *--source; - - yy_cp += (int) (dest - source); - yy_bp += (int) (dest - source); - yy_current_buffer->yy_n_chars = - yy_n_chars = yy_current_buffer->yy_buf_size; - - if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) - YY_FATAL_ERROR( "flex scanner push-back overflow" ); - } - - *--yy_cp = (char) c; - - - yytext_ptr = yy_bp; - yy_hold_char = *yy_cp; - yy_c_buf_p = yy_cp; - } -#endif /* ifndef YY_NO_UNPUT */ - - -#ifdef __cplusplus -static int yyinput() -#else -static int input() -#endif - { - int c; - - *yy_c_buf_p = yy_hold_char; - - if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR ) - { - /* yy_c_buf_p now points to the character we want to return. - * If this occurs *before* the EOB characters, then it's a - * valid NUL; if not, then we've hit the end of the buffer. - */ - if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] ) - /* This was really a NUL. */ - *yy_c_buf_p = '\0'; - - else - { /* need more input */ - int offset = yy_c_buf_p - yytext_ptr; - ++yy_c_buf_p; - - switch ( yy_get_next_buffer() ) - { - case EOB_ACT_LAST_MATCH: - /* This happens because yy_g_n_b() - * sees that we've accumulated a - * token and flags that we need to - * try matching the token before - * proceeding. But for input(), - * there's no matching to consider. - * So convert the EOB_ACT_LAST_MATCH - * to EOB_ACT_END_OF_FILE. - */ - - /* Reset buffer status. */ - yyrestart( yyin ); - - /* fall through */ - - case EOB_ACT_END_OF_FILE: - { - if ( yywrap() ) - return EOF; - - if ( ! yy_did_buffer_switch_on_eof ) - YY_NEW_FILE; -#ifdef __cplusplus - return yyinput(); -#else - return input(); -#endif - } - - case EOB_ACT_CONTINUE_SCAN: - yy_c_buf_p = yytext_ptr + offset; - break; - } - } - } - - c = *(unsigned char *) yy_c_buf_p; /* cast for 8-bit char's */ - *yy_c_buf_p = '\0'; /* preserve yytext */ - yy_hold_char = *++yy_c_buf_p; - - yy_current_buffer->yy_at_bol = (c == '\n'); - - return c; - } - - -#ifdef YY_USE_PROTOS -void yyrestart( FILE *input_file ) -#else -void yyrestart( input_file ) -FILE *input_file; -#endif - { - if ( ! yy_current_buffer ) - yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); - - yy_init_buffer( yy_current_buffer, input_file ); - yy_load_buffer_state(); - } - - -#ifdef YY_USE_PROTOS -void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer ) -#else -void yy_switch_to_buffer( new_buffer ) -YY_BUFFER_STATE new_buffer; -#endif - { - if ( yy_current_buffer == new_buffer ) - return; - - if ( yy_current_buffer ) - { - /* Flush out information for old buffer. */ - *yy_c_buf_p = yy_hold_char; - yy_current_buffer->yy_buf_pos = yy_c_buf_p; - yy_current_buffer->yy_n_chars = yy_n_chars; - } - - yy_current_buffer = new_buffer; - yy_load_buffer_state(); - - /* We don't actually know whether we did this switch during - * EOF (yywrap()) processing, but the only time this flag - * is looked at is after yywrap() is called, so it's safe - * to go ahead and always set it. - */ - yy_did_buffer_switch_on_eof = 1; - } - - -#ifdef YY_USE_PROTOS -void yy_load_buffer_state( void ) -#else -void yy_load_buffer_state() -#endif - { - yy_n_chars = yy_current_buffer->yy_n_chars; - yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos; - yyin = yy_current_buffer->yy_input_file; - yy_hold_char = *yy_c_buf_p; - } - - -#ifdef YY_USE_PROTOS -YY_BUFFER_STATE yy_create_buffer( FILE *file, int size ) -#else -YY_BUFFER_STATE yy_create_buffer( file, size ) -FILE *file; -int size; -#endif - { - YY_BUFFER_STATE b; - - b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) ); - if ( ! b ) - YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); - - b->yy_buf_size = size; - - /* yy_ch_buf has to be 2 characters longer than the size given because - * we need to put in 2 end-of-buffer characters. - */ - b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 ); - if ( ! b->yy_ch_buf ) - YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); - - b->yy_is_our_buffer = 1; - - yy_init_buffer( b, file ); - - return b; - } - - -#ifdef YY_USE_PROTOS -void yy_delete_buffer( YY_BUFFER_STATE b ) -#else -void yy_delete_buffer( b ) -YY_BUFFER_STATE b; -#endif - { - if ( ! b ) - return; - - if ( b == yy_current_buffer ) - yy_current_buffer = (YY_BUFFER_STATE) 0; - - if ( b->yy_is_our_buffer ) - yy_flex_free( (void *) b->yy_ch_buf ); - - yy_flex_free( (void *) b ); - } - - -#ifndef YY_ALWAYS_INTERACTIVE -#ifndef YY_NEVER_INTERACTIVE -extern int isatty YY_PROTO(( int )); -#endif -#endif - -#ifdef YY_USE_PROTOS -void yy_init_buffer( YY_BUFFER_STATE b, FILE *file ) -#else -void yy_init_buffer( b, file ) -YY_BUFFER_STATE b; -FILE *file; -#endif - - - { - yy_flush_buffer( b ); - - b->yy_input_file = file; - b->yy_fill_buffer = 1; - -#if YY_ALWAYS_INTERACTIVE - b->yy_is_interactive = 1; -#else -#if YY_NEVER_INTERACTIVE - b->yy_is_interactive = 0; -#else - b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; -#endif -#endif - } - - -#ifdef YY_USE_PROTOS -void yy_flush_buffer( YY_BUFFER_STATE b ) -#else -void yy_flush_buffer( b ) -YY_BUFFER_STATE b; -#endif - - { - if ( ! b ) - return; - - b->yy_n_chars = 0; - - /* We always need two end-of-buffer characters. The first causes - * a transition to the end-of-buffer state. The second causes - * a jam in that state. - */ - b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; - b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; - - b->yy_buf_pos = &b->yy_ch_buf[0]; - - b->yy_at_bol = 1; - b->yy_buffer_status = YY_BUFFER_NEW; - - if ( b == yy_current_buffer ) - yy_load_buffer_state(); - } - - -#ifndef YY_NO_SCAN_BUFFER -#ifdef YY_USE_PROTOS -YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size ) -#else -YY_BUFFER_STATE yy_scan_buffer( base, size ) -char *base; -yy_size_t size; -#endif - { - YY_BUFFER_STATE b; - - if ( size < 2 || - base[size-2] != YY_END_OF_BUFFER_CHAR || - base[size-1] != YY_END_OF_BUFFER_CHAR ) - /* They forgot to leave room for the EOB's. */ - return 0; - - b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) ); - if ( ! b ) - YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" ); - - b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ - b->yy_buf_pos = b->yy_ch_buf = base; - b->yy_is_our_buffer = 0; - b->yy_input_file = 0; - b->yy_n_chars = b->yy_buf_size; - b->yy_is_interactive = 0; - b->yy_at_bol = 1; - b->yy_fill_buffer = 0; - b->yy_buffer_status = YY_BUFFER_NEW; - - yy_switch_to_buffer( b ); - - return b; - } -#endif - - -#ifndef YY_NO_SCAN_STRING -#ifdef YY_USE_PROTOS -YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str ) -#else -YY_BUFFER_STATE yy_scan_string( yy_str ) -yyconst char *yy_str; -#endif - { - int len; - for ( len = 0; yy_str[len]; ++len ) - ; - - return yy_scan_bytes( yy_str, len ); - } -#endif - - -#ifndef YY_NO_SCAN_BYTES -#ifdef YY_USE_PROTOS -YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len ) -#else -YY_BUFFER_STATE yy_scan_bytes( bytes, len ) -yyconst char *bytes; -int len; -#endif - { - YY_BUFFER_STATE b; - char *buf; - yy_size_t n; - int i; - - /* Get memory for full buffer, including space for trailing EOB's. */ - n = len + 2; - buf = (char *) yy_flex_alloc( n ); - if ( ! buf ) - YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); - - for ( i = 0; i < len; ++i ) - buf[i] = bytes[i]; - - buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR; - - b = yy_scan_buffer( buf, n ); - if ( ! b ) - YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" ); - - /* It's okay to grow etc. this buffer, and we should throw it - * away when we're done. - */ - b->yy_is_our_buffer = 1; - - return b; - } -#endif - - -#ifndef YY_NO_PUSH_STATE -#ifdef YY_USE_PROTOS -static void yy_push_state( int new_state ) -#else -static void yy_push_state( new_state ) -int new_state; -#endif - { - if ( yy_start_stack_ptr >= yy_start_stack_depth ) - { - yy_size_t new_size; - - yy_start_stack_depth += YY_START_STACK_INCR; - new_size = yy_start_stack_depth * sizeof( int ); - - if ( ! yy_start_stack ) - yy_start_stack = (int *) yy_flex_alloc( new_size ); - - else - yy_start_stack = (int *) yy_flex_realloc( - (void *) yy_start_stack, new_size ); - - if ( ! yy_start_stack ) - YY_FATAL_ERROR( - "out of memory expanding start-condition stack" ); - } - - yy_start_stack[yy_start_stack_ptr++] = YY_START; - - BEGIN(new_state); - } -#endif - - -#ifndef YY_NO_POP_STATE -static void yy_pop_state() - { - if ( --yy_start_stack_ptr < 0 ) - YY_FATAL_ERROR( "start-condition stack underflow" ); - - BEGIN(yy_start_stack[yy_start_stack_ptr]); - } -#endif - - -#ifndef YY_NO_TOP_STATE -static int yy_top_state() - { - return yy_start_stack[yy_start_stack_ptr - 1]; - } -#endif - -#ifndef YY_EXIT_FAILURE -#define YY_EXIT_FAILURE 2 -#endif - -#ifdef YY_USE_PROTOS -static void yy_fatal_error( yyconst char msg[] ) -#else -static void yy_fatal_error( msg ) -char msg[]; -#endif - { - (void) fprintf( stderr, "%s\n", msg ); - exit( YY_EXIT_FAILURE ); - } - - - -/* Redefine yyless() so it works in section 3 code. */ - -#undef yyless -#define yyless(n) \ - do \ - { \ - /* Undo effects of setting up yytext. */ \ - yytext[yyleng] = yy_hold_char; \ - yy_c_buf_p = yytext + n; \ - yy_hold_char = *yy_c_buf_p; \ - *yy_c_buf_p = '\0'; \ - yyleng = n; \ - } \ - while ( 0 ) - - -/* Internal utility routines. */ - -#ifndef yytext_ptr -#ifdef YY_USE_PROTOS -static void yy_flex_strncpy( char *s1, yyconst char *s2, int n ) -#else -static void yy_flex_strncpy( s1, s2, n ) -char *s1; -yyconst char *s2; -int n; -#endif - { - register int i; - for ( i = 0; i < n; ++i ) - s1[i] = s2[i]; - } -#endif - -#ifdef YY_NEED_STRLEN -#ifdef YY_USE_PROTOS -static int yy_flex_strlen( yyconst char *s ) -#else -static int yy_flex_strlen( s ) -yyconst char *s; -#endif - { - register int n; - for ( n = 0; s[n]; ++n ) - ; - - return n; - } -#endif - - -#ifdef YY_USE_PROTOS -static void *yy_flex_alloc( yy_size_t size ) -#else -static void *yy_flex_alloc( size ) -yy_size_t size; -#endif - { - return (void *) malloc( size ); - } - -#ifdef YY_USE_PROTOS -static void *yy_flex_realloc( void *ptr, yy_size_t size ) -#else -static void *yy_flex_realloc( ptr, size ) -void *ptr; -yy_size_t size; -#endif - { - /* The cast to (char *) in the following accommodates both - * implementations that use char* generic pointers, and those - * that use void* generic pointers. It works with the latter - * because both ANSI C and C++ allow castless assignment from - * any pointer type to void*, and deal with argument conversions - * as though doing an assignment. - */ - return (void *) realloc( (char *) ptr, size ); - } - -#ifdef YY_USE_PROTOS -static void yy_flex_free( void *ptr ) -#else -static void yy_flex_free( ptr ) -void *ptr; -#endif - { - free( ptr ); - } - -#if YY_MAIN -int main() - { - yylex(); - return 0; - } -#endif -#line 153 "../../../extras/FvwmScript/scanner.l" diff --git a/app/fvwm/extras/FvwmScript/scanner.l b/app/fvwm/extras/FvwmScript/scanner.l deleted file mode 100644 index 534e0ea45..000000000 --- a/app/fvwm/extras/FvwmScript/scanner.l +++ /dev/null @@ -1,152 +0,0 @@ -%{ -# include "script.h" -# include "types.h" - -int numligne=1; -%} - - -bl [ \t]* -nl \n -commentaire #.* -nb [-+]?[0-9]* -str [^ = \t \n \( \) \< \> \} \{]+ -gstr \{[^\{\}\n]*[\}\n] -inf < -infeq <= -equal == -supeq >= -sup > -diff <> -get = - -%% -{bl} ; -{commentaire} ; - -^{bl}+WindowTitle { return WINDOWTITLE; } -^{bl}+WindowSize { return WINDOWSIZE; } -^{bl}+WindowPosition { return WINDOWPOSITION; } -^{bl}+ForeColor { return FORECOLOR; } -^{bl}+BackColor { return BACKCOLOR; } -^{bl}+ShadowColor { return SHADCOLOR; } -^{bl}+HilightColor { return LICOLOR; } -^{bl}+Widget { return OBJECT; } -^{bl}+Property { return PROP; } -^{bl}+Main { return MAIN; } -^{bl}+End { return END; } -^{bl}+Font { return FONT; } - -^{bl}+Type { return TYPE; } -^{bl}+Size { return SIZE; } -^{bl}+Position { return POSITION; } -^{bl}+Value { return VALUE; } -^{bl}+MinValue { return VALUEMIN; } -^{bl}+MaxValue { return VALUEMAX; } -^{bl}+Title { return TITLE; } -^{bl}+SwallowExec { return SWALLOWEXEC; } -^{bl}+Icon { return ICON; } -^{bl}+Flags { return FLAGS; } -Hidden { return HIDDEN; } -CanBeSelected { return CANBESELECTED; } -NoReliefString { return NORELIEFSTRING; } - -^{bl}+Do { return EXEC; } -^{bl}+HideWidget { return HIDE; } -^{bl}+ShowWidget { return SHOW; } -^{bl}+ChangeValue { return CHVALUE; } -^{bl}+ChangeMaxValue { return CHVALUEMAX; } -^{bl}+ChangeMinValue { return CHVALUEMIN; } -GetTitle { return GETTITLE; } -GetValue { return GETVALUE; } -GetOutput { return GETOUTPUT; } -NumToHex { return NUMTOHEX; } -HexToNum { return HEXTONUM; } -Add { return ADD;} -Mult { return MULT;} -Div { return DIV;} -StrCopy { return STRCOPY; } -LaunchScript { return LAUNCHSCRIPT; } -GetScriptFather { return GETSCRIPTFATHER; } -ReceivFromScript { return RECEIVFROMSCRIPT; } -RemainderOfDiv { return REMAINDEROFDIV; } -GetTime { return GETTIME; } -GetScriptArgument { return GETSCRIPTARG; } -^{bl}+ChangePosition { return POSITION; } -^{bl}+ChangeSize { return SIZE; } -^{bl}+ChangeTitle { return TITLE; } -^{bl}+ChangeIcon { return ICON; } -^{bl}+ChangeFont { return FONT; } -^{bl}+ChangeForeColor { return CHFORECOLOR; } -^{bl}+ChangeBackColor { return CHBACKCOLOR; } -^{bl}+Set { return SET; } -^{bl}+SendSignal { return SENDSIGN; } -^{bl}+Quit { return QUIT; } -^{bl}+Init { return INIT; } -^{bl}+PeriodicTasks { return PERIODICTASK; } -^{bl}+For { return FOR; } -^{bl}+WarpPointer { return WARP; } -^{bl}+WriteToFile { return WRITETOFILE; } -^{bl}+SendToScript { return SENDTOSCRIPT; } -^{bl}+SingleClic { return SINGLECLIC; } -^{bl}+DoubleClic { return DOUBLECLIC; } -To { return TO; } -Do { return DO; } -^{bl}+If { return IF; } -Then { return THEN; } -Else { return ELSE; } - -{inf} { return INF; } -{infeq} { return INFEQ; } -{supeq} { return SUPEQ; } -{sup} { return SUP; } -{diff} { return DIFF; } -{equal} { return EQUAL; } -{get} { return GET; } - -^{bl}+While { return WHILE; } -^{bl}+Case+[ \t]+message+[ \t]of { return CASE; } -^{bl}+Begin { return BEG; } -: { return POINT; } -[\(] { return BEGF; } -[\)] { return ENDF; } - - -{nb} { yylval.number=atoi(yytext); - return NUMBER; - } - -[\$]+{str} { - yylval.str=(char*) strdup(yytext+1); - yylval.str[yyleng-1]='\0'; - return VAR; - } -{gstr} { /* Str entre "" */ - yylval.str=(char*) strdup(yytext+1); - yylval.str[yyleng-2]='\0'; - return GSTR; - } - -{str} { yylval.str=(char*) strdup(yytext); - yylval.str[yyleng]='\0'; - return STR; - } - - -{nl} { numligne++; } - - - - - - - - - - - - - - - - diff --git a/app/fvwm/extras/FvwmScript/script.c b/app/fvwm/extras/FvwmScript/script.c deleted file mode 100644 index ef8a86688..000000000 --- a/app/fvwm/extras/FvwmScript/script.c +++ /dev/null @@ -1,2109 +0,0 @@ - -/* A Bison parser, made from ../../../extras/FvwmScript/script.y - by GNU Bison version 1.25 - */ - -#define YYBISON 1 /* Identify Bison output. */ - -#define STR 258 -#define GSTR 259 -#define VAR 260 -#define NUMBER 261 -#define WINDOWTITLE 262 -#define WINDOWSIZE 263 -#define WINDOWPOSITION 264 -#define FONT 265 -#define FORECOLOR 266 -#define BACKCOLOR 267 -#define SHADCOLOR 268 -#define LICOLOR 269 -#define OBJECT 270 -#define INIT 271 -#define PERIODICTASK 272 -#define MAIN 273 -#define END 274 -#define PROP 275 -#define TYPE 276 -#define SIZE 277 -#define POSITION 278 -#define VALUE 279 -#define VALUEMIN 280 -#define VALUEMAX 281 -#define TITLE 282 -#define SWALLOWEXEC 283 -#define ICON 284 -#define FLAGS 285 -#define WARP 286 -#define WRITETOFILE 287 -#define HIDDEN 288 -#define CANBESELECTED 289 -#define NORELIEFSTRING 290 -#define CASE 291 -#define SINGLECLIC 292 -#define DOUBLECLIC 293 -#define BEG 294 -#define POINT 295 -#define EXEC 296 -#define HIDE 297 -#define SHOW 298 -#define CHFORECOLOR 299 -#define CHBACKCOLOR 300 -#define GETVALUE 301 -#define CHVALUE 302 -#define CHVALUEMAX 303 -#define CHVALUEMIN 304 -#define ADD 305 -#define DIV 306 -#define MULT 307 -#define GETTITLE 308 -#define GETOUTPUT 309 -#define STRCOPY 310 -#define NUMTOHEX 311 -#define HEXTONUM 312 -#define QUIT 313 -#define LAUNCHSCRIPT 314 -#define GETSCRIPTFATHER 315 -#define SENDTOSCRIPT 316 -#define RECEIVFROMSCRIPT 317 -#define GET 318 -#define SET 319 -#define SENDSIGN 320 -#define REMAINDEROFDIV 321 -#define GETTIME 322 -#define GETSCRIPTARG 323 -#define IF 324 -#define THEN 325 -#define ELSE 326 -#define FOR 327 -#define TO 328 -#define DO 329 -#define WHILE 330 -#define BEGF 331 -#define ENDF 332 -#define EQUAL 333 -#define INFEQ 334 -#define SUPEQ 335 -#define INF 336 -#define SUP 337 -#define DIFF 338 - -#line 1 "../../../extras/FvwmScript/script.y" - -#include "types.h" - -extern int numligne; -ScriptProp *scriptprop; -int nbobj=-1; /* Nombre d'objets */ -int HasPosition,HasType=0; -TabObj *tabobj; /* Tableau d'objets, limite=100 */ -int TabIdObj[101]; /* Tableau d'indice des objets */ -Bloc **TabIObj; /* TabIObj[Obj][Case] -> bloc attache au case */ -Bloc *PileBloc[10]; /* Au maximum 10 imbrications de boucle conditionnelle */ -int TopPileB=0; /* Sommet de la pile des blocs */ -CaseObj *TabCObj; /* Struct pour enregistrer les valeurs des cases et leur nb */ -int CurrCase; -int i; -char **TabNVar; /* Tableau des noms de variables */ -char **TabVVar; /* Tableau des valeurs de variables */ -int NbVar; -long BuffArg[6][20]; /* Les arguments s'ajoute par couche pour chaque fonction imbriquee */ -int NbArg[6]; /* Tableau: nb d'args pour chaque couche */ -int SPileArg; /* Taille de la pile d'arguments */ -long l; - -/* Initialisation globale */ -void InitVarGlob() -{ - scriptprop=(ScriptProp*) calloc(1,sizeof(ScriptProp)); - scriptprop->x=-1; - scriptprop->y=-1; - scriptprop->initbloc=NULL; - - tabobj=(TabObj*) calloc(1,sizeof(TabObj)); - for (i=0;i<101;i++) - TabIdObj[i]=-1; - TabNVar=NULL; - TabVVar=NULL; - NbVar=-1; - - SPileArg=-1; - scriptprop->periodictasks=NULL; -} - -/* Initialisation pour un objet */ -void InitObjTabCase(int HasMainLoop) -{ - if (nbobj==0) - { - TabIObj=(Bloc**)calloc(1,sizeof(long)); - TabCObj=(CaseObj*)calloc(1,sizeof(CaseObj)); - } - else - { - TabIObj=(Bloc**)realloc(TabIObj,sizeof(long)*(nbobj+1)); - TabCObj=(CaseObj*)realloc(TabCObj,sizeof(CaseObj)*(nbobj+1)); - } - - if (!HasMainLoop) - TabIObj[nbobj]=NULL; - CurrCase=-1; - TabCObj[nbobj].NbCase=-1; -} - -/* Ajout d'un case dans la table TabCase */ -/* Initialisation d'un case of: agrandissement de la table */ -void InitCase(int cond) -{ - CurrCase++; - - /* On enregistre la condition du case */ - TabCObj[nbobj].NbCase++; - if (TabCObj[nbobj].NbCase==0) - TabCObj[nbobj].LstCase=(int*)calloc(1,sizeof(int)); - else - TabCObj[nbobj].LstCase=(int*)realloc(TabCObj[nbobj].LstCase,sizeof(int)*(CurrCase+1)); - TabCObj[nbobj].LstCase[CurrCase]=cond; - - if (CurrCase==0) - TabIObj[nbobj]=(Bloc*)calloc(1,sizeof(Bloc)); - else - TabIObj[nbobj]=(Bloc*)realloc(TabIObj[nbobj],sizeof(Bloc)*(CurrCase+1)); - - TabIObj[nbobj][CurrCase].NbInstr=-1; - TabIObj[nbobj][CurrCase].TabInstr=NULL; - - /* Ce case correspond au bloc courant d'instruction: on l'empile */ - PileBloc[0]=&TabIObj[nbobj][CurrCase]; - TopPileB=0; -} - -/* Enleve un niveau d'args dans la pile BuffArg */ -void RmLevelBufArg() -{ - SPileArg--; -} - -/* Fonction de concatenation des n derniers etage de la pile */ -/* Retourne les elts trie et depile et la taille */ -long *Depile(int NbLevelArg, int *s) -{ - long *Temp; - int j; - int i; - int size; - - if (NbLevelArg>0) - { - Temp=(long*)calloc(1,sizeof(long)); - size=0; - for (i=SPileArg-NbLevelArg+1;i<=SPileArg;i++) - { - size=NbArg[i]+size+1; - Temp=(long*)realloc (Temp,sizeof(long)*size); - for (j=0;j<=NbArg[i];j++) - { - Temp[j+size-NbArg[i]-1]=BuffArg[i][j]; - } - } - *s=size; - for (i=0;i<NbLevelArg;i++) /* On depile les couches d'arguments */ - RmLevelBufArg(); - return Temp; - } - else - { - return NULL; - *s=0; - } -} - -/* Ajout d'une commande */ -void AddCom(int Type, int NbLevelArg) -{ - int CurrInstr; - - - PileBloc[TopPileB]->NbInstr++; - CurrInstr=PileBloc[TopPileB]->NbInstr; - - if (CurrInstr==0) - PileBloc[TopPileB]->TabInstr=(Instr*)calloc(1,sizeof(Instr)*(CurrInstr+1)); - else - PileBloc[TopPileB]->TabInstr=(Instr*)realloc(PileBloc[TopPileB]->TabInstr, - sizeof(Instr)*(CurrInstr+1)); - /* Rangement des instructions dans le bloc */ - PileBloc[TopPileB]->TabInstr[CurrInstr].Type=Type; - /* On enleve la derniere couche d'argument et on la range dans la commande */ - - PileBloc[TopPileB]->TabInstr[CurrInstr].TabArg=Depile(NbLevelArg, - &PileBloc[TopPileB]->TabInstr[CurrInstr].NbArg); -} - -/* Initialisation du buffer contenant les arguments de la commande courante */ -/* Ajout d'une couche d'argument dans la pile*/ -void AddLevelBufArg() -{ - /* Agrandissment de la pile */ - SPileArg++; - NbArg[SPileArg]=-1; -} - -/* Ajout d'un arg dans la couche arg qui est au sommet de la pile TabArg */ -void AddBufArg(long *TabLong,int NbLong) -{ - int i; - - for (i=0;i<NbLong;i++) - { - BuffArg[SPileArg][i+NbArg[SPileArg]+1]=TabLong[i]; - } - NbArg[SPileArg]=NbArg[SPileArg]+NbLong; -} - -/* Recheche d'un nom de var dans TabVar, s'il n'existe pas il le cree */ -/* Retourne un Id */ -void AddVar(char *Name) /* ajout de variable a la fin de la derniere commande pointee */ -{ - int i; - - /* Comparaison avec les variables deja existante */ - for (i=0;i<=NbVar;i++) - if (strcmp(TabNVar[i],Name)==0) - { - l=(long)i; - AddBufArg(&l,1); - return ; - } - - if (NbVar>58) - { - fprintf(stderr,"Line %d: too many variables (>60)\n",numligne); - exit(1); - } - - /* La variable n'a pas ete trouvee: creation */ - NbVar++; - - if (NbVar==0) - { - TabNVar=(char**)calloc(1,sizeof(long)); - TabVVar=(char**)calloc(1,sizeof(long)); - } - else - { - TabNVar=(char**)realloc(TabNVar,sizeof(long)*(NbVar+1)); - TabVVar=(char**)realloc(TabVVar,sizeof(long)*(NbVar+1)); - } - - TabNVar[NbVar]=(char*)strdup(Name); - TabVVar[NbVar]=(char*)calloc(1,sizeof(char)); - TabVVar[NbVar][0]='\0'; - - - /* Ajout de la variable dans le buffer Arg */ - l=(long)NbVar; - AddBufArg(&l,1); - return ; -} - -/* Ajout d'une constante str comme argument */ -void AddConstStr(char *Name) -{ - /* On cree une nouvelle variable et on range la constante dedans */ - NbVar++; - if (NbVar==0) - { - TabVVar=(char**)calloc(1,sizeof(long)); - TabNVar=(char**)calloc(1,sizeof(long)); - } - else - { - TabVVar=(char**)realloc(TabVVar,sizeof(long)*(NbVar+1)); - TabNVar=(char**)realloc(TabNVar,sizeof(long)*(NbVar+1)); - } - - TabNVar[NbVar]=(char*)calloc(1,sizeof(char)); - TabNVar[NbVar][0]='\0'; - TabVVar[NbVar]=(char*)strdup(Name); - - /* Ajout de l'id de la constante dans la liste courante des arguments */ - l=(long)NbVar; - AddBufArg(&l,1); -} - -/* Ajout d'une constante numerique comme argument */ -void AddConstNum(long num) -{ - - /* On ne cree pas de nouvelle variable */ - /* On code la valeur numerique afin de le ranger sous forme d'id */ - l=num+200000; - /* Ajout de la constante dans la liste courante des arguments */ - AddBufArg(&l,1); -} - -/* Ajout d'une fonction comme argument */ -/* Enleve les args de func de la pile, */ -/* le concate, et les range dans la pile */ -void AddFunct(int code,int NbLevelArg) -{ - int size; - long *l; - int i; - - /* Methode: depiler BuffArg et completer le niveau inferieur de BuffArg */ - l=Depile(NbLevelArg, &size); - - size++; - if (size==1) - l=(long*)calloc(1,sizeof(long)); - else - { - l=(long*)realloc(l,sizeof(long)*(size)); - for (i=size-2;i>-1;i--) /* Deplacement des args */ - { - l[i+1]=l[i]; - } - } - l[0]=(long)code-150000; - - AddBufArg(l,size); -} - -/* Ajout d'une instruction de test pour executer un ou plusieurs blocs */ -/* enregistre l'instruction et le champs de ces blocs = NULL */ -void AddComBloc(int TypeCond, int NbLevelArg, int NbBloc) -{ - int i; - int OldNA; - int CurrInstr; - - /* Ajout de l'instruction de teste comme d'une commande */ - AddCom(TypeCond, NbLevelArg); - - /* On initialise ensuite les deux champs reserve à bloc1 et bloc2 */ - CurrInstr=PileBloc[TopPileB]->NbInstr; - /* Attention NbArg peur changer si on utilise en arg une fonction */ - OldNA=PileBloc[TopPileB]->TabInstr[CurrInstr].NbArg; - - PileBloc[TopPileB]->TabInstr[CurrInstr].TabArg=(long*)realloc( - PileBloc[TopPileB]->TabInstr[CurrInstr].TabArg,sizeof(long)*(OldNA+NbBloc)); - for (i=0;i<NbBloc;i++) - { - PileBloc[TopPileB]->TabInstr[CurrInstr].TabArg[OldNA+i]=0; - } - PileBloc[TopPileB]->TabInstr[CurrInstr].NbArg=OldNA+NbBloc; -} - -/* Creer un nouveau bloc, et l'empile: il devient le bloc courant */ -void EmpilerBloc() -{ - Bloc *TmpBloc; - - TmpBloc=(Bloc*)calloc(1,sizeof(Bloc)); - TmpBloc->NbInstr=-1; - TmpBloc->TabInstr=NULL; - TopPileB++; - PileBloc[TopPileB]=TmpBloc; - -} - -/* Depile le bloc d'initialisation du script et le range a sa place speciale */ -void DepilerBloc(int IdBloc) -{ - Bloc *Bloc1; - Instr *IfInstr; - - Bloc1=PileBloc[TopPileB]; - TopPileB--; - IfInstr=&PileBloc[TopPileB]->TabInstr[PileBloc[TopPileB]->NbInstr]; - IfInstr->TabArg[IfInstr->NbArg-IdBloc]=(long)Bloc1; -} - -/* Gestion des erreurs de syntaxes */ -int yyerror(char *errmsg) -{ - fprintf(stderr,"Line %d: %s\n",numligne,errmsg); - return 0; -} - - - -#line 346 "../../../extras/FvwmScript/script.y" -typedef union { char *str; - int number; - } YYSTYPE; -#include <stdio.h> - -#ifndef __cplusplus -#ifndef __STDC__ -#define const -#endif -#endif - - - -#define YYFINAL 446 -#define YYFLAG -32768 -#define YYNTBASE 84 - -#define YYTRANSLATE(x) ((unsigned)(x) <= 338 ? yytranslate[x] : 146) - -static const char yytranslate[] = { 0, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 1, 2, 3, 4, 5, - 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, - 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, - 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, - 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, - 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, - 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, - 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, - 76, 77, 78, 79, 80, 81, 82, 83 -}; - -#if YYDEBUG != 0 -static const short yyprhs[] = { 0, - 0, 6, 7, 8, 12, 16, 21, 26, 30, 34, - 38, 42, 46, 47, 53, 54, 60, 61, 69, 71, - 72, 76, 81, 86, 90, 94, 98, 102, 106, 110, - 114, 118, 122, 126, 130, 134, 135, 138, 141, 144, - 145, 147, 153, 154, 155, 160, 165, 167, 169, 171, - 175, 176, 180, 184, 188, 192, 196, 200, 204, 208, - 212, 216, 220, 224, 228, 232, 236, 240, 244, 248, - 252, 256, 260, 264, 267, 270, 273, 276, 279, 282, - 285, 288, 291, 294, 297, 300, 303, 306, 309, 312, - 315, 318, 321, 324, 327, 330, 333, 336, 341, 346, - 351, 358, 365, 370, 375, 380, 385, 390, 396, 401, - 402, 405, 410, 415, 420, 424, 428, 436, 437, 441, - 442, 446, 448, 452, 454, 464, 472, 474, 476, 478, - 480, 482, 484, 485, 488, 491, 496, 500, 503, 507, - 511, 515, 520, 523, 525, 528, 532, 534, 537, 538, - 541, 544, 547, 550, 553, 556, 562, 564, 566, 568, - 570, 572, 574, 579, 581, 583, 585, 587, 592, 594, - 596, 601, 603, 605, 610, 612, 614, 616, 618, 620, - 622 -}; - -static const short yyrhs[] = { 85, - 86, 87, 88, 89, 0, 0, 0, 7, 4, 86, - 0, 29, 3, 86, 0, 9, 6, 6, 86, 0, - 8, 6, 6, 86, 0, 12, 4, 86, 0, 11, - 4, 86, 0, 13, 4, 86, 0, 14, 4, 86, - 0, 10, 3, 86, 0, 0, 16, 126, 39, 100, - 19, 0, 0, 17, 126, 39, 100, 19, 0, 0, - 15, 90, 20, 91, 93, 94, 89, 0, 6, 0, - 0, 21, 3, 91, 0, 22, 6, 6, 91, 0, - 23, 6, 6, 91, 0, 24, 6, 91, 0, 25, - 6, 91, 0, 26, 6, 91, 0, 27, 4, 91, - 0, 28, 4, 91, 0, 29, 3, 91, 0, 12, - 4, 91, 0, 11, 4, 91, 0, 13, 4, 91, - 0, 14, 4, 91, 0, 10, 3, 91, 0, 30, - 92, 91, 0, 0, 33, 92, 0, 35, 92, 0, - 34, 92, 0, 0, 19, 0, 18, 95, 36, 96, - 19, 0, 0, 0, 97, 40, 99, 96, 0, 98, - 40, 99, 96, 0, 37, 0, 38, 0, 6, 0, - 39, 100, 19, 0, 0, 41, 102, 100, 0, 31, - 118, 100, 0, 32, 120, 100, 0, 42, 103, 100, - 0, 43, 104, 100, 0, 47, 105, 100, 0, 48, - 106, 100, 0, 49, 107, 100, 0, 23, 108, 100, - 0, 22, 109, 100, 0, 27, 111, 100, 0, 29, - 110, 100, 0, 10, 112, 100, 0, 44, 113, 100, - 0, 45, 114, 100, 0, 64, 115, 100, 0, 65, - 116, 100, 0, 58, 117, 100, 0, 61, 119, 100, - 0, 69, 121, 100, 0, 72, 122, 100, 0, 75, - 123, 100, 0, 41, 102, 0, 31, 118, 0, 32, - 120, 0, 42, 103, 0, 43, 104, 0, 47, 105, - 0, 48, 106, 0, 49, 107, 0, 23, 108, 0, - 22, 109, 0, 27, 111, 0, 29, 110, 0, 10, - 112, 0, 44, 113, 0, 45, 114, 0, 64, 115, - 0, 65, 116, 0, 58, 117, 0, 61, 119, 0, - 72, 122, 0, 75, 123, 0, 137, 139, 0, 137, - 141, 0, 137, 141, 0, 137, 141, 137, 141, 0, - 137, 141, 137, 141, 0, 137, 141, 137, 141, 0, - 137, 141, 137, 141, 137, 141, 0, 137, 141, 137, - 141, 137, 141, 0, 137, 141, 137, 142, 0, 137, - 141, 137, 143, 0, 137, 141, 137, 142, 0, 137, - 141, 137, 143, 0, 137, 141, 137, 143, 0, 137, - 144, 63, 137, 139, 0, 137, 141, 137, 141, 0, - 0, 137, 141, 0, 137, 141, 137, 139, 0, 137, - 142, 137, 139, 0, 124, 126, 127, 125, 0, 129, - 126, 128, 0, 130, 126, 128, 0, 137, 140, 137, - 145, 137, 140, 70, 0, 0, 71, 126, 128, 0, - 0, 39, 100, 19, 0, 101, 0, 39, 100, 19, - 0, 101, 0, 137, 144, 63, 137, 140, 73, 137, - 140, 74, 0, 137, 140, 137, 145, 137, 140, 74, - 0, 5, 0, 3, 0, 4, 0, 6, 0, 37, - 0, 38, 0, 0, 46, 141, 0, 53, 141, 0, - 54, 143, 141, 141, 0, 56, 141, 141, 0, 57, - 143, 0, 50, 141, 141, 0, 52, 141, 141, 0, - 51, 141, 141, 0, 55, 143, 141, 141, 0, 59, - 143, 0, 60, 0, 62, 141, 0, 66, 141, 141, - 0, 67, 0, 68, 141, 0, 0, 135, 139, 0, - 136, 139, 0, 131, 139, 0, 133, 139, 0, 132, - 139, 0, 134, 139, 0, 76, 137, 138, 77, 139, - 0, 131, 0, 135, 0, 136, 0, 133, 0, 132, - 0, 134, 0, 76, 137, 138, 77, 0, 135, 0, - 136, 0, 134, 0, 131, 0, 76, 137, 138, 77, - 0, 131, 0, 132, 0, 76, 137, 138, 77, 0, - 131, 0, 133, 0, 76, 137, 138, 77, 0, 131, - 0, 81, 0, 79, 0, 78, 0, 80, 0, 82, - 0, 83, 0 -}; - -#endif - -#if YYDEBUG != 0 -static const short yyrline[] = { 0, - 369, 372, 376, 377, 380, 383, 388, 393, 396, 399, - 402, 405, 411, 412, 417, 418, 427, 428, 431, 446, - 447, 451, 455, 460, 463, 466, 469, 472, 475, 478, - 481, 484, 487, 490, 493, 495, 496, 499, 502, 508, - 519, 520, 523, 525, 526, 527, 530, 531, 534, 537, - 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, - 552, 553, 554, 555, 556, 557, 558, 559, 560, 561, - 562, 563, 564, 568, 569, 570, 571, 572, 573, 574, - 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, - 585, 586, 587, 588, 591, 593, 595, 597, 599, 601, - 603, 605, 607, 609, 611, 613, 615, 617, 619, 621, - 623, 625, 627, 629, 631, 633, 637, 639, 640, 642, - 644, 645, 648, 649, 653, 657, 662, 664, 666, 668, - 670, 672, 674, 676, 677, 678, 679, 680, 681, 682, - 683, 684, 685, 686, 687, 688, 689, 690, 695, 696, - 697, 698, 699, 700, 701, 702, 707, 708, 709, 710, - 711, 712, 713, 717, 718, 719, 720, 721, 725, 726, - 727, 731, 732, 733, 737, 741, 742, 743, 744, 745, - 746 -}; -#endif - - -#if YYDEBUG != 0 || defined (YYERROR_VERBOSE) - -static const char * const yytname[] = { "$","error","$undefined.","STR","GSTR", -"VAR","NUMBER","WINDOWTITLE","WINDOWSIZE","WINDOWPOSITION","FONT","FORECOLOR", -"BACKCOLOR","SHADCOLOR","LICOLOR","OBJECT","INIT","PERIODICTASK","MAIN","END", -"PROP","TYPE","SIZE","POSITION","VALUE","VALUEMIN","VALUEMAX","TITLE","SWALLOWEXEC", -"ICON","FLAGS","WARP","WRITETOFILE","HIDDEN","CANBESELECTED","NORELIEFSTRING", -"CASE","SINGLECLIC","DOUBLECLIC","BEG","POINT","EXEC","HIDE","SHOW","CHFORECOLOR", -"CHBACKCOLOR","GETVALUE","CHVALUE","CHVALUEMAX","CHVALUEMIN","ADD","DIV","MULT", -"GETTITLE","GETOUTPUT","STRCOPY","NUMTOHEX","HEXTONUM","QUIT","LAUNCHSCRIPT", -"GETSCRIPTFATHER","SENDTOSCRIPT","RECEIVFROMSCRIPT","GET","SET","SENDSIGN","REMAINDEROFDIV", -"GETTIME","GETSCRIPTARG","IF","THEN","ELSE","FOR","TO","DO","WHILE","BEGF","ENDF", -"EQUAL","INFEQ","SUPEQ","INF","SUP","DIFF","script","initvar","head","initbloc", -"periodictask","object","id","init","flags","verify","mainloop","addtabcase", -"case","clic","number","bloc","instr","oneinstr","exec","hide","show","chvalue", -"chvaluemax","chvaluemin","position","size","icon","title","font","chforecolor", -"chbackcolor","set","sendsign","quit","warp","sendtoscript","writetofile","ifthenelse", -"loop","while","headif","else","creerbloc","bloc1","bloc2","headloop","headwhile", -"var","str","gstr","num","singleclic2","doubleclic2","addlbuff","function","args", -"arg","numarg","strarg","gstrarg","vararg","compare", NULL -}; -#endif - -static const short yyr1[] = { 0, - 84, 85, 86, 86, 86, 86, 86, 86, 86, 86, - 86, 86, 87, 87, 88, 88, 89, 89, 90, 91, - 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, - 91, 91, 91, 91, 91, 92, 92, 92, 92, 93, - 94, 94, 95, 96, 96, 96, 97, 97, 98, 99, - 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, - 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, - 100, 100, 100, 101, 101, 101, 101, 101, 101, 101, - 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, - 101, 101, 101, 101, 102, 103, 104, 105, 106, 107, - 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, - 118, 119, 120, 121, 122, 123, 124, 125, 125, 126, - 127, 127, 128, 128, 129, 130, 131, 132, 133, 134, - 135, 136, 137, 138, 138, 138, 138, 138, 138, 138, - 138, 138, 138, 138, 138, 138, 138, 138, 139, 139, - 139, 139, 139, 139, 139, 139, 140, 140, 140, 140, - 140, 140, 140, 141, 141, 141, 141, 141, 142, 142, - 142, 143, 143, 143, 144, 145, 145, 145, 145, 145, - 145 -}; - -static const short yyr2[] = { 0, - 5, 0, 0, 3, 3, 4, 4, 3, 3, 3, - 3, 3, 0, 5, 0, 5, 0, 7, 1, 0, - 3, 4, 4, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 0, 2, 2, 2, 0, - 1, 5, 0, 0, 4, 4, 1, 1, 1, 3, - 0, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 4, 4, 4, - 6, 6, 4, 4, 4, 4, 4, 5, 4, 0, - 2, 4, 4, 4, 3, 3, 7, 0, 3, 0, - 3, 1, 3, 1, 9, 7, 1, 1, 1, 1, - 1, 1, 0, 2, 2, 4, 3, 2, 3, 3, - 3, 4, 2, 1, 2, 3, 1, 2, 0, 2, - 2, 2, 2, 2, 2, 5, 1, 1, 1, 1, - 1, 1, 4, 1, 1, 1, 1, 4, 1, 1, - 4, 1, 1, 4, 1, 1, 1, 1, 1, 1, - 1 -}; - -static const short yydefact[] = { 2, - 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 13, 3, 0, 0, 3, 3, 3, 3, 3, 3, - 120, 15, 4, 3, 3, 12, 9, 8, 10, 11, - 5, 0, 120, 17, 7, 6, 51, 0, 0, 1, - 133, 133, 133, 133, 133, 133, 133, 133, 133, 133, - 133, 133, 133, 133, 133, 110, 133, 133, 133, 133, - 133, 133, 0, 51, 19, 0, 51, 0, 51, 0, - 51, 0, 51, 0, 51, 0, 51, 0, 51, 0, - 51, 149, 51, 0, 51, 0, 51, 0, 51, 0, - 51, 0, 51, 0, 51, 0, 51, 51, 0, 51, - 0, 51, 0, 51, 120, 0, 51, 120, 0, 51, - 120, 0, 14, 0, 20, 64, 127, 130, 131, 132, - 133, 167, 166, 164, 165, 133, 61, 133, 60, 133, - 62, 133, 63, 133, 53, 111, 54, 128, 133, 169, - 170, 133, 52, 129, 133, 149, 149, 149, 149, 149, - 149, 95, 55, 96, 56, 97, 65, 133, 66, 133, - 57, 133, 58, 133, 59, 133, 69, 70, 133, 67, - 175, 0, 68, 133, 71, 0, 133, 157, 161, 160, - 162, 158, 159, 133, 72, 0, 0, 73, 0, 133, - 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 36, 40, 0, 0, 0, - 0, 0, 0, 0, 149, 0, 152, 154, 153, 155, - 150, 151, 0, 0, 0, 0, 0, 149, 133, 0, - 133, 133, 133, 133, 133, 133, 133, 51, 133, 133, - 133, 133, 133, 133, 133, 133, 110, 133, 133, 133, - 133, 133, 122, 118, 0, 0, 51, 124, 115, 133, - 116, 0, 20, 20, 20, 20, 20, 20, 0, 0, - 20, 20, 20, 20, 20, 20, 36, 36, 36, 20, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 144, 0, 0, 147, 0, 0, 105, 133, 133, - 133, 172, 173, 104, 103, 0, 113, 0, 106, 107, - 98, 99, 100, 112, 149, 109, 86, 83, 82, 84, - 85, 75, 76, 0, 74, 77, 78, 87, 88, 79, - 80, 81, 91, 92, 89, 90, 93, 94, 120, 114, - 0, 178, 177, 179, 176, 180, 181, 133, 0, 0, - 133, 34, 31, 30, 32, 33, 21, 20, 20, 24, - 25, 26, 27, 28, 29, 37, 39, 38, 35, 43, - 41, 17, 134, 0, 0, 0, 135, 0, 0, 0, - 138, 143, 145, 0, 148, 168, 0, 0, 0, 171, - 149, 108, 121, 0, 163, 0, 123, 0, 0, 22, - 23, 0, 18, 139, 141, 140, 0, 0, 137, 146, - 102, 101, 0, 156, 119, 0, 133, 0, 44, 136, - 142, 174, 117, 0, 126, 49, 47, 48, 0, 0, - 0, 0, 42, 0, 0, 125, 51, 44, 44, 0, - 45, 46, 50, 0, 0, 0 -}; - -static const short yydefgoto[] = { 444, - 1, 11, 22, 34, 40, 66, 207, 280, 281, 372, - 402, 429, 430, 431, 438, 63, 258, 81, 83, 85, - 91, 93, 95, 71, 69, 75, 73, 67, 87, 89, - 100, 102, 97, 77, 98, 79, 104, 107, 110, 105, - 340, 32, 254, 259, 108, 111, 122, 147, 148, 123, - 124, 125, 68, 297, 152, 184, 126, 142, 304, 172, - 348 -}; - -static const short yypact[] = {-32768, - 555, 37, 29, 39, 25, 45, 47, 51, 53, 40, - 43, 555, 55, 57, 555, 555, 555, 555, 555, 555, --32768, 49,-32768, 555, 555,-32768,-32768,-32768,-32768,-32768, --32768, 36,-32768, 61,-32768,-32768, 465, 46, 62,-32768, --32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, --32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, --32768,-32768, 68, 465,-32768, 50, 465, 139, 465, 139, - 465, 139, 465, 139, 465, 139, 465, 139, 465, 19, - 465, 77, 465, 139, 465, 139, 465, 139, 465, 139, - 465, 139, 465, 139, 465, 139, 465, 465, 139, 465, - 84, 465, 139, 465,-32768, 262, 465,-32768, 84, 465, --32768, 262,-32768, 72, 616,-32768,-32768,-32768,-32768,-32768, --32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, --32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, --32768,-32768,-32768,-32768,-32768, 77, 77, 77, 77, 77, - 77,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, --32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, --32768, 30,-32768,-32768,-32768, 560,-32768,-32768,-32768,-32768, --32768,-32768,-32768,-32768,-32768, 663, 33,-32768, 663,-32768, --32768, 91, 97, 108, 109, 115, 118, 120, 122, 125, - 128, 134, 142, 145, 149, 76,-32768, 492, 19, 139, - 139, 22, 19, 492, 77, 492,-32768,-32768,-32768,-32768, --32768,-32768, 22, 22, 139, 139, 139, 77,-32768, 139, --32768,-32768,-32768,-32768,-32768,-32768,-32768, 465,-32768,-32768, --32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, --32768,-32768,-32768, 80, 492, 148, 465,-32768,-32768,-32768, --32768, 148, 616, 616, 616, 616, 616, 616, 156, 163, - 616, 616, 616, 616, 616, 616, 76, 76, 76, 616, - 14, 139, 139, 139, 139, 139, 22, 22, 139, 22, - 22,-32768, 139, 139,-32768, 139, 78,-32768,-32768,-32768, --32768,-32768,-32768,-32768,-32768, 111,-32768, 112,-32768,-32768, --32768,-32768,-32768,-32768, 77,-32768,-32768,-32768,-32768,-32768, --32768,-32768,-32768, 177,-32768,-32768,-32768,-32768,-32768,-32768, --32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, - 136,-32768,-32768,-32768,-32768,-32768,-32768,-32768, 195, 262, --32768,-32768,-32768,-32768,-32768,-32768,-32768, 616, 616,-32768, --32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, --32768, 61,-32768, 139, 139, 139,-32768, 139, 139, 139, --32768,-32768,-32768, 139,-32768,-32768, 139, 139, 492,-32768, - 77,-32768,-32768, 663,-32768, 262,-32768, 143, 262,-32768, --32768, 181,-32768,-32768,-32768,-32768, 139, 139,-32768,-32768, --32768,-32768, 146,-32768,-32768, 150,-32768, 160, 101,-32768, --32768,-32768,-32768, 262,-32768,-32768,-32768,-32768, 221, 202, - 204, 172,-32768, 210, 210,-32768, 465, 101, 101, 232, --32768,-32768,-32768, 253, 256,-32768 -}; - -static const short yypgoto[] = {-32768, --32768, 278,-32768,-32768, -112,-32768, 197, -99,-32768,-32768, --32768, -366,-32768,-32768, -173, -33, 88, 32, 34, 28, - 26, 27, 38, 48, 41, 52, 58, 70, 63, 65, - 64, 54, 69, 81, 75, 83,-32768, 73, 74,-32768, --32768, -3,-32768, -175,-32768,-32768, 24, -59, 31, 17, - 35, 129, -42, -177, 10, -89, 292, -184, -2, 173, - 21 -}; - - -#define YYLAST 738 - - -static const short yytable[] = { 70, - 72, 74, 76, 78, 80, 82, 84, 86, 88, 90, - 92, 94, 96, 261, 99, 101, 103, 106, 109, 112, - 141, 138, 190, 117, 298, 144, 117, 15, 305, 38, - 114, 370, 371, 116, 13, 127, 306, 129, 308, 131, - 12, 133, 20, 135, 14, 137, 179, 143, 16, 153, - 17, 155, 179, 157, 18, 159, 19, 161, 21, 163, - 24, 165, 25, 167, 168, 33, 170, 65, 173, 115, - 175, 441, 442, 185, 37, 39, 188, 341, 208, 138, - 144, 117, 118, 209, 64, 210, 113, 211, 117, 212, - 191, 213, 229, 263, 139, 260, 214, 301, 149, 215, - 264, 176, 216, 140, 186, 146, 426, 189, 277, 278, - 279, 265, 266, 119, 120, 223, 150, 224, 267, 225, - 268, 226, 181, 227, 171, 269, 228, 270, 181, 178, - 271, 230, 171, 272, 255, 178, 180, 427, 428, 273, - 182, 256, 180, 117, 118, 274, 182, 262, 275, 141, - 339, 276, 145, 141, 386, 217, 218, 219, 220, 221, - 222, 358, 149, 149, 149, 149, 149, 149, 359, 146, - 146, 146, 146, 146, 146, 119, 120, 366, 367, 368, - 150, 150, 150, 150, 150, 150, 315, 390, 391, 70, - 72, 74, 76, 78, 80, 393, 82, 84, 86, 88, - 90, 92, 94, 96, 324, 99, 101, 103, 109, 112, - 151, 413, 395, 397, 121, 417, 419, 350, 415, 423, - 309, 310, 422, 349, 307, 342, 343, 344, 345, 346, - 347, 149, 140, 425, 183, 302, 140, 314, 146, 433, - 183, 434, 303, 435, 149, 436, 302, 302, 437, 150, - 443, 146, 445, 303, 303, 446, 387, 388, 389, 403, - 398, 439, 150, 253, 138, 144, 117, 118, 327, 330, - 325, 331, 318, 326, 151, 151, 151, 151, 151, 151, - 319, 187, 351, 332, 378, 379, 321, 381, 382, 23, - 179, 320, 26, 27, 28, 29, 30, 31, 119, 120, - 317, 35, 36, 336, 328, 396, 416, 329, 399, 418, - 302, 302, 335, 302, 302, 333, 322, 303, 303, 323, - 303, 303, 334, 337, 392, 338, 0, 0, 0, 0, - 0, 149, 0, 0, 432, 394, 179, 177, 146, 179, - 0, 0, 0, 151, 0, 0, 0, 0, 0, 150, - 0, 0, 0, 0, 0, 0, 151, 0, 0, 0, - 0, 128, 0, 130, 179, 132, 181, 134, 0, 136, - 0, 0, 0, 178, 424, 154, 0, 156, 0, 158, - 180, 160, 0, 162, 182, 164, 0, 166, 0, 0, - 169, 0, 0, 0, 174, 0, 0, 0, 0, 0, - 414, 0, 0, 440, 0, 0, 0, 149, 0, 0, - 0, 0, 181, 0, 146, 181, 0, 0, 0, 178, - 0, 0, 178, 0, 0, 150, 180, 0, 0, 180, - 182, 0, 0, 182, 0, 0, 0, 0, 0, 0, - 181, 0, 0, 151, 0, 0, 0, 178, 0, 0, - 0, 0, 0, 0, 180, 0, 0, 0, 182, 352, - 353, 354, 355, 356, 357, 0, 0, 360, 361, 362, - 363, 364, 365, 0, 41, 0, 369, 0, 183, 0, - 0, 0, 0, 0, 0, 0, 42, 43, 0, 0, - 0, 44, 0, 45, 0, 46, 47, 0, 0, 0, - 0, 299, 300, 0, 0, 48, 49, 50, 51, 52, - 0, 53, 54, 55, 0, 0, 311, 312, 313, 151, - 0, 316, 56, 0, 183, 57, 0, 183, 58, 59, - 0, 0, 0, 60, 0, 0, 61, 282, 0, 62, - 0, 283, 284, 285, 286, 287, 288, 289, 290, 0, - 291, 292, 183, 293, 400, 401, 0, 294, 295, 296, - 0, 2, 3, 4, 5, 6, 7, 8, 9, 231, - 0, 0, 0, 373, 374, 375, 376, 377, 0, 0, - 380, 232, 233, 10, 383, 384, 234, 385, 235, 0, - 236, 237, 0, 0, 0, 0, 0, 0, 238, 0, - 239, 240, 241, 242, 243, 0, 244, 245, 246, 0, - 0, 0, 0, 0, 0, 0, 0, 247, 0, 0, - 248, 0, 0, 249, 250, 192, 193, 194, 195, 196, - 0, 251, 0, 0, 252, 0, 197, 198, 199, 200, - 201, 202, 203, 204, 205, 206, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 404, 405, 406, 0, 407, - 408, 409, 231, 0, 0, 410, 0, 0, 411, 412, - 0, 0, 0, 0, 232, 233, 0, 0, 0, 234, - 0, 235, 0, 236, 237, 0, 0, 0, 420, 421, - 0, 257, 0, 239, 240, 241, 242, 243, 0, 244, - 245, 246, 0, 0, 0, 0, 0, 0, 0, 0, - 247, 0, 0, 248, 0, 0, 249, 250, 0, 0, - 0, 0, 0, 0, 251, 0, 0, 252 -}; - -static const short yycheck[] = { 42, - 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, - 53, 54, 55, 189, 57, 58, 59, 60, 61, 62, - 80, 3, 112, 5, 209, 4, 5, 3, 213, 33, - 64, 18, 19, 67, 6, 69, 214, 71, 216, 73, - 4, 75, 3, 77, 6, 79, 106, 81, 4, 83, - 4, 85, 112, 87, 4, 89, 4, 91, 16, 93, - 6, 95, 6, 97, 98, 17, 100, 6, 102, 20, - 104, 438, 439, 107, 39, 15, 110, 255, 121, 3, - 4, 5, 6, 126, 39, 128, 19, 130, 5, 132, - 19, 134, 63, 3, 76, 63, 139, 76, 82, 142, - 4, 105, 145, 80, 108, 82, 6, 111, 33, 34, - 35, 4, 4, 37, 38, 158, 82, 160, 4, 162, - 3, 164, 106, 166, 101, 6, 169, 6, 112, 106, - 6, 174, 109, 6, 177, 112, 106, 37, 38, 6, - 106, 184, 112, 5, 6, 4, 112, 190, 4, 209, - 71, 3, 76, 213, 77, 146, 147, 148, 149, 150, - 151, 6, 146, 147, 148, 149, 150, 151, 6, 146, - 147, 148, 149, 150, 151, 37, 38, 277, 278, 279, - 146, 147, 148, 149, 150, 151, 229, 77, 77, 232, - 233, 234, 235, 236, 237, 19, 239, 240, 241, 242, - 243, 244, 245, 246, 238, 248, 249, 250, 251, 252, - 82, 389, 77, 19, 76, 73, 36, 260, 394, 70, - 223, 224, 77, 257, 215, 78, 79, 80, 81, 82, - 83, 215, 209, 74, 106, 212, 213, 228, 215, 19, - 112, 40, 212, 40, 228, 74, 223, 224, 39, 215, - 19, 228, 0, 223, 224, 0, 299, 300, 301, 372, - 350, 435, 228, 176, 3, 4, 5, 6, 241, 244, - 239, 245, 232, 240, 146, 147, 148, 149, 150, 151, - 233, 109, 262, 246, 287, 288, 235, 290, 291, 12, - 350, 234, 15, 16, 17, 18, 19, 20, 37, 38, - 231, 24, 25, 250, 242, 348, 396, 243, 351, 399, - 287, 288, 249, 290, 291, 247, 236, 287, 288, 237, - 290, 291, 248, 251, 315, 252, -1, -1, -1, -1, - -1, 315, -1, -1, 424, 339, 396, 76, 315, 399, - -1, -1, -1, 215, -1, -1, -1, -1, -1, 315, - -1, -1, -1, -1, -1, -1, 228, -1, -1, -1, - -1, 70, -1, 72, 424, 74, 350, 76, -1, 78, - -1, -1, -1, 350, 417, 84, -1, 86, -1, 88, - 350, 90, -1, 92, 350, 94, -1, 96, -1, -1, - 99, -1, -1, -1, 103, -1, -1, -1, -1, -1, - 391, -1, -1, 437, -1, -1, -1, 391, -1, -1, - -1, -1, 396, -1, 391, 399, -1, -1, -1, 396, - -1, -1, 399, -1, -1, 391, 396, -1, -1, 399, - 396, -1, -1, 399, -1, -1, -1, -1, -1, -1, - 424, -1, -1, 315, -1, -1, -1, 424, -1, -1, - -1, -1, -1, -1, 424, -1, -1, -1, 424, 263, - 264, 265, 266, 267, 268, -1, -1, 271, 272, 273, - 274, 275, 276, -1, 10, -1, 280, -1, 350, -1, - -1, -1, -1, -1, -1, -1, 22, 23, -1, -1, - -1, 27, -1, 29, -1, 31, 32, -1, -1, -1, - -1, 210, 211, -1, -1, 41, 42, 43, 44, 45, - -1, 47, 48, 49, -1, -1, 225, 226, 227, 391, - -1, 230, 58, -1, 396, 61, -1, 399, 64, 65, - -1, -1, -1, 69, -1, -1, 72, 46, -1, 75, - -1, 50, 51, 52, 53, 54, 55, 56, 57, -1, - 59, 60, 424, 62, 358, 359, -1, 66, 67, 68, - -1, 7, 8, 9, 10, 11, 12, 13, 14, 10, - -1, -1, -1, 282, 283, 284, 285, 286, -1, -1, - 289, 22, 23, 29, 293, 294, 27, 296, 29, -1, - 31, 32, -1, -1, -1, -1, -1, -1, 39, -1, - 41, 42, 43, 44, 45, -1, 47, 48, 49, -1, - -1, -1, -1, -1, -1, -1, -1, 58, -1, -1, - 61, -1, -1, 64, 65, 10, 11, 12, 13, 14, - -1, 72, -1, -1, 75, -1, 21, 22, 23, 24, - 25, 26, 27, 28, 29, 30, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 374, 375, 376, -1, 378, - 379, 380, 10, -1, -1, 384, -1, -1, 387, 388, - -1, -1, -1, -1, 22, 23, -1, -1, -1, 27, - -1, 29, -1, 31, 32, -1, -1, -1, 407, 408, - -1, 39, -1, 41, 42, 43, 44, 45, -1, 47, - 48, 49, -1, -1, -1, -1, -1, -1, -1, -1, - 58, -1, -1, 61, -1, -1, 64, 65, -1, -1, - -1, -1, -1, -1, 72, -1, -1, 75 -}; -/* -*-C-*- Note some compilers choke on comments on `#line' lines. */ -#line 3 "/usr/share/bison.simple" - -/* Skeleton output parser for bison, - Copyright (C) 1984, 1989, 1990 Free Software Foundation, Inc. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ - -/* As a special exception, when this file is copied by Bison into a - Bison output file, you may use that output file without restriction. - This special exception was added by the Free Software Foundation - in version 1.24 of Bison. */ - -#ifndef alloca -#ifdef __GNUC__ -#define alloca __builtin_alloca -#else /* not GNU C. */ -#if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) || defined (__sparc) || defined (__sgi) -#include <alloca.h> -#else /* not sparc */ -#if defined (MSDOS) && !defined (__TURBOC__) -#include <malloc.h> -#else /* not MSDOS, or __TURBOC__ */ -#if defined(_AIX) -#include <malloc.h> - #pragma alloca -#else /* not MSDOS, __TURBOC__, or _AIX */ -#ifdef __hpux -#ifdef __cplusplus -extern "C" { -void *alloca (unsigned int); -}; -#else /* not __cplusplus */ -void *alloca (); -#endif /* not __cplusplus */ -#endif /* __hpux */ -#endif /* not _AIX */ -#endif /* not MSDOS, or __TURBOC__ */ -#endif /* not sparc. */ -#endif /* not GNU C. */ -#endif /* alloca not defined. */ - -/* This is the parser code that is written into each bison parser - when the %semantic_parser declaration is not specified in the grammar. - It was written by Richard Stallman by simplifying the hairy parser - used when %semantic_parser is specified. */ - -/* Note: there must be only one dollar sign in this file. - It is replaced by the list of actions, each action - as one case of the switch. */ - -#define yyerrok (yyerrstatus = 0) -#define yyclearin (yychar = YYEMPTY) -#define YYEMPTY -2 -#define YYEOF 0 -#define YYACCEPT return(0) -#define YYABORT return(1) -#define YYERROR goto yyerrlab1 -/* Like YYERROR except do call yyerror. - This remains here temporarily to ease the - transition to the new meaning of YYERROR, for GCC. - Once GCC version 2 has supplanted version 1, this can go. */ -#define YYFAIL goto yyerrlab -#define YYRECOVERING() (!!yyerrstatus) -#define YYBACKUP(token, value) \ -do \ - if (yychar == YYEMPTY && yylen == 1) \ - { yychar = (token), yylval = (value); \ - yychar1 = YYTRANSLATE (yychar); \ - YYPOPSTACK; \ - goto yybackup; \ - } \ - else \ - { yyerror ("syntax error: cannot back up"); YYERROR; } \ -while (0) - -#define YYTERROR 1 -#define YYERRCODE 256 - -#ifndef YYPURE -#define YYLEX yylex() -#endif - -#ifdef YYPURE -#ifdef YYLSP_NEEDED -#ifdef YYLEX_PARAM -#define YYLEX yylex(&yylval, &yylloc, YYLEX_PARAM) -#else -#define YYLEX yylex(&yylval, &yylloc) -#endif -#else /* not YYLSP_NEEDED */ -#ifdef YYLEX_PARAM -#define YYLEX yylex(&yylval, YYLEX_PARAM) -#else -#define YYLEX yylex(&yylval) -#endif -#endif /* not YYLSP_NEEDED */ -#endif - -/* If nonreentrant, generate the variables here */ - -#ifndef YYPURE - -int yychar; /* the lookahead symbol */ -YYSTYPE yylval; /* the semantic value of the */ - /* lookahead symbol */ - -#ifdef YYLSP_NEEDED -YYLTYPE yylloc; /* location data for the lookahead */ - /* symbol */ -#endif - -int yynerrs; /* number of parse errors so far */ -#endif /* not YYPURE */ - -#if YYDEBUG != 0 -int yydebug; /* nonzero means print parse trace */ -/* Since this is uninitialized, it does not stop multiple parsers - from coexisting. */ -#endif - -/* YYINITDEPTH indicates the initial size of the parser's stacks */ - -#ifndef YYINITDEPTH -#define YYINITDEPTH 200 -#endif - -/* YYMAXDEPTH is the maximum size the stacks can grow to - (effective only if the built-in stack extension method is used). */ - -#if YYMAXDEPTH == 0 -#undef YYMAXDEPTH -#endif - -#ifndef YYMAXDEPTH -#define YYMAXDEPTH 10000 -#endif - -/* Prevent warning if -Wstrict-prototypes. */ -#ifdef __GNUC__ -int yyparse (void); -#endif - -#if __GNUC__ > 1 /* GNU C and GNU C++ define this. */ -#define __yy_memcpy(TO,FROM,COUNT) __builtin_memcpy(TO,FROM,COUNT) -#else /* not GNU C or C++ */ -#ifndef __cplusplus - -/* This is the most reliable way to avoid incompatibilities - in available built-in functions on various systems. */ -static void -__yy_memcpy (to, from, count) - char *to; - char *from; - int count; -{ - register char *f = from; - register char *t = to; - register int i = count; - - while (i-- > 0) - *t++ = *f++; -} - -#else /* __cplusplus */ - -/* This is the most reliable way to avoid incompatibilities - in available built-in functions on various systems. */ -static void -__yy_memcpy (char *to, char *from, int count) -{ - register char *f = from; - register char *t = to; - register int i = count; - - while (i-- > 0) - *t++ = *f++; -} - -#endif -#endif - -#line 196 "/usr/share/bison.simple" - -/* The user can define YYPARSE_PARAM as the name of an argument to be passed - into yyparse. The argument should have type void *. - It should actually point to an object. - Grammar actions can access the variable by casting it - to the proper pointer type. */ - -#ifdef YYPARSE_PARAM -#ifdef __cplusplus -#define YYPARSE_PARAM_ARG void *YYPARSE_PARAM -#define YYPARSE_PARAM_DECL -#else /* not __cplusplus */ -#define YYPARSE_PARAM_ARG YYPARSE_PARAM -#define YYPARSE_PARAM_DECL void *YYPARSE_PARAM; -#endif /* not __cplusplus */ -#else /* not YYPARSE_PARAM */ -#define YYPARSE_PARAM_ARG -#define YYPARSE_PARAM_DECL -#endif /* not YYPARSE_PARAM */ - -int -yyparse(YYPARSE_PARAM_ARG) - YYPARSE_PARAM_DECL -{ - register int yystate; - register int yyn; - register short *yyssp; - register YYSTYPE *yyvsp; - int yyerrstatus; /* number of tokens to shift before error messages enabled */ - int yychar1 = 0; /* lookahead token as an internal (translated) token number */ - - short yyssa[YYINITDEPTH]; /* the state stack */ - YYSTYPE yyvsa[YYINITDEPTH]; /* the semantic value stack */ - - short *yyss = yyssa; /* refer to the stacks thru separate pointers */ - YYSTYPE *yyvs = yyvsa; /* to allow yyoverflow to reallocate them elsewhere */ - -#ifdef YYLSP_NEEDED - YYLTYPE yylsa[YYINITDEPTH]; /* the location stack */ - YYLTYPE *yyls = yylsa; - YYLTYPE *yylsp; - -#define YYPOPSTACK (yyvsp--, yyssp--, yylsp--) -#else -#define YYPOPSTACK (yyvsp--, yyssp--) -#endif - - int yystacksize = YYINITDEPTH; - -#ifdef YYPURE - int yychar; - YYSTYPE yylval; - int yynerrs; -#ifdef YYLSP_NEEDED - YYLTYPE yylloc; -#endif -#endif - - YYSTYPE yyval; /* the variable used to return */ - /* semantic values from the action */ - /* routines */ - - int yylen; - -#if YYDEBUG != 0 - if (yydebug) - fprintf(stderr, "Starting parse\n"); -#endif - - yystate = 0; - yyerrstatus = 0; - yynerrs = 0; - yychar = YYEMPTY; /* Cause a token to be read. */ - - /* Initialize stack pointers. - Waste one element of value and location stack - so that they stay on the same level as the state stack. - The wasted elements are never initialized. */ - - yyssp = yyss - 1; - yyvsp = yyvs; -#ifdef YYLSP_NEEDED - yylsp = yyls; -#endif - -/* Push a new state, which is found in yystate . */ -/* In all cases, when you get here, the value and location stacks - have just been pushed. so pushing a state here evens the stacks. */ -yynewstate: - - *++yyssp = yystate; - - if (yyssp >= yyss + yystacksize - 1) - { - /* Give user a chance to reallocate the stack */ - /* Use copies of these so that the &'s don't force the real ones into memory. */ - YYSTYPE *yyvs1 = yyvs; - short *yyss1 = yyss; -#ifdef YYLSP_NEEDED - YYLTYPE *yyls1 = yyls; -#endif - - /* Get the current used size of the three stacks, in elements. */ - int size = yyssp - yyss + 1; - -#ifdef yyoverflow - /* Each stack pointer address is followed by the size of - the data in use in that stack, in bytes. */ -#ifdef YYLSP_NEEDED - /* This used to be a conditional around just the two extra args, - but that might be undefined if yyoverflow is a macro. */ - yyoverflow("parser stack overflow", - &yyss1, size * sizeof (*yyssp), - &yyvs1, size * sizeof (*yyvsp), - &yyls1, size * sizeof (*yylsp), - &yystacksize); -#else - yyoverflow("parser stack overflow", - &yyss1, size * sizeof (*yyssp), - &yyvs1, size * sizeof (*yyvsp), - &yystacksize); -#endif - - yyss = yyss1; yyvs = yyvs1; -#ifdef YYLSP_NEEDED - yyls = yyls1; -#endif -#else /* no yyoverflow */ - /* Extend the stack our own way. */ - if (yystacksize >= YYMAXDEPTH) - { - yyerror("parser stack overflow"); - return 2; - } - yystacksize *= 2; - if (yystacksize > YYMAXDEPTH) - yystacksize = YYMAXDEPTH; - yyss = (short *) alloca (yystacksize * sizeof (*yyssp)); - __yy_memcpy ((char *)yyss, (char *)yyss1, size * sizeof (*yyssp)); - yyvs = (YYSTYPE *) alloca (yystacksize * sizeof (*yyvsp)); - __yy_memcpy ((char *)yyvs, (char *)yyvs1, size * sizeof (*yyvsp)); -#ifdef YYLSP_NEEDED - yyls = (YYLTYPE *) alloca (yystacksize * sizeof (*yylsp)); - __yy_memcpy ((char *)yyls, (char *)yyls1, size * sizeof (*yylsp)); -#endif -#endif /* no yyoverflow */ - - yyssp = yyss + size - 1; - yyvsp = yyvs + size - 1; -#ifdef YYLSP_NEEDED - yylsp = yyls + size - 1; -#endif - -#if YYDEBUG != 0 - if (yydebug) - fprintf(stderr, "Stack size increased to %d\n", yystacksize); -#endif - - if (yyssp >= yyss + yystacksize - 1) - YYABORT; - } - -#if YYDEBUG != 0 - if (yydebug) - fprintf(stderr, "Entering state %d\n", yystate); -#endif - - goto yybackup; - yybackup: - -/* Do appropriate processing given the current state. */ -/* Read a lookahead token if we need one and don't already have one. */ -/* yyresume: */ - - /* First try to decide what to do without reference to lookahead token. */ - - yyn = yypact[yystate]; - if (yyn == YYFLAG) - goto yydefault; - - /* Not known => get a lookahead token if don't already have one. */ - - /* yychar is either YYEMPTY or YYEOF - or a valid token in external form. */ - - if (yychar == YYEMPTY) - { -#if YYDEBUG != 0 - if (yydebug) - fprintf(stderr, "Reading a token: "); -#endif - yychar = YYLEX; - } - - /* Convert token to internal form (in yychar1) for indexing tables with */ - - if (yychar <= 0) /* This means end of input. */ - { - yychar1 = 0; - yychar = YYEOF; /* Don't call YYLEX any more */ - -#if YYDEBUG != 0 - if (yydebug) - fprintf(stderr, "Now at end of input.\n"); -#endif - } - else - { - yychar1 = YYTRANSLATE(yychar); - -#if YYDEBUG != 0 - if (yydebug) - { - fprintf (stderr, "Next token is %d (%s", yychar, yytname[yychar1]); - /* Give the individual parser a way to print the precise meaning - of a token, for further debugging info. */ -#ifdef YYPRINT - YYPRINT (stderr, yychar, yylval); -#endif - fprintf (stderr, ")\n"); - } -#endif - } - - yyn += yychar1; - if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1) - goto yydefault; - - yyn = yytable[yyn]; - - /* yyn is what to do for this token type in this state. - Negative => reduce, -yyn is rule number. - Positive => shift, yyn is new state. - New state is final state => don't bother to shift, - just return success. - 0, or most negative number => error. */ - - if (yyn < 0) - { - if (yyn == YYFLAG) - goto yyerrlab; - yyn = -yyn; - goto yyreduce; - } - else if (yyn == 0) - goto yyerrlab; - - if (yyn == YYFINAL) - YYACCEPT; - - /* Shift the lookahead token. */ - -#if YYDEBUG != 0 - if (yydebug) - fprintf(stderr, "Shifting token %d (%s), ", yychar, yytname[yychar1]); -#endif - - /* Discard the token being shifted unless it is eof. */ - if (yychar != YYEOF) - yychar = YYEMPTY; - - *++yyvsp = yylval; -#ifdef YYLSP_NEEDED - *++yylsp = yylloc; -#endif - - /* count tokens shifted since error; after three, turn off error status. */ - if (yyerrstatus) yyerrstatus--; - - yystate = yyn; - goto yynewstate; - -/* Do the default action for the current state. */ -yydefault: - - yyn = yydefact[yystate]; - if (yyn == 0) - goto yyerrlab; - -/* Do a reduction. yyn is the number of a rule to reduce with. */ -yyreduce: - yylen = yyr2[yyn]; - if (yylen > 0) - yyval = yyvsp[1-yylen]; /* implement default value of the action */ - -#if YYDEBUG != 0 - if (yydebug) - { - int i; - - fprintf (stderr, "Reducing via rule %d (line %d), ", - yyn, yyrline[yyn]); - - /* Print the symbols being reduced, and their result. */ - for (i = yyprhs[yyn]; yyrhs[i] > 0; i++) - fprintf (stderr, "%s ", yytname[yyrhs[i]]); - fprintf (stderr, " -> %s\n", yytname[yyr1[yyn]]); - } -#endif - - - switch (yyn) { - -case 2: -#line 372 "../../../extras/FvwmScript/script.y" -{ InitVarGlob(); ; - break;} -case 4: -#line 377 "../../../extras/FvwmScript/script.y" -{ /* Titre de la fenetre */ - scriptprop->titlewin=yyvsp[-1].str; - ; - break;} -case 5: -#line 380 "../../../extras/FvwmScript/script.y" -{ - scriptprop->icon=yyvsp[-1].str; - ; - break;} -case 6: -#line 384 "../../../extras/FvwmScript/script.y" -{ /* Position et taille de la fenetre */ - scriptprop->x=yyvsp[-2].number; - scriptprop->y=yyvsp[-1].number; - ; - break;} -case 7: -#line 389 "../../../extras/FvwmScript/script.y" -{ /* Position et taille de la fenetre */ - scriptprop->width=yyvsp[-2].number; - scriptprop->height=yyvsp[-1].number; - ; - break;} -case 8: -#line 393 "../../../extras/FvwmScript/script.y" -{ /* Couleur de fond */ - scriptprop->backcolor=yyvsp[-1].str; - ; - break;} -case 9: -#line 396 "../../../extras/FvwmScript/script.y" -{ /* Couleur des lignes */ - scriptprop->forecolor=yyvsp[-1].str; - ; - break;} -case 10: -#line 399 "../../../extras/FvwmScript/script.y" -{ /* Couleur des lignes */ - scriptprop->shadcolor=yyvsp[-1].str; - ; - break;} -case 11: -#line 402 "../../../extras/FvwmScript/script.y" -{ /* Couleur des lignes */ - scriptprop->licolor=yyvsp[-1].str; - ; - break;} -case 12: -#line 405 "../../../extras/FvwmScript/script.y" -{ - scriptprop->font=yyvsp[-1].str; - ; - break;} -case 14: -#line 412 "../../../extras/FvwmScript/script.y" -{ - scriptprop->initbloc=PileBloc[TopPileB]; - TopPileB--; - ; - break;} -case 16: -#line 418 "../../../extras/FvwmScript/script.y" -{ - scriptprop->periodictasks=PileBloc[TopPileB]; - TopPileB--; - ; - break;} -case 19: -#line 431 "../../../extras/FvwmScript/script.y" -{ nbobj++; - if (nbobj>100) - { yyerror("Too many items\n"); - exit(1);} - if ((yyvsp[0].number<1)||(yyvsp[0].number>100)) - { yyerror("Choose item id between 1 and 100\n"); - exit(1);} - if (TabIdObj[yyvsp[0].number]!=-1) - { i=yyvsp[0].number; fprintf(stderr,"Line %d: item id %d already used:\n",numligne,yyvsp[0].number); - exit(1);} - TabIdObj[yyvsp[0].number]=nbobj; - (*tabobj)[nbobj].id=yyvsp[0].number; - ; - break;} -case 21: -#line 447 "../../../extras/FvwmScript/script.y" -{ - (*tabobj)[nbobj].type=yyvsp[-1].str; - HasType=1; - ; - break;} -case 22: -#line 451 "../../../extras/FvwmScript/script.y" -{ - (*tabobj)[nbobj].width=yyvsp[-2].number; - (*tabobj)[nbobj].height=yyvsp[-1].number; - ; - break;} -case 23: -#line 455 "../../../extras/FvwmScript/script.y" -{ - (*tabobj)[nbobj].x=yyvsp[-2].number; - (*tabobj)[nbobj].y=yyvsp[-1].number; - HasPosition=1; - ; - break;} -case 24: -#line 460 "../../../extras/FvwmScript/script.y" -{ - (*tabobj)[nbobj].value=yyvsp[-1].number; - ; - break;} -case 25: -#line 463 "../../../extras/FvwmScript/script.y" -{ - (*tabobj)[nbobj].value2=yyvsp[-1].number; - ; - break;} -case 26: -#line 466 "../../../extras/FvwmScript/script.y" -{ - (*tabobj)[nbobj].value3=yyvsp[-1].number; - ; - break;} -case 27: -#line 469 "../../../extras/FvwmScript/script.y" -{ - (*tabobj)[nbobj].title=yyvsp[-1].str; - ; - break;} -case 28: -#line 472 "../../../extras/FvwmScript/script.y" -{ - (*tabobj)[nbobj].swallow=yyvsp[-1].str; - ; - break;} -case 29: -#line 475 "../../../extras/FvwmScript/script.y" -{ - (*tabobj)[nbobj].icon=yyvsp[-1].str; - ; - break;} -case 30: -#line 478 "../../../extras/FvwmScript/script.y" -{ - (*tabobj)[nbobj].backcolor=yyvsp[-1].str; - ; - break;} -case 31: -#line 481 "../../../extras/FvwmScript/script.y" -{ - (*tabobj)[nbobj].forecolor=yyvsp[-1].str; - ; - break;} -case 32: -#line 484 "../../../extras/FvwmScript/script.y" -{ - (*tabobj)[nbobj].shadcolor=yyvsp[-1].str; - ; - break;} -case 33: -#line 487 "../../../extras/FvwmScript/script.y" -{ - (*tabobj)[nbobj].licolor=yyvsp[-1].str; - ; - break;} -case 34: -#line 490 "../../../extras/FvwmScript/script.y" -{ - (*tabobj)[nbobj].font=yyvsp[-1].str; - ; - break;} -case 37: -#line 496 "../../../extras/FvwmScript/script.y" -{ - (*tabobj)[nbobj].flags[0]=True; - ; - break;} -case 38: -#line 499 "../../../extras/FvwmScript/script.y" -{ - (*tabobj)[nbobj].flags[1]=True; - ; - break;} -case 39: -#line 502 "../../../extras/FvwmScript/script.y" -{ - (*tabobj)[nbobj].flags[2]=True; - ; - break;} -case 40: -#line 508 "../../../extras/FvwmScript/script.y" -{ - if (!HasPosition) - { yyerror("No position for object"); - exit(1);} - if (!HasType) - { yyerror("No type for object"); - exit(1);} - HasPosition=0; - HasType=0; - ; - break;} -case 41: -#line 519 "../../../extras/FvwmScript/script.y" -{ InitObjTabCase(0); ; - break;} -case 43: -#line 523 "../../../extras/FvwmScript/script.y" -{ InitObjTabCase(1); ; - break;} -case 47: -#line 530 "../../../extras/FvwmScript/script.y" -{ InitCase(-1); ; - break;} -case 48: -#line 531 "../../../extras/FvwmScript/script.y" -{ InitCase(-2); ; - break;} -case 49: -#line 534 "../../../extras/FvwmScript/script.y" -{ InitCase(yyvsp[0].number); ; - break;} -case 95: -#line 591 "../../../extras/FvwmScript/script.y" -{ AddCom(1,1); ; - break;} -case 96: -#line 593 "../../../extras/FvwmScript/script.y" -{ AddCom(2,1);; - break;} -case 97: -#line 595 "../../../extras/FvwmScript/script.y" -{ AddCom(3,1);; - break;} -case 98: -#line 597 "../../../extras/FvwmScript/script.y" -{ AddCom(4,2);; - break;} -case 99: -#line 599 "../../../extras/FvwmScript/script.y" -{ AddCom(21,2);; - break;} -case 100: -#line 601 "../../../extras/FvwmScript/script.y" -{ AddCom(22,2);; - break;} -case 101: -#line 603 "../../../extras/FvwmScript/script.y" -{ AddCom(5,3);; - break;} -case 102: -#line 605 "../../../extras/FvwmScript/script.y" -{ AddCom(6,3);; - break;} -case 103: -#line 607 "../../../extras/FvwmScript/script.y" -{ AddCom(7,2);; - break;} -case 104: -#line 609 "../../../extras/FvwmScript/script.y" -{ AddCom(8,2);; - break;} -case 105: -#line 611 "../../../extras/FvwmScript/script.y" -{ AddCom(9,2);; - break;} -case 106: -#line 613 "../../../extras/FvwmScript/script.y" -{ AddCom(10,2);; - break;} -case 107: -#line 615 "../../../extras/FvwmScript/script.y" -{ AddCom(19,2);; - break;} -case 108: -#line 617 "../../../extras/FvwmScript/script.y" -{ AddCom(11,2);; - break;} -case 109: -#line 619 "../../../extras/FvwmScript/script.y" -{ AddCom(12,2);; - break;} -case 110: -#line 621 "../../../extras/FvwmScript/script.y" -{ AddCom(13,0);; - break;} -case 111: -#line 623 "../../../extras/FvwmScript/script.y" -{ AddCom(17,1);; - break;} -case 112: -#line 625 "../../../extras/FvwmScript/script.y" -{ AddCom(23,2);; - break;} -case 113: -#line 627 "../../../extras/FvwmScript/script.y" -{ AddCom(18,2);; - break;} -case 117: -#line 637 "../../../extras/FvwmScript/script.y" -{ AddComBloc(14,3,2); ; - break;} -case 120: -#line 642 "../../../extras/FvwmScript/script.y" -{ EmpilerBloc(); ; - break;} -case 121: -#line 644 "../../../extras/FvwmScript/script.y" -{ DepilerBloc(2); ; - break;} -case 122: -#line 645 "../../../extras/FvwmScript/script.y" -{ DepilerBloc(2); ; - break;} -case 123: -#line 648 "../../../extras/FvwmScript/script.y" -{ DepilerBloc(1); ; - break;} -case 124: -#line 649 "../../../extras/FvwmScript/script.y" -{ DepilerBloc(1); ; - break;} -case 125: -#line 653 "../../../extras/FvwmScript/script.y" -{ AddComBloc(15,3,1); ; - break;} -case 126: -#line 657 "../../../extras/FvwmScript/script.y" -{ AddComBloc(16,3,1); ; - break;} -case 127: -#line 662 "../../../extras/FvwmScript/script.y" -{ AddVar(yyvsp[0].str); ; - break;} -case 128: -#line 664 "../../../extras/FvwmScript/script.y" -{ AddConstStr(yyvsp[0].str); ; - break;} -case 129: -#line 666 "../../../extras/FvwmScript/script.y" -{ AddConstStr(yyvsp[0].str); ; - break;} -case 130: -#line 668 "../../../extras/FvwmScript/script.y" -{ AddConstNum(yyvsp[0].number); ; - break;} -case 131: -#line 670 "../../../extras/FvwmScript/script.y" -{ AddConstNum(-1); ; - break;} -case 132: -#line 672 "../../../extras/FvwmScript/script.y" -{ AddConstNum(-2); ; - break;} -case 133: -#line 674 "../../../extras/FvwmScript/script.y" -{ AddLevelBufArg(); ; - break;} -case 134: -#line 676 "../../../extras/FvwmScript/script.y" -{ AddFunct(1,1); ; - break;} -case 135: -#line 677 "../../../extras/FvwmScript/script.y" -{ AddFunct(2,1); ; - break;} -case 136: -#line 678 "../../../extras/FvwmScript/script.y" -{ AddFunct(3,1); ; - break;} -case 137: -#line 679 "../../../extras/FvwmScript/script.y" -{ AddFunct(4,1); ; - break;} -case 138: -#line 680 "../../../extras/FvwmScript/script.y" -{ AddFunct(5,1); ; - break;} -case 139: -#line 681 "../../../extras/FvwmScript/script.y" -{ AddFunct(6,1); ; - break;} -case 140: -#line 682 "../../../extras/FvwmScript/script.y" -{ AddFunct(7,1); ; - break;} -case 141: -#line 683 "../../../extras/FvwmScript/script.y" -{ AddFunct(8,1); ; - break;} -case 142: -#line 684 "../../../extras/FvwmScript/script.y" -{ AddFunct(9,1); ; - break;} -case 143: -#line 685 "../../../extras/FvwmScript/script.y" -{ AddFunct(10,1); ; - break;} -case 144: -#line 686 "../../../extras/FvwmScript/script.y" -{ AddFunct(11,1); ; - break;} -case 145: -#line 687 "../../../extras/FvwmScript/script.y" -{ AddFunct(12,1); ; - break;} -case 146: -#line 688 "../../../extras/FvwmScript/script.y" -{ AddFunct(13,1); ; - break;} -case 147: -#line 689 "../../../extras/FvwmScript/script.y" -{ AddFunct(14,1); ; - break;} -case 148: -#line 690 "../../../extras/FvwmScript/script.y" -{ AddFunct(15,1); ; - break;} -case 149: -#line 695 "../../../extras/FvwmScript/script.y" -{ ; - break;} -case 176: -#line 741 "../../../extras/FvwmScript/script.y" -{ l=1-250000; AddBufArg(&l,1); ; - break;} -case 177: -#line 742 "../../../extras/FvwmScript/script.y" -{ l=2-250000; AddBufArg(&l,1); ; - break;} -case 178: -#line 743 "../../../extras/FvwmScript/script.y" -{ l=3-250000; AddBufArg(&l,1); ; - break;} -case 179: -#line 744 "../../../extras/FvwmScript/script.y" -{ l=4-250000; AddBufArg(&l,1); ; - break;} -case 180: -#line 745 "../../../extras/FvwmScript/script.y" -{ l=5-250000; AddBufArg(&l,1); ; - break;} -case 181: -#line 746 "../../../extras/FvwmScript/script.y" -{ l=6-250000; AddBufArg(&l,1); ; - break;} -} - /* the action file gets copied in in place of this dollarsign */ -#line 498 "/usr/share/bison.simple" - - yyvsp -= yylen; - yyssp -= yylen; -#ifdef YYLSP_NEEDED - yylsp -= yylen; -#endif - -#if YYDEBUG != 0 - if (yydebug) - { - short *ssp1 = yyss - 1; - fprintf (stderr, "state stack now"); - while (ssp1 != yyssp) - fprintf (stderr, " %d", *++ssp1); - fprintf (stderr, "\n"); - } -#endif - - *++yyvsp = yyval; - -#ifdef YYLSP_NEEDED - yylsp++; - if (yylen == 0) - { - yylsp->first_line = yylloc.first_line; - yylsp->first_column = yylloc.first_column; - yylsp->last_line = (yylsp-1)->last_line; - yylsp->last_column = (yylsp-1)->last_column; - yylsp->text = 0; - } - else - { - yylsp->last_line = (yylsp+yylen-1)->last_line; - yylsp->last_column = (yylsp+yylen-1)->last_column; - } -#endif - - /* Now "shift" the result of the reduction. - Determine what state that goes to, - based on the state we popped back to - and the rule number reduced by. */ - - yyn = yyr1[yyn]; - - yystate = yypgoto[yyn - YYNTBASE] + *yyssp; - if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp) - yystate = yytable[yystate]; - else - yystate = yydefgoto[yyn - YYNTBASE]; - - goto yynewstate; - -yyerrlab: /* here on detecting error */ - - if (! yyerrstatus) - /* If not already recovering from an error, report this error. */ - { - ++yynerrs; - -#ifdef YYERROR_VERBOSE - yyn = yypact[yystate]; - - if (yyn > YYFLAG && yyn < YYLAST) - { - int size = 0; - char *msg; - int x, count; - - count = 0; - /* Start X at -yyn if nec to avoid negative indexes in yycheck. */ - for (x = (yyn < 0 ? -yyn : 0); - x < (sizeof(yytname) / sizeof(char *)); x++) - if (yycheck[x + yyn] == x) - size += strlen(yytname[x]) + 15, count++; - msg = (char *) malloc(size + 15); - if (msg != 0) - { - strcpy(msg, "parse error"); - - if (count < 5) - { - count = 0; - for (x = (yyn < 0 ? -yyn : 0); - x < (sizeof(yytname) / sizeof(char *)); x++) - if (yycheck[x + yyn] == x) - { - strcat(msg, count == 0 ? ", expecting `" : " or `"); - strcat(msg, yytname[x]); - strcat(msg, "'"); - count++; - } - } - yyerror(msg); - free(msg); - } - else - yyerror ("parse error; also virtual memory exceeded"); - } - else -#endif /* YYERROR_VERBOSE */ - yyerror("parse error"); - } - - goto yyerrlab1; -yyerrlab1: /* here on error raised explicitly by an action */ - - if (yyerrstatus == 3) - { - /* if just tried and failed to reuse lookahead token after an error, discard it. */ - - /* return failure if at end of input */ - if (yychar == YYEOF) - YYABORT; - -#if YYDEBUG != 0 - if (yydebug) - fprintf(stderr, "Discarding token %d (%s).\n", yychar, yytname[yychar1]); -#endif - - yychar = YYEMPTY; - } - - /* Else will try to reuse lookahead token - after shifting the error token. */ - - yyerrstatus = 3; /* Each real token shifted decrements this */ - - goto yyerrhandle; - -yyerrdefault: /* current state does not do anything special for the error token. */ - -#if 0 - /* This is wrong; only states that explicitly want error tokens - should shift them. */ - yyn = yydefact[yystate]; /* If its default is to accept any token, ok. Otherwise pop it.*/ - if (yyn) goto yydefault; -#endif - -yyerrpop: /* pop the current state because it cannot handle the error token */ - - if (yyssp == yyss) YYABORT; - yyvsp--; - yystate = *--yyssp; -#ifdef YYLSP_NEEDED - yylsp--; -#endif - -#if YYDEBUG != 0 - if (yydebug) - { - short *ssp1 = yyss - 1; - fprintf (stderr, "Error: state stack now"); - while (ssp1 != yyssp) - fprintf (stderr, " %d", *++ssp1); - fprintf (stderr, "\n"); - } -#endif - -yyerrhandle: - - yyn = yypact[yystate]; - if (yyn == YYFLAG) - goto yyerrdefault; - - yyn += YYTERROR; - if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR) - goto yyerrdefault; - - yyn = yytable[yyn]; - if (yyn < 0) - { - if (yyn == YYFLAG) - goto yyerrpop; - yyn = -yyn; - goto yyreduce; - } - else if (yyn == 0) - goto yyerrpop; - - if (yyn == YYFINAL) - YYACCEPT; - -#if YYDEBUG != 0 - if (yydebug) - fprintf(stderr, "Shifting error token, "); -#endif - - *++yyvsp = yylval; -#ifdef YYLSP_NEEDED - *++yylsp = yylloc; -#endif - - yystate = yyn; - goto yynewstate; -} -#line 749 "../../../extras/FvwmScript/script.y" - - - - - - - - - - - - - - - diff --git a/app/fvwm/extras/FvwmScript/script.h b/app/fvwm/extras/FvwmScript/script.h deleted file mode 100644 index 9f4cc8709..000000000 --- a/app/fvwm/extras/FvwmScript/script.h +++ /dev/null @@ -1,87 +0,0 @@ -typedef union { char *str; - int number; - } YYSTYPE; -#define STR 258 -#define GSTR 259 -#define VAR 260 -#define NUMBER 261 -#define WINDOWTITLE 262 -#define WINDOWSIZE 263 -#define WINDOWPOSITION 264 -#define FONT 265 -#define FORECOLOR 266 -#define BACKCOLOR 267 -#define SHADCOLOR 268 -#define LICOLOR 269 -#define OBJECT 270 -#define INIT 271 -#define PERIODICTASK 272 -#define MAIN 273 -#define END 274 -#define PROP 275 -#define TYPE 276 -#define SIZE 277 -#define POSITION 278 -#define VALUE 279 -#define VALUEMIN 280 -#define VALUEMAX 281 -#define TITLE 282 -#define SWALLOWEXEC 283 -#define ICON 284 -#define FLAGS 285 -#define WARP 286 -#define WRITETOFILE 287 -#define HIDDEN 288 -#define CANBESELECTED 289 -#define NORELIEFSTRING 290 -#define CASE 291 -#define SINGLECLIC 292 -#define DOUBLECLIC 293 -#define BEG 294 -#define POINT 295 -#define EXEC 296 -#define HIDE 297 -#define SHOW 298 -#define CHFORECOLOR 299 -#define CHBACKCOLOR 300 -#define GETVALUE 301 -#define CHVALUE 302 -#define CHVALUEMAX 303 -#define CHVALUEMIN 304 -#define ADD 305 -#define DIV 306 -#define MULT 307 -#define GETTITLE 308 -#define GETOUTPUT 309 -#define STRCOPY 310 -#define NUMTOHEX 311 -#define HEXTONUM 312 -#define QUIT 313 -#define LAUNCHSCRIPT 314 -#define GETSCRIPTFATHER 315 -#define SENDTOSCRIPT 316 -#define RECEIVFROMSCRIPT 317 -#define GET 318 -#define SET 319 -#define SENDSIGN 320 -#define REMAINDEROFDIV 321 -#define GETTIME 322 -#define GETSCRIPTARG 323 -#define IF 324 -#define THEN 325 -#define ELSE 326 -#define FOR 327 -#define TO 328 -#define DO 329 -#define WHILE 330 -#define BEGF 331 -#define ENDF 332 -#define EQUAL 333 -#define INFEQ 334 -#define SUPEQ 335 -#define INF 336 -#define SUP 337 -#define DIFF 338 - - -extern YYSTYPE yylval; diff --git a/app/fvwm/extras/FvwmScript/script.y b/app/fvwm/extras/FvwmScript/script.y deleted file mode 100644 index 70b0b5a91..000000000 --- a/app/fvwm/extras/FvwmScript/script.y +++ /dev/null @@ -1,763 +0,0 @@ -%{ -#include "types.h" - -extern int numligne; -ScriptProp *scriptprop; -int nbobj=-1; /* Nombre d'objets */ -int HasPosition,HasType=0; -TabObj *tabobj; /* Tableau d'objets, limite=100 */ -int TabIdObj[101]; /* Tableau d'indice des objets */ -Bloc **TabIObj; /* TabIObj[Obj][Case] -> bloc attache au case */ -Bloc *PileBloc[10]; /* Au maximum 10 imbrications de boucle conditionnelle */ -int TopPileB=0; /* Sommet de la pile des blocs */ -CaseObj *TabCObj; /* Struct pour enregistrer les valeurs des cases et leur nb */ -int CurrCase; -int i; -char **TabNVar; /* Tableau des noms de variables */ -char **TabVVar; /* Tableau des valeurs de variables */ -int NbVar; -long BuffArg[6][20]; /* Les arguments s'ajoute par couche pour chaque fonction imbriquee */ -int NbArg[6]; /* Tableau: nb d'args pour chaque couche */ -int SPileArg; /* Taille de la pile d'arguments */ -long l; - -/* Initialisation globale */ -void InitVarGlob() -{ - scriptprop=(ScriptProp*) calloc(1,sizeof(ScriptProp)); - scriptprop->x=-1; - scriptprop->y=-1; - scriptprop->initbloc=NULL; - - tabobj=(TabObj*) calloc(1,sizeof(TabObj)); - for (i=0;i<101;i++) - TabIdObj[i]=-1; - TabNVar=NULL; - TabVVar=NULL; - NbVar=-1; - - SPileArg=-1; - scriptprop->periodictasks=NULL; -} - -/* Initialisation pour un objet */ -void InitObjTabCase(int HasMainLoop) -{ - if (nbobj==0) - { - TabIObj=(Bloc**)calloc(1,sizeof(long)); - TabCObj=(CaseObj*)calloc(1,sizeof(CaseObj)); - } - else - { - TabIObj=(Bloc**)realloc(TabIObj,sizeof(long)*(nbobj+1)); - TabCObj=(CaseObj*)realloc(TabCObj,sizeof(CaseObj)*(nbobj+1)); - } - - if (!HasMainLoop) - TabIObj[nbobj]=NULL; - CurrCase=-1; - TabCObj[nbobj].NbCase=-1; -} - -/* Ajout d'un case dans la table TabCase */ -/* Initialisation d'un case of: agrandissement de la table */ -void InitCase(int cond) -{ - CurrCase++; - - /* On enregistre la condition du case */ - TabCObj[nbobj].NbCase++; - if (TabCObj[nbobj].NbCase==0) - TabCObj[nbobj].LstCase=(int*)calloc(1,sizeof(int)); - else - TabCObj[nbobj].LstCase=(int*)realloc(TabCObj[nbobj].LstCase,sizeof(int)*(CurrCase+1)); - TabCObj[nbobj].LstCase[CurrCase]=cond; - - if (CurrCase==0) - TabIObj[nbobj]=(Bloc*)calloc(1,sizeof(Bloc)); - else - TabIObj[nbobj]=(Bloc*)realloc(TabIObj[nbobj],sizeof(Bloc)*(CurrCase+1)); - - TabIObj[nbobj][CurrCase].NbInstr=-1; - TabIObj[nbobj][CurrCase].TabInstr=NULL; - - /* Ce case correspond au bloc courant d'instruction: on l'empile */ - PileBloc[0]=&TabIObj[nbobj][CurrCase]; - TopPileB=0; -} - -/* Enleve un niveau d'args dans la pile BuffArg */ -void RmLevelBufArg() -{ - SPileArg--; -} - -/* Fonction de concatenation des n derniers etage de la pile */ -/* Retourne les elts trie et depile et la taille */ -long *Depile(int NbLevelArg, int *s) -{ - long *Temp; - int j; - int i; - int size; - - if (NbLevelArg>0) - { - Temp=(long*)calloc(1,sizeof(long)); - size=0; - for (i=SPileArg-NbLevelArg+1;i<=SPileArg;i++) - { - size=NbArg[i]+size+1; - Temp=(long*)realloc (Temp,sizeof(long)*size); - for (j=0;j<=NbArg[i];j++) - { - Temp[j+size-NbArg[i]-1]=BuffArg[i][j]; - } - } - *s=size; - for (i=0;i<NbLevelArg;i++) /* On depile les couches d'arguments */ - RmLevelBufArg(); - return Temp; - } - else - { - return NULL; - *s=0; - } -} - -/* Ajout d'une commande */ -void AddCom(int Type, int NbLevelArg) -{ - int CurrInstr; - - - PileBloc[TopPileB]->NbInstr++; - CurrInstr=PileBloc[TopPileB]->NbInstr; - - if (CurrInstr==0) - PileBloc[TopPileB]->TabInstr=(Instr*)calloc(1,sizeof(Instr)*(CurrInstr+1)); - else - PileBloc[TopPileB]->TabInstr=(Instr*)realloc(PileBloc[TopPileB]->TabInstr, - sizeof(Instr)*(CurrInstr+1)); - /* Rangement des instructions dans le bloc */ - PileBloc[TopPileB]->TabInstr[CurrInstr].Type=Type; - /* On enleve la derniere couche d'argument et on la range dans la commande */ - - PileBloc[TopPileB]->TabInstr[CurrInstr].TabArg=Depile(NbLevelArg, - &PileBloc[TopPileB]->TabInstr[CurrInstr].NbArg); -} - -/* Initialisation du buffer contenant les arguments de la commande courante */ -/* Ajout d'une couche d'argument dans la pile*/ -void AddLevelBufArg() -{ - /* Agrandissment de la pile */ - SPileArg++; - NbArg[SPileArg]=-1; -} - -/* Ajout d'un arg dans la couche arg qui est au sommet de la pile TabArg */ -void AddBufArg(long *TabLong,int NbLong) -{ - int i; - - for (i=0;i<NbLong;i++) - { - BuffArg[SPileArg][i+NbArg[SPileArg]+1]=TabLong[i]; - } - NbArg[SPileArg]=NbArg[SPileArg]+NbLong; -} - -/* Recheche d'un nom de var dans TabVar, s'il n'existe pas il le cree */ -/* Retourne un Id */ -void AddVar(char *Name) /* ajout de variable a la fin de la derniere commande pointee */ -{ - int i; - - /* Comparaison avec les variables deja existante */ - for (i=0;i<=NbVar;i++) - if (strcmp(TabNVar[i],Name)==0) - { - l=(long)i; - AddBufArg(&l,1); - return ; - } - - if (NbVar>58) - { - fprintf(stderr,"Line %d: too many variables (>60)\n",numligne); - exit(1); - } - - /* La variable n'a pas ete trouvee: creation */ - NbVar++; - - if (NbVar==0) - { - TabNVar=(char**)calloc(1,sizeof(long)); - TabVVar=(char**)calloc(1,sizeof(long)); - } - else - { - TabNVar=(char**)realloc(TabNVar,sizeof(long)*(NbVar+1)); - TabVVar=(char**)realloc(TabVVar,sizeof(long)*(NbVar+1)); - } - - TabNVar[NbVar]=(char*)strdup(Name); - TabVVar[NbVar]=(char*)calloc(1,sizeof(char)); - TabVVar[NbVar][0]='\0'; - - - /* Ajout de la variable dans le buffer Arg */ - l=(long)NbVar; - AddBufArg(&l,1); - return ; -} - -/* Ajout d'une constante str comme argument */ -void AddConstStr(char *Name) -{ - /* On cree une nouvelle variable et on range la constante dedans */ - NbVar++; - if (NbVar==0) - { - TabVVar=(char**)calloc(1,sizeof(long)); - TabNVar=(char**)calloc(1,sizeof(long)); - } - else - { - TabVVar=(char**)realloc(TabVVar,sizeof(long)*(NbVar+1)); - TabNVar=(char**)realloc(TabNVar,sizeof(long)*(NbVar+1)); - } - - TabNVar[NbVar]=(char*)calloc(1,sizeof(char)); - TabNVar[NbVar][0]='\0'; - TabVVar[NbVar]=(char*)strdup(Name); - - /* Ajout de l'id de la constante dans la liste courante des arguments */ - l=(long)NbVar; - AddBufArg(&l,1); -} - -/* Ajout d'une constante numerique comme argument */ -void AddConstNum(long num) -{ - - /* On ne cree pas de nouvelle variable */ - /* On code la valeur numerique afin de le ranger sous forme d'id */ - l=num+200000; - /* Ajout de la constante dans la liste courante des arguments */ - AddBufArg(&l,1); -} - -/* Ajout d'une fonction comme argument */ -/* Enleve les args de func de la pile, */ -/* le concate, et les range dans la pile */ -void AddFunct(int code,int NbLevelArg) -{ - int size; - long *l; - int i; - - /* Methode: depiler BuffArg et completer le niveau inferieur de BuffArg */ - l=Depile(NbLevelArg, &size); - - size++; - if (size==1) - l=(long*)calloc(1,sizeof(long)); - else - { - l=(long*)realloc(l,sizeof(long)*(size)); - for (i=size-2;i>-1;i--) /* Deplacement des args */ - { - l[i+1]=l[i]; - } - } - l[0]=(long)code-150000; - - AddBufArg(l,size); -} - -/* Ajout d'une instruction de test pour executer un ou plusieurs blocs */ -/* enregistre l'instruction et le champs de ces blocs = NULL */ -void AddComBloc(int TypeCond, int NbLevelArg, int NbBloc) -{ - int i; - int OldNA; - int CurrInstr; - - /* Ajout de l'instruction de teste comme d'une commande */ - AddCom(TypeCond, NbLevelArg); - - /* On initialise ensuite les deux champs reserve à bloc1 et bloc2 */ - CurrInstr=PileBloc[TopPileB]->NbInstr; - /* Attention NbArg peur changer si on utilise en arg une fonction */ - OldNA=PileBloc[TopPileB]->TabInstr[CurrInstr].NbArg; - - PileBloc[TopPileB]->TabInstr[CurrInstr].TabArg=(long*)realloc( - PileBloc[TopPileB]->TabInstr[CurrInstr].TabArg,sizeof(long)*(OldNA+NbBloc)); - for (i=0;i<NbBloc;i++) - { - PileBloc[TopPileB]->TabInstr[CurrInstr].TabArg[OldNA+i]=0; - } - PileBloc[TopPileB]->TabInstr[CurrInstr].NbArg=OldNA+NbBloc; -} - -/* Creer un nouveau bloc, et l'empile: il devient le bloc courant */ -void EmpilerBloc() -{ - Bloc *TmpBloc; - - TmpBloc=(Bloc*)calloc(1,sizeof(Bloc)); - TmpBloc->NbInstr=-1; - TmpBloc->TabInstr=NULL; - TopPileB++; - PileBloc[TopPileB]=TmpBloc; - -} - -/* Depile le bloc d'initialisation du script et le range a sa place speciale */ -void DepilerBloc(int IdBloc) -{ - Bloc *Bloc1; - Instr *IfInstr; - - Bloc1=PileBloc[TopPileB]; - TopPileB--; - IfInstr=&PileBloc[TopPileB]->TabInstr[PileBloc[TopPileB]->NbInstr]; - IfInstr->TabArg[IfInstr->NbArg-IdBloc]=(long)Bloc1; -} - -/* Gestion des erreurs de syntaxes */ -int yyerror(char *errmsg) -{ - fprintf(stderr,"Line %d: %s\n",numligne,errmsg); - return 0; -} - - -%} - -/* Declaration des types des tokens, tous les types sont assemblés dans union */ -/* Le type est celui de yyval, yyval est utilisé dans lex explicitement */ -/* Dans bison, il est utlise implicitement avec $1, $2... */ -%union { char *str; - int number; - } - -/* Declaration des symboles terminaux */ -%token <str> STR GSTR VAR -%token <number> NUMBER /* Nombre pour communiquer les dimensions */ - -%token WINDOWTITLE WINDOWSIZE WINDOWPOSITION FONT -%token FORECOLOR BACKCOLOR SHADCOLOR LICOLOR -%token OBJECT INIT PERIODICTASK MAIN END PROP -%token TYPE SIZE POSITION VALUE VALUEMIN VALUEMAX TITLE SWALLOWEXEC ICON FLAGS WARP WRITETOFILE -%token HIDDEN CANBESELECTED NORELIEFSTRING -%token CASE SINGLECLIC DOUBLECLIC BEG POINT -%token EXEC HIDE SHOW FONT CHFORECOLOR CHBACKCOLOR GETVALUE CHVALUE CHVALUEMAX CHVALUEMIN -%token ADD DIV MULT GETTITLE GETOUTPUT STRCOPY NUMTOHEX HEXTONUM QUIT -%token LAUNCHSCRIPT GETSCRIPTFATHER SENDTOSCRIPT RECEIVFROMSCRIPT -%token GET SET SENDSIGN REMAINDEROFDIV GETTIME GETSCRIPTARG -%token IF THEN ELSE FOR TO DO WHILE -%token BEGF ENDF -%token EQUAL INFEQ SUPEQ INF SUP DIFF - -%% -script: initvar head initbloc periodictask object ; - -/* Initialisation des variables */ -initvar: { InitVarGlob(); } - ; - -/* Entete du scripte decrivant les options par defaut */ -head: /* vide: dans ce cas on utilise les valeurs par défaut */ - | WINDOWTITLE GSTR head { /* Titre de la fenetre */ - scriptprop->titlewin=$2; - } - | ICON STR head { - scriptprop->icon=$2; - } - | WINDOWPOSITION NUMBER NUMBER head - { /* Position et taille de la fenetre */ - scriptprop->x=$2; - scriptprop->y=$3; - } - | WINDOWSIZE NUMBER NUMBER head - { /* Position et taille de la fenetre */ - scriptprop->width=$2; - scriptprop->height=$3; - } - | BACKCOLOR GSTR head { /* Couleur de fond */ - scriptprop->backcolor=$2; - } - | FORECOLOR GSTR head { /* Couleur des lignes */ - scriptprop->forecolor=$2; - } - | SHADCOLOR GSTR head { /* Couleur des lignes */ - scriptprop->shadcolor=$2; - } - | LICOLOR GSTR head { /* Couleur des lignes */ - scriptprop->licolor=$2; - } - | FONT STR head { - scriptprop->font=$2; - } - ; - -/* Bloc d'initialisation du script */ -initbloc: /* cas ou il n'y pas de bloc d'initialisation du script */ - | INIT creerbloc BEG instr END { - scriptprop->initbloc=PileBloc[TopPileB]; - TopPileB--; - } - -periodictask: /* cas ou il n'y a pas de tache periodique */ - | PERIODICTASK creerbloc BEG instr END { - scriptprop->periodictasks=PileBloc[TopPileB]; - TopPileB--; - } - - ; - - -/* Desciption d'un objet */ -object : /* Vide */ - | OBJECT id PROP init verify mainloop object - ; - -id: NUMBER { nbobj++; - if (nbobj>100) - { yyerror("Too many items\n"); - exit(1);} - if (($1<1)||($1>100)) - { yyerror("Choose item id between 1 and 100\n"); - exit(1);} - if (TabIdObj[$1]!=-1) - { i=$1; fprintf(stderr,"Line %d: item id %d already used:\n",numligne,$1); - exit(1);} - TabIdObj[$1]=nbobj; - (*tabobj)[nbobj].id=$1; - } - ; - -init: /* vide */ - | TYPE STR init { - (*tabobj)[nbobj].type=$2; - HasType=1; - } - | SIZE NUMBER NUMBER init { - (*tabobj)[nbobj].width=$2; - (*tabobj)[nbobj].height=$3; - } - | POSITION NUMBER NUMBER init { - (*tabobj)[nbobj].x=$2; - (*tabobj)[nbobj].y=$3; - HasPosition=1; - } - | VALUE NUMBER init { - (*tabobj)[nbobj].value=$2; - } - | VALUEMIN NUMBER init { - (*tabobj)[nbobj].value2=$2; - } - | VALUEMAX NUMBER init { - (*tabobj)[nbobj].value3=$2; - } - | TITLE GSTR init { - (*tabobj)[nbobj].title=$2; - } - | SWALLOWEXEC GSTR init { - (*tabobj)[nbobj].swallow=$2; - } - | ICON STR init { - (*tabobj)[nbobj].icon=$2; - } - | BACKCOLOR GSTR init { - (*tabobj)[nbobj].backcolor=$2; - } - | FORECOLOR GSTR init { - (*tabobj)[nbobj].forecolor=$2; - } - | SHADCOLOR GSTR init { - (*tabobj)[nbobj].shadcolor=$2; - } - | LICOLOR GSTR init { - (*tabobj)[nbobj].licolor=$2; - } - | FONT STR init { - (*tabobj)[nbobj].font=$2; - } - | FLAGS flags init - ; -flags: - | HIDDEN flags { - (*tabobj)[nbobj].flags[0]=True; - } - | NORELIEFSTRING flags { - (*tabobj)[nbobj].flags[1]=True; - } - | CANBESELECTED flags { - (*tabobj)[nbobj].flags[2]=True; - } - ; - - -verify: { - if (!HasPosition) - { yyerror("No position for object"); - exit(1);} - if (!HasType) - { yyerror("No type for object"); - exit(1);} - HasPosition=0; - HasType=0; - } - -mainloop: END { InitObjTabCase(0); } - | MAIN addtabcase CASE case END - ; - -addtabcase: { InitObjTabCase(1); } - -case: - | clic POINT bloc case - | number POINT bloc case - ; - -clic : SINGLECLIC { InitCase(-1); } - | DOUBLECLIC { InitCase(-2); } - ; - -number : NUMBER { InitCase($1); } - ; - -bloc: BEG instr END - ; - - -/* ensemble d'instructions */ -instr: - | EXEC exec instr - | WARP warp instr - | WRITETOFILE writetofile instr - | HIDE hide instr - | SHOW show instr - | CHVALUE chvalue instr - | CHVALUEMAX chvaluemax instr - | CHVALUEMIN chvaluemin instr - | POSITION position instr - | SIZE size instr - | TITLE title instr - | ICON icon instr - | FONT font instr - | CHFORECOLOR chforecolor instr - | CHBACKCOLOR chbackcolor instr - | SET set instr - | SENDSIGN sendsign instr - | QUIT quit instr - | SENDTOSCRIPT sendtoscript instr - | IF ifthenelse instr - | FOR loop instr - | WHILE while instr - ; - -/* une seule instruction */ -oneinstr: EXEC exec - | WARP warp - | WRITETOFILE writetofile - | HIDE hide - | SHOW show - | CHVALUE chvalue - | CHVALUEMAX chvaluemax - | CHVALUEMIN chvaluemin - | POSITION position - | SIZE size - | TITLE title - | ICON icon - | FONT font - | CHFORECOLOR chforecolor - | CHBACKCOLOR chbackcolor - | SET set - | SENDSIGN sendsign - | QUIT quit - | SENDTOSCRIPT sendtoscript - | FOR loop - | WHILE while - ; - -exec: addlbuff args { AddCom(1,1); } - ; -hide: addlbuff numarg { AddCom(2,1);} - ; -show: addlbuff numarg { AddCom(3,1);} - ; -chvalue: addlbuff numarg addlbuff numarg { AddCom(4,2);} - ; -chvaluemax: addlbuff numarg addlbuff numarg { AddCom(21,2);} - ; -chvaluemin: addlbuff numarg addlbuff numarg { AddCom(22,2);} - ; -position: addlbuff numarg addlbuff numarg addlbuff numarg { AddCom(5,3);} - ; -size: addlbuff numarg addlbuff numarg addlbuff numarg { AddCom(6,3);} - ; -icon: addlbuff numarg addlbuff strarg { AddCom(7,2);} - ; -title: addlbuff numarg addlbuff gstrarg { AddCom(8,2);} - ; -font: addlbuff numarg addlbuff strarg { AddCom(9,2);} - ; -chforecolor: addlbuff numarg addlbuff gstrarg { AddCom(10,2);} - ; -chbackcolor: addlbuff numarg addlbuff gstrarg { AddCom(19,2);} - ; -set: addlbuff vararg GET addlbuff args { AddCom(11,2);} - ; -sendsign: addlbuff numarg addlbuff numarg{ AddCom(12,2);} - ; -quit: { AddCom(13,0);} - ; -warp: addlbuff numarg { AddCom(17,1);} - ; -sendtoscript: addlbuff numarg addlbuff args { AddCom(23,2);} - ; -writetofile: addlbuff strarg addlbuff args { AddCom(18,2);} - ; -ifthenelse: headif creerbloc bloc1 else - ; -loop: headloop creerbloc bloc2 - ; -while: headwhile creerbloc bloc2 - ; - -/* Boucle conditionnelle: compare n'importe quel type d'argument */ -headif: addlbuff arg addlbuff compare addlbuff arg THEN { AddComBloc(14,3,2); } - ; -else: /* Le else est optionnel */ - | ELSE creerbloc bloc2 - ; -creerbloc: { EmpilerBloc(); } - ; -bloc1: BEG instr END { DepilerBloc(2); } - | oneinstr { DepilerBloc(2); } - ; - -bloc2: BEG instr END { DepilerBloc(1); } - | oneinstr { DepilerBloc(1); } - ; - -/* Boucle sur une variable */ -headloop: addlbuff vararg GET addlbuff arg TO addlbuff arg DO { AddComBloc(15,3,1); } - ; - -/* Boucle conditionnelle while */ -headwhile: addlbuff arg addlbuff compare addlbuff arg DO { AddComBloc(16,3,1); } - ; - -/* Argument de commandes */ -/* Argument elementaire */ -var : VAR { AddVar($1); } - ; -str : STR { AddConstStr($1); } - ; -gstr : GSTR { AddConstStr($1); } - ; -num : NUMBER { AddConstNum($1); } - ; -singleclic2: SINGLECLIC { AddConstNum(-1); } - ; -doubleclic2: DOUBLECLIC { AddConstNum(-2); } - ; -addlbuff: { AddLevelBufArg(); } - ; -function: GETVALUE numarg { AddFunct(1,1); } - | GETTITLE numarg { AddFunct(2,1); } - | GETOUTPUT gstrarg numarg numarg { AddFunct(3,1); } - | NUMTOHEX numarg numarg { AddFunct(4,1); } - | HEXTONUM gstrarg { AddFunct(5,1); } - | ADD numarg numarg { AddFunct(6,1); } - | MULT numarg numarg { AddFunct(7,1); } - | DIV numarg numarg { AddFunct(8,1); } - | STRCOPY gstrarg numarg numarg { AddFunct(9,1); } - | LAUNCHSCRIPT gstrarg { AddFunct(10,1); } - | GETSCRIPTFATHER { AddFunct(11,1); } - | RECEIVFROMSCRIPT numarg { AddFunct(12,1); } - | REMAINDEROFDIV numarg numarg { AddFunct(13,1); } - | GETTIME { AddFunct(14,1); } - | GETSCRIPTARG numarg { AddFunct(15,1); } - ; - - -/* Plusieurs arguments de type differents */ -args : { } - | singleclic2 args - | doubleclic2 args - | var args - | gstr args - | str args - | num args - | BEGF addlbuff function ENDF args - ; - - -/* Argument unique de n'importe quel type */ -arg : var - | singleclic2 - | doubleclic2 - | gstr - | str - | num - | BEGF addlbuff function ENDF - ; - -/* Argument unique de type numerique */ -numarg : singleclic2 - | doubleclic2 - | num - | var - | BEGF addlbuff function ENDF - ; - -/* Argument unique de type str */ -strarg : var - | str - | BEGF addlbuff function ENDF - ; - -/* Argument unique de type gstr */ -gstrarg : var - | gstr - | BEGF addlbuff function ENDF - ; - -/* Argument unique de type var, pas de fonction */ -vararg : var - ; - -/* element de comparaison entre deux variables numerique */ -compare : INF { l=1-250000; AddBufArg(&l,1); } - | INFEQ { l=2-250000; AddBufArg(&l,1); } - | EQUAL { l=3-250000; AddBufArg(&l,1); } - | SUPEQ { l=4-250000; AddBufArg(&l,1); } - | SUP { l=5-250000; AddBufArg(&l,1); } - | DIFF { l=6-250000; AddBufArg(&l,1); } - ; - -%% - - - - - - - - - - - - - - diff --git a/app/fvwm/extras/FvwmScript/types.h b/app/fvwm/extras/FvwmScript/types.h deleted file mode 100644 index 67de1efd8..000000000 --- a/app/fvwm/extras/FvwmScript/types.h +++ /dev/null @@ -1,220 +0,0 @@ -#include "config.h" - -#include "../../fvwm/module.h" -#include "fvwmlib.h" - -#include <stdio.h> -#include <signal.h> -#include <ctype.h> - -#include <unistd.h> -#include <fcntl.h> -#include <sys/time.h> - -#define XK_MISCELLANY -#include <sys/types.h> -#include <sys/time.h> - -#if HAVE_SYS_BSDTYPES_H -#include <sys/bsdtypes.h> /* Saul */ -#endif - -#if HAVE_SYS_SELECT_H -#include <sys/select.h> -#endif - -#include <X11/keysymdef.h> -#include <X11/keysym.h> -#include <X11/Xlib.h> -#include <X11/Xutil.h> -#include <X11/Xproto.h> -#include <X11/cursorfont.h> -#include <X11/Xatom.h> -#include <X11/xpm.h> -#include <X11/X.h> - - -/* Constante de couleurs */ -#define black 0 -#define white 1 -#define back 2 -#define fore 3 -#define shad 4 -#define li 5 - -/* Constante vrai ou faux */ -#define True 1 -#define False 0 - -/* Constante type de widget */ -#define PushButton 1 -#define RadioButton 2 -#define ItemDraw 3 -#define CheckBox 4 -#define TextField 5 -#define HScrollBar 6 -#define VScrollBar 7 -#define PopupMenu 8 -#define Rectangle 9 -#define MiniScroll 10 -#define SwallowExec 11 -#define HDipstick 12 -#define VDipstick 13 -#define List 14 -#define Menu 15 - -/* Structure qui regroupe commande et boucle conditionnelle */ -typedef struct -{ - int Type; /* Type de la commande */ - long *TabArg; /* Tableau d'argument: id var,fnc,const,adr bloc... */ - int NbArg; -} Instr; - - -/* Structure bloc d'instruction */ -typedef struct -{ - Instr *TabInstr; /* Tableau d'instruction */ - int NbInstr; /* Nombre d'instruction */ -} Bloc; - - -/* Structure pour enregistrer l'entete du script: valeur par defaut */ -typedef struct /* Type pour la gestion X */ -{ - int x,y ; /* Origine de la fenetre */ - int height,width; /* Hauteur et largeur */ - char *titlewin; /* Titre */ - char *forecolor; /* Couleur des lignes */ - char *backcolor; /* Couleur de fond */ - char *shadcolor; /* Couleur des lignes */ - char *licolor; /* Couleur des lignes */ - char *font; /* Police utilisee */ - char *icon; /* Icone pour l'application iconisee */ - Bloc *periodictasks; /* Tableau de taches periodiques */ - Bloc *initbloc; /* Bloc d'initalisation */ -} ScriptProp; - - -typedef struct -{ - int NbCase; - int *LstCase; /* Tableau des valeurs case a verifier */ -} CaseObj; - -/* Structure pour enregistrer les caracteristiques des objets graphiques */ -typedef struct /* Type pour les boutons */ -{ - int id; - char *type; - int x,y ; /* Origine du bouton */ - int height,width; /* Hauteur et largeur */ - char *title; /* Titre */ - char *swallow; /* swallowexec */ - char *icon; /* Icon */ - char *forecolor; /* Couleur des lignes */ - char *backcolor; /* Couleur de fond */ - char *shadcolor; - char *licolor; - char *font; /* Police utilisé */ - int flags[5]; /* Etat du bouton:invisible, inactif et actif */ - int value; - int value2; - int value3; -} MyObject; - -typedef MyObject TabObj[100]; - - -typedef struct -{ - Display *display ; - int screen ; - Window root ; - Window win ; - Colormap colormap ; - GC gc ; - int depth ; - unsigned long WhitePix ; - unsigned long BlackPix ; - XColor TabColor[6]; - XSizeHints size; - char *backcolor; - char *forecolor; - char *shadcolor; - char *licolor; - char *font; - char *icon; - char *title; - Bloc *periodictasks; - int HaveXSelection; - char* TabScriptId[99]; - int NbChild; - time_t BeginTime; - char *TabArg[20]; -} X11base ; - -typedef struct -{ - char *Msg; - char* R; -} TypeName; - -typedef struct -{ - int NbMsg; - TypeName TabMsg[40]; -} TypeBuffSend ; - -struct XObj -{ - int TypeWidget; - Window win; /* Fenetre contenant l'objet */ - Window *ParentWin; /* Fenetre parent */ - Display *display; - int Screen; - Colormap *colormap; - XColor TabColor[6]; - GC gc; /* gc utilise pour les requetes: 4 octets */ - int id; /* Numero d'id */ - int x,y; /* Origine du bouton */ - int height,width; /* Hauteur et largeur */ - char *title; /* Titre */ - char *swallow; /* SwallowExec */ - char *icon; /* Icon */ - char *forecolor; /* Couleur des lignes */ - char *backcolor; /* Couleur de fond */ - char *shadcolor; /* Couleur des lignes */ - char *licolor; /* Couleur de fond */ - char *font; /* Police utilisee */ - Pixmap iconPixmap; /* Icone charge */ - Pixmap icon_maskPixmap; /* Icone masque */ - int icon_w,icon_h; /* Largeur et hauteur de l'icone */ - XFontStruct *xfont; - int value; /* Valeur courante */ - int value2; /* Valeur minimale */ - int value3; /* Valeur maximale */ - int flags[5]; - void (*InitObj) (struct XObj *xobj); /* Initialisation de l'objet */ - void (*DestroyObj) (struct XObj *xobj); /* Destruction objet */ - void (*DrawObj) (struct XObj *xobj); /* Dessin de l'objet */ - void (*EvtMouse) (struct XObj *xobj,XButtonEvent *EvtButton); - void (*EvtKey) (struct XObj *xobj,XKeyEvent *EvtKey); - void (*ProcessMsg) (struct XObj *xobj,unsigned long type,unsigned long *body); - void *UserPtr; -}; - -void ChooseFunction(struct XObj *xobj,char *type); - -void SendMsg(struct XObj *xobj,int TypeMsg); - -void ExecBloc(Bloc *bloc); - -void UnselectAllTextField(struct XObj **xobj); - -int MyAllocNamedColor(Display *display,Colormap colormap,char* colorname,XColor* color); - -void Quit (int NbArg,long *TabArg); - -void SendMsgToScript(XEvent event); diff --git a/app/fvwm/extras/FvwmTaskBar/ButtonArray.c b/app/fvwm/extras/FvwmTaskBar/ButtonArray.c deleted file mode 100644 index c3c4519b4..000000000 --- a/app/fvwm/extras/FvwmTaskBar/ButtonArray.c +++ /dev/null @@ -1,477 +0,0 @@ -/* FvwmTaskBar Module for Fvwm. - * - * Copyright 1994, Mike Finger (mfinger@mermaid.micro.umn.edu or - * Mike_Finger@atk.com) - * Copyright 1995, Pekka Pietik{inen (pp@netppl.fi) - * - * The functions in this source file that are the original work of Mike Finger. - * This source file has been modified for use with fvwm95look by - * Pekka Pietik{inen, David Barth, Hector Peraza, etc, etc... - * - * No guarantees or warantees or anything are provided or implied in any way - * whatsoever. Use this program at your own risk. Permission to use this - * program for any purpose is given, as long as the copyright is kept intact. - * - */ - -#include <stdlib.h> -#include <stdio.h> -#include <X11/Xlib.h> - -#include "../../libs/fvwmlib.h" - -#include "ButtonArray.h" -#include "Mallocs.h" - -extern XFontStruct *ButtonFont, *SelButtonFont; -extern Display *dpy; -extern Window win; -extern GC shadow, hilite, graph, whitegc, blackgc, checkered; -extern button_width; - -extern Button *StartButton; - -int w3p; /* width of the string "..." in pixels */ - -extern int NRows, RowHeight; - -#define MIN_BUTTON_SIZE 32 /*....*/ - -/************************************************************************* - * * - * Button handling functions and procedures * - * * - *************************************************************************/ - -/* Draws a 3D rectangle */ -void Draw3dRect(Window wn, int x, int y, int w, int h, int state) -{ - XClearArea (dpy, wn, x, y, w, h, False); - - switch (state) { - case BUTTON_UP: - XDrawLine (dpy, win, hilite, x, y, x+w-2, y); - XDrawLine (dpy, win, hilite, x, y, x, y+h-2); - - XDrawLine (dpy, win, shadow, x+1, y+h-2, x+w-2, y+h-2); - XDrawLine (dpy, win, shadow, x+w-2, y+h-2, x+w-2, y+1); - XDrawLine (dpy, win, blackgc, x, y+h-1, x+w-1, y+h-1); - XDrawLine (dpy, win, blackgc, x+w-1, y+h-1, x+w-1, y); - break; - case BUTTON_BRIGHT: - XFillRectangle (dpy, win, checkered, x+2, y+2, w-4, h-4); - XDrawLine (dpy, win, hilite, x+2, y+2, x+w-3, y+2); - case BUTTON_DOWN: - XDrawLine (dpy, win, blackgc, x, y, x+w-1, y); - XDrawLine (dpy, win, blackgc, x, y, x, y+h-1); - - XDrawLine (dpy, win, shadow, x+1, y+1, x+w-3, y+1); - XDrawLine (dpy, win, shadow, x+1, y+1, x+1, y+h-3); - XDrawLine (dpy, win, hilite, x+1, y+h-1, x+w-1, y+h-1); - XDrawLine (dpy, win, hilite, x+w-1, y+h-1, x+w-1, y+1); - break; - } -} - - -/* ------------------------------------------------------------------------- - ButtonNew - Allocates and fills a new button structure - ------------------------------------------------------------------------- */ -Button *ButtonNew(char *title, Picture *p, int state) -{ - Button *new; - - new = (Button *)safemalloc(sizeof(Button)); - new->title = safemalloc(strlen(title)+1); - strcpy(new->title, title); - if (p != NULL) { - new->p.picture = p->picture; - new->p.mask = p->mask; - new->p.width = p->width; - new->p.height = p->height; - new->p.depth = p->depth; - } else { - new->p.picture = 0; - } - - new->state = state; - new->next = NULL; - new->needsupdate = 1; - - return new; -} - -/* ------------------------------------------------------------------------- - ButtonDraw - Draws the specified button - ------------------------------------------------------------------------- */ -void ButtonDraw(Button *button, int x, int y, int w, int h) -{ - static char *t3p = "..."; - int state, x3p, newx; - int search_len; - XFontStruct *font; - XGCValues gcv; - unsigned long gcm; - - if (button == NULL) return; - button->needsupdate = 0; - state = button->state; - Draw3dRect(win, x, y, w, h, state); - - if (state != BUTTON_UP) { x++; y++; } - - if (state == BUTTON_BRIGHT || button == StartButton) - font = SelButtonFont; - else - font = ButtonFont; - - gcm = GCFont; - gcv.font = font->fid; - XChangeGC(dpy, graph, gcm, &gcv); - - newx = 4; - - w3p = XTextWidth(font, t3p, 3); - - if ((button->p.picture != 0) && - (w + button->p.width + w3p + 3 > MIN_BUTTON_SIZE)) { - - gcm = GCClipMask | GCClipXOrigin | GCClipYOrigin; - gcv.clip_mask = button->p.mask; - gcv.clip_x_origin = x + 3; - gcv.clip_y_origin = y + ((h-button->p.height) >> 1); - XChangeGC(dpy, hilite, gcm, &gcv); - XCopyArea(dpy, button->p.picture, win, hilite, 0, 0, - button->p.width, button->p.height, - gcv.clip_x_origin, gcv.clip_y_origin); - gcm = GCClipMask; - gcv.clip_mask = None; - XChangeGC(dpy, hilite, gcm, &gcv); - - newx += button->p.width+2; - } - - if (button->title == NULL) return; - - search_len = strlen(button->title); - - button->truncate = False; - if (XTextWidth(font, button->title, search_len) > w-newx-3) { - - x3p = 0; - while (search_len > 0 - && ((x3p = newx + XTextWidth(font, button->title, search_len)) - > w-w3p-3)) - search_len--; - - /* It seems a little bogus that we don't see if the "..." _itself_ - will fit on the button; what if it won't? Oh well. */ - XDrawString(dpy, win, graph, x + x3p, y+ButtonFont->ascent+4, t3p, 3); - button->truncate = True; - } - - /* Only print as much of the title as will fit. */ - if (search_len) - XDrawString(dpy, win, graph, - x+newx, y+font->ascent+4, - button->title, search_len); -} - - -/* ------------------------------------------------------------------------- - ButtonUpdate - Change the name/state of a button - ------------------------------------------------------------------------- */ -int ButtonUpdate(Button *button, char *title, int state) -{ - if (button == NULL) return -1; - - if ((title != NULL) && (button->title != title)) { - button->title = (char *)realloc(button->title,strlen(title)+1); - strcpy(button->title,title); - button->needsupdate = 1; - } - - if (state != DONT_CARE) { - if (state != button->state) { - button->state = state; - button->needsupdate = 1; - } - } - - return 1; -} - -/* ------------------------------------------------------------------------- - ButtonDelete - Free space allocated to a button - ------------------------------------------------------------------------- */ -void ButtonDelete(Button *ptr) -{ - if (ptr != NULL) { - if (ptr->title != NULL) free(ptr->title); - free(ptr); - } -} - -/* ------------------------------------------------------------------------- - ButtonName - Return the name of the button - ------------------------------------------------------------------------- */ -char *ButtonName(Button *button) -{ - if (button == NULL) return NULL; - else return button->title; -} - - -/************************************************************************* - * * - * ButtonArray handling functions and procedures * - * * - *************************************************************************/ - -/* ------------------------------------------------------------------------- - InitArray - Initialize the arrary of buttons - ------------------------------------------------------------------------- */ -void InitArray(ButtonArray *array, int x, int y, int w, int h, int tw) -{ - array->count = 0; - array->head = array->tail = NULL; - array->x = x; - array->y = y; - array->w = w; - array->h = h; - array->tw = tw; -} - -/* ------------------------------------------------------------------------- - UpdateArray - Update the array specifics. x,y, width, height - ------------------------------------------------------------------------- */ -void UpdateArray(ButtonArray *array,int x,int y,int w, int h, int tw) -{ - Button *temp; - - if (x != -1) array->x = x; - if (y != -1) array->y = y; - if (w != -1) array->w = w; - if (h != -1) array->h = h; - if (tw != -1) array->tw = tw; - for(temp=array->head; temp!=NULL; temp=temp->next) temp->needsupdate = 1; -} - -/* ------------------------------------------------------------------------- - AddButton - Allocate space for and add the button to the list - ------------------------------------------------------------------------- */ -void AddButton(ButtonArray *array, char *title, Picture *p, int state) -{ - Button *new; - - new = ButtonNew(title, p, state); - if (array->head == NULL) array->head = array->tail = new; - else { - array->tail->next = new; - array->tail = new; - } - array->count++; - - ArrangeButtonArray (array); -} - -/* ------------------------------------------------------------------------- - ArrangeButtonArray - Rearrange the button size (called from AddButton, - RemoveButton, AdjustWindow) - ------------------------------------------------------------------------- */ - -void ArrangeButtonArray (ButtonArray *array) - { - int tw; - Button *temp; - - if (!array->count) - tw = array->w; - else if (NRows == 1) - tw = array->w / array->count; - else - tw = array->w / ((array->count / NRows)+1); - - if (tw > button_width) tw = button_width; - if (tw < MIN_BUTTON_SIZE) tw = MIN_BUTTON_SIZE; - - if (tw != array->tw) /* update needed */ - { - array->tw = tw; - for(temp=array->head; temp!=NULL; temp=temp->next) - temp->needsupdate=1; - } - } - -/* ------------------------------------------------------------------------- - UpdateButton - Change the name/state of a button - ------------------------------------------------------------------------- */ -int UpdateButton(ButtonArray *array, int butnum, char *title, int state) -{ - Button *temp; - - temp = find_n(array, butnum); - return ButtonUpdate(temp, title, state); -} - -/* ------------------------------------------------------------------------- - UpdateButtonPicture - Change the picture of a button - ------------------------------------------------------------------------- */ -int UpdateButtonPicture(ButtonArray *array, int butnum, Picture *p) -{ - Button *temp; - - temp = find_n(array, butnum); - if (temp == NULL) return -1; - if (temp->p.picture != p->picture || temp->p.mask != p->mask) { - temp->p.picture = p->picture; - temp->p.mask = p->mask; - temp->p.width = p->width; - temp->p.height = p->height; - temp->p.depth = p->depth; - temp->needsupdate = 1; - } - return 1; -} - -/* ------------------------------------------------------------------------- - RemoveButton - Delete a button from the list - ------------------------------------------------------------------------- */ -void RemoveButton(ButtonArray *array, int butnum) -{ - Button *temp, *temp2; - - if (butnum == 0) { - temp2 = array->head; - temp = array->head = array->head->next; - } else { - temp = find_n(array, butnum-1); - if (temp == NULL) return; - temp2 = temp->next; - temp->next = temp2->next; - } - - if (array->tail == temp2) array->tail = temp; - - ButtonDelete(temp2); - array->count--; - if (temp != array->head) - temp = temp->next; - for (; temp!=NULL; temp=temp->next) - temp->needsupdate = 1; - - ArrangeButtonArray(array); -} - -/* ------------------------------------------------------------------------- - find_n - Find the nth button in the list (Use internally) - ------------------------------------------------------------------------- */ -Button *find_n(ButtonArray *array, int n) -{ - Button *temp; - int i; - - temp = array->head; - if (n < 0) return NULL; - for(i=0; i<n && temp!=NULL; i++,temp=temp->next); - return temp; -} - -/* ------------------------------------------------------------------------- - FreeAllButtons - Free the whole array of buttons - ------------------------------------------------------------------------- */ -void FreeAllButtons(ButtonArray *array) -{ - Button *temp, *temp2; - - for(temp=array->head; temp!=NULL; ) { - temp2 = temp; - temp = temp->next; - ButtonDelete(temp2); - } -} - -/* ------------------------------------------------------------------------ - DrawButtonArray - Draw the whole array (all=1), or only those that need. - ------------------------------------------------------------------------ */ -void DrawButtonArray(ButtonArray *array, int all) -{ - Button *temp; - int x, y, n; - - x = 0; - y = array->y; - n = 1; - for(temp=array->head; temp!=NULL; temp=temp->next) { - if ((x + array->tw > array->w) && (n < NRows)) - { x = 0; y += RowHeight+2; ++n; } - if (temp->needsupdate || all) - ButtonDraw(temp, x + array->x, y, array->tw-3, array->h); - x += array->tw; - } -} - -/* ------------------------------------------------------------------------- - RadioButton - Enable button i and verify all others are disabled - ------------------------------------------------------------------------- */ -void RadioButton(ButtonArray *array, int butnum, int state) -{ - Button *button; - int i; - - for(button=array->head,i=0; button!=NULL; button=button->next,i++) { - if (i == butnum) { - button->state = state; - button->needsupdate = 1; - } else { - if (button->state != BUTTON_UP) { - button->state = BUTTON_UP; - button->needsupdate = 1; - } - } - } -} - -/* ------------------------------------------------------------------------- - WhichButton - Based on x,y which button was pressed - ------------------------------------------------------------------------- */ -int WhichButton(ButtonArray *array, int xp, int yp) -{ - int junkx, junky, junkz; - char *junkt; - - return LocateButton(array, xp, yp, &junkx, &junky, &junkt, &junkz); -} - -int LocateButton(ButtonArray *array, int xp, int yp, int *xb, int *yb, - char **name, int *trunc) -{ - Button *temp; - int num, x, y, n; - - if (xp < array->x || xp > array->x+array->w) return -1; - - x = 0; - y = array->y; - n = 1; - for(temp=array->head, num=0; temp!=NULL; temp=temp->next, num++) { - if((x + array->tw > array->w) && (n < NRows)) - { x = 0; y += RowHeight+2; ++n; } - if( xp >= x+array->x && xp <= x+array->x+array->tw-3 && - yp >= y && yp <= y+array->h) break; - x += array->tw; - } - - if (num<0 || num>array->count-1) num = -1; - - *xb = x+array->x; - *yb = y; - if (temp) { - *name = temp->title; - *trunc = temp->truncate; - } else { - *name = NULL; - } - - return num; -} diff --git a/app/fvwm/extras/FvwmTaskBar/ButtonArray.h b/app/fvwm/extras/FvwmTaskBar/ButtonArray.h deleted file mode 100644 index 42ca29748..000000000 --- a/app/fvwm/extras/FvwmTaskBar/ButtonArray.h +++ /dev/null @@ -1,63 +0,0 @@ -/* FvwmTaskBar Module for Fvwm95, based on the FvwmWinList module - * - * Copyright 1994, Mike Finger (mfinger@mermaid.micro.umn.edu or - * Mike_Finger@atk.com) - * - * The functions in this header file that are the original work of Mike Finger. - * - * No guarantees or warantees or anything are provided or implied in any way - * whatsoever. Use this program at your own risk. Permission to use this - * program for any purpose is given, as long as the copyright is kept intact. - * - * Things to do: Convert to C++ (In Progress) - */ - -#define DEFAULT_BTN_WIDTH 180 - -/* Button states */ - -#define BUTTON_UP 0 -#define BUTTON_DOWN 1 -#define BUTTON_BRIGHT 2 - -#define DONT_CARE -1 - -/* Struct definitions */ - -typedef struct button { - char *title; - int state, needsupdate, truncate; - struct button *next; - Picture p; -} Button; - -typedef struct { - int count; - Button *head, *tail; - int x, y, w, h, tw; -} ButtonArray; - -/* Function Prototypes */ - -void Draw3dRect(Window wn, int x, int y, int w, int h, int state); -Button *ButtonNew(char *title, Picture *p, int state); -int ButtonUpdate(Button *button, char *title, int state); -char *ButtonName(Button *button); -void InitArray(ButtonArray *array, int x, int y, int w, int h, int tw); -void UpdateArray(ButtonArray *array, int x, int y, int w, int h, int tw); -void AddButton(ButtonArray *array, char *title, Picture *p, int state); -int UpdateButton(ButtonArray *array, int butnum, char *title, int state); -int UpdateButtonPicture(ButtonArray *array, int butnum, Picture *p); -void RemoveButton(ButtonArray *array, int butnum); -Button *find_n(ButtonArray *array, int n); -void FreeButton(Button *ptr); -void FreeAllButtons(ButtonArray *array); -void DoButton(ButtonArray *array, Button *ptr, int x, int y, int w, int h); -void DrawButtonArray(ButtonArray *array, int all); -void RadioButton(ButtonArray *array, int butnum, int state); -int WhichButton(ButtonArray *array, int x, int y); -int LocateButton(ButtonArray *array, int xp, int yp, - int *xb, int *yb, - char **name, int *trunc); -void ArrangeButtonArray(ButtonArray *array); -void ButtonDraw(Button *button, int x, int y, int w, int h); diff --git a/app/fvwm/extras/FvwmTaskBar/Colors.c b/app/fvwm/extras/FvwmTaskBar/Colors.c deleted file mode 100644 index b0d50ea98..000000000 --- a/app/fvwm/extras/FvwmTaskBar/Colors.c +++ /dev/null @@ -1,101 +0,0 @@ -/* Part of the FvwmTaskBar Module for Fvwm. - * - * Copyright 1994, Mike Finger (mfinger@mermaid.micro.umn.edu or - * Mike_Finger@atk.com) - * - * The author makes not guarantees or warantees, either express or - * implied. Feel free to use any contained here for any purpose, as long - * and this and any other applicible copyrights are kept intact. - - * The functions in this source file were originally part of the GoodStuff - * and FvwmIdent modules for Fvwm, so there copyrights are also included: - * - * Copyright 1994, Robert Nation and Nobutaka Suzuki. - * No guarantees or warantees or anything - * are provided or implied in any way whatsoever. Use this program at your - * own risk. Permission to use this program for any purpose is given, - * as long as the copyright is kept intact. */ - -#include "config.h" -#include <stdio.h> -#include <X11/Xlib.h> -#include "Colors.h" - -extern Display *dpy; -extern Window Root; -extern char *Module; - -/**************************************************************************** - Loads a single color -*****************************************************************************/ -Pixel GetColor(char *name) -{ - XColor color; - XWindowAttributes attributes; - - XGetWindowAttributes(dpy,Root,&attributes); - color.pixel = 0; - if (!XParseColor (dpy, attributes.colormap, name, &color)) - nocolor("parse",name); - else if(!XAllocColor (dpy, attributes.colormap, &color)) - nocolor("alloc",name); - return color.pixel; -} - -/**************************************************************************** - This routine computes the hilight color from the background color -*****************************************************************************/ -Pixel GetHilite(Pixel background) -{ - XColor bg_color, white_p; - XWindowAttributes attributes; - - XGetWindowAttributes(dpy,Root,&attributes); - - bg_color.pixel = background; - XQueryColor(dpy,attributes.colormap,&bg_color); - - white_p.pixel = GetColor("white"); - XQueryColor(dpy,attributes.colormap,&white_p); - - bg_color.red = max((white_p.red/5), bg_color.red); - bg_color.green = max((white_p.green/5), bg_color.green); - bg_color.blue = max((white_p.blue/5), bg_color.blue); - - bg_color.red = min(white_p.red, (bg_color.red*140)/100); - bg_color.green = min(white_p.green, (bg_color.green*140)/100); - bg_color.blue = min(white_p.blue, (bg_color.blue*140)/100); - - if(!XAllocColor(dpy,attributes.colormap,&bg_color)) - nocolor("alloc hilight",""); - - return bg_color.pixel; -} - -/**************************************************************************** - This routine computes the shadow color from the background color -*****************************************************************************/ -Pixel GetShadow(Pixel background) -{ - XColor bg_color; - XWindowAttributes attributes; - - XGetWindowAttributes(dpy,Root,&attributes); - - bg_color.pixel = background; - XQueryColor(dpy,attributes.colormap,&bg_color); - - bg_color.red = (unsigned short)((bg_color.red*60)/100); /* was 50% */ - bg_color.green = (unsigned short)((bg_color.green*60)/100); - bg_color.blue = (unsigned short)((bg_color.blue*60)/100); - - if(!XAllocColor(dpy,attributes.colormap,&bg_color)) - nocolor("alloc shadow",""); - - return bg_color.pixel; -} - -void nocolor(char *a, char *b) -{ - fprintf(stderr,"%s: can't %s %s\n", Module, a, b); -} diff --git a/app/fvwm/extras/FvwmTaskBar/Colors.h b/app/fvwm/extras/FvwmTaskBar/Colors.h deleted file mode 100644 index f9797cbfa..000000000 --- a/app/fvwm/extras/FvwmTaskBar/Colors.h +++ /dev/null @@ -1,19 +0,0 @@ -/* Part of the FvwmTaskBar Module for Fvwm. - * - * The functions in this header file were originally part of the GoodStuff - * and FvwmIdent modules for Fvwm, so there copyrights are listed: - * - * Copyright 1994, Robert Nation and Nobutaka Suzuki. - * No guarantees or warantees or anything - * are provided or implied in any way whatsoever. Use this program at your - * own risk. Permission to use this program for any purpose is given, - * as long as the copyright is kept intact. */ - -#include <X11/Intrinsic.h> - -/* Function Prototypes */ -Pixel GetColor(char *name); -Pixel GetHilite(Pixel background); -Pixel GetShadow(Pixel background); -void nocolor(char *a, char *b); - diff --git a/app/fvwm/extras/FvwmTaskBar/FvwmTaskBar.1 b/app/fvwm/extras/FvwmTaskBar/FvwmTaskBar.1 deleted file mode 100644 index 9a4d53aaf..000000000 --- a/app/fvwm/extras/FvwmTaskBar/FvwmTaskBar.1 +++ /dev/null @@ -1,240 +0,0 @@ -.\" t -.\" @(#)FvwmTaskBar.1 6/30/96 -.TH FvwmTaskBar 2.6 "June 30th, 1996" -.UC -.SH NAME -FvwmTaskBar \- the FVWM taskbar module -.SH SYNOPSIS -FvwmTaskBar is spawned by FVWM, so no command line invocation will work. - -.SH DESCRIPTION -The FvwmTaskBar module provides a taskbar made up of buttons arranged by -rows, each corresponding to a window that FVWM is managing. -Clicking on first button gives focus to the corresponding toplevel window; -clicking on the middle button will hide a toplevel window; third mouse button -is reserved for a future extension (context menu). -Like the other modules, FvwmTaskBar only works when fvwm is used as the -window manager. - -When started, the taskbar shows up as a single row of buttons filling the -full width of the screen, but during the work can be resized to accomodate -up to 8 rows. In adition, if the AutoStick option is used, the taskbar -will autoposition itself at the top or bottom of the screen, and can be -dragged from one position to another with a normal move operation. - -The first button of the taskbar, labelled "Start" sends a "Popup -StartMenu" command to the FVWM, which can be used to pop-up a -general-purpose menu when the button is pressed. - -The FvwmTaskBar also displays at the right side a window showing the -current time and the built-in incoming mail indicator. - -.SH COPYRIGHTS -The FvwmTaskBar module is derivated from Mike Finger's FvwmWinList. - -Copyright 1994, Mike Finger. The author makes no guarantees or warranties of -any kind about the use of this module. Use this modules at your own risk. -You may freely use this module or any portion of it for any purpose as long -as the copyright is kept intact. - -.SH INITIALIZATION -During initialization, \fIFvwmTaskBar\fP gets configuration information -from FVWM to find the options that pertain to it. -These options are discussed in a later section. - -.SH INVOCATION -FvwmTaskBar can be invoked by fvwm during initialization by inserting the -line 'Module FvwmTaskBar' in the .fvwm2rc file. - -FvwmTaskBar must reside in a directory that is listed in the ModulePath -option of FVWM for it to be executed by FVWM. - -.SH CONFIGURATION OPTIONS -The following options can be placed in the .fvwm2rc file - -.IP "*FvwmTaskBarGeometry \fI{+-}<X>x{+-}<Y>\fP" -Specifies the location and gravity of the FvwmTaskBar window. At the -current version, size is not supported and the taskbar will resize itself -to fill the full witdh of the screen. If the AutoStick option is also -specified, the module will automatically "stick" to the top or the bottom -of the screen, whichever is closest to the geometry specification. - -.IP "*FvwmTaskBarFont \fIfont\fP" -Specifies the default font to be used for labeling the buttons, when they -are not depressed. If not specified, fixed font is assumed. - -.IP "*FvwmTaskBarSelFont \fIfont\fP" -Specifies the font to be used for the depressed buttons. Note that the -Start button will use always this font even if is not pressed. If this -option is not specified, the default font is used instead. - -.IP "*FvwmTaskBarStatusFont \fIfont\fP" -Specifies the font to be used for the clock and tip windows. If this -option is not specified, fixed font is used. - -.IP "*FvwmTaskBarFore \fIcolor\fP" -Specifies the color to use for the button names. - -.IP "*FvwmTaskBarBack \fIcolor\fP" -Specifies the background color for the bar and buttons. - -.IP "*FvwmTaskBarTipsFore \fIcolor\fP" -Specifies the color to be used for the text in the tips windows. - -.IP "*FvwmTaskBarTipsBack \fIcolor\fP" -Specifies the background color for the tips windows. - -.IP "*FvwmTaskBarGeometry \fIgeometry\fP" -This option specifies the geometry of the window (only the Y coordinate is -useful) - -.IP "*FvwmTaskBarAutoStick" -This option causes the taskbar to "stick" either to the top or bottom -of the screen, whichever is closest to the initial window placement. Any -further move operation is also subject to that behaviour. - -.IP "*FvwmTaskBarAutoHide" -This option causes the taskbar to disappear leaving a narrow strip at the -bottom of the screen, and reappears only when the mouse is moved to that -strip. This option automatically enables AutoStick. - -.IP "*FvwmTaskBarUseSkipList" -Tells FvwmTaskBar to not show the windows that are listed on a WindowListSkip -line in the configuration file. - -.IP "*FvwmTaskBarUseIconNames" -Tells FvwmTaskBar to use the icon name of the window instead of the full -window name. This is useful to keep the width of the buttons small. - -.IP "*FvwmTaskBarShowTransients" -Tells FvwmTaskBar to show the application transient windows also. By default -they are not shown. - -.IP "*FvwmTaskBarAction \fIaction response[,response...]\fP" -Tells FvwmTaskBar to do \fIresponse\fP when \fIaction\fP is done. The -currently supported \fIaction\fPs are: Click1, Click2, Click3. The currently -supported \fIresponse\fPs are any fvwm built-in commands, including modules -and functions. -The configuration example below shows the default values. - -.IP "*FvwmTaskBarButtonWidth \fIwidth\fP" -Indicates the maximum width that window buttons should reach. -(the minimum is hardcoded at 32). - -.IP "*FvwmTaskBarHighlightFocus" -If the mouse pointer is over the taskbar, the window under the current -button is active. This behavior is like the TVTWM Icon Manager or -FvwmIconMan. \fINote:\fP If you use this option combined with FollowMouse -focus style, you'll want the taskbar to be ClickToFocus. - -.IP "*FvwmTaskBarShowTips" -Enables the tips windows (by default disabled). - -.SH "" - -The following options deal more specifically with the status indicators -displayed at the rigth of the taskbar. - -.IP "*FvwmTaskBarClockFormat \fIformat-string\fP" -This option specifies the time format for the digital clock. -It is a \fIstfrtime(3)\fP compatible format string. -By default it is "%R". - -.IP "*FvwmTaskBarUpdateInterval \fIseconds\fP" -Specifies how often the clock display should be refreshed, so that times of -the form HH:MM:SS can be used. By default 60 seconds. - -.IP "*FvwmTaskBarBellVolume \fIvolume\fP" -This sets the volume of the bell when mail is detected. -It is a value between 0 (no bell) and 100 (maximum volume). -By default it is set to 20. - -.IP "*FvwmTaskBarMailBox \fIpath\fP" -This option intructs the module to look for mail at the specified place -It is a full pathname to the user's mailbox. -By default it is \fI/var/spool/mail/$USER_LOGIN\fP. -A value of 'None' instructs the module not to have a mail indicator. - -.IP "*FvwmTaskBarMailCommand \fIcommand\fP" -Specifies a \fIfvwm\fP command to be executed when double-clicking -on the mail icon. - -.IP "*FvwmTaskBarIgnoreOldMail" -If set, draw no bitmap if there is no new mail. - -.SH "" -The following options deal with the Start button at the left of the taskbar: - -.IP "*FvwmTaskBarStartName \fIstring\fP" -This option specifies the string displayed in the Start button. -('Start' by default). - -.IP "*FvwmTaskBarStartMenu \fIstring\fP" -This option specifies the popup to invoke when the start button is pressed. -('StartMenu' by default). The module send a 'Popup StartMenu' command to -the fvwm window manager. - -.IP "*FvwmTaskBarStartIcon \fIicon-name\fP" -This option specifies the name of the icon to display at the left of the Start -button. - -.SH SAMPLE CONFIGURATION -The following are excepts from a .fvwm2rc file which describe FvwmTaskBar -initialization commands: - -.nf -.sp -# -# Start the taskbar on fvwm startup and restart -# - -AddToFunc "InitFunction" "I" Module FvwmTaskBar - -AddToFunc "RestartFunction" "I" Module FvwmTaskBar - -# -# Set the style for the taskbar window, keep always on top of another -# windows -# - -Style "FvwmTaskBar" NoTitle,BorderWidth 4, HandleWidth 4,Sticky, -StaysOnTop,WindowSkipList,CirculateSkip - -#------------------------------------ taskbar -*FvwmTaskBarBack #c3c3c3 -*FvwmTaskBarFore black -*FvwmTaskBarTipsBack bisque -*FvwmTaskBarTipsFore black -*FvwmTaskBarGeometry +0-1 -*FvwmTaskBarFont -adobe-helvetica-medium-r-*-*-14-*-*-*-*-*-*-* -*FvwmTaskBarSelFont -adobe-helvetica-bold-r-*-*-14-*-*-*-*-*-*-* -*FvwmTaskBarStatusFont fixed - -*FvwmTaskBarAction Click1 Iconify -1, Raise -*FvwmTaskBarAction Click2 Iconify +1, Lower -*FvwmTaskBarAction Click3 Iconify -1, Raise - -*FvwmTaskBarUseSkipList -*FvwmTaskBarUseIconNames -*FvwmTaskBarAutoStick -*FvwmTaskBarShowTips - -*FvwmTaskBarButtonWidth 180 -*FvwmTaskBarBellVolume 20 -*FvwmTaskBarMailBox /var/spool/mail/ -*FvwmTaskBarMailCommand Exec xterm -e mail -*FvwmTaskBarClockFormat %I:%M %p - -*FvwmTaskBarStartName Start -*FvwmTaskBarStartMenu StartMenu -*FvwmTaskBarStartIcon mini-exp.xpm - -.sp -.fi - -.SH BUGS -There is a bug report that FvwmTaskBar doesn't work well with -Autohide turned on. - -.SH AUTHOR -David Barth (barth@di.epfl.ch) diff --git a/app/fvwm/extras/FvwmTaskBar/FvwmTaskBar.c b/app/fvwm/extras/FvwmTaskBar/FvwmTaskBar.c deleted file mode 100644 index cd4df89d1..000000000 --- a/app/fvwm/extras/FvwmTaskBar/FvwmTaskBar.c +++ /dev/null @@ -1,1437 +0,0 @@ -/* FvwmTaskBar Module for Fvwm. - * - * (Much reworked version of FvwmWinList) - * Copyright 1994, Mike Finger (mfinger@mermaid.micro.umn.edu or - * Mike_Finger@atk.com) - * Minor hack by TKP to enable autohide to work with pages (leaves 2 pixels - * visible so that the 1 pixel panframes don't get in the way) - * - * The author makes not guarantees or warantees, either express or - * implied. Feel free to use any contained here for any purpose, as long - * and this and any other applicable copyrights are kept intact. - - * The functions in this source file that are based on part of the FvwmIdent - * module for Fvwm are noted by a small copyright atop that function, all others - * are copyrighted by Mike Finger. For those functions modified/used, here is - * the full, original copyright: - * - * Copyright 1994, Robert Nation and Nobutaka Suzuki. - * No guarantees or warantees or anything - * are provided or implied in any way whatsoever. Use this program at your - * own risk. Permission to use this program for any purpose is given, - * as long as the copyright is kept intact. */ - -#include "config.h" - -#include <stdio.h> -#include <signal.h> -#include <fcntl.h> -#include <string.h> -#include <sys/wait.h> -#include <sys/time.h> -#include <sys/stat.h> -#include <stdarg.h> - -#if HAVE_SYS_SELECT_H -#include <sys/select.h> -#endif - -#include <unistd.h> -#include <ctype.h> - -#ifdef HAVE_SYS_BSDTYPES_H -#include <sys/bsdtypes.h> /* Saul */ -#endif /* Saul */ - -#include <stdlib.h> -#include <X11/Xlib.h> -#include <X11/Xutil.h> -#include <X11/Xproto.h> -#include <X11/Xatom.h> -#include <X11/Intrinsic.h> -#include <X11/cursorfont.h> - -#include "../../fvwm/module.h" -#include "../../libs/fvwmlib.h" /* for pixmaps routines */ - - -#include "FvwmTaskBar.h" -#include "ButtonArray.h" -#include "List.h" -#include "Colors.h" -#include "Mallocs.h" -#include "Goodies.h" -#include "Start.h" - - -#define GRAB_EVENTS (ButtonPressMask|ButtonReleaseMask|ButtonMotionMask|EnterWindowMask|LeaveWindowMask) -#define SomeButtonDown(a) ((a)&Button1Mask||(a)&Button2Mask||(a)&Button3Mask) - -#define DEFAULT_CLICK1 "Iconify -1, Raise, Focus" -#define DEFAULT_CLICK2 "Iconify +1, Lower" -#define DEFAULT_CLICK3 "Nop" - -#define gray_width 8 -#define gray_height 8 -unsigned char gray_bits[] = { 0xaa, 0x55, 0xaa, 0x55, - 0xaa, 0x55, 0xaa, 0x55 }; -GC checkered; - -/* File type information */ -FILE *console; -int fd_width; -int Fvwm_fd[2]; -int x_fd; - -/* X related things */ -Display *dpy; -Window Root, win; -int screen, d_depth; -Pixel back, fore; -GC graph, shadow, hilite, blackgc, whitegc; -XFontStruct *ButtonFont, *SelButtonFont; -int fontheight; -static Atom wm_del_win; -Atom MwmAtom = None; - -/* Module related information */ -char *Module; -int win_width = 5, - win_height = 5, - win_grav, - win_x, - win_y, - win_border, - button_width = DEFAULT_BTN_WIDTH, - Clength, - ButPressed = -1, - ButReleased = -1, - Checked = 0, - BelayHide = False, - AlarmSet = NOT_SET; - -int UpdateInterval = 30; - -ButtonArray buttons; -List windows; -List swallowed; - -char *ClickAction[3] = { DEFAULT_CLICK1, DEFAULT_CLICK2, DEFAULT_CLICK3 }, - *EnterAction, - *BackColor = "white", - *ForeColor = "black", - *geometry = NULL, - *font_string = "fixed", - *selfont_string = NULL; - -int UseSkipList = False, - UseIconNames = False, - ShowTransients = False, - adjust_flag = False, - AutoStick = False, - AutoHide = False, - HighlightFocus = False; - -unsigned int ScreenWidth, ScreenHeight; - -int NRows, RowHeight, Midline; - -/* Imported from Goodies */ -extern int stwin_width, goodies_width; -extern TipStruct Tip; - -/* Imported from Start */ -extern int StartButtonWidth, StartButtonHeight; -extern char *StartPopup; - -Colormap PictureCMap; - -char *IconPath = NULL, - *PixmapPath = NULL; - -static void ParseConfigLine(char *tline); - -/****************************************************************************** - Main - Setup the XConnection,request the window list and loop forever - Based on main() from FvwmIdent: - Copyright 1994, Robert Nation and Nobutaka Suzuki. -******************************************************************************/ -int main(int argc, char **argv) -{ - char *temp, *s; - - /* Save the program name for error messages and config parsing */ - temp = argv[0]; - s=strrchr(argv[0], '/'); - if (s != NULL) - temp = s + 1; - - /* Setup my name */ - Module = safemalloc(strlen(temp)+2); - strcpy(Module,"*"); - strcat(Module, temp); - Clength = strlen(Module); - - /* Open the console for messages */ - OpenConsole(); - - if((argc != 6)&&(argc != 7)) { - fprintf(stderr,"%s Version %s should only be executed by fvwm!\n",Module, - VERSION); - ConsoleMessage("%s Version %s should only be executed by fvwm!\n",Module, - VERSION); - exit(1); - } - - /* setup fvwm pipes */ - Fvwm_fd[0] = atoi(argv[1]); - Fvwm_fd[1] = atoi(argv[2]); - fd_width = GetFdWidth(); - - signal (SIGPIPE, DeadPipe); - signal (SIGALRM, Alarm); - - SetMessageMask(Fvwm_fd,M_ADD_WINDOW | M_CONFIGURE_WINDOW | M_DESTROY_WINDOW | - M_WINDOW_NAME | M_ICON_NAME | M_RES_NAME | M_DEICONIFY | M_ICONIFY | - M_END_WINDOWLIST | M_FOCUS_CHANGE | - M_CONFIG_INFO | M_END_CONFIG_INFO -#ifdef FVWM95 - | M_FUNCTION_END | - M_SCROLLREGION -#endif -#ifdef MINI_ICONS - | M_MINI_ICON -#endif - ); - - /* Parse the config file */ - InitList(&swallowed); - - ParseConfig(); - - /* Setup the XConnection */ - StartMeUp(); - XSetErrorHandler((XErrorHandler) ErrorHandler); - - InitPictureCMap(dpy, Root); - - StartButtonInit(RowHeight); - - /* init the array of buttons */ - InitArray(&buttons, StartButtonWidth + 4, 0, - win_width - stwin_width - 8 - StartButtonWidth -10, - RowHeight, button_width); - InitList(&windows); - - /* Request a list of all windows, - * wait for ConfigureWindow packets */ - SendFvwmPipe("Send_WindowList",0); - - /* Receive all messages from Fvwm */ - EndLessLoop(); - return 0; -} - - -/****************************************************************************** - EndLessLoop - Read and redraw until we get killed, blocking when can't read -******************************************************************************/ -void EndLessLoop() -{ - fd_set readset; - struct timeval tv; - - while(1) { - FD_ZERO(&readset); - FD_SET(Fvwm_fd[1], &readset); - FD_SET(x_fd, &readset); - XPending(dpy); - tv.tv_sec = 0; - tv.tv_usec = 0; - if (!select(fd_width, SELECT_TYPE_ARG234 &readset, NULL, NULL, &tv)) { - while(1) { - FD_ZERO(&readset); - FD_SET(Fvwm_fd[1], &readset); - FD_SET(x_fd, &readset); - XPending(dpy); - tv.tv_sec = UpdateInterval; - tv.tv_usec = 0; - if (select(fd_width, SELECT_TYPE_ARG234 &readset, NULL, NULL, &tv) - <= 0) - DrawGoodies(); - else - break; - } - } - - if (FD_ISSET(x_fd, &readset)) - LoopOnEvents(); - - if (FD_ISSET(Fvwm_fd[1], &readset)) { - ReadFvwmPipe(); - DrawGoodies(); - } - - } -} - - -/****************************************************************************** - ReadFvwmPipe - Read a single message from the pipe from Fvwm - Originally Loop() from FvwmIdent: - Copyright 1994, Robert Nation and Nobutaka Suzuki. -******************************************************************************/ -void ReadFvwmPipe() -{ - unsigned long header[HEADER_SIZE],*body; - - if(ReadFvwmPacket(Fvwm_fd[1],header,&body) > 0) - { - ProcessMessage(header[1],body); - free(body); - } -} - -/****************************************************************************** - ProcessMessage - Process the message coming from Fvwm - Skeleton based on processmessage() from FvwmIdent: - Copyright 1994, Robert Nation and Nobutaka Suzuki. -******************************************************************************/ -void ProcessMessage(unsigned long type,unsigned long *body) -{ - int redraw=-1; - int i; - long flags; - char *string; - Picture p; - - switch(type) { - case M_FOCUS_CHANGE: - i = FindItem(&windows, body[0]); - if (win != body[0]) { /* This case is handled in LoopOnEvents() */ - if (ItemFlags(&windows, body[0]) & ICONIFIED) i = -1; - RadioButton(&buttons, i, BUTTON_BRIGHT); - ButPressed = i; - ButReleased = -1; - redraw = 0; - } - break; - - case M_ADD_WINDOW: - case M_CONFIGURE_WINDOW: - /* Matched only at startup when default border width and - actual border width differ. Don't assign win_width here so - Window redraw and rewarping gets handled by XEvent - ConfigureNotify code. */ - if (!ShowTransients && (body[8] & TRANSIENT)) break; - if (body[0] == win) { - if (win_border != (int)body[10]) { - win_x = win_border = (int)body[10]; - - if (win_y > Midline) - win_y = ScreenHeight - (AutoHide ? 2 : win_height + win_border); - else - win_y = AutoHide ? 2 - win_height : win_border; - - XMoveResizeWindow(dpy, win, win_x, win_y, - ScreenWidth-(win_border<<1), win_height); - - } - break; - } - - if (FindItem(&windows,body[0]) != -1) break; - if (!(body[8] & WINDOWLISTSKIP) || !UseSkipList) { - AddItem(&windows, body[0], body[8]); - } - break; - - case M_DESTROY_WINDOW: - if ((i = DeleteItem(&windows, body[0])) == -1) break; - if (FindItem(&swallowed, body[0]) != -1) break; - RemoveButton(&buttons, i); - redraw = 1; - break; - -#ifdef MINI_ICONS - case M_MINI_ICON: - if ((i = FindItem(&windows, body[0])) == -1) break; - if (UpdateButton(&buttons, i, NULL, DONT_CARE) != -1) { - p.picture = body[6]; - p.mask = body[7]; - p.width = body[3]; - p.height = body[4]; - p.depth = body[5]; - UpdateButtonPicture(&buttons, i, &p); - redraw = 0; - } - break; -#endif - - case M_WINDOW_NAME: - case M_ICON_NAME: - if ((type == M_ICON_NAME && !UseIconNames) || - (type == M_WINDOW_NAME && UseIconNames)) break; - string = (char *) &body[3]; - if ((i = FindNameItem(&swallowed, string)) != -1) { - if (ItemIndexFlags(&swallowed, i) == F_NOT_SWALLOWED) { - Swallow(body); - break; - } - } - if ((i = UpdateItemName(&windows, body[0], (char *)&body[3])) == -1) - break; - if (UpdateButton(&buttons, i, string, DONT_CARE) == -1) - { - AddButton(&buttons, string, NULL, BUTTON_UP); - redraw = 1; - } - else - redraw = 0; - break; - - case M_DEICONIFY: - case M_ICONIFY: - if ((i = FindItem(&windows, body[0])) == -1) break; - flags = ItemFlags(&windows, body[0]); - if (type == M_DEICONIFY && !(flags & ICONIFIED)) break; - if (type == M_ICONIFY && flags & ICONIFIED) break; - flags ^= ICONIFIED; - if (type == M_ICONIFY && i == ButReleased) { - RadioButton(&buttons, -1, BUTTON_UP); - ButReleased = ButPressed = -1; - redraw = 0; - } - UpdateItemFlags(&windows, body[0], flags); - break; - - case M_END_WINDOWLIST: - XMapRaised(dpy, win); - break; - -#ifdef FVWM95 - case M_FUNCTION_END: - StartButtonUpdate(NULL, BUTTON_UP); - - if (AutoHide && !BelayHide) /* We don't want the taskbar to hide */ - SetAlarm(HIDE_TASK_BAR); /* after a Focus or Iconify function */ - - redraw = 0; - break; - - /* Added a new Fvwm Event because scrolling regions interfere - with EnterNotify event when taskbar is hidden. */ - case M_SCROLLREGION: - if (AutoHide && ((win_y < Midline && body[1] < 4) || - (win_y >= Midline && body[1] > ScreenHeight-4))) - RevealTaskBar(); - break; - -#endif /*FVWM95*/ - - case M_NEW_DESK: - break; - - case M_NEW_PAGE: - break; - - } - - if (redraw >= 0) RedrawWindow(redraw); -} - -/****************************************************************************** - SendFvwmPipe - Send a message back to fvwm - Based on SendInfo() from FvwmIdent: - Copyright 1994, Robert Nation and Nobutaka Suzuki. -******************************************************************************/ -void SendFvwmPipe(char *message, unsigned long window) -{ - int w; - char *hold, *temp, *temp_msg; - - hold = message; - - while(1) { - temp = strchr(hold, ','); - if (temp != NULL) { - temp_msg = malloc(temp-hold+1); - strncpy(temp_msg, hold, (temp-hold)); - temp_msg[(temp-hold)] = '\0'; - hold = temp+1; - } else temp_msg = hold; - - write(Fvwm_fd[0], &window, sizeof(unsigned long)); - - w=strlen(temp_msg); - write(Fvwm_fd[0], &w, sizeof(int)); - write(Fvwm_fd[0], temp_msg, w); - - /* keep going */ - w = 1; - write(Fvwm_fd[0], &w, sizeof(int)); - - if(temp_msg != hold) - free(temp_msg); - else - break; - } -} - -/*********************************************************************** - Detected a broken pipe - time to exit - Based on DeadPipe() from FvwmIdent: - Copyright 1994, Robert Nation and Nobutaka Suzuki. - **********************************************************************/ -void DeadPipe(int nonsense) -{ - ConsoleMessage("received SIGPIPE signal: exiting...\n"); - ShutMeDown(1); -} - -/****************************************************************************** - WaitForExpose - Used to wait for expose event so we don't draw too early -******************************************************************************/ -void WaitForExpose(void) -{ - XEvent Event; - - while(1) { - XNextEvent(dpy, &Event); - if (Event.type == Expose) { - if (Event.xexpose.count == 0) break; - } - } -} - -/****************************************************************************** - RedrawWindow - Update the needed lines and erase any old ones -******************************************************************************/ -void RedrawWindow(int force) -{ - if (Tip.open) RedrawTipWindow(); - if (force) { - XClearArea (dpy, win, 0, 0, win_width, win_height, False); - DrawGoodies(); - } - DrawButtonArray(&buttons, force); - StartButtonDraw(force); - if (XQLength(dpy) && !force) LoopOnEvents(); -} - -/****************************************************************************** - ConsoleMessage - Print a message on the console. Works like printf. -******************************************************************************/ -void ConsoleMessage(char *fmt, ...) -{ -#ifndef NO_CONSOLE - va_list args; - FILE *filep; - - if (console == NULL) - filep = stderr; - else - filep = console; - va_start(args, fmt); - vfprintf(filep, fmt, args); - va_end(args); - fflush(console); -#endif -} - -/****************************************************************************** - OpenConsole - Open the console as a way of sending messages -******************************************************************************/ -int OpenConsole() -{ -#ifndef NO_CONSOLE - if ((console = fopen("/dev/console","w")) == NULL) { - fprintf(stderr, "%s: cannot open console\n", Module); - return 0; - } -#endif - return 1; -} - -void ParseConfig() { - char *buf; - while (GetConfigLine(Fvwm_fd,&buf), buf != NULL) { - ParseConfigLine(buf); - } /* end config lines */ -} /* end function */ - -static void ParseConfigLine(char *tline) { - char *str; - int i, j; - - while (isspace(*tline))tline++; - if(strncasecmp(tline, CatString3(Module, "Font",""),Clength+4)==0) - CopyString(&font_string,&tline[Clength+4]); - else if(strncasecmp(tline, CatString3(Module, "SelFont",""),Clength+7)==0) - CopyString(&selfont_string,&tline[Clength+7]); - else if(strncasecmp(tline,CatString3(Module,"Fore",""), Clength+4)==0) { - CopyString(&ForeColor,&tline[Clength+4]); - } else if(strncasecmp(tline,CatString3(Module, "Geometry",""), Clength+8)==0) { - str = &tline[Clength+9]; - while(((isspace(*str))&&(*str != '\n'))&&(*str != 0)) str++; - str[strlen(str)-1] = 0; - UpdateString(&geometry,str); - } else if(strncasecmp(tline,CatString3(Module, "Back",""), Clength+4)==0) - CopyString(&BackColor,&tline[Clength+4]); - else if(strncasecmp(tline,CatString3(Module, "Action",""), Clength+6)==0) - LinkAction(&tline[Clength+6]); - else if(strncasecmp(tline,CatString3(Module, "UseSkipList",""), - Clength+11)==0) UseSkipList=True; - else if(strncasecmp(tline,CatString3(Module, "AutoStick",""), - Clength+9)==0) AutoStick=True; - else if(strncasecmp(tline,CatString3(Module, "AutoHide",""), - Clength+4)==0) { AutoHide=True; AutoStick=True; } - else if(strncasecmp(tline,CatString3(Module, "UseIconNames",""), - Clength+12)==0) UseIconNames=True; - else if(strncasecmp(tline,CatString3(Module, "ShowTransients",""), - Clength+14)==0) ShowTransients=True; - else if(strncasecmp(tline,CatString3(Module, "UpdateInterval",""), - Clength+14)==0) - UpdateInterval=atoi(&tline[Clength+14]); - else if(strncasecmp(tline,CatString3(Module, "HighlightFocus",""), - Clength+14)==0) HighlightFocus=True; - else if(strncasecmp(tline,CatString3(Module, "SwallowModule",""), - Clength+13)==0) { - - /* tell fvwm to launch the module for us */ - str = safemalloc(strlen(&tline[Clength+13]) + 6); - sprintf(str, "Module %s",&tline[Clength+13]); - ConsoleMessage("Trying to: %s", str); - SendFvwmPipe(str, 0); - - /* Remember the anticipated window's name for swallowing */ - i = 4; - while((str[i] != 0)&& - (str[i] != '"')) - i++; - j = ++i; - while((str[i] != 0)&& - (str[i] != '"')) - i++; - if (i > j) { - str[i] = 0; - ConsoleMessage("Looking for window: [%s]\n", &str[j]); - AddItemName(&swallowed, &str[j], F_NOT_SWALLOWED); - } - free(str); - } else if(strncasecmp(tline,CatString3(Module, "Swallow",""), - Clength+7)==0) { - - /* tell fvwm to Exec the process for us */ - str = safemalloc(strlen(&tline[Clength+7]) + 6); - sprintf(str, "Exec %s",&tline[Clength+7]); - ConsoleMessage("Trying to: %s", str); - SendFvwmPipe(str, 0); - - /* Remember the anticipated window's name for swallowing */ - i = 4; - while((str[i] != 0)&& - (str[i] != '"')) - i++; - j = ++i; - while((str[i] != 0)&& - (str[i] != '"')) - i++; - if (i > j) { - str[i] = 0; - ConsoleMessage("Looking for window: [%s]\n", &str[j]); - AddItemName(&swallowed, &str[j], F_NOT_SWALLOWED); - } - free(str); - } else if(strncasecmp(tline,"ButtonWidth",11) == 0) { - button_width = atoi(&tline[11]); - } else if(strncasecmp(tline,"IconPath",8) == 0) { - CopyString(&IconPath, &tline[8]); - } else if(strncasecmp(tline,"PixmapPath",10) == 0) { - CopyString(&PixmapPath, &tline[10]); - } else { - GoodiesParseConfig(tline, Module); - StartButtonParseConfig(tline, Module); - } -} - -/****************************************************************************** - Swallow a process window -******************************************************************************/ -void Swallow(unsigned long *body) { - XSizeHints hints; - long supplied; - int h,w; - - /* Swallow the window */ - XUnmapWindow(dpy, body[0]); - - if (!XGetWMNormalHints (dpy, (Window)body[0], &hints, &supplied)) - hints.flags = 0; - h = win_height - 10; w = 80; - ConstrainSize(&hints, &w, &h); - XResizeWindow(dpy,(Window)body[0], w, h); - - stwin_width += w + 2; - - XReparentWindow(dpy,(Window)body[0], win, - win_width - stwin_width + goodies_width + 2, 5); - goodies_width += w + 2; - - XMapWindow(dpy,body[0]); - XSelectInput(dpy,(Window)body[0], - PropertyChangeMask|StructureNotifyMask); - - - /* Do not swallow it next time */ - UpdateNameItem(&swallowed, (char*)&body[3], body[0], F_SWALLOWED); - ConsoleMessage("-> Swallowed: %s\n",(char*)&body[3]); - RedrawWindow(1); -} - -/****************************************************************************** - Alarm - Handle a SIGALRM - used to implement timeout events -******************************************************************************/ -void Alarm(int nonsense) { - - switch(AlarmSet) { - - case SHOW_TIP: - ShowTipWindow(1); - break; - - case HIDE_TASK_BAR: - HideTaskBar(); - break; - } - - AlarmSet = NOT_SET; - signal (SIGALRM, Alarm); -} - -/****************************************************************************** - CheckForTip - determine when to popup the tip window -******************************************************************************/ -void CheckForTip(int x, int y) { - int num, bx, by, trunc; - char *name; - - if (MouseInStartButton(x, y)) { - if (Tip.type != START_TIP) PopupTipWindow(3, 0, "Click here to start"); - Tip.type = START_TIP; - } - else if (MouseInMail(x, y)) { - if (Tip.type != MAIL_TIP) CreateMailTipWindow(); - Tip.type = MAIL_TIP; - } - else if (MouseInClock(x, y)) { - if (Tip.type != DATE_TIP) CreateDateWindow(); - Tip.type = DATE_TIP; - } - else { - num = LocateButton(&buttons, x, y, &bx, &by, &name, &trunc); - if (num != -1 && trunc) { - if ((Tip.type != num) || - (Tip.text == NULL) || (strcmp(name, Tip.text) != 0)) - PopupTipWindow(bx+3, by, name); - Tip.type = num; - } else { - Tip.type = NO_TIP; - } - } - - if (Tip.type != NO_TIP) { - if (!AlarmSet && !Tip.open) { - alarm(1); - AlarmSet = 1; - } - if (AlarmSet != SHOW_TIP && !Tip.open) - SetAlarm(SHOW_TIP); - } else { - if (AlarmSet) { - alarm(0); - AlarmSet = 0; - } - ClearAlarm(); - if (Tip.open) ShowTipWindow(0); - } -} - - -/****************************************************************************** - LoopOnEvents - Process all the X events we get -******************************************************************************/ -void LoopOnEvents() -{ - int num = 0; - char tmp[100]; - XEvent Event; - int x, y, redraw; - static unsigned long lasttime = 0L; - - while(XPending(dpy)) { - redraw = -1; - XNextEvent(dpy, &Event); - - switch(Event.type) { - case ButtonRelease: - num = WhichButton(&buttons, Event.xbutton.x, Event.xbutton.y); - if (num != -1) { - ButReleased = ButPressed; /* Avoid race fvwm pipe */ - BelayHide = True; /* Don't AutoHide when function ends */ - SendFvwmPipe(ClickAction[Event.xbutton.button-1], - ItemID(&windows, num)); - redraw = 0; - } - - if (HighlightFocus) { - if (num == ButPressed) RadioButton(&buttons, num, BUTTON_DOWN); - if (num != -1) SendFvwmPipe("Focus 0", ItemID(&windows, num)); - } - ButPressed = -1; - break; - - case ButtonPress: - RadioButton(&buttons, -1, BUTTON_UP); /* no windows focused anymore */ - if (MouseInStartButton(Event.xbutton.x, Event.xbutton.y)) { - StartButtonUpdate(NULL, BUTTON_DOWN); - x = win_x; - if (win_y < Midline) { - /* bar in top half of the screen */ - y = win_y + RowHeight; - } else { - /* bar in bottom of the screen */ - y = win_y - ScreenHeight; - } - sprintf(tmp,"Popup %s %d %d", StartPopup, x, y); - SendFvwmPipe(tmp, ItemID(&windows, num)); - } else if (MouseInMail(Event.xbutton.x, Event.xbutton.y)) { - HandleMailClick(Event); - } else { - num = WhichButton(&buttons, Event.xbutton.x, Event.xbutton.y); - UpdateButton(&buttons, num, NULL, (ButPressed == num) ? - BUTTON_BRIGHT : BUTTON_DOWN); - -/* UpdateButton(&buttons, num, NULL, BUTTON_DOWN);*/ - ButPressed = num; - } -/* else { / * Move taskbar * / - - XUngrabPointer(dpy, CurrentTime); - SendFvwmPipe("Move", win); - - } -*/ - redraw = 0; - break; - - case Expose: - if (Event.xexpose.count == 0) - if (Event.xexpose.window == Tip.win) - redraw = 0; - else - redraw = 1; - break; - - case ClientMessage: - if ((Event.xclient.format==32) && (Event.xclient.data.l[0]==wm_del_win)) - ShutMeDown(0); - break; - - case EnterNotify: - if (AutoHide) RevealTaskBar(); - - if (Event.xcrossing.mode != NotifyNormal) break; - num = WhichButton(&buttons, Event.xcrossing.x, Event.xcrossing.y); - if (!HighlightFocus) { - if (SomeButtonDown(Event.xcrossing.state)) { - if (num != -1) { - RadioButton(&buttons, num, BUTTON_DOWN); - ButPressed = num; - redraw = 0; - } else { - ButPressed = -1; - } - } - } else { - if (num != -1 && num != ButPressed) - SendFvwmPipe("Focus 0", ItemID(&windows, num)); - } - - CheckForTip(Event.xmotion.x, Event.xmotion.y); - break; - - case LeaveNotify: - ClearAlarm(); - if (Tip.open) ShowTipWindow(0); - - if (Event.xcrossing.mode != NotifyNormal) break; - - if (AutoHide) SetAlarm(HIDE_TASK_BAR); - - if (!HighlightFocus) { - if (SomeButtonDown(Event.xcrossing.state)) { - if (ButPressed != -1) { - RadioButton(&buttons, -1, BUTTON_UP); - ButPressed = -1; - redraw = 0; - } - } else { - if (ButReleased != -1) { - RadioButton(&buttons, -1, BUTTON_UP); - ButReleased = -1; - redraw = 0; - } - } - } - break; - - case MotionNotify: - num = WhichButton(&buttons, Event.xmotion.x, Event.xmotion.y); - if (!HighlightFocus) { - if (SomeButtonDown(Event.xmotion.state) && num != ButPressed) { - if (num != -1) { - RadioButton(&buttons, num, BUTTON_DOWN); - ButPressed = num; - } else { - RadioButton(&buttons, num, BUTTON_UP); - ButPressed = -1; - } - redraw = 0; - } - } else { - if (num != -1 && num != ButPressed) - SendFvwmPipe("Focus 0", ItemID(&windows, num)); - } - - CheckForTip(Event.xmotion.x, Event.xmotion.y); - break; - - case ConfigureNotify: - if ((Event.xconfigure.width != win_width || - Event.xconfigure.height != win_height)) { - AdjustWindow(Event.xconfigure.width, Event.xconfigure.height); - if (AutoStick) WarpTaskBar(win_y); - redraw = 1; - } - else if (Event.xconfigure.x != win_x || Event.xconfigure.y != win_y) { - if (AutoStick) { - WarpTaskBar(Event.xconfigure.y); - } else { - win_x = Event.xconfigure.x; - win_y = Event.xconfigure.y; - } - } - break; - } - - if (redraw >= 0) RedrawWindow(redraw); - - if (Event.xkey.time - lasttime > UpdateInterval*1000L) { - DrawGoodies(); - lasttime = Event.xkey.time; - } - } - -} - -/*********************************** - AdjustWindow - Resize the window - **********************************/ -void AdjustWindow(int width, int height) -{ - NRows = (height+2)/RowHeight; - win_height = height; - win_width = width; - ArrangeButtonArray(&buttons); -} - -/****************************************************************************** - makename - Based on the flags return me '(name)' or 'name' -******************************************************************************/ -char *makename(char *string,long flags) -{ - char *ptr; - - ptr=safemalloc(strlen(string)+3); - if (flags&ICONIFIED) strcpy(ptr,"("); - else strcpy(ptr,""); - strcat(ptr,string); - if (flags&ICONIFIED) strcat(ptr,")"); - return ptr; -} - -/****************************************************************************** - LinkAction - Link an response to a users action -******************************************************************************/ -void LinkAction(char *string) -{ -char *temp; - temp=string; - while(isspace(*temp)) temp++; - if(strncasecmp(temp, "Click1", 6)==0) - CopyString(&ClickAction[0],&temp[6]); - else if(strncasecmp(temp, "Click2", 6)==0) - CopyString(&ClickAction[1],&temp[6]); - else if(strncasecmp(temp, "Click3", 6)==0) - CopyString(&ClickAction[2],&temp[6]); - else if(strncasecmp(temp, "Enter", 5)==0) - CopyString(&EnterAction,&temp[5]); -} - -/****************************************************************************** - StartMeUp - Do X initialization things -******************************************************************************/ -void StartMeUp() -{ - XSizeHints hints; - XGCValues gcval; - unsigned long gcmask; - int ret; - - if (!(dpy = XOpenDisplay(""))) { - fprintf(stderr,"%s: can't open display %s", Module, - XDisplayName("")); - exit (1); - } - x_fd = XConnectionNumber(dpy); - screen= DefaultScreen(dpy); - Root = RootWindow(dpy, screen); - d_depth = DefaultDepth(dpy, screen); - - ScreenWidth = XDisplayWidth(dpy, screen); - ScreenHeight = XDisplayHeight(dpy, screen); - - Midline = (int) (ScreenHeight >> 1); - - if (selfont_string == NULL) selfont_string = font_string; - - if ((ButtonFont = XLoadQueryFont(dpy, font_string)) == NULL) { - if ((ButtonFont = XLoadQueryFont(dpy, "fixed")) == NULL) { - ConsoleMessage("Couldn't load fixed font. Exiting!\n"); - exit(1); - } - } - if ((SelButtonFont = XLoadQueryFont(dpy, selfont_string)) == NULL) { - if ((SelButtonFont = XLoadQueryFont(dpy, "fixed")) == NULL) { - ConsoleMessage("Couldn't load fixed font. Exiting!\n"); - exit(1); - } - } - - fontheight = SelButtonFont->ascent + SelButtonFont->descent; - - NRows = 1; - RowHeight = fontheight + 8; - - win_border = 4; /* default border width */ - win_height = RowHeight; - win_width = ScreenWidth - (win_border << 1); - - ret = XParseGeometry(geometry, &hints.x, &hints.y, - (unsigned int *)&hints.width, - (unsigned int *)&hints.height); - - if (ret & YNegative) - hints.y = ScreenHeight - (AutoHide ? 1 : win_height + (win_border<<1)); - else - hints.y = AutoHide ? 1 - win_height : 0; - - hints.flags=USPosition|PPosition|USSize|PSize|PResizeInc| - PWinGravity|PMinSize|PMaxSize|PBaseSize; - hints.x = 0; - hints.width = win_width; - hints.height = RowHeight; - hints.width_inc = win_width; - hints.height_inc = RowHeight+2; - hints.win_gravity = NorthWestGravity; - hints.min_width = win_width; - hints.min_height = RowHeight; - hints.min_height = win_height; - hints.max_width = win_width; - hints.max_height = RowHeight+7*(RowHeight+2) + 1; - hints.base_width = win_width; - hints.base_height = RowHeight; - - win_x = hints.x; - win_y = hints.y; - - if(d_depth < 2) { - back = GetColor("white"); - fore = GetColor("black"); - } else { - back = GetColor(BackColor); - fore = GetColor(ForeColor); - } - - win=XCreateSimpleWindow(dpy,Root,hints.x,hints.y, - hints.width,hints.height,0, - fore,back); - - wm_del_win=XInternAtom(dpy,"WM_DELETE_WINDOW",False); - XSetWMProtocols(dpy,win,&wm_del_win,1); - - XSetWMNormalHints(dpy,win,&hints); - - XGrabButton(dpy,1,AnyModifier,win,True,GRAB_EVENTS,GrabModeAsync, - GrabModeAsync,None,None); - XGrabButton(dpy,2,AnyModifier,win,True,GRAB_EVENTS,GrabModeAsync, - GrabModeAsync,None,None); - XGrabButton(dpy,3,AnyModifier,win,True,GRAB_EVENTS,GrabModeAsync, - GrabModeAsync,None,None); - - /* SetMwmHints(MWM_DECOR_ALL|MWM_DECOR_MAXIMIZE|MWM_DECOR_MINIMIZE, - MWM_FUNC_ALL|MWM_FUNC_MAXIMIZE|MWM_FUNC_MINIMIZE, - MWM_INPUT_MODELESS); - */ - gcmask = GCForeground | GCBackground | GCFont | GCGraphicsExposures; - gcval.foreground = fore; - gcval.background = back; - gcval.font = SelButtonFont->fid; - gcval.graphics_exposures = False; - graph = XCreateGC(dpy,Root,gcmask,&gcval); - - if(d_depth < 2) - gcval.foreground = GetShadow(fore); - else - gcval.foreground = GetShadow(back); - gcval.background = back; - gcmask = GCForeground | GCBackground | GCGraphicsExposures; - shadow = XCreateGC(dpy,Root,gcmask,&gcval); - - gcval.foreground = GetHilite(back); - gcval.background = back; - hilite = XCreateGC(dpy,Root,gcmask,&gcval); - - gcval.foreground = GetColor("white");; - gcval.background = back; - whitegc = XCreateGC(dpy,Root,gcmask,&gcval); - - gcval.foreground = GetColor("black"); - gcval.background = back; - blackgc = XCreateGC(dpy,Root,gcmask,&gcval); - - gcmask = GCForeground | GCBackground | GCTile | - GCFillStyle | GCGraphicsExposures; - gcval.foreground = GetHilite(back); - gcval.background = back; - gcval.fill_style = FillTiled; - gcval.tile = XCreatePixmapFromBitmapData(dpy, Root, (char *)gray_bits, - gray_width, gray_height, - gcval.foreground, gcval.background, d_depth); - checkered = XCreateGC(dpy, Root, gcmask, &gcval); - - XSelectInput(dpy,win,(ExposureMask | KeyPressMask | PointerMotionMask | - EnterWindowMask | LeaveWindowMask | - StructureNotifyMask)); - /* ResizeRedirectMask | */ - ChangeWindowName(&Module[1]); - - InitGoodies(); - -} - -/****************************************************************************** - ShutMeDown - Do X client cleanup -******************************************************************************/ -void ShutMeDown(int exitstat) -{ - FreeList(&windows); - FreeAllButtons(&buttons); - XFreeGC(dpy,graph); - XDestroyWindow(dpy, win); - XCloseDisplay(dpy); - exit(exitstat); -} - - -/****************************************************************************** - ChangeWindowName - Self explanitory - Original work from FvwmIdent: - Copyright 1994, Robert Nation and Nobutaka Suzuki. -******************************************************************************/ -void ChangeWindowName(char *str) -{ - XTextProperty name; - if (XStringListToTextProperty(&str,1,&name) == 0) { - fprintf(stderr,"%s: cannot allocate window name.\n",Module); - return; - } - XSetWMName(dpy,win,&name); - XSetWMIconName(dpy,win,&name); - XFree(name.value); -} - -/************************************************************************** - * - * Sets mwm hints - * - *************************************************************************/ -/* - * Now, if we (hopefully) have MWW - compatible window manager , - * say, mwm, ncdwm, or else, we will set useful decoration style. - * Never check for MWM_RUNNING property.May be considered bad. - */ - -void SetMwmHints(unsigned int value, unsigned int funcs, unsigned int input) -{ -PropMwmHints prop; - - if (MwmAtom==None) - { - MwmAtom=XInternAtom(dpy,"_MOTIF_WM_HINTS",False); - } - if (MwmAtom!=None) - { - /* sh->mwm.decorations contains OR of the MWM_DECOR_XXXXX */ - prop.decorations= value; - prop.functions = funcs; - prop.inputMode = input; - prop.flags = MWM_HINTS_DECORATIONS| MWM_HINTS_FUNCTIONS | MWM_HINTS_INPUT_MODE; - - /* HOP - LA! */ - XChangeProperty (dpy,win, - MwmAtom, MwmAtom, - 32, PropModeReplace, - (unsigned char *)&prop, - PROP_MWM_HINTS_ELEMENTS); - } -} - -/*********************************************************************** - * - * Procedure: - * ConstrainSize - adjust the given width and height to account for the - * constraints imposed by size hints - * - * The general algorithm, especially the aspect ratio stuff, is - * borrowed from uwm's CheckConsistency routine. - * - ***********************************************************************/ -void ConstrainSize (XSizeHints *hints, int *widthp, int *heightp) -{ -#define makemult(a,b) ((b==1) ? (a) : (((int)((a)/(b))) * (b)) ) -#define _min(a,b) (((a) < (b)) ? (a) : (b)) - - - int minWidth, minHeight, maxWidth, maxHeight, xinc, yinc, delta; - int baseWidth, baseHeight; - int dwidth = *widthp, dheight = *heightp; - - if(hints->flags & PMinSize) - { - minWidth = hints->min_width; - minHeight = hints->min_height; - if(hints->flags & PBaseSize) - { - baseWidth = hints->base_width; - baseHeight = hints->base_height; - } - else - { - baseWidth = hints->min_width; - baseHeight = hints->min_height; - } - } - else if(hints->flags & PBaseSize) - { - minWidth = hints->base_width; - minHeight = hints->base_height; - baseWidth = hints->base_width; - baseHeight = hints->base_height; - } - else - { - minWidth = 1; - minHeight = 1; - baseWidth = 1; - baseHeight = 1; - } - - if(hints->flags & PMaxSize) - { - maxWidth = hints->max_width; - maxHeight = hints->max_height; - } - else - { - maxWidth = 10000; - maxHeight = 10000; - } - if(hints->flags & PResizeInc) - { - xinc = hints->width_inc; - yinc = hints->height_inc; - } - else - { - xinc = 1; - yinc = 1; - } - - /* - * First, clamp to min and max values - */ - if (dwidth < minWidth) dwidth = minWidth; - if (dheight < minHeight) dheight = minHeight; - - if (dwidth > maxWidth) dwidth = maxWidth; - if (dheight > maxHeight) dheight = maxHeight; - - - /* - * Second, fit to base + N * inc - */ - dwidth = ((dwidth - baseWidth) / xinc * xinc) + baseWidth; - dheight = ((dheight - baseHeight) / yinc * yinc) + baseHeight; - - - /* - * Third, adjust for aspect ratio - */ -#define maxAspectX hints->max_aspect.x -#define maxAspectY hints->max_aspect.y -#define minAspectX hints->min_aspect.x -#define minAspectY hints->min_aspect.y - /* - * The math looks like this: - * - * minAspectX dwidth maxAspectX - * ---------- <= ------- <= ---------- - * minAspectY dheight maxAspectY - * - * If that is multiplied out, then the width and height are - * invalid in the following situations: - * - * minAspectX * dheight > minAspectY * dwidth - * maxAspectX * dheight < maxAspectY * dwidth - * - */ - - if (hints->flags & PAspect) - { - if (minAspectX * dheight > minAspectY * dwidth) - { - delta = makemult(minAspectX * dheight / minAspectY - dwidth, - xinc); - if (dwidth + delta <= maxWidth) - dwidth += delta; - else - { - delta = makemult(dheight - dwidth*minAspectY/minAspectX, - yinc); - if (dheight - delta >= minHeight) dheight -= delta; - } - } - - if (maxAspectX * dheight < maxAspectY * dwidth) - { - delta = makemult(dwidth * maxAspectY / maxAspectX - dheight, - yinc); - if (dheight + delta <= maxHeight) - dheight += delta; - else - { - delta = makemult(dwidth - maxAspectX*dheight/maxAspectY, - xinc); - if (dwidth - delta >= minWidth) dwidth -= delta; - } - } - } - - *widthp = dwidth; - *heightp = dheight; - return; -} - -/*********************************************************************** - WarpTaskBar -- Enforce AutoStick feature - ***********************************************************************/ -void WarpTaskBar(int y) { - win_x = win_border; - - if (y < Midline) - win_y = win_border; - else - win_y = (int)ScreenHeight - win_height - win_border; - - XMoveWindow(dpy, win, win_x, win_y); - if (AutoHide) SetAlarm(HIDE_TASK_BAR); - - /* Prevent oscillations caused by race with - time delayed TaskBarHide(). Is there any way - to prevent these Xevents from being sent - to the server in the first place? */ - PurgeConfigEvents(); -} - -/*********************************************************************** - RevealTaskBar -- Make taskbar fully visible - ***********************************************************************/ -void RevealTaskBar() { - ClearAlarm(); - - if (win_y < Midline) - win_y = win_border; - else - win_y = (int)ScreenHeight - win_height - win_border; - - BelayHide = False; - XMoveWindow(dpy, win, win_x, win_y); -} - -/*********************************************************************** - HideTaskbar -- Make taskbar partially visible - ***********************************************************************/ -void HideTaskBar() { - ClearAlarm(); - - if (win_y < Midline) - win_y = 2 - win_height; - else - win_y = (int)ScreenHeight - 2; - - XMoveWindow(dpy, win, win_x, win_y); -} - -/*********************************************************************** - SetAlarm -- Schedule a timeout event - ************************************************************************/ -void SetAlarm(int event) { - AlarmSet = event; - alarm(1); -} - -/*********************************************************************** - ClearAlarm -- Disable timeout events - ************************************************************************/ -void ClearAlarm(void) { - if(AlarmSet) { - AlarmSet = NOT_SET; - alarm(0); - } -} - -/*********************************************************************** - PurgeConfigEvents -- Wait for and purge ConfigureNotify events. - ************************************************************************/ -void PurgeConfigEvents(void) { - XEvent Event; - - XPeekEvent(dpy, &Event); - while (XCheckTypedWindowEvent(dpy, win, ConfigureNotify, &Event)); -} - -/************************************************************************ - X Error Handler -************************************************************************/ -XErrorHandler ErrorHandler(Display *d, XErrorEvent *event) -{ - char errmsg[256]; - - XGetErrorText(d, event->error_code, errmsg, 256); - ConsoleMessage("%s failed request: %s\n", Module, errmsg); - ConsoleMessage("Major opcode: 0x%x, resource id: 0x%x\n", - event->request_code, event->resourceid); - return NULL; -} diff --git a/app/fvwm/extras/FvwmTaskBar/FvwmTaskBar.h b/app/fvwm/extras/FvwmTaskBar/FvwmTaskBar.h deleted file mode 100644 index 5086136ab..000000000 --- a/app/fvwm/extras/FvwmTaskBar/FvwmTaskBar.h +++ /dev/null @@ -1,118 +0,0 @@ -/* FvwmTaskBar Module for Fvwm. - * - * Copyright 1994, Mike Finger (mfinger@mermaid.micro.umn.edu or - * Mike_Finger@atk.com) - * - * The author makes not guarantees or warantees, either express or - * implied. Feel free to use any contained here for any purpose, as long - * and this and any other applicible copyrights are kept intact. - - * The functions in this header file that are based on part of the FvwmIdent - * module for Fvwm are noted by a small copyright atop that function, all others - * are copyrighted by Mike Finger. For those functions modified/used, here is - * the full, original copyright: - * - * Copyright 1994, Robert Nation and Nobutaka Suzuki. - * No guarantees or warantees or anything - * are provided or implied in any way whatsoever. Use this program at your - * own risk. Permission to use this program for any purpose is given, - * as long as the copyright is kept intact. */ - -#ifndef _H_FvwmTaskBar -#define _H_FvwmTaskBar - -#include "config.h" -#include "fvwm/fvwm.h" - -#define F_SWALLOWED 1 -#define F_NOT_SWALLOWED 2 - -/* Motif window hints */ -typedef struct -{ - CARD32 flags; - CARD32 functions; - CARD32 decorations; - INT32 inputMode; -} PropMotifWmHints; - -typedef PropMotifWmHints PropMwmHints; - -/* Motif window hints */ -#define MWM_HINTS_FUNCTIONS (1L << 0) -#define MWM_HINTS_DECORATIONS (1L << 1) -#define MWM_HINTS_INPUT_MODE (1L << 2) - -/* bit definitions for MwmHints.functions */ -#define MWM_FUNC_ALL (1L << 0) -#define MWM_FUNC_RESIZE (1L << 1) -#define MWM_FUNC_MOVE (1L << 2) -#define MWM_FUNC_MINIMIZE (1L << 3) -#define MWM_FUNC_MAXIMIZE (1L << 4) -#define MWM_FUNC_CLOSE (1L << 5) - -/* values for MwmHints.input_mode */ -#define MWM_INPUT_MODELESS 0 -#define MWM_INPUT_PRIMARY_APPLICATION_MODAL 1 -#define MWM_INPUT_SYSTEM_MODAL 2 -#define MWM_INPUT_FULL_APPLICATION_MODAL 3 - -/* bit definitions for MwmHints.decorations */ -#define MWM_DECOR_ALL (1L << 0) -#define MWM_DECOR_BORDER (1L << 1) -#define MWM_DECOR_RESIZEH (1L << 2) -#define MWM_DECOR_TITLE (1L << 3) -#define MWM_DECOR_MENU (1L << 4) -#define MWM_DECOR_MINIMIZE (1L << 5) -#define MWM_DECOR_MAXIMIZE (1L << 6) - -#define PROP_MOTIF_WM_HINTS_ELEMENTS 4 -#define PROP_MWM_HINTS_ELEMENTS PROP_MOTIF_WM_HINTS_ELEMENTS - -/* Alarm Events */ -#define NOT_SET 0 -#define SHOW_TIP 1 -#define HIDE_TASK_BAR 2 - -/************************************************************************* - Subroutine Prototypes -**************************************************************************/ -void EndLessLoop(void); -void ReadFvwmPipe(void); -void ProcessMessage(unsigned long type,unsigned long *body); -void SendFvwmPipe(char *message,unsigned long window); -void DeadPipe(int nonsense); -void Alarm(int nonsense); -void SetAlarm(int event); -void ClearAlarm(void); -void CheckForTip(int x, int y); -void MakeMeWindow(void); -void WaitForExpose(void); -void RedrawWindow(int force); -void StartMeUp(void); -void ShutMeDown(int exitstat); -void ConsoleMessage(char *fmt,...); -int OpenConsole(void); -void ConsoleMessage(char *fmt,...); -static void ParseConfig(); -void LoopOnEvents(void); -void AdjustWindow(int width, int height); -char *makename(char *string,long flags); -void ChangeWindowName(char *str); -void LinkAction(char *string); -void AddToSkipList(char *string); -int InSkipList(char *string); -void PrintSkipList(void); -void FvwmNameMessage(long *body); -void SetMwmHints(unsigned int value,unsigned int funcs,unsigned int input); -void ConstrainSize (XSizeHints *hints, int *widthp, int *heightp); -void RevealTaskBar(void); -void HideTaskBar(void); -void WarpTaskBar(int x); -void PurgeConfigEvents(void); - -void Swallow(unsigned long *body); - -XErrorHandler ErrorHandler(Display *d, XErrorEvent *event); - -#endif diff --git a/app/fvwm/extras/FvwmTaskBar/Goodies.c b/app/fvwm/extras/FvwmTaskBar/Goodies.c deleted file mode 100644 index 26dccbf58..000000000 --- a/app/fvwm/extras/FvwmTaskBar/Goodies.c +++ /dev/null @@ -1,424 +0,0 @@ -#include "config.h" -#include "fvwmlib.h" - -#include <stdlib.h> -#include <stdio.h> -#include <fcntl.h> -#include <pwd.h> -#include <time.h> -#include <sys/time.h> -#include <sys/stat.h> -#include <sys/types.h> -#include <X11/Xlib.h> -#include <X11/Xutil.h> -#include <X11/Intrinsic.h> -#ifdef SHAPE -#include <X11/extensions/shape.h> -#endif - -#include "Goodies.h" -#include "minimail.xbm" - -extern Display *dpy; -extern Window Root, win; -extern int win_width, win_height, win_y, win_border, d_depth, - ScreenWidth, ScreenHeight, RowHeight; -extern Pixel back, fore; -extern int Clength; -extern GC blackgc, hilite, shadow, checkered; - -GC statusgc, dategc; -XFontStruct *StatusFont; -int stwin_width = 100, goodies_width = 0; -int anymail, unreadmail, newmail, mailcleared = 0; -int fontheight, clock_width; -char *mailpath = NULL; -char *clockfmt = NULL; -int BellVolume = DEFAULT_BELL_VOLUME; -Pixmap mailpix, wmailpix, pmask, pclip; -int NoMailCheck = False; -char *DateFore = "black", - *DateBack = "LightYellow", - *MailCmd = "Exec xterm -e mail"; -int IgnoreOldMail = False; -int ShowTips = False; -char *statusfont_string = "fixed"; -int last_date = -1; - -void cool_get_inboxstatus(); - -#define gray_width 8 -#define gray_height 8 -extern unsigned char gray_bits[]; - -/* x y w h tw th open type *text win */ -TipStruct Tip = { 0, 0, 0, 0, 0, 0, 0, 0, NULL, None }; - - -/* Parse 'goodies' specific resources */ -void GoodiesParseConfig(char *tline, char *Module) -{ - if(strncasecmp(tline,CatString3(Module, "BellVolume",""), - Clength+10)==0) { - BellVolume = atoi(&tline[Clength+11]); - } else if(strncasecmp(tline,CatString3(Module, "Mailbox",""), - Clength+11)==0) { - if (strncasecmp(&tline[Clength+11], "None", 4) == 0) { - NoMailCheck = True; - } else { - UpdateString(&mailpath, &tline[Clength+8]); - } - } else if(strncasecmp(tline,CatString3(Module, "ClockFormat",""), - Clength+11)==0) { - UpdateString(&clockfmt, &tline[Clength+12]); - clockfmt[strlen(clockfmt)-1] = 0; - } else if(strncasecmp(tline, CatString3(Module, "StatusFont",""), - Clength+10)==0) { - CopyString(&statusfont_string,&tline[Clength+11]); - } else if(strncasecmp(tline,CatString3(Module, "TipsFore",""), - Clength+8)==0) { - CopyString(&DateFore, &tline[Clength+9]); - } else if(strncasecmp(tline,CatString3(Module, "TipsBack",""), - Clength+8)==0) { - CopyString(&DateBack, &tline[Clength+9]); - } else if(strncasecmp(tline,CatString3(Module, "MailCommand",""), - Clength+11)==0) { - CopyString(&MailCmd, &tline[Clength+12]); - } else if(strncasecmp(tline,CatString3(Module, "IgnoreOldMail",""), - Clength+13)==0) { - IgnoreOldMail = True; - } else if(strncasecmp(tline,CatString3(Module, "ShowTips",""), - Clength+8)==0) { - ShowTips = True; - } -} - -void InitGoodies() { - struct passwd *pwent; - char tmp[1024]; - XGCValues gcval; - unsigned long gcmask; - - if (mailpath == NULL) { - strcpy(tmp, DEFAULT_MAIL_PATH); - pwent = getpwuid(getuid()); - strcat(tmp, (char *) (pwent->pw_name)); - UpdateString(&mailpath, tmp); - } - - if ((StatusFont = XLoadQueryFont(dpy, statusfont_string)) == NULL) { - if ((StatusFont = XLoadQueryFont(dpy, "fixed")) == NULL) { - ConsoleMessage("Couldn't load fixed font. Exiting!\n"); - exit(1); - } - } - - fontheight = StatusFont->ascent + StatusFont->descent; - - gcmask = GCForeground | GCBackground | GCFont | GCGraphicsExposures; - gcval.foreground = fore; - gcval.background = back; - gcval.font = StatusFont->fid; - gcval.graphics_exposures = False; - statusgc = XCreateGC(dpy, Root, gcmask, &gcval); - - if (!NoMailCheck) { - mailpix = XCreatePixmapFromBitmapData(dpy, win, (char *)minimail_bits, - minimail_width, minimail_height, - fore,back, d_depth); - wmailpix = XCreatePixmapFromBitmapData(dpy, win, (char *)minimail_bits, - minimail_width, minimail_height, - fore,GetColor("white"), d_depth); - - goodies_width += minimail_width + 7; - } - if (clockfmt) { - struct tm *tms; - static time_t timer; - static char str[24]; - time(&timer); - tms = localtime(&timer); - strftime(str, 24, clockfmt, tms); - clock_width = XTextWidth(StatusFont, str, strlen(str)) + 4; - } - else clock_width = XTextWidth(StatusFont, "XX:XX", 5) + 4; - goodies_width += clock_width; - stwin_width = goodies_width; -} - -void Draw3dBox(Window wn, int x, int y, int w, int h) -{ - XClearArea(dpy, wn, x, y, w, h, False); - - XDrawLine(dpy, win, shadow, x, y, x+w-2, y); - XDrawLine(dpy, win, shadow, x, y, x, y+h-2); - - XDrawLine(dpy, win, hilite, x, y+h-1, x+w-1, y+h-1); - XDrawLine(dpy, win, hilite, x+w-1, y+h-1, x+w-1, y); -} - -void DrawGoodies() { - struct tm *tms; - static char str[40]; - static time_t timer; - static int last_mail_check = -1; - - time(&timer); - tms = localtime(&timer); - if (clockfmt) { - strftime(str, 24, clockfmt, tms); - if (str[0] == '0') str[0]=' '; - } else { - strftime(str, 15, "%R", tms); - } - - Draw3dBox(win, win_width - stwin_width, 0, stwin_width, RowHeight); - XDrawString(dpy,win,statusgc, - win_width - stwin_width + 4, - ((RowHeight - fontheight) >> 1) +StatusFont->ascent, - str, strlen(str)); - - if (NoMailCheck) return; - if (timer - last_mail_check >= 10) { - cool_get_inboxstatus(); - last_mail_check = timer; - if (newmail) - XBell(dpy, BellVolume); - } - - if (!mailcleared && (unreadmail || newmail)) - XCopyArea(dpy, wmailpix, win, statusgc, 0, 0, - minimail_width, minimail_height, - win_width - stwin_width + clock_width + 3, - ((RowHeight - minimail_height) >> 1)); - else if (!IgnoreOldMail /*&& !mailcleared*/ && anymail) - XCopyArea(dpy, mailpix, win, statusgc, 0, 0, - minimail_width, minimail_height, - win_width - stwin_width + clock_width + 3, - ((RowHeight - minimail_height) >> 1)); - - if (Tip.open) { - if (Tip.type == DATE_TIP) - if (tms->tm_mday != last_date) /* reflect date change */ - CreateDateWindow(); /* This automatically deletes any old window */ - last_date = tms->tm_mday; - RedrawTipWindow(); - } - -} - -int MouseInClock(int x, int y) { - int clockl = win_width - stwin_width; - int clockr = win_width - stwin_width + clock_width; - return (x>=clockl && x<clockr && y>1 && y<RowHeight-2); -} - -int MouseInMail(int x, int y) { - int maill = win_width - stwin_width + clock_width; - int mailr = win_width; - return (x>=maill && x<mailr && y>1 && y<RowHeight-2); -} - -void CreateDateWindow() { - struct tm *tms; - static time_t timer; - static char str[40]; - - time(&timer); - tms = localtime(&timer); - strftime(str, 40, "%A, %B %d, %Y", tms); - last_date = tms->tm_mday; - - PopupTipWindow(win_width, 0, str); -} - -void CreateMailTipWindow() { - char str[20]; - - if (!anymail) return; - sprintf(str, "You have %smail", (newmail || unreadmail) ? "new " : ""); - PopupTipWindow(win_width, 0, str); -} - -void RedrawTipWindow() { - if (Tip.text) { - XDrawString(dpy, Tip.win, dategc, 3, Tip.th-4, - Tip.text, strlen(Tip.text)); - XRaiseWindow(dpy, Tip.win); /*****************/ - } -} - -void PopupTipWindow(int px, int py, char *text) { - int newx, newy; - Window child; - - if (!ShowTips) return; - - if (Tip.win != None) DestroyTipWindow(); - - Tip.tw = XTextWidth(StatusFont, text, strlen(text)) + 6; - Tip.th = StatusFont->ascent + StatusFont->descent + 4; - XTranslateCoordinates(dpy, win, Root, px, py, &newx, &newy, &child); - - Tip.x = newx; - if (win_y == win_border) - Tip.y = newy + RowHeight; - else - Tip.y = newy - Tip.th -2; - - Tip.w = Tip.tw; - Tip.h = Tip.th; - - if (Tip.x+Tip.tw+4 > ScreenWidth-5) Tip.x = ScreenWidth-Tip.tw-9; - if (Tip.x < 5) Tip.x = 5; - - UpdateString(&Tip.text, text); - CreateTipWindow(Tip.x, Tip.y, Tip.w, Tip.h); - if (Tip.open) XMapRaised(dpy, Tip.win); -} - -void ShowTipWindow(int open) { - if (open) { - if (Tip.win != None) { - XMapRaised(dpy, Tip.win); - } - } else { - XUnmapWindow(dpy, Tip.win); - } - Tip.open = open; -} - -void CreateTipWindow(int x, int y, int w, int h) { - unsigned long gcmask; - unsigned long winattrmask = CWBackPixel | CWBorderPixel | CWEventMask | - CWSaveUnder | CWOverrideRedirect; - XSetWindowAttributes winattr; - GC cgc, gc0, gc1; - XGCValues gcval; - Pixmap pchk; - - winattr.background_pixel = GetColor(DateBack); - winattr.border_pixel = GetColor("black"); - winattr.override_redirect = True; - winattr.save_under = True; - winattr.event_mask = ExposureMask; - - Tip.win = XCreateWindow(dpy, Root, x, y, w+4, h+4, 0, - CopyFromParent, CopyFromParent, CopyFromParent, - winattrmask, &winattr); - - gcmask = GCForeground | GCBackground | GCFont | GCGraphicsExposures; - gcval.graphics_exposures = False; - gcval.foreground = GetColor(DateFore); - gcval.background = GetColor(DateBack); - gcval.font = StatusFont->fid; - dategc = XCreateGC(dpy, Root, gcmask, &gcval); - - pmask = XCreatePixmap(dpy, Root, w+4, h+4, 1); - pclip = XCreatePixmap(dpy, Root, w+4, h+4, 1); - - gcmask = GCForeground | GCBackground | GCFillStyle | GCStipple | - GCGraphicsExposures; - gcval.foreground = 1; - gcval.background = 0; - gcval.fill_style = FillStippled; - pchk = XCreatePixmapFromBitmapData(dpy, Root, (char *)gray_bits, - gray_width, gray_height, 1, 0, 1); - gcval.stipple = pchk; - cgc = XCreateGC(dpy, pmask, gcmask, &gcval); - - gcmask = GCForeground | GCBackground | GCGraphicsExposures | GCFillStyle; - gcval.graphics_exposures = False; - gcval.fill_style = FillSolid; - gcval.foreground = 0; - gcval.background = 0; - gc0 = XCreateGC(dpy, pmask, gcmask, &gcval); - - gcval.foreground = 1; - gcval.background = 1; - gc1 = XCreateGC(dpy, pmask, gcmask, &gcval); - - XFillRectangle(dpy, pmask, gc0, 0, 0, w+4, h+4); - XFillRectangle(dpy, pmask, cgc, 3, 3, w+4, h+4); - XFillRectangle(dpy, pmask, gc1, 0, 0, w+1, h+1); - - XFillRectangle(dpy, pclip, gc0, 0, 0, w+4, h+4); - XFillRectangle(dpy, pclip, gc1, 1, 1, w-1, h-1); - -#ifdef SHAPE - XShapeCombineMask(dpy, Tip.win, ShapeBounding, 0, 0, pmask, ShapeSet); - XShapeCombineMask(dpy, Tip.win, ShapeClip, 0, 0, pclip, ShapeSet); -#endif - - XFreeGC(dpy, gc0); - XFreeGC(dpy, gc1); - XFreeGC(dpy, cgc); - XFreePixmap(dpy, pchk); -} - -void DestroyTipWindow() { - XFreePixmap(dpy, pclip); - XFreePixmap(dpy, pmask); - XFreeGC(dpy, dategc); - XDestroyWindow(dpy, Tip.win); - if (Tip.text) { free(Tip.text); Tip.text = NULL; } - Tip.win = None; -} - -/*-----------------------------------------------------*/ -/* Get file modification time */ -/* (based on the code of 'coolmail' By Byron C. Darrah */ -/*-----------------------------------------------------*/ - -void cool_get_inboxstatus() -{ - static off_t oldsize = 0; - off_t newsize; - struct stat st; - int fd; - - fd = open (mailpath, O_RDONLY, 0); - if (fd < 0) - { - anymail = 0; - newmail = 0; - unreadmail = 0; - newsize = 0; - } - else - { - fstat(fd, &st); - close(fd); - newsize = st.st_size; - - if (newsize > 0) - anymail = 1; - else - anymail = 0; - - if (st.st_mtime >= st.st_atime && newsize > 0) - unreadmail = 1; - else - unreadmail = 0; - - if (newsize > oldsize && unreadmail) { - newmail = 1; - mailcleared = 0; - } - else - newmail = 0; - } - - oldsize = newsize; -} - -/*---------------------------------------------------------------------------*/ - -void HandleMailClick(XEvent event) { - static Time lastclick = 0; - if (event.xbutton.time - lastclick < 250) { - SendFvwmPipe(MailCmd, 0); - } - lastclick = event.xbutton.time; - mailcleared = 1; -} diff --git a/app/fvwm/extras/FvwmTaskBar/Goodies.h b/app/fvwm/extras/FvwmTaskBar/Goodies.h deleted file mode 100644 index dc7c7ef19..000000000 --- a/app/fvwm/extras/FvwmTaskBar/Goodies.h +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Goodies.c structures and exported functions - */ - -#ifndef _H_Goodies -#define _H_Goodies - -#define DEFAULT_MAIL_PATH "/var/spool/mail/" -#define DEFAULT_BELL_VOLUME 20 - -/* Tip window types */ -#define NO_TIP (-1) -#define DATE_TIP (-2) -#define MAIL_TIP (-3) -#define START_TIP (-4) - -typedef struct { - int x, y, w, h, tw, th, open, type; - char *text; - Window win; -} TipStruct; - -void GoodiesParseConfig(char *tline, char *Module); -void InitGoodies(); -void DrawGoodies(); -int MouseInClock(int x, int y); -int MouseInMail(int x, int y); -void CreateDateWindow(); -void CreateMailTipWindow(); -void PopupTipWindow(int px, int py, char *text); -void CreateTipWindow(int x, int y, int w, int h); -void RedrawTipWindow(); -void DestroyTipWindow(); -void ShowTipWindow(int open); -void HandleMouseClick(XEvent event); -void HandleMailClick(XEvent event); - -#endif diff --git a/app/fvwm/extras/FvwmTaskBar/List.c b/app/fvwm/extras/FvwmTaskBar/List.c deleted file mode 100644 index 70ba4dde5..000000000 --- a/app/fvwm/extras/FvwmTaskBar/List.c +++ /dev/null @@ -1,292 +0,0 @@ -/* FvwmTaskBar Module for Fvwm. - * - * Copyright 1994, Mike Finger (mfinger@mermaid.micro.umn.edu or - * Mike_Finger@atk.com) - * - * The functions in this source file are the original work of Mike Finger. - * - * No guarantees or warantees or anything are provided or implied in any way - * whatsoever. Use this program at your own risk. Permission to use this - * program for any purpose is given, as long as the copyright is kept intact. - * - * Things to do: Convert to C++ (In Progress) - */ - -#include "config.h" - -#include <stdio.h> -#include <stdlib.h> -#include "List.h" -#include "Mallocs.h" -#include "../../fvwm/module.h" - - -/****************************************************************************** - InitList - Initialize the list -******************************************************************************/ -void InitList(List *list) -{ - list->head=list->tail=NULL; - list->count=0; -} - -/****************************************************************************** - AddItem - Allocates spaces for and appends an item to the list -******************************************************************************/ -void AddItem(List *list, long id,long flags) -{ -Item *new; - new=(Item *)safemalloc(sizeof(Item)); - new->id=id; - new->name=NULL; - new->flags=flags; - new->next=NULL; - - if (list->tail==NULL) list->head=list->tail=new; - else { - list->tail->next=new; - list->tail=new; - } - list->count++; -} - -/****************************************************************************** - AddItemName - Allocates spaces for and appends an item to the list -******************************************************************************/ -void AddItemName(List *list, char *string, long flags) { - Item *new; - - new = (Item *)safemalloc(sizeof(Item)); - new->id = 0L; - new->name = NULL; - UpdateString(&new->name, string); - new->flags = flags; - new->next = NULL; - - if (list->tail == NULL) list->head = list->tail = new; - else { - list->tail->next = new; - list->tail = new; - } - list->count++; -} - - -/****************************************************************************** - FindItem - Find the item in the list matching the id -******************************************************************************/ -int FindItem(List *list, long id) -{ -Item *temp; -int i; - for(i=0,temp=list->head;temp!=NULL && temp->id!=id;i++,temp=temp->next); - if (temp==NULL) return -1; - return i; -} - -/****************************************************************************** - FindNameItem - Find the item in the list matching the string -******************************************************************************/ -int FindNameItem(List *list, char *string) -{ - Item *temp; - int i; - - for(i = 0, temp=list->head; - temp!=NULL && strcmp(temp->name,string) != 0; - i++,temp=temp->next); - if (temp==NULL) return -1; - return i; -} - -/****************************************************************************** - UpdateItem - Update the item in the list, setting name & flags as necessary. -******************************************************************************/ -int UpdateItemName(List *list, long id, char *string) -{ -Item *temp; -int i; - for(i=0,temp=list->head;temp!=NULL && id!=temp->id;i++,temp=temp->next); - if (temp==NULL) return -1; - UpdateString(&temp->name,string); - return i; -} - -int UpdateItemFlags(List *list, long id, long flags) -{ -Item *temp; -int i; - for(i=0,temp=list->head;temp!=NULL && id!=temp->id;i++,temp=temp->next); - if (temp==NULL) return -1; - if (flags!=-1) temp->flags=flags; - return i; -} - -int UpdateNameItem(List *list, char *string, long id, long flags) { - Item *temp; - int i; - - for(i = 0, temp=list->head; - temp!=NULL && strcmp(temp->name,string) != 0; - i++,temp=temp->next); - if (temp==NULL) return -1; - else { - if (id != -1) temp->id = id; - if (flags != -1) temp->flags = flags; - return i; - } -} - -/****************************************************************************** - FreeItem - Frees allocated space for an Item -******************************************************************************/ -void FreeItem(Item *ptr) -{ - if (ptr != NULL) { - if (ptr->name!=NULL) free(ptr->name); - free(ptr); - } -} - -/****************************************************************************** - DeleteItem - Deletes an item from the list -******************************************************************************/ -int DeleteItem(List *list,long id) -{ -Item *temp,*temp2; -int i; - if (list->head==NULL) return -1; - if (list->head->id==id) { - temp2=list->head; - temp=list->head=list->head->next; - i=-1; - } else { - for(i=0,temp=list->head;temp->next!=NULL && temp->next->id!=id; - i++,temp=temp->next); - if (temp->next==NULL) return -1; - temp2=temp->next; - temp->next=temp2->next; - } - - if (temp2==list->tail) list->tail=temp; - - FreeItem(temp2); - list->count--; - return i+1; -} - -/****************************************************************************** - FreeList - Free the entire list of Items -******************************************************************************/ -void FreeList(List *list) -{ -Item *temp,*temp2; - for(temp=list->head;temp!=NULL;) { - temp2=temp; - temp=temp->next; - FreeItem(temp2); - } - list->count=0; -} - -/****************************************************************************** - PrintList - Print the list of item on the console. (Debugging) -******************************************************************************/ -void PrintList(List *list) -{ - Item *temp; - ConsoleMessage("List of Items:\n"); - ConsoleMessage(" %10s %-15s %-15s %-15s %-15s Flgs\n","ID","Name","I-Name", - "R-Name","R-Class"); - ConsoleMessage(" ---------- --------------- --------------- --------------- --------------- ----\n"); - for(temp=list->head;temp!=NULL;temp=temp->next) { - ConsoleMessage(" %10ld %-15.15s %4d\n",temp->id, - (temp->name==NULL) ? "<null>" : temp->name, - temp->flags); - } -} - -/****************************************************************************** - ItemName - Return the name of an Item -******************************************************************************/ -char *ItemName(List *list, int n) -{ -Item *temp; -int i; - for(i=0,temp=list->head;temp!=NULL && i<n;i++,temp=temp->next); - if (temp==NULL) return NULL; - return temp->name; -} - -/****************************************************************************** - ItemFlags - Return the flags for an item -******************************************************************************/ -long ItemFlags(List *list, long id) -{ -Item *temp; - for(temp=list->head;temp!=NULL && id!=temp->id;temp=temp->next); - if (temp==NULL) return -1; - else return temp->flags; -} - -/****************************************************************************** - ItemIndexFlags - Return the flags for an item of index i -******************************************************************************/ -long ItemIndexFlags(List *list, int i) -{ -Item *temp; -int j; - for(temp=list->head, j=0;temp!=NULL && j!=i;temp=temp->next,j++); - if (temp==NULL) return -1; - else return temp->flags; -} - -/****************************************************************************** - XorFlags - Exclusive of the flags with the specified value. -******************************************************************************/ -long XorFlags(List *list, int n, long value) -{ -Item *temp; -int i; -long ret; - for(i=0,temp=list->head;temp!=NULL && i<n;i++,temp=temp->next) - if (temp==NULL) return -1; - ret=temp->flags; - temp->flags^=value; - return ret; -} - -/****************************************************************************** - ItemCount - Return the number of items inthe list -******************************************************************************/ -int ItemCount(List *list) -{ - return list->count; -} - -/****************************************************************************** - ItemID - Return the ID of the item in the list. -******************************************************************************/ -long ItemID(List *list, int n) -{ -Item *temp; -int i; - for(i=0,temp=list->head;temp!=NULL && i<n;i++,temp=temp->next); - if (temp==NULL) return -1; - return temp->id; -} - -/****************************************************************************** - CopyItem - Copy an item from one list to another -******************************************************************************/ -void CopyItem(List *dest, List *source, int n) -{ -Item *temp; -int i; - for(i=0,temp=source->head;temp!=NULL && i<n;i++,temp=temp->next); - if (temp==NULL) return; - AddItem(dest,temp->id,temp->flags); - UpdateItemName(dest,temp->id,temp->name); - DeleteItem(source,temp->id); -} - diff --git a/app/fvwm/extras/FvwmTaskBar/List.h b/app/fvwm/extras/FvwmTaskBar/List.h deleted file mode 100644 index 6b14848ac..000000000 --- a/app/fvwm/extras/FvwmTaskBar/List.h +++ /dev/null @@ -1,47 +0,0 @@ -/* FvwmTaskBar Module for Fvwm. - * - * Copyright 1994, Mike Finger (mfinger@mermaid.micro.umn.edu or - * Mike_Finger@atk.com) - * - * The functions in this source file that are the original work of Mike Finger. - * - * No guarantees or warantees or anything are provided or implied in any way - * whatsoever. Use this program at your own risk. Permission to use this - * program for any purpose is given, as long as the copyright is kept intact. - * - * Things to do: Convert to C++ (In Progress) - */ - -/* Structure definitions */ -typedef struct item { - long id; - char *name; - long flags; - struct item *next; -} Item; - -typedef struct { - Item *head,*tail; - int count; -} List; - -/* Function Prototypes */ -void InitList(List *list); -void AddItem(List *list, long id, long flags); -void AddItemName(List *list, char *string, long flags); -int FindItem(List *list, long id); -int FindNameItem(List *list, char *string); -int UpdateItemName(List *list, long id, char *string); -int UpdateItemFlags(List *list, long id, long flags); -int UpdateNameItem(List *list, char *string, long id, long flags); -void FreeItem(Item *ptr); -int DeleteItem(List *list,long id); -void FreeList(List *list); -void PrintList(List *list); -char *ItemName(List *list, int n); -long ItemFlags(List *list, long id ); -long ItemIndexFlags(List *list, int i); -long XorFlags(List *list, int n, long value); -int ItemCount(List *list); -long ItemID(List *list, int n); -void CopyItem(List *dest,List *source,int n); diff --git a/app/fvwm/extras/FvwmTaskBar/Mallocs.c b/app/fvwm/extras/FvwmTaskBar/Mallocs.c deleted file mode 100644 index ea9f7e0ac..000000000 --- a/app/fvwm/extras/FvwmTaskBar/Mallocs.c +++ /dev/null @@ -1,60 +0,0 @@ -/* FvwmTaskBar Module for Fvwm. - * - * Copyright 1994, Mike Finger (mfinger@mermaid.micro.umn.edu or - * Mike_Finger@atk.com) - * - * The author makes not guarantees or warantees, either express or - * implied. Feel free to use any contained here for any purpose, as long - * and this and any other applicible copyrights are kept intact. - - * The functions in this source file that are based on part of the FvwmIdent - * module for Fvwm are noted by a small copyright atop that function, all others - * are copyrighted by Mike Finger. For those functions modified/used, here is - * the full, original copyright: - * - * Copyright 1994, Robert Nation and Nobutaka Suzuki. - * No guarantees or warantees or anything - * are provided or implied in any way whatsoever. Use this program at your - * own risk. Permission to use this program for any purpose is given, - * as long as the copyright is kept intact. */ - -#include "config.h" -#include "fvwmlib.h" - -#include <stdio.h> -#include <stdlib.h> -#include <ctype.h> -#include <string.h> -#include <sys/time.h> - -extern char *Module; - -/****************************************************************************** - saferealloc - safely reallocate memory or exit if fails. (Doesn't work right) -******************************************************************************/ -char *saferealloc(char *ptr, int length) -{ -char *newptr; - - if(length <=0) length=1; - - newptr=realloc(ptr,length); - if (ptr == (char *)0) { - fprintf(stderr,"%s:realloc failed",Module); - exit(1); - } - return ptr; -} - -void UpdateString(char **string,char *value) -{ - if (value==NULL) - return; - if (*string==NULL) - *string=(char *)safemalloc(strlen(value)+1); - else - *string=(char *)realloc(*string,strlen(value)+1); - strcpy(*string,value); -} - - diff --git a/app/fvwm/extras/FvwmTaskBar/Mallocs.h b/app/fvwm/extras/FvwmTaskBar/Mallocs.h deleted file mode 100644 index 3e7ee2b17..000000000 --- a/app/fvwm/extras/FvwmTaskBar/Mallocs.h +++ /dev/null @@ -1,31 +0,0 @@ -/* FvwmTaskBar Module for Fvwm. - * - * Copyright 1994, Mike Finger (mfinger@mermaid.micro.umn.edu or - * Mike_Finger@atk.com) - * - * The author makes not guarantees or warantees, either express or - * implied. Feel free to use any contained here for any purpose, as long - * and this and any other applicible copyrights are kept intact. - - * The functions in this source file that are based on part of the FvwmIdent - * module for Fvwm are noted by a small copyright atop that function, all others - * are copyrighted by Mike Finger. For those functions modified/used, here is - * the full, original copyright: - * - * Copyright 1994, Robert Nation and Nobutaka Suzuki. - * No guarantees or warantees or anything - * are provided or implied in any way whatsoever. Use this program at your - * own risk. Permission to use this program for any purpose is given, - * as long as the copyright is kept intact. */ - -#ifndef _H_Mallocs -#define _H_Mallocs - -/* Function Prototypes */ -char *safemalloc(int length); -char *saferealloc(char *ptr, int length); -void CopyString(char **dest, char *source); -char *CatString2(char *a, char *b); -void UpdateString(char **string,char *value); - -#endif diff --git a/app/fvwm/extras/FvwmTaskBar/README b/app/fvwm/extras/FvwmTaskBar/README deleted file mode 100644 index 9bd18b670..000000000 --- a/app/fvwm/extras/FvwmTaskBar/README +++ /dev/null @@ -1,61 +0,0 @@ -Features : - - * a start button linked to a user-defined menu in the .fvwm2rc configuration - file - - * an array of buttons representing the active application windows : the - focused one corresponds to the depressed buton. - - * digital clock and mail indicator - - * support for pixmaps in the buttons - -Thanks to : -Brian Wellington <bwelling@Glue.umd.edu> -Georg Hager <georg.hager@btp3x3.phy.uni-bayreuth.de> -Andreas Klemm <andreas@knobel.gun.de> -Michael A. Kazda <kazda@infomine.net> -Hector Peraza <peraza@mitac11.uia.ac.be> -Henry R. McTague <mctague@mctague.mv.com> -andrew (a.b.) atrens <atrens@bnr.ca> -William E. Roadcap <roadcapw@cfw.com> - -Options : - -FvwmTaskBarFont : default font for the buttons - "" SelFont: : font for the depressed buttons (the Start button uses - always SelFont even if depressed) - "" Fore & Back : fore and back colors - "" Geometry : window geometry (only Y coordinate is usefull) - "" Action : binds action to mouse buttons. - "" AutoStick : the bar automatically sticks to the top or bottom of the - screen - "" UseSkipList : only lists windows that are not in the SkipList definition - "" UseIconNames : use preferably the icon name instead of the full window - title for button label - "" SwallowModule: same as in FvwmButtons (or GoodStuff), however, the support - is limited and resizing is awfull. - "" ButtonWidth : maximum button width (min = 32) - "" ClockFormat : strftime string format for the digital clock - "" BellVolume : volume of the bell rung for mail - "" MailBox : mailbox path (by default /var/spool/mail/$login_name - (site administrator should consider changing DEFAULT_MAIL_PATH - in Goodies.h if it does not reflect their system's default) - A value of 'None' indicates not to check for mail. - "" StartName : label for the start button - "" StartMenu : fvwm popup menu to be activated when the start button - is pressed - "" StartIcon : pixmap for the start button - -...and more (see the man pages!!!) - -A word about the pixmaps size: the current version only centers them on -the button, neither button resize nor pixmap resize is made if the icon is -bigger than the default button size. For the font size I'm using (12pts) -the maximum height is about 16 pixels. - -This module is based on the FvwmWinList module + win95look -(see copyrights in source files) - --- -D.Barth <barth@di.epfl.ch) diff --git a/app/fvwm/extras/FvwmTaskBar/Start.c b/app/fvwm/extras/FvwmTaskBar/Start.c deleted file mode 100644 index 98e5d8309..000000000 --- a/app/fvwm/extras/FvwmTaskBar/Start.c +++ /dev/null @@ -1,73 +0,0 @@ -/* Start ;-) button handling */ - -#include <X11/Xlib.h> - -#include "../../libs/fvwmlib.h" -#include "ButtonArray.h" - -extern Display *dpy; -extern Window Root, win; -extern XFontStruct *ButtonFont; -extern int Clength; -extern char *PixmapPath; -extern char *IconPath; -Button *StartButton; -int StartButtonWidth, StartButtonHeight; -char *StartName = NULL, - *StartPopup = NULL, - *StartIconName = NULL; - - -void StartButtonParseConfig(char *tline, char *Module) -{ - if(strncasecmp(tline,CatString3(Module,"StartName",""), Clength+9)==0) - CopyString(&StartName,&tline[Clength+9]); - else if(strncasecmp(tline,CatString3(Module,"StartMenu",""), Clength+9)==0) - CopyString(&StartPopup,&tline[Clength+9]); - else if(strncasecmp(tline,CatString3(Module,"StartIcon",""), Clength+9)==0) - CopyString(&StartIconName,&tline[Clength+9]); -} - -void StartButtonInit(int height) -{ - Picture *p = NULL; - int pw; - - /* some defaults */ - if (StartName == NULL) - UpdateString(&StartName, "Start"); - if (StartPopup == NULL) - UpdateString(&StartPopup, "StartMenu"); - if (StartIconName == NULL) - UpdateString(&StartIconName, "mini-start.xpm"); - - /** FIXME: what should the colour limit be? - I put in -1, which apparently imposes NO limit. - **/ - p = GetPicture(dpy, Root, IconPath, PixmapPath, StartIconName, -1); - - StartButton = (Button *)ButtonNew(StartName, p, BUTTON_UP); - if (p != NULL) pw = p->width+3; else pw = 0; - StartButtonWidth = XTextWidth(ButtonFont, StartName, strlen(StartName)) + - pw + 14; - StartButtonHeight = height; -} - -void StartButtonUpdate(char *title, int state) -{ - if (title != NULL) - ConsoleMessage("Updating StartTitle not supported yet...\n"); - ButtonUpdate(StartButton, title, state); -} - -void StartButtonDraw(int force) -{ - if (StartButton->needsupdate || force) - ButtonDraw(StartButton, 0, 0, StartButtonWidth, StartButtonHeight); -} - -int MouseInStartButton(int x, int y) -{ - return (x > 0 && x < StartButtonWidth && - y > 0 && y < StartButtonHeight); -} diff --git a/app/fvwm/extras/FvwmTaskBar/Start.h b/app/fvwm/extras/FvwmTaskBar/Start.h deleted file mode 100644 index 011cbf36b..000000000 --- a/app/fvwm/extras/FvwmTaskBar/Start.h +++ /dev/null @@ -1,13 +0,0 @@ -/* - * Start.c exported functions - */ - -#ifndef _H_Start -#define _H_Start - -void StartButtonInit(int height); -void StartButtonUpdate(char *title, int state); -void StartButtonDraw(int force); -int MouseInStartButton(int x, int y); - -#endif diff --git a/app/fvwm/extras/FvwmTaskBar/fvwm2.README b/app/fvwm/extras/FvwmTaskBar/fvwm2.README deleted file mode 100644 index b63b3b5ac..000000000 --- a/app/fvwm/extras/FvwmTaskBar/fvwm2.README +++ /dev/null @@ -1,2 +0,0 @@ -Make sure you applied the MiniIcon support, added #define MINI_ICONS to -fvwm.tmpl. Do a MakeMakefiles and recompiled everything. diff --git a/app/fvwm/extras/FvwmTaskBar/minimail.xbm b/app/fvwm/extras/FvwmTaskBar/minimail.xbm deleted file mode 100644 index a74272099..000000000 --- a/app/fvwm/extras/FvwmTaskBar/minimail.xbm +++ /dev/null @@ -1,5 +0,0 @@ -#define minimail_width 13 -#define minimail_height 9 -static unsigned char minimail_bits[] = { - 0xff, 0x1f, 0x01, 0x10, 0x03, 0x18, 0x05, 0x14, 0x09, 0x12, 0x19, 0x13, - 0xe5, 0x14, 0x03, 0x18, 0xff, 0x1f}; diff --git a/app/fvwm/extras/FvwmWharf/ASSound/ASSound.c b/app/fvwm/extras/FvwmWharf/ASSound/ASSound.c deleted file mode 100644 index c1939064a..000000000 --- a/app/fvwm/extras/FvwmWharf/ASSound/ASSound.c +++ /dev/null @@ -1,242 +0,0 @@ -/* - * AfterStep Sound System - sound module for Wharf - * - * Copyright (c) 1996 by Alfredo Kojima - */ -/* - * Todo: - * realtime audio mixing - * replace the Audio module - */ -#include <stdlib.h> -#include <stdio.h> -#include <sys/stat.h> -#include <sys/types.h> -#include <sys/fcntl.h> -#include <sys/time.h> -#include <signal.h> -#include <unistd.h> -#define AUDIO_DEVICE "/dev/audio" - -typedef struct LList { - struct LList *next; - struct LList *prev; - int data; - int timestamp; -} LList; - -typedef struct SoundEntry { - char *data; - int size; -} SoundEntry; - -/* timeout time for sound playing in seconds */ -#define PLAY_TIMEOUT 1 - -/* table of audio data (not filenames) */ -SoundEntry **SoundTable; - -int LastSound=0; -char *SoundPlayer; - -char *ProgName; -LList *PlayQueue=NULL, *OldestQueued=NULL; - -int InPipe; - -void *ckmalloc(size_t size) -{ - void *tmp; - - tmp=malloc(size); - if (tmp==NULL) { - fprintf(stderr,"%s: virtual memory exhausted.",ProgName); - exit(1); - } - return tmp; -} - -/* - * Register -- - * makes a new sound entry - */ -void Register(char *sound_file, int code) -{ - int file; - struct stat stat_buf; - - if (sound_file[0]=='.' && sound_file[1]==0) { - SoundTable[code]=ckmalloc(sizeof(SoundEntry)); - SoundTable[code]->size = -1; - return; /* dummy sound */ - } - if (stat(sound_file, &stat_buf)<0) { - fprintf(stderr,"%s: sound file %s not found\n",ProgName, - sound_file); - return; - } - SoundTable[code]=ckmalloc(sizeof(SoundEntry)); - if (SoundPlayer!=NULL) { - SoundTable[code]->data=ckmalloc(strlen(sound_file)); - SoundTable[code]->size=1; - strcpy(SoundTable[code]->data,sound_file); - return; - } - SoundTable[code]->data=ckmalloc(stat_buf.st_size); - file=open(sound_file, O_RDONLY); - if (file<0) { - fprintf(stderr,"%s: can't open sound file %s\n",ProgName, sound_file); - free(SoundTable[code]->data); - free(SoundTable[code]); - SoundTable[code]=NULL; - return; - } - SoundTable[code]->size=read(file,SoundTable[code]->data,stat_buf.st_size); - if (SoundTable[code]->size<1) { - fprintf(stderr,"%s: error reading sound file %s\n",ProgName, - sound_file); - free(SoundTable[code]->data); - free(SoundTable[code]); - close(file); - SoundTable[code]=NULL; - return; - } - close(file); -} - -/* - * PlaySound -- - * plays a sound - */ - -void PlaySound(int sid) -{ - int audio=-1; - if ((sid < LastSound) && (SoundTable[sid]->size<=0)) return; - if ((sid>=LastSound) || (sid<0) || SoundTable[sid]==NULL) { - fprintf(stderr,"%s: request to play invalid sound received\n", - ProgName); - return; - } - if (SoundPlayer!=NULL) { - static char cmd[1024]; - pid_t child; - - child = fork(); - if (child<0) return; - else if (child==0) { - execlp(SoundPlayer,SoundPlayer,SoundTable[sid]->data,NULL); - } else { - while (wait(NULL)<0); - } - /* - sprintf(cmd,"%s %s",SoundPlayer,SoundTable[sid]->data); - system(cmd); - */ - return; - } -#if 0 - audio = open(AUDIO_DEVICE,O_WRONLY|O_NONBLOCK); - if ((audio<0) && errno==EAGAIN) { - sleep(1); - audio = open(AUDIO_DEVICE,O_WRONLY|O_NONBLOCK); - if (audio<0) return; - } - write(audio, SoundTable[sid]->data,SoundTable[sid]->size); - close(audio); - audio=-1; -#endif -} - -void DoNothing(int foo) -{ - signal(SIGUSR1, DoNothing); -} - -/* - * HandleRequest -- - * play requested sound - * sound -1 is a quit command - * - * Note: - * Something not good will happed if a new play request - * arrives before exiting the handler - */ -void HandleRequest(int foo) -{ - int sound, timestamp; - char *buffer; - LList *tmp; -/* - signal(SIGUSR1, DoNothing); - */ - read(InPipe,&sound,sizeof(sound)); - read(InPipe,×tamp,sizeof(timestamp)); - if (sound<0) { - printf("exitting ASSound..\n"); - exit(0); - } - if ((clock()-timestamp)<PLAY_TIMEOUT) - PlaySound(sound); -#if 0 - tmp = ckmalloc(sizeof(LList)); - tmp->data = sound; - tmp->timestamp = clock(); - tmp->next = PlayQueue; - if (PlayQueue==NULL) { - OldestQueued = tmp; - tmp->prev = NULL; - } else { - PlayQueue->prev = tmp; - } - PlayQueue = tmp; - signal(SIGUSR1, HandleRequest); -#endif -} - -/* - * Program startup. - * Arguments: - * argv[1] - pipe for reading data - * argv[2] - the name of the sound player to be used. ``-'' indicates - * internal player. - * argv[3]... - filenames of sound files with code n-3 - */ -int main(int argc, char **argv) -{ - int i; - - signal(SIGUSR1, HandleRequest); - ProgName=argv[0]; - if (argc<4) { - fprintf(stderr, "%s can only be started by an AfterStep module\n", - ProgName); - exit(1); - } - SoundPlayer=argv[2]; - if (SoundPlayer[0]=='-' && SoundPlayer[1]==0) { - SoundPlayer=NULL; - printf("%s:need a sound player.\n",ProgName); - } - SoundTable=ckmalloc(sizeof(SoundEntry *)*(argc-3)); - for(i=3; i<argc; i++) { - Register(argv[i], i-3); - } - LastSound=i-3; - InPipe = atoi(argv[1]); - while(1) { -#if 0 - LList *tmp; - while (OldestQueued!=NULL) { - if ((clock()-OldestQueued->timestamp) < PLAY_TIMEOUT) - PlaySound(OldestQueued->data); - tmp = OldestQueued->prev; - free(OldestQueued); - OldestQueued=tmp; - } - pause(); -#endif - HandleRequest(0); - } -} - diff --git a/app/fvwm/extras/FvwmWharf/ASSound/README b/app/fvwm/extras/FvwmWharf/ASSound/README deleted file mode 100644 index 3ed69c962..000000000 --- a/app/fvwm/extras/FvwmWharf/ASSound/README +++ /dev/null @@ -1 +0,0 @@ -ASSound must go to the AfterStep modules directory. diff --git a/app/fvwm/extras/FvwmWharf/FvwmWharf.1 b/app/fvwm/extras/FvwmWharf/FvwmWharf.1 deleted file mode 100644 index 9b3cee258..000000000 --- a/app/fvwm/extras/FvwmWharf/FvwmWharf.1 +++ /dev/null @@ -1,205 +0,0 @@ -.TH FvwmWharf 1.0 "October 1996" FvwmWharf -.UC -.SH NAME -FvwmWharf \- the AfterStep application "dock" module ported to -Fvwm. -.SH SYNOPSIS -FvwmWharf is spawned by Fvwm, so no command line invocation will work. - -.SH DESCRIPTION -The FvwmWharf module is a free-floating application loader that can -execute programs, "Swallow" running programs, and contain "Folders" of -more applications, among other things. The user can press the first -button at any time to trigger invocation of one of these functions, or -the user can press button two in order to cause the entire Wharf -to withdraw to the nearest corner in an iconized state. FvwmWharf only -works when Fvwm is used as the window manager. - -.SH COPYRIGHTS -The FvwmWharf module is copyright 1995 and 1996 by a variety of contributors. -They are, in alphabetical order, Beat Christen, Frank Fejes, Alfredo -Kenji Kojima, Dan Weeks, and Bo Yang - -The GoodStuff program, and the concept for -interfacing this module to the Window Manager, are all original work -by Robert Nation - -No guarantees or warranties or anything -are provided or implied in any way whatsoever. Use this program at your -own risk. Permission to use this program for any purpose is given, -as long as the copyright is kept intact. - - -.SH INITIALIZATION -During initialization, \fIFvwmWharf\fP will search for a configuration -file which describes the button panel geometry, color, icons, and -actions. The format of -this file will be described later. The configuration file will be the -one which Fvwm used during its initialization. - -If the FvwmWharf executable is linked to another name, ie ln -s -FvwmWharf Pier, then another module called Pier can be -started, with a completely different configuration than FvwmWharf, -simply by changing the keywords FvwmWharf??? to Pier???. This way multiple -button-bars can be used. - -.SH INVOCATION -FvwmWharf should be invoked in the same way as other -Fvwm modules. - -.SH CONFIGURATION OPTIONS -The following options can be placed in the .steprc file - -.IP "*FvwmWharfAnimate" -If specified, the opening and closing of Folders will be animated, -rather than simply drawn in one frame. - -.IP "*FvwmWharfAnimateMain" -Designates that full-length Wharf windraws will be animated. - -.IP "*FvwmWharfBgColor \fIcolor\fP" -If \fI*FvwmWharfTextureType 0\fP is specified, \fIFvwmWharf\fP's buttons -will be filled with \fIcolor\fP. - -.IP "*FvwmWharfColumns \fIcolumns\fP" -Specifies the number of columns of buttons to be created. If unspecified, -the number of columns will be set to 1. -If the columns are set to a number greater than 1 then there will be that number -of columns with enough rows to satisfy the requested number of buttons. - -.IP "*FvwmWharfForceSize" -If specified, will force pixmaps larger than 64x64 to the default -size. Pixmaps smaller than 64x64 are not supported. - -.IP "*FvwmWharfFullPush" -If specified, the entire FvwmWharf button background will be moved down -and to the right when pushed. Especially useful with *FvwmWharfNoBorder -textures. - -.IP "*FvwmWharfGeometry \fIgeometry\fP" -Specifies the FvwmWharf window location and/or size. If the size is -not specified, FvwmWharf will auto-size itself in a reasonable manner. -The geometry is a standard X11 window geometry specification. This option is -pre-set in the NEXTSTEP(tm) style section for a consistent look and feel with NEXTSTEP(tm). -Secondary FvwmWharf invocations from links may have their own geometry. - -.IP "*FvwmWharfMaxColors \fInumber\fP" -Specifies the maximum \fInumber\fP of colors to use on a gradient -fill. - -.IP "*FvwmWharfNoBorder" -Denotes that beveled borders should not be drawn around the FvwmWharf button. -Useful with textures that include their own bevels. - -.IP "*FvwmWharfPixmap \fIpixmap\fP" -Sets the pixmap file to be used as \fIFvwmWharf\fP's button. To be used -with \fI*FvwmWharfTextureType 128\fP. - -.IP "*FvwmWharfTextureColor \fIfrom\fP \fIto\fP" -When used with a \fI*FvwmWharfTextureType\fP of 1 to 5, designates the -ends of the gradient range to be used on \fIFvwmWharf\fP's buttons. - -.IP "*FvwmWharfTextureType \fItype\fP" -Specifies the type of gradient fill to be used on -\fIFvwmWharf\fP's buttons. Valid values are: -.nf -0 - No texture - use \fIFvwmWharfBgColor\fP to set the desired color -1 - Gradient from upper-left to lower right -2 - Horizontal one way gradient from top to bottom -3 - Horizontal cylindrical gradient from top/bottom to center -4 - Vertical one way gradient from left to right -5 - Vertical cylindrical gradient from left/right to center -128 - User specified pixmap -.fi -The default is the builtin \fIFvwmWharf\fP texture pixmap. - -.IP "*FvwmWharf \fIlabel icon command\fP" -Specifies a window manager built-in command or folder to activate -(folders will be discussed below), as described in the Fvwm -man page, which should be executed when a button is pressed. The label -field is an internal item that is still around from the GoodStuff module. -The icon field -specifies an X11 bitmap file, XPM color icon file, or a comma-delimited -set of pixmaps containing the -icon(s) to display on the button. FvwmWharf will search through the path -specified in the IconPath or PixmapPath configuration items to -find the icon file. - -NOTE: Icons must have one transparent pixel or the definition of a transparent color in order to be valid. - -If \fIcommand\fP is an Fvwm Exec command, then the button will -appear pushed in until the mouse button is released. - -A single extension to the Fvwm built-in command set is provided. -A command of the form: -.nf - -*FvwmWharf junk clock.xpm Swallow "Clock" asclock -shape -12 & - -.fi -will cause FvwmWharf to spawn an asclock process, and capture -the first window whose name or resource is "Clock", and display it in -the button-bar. This is handy for applications like xclock, xbiff, -xload, asclock, and asmail. Modules can be swallowed by specifying SwallowModule instead -of just "swallow" NOTE: if you use xclock for this application, you will want -to specify xclock -padding 0. - -For certain applications that overrun the 48 pixel by 48 pixel boundary of FvwmWharf -icons and Swallowed programs there is a special option called -.I MaxSwallow. -.I MaxSwallow -will allow the application to draw itself larger than the 48x48 boundary. It is -invoked the same way Swallow is. - -To create folder "slide-outs" in -.B FvwmWharf -the following format must be used: -.nf - -*FvwmWharf files Folders.xpm Folder -*FvwmWharf xftp 3DRings.xpm Exec xftp & -*FvwmWharf xdir FolderDeposit.xpm Exec xdir & -*FvwmWharf moxfm FilingCabinet.xpm Exec moxfm & -*FvwmWharf ~Folders - -.fi -The first line of this set tells FvwmWharf that this button definition will be a -folder. All of the button definitions between the -.I Folder -and the line with the definition of -.I *FvwmWharf ~Folders -will appear on the "files" folder when it is exposed. To expose the "files" -folder simply click on the FvwmWharf button with the Folders.xpm icon showing. A -button bar will appear perpendicular to your FvwmWharf bar and toward the center -of the screen. On this smaller bar will be the three icons that were configured -between the -.I Folder -and -.I ~Folder -parts of the FvwmWharf configuration. As many folder buttons may be configured as -is room on your screen. The only items that may not be configured within -folders are Swallowed applications and more folders. - -.SH DRAG AND DROP -\fIFvwmWharf\fP supports the OffiX Drag and Drop standard. In order to -have Drag and Drop enabled on a particular button, the following syntax -must be adhered to: -.nf - -*FvwmWharf nil nil DropExec "\fIprogram\fP" \fIprogram\fP %s -*FvwmWharf \fIprogram\fP \fIiconname\fP Exec "\fIprogram\fP" \fIprogram\fP - -.fi - -The button will call \fIprogram\fP when pushed. If a file is dragged -onto into it, \fIprogram\fP will be called with %s being replaced by -the dropped filename. - -.SH AUTHORS -.nf -Beat Christen (bchriste@iiic.ethz.ch) -Frank Fejes (frank@ssax.com) -Alfredo Kengi Kojima (kojima@inf.ufrgs.br) -Dan Weeks (dan@mango.sfasu.edu) -Bo Yang (eric@coeus.ucsd.edu) -.fi diff --git a/app/fvwm/extras/FvwmWharf/FvwmWharf.c b/app/fvwm/extras/FvwmWharf/FvwmWharf.c deleted file mode 100644 index 5b5975bd2..000000000 --- a/app/fvwm/extras/FvwmWharf/FvwmWharf.c +++ /dev/null @@ -1,2443 +0,0 @@ -/* Wharf.c. by Bo Yang. - * - * Copyright 1993, Robert Nation. - * - * Modifications: Copyright 1995 by Bo Yang. - * - * modifications made by Frank Fejes for AfterStep Copyright 1996 - * - * folder code Copyright 1996 by Beat Christen. - * - * swallowed button actions Copyright 1996 by Kaj Groner - * - * Various enhancements Copyright 1996 Alfredo K. Kojima - * - * button pushing styles - * configurable border drawing - * Change of icon creation code. Does not use shape extension anymore. - * each icon window now contains the whole background - * OffiX drop support added - * animation added - * withdraw on button2 click - * icon overlaying - * sound bindings - * - * based on GoodStuff.c by Robert Nation - * The GoodStuff module, and the entire GoodStuff program, and the concept for - * interfacing that module to the Window Manager, are all original work - * by Robert Nation - * - * No guarantees or warantees or anything - * are provided or implied in any way whatsoever. Use this program at your - * own risk. Permission to use this program for any purpose is given, - * as long as the copyright is kept intact. */ - -#define TRUE 1 -#define FALSE 0 -#define DOUBLECLICKTIME 1 - -#include "config.h" - -#ifdef HAVE_SYS_BSDTYPES_H -#include <sys/bsdtypes.h> /* Saul */ -#endif - -#include <stdio.h> -#include <signal.h> -#include <fcntl.h> -#include <string.h> -#include <sys/wait.h> -#include <sys/time.h> - -#if HAVE_SYS_SELECT_H -#include <sys/select.h> -#endif - -#include <unistd.h> -#include <ctype.h> -#include <stdlib.h> -#include "../../fvwm/module.h" -#include <X11/Xlib.h> -#include <X11/Xutil.h> -#include <X11/Xproto.h> -#include <X11/Xatom.h> -#include <X11/Intrinsic.h> -#include <syslog.h> - -#include "Wharf.h" -#define AFTER_ICONS 1 -/*#include "../../afterstep/asbuttons.h" pdg */ - -#ifdef ENABLE_DND -#include "OffiX/DragAndDrop.h" -#include "OffiX/DragAndDropTypes.h" -#endif - -#include "stepgfx.h" - -/* - * You may want to raise the following values if your machine is fast - */ -#define ANIM_STEP 2 /* must be >= 1. Greater is smoother and slower */ -#define ANIM_STEP_MAIN 1 /* same for the main folder */ -#define ANIM_DELAY 10 - -#ifdef ENABLE_SOUND -#define WHEV_PUSH 0 -#define WHEV_CLOSE_FOLDER 1 -#define WHEV_OPEN_FOLDER 2 -#define WHEV_CLOSE_MAIN 3 -#define WHEV_OPEN_MAIN 4 -#define WHEV_DROP 5 -#define MAX_EVENTS 6 - -int SoundActive = 0; -char *Sounds[6]={".",".",".",".",".","."}; -char *SoundPlayer=NULL; -char *SoundPath="."; - -pid_t SoundThread; -int PlayerChannel[2]; - -/*char *ModulePath=AFTERDIR; pdg */ -#endif - -char *MyName; - -Display *dpy; -int x_fd,fd_width; -int ROWS = FALSE; - -Window Root; -int screen; -int flags; -long d_depth; -Bool NoBorder=0; -Bool Pushed = 0; -Bool Pushable = 1; -Bool ForceSize=0; -Pixel back_pix, fore_pix, light_grey; -GC NormalGC, HiReliefGC, HiInnerGC; - -GC MaskGC, DefGC; -int AnimationStyle=0,AnimateMain=0; -int PushStyle=0; -int AnimationDir=1; - -Window main_win; -int Width, Height,win_x,win_y; -unsigned int display_width, display_height; - -#define MW_EVENTS (ExposureMask | ButtonReleaseMask |\ - ButtonPressMask | LeaveWindowMask | EnterWindowMask) -XSizeHints mysizehints; -int num_buttons = 0; -int num_folderbuttons = MAX_BUTTONS; -int num_folders = 0; -int num_rows = 0; -int num_columns = 0; -int max_icon_width = 30,max_icon_height = 0; -int BUTTONWIDTH, BUTTONHEIGHT; -int x= -100000,y= -100000,w= -1,h= -1,gravity = NorthWestGravity; -int new_desk = 0; -int pageing_enabled = 1; -int ready = 0; - -int CurrentButton = -1; -int fd[2]; - -struct button_info Buttons[BUTTON_ARRAY_LN]; -struct folder_info Folders[FOLDER_ARRAY_LN]; - -char *iconPath = NULL; -char *pixmapPath = NULL; - -static Atom wm_del_win; -Atom _XA_WM_PROTOCOLS; -Atom _XA_WM_NAME; -#ifdef ENABLE_DND -Atom DndProtocol; -Atom DndSelection; -#endif -int TextureType=TEXTURE_BUILTIN; -char *BgPixmapFile=NULL; -int FromColor[3]={0x4000,0x4000,0x4000}, ToColor[3]={0x8000,0x8000,0x8000}; -Pixel BgColor=0; -int MaxColors=16; -int Withdrawn; - -#define DIR_TOLEFT 1 -#define DIR_TORIGHT 2 -#define DIR_TOUP 3 -#define DIR_TODOWN 4 - -#ifdef ENABLE_SOUND -void waitchild(int bullshit) -{ - int stat; - - wait(&stat); - SoundActive=0; -} -#endif - -unsigned int lock_mods[256]; -void FindLockMods(void); - - -/*********************************************************************** - * - * Procedure: - * main - start of afterstep - * - *********************************************************************** - */ -int main(int argc, char **argv) -{ - char *display_name = NULL; - int i,j; - Window root; - int x,y,border_width,button; - int depth; - char *temp, *s; - temp = argv[0]; - - s=strrchr(argv[0], '/'); - if (s != NULL) - temp = s + 1; - - MyName = safemalloc(strlen(temp)+1); - strcpy(MyName, temp); - - for(i=0;i<BUTTON_ARRAY_LN;i++) - { -#ifdef ENABLE_DND - Buttons[i].drop_action = NULL; -#endif - Buttons[i].title = NULL; - Buttons[i].action = NULL; - Buttons[i].iconno = 0; - for(j=0;j<MAX_OVERLAY;j++) { - Buttons[i].icons[j].file = NULL; - Buttons[i].icons[j].w = 0; - Buttons[i].icons[j].h = 0; - Buttons[i].icons[j].mask = None; /* pixmap for the icon mask */ - Buttons[i].icons[j].icon = None; - Buttons[i].icons[j].depth = 0; - } - Buttons[i].IconWin = None; - Buttons[i].completeIcon = None; - Buttons[i].up = 1; /* Buttons start up */ - Buttons[i].hangon = NULL; /* don't wait on anything yet*/ - Buttons[i].folder = -1; - } - signal (SIGPIPE, DeadPipe); - if((argc != 6)&&(argc != 7)) - { - fprintf(stderr,"%s Version %s should only be executed by AfterStep!\n", - MyName, VERSION); - exit(1); - } - fd[0] = atoi(argv[1]); - fd[1] = atoi(argv[2]); - - if (!(dpy = XOpenDisplay(display_name))) - { - fprintf(stderr,"%s: can't open display %s", MyName, - XDisplayName(display_name)); - exit (1); - } - x_fd = XConnectionNumber(dpy); - - fd_width = GetFdWidth(); - - screen= DefaultScreen(dpy); - Root = RootWindow(dpy, screen); - if(Root == None) - { - fprintf(stderr,"%s: Screen %d is not valid ", MyName, screen); - exit(1); - } - display_width = DisplayWidth(dpy, screen); - display_height = DisplayHeight(dpy, screen); - - d_depth = DefaultDepth(dpy, screen); - - SetMessageMask(fd, M_NEW_DESK | M_END_WINDOWLIST | M_MAP | M_WINDOW_NAME | - M_RES_CLASS | M_CONFIG_INFO | M_END_CONFIG_INFO | M_RES_NAME); -/* - sprintf(set_mask_mesg,"SET_MASK %lu\n", - (unsigned long)(M_NEW_DESK | - M_END_WINDOWLIST| - M_MAP| - M_RES_NAME| - M_RES_CLASS| - M_WINDOW_NAME)); - - SendText(fd,set_mask_mesg,0); -*/ - ParseOptions(argv[3]); - if(num_buttons == 0) - { - fprintf(stderr,"%s: No Buttons defined. Quitting\n", MyName); - exit(0); - } - -#ifdef ENABLE_SOUND - /* startup sound subsystem */ - if (SoundActive) { - if (pipe(PlayerChannel)<0) { - fprintf(stderr,"%s: could not create pipe. Disabling sound\n"); - SoundActive=0; - } else { - signal(SIGCHLD,waitchild); - SoundThread=fork(); - if (SoundThread<0) { - fprintf(stderr,"%s: could not fork(). Disabling sound", - MyName); - perror("."); - SoundActive=0; - } else if (SoundThread==0) { /* in the sound player process */ - char *margv[9], *name; - int i; - - margv[0]="ASSound"; - name = findIconFile("ASSound",ModulePath,X_OK); - if(name == NULL) { - fprintf(stderr,"Wharf: couldn't find ASSound\n"); - SoundActive = 0; - } else { - margv[1]=safemalloc(16); - close(PlayerChannel[1]); - sprintf(margv[1],"%x",PlayerChannel[0]); - if (SoundPlayer!=NULL) - margv[2]=SoundPlayer; - else - margv[2]="-"; - for(i=0;i<MAX_EVENTS;i++) { - if (Sounds[i][0]=='.') { - margv[i+3]=Sounds[i]; - } else { - margv[i+3]=safemalloc(strlen(Sounds[i]) - +strlen(SoundPath)+4); - sprintf(margv[i+3],"%s/%s",SoundPath,Sounds[i]); - } - } - margv[i+3]=NULL; - execvp(name,margv); - fprintf(stderr,"Wharf: couldn't spawn ASSound\n"); - exit(1); - } - } else { /* in parent */ - close(PlayerChannel[0]); - } - } - } -#endif - - CreateShadowGC(); - - switch (TextureType) { - case TEXTURE_PIXMAP: - if (BgPixmapFile==NULL) { - fprintf(stderr,"%s: No Button background pixmap defined.Using default\n", MyName); - goto Builtin; - } - Buttons[BACK_BUTTON].icons[0].file=BgPixmapFile; - if (GetXPMFile(BACK_BUTTON,0)) - break; - else goto Solid; - case TEXTURE_GRADIENT: - case TEXTURE_HGRADIENT: - case TEXTURE_HCGRADIENT: - case TEXTURE_VGRADIENT: - case TEXTURE_VCGRADIENT: - if (GetXPMGradient(BACK_BUTTON, FromColor, ToColor, MaxColors,TextureType)) - break; - else goto Solid; - - case TEXTURE_BUILTIN: - Builtin: - TextureType=TEXTURE_BUILTIN; -/* if (GetXPMData( BACK_BUTTON, button_xpm)) - break; -pdg */ - default: -Solid: - TextureType=TEXTURE_SOLID; - if (GetSolidXPM(BACK_BUTTON, BgColor)) - break; - else { - fprintf( stderr, "back Wharf button creation\n"); - exit(-1); - } - } - for(i=0;i<num_buttons;i++) - { - for(j=0;j<Buttons[i].iconno;j++) { - LoadIconFile(i,j); - } - } - for(i=num_folderbuttons;i<MAX_BUTTONS;i++) { - for(j=0;j<Buttons[i].iconno;j++) { - LoadIconFile(i,j); - } - } -#ifdef ENABLE_DND - DndProtocol=XInternAtom(dpy,"DndProtocol",False); - DndSelection=XInternAtom(dpy,"DndSelection",False); -#endif - - - CreateWindow(); - for(i=0;i<num_buttons;i++) { - CreateIconWindow(i, &main_win); - } - for(i=num_folderbuttons;i<MAX_BUTTONS;i++) - CreateIconWindow(i, Buttons[i].parent); - XGetGeometry(dpy,main_win,&root,&x,&y, - (unsigned int *)&Width,(unsigned int *)&Height, - (unsigned int *)&border_width,(unsigned int *)&depth); - - for(i=0;i<num_rows;i++) - for(j=0;j<num_columns; j++) - { - button = i*num_columns + j; - ConfigureIconWindow(button,i,j); - }; - for(i=0;i<num_folders;i++) - for(j=0;j<Folders[i].count;j++) - if(num_columns < num_rows) { - ConfigureIconWindow(Folders[i].firstbutton+j,0, j); - } else { - ConfigureIconWindow(Folders[i].firstbutton+j,j, 0); - } - /* dirty hack to make swallowed app background be textured */ - XSetWindowBackgroundPixmap(dpy, main_win, Buttons[BACK_BUTTON].icons[0].icon); - XMapSubwindows(dpy,main_win); - XMapWindow(dpy,main_win); - for(i=0;i<num_folders;i++) - XMapSubwindows(dpy, Folders[i].win); - - FindLockMods(); - - /* request a window list, since this triggers a response which - * will tell us the current desktop and paging status, needed to - * indent buttons correctly */ - SendText(fd,"Send_WindowList",0); - Loop(); - return 0; -} - -/*********************************************************************** - * - * Procedure: - * Loop - wait for data to process - * - ***********************************************************************/ - -void Loop(void) -{ - Window *CurrentWin=None; - int x,y,CurrentRow,CurrentColumn,CurrentBase=0; - XEvent Event; - int NewButton,i=0,j=0,i2, bl=-1; - int LastMapped=-1; - time_t t, tl = (time_t) 0; - int CancelPush=0; - - while(1) - { - if(My_XNextEvent(dpy,&Event)) - { - switch(Event.type) - { - - case Expose: - for(x=0;x<num_folders;x++) - if(Event.xany.window == Folders[x].win ) - { - RedrawWindow(&Folders[x].win,num_folderbuttons, -1, Folders[x].cols,Folders[x].rows); - for(y=1;y<=Folders[x].count;y++) - if(num_columns<num_rows) - RedrawUnpushedOutline(&Folders[x].win, 1, y); - else - RedrawUnpushedOutline(&Folders[x].win, y, 1); - } - if (Pushed) - break; - if((Event.xexpose.count == 0)&& - (Event.xany.window == main_win)) - { - if(ready < 1) - ready ++; - RedrawWindow(&main_win,0, -1, num_rows, num_columns); - } - break; - - case ButtonPress: - if (Event.xbutton.button != Button1) { - if (Event.xbutton.button == Button2) { - static int LastX, LastY; - - if (LastMapped != -1) { - CloseFolder(LastMapped); - Folders[LastMapped].mapped = NOTMAPPED; - LastMapped=-1; - } - if (Withdrawn) { -#ifdef ENABLE_SOUND - PlaySound(WHEV_OPEN_MAIN); -#endif - if (AnimationStyle>0 && AnimateMain) - OpenFolder(-1,LastX,LastY,Width,Height, - AnimationDir); - else - XMoveResizeWindow(dpy,main_win,LastX,LastY, - Width,Height); - Withdrawn=0; - } else { - Window junk; - int junk2,junk3,junk4,junk5; - int CornerX, CornerY; - -#ifdef ENABLE_SOUND - PlaySound(WHEV_CLOSE_MAIN); -#endif - XGetGeometry(dpy,main_win,&junk,&LastX,&LastY, - &junk2,&junk3,&junk4,&junk5); - XTranslateCoordinates(dpy,main_win,Root, - LastX,LastY, - &LastX,&LastY,&junk); - if (num_rows<num_columns) { /* horizontal */ - if (LastY > display_height/2) { - CornerY = display_height-BUTTONHEIGHT; - } else { - CornerY = 0; - } - if (Event.xbutton.x>num_columns*BUTTONWIDTH/2) { - CornerX = display_width - BUTTONWIDTH; - AnimationDir = DIR_TOLEFT; - } else { - CornerX = 0; - AnimationDir = DIR_TORIGHT; - } - if (AnimationStyle>0 && AnimateMain) { - CloseFolder(-1); - XMoveWindow(dpy,main_win, CornerX, CornerY); - } else { - XMoveResizeWindow(dpy,main_win, - CornerX, CornerY, - BUTTONWIDTH,BUTTONHEIGHT); - } - } else { /* vertical */ - if (LastX > display_width/2) { - CornerX = display_width - BUTTONWIDTH; - } else { - CornerX = 0; - } - if (Event.xbutton.y>num_rows*BUTTONHEIGHT/2) { - CornerY = display_height-BUTTONHEIGHT; - AnimationDir = DIR_TOUP; - } else { - CornerY = 0; - AnimationDir = DIR_TODOWN; - } - if (AnimationStyle>0 && AnimateMain) { - CloseFolder(-1); - XMoveWindow(dpy,main_win, CornerX, CornerY); - } else { - XMoveResizeWindow(dpy,main_win, - CornerX, CornerY, - BUTTONWIDTH,BUTTONHEIGHT); - } - } - Withdrawn=1; - } - } - break; - } -#ifdef ENABLE_SOUND - PlaySound(WHEV_PUSH); -#endif - CancelPush = 0; - CurrentWin = &Event.xbutton.window; - CurrentBase = 0; - CurrentRow = (Event.xbutton.y/BUTTONHEIGHT); - CurrentColumn = (Event.xbutton.x/BUTTONWIDTH); - if (*CurrentWin!=main_win) { - CurrentButton = CurrentBase + CurrentColumn*num_rows - + CurrentRow*num_columns; - } else { - CurrentButton = CurrentBase + CurrentColumn - + CurrentRow*num_columns; - if (CurrentButton>=num_buttons) { - CurrentButton = -1; - break; - } - } - - for(x=0;x<num_buttons;x++) - { - if (*CurrentWin == Buttons[x].IconWin) - { - CurrentButton = x; - CurrentRow = x / num_columns; - CurrentColumn = x % num_columns; - } - } - - for(x=0;x<num_folders;x++) - if(*CurrentWin == Folders[x].win) - { - CurrentBase = Folders[x].firstbutton; - if (num_rows<num_columns) - CurrentButton = CurrentBase + CurrentRow; - else - CurrentButton = CurrentBase + CurrentColumn; - } - i = CurrentRow+1; - j = CurrentColumn +1; - - if (Buttons[CurrentButton].swallow == 1 || - Buttons[CurrentButton].swallow == 2 || - Buttons[CurrentButton].action == NULL) - break; - - if (Pushable) - { - if (Buttons[CurrentButton].swallow != 3 && - Buttons[CurrentButton].swallow != 4) - { - Pushed = 1; - RedrawPushed(CurrentWin, i, j); - } - } - if (strncasecmp(Buttons[CurrentButton].action,"Folder",6)==0) { - Window junk; - int junk2,junk3,junk4,junk5; - XGetGeometry(dpy,main_win,&junk,&x,&y, - &junk2,&junk3,&junk4,&junk5); - XTranslateCoordinates(dpy,main_win,Root, - x,y, - &x,&y,&junk); -/* kludge until Beat takes a look */ -if ((num_columns == 1) && (num_rows == 1)) - MapFolder(Buttons[CurrentButton].folder, - &LastMapped, - x, y, - 1,1); -else - MapFolder(Buttons[CurrentButton].folder, - &LastMapped, - x, y, - CurrentRow, CurrentColumn); - } - break; - case EnterNotify: - CancelPush = 0; - break; - case LeaveNotify: - CancelPush = 1; - break; -#ifdef ENABLE_DND - case ClientMessage: - if (Event.xclient.message_type==DndProtocol) { - unsigned long dummy_r,size; - Atom dummy_a; - int dummy_f; - unsigned char *data, *Command; - - Window dummy_rt, dummy_c; - int dummy_x, dummy_y, base, pos_x, pos_y; - unsigned int dummy; - -/* if (Event.xclient.data.l[0]!=DndFile || - Event.xclient.data.l[0]!=DndFiles || - Event.xclient.data.l[0]!=DndExe - ) - break; */ - - XQueryPointer(dpy,main_win, - &dummy_rt,&dummy_c, - &dummy_x,&dummy_y, - &pos_x,&pos_y, - &dummy); - base = 0; - dummy_y = (pos_y/BUTTONHEIGHT); - dummy_x= (pos_x/BUTTONWIDTH); - dummy = base + dummy_x + dummy_y*num_columns; - - /* - for(x=0;x<num_folders;x++) { - if(Event.xbutton.window == Folders[x].win) { - base = Folders[x].firstbutton; - dummy = base + dummy_y + dummy_x -1; - } - } */ - if (Buttons[dummy].drop_action == NULL) - break; - dummy_x++; - dummy_y++; - CurrentWin=Buttons[dummy].parent; - if (Pushable) { - RedrawPushedOutline(CurrentWin, dummy_y, dummy_x); - XSync(dpy, 0); - } - XGetWindowProperty(dpy, Root, DndSelection, 0L, - 100000L, False, AnyPropertyType, - &dummy_a, &dummy_f, - &size,&dummy_r, - &data); - if (Event.xclient.data.l[0]==DndFiles) { - for (dummy_r = 0; dummy_r<size-1; dummy_r++) { - if (data[dummy_r]==0) - data[dummy_r]=' '; - } - } -#ifdef ENABLE_SOUND - PlaySound(WHEV_DROP); -#endif - Command=(unsigned char *)safemalloc(strlen((char *)data) - + strlen((char *)(Buttons[dummy].drop_action))); - sprintf((char *)Command,Buttons[dummy].drop_action, - data,Event.xclient.data.l[0]); - SendInfo(fd,(char *)Command,0); - free(Command); - if (Pushable) { - usleep(50000); - XClearWindow(dpy,Buttons[dummy].IconWin); - RedrawUnpushedOutline(CurrentWin, dummy_y, dummy_x); - } - } - break; -#endif /* ENABLE_DND */ - case ButtonRelease: - if ((Event.xbutton.button != Button1) || - (Buttons[CurrentButton].swallow == 1) || - (Buttons[CurrentButton].swallow == 2) || - (Buttons[CurrentButton].action == NULL)) { - break; - } - - CurrentRow = (Event.xbutton.y/BUTTONHEIGHT); - CurrentColumn = (Event.xbutton.x/BUTTONWIDTH); - - if (Pushable) - { - if (Buttons[CurrentButton].swallow != 3 && - Buttons[CurrentButton].swallow != 4) - { - Pushed=0; - RedrawUnpushed(CurrentWin, i, j); - } - } - if (CancelPush) - break; - if (*CurrentWin!=main_win) { - NewButton = CurrentBase + CurrentColumn*num_rows - + CurrentRow*num_columns; - } else { - NewButton = CurrentBase + CurrentColumn - + CurrentRow*num_columns; - } - - for(x=0;x<num_folders;x++) - if(*CurrentWin == Folders[x].win) - { - if (num_rows<num_columns) - NewButton = Folders[x].firstbutton + CurrentRow; - else - NewButton = Folders[x].firstbutton + CurrentColumn; - } - for (x=0;x<num_buttons;x++) - { - if (*CurrentWin == Buttons[x].IconWin) - { - NewButton = x; - CurrentRow = x / num_columns; - CurrentColumn = x % num_columns; - } - } - - if(NewButton == CurrentButton) - { - t = time( 0); - bl = -1; - tl = -1; - if(strncasecmp(Buttons[CurrentButton].action,"Folder",6)!=0) - { - if (LastMapped != -1 && CurrentWin != &main_win) - { - CloseFolder(LastMapped); - Folders[LastMapped].mapped = NOTMAPPED; - LastMapped = -1; - } - SendInfo(fd,Buttons[CurrentButton].action,0); - } - if((Buttons[CurrentButton].action)&& - (strncasecmp(Buttons[CurrentButton].action,"exec",4)== 0)) - { - i=4; - while((Buttons[CurrentButton].action[i] != 0)&& - (Buttons[CurrentButton].action[i] != '"')) - i++; - i2=i+1; - - while((Buttons[CurrentButton].action[i2] != 0)&& - (Buttons[CurrentButton].action[i2] != '"')) - i2++; - if(i2 - i >1) - { - Buttons[CurrentButton].hangon = safemalloc(i2-i); - strncpy(Buttons[CurrentButton].hangon, - &Buttons[CurrentButton].action[i+1],i2-i-1); - Buttons[CurrentButton].hangon[i2-i-1] = 0; - Buttons[CurrentButton].up = 0; - if (Buttons[CurrentButton].swallow == 3 || - Buttons[CurrentButton].swallow == 4) - Buttons[CurrentButton].swallow = 4; - else - Buttons[CurrentButton].swallow = 0; - } - } - } - break; - - /* - case ClientMessage: - if ((Event.xclient.format==32) && - (Event.xclient.data.l[0]==wm_del_win)) - { - DeadPipe(1); - } - break; - case PropertyNotify: - if (Pushed) - break; - for(i=0;i<num_rows;i++) - for(j=0;j<num_columns; j++) - { - button = i*num_columns + j; - if(((Buttons[button].swallow == 3)|| - (Buttons[button.swallow == 4))&& - (Event.xany.window == Buttons[button].IconWin)&& - (Event.xproperty.atom == XA_WM_NAME)) - { - XFetchName(dpy, Buttons[button].IconWin, &temp); - if(strcmp(Buttons[button].title,"-")!=0) - CopyString(&Buttons[button].title, temp); - XFree(temp); - XClearArea(dpy,main_win,j*BUTTONWIDTH, - i*BUTTONHEIGHT, BUTTONWIDTH,BUTTONHEIGHT,0); - RedrawWindow(&main_win,0, button, num_rows, num_columns); - } - } - break; - */ - default: - break; - } - } - } -} - -void OpenFolder(int folder,int x, int y, int w, int h, int direction) -{ - int winc, hinc; - int cx, cy, cw, ch; - Window win; - int isize; - - if (folder<0) { - winc = BUTTONWIDTH/ANIM_STEP_MAIN; - hinc = BUTTONHEIGHT/ANIM_STEP_MAIN; - } else { - winc = BUTTONWIDTH/ANIM_STEP; - hinc = BUTTONHEIGHT/ANIM_STEP; - } - - if (folder>=0) { - win = Folders[folder].win; - Folders[folder].direction = direction; - if (direction == DIR_TOLEFT || direction == DIR_TORIGHT) - isize = winc; - else - isize = hinc; - } else { - win = main_win; - if (direction == DIR_TOLEFT || direction == DIR_TORIGHT) - isize = BUTTONWIDTH; - else - isize = BUTTONHEIGHT; - } - cx = x; cy = y; - ch = h; cw = w; - if (AnimationStyle==0) { - XMapWindow(dpy, win); - } else - switch (direction) { - case DIR_TOLEFT: - cx = x+w; - XMoveResizeWindow(dpy,win,cx,y, 1, h); - XMapWindow(dpy, win); - for(cw=isize;cw<=w;cw+=winc) { - cx -= winc; - usleep(ANIM_DELAY/2); - XMoveResizeWindow(dpy,win,cx,y, cw,h); - XSync(dpy,0); - } - break; - case DIR_TORIGHT: - XMoveResizeWindow(dpy,win,x,y, 1, h); - XMapWindow(dpy, win); - for(cw=isize;cw<=w;cw+=winc) { - usleep(ANIM_DELAY/2); - XMoveResizeWindow(dpy,win,x,y, cw,h); - XSync(dpy,0); - } - break; - case DIR_TOUP: - cy = y+h; - XMoveResizeWindow(dpy,win,x,cy, w, 1); - XMapWindow(dpy, win); - for(ch=isize;ch<=h;ch+=hinc) { - cy -= hinc; - usleep(ANIM_DELAY/2); - XMoveResizeWindow(dpy,win,x,cy, w, ch); - XSync(dpy,0); - } - break; - case DIR_TODOWN: - XMoveResizeWindow(dpy,win,x,y, w, 1); - XMapWindow(dpy, win); - for(ch=isize;ch<=h;ch+=hinc) { - usleep(ANIM_DELAY/2); - XMoveResizeWindow(dpy,win,x,y, w, ch); - XSync(dpy,0); - } - break; - default: - XBell(dpy,100); - fprintf(stderr,"WHARF INTERNAL BUG in OpenFolder()\n"); - exit(-1); - } - - if (cw!=w || ch!=h || x != cx || cy != y || AnimationStyle==0) - XMoveResizeWindow(dpy,win,x,y,w,h); -} - - - -void CloseFolder(int folder) -{ - int winc, hinc; - int cx, cy, cw, ch; - int x,y,w,h, junk_depth, junk_bd; - int fsize, direction; - Window win, junk_win; - -#ifdef ENABLE_SOUND - PlaySound(WHEV_CLOSE_FOLDER); -#endif - if (folder<0) { - winc = BUTTONWIDTH/ANIM_STEP_MAIN; - hinc = BUTTONHEIGHT/ANIM_STEP_MAIN; - } else { - winc = BUTTONWIDTH/ANIM_STEP; - hinc = BUTTONHEIGHT/ANIM_STEP; - } - if (folder < 0) { - win = main_win; - direction = AnimationDir; - if (direction==DIR_TOUP || direction==DIR_TODOWN) - fsize=BUTTONHEIGHT; - else - fsize=BUTTONWIDTH; - } else { - direction = Folders[folder].direction; - win = Folders[folder].win; - if (direction==DIR_TOUP || direction==DIR_TODOWN) - fsize=hinc; - else - fsize=winc; - } - if (AnimationStyle==0) { - goto end; - } - XGetGeometry(dpy,win,&junk_win,&x,&y,&w,&h,&junk_bd,&junk_depth); - XTranslateCoordinates(dpy,win,Root,x,y,&x,&y,&junk_win); - switch (direction) { - case DIR_TOLEFT: - cx = x; - for(cw=w;cw >= fsize; cw-=winc) { - XMoveResizeWindow(dpy,win,cx,y, cw,h); - XSync(dpy,0); - usleep(ANIM_DELAY); - cx += winc; - } - break; - case DIR_TORIGHT: - for(cw=w;cw >= fsize; cw-=winc) { - XMoveResizeWindow(dpy,win,x,y, cw,h); - XSync(dpy,0); - usleep(ANIM_DELAY); - } - break; - case DIR_TOUP: - cy = y; - for(ch=h;ch >= fsize; ch-=hinc) { - XMoveResizeWindow(dpy,win,x,cy, w,ch); - XSync(dpy,0); - usleep(ANIM_DELAY); - cy += hinc; - } - break; - case DIR_TODOWN: - for(ch=h;ch >= fsize; ch-=hinc) { - XMoveResizeWindow(dpy,win,x,y, w, ch); - XSync(dpy,0); - usleep(ANIM_DELAY); - } - break; - default: - XBell(dpy,100); - fprintf(stderr,"WHARF INTERNAL BUG in CloseFolder()\n"); - exit(-1); - } - Folders[folder].direction = 0; - end: - if (folder<0) { - XResizeWindow(dpy,win,BUTTONWIDTH,BUTTONHEIGHT); - } else { - XUnmapWindow(dpy,win); - } -} - - -void MapFolder(int folder, int *LastMapped, int base_x, int base_y, int row, int col) -{ - int dir; - - if (Folders[folder].mapped ==ISMAPPED) - { - CloseFolder(folder); - Folders[folder].mapped = NOTMAPPED; - *LastMapped = -1; - } - else - { - int folderx, foldery, folderw, folderh; - if (*LastMapped != -1) - { - CloseFolder(*LastMapped); - Folders[*LastMapped].mapped = NOTMAPPED; - *LastMapped = -1; - } - Folders[folder].mapped = ISMAPPED; - if(num_columns < num_rows) - { - if((base_x % display_width) > display_width / 2 ) { - folderx = base_x+(col-Folders[folder].count)*BUTTONWIDTH-2; - dir = DIR_TOLEFT; - } - else { - folderx = base_x+(col+1)*BUTTONHEIGHT+1; - dir = DIR_TORIGHT; - } - foldery = base_y+row*BUTTONHEIGHT; - folderw = Folders[folder].count*BUTTONWIDTH; - folderh = BUTTONHEIGHT; - } -/* more kludgery */ - else if (num_columns == num_rows) - { -/* - if((base_x % display_width) > display_width / 2 ) - folderx = (col-Folders[folder].count)*BUTTONHEIGHT-2; - else - folderx = (col+1)*BUTTONHEIGHT+1; -*/ - if (ROWS) - { - if ((base_y % display_height) > display_height / 2) { - foldery = base_y-(Folders[folder].count)*BUTTONHEIGHT-2; - dir = DIR_TOUP; - } - else { - foldery = base_y+BUTTONHEIGHT+2; - dir = DIR_TODOWN; - } - folderx = base_x; - folderw = BUTTONWIDTH; - folderh = (Folders[folder].count)*BUTTONHEIGHT; - } - else - { - if((base_x % display_width) > display_width / 2 ) { - folderx = base_x-(Folders[folder].count)*BUTTONWIDTH-2; - dir = DIR_TOLEFT; - } - else { - folderx = base_x+BUTTONWIDTH+1; - dir = DIR_TORIGHT; - } - foldery = base_y-1; - folderh = BUTTONHEIGHT; - folderw = (Folders[folder].count)*BUTTONWIDTH; - } - } - else - { - if ((base_y % display_height) < display_height / 2) { - foldery =base_y+(row+1)*BUTTONHEIGHT; - dir = DIR_TODOWN; - } - else { - foldery = base_y+(row-Folders[folder].count)*BUTTONHEIGHT; - dir = DIR_TOUP; - } - folderx = base_x+col*BUTTONWIDTH; - folderw = BUTTONWIDTH; - folderh = (Folders[folder].count)*BUTTONHEIGHT; - } - -#ifdef ENABLE_SOUND - PlaySound(WHEV_OPEN_FOLDER); -#endif - XMoveWindow(dpy, Folders[folder].win, folderx, foldery); - OpenFolder(folder,folderx, foldery, folderw, folderh, dir); - *LastMapped = folder; - } -} - -void -DrawOutline(Drawable d, int w, int h) -{ - if (NoBorder) - return; -/* top */ - XDrawLine( dpy, d, HiInnerGC, 0, 0, w-1, 0); - /* - XDrawLine( dpy, d, HiInnerGC, 0, 1, w-1, 1); -*/ -/* bottom */ - XFillRectangle(dpy, d, NormalGC, 0,h-2,w-1,h-1); - -/* left */ - XDrawLine( dpy, d, HiInnerGC, 0, 1, 0, h-1); - /* - XDrawLine( dpy, d, HiInnerGC, 1, 2, 1, h-2); - */ -/* right */ - XDrawLine( dpy, d, NormalGC, w-1, 1, w-1, h-1); - XDrawLine( dpy, d, NormalGC, w-2, 2, w-2, h-2); -} - -void RedrawUnpushed(Window *win, int i, int j) -{ - if (PushStyle!=0) { - XMoveResizeWindow(dpy, Buttons[CurrentButton].IconWin, - (j-1)*BUTTONWIDTH ,(i-1)*BUTTONHEIGHT, - BUTTONWIDTH, BUTTONHEIGHT); - } else { - XCopyArea( dpy, Buttons[CurrentButton].completeIcon, - Buttons[CurrentButton].IconWin, NormalGC, 0, 0, - Buttons[BACK_BUTTON].icons[0].w, - Buttons[BACK_BUTTON].icons[0].h, - 0,0); - } - RedrawWindow(win,0, CurrentButton, num_rows, num_columns); - - RedrawUnpushedOutline(win, i, j); -} - -void RedrawUnpushedOutline(Window *win, int i, int j) -{ -/* top */ - if (NoBorder) { - return; - } - - XDrawLine( dpy, *win, HiInnerGC, - j*BUTTONWIDTH-BUTTONWIDTH, i*BUTTONHEIGHT-BUTTONHEIGHT, - j*BUTTONWIDTH,i*BUTTONHEIGHT-BUTTONHEIGHT); -/* - XDrawLine( dpy, *win, HiInnerGC, j*BUTTONWIDTH-BUTTONWIDTH, - i*BUTTONHEIGHT-BUTTONHEIGHT+1, j*BUTTONWIDTH, - i*BUTTONHEIGHT-BUTTONHEIGHT+1); - */ - /* left */ - XDrawLine( dpy, *win, HiInnerGC, j*BUTTONWIDTH-BUTTONWIDTH, - i*BUTTONHEIGHT-BUTTONHEIGHT+1, j*BUTTONWIDTH-BUTTONWIDTH, - i*BUTTONHEIGHT-1); - /* - XDrawLine( dpy, *win, HiInnerGC, j*BUTTONWIDTH - -BUTTONWIDTH+1, i*BUTTONHEIGHT-BUTTONHEIGHT+2, - j*BUTTONWIDTH-BUTTONWIDTH+1 ,i*BUTTONHEIGHT-1); - */ - /* right */ - XDrawLine( dpy, *win, NormalGC, j*BUTTONWIDTH-BUTTONWIDTH - +BUTTONWIDTH-2, i*BUTTONHEIGHT-BUTTONHEIGHT+2, j*BUTTONWIDTH - -BUTTONWIDTH+BUTTONWIDTH-2 ,i*BUTTONHEIGHT-1); - - XDrawLine( dpy, *win, NormalGC, j*BUTTONWIDTH-BUTTONWIDTH - +BUTTONWIDTH-1, i*BUTTONHEIGHT-BUTTONHEIGHT+1, - j*BUTTONWIDTH-BUTTONWIDTH+BUTTONWIDTH-1 ,i*BUTTONHEIGHT-1); - - /* bottom */ - XDrawLine( dpy, *win, NormalGC, j*BUTTONWIDTH - -BUTTONWIDTH+1, i*BUTTONHEIGHT-1, j*BUTTONWIDTH-BUTTONWIDTH - +BUTTONWIDTH-2,i*BUTTONHEIGHT-1); - - XDrawLine( dpy, *win, NormalGC, j*BUTTONWIDTH-BUTTONWIDTH - +1, i*BUTTONHEIGHT-2, j*BUTTONWIDTH-BUTTONWIDTH+BUTTONWIDTH-2, - i*BUTTONHEIGHT-2); -} - -void RedrawPushed(Window *win, int i,int j) -{ - if (PushStyle!=0) { - XMoveResizeWindow(dpy, Buttons[CurrentButton].IconWin, - 2+(j-1)*BUTTONWIDTH,(i-1)*BUTTONHEIGHT+2, - BUTTONWIDTH-2, BUTTONHEIGHT-2); - } else { - XCopyArea( dpy, Buttons[CurrentButton].completeIcon, - Buttons[CurrentButton].IconWin, NormalGC, 2, 2, - Buttons[BACK_BUTTON].icons[0].w-2, - Buttons[BACK_BUTTON].icons[0].h-2, 4, 4); - XCopyArea( dpy, Buttons[BACK_BUTTON].icons[0].icon, - Buttons[CurrentButton].IconWin, NormalGC, 2, 2, - 2, BUTTONHEIGHT, 2, 2); - XCopyArea( dpy, Buttons[BACK_BUTTON].icons[0].icon, - Buttons[CurrentButton].IconWin, NormalGC, 2, 2, - BUTTONWIDTH, 2, 2, 2); - } - RedrawWindow(win,0, CurrentButton, num_rows, num_columns); - RedrawPushedOutline(win, i,j); -} - -void RedrawPushedOutline(Window *win, int i, int j) -{ - GC gc1; - /* Top Hilite */ - XDrawLine( dpy, *win, NormalGC, j*BUTTONWIDTH-BUTTONWIDTH, - i*BUTTONHEIGHT-BUTTONHEIGHT, j*BUTTONWIDTH,i*BUTTONHEIGHT - -BUTTONHEIGHT); -/* - XDrawLine( dpy, *win, NormalGC, j*BUTTONWIDTH-BUTTONWIDTH, - i*BUTTONHEIGHT-BUTTONHEIGHT+1, j*BUTTONWIDTH,i*BUTTONHEIGHT - -BUTTONHEIGHT+1); - */ - /* Left Hilite */ - - XDrawLine( dpy, *win, NormalGC, j*BUTTONWIDTH-BUTTONWIDTH, - i*BUTTONHEIGHT-BUTTONHEIGHT+1, j*BUTTONWIDTH-BUTTONWIDTH, - i*BUTTONHEIGHT-1); - /* - XDrawLine( dpy, *win, NormalGC, j*BUTTONWIDTH-BUTTONWIDTH - +1, i*BUTTONHEIGHT-BUTTONHEIGHT+2, j*BUTTONWIDTH-BUTTONWIDTH+1, - i*BUTTONHEIGHT-1); - */ - if (PushStyle!=0) { - gc1 = HiReliefGC; - } else { - gc1 = HiInnerGC; - } - - /* Right Hilite */ - - XDrawLine( dpy, *win, HiReliefGC, j*BUTTONWIDTH - -BUTTONWIDTH+BUTTONWIDTH-2, i*BUTTONHEIGHT-BUTTONHEIGHT+2, - j*BUTTONWIDTH-BUTTONWIDTH+BUTTONWIDTH-2 ,i*BUTTONHEIGHT-1); - - XDrawLine( dpy, *win, gc1, j*BUTTONWIDTH - -BUTTONWIDTH+BUTTONWIDTH-1, i*BUTTONHEIGHT-BUTTONHEIGHT+1, - j*BUTTONWIDTH-BUTTONWIDTH+BUTTONWIDTH-1 ,i*BUTTONHEIGHT-1); - - /* Bottom Hilite */ - XDrawLine( dpy, *win, gc1, j*BUTTONWIDTH - -BUTTONWIDTH+1, i*BUTTONHEIGHT-1, j*BUTTONWIDTH-BUTTONWIDTH - +BUTTONWIDTH-2,i*BUTTONHEIGHT-1); - - XDrawLine( dpy, *win, HiReliefGC, j*BUTTONWIDTH - -BUTTONWIDTH+1, i*BUTTONHEIGHT-2, j*BUTTONWIDTH-BUTTONWIDTH - +BUTTONWIDTH-2,i*BUTTONHEIGHT-2); -} -/************************************************************************ - * - * Draw the window - * - ***********************************************************************/ -void RedrawWindow(Window *win, int firstbutton, int newbutton, - int num_rows, int num_columns) -{ - int i,j,button; - XEvent dummy; - - if(ready < 1) - return; - - while (XCheckTypedWindowEvent (dpy, *win, Expose, &dummy)); - - for(i=0;i<num_rows;i++) - for(j=0;j<num_columns; j++) - { - button = firstbutton+i*num_columns + j; - if((newbutton == -1)||(newbutton == button)) - { - if(((Buttons[button].swallow == 3)|| - (Buttons[button].swallow == 4))&& - (Buttons[button].IconWin != None)) - XSetWindowBorderWidth(dpy,Buttons[button].IconWin,0); - } - RedrawUnpushedOutline(win,i,j); - } -} - - -/******************************************************************* - * - * Create GC's - * - ******************************************************************/ -void CreateShadowGC(void) -{ - XGCValues gcv; - unsigned long gcm; - - if(d_depth < 2) - { - back_pix = GetColor("white"); - fore_pix = GetColor("black"); - } - else - { - if (TextureType>0 && TextureType < 128) { - MakeShadowColors(dpy, FromColor, ToColor, &fore_pix, &light_grey); - } else { - back_pix = GetColor("grey40"); - fore_pix = GetColor("grey17"); - light_grey = GetColor("white"); - } - } - gcm = GCForeground|GCBackground|GCSubwindowMode; - gcv.subwindow_mode = IncludeInferiors; - - gcv.foreground = fore_pix; - gcv.background = back_pix; - NormalGC = XCreateGC(dpy, Root, gcm, &gcv); - - gcv.foreground = back_pix; - gcv.background = fore_pix; - HiReliefGC = XCreateGC(dpy, Root, gcm, &gcv); - - gcv.foreground = light_grey; - gcv.background = fore_pix; - HiInnerGC = XCreateGC(dpy, Root, gcm, &gcv); - - gcm = GCForeground; - gcv.foreground = fore_pix; - MaskGC = XCreateGC(dpy, Root, gcm, &gcv); - - DefGC = DefaultGC(dpy, screen); -} - -/************************************************************************ - * - * Sizes and creates the window - * - ***********************************************************************/ -void CreateWindow(void) -{ - int first_avail_button,i; - - wm_del_win = XInternAtom(dpy,"WM_DELETE_WINDOW",False); - _XA_WM_PROTOCOLS = XInternAtom (dpy, "WM_PROTOCOLS", False); - - /* Allow for multi-width/height buttons */ - first_avail_button = num_buttons; - - if(num_buttons > MAX_BUTTONS) - { - fprintf(stderr,"%s: Out of Buttons!\n",MyName); - exit(0); - } - - /* size and create the window */ - if((num_rows == 0)&&(num_columns == 0)) - num_columns = 1; - if(num_columns == 0) - { - num_columns = num_buttons/num_rows; - while(num_rows * num_columns < num_buttons) - num_columns++; - } - if(num_rows == 0) - { - num_rows = num_buttons/num_columns; - while(num_rows * num_columns < num_buttons) - num_rows++; - } - - while(num_rows * num_columns < num_buttons) - num_columns++; - - mysizehints.flags = PWinGravity| PResizeInc | PBaseSize; - /* subtract one for the right/bottom border */ - mysizehints.width = BUTTONWIDTH*num_columns; - mysizehints.height= BUTTONHEIGHT*num_rows; - mysizehints.width_inc = num_columns; - mysizehints.height_inc = num_rows; - mysizehints.base_height = num_rows - 1; - mysizehints.base_width = num_columns - 1; - - if(x > -100000) - { - if (x <= -1) - { - mysizehints.x = DisplayWidth(dpy,screen) + x - mysizehints.width-1; - gravity = NorthEastGravity; - } - else if ((x == 0) && (flags & 16)) - mysizehints.x = DisplayWidth(dpy,screen) - mysizehints.width-2; - else - mysizehints.x = x; - if ( y<0) - { - mysizehints.y = DisplayHeight(dpy,screen) + y - mysizehints.height-2; - gravity = SouthWestGravity; - } - else - mysizehints.y = y; - - if((x < 0) && (y < 0)) - gravity = SouthEastGravity; - mysizehints.flags |= USPosition; - } - - mysizehints.win_gravity = gravity; - - main_win = XCreateSimpleWindow(dpy,Root,mysizehints.x,mysizehints.y, - mysizehints.width,mysizehints.height, - 0,0,back_pix); - - for(i=0;i<num_folders;i++) - { - if(num_columns <num_rows) - { - Folders[i].cols = 1; - Folders[i].rows = Folders[i].count; - } - else if ((num_columns == num_rows) && (!ROWS)) - { - Folders[i].cols = 1; - Folders[i].rows = Folders[i].count; - } - else - { - Folders[i].cols = Folders[i].count; - Folders[i].rows = 1; - } - Folders[i].win = XCreateSimpleWindow(dpy, Root, 0,0, - BUTTONWIDTH*Folders[i].rows,BUTTONHEIGHT*Folders[i].cols, - 0,0,back_pix); - XSetWMNormalHints(dpy,Folders[i].win,&mysizehints); - XSelectInput(dpy, Folders[i].win, MW_EVENTS); - } - - XSetWMProtocols(dpy,main_win,&wm_del_win,1); - - XSetWMNormalHints(dpy,main_win,&mysizehints); - - XSelectInput(dpy, main_win, MW_EVENTS); - change_window_name(MyName); -} - - -void nocolor(char *a, char *b) -{ - fprintf(stderr,"%s: can't %s %s\n", MyName, a,b); -} - -/**************************************************************************** - * - * Loads a single color - * - ****************************************************************************/ -Pixel GetColor(char *name) -{ - XColor color; - XWindowAttributes attributes; - - XGetWindowAttributes(dpy,Root,&attributes); - color.pixel = 0; - if (!XParseColor (dpy, attributes.colormap, name, &color)) - { - nocolor("parse",name); - } - else if(!XAllocColor (dpy, attributes.colormap, &color)) - { - nocolor("alloc",name); - } - return color.pixel; -} - -/************************************************************************ - * - * Dead pipe handler - * - ***********************************************************************/ -void DeadPipe(int nonsense) -{ - int i,j,button; - -#ifdef ENABLE_SOUND - int val=-1; - write(PlayerChannel[1],&val,sizeof(val)); - if (SoundThread != 0) - kill(SoundThread,SIGUSR1); -#endif - for(i=0;i<num_rows;i++) - for(j=0;j<num_columns; j++) - { - button = i*num_columns + j; - /* delete swallowed windows, but not modules (afterstep handles those) */ - if(((Buttons[button].swallow == 3)||(Buttons[button].swallow == 4))&& - (Buttons[button].module == 0)) - { - my_send_clientmessage(Buttons[button].IconWin,wm_del_win,CurrentTime); - XSync(dpy,0); - } - } - XSync(dpy,0); - exit(0); -} - -int TOTHEFOLDER = -1; -/***************************************************************************** - * - * This routine is responsible for reading and parsing the config file - * - ****************************************************************************/ -void ParseOptions(char *filename) -{ - char *tline,*orig_tline,*tmp; - int Clength, len; - - GetConfigLine(fd, &tline); - orig_tline = tline; - Clength = strlen(MyName); - while(tline != NULL && tline[0] != '\0') - { - int g_x, g_y; - unsigned width,height; - while(isspace(*tline))tline++; - - if((strlen(&tline[0])>1)&& - (strncasecmp(tline,CatString3("*", MyName, "Geometry"),Clength+9)==0)) - { - tmp = &tline[Clength+9]; - while(((isspace(*tmp))&&(*tmp != '\n'))&&(*tmp != 0)) - { - tmp++; - } - tmp[strlen(tmp)-1] = 0; - - flags = XParseGeometry(tmp,&g_x,&g_y,&width,&height); - if (flags & WidthValue) - w = width; - if (flags & HeightValue) - h = height; - if (flags & XValue) - x = g_x; - if (flags & YValue) - y = g_y; - } - else if((strlen(&tline[0])>1)&& - (strncasecmp(tline,CatString3("*",MyName,"Rows"),Clength+5)==0)) - { - len=sscanf(&tline[Clength+5],"%d",&num_rows); - if(len < 1) - num_rows = 0; - ROWS = TRUE; - } - else if((strlen(&tline[0])>1)&& - (strncasecmp(tline,CatString3("*",MyName,"Columns"),Clength+8)==0)) - { - len=sscanf(&tline[Clength+8],"%d",&num_columns); - if(len < 1) - num_columns = 0; - ROWS = FALSE; - } - else if((strlen(&tline[0])>1)&& - (strncasecmp(tline,CatString3("*",MyName,"NoPush"),Clength+5)==0)) - { - Pushable = 0; - } else if((strlen(&tline[0])>1)&& - (strncasecmp(tline,CatString3("*",MyName,"FullPush"),Clength+9)==0)) - { - PushStyle = 1; - } else if((strlen(&tline[0])>1)&& - (strncasecmp(tline,CatString3("*",MyName,"NoBorder"),Clength+9)==0)) - { - NoBorder = 1; - } else if ((strlen(&tline[0])>1) - &&(strncasecmp(tline,CatString3("*",MyName,"ForceSize"),Clength+10)==0)) { - ForceSize = 1; - } else if ((strlen(&tline[0])>1) - &&(strncasecmp(tline,CatString3("*",MyName,"TextureType"),Clength+12)==0)) { - if (sscanf(&tline[Clength+12],"%d",&TextureType)<1) - TextureType = TEXTURE_BUILTIN; - } else if ((strlen(&tline[0])>1) - &&(strncasecmp(tline,CatString3("*",MyName,"MaxColors"),Clength+10)==0)) { - - if (sscanf(&tline[Clength+10],"%d",&MaxColors)<1) - MaxColors = 16; - } else if ((strlen(&tline[0])>1) - &&(strncasecmp(tline,CatString3("*",MyName,"BgColor"),Clength+8)==0)) { - char *tmp; - tmp=safemalloc(strlen(tline)); - sscanf(&tline[Clength+8],"%s",tmp); - BgColor=GetColor(tmp); - free(tmp); - } else if ((strlen(&tline[0])>1) - &&(strncasecmp(tline,CatString3("*",MyName,"TextureColor"),Clength+13)==0)) { - char *c1, *c2; - XColor color; - XWindowAttributes attributes; - - XGetWindowAttributes(dpy,Root,&attributes); - len = strlen(&tline[Clength+13]); - c1 = safemalloc(len); - c2 = safemalloc(len); - if (sscanf(&tline[Clength+13],"%s %s",c1,c2)!=2) { - fprintf(stderr,"%s:You must specify two colors for the texture\n",MyName); - FromColor[0]=0; - FromColor[1]=0; - FromColor[2]=0; - ToColor[0]=0; - ToColor[1]=0; - ToColor[2]=0; - } - if (!XParseColor (dpy, attributes.colormap, c1, &color)) - { - nocolor("parse",c1); - TextureType=TEXTURE_BUILTIN; - } else { - FromColor[0]=color.red; - FromColor[1]=color.green; - FromColor[2]=color.blue; - } - if (!XParseColor (dpy, attributes.colormap, c2, &color)) - { - nocolor("parse",c2); - TextureType=TEXTURE_BUILTIN; - } else { - ToColor[0]=color.red; - ToColor[1]=color.green; - ToColor[2]=color.blue; - } - free(c1); - free(c2); - } else if ((strlen(&tline[0])>1) - &&(strncasecmp(tline,CatString3("*",MyName,"Pixmap"),Clength+7)==0)) { - CopyString(&BgPixmapFile,&tline[Clength+7]); - } else if((strlen(&tline[0])>1)&& - (strncasecmp(tline,CatString3("*",MyName,"AnimateMain"),Clength+12)==0)) - { - AnimateMain = 1; - } - else if((strlen(&tline[0])>1)&& - (strncasecmp(tline,CatString3("*",MyName,"Animate"),Clength+8)==0)) - { - if ((tline[Clength+9]!='M') && (tline[Clength+9]!='m')) - AnimationStyle = 1; - } -#ifdef ENABLE_SOUND - else if((strlen(&tline[0])>1)&& - (strncasecmp(tline,CatString3("*",MyName,"Player"),Clength+7)==0)) - { - CopyString(&SoundPlayer, &tline[Clength+7]); - } else if((strlen(&tline[0])>1)&& - (strncasecmp(tline,CatString3("*",MyName,"Sound"),Clength+6)==0)) - { - bind_sound(&tline[Clength+6]); - SoundActive = 1; - } -#endif - else if((strlen(&tline[0])>1) - &&(strncasecmp(tline,CatString3("*", MyName, ""),Clength+1)==0) - && (num_buttons < MAX_BUTTONS)) - { - /* check if this is a invalid option */ - if (!isspace(tline[Clength+1])) - fprintf(stderr,"%s:invalid option %s\n",MyName,tline); - else - match_string(&tline[Clength+1]); - } - else if((strlen(&tline[0])>1)&&(strncasecmp(tline,"IconPath",8)==0)) - { - CopyString(&iconPath,&tline[8]); - } - else if((strlen(&tline[0])>1)&&(strncasecmp(tline,"PixmapPath",10)==0)) - { - CopyString(&pixmapPath,&tline[10]); - } -#ifdef ENABLE_SOUND - else if((strlen(&tline[0])>1)&&(strncasecmp(tline,"*AudioDir",9)==0)) - { - CopyString(&SoundPath,&tline[9]); - } - else if((strlen(&tline[0])>1)&&(strncasecmp(tline,"ModulePath",11)==0)) - { - CopyString(&ModulePath,&tline[11]); - } -#endif - GetConfigLine(fd, &tline); - orig_tline = tline; - } -#ifdef ENABLE_DND - /* ignore last button if there's nothing bound to it */ - if ((Buttons[num_buttons-1].drop_action!=NULL) && - (Buttons[num_buttons-1].iconno==0)) { - num_buttons--; - } -#endif - return; -} - -/* - * Gets a word of a given index in the line, stripping any blanks - * The returned word is newly allocated - */ -#ifdef ENABLE_SOUND -char *get_token(char *tline, int index) -{ - char *start, *end; - int i,c,size; - char *word; - - index++; /* index is 0 based */ - size = strlen(tline); - i=c=0; - start=end=tline; - while (i<index && c<size) { - start=end; - while(isspace(*start) && c<size) { - start++; - c++; - } - end=start; - while(!isspace(*end) && c<size) { - end++; - c++; - } - if (end==start) return NULL; - i++; - } - if (i<index) return NULL; - word=safemalloc(end-start+1); - strncpy(word, start, end-start); - word[end-start]=0; - return word; -} - -/************************************************************************** - * - * Parses a sound binding - * - **************************************************************************/ -void bind_sound(char *tline) -{ - char *event, *sound; - - event = get_token(tline,0); - if (event==NULL) { - fprintf(stderr,"%s:bad sound binding %s\n",MyName,tline); - return; - } - sound = get_token(tline,1); - if (sound==NULL) { - free(event); - fprintf(stderr,"%s:bad sound binding %s\n",MyName,tline); - return; - } - if (strcmp(event,"open_folder")==0) { - Sounds[WHEV_OPEN_FOLDER]=sound; - } else if (strcmp(event,"close_folder")==0) { - Sounds[WHEV_CLOSE_FOLDER]=sound; - } else if (strcmp(event,"open_main")==0) { - Sounds[WHEV_OPEN_MAIN]=sound; - } else if (strcmp(event,"close_main")==0) { - Sounds[WHEV_CLOSE_MAIN]=sound; - } else if (strcmp(event,"push")==0) { - Sounds[WHEV_PUSH]=sound; - } else if (strcmp(event,"drop")==0) { - Sounds[WHEV_DROP]=sound; - } else { - fprintf(stderr,"%s:bad event %s in sound binding\n",MyName,event); - free(sound); - } - free(event); - return; -} -#endif /* ENABLE_SOUND */ - -/************************************************************************** - * - * Parses a button command line from the config file - * - *************************************************************************/ -void match_string(char *tline) -{ - int len,i,i2,n,j,k; - char *ptr,*start,*end,*tmp; - struct button_info *actual; - - /* skip spaces */ - while(isspace(*tline)&&(*tline != '\n')&&(*tline != 0)) - tline++; - - /* read next word. Its the button label. Users can specify "" - * NoIcon, or whatever to skip the label */ - /* read to next space */ - start = tline; - end = tline; - while((!isspace(*end))&&(*end!='\n')&&(*end!=0)) - end++; - len = end - start; - ptr = safemalloc(len+1); - strncpy(ptr,start,len); - ptr[len] = 0; - - if (strncmp(ptr,"~Folder",7)==0) - { - TOTHEFOLDER = -1; - Folders[num_folders].firstbutton = num_folderbuttons; - num_folders++; - free(ptr); - return; - } - - if(TOTHEFOLDER==-1) - { - actual = &Buttons[num_buttons++]; - actual->parent = &main_win; - } - else - { - actual = &Buttons[--num_folderbuttons]; - actual->folder = num_folders; - actual->parent = &Folders[num_folders].win; - }; - - actual->title = ptr; - - /* read next word. Its the icon bitmap/pixmap label. Users can specify "" - * NoIcon, or whatever to skip the label */ - /* read to next space */ - start = end; - /* skip spaces */ - while(isspace(*start)&&(*start != '\n')&&(*start != 0)) - start++; - end = start; - while((!isspace(*end))&&(*end!='\n')&&(*end!=0)) - end++; - len = end - start; - ptr = safemalloc(len+1); - strncpy(ptr,start,len); - ptr[len] = 0; - /* separate icon files to be overlaid */ - i2 = len; - j=k=0; - for(i=0;i<MAX_OVERLAY;i++) { - while (ptr[j]!=',' && j<i2) j++; - actual->icons[i].file=safemalloc(j-k+1); - strncpy(actual->icons[i].file,&(ptr[k]),j-k); - actual->icons[i].file[j-k]=0; - actual->iconno++; - j++; - k=j; - if (j>=i2) break; - } - tline = end; - for (i=num_buttons - 2;i>=0;i--) - { - if (strcmp(Buttons[i].title, actual->title) == 0) - { - actual = &Buttons[i]; - num_buttons--; - for(i=0;i<actual->iconno;i++) { - free(actual->icons[i].file); - } - break; - } - } - /* skip spaces */ - while(isspace(*tline)&&(*tline != '\n')&&(*tline != 0)) - tline++; -#ifdef ENABLE_DND - if (strncasecmp(tline,"dropexec",8)==0) { - /* get command to execute for dropped stuff */ - - if(TOTHEFOLDER==-1) { - num_buttons--; /* make the next parsed thing the button for this */ - free(ptr); - for(i=0;i<actual->iconno;i++) { - free(actual->icons[i].file); - } - actual->iconno=0; - } else { - num_folderbuttons++; - free(ptr); - for(i=0;i<actual->iconno;i++) { - free(actual->icons[i].file); - } - actual->iconno=0; - fprintf(stderr,"Drop in Folders not supported. Ignoring option\n"); - return; - } - - tline=strstr(tline,"Exec"); - len = strlen(tline); - tmp = tline + len -1; - while(((isspace(*tmp))||(*tmp == '\n'))&&(tmp >=tline)) { - tmp--; - len--; - } - ptr = safemalloc(len+1); - actual->drop_action=ptr; - strncpy(ptr,tline,len); - ptr[len]=0; - } else -#endif - if(strncasecmp(tline,"swallow",7)==0 || strncasecmp(tline,"maxswallow",10)==0) - { - /* Look for swallow "identifier", in which - case Wharf spawns and gobbles up window */ - i=7; - while((tline[i] != 0)&& - (tline[i] != '"')) - i++; - i2=i+1; - while((tline[i2] != 0)&& - (tline[i2] != '"')) - i2++; - actual->maxsize = - strncasecmp(tline,"maxswallow",10) == 0 ? 1 : 0; - if(i2 - i >1) - { - actual->hangon = safemalloc(i2-i); - strncpy(actual->hangon,&tline[i+1],i2-i-1); - actual->hangon[i2-i-1] = 0; - actual->swallow = 1; - } - n = 7; - n = i2+1; - while((isspace(tline[n]))&&(tline[n]!=0)) - n++; - len = strlen(&tline[n]); - tmp = tline + n + len -1; - while(((isspace(*tmp))||(*tmp == '\n'))&&(tmp >=(tline + n))) - { - tmp--; - len--; - } - ptr = safemalloc(len+6); - if(strncasecmp(&tline[n],"Module",6)==0) - { - ptr[0] = 0; - actual->module = 1; - } - else - strcpy(ptr,"Exec "); - i2 = strlen(ptr); - strncat(ptr,&tline[n],len); - ptr[i2+len]=0; - SendText(fd,ptr,0); - free(ptr); - actual->action = NULL; - } - else - { - if(!TOTHEFOLDER) - { - Folders[num_folders].count++; - } - - len = strlen(tline); - tmp = tline + len -1; - while(((isspace(*tmp))||(*tmp == '\n'))&&(tmp >=tline)) - { - tmp--; - len--; - } - ptr = safemalloc(len+1); - strncpy(ptr,tline,len); - ptr[len]=0; - - if (strncmp(ptr,"Folder",6)==0) - { - TOTHEFOLDER = 0; - Folders[num_folders].count = 0; - actual->folder = num_folders; - Folders[num_folders].mapped = NOTMAPPED; - } - actual->action = ptr; - } - return; -} - -/************************************************************************** - * Change the window name displayed in the title bar. - **************************************************************************/ -void change_window_name(char *str) -{ - XTextProperty name; - int i; - - if (XStringListToTextProperty(&str,1,&name) == 0) - { - fprintf(stderr,"%s: cannot allocate window name",MyName); - return; - } - XSetWMName(dpy,main_win,&name); - XSetWMIconName(dpy,main_win,&name); - for(i=0;i<num_folders;i++) - { - XSetWMName(dpy, Folders[i].win,&name); - XSetWMIconName(dpy, Folders[i].win,&name); - } - XFree(name.value); -} - - - -/*************************************************************************** - * - * Waits for next X event, or for an auto-raise timeout. - * - ****************************************************************************/ -int My_XNextEvent(Display *dpy, XEvent *event) -{ - fd_set in_fdset; - unsigned long header[HEADER_SIZE]; - int count; - static int miss_counter = 0; - unsigned long *body; - - if(XPending(dpy)) - { - XNextEvent(dpy,event); - return 1; - } - - FD_ZERO(&in_fdset); - FD_SET(x_fd,&in_fdset); - FD_SET(fd[1],&in_fdset); - - select(fd_width, SELECT_TYPE_ARG234 &in_fdset, 0, 0, NULL); - if(FD_ISSET(x_fd, &in_fdset)) - { - if(XPending(dpy)) - { - XNextEvent(dpy,event); - miss_counter = 0; - return 1; - } - else - miss_counter++; - if(miss_counter > 100) - DeadPipe(0); - } - - if(FD_ISSET(fd[1], &in_fdset)) - { - if((count = ReadFvwmPacket(fd[1], header, &body)) > 0) - { - process_message(header[1],body); - free(body); - } - } - return 0; -} - -void CheckForHangon(unsigned long *body) -{ - int button,i,j; - char *cbody; - - cbody = (char *)&body[3]; - for(i=0;i<num_rows;i++) - for(j=0;j<num_columns; j++) - { - button = i*num_columns + j; - if(Buttons[button].hangon != NULL) - { - if(strcmp(cbody,Buttons[button].hangon)==0) - { - if(Buttons[button].swallow == 1) - { - Buttons[button].swallow = 2; - if(Buttons[button].IconWin != None) - { - XDestroyWindow(dpy,Buttons[button].IconWin); - } - Buttons[button].IconWin = (Window)body[0]; - free(Buttons[button].hangon); - Buttons[button].hangon = NULL; - } - else - { - if (Buttons[button].swallow == 4) - Buttons[button].swallow = 3; - Buttons[button].up = 1; - free(Buttons[button].hangon); - Buttons[button].hangon = NULL; - RedrawWindow(&main_win,0, button, num_rows, num_columns); - } - } - } - } -} - -/************************************************************************** - * - * Process window list messages - * - *************************************************************************/ -void process_message(unsigned long type,unsigned long *body) -{ - switch(type) - { -/* case M_TOGGLE_PAGING: - pageing_enabled = body[0]; - RedrawWindow(&main_win,0, -1, num_rows, num_columns); - break; - pdg */ - case M_NEW_DESK: - new_desk = body[0]; - RedrawWindow(&main_win,0, -1, num_rows, num_columns); - break; - case M_END_WINDOWLIST: - RedrawWindow(&main_win,0, -1, num_rows, num_columns); - case M_MAP: - swallow(body); - case M_RES_NAME: - case M_RES_CLASS: - case M_WINDOW_NAME: - CheckForHangon(body); - break; - default: - break; - } -} - - - - - -/*************************************************************************** - * - * ICCCM Client Messages - Section 4.2.8 of the ICCCM dictates that all - * client messages will have the following form: - * - * event type ClientMessage - * message type _XA_WM_PROTOCOLS - * window tmp->w - * format 32 - * data[0] message atom - * data[1] time stamp - * - ****************************************************************************/ -void my_send_clientmessage (Window w, Atom a, Time timestamp) -{ - XClientMessageEvent ev; - - ev.type = ClientMessage; - ev.window = w; - ev.message_type = _XA_WM_PROTOCOLS; - ev.format = 32; - ev.data.l[0] = a; - ev.data.l[1] = timestamp; - XSendEvent (dpy, w, False, 0L, (XEvent *) &ev); -} - - -void swallow(unsigned long *body) -{ - char *temp; - int button,i,j; - long supplied; - - for(i=0;i<num_rows;i++) - for(j=0;j<num_columns; j++) - { - button = i*num_columns + j; - if((Buttons[button].IconWin == (Window)body[0])&& - (Buttons[button].swallow == 2)) - { - Buttons[button].swallow = 3; - /* "Swallow" the window! */ - - XReparentWindow(dpy,Buttons[button].IconWin, main_win, - j*BUTTONWIDTH+4, i*BUTTONHEIGHT+4); - XMapWindow(dpy,Buttons[button].IconWin); - XSelectInput(dpy,(Window)body[0], - PropertyChangeMask); - if (Buttons[button].action) - { - /* - XGrabButton(dpy, Button1Mask | Button2Mask, None, - (Window)body[0], - False, ButtonPressMask | ButtonReleaseMask, - GrabModeAsync, GrabModeAsync, None, None); - XGrabButton(dpy, Button1Mask | Button2Mask, LockMask, - */ - unsigned *mods = lock_mods; - do XGrabButton(dpy, Button1Mask | Button2Mask, *mods, - - (Window)body[0], - False, ButtonPressMask | ButtonReleaseMask, - GrabModeAsync, GrabModeAsync, None, None); - while (*mods++); - - } - if (Buttons[button].maxsize) { - Buttons[button].icons[0].w = 55; - Buttons[button].icons[0].h = 57; - } - else { - Buttons[button].icons[0].w = ICON_WIN_WIDTH; - Buttons[button].icons[0].h = ICON_WIN_HEIGHT; - } - if (!XGetWMNormalHints (dpy, Buttons[button].IconWin, - &Buttons[button].hints, - &supplied)) - Buttons[button].hints.flags = 0; - - XResizeWindow(dpy,(Window)body[0], Buttons[button].icons[0].w, - Buttons[button].icons[0].h); - XMoveWindow(dpy,Buttons[button].IconWin, - j*BUTTONWIDTH + - (BUTTONWIDTH - Buttons[button].icons[0].w)/2, - i*BUTTONHEIGHT + - (BUTTONHEIGHT - Buttons[button].icons[0].h)/2); - - XFetchName(dpy, Buttons[button].IconWin, &temp); - XClearArea(dpy, main_win,j*BUTTONWIDTH, i*BUTTONHEIGHT, - BUTTONWIDTH,BUTTONHEIGHT,0); - if(strcmp(Buttons[button].title,"-")!=0) - CopyString(&Buttons[button].title, temp); - RedrawWindow(&main_win,0, -1, num_rows, num_columns); - XFree(temp); - } - } -} - - - -void FindLockMods(void) -{ - int m, i, knl; - char* kn; - KeySym ks; - KeyCode kc, *kp; - unsigned lockmask, *mp; - XModifierKeymap* mm = XGetModifierMapping(dpy); - lockmask = LockMask; - if (mm) - { - kp = mm->modifiermap; - for (m = 0; m < 8; m++) - { - for (i = 0; i < mm->max_keypermod; i++) - { - if ((kc = *kp++) && - ((ks = XKeycodeToKeysym(dpy, kc, 0)) != NoSymbol)) - { - kn = XKeysymToString(ks); - knl = strlen(kn); - if ((knl > 6) && (strcasecmp(kn + knl - 4, "lock") == 0)) - lockmask |= (1 << m); - } - } - } - XFreeModifiermap(mm); - } - lockmask &= ~(ShiftMask | ControlMask); - - mp = lock_mods; - for (m = 0, i = 1; i < 256; i++) - { - if ((i & lockmask) > m) - m = *mp++ = (i & lockmask); - } - *mp = 0; -} - - -/*********************************************************************** - * - * Procedure: - * ConstrainSize - adjust the given width and height to account for the - * constraints imposed by size hints - * - * The general algorithm, especially the aspect ratio stuff, is - * borrowed from uwm's CheckConsistency routine. - * - ***********************************************************************/ -void ConstrainSize (XSizeHints *hints, int *widthp, int *heightp) -{ -#define makemult(a,b) ((b==1) ? (a) : (((int)((a)/(b))) * (b)) ) -#define _min(a,b) (((a) < (b)) ? (a) : (b)) - - - int minWidth, minHeight, maxWidth, maxHeight, xinc, yinc, delta; - int baseWidth, baseHeight; - int dwidth = *widthp, dheight = *heightp; - - if(hints->flags & PMinSize) - { - minWidth = hints->min_width; - minHeight = hints->min_height; - if(hints->flags & PBaseSize) - { - baseWidth = hints->base_width; - baseHeight = hints->base_height; - } - else - { - baseWidth = hints->min_width; - baseHeight = hints->min_height; - } - } - else if(hints->flags & PBaseSize) - { - minWidth = hints->base_width; - minHeight = hints->base_height; - baseWidth = hints->base_width; - baseHeight = hints->base_height; - } - else - { - minWidth = 1; - minHeight = 1; - baseWidth = 1; - baseHeight = 1; - } - - if(hints->flags & PMaxSize) - { - maxWidth = hints->max_width; - maxHeight = hints->max_height; - } - else - { - maxWidth = 10000; - maxHeight = 10000; - } - if(hints->flags & PResizeInc) - { - xinc = hints->width_inc; - yinc = hints->height_inc; - } - else - { - xinc = 1; - yinc = 1; - } - - /* - * First, clamp to min and max values - */ - if (dwidth < minWidth) dwidth = minWidth; - if (dheight < minHeight) dheight = minHeight; - - if (dwidth > maxWidth) dwidth = maxWidth; - if (dheight > maxHeight) dheight = maxHeight; - - - /* - * Second, fit to base + N * inc - */ - dwidth = ((dwidth - baseWidth) / xinc * xinc) + baseWidth; - dheight = ((dheight - baseHeight) / yinc * yinc) + baseHeight; - - - /* - * Third, adjust for aspect ratio - */ -#define maxAspectX hints->max_aspect.x -#define maxAspectY hints->max_aspect.y -#define minAspectX hints->min_aspect.x -#define minAspectY hints->min_aspect.y - /* - * The math looks like this: - * - * minAspectX dwidth maxAspectX - * ---------- <= ------- <= ---------- - * minAspectY dheight maxAspectY - * - * If that is multiplied out, then the width and height are - * invalid in the following situations: - * - * minAspectX * dheight > minAspectY * dwidth - * maxAspectX * dheight < maxAspectY * dwidth - * - */ - - if (hints->flags & PAspect) - { - if (minAspectX * dheight > minAspectY * dwidth) - { - delta = makemult(minAspectX * dheight / minAspectY - dwidth, - xinc); - if (dwidth + delta <= maxWidth) - dwidth += delta; - else - { - delta = makemult(dheight - dwidth*minAspectY/minAspectX, - yinc); - if (dheight - delta >= minHeight) dheight -= delta; - } - } - - if (maxAspectX * dheight < maxAspectY * dwidth) - { - delta = makemult(dwidth * maxAspectY / maxAspectX - dheight, - yinc); - if (dheight + delta <= maxHeight) - dheight += delta; - else - { - delta = makemult(dwidth - maxAspectX*dheight/maxAspectY, - xinc); - if (dwidth - delta >= minWidth) dwidth -= delta; - } - } - } - - *widthp = dwidth; - *heightp = dheight; - return; -} - - -#ifdef ENABLE_SOUND -void PlaySound(int event) -{ - int timestamp; - - if (!SoundActive) - return; - if (Sounds[event]==NULL) return; - write(PlayerChannel[1],&event,sizeof(event)); - timestamp = clock(); - write(PlayerChannel[1],×tamp,sizeof(timestamp)); - /* - kill(SoundThread,SIGUSR1); - */ -} -#endif diff --git a/app/fvwm/extras/FvwmWharf/OffiX/DragAndDrop.h b/app/fvwm/extras/FvwmWharf/OffiX/DragAndDrop.h deleted file mode 100644 index 433309777..000000000 --- a/app/fvwm/extras/FvwmWharf/OffiX/DragAndDrop.h +++ /dev/null @@ -1,48 +0,0 @@ -/* -Copyright (C) 1996 César Crusius - -This file is part of the DND Library. This library is free -software; you can redistribute it and/or modify it under the terms of -the GNU Library General Public License as published by the Free -Software Foundation; either version 2 of the License, or (at your -option) any later version. This library is distributed in the hope -that it will be useful, but WITHOUT ANY WARRANTY; without even the -implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR -PURPOSE. See the GNU Library General Public License for more details. -You should have received a copy of the GNU Library General Public -License along with this library; if not, write to the Free Software -Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. -*/ - -#ifndef __DragAndDropH__ -#define __DragAndDropH__ - -#include <OffiX/DragAndDropTypes.h> - -#include <X11/Intrinsic.h> - -void DndInitialize(Widget shell); - -void DndRegisterRootDrop(XtEventHandler handler); -void DndRegisterIconDrop(XtEventHandler handler); -void DndRegisterOtherDrop(XtEventHandler handler); - -void DndRegisterDropWidget(Widget widget,XtEventHandler handler, - XtPointer data); -void DndRegisterDragWidget(Widget widget,XtEventHandler handler, - XtPointer data); - -int DndHandleDragging(Widget widget,XEvent* event); - -void DndMultipleShells(void); -void DndAddShell(Widget widget); - -void DndSetData(int Type,unsigned char *Data,unsigned long Size); -void DndGetData(unsigned char **Data,unsigned long *Size); - -int DndIsIcon(Widget widget); -int DndDataType(XEvent *event); -unsigned int DndDragButtons(XEvent *event); -Widget DndSourceWidget(XEvent *event); - -#endif diff --git a/app/fvwm/extras/FvwmWharf/OffiX/DragAndDropTypes.h b/app/fvwm/extras/FvwmWharf/OffiX/DragAndDropTypes.h deleted file mode 100644 index 771452a80..000000000 --- a/app/fvwm/extras/FvwmWharf/OffiX/DragAndDropTypes.h +++ /dev/null @@ -1,32 +0,0 @@ -/* -Copyright (C) 1996 César Crusius - -This file is part of the DND Library. This library is free -software; you can redistribute it and/or modify it under the terms of -the GNU Library General Public License as published by the Free -Software Foundation; either version 2 of the License, or (at your -option) any later version. This library is distributed in the hope -that it will be useful, but WITHOUT ANY WARRANTY; without even the -implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR -PURPOSE. See the GNU Library General Public License for more details. -You should have received a copy of the GNU Library General Public -License along with this library; if not, write to the Free Software -Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. -*/ - -#ifndef __DragAndDropTypesH__ -#define __DragAndDropTypesH__ - -#define DndNotDnd -1 -#define DndUnknown 0 -#define DndRawData 1 -#define DndFile 2 -#define DndFiles 3 -#define DndText 4 -#define DndDir 5 -#define DndLink 6 -#define DndExe 7 - -#define DndEND 8 - -#endif diff --git a/app/fvwm/extras/FvwmWharf/README b/app/fvwm/extras/FvwmWharf/README deleted file mode 100644 index db2039d15..000000000 --- a/app/fvwm/extras/FvwmWharf/README +++ /dev/null @@ -1,22 +0,0 @@ -This is a port of the AfterStep -wharf module to an fvwm2 module. - -You should install this directory -in the modules subdirectory of the -fvwm source directory. - -I have only build this on a SUN -running solaris 2. - -I don't think it will build if you enable the -audio extensions. It should build but I have -no idea if it works if you enable the -drag and drop extenstions. I am not sure -if all the textures work. Swallow does seem -to work. - -I am happy to attempt to maintain this. -If you find/fix any bugs or fox the -man page, - -pdg@uow.edu.au diff --git a/app/fvwm/extras/FvwmWharf/Wharf.h b/app/fvwm/extras/FvwmWharf/Wharf.h deleted file mode 100644 index 5486955e5..000000000 --- a/app/fvwm/extras/FvwmWharf/Wharf.h +++ /dev/null @@ -1,121 +0,0 @@ -#include "config.h" -#include "fvwmlib.h" - -/************************************************************************* - * - * Subroutine Prototypes - * - *************************************************************************/ -extern void CreateWindow(void); -extern Pixel GetColor(char *name); -extern void nocolor(char *a, char *b); -extern void RedrawWindow(Window *win, int firstbutton, int newbutton, int num_rows, int num_columns); -extern void match_string(char *tline); -#ifdef ENABLE_SOUND -extern void bind_sound(char *tline); -extern void PlaySound(int event); -#endif -extern void Loop(void); -extern void ParseOptions(char *); -extern char *safemalloc(int length); -extern void change_window_name(char *str); -extern int My_XNextEvent(Display *dpy, XEvent *event); -extern void DeadPipe(int nonsense); -extern void LoadIconFile(int button,int ico); -extern void CreateIconWindow(int button, Window *win); -extern void ConfigureIconWindow(int button,int row, int column); -extern void GetBitmapFile(int button,int ico); -extern int GetXPMFile(int button,int ico); -extern int GetXPMData(int button, char **data); -extern int GetXPMGradient(int button, int from[3], int to[3], int maxcols, - int type); -extern int GetSolidXPM(int button, Pixel pixel); -extern Bool Pushed; -extern Bool ForceSize; -extern void DrawOutline(Drawable d, int w, int h); -void process_message(unsigned long type,unsigned long *body); -void my_send_clientmessage (Window w, Atom a, Time timestamp); -void swallow(unsigned long *body); -void ConstrainSize (XSizeHints *hints, int *widthp, int *height); -void MapFolder(int folder, int *LastMapped, int base_x, int base_y, int row, int col); -void CloseFolder(int folder); -void OpenFolder(int folder,int x, int y, int w, int h, int direction); -void RedrawPushed(Window *win, int i, int j); -void RedrawUnpushed(Window *win, int i, int j); -void RedrawUnpushedOutline(Window *win, int i,int j); -void RedrawPushedOutline(Window *win, int i, int j); -void CreateShadowGC(void); -extern Display *dpy; /* which display are we talking to */ -extern Window Root; -extern Window main_win; -extern int screen; -extern long d_depth; -extern Pixel back_pix, fore_pix; -extern GC NormalGC, HiReliefGC, HiInnerGC; -extern GC MaskGC; -extern int BUTTONWIDTH, BUTTONHEIGHT; -extern XFontStruct *font; -#define MAX_BUTTONS 100 -#define BACK_BUTTON 100 - -#define MAX_OVERLAY 3 - -#define BUTTON_ARRAY_LN 102 -#define FOLDER_ARRAY_LN 10 - -#define ICON_WIN_WIDTH 48 -#define ICON_WIN_HEIGHT 48 - -#define ISMAPPED 0 -#define NOTMAPPED 1 - -typedef struct icon_info { - char *file; - short w, h; - Pixmap icon, mask; - signed char depth; -} icon_info; - -struct button_info -{ - char *action; - char *title; - int iconno; - icon_info icons[MAX_OVERLAY]; - - Pixmap completeIcon; /* icon with background */ - Window IconWin; - Window *parent; - XSizeHints hints; - char *hangon; - char up; - char swallow; - char maxsize; - char module; - int folder; -#ifdef ENABLE_DND - char *drop_action; -#endif -}; - -struct folder_info -{ - Window win; /* Window of the Folder */ - int firstbutton; /* index to Buttons, starting at end */ - int count; /* count folded buttons */ - int mapped; /* is the window visible or not ?? */ - int cols; /* either 1 or me.count */ - int rows; /* either me.count or 1 */ - int direction; /* direction of the folder */ -}; - -extern struct button_info Buttons[MAX_BUTTONS+2]; -extern struct folder_info Folders[FOLDER_ARRAY_LN]; - -extern char *iconPath; -extern char *pixmapPath; - - - - - diff --git a/app/fvwm/extras/FvwmWharf/icons.c b/app/fvwm/extras/FvwmWharf/icons.c deleted file mode 100644 index 5e3219b95..000000000 --- a/app/fvwm/extras/FvwmWharf/icons.c +++ /dev/null @@ -1,367 +0,0 @@ -/* icons.c. by Bo Yang. - * Modifications: Copyright 1995 by Bo Yang. - * - * based on icons.c by Robert Nation - * The icons module, and the entire GoodStuff program, and the concept for - * interfacing this module to the Window Manager, are all original work - * by Robert Nation - * - * Copyright 1993, Robert Nation. - * No guarantees or warantees or anything - * are provided or implied in any way whatsoever. Use this program at your - * own risk. Permission to use this program for any purpose is given, - * as long as the copyright is kept intact. */ -/*********************************************************************** - * - * Derived from fvwm icon code - * - ***********************************************************************/ - -#include "config.h" - -#include <stdio.h> -#include <unistd.h> -#include <signal.h> -#include <string.h> -#include <stdlib.h> - -#include <X11/Xlib.h> -#include <X11/Xutil.h> -#include <X11/Xproto.h> -#include <X11/Xatom.h> -#include <X11/Intrinsic.h> - -#ifdef HAVE_FCNTL_H -#include <fcntl.h> -#endif - -#include "Wharf.h" - -#ifdef XPM -#include <X11/xpm.h> -#endif /* XPM */ -#include "stepgfx.h" - - -/**************************************************************************** - * - * Loads an icon file into a pixmap - * - ****************************************************************************/ -void LoadIconFile(int button, int ico) -{ -#ifndef NO_ICONS - /* First, check for a monochrome bitmap */ - if(Buttons[button].icons[ico].file != NULL) - GetBitmapFile(button,ico); - /* Next, check for a color pixmap */ - if((Buttons[button].icons[ico].file != NULL)&& - (Buttons[button].icons[ico].w == 0)&&(Buttons[button].icons[ico].h == 0)) - GetXPMFile(button,ico); -#endif -} - -/**************************************************************************** - * - * Creates an Icon Window - * - ****************************************************************************/ -void CreateIconWindow(int button, Window *win) -{ -#ifndef NO_ICONS - unsigned long valuemask; /* mask for create windows */ - XSetWindowAttributes attributes; /* attributes for create windows */ - - /* This used to make buttons without icons explode when pushed - if((Buttons[button].icon_w == 0)&&(Buttons[button].icon_h == 0)) - return; - */ - attributes.background_pixel = back_pix; - attributes.event_mask = ExposureMask; - valuemask = CWEventMask | CWBackPixel; - - Buttons[button].IconWin = - XCreateWindow(dpy, *win, 0, 0, BUTTONWIDTH, - BUTTONHEIGHT, 0, CopyFromParent, - CopyFromParent,CopyFromParent,valuemask,&attributes); - - return; -#endif -} - -/**************************************************************************** - * - * Combines icon shape masks after a resize - * - ****************************************************************************/ -void ConfigureIconWindow(int button,int row, int column) -{ -#ifndef NO_ICONS - int x,y, w, h; - int xoff,yoff; - int i; - - - if(Buttons[button].iconno == 0) - return; - if(Buttons[button].swallow != 0) { - return; - } - x = column*BUTTONWIDTH; - y = row*BUTTONHEIGHT; - - XMoveResizeWindow(dpy, Buttons[button].IconWin, x,y,BUTTONWIDTH, - BUTTONHEIGHT); - Buttons[button].completeIcon = - XCreatePixmap(dpy,Root, BUTTONWIDTH,BUTTONHEIGHT,d_depth); - XCopyArea(dpy, Buttons[BACK_BUTTON].icons[0].icon, - Buttons[button].completeIcon, NormalGC, 0,0, - BUTTONWIDTH,BUTTONHEIGHT, 0,0); - - for(i=0;i<Buttons[button].iconno;i++) { - w = Buttons[button].icons[i].w; - h = Buttons[button].icons[i].h; - if (w<1 || h<1) continue; - if(w > BUTTONWIDTH) w = BUTTONWIDTH; - if(h > BUTTONHEIGHT) h = BUTTONHEIGHT; - if (w < 1) w = 1; - if (h < 1) h = 1; -#ifdef XPM - xoff = (BUTTONWIDTH - w)/2; - yoff = (BUTTONHEIGHT - h)/2; - if (xoff<0) xoff=0; - if (yoff<0) yoff=0; - if (Buttons[button].icons[i].mask != None) { - XSetClipOrigin(dpy, MaskGC, xoff, yoff); - XSetClipMask(dpy, MaskGC, Buttons[button].icons[i].mask); - } else { - XRectangle rect[1]; - rect[0].x=0; rect[0].y=0; - rect[0].width=w; rect[0].height=h; - - XSetClipRectangles(dpy,MaskGC,xoff,yoff, rect, 1, YSorted); - } - XCopyArea(dpy, Buttons[button].icons[i].icon, - Buttons[button].completeIcon, MaskGC, 0,0, - w, h, xoff,yoff); - /* don't need them anymore */ - XFreePixmap(dpy, Buttons[button].icons[i].icon); - if (Buttons[button].icons[i].mask != None) { - XFreePixmap(dpy, Buttons[button].icons[i].mask); - } -#endif - if(Buttons[button].icons[i].depth == -1) { - XCopyPlane(dpy,Buttons[button].icons[i].icon, - Buttons[button].completeIcon,NormalGC, - 0,0,w,h, 0,0,1); - XFreePixmap(dpy, Buttons[button].icons[i].icon); - } - } - XSetWindowBackgroundPixmap(dpy, Buttons[button].IconWin, - Buttons[button].completeIcon); - XClearWindow(dpy,Buttons[button].IconWin); -#endif -} - -/*************************************************************************** - * - * Looks for a monochrome icon bitmap file - * - **************************************************************************/ -void GetBitmapFile(int button, int ico) -{ -#ifndef NO_ICONS - char *path = NULL; - int HotX,HotY; - - path = findIconFile(Buttons[button].icons[ico].file, iconPath,R_OK); - if(path == NULL)return; - - if(XReadBitmapFile (dpy, Root,path,(unsigned int *)&Buttons[button].icons[ico].w, - (unsigned int *)&Buttons[button].icons[ico].h, - &Buttons[button].icons[ico].icon, - (int *)&HotX, - (int *)&HotY) != BitmapSuccess) - { - Buttons[button].icons[ico].w = 0; - Buttons[button].icons[ico].h = 0; - } - else - { - Buttons[button].icons[ico].depth = -1; - } - Buttons[button].icons[ico].mask = None; - free(path); -#endif -} - - -/**************************************************************************** - * - * Looks for a color XPM icon file - * - ****************************************************************************/ -int GetXPMFile(int button,int ico) -{ -#ifndef NO_ICONS -#ifdef XPM - XWindowAttributes root_attr; - XpmAttributes xpm_attributes; - char *path = NULL; - - path = findIconFile(Buttons[button].icons[ico].file, pixmapPath,R_OK); - if(path == NULL) return 0; - XGetWindowAttributes(dpy,Root,&root_attr); - xpm_attributes.colormap = root_attr.colormap; - xpm_attributes.closeness = 40000; - xpm_attributes.valuemask = XpmSize | XpmReturnPixels|XpmColormap - |XpmCloseness; - if(XpmReadFileToPixmap(dpy, Root, path, - &Buttons[button].icons[ico].icon, - &Buttons[button].icons[ico].mask, - &xpm_attributes) == XpmSuccess) - { - Buttons[button].icons[ico].w = xpm_attributes.width; - Buttons[button].icons[ico].h = xpm_attributes.height; - Buttons[button].icons[ico].depth = d_depth; - free(path); - } else { - free(path); - Buttons[button].icons[ico].icon=None; - return 0; - } - if (button==BACK_BUTTON) { - BUTTONWIDTH = xpm_attributes.width; - BUTTONHEIGHT = xpm_attributes.height; - if (ForceSize && (BUTTONWIDTH > 64 || BUTTONHEIGHT > 64)) { - Pixmap resized; - - BUTTONWIDTH = 64; - BUTTONHEIGHT = 64; - resized = XCreatePixmap(dpy, Root, 64, 64, d_depth); - XCopyArea(dpy, Buttons[button].icons[ico].icon, - resized, NormalGC, 0, 0, 64, 64, 0, 0); - XFreePixmap(dpy, Buttons[button].icons[ico].icon); - Buttons[button].icons[ico].icon = resized; - } - DrawOutline(Buttons[button].icons[ico].icon,BUTTONWIDTH,BUTTONHEIGHT); - } - return 1; -#endif /* XPM */ -#endif -} - -/**************************************************************************** - * - * read background icons from data - * - ****************************************************************************/ -int GetXPMData(int button, char **data) -{ -#ifndef NO_ICONS -#ifdef XPM - XWindowAttributes root_attr; - XpmAttributes xpm_attributes; - - if( button != BACK_BUTTON ) - return 0; - XGetWindowAttributes(dpy,Root,&root_attr); - xpm_attributes.colormap = root_attr.colormap; - xpm_attributes.valuemask = XpmSize | XpmReturnPixels|XpmColormap; - if(XpmCreatePixmapFromData(dpy, Root, data, - &Buttons[button].icons[0].icon, - &Buttons[button].icons[0].mask, - &xpm_attributes) == XpmSuccess) - { - BUTTONWIDTH = Buttons[button].icons[0].w = xpm_attributes.width; - BUTTONHEIGHT = Buttons[button].icons[0].h = xpm_attributes.height; - Buttons[button].icons[0].depth = d_depth; - } - else { - return 0; - } - DrawOutline(Buttons[button].icons[0].icon,BUTTONWIDTH,BUTTONHEIGHT); - - return 1; -#endif /* XPM */ -#endif -} - -/******************************************************************* - * - * Make a gradient pixmap - * - *******************************************************************/ - -int GetXPMGradient(int button, int from[3], int to[3], int maxcols, - int type) -{ - Buttons[button].icons[0].icon=XCreatePixmap(dpy,Root,64,64, d_depth); - Buttons[button].icons[0].mask=None; - Buttons[button].icons[0].w = 64; - Buttons[button].icons[0].h = 64; - if (button==BACK_BUTTON) { - BUTTONWIDTH = 64; - BUTTONHEIGHT = 64; - } - Buttons[button].icons[0].depth = d_depth; - switch (type) { - case TEXTURE_GRADIENT: - if (!DrawDegradeRelief(dpy, Buttons[button].icons[0].icon, 0,0,64,64, - from, to, 0, maxcols)) { - XFreePixmap(dpy, Buttons[button].icons[0].icon); - return 0; - } - break; - case TEXTURE_HGRADIENT: - case TEXTURE_HCGRADIENT: - if (!DrawHGradient(dpy, Buttons[button].icons[0].icon, 0, 0, 64,64, - from, to, 0, maxcols, type-TEXTURE_HGRADIENT)) { - XFreePixmap(dpy, Buttons[button].icons[0].icon); - return 0; - } - break; - case TEXTURE_VGRADIENT: - case TEXTURE_VCGRADIENT: - if (!DrawVGradient(dpy, Buttons[button].icons[0].icon, 0, 0, 64,64, - from, to, 0, maxcols, type-TEXTURE_VGRADIENT)) { - XFreePixmap(dpy, Buttons[button].icons[0].icon); - return 0; - } - break; - default: - return 0; - } - DrawOutline(Buttons[button].icons[0].icon,64,64); - - return 1; -} - -/******************************************************************* - * - * Make a solid color pixmap - * - *******************************************************************/ - -int GetSolidXPM(int button, Pixel pixel) -{ - GC gc; - XGCValues gcv; - - gcv.foreground=pixel; - gc=XCreateGC(dpy,Root,GCForeground, &gcv); - if (button==BACK_BUTTON) { - BUTTONWIDTH = 64; - BUTTONHEIGHT = 64; - } - Buttons[button].icons[0].icon=XCreatePixmap(dpy,Root,64,64, d_depth); - Buttons[button].icons[0].mask=None; - XFillRectangle(dpy,Buttons[button].icons[0].icon,gc,0,0,64,64); - Buttons[button].icons[0].w = 64; - Buttons[button].icons[0].h = 64; - Buttons[button].icons[0].depth = d_depth; - XFreeGC(dpy,gc); - DrawOutline(Buttons[button].icons[0].icon,64,64); - - return 1; -} diff --git a/app/fvwm/extras/FvwmWharf/sample.style b/app/fvwm/extras/FvwmWharf/sample.style deleted file mode 100644 index 08b0e6ac9..000000000 --- a/app/fvwm/extras/FvwmWharf/sample.style +++ /dev/null @@ -1,41 +0,0 @@ - - -# Animate Wharf's folders - -*FvwmWharfAnimate -*FvwmWharfAnimateMain -*FvwmWharfGeometry +0+0 -*FvwmWharfColumns 1 -*FvwmWharfTextureType 2 -*FvwmWharfMaxColors 10 -*FvwmWharfBgColor black -*FvwmWharfTextureColor darkgrey white - - - -# Create a pullout "Folder" as the first button on Wharf - - -*FvwmWharf AfterStep fvwm3.xpm Folder -*FvwmWharf Shutdown shutdown-label.xpm Quit -*FvwmWharf xlock KeysOnChain-label.xpm Exec xlock -*FvwmWharf ~Folders -*FvwmWharf xterm terminal.xpm Exec xterm -*FvwmWharf Machines machines.xpm Folder -*FvwmWharf Wumpus wumpus.xpm Exec xterm -cn -T Wumpus -n Wumpus -e ssh wumpus -*FvwmWharf Wyrm wyrm.xpm Exec xterm -cn -T Wyrm -n Wyrm -e ssh wyrm -*FvwmWharf Gryphon gryphon.xpm Exec xterm -cn -T Gryphon -n Gryphon -e ssh gryphon -*FvwmWharf Wraith wraith.xpm Exec xterm -cn -T Wraith -n Wraith -e ssh wraith -*FvwmWharf Banshee banshee.xpm Exec xterm -cn -T Banshee -n Banshee -e ssh banshee -*FvwmWharf Library library.xpm Exec xterm -cn -T Library -n Library -e /usr/bin/rlogin -l library library -*FvwmWharf Rlogin rlogin.xpm Module Rlogin -*FvwmWharf ~Folders -*FvwmWharf Applications tools-label.xpm Folder -*FvwmWharf Netscape netscape-label.xpm Exec netscape -*FvwmWharf Answerbook answerbook.xpm Exec answerbook -*FvwmWharf ~Folders -*FvwmWharf MyStuff Wizard-label.xpm Folder -*FvwmWharf Workman cdrom.xpm Exec workman.sh -Wl workman -WL workman -Wp 880 680 -WP 1215 960 -Wi -*FvwmWharf Hotjava hotjava2.xpm Exec hotjava -*FvwmWharf Todo todo.xpm Exec xvdtl -*FvwmWharf ~Folders diff --git a/app/fvwm/extras/FvwmWharf/stepgfx.c b/app/fvwm/extras/FvwmWharf/stepgfx.c deleted file mode 100644 index e15da8d87..000000000 --- a/app/fvwm/extras/FvwmWharf/stepgfx.c +++ /dev/null @@ -1,587 +0,0 @@ -/* - * Generic graphics and misc. utilities - * - */ - -#include <X11/Xlib.h> -#include <stdlib.h> - -/* Masks to apply to color components when allocating colors - * you may want to set them to 0xffff if your display supports 16bpp+ - */ -#define RED_MASK 0xff00 -#define GREEN_MASK 0xff00 -#define BLUE_MASK 0xff00 -/* - *********************************************************************** - * Allocates colors and fill a pixel value array. Color values are - * truncated with RED_MASK, GREEN_MASK and BLUE_MASK - * - * from,to are the primary colors to use - * maxcols is the number of colors - * colors is the array of pixel values - * light,dark are the colors for the relief - * dr,dg,db are the increment values for the colors - * alloc_relief if colors for relief should be allocated - * incr - 0 if gradient is light to dark, 1 if dark to light - *********************************************************************** - */ -int MakeColors(Display *dpy, Drawable d, int from[3], int to[3], int maxcols, - unsigned long *colors, unsigned long *dark, - unsigned long *light, int dr, int dg, int db, - int alloc_relief, int incr) -{ - float rv, gv, bv; - float sr,sg,sb; - int red, green, blue; - XColor color; - int i; - - sr = (float)dr / (float)maxcols; - sg = (float)dg / (float)maxcols; - sb = (float)db / (float)maxcols; - rv = (float)from[0]; - gv = (float)from[1]; - bv = (float)from[2]; - /* kludge to frce color allocation in the first iteration on any case */ - color.red = (from[0] == 0) ? 0xffff : 0; - color.green = 0; - color.blue = 0; - for(i = 0; i < maxcols; i++) { - /* color allocation saver */ - red = ((short)rv) & RED_MASK; - green = ((short)gv) & GREEN_MASK; - blue = ((short)bv) & BLUE_MASK; - if (color.red != red || color.green != green || color.blue != blue) { - color.red = red; - color.green = green; - color.blue = blue; - if (XAllocColor(dpy, DefaultColormap(dpy, DefaultScreen(dpy)), - &color)==0) { - return 0; - } - } - colors[i] = color.pixel; - rv += sr; - gv += sg; - bv += sb; - rv = ((rv > 65535.0) || (rv < 0.0)) ? rv -= sr : rv; - gv = ((gv > 65535.0) || (gv < 0.0)) ? gv -= sg : gv; - bv = ((bv > 65535.0) || (bv < 0.0)) ? bv -= sb : bv; - } - /* allocate 2 colors for the bevel */ - if (alloc_relief) { - if (incr) { - rv = (float)from[0] * 0.8; - gv = (float)from[1] * 0.8; - bv = (float)from[2] * 0.8; - } else { - rv = (float)to[0] * 0.8; - gv = (float)to[1] * 0.8; - bv = (float)to[2] * 0.8; - } - color.red = (unsigned short)(rv<0?0:rv); - color.green = (unsigned short)(gv<0?0:gv); - color.blue = (unsigned short)(bv<0?0:bv); - if (XAllocColor(dpy, DefaultColormap(dpy, DefaultScreen(dpy)),&color)) - *dark = color.pixel; - else - *dark = colors[incr ? 0 : maxcols-1]; - - if (incr) { - float avg; - avg = (float)(to[0]+to[1]+to[2])/3; - rv = avg + (float)(to[0]/2); - gv = avg + (float)(to[1]/2); - bv = avg + (float)(to[2]/2); - } else { - float avg; - avg = (float)(from[0]+from[1]+from[2])/3; - rv = avg + (float)(from[0]/2); - gv = avg + (float)(from[1]/2); - bv = avg + (float)(from[2]/2); - } - color.red = (unsigned short)(rv>65535.0 ? 65535.0:rv); - color.green = (unsigned short)(gv>65535.0 ? 65535.0:gv); - color.blue = (unsigned short)(bv>65535.0 ? 65535.0:bv); - if (XAllocColor(dpy, DefaultColormap(dpy, DefaultScreen(dpy)), - &color)) - *light = color.pixel; - else - *light = colors[incr ? maxcols-1 : 0]; - } else { - *light = colors[incr ? maxcols-1 : 0]; - *dark = colors[incr ? 0 : maxcols-1]; - } - return 1; -} - - -/* - ************************************************************************ - * - * Draws a texture similar to Wharf's button background - * - * from: r,g,b values of top left color - * to: r,g,b values of bottom right color - * relief: relief to add to the borders. 0=flat, >0 raised, <0 sunken - * maxcols: # of max colors to use - * - * Aborts and returns 0 on error - ************************************************************************ - */ - -int DrawDegradeRelief(Display *dpy, Drawable d, int x, int y, int w, int h, - int from[3], int to[3], int relief, int maxcols) -{ - int i = 0,j,k; - int dr, dg, db; /* delta */ - int dmax, dmax2; - GC gc, gc2; - XGCValues gcv; - int px, py, pd; - unsigned long lightcolor, darkcolor; - int alloc_relief; - unsigned long *colors; - float c1,s1; - - if (w <= 0 || h <= 0) - return 0; - - gcv.foreground = 1; - gc = XCreateGC(dpy, d, GCForeground, &gcv); - gc2 = XCreateGC(dpy, d, GCForeground, &gcv); - - dr = to[0] - from[0]; - dg = to[1] - from[1]; - db = to[2] - from[2]; - - dmax = abs(dr); - dmax2 = dr; - if (dmax < abs(dg)) { - dmax = abs(dg); - dmax2 = dg; - } - if (dmax < abs(db)) { - dmax = abs(db); - dmax2 = db; - } - /* if colors from and to are the same, force to one color */ - if (dmax==0) dmax=1; - - if (relief!=0) { - if (maxcols>4) { - alloc_relief=1; - maxcols -= 2; /* reserve two colors for the relief */ - } else { - alloc_relief=0; - } - } else - alloc_relief = 0; - - if (dmax < maxcols) { - maxcols = dmax; /* we need less colors than we expected */ - } - - colors = malloc(sizeof(unsigned long)*maxcols); - /* alloc colors */ - if (!MakeColors(dpy, d, from, to, maxcols, colors, &darkcolor, &lightcolor, - dr, dg, db, alloc_relief, dmax2>0)) - return 0; - - /* display it */ - s1 = (float)(maxcols)/((float)w*2.0); - pd = relief==0 ? 0 : 1; - for(py = pd; py < h-pd; py++) { - c1 = ((float)maxcols/2.0)*((float)py/(float)((h-pd*2)-1)); - j = -1; - k=pd+x; - for(px = pd+x; px < w-pd+x; px++) { - i = (int)c1; - if (i>=maxcols) i=maxcols-1; - if (j != colors[i]) { - j = colors[i]; - XSetForeground(dpy, gc, j); - XDrawLine(dpy, d, gc, k, y+py, px, y+py); - k=px; - } - c1+=s1; - } - XSetForeground(dpy, gc, colors[i]); - XDrawLine(dpy, d, gc, k, y+py, w-pd+x, y+py); - } - /* draw borders */ - if (relief != 0) { - if (relief>0) { - XSetForeground(dpy, gc, lightcolor); - XSetForeground(dpy, gc2, darkcolor); - } else { - XSetForeground(dpy, gc, darkcolor); - XSetForeground(dpy, gc2, lightcolor); - } - XDrawLine(dpy, d, gc, x, y, x, y+h-1); - XDrawLine(dpy, d, gc, x, y, x+w-1, y); - XDrawLine(dpy, d, gc2, x, y+h-1, x+w-1, y+h-1); - XDrawLine(dpy, d, gc2, x+w-1, y, x+w-1, y+h-1); - } - XFreeGC(dpy,gc); - XFreeGC(dpy,gc2); - free(colors); - return 1; -} - - -/* - ************************************************************************ - * - * Draws a horizontal gradient - * - * from: r,g,b values of top color - * to: r,g,b values of bottom color - * relief: relief to add to the borders. 0=flat, >0 raised, <0 sunken - * maxcols: max colors to use - * type: gradient type. 0 for one-way, != 0 for cilindrical - * - * aborts and returns 0 on error. - ************************************************************************ - */ -int DrawHGradient(Display *dpy, Drawable d, int x, int y, int w, int h, - int from[3], int to[3], int relief, int maxcols, - int type) -{ - int i,j; - XGCValues gcv; - GC gc, gc2; - int dr,dg,db; - float s,c; - int dmax; - unsigned long *colors, lightcolor, darkcolor; - int py,pd; - int alloc_relief; - - if (w <= 1 || h <= 1) - return 0; - - gcv.foreground = 1; - gc = XCreateGC(dpy, d, GCForeground, &gcv); - gc2 = XCreateGC(dpy, d, GCForeground, &gcv); - - dr = to[0] - from[0]; - dg = to[1] - from[1]; - db = to[2] - from[2]; - - dmax = dr; - if (abs(dmax) < abs(dg)) { - dmax = dg; - } - if (abs(dmax) < abs(db)) { - dmax = db; - } - if (relief!=0) { - if (maxcols>4) { - alloc_relief=1; - maxcols -= 2; /* reserve two colors for the relief */ - } else { - alloc_relief=0; - } - } else - alloc_relief=0; - - if (type) { - if (h/2 < maxcols) { - maxcols = h/2; /* we need less colors than we expected */ - } - } else { - if (h < maxcols) { - maxcols = h; /* we need less colors than we expected */ - } - } - /* alloc colors */ - colors=malloc(maxcols*sizeof(unsigned long)); - if (!MakeColors(dpy, d, from, to, maxcols, colors, &darkcolor, &lightcolor, - dr, dg, db, alloc_relief, dmax>0)) - return 0; - /* display it */ - if (type) { - s = ((float)maxcols*2)/(float)h; - } else { - s = (float)maxcols/(float)h; - } - pd = relief==0 ? 0 : 1; - c=0; - j=-1; - if (type==0) { /* one-way */ - for(py = pd; py < h-pd; py++) { - i=(int)c; - if (i>=maxcols) i=maxcols-1; - if (j != i) { - XSetForeground(dpy, gc, colors[i]); - } - XDrawLine(dpy, d, gc, x+pd, y+py, x+w-1-pd, y+py); - j = i; - c += s; - } - } else { /* cylindrical */ - for(py = pd; py < h-pd; py++) { - i=(int)c; - if (i>=maxcols) i=maxcols-1; - if (j != i) { - XSetForeground(dpy, gc, colors[i]); - } - XDrawLine(dpy, d, gc, x+pd, y+py, x+w-1-pd, y+py); - j = i; - if (py == h/2) s = -s; - c += s; - } - } - /* draw borders */ - if (relief != 0) { - if (relief>0) { - XSetForeground(dpy, gc, lightcolor); - XSetForeground(dpy, gc2, darkcolor); - } else { - XSetForeground(dpy, gc, darkcolor); - XSetForeground(dpy, gc2, lightcolor); - } - XDrawLine(dpy, d, gc, x, y, x, y+h-1); - XDrawLine(dpy, d, gc, x, y, x+w-1, y); - XDrawLine(dpy, d, gc2, x, y+h-1, x+w-1, y+h-1); - XDrawLine(dpy, d, gc2, x+w-1, y, x+w-1, y+h-1); - } - XFreeGC(dpy,gc); - XFreeGC(dpy,gc2); - free(colors); - return 1; -} - - -/* - ************************************************************************ - * - * Draws a vertical gradient - * - * from: r,g,b values of left color - * to: r,g,b values of right color - * relief: relief to add to the borders. 0=flat, >0 raised, <0 sunken - * maxcols: max colors to use - * type: gradient type. 0 for one-way, != 0 for cilindrical - * - * aborts and returns 0 on error. - ************************************************************************ - */ -int DrawVGradient(Display *dpy, Drawable d, int x, int y, int w, int h, - int from[3], int to[3], int relief, int maxcols, - int type) -{ - int i,j; - XGCValues gcv; - GC gc, gc2; - int dr,dg,db; - float s,c; - int dmax; - unsigned long *colors, lightcolor, darkcolor; - int px,pd; - int alloc_relief; - - if (w <= 1 || h <= 1) - return 0; - - gcv.foreground = 1; - gc = XCreateGC(dpy, d, GCForeground, &gcv); - gc2 = XCreateGC(dpy, d, GCForeground, &gcv); - - dr = to[0] - from[0]; - dg = to[1] - from[1]; - db = to[2] - from[2]; - - dmax = dr; - if (abs(dmax) < abs(dg)) { - dmax = dg; - } - if (abs(dmax) < abs(db)) { - dmax = db; - } - if (relief!=0) { - if (maxcols>4) { - alloc_relief=1; - maxcols -= 2; /* reserve two colors for the relief */ - } else { - alloc_relief=0; - } - } else - alloc_relief=0; - - if (type) { - if (w/2 < maxcols) { - maxcols = w/2; /* we need less colors than we expected */ - } - } else { - if (w < maxcols) { - maxcols = w; /* we need less colors than we expected */ - } - } - /* alloc colors */ - colors=malloc(maxcols*sizeof(unsigned long)); - if (!MakeColors(dpy, d, from, to, maxcols, colors, &darkcolor, &lightcolor, - dr, dg, db, alloc_relief, dmax>0)) - return 0; - /* display it */ - if (type) { - s = ((float)maxcols*2)/(float)w; - } else { - s = (float)maxcols/(float)w; - } - pd = relief==0 ? 0 : 1; - c=0; - j=-1; - if (type==0) { /* one-way */ - for(px = pd; px < w-pd; px++) { - i=(int)c; - if (i>=maxcols) i=maxcols-1; - if (j != i) { - XSetForeground(dpy, gc, colors[i]); - } - XDrawLine(dpy, d, gc, x+px, y+pd, x+px, y+h-pd-1); - j = i; - c += s; - } - } else { /* cylindrical */ - for(px = pd; px < w-pd; px++) { - i=(int)c; - if (i>=maxcols) i=maxcols-1; - if (j != i) { - XSetForeground(dpy, gc, colors[i]); - } - XDrawLine(dpy, d, gc, x+px, y+pd, x+px, y+h-pd-1); - j = i; - if (px == w/2) s = -s; - c += s; - } - } - /* draw borders */ - if (relief != 0) { - if (relief>0) { - XSetForeground(dpy, gc, lightcolor); - XSetForeground(dpy, gc2, darkcolor); - } else { - XSetForeground(dpy, gc, darkcolor); - XSetForeground(dpy, gc2, lightcolor); - } - XDrawLine(dpy, d, gc, x, y, x, y+h-1); - XDrawLine(dpy, d, gc, x, y, x+w-1, y); - XDrawLine(dpy, d, gc2, x, y+h-1, x+w-1, y+h-1); - XDrawLine(dpy, d, gc2, x+w-1, y, x+w-1, y+h-1); - } - XFreeGC(dpy,gc); - XFreeGC(dpy,gc2); - free(colors); - return 1; -} - - -/************************************************************************ - * - * Draws text with a texture - * - * d - target drawable - * font - font to draw text - * x,y - position of text - * gradient - texture pixmap. size must be at least as large as text - * text - text to draw - * chars - chars in text - ************************************************************************/ -void DrawTexturedText(Display *dpy, Drawable d, XFontStruct *font, - int x, int y, Pixmap gradient, char *text, int chars) - -{ - Pixmap mask; - int w,h; - GC gc; - XGCValues gcv; - - /* make the mask pixmap */ - w = XTextWidth(font,text,chars); - h = font->ascent+font->descent; - mask=XCreatePixmap(dpy,DefaultRootWindow(dpy),w+1,h+1,1); - gcv.foreground = 0; - gcv.function = GXcopy; - gcv.font = font->fid; - gc = XCreateGC(dpy,mask,GCFunction|GCForeground|GCFont,&gcv); - XFillRectangle(dpy,mask,gc,0,0,w,h); - XSetForeground(dpy,gc,1); - XDrawString(dpy,mask,gc,0,font->ascent,text,chars); - XFreeGC(dpy,gc); - /* draw the texture */ - gcv.function=GXcopy; - gc = XCreateGC(dpy,d,GCFunction,&gcv); - XSetClipOrigin(dpy,gc,x,y); - XSetClipMask(dpy,gc,mask); - XCopyArea(dpy,gradient,d,gc,0,0,w,h,x,y); - XFreeGC(dpy,gc); - XFreePixmap(dpy,mask); -} - - - - -int MakeShadowColors(Display *dpy, int from[3], int to[3], - unsigned long *dark, unsigned long *light) -{ - float rv, gv, bv; - XColor color; - int incr; - int dr,dg,db,dmax; - - dr = to[0] - from[0]; - dg = to[1] - from[1]; - db = to[2] - from[2]; - - dmax = dr; - if (abs(dmax) < abs(dg)) { - dmax = dg; - } - if (abs(dmax) < abs(db)) { - dmax = db; - } - incr=(dmax>0); - /* allocate 2 colors for the bevel */ - if (incr) { - rv = (float)from[0] * 0.8; - gv = (float)from[1] * 0.8; - bv = (float)from[2] * 0.8; - } else { - rv = (float)to[0] * 0.8; - gv = (float)to[1] * 0.8; - bv = (float)to[2] * 0.8; - } - color.red = (short)(rv<0?0:rv); - color.green = (short)(gv<0?0:gv); - color.blue = (short)(bv<0?0:bv); - if (XAllocColor(dpy, DefaultColormap(dpy, DefaultScreen(dpy)),&color)) - *dark = color.pixel; - else - return 0; - - if (incr) { - float avg; - avg = (float)(to[0]+to[1]+to[2])/3; - rv = avg + (float)(to[0]/2); - gv = avg + (float)(to[1]/2); - bv = avg + (float)(to[2]/2); - } else { - float avg; - avg = (float)(from[0]+from[1]+from[2])/3; - rv = avg + (float)(from[0]/2); - gv = avg + (float)(from[1]/2); - bv = avg + (float)(from[2]/2); - } - color.red = (unsigned short)(rv>65535.0 ? 65535.0:rv); - color.green = (unsigned short)(gv>65535.0 ? 65535.0:gv); - color.blue = (unsigned short)(bv>65535.0 ? 65535.0:bv); - if (XAllocColor(dpy, DefaultColormap(dpy, DefaultScreen(dpy)), - &color)) - *light = color.pixel; - else - return 0; - return 1; -} diff --git a/app/fvwm/extras/FvwmWharf/stepgfx.h b/app/fvwm/extras/FvwmWharf/stepgfx.h deleted file mode 100644 index 902f5a06f..000000000 --- a/app/fvwm/extras/FvwmWharf/stepgfx.h +++ /dev/null @@ -1,33 +0,0 @@ - - - -#ifndef STEPGFX_H_ -#define STEPGFX_H_ - -#define TEXTURE_SOLID 0 -#define TEXTURE_GRADIENT 1 -#define TEXTURE_HGRADIENT 2 -#define TEXTURE_HCGRADIENT 3 -#define TEXTURE_VGRADIENT 4 -#define TEXTURE_VCGRADIENT 5 - -#define TEXTURE_PIXMAP 128 - -#define TEXTURE_BUILTIN 255 - -extern int DrawVGradient(Display *dpy, Drawable d, int x, int y, int w, int h, - int from[3], int to[3], int relief, int maxcols, - int type); -extern int DrawHGradient(Display *dpy, Drawable d, int x, int y, int w, int h, - int from[3], int to[3], int relief, int maxcols, - int type); -extern int DrawDegradeRelief(Display *dpy, Drawable d, int x, int y, int w, - int h, int from[3], int to[3], int relief, - int maxcols); -extern void DrawTexturedText(Display *dpy, Drawable d, XFontStruct *font, - int x, int y, Pixmap gradient, char *text, int chars); - -extern int MakeShadowColors(Display *dpy, int from[3], int to[3], - unsigned long *dark, unsigned long *light); - -#endif |