Mercurial > geeqie.yaz
comparison src/layout_util.c @ 428:af843364b3ea
I have finally found how to add alternative hotkeys
removed more hard-coded keys
"Split Quad" is without hotkey for now
author | nadvornik |
---|---|
date | Sat, 19 Apr 2008 20:19:27 +0000 |
parents | c4080362d619 |
children | 831035240885 |
comparison
equal
deleted
inserted
replaced
427:134beb10d916 | 428:af843364b3ea |
---|---|
159 | 159 |
160 keyboard_scroll_calc(&x, &y, event); | 160 keyboard_scroll_calc(&x, &y, event); |
161 layout_image_scroll(lw, x, y); | 161 layout_image_scroll(lw, x, y); |
162 } | 162 } |
163 | 163 |
164 if (stop_signal) return stop_signal; | 164 return stop_signal; |
165 | 165 } |
166 if (event->state & GDK_CONTROL_MASK) | 166 |
167 { | 167 void layout_keyboard_init(LayoutWindow *lw, GtkWidget *window) |
168 stop_signal = FALSE; | 168 { |
169 } | 169 g_signal_connect(G_OBJECT(window), "key_press_event", |
170 else | 170 G_CALLBACK(layout_key_press_cb), lw); |
171 { | 171 } |
172 stop_signal = TRUE; | 172 |
173 switch (event->keyval) | 173 /* |
174 { | 174 *----------------------------------------------------------------------------- |
175 case '+': case GDK_KP_Add: | 175 * menu callbacks |
176 layout_image_zoom_adjust(lw, get_zoom_increment()); | 176 *----------------------------------------------------------------------------- |
177 break; | 177 */ |
178 case GDK_KP_Subtract: | 178 |
179 layout_image_zoom_adjust(lw, -get_zoom_increment()); | 179 |
180 break; | 180 static GtkWidget *layout_window(LayoutWindow *lw) |
181 case GDK_KP_Multiply: | 181 { |
182 layout_image_zoom_set(lw, 0.0); | 182 return lw->full_screen ? lw->full_screen->window : lw->window; |
183 break; | 183 } |
184 case GDK_KP_Divide: | 184 |
185 layout_image_zoom_set(lw, 1.0); | 185 static void layout_menu_new_window_cb(GtkAction *action, gpointer data) |
186 break; | 186 { |
187 case GDK_Page_Up: case GDK_KP_Page_Up: | 187 LayoutWindow *lw = data; |
188 layout_image_prev(lw); | 188 LayoutWindow *nw; |
189 break; | 189 |
190 case GDK_Page_Down: case GDK_KP_Page_Down: | 190 if (lw->full_screen) |
191 layout_image_next(lw); | 191 layout_image_full_screen_stop(lw); |
192 break; | 192 |
193 case GDK_Delete: case GDK_KP_Delete: | 193 nw = layout_new(NULL, FALSE, FALSE); |
194 if (options->file_ops.enable_delete_key) | 194 layout_sort_set(nw, options->file_sort.method, options->file_sort.ascending); |
195 { | 195 layout_set_path(nw, layout_get_path(lw)); |
196 file_util_delete(NULL, layout_selection_list(lw), widget); | 196 } |
197 } | 197 |
198 break; | 198 static void layout_menu_new_cb(GtkAction *action, gpointer data) |
199 case GDK_Escape: | 199 { |
200 LayoutWindow *lw = data; | |
201 if (lw->full_screen) | |
202 layout_image_full_screen_stop(lw); | |
203 collection_window_new(NULL); | |
204 } | |
205 | |
206 static void layout_menu_open_cb(GtkAction *action, gpointer data) | |
207 { | |
208 LayoutWindow *lw = data; | |
209 if (lw->full_screen) | |
210 layout_image_full_screen_stop(lw); | |
211 collection_dialog_load(NULL); | |
212 } | |
213 | |
214 static void layout_menu_search_cb(GtkAction *action, gpointer data) | |
215 { | |
216 LayoutWindow *lw = data; | |
217 if (lw->full_screen) | |
218 layout_image_full_screen_stop(lw); | |
219 | |
220 search_new(lw->path, layout_image_get_path(lw)); | |
221 } | |
222 | |
223 static void layout_menu_dupes_cb(GtkAction *action, gpointer data) | |
224 { | |
225 LayoutWindow *lw = data; | |
226 if (lw->full_screen) | |
227 layout_image_full_screen_stop(lw); | |
228 | |
229 dupe_window_new(DUPE_MATCH_NAME); | |
230 } | |
231 | |
232 static void layout_menu_pan_cb(GtkAction *action, gpointer data) | |
233 { | |
234 LayoutWindow *lw = data; | |
235 if (lw->full_screen) | |
236 layout_image_full_screen_stop(lw); | |
237 | |
238 pan_window_new(layout_get_path(lw)); | |
239 } | |
240 | |
241 static void layout_menu_print_cb(GtkAction *action, gpointer data) | |
242 { | |
243 LayoutWindow *lw = data; | |
244 | |
245 print_window_new(layout_image_get_fd(lw), layout_selection_list(lw), layout_list(lw), layout_window(lw)); | |
246 } | |
247 | |
248 static void layout_menu_dir_cb(GtkAction *action, gpointer data) | |
249 { | |
250 LayoutWindow *lw = data; | |
251 | |
252 file_util_create_dir(lw->path, layout_window(lw)); | |
253 } | |
254 | |
255 static void layout_menu_copy_cb(GtkAction *action, gpointer data) | |
256 { | |
257 LayoutWindow *lw = data; | |
258 | |
259 file_util_copy(NULL, layout_selection_list(lw), NULL, layout_window(lw)); | |
260 } | |
261 | |
262 static void layout_menu_move_cb(GtkAction *action, gpointer data) | |
263 { | |
264 LayoutWindow *lw = data; | |
265 | |
266 file_util_move(NULL, layout_selection_list(lw), NULL, layout_window(lw)); | |
267 } | |
268 | |
269 static void layout_menu_rename_cb(GtkAction *action, gpointer data) | |
270 { | |
271 LayoutWindow *lw = data; | |
272 | |
273 file_util_rename(NULL, layout_selection_list(lw), layout_window(lw)); | |
274 } | |
275 | |
276 static void layout_menu_delete_cb(GtkAction *action, gpointer data) | |
277 { | |
278 LayoutWindow *lw = data; | |
279 | |
280 file_util_delete(NULL, layout_selection_list(lw), layout_window(lw)); | |
281 } | |
282 | |
283 static void layout_menu_close_cb(GtkAction *action, gpointer data) | |
284 { | |
285 LayoutWindow *lw = data; | |
286 if (lw->full_screen) | |
287 layout_image_full_screen_stop(lw); | |
288 | |
289 layout_close(lw); | |
290 } | |
291 | |
292 static void layout_menu_exit_cb(GtkAction *action, gpointer data) | |
293 { | |
294 exit_program(); | |
295 } | |
296 | |
297 static void layout_menu_alter_90_cb(GtkAction *action, gpointer data) | |
298 { | |
299 LayoutWindow *lw = data; | |
300 | |
301 layout_image_alter(lw, ALTER_ROTATE_90); | |
302 } | |
303 | |
304 static void layout_menu_alter_90cc_cb(GtkAction *action, gpointer data) | |
305 { | |
306 LayoutWindow *lw = data; | |
307 | |
308 layout_image_alter(lw, ALTER_ROTATE_90_CC); | |
309 } | |
310 | |
311 static void layout_menu_alter_180_cb(GtkAction *action, gpointer data) | |
312 { | |
313 LayoutWindow *lw = data; | |
314 | |
315 layout_image_alter(lw, ALTER_ROTATE_180); | |
316 } | |
317 | |
318 static void layout_menu_alter_mirror_cb(GtkAction *action, gpointer data) | |
319 { | |
320 LayoutWindow *lw = data; | |
321 | |
322 layout_image_alter(lw, ALTER_MIRROR); | |
323 } | |
324 | |
325 static void layout_menu_alter_flip_cb(GtkAction *action, gpointer data) | |
326 { | |
327 LayoutWindow *lw = data; | |
328 | |
329 layout_image_alter(lw, ALTER_FLIP); | |
330 } | |
331 | |
332 static void layout_menu_alter_desaturate_cb(GtkAction *action, gpointer data) | |
333 { | |
334 LayoutWindow *lw = data; | |
335 | |
336 layout_image_alter(lw, ALTER_DESATURATE); | |
337 } | |
338 | |
339 static void layout_menu_info_cb(GtkAction *action, gpointer data) | |
340 { | |
341 LayoutWindow *lw = data; | |
342 GList *list; | |
343 FileData *fd = NULL; | |
344 | |
345 list = layout_selection_list(lw); | |
346 if (!list) fd = layout_image_get_fd(lw); | |
347 | |
348 info_window_new(fd, list); | |
349 } | |
350 | |
351 | |
352 static void layout_menu_config_cb(GtkAction *action, gpointer data) | |
353 { | |
354 LayoutWindow *lw = data; | |
355 if (lw->full_screen) | |
356 layout_image_full_screen_stop(lw); | |
357 | |
358 show_config_window(); | |
359 } | |
360 | |
361 static void layout_menu_remove_thumb_cb(GtkAction *action, gpointer data) | |
362 { | |
363 LayoutWindow *lw = data; | |
364 if (lw->full_screen) | |
365 layout_image_full_screen_stop(lw); | |
366 | |
367 cache_manager_show(); | |
368 } | |
369 | |
370 static void layout_menu_wallpaper_cb(GtkAction *action, gpointer data) | |
371 { | |
372 LayoutWindow *lw = data; | |
373 | |
374 layout_image_to_root(lw); | |
375 } | |
376 | |
377 static void layout_menu_zoom_in_cb(GtkAction *action, gpointer data) | |
378 { | |
379 LayoutWindow *lw = data; | |
380 | |
381 layout_image_zoom_adjust(lw, get_zoom_increment()); | |
382 } | |
383 | |
384 static void layout_menu_zoom_out_cb(GtkAction *action, gpointer data) | |
385 { | |
386 LayoutWindow *lw = data; | |
387 | |
388 layout_image_zoom_adjust(lw, -get_zoom_increment()); | |
389 } | |
390 | |
391 static void layout_menu_zoom_1_1_cb(GtkAction *action, gpointer data) | |
392 { | |
393 LayoutWindow *lw = data; | |
394 | |
395 layout_image_zoom_set(lw, 1.0); | |
396 } | |
397 | |
398 static void layout_menu_zoom_fit_cb(GtkAction *action, gpointer data) | |
399 { | |
400 LayoutWindow *lw = data; | |
401 | |
402 layout_image_zoom_set(lw, 0.0); | |
403 } | |
404 | |
405 static void layout_menu_zoom_fit_hor_cb(GtkAction *action, gpointer data) | |
406 { | |
407 LayoutWindow *lw = data; | |
408 | |
409 layout_image_zoom_set_fill_geometry(lw, TRUE); | |
410 } | |
411 | |
412 static void layout_menu_zoom_fit_vert_cb(GtkAction *action, gpointer data) | |
413 { | |
414 LayoutWindow *lw = data; | |
415 | |
416 layout_image_zoom_set_fill_geometry(lw, FALSE); | |
417 } | |
418 | |
419 static void layout_menu_zoom_2_1_cb(GtkAction *action, gpointer data) | |
420 { | |
421 LayoutWindow *lw = data; | |
422 | |
423 layout_image_zoom_set(lw, 2.0); | |
424 } | |
425 | |
426 static void layout_menu_zoom_3_1_cb(GtkAction *action, gpointer data) | |
427 { | |
428 LayoutWindow *lw = data; | |
429 | |
430 layout_image_zoom_set(lw, 3.0); | |
431 } | |
432 static void layout_menu_zoom_4_1_cb(GtkAction *action, gpointer data) | |
433 { | |
434 LayoutWindow *lw = data; | |
435 | |
436 layout_image_zoom_set(lw, 4.0); | |
437 } | |
438 | |
439 static void layout_menu_zoom_1_2_cb(GtkAction *action, gpointer data) | |
440 { | |
441 LayoutWindow *lw = data; | |
442 | |
443 layout_image_zoom_set(lw, -2.0); | |
444 } | |
445 | |
446 static void layout_menu_zoom_1_3_cb(GtkAction *action, gpointer data) | |
447 { | |
448 LayoutWindow *lw = data; | |
449 | |
450 layout_image_zoom_set(lw, -3.0); | |
451 } | |
452 | |
453 static void layout_menu_zoom_1_4_cb(GtkAction *action, gpointer data) | |
454 { | |
455 LayoutWindow *lw = data; | |
456 | |
457 layout_image_zoom_set(lw, -4.0); | |
458 } | |
459 | |
460 | |
461 static void layout_menu_split_cb(GtkRadioAction *action, GtkRadioAction *current, gpointer data) | |
462 { | |
463 LayoutWindow *lw = data; | |
464 if (lw->full_screen) | |
465 layout_image_full_screen_stop(lw); | |
466 | |
467 ImageSplitMode mode = gtk_radio_action_get_current_value(action); | |
468 | |
469 if (mode == lw->split_mode) mode = 0; /* toggle back */ | |
470 | |
471 layout_split_change(lw, mode); | |
472 } | |
473 | |
474 static void layout_menu_connect_scroll_cb(GtkToggleAction *action, gpointer data) | |
475 { | |
476 LayoutWindow *lw = data; | |
477 lw->connect_scroll = gtk_toggle_action_get_active(action); | |
478 } | |
479 | |
480 static void layout_menu_connect_zoom_cb(GtkToggleAction *action, gpointer data) | |
481 { | |
482 LayoutWindow *lw = data; | |
483 lw->connect_zoom = gtk_toggle_action_get_active(action); | |
484 } | |
485 | |
486 | |
487 static void layout_menu_thumb_cb(GtkToggleAction *action, gpointer data) | |
488 { | |
489 LayoutWindow *lw = data; | |
490 | |
491 layout_thumb_set(lw, gtk_toggle_action_get_active(action)); | |
492 } | |
493 | |
494 | |
495 static void layout_menu_list_cb(GtkRadioAction *action, GtkRadioAction *current, gpointer data) | |
496 { | |
497 LayoutWindow *lw = data; | |
498 if (lw->full_screen) | |
499 layout_image_full_screen_stop(lw); | |
500 | |
501 layout_views_set(lw, lw->dir_view_type, (gtk_radio_action_get_current_value(action) == 1)); | |
502 } | |
503 | |
504 static void layout_menu_view_dir_as_cb(GtkRadioAction *action, GtkRadioAction *current, gpointer data) | |
505 { | |
506 LayoutWindow *lw = data; | |
507 if (lw->full_screen) | |
508 layout_image_full_screen_stop(lw); | |
509 | |
510 layout_views_set(lw, (DirViewType) gtk_radio_action_get_current_value(action), lw->icon_view); | |
511 } | |
512 | |
513 static void layout_menu_view_in_new_window_cb(GtkAction *action, gpointer data) | |
514 { | |
515 LayoutWindow *lw = data; | |
516 | |
517 if (lw->full_screen) | |
518 layout_image_full_screen_stop(lw); | |
519 view_window_new(layout_image_get_fd(lw)); | |
520 } | |
521 | |
522 static void layout_menu_fullscreen_cb(GtkAction *action, gpointer data) | |
523 { | |
524 LayoutWindow *lw = data; | |
525 | |
526 layout_image_full_screen_toggle(lw); | |
527 } | |
528 | |
529 static void layout_menu_escape_cb(GtkAction *action, gpointer data) | |
530 { | |
531 LayoutWindow *lw = data; | |
532 | |
533 layout_image_full_screen_stop(lw); | |
200 /* FIXME:interrupting thumbs no longer allowed */ | 534 /* FIXME:interrupting thumbs no longer allowed */ |
201 #if 0 | 535 #if 0 |
202 interrupt_thumbs(); | 536 interrupt_thumbs(); |
203 #endif | 537 #endif |
204 break; | |
205 case 'P': case 'p': | |
206 if (!event->state & GDK_SHIFT_MASK) | |
207 { | |
208 layout_image_slideshow_pause_toggle(lw); | |
209 } | |
210 else | |
211 { | |
212 stop_signal = FALSE; | |
213 } | |
214 break; | |
215 case 'V': case 'v': | |
216 case GDK_F11: | |
217 layout_image_full_screen_toggle(lw); | |
218 break; | |
219 default: | |
220 stop_signal = FALSE; | |
221 break; | |
222 } | |
223 } | |
224 | |
225 #if 0 | |
226 if (stop_signal) g_signal_stop_emission_by_name(G_OBJECT(widget), "key_press_event"); | |
227 #endif | |
228 | |
229 return stop_signal; | |
230 } | |
231 | |
232 void layout_keyboard_init(LayoutWindow *lw, GtkWidget *window) | |
233 { | |
234 g_signal_connect(G_OBJECT(window), "key_press_event", | |
235 G_CALLBACK(layout_key_press_cb), lw); | |
236 } | |
237 | |
238 /* | |
239 *----------------------------------------------------------------------------- | |
240 * menu callbacks | |
241 *----------------------------------------------------------------------------- | |
242 */ | |
243 | |
244 | |
245 static GtkWidget *layout_window(LayoutWindow *lw) | |
246 { | |
247 return lw->full_screen ? lw->full_screen->window : lw->window; | |
248 } | |
249 | |
250 static void layout_menu_new_window_cb(GtkAction *action, gpointer data) | |
251 { | |
252 LayoutWindow *lw = data; | |
253 LayoutWindow *nw; | |
254 | |
255 if (lw->full_screen) | |
256 layout_image_full_screen_stop(lw); | |
257 | |
258 nw = layout_new(NULL, FALSE, FALSE); | |
259 layout_sort_set(nw, options->file_sort.method, options->file_sort.ascending); | |
260 layout_set_path(nw, layout_get_path(lw)); | |
261 } | |
262 | |
263 static void layout_menu_new_cb(GtkAction *action, gpointer data) | |
264 { | |
265 LayoutWindow *lw = data; | |
266 if (lw->full_screen) | |
267 layout_image_full_screen_stop(lw); | |
268 collection_window_new(NULL); | |
269 } | |
270 | |
271 static void layout_menu_open_cb(GtkAction *action, gpointer data) | |
272 { | |
273 LayoutWindow *lw = data; | |
274 if (lw->full_screen) | |
275 layout_image_full_screen_stop(lw); | |
276 collection_dialog_load(NULL); | |
277 } | |
278 | |
279 static void layout_menu_search_cb(GtkAction *action, gpointer data) | |
280 { | |
281 LayoutWindow *lw = data; | |
282 if (lw->full_screen) | |
283 layout_image_full_screen_stop(lw); | |
284 | |
285 search_new(lw->path, layout_image_get_path(lw)); | |
286 } | |
287 | |
288 static void layout_menu_dupes_cb(GtkAction *action, gpointer data) | |
289 { | |
290 LayoutWindow *lw = data; | |
291 if (lw->full_screen) | |
292 layout_image_full_screen_stop(lw); | |
293 | |
294 dupe_window_new(DUPE_MATCH_NAME); | |
295 } | |
296 | |
297 static void layout_menu_pan_cb(GtkAction *action, gpointer data) | |
298 { | |
299 LayoutWindow *lw = data; | |
300 if (lw->full_screen) | |
301 layout_image_full_screen_stop(lw); | |
302 | |
303 pan_window_new(layout_get_path(lw)); | |
304 } | |
305 | |
306 static void layout_menu_print_cb(GtkAction *action, gpointer data) | |
307 { | |
308 LayoutWindow *lw = data; | |
309 | |
310 print_window_new(layout_image_get_fd(lw), layout_selection_list(lw), layout_list(lw), layout_window(lw)); | |
311 } | |
312 | |
313 static void layout_menu_dir_cb(GtkAction *action, gpointer data) | |
314 { | |
315 LayoutWindow *lw = data; | |
316 | |
317 file_util_create_dir(lw->path, layout_window(lw)); | |
318 } | |
319 | |
320 static void layout_menu_copy_cb(GtkAction *action, gpointer data) | |
321 { | |
322 LayoutWindow *lw = data; | |
323 | |
324 file_util_copy(NULL, layout_selection_list(lw), NULL, layout_window(lw)); | |
325 } | |
326 | |
327 static void layout_menu_move_cb(GtkAction *action, gpointer data) | |
328 { | |
329 LayoutWindow *lw = data; | |
330 | |
331 file_util_move(NULL, layout_selection_list(lw), NULL, layout_window(lw)); | |
332 } | |
333 | |
334 static void layout_menu_rename_cb(GtkAction *action, gpointer data) | |
335 { | |
336 LayoutWindow *lw = data; | |
337 | |
338 file_util_rename(NULL, layout_selection_list(lw), layout_window(lw)); | |
339 } | |
340 | |
341 static void layout_menu_delete_cb(GtkAction *action, gpointer data) | |
342 { | |
343 LayoutWindow *lw = data; | |
344 | |
345 file_util_delete(NULL, layout_selection_list(lw), layout_window(lw)); | |
346 } | |
347 | |
348 static void layout_menu_close_cb(GtkAction *action, gpointer data) | |
349 { | |
350 LayoutWindow *lw = data; | |
351 if (lw->full_screen) | |
352 layout_image_full_screen_stop(lw); | |
353 | |
354 layout_close(lw); | |
355 } | |
356 | |
357 static void layout_menu_exit_cb(GtkAction *action, gpointer data) | |
358 { | |
359 exit_program(); | |
360 } | |
361 | |
362 static void layout_menu_alter_90_cb(GtkAction *action, gpointer data) | |
363 { | |
364 LayoutWindow *lw = data; | |
365 | |
366 layout_image_alter(lw, ALTER_ROTATE_90); | |
367 } | |
368 | |
369 static void layout_menu_alter_90cc_cb(GtkAction *action, gpointer data) | |
370 { | |
371 LayoutWindow *lw = data; | |
372 | |
373 layout_image_alter(lw, ALTER_ROTATE_90_CC); | |
374 } | |
375 | |
376 static void layout_menu_alter_180_cb(GtkAction *action, gpointer data) | |
377 { | |
378 LayoutWindow *lw = data; | |
379 | |
380 layout_image_alter(lw, ALTER_ROTATE_180); | |
381 } | |
382 | |
383 static void layout_menu_alter_mirror_cb(GtkAction *action, gpointer data) | |
384 { | |
385 LayoutWindow *lw = data; | |
386 | |
387 layout_image_alter(lw, ALTER_MIRROR); | |
388 } | |
389 | |
390 static void layout_menu_alter_flip_cb(GtkAction *action, gpointer data) | |
391 { | |
392 LayoutWindow *lw = data; | |
393 | |
394 layout_image_alter(lw, ALTER_FLIP); | |
395 } | |
396 | |
397 static void layout_menu_alter_desaturate_cb(GtkAction *action, gpointer data) | |
398 { | |
399 LayoutWindow *lw = data; | |
400 | |
401 layout_image_alter(lw, ALTER_DESATURATE); | |
402 } | |
403 | |
404 static void layout_menu_info_cb(GtkAction *action, gpointer data) | |
405 { | |
406 LayoutWindow *lw = data; | |
407 GList *list; | |
408 FileData *fd = NULL; | |
409 | |
410 list = layout_selection_list(lw); | |
411 if (!list) fd = layout_image_get_fd(lw); | |
412 | |
413 info_window_new(fd, list); | |
414 } | |
415 | |
416 | |
417 static void layout_menu_config_cb(GtkAction *action, gpointer data) | |
418 { | |
419 LayoutWindow *lw = data; | |
420 if (lw->full_screen) | |
421 layout_image_full_screen_stop(lw); | |
422 | |
423 show_config_window(); | |
424 } | |
425 | |
426 static void layout_menu_remove_thumb_cb(GtkAction *action, gpointer data) | |
427 { | |
428 LayoutWindow *lw = data; | |
429 if (lw->full_screen) | |
430 layout_image_full_screen_stop(lw); | |
431 | |
432 cache_manager_show(); | |
433 } | |
434 | |
435 static void layout_menu_wallpaper_cb(GtkAction *action, gpointer data) | |
436 { | |
437 LayoutWindow *lw = data; | |
438 | |
439 layout_image_to_root(lw); | |
440 } | |
441 | |
442 static void layout_menu_zoom_in_cb(GtkAction *action, gpointer data) | |
443 { | |
444 LayoutWindow *lw = data; | |
445 | |
446 layout_image_zoom_adjust(lw, get_zoom_increment()); | |
447 } | |
448 | |
449 static void layout_menu_zoom_out_cb(GtkAction *action, gpointer data) | |
450 { | |
451 LayoutWindow *lw = data; | |
452 | |
453 layout_image_zoom_adjust(lw, -get_zoom_increment()); | |
454 } | |
455 | |
456 static void layout_menu_zoom_1_1_cb(GtkAction *action, gpointer data) | |
457 { | |
458 LayoutWindow *lw = data; | |
459 | |
460 layout_image_zoom_set(lw, 1.0); | |
461 } | |
462 | |
463 static void layout_menu_zoom_fit_cb(GtkAction *action, gpointer data) | |
464 { | |
465 LayoutWindow *lw = data; | |
466 | |
467 layout_image_zoom_set(lw, 0.0); | |
468 } | |
469 | |
470 static void layout_menu_zoom_fit_hor_cb(GtkAction *action, gpointer data) | |
471 { | |
472 LayoutWindow *lw = data; | |
473 | |
474 layout_image_zoom_set_fill_geometry(lw, TRUE); | |
475 } | |
476 | |
477 static void layout_menu_zoom_fit_vert_cb(GtkAction *action, gpointer data) | |
478 { | |
479 LayoutWindow *lw = data; | |
480 | |
481 layout_image_zoom_set_fill_geometry(lw, FALSE); | |
482 } | |
483 | |
484 static void layout_menu_zoom_2_1_cb(GtkAction *action, gpointer data) | |
485 { | |
486 LayoutWindow *lw = data; | |
487 | |
488 layout_image_zoom_set(lw, 2.0); | |
489 } | |
490 | |
491 static void layout_menu_zoom_3_1_cb(GtkAction *action, gpointer data) | |
492 { | |
493 LayoutWindow *lw = data; | |
494 | |
495 layout_image_zoom_set(lw, 3.0); | |
496 } | |
497 static void layout_menu_zoom_4_1_cb(GtkAction *action, gpointer data) | |
498 { | |
499 LayoutWindow *lw = data; | |
500 | |
501 layout_image_zoom_set(lw, 4.0); | |
502 } | |
503 | |
504 static void layout_menu_zoom_1_2_cb(GtkAction *action, gpointer data) | |
505 { | |
506 LayoutWindow *lw = data; | |
507 | |
508 layout_image_zoom_set(lw, -2.0); | |
509 } | |
510 | |
511 static void layout_menu_zoom_1_3_cb(GtkAction *action, gpointer data) | |
512 { | |
513 LayoutWindow *lw = data; | |
514 | |
515 layout_image_zoom_set(lw, -3.0); | |
516 } | |
517 | |
518 static void layout_menu_zoom_1_4_cb(GtkAction *action, gpointer data) | |
519 { | |
520 LayoutWindow *lw = data; | |
521 | |
522 layout_image_zoom_set(lw, -4.0); | |
523 } | |
524 | |
525 | |
526 static void layout_menu_split_cb(GtkRadioAction *action, GtkRadioAction *current, gpointer data) | |
527 { | |
528 LayoutWindow *lw = data; | |
529 if (lw->full_screen) | |
530 layout_image_full_screen_stop(lw); | |
531 | |
532 ImageSplitMode mode = gtk_radio_action_get_current_value(action); | |
533 | |
534 if (mode == lw->split_mode) mode = 0; /* toggle back */ | |
535 | |
536 layout_split_change(lw, mode); | |
537 } | |
538 | |
539 static void layout_menu_connect_scroll_cb(GtkToggleAction *action, gpointer data) | |
540 { | |
541 LayoutWindow *lw = data; | |
542 lw->connect_scroll = gtk_toggle_action_get_active(action); | |
543 } | |
544 | |
545 static void layout_menu_connect_zoom_cb(GtkToggleAction *action, gpointer data) | |
546 { | |
547 LayoutWindow *lw = data; | |
548 lw->connect_zoom = gtk_toggle_action_get_active(action); | |
549 } | |
550 | |
551 | |
552 static void layout_menu_thumb_cb(GtkToggleAction *action, gpointer data) | |
553 { | |
554 LayoutWindow *lw = data; | |
555 | |
556 layout_thumb_set(lw, gtk_toggle_action_get_active(action)); | |
557 } | |
558 | |
559 | |
560 static void layout_menu_list_cb(GtkRadioAction *action, GtkRadioAction *current, gpointer data) | |
561 { | |
562 LayoutWindow *lw = data; | |
563 if (lw->full_screen) | |
564 layout_image_full_screen_stop(lw); | |
565 | |
566 layout_views_set(lw, lw->dir_view_type, (gtk_radio_action_get_current_value(action) == 1)); | |
567 } | |
568 | |
569 static void layout_menu_view_dir_as_cb(GtkRadioAction *action, GtkRadioAction *current, gpointer data) | |
570 { | |
571 LayoutWindow *lw = data; | |
572 if (lw->full_screen) | |
573 layout_image_full_screen_stop(lw); | |
574 | |
575 layout_views_set(lw, (DirViewType) gtk_radio_action_get_current_value(action), lw->icon_view); | |
576 } | |
577 | |
578 static void layout_menu_view_in_new_window_cb(GtkAction *action, gpointer data) | |
579 { | |
580 LayoutWindow *lw = data; | |
581 | |
582 if (lw->full_screen) | |
583 layout_image_full_screen_stop(lw); | |
584 view_window_new(layout_image_get_fd(lw)); | |
585 } | |
586 | |
587 static void layout_menu_fullscreen_cb(GtkAction *action, gpointer data) | |
588 { | |
589 LayoutWindow *lw = data; | |
590 | |
591 layout_image_full_screen_toggle(lw); | |
592 } | 538 } |
593 | 539 |
594 static void layout_menu_overlay_cb(GtkAction *action, gpointer data) | 540 static void layout_menu_overlay_cb(GtkAction *action, gpointer data) |
595 { | 541 { |
596 LayoutWindow *lw = data; | 542 LayoutWindow *lw = data; |
708 static void layout_menu_slideshow_cb(GtkAction *action, gpointer data) | 654 static void layout_menu_slideshow_cb(GtkAction *action, gpointer data) |
709 { | 655 { |
710 LayoutWindow *lw = data; | 656 LayoutWindow *lw = data; |
711 | 657 |
712 layout_image_slideshow_toggle(lw); | 658 layout_image_slideshow_toggle(lw); |
659 } | |
660 | |
661 static void layout_menu_slideshow_pause_cb(GtkAction *action, gpointer data) | |
662 { | |
663 LayoutWindow *lw = data; | |
664 | |
665 layout_image_slideshow_pause_toggle(lw); | |
713 } | 666 } |
714 | 667 |
715 static void layout_menu_help_cb(GtkAction *action, gpointer data) | 668 static void layout_menu_help_cb(GtkAction *action, gpointer data) |
716 { | 669 { |
717 LayoutWindow *lw = data; | 670 LayoutWindow *lw = data; |
1057 { "SplitMenu", NULL, N_("_Split") }, | 1010 { "SplitMenu", NULL, N_("_Split") }, |
1058 { "HelpMenu", NULL, N_("_Help") }, | 1011 { "HelpMenu", NULL, N_("_Help") }, |
1059 | 1012 |
1060 { "FirstImage", GTK_STOCK_GOTO_TOP, N_("_First Image"), "Home", NULL, CB(layout_menu_image_first_cb) }, | 1013 { "FirstImage", GTK_STOCK_GOTO_TOP, N_("_First Image"), "Home", NULL, CB(layout_menu_image_first_cb) }, |
1061 { "PrevImage", GTK_STOCK_GO_UP, N_("_Previous Image"), "BackSpace", NULL, CB(layout_menu_image_prev_cb) }, | 1014 { "PrevImage", GTK_STOCK_GO_UP, N_("_Previous Image"), "BackSpace", NULL, CB(layout_menu_image_prev_cb) }, |
1015 { "PrevImageAlt1", GTK_STOCK_GO_UP, N_("_Previous Image"), "Page_Up", NULL, CB(layout_menu_image_prev_cb) }, | |
1016 { "PrevImageAlt2", GTK_STOCK_GO_UP, N_("_Previous Image"), "KP_Page_Up", NULL, CB(layout_menu_image_prev_cb) }, | |
1062 { "NextImage", GTK_STOCK_GO_DOWN, N_("_Next Image"), "space", NULL, CB(layout_menu_image_next_cb) }, | 1017 { "NextImage", GTK_STOCK_GO_DOWN, N_("_Next Image"), "space", NULL, CB(layout_menu_image_next_cb) }, |
1018 { "NextImageAlt1", GTK_STOCK_GO_DOWN, N_("_Next Image"), "Page_Down", NULL, CB(layout_menu_image_next_cb) }, | |
1019 { "NextImageAlt2", GTK_STOCK_GO_DOWN, N_("_Next Image"), "KP_Page_Down", NULL, CB(layout_menu_image_next_cb) }, | |
1063 { "LastImage", GTK_STOCK_GOTO_BOTTOM, N_("_Last Image"), "End", NULL, CB(layout_menu_image_last_cb) }, | 1020 { "LastImage", GTK_STOCK_GOTO_BOTTOM, N_("_Last Image"), "End", NULL, CB(layout_menu_image_last_cb) }, |
1064 | 1021 |
1065 | 1022 |
1066 { "NewWindow", GTK_STOCK_NEW, N_("New _window"), NULL, NULL, CB(layout_menu_new_window_cb) }, | 1023 { "NewWindow", GTK_STOCK_NEW, N_("New _window"), NULL, NULL, CB(layout_menu_new_window_cb) }, |
1067 { "NewCollection", GTK_STOCK_INDEX,N_("_New collection"), "C", NULL, CB(layout_menu_new_cb) }, | 1024 { "NewCollection", GTK_STOCK_INDEX,N_("_New collection"), "C", NULL, CB(layout_menu_new_cb) }, |
1074 { "NewFolder", NULL, N_("N_ew folder..."), "<control>F", NULL, CB(layout_menu_dir_cb) }, | 1031 { "NewFolder", NULL, N_("N_ew folder..."), "<control>F", NULL, CB(layout_menu_dir_cb) }, |
1075 { "Copy", NULL, N_("_Copy..."), "<control>C", NULL, CB(layout_menu_copy_cb) }, | 1032 { "Copy", NULL, N_("_Copy..."), "<control>C", NULL, CB(layout_menu_copy_cb) }, |
1076 { "Move", NULL, N_("_Move..."), "<control>M", NULL, CB(layout_menu_move_cb) }, | 1033 { "Move", NULL, N_("_Move..."), "<control>M", NULL, CB(layout_menu_move_cb) }, |
1077 { "Rename", NULL, N_("_Rename..."), "<control>R", NULL, CB(layout_menu_rename_cb) }, | 1034 { "Rename", NULL, N_("_Rename..."), "<control>R", NULL, CB(layout_menu_rename_cb) }, |
1078 { "Delete", GTK_STOCK_DELETE, N_("_Delete..."), "<control>D", NULL, CB(layout_menu_delete_cb) }, | 1035 { "Delete", GTK_STOCK_DELETE, N_("_Delete..."), "<control>D", NULL, CB(layout_menu_delete_cb) }, |
1036 { "DeleteAlt1",GTK_STOCK_DELETE, N_("_Delete..."), "Delete", NULL, CB(layout_menu_delete_cb) }, | |
1037 { "DeleteAlt2",GTK_STOCK_DELETE, N_("_Delete..."), "KP_Delete", NULL, CB(layout_menu_delete_cb) }, | |
1079 { "CloseWindow", GTK_STOCK_CLOSE,N_("C_lose window"), "<control>W", NULL, CB(layout_menu_close_cb) }, | 1038 { "CloseWindow", GTK_STOCK_CLOSE,N_("C_lose window"), "<control>W", NULL, CB(layout_menu_close_cb) }, |
1080 { "Quit", GTK_STOCK_QUIT, N_("_Quit"), "<control>Q", NULL, CB(layout_menu_exit_cb) }, | 1039 { "Quit", GTK_STOCK_QUIT, N_("_Quit"), "<control>Q", NULL, CB(layout_menu_exit_cb) }, |
1081 | 1040 |
1082 { "Editor0", NULL, "editor0", NULL, NULL, CB(layout_menu_edit_cb) }, | 1041 { "Editor0", NULL, "editor0", NULL, NULL, CB(layout_menu_edit_cb) }, |
1083 { "Editor1", NULL, "editor1", NULL, NULL, CB(layout_menu_edit_cb) }, | 1042 { "Editor1", NULL, "editor1", NULL, NULL, CB(layout_menu_edit_cb) }, |
1101 { "Preferences",GTK_STOCK_PREFERENCES,N_("P_references..."), "<control>O", NULL, CB(layout_menu_config_cb) }, | 1060 { "Preferences",GTK_STOCK_PREFERENCES,N_("P_references..."), "<control>O", NULL, CB(layout_menu_config_cb) }, |
1102 { "Maintenance", NULL, N_("_Thumbnail maintenance..."),NULL, NULL, CB(layout_menu_remove_thumb_cb) }, | 1061 { "Maintenance", NULL, N_("_Thumbnail maintenance..."),NULL, NULL, CB(layout_menu_remove_thumb_cb) }, |
1103 { "Wallpaper", NULL, N_("Set as _wallpaper"),NULL, NULL, CB(layout_menu_wallpaper_cb) }, | 1062 { "Wallpaper", NULL, N_("Set as _wallpaper"),NULL, NULL, CB(layout_menu_wallpaper_cb) }, |
1104 | 1063 |
1105 { "ZoomIn", GTK_STOCK_ZOOM_IN, N_("Zoom _in"), "equal", NULL, CB(layout_menu_zoom_in_cb) }, | 1064 { "ZoomIn", GTK_STOCK_ZOOM_IN, N_("Zoom _in"), "equal", NULL, CB(layout_menu_zoom_in_cb) }, |
1065 { "ZoomInAlt1",GTK_STOCK_ZOOM_IN, N_("Zoom _in"), "plus", NULL, CB(layout_menu_zoom_in_cb) }, | |
1066 { "ZoomInAlt2",GTK_STOCK_ZOOM_IN, N_("Zoom _in"), "KP_Add", NULL, CB(layout_menu_zoom_in_cb) }, | |
1106 { "ZoomOut", GTK_STOCK_ZOOM_OUT, N_("Zoom _out"), "minus", NULL, CB(layout_menu_zoom_out_cb) }, | 1067 { "ZoomOut", GTK_STOCK_ZOOM_OUT, N_("Zoom _out"), "minus", NULL, CB(layout_menu_zoom_out_cb) }, |
1068 { "ZoomOutAlt1",GTK_STOCK_ZOOM_OUT, N_("Zoom _out"), "KP_Subtract", NULL, CB(layout_menu_zoom_out_cb) }, | |
1107 { "Zoom100", GTK_STOCK_ZOOM_100, N_("Zoom _1:1"), "Z", NULL, CB(layout_menu_zoom_1_1_cb) }, | 1069 { "Zoom100", GTK_STOCK_ZOOM_100, N_("Zoom _1:1"), "Z", NULL, CB(layout_menu_zoom_1_1_cb) }, |
1070 { "Zoom100Alt1",GTK_STOCK_ZOOM_100, N_("Zoom _1:1"), "KP_Divide", NULL, CB(layout_menu_zoom_1_1_cb) }, | |
1108 { "ZoomFit", GTK_STOCK_ZOOM_FIT, N_("_Zoom to fit"), "X", NULL, CB(layout_menu_zoom_fit_cb) }, | 1071 { "ZoomFit", GTK_STOCK_ZOOM_FIT, N_("_Zoom to fit"), "X", NULL, CB(layout_menu_zoom_fit_cb) }, |
1072 { "ZoomFitAlt1",GTK_STOCK_ZOOM_FIT, N_("_Zoom to fit"), "KP_Multiply", NULL, CB(layout_menu_zoom_fit_cb) }, | |
1109 { "ZoomFillHor", NULL, N_("Fit _Horizontally"),"H", NULL, CB(layout_menu_zoom_fit_hor_cb) }, | 1073 { "ZoomFillHor", NULL, N_("Fit _Horizontally"),"H", NULL, CB(layout_menu_zoom_fit_hor_cb) }, |
1110 { "ZoomFillVert", NULL, N_("Fit _Vorizontally"),"W", NULL, CB(layout_menu_zoom_fit_vert_cb) }, | 1074 { "ZoomFillVert", NULL, N_("Fit _Vorizontally"),"W", NULL, CB(layout_menu_zoom_fit_vert_cb) }, |
1111 { "Zoom200", NULL, N_("Zoom _2:1"), NULL, NULL, CB(layout_menu_zoom_2_1_cb) }, | 1075 { "Zoom200", NULL, N_("Zoom _2:1"), NULL, NULL, CB(layout_menu_zoom_2_1_cb) }, |
1112 { "Zoom300", NULL, N_("Zoom _3:1"), NULL, NULL, CB(layout_menu_zoom_3_1_cb) }, | 1076 { "Zoom300", NULL, N_("Zoom _3:1"), NULL, NULL, CB(layout_menu_zoom_3_1_cb) }, |
1113 { "Zoom400", NULL, N_("Zoom _4:1"), NULL, NULL, CB(layout_menu_zoom_4_1_cb) }, | 1077 { "Zoom400", NULL, N_("Zoom _4:1"), NULL, NULL, CB(layout_menu_zoom_4_1_cb) }, |
1117 | 1081 |
1118 | 1082 |
1119 { "ViewInNewWindow", NULL, N_("_View in new window"), "<control>V", NULL, CB(layout_menu_view_in_new_window_cb) }, | 1083 { "ViewInNewWindow", NULL, N_("_View in new window"), "<control>V", NULL, CB(layout_menu_view_in_new_window_cb) }, |
1120 | 1084 |
1121 { "FullScreen", NULL, N_("F_ull screen"), "F", NULL, CB(layout_menu_fullscreen_cb) }, | 1085 { "FullScreen", NULL, N_("F_ull screen"), "F", NULL, CB(layout_menu_fullscreen_cb) }, |
1086 { "FullScreenAlt1", NULL, N_("F_ull screen"), "V", NULL, CB(layout_menu_fullscreen_cb) }, | |
1087 { "FullScreenAlt2", NULL, N_("F_ull screen"), "F11", NULL, CB(layout_menu_fullscreen_cb) }, | |
1088 { "Escape", NULL, N_("Escape"), "Escape", NULL, CB(layout_menu_escape_cb) }, | |
1089 { "EscapeAlt1", NULL, N_("Escape"), "Q", NULL, CB(layout_menu_escape_cb) }, | |
1122 { "ImageOverlay", NULL, N_("_Image Overlay"), "I", NULL, CB(layout_menu_overlay_cb) }, | 1090 { "ImageOverlay", NULL, N_("_Image Overlay"), "I", NULL, CB(layout_menu_overlay_cb) }, |
1123 { "HistogramChan", NULL, N_("Histogram _channels"), "K", NULL, CB(layout_menu_histogram_chan_cb) }, | 1091 { "HistogramChan", NULL, N_("Histogram _channels"), "K", NULL, CB(layout_menu_histogram_chan_cb) }, |
1124 { "HistogramLog", NULL, N_("Histogram _log mode"), "J", NULL, CB(layout_menu_histogram_log_cb) }, | 1092 { "HistogramLog", NULL, N_("Histogram _log mode"), "J", NULL, CB(layout_menu_histogram_log_cb) }, |
1125 { "HideTools", NULL, N_("_Hide file list"), "<control>H", NULL, CB(layout_menu_hide_cb) }, | 1093 { "HideTools", NULL, N_("_Hide file list"), "<control>H", NULL, CB(layout_menu_hide_cb) }, |
1126 { "SlideShow", NULL, N_("Toggle _slideshow"),"S", NULL, CB(layout_menu_slideshow_cb) }, | 1094 { "SlideShow", NULL, N_("Toggle _slideshow"),"S", NULL, CB(layout_menu_slideshow_cb) }, |
1095 { "SlideShowPause", NULL, N_("_Pause _slideshow"),"P", NULL, CB(layout_menu_slideshow_pause_cb) }, | |
1127 { "Refresh", GTK_STOCK_REFRESH, N_("_Refresh"), "R", NULL, CB(layout_menu_refresh_cb) }, | 1096 { "Refresh", GTK_STOCK_REFRESH, N_("_Refresh"), "R", NULL, CB(layout_menu_refresh_cb) }, |
1128 | 1097 |
1129 { "HelpContents", GTK_STOCK_HELP, N_("_Contents"), "F1", NULL, CB(layout_menu_help_cb) }, | 1098 { "HelpContents", GTK_STOCK_HELP, N_("_Contents"), "F1", NULL, CB(layout_menu_help_cb) }, |
1130 { "HelpShortcuts", NULL, N_("_Keyboard shortcuts"),NULL, NULL, CB(layout_menu_help_keys_cb) }, | 1099 { "HelpShortcuts", NULL, N_("_Keyboard shortcuts"),NULL, NULL, CB(layout_menu_help_keys_cb) }, |
1131 { "HelpNotes", NULL, N_("_Release notes"), NULL, NULL, CB(layout_menu_notes_cb) }, | 1100 { "HelpNotes", NULL, N_("_Release notes"), NULL, NULL, CB(layout_menu_notes_cb) }, |
1150 }; | 1119 }; |
1151 | 1120 |
1152 static GtkRadioActionEntry menu_split_radio_entries[] = { | 1121 static GtkRadioActionEntry menu_split_radio_entries[] = { |
1153 { "SplitHorizontal", NULL, N_("Horizontal"), "E", NULL, SPLIT_HOR }, | 1122 { "SplitHorizontal", NULL, N_("Horizontal"), "E", NULL, SPLIT_HOR }, |
1154 { "SplitVertical", NULL, N_("Vertical"), "U", NULL, SPLIT_VERT }, | 1123 { "SplitVertical", NULL, N_("Vertical"), "U", NULL, SPLIT_VERT }, |
1155 { "SplitQuad", NULL, N_("Quad"), "Q", NULL, SPLIT_QUAD }, | 1124 { "SplitQuad", NULL, N_("Quad"), NULL, NULL, SPLIT_QUAD }, |
1156 { "SplitSingle", NULL, N_("Single"), "Y", NULL, SPLIT_NONE } | 1125 { "SplitSingle", NULL, N_("Single"), "Y", NULL, SPLIT_NONE } |
1157 }; | 1126 }; |
1158 | 1127 |
1159 | 1128 |
1160 #undef CB | 1129 #undef CB |
1271 " <menuitem action='SBarKeywords'/>" | 1240 " <menuitem action='SBarKeywords'/>" |
1272 " <menuitem action='SBarExif'/>" | 1241 " <menuitem action='SBarExif'/>" |
1273 " <menuitem action='SBarSort'/>" | 1242 " <menuitem action='SBarSort'/>" |
1274 " <separator/>" | 1243 " <separator/>" |
1275 " <menuitem action='SlideShow'/>" | 1244 " <menuitem action='SlideShow'/>" |
1245 " <menuitem action='SlideShowPause'/>" | |
1276 " <menuitem action='Refresh'/>" | 1246 " <menuitem action='Refresh'/>" |
1277 " </menu>" | 1247 " </menu>" |
1278 " <menu action='HelpMenu'>" | 1248 " <menu action='HelpMenu'>" |
1279 " <separator/>" | 1249 " <separator/>" |
1280 " <menuitem action='HelpContents'/>" | 1250 " <menuitem action='HelpContents'/>" |
1282 " <menuitem action='HelpNotes'/>" | 1252 " <menuitem action='HelpNotes'/>" |
1283 " <separator/>" | 1253 " <separator/>" |
1284 " <menuitem action='About'/>" | 1254 " <menuitem action='About'/>" |
1285 " </menu>" | 1255 " </menu>" |
1286 " </menubar>" | 1256 " </menubar>" |
1257 "<accelerator action='PrevImageAlt1'/>" | |
1258 "<accelerator action='PrevImageAlt2'/>" | |
1259 "<accelerator action='NextImageAlt1'/>" | |
1260 "<accelerator action='NextImageAlt2'/>" | |
1261 "<accelerator action='DeleteAlt1'/>" | |
1262 "<accelerator action='DeleteAlt2'/>" | |
1263 "<accelerator action='ZoomInAlt1'/>" | |
1264 "<accelerator action='ZoomInAlt2'/>" | |
1265 "<accelerator action='ZoomOutAlt1'/>" | |
1266 "<accelerator action='Zoom100Alt1'/>" | |
1267 "<accelerator action='ZoomFitAlt1'/>" | |
1268 "<accelerator action='FullScreenAlt1'/>" | |
1269 "<accelerator action='FullScreenAlt2'/>" | |
1270 "<accelerator action='Escape'/>" | |
1271 "<accelerator action='EscapeAlt1'/>" | |
1287 "</ui>"; | 1272 "</ui>"; |
1288 | 1273 |
1289 | 1274 |
1290 static gchar *menu_translate(const gchar *path, gpointer data) | 1275 static gchar *menu_translate(const gchar *path, gpointer data) |
1291 { | 1276 { |