[gtkmm] Add some new methods.



commit f5bf21681e034e8e7418681f9742bfeb55f98ac8
Author: Murray Cumming <murrayc murrayc com>
Date:   Fri Jun 15 10:21:26 2012 +0200

    Add some new methods.
    
    * gdk/src/screen.[hg|ccg]: Add get_monitor_workarea().
    * gtk/src/application.hg: Add get_window_by_id().
    * gtk/src/button.hg: Add set/get_always_show_image() and the
    property.

 ChangeLog              |    9 +++++++++
 gdk/src/screen.ccg     |    7 +++++++
 gdk/src/screen.hg      |   18 ++++++++++++++++++
 gtk/src/application.hg |    3 +++
 gtk/src/button.hg      |    4 ++++
 5 files changed, 41 insertions(+), 0 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 855aaf2..4755213 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,14 @@
 2012-06-15  Murray Cumming  <murrayc murrayc com>
 
+	Add some new methods.
+
+	* gdk/src/screen.[hg|ccg]: Add get_monitor_workarea().
+	* gtk/src/application.hg: Add get_window_by_id().
+	* gtk/src/button.hg: Add set/get_always_show_image() and the 
+	property.
+
+2012-06-15  Murray Cumming  <murrayc murrayc com>
+
 	Add some extra .defs entries needed for documentation.
 
 	* gdk/src/gdk_extra_objects.defs:
diff --git a/gdk/src/screen.ccg b/gdk/src/screen.ccg
index 7658330..c759702 100644
--- a/gdk/src/screen.ccg
+++ b/gdk/src/screen.ccg
@@ -29,6 +29,13 @@
 namespace Gdk
 {
 
+Rectangle Screen::get_monitor_workarea(int monitor_num) const
+{
+  Rectangle rect;
+  gdk_screen_get_monitor_workarea(const_cast<GdkScreen*>(gobj()), monitor_num, rect.gobj());
+  return rect;
+}
+
 } //Gdk
 
 
diff --git a/gdk/src/screen.hg b/gdk/src/screen.hg
index f804904..440ab71 100644
--- a/gdk/src/screen.hg
+++ b/gdk/src/screen.hg
@@ -78,6 +78,24 @@ public:
   _WRAP_METHOD(int get_n_monitors() const, gdk_screen_get_n_monitors)
   _WRAP_METHOD(int get_primary_monitor() const, gdk_screen_get_primary_monitor)
   _WRAP_METHOD(void get_monitor_geometry(int monitor_num, Rectangle& dest) const, gdk_screen_get_monitor_geometry)
+
+  /** Retrieves the Gdk::Rectangle representing the size and position of
+   * the "work area" on a monitor within the entire screen area.
+   * 
+   * The work area should be considered when positioning menus and
+   * similar popups, to avoid placing them below panels, docks or other
+   * desktop components.
+   * 
+   * Monitor numbers start at 0. To obtain the number of monitors of
+   *  @a screen, use get_n_monitors().
+   * 
+   * @newin{3,6}
+   * @param monitor_num The monitor number.
+   * @result The monitor workarea.
+   */
+  Rectangle get_monitor_workarea(int monitor_num = 0) const;
+  _IGNORE(gdk_screen_get_monitor_workarea)
+
   _WRAP_METHOD(int get_monitor_at_point(int x, int y) const, gdk_screen_get_monitor_at_point)
   _WRAP_METHOD(int get_monitor_at_window(const Glib::RefPtr<Window>& window) const, gdk_screen_get_monitor_at_window)
 
diff --git a/gtk/src/application.hg b/gtk/src/application.hg
index 40c8108..eb3a794 100644
--- a/gtk/src/application.hg
+++ b/gtk/src/application.hg
@@ -249,6 +249,9 @@ public:
   _WRAP_METHOD(void uninhibit(guint cookie), gtk_application_uninhibit)
   _WRAP_METHOD(bool is_inhibited(ApplicationInhibitFlags flags) const, gtk_application_is_inhibited)
 
+  _WRAP_METHOD(Window* get_window_by_id(guint id), gtk_application_get_window_by_id)
+  _WRAP_METHOD(const Window* get_window_by_id(guint id) const, gtk_application_get_window_by_id, constversion)
+
 
   _WRAP_PROPERTY("app-menu", Glib::RefPtr<Gio::MenuModel>)
   _WRAP_PROPERTY("menubar", Glib::RefPtr<Gio::MenuModel>)
diff --git a/gtk/src/button.hg b/gtk/src/button.hg
index b091c25..1231a94 100644
--- a/gtk/src/button.hg
+++ b/gtk/src/button.hg
@@ -100,6 +100,9 @@ public:
   _WRAP_METHOD(void set_image_position(PositionType position), gtk_button_set_image_position)
   _WRAP_METHOD(PositionType get_image_position() const, gtk_button_get_image_position)
 
+  _WRAP_METHOD(void set_always_show_image(bool always_show = true), gtk_button_set_always_show_image)
+  _WRAP_METHOD(bool get_always_show_image(), gtk_button_get_always_show_image)
+
   _WRAP_METHOD(Glib::RefPtr<Gdk::Window> get_event_window(), gtk_button_get_event_window, refreturn)
   _WRAP_METHOD(Glib::RefPtr<const Gdk::Window> get_event_window() const, gtk_button_get_event_window, refreturn, constversion)
 
@@ -119,6 +122,7 @@ public:
   _WRAP_PROPERTY("yalign", float)
   _WRAP_PROPERTY("image", Gtk::Widget*)
   _WRAP_PROPERTY("image-position", PositionType)
+  _WRAP_PROPERTY("always-show-image", bool)
 };
 
 /*! A Gtk::Button example.



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