diff options
author | Berke Viktor <bviktor@hexchat.org> | 2012-07-14 20:46:42 +0200 |
---|---|---|
committer | Berke Viktor <bviktor@hexchat.org> | 2012-07-14 20:46:42 +0200 |
commit | c80cb47e5cf49c7aa0b162fc509ab08fd1b17e8a (patch) | |
tree | f16850554ffab9559826c96e728a0297777e7659 /src | |
parent | a5cc3b15d7eb98c25ff58063079b969ad3b56e3f (diff) |
Update XChat to r1516
Diffstat (limited to 'src')
-rw-r--r-- | src/common/xchat.h | 5 | ||||
-rw-r--r-- | src/fe-gtk/chanview-tree.c | 4 | ||||
-rw-r--r-- | src/fe-gtk/fe-gtk.c | 7 | ||||
-rw-r--r-- | src/fe-gtk/fkeys.c | 4 | ||||
-rw-r--r-- | src/fe-gtk/gtkutil.c | 3 | ||||
-rw-r--r-- | src/fe-gtk/ignoregui.c | 4 | ||||
-rw-r--r-- | src/fe-gtk/menu.c | 9 | ||||
-rw-r--r-- | src/fe-gtk/xtext.c | 36 |
8 files changed, 5 insertions, 67 deletions
diff --git a/src/common/xchat.h b/src/common/xchat.h index 6ed5ebe2..329872d0 100644 --- a/src/common/xchat.h +++ b/src/common/xchat.h @@ -586,12 +586,7 @@ struct popup /* CL: get a random int in the range [0..n-1]. DON'T use rand() % n, it gives terrible results. */ #define RAND_INT(n) ((int)(rand() / (RAND_MAX + 1.0) * (n))) -#if defined(WIN32) && GLIB_CHECK_VERSION(2,4,0) #define xchat_filename_from_utf8 g_locale_from_utf8 #define xchat_filename_to_utf8 g_locale_to_utf8 -#else -#define xchat_filename_from_utf8 g_filename_from_utf8 -#define xchat_filename_to_utf8 g_filename_to_utf8 -#endif #endif diff --git a/src/fe-gtk/chanview-tree.c b/src/fe-gtk/chanview-tree.c index 5373f21b..88d1662b 100644 --- a/src/fe-gtk/chanview-tree.c +++ b/src/fe-gtk/chanview-tree.c @@ -100,10 +100,10 @@ cv_tree_init (chanview *cv) /*gtk_widget_modify_base (view, GTK_STATE_NORMAL, &colors[COL_BG]);*/ GTK_WIDGET_UNSET_FLAGS (view, GTK_CAN_FOCUS); gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (view), FALSE); -#if GTK_CHECK_VERSION(2,10,0) + if (!(prefs.gui_tweaks & 8)) gtk_tree_view_set_enable_tree_lines (GTK_TREE_VIEW (view), TRUE); -#endif + gtk_container_add (GTK_CONTAINER (win), view); /* icon column */ diff --git a/src/fe-gtk/fe-gtk.c b/src/fe-gtk/fe-gtk.c index 8c7e515a..4a20006a 100644 --- a/src/fe-gtk/fe-gtk.c +++ b/src/fe-gtk/fe-gtk.c @@ -908,13 +908,8 @@ fe_gui_info (session *sess, int info_type) if (!GTK_WIDGET_VISIBLE (GTK_WIDGET (sess->gui->window))) #endif return 2; /* hidden (iconified or systray) */ -#if GTK_CHECK_VERSION(2,4,0) + if (gtk_window_is_active (GTK_WINDOW (sess->gui->window))) -#else -#if GTK_CHECK_VERSION(2,2,0) - if (GTK_WINDOW (sess->gui->window)->is_active) -#endif -#endif return 1; /* active/focused */ return 0; /* normal (no keyboard focus or behind a window) */ diff --git a/src/fe-gtk/fkeys.c b/src/fe-gtk/fkeys.c index e4a7ff19..611697de 100644 --- a/src/fe-gtk/fkeys.c +++ b/src/fe-gtk/fkeys.c @@ -1544,11 +1544,7 @@ key_action_tab_comp (GtkWidget *t, GdkEventKey *entry, char *d1, char *d2, comp = 0; } -#if GLIB_CHECK_VERSION(2,4,0) list = g_completion_complete_utf8 (gcomp, comp ? old_gcomp.data : ent, &result); -#else - list = g_completion_complete (gcomp, comp ? old_gcomp.data : ent, &result); -#endif if (result == NULL) /* No matches found */ { diff --git a/src/fe-gtk/gtkutil.c b/src/fe-gtk/gtkutil.c index fe4e1737..7b4f8b06 100644 --- a/src/fe-gtk/gtkutil.c +++ b/src/fe-gtk/gtkutil.c @@ -436,10 +436,9 @@ gtkutil_file_req (const char *title, void *callback, void *userdata, char *filte gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER (dialog), temp); gtk_file_chooser_set_current_name (GTK_FILE_CHOOSER (dialog), file_part (filter)); } -#if GTK_CHECK_VERSION(2,8,0) + if (!(flags & FRF_NOASKOVERWRITE)) gtk_file_chooser_set_do_overwrite_confirmation (GTK_FILE_CHOOSER (dialog), TRUE); -#endif } else dialog = gtk_file_chooser_dialog_new (title, NULL, diff --git a/src/fe-gtk/ignoregui.c b/src/fe-gtk/ignoregui.c index 717f7d85..13cd8f0b 100644 --- a/src/fe-gtk/ignoregui.c +++ b/src/fe-gtk/ignoregui.c @@ -228,9 +228,6 @@ ignore_delete_entry_clicked (GtkWidget * wid, struct session *sess) if (gtkutil_treeview_get_selected (view, &iter, 0, &mask, -1)) { /* delete this row, select next one */ -#if (GTK_MAJOR_VERSION == 2) && (GTK_MINOR_VERSION == 0) - gtk_list_store_remove (store, &iter); -#else if (gtk_list_store_remove (store, &iter)) { path = gtk_tree_model_get_path (GTK_TREE_MODEL (store), &iter); @@ -238,7 +235,6 @@ ignore_delete_entry_clicked (GtkWidget * wid, struct session *sess) gtk_tree_view_set_cursor (view, path, NULL, FALSE); gtk_tree_path_free (path); } -#endif ignore_del (mask, NULL); g_free (mask); diff --git a/src/fe-gtk/menu.c b/src/fe-gtk/menu.c index 662608d3..c4912212 100644 --- a/src/fe-gtk/menu.c +++ b/src/fe-gtk/menu.c @@ -565,10 +565,8 @@ menu_destroy (GtkWidget *menu, gpointer objtounref) static void menu_popup (GtkWidget *menu, GdkEventButton *event, gpointer objtounref) { -#if (GTK_MAJOR_VERSION != 2) || (GTK_MINOR_VERSION != 0) if (event && event->window) gtk_menu_set_screen (GTK_MENU (menu), gdk_drawable_get_screen (event->window)); -#endif g_object_ref (menu); g_object_ref_sink (menu); @@ -1746,8 +1744,6 @@ create_icon_menu (char *labeltext, void *stock_name, int is_stock) return item; } -#if GTK_CHECK_VERSION(2,4,0) - /* Override the default GTK2.4 handler, which would make menu bindings not work when the menu-bar is hidden. */ static gboolean @@ -1761,9 +1757,6 @@ menu_canacaccel (GtkWidget *widget, guint signal_id, gpointer user_data) #endif } -#endif - - /* === STUFF FOR /MENU === */ static GtkMenuItem * @@ -2139,10 +2132,8 @@ menu_create_main (void *accel_group, int bar, int away, int toplevel, /* /MENU needs to know this later */ g_object_set_data (G_OBJECT (menu_bar), "accel", accel_group); -#if GTK_CHECK_VERSION(2,4,0) g_signal_connect (G_OBJECT (menu_bar), "can-activate-accel", G_CALLBACK (menu_canacaccel), 0); -#endif /* set the initial state of toggles */ mymenu[MENUBAR_OFFSET].state = !prefs.hidemenu; diff --git a/src/fe-gtk/xtext.c b/src/fe-gtk/xtext.c index 547affee..e23eaf83 100644 --- a/src/fe-gtk/xtext.c +++ b/src/fe-gtk/xtext.c @@ -1094,13 +1094,8 @@ gtk_xtext_realize (GtkWidget * widget) gdk_gc_set_fill (xtext->bgc, GDK_TILED); } -#if (GTK_MAJOR_VERSION == 2) && (GTK_MINOR_VERSION == 0) - xtext->hand_cursor = gdk_cursor_new (GDK_HAND1); - xtext->resize_cursor = gdk_cursor_new (GDK_LEFT_SIDE); -#else xtext->hand_cursor = gdk_cursor_new_for_display (gdk_drawable_get_display (widget->window), GDK_HAND1); xtext->resize_cursor = gdk_cursor_new_for_display (gdk_drawable_get_display (widget->window), GDK_LEFT_SIDE); -#endif gdk_window_set_back_pixmap (widget->window, NULL, FALSE); widget->style = gtk_style_attach (widget->style, widget->window); @@ -1368,11 +1363,7 @@ gtk_xtext_draw_marker (GtkXText * xtext, textentry * ent, int y) gdk_draw_line (xtext->draw_buf, xtext->marker_gc, x, render_y, x + width, render_y); -#if GTK_CHECK_VERSION(2,4,0) if (gtk_window_has_toplevel_focus (GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (xtext))))) -#else - if (GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (xtext)))->has_focus) -#endif { xtext->buffer->marker_seen = TRUE; } @@ -2160,13 +2151,8 @@ gtk_xtext_set_clip_owner (GtkWidget * xtext, GdkEventButton * event) str = gtk_xtext_selection_get_text (GTK_XTEXT (xtext), &len); if (str) { -#if (GTK_MAJOR_VERSION == 2) && (GTK_MINOR_VERSION == 0) - gtk_clipboard_set_text (gtk_clipboard_get (GDK_SELECTION_CLIPBOARD), - str, len); -#else gtk_clipboard_set_text (gtk_widget_get_clipboard (xtext, GDK_SELECTION_CLIPBOARD), str, len); -#endif free (str); } @@ -2516,16 +2502,10 @@ gtk_xtext_selection_get (GtkWidget * widget, gint format; gint new_length; -#if (GTK_MAJOR_VERSION == 2) && (GTK_MINOR_VERSION == 0) - gdk_string_to_compound_text ( - stripped, &encoding, &format, &new_text, - &new_length); -#else gdk_string_to_compound_text_for_display ( gdk_drawable_get_display (widget->window), stripped, &encoding, &format, &new_text, &new_length); -#endif gtk_selection_data_set (selection_data_ptr, encoding, format, new_text, new_length); gdk_free_compound_text (new_text); @@ -3876,14 +3856,9 @@ shade_pixmap (GtkXText * xtext, Pixmap p, int x, int y, int w, int h) #ifdef USE_SHM if (xtext->shm && shm_pixmaps) { -#if (GTK_MAJOR_VERSION == 2) && (GTK_MINOR_VERSION == 0) - shaded_pix = gdk_pixmap_foreign_new ( - XShmCreatePixmap (xdisplay, p, ximg->data, &xtext->shminfo, w, h, depth)); -#else shaded_pix = gdk_pixmap_foreign_new_for_display ( gdk_drawable_get_display (xtext->draw_buf), XShmCreatePixmap (xdisplay, p, ximg->data, &xtext->shminfo, w, h, depth)); -#endif } else #endif { @@ -4104,11 +4079,7 @@ gtk_xtext_load_trans (GtkXText * xtext) } else { noshade: -#if (GTK_MAJOR_VERSION == 2) && (GTK_MINOR_VERSION == 0) - xtext->pixmap = gdk_pixmap_foreign_new (rootpix); -#else xtext->pixmap = gdk_pixmap_foreign_new_for_display (gdk_drawable_get_display (GTK_WIDGET (xtext)->window), rootpix); -#endif gdk_gc_set_tile (xtext->bgc, xtext->pixmap); gdk_gc_set_ts_origin (xtext->bgc, -x, -y); xtext->ts_x = -x; @@ -5646,12 +5617,7 @@ gtk_xtext_append_entry (xtext_buffer *buf, textentry * ent, time_t stamp) if (buf->reset_marker_pos || ((buf->marker_pos == NULL || buf->marker_seen) && (buf->xtext->buffer != buf || -#if GTK_CHECK_VERSION(2,4,0) - !gtk_window_has_toplevel_focus (GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (buf->xtext)))) -#else - !(GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (buf->xtext))))->has_focus -#endif - ))) + !gtk_window_has_toplevel_focus (GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (buf->xtext))))))) { buf->marker_pos = ent; dontscroll (buf); /* force scrolling off */ |