Only define compatability helpers for sexy icons if required.

The helper nsgtk_widget_get_state is only necessary for sexy icons and
introduces unecessary GTK 3 compatability issues otehrwise.
This commit is contained in:
Vincent Sanders 2015-04-09 11:41:06 +01:00
parent 5a14a74ab1
commit ae98fbe8c8
2 changed files with 23 additions and 11 deletions

View File

@ -25,8 +25,24 @@
#include "gtk/compat.h"
#if !GTK_CHECK_VERSION(2,16,0)
#ifdef _SEXY_ICON_ENTRY_H_
#include "gtk/sexy_icon_entry.c"
/*
* exported interface documented in gtk/compat.h
*
* Only required for the lib sexy interface before 2.16
*/
GtkStateType nsgtk_widget_get_state(GtkWidget *widget)
{
#if GTK_CHECK_VERSION(2,18,0)
return gtk_widget_get_state(widget);
#else
return GTK_WIDGET_STATE(widget);
#endif
}
#endif
void nsgtk_widget_set_can_focus(GtkWidget *widget, gboolean can_focus)
@ -86,15 +102,6 @@ gboolean nsgtk_widget_is_drawable(GtkWidget *widget)
#endif
}
GtkStateType nsgtk_widget_get_state(GtkWidget *widget)
{
#if GTK_CHECK_VERSION(2,18,0)
return gtk_widget_get_state(widget);
#else
return GTK_WIDGET_STATE(widget);
#endif
}
void nsgtk_dialog_set_has_separator(GtkDialog *dialog, gboolean setting)
{
#if GTK_CHECK_VERSION(2,21,8)

View File

@ -68,19 +68,24 @@ gboolean nsgtk_widget_get_visible(GtkWidget *widget);
gboolean nsgtk_widget_get_realized(GtkWidget *widget);
gboolean nsgtk_widget_get_mapped(GtkWidget *widget);
gboolean nsgtk_widget_is_drawable(GtkWidget *widget);
GtkStateType nsgtk_widget_get_state(GtkWidget *widget);
void nsgtk_dialog_set_has_separator(GtkDialog *dialog, gboolean setting);
GtkWidget *nsgtk_combo_box_text_new(void);
void nsgtk_combo_box_text_append_text(GtkWidget *combo_box, const gchar *text);
gchar *nsgtk_combo_box_text_get_active_text(GtkWidget *combo_box);
/* GTK prior to 2.16 needs the sexy interface for icons */
#if !GTK_CHECK_VERSION(2,16,0)
#include "gtk/sexy_icon_entry.h"
typedef enum {
GTK_ENTRY_ICON_PRIMARY = SEXY_ICON_ENTRY_PRIMARY,
GTK_ENTRY_ICON_SECONDARY = SEXY_ICON_ENTRY_SECONDARY
} GtkEntryIconPosition;
GtkStateType nsgtk_widget_get_state(GtkWidget *widget);
#endif
#if GTK_CHECK_VERSION (2, 90, 7)