[gtkmm] Wrapped some new GTK+ functions.



commit 4550798047585e9cd1e7be66316fa8528ab5c340
Author: Murray Cumming <murrayc murrayc com>
Date:   Tue Jan 19 10:47:55 2010 +0100

    Wrapped some new GTK+ functions.
    
    * gtk/src/gtk_methods.defs: Regenerated with h2defs.py
    * gtk/src/action.hg: Added get/set_always_show_image() and property.
    * gtk/src/fontselection.hg: Added get_family_list(), get_face_list(),
    get_size_list(). Reimplemented get_size_entry() and get_preview_entry()
    using new functions instead of struct fields.
    Added get_family() and get_face().
    * tools/m4/convert_pango.m4: Added necessary FontFace and FontFamily
    conversions.
    * gtk/src/printcontext.hg: Added get_hard_margins().
    * gtk/src/widget.[hg|ccg]: Added has_rc_style(), wrapping the new C function,
    deprecating rc_style().
    * gtk/src/window.hg: Added get_icon_name() and icon_name property.
    * gtk/src/toolpalette.hg: set_drag_source(), add_drag_dest():
    Add suitable default parameter values.

 ChangeLog                 |   21 ++++++++++++++++++++-
 gtk/src/action.hg         |    4 ++++
 gtk/src/fontselection.ccg |    1 +
 gtk/src/fontselection.hg  |   30 ++++++++++++++++++++++++++----
 gtk/src/gtk_methods.defs  |    8 +++++++-
 gtk/src/printcontext.hg   |    2 ++
 gtk/src/toolpalette.hg    |    4 ++--
 gtk/src/widget.ccg        |   17 +++++++++--------
 gtk/src/widget.hg         |    6 +++++-
 gtk/src/window.hg         |    6 ++++--
 tools/m4/convert_pango.m4 |    5 +++++
 11 files changed, 85 insertions(+), 19 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 77907dd..52a1dcd 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,25 @@
+2010-01-19  Murray Cumming  <murrayc murrayc com>
+
+	Wrapped some new GTK+ functions.
+
+	* gtk/src/gtk_methods.defs: Regenerated with h2defs.py
+	* gtk/src/action.hg: Added get/set_always_show_image() and property.
+	* gtk/src/fontselection.hg: Added get_family_list(), get_face_list(), 
+	get_size_list(). Reimplemented get_size_entry() and get_preview_entry() 
+	using new functions instead of struct fields.
+	Added get_family() and get_face().
+	* tools/m4/convert_pango.m4: Added necessary FontFace and FontFamily 
+	conversions.
+	* gtk/src/printcontext.hg: Added get_hard_margins().
+	* gtk/src/widget.[hg|ccg]: Added has_rc_style(), wrapping the new C function, 
+	deprecating rc_style().
+	* gtk/src/window.hg: Added get_icon_name() and icon_name property.
+	* gtk/src/toolpalette.hg: set_drag_source(), add_drag_dest(): 
+	Add suitable default parameter values.
+
 2010-01-16  Murray Cumming  <murrayc murrayc com>
 
-  ToolItemGroup: Slight API improvements.
+	ToolItemGroup: Slight API improvements.
   
 	* gtk/src/toolitemgroup.[hg|ccg]: Added insert() with no position parameter.
 	get_item_position(): Made this const.
diff --git a/gtk/src/action.hg b/gtk/src/action.hg
index 2b5eb78..1751423 100644
--- a/gtk/src/action.hg
+++ b/gtk/src/action.hg
@@ -204,6 +204,9 @@ public:
   _WRAP_METHOD(void set_is_important(bool is_important = true), gtk_action_set_is_important)
   _WRAP_METHOD(bool get_is_important() const, gtk_action_get_is_important)
 
