Mercurial > hg > xemacs-beta
comparison src/select-gtk.c @ 2286:04bc9d2f42c7
[xemacs-hg @ 2004-09-20 19:18:55 by james]
Mark all unused parameters as unused. Also eliminate some unneeded local
variables.
author | james |
---|---|
date | Mon, 20 Sep 2004 19:20:08 +0000 |
parents | 91d4c8c65a0f |
children | ecf1ebac70d8 |
comparison
equal
deleted
inserted
replaced
2285:914c5afaac33 | 2286:04bc9d2f42c7 |
---|---|
47 | 47 |
48 extern int lisp_to_time (Lisp_Object, time_t *); | 48 extern int lisp_to_time (Lisp_Object, time_t *); |
49 extern Lisp_Object time_to_lisp (time_t); | 49 extern Lisp_Object time_to_lisp (time_t); |
50 | 50 |
51 static GdkAtom | 51 static GdkAtom |
52 symbol_to_gtk_atom (struct device *d, Lisp_Object sym, int only_if_exists) | 52 symbol_to_gtk_atom (struct device *UNUSED (d), Lisp_Object sym, |
53 int only_if_exists) | |
53 { | 54 { |
54 if (NILP (sym)) return GDK_SELECTION_PRIMARY; | 55 if (NILP (sym)) return GDK_SELECTION_PRIMARY; |
55 if (EQ (sym, Qt)) return GDK_SELECTION_SECONDARY; | 56 if (EQ (sym, Qt)) return GDK_SELECTION_SECONDARY; |
56 if (EQ (sym, QPRIMARY)) return GDK_SELECTION_PRIMARY; | 57 if (EQ (sym, QPRIMARY)) return GDK_SELECTION_PRIMARY; |
57 if (EQ (sym, QSECONDARY)) return GDK_SELECTION_SECONDARY; | 58 if (EQ (sym, QSECONDARY)) return GDK_SELECTION_SECONDARY; |
62 return gdk_atom_intern (nameext, only_if_exists ? TRUE : FALSE); | 63 return gdk_atom_intern (nameext, only_if_exists ? TRUE : FALSE); |
63 } | 64 } |
64 } | 65 } |
65 | 66 |
66 static Lisp_Object | 67 static Lisp_Object |
67 atom_to_symbol (struct device *d, GdkAtom atom) | 68 atom_to_symbol (struct device *UNUSED (d), GdkAtom atom) |
68 { | 69 { |
69 if (atom == GDK_SELECTION_PRIMARY) return (QPRIMARY); | 70 if (atom == GDK_SELECTION_PRIMARY) return (QPRIMARY); |
70 if (atom == GDK_SELECTION_SECONDARY) return (QSECONDARY); | 71 if (atom == GDK_SELECTION_SECONDARY) return (QSECONDARY); |
71 | 72 |
72 { | 73 { |
127 ** but has been modeled after the X code, and appears to work. | 128 ** but has been modeled after the X code, and appears to work. |
128 ** | 129 ** |
129 ** WMP Feb 12 2001 | 130 ** WMP Feb 12 2001 |
130 */ | 131 */ |
131 void | 132 void |
132 emacs_gtk_selection_handle (GtkWidget *widget, | 133 emacs_gtk_selection_handle (GtkWidget *UNUSED (widget), |
133 GtkSelectionData *selection_data, | 134 GtkSelectionData *selection_data, |
134 guint info, | 135 guint UNUSED (info), |
135 guint time_stamp, | 136 guint time_stamp, |
136 gpointer data) | 137 gpointer UNUSED (data)) |
137 { | 138 { |
138 /* This function can GC */ | 139 /* This function can GC */ |
139 struct gcpro gcpro1, gcpro2; | 140 struct gcpro gcpro1, gcpro2; |
140 Lisp_Object temp_obj; | 141 Lisp_Object temp_obj; |
141 Lisp_Object selection_symbol; | 142 Lisp_Object selection_symbol; |
239 } | 240 } |
240 } | 241 } |
241 | 242 |
242 | 243 |
243 void | 244 void |
244 emacs_gtk_selection_clear_event_handle (GtkWidget *widget, | 245 emacs_gtk_selection_clear_event_handle (GtkWidget *UNUSED (widget), |
245 GdkEventSelection *event, | 246 GdkEventSelection *event, |
246 gpointer data) | 247 gpointer UNUSED (data)) |
247 { | 248 { |
248 GdkAtom selection = event->selection; | 249 GdkAtom selection = event->selection; |
249 guint32 changed_owner_time = event->time; | 250 guint32 changed_owner_time = event->time; |
250 struct device *d = decode_gtk_device (Qnil); | 251 struct device *d = decode_gtk_device (Qnil); |
251 | 252 |
279 static GdkAtom reading_which_selection; | 280 static GdkAtom reading_which_selection; |
280 static int selection_reply_timed_out; | 281 static int selection_reply_timed_out; |
281 | 282 |
282 /* Gets the current selection owned by another application */ | 283 /* Gets the current selection owned by another application */ |
283 void | 284 void |
284 emacs_gtk_selection_received (GtkWidget *widget, | 285 emacs_gtk_selection_received (GtkWidget *UNUSED (widget), |
285 GtkSelectionData *selection_data, | 286 GtkSelectionData *selection_data, |
286 gpointer user_data) | 287 gpointer UNUSED (user_data)) |
287 { | 288 { |
288 waiting_for_selection = FALSE; | 289 waiting_for_selection = FALSE; |
289 Vretrieved_selection = Qnil; | 290 Vretrieved_selection = Qnil; |
290 | 291 |
291 reading_selection_reply = NULL; | 292 reading_selection_reply = NULL; |
304 selection_data->type, | 305 selection_data->type, |
305 selection_data->format); | 306 selection_data->format); |
306 } | 307 } |
307 | 308 |
308 static int | 309 static int |
309 selection_reply_done (void *ignore) | 310 selection_reply_done (void *UNUSED (ignore)) |
310 { | 311 { |
311 return !reading_selection_reply; | 312 return !reading_selection_reply; |
312 } | 313 } |
313 | 314 |
314 /* Do protocol to read selection-data from the server. | 315 /* Do protocol to read selection-data from the server. |
402 #endif | 403 #endif |
403 | 404 |
404 | 405 |
405 | 406 |
406 static Lisp_Object | 407 static Lisp_Object |
407 gtk_own_selection (Lisp_Object selection_name, Lisp_Object selection_value, | 408 gtk_own_selection (Lisp_Object selection_name, |
408 Lisp_Object how_to_add, Lisp_Object selection_type, int owned_p) | 409 Lisp_Object UNUSED (selection_value), |
410 Lisp_Object UNUSED (how_to_add), | |
411 Lisp_Object UNUSED (selection_type), int UNUSED (owned_p)) | |
409 { | 412 { |
410 struct device *d = decode_gtk_device (Qnil); | 413 struct device *d = decode_gtk_device (Qnil); |
411 GtkWidget *selecting_window = GTK_WIDGET (DEVICE_GTK_APP_SHELL (d)); | 414 GtkWidget *selecting_window = GTK_WIDGET (DEVICE_GTK_APP_SHELL (d)); |
412 /* Use the time of the last-read mouse or keyboard event. | 415 /* Use the time of the last-read mouse or keyboard event. |
413 For selection purposes, we use this as a sleazy way of knowing what the | 416 For selection purposes, we use this as a sleazy way of knowing what the |
457 gtk_selection_owner_set (NULL, selection_atom, timestamp); | 460 gtk_selection_owner_set (NULL, selection_atom, timestamp); |
458 } | 461 } |
459 | 462 |
460 static Lisp_Object | 463 static Lisp_Object |
461 gtk_selection_exists_p (Lisp_Object selection, | 464 gtk_selection_exists_p (Lisp_Object selection, |
462 Lisp_Object selection_type) | 465 Lisp_Object UNUSED (selection_type)) |
463 { | 466 { |
464 struct device *d = decode_gtk_device (Qnil); | 467 struct device *d = decode_gtk_device (Qnil); |
465 | 468 |
466 return (gdk_selection_owner_get (symbol_to_gtk_atom (d, selection, 0)) ? Qt : Qnil); | 469 return (gdk_selection_owner_get (symbol_to_gtk_atom (d, selection, 0)) ? Qt : Qnil); |
467 } | 470 } |