Mercurial > pidgin.yaz
comparison src/gtkrequest.c @ 5794:5e93fc46d1af
[gaim-migrate @ 6219]
Removed the __ prefix from static functions. I love them, but ANSI C
knocked on my door and threatened to sue, saying they own all rights to
them, so I was forced to remove them.
committer: Tailor Script <tailor@pidgin.im>
author | Christian Hammond <chipx86@chipx86.com> |
---|---|
date | Sat, 07 Jun 2003 07:57:24 +0000 |
parents | da18a02c3705 |
children | 9467bff78029 |
comparison
equal
deleted
inserted
replaced
5793:952710ac6635 | 5794:5e93fc46d1af |
---|---|
51 } u; | 51 } u; |
52 | 52 |
53 } GaimRequestData; | 53 } GaimRequestData; |
54 | 54 |
55 static void | 55 static void |
56 __input_response_cb(GtkDialog *dialog, gint id, GaimRequestData *data) | 56 input_response_cb(GtkDialog *dialog, gint id, GaimRequestData *data) |
57 { | 57 { |
58 const char *value; | 58 const char *value; |
59 | 59 |
60 if (data->u.input.multiline) { | 60 if (data->u.input.multiline) { |
61 GtkTextIter start_iter, end_iter; | 61 GtkTextIter start_iter, end_iter; |
76 | 76 |
77 gaim_request_close(GAIM_REQUEST_INPUT, data); | 77 gaim_request_close(GAIM_REQUEST_INPUT, data); |
78 } | 78 } |
79 | 79 |
80 static void | 80 static void |
81 __action_response_cb(GtkDialog *dialog, gint id, GaimRequestData *data) | 81 action_response_cb(GtkDialog *dialog, gint id, GaimRequestData *data) |
82 { | 82 { |
83 if (id < data->cb_count && data->cbs[id] != NULL) | 83 if (id < data->cb_count && data->cbs[id] != NULL) |
84 ((GaimRequestActionCb)data->cbs[id])(data->user_data, id); | 84 ((GaimRequestActionCb)data->cbs[id])(data->user_data, id); |
85 | 85 |
86 gaim_request_close(GAIM_REQUEST_INPUT, data); | 86 gaim_request_close(GAIM_REQUEST_INPUT, data); |
89 #define STOCK_ITEMIZE(r, l) \ | 89 #define STOCK_ITEMIZE(r, l) \ |
90 if (!strcmp((r), text)) \ | 90 if (!strcmp((r), text)) \ |
91 return (l); | 91 return (l); |
92 | 92 |
93 static const char * | 93 static const char * |
94 __text_to_stock(const char *text) | 94 text_to_stock(const char *text) |
95 { | 95 { |
96 STOCK_ITEMIZE(_("Yes"), GTK_STOCK_YES); | 96 STOCK_ITEMIZE(_("Yes"), GTK_STOCK_YES); |
97 STOCK_ITEMIZE(_("No"), GTK_STOCK_NO); | 97 STOCK_ITEMIZE(_("No"), GTK_STOCK_NO); |
98 STOCK_ITEMIZE(_("OK"), GTK_STOCK_OK); | 98 STOCK_ITEMIZE(_("OK"), GTK_STOCK_OK); |
99 STOCK_ITEMIZE(_("Cancel"), GTK_STOCK_CANCEL); | 99 STOCK_ITEMIZE(_("Cancel"), GTK_STOCK_CANCEL); |
133 data->cbs[0] = ok_cb; | 133 data->cbs[0] = ok_cb; |
134 data->cbs[1] = cancel_cb; | 134 data->cbs[1] = cancel_cb; |
135 | 135 |
136 /* Create the dialog. */ | 136 /* Create the dialog. */ |
137 dialog = gtk_dialog_new_with_buttons("", NULL, 0, | 137 dialog = gtk_dialog_new_with_buttons("", NULL, 0, |
138 __text_to_stock(cancel_text), 1, | 138 text_to_stock(cancel_text), 1, |
139 __text_to_stock(ok_text), 0, | 139 text_to_stock(ok_text), 0, |
140 NULL); | 140 NULL); |
141 data->dialog = dialog; | 141 data->dialog = dialog; |
142 | 142 |
143 g_signal_connect(G_OBJECT(dialog), "response", | 143 g_signal_connect(G_OBJECT(dialog), "response", |
144 G_CALLBACK(__input_response_cb), data); | 144 G_CALLBACK(input_response_cb), data); |
145 | 145 |
146 /* Setup the dialog */ | 146 /* Setup the dialog */ |
147 gtk_container_set_border_width(GTK_CONTAINER(dialog), 6); | 147 gtk_container_set_border_width(GTK_CONTAINER(dialog), 6); |
148 gtk_container_set_border_width(GTK_CONTAINER(GTK_DIALOG(dialog)->vbox), 6); | 148 gtk_container_set_border_width(GTK_CONTAINER(GTK_DIALOG(dialog)->vbox), 6); |
149 gtk_window_set_resizable(GTK_WINDOW(dialog), FALSE); | 149 gtk_window_set_resizable(GTK_WINDOW(dialog), FALSE); |
270 /* Create the dialog. */ | 270 /* Create the dialog. */ |
271 data->dialog = dialog = gtk_dialog_new(); | 271 data->dialog = dialog = gtk_dialog_new(); |
272 | 272 |
273 for (i = 0; i < action_count; i++) { | 273 for (i = 0; i < action_count; i++) { |
274 gtk_dialog_add_button(GTK_DIALOG(dialog), | 274 gtk_dialog_add_button(GTK_DIALOG(dialog), |
275 __text_to_stock(buttons[2 * i]), i); | 275 text_to_stock(buttons[2 * i]), i); |
276 | 276 |
277 data->cbs[i] = buttons[2 * i + 1]; | 277 data->cbs[i] = buttons[2 * i + 1]; |
278 } | 278 } |
279 | 279 |
280 g_free(buttons); | 280 g_free(buttons); |
281 | 281 |
282 g_signal_connect(G_OBJECT(dialog), "response", | 282 g_signal_connect(G_OBJECT(dialog), "response", |
283 G_CALLBACK(__action_response_cb), data); | 283 G_CALLBACK(action_response_cb), data); |
284 | 284 |
285 /* Setup the dialog */ | 285 /* Setup the dialog */ |
286 gtk_container_set_border_width(GTK_CONTAINER(dialog), 6); | 286 gtk_container_set_border_width(GTK_CONTAINER(dialog), 6); |
287 gtk_window_set_resizable(GTK_WINDOW(dialog), FALSE); | 287 gtk_window_set_resizable(GTK_WINDOW(dialog), FALSE); |
288 gtk_dialog_set_has_separator(GTK_DIALOG(dialog), FALSE); | 288 gtk_dialog_set_has_separator(GTK_DIALOG(dialog), FALSE); |