]>
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
,
29 String args
[], int *num_args
);
31 // For repainting arbitrary windows
32 void wxUniversalRepaintProc(Widget w
, XtPointer
WXUNUSED(c_data
),
33 XEvent
*event
, char *);
35 // ----------------------------------------------------------------------------
36 // we maintain a hash table which contains the mapping from Widget to wxWindow
37 // corresponding to the window for this widget
38 // ----------------------------------------------------------------------------
40 extern void wxDeleteWindowFromTable(Widget w
);
41 extern wxWindow
*wxGetWindowFromTable(Widget w
);
42 extern bool wxAddWindowToTable(Widget w
, wxWindow
*win
);
44 // ----------------------------------------------------------------------------
45 // key events related functions
46 // ----------------------------------------------------------------------------
48 extern char wxFindMnemonic(const char* s
);
50 extern char * wxFindAccelerator (const char *s
);
51 extern XmString
wxFindAcceleratorText (const char *s
);
53 // ----------------------------------------------------------------------------
54 // TranslateXXXEvent() functions - translate Motif event to wxWindow one
55 // ----------------------------------------------------------------------------
57 extern bool wxTranslateMouseEvent(wxMouseEvent
& wxevent
, wxWindow
*win
,
58 Widget widget
, XEvent
*xevent
);
59 extern bool wxTranslateKeyEvent(wxKeyEvent
& wxevent
, wxWindow
*win
,
60 Widget widget
, XEvent
*xevent
);
62 extern void wxDoChangeForegroundColour(WXWidget widget
,
63 wxColour
& foregroundColour
);
64 extern void wxDoChangeBackgroundColour(WXWidget widget
,
65 wxColour
& backgroundColour
,
66 bool changeArmColour
= FALSE
);
68 #define wxNO_COLORS 0x00
69 #define wxBACK_COLORS 0x01
70 #define wxFORE_COLORS 0x02
72 extern XColor itemColors
[5] ;
74 #define wxBACK_INDEX 0
75 #define wxFORE_INDEX 1
76 #define wxSELE_INDEX 2
77 #define wxTOPS_INDEX 3
78 #define wxBOTS_INDEX 4
80 // ----------------------------------------------------------------------------
82 // ----------------------------------------------------------------------------
84 // XmString made easy to use in wxWindows (and has an added benefit of
85 // cleaning up automatically)
89 wxXmString(const char* str
)
91 m_string
= XmStringCreateLtoR((char *)str
, XmSTRING_DEFAULT_CHARSET
);
94 wxXmString(const wxString
& str
)
96 m_string
= XmStringCreateLtoR((char *)str
.c_str(),
97 XmSTRING_DEFAULT_CHARSET
);
100 ~wxXmString() { XmStringFree(m_string
); }
102 // semi-implicit conversion to XmString (shouldn't rely on implicit
103 // conversion because many of Motif functions are macros)
104 XmString
operator()() const { return m_string
; }
110 // ----------------------------------------------------------------------------
111 // Routines used in both wxTextCtrl/wxListBox and nativa wxComboBox
112 // (defined in src/motif/listbox.cpp or src/motif/textctrl.cpp
113 // ----------------------------------------------------------------------------
115 int wxDoFindStringInList( Widget listWidget
, const wxString
& str
);
116 int wxDoGetSelectionInList(Widget listWidget
);
118 // ----------------------------------------------------------------------------
119 // executes one main loop iteration (implemented in src/motif/evtloop.cpp)
120 // ----------------------------------------------------------------------------
124 // returns true if the loop should be exited
125 bool wxDoEventLoopIteration( wxEventLoop
& evtLoop
);
127 // ----------------------------------------------------------------------------
128 // macros to avoid casting WXFOO to Foo all the time
129 // ----------------------------------------------------------------------------
131 // argument is of type "wxWindow *"
132 #define GetWidget(w) ((Widget)(w)->GetHandle())
134 // ----------------------------------------------------------------------------
135 // accessors for C modules
136 // ----------------------------------------------------------------------------
138 extern "C" XtAppContext
wxGetAppContext();