wxMotif for OS/2 adjustements. Source cleaning.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@35808 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Włodzimierz Skiba 2005-10-06 12:10:44 +00:00
parent 7fc65a0384
commit 355b4d3de5
23 changed files with 1516 additions and 294 deletions

1166
include/wx/motif/setup0.h Normal file

File diff suppressed because it is too large Load Diff

View File

@ -26,13 +26,25 @@
#include <os2def.h>
#define I_NEED_OS2_H
#include <X11/Xmd.h>
#ifdef __cplusplus
extern "C" {
// include this header from here for many of the GUI related code
#if wxUSE_GUI
extern "C" {
#include <Xm/VendorSP.h>
}
#endif
#include <Xm/VendorSP.h>
#ifdef __cplusplus
// provide Unix-like pipe()
#include <types.h>
#include <tcpustd.h>
#include <sys/time.h>
// Use ::DosCreatePipe or ::DosCreateNPipe under OS/2
// for more see http://posix2.sourceforge.net/guide.html
inline int pipe( int WXUNUSED(filedes)[2] )
{
wxFAIL_MSG(wxT("Implement first"));
return -1;
}
#endif
#endif
#if defined (__EMX__) && !defined(USE_OS2_TOOLKIT_HEADERS) && !defined(HAVE_SPBCDATA)

View File

@ -443,8 +443,8 @@ void wxWindowDC::DoDrawLines( int n, wxPoint points[], wxCoord xoffset, wxCoord
for (i = 0; i < n; i++)
{
xpoints[i].x = XLOG2DEV (points[i].x + xoffset);
xpoints[i].y = YLOG2DEV (points[i].y + yoffset);
xpoints[i].x = (short)XLOG2DEV (points[i].x + xoffset);
xpoints[i].y = (short)YLOG2DEV (points[i].y + yoffset);
}
XDrawLines ((Display*) m_display, (Pixmap) m_pixmap, (GC) m_gc, xpoints, n, 0);
@ -452,8 +452,8 @@ void wxWindowDC::DoDrawLines( int n, wxPoint points[], wxCoord xoffset, wxCoord
{
for (i = 0; i < n; i++)
{
xpoints[i].x = XLOG2DEV_2 (points[i].x + xoffset);
xpoints[i].y = YLOG2DEV_2 (points[i].y + yoffset);
xpoints[i].x = (short)XLOG2DEV_2 (points[i].x + xoffset);
xpoints[i].y = (short)YLOG2DEV_2 (points[i].y + yoffset);
}
XDrawLines ((Display*) m_display, (Pixmap) m_window->GetBackingPixmap(),(GC) m_gcBacking, xpoints, n, 0);
}
@ -471,10 +471,10 @@ void wxWindowDC::DoDrawPolygon( int n, wxPoint points[],
int i;
for (i = 0; i < n; i++)
{
xpoints1[i].x = XLOG2DEV (points[i].x + xoffset);
xpoints1[i].y = YLOG2DEV (points[i].y + yoffset);
xpoints2[i].x = XLOG2DEV_2 (points[i].x + xoffset);
xpoints2[i].y = YLOG2DEV_2 (points[i].y + yoffset);
xpoints1[i].x = (short)XLOG2DEV (points[i].x + xoffset);
xpoints1[i].y = (short)YLOG2DEV (points[i].y + yoffset);
xpoints2[i].x = (short)XLOG2DEV_2 (points[i].x + xoffset);
xpoints2[i].y = (short)YLOG2DEV_2 (points[i].y + yoffset);
CalcBoundingBox (points[i].x + xoffset, points[i].y + yoffset);
}
@ -1578,7 +1578,7 @@ void wxWindowDC::SetPen( const wxPen &pen )
{
int factor = scaled_width == 0 ? 1 : scaled_width;
for (int i = 0; i < req_nb_dash; i++)
real_req_dash[i] = req_dash[i] * factor;
real_req_dash[i] = (wxX11Dash)(req_dash[i] * factor);
XSetDashes ((Display*) m_display, (GC) m_gc, 0, real_req_dash, req_nb_dash);
if (m_window && m_window->GetBackingPixmap())
@ -2072,10 +2072,10 @@ void wxWindowDC::DoSetClippingRegion( wxCoord x, wxCoord y,
if (m_window && m_window->GetBackingPixmap())
{
XRectangle rects[1];
rects[0].x = XLOG2DEV_2(x);
rects[0].y = YLOG2DEV_2(y);
rects[0].width = XLOG2DEVREL(width);
rects[0].height = YLOG2DEVREL(height);
rects[0].x = (short)XLOG2DEV_2(x);
rects[0].y = (short)YLOG2DEV_2(y);
rects[0].width = (unsigned short)XLOG2DEVREL(width);
rects[0].height = (unsigned short)YLOG2DEVREL(height);
XSetClipRectangles((Display*) m_display, (GC) m_gcBacking,
0, 0, rects, 1, Unsorted);
}
@ -2094,10 +2094,10 @@ void wxWindowDC::DoSetClippingRegionAsRegion( const wxRegion& region )
if (m_window && m_window->GetBackingPixmap())
{
XRectangle rects[1];
rects[0].x = XLOG2DEV_2(box.x);
rects[0].y = YLOG2DEV_2(box.y);
rects[0].width = XLOG2DEVREL(box.width);
rects[0].height = YLOG2DEVREL(box.height);
rects[0].x = (short)XLOG2DEV_2(box.x);
rects[0].y = (short)YLOG2DEV_2(box.y);
rects[0].width = (unsigned short)XLOG2DEVREL(box.width);
rects[0].height = (unsigned short)YLOG2DEVREL(box.height);
XSetClipRectangles((Display*) m_display, (GC) m_gcBacking,
0, 0, rects, 1, Unsorted);
}

View File

@ -113,32 +113,32 @@ bool wxDialog::Create(wxWindow *parent, wxWindowID id,
ChangeFont(false);
// Can't remember what this was about... but I think it's necessary.
if (wxUSE_INVISIBLE_RESIZE)
{
if (pos.x > -1)
XtVaSetValues(dialogShell, XmNx, pos.x,
NULL);
if (pos.y > -1)
XtVaSetValues(dialogShell, XmNy, pos.y,
NULL);
#if wxUSE_INVISIBLE_RESIZE
if (pos.x > -1)
XtVaSetValues(dialogShell, XmNx, pos.x,
NULL);
if (pos.y > -1)
XtVaSetValues(dialogShell, XmNy, pos.y,
NULL);
if (size.x > -1)
XtVaSetValues(dialogShell, XmNwidth, size.x, NULL);
if (size.y > -1)
XtVaSetValues(dialogShell, XmNheight, size.y, NULL);
}
if (size.x > -1)
XtVaSetValues(dialogShell, XmNwidth, size.x, NULL);
if (size.y > -1)
XtVaSetValues(dialogShell, XmNheight, size.y, NULL);
#endif
// Positioning of the dialog doesn't work properly unless the dialog
// is managed, so we manage without mapping to the screen.
// To show, we map the shell (actually it's parent).
if (!wxUSE_INVISIBLE_RESIZE)
XtVaSetValues(shell, XmNmappedWhenManaged, False, NULL);
#if !wxUSE_INVISIBLE_RESIZE
XtVaSetValues(shell, XmNmappedWhenManaged, False, NULL);
#endif
#if !wxUSE_INVISIBLE_RESIZE
XtManageChild(dialogShell);
SetSize(pos.x, pos.y, size.x, size.y);
#endif
if (!wxUSE_INVISIBLE_RESIZE)
{
XtManageChild(dialogShell);
SetSize(pos.x, pos.y, size.x, size.y);
}
XtAddEventHandler(dialogShell,ExposureMask,False,
wxUniversalRepaintProc, (XtPointer) this);
@ -148,11 +148,11 @@ bool wxDialog::Create(wxWindow *parent, wxWindowID id,
}
bool wxDialog::XmDoCreateTLW(wxWindow* parent,
wxWindowID id,
const wxString& title,
const wxPoint& pos,
const wxSize& size,
long style,
wxWindowID WXUNUSED(id),
const wxString& WXUNUSED(title),
const wxPoint& WXUNUSED(pos),
const wxSize& WXUNUSED(size),
long WXUNUSED(style),
const wxString& name)
{
Widget parentWidget = (Widget) 0;
@ -224,10 +224,13 @@ wxDialog::~wxDialog()
}
m_modalShowing = false;
if (!wxUSE_INVISIBLE_RESIZE && m_mainWidget)
#if !wxUSE_INVISIBLE_RESIZE
if (m_mainWidget)
{
XtUnmapWidget((Widget) m_mainWidget);
}
#endif
PreDestroy();
@ -299,10 +302,11 @@ bool wxDialog::Show( bool show )
if (show)
{
if (!wxUSE_INVISIBLE_RESIZE)
XtMapWidget(XtParent((Widget) m_mainWidget));
else
XtManageChild((Widget)m_mainWidget) ;
#if !wxUSE_INVISIBLE_RESIZE
XtMapWidget(XtParent((Widget) m_mainWidget));
#else
XtManageChild((Widget)m_mainWidget) ;
#endif
XRaiseWindow( XtDisplay( (Widget)m_mainWidget ),
XtWindow( (Widget)m_mainWidget) );
@ -310,10 +314,11 @@ bool wxDialog::Show( bool show )
}
else
{
if (!wxUSE_INVISIBLE_RESIZE)
XtUnmapWidget(XtParent((Widget) m_mainWidget));
else
XtUnmanageChild((Widget)m_mainWidget) ;
#if !wxUSE_INVISIBLE_RESIZE
XtUnmapWidget(XtParent((Widget) m_mainWidget));
#else
XtUnmanageChild((Widget)m_mainWidget) ;
#endif
XFlush(XtDisplay((Widget)m_mainWidget));
XSync(XtDisplay((Widget)m_mainWidget), False);

View File

@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////////
// Name: motif/evtloop.cpp
// Name: src/motif/evtloop.cpp
// Purpose: implements wxEventLoop for Motif
// Author: Mattia Barbon
// Modified by:
@ -257,7 +257,7 @@ bool CheckForAccelerator(XEvent* event)
wxWindow* win = NULL;
// Find the first wxWindow that corresponds to this event window
while (widget && !(win = wxGetWindowFromTable(widget)))
while (widget && ((win = wxGetWindowFromTable(widget))!=NULL))
widget = XtParent(widget);
if (!widget || !win)
@ -291,7 +291,7 @@ bool CheckForKeyDown(XEvent* event)
wxWindow* win = NULL;
// Find the first wxWindow that corresponds to this event window
while (widget && !(win = wxGetWindowFromTable(widget)))
while (widget && ((win = wxGetWindowFromTable(widget))!=NULL))
widget = XtParent(widget);
if (!widget || !win)
@ -317,7 +317,7 @@ bool CheckForKeyUp(XEvent* event)
wxWindow* win = NULL;
// Find the first wxWindow that corresponds to this event window
while (widget && !(win = wxGetWindowFromTable(widget)))
while (widget && ((win = wxGetWindowFromTable(widget))!=NULL))
widget = XtParent(widget);
if (!widget || !win)
@ -472,7 +472,7 @@ bool wxAddIdleCallback()
{
if (!wxInitIdleFds())
return false;
// install input handler for wxWakeUpIdle
XtAppAddInput((XtAppContext) wxTheApp->GetAppContext(),
idleFds[0],

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////////
// Name: motif/frame.cpp
// Name: src/motif/frame.cpp
// Purpose: wxFrame
// Author: Julian Smart
// Modified by:
@ -184,7 +184,8 @@ bool wxFrame::Create(wxWindow *parent,
PreResize();
wxSizeEvent sizeEvent(wxSize(width, height), GetId());
wxSize newSize(width, height);
wxSizeEvent sizeEvent(newSize, GetId());
sizeEvent.SetEventObject(this);
GetEventHandler()->ProcessEvent(sizeEvent);
@ -192,11 +193,11 @@ bool wxFrame::Create(wxWindow *parent,
return true;
}
bool wxFrame::XmDoCreateTLW(wxWindow* parent,
wxWindowID id,
const wxString& title,
const wxPoint& pos,
const wxSize& size,
bool wxFrame::XmDoCreateTLW(wxWindow* WXUNUSED(parent),
wxWindowID WXUNUSED(id),
const wxString& WXUNUSED(title),
const wxPoint& WXUNUSED(pos),
const wxSize& WXUNUSED(size),
long style,
const wxString& name)
{
@ -330,7 +331,7 @@ void wxFrame::DoGetClientSize(int *x, int *y) const
{
int sbw, sbh;
m_frameStatusBar->GetSize(& sbw, & sbh);
yy -= sbh;
yy = (Dimension)(yy - sbh);
}
#if wxUSE_TOOLBAR
if (m_frameToolBar)
@ -338,9 +339,9 @@ void wxFrame::DoGetClientSize(int *x, int *y) const
int tbw, tbh;
m_frameToolBar->GetSize(& tbw, & tbh);
if (m_frameToolBar->GetWindowStyleFlag() & wxTB_VERTICAL)
xx -= tbw;
xx = (Dimension)(xx - tbw);
else
yy -= tbh;
yy = (Dimension)(yy - tbh);
}
#endif // wxUSE_TOOLBAR
@ -385,7 +386,8 @@ void wxFrame::DoSetClientSize(int width, int height)
}
PreResize();
wxSizeEvent sizeEvent(wxSize(width, height), GetId());
wxSize newSize(width, height);
wxSizeEvent sizeEvent(newSize, GetId());
sizeEvent.SetEventObject(this);
GetEventHandler()->ProcessEvent(sizeEvent);

View File

@ -1,12 +1,12 @@
/////////////////////////////////////////////////////////////////////////////
// Name: gauge.cpp
// Name: src/motif/gauge.cpp
// Purpose: wxGauge class
// Author: Julian Smart
// Modified by:
// Created: 17/09/98
// RCS-ID: $Id$
// Copyright: (c) Julian Smart
// Licence: wxWindows licence
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
// For compilers that support precompilation, includes "wx.h".
@ -24,6 +24,10 @@
# include "wx/gauge.h"
#ifdef __OS2__
#include <types.h>
#endif
#ifdef __VMS__
#pragma message disable nosimpint
#endif
@ -67,8 +71,8 @@ IMPLEMENT_DYNAMIC_CLASS(wxGauge, wxControl)
*/
//// PUBLIC XMGAUGE DECLARATIONS
typedef struct _XmGaugeClassRec* XmGaugeWidgetClass;
typedef struct _XmGaugeRec* XmGaugeWidget;
typedef struct _XmGaugeClassRec* XmGaugeWidgetClass;
typedef struct _XmGaugeRec* XmGaugeWidget;
#ifdef __cplusplus
extern "C" WidgetClass xmGaugeWidgetClass;
@ -217,9 +221,9 @@ typedef struct {
} XmGaugeClassPart;
typedef struct _XmGaugeClassRec {
CoreClassPart core_class;
XmPrimitiveClassPart primitive_class;
XmGaugeClassPart gauge_class;
CoreClassPart core_class;
XmPrimitiveClassPart primitive_class;
XmGaugeClassPart gauge_class;
} XmGaugeClassRec;
@ -234,16 +238,16 @@ typedef struct _XmGaugePart{
XtCallbackList valueChangedCallback;
/* private fields */
Boolean dragging; /* drag in progress ? */
Boolean dragging; /* drag in progress ? */
int oldx, oldy;
GC gc;
} XmGaugePart;
typedef struct _XmGaugeRec {
CorePart core;
XmPrimitivePart primitive;
XmGaugePart gauge;
CorePart core;
XmPrimitivePart primitive;
XmGaugePart gauge;
} XmGaugeRec;
extern XmGaugeClassRec xmGaugeClassRec;
@ -404,7 +408,7 @@ DrawSlider(XmGaugeWidget gw, Boolean clear)
}
switch(THIS.orientation) {
case XmHORIZONTAL:
/* size = (gw->core.width - 2 * sht) / ratio; */
/* size = (gw->core.width - 2 * sht) / ratio; */
/* A fix suggested by Dmitri Chubraev */
size = (gw->core.width - 2 * sht) /((float)THIS.maximum-(float)THIS.minimum)*(float)THIS.value;
switch(THIS.processingDirection) {
@ -423,7 +427,7 @@ DrawSlider(XmGaugeWidget gw, Boolean clear)
break;
case XmVERTICAL:
size = (gw->core.height - 2 * sht) /((float)THIS.maximum-(float)THIS.minimum)*(float)THIS.value;
/* size = (gw->core.height - 2 * sht)/ ratio; */
/* size = (gw->core.height - 2 * sht)/ ratio; */
switch(THIS.processingDirection) {
case XmMAX_ON_RIGHT:
case XmMAX_ON_BOTTOM:
@ -511,7 +515,7 @@ ExposeProc(Widget w, XEvent *WXUNUSED(event), Region WXUNUSED(r))
gw->primitive.top_shadow_GC,
gw->primitive.bottom_shadow_GC,
0, 0, w->core.width, w->core.height,
sht, XmSHADOW_IN);
(Dimension)sht, XmSHADOW_IN);
DrawSlider(gw, False);
#undef THIS
}
@ -551,53 +555,53 @@ resources[] = {
XmGaugeClassRec xmGaugeClassRec = {
{ /* core fields */
(WidgetClass) &xmPrimitiveClassRec, /* superclass */
"XmGauge", /* class_name */
sizeof(XmGaugeRec), /* widget_size */
NULL, /* class_initialize */
NULL, /* class_part_initialize */
False, /* class_inited */
Initialize, /* initialize */
NULL, /* initialize_hook */
XtInheritRealize, /* realize */
actions, /* actions */
XtNumber(actions), /* num_actions */
resources, /* resources */
XtNumber(resources), /* num_resources */
NULLQUARK, /* xrm_class */
True, /* compress_motion */
True, /* compress_exposure */
True, /* compress_enterleave */
False, /* visible_interest */
Destroy, /* destroy */
NULL, /* resize */
ExposeProc, /* expose */
SetValues, /* set_values */
NULL, /* set_values_hook */
XtInheritSetValuesAlmost, /* set_values_almost */
NULL, /* get_values_hook */
NULL, /* accept_focus */
XtVersion, /* version */
NULL, /* callback_private */
translations, /* tm_table */
NULL, /* query_geometry */
NULL, /* display_accelerator */
NULL /* extension */
{ /* core fields */
(WidgetClass) &xmPrimitiveClassRec, /* superclass */
"XmGauge", /* class_name */
sizeof(XmGaugeRec), /* widget_size */
NULL, /* class_initialize */
NULL, /* class_part_initialize */
False, /* class_inited */
Initialize, /* initialize */
NULL, /* initialize_hook */
XtInheritRealize, /* realize */
actions, /* actions */
XtNumber(actions), /* num_actions */
resources, /* resources */
XtNumber(resources), /* num_resources */
NULLQUARK, /* xrm_class */
True, /* compress_motion */
True, /* compress_exposure */
True, /* compress_enterleave */
False, /* visible_interest */
Destroy, /* destroy */
NULL, /* resize */
ExposeProc, /* expose */
SetValues, /* set_values */
NULL, /* set_values_hook */
XtInheritSetValuesAlmost, /* set_values_almost */
NULL, /* get_values_hook */
NULL, /* accept_focus */
XtVersion, /* version */
NULL, /* callback_private */
translations, /* tm_table */
NULL, /* query_geometry */
NULL, /* display_accelerator */
NULL /* extension */
},
/* primitive_class fields */
/* primitive_class fields */
{
NULL, /* border_highlight */
NULL, /* border_unhighlight */
NULL, /* translations */
NULL, /* arm_and_activate */
NULL, /* syn_resources */
0, /* num_syn_resources */
NULL /* extension */
},
{ /* gauge fields */
0 /* empty */
}
NULL, /* border_highlight */
NULL, /* border_unhighlight */
NULL, /* translations */
NULL, /* arm_and_activate */
NULL, /* syn_resources */
0, /* num_syn_resources */
NULL /* extension */
},
{ /* gauge fields */
0 /* empty */
}
};
WidgetClass xmGaugeWidgetClass = (WidgetClass)&xmGaugeClassRec;

View File

@ -1,14 +1,18 @@
/////////////////////////////////////////////////////////////////////////////
// Name: gdiobj.cpp
// Name: src/motif/gdiobj.cpp
// Purpose: wxGDIObject class
// Author: Julian Smart
// Modified by:
// Created: 17/09/98
// RCS-ID: $Id$
// Copyright: (c) Julian Smart
// Licence: wxWindows licence
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
// For compilers that support precompilation, includes "wx.h".
#include "wx/wxprec.h"
#include "wx/gdiobj.h"
IMPLEMENT_DYNAMIC_CLASS(wxGDIObject, wxObject)

View File

@ -1,12 +1,13 @@
/* -------------------------------------------------------------------------
* Project: GSocket (Generic Socket) for WX
* Name: gsockmot.c
* Purpose: GSocket: Motif part
* CVSID: $Id$
* Licence: The wxWindows licence
* ------------------------------------------------------------------------- */
/////////////////////////////////////////////////////////////////////////////
// Name: src/motif/gsockmot.cpp
// Project: GSocket (Generic Socket) for WX
// Purpose: GSocket: Motif part
// CVSID: $Id$
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#include "wx/setup.h"
// For compilers that support precompilation, includes "wx.h".
#include "wx/wxprec.h"
#if wxUSE_SOCKETS
@ -17,24 +18,26 @@
extern "C" XtAppContext wxGetAppContext();
static void _GSocket_Motif_Input(XtPointer data, int *fid,
XtInputId *id)
static void _GSocket_Motif_Input(XtPointer data, int *WXUNUSED(fid),
XtInputId *WXUNUSED(id))
{
GSocket *socket = (GSocket *)data;
GSocket *socket = (GSocket *)data;
socket->Detected_Read();
socket->Detected_Read();
}
static void _GSocket_Motif_Output(XtPointer data, int *fid,
XtInputId *id)
static void _GSocket_Motif_Output(XtPointer data, int *WXUNUSED(fid),
XtInputId *WXUNUSED(id))
{
GSocket *socket = (GSocket *)data;
GSocket *socket = (GSocket *)data;
socket->Detected_Write();
socket->Detected_Write();
}
bool GSocketGUIFunctionsTableConcrete::CanUseEventLoop()
{ return true; }
{
return true;
}
bool GSocketGUIFunctionsTableConcrete::OnInit(void)
{
@ -47,88 +50,88 @@ void GSocketGUIFunctionsTableConcrete::OnExit(void)
bool GSocketGUIFunctionsTableConcrete::Init_Socket(GSocket *socket)
{
int *m_id;
int *m_id;
socket->m_gui_dependent = (char *)malloc(sizeof(int)*2);
m_id = (int *)(socket->m_gui_dependent);
socket->m_gui_dependent = (char *)malloc(sizeof(int)*2);
m_id = (int *)(socket->m_gui_dependent);
m_id[0] = -1;
m_id[1] = -1;
m_id[0] = -1;
m_id[1] = -1;
return true;
return true;
}
void GSocketGUIFunctionsTableConcrete::Destroy_Socket(GSocket *socket)
{
free(socket->m_gui_dependent);
free(socket->m_gui_dependent);
}
void GSocketGUIFunctionsTableConcrete::Install_Callback(GSocket *socket, GSocketEvent event)
{
int *m_id = (int *)(socket->m_gui_dependent);
int c;
int *m_id = (int *)(socket->m_gui_dependent);
int c;
if (socket->m_fd == -1)
return;
if (socket->m_fd == -1)
return;
switch (event)
{
case GSOCK_LOST: /* fall-through */
case GSOCK_INPUT: c = 0; break;
case GSOCK_OUTPUT: c = 1; break;
case GSOCK_CONNECTION: c = ((socket->m_server) ? 0 : 1); break;
default: return;
}
switch (event)
{
case GSOCK_LOST: /* fall-through */
case GSOCK_INPUT: c = 0; break;
case GSOCK_OUTPUT: c = 1; break;
case GSOCK_CONNECTION: c = ((socket->m_server) ? 0 : 1); break;
default: return;
}
if (m_id[c] != -1)
XtRemoveInput(m_id[c]);
if (m_id[c] != -1)
XtRemoveInput(m_id[c]);
if (c == 0)
{
m_id[0] = XtAppAddInput(wxGetAppContext(), socket->m_fd,
(XtPointer *)XtInputReadMask,
(XtInputCallbackProc) _GSocket_Motif_Input,
(XtPointer) socket);
}
else
{
m_id[1] = XtAppAddInput(wxGetAppContext(), socket->m_fd,
(XtPointer *)XtInputWriteMask,
(XtInputCallbackProc) _GSocket_Motif_Output,
(XtPointer) socket);
}
if (c == 0)
{
m_id[0] = XtAppAddInput(wxGetAppContext(), socket->m_fd,
(XtPointer *)XtInputReadMask,
(XtInputCallbackProc) _GSocket_Motif_Input,
(XtPointer) socket);
}
else
{
m_id[1] = XtAppAddInput(wxGetAppContext(), socket->m_fd,
(XtPointer *)XtInputWriteMask,
(XtInputCallbackProc) _GSocket_Motif_Output,
(XtPointer) socket);
}
}
void GSocketGUIFunctionsTableConcrete::Uninstall_Callback(GSocket *socket, GSocketEvent event)
{
int *m_id = (int *)(socket->m_gui_dependent);
int c;
int *m_id = (int *)(socket->m_gui_dependent);
int c;
switch (event)
{
case GSOCK_LOST: /* fall-through */
case GSOCK_INPUT: c = 0; break;
case GSOCK_OUTPUT: c = 1; break;
case GSOCK_CONNECTION: c = ((socket->m_server) ? 0 : 1); break;
default: return;
}
switch (event)
{
case GSOCK_LOST: /* fall-through */
case GSOCK_INPUT: c = 0; break;
case GSOCK_OUTPUT: c = 1; break;
case GSOCK_CONNECTION: c = ((socket->m_server) ? 0 : 1); break;
default: return;
}
if (m_id[c] != -1)
XtRemoveInput(m_id[c]);
if (m_id[c] != -1)
XtRemoveInput(m_id[c]);
m_id[c] = -1;
m_id[c] = -1;
}
void GSocketGUIFunctionsTableConcrete::Enable_Events(GSocket *socket)
{
Install_Callback(socket, GSOCK_INPUT);
Install_Callback(socket, GSOCK_OUTPUT);
Install_Callback(socket, GSOCK_INPUT);
Install_Callback(socket, GSOCK_OUTPUT);
}
void GSocketGUIFunctionsTableConcrete::Disable_Events(GSocket *socket)
{
Uninstall_Callback(socket, GSOCK_INPUT);
Uninstall_Callback(socket, GSOCK_OUTPUT);
Uninstall_Callback(socket, GSOCK_INPUT);
Uninstall_Callback(socket, GSOCK_OUTPUT);
}
#else /* !wxUSE_SOCKETS */

View File

@ -1,12 +1,12 @@
/////////////////////////////////////////////////////////////////////////////
// Name: icon.cpp
// Name: src/motif/icon.cpp
// Purpose: wxIcon class
// Author: Julian Smart
// Modified by:
// Created: 17/09/98
// RCS-ID: $Id$
// Copyright: (c) Julian Smart
// Licence: wxWindows licence
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
// For compilers that support precompilation, includes "wx.h".
@ -57,7 +57,7 @@ bool wxIcon::LoadFile(const wxString& filename, wxBitmapType type,
UnRef();
wxBitmapHandler *handler = FindHandler(type);
if ( handler )
return handler->LoadFile(this, filename, type,
desiredWidth, desiredHeight);

View File

@ -306,7 +306,7 @@ int wxDoFindStringInList(Widget w, const wxString& s)
return -1;
}
int wxListBox::FindString(const wxString& s, bool bCase) const
int wxListBox::FindString(const wxString& s, bool WXUNUSED(bCase)) const
{
// FIXME: back to base class for not supported value of bCase

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////////
// Name: menu.cpp
// Name: src/motif/menu.cpp
// Purpose: wxMenu, wxMenuBar, wxMenuItem
// Author: Julian Smart
// Modified by:
@ -140,7 +140,7 @@ wxMenuItem* wxMenu::DoInsert(size_t pos, wxMenuItem *item)
item->GetSubMenu()->m_topLevelMenu = m_topLevelMenu;
}
return pos == GetMenuItemCount() ? wxMenuBase::DoAppend(item) :
return pos == GetMenuItemCount() ? wxMenuBase::DoAppend(item) :
wxMenuBase::DoInsert(pos, item);
}
@ -338,12 +338,14 @@ wxMenuItem *wxMenuBar::FindItem(int id, wxMenu ** itemMenu) const
if (itemMenu)
*itemMenu = NULL;
wxMenuItem *item = NULL;
size_t menuCount = GetMenuCount();
for (size_t i = 0; i < menuCount; i++)
if ((item = m_menus.Item(i)->GetData()->FindItem(id, itemMenu)))
return item;
return NULL;
{
wxMenuItem *item = m_menus.Item(i)->GetData()->FindItem(id, itemMenu);
if (item) return item;
}
return NULL;
}
// Create menubar
@ -465,7 +467,12 @@ void wxMenu::DestroyWidgetAndDetach()
*
*/
WXWidget wxMenu::CreateMenu (wxMenuBar * menuBar, WXWidget parent, wxMenu * topMenu, size_t index, const wxString& title, bool pullDown)
WXWidget wxMenu::CreateMenu (wxMenuBar * menuBar,
WXWidget parent,
wxMenu * topMenu,
size_t WXUNUSED(index),
const wxString& title,
bool pullDown)
{
Widget menu = (Widget) 0;
Widget buttonWidget = (Widget) 0;
@ -671,6 +678,8 @@ void wxMenu::ChangeFont(bool keepOriginalSize)
if (item->GetSubMenu())
item->GetSubMenu()->ChangeFont(keepOriginalSize);
}
#else
wxUnusedVar(keepOriginalSize);
#endif
}

View File

@ -1,14 +1,17 @@
/////////////////////////////////////////////////////////////////////////////
// Name: minifram.cpp
// Name: src/motif/minifram.cpp
// Purpose: wxMiniFrame. Optional; identical to wxFrame if not supported.
// Author: Julian Smart
// Modified by:
// Created: 17/09/98
// RCS-ID: $Id$
// Copyright: (c) Julian Smart
// Licence: wxWindows licence
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
// For compilers that support precompilation, includes "wx.h".
#include "wx/wxprec.h"
#include "wx/minifram.h"
IMPLEMENT_DYNAMIC_CLASS(wxMiniFrame, wxFrame)

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////////
// Name: palette.cpp
// Name: src/motif/palette.cpp
// Purpose: wxPalette
// Author: Julian Smart
// Modified by:
@ -147,9 +147,9 @@ bool wxPalette::Create(int n, const unsigned char *red, const unsigned char *gre
pix_array_n = n;
xcol.flags = DoRed | DoGreen | DoBlue;
for(int i = 0; i < n; i++) {
xcol.red = (unsigned short)red[i] << 8;
xcol.green = (unsigned short)green[i] << 8;
xcol.blue = (unsigned short)blue[i] << 8;
xcol.red = (unsigned short)(red[i] << 8);
xcol.green = (unsigned short)(green[i] << 8);
xcol.blue = (unsigned short)(blue[i] << 8);
pix_array[i] = (XAllocColor(display, cmap, &xcol) == 0) ? 0 : xcol.pixel;
}
@ -165,7 +165,9 @@ bool wxPalette::Create(int n, const unsigned char *red, const unsigned char *gre
return true;
}
int wxPalette::GetPixel(const unsigned char red, const unsigned char green, const unsigned char blue) const
int wxPalette::GetPixel(const unsigned char WXUNUSED(red),
const unsigned char WXUNUSED(green),
const unsigned char WXUNUSED(blue)) const
{
if ( !m_refData )
return false;
@ -290,9 +292,9 @@ bool wxPalette::TransferBitmap8(unsigned char *data, unsigned long sz,
struct rgb24 { unsigned char r, g, b; } *dptr = (struct rgb24 *)dest;
while(sz-- > 0) {
if((int)*data < pix_array_n) {
dptr->r = pix_array[*data] & 0xFF;
dptr->g = (pix_array[*data] >> 8) & 0xFF;
dptr->b = (pix_array[*data] >> 16) & 0xFF;
dptr->r = (unsigned char)(pix_array[*data] & 0xFF);
dptr->g = (unsigned char)((pix_array[*data] >> 8) & 0xFF);
dptr->b = (unsigned char)((pix_array[*data] >> 16) & 0xFF);
}
data++;
dptr++;

View File

@ -1,12 +1,12 @@
/////////////////////////////////////////////////////////////////////////////
// Name: radiobut.cpp
// Name: src/motif/radiobut.cpp
// Purpose: wxRadioButton
// Author: Julian Smart
// Modified by:
// Created: 17/09/98
// RCS-ID: $Id$
// Copyright: (c) Julian Smart
// Licence: wxWindows licence
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
// For compilers that support precompilation, includes "wx.h".
@ -147,7 +147,7 @@ void wxRadioButton::ChangeBackgroundColour()
NULL);
}
void wxRadioButtonCallback (Widget w, XtPointer clientData,
void wxRadioButtonCallback (Widget WXUNUSED(w), XtPointer clientData,
XmToggleButtonCallbackStruct * cbs)
{
if (!cbs->set)

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////////
// Name: scrolbar.cpp
// Name: src/motif/scrolbar.cpp
// Purpose: wxScrollBar
// Author: Julian Smart
// Modified by:

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////////
// Name: motif/settings.cpp
// Name: src/motif/settings.cpp
// Purpose: wxSettings
// Author: Julian Smart
// Modified by:
@ -41,7 +41,7 @@ wxColour wxSystemSettingsNative::GetColour(wxSystemColour index)
if (NULL == but_setting_wid && wxTheApp && wxTheApp->GetTopLevelWidget())
{
but_setting_wid = XtVaCreateWidget("settings_button", xmPushButtonWidgetClass,
(Widget)wxTheApp->GetTopLevelWidget(), NULL);
(Widget)wxTheApp->GetTopLevelWidget(), NULL);
}
switch (index)
@ -70,7 +70,9 @@ wxColour wxSystemSettingsNative::GetColour(wxSystemColour index)
XtVaGetValues(but_setting_wid,
XtVaTypedArg, XmNbackground, XtRColor, &bg, sizeof(bg),
NULL);
return wxColor(bg.red >> 8, bg.green >> 8, bg.blue >> 8);
return wxColor((unsigned char)(bg.red >> 8),
(unsigned char)(bg.green >> 8),
(unsigned char)(bg.blue >> 8));
}
else
{
@ -113,7 +115,9 @@ wxColour wxSystemSettingsNative::GetColour(wxSystemColour index)
XtVaGetValues(but_setting_wid,
XtVaTypedArg, XmNforeground, XtRColor, &fg, sizeof(fg),
NULL);
return wxColor(fg.red >> 8, fg.green >> 8, fg.blue >> 8);
return wxColor((unsigned char)(fg.red >> 8),
(unsigned char)(fg.green >> 8),
(unsigned char)(fg.blue >> 8));
}
else
{
@ -133,7 +137,9 @@ wxColour wxSystemSettingsNative::GetColour(wxSystemColour index)
XtVaGetValues(but_setting_wid,
XtVaTypedArg, XmNbackground, XtRColor, &bg, sizeof(bg),
NULL);
return wxColor(bg.red >> 8, bg.green >> 8, bg.blue >> 8);
return wxColor((unsigned char)(bg.red >> 8),
(unsigned char)(bg.green >> 8),
(unsigned char)(bg.blue >> 8));
}
else
{
@ -163,11 +169,13 @@ wxFont wxSystemSettingsNative::GetFont(wxSystemFont index)
|| wxFont::GetDefaultEncoding() == wxFONTENCODING_EUC_JP)
pointSize = 15;
wxFont font;
switch (index)
{
case wxSYS_SYSTEM_FIXED_FONT:
{
return wxFont(pointSize, wxMODERN, wxNORMAL, wxNORMAL, false);
font = wxFont(pointSize, wxMODERN, wxNORMAL, wxNORMAL, false);
break;
}
case wxSYS_DEVICE_DEFAULT_FONT:
@ -175,12 +183,12 @@ wxFont wxSystemSettingsNative::GetFont(wxSystemFont index)
case wxSYS_DEFAULT_GUI_FONT:
default:
{
return wxFont(pointSize, wxSWISS, wxNORMAL, wxNORMAL, false);
font = wxFont(pointSize, wxSWISS, wxNORMAL, wxNORMAL, false);
break;
}
}
return wxFont();
return font;
}
// Get a system metric, e.g. scrollbar size
@ -193,7 +201,7 @@ int wxSystemSettingsNative::GetMetric(wxSystemMetric index, wxWindow* WXUNUSED(w
case wxSYS_HSCROLL_Y:
case wxSYS_VSCROLL_X:
return 15;
case wxSYS_SCREEN_X:
return_value = DisplayWidth( wxGlobalDisplay(), 0 );
break;

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////////
// Name: spinbutt.cpp
// Name: src/motif/spinbutt.cpp
// Purpose: wxSpinButton
// Author: Julian Smart
// Modified by:
@ -182,7 +182,8 @@ void wxArrowButton::StopTimerCallback( Widget w, XtPointer clientData,
btn->m_timer = 0;
}
bool wxArrowButton::Create( wxSpinButton* parent, wxWindowID id,
bool wxArrowButton::Create( wxSpinButton* parent,
wxWindowID WXUNUSED(id),
ArrowDirection d,
const wxPoint& pos, const wxSize& size )
{

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////////
// Name: textctrl.cpp
// Name: src/motif/textctrl.cpp
// Purpose: wxTextCtrl
// Author: Julian Smart
// Modified by:
@ -136,7 +136,7 @@ bool wxTextCtrl::Create(wxWindow *parent,
XtSetArg (args[count], (String) wxFont::GetFontTag(),
m_font.GetFontType( XtDisplay(parentWidget) ) ); ++count;
XtSetArg (args[count], XmNwordWrap, wantWordWrap); ++count;
XtSetArg (args[count], XmNvalue, value.c_str()); ++count;
XtSetArg (args[count], XmNvalue, value.c_str()); ++count;
XtSetArg (args[count], XmNeditable,
style & wxTE_READONLY ? False : True); ++count;
XtSetArg (args[count], XmNeditMode, XmMULTI_LINE_EDIT ); ++count;
@ -249,7 +249,7 @@ void wxTextCtrl::SetValue(const wxString& text)
SetInsertionPoint(text.length());
XmTextShowPosition ((Widget) m_mainWidget, text.length());
m_modified = TRUE;
m_modified = true;
m_inSetValue = false;
}
@ -498,7 +498,7 @@ wxString wxTextCtrl::GetLineText(long lineNo) const
if (s)
{
wxString buf("");
wxString buf;
long i;
int currentLine = 0;
for (i = 0; currentLine != lineNo && s[i]; i++ )
@ -549,7 +549,7 @@ void wxTextCtrl::OnChar(wxKeyEvent& event)
textStruct->doit = True;
if (isascii(event.m_keyCode) && (textStruct->text->length == 1))
{
textStruct->text->ptr[0] = ((event.m_keyCode == WXK_RETURN) ? 10 : event.m_keyCode);
textStruct->text->ptr[0] = (char)((event.m_keyCode == WXK_RETURN) ? 10 : event.m_keyCode);
}
}
}

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////////
// Name: motif/toolbar.cpp
// Name: src/motif/toolbar.cpp
// Purpose: wxToolBar
// Author: Julian Smart
// Modified by: 13.12.99 by VZ during toolbar classes reorganization
@ -417,7 +417,7 @@ bool wxToolBar::Realize()
(Pixmap)tmp.GetDrawable() :
tool->GetInsensPixmap();
}
if (tool->CanBeToggled())
{
// Toggle button
@ -492,7 +492,7 @@ bool wxToolBar::DoInsertTool(size_t WXUNUSED(pos), wxToolBarToolBase *tool)
return true;
}
bool wxToolBar::DoDeleteTool(size_t pos, wxToolBarToolBase *tool)
bool wxToolBar::DoDeleteTool(size_t WXUNUSED(pos), wxToolBarToolBase *tool)
{
tool->Detach();
@ -516,7 +516,7 @@ bool wxToolBar::DoDeleteTool(size_t pos, wxToolBarToolBase *tool)
offset = isVertical ? size.y : size.x;
offset += packing;
break;
}
}
case wxTOOL_STYLE_SEPARATOR:
offset = isVertical ? 0 : separatorSize;
break;
@ -542,14 +542,14 @@ bool wxToolBar::DoDeleteTool(size_t pos, wxToolBarToolBase *tool)
{
case wxTOOL_STYLE_CONTROL:
{
wxPoint pos = t->GetControl()->GetPosition();
wxPoint location = t->GetControl()->GetPosition();
if( isVertical )
pos.y -= offset;
location.y -= offset;
else
pos.x -= offset;
location.x -= offset;
t->GetControl()->Move( pos );
t->GetControl()->Move( location );
break;
}
case wxTOOL_STYLE_SEPARATOR:
@ -563,9 +563,9 @@ bool wxToolBar::DoDeleteTool(size_t pos, wxToolBarToolBase *tool)
NULL );
if( isVertical )
y -= offset;
y = (Dimension)(y - offset);
else
x -= offset;
x = (Dimension)(x - offset);
XtVaSetValues( t->GetButtonWidget(),
XmNx, x,
@ -621,12 +621,12 @@ void wxToolBar::DoSetSize(int x, int y, int width, int height, int sizeFlags)
}
wxToolBarBase::DoSetSize(x, y, width, height, sizeFlags);
// We must refresh the frame size when the toolbar changes size
// otherwise the toolbar can be shown incorrectly
if ( old_width != width || old_height != height )
{
// But before we send the size event check it
// But before we send the size event check it
// we have a frame that is not being deleted.
wxFrame *frame = wxDynamicCast(GetParent(), wxFrame);
if ( frame && !frame->IsBeingDeleted() )
@ -754,7 +754,7 @@ void wxToolBarTimer::Notify()
// Move the tooltip more or less above the button
int yOffset = 20; // TODO: What should be really?
y -= yOffset;
y = (Position)(y - yOffset);
if (y < yOffset) y = 0;
/************************************************************/

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////////
// Name: motif/toplevel.cpp
// Name: src/motif/toplevel.cpp
// Purpose: wxTopLevelWindow Motif implementation
// Author: Mattia Barbon
// Modified by:
@ -270,8 +270,8 @@ WXWidget wxTopLevelWindowMotif::GetShellWidget() const
return (WXWidget) GetShell( this );
}
bool wxTopLevelWindowMotif::ShowFullScreen( bool show,
long style )
bool wxTopLevelWindowMotif::ShowFullScreen( bool WXUNUSED(show),
long WXUNUSED(style) )
{
// TODO, see wxGTK
return false;
@ -318,7 +318,7 @@ bool wxTopLevelWindowMotif::IsIconized() const
XmNiconic, &iconic,
NULL );
return iconic;
return (iconic == True);
}
void wxTopLevelWindowMotif::Maximize( bool maximize )

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////////
// Name: utils.cpp
// Name: src/motif/utils.cpp
// Purpose: Various utilities
// Author: Julian Smart
// Modified by:
@ -180,7 +180,7 @@ static char * GetIniFile (char *dest, const char *filename)
{
strcpy(dest, filename);
}
else if ((home = wxGetUserHome("")) != NULL)
else if ((home = wxGetUserHome()) != NULL)
{
strcpy(dest, home);
if (dest[strlen(dest) - 1] != '/')
@ -314,7 +314,7 @@ bool wxGetResource(const wxString& section, const wxString& entry, char **value,
XrmDatabase database;
if (file != "")
if (!file.empty())
{
char buffer[500];
@ -454,7 +454,7 @@ void wxXMergeDatabases (wxApp * theApp, Display * display)
environment = GetIniFile (filename, NULL);
len = strlen (environment);
wxString hostname = wxGetHostName();
if ( !!hostname )
if ( !hostname.empty() )
strncat(environment, hostname, 1024 - len);
}
homeDB = XrmGetFileDatabase (environment);
@ -667,9 +667,9 @@ void wxHSVToXColor(wxHSV *hsv,XColor *rgb)
case 4: r = t, g = p, b = v; break;
case 5: r = v, g = p, b = q; break;
}
rgb->red = r << 8;
rgb->green = g << 8;
rgb->blue = b << 8;
rgb->red = (unsigned short)(r << 8);
rgb->green = (unsigned short)(g << 8);
rgb->blue = (unsigned short)(b << 8);
}
void wxXColorToHSV(wxHSV *hsv,XColor *rgb)
@ -811,6 +811,7 @@ char wxFindMnemonic (const char *s)
char* wxFindAccelerator( const char *s )
{
#if 1
wxUnusedVar(s);
// VZ: this function returns incorrect keysym which completely breaks kbd
// handling
return NULL;
@ -878,6 +879,7 @@ char* wxFindAccelerator( const char *s )
XmString wxFindAcceleratorText (const char *s)
{
#if 1
wxUnusedVar(s);
// VZ: this function returns incorrect keysym which completely breaks kbd
// handling
return NULL;
@ -934,6 +936,9 @@ extern void wxDoChangeFont(WXWidget widget, const wxFont& font)
XtVaSetValues( w,
wxFont::GetFontTag(), font.GetFontTypeC( XtDisplay(w) ),
NULL );
#else
wxUnusedVar(widget);
wxUnusedVar(font);
#endif
}

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////////
// Name: windows.cpp
// Name: src/motif/windows.cpp
// Purpose: wxWindow
// Author: Julian Smart
// Modified by:
@ -200,7 +200,7 @@ void wxWindow::Init()
m_winCaptured = false;
m_isShown = true;
m_hScrollBar =
m_vScrollBar =
m_borderWidget =
@ -352,7 +352,7 @@ wxWindow::~wxWindow()
{
if (g_captureWindow == this)
g_captureWindow = NULL;
m_isBeingDeleted = true;
// Motif-specific actions first
@ -747,12 +747,12 @@ int wxWindow::GetScrollPos(int orient) const
int wxWindow::GetScrollRange(int orient) const
{
Widget scrollBar = (Widget)GetScrollbar((wxOrientation)orient);
// CE scintilla windows don't always have these scrollbars
// CE scintilla windows don't always have these scrollbars
// and it tends to pile up a whole bunch of asserts
//wxCHECK_MSG( scrollBar, 0, "no such scrollbar" );
int range = 0;
if (scrollBar)
if (scrollBar)
XtVaGetValues(scrollBar, XmNmaximum, &range, NULL);
return range;
}
@ -1175,7 +1175,7 @@ void wxWindow::DoGetSize(int *x, int *y) const
XmNwidth, &xx,
XmNheight, &yy,
NULL );
if(x) *x = xx;
if(x) *x = xx;
if(y) *y = yy;
}
@ -1183,7 +1183,7 @@ void wxWindow::DoGetPosition(int *x, int *y) const
{
Widget widget = (Widget)
( m_drawingArea ?
( m_borderWidget ? m_borderWidget : m_scrolledWindow ) :
( m_borderWidget ? m_borderWidget : m_scrolledWindow ) :
GetTopWidget() );
Position xx, yy;
@ -1194,8 +1194,8 @@ void wxWindow::DoGetPosition(int *x, int *y) const
if (GetParent())
{
wxPoint pt(GetParent()->GetClientAreaOrigin());
xx -= pt.x;
yy -= pt.y;
xx = (Position)(xx - pt.x);
yy = (Position)(yy - pt.y);
}
if(x) *x = xx;
@ -1455,7 +1455,7 @@ int wxWindow::GetCharHeight() const
wxCHECK_MSG( m_font.Ok(), 0, "valid window font needed" );
int height;
wxGetTextExtent (GetXDisplay(), m_font, 1.0,
"x", NULL, &height, NULL, NULL);
@ -1467,7 +1467,7 @@ int wxWindow::GetCharWidth() const
wxCHECK_MSG( m_font.Ok(), 0, "valid window font needed" );
int width;
wxGetTextExtent (GetXDisplay(), m_font, 1.0,
"x", &width, NULL, NULL, NULL);
@ -1894,9 +1894,8 @@ void wxWidgetResizeProc(Widget w, XConfigureEvent *WXUNUSED(event),
if (win->PreResize())
{
int width, height;
win->GetSize(&width, &height);
wxSizeEvent sizeEvent(wxSize(width, height), win->GetId());
wxSize newSize(win->GetSize());
wxSizeEvent sizeEvent(newSize, win->GetId());
sizeEvent.SetEventObject(win);
win->GetEventHandler()->ProcessEvent(sizeEvent);
}
@ -2315,10 +2314,10 @@ bool wxTranslateMouseEvent(wxMouseEvent& wxevent, wxWindow *win,
|| (event_right_is_down (xevent)
&& (eventType != wxEVT_RIGHT_UP)));
wxevent.m_shiftDown = xevent->xbutton.state & ShiftMask;
wxevent.m_controlDown = xevent->xbutton.state & ControlMask;
wxevent.m_altDown = xevent->xbutton.state & Mod3Mask;
wxevent.m_metaDown = xevent->xbutton.state & Mod1Mask;
wxevent.m_shiftDown = (xevent->xbutton.state & ShiftMask) == ShiftMask;
wxevent.m_controlDown = (xevent->xbutton.state & ControlMask) == ControlMask;
wxevent.m_altDown = (xevent->xbutton.state & Mod3Mask) == Mod3Mask;
wxevent.m_metaDown = (xevent->xbutton.state & Mod1Mask) == Mod1Mask;
wxevent.SetId(win->GetId());
wxevent.SetEventObject(win);
@ -2364,9 +2363,8 @@ bool wxTranslateKeyEvent(wxKeyEvent& wxevent, wxWindow *win,
if (id > -1)
return true;
else
return false;
break;
return false;
}
default:
break;
@ -2389,9 +2387,9 @@ int wxComputeColours (Display *display, wxColour * back, wxColour * fore)
if (back)
{
g_itemColors[0].red = (((long) back->Red ()) << 8);
g_itemColors[0].green = (((long) back->Green ()) << 8);
g_itemColors[0].blue = (((long) back->Blue ()) << 8);
g_itemColors[0].red = (unsigned short)(((long) back->Red ()) << 8);
g_itemColors[0].green = (unsigned short)(((long) back->Green ()) << 8);
g_itemColors[0].blue = (unsigned short)(((long) back->Blue ()) << 8);
g_itemColors[0].flags = DoRed | DoGreen | DoBlue;
if (colorProc == (XmColorProc) NULL)
{
@ -2409,9 +2407,9 @@ int wxComputeColours (Display *display, wxColour * back, wxColour * fore)
}
if (fore)
{
g_itemColors[wxFORE_INDEX].red = (((long) fore->Red ()) << 8);
g_itemColors[wxFORE_INDEX].green = (((long) fore->Green ()) << 8);
g_itemColors[wxFORE_INDEX].blue = (((long) fore->Blue ()) << 8);
g_itemColors[wxFORE_INDEX].red = (unsigned short)(((long) fore->Red ()) << 8);
g_itemColors[wxFORE_INDEX].green = (unsigned short)(((long) fore->Green ()) << 8);
g_itemColors[wxFORE_INDEX].blue = (unsigned short)(((long) fore->Blue ()) << 8);
g_itemColors[wxFORE_INDEX].flags = DoRed | DoGreen | DoBlue;
if (result == wxNO_COLORS)
result = wxFORE_COLORS;