+  _WRAP_METHOD(void set_always_show_image(bool always_show = true), gtk_action_set_always_show_image)
+  _WRAP_METHOD(bool get_always_show_image() const, gtk_action_get_always_show_image)
+
   _WRAP_METHOD(void block_activate(), gtk_action_block_activate)
   _WRAP_METHOD(void unblock_activate(), gtk_action_unblock_activate)
 
@@ -225,6 +228,7 @@ public:
   _WRAP_PROPERTY("sensitive", bool)
   _WRAP_PROPERTY("visible", bool)
   _WRAP_PROPERTY("action_group", Glib::RefPtr<ActionGroup>)
+  _WRAP_PROPERTY("always-show-image", bool)
 
 protected:
   //For use by child actions:
diff --git a/gtk/src/fontselection.ccg b/gtk/src/fontselection.ccg
index eaa9c4f..ca83c00 100644
--- a/gtk/src/fontselection.ccg
+++ b/gtk/src/fontselection.ccg
@@ -21,5 +21,6 @@
 #include <gtkmm/button.h>
 #include <gtkmm/entry.h>
 #include <gtkmm/radiobutton.h>
+#include <gtkmm/treeview.h>
 #include <gtk/gtk.h>
 
diff --git a/gtk/src/fontselection.hg b/gtk/src/fontselection.hg
index 529478a..87ad302 100644
--- a/gtk/src/fontselection.hg
+++ b/gtk/src/fontselection.hg
@@ -30,6 +30,7 @@ namespace Gtk
 
 class Button;
 class Entry;
+class TreeView;
 class RadioButton;
 
 
@@ -45,10 +46,33 @@ class RadioButton;
 class FontSelection : public VBox
 {
   _CLASS_GTKOBJECT(FontSelection,GtkFontSelection,GTK_FONT_SELECTION,Gtk::VBox,GtkVBox)
-  _IGNORE(gtk_font_selection_get_font)
+  _IGNORE(gtk_font_selection_get_font) //deprecated
 public:
   _CTOR_DEFAULT()
 
+  _WRAP_METHOD(TreeView* get_family_list(), gtk_font_selection_get_family_list)
+  _WRAP_METHOD(const TreeView* get_family_list() const, gtk_font_selection_get_family_list, constversion)
+
+  _WRAP_METHOD(TreeView* get_face_list(), gtk_font_selection_get_face_list)
+  _WRAP_METHOD(const TreeView* get_face_list() const, gtk_font_selection_get_face_list, constversion)
+
+  _WRAP_METHOD(Entry* get_size_entry(), gtk_font_selection_get_size_entry)
+  _WRAP_METHOD(const Entry* get_size_entry() const, gtk_font_selection_get_size_entry, constversion)
+
+  _WRAP_METHOD(TreeView* get_size_list(), gtk_font_selection_get_size_list)
+  _WRAP_METHOD(const TreeView* get_size_list() const, gtk_font_selection_get_size_list, constversion)
+
+  _WRAP_METHOD(Entry* get_preview_entry(), gtk_font_selection_get_preview_entry)
+  _WRAP_METHOD(const Entry* get_preview_entry() const, gtk_font_selection_get_preview_entry)
+
+  _WRAP_METHOD(Glib::RefPtr<Pango::FontFamily> get_family(), gtk_font_selection_get_family, refreturn)
+  _WRAP_METHOD(Glib::RefPtr<const Pango::FontFamily> get_family() const, gtk_font_selection_get_family, refreturn, constversion)
+
+  _WRAP_METHOD(Glib::RefPtr<Pango::FontFace> get_face(), gtk_font_selection_get_face, refreturn)
+  _WRAP_METHOD(Glib::RefPtr<const Pango::FontFace> get_face() const, gtk_font_selection_get_face, refreturn, constversion)
+
+  _WRAP_METHOD(int get_size() const, gtk_font_selection_get_size)
+
   _WRAP_METHOD(Glib::ustring get_font_name() const, gtk_font_selection_get_font_name)
   _WRAP_METHOD(bool set_font_name(const Glib::ustring& fontname), gtk_font_selection_set_font_name)
   _WRAP_METHOD(Glib::ustring get_preview_text() const, gtk_font_selection_get_preview_text)
@@ -57,14 +81,12 @@ public:
   // Font page
   _MEMBER_GET_PTR(font_entry,font_entry,Entry*,GtkWidget*)
   _MEMBER_GET_PTR(font_style_entry,font_style_entry,Entry*,GtkWidget*)
-  _MEMBER_GET_PTR(size_entry,size_entry,Entry*,GtkWidget*)
 
   _MEMBER_GET_PTR(pixels_button,pixels_button,RadioButton*,GtkWidget*)
   _MEMBER_GET_PTR(points_button,points_button,RadioButton*,GtkWidget*)
   _MEMBER_GET_PTR(filter_button,filter_button,Button*,GtkWidget*)
 
-  _MEMBER_GET_PTR(preview_entry,preview_entry,Entry*,GtkWidget*)
-
+  //Note: The GdkFont "font" property is deprecated, or should be.
   _WRAP_PROPERTY("font_name", Glib::ustring)
   _WRAP_PROPERTY("preview_text", Glib::ustring)
 };
diff --git a/gtk/src/gtk_methods.defs b/gtk/src/gtk_methods.defs
index 0fa1232..f91bfe4 100644
--- a/gtk/src/gtk_methods.defs
+++ b/gtk/src/gtk_methods.defs
@@ -29089,7 +29089,7 @@
 (define-method get_drop_group
   (of-object "GtkToolPalette")
   (c-name "gtk_tool_palette_get_drop_group")
-  (return-type "GtkWidget*")
+  (return-type "GtkToolItemGroup*")
   (parameters
     '("gint" "x")
     '("gint" "y")
@@ -34058,6 +34058,12 @@
   (return-type "gboolean")
 )
 
+(define-method has_rc_style
+  (of-object "GtkWidget")
+  (c-name "gtk_widget_has_rc_style")
+  (return-type "gboolean")
+)
+
 (define-method set_style
   (of-object "GtkWidget")
   (c-name "gtk_widget_set_style")
diff --git a/gtk/src/printcontext.hg b/gtk/src/printcontext.hg
index 9092fcd..b13f8c0 100644
--- a/gtk/src/printcontext.hg
+++ b/gtk/src/printcontext.hg
@@ -64,6 +64,8 @@ public:
   _WRAP_METHOD(double get_dpi_x() const, gtk_print_context_get_dpi_x)
   _WRAP_METHOD(double get_dpi_y() const, gtk_print_context_get_dpi_y)
 
+  _WRAP_METHOD(bool get_hard_margins(double& top, double& bottom, double& left, double& right) const, gtk_print_context_get_hard_margins)
+
   _WRAP_METHOD(Glib::RefPtr<Pango::FontMap> get_pango_fontmap(), gtk_print_context_get_pango_fontmap, refreturn)
   _WRAP_METHOD(Glib::RefPtr<const Pango::FontMap> get_pango_fontmap() const, gtk_print_context_get_pango_fontmap, refreturn, constversion)
 
diff --git a/gtk/src/toolpalette.hg b/gtk/src/toolpalette.hg
index 17e4377..45180fd 100644
--- a/gtk/src/toolpalette.hg
+++ b/gtk/src/toolpalette.hg
@@ -83,8 +83,8 @@ public:
   _WRAP_METHOD(ToolItem* get_drag_item(const SelectionData& selection), gtk_tool_palette_get_drag_item)
   _WRAP_METHOD(const ToolItem* get_drag_item(const SelectionData& selection) const, gtk_tool_palette_get_drag_item, constversion)
 
-  _WRAP_METHOD(void set_drag_source(ToolPaletteDragTargets targets), gtk_tool_palette_set_drag_source)
-  _WRAP_METHOD(void add_drag_dest(Gtk::Widget& widget, DestDefaults flags, ToolPaletteDragTargets targets, Gdk::DragAction actions), gtk_tool_palette_add_drag_dest)
+  _WRAP_METHOD(void set_drag_source(ToolPaletteDragTargets targets = TOOL_PALETTE_DRAG_ITEMS), gtk_tool_palette_set_drag_source)
+  _WRAP_METHOD(void add_drag_dest(Gtk::Widget& widget, DestDefaults flags = DEST_DEFAULT_ALL, ToolPaletteDragTargets targets = TOOL_PALETTE_DRAG_ITEMS, Gdk::DragAction actions = Gdk::ACTION_COPY), gtk_tool_palette_add_drag_dest)
 
   _WRAP_METHOD(Adjustment* get_hadjustment(), gtk_tool_palette_get_hadjustment)
   _WRAP_METHOD(const Adjustment* get_hadjustment() const, gtk_tool_palette_get_hadjustment, constversion)
diff --git a/gtk/src/widget.ccg b/gtk/src/widget.ccg
index 9e41043..87db77a 100644
--- a/gtk/src/widget.ccg
+++ b/gtk/src/widget.ccg
@@ -321,6 +321,15 @@ bool Widget::app_paintable() const
 //deprecated:
 bool Widget::double_buffered() const
   { return get_double_buffered(); }
+
+//deprecated:
+bool Widget::rc_style() const
+  { return has_rc_style(); }
+
+//deprecated:
+bool Widget::is_composite_child() const
+  { return GTK_WIDGET_COMPOSITE_CHILD(gobj()); }
+
 _DEPRECATE_IFDEF_END
 
 Allocation Widget::get_allocation() const
@@ -333,14 +342,6 @@ Allocation Widget::get_allocation() const
 bool Widget::parent_sensitive() const
   { return GTK_WIDGET_PARENT_SENSITIVE(gobj()); }
 
-bool Widget::rc_style() const
-  { return GTK_WIDGET_RC_STYLE(gobj()); }
-
-_DEPRECATE_IFDEF_START
-bool Widget::is_composite_child() const
-  { return GTK_WIDGET_COMPOSITE_CHILD(gobj()); }
-_DEPRECATE_IFDEF_END
-
 WidgetFlags Widget::get_flags() const
   { return static_cast<WidgetFlags>(GTK_WIDGET_FLAGS(gobj())); }
 
diff --git a/gtk/src/widget.hg b/gtk/src/widget.hg
index d448e4b..ffff948 100644
--- a/gtk/src/widget.hg
+++ b/gtk/src/widget.hg
@@ -347,6 +347,7 @@ public:
 					       int& dest_x, int& dest_y), gtk_widget_translate_coordinates)
 
 /* STYLE */
+  _WRAP_METHOD(bool has_rc_style() const, gtk_widget_has_rc_style)
   _WRAP_METHOD(void set_style(const Glib::RefPtr<Style>& style), gtk_widget_set_style)
   void unset_style();
 
@@ -516,6 +517,7 @@ public:
   _WRAP_METHOD(void drag_highlight(), gtk_drag_highlight)
   _WRAP_METHOD(void drag_unhighlight(), gtk_drag_unhighlight)
 
+  //TODO: Change the defaults? Maybe we should use ALL for DestDefaults. See other drag_dest_set() methods here and in other widgets.
   void drag_dest_set(DestDefaults flags = DestDefaults(0), Gdk::DragAction actions = Gdk::DragAction(0));
   void drag_dest_set(const ArrayHandle_TargetEntry& targets, DestDefaults flags = DEST_DEFAULT_ALL, Gdk::DragAction actions = Gdk::ACTION_COPY);
   _IGNORE(gtk_drag_dest_set)
@@ -623,10 +625,12 @@ _DEPRECATE_IFDEF_START
    */
   bool double_buffered() const;
 
-_DEPRECATE_IFDEF_END
+  _DEPRECATE_IFDEF_END
 
   bool parent_sensitive() const;
 
+  /** @deprecated: Use has_rc_style() instead.
+   */
   bool rc_style() const;
 
   _DEPRECATE_IFDEF_START
diff --git a/gtk/src/window.hg b/gtk/src/window.hg
index 1ad1ab3..2f65772 100644
--- a/gtk/src/window.hg
+++ b/gtk/src/window.hg
@@ -64,7 +64,7 @@ class Window : public Bin
   _IGNORE(_gtk_window_internal_set_focus, _gtk_window_reposition, _gtk_window_constrain_size, gtk_window_remove_embedded_xid,
                 _gtk_window_get_group, _gtk_window_activate_key, gtk_window_add_embedded_xid, _gtk_window_keys_foreach)
 public:
-   _WRAP_CTOR(Window(WindowType type = WINDOW_TOPLEVEL), gtk_window_new)
+  _WRAP_CTOR(Window(WindowType type = WINDOW_TOPLEVEL), gtk_window_new)
 
   _WRAP_PROPERTY("title", Glib::ustring)
   _WRAP_PROPERTY("allow_shrink", bool)
@@ -77,7 +77,7 @@ public:
   _WRAP_PROPERTY("destroy_with_parent", bool)
   _WRAP_PROPERTY("icon", Glib::RefPtr<Gdk::Pixbuf>)
   _WRAP_PROPERTY("mnemonics-visible", bool)
-  
+  _WRAP_PROPERTY("icon-name", Glib::ustring) 
   _WRAP_PROPERTY("screen", Glib::RefPtr<Gdk::Screen>)
   _WRAP_PROPERTY("is_active", bool)
   _WRAP_PROPERTY("has_toplevel_focus", bool)
@@ -253,6 +253,8 @@ dnl
   _WRAP_METHOD(Glib::RefPtr<Gdk::Pixbuf> get_icon(), gtk_window_get_icon, refreturn)
   _WRAP_METHOD(Glib::RefPtr<const Gdk::Pixbuf> get_icon() const, gtk_window_get_icon, refreturn, constversion)
 
+  _WRAP_METHOD(Glib::ustring get_icon_name() const, gtk_window_get_icon_name)
+
   _WRAP_METHOD(static void set_default_icon_list(
                    const Glib::ListHandle< Glib::RefPtr<Gdk::Pixbuf> >& list),
                gtk_window_set_default_icon_list)
diff --git a/tools/m4/convert_pango.m4 b/tools/m4/convert_pango.m4
index 60e3280..81c42fd 100644
--- a/tools/m4/convert_pango.m4
+++ b/tools/m4/convert_pango.m4
@@ -96,6 +96,11 @@ _CONVERSION(`const Glib::RefPtr<const Font>&',`PangoFont*',__CONVERT_CONST_REFPT
 #_CONVERSION(`const Glib::RefPtr<const Font>&',`PangoFont*',__CONVERT_CONST_REFPTR_TO_P)
 _CONVERSION(`const Glib::RefPtr<const Pango::Font>&',`PangoFont*',__CONVERT_CONST_REFPTR_TO_P_SUN(Pango::Font))
 
+_CONVERSION(`PangoFontFace*',`Glib::RefPtr<Pango::FontFace>',Glib::wrap($3))
+_CONVERSION(`PangoFontFace*',`Glib::RefPtr<const Pango::FontFace>',Glib::wrap($3))
+_CONVERSION(`PangoFontFamily*',`Glib::RefPtr<Pango::FontFamily>',Glib::wrap($3))
+_CONVERSION(`PangoFontFamily*',`Glib::RefPtr<const Pango::FontFamily>',Glib::wrap($3))
+
 _CONVERSION(`PangoFontMap*',`Glib::RefPtr<FontMap>',Glib::wrap($3))
 _CONVERSION(`PangoFontMap*',`Glib::RefPtr<const FontMap>',Glib::wrap($3))
 _CONVERSION(`const Glib::RefPtr<FontMap>&',`PangoFontMap*',__CONVERT_REFPTR_TO_P)



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]