1 /* wmbutton.h - Edward H. Flora - ehf_dockapps@cox.net */
2 /* Last Modified 3/27/04 */
4 /****** Include Files ***************************************************/
8 #include <X11/extensions/shape.h>
9 #include <X11/keysym.h>
17 /****** Define Config File Info ***************************************/
18 #define CONFFILENAME "/.wmbutton" /* Default conf filename $HOME/.wmbutton */
19 #define CONFIGGLOBAL "/etc/wmbutton.conf" /* system configuration */
20 #define BUTTONFILENAME "/.wmbutton.xpm"
22 /****** Version Number *************************************************/
23 #define VER 0 /* Version Number */
24 #define REL 6 /* Release Number */
26 /****** Define Error Codes *********************************************/
38 /****** Define Other Options ****************************************/
39 #define VERB 0 /* Enable=1, Disable=0: Debugging (verbose) Mode*/
40 #define MIDMOUSE 1 /* Define Middle Mouse functionality */
41 #define LMASK 0 /* left button mask: run app # mask + button #*/
42 #define MMASK 10 /* middle button mask: run app # mask + button #*/
43 #define RMASK 20 /* right button mask: run app # mask + button #*/
44 #define NUMB_OF_APPS 9 /* Define number of apps */
46 #define EOLN '\n' /* Defines the new line character */
47 #define SIZE1 20 /* Defines the increment to increase the */
48 /* string by until a newline of EOF is found */
50 /****** Defines for Tool Tips ***************************************/
51 #define TOOLTIP_SUPPORT 1
52 #define TOOLTIP_FONT "-*-helvetica-medium-r-normal-*-10-*-*-*-*-*-*-*"
53 #define TOOLTIP_FONT_LEN 128
54 #define TOOLTIP_SHOW_DELAY 750
55 #define TOOLTIP_RESHOW_DELAY 1500
57 #define TOOLTIP_SPACE 12
59 #define TOOLTIP_BOTTOM 1
60 #define TOOLTIP_LEFT 0
61 #define TOOLTIP_RIGHT 2
63 #define BUTTON_SIZE 18
66 #define BUFFER_SIZE 1024
68 /****** Typedefs *******************************************/
78 int bTooltipSwapColors
;
82 /****** Function Prototyes *******************************************/
83 void RunAppN(int app
); // function to run app N as found in conf file
84 char *Parse(int app
); // parse data in config file
85 void parseargs(int argc
, char **argv
);
86 char *readln(FILE *fp
); // read line from file, return pointer to it
87 void err_mess(int err
, char *str
); // Error Handling Routine
88 void show_usage(void); // show usage message to stderr
89 int flush_expose(Window w
);
92 /****** Tooltip Function Prototypes **********************************/
94 void destroyTooltip ();
95 int hasTooltipSupport ();
96 void showTooltip (int nButton
, int nMouseX
, int nMouseY
);
99 void drawTooltipBalloon (Pixmap pix
, GC gc
, int x
, int y
, int w
, int h
, int side
);
100 Pixmap
createTooltipPixmap (int width
, int height
, int side
, Pixmap
*mask
);
103 long currentTimeMillis ();
104 void getWindowOrigin (Window w
, int* nX
, int* nY
);
105 void getButtonLocation (int nButton
, int* nLocationX
, int* nLocationY
);
106 char *getButtonAppNames (int nButton
);
108 /**********************************************************************/