static void impl_deactivate (PeasActivatable *plugin) { GtkWindow *window; GtkUIManager *manager; XplayerObject *xplayer; XplayerSkiptoPluginPrivate *priv = XPLAYER_SKIPTO_PLUGIN (plugin)->priv; xplayer = g_object_get_data (G_OBJECT (plugin), "object"); g_signal_handler_disconnect (G_OBJECT (xplayer), priv->handler_id_stream_length); g_signal_handler_disconnect (G_OBJECT (xplayer), priv->handler_id_seekable); if (priv->handler_id_key_press != 0) { window = xplayer_get_main_window (xplayer); g_signal_handler_disconnect (G_OBJECT(window), priv->handler_id_key_press); priv->handler_id_key_press = 0; g_object_unref (window); } /* Remove the menu */ manager = xplayer_get_ui_manager (xplayer); gtk_ui_manager_remove_ui (manager, priv->ui_merge_id); gtk_ui_manager_remove_action_group (manager, priv->action_group); destroy_dialog (XPLAYER_SKIPTO_PLUGIN (plugin)); }
static void xplayer_screensaver_update_from_state (XplayerObject *xplayer, XplayerScreensaverPlugin *pi) { gboolean lock_screensaver_on_audio, has_video_frames; BaconVideoWidget *bvw; bvw = BACON_VIDEO_WIDGET (xplayer_get_video_widget ((Xplayer *)(xplayer))); lock_screensaver_on_audio = g_settings_get_boolean (pi->priv->settings, "lock-screensaver-on-audio"); has_video_frames = has_video (bvw); if ((xplayer_is_playing (xplayer) != FALSE && has_video_frames) || (xplayer_is_playing (xplayer) != FALSE && !lock_screensaver_on_audio)) { if (pi->priv->inhibit_cookie == 0) { GtkWindow *window; window = xplayer_get_main_window (xplayer); pi->priv->inhibit_cookie = gtk_application_inhibit (GTK_APPLICATION (xplayer), window, GTK_APPLICATION_INHIBIT_IDLE, _("Playing a movie")); g_object_unref (window); } } else { if (pi->priv->inhibit_cookie != 0) { gtk_application_uninhibit (GTK_APPLICATION (pi->priv->xplayer), pi->priv->inhibit_cookie); pi->priv->inhibit_cookie = 0; } } }
static void impl_activate (PeasActivatable *plugin) { GtkWindow *window; GtkUIManager *manager; XplayerSkiptoPlugin *pi = XPLAYER_SKIPTO_PLUGIN (plugin); XplayerSkiptoPluginPrivate *priv = pi->priv; const GtkActionEntry menu_entries[] = { { "skip-to", "go-jump-symbolic", N_("_Skip To..."), "<Control>K", N_("Skip to a specific time"), G_CALLBACK (skip_to_action_callback) } }; priv->xplayer = g_object_get_data (G_OBJECT (plugin), "object"); priv->handler_id_stream_length = g_signal_connect (G_OBJECT (priv->xplayer), "notify::stream-length", G_CALLBACK (property_notify_cb), pi); priv->handler_id_seekable = g_signal_connect (G_OBJECT (priv->xplayer), "notify::seekable", G_CALLBACK (property_notify_cb), pi); /* Key press handler */ window = xplayer_get_main_window (priv->xplayer); priv->handler_id_key_press = g_signal_connect (G_OBJECT(window), "key-press-event", G_CALLBACK (on_window_key_press_event), pi); g_object_unref (window); /* Install the menu */ priv->action_group = gtk_action_group_new ("skip-to_group"); gtk_action_group_set_translation_domain (priv->action_group, GETTEXT_PACKAGE); gtk_action_group_add_actions (priv->action_group, menu_entries, G_N_ELEMENTS (menu_entries), pi); manager = xplayer_get_ui_manager (priv->xplayer); gtk_ui_manager_insert_action_group (manager, priv->action_group, -1); g_object_unref (priv->action_group); priv->ui_merge_id = gtk_ui_manager_new_merge_id (manager); gtk_ui_manager_add_ui (manager, priv->ui_merge_id, "/ui/tmw-menubar/go/skip-forward", "skip-to", "skip-to", GTK_UI_MANAGER_AUTO, TRUE); xplayer_skipto_update_from_state (priv->xplayer, pi); }
static void impl_activate (PeasActivatable *plugin) { XplayerOntopPlugin *pi = XPLAYER_ONTOP_PLUGIN (plugin); pi->priv->xplayer = g_object_get_data (G_OBJECT (plugin), "object"); pi->priv->window = xplayer_get_main_window (pi->priv->xplayer); pi->priv->bvw = BACON_VIDEO_WIDGET (xplayer_get_video_widget (pi->priv->xplayer)); pi->priv->handler_id = g_signal_connect (G_OBJECT (pi->priv->xplayer), "notify::playing", G_CALLBACK (property_notify_cb), pi); pi->priv->handler_id_metadata = g_signal_connect (G_OBJECT (pi->priv->bvw), "got-metadata", G_CALLBACK (got_metadata_cb), pi); update_from_state (pi->priv); }
static void xplayer_disc_recorder_plugin_burn (GtkAction *action, XplayerDiscRecorderPlugin *pi) { char *path; char *error = NULL; path = xplayer_disc_recorder_plugin_write_video_project (pi, &error); if (!path) { xplayer_interface_error (_("The movie could not be recorded."), error, xplayer_get_main_window (pi->priv->xplayer)); g_free (error); return; } if (!xplayer_disc_recorder_plugin_start_burning (pi, path, FALSE)) g_remove (path); g_free (path); }
static gboolean xplayer_disc_recorder_plugin_start_burning (XplayerDiscRecorderPlugin *pi, const char *path, gboolean copy) { GtkWindow *main_window; GdkScreen *screen; GdkDisplay *display; gchar *command_line; GList *uris; GAppInfo *info; GdkAppLaunchContext *context; GError *error = NULL; char *xid_arg; main_window = xplayer_get_main_window (pi->priv->xplayer); screen = gtk_widget_get_screen (GTK_WIDGET (main_window)); display = gdk_display_get_default (); /* Build a command line to use */ xid_arg = NULL; #ifdef GDK_WINDOWING_X11 if (GDK_IS_X11_DISPLAY (display)) xid_arg = g_strdup_printf ("-x %d", (int) gdk_x11_window_get_xid (gtk_widget_get_window (GTK_WIDGET (main_window)))); #endif /* GDK_WINDOWING_X11 */ g_object_unref (main_window); if (copy != FALSE) command_line = g_strdup_printf ("brasero %s -c", xid_arg ? xid_arg : ""); else command_line = g_strdup_printf ("brasero %s -r", xid_arg ? xid_arg : ""); /* Build the app info */ info = g_app_info_create_from_commandline (command_line, NULL, G_APP_INFO_CREATE_SUPPORTS_URIS | G_APP_INFO_CREATE_SUPPORTS_STARTUP_NOTIFICATION, &error); g_free (command_line); if (error != NULL) goto error; /* Create a launch context and launch it */ context = gdk_display_get_app_launch_context (gtk_widget_get_display (GTK_WIDGET (main_window))); gdk_app_launch_context_set_screen (context, screen); uris = g_list_prepend (NULL, (gpointer) path); g_app_info_launch_uris (info, uris, G_APP_LAUNCH_CONTEXT (context), &error); g_list_free (uris); g_object_unref (info); g_object_unref (context); if (error != NULL) goto error; return TRUE; error: main_window = xplayer_get_main_window (pi->priv->xplayer); if (copy != FALSE) xplayer_interface_error (_("The video disc could not be duplicated."), error->message, main_window); else xplayer_interface_error (_("The movie could not be recorded."), error->message, main_window); g_error_free (error); g_object_unref (main_window); return FALSE; }