Mercurial > geeqie
comparison src/img-view.c @ 117:0c2e1f0a001b
Wed Nov 29 14:28:30 2006 John Ellis <johne@verizon.net>
* image-overlay.[ch]: Rewrite most of the information overlay code to
be more flexible and easily extended.
* image.[ch], typedefs.h: Remove image_new_func, and replace it with
image_state_func callback which is much more informative.
* img-view.c, layout.c, layout_image.c: Updates for new image overlay
function names.
author | gqview |
---|---|
date | Wed, 29 Nov 2006 19:38:25 +0000 |
parents | 50dc5a14d37b |
children | ac0f7f942c4d |
comparison
equal
deleted
inserted
replaced
116:1bd40943dc2a | 117:0c2e1f0a001b |
---|---|
43 FullScreenData *fs; | 43 FullScreenData *fs; |
44 SlideShowData *ss; | 44 SlideShowData *ss; |
45 | 45 |
46 GList *list; | 46 GList *list; |
47 GList *list_pointer; | 47 GList *list_pointer; |
48 | |
49 gint overlay_id; | |
50 }; | 48 }; |
51 | 49 |
52 | 50 |
53 static GList *view_window_list = NULL; | 51 static GList *view_window_list = NULL; |
54 | 52 |
687 if (vw->ss) vw->ss->imd = vw->imd; | 685 if (vw->ss) vw->ss->imd = vw->imd; |
688 } | 686 } |
689 | 687 |
690 static void view_fullscreen_toggle(ViewWindow *vw, gint force_off) | 688 static void view_fullscreen_toggle(ViewWindow *vw, gint force_off) |
691 { | 689 { |
690 gint info, status; | |
691 | |
692 if (force_off && !vw->fs) return; | 692 if (force_off && !vw->fs) return; |
693 | 693 |
694 if (vw->fs) | 694 if (vw->fs) |
695 { | 695 { |
696 if (image_osd_get(vw->fs->imd, &info, &status)) | |
697 { | |
698 image_osd_set(vw->imd, info, status); | |
699 } | |
700 | |
696 fullscreen_stop(vw->fs); | 701 fullscreen_stop(vw->fs); |
697 | |
698 if (vw->overlay_id != -1) vw->overlay_id = image_overlay_info_enable(vw->imd); | |
699 } | 702 } |
700 else | 703 else |
701 { | 704 { |
702 vw->fs = fullscreen_start(vw->window, vw->imd, view_fullscreen_stop_func, vw); | 705 vw->fs = fullscreen_start(vw->window, vw->imd, view_fullscreen_stop_func, vw); |
703 | 706 |
705 g_signal_connect(G_OBJECT(vw->fs->window), "key_press_event", | 708 g_signal_connect(G_OBJECT(vw->fs->window), "key_press_event", |
706 G_CALLBACK(view_window_key_press_cb), vw); | 709 G_CALLBACK(view_window_key_press_cb), vw); |
707 | 710 |
708 if (vw->ss) vw->ss->imd = vw->fs->imd; | 711 if (vw->ss) vw->ss->imd = vw->fs->imd; |
709 | 712 |
710 if (vw->overlay_id != -1) | 713 if (image_osd_get(vw->imd, &info, &status)) |
711 { | 714 { |
712 image_overlay_info_disable(vw->imd, vw->overlay_id); | 715 image_osd_set(vw->imd, FALSE, FALSE); |
713 vw->overlay_id = image_overlay_info_enable(vw->fs->imd); | 716 image_osd_set(vw->fs->imd, info, status); |
714 } | 717 } |
715 } | 718 } |
716 } | 719 } |
717 | 720 |
718 static void view_overlay_toggle(ViewWindow *vw) | 721 static void view_overlay_toggle(ViewWindow *vw) |
719 { | 722 { |
720 ImageWindow *imd; | 723 ImageWindow *imd; |
721 | 724 |
722 imd = view_window_active_image(vw); | 725 imd = view_window_active_image(vw); |
723 | 726 |
724 if (vw->overlay_id == -1) | 727 if (!image_osd_get(imd, NULL, NULL)) |
725 { | 728 { |
726 vw->overlay_id = image_overlay_info_enable(imd); | 729 image_osd_set(imd, TRUE, TRUE); |
727 } | 730 } |
728 else | 731 else |
729 { | 732 { |
730 image_overlay_info_disable(imd, vw->overlay_id); | 733 image_osd_set(imd, FALSE, FALSE); |
731 vw->overlay_id = -1; | |
732 } | 734 } |
733 } | 735 } |
734 | 736 |
735 static void view_slideshow_next(ViewWindow *vw) | 737 static void view_slideshow_next(ViewWindow *vw) |
736 { | 738 { |
819 vw = g_new0(ViewWindow, 1); | 821 vw = g_new0(ViewWindow, 1); |
820 vw->fs = NULL; | 822 vw->fs = NULL; |
821 vw->ss = NULL; | 823 vw->ss = NULL; |
822 vw->list = NULL; | 824 vw->list = NULL; |
823 vw->list_pointer = NULL; | 825 vw->list_pointer = NULL; |
824 | |
825 vw->overlay_id = -1; | |
826 | 826 |
827 vw->window = gtk_window_new(GTK_WINDOW_TOPLEVEL); | 827 vw->window = gtk_window_new(GTK_WINDOW_TOPLEVEL); |
828 | 828 |
829 geometry.min_width = 8; | 829 geometry.min_width = 8; |
830 geometry.min_height = 8; | 830 geometry.min_height = 8; |
1625 | 1625 |
1626 image_change_path(imd, path, image_zoom_get_default(imd, zoom_mode)); | 1626 image_change_path(imd, path, image_zoom_get_default(imd, zoom_mode)); |
1627 } | 1627 } |
1628 } | 1628 } |
1629 | 1629 |
1630 if (vw->overlay_id != -1) image_overlay_update(imd, vw->overlay_id); | 1630 image_osd_update(imd); |
1631 } | 1631 } |
1632 | 1632 |
1633 static void view_real_moved(ViewWindow *vw, const gchar *source, const gchar *dest) | 1633 static void view_real_moved(ViewWindow *vw, const gchar *source, const gchar *dest) |
1634 { | 1634 { |
1635 ImageWindow *imd; | 1635 ImageWindow *imd; |