]> git.saurik.com Git - wxWidgets.git/blame - include/wx/x11/private.h
Killed various wxMotif things in wxX11.
[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"
1934d291 16#include "wx/utils.h"
7266b672 17#include "X11/Xlib.h"
83df96d6
JS
18
19class wxMouseEvent;
20class wxKeyEvent;
1934d291 21class 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.
29extern void wxWidgetResizeProc(Widget w, XConfigureEvent *event, String args[], int *num_args);
30
31// For repainting arbitrary windows
32void 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
40extern void wxDeleteWindowFromTable(Window w);
41extern wxWindow *wxGetWindowFromTable(Window w);
42extern bool wxAddWindowToTable(Window w, wxWindow *win);
83df96d6
JS
43
44// ----------------------------------------------------------------------------
45// key events related functions
46// ----------------------------------------------------------------------------
47
48extern char wxFindMnemonic(const char* s);
49
50extern char * wxFindAccelerator (const char *s);
1b0fb34b 51//extern XmString wxFindAcceleratorText (const char *s);
83df96d6
JS
52
53extern int wxCharCodeXToWX(KeySym keySym);
54extern KeySym wxCharCodeWXToX(int id);
55
56// ----------------------------------------------------------------------------
57// TranslateXXXEvent() functions - translate Motif event to wxWindow one
58// ----------------------------------------------------------------------------
1b0fb34b
JS
59extern bool wxTranslateMouseEvent(wxMouseEvent& wxevent, wxWindow *win, Window window, XEvent *xevent);
60extern bool wxTranslateKeyEvent(wxKeyEvent& wxevent, wxWindow *win, Window window, XEvent *xevent);
83df96d6
JS
61
62int wxGetBestMatchingPixel(Display *display, XColor *desiredColor, Colormap cmap);
63Pixmap XCreateInsensitivePixmap( Display *display, Pixmap pixmap );
64
65extern XColor g_itemColors[];
66extern int wxComputeColours (Display *display, wxColour * back, wxColour * fore);
67
68extern void wxDoChangeForegroundColour(WXWidget widget, wxColour& foregroundColour);
69extern void wxDoChangeBackgroundColour(WXWidget widget, wxColour& backgroundColour, bool changeArmColour = FALSE);
70
b513212d
JS
71extern Window wxGetWindowParent(Window window);
72
73// For convenience
74inline Display* wxGlobalDisplay() { return (Display*) wxGetDisplay(); }
75
83df96d6
JS
76#define wxNO_COLORS 0x00
77#define wxBACK_COLORS 0x01
78#define wxFORE_COLORS 0x02
79
80extern XColor itemColors[5] ;
81
82#define wxBACK_INDEX 0
83#define wxFORE_INDEX 1
84#define wxSELE_INDEX 2
85#define wxTOPS_INDEX 3
86#define wxBOTS_INDEX 4
87
7266b672
JS
88#define wxMAX_RGB 0xff
89#define wxMAX_SV 1000
90#define wxSIGN(x) ((x < 0) ? -x : x)
91#define wxH_WEIGHT 4
92#define wxS_WEIGHT 1
93#define wxV_WEIGHT 2
94
95typedef struct wx_hsv {
96 int h,s,v;
97 } wxHSV;
98
99#define wxMax3(x,y,z) ((x > y) ? ((x > z) ? x : z) : ((y > z) ? y : z))
100#define wxMin3(x,y,z) ((x < y) ? ((x < z) ? x : z) : ((y < z) ? y : z))
101
102void wxHSVToXColor(wxHSV *hsv,XColor *xcolor);
103void wxXColorToHSV(wxHSV *hsv,XColor *xcolor);
104void wxAllocNearestColor(Display *display,Colormap colormap,XColor *xcolor);
105void wxAllocColor(Display *display,Colormap colormap,XColor *xcolor);
106
83df96d6
JS
107// ----------------------------------------------------------------------------
108// accessors for C modules
109// ----------------------------------------------------------------------------
110
1b0fb34b 111// extern "C" XtAppContext wxGetAppContext();
83df96d6
JS
112
113#endif
114// _WX_PRIVATE_H_