X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/dd12575372f29ff5f44cffca2540fcc6ca3c799e..286694ba265d1bf68290cac192bbe54259c313d9:/src/motif/utils.cpp diff --git a/src/motif/utils.cpp b/src/motif/utils.cpp index 6f80f461de..d06990d497 100644 --- a/src/motif/utils.cpp +++ b/src/motif/utils.cpp @@ -89,7 +89,7 @@ void wxFlushEvents(WXDisplay* wxdisplay) Display *display = (Display*)wxdisplay; wxEventLoop evtLoop; - XSync (display, FALSE); + XSync (display, False); while (evtLoop.Pending()) { @@ -197,7 +197,7 @@ static char * GetIniFile (char *dest, const char *filename) 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); @@ -240,7 +240,7 @@ wxFlushResources (void) { 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); @@ -277,7 +277,7 @@ bool wxWriteResource(const wxString& section, const wxString& entry, const wxStr strcat (resName, entry.c_str()); XrmPutStringResource (&database, resName, value); - return TRUE; + return true; } bool wxWriteResource(const wxString& section, const wxString& entry, float value, const wxString& file) @@ -354,9 +354,9 @@ bool wxGetResource(const wxString& section, const wxString& entry, char **value, *value = new char[xvalue.size + 1]; strncpy (*value, xvalue.addr, (int) xvalue.size); - return TRUE; + return true; } - return FALSE; + return false; } bool wxGetResource(const wxString& section, const wxString& entry, float *value, const wxString& file) @@ -367,9 +367,9 @@ bool wxGetResource(const wxString& section, const wxString& entry, float *value, { *value = (float)strtod(s, NULL); delete[] s; - return TRUE; + return true; } - else return FALSE; + else return false; } bool wxGetResource(const wxString& section, const wxString& entry, long *value, const wxString& file) @@ -380,9 +380,9 @@ bool wxGetResource(const wxString& section, const wxString& entry, long *value, { *value = strtol(s, NULL, 10); delete[] s; - return TRUE; + return true; } - else return FALSE; + else return false; } bool wxGetResource(const wxString& section, const wxString& entry, int *value, const wxString& file) @@ -394,18 +394,18 @@ bool wxGetResource(const wxString& section, const wxString& entry, int *value, c // 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); delete[] s; - return TRUE; + return true; } else - return FALSE; + return false; } void wxXMergeDatabases (wxApp * theApp, Display * display) @@ -492,7 +492,7 @@ wxSetDefaultResources (const Widget w, const char **resourceSpec, const char *na { #if (XlibSpecificationRelease>=5) XrmDatabase db = XtDatabase (dpy); - XrmCombineDatabase (rdb, &db, FALSE); + XrmCombineDatabase (rdb, &db, False); #else XrmMergeDatabases (dpy->db, &rdb); dpy->db = rdb; @@ -528,7 +528,7 @@ void wxGetMousePosition( int* x, int* y ) #endif }; -// Return TRUE if we have a colour display +// Return true if we have a colour display bool wxColourDisplay() { return wxDisplayDepth() > 1; @@ -592,11 +592,11 @@ bool wxSetDisplay(const wxString& display_name) { gs_displayName = display_name; - if ( display_name.IsEmpty() ) + if ( display_name.empty() ) { gs_currentDisplay = NULL; - return TRUE; + return true; } else { @@ -617,10 +617,10 @@ bool wxSetDisplay(const wxString& display_name) if (display) { gs_currentDisplay = (WXDisplay*) display; - return TRUE; + return true; } else - return FALSE; + return false; } } @@ -757,22 +757,22 @@ wxString wxGetXEventName(XEvent& event) return str; #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 - type = wxMin(35, type); type = wxMax(1, type); - wxString str(event_name[type]); - return str; + 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 + type = wxMin(35, type); type = wxMax(1, type); + wxString str(event_name[type]); + return str; #endif } #endif @@ -976,11 +976,10 @@ wxBitmap wxCreateMaskedBitmap(const wxBitmap& bitmap, wxColour& colour) destDC.SelectObject(newBitmap); wxBrush brush(colour, wxSOLID); - // destDC.SetOptimization(FALSE); destDC.SetBackground(brush); destDC.Clear(); destDC.Blit(0, 0, bitmap.GetWidth(), bitmap.GetHeight(), - &srcDC, 0, 0, wxCOPY, TRUE); + &srcDC, 0, 0, wxCOPY, true); return newBitmap; }