#! /bin/sh
-# From configure.in Id: configure.in 47617 2007-07-21 13:01:28Z VZ .
+# From configure.in Id: configure.in 47621 2007-07-21 13:09:57Z VZ .
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.61 for wxWidgets 2.9.0.
#
fi
if test "$wxUSE_MOTIF" = 1; then
- if test "$wxUSE_UNICODE" = "yes"; then
- { { echo "$as_me:$LINENO: error: Unicode configuration not supported with Motif" >&5
-echo "$as_me: error: Unicode configuration not supported with Motif" >&2;}
- { (exit 1); exit 1; }; }
- fi
-
{ echo "$as_me:$LINENO: checking for Motif/Lesstif headers" >&5
echo $ECHO_N "checking for Motif/Lesstif headers... $ECHO_C" >&6; }
fi
if test "$wxUSE_MOTIF" = 1; then
- if test "$wxUSE_UNICODE" = "yes"; then
- AC_MSG_ERROR([Unicode configuration not supported with Motif])
- fi
-
AC_MSG_CHECKING(for Motif/Lesstif headers)
WX_PATH_FIND_INCLUDES($SEARCH_INCLUDE, Xm/Xm.h)
if test "$ac_find_includes" != "" ; then
/* THIS IS A C FILE, DON'T USE C++ FEATURES (IN PARTICULAR COMMENTS) IN IT */
-#if wxUSE_UNICODE
-# ifdef wxABORT_ON_CONFIG_ERROR
-# error "wxUSE_UNICODE is not supported with wxMotif"
-# else
-# define wxUSE_UNICODE 0
-# endif
-#endif
-
#if wxUSE_NOTEBOOK && !wxUSE_TAB_DIALOG
# undef wxUSE_TAB_DIALOG
# define wxUSE_TAB_DIALOG 1
// ----------------------------------------------------------------------------
wxString wxXmStringToString( const XmString& xmString );
-XmString wxStringToXmString( const wxString& string );
XmString wxStringToXmString( const char* string );
+inline XmString wxStringToXmString( const wxCharBuffer& string )
+ { return wxStringToXmString(string.data()); }
+inline XmString wxStringToXmString( const wxString& string )
+ { return wxStringToXmString((const char*)string.mb_str()); }
// XmString made easy to use in wxWidgets (and has an added benefit of
// cleaning up automatically)
Init(str);
}
+ wxXmString(const wchar_t* str)
+ {
+ Init(wxConvLibc.cWC2MB(str));
+ }
+
wxXmString(const wxString& str)
{
Init(str.mb_str());
// Include common declarations
#include "wx/x11/privx.h"
-#if wxUSE_UNICODE
-#include "pango/pango.h"
+#if wxUSE_PANGO
+#include <pango/pango.h>
#endif
class WXDLLIMPEXP_FWD_CORE wxMouseEvent;
class WXDLLEXPORT wxAcceleratorRefData: public wxObjectRefData
{
- friend class WXDLLEXPORT wxAcceleratorTable;
+ friend class wxAcceleratorTable;
public:
wxAcceleratorRefData();
virtual ~wxAcceleratorRefData();
if ( clsname.empty() )
clsname = _T("wx");
+ // FIXME-UTF8: This code is taken from wxGTK and duplicated here. This
+ // is just a temporary fix to make wxX11 compile in Unicode
+ // build, the real fix is to change Initialize()'s signature
+ // to use char* on Unix.
+#if wxUSE_UNICODE
+ // XtOpenDisplay() wants char*, not wchar_t*, so convert
+ int i;
+ char **argvX11 = new char *[argc + 1];
+ for ( i = 0; i < argc; i++ )
+ {
+ argvX11[i] = strdup(wxConvLibc.cWX2MB(argv[i]));
+ }
+
+ argvX11[argc] = NULL;
+
+ int argcX11 = argc;
+
+ Display *dpy = XtOpenDisplay((XtAppContext) wxTheApp->m_appContext,
+ (String)NULL,
+ appname.c_str(),
+ clsname.c_str(),
+ NULL, 0, // no options
+# if XtSpecificationRelease < 5
+ (Cardinal*) &argcX11,
+# else
+ &argcX11,
+# endif
+ argvX11);
+
+ if ( argcX11 != argc )
+ {
+ // we have to drop the parameters which were consumed by X11+
+ for ( i = 0; i < argcX11; i++ )
+ {
+ while ( strcmp(wxConvLibc.cWX2MB(argv[i]), argvX11[i]) != 0 )
+ {
+ memmove(argv + i, argv + i + 1, (argc - i)*sizeof(*argv));
+ }
+ }
+
+ argc = argcX11;
+ }
+ //else: XtOpenDisplay() didn't modify our parameters
+
+ // free our copy
+ for ( i = 0; i < argcX11; i++ )
+ {
+ free(argvX11[i]);
+ }
+
+ delete [] argvX11;
+
+#else // ANSI
+
Display *dpy = XtOpenDisplay((XtAppContext) wxTheApp->m_appContext,
(String)NULL,
appname.c_str(),
# endif
argv);
+#endif // Unicode/ANSI
+
if (!dpy) {
// if you don't log to stderr, nothing will be shown...
delete wxLog::SetActiveTarget(new wxLogStderr);
wxString id = dfarr[i].GetId();
while( ( retval = XmClipboardCopy( xdisplay, xwindow, itemId,
- wxConstCast(id.mb_str(), char),
+ id.char_str(),
NULL, size, i, &data_id ) )
== XmClipboardLocked );
wxString id = chosenFormat.GetId();
while( ( retval = XmClipboardInquireLength( xdisplay, xwindow,
- wxConstCast(id.mb_str(), char),
+ id.char_str(),
&length ) )
== XmClipboardLocked );
if( retval != XmClipboardSuccess )
wxCharBuffer buf(length);
while( ( retval = XmClipboardRetrieve( xdisplay, xwindow,
- wxConstCast(id.mb_str(), char),
+ id.char_str(),
(XtPointer)buf.data(),
length, &dummy1, &dummy2 ) )
== XmClipboardLocked );
m_inSetValue = true;
XtVaSetValues( GetXmText(this),
- XmNvalue, value.mb_str(),
+ XmNvalue, (const char*)value.mb_str(),
NULL);
m_inSetValue = false;
void wxComboBox::Replace(long from, long to, const wxString& value)
{
XmTextReplace( GetXmText(this), (XmTextPosition)from, (XmTextPosition)to,
- wxConstCast(value.mb_str(), char) );
+ value.char_str() );
}
void wxComboBox::Remove(long from, long to)
class WXDLLEXPORT wxCursorRefData: public wxObjectRefData
{
- friend class WXDLLEXPORT wxCursor;
+ friend class wxCursor;
public:
wxCursorRefData();
virtual ~wxCursorRefData();
int screen_num = DefaultScreen (dpy);
int value = XReadBitmapFile (dpy, RootWindow (dpy, screen_num),
- wxConstCast(name.mb_str(), char),
+ name.mb_str(),
&w, &h, &pixmap, &hotX, &hotY);
if (value == BitmapSuccess)
#if wxMOTIF_NEW_FONT_HANDLING
XmbDrawString((Display*) m_display, (Pixmap) m_window->GetBackingPixmap(), fset, (GC) m_gcBacking,
XLOG2DEV_2 (x), YLOG2DEV_2 (y) + ascent,
- wxConstCast(text.mb_str(), char), slen);
+ text.mb_str(), slen);
#else
XDrawString((Display*) m_display, (Pixmap) m_window->GetBackingPixmap(), (GC) m_gcBacking,
XLOG2DEV_2 (x), YLOG2DEV_2 (y) + ascent,
- wxConstCast(text.mb_str(), char), slen);
+ text.mb_str(), slen);
#endif
}
XtSetArg (args[1], XmNautoUnmanage, False);
Widget dialogShell =
XmCreateBulletinBoardDialog( parentWidget,
- wxConstCast(name.mb_str(), char),
+ name.char_str(),
args, 2);
m_mainWidget = (WXWidget) dialogShell;
{
wxXmString str( title );
XtVaSetValues( (Widget)m_mainWidget,
- XmNtitle, title.mb_str(),
+ XmNtitle, (const char*)title.mb_str(),
XmNdialogTitle, str(),
- XmNiconName, title.mb_str(),
+ XmNiconName, (const char*)title.mb_str(),
NULL );
}
}
if (!m_message.IsNull())
XtVaSetValues(shell,
- XmNtitle, wxConstCast(m_message.mb_str(), char),
+ XmNtitle, (const char*)m_message.mb_str(),
NULL);
if (!m_wildCard.empty())
else
filter = wildCard;
- XmTextSetString(filterWidget, wxConstCast(filter.mb_str(), char));
+ XmTextSetString(filterWidget, filter.char_str());
XmFileSelectionDoSearch(fileSel, NULL);
}
if (!entirePath.empty())
{
- XmTextSetString(selectionWidget,
- wxConstCast(entirePath.mb_str(), char));
+ XmTextSetString(selectionWidget, entirePath.char_str());
}
XtAddCallback(fileSel, XmNcancelCallback,
int count = 0;
#if wxMOTIF_NEW_FONT_HANDLING
- wxChar* fontSpec = wxStrdup( xFontSpec.mb_str() );
+ char* fontSpec = wxStrdup(xFontSpec.mb_str());
XtSetArg( args[count], XmNfontName, fontSpec ); ++count;
XtSetArg( args[count], XmNfontType, XmFONT_IS_FONTSET ); ++count;
#else
if( !title.empty() )
XtVaSetValues( (Widget)m_frameShell,
- XmNtitle, title.mb_str(),
- XmNiconName, title.mb_str(),
+ XmNtitle, (const char*)title.mb_str(),
+ XmNiconName, (const char*)title.mb_str(),
NULL );
}
Widget listWidget =
XmCreateScrolledList(parentWidget,
- wxConstCast(name.mb_str(), char), args, count);
+ name.char_str(), args, count);
m_mainWidget = (WXWidget) listWidget;
wxString str(GetLabelText(choices[i]));
m_radioButtonLabels.push_back(str);
Widget radioItem = XtVaCreateManagedWidget (
- wxConstCast(str.mb_str(), char),
+ str.mb_str(),
#if wxUSE_GADGETS
xmToggleButtonGadgetClass, radioBoxWidget,
#else
(Widget) wxCreateBorderWidget( (WXWidget)parentWidget, style );
m_labelWidget =
- XtVaCreateManagedWidget (wxConstCast(name.mb_str(), char),
+ XtVaCreateManagedWidget (name.mb_str(),
xmLabelWidgetClass,
borderWidget ? borderWidget : parentWidget,
wxFont::GetFontTag(), m_font.GetFontTypeC(XtDisplay(parentWidget)),
XtSetArg (args[count], (String) wxFont::GetFontTag(),
m_font.GetFontType( XtDisplay(parentWidget) ) ); ++count;
XtSetArg (args[count], XmNwordWrap, wantWordWrap); ++count;
- XtSetArg (args[count], XmNvalue, value.mb_str()); ++count;
+ XtSetArg (args[count], XmNvalue, (const char*)value.mb_str()); ++count;
XtSetArg (args[count], XmNeditable,
style & wxTE_READONLY ? False : True); ++count;
XtSetArg (args[count], XmNeditMode, XmMULTI_LINE_EDIT ); ++count;
m_mainWidget =
(WXWidget) XmCreateScrolledText(parentWidget,
- wxConstCast(name.mb_str(), char),
+ name.char_str(),
args, count);
XtManageChild ((Widget) m_mainWidget);
{
m_mainWidget = (WXWidget)XtVaCreateManagedWidget
(
- wxConstCast(name.mb_str(), char),
+ name.mb_str(),
xmTextWidgetClass,
parentWidget,
wxFont::GetFontTag(), m_font.GetFontType( XtDisplay(parentWidget) ),
- XmNvalue, value.mb_str(),
+ XmNvalue, (const char*)value.mb_str(),
XmNeditable, (style & wxTE_READONLY) ?
False : True,
NULL
{
m_inSetValue = true;
- XmTextSetString ((Widget) m_mainWidget, wxConstCast(text.mb_str(), char));
+ XmTextSetString ((Widget) m_mainWidget, text.char_str());
XtVaSetValues ((Widget) m_mainWidget,
XmNcursorPosition, text.length(),
NULL);
void wxTextCtrl::Replace(long from, long to, const wxString& value)
{
XmTextReplace ((Widget) m_mainWidget, (XmTextPosition) from, (XmTextPosition) to,
- wxConstCast(value.mb_str(), char));
+ value.char_str());
}
void wxTextCtrl::Remove(long from, long to)
{
long textPosition = GetInsertionPoint() + text.length();
XmTextInsert ((Widget) m_mainWidget, GetInsertionPoint(),
- wxConstCast(text.mb_str(), char));
+ text.char_str());
XtVaSetValues ((Widget) m_mainWidget, XmNcursorPosition, textPosition, NULL);
SetInsertionPoint(textPosition);
XmTextShowPosition ((Widget) m_mainWidget, textPosition);
{
wxTextPos textPosition = GetLastPosition() + text.length();
XmTextInsert ((Widget) m_mainWidget, GetLastPosition(),
- wxConstCast(text.mb_str(), char));
+ text.char_str());
XtVaSetValues ((Widget) m_mainWidget, XmNcursorPosition, textPosition, NULL);
SetInsertionPoint(textPosition);
XmTextShowPosition ((Widget) m_mainWidget, textPosition);
return wxEmptyString;
}
-XmString wxStringToXmString( const wxString& str )
-{
- return wxStringToXmString(str.mb_str());
-}
-
XmString wxStringToXmString( const char* str )
{
return XmStringCreateLtoR((char *)str, XmSTRING_DEFAULT_CHARSET);
void wxWindow::SetLabel(const wxString& label)
{
- XtVaSetValues((Widget)GetMainWidget(), XmNtitle, label.mb_str(), NULL);
+ XtVaSetValues((Widget)GetMainWidget(), XmNtitle,
+ (const char*)label.mb_str(), NULL);
}
wxString wxWindow::GetLabel() const