Added a couple of const to == and != operators.

Removed no-flicker hack which seems to be a
   problem on Sun.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_2_BRANCH@7415 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robert Roebling
2000-05-17 20:07:24 +00:00
parent a5fc62d05d
commit 1b51ff0849
14 changed files with 24 additions and 144 deletions

View File

@@ -70,8 +70,8 @@ public:
wxBitmap( const wxString &filename, int type = wxBITMAP_TYPE_XPM );
~wxBitmap();
wxBitmap& operator = ( const wxBitmap& bmp );
bool operator == ( const wxBitmap& bmp );
bool operator != ( const wxBitmap& bmp );
bool operator == ( const wxBitmap& bmp ) const;
bool operator != ( const wxBitmap& bmp ) const;
bool Ok() const;
bool Create(int width, int height, int depth = -1);

View File

@@ -40,8 +40,8 @@ public:
wxBrush( const wxBrush &brush );
~wxBrush();
wxBrush& operator = ( const wxBrush& brush );
bool operator == ( const wxBrush& brush );
bool operator != ( const wxBrush& brush );
bool operator == ( const wxBrush& brush ) const;
bool operator != ( const wxBrush& brush ) const;
bool Ok() const;
int GetStyle() const;

View File

@@ -45,8 +45,8 @@ public:
wxPen( const wxPen& pen );
~wxPen();
wxPen& operator = ( const wxPen& pen );
bool operator == ( const wxPen& pen );
bool operator != ( const wxPen& pen );
bool operator == ( const wxPen& pen ) const;
bool operator != ( const wxPen& pen ) const;
void SetColour( const wxColour &colour );
void SetColour( int red, int green, int blue );

View File

@@ -70,8 +70,8 @@ public:
wxBitmap( const wxString &filename, int type = wxBITMAP_TYPE_XPM );
~wxBitmap();
wxBitmap& operator = ( const wxBitmap& bmp );
bool operator == ( const wxBitmap& bmp );
bool operator != ( const wxBitmap& bmp );
bool operator == ( const wxBitmap& bmp ) const;
bool operator != ( const wxBitmap& bmp ) const;
bool Ok() const;
bool Create(int width, int height, int depth = -1);

View File

@@ -40,8 +40,8 @@ public:
wxBrush( const wxBrush &brush );
~wxBrush();
wxBrush& operator = ( const wxBrush& brush );
bool operator == ( const wxBrush& brush );
bool operator != ( const wxBrush& brush );
bool operator == ( const wxBrush& brush ) const;
bool operator != ( const wxBrush& brush ) const;
bool Ok() const;
int GetStyle() const;

View File

@@ -45,8 +45,8 @@ public:
wxPen( const wxPen& pen );
~wxPen();
wxPen& operator = ( const wxPen& pen );
bool operator == ( const wxPen& pen );
bool operator != ( const wxPen& pen );
bool operator == ( const wxPen& pen ) const;
bool operator != ( const wxPen& pen ) const;
void SetColour( const wxColour &colour );
void SetColour( int red, int green, int blue );

View File

@@ -351,12 +351,12 @@ wxBitmap& wxBitmap::operator = ( const wxBitmap& bmp )
return *this;
}
bool wxBitmap::operator == ( const wxBitmap& bmp )
bool wxBitmap::operator == ( const wxBitmap& bmp ) const
{
return m_refData == bmp.m_refData;
}
bool wxBitmap::operator != ( const wxBitmap& bmp )
bool wxBitmap::operator != ( const wxBitmap& bmp ) const
{
return m_refData != bmp.m_refData;
}

View File

@@ -96,12 +96,12 @@ wxBrush& wxBrush::operator = ( const wxBrush& brush )
return *this;
}
bool wxBrush::operator == ( const wxBrush& brush )
bool wxBrush::operator == ( const wxBrush& brush ) const
{
return m_refData == brush.m_refData;
}
bool wxBrush::operator != ( const wxBrush& brush )
bool wxBrush::operator != ( const wxBrush& brush ) const
{
return m_refData != brush.m_refData;
}

View File

@@ -100,12 +100,12 @@ wxPen& wxPen::operator = ( const wxPen& pen )
return *this;
}
bool wxPen::operator == ( const wxPen& pen )
bool wxPen::operator == ( const wxPen& pen ) const
{
return m_refData == pen.m_refData;
}
bool wxPen::operator != ( const wxPen& pen )
bool wxPen::operator != ( const wxPen& pen ) const
{
return m_refData != pen.m_refData;
}

View File

@@ -636,9 +636,6 @@ static int gtk_window_expose_callback( GtkWidget *widget, GdkEventExpose *gdk_ev
}
*/
if (!win->m_queuedFullRedraw)
{
win->GetUpdateRegion().Union( gdk_event->area.x,
gdk_event->area.y,
gdk_event->area.width,
@@ -683,7 +680,6 @@ static int gtk_window_expose_callback( GtkWidget *widget, GdkEventExpose *gdk_ev
gtk_widget_event (child->widget, (GdkEvent*) &child_event);
}
}
}
return TRUE;
}
@@ -738,9 +734,6 @@ static void gtk_window_draw_callback( GtkWidget *widget, GdkRectangle *rect, wxW
GtkPizza *pizza = GTK_PIZZA (widget);
if (!win->m_queuedFullRedraw)
{
if (!(GTK_WIDGET_APP_PAINTABLE (widget)) &&
(pizza->clear_on_draw))
{
@@ -777,7 +770,6 @@ static void gtk_window_draw_callback( GtkWidget *widget, GdkRectangle *rect, wxW
gtk_widget_draw (child->widget, &child_area /* (GdkRectangle*) NULL*/ );
}
}
}
}
//-----------------------------------------------------------------------------
@@ -2062,7 +2054,6 @@ void wxWindow::Init()
m_acceptsFocus = FALSE;
m_clipPaintRegion = FALSE;
m_queuedFullRedraw = FALSE;
m_cursor = *wxSTANDARD_CURSOR;
@@ -2403,24 +2394,6 @@ bool wxWindow::Destroy()
void wxWindow::DoMoveWindow(int x, int y, int width, int height)
{
if (m_wxwindow && GTK_PIZZA(m_wxwindow)->bin_window)
{
/* Normally, GTK will send expose events only for the regions
which actually got exposed. Sadly, wxMSW invalidates
the whole window so we have to do that, too. We could
simply add a complete refresh, but we would then get
the normal GTK expose events in surplus, so we shut
off the expose events and schedule a full redraw to
be done in OnInternalIdle, where we restore the handling
of expose events. */
m_queuedFullRedraw = TRUE;
GdkEventMask mask = gdk_window_get_events( GTK_PIZZA(m_wxwindow)->bin_window );
mask = (GdkEventMask)(mask & ~GDK_EXPOSURE_MASK);
gdk_window_set_events( GTK_PIZZA(m_wxwindow)->bin_window, mask );
}
gtk_pizza_set_size( GTK_PIZZA(m_parent->m_wxwindow), m_widget, x, y, width, height );
}
@@ -2568,39 +2541,6 @@ void wxWindow::OnInternalIdle()
}
UpdateWindowUI();
if (m_queuedFullRedraw)
{
/* See also wxWindow::DoMoveWindow for explanation of this code. What
we test here is if the requested size of the window is the same as
the actual size of window, in which case all expose events that resulted
from resizing the window have been sent (and discarded) and we can
now do our full redraw and switch on expose event handling again. */
bool child_already_resized = FALSE;
if (IsTopLevel() && !m_isFrame)
{
child_already_resized = ((m_wxwindow->parent) &&
(gtk_pizza_child_resized( GTK_PIZZA(m_wxwindow->parent), m_wxwindow )));
}
else
{
child_already_resized = ((m_widget->parent) &&
(gtk_pizza_child_resized( GTK_PIZZA(m_widget->parent), m_widget )));
}
if (child_already_resized)
{
m_queuedFullRedraw = FALSE;
m_updateRegion.Clear();
m_updateRegion.Union( 0,0,m_width,m_height );
gtk_widget_draw( m_wxwindow, (GdkRectangle*) NULL );
GdkEventMask mask = gdk_window_get_events( GTK_PIZZA(m_wxwindow)->bin_window );
mask = (GdkEventMask)(mask | GDK_EXPOSURE_MASK);
gdk_window_set_events( GTK_PIZZA(m_wxwindow)->bin_window, mask );
}
}
}
void wxWindow::DoGetSize( int *width, int *height ) const

View File

@@ -351,12 +351,12 @@ wxBitmap& wxBitmap::operator = ( const wxBitmap& bmp )
return *this;
}
bool wxBitmap::operator == ( const wxBitmap& bmp )
bool wxBitmap::operator == ( const wxBitmap& bmp ) const
{
return m_refData == bmp.m_refData;
}
bool wxBitmap::operator != ( const wxBitmap& bmp )
bool wxBitmap::operator != ( const wxBitmap& bmp ) const
{
return m_refData != bmp.m_refData;
}

View File

@@ -96,12 +96,12 @@ wxBrush& wxBrush::operator = ( const wxBrush& brush )
return *this;
}
bool wxBrush::operator == ( const wxBrush& brush )
bool wxBrush::operator == ( const wxBrush& brush ) const
{
return m_refData == brush.m_refData;
}
bool wxBrush::operator != ( const wxBrush& brush )
bool wxBrush::operator != ( const wxBrush& brush ) const
{
return m_refData != brush.m_refData;
}

View File

@@ -100,12 +100,12 @@ wxPen& wxPen::operator = ( const wxPen& pen )
return *this;
}
bool wxPen::operator == ( const wxPen& pen )
bool wxPen::operator == ( const wxPen& pen ) const
{
return m_refData == pen.m_refData;
}
bool wxPen::operator != ( const wxPen& pen )
bool wxPen::operator != ( const wxPen& pen ) const
{
return m_refData != pen.m_refData;
}

View File

@@ -636,9 +636,6 @@ static int gtk_window_expose_callback( GtkWidget *widget, GdkEventExpose *gdk_ev
}
*/
if (!win->m_queuedFullRedraw)
{
win->GetUpdateRegion().Union( gdk_event->area.x,
gdk_event->area.y,
gdk_event->area.width,
@@ -683,7 +680,6 @@ static int gtk_window_expose_callback( GtkWidget *widget, GdkEventExpose *gdk_ev
gtk_widget_event (child->widget, (GdkEvent*) &child_event);
}
}
}
return TRUE;
}
@@ -738,9 +734,6 @@ static void gtk_window_draw_callback( GtkWidget *widget, GdkRectangle *rect, wxW
GtkPizza *pizza = GTK_PIZZA (widget);
if (!win->m_queuedFullRedraw)
{
if (!(GTK_WIDGET_APP_PAINTABLE (widget)) &&
(pizza->clear_on_draw))
{
@@ -777,7 +770,6 @@ static void gtk_window_draw_callback( GtkWidget *widget, GdkRectangle *rect, wxW
gtk_widget_draw (child->widget, &child_area /* (GdkRectangle*) NULL*/ );
}
}
}
}
//-----------------------------------------------------------------------------
@@ -2062,7 +2054,6 @@ void wxWindow::Init()
m_acceptsFocus = FALSE;
m_clipPaintRegion = FALSE;
m_queuedFullRedraw = FALSE;
m_cursor = *wxSTANDARD_CURSOR;
@@ -2403,24 +2394,6 @@ bool wxWindow::Destroy()
void wxWindow::DoMoveWindow(int x, int y, int width, int height)
{
if (m_wxwindow && GTK_PIZZA(m_wxwindow)->bin_window)
{
/* Normally, GTK will send expose events only for the regions
which actually got exposed. Sadly, wxMSW invalidates
the whole window so we have to do that, too. We could
simply add a complete refresh, but we would then get
the normal GTK expose events in surplus, so we shut
off the expose events and schedule a full redraw to
be done in OnInternalIdle, where we restore the handling
of expose events. */
m_queuedFullRedraw = TRUE;
GdkEventMask mask = gdk_window_get_events( GTK_PIZZA(m_wxwindow)->bin_window );
mask = (GdkEventMask)(mask & ~GDK_EXPOSURE_MASK);
gdk_window_set_events( GTK_PIZZA(m_wxwindow)->bin_window, mask );
}
gtk_pizza_set_size( GTK_PIZZA(m_parent->m_wxwindow), m_widget, x, y, width, height );
}
@@ -2568,39 +2541,6 @@ void wxWindow::OnInternalIdle()
}
UpdateWindowUI();
if (m_queuedFullRedraw)
{
/* See also wxWindow::DoMoveWindow for explanation of this code. What
we test here is if the requested size of the window is the same as
the actual size of window, in which case all expose events that resulted
from resizing the window have been sent (and discarded) and we can
now do our full redraw and switch on expose event handling again. */
bool child_already_resized = FALSE;
if (IsTopLevel() && !m_isFrame)
{
child_already_resized = ((m_wxwindow->parent) &&
(gtk_pizza_child_resized( GTK_PIZZA(m_wxwindow->parent), m_wxwindow )));
}
else
{
child_already_resized = ((m_widget->parent) &&
(gtk_pizza_child_resized( GTK_PIZZA(m_widget->parent), m_widget )));
}
if (child_already_resized)
{
m_queuedFullRedraw = FALSE;
m_updateRegion.Clear();
m_updateRegion.Union( 0,0,m_width,m_height );
gtk_widget_draw( m_wxwindow, (GdkRectangle*) NULL );
GdkEventMask mask = gdk_window_get_events( GTK_PIZZA(m_wxwindow)->bin_window );
mask = (GdkEventMask)(mask | GDK_EXPOSURE_MASK);
gdk_window_set_events( GTK_PIZZA(m_wxwindow)->bin_window, mask );
}
}
}
void wxWindow::DoGetSize( int *width, int *height ) const