]>
Commit | Line | Data |
---|---|---|
83df96d6 JS |
1 | ///////////////////////////////////////////////////////////////////////////// |
2 | // Name: private.h | |
1b0fb34b | 3 | // Purpose: Private declarations for X11 port |
83df96d6 JS |
4 | // Author: Julian Smart |
5 | // Modified by: | |
6 | // Created: 17/09/98 | |
7 | // RCS-ID: $Id$ | |
8 | // Copyright: (c) Julian Smart | |
9 | // Licence: wxWindows licence | |
10 | ///////////////////////////////////////////////////////////////////////////// | |
11 | ||
12 | #ifndef _WX_PRIVATE_H_ | |
13 | #define _WX_PRIVATE_H_ | |
14 | ||
15 | #include "wx/defs.h" | |
1934d291 | 16 | #include "wx/utils.h" |
7266b672 | 17 | #include "X11/Xlib.h" |
1b0b798d RR |
18 | #include "X11/Xatom.h" |
19 | #include "X11/Xutil.h" | |
83df96d6 JS |
20 | |
21 | class wxMouseEvent; | |
22 | class wxKeyEvent; | |
1934d291 | 23 | class wxWindow; |
83df96d6 | 24 | |
83df96d6 JS |
25 | // ---------------------------------------------------------------------------- |
26 | // common callbacks | |
27 | // ---------------------------------------------------------------------------- | |
28 | ||
1b0fb34b | 29 | #if 0 |
83df96d6 JS |
30 | // All widgets should have this as their resize proc. |
31 | extern void wxWidgetResizeProc(Widget w, XConfigureEvent *event, String args[], int *num_args); | |
32 | ||
33 | // For repainting arbitrary windows | |
34 | void wxUniversalRepaintProc(Widget w, XtPointer WXUNUSED(c_data), XEvent *event, char *); | |
1b0fb34b | 35 | #endif |
83df96d6 JS |
36 | |
37 | // ---------------------------------------------------------------------------- | |
38 | // we maintain a hash table which contains the mapping from Widget to wxWindow | |
39 | // corresponding to the window for this widget | |
40 | // ---------------------------------------------------------------------------- | |
41 | ||
1b0fb34b JS |
42 | extern void wxDeleteWindowFromTable(Window w); |
43 | extern wxWindow *wxGetWindowFromTable(Window w); | |
44 | extern bool wxAddWindowToTable(Window w, wxWindow *win); | |
83df96d6 JS |
45 | |
46 | // ---------------------------------------------------------------------------- | |
47 | // key events related functions | |
48 | // ---------------------------------------------------------------------------- | |
49 | ||
50 | extern char wxFindMnemonic(const char* s); | |
51 | ||
52 | extern char * wxFindAccelerator (const char *s); | |
1b0fb34b | 53 | //extern XmString wxFindAcceleratorText (const char *s); |
83df96d6 JS |
54 | |
55 | extern int wxCharCodeXToWX(KeySym keySym); | |
56 | extern KeySym wxCharCodeWXToX(int id); | |
57 | ||
58 | // ---------------------------------------------------------------------------- | |
59 | // TranslateXXXEvent() functions - translate Motif event to wxWindow one | |
60 | // ---------------------------------------------------------------------------- | |
1b0fb34b JS |
61 | extern bool wxTranslateMouseEvent(wxMouseEvent& wxevent, wxWindow *win, Window window, XEvent *xevent); |
62 | extern bool wxTranslateKeyEvent(wxKeyEvent& wxevent, wxWindow *win, Window window, XEvent *xevent); | |
83df96d6 JS |
63 | |
64 | int wxGetBestMatchingPixel(Display *display, XColor *desiredColor, Colormap cmap); | |
65 | Pixmap XCreateInsensitivePixmap( Display *display, Pixmap pixmap ); | |
66 | ||
67 | extern XColor g_itemColors[]; | |
68 | extern int wxComputeColours (Display *display, wxColour * back, wxColour * fore); | |
69 | ||
b513212d JS |
70 | extern Window wxGetWindowParent(Window window); |
71 | ||
b28d3abf JS |
72 | // Set the window manager decorations according to the |
73 | // given wxWindows style | |
74 | bool wxSetWMDecorations(Window w, long style); | |
75 | bool wxMWMIsRunning(Window w); | |
76 | ||
b513212d JS |
77 | // For convenience |
78 | inline Display* wxGlobalDisplay() { return (Display*) wxGetDisplay(); } | |
79 | ||
83df96d6 JS |
80 | #define wxNO_COLORS 0x00 |
81 | #define wxBACK_COLORS 0x01 | |
82 | #define wxFORE_COLORS 0x02 | |
83 | ||
84 | extern XColor itemColors[5] ; | |
85 | ||
86 | #define wxBACK_INDEX 0 | |
87 | #define wxFORE_INDEX 1 | |
88 | #define wxSELE_INDEX 2 | |
89 | #define wxTOPS_INDEX 3 | |
90 | #define wxBOTS_INDEX 4 | |
91 | ||
7266b672 JS |
92 | #define wxMAX_RGB 0xff |
93 | #define wxMAX_SV 1000 | |
94 | #define wxSIGN(x) ((x < 0) ? -x : x) | |
95 | #define wxH_WEIGHT 4 | |
96 | #define wxS_WEIGHT 1 | |
97 | #define wxV_WEIGHT 2 | |
98 | ||
99 | typedef struct wx_hsv { | |
100 | int h,s,v; | |
101 | } wxHSV; | |
102 | ||
103 | #define wxMax3(x,y,z) ((x > y) ? ((x > z) ? x : z) : ((y > z) ? y : z)) | |
104 | #define wxMin3(x,y,z) ((x < y) ? ((x < z) ? x : z) : ((y < z) ? y : z)) | |
105 | ||
106 | void wxHSVToXColor(wxHSV *hsv,XColor *xcolor); | |
107 | void wxXColorToHSV(wxHSV *hsv,XColor *xcolor); | |
108 | void wxAllocNearestColor(Display *display,Colormap colormap,XColor *xcolor); | |
109 | void wxAllocColor(Display *display,Colormap colormap,XColor *xcolor); | |
110 | ||
83df96d6 JS |
111 | // ---------------------------------------------------------------------------- |
112 | // accessors for C modules | |
113 | // ---------------------------------------------------------------------------- | |
114 | ||
1b0fb34b | 115 | // extern "C" XtAppContext wxGetAppContext(); |
83df96d6 JS |
116 | |
117 | #endif | |
118 | // _WX_PRIVATE_H_ |