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 /****** Define Error Codes *********************************************/
34 /****** Define Other Options ****************************************/
35 #define VERB 0 /* Enable=1, Disable=0: Debugging (verbose) Mode*/
36 #define LMASK 0 /* left button mask: run app # mask + button #*/
37 #define MMASK 10 /* middle button mask: run app # mask + button #*/
38 #define RMASK 20 /* right button mask: run app # mask + button #*/
39 #define NUMB_OF_APPS 9 /* Define number of apps */
41 #define EOLN '\n' /* Defines the new line character */
42 #define SIZE1 20 /* Defines the increment to increase the */
43 /* string by until a newline of EOF is found */
45 /****** Defines for Tool Tips ***************************************/
46 #define TOOLTIP_SUPPORT 1
47 #define TOOLTIP_FONT "-*-helvetica-medium-r-normal-*-10-*-*-*-*-*-*-*"
48 #define TOOLTIP_FONT_LEN 128
49 #define TOOLTIP_SHOW_DELAY 750
50 #define TOOLTIP_RESHOW_DELAY 1500
52 #define TOOLTIP_SPACE 12
54 #define TOOLTIP_BOTTOM 1
55 #define TOOLTIP_LEFT 0
56 #define TOOLTIP_RIGHT 2
58 #define BUTTON_SIZE 18
61 #define BUFFER_SIZE 1024
63 /****** Typedefs *******************************************/
73 int bTooltipSwapColors
;
77 /****** Function Prototyes *******************************************/
78 void RunAppN(int app
); /* function to run app N as found in conf file */
79 char *Parse(int app
); /* parse data in config file */
80 void parseargs(int argc
, char **argv
);
81 char *readln(FILE *fp
); /* read line from file, return pointer to it */
82 void err_mess(int err
, char *str
); /* Error Handling Routine */
83 void show_usage(void); /* show usage message to stderr */
84 int canOpenFile(const char *path
);
85 int flush_expose(Window w
);
88 /****** Tooltip Function Prototypes **********************************/
89 void initTooltip(void);
90 void destroyTooltip(void);
91 int hasTooltipSupport(void);
92 void showTooltip(int nButton
, int nMouseX
, int nMouseY
);
93 void hideTooltip(void);
95 void drawTooltipBalloon(Pixmap pix
, GC gc
, int x
, int y
, int w
, int h
, int side
);
96 Pixmap
createTooltipPixmap(int width
, int height
, int side
, Pixmap
*mask
);
99 long currentTimeMillis(void);
100 void getWindowOrigin(Window w
, int *nX
, int *nY
);
101 void getButtonLocation(int nButton
, int *nLocationX
, int *nLocationY
);
102 char *getButtonAppNames(int nButton
);
104 /**********************************************************************/