[gtkmm] Adapted Gdk and Gtk to vectorutils.
- From: Krzesimir Nowak <krnowak src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtkmm] Adapted Gdk and Gtk to vectorutils.
- Date: Thu, 27 Jan 2011 22:38:41 +0000 (UTC)
commit ab8557dd7775850e0b6f0aa8d7e511aefefcf1fb
Author: Krzesimir Nowak <qdlacz gmail com>
Date: Thu Jan 27 23:34:44 2011 +0100
Adapted Gdk and Gtk to vectorutils.
ChangeLog | 115 ++++++++++++++++++++++
demos/gtk-demo/example_change_display.cc | 2 +-
demos/gtk-demo/example_textview.cc | 16 +++-
gdk/gdkmm/filelist.am | 2 +-
gdk/gdkmm/list.h | 157 ------------------------------
gdk/src/color.hg | 2 -
gdk/src/device.ccg | 4 +-
gdk/src/device.hg | 10 +-
gdk/src/devicemanager.ccg | 2 +
gdk/src/devicemanager.hg | 8 +-
gdk/src/display.ccg | 31 +++----
gdk/src/display.hg | 4 +-
gdk/src/displaymanager.hg | 5 +-
gdk/src/dragcontext.ccg | 6 +-
gdk/src/dragcontext.hg | 5 +-
gdk/src/pixbuf.ccg | 20 +++--
gdk/src/pixbuf.hg | 13 ++-
gdk/src/pixbufformat.hg | 6 +-
gdk/src/rgba.hg | 2 -
gdk/src/screen.hg | 12 +-
gdk/src/timecoord.hg | 1 -
gdk/src/types.hg | 15 +++-
gdk/src/window.ccg | 25 +-----
gdk/src/window.hg | 11 ++-
gtk/gtkmm/listviewtext.cc | 4 +-
gtk/gtkmm/stock.cc | 4 +-
gtk/gtkmm/stock.h | 2 +-
gtk/gtkmm/stockid.h | 2 +-
gtk/gtkmm/targetentry.h | 5 +-
gtk/src/aboutdialog.ccg | 2 +
gtk/src/aboutdialog.hg | 29 +++---
gtk/src/action.ccg | 2 +
gtk/src/action.hg | 10 +-
gtk/src/actiongroup.ccg | 2 +
gtk/src/actiongroup.hg | 8 +-
gtk/src/application.ccg | 2 +
gtk/src/application.hg | 10 +-
gtk/src/box.hg | 1 -
gtk/src/builder.ccg | 27 +++---
gtk/src/builder.hg | 20 ++--
gtk/src/celllayout.ccg | 2 +
gtk/src/celllayout.hg | 10 +-
gtk/src/clipboard.ccg | 50 ++++------
gtk/src/clipboard.hg | 24 +++---
gtk/src/colorselection.ccg | 18 ++--
gtk/src/colorselection.hg | 8 +-
gtk/src/container.ccg | 10 +-
gtk/src/container.hg | 16 ++-
gtk/src/dialog.ccg | 4 +-
gtk/src/dialog.hg | 4 +-
gtk/src/enums.hg | 17 +++
gtk/src/filechooser.ccg | 2 +
gtk/src/filechooser.hg | 25 +++--
gtk/src/iconinfo.ccg | 14 ++--
gtk/src/iconinfo.hg | 4 +-
gtk/src/iconset.ccg | 4 +-
gtk/src/iconset.hg | 3 +-
gtk/src/icontheme.ccg | 18 ++--
gtk/src/icontheme.hg | 20 ++--
gtk/src/iconview.ccg | 13 +--
gtk/src/iconview.hg | 11 +-
gtk/src/liststore.ccg | 6 +-
gtk/src/liststore.hg | 4 +-
gtk/src/main.ccg | 2 +-
gtk/src/main.hg | 2 +-
gtk/src/menushell.ccg | 14 ++--
gtk/src/menushell.hg | 1 -
gtk/src/notebook.hg | 1 -
gtk/src/papersize.ccg | 3 +-
gtk/src/papersize.hg | 9 +-
gtk/src/printer.ccg | 2 +
gtk/src/printer.hg | 10 +-
gtk/src/printsettings.ccg | 38 ++------
gtk/src/printsettings.hg | 20 ++++-
gtk/src/recentchooser.ccg | 9 +-
gtk/src/recentchooser.hg | 17 ++-
gtk/src/recentinfo.ccg | 10 +-
gtk/src/recentinfo.hg | 6 +-
gtk/src/recentmanager.ccg | 5 +-
gtk/src/recentmanager.hg | 8 +-
gtk/src/scalebutton.ccg | 2 +
gtk/src/scalebutton.hg | 9 +-
gtk/src/selectiondata.ccg | 6 +-
gtk/src/selectiondata.hg | 17 ++--
gtk/src/sizegroup.ccg | 2 +
gtk/src/sizegroup.hg | 8 +-
gtk/src/table.hg | 1 -
gtk/src/targetlist.ccg | 10 +-
gtk/src/targetlist.hg | 6 +-
gtk/src/textbuffer.ccg | 52 +++-------
gtk/src/textbuffer.hg | 17 ++--
gtk/src/textchildanchor.ccg | 2 +
gtk/src/textchildanchor.hg | 8 +-
gtk/src/textiter.ccg | 2 +
gtk/src/textiter.hg | 19 +++--
gtk/src/toolbar.hg | 1 -
gtk/src/treemodel.ccg | 16 +++-
gtk/src/treemodel.hg | 8 +-
gtk/src/treepath.hg | 5 +-
gtk/src/treeselection.ccg | 12 ++-
gtk/src/treeselection.hg | 7 +-
gtk/src/treestore.ccg | 6 +-
gtk/src/treestore.hg | 4 +-
gtk/src/treeview.ccg | 37 +++++---
gtk/src/treeview.hg | 13 ++-
gtk/src/treeviewcolumn.hg | 1 -
gtk/src/uimanager.ccg | 2 +
gtk/src/uimanager.hg | 18 ++--
gtk/src/widget.ccg | 12 ++-
gtk/src/widget.hg | 11 ++-
gtk/src/window.ccg | 2 +
gtk/src/window.hg | 21 +++--
tests/refcount_dialog/main.cc | 6 +-
113 files changed, 737 insertions(+), 654 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 4d6dd21..a886cf5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,118 @@
+2011-01-27 Krzesimir Nowak <qdlacz gmail com>
+
+ Adapted Gdk and Gtk to vectorutils.
+
+ * gdk/gdkmm/list.h: Deleted.
+ * gdk/gdkmm/filelist.am: Removed list.h from build.
+ * gdk/src/color.hg:
+ * gdk/src/device.ccg:
+ * gdk/src/device.hg:
+ * gdk/src/devicemanager.ccg:
+ * gdk/src/devicemanager.hg:
+ * gdk/src/display.ccg:
+ * gdk/src/dragcontext.ccg:
+ * gdk/src/dragcontext.hg:
+ * gdk/src/pixbuf.ccg:
+ * gdk/src/pixbuf.hg:
+ * gdk/src/pixbufformat.hg:
+ * gdk/src/rgba.hg:
+ * gdk/src/screen.hg:
+ * gdk/src/timecoord.hg:
+ * gdk/src/types.hg:
+ * gdk/src/window.ccg:
+ * gdk/src/window.hg: Adapted Gdk to vectorutils.
+ * gtk/gtkmm/listviewtext.cc:
+ * gtk/gtkmm/stock.cc:
+ * gtk/gtkmm/stock.h:
+ * gtk/gtkmm/stockid.h:
+ * gtk/gtkmm/targetentry.h:
+ * gtk/src/aboutdialog.ccg:
+ * gtk/src/aboutdialog.hg:
+ * gtk/src/action.ccg:
+ * gtk/src/action.hg:
+ * gtk/src/actiongroup.ccg:
+ * gtk/src/actiongroup.hg:
+ * gtk/src/application.ccg:
+ * gtk/src/application.hg:
+ * gtk/src/box.hg:
+ * gtk/src/builder.ccg:
+ * gtk/src/builder.hg:
+ * gtk/src/celllayout.ccg:
+ * gtk/src/celllayout.hg:
+ * gtk/src/clipboard.ccg:
+ * gtk/src/clipboard.hg:
+ * gtk/src/colorselection.ccg:
+ * gtk/src/colorselection.hg:
+ * gtk/src/container.ccg:
+ * gtk/src/container.hg:
+ * gtk/src/dialog.ccg:
+ * gtk/src/dialog.hg:
+ * gtk/src/enums.hg:
+ * gtk/src/filechooser.ccg:
+ * gtk/src/filechooser.hg:
+ * gtk/src/iconinfo.ccg:
+ * gtk/src/iconinfo.hg:
+ * gtk/src/iconset.ccg:
+ * gtk/src/iconset.hg:
+ * gtk/src/icontheme.ccg:
+ * gtk/src/icontheme.hg:
+ * gtk/src/iconview.ccg:
+ * gtk/src/iconview.hg:
+ * gtk/src/liststore.ccg:
+ * gtk/src/liststore.hg:
+ * gtk/src/main.ccg:
+ * gtk/src/main.hg:
+ * gtk/src/menushell.ccg:
+ * gtk/src/menushell.hg:
+ * gtk/src/notebook.hg:
+ * gtk/src/papersize.ccg:
+ * gtk/src/papersize.hg:
+ * gtk/src/printer.ccg:
+ * gtk/src/printer.hg:
+ * gtk/src/printsettings.ccg:
+ * gtk/src/printsettings.hg:
+ * gtk/src/recentchooser.ccg:
+ * gtk/src/recentchooser.hg:
+ * gtk/src/recentinfo.ccg:
+ * gtk/src/recentinfo.hg:
+ * gtk/src/recentmanager.ccg:
+ * gtk/src/recentmanager.hg:
+ * gtk/src/scalebutton.ccg:
+ * gtk/src/scalebutton.hg:
+ * gtk/src/selectiondata.ccg:
+ * gtk/src/selectiondata.hg:
+ * gtk/src/sizegroup.ccg:
+ * gtk/src/sizegroup.hg:
+ * gtk/src/table.hg:
+ * gtk/src/targetlist.ccg:
+ * gtk/src/targetlist.hg:
+ * gtk/src/textbuffer.ccg:
+ * gtk/src/textbuffer.hg:
+ * gtk/src/textchildanchor.ccg:
+ * gtk/src/textchildanchor.hg:
+ * gtk/src/textiter.ccg:
+ * gtk/src/textiter.hg:
+ * gtk/src/toolbar.hg:
+ * gtk/src/treemodel.ccg:
+ * gtk/src/treemodel.hg:
+ * gtk/src/treepath.hg:
+ * gtk/src/treeselection.ccg:
+ * gtk/src/treeselection.hg:
+ * gtk/src/treestore.ccg:
+ * gtk/src/treestore.hg:
+ * gtk/src/treeview.ccg:
+ * gtk/src/treeview.hg:
+ * gtk/src/treeviewcolumn.hg:
+ * gtk/src/uimanager.ccg:
+ * gtk/src/uimanager.hg:
+ * gtk/src/widget.ccg:
+ * gtk/src/widget.hg:
+ * gtk/src/window.ccg:
+ * gtk/src/window.hg: Adapted Gtk to vectorutils.
+ * demos/gtk-demo/example_change_display.cc:
+ * demos/gtk-demo/example_textview.cc:
+ * tests/refcount_dialog/main.cc: Fixed tests and examples.
+
2011-01-27 Murray Cumming <murrayc murrayc com>
Documentation: Added some since tags.
diff --git a/demos/gtk-demo/example_change_display.cc b/demos/gtk-demo/example_change_display.cc
index 40bd742..b212e02 100644
--- a/demos/gtk-demo/example_change_display.cc
+++ b/demos/gtk-demo/example_change_display.cc
@@ -213,7 +213,7 @@ void Example_ChangeDisplay::initialize_displays()
#ifndef G_OS_WIN32
Glib::RefPtr<Gdk::DisplayManager> refDisplayManager = Gdk::DisplayManager::get();
- typedef std::list< Glib::RefPtr<Gdk::Display> > type_listDisplays;
+ typedef std::vector< Glib::RefPtr<Gdk::Display> > type_listDisplays;
type_listDisplays listDisplays = refDisplayManager->list_displays();
for(type_listDisplays::iterator iter = listDisplays.begin(); iter != listDisplays.end(); ++iter)
diff --git a/demos/gtk-demo/example_textview.cc b/demos/gtk-demo/example_textview.cc
index 96c8f60..03ca5fe 100644
--- a/demos/gtk-demo/example_textview.cc
+++ b/demos/gtk-demo/example_textview.cc
@@ -216,9 +216,11 @@ void Example_TextView::insert_text(Glib::RefPtr<Gtk::TextBuffer>& refBuffer)
iter = refBuffer->insert_with_tag(iter, "a red background", "red_background");
iter = refBuffer->insert(iter, " or even ");
- typedef const char* type_constpch;
{
- type_constpch tag_names[] = {"blue_foreground", "red_background", 0};
+ std::vector<Glib::ustring> tag_names;
+
+ tag_names.push_back("blue_foreground");
+ tag_names.push_back("red_background");
iter = refBuffer->insert_with_tags_by_name(iter, "a blue foreground on red background", tag_names);
}
@@ -250,7 +252,10 @@ void Example_TextView::insert_text(Glib::RefPtr<Gtk::TextBuffer>& refBuffer)
iter = refBuffer->insert(iter, "You can adjust the amount of space before each line.\n");
{
- type_constpch tag_names[] = {"big_gap_before_line", "wide_margins", 0};
+ std::vector<Glib::ustring> tag_names;
+
+ tag_names.push_back("big_gap_before_line");
+ tag_names.push_back("wide_margins");
iter = refBuffer->insert_with_tags_by_name(iter,
"This line has a whole lot of space before it.\n", tag_names);
iter = refBuffer->insert_with_tags_by_name(iter,
@@ -258,7 +263,10 @@ void Example_TextView::insert_text(Glib::RefPtr<Gtk::TextBuffer>& refBuffer)
}
{
- type_constpch tag_names[] = {"double_spaced_line", "wide_margins", 0};
+ std::vector<Glib::ustring> tag_names;
+
+ tag_names.push_back("double_spaced_line");
+ tag_names.push_back("wide_margins");
iter = refBuffer->insert_with_tags_by_name(iter,
"You can also adjust the amount of space between wrapped lines; this line has extra space between each wrapped line in the same paragraph. To show off wrapping, some filler text: the quick brown fox jumped over the lazy dog. Blah blah blah blah blah blah blah blah blah.\n",
tag_names);
diff --git a/gdk/gdkmm/filelist.am b/gdk/gdkmm/filelist.am
index dcc7540..9c591c1 100644
--- a/gdk/gdkmm/filelist.am
+++ b/gdk/gdkmm/filelist.am
@@ -5,5 +5,5 @@ gdkmm_files_built_h = $(gdkmm_files_hg:.hg=.h)
gdkmm_files_built_ph = $(patsubst %.hg,private/%_p.h,$(gdkmm_files_hg))
gdkmm_files_extra_cc = general.cc
-gdkmm_files_extra_h = general.h list.h wrap_init.h
+gdkmm_files_extra_h = general.h wrap_init.h
gdkmm_files_extra_ph =
diff --git a/gdk/src/color.hg b/gdk/src/color.hg
index 70ee4df..78029e4 100644
--- a/gdk/src/color.hg
+++ b/gdk/src/color.hg
@@ -169,6 +169,4 @@ struct ColorTraits
};
#endif //DOXYGEN_SHOULD_SKIP_THIS
-typedef Glib::ArrayHandle<Color,ColorTraits> ArrayHandle_Color;
-
} // namespace Gdk
diff --git a/gdk/src/device.ccg b/gdk/src/device.ccg
index 2149fee..85feab4 100644
--- a/gdk/src/device.ccg
+++ b/gdk/src/device.ccg
@@ -26,7 +26,7 @@
namespace Gdk
{
-ArrayHandle_TimeCoords Device::get_history(const Glib::RefPtr<Window>& window, guint32 start, guint32 stop) const
+std::vector<TimeCoord> Device::get_history(const Glib::RefPtr<Window>& window, guint32 start, guint32 stop) const
{
GdkTimeCoord** coords = 0;
int events_count = 0;
@@ -34,7 +34,7 @@ ArrayHandle_TimeCoords Device::get_history(const Glib::RefPtr<Window>& window, g
// we don't care about returned value - false means that either getting history is unsupported or no motion events happened.
// it is undistinguishable.
gdk_device_get_history(const_cast<GdkDevice*>(gobj()), Glib::unwrap(window), start, stop, &coords, &events_count);
- return ArrayHandle_TimeCoords(coords, events_count, Glib::OWNERSHIP_DEEP);
+ return Glib::ArrayHandler<TimeCoord, TimeCoordPtrTraits>::array_to_vector(coords, events_count, Glib::OWNERSHIP_DEEP);
}
void Device::get_position(int& x, int& y) const
diff --git a/gdk/src/device.hg b/gdk/src/device.hg
index ad789ed..ffc7a56 100644
--- a/gdk/src/device.hg
+++ b/gdk/src/device.hg
@@ -17,6 +17,8 @@
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
+#include <vector>
+
//#include <gdkmm/window.h>
#include <gdkmm/cursor.h>
#include <gdkmm/event.h>
@@ -65,11 +67,11 @@ public:
_WRAP_METHOD(void get_state(const Glib::RefPtr<Window>& window, double& axes, ModifierType& mask), gdk_device_get_state)
// TODO: docs.
- ArrayHandle_TimeCoords get_history(const Glib::RefPtr<Window>& window, guint32 start, guint32 stop) const;
+ std::vector<TimeCoord> get_history(const Glib::RefPtr<Window>& window, guint32 start, guint32 stop) const;
_IGNORE(gdk_device_get_history)
-//#m4 _CONVERSION(`GList*',`Glib::ListHandle<Glib::RefPtr<Gdk::Device> >',`$2($3, Glib::OWNERSHIP_SHALLOW)')
- //_WRAP_METHOD(Glib::ListHandle<Glib::RefPtr<Gdk::Device> > list_slave_devices(), gdk_device_list_slave_devices)
- //_WRAP_METHOD(Glib::ListHandle<Glib::RefPtr<const Gdk::Device> > list_slave_devices() const, gdk_device_list_slave_devices, constversion)
+//#m4 _CONVERSION(`GList*',`std::vector<Glib::RefPtr<Gdk::Device> >',`Glib::ListHandler<Glib::RefPtr<Gdk::Device> >::list_to_vector($3, Glib::OWNERSHIP_SHALLOW)')
+ //_WRAP_METHOD(std::vector<Glib::RefPtr<Gdk::Device> > list_slave_devices(), gdk_device_list_slave_devices)
+ //_WRAP_METHOD(std::vector<Glib::RefPtr<const Gdk::Device> > list_slave_devices() const, gdk_device_list_slave_devices, constversion)
_WRAP_METHOD(int get_n_axes() const, gdk_device_get_n_axes)
//TODO: A list of GdkAtom, which we should show as strings: _WRAP_METHOD(GList * gdk_device_list_axes () const, gdk_device_list_axes)
diff --git a/gdk/src/devicemanager.ccg b/gdk/src/devicemanager.ccg
index 3d58fb7..fc4efe2 100644
--- a/gdk/src/devicemanager.ccg
+++ b/gdk/src/devicemanager.ccg
@@ -16,3 +16,5 @@
* License along with this library; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
+
+#include <glibmm/vectorutils.h>
diff --git a/gdk/src/devicemanager.hg b/gdk/src/devicemanager.hg
index fbf8894..63430dd 100644
--- a/gdk/src/devicemanager.hg
+++ b/gdk/src/devicemanager.hg
@@ -17,6 +17,8 @@
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
+#include <vector>
+
#include <gdkmm/device.h>
#include <gdkmm/display.h>
#include <gdk/gdk.h>
@@ -43,8 +45,10 @@ public:
_WRAP_METHOD(Glib::RefPtr<Display> get_display(), gdk_device_manager_get_display, refreturn)
_WRAP_METHOD(Glib::RefPtr<const Display> get_display() const, gdk_device_manager_get_display, refreturn, constversion)
- _WRAP_METHOD(Glib::ListHandle< Glib::RefPtr<Device> > list_devices(DeviceType type), gdk_device_manager_list_devices)
- _WRAP_METHOD(Glib::ListHandle< Glib::RefPtr<const Device> > list_devices(DeviceType type) const, gdk_device_manager_list_devices)
+#m4 _CONVERSION(`GList*',`std::vector< Glib::RefPtr<Device> >',`Glib::ListHandler<Glib::RefPtr<Device> >::list_to_vector($3, Glib::OWNERSHIP_SHALLOW)')
+ _WRAP_METHOD(std::vector< Glib::RefPtr<Device> > list_devices(DeviceType type), gdk_device_manager_list_devices)
+#m4 _CONVERSION(`GList*',`std::vector< Glib::RefPtr<const Device> >',`Glib::ListHandler<Glib::RefPtr<const Device> >::list_to_vector($3, Glib::OWNERSHIP_SHALLOW)')
+ _WRAP_METHOD(std::vector< Glib::RefPtr<const Device> > list_devices(DeviceType type) const, gdk_device_manager_list_devices)
_WRAP_METHOD(Glib::RefPtr<Device> get_client_pointer(), gdk_device_manager_get_client_pointer, refreturn)
diff --git a/gdk/src/display.ccg b/gdk/src/display.ccg
index a831b6d..56d7584 100644
--- a/gdk/src/display.ccg
+++ b/gdk/src/display.ccg
@@ -20,6 +20,8 @@
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
+#include <vector>
+
#include <gdkmm/devicemanager.h>
#include <gdkmm/window.h>
#include <gdk/gdk.h>
@@ -47,25 +49,16 @@ void Display::store_clipboard(const Glib::RefPtr<Gdk::Window>& clipboard_window,
gdk_display_store_clipboard(gobj(), clipboard_window->gobj(), time_, 0 /* see the C docs */, 0);
}
-void Display::store_clipboard(const Glib::RefPtr<Gdk::Window>& clipboard_window, guint32 time_, const Glib::StringArrayHandle& targets)
- {
- //Put it into a real container that we can use:
- std::vector<Glib::ustring> targets_copy = targets;
-
- //Create array of target GdkAtoms from target strings:
- if(!targets_copy.empty())
- {
- GdkAtom* pAtoms = new GdkAtom[targets_copy.size()];
-
- for(guint i = 0; i < targets_copy.size(); ++i)
- {
- *pAtoms = Gdk::AtomString::to_c_type(targets_copy[i]);
- }
-
- gdk_display_store_clipboard(gobj(), clipboard_window->gobj(), time_, 0 /* see the C docs */, 0);
-
- delete[] pAtoms;
- }
+void Display::store_clipboard(const Glib::RefPtr<Gdk::Window>& clipboard_window, guint32 time_, const std::vector<Glib::ustring>& targets)
+{
+ if (!targets.size ())
+ {
+ gdk_display_store_clipboard(gobj(),
+ Glib::unwrap (clipboard_window),
+ time_,
+ Glib::ArrayHandler<Glib::ustring, AtomStringTraits>::vector_to_array(targets).data (),
+ targets.size ());
+ }
}
} //Gdk
diff --git a/gdk/src/display.hg b/gdk/src/display.hg
index 6d8cb7a..17d5545 100644
--- a/gdk/src/display.hg
+++ b/gdk/src/display.hg
@@ -19,6 +19,8 @@
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
+#include <vector>
+
#include <gdkmm/screen.h>
//#include <gdkmm/devicemanager.h>
#include <gdkmm/types.h> //For ModifierType
@@ -156,7 +158,7 @@ public:
*/
void store_clipboard(const Glib::RefPtr<Gdk::Window>& clipboard_window, guint32 time_);
- void store_clipboard(const Glib::RefPtr<Gdk::Window>& clipboard_window, guint32 time_, const Glib::StringArrayHandle& targets);
+ void store_clipboard(const Glib::RefPtr<Gdk::Window>& clipboard_window, guint32 time_, const std::vector<Glib::ustring>& targets);
_IGNORE(gdk_display_store_clipboard)
_WRAP_METHOD(bool supports_shapes() const, gdk_display_supports_shapes)
diff --git a/gdk/src/displaymanager.hg b/gdk/src/displaymanager.hg
index 603442d..2684bf4 100644
--- a/gdk/src/displaymanager.hg
+++ b/gdk/src/displaymanager.hg
@@ -19,6 +19,8 @@
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
+#include <vector>
+
#include <glibmm/object.h>
#include <gdkmm/display.h>
@@ -45,7 +47,8 @@ public:
_WRAP_METHOD(void set_default_display(const Glib::RefPtr<Display>& display), gdk_display_manager_set_default_display)
- _WRAP_METHOD(Glib::SListHandle< Glib::RefPtr<Display> > list_displays(), gdk_display_manager_list_displays)
+#m4 _CONVERSION(`GSList*',`std::vector< Glib::RefPtr<Display> >',`Glib::SListHandler<Glib::RefPtr<Display> >::slist_to_vector($3, Glib::OWNERSHIP_SHALLOW)')
+ _WRAP_METHOD(std::vector< Glib::RefPtr<Display> > list_displays(), gdk_display_manager_list_displays)
_WRAP_METHOD(Glib::RefPtr<Display> open_display(const Glib::ustring& name), gdk_display_manager_open_display, refreturn)
diff --git a/gdk/src/dragcontext.ccg b/gdk/src/dragcontext.ccg
index 0f07a1d..0826d5a 100644
--- a/gdk/src/dragcontext.ccg
+++ b/gdk/src/dragcontext.ccg
@@ -20,6 +20,8 @@
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
+#include <glibmm/vectorutils.h>
+
#include <gdkmm/window.h>
#include <gtk/gtk.h>
#include <gdk/gdk.h>
@@ -42,10 +44,10 @@ void DragContext::drag_refuse(guint32 time)
gdk_drag_status(gobj(), ((GdkDragAction)(0)) /* see GDK docs */, time);
}
-Gdk::ListHandle_AtomString DragContext::list_targets() const
+std::vector<std::string> DragContext::list_targets() const
{
//Note that we don't free the GList* (or it's items), because we are accessing the struct directly:
- return ListHandle_AtomString( gdk_drag_context_list_targets(const_cast<GdkDragContext*>(gobj())), Glib::OWNERSHIP_NONE);
+ return Glib::ListHandler<std::string, AtomStringTraits>::list_to_vector( gdk_drag_context_list_targets(const_cast<GdkDragContext*>(gobj())), Glib::OWNERSHIP_NONE);
}
} /* namespace Gdk */
diff --git a/gdk/src/dragcontext.hg b/gdk/src/dragcontext.hg
index 7bb38eb..bb71272 100644
--- a/gdk/src/dragcontext.hg
+++ b/gdk/src/dragcontext.hg
@@ -19,11 +19,12 @@
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
+#include <vector>
+
#include <gdkmm/color.h>
#include <gdkmm/pixbuf.h>
#include <gdkmm/device.h>
#include <glibmm/object.h>
-#include <glibmm/listhandle.h>
#include <cairomm/surface.h>
#include <gdk/gdk.h>
_DEFS(gdkmm,gdk)
@@ -106,7 +107,7 @@ public:
/** Get a list of targets offered by the source.
* @result a list of targets offered by the source.
*/
- Gdk::ListHandle_AtomString list_targets() const;
+ std::vector<std::string> list_targets() const;
_IGNORE(gdk_drag_context_list_targets)
_WRAP_METHOD(DragAction get_actions() const, gdk_drag_context_get_actions)
diff --git a/gdk/src/pixbuf.ccg b/gdk/src/pixbuf.ccg
index 4086710..6a2f22f 100644
--- a/gdk/src/pixbuf.ccg
+++ b/gdk/src/pixbuf.ccg
@@ -18,6 +18,8 @@
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
+#include <glibmm/vectorutils.h>
+
#include <gdkmm/window.h>
#include <gdk/gdk.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
@@ -119,14 +121,15 @@ void Pixbuf::save(const std::string& filename, const Glib::ustring& type)
void Pixbuf::save(const std::string& filename, const Glib::ustring& type,
- const Glib::StringArrayHandle& option_keys,
- const Glib::StringArrayHandle& option_values)
+ const std::vector<Glib::ustring>& option_keys,
+ const std::vector<Glib::ustring>& option_values)
{
GError* gerror = 0;
gdk_pixbuf_savev(
gobj(), filename.c_str(), type.c_str(),
- const_cast<char**>(option_keys.data()), const_cast<char**>(option_values.data()),
+ const_cast<char**>(Glib::ArrayHandler<Glib::ustring>::vector_to_array(option_keys).data ()),
+ const_cast<char**>(Glib::ArrayHandler<Glib::ustring>::vector_to_array(option_values).data ()),
&gerror);
if(gerror)
@@ -150,24 +153,25 @@ void Pixbuf::save_to_buffer(gchar*& buffer, gsize& buffer_size,
void Pixbuf::save_to_buffer(gchar*& buffer, gsize& buffer_size,
const Glib::ustring& type,
- const Glib::StringArrayHandle& option_keys,
- const Glib::StringArrayHandle& option_values)
+ const std::vector<Glib::ustring>& option_keys,
+ const std::vector<Glib::ustring>& option_values)
{
GError* gerror = 0;
gdk_pixbuf_save_to_bufferv(
gobj(), &buffer, &buffer_size,
type.c_str(),
- const_cast<char**>(option_keys.data()), const_cast<char**>(option_values.data()),
+ const_cast<char**>(Glib::ArrayHandler<Glib::ustring>::vector_to_array(option_keys).data ()),
+ const_cast<char**>(Glib::ArrayHandler<Glib::ustring>::vector_to_array(option_values).data ()),
&gerror);
if(gerror)
::Glib::Error::throw_exception(gerror);
}
-Pixbuf::SListHandle_PixbufFormat Pixbuf::get_formats()
+std::vector<PixbufFormat> Pixbuf::get_formats()
{
- return SListHandle_PixbufFormat(gdk_pixbuf_get_formats(), Glib::OWNERSHIP_SHALLOW);
+ return Glib::SListHandler<PixbufFormat, PixbufFormatTraits>::slist_to_vector(gdk_pixbuf_get_formats(), Glib::OWNERSHIP_SHALLOW);
}
} // namespace Gdk
diff --git a/gdk/src/pixbuf.hg b/gdk/src/pixbuf.hg
index 8b5fff8..b152fa4 100644
--- a/gdk/src/pixbuf.hg
+++ b/gdk/src/pixbuf.hg
@@ -19,6 +19,8 @@
// the #ifndef GDKMM_DISABLE_DEPRECATED in deprecated classes) is generated:
_CONFIGINCLUDE(gdkmmconfig.h)
+#include <vector>
+
//#include <gdkmm/window.h>
#include <gdkmm/pixbufformat.h>
#include <gdkmm/types.h>
@@ -301,8 +303,8 @@ public:
* @throw Gdk::PixbufError
*/
void save(const std::string& filename, const Glib::ustring& type,
- const Glib::StringArrayHandle& option_keys,
- const Glib::StringArrayHandle& option_values);
+ const std::vector<Glib::ustring>& option_keys,
+ const std::vector<Glib::ustring>& option_values);
_IGNORE(gdk_pixbuf_savev)
@@ -357,8 +359,8 @@ gboolean gdk_pixbuf_save_to_callbackv (GdkPixbuf *pixbuf,
*/
void save_to_buffer(gchar*& buffer, gsize& buffer_size,
const Glib::ustring& type,
- const Glib::StringArrayHandle& option_keys,
- const Glib::StringArrayHandle& option_values);
+ const std::vector<Glib::ustring>& option_keys,
+ const std::vector<Glib::ustring>& option_values);
_IGNORE(gdk_pixbuf_save_to_bufferv, gdk_pixbuf_save_to_buffer)
@@ -434,8 +436,7 @@ gboolean gdk_pixbuf_save_to_callbackv (GdkPixbuf *pixbuf,
_WRAP_METHOD(Glib::RefPtr<Pixbuf> apply_embedded_orientation(), gdk_pixbuf_apply_embedded_orientation)
//TODO: Documentation
- typedef Glib::SListHandle< Glib::RefPtr<PixbufFormat>, PixbufFormatTraits > SListHandle_PixbufFormat;
- static SListHandle_PixbufFormat get_formats();
+ static std::vector<PixbufFormat> get_formats();
_IGNORE(gdk_pixbuf_get_formats)
};
diff --git a/gdk/src/pixbufformat.hg b/gdk/src/pixbufformat.hg
index fd0c524..8b4bbce 100644
--- a/gdk/src/pixbufformat.hg
+++ b/gdk/src/pixbufformat.hg
@@ -35,8 +35,10 @@ public:
_WRAP_METHOD(Glib::ustring get_name() const, gdk_pixbuf_format_get_name)
_WRAP_METHOD(Glib::ustring get_description() const, gdk_pixbuf_format_get_description)
- _WRAP_METHOD(Glib::StringArrayHandle get_mime_types() const, gdk_pixbuf_format_get_mime_types)
- _WRAP_METHOD(Glib::StringArrayHandle get_extensions() const, gdk_pixbuf_format_get_extensions)
+
+#m4 _CONVERSION(`gchar**',`std::vector<Glib::ustring>',`Glib::ArrayHandler<Glib::ustring>::array_to_vector($3, Glib::OWNERSHIP_DEEP)')
+ _WRAP_METHOD(std::vector<Glib::ustring> get_mime_types() const, gdk_pixbuf_format_get_mime_types)
+ _WRAP_METHOD(std::vector<Glib::ustring> get_extensions() const, gdk_pixbuf_format_get_extensions)
_WRAP_METHOD(bool is_writable() const, gdk_pixbuf_format_is_writable)
_WRAP_METHOD(bool is_scalable() const, gdk_pixbuf_format_is_scalable)
diff --git a/gdk/src/rgba.hg b/gdk/src/rgba.hg
index 32a4b33..f0e9f22 100644
--- a/gdk/src/rgba.hg
+++ b/gdk/src/rgba.hg
@@ -179,6 +179,4 @@ struct RGBATraits
};
#endif //DOXYGEN_SHOULD_SKIP_THIS
-typedef Glib::ArrayHandle<RGBA,RGBATraits> ArrayHandle_RGBA;
-
} // namespace Gdk
diff --git a/gdk/src/screen.hg b/gdk/src/screen.hg
index 7a6a6e5..10bd0da 100644
--- a/gdk/src/screen.hg
+++ b/gdk/src/screen.hg
@@ -67,11 +67,11 @@ public:
_WRAP_METHOD(int get_width_mm() const, gdk_screen_get_width_mm)
_WRAP_METHOD(int get_height_mm() const, gdk_screen_get_height_mm)
-#m4 _CONVERSION(`GList*',`Glib::ListHandle< Glib::RefPtr<Visual> >',`$2($3, Glib::OWNERSHIP_SHALLOW)')
- _WRAP_METHOD(Glib::ListHandle< Glib::RefPtr<Visual> > list_visuals(), gdk_screen_list_visuals)
+#m4 _CONVERSION(`GList*',`std::vector< Glib::RefPtr<Visual> >',`Glib::ListHandler< Glib::RefPtr<Visual> >::list_to_vector($3, Glib::OWNERSHIP_SHALLOW)')
+ _WRAP_METHOD(std::vector< Glib::RefPtr<Visual> > list_visuals(), gdk_screen_list_visuals)
-#m4 _CONVERSION(`GList*',`Glib::ListHandle< Glib::RefPtr<Window> >',`$2($3, Glib::OWNERSHIP_SHALLOW)')
- _WRAP_METHOD(Glib::ListHandle< Glib::RefPtr<Window> > get_toplevel_windows(), gdk_screen_get_toplevel_windows)
+#m4 _CONVERSION(`GList*',`std::vector< Glib::RefPtr<Window> >',`Glib::ListHandler< Glib::RefPtr<Window> >::list_to_vector($3, Glib::OWNERSHIP_SHALLOW)')
+ _WRAP_METHOD(std::vector< Glib::RefPtr<Window> > get_toplevel_windows(), gdk_screen_get_toplevel_windows)
_WRAP_METHOD(Glib::ustring make_display_name(), gdk_screen_make_display_name)
@@ -105,8 +105,8 @@ public:
_WRAP_METHOD(Glib::RefPtr<Gdk::Window> get_active_window(), gdk_screen_get_active_window, refreturn)
_WRAP_METHOD(Glib::RefPtr<const Gdk::Window> get_active_window() const, gdk_screen_get_active_window, refreturn, constversion)
-#m4 _CONVERSION(`GList*',`Glib::ListHandle< Glib::RefPtr<Window> >',`$2($3, Glib::OWNERSHIP_DEEP)')
- _WRAP_METHOD(Glib::ListHandle< Glib::RefPtr<Window> > get_window_stack(), gdk_screen_get_window_stack)
+#m4 _CONVERSION(`GList*',`std::vector< Glib::RefPtr<Window> >',`Glib::ListHandler< Glib::RefPtr<Window> >::list_to_vector($3, Glib::OWNERSHIP_DEEP)')
+ _WRAP_METHOD(std::vector< Glib::RefPtr<Window> > get_window_stack(), gdk_screen_get_window_stack)
//We use no_default_handler because GdkDisplayManagerClass is private.
diff --git a/gdk/src/timecoord.hg b/gdk/src/timecoord.hg
index 7f79824..975fc26 100644
--- a/gdk/src/timecoord.hg
+++ b/gdk/src/timecoord.hg
@@ -62,6 +62,5 @@ struct TimeCoordPtrTraits
static void release_c_type(const CType& obj) { g_free(const_cast<CType>(obj)); }
};
#endif
-typedef Glib::ArrayHandle<TimeCoord, TimeCoordPtrTraits> ArrayHandle_TimeCoords;
} // namespace Gdk
diff --git a/gdk/src/types.hg b/gdk/src/types.hg
index 2715530..4e3cfff 100644
--- a/gdk/src/types.hg
+++ b/gdk/src/types.hg
@@ -100,6 +100,18 @@ inline bool operator!=(const Point& lhs, const Point& rhs)
{ return !lhs.equal(rhs); }
#ifndef DOXYGEN_SHOULD_SKIP_THIS
+struct PointTraits
+{
+ typedef Gdk::Point CppType;
+ typedef GdkPoint CType;
+ typedef GdkPoint CTypeNonConst;
+
+ static CType to_c_type (CType c_obj) { return c_obj; }
+ static void release_c_type (CType) {}
+ static CType to_c_type (const CppType& cpp_obj) { return *(cpp_obj.gobj ()); }
+ static CppType to_cpp_type (CType c_obj) { return CppType (c_obj.x, c_obj.y); }
+};
+
struct AtomStringTraits
{
typedef std::string CppType;
@@ -121,9 +133,6 @@ struct AtomStringTraits
typedef AtomStringTraits AtomString;
#endif //DOXYGEN_SHOULD_SKIP_THIS
-typedef Glib::ArrayHandle<std::string,AtomStringTraits> ArrayHandle_AtomString;
-typedef Glib::ListHandle<std::string,AtomStringTraits> ListHandle_AtomString;
-
} // namespace Gdk
diff --git a/gdk/src/window.ccg b/gdk/src/window.ccg
index cbc0458..535b50e 100644
--- a/gdk/src/window.ccg
+++ b/gdk/src/window.ccg
@@ -59,30 +59,9 @@ void Window::restack(bool above)
gdk_window_restack(gobj(), NULL, above);
}
-Glib::RefPtr<DragContext> Window::drag_begin(const Glib::StringArrayHandle& targets)
+Glib::RefPtr<DragContext> Window::drag_begin (const std::vector<Glib::ustring>& targets)
{
- Glib::RefPtr<DragContext> result;
-
- //Put it into a real container that we can use:
- std::vector<Glib::ustring> targets_copy = targets;
-
- //Create GList from target strings:
- if(!targets_copy.empty())
- {
- GList* list = 0;
-
- for(guint i = 0; i < targets_copy.size(); ++i)
- {
- GdkAtom atom = Gdk::AtomString::to_c_type(targets_copy[i]);
- list = g_list_append (list, GUINT_TO_POINTER (atom));
- }
-
- result = Glib::wrap(gdk_drag_begin(gobj(), list), true);
-
- g_list_free(list);
- }
-
- return result;
+ return Glib::wrap (gdk_drag_begin (gobj (), Glib::ListHandler<Glib::ustring, AtomStringTraits>::vector_to_list(targets).data ()), true);
}
diff --git a/gdk/src/window.hg b/gdk/src/window.hg
index 630cb2b..ad86e74 100644
--- a/gdk/src/window.hg
+++ b/gdk/src/window.hg
@@ -205,8 +205,10 @@ public:
_WRAP_METHOD(Glib::RefPtr<Window> get_effective_toplevel(), gdk_window_get_effective_toplevel, refreturn)
_WRAP_METHOD(Glib::RefPtr<const Window> get_effective_toplevel() const, gdk_window_get_effective_toplevel, refreturn, constversion)
- _WRAP_METHOD(Glib::ListHandle< Glib::RefPtr<Window> > get_children(), gdk_window_get_children)
- _WRAP_METHOD(Glib::ListHandle< Glib::RefPtr<const Window> > get_children() const, gdk_window_get_children)
+#m4 _CONVERSION(`GList*',`std::vector< Glib::RefPtr<Window> >',`Glib::ListHandler<Glib::RefPtr<Window> >::list_to_vector($3, Glib::OWNERSHIP_SHALLOW)')
+ _WRAP_METHOD(std::vector< Glib::RefPtr<Window> > get_children(), gdk_window_get_children)
+#m4 _CONVERSION(`GList*',`std::vector< Glib::RefPtr<const Window> >',`Glib::ListHandler<Glib::RefPtr<const Window> >::list_to_vector($3, Glib::OWNERSHIP_SHALLOW)')
+ _WRAP_METHOD(std::vector< Glib::RefPtr<const Window> > get_children() const, gdk_window_get_children)
_IGNORE(gdk_window_peek_children) //gdk_window_peek_children() is the same as gdk_window_get_children() with different memory mangement of the list.
_WRAP_METHOD(EventMask get_events() const, gdk_window_get_events)
@@ -218,7 +220,8 @@ public:
_WRAP_METHOD(EventMask get_source_events(InputSource source) const, gdk_window_get_source_events)
_WRAP_METHOD(void set_source_events(InputSource source, EventMask event_mask), gdk_window_set_source_events)
- _WRAP_METHOD(void set_icon_list(const Glib::ListHandle< Glib::RefPtr<Gdk::Pixbuf> >& pixbufs), gdk_window_set_icon_list)
+#m4 _CONVERSION(`const std::vector< Glib::RefPtr<Gdk::Pixbuf> >&',`GList*',`Glib::ListHandler<Glib::RefPtr<Gdk::Pixbuf> >::vector_to_list($3).data ()')
+ _WRAP_METHOD(void set_icon_list(const std::vector< Glib::RefPtr<Gdk::Pixbuf> >& pixbufs), gdk_window_set_icon_list)
void unset_icon();
_WRAP_METHOD(void set_icon_name(const Glib::ustring& name), gdk_window_set_icon_name)
@@ -257,7 +260,7 @@ public:
*
* @newin{2,24}
*/
- Glib::RefPtr<DragContext> drag_begin(const Glib::StringArrayHandle& targets);
+ Glib::RefPtr<DragContext> drag_begin(const std::vector<Glib::ustring>& targets);
_IGNORE(gdk_drag_begin)
_WRAP_METHOD(void invalidate_rect(const Rectangle& rect, bool invalidate_children), gdk_window_invalidate_rect)
diff --git a/gtk/gtkmm/listviewtext.cc b/gtk/gtkmm/listviewtext.cc
index e9eee8a..68653e9 100644
--- a/gtk/gtkmm/listviewtext.cc
+++ b/gtk/gtkmm/listviewtext.cc
@@ -163,7 +163,7 @@ guint ListViewText::get_num_columns() const
ListViewText::SelectionList ListViewText::get_selected()
{
Glib::RefPtr<Gtk::TreeSelection> selected = get_selection();
- Gtk::TreeSelection::ListHandle_Path selectedRows = selected->get_selected_rows();
+ std::vector<TreeModel::Path> selectedRows = selected->get_selected_rows();
// Reserve space
SelectionList selectionList;
@@ -171,7 +171,7 @@ ListViewText::SelectionList ListViewText::get_selected()
// Save selected rows
- for(Gtk::TreeSelection::ListHandle_Path::const_iterator iter = selectedRows.begin(); iter != selectedRows.end(); ++iter)
+ for (std::vector<TreeModel::Path>::const_iterator iter = selectedRows.begin(); iter != selectedRows.end(); ++iter)
{
selectionList.push_back( *((*iter).begin()) );
}
diff --git a/gtk/gtkmm/stock.cc b/gtk/gtkmm/stock.cc
index 2ab73f1..c679c0b 100644
--- a/gtk/gtkmm/stock.cc
+++ b/gtk/gtkmm/stock.cc
@@ -162,9 +162,9 @@ bool lookup(const Gtk::StockID& stock_id, Gtk::IconSize size, Gtk::Image& image)
return (image.gobj() != 0);
}
-Glib::SListHandle<Gtk::StockID,Gtk::StockID_Traits> get_ids()
+std::vector<Gtk::StockID> get_ids()
{
- return Glib::SListHandle<Gtk::StockID,Gtk::StockID_Traits>(
+ return Glib::SListHandler<Gtk::StockID,Gtk::StockIDTraits>::slist_to_vector(
gtk_stock_list_ids(), Glib::OWNERSHIP_DEEP);
}
diff --git a/gtk/gtkmm/stock.h b/gtk/gtkmm/stock.h
index 51842f6..e7ed80c 100644
--- a/gtk/gtkmm/stock.h
+++ b/gtk/gtkmm/stock.h
@@ -217,7 +217,7 @@ bool lookup(const Gtk::StockID& stock_id, Gtk::IconSize size, Gtk::Image& image)
*
* @return list of all known stock IDs.
*/
-Glib::SListHandle<Gtk::StockID,Gtk::StockID_Traits> get_ids();
+std::vector<Gtk::StockID> get_ids();
} // namespace Stock
diff --git a/gtk/gtkmm/stockid.h b/gtk/gtkmm/stockid.h
index e238aaf..762d1c9 100644
--- a/gtk/gtkmm/stockid.h
+++ b/gtk/gtkmm/stockid.h
@@ -105,7 +105,7 @@ inline bool operator!=(const StockID& lhs, const StockID& rhs)
#ifndef DOXYGEN_SHOULD_SKIP_THIS
-struct StockID_Traits : public Glib::Container_Helpers::TypeTraits<Glib::ustring>
+struct StockIDTraits : public Glib::Container_Helpers::TypeTraits<Glib::ustring>
{
typedef Gtk::StockID CppType;
diff --git a/gtk/gtkmm/targetentry.h b/gtk/gtkmm/targetentry.h
index 16622bd..87610ec 100644
--- a/gtk/gtkmm/targetentry.h
+++ b/gtk/gtkmm/targetentry.h
@@ -25,7 +25,6 @@
#include <glibmm/utility.h>
#include <glibmm/ustring.h>
-#include <glibmm/arrayhandle.h>
#include <gtkmm/enums.h>
#include <gtk/gtk.h> //For GtkTargetEntry.
@@ -69,7 +68,7 @@ protected:
};
#ifndef DOXYGEN_SHOULD_SKIP_THIS
-struct TargetEntry_Traits
+struct TargetEntryTraits
{
typedef TargetEntry CppType;
typedef GtkTargetEntry CType;
@@ -88,8 +87,6 @@ struct TargetEntry_Traits
};
#endif /* DOXYGEN_SHOULD_SKIP_THIS */
-typedef Glib::ArrayHandle< TargetEntry, TargetEntry_Traits > ArrayHandle_TargetEntry;
-
} /* namespace Gtk */
diff --git a/gtk/src/aboutdialog.ccg b/gtk/src/aboutdialog.ccg
index 2be6eee..2f70d48 100644
--- a/gtk/src/aboutdialog.ccg
+++ b/gtk/src/aboutdialog.ccg
@@ -20,4 +20,6 @@
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
+#include <glibmm/vectorutils.h>
+
#include <gtk/gtk.h>
diff --git a/gtk/src/aboutdialog.hg b/gtk/src/aboutdialog.hg
index e1dfd36..3bac4ab 100644
--- a/gtk/src/aboutdialog.hg
+++ b/gtk/src/aboutdialog.hg
@@ -18,8 +18,9 @@
_CONFIGINCLUDE(gtkmmconfig.h)
+#include <vector>
+
#include <gtkmm/dialog.h>
-//#include <glibmm/listhandle.h>
_DEFS(gtkmm,gtk)
_PINCLUDE(gtkmm/private/dialog_p.h)
@@ -72,19 +73,17 @@ public:
_WRAP_METHOD(Glib::ustring get_website_label() const, gtk_about_dialog_get_website_label)
_WRAP_METHOD(void set_website_label(const Glib::ustring& website_label), gtk_about_dialog_set_website_label)
- #m4 _CONVERSION(`const gchar**',`Glib::StringArrayHandle',`Glib::StringArrayHandle($3)')
-
- _WRAP_METHOD(Glib::StringArrayHandle get_authors() const, gtk_about_dialog_get_authors)
-
- _WRAP_METHOD(void set_authors(const Glib::StringArrayHandle& authors) const, gtk_about_dialog_set_authors)
+#m4 _CONVERSION(`const gchar**',`std::vector<Glib::ustring>',`Glib::ArrayHandler<Glib::ustring>::array_to_vector($3, Glib::OWNERSHIP_NONE)')
+ _WRAP_METHOD(std::vector<Glib::ustring> get_authors() const, gtk_about_dialog_get_authors)
- _WRAP_METHOD(Glib::StringArrayHandle get_documenters() const, gtk_about_dialog_get_documenters)
+#m4 _CONVERSION(`const std::vector<Glib::ustring>&',`const gchar**',`Glib::ArrayHandler<Glib::ustring>::vector_to_array($3).data ()')
+ _WRAP_METHOD(void set_authors(const std::vector<Glib::ustring>& authors) const, gtk_about_dialog_set_authors)
- #m4 _CONVERSION(`const Glib::StringArrayHandle&',`const gchar**',`const_cast<const gchar**>(($3).data())')
+ _WRAP_METHOD(std::vector<Glib::ustring> get_documenters() const, gtk_about_dialog_get_documenters)
- _WRAP_METHOD(void set_documenters(const Glib::StringArrayHandle& documenters), gtk_about_dialog_set_documenters)
- _WRAP_METHOD(Glib::StringArrayHandle get_artists() const, gtk_about_dialog_get_artists)
- _WRAP_METHOD(void set_artists(const Glib::StringArrayHandle& artists), gtk_about_dialog_set_artists)
+ _WRAP_METHOD(void set_documenters(const std::vector<Glib::ustring>& documenters), gtk_about_dialog_set_documenters)
+ _WRAP_METHOD(std::vector<Glib::ustring> get_artists() const, gtk_about_dialog_get_artists)
+ _WRAP_METHOD(void set_artists(const std::vector<Glib::ustring>& artists), gtk_about_dialog_set_artists)
_WRAP_METHOD(Glib::ustring get_translator_credits() const, gtk_about_dialog_get_translator_credits)
_WRAP_METHOD(void set_translator_credits(const Glib::ustring& translator_credits), gtk_about_dialog_set_translator_credits)
@@ -108,10 +107,10 @@ public:
_WRAP_PROPERTY("website_label", Glib::ustring)
_WRAP_PROPERTY("license", Glib::ustring)
_WRAP_PROPERTY("license-type", License)
- _WRAP_PROPERTY("authors", Glib::StringArrayHandle)
- _WRAP_PROPERTY("documenters", Glib::StringArrayHandle)
- _WRAP_PROPERTY("translator_credits", Glib::StringArrayHandle)
- _WRAP_PROPERTY("artists", Glib::StringArrayHandle)
+ _WRAP_PROPERTY("authors", std::vector<Glib::ustring>)
+ _WRAP_PROPERTY("documenters", std::vector<Glib::ustring>)
+ _WRAP_PROPERTY("translator_credits", std::vector<Glib::ustring>)
+ _WRAP_PROPERTY("artists", std::vector<Glib::ustring>)
_WRAP_PROPERTY("logo", Glib::RefPtr<Gdk::Pixbuf>)
_WRAP_PROPERTY("logo_icon_name", Glib::ustring)
_WRAP_PROPERTY("wrap_license", bool)
diff --git a/gtk/src/action.ccg b/gtk/src/action.ccg
index ea88e6a..aaf2325 100644
--- a/gtk/src/action.ccg
+++ b/gtk/src/action.ccg
@@ -18,6 +18,8 @@
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
+#include <glibmm/vectorutils.h>
+
#include <gtk/gtk.h>
#include <gtkmm/menu.h>
diff --git a/gtk/src/action.hg b/gtk/src/action.hg
index e326110..74ab877 100644
--- a/gtk/src/action.hg
+++ b/gtk/src/action.hg
@@ -17,6 +17,8 @@
_CONFIGINCLUDE(gtkmmconfig.h)
+#include <vector>
+
#include <gtkmm/widget.h>
#include <gtkmm/accelgroup.h>
#include <gtkmm/stockid.h>
@@ -162,11 +164,11 @@ public:
_IGNORE(gtk_action_connect_proxy, gtk_action_disconnect_proxy) // deprecated
#m4 dnl // This isn't in convert_gtk.m4, and the default behaviour is wrong.
-#m4 _CONVERSION(`GSList*', `Glib::SListHandle<Widget*>', `$2($3, Glib::OWNERSHIP_NONE)')
-#m4 _CONVERSION(`GSList*', `Glib::SListHandle<const Widget*>', `$2($3, Glib::OWNERSHIP_NONE)')
+#m4 _CONVERSION(`GSList*', `std::vector<Widget*>', `Glib::SListHandler<Widget*>::slist_to_vector($3, Glib::OWNERSHIP_NONE)')
+#m4 _CONVERSION(`GSList*', `std::vector<const Widget*>', `Glib::SListHandler<const Widget*>::slist_to_vector($3, Glib::OWNERSHIP_NONE)')
- _WRAP_METHOD(Glib::SListHandle<Widget*> get_proxies(), gtk_action_get_proxies)
- _WRAP_METHOD(Glib::SListHandle<const Widget*> get_proxies() const, gtk_action_get_proxies)
+ _WRAP_METHOD(std::vector<Widget*> get_proxies(), gtk_action_get_proxies)
+ _WRAP_METHOD(std::vector<const Widget*> get_proxies() const, gtk_action_get_proxies)
_WRAP_METHOD(void connect_accelerator(), gtk_action_connect_accelerator)
_WRAP_METHOD(void disconnect_accelerator(), gtk_action_disconnect_accelerator)
diff --git a/gtk/src/actiongroup.ccg b/gtk/src/actiongroup.ccg
index 23af142..5ab0cc9 100644
--- a/gtk/src/actiongroup.ccg
+++ b/gtk/src/actiongroup.ccg
@@ -18,6 +18,8 @@
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
+#include <glibmm/vectorutils.h>
+
#include <gtk/gtk.h>
#include <gtkmm/accelmap.h>
diff --git a/gtk/src/actiongroup.hg b/gtk/src/actiongroup.hg
index bf4e6fa..d5a8913 100644
--- a/gtk/src/actiongroup.hg
+++ b/gtk/src/actiongroup.hg
@@ -17,6 +17,8 @@
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
+#include <vector>
+
#include <gtkmm/widget.h>
#include <gtkmm/action.h>
#include <gtkmm/accelkey.h>
@@ -51,8 +53,10 @@ public:
_WRAP_METHOD(Glib::RefPtr<Action> get_action(const Glib::ustring& action_name), gtk_action_group_get_action, refreturn)
_WRAP_METHOD(Glib::RefPtr<const Action> get_action(const Glib::ustring& action_name) const, gtk_action_group_get_action, refreturn, constversion)
- _WRAP_METHOD(Glib::ListHandle< Glib::RefPtr<Action> > get_actions(), gtk_action_group_list_actions)
- _WRAP_METHOD(Glib::ListHandle< Glib::RefPtr<const Action> > get_actions() const, gtk_action_group_list_actions)
+#m4 _CONVERSION(`GList*',`std::vector< Glib::RefPtr<Action> >',`Glib::ListHandler< Glib::RefPtr<Action> >::list_to_vector($3, Glib::OWNERSHIP_SHALLOW)')
+ _WRAP_METHOD(std::vector< Glib::RefPtr<Action> > get_actions(), gtk_action_group_list_actions)
+#m4 _CONVERSION(`GList*',`std::vector< Glib::RefPtr<const Action> >',`Glib::ListHandler< Glib::RefPtr<const Action> >::list_to_vector($3, Glib::OWNERSHIP_SHALLOW)')
+ _WRAP_METHOD(std::vector< Glib::RefPtr<const Action> > get_actions() const, gtk_action_group_list_actions)
void add(const Glib::RefPtr<Action>& action);
_IGNORE(gtk_action_group_add_action)
diff --git a/gtk/src/application.ccg b/gtk/src/application.ccg
index d8273d7..c839677 100644
--- a/gtk/src/application.ccg
+++ b/gtk/src/application.ccg
@@ -18,6 +18,8 @@
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
+#include <glibmm/vectorutils.h>
+
#include <gtk/gtk.h>
#include <gtkmm/window.h>
#include <glibmm/init.h>
diff --git a/gtk/src/application.hg b/gtk/src/application.hg
index b8caba0..1b538e0 100644
--- a/gtk/src/application.hg
+++ b/gtk/src/application.hg
@@ -17,6 +17,8 @@
_CONFIGINCLUDE(gtkmmconfig.h)
+#include <vector>
+
#include <giomm/application.h>
#include <gtkmm/actiongroup.h>
@@ -70,11 +72,11 @@ public:
_WRAP_CREATE(int argc, char** argv, const Glib::ustring& application_id, Gio::ApplicationFlags flags = Gio::APPLICATION_FLAGS_NONE)
-#m4 _CONVERSION(`GList*',`Glib::ListHandle<Window*>',`$2($3, Glib::OWNERSHIP_NONE)')
- _WRAP_METHOD(Glib::ListHandle<Window*> get_windows(), gtk_application_get_windows)
+#m4 _CONVERSION(`GList*',`std::vector<Window*>',`Glib::ListHandler<Window*>::list_to_vector($3, Glib::OWNERSHIP_NONE)')
+ _WRAP_METHOD(std::vector<Window*> get_windows(), gtk_application_get_windows)
-#m4 _CONVERSION(`GList*',`Glib::ListHandle<const Window*>',`$2($3, Glib::OWNERSHIP_NONE)')
- _WRAP_METHOD(Glib::ListHandle<const Window*> get_windows() const, gtk_application_get_windows)
+#m4 _CONVERSION(`GList*',`std::vector<const Window*>',`Glib::ListHandler<const Window*>::list_to_vector($3, Glib::OWNERSHIP_NONE)')
+ _WRAP_METHOD(std::vector<const Window*> get_windows() const, gtk_application_get_windows)
/** Adds a window to the Gtk::Application.
*
diff --git a/gtk/src/box.hg b/gtk/src/box.hg
index 5302399..6caaddf 100644
--- a/gtk/src/box.hg
+++ b/gtk/src/box.hg
@@ -28,7 +28,6 @@ _PINCLUDE(gtkmm/private/container_p.h)
#include <gtkmm/container.h>
#include <gtkmm/orientable.h>
-#include <glibmm/helperlist.h>
#include <gtk/gtk.h> /* For _GtkBoxChild */
diff --git a/gtk/src/builder.ccg b/gtk/src/builder.ccg
index 0c2867a..6ee1384 100644
--- a/gtk/src/builder.ccg
+++ b/gtk/src/builder.ccg
@@ -18,6 +18,8 @@
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
+#include <glibmm/vectorutils.h>
+
#include <gtk/gtk.h>
// Allow GtkBuilder to instantiate a gtkmm derived GType instead of the regular
@@ -77,7 +79,7 @@ Glib::RefPtr<Builder> Builder::create_from_file(const std::string& filename, con
}
//static
-Glib::RefPtr<Builder> Builder::create_from_file(const std::string& filename, const Glib::StringArrayHandle& object_ids)
+Glib::RefPtr<Builder> Builder::create_from_file(const std::string& filename, const std::vector<Glib::ustring>& object_ids)
{
Glib::RefPtr<Builder> builder = Builder::create();
if(builder->add_from_file(filename, object_ids))
@@ -120,7 +122,7 @@ Glib::RefPtr<Builder> Builder::create_from_string(const Glib::ustring& buffer,
//static
Glib::RefPtr<Builder> Builder::create_from_string(const Glib::ustring& buffer,
- const Glib::StringArrayHandle& object_ids)
+ const std::vector<Glib::ustring>& object_ids)
{
Glib::RefPtr<Builder> builder = Builder::create();
if(builder->add_from_string(buffer, object_ids))
@@ -131,16 +133,14 @@ Glib::RefPtr<Builder> Builder::create_from_string(const Glib::ustring& buffer,
bool Builder::add_from_file(const std::string& filename, const char* object_id)
{
- std::list<Glib::ustring> object_ids;
- object_ids.push_back(object_id);
+ std::vector<Glib::ustring> object_ids (1, object_id);
return add_from_file(filename, object_ids);
}
bool Builder::add_from_file(const std::string& filename, const Glib::ustring& object_id)
{
- std::list<Glib::ustring> object_ids;
- object_ids.push_back(object_id);
+ std::vector<Glib::ustring> object_ids (1, object_id);
return add_from_file(filename, object_ids);
}
@@ -159,24 +159,27 @@ bool Builder::add_from_string(const Glib::ustring& buffer)
bool Builder::add_from_string(const Glib::ustring& buffer, const char* object_id)
{
- std::list<Glib::ustring> object_ids;
- object_ids.push_back(object_id);
+ std::vector<Glib::ustring> object_ids (1, object_id);
return add_from_string(buffer, object_ids);
}
bool Builder::add_from_string(const Glib::ustring& buffer, const Glib::ustring& object_id)
{
- std::list<Glib::ustring> object_ids;
- object_ids.push_back(object_id);
+ std::vector<Glib::ustring> object_ids (1, object_id);
return add_from_string(buffer, object_ids);
}
-bool Builder::add_from_string(const Glib::ustring& buffer, const Glib::StringArrayHandle& object_ids)
+bool Builder::add_from_string(const Glib::ustring& buffer, const std::vector<Glib::ustring>& object_ids)
{
GError* gerror = 0;
- bool retvalue = gtk_builder_add_objects_from_string(gobj(), buffer.c_str(), -1 /* means null-terminated */, const_cast<char**>(object_ids.data()), &(gerror));
+ bool retvalue = gtk_builder_add_objects_from_string(
+ gobj(),
+ buffer.c_str(),
+ -1 /* means null-terminated */,
+ const_cast<char**>(Glib::ArrayHandler<Glib::ustring>::vector_to_array(object_ids).data ()),
+ &(gerror));
if(gerror)
::Glib::Error::throw_exception(gerror);
diff --git a/gtk/src/builder.hg b/gtk/src/builder.hg
index 3bc07ad..eff3b1a 100644
--- a/gtk/src/builder.hg
+++ b/gtk/src/builder.hg
@@ -17,6 +17,8 @@
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
+#include <vector>
+
#include <gtkmm/widget.h>
_DEFS(gtkmm,gtk)
@@ -77,7 +79,7 @@ public:
*/
static Glib::RefPtr<Builder> create_from_file(const std::string& filename, const Glib::ustring& object_id);
//This is just to avoid the ambiguous call when using a string literal,
- //caused by the overload that takes a StringArrayHandle.
+ //caused by the overload that takes a std::vector<Glib::ustring>.
/** Parses a file containing a GtkBuilder UI definition, building only the requested object.
*
* If you are adding an object that depends on an object that is not
@@ -105,7 +107,7 @@ public:
*
* @newin{2,14}
*/
- static Glib::RefPtr<Builder> create_from_file(const std::string& filename, const Glib::StringArrayHandle& object_ids);
+ static Glib::RefPtr<Builder> create_from_file(const std::string& filename, const std::vector<Glib::ustring>& object_ids);
/** Parses a string containing a GtkBuilder UI definition.
*
@@ -117,7 +119,7 @@ public:
*/
static Glib::RefPtr<Builder> create_from_string(const Glib::ustring& buffer);
//This is just to avoid the ambiguous call when using a string literal,
- //caused by the overload that takes a StringArrayHandle.
+ //caused by the overload that takes a std::vector<Glib::ustring>.
/** Parses a string containing a GtkBuilder UI definition building only the requested object.
*
* @param buffer The string to parse.
@@ -153,7 +155,7 @@ public:
*
* @newin{2,14}
*/
- static Glib::RefPtr<Builder> create_from_string(const Glib::ustring& buffer, const Glib::StringArrayHandle& object_ids);
+ static Glib::RefPtr<Builder> create_from_string(const Glib::ustring& buffer, const std::vector<Glib::ustring>& object_ids);
_IGNORE(gtk_builder_add_objects_from_file)
/** Parses a file containing a GtkBuilder UI definition,
@@ -168,7 +170,7 @@ public:
_WRAP_METHOD(bool add_from_file(const std::string& filename), gtk_builder_add_from_file, errthrow)
//This is just to avoid the ambiguous call when using a string literal,
- //caused by the overload that takes a StringArrayHandle.
+ //caused by the overload that takes a std::vector<Glib::ustring>.
/** Parses a file containing a GtkBuilder UI definition,
* building only the requested object,
* and merges it with the current contents of the builder.
@@ -203,11 +205,11 @@ public:
*/
bool add_from_file(const std::string& filename, const Glib::ustring& object_id);
-#m4 _CONVERSION(`const Glib::StringArrayHandle&',`gchar**',`const_cast<char**>(($3).data())')
- _WRAP_METHOD(bool add_from_file(const std::string& filename, const Glib::StringArrayHandle& object_ids), gtk_builder_add_objects_from_file, errthrow)
+#m4 _CONVERSION(`const std::vector<Glib::ustring>&',`gchar**',`const_cast<char**>(Glib::ArrayHandler<Glib::ustring>::vector_to_array($3).data())')
+ _WRAP_METHOD(bool add_from_file(const std::string& filename, const std::vector<Glib::ustring>& object_ids), gtk_builder_add_objects_from_file, errthrow)
//This is just to avoid the ambiguous call when using a string literal,
- //caused by the overload that takes a StringArrayHandle.
+ //caused by the overload that takes a std::vector<Glib::ustring>.
/** Parses a string containing a GtkBuilder UI definition
* and merges it with the current contents of the builder.
*
@@ -256,7 +258,7 @@ public:
*
* @newin{2,14}
*/
- bool add_from_string(const Glib::ustring& buffer, const Glib::StringArrayHandle& object_ids);
+ bool add_from_string(const Glib::ustring& buffer, const std::vector<Glib::ustring>& object_ids);
_IGNORE(gtk_builder_add_objects_from_string)
/** Parses a string containing a GtkBuilder UI definition
diff --git a/gtk/src/celllayout.ccg b/gtk/src/celllayout.ccg
index 78d70fd..ee0d9e9 100644
--- a/gtk/src/celllayout.ccg
+++ b/gtk/src/celllayout.ccg
@@ -18,6 +18,8 @@
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
+#include <glibmm/vectorutils.h>
+
#include <gtkmm/cellarea.h>
#include <gtk/gtk.h>
diff --git a/gtk/src/celllayout.hg b/gtk/src/celllayout.hg
index f976d41..efe6c3f 100644
--- a/gtk/src/celllayout.hg
+++ b/gtk/src/celllayout.hg
@@ -17,6 +17,8 @@
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
+#include <vector>
+
#include <glibmm/interface.h>
//#include <gtkmm/cellarea.h>
#include <gtkmm/cellrenderer.h>
@@ -55,10 +57,10 @@ public:
_WRAP_METHOD(void pack_start(CellRenderer& cell, bool expand = true), gtk_cell_layout_pack_start)
_WRAP_METHOD(void pack_end(CellRenderer& cell, bool expand = true), gtk_cell_layout_pack_end)
- #m4 _CONVERSION(`GList*', `Glib::ListHandle<CellRenderer*>', `$2($3, Glib::OWNERSHIP_SHALLOW)')
- #m4 _CONVERSION(`GList*', `Glib::ListHandle<const CellRenderer*>', `$2($3, Glib::OWNERSHIP_SHALLOW)')
- _WRAP_METHOD(Glib::ListHandle<CellRenderer*> get_cells(), gtk_cell_layout_get_cells)
- _WRAP_METHOD(Glib::ListHandle<const CellRenderer*> get_cells() const, gtk_cell_layout_get_cells)
+#m4 _CONVERSION(`GList*', `std::vector<CellRenderer*>', `Glib::ListHandler<CellRenderer*>::list_to_vector($3, Glib::OWNERSHIP_SHALLOW)')
+#m4 _CONVERSION(`GList*', `std::vector<const CellRenderer*>', `Glib::ListHandler<const CellRenderer*>::list_to_vector($3, Glib::OWNERSHIP_SHALLOW)')
+ _WRAP_METHOD(std::vector<CellRenderer*> get_cells(), gtk_cell_layout_get_cells)
+ _WRAP_METHOD(std::vector<const CellRenderer*> get_cells() const, gtk_cell_layout_get_cells)
/** Gets the CellRenderer for the column.
* You should dynamic_cast<> to the expected derived CellRenderer type.
diff --git a/gtk/src/clipboard.ccg b/gtk/src/clipboard.ccg
index 0379162..c857cc7 100644
--- a/gtk/src/clipboard.ccg
+++ b/gtk/src/clipboard.ccg
@@ -17,6 +17,10 @@
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
+#include <glibmm/vectorutils.h>
+
+#include <gdkmm/types.h>
+
#include <gtkmm/textbuffer.h>
#include <gtkmm/selectiondata_private.h>
#include <glibmm/utility.h> //For ScopedPtr<>.
@@ -111,15 +115,8 @@ static void SignalProxy_TargetsReceived_gtk_callback(GtkClipboard*, GdkAtom* ato
try
{
- // TODO: This conversion should normally be performed in a custom
- // Traits implementation. Alternatively, a real container could
- // have been used as the argument instead of handle.
- const unsigned int n_names = (n_atoms > 0) ? n_atoms : 0;
- char** names = g_new(char*, n_names);
-
- std::transform(&atoms[0], &atoms[n_names], &names[0], &gdk_atom_name);
-
- (*slot)(Glib::StringArrayHandle(names, n_names, Glib::OWNERSHIP_DEEP));
+ // TODO: check if the ownership is good.
+ (*slot) (Glib::ArrayHandler<Glib::ustring, Gdk::AtomStringTraits>::array_to_vector(atoms, n_atoms > 0 ? n_atoms : 0, Glib::OWNERSHIP_NONE));
}
catch (...)
{
@@ -169,8 +166,9 @@ static void SignalProxy_UrisReceived_gtk_callback(GtkClipboard*, gchar** uris, v
try
{
+ // TODO: check if the ownetship is good. krnowak.
//Handle: Does this take ownership? It should probalby copy. murrayc.
- (*the_slot)( Glib::StringArrayHandle(uris) );
+ (*the_slot)( Glib::ArrayHandler<Glib::ustring>::array_to_vector(uris, Glib::OWNERSHIP_NONE) );
}
catch(...)
{
@@ -200,14 +198,16 @@ static void SignalProxy_ImageReceived_gtk_callback(GtkClipboard*, GdkPixbuf* ima
namespace Gtk
{
-bool Clipboard::set(const ArrayHandle_TargetEntry& targets,
+bool Clipboard::set(const std::vector<TargetEntry>& targets,
const SlotGet& slot_get, const SlotClear& slot_clear)
{
// Create a signal proxy. A pointer to this will be passed through the callback's data parameter.
SignalProxy_GetClear *const pSignalProxy = new SignalProxy_GetClear(slot_get, slot_clear);
return gtk_clipboard_set_with_data(
- gobj(), targets.data(), targets.size(),
+ gobj(),
+ Glib::ArrayHandler<TargetEntry, TargetEntryTraits>::vector_to_array(targets).data (),
+ targets.size(),
&SignalProxy_GetClear_gtk_callback_get,
&SignalProxy_GetClear_gtk_callback_clear,
pSignalProxy);
@@ -278,30 +278,22 @@ SelectionData Clipboard::wait_for_contents(const Glib::ustring& target) const
return SelectionData(cData, false /* take_copy */);
}
-Glib::StringArrayHandle Clipboard::wait_for_targets() const
+std::vector<Glib::ustring> Clipboard::wait_for_targets() const
{
- char** names = 0;
- GdkAtom* atoms = 0;
- int n_targets = 0;
-
- // TODO: This works, but is not the intended way to use the array handles.
- // Normally one would define custom Traits for the conversion, but that is
- // not possible here because it would break binary compatibility.
- if (gtk_clipboard_wait_for_targets(const_cast<GtkClipboard*>(gobj()), &atoms, &n_targets))
+ GdkAtom* atoms (0);
+ int n_targets (0);
+
+ if (!gtk_clipboard_wait_for_targets(const_cast<GtkClipboard*>(gobj()), &atoms, &n_targets))
{
- names = g_new(char*, n_targets);
- std::transform(&atoms[0], &atoms[n_targets], &names[0], &gdk_atom_name);
- g_free(atoms);
- }
- else
n_targets = 0;
+ }
- return Glib::StringArrayHandle(names, n_targets, Glib::OWNERSHIP_DEEP);
+ return Glib::ArrayHandler<Glib::ustring, Gdk::AtomStringTraits>::array_to_vector(atoms, n_targets, Glib::OWNERSHIP_SHALLOW);
}
-void Clipboard::set_can_store(const ArrayHandle_TargetEntry& targets)
+void Clipboard::set_can_store(const std::vector<TargetEntry>& targets)
{
- gtk_clipboard_set_can_store( gobj(), targets.data(), targets.size() );
+ gtk_clipboard_set_can_store( gobj(), Glib::ArrayHandler<TargetEntry, TargetEntryTraits>::vector_to_array(targets).data (), targets.size() );
}
void Clipboard::set_can_store()
diff --git a/gtk/src/clipboard.hg b/gtk/src/clipboard.hg
index 7d251fe..81b52ee 100644
--- a/gtk/src/clipboard.hg
+++ b/gtk/src/clipboard.hg
@@ -19,12 +19,13 @@
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
+#include <vector>
+
#include <gdkmm/display.h>
#include <gdkmm/pixbuf.h>
#include <gtkmm/targetentry.h>
#include <gtkmm/selectiondata.h>
#include <glibmm/object.h>
-#include <glibmm/containers.h>
_DEFS(gtkmm,gtk)
_PINCLUDE(glibmm/private/object_p.h)
@@ -93,7 +94,7 @@ public:
* the clipboard data failed then the provided callback methods
* will be ignored.
*/
- bool set(const ArrayHandle_TargetEntry& targets, const SlotGet& slot_get, const SlotClear& slot_clear);
+ bool set(const std::vector<TargetEntry>& targets, const SlotGet& slot_get, const SlotClear& slot_clear);
_IGNORE(gtk_clipboard_set_with_owner, gtk_clipboard_set_with_data)
_WRAP_METHOD(Glib::RefPtr<Glib::Object> get_owner(), gtk_clipboard_get_owner, refreturn)
@@ -176,8 +177,8 @@ public:
_IGNORE(gtk_clipboard_request_rich_text)
- /// For instance: void on_uris_received(const Glib::StringArrayHandle& uris);
- typedef sigc::slot<void, const Glib::StringArrayHandle&> SlotUrisReceived;
+ /// For instance: void on_uris_received(const std::vector<Glib::ustring>& uris);
+ typedef sigc::slot<void, const std::vector<Glib::ustring>&> SlotUrisReceived;
/** Requests the contents of the clipboard as URIs. When the URIs are
* later received @a slot will be called.
@@ -216,8 +217,8 @@ public:
void request_image(const SlotImageReceived& slot);
_IGNORE(gtk_clipboard_request_image)
- /// For instance: void on_targetsreceived(const Glib::StringArrayHandle& targets);
- typedef sigc::slot<void, const Glib::StringArrayHandle&> SlotTargetsReceived;
+ /// For instance: void on_targets_received(const std::vector<Glib::ustring>& targets);
+ typedef sigc::slot<void, const std::vector<Glib::ustring>&> SlotTargetsReceived;
/** Requests the contents of the clipboard as list of supported targets.
* When the list is later received, callback will be called.
@@ -227,9 +228,7 @@ public:
*
* @param slot a function to call when the targets are received,
* or the retrieval fails. (It will always be called
- * one way or the other.) Remember that Glib::StringArrayHandle
- * is an intermediate type, so you should convert it to a
- * standard C++ container.
+ * one way or the other.)
*
* @newin{2,4}
*/
@@ -270,10 +269,11 @@ public:
*
* @newin{2,4}
*/
- Glib::StringArrayHandle wait_for_targets() const;
+ std::vector<Glib::ustring> wait_for_targets() const;
_IGNORE(gtk_clipboard_wait_for_targets)
- _WRAP_METHOD(Glib::StringArrayHandle wait_for_uris() const, gtk_clipboard_wait_for_uris)
+#m4 _CONVERSION(`gchar**',`std::vector<Glib::ustring>',`Glib::ArrayHandler<Glib::ustring>::array_to_vector($3, Glib::OWNERSHIP_DEEP)')
+ _WRAP_METHOD(std::vector<Glib::ustring> wait_for_uris() const, gtk_clipboard_wait_for_uris)
/** Hints that the clipboard data should be stored somewhere when the application exits or when store()
* is called.
@@ -283,7 +283,7 @@ public:
*
* @param targets Array containing information about which forms should be stored.
*/
- void set_can_store(const ArrayHandle_TargetEntry& targets);
+ void set_can_store(const std::vector<TargetEntry>& targets);
/** Hints that all forms of clipboard data should be stored somewhere when the application exits or when store()
* is called.
diff --git a/gtk/src/colorselection.ccg b/gtk/src/colorselection.ccg
index a4bf3c3..2944be1 100644
--- a/gtk/src/colorselection.ccg
+++ b/gtk/src/colorselection.ccg
@@ -18,6 +18,8 @@
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
+#include <glibmm/vectorutils.h>
+
#include <gtk/gtk.h>
@@ -34,7 +36,7 @@ static void global_change_palette_hook_callback(GdkScreen* screen, const GdkColo
{
(*global_change_palette_hook)(
Glib::wrap(screen, true),
- Gdk::ArrayHandle_Color(colors, n_colors, Glib::OWNERSHIP_NONE));
+ Glib::ArrayHandler<Gdk::Color, Gdk::ColorTraits>::array_to_vector(colors, n_colors, Glib::OWNERSHIP_NONE));
}
catch(...)
{
@@ -43,12 +45,14 @@ static void global_change_palette_hook_callback(GdkScreen* screen, const GdkColo
}
static void old_change_palette_hook_callback(const Glib::RefPtr<Gdk::Screen>& screen,
- const Gdk::ArrayHandle_Color& colors,
+ const std::vector<Gdk::Color>& colors,
GtkColorSelectionChangePaletteWithScreenFunc func)
{
g_return_if_fail(func != 0);
- (*func)(Glib::unwrap(screen), colors.data(), colors.size());
+ (*func)(Glib::unwrap(screen),
+ Glib::ArrayHandler<Gdk::Color, Gdk::ColorTraits>::vector_to_array(colors).data(),
+ colors.size());
}
} // anonymous namespace
@@ -86,20 +90,20 @@ Gdk::RGBA ColorSelection::get_previous_rgba() const
}
// static
-Gdk::ArrayHandle_Color ColorSelection::palette_from_string(const Glib::ustring& str)
+std::vector<Gdk::Color> ColorSelection::palette_from_string(const Glib::ustring& str)
{
GdkColor* colors = 0;
int n_colors = 0;
gtk_color_selection_palette_from_string(str.c_str(), &colors, &n_colors);
- return Gdk::ArrayHandle_Color(colors, n_colors, Glib::OWNERSHIP_SHALLOW);
+ return Glib::ArrayHandler<Gdk::Color, Gdk::ColorTraits>::array_to_vector(colors, n_colors, Glib::OWNERSHIP_SHALLOW);
}
// static
-Glib::ustring ColorSelection::palette_to_string(const Gdk::ArrayHandle_Color& colors)
+Glib::ustring ColorSelection::palette_to_string(const std::vector<Gdk::Color>& colors)
{
- if(char *const str = gtk_color_selection_palette_to_string(colors.data(), colors.size()))
+ if(char *const str = gtk_color_selection_palette_to_string(Glib::ArrayHandler<Gdk::Color, Gdk::ColorTraits>::vector_to_array(colors).data (), colors.size()))
return Glib::ustring(Glib::ScopedPtr<char>(str).get());
else
return Glib::ustring();
diff --git a/gtk/src/colorselection.hg b/gtk/src/colorselection.hg
index 5f19577..a73507e 100644
--- a/gtk/src/colorselection.hg
+++ b/gtk/src/colorselection.hg
@@ -21,6 +21,8 @@ _DEFS(gtkmm,gtk)
_PINCLUDE(gtkmm/private/box_p.h)
_PINCLUDE(gtkmm/private/dialog_p.h)
+#include <vector>
+
#include <gtkmm/box.h>
#include <gtkmm/dialog.h>
#include <gtkmm/button.h>
@@ -69,11 +71,11 @@ public:
_WRAP_METHOD(bool is_adjusting() const, gtk_color_selection_is_adjusting)
- static Gdk::ArrayHandle_Color palette_from_string(const Glib::ustring& str);
- static Glib::ustring palette_to_string(const Gdk::ArrayHandle_Color& colors);
+ static std::vector<Gdk::Color> palette_from_string(const Glib::ustring& str);
+ static Glib::ustring palette_to_string(const std::vector<Gdk::Color>& colors);
typedef sigc::slot<void, const Glib::RefPtr<Gdk::Screen>&,
- const Gdk::ArrayHandle_Color&> SlotChangePaletteHook;
+ const std::vector<Gdk::Color>&> SlotChangePaletteHook;
static SlotChangePaletteHook set_change_palette_hook(const SlotChangePaletteHook& slot);
diff --git a/gtk/src/container.ccg b/gtk/src/container.ccg
index b864ab9..b4539c3 100644
--- a/gtk/src/container.ccg
+++ b/gtk/src/container.ccg
@@ -18,6 +18,8 @@
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
+#include <glibmm/vectorutils.h>
+
#include <gtkmm/adjustment.h>
#include <gtk/gtk.h>
@@ -177,20 +179,20 @@ bool Container::has_focus_chain() const
return gtk_container_get_focus_chain(const_cast<GtkContainer*>(gobj()), 0);
}
-Glib::ListHandle<Widget*> Container::get_focus_chain()
+std::vector<Widget*> Container::get_focus_chain()
{
GList* list = 0;
gtk_container_get_focus_chain(gobj(), &list);
- return Glib::ListHandle<Widget*>(list, Glib::OWNERSHIP_SHALLOW);
+ return Glib::ListHandler<Widget*>::list_to_vector(list, Glib::OWNERSHIP_SHALLOW);
}
-Glib::ListHandle<const Widget*> Container::get_focus_chain() const
+std::vector<const Widget*> Container::get_focus_chain() const
{
GList* list = 0;
gtk_container_get_focus_chain(const_cast<GtkContainer*>(gobj()), &list);
- return Glib::ListHandle<const Widget*>(list, Glib::OWNERSHIP_SHALLOW);
+ return Glib::ListHandler<const Widget*>::list_to_vector(list, Glib::OWNERSHIP_SHALLOW);
}
diff --git a/gtk/src/container.hg b/gtk/src/container.hg
index feb8a04..1c233fb 100644
--- a/gtk/src/container.hg
+++ b/gtk/src/container.hg
@@ -17,7 +17,8 @@
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-#include <glibmm/listhandle.h>
+#include <vector>
+
#include <gtkmm/widget.h>
_DEFS(gtkmm,gtk)
@@ -106,20 +107,23 @@ public:
/// (internal) Operate on contained items (see foreach())
//_WRAP_METHOD(void foreach_full_(GtkCallback callback,GtkCallbackMarshal marshal, gpointer data,GDestroyNotify notify),gtk_container_foreach_full)
- _WRAP_METHOD(Glib::ListHandle<Widget*> get_children(), gtk_container_get_children)
- _WRAP_METHOD(Glib::ListHandle<const Widget*> get_children() const, gtk_container_get_children)
+#m4 _CONVERSION(`GList*',`std::vector<Widget*>',`Glib::ListHandler<Widget*>::list_to_vector($3, Glib::OWNERSHIP_SHALLOW)')
+ _WRAP_METHOD(std::vector<Widget*> get_children(), gtk_container_get_children)
+#m4 _CONVERSION(`GList*',`std::vector<const Widget*>',`Glib::ListHandler<const Widget*>::list_to_vector($3, Glib::OWNERSHIP_SHALLOW)')
+ _WRAP_METHOD(std::vector<const Widget*> get_children() const, gtk_container_get_children)
//TODO: See https://bugzilla.gnome.org/show_bug.cgi?id=630800
//_WRAP_METHOD(void propagate_expose(Widget& child, GdkEventExpose* event), gtk_container_propagate_expose)
- _WRAP_METHOD(void set_focus_chain(const Glib::ListHandle<Widget*>& focusable_widgets),
+#m4 _CONVERSION(`const std::vector<Widget*>&',`GList*',`Glib::ListHandler<Widget*>::vector_to_list($3).data ()')
+ _WRAP_METHOD(void set_focus_chain(const std::vector<Widget*>& focusable_widgets),
gtk_container_set_focus_chain)
// gtk_container_get_focus_chain() has been split up into two
// functions in order to make implicit container conversion possible.
bool has_focus_chain() const;
- Glib::ListHandle<Widget*> get_focus_chain();
- Glib::ListHandle<const Widget*> get_focus_chain() const;
+ std::vector<Widget*> get_focus_chain();
+ std::vector<const Widget*> get_focus_chain() const;
_WRAP_METHOD(void unset_focus_chain(), gtk_container_unset_focus_chain)
diff --git a/gtk/src/dialog.ccg b/gtk/src/dialog.ccg
index a3c5b2e..46d2aa1 100644
--- a/gtk/src/dialog.ccg
+++ b/gtk/src/dialog.ccg
@@ -38,9 +38,9 @@ Dialog::Dialog(const Glib::ustring& title, bool modal)
set_modal(modal);
}
-void Dialog::set_alternative_button_order_from_array(const Glib::ArrayHandle<int>& new_order)
+void Dialog::set_alternative_button_order_from_array(const std::vector<int>& new_order)
{
- gtk_dialog_set_alternative_button_order_from_array(gobj(), new_order.size(), const_cast<int*>(new_order.data()));
+ gtk_dialog_set_alternative_button_order_from_array(gobj(), new_order.size(), const_cast<int*>(Glib::ArrayHandler<int>::vector_to_array(new_order).data()));
}
} // namespace Gtk
diff --git a/gtk/src/dialog.hg b/gtk/src/dialog.hg
index 8e8b14e..4732b81 100644
--- a/gtk/src/dialog.hg
+++ b/gtk/src/dialog.hg
@@ -19,6 +19,8 @@
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
+#include <vector>
+
#include <gtkmm/window.h>
#include <gtkmm/box.h>
#include <gtkmm/button.h>
@@ -103,7 +105,7 @@ public:
*
* @newinp26
*/
- void set_alternative_button_order_from_array(const Glib::ArrayHandle<int>& new_order);
+ void set_alternative_button_order_from_array(const std::vector<int>& new_order);
_IGNORE(gtk_dialog_set_alternative_button_order_from_array, gtk_dialog_set_alternative_button_order)
_WRAP_METHOD(void response(int response_id), gtk_dialog_response)
diff --git a/gtk/src/enums.hg b/gtk/src/enums.hg
index 0a05f12..bd21d8a 100644
--- a/gtk/src/enums.hg
+++ b/gtk/src/enums.hg
@@ -19,6 +19,8 @@
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
+#include <gtk/gtk.h>
+
#include <gtkmmconfig.h> //For GTKMM_MAEMO_EXTENSIONS_ENABLED
_DEFS(gtkmm,gtk)
@@ -205,6 +207,21 @@ public:
static Glib::ustring get_name(IconSize size);
};
+
+#ifndef DOXYGEN_SHOULD_SKIP_THIS
+struct IconSizeTraits
+{
+ typedef Gtk::IconSize CppType;
+ typedef GtkIconSize CType;
+ typedef GtkIconSize CTypeNonConst;
+
+ static CType to_c_type (CType c_obj) { return c_obj; }
+ static void release_c_type (CType) {}
+ static CType to_c_type (const CppType& cpp_obj) { int value (cpp_obj); return static_cast<CType> (value); }
+ static CppType to_cpp_type (CType c_obj) { return CppType (c_obj); }
+};
+#endif //DOXYGEN_SHOULD_SKIP_THIS
+
} // namespace Gtk
diff --git a/gtk/src/filechooser.ccg b/gtk/src/filechooser.ccg
index bba54ce..483654f 100644
--- a/gtk/src/filechooser.ccg
+++ b/gtk/src/filechooser.ccg
@@ -18,5 +18,7 @@
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
+#include <glibmm/vectorutils.h>
+
#include <gtk/gtk.h>
//#include <gtk/gtkfilesystem.h> //We include this semi-private header just to get GTK_FILE_SYSTEM_ERROR.
diff --git a/gtk/src/filechooser.hg b/gtk/src/filechooser.hg
index b18d435..9b080ef 100644
--- a/gtk/src/filechooser.hg
+++ b/gtk/src/filechooser.hg
@@ -17,6 +17,8 @@
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
+#include <vector>
+
#include <gtkmm/widget.h>
#include <gtkmm/filefilter.h>
#include <giomm/file.h>
@@ -89,8 +91,8 @@ public:
_WRAP_METHOD(void select_all(), gtk_file_chooser_select_all)
_WRAP_METHOD(void unselect_all(), gtk_file_chooser_unselect_all)
-#m4 _CONVERSION(`GSList*',`Glib::SListHandle<std::string>',__FL2H_DEEP)
- _WRAP_METHOD(Glib::SListHandle<std::string> get_filenames() const, gtk_file_chooser_get_filenames)
+#m4 _CONVERSION(`GSList*',`std::vector<std::string>',`Glib::SListHandler<std::string>::slist_to_vector($3, Glib::OWNERSHIP_DEEP)')
+ _WRAP_METHOD(std::vector<std::string> get_filenames() const, gtk_file_chooser_get_filenames)
_WRAP_METHOD(bool set_current_folder(const std::string& filename), gtk_file_chooser_set_current_folder)
_WRAP_METHOD(std::string get_current_folder() const, gtk_file_chooser_get_current_folder)
@@ -102,7 +104,8 @@ public:
_WRAP_METHOD(bool set_uri(const Glib::ustring& uri), gtk_file_chooser_set_uri)
_WRAP_METHOD(bool select_uri(const Glib::ustring& uri), gtk_file_chooser_select_uri)
_WRAP_METHOD(void unselect_uri(const Glib::ustring& uri), gtk_file_chooser_unselect_uri)
- _WRAP_METHOD(Glib::SListHandle<Glib::ustring> get_uris() const, gtk_file_chooser_get_uris)
+#m4 _CONVERSION(`GSList*',`std::vector<Glib::ustring>',`Glib::SListHandler<Glib::ustring>::slist_to_vector($3, Glib::OWNERSHIP_DEEP)')
+ _WRAP_METHOD(std::vector<Glib::ustring> get_uris() const, gtk_file_chooser_get_uris)
_WRAP_METHOD(bool set_current_folder_uri(const Glib::ustring& uri), gtk_file_chooser_set_current_folder_uri)
_WRAP_METHOD(Glib::ustring get_current_folder_uri() const, gtk_file_chooser_get_current_folder_uri)
@@ -112,8 +115,8 @@ public:
_WRAP_METHOD(bool select_file(const Glib::RefPtr<const Gio::File>& file), gtk_file_chooser_select_file, errthrow)
_WRAP_METHOD(void unselect_file(const Glib::RefPtr<const Gio::File>& file), gtk_file_chooser_unselect_file)
-#m4 _CONVERSION(`GSList*',`Glib::SListHandle< Glib::RefPtr<Gio::File> >',`Glib::SListHandle< Glib::RefPtr<Gio::File> >($3, Glib::OWNERSHIP_DEEP)')
- _WRAP_METHOD(Glib::SListHandle< Glib::RefPtr<Gio::File> > get_files(), gtk_file_chooser_get_files)
+#m4 _CONVERSION(`GSList*',`std::vector< Glib::RefPtr<Gio::File> >',`Glib::SListHandler< Glib::RefPtr<Gio::File> >::slist_to_vector($3, Glib::OWNERSHIP_DEEP)')
+ _WRAP_METHOD(std::vector< Glib::RefPtr<Gio::File> > get_files(), gtk_file_chooser_get_files)
_WRAP_METHOD(bool set_current_folder_file(const Glib::RefPtr<const Gio::File>& file), gtk_file_chooser_set_current_folder_file, errthrow)
@@ -156,10 +159,10 @@ public:
_WRAP_METHOD(void add_filter(const Glib::RefPtr<FileFilter>& filter), gtk_file_chooser_add_filter)
_WRAP_METHOD(void remove_filter (const Glib::RefPtr<FileFilter>& filter), gtk_file_chooser_remove_filter)
-_CONVERSION(`GSList*',`Glib::SListHandle< Glib::RefPtr<FileFilter> >',__FL2H_SHALLOW)
-_CONVERSION(`GSList*',`Glib::SListHandle< Glib::RefPtr<const FileFilter> >',__FL2H_SHALLOW)
- _WRAP_METHOD(Glib::SListHandle< Glib::RefPtr<FileFilter> > list_filters(), gtk_file_chooser_list_filters)
- _WRAP_METHOD(Glib::SListHandle< Glib::RefPtr<const FileFilter> > list_filters() const, gtk_file_chooser_list_filters)
+#m4 _CONVERSION(`GSList*',`std::vector< Glib::RefPtr<FileFilter> >',`Glib::SListHandler< Glib::RefPtr<FileFilter> >::slist_to_vector($3, Glib::OWNERSHIP_SHALLOW)')
+#m4 _CONVERSION(`GSList*',`std::vector< Glib::RefPtr<const FileFilter> >',`Glib::SListHandler< Glib::RefPtr<const FileFilter> >::slist_to_vector($3, Glib::OWNERSHIP_SHALLOW)')
+ _WRAP_METHOD(std::vector< Glib::RefPtr<FileFilter> > list_filters(), gtk_file_chooser_list_filters)
+ _WRAP_METHOD(std::vector< Glib::RefPtr<const FileFilter> > list_filters() const, gtk_file_chooser_list_filters)
/* Current filter
*/
@@ -172,11 +175,11 @@ _CONVERSION(`GSList*',`Glib::SListHandle< Glib::RefPtr<const FileFilter> >',__FL
_WRAP_METHOD(bool add_shortcut_folder(const std::string& folder), gtk_file_chooser_add_shortcut_folder, errthrow)
_WRAP_METHOD(bool remove_shortcut_folder(const std::string& folder), gtk_file_chooser_remove_shortcut_folder, errthrow)
- _WRAP_METHOD(Glib::SListHandle<std::string> list_shortcut_folders() const, gtk_file_chooser_list_shortcut_folders)
+ _WRAP_METHOD(std::vector<std::string> list_shortcut_folders() const, gtk_file_chooser_list_shortcut_folders)
_WRAP_METHOD(bool add_shortcut_folder_uri(const Glib::ustring& uri), gtk_file_chooser_add_shortcut_folder_uri, errthrow)
_WRAP_METHOD(bool remove_shortcut_folder_uri(const Glib::ustring& uri), gtk_file_chooser_remove_shortcut_folder_uri, errthrow)
- _WRAP_METHOD(Glib::SListHandle<Glib::ustring> list_shortcut_folder_uris() const, gtk_file_chooser_list_shortcut_folder_uris)
+ _WRAP_METHOD(std::vector<Glib::ustring> list_shortcut_folder_uris() const, gtk_file_chooser_list_shortcut_folder_uris)
/** This signal is emitted when the current folder in a FileChooser
diff --git a/gtk/src/iconinfo.ccg b/gtk/src/iconinfo.ccg
index 7b19759..beee4ca 100644
--- a/gtk/src/iconinfo.ccg
+++ b/gtk/src/iconinfo.ccg
@@ -15,6 +15,8 @@
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
+#include <glibmm/vectorutils.h>
+
#include <gtk/gtk.h>
#include <gtkmm/icontheme.h>
@@ -26,19 +28,17 @@ IconInfo::IconInfo(const Glib::RefPtr<IconTheme>& icon_theme, const Glib::RefPtr
{
}
-bool IconInfo::get_attach_points(Glib::ArrayHandle<Gdk::Point>& /* points */) const
+std::vector<Gdk::Point> IconInfo::get_attach_points() const
{
GdkPoint* c_attach_points = 0;
gint n_points = 0;
- bool result = gtk_icon_info_get_attach_points (const_cast<GtkIconInfo*>(gobj()), &c_attach_points, &n_points);
+ gtk_icon_info_get_attach_points (const_cast<GtkIconInfo*>(gobj()), &c_attach_points, &n_points);
- if(c_attach_points)
+ if (c_attach_points)
{
- //TODO: We can't use = with an ArrayHandle.
- //Investigate whether the bool return value has a special meaning - maybe we can just return an empty ArrayHandle.
- //points = Glib::ArrayHandle<Gdk::Point>(reinterpret_cast<Gdk::Point*>(c_attach_points), (size_t)n_points, Glib::OWNERSHIP_SHALLOW); //We use OWNERSHIP_SHALLOW because we just need to g_free() the array and nothing more.
+ return Glib::ArrayHandler<Gdk::Point, Gdk::PointTraits>::array_to_vector(c_attach_points, n_points, Glib::OWNERSHIP_DEEP);
}
- return result;
+ return std::vector<Gdk::Point> ();
}
IconInfo::operator bool() const
diff --git a/gtk/src/iconinfo.hg b/gtk/src/iconinfo.hg
index 38af9cc..d2c873d 100644
--- a/gtk/src/iconinfo.hg
+++ b/gtk/src/iconinfo.hg
@@ -15,6 +15,8 @@
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
+#include <vector>
+
#include <gtkmm/stylecontext.h>
#include <gdkmm/rectangle.h>
#include <gdkmm/pixbuf.h>
@@ -62,7 +64,7 @@ public:
_WRAP_METHOD(bool get_embedded_rect(Gdk::Rectangle& rectangle) const, gtk_icon_info_get_embedded_rect)
//TODO: Documentation.
- bool get_attach_points(Glib::ArrayHandle<Gdk::Point>& points) const;
+ std::vector<Gdk::Point> get_attach_points() const;
_WRAP_METHOD(Glib::ustring get_display_name() const, gtk_icon_info_get_display_name)
};
diff --git a/gtk/src/iconset.ccg b/gtk/src/iconset.ccg
index d597c6b..daa4646 100644
--- a/gtk/src/iconset.ccg
+++ b/gtk/src/iconset.ccg
@@ -31,13 +31,13 @@ IconSet::IconSet(const Glib::RefPtr<Gdk::Pixbuf>& pixbuf)
gobject_ = gtk_icon_set_new_from_pixbuf(Glib::unwrap(pixbuf));
}
-Glib::ArrayHandle<IconSize> IconSet::get_sizes() const
+std::vector<IconSize> IconSet::get_sizes() const
{
GtkIconSize* pSizes = 0;
int n_sizes = 0;
gtk_icon_set_get_sizes(const_cast<GtkIconSet*>(gobj()), &pSizes, &n_sizes);
- return Glib::ArrayHandle<IconSize>((IconSize*) pSizes, n_sizes, Glib::OWNERSHIP_SHALLOW);
+ return Glib::ArrayHandler<IconSize, IconSizeTraits>::array_to_vector(pSizes, n_sizes, Glib::OWNERSHIP_SHALLOW);
}
IconSet IconSet::lookup_default(const Gtk::StockID& stock_id) //static
diff --git a/gtk/src/iconset.hg b/gtk/src/iconset.hg
index d11749b..3680541 100644
--- a/gtk/src/iconset.hg
+++ b/gtk/src/iconset.hg
@@ -24,7 +24,6 @@
#include <gtkmm/iconsource.h>
//#include <gtkmm/widget.h>
#include <gtkmm/stockid.h>
-#include <glibmm/arrayhandle.h>
_DEFS(gtkmm,gtk)
@@ -55,7 +54,7 @@ public:
_WRAP_METHOD(void add_source(const IconSource& source), gtk_icon_set_add_source)
- Glib::ArrayHandle<IconSize> get_sizes() const;
+ std::vector<IconSize> get_sizes() const;
/** Looks for an icon in the list of default icon factories.
* @param stock_id StockID to search for
diff --git a/gtk/src/icontheme.ccg b/gtk/src/icontheme.ccg
index 01d602d..71d96c8 100644
--- a/gtk/src/icontheme.ccg
+++ b/gtk/src/icontheme.ccg
@@ -15,36 +15,38 @@
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
+#include <glibmm/vectorutils.h>
+
#include <gtk/gtk.h> //For gtk_icon_theme_error_get_type().
namespace Gtk
{
-void IconTheme::set_search_path(const Glib::ArrayHandle<Glib::ustring>& path)
+void IconTheme::set_search_path(const std::vector<Glib::ustring>& path)
{
- gtk_icon_theme_set_search_path(gobj(), const_cast<const char**>(path.data()), path.size());
+ gtk_icon_theme_set_search_path(gobj(), const_cast<const char**>(Glib::ArrayHandler<Glib::ustring>::vector_to_array(path).data ()), path.size());
}
-Glib::ArrayHandle<Glib::ustring> IconTheme::get_search_path() const
+std::vector<Glib::ustring> IconTheme::get_search_path() const
{
int temp_int = 0;
gchar** temp_path = 0;
gtk_icon_theme_get_search_path(const_cast<GtkIconTheme*>(gobj()), &temp_path, &temp_int);
- return Glib::ArrayHandle<Glib::ustring>((const char**) temp_path, temp_int, Glib::OWNERSHIP_DEEP);
+ return Glib::ArrayHandler<Glib::ustring>::array_to_vector(temp_path, temp_int, Glib::OWNERSHIP_DEEP);
}
-Glib::ArrayHandle<int> IconTheme::get_icon_sizes(const Glib::ustring& icon_name) const
+std::vector<int> IconTheme::get_icon_sizes(const Glib::ustring& icon_name) const
{
int* pArrayInts = gtk_icon_theme_get_icon_sizes(const_cast<GtkIconTheme*>(gobj()), icon_name.c_str());
//pArrayInts is null-terminated.
- return Glib::ArrayHandle<int>(pArrayInts, Glib::OWNERSHIP_SHALLOW);
+ return Glib::ArrayHandler<int>::array_to_vector(pArrayInts, Glib::OWNERSHIP_SHALLOW);
}
-Glib::ListHandle<Glib::ustring> IconTheme::list_icons() const
+std::vector<Glib::ustring> IconTheme::list_icons() const
{
- return Glib::ListHandle<Glib::ustring>(gtk_icon_theme_list_icons(const_cast<GtkIconTheme*>(gobj()), 0 /* means all icons according to the C documentation. */ ), Glib::OWNERSHIP_SHALLOW);
+ return Glib::ListHandler<Glib::ustring>::list_to_vector(gtk_icon_theme_list_icons(const_cast<GtkIconTheme*>(gobj()), 0 /* means all icons according to the C documentation. */ ), Glib::OWNERSHIP_SHALLOW);
}
diff --git a/gtk/src/icontheme.hg b/gtk/src/icontheme.hg
index 2da19a7..a720a95 100644
--- a/gtk/src/icontheme.hg
+++ b/gtk/src/icontheme.hg
@@ -15,6 +15,8 @@
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
+#include <vector>
+
#include <gdkmm/pixbuf.h>
#include <gdkmm/screen.h>
@@ -47,14 +49,14 @@ public:
_WRAP_METHOD(static Glib::RefPtr<IconTheme> get_default(), gtk_icon_theme_get_default, refreturn)
_WRAP_METHOD(static Glib::RefPtr<IconTheme> get_for_screen(const Glib::RefPtr<Gdk::Screen>& screen), gtk_icon_theme_get_for_screen, refreturn)
_WRAP_METHOD(void set_screen(const Glib::RefPtr<Gdk::Screen>& screen), gtk_icon_theme_set_screen)
- void set_search_path(const Glib::ArrayHandle<Glib::ustring>& path);
- Glib::ArrayHandle<Glib::ustring> get_search_path() const;
+ void set_search_path(const std::vector<Glib::ustring>& path);
+ std::vector<Glib::ustring> get_search_path() const;
_WRAP_METHOD(void append_search_path(const Glib::ustring& path), gtk_icon_theme_append_search_path)
_WRAP_METHOD(void prepend_search_path(const Glib::ustring& path), gtk_icon_theme_prepend_search_path)
_WRAP_METHOD(void set_custom_theme(const Glib::ustring& theme_name), gtk_icon_theme_set_custom_theme)
_WRAP_METHOD(bool has_icon(const Glib::ustring& icon_name) const, gtk_icon_theme_has_icon)
- Glib::ArrayHandle<int> get_icon_sizes(const Glib::ustring& icon_name) const;
+ std::vector<int> get_icon_sizes(const Glib::ustring& icon_name) const;
_IGNORE(gtk_icon_theme_get_icon_sizes)
_WRAP_METHOD(IconInfo lookup_icon(const Glib::ustring& icon_name, int size, IconLookupFlags flags) const, gtk_icon_theme_lookup_icon)
@@ -62,13 +64,13 @@ public:
_WRAP_METHOD(IconInfo lookup_icon(const Glib::RefPtr<const Gio::Icon>& icon, int size, IconLookupFlags flags) const, gtk_icon_theme_lookup_by_gicon)
- #m4 _CONVERSION(`const Glib::StringArrayHandle&',`const gchar*[]',`const_cast<const gchar**>(($3).data())')
- _WRAP_METHOD(IconInfo choose_icon(const Glib::StringArrayHandle& icon_names, int size, IconLookupFlags flags), gtk_icon_theme_choose_icon)
+ #m4 _CONVERSION(`const std::vector<Glib::ustring>&',`const gchar*[]',`const_cast<const gchar**>(Glib::ArrayHandler<Glib::ustring>::vector_to_array($3).data ())')
+ _WRAP_METHOD(IconInfo choose_icon(const std::vector<Glib::ustring>& icon_names, int size, IconLookupFlags flags), gtk_icon_theme_choose_icon)
_WRAP_METHOD(Glib::RefPtr<Gdk::Pixbuf> load_icon(const Glib::ustring& icon_name, int size, IconLookupFlags flags = (IconLookupFlags)0) const, gtk_icon_theme_load_icon, errthrow)
-
- _WRAP_METHOD(Glib::ListHandle<Glib::ustring> list_icons(const Glib::ustring& context) const, gtk_icon_theme_list_icons)
+#m4 _CONVERSION(`GList*',`std::vector<Glib::ustring>',`Glib::ListHandler<Glib::ustring>::list_to_vector($3, Glib::OWNERSHIP_DEEP)')
+ _WRAP_METHOD(std::vector<Glib::ustring> list_icons(const Glib::ustring& context) const, gtk_icon_theme_list_icons)
/** Lists the icons in the current icon theme.
*
@@ -77,9 +79,9 @@ public:
*
* @newin{2,10}.
*/
- Glib::ListHandle<Glib::ustring> list_icons() const;
+ std::vector<Glib::ustring> list_icons() const;
- _WRAP_METHOD(Glib::ListHandle<Glib::ustring> list_contexts() const, gtk_icon_theme_list_contexts)
+ _WRAP_METHOD(std::vector<Glib::ustring> list_contexts() const, gtk_icon_theme_list_contexts)
_WRAP_METHOD(Glib::ustring get_example_icon_name() const, gtk_icon_theme_get_example_icon_name)
_WRAP_METHOD(bool rescan_if_needed(), gtk_icon_theme_rescan_if_needed)
diff --git a/gtk/src/iconview.ccg b/gtk/src/iconview.ccg
index 977369d..c6307bd 100644
--- a/gtk/src/iconview.ccg
+++ b/gtk/src/iconview.ccg
@@ -18,6 +18,8 @@
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
+#include <glibmm/vectorutils.h>
+
#include <gtkmm/adjustment.h>
#include <gtk/gtk.h>
@@ -45,9 +47,6 @@ static void proxy_foreach_callback(GtkIconView* /* icon_view */, GtkTreePath* pa
namespace Gtk
{
-//Allow the generated code to work without the prefix:
-typedef IconView::ArrayHandle_TreePaths ArrayHandle_TreePaths;
-
void IconView::unset_model()
{
gtk_icon_view_set_model(gobj(), 0);
@@ -178,15 +177,15 @@ bool IconView::get_dest_item_at_pos(int drag_x, int drag_y, IconViewDropPosition
}
-void IconView::enable_model_drag_source(const ArrayHandle_TargetEntry& targets, Gdk::ModifierType start_button_mask, Gdk::DragAction actions)
+void IconView::enable_model_drag_source(const std::vector<TargetEntry>& targets, Gdk::ModifierType start_button_mask, Gdk::DragAction actions)
{
- gtk_icon_view_enable_model_drag_source(gobj(), (GdkModifierType)start_button_mask, targets.data(), targets.size(), (GdkDragAction)actions);
+ gtk_icon_view_enable_model_drag_source(gobj(), (GdkModifierType)start_button_mask, Glib::ArrayHandler<TargetEntry, TargetEntryTraits>::vector_to_array(targets).data (), targets.size(), (GdkDragAction)actions);
}
-void IconView::enable_model_drag_dest(const ArrayHandle_TargetEntry& targets, Gdk::DragAction actions)
+void IconView::enable_model_drag_dest(const std::vector<TargetEntry>& targets, Gdk::DragAction actions)
{
- gtk_icon_view_enable_model_drag_dest(gobj(), targets.data(), targets.size(), (GdkDragAction)actions);
+ gtk_icon_view_enable_model_drag_dest(gobj(), Glib::ArrayHandler<TargetEntry, TargetEntryTraits>::vector_to_array(targets).data(), targets.size(), (GdkDragAction)actions);
}
bool
diff --git a/gtk/src/iconview.hg b/gtk/src/iconview.hg
index 8f507f3..cda058d 100644
--- a/gtk/src/iconview.hg
+++ b/gtk/src/iconview.hg
@@ -19,6 +19,7 @@
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
+#include <vector>
#include <gtkmm/container.h>
#include <gtkmm/treemodel.h>
@@ -180,10 +181,8 @@ public:
};
#endif //DOXYGEN_SHOULD_SKIP_THIS
- typedef Glib::ListHandle<TreePath, TreePathTraits> ArrayHandle_TreePaths;
-
- _CONVERSION(`GList*',`ArrayHandle_TreePaths',__FL2H_SHALLOW)
- _WRAP_METHOD(ArrayHandle_TreePaths get_selected_items() const, gtk_icon_view_get_selected_items)
+#m4 _CONVERSION(`GList*',`std::vector<TreePath>',`Glib::ListHandler<TreePath, TreePathTraits>::list_to_vector($3, Glib::OWNERSHIP_SHALLOW)')
+ _WRAP_METHOD(std::vector<TreePath> get_selected_items() const, gtk_icon_view_get_selected_items)
_WRAP_METHOD(void select_all(), gtk_icon_view_select_all)
_WRAP_METHOD(void unselect_all(), gtk_icon_view_unselect_all)
@@ -237,7 +236,7 @@ public:
* @param start_button_mask Mask of allowed buttons to start drag.
* @param actions The bitmask of possible actions for a drag from this widget.
*/
- void enable_model_drag_source(const ArrayHandle_TargetEntry& targets,
+ void enable_model_drag_source(const std::vector<TargetEntry>& targets,
Gdk::ModifierType start_button_mask = Gdk::MODIFIER_MASK,
Gdk::DragAction actions = Gdk::ACTION_COPY | Gdk::ACTION_MOVE);
_IGNORE(gtk_icon_view_enable_model_drag_source)
@@ -247,7 +246,7 @@ public:
* @param targets The table of targets that the drag will support.
* @param actions The bitmask of possible actions for a drag from this widget.
*/
- void enable_model_drag_dest(const ArrayHandle_TargetEntry& targets, Gdk::DragAction actions = Gdk::ACTION_COPY | Gdk::ACTION_MOVE);
+ void enable_model_drag_dest(const std::vector<TargetEntry>& targets, Gdk::DragAction actions = Gdk::ACTION_COPY | Gdk::ACTION_MOVE);
_IGNORE(gtk_icon_view_enable_model_drag_dest)
_WRAP_METHOD(void unset_model_drag_source(), gtk_icon_view_unset_model_drag_source)
diff --git a/gtk/src/liststore.ccg b/gtk/src/liststore.ccg
index 610490c..4420e38 100644
--- a/gtk/src/liststore.ccg
+++ b/gtk/src/liststore.ccg
@@ -18,6 +18,8 @@
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
+#include <glibmm/vectorutils.h>
+
#include <gtk/gtk.h>
@@ -115,9 +117,9 @@ void ListStore::move(const iterator& source, const iterator& destination)
const_cast<GtkTreeIter*>(destination.get_gobject_if_not_end()));
}
-void ListStore::reorder(const Glib::ArrayHandle<int>& new_order)
+void ListStore::reorder(const std::vector<int>& new_order)
{
- gtk_list_store_reorder(gobj(), const_cast<int*>(new_order.data()));
+ gtk_list_store_reorder(gobj(), const_cast<int*>(Glib::ArrayHandler<int>::vector_to_array(new_order).data()));
}
void ListStore::set_value_impl(const iterator& row, int column, const Glib::ValueBase& value)
diff --git a/gtk/src/liststore.hg b/gtk/src/liststore.hg
index 045e9c1..7a1ce06 100644
--- a/gtk/src/liststore.hg
+++ b/gtk/src/liststore.hg
@@ -17,6 +17,8 @@
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
+#include <vector>
+
#include <gtkmm/treeiter.h>
#include <gtkmm/treemodel.h>
#include <gtkmm/treesortable.h>
@@ -139,7 +141,7 @@ public:
/** Reorders the list store to follow the order indicated by @a new_order.
* Note that this function only works with unsorted stores.
*/
- void reorder(const Glib::ArrayHandle<int>& new_order);
+ void reorder(const std::vector<int>& new_order);
_WRAP_METHOD(void clear(), gtk_list_store_clear)
diff --git a/gtk/src/main.ccg b/gtk/src/main.ccg
index 1194955..347d818 100644
--- a/gtk/src/main.ccg
+++ b/gtk/src/main.ccg
@@ -256,7 +256,7 @@ Main::Main(int* argc, char*** argv, bool set_locale)
init(argc, argv, set_locale);
}
-/*Main::Main(int* argc, char*** argv, const std::string& parameter_string, const Glib::ArrayHandle<const Glib::OptionEntry&>& entries, const std::string& translation_domain)
+/*Main::Main(int* argc, char*** argv, const std::string& parameter_string, const std::vector<const Glib::OptionEntry&>& entries, const std::string& translation_domain)
{
init(argc, argv, parameter_string, entries, translation_domain);
}*/
diff --git a/gtk/src/main.hg b/gtk/src/main.hg
index f0c9c0a..b5aeb06 100644
--- a/gtk/src/main.hg
+++ b/gtk/src/main.hg
@@ -204,7 +204,7 @@ protected:
void init(int* argc, char*** argv, bool set_locale);
// TODO: implement this to use the new Glib::OptionEntry argument parsing classes.
- //void init(int* argc, char*** argv, const std::string& parameter_string, const Glib::ArrayHandle<const Glib::OptionEntry&>& entries, const std::string& translation_domain);
+ //void init(int* argc, char*** argv, const std::string& parameter_string, const std::vector<const Glib::OptionEntry&>& entries, const std::string& translation_domain);
virtual void run_impl();
virtual void quit_impl();
diff --git a/gtk/src/menushell.ccg b/gtk/src/menushell.ccg
index 0f3c676..a99e30c 100644
--- a/gtk/src/menushell.ccg
+++ b/gtk/src/menushell.ccg
@@ -55,16 +55,16 @@ void MenuShell::accelerate(Window& window)
// after it has been accelerated.
accel_window_ = &window;
- typedef std::list<Gtk::Widget*> type_list_widgets;
- type_list_widgets items = get_children();
- const type_list_widgets::iterator items_end = items.end();
+ std::vector<Gtk::Widget*> items = get_children();
- for(type_list_widgets::iterator iter = items.begin(); iter != items_end; ++iter)
+ for(std::vector<Gtk::Widget*>::iterator iter (items.begin ()), items_end (items.end ()); iter != items_end; ++iter)
{
- Gtk::Widget* widget = *iter;
- Gtk::MenuItem* menuitem = dynamic_cast<MenuItem*>(widget);
- if(menuitem)
+ Gtk::MenuItem* menuitem = dynamic_cast<MenuItem*>(*iter);
+
+ if (menuitem)
+ {
menuitem->accelerate(window);
+ }
}
}
diff --git a/gtk/src/menushell.hg b/gtk/src/menushell.hg
index 5c24b68..88fd8a9 100644
--- a/gtk/src/menushell.hg
+++ b/gtk/src/menushell.hg
@@ -26,7 +26,6 @@ _PINCLUDE(gtkmm/window.h)
#include <gtkmm/container.h>
#include <gtkmm/menuitem.h>
-#include <glibmm/helperlist.h>
namespace Gtk
{
diff --git a/gtk/src/notebook.hg b/gtk/src/notebook.hg
index fd4600c..1669059 100644
--- a/gtk/src/notebook.hg
+++ b/gtk/src/notebook.hg
@@ -20,7 +20,6 @@ _CONFIGINCLUDE(gtkmmconfig.h)
#include <gtkmm/container.h>
#include <gtkmm/label.h>
-#include <glibmm/helperlist.h>
_DEFS(gtkmm,gtk)
_PINCLUDE(gtkmm/private/container_p.h)
diff --git a/gtk/src/papersize.ccg b/gtk/src/papersize.ccg
index a9201e3..8d6b090 100644
--- a/gtk/src/papersize.ccg
+++ b/gtk/src/papersize.ccg
@@ -15,12 +15,13 @@
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
+#include <glibmm/vectorutils.h>
+
#include <gtk/gtk.h>
namespace Gtk
{
-typedef PaperSize::ListHandle_PaperSizes ListHandle_PaperSizes;
//PaperSize::PaperSize()
//:
// gobject_(gtk_paper_size_new(gtk_paper_size_get_default()))
diff --git a/gtk/src/papersize.hg b/gtk/src/papersize.hg
index 2e5700d..3408459 100644
--- a/gtk/src/papersize.hg
+++ b/gtk/src/papersize.hg
@@ -17,6 +17,8 @@
_DEFS(gtkmm,gtk)
+#include <vector>
+
namespace Gtk
{
@@ -71,11 +73,8 @@ public:
*/
operator bool() const;
- typedef Glib::ListHandle<PaperSize, PaperSizeTraits> ListHandle_PaperSizes;
- _CONVERSION(`GList*',`ListHandle_RecentInfos',__FL2H_SHALLOW)
-
- #m4 _CONVERSION(`GList*', `ListHandle_PaperSizes', __FL2H_DEEP)
- _WRAP_METHOD(static ListHandle_PaperSizes get_paper_sizes(bool include_custom = true), gtk_paper_size_get_paper_sizes)
+ #m4 _CONVERSION(`GList*', `std::vector<PaperSize>',`Glib::ListHandler<PaperSize, PaperSizeTraits>::list_to_vector($3, Glib::OWNERSHIP_DEEP)')
+ _WRAP_METHOD(static std::vector<PaperSize> get_paper_sizes(bool include_custom = true), gtk_paper_size_get_paper_sizes)
_WRAP_METHOD(Glib::ustring get_name() const, gtk_paper_size_get_name)
_WRAP_METHOD(Glib::ustring get_display_name() const, gtk_paper_size_get_display_name)
diff --git a/gtk/src/printer.ccg b/gtk/src/printer.ccg
index df721e9..ba167b2 100644
--- a/gtk/src/printer.ccg
+++ b/gtk/src/printer.ccg
@@ -16,6 +16,8 @@
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
+#include <glibmm/vectorutils.h>
+
#include <gtk/gtkunixprint.h>
// This Signal Proxy allows the C++ coder to specify a sigc::slot instead of a static function.
diff --git a/gtk/src/printer.hg b/gtk/src/printer.hg
index b09a7a6..3927933 100644
--- a/gtk/src/printer.hg
+++ b/gtk/src/printer.hg
@@ -15,6 +15,8 @@
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
+#include <vector>
+
#include <gtkmm/pagesetup.h>
_DEFS(gtkmm,gtk)
@@ -70,13 +72,13 @@ public:
_WRAP_METHOD(bool accepts_pdf() const, gtk_printer_accepts_pdf)
_WRAP_METHOD(bool accepts_ps() const, gtk_printer_accepts_ps)
-#m4 _CONVERSION(`GList*', `Glib::ListHandle< Glib::RefPtr<PageSetup> >', __FL2H_DEEP)
- _WRAP_METHOD(Glib::ListHandle< Glib::RefPtr<PageSetup> > list_papers(), gtk_printer_list_papers)
+#m4 _CONVERSION(`GList*', `std::vector< Glib::RefPtr<PageSetup> >', `Glib::ListHandler< Glib::RefPtr<PageSetup> >::list_to_vector($3, Glib::OWNERSHIP_DEEP)')
+ _WRAP_METHOD(std::vector< Glib::RefPtr<PageSetup> > list_papers(), gtk_printer_list_papers)
_WRAP_METHOD(Glib::RefPtr<PageSetup> get_default_page_size() const, gtk_printer_get_default_page_size, refreturn)
-#m4 _CONVERSION(`GList*', `Glib::ListHandle< Glib::RefPtr<const PageSetup> >', __FL2H_DEEP)
- _WRAP_METHOD(Glib::ListHandle< Glib::RefPtr<const PageSetup> > list_papers() const, gtk_printer_list_papers)
+#m4 _CONVERSION(`GList*', `std::vector< Glib::RefPtr<const PageSetup> >', `Glib::ListHandler< Glib::RefPtr<const PageSetup> >::list_to_vector($3, Glib::OWNERSHIP_DEEP)')
+ _WRAP_METHOD(std::vector< Glib::RefPtr<const PageSetup> > list_papers() const, gtk_printer_list_papers)
_IGNORE(gtk_printer_compare)
_IGNORE(gtk_enumerate_printers)
diff --git a/gtk/src/printsettings.ccg b/gtk/src/printsettings.ccg
index 8782a58..1745bba 100644
--- a/gtk/src/printsettings.ccg
+++ b/gtk/src/printsettings.ccg
@@ -15,9 +15,9 @@
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-#include <gtk/gtk.h>
+#include <glibmm/vectorutils.h>
-#include <vector>
+#include <gtk/gtk.h>
#include <glib.h>
@@ -119,39 +119,21 @@ PrintSettings::PageRange::PageRange(int start_, int end_)
end(end_)
{}
-Glib::ArrayHandle<PrintSettings::PageRange> PrintSettings::get_page_ranges() const
+std::vector<PrintSettings::PageRange> PrintSettings::get_page_ranges() const
{
- int num_ranges;
+ int num_ranges (0);
GtkPageRange* page_ranges =
gtk_print_settings_get_page_ranges(const_cast<GtkPrintSettings*>(gobj()), &num_ranges);
- std::vector<PrintSettings::PageRange> v(num_ranges);
-
- for (int i = 0; i < num_ranges; ++i)
- {
- v.push_back(PrintSettings::PageRange(page_ranges[i].start, page_ranges[i].end));
- }
-
- g_free(page_ranges);
- Glib::ArrayHandle<PrintSettings::PageRange> ah(v);
-
- return ah;
+ // no need for deep ownership.
+ return Glib::ArrayHandler<PageRange, PageRangeTraits>::array_to_vector(page_ranges, num_ranges, Glib::OWNERSHIP_SHALLOW);
}
-void PrintSettings::set_page_ranges(const Glib::ArrayHandle<PrintSettings::PageRange>& page_ranges)
+void PrintSettings::set_page_ranges(const std::vector<PrintSettings::PageRange>& page_ranges)
{
- int n = page_ranges.size();
- GtkPageRange* ranges = g_new0(GtkPageRange, n);
- std::vector<PrintSettings::PageRange> v_ranges(page_ranges);
-
- for (int i = 0; i < n; ++i)
- {
- ranges[i].start = v_ranges[i].start;
- ranges[i].end = v_ranges[i].end;
- }
-
- gtk_print_settings_set_page_ranges(const_cast<GtkPrintSettings*>(gobj()), ranges, n);
- g_free(ranges);
+ gtk_print_settings_set_page_ranges(gobj(),
+ Glib::ArrayHandler<PageRange, PageRangeTraits>::vector_to_array(page_ranges).data (),
+ page_ranges.size ());
}
diff --git a/gtk/src/printsettings.hg b/gtk/src/printsettings.hg
index 8e08805..573f614 100644
--- a/gtk/src/printsettings.hg
+++ b/gtk/src/printsettings.hg
@@ -15,6 +15,8 @@
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
+#include <vector>
+
#include <glibmm/object.h>
#include <gtkmm/enums.h>
#include <gtkmm/papersize.h>
@@ -271,8 +273,22 @@ public:
int end;
};
- Glib::ArrayHandle<PageRange> get_page_ranges() const;
- void set_page_ranges(const Glib::ArrayHandle<PageRange>& page_ranges);
+#ifndef DOXYGEN_SHOULD_SKIP_THIS
+ struct PageRangeTraits
+ {
+ typedef PageRange CppType;
+ typedef GtkPageRange CType;
+ typedef GtkPageRange CTypeNonConst;
+
+ static CType to_c_type (CType c_obj) { return c_obj; }
+ static void release_c_type (CType) {}
+ static CType to_c_type (const CppType& cpp_obj) { CTypeNonConst c_obj = {cpp_obj.start, cpp_obj.end}; return c_obj; }
+ static CppType to_cpp_type (CType c_obj) { return CppType (c_obj.start, c_obj.end); }
+ };
+#endif // DOXYGEN_SHOULD_SKIP_THIS
+
+ std::vector<PageRange> get_page_ranges() const;
+ void set_page_ranges(const std::vector<PageRange>& page_ranges);
_IGNORE(gtk_print_settings_get_page_ranges, gtk_print_settings_set_page_ranges)
diff --git a/gtk/src/recentchooser.ccg b/gtk/src/recentchooser.ccg
index 4aaecbc..926a8a6 100644
--- a/gtk/src/recentchooser.ccg
+++ b/gtk/src/recentchooser.ccg
@@ -15,6 +15,8 @@
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
+#include <glibmm/vectorutils.h>
+
#include <gtk/gtk.h>
// This Signal Proxy allows the C++ coder to specify a sigc::slot instead of a static function.
@@ -44,9 +46,6 @@ static void SignalProxy_Compare_gtk_callback_destroy(gpointer data)
namespace Gtk
{
-//Allow the generated code to work without the prefix:
-typedef RecentChooser::ListHandle_RecentInfos ListHandle_RecentInfos;
-
void RecentChooser::set_sort_func(const SlotCompare& slot)
{
SlotCompare* slot_copy = new SlotCompare(slot);
@@ -57,9 +56,9 @@ void RecentChooser::set_sort_func(const SlotCompare& slot)
&SignalProxy_Compare_gtk_callback_destroy);
}
-Glib::StringArrayHandle RecentChooser::get_uris() const
+std::vector<Glib::ustring> RecentChooser::get_uris() const
{
- return Glib::StringArrayHandle(gtk_recent_chooser_get_uris(const_cast<GtkRecentChooser*>(gobj()), NULL));
+ return Glib::ArrayHandler<Glib::ustring>::array_to_vector(gtk_recent_chooser_get_uris(const_cast<GtkRecentChooser*>(gobj()), NULL), Glib::OWNERSHIP_DEEP);
}
void RecentChooser::unset_limit()
diff --git a/gtk/src/recentchooser.hg b/gtk/src/recentchooser.hg
index 0fa0d33..f3c8a43 100644
--- a/gtk/src/recentchooser.hg
+++ b/gtk/src/recentchooser.hg
@@ -15,6 +15,8 @@
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
+#include <vector>
+
#include <glibmm/interface.h>
#include <gtkmm/recentinfo.h>
#include <gtkmm/recentfilter.h>
@@ -100,24 +102,26 @@ public:
_WRAP_METHOD(void select_all(), gtk_recent_chooser_select_all)
_WRAP_METHOD(void unselect_all(), gtk_recent_chooser_unselect_all)
- typedef Glib::ListHandle<RecentInfo, RecentInfoTraits> ListHandle_RecentInfos;
- _CONVERSION(`GList*',`ListHandle_RecentInfos',__FL2H_SHALLOW)
+ //typedef Glib::ListHandle<RecentInfo, RecentInfoTraits> ListHandle_RecentInfos;
+#m4 _CONVERSION(`GList*',`std::vector<Glib::RefPtr<RecentInfo> >',`Glib::ListHandler<Glib::RefPtr<RecentInfo>, RecentInfoTraits>::list_to_vector($3, Glib::OWNERSHIP_SHALLOW)')
- _WRAP_METHOD(ListHandle_RecentInfos get_items() const, gtk_recent_chooser_get_items)
+ _WRAP_METHOD(std::vector<Glib::RefPtr<RecentInfo> > get_items() const, gtk_recent_chooser_get_items)
/** Gets the URI of the recently used resources.
*
* The return value of this function is affected by the "sort-type" and
* "limit" properties of the recent chooser.
*/
- Glib::StringArrayHandle get_uris() const;
+ std::vector<Glib::ustring> get_uris() const;
_IGNORE(gtk_recent_chooser_get_uris)
_WRAP_METHOD(void add_filter(const Glib::RefPtr<RecentFilter>& filter), gtk_recent_chooser_add_filter)
_WRAP_METHOD(void remove_filter(const Glib::RefPtr<RecentFilter>& filter), gtk_recent_chooser_remove_filter)
- _WRAP_METHOD(Glib::SListHandle< Glib::RefPtr<RecentFilter> > list_filters(), gtk_recent_chooser_list_filters)
- _WRAP_METHOD(Glib::SListHandle< Glib::RefPtr<const RecentFilter> > list_filters() const, gtk_recent_chooser_list_filters)
+#m4 _CONVERSION(`GSList*',`std::vector< Glib::RefPtr<RecentFilter> >',`Glib::SListHandler<Glib::RefPtr<RecentFilter> >::slist_to_vector($3, Glib::OWNERSHIP_SHALLOW)')
+ _WRAP_METHOD(std::vector< Glib::RefPtr<RecentFilter> > list_filters(), gtk_recent_chooser_list_filters)
+#m4 _CONVERSION(`GSList*',`std::vector< Glib::RefPtr<const RecentFilter> >',`Glib::SListHandler<Glib::RefPtr<const RecentFilter> >::slist_to_vector($3, Glib::OWNERSHIP_SHALLOW)')
+ _WRAP_METHOD(std::vector< Glib::RefPtr<const RecentFilter> > list_filters() const, gtk_recent_chooser_list_filters)
_WRAP_METHOD(void set_filter(const Glib::RefPtr<RecentFilter>& filter), gtk_recent_chooser_set_filter)
_WRAP_METHOD(Glib::RefPtr<RecentFilter> get_filter(), gtk_recent_chooser_get_filter, refreturn)
@@ -152,6 +156,7 @@ protected:
#m4 _CONVERSION(`Glib::ustring', `gchar*', `g_strdup(($3).c_str())')
// TODO: How to wrap those vfuncs?
+ // TODO: Also: use vectorutils.
//_CONVERSION(`ListHandle_RecentInfos', `GList*', `($3).data()')
//_CONVERSION(`Glib::SListHandle<RecentFilter*>', `GSList*', `($3).data()')
diff --git a/gtk/src/recentinfo.ccg b/gtk/src/recentinfo.ccg
index cae9dc3..8394998 100644
--- a/gtk/src/recentinfo.ccg
+++ b/gtk/src/recentinfo.ccg
@@ -15,6 +15,8 @@
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
+#include <glibmm/vectorutils.h>
+
#include <gtk/gtk.h>
namespace Gtk
@@ -25,13 +27,13 @@ RecentInfo::operator bool() const
return gobj() != 0;
}
-Glib::StringArrayHandle RecentInfo::get_applications() const
+std::vector<Glib::ustring> RecentInfo::get_applications() const
{
gsize length = 0;
char** const applications =
gtk_recent_info_get_applications(const_cast<GtkRecentInfo*>(gobj()), &length);
- return Glib::StringArrayHandle(applications, length, Glib::OWNERSHIP_DEEP);
+ return Glib::ArrayHandler<Glib::ustring>::array_to_vector(applications, length, Glib::OWNERSHIP_DEEP);
}
bool RecentInfo::get_application_info(const Glib::ustring& app_name, std::string& app_exec,
@@ -49,12 +51,12 @@ bool RecentInfo::get_application_info(const Glib::ustring& app_name, std::string
return (found != 0);
}
-Glib::StringArrayHandle RecentInfo::get_groups() const
+std::vector<Glib::ustring> RecentInfo::get_groups() const
{
gsize length = 0;
char** const groups = gtk_recent_info_get_groups(const_cast<GtkRecentInfo*>(gobj()), &length);
- return Glib::StringArrayHandle(groups, length, Glib::OWNERSHIP_DEEP);
+ return Glib::ArrayHandler<Glib::ustring>::array_to_vector(groups, length, Glib::OWNERSHIP_DEEP);
}
RecentInfoTraits::CppType RecentInfoTraits::to_cpp_type(const CType& obj)
diff --git a/gtk/src/recentinfo.hg b/gtk/src/recentinfo.hg
index e86ba3e..c6eedda 100644
--- a/gtk/src/recentinfo.hg
+++ b/gtk/src/recentinfo.hg
@@ -15,6 +15,8 @@
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
+#include <vector>
+
#include <gdkmm/pixbuf.h>
#include <giomm/icon.h>
#include <giomm/appinfo.h>
@@ -74,14 +76,14 @@ public:
guint& count, time_t& time_) const;
_WRAP_METHOD_DOCS_ONLY(gtk_recent_info_get_applications)
- Glib::StringArrayHandle get_applications() const;
+ std::vector<Glib::ustring> get_applications() const;
_WRAP_METHOD(Glib::ustring last_application() const, gtk_recent_info_last_application)
_WRAP_METHOD(bool has_application(const Glib::ustring& app_name) const,
gtk_recent_info_has_application)
_WRAP_METHOD_DOCS_ONLY(gtk_recent_info_get_groups)
- Glib::StringArrayHandle get_groups() const;
+ std::vector<Glib::ustring> get_groups() const;
_WRAP_METHOD(bool has_group(const Glib::ustring& group) const, gtk_recent_info_has_group)
diff --git a/gtk/src/recentmanager.ccg b/gtk/src/recentmanager.ccg
index 2933f5a..b4805e9 100644
--- a/gtk/src/recentmanager.ccg
+++ b/gtk/src/recentmanager.ccg
@@ -15,14 +15,13 @@
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
+#include <glibmm/vectorutils.h>
+
#include <gtk/gtk.h>
namespace Gtk
{
-//Allow the generated code to work without the prefix:
-typedef RecentManager::ListHandle_RecentInfos ListHandle_RecentInfos;
-
bool RecentManager::add_item(const Glib::ustring& uri, const Data& data)
{
GtkRecentData c_data;
diff --git a/gtk/src/recentmanager.hg b/gtk/src/recentmanager.hg
index b47d9e7..5f6b42c 100644
--- a/gtk/src/recentmanager.hg
+++ b/gtk/src/recentmanager.hg
@@ -17,13 +17,14 @@
_CONFIGINCLUDE(gtkmmconfig.h)
+#include <vector>
+
#include <gdkmm/screen.h>
#include <gdkmm/pixbuf.h>
#include <gtkmm/recentinfo.h>
#include <glibmm/object.h>
-#include <glibmm/containers.h>
_DEFS(gtkmm,gtk)
_PINCLUDE(glibmm/private/object_p.h)
@@ -122,10 +123,9 @@ public:
_WRAP_METHOD(bool has_item(const Glib::ustring& uri) const, gtk_recent_manager_has_item)
_WRAP_METHOD(bool move_item(const Glib::ustring& uri, const Glib::ustring& new_uri), gtk_recent_manager_move_item, errthrow)
- typedef Glib::ListHandle<RecentInfo, RecentInfoTraits> ListHandle_RecentInfos;
- _CONVERSION(`GList*',`ListHandle_RecentInfos',__FL2H_SHALLOW)
+#m4 _CONVERSION(`GList*',`std::vector<Glib::RefPtr<RecentInfo> >',`Glib::ListHandler<Glib::RefPtr<RecentInfo>, RecentInfoTraits>::list_to_vector($3, Glib::OWNERSHIP_SHALLOW)')
- _WRAP_METHOD(ListHandle_RecentInfos get_items() const, gtk_recent_manager_get_items)
+ _WRAP_METHOD(std::vector<Glib::RefPtr<RecentInfo> > get_items() const, gtk_recent_manager_get_items)
_WRAP_METHOD(int purge_items(), gtk_recent_manager_purge_items, errthrow)
diff --git a/gtk/src/scalebutton.ccg b/gtk/src/scalebutton.ccg
index 2269b5d..3d07691 100644
--- a/gtk/src/scalebutton.ccg
+++ b/gtk/src/scalebutton.ccg
@@ -20,6 +20,8 @@
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
+#include <glibmm/vectorutils.h>
+
#include <gtk/gtk.h>
namespace Gtk
diff --git a/gtk/src/scalebutton.hg b/gtk/src/scalebutton.hg
index 8de1a4e..8fb1f0a 100644
--- a/gtk/src/scalebutton.hg
+++ b/gtk/src/scalebutton.hg
@@ -18,6 +18,8 @@
_CONFIGINCLUDE(gtkmmconfig.h)
+#include <vector>
+
#include <gtkmm/button.h>
#include <gtkmm/adjustment.h>
#include <gtkmm/orientable.h>
@@ -45,9 +47,10 @@ class ScaleButton
_IMPLEMENTS_INTERFACE(Orientable)
public:
- _WRAP_CTOR(ScaleButton(IconSize size, double min, double max, double step, const Glib::StringArrayHandle& icons), gtk_scale_button_new)
+#m4 _CONVERSION(`const std::vector<Glib::ustring>&',`const gchar**',`Glib::ArrayHandler<Glib::ustring>::vector_to_array($3).data ()')
+ _WRAP_CTOR(ScaleButton(IconSize size, double min, double max, double step, const std::vector<Glib::ustring>& icons), gtk_scale_button_new)
- _WRAP_METHOD(void set_icons(const Glib::StringArrayHandle& icons), gtk_scale_button_set_icons)
+ _WRAP_METHOD(void set_icons(const std::vector<Glib::ustring>& icons), gtk_scale_button_set_icons)
_WRAP_METHOD(double get_value() const, gtk_scale_button_get_value)
_WRAP_METHOD(void set_value(double value), gtk_scale_button_set_value)
@@ -74,7 +77,7 @@ public:
_WRAP_PROPERTY("value", double)
_WRAP_PROPERTY("size", IconSize)
_WRAP_PROPERTY("adjustment", Adjustment*)
- _WRAP_PROPERTY("icons", Glib::StringArrayHandle)
+ _WRAP_PROPERTY("icons", std::vector<Glib::ustring>)
_WRAP_PROPERTY("orientation", Orientation)
};
diff --git a/gtk/src/selectiondata.ccg b/gtk/src/selectiondata.ccg
index 20b6332..ba7376e 100644
--- a/gtk/src/selectiondata.ccg
+++ b/gtk/src/selectiondata.ccg
@@ -18,6 +18,8 @@
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
+#include <glibmm/vectorutils.h>
+
#include <gtkmm/textbuffer.h>
#include <gdkmm/pixbuf.h>
#include <glibmm/utility.h> //For ScopedPtr<>.
@@ -73,7 +75,7 @@ std::string SelectionData::get_target() const
gdk_atom_name( gtk_selection_data_get_target(const_cast<GtkSelectionData*>(gobj())) ) );
}
-Gdk::ArrayHandle_AtomString SelectionData::get_targets() const
+std::vector<std::string> SelectionData::get_targets() const
{
GdkAtom* targets = 0;
int n_targets = 0;
@@ -82,7 +84,7 @@ Gdk::ArrayHandle_AtomString SelectionData::get_targets() const
n_targets = 0; // it's set to -1 otherwise
//Note that we free the GdkAtom* array, but we don't need to free its items:
- return Gdk::ArrayHandle_AtomString(targets, n_targets, Glib::OWNERSHIP_SHALLOW);
+ return Glib::ArrayHandler<std::string, Gdk::AtomStringTraits>::array_to_vector(targets, n_targets, Glib::OWNERSHIP_SHALLOW);
}
diff --git a/gtk/src/selectiondata.hg b/gtk/src/selectiondata.hg
index 06a4a07..6abe9c9 100644
--- a/gtk/src/selectiondata.hg
+++ b/gtk/src/selectiondata.hg
@@ -19,6 +19,8 @@
_DEFS(gtkmm,gtk)
+#include <vector>
+
#include <gdkmm/display.h>
#include <gdkmm/pixbuf.h>
@@ -79,11 +81,12 @@ public:
_WRAP_METHOD(bool set_pixbuf(const Glib::RefPtr<Gdk::Pixbuf>& pixbuf), gtk_selection_data_set_pixbuf)
_WRAP_METHOD(Glib::RefPtr<Gdk::Pixbuf> get_pixbuf(), gtk_selection_data_get_pixbuf)
_WRAP_METHOD(Glib::RefPtr<const Gdk::Pixbuf> get_pixbuf() const, gtk_selection_data_get_pixbuf, constversion)
-
+
#dnl The constness of gtk_selection_data_set_uris() is not quite right:
-#m4 _CONVERSION(`const Glib::StringArrayHandle&',`gchar**',`const_cast<char**>(($3).data())')
- _WRAP_METHOD(bool set_uris(const Glib::StringArrayHandle& uris), gtk_selection_data_set_uris)
- _WRAP_METHOD(Glib::StringArrayHandle get_uris() const, gtk_selection_data_get_uris)
+#m4 _CONVERSION(`const std::vector<Glib::ustring>&',`gchar**',`const_cast<char**>(Glib::ArrayHandler<Glib::ustring>::vector_to_array($3).data())')
+ _WRAP_METHOD(bool set_uris(const std::vector<Glib::ustring>& uris), gtk_selection_data_set_uris)
+#m4 _CONVERSION(`gchar**',`std::vector<Glib::ustring>',`Glib::ArrayHandler<Glib::ustring>::array_to_vector($3, Glib::OWNERSHIP_DEEP)')
+ _WRAP_METHOD(std::vector<Glib::ustring> get_uris() const, gtk_selection_data_get_uris)
_WRAP_METHOD(const guchar* get_data() const, gtk_selection_data_get_data)
@@ -91,8 +94,8 @@ public:
std::string get_data_as_string() const;
- //TODO: Change the return type to std::string, when we can break ABI:
- _WRAP_METHOD(GdkAtom get_selection() const, gtk_selection_data_get_selection)
+#m4 _CONVERSION(`GdkAtom',`std::string',`Gdk::AtomString::to_cpp_type ($3)')
+ _WRAP_METHOD(std::string get_selection() const, gtk_selection_data_get_selection)
/** Retrieves the target of the selection.
*
@@ -102,7 +105,7 @@ public:
_IGNORE(gtk_selection_data_get_target)
/// See also Gtk::Clipboard::request_targets()
- Gdk::ArrayHandle_AtomString get_targets() const;
+ std::vector<std::string> get_targets() const;
_IGNORE(gtk_selection_data_get_targets)
/** Returns the type of the data as set by SelectionData::set().
diff --git a/gtk/src/sizegroup.ccg b/gtk/src/sizegroup.ccg
index b9fa611..c489272 100644
--- a/gtk/src/sizegroup.ccg
+++ b/gtk/src/sizegroup.ccg
@@ -20,6 +20,8 @@
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
+#include <glibmm/vectorutils.h>
+
#include <gtk/gtk.h>
namespace Gtk
diff --git a/gtk/src/sizegroup.hg b/gtk/src/sizegroup.hg
index b14e046..637a260 100644
--- a/gtk/src/sizegroup.hg
+++ b/gtk/src/sizegroup.hg
@@ -19,6 +19,8 @@
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
+#include <vector>
+
#include <glibmm/object.h>
#include <gtkmm/widget.h>
_DEFS(gtkmm,gtk)
@@ -70,8 +72,10 @@ public:
_WRAP_METHOD(void add_widget(Widget& widget), gtk_size_group_add_widget)
_WRAP_METHOD(void remove_widget(Widget& widget), gtk_size_group_remove_widget)
- _WRAP_METHOD(Glib::SListHandle<Widget*> get_widgets(), gtk_size_group_get_widgets)
- _WRAP_METHOD(Glib::SListHandle<const Widget*> get_widgets() const, gtk_size_group_get_widgets)
+#m4 _CONVERSION(`GSList*',`std::vector<Widget*>',`Glib::SListHandler<Widget*>::slist_to_vector($3, Glib::OWNERSHIP_NONE)')
+ _WRAP_METHOD(std::vector<Widget*> get_widgets(), gtk_size_group_get_widgets)
+#m4 _CONVERSION(`GSList*',`std::vector<const Widget*>',`Glib::SListHandler<const Widget*>::slist_to_vector($3, Glib::OWNERSHIP_NONE)')
+ _WRAP_METHOD(std::vector<const Widget*> get_widgets() const, gtk_size_group_get_widgets)
_WRAP_PROPERTY("mode", SizeGroupMode)
_WRAP_PROPERTY("ignore_hidden", bool)
diff --git a/gtk/src/table.hg b/gtk/src/table.hg
index 9223a98..cb6cdd4 100644
--- a/gtk/src/table.hg
+++ b/gtk/src/table.hg
@@ -17,7 +17,6 @@
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-#include <glibmm/helperlist.h>
#include <gtkmm/container.h>
#include <gtkmm/enums.h>
diff --git a/gtk/src/targetlist.ccg b/gtk/src/targetlist.ccg
index d6e0023..e0e9b41 100644
--- a/gtk/src/targetlist.ccg
+++ b/gtk/src/targetlist.ccg
@@ -15,17 +15,19 @@
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
+#include <glibmm/vectorutils.h>
+
namespace Gtk
{
-Glib::RefPtr<Gtk::TargetList> TargetList::create(const ArrayHandle_TargetEntry& targets)
+Glib::RefPtr<Gtk::TargetList> TargetList::create(const std::vector<TargetEntry>& targets)
{
- return Glib::wrap(gtk_target_list_new(targets.data(), targets.size()));
+ return Glib::wrap(gtk_target_list_new(Glib::ArrayHandler<TargetEntry, TargetEntryTraits>::vector_to_array(targets).data(), targets.size()));
}
-void TargetList::add(const ArrayHandle_TargetEntry& targets)
+void TargetList::add(const std::vector<TargetEntry>& targets)
{
- gtk_target_list_add_table(gobj(), targets.data(), targets.size());
+ gtk_target_list_add_table(gobj(), Glib::ArrayHandler<TargetEntry, TargetEntryTraits>::vector_to_array(targets).data(), targets.size());
}
} // namespace Gtk
diff --git a/gtk/src/targetlist.hg b/gtk/src/targetlist.hg
index 318e5bf..571556f 100644
--- a/gtk/src/targetlist.hg
+++ b/gtk/src/targetlist.hg
@@ -17,6 +17,8 @@
_DEFS(gtkmm,gtk)
+#include <vector>
+
#include <gtkmm/enums.h>
#include <gtkmm/targetentry.h>
#include <gdkmm/types.h>
@@ -31,11 +33,11 @@ class TargetList
_CLASS_OPAQUE_REFCOUNTED(TargetList, GtkTargetList, NONE, gtk_target_list_ref, gtk_target_list_unref)
_IGNORE(gtk_selection_data_copy, gtk_selection_data_free)
public:
- static Glib::RefPtr<Gtk::TargetList> create(const ArrayHandle_TargetEntry& targets);
+ static Glib::RefPtr<Gtk::TargetList> create(const std::vector<TargetEntry>& targets);
#m4 _CONVERSION(`TargetFlags', `guint', `($2)($3)')
_WRAP_METHOD(void add(const Glib::ustring& target, TargetFlags flags = TargetFlags(0), guint info = 0), gtk_target_list_add)
- void add(const ArrayHandle_TargetEntry& targets);
+ void add(const std::vector<TargetEntry>& targets);
_WRAP_METHOD(void remove(const Glib::ustring& target), gtk_target_list_remove)
_WRAP_METHOD(bool find(const Glib::ustring& target, guint* info) const, gtk_target_list_find)
};
diff --git a/gtk/src/textbuffer.ccg b/gtk/src/textbuffer.ccg
index c8fc251..0534f5e 100644
--- a/gtk/src/textbuffer.ccg
+++ b/gtk/src/textbuffer.ccg
@@ -1,4 +1,4 @@
-// -*- c++ -*-
+Atom// -*- c++ -*-
/* $Id: textbuffer.ccg,v 1.8 2006/11/20 09:19:49 murrayc Exp $ */
/* Copyright(C) 1998-2002 The gtkmm Development Team
@@ -18,6 +18,8 @@
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
+#include <glibmm/vectorutils.h>
+
#include <gtk/gtk.h>
#include <glib.h>
#include <gtkmm/textmark.h>
@@ -332,7 +334,7 @@ TextBuffer::iterator TextBuffer::insert_with_tag(const iterator& pos,
}
TextBuffer::iterator TextBuffer::insert_with_tags(const iterator& pos, const Glib::ustring& text,
- const Glib::ArrayHandle< Glib::RefPtr<Tag> >& tags)
+ const std::vector< Glib::RefPtr<Tag> >& tags)
{
const char *const text_begin = text.data();
return insert_with_tags(pos, text_begin, text_begin + text.bytes(), tags);
@@ -340,7 +342,7 @@ TextBuffer::iterator TextBuffer::insert_with_tags(const iterator& pos, const Gli
TextBuffer::iterator TextBuffer::insert_with_tags(const iterator& pos,
const char* text_begin, const char* text_end,
- const Glib::ArrayHandle< Glib::RefPtr<Tag> >& tags)
+ const std::vector< Glib::RefPtr<Tag> >& tags)
{
const int start_offset = pos.get_offset();
iterator range_end (insert(pos, text_begin, text_end));
@@ -348,14 +350,15 @@ TextBuffer::iterator TextBuffer::insert_with_tags(const iterator& pos,
GtkTextIter range_begin;
gtk_text_buffer_get_iter_at_offset(gobj(), &range_begin, start_offset);
+ Glib::ArrayHandler<Glib::RefPtr<Tag> >::ArrayKeeperType array_keeper (Glib::ArrayHandler<Glib::RefPtr<Tag> >::vector_to_array(tags));
+
//This was GtkTextTag* const * const, but the SUN Forte compiler said that it couldn't convert to that. murrayc
- const GtkTextTag* const* tags_begin = tags.data();
+ const GtkTextTag* const* tags_begin = array_keeper.data();
const GtkTextTag* const* tags_end = tags_begin + tags.size();
//TODO: Investigate if this const_cast<> is really necessary.
//I added it for the SUN Forte compiler. murrayc.
- for(GtkTextTag *const * ptag = const_cast<GtkTextTag* const *>(tags_begin); ptag != const_cast<GtkTextTag* const *>(tags_end);
-++ptag)
+ for(GtkTextTag *const * ptag = const_cast<GtkTextTag* const *>(tags_begin); ptag != const_cast<GtkTextTag* const *>(tags_end); ++ptag)
{
gtk_text_buffer_apply_tag(gobj(), *ptag, &range_begin, range_end.gobj());
}
@@ -364,7 +367,7 @@ TextBuffer::iterator TextBuffer::insert_with_tags(const iterator& pos,
}
TextBuffer::iterator TextBuffer::insert_with_tags_by_name(const iterator& pos, const Glib::ustring& text,
- const Glib::ArrayHandle<Glib::ustring>& tag_names)
+ const std::vector<Glib::ustring>& tag_names)
{
const char *const text_begin = text.data();
return insert_with_tags_by_name(pos, text_begin, text_begin + text.bytes(), tag_names);
@@ -372,7 +375,7 @@ TextBuffer::iterator TextBuffer::insert_with_tags_by_name(const iterator& pos, c
TextBuffer::iterator TextBuffer::insert_with_tags_by_name(const iterator& pos,
const char* text_begin, const char* text_end,
- const Glib::ArrayHandle<Glib::ustring>& tag_names)
+ const std::vector<Glib::ustring>& tag_names)
{
// gtk_buffer_insert_with_tags_by_name() is a convenience wrapper, so it's kind of OK to reimplement it:
@@ -383,8 +386,9 @@ TextBuffer::iterator TextBuffer::insert_with_tags_by_name(const iterator& pos,
gtk_text_buffer_get_iter_at_offset(gobj(), &range_begin, start_offset);
GtkTextTagTable *const tag_table = gtk_text_buffer_get_tag_table(gobj());
+ Glib::ArrayHandler<Glib::ustring>::ArrayKeeperType array_keeper (Glib::ArrayHandler<Glib::ustring>::vector_to_array(tag_names));
- const char *const *const names_begin = tag_names.data();
+ const char *const *const names_begin = array_keeper.data();
const char *const *const names_end = names_begin + tag_names.size();
for(const char *const * pname = names_begin; pname != names_end; ++pname)
@@ -489,46 +493,24 @@ int TextBuffer::size() const
return get_char_count();
}
-//This is not public API:
-//(and it is copy/pasted from clipboard.ccg)
-typedef std::list<Glib::ustring> listStrings;
-static listStrings util_convert_atoms_to_strings(GdkAtom* targets, int n_targets)
-{
- listStrings listTargets;
-
- //Add the targets to the C++ container:
- for(int i = 0; i < n_targets; i++)
- {
- //Convert the atom to a string:
- char* atom_name = gdk_atom_name(targets[i]);
- if(atom_name)
- {
- listTargets.push_back( Glib::ustring(atom_name) );
- g_free(atom_name);
- }
- }
-
- return listTargets;
-}
-
Glib::ustring TextBuffer::get_text(bool include_hidden_chars) const
{
TextBuffer* unconst = const_cast<TextBuffer*>(this); //Because begin() and end() are not const.
return get_text(unconst->begin(), unconst->end(), include_hidden_chars);
}
-Glib::StringArrayHandle TextBuffer::get_serialize_formats() const
+std::vector<Glib::ustring> TextBuffer::get_serialize_formats() const
{
int n_atoms = 0;
GdkAtom* atoms = gtk_text_buffer_get_serialize_formats(const_cast<GtkTextBuffer*>(gobj()), &n_atoms);
- return util_convert_atoms_to_strings(atoms, n_atoms);
+ return Glib::ArrayHandler<Glib::ustring, Gdk::AtomStringTraits>::array_to_vector(atoms, n_atoms, Glib::OWNERSHIP_SHALLOW);
}
-Glib::StringArrayHandle TextBuffer::get_deserialize_formats() const
+std::vector<Glib::ustring> TextBuffer::get_deserialize_formats() const
{
int n_atoms = 0;
GdkAtom* atoms = gtk_text_buffer_get_deserialize_formats(const_cast<GtkTextBuffer*>(gobj()), &n_atoms);
- return util_convert_atoms_to_strings(atoms, n_atoms);
+ return Glib::ArrayHandler<Glib::ustring, Gdk::AtomStringTraits>::array_to_vector(atoms, n_atoms, Glib::OWNERSHIP_SHALLOW);
}
/*
diff --git a/gtk/src/textbuffer.hg b/gtk/src/textbuffer.hg
index c91333d..f602947 100644
--- a/gtk/src/textbuffer.hg
+++ b/gtk/src/textbuffer.hg
@@ -21,6 +21,8 @@
// the #ifndef GTKMM_DISABLE_DEPRECATED in deprecated classes) is generated:
_CONFIGINCLUDE(gtkmmconfig.h)
+#include <vector>
+
#include <gtkmm/texttagtable.h>
#include <gtkmm/textchildanchor.h>
#include <gtkmm/textmark.h>
@@ -250,7 +252,7 @@ public:
* @result Whether text was actually inserted
*/
iterator insert_with_tags(const iterator& pos, const Glib::ustring& text,
- const Glib::ArrayHandle< Glib::RefPtr<Tag> >& tags);
+ const std::vector< Glib::RefPtr<Tag> >& tags);
/** Inserts text into buffer at @a pos, applying the list of tags to the newly-inserted text.
* Equivalent to calling insert(), then apply_tag() on the inserted text; This is just a convenience function.
@@ -262,7 +264,7 @@ public:
* @result Whether text was actually inserted
*/
iterator insert_with_tags(const iterator& pos, const char* text_begin, const char* text_end,
- const Glib::ArrayHandle< Glib::RefPtr<Tag> >& tags);
+ const std::vector< Glib::RefPtr<Tag> >& tags);
/** Inserts text into buffer at @a pos, applying the list of tags to the newly-inserted text.
* Equivalent to calling insert(), then apply_tag() on the inserted text; This is just a convenience function.
@@ -273,7 +275,7 @@ public:
* @result Whether text was actually inserted
*/
iterator insert_with_tags_by_name(const iterator& pos, const Glib::ustring& text,
- const Glib::StringArrayHandle& tag_names);
+ const std::vector<Glib::ustring>& tag_names);
/** Equivalent to calling insert(), then apply_tag() on the inserted text; This is just a convenience function.
@@ -285,7 +287,7 @@ public:
* @result Whether text was actually inserted
*/
iterator insert_with_tags_by_name(const iterator& pos, const char* text_begin, const char* text_end,
- const Glib::StringArrayHandle& tag_names);
+ const std::vector<Glib::ustring>& tag_names);
/* Deletes all text between @a range_begin and @a range_end. The order of range_begin and range_end is not actually relevant.
* This function actually emits the "delete_range" signal, and the default handler of that signal deletes the text.
@@ -469,6 +471,7 @@ public:
//TODO: Use ArrayHandle, or just use guint8* to be more efficient?
+// TODO: Or rather - vector utils.
// typedef sigc::slot<bool, const Glib::RefPtr<TextBuffer>& /* content_buffer */, iterator& /* iter */, const guint8* /* data */, gsize /* length */, bool /* create_tags */> SlotDeserialize;
/*
@@ -491,9 +494,9 @@ public:
_WRAP_METHOD(bool get_can_create_tags(const Glib::ustring& format) const, gtk_text_buffer_deserialize_get_can_create_tags)
- Glib::StringArrayHandle get_serialize_formats() const;
+ std::vector<Glib::ustring> get_serialize_formats() const;
_IGNORE(gtk_text_buffer_get_serialize_formats)
- Glib::StringArrayHandle get_deserialize_formats() const;
+ std::vector<Glib::ustring> get_deserialize_formats() const;
_IGNORE(gtk_text_buffer_get_deserialize_formats)
/*
@@ -508,7 +511,7 @@ public:
gsize& length), gtk_text_buffer_serialize)
//TODO: Is the bool superfluous?
-//TODO: Use an ArrayHandle?
+//TODO: Use an ArrayHandle? Or rather - vector utils.
_WRAP_METHOD(bool deserialize(const Glib::RefPtr<TextBuffer>& content_buffer,
const Glib::ustring& format,
const iterator& iter, const guint8* data,
diff --git a/gtk/src/textchildanchor.ccg b/gtk/src/textchildanchor.ccg
index 7adf20d..e8f5126 100644
--- a/gtk/src/textchildanchor.ccg
+++ b/gtk/src/textchildanchor.ccg
@@ -20,4 +20,6 @@
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
+#include <glibmm/vectorutils.h>
+
#include <gtk/gtk.h>
diff --git a/gtk/src/textchildanchor.hg b/gtk/src/textchildanchor.hg
index 553180e..e08e207 100644
--- a/gtk/src/textchildanchor.hg
+++ b/gtk/src/textchildanchor.hg
@@ -19,9 +19,9 @@
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
+#include <vector>
#include <gtkmm/widget.h>
-#include <glibmm/listhandle.h>
_DEFS(gtkmm,gtk)
_PINCLUDE(glibmm/private/object_p.h)
@@ -45,8 +45,10 @@ protected:
public:
_WRAP_CREATE()
- _WRAP_METHOD(Glib::ListHandle<Widget*> get_widgets(), gtk_text_child_anchor_get_widgets)
- _WRAP_METHOD(Glib::ListHandle<const Widget*> get_widgets() const, gtk_text_child_anchor_get_widgets)
+#m4 _CONVERSION(`GList*',`std::vector<Widget*>',`Glib::ListHandler<Widget*>::list_to_vector($3, Glib::OWNERSHIP_SHALLOW)')
+ _WRAP_METHOD(std::vector<Widget*> get_widgets(), gtk_text_child_anchor_get_widgets)
+#m4 _CONVERSION(`GList*',`std::vector<const Widget*>',`Glib::ListHandler<const Widget*>::list_to_vector($3, Glib::OWNERSHIP_SHALLOW)')
+ _WRAP_METHOD(std::vector<const Widget*> get_widgets() const, gtk_text_child_anchor_get_widgets)
_WRAP_METHOD(bool get_deleted() const, gtk_text_child_anchor_get_deleted)
//These methods, and GtkTextLayout are semi-private:
diff --git a/gtk/src/textiter.ccg b/gtk/src/textiter.ccg
index 303cbc4..af48bc2 100644
--- a/gtk/src/textiter.ccg
+++ b/gtk/src/textiter.ccg
@@ -18,6 +18,8 @@
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
+#include <glibmm/vectorutils.h>
+
#include <gtkmm/texttag.h>
#include <gtkmm/textbuffer.h>
diff --git a/gtk/src/textiter.hg b/gtk/src/textiter.hg
index 0bdafd4..cdd1cfa 100644
--- a/gtk/src/textiter.hg
+++ b/gtk/src/textiter.hg
@@ -17,8 +17,9 @@
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
+#include <vector>
+
#include <glibmm/exceptionhandler.h>
-#include <glibmm/slisthandle.h>
#include <gdkmm/pixbuf.h>
#include <gtkmm/texttag.h>
#include <gtkmm/textchildanchor.h>
@@ -116,14 +117,18 @@ public:
_WRAP_METHOD(Glib::ustring get_visible_text(const TextIter& end) const, gtk_text_iter_get_visible_text)
_WRAP_METHOD(Glib::RefPtr<Gdk::Pixbuf> get_pixbuf() const, gtk_text_iter_get_pixbuf, refreturn)
- _WRAP_METHOD(Glib::SListHandle< Glib::RefPtr<TextMark> > get_marks(), gtk_text_iter_get_marks)
- _WRAP_METHOD(Glib::SListHandle< Glib::RefPtr<const TextMark> > get_marks() const, gtk_text_iter_get_marks)
+#m4 _CONVERSION(`GSList*',`std::vector< Glib::RefPtr<TextMark> >',`Glib::SListHandler<Glib::RefPtr<TextMark> >::slist_to_vector($3, Glib::OWNERSHIP_SHALLOW)')
+ _WRAP_METHOD(std::vector< Glib::RefPtr<TextMark> > get_marks(), gtk_text_iter_get_marks)
+#m4 _CONVERSION(`GSList*',`std::vector< Glib::RefPtr<const TextMark> >',`Glib::SListHandler<Glib::RefPtr<const TextMark> >::slist_to_vector($3, Glib::OWNERSHIP_SHALLOW)')
+ _WRAP_METHOD(std::vector< Glib::RefPtr<const TextMark> > get_marks() const, gtk_text_iter_get_marks)
_WRAP_METHOD(Glib::RefPtr<TextChildAnchor> get_child_anchor(), gtk_text_iter_get_child_anchor, refreturn)
_WRAP_METHOD(Glib::RefPtr<const TextChildAnchor> get_child_anchor() const, gtk_text_iter_get_child_anchor, refreturn)
- _WRAP_METHOD(Glib::SListHandle< Glib::RefPtr<TextTag> > get_toggled_tags(bool toggled_on = true), gtk_text_iter_get_toggled_tags)
- _WRAP_METHOD(Glib::SListHandle< Glib::RefPtr<const TextTag> > get_toggled_tags(bool toggled_on = true) const, gtk_text_iter_get_toggled_tags)
+#m4 _CONVERSION(`GSList*',`std::vector< Glib::RefPtr<TextTag> >',`Glib::SListHandler<Glib::RefPtr<TextTag> >::slist_to_vector($3, Glib::OWNERSHIP_SHALLOW)')
+ _WRAP_METHOD(std::vector< Glib::RefPtr<TextTag> > get_toggled_tags(bool toggled_on = true), gtk_text_iter_get_toggled_tags)
+#m4 _CONVERSION(`GSList*',`std::vector< Glib::RefPtr<const TextTag> >',`Glib::SListHandler<Glib::RefPtr<const TextTag> >::slist_to_vector($3, Glib::OWNERSHIP_SHALLOW)')
+ _WRAP_METHOD(std::vector< Glib::RefPtr<const TextTag> > get_toggled_tags(bool toggled_on = true) const, gtk_text_iter_get_toggled_tags)
_WRAP_METHOD(bool begins_tag(const Glib::RefPtr<const TextTag>& tag) const, gtk_text_iter_begins_tag)
bool begins_tag() const;
@@ -135,8 +140,8 @@ public:
_WRAP_METHOD(bool has_tag(const Glib::RefPtr<const TextTag>& tag) const, gtk_text_iter_has_tag)
bool has_tag() const;
- _WRAP_METHOD(Glib::SListHandle< Glib::RefPtr<TextTag> > get_tags(), gtk_text_iter_get_tags)
- _WRAP_METHOD(Glib::SListHandle< Glib::RefPtr<const TextTag> > get_tags() const, gtk_text_iter_get_tags)
+ _WRAP_METHOD(std::vector< Glib::RefPtr<TextTag> > get_tags(), gtk_text_iter_get_tags)
+ _WRAP_METHOD(std::vector< Glib::RefPtr<const TextTag> > get_tags() const, gtk_text_iter_get_tags)
_WRAP_METHOD(bool editable(bool default_setting = true) const, gtk_text_iter_editable)
_WRAP_METHOD(bool can_insert(bool default_editability = true) const, gtk_text_iter_can_insert)
diff --git a/gtk/src/toolbar.hg b/gtk/src/toolbar.hg
index 1101e9e..0305556 100644
--- a/gtk/src/toolbar.hg
+++ b/gtk/src/toolbar.hg
@@ -23,7 +23,6 @@ _CONFIGINCLUDE(gtkmmconfig.h)
#include <gtkmm/toolitem.h>
#include <gtkmm/toolbutton.h>
#include <gtkmm/toggletoolbutton.h>
-#include <glibmm/helperlist.h>
#include <gtkmm/container.h>
#include <gtkmm/stockid.h>
diff --git a/gtk/src/treemodel.ccg b/gtk/src/treemodel.ccg
index cac516e..d2eb512 100644
--- a/gtk/src/treemodel.ccg
+++ b/gtk/src/treemodel.ccg
@@ -18,6 +18,8 @@
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
+#include <glibmm/vectorutils.h>
+
#include <gtkmm/treeiter.h>
#include <gtkmm/treepath.h>
#include <gtk/gtk.h>
@@ -590,16 +592,22 @@ g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) /
-void TreeModel::rows_reordered(const Path& path, const iterator& iter, const Glib::ArrayHandle<int>& new_order)
+void TreeModel::rows_reordered(const Path& path, const iterator& iter, const std::vector<int>& new_order)
{
//The size of the array seems to be based on the known number of children. murrayc.
- gtk_tree_model_rows_reordered(gobj(), const_cast<GtkTreePath*>((path).gobj()), const_cast<GtkTreeIter*>((iter).gobj()), const_cast<int*>(new_order.data()));
+ gtk_tree_model_rows_reordered(gobj(),
+ const_cast<GtkTreePath*>((path).gobj()),
+ const_cast<GtkTreeIter*>((iter).gobj()),
+ const_cast<int*>(Glib::ArrayHandler<int>::vector_to_array(new_order).data ()));
}
-void TreeModel::rows_reordered(const Path& path, const Glib::ArrayHandle<int>& new_order)
+void TreeModel::rows_reordered(const Path& path, const std::vector<int>& new_order)
{
//The size of the array seems to be based on the known number of children. murrayc.
- gtk_tree_model_rows_reordered(gobj(), const_cast<GtkTreePath*>((path).gobj()), 0, const_cast<int*>(new_order.data()));
+ gtk_tree_model_rows_reordered(gobj(),
+ const_cast<GtkTreePath*>((path).gobj()),
+ 0,
+ const_cast<int*>(Glib::ArrayHandler<int>::vector_to_array(new_order).data ()));
}
} // namespace Gtk
diff --git a/gtk/src/treemodel.hg b/gtk/src/treemodel.hg
index 252f5e2..6bbfd1e 100644
--- a/gtk/src/treemodel.hg
+++ b/gtk/src/treemodel.hg
@@ -17,6 +17,8 @@
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
+#include <vector>
+
#include <gtk/gtk.h>
#include <glibmm/interface.h>
#include <gtkmm/treeiter.h>
@@ -192,11 +194,11 @@ public:
* custom models when their rows have been reordered.
*
* @param path A tree path pointing to the tree node whose children have been reordered.
- * @param iter A valid iterator pointing to the node whose children have been reordered. See also, rows_reordered(const Path& path, const Glib::ArrayHandle<int>& new_order), if the path has a depth of 0.
+ * @param iter A valid iterator pointing to the node whose children have been reordered. See also, rows_reordered(const Path& path, const std::vector<int>& new_order), if the path has a depth of 0.
* @param new_order An array of integers mapping the current position of each child
* to its old position before the re-ordering, i.e. @a new_order<literal>[newpos] = oldpos.
*/
- void rows_reordered(const Path& path, const iterator& iter, const Glib::ArrayHandle<int>& new_order);
+ void rows_reordered(const Path& path, const iterator& iter, const std::vector<int>& new_order);
/** Emits the "rows_reordered" signal on the tree model. This should be called by
* custom models when their rows have been reordered. This method overload is for nodes whose
@@ -207,7 +209,7 @@ public:
* @param new_order An array of integers mapping the current position of each child
* to its old position before the re-ordering, i.e. @a new_order<literal>[newpos] = oldpos.
*/
- void rows_reordered(const Path& path, const Glib::ArrayHandle<int>& new_order);
+ void rows_reordered(const Path& path, const std::vector<int>& new_order);
_WRAP_METHOD(void rows_reordered(const Path& path, const iterator& iter, int* new_order), gtk_tree_model_rows_reordered)
diff --git a/gtk/src/treepath.hg b/gtk/src/treepath.hg
index 1f7bd69..a5ccafd 100644
--- a/gtk/src/treepath.hg
+++ b/gtk/src/treepath.hg
@@ -196,10 +196,7 @@ void TreePath::assign(In pbegin, In pend)
this->swap(temp);
}
-
-/* Traits for use of TreePath in a Glib::ListHandle<>.
- */
-struct TreePath_Traits
+struct TreePathTraits
{
typedef TreePath CppType;
typedef const GtkTreePath* CType;
diff --git a/gtk/src/treeselection.ccg b/gtk/src/treeselection.ccg
index 3f11b8b..94e412e 100644
--- a/gtk/src/treeselection.ccg
+++ b/gtk/src/treeselection.ccg
@@ -18,6 +18,8 @@
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
+#include <glibmm/vectorutils.h>
+
#include <gtkmm/treeview.h>
#include <gtk/gtk.h>
@@ -163,18 +165,18 @@ void TreeSelection::selected_foreach(const SlotForeachPathAndIter& slot) const
gtk_tree_selection_selected_foreach(const_cast<GtkTreeSelection*>(gobj()), &proxy_foreach_selection_path_and_iter_callback, &slot_copy);
}
-TreeSelection::ListHandle_Path TreeSelection::get_selected_rows() const
+std::vector<TreeModel::Path> TreeSelection::get_selected_rows() const
{
- return ListHandle_Path(gtk_tree_selection_get_selected_rows(
+ return Glib::ListHandler<TreeModel::Path, TreePathTraits>::list_to_vector(gtk_tree_selection_get_selected_rows(
const_cast<GtkTreeSelection*>(gobj()), 0), Glib::OWNERSHIP_DEEP);
}
-TreeSelection::ListHandle_Path TreeSelection::get_selected_rows(Glib::RefPtr<TreeModel>& model)
+std::vector<TreeModel::Path> TreeSelection::get_selected_rows(Glib::RefPtr<TreeModel>& model)
{
GtkTreeModel* model_gobject = 0;
- const ListHandle_Path result (gtk_tree_selection_get_selected_rows(
- const_cast<GtkTreeSelection*>(gobj()), &model_gobject), Glib::OWNERSHIP_DEEP);
+ const std::vector<TreeModel::Path> result (Glib::ListHandler<TreeModel::Path, TreePathTraits>::list_to_vector(gtk_tree_selection_get_selected_rows(
+ const_cast<GtkTreeSelection*>(gobj()), &model_gobject), Glib::OWNERSHIP_DEEP));
model = Glib::wrap(model_gobject, true);
return result;
diff --git a/gtk/src/treeselection.hg b/gtk/src/treeselection.hg
index a95a33c..e859c5e 100644
--- a/gtk/src/treeselection.hg
+++ b/gtk/src/treeselection.hg
@@ -17,6 +17,7 @@
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
+#include <vector>
#include <gtkmm/enums.h>
#include <gtkmm/treemodel.h>
@@ -116,15 +117,13 @@ public:
*/
TreeModel::iterator get_selected(Glib::RefPtr<TreeModel>& model);
- typedef Glib::ListHandle<TreeModel::Path, TreePath_Traits> ListHandle_Path;
-
/** Creates a list of paths of all selected rows.
* Additionally, if you are planning on modifying the model after calling this function,
* you may want to convert the returned list into a list of GtkTreeRowReferences.
*
* @returns a standard container containing a Gtk::Model::Path for each selected row.
*/
- ListHandle_Path get_selected_rows() const;
+ std::vector<TreeModel::Path> get_selected_rows() const;
/** Creates a list of paths of all selected rows.
* Additionally, if you are planning on modifying the model after calling this function,
@@ -133,7 +132,7 @@ public:
* @retval model The current TreeModel.
* @returns a standard container containing a Gtk::Model::Path for each selected row.
*/
- ListHandle_Path get_selected_rows(Glib::RefPtr<TreeModel>& model);
+ std::vector<TreeModel::Path> get_selected_rows(Glib::RefPtr<TreeModel>& model);
_WRAP_METHOD(int count_selected_rows() const, gtk_tree_selection_count_selected_rows)
diff --git a/gtk/src/treestore.ccg b/gtk/src/treestore.ccg
index beeb792..7c1b4fc 100644
--- a/gtk/src/treestore.ccg
+++ b/gtk/src/treestore.ccg
@@ -18,6 +18,8 @@
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
+#include <glibmm/vectorutils.h>
+
#include <gtk/gtk.h>
@@ -122,11 +124,11 @@ void TreeStore::move(const iterator& source, const iterator& destination)
const_cast<GtkTreeIter*>(destination.get_gobject_if_not_end()));
}
-void TreeStore::reorder(const TreeNodeChildren& node, const Glib::ArrayHandle<int>& new_order)
+void TreeStore::reorder(const TreeNodeChildren& node, const std::vector<int>& new_order)
{
gtk_tree_store_reorder(gobj(),
const_cast<GtkTreeIter*>(node.get_parent_gobject()),
- const_cast<int*>(new_order.data()));
+ const_cast<int*>(Glib::ArrayHandler<int>::vector_to_array(new_order).data ()));
}
void TreeStore::set_value_impl(const iterator& row, int column, const Glib::ValueBase& value)
diff --git a/gtk/src/treestore.hg b/gtk/src/treestore.hg
index ed1233d..35be487 100644
--- a/gtk/src/treestore.hg
+++ b/gtk/src/treestore.hg
@@ -17,6 +17,8 @@
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
+#include <vector>
+
#include <gtkmm/treeiter.h>
#include <gtkmm/treemodel.h>
#include <gtkmm/treesortable.h>
@@ -152,7 +154,7 @@ public:
/** Reorders the children of @a node to follow the order indicated by @a new_order.
* Note that this function only works with unsorted stores.
*/
- void reorder(const TreeNodeChildren& node, const Glib::ArrayHandle<int>& new_order);
+ void reorder(const TreeNodeChildren& node, const std::vector<int>& new_order);
_WRAP_METHOD(void clear(), gtk_tree_store_clear)
_WRAP_METHOD(bool is_ancestor(const iterator& iter, const iterator& descendant) const, gtk_tree_store_is_ancestor)
diff --git a/gtk/src/treeview.ccg b/gtk/src/treeview.ccg
index d3f16cc..18c561f 100644
--- a/gtk/src/treeview.ccg
+++ b/gtk/src/treeview.ccg
@@ -18,6 +18,8 @@
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
+#include <glibmm/vectorutils.h>
+
#include <gtkmm/treeviewcolumn.h>
#include <gtkmm/treeview_private.h>
#include <gtkmm/treemodel.h>
@@ -145,33 +147,35 @@ void TreeView::get_cursor(TreeModel::Path& path, TreeViewColumn*& focus_column)
}
-void TreeView::enable_model_drag_source(const ArrayHandle_TargetEntry& targets,
+void TreeView::enable_model_drag_source(const std::vector<TargetEntry>& targets,
Gdk::ModifierType start_button_mask,
Gdk::DragAction actions)
{
gtk_tree_view_enable_model_drag_source(
gobj(), (GdkModifierType) start_button_mask,
- targets.data(), targets.size(), (GdkDragAction) actions);
+ Glib::ArrayHandler<TargetEntry, TargetEntryTraits>::vector_to_array(targets).data(),
+ targets.size(), (GdkDragAction) actions);
}
void TreeView::enable_model_drag_source(Gdk::ModifierType start_button_mask, Gdk::DragAction actions)
{
- std::list<TargetEntry> listTargets;
- listTargets.push_back(TargetEntry(treeview_target_row));
- enable_model_drag_source(listTargets, start_button_mask, actions);
+ std::vector<TargetEntry> targets (1, TargetEntry (treeview_target_row));
+
+ enable_model_drag_source(targets, start_button_mask, actions);
}
-void TreeView::enable_model_drag_dest(const ArrayHandle_TargetEntry& targets, Gdk::DragAction actions)
+void TreeView::enable_model_drag_dest(const std::vector<TargetEntry>& targets, Gdk::DragAction actions)
{
gtk_tree_view_enable_model_drag_dest(
- gobj(), targets.data(), targets.size(), (GdkDragAction) actions);
+ gobj(), Glib::ArrayHandler<TargetEntry, TargetEntryTraits>::vector_to_array(targets).data(),
+ targets.size(), (GdkDragAction) actions);
}
void TreeView::enable_model_drag_dest(Gdk::DragAction actions)
{
- std::list<TargetEntry> listTargets;
- listTargets.push_back(TargetEntry(treeview_target_row));
- enable_model_drag_dest(listTargets, actions);
+ std::vector<TargetEntry> targets (1, TargetEntry (treeview_target_row));
+
+ enable_model_drag_dest(targets, actions);
}
bool TreeView::get_path_at_pos(int x, int y, TreeModel::Path& path, TreeViewColumn*& column, int& cell_x, int& cell_y) const
@@ -291,13 +295,18 @@ void TreeView::remove_all_columns()
//This method is not in GTK+, but it seems useful.
//Remove all View columns:
- typedef std::list< Gtk::TreeView::Column* > type_vecViewColumns;
- type_vecViewColumns vecViewColumns = get_columns();
- for(type_vecViewColumns::iterator iter = vecViewColumns.begin(); iter != vecViewColumns.end(); ++iter)
+ std::vector<Gtk::TreeView::Column*> vecViewColumns (get_columns());
+
+ for (std::vector<Gtk::TreeView::Column*>::iterator iter (vecViewColumns.begin ()), columns_end (vecViewColumns.end ());
+ iter != columns_end;
+ ++iter)
{
- Gtk::TreeView::Column* pViewColumn = *iter;
+ Gtk::TreeView::Column* pViewColumn (*iter);
+
if(pViewColumn)
+ {
remove_column(*pViewColumn);
+ }
}
}
diff --git a/gtk/src/treeview.hg b/gtk/src/treeview.hg
index 341d641..90df729 100644
--- a/gtk/src/treeview.hg
+++ b/gtk/src/treeview.hg
@@ -19,7 +19,8 @@
// the #ifndef GTKMM_DISABLE_DEPRECATED in deprecated classes) is generated:
_CONFIGINCLUDE(gtkmmconfig.h)
-#include <glibmm/listhandle.h>
+#include <vector>
+
#include <gtkmm/container.h>
#include <gtkmm/treeviewcolumn.h>
#include <gtkmm/treeselection.h>
@@ -300,8 +301,10 @@ public:
*/
const CellRenderer* get_column_cell_renderer(int n) const;
- _WRAP_METHOD(Glib::ListHandle<TreeViewColumn*> get_columns(), gtk_tree_view_get_columns)
- _WRAP_METHOD(Glib::ListHandle<const TreeViewColumn*> get_columns() const, gtk_tree_view_get_columns)
+#m4 _CONVERSION(`GList*',`std::vector<TreeViewColumn*>',`Glib::ListHandler<TreeViewColumn*>::list_to_vector($3, Glib::OWNERSHIP_SHALLOW)')
+ _WRAP_METHOD(std::vector<TreeViewColumn*> get_columns(), gtk_tree_view_get_columns)
+#m4 _CONVERSION(`GList*',`std::vector<const TreeViewColumn*>',`Glib::ListHandler<const TreeViewColumn*>::list_to_vector($3, Glib::OWNERSHIP_SHALLOW)')
+ _WRAP_METHOD(std::vector<const TreeViewColumn*> get_columns() const, gtk_tree_view_get_columns)
_WRAP_METHOD(void move_column_after(TreeViewColumn& column, TreeViewColumn& base_column), gtk_tree_view_move_column_after)
@@ -563,7 +566,7 @@ public:
* @param start_button_mask Mask of allowed buttons to start drag.
* @param actions The bitmask of possible actions for a drag from this widget.
*/
- void enable_model_drag_source(const ArrayHandle_TargetEntry& targets,
+ void enable_model_drag_source(const std::vector<TargetEntry>& targets,
Gdk::ModifierType start_button_mask = Gdk::MODIFIER_MASK,
Gdk::DragAction actions = Gdk::ACTION_COPY | Gdk::ACTION_MOVE);
@@ -584,7 +587,7 @@ public:
* @param targets The table of targets that the drag will support.
* @param actions The bitmask of possible actions for a drag from this widget.
*/
- void enable_model_drag_dest(const ArrayHandle_TargetEntry& targets, Gdk::DragAction actions = Gdk::ACTION_COPY | Gdk::ACTION_MOVE);
+ void enable_model_drag_dest(const std::vector<TargetEntry>& targets, Gdk::DragAction actions = Gdk::ACTION_COPY | Gdk::ACTION_MOVE);
/** Turns the TreeView into a drop destination for automatic DND. This uses the default
* "GTK_TREE_MODEL_ROW" target, which the TreeView can handle automatically.
diff --git a/gtk/src/treeviewcolumn.hg b/gtk/src/treeviewcolumn.hg
index e20cdb4..867cf7d 100644
--- a/gtk/src/treeviewcolumn.hg
+++ b/gtk/src/treeviewcolumn.hg
@@ -24,7 +24,6 @@ _CONFIGINCLUDE(gtkmmconfig.h)
#include <gdkmm/window.h>
#include <gtkmm/treemodel.h>
#include <gtkmm/celllayout.h>
-#include <glibmm/listhandle.h>
#include <gtkmm/cellrenderer_generation.h>
_DEFS(gtkmm,gtk)
_PINCLUDE(gtkmm/private/object_p.h)
diff --git a/gtk/src/uimanager.ccg b/gtk/src/uimanager.ccg
index 03a501d..6460ef1 100644
--- a/gtk/src/uimanager.ccg
+++ b/gtk/src/uimanager.ccg
@@ -18,6 +18,8 @@
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
+#include <glibmm/vectorutils.h>
+
#include <gtk/gtk.h>
diff --git a/gtk/src/uimanager.hg b/gtk/src/uimanager.hg
index e63c402..2b8280e 100644
--- a/gtk/src/uimanager.hg
+++ b/gtk/src/uimanager.hg
@@ -17,10 +17,11 @@
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
+#include <vector>
+
#include <gtkmm/widget.h>
#include <gtkmm/action.h>
#include <gtkmm/actiongroup.h>
-#include <gtkmm/uimanager.h>
_DEFS(gtkmm,gtk)
_PINCLUDE(glibmm/private/object_p.h)
@@ -188,19 +189,20 @@ public:
_WRAP_METHOD(void remove_action_group(const Glib::RefPtr<ActionGroup>& action_group), gtk_ui_manager_remove_action_group)
#m4 dnl // Override the conversion in convert_gtk.m4, because the default behaviour is wrong for this method:
-#m4 _CONVERSION(`GList*', `Glib::ListHandle Glib::RefPtr<ActionGroup> >', __FL2H_NONE)
-#m4 _CONVERSION(`GList*', `Glib::ListHandle< Glib::RefPtr<ActionGroup> >', __FL2H_NONE)
-
- _WRAP_METHOD(Glib::ListHandle< Glib::RefPtr<ActionGroup> > get_action_groups(), gtk_ui_manager_get_action_groups)
- _WRAP_METHOD(Glib::ListHandle< Glib::RefPtr<const ActionGroup> > get_action_groups() const, gtk_ui_manager_get_action_groups)
+#m4 _CONVERSION(`GList*', `std::vector< Glib::RefPtr<ActionGroup> >', `Glib::ListHandler<Glib::RefPtr<ActionGroup> >::list_to_vector($3, Glib::OWNERSHIP_NONE)')
+ _WRAP_METHOD(std::vector< Glib::RefPtr<ActionGroup> > get_action_groups(), gtk_ui_manager_get_action_groups)
+#m4 _CONVERSION(`GList*', `std::vector< Glib::RefPtr<const ActionGroup> >', `Glib::ListHandler<Glib::RefPtr<const ActionGroup> >::list_to_vector($3, Glib::OWNERSHIP_NONE)')
+ _WRAP_METHOD(std::vector< Glib::RefPtr<const ActionGroup> > get_action_groups() const, gtk_ui_manager_get_action_groups)
_WRAP_METHOD(Glib::RefPtr<AccelGroup> get_accel_group(), gtk_ui_manager_get_accel_group, refreturn)
_WRAP_METHOD(Glib::RefPtr<const AccelGroup> get_accel_group() const, gtk_ui_manager_get_accel_group, refreturn, constversion)
_WRAP_METHOD(Widget* get_widget(const Glib::ustring& path), gtk_ui_manager_get_widget)
_WRAP_METHOD(const Widget* get_widget(const Glib::ustring& path) const, gtk_ui_manager_get_widget, constversion)
- _WRAP_METHOD(Glib::SListHandle<Widget*> get_toplevels(UIManagerItemType types), gtk_ui_manager_get_toplevels)
- _WRAP_METHOD(Glib::SListHandle<const Widget*> get_toplevels(UIManagerItemType types) const, gtk_ui_manager_get_toplevels)
+#m4 _CONVERSION(`GSList*',`std::vector<Widget*>',`Glib::SListHandler<Widget*>::slist_to_vector($3, Glib::OWNERSHIP_SHALLOW)')
+ _WRAP_METHOD(std::vector<Widget*> get_toplevels(UIManagerItemType types), gtk_ui_manager_get_toplevels)
+#m4 _CONVERSION(`GSList*',`std::vector<const Widget*>',`Glib::SListHandler<const Widget*>::slist_to_vector($3, Glib::OWNERSHIP_SHALLOW)')
+ _WRAP_METHOD(std::vector<const Widget*> get_toplevels(UIManagerItemType types) const, gtk_ui_manager_get_toplevels)
_WRAP_METHOD(Glib::RefPtr<Action> get_action(const Glib::ustring& path), gtk_ui_manager_get_action, refreturn)
_WRAP_METHOD(Glib::RefPtr<const Action> get_action(const Glib::ustring& path) const, gtk_ui_manager_get_action, refreturn, constversion)
diff --git a/gtk/src/widget.ccg b/gtk/src/widget.ccg
index e32c149..eba7aa3 100644
--- a/gtk/src/widget.ccg
+++ b/gtk/src/widget.ccg
@@ -18,6 +18,8 @@
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
+#include <glibmm/vectorutils.h>
+
#include <gtkmm/adjustment.h>
#include <gtkmm/window.h>
#include <gtkmm/accelgroup.h>
@@ -294,24 +296,26 @@ void Widget::drag_dest_set(DestDefaults flags, Gdk::DragAction actions)
gtk_drag_dest_set(gobj(), (GtkDestDefaults)flags, 0, 0, (GdkDragAction)actions);
}
-void Widget::drag_dest_set(const ArrayHandle_TargetEntry& targets,
+void Widget::drag_dest_set(const std::vector<TargetEntry>& targets,
DestDefaults flags, Gdk::DragAction actions)
{
// I've used Gdk::ACTION_COPY as the default, because Gdk::ACTION_DEFAULT means that
// it's never a drag destination, so it would seem like this method didn't work. murrayc.
gtk_drag_dest_set(
gobj(), (GtkDestDefaults)flags,
- targets.data(), targets.size(), (GdkDragAction)actions);
+ Glib::ArrayHandler<TargetEntry, TargetEntryTraits>::vector_to_array(targets).data(),
+ targets.size(), (GdkDragAction)actions);
}
-void Widget::drag_source_set(const ArrayHandle_TargetEntry& targets,
+void Widget::drag_source_set(const std::vector<TargetEntry>& targets,
Gdk::ModifierType start_button_mask, Gdk::DragAction actions)
{
// I've used Gdk::MODIFIER_MASK as the default, because it seems
// to mean 'whatever is possible in the context'. murrayc.
gtk_drag_source_set(
gobj(), (GdkModifierType)start_button_mask,
- targets.data(), targets.size(), (GdkDragAction)actions);
+ Glib::ArrayHandler<TargetEntry, TargetEntryTraits>::vector_to_array(targets).data(),
+ targets.size(), (GdkDragAction)actions);
}
Widget* Widget::drag_get_source_widget(const Glib::RefPtr<Gdk::DragContext>& context) //static
diff --git a/gtk/src/widget.hg b/gtk/src/widget.hg
index f2876d5..0debddb 100644
--- a/gtk/src/widget.hg
+++ b/gtk/src/widget.hg
@@ -17,6 +17,7 @@
_CONFIGINCLUDE(gtkmmconfig.h)
+#include <vector>
#include <pangomm/context.h>
#include <pangomm/layout.h>
@@ -411,8 +412,10 @@ public:
_WRAP_METHOD(WidgetPath get_path() const, gtk_widget_get_path)
_IGNORE(gtk_widget_path, gtk_widget_class_path) //deprecated
- _WRAP_METHOD(Glib::ListHandle<Widget*> list_mnemonic_labels(), gtk_widget_list_mnemonic_labels)
- _WRAP_METHOD(Glib::ListHandle<const Widget*> list_mnemonic_labels() const, gtk_widget_list_mnemonic_labels)
+#m4 _CONVERSION(`GList*',`std::vector<Widget*>',`Glib::ListHandler<Widget*>::list_to_vector($3, Glib::OWNERSHIP_SHALLOW)')
+ _WRAP_METHOD(std::vector<Widget*> list_mnemonic_labels(), gtk_widget_list_mnemonic_labels)
+#m4 _CONVERSION(`GList*',`std::vector<const Widget*>',`Glib::ListHandler<const Widget*>::list_to_vector($3, Glib::OWNERSHIP_SHALLOW)')
+ _WRAP_METHOD(std::vector<const Widget*> list_mnemonic_labels() const, gtk_widget_list_mnemonic_labels)
_WRAP_METHOD(void add_mnemonic_label(Widget& label), gtk_widget_add_mnemonic_label)
_WRAP_METHOD(void remove_mnemonic_label(Widget& label), gtk_widget_remove_mnemonic_label)
@@ -424,7 +427,7 @@ public:
//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);
+ void drag_dest_set(const std::vector<TargetEntry>& targets, DestDefaults flags = DEST_DEFAULT_ALL, Gdk::DragAction actions = Gdk::ACTION_COPY);
_IGNORE(gtk_drag_dest_set)
_WRAP_METHOD(void drag_dest_set_proxy(const Glib::RefPtr<Gdk::Window>& proxy_window, Gdk::DragProtocol protocol, bool use_coordinates), gtk_drag_dest_set_proxy)
@@ -440,7 +443,7 @@ public:
_WRAP_METHOD(void drag_dest_add_image_targets(), gtk_drag_dest_add_image_targets)
_WRAP_METHOD(void drag_dest_add_uri_targets(), gtk_drag_dest_add_uri_targets)
- void drag_source_set(const ArrayHandle_TargetEntry& targets, Gdk::ModifierType start_button_mask = Gdk::MODIFIER_MASK, Gdk::DragAction actions = Gdk::ACTION_COPY);
+ void drag_source_set(const std::vector<TargetEntry>& targets, Gdk::ModifierType start_button_mask = Gdk::MODIFIER_MASK, Gdk::DragAction actions = Gdk::ACTION_COPY);
_IGNORE(gtk_drag_source_set)
_WRAP_METHOD(void drag_source_unset(), gtk_drag_source_unset)
diff --git a/gtk/src/window.ccg b/gtk/src/window.ccg
index 18f68be..2dd3e91 100644
--- a/gtk/src/window.ccg
+++ b/gtk/src/window.ccg
@@ -20,6 +20,8 @@
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
+#include <glibmm/vectorutils.h>
+
#include <gtkmm/accelgroup.h>
#include <gdkmm/cursor.h>
#include <gtk/gtk.h>
diff --git a/gtk/src/window.hg b/gtk/src/window.hg
index 28434ef..84d121c 100644
--- a/gtk/src/window.hg
+++ b/gtk/src/window.hg
@@ -19,8 +19,9 @@
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
+#include <vector>
+
#include <glibmm/object.h>
-#include <glibmm/listhandle.h>
#include <gtkmm/bin.h>
#include <gtkmm/application.h>
@@ -218,10 +219,13 @@ dnl
_WRAP_METHOD(void set_deletable(bool setting = true), gtk_window_set_deletable)
_WRAP_METHOD(bool get_deletable() const, gtk_window_get_deletable)
- _WRAP_METHOD(Glib::ListHandle< Glib::RefPtr<Gdk::Pixbuf> > get_icon_list(), gtk_window_get_icon_list)
- _WRAP_METHOD(Glib::ListHandle< Glib::RefPtr<const Gdk::Pixbuf> > get_icon_list() const, gtk_window_get_icon_list)
+#m4 _CONVERSION(`GList*',`std::vector< Glib::RefPtr<Gdk::Pixbuf> >',`Glib::ListHandler< Glib::RefPtr<Gdk::Pixbuf> >::list_to_vector($3, Glib::OWNERSHIP_SHALLOW)')
+ _WRAP_METHOD(std::vector< Glib::RefPtr<Gdk::Pixbuf> > get_icon_list(), gtk_window_get_icon_list)
+#m4 _CONVERSION(`GList*',`std::vector< Glib::RefPtr<const Gdk::Pixbuf> >',`Glib::ListHandler< Glib::RefPtr<const Gdk::Pixbuf> >::list_to_vector($3, Glib::OWNERSHIP_SHALLOW)')
+ _WRAP_METHOD(std::vector< Glib::RefPtr<const Gdk::Pixbuf> > get_icon_list() const, gtk_window_get_icon_list)
- _WRAP_METHOD(void set_icon_list(const Glib::ListHandle< Glib::RefPtr<Gdk::Pixbuf> >& list),
+#m4 _CONVERSION(`const std::vector< Glib::RefPtr<Gdk::Pixbuf> >&',`GList*',`Glib::ListHandler< Glib::RefPtr<Gdk::Pixbuf> >::vector_to_list($3).data ()')
+ _WRAP_METHOD(void set_icon_list(const std::vector< Glib::RefPtr<Gdk::Pixbuf> >& list),
gtk_window_set_icon_list)
_WRAP_METHOD(void set_icon(const Glib::RefPtr<Gdk::Pixbuf>& icon),
@@ -237,10 +241,10 @@ dnl
_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),
+ const std::vector< Glib::RefPtr<Gdk::Pixbuf> >& list),
gtk_window_set_default_icon_list)
- _WRAP_METHOD(static Glib::ListHandle< Glib::RefPtr<Gdk::Pixbuf> > get_default_icon_list(), gtk_window_get_default_icon_list)
+ _WRAP_METHOD(static std::vector< Glib::RefPtr<Gdk::Pixbuf> > get_default_icon_list(), gtk_window_get_default_icon_list)
_WRAP_METHOD(static void set_default_icon(const Glib::RefPtr<Gdk::Pixbuf>& icon), gtk_window_set_default_icon)
_WRAP_METHOD(static void set_default_icon_name(const Glib::ustring& name), gtk_window_set_default_icon_name)
@@ -251,9 +255,8 @@ dnl
_WRAP_METHOD(bool get_modal() const, gtk_window_get_modal)
-
- _WRAP_METHOD(static Glib::ListHandle<Window*> list_toplevels(), gtk_window_list_toplevels)
-
+#m4 _CONVERSION(`GList*',`std::vector<Window*>',`Glib::ListHandler<Window*>::list_to_vector($3, Glib::OWNERSHIP_SHALLOW)')
+ _WRAP_METHOD(static std::vector<Window*> list_toplevels(), gtk_window_list_toplevels)
_WRAP_METHOD(void add_mnemonic(guint keyval, Widget& target),
gtk_window_add_mnemonic)
diff --git a/tests/refcount_dialog/main.cc b/tests/refcount_dialog/main.cc
index fab5ce9..410f107 100644
--- a/tests/refcount_dialog/main.cc
+++ b/tests/refcount_dialog/main.cc
@@ -42,9 +42,9 @@ void MyWindow::on_button_clicked()
std::cout << "After d.run()" << std::endl;
}
- std::cout << "before list_toplevel" << std::endl;
- std::list<Gtk::Window*> toplevelwindows = list_toplevels();
- std::cout << "after list_toplevel" << std::endl;
+ std::cout << "before list_toplevel" << std::endl;
+ std::vector<Gtk::Window*> toplevelwindows = list_toplevels();
+ std::cout << "after list_toplevel" << std::endl;
std::cout << "toplevelwindows.size = " << toplevelwindows.size() << std::endl;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]