[pan2/new_master: 261/266] compat changes
- From: Heinrich MÃller <henmull src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pan2/new_master: 261/266] compat changes
- Date: Mon, 2 Jan 2012 14:11:44 +0000 (UTC)
commit c0bf54397cbafc4a277dd5b43add107e20eed778
Author: Heinrich MÃller <henmull src gnome org>
Date: Mon Jan 2 02:02:19 2012 +0100
compat changes
pan/gui/gtk-compat.h | 39 ++++++++++++++++++++++++++-------------
1 files changed, 26 insertions(+), 13 deletions(-)
---
diff --git a/pan/gui/gtk-compat.h b/pan/gui/gtk-compat.h
index 6e2f608..d9c83ca 100644
--- a/pan/gui/gtk-compat.h
+++ b/pan/gui/gtk-compat.h
@@ -14,9 +14,6 @@
#ifndef PAN_GTK_COMPAT_H
#define PAN_GTK_COMPAT_H
-#include <gtk/gtk.h>
-#include <gdk/gdk.h>
-
#ifdef __cplusplus
namespace
{
@@ -82,25 +79,41 @@ namespace
}
#endif
-#if !GTK_CHECK_VERSION(3,0,0)
-#ifndef GDK_KEY_Up
-#define GDK_KEY_Up GDK_Up
-#define GDK_KEY_KP_Up GDK_KP_Up
-#define GDK_KEY_Down GDK_Down
-#define GDK_KEY_KP_Down GDK_KP_Down
+#if !GTK_CHECK_VERSION(3, 0, 0)
+ #include <gdk/gdkkeysyms.h>
+#endif
+
+//#if !GTK_CHECK_VERSION(3,0,0)
+//#ifndef GDK_KEY_Up
+// #define GDK_KEY_Up GDK_Up
+//#define GDK_KEY_KP_Up GDK_KP_Up
+//#ifndef GDK_KEY_Down
+// #define GDK_KEY_Down GDK_Down
+//#define GDK_KEY_KP_Down GDK_KP_Down
+//#endif
+
+#if !GTK_CHECK_VERSION(2, 22, 0)
+// Define any keys not defined by older GDK versions
+ #define GDK_KEY_Delete GDK_Delete
+ #define GDK_KEY_Return GDK_Return
+ #define GDK_KEY_Down GDK_Down
+ #define GDK_KEY_Up GDK_Up
#endif
+
+#if !GTK_CHECK_VERSION(3,0,0)
+
typedef GtkStyle GtkStyleContext;
- GtkStyleContext* gtk_widget_get_style_context(GtkWidget *w)
+ static inline GtkStyleContext* gtk_widget_get_style_context(GtkWidget *w)
{
return gtk_widget_get_style(w);
}
- GtkIconSet* gtk_style_context_lookup_icon_set(GtkStyleContext *s,
+ static inline GtkIconSet* gtk_style_context_lookup_icon_set(GtkStyleContext *s,
const char *id)
{
return gtk_style_lookup_icon_set(s,id);
}
- void gtk_widget_override_font(GtkWidget *w, PangoFontDescription *f)
+ static inline void gtk_widget_override_font(GtkWidget *w, PangoFontDescription *f)
{
gtk_widget_modify_font(w,f);
}
@@ -108,7 +121,7 @@ namespace
#if GTK_CHECK_VERSION(3,0,0)
// include this for conversion of old key names to new
-#include <gdk/gdkkeysyms.h>
+#include <gdk/gdkkeysyms-compat.h>
#define GTK_OBJECT(w) w
typedef GtkWidget GtkObject;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]