]>
Commit | Line | Data |
---|---|---|
5e29f97a JS |
1 | ///////////////////////////////////////////////////////////////////////////// |
2 | // Name: privx.h | |
3 | // Purpose: Private declarations common to X11 and Motif ports | |
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 | ||
61aa560b JS |
12 | #ifndef _WX_PRIVX_H_ |
13 | #define _WX_PRIVX_H_ | |
5e29f97a JS |
14 | |
15 | #include "wx/defs.h" | |
16 | #include "wx/utils.h" | |
17 | #include "X11/Xlib.h" | |
18 | #include "X11/Xatom.h" | |
19 | #include "X11/Xutil.h" | |
20 | ||
21 | class wxMouseEvent; | |
22 | class wxKeyEvent; | |
23 | class wxWindow; | |
24 | ||
25 | // ---------------------------------------------------------------------------- | |
26 | // key events related functions | |
27 | // ---------------------------------------------------------------------------- | |
28 | ||
29 | extern int wxCharCodeXToWX(KeySym keySym); | |
30 | extern KeySym wxCharCodeWXToX(int id); | |
31 | ||
32 | int wxGetBestMatchingPixel(Display *display, XColor *desiredColor, Colormap cmap); | |
33 | Pixmap XCreateInsensitivePixmap( Display *display, Pixmap pixmap ); | |
34 | ||
35 | extern XColor g_itemColors[]; | |
36 | extern int wxComputeColours (Display *display, wxColour * back, wxColour * fore); | |
37 | ||
38 | // For convenience | |
39 | inline Display* wxGlobalDisplay() { return (Display*) wxGetDisplay(); } | |
40 | ||
5e29f97a JS |
41 | #define wxMAX_RGB 0xff |
42 | #define wxMAX_SV 1000 | |
43 | #define wxSIGN(x) ((x < 0) ? -x : x) | |
44 | #define wxH_WEIGHT 4 | |
45 | #define wxS_WEIGHT 1 | |
46 | #define wxV_WEIGHT 2 | |
47 | ||
48 | typedef struct wx_hsv { | |
49 | int h,s,v; | |
50 | } wxHSV; | |
51 | ||
52 | #define wxMax3(x,y,z) ((x > y) ? ((x > z) ? x : z) : ((y > z) ? y : z)) | |
53 | #define wxMin3(x,y,z) ((x < y) ? ((x < z) ? x : z) : ((y < z) ? y : z)) | |
54 | ||
55 | void wxHSVToXColor(wxHSV *hsv,XColor *xcolor); | |
56 | void wxXColorToHSV(wxHSV *hsv,XColor *xcolor); | |
57 | void wxAllocNearestColor(Display *display,Colormap colormap,XColor *xcolor); | |
58 | void wxAllocColor(Display *display,Colormap colormap,XColor *xcolor); | |
59 | ||
45ff6421 JS |
60 | // For debugging |
61 | #ifdef __WXDEBUG__ | |
62 | wxString wxGetXEventName(XEvent& event); | |
63 | #endif | |
64 | ||
3a0b23eb JS |
65 | // Is the window visible? |
66 | bool wxWindowIsVisible(Window win); | |
67 | ||
5e29f97a | 68 | #endif |
61aa560b | 69 | // _WX_PRIVX_H_ |