[gtkmm] Remove some deprecated API
- From: Kjell Ahlstedt <kjellahl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtkmm] Remove some deprecated API
- Date: Fri, 30 Dec 2016 15:24:04 +0000 (UTC)
commit 1265073904767b8c986d577653c98f40fa03d515
Author: Kjell Ahlstedt <kjell ahlstedt bredband net>
Date: Fri Dec 30 16:21:14 2016 +0100
Remove some deprecated API
* gdk/src/device.[ccg|hg]: Remove grab() and ungrab().
Remove enum GrabOwnership, although it's not deprecated in gtk+.
It's not used any more in gtkmm.
* gdk/src/devicemanager.hg: Remove list_devices().
* gdk/src/display.hg: Remove get_device_manager().
* gdk/src/pixbuf.[ccg|hg]: Remove create_from_inline(). Remove non-const
versions of save() and save_to_buffer().
* gtk/gtkmm/radiobuttongroup.h: Remove an obsolete class declaration.
* gtk/src/stylecontext.[ccg|hg]: Remove get_background_color() and
get_border_color().
These functions have been deprecated but not removed in gtk+ and gdk-pixbuf.
gdk/src/device.ccg | 9 -----
gdk/src/device.hg | 16 +-------
gdk/src/devicemanager.hg | 7 +---
gdk/src/display.hg | 5 +--
gdk/src/pixbuf.ccg | 39 ---------------------
gdk/src/pixbuf.hg | 78 +-----------------------------------------
gtk/gtkmm/radiobuttongroup.h | 1 -
gtk/src/stylecontext.ccg | 20 -----------
gtk/src/stylecontext.hg | 13 +------
9 files changed, 6 insertions(+), 182 deletions(-)
---
diff --git a/gdk/src/device.ccg b/gdk/src/device.ccg
index fb5f51e..49925b1 100644
--- a/gdk/src/device.ccg
+++ b/gdk/src/device.ccg
@@ -72,15 +72,6 @@ Glib::RefPtr<const Window> Device::get_window_at_position() const
return const_cast<Device*>(this)->get_window_at_position();
}
-_DEPRECATE_IFDEF_START
-G_GNUC_BEGIN_IGNORE_DEPRECATIONS
-GrabStatus Device::grab(const Glib::RefPtr<Window>& window, GrabOwnership grab_ownership, bool owner_events,
EventMask event_mask, guint32 time_)
-{
- return static_cast<GrabStatus>(gdk_device_grab(gobj(), Glib::unwrap(window),
static_cast<GdkGrabOwnership>(grab_ownership), static_cast<int>(owner_events),
static_cast<GdkEventMask>(event_mask), nullptr, time_));
-}
-G_GNUC_END_IGNORE_DEPRECATIONS
-_DEPRECATE_IFDEF_END
-
std::vector<std::string> Device::list_axes() const
{
auto glist = gdk_device_list_axes(const_cast<GdkDevice*>(gobj()));
diff --git a/gdk/src/device.hg b/gdk/src/device.hg
index 95aa178..c866b14 100644
--- a/gdk/src/device.hg
+++ b/gdk/src/device.hg
@@ -35,7 +35,7 @@ _WRAP_ENUM(EventMask, GdkEventMask)
_WRAP_ENUM(InputMode, GdkInputMode)
_WRAP_ENUM(InputSource, GdkInputSource)
_WRAP_ENUM(DeviceType, GdkDeviceType)
-_WRAP_ENUM(GrabOwnership, GdkGrabOwnership)
+//_WRAP_ENUM(GrabOwnership, GdkGrabOwnership)
_WRAP_ENUM(GrabStatus, GdkGrabStatus)
class Display;
@@ -105,20 +105,8 @@ public:
_WRAP_METHOD(DeviceType get_device_type() const, gdk_device_get_device_type)
- _WRAP_METHOD(GrabStatus grab(const Glib::RefPtr<Window>& window, GrabOwnership grab_ownership,
- bool owner_events, EventMask event_mask, const Glib::RefPtr<Cursor>& cursor, guint32 time_),
- gdk_device_grab, deprecated "Use Gdk::Seat::grab() instead.")
+ _IGNORE(gdk_device_grab, gdk_device_ungrab)dnl//deprecated
-_DEPRECATE_IFDEF_START
- /** See the grab() method which takes more parameters.
- *
- * @deprecated Use Gdk::Seat::grab() instead.
- */
- GrabStatus grab(const Glib::RefPtr<Window>& window, GrabOwnership grab_ownership, bool owner_events,
EventMask event_mask, guint32 time_);
-_DEPRECATE_IFDEF_END
-
- _WRAP_METHOD(void ungrab(guint32 time_), gdk_device_ungrab,
- deprecated "Use Gdk::Seat::ungrab() instead.")
_WRAP_METHOD(void warp(const Glib::RefPtr<Screen>& screen, int x, int y), gdk_device_warp)
/** Gets the current location of the device.
diff --git a/gdk/src/devicemanager.hg b/gdk/src/devicemanager.hg
index cebbfa3..9799bd4 100644
--- a/gdk/src/devicemanager.hg
+++ b/gdk/src/devicemanager.hg
@@ -123,12 +123,7 @@ 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)
-#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,
- deprecated "Use Gdk::Seat::get_pointer(), Gdk::Seat::get_keyboard() and Gdk::Seat::get_slaves()
instead.")
-#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,
- deprecated "Use Gdk::Seat::get_pointer(), Gdk::Seat::get_keyboard() and Gdk::Seat::get_slaves()
instead.")
+ _IGNORE(gdk_device_manager_list_devices)dnl//deprecated
// Signals and properties are not yet (2016-05-26) formally deprecated in
// gtk+, but GdkDeviceManager is not recommended for use in new code.
diff --git a/gdk/src/display.hg b/gdk/src/display.hg
index 666adb3..5ecf713 100644
--- a/gdk/src/display.hg
+++ b/gdk/src/display.hg
@@ -130,10 +130,7 @@ public:
_WRAP_METHOD(bool supports_input_shapes() const, gdk_display_supports_input_shapes)
_WRAP_METHOD(void notify_startup_complete(const Glib::ustring& startup_id),
gdk_display_notify_startup_complete)
- _WRAP_METHOD(Glib::RefPtr<DeviceManager> get_device_manager(), gdk_display_get_device_manager, refreturn,
- deprecated "Use get_default_seat() and Gdk::Seat operations.")
- _WRAP_METHOD(Glib::RefPtr<const DeviceManager> get_device_manager() const, gdk_display_get_device_manager,
refreturn, constversion,
- deprecated "Use get_default_seat() and Gdk::Seat operations.")
+ _IGNORE(gdk_display_get_device_manager)dnl//deprecated
#m4 _CONVERSION(`GdkAppLaunchContext*',`Glib::RefPtr<AppLaunchContext>', `Glib::wrap($3)')
#m4 _CONVERSION(`GdkAppLaunchContext*',`Glib::RefPtr<const AppLaunchContext>', `Glib::wrap($3)')
diff --git a/gdk/src/pixbuf.ccg b/gdk/src/pixbuf.ccg
index 9beebaf..65960d5 100644
--- a/gdk/src/pixbuf.ccg
+++ b/gdk/src/pixbuf.ccg
@@ -110,14 +110,6 @@ void Pixbuf::save(const std::string& filename, const Glib::ustring& type) const
::Glib::Error::throw_exception(gerror);
}
-#ifndef GDKMM_DISABLE_DEPRECATED
-
-void Pixbuf::save(const std::string& filename, const Glib::ustring& type)
-{
- const_cast<const Pixbuf*>(this)->save(filename, type);
-}
-#endif // GDKMM_DISABLE_DEPRECATED
-
void Pixbuf::save(const std::string& filename, const Glib::ustring& type,
const std::vector<Glib::ustring>& option_keys,
const std::vector<Glib::ustring>& option_values) const
@@ -134,16 +126,6 @@ void Pixbuf::save(const std::string& filename, const Glib::ustring& type,
::Glib::Error::throw_exception(gerror);
}
-#ifndef GDKMM_DISABLE_DEPRECATED
-
-void Pixbuf::save(const std::string& filename, const Glib::ustring& type,
- const std::vector<Glib::ustring>& option_keys,
- const std::vector<Glib::ustring>& option_values)
-{
- const_cast<const Pixbuf*>(this)->save(filename, type, option_keys, option_values);
-}
-#endif // GDKMM_DISABLE_DEPRECATED
-
void Pixbuf::save_to_buffer(gchar*& buffer, gsize& buffer_size,
const Glib::ustring& type) const
{
@@ -158,15 +140,6 @@ void Pixbuf::save_to_buffer(gchar*& buffer, gsize& buffer_size,
::Glib::Error::throw_exception(gerror);
}
-#ifndef GDKMM_DISABLE_DEPRECATED
-
-void Pixbuf::save_to_buffer(gchar*& buffer, gsize& buffer_size,
- const Glib::ustring& type)
-{
- const_cast<const Pixbuf*>(this)->save_to_buffer(buffer, buffer_size, type);
-}
-#endif // GDKMM_DISABLE_DEPRECATED
-
void Pixbuf::save_to_buffer(gchar*& buffer, gsize& buffer_size,
const Glib::ustring& type,
const std::vector<Glib::ustring>& option_keys,
@@ -186,18 +159,6 @@ void Pixbuf::save_to_buffer(gchar*& buffer, gsize& buffer_size,
::Glib::Error::throw_exception(gerror);
}
-#ifndef GDKMM_DISABLE_DEPRECATED
-
-void Pixbuf::save_to_buffer(gchar*& buffer, gsize& buffer_size,
- const Glib::ustring& type,
- const std::vector<Glib::ustring>& option_keys,
- const std::vector<Glib::ustring>& option_values)
-{
- const_cast<const Pixbuf*>(this)->save_to_buffer(buffer, buffer_size, type,
- option_keys, option_values);
-}
-#endif // GDKMM_DISABLE_DEPRECATED
-
std::vector<PixbufFormat> Pixbuf::get_formats()
{
return Glib::SListHandler<PixbufFormat, PixbufFormatTraits>::slist_to_vector(gdk_pixbuf_get_formats(),
Glib::OWNERSHIP_SHALLOW);
diff --git a/gdk/src/pixbuf.hg b/gdk/src/pixbuf.hg
index 27a4805..4a6c8ff 100644
--- a/gdk/src/pixbuf.hg
+++ b/gdk/src/pixbuf.hg
@@ -34,7 +34,7 @@ _PINCLUDE(glibmm/private/object_p.h)
#m4 _PUSH(SECTION_CC_PRE_INCLUDES)
// So we can use deprecated functions in our deprecated methods.
-#undef GDK_PIXBUF_DISABLE_DEPRECATED
+//#undef GDK_PIXBUF_DISABLE_DEPRECATED
#m4 _POP()
namespace Gdk
@@ -206,39 +206,6 @@ public:
_WRAP_METHOD(static Glib::RefPtr<Pixbuf> create_from_xpm_data(const char *const * data),
gdk_pixbuf_new_from_xpm_data)
- /** Create a Gdk::Pixbuf from a flat representation that is suitable for
- * storing as inline data in a program. This is useful if you want to ship a
- * program with images, but don't want to depend on any external files.
- *
- * GTK+ ships with a program called <tt>gdk-pixbuf-csource</tt> which allows
- * for conversion of GdkPixbufs into such a inline representation. In almost
- * all cases, you should pass the <tt>--raw</tt> flag to
- * <tt>gdk-pixbuf-csource</tt>. A sample invocation would be:
- *
- * <tt>gdk-pixbuf-csource --raw --name=myimage_inline myimage.png</tt>
- *
- * For the typical case where the inline pixbuf is read-only static data, you
- * don't need to copy the pixel data unless you intend to write to it, so you
- * can pass <tt>false</tt> for @a copy_pixels. (If you pass <tt>--rle</tt> to
- * <tt>gdk-pixbuf-csource</tt>, a copy will be made even if @a copy_pixels is
- * <tt>false</tt>, so using this option is generally a bad idea.)
- *
- * If you create a pixbuf from const inline data compiled into your program,
- * it's probably safe to ignore errors, since things will always succeed. For
- * non-const inline data, you could get out of memory. For untrusted inline
- * data located at runtime, you could have corrupt inline data in addition.
- *
- * @param data_length Length in bytes of the @a data argument.
- * @param data Byte data containing a serialized GdkPixdata structure.
- * @param copy_pixels Whether to copy the pixel data, or use direct pointers
- * to @a data for the resulting pixbuf.
- * @throw Gdk::PixbufError
- *
- * @deprecated Use Gio::Resource instead.
- */
- _WRAP_METHOD(static Glib::RefPtr<Pixbuf> create_from_inline(int data_length, const guint8* data,
- bool copy_pixels = false), gdk_pixbuf_new_from_inline, errthrow, deprecated "Use
Gio::Resource instead.")
-
_WRAP_METHOD(static Glib::RefPtr<Pixbuf> create_from_stream(const Glib::RefPtr<Gio::InputStream>& stream,
const Glib::RefPtr<Gio::Cancellable>& cancellable), gdk_pixbuf_new_from_stream, errthrow)
static Glib::RefPtr<Pixbuf> create_from_stream(const Glib::RefPtr<Gio::InputStream>& stream);
@@ -275,15 +242,6 @@ public:
* @throw Gdk::PixbufError
*/
void save(const std::string& filename, const Glib::ustring& type) const;
-
-#ifndef GDKMM_DISABLE_DEPRECATED
- /**
- * Same as the const version.
- * @deprecated 3.6: Use the const version instead.
- */
- void save(const std::string& filename, const Glib::ustring& type);
-#endif // GDKMM_DISABLE_DEPRECATED
-
_IGNORE(gdk_pixbuf_save)
/** Saves pixbuf to a file in format @a type.
@@ -313,17 +271,6 @@ public:
void save(const std::string& filename, const Glib::ustring& type,
const std::vector<Glib::ustring>& option_keys,
const std::vector<Glib::ustring>& option_values) const;
-
-#ifndef GDKMM_DISABLE_DEPRECATED
- /**
- * Same as the const version.
- * @deprecated 3.6: Use the const version instead.
- */
- void save(const std::string& filename, const Glib::ustring& type,
- const std::vector<Glib::ustring>& option_keys,
- const std::vector<Glib::ustring>& option_values);
-#endif // GDKMM_DISABLE_DEPRECATED
-
_IGNORE(gdk_pixbuf_savev)
#if 0 //TODO:
@@ -380,15 +327,6 @@ gboolean gdk_pixbuf_save_to_callbackv (GdkPixbuf *pixbuf,
void save_to_buffer(gchar*& buffer, gsize& buffer_size,
const Glib::ustring& type = "png") const;
-#ifndef GDKMM_DISABLE_DEPRECATED
- /**
- * Same as the const version.
- * @deprecated 3.6: Use the const version instead.
- */
- void save_to_buffer(gchar*& buffer, gsize& buffer_size,
- const Glib::ustring& type = "png");
-#endif // GDKMM_DISABLE_DEPRECATED
-
/** Saves the pixbuf to a new buffer in format @a type.
* Note that the buffer is not nul-terminated and may contain embedded nulls.
* @see save().
@@ -408,22 +346,8 @@ gboolean gdk_pixbuf_save_to_callbackv (GdkPixbuf *pixbuf,
const Glib::ustring& type,
const std::vector<Glib::ustring>& option_keys,
const std::vector<Glib::ustring>& option_values) const;
-
-#ifndef GDKMM_DISABLE_DEPRECATED
- /**
- * Same as the const version.
- * @deprecated 3.6: Use the const version instead.
- */
- void save_to_buffer(gchar*& buffer, gsize& buffer_size,
- const Glib::ustring& type,
- const std::vector<Glib::ustring>& option_keys,
- const std::vector<Glib::ustring>& option_values);
-#endif // GDKMM_DISABLE_DEPRECATED
-
_IGNORE(gdk_pixbuf_save_to_bufferv, gdk_pixbuf_save_to_buffer)
-
-
_WRAP_METHOD(Glib::RefPtr<Gdk::Pixbuf> add_alpha(
bool substitute_color, guint8 r, guint8 g, guint8 b) const,
gdk_pixbuf_add_alpha)
diff --git a/gtk/gtkmm/radiobuttongroup.h b/gtk/gtkmm/radiobuttongroup.h
index f20cc14..8220ba3 100644
--- a/gtk/gtkmm/radiobuttongroup.h
+++ b/gtk/gtkmm/radiobuttongroup.h
@@ -35,7 +35,6 @@ namespace Gtk
class RadioButton;
class RadioMenuItem;
-class RadioAction; //deprecated
class RadioToolButton;
/** RadioButtonGroup, identifier for RadioButtons.
diff --git a/gtk/src/stylecontext.ccg b/gtk/src/stylecontext.ccg
index 3d79370..08cf3f5 100644
--- a/gtk/src/stylecontext.ccg
+++ b/gtk/src/stylecontext.ccg
@@ -22,7 +22,6 @@
namespace Gtk
{
-
Gdk::RGBA StyleContext::get_color() const
{
GdkRGBA crgba;
@@ -30,24 +29,6 @@ Gdk::RGBA StyleContext::get_color() const
return Gdk::RGBA(&crgba, true);
}
-_DEPRECATE_IFDEF_START
-G_GNUC_BEGIN_IGNORE_DEPRECATIONS
-Gdk::RGBA StyleContext::get_background_color() const
-{
- GdkRGBA crgba;
- gtk_style_context_get_background_color(const_cast<GtkStyleContext*>(gobj()), &crgba);
- return Gdk::RGBA(&crgba, true);
-}
-
-Gdk::RGBA StyleContext::get_border_color() const
-{
- GdkRGBA crgba;
- gtk_style_context_get_border_color(const_cast<GtkStyleContext*>(gobj()), &crgba);
- return Gdk::RGBA(&crgba, true);
-}
-G_GNUC_END_IGNORE_DEPRECATIONS
-_DEPRECATE_IFDEF_END
-
Pango::FontDescription StyleContext::get_font(StateFlags state) const
{
PangoFontDescription* description = nullptr;
@@ -82,5 +63,4 @@ void StyleContext::unset_parent()
gtk_style_context_set_parent(gobj(), nullptr);
}
-
} // namespace Gtk
diff --git a/gtk/src/stylecontext.hg b/gtk/src/stylecontext.hg
index 39d3037..f42944b 100644
--- a/gtk/src/stylecontext.hg
+++ b/gtk/src/stylecontext.hg
@@ -180,18 +180,7 @@ public:
*/
Gdk::RGBA get_color() const;
_IGNORE(gtk_style_context_get_color)
-
-_DEPRECATE_IFDEF_START
- /** @deprecated Use render_background() instead.
- */
- Gdk::RGBA get_background_color() const;
- _IGNORE(gtk_style_context_get_background_color)
-
- /** @deprecated Use render_frame() instead.
- */
- Gdk::RGBA get_border_color() const;
- _IGNORE(gtk_style_context_get_border_color)
-_DEPRECATE_IFDEF_END
+ _IGNORE(gtk_style_context_get_background_color, gtk_style_context_get_border_color)dnl//deprecated
/** Returns the font description for a given state.
*
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]