1
0
mirror of https://github.com/moparisthebest/hexchat synced 2024-08-13 16:53:48 -04:00

GtkComboBoxText requires GTK+ 2.24, dump code for older versions

This commit is contained in:
Berke Viktor 2013-05-11 13:06:25 +02:00
parent 5c663adf35
commit 712eb5428e
7 changed files with 10 additions and 26 deletions

View File

@ -199,7 +199,7 @@ dnl *********************************************************************
# we might get undefined macro without this test # we might get undefined macro without this test
if test "$gtkfe" = yes ; then if test "$gtkfe" = yes ; then
AM_PATH_GTK_2_0(2.14.0, havegtk=yes, havegtk=no) AM_PATH_GTK_2_0(2.24.0, havegtk=yes, havegtk=no)
if test "$havegtk" = no; then if test "$havegtk" = no; then
gtkfe=no gtkfe=no

View File

@ -21,7 +21,7 @@ in general. HexChat runs on most BSD and POSIX compliant operating systems.
## Requirements: ## Requirements:
* GTK+ 2.14 * GTK+ 2.24
* GLib 2.14 * GLib 2.14
HexChat is known to work on, at least: HexChat is known to work on, at least:

View File

@ -685,14 +685,14 @@ dcc_detail_label (char *text, GtkWidget *box, int num)
static void static void
dcc_exp_cb (GtkWidget *exp, GtkWidget *box) dcc_exp_cb (GtkWidget *exp, GtkWidget *box)
{ {
#if GTK_CHECK_VERSION(2,20,0)
if (gtk_widget_get_visible (box)) if (gtk_widget_get_visible (box))
#else {
if (GTK_WIDGET_VISIBLE (box))
#endif
gtk_widget_hide (box); gtk_widget_hide (box);
}
else else
{
gtk_widget_show (box); gtk_widget_show (box);
}
} }
static void static void

View File

@ -897,15 +897,15 @@ fe_gui_info (session *sess, int info_type)
switch (info_type) switch (info_type)
{ {
case 0: /* window status */ case 0: /* window status */
#if GTK_CHECK_VERSION(2,20,0)
if (!gtk_widget_get_visible (GTK_WIDGET (sess->gui->window))) if (!gtk_widget_get_visible (GTK_WIDGET (sess->gui->window)))
#else {
if (!GTK_WIDGET_VISIBLE (GTK_WIDGET (sess->gui->window)))
#endif
return 2; /* hidden (iconified or systray) */ return 2; /* hidden (iconified or systray) */
}
if (gtk_window_is_active (GTK_WINDOW (sess->gui->window))) if (gtk_window_is_active (GTK_WINDOW (sess->gui->window)))
{
return 1; /* active/focused */ return 1; /* active/focused */
}
return 0; /* normal (no keyboard focus or behind a window) */ return 0; /* normal (no keyboard focus or behind a window) */
} }
@ -920,11 +920,7 @@ fe_gui_info_ptr (session *sess, int info_type)
{ {
case 0: /* native window pointer (for plugins) */ case 0: /* native window pointer (for plugins) */
#ifdef WIN32 #ifdef WIN32
#if GTK_CHECK_VERSION(2,24,8)
return gdk_win32_window_get_impl_hwnd (sess->gui->window->window); return gdk_win32_window_get_impl_hwnd (sess->gui->window->window);
#else
return GDK_WINDOW_HWND (sess->gui->window->window);
#endif
#else #else
return sess->gui->window; return sess->gui->window;
#endif #endif

View File

@ -1729,11 +1729,7 @@ static gboolean
menu_canacaccel (GtkWidget *widget, guint signal_id, gpointer user_data) menu_canacaccel (GtkWidget *widget, guint signal_id, gpointer user_data)
{ {
/* GTK2.2 behaviour */ /* GTK2.2 behaviour */
#if GTK_CHECK_VERSION(2,20,0)
return gtk_widget_is_sensitive (widget); return gtk_widget_is_sensitive (widget);
#else
return GTK_WIDGET_IS_SENSITIVE (widget);
#endif
} }
/* === STUFF FOR /MENU === */ /* === STUFF FOR /MENU === */

View File

@ -414,11 +414,7 @@ tray_toggle_visibility (gboolean force_hide)
if (!win) if (!win)
return FALSE; return FALSE;
#if GTK_CHECK_VERSION(2,20,0)
if (force_hide || gtk_widget_get_visible (GTK_WIDGET (win))) if (force_hide || gtk_widget_get_visible (GTK_WIDGET (win)))
#else
if (force_hide || GTK_WIDGET_VISIBLE (win))
#endif
{ {
if (prefs.hex_gui_tray_away) if (prefs.hex_gui_tray_away)
hexchat_command (ph, "ALLSERV AWAY"); hexchat_command (ph, "ALLSERV AWAY");

View File

@ -1034,11 +1034,7 @@ gtk_xtext_realize (GtkWidget * widget)
gdk_window_set_user_data (widget->window, widget); gdk_window_set_user_data (widget->window, widget);
#if GTK_CHECK_VERSION(2,24,0)
xtext->depth = gdk_window_get_visual (widget->window)->depth; xtext->depth = gdk_window_get_visual (widget->window)->depth;
#else
xtext->depth = gdk_drawable_get_visual (widget->window)->depth;
#endif
val.subwindow_mode = GDK_INCLUDE_INFERIORS; val.subwindow_mode = GDK_INCLUDE_INFERIORS;
val.graphics_exposures = 0; val.graphics_exposures = 0;