[gtkmm] Gtk::CellArea, CellRenderer, CheckMenuItem: Remove render functions
- From: Kjell Ahlstedt <kjellahl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtkmm] Gtk::CellArea, CellRenderer, CheckMenuItem: Remove render functions
- Date: Mon, 2 Jan 2017 12:08:38 +0000 (UTC)
commit 7535c82fea6f84fb598d3a9ca798b5287da8bcf5
Author: Kjell Ahlstedt <kjell ahlstedt bredband net>
Date: Mon Jan 2 13:04:28 2017 +0100
Gtk::CellArea, CellRenderer, CheckMenuItem: Remove render functions
* gtk/src/cellarea.hg: Remove render().
* gtk/src/cellrenderer.hg: Remove render() and render_vfunc().
* gtk/src/checkmenuitem.hg: Remove draw_indicator_vfunc().
* gtk/src/gtk_vfuncs.defs: Replace render vfuncs by snapshot vfuncs.
These render functions have been replaced in gtk+ by snapshot functions,
taking a GtkSnapshot instead of a cairo_t. The snapshot functions can be
added to gtkmm when GtkSnapshot has been wrapped. Bug 776659
gtk/src/cellarea.hg | 5 ++++-
gtk/src/cellrenderer.hg | 31 ++++++++++++++-----------------
gtk/src/checkmenuitem.hg | 13 ++++---------
gtk/src/gtk_vfuncs.defs | 8 ++++----
4 files changed, 26 insertions(+), 31 deletions(-)
---
diff --git a/gtk/src/cellarea.hg b/gtk/src/cellarea.hg
index 09e1d67..80e5527 100644
--- a/gtk/src/cellarea.hg
+++ b/gtk/src/cellarea.hg
@@ -157,7 +157,10 @@ public:
_IGNORE(gtk_cell_area_foreach_alloc)
_WRAP_METHOD(int event(const Glib::RefPtr<CellAreaContext>& context, Widget& widget, GdkEvent* gdk_event,
const Gdk::Rectangle& cell_area, GtkCellRendererState flags), gtk_cell_area_event)
- _WRAP_METHOD(void render(const Glib::RefPtr<CellAreaContext>& context, Widget& widget, const
::Cairo::RefPtr< ::Cairo::Context>& cr, const Gdk::Rectangle& background_area, const Gdk::Rectangle&
cell_area, CellRendererState flags, bool paint_focus), gtk_cell_area_render)
+ //TODO: Implement when GtkSnapshot has been wrapped in gtkmm:
+ //_WRAP_METHOD(void snapshot(const Glib::RefPtr<CellAreaContext>& context, Widget& widget,
+ // Snapshot& snapshot, const Gdk::Rectangle& background_area, const Gdk::Rectangle& cell_area,
+ // CellRendererState flags, bool paint_focus), gtk_cell_area_snapshot)
_WRAP_METHOD(void get_cell_allocation(const Glib::RefPtr<CellAreaContext>& context, Widget& widget,
CellRenderer& renderer, const Gdk::Rectangle& cell_area, Gdk::Rectangle& allocation),
gtk_cell_area_get_cell_allocation)
diff --git a/gtk/src/cellrenderer.hg b/gtk/src/cellrenderer.hg
index 7e26dd1..03e9d70 100644
--- a/gtk/src/cellrenderer.hg
+++ b/gtk/src/cellrenderer.hg
@@ -55,12 +55,13 @@ public:
//TODO: Use a return value intead?
_WRAP_METHOD(void get_aligned_area(Widget& widget, CellRendererState flags, const Gdk::Rectangle&
cell_area, Gdk::Rectangle& aligned_area), gtk_cell_renderer_get_aligned_area)
- _WRAP_METHOD(void render(
- const ::Cairo::RefPtr< ::Cairo::Context>& cr,
- Widget& widget,
- const Gdk::Rectangle& background_area,
- const Gdk::Rectangle& cell_area,
- CellRendererState flags), gtk_cell_renderer_render)
+ //TODO: Implement when GtkSnapshot has been wrapped in gtkmm:
+ //_WRAP_METHOD(void snapshot(
+ // Snapshot& snapshot,
+ // Widget& widget,
+ // const Gdk::Rectangle& background_area,
+ // const Gdk::Rectangle& cell_area,
+ // CellRendererState flags), gtk_cell_renderer_snapshot)
_WRAP_METHOD(bool activate(
GdkEvent* event,
@@ -140,11 +141,6 @@ public:
protected:
_CTOR_DEFAULT()
-#m4begin
-dnl This extra conversion does the extra reference, often needed by code for vfuncs and signal.
- _CONVERSION(`cairo_t*',`const ::Cairo::RefPtr< ::Cairo::Context>&',`::Cairo::make_refptr_for_instance<
::Cairo::Context>(new ::Cairo::Context($3, false /* has_reference */))')
-#m4end
-
#m4 _CONVERSION(`const GdkRectangle*',`const Gdk::Rectangle&',`Glib::wrap($3)')
#m4 _CONVERSION(`GdkRectangle*',`const Gdk::Rectangle&',`Glib::wrap($3)')
@@ -154,12 +150,13 @@ dnl This extra conversion does the extra reference, often needed by code for vfu
_WRAP_VFUNC(void get_preferred_height(Widget& widget, int& minimum_height, int& natural_height) const,
get_preferred_height, custom_vfunc_callback)
_WRAP_VFUNC(void get_preferred_width_for_height(Widget& widget, int height, int& minimum_width, int&
natural_width) const, get_preferred_width_for_height, custom_vfunc_callback)
- _WRAP_VFUNC(void render(
- const ::Cairo::RefPtr< ::Cairo::Context>& cr,
- Widget& widget,
- const Gdk::Rectangle& background_area,
- const Gdk::Rectangle& cell_area,
- CellRendererState flags), render)
+ //TODO: Implement when GtkSnapshot has been wrapped in gtkmm:
+ //_WRAP_VFUNC(void snapshot(
+ // Snapshot& snapshot,
+ // Widget& widget,
+ // const Gdk::Rectangle& background_area,
+ // const Gdk::Rectangle& cell_area,
+ // CellRendererState flags), snapshot)
_WRAP_VFUNC(bool activate(
GdkEvent* event,
diff --git a/gtk/src/checkmenuitem.hg b/gtk/src/checkmenuitem.hg
index e2b9c41..bf61936 100644
--- a/gtk/src/checkmenuitem.hg
+++ b/gtk/src/checkmenuitem.hg
@@ -57,19 +57,14 @@ public:
_WRAP_PROPERTY("draw-as-radio", bool)
protected:
-
-#m4begin
-dnl This extra conversion does the extra reference, often needed by code for vfuncs and signal.
-_CONVERSION(`cairo_t*',`const ::Cairo::RefPtr< ::Cairo::Context>&',`::Cairo::make_refptr_for_instance<
::Cairo::Context>(new ::Cairo::Context($3, false /* has_reference */))')
-#m4end
-
- /** Triggered when the item is redrawn (e.g.after being toggled)
- * Overload this signal if you want to implement your own check item
+ //TODO: Implement when GtkSnapshot has been wrapped in gtkmm:
+ /* Triggered when the item is redrawn (e.g. after being toggled)
+ * Override this vfunc if you want to implement your own check item
* look. Otherwise, you most likely don't care about it.
* The GdkRectangle specifies the area of the widget which will get
* redrawn.
*/
- _WRAP_VFUNC(void draw_indicator(const ::Cairo::RefPtr< ::Cairo::Context>& cr), draw_indicator)
+ //_WRAP_VFUNC(void snapshot_indicator(Snapshot& snapshot), snapshot_indicator)
};
} //namespace Gtk
diff --git a/gtk/src/gtk_vfuncs.defs b/gtk/src/gtk_vfuncs.defs
index 48860b9..8c8a543 100644
--- a/gtk/src/gtk_vfuncs.defs
+++ b/gtk/src/gtk_vfuncs.defs
@@ -212,11 +212,11 @@
; )
;)
-(define-vfunc render
+(define-vfunc snapshot
(of-object "GtkCellRenderer")
(return-type "none")
(parameters
- '("cairo_t*" "cr")
+ '("GtkSnapshot*" "snapshot")
'("GtkWidget*" "widget")
'("const-GdkRectangle*" "background_area")
'("const-GdkRectangle*" "cell_area")
@@ -264,11 +264,11 @@
; GtkCheckMenuItem
-(define-vfunc draw_indicator
+(define-vfunc snapshot_indicator
(of-object "GtkCheckMenuItem")
(return-type "none")
(parameters
- '("cairo_t*" "cr")
+ '("GtkSnapshot*" "snapshot")
)
)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]