]>
git.saurik.com Git - wxWidgets.git/blob - include/wx/motif/private.h
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: Private declarations for wxMotif port
4 // Author: Julian Smart
8 // Copyright: (c) Julian Smart
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 #ifndef _WX_PRIVATE_H_
13 #define _WX_PRIVATE_H_
18 #include "wx/x11/privx.h"
20 // Put any private declarations here: native Motif types may be used because
21 // this header is included after Xm/Xm.h
23 // ----------------------------------------------------------------------------
25 // ----------------------------------------------------------------------------
27 // All widgets should have this as their resize proc.
28 extern void wxWidgetResizeProc(Widget w
, XConfigureEvent
*event
, String args
[], int *num_args
);
30 // For repainting arbitrary windows
31 void wxUniversalRepaintProc(Widget w
, XtPointer
WXUNUSED(c_data
), XEvent
*event
, char *);
33 // ----------------------------------------------------------------------------
34 // we maintain a hash table which contains the mapping from Widget to wxWindow
35 // corresponding to the window for this widget
36 // ----------------------------------------------------------------------------
38 extern void wxDeleteWindowFromTable(Widget w
);
39 extern wxWindow
*wxGetWindowFromTable(Widget w
);
40 extern bool wxAddWindowToTable(Widget w
, wxWindow
*win
);
42 // ----------------------------------------------------------------------------
43 // key events related functions
44 // ----------------------------------------------------------------------------
46 extern char wxFindMnemonic(const char* s
);
48 extern char * wxFindAccelerator (const char *s
);
49 extern XmString
wxFindAcceleratorText (const char *s
);
51 // ----------------------------------------------------------------------------
52 // TranslateXXXEvent() functions - translate Motif event to wxWindow one
53 // ----------------------------------------------------------------------------
54 extern bool wxTranslateMouseEvent(wxMouseEvent
& wxevent
, wxWindow
*win
, Widget widget
, XEvent
*xevent
);
55 extern bool wxTranslateKeyEvent(wxKeyEvent
& wxevent
, wxWindow
*win
, Widget widget
, XEvent
*xevent
);
57 extern void wxDoChangeForegroundColour(WXWidget widget
, wxColour
& foregroundColour
);
58 extern void wxDoChangeBackgroundColour(WXWidget widget
, wxColour
& backgroundColour
, bool changeArmColour
= FALSE
);
60 #define wxNO_COLORS 0x00
61 #define wxBACK_COLORS 0x01
62 #define wxFORE_COLORS 0x02
64 extern XColor itemColors
[5] ;
66 #define wxBACK_INDEX 0
67 #define wxFORE_INDEX 1
68 #define wxSELE_INDEX 2
69 #define wxTOPS_INDEX 3
70 #define wxBOTS_INDEX 4
72 // ----------------------------------------------------------------------------
74 // ----------------------------------------------------------------------------
76 // XmString made easy to use in wxWindows (and has an added benefit of
77 // cleaning up automatically)
81 wxXmString(const wxString
& str
)
83 m_string
= XmStringCreateLtoR((char *)str
.c_str(),
84 XmSTRING_DEFAULT_CHARSET
);
87 ~wxXmString() { XmStringFree(m_string
); }
89 // semi-implicit conversion to XmString (shouldn't rely on implicit
90 // conversion because many of Motif functions are macros)
91 XmString
operator()() const { return m_string
; }
97 // ----------------------------------------------------------------------------
98 // macros to avoid casting WXFOO to Foo all the time
99 // ----------------------------------------------------------------------------
101 // argument is of type "wxWindow *"
102 #define GetWidget(w) ((Widget)(w)->GetHandle())
104 // ----------------------------------------------------------------------------
105 // accessors for C modules
106 // ----------------------------------------------------------------------------
108 extern "C" XtAppContext
wxGetAppContext();