From 10c452c42c22654f0ac7f121b0036334c178b6b7 Mon Sep 17 00:00:00 2001 From: Bastien Nocera Date: Mon, 11 Feb 2019 16:01:07 +0100 Subject: [PATCH] properties: Remove nautilus properties page It's now in nautilus itself. See: https://gitlab.gnome.org/GNOME/nautilus/issues/887 https://gitlab.gnome.org/GNOME/nautilus/merge_requests/411 --- .gitlab-ci.yml | 2 +- docs/reference/meson.build | 1 - meson.build | 29 --- meson_options.txt | 2 - po/POTFILES.in | 2 - src/meson.build | 45 ---- src/test-properties-page.c | 87 -------- src/totem-properties-main.c | 160 --------------- src/totem-properties-view.c | 395 ------------------------------------ src/totem-properties-view.h | 57 ------ 10 files changed, 1 insertion(+), 779 deletions(-) delete mode 100644 src/test-properties-page.c delete mode 100644 src/totem-properties-main.c delete mode 100644 src/totem-properties-view.c delete mode 100644 src/totem-properties-view.h diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index ce6035db2..2b89a1fcf 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -6,7 +6,7 @@ build-fedora: image: fedora:latest stage: test before_script: - - dnf install -y redhat-rpm-config meson git cairo-devel clutter-devel clutter-gst3-devel clutter-gtk-devel gcc-c++ gettext gnome-desktop3-devel grilo-devel gsettings-desktop-schemas-devel gstreamer1-devel gstreamer1-plugins-base-devel gstreamer1-plugins-good gtk3-devel gtk-doc itstool libappstream-glib liberation-sans-fonts libpeas-devel lirc-devel meson nautilus-devel pygobject3-devel pylint python3-devel totem-pl-parser-devel flatpak-builder + - dnf install -y redhat-rpm-config meson git cairo-devel clutter-devel clutter-gst3-devel clutter-gtk-devel gcc-c++ gettext gnome-desktop3-devel grilo-devel gsettings-desktop-schemas-devel gstreamer1-devel gstreamer1-plugins-base-devel gstreamer1-plugins-good gtk3-devel gtk-doc itstool libappstream-glib liberation-sans-fonts libpeas-devel lirc-devel meson pygobject3-devel pylint python3-devel totem-pl-parser-devel flatpak-builder script: - meson _build - ninja -C _build test diff --git a/docs/reference/meson.build b/docs/reference/meson.build index 8ec9db342..1776eaa0c 100644 --- a/docs/reference/meson.build +++ b/docs/reference/meson.build @@ -40,7 +40,6 @@ private_headers = [ 'totem-preferences.h', 'totem-private.h', 'totem-profile.h', - 'totem-properties-view.h', 'totem-python-plugin.h', 'totem-resources.h', 'totem-screenshot-plugin.h', diff --git a/meson.build b/meson.build index e7c878652..1a2ef09b6 100644 --- a/meson.build +++ b/meson.build @@ -216,28 +216,6 @@ if python_option != 'no' endif endif -# nautilus support -have_nautilus = false - -if get_option('enable-nautilus') != 'no' - libnautilus_ext_dep = dependency('libnautilus-extension', version: '>= 2.91.3', required: false) - if libnautilus_ext_dep.found() - nautilusdir = get_option('with-nautilusdir') - if nautilusdir == '' - nautilusdir = libnautilus_ext_dep.get_pkgconfig_variable('extensiondir') - endif - - have_nautilus = true - message('installing nautilus plugin in ' + nautilusdir) - else - if get_option('enable-nautilus') == 'yes' - error('nautilus support enabled but libnautilus-extension missing') - else - message('libnautilus-extension missing so disabling nautilus supportt') - endif - endif -endif - configure_file( output: 'config.h', configuration: config_h @@ -287,11 +265,4 @@ foreach plugin: allowed_plugins endif endforeach -str = 'Nautilus properties page' -if have_nautilus - message('** ' + str + ' enabled') -else - message(' ' + str + ' disabled') -endif - message('End options') diff --git a/meson_options.txt b/meson_options.txt index bcce94676..e1c590968 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -1,7 +1,5 @@ option('enable-easy-codec-installation', type: 'combo', choices: ['yes', 'no', 'auto'], value: 'auto', description: 'Whether to enable easy codec installation support for GStreamer') option('enable-python', type: 'combo', choices: ['yes', 'no', 'auto'], value: 'auto', description: 'Enable python support') option('with-plugins', type: 'combo', choices: ['all', 'none', 'auto'], value: 'auto', description: 'Which Totem plugins to compile (default: auto; "all", "none" and "auto" are valid)') -option('enable-nautilus', type: 'combo', choices: ['yes', 'no', 'auto'], value: 'auto', description: 'compile the nautilus plugin') -option('with-nautilusdir', type: 'string', value: '', description: 'Installation path for Nautilus extension') option('enable-gtk-doc', type: 'boolean', value: false, description: 'use gtk-doc to build documentation') option('enable-introspection', type: 'combo', choices: ['yes', 'no', 'auto'], value: 'auto', description: 'Enable GObject Introspection (depends on GObject)') diff --git a/po/POTFILES.in b/po/POTFILES.in index 29cdec3bd..8676b6f49 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -28,8 +28,6 @@ src/totem-open-location.c src/totem-options.c src/totem-playlist.c src/totem-preferences.c -src/totem-properties-main.c -src/totem-properties-view.c src/totemselectiontoolbar.ui src/totem-subtitle-encoding.c src/totem-time-label.c diff --git a/src/meson.build b/src/meson.build index 478798384..c5e04bf97 100644 --- a/src/meson.build +++ b/src/meson.build @@ -24,7 +24,6 @@ enum_headers = files( 'totem-preferences.h', 'totem-private.h', 'totem-profile.h', - 'totem-properties-view.h', 'totem-resources.h', 'totem-search-entry.h', 'totem-selection-toolbar.h', @@ -250,50 +249,6 @@ executable( install_dir: totem_libexecdir ) -if have_nautilus - libtotem_properties_page_sources = files( - 'totem-properties-main.c', - 'totem-properties-view.c' - ) - - libtotem_properties_page_deps = missing_plugins_deps + [ - gtk_dep, - dependency('gthread-2.0'), - libnautilus_ext_dep, - gst_tag_dep, - libbacon_video_widget_properties_dep - ] - - libtotem_properties_page = shared_module( - 'totem-properties-page', - sources: libtotem_properties_page_sources + gen_sources, - include_directories: top_inc, - dependencies: libtotem_properties_page_deps, - c_args: totem_common_cflags + [ - '-DG_LOG_DOMAIN="TotemPropertiesPage"' - ], - install: true, - install_dir: nautilusdir - ) - - test_properties_page_sources = files( - 'totem-properties-main.c', - 'totem-properties-view.c', - 'test-properties-page.c' - ) - - executable( - 'test-properties-page', - test_properties_page_sources + gen_sources, - include_directories: top_inc, - dependencies: libtotem_properties_page_deps + [ - libtotem_player_dep, - libbacon_video_widget_dep - ], - c_args: totem_common_cflags - ) -endif - test_icons_sources = files( 'icon-helpers.c', 'test-icons.c' diff --git a/src/test-properties-page.c b/src/test-properties-page.c deleted file mode 100644 index 8dd3f2e33..000000000 --- a/src/test-properties-page.c +++ /dev/null @@ -1,87 +0,0 @@ -/* - * Copyright (C) 2005 Bastien Nocera - * - * This library 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 library 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 library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * The Totem project hereby grant permission for non-gpl compatible GStreamer - * plugins to be used and distributed together with GStreamer and Totem. This - * permission are above and beyond the permissions granted by the GPL license - * Totem is covered by. - * - * Monday 7th February 2005: Christian Schaller: Add exception clause. - * See license_change file for details. - * - */ - -#include -#include -#define GST_USE_UNSTABLE_API 1 -#include -#include -#include "totem-properties-view.h" - -static GtkWidget *window, *props, *label; - -static void -create_props (const char *url) -{ - label = gtk_label_new ("Audio/Video"); - window = gtk_window_new (GTK_WINDOW_TOPLEVEL); - g_signal_connect (G_OBJECT (window), "destroy", - G_CALLBACK (gtk_main_quit), NULL); - gtk_window_set_default_size (GTK_WINDOW (window), 450, 550); - props = totem_properties_view_new (url, label); - gtk_container_add (GTK_CONTAINER (window), props); - - gtk_widget_show_all (window); -} - -static void -destroy_props (void) -{ - gtk_widget_destroy (label); -} - -int main (int argc, char **argv) -{ - GFile *file; - char *url; - - bindtextdomain (GETTEXT_PACKAGE, GNOMELOCALEDIR); - bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); - textdomain (GETTEXT_PACKAGE); - - gst_init (&argc, &argv); - gtk_init (&argc, &argv); - - if (argc != 2) { - g_print ("Usage: %s [URI]\n", argv[0]); - return 1; - } - - file = g_file_new_for_commandline_arg (argv[1]); - url = g_file_get_uri (file); - g_object_unref (file); - - create_props (url); - g_free (url); - - gtk_main (); - - destroy_props (); - - return 0; -} - diff --git a/src/totem-properties-main.c b/src/totem-properties-main.c deleted file mode 100644 index 4a60489a2..000000000 --- a/src/totem-properties-main.c +++ /dev/null @@ -1,160 +0,0 @@ -/* - * Copyright (C) 2000, 2001 Eazel Inc. - * Copyright (C) 2003 Andrew Sobala - * Copyright (C) 2005 Bastien Nocera - * - * This library 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 library 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 library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * The Totem project hereby grant permission for non-gpl compatible GStreamer - * plugins to be used and distributed together with GStreamer and Totem. This - * permission are above and beyond the permissions granted by the GPL license - * Totem is covered by. - * - */ - -#include -#include -#include -#define GST_USE_UNSTABLE_API 1 -#include - -#include "gst/totem-gst-helpers.h" -#include "totem-properties-view.h" -#include -#include - -#define WANT_MIME_TYPES 1 -#include "totem-mime-types.h" - -static GType tpp_type = 0; -static void property_page_provider_iface_init - (NautilusPropertyPageProviderIface *iface); -static GList *totem_properties_get_pages - (NautilusPropertyPageProvider *provider, GList *files); - -static void -totem_properties_plugin_register_type (GTypeModule *module) -{ - const GTypeInfo info = { - sizeof (GObjectClass), - (GBaseInitFunc) NULL, - (GBaseFinalizeFunc) NULL, - (GClassInitFunc) NULL, - NULL, - NULL, - sizeof (GObject), - 0, - (GInstanceInitFunc) NULL - }; - const GInterfaceInfo property_page_provider_iface_info = { - (GInterfaceInitFunc)property_page_provider_iface_init, - NULL, - NULL - }; - - tpp_type = g_type_module_register_type (module, G_TYPE_OBJECT, - "TotemPropertiesPlugin", - &info, 0); - g_type_module_add_interface (module, - tpp_type, - NAUTILUS_TYPE_PROPERTY_PAGE_PROVIDER, - &property_page_provider_iface_info); -} - -static void -property_page_provider_iface_init (NautilusPropertyPageProviderIface *iface) -{ - iface->get_pages = totem_properties_get_pages; -} - -static gpointer -init_backend (gpointer data) -{ - gst_init (NULL, NULL); - totem_gst_disable_display_decoders (); - return NULL; -} - -static GList * -totem_properties_get_pages (NautilusPropertyPageProvider *provider, - GList *files) -{ - static GOnce backend_inited = G_ONCE_INIT; - NautilusFileInfo *file; - char *uri; - GtkWidget *page, *label; - NautilusPropertyPage *property_page; - guint i; - gboolean found; - - /* only add properties page if a single file is selected */ - if (files == NULL || files->next != NULL) - return NULL; - file = files->data; - - /* only add the properties page to these mime types */ - found = FALSE; - for (i = 0; mime_types[i] != NULL; i++) { - if (nautilus_file_info_is_mime_type (file, mime_types[i])) { - found = TRUE; - break; - } - } - if (found == FALSE) - return NULL; - - /* okay, make the page, init'ing the backend first if necessary */ - g_once (&backend_inited, init_backend, NULL); - - uri = nautilus_file_info_get_uri (file); - label = gtk_label_new (_("Audio/Video")); - page = totem_properties_view_new (uri, label); - g_free (uri); - - gtk_container_set_border_width (GTK_CONTAINER (page), 6); - property_page = nautilus_property_page_new ("video-properties", - label, page); - - return g_list_prepend (NULL, property_page); -} - -/* --- extension interface --- */ -void -nautilus_module_initialize (GTypeModule *module) -{ - /* set up translation catalog */ - bindtextdomain (GETTEXT_PACKAGE, GNOMELOCALEDIR); - bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); - - totem_properties_plugin_register_type (module); - totem_properties_view_register_type (module); -} - -void -nautilus_module_shutdown (void) -{ -} - -void -nautilus_module_list_types (const GType **types, - int *num_types) -{ - static GType type_list[1]; - - type_list[0] = tpp_type; - *types = type_list; - *num_types = G_N_ELEMENTS (type_list); -} - diff --git a/src/totem-properties-view.c b/src/totem-properties-view.c deleted file mode 100644 index 51c1334ef..000000000 --- a/src/totem-properties-view.c +++ /dev/null @@ -1,395 +0,0 @@ -/* - * Copyright (C) 2003 Andrew Sobala - * Copyright (C) 2004 Bastien Nocera - * - * This library 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 library 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 library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * The Totem project hereby grant permission for non-gpl compatible GStreamer - * plugins to be used and distributed together with GStreamer and Totem. This - * permission are above and beyond the permissions granted by the GPL license - * Totem is covered by. - * - * Monday 7th February 2005: Christian Schaller: Add exception clause. - * See license_change file for details. - * - */ - -#include - -#include -#include - -#define GST_USE_UNSTABLE_API 1 -#include -#include - -#include "totem-properties-view.h" -#include "bacon-video-widget-properties.h" - -struct TotemPropertiesViewPriv { - GtkWidget *label; - GtkWidget *vbox; - BaconVideoWidgetProperties *props; - GstDiscoverer *disco; -}; - -static GObjectClass *parent_class = NULL; -static void totem_properties_view_finalize (GObject *object); - -G_DEFINE_TYPE (TotemPropertiesView, totem_properties_view, GTK_TYPE_GRID) - -void -totem_properties_view_register_type (GTypeModule *module) -{ - totem_properties_view_get_type (); -} - -static void -totem_properties_view_class_init (TotemPropertiesViewClass *class) -{ - parent_class = g_type_class_peek_parent (class); - G_OBJECT_CLASS (class)->finalize = totem_properties_view_finalize; -} - -static void -update_general (TotemPropertiesView *props, - const GstTagList *list) -{ - struct { - const char *tag_name; - const char *widget; - } items[] = { - { GST_TAG_TITLE, "title" }, - { GST_TAG_ARTIST, "artist" }, - { GST_TAG_ALBUM, "album" }, - }; - guint i; - GDate *date; - GstDateTime *datetime; - gchar *comment; - - for (i = 0; i < G_N_ELEMENTS(items); i++) { - char *string; - - if (gst_tag_list_get_string_index (list, items[i].tag_name, 0, &string) != FALSE) { - bacon_video_widget_properties_set_label (props->priv->props, - items[i].widget, - string); - g_free (string); - } - } - - /* Comment else use Description defined by: - * http://xiph.org/vorbis/doc/v-comment.html */ - if (gst_tag_list_get_string (list, GST_TAG_COMMENT, &comment) || - gst_tag_list_get_string (list, GST_TAG_DESCRIPTION, &comment)) { - - bacon_video_widget_properties_set_label (props->priv->props, - "comment", - comment); - g_free (comment); - } - - /* Date */ - if (gst_tag_list_get_date (list, GST_TAG_DATE, &date)) { - char *string; - - string = g_strdup_printf ("%d", g_date_get_year (date)); - g_date_free (date); - bacon_video_widget_properties_set_label (props->priv->props, - "year", - string); - g_free (string); - } else if (gst_tag_list_get_date_time (list, GST_TAG_DATE_TIME, &datetime)) { - char *string; - - string = g_strdup_printf ("%d", gst_date_time_get_year (datetime)); - gst_date_time_unref (datetime); - bacon_video_widget_properties_set_label (props->priv->props, - "year", - string); - g_free (string); - } -} - -static void -set_codec (TotemPropertiesView *props, - GstDiscovererStreamInfo *info, - const char *widget) -{ - GstCaps *caps; - const char *nick; - - nick = gst_discoverer_stream_info_get_stream_type_nick (info); - if (g_str_equal (nick, "audio") == FALSE && - g_str_equal (nick, "video") == FALSE && - g_str_equal (nick, "container") == FALSE) { - bacon_video_widget_properties_set_label (props->priv->props, - widget, - _("N/A")); - return; - } - - caps = gst_discoverer_stream_info_get_caps (info); - if (caps) { - if (gst_caps_is_fixed (caps)) { - char *string; - - string = gst_pb_utils_get_codec_description (caps); - bacon_video_widget_properties_set_label (props->priv->props, - widget, - string); - g_free (string); - } - gst_caps_unref (caps); - } -} - -static void -set_bitrate (TotemPropertiesView *props, - guint bitrate, - const char *widget) -{ - char *string; - - if (!bitrate) { - bacon_video_widget_properties_set_label (props->priv->props, - widget, - C_("Stream bit rate", "N/A")); - return; - } - string = g_strdup_printf (_("%d kbps"), bitrate / 1000); - bacon_video_widget_properties_set_label (props->priv->props, - widget, - string); - g_free (string); -} - -static void -update_video (TotemPropertiesView *props, - GstDiscovererVideoInfo *info) -{ - guint width, height; - guint fps_n, fps_d; - char *string; - - width = gst_discoverer_video_info_get_width (info); - height = gst_discoverer_video_info_get_height (info); - string = g_strdup_printf (N_("%d × %d"), width, height); - bacon_video_widget_properties_set_label (props->priv->props, - "dimensions", - string); - g_free (string); - - set_codec (props, (GstDiscovererStreamInfo *) info, "vcodec"); - set_bitrate (props, gst_discoverer_video_info_get_bitrate (info), "video_bitrate"); - - /* Round up/down to the nearest integer framerate */ - fps_n = gst_discoverer_video_info_get_framerate_num (info); - fps_d = gst_discoverer_video_info_get_framerate_denom (info); - if (fps_d == 0) - bacon_video_widget_properties_set_framerate (props->priv->props, 0); - else - bacon_video_widget_properties_set_framerate (props->priv->props, - (fps_n + fps_d/2) / fps_d); -} - -static void -update_audio (TotemPropertiesView *props, - GstDiscovererAudioInfo *info) -{ - guint samplerate, channels; - - set_codec (props, (GstDiscovererStreamInfo *) info, "acodec"); - - set_bitrate (props, gst_discoverer_audio_info_get_bitrate (info), "audio_bitrate"); - - samplerate = gst_discoverer_audio_info_get_sample_rate (info); - if (samplerate) { - char *string; - string = g_strdup_printf (_("%d Hz"), samplerate); - bacon_video_widget_properties_set_label (props->priv->props, - "samplerate", - string); - g_free (string); - } else { - bacon_video_widget_properties_set_label (props->priv->props, - "samplerate", - C_("Sample rate", "N/A")); - } - - channels = gst_discoverer_audio_info_get_channels (info); - if (channels) { - char *string; - - if (channels > 2) { - string = g_strdup_printf ("%s %d.1", _("Surround"), channels - 1); - } else if (channels == 1) { - string = g_strdup (_("Mono")); - } else if (channels == 2) { - string = g_strdup (_("Stereo")); - } - bacon_video_widget_properties_set_label (props->priv->props, - "channels", - string); - g_free (string); - } else { - bacon_video_widget_properties_set_label (props->priv->props, - "channels", - C_("Number of audio channels", "N/A")); - } -} - -static void -discovered_cb (GstDiscoverer *discoverer, - GstDiscovererInfo *info, - GError *error, - TotemPropertiesView *props) -{ - GList *video_streams, *audio_streams; - const GstTagList *taglist; - gboolean has_audio, has_video; - const char *label; - GstClockTime duration; - GstDiscovererStreamInfo *sinfo; - - if (error) { - g_warning ("Couldn't get information about '%s': %s", - gst_discoverer_info_get_uri (info), - error->message); - return; - } - - video_streams = gst_discoverer_info_get_video_streams (info); - has_video = (video_streams != NULL); - audio_streams = gst_discoverer_info_get_audio_streams (info); - has_audio = (audio_streams != NULL); - - if (has_audio == has_video) - label = N_("Audio/Video"); - else if (has_audio) - label = N_("Audio"); - else - label = N_("Video"); - - gtk_label_set_text (GTK_LABEL (props->priv->label), _(label)); - - /* Widgets */ - bacon_video_widget_properties_set_has_type (props->priv->props, - has_video, - has_audio); - - /* General */ - duration = gst_discoverer_info_get_duration (info); - bacon_video_widget_properties_set_duration (props->priv->props, duration / GST_SECOND * 1000); - - sinfo = gst_discoverer_info_get_stream_info (info); - if (sinfo) { - set_codec (props, sinfo, "container"); - gst_discoverer_stream_info_unref (sinfo); - } - - taglist = gst_discoverer_info_get_tags (info); - update_general (props, taglist); - - /* Video and Audio */ - if (video_streams) - update_video (props, video_streams->data); - if (audio_streams) - update_audio (props, audio_streams->data); - - gst_discoverer_stream_info_list_free (video_streams); - gst_discoverer_stream_info_list_free (audio_streams); -} - -static void -totem_properties_view_init (TotemPropertiesView *props) -{ - GError *err = NULL; - - props->priv = g_new0 (TotemPropertiesViewPriv, 1); - - props->priv->vbox = bacon_video_widget_properties_new (); - gtk_grid_attach (GTK_GRID (props), props->priv->vbox, 0, 0, 1, 1); - gtk_widget_show (GTK_WIDGET (props)); - - props->priv->props = BACON_VIDEO_WIDGET_PROPERTIES (props->priv->vbox); - - props->priv->disco = gst_discoverer_new (GST_SECOND * 60, &err); - if (props->priv->disco == NULL) { - g_warning ("Could not create discoverer object: %s", err->message); - g_error_free (err); - return; - } - g_signal_connect (props->priv->disco, "discovered", - G_CALLBACK (discovered_cb), props); -} - -static void -totem_properties_view_finalize (GObject *object) -{ - TotemPropertiesView *props; - - props = TOTEM_PROPERTIES_VIEW (object); - - if (props->priv != NULL) { - if (props->priv->disco) { - g_signal_handlers_disconnect_by_func (props->priv->disco, - discovered_cb, - props); - gst_discoverer_stop (props->priv->disco); - g_clear_object (&props->priv->disco); - } - g_clear_object (&props->priv->label); - g_free (props->priv); - } - props->priv = NULL; - - G_OBJECT_CLASS (parent_class)->finalize (object); -} - -static void -totem_properties_view_set_location (TotemPropertiesView *props, - const char *location) -{ - g_assert (TOTEM_IS_PROPERTIES_VIEW (props)); - - if (props->priv->disco) - gst_discoverer_stop (props->priv->disco); - - bacon_video_widget_properties_reset (props->priv->props); - - if (location != NULL && props->priv->disco != NULL) { - gst_discoverer_start (props->priv->disco); - - if (gst_discoverer_discover_uri_async (props->priv->disco, location) == FALSE) { - g_warning ("Couldn't add %s to list", location); - return; - } - } -} - -GtkWidget * -totem_properties_view_new (const char *location, GtkWidget *label) -{ - TotemPropertiesView *self; - - self = g_object_new (TOTEM_TYPE_PROPERTIES_VIEW, NULL); - g_object_ref (label); - self->priv->label = label; - totem_properties_view_set_location (self, location); - - return GTK_WIDGET (self); -} diff --git a/src/totem-properties-view.h b/src/totem-properties-view.h deleted file mode 100644 index 6b0a9f2a4..000000000 --- a/src/totem-properties-view.h +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (C) 2003 Andrew Sobala - * Copyright (C) 2005 Bastien Nocera - * - * This library 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 library 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 library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * The Totem project hereby grant permission for non-gpl compatible GStreamer - * plugins to be used and distributed together with GStreamer and Totem. This - * permission are above and beyond the permissions granted by the GPL license - * Totem is covered by. - * - * Monday 7th February 2005: Christian Schaller: Add exception clause. - * See license_change file for details. - * - */ - -#ifndef TOTEM_PROPERTIES_VIEW_H -#define TOTEM_PROPERTIES_VIEW_H - -#include - -#define TOTEM_TYPE_PROPERTIES_VIEW (totem_properties_view_get_type ()) -#define TOTEM_PROPERTIES_VIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TOTEM_TYPE_PROPERTIES_VIEW, TotemPropertiesView)) -#define TOTEM_PROPERTIES_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TOTEM_TYPE_PROPERTIES_VIEW, TotemPropertiesViewClass)) -#define TOTEM_IS_PROPERTIES_VIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TOTEM_TYPE_PROPERTIES_VIEW)) -#define TOTEM_IS_PROPERTIES_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TOTEM_TYPE_PROPERTIES_VIEW)) - -typedef struct TotemPropertiesViewPriv TotemPropertiesViewPriv; - -typedef struct { - GtkGrid parent; - TotemPropertiesViewPriv *priv; -} TotemPropertiesView; - -typedef struct { - GtkGridClass parent; -} TotemPropertiesViewClass; - -GType totem_properties_view_get_type (void); -void totem_properties_view_register_type (GTypeModule *module); - -GtkWidget *totem_properties_view_new (const char *location, - GtkWidget *label); - -#endif /* TOTEM_PROPERTIES_VIEW_H */ -- GitLab