From: Václav Slavík Date: Wed, 20 Aug 2003 08:39:47 +0000 (+0000) Subject: Unicode compilation fixes for wxX11 X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/54385bdb3f485f25656511b5a6b1b8ced03e0688 Unicode compilation fixes for wxX11 git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@23038 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/include/wx/x11/glcanvas.h b/include/wx/x11/glcanvas.h index 1e5d5fe1de..e6aa775e09 100644 --- a/include/wx/x11/glcanvas.h +++ b/include/wx/x11/glcanvas.h @@ -64,7 +64,7 @@ public: ~wxGLContext(); void SetCurrent(); - void SetColour(const char *colour); + void SetColour(const wxChar *colour); void SwapBuffers(); void SetupPixelFormat(); @@ -131,7 +131,7 @@ public: ~wxGLCanvas(); void SetCurrent(); - void SetColour(const char *colour); + void SetColour(const wxChar *colour); void SwapBuffers(); // void OnSize(wxSizeEvent& event); diff --git a/src/x11/app.cpp b/src/x11/app.cpp index 086654892a..7602f5821f 100644 --- a/src/x11/app.cpp +++ b/src/x11/app.cpp @@ -789,7 +789,7 @@ WXColormap wxApp::GetMainColormap(WXDisplay* display) Window wxGetWindowParent(Window window) { - wxASSERT_MSG( window, "invalid window" ); + wxASSERT_MSG( window, _T("invalid window") ); return (Window) 0; diff --git a/src/x11/bitmap.cpp b/src/x11/bitmap.cpp index 12a782db43..10f3bc41e9 100644 --- a/src/x11/bitmap.cpp +++ b/src/x11/bitmap.cpp @@ -366,7 +366,7 @@ bool wxBitmap::Create(void *data, wxBitmapType type, wxBitmapHandler *handler = FindHandler(type); if ( handler == NULL ) { - wxLogWarning("no data bitmap handler for type %ld defined.", + wxLogWarning(wxT("no data bitmap handler for type %ld defined."), (long)type); return FALSE; @@ -417,7 +417,7 @@ bool wxBitmap::Create(WXPixmap pixmap) bool wxBitmap::CreateFromXpm( const char **bits ) { - wxCHECK_MSG( bits, FALSE, _T("NULL pointer in wxBitmap::CreateFromXpm") ); + wxCHECK_MSG( bits, FALSE, wxT("NULL pointer in wxBitmap::CreateFromXpm") ); return Create(bits, wxBITMAP_TYPE_XPM_DATA, 0, 0, 0); } @@ -427,7 +427,7 @@ bool wxBitmap::CreateFromImage( const wxImage& image, int depth ) #if wxUSE_NANOX if (!image.Ok()) { - wxASSERT_MSG(image.Ok(), "Invalid wxImage passed to wxBitmap::CreateFromImage."); + wxASSERT_MSG(image.Ok(), wxT("Invalid wxImage passed to wxBitmap::CreateFromImage.")); return FALSE; } @@ -558,7 +558,7 @@ bool wxBitmap::CreateFromImage( const wxImage& image, int depth ) if (depth == 1) { - wxFAIL_MSG( "mono images later" ); + wxFAIL_MSG( wxT("mono images later") ); } else { @@ -623,7 +623,7 @@ bool wxBitmap::CreateFromImage( const wxImage& image, int depth ) int b_mask = image.GetMaskBlue(); unsigned char* data = image.GetData(); - wxASSERT_MSG( data, "No image data" ); + wxASSERT_MSG( data, wxT("No image data") ); unsigned char *colorCube = wxTheApp->GetVisualInfo(M_BMPDATA->m_display)->m_colorCube; @@ -1320,8 +1320,8 @@ class wxXPMFileHandler : public wxBitmapHandler public: wxXPMFileHandler() { - m_name = "XPM file"; - m_extension = "xpm"; + m_name = wxT("XPM file"); + m_extension = wxT("xpm"); m_type = wxBITMAP_TYPE_XPM; }; @@ -1428,8 +1428,8 @@ class wxXPMDataHandler : public wxBitmapHandler public: wxXPMDataHandler() { - m_name = "XPM data"; - m_extension = "xpm"; + m_name = wxT("XPM data"); + m_extension = wxT("xpm"); m_type = wxBITMAP_TYPE_XPM_DATA; }; @@ -1529,8 +1529,8 @@ class WXDLLEXPORT wxXBMDataHandler: public wxBitmapHandler public: inline wxXBMDataHandler() { - m_name = "XBM data"; - m_extension = "xbm"; + m_name = wxT("XBM data"); + m_extension = wxT("xbm"); m_type = wxBITMAP_TYPE_XBM_DATA; }; diff --git a/src/x11/cursor.cpp b/src/x11/cursor.cpp index 014064ea69..fe53a0a5e9 100644 --- a/src/x11/cursor.cpp +++ b/src/x11/cursor.cpp @@ -125,7 +125,7 @@ wxCursor::wxCursor(const char bits[], int width, int height, int hotSpotX, int hotSpotY, const char maskBits[], wxColour *fg, wxColour *bg) { - wxFAIL_MSG( "wxCursor creation from bits not yet implemented" ); + wxFAIL_MSG( wxT("wxCursor creation from bits not yet implemented") ); } @@ -137,7 +137,7 @@ wxCursor::wxCursor( const wxCursor &cursor ) #if wxUSE_IMAGE wxCursor::wxCursor( const wxImage & image ) { - wxFAIL_MSG( "wxCursor creation from wxImage not yet implemented" ); + wxFAIL_MSG( wxT("wxCursor creation from wxImage not yet implemented") ); } #endif diff --git a/src/x11/dcclient.cpp b/src/x11/dcclient.cpp index edc41476d1..29fd42b652 100644 --- a/src/x11/dcclient.cpp +++ b/src/x11/dcclient.cpp @@ -1478,7 +1478,7 @@ void wxWindowDC::DoGetTextExtent( const wxString &string, wxCoord *width, wxCoor wxCoord *descent, wxCoord *externalLeading, wxFont *font ) const { - wxCHECK_RET( Ok(), "invalid dc" ); + wxCHECK_RET( Ok(), wxT("invalid dc") ); if (string.IsEmpty()) { @@ -1516,7 +1516,7 @@ void wxWindowDC::DoGetTextExtent( const wxString &string, wxCoord *width, wxCoor wxFont fontToUse = m_font; if (font) fontToUse = *font; - wxCHECK_RET( fontToUse.Ok(), "invalid font" ); + wxCHECK_RET( fontToUse.Ok(), wxT("invalid font") ); XFontStruct *xfont = (XFontStruct*) fontToUse.GetFontStruct( m_scaleY, m_display ); @@ -1541,7 +1541,7 @@ void wxWindowDC::DoGetTextExtent( const wxString &string, wxCoord *width, wxCoor wxCoord wxWindowDC::GetCharWidth() const { - wxCHECK_MSG( Ok(), 0, "invalid dc" ); + wxCHECK_MSG( Ok(), 0, wxT("invalid dc") ); #if wxUSE_UNICODE PangoLayout *layout = pango_layout_new( m_context ); @@ -1560,7 +1560,7 @@ wxCoord wxWindowDC::GetCharWidth() const return w; #else - wxCHECK_MSG( m_font.Ok(), 0, "invalid font" ); + wxCHECK_MSG( m_font.Ok(), 0, wxT("invalid font") ); XFontStruct *xfont = (XFontStruct*) m_font.GetFontStruct( m_scaleY, m_display ); @@ -1577,7 +1577,7 @@ wxCoord wxWindowDC::GetCharWidth() const wxCoord wxWindowDC::GetCharHeight() const { - wxCHECK_MSG( Ok(), 0, "invalid dc" ); + wxCHECK_MSG( Ok(), 0, wxT("invalid dc") ); #if wxUSE_UNICODE PangoLayout *layout = pango_layout_new( m_context ); @@ -1597,7 +1597,7 @@ wxCoord wxWindowDC::GetCharHeight() const return h; #else - wxCHECK_MSG( m_font.Ok(), 0, "invalid font" ); + wxCHECK_MSG( m_font.Ok(), 0, wxT("invalid font") ); XFontStruct *xfont = (XFontStruct*) m_font.GetFontStruct( m_scaleY, m_display ); @@ -1644,7 +1644,7 @@ void wxWindowDC::Clear() void wxWindowDC::SetFont( const wxFont &font ) { - wxCHECK_RET( Ok(), "invalid dc" ); + wxCHECK_RET( Ok(), wxT("invalid dc") ); m_font = font; } @@ -1868,7 +1868,7 @@ void wxWindowDC::SetBackground( const wxBrush &brush ) void wxWindowDC::SetLogicalFunction( int function ) { - wxCHECK_RET( Ok(), "invalid dc" ); + wxCHECK_RET( Ok(), wxT("invalid dc") ); int x_function; diff --git a/src/x11/glcanvas.cpp b/src/x11/glcanvas.cpp index 9fc512eb43..5b619202a0 100644 --- a/src/x11/glcanvas.cpp +++ b/src/x11/glcanvas.cpp @@ -73,12 +73,12 @@ wxGLContext::wxGLContext( bool WXUNUSED(isRGB), wxWindow *win, wxGLCanvas *gc = (wxGLCanvas*) win; XVisualInfo *vi = (XVisualInfo *) gc->m_vi; - wxCHECK_RET( vi, "invalid visual for OpenGl" ); + wxCHECK_RET( vi, wxT("invalid visual for OpenGL") ); m_glContext = glXCreateContext( (Display *)wxGetDisplay(), vi, None, GL_TRUE); - wxCHECK_RET( m_glContext, "Couldn't create OpenGl context" ); + wxCHECK_RET( m_glContext, wxT("Couldn't create OpenGL context") ); } wxGLContext::wxGLContext( @@ -93,7 +93,7 @@ wxGLContext::wxGLContext( wxGLCanvas *gc = (wxGLCanvas*) win; XVisualInfo *vi = (XVisualInfo *) gc->m_vi; - wxCHECK_RET( vi, "invalid visual for OpenGl" ); + wxCHECK_RET( vi, wxT("invalid visual for OpenGL") ); if( other != 0 ) m_glContext = glXCreateContext( (Display *)wxGetDisplay(), vi, @@ -102,7 +102,7 @@ wxGLContext::wxGLContext( m_glContext = glXCreateContext( (Display *)wxGetDisplay(), vi, None, GL_TRUE ); - wxCHECK_RET( m_glContext, "Couldn't create OpenGl context" ); + wxCHECK_RET( m_glContext, wxT("Couldn't create OpenGL context") ); } wxGLContext::~wxGLContext() @@ -136,7 +136,7 @@ void wxGLContext::SetCurrent() } } -void wxGLContext::SetColour(const char *colour) +void wxGLContext::SetColour(const wxChar *colour) { wxColour *the_colour = wxTheColourDatabase->FindColour(colour); if(the_colour) { @@ -155,7 +155,7 @@ void wxGLContext::SetColour(const char *colour) GLint pix = (GLint)the_colour->GetPixel(); if(pix == -1) { - wxLogError("wxGLCanvas: cannot allocate color\n"); + wxLogError(wxT("wxGLCanvas: cannot allocate color\n")); return; } glIndexi(pix); @@ -255,7 +255,7 @@ bool wxGLCanvas::Create( wxWindow *parent, // Check for the presence of the GLX extension if(!glXQueryExtension(display, NULL, NULL)) { - wxLogDebug("wxGLCanvas: GLX extension is missing\n"); + wxLogDebug(wxT("wxGLCanvas: GLX extension is missing\n")); return FALSE; } @@ -350,7 +350,7 @@ bool wxGLCanvas::Create( wxWindow *parent, m_vi = vi; // safe for later use - wxCHECK_MSG( m_vi, FALSE, "required visual couldn't be found" ); + wxCHECK_MSG( m_vi, FALSE, wxT("required visual couldn't be found") ); // Create the GLX context and make it current @@ -395,7 +395,7 @@ void wxGLCanvas::SetCurrent() // if(glx_cx) glXMakeCurrent(display, (Window) GetClientAreaWindow(), glx_cx); } -void wxGLCanvas::SetColour(const char *col) +void wxGLCanvas::SetColour(const wxChar *col) { if( m_glContext ) m_glContext->SetColour(col); } diff --git a/src/x11/utils.cpp b/src/x11/utils.cpp index 22d3476ac8..8221b95431 100644 --- a/src/x11/utils.cpp +++ b/src/x11/utils.cpp @@ -73,7 +73,7 @@ void wxFlushEvents() bool wxCheckForInterrupt(wxWindow *wnd) { - wxASSERT_MSG(FALSE, "wxCheckForInterrupt not yet implemented."); + wxASSERT_MSG(FALSE, wxT("wxCheckForInterrupt not yet implemented.")); return FALSE; } @@ -605,8 +605,7 @@ wxString wxGetXEventName(XEvent& event) "ClientMessage", "MappingNotify", // 33-34 "unknown(+)"}; // 35 type = wxMin(35, type); type = wxMax(1, type); - wxString str(event_name[type]); - return str; + return wxString::FromAscii(event_name[type]); #endif } #endif diff --git a/src/x11/window.cpp b/src/x11/window.cpp index 5fc23f7e6b..8f9b0c337f 100644 --- a/src/x11/window.cpp +++ b/src/x11/window.cpp @@ -123,7 +123,7 @@ bool wxWindowX11::Create(wxWindow *parent, wxWindowID id, long style, const wxString& name) { - wxCHECK_MSG( parent, FALSE, "can't create wxWindow without parent" ); + wxCHECK_MSG( parent, FALSE, wxT("can't create wxWindow without parent") ); CreateBase(parent, id, pos, size, style, wxDefaultValidator, name); @@ -471,7 +471,7 @@ void wxWindowX11::DoCaptureMouse() { if ((g_captureWindow != NULL) && (g_captureWindow != this)) { - wxASSERT_MSG(FALSE, "Trying to capture before mouse released."); + wxASSERT_MSG(FALSE, wxT("Trying to capture before mouse released.")); // Core dump now int *tmp = NULL; @@ -989,7 +989,7 @@ void wxWindowX11::SetSizeHints(int minW, int minH, int maxW, int maxH, int incW, int wxWindowX11::GetCharHeight() const { - wxCHECK_MSG( m_font.Ok(), 0, "valid window font needed" ); + wxCHECK_MSG( m_font.Ok(), 0, wxT("valid window font needed") ); #if wxUSE_UNICODE // There should be an easier way. @@ -1016,7 +1016,7 @@ int wxWindowX11::GetCharHeight() const int wxWindowX11::GetCharWidth() const { - wxCHECK_MSG( m_font.Ok(), 0, "valid window font needed" ); + wxCHECK_MSG( m_font.Ok(), 0, wxT("valid window font needed") ); #if wxUSE_UNICODE // There should be an easier way. @@ -1586,7 +1586,7 @@ bool wxWindowX11::SetForegroundColour(const wxColour& col) wxWindow *wxGetActiveWindow() { // TODO - wxFAIL_MSG("Not implemented"); + wxFAIL_MSG(wxT("Not implemented")); return NULL; }