1. wxApp::ProcessPendingEvents() is now common, added appcmn.cpp and

regenerated the makefiles. wxPostEvent() should work for wxGTK too (untested)
2. long -> wxCoord change for wxGTK and wxMSW, use
   wxUSE_COMPATIBLE_COORD_TYPES to get the old behaviour
3. wxHTML compilation fixes (for !wxUSE_HTML case)
4. a couple of handy macros in thread.h added


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@4054 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
1999-10-18 15:14:52 +00:00
parent 72dd34b5dc
commit 72cdf4c9b3
54 changed files with 1356 additions and 1230 deletions

65
src/common/appcmn.cpp Normal file
View File

@@ -0,0 +1,65 @@
/////////////////////////////////////////////////////////////////////////////
// Name: common/appcmn.cpp
// Purpose: wxAppBase methods common to all platforms
// Author: Vadim Zeitlin
// Modified by:
// Created: 18.10.99
// RCS-ID: $Id$
// Copyright: (c) Vadim Zeitlin
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
// ============================================================================
// declarations
// ============================================================================
// ---------------------------------------------------------------------------
// headers
// ---------------------------------------------------------------------------
#ifdef __GNUG__
#pragma implementation "appbase.h"
#endif
// For compilers that support precompilation, includes "wx.h".
#include "wx/wxprec.h"
#if defined(__BORLANDC__)
#pragma hdrstop
#endif
#ifndef WX_PRECOMP
#include "wx/app.h"
#endif
#include "wx/thread.h"
// ===========================================================================
// implementation
// ===========================================================================
// ---------------------------------------------------------------------------
// wxAppBase
// ----------------------------------------------------------------------------
void wxAppBase::ProcessPendingEvents()
{
// ensure that we're the only thread to modify the pending events list
wxCRIT_SECT_LOCKER(locker, wxPendingEventsLocker);
if ( !wxPendingEvents )
return;
// iterate until the list becomes empty
wxNode *node = wxPendingEvents->First();
while (node)
{
wxEvtHandler *handler = (wxEvtHandler *)node->Data();
handler->ProcessPendingEvents();
delete node;
node = wxPendingEvents->First();
}
}

View File

@@ -30,7 +30,7 @@
#include "wx/dc.h"
void wxDCBase::DrawLines(const wxList *list, long xoffset, long yoffset)
void wxDCBase::DrawLines(const wxList *list, wxCoord xoffset, wxCoord yoffset)
{
int n = list->Number();
wxPoint *points = new wxPoint[n];
@@ -50,7 +50,7 @@ void wxDCBase::DrawLines(const wxList *list, long xoffset, long yoffset)
void wxDCBase::DrawPolygon(const wxList *list,
long xoffset, long yoffset,
wxCoord xoffset, wxCoord yoffset,
int fillStyle)
{
int n = list->Number();
@@ -73,7 +73,7 @@ void wxDCBase::DrawPolygon(const wxList *list,
#if wxUSE_SPLINES
// TODO: this API needs fixing (wxPointList, why (!const) "wxList *"?)
void wxDCBase::DrawSpline(long x1, long y1, long x2, long y2, long x3, long y3)
void wxDCBase::DrawSpline(wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2, wxCoord x3, wxCoord y3)
{
wxList point_list;

View File

@@ -321,7 +321,7 @@ bool wxMouseEvent::Button(int but) const
{
switch (but) {
case -1:
return (ButtonUp(-1) || ButtonDown(-1) || ButtonDClick(-1)) ;
return (ButtonUp(-1) || ButtonDown(-1) || ButtonDClick(-1));
case 1:
return (LeftDown() || LeftUp() || LeftDClick());
case 2:
@@ -601,11 +601,13 @@ void wxEvtHandler::AddPendingEvent(wxEvent& event)
m_pendingEvents->Append(event2);
wxPendingEventsLocker->Enter();
wxENTER_CRIT_SECT(wxPendingEventsLocker);
if ( !wxPendingEvents )
wxPendingEvents = new wxList;
wxPendingEvents->Append(this);
wxPendingEventsLocker->Leave();
wxLEAVE_CRIT_SECT(wxPendingEventsLocker);
// TODO: Wake up idle handler for the other platforms.
#ifdef __WXGTK__
@@ -623,9 +625,7 @@ void wxEvtHandler::AddPendingEvent(wxEvent& event)
void wxEvtHandler::ProcessPendingEvents()
{
#if wxUSE_THREADS
wxCriticalSectionLocker locker(*m_eventsLocker);
#endif
wxCRIT_SECT_LOCKER(locker, m_eventsLocker);
wxNode *node = m_pendingEvents->First();
wxEvent *event;

View File

@@ -94,7 +94,11 @@ wxObject *wxObject::Clone() const
return object;
}
#ifdef __WXDEBUG__
void wxObject::CopyObject(wxObject& object_dest) const
#else // !Debug
void wxObject::CopyObject(wxObject& WXUNUSED(object_dest)) const
#endif // Debug/!Debug
{
wxASSERT(object_dest.GetClassInfo()->IsKindOf(GetClassInfo()));
}

File diff suppressed because it is too large Load Diff

View File

@@ -8,7 +8,6 @@
/////////////////////////////////////////////////////////////////////////////
#ifdef __GNUG__
#pragma implementation "appbase.h"
#pragma implementation "app.h"
#endif
@@ -515,28 +514,6 @@ void wxApp::Dispatch()
gtk_main_iteration();
}
void wxApp::ProcessPendingEvents()
{
#if wxUSE_THREADS
wxCriticalSectionLocker locker(*wxPendingEventsLocker);
#endif // wxUSE_THREADS
if ( !wxPendingEvents )
return;
wxNode *node = wxPendingEvents->First();
while (node)
{
wxEvtHandler *handler = (wxEvtHandler *)node->Data();
handler->ProcessPendingEvents();
delete node;
node = wxPendingEvents->First();
}
}
void wxApp::DeletePendingObjects()
{
wxNode *node = wxPendingDelete.First();

View File

@@ -51,7 +51,7 @@ wxDC::wxDC()
m_brush = *wxWHITE_BRUSH;
}
void wxDC::DoSetClippingRegion( long x, long y, long width, long height )
void wxDC::DoSetClippingRegion( wxCoord x, wxCoord y, wxCoord width, wxCoord height )
{
m_clipping = TRUE;
m_clipX1 = x;
@@ -149,14 +149,14 @@ void wxDC::SetLogicalScale( double x, double y )
ComputeScaleAndOrigin();
}
void wxDC::SetLogicalOrigin( long x, long y )
void wxDC::SetLogicalOrigin( wxCoord x, wxCoord y )
{
m_logicalOriginX = x * m_signX; // is this still correct ?
m_logicalOriginY = y * m_signY;
ComputeScaleAndOrigin();
}
void wxDC::SetDeviceOrigin( long x, long y )
void wxDC::SetDeviceOrigin( wxCoord x, wxCoord y )
{
// only wxPostScripDC has m_signX = -1, we override SetDeviceOrigin there
m_deviceOriginX = x;
@@ -176,42 +176,42 @@ void wxDC::SetAxisOrientation( bool xLeftRight, bool yBottomUp )
// coordinates transformations
// ---------------------------------------------------------------------------
long wxDCBase::DeviceToLogicalX(long x) const
wxCoord wxDCBase::DeviceToLogicalX(wxCoord x) const
{
return ((wxDC *)this)->XDEV2LOG(x);
}
long wxDCBase::DeviceToLogicalY(long y) const
wxCoord wxDCBase::DeviceToLogicalY(wxCoord y) const
{
return ((wxDC *)this)->YDEV2LOG(y);
}
long wxDCBase::DeviceToLogicalXRel(long x) const
wxCoord wxDCBase::DeviceToLogicalXRel(wxCoord x) const
{
return ((wxDC *)this)->XDEV2LOGREL(x);
}
long wxDCBase::DeviceToLogicalYRel(long y) const
wxCoord wxDCBase::DeviceToLogicalYRel(wxCoord y) const
{
return ((wxDC *)this)->YDEV2LOGREL(y);
}
long wxDCBase::LogicalToDeviceX(long x) const
wxCoord wxDCBase::LogicalToDeviceX(wxCoord x) const
{
return ((wxDC *)this)->XLOG2DEV(x);
}
long wxDCBase::LogicalToDeviceY(long y) const
wxCoord wxDCBase::LogicalToDeviceY(wxCoord y) const
{
return ((wxDC *)this)->YLOG2DEV(y);
}
long wxDCBase::LogicalToDeviceXRel(long x) const
wxCoord wxDCBase::LogicalToDeviceXRel(wxCoord x) const
{
return ((wxDC *)this)->XLOG2DEVREL(x);
}
long wxDCBase::LogicalToDeviceYRel(long y) const
wxCoord wxDCBase::LogicalToDeviceYRel(wxCoord y) const
{
return ((wxDC *)this)->YLOG2DEVREL(y);
}

View File

@@ -153,19 +153,19 @@ wxWindowDC::~wxWindowDC()
Destroy();
}
void wxWindowDC::DoFloodFill( long WXUNUSED(x), long WXUNUSED(y),
void wxWindowDC::DoFloodFill( wxCoord WXUNUSED(x), wxCoord WXUNUSED(y),
const wxColour &WXUNUSED(col), int WXUNUSED(style) )
{
wxFAIL_MSG( wxT("wxWindowDC::DoFloodFill not implemented") );
}
bool wxWindowDC::DoGetPixel( long WXUNUSED(x1), long WXUNUSED(y1), wxColour *WXUNUSED(col) ) const
bool wxWindowDC::DoGetPixel( wxCoord WXUNUSED(x1), wxCoord WXUNUSED(y1), wxColour *WXUNUSED(col) ) const
{
wxFAIL_MSG( wxT("wxWindowDC::DoGetPixel not implemented") );
return FALSE;
}
void wxWindowDC::DoDrawLine( long x1, long y1, long x2, long y2 )
void wxWindowDC::DoDrawLine( wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2 )
{
wxCHECK_RET( Ok(), wxT("invalid window dc") );
@@ -179,7 +179,7 @@ void wxWindowDC::DoDrawLine( long x1, long y1, long x2, long y2 )
}
}
void wxWindowDC::DoCrossHair( long x, long y )
void wxWindowDC::DoCrossHair( wxCoord x, wxCoord y )
{
wxCHECK_RET( Ok(), wxT("invalid window dc") );
@@ -188,8 +188,8 @@ void wxWindowDC::DoCrossHair( long x, long y )
int w = 0;
int h = 0;
GetSize( &w, &h );
long xx = XLOG2DEV(x);
long yy = YLOG2DEV(y);
wxCoord xx = XLOG2DEV(x);
wxCoord yy = YLOG2DEV(y);
if (m_window)
{
gdk_draw_line( m_window, m_penGC, 0, yy, XLOG2DEVREL(w), yy );
@@ -198,21 +198,21 @@ void wxWindowDC::DoCrossHair( long x, long y )
}
}
void wxWindowDC::DoDrawArc( long x1, long y1, long x2, long y2,
long xc, long yc )
void wxWindowDC::DoDrawArc( wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2,
wxCoord xc, wxCoord yc )
{
wxCHECK_RET( Ok(), wxT("invalid window dc") );
long xx1 = XLOG2DEV(x1);
long yy1 = YLOG2DEV(y1);
long xx2 = XLOG2DEV(x2);
long yy2 = YLOG2DEV(y2);
long xxc = XLOG2DEV(xc);
long yyc = YLOG2DEV(yc);
wxCoord xx1 = XLOG2DEV(x1);
wxCoord yy1 = YLOG2DEV(y1);
wxCoord xx2 = XLOG2DEV(x2);
wxCoord yy2 = YLOG2DEV(y2);
wxCoord xxc = XLOG2DEV(xc);
wxCoord yyc = YLOG2DEV(yc);
double dx = xx1 - xxc;
double dy = yy1 - yyc;
double radius = sqrt((double)(dx*dx+dy*dy));
long r = (long)radius;
wxCoord r = (wxCoord)radius;
double radius1, radius2;
if (xx1 == xx2 && yy1 == yy2)
@@ -234,8 +234,8 @@ void wxWindowDC::DoDrawArc( long x1, long y1, long x2, long y2,
(yy2 - yyc < 0) ? 90.0 : -90.0 :
-atan2(double(yy2-yyc), double(xx2-xxc)) * RAD2DEG;
}
long alpha1 = long(radius1 * 64.0);
long alpha2 = long((radius2 - radius1) * 64.0);
wxCoord alpha1 = wxCoord(radius1 * 64.0);
wxCoord alpha2 = wxCoord((radius2 - radius1) * 64.0);
while (alpha2 <= 0) alpha2 += 360*64;
while (alpha1 > 360*64) alpha1 -= 360*64;
@@ -252,14 +252,14 @@ void wxWindowDC::DoDrawArc( long x1, long y1, long x2, long y2,
CalcBoundingBox (x2, y2);
}
void wxWindowDC::DoDrawEllipticArc( long x, long y, long width, long height, double sa, double ea )
void wxWindowDC::DoDrawEllipticArc( wxCoord x, wxCoord y, wxCoord width, wxCoord height, double sa, double ea )
{
wxCHECK_RET( Ok(), wxT("invalid window dc") );
long xx = XLOG2DEV(x);
long yy = YLOG2DEV(y);
long ww = m_signX * XLOG2DEVREL(width);
long hh = m_signY * YLOG2DEVREL(height);
wxCoord xx = XLOG2DEV(x);
wxCoord yy = YLOG2DEV(y);
wxCoord ww = m_signX * XLOG2DEVREL(width);
wxCoord hh = m_signY * YLOG2DEVREL(height);
// CMB: handle -ve width and/or height
if (ww < 0) { ww = -ww; xx = xx - ww; }
@@ -267,8 +267,8 @@ void wxWindowDC::DoDrawEllipticArc( long x, long y, long width, long height, dou
if (m_window)
{
long start = long(sa * 64.0);
long end = long(ea * 64.0);
wxCoord start = wxCoord(sa * 64.0);
wxCoord end = wxCoord(ea * 64.0);
if (m_brush.GetStyle() != wxTRANSPARENT)
gdk_draw_arc( m_window, m_brushGC, TRUE, xx, yy, ww, hh, start, end );
@@ -281,7 +281,7 @@ void wxWindowDC::DoDrawEllipticArc( long x, long y, long width, long height, dou
CalcBoundingBox (x + width, y + height);
}
void wxWindowDC::DoDrawPoint( long x, long y )
void wxWindowDC::DoDrawPoint( wxCoord x, wxCoord y )
{
wxCHECK_RET( Ok(), wxT("invalid window dc") );
@@ -291,7 +291,7 @@ void wxWindowDC::DoDrawPoint( long x, long y )
CalcBoundingBox (x, y);
}
void wxWindowDC::DoDrawLines( int n, wxPoint points[], long xoffset, long yoffset )
void wxWindowDC::DoDrawLines( int n, wxPoint points[], wxCoord xoffset, wxCoord yoffset )
{
wxCHECK_RET( Ok(), wxT("invalid window dc") );
@@ -302,10 +302,10 @@ void wxWindowDC::DoDrawLines( int n, wxPoint points[], long xoffset, long yoffse
for (int i = 0; i < n-1; i++)
{
long x1 = XLOG2DEV(points[i].x + xoffset);
long x2 = XLOG2DEV(points[i+1].x + xoffset);
long y1 = YLOG2DEV(points[i].y + yoffset); // oh, what a waste
long y2 = YLOG2DEV(points[i+1].y + yoffset);
wxCoord x1 = XLOG2DEV(points[i].x + xoffset);
wxCoord x2 = XLOG2DEV(points[i+1].x + xoffset);
wxCoord y1 = YLOG2DEV(points[i].y + yoffset); // oh, what a waste
wxCoord y2 = YLOG2DEV(points[i+1].y + yoffset);
if (m_window)
gdk_draw_line( m_window, m_penGC, x1, y1, x2, y2 );
@@ -314,7 +314,7 @@ void wxWindowDC::DoDrawLines( int n, wxPoint points[], long xoffset, long yoffse
}
}
void wxWindowDC::DoDrawPolygon( int n, wxPoint points[], long xoffset, long yoffset, int WXUNUSED(fillStyle) )
void wxWindowDC::DoDrawPolygon( int n, wxPoint points[], wxCoord xoffset, wxCoord yoffset, int WXUNUSED(fillStyle) )
{
wxCHECK_RET( Ok(), wxT("invalid window dc") );
@@ -350,14 +350,14 @@ void wxWindowDC::DoDrawPolygon( int n, wxPoint points[], long xoffset, long yoff
delete[] gdkpoints;
}
void wxWindowDC::DoDrawRectangle( long x, long y, long width, long height )
void wxWindowDC::DoDrawRectangle( wxCoord x, wxCoord y, wxCoord width, wxCoord height )
{
wxCHECK_RET( Ok(), wxT("invalid window dc") );
long xx = XLOG2DEV(x);
long yy = YLOG2DEV(y);
long ww = m_signX * XLOG2DEVREL(width);
long hh = m_signY * YLOG2DEVREL(height);
wxCoord xx = XLOG2DEV(x);
wxCoord yy = YLOG2DEV(y);
wxCoord ww = m_signX * XLOG2DEVREL(width);
wxCoord hh = m_signY * YLOG2DEVREL(height);
// CMB: draw nothing if transformed w or h is 0
if (ww == 0 || hh == 0) return;
@@ -379,17 +379,17 @@ void wxWindowDC::DoDrawRectangle( long x, long y, long width, long height )
CalcBoundingBox( x + width, y + height );
}
void wxWindowDC::DoDrawRoundedRectangle( long x, long y, long width, long height, double radius )
void wxWindowDC::DoDrawRoundedRectangle( wxCoord x, wxCoord y, wxCoord width, wxCoord height, double radius )
{
wxCHECK_RET( Ok(), wxT("invalid window dc") );
if (radius < 0.0) radius = - radius * ((width < height) ? width : height);
long xx = XLOG2DEV(x);
long yy = YLOG2DEV(y);
long ww = m_signX * XLOG2DEVREL(width);
long hh = m_signY * YLOG2DEVREL(height);
long rr = XLOG2DEVREL((long)radius);
wxCoord xx = XLOG2DEV(x);
wxCoord yy = YLOG2DEV(y);
wxCoord ww = m_signX * XLOG2DEVREL(width);
wxCoord hh = m_signY * YLOG2DEVREL(height);
wxCoord rr = XLOG2DEVREL((wxCoord)radius);
// CMB: handle -ve width and/or height
if (ww < 0) { ww = -ww; xx = xx - ww; }
@@ -418,7 +418,7 @@ void wxWindowDC::DoDrawRoundedRectangle( long x, long y, long width, long height
{
// CMB: ensure dd is not larger than rectangle otherwise we
// get an hour glass shape
long dd = 2 * rr;
wxCoord dd = 2 * rr;
if (dd > ww) dd = ww;
if (dd > hh) dd = hh;
rr = dd / 2;
@@ -451,14 +451,14 @@ void wxWindowDC::DoDrawRoundedRectangle( long x, long y, long width, long height
CalcBoundingBox( x + width, y + height );
}
void wxWindowDC::DoDrawEllipse( long x, long y, long width, long height )
void wxWindowDC::DoDrawEllipse( wxCoord x, wxCoord y, wxCoord width, wxCoord height )
{
wxCHECK_RET( Ok(), wxT("invalid window dc") );
long xx = XLOG2DEV(x);
long yy = YLOG2DEV(y);
long ww = m_signX * XLOG2DEVREL(width);
long hh = m_signY * YLOG2DEVREL(height);
wxCoord xx = XLOG2DEV(x);
wxCoord yy = YLOG2DEV(y);
wxCoord ww = m_signX * XLOG2DEVREL(width);
wxCoord hh = m_signY * YLOG2DEVREL(height);
// CMB: handle -ve width and/or height
if (ww < 0) { ww = -ww; xx = xx - ww; }
@@ -477,14 +477,14 @@ void wxWindowDC::DoDrawEllipse( long x, long y, long width, long height )
CalcBoundingBox( x + width, y + height );
}
void wxWindowDC::DoDrawIcon( const wxIcon &icon, long x, long y )
void wxWindowDC::DoDrawIcon( const wxIcon &icon, wxCoord x, wxCoord y )
{
// VZ: egcs 1.0.3 refuses to compile this without cast, no idea why
DoDrawBitmap( (const wxBitmap&)icon, x, y, (bool)TRUE );
}
void wxWindowDC::DoDrawBitmap( const wxBitmap &bitmap,
long x, long y,
wxCoord x, wxCoord y,
bool useMask )
{
wxCHECK_RET( Ok(), wxT("invalid window dc") );
@@ -559,8 +559,8 @@ void wxWindowDC::DoDrawBitmap( const wxBitmap &bitmap,
}
}
bool wxWindowDC::DoBlit( long xdest, long ydest, long width, long height,
wxDC *source, long xsrc, long ysrc,
bool wxWindowDC::DoBlit( wxCoord xdest, wxCoord ydest, wxCoord width, wxCoord height,
wxDC *source, wxCoord xsrc, wxCoord ysrc,
int logical_func, bool useMask )
{
/* this is the nth try to get this utterly useless function to
@@ -629,11 +629,11 @@ bool wxWindowDC::DoBlit( long xdest, long ydest, long width, long height,
{
/* scale/translate bitmap size */
long bm_width = memDC->m_selected.GetWidth();
long bm_height = memDC->m_selected.GetHeight();
wxCoord bm_width = memDC->m_selected.GetWidth();
wxCoord bm_height = memDC->m_selected.GetHeight();
long bm_ww = XLOG2DEVREL( bm_width );
long bm_hh = YLOG2DEVREL( bm_height );
wxCoord bm_ww = XLOG2DEVREL( bm_width );
wxCoord bm_hh = YLOG2DEVREL( bm_height );
/* scale bitmap if required */
@@ -653,11 +653,11 @@ bool wxWindowDC::DoBlit( long xdest, long ydest, long width, long height,
/* scale/translate size and position */
long xx = XLOG2DEV(xdest);
long yy = YLOG2DEV(ydest);
wxCoord xx = XLOG2DEV(xdest);
wxCoord yy = YLOG2DEV(ydest);
long ww = XLOG2DEVREL(width);
long hh = YLOG2DEVREL(height);
wxCoord ww = XLOG2DEVREL(width);
wxCoord hh = YLOG2DEVREL(height);
/* apply mask if any */
@@ -700,11 +700,11 @@ bool wxWindowDC::DoBlit( long xdest, long ydest, long width, long height,
{
/* scale/translate size and position */
long xx = XLOG2DEV(xdest);
long yy = YLOG2DEV(ydest);
wxCoord xx = XLOG2DEV(xdest);
wxCoord yy = YLOG2DEV(ydest);
long ww = XLOG2DEVREL(width);
long hh = YLOG2DEVREL(height);
wxCoord ww = XLOG2DEVREL(width);
wxCoord hh = YLOG2DEVREL(height);
if ((width != ww) || (height != hh))
{
@@ -754,7 +754,7 @@ bool wxWindowDC::DoBlit( long xdest, long ydest, long width, long height,
return TRUE;
}
void wxWindowDC::DoDrawText( const wxString &text, long x, long y )
void wxWindowDC::DoDrawText( const wxString &text, wxCoord x, wxCoord y )
{
wxCHECK_RET( Ok(), wxT("invalid window dc") );
@@ -770,8 +770,8 @@ void wxWindowDC::DoDrawText( const wxString &text, long x, long y )
/* CMB 21/5/98: draw text background if mode is wxSOLID */
if (m_backgroundMode == wxSOLID)
{
long width = gdk_string_width( font, text.mbc_str() );
long height = font->ascent + font->descent;
wxCoord width = gdk_string_width( font, text.mbc_str() );
wxCoord height = font->ascent + font->descent;
gdk_gc_set_foreground( m_textGC, m_textBackgroundColour.GetColor() );
gdk_draw_rectangle( m_window, m_textGC, TRUE, x, y, width, height );
gdk_gc_set_foreground( m_textGC, m_textForegroundColour.GetColor() );
@@ -783,42 +783,43 @@ void wxWindowDC::DoDrawText( const wxString &text, long x, long y )
properties (see wxXt implementation) */
if (m_font.GetUnderlined())
{
long width = gdk_string_width( font, text.mbc_str() );
long ul_y = y + font->ascent;
wxCoord width = gdk_string_width( font, text.mbc_str() );
wxCoord ul_y = y + font->ascent;
if (font->descent > 0) ul_y++;
gdk_draw_line( m_window, m_textGC, x, ul_y, x + width, ul_y);
}
long w, h;
wxCoord w, h;
GetTextExtent (text, &w, &h);
CalcBoundingBox (x + w, y + h);
CalcBoundingBox (x, y);
}
void wxWindowDC::GetTextExtent( const wxString &string, long *width, long *height,
long *descent, long *externalLeading,
wxFont *theFont ) const
void wxWindowDC::DoGetTextExtent(const wxString &string,
wxCoord *width, wxCoord *height,
wxCoord *descent, wxCoord *externalLeading,
wxFont *theFont) const
{
wxFont fontToUse = m_font;
if (theFont) fontToUse = *theFont;
GdkFont *font = fontToUse.GetInternalFont( m_scaleY );
if (width) (*width) = long(gdk_string_width( font, string.mbc_str() ) / m_scaleX);
if (height) (*height) = long((font->ascent + font->descent) / m_scaleY);
if (descent) (*descent) = long(font->descent / m_scaleY);
if (width) (*width) = wxCoord(gdk_string_width( font, string.mbc_str() ) / m_scaleX);
if (height) (*height) = wxCoord((font->ascent + font->descent) / m_scaleY);
if (descent) (*descent) = wxCoord(font->descent / m_scaleY);
if (externalLeading) (*externalLeading) = 0; // ??
}
long wxWindowDC::GetCharWidth() const
wxCoord wxWindowDC::GetCharWidth() const
{
GdkFont *font = m_font.GetInternalFont( m_scaleY );
return long(gdk_string_width( font, "H" ) / m_scaleX);
return wxCoord(gdk_string_width( font, "H" ) / m_scaleX);
}
long wxWindowDC::GetCharHeight() const
wxCoord wxWindowDC::GetCharHeight() const
{
GdkFont *font = m_font.GetInternalFont( m_scaleY );
return long((font->ascent + font->descent) / m_scaleY);
return wxCoord((font->ascent + font->descent) / m_scaleY);
}
void wxWindowDC::Clear()
@@ -886,7 +887,7 @@ void wxWindowDC::SetPen( const wxPen &pen )
static const char dotted[] = {1, 1};
static const char short_dashed[] = {2, 2};
static const char long_dashed[] = {2, 4};
static const char wxCoord_dashed[] = {2, 4};
static const char dotted_dashed[] = {3, 3, 1, 3};
// We express dash pattern in pen width unit, so we are
@@ -915,7 +916,7 @@ void wxWindowDC::SetPen( const wxPen &pen )
{
lineStyle = GDK_LINE_ON_OFF_DASH;
req_nb_dash = 2;
req_dash = long_dashed;
req_dash = wxCoord_dashed;
break;
}
case wxSHORT_DASH:
@@ -1168,7 +1169,7 @@ void wxWindowDC::SetPalette( const wxPalette& WXUNUSED(palette) )
wxFAIL_MSG( wxT("wxWindowDC::SetPalette not implemented") );
}
void wxWindowDC::DoSetClippingRegion( long x, long y, long width, long height )
void wxWindowDC::DoSetClippingRegion( wxCoord x, wxCoord y, wxCoord width, wxCoord height )
{
wxCHECK_RET( Ok(), wxT("invalid window dc") );

View File

@@ -4,7 +4,7 @@
// Author: Robert Roebling
// RCS-ID: $Id$
// Copyright: (c) 1998 Robert Roebling
// Licence: wxWindows licence
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifdef __GNUG__
@@ -25,15 +25,15 @@ IMPLEMENT_DYNAMIC_CLASS(wxMemoryDC,wxWindowDC)
wxMemoryDC::wxMemoryDC() : wxWindowDC()
{
m_ok = FALSE;
m_cmap = gtk_widget_get_default_colormap();
}
wxMemoryDC::wxMemoryDC( wxDC *WXUNUSED(dc) )
wxMemoryDC::wxMemoryDC( wxDC *WXUNUSED(dc) )
: wxWindowDC()
{
m_ok = FALSE;
m_cmap = gtk_widget_get_default_colormap();
}
@@ -54,13 +54,13 @@ void wxMemoryDC::SelectObject( const wxBitmap& bitmap )
{
m_window = m_selected.GetBitmap();
}
SetUpDC();
m_isMemDC = TRUE;
}
else
{
{
m_ok = FALSE;
m_window = (GdkWindow *) NULL;
}

View File

@@ -4,7 +4,7 @@
// Author: Robert Roebling
// Id: $Id$
// Copyright: (c) 1998 Robert Roebling
// Licence: wxWindows licence
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifdef __GNUG__
@@ -22,10 +22,9 @@
//-----------------------------------------------------------------------------
GdkWindow *wxScreenDC::sm_overlayWindow = (GdkWindow*) NULL;
int wxScreenDC::sm_overlayWindowX = 0;
int wxScreenDC::sm_overlayWindowY = 0;
int wxScreenDC::sm_overlayWindowX = 0;
int wxScreenDC::sm_overlayWindowY = 0;
//-----------------------------------------------------------------------------
// create X window
//-----------------------------------------------------------------------------
@@ -57,14 +56,14 @@ int my_event_masks_table[19] =
StructureNotifyMask,
PropertyChangeMask,
VisibilityChangeMask,
0, /* PROXIMITY_IN */
0 /* PROXIMTY_OUT */
0, /* PROXIMITY_IN */
0 /* PROXIMTY_OUT */
};
GdkWindow*
gdk_window_transparent_new ( GdkWindow *parent,
GdkWindowAttr *attributes,
gint attributes_mask)
GdkWindowAttr *attributes,
gint attributes_mask)
{
GdkWindow *window;
GdkWindowPrivate *gprivate;
@@ -125,7 +124,7 @@ gdk_window_transparent_new ( GdkWindow *parent,
gprivate->height = (attributes->height > 1) ? (attributes->height) : (1);
gprivate->window_type = attributes->window_type;
gprivate->extension_events = FALSE;
#if (GTK_MINOR_VERSION == 0)
gprivate->dnd_drag_data_type = None;
gprivate->dnd_drag_data_typesavail =
@@ -152,16 +151,16 @@ gdk_window_transparent_new ( GdkWindow *parent,
for (i = 0; i < my_nevent_masks; i++)
{
if (attributes->event_mask & (1 << (i + 1)))
xattributes.event_mask |= my_event_masks_table[i];
xattributes.event_mask |= my_event_masks_table[i];
}
if (xattributes.event_mask)
xattributes_mask |= CWEventMask;
if(attributes_mask & GDK_WA_NOREDIR) {
xattributes.override_redirect =
(attributes->override_redirect == FALSE)?False:True;
xattributes_mask |= CWOverrideRedirect;
xattributes.override_redirect =
(attributes->override_redirect == FALSE)?False:True;
xattributes_mask |= CWOverrideRedirect;
} else
xattributes.override_redirect = False;
@@ -169,24 +168,24 @@ gdk_window_transparent_new ( GdkWindow *parent,
depth = visual->depth;
if (attributes_mask & GDK_WA_COLORMAP)
gprivate->colormap = attributes->colormap;
gprivate->colormap = attributes->colormap;
else
gprivate->colormap = gdk_colormap_get_system ();
gprivate->colormap = gdk_colormap_get_system ();
xattributes.colormap = ((GdkColormapPrivate*) gprivate->colormap)->xcolormap;
xattributes_mask |= CWColormap;
xattributes.colormap = ((GdkColormapPrivate*) gprivate->colormap)->xcolormap;
xattributes_mask |= CWColormap;
xparent = gdk_root_window;
xparent = gdk_root_window;
xattributes.save_under = True;
xattributes.override_redirect = True;
xattributes.cursor = None;
xattributes_mask |= CWSaveUnder | CWOverrideRedirect;
xattributes.save_under = True;
xattributes.override_redirect = True;
xattributes.cursor = None;
xattributes_mask |= CWSaveUnder | CWOverrideRedirect;
gprivate->xwindow = XCreateWindow (gprivate->xdisplay, xparent,
x, y, gprivate->width, gprivate->height,
0, depth, gclass, xvisual,
xattributes_mask, &xattributes);
x, y, gprivate->width, gprivate->height,
0, depth, gclass, xvisual,
xattributes_mask, &xattributes);
gdk_window_ref (window);
gdk_xid_table_insert (&gprivate->xwindow, window);
@@ -246,12 +245,12 @@ gdk_window_transparent_new ( GdkWindow *parent,
IMPLEMENT_DYNAMIC_CLASS(wxScreenDC,wxPaintDC)
wxScreenDC::wxScreenDC(void)
wxScreenDC::wxScreenDC()
{
m_ok = FALSE;
m_window = (GdkWindow *) NULL;
m_cmap = gdk_colormap_get_system();
if (sm_overlayWindow)
{
m_window = sm_overlayWindow;
@@ -262,16 +261,16 @@ wxScreenDC::wxScreenDC(void)
{
m_window = GDK_ROOT_PARENT();
}
SetUpDC();
gdk_gc_set_subwindow( m_penGC, GDK_INCLUDE_INFERIORS );
gdk_gc_set_subwindow( m_brushGC, GDK_INCLUDE_INFERIORS );
gdk_gc_set_subwindow( m_textGC, GDK_INCLUDE_INFERIORS );
gdk_gc_set_subwindow( m_bgGC, GDK_INCLUDE_INFERIORS );
}
wxScreenDC::~wxScreenDC(void)
wxScreenDC::~wxScreenDC()
{
EndDrawingOnTop();
}
@@ -279,7 +278,7 @@ wxScreenDC::~wxScreenDC(void)
bool wxScreenDC::StartDrawingOnTop( wxWindow *window )
{
if (!window) return StartDrawingOnTop();
int x = 0;
int y = 0;
window->GetPosition( &x, &y );
@@ -287,13 +286,13 @@ bool wxScreenDC::StartDrawingOnTop( wxWindow *window )
int h = 0;
window->GetSize( &w, &h );
window->ClientToScreen( &x, &y );
wxRect rect;
rect.x = x;
rect.y = y;
rect.width = 0;
rect.height = 0;
return StartDrawingOnTop( &rect );
}
@@ -310,7 +309,7 @@ bool wxScreenDC::StartDrawingOnTop( wxRect *rect )
width = rect->width;
height = rect->height;
}
sm_overlayWindowX = x;
sm_overlayWindowY = y;
@@ -323,23 +322,23 @@ bool wxScreenDC::StartDrawingOnTop( wxRect *rect )
attr.wclass = GDK_INPUT_OUTPUT;
attr.event_mask = 0;
attr.window_type = GDK_WINDOW_TEMP;
// GTK cannot set transparent backgrounds. :-(
sm_overlayWindow = gdk_window_transparent_new( NULL, &attr, GDK_WA_NOREDIR | GDK_WA_X | GDK_WA_Y );
if (sm_overlayWindow) gdk_window_show( sm_overlayWindow );
return (sm_overlayWindow != NULL);
}
bool wxScreenDC::EndDrawingOnTop(void)
bool wxScreenDC::EndDrawingOnTop()
{
if (sm_overlayWindow) gdk_window_destroy( sm_overlayWindow );
sm_overlayWindow = NULL;
sm_overlayWindowX = 0;
sm_overlayWindowY = 0;
return TRUE;
}

View File

@@ -8,7 +8,6 @@
/////////////////////////////////////////////////////////////////////////////
#ifdef __GNUG__
#pragma implementation "appbase.h"
#pragma implementation "app.h"
#endif
@@ -515,28 +514,6 @@ void wxApp::Dispatch()
gtk_main_iteration();
}
void wxApp::ProcessPendingEvents()
{
#if wxUSE_THREADS
wxCriticalSectionLocker locker(*wxPendingEventsLocker);
#endif // wxUSE_THREADS
if ( !wxPendingEvents )
return;
wxNode *node = wxPendingEvents->First();
while (node)
{
wxEvtHandler *handler = (wxEvtHandler *)node->Data();
handler->ProcessPendingEvents();
delete node;
node = wxPendingEvents->First();
}
}
void wxApp::DeletePendingObjects()
{
wxNode *node = wxPendingDelete.First();

View File

@@ -51,7 +51,7 @@ wxDC::wxDC()
m_brush = *wxWHITE_BRUSH;
}
void wxDC::DoSetClippingRegion( long x, long y, long width, long height )
void wxDC::DoSetClippingRegion( wxCoord x, wxCoord y, wxCoord width, wxCoord height )
{
m_clipping = TRUE;
m_clipX1 = x;
@@ -149,14 +149,14 @@ void wxDC::SetLogicalScale( double x, double y )
ComputeScaleAndOrigin();
}
void wxDC::SetLogicalOrigin( long x, long y )
void wxDC::SetLogicalOrigin( wxCoord x, wxCoord y )
{
m_logicalOriginX = x * m_signX; // is this still correct ?
m_logicalOriginY = y * m_signY;
ComputeScaleAndOrigin();
}
void wxDC::SetDeviceOrigin( long x, long y )
void wxDC::SetDeviceOrigin( wxCoord x, wxCoord y )
{
// only wxPostScripDC has m_signX = -1, we override SetDeviceOrigin there
m_deviceOriginX = x;
@@ -176,42 +176,42 @@ void wxDC::SetAxisOrientation( bool xLeftRight, bool yBottomUp )
// coordinates transformations
// ---------------------------------------------------------------------------
long wxDCBase::DeviceToLogicalX(long x) const
wxCoord wxDCBase::DeviceToLogicalX(wxCoord x) const
{
return ((wxDC *)this)->XDEV2LOG(x);
}
long wxDCBase::DeviceToLogicalY(long y) const
wxCoord wxDCBase::DeviceToLogicalY(wxCoord y) const
{
return ((wxDC *)this)->YDEV2LOG(y);
}
long wxDCBase::DeviceToLogicalXRel(long x) const
wxCoord wxDCBase::DeviceToLogicalXRel(wxCoord x) const
{
return ((wxDC *)this)->XDEV2LOGREL(x);
}
long wxDCBase::DeviceToLogicalYRel(long y) const
wxCoord wxDCBase::DeviceToLogicalYRel(wxCoord y) const
{
return ((wxDC *)this)->YDEV2LOGREL(y);
}
long wxDCBase::LogicalToDeviceX(long x) const
wxCoord wxDCBase::LogicalToDeviceX(wxCoord x) const
{
return ((wxDC *)this)->XLOG2DEV(x);
}
long wxDCBase::LogicalToDeviceY(long y) const
wxCoord wxDCBase::LogicalToDeviceY(wxCoord y) const
{
return ((wxDC *)this)->YLOG2DEV(y);
}
long wxDCBase::LogicalToDeviceXRel(long x) const
wxCoord wxDCBase::LogicalToDeviceXRel(wxCoord x) const
{
return ((wxDC *)this)->XLOG2DEVREL(x);
}
long wxDCBase::LogicalToDeviceYRel(long y) const
wxCoord wxDCBase::LogicalToDeviceYRel(wxCoord y) const
{
return ((wxDC *)this)->YLOG2DEVREL(y);
}

View File

@@ -153,19 +153,19 @@ wxWindowDC::~wxWindowDC()
Destroy();
}
void wxWindowDC::DoFloodFill( long WXUNUSED(x), long WXUNUSED(y),
void wxWindowDC::DoFloodFill( wxCoord WXUNUSED(x), wxCoord WXUNUSED(y),
const wxColour &WXUNUSED(col), int WXUNUSED(style) )
{
wxFAIL_MSG( wxT("wxWindowDC::DoFloodFill not implemented") );
}
bool wxWindowDC::DoGetPixel( long WXUNUSED(x1), long WXUNUSED(y1), wxColour *WXUNUSED(col) ) const
bool wxWindowDC::DoGetPixel( wxCoord WXUNUSED(x1), wxCoord WXUNUSED(y1), wxColour *WXUNUSED(col) ) const
{
wxFAIL_MSG( wxT("wxWindowDC::DoGetPixel not implemented") );
return FALSE;
}
void wxWindowDC::DoDrawLine( long x1, long y1, long x2, long y2 )
void wxWindowDC::DoDrawLine( wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2 )
{
wxCHECK_RET( Ok(), wxT("invalid window dc") );
@@ -179,7 +179,7 @@ void wxWindowDC::DoDrawLine( long x1, long y1, long x2, long y2 )
}
}
void wxWindowDC::DoCrossHair( long x, long y )
void wxWindowDC::DoCrossHair( wxCoord x, wxCoord y )
{
wxCHECK_RET( Ok(), wxT("invalid window dc") );
@@ -188,8 +188,8 @@ void wxWindowDC::DoCrossHair( long x, long y )
int w = 0;
int h = 0;
GetSize( &w, &h );
long xx = XLOG2DEV(x);
long yy = YLOG2DEV(y);
wxCoord xx = XLOG2DEV(x);
wxCoord yy = YLOG2DEV(y);
if (m_window)
{
gdk_draw_line( m_window, m_penGC, 0, yy, XLOG2DEVREL(w), yy );
@@ -198,21 +198,21 @@ void wxWindowDC::DoCrossHair( long x, long y )
}
}
void wxWindowDC::DoDrawArc( long x1, long y1, long x2, long y2,
long xc, long yc )
void wxWindowDC::DoDrawArc( wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2,
wxCoord xc, wxCoord yc )
{
wxCHECK_RET( Ok(), wxT("invalid window dc") );
long xx1 = XLOG2DEV(x1);
long yy1 = YLOG2DEV(y1);
long xx2 = XLOG2DEV(x2);
long yy2 = YLOG2DEV(y2);
long xxc = XLOG2DEV(xc);
long yyc = YLOG2DEV(yc);
wxCoord xx1 = XLOG2DEV(x1);
wxCoord yy1 = YLOG2DEV(y1);
wxCoord xx2 = XLOG2DEV(x2);
wxCoord yy2 = YLOG2DEV(y2);
wxCoord xxc = XLOG2DEV(xc);
wxCoord yyc = YLOG2DEV(yc);
double dx = xx1 - xxc;
double dy = yy1 - yyc;
double radius = sqrt((double)(dx*dx+dy*dy));
long r = (long)radius;
wxCoord r = (wxCoord)radius;
double radius1, radius2;
if (xx1 == xx2 && yy1 == yy2)
@@ -234,8 +234,8 @@ void wxWindowDC::DoDrawArc( long x1, long y1, long x2, long y2,
(yy2 - yyc < 0) ? 90.0 : -90.0 :
-atan2(double(yy2-yyc), double(xx2-xxc)) * RAD2DEG;
}
long alpha1 = long(radius1 * 64.0);
long alpha2 = long((radius2 - radius1) * 64.0);
wxCoord alpha1 = wxCoord(radius1 * 64.0);
wxCoord alpha2 = wxCoord((radius2 - radius1) * 64.0);
while (alpha2 <= 0) alpha2 += 360*64;
while (alpha1 > 360*64) alpha1 -= 360*64;
@@ -252,14 +252,14 @@ void wxWindowDC::DoDrawArc( long x1, long y1, long x2, long y2,
CalcBoundingBox (x2, y2);
}
void wxWindowDC::DoDrawEllipticArc( long x, long y, long width, long height, double sa, double ea )
void wxWindowDC::DoDrawEllipticArc( wxCoord x, wxCoord y, wxCoord width, wxCoord height, double sa, double ea )
{
wxCHECK_RET( Ok(), wxT("invalid window dc") );
long xx = XLOG2DEV(x);
long yy = YLOG2DEV(y);
long ww = m_signX * XLOG2DEVREL(width);
long hh = m_signY * YLOG2DEVREL(height);
wxCoord xx = XLOG2DEV(x);
wxCoord yy = YLOG2DEV(y);
wxCoord ww = m_signX * XLOG2DEVREL(width);
wxCoord hh = m_signY * YLOG2DEVREL(height);
// CMB: handle -ve width and/or height
if (ww < 0) { ww = -ww; xx = xx - ww; }
@@ -267,8 +267,8 @@ void wxWindowDC::DoDrawEllipticArc( long x, long y, long width, long height, dou
if (m_window)
{
long start = long(sa * 64.0);
long end = long(ea * 64.0);
wxCoord start = wxCoord(sa * 64.0);
wxCoord end = wxCoord(ea * 64.0);
if (m_brush.GetStyle() != wxTRANSPARENT)
gdk_draw_arc( m_window, m_brushGC, TRUE, xx, yy, ww, hh, start, end );
@@ -281,7 +281,7 @@ void wxWindowDC::DoDrawEllipticArc( long x, long y, long width, long height, dou
CalcBoundingBox (x + width, y + height);
}
void wxWindowDC::DoDrawPoint( long x, long y )
void wxWindowDC::DoDrawPoint( wxCoord x, wxCoord y )
{
wxCHECK_RET( Ok(), wxT("invalid window dc") );
@@ -291,7 +291,7 @@ void wxWindowDC::DoDrawPoint( long x, long y )
CalcBoundingBox (x, y);
}
void wxWindowDC::DoDrawLines( int n, wxPoint points[], long xoffset, long yoffset )
void wxWindowDC::DoDrawLines( int n, wxPoint points[], wxCoord xoffset, wxCoord yoffset )
{
wxCHECK_RET( Ok(), wxT("invalid window dc") );
@@ -302,10 +302,10 @@ void wxWindowDC::DoDrawLines( int n, wxPoint points[], long xoffset, long yoffse
for (int i = 0; i < n-1; i++)
{
long x1 = XLOG2DEV(points[i].x + xoffset);
long x2 = XLOG2DEV(points[i+1].x + xoffset);
long y1 = YLOG2DEV(points[i].y + yoffset); // oh, what a waste
long y2 = YLOG2DEV(points[i+1].y + yoffset);
wxCoord x1 = XLOG2DEV(points[i].x + xoffset);
wxCoord x2 = XLOG2DEV(points[i+1].x + xoffset);
wxCoord y1 = YLOG2DEV(points[i].y + yoffset); // oh, what a waste
wxCoord y2 = YLOG2DEV(points[i+1].y + yoffset);
if (m_window)
gdk_draw_line( m_window, m_penGC, x1, y1, x2, y2 );
@@ -314,7 +314,7 @@ void wxWindowDC::DoDrawLines( int n, wxPoint points[], long xoffset, long yoffse
}
}
void wxWindowDC::DoDrawPolygon( int n, wxPoint points[], long xoffset, long yoffset, int WXUNUSED(fillStyle) )
void wxWindowDC::DoDrawPolygon( int n, wxPoint points[], wxCoord xoffset, wxCoord yoffset, int WXUNUSED(fillStyle) )
{
wxCHECK_RET( Ok(), wxT("invalid window dc") );
@@ -350,14 +350,14 @@ void wxWindowDC::DoDrawPolygon( int n, wxPoint points[], long xoffset, long yoff
delete[] gdkpoints;
}
void wxWindowDC::DoDrawRectangle( long x, long y, long width, long height )
void wxWindowDC::DoDrawRectangle( wxCoord x, wxCoord y, wxCoord width, wxCoord height )
{
wxCHECK_RET( Ok(), wxT("invalid window dc") );
long xx = XLOG2DEV(x);
long yy = YLOG2DEV(y);
long ww = m_signX * XLOG2DEVREL(width);
long hh = m_signY * YLOG2DEVREL(height);
wxCoord xx = XLOG2DEV(x);
wxCoord yy = YLOG2DEV(y);
wxCoord ww = m_signX * XLOG2DEVREL(width);
wxCoord hh = m_signY * YLOG2DEVREL(height);
// CMB: draw nothing if transformed w or h is 0
if (ww == 0 || hh == 0) return;
@@ -379,17 +379,17 @@ void wxWindowDC::DoDrawRectangle( long x, long y, long width, long height )
CalcBoundingBox( x + width, y + height );
}
void wxWindowDC::DoDrawRoundedRectangle( long x, long y, long width, long height, double radius )
void wxWindowDC::DoDrawRoundedRectangle( wxCoord x, wxCoord y, wxCoord width, wxCoord height, double radius )
{
wxCHECK_RET( Ok(), wxT("invalid window dc") );
if (radius < 0.0) radius = - radius * ((width < height) ? width : height);
long xx = XLOG2DEV(x);
long yy = YLOG2DEV(y);
long ww = m_signX * XLOG2DEVREL(width);
long hh = m_signY * YLOG2DEVREL(height);
long rr = XLOG2DEVREL((long)radius);
wxCoord xx = XLOG2DEV(x);
wxCoord yy = YLOG2DEV(y);
wxCoord ww = m_signX * XLOG2DEVREL(width);
wxCoord hh = m_signY * YLOG2DEVREL(height);
wxCoord rr = XLOG2DEVREL((wxCoord)radius);
// CMB: handle -ve width and/or height
if (ww < 0) { ww = -ww; xx = xx - ww; }
@@ -418,7 +418,7 @@ void wxWindowDC::DoDrawRoundedRectangle( long x, long y, long width, long height
{
// CMB: ensure dd is not larger than rectangle otherwise we
// get an hour glass shape
long dd = 2 * rr;
wxCoord dd = 2 * rr;
if (dd > ww) dd = ww;
if (dd > hh) dd = hh;
rr = dd / 2;
@@ -451,14 +451,14 @@ void wxWindowDC::DoDrawRoundedRectangle( long x, long y, long width, long height
CalcBoundingBox( x + width, y + height );
}
void wxWindowDC::DoDrawEllipse( long x, long y, long width, long height )
void wxWindowDC::DoDrawEllipse( wxCoord x, wxCoord y, wxCoord width, wxCoord height )
{
wxCHECK_RET( Ok(), wxT("invalid window dc") );
long xx = XLOG2DEV(x);
long yy = YLOG2DEV(y);
long ww = m_signX * XLOG2DEVREL(width);
long hh = m_signY * YLOG2DEVREL(height);
wxCoord xx = XLOG2DEV(x);
wxCoord yy = YLOG2DEV(y);
wxCoord ww = m_signX * XLOG2DEVREL(width);
wxCoord hh = m_signY * YLOG2DEVREL(height);
// CMB: handle -ve width and/or height
if (ww < 0) { ww = -ww; xx = xx - ww; }
@@ -477,14 +477,14 @@ void wxWindowDC::DoDrawEllipse( long x, long y, long width, long height )
CalcBoundingBox( x + width, y + height );
}
void wxWindowDC::DoDrawIcon( const wxIcon &icon, long x, long y )
void wxWindowDC::DoDrawIcon( const wxIcon &icon, wxCoord x, wxCoord y )
{
// VZ: egcs 1.0.3 refuses to compile this without cast, no idea why
DoDrawBitmap( (const wxBitmap&)icon, x, y, (bool)TRUE );
}
void wxWindowDC::DoDrawBitmap( const wxBitmap &bitmap,
long x, long y,
wxCoord x, wxCoord y,
bool useMask )
{
wxCHECK_RET( Ok(), wxT("invalid window dc") );
@@ -559,8 +559,8 @@ void wxWindowDC::DoDrawBitmap( const wxBitmap &bitmap,
}
}
bool wxWindowDC::DoBlit( long xdest, long ydest, long width, long height,
wxDC *source, long xsrc, long ysrc,
bool wxWindowDC::DoBlit( wxCoord xdest, wxCoord ydest, wxCoord width, wxCoord height,
wxDC *source, wxCoord xsrc, wxCoord ysrc,
int logical_func, bool useMask )
{
/* this is the nth try to get this utterly useless function to
@@ -629,11 +629,11 @@ bool wxWindowDC::DoBlit( long xdest, long ydest, long width, long height,
{
/* scale/translate bitmap size */
long bm_width = memDC->m_selected.GetWidth();
long bm_height = memDC->m_selected.GetHeight();
wxCoord bm_width = memDC->m_selected.GetWidth();
wxCoord bm_height = memDC->m_selected.GetHeight();
long bm_ww = XLOG2DEVREL( bm_width );
long bm_hh = YLOG2DEVREL( bm_height );
wxCoord bm_ww = XLOG2DEVREL( bm_width );
wxCoord bm_hh = YLOG2DEVREL( bm_height );
/* scale bitmap if required */
@@ -653,11 +653,11 @@ bool wxWindowDC::DoBlit( long xdest, long ydest, long width, long height,
/* scale/translate size and position */
long xx = XLOG2DEV(xdest);
long yy = YLOG2DEV(ydest);
wxCoord xx = XLOG2DEV(xdest);
wxCoord yy = YLOG2DEV(ydest);
long ww = XLOG2DEVREL(width);
long hh = YLOG2DEVREL(height);
wxCoord ww = XLOG2DEVREL(width);
wxCoord hh = YLOG2DEVREL(height);
/* apply mask if any */
@@ -700,11 +700,11 @@ bool wxWindowDC::DoBlit( long xdest, long ydest, long width, long height,
{
/* scale/translate size and position */
long xx = XLOG2DEV(xdest);
long yy = YLOG2DEV(ydest);
wxCoord xx = XLOG2DEV(xdest);
wxCoord yy = YLOG2DEV(ydest);
long ww = XLOG2DEVREL(width);
long hh = YLOG2DEVREL(height);
wxCoord ww = XLOG2DEVREL(width);
wxCoord hh = YLOG2DEVREL(height);
if ((width != ww) || (height != hh))
{
@@ -754,7 +754,7 @@ bool wxWindowDC::DoBlit( long xdest, long ydest, long width, long height,
return TRUE;
}
void wxWindowDC::DoDrawText( const wxString &text, long x, long y )
void wxWindowDC::DoDrawText( const wxString &text, wxCoord x, wxCoord y )
{
wxCHECK_RET( Ok(), wxT("invalid window dc") );
@@ -770,8 +770,8 @@ void wxWindowDC::DoDrawText( const wxString &text, long x, long y )
/* CMB 21/5/98: draw text background if mode is wxSOLID */
if (m_backgroundMode == wxSOLID)
{
long width = gdk_string_width( font, text.mbc_str() );
long height = font->ascent + font->descent;
wxCoord width = gdk_string_width( font, text.mbc_str() );
wxCoord height = font->ascent + font->descent;
gdk_gc_set_foreground( m_textGC, m_textBackgroundColour.GetColor() );
gdk_draw_rectangle( m_window, m_textGC, TRUE, x, y, width, height );
gdk_gc_set_foreground( m_textGC, m_textForegroundColour.GetColor() );
@@ -783,42 +783,43 @@ void wxWindowDC::DoDrawText( const wxString &text, long x, long y )
properties (see wxXt implementation) */
if (m_font.GetUnderlined())
{
long width = gdk_string_width( font, text.mbc_str() );
long ul_y = y + font->ascent;
wxCoord width = gdk_string_width( font, text.mbc_str() );
wxCoord ul_y = y + font->ascent;
if (font->descent > 0) ul_y++;
gdk_draw_line( m_window, m_textGC, x, ul_y, x + width, ul_y);
}
long w, h;
wxCoord w, h;
GetTextExtent (text, &w, &h);
CalcBoundingBox (x + w, y + h);
CalcBoundingBox (x, y);
}
void wxWindowDC::GetTextExtent( const wxString &string, long *width, long *height,
long *descent, long *externalLeading,
wxFont *theFont ) const
void wxWindowDC::DoGetTextExtent(const wxString &string,
wxCoord *width, wxCoord *height,
wxCoord *descent, wxCoord *externalLeading,
wxFont *theFont) const
{
wxFont fontToUse = m_font;
if (theFont) fontToUse = *theFont;
GdkFont *font = fontToUse.GetInternalFont( m_scaleY );
if (width) (*width) = long(gdk_string_width( font, string.mbc_str() ) / m_scaleX);
if (height) (*height) = long((font->ascent + font->descent) / m_scaleY);
if (descent) (*descent) = long(font->descent / m_scaleY);
if (width) (*width) = wxCoord(gdk_string_width( font, string.mbc_str() ) / m_scaleX);
if (height) (*height) = wxCoord((font->ascent + font->descent) / m_scaleY);
if (descent) (*descent) = wxCoord(font->descent / m_scaleY);
if (externalLeading) (*externalLeading) = 0; // ??
}
long wxWindowDC::GetCharWidth() const
wxCoord wxWindowDC::GetCharWidth() const
{
GdkFont *font = m_font.GetInternalFont( m_scaleY );
return long(gdk_string_width( font, "H" ) / m_scaleX);
return wxCoord(gdk_string_width( font, "H" ) / m_scaleX);
}
long wxWindowDC::GetCharHeight() const
wxCoord wxWindowDC::GetCharHeight() const
{
GdkFont *font = m_font.GetInternalFont( m_scaleY );
return long((font->ascent + font->descent) / m_scaleY);
return wxCoord((font->ascent + font->descent) / m_scaleY);
}
void wxWindowDC::Clear()
@@ -886,7 +887,7 @@ void wxWindowDC::SetPen( const wxPen &pen )
static const char dotted[] = {1, 1};
static const char short_dashed[] = {2, 2};
static const char long_dashed[] = {2, 4};
static const char wxCoord_dashed[] = {2, 4};
static const char dotted_dashed[] = {3, 3, 1, 3};
// We express dash pattern in pen width unit, so we are
@@ -915,7 +916,7 @@ void wxWindowDC::SetPen( const wxPen &pen )
{
lineStyle = GDK_LINE_ON_OFF_DASH;
req_nb_dash = 2;
req_dash = long_dashed;
req_dash = wxCoord_dashed;
break;
}
case wxSHORT_DASH:
@@ -1168,7 +1169,7 @@ void wxWindowDC::SetPalette( const wxPalette& WXUNUSED(palette) )
wxFAIL_MSG( wxT("wxWindowDC::SetPalette not implemented") );
}
void wxWindowDC::DoSetClippingRegion( long x, long y, long width, long height )
void wxWindowDC::DoSetClippingRegion( wxCoord x, wxCoord y, wxCoord width, wxCoord height )
{
wxCHECK_RET( Ok(), wxT("invalid window dc") );

View File

@@ -4,7 +4,7 @@
// Author: Robert Roebling
// RCS-ID: $Id$
// Copyright: (c) 1998 Robert Roebling
// Licence: wxWindows licence
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifdef __GNUG__
@@ -25,15 +25,15 @@ IMPLEMENT_DYNAMIC_CLASS(wxMemoryDC,wxWindowDC)
wxMemoryDC::wxMemoryDC() : wxWindowDC()
{
m_ok = FALSE;
m_cmap = gtk_widget_get_default_colormap();
}
wxMemoryDC::wxMemoryDC( wxDC *WXUNUSED(dc) )
wxMemoryDC::wxMemoryDC( wxDC *WXUNUSED(dc) )
: wxWindowDC()
{
m_ok = FALSE;
m_cmap = gtk_widget_get_default_colormap();
}
@@ -54,13 +54,13 @@ void wxMemoryDC::SelectObject( const wxBitmap& bitmap )
{
m_window = m_selected.GetBitmap();
}
SetUpDC();
m_isMemDC = TRUE;
}
else
{
{
m_ok = FALSE;
m_window = (GdkWindow *) NULL;
}

View File

@@ -4,7 +4,7 @@
// Author: Robert Roebling
// Id: $Id$
// Copyright: (c) 1998 Robert Roebling
// Licence: wxWindows licence
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifdef __GNUG__
@@ -22,10 +22,9 @@
//-----------------------------------------------------------------------------
GdkWindow *wxScreenDC::sm_overlayWindow = (GdkWindow*) NULL;
int wxScreenDC::sm_overlayWindowX = 0;
int wxScreenDC::sm_overlayWindowY = 0;
int wxScreenDC::sm_overlayWindowX = 0;
int wxScreenDC::sm_overlayWindowY = 0;
//-----------------------------------------------------------------------------
// create X window
//-----------------------------------------------------------------------------
@@ -57,14 +56,14 @@ int my_event_masks_table[19] =
StructureNotifyMask,
PropertyChangeMask,
VisibilityChangeMask,
0, /* PROXIMITY_IN */
0 /* PROXIMTY_OUT */
0, /* PROXIMITY_IN */
0 /* PROXIMTY_OUT */
};
GdkWindow*
gdk_window_transparent_new ( GdkWindow *parent,
GdkWindowAttr *attributes,
gint attributes_mask)
GdkWindowAttr *attributes,
gint attributes_mask)
{
GdkWindow *window;
GdkWindowPrivate *gprivate;
@@ -125,7 +124,7 @@ gdk_window_transparent_new ( GdkWindow *parent,
gprivate->height = (attributes->height > 1) ? (attributes->height) : (1);
gprivate->window_type = attributes->window_type;
gprivate->extension_events = FALSE;
#if (GTK_MINOR_VERSION == 0)
gprivate->dnd_drag_data_type = None;
gprivate->dnd_drag_data_typesavail =
@@ -152,16 +151,16 @@ gdk_window_transparent_new ( GdkWindow *parent,
for (i = 0; i < my_nevent_masks; i++)
{
if (attributes->event_mask & (1 << (i + 1)))
xattributes.event_mask |= my_event_masks_table[i];
xattributes.event_mask |= my_event_masks_table[i];
}
if (xattributes.event_mask)
xattributes_mask |= CWEventMask;
if(attributes_mask & GDK_WA_NOREDIR) {
xattributes.override_redirect =
(attributes->override_redirect == FALSE)?False:True;
xattributes_mask |= CWOverrideRedirect;
xattributes.override_redirect =
(attributes->override_redirect == FALSE)?False:True;
xattributes_mask |= CWOverrideRedirect;
} else
xattributes.override_redirect = False;
@@ -169,24 +168,24 @@ gdk_window_transparent_new ( GdkWindow *parent,
depth = visual->depth;
if (attributes_mask & GDK_WA_COLORMAP)
gprivate->colormap = attributes->colormap;
gprivate->colormap = attributes->colormap;
else
gprivate->colormap = gdk_colormap_get_system ();
gprivate->colormap = gdk_colormap_get_system ();
xattributes.colormap = ((GdkColormapPrivate*) gprivate->colormap)->xcolormap;
xattributes_mask |= CWColormap;
xattributes.colormap = ((GdkColormapPrivate*) gprivate->colormap)->xcolormap;
xattributes_mask |= CWColormap;
xparent = gdk_root_window;
xparent = gdk_root_window;
xattributes.save_under = True;
xattributes.override_redirect = True;
xattributes.cursor = None;
xattributes_mask |= CWSaveUnder | CWOverrideRedirect;
xattributes.save_under = True;
xattributes.override_redirect = True;
xattributes.cursor = None;
xattributes_mask |= CWSaveUnder | CWOverrideRedirect;
gprivate->xwindow = XCreateWindow (gprivate->xdisplay, xparent,
x, y, gprivate->width, gprivate->height,
0, depth, gclass, xvisual,
xattributes_mask, &xattributes);
x, y, gprivate->width, gprivate->height,
0, depth, gclass, xvisual,
xattributes_mask, &xattributes);
gdk_window_ref (window);
gdk_xid_table_insert (&gprivate->xwindow, window);
@@ -246,12 +245,12 @@ gdk_window_transparent_new ( GdkWindow *parent,
IMPLEMENT_DYNAMIC_CLASS(wxScreenDC,wxPaintDC)
wxScreenDC::wxScreenDC(void)
wxScreenDC::wxScreenDC()
{
m_ok = FALSE;
m_window = (GdkWindow *) NULL;
m_cmap = gdk_colormap_get_system();
if (sm_overlayWindow)
{
m_window = sm_overlayWindow;
@@ -262,16 +261,16 @@ wxScreenDC::wxScreenDC(void)
{
m_window = GDK_ROOT_PARENT();
}
SetUpDC();
gdk_gc_set_subwindow( m_penGC, GDK_INCLUDE_INFERIORS );
gdk_gc_set_subwindow( m_brushGC, GDK_INCLUDE_INFERIORS );
gdk_gc_set_subwindow( m_textGC, GDK_INCLUDE_INFERIORS );
gdk_gc_set_subwindow( m_bgGC, GDK_INCLUDE_INFERIORS );
}
wxScreenDC::~wxScreenDC(void)
wxScreenDC::~wxScreenDC()
{
EndDrawingOnTop();
}
@@ -279,7 +278,7 @@ wxScreenDC::~wxScreenDC(void)
bool wxScreenDC::StartDrawingOnTop( wxWindow *window )
{
if (!window) return StartDrawingOnTop();
int x = 0;
int y = 0;
window->GetPosition( &x, &y );
@@ -287,13 +286,13 @@ bool wxScreenDC::StartDrawingOnTop( wxWindow *window )
int h = 0;
window->GetSize( &w, &h );
window->ClientToScreen( &x, &y );
wxRect rect;
rect.x = x;
rect.y = y;
rect.width = 0;
rect.height = 0;
return StartDrawingOnTop( &rect );
}
@@ -310,7 +309,7 @@ bool wxScreenDC::StartDrawingOnTop( wxRect *rect )
width = rect->width;
height = rect->height;
}
sm_overlayWindowX = x;
sm_overlayWindowY = y;
@@ -323,23 +322,23 @@ bool wxScreenDC::StartDrawingOnTop( wxRect *rect )
attr.wclass = GDK_INPUT_OUTPUT;
attr.event_mask = 0;
attr.window_type = GDK_WINDOW_TEMP;
// GTK cannot set transparent backgrounds. :-(
sm_overlayWindow = gdk_window_transparent_new( NULL, &attr, GDK_WA_NOREDIR | GDK_WA_X | GDK_WA_Y );
if (sm_overlayWindow) gdk_window_show( sm_overlayWindow );
return (sm_overlayWindow != NULL);
}
bool wxScreenDC::EndDrawingOnTop(void)
bool wxScreenDC::EndDrawingOnTop()
{
if (sm_overlayWindow) gdk_window_destroy( sm_overlayWindow );
sm_overlayWindow = NULL;
sm_overlayWindowX = 0;
sm_overlayWindowY = 0;
return TRUE;
}

View File

@@ -24,7 +24,7 @@
#include "wx/wx.h"
#endif
#if wxUSE_PRINTING_ARCHITECTURE
#if wxUSE_HTML & wxUSE_PRINTING_ARCHITECTURE
#include "wx/print.h"
#include "wx/printdlg.h"
@@ -565,4 +565,4 @@ wxHtmlPrintout *wxHtmlEasyPrinting::CreatePrintout()
#endif // wxUSE_PRINTING_ARCHITECTURE
#endif // wxUSE_HTML & wxUSE_PRINTING_ARCHITECTURE

View File

@@ -53,11 +53,6 @@
extern char *wxBuffer;
extern wxList wxPendingDelete;
#if wxUSE_THREADS
extern wxList *wxPendingEvents;
extern wxCriticalSection *wxPendingEventsLocker;
#endif // wxUSE_THREADS
wxApp *wxTheApp = NULL;
wxHashTable *wxWidgetHashTable = NULL;
@@ -81,7 +76,6 @@ bool wxApp::Initialize()
// GL: I'm annoyed ... I don't know where to put this and I don't want to
// create a module for that as it's part of the core.
#if wxUSE_THREADS
wxPendingEvents = new wxList();
wxPendingEventsLocker = new wxCriticalSection();
#endif
@@ -549,24 +543,6 @@ void wxApp::DeletePendingObjects()
}
}
#if wxUSE_THREADS
void wxApp::ProcessPendingEvents()
{
wxNode *node = wxPendingEvents->First();
wxCriticalSectionLocker locker(*wxPendingEventsLocker);
while (node)
{
wxEvtHandler *handler = (wxEvtHandler *)node->Data();
handler->ProcessPendingEvents();
delete node;
node = wxPendingEvents->First();
}
}
#endif // wxUSE_THREADS
// Create an application context
bool wxApp::OnInitGui()
{

View File

@@ -27,12 +27,6 @@ wxWindowList wxTopLevelWindows;
// List of windows pending deletion
wxList wxPendingDelete;
#if wxUSE_THREADS
// List of events pending propagation
wxList *wxPendingEvents = NULL;
wxCriticalSection *wxPendingEventsLocker = NULL;
#endif
int wxPageNumber;
// GDI Object Lists

View File

@@ -19,7 +19,6 @@
#ifdef __GNUG__
#pragma implementation "app.h"
#pragma implementation "appbase.h"
#endif
// For compilers that support precompilation, includes "wx.h".
@@ -44,8 +43,8 @@
#include "wx/msgdlg.h"
#include "wx/intl.h"
#include "wx/dynarray.h"
# include "wx/wxchar.h"
# include "wx/icon.h"
#include "wx/wxchar.h"
#include "wx/icon.h"
#endif
#include "wx/log.h"
@@ -924,28 +923,6 @@ bool wxApp::ProcessIdle()
return event.MoreRequested();
}
void wxApp::ProcessPendingEvents()
{
#if wxUSE_THREADS
// ensure that we're the only thread to modify the pending events list
wxCriticalSectionLocker locker(*wxPendingEventsLocker);
#endif
if ( !wxPendingEvents )
return;
wxNode *node = wxPendingEvents->First();
while (node)
{
wxEvtHandler *handler = (wxEvtHandler *)node->Data();
handler->ProcessPendingEvents();
delete node;
node = wxPendingEvents->First();
}
}
void wxApp::ExitMainLoop()
{
m_keepGoing = FALSE;

View File

@@ -164,7 +164,7 @@ void wxDC::SelectOldObjects(WXHDC dc)
// clipping
// ---------------------------------------------------------------------------
void wxDC::DoSetClippingRegion(long cx, long cy, long cw, long ch)
void wxDC::DoSetClippingRegion(wxCoord cx, wxCoord cy, wxCoord cw, wxCoord ch)
{
m_clipping = TRUE;
m_clipX1 = (int)cx;
@@ -273,7 +273,7 @@ void wxDC::Clear()
::SetWindowOrgEx(GetHdc(), (int)m_logicalOriginX, (int)m_logicalOriginY, NULL);
}
void wxDC::DoFloodFill(long x, long y, const wxColour& col, int style)
void wxDC::DoFloodFill(wxCoord x, wxCoord y, const wxColour& col, int style)
{
(void)ExtFloodFill(GetHdc(), XLOG2DEV(x), YLOG2DEV(y),
col.GetPixel(),
@@ -283,7 +283,7 @@ void wxDC::DoFloodFill(long x, long y, const wxColour& col, int style)
CalcBoundingBox(x, y);
}
bool wxDC::DoGetPixel(long x, long y, wxColour *col) const
bool wxDC::DoGetPixel(wxCoord x, wxCoord y, wxColour *col) const
{
// added by steve 29.12.94 (copied from DrawPoint)
// returns TRUE for pixels in the color of the current pen
@@ -308,12 +308,12 @@ bool wxDC::DoGetPixel(long x, long y, wxColour *col) const
return(pixelcolor==pencolor);
}
void wxDC::DoCrossHair(long x, long y)
void wxDC::DoCrossHair(wxCoord x, wxCoord y)
{
long x1 = x-VIEWPORT_EXTENT;
long y1 = y-VIEWPORT_EXTENT;
long x2 = x+VIEWPORT_EXTENT;
long y2 = y+VIEWPORT_EXTENT;
wxCoord x1 = x-VIEWPORT_EXTENT;
wxCoord y1 = y-VIEWPORT_EXTENT;
wxCoord x2 = x+VIEWPORT_EXTENT;
wxCoord y2 = y+VIEWPORT_EXTENT;
(void)MoveToEx(GetHdc(), XLOG2DEV(x1), YLOG2DEV(y), NULL);
(void)LineTo(GetHdc(), XLOG2DEV(x2), YLOG2DEV(y));
@@ -325,7 +325,7 @@ void wxDC::DoCrossHair(long x, long y)
CalcBoundingBox(x2, y2);
}
void wxDC::DoDrawLine(long x1, long y1, long x2, long y2)
void wxDC::DoDrawLine(wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2)
{
(void)MoveToEx(GetHdc(), XLOG2DEV(x1), YLOG2DEV(y1), NULL);
(void)LineTo(GetHdc(), XLOG2DEV(x2), YLOG2DEV(y2));
@@ -339,30 +339,30 @@ void wxDC::DoDrawLine(long x1, long y1, long x2, long y2)
CalcBoundingBox(x2, y2);
}
void wxDC::DoDrawArc(long x1,long y1,long x2,long y2, long xc, long yc)
void wxDC::DoDrawArc(wxCoord x1,wxCoord y1,wxCoord x2,wxCoord y2, wxCoord xc, wxCoord yc)
{
double dx = xc-x1;
double dy = yc-y1;
double radius = (double)sqrt(dx*dx+dy*dy) ;;
if (x1==x2 && x2==y2)
{
DrawEllipse(xc,yc,(long)(radius*2.0),(long)(radius*2.0));
DrawEllipse(xc,yc,(wxCoord)(radius*2.0),(wxCoord)(radius*2.0));
return;
}
long xx1 = XLOG2DEV(x1);
long yy1 = YLOG2DEV(y1);
long xx2 = XLOG2DEV(x2);
long yy2 = YLOG2DEV(y2);
long xxc = XLOG2DEV(xc);
long yyc = YLOG2DEV(yc);
long ray = (long) sqrt(double((xxc-xx1)*(xxc-xx1)+(yyc-yy1)*(yyc-yy1)));
wxCoord xx1 = XLOG2DEV(x1);
wxCoord yy1 = YLOG2DEV(y1);
wxCoord xx2 = XLOG2DEV(x2);
wxCoord yy2 = YLOG2DEV(y2);
wxCoord xxc = XLOG2DEV(xc);
wxCoord yyc = YLOG2DEV(yc);
wxCoord ray = (wxCoord) sqrt(double((xxc-xx1)*(xxc-xx1)+(yyc-yy1)*(yyc-yy1)));
(void)MoveToEx(GetHdc(), (int) xx1, (int) yy1, NULL);
long xxx1 = (long) (xxc-ray);
long yyy1 = (long) (yyc-ray);
long xxx2 = (long) (xxc+ray);
long yyy2 = (long) (yyc+ray);
wxCoord xxx1 = (wxCoord) (xxc-ray);
wxCoord yyy1 = (wxCoord) (yyc-ray);
wxCoord xxx2 = (wxCoord) (xxc+ray);
wxCoord yyy2 = (wxCoord) (yyc+ray);
if (m_brush.Ok() && m_brush.GetStyle() !=wxTRANSPARENT)
{
// Have to add 1 to bottom-right corner of rectangle
@@ -377,11 +377,11 @@ void wxDC::DoDrawArc(long x1,long y1,long x2,long y2, long xc, long yc)
Arc(GetHdc(),xxx1,yyy1,xxx2,yyy2,
xx1,yy1,xx2,yy2);
CalcBoundingBox((long)(xc-radius), (long)(yc-radius));
CalcBoundingBox((long)(xc+radius), (long)(yc+radius));
CalcBoundingBox((wxCoord)(xc-radius), (wxCoord)(yc-radius));
CalcBoundingBox((wxCoord)(xc+radius), (wxCoord)(yc+radius));
}
void wxDC::DoDrawPoint(long x, long y)
void wxDC::DoDrawPoint(wxCoord x, wxCoord y)
{
COLORREF color = 0x00ffffff;
if (m_pen.Ok())
@@ -394,7 +394,7 @@ void wxDC::DoDrawPoint(long x, long y)
CalcBoundingBox(x, y);
}
void wxDC::DoDrawPolygon(int n, wxPoint points[], long xoffset, long yoffset,int fillStyle)
void wxDC::DoDrawPolygon(int n, wxPoint points[], wxCoord xoffset, wxCoord yoffset,int fillStyle)
{
// Do things less efficiently if we have offsets
if (xoffset != 0 || yoffset != 0)
@@ -425,7 +425,7 @@ void wxDC::DoDrawPolygon(int n, wxPoint points[], long xoffset, long yoffset,int
}
}
void wxDC::DoDrawLines(int n, wxPoint points[], long xoffset, long yoffset)
void wxDC::DoDrawLines(int n, wxPoint points[], wxCoord xoffset, wxCoord yoffset)
{
// Do things less efficiently if we have offsets
if (xoffset != 0 || yoffset != 0)
@@ -452,10 +452,10 @@ void wxDC::DoDrawLines(int n, wxPoint points[], long xoffset, long yoffset)
}
}
void wxDC::DoDrawRectangle(long x, long y, long width, long height)
void wxDC::DoDrawRectangle(wxCoord x, wxCoord y, wxCoord width, wxCoord height)
{
long x2 = x + width;
long y2 = y + height;
wxCoord x2 = x + width;
wxCoord y2 = y + height;
/* MATTHEW: [6] new normalization */
#if WX_STANDARD_GRAPHICS
@@ -496,7 +496,7 @@ void wxDC::DoDrawRectangle(long x, long y, long width, long height)
CalcBoundingBox(x2, y2);
}
void wxDC::DoDrawRoundedRectangle(long x, long y, long width, long height, double radius)
void wxDC::DoDrawRoundedRectangle(wxCoord x, wxCoord y, wxCoord width, wxCoord height, double radius)
{
// Now, a negative radius value is interpreted to mean
// 'the proportion of the smallest X or Y dimension'
@@ -511,8 +511,8 @@ void wxDC::DoDrawRoundedRectangle(long x, long y, long width, long height, doubl
radius = (- radius * smallest);
}
long x2 = (x+width);
long y2 = (y+height);
wxCoord x2 = (x+width);
wxCoord y2 = (y+height);
(void)RoundRect(GetHdc(), XLOG2DEV(x), YLOG2DEV(y), XLOG2DEV(x2),
YLOG2DEV(y2), (int) (2*XLOG2DEV(radius)), (int)( 2*YLOG2DEV(radius)));
@@ -521,10 +521,10 @@ void wxDC::DoDrawRoundedRectangle(long x, long y, long width, long height, doubl
CalcBoundingBox(x2, y2);
}
void wxDC::DoDrawEllipse(long x, long y, long width, long height)
void wxDC::DoDrawEllipse(wxCoord x, wxCoord y, wxCoord width, wxCoord height)
{
long x2 = (x+width);
long y2 = (y+height);
wxCoord x2 = (x+width);
wxCoord y2 = (y+height);
(void)Ellipse(GetHdc(), XLOG2DEV(x), YLOG2DEV(y), XLOG2DEV(x2), YLOG2DEV(y2));
@@ -533,10 +533,10 @@ void wxDC::DoDrawEllipse(long x, long y, long width, long height)
}
// Chris Breeze 20/5/98: first implementation of DrawEllipticArc on Windows
void wxDC::DoDrawEllipticArc(long x,long y,long w,long h,double sa,double ea)
void wxDC::DoDrawEllipticArc(wxCoord x,wxCoord y,wxCoord w,wxCoord h,double sa,double ea)
{
long x2 = (x+w);
long y2 = (y+h);
wxCoord x2 = (x+w);
wxCoord y2 = (y+h);
const double deg2rad = 3.14159265359 / 180.0;
int rx1 = XLOG2DEV(x+w/2);
@@ -569,7 +569,7 @@ void wxDC::DoDrawEllipticArc(long x,long y,long w,long h,double sa,double ea)
CalcBoundingBox(x2, y2);
}
void wxDC::DoDrawIcon(const wxIcon& icon, long x, long y)
void wxDC::DoDrawIcon(const wxIcon& icon, wxCoord x, wxCoord y)
{
#if defined(__WIN32__) && !defined(__SC__) && !defined(__TWIN32__)
::DrawIconEx(GetHdc(), XLOG2DEV(x), YLOG2DEV(y), (HICON) icon.GetHICON(),
@@ -582,7 +582,7 @@ void wxDC::DoDrawIcon(const wxIcon& icon, long x, long y)
CalcBoundingBox(x+icon.GetWidth(), y+icon.GetHeight());
}
void wxDC::DoDrawBitmap( const wxBitmap &bmp, long x, long y, bool useMask )
void wxDC::DoDrawBitmap( const wxBitmap &bmp, wxCoord x, wxCoord y, bool useMask )
{
if (!bmp.Ok())
return;
@@ -623,7 +623,7 @@ void wxDC::DoDrawBitmap( const wxBitmap &bmp, long x, long y, bool useMask )
}
}
void wxDC::DoDrawText(const wxString& text, long x, long y)
void wxDC::DoDrawText(const wxString& text, wxCoord x, wxCoord y)
{
if (m_textForegroundColour.Ok())
SetTextColor(GetHdc(), m_textForegroundColour.GetPixel() );
@@ -650,7 +650,7 @@ void wxDC::DoDrawText(const wxString& text, long x, long y)
CalcBoundingBox(x, y);
long w, h;
wxCoord w, h;
GetTextExtent(text, &w, &h);
CalcBoundingBox((x + w), (y + h));
}
@@ -901,7 +901,7 @@ void wxDC::EndPage()
// text metrics
// ---------------------------------------------------------------------------
long wxDC::GetCharHeight() const
wxCoord wxDC::GetCharHeight() const
{
TEXTMETRIC lpTextMetric;
@@ -910,7 +910,7 @@ long wxDC::GetCharHeight() const
return YDEV2LOGREL(lpTextMetric.tmHeight);
}
long wxDC::GetCharWidth() const
wxCoord wxDC::GetCharWidth() const
{
TEXTMETRIC lpTextMetric;
@@ -919,9 +919,9 @@ long wxDC::GetCharWidth() const
return XDEV2LOGREL(lpTextMetric.tmAveCharWidth);
}
void wxDC::GetTextExtent(const wxString& string, long *x, long *y,
long *descent, long *externalLeading,
wxFont *theFont) const
void wxDC::DoGetTextExtent(const wxString& string, wxCoord *x, wxCoord *y,
wxCoord *descent, wxCoord *externalLeading,
wxFont *theFont) const
{
wxFont *fontToUse = (wxFont*) theFont;
if (!fontToUse)
@@ -1031,7 +1031,7 @@ void wxDC::SetSystemScale(double x, double y)
SetMapMode(m_mappingMode);
}
void wxDC::SetLogicalOrigin(long x, long y)
void wxDC::SetLogicalOrigin(wxCoord x, wxCoord y)
{
m_logicalOriginX = x;
m_logicalOriginY = y;
@@ -1039,7 +1039,7 @@ void wxDC::SetLogicalOrigin(long x, long y)
::SetWindowOrgEx(GetHdc(), (int)m_logicalOriginX, (int)m_logicalOriginY, NULL);
}
void wxDC::SetDeviceOrigin(long x, long y)
void wxDC::SetDeviceOrigin(wxCoord x, wxCoord y)
{
m_deviceOriginX = x;
m_deviceOriginY = y;
@@ -1051,56 +1051,56 @@ void wxDC::SetDeviceOrigin(long x, long y)
// coordinates transformations
// ---------------------------------------------------------------------------
long wxDCBase::DeviceToLogicalX(long x) const
wxCoord wxDCBase::DeviceToLogicalX(wxCoord x) const
{
return (long) (((x) - m_deviceOriginX)/(m_logicalScaleX*m_userScaleX*m_signX*m_scaleX) - m_logicalOriginX);
return (wxCoord) (((x) - m_deviceOriginX)/(m_logicalScaleX*m_userScaleX*m_signX*m_scaleX) - m_logicalOriginX);
}
long wxDCBase::DeviceToLogicalXRel(long x) const
wxCoord wxDCBase::DeviceToLogicalXRel(wxCoord x) const
{
return (long) ((x)/(m_logicalScaleX*m_userScaleX*m_signX*m_scaleX));
return (wxCoord) ((x)/(m_logicalScaleX*m_userScaleX*m_signX*m_scaleX));
}
long wxDCBase::DeviceToLogicalY(long y) const
wxCoord wxDCBase::DeviceToLogicalY(wxCoord y) const
{
return (long) (((y) - m_deviceOriginY)/(m_logicalScaleY*m_userScaleY*m_signY*m_scaleY) - m_logicalOriginY);
return (wxCoord) (((y) - m_deviceOriginY)/(m_logicalScaleY*m_userScaleY*m_signY*m_scaleY) - m_logicalOriginY);
}
long wxDCBase::DeviceToLogicalYRel(long y) const
wxCoord wxDCBase::DeviceToLogicalYRel(wxCoord y) const
{
return (long) ((y)/(m_logicalScaleY*m_userScaleY*m_signY*m_scaleY));
return (wxCoord) ((y)/(m_logicalScaleY*m_userScaleY*m_signY*m_scaleY));
}
long wxDCBase::LogicalToDeviceX(long x) const
wxCoord wxDCBase::LogicalToDeviceX(wxCoord x) const
{
return (long) ((x - m_logicalOriginX)*m_logicalScaleX*m_userScaleX*m_signX*m_scaleX + m_deviceOriginX);
return (wxCoord) ((x - m_logicalOriginX)*m_logicalScaleX*m_userScaleX*m_signX*m_scaleX + m_deviceOriginX);
}
long wxDCBase::LogicalToDeviceXRel(long x) const
wxCoord wxDCBase::LogicalToDeviceXRel(wxCoord x) const
{
return (long) (x*m_logicalScaleX*m_userScaleX*m_signX*m_scaleX);
return (wxCoord) (x*m_logicalScaleX*m_userScaleX*m_signX*m_scaleX);
}
long wxDCBase::LogicalToDeviceY(long y) const
wxCoord wxDCBase::LogicalToDeviceY(wxCoord y) const
{
return (long) ((y - m_logicalOriginY)*m_logicalScaleY*m_userScaleY*m_signY*m_scaleY + m_deviceOriginY);
return (wxCoord) ((y - m_logicalOriginY)*m_logicalScaleY*m_userScaleY*m_signY*m_scaleY + m_deviceOriginY);
}
long wxDCBase::LogicalToDeviceYRel(long y) const
wxCoord wxDCBase::LogicalToDeviceYRel(wxCoord y) const
{
return (long) (y*m_logicalScaleY*m_userScaleY*m_signY*m_scaleY);
return (wxCoord) (y*m_logicalScaleY*m_userScaleY*m_signY*m_scaleY);
}
// ---------------------------------------------------------------------------
// bit blit
// ---------------------------------------------------------------------------
bool wxDC::DoBlit(long xdest, long ydest, long width, long height,
wxDC *source, long xsrc, long ysrc, int rop, bool useMask)
bool wxDC::DoBlit(wxCoord xdest, wxCoord ydest, wxCoord width, wxCoord height,
wxDC *source, wxCoord xsrc, wxCoord ysrc, int rop, bool useMask)
{
long xdest1 = xdest;
long ydest1 = ydest;
long xsrc1 = xsrc;
long ysrc1 = ysrc;
wxCoord xdest1 = xdest;
wxCoord ydest1 = ydest;
wxCoord xsrc1 = xsrc;
wxCoord ysrc1 = ysrc;
// Chris Breeze 18/5/98: use text foreground/background colours
// when blitting from 1-bit bitmaps
@@ -1295,7 +1295,7 @@ void wxDC::DoGetTextExtent(const wxString& string, float *x, float *y,
float *descent, float *externalLeading,
wxFont *theFont, bool use16bit) const
{
long x1, y1, descent1, externalLeading1;
wxCoord x1, y1, descent1, externalLeading1;
GetTextExtent(string, & x1, & y1, & descent1, & externalLeading1, theFont, use16bit);
*x = x1; *y = y1;
if (descent)

View File

@@ -1,6 +1,6 @@
# This file was automatically generated by tmake at 22:30, 1999/10/16
# This file was automatically generated by tmake at 15:50, 1999/10/18
# DO NOT CHANGE THIS FILE, YOUR CHANGES WILL BE LOST! CHANGE B32.T!
#
@@ -109,6 +109,7 @@ GENERICOBJS= $(MSWDIR)\busyinfo.obj \
COMMONOBJS = \
$(MSWDIR)\y_tab.obj \
$(MSWDIR)\appcmn.obj \
$(MSWDIR)\choiccmn.obj \
$(MSWDIR)\cmndata.obj \
$(MSWDIR)\config.obj \
@@ -525,6 +526,8 @@ $(MSWDIR)\xpmhand.obj: $(MSWDIR)\xpmhand.$(SRCSUFF)
########################################################
# Common objects (always compiled)
$(MSWDIR)\appcmn.obj: $(COMMDIR)\appcmn.$(SRCSUFF)
$(MSWDIR)\choiccmn.obj: $(COMMDIR)\choiccmn.$(SRCSUFF)
$(MSWDIR)\cmndata.obj: $(COMMDIR)\cmndata.$(SRCSUFF)

View File

@@ -1,6 +1,6 @@
# This file was automatically generated by tmake at 22:30, 1999/10/16
# This file was automatically generated by tmake at 15:50, 1999/10/18
# DO NOT CHANGE THIS FILE, YOUR CHANGES WILL BE LOST! CHANGE BCC.T!
#
@@ -100,6 +100,7 @@ GENERICOBJS= $(MSWDIR)\busyinfo.obj \
COMMONOBJS = \
$(MSWDIR)\y_tab.obj \
$(MSWDIR)\appcmn.obj \
$(MSWDIR)\choiccmn.obj \
$(MSWDIR)\cmndata.obj \
$(MSWDIR)\config.obj \
@@ -433,6 +434,8 @@ $(MSWDIR)\xpmhand.obj: $(MSWDIR)\xpmhand.$(SRCSUFF)
########################################################
# Common objects (always compiled)
$(MSWDIR)\appcmn.obj: $(COMMDIR)\appcmn.$(SRCSUFF)
$(MSWDIR)\choiccmn.obj: $(COMMDIR)\choiccmn.$(SRCSUFF)
$(MSWDIR)\cmndata.obj: $(COMMDIR)\cmndata.$(SRCSUFF)

View File

@@ -1,6 +1,6 @@
# This file was automatically generated by tmake at 22:30, 1999/10/16
# This file was automatically generated by tmake at 15:50, 1999/10/18
# DO NOT CHANGE THIS FILE, YOUR CHANGES WILL BE LOST! CHANGE DOS.T!
#
@@ -87,6 +87,7 @@ GENERICOBJS= $(GENDIR)\busyinfo.obj \
COMMONOBJS = \
$(COMMDIR)\y_tab.obj \
$(COMMDIR)\appcmn.obj \
$(COMMDIR)\choiccmn.obj \
$(COMMDIR)\cmndata.obj \
$(COMMDIR)\config.obj \
@@ -677,6 +678,11 @@ $(MSWDIR)/xpmhand.obj: $*.$(SRCSUFF)
$(CPPFLAGS) /Fo$@ /c /Tp $*.$(SRCSUFF)
<<
$(COMMDIR)/appcmn.obj: $*.$(SRCSUFF)
cl @<<
$(CPPFLAGS) /Fo$@ /c /Tp $*.$(SRCSUFF)
<<
$(COMMDIR)/choiccmn.obj: $*.$(SRCSUFF)
cl @<<
$(CPPFLAGS) /Fo$@ /c /Tp $*.$(SRCSUFF)

View File

@@ -1,5 +1,5 @@
# This file was automatically generated by tmake at 22:30, 1999/10/16
# This file was automatically generated by tmake at 15:50, 1999/10/18
# DO NOT CHANGE THIS FILE, YOUR CHANGES WILL BE LOST! CHANGE G95.T!
#
@@ -60,6 +60,7 @@ GENERICOBJS = \
COMMONOBJS = \
$(COMMDIR)/y_tab.$(OBJSUFF) \
$(COMMDIR)/appcmn.$(OBJSUFF) \
$(COMMDIR)/choiccmn.$(OBJSUFF) \
$(COMMDIR)/cmndata.$(OBJSUFF) \
$(COMMDIR)/config.$(OBJSUFF) \

View File

@@ -1,6 +1,6 @@
# This file was automatically generated by tmake at 22:30, 1999/10/16
# This file was automatically generated by tmake at 15:50, 1999/10/18
# DO NOT CHANGE THIS FILE, YOUR CHANGES WILL BE LOST! CHANGE SC.T!
# Symantec C++ makefile for the msw objects
@@ -48,6 +48,7 @@ GENERICOBJS= $(GENDIR)\busyinfo.obj \
COMMONOBJS = \
$(COMMDIR)\y_tab.obj \
$(COMMDIR)\appcmn.obj \
$(COMMDIR)\choiccmn.obj \
$(COMMDIR)\cmndata.obj \
$(COMMDIR)\config.obj \

View File

@@ -1,4 +1,4 @@
# This file was automatically generated by tmake at 22:30, 1999/10/16
# This file was automatically generated by tmake at 15:50, 1999/10/18
# DO NOT CHANGE THIS FILE, YOUR CHANGES WILL BE LOST! CHANGE VC.T!
# File: makefile.vc
@@ -125,6 +125,7 @@ NONESSENTIALOBJS= ..\generic\$D\caret.obj \
COMMONOBJS = \
..\common\$D\y_tab.obj \
..\common\$D\appcmn.obj \
..\common\$D\choiccmn.obj \
..\common\$D\cmndata.obj \
..\common\$D\config.obj \

View File

@@ -1,6 +1,6 @@
# This file was automatically generated by tmake at 22:30, 1999/10/16
# This file was automatically generated by tmake at 15:50, 1999/10/18
# DO NOT CHANGE THIS FILE, YOUR CHANGES WILL BE LOST! CHANGE WAT.T!
#!/binb/wmake.exe
@@ -74,6 +74,7 @@ NONESSENTIALOBJS= caret.obj &
COMMONOBJS = &
y_tab.obj &
appcmn.obj &
choiccmn.obj &
cmndata.obj &
config.obj &
@@ -556,6 +557,9 @@ xpmhand.obj: $(MSWDIR)\xpmhand.cpp
########################################################
# Common objects (always compiled)
appcmn.obj: $(COMMDIR)\appcmn.cpp
*$(CCC) $(CPPFLAGS) $(IFLAGS) $<
choiccmn.obj: $(COMMDIR)\choiccmn.cpp
*$(CCC) $(CPPFLAGS) $(IFLAGS) $<