Restructure how we look for Read files slightly.
[fvwm.git] / modules / FvwmScript / Widgets / Tools.h
blob1b309ffe65244422856d282999e08b2b2de7031a
1 /* -*-c-*- */
2 #include "../types.h"
3 #if HAVE_SYS_SELECT_H
4 # include <sys/select.h>
5 #endif
7 #include "libs/Flocale.h"
9 extern Display *dpy;
10 extern int screen;
11 extern Window Root;
12 extern char *Scrapt;
13 extern Atom propriete;
14 extern Atom type;
15 extern char *imagePath;
16 extern X11base *x11base;
17 extern int nbobj;
18 extern struct XObj *tabxobj[1000];
19 extern int x_fd;
20 extern char *ScriptName;
21 extern FlocaleWinString *FwinString;
23 /* Constante pour les type de message envoie entre objets */
24 /* <0 valeur reserve pour les messages internes */
25 /* >0 message envoie par l'utilisateur */
26 #define SingleClic -1
27 #define DoubleClic -2
29 /* if the time in X ms between a Button Press and ButtonRelease is < to *
30 * MENU_DRAG_TIME, then we consider the mouse click as simple click and
31 * not "menu drag" (use in Menu.c and PopupMenu.c */
32 #define MENU_DRAG_TIME 300
33 #define GRAB_EVMASK (ButtonPressMask | ButtonReleaseMask | ButtonMotionMask | PointerMotionMask | EnterWindowMask | LeaveWindowMask)
35 /* helper functions */
36 /* get byte offset corresponding to character offset, including
37 bounds check to represent end of text */
38 int getByteOffsetBoundsCheck(FlocaleFont *flf, char *str, int offset);
39 /* opposite of the above, return character offset */
40 int getCharOffsetBoundsCheck(FlocaleFont *flf, char *str, int offset);
42 void MyDrawString(
43 Display *dpy, struct XObj *xobj, Window win, int x, int y,
44 char *str, unsigned long ForeC,unsigned long HiC,
45 unsigned long BackC, int WithRelief, XRectangle *clip, XEvent *evp);
47 int GetXTextPosition(struct XObj *xobj, int obj_width, int str_len,
48 int left_offset, int center_offset, int right_offset);
50 char* GetMenuTitle(char *str,int id);
52 void DrawPMenu(struct XObj *xobj,Window WinPop,int h,int StrtOpt);
54 void UnselectMenu(struct XObj *xobj,Window WinPop,int hOpt,int value,
55 unsigned int width, int asc, int start);
56 void SelectMenu(struct XObj *xobj,Window WinPop,int hOpt,int value);
58 int CountOption(char *str);
60 void DrawIconStr(int offset, struct XObj *xobj, int DoRedraw,
61 int l_offset, int c_offset, int r_offset,
62 XRectangle *str_clip, XRectangle *icon_clip, XEvent *evp);
64 void DrawReliefRect(int x,int y,int width,int height,struct XObj *xobj,
65 unsigned int LiC, unsigned int ShadC);
67 int InsertText(struct XObj *xobj,char *str,int SizeStr);
69 char *GetText(struct XObj *xobj,int End);
71 void SelectOneTextField(struct XObj *xobj);
73 void DrawArrowN(struct XObj *xobj,int x,int y,int Press);
75 void DrawArrowS(struct XObj *xobj,int x,int y,int Press);
77 void DrawArrowE(struct XObj *xobj,int x,int y,int Press);
79 void DrawArrowW(struct XObj *xobj,int x,int y,int Press);
81 int PtInRect(XPoint pt,XRectangle rect);
83 void Wait(int t);
85 int IsItDoubleClic(struct XObj *xobj);