First round of using GTK accessor functions

This is the first step to build with GSEAL_ENABLE
setup.c uses a deprecated fontchooser,
chanview-tabs.c didn't like the conversion, and
I am waiting to do some work on xtext.c before
converting it.
This commit is contained in:
TingPing 2013-05-12 01:43:27 -04:00
parent 9f8073ab77
commit ae04663aa9
18 changed files with 176 additions and 184 deletions

View File

@ -632,7 +632,7 @@ banlist_toggle (GtkWidget *item, gpointer data)
if (bit) /* Should be gassert() */ if (bit) /* Should be gassert() */
{ {
banl->checked &= ~bit; banl->checked &= ~bit;
banl->checked |= (GTK_TOGGLE_BUTTON (item)->active)? bit: 0; banl->checked |= (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (item)))? bit: 0;
banlist_do_refresh (banl); banlist_do_refresh (banl);
} }
} }

View File

@ -75,7 +75,7 @@ chanlist_match (server *serv, const char *str)
switch (serv->gui->chanlist_search_type) switch (serv->gui->chanlist_search_type)
{ {
case 1: case 1:
return match (GTK_ENTRY (serv->gui->chanlist_wild)->text, str); return match (gtk_entry_get_text (GTK_ENTRY (serv->gui->chanlist_wild)), str);
#ifndef WIN32 #ifndef WIN32
case 2: case 2:
if (!serv->gui->have_regex) if (!serv->gui->have_regex)
@ -84,7 +84,7 @@ chanlist_match (server *serv, const char *str)
return !regexec (&serv->gui->chanlist_match_regex, str, 1, NULL, REG_NOTBOL); return !regexec (&serv->gui->chanlist_match_regex, str, 1, NULL, REG_NOTBOL);
#endif #endif
default: /* case 0: */ default: /* case 0: */
return nocasestrstr (str, GTK_ENTRY (serv->gui->chanlist_wild)->text) ? 1 : 0; return nocasestrstr (str, gtk_entry_get_text (GTK_ENTRY (serv->gui->chanlist_wild))) ? 1 : 0;
} }
} }
@ -227,7 +227,7 @@ chanlist_place_row_in_gui (server *serv, chanlistrow *next_row, gboolean force)
return; return;
} }
if (GTK_ENTRY (serv->gui->chanlist_wild)->text[0]) if (gtk_entry_get_text (GTK_ENTRY (serv->gui->chanlist_wild))[0])
{ {
/* Check what the user wants to match. If both buttons or _neither_ /* Check what the user wants to match. If both buttons or _neither_
* button is checked, look for match in both by default. * button is checked, look for match in both by default.
@ -414,7 +414,7 @@ chanlist_find_cb (GtkWidget * wid, server *serv)
regfree (&serv->gui->chanlist_match_regex); regfree (&serv->gui->chanlist_match_regex);
} }
if (regcomp (&serv->gui->chanlist_match_regex, GTK_ENTRY (wid)->text, if (regcomp (&serv->gui->chanlist_match_regex, gtk_entry_get_text (GTK_ENTRY (wid)),
REG_ICASE | REG_EXTENDED | REG_NOSUB) == 0) REG_ICASE | REG_EXTENDED | REG_NOSUB) == 0)
serv->gui->have_regex = 1; serv->gui->have_regex = 1;
#endif #endif
@ -423,13 +423,13 @@ chanlist_find_cb (GtkWidget * wid, server *serv)
static void static void
chanlist_match_channel_button_toggled (GtkWidget * wid, server *serv) chanlist_match_channel_button_toggled (GtkWidget * wid, server *serv)
{ {
serv->gui->chanlist_match_wants_channel = GTK_TOGGLE_BUTTON (wid)->active; serv->gui->chanlist_match_wants_channel = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (wid));
} }
static void static void
chanlist_match_topic_button_toggled (GtkWidget * wid, server *serv) chanlist_match_topic_button_toggled (GtkWidget * wid, server *serv)
{ {
serv->gui->chanlist_match_wants_topic = GTK_TOGGLE_BUTTON (wid)->active; serv->gui->chanlist_match_wants_topic = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (wid));
} }
static char * static char *
@ -519,7 +519,7 @@ chanlist_save (GtkWidget * wid, server *serv)
static gboolean static gboolean
chanlist_flash (server *serv) chanlist_flash (server *serv)
{ {
if (serv->gui->chanlist_refresh->state != GTK_STATE_ACTIVE) if (gtk_widget_get_state (serv->gui->chanlist_refresh) != GTK_STATE_ACTIVE)
gtk_widget_set_state (serv->gui->chanlist_refresh, GTK_STATE_ACTIVE); gtk_widget_set_state (serv->gui->chanlist_refresh, GTK_STATE_ACTIVE);
else else
gtk_widget_set_state (serv->gui->chanlist_refresh, GTK_STATE_PRELIGHT); gtk_widget_set_state (serv->gui->chanlist_refresh, GTK_STATE_PRELIGHT);
@ -762,7 +762,7 @@ chanlist_opengui (server *serv, int do_refresh)
store = (GtkListStore *) custom_list_new(); store = (GtkListStore *) custom_list_new();
view = gtkutil_treeview_new (vbox, GTK_TREE_MODEL (store), NULL, -1); view = gtkutil_treeview_new (vbox, GTK_TREE_MODEL (store), NULL, -1);
gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (view->parent), gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (gtk_widget_get_parent (view)),
GTK_SHADOW_IN); GTK_SHADOW_IN);
serv->gui->chanlist_list = view; serv->gui->chanlist_list = view;

View File

@ -118,7 +118,7 @@ cv_tree_init (chanview *cv)
if (cv->style) if (cv->style)
gtk_widget_set_style (view, cv->style); gtk_widget_set_style (view, cv->style);
/*gtk_widget_modify_base (view, GTK_STATE_NORMAL, &colors[COL_BG]);*/ /*gtk_widget_modify_base (view, GTK_STATE_NORMAL, &colors[COL_BG]);*/
GTK_WIDGET_UNSET_FLAGS (view, GTK_CAN_FOCUS); gtk_widget_set_can_focus (view, FALSE);
gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (view), FALSE); gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (view), FALSE);
if (prefs.hex_gui_tab_dots) if (prefs.hex_gui_tab_dots)

View File

@ -769,7 +769,7 @@ dcc_exp_cb (GtkWidget *exp, GtkWidget *box)
static void static void
dcc_toggle (GtkWidget *item, gpointer data) dcc_toggle (GtkWidget *item, gpointer data)
{ {
if (GTK_TOGGLE_BUTTON (item)->active) if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (item)))
{ {
view_mode = GPOINTER_TO_INT (data); view_mode = GPOINTER_TO_INT (data);
dcc_fill_window (GPOINTER_TO_INT (data)); dcc_fill_window (GPOINTER_TO_INT (data));

View File

@ -796,7 +796,7 @@ fe_set_lag (server *serv, int lag)
if (sess->gui->lagometer) if (sess->gui->lagometer)
{ {
gtk_progress_bar_set_fraction ((GtkProgressBar *) sess->gui->lagometer, per); gtk_progress_bar_set_fraction ((GtkProgressBar *) sess->gui->lagometer, per);
add_tip (sess->gui->lagometer->parent, lagtip); add_tip (gtk_widget_get_parent (sess->gui->lagometer), lagtip);
} }
if (sess->gui->laginfo) if (sess->gui->laginfo)
gtk_label_set_text ((GtkLabel *) sess->gui->laginfo, lagtext); gtk_label_set_text ((GtkLabel *) sess->gui->laginfo, lagtext);
@ -842,7 +842,7 @@ fe_set_throttle (server *serv)
if (sess->gui->throttlemeter) if (sess->gui->throttlemeter)
{ {
gtk_progress_bar_set_fraction ((GtkProgressBar *) sess->gui->throttlemeter, per); gtk_progress_bar_set_fraction ((GtkProgressBar *) sess->gui->throttlemeter, per);
add_tip (sess->gui->throttlemeter->parent, tip); add_tip (gtk_widget_get_parent (sess->gui->throttlemeter), tip);
} }
if (sess->gui->throttleinfo) if (sess->gui->throttleinfo)
gtk_label_set_text ((GtkLabel *) sess->gui->throttleinfo, tbuf); gtk_label_set_text ((GtkLabel *) sess->gui->throttleinfo, tbuf);
@ -948,7 +948,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
return gdk_win32_window_get_impl_hwnd (sess->gui->window->window); return gdk_win32_window_get_impl_hwnd (gtk_widget_get_window (sess->gui->window));
#else #else
return sess->gui->window; return sess->gui->window;
#endif #endif

View File

@ -206,7 +206,7 @@ int SPELL_ENTRY_GET_POS (GtkWidget *entry);
void SPELL_ENTRY_SET_POS (GtkWidget *entry, int pos); void SPELL_ENTRY_SET_POS (GtkWidget *entry, int pos);
void SPELL_ENTRY_INSERT (GtkWidget *entry, const char *text, int len, int *pos); void SPELL_ENTRY_INSERT (GtkWidget *entry, const char *text, int len, int *pos);
#else #else
#define SPELL_ENTRY_GET_TEXT(e) (GTK_ENTRY(e)->text) #define SPELL_ENTRY_GET_TEXT(e) ((char *)(gtk_entry_get_text (GTK_ENTRY(e))))
#define SPELL_ENTRY_SET_TEXT(e,txt) gtk_entry_set_text(GTK_ENTRY(e),txt) #define SPELL_ENTRY_SET_TEXT(e,txt) gtk_entry_set_text(GTK_ENTRY(e),txt)
#define SPELL_ENTRY_SET_EDITABLE(e,v) gtk_editable_set_editable(GTK_EDITABLE(e),v) #define SPELL_ENTRY_SET_EDITABLE(e,v) gtk_editable_set_editable(GTK_EDITABLE(e),v)
#define SPELL_ENTRY_GET_POS(e) gtk_editable_get_position(GTK_EDITABLE(e)) #define SPELL_ENTRY_GET_POS(e) gtk_editable_get_position(GTK_EDITABLE(e))

View File

@ -569,7 +569,7 @@ key_dialog_sel_row (GtkWidget * clist, gint row, gint column,
static void static void
key_dialog_tog_key (GtkWidget * tog, int kstate) key_dialog_tog_key (GtkWidget * tog, int kstate)
{ {
int state = GTK_TOGGLE_BUTTON (tog)->active; int state = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (tog));
int row = gtkutil_clist_selection (key_dialog_kb_clist); int row = gtkutil_clist_selection (key_dialog_kb_clist);
struct key_binding *kb; struct key_binding *kb;
char buf[32]; char buf[32];
@ -1303,8 +1303,8 @@ key_action_scroll_page (GtkWidget * wid, GdkEventKey * evt, char *d1,
if (!sess) if (!sess)
return 0; return 0;
adj = GTK_RANGE (sess->gui->vscrollbar)->adjustment; adj = gtk_range_get_adjustment (GTK_RANGE (sess->gui->vscrollbar));
end = adj->upper - adj->lower - adj->page_size; end = gtk_adjustment_get_upper (adj) - gtk_adjustment_get_lower (adj) - gtk_adjustment_get_page_size (adj);
switch (type) switch (type)
{ {
@ -1317,19 +1317,19 @@ key_action_scroll_page (GtkWidget * wid, GdkEventKey * evt, char *d1,
break; break;
case PAGE_UP: case PAGE_UP:
value = adj->value - (adj->page_size - 1); value = gtk_adjustment_get_value (adj) - (gtk_adjustment_get_page_size (adj) - 1);
break; break;
case PAGE_DOWN: case PAGE_DOWN:
value = adj->value + (adj->page_size - 1); value = gtk_adjustment_get_value (adj) + (gtk_adjustment_get_page_size (adj) - 1);
break; break;
case LINE_UP: case LINE_UP:
value = adj->value - 1.0; value = gtk_adjustment_get_value (adj) - 1.0;
break; break;
case LINE_DOWN: case LINE_DOWN:
value = adj->value + 1.0; value = gtk_adjustment_get_value (adj) + 1.0;
break; break;
} }

View File

@ -325,8 +325,9 @@ fe_get_str (char *msg, char *def, void *callback, void *userdata)
GTK_STOCK_CANCEL, GTK_RESPONSE_REJECT, GTK_STOCK_CANCEL, GTK_RESPONSE_REJECT,
GTK_STOCK_OK, GTK_RESPONSE_ACCEPT, GTK_STOCK_OK, GTK_RESPONSE_ACCEPT,
NULL); NULL);
gtk_box_set_homogeneous (GTK_BOX (GTK_DIALOG (dialog)->vbox), TRUE);
gtk_window_set_transient_for (GTK_WINDOW (dialog), GTK_WINDOW (parent_window)); gtk_window_set_transient_for (GTK_WINDOW (dialog), GTK_WINDOW (parent_window));
gtk_box_set_homogeneous (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (dialog))), TRUE);
if (userdata == (void *)1) /* nick box is usually on the very bottom, make it centered */ if (userdata == (void *)1) /* nick box is usually on the very bottom, make it centered */
{ {
@ -354,7 +355,7 @@ fe_get_str (char *msg, char *def, void *callback, void *userdata)
g_signal_connect (G_OBJECT (dialog), "response", g_signal_connect (G_OBJECT (dialog), "response",
G_CALLBACK (gtkutil_get_str_response), entry); G_CALLBACK (gtkutil_get_str_response), entry);
gtk_container_add (GTK_CONTAINER (GTK_DIALOG (dialog)->vbox), hbox); gtk_container_add (GTK_CONTAINER (gtk_dialog_get_content_area (GTK_DIALOG (dialog))), hbox);
gtk_widget_show_all (dialog); gtk_widget_show_all (dialog);
} }
@ -397,7 +398,7 @@ fe_get_int (char *msg, int def, void *callback, void *userdata)
GTK_STOCK_CANCEL, GTK_RESPONSE_REJECT, GTK_STOCK_CANCEL, GTK_RESPONSE_REJECT,
GTK_STOCK_OK, GTK_RESPONSE_ACCEPT, GTK_STOCK_OK, GTK_RESPONSE_ACCEPT,
NULL); NULL);
gtk_box_set_homogeneous (GTK_BOX (GTK_DIALOG (dialog)->vbox), TRUE); gtk_box_set_homogeneous (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (dialog))), TRUE);
gtk_window_set_position (GTK_WINDOW (dialog), GTK_WIN_POS_MOUSE); gtk_window_set_position (GTK_WINDOW (dialog), GTK_WIN_POS_MOUSE);
gtk_window_set_transient_for (GTK_WINDOW (dialog), GTK_WINDOW (parent_window)); gtk_window_set_transient_for (GTK_WINDOW (dialog), GTK_WINDOW (parent_window));
@ -408,9 +409,9 @@ fe_get_int (char *msg, int def, void *callback, void *userdata)
spin = gtk_spin_button_new (NULL, 1, 0); spin = gtk_spin_button_new (NULL, 1, 0);
adj = gtk_spin_button_get_adjustment ((GtkSpinButton*)spin); adj = gtk_spin_button_get_adjustment ((GtkSpinButton*)spin);
adj->lower = 0; gtk_adjustment_set_lower (adj, 0);
adj->upper = 1024; gtk_adjustment_set_upper (adj, 1024);
adj->step_increment = 1; gtk_adjustment_set_step_increment (adj, 1);
gtk_adjustment_changed (adj); gtk_adjustment_changed (adj);
gtk_spin_button_set_value ((GtkSpinButton*)spin, def); gtk_spin_button_set_value ((GtkSpinButton*)spin, def);
gtk_box_pack_end (GTK_BOX (hbox), spin, 0, 0, 0); gtk_box_pack_end (GTK_BOX (hbox), spin, 0, 0, 0);
@ -421,7 +422,7 @@ fe_get_int (char *msg, int def, void *callback, void *userdata)
g_signal_connect (G_OBJECT (dialog), "response", g_signal_connect (G_OBJECT (dialog), "response",
G_CALLBACK (gtkutil_get_number_response), spin); G_CALLBACK (gtkutil_get_number_response), spin);
gtk_container_add (GTK_CONTAINER (GTK_DIALOG (dialog)->vbox), hbox); gtk_container_add (GTK_CONTAINER (gtk_dialog_get_content_area (GTK_DIALOG (dialog))), hbox);
gtk_widget_show_all (dialog); gtk_widget_show_all (dialog);
} }
@ -570,7 +571,7 @@ add_tip (GtkWidget * wid, char *text)
void void
show_and_unfocus (GtkWidget * wid) show_and_unfocus (GtkWidget * wid)
{ {
GTK_WIDGET_UNSET_FLAGS (wid, GTK_CAN_FOCUS); gtk_widget_set_can_focus (wid, FALSE);
gtk_widget_show (wid); gtk_widget_show (wid);
} }
@ -621,7 +622,7 @@ gtkutil_copy_to_clipboard (GtkWidget *widget, GdkAtom selection,
GtkClipboard *clip, *clip2; GtkClipboard *clip, *clip2;
win = gtk_widget_get_toplevel (GTK_WIDGET (widget)); win = gtk_widget_get_toplevel (GTK_WIDGET (widget));
if (GTK_WIDGET_TOPLEVEL (win)) if (gtk_widget_is_toplevel (win))
{ {
int len = strlen (str); int len = strlen (str);

View File

@ -43,7 +43,7 @@
static void static void
joind_radio2_cb (GtkWidget *radio, server *serv) joind_radio2_cb (GtkWidget *radio, server *serv)
{ {
if (GTK_TOGGLE_BUTTON (radio)->active) if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (radio)))
{ {
gtk_widget_grab_focus (serv->gui->joind_entry); gtk_widget_grab_focus (serv->gui->joind_entry);
gtk_editable_set_position (GTK_EDITABLE (serv->gui->joind_entry), 999); gtk_editable_set_position (GTK_EDITABLE (serv->gui->joind_entry), 999);
@ -79,13 +79,13 @@ joind_ok_cb (GtkWidget *ok, server *serv)
} }
/* do nothing */ /* do nothing */
if (GTK_TOGGLE_BUTTON (serv->gui->joind_radio1)->active) if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (serv->gui->joind_radio1)))
goto xit; goto xit;
/* join specific channel */ /* join specific channel */
if (GTK_TOGGLE_BUTTON (serv->gui->joind_radio2)->active) if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (serv->gui->joind_radio2)))
{ {
char *text = GTK_ENTRY (serv->gui->joind_entry)->text; char *text = (char *)gtk_entry_get_text (GTK_ENTRY (serv->gui->joind_entry));
if (strlen (text) < 2) if (strlen (text) < 2)
{ {
fe_message (_("Channel name too short, try again."), FE_MSG_ERROR); fe_message (_("Channel name too short, try again."), FE_MSG_ERROR);
@ -100,7 +100,7 @@ joind_ok_cb (GtkWidget *ok, server *serv)
xit: xit:
prefs.hex_gui_join_dialog = 0; prefs.hex_gui_join_dialog = 0;
if (GTK_TOGGLE_BUTTON (serv->gui->joind_check)->active) if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (serv->gui->joind_check)))
prefs.hex_gui_join_dialog = 1; prefs.hex_gui_join_dialog = 1;
gtk_widget_destroy (serv->gui->joind_win); gtk_widget_destroy (serv->gui->joind_win);
@ -134,7 +134,7 @@ joind_show_dialog (server *serv)
gtk_window_set_type_hint (GTK_WINDOW (dialog1), GDK_WINDOW_TYPE_HINT_DIALOG); gtk_window_set_type_hint (GTK_WINDOW (dialog1), GDK_WINDOW_TYPE_HINT_DIALOG);
gtk_window_set_position (GTK_WINDOW (dialog1), GTK_WIN_POS_MOUSE); gtk_window_set_position (GTK_WINDOW (dialog1), GTK_WIN_POS_MOUSE);
dialog_vbox1 = GTK_DIALOG (dialog1)->vbox; dialog_vbox1 = gtk_dialog_get_content_area (GTK_DIALOG (dialog1));
gtk_widget_show (dialog_vbox1); gtk_widget_show (dialog_vbox1);
vbox1 = gtk_vbox_new (FALSE, 0); vbox1 = gtk_vbox_new (FALSE, 0);
@ -167,7 +167,7 @@ joind_show_dialog (server *serv)
label = gtk_label_new (_("In the Server-List window, no channel (chat room) has been entered to be automatically joined for this network.")); label = gtk_label_new (_("In the Server-List window, no channel (chat room) has been entered to be automatically joined for this network."));
gtk_widget_show (label); gtk_widget_show (label);
gtk_box_pack_start (GTK_BOX (vbox2), label, FALSE, FALSE, 0); gtk_box_pack_start (GTK_BOX (vbox2), label, FALSE, FALSE, 0);
GTK_LABEL (label)->wrap = TRUE; gtk_label_set_line_wrap (GTK_LABEL (label), TRUE);
gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5); gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5);
label = gtk_label_new (_("What would you like to do next?")); label = gtk_label_new (_("What would you like to do next?"));
@ -223,14 +223,14 @@ joind_show_dialog (server *serv)
gtk_widget_show (checkbutton1); gtk_widget_show (checkbutton1);
gtk_box_pack_start (GTK_BOX (vbox1), checkbutton1, FALSE, FALSE, 0); gtk_box_pack_start (GTK_BOX (vbox1), checkbutton1, FALSE, FALSE, 0);
dialog_action_area1 = GTK_DIALOG (dialog1)->action_area; dialog_action_area1 = gtk_dialog_get_action_area (GTK_DIALOG (dialog1));
gtk_widget_show (dialog_action_area1); gtk_widget_show (dialog_action_area1);
gtk_button_box_set_layout (GTK_BUTTON_BOX (dialog_action_area1), GTK_BUTTONBOX_END); gtk_button_box_set_layout (GTK_BUTTON_BOX (dialog_action_area1), GTK_BUTTONBOX_END);
okbutton1 = gtk_button_new_from_stock ("gtk-ok"); okbutton1 = gtk_button_new_from_stock ("gtk-ok");
gtk_widget_show (okbutton1); gtk_widget_show (okbutton1);
gtk_box_pack_end (GTK_BOX (GTK_DIALOG (dialog1)->action_area), okbutton1, FALSE, TRUE, 0); gtk_box_pack_end (GTK_BOX (gtk_dialog_get_action_area (GTK_DIALOG (dialog1))), okbutton1, FALSE, TRUE, 0);
GTK_WIDGET_SET_FLAGS (okbutton1, GTK_CAN_DEFAULT); gtk_widget_set_can_default (okbutton1, TRUE);
g_signal_connect (G_OBJECT (dialog1), "destroy", g_signal_connect (G_OBJECT (dialog1), "destroy",
G_CALLBACK (joind_destroy_cb), serv); G_CALLBACK (joind_destroy_cb), serv);

View File

@ -298,7 +298,7 @@ fe_set_tab_color (struct session *sess, int col)
static void static void
mg_set_myself_away (session_gui *gui, gboolean away) mg_set_myself_away (session_gui *gui, gboolean away)
{ {
gtk_label_set_attributes (GTK_LABEL (GTK_BIN (gui->nick_label)->child), gtk_label_set_attributes (GTK_LABEL (gtk_bin_get_child (GTK_BIN (gui->nick_label))),
away ? away_list : NULL); away ? away_list : NULL);
} }
@ -545,11 +545,7 @@ mg_show_generic_tab (GtkWidget *box)
int num; int num;
GtkWidget *f = NULL; GtkWidget *f = NULL;
#if defined(GTK_WIDGET_HAS_FOCUS)
if (current_sess && GTK_WIDGET_HAS_FOCUS (current_sess->gui->input_box))
#else
if (current_sess && gtk_widget_has_focus (current_sess->gui->input_box)) if (current_sess && gtk_widget_has_focus (current_sess->gui->input_box))
#endif
f = current_sess->gui->input_box; f = current_sess->gui->input_box;
num = gtk_notebook_page_num (GTK_NOTEBOOK (mg_gui->note_book), box); num = gtk_notebook_page_num (GTK_NOTEBOOK (mg_gui->note_book), box);
@ -658,16 +654,16 @@ mg_unpopulate (session *sess)
res = sess->res; res = sess->res;
res->input_text = strdup (SPELL_ENTRY_GET_TEXT (gui->input_box)); res->input_text = strdup (SPELL_ENTRY_GET_TEXT (gui->input_box));
res->topic_text = strdup (GTK_ENTRY (gui->topic_entry)->text); res->topic_text = strdup (gtk_entry_get_text (GTK_ENTRY (gui->topic_entry)));
res->limit_text = strdup (GTK_ENTRY (gui->limit_entry)->text); res->limit_text = strdup (gtk_entry_get_text (GTK_ENTRY (gui->limit_entry)));
res->key_text = strdup (GTK_ENTRY (gui->key_entry)->text); res->key_text = strdup (gtk_entry_get_text (GTK_ENTRY (gui->key_entry)));
if (gui->laginfo) if (gui->laginfo)
res->lag_text = strdup (gtk_label_get_text (GTK_LABEL (gui->laginfo))); res->lag_text = strdup (gtk_label_get_text (GTK_LABEL (gui->laginfo)));
if (gui->throttleinfo) if (gui->throttleinfo)
res->queue_text = strdup (gtk_label_get_text (GTK_LABEL (gui->throttleinfo))); res->queue_text = strdup (gtk_label_get_text (GTK_LABEL (gui->throttleinfo)));
for (i = 0; i < NUM_FLAG_WIDS - 1; i++) for (i = 0; i < NUM_FLAG_WIDS - 1; i++)
res->flag_wid_state[i] = GTK_TOGGLE_BUTTON (gui->flag_wid[i])->active; res->flag_wid_state[i] = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (gui->flag_wid[i]));
res->old_ul_value = userlist_get_value (gui->user_tree); res->old_ul_value = userlist_get_value (gui->user_tree);
if (gui->lagometer) if (gui->lagometer)
@ -749,9 +745,9 @@ mg_set_topic_tip (session *sess)
add_tip (sess->gui->topic_entry, _("No topic is set")); add_tip (sess->gui->topic_entry, _("No topic is set"));
break; break;
default: default:
if (GTK_ENTRY (sess->gui->topic_entry)->text && if (gtk_entry_get_text (GTK_ENTRY (sess->gui->topic_entry)) &&
GTK_ENTRY (sess->gui->topic_entry)->text[0]) gtk_entry_get_text (GTK_ENTRY (sess->gui->topic_entry))[0])
add_tip (sess->gui->topic_entry, GTK_ENTRY (sess->gui->topic_entry)->text); add_tip (sess->gui->topic_entry, (char *)gtk_entry_get_text (GTK_ENTRY (sess->gui->topic_entry)));
else else
add_tip (sess->gui->topic_entry, NULL); add_tip (sess->gui->topic_entry, NULL);
} }
@ -760,13 +756,8 @@ mg_set_topic_tip (session *sess)
static void static void
mg_hide_empty_pane (GtkPaned *pane) mg_hide_empty_pane (GtkPaned *pane)
{ {
#if defined(GTK_WIDGET_VISIBLE) if ((gtk_paned_get_child1 (pane) == NULL || !gtk_widget_get_visible (gtk_paned_get_child1 (pane))) &&
if ((pane->child1 == NULL || !GTK_WIDGET_VISIBLE (pane->child1)) && (gtk_paned_get_child2 (pane) == NULL || !gtk_widget_get_visible (gtk_paned_get_child2 (pane))))
(pane->child2 == NULL || !GTK_WIDGET_VISIBLE (pane->child2)))
#else
if ((pane->child1 == NULL || !gtk_widget_get_visible (pane->child1)) &&
(pane->child2 == NULL || !gtk_widget_get_visible (pane->child2)))
#endif
{ {
gtk_widget_hide (GTK_WIDGET (pane)); gtk_widget_hide (GTK_WIDGET (pane));
return; return;
@ -789,6 +780,7 @@ mg_userlist_showhide (session *sess, int show)
session_gui *gui = sess->gui; session_gui *gui = sess->gui;
int handle_size; int handle_size;
int right_size; int right_size;
GtkAllocation allocation;
right_size = MAX (prefs.hex_gui_pane_right_size, prefs.hex_gui_pane_right_size_min); right_size = MAX (prefs.hex_gui_pane_right_size, prefs.hex_gui_pane_right_size_min);
@ -797,8 +789,9 @@ mg_userlist_showhide (session *sess, int show)
gtk_widget_show (gui->user_box); gtk_widget_show (gui->user_box);
gui->ul_hidden = 0; gui->ul_hidden = 0;
gtk_widget_get_allocation (gui->hpane_right, &allocation);
gtk_widget_style_get (GTK_WIDGET (gui->hpane_right), "handle-size", &handle_size, NULL); gtk_widget_style_get (GTK_WIDGET (gui->hpane_right), "handle-size", &handle_size, NULL);
gtk_paned_set_position (GTK_PANED (gui->hpane_right), GTK_WIDGET (gui->hpane_right)->allocation.width - (right_size + handle_size)); gtk_paned_set_position (GTK_PANED (gui->hpane_right), allocation.width - (right_size + handle_size));
} }
else else
{ {
@ -895,6 +888,7 @@ mg_populate (session *sess)
restore_gui *res = sess->res; restore_gui *res = sess->res;
int i, render = TRUE; int i, render = TRUE;
guint16 vis = gui->ul_hidden; guint16 vis = gui->ul_hidden;
GtkAllocation allocation;
switch (sess->type) switch (sess->type)
{ {
@ -935,7 +929,8 @@ mg_populate (session *sess)
/* xtext size change? Then don't render, wait for the expose caused /* xtext size change? Then don't render, wait for the expose caused
by showing/hidding the userlist */ by showing/hidding the userlist */
if (vis != gui->ul_hidden && gui->user_box->allocation.width > 1) gtk_widget_get_allocation (gui->user_box, &allocation);
if (vis != gui->ul_hidden && allocation.width > 1)
render = FALSE; render = FALSE;
gtk_xtext_buffer_show (GTK_XTEXT (gui->xtext), res->buffer, render); gtk_xtext_buffer_show (GTK_XTEXT (gui->xtext), res->buffer, render);
@ -982,14 +977,14 @@ mg_populate (session *sess)
gtk_progress_bar_set_fraction (GTK_PROGRESS_BAR (gui->lagometer), gtk_progress_bar_set_fraction (GTK_PROGRESS_BAR (gui->lagometer),
res->lag_value); res->lag_value);
if (res->lag_tip) if (res->lag_tip)
add_tip (sess->gui->lagometer->parent, res->lag_tip); add_tip (gtk_widget_get_parent (sess->gui->lagometer), res->lag_tip);
} }
if (gui->throttlemeter) if (gui->throttlemeter)
{ {
gtk_progress_bar_set_fraction (GTK_PROGRESS_BAR (gui->throttlemeter), gtk_progress_bar_set_fraction (GTK_PROGRESS_BAR (gui->throttlemeter),
res->queue_value); res->queue_value);
if (res->queue_tip) if (res->queue_tip)
add_tip (sess->gui->throttlemeter->parent, res->queue_tip); add_tip (gtk_widget_get_parent (sess->gui->throttlemeter), res->queue_tip);
} }
/* did this tab have a connecting graph? restore it.. */ /* did this tab have a connecting graph? restore it.. */
@ -1000,7 +995,7 @@ mg_populate (session *sess)
} }
/* menu items */ /* menu items */
GTK_CHECK_MENU_ITEM (gui->menu_item[MENU_ID_AWAY])->active = sess->server->is_away; gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (gui->menu_item[MENU_ID_AWAY]), sess->server->is_away);
gtk_widget_set_sensitive (gui->menu_item[MENU_ID_AWAY], sess->server->connected); gtk_widget_set_sensitive (gui->menu_item[MENU_ID_AWAY], sess->server->connected);
gtk_widget_set_sensitive (gui->menu_item[MENU_ID_JOIN], sess->server->end_of_motd); gtk_widget_set_sensitive (gui->menu_item[MENU_ID_JOIN], sess->server->end_of_motd);
gtk_widget_set_sensitive (gui->menu_item[MENU_ID_DISCONNECT], gtk_widget_set_sensitive (gui->menu_item[MENU_ID_DISCONNECT],
@ -1241,7 +1236,7 @@ mg_open_quit_dialog (gboolean minimize_button)
gtk_window_set_resizable (GTK_WINDOW (dialog), FALSE); gtk_window_set_resizable (GTK_WINDOW (dialog), FALSE);
gtk_dialog_set_has_separator (GTK_DIALOG (dialog), FALSE); gtk_dialog_set_has_separator (GTK_DIALOG (dialog), FALSE);
dialog_vbox1 = GTK_DIALOG (dialog)->vbox; dialog_vbox1 = gtk_dialog_get_content_area (GTK_DIALOG (dialog));
gtk_widget_show (dialog_vbox1); gtk_widget_show (dialog_vbox1);
table1 = gtk_table_new (2, 2, FALSE); table1 = gtk_table_new (2, 2, FALSE);
@ -1278,7 +1273,7 @@ mg_open_quit_dialog (gboolean minimize_button)
gtk_label_set_use_markup (GTK_LABEL (label), TRUE); gtk_label_set_use_markup (GTK_LABEL (label), TRUE);
gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5); gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5);
dialog_action_area1 = GTK_DIALOG (dialog)->action_area; dialog_action_area1 = gtk_dialog_get_action_area (GTK_DIALOG (dialog));
gtk_widget_show (dialog_action_area1); gtk_widget_show (dialog_action_area1);
gtk_button_box_set_layout (GTK_BUTTON_BOX (dialog_action_area1), gtk_button_box_set_layout (GTK_BUTTON_BOX (dialog_action_area1),
GTK_BUTTONBOX_END); GTK_BUTTONBOX_END);
@ -1305,12 +1300,12 @@ mg_open_quit_dialog (gboolean minimize_button)
switch (gtk_dialog_run (GTK_DIALOG (dialog))) switch (gtk_dialog_run (GTK_DIALOG (dialog)))
{ {
case 0: case 0:
if (GTK_TOGGLE_BUTTON (checkbutton1)->active) if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (checkbutton1)))
prefs.hex_gui_quit_dialog = 0; prefs.hex_gui_quit_dialog = 0;
hexchat_exit (); hexchat_exit ();
break; break;
case 1: /* minimize to tray */ case 1: /* minimize to tray */
if (GTK_TOGGLE_BUTTON (checkbutton1)->active) if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (checkbutton1)))
{ {
prefs.hex_gui_tray_close = 1; prefs.hex_gui_tray_close = 1;
/*prefs.hex_gui_quit_dialog = 0;*/ /*prefs.hex_gui_quit_dialog = 0;*/
@ -1474,7 +1469,7 @@ mg_markup_item (GtkWidget *menu, char *text, int arg)
GtkWidget *item; GtkWidget *item;
item = gtk_menu_item_new_with_label (""); item = gtk_menu_item_new_with_label ("");
gtk_label_set_markup (GTK_LABEL (GTK_BIN (item)->child), text); gtk_label_set_markup (GTK_LABEL (gtk_bin_get_child (GTK_BIN (item))), text);
g_signal_connect (G_OBJECT (item), "activate", g_signal_connect (G_OBJECT (item), "activate",
G_CALLBACK (mg_color_insert), GINT_TO_POINTER (arg)); G_CALLBACK (mg_color_insert), GINT_TO_POINTER (arg));
gtk_menu_shell_append (GTK_MENU_SHELL (menu), item); gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);
@ -1540,7 +1535,7 @@ mg_set_guint8 (GtkCheckMenuItem *item, guint8 *setting)
guint8 logging = sess->text_logging; guint8 logging = sess->text_logging;
*setting = SET_OFF; *setting = SET_OFF;
if (item->active) if (gtk_check_menu_item_get_active (item))
*setting = SET_ON; *setting = SET_ON;
/* has the logging setting changed? */ /* has the logging setting changed? */
@ -1608,7 +1603,7 @@ mg_create_tabmenu (session *sess, GdkEventButton *event, chan *ch)
g_free (name); g_free (name);
item = gtk_menu_item_new_with_label (""); item = gtk_menu_item_new_with_label ("");
gtk_label_set_markup (GTK_LABEL (GTK_BIN (item)->child), buf); gtk_label_set_markup (GTK_LABEL (gtk_bin_get_child (GTK_BIN (item))), buf);
gtk_menu_shell_append (GTK_MENU_SHELL (menu), item); gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);
gtk_widget_show (item); gtk_widget_show (item);
@ -1713,7 +1708,7 @@ mg_dialog_dnd_drop (GtkWidget * widget, GdkDragContext * context, gint x,
{ {
if (current_sess->type == SESS_DIALOG) if (current_sess->type == SESS_DIALOG)
/* sess->channel is really the nickname of dialogs */ /* sess->channel is really the nickname of dialogs */
mg_dnd_drop_file (current_sess, current_sess->channel, selection_data->data); mg_dnd_drop_file (current_sess, current_sess->channel, (char *)gtk_selection_data_get_data (selection_data));
} }
/* add a tabbed channel */ /* add a tabbed channel */
@ -1804,7 +1799,7 @@ mg_topic_cb (GtkWidget *entry, gpointer userdata)
if (sess->channel[0] && sess->server->connected && sess->type == SESS_CHANNEL) if (sess->channel[0] && sess->server->connected && sess->type == SESS_CHANNEL)
{ {
text = GTK_ENTRY (entry)->text; text = (char *)gtk_entry_get_text (GTK_ENTRY (entry));
if (text[0] == 0) if (text[0] == 0)
text = NULL; text = NULL;
sess->server->p_topic (sess->server, sess->channel, text); sess->server->p_topic (sess->server, sess->channel, text);
@ -1946,7 +1941,7 @@ mg_change_flag (GtkWidget * wid, session *sess, char flag)
mode[2] = '\0'; mode[2] = '\0';
if (serv->connected && sess->channel[0]) if (serv->connected && sess->channel[0])
{ {
if (GTK_TOGGLE_BUTTON (wid)->active) if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (wid)))
mode[0] = '+'; mode[0] = '+';
else else
mode[0] = '-'; mode[0] = '-';
@ -1964,7 +1959,7 @@ flagl_hit (GtkWidget * wid, struct session *sess)
const char *limit_str; const char *limit_str;
server *serv = sess->server; server *serv = sess->server;
if (GTK_TOGGLE_BUTTON (wid)->active) if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (wid)))
{ {
if (serv->connected && sess->channel[0]) if (serv->connected && sess->channel[0])
{ {
@ -1995,7 +1990,7 @@ flagk_hit (GtkWidget * wid, struct session *sess)
snprintf (modes, sizeof (modes), "-k %s", snprintf (modes, sizeof (modes), "-k %s",
gtk_entry_get_text (GTK_ENTRY (sess->gui->key_entry))); gtk_entry_get_text (GTK_ENTRY (sess->gui->key_entry)));
if (GTK_TOGGLE_BUTTON (wid)->active) if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (wid)))
modes[0] = '+'; modes[0] = '+';
serv->p_mode (serv, sess->channel, modes); serv->p_mode (serv, sess->channel, modes);
@ -2154,7 +2149,7 @@ mg_dialog_button_cb (GtkWidget *wid, char *cmd)
if (!current_sess) if (!current_sess)
return; return;
topic = (char *)(GTK_ENTRY (current_sess->gui->topic_entry)->text); topic = (char *)(gtk_entry_get_text (GTK_ENTRY (current_sess->gui->topic_entry)));
topic = strrchr (topic, '@'); topic = strrchr (topic, '@');
if (topic) if (topic)
host = topic + 1; host = topic + 1;
@ -2558,15 +2553,12 @@ static void
mg_rightpane_cb (GtkPaned *pane, GParamSpec *param, session_gui *gui) mg_rightpane_cb (GtkPaned *pane, GParamSpec *param, session_gui *gui)
{ {
int handle_size; int handle_size;
GtkAllocation allocation;
/* if (pane->child1 == NULL || (!GTK_WIDGET_VISIBLE (pane->child1)))
return;
if (pane->child2 == NULL || (!GTK_WIDGET_VISIBLE (pane->child2)))
return;*/
gtk_widget_style_get (GTK_WIDGET (pane), "handle-size", &handle_size, NULL); gtk_widget_style_get (GTK_WIDGET (pane), "handle-size", &handle_size, NULL);
/* record the position from the RIGHT side */ /* record the position from the RIGHT side */
prefs.hex_gui_pane_right_size = GTK_WIDGET (pane)->allocation.width - gtk_paned_get_position (pane) - handle_size; gtk_widget_get_allocation (GTK_WIDGET(pane), &allocation);
prefs.hex_gui_pane_right_size = allocation.width - gtk_paned_get_position (pane) - handle_size;
} }
static gboolean static gboolean
@ -2697,17 +2689,17 @@ mg_place_userlist_and_chanview_real (session_gui *gui, GtkWidget *userlist, GtkW
int unref_chanview = FALSE; int unref_chanview = FALSE;
/* first, remove userlist/treeview from their containers */ /* first, remove userlist/treeview from their containers */
if (userlist && userlist->parent) if (userlist && gtk_widget_get_parent (userlist))
{ {
g_object_ref (userlist); g_object_ref (userlist);
gtk_container_remove (GTK_CONTAINER (userlist->parent), userlist); gtk_container_remove (GTK_CONTAINER (gtk_widget_get_parent (userlist)), userlist);
unref_userlist = TRUE; unref_userlist = TRUE;
} }
if (chanview && chanview->parent) if (chanview && gtk_widget_get_parent (chanview))
{ {
g_object_ref (chanview); g_object_ref (chanview);
gtk_container_remove (GTK_CONTAINER (chanview->parent), chanview); gtk_container_remove (GTK_CONTAINER (gtk_widget_get_parent (chanview)), chanview);
unref_chanview = TRUE; unref_chanview = TRUE;
} }
@ -3036,7 +3028,7 @@ mg_create_entry (session *sess, GtkWidget *box)
gui->nick_label = but = gtk_button_new_with_label (sess->server->nick); gui->nick_label = but = gtk_button_new_with_label (sess->server->nick);
gtk_button_set_relief (GTK_BUTTON (but), GTK_RELIEF_NONE); gtk_button_set_relief (GTK_BUTTON (but), GTK_RELIEF_NONE);
GTK_WIDGET_UNSET_FLAGS (but, GTK_CAN_FOCUS); gtk_widget_set_can_focus (but, FALSE);
gtk_box_pack_end (GTK_BOX (gui->nick_box), but, 0, 0, 0); gtk_box_pack_end (GTK_BOX (gui->nick_box), but, 0, 0, 0);
g_signal_connect (G_OBJECT (but), "clicked", g_signal_connect (G_OBJECT (but), "clicked",
G_CALLBACK (mg_nickclick_cb), NULL); G_CALLBACK (mg_nickclick_cb), NULL);
@ -3517,7 +3509,7 @@ fe_update_mode_buttons (session *sess, char mode, char sign)
if (!sess->gui->is_tab || sess == current_tab) if (!sess->gui->is_tab || sess == current_tab)
{ {
ignore_chanmode = TRUE; ignore_chanmode = TRUE;
if (GTK_TOGGLE_BUTTON (sess->gui->flag_wid[i])->active != state) if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (sess->gui->flag_wid[i])) != state)
gtk_toggle_button_set_active ( gtk_toggle_button_set_active (
GTK_TOGGLE_BUTTON (sess->gui->flag_wid[i]), state); GTK_TOGGLE_BUTTON (sess->gui->flag_wid[i]), state);
ignore_chanmode = FALSE; ignore_chanmode = FALSE;
@ -3561,7 +3553,7 @@ fe_set_away (server *serv)
{ {
if (!sess->gui->is_tab || sess == current_tab) if (!sess->gui->is_tab || sess == current_tab)
{ {
GTK_CHECK_MENU_ITEM (sess->gui->menu_item[MENU_ID_AWAY])->active = serv->is_away; gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (sess->gui->menu_item[MENU_ID_AWAY]), serv->is_away);
/* gray out my nickname */ /* gray out my nickname */
mg_set_myself_away (sess->gui, serv->is_away); mg_set_myself_away (sess->gui, serv->is_away);
} }
@ -3774,9 +3766,9 @@ is_child_of (GtkWidget *widget, GtkWidget *parent)
{ {
while (widget) while (widget)
{ {
if (widget->parent == parent) if (gtk_widget_get_parent (widget) == parent)
return TRUE; return TRUE;
widget = widget->parent; widget = gtk_widget_get_parent (widget);
} }
return FALSE; return FALSE;
} }
@ -3787,7 +3779,7 @@ mg_handle_drop (GtkWidget *widget, int y, int *pos, int *other_pos)
int height; int height;
session_gui *gui = current_sess->gui; session_gui *gui = current_sess->gui;
gdk_drawable_get_size (widget->window, NULL, &height); gdk_drawable_get_size (gtk_widget_get_window (widget), NULL, &height);
if (y < height / 2) if (y < height / 2)
{ {
@ -3832,10 +3824,10 @@ mg_is_gui_target (GdkDragContext *context)
{ {
char *target_name; char *target_name;
if (!context || !context->targets || !context->targets->data) if (!context || !gdk_drag_context_list_targets (context) || !gdk_drag_context_list_targets (context)->data)
return FALSE; return FALSE;
target_name = gdk_atom_name (context->targets->data); target_name = gdk_atom_name (gdk_drag_context_list_targets (context)->data);
if (target_name) if (target_name)
{ {
/* if it's not HEXCHAT_CHANVIEW or HEXCHAT_USERLIST */ /* if it's not HEXCHAT_CHANVIEW or HEXCHAT_USERLIST */
@ -3900,7 +3892,7 @@ mg_drag_drop_cb (GtkWidget *widget, GdkDragContext *context, int x, int y, guint
if (!mg_is_gui_target (context)) if (!mg_is_gui_target (context))
return FALSE; return FALSE;
switch (context->action) switch (gdk_drag_context_get_selected_action (context))
{ {
case GDK_ACTION_MOVE: case GDK_ACTION_MOVE:
/* from userlist */ /* from userlist */
@ -3927,10 +3919,8 @@ mg_drag_motion_cb (GtkWidget *widget, GdkDragContext *context, int x, int y, gui
GdkGCValues val; GdkGCValues val;
int half, width, height; int half, width, height;
int ox, oy; int ox, oy;
#if 0
GtkPaned *paned;
#endif
GdkDrawable *draw; GdkDrawable *draw;
GtkAllocation allocation;
/* ignore file drops */ /* ignore file drops */
if (!mg_is_gui_target (context)) if (!mg_is_gui_target (context))
@ -3938,24 +3928,25 @@ mg_drag_motion_cb (GtkWidget *widget, GdkDragContext *context, int x, int y, gui
if (scbar) /* scrollbar */ if (scbar) /* scrollbar */
{ {
ox = widget->allocation.x; gtk_widget_get_allocation (widget, &allocation);
oy = widget->allocation.y; ox = allocation.x;
width = widget->allocation.width; oy = allocation.y;
height = widget->allocation.height; width = allocation.width;
draw = widget->window; height = allocation.height;
draw = gtk_widget_get_window (widget);
} }
else else
{ {
ox = oy = 0; ox = oy = 0;
gdk_drawable_get_size (widget->window, &width, &height); gdk_drawable_get_size (gtk_widget_get_window (widget), &width, &height);
draw = widget->window; draw = gtk_widget_get_window (widget);
} }
val.subwindow_mode = GDK_INCLUDE_INFERIORS; val.subwindow_mode = GDK_INCLUDE_INFERIORS;
val.graphics_exposures = 0; val.graphics_exposures = 0;
val.function = GDK_XOR; val.function = GDK_XOR;
gc = gdk_gc_new_with_values (widget->window, &val, GDK_GC_EXPOSURES | GDK_GC_SUBWINDOW | GDK_GC_FUNCTION); gc = gdk_gc_new_with_values (gtk_widget_get_window (widget), &val, GDK_GC_EXPOSURES | GDK_GC_SUBWINDOW | GDK_GC_FUNCTION);
col.red = rand() % 0xffff; col.red = rand() % 0xffff;
col.green = rand() % 0xffff; col.green = rand() % 0xffff;
col.blue = rand() % 0xffff; col.blue = rand() % 0xffff;

View File

@ -297,9 +297,9 @@ menu_quick_item (char *cmd, char *label, GtkWidget * menu, int flags,
{ {
item = gtk_menu_item_new_with_label (""); item = gtk_menu_item_new_with_label ("");
if (flags & XCMENU_MNEMONIC) if (flags & XCMENU_MNEMONIC)
gtk_label_set_markup_with_mnemonic (GTK_LABEL (GTK_BIN (item)->child), label); gtk_label_set_markup_with_mnemonic (GTK_LABEL (gtk_bin_get_child (GTK_BIN (item))), label);
else else
gtk_label_set_markup (GTK_LABEL (GTK_BIN (item)->child), label); gtk_label_set_markup (GTK_LABEL (gtk_bin_get_child (GTK_BIN (item))), label);
} else } else
{ {
if (flags & XCMENU_MNEMONIC) if (flags & XCMENU_MNEMONIC)
@ -348,7 +348,7 @@ menu_quick_sub (char *name, GtkWidget *menu, GtkWidget **sub_item_ret, int flags
if (flags & XCMENU_MARKUP) if (flags & XCMENU_MARKUP)
{ {
sub_item = gtk_menu_item_new_with_label (""); sub_item = gtk_menu_item_new_with_label ("");
gtk_label_set_markup (GTK_LABEL (GTK_BIN (sub_item)->child), name); gtk_label_set_markup (GTK_LABEL (gtk_bin_get_child (GTK_BIN (sub_item))), name);
} }
else else
{ {
@ -388,7 +388,7 @@ toggle_cb (GtkWidget *item, char *pref_name)
{ {
char buf[256]; char buf[256];
if (GTK_CHECK_MENU_ITEM (item)->active) if (gtk_check_menu_item_get_active (GTK_CHECK_MENU_ITEM (item)))
snprintf (buf, sizeof (buf), "set %s 1", pref_name); snprintf (buf, sizeof (buf), "set %s 1", pref_name);
else else
snprintf (buf, sizeof (buf), "set %s 0", pref_name); snprintf (buf, sizeof (buf), "set %s 0", pref_name);
@ -700,7 +700,7 @@ fe_userlist_update (session *sess, struct User *user)
g_signal_handlers_disconnect_by_func (nick_submenu, menu_nickinfo_cb, sess); g_signal_handlers_disconnect_by_func (nick_submenu, menu_nickinfo_cb, sess);
/* destroy all the old items */ /* destroy all the old items */
items = ((GtkMenuShell *) nick_submenu)->children; items = gtk_container_get_children (GTK_CONTAINER (nick_submenu));
while (items) while (items)
{ {
next = items->next; next = items->next;
@ -832,7 +832,7 @@ menu_setting_foreach (void (*callback) (session *), int id, guint state)
if (sess->gui->is_tab) if (sess->gui->is_tab)
maindone = TRUE; maindone = TRUE;
if (id != -1) if (id != -1)
GTK_CHECK_MENU_ITEM (sess->gui->menu_item[id])->active = state; gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (sess->gui->menu_item[id]), state);
if (callback) if (callback)
callback (sess); callback (sess);
} }
@ -1143,7 +1143,7 @@ usermenu_create (GtkWidget *menu)
static void static void
usermenu_destroy (GtkWidget * menu) usermenu_destroy (GtkWidget * menu)
{ {
GList *items = ((GtkMenuShell *) menu)->children; GList *items = gtk_container_get_children (GTK_CONTAINER (menu));
GList *next; GList *next;
while (items) while (items)
@ -1332,7 +1332,7 @@ menu_join_cb (GtkWidget *dialog, gint response, GtkEntry *entry)
switch (response) switch (response)
{ {
case GTK_RESPONSE_ACCEPT: case GTK_RESPONSE_ACCEPT:
menu_chan_join (NULL, entry->text); menu_chan_join (NULL, (char *)gtk_entry_get_text (entry));
break; break;
case GTK_RESPONSE_HELP: case GTK_RESPONSE_HELP:
@ -1360,12 +1360,12 @@ menu_join (GtkWidget * wid, gpointer none)
GTK_STOCK_CANCEL, GTK_RESPONSE_REJECT, GTK_STOCK_CANCEL, GTK_RESPONSE_REJECT,
GTK_STOCK_OK, GTK_RESPONSE_ACCEPT, GTK_STOCK_OK, GTK_RESPONSE_ACCEPT,
NULL); NULL);
gtk_box_set_homogeneous (GTK_BOX (GTK_DIALOG (dialog)->vbox), TRUE); gtk_box_set_homogeneous (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (dialog))), TRUE);
gtk_window_set_position (GTK_WINDOW (dialog), GTK_WIN_POS_MOUSE); gtk_window_set_position (GTK_WINDOW (dialog), GTK_WIN_POS_MOUSE);
hbox = gtk_hbox_new (TRUE, 0); hbox = gtk_hbox_new (TRUE, 0);
entry = gtk_entry_new (); entry = gtk_entry_new ();
GTK_ENTRY (entry)->editable = 0; /* avoid auto-selection */ gtk_editable_set_editable (GTK_EDITABLE (entry), FALSE); /* avoid auto-selection */
gtk_entry_set_text (GTK_ENTRY (entry), "#"); gtk_entry_set_text (GTK_ENTRY (entry), "#");
g_signal_connect (G_OBJECT (entry), "activate", g_signal_connect (G_OBJECT (entry), "activate",
G_CALLBACK (menu_join_entry_cb), dialog); G_CALLBACK (menu_join_entry_cb), dialog);
@ -1377,7 +1377,7 @@ menu_join (GtkWidget * wid, gpointer none)
g_signal_connect (G_OBJECT (dialog), "response", g_signal_connect (G_OBJECT (dialog), "response",
G_CALLBACK (menu_join_cb), entry); G_CALLBACK (menu_join_cb), entry);
gtk_container_add (GTK_CONTAINER (GTK_DIALOG (dialog)->vbox), hbox); gtk_container_add (GTK_CONTAINER (gtk_dialog_get_content_area (GTK_DIALOG (dialog))), hbox);
gtk_widget_show_all (dialog); gtk_widget_show_all (dialog);
@ -1388,7 +1388,7 @@ menu_join (GtkWidget * wid, gpointer none)
static void static void
menu_away (GtkCheckMenuItem *item, gpointer none) menu_away (GtkCheckMenuItem *item, gpointer none)
{ {
handle_command (current_sess, item->active ? "away" : "back", FALSE); handle_command (current_sess, gtk_check_menu_item_get_active (item) ? "away" : "back", FALSE);
} }
static void static void
@ -1583,7 +1583,7 @@ static void
menu_layout_cb (GtkWidget *item, gpointer none) menu_layout_cb (GtkWidget *item, gpointer none)
{ {
prefs.hex_gui_tab_layout = 2; prefs.hex_gui_tab_layout = 2;
if (GTK_CHECK_MENU_ITEM (item)->active) if (gtk_check_menu_item_get_active (GTK_CHECK_MENU_ITEM (item)))
prefs.hex_gui_tab_layout = 0; prefs.hex_gui_tab_layout = 0;
menu_change_layout (); menu_change_layout ();
@ -1598,7 +1598,7 @@ menu_apply_metres_cb (session *sess)
static void static void
menu_metres_off (GtkWidget *item, gpointer none) menu_metres_off (GtkWidget *item, gpointer none)
{ {
if (GTK_CHECK_MENU_ITEM (item)->active) if (gtk_check_menu_item_get_active (GTK_CHECK_MENU_ITEM (item)))
{ {
prefs.hex_gui_lagometer = 0; prefs.hex_gui_lagometer = 0;
prefs.hex_gui_throttlemeter = 0; prefs.hex_gui_throttlemeter = 0;
@ -1609,7 +1609,7 @@ menu_metres_off (GtkWidget *item, gpointer none)
static void static void
menu_metres_text (GtkWidget *item, gpointer none) menu_metres_text (GtkWidget *item, gpointer none)
{ {
if (GTK_CHECK_MENU_ITEM (item)->active) if (gtk_check_menu_item_get_active (GTK_CHECK_MENU_ITEM (item)))
{ {
prefs.hex_gui_lagometer = 2; prefs.hex_gui_lagometer = 2;
prefs.hex_gui_throttlemeter = 2; prefs.hex_gui_throttlemeter = 2;
@ -1620,7 +1620,7 @@ menu_metres_text (GtkWidget *item, gpointer none)
static void static void
menu_metres_graph (GtkWidget *item, gpointer none) menu_metres_graph (GtkWidget *item, gpointer none)
{ {
if (GTK_CHECK_MENU_ITEM (item)->active) if (gtk_check_menu_item_get_active (GTK_CHECK_MENU_ITEM (item)))
{ {
prefs.hex_gui_lagometer = 1; prefs.hex_gui_lagometer = 1;
prefs.hex_gui_throttlemeter = 1; prefs.hex_gui_throttlemeter = 1;
@ -1631,7 +1631,7 @@ menu_metres_graph (GtkWidget *item, gpointer none)
static void static void
menu_metres_both (GtkWidget *item, gpointer none) menu_metres_both (GtkWidget *item, gpointer none)
{ {
if (GTK_CHECK_MENU_ITEM (item)->active) if (gtk_check_menu_item_get_active (GTK_CHECK_MENU_ITEM (item)))
{ {
prefs.hex_gui_lagometer = 3; prefs.hex_gui_lagometer = 3;
prefs.hex_gui_throttlemeter = 3; prefs.hex_gui_throttlemeter = 3;
@ -1827,7 +1827,7 @@ menu_canacaccel (GtkWidget *widget, guint signal_id, gpointer user_data)
static GtkMenuItem * static GtkMenuItem *
menu_find_item (GtkWidget *menu, char *name) menu_find_item (GtkWidget *menu, char *name)
{ {
GList *items = ((GtkMenuShell *) menu)->children; GList *items = gtk_container_get_children (GTK_CONTAINER (menu));
GtkMenuItem *item; GtkMenuItem *item;
GtkWidget *child; GtkWidget *child;
const char *labeltext; const char *labeltext;
@ -1835,7 +1835,7 @@ menu_find_item (GtkWidget *menu, char *name)
while (items) while (items)
{ {
item = items->data; item = items->data;
child = GTK_BIN (item)->child; child = gtk_bin_get_child (GTK_BIN (item));
if (child) /* separators arn't labels, skip them */ if (child) /* separators arn't labels, skip them */
{ {
labeltext = g_object_get_data (G_OBJECT (item), "name"); labeltext = g_object_get_data (G_OBJECT (item), "name");
@ -1932,7 +1932,7 @@ menu_update_cb (GtkWidget *menu, menu_entry *me, char *target)
gtk_widget_set_sensitive (item, me->enable); gtk_widget_set_sensitive (item, me->enable);
/* must do it without triggering the callback */ /* must do it without triggering the callback */
if (GTK_IS_CHECK_MENU_ITEM (item)) if (GTK_IS_CHECK_MENU_ITEM (item))
GTK_CHECK_MENU_ITEM (item)->active = me->state; gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (item), me->state);
} }
} }
@ -1941,7 +1941,7 @@ static void
menu_radio_cb (GtkCheckMenuItem *item, menu_entry *me) menu_radio_cb (GtkCheckMenuItem *item, menu_entry *me)
{ {
me->state = 0; me->state = 0;
if (item->active) if (gtk_check_menu_item_get_active (item))
me->state = 1; me->state = 1;
/* update the state, incase this was changed via right-click. */ /* update the state, incase this was changed via right-click. */
@ -1957,7 +1957,7 @@ static void
menu_toggle_cb (GtkCheckMenuItem *item, menu_entry *me) menu_toggle_cb (GtkCheckMenuItem *item, menu_entry *me)
{ {
me->state = 0; me->state = 0;
if (item->active) if (gtk_check_menu_item_get_active (item))
me->state = 1; me->state = 1;
/* update the state, incase this was changed via right-click. */ /* update the state, incase this was changed via right-click. */
@ -1999,7 +1999,7 @@ menu_reorder (GtkMenu *menu, GtkWidget *item, int pos)
return; return;
if (pos < 0) /* position offset from end/bottom */ if (pos < 0) /* position offset from end/bottom */
gtk_menu_reorder_child (menu, item, (g_list_length (GTK_MENU_SHELL (menu)->children) + pos) - 1); gtk_menu_reorder_child (menu, item, (g_list_length (gtk_container_get_children (GTK_CONTAINER (menu))) + pos) - 1);
else else
gtk_menu_reorder_child (menu, item, pos); gtk_menu_reorder_child (menu, item, pos);
} }
@ -2065,7 +2065,7 @@ menu_add_sub (GtkWidget *menu, menu_entry *me)
{ {
pos = me->pos; pos = me->pos;
if (pos < 0) /* position offset from end/bottom */ if (pos < 0) /* position offset from end/bottom */
pos = g_list_length (GTK_MENU_SHELL (menu)->children) + pos; pos = g_list_length (gtk_container_get_children (GTK_CONTAINER (menu))) + pos;
menu_quick_sub (me->label, menu, &item, me->markup ? XCMENU_MARKUP|XCMENU_MNEMONIC : XCMENU_MNEMONIC, pos); menu_quick_sub (me->label, menu, &item, me->markup ? XCMENU_MARKUP|XCMENU_MNEMONIC : XCMENU_MNEMONIC, pos);
} }
return item; return item;
@ -2333,7 +2333,7 @@ normalitem:
item = gtk_check_menu_item_new_with_mnemonic (_(mymenu[i].text)); item = gtk_check_menu_item_new_with_mnemonic (_(mymenu[i].text));
togitem: togitem:
/* must avoid callback for Radio buttons */ /* must avoid callback for Radio buttons */
GTK_CHECK_MENU_ITEM (item)->active = mymenu[i].state; gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (item), mymenu[i].state);
/*gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (item), /*gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (item),
mymenu[i].state);*/ mymenu[i].state);*/
if (mymenu[i].key != 0) if (mymenu[i].key != 0)

View File

@ -311,10 +311,10 @@ notifygui_add_cb (GtkDialog *dialog, gint response, gpointer entry)
char *networks; char *networks;
char *text; char *text;
text = GTK_ENTRY (entry)->text; text = (char *)gtk_entry_get_text (GTK_ENTRY (entry));
if (text[0] && response == GTK_RESPONSE_ACCEPT) if (text[0] && response == GTK_RESPONSE_ACCEPT)
{ {
networks = GTK_ENTRY (g_object_get_data (G_OBJECT (entry), "net"))->text; networks = gtk_entry_get_text (GTK_ENTRY (g_object_get_data (G_OBJECT (entry), "net")));
if (g_ascii_strcasecmp (networks, "ALL") == 0 || networks[0] == 0) if (g_ascii_strcasecmp (networks, "ALL") == 0 || networks[0] == 0)
notify_adduser (text, NULL); notify_adduser (text, NULL);
else else
@ -353,7 +353,7 @@ fe_notify_ask (char *nick, char *networks)
gtk_container_set_border_width (GTK_CONTAINER (table), 12); gtk_container_set_border_width (GTK_CONTAINER (table), 12);
gtk_table_set_row_spacings (GTK_TABLE (table), 3); gtk_table_set_row_spacings (GTK_TABLE (table), 3);
gtk_table_set_col_spacings (GTK_TABLE (table), 8); gtk_table_set_col_spacings (GTK_TABLE (table), 8);
gtk_container_add (GTK_CONTAINER (GTK_DIALOG (dialog)->vbox), table); gtk_container_add (GTK_CONTAINER (gtk_dialog_get_content_area (GTK_DIALOG (dialog))), table);
label = gtk_label_new (msg); label = gtk_label_new (msg);
gtk_table_attach_defaults (GTK_TABLE (table), label, 0, 1, 0, 1); gtk_table_attach_defaults (GTK_TABLE (table), label, 0, 1, 0, 1);

View File

@ -555,7 +555,7 @@ tray_make_item (GtkWidget *menu, char *label, void *callback, void *userdata)
static void static void
tray_toggle_cb (GtkCheckMenuItem *item, unsigned int *setting) tray_toggle_cb (GtkCheckMenuItem *item, unsigned int *setting)
{ {
*setting = item->active; *setting = gtk_check_menu_item_get_active (item);
} }
static void static void

View File

@ -671,10 +671,10 @@ servlist_update_from_entry (char **str, GtkWidget *entry)
if (*str) if (*str)
free (*str); free (*str);
if (GTK_ENTRY (entry)->text[0] == 0) if (gtk_entry_get_text (GTK_ENTRY (entry))[0] == 0)
*str = NULL; *str = NULL;
else else
*str = strdup (GTK_ENTRY (entry)->text); *str = strdup (gtk_entry_get_text (GTK_ENTRY (entry)));
} }
static void static void
@ -946,20 +946,20 @@ servlist_savegui (void)
char *sp; char *sp;
/* check for blank username, ircd will not allow this */ /* check for blank username, ircd will not allow this */
if (GTK_ENTRY (entry_guser)->text[0] == 0) if (gtk_entry_get_text (GTK_ENTRY (entry_guser))[0] == 0)
return 1; return 1;
/* if (GTK_ENTRY (entry_greal)->text[0] == 0) /* if (gtk_entry_get_text (GTK_ENTRY (entry_greal))[0] == 0)
return 1; */ return 1; */
strcpy (prefs.hex_irc_nick1, GTK_ENTRY (entry_nick1)->text); strcpy (prefs.hex_irc_nick1, gtk_entry_get_text (GTK_ENTRY (entry_nick1)));
strcpy (prefs.hex_irc_nick2, GTK_ENTRY (entry_nick2)->text); strcpy (prefs.hex_irc_nick2, gtk_entry_get_text (GTK_ENTRY (entry_nick2)));
strcpy (prefs.hex_irc_nick3, GTK_ENTRY (entry_nick3)->text); strcpy (prefs.hex_irc_nick3, gtk_entry_get_text (GTK_ENTRY (entry_nick3)));
strcpy (prefs.hex_irc_user_name, GTK_ENTRY (entry_guser)->text); strcpy (prefs.hex_irc_user_name, gtk_entry_get_text (GTK_ENTRY (entry_guser)));
sp = strchr (prefs.hex_irc_user_name, ' '); sp = strchr (prefs.hex_irc_user_name, ' ');
if (sp) if (sp)
sp[0] = 0; /* spaces will break the login */ sp[0] = 0; /* spaces will break the login */
/* strcpy (prefs.hex_irc_real_name, GTK_ENTRY (entry_greal)->text); */ /* strcpy (prefs.hex_irc_real_name, gtk_entry_get_text (GTK_ENTRY (entry_greal))); */
servlist_save (); servlist_save ();
save_config (); /* For nicks stored in hexchat.conf */ save_config (); /* For nicks stored in hexchat.conf */
@ -1208,13 +1208,13 @@ servlist_check_cb (GtkWidget *but, gpointer num_p)
if ((1 << num) == FLAG_CYCLE || (1 << num) == FLAG_USE_PROXY) if ((1 << num) == FLAG_CYCLE || (1 << num) == FLAG_USE_PROXY)
{ {
/* these ones are reversed, so it's compat with 2.0.x */ /* these ones are reversed, so it's compat with 2.0.x */
if (GTK_TOGGLE_BUTTON (but)->active) if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (but)))
selected_net->flags &= ~(1 << num); selected_net->flags &= ~(1 << num);
else else
selected_net->flags |= (1 << num); selected_net->flags |= (1 << num);
} else } else
{ {
if (GTK_TOGGLE_BUTTON (but)->active) if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (but)))
selected_net->flags |= (1 << num); selected_net->flags |= (1 << num);
else else
selected_net->flags &= ~(1 << num); selected_net->flags &= ~(1 << num);
@ -1222,7 +1222,7 @@ servlist_check_cb (GtkWidget *but, gpointer num_p)
if ((1 << num) == FLAG_USE_GLOBAL) if ((1 << num) == FLAG_USE_GLOBAL)
{ {
servlist_toggle_global_user (!GTK_TOGGLE_BUTTON (but)->active); servlist_toggle_global_user (!gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (but)));
} }
} }
@ -1496,7 +1496,7 @@ servlist_combo_cb (GtkEntry *entry, gpointer userdata)
if (selected_net->encoding) if (selected_net->encoding)
free (selected_net->encoding); free (selected_net->encoding);
selected_net->encoding = strdup (entry->text); selected_net->encoding = strdup (gtk_entry_get_text (entry));
} }
/* Fills up the network's authentication type so that it's guaranteed to be either NULL or a valid value. */ /* Fills up the network's authentication type so that it's guaranteed to be either NULL or a valid value. */
@ -1549,7 +1549,7 @@ servlist_create_charsetcombo (void)
gtk_entry_set_text (GTK_ENTRY (gtk_bin_get_child (GTK_BIN(cb))), selected_net->encoding ? selected_net->encoding : "System default"); gtk_entry_set_text (GTK_ENTRY (gtk_bin_get_child (GTK_BIN(cb))), selected_net->encoding ? selected_net->encoding : "System default");
g_signal_connect (G_OBJECT (GTK_BIN (cb)->child), "changed", g_signal_connect (G_OBJECT (gtk_bin_get_child (GTK_BIN (cb))), "changed",
G_CALLBACK (servlist_combo_cb), NULL); G_CALLBACK (servlist_combo_cb), NULL);
return cb; return cb;
@ -1582,7 +1582,7 @@ servlist_create_logintypecombo (GtkWidget *data)
static void static void
no_servlist (GtkWidget * igad, gpointer serv) no_servlist (GtkWidget * igad, gpointer serv)
{ {
if (GTK_TOGGLE_BUTTON (igad)->active) if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (igad)))
prefs.hex_gui_slist_skip = TRUE; prefs.hex_gui_slist_skip = TRUE;
else else
prefs.hex_gui_slist_skip = FALSE; prefs.hex_gui_slist_skip = FALSE;
@ -1591,7 +1591,7 @@ no_servlist (GtkWidget * igad, gpointer serv)
static void static void
fav_servlist (GtkWidget * igad, gpointer serv) fav_servlist (GtkWidget * igad, gpointer serv)
{ {
if (GTK_TOGGLE_BUTTON (igad)->active) if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (igad)))
prefs.hex_gui_slist_fav = TRUE; prefs.hex_gui_slist_fav = TRUE;
else else
prefs.hex_gui_slist_fav = FALSE; prefs.hex_gui_slist_fav = FALSE;
@ -1711,7 +1711,6 @@ servlist_open_edit (GtkWidget *parent, ircnet *net)
"editable", 1, "editable", 1,
NULL); NULL);
/* Channel Tree */ /* Channel Tree */
store = gtk_list_store_new (3, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_BOOLEAN); store = gtk_list_store_new (3, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_BOOLEAN);
model = GTK_TREE_MODEL (store); model = GTK_TREE_MODEL (store);
@ -1784,19 +1783,19 @@ servlist_open_edit (GtkWidget *parent, ircnet *net)
g_signal_connect (G_OBJECT (buttonadd), "clicked", g_signal_connect (G_OBJECT (buttonadd), "clicked",
G_CALLBACK (servlist_addbutton_cb), notebook); G_CALLBACK (servlist_addbutton_cb), notebook);
gtk_container_add (GTK_CONTAINER (vbuttonbox1), buttonadd); gtk_container_add (GTK_CONTAINER (vbuttonbox1), buttonadd);
GTK_WIDGET_SET_FLAGS (buttonadd, GTK_CAN_DEFAULT); gtk_widget_set_can_default (buttonadd, TRUE);
buttonremove = gtk_button_new_from_stock ("gtk-remove"); buttonremove = gtk_button_new_from_stock ("gtk-remove");
g_signal_connect (G_OBJECT (buttonremove), "clicked", g_signal_connect (G_OBJECT (buttonremove), "clicked",
G_CALLBACK (servlist_deletebutton_cb), notebook); G_CALLBACK (servlist_deletebutton_cb), notebook);
gtk_container_add (GTK_CONTAINER (vbuttonbox1), buttonremove); gtk_container_add (GTK_CONTAINER (vbuttonbox1), buttonremove);
GTK_WIDGET_SET_FLAGS (buttonremove, GTK_CAN_DEFAULT); gtk_widget_set_can_default (buttonremove, TRUE);
buttonedit = gtk_button_new_with_mnemonic (_("_Edit")); buttonedit = gtk_button_new_with_mnemonic (_("_Edit"));
g_signal_connect (G_OBJECT (buttonedit), "clicked", g_signal_connect (G_OBJECT (buttonedit), "clicked",
G_CALLBACK (servlist_editbutton_cb), notebook); G_CALLBACK (servlist_editbutton_cb), notebook);
gtk_container_add (GTK_CONTAINER (vbuttonbox1), buttonedit); gtk_container_add (GTK_CONTAINER (vbuttonbox1), buttonedit);
GTK_WIDGET_SET_FLAGS (buttonedit, GTK_CAN_DEFAULT); gtk_widget_set_can_default (buttonedit, TRUE);
/* Checkboxes and entries */ /* Checkboxes and entries */
@ -1854,7 +1853,7 @@ servlist_open_edit (GtkWidget *parent, ircnet *net)
g_signal_connect (G_OBJECT (button10), "clicked", g_signal_connect (G_OBJECT (button10), "clicked",
G_CALLBACK (servlist_edit_close_cb), 0); G_CALLBACK (servlist_edit_close_cb), 0);
gtk_container_add (GTK_CONTAINER (hbuttonbox4), button10); gtk_container_add (GTK_CONTAINER (hbuttonbox4), button10);
GTK_WIDGET_SET_FLAGS (button10, GTK_CAN_DEFAULT); gtk_widget_set_can_default (button10, TRUE);
if (net->flags & FLAG_USE_GLOBAL) if (net->flags & FLAG_USE_GLOBAL)
{ {
@ -2089,21 +2088,21 @@ servlist_open_networks (void)
G_CALLBACK (servlist_addnet_cb), networks_tree); G_CALLBACK (servlist_addnet_cb), networks_tree);
gtk_widget_show (button_add); gtk_widget_show (button_add);
gtk_container_add (GTK_CONTAINER (vbuttonbox2), button_add); gtk_container_add (GTK_CONTAINER (vbuttonbox2), button_add);
GTK_WIDGET_SET_FLAGS (button_add, GTK_CAN_DEFAULT); gtk_widget_set_can_default (button_add, TRUE);
button_remove = gtk_button_new_from_stock ("gtk-remove"); button_remove = gtk_button_new_from_stock ("gtk-remove");
g_signal_connect (G_OBJECT (button_remove), "clicked", g_signal_connect (G_OBJECT (button_remove), "clicked",
G_CALLBACK (servlist_deletenet_cb), 0); G_CALLBACK (servlist_deletenet_cb), 0);
gtk_widget_show (button_remove); gtk_widget_show (button_remove);
gtk_container_add (GTK_CONTAINER (vbuttonbox2), button_remove); gtk_container_add (GTK_CONTAINER (vbuttonbox2), button_remove);
GTK_WIDGET_SET_FLAGS (button_remove, GTK_CAN_DEFAULT); gtk_widget_set_can_default (button_remove, TRUE);
button_edit = gtk_button_new_with_mnemonic (_("_Edit...")); button_edit = gtk_button_new_with_mnemonic (_("_Edit..."));
g_signal_connect (G_OBJECT (button_edit), "clicked", g_signal_connect (G_OBJECT (button_edit), "clicked",
G_CALLBACK (servlist_edit_cb), 0); G_CALLBACK (servlist_edit_cb), 0);
gtk_widget_show (button_edit); gtk_widget_show (button_edit);
gtk_container_add (GTK_CONTAINER (vbuttonbox2), button_edit); gtk_container_add (GTK_CONTAINER (vbuttonbox2), button_edit);
GTK_WIDGET_SET_FLAGS (button_edit, GTK_CAN_DEFAULT); gtk_widget_set_can_default (button_edit, TRUE);
button_sort = gtk_button_new_with_mnemonic (_("_Sort")); button_sort = gtk_button_new_with_mnemonic (_("_Sort"));
add_tip (button_sort, _("Sorts the network list in alphabetical order. " add_tip (button_sort, _("Sorts the network list in alphabetical order. "
@ -2112,7 +2111,7 @@ servlist_open_networks (void)
G_CALLBACK (servlist_sort), 0); G_CALLBACK (servlist_sort), 0);
gtk_widget_show (button_sort); gtk_widget_show (button_sort);
gtk_container_add (GTK_CONTAINER (vbuttonbox2), button_sort); gtk_container_add (GTK_CONTAINER (vbuttonbox2), button_sort);
GTK_WIDGET_SET_FLAGS (button_sort, GTK_CAN_DEFAULT); gtk_widget_set_can_default (button_sort, TRUE);
button_sort = gtk_button_new_with_mnemonic (_("_Favor")); button_sort = gtk_button_new_with_mnemonic (_("_Favor"));
add_tip (button_sort, _("Mark or unmark this network as a favorite.")); add_tip (button_sort, _("Mark or unmark this network as a favorite."));
@ -2120,7 +2119,7 @@ servlist_open_networks (void)
G_CALLBACK (servlist_favor), 0); G_CALLBACK (servlist_favor), 0);
gtk_widget_show (button_sort); gtk_widget_show (button_sort);
gtk_container_add (GTK_CONTAINER (vbuttonbox2), button_sort); gtk_container_add (GTK_CONTAINER (vbuttonbox2), button_sort);
GTK_WIDGET_SET_FLAGS (button_sort, GTK_CAN_DEFAULT); gtk_widget_set_can_default (button_sort, TRUE);
hseparator1 = gtk_hseparator_new (); hseparator1 = gtk_hseparator_new ();
gtk_widget_show (hseparator1); gtk_widget_show (hseparator1);
@ -2136,11 +2135,11 @@ servlist_open_networks (void)
g_signal_connect (G_OBJECT (button_close), "clicked", g_signal_connect (G_OBJECT (button_close), "clicked",
G_CALLBACK (servlist_close_cb), 0); G_CALLBACK (servlist_close_cb), 0);
gtk_container_add (GTK_CONTAINER (hbuttonbox1), button_close); gtk_container_add (GTK_CONTAINER (hbuttonbox1), button_close);
GTK_WIDGET_SET_FLAGS (button_close, GTK_CAN_DEFAULT); gtk_widget_set_can_default (button_close, TRUE);
button_connect = gtkutil_button (hbuttonbox1, GTK_STOCK_CONNECT, NULL, button_connect = gtkutil_button (hbuttonbox1, GTK_STOCK_CONNECT, NULL,
servlist_connect_cb, NULL, _("C_onnect")); servlist_connect_cb, NULL, _("C_onnect"));
GTK_WIDGET_SET_FLAGS (button_connect, GTK_CAN_DEFAULT); gtk_widget_set_can_default (button_connect, TRUE);
gtk_label_set_mnemonic_widget (GTK_LABEL (label3), entry1); gtk_label_set_mnemonic_widget (GTK_LABEL (label3), entry1);
gtk_label_set_mnemonic_widget (GTK_LABEL (label6), entry4); gtk_label_set_mnemonic_widget (GTK_LABEL (label6), entry4);

View File

@ -635,7 +635,7 @@ static const setting network_settings[] =
static void static void
setup_3oggle_cb (GtkToggleButton *but, unsigned int *setting) setup_3oggle_cb (GtkToggleButton *but, unsigned int *setting)
{ {
*setting = but->active; *setting = gtk_toggle_button_get_active (but);
} }
static void static void
@ -708,15 +708,15 @@ setup_toggle_cb (GtkToggleButton *but, const setting *set)
{ {
GtkWidget *label, *disable_wid; GtkWidget *label, *disable_wid;
setup_set_int (&setup_prefs, set, but->active ? 1 : 0); setup_set_int (&setup_prefs, set, gtk_toggle_button_get_active (but));
/* does this toggle also enable/disable another widget? */ /* does this toggle also enable/disable another widget? */
disable_wid = g_object_get_data (G_OBJECT (but), "nxt"); disable_wid = g_object_get_data (G_OBJECT (but), "nxt");
if (disable_wid) if (disable_wid)
{ {
gtk_widget_set_sensitive (disable_wid, but->active); gtk_widget_set_sensitive (disable_wid, gtk_toggle_button_get_active (but));
label = g_object_get_data (G_OBJECT (disable_wid), "lbl"); label = g_object_get_data (G_OBJECT (disable_wid), "lbl");
gtk_widget_set_sensitive (label, but->active); gtk_widget_set_sensitive (label, gtk_toggle_button_get_active (but));
} }
} }
@ -904,7 +904,7 @@ setup_menu_cb (GtkWidget *cbox, const setting *set)
static void static void
setup_radio_cb (GtkWidget *item, const setting *set) setup_radio_cb (GtkWidget *item, const setting *set)
{ {
if (GTK_TOGGLE_BUTTON (item)->active) if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (item)))
{ {
int n = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (item), "n")); int n = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (item), "n"));
/* set the prefs.<field> */ /* set the prefs.<field> */
@ -1110,7 +1110,7 @@ setup_fontsel_cancel (GtkWidget *button, GtkFontSelectionDialog *dialog)
static void static void
setup_browsefolder_cb (GtkWidget *button, GtkEntry *entry) setup_browsefolder_cb (GtkWidget *button, GtkEntry *entry)
{ {
gtkutil_file_req (_("Select Download Folder"), setup_filereq_cb, entry, entry->text, NULL, FRF_CHOOSEFOLDER); gtkutil_file_req (_("Select Download Folder"), setup_filereq_cb, entry, (char*)gtk_entry_get_text (entry), NULL, FRF_CHOOSEFOLDER);
} }
static void static void
@ -1124,8 +1124,8 @@ setup_browsefont_cb (GtkWidget *button, GtkWidget *entry)
sel = (GtkFontSelection *) dialog->fontsel; sel = (GtkFontSelection *) dialog->fontsel;
if (GTK_ENTRY (entry)->text[0]) if (gtk_entry_get_text (GTK_ENTRY (entry))[0])
gtk_font_selection_set_font_name (sel, GTK_ENTRY (entry)->text); gtk_font_selection_set_font_name (sel, gtk_entry_get_text (GTK_ENTRY (entry)));
g_object_set_data (G_OBJECT (dialog->ok_button), "e", entry); g_object_set_data (G_OBJECT (dialog->ok_button), "e", entry);
@ -1144,8 +1144,8 @@ setup_entry_cb (GtkEntry *entry, setting *set)
{ {
int size; int size;
int pos; int pos;
int len = strlen (entry->text); int len = gtk_entry_get_text_length (entry);
unsigned char *p = entry->text; unsigned char *p = (unsigned char*)gtk_entry_get_text (entry);
/* need to truncate? */ /* need to truncate? */
if (len >= set->extra) if (len >= set->extra)
@ -1167,7 +1167,7 @@ setup_entry_cb (GtkEntry *entry, setting *set)
} }
else else
{ {
setup_set_str (&setup_prefs, set, entry->text); setup_set_str (&setup_prefs, set, gtk_entry_get_text (entry));
} }
} }
@ -1449,7 +1449,7 @@ setup_create_color_button (GtkWidget *table, int num, int row, int col)
/* 12345678901 23456789 01 23456789 */ /* 12345678901 23456789 01 23456789 */
sprintf (buf, "<span size=\"x-small\">%d</span>", num); sprintf (buf, "<span size=\"x-small\">%d</span>", num);
but = gtk_button_new_with_label (" "); but = gtk_button_new_with_label (" ");
gtk_label_set_markup (GTK_LABEL (GTK_BIN (but)->child), buf); gtk_label_set_markup (GTK_LABEL (gtk_bin_get_child (GTK_BIN (but))), buf);
/* win32 build uses this to turn off themeing */ /* win32 build uses this to turn off themeing */
g_object_set_data (G_OBJECT (but), "hexchat-color", (gpointer)1); g_object_set_data (G_OBJECT (but), "hexchat-color", (gpointer)1);
gtk_table_attach (GTK_TABLE (table), but, col, col+1, row, row+1, gtk_table_attach (GTK_TABLE (table), but, col, col+1, row, row+1,
@ -1693,7 +1693,7 @@ setup_snd_browse_cb (GtkWidget *button, GtkEntry *entry)
static void static void
setup_snd_play_cb (GtkWidget *button, GtkEntry *entry) setup_snd_play_cb (GtkWidget *button, GtkEntry *entry)
{ {
sound_play (entry->text, FALSE); sound_play (gtk_entry_get_text (entry), FALSE);
} }
static void static void
@ -1715,7 +1715,7 @@ setup_snd_changed_cb (GtkEntry *ent, GtkTreeView *tree)
/* get the new sound file */ /* get the new sound file */
if (sound_files[n]) if (sound_files[n])
free (sound_files[n]); free (sound_files[n]);
sound_files[n] = strdup (GTK_ENTRY (ent)->text); sound_files[n] = strdup (gtk_entry_get_text (GTK_ENTRY (ent)));
/* update the TreeView list */ /* update the TreeView list */
store = (GtkListStore *)gtk_tree_view_get_model (tree); store = (GtkListStore *)gtk_tree_view_get_model (tree);

View File

@ -420,7 +420,7 @@ replace_word(GtkWidget *menuitem, SexySpellEntry *entry)
get_word_extents_from_position(entry, &start, &end, entry->priv->mark_character); get_word_extents_from_position(entry, &start, &end, entry->priv->mark_character);
oldword = gtk_editable_get_chars(GTK_EDITABLE(entry), start, end); oldword = gtk_editable_get_chars(GTK_EDITABLE(entry), start, end);
newword = gtk_label_get_text(GTK_LABEL(GTK_BIN(menuitem)->child)); newword = gtk_label_get_text(GTK_LABEL(gtk_bin_get_child (GTK_BIN(menuitem))));
cursor = gtk_editable_get_position(GTK_EDITABLE(entry)); cursor = gtk_editable_get_position(GTK_EDITABLE(entry));
/* is the cursor at the end? If so, restore it there */ /* is the cursor at the end? If so, restore it there */
@ -821,7 +821,7 @@ sexy_spell_entry_recheck_all(SexySpellEntry *entry)
rect.x = 0; rect.y = 0; rect.x = 0; rect.y = 0;
rect.width = widget->allocation.width; rect.width = widget->allocation.width;
rect.height = widget->allocation.height; rect.height = widget->allocation.height;
gdk_window_invalidate_rect(widget->window, &rect, TRUE); gdk_window_invalidate_rect(gtk_widget_get_window (widget), &rect, TRUE);
} }
} }
@ -1338,7 +1338,7 @@ sexy_spell_entry_set_checked(SexySpellEntry *entry, gboolean checked)
rect.x = 0; rect.y = 0; rect.x = 0; rect.y = 0;
rect.width = widget->allocation.width; rect.width = widget->allocation.width;
rect.height = widget->allocation.height; rect.height = widget->allocation.height;
gdk_window_invalidate_rect(widget->window, &rect, TRUE); gdk_window_invalidate_rect(gtk_widget_get_window (widget), &rect, TRUE);
} else { } else {
if (entry->priv->words) { if (entry->priv->words) {
g_strfreev(entry->priv->words); g_strfreev(entry->priv->words);

View File

@ -274,7 +274,7 @@ userlist_set_value (GtkWidget *treeview, gfloat val)
gfloat gfloat
userlist_get_value (GtkWidget *treeview) userlist_get_value (GtkWidget *treeview)
{ {
return gtk_tree_view_get_vadjustment (GTK_TREE_VIEW (treeview))->value; return gtk_adjustment_get_value (gtk_tree_view_get_vadjustment (GTK_TREE_VIEW (treeview)));
} }
int int
@ -425,7 +425,7 @@ userlist_dnd_drop (GtkTreeView *widget, GdkDragContext *context,
return; return;
gtk_tree_model_get (model, &iter, COL_USER, &user, -1); gtk_tree_model_get (model, &iter, COL_USER, &user, -1);
mg_dnd_drop_file (current_sess, user->nick, selection_data->data); mg_dnd_drop_file (current_sess, user->nick, (char *)gtk_selection_data_get_data (selection_data));
} }
static gboolean static gboolean

View File

@ -16,6 +16,7 @@
<!-- YOU SHOULDN'T TOUCH ANYTHING BELOW --> <!-- YOU SHOULDN'T TOUCH ANYTHING BELOW -->
<!-- G_DISABLE_DEPRECATED is unfeasible due to g_completion_* --> <!-- G_DISABLE_DEPRECATED is unfeasible due to g_completion_* -->
<!-- must be buildable with GSEAL_ENABLE in the future, xtext, setup, and chanview-tabs stand in the way -->
<OwnFlags>GDK_PIXBUF_DISABLE_DEPRECATED;G_DISABLE_SINGLE_INCLUDES;GDK_PIXBUF_DISABLE_SINGLE_INCLUDES;GTK_DISABLE_SINGLE_INCLUDES;HAVE_STRTOULL;strtoull=_strtoui64;strcasecmp=stricmp;strncasecmp=strnicmp;__inline__=__inline</OwnFlags> <OwnFlags>GDK_PIXBUF_DISABLE_DEPRECATED;G_DISABLE_SINGLE_INCLUDES;GDK_PIXBUF_DISABLE_SINGLE_INCLUDES;GTK_DISABLE_SINGLE_INCLUDES;HAVE_STRTOULL;strtoull=_strtoui64;strcasecmp=stricmp;strncasecmp=strnicmp;__inline__=__inline</OwnFlags>
<DepsRoot>$(YourDepsPath)\$(PlatformName)</DepsRoot> <DepsRoot>$(YourDepsPath)\$(PlatformName)</DepsRoot>
<GendefPath>$(YourGendefPath)</GendefPath> <GendefPath>$(YourGendefPath)</GendefPath>