Unicode compilation fixes for wxX11
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@23038 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -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);
|
||||
|
@@ -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;
|
||||
|
||||
|
@@ -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;
|
||||
};
|
||||
|
||||
|
@@ -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
|
||||
|
||||
|
@@ -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;
|
||||
|
||||
|
@@ -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);
|
||||
}
|
||||
|
@@ -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
|
||||
|
@@ -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;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user