[gtkmm] Gtk::CssProvider, Menu, StyleContext: Remove some methods
- From: Kjell Ahlstedt <kjellahl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtkmm] Gtk::CssProvider, Menu, StyleContext: Remove some methods
- Date: Mon, 30 Jul 2018 17:07:04 +0000 (UTC)
commit 0c372aa787a80c2c531d8606efd922f15a85f9ae
Author: Kjell Ahlstedt <kjellahlstedt gmail com>
Date: Mon Jul 30 19:04:18 2018 +0200
Gtk::CssProvider, Menu, StyleContext: Remove some methods
The corresponding gtk+ methods have been removed.
* gdk/src/contentformats.hg:
* gdk/src/contentprovider.hg:
* gtk/src/selectiondata.hg:
* gtk/src/widget.hg: Fix comments
* gtk/src/cssprovider.hg: Remove get_default()
* gtk/src/menu.[ccg|hg]: Remove 3 popup() overloads
* gtk/src/stylecontext.hg: Remove render_frame_gap()
gdk/src/contentformats.hg | 2 +-
gdk/src/contentprovider.hg | 2 +-
gtk/src/cssprovider.hg | 2 --
gtk/src/menu.ccg | 68 ----------------------------------------------
gtk/src/menu.hg | 37 +------------------------
gtk/src/selectiondata.hg | 2 +-
gtk/src/stylecontext.hg | 1 -
gtk/src/widget.hg | 8 +++---
8 files changed, 8 insertions(+), 114 deletions(-)
---
diff --git a/gdk/src/contentformats.hg b/gdk/src/contentformats.hg
index d4b832c7..0fb85169 100644
--- a/gdk/src/contentformats.hg
+++ b/gdk/src/contentformats.hg
@@ -56,7 +56,7 @@ namespace Gdk
* the types it represents. Instead, new %Gdk::ContentFormats have to be created.
* Gdk::ContentFormatsBuilder is meant to help in this endeavor.
*
- * @see Gdk::Drag, Gdk::Drop, Gtk::Clipboard
+ * @see Gdk::Drag, Gdk::Drop, Gdk::Clipboard
*
* @newin{3,94}
*/
diff --git a/gdk/src/contentprovider.hg b/gdk/src/contentprovider.hg
index ea7024b5..b758ad2e 100644
--- a/gdk/src/contentprovider.hg
+++ b/gdk/src/contentprovider.hg
@@ -36,7 +36,7 @@ namespace Gdk
* Gdk::ContentSerializer and Gdk::ContentDeserializer if you want to add support
* for application-specific data formats.
*
- * @See Gdk::ContentSerializer, Gdk::ContentDeserializer
+ * @see Gdk::ContentSerializer, Gdk::ContentDeserializer
*
* @newin{3,94}
*/
diff --git a/gtk/src/cssprovider.hg b/gtk/src/cssprovider.hg
index 9d956f39..b335c8dd 100644
--- a/gtk/src/cssprovider.hg
+++ b/gtk/src/cssprovider.hg
@@ -69,8 +69,6 @@ public:
_WRAP_METHOD(void load_from_path(const std::string& path), gtk_css_provider_load_from_path)
_WRAP_METHOD(void load_from_resource(const std::string& resource_path),
gtk_css_provider_load_from_resource)
- _WRAP_METHOD(static Glib::RefPtr<CssProvider> get_default(), gtk_css_provider_get_default, refreturn)
-
_WRAP_METHOD(static Glib::RefPtr<CssProvider> get_named(const Glib::ustring& name, const Glib::ustring&
variant), gtk_css_provider_get_named, refreturn)
#m4 _CONVERSION(`GtkCssSection*',`const Glib::RefPtr<const CssSection>&',`Glib::wrap($3, true)')
diff --git a/gtk/src/menu.ccg b/gtk/src/menu.ccg
index 93a5fd24..22ec7d7a 100644
--- a/gtk/src/menu.ccg
+++ b/gtk/src/menu.ccg
@@ -18,37 +18,6 @@
#include <gtk/gtk.h>
#include <gtkmm/accelgroup.h>
-
-static void SignalProxy_PopupPosition_gtk_callback(GtkMenu*, int* x, int* y, gboolean* push_in, void* data)
-{
- auto the_slot = static_cast<Gtk::Menu::SlotPositionCalc*>(data);
-
- int temp_x = (x) ? *x : 0;
- int temp_y = (y) ? *y : 0;
- bool temp_push_in = (push_in) ? bool(*push_in) : false;
-
- try
- {
- (*the_slot)(temp_x, temp_y, temp_push_in);
- }
- catch(...)
- {
- Glib::exception_handlers_invoke();
- }
-
- if(x) *x = temp_x;
- if(y) *y = temp_y;
- if(push_in) *push_in = temp_push_in;
-}
-
-static void SignalProxy_PopupPosition_gtk_callback_destroy(void* data)
-{
- auto the_slot = static_cast<Gtk::Menu::SlotPositionCalc*>(data);
- delete the_slot;
-}
-
-
-
namespace Gtk
{
@@ -61,42 +30,6 @@ Menu::Menu(const Glib::RefPtr<Gio::MenuModel>& model)
bind_model(model, true);
}
-void Menu::popup(const SlotPositionCalc& position_calc_slot, guint button, guint32 activate_time, const
Glib::RefPtr<Gdk::Device>& device)
-{
- // Tell GTK+ to call the static function with the slot's address as the extra
- // data, so that the static function can then call the sigc::slot:
- if(!device)
- gtk_menu_popup(gobj(), nullptr, nullptr, &SignalProxy_PopupPosition_gtk_callback,
const_cast<SlotPositionCalc*>(&position_calc_slot), button, activate_time);
- else
- {
- auto slot_copy = new SlotPositionCalc(position_calc_slot); //Deleted in the destroy callback.
-
- gtk_menu_popup_for_device(gobj(), device->gobj(), nullptr, nullptr,
&SignalProxy_PopupPosition_gtk_callback, slot_copy, &SignalProxy_PopupPosition_gtk_callback_destroy, button,
activate_time);
- }
-}
-
-void Menu::popup(MenuShell& parent_menu_shell, MenuItem& parent_menu_item, const SlotPositionCalc&
position_calc_slot, guint button, guint32 activate_time, const Glib::RefPtr<Gdk::Device>& device)
-{
- // Tell GTK+ to call the static function with the slot's address as the extra
- // data, so that the static function can then call the sigc::slot:
- if(!device)
- gtk_menu_popup(gobj(), parent_menu_shell.Gtk::Widget::gobj(), parent_menu_item.Gtk::Widget::gobj(),
&SignalProxy_PopupPosition_gtk_callback, const_cast<SlotPositionCalc*>(&position_calc_slot), button,
activate_time);
- else
- {
- auto slot_copy = new SlotPositionCalc(position_calc_slot); //Deleted in the destroy callback.
-
- gtk_menu_popup_for_device(gobj(), device->gobj(), parent_menu_shell.Gtk::Widget::gobj(),
parent_menu_item.Gtk::Widget::gobj(), &SignalProxy_PopupPosition_gtk_callback, slot_copy,
&SignalProxy_PopupPosition_gtk_callback_destroy, button, activate_time);
- }
-}
-
-void Menu::popup(guint button, guint32 activate_time, const Glib::RefPtr<Gdk::Device>& device)
-{
- if(!device)
- gtk_menu_popup(gobj(), nullptr, nullptr, nullptr, nullptr, button, activate_time);
- else
- gtk_menu_popup_for_device(gobj(), device->gobj(), nullptr, nullptr, nullptr, nullptr, nullptr, button,
activate_time);
-}
-
void Menu::reorder_child(const MenuItem& child, int position)
{
gtk_menu_reorder_child(
@@ -115,5 +48,4 @@ void Menu::attach_to_widget(Widget& attach_widget)
gtk_menu_attach_to_widget(gobj(), (attach_widget).gobj(), nullptr /* allowed by the C docs. */);
}
-
} // namespace Gtk
diff --git a/gtk/src/menu.hg b/gtk/src/menu.hg
index 54bad0f3..d0b84c45 100644
--- a/gtk/src/menu.hg
+++ b/gtk/src/menu.hg
@@ -33,7 +33,7 @@ class AccelGroup;
/** A drop-down menu consisting of Gtk::MenuItem objects which can be navigated and activated by the user to
perform application functions.
* Menus are normally placed inside a Gtk::MenuBar or another MenuItem as a sub menu.
- * A Menu can also be popped up, for instance as a right-click context menu, by calling the popup() method.
+ * A Menu can also be popped up, for instance as a right-click context menu, by calling one of the popup_*()
methods.
*
* @ingroup Widgets
* @ingroup Menus
@@ -61,43 +61,8 @@ public:
explicit Menu(const Glib::RefPtr<Gio::MenuModel>& model);
_IGNORE(gtk_menu_new_from_model)
-
/* append, prepend, and insert are defined in MenuShell */
- /** For instance,
- * void on_popup_menu_position(int& x, int& y, bool& push_in);
- */
- typedef sigc::slot<void(int&, int&, bool&)> SlotPositionCalc;
-
- void popup(MenuShell& parent_menu_shell, MenuItem& parent_menu_item, const SlotPositionCalc& slot, guint
button, guint32 activate_time, const Glib::RefPtr<Gdk::Device>& device = Glib::RefPtr<Gdk::Device>());
- _IGNORE(gtk_menu_popup, gtk_menu_popup_for_device)
-
- /** Displays a menu and makes it available for selection. Applications can use
- * this function to display context-sensitive menus.
- *
- * The @a button parameter should be the mouse button pressed to initiate
- * the menu popup. If the menu popup was initiated by something other than
- * a mouse button press, such as a mouse button release or a keypress,
- * @a button should be 0.
- *
- * The @a activate_time parameter should be the time stamp of the event that
- * initiated the popup. If such an event is not available, use
- * gtk_get_current_event_time() instead.
- * @param position_calc_slot A user supplied function used to position the menu, or <tt>0</tt>.
- * @param button The mouse button which was pressed to initiate the event.
- * @param activate_time The time at which the activation event occurred.
- * @param device A Gdk::Device.
- */
- void popup(const SlotPositionCalc& position_calc_slot, guint button, guint32 activate_time, const
Glib::RefPtr<Gdk::Device>& device = Glib::RefPtr<Gdk::Device>());
-
- /** Displays a menu and makes it available for selection.
- * Applications can use this function to display context-sensitive menus, at the current pointer position.
- * @param button The button which was pressed to initiate the event.
- * @param activate_time The time at which the activation event occurred.
- * @param device A Gdk::Device.
- */
- void popup(guint button, guint32 activate_time, const Glib::RefPtr<Gdk::Device>& device =
Glib::RefPtr<Gdk::Device>());
-
_WRAP_METHOD(void popup_at_rect(const Glib::RefPtr<Gdk::Surface>& rect_surface,
const Gdk::Rectangle& rect, Gdk::Gravity rect_anchor, Gdk::Gravity menu_anchor,
const Glib::RefPtr<const Gdk::Event>& trigger_event = {}), gtk_menu_popup_at_rect)
diff --git a/gtk/src/selectiondata.hg b/gtk/src/selectiondata.hg
index da9fb7c4..6ec5cf5e 100644
--- a/gtk/src/selectiondata.hg
+++ b/gtk/src/selectiondata.hg
@@ -125,7 +125,7 @@ dnl The constness of gtk_selection_data_set_uris() is not quite right:
std::string get_target() const;
_IGNORE(gtk_selection_data_get_target)
- /// See also Gtk::Clipboard::request_targets()
+ /// See also Gdk::Clipboard::get_formats()
std::vector<std::string> get_targets() const;
_IGNORE(gtk_selection_data_get_targets)
diff --git a/gtk/src/stylecontext.hg b/gtk/src/stylecontext.hg
index 3ba50cb1..d8b61495 100644
--- a/gtk/src/stylecontext.hg
+++ b/gtk/src/stylecontext.hg
@@ -196,7 +196,6 @@ public:
_WRAP_METHOD(void render_focus(const Cairo::RefPtr<Cairo::Context>& cr, double x, double y, double width,
double height), gtk_render_focus)
_WRAP_METHOD(void render_layout(const Cairo::RefPtr<Cairo::Context>& cr, double x, double y, const
Glib::RefPtr<Pango::Layout>& layout), gtk_render_layout)
_WRAP_METHOD(void render_line(const Cairo::RefPtr<Cairo::Context>& cr, double x0, double y0, double x1,
double y1), gtk_render_line)
- _WRAP_METHOD(void render_frame_gap(const Cairo::RefPtr<Cairo::Context>& cr, double x, double y, double
width, double height, PositionType gap_side, double xy0_gap, double xy1_gap), gtk_render_frame_gap)
_WRAP_METHOD(void render_handle(const Cairo::RefPtr<Cairo::Context>& cr, double x, double y, double width,
double height), gtk_render_handle)
_WRAP_METHOD(void render_activity(const Cairo::RefPtr<Cairo::Context>& cr, double x, double y, double
width, double height), gtk_render_activity)
_WRAP_METHOD(void render_icon(const Cairo::RefPtr<Cairo::Context>& cr, const Glib::RefPtr<Gdk::Texture>&
texture, double x, double y), gtk_render_icon)
diff --git a/gtk/src/widget.hg b/gtk/src/widget.hg
index 02928387..8e06af41 100644
--- a/gtk/src/widget.hg
+++ b/gtk/src/widget.hg
@@ -350,7 +350,7 @@ public:
*/
void unset_font_options();
// This returns a const, so we assume that we must copy it:
- #m4 _CONVERSION(`const cairo_font_options_t*', `Cairo::FontOptions',
`Cairo::FontOptions(const_cast<cairo_font_options_t*>($3), false /* take_ownership */)')
+#m4 _CONVERSION(`const cairo_font_options_t*', `Cairo::FontOptions',
`Cairo::FontOptions(const_cast<cairo_font_options_t*>($3), false /* take_ownership */)')
_WRAP_METHOD(Cairo::FontOptions get_font_options() const, gtk_widget_get_font_options)
_WRAP_METHOD(Glib::RefPtr<Pango::Layout> create_pango_layout(const Glib::ustring& text),
gtk_widget_create_pango_layout)
@@ -640,17 +640,17 @@ dnl
_WRAP_SIGNAL(void drag_end(const Glib::RefPtr<Gdk::Drag>& drag), "drag_end")
//We use the optional custom_c_callback parameter with _WRAP_SIGNAL(),
//so that we can write special code to wrap the non-const SelectionData& output parameter:
- _WRAP_SIGNAL(void drag_data_get(const Glib::RefPtr<Gdk::Drag>& context, SelectionData& selection_data),
"drag_data_get", custom_c_callback)
+ _WRAP_SIGNAL(void drag_data_get(const Glib::RefPtr<Gdk::Drag>& drag, SelectionData& selection_data),
"drag_data_get", custom_c_callback)
_WRAP_SIGNAL(void drag_data_delete(const Glib::RefPtr<Gdk::Drag>& drag), "drag_data_delete")
_WRAP_SIGNAL(bool drag_failed(const Glib::RefPtr<Gdk::Drag>& drag, DragResult result), "drag_failed")
_WRAP_SIGNAL(void drag_leave(const Glib::RefPtr<Gdk::Drop>& drop), "drag_leave")
_WRAP_SIGNAL(bool drag_motion(const Glib::RefPtr<Gdk::Drop>& drop, int x, int y), "drag_motion")
_WRAP_SIGNAL(bool drag_drop(const Glib::RefPtr<Gdk::Drop>& drop, int x, int y), "drag_drop")
- _WRAP_SIGNAL(void drag_data_received(const Glib::RefPtr<Gdk::Drop>& context, const SelectionData&
selection_data), "drag_data_received")
+ _WRAP_SIGNAL(void drag_data_received(const Glib::RefPtr<Gdk::Drop>& drop, const SelectionData&
selection_data), "drag_data_received")
// The accel_closures_changed signal can't have a default handler because the wrapped C signal has no
default handler.
_WRAP_SIGNAL(void accel_closures_changed(), "accel_closures_changed", no_default_handler)
-_CONVERSION(`GdkDisplay*',`const Glib::RefPtr<Gdk::Display>&',`Glib::wrap($3, true)')
+#m4 _CONVERSION(`GdkDisplay*',`const Glib::RefPtr<Gdk::Display>&',`Glib::wrap($3, true)')
_WRAP_SIGNAL(void display_changed(const Glib::RefPtr<Gdk::Display>& previous_display), "display_changed")
//TODO: The signal_id is very C-like here:
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]