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 BUTTONFILENAME "/.wmbutton.xpm"
21 /****** Version / Release Number ***************************************/
22 #define VER 0 /* Version Number */
23 #define REL 6 /* Release Number */
25 /****** Define Error Codes *********************************************/
37 /****** Define Other Options ****************************************/
38 #define VERB 0 /* Enable=1, Disable=0: Debugging (verbose) Mode*/
39 #define MIDMOUSE 1 /* Define Middle Mouse functionality */
40 #define LMASK 0 /* left button mask: run app # mask + button #*/
41 #define MMASK 10 /* middle button mask: run app # mask + button #*/
42 #define RMASK 20 /* right button mask: run app # mask + button #*/
43 #define NUMB_OF_APPS 9 /* Define number of apps */
45 #define EOLN '\n' /* Defines the new line character */
46 #define SIZE1 20 /* Defines the increment to increase the */
47 /* string by until a newline of EOF is found */
49 /****** Defines for Tool Tips ***************************************/
50 #define TOOLTIP_SUPPORT 1
51 #define TOOLTIP_FONT "-*-helvetica-medium-r-normal-*-10-*-*-*-*-*-*-*"
52 #define TOOLTIP_FONT_LEN 128
53 #define TOOLTIP_SHOW_DELAY 750
54 #define TOOLTIP_RESHOW_DELAY 1500
56 #define TOOLTIP_SPACE 12
58 #define TOOLTIP_BOTTOM 1
59 #define TOOLTIP_LEFT 0
60 #define TOOLTIP_RIGHT 2
62 #define BUTTON_SIZE 18
65 #define BUFFER_SIZE 1024
67 /****** Typedefs *******************************************/
77 int bTooltipSwapColors
;
81 /****** Function Prototyes *******************************************/
82 void RunAppN(int app
); // function to run app N as found in conf file
83 char *Parse(int app
); // parse data in config file
84 void parseargs(int argc
, char **argv
);
85 char *readln(FILE *fp
); // read line from file, return pointer to it
86 void err_mess(int err
, char *str
); // Error Handling Routine
87 void show_usage(void); // show usage message to stderr
88 int flush_expose(Window w
);
91 /****** Tooltip Function Prototypes **********************************/
93 void destroyTooltip ();
94 int hasTooltipSupport ();
95 void showTooltip (int nButton
, int nMouseX
, int nMouseY
);
98 void drawTooltipBalloon (Pixmap pix
, GC gc
, int x
, int y
, int w
, int h
, int side
);
99 Pixmap
createTooltipPixmap (int width
, int height
, int side
, Pixmap
*mask
);
102 long currentTimeMillis ();
103 void getWindowOrigin (Window w
, int* nX
, int* nY
);
104 void getButtonLocation (int nButton
, int* nLocationX
, int* nLocationY
);
105 char *getButtonAppNames (int nButton
);
107 /**********************************************************************/