From: Václav Slavík Date: Sun, 27 Mar 2011 17:23:39 +0000 (+0000) Subject: Renamed wx/gtk/private/compat.h to gtk2-compat.h. X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/8bffcd08c26ab977d908b119a9a41a6ce9887b64?ds=inline Renamed wx/gtk/private/compat.h to gtk2-compat.h. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67318 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/include/wx/gtk/private.h b/include/wx/gtk/private.h index 00f2c9f759..c1a8c66f6e 100644 --- a/include/wx/gtk/private.h +++ b/include/wx/gtk/private.h @@ -15,7 +15,7 @@ #include #include "wx/gtk/private/string.h" -#include "wx/gtk/private/compat.h" +#include "wx/gtk/private/gtk2-compat.h" // pango_version_check symbol is quite recent ATM (4/2007)... so we // use our own wrapper which implements a smart trick. diff --git a/include/wx/gtk/private/compat.h b/include/wx/gtk/private/compat.h deleted file mode 100644 index 9e1db828f3..0000000000 --- a/include/wx/gtk/private/compat.h +++ /dev/null @@ -1,152 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: wx/gtk/private/compat.h -// Purpose: Compatibility code for older GTK+ versions -// Author: Vaclav Slavik -// Created: 2011-03-25 -// RCS-ID: $Id$ -// Copyright: (c) 2011 Vaclav Slavik -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_GTK_PRIVATE_COMPAT_H_ -#define _WX_GTK_PRIVATE_COMPAT_H_ - -// ---------------------------------------------------------------------------- -// Implementations of new accessors for older GTK+ versions -// ---------------------------------------------------------------------------- - -// GTK+ deprecated direct access to struct members and some other stuff, -// replacing them with simple accessor functions. These aren't available in -// older versions, though, so we have to provide them for compatibility. -// -// Note: wx_ prefix is used to avoid symbol conflicts at runtime - - -#if !GTK_CHECK_VERSION(2,18,0) - inline gboolean wx_gtk_widget_get_has_window(GtkWidget *widget) - { - return !GTK_WIDGET_NO_WINDOW(widget); - } - #define gtk_widget_get_has_window wx_gtk_widget_get_has_window -#endif - - -#if !GTK_CHECK_VERSION(2,18,0) - inline gboolean wx_gtk_widget_get_has_grab(GtkWidget *widget) - { - return GTK_WIDGET_HAS_GRAB(widget); - } - #define gtk_widget_get_has_grab wx_gtk_widget_get_has_grab -#endif - - -#if !GTK_CHECK_VERSION(2,18,0) - inline gboolean wx_gtk_widget_get_visible(GtkWidget *widget) - { - return GTK_WIDGET_VISIBLE(widget); - } - #define gtk_widget_get_visible wx_gtk_widget_get_visible -#endif - - -#if !GTK_CHECK_VERSION(2,18,0) - inline gboolean wx_gtk_widget_get_sensitive(GtkWidget *widget) - { - return GTK_WIDGET_VISIBLE(widget); - } - #define gtk_widget_get_sensitive wx_gtk_widget_get_sensitive -#endif - - -#if !GTK_CHECK_VERSION(2,18,0) - inline gboolean wx_gtk_widget_is_drawable(GtkWidget *widget) - { - return GTK_WIDGET_DRAWABLE(widget); - } - #define gtk_widget_is_drawable wx_gtk_widget_is_drawable -#endif - - -#if !GTK_CHECK_VERSION(2,18,0) - inline gboolean wx_gtk_widget_get_can_focus(GtkWidget *widget) - { - return GTK_WIDGET_CAN_FOCUS(widget); - } - #define gtk_widget_get_can_focus wx_gtk_widget_get_can_focus - - inline void wx_gtk_widset_set_can_focus(GtkWidget *widget, gboolean can) - { - if ( can ) - GTK_WIDGET_SET_FLAGS(widget, GTK_CAN_FOCUS); - else - GTK_WIDGET_UNSET_FLAGS(widget, GTK_CAN_FOCUS); - } - #define gtk_widset_set_can_focus wx_gtk_widset_set_can_focus -#endif - - -#if !GTK_CHECK_VERSION(2,18,0) - inline gboolean wx_gtk_widget_get_can_default(GtkWidget *widget) - { - return GTK_WIDGET_CAN_DEFAULT(widget); - } - #define gtk_widget_get_can_default wx_gtk_widget_get_can_default - - inline void wx_gtk_widget_set_can_default(GtkWidget *widget, gboolean can) - { - if ( can ) - GTK_WIDGET_SET_FLAGS(widget, GTK_CAN_DEFAULT); - else - GTK_WIDGET_UNSET_FLAGS(widget, GTK_CAN_DEFAULT); - } - #define gtk_widget_set_can_default wx_gtk_widget_set_can_default -#endif - - -#if !GTK_CHECK_VERSION(2,18,0) - inline gboolean wx_gtk_widget_has_default(GtkWidget *widget) - { - return GTK_WIDGET_HAS_DEFAULT(widget); - } - #define gtk_widget_has_default wx_gtk_widget_has_default -#endif - - -#if !GTK_CHECK_VERSION(2,18,0) - inline GtkStateType wx_gtk_widget_get_state(GtkWidget *widget) - { - return (GtkStateType)GTK_WIDGET_STATE(widget); - } - #define gtk_widget_get_state wx_gtk_widget_get_state -#endif - - -#if !GTK_CHECK_VERSION(2,18,0) - inline gboolean wx_gtk_widget_get_double_buffered(GtkWidget *widget) - { - return GTK_WIDGET_DOUBLE_BUFFERED(widget); - } - #define gtk_widget_get_double_buffered wx_gtk_widget_get_double_buffered -#endif - - -#if !GTK_CHECK_VERSION(2,20,0) - inline gboolean wx_gtk_widget_get_realized(GtkWidget *widget) - { - return GTK_WIDGET_REALIZED(widget); - } - #define gtk_widget_get_realized wx_gtk_widget_get_realized -#endif - - -#if !GTK_CHECK_VERSION(2,20,0) - inline gboolean wx_gtk_widget_get_mapped(GtkWidget *widget) - { - return GTK_WIDGET_MAPPED(widget); - } - #define gtk_widget_get_mapped wx_gtk_widget_get_mapped -#endif - - -#endif // _WX_GTK_PRIVATE_COMPAT_H_ - diff --git a/include/wx/gtk/private/gtk2-compat.h b/include/wx/gtk/private/gtk2-compat.h new file mode 100644 index 0000000000..9e1db828f3 --- /dev/null +++ b/include/wx/gtk/private/gtk2-compat.h @@ -0,0 +1,152 @@ +/////////////////////////////////////////////////////////////////////////////// +// Name: wx/gtk/private/compat.h +// Purpose: Compatibility code for older GTK+ versions +// Author: Vaclav Slavik +// Created: 2011-03-25 +// RCS-ID: $Id$ +// Copyright: (c) 2011 Vaclav Slavik +// Licence: wxWindows licence +/////////////////////////////////////////////////////////////////////////////// + +#ifndef _WX_GTK_PRIVATE_COMPAT_H_ +#define _WX_GTK_PRIVATE_COMPAT_H_ + +// ---------------------------------------------------------------------------- +// Implementations of new accessors for older GTK+ versions +// ---------------------------------------------------------------------------- + +// GTK+ deprecated direct access to struct members and some other stuff, +// replacing them with simple accessor functions. These aren't available in +// older versions, though, so we have to provide them for compatibility. +// +// Note: wx_ prefix is used to avoid symbol conflicts at runtime + + +#if !GTK_CHECK_VERSION(2,18,0) + inline gboolean wx_gtk_widget_get_has_window(GtkWidget *widget) + { + return !GTK_WIDGET_NO_WINDOW(widget); + } + #define gtk_widget_get_has_window wx_gtk_widget_get_has_window +#endif + + +#if !GTK_CHECK_VERSION(2,18,0) + inline gboolean wx_gtk_widget_get_has_grab(GtkWidget *widget) + { + return GTK_WIDGET_HAS_GRAB(widget); + } + #define gtk_widget_get_has_grab wx_gtk_widget_get_has_grab +#endif + + +#if !GTK_CHECK_VERSION(2,18,0) + inline gboolean wx_gtk_widget_get_visible(GtkWidget *widget) + { + return GTK_WIDGET_VISIBLE(widget); + } + #define gtk_widget_get_visible wx_gtk_widget_get_visible +#endif + + +#if !GTK_CHECK_VERSION(2,18,0) + inline gboolean wx_gtk_widget_get_sensitive(GtkWidget *widget) + { + return GTK_WIDGET_VISIBLE(widget); + } + #define gtk_widget_get_sensitive wx_gtk_widget_get_sensitive +#endif + + +#if !GTK_CHECK_VERSION(2,18,0) + inline gboolean wx_gtk_widget_is_drawable(GtkWidget *widget) + { + return GTK_WIDGET_DRAWABLE(widget); + } + #define gtk_widget_is_drawable wx_gtk_widget_is_drawable +#endif + + +#if !GTK_CHECK_VERSION(2,18,0) + inline gboolean wx_gtk_widget_get_can_focus(GtkWidget *widget) + { + return GTK_WIDGET_CAN_FOCUS(widget); + } + #define gtk_widget_get_can_focus wx_gtk_widget_get_can_focus + + inline void wx_gtk_widset_set_can_focus(GtkWidget *widget, gboolean can) + { + if ( can ) + GTK_WIDGET_SET_FLAGS(widget, GTK_CAN_FOCUS); + else + GTK_WIDGET_UNSET_FLAGS(widget, GTK_CAN_FOCUS); + } + #define gtk_widset_set_can_focus wx_gtk_widset_set_can_focus +#endif + + +#if !GTK_CHECK_VERSION(2,18,0) + inline gboolean wx_gtk_widget_get_can_default(GtkWidget *widget) + { + return GTK_WIDGET_CAN_DEFAULT(widget); + } + #define gtk_widget_get_can_default wx_gtk_widget_get_can_default + + inline void wx_gtk_widget_set_can_default(GtkWidget *widget, gboolean can) + { + if ( can ) + GTK_WIDGET_SET_FLAGS(widget, GTK_CAN_DEFAULT); + else + GTK_WIDGET_UNSET_FLAGS(widget, GTK_CAN_DEFAULT); + } + #define gtk_widget_set_can_default wx_gtk_widget_set_can_default +#endif + + +#if !GTK_CHECK_VERSION(2,18,0) + inline gboolean wx_gtk_widget_has_default(GtkWidget *widget) + { + return GTK_WIDGET_HAS_DEFAULT(widget); + } + #define gtk_widget_has_default wx_gtk_widget_has_default +#endif + + +#if !GTK_CHECK_VERSION(2,18,0) + inline GtkStateType wx_gtk_widget_get_state(GtkWidget *widget) + { + return (GtkStateType)GTK_WIDGET_STATE(widget); + } + #define gtk_widget_get_state wx_gtk_widget_get_state +#endif + + +#if !GTK_CHECK_VERSION(2,18,0) + inline gboolean wx_gtk_widget_get_double_buffered(GtkWidget *widget) + { + return GTK_WIDGET_DOUBLE_BUFFERED(widget); + } + #define gtk_widget_get_double_buffered wx_gtk_widget_get_double_buffered +#endif + + +#if !GTK_CHECK_VERSION(2,20,0) + inline gboolean wx_gtk_widget_get_realized(GtkWidget *widget) + { + return GTK_WIDGET_REALIZED(widget); + } + #define gtk_widget_get_realized wx_gtk_widget_get_realized +#endif + + +#if !GTK_CHECK_VERSION(2,20,0) + inline gboolean wx_gtk_widget_get_mapped(GtkWidget *widget) + { + return GTK_WIDGET_MAPPED(widget); + } + #define gtk_widget_get_mapped wx_gtk_widget_get_mapped +#endif + + +#endif // _WX_GTK_PRIVATE_COMPAT_H_ +