Update of /cvsroot/xine/gnome-xine/src In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv17136/src Modified Files: Makefile.am client.c console_output.c console_output.h defs.h desktop_integration.c desktop_integration.h drag_drop.c drag_drop.h engine.c engine.h globals.h gtkflipbutton.c gtkflipbutton.h gtkvideo.c gtkvideo.h history.c history.h http.c http.h info_widgets.c info_widgets.h key_events.c key_events.h lirc.c lirc.h log_window.c log_window.h main.c mediamarks.c mediamarks.h menu.c menu.h noskin_window.c noskin_window.h open_mrl.c open_mrl.h play_item.c play_item.h player.c player.h playlist.c playlist.h post.c post.h preferences.c preferences.h script_engine.c script_engine.h server.c server.h settings.c settings.h snapshot.c snapshot.h stream_info.c stream_info.h ui.c ui.h utils.c utils.h vis.c vis.h wizards.c wizards.h xml_widgets.c xml_widgets.h Added Files: systray.c systray.h Log Message: Resync with hg head. --- NEW FILE: systray.c --- /* * Copyright (C) 2007 the xine-project * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the Free * Software Foundation; either version 2 of the License, or (at your option) * any later version. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., 51 * Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * * System tray icon for gxine. */ #include "globals.h" #include "systray.h" #include <stdlib.h> #include "drag_drop.h" #include "engine.h" #include "menu.h" #include "noskin_window.h" #include "ui.h" #include <gtk/gtk.h> #include <gdk/gdkx.h> #include <X11/Xlib.h> static GtkWidget *tray_icon, *tray_menu; static Window tray = None; static struct { Atom data, manager, opcode, selection; } atoms; static void systray_update (void); static void send_opcode (glong d1, glong d2, glong d3, glong d4) { GdkDisplay *display = gtk_widget_get_display (tray_icon); Display *xdisplay = GDK_DISPLAY_XDISPLAY (display); XClientMessageEvent xev = { ClientMessage, 0, True, xdisplay, tray, atoms.opcode, 32, { .l = { gdk_x11_get_server_time (tray_icon->window), d1, d2, d3, d4 } } }; gdk_error_trap_push (); XSendEvent (xdisplay, tray, False, NoEventMask, (XEvent *) &xev); XSync (xdisplay, FALSE); gdk_error_trap_pop (); } static GdkFilterReturn systray_filter (GdkXEvent *gxev, GdkEvent *ev, gpointer data) { XEvent *xev = (XEvent *) gxev; switch (xev->type) { case ClientMessage: /* tray appeared? */ if (xev->xclient.message_type == atoms.manager && xev->xclient.data.l[1] == atoms.selection) systray_update (); break; case DestroyNotify: /* tray disappeared? */ if (xev->xclient.window == tray) systray_update (); break; } return GDK_FILTER_CONTINUE; } static void systray_update (void) { GdkDisplay *display = gtk_widget_get_display (app); Display *xdisplay = GDK_DISPLAY_XDISPLAY (display); if (tray != None) { GdkWindow *window = gdk_window_lookup_for_display (display, tray); gdk_window_remove_filter (window, systray_filter, NULL); } XGrabServer (xdisplay); tray = XGetSelectionOwner (xdisplay, atoms.selection); if (tray != None) XSelectInput (xdisplay, tray, StructureNotifyMask); XUngrabServer (xdisplay); XFlush (xdisplay); if (tray != None) { GdkWindow *window = gdk_window_lookup_for_display (display, tray); gdk_window_add_filter (window, systray_filter, NULL); /* request dock */ send_opcode (0, gtk_plug_get_id (GTK_PLUG (tray_icon)), 0, 0); } } /* Standard callback (invokes Javascript) */ #define JS_CB(func, command) \ static void js_##func##_cb (GtkAction *action, gpointer data) \ { \ char *fn = g_strdup_printf (_("menu function %s"), #func); \ engine_exec ((command), NULL, NULL, fn); \ free (fn); \ } JS_CB (PrevTrack, "playlist_play (playlist_get_item () - 1);") JS_CB (NextTrack, "playlist_play (playlist_get_item () + 1);") JS_CB (Play, "play ();") JS_CB (Pause, "if (!is_live_stream ()) pause ();") JS_CB (FFwd, "if (!is_live_stream ()) av_speed.v = 5;") JS_CB (Stop, "stop ();") #define CB(name, stock, label, key) \ { #name, (stock), (label), (key), NULL, G_CALLBACK(js_##name##_cb) } static const GtkActionEntry popup_actions[] = { CB(PrevTrack, GTK_STOCK_MEDIA_PREVIOUS, N_("Pre_vious track"), NULL), CB(Play, GTK_STOCK_MEDIA_PLAY, N_("_Play"), NULL), CB(Pause, GTK_STOCK_MEDIA_PAUSE, N_("_Pause"), NULL), CB(FFwd, GTK_STOCK_MEDIA_FORWARD, N_("_Fast forward"), NULL), CB(Stop, GTK_STOCK_MEDIA_STOP, N_("_Stop"), NULL), CB(NextTrack, GTK_STOCK_MEDIA_NEXT, N_("_Next track"), NULL), }; static const char popup_menu_xml[] = "<ui><popup name='tray'>\n" "<menuitem action='PrevTrack' />\n" "<menuitem action='Play' />\n" "<menuitem action='Pause' />\n" "<menuitem action='FFwd' />\n" "<menuitem action='Stop' />\n" "<menuitem action='NextTrack' />\n" "<menuitem action='Playlist' />\n" "<separator />\n" "<menuitem action='Quit' />\n" "</popup></ui>"; static gboolean button_cb (GtkWidget *widget, GdkEventButton *ev, gpointer data) { switch (ev->button) { case 1: gtk_menu_popup (GTK_MENU (tray_menu), NULL, NULL, NULL, NULL, ev->button, ev->time); break; case 2: if (GTK_WIDGET_MAPPED (app)) app_hide (); else app_show (); break; case 3: gtk_menu_popup (GTK_MENU (popup_menu), NULL, NULL, NULL, NULL, ev->button, ev->time); break; } return TRUE; } void systray_init (void) { tray_icon = gtk_plug_new (0); gtk_container_add (GTK_CONTAINER (tray_icon), gtk_image_new_from_icon_name ("gxine", GTK_ICON_SIZE_LARGE_TOOLBAR)); gtk_widget_show_all (tray_icon); drag_drop_setup (tray_icon, TRUE); GdkScreen *screen = gtk_widget_get_screen (tray_icon); Screen *xscreen = GDK_SCREEN_XSCREEN (screen); GdkDisplay *display = gtk_widget_get_display (tray_icon); Display *xdisplay = GDK_DISPLAY_XDISPLAY (display); char selection[32]; snprintf (selection, sizeof (selection), "_NET_SYSTEM_TRAY_S%d", XScreenNumberOfScreen (xscreen)); atoms.data = XInternAtom (xdisplay, "_NET_SYSTEM_TRAY_MESSAGE_DATA", False); atoms.manager = XInternAtom (xdisplay, "MANAGER", False); atoms.opcode = XInternAtom (xdisplay, "_NET_SYSTEM_TRAY_OPCODE", False); atoms.selection = XInternAtom (xdisplay, selection, False); systray_update (); gdk_window_add_filter (gdk_screen_get_root_window (screen), systray_filter, NULL); GtkActionGroup *action = ui_get_action_group (ui); gtk_action_group_add_actions (action, popup_actions, G_N_ELEMENTS (popup_actions), NULL); GError *error = NULL; gtk_ui_manager_add_ui_from_string (ui, popup_menu_xml, -1, &error); tray_menu = gtk_ui_manager_get_widget (ui, "/ui/tray"); static const char items[][16] = { [Control_STOP] = "/ui/tray/Stop", [Control_PAUSE] = "/ui/tray/Pause", [Control_PLAY] = "/ui/tray/Play", [Control_FASTFWD] = "/ui/tray/FFwd", }; for (int i = 0; i < G_N_ELEMENTS (items); ++i) if (items[i][0]) ui_register_control_button (i, gtk_ui_manager_get_widget (ui, items[i])); gdk_window_set_events (tray_icon->window, gdk_window_get_events (tray_icon->window) | GDK_BUTTON_PRESS_MASK); g_signal_connect (G_OBJECT (tray_icon), "button-press-event", G_CALLBACK (button_cb), NULL); } --- NEW FILE: systray.h --- /* * Copyright (C) 2007 the xine-project * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the Free * Software Foundation; either version 2 of the License, or (at your option) * any later version. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., 51 * Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * * System tray icon for gxine. */ void systray_init (void); Index: Makefile.am =================================================================== RCS file: /cvsroot/xine/gnome-xine/src/Makefile.am,v retrieving revision 1.59 retrieving revision 1.60 diff -u -r1.59 -r1.60 --- Makefile.am 9 Dec 2006 14:05:29 -0000 1.59 +++ Makefile.am 3 Feb 2007 15:26:21 -0000 1.60 @@ -5,7 +5,7 @@ AM_CFLAGS = @GNU99@ $(XINE_CFLAGS) $(X_CFLAGS) \ @GTK2_CFLAGS@ @GTHREAD2_CFLAGS@ \ - @DBUS_CFLAGS@ @JS_CFLAGS@ \ + @HAL_CFLAGS@ @DBUS_CFLAGS@ @JS_CFLAGS@ \ -DLOCALEDIR=\"$(localedir)\" bin_PROGRAMS = gxine gxine_client @@ -40,6 +40,7 @@ settings.c \ snapshot.c \ stream_info.c \ + systray.c \ ui.c \ utils.c \ vis.c \ @@ -47,7 +48,7 @@ xml_widgets.c gxine_LDADD = @XINE_LIBS@ @GTK2_LIBS@ @GTHREAD2_LIBS@ \ - @JS_LIBS@ @DBUS_LIBS@ $(XTEST_LIBS) $(LIRC_LIBS) + @JS_LIBS@ @HAL_LIBS@ @DBUS_LIBS@ $(XTEST_LIBS) $(LIRC_LIBS) gxine_client_LDADD = $(LDADD) @GLIB2_LIBS@ Index: client.c =================================================================== RCS file: /cvsroot/xine/gnome-xine/src/client.c,v retrieving revision 1.15 retrieving revision 1.16 diff -u -r1.15 -r1.16 --- client.c 7 Jan 2007 20:26:25 -0000 1.15 +++ client.c 3 Feb 2007 15:26:21 -0000 1.16 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003-2005 the xine-project + * Copyright (C) 2003-2007 the xine-project * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -16,8 +16,6 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 * USA * - * $Id$ - * * gxine Javascript client */ Index: console_output.c =================================================================== RCS file: /cvsroot/xine/gnome-xine/src/console_output.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- console_output.c 27 Mar 2006 22:48:57 -0000 1.1 +++ console_output.c 3 Feb 2007 15:26:21 -0000 1.2 @@ -15,8 +15,6 @@ * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * - * $Id$ - * * Permissive console output transliteration */ Index: console_output.h =================================================================== RCS file: /cvsroot/xine/gnome-xine/src/console_output.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- console_output.h 27 Mar 2006 22:48:57 -0000 1.1 +++ console_output.h 3 Feb 2007 15:26:21 -0000 1.2 @@ -15,8 +15,6 @@ * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * - * $Id$ - * * Permissive console output transliteration */ Index: defs.h =================================================================== RCS file: /cvsroot/xine/gnome-xine/src/defs.h,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- defs.h 27 Aug 2006 18:33:23 -0000 1.6 +++ defs.h 3 Feb 2007 15:26:21 -0000 1.7 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2001-2004 the xine-project + * Copyright (C) 2001-2006 the xine-project * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -16,8 +16,6 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 * USA * - * $Id$ - * * misc. #defines */ Index: desktop_integration.c =================================================================== RCS file: /cvsroot/xine/gnome-xine/src/desktop_integration.c,v retrieving revision 1.28 retrieving revision 1.29 diff -u -r1.28 -r1.29 --- desktop_integration.c 12 Nov 2006 14:02:40 -0000 1.28 +++ desktop_integration.c 3 Feb 2007 15:26:21 -0000 1.29 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2005 the xine-project + * Copyright (C) 2002-2006 the xine-project * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -16,8 +16,6 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 * USA * - * $Id$ - * * helper functions to register gxine with kde and gnome * (and possibly cde in the future) * Index: desktop_integration.h =================================================================== RCS file: /cvsroot/xine/gnome-xine/src/desktop_integration.h,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- desktop_integration.h 6 Jul 2006 18:04:41 -0000 1.7 +++ desktop_integration.h 3 Feb 2007 15:26:21 -0000 1.8 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2001-2002 the xine-project + * Copyright (C) 2001-2006 the xine-project * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -16,8 +16,6 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 * USA * - * $Id$ - * * helper functions to register gxine with kde and gnome * (and possibly cde in the future) */ Index: drag_drop.c =================================================================== RCS file: /cvsroot/xine/gnome-xine/src/drag_drop.c,v retrieving revision 1.16 retrieving revision 1.17 diff -u -r1.16 -r1.17 --- drag_drop.c 6 Jul 2006 18:03:31 -0000 1.16 +++ drag_drop.c 3 Feb 2007 15:26:21 -0000 1.17 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003-2005 the xine project + * Copyright (C) 2003-2006 the xine project * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -15,8 +15,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * - * $Id$ - * * drag and drop support for the main window */ Index: drag_drop.h =================================================================== RCS file: /cvsroot/xine/gnome-xine/src/drag_drop.h,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- drag_drop.h 6 Jul 2006 18:03:31 -0000 1.5 +++ drag_drop.h 3 Feb 2007 15:26:21 -0000 1.6 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003-2005 the xine-project + * Copyright (C) 2003-2006 the xine-project * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -16,8 +16,6 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 * USA * - * $Id$ - * * drag and drop support functions */ Index: engine.c =================================================================== RCS file: /cvsroot/xine/gnome-xine/src/engine.c,v retrieving revision 1.49 retrieving revision 1.50 diff -u -r1.49 -r1.50 --- engine.c 7 Jan 2007 20:26:25 -0000 1.49 +++ engine.c 3 Feb 2007 15:26:21 -0000 1.50 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003-2006 the xine-project + * Copyright (C) 2003-2007 the xine-project * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -16,8 +16,6 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 * USA * - * $Id$ - * * init xine engine, set up script engine */ @@ -56,10 +54,6 @@ GAsyncQueue *js_queue; static gboolean queue_available = FALSE; -#if GXINE_GTK_OLDER_THAN(2,8,0) -WEAK (void, gtk_about_dialog_set_wrap_license); -#endif - static JSBool show_about (JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval) { @@ -84,8 +78,8 @@ GtkBox *vbox; /* translators' names go here */ const gchar *translator = _("TRANSLATOR"); - gchar *licence = GTK_HAVE (gtk_about_dialog_set_wrap_license, 2, 8, 0) - ? _("This program is free software; you can redistribute it and/or " + gchar *licence = + _("This program is free software; you can redistribute it and/or " "modify it under the terms of the GNU General Public Licence as " "published by the Free Software Foundation; either version 2 of the " "Licence, or (at your option) any later version.\n" @@ -98,24 +92,6 @@ "You should have received a copy of the GNU General Public Licence " "along with this program; if not, write to the Free Software " "Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, " - "MA 02110-1301 USA") - /* Translators: rewrap as required */ - : _("This program is free software; you can\n" - "redistribute it and/or modify it under the terms of\n" - "the GNU General Public Licence as published by\n" - "the Free Software Foundation; either version 2 of\n" - "the Licence, or (at your option) any later version.\n" - "\n" - "This program is distributed in the hope that it will\n" - "be useful, but WITHOUT ANY WARRANTY; without\n" - "even the implied warranty of MERCHANTABILITY\n" - "or FITNESS FOR A PARTICULAR PURPOSE. See the\n" - "GNU General Public Licence for more details.\n" - "\n" - "You should have received a copy of the GNU\n" - "General Public Licence along with this program;\n" - "if not, write to the Free Software Foundation, Inc.,\n" - "51 Franklin St, Fifth Floor, Boston,\n" "MA 02110-1301 USA"); about = gtk_about_dialog_new (); @@ -125,17 +101,15 @@ "copyright", get_copyright_notice (), "comments", _("A GTK media player front end for xine-lib"), "license", licence, + "wrap-license", TRUE, "website", "http://xinehq.de/", "authors", authors, "documenters", documenters, "translator-credits", strcmp (translator, "TRANSLATOR") ? translator : NULL, "logo-icon-name", GXINE_LOGO, NULL); - if (GTK_HAVE (gtk_about_dialog_set_wrap_license, 2, 8, 0)) - gtk_about_dialog_set_wrap_license ((GtkAboutDialog *) about, TRUE); - label = gtk_label_new ("<small><i>" VENDOR_PKG_VERSION CSET_ID "</i></small>"); - gtk_label_set_use_markup (GTK_LABEL (label), TRUE); + label = ui_label_new_with_markup ("<small><i>" VENDOR_PKG_VERSION CSET_ID "</i></small>"); vbox = GTK_BOX (GTK_DIALOG (about)->vbox); gtk_box_pack_end (vbox, label, FALSE, FALSE, 2); g_object_connect (about, Index: engine.h =================================================================== RCS file: /cvsroot/xine/gnome-xine/src/engine.h,v retrieving revision 1.15 retrieving revision 1.16 diff -u -r1.15 -r1.16 --- engine.h 6 Jul 2006 18:03:31 -0000 1.15 +++ engine.h 3 Feb 2007 15:26:21 -0000 1.16 @@ -15,8 +15,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * - * $Id$ - * * init xine engine, set up script engine with player object */ Index: globals.h =================================================================== RCS file: /cvsroot/xine/gnome-xine/src/globals.h,v retrieving revision 1.43 retrieving revision 1.44 diff -u -r1.43 -r1.44 --- globals.h 9 Dec 2006 14:05:29 -0000 1.43 +++ globals.h 3 Feb 2007 15:26:21 -0000 1.44 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2001-2004 the xine-project + * Copyright (C) 2001-2006 the xine-project * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -16,8 +16,6 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 * USA * - * $Id$ - * * global variables for lazy programmers... :> */ Index: gtkflipbutton.c =================================================================== RCS file: /cvsroot/xine/gnome-xine/src/gtkflipbutton.c,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- gtkflipbutton.c 2 Oct 2006 21:07:10 -0000 1.8 +++ gtkflipbutton.c 3 Feb 2007 15:26:21 -0000 1.9 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004-2005 the xine project + * Copyright (C) 2004-2006 the xine project * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -15,8 +15,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * - * $Id$ - * * GTK flip-button widget */ Index: gtkflipbutton.h =================================================================== RCS file: /cvsroot/xine/gnome-xine/src/gtkflipbutton.h,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- gtkflipbutton.h 2 Oct 2006 21:07:10 -0000 1.5 +++ gtkflipbutton.h 3 Feb 2007 15:26:21 -0000 1.6 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004-2005 the xine project + * Copyright (C) 2004-2006 the xine project * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -15,8 +15,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * - * $Id$ - * * a GTK toggle-button-like widget */ Index: gtkvideo.c =================================================================== RCS file: /cvsroot/xine/gnome-xine/src/gtkvideo.c,v retrieving revision 1.133 retrieving revision 1.134 diff -u -r1.133 -r1.134 --- gtkvideo.c 3 Feb 2007 14:59:31 -0000 1.133 +++ gtkvideo.c 3 Feb 2007 15:26:21 -0000 1.134 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2001-2006 the xine project + * Copyright (C) 2001-2007 the xine project * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -15,8 +15,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * - * $Id$ - * * gtk xine video widget * * some code originating from totem's gtkxine widget Index: gtkvideo.h =================================================================== RCS file: /cvsroot/xine/gnome-xine/src/gtkvideo.h,v retrieving revision 1.25 retrieving revision 1.26 diff -u -r1.25 -r1.26 --- gtkvideo.h 9 Dec 2006 14:05:29 -0000 1.25 +++ gtkvideo.h 3 Feb 2007 15:26:21 -0000 1.26 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2001-2004 the xine project + * Copyright (C) 2001-2006 the xine project * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -15,8 +15,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * - * $Id$ - * * a gtk xine video widget */ Index: history.c =================================================================== RCS file: /cvsroot/xine/gnome-xine/src/history.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- history.c 6 Jul 2006 18:03:31 -0000 1.3 +++ history.c 3 Feb 2007 15:26:21 -0000 1.4 @@ -15,8 +15,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * - * $Id$ - * * GtkComboBox with history * */ @@ -70,13 +68,13 @@ } static void -set_iter (GtkWidget *w, GtkScrollType dir) +set_iter (GtkComboBox *w, GtkScrollType dir) { GtkEditable *edit = GTK_EDITABLE (GTK_BIN (w)->child); - int item = gtk_combo_box_get_active (GTK_COMBO_BOX (w)); + int item = gtk_combo_box_get_active (w); int prev = item; int last = gtk_tree_model_iter_n_children - (gtk_combo_box_get_model (GTK_COMBO_BOX (w)), NULL) - 1; + (gtk_combo_box_get_model (w), NULL) - 1; switch (dir) { @@ -99,7 +97,7 @@ eval_text = gtk_editable_get_chars (edit, 0, -1); } - gtk_combo_box_set_active (GTK_COMBO_BOX (w), item); + gtk_combo_box_set_active (w, item); if (item < 0) { @@ -111,7 +109,7 @@ } static gboolean -scroll_cb (GtkWidget *w, GdkEventKey *e, GtkWidget *t) +scroll_cb (GtkComboBox *w, GdkEventKey *e, GtkWidget *t) { switch (e->state & GXINE_MODIFIER_MASK) { Index: history.h =================================================================== RCS file: /cvsroot/xine/gnome-xine/src/history.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- history.h 6 Jul 2006 18:03:31 -0000 1.2 +++ history.h 3 Feb 2007 15:26:21 -0000 1.3 @@ -15,8 +15,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * - * $Id$ - * * GtkComboBox with history * */ Index: http.c =================================================================== RCS file: /cvsroot/xine/gnome-xine/src/http.c,v retrieving revision 1.36 retrieving revision 1.37 diff -u -r1.36 -r1.37 --- http.c 16 Dec 2006 23:42:20 -0000 1.36 +++ http.c 3 Feb 2007 15:26:21 -0000 1.37 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2005 the xine project + * Copyright (C) 2002-2006 the xine project * * This file is part of xine, a free video player. * @@ -17,7 +17,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * - * $Id$ */ #include "globals.h" Index: http.h =================================================================== RCS file: /cvsroot/xine/gnome-xine/src/http.h,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- http.h 6 Jul 2006 18:03:31 -0000 1.8 +++ http.h 3 Feb 2007 15:26:22 -0000 1.9 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002 the xine project + * Copyright (C) 2002-2006 the xine project * * This file is part of xine, a free video player. * @@ -17,7 +17,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * - * $Id$ */ #ifndef HAVE_HTTP_H Index: info_widgets.c =================================================================== RCS file: /cvsroot/xine/gnome-xine/src/info_widgets.c,v retrieving revision 1.23 retrieving revision 1.24 diff -u -r1.23 -r1.24 --- info_widgets.c 16 Dec 2006 23:42:20 -0000 1.23 +++ info_widgets.c 3 Feb 2007 15:26:22 -0000 1.24 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2005 the xine-project + * Copyright (C) 2002-2007 the xine-project * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -16,8 +16,6 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 * USA * - * $Id$ - * * nice black information display areas */ @@ -36,6 +34,7 @@ #include "i18n.h" #include "defs.h" #include "info_widgets.h" +#include "ui.h" #include "utils.h" #include "playlist.h" #include "player.h" @@ -54,7 +53,7 @@ struct gxineinfo_private_s { gxineinfo_cb postinit, update; - GtkWidget *line[MAX_LINES]; + GtkLabel *line[MAX_LINES]; int data; }; typedef struct gxineinfo_private_s gxineinfo_private_t; @@ -184,9 +183,9 @@ for (i = 0; i < height; ++i) { GtkWidget *ev = (buttons & 1 << i) ? gtk_event_box_new () : NULL; - GtkWidget *line = priv->line[i] = gtk_label_new (NULL); + GtkWidget *line = ui_label_new_with_xalign ("", 0); + priv->line[i] = GTK_LABEL (line); gtk_widget_set_name (line, i ? small : large); - gtk_misc_set_alignment (GTK_MISC (line), 0, 0.5); gtk_label_set_ellipsize (GTK_LABEL (line), ellipsize); if (!i && width) gtk_label_set_width_chars (GTK_LABEL (line), width); @@ -231,7 +230,7 @@ { gxineinfo_private_t *priv = GET_PRIVATE (objs->data); if (priv->line[lineno]) - gtk_label_set_text (GTK_LABEL (priv->line[lineno]), text); + gtk_label_set_text (priv->line[lineno], text); } free (text); } @@ -389,7 +388,7 @@ !!(xine_config_lookup_entry (xine, "gui.show_time_remaining", &entry) && entry.num_value); - gtk_widget_set_state (widget, state ? GTK_STATE_ACTIVE : GTK_STATE_NORMAL); + gtk_widget_set_state ((GtkWidget *)widget, state ? GTK_STATE_ACTIVE : GTK_STATE_NORMAL); if (xine_get_status (stream) == XINE_STATUS_PLAY && !playlist_showing_logo ()) { @@ -415,17 +414,17 @@ strcpy (time.current, "â¢"); if (priv->line[1]) { - gtk_label_set_text (GTK_LABEL (priv->line[0]), time.current); - gtk_label_set_text (GTK_LABEL (priv->line[1]), time.length); + gtk_label_set_text (priv->line[0], time.current); + gtk_label_set_text (priv->line[1], time.length); } else if (time.current[0]) { strcat (time.full, " / "); memmove (time.full + strlen (time.full), time.length, sizeof (time.length)); - gtk_label_set_text (GTK_LABEL (priv->line[0]), time.full); + gtk_label_set_text (priv->line[0], time.full); } else - gtk_label_set_text (GTK_LABEL (priv->line[0]), ""); + gtk_label_set_text (priv->line[0], ""); #ifdef XINE_STREAM_INFO_DVD_TITLE_NUMBER time.full[0] = 0; @@ -439,7 +438,7 @@ sprintf (time.full + strlen (time.full), _("C%d/%d "), xine_get_stream_info (stream, XINE_STREAM_INFO_DVD_CHAPTER_NUMBER), count); - gtk_label_set_text (GTK_LABEL (priv->line[2]), time.full); + gtk_label_set_text (priv->line[2], time.full); #endif gdk_threads_leave (); @@ -462,10 +461,11 @@ postinit_time_widget (gpointer widget) { gxineinfo_private_t *priv = GET_PRIVATE (widget); - g_signal_connect (G_OBJECT (priv->line[0]->parent), "button-press-event", + GtkWidget *line = GTK_WIDGET (priv->line[0]); + g_signal_connect (G_OBJECT (line->parent), "button-press-event", G_CALLBACK (frob_format_cb), widget); - GdkWindow *window = priv->line[0]->window; + GdkWindow *window = line->window; GdkDisplay *display = gdk_drawable_get_display ((GdkDrawable *)window); GdkCursor *ptr = gdk_cursor_new_for_display (display, GDK_CLOCK); gdk_window_set_cursor (window, ptr); Index: info_widgets.h =================================================================== RCS file: /cvsroot/xine/gnome-xine/src/info_widgets.h,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- info_widgets.h 6 Jul 2006 18:03:31 -0000 1.7 +++ info_widgets.h 3 Feb 2007 15:26:22 -0000 1.8 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2005 the xine-project + * Copyright (C) 2002-2006 the xine-project * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -16,8 +16,6 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 * USA * - * $Id$ - * * nice black information display areas */ #ifndef HAVE_INFO_WIDGETS_H Index: key_events.c =================================================================== RCS file: /cvsroot/xine/gnome-xine/src/key_events.c,v retrieving revision 1.118 retrieving revision 1.119 diff -u -r1.118 -r1.119 --- key_events.c 7 Jan 2007 20:26:25 -0000 1.118 +++ key_events.c 3 Feb 2007 15:26:22 -0000 1.119 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003-2006 the xine project + * Copyright (C) 2003-2007 the xine project * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -15,8 +15,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * - * $Id$ - * * key event handler and keymap editor */ @@ -57,7 +55,8 @@ is_new_binding = FALSE; static GtkListStore *kb_store; static GtkTreeModel *kb_model; -static GtkWidget *kb_bindings_list_dlg, *tree_view, +static GtkTreeView *tree_view; +static GtkWidget *kb_bindings_list_dlg, *kb_binding_edit_dlg, *kb_binding_desc, *kb_binding_command, *kb_binding_key, *kb_binding_quote; static GtkTextBuffer *kb_binding_command_buf; @@ -193,7 +192,7 @@ guint keyval = gdk_keyval_to_lower (event->keyval); guint state = event->state & GXINE_MODIFIER_MASK; - if (gtk_tree_model_get_iter_first (GTK_TREE_MODEL(kb_store), &iter)) + if (gtk_tree_model_get_iter_first (kb_model, &iter)) { do { @@ -310,7 +309,7 @@ if (!desc && !cmd) return NULL; - if (gtk_tree_model_get_iter_first (GTK_TREE_MODEL(kb_store), iter)) + if (gtk_tree_model_get_iter_first (kb_model, iter)) { do { @@ -494,9 +493,9 @@ { GtkTreeIter iter; - fprintf (f, "<GXINEKB VERSION=\"4\">\n"); + fprintf (f, "<GXINEKB VERSION=\"5\">\n"); - if (gtk_tree_model_get_iter_first (GTK_TREE_MODEL(kb_store), &iter)) + if (gtk_tree_model_get_iter_first (kb_model, &iter)) { do { @@ -591,6 +590,13 @@ { "ao_mute.toggle ();", "vdr ('MUTE') || ao_mute.toggle ();" }, { NULL } }; +static const kb_upgrade_t upgrade_to_0_5_11[] = { + { "if (!vdr ('FASTREW') && !is_live_stream ()) play (0, get_time()-60000);", + "if (!vdr ('FASTREW') && !is_live_stream ()) { var pos = has_time() ? 0 : get_pos()-1; play (pos < 0 ? 0 : pos, get_time()-60000); }" }, + { "if (!vdr ('FASTFWD') && !is_live_stream ()) play (0, get_time()+60000);", + "if (!vdr ('FASTFWD') && !is_live_stream ()) { var pos = has_time() ? 0 : get_pos()+1; play (pos < 0 ? 0 : pos, get_time()+60000); }" }, + { NULL } +}; /* For upgrading from < 0.5.8 */ static inline const char * @@ -650,6 +656,8 @@ binding.cmd = kb_upgrade (binding.cmd, vdr_upgrade_to_0_4_0); if (version < 3) binding.cmd = kb_upgrade (binding.cmd, vdr_upgrade_to_0_5_0); + if (version < 5) + binding.cmd = kb_upgrade (binding.cmd, upgrade_to_0_5_11); logprintf ("key_events: desc='%s', cmd='%s', keyval=%d, state=%d\n", binding.desc ? binding.desc : "", binding.cmd, binding.keyval, @@ -742,7 +750,7 @@ { list_visible = TRUE; window_show (kb_bindings_list_dlg, NULL); - gtk_tree_view_columns_autosize (GTK_TREE_VIEW(tree_view)); + gtk_tree_view_columns_autosize (tree_view); } } @@ -779,14 +787,14 @@ { GtkTreeIter iter; GtkTreeSelection *sel = - gtk_tree_view_get_selection (GTK_TREE_VIEW (tree_view)); + gtk_tree_view_get_selection (tree_view); if (gtk_tree_selection_get_selected (sel, NULL, &iter)) { GtkTreePath *path = gtk_tree_model_get_path (kb_model, &iter); if (path) { - gtk_tree_view_set_cursor (GTK_TREE_VIEW (tree_view), path, NULL, FALSE); + gtk_tree_view_set_cursor (tree_view, path, NULL, FALSE); gtk_tree_path_free (path); } @@ -801,7 +809,7 @@ static void kb_edit_binding (GtkWidget *widget, gpointer data) { GtkTreeSelection *sel = - gtk_tree_view_get_selection (GTK_TREE_VIEW (tree_view)); + gtk_tree_view_get_selection (tree_view); if (sel && gtk_tree_selection_get_selected (sel, NULL, &catch_key_iter)) do_edit_binding (); @@ -1370,28 +1378,25 @@ /* add a nice tree view widget here */ - tree_view = gtk_tree_view_new_with_model (GTK_TREE_MODEL(kb_store)); - gtk_tree_view_set_rules_hint (GTK_TREE_VIEW (tree_view), TRUE); - gtk_tree_view_set_reorderable (GTK_TREE_VIEW (tree_view), TRUE); + tree_view = GTK_TREE_VIEW (gtk_tree_view_new_with_model (kb_model)); + gtk_tree_view_set_rules_hint (tree_view, TRUE); + gtk_tree_view_set_reorderable (tree_view, TRUE); cell = gtk_cell_renderer_text_new (); column = gtk_tree_view_column_new_with_attributes (_("Action"), cell, "text", COLUMN_DESC, NULL); - gtk_tree_view_column_set_resizable (GTK_TREE_VIEW_COLUMN(column), TRUE); - gtk_tree_view_append_column (GTK_TREE_VIEW (tree_view), - GTK_TREE_VIEW_COLUMN (column)); + gtk_tree_view_column_set_resizable (column, TRUE); + gtk_tree_view_append_column (tree_view, column); column = gtk_tree_view_column_new_with_attributes (_("Accelerator key"), cell, "text", COLUMN_KEY, NULL); - gtk_tree_view_column_set_sizing (GTK_TREE_VIEW_COLUMN(column), - GTK_TREE_VIEW_COLUMN_AUTOSIZE); - gtk_tree_view_append_column (GTK_TREE_VIEW (tree_view), - GTK_TREE_VIEW_COLUMN (column)); + gtk_tree_view_column_set_sizing (column, GTK_TREE_VIEW_COLUMN_AUTOSIZE); + gtk_tree_view_append_column (tree_view, column); scrolled_window = gtk_scrolled_window_new (NULL, NULL); gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_window), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); - gtk_container_add (GTK_CONTAINER (scrolled_window), tree_view); + gtk_container_add (GTK_CONTAINER (scrolled_window), GTK_WIDGET (tree_view)); g_signal_connect (G_OBJECT (tree_view), "row-activated", G_CALLBACK (kb_sig_edit_binding), kb_bindings_list_dlg); @@ -1428,8 +1433,8 @@ GError *error; GtkUIManager *ui = ui_create_manager ("bindings", kb_bindings_list_dlg); - - gtk_action_group_add_actions (ui_get_action_group (ui), + GtkActionGroup *actions = ui_get_action_group (ui); + gtk_action_group_add_actions (actions, kb_menu_data, G_N_ELEMENTS(kb_menu_data), kb_bindings_list_dlg); gtk_ui_manager_add_ui_from_string (ui, kb_menu_structure, -1, &error); @@ -1437,7 +1442,7 @@ (GTK_BOX(hbox), gtk_ui_manager_get_widget (ui, "/toolbar"), TRUE, TRUE, 0); gtk_box_pack_end (GTK_BOX(hbox), gtk_ui_manager_get_widget (ui, "/menubar"), FALSE, FALSE, 0); - gtk_action_group_connect_accelerators (ui_get_action_group (ui)); + gtk_action_group_connect_accelerators (actions); } gtk_box_pack_start (GTK_BOX(GTK_DIALOG(kb_bindings_list_dlg)->vbox), hbox, Index: key_events.h =================================================================== RCS file: /cvsroot/xine/gnome-xine/src/key_events.h,v retrieving revision 1.12 retrieving revision 1.13 diff -u -r1.12 -r1.13 --- key_events.h 6 Jul 2006 18:03:31 -0000 1.12 +++ key_events.h 3 Feb 2007 15:26:22 -0000 1.13 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2001-2005 the xine-project + * Copyright (C) 2001-2006 the xine-project * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -16,8 +16,6 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 * USA * - * $Id$ - * * key event handler, keymap editor */ Index: lirc.c =================================================================== RCS file: /cvsroot/xine/gnome-xine/src/lirc.c,v retrieving revision 1.27 retrieving revision 1.28 diff -u -r1.27 -r1.28 --- lirc.c 27 Aug 2006 18:33:24 -0000 1.27 +++ lirc.c 3 Feb 2007 15:26:22 -0000 1.28 @@ -16,8 +16,6 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 * USA * - * $Id$ - * * lirc (infrared control) code, originally based on oxine */ Index: lirc.h =================================================================== RCS file: /cvsroot/xine/gnome-xine/src/lirc.h,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- lirc.h 6 Jul 2006 18:03:31 -0000 1.3 +++ lirc.h 3 Feb 2007 15:26:22 -0000 1.4 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2001-2003 the xine project + * Copyright (C) 2001-2006 the xine project * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -15,8 +15,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * - * $Id$ - * * lirc handling functions */ Index: log_window.c =================================================================== RCS file: /cvsroot/xine/gnome-xine/src/log_window.c,v retrieving revision 1.22 retrieving revision 1.23 diff -u -r1.22 -r1.23 --- log_window.c 19 Jul 2006 01:47:09 -0000 1.22 +++ log_window.c 3 Feb 2007 15:26:22 -0000 1.23 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2005 the xine-project + * Copyright (C) 2002-2006 the xine-project * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -16,8 +16,6 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 * USA * - * $Id$ - * * log window implementation */ Index: log_window.h =================================================================== RCS file: /cvsroot/xine/gnome-xine/src/log_window.h,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- log_window.h 6 Jul 2006 18:03:31 -0000 1.5 +++ log_window.h 3 Feb 2007 15:26:22 -0000 1.6 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002 the xine-project + * Copyright (C) 2002-2006 the xine-project * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -16,8 +16,6 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 * USA * - * $Id$ - * * log window header */ #ifndef HAVE_LOG_WINDOW_H Index: main.c =================================================================== RCS file: /cvsroot/xine/gnome-xine/src/main.c,v retrieving revision 1.175 retrieving revision 1.176 diff -u -r1.175 -r1.176 --- main.c 9 Dec 2006 14:05:30 -0000 1.175 +++ main.c 3 Feb 2007 15:26:22 -0000 1.176 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2001-2006 the xine-project + * Copyright (C) 2001-2007 the xine-project * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -16,8 +16,6 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 * USA * - * $Id$ - * * gtk2 ui for xine * * main @@ -69,6 +67,7 @@ #include "stream_info.h" #include "ui.h" #include "utils.h" +#include "systray.h" #include "vis.h" #include "post.h" #include "console_output.h" @@ -143,8 +142,7 @@ gtk_container_add (GTK_CONTAINER (splash), fixed); gtk_fixed_put (GTK_FIXED (fixed), img, 0, 0); - text = gtk_label_new ("<span font_desc='sans 12' color='#DDDDDD'>"VERSION"</span>"); - gtk_label_set_use_markup (GTK_LABEL (text), TRUE); + text = ui_label_new_with_markup ("<span font_desc='sans 12' color='#DDDDDD'>"VERSION"</span>"); gtk_misc_set_alignment (GTK_MISC (text), 1, 1); gtk_fixed_put (GTK_FIXED (fixed), text, 0, 0); @@ -234,7 +232,7 @@ return TRUE; } -static void watchdog_timeout (int sig) +static void __attribute__ ((noreturn)) watchdog_timeout (int sig) { /* if this happens, we have a problem... */ g_printerr (_("gxine: killed by watchdog bite\n")); @@ -258,7 +256,7 @@ /* Faults */ -static void fault_handler (int sig) +static void __attribute__ ((noreturn)) fault_handler (int sig) { static gboolean recurse = FALSE; if (recurse) @@ -592,6 +590,7 @@ gxine_lirc_init (); snapshot_init (); vis_init (); + systray_init (); post_init (); stream_info_init (); wizards_init (); Index: mediamarks.c =================================================================== RCS file: /cvsroot/xine/gnome-xine/src/mediamarks.c,v retrieving revision 1.76 retrieving revision 1.77 diff -u -r1.76 -r1.77 --- mediamarks.c 2 Oct 2006 21:08:20 -0000 1.76 +++ mediamarks.c 3 Feb 2007 15:26:22 -0000 1.77 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2004 the xine-project + * Copyright (C) 2002-2007 the xine-project * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -16,8 +16,6 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 * USA * - * $Id$ - * * mediamarks - load * - save * - edit @@ -44,6 +42,7 @@ static GtkTreeStore *mm_store; static GtkTreeModel *mm_model; +static GtkTreeView *tree; static GtkTreeSelection *sel; static GtkWidget *manage_dlg, *cat_dlg, *cat_entry, *mm_tree; static GtkTreeIter cat_iter; @@ -51,6 +50,8 @@ static GtkUIManager *mm_ui; static GtkActionGroup *media_group = NULL; +static GtkAction *play_item; +static GtkMenu *menu[2]; static guint media_merge; #define COLUMN_TITLE 0 @@ -78,6 +79,18 @@ return p; } +static void play_cb (GtkWidget* widget, gpointer data) +{ + GtkTreeIter iter; + + if (gtk_tree_selection_get_selected (sel, NULL, &iter)) + { + play_item_t *item = peek_play_item (&iter); + if (item) + playlist_play (playlist_add (play_item_copy (item), -1)); + } +} + static void menu_cb (GtkAction* action, gpointer data) { if (data) @@ -104,12 +117,11 @@ else { GtkTreeIter children; - if (gtk_tree_model_iter_children (GTK_TREE_MODEL(mm_store), - &children, iter)) + if (gtk_tree_model_iter_children (mm_model, &children, iter)) count = gen_actions_sub (ui, actions, &children, count); } } - } while (gtk_tree_model_iter_next (GTK_TREE_MODEL(mm_store), iter)); + } while (gtk_tree_model_iter_next (mm_model, iter)); return count; } @@ -141,8 +153,7 @@ GtkTreeIter children; gtk_ui_manager_add_ui (ui, merge, path, name, name, GTK_UI_MANAGER_MENU, FALSE); - if (gtk_tree_model_iter_children (GTK_TREE_MODEL(mm_store), - &children, iter)) + if (gtk_tree_model_iter_children (mm_model, &children, iter)) { char *newpath = g_strdup_printf ("%s/%s", path, name); count = gen_items (ui, newpath, &children, merge, count); @@ -150,7 +161,7 @@ } } } - } while (gtk_tree_model_iter_next (GTK_TREE_MODEL(mm_store), iter)); + } while (gtk_tree_model_iter_next (mm_model, iter)); return count; } @@ -396,6 +407,36 @@ } } +static gboolean row_clicked_lcb (GtkWidget *widget, GdkEventButton *ev, + gpointer data) +{ + if (ev->button != 3 || ev->window != gtk_tree_view_get_bin_window (tree)) + return FALSE; + + GtkTreePath *path; + if (gtk_tree_view_get_path_at_pos (tree, ev->x, ev->y, &path, + NULL, NULL, NULL)) + { + gtk_tree_selection_select_path (sel, path); + gtk_tree_path_free (path); + gtk_menu_popup (((GtkMenu **)data)[1], NULL, NULL, NULL, NULL, 3, + gtk_get_current_event_time ()); + } + else + gtk_menu_popup (((GtkMenu **)data)[0], NULL, NULL, NULL, NULL, 3, + gtk_get_current_event_time ()); + + return TRUE; +} + +static gboolean popup_cb (GtkWidget *widget, GdkEventButton *ev, gpointer data) +{ + if (ev->button != 3) + return FALSE; + gtk_menu_popup (data, NULL, NULL, NULL, NULL, 3, gtk_get_current_event_time ()); + return TRUE; +} + static void delete_cb (GtkWidget* widget, gpointer data) { GtkTreeIter iter; @@ -623,7 +664,7 @@ print_depth (f, depth); fprintf (f, "<SUB NAME=\"%s\">\n", id); - if (gtk_tree_model_iter_children (GTK_TREE_MODEL(mm_store), &children, iter)) + if (gtk_tree_model_iter_children (mm_model, &children, iter)) save_items (f, depth+2, &children); print_depth (f, depth); @@ -631,7 +672,7 @@ } } - } while (gtk_tree_model_iter_next (GTK_TREE_MODEL(mm_store), iter)); + } while (gtk_tree_model_iter_next (mm_model, iter)); } void mm_save (void) @@ -696,9 +737,17 @@ } } +static gboolean map_cb (GtkWidget* widget, gpointer data) +{ + gdk_window_set_events (widget->window, + gdk_window_get_events (widget->window) | GDK_BUTTON_PRESS_MASK); + return FALSE; +} + static const GtkActionEntry buttons_data[] = { + { "play", GTK_STOCK_MEDIA_PLAY, NULL, NULL, NULL, play_cb }, { "new", GTK_STOCK_NEW, NULL, NULL, N_("Add an MRL"), mm_add_show }, - { "newcat", GTK_STOCK_DIRECTORY, N_("New category"), "<Control>F", N_("Add a category folder"), new_category_cb }, + { "newcat", GTK_STOCK_DIRECTORY, N_("_Category"), "<Control>F", N_("Add a category folder"), new_category_cb }, { "edit", GTK_STOCK_EDIT, NULL, "<Control>E", N_("Edit the selected item"), edit_cb }, { "delete", GTK_STOCK_DELETE, NULL, "Delete", N_("Delete the selected item"), delete_cb }, { "copy", GTK_STOCK_COPY, NULL, NULL, NULL, copy_cb }, @@ -716,13 +765,29 @@ "<toolitem action='copy' />\n" "<toolitem action='cut' />\n" "<toolitem action='paste' />\n" + "<separator />\n" + "<toolitem action='play' />\n" "</toolbar>\n" + "<popup name='item_menu'>\n" + "<menuitem action='play' />\n" + "<separator />\n" + "<menuitem action='edit' />\n" + "<menuitem action='delete' />\n" + "<menuitem action='copy' />\n" + "<menuitem action='cut' />\n" + "<menuitem action='paste' />\n" + "</popup>\n" + "<popup name='list_menu'>\n" + "<menuitem action='new' />\n" + "<menuitem action='newcat' />\n" + "<menuitem action='paste' />\n" + "</popup>\n" "</ui>"; static void sel_changed_cb (GtkTreeSelection *sel, gpointer data) { static const char *const items[] = { "edit", "delete", NULL }; - static const char *const cb_items[] = { "copy", "cut", NULL }; + static const char *const cb_items[] = { "play", "copy", "cut", NULL }; GtkTreeIter iter; gboolean have_selected = gtk_tree_selection_get_selected (sel, NULL, &iter); @@ -735,12 +800,29 @@ void mediamarks_init (void) { - GtkWidget *tree, *scrolled_window, *hbox, *label; + GtkWidget *scrolled_window, *hbox, *label; GtkBox *vbox; gchar *fname; GtkCellRenderer *cell; GtkTreeViewColumn *column; - GError *error; + GError *error = NULL; + + /* buttons & menus */ + + mm_ui = ui_create_manager ("mm", manage_dlg); + GtkActionGroup *group = ui_get_action_group (mm_ui); + gtk_action_group_add_actions (group, buttons_data, + G_N_ELEMENTS (buttons_data), tree); + gtk_ui_manager_add_ui_from_string (mm_ui, buttons_structure, -1, &error); + if (error) + { + g_printerr (_("playlist XML: %s\n"), error->message); + g_clear_error (&error); + } + menu[0] = GTK_MENU (gtk_ui_manager_get_widget (mm_ui, "/ui/list_menu")); + menu[1] = GTK_MENU (gtk_ui_manager_get_widget (mm_ui, "/ui/item_menu")); + play_item = gtk_action_group_get_action (group, "play"); + gtk_action_group_connect_accelerators (group); /* * init tree store @@ -765,30 +847,27 @@ GTK_STOCK_CLOSE, GTK_RESPONSE_DELETE_EVENT, NULL); gtk_window_set_default_size (GTK_WINDOW (manage_dlg), 400, 250); - g_signal_connect (G_OBJECT(manage_dlg), "response", - G_CALLBACK(mm_response_cb), NULL); + g_object_connect (G_OBJECT(manage_dlg), + "signal::map-event", G_CALLBACK (map_cb), NULL, + "signal::button-press-event", G_CALLBACK(popup_cb), menu[0], + "signal::response", G_CALLBACK(mm_response_cb), NULL, + NULL); hide_on_delete (manage_dlg, &is_visible); vbox = GTK_BOX (GTK_DIALOG (manage_dlg)->vbox); /* add a nice toolbar and tree view widget here */ - mm_tree = tree = gtk_tree_view_new_with_model (GTK_TREE_MODEL(mm_store)); - gtk_tree_view_set_rules_hint (GTK_TREE_VIEW (tree), TRUE); + mm_tree = gtk_tree_view_new_with_model (mm_model); + tree = GTK_TREE_VIEW (mm_tree); + gtk_tree_view_set_rules_hint (tree, TRUE); - sel = gtk_tree_view_get_selection (GTK_TREE_VIEW (tree)); + sel = gtk_tree_view_get_selection (tree); g_signal_connect (G_OBJECT (sel), "changed", G_CALLBACK (sel_changed_cb), NULL); - /* buttons */ - - mm_ui = ui_create_manager ("mm", manage_dlg); - gtk_action_group_add_actions (ui_get_action_group (mm_ui), buttons_data, - G_N_ELEMENTS (buttons_data), tree); - gtk_ui_manager_add_ui_from_string (mm_ui, buttons_structure, -1, &error); - gtk_box_pack_start (vbox, gtk_ui_manager_get_widget (mm_ui, "/toolbar"), + gtk_box_pack_start (vbox, gtk_ui_manager_get_widget (mm_ui, "/ui/toolbar"), FALSE, FALSE, 0); - gtk_action_group_connect_accelerators (ui_get_action_group (mm_ui)); sel_changed_cb (sel, NULL); @@ -799,30 +878,29 @@ "ellipsize", 2, "width_chars", 16, NULL); /* foo...bar */ column = gtk_tree_view_column_new_with_attributes (_("Media mark"), cell, "text", COLUMN_TITLE, NULL); - gtk_tree_view_column_set_resizable (GTK_TREE_VIEW_COLUMN(column), TRUE); - gtk_tree_view_append_column (GTK_TREE_VIEW (tree), - GTK_TREE_VIEW_COLUMN (column)); + gtk_tree_view_column_set_resizable (column, TRUE); + gtk_tree_view_append_column (tree, column); cell = gtk_cell_renderer_text_new (); g_object_set (G_OBJECT(cell), "ellipsize", 1, "width_chars", 16, NULL); /* ...bar */ column = gtk_tree_view_column_new_with_attributes (_("MRL"), cell, "text", COLUMN_MRL, NULL); - gtk_tree_view_column_set_sizing (GTK_TREE_VIEW_COLUMN(column), - GTK_TREE_VIEW_COLUMN_AUTOSIZE); - gtk_tree_view_append_column (GTK_TREE_VIEW (tree), - GTK_TREE_VIEW_COLUMN (column)); + gtk_tree_view_column_set_sizing (column, GTK_TREE_VIEW_COLUMN_AUTOSIZE); + gtk_tree_view_append_column (tree, column); - gtk_tree_view_set_reorderable (GTK_TREE_VIEW (tree), TRUE); + gtk_tree_view_set_reorderable (tree, TRUE); scrolled_window = gtk_scrolled_window_new (NULL, NULL); gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_window), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); - gtk_container_add (GTK_CONTAINER (scrolled_window), tree); + gtk_container_add (GTK_CONTAINER (scrolled_window), mm_tree); - g_signal_connect (G_OBJECT (tree), "row-activated", - G_CALLBACK (edit_cb), NULL); + g_object_connect (G_OBJECT (tree), + "signal::row-activated", G_CALLBACK (edit_cb), NULL, + "signal::button-press-event", G_CALLBACK (row_clicked_lcb), menu, + NULL); gtk_box_pack_start (vbox, scrolled_window, TRUE, TRUE, 2); Index: mediamarks.h =================================================================== RCS file: /cvsroot/xine/gnome-xine/src/mediamarks.h,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- mediamarks.h 6 Jul 2006 18:03:32 -0000 1.10 +++ mediamarks.h 3 Feb 2007 15:26:22 -0000 1.11 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2001-2003 the xine project + * Copyright (C) 2001-2006 the xine project * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -15,8 +15,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * - * $Id$ - * */ #ifndef HAVE_MEDIAMARKS_H Index: menu.c =================================================================== RCS file: /cvsroot/xine/gnome-xine/src/menu.c,v retrieving revision 1.91 retrieving revision 1.92 diff -u -r1.91 -r1.92 --- menu.c 3 Feb 2007 15:04:44 -0000 1.91 +++ menu.c 3 Feb 2007 15:26:22 -0000 1.92 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003-2005 the xine project + * Copyright (C) 2003-2007 the xine project * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -15,8 +15,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * - * $Id$ - * * main/context menu creation / handling */ @@ -376,7 +374,7 @@ { "ToolsMenu", NULL, N_("_Tools"), NULL }, CB(EngineLog, NULL, N_("Engine _log..."), "<control>L"), CB(JSConsole, GTK_STOCK_EXECUTE, N_("_Javascript console..."), "<control>J"), - CB(StreamInfo, "gtk-info", N_("Stream _info..."), NULL), + CB(StreamInfo, GTK_STOCK_INFO, N_("Stream _info..."), NULL), CB(SetupWizards, GTK_STOCK_REDO, N_("_Re-run setup wizards..."), NULL), { "HelpMenu", NULL, N_("_Help"), NULL }, CB(About, GTK_STOCK_ABOUT, N_("_About..."), NULL), Index: menu.h =================================================================== RCS file: /cvsroot/xine/gnome-xine/src/menu.h,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- menu.h 6 Jul 2006 18:03:32 -0000 1.10 +++ menu.h 3 Feb 2007 15:26:22 -0000 1.11 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003-2005 the xine project + * Copyright (C) 2003-2006 the xine project * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -15,8 +15,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * - * $Id$ - * * main/context menu creation / handling */ Index: noskin_window.c =================================================================== RCS file: /cvsroot/xine/gnome-xine/src/noskin_window.c,v retrieving revision 1.124 retrieving revision 1.125 diff -u -r1.124 -r1.125 --- noskin_window.c 7 Jan 2007 20:26:25 -0000 1.124 +++ noskin_window.c 3 Feb 2007 15:26:22 -0000 1.125 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003-2004 the xine project + * Copyright (C) 2003-2007 the xine project * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -15,8 +15,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * - * $Id$ - * * standard, non-skinned main window */ @@ -318,7 +316,7 @@ void window_wm_toolbar_restore (void) { - if (wm_toolbar) + if (wm_toolbar && GTK_WIDGET_MAPPED (app)) gtk_window_present (GTK_WINDOW (wm_toolbar)); } @@ -503,6 +501,20 @@ return FALSE; } +void app_show (void) +{ + gtk_widget_show (app); + if (wm_toolbar && wm_toolbar_visible) + gtk_widget_show (wm_toolbar); +} + +void app_hide (void) +{ + gtk_widget_hide (app); + if (wm_toolbar && wm_toolbar_visible) + gtk_widget_hide (wm_toolbar); +} + static void xevent_properties (void) { Index: noskin_window.h =================================================================== RCS file: /cvsroot/xine/gnome-xine/src/noskin_window.h,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- noskin_window.h 9 Dec 2006 14:05:30 -0000 1.6 +++ noskin_window.h 3 Feb 2007 15:26:22 -0000 1.7 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003-2005 the xine project + * Copyright (C) 2003-2007 the xine project * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -15,8 +15,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * - * $Id$ - * * standard, non-skinned main window */ @@ -28,4 +26,7 @@ void noskin_main_init (const gchar *geometry); void noskin_main_close (void); +void app_show (void); +void app_hide (void); + #endif Index: open_mrl.c =================================================================== RCS file: /cvsroot/xine/gnome-xine/src/open_mrl.c,v retrieving revision 1.33 retrieving revision 1.34 diff -u -r1.33 -r1.34 --- open_mrl.c 6 Jul 2006 18:03:32 -0000 1.33 +++ open_mrl.c 3 Feb 2007 15:26:22 -0000 1.34 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003-2004 the xine project + * Copyright (C) 2003-2006 the xine project * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -15,8 +15,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * - * $Id$ - * * open mrl dialog (plus file browser) */ Index: open_mrl.h =================================================================== RCS file: /cvsroot/xine/gnome-xine/src/open_mrl.h,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- open_mrl.h 6 Jul 2006 18:03:32 -0000 1.3 +++ open_mrl.h 3 Feb 2007 15:26:22 -0000 1.4 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003 the xine project + * Copyright (C) 2003-2006 the xine project * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -15,8 +15,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * - * $Id$ - * * file d... [truncated message content] |