[gtkmm/gtkmm-3-22] Gdk: Deprecate flush(), screen_width(), etc.
- From: Kjell Ahlstedt <kjellahl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtkmm/gtkmm-3-22] Gdk: Deprecate flush(), screen_width(), etc.
- Date: Thu, 28 Dec 2017 09:43:09 +0000 (UTC)
commit 09b0693d47b5176281bd6ffb589eac407afef37c
Author: Kjell Ahlstedt <kjellahlstedt gmail com>
Date: Thu Dec 28 10:40:48 2017 +0100
Gdk: Deprecate flush(), screen_width(), etc.
* gdk/gdkmm/general.[cc|h]: Decrecate Gdk::screen_width(), screen_height(),
screen_width_mm(), screen_height_mm(), flush(). They have been deprecated
in gtk+ 3.22.
* gtk/src/fontbutton.hg: Disable deprecation warnings when fontbutton.cc
is compiled. gtk_font_button_set/get_font_name() and property font-name
are deprecated in gtk+ 3.22 in favor of gtk_font_chooser_set/get_font() and
GtkFontChooser:font. They can't be deprecated in gtkmm 3.22 because
FontChooser is not a base class of FontButton.
* demos/gtk-demo/example_change_display.cc: Don't use the deprecated
Gdk::flush().
demos/gtk-demo/example_change_display.cc | 2 +-
gdk/gdkmm/general.cc | 14 ++++++--------
gdk/gdkmm/general.h | 14 ++++++++++++++
gtk/src/fontbutton.hg | 8 ++++++++
4 files changed, 29 insertions(+), 9 deletions(-)
---
diff --git a/demos/gtk-demo/example_change_display.cc b/demos/gtk-demo/example_change_display.cc
index 8f90b9a..9a327b9 100644
--- a/demos/gtk-demo/example_change_display.cc
+++ b/demos/gtk-demo/example_change_display.cc
@@ -331,7 +331,7 @@ Gtk::Window* Example_ChangeDisplay::query_for_toplevel(const Glib::RefPtr<Gdk::S
toplevel = nullptr;
}
- Gdk::flush(); /* Really release the grab */
+ refDisplay->flush(); /* Really release the grab */
return toplevel;
}
diff --git a/gdk/gdkmm/general.cc b/gdk/gdkmm/general.cc
index 8c7704f..6baca46 100644
--- a/gdk/gdkmm/general.cc
+++ b/gdk/gdkmm/general.cc
@@ -15,11 +15,6 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-//Allow use of deprecated API,
-//in the API that we also deprecate, but cannot remove yet:
-#undef GDK_DISABLE_DEPRECATED
-#define GDK_DISABLE_DEPRECATION_WARNINGS 1
-
#include <gdkmm/general.h>
#include <gdkmm/color.h>
#include <gdk/gdk.h>
@@ -28,6 +23,8 @@
namespace Gdk
{
+#ifndef GDKMM_DISABLE_DEPRECATED
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
int screen_width()
{
return gdk_screen_width();
@@ -48,22 +45,23 @@ int screen_height_mm()
return gdk_screen_height_mm();
}
-
void flush()
{
gdk_flush();
}
+G_GNUC_END_IGNORE_DEPRECATIONS
+#endif //GDKMM_DISABLE_DEPRECATED
namespace Cairo
{
#ifndef GDKMM_DISABLE_DEPRECATED
-
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
void set_source_color(const ::Cairo::RefPtr< ::Cairo::Context >& context, const Gdk::Color& color)
{
gdk_cairo_set_source_color(context->cobj(), const_cast<GdkColor*>(color.gobj()));
}
-
+G_GNUC_END_IGNORE_DEPRECATIONS
#endif //GDKMM_DISABLE_DEPRECATED
void set_source_rgba(const ::Cairo::RefPtr< ::Cairo::Context >& context, const Gdk::RGBA& color)
diff --git a/gdk/gdkmm/general.h b/gdk/gdkmm/general.h
index f8746de..b931374 100644
--- a/gdk/gdkmm/general.h
+++ b/gdk/gdkmm/general.h
@@ -28,13 +28,27 @@
namespace Gdk
{
+#ifndef GDKMM_DISABLE_DEPRECATED
+/** @deprecated Use per-monitor information.
+ */
int screen_width();
+
+/** @deprecated Use per-monitor information.
+ */
int screen_height();
+/** @deprecated Use per-monitor information.
+ */
int screen_width_mm();
+
+/** @deprecated Use per-monitor information.
+ */
int screen_height_mm();
+/** @deprecated Use Gdk::Display::flush() instead.
+ */
void flush();
+#endif //GDKMM_DISABLE_DEPRECATED
namespace Cairo
{
diff --git a/gtk/src/fontbutton.hg b/gtk/src/fontbutton.hg
index 86ba10b..c313b65 100644
--- a/gtk/src/fontbutton.hg
+++ b/gtk/src/fontbutton.hg
@@ -22,6 +22,14 @@
_DEFS(gtkmm,gtk)
_PINCLUDE(gtkmm/private/button_p.h)
+#m4 _PUSH(SECTION_CC_PRE_INCLUDES)
+#undef GTK_DISABLE_DEPRECATED
+#define GDK_DISABLE_DEPRECATION_WARNINGS 1
+#m4 _POP()
+// gtk_font_button_set/get_font_name() and property font-name are deprecated
+// in gtk+ 3.22 in favor of gtk_font_chooser_set/get_font() and
+// GtkFontChooser:font. They can't be deprecated here because FontChooser
+// is not a base cvlass.
namespace Gtk
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]