Display *display = (Display*)wxdisplay;
wxEventLoop evtLoop;
- XSync (display, FALSE);
+ XSync (display, False);
while (evtLoop.Pending())
{
// Motif version of the libs but the X protocol
// version!
Display *display = wxGlobalDisplay();
- info.versionMajor = ProtocolVersion (display);
- info.versionMinor = ProtocolRevision (display);
+ if (display)
+ {
+ info.versionMajor = ProtocolVersion (display);
+ info.versionMinor = ProtocolRevision (display);
+ }
info.os = wxMOTIF_X;
return info;
}
return dest;
}
-static char *GetResourcePath(char *buf, const char *name, bool create = FALSE)
+static char *GetResourcePath(char *buf, const char *name, bool create = false)
{
if (create && wxFileExists (name) ) {
strcpy(buf, name);
{
const char *file = node->GetKeyString();
// If file doesn't exist, create it first.
- (void)GetResourcePath(nameBuffer, file, TRUE);
+ (void)GetResourcePath(nameBuffer, file, true);
XrmDatabase database = (XrmDatabase) node->Data ();
XrmPutFileDatabase (database, nameBuffer);
strncpy (*value, xvalue.addr, (int) xvalue.size);
return true;
}
- return FALSE;
+ return false;
}
bool wxGetResource(const wxString& section, const wxString& entry, float *value, const wxString& file)
delete[] s;
return true;
}
- else return FALSE;
+ else return false;
}
bool wxGetResource(const wxString& section, const wxString& entry, long *value, const wxString& file)
delete[] s;
return true;
}
- else return FALSE;
+ else return false;
}
bool wxGetResource(const wxString& section, const wxString& entry, int *value, const wxString& file)
// Handle True, False here
// True, Yes, Enables, Set or Activated
if (*s == 'T' || *s == 'Y' || *s == 'E' || *s == 'S' || *s == 'A')
- *value = TRUE;
+ *value = true;
// False, No, Disabled, Reset, Cleared, Deactivated
else if (*s == 'F' || *s == 'N' || *s == 'D' || *s == 'R' || *s == 'C')
- *value = FALSE;
+ *value = false;
// Handle as Integer
else
*value = (int) strtol (s, NULL, 10);
return true;
}
else
- return FALSE;
+ return false;
}
void wxXMergeDatabases (wxApp * theApp, Display * display)
{
#if (XlibSpecificationRelease>=5)
XrmDatabase db = XtDatabase (dpy);
- XrmCombineDatabase (rdb, &db, FALSE);
+ XrmCombineDatabase (rdb, &db, False);
#else
XrmMergeDatabases (dpy->db, &rdb);
dpy->db = rdb;
return true;
}
else
- return FALSE;
+ return false;
}
}
#else
int type = event.xany.type;
static char* event_name[] = {
- "", "unknown(-)", // 0-1
- "KeyPress", "KeyRelease", "ButtonPress", "ButtonRelease", // 2-5
- "MotionNotify", "EnterNotify", "LeaveNotify", "FocusIn", // 6-9
- "FocusOut", "KeymapNotify", "Expose", "GraphicsExpose", // 10-13
- "NoExpose", "VisibilityNotify", "CreateNotify", // 14-16
- "DestroyNotify", "UnmapNotify", "MapNotify", "MapRequest",// 17-20
- "ReparentNotify", "ConfigureNotify", "ConfigureRequest", // 21-23
- "GravityNotify", "ResizeRequest", "CirculateNotify", // 24-26
- "CirculateRequest", "PropertyNotify", "SelectionClear", // 27-29
- "SelectionRequest", "SelectionNotify", "ColormapNotify", // 30-32
- "ClientMessage", "MappingNotify", // 33-34
- "unknown(+)"}; // 35
+ wxMOTIF_STR(""), wxMOTIF_STR("unknown(-)"), // 0-1
+ wxMOTIF_STR("KeyPress"), wxMOTIF_STR("KeyRelease"), wxMOTIF_STR("ButtonPress"), wxMOTIF_STR("ButtonRelease"), // 2-5
+ wxMOTIF_STR("MotionNotify"), wxMOTIF_STR("EnterNotify"), wxMOTIF_STR("LeaveNotify"), wxMOTIF_STR("FocusIn"), // 6-9
+ wxMOTIF_STR("FocusOut"), wxMOTIF_STR("KeymapNotify"), wxMOTIF_STR("Expose"), wxMOTIF_STR("GraphicsExpose"), // 10-13
+ wxMOTIF_STR("NoExpose"), wxMOTIF_STR("VisibilityNotify"), wxMOTIF_STR("CreateNotify"), // 14-16
+ wxMOTIF_STR("DestroyNotify"), wxMOTIF_STR("UnmapNotify"), wxMOTIF_STR("MapNotify"), wxMOTIF_STR("MapRequest"),// 17-20
+ wxMOTIF_STR("ReparentNotify"), wxMOTIF_STR("ConfigureNotify"), wxMOTIF_STR("ConfigureRequest"), // 21-23
+ wxMOTIF_STR("GravityNotify"), wxMOTIF_STR("ResizeRequest"), wxMOTIF_STR("CirculateNotify"), // 24-26
+ wxMOTIF_STR("CirculateRequest"), wxMOTIF_STR("PropertyNotify"), wxMOTIF_STR("SelectionClear"), // 27-29
+ wxMOTIF_STR("SelectionRequest"), wxMOTIF_STR("SelectionNotify"), wxMOTIF_STR("ColormapNotify"), // 30-32
+ wxMOTIF_STR("ClientMessage"), wxMOTIF_STR("MappingNotify"), // 33-34
+ wxMOTIF_STR("unknown(+)")}; // 35
type = wxMin(35, type); type = wxMax(1, type);
wxString str(event_name[type]);
return str;
extern void wxDoChangeFont(WXWidget widget, wxFont& font)
{
- // Lesstif 0.87 hangs here, but 0.93 does not
-#if !wxCHECK_LESSTIF() || wxCHECK_LESSTIF_VERSION( 0, 93 )
+ // Lesstif 0.87 hangs here, but 0.93 does not; MBN: sometimes it does
+#if !wxCHECK_LESSTIF() // || wxCHECK_LESSTIF_VERSION( 0, 93 )
Widget w = (Widget)widget;
XtVaSetValues( w,
- wxFont::GetFontTag(), font.GetFontType( XtDisplay(w) ),
+ wxFont::GetFontTag(), font.GetFontTypeC( XtDisplay(w) ),
NULL );
#endif