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