[Xfce4-commits] <parole:master> Added embedded_mode patch.

Sean Davis noreply at xfce.org
Wed Nov 14 02:14:01 CET 2012


Updating branch refs/heads/master
         to 6f356197d7ce34ffd38924f4e76561fb8f666cae (commit)
       from 67a0e7f75ea1a6c466f9d71f5d5a669a504e2116 (commit)

commit 6f356197d7ce34ffd38924f4e76561fb8f666cae
Author: Sean Davis <smd.seandavis at gmail.com>
Date:   Tue Nov 13 18:37:16 2012 -0500

    Added embedded_mode patch.

 src/main.c          |    6 +++++-
 src/parole-player.c |   18 ++++++++++++++++--
 2 files changed, 21 insertions(+), 3 deletions(-)

diff --git a/src/main.c b/src/main.c
index 141a5c3..769d50a 100644
--- a/src/main.c
+++ b/src/main.c
@@ -259,6 +259,7 @@ int main (int argc, char **argv)
     gboolean lower_volume = FALSE;
     gboolean mute = FALSE;
     gboolean no_plugins = FALSE;
+    gboolean embedded = FALSE;
     gboolean fullscreen = FALSE;
 	gboolean enqueue = FALSE;
     gchar    *client_id = NULL;
@@ -287,6 +288,7 @@ int main (int argc, char **argv)
 	{ "lower-volume", 'l', G_OPTION_FLAG_IN_MAIN, G_OPTION_ARG_NONE, &lower_volume, N_("Lower volume"), NULL },
 	{ "mute", 'm', G_OPTION_FLAG_IN_MAIN, G_OPTION_ARG_NONE, &mute, N_("Mute volume"), NULL },
 	{ "version", 'V', G_OPTION_FLAG_IN_MAIN, G_OPTION_ARG_NONE, &version, N_("Version information"), NULL },
+	{ "embedded", 'E', G_OPTION_FLAG_IN_MAIN, G_OPTION_ARG_NONE, &embedded, N_("Use embedded mode"), NULL },
 	{ "fullscreen", 'F', G_OPTION_FLAG_IN_MAIN, G_OPTION_ARG_NONE, &fullscreen, N_("Start in fullscreen mode"), NULL },
 	{ "xv", '\0', G_OPTION_FLAG_IN_MAIN, G_OPTION_ARG_CALLBACK, (GOptionArgFunc) xv_option_given, N_("Enabled/Disable XV support"), NULL},
 	{ "add", 'a', G_OPTION_FLAG_IN_MAIN, G_OPTION_ARG_NONE, &enqueue, N_("Add files to playlist"), NULL},
@@ -373,7 +375,9 @@ int main (int argc, char **argv)
 	player = parole_player_new (client_id);
 	g_free (client_id);
 	
-	if (fullscreen)
+	if (embedded)
+	    parole_player_embedded (player);
+	else if (fullscreen)
 	    parole_player_full_screen (player, TRUE);
 
 	if ( filenames && filenames[0] != NULL )
diff --git a/src/parole-player.c b/src/parole-player.c
index 7a13c99..15aa9bf 100644
--- a/src/parole-player.c
+++ b/src/parole-player.c
@@ -338,6 +338,7 @@ struct ParolePlayerPrivate
      
     gboolean             exit;
     
+    gboolean		 embedded;
     gboolean		 full_screen;
     
     ParoleState     state;
@@ -1507,6 +1508,19 @@ parole_player_move_fs_window (ParolePlayer *player)
 }
 
 void
+parole_player_embedded (ParolePlayer *player)
+{
+    gtk_widget_hide (player->priv->menu_bar);
+    gtk_widget_hide (player->priv->playlist_nt);
+    gtk_widget_hide (player->priv->go_fs);
+    gtk_widget_hide (player->priv->leave_fs);
+    gtk_widget_hide (player->priv->show_hide_playlist);
+    gtk_widget_hide (player->priv->show_hide_playlist_button);
+    
+    player->priv->embedded = TRUE;
+}
+
+void
 parole_player_full_screen (ParolePlayer *player, gboolean fullscreen)
 {
     gint npages;
@@ -2029,7 +2043,7 @@ parole_player_handle_key_press (GdkEventKey *ev, ParolePlayer *player)
     {
 	case GDK_f:
 	case GDK_F:
-	    parole_player_full_screen_menu_item_activate (player);
+            if ( player->priv->embedded != TRUE ) parole_player_full_screen_menu_item_activate (player);
 	    ret_val = TRUE;
 	    break;
 	case GDK_space:
@@ -2101,7 +2115,7 @@ parole_player_key_press (GtkWidget *widget, GdkEventKey *ev, ParolePlayer *playe
     switch (ev->keyval)
     {
 	case GDK_F11:
-	    parole_player_full_screen_menu_item_activate (player);
+            if ( player->priv->embedded != TRUE ) parole_player_full_screen_menu_item_activate (player);
 	    return TRUE;
 #ifdef HAVE_XF86_KEYSYM
 	case XF86XK_AudioPlay:


More information about the Xfce4-commits mailing list