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