[gtkmm: 2/10] Use char, int, float and double instead of g types
- From: Kjell Ahlstedt <kjellahl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtkmm: 2/10] Use char, int, float and double instead of g types
- Date: Fri, 31 Jul 2020 16:49:37 +0000 (UTC)
commit 371830272e876660c05f895d468ab6bd66a7df3d
Author: Andreas Persson <andreasp56 outlook com>
Date: Wed Jul 29 08:17:30 2020 +0200
Use char, int, float and double instead of g types
Adapt to Gtk change to use char*, int, float and double instead of
corresponding Glib types.
gtk/src/aboutdialog.hg | 4 ++--
gtk/src/actionable.hg | 2 +-
gtk/src/application.hg | 6 +++---
gtk/src/assistant.ccg | 4 ++--
gtk/src/buildable.ccg | 4 ++--
gtk/src/buildable.hg | 4 ++--
gtk/src/cellarea.ccg | 8 ++++----
gtk/src/cellrenderer.ccg | 8 ++++----
gtk/src/combobox.hg | 8 ++++----
gtk/src/editable.hg | 8 ++++----
gtk/src/entrybuffer.hg | 2 +-
gtk/src/entrycompletion.ccg | 2 +-
gtk/src/flowbox.ccg | 2 +-
gtk/src/gesturestylus.ccg | 4 ++--
gtk/src/icontheme.hg | 2 +-
gtk/src/iconview.hg | 4 ++--
gtk/src/listbox.ccg | 2 +-
gtk/src/padactionentry.hg | 20 ++++++++++----------
gtk/src/papersize.ccg | 8 ++++----
gtk/src/printsettings.ccg | 2 +-
gtk/src/recentmanager.ccg | 14 +++++++-------
gtk/src/scalebutton.hg | 2 +-
gtk/src/treemodelfilter.ccg | 2 +-
tools/m4/convert_gtk.m4 | 3 ++-
24 files changed, 63 insertions(+), 62 deletions(-)
---
diff --git a/gtk/src/aboutdialog.hg b/gtk/src/aboutdialog.hg
index dc69140d1..eb57d23b9 100644
--- a/gtk/src/aboutdialog.hg
+++ b/gtk/src/aboutdialog.hg
@@ -99,10 +99,10 @@ 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*
const*',`std::vector<Glib::ustring>',`Glib::ArrayHandler<Glib::ustring>::array_to_vector($3,
Glib::OWNERSHIP_NONE)')
+#m4 _CONVERSION(`const char*
const*',`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)
-#m4 _CONVERSION(`const std::vector<Glib::ustring>&',`const
gchar**',`Glib::ArrayHandler<Glib::ustring>::vector_to_array($3).data ()')
+#m4 _CONVERSION(`const std::vector<Glib::ustring>&',`const
char**',`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)
_WRAP_METHOD(std::vector<Glib::ustring> get_documenters() const, gtk_about_dialog_get_documenters)
diff --git a/gtk/src/actionable.hg b/gtk/src/actionable.hg
index 3772660ef..7c5a7630d 100644
--- a/gtk/src/actionable.hg
+++ b/gtk/src/actionable.hg
@@ -69,7 +69,7 @@ public:
_WRAP_PROPERTY("action-target", Glib::VariantBase)
protected:
-#m4 _CONVERSION(`Glib::ustring',`const gchar*',`$3.empty() ? nullptr : $3.c_str()')
+#m4 _CONVERSION(`Glib::ustring',`const char*',`$3.empty() ? nullptr : $3.c_str()')
_WRAP_VFUNC(Glib::ustring get_action_name() const, "get_action_name", keep_return)
_WRAP_VFUNC(void set_action_name(const Glib::ustring& action_name), "set_action_name")
diff --git a/gtk/src/application.hg b/gtk/src/application.hg
index 769e2a642..9a50a245a 100644
--- a/gtk/src/application.hg
+++ b/gtk/src/application.hg
@@ -248,15 +248,15 @@ public:
_WRAP_METHOD(Window* get_active_window(), gtk_application_get_active_window, refreturn)
_WRAP_METHOD(const Window* get_active_window() const, gtk_application_get_active_window, refreturn,
constversion)
-#m4
_CONVERSION(`gchar**',`std::vector<Glib::ustring>',`Glib::ArrayHandler<Glib::ustring>::array_to_vector($3,
Glib::OWNERSHIP_DEEP)')
+#m4
_CONVERSION(`char**',`std::vector<Glib::ustring>',`Glib::ArrayHandler<Glib::ustring>::array_to_vector($3,
Glib::OWNERSHIP_DEEP)')
_WRAP_METHOD(std::vector<Glib::ustring> list_action_descriptions() const,
gtk_application_list_action_descriptions)
-#m4
_CONVERSION(`gchar**',`std::vector<Glib::ustring>',`Glib::ArrayHandler<Glib::ustring>::array_to_vector($3,
Glib::OWNERSHIP_DEEP)')
+#m4
_CONVERSION(`char**',`std::vector<Glib::ustring>',`Glib::ArrayHandler<Glib::ustring>::array_to_vector($3,
Glib::OWNERSHIP_DEEP)')
_WRAP_METHOD(std::vector<Glib::ustring> get_accels_for_action(const Glib::ustring& detailed_action_name)
const, gtk_application_get_accels_for_action)
_WRAP_METHOD(std::vector<Glib::ustring> get_actions_for_accel(const Glib::ustring& accel) const,
gtk_application_get_actions_for_accel)
-#m4 _CONVERSION(`const std::vector<Glib::ustring>&',`const
gchar*-const*',`Glib::ArrayHandler<Glib::ustring>::vector_to_array($3).data ()')
+#m4 _CONVERSION(`const std::vector<Glib::ustring>&',`const
char*-const*',`Glib::ArrayHandler<Glib::ustring>::vector_to_array($3).data ()')
_WRAP_METHOD(void set_accels_for_action(const Glib::ustring& detailed_action_name, const
std::vector<Glib::ustring>& accels), gtk_application_set_accels_for_action)
/** Sets a keyboard accelerator that will trigger the
diff --git a/gtk/src/assistant.ccg b/gtk/src/assistant.ccg
index 543158145..ca898ae62 100644
--- a/gtk/src/assistant.ccg
+++ b/gtk/src/assistant.ccg
@@ -18,7 +18,7 @@
#include <gtk/gtk.h>
-static gint SignalProxy_SlotForwardPage_gtk_callback(gint current_page, gpointer data)
+static int SignalProxy_SlotForwardPage_gtk_callback(int current_page, gpointer data)
{
auto the_slot = static_cast<Gtk::Assistant::SlotForwardPage*>(data);
@@ -29,7 +29,7 @@ static gint SignalProxy_SlotForwardPage_gtk_callback(gint current_page, gpointer
catch(...)
{
Glib::exception_handlers_invoke();
- return gint();
+ return int();
}
}
diff --git a/gtk/src/buildable.ccg b/gtk/src/buildable.ccg
index d1756cc09..ad18e859e 100644
--- a/gtk/src/buildable.ccg
+++ b/gtk/src/buildable.ccg
@@ -27,7 +27,7 @@ gboolean Buildable_Class::custom_tag_start_vfunc_callback(
GtkBuildable* buildable,
GtkBuilder* builder,
GObject* child,
- const gchar* tagname,
+ const char* tagname,
GtkBuildableParser* parser,
gpointer* data)
{
@@ -60,7 +60,7 @@ void Buildable_Class::custom_tag_end_vfunc_callback(
GtkBuildable* buildable,
GtkBuilder* builder,
GObject* child,
- const gchar* tagname,
+ const char* tagname,
gpointer data)
{
const auto base = static_cast<BaseClassType*>(
diff --git a/gtk/src/buildable.hg b/gtk/src/buildable.hg
index ce3aceea5..f7f278c8f 100644
--- a/gtk/src/buildable.hg
+++ b/gtk/src/buildable.hg
@@ -101,14 +101,14 @@ dnl
GtkBuildable* buildable,
GtkBuilder* builder,
GObject* child,
- const gchar* tagname,
+ const char* tagname,
GtkBuildableParser* parser,
gpointer* data);
static void custom_tag_end_vfunc_callback(
GtkBuildable* buildable,
GtkBuilder* builder,
GObject* child,
- const gchar* tagname,
+ const char* tagname,
gpointer data);
_POP()
#m4end
diff --git a/gtk/src/cellarea.ccg b/gtk/src/cellarea.ccg
index 68966a836..3fd2621cc 100644
--- a/gtk/src/cellarea.ccg
+++ b/gtk/src/cellarea.ccg
@@ -79,7 +79,7 @@ void CellArea::foreach(const Glib::RefPtr<CellAreaContext>& context, Widget* wid
//These vfunc callbacks are custom implemented because we want the output
//arguments of the C++ vfuncs to be int& (not int*), and the vfunc_callback
//functions may be called from gtk+ with a NULL pointer.
-void CellArea_Class::get_preferred_width_vfunc_callback(GtkCellArea* self, GtkCellAreaContext* context,
GtkWidget* widget, gint* minimum_width, gint* natural_width)
+void CellArea_Class::get_preferred_width_vfunc_callback(GtkCellArea* self, GtkCellAreaContext* context,
GtkWidget* widget, int* minimum_width, int* natural_width)
{
const auto obj_base = static_cast<Glib::ObjectBase*>(
Glib::ObjectBase::_get_current_wrapper((GObject*)self));
@@ -121,7 +121,7 @@ void CellArea_Class::get_preferred_width_vfunc_callback(GtkCellArea* self, GtkCe
(*base->get_preferred_width)(self, context, widget, minimum_width, natural_width);
}
-void CellArea_Class::get_preferred_height_for_width_vfunc_callback(GtkCellArea* self, GtkCellAreaContext*
context, GtkWidget* widget, gint width, gint* minimum_height, gint* natural_height)
+void CellArea_Class::get_preferred_height_for_width_vfunc_callback(GtkCellArea* self, GtkCellAreaContext*
context, GtkWidget* widget, int width, int* minimum_height, int* natural_height)
{
const auto obj_base = static_cast<Glib::ObjectBase*>(
Glib::ObjectBase::_get_current_wrapper((GObject*)self));
@@ -163,7 +163,7 @@ void CellArea_Class::get_preferred_height_for_width_vfunc_callback(GtkCellArea*
(*base->get_preferred_height_for_width)(self, context, widget, width, minimum_height, natural_height);
}
-void CellArea_Class::get_preferred_height_vfunc_callback(GtkCellArea* self, GtkCellAreaContext* context,
GtkWidget* widget, gint* minimum_height, gint* natural_height)
+void CellArea_Class::get_preferred_height_vfunc_callback(GtkCellArea* self, GtkCellAreaContext* context,
GtkWidget* widget, int* minimum_height, int* natural_height)
{
const auto obj_base = static_cast<Glib::ObjectBase*>(
Glib::ObjectBase::_get_current_wrapper((GObject*)self));
@@ -205,7 +205,7 @@ void CellArea_Class::get_preferred_height_vfunc_callback(GtkCellArea* self, GtkC
(*base->get_preferred_height)(self, context, widget, minimum_height, natural_height);
}
-void CellArea_Class::get_preferred_width_for_height_vfunc_callback(GtkCellArea* self, GtkCellAreaContext*
context, GtkWidget* widget, gint height, gint* minimum_width, gint* natural_width)
+void CellArea_Class::get_preferred_width_for_height_vfunc_callback(GtkCellArea* self, GtkCellAreaContext*
context, GtkWidget* widget, int height, int* minimum_width, int* natural_width)
{
const auto obj_base = static_cast<Glib::ObjectBase*>(
Glib::ObjectBase::_get_current_wrapper((GObject*)self));
diff --git a/gtk/src/cellrenderer.ccg b/gtk/src/cellrenderer.ccg
index dd3d01faa..0fc5942a2 100644
--- a/gtk/src/cellrenderer.ccg
+++ b/gtk/src/cellrenderer.ccg
@@ -40,7 +40,7 @@ Glib::PropertyProxy_Base CellRenderer::_property_renderable()
//These vfunc callbacks are custom implemented because we want the output
//arguments of the C++ vfuncs to be int& (not int*), and the vfunc_callback
//functions may be called from gtk+ with a NULL pointer.
-void CellRenderer_Class::get_preferred_width_vfunc_callback(GtkCellRenderer* self, GtkWidget* widget, gint*
minimum_width, gint* natural_width)
+void CellRenderer_Class::get_preferred_width_vfunc_callback(GtkCellRenderer* self, GtkWidget* widget, int*
minimum_width, int* natural_width)
{
const auto obj_base = static_cast<Glib::ObjectBase*>(
Glib::ObjectBase::_get_current_wrapper((GObject*)self));
@@ -81,7 +81,7 @@ void CellRenderer_Class::get_preferred_width_vfunc_callback(GtkCellRenderer* sel
(*base->get_preferred_width)(self, widget, minimum_width, natural_width);
}
-void CellRenderer_Class::get_preferred_height_for_width_vfunc_callback(GtkCellRenderer* self, GtkWidget*
widget, gint width, gint* minimum_height, gint* natural_height)
+void CellRenderer_Class::get_preferred_height_for_width_vfunc_callback(GtkCellRenderer* self, GtkWidget*
widget, int width, int* minimum_height, int* natural_height)
{
const auto obj_base = static_cast<Glib::ObjectBase*>(
Glib::ObjectBase::_get_current_wrapper((GObject*)self));
@@ -122,7 +122,7 @@ void CellRenderer_Class::get_preferred_height_for_width_vfunc_callback(GtkCellRe
(*base->get_preferred_height_for_width)(self, widget, width, minimum_height, natural_height);
}
-void CellRenderer_Class::get_preferred_height_vfunc_callback(GtkCellRenderer* self, GtkWidget* widget, gint*
minimum_height, gint* natural_height)
+void CellRenderer_Class::get_preferred_height_vfunc_callback(GtkCellRenderer* self, GtkWidget* widget, int*
minimum_height, int* natural_height)
{
const auto obj_base = static_cast<Glib::ObjectBase*>(
Glib::ObjectBase::_get_current_wrapper((GObject*)self));
@@ -163,7 +163,7 @@ void CellRenderer_Class::get_preferred_height_vfunc_callback(GtkCellRenderer* se
(*base->get_preferred_height)(self, widget, minimum_height, natural_height);
}
-void CellRenderer_Class::get_preferred_width_for_height_vfunc_callback(GtkCellRenderer* self, GtkWidget*
widget, gint height, gint* minimum_width, gint* natural_width)
+void CellRenderer_Class::get_preferred_width_for_height_vfunc_callback(GtkCellRenderer* self, GtkWidget*
widget, int height, int* minimum_width, int* natural_width)
{
const auto obj_base = static_cast<Glib::ObjectBase*>(
Glib::ObjectBase::_get_current_wrapper((GObject*)self));
diff --git a/gtk/src/combobox.hg b/gtk/src/combobox.hg
index 63b7f5966..6d0c9e431 100644
--- a/gtk/src/combobox.hg
+++ b/gtk/src/combobox.hg
@@ -214,10 +214,10 @@ dnl// (which is obviously not a const gchar*)
dnl// Also, ensure that format_entry_text never returns an empty char[],
dnl// because that could be caused by an intermediate empty ustring from an initial null char*.
dnl// See bug http://bugzilla.gnome.org/show_bug.cgi?id=168747.
- _CONVERSION(`Glib::ustring',`gchar*',`g_strdup(Glib::c_str_or_nullptr($3))')
- _CONVERSION(`gchar*',`Glib::ustring',`Glib::convert_return_gchar_ptr_to_ustring($3)')
- _CONVERSION(`const gchar*',`const TreeModel::Path&',`TreeModel::Path($3)')
- _CONVERSION(`const TreeModel::Path&',`const gchar*',`($3).to_string().c_str()')
+ _CONVERSION(`Glib::ustring',`char*',`g_strdup(Glib::c_str_or_nullptr($3))')
+ _CONVERSION(`char*',`Glib::ustring',`Glib::convert_return_gchar_ptr_to_ustring($3)')
+ _CONVERSION(`const char*',`const TreeModel::Path&',`TreeModel::Path($3)')
+ _CONVERSION(`const TreeModel::Path&',`const char*',`($3).to_string().c_str()')
#m4end
_WRAP_SIGNAL(Glib::ustring format_entry_text(const TreeModel::Path& path), "format-entry-text")
diff --git a/gtk/src/editable.hg b/gtk/src/editable.hg
index 9dc4a5ed4..2936173e3 100644
--- a/gtk/src/editable.hg
+++ b/gtk/src/editable.hg
@@ -84,10 +84,10 @@ public:
#m4begin
dnl // WRAP_SIGNAL "insert_text"
dnl // C++ prototype: void insert_text(const Glib::ustring& text, int* position)
-dnl // C prototype: void insert_text(const gchar* text, int length, int* position)
+dnl // C prototype: void insert_text(const char* text, int length, int* position)
_SIGNAL_PROXY(
- insert_text, void, `const gchar* text, int length, int* position',
+ insert_text, void, `const char* text, int length, int* position',
insert_text, void, `const Glib::ustring&, int*',dnl // C++ prototype
`Glib::ustring(text, text + length), position',`dnl // C -> C++ conversion
/**
@@ -97,7 +97,7 @@ dnl // C prototype: void insert_text(const gchar* text, int length, int* positio
*/')
_SIGNAL_H(insert_text, void, `const Glib::ustring& text, int* position')
- _SIGNAL_PH(insert_text, void, `GtkEditable* self, const gchar* text, int length, int* position')
+ _SIGNAL_PH(insert_text, void, `GtkEditable* self, const char* text, int length, int* position')
_SIGNAL_CC(
insert_text, insert_text, void, void,
@@ -106,7 +106,7 @@ dnl // C prototype: void insert_text(const gchar* text, int length, int* positio
_SIGNAL_PCC(
insert_text, insert_text, void, void,
- `GtkEditable* self, const gchar* text, int length, int* position',dnl // C arguments
+ `GtkEditable* self, const char* text, int length, int* position',dnl // C arguments
`self, text, length, position',dnl // C argument names
`Glib::ustring(text, text + length), position',dnl // C -> C++ conversion
self)
diff --git a/gtk/src/entrybuffer.hg b/gtk/src/entrybuffer.hg
index 3466bec47..f3099a371 100644
--- a/gtk/src/entrybuffer.hg
+++ b/gtk/src/entrybuffer.hg
@@ -105,7 +105,7 @@ public:
_WRAP_METHOD(void emit_deleted_text(guint position, guint n_chars), gtk_entry_buffer_emit_deleted_text)
- _WRAP_SIGNAL(void inserted_text(guint position, const gchar* chars, guint n_chars), "inserted-text")
+ _WRAP_SIGNAL(void inserted_text(guint position, const char* chars, guint n_chars), "inserted-text")
_WRAP_SIGNAL(void deleted_text(guint position, guint n_chars), "deleted-text")
_WRAP_PROPERTY("text", Glib::ustring)
diff --git a/gtk/src/entrycompletion.ccg b/gtk/src/entrycompletion.ccg
index 1c16a9b36..6f298fcec 100644
--- a/gtk/src/entrycompletion.ccg
+++ b/gtk/src/entrycompletion.ccg
@@ -21,7 +21,7 @@
#include <gtk/gtk.h>
-static gboolean SignalProxy_Match_gtk_callback(GtkEntryCompletion* completion, const gchar* key,
GtkTreeIter* iter, gpointer user_data)
+static gboolean SignalProxy_Match_gtk_callback(GtkEntryCompletion* completion, const char* key, GtkTreeIter*
iter, gpointer user_data)
{
auto the_slot = static_cast<Gtk::EntryCompletion::SlotMatch*>(user_data);
diff --git a/gtk/src/flowbox.ccg b/gtk/src/flowbox.ccg
index d24a6422b..4b5f31d7f 100644
--- a/gtk/src/flowbox.ccg
+++ b/gtk/src/flowbox.ccg
@@ -54,7 +54,7 @@ static void SignalProxy_Filter_gtk_callback_destroy(void* data)
delete static_cast<Gtk::FlowBox::SlotFilter*>(data);
}
-static gint SignalProxy_Sort_gtk_callback(GtkFlowBoxChild* child1, GtkFlowBoxChild* child2, void* data)
+static int SignalProxy_Sort_gtk_callback(GtkFlowBoxChild* child1, GtkFlowBoxChild* child2, void* data)
{
auto the_slot = static_cast<Gtk::FlowBox::SlotSort*>(data);
diff --git a/gtk/src/gesturestylus.ccg b/gtk/src/gesturestylus.ccg
index 007d19db2..979f22b47 100644
--- a/gtk/src/gesturestylus.ccg
+++ b/gtk/src/gesturestylus.ccg
@@ -23,7 +23,7 @@ namespace Gtk
std::optional<double> GestureStylus::get_axis(Gdk::AxisUse axis) const
{
- gdouble g_value = gdouble();
+ double g_value = double();
auto retvalue = gtk_gesture_stylus_get_axis(
const_cast<GtkGestureStylus*>(gobj()), static_cast<GdkAxisUse>(axis), &g_value);
@@ -43,7 +43,7 @@ std::vector<double> GestureStylus::get_axes(const std::vector<Gdk::AxisUse>& axe
g_axes[i] = static_cast<GdkAxisUse>(axes[i]);
g_axes[axes.size()] = GDK_AXIS_IGNORE;
- gdouble* g_values = nullptr;
+ double* g_values = nullptr;
const bool result = gtk_gesture_stylus_get_axes(
const_cast<GtkGestureStylus*>(gobj()), g_axes.get(), &g_values);
diff --git a/gtk/src/icontheme.hg b/gtk/src/icontheme.hg
index 007fcc739..49aed7855 100644
--- a/gtk/src/icontheme.hg
+++ b/gtk/src/icontheme.hg
@@ -85,7 +85,7 @@ public:
#m4 _CONVERSION(`int*',`std::vector<int>',`Glib::ArrayHandler<int>::array_to_vector($3,
Glib::OWNERSHIP_SHALLOW)')
_WRAP_METHOD(std::vector<int> get_icon_sizes(const Glib::ustring& icon_name) const,
gtk_icon_theme_get_icon_sizes)
-#m4 _CONVERSION(`const std::vector<Glib::ustring>&',`const char*[]',`const_cast<const
gchar**>(Glib::ArrayHandler<Glib::ustring>::vector_to_array($3).data())')
+#m4 _CONVERSION(`const std::vector<Glib::ustring>&',`const char*[]',`const_cast<const
char**>(Glib::ArrayHandler<Glib::ustring>::vector_to_array($3).data())')
_WRAP_METHOD(Glib::RefPtr<IconPaintable> lookup_icon(const Glib::ustring& icon_name,
const std::vector<Glib::ustring>& fallbacks{?}, int size, int scale = 1, TextDirection direction =
TextDirection::NONE,
IconLookupFlags flags = (IconLookupFlags)0), gtk_icon_theme_lookup_icon)
diff --git a/gtk/src/iconview.hg b/gtk/src/iconview.hg
index ba470ac98..530736763 100644
--- a/gtk/src/iconview.hg
+++ b/gtk/src/iconview.hg
@@ -91,7 +91,7 @@ public:
_WRAP_METHOD(void set_spacing(int spacing), gtk_icon_view_set_spacing)
_WRAP_METHOD(int get_spacing() const, gtk_icon_view_get_spacing)
_WRAP_METHOD(void set_row_spacing(int row_spacing), gtk_icon_view_set_row_spacing)
- _WRAP_METHOD(gint get_row_spacing() const, gtk_icon_view_get_row_spacing)
+ _WRAP_METHOD(int get_row_spacing() const, gtk_icon_view_get_row_spacing)
_WRAP_METHOD(void set_column_spacing(int column_spacing), gtk_icon_view_set_column_spacing)
_WRAP_METHOD(int get_column_spacing() const, gtk_icon_view_get_column_spacing)
@@ -219,7 +219,7 @@ public:
bool get_cursor(CellRenderer*& cell) const;
_IGNORE(gtk_icon_view_get_cursor)
- _WRAP_METHOD(void scroll_to_path(const TreeModel::Path& path, bool use_align, gfloat row_align, gfloat
col_align), gtk_icon_view_scroll_to_path)
+ _WRAP_METHOD(void scroll_to_path(const TreeModel::Path& path, bool use_align, float row_align, float
col_align), gtk_icon_view_scroll_to_path)
/* Drag-and-Drop support */
// Gdk::ContentFormats is an immutable object. It can be declared const
diff --git a/gtk/src/listbox.ccg b/gtk/src/listbox.ccg
index c68734d7b..cf6e141d9 100644
--- a/gtk/src/listbox.ccg
+++ b/gtk/src/listbox.ccg
@@ -40,7 +40,7 @@ void SignalProxy_Filter_gtk_callback_destroy(void* data)
delete static_cast<Gtk::ListBox::SlotFilter*>(data);
}
-gint SignalProxy_Sort_gtk_callback(GtkListBoxRow* row1, GtkListBoxRow* row2, void* data)
+int SignalProxy_Sort_gtk_callback(GtkListBoxRow* row1, GtkListBoxRow* row2, void* data)
{
auto the_slot = static_cast<Gtk::ListBox::SlotSort*>(data);
diff --git a/gtk/src/padactionentry.hg b/gtk/src/padactionentry.hg
index f0e65f975..ad6a7c26c 100644
--- a/gtk/src/padactionentry.hg
+++ b/gtk/src/padactionentry.hg
@@ -63,19 +63,19 @@ public:
_MEMBER_GET(type, type, PadActionType, GtkPadActionType)
_MEMBER_SET(type, type, PadActionType, GtkPadActionType)
- _MEMBER_GET(index, index, int, gint)
- _MEMBER_SET(index, index, int, gint)
+ _MEMBER_GET(index, index, int, int)
+ _MEMBER_SET(index, index, int, int)
- _MEMBER_GET(mode, mode, int, gint)
- _MEMBER_SET(mode, mode, int, gint)
+ _MEMBER_GET(mode, mode, int, int)
+ _MEMBER_SET(mode, mode, int, int)
-#m4 _CONVERSION(`gchar*',`Glib::ustring',`Glib::convert_const_gchar_ptr_to_ustring($3)')
-#m4 _CONVERSION(`Glib::ustring',`gchar*',`($3).c_str()')
- _MEMBER_GET(label, label, Glib::ustring, gchar*)
- _MEMBER_SET_STR(label, label, Glib::ustring, gchar*)
+#m4 _CONVERSION(`const char*',`Glib::ustring',`Glib::convert_const_gchar_ptr_to_ustring($3)')
+#m4 _CONVERSION(`Glib::ustring',`const char*',`($3).c_str()')
+ _MEMBER_GET(label, label, Glib::ustring, const char*)
+ _MEMBER_SET_STR(label, label, Glib::ustring, const char*)
- _MEMBER_GET(action_name, action_name, Glib::ustring, gchar*)
- _MEMBER_SET_STR(action_name, action_name, Glib::ustring, gchar*)
+ _MEMBER_GET(action_name, action_name, Glib::ustring, const char*)
+ _MEMBER_SET_STR(action_name, action_name, Glib::ustring, const char*)
GtkPadActionEntry* gobj() { return gobject_; }
const GtkPadActionEntry* gobj() const { return gobject_; }
diff --git a/gtk/src/papersize.ccg b/gtk/src/papersize.ccg
index c6f38aff8..38b26a2ed 100644
--- a/gtk/src/papersize.ccg
+++ b/gtk/src/papersize.ccg
@@ -44,16 +44,16 @@ PaperSize::PaperSize(const Glib::ustring& ppd_name, const Glib::ustring& ppd_dis
:
gobject_(gtk_paper_size_new_from_ppd(ppd_name.c_str(),
ppd_display_name.c_str(),
- gdouble(width),
- gdouble(height)))
+ width,
+ height))
{}
PaperSize::PaperSize(const Glib::ustring& name, const Glib::ustring& display_name, double width, double
height, Unit unit)
:
gobject_(gtk_paper_size_new_custom(name.c_str(),
display_name.c_str(),
- gdouble(width),
- gdouble(height),
+ width,
+ height,
GtkUnit(unit)))
{}
diff --git a/gtk/src/printsettings.ccg b/gtk/src/printsettings.ccg
index 94f68ec3d..cc0101356 100644
--- a/gtk/src/printsettings.ccg
+++ b/gtk/src/printsettings.ccg
@@ -23,7 +23,7 @@
namespace // anonymous
{
-static void proxy_foreach_callback(const gchar* key, const gchar* value, void* data)
+static void proxy_foreach_callback(const char* key, const char* value, void* data)
{
typedef Gtk::PrintSettings::SlotForeach SlotType;
auto& slot = *static_cast<SlotType*>(data);
diff --git a/gtk/src/recentmanager.ccg b/gtk/src/recentmanager.ccg
index 0cc37baad..cefdceda1 100644
--- a/gtk/src/recentmanager.ccg
+++ b/gtk/src/recentmanager.ccg
@@ -28,15 +28,15 @@ bool RecentManager::add_item(const Glib::ustring& uri, const Data& data)
gboolean result;
// I wonder whether these should be const in the GTK+ API. armin.
- c_data.display_name = data.display_name.empty() ? nullptr : const_cast<gchar*>(data.display_name.c_str());
- c_data.description = const_cast<gchar*>(data.description.c_str());
- c_data.mime_type = const_cast<gchar*>(data.mime_type.c_str());
- c_data.app_name = const_cast<gchar*>(data.app_name.c_str());
- c_data.app_exec = const_cast<gchar*>(data.app_exec.c_str());
+ c_data.display_name = data.display_name.empty() ? nullptr : const_cast<char*>(data.display_name.c_str());
+ c_data.description = const_cast<char*>(data.description.c_str());
+ c_data.mime_type = const_cast<char*>(data.mime_type.c_str());
+ c_data.app_name = const_cast<char*>(data.app_name.c_str());
+ c_data.app_exec = const_cast<char*>(data.app_exec.c_str());
- c_data.groups = static_cast<gchar**>(g_malloc((data.groups.size() + 1) * sizeof(gchar*)));
+ c_data.groups = static_cast<char**>(g_malloc((data.groups.size() + 1) * sizeof(char*)));
for(unsigned int i = 0; i < data.groups.size(); ++ i)
- c_data.groups[i] = const_cast<gchar*>(data.groups[i].c_str());
+ c_data.groups[i] = const_cast<char*>(data.groups[i].c_str());
c_data.groups[data.groups.size()] = nullptr;
c_data.is_private = data.is_private;
diff --git a/gtk/src/scalebutton.hg b/gtk/src/scalebutton.hg
index 4e968e412..e009d4167 100644
--- a/gtk/src/scalebutton.hg
+++ b/gtk/src/scalebutton.hg
@@ -69,7 +69,7 @@ public:
*/
explicit ScaleButton(double min, double max, double step);
-#m4 _CONVERSION(`const std::vector<Glib::ustring>&',`const
gchar**',`Glib::ArrayHandler<Glib::ustring>::vector_to_array($3).data ()')
+#m4 _CONVERSION(`const std::vector<Glib::ustring>&',`const
char**',`Glib::ArrayHandler<Glib::ustring>::vector_to_array($3).data ()')
_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)
diff --git a/gtk/src/treemodelfilter.ccg b/gtk/src/treemodelfilter.ccg
index e83f1c2c9..18e7b879d 100644
--- a/gtk/src/treemodelfilter.ccg
+++ b/gtk/src/treemodelfilter.ccg
@@ -41,7 +41,7 @@ static void SignalProxy_Visible_gtk_callback_destroy(void* data)
}
-static void SignalProxy_Modify_gtk_callback(GtkTreeModel* model, GtkTreeIter* iter, GValue* value, gint
column, gpointer data)
+static void SignalProxy_Modify_gtk_callback(GtkTreeModel* model, GtkTreeIter* iter, GValue* value, int
column, gpointer data)
{
auto the_slot = static_cast<Gtk::TreeModelFilter::SlotModify*>(data);
diff --git a/tools/m4/convert_gtk.m4 b/tools/m4/convert_gtk.m4
index 6ac2f8168..08464bfc5 100644
--- a/tools/m4/convert_gtk.m4
+++ b/tools/m4/convert_gtk.m4
@@ -20,7 +20,8 @@ include(convert_glib.m4)
#
# Basic Types
-_CONVERSION(`gdouble*',`double&',`*($3)')
+_CONVERSION(`double*',`double&',`*($3)')
+_CONVERSION(`float&',`float*',`&($3)')
_CONVERSION(`time_t&',`time_t*',`&($3)')
_CONVERSION(`time_t',`std::time_t',`$3')
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]