Index: src/cheese-window.c =================================================================== --- src/cheese-window.c (revision 539) +++ src/cheese-window.c (working copy) @@ -35,6 +35,10 @@ #include #include +#ifdef HILDON +#include +#endif + #include "cheese-countdown.h" #include "cheese-effect-chooser.h" #include "cheese-fileutil.h" @@ -44,7 +48,6 @@ #include "ephy-spinner.h" #include "gst-audio-play.h" - #define SHUTTER_SOUNDS 5 typedef enum @@ -72,6 +75,7 @@ GtkWidget *notebook_bar; GtkWidget *main_vbox; + GtkWidget *video_vbox; GtkWidget *effect_frame; GtkWidget *effect_chooser; @@ -97,6 +101,11 @@ GtkWidget *screen; GtkWidget *take_picture; +#ifdef HILDON + GtkWidget *main_hbox; + GtkWidget *subwindow; +#endif + GtkActionGroup *actions_main; GtkActionGroup *actions_toggle; GtkActionGroup *actions_effects; @@ -992,11 +1001,18 @@ static void cheese_window_create_window (CheeseWindow *cheese_window) { - GtkWidget *menubar; GError *error=NULL; char *path; GtkBuilder* builder; +#ifdef HILDON + HildonProgram *program = hildon_program_get_instance(); + GtkWidget *menu; + GtkWidget *menuitem; +#else + GtkWidget *menubar; +#endif + builder = gtk_builder_new (); gtk_builder_add_from_file (builder, PACKAGE_DATADIR"/cheese.ui", &error); @@ -1016,6 +1032,7 @@ cheese_window->label_take_photo = GTK_WIDGET (gtk_builder_get_object (builder, "label_take_photo")); cheese_window->label_video = GTK_WIDGET (gtk_builder_get_object (builder, "label_video")); cheese_window->main_vbox = GTK_WIDGET (gtk_builder_get_object (builder, "main_vbox")); + cheese_window->video_vbox = GTK_WIDGET (gtk_builder_get_object (builder, "video_vbox")); cheese_window->notebook = GTK_WIDGET (gtk_builder_get_object (builder, "notebook")); cheese_window->notebook_bar = GTK_WIDGET (gtk_builder_get_object (builder, "notebook_bar")); cheese_window->screen = GTK_WIDGET (gtk_builder_get_object (builder, "video_screen")); @@ -1025,6 +1042,23 @@ cheese_window->countdown_frame = GTK_WIDGET (gtk_builder_get_object (builder, "countdown_frame")); cheese_window->effect_frame = GTK_WIDGET (gtk_builder_get_object (builder, "effect_frame")); +#ifdef HILDON + cheese_window->window = hildon_window_new(); + cheese_window->main_hbox = gtk_hbox_new(FALSE, 0); + hildon_program_add_window (program, HILDON_WINDOW(cheese_window->window)); + gtk_container_add (GTK_CONTAINER(cheese_window->window), cheese_window->main_hbox); + gtk_widget_ref(cheese_window->thumb_scrollwindow); + gtk_widget_ref(cheese_window->video_vbox); + gtk_container_remove(GTK_CONTAINER(cheese_window->video_vbox), cheese_window->thumb_scrollwindow); + gtk_container_remove(GTK_CONTAINER(cheese_window->main_vbox),cheese_window->video_vbox); + gtk_box_pack_start (GTK_BOX(cheese_window->main_hbox), cheese_window->video_vbox, TRUE, TRUE, 0); + gtk_box_pack_start (GTK_BOX(cheese_window->main_hbox), GTK_WIDGET(cheese_window->thumb_scrollwindow), FALSE, FALSE, 0); + gtk_widget_destroy(cheese_window->main_vbox); + gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW(cheese_window->thumb_scrollwindow), GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC); + gtk_widget_unref(cheese_window->thumb_scrollwindow); + gtk_widget_unref(cheese_window->video_vbox); +#endif + g_object_unref (builder); char *str = g_strconcat ("", _("_Take a photo"), "", NULL); @@ -1124,8 +1158,25 @@ g_error_free (error); } +#ifdef HILDON + menu = gtk_menu_new(); + menuitem = gtk_menu_item_new_with_label(_("Quit")); + g_signal_connect_swapped(menuitem,"activate", + GTK_SIGNAL_FUNC(cheese_window_cmd_close), + NULL); + gtk_menu_append(menu, menuitem); + + menuitem = gtk_menu_item_new_with_label(_("About")); + g_signal_connect_swapped(menuitem,"activate", + GTK_SIGNAL_FUNC(cheese_window_cmd_about), + cheese_window->window); + gtk_menu_append(menu, menuitem); + + hildon_window_set_menu (HILDON_WINDOW(cheese_window->window),GTK_MENU(menu)); +#else menubar = gtk_ui_manager_get_widget (cheese_window->ui_manager, "/MainMenu"); gtk_box_pack_start (GTK_BOX (cheese_window->main_vbox), menubar, FALSE, FALSE, 0); +#endif cheese_window->thumb_view_popup_menu = gtk_ui_manager_get_widget (cheese_window->ui_manager, "/ThumbnailPopup"); Index: src/cheese-fileutil.c =================================================================== --- src/cheese-fileutil.c (revision 539) +++ src/cheese-fileutil.c (working copy) @@ -31,8 +31,11 @@ cheese_fileutil_get_path () { char *path; - +#ifdef HILDON + path = g_strjoin (G_DIR_SEPARATOR_S, g_get_home_dir(), "Mydocs", ".images", NULL); +#else path = g_strjoin (G_DIR_SEPARATOR_S, g_get_home_dir(), ".gnome2", "cheese", NULL); +#endif return path; } Index: src/cheese-thumb-view.c =================================================================== --- src/cheese-thumb-view.c (revision 539) +++ src/cheese-thumb-view.c (working copy) @@ -366,7 +366,11 @@ g_free (path); gtk_icon_view_set_pixbuf_column (GTK_ICON_VIEW (thumb_view), 0); +#ifdef HILDON + gtk_icon_view_set_columns (GTK_ICON_VIEW (thumb_view), -1); +#else gtk_icon_view_set_columns (GTK_ICON_VIEW (thumb_view), G_MAXINT); +#endif gtk_icon_view_enable_model_drag_source (GTK_ICON_VIEW (thumb_view), GDK_BUTTON1_MASK, target_table, G_N_ELEMENTS (target_table), Index: src/Makefile.am =================================================================== --- src/Makefile.am (revision 539) +++ src/Makefile.am (working copy) @@ -34,5 +34,10 @@ gst-audio-play.h cheese_LDADD = \ - $(CHEESE_LIBS) + $(CHEESE_LIBS) +if WITH_HILDON + INCLUDES += $(HILDON_CFLAGS) -DHILDON + cheese_LDADD += $(HILDON_LIBS) +endif + Index: src/wscript_build =================================================================== --- src/wscript_build (revision 539) +++ src/wscript_build (working copy) @@ -15,8 +15,13 @@ obj.includes='.' obj.uselib='''GLIB GOBJECT GTK LIBGLADE GDK HAL GSTREAMER GSTREAMER_PLUGINS_BASE +<<<<<<< .mine + GNOME_VFS CAIRO LIBGNOMEUI LIBEBOOK + XXF86VM HILDON''' +======= GNOME_VFS CAIRO PANGOCAIRO LIBRSVG LIBGNOMEUI LIBEBOOK XXF86VM''' +>>>>>>> .r531 obj.target='cheese' Index: wscript =================================================================== --- wscript (revision 539) +++ wscript (working copy) @@ -25,6 +25,7 @@ def set_options(opt): opt.add_option('--maintainer', action="store_true", default=False, help="enable maintainer mode", dest="maintainer") opt.add_option('--cheese-advices', action="store_true", default=False, help="enable mobile application usage advice handler", dest="advices") + opt.add_option('--enable-hildon', action="store_true", default=False, help="enable support for hildon mobile platform", dest="hildon") pass def configure(conf): @@ -47,6 +48,11 @@ conf.check_pkg('libgnomeui-2.0', destvar='LIBGNOMEUI', vnum='2.20.0', mandatory=True) conf.check_pkg('libebook-1.2', destvar='LIBEBOOK', vnum='1.12.0', mandatory=True) conf.check_pkg('xxf86vm', destvar='XXF86VM', vnum='1.0.0', mandatory=True) + + if Params.g_options.hildon: + conf.check_pkg('hildon-1', destvar='HILDON', vnum='1.0.0', mandatory=True) + conf.env['HAVE_HILDON'] = True + conf.env['LIB_GSTREAMER'] += ['gstinterfaces-0.10'] conf.define('VERSION', VERSION) @@ -67,6 +73,9 @@ else: conf.define('PACKAGE_DATADIR', conf.env['DATADIR'] + '/cheese') + if Params.g_options.hildon: + conf.define('HILDON', '1') + conf.define('PACKAGE_DOCDIR', conf.env['DATADIR'] + '/share/doc/cheese') conf.define('PACKAGE_LOCALEDIR', conf.env['DATADIR'] + '/locale') conf.define('PACKAGE_LIBEXECDIR', conf.env['PREFIX'] + '/libexec/cheese') Index: configure.ac =================================================================== --- configure.ac (revision 539) +++ configure.ac (working copy) @@ -93,6 +93,16 @@ AC_SUBST(CHEESE_LIBS) +AC_ARG_ENABLE(hildon, AS_HELP_STRING([--enable-hildon],[compile for Hildon environment (default=no)]),,enable_hildon=no) + +if test "x$enable_hildon" = "xyes"; then + PKG_CHECK_MODULES([HILDON], hildon-1 >= 1.0.5,enable_hildon=yes,enable_hildon=no) +else + enable_hildon=no +fi + +AM_CONDITIONAL(WITH_HILDON, test "x$enable_hildon" = "xyes") + AC_PATH_PROG(GCONFTOOL, gconftool-2) AM_GCONF_SOURCE_2