]>
git.saurik.com Git - wxWidgets.git/blob - include/wx/x11/privx.h
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: Private declarations common to X11 and Motif ports
4 // Author: Julian Smart
8 // Copyright: (c) Julian Smart
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
18 #include "X11/Xatom.h"
19 #include "X11/Xutil.h"
25 // ----------------------------------------------------------------------------
26 // key events related functions
27 // ----------------------------------------------------------------------------
29 extern int wxCharCodeXToWX(KeySym keySym
);
30 extern KeySym
wxCharCodeWXToX(int id
);
32 int wxGetBestMatchingPixel(Display
*display
, XColor
*desiredColor
, Colormap cmap
);
33 Pixmap
XCreateInsensitivePixmap( Display
*display
, Pixmap pixmap
);
35 extern XColor g_itemColors
[];
36 extern int wxComputeColours (Display
*display
, wxColour
* back
, wxColour
* fore
);
39 inline Display
* wxGlobalDisplay() { return (Display
*) wxGetDisplay(); }
41 #define wxMAX_RGB 0xff
43 #define wxSIGN(x) ((x < 0) ? -x : x)
48 typedef struct wx_hsv
{
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))
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
);
62 wxString
wxGetXEventName(XEvent
& event
);
65 // Is the window visible?
66 bool wxWindowIsVisible(Window win
);
69 #define XEventGetWindow(event) event->general.wid
70 #define XConfigureEventGetWidth(event) ((int) event->update.width)
71 #define XConfigureEventGetHeight(event) ((int) event->update.height)
72 #define XExposeEventGetX(event) event->exposure.x
73 #define XExposeEventGetY(event) event->exposure.y
74 #define XExposeEventGetWidth(event) event->exposure.width
75 #define XExposeEventGetHeight(event) event->exposure.height
76 #define XFontStructGetAscent(f) f->info.baseline
78 #define XEventGetWindow(event) event->xany.window
79 #define XConfigureEventGetWidth(event) event->xconfigure.width
80 #define XConfigureEventGetHeight(event) event->xconfigure.height
81 #define XExposeEventGetX(event) event->xexpose.x
82 #define XExposeEventGetY(event) event->xexpose.y
83 #define XExposeEventGetWidth(event) event->xexpose.width
84 #define XExposeEventGetHeight(event) event->xexpose.height
85 #define XFontStructGetAscent(f) f->ascent