Use GTK_MAJOR_VERSION macro instead of custom one.
This commit is contained in:
parent
f2dcb275d2
commit
99f7e63972
@ -199,7 +199,6 @@ GTK3_WARNING=no
|
||||
if test yes = "$with_gtk3" -a no = "$with_gtk2"; then
|
||||
GTK_VERSION="gtk+-3.0"
|
||||
GTK3_WARNING=yes
|
||||
CFLAGS="$CFLAGS -DUSE_GTK3"
|
||||
else
|
||||
GTK_VERSION="gtk+-2.0 >= 2.16"
|
||||
fi
|
||||
|
@ -1,9 +1,10 @@
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <gtk/gtk.h>
|
||||
#include <gdk/gdk.h>
|
||||
#include <gdk/gdkkeysyms.h>
|
||||
#ifdef USE_GTK3
|
||||
#if GTK_MAJOR_VERSION >= 3
|
||||
#include <gdk/gdkkeysyms-compat.h>
|
||||
#endif
|
||||
|
||||
|
@ -770,7 +770,7 @@ S9xOpenGLDisplayDriver::create_window (int width, int height)
|
||||
XMapWindow (display, xwindow);
|
||||
XSync (display, False);
|
||||
|
||||
#if USE_GTK3
|
||||
#if GTK_MAJOR_VERSION >= 3
|
||||
gdk_window = gdk_x11_window_foreign_new_for_display (gtk_widget_get_display (drawing_area), xwindow);
|
||||
#else
|
||||
gdk_window = gdk_window_foreign_new (xwindow);
|
||||
|
@ -76,7 +76,7 @@ S9xXVDisplayDriver::create_window (int width, int height)
|
||||
XMapWindow (display, xwindow);
|
||||
XSync (display, False);
|
||||
|
||||
#if USE_GTK3
|
||||
#if GTK_MAJOR_VERSION >= 3
|
||||
gdk_window = gdk_x11_window_foreign_new_for_display (gtk_widget_get_display (drawing_area), xwindow);
|
||||
#else
|
||||
gdk_window = gdk_window_foreign_new (xwindow);
|
||||
|
@ -2,9 +2,6 @@
|
||||
#include <stdlib.h>
|
||||
#include <gdk/gdkkeysyms.h>
|
||||
#include <gdk/gdkx.h>
|
||||
#ifdef USE_GTK3
|
||||
#include <gdk/gdkkeysyms-compat.h>
|
||||
#endif
|
||||
|
||||
#include "gtk_preferences.h"
|
||||
#include "gtk_config.h"
|
||||
@ -14,6 +11,10 @@
|
||||
#include "gtk_display.h"
|
||||
#include "gtk_binding.h"
|
||||
|
||||
#if GTK_MAJOR_VERSION >= 3
|
||||
#include <gdk/gdkkeysyms-compat.h>
|
||||
#endif
|
||||
|
||||
#define SAME_GAME _("Same location as current game")
|
||||
|
||||
gboolean
|
||||
@ -565,7 +566,7 @@ event_about_clicked (GtkButton *widget, gpointer data)
|
||||
|
||||
gtk_widget_hide (about_dialog->get_widget ("preferences_splash"));
|
||||
|
||||
#ifdef USE_GTK3
|
||||
#if GTK_MAJOR_VERSION >= 3
|
||||
GtkCssProvider *provider;
|
||||
GtkStyleContext *context;
|
||||
|
||||
|
@ -36,7 +36,7 @@
|
||||
extern Snes9xWindow *top_level;
|
||||
extern Snes9xConfig *gui_config;
|
||||
|
||||
#ifdef USE_GTK3
|
||||
#if GTK_MAJOR_VERSION >= 3
|
||||
#define GDK_COMPAT_WINDOW_XID(window) (gdk_x11_window_get_xid (window))
|
||||
#else
|
||||
#define GDK_COMPAT_WINDOW_XID(window) (GDK_WINDOW_XWINDOW (window))
|
||||
|
@ -1,9 +1,6 @@
|
||||
#include <gdk/gdk.h>
|
||||
#include <gdk/gdkx.h>
|
||||
#include <gdk/gdkkeysyms.h>
|
||||
#ifdef USE_GTK3
|
||||
#include <gdk/gdkkeysyms-compat.h>
|
||||
#endif
|
||||
#include <cairo.h>
|
||||
|
||||
#ifdef USE_XV
|
||||
@ -24,6 +21,10 @@
|
||||
#include "gtk_netplay.h"
|
||||
#endif
|
||||
|
||||
#if GTK_MAJOR_VERSION >= 3
|
||||
#include <gdk/gdkkeysyms-compat.h>
|
||||
#endif
|
||||
|
||||
static gboolean
|
||||
event_main_window_delete (GtkWidget *widget,
|
||||
GdkEvent *event,
|
||||
@ -133,7 +134,7 @@ event_open_netplay (GtkWidget *widget, gpointer data)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
#ifdef USE_GTK3
|
||||
#if GTK_MAJOR_VERSION >= 3
|
||||
static gboolean
|
||||
event_drawingarea_draw (GtkWidget *widget,
|
||||
cairo_t *cr,
|
||||
@ -147,9 +148,9 @@ event_drawingarea_draw (GtkWidget *widget,
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef USE_GTK3
|
||||
#else
|
||||
|
||||
static gboolean
|
||||
event_drawingarea_expose (GtkWidget *widget,
|
||||
GdkEventExpose *event,
|
||||
@ -623,13 +624,13 @@ Snes9xWindow::Snes9xWindow (Snes9xConfig *config) :
|
||||
}
|
||||
|
||||
drawing_area = GTK_DRAWING_AREA (get_widget ("drawingarea"));
|
||||
#ifndef USE_GTK3
|
||||
#if GTK_MAJOR_VERSION < 3
|
||||
gtk_widget_set_double_buffered (GTK_WIDGET (drawing_area), FALSE);
|
||||
#endif
|
||||
|
||||
gtk_widget_realize (window);
|
||||
gtk_widget_realize (GTK_WIDGET (drawing_area));
|
||||
#ifndef USE_GTK3
|
||||
#if GTK_MAJOR_VERSION < 3
|
||||
gdk_window_set_back_pixmap (gtk_widget_get_window (window), NULL, FALSE);
|
||||
gdk_window_set_back_pixmap (gtk_widget_get_window (GTK_WIDGET (drawing_area)), NULL, FALSE);
|
||||
#endif
|
||||
@ -646,7 +647,7 @@ Snes9xWindow::Snes9xWindow (Snes9xConfig *config) :
|
||||
gtk_widget_hide (get_widget ("sync_clients_separator"));
|
||||
#endif
|
||||
|
||||
#ifdef USE_GTK3
|
||||
#if GTK_MAJOR_VERSION >= 3
|
||||
g_signal_connect_data (drawing_area,
|
||||
"draw",
|
||||
G_CALLBACK (event_drawingarea_draw),
|
||||
@ -1966,7 +1967,7 @@ Snes9xWindow::get_cairo (void)
|
||||
|
||||
GtkWidget *drawing_area = GTK_WIDGET (this->drawing_area);
|
||||
|
||||
#ifndef USE_GTK3
|
||||
#if GTK_MAJOR_VERSION < 3
|
||||
cr = gdk_cairo_create (gtk_widget_get_window (drawing_area));
|
||||
#else
|
||||
GtkAllocation allocation;
|
||||
@ -1988,7 +1989,7 @@ Snes9xWindow::release_cairo (void)
|
||||
{
|
||||
if (cairo_owned)
|
||||
{
|
||||
#ifndef USE_GTK3
|
||||
#if GTK_MAJOR_VERSION < 3
|
||||
cairo_destroy (cr);
|
||||
#else
|
||||
gdk_window_end_draw_frame (gtk_widget_get_window (GTK_WIDGET (drawing_area)), gdk_drawing_context);
|
||||
|
@ -83,7 +83,7 @@ class Snes9xWindow : public GtkBuilderWindow
|
||||
GtkWidget *recent_menu;
|
||||
cairo_t *cr;
|
||||
int cairo_owned;
|
||||
#ifdef USE_GTK3
|
||||
#if GTK_MAJOR_VERSION >= 3
|
||||
GdkDrawingContext *gdk_drawing_context;
|
||||
cairo_region_t *cairo_region;
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user