///////////////////////////////////////////////////////////////////////////////
-// Name: gtk/renderer.cpp
+// Name: src/gtk1/renderer.cpp
// Purpose: implementation of wxRendererNative for wxGTK
// Author: Vadim Zeitlin
// Modified by:
#endif
#include "wx/renderer.h"
+
+#ifndef WX_PRECOMP
+ #include "wx/window.h"
+ #include "wx/dc.h"
+#endif
+
#include <gtk/gtk.h>
#include "wx/gtk1/win_gtk.h"
-
-#include "wx/window.h"
-#include "wx/dc.h"
-#include "wx/dcclient.h"
+#include "wx/gtk1/dcclient.h"
// RR: After a correction to the orientation of the sash
// this doesn't seem to be required anymore and it
NULL,
button,
"button",
- dc.XLOG2DEV(rect.x) -1, rect.y -1, rect.width +2, rect.height +2
+ dc.LogicalToDeviceX(rect.x) -1, rect.y -1, rect.width +2, rect.height +2
);
}
void
wxRendererGTK::DrawSplitterSash(wxWindow *win,
- wxDC& dc,
+ wxDC& WXUNUSED(dc),
const wxSize& size,
wxCoord position,
wxOrientation orient,
}
void
-wxRendererGTK::DrawDropArrow(wxWindow *win,
+wxRendererGTK::DrawDropArrow(wxWindow *WXUNUSED(win),
wxDC& dc,
const wxRect& rect,
int flags)
// work for wxMemoryDC. So that is why we assume wxDC
// is wxWindowDC (wxClientDC, wxMemoryDC and wxPaintDC
// are derived from it) and use its m_window.
- wxWindowDC& wdc = (wxWindowDC&)dc;
+ wxWindowDCImpl * const impl = wxDynamicCast(dc.GetImpl(), wxWindowDCImpl);
+ wxCHECK_RET( impl, "must have a window DC" );
- // only doing debug-time checking here (it should
- // probably be enough)
- wxASSERT ( wdc.IsKindOf(CLASSINFO(wxWindowDC)) );
+ GdkWindow* gdk_window = impl->GetGDKWindow();
// draw arrow so that there is even space horizontally
// on both sides
gtk_paint_arrow
(
button->style,
- wdc.m_window,
+ gdk_window,
state,
flags & wxCONTROL_PRESSED ? GTK_SHADOW_IN : GTK_SHADOW_OUT,
NULL,
GtkWidget *button = GetButtonWidget();
// for reason why we do this, see DrawDropArrow
- wxWindowDC& wdc = (wxWindowDC&)dc;
- wxASSERT ( wdc.IsKindOf(CLASSINFO(wxWindowDC)) );
+ wxWindowDCImpl * const impl = wxDynamicCast(dc.GetImpl(), wxWindowDCImpl);
+ wxCHECK_RET( impl, "must have a window DC" );
+
+ GdkWindow* gdk_window = impl->GetGDKWindow();
// draw button
GtkStateType state;
gtk_paint_box
(
button->style,
- wdc.m_window,
+ gdk_window,
state,
flags & wxCONTROL_PRESSED ? GTK_SHADOW_IN : GTK_SHADOW_OUT,
NULL,