Force windows on-screen when using:
[fvwm.git] / modules / FvwmDragWell / fvwmDragWell.h
blobe6e4b494e21e563038d05cd04389e32386a87dc0
1 /* -*-c-*- */
2 #ifndef FVWMDRAGWELL_H
3 #define FVWMDRAGWELL_H
5 #include <X11/Xlib.h>
6 #include <X11/Xproto.h>
7 #include <sys/types.h>
8 #include <sys/stat.h>
9 #include <dirent.h>
11 #define MW_EVENTS (ExposureMask | ButtonReleaseMask | ButtonPressMask | \
12 ButtonMotionMask | StructureNotifyMask)
15 #define MODULE_TO_FVWM 0 /*fd[] entries*/
16 #define FVWM_TO_MODULE 1
18 #define FOUND_XEVENT 1 /*return types of myXNextEvent*/
19 #define FOUND_FVWM_MESSAGE -1
20 #define FOUND_FVWM_NON_MESSAGE 0
22 #define DEFAULT_ANIMATION 1 /*xg.animationType*/
24 /*This is a collection of globals that deal with X*/
25 typedef struct XGlobals_struct {
26 Window root; /* root window of screen*/
27 Window win; /* the button/drag window*/
28 Display *dpy; /* Display */
29 int xfd; /*X file descriptor, used to check for events */
30 int fdWidth; /*fd_set_size_t fdWidth;*/
31 int animationType; /*how we animate upon receipt of a drag item*/
32 int screen; /* Screen*/
33 int dpyHeight; /*height of screen*/
34 int dpyWidth;
35 int dpyDepth; /* display depth*/
36 int colorset; /*colorset*/
37 Pixel fore; /* colors..*/
38 Pixel back;
39 Pixel shadow; /*colors of buttons, relief on menus*/
40 Pixel hilite;
41 char *foreColorStr; /*strings for colors*/
42 char *backColorStr;
43 char *shadowColorStr;
44 char *hiliteColorStr;
45 GC hiliteGC;
46 GC shadowGC;
47 GC buttonGC;
48 FILE *log; /* debugging log*/
49 Atom wmAtomDelWin; /*seems to be used for closing the window*/
50 char *appName; /* name of the application */
51 int x,y; /* screen location*/
52 unsigned w,h; /*width of window*/
53 int dbx,dby; /* the x,y pos of drop box*/
54 unsigned dbw,dbh; /*the width and height of the drop box*/
55 int xneg,yneg,usposition; /*window size stuff*/
56 XSizeHints sizehints;
57 } XGlobals;
62 *Button stuff
64 typedef struct DragWellButton_struct DragWellButton;
65 struct DragWellButton_struct {
66 Window win; /*window the button is on*/
67 int wx,wy; /*x,y position on window*/
68 int w,h; /*width, height*/
69 int state; /*state of button*/
70 int (*drawButFace)(DragWellButton *); /*func ptr to draw something on face of button*/
73 /* The two possible states of the DragWellButton */
74 #define DRAGWELL_BUTTON_NOT_PUSHED 0
75 #define DRAGWELL_BUTTON_PUSHED 1
78 /*Maximum length of qfsPath */
79 #define MAX_PATH_LEN 256
81 /* Menu entry types, used by entryType[] */
82 #define DRAGWELLMENUITEM_DIR 1
83 #define DRAGWELLMENUITEM_FILE 2
85 /*Total time it takes to animate a successful selection*/
86 #define TOTAL_ANIMATION_TIME 500000
88 #define DRAG_DATA_TYPE_PATH 0
89 #define DRAG_DATA_TYPE_NONPATH 1
91 *Global stuff common to all menus
93 typedef struct DragWellMenuGlobal_struct {
94 short exportAsURL; /* export as "file://" or "/" */
95 Pixel fore,back; /* colors...*/
97 char dragData[MAX_PATH_LEN]; /*the path*/
98 char dragTypeStr[MAX_PATH_LEN]; /*the path*/
99 int dragDataType;
100 int dragState; /* Do we have an item to drag*/
101 Atom action; /* the XDND action we will use*/
102 Atom *typelist; /* the drag types we support, Null terminated */
103 Atom textUriAtom;
104 /*UNUSED*/
105 char *fontname; /* name of the font used in the menus*/
106 XFontStruct *font; /* font structure */
107 int fontHeight; /* height of the font */
108 /*end UNUSED*/
109 } DragWellMenuGlobals;
111 /*UNUSED*/
113 /*Do we have a draggable item, used by dragState*/
114 #define DRAGWELLMENU_NO_DRAG_ITEM 0
115 #define DRAGWELLMENU_HAVE_DRAG_ITEM 1
117 #endif