diff options
author | Manish Sinha <manishsinha@ubuntu.com> | 2012-04-02 02:07:16 +0530 |
---|---|---|
committer | Manish Sinha <manishsinha@ubuntu.com> | 2012-04-02 02:07:16 +0530 |
commit | c2f2f8b73a9626ea6f49aab0316c7a5aa14bb902 (patch) | |
tree | 38a961e03f0f80298835d55427f3c4c2bacf76f1 | |
parent | 9a7293a2f3c9eae5a38b8075657f6bfd44f06a52 (diff) |
Remove totem datasource as it is present upstream
-rw-r--r-- | NEWS | 4 | ||||
-rw-r--r-- | configure.ac | 26 | ||||
-rw-r--r-- | totem-libzg/Makefile.am | 50 | ||||
-rw-r--r-- | totem-libzg/headers/bacon-video-widget.h | 477 | ||||
-rw-r--r-- | totem-libzg/headers/totem-cell-renderer-video.h | 71 | ||||
-rw-r--r-- | totem-libzg/headers/totem-playlist.h | 153 | ||||
-rw-r--r-- | totem-libzg/headers/totem-plugin.h | 330 | ||||
-rw-r--r-- | totem-libzg/headers/totem-video-list.h | 75 | ||||
-rw-r--r-- | totem-libzg/headers/totem.h | 284 | ||||
-rw-r--r-- | totem-libzg/libtotem_zeitgeist_plugin_la_vala.stamp | 0 | ||||
-rw-r--r-- | totem-libzg/totem-zeitgeist-plugin.c | 608 | ||||
-rw-r--r-- | totem-libzg/totem-zeitgeist-plugin.vala | 216 | ||||
-rw-r--r-- | totem-libzg/vapi/bacon-video.vapi | 40 | ||||
-rw-r--r-- | totem-libzg/vapi/totem.deps | 1 | ||||
-rw-r--r-- | totem-libzg/vapi/totem.vapi | 127 | ||||
-rw-r--r-- | totem-libzg/zeitgeist.totem-plugin | 8 |
16 files changed, 4 insertions, 2466 deletions
@@ -3,7 +3,9 @@ * New Firefox datasource using js-ctypes which replaces old native addon * New Thunderbird datasource * New Monodeveloper datasources -* Removed gedit datasource +* Removed gedit Datasource as it uses GtkRecentManager +* Removed eog (Eye of GNOME) Datasource as it uses GtkRecentManager +* Removed Totem datasource as it is now upstream * Stop XChat from logging messages to avoid polluting database * Set telepathy subject uri's to telepathy://account_path/target_id * Fix actor for chrome diff --git a/configure.ac b/configure.ac index b6822a2..a57d0f6 100644 --- a/configure.ac +++ b/configure.ac @@ -63,7 +63,7 @@ AC_ARG_ENABLE([all-plugins], AC_MSG_NOTICE([Requested to enable all plugins: ${all_plugins}]) # The full list of plugins -allowed_plugins="bzr chrome geany vim emacs tomboy telepathy xchat rhythmbox firefox totem-libzg firefox-36-libzg monodevelop thunderbird" +allowed_plugins="bzr chrome geany vim emacs tomboy telepathy xchat rhythmbox firefox firefox-36-libzg monodevelop thunderbird" # currently disabled = "epiphany" # npapi-plugin has a template Makefile.am, but don't use it directly @@ -226,26 +226,6 @@ for plugin in ${used_plugins}; do ;; thunderbird) ;; - totem*) - if test "${with_vala}" != "yes" ; then - plugin_error_or_ignore "you need vala installed to use the ${plugin} plugin" - continue - fi - if test "${HAVE_LIBZG}" != "yes" ; then - plugin_error_or_ignore "libzeitgeist not found" - continue - fi - if test "${HAVE_GTK}" != "yes" ; then - plugin_error_or_ignore "gtk+-2.0 not found" - continue - fi - PKG_CHECK_MODULES(TOTEM_PLPARSER, totem-plparser, - [HAVE_TOTEM_PLPARSER=yes], [HAVE_TOTEM_PLPARSER=no]) - if test "${HAVE_TOTEM_PLPARSER}" != "yes" ; then - plugin_error_or_ignore "totem-plparser package not found" - continue - fi - ;; vim) ;; emacs) @@ -338,10 +318,6 @@ if test "x${PLUGINS}" != "x" ; then ]) continue 2 ;; - totem-libzg) - AC_CONFIG_FILES([totem-libzg/Makefile]) - continue 2 - ;; monodevelop) AC_CONFIG_FILES([monodevelop/Makefile]) continue 2 diff --git a/totem-libzg/Makefile.am b/totem-libzg/Makefile.am deleted file mode 100644 index 1bf35a0..0000000 --- a/totem-libzg/Makefile.am +++ /dev/null @@ -1,50 +0,0 @@ -totemplugindir = $(libdir)/totem/plugins/zeitgeist -dist_totemplugin_DATA = zeitgeist.totem-plugin -totemplugin_LTLIBRARIES = libtotem-zeitgeist-plugin.la - -AM_VALAFLAGS = \ - --pkg zeitgeist-1.0 \ - --vapidir=./vapi \ - --pkg bacon-video \ - --pkg totem \ - $(NULL) - -libtotem_zeitgeist_plugin_la_SOURCES = \ - totem-zeitgeist-plugin.vala -libtotem_zeitgeist_plugin_la_CFLAGS = \ - -fPIC -Wall -std=c99 \ - $(ZEITGEIST_CFLAGS) \ - $(GTK_CFLAGS) \ - $(TOTEM_PLPARSER_CFLAGS) \ - -I$(top_srcdir)/totem-libzg/headers \ - $(NULL) - -libtotem_zeitgeist_plugin_la_LIBADD = \ - $(ZEITGEIST_LIBS) \ - $(GTK_LIBS) \ - $(NULL) -libtotem_zeitgeist_plugin_la_LDFLAGS = \ - -module -avoid-version \ - $(NULL) - -EXTRA_DIST = \ - $(top_srcdir)/totem-libzg/headers/totem.h \ - $(top_srcdir)/totem-libzg/headers/totem-plugin.h \ - $(top_srcdir)/totem-libzg/headers/totem-playlist.h \ - $(top_srcdir)/totem-libzg/headers/bacon-video-widget.h \ - $(NULL) - - -# we want to allow also local install -PLUGIN_FILES = zeitgeist.totem-plugin ./.libs/libtotem-zeitgeist-plugin.so - -TOTEM_PLUGIN_HOME_DIR = ~/.local/share/totem/plugins/zeitgeist - -local-install: - mkdir -p $(TOTEM_PLUGIN_HOME_DIR) - cp $(PLUGIN_FILES) $(TOTEM_PLUGIN_HOME_DIR) - -local-uninstall: - echo Removing $(TOTEM_PLUGIN_HOME_DIR) - rm -rf $(TOTEM_PLUGIN_HOME_DIR) - diff --git a/totem-libzg/headers/bacon-video-widget.h b/totem-libzg/headers/bacon-video-widget.h deleted file mode 100644 index 8f81c63..0000000 --- a/totem-libzg/headers/bacon-video-widget.h +++ /dev/null @@ -1,477 +0,0 @@ -/* - * Copyright (C) 2001,2002,2003,2004,2005 Bastien Nocera <hadess@hadess.net> - * - * 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 Street, Fifth Floor, Boston, MA 02110-1301 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 HAVE_BACON_VIDEO_WIDGET_H -#define HAVE_BACON_VIDEO_WIDGET_H - -#include <gtk/gtk.h> -/* for optical disc enumeration type */ -#include <totem-disc.h> - -G_BEGIN_DECLS - -#define BACON_TYPE_VIDEO_WIDGET (bacon_video_widget_get_type ()) -#define BACON_VIDEO_WIDGET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), bacon_video_widget_get_type (), BaconVideoWidget)) -#define BACON_VIDEO_WIDGET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), bacon_video_widget_get_type (), BaconVideoWidgetClass)) -#define BACON_IS_VIDEO_WIDGET(obj) (G_TYPE_CHECK_INSTANCE_TYPE (obj, bacon_video_widget_get_type ())) -#define BACON_IS_VIDEO_WIDGET_CLASS(klass) (G_CHECK_INSTANCE_GET_CLASS ((klass), bacon_video_widget_get_type ())) -#define BVW_ERROR bacon_video_widget_error_quark () - -typedef struct BaconVideoWidgetPrivate BaconVideoWidgetPrivate; -typedef struct BaconVideoWidgetCommon BaconVideoWidgetCommon; - -/** - * BaconVideoWidget: - * - * All the fields in the #BaconVideoWidget structure are private and should never be accessed directly. - **/ -typedef struct { - /*< private >*/ - GtkEventBox parent; - BaconVideoWidgetPrivate *priv; -} BaconVideoWidget; - -/** - * BaconVideoWidgetClass: - * - * All the fields in the #BaconVideoWidgetClass structure are private and should never be accessed directly. - **/ -typedef struct { - /*< private >*/ - GtkEventBoxClass parent_class; - - void (*error) (GtkWidget *bvw, const char *message, - gboolean playback_stopped, gboolean fatal); - void (*eos) (GtkWidget *bvw); - void (*got_metadata) (GtkWidget *bvw); - void (*got_redirect) (GtkWidget *bvw, const char *mrl); - void (*title_change) (GtkWidget *bvw, const char *title); - void (*channels_change) (GtkWidget *bvw); - void (*tick) (GtkWidget *bvw, gint64 current_time, gint64 stream_length, - double current_position, gboolean seekable); - void (*buffering) (GtkWidget *bvw, guint progress); - void (*download_buffering) (GtkWidget *bvw, gdouble percentage); -} BaconVideoWidgetClass; - -/** - * BvwError: - * @BVW_ERROR_AUDIO_PLUGIN: Error loading audio output plugin or device. - * @BVW_ERROR_NO_PLUGIN_FOR_FILE: A required GStreamer plugin or xine feature is missing. - * @BVW_ERROR_VIDEO_PLUGIN: Error loading video output plugin or device. - * @BVW_ERROR_AUDIO_BUSY: Audio output device is busy. - * @BVW_ERROR_BROKEN_FILE: The movie file is broken and cannot be decoded. - * @BVW_ERROR_FILE_GENERIC: A generic error for problems with movie files. - * @BVW_ERROR_FILE_PERMISSION: Permission was refused to access the stream, or authentication was required. - * @BVW_ERROR_FILE_ENCRYPTED: The stream is encrypted and cannot be played. - * @BVW_ERROR_FILE_NOT_FOUND: The stream cannot be found. - * @BVW_ERROR_DVD_ENCRYPTED: The DVD is encrypted and libdvdcss is not installed. - * @BVW_ERROR_INVALID_DEVICE: The device given in an MRL (e.g. DVD drive or DVB tuner) did not exist. - * @BVW_ERROR_DEVICE_BUSY: The device was busy. - * @BVW_ERROR_UNKNOWN_HOST: The host for a given stream could not be resolved. - * @BVW_ERROR_NETWORK_UNREACHABLE: The host for a given stream could not be reached. - * @BVW_ERROR_CONNECTION_REFUSED: The server for a given stream refused the connection. - * @BVW_ERROR_INVALID_LOCATION: An MRL was malformed, or CDDB playback was attempted (which is now unsupported). - * @BVW_ERROR_GENERIC: A generic error occurred. - * @BVW_ERROR_CODEC_NOT_HANDLED: The audio or video codec required by the stream is not supported. - * @BVW_ERROR_AUDIO_ONLY: An audio-only stream could not be played due to missing audio output support. - * @BVW_ERROR_CANNOT_CAPTURE: Error determining frame capture support for a video with bacon_video_widget_can_get_frames(). - * @BVW_ERROR_READ_ERROR: A generic error for problems reading streams. - * @BVW_ERROR_PLUGIN_LOAD: A library or plugin could not be loaded. - * @BVW_ERROR_EMPTY_FILE: A movie file was empty. - * - * Error codes for #BaconVideoWidget operations. - **/ -typedef enum { - /* Plugins */ - BVW_ERROR_AUDIO_PLUGIN, - BVW_ERROR_NO_PLUGIN_FOR_FILE, - BVW_ERROR_VIDEO_PLUGIN, - BVW_ERROR_AUDIO_BUSY, - /* File */ - BVW_ERROR_BROKEN_FILE, - BVW_ERROR_FILE_GENERIC, - BVW_ERROR_FILE_PERMISSION, - BVW_ERROR_FILE_ENCRYPTED, - BVW_ERROR_FILE_NOT_FOUND, - /* Devices */ - BVW_ERROR_DVD_ENCRYPTED, - BVW_ERROR_INVALID_DEVICE, - BVW_ERROR_DEVICE_BUSY, - /* Network */ - BVW_ERROR_UNKNOWN_HOST, - BVW_ERROR_NETWORK_UNREACHABLE, - BVW_ERROR_CONNECTION_REFUSED, - /* Generic */ - BVW_ERROR_INVALID_LOCATION, - BVW_ERROR_GENERIC, - BVW_ERROR_CODEC_NOT_HANDLED, - BVW_ERROR_AUDIO_ONLY, - BVW_ERROR_CANNOT_CAPTURE, - BVW_ERROR_READ_ERROR, - BVW_ERROR_PLUGIN_LOAD, - BVW_ERROR_EMPTY_FILE -} BvwError; - -GQuark bacon_video_widget_error_quark (void) G_GNUC_CONST; -GType bacon_video_widget_get_type (void); -GOptionGroup* bacon_video_widget_get_option_group (void); -/* This can be used if the app does not use popt */ -void bacon_video_widget_init_backend (int *argc, char ***argv); - -/** - * BvwUseType: - * @BVW_USE_TYPE_VIDEO: fully-featured with video, audio, capture and metadata support - * @BVW_USE_TYPE_AUDIO: audio and metadata support - * @BVW_USE_TYPE_CAPTURE: capture support only - * @BVW_USE_TYPE_METADATA: metadata support only - * - * The purpose for which a #BaconVideoWidget will be used, as specified to - * bacon_video_widget_new(). This determines which features will be enabled - * in the created widget. - **/ -typedef enum { - BVW_USE_TYPE_VIDEO, - BVW_USE_TYPE_AUDIO, - BVW_USE_TYPE_CAPTURE, - BVW_USE_TYPE_METADATA -} BvwUseType; - -GtkWidget *bacon_video_widget_new (int width, int height, - BvwUseType type, - GError **error); - -char *bacon_video_widget_get_backend_name (BaconVideoWidget *bvw); - -/* Actions */ -gboolean bacon_video_widget_open (BaconVideoWidget *bvw, - const char *mrl, - const char *subtitle_uri, - GError **error); -gboolean bacon_video_widget_play (BaconVideoWidget *bvw, - GError **error); -void bacon_video_widget_pause (BaconVideoWidget *bvw); -gboolean bacon_video_widget_is_playing (BaconVideoWidget *bvw); - -/* Seeking and length */ -gboolean bacon_video_widget_is_seekable (BaconVideoWidget *bvw); -gboolean bacon_video_widget_seek (BaconVideoWidget *bvw, - double position, - GError **error); -gboolean bacon_video_widget_seek_time (BaconVideoWidget *bvw, - gint64 _time, - GError **error); -gboolean bacon_video_widget_step (BaconVideoWidget *bvw, - gboolean forward, - GError **error); -gboolean bacon_video_widget_can_direct_seek (BaconVideoWidget *bvw); -double bacon_video_widget_get_position (BaconVideoWidget *bvw); -gint64 bacon_video_widget_get_current_time (BaconVideoWidget *bvw); -gint64 bacon_video_widget_get_stream_length (BaconVideoWidget *bvw); - -void bacon_video_widget_stop (BaconVideoWidget *bvw); -void bacon_video_widget_close (BaconVideoWidget *bvw); - -/* Audio volume */ -gboolean bacon_video_widget_can_set_volume (BaconVideoWidget *bvw); -void bacon_video_widget_set_volume (BaconVideoWidget *bvw, - double volume); -double bacon_video_widget_get_volume (BaconVideoWidget *bvw); - -/* Properties */ -void bacon_video_widget_set_logo (BaconVideoWidget *bvw, - const char *name); -void bacon_video_widget_set_logo_mode (BaconVideoWidget *bvw, - gboolean logo_mode); -gboolean bacon_video_widget_get_logo_mode (BaconVideoWidget *bvw); - -void bacon_video_widget_set_fullscreen (BaconVideoWidget *bvw, - gboolean fullscreen); - -void bacon_video_widget_set_show_cursor (BaconVideoWidget *bvw, - gboolean show_cursor); -gboolean bacon_video_widget_get_show_cursor (BaconVideoWidget *bvw); - -gboolean bacon_video_widget_get_auto_resize (BaconVideoWidget *bvw); -void bacon_video_widget_set_auto_resize (BaconVideoWidget *bvw, - gboolean auto_resize); - -void bacon_video_widget_set_connection_speed (BaconVideoWidget *bvw, - int speed); -int bacon_video_widget_get_connection_speed (BaconVideoWidget *bvw); - -gchar **bacon_video_widget_get_mrls (BaconVideoWidget *bvw, - TotemDiscMediaType type, - const char *device, - GError **error); -void bacon_video_widget_set_subtitle_font (BaconVideoWidget *bvw, - const char *font); -void bacon_video_widget_set_subtitle_encoding (BaconVideoWidget *bvw, - const char *encoding); - -void bacon_video_widget_set_user_agent (BaconVideoWidget *bvw, - const char *user_agent); - -void bacon_video_widget_set_referrer (BaconVideoWidget *bvw, - const char *referrer); - -/* Metadata */ -/** - * BvwMetadataType: - * @BVW_INFO_TITLE: the stream's title - * @BVW_INFO_ARTIST: the artist who created the work - * @BVW_INFO_YEAR: the year in which the work was created - * @BVW_INFO_COMMENT: a comment attached to the stream - * @BVW_INFO_ALBUM: the album in which the work was released - * @BVW_INFO_DURATION: the stream's duration, in seconds - * @BVW_INFO_TRACK_NUMBER: the track number of the work on the album - * @BVW_INFO_COVER: a #GdkPixbuf of the cover artwork - * @BVW_INFO_HAS_VIDEO: whether the stream has video - * @BVW_INFO_DIMENSION_X: the video's width, in pixels - * @BVW_INFO_DIMENSION_Y: the video's height, in pixels - * @BVW_INFO_VIDEO_BITRATE: the video's bitrate, in kilobits per second - * @BVW_INFO_VIDEO_CODEC: the video's codec - * @BVW_INFO_FPS: the number of frames per second in the video - * @BVW_INFO_HAS_AUDIO: whether the stream has audio - * @BVW_INFO_AUDIO_BITRATE: the audio's bitrate, in kilobits per second - * @BVW_INFO_AUDIO_CODEC: the audio's codec - * @BVW_INFO_AUDIO_SAMPLE_RATE: the audio sample rate, in bits per second - * @BVW_INFO_AUDIO_CHANNELS: a string describing the number of audio channels in the stream - * - * The different metadata available for querying from a #BaconVideoWidget - * stream with bacon_video_widget_get_metadata(). - **/ -typedef enum { - BVW_INFO_TITLE, - BVW_INFO_ARTIST, - BVW_INFO_YEAR, - BVW_INFO_COMMENT, - BVW_INFO_ALBUM, - BVW_INFO_DURATION, - BVW_INFO_TRACK_NUMBER, - BVW_INFO_COVER, - /* Video */ - BVW_INFO_HAS_VIDEO, - BVW_INFO_DIMENSION_X, - BVW_INFO_DIMENSION_Y, - BVW_INFO_VIDEO_BITRATE, - BVW_INFO_VIDEO_CODEC, - BVW_INFO_FPS, - /* Audio */ - BVW_INFO_HAS_AUDIO, - BVW_INFO_AUDIO_BITRATE, - BVW_INFO_AUDIO_CODEC, - BVW_INFO_AUDIO_SAMPLE_RATE, - BVW_INFO_AUDIO_CHANNELS -} BvwMetadataType; - -void bacon_video_widget_get_metadata (BaconVideoWidget *bvw, - BvwMetadataType type, - GValue *value); - -/* Visualisation functions */ -/** - * BvwVisualsQuality: - * @VISUAL_SMALL: small size (240×15) - * @VISUAL_NORMAL: normal size (320×25) - * @VISUAL_LARGE: large size (480×25) - * @VISUAL_EXTRA_LARGE: extra large size (600×30) - * @NUM_VISUAL_QUALITIES: the number of visual qualities available - * - * The different visualisation sizes or qualities available for use - * with bacon_video_widget_set_visuals_quality(). - **/ -typedef enum { - VISUAL_SMALL = 0, - VISUAL_NORMAL, - VISUAL_LARGE, - VISUAL_EXTRA_LARGE, - NUM_VISUAL_QUALITIES -} BvwVisualsQuality; - -void bacon_video_widget_set_show_visuals (BaconVideoWidget *bvw, - gboolean show_visuals); -GList *bacon_video_widget_get_visuals_list (BaconVideoWidget *bvw); -gboolean bacon_video_widget_set_visuals (BaconVideoWidget *bvw, - const char *name); -void bacon_video_widget_set_visuals_quality (BaconVideoWidget *bvw, - BvwVisualsQuality quality); - -/* Picture settings */ -/** - * BvwVideoProperty: - * @BVW_VIDEO_BRIGHTNESS: the video brightness - * @BVW_VIDEO_CONTRAST: the video contrast - * @BVW_VIDEO_SATURATION: the video saturation - * @BVW_VIDEO_HUE: the video hue - * - * The video properties queryable with bacon_video_widget_get_video_property(), - * and settable with bacon_video_widget_set_video_property(). - **/ -typedef enum { - BVW_VIDEO_BRIGHTNESS, - BVW_VIDEO_CONTRAST, - BVW_VIDEO_SATURATION, - BVW_VIDEO_HUE -} BvwVideoProperty; - -/** - * BvwAspectRatio: - * @BVW_RATIO_AUTO: automatic - * @BVW_RATIO_SQUARE: square (1:1) - * @BVW_RATIO_FOURBYTHREE: four-by-three (4:3) - * @BVW_RATIO_ANAMORPHIC: anamorphic (16:9) - * @BVW_RATIO_DVB: DVB (20:9) - * - * The pixel aspect ratios available in which to display videos using - * @bacon_video_widget_set_aspect_ratio(). - **/ -typedef enum { - BVW_RATIO_AUTO = 0, - BVW_RATIO_SQUARE = 1, - BVW_RATIO_FOURBYTHREE = 2, - BVW_RATIO_ANAMORPHIC = 3, - BVW_RATIO_DVB = 4 -} BvwAspectRatio; - -gboolean bacon_video_widget_can_deinterlace (BaconVideoWidget *bvw); -void bacon_video_widget_set_deinterlacing (BaconVideoWidget *bvw, - gboolean deinterlace); -gboolean bacon_video_widget_get_deinterlacing (BaconVideoWidget *bvw); - -void bacon_video_widget_set_aspect_ratio (BaconVideoWidget *bvw, - BvwAspectRatio ratio); -BvwAspectRatio bacon_video_widget_get_aspect_ratio - (BaconVideoWidget *bvw); - -void bacon_video_widget_set_scale_ratio (BaconVideoWidget *bvw, - float ratio); - -void bacon_video_widget_set_zoom (BaconVideoWidget *bvw, - double zoom); -double bacon_video_widget_get_zoom (BaconVideoWidget *bvw); - -int bacon_video_widget_get_video_property (BaconVideoWidget *bvw, - BvwVideoProperty type); -void bacon_video_widget_set_video_property (BaconVideoWidget *bvw, - BvwVideoProperty type, - int value); - -gboolean bacon_video_widget_has_menus (BaconVideoWidget *bvw); - -/* DVD functions */ -/** - * BvwDVDEvent: - * @BVW_DVD_ROOT_MENU: root menu - * @BVW_DVD_TITLE_MENU: title menu - * @BVW_DVD_SUBPICTURE_MENU: subpicture menu (if available) - * @BVW_DVD_AUDIO_MENU: audio menu (if available) - * @BVW_DVD_ANGLE_MENU: angle menu (if available) - * @BVW_DVD_CHAPTER_MENU: chapter menu - * @BVW_DVD_NEXT_CHAPTER: the next chapter - * @BVW_DVD_PREV_CHAPTER: the previous chapter - * @BVW_DVD_NEXT_TITLE: the next title in the current chapter - * @BVW_DVD_PREV_TITLE: the previous title in the current chapter - * @BVW_DVD_NEXT_ANGLE: the next angle - * @BVW_DVD_PREV_ANGLE: the previous angle - * @BVW_DVD_ROOT_MENU_UP: go up in the menu - * @BVW_DVD_ROOT_MENU_DOWN: go down in the menu - * @BVW_DVD_ROOT_MENU_LEFT: go left in the menu - * @BVW_DVD_ROOT_MENU_RIGHT: go right in the menu - * @BVW_DVD_ROOT_MENU_SELECT: select the current menu entry - * - * The DVD navigation actions available to fire as DVD events to - * the #BaconVideoWidget. - **/ -typedef enum { - BVW_DVD_ROOT_MENU, - BVW_DVD_TITLE_MENU, - BVW_DVD_SUBPICTURE_MENU, - BVW_DVD_AUDIO_MENU, - BVW_DVD_ANGLE_MENU, - BVW_DVD_CHAPTER_MENU, - BVW_DVD_NEXT_CHAPTER, - BVW_DVD_PREV_CHAPTER, - BVW_DVD_NEXT_TITLE, - BVW_DVD_PREV_TITLE, - BVW_DVD_NEXT_ANGLE, - BVW_DVD_PREV_ANGLE, - BVW_DVD_ROOT_MENU_UP, - BVW_DVD_ROOT_MENU_DOWN, - BVW_DVD_ROOT_MENU_LEFT, - BVW_DVD_ROOT_MENU_RIGHT, - BVW_DVD_ROOT_MENU_SELECT -} BvwDVDEvent; - -void bacon_video_widget_dvd_event (BaconVideoWidget *bvw, - BvwDVDEvent type); -GList *bacon_video_widget_get_languages (BaconVideoWidget *bvw); -int bacon_video_widget_get_language (BaconVideoWidget *bvw); -void bacon_video_widget_set_language (BaconVideoWidget *bvw, - int language); - -GList *bacon_video_widget_get_subtitles (BaconVideoWidget *bvw); -int bacon_video_widget_get_subtitle (BaconVideoWidget *bvw); -void bacon_video_widget_set_subtitle (BaconVideoWidget *bvw, - int subtitle); - -gboolean bacon_video_widget_has_next_track (BaconVideoWidget *bvw); -gboolean bacon_video_widget_has_previous_track (BaconVideoWidget *bvw); - -/* Screenshot functions */ -gboolean bacon_video_widget_can_get_frames (BaconVideoWidget *bvw, - GError **error); -GdkPixbuf *bacon_video_widget_get_current_frame (BaconVideoWidget *bvw); - -/* Audio-out functions */ -/** - * BvwAudioOutType: - * @BVW_AUDIO_SOUND_STEREO: stereo output - * @BVW_AUDIO_SOUND_4CHANNEL: 4-channel output - * @BVW_AUDIO_SOUND_41CHANNEL: 4.1-channel output - * @BVW_AUDIO_SOUND_5CHANNEL: 5-channel output - * @BVW_AUDIO_SOUND_51CHANNEL: 5.1-channel output - * @BVW_AUDIO_SOUND_AC3PASSTHRU: AC3 passthrough output - * - * The audio output types available for use with bacon_video_widget_set_audio_out_type(). - **/ -typedef enum { - BVW_AUDIO_SOUND_STEREO, - BVW_AUDIO_SOUND_4CHANNEL, - BVW_AUDIO_SOUND_41CHANNEL, - BVW_AUDIO_SOUND_5CHANNEL, - BVW_AUDIO_SOUND_51CHANNEL, - BVW_AUDIO_SOUND_AC3PASSTHRU -} BvwAudioOutType; - -BvwAudioOutType bacon_video_widget_get_audio_out_type - (BaconVideoWidget *bvw); -gboolean bacon_video_widget_set_audio_out_type (BaconVideoWidget *bvw, - BvwAudioOutType type); - -G_END_DECLS - -#endif /* HAVE_BACON_VIDEO_WIDGET_H */ diff --git a/totem-libzg/headers/totem-cell-renderer-video.h b/totem-libzg/headers/totem-cell-renderer-video.h deleted file mode 100644 index 355958f..0000000 --- a/totem-libzg/headers/totem-cell-renderer-video.h +++ /dev/null @@ -1,71 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* - * Copyright (C) 2001-2007 Philip Withnall <philip@tecnocode.co.uk> - * - * 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 Street, Fifth Floor, Boston, MA 02110-1301 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 <gtk/gtk.h> -#include <glib.h> - -#ifndef TOTEM_CELLRENDERERVIDEO_H -#define TOTEM_CELLRENDERERVIDEO_H - -G_BEGIN_DECLS - -#define TOTEM_TYPE_CELL_RENDERER_VIDEO (totem_cell_renderer_video_get_type ()) -#define TOTEM_CELL_RENDERER_VIDEO(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), TOTEM_TYPE_CELL_RENDERER_VIDEO, TotemCellRendererVideo)) -#define TOTEM_CELL_RENDERER_VIDEO_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), TOTEM_TYPE_CELL_RENDERER_VIDEO, TotemCellRendererVideoClass)) -#define TOTEM_IS_CELL_RENDERER_VIDEO(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), TOTEM_TYPE_CELL_RENDERER_VIDEO)) -#define TOTEM_IS_CELL_RENDERER_VIDEO_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), TOTEM_TYPE_CELL_RENDERER_VIDEO)) -#define TOTEM_CELL_RENDERER_VIDEO_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), TOTEM_TYPE_CELL_RENDERER_VIDEO, TotemCellRendererVideoClass)) - -typedef struct _TotemCellRendererVideoPrivate TotemCellRendererVideoPrivate; - -/** - * TotemCellRendererVideo: - * - * All the fields in the #TotemCellRendererVideo structure are private and should never be accessed directly. - **/ -typedef struct { - GtkCellRenderer parent; - TotemCellRendererVideoPrivate *priv; -} TotemCellRendererVideo; - -/** - * TotemCellRendererVideoClass: - * @parent: the parent class - * - * The class structure for the #TotemCellRendererVideo type. - **/ -typedef struct { - GtkCellRendererClass parent; -} TotemCellRendererVideoClass; - -GType totem_cell_renderer_video_get_type (void); -TotemCellRendererVideo *totem_cell_renderer_video_new (gboolean use_placeholder); - -G_END_DECLS - -#endif /* TOTEM_CELLRENDERERVIDEO_H */ diff --git a/totem-libzg/headers/totem-playlist.h b/totem-libzg/headers/totem-playlist.h deleted file mode 100644 index 0ec018b..0000000 --- a/totem-libzg/headers/totem-playlist.h +++ /dev/null @@ -1,153 +0,0 @@ -/* totem-playlist.h: Simple playlist dialog - - Copyright (C) 2002, 2003, 2004, 2005 Bastien Nocera <hadess@hadess.net> - - The Gnome Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The Gnome 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 - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the Gnome Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301 USA. - - Author: Bastien Nocera <hadess@hadess.net> - */ - -#ifndef TOTEM_PLAYLIST_H -#define TOTEM_PLAYLIST_H - -#include <gtk/gtk.h> -#include <totem-pl-parser.h> -#include <gio/gio.h> - -G_BEGIN_DECLS - -#define TOTEM_TYPE_PLAYLIST (totem_playlist_get_type ()) -#define TOTEM_PLAYLIST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TOTEM_TYPE_PLAYLIST, TotemPlaylist)) -#define TOTEM_PLAYLIST_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TOTEM_TYPE_PLAYLIST, TotemPlaylistClass)) -#define TOTEM_IS_PLAYLIST(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TOTEM_TYPE_PLAYLIST)) -#define TOTEM_IS_PLAYLIST_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TOTEM_TYPE_PLAYLIST)) - -typedef enum { - TOTEM_PLAYLIST_STATUS_NONE, - TOTEM_PLAYLIST_STATUS_PLAYING, - TOTEM_PLAYLIST_STATUS_PAUSED -} TotemPlaylistStatus; - -typedef enum { - TOTEM_PLAYLIST_DIRECTION_NEXT, - TOTEM_PLAYLIST_DIRECTION_PREVIOUS -} TotemPlaylistDirection; - -typedef enum { - TOTEM_PLAYLIST_DIALOG_SELECTED, - TOTEM_PLAYLIST_DIALOG_PLAYING -} TotemPlaylistSelectDialog; - - -typedef struct TotemPlaylist TotemPlaylist; -typedef struct TotemPlaylistClass TotemPlaylistClass; -typedef struct TotemPlaylistPrivate TotemPlaylistPrivate; - -typedef void (*TotemPlaylistForeachFunc) (TotemPlaylist *playlist, - const gchar *filename, - const gchar *uri, - gpointer user_data); - -struct TotemPlaylist { - GtkVBox parent; - TotemPlaylistPrivate *priv; -}; - -struct TotemPlaylistClass { - GtkVBoxClass parent_class; - - void (*changed) (TotemPlaylist *playlist); - void (*item_activated) (TotemPlaylist *playlist); - void (*active_name_changed) (TotemPlaylist *playlist); - void (*current_removed) (TotemPlaylist *playlist); - void (*repeat_toggled) (TotemPlaylist *playlist, gboolean repeat); - void (*shuffle_toggled) (TotemPlaylist *playlist, gboolean toggled); - void (*subtitle_changed) (TotemPlaylist *playlist); - void (*item_added) (TotemPlaylist *playlist, const gchar *filename, const gchar *uri); - void (*item_removed) (TotemPlaylist *playlist, const gchar *filename, const gchar *uri); -}; - -GType totem_playlist_get_type (void); -GtkWidget *totem_playlist_new (void); - -/* The application is responsible for checking that the mrl is correct - * @display_name is if you have a preferred display string for the mrl, - * NULL otherwise - */ -gboolean totem_playlist_add_mrl (TotemPlaylist *playlist, - const char *mrl, - const char *display_name); -gboolean totem_playlist_add_mrl_with_cursor (TotemPlaylist *playlist, - const char *mrl, - const char *display_name); - -void totem_playlist_save_current_playlist (TotemPlaylist *playlist, - const char *output); -void totem_playlist_save_current_playlist_ext (TotemPlaylist *playlist, - const char *output, TotemPlParserType type); -void totem_playlist_select_subtitle_dialog (TotemPlaylist *playlist, - TotemPlaylistSelectDialog mode); - -/* totem_playlist_clear doesn't emit the current_removed signal, even if it does - * because the caller should know what to do after it's done with clearing */ -gboolean totem_playlist_clear (TotemPlaylist *playlist); -void totem_playlist_clear_with_g_mount (TotemPlaylist *playlist, - GMount *mount); -char *totem_playlist_get_current_mrl (TotemPlaylist *playlist, - char **subtitle); -char *totem_playlist_get_current_title (TotemPlaylist *playlist, - gboolean *custom); -char *totem_playlist_get_title (TotemPlaylist *playlist, - guint title_index); - -gboolean totem_playlist_set_title (TotemPlaylist *playlist, - const char *title, - gboolean force); -void totem_playlist_set_current_subtitle (TotemPlaylist *playlist, - const char *subtitle_uri); - -#define totem_playlist_has_direction(playlist, direction) (direction == TOTEM_PLAYLIST_DIRECTION_NEXT ? totem_playlist_has_next_mrl (playlist) : totem_playlist_has_previous_mrl (playlist)) -gboolean totem_playlist_has_previous_mrl (TotemPlaylist *playlist); -gboolean totem_playlist_has_next_mrl (TotemPlaylist *playlist); - -#define totem_playlist_set_direction(playlist, direction) (direction == TOTEM_PLAYLIST_DIRECTION_NEXT ? totem_playlist_set_next (playlist) : totem_playlist_set_previous (playlist)) -void totem_playlist_set_previous (TotemPlaylist *playlist); -void totem_playlist_set_next (TotemPlaylist *playlist); - -gboolean totem_playlist_get_repeat (TotemPlaylist *playlist); -void totem_playlist_set_repeat (TotemPlaylist *playlist, gboolean repeat); - -gboolean totem_playlist_get_shuffle (TotemPlaylist *playlist); -void totem_playlist_set_shuffle (TotemPlaylist *playlist, - gboolean shuffle); - -gboolean totem_playlist_set_playing (TotemPlaylist *playlist, TotemPlaylistStatus state); -TotemPlaylistStatus totem_playlist_get_playing (TotemPlaylist *playlist); - -void totem_playlist_set_at_start (TotemPlaylist *playlist); -void totem_playlist_set_at_end (TotemPlaylist *playlist); - -int totem_playlist_get_current (TotemPlaylist *playlist); -int totem_playlist_get_last (TotemPlaylist *playlist); -void totem_playlist_set_current (TotemPlaylist *playlist, guint current_index); - -void totem_playlist_foreach (TotemPlaylist *playlist, - TotemPlaylistForeachFunc callback, - gpointer user_data); - -G_END_DECLS - -#endif /* TOTEM_PLAYLIST_H */ diff --git a/totem-libzg/headers/totem-plugin.h b/totem-libzg/headers/totem-plugin.h deleted file mode 100644 index 840213c..0000000 --- a/totem-libzg/headers/totem-plugin.h +++ /dev/null @@ -1,330 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- - * - * heavily based on code from Rhythmbox and Gedit - * - * Copyright (C) 2002-2005 Paolo Maggi - * Copyright (C) 2007 Bastien Nocera <hadess@hadess.net> - * - * 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. - * - * Sunday 13th May 2007: Bastien Nocera: Add exception clause. - * See license_change file for details. - * - */ - -#ifndef __TOTEM_PLUGIN_H__ -#define __TOTEM_PLUGIN_H__ - -#include <glib-object.h> -#include <gtk/gtk.h> - -#include "totem.h" - -G_BEGIN_DECLS - -/* - * Type checking and casting macros - */ -#define TOTEM_TYPE_PLUGIN (totem_plugin_get_type()) -#define TOTEM_PLUGIN(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), TOTEM_TYPE_PLUGIN, TotemPlugin)) -#define TOTEM_PLUGIN_CONST(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), TOTEM_TYPE_PLUGIN, TotemPlugin const)) -#define TOTEM_PLUGIN_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), TOTEM_TYPE_PLUGIN, TotemPluginClass)) -#define TOTEM_IS_PLUGIN(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), TOTEM_TYPE_PLUGIN)) -#define TOTEM_IS_PLUGIN_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TOTEM_TYPE_PLUGIN)) -#define TOTEM_PLUGIN_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), TOTEM_TYPE_PLUGIN, TotemPluginClass)) - -/** - * TotemPlugin: - * - * All the fields in the #TotemPlugin structure are private and should never be accessed directly. - **/ -typedef struct { - GObject parent; -} TotemPlugin; - -/** - * TotemPluginActivationFunc: - * @plugin: the #TotemPlugin - * @totem: a #TotemObject - * @error: a #GError - * - * Called when the user has requested @plugin be activated, this function should be used to initialise - * any resources the plugin needs, and attach itself to the Totem UI. - * - * If an error is encountered while setting up the plugin, @error should be set, and the function - * should return %FALSE. Totem will then not mark the plugin as activated, and will ensure it's not loaded - * again unless explicitly asked for by the user. - * - * Return value: %TRUE on success, %FALSE otherwise - **/ -typedef gboolean (*TotemPluginActivationFunc) (TotemPlugin *plugin, TotemObject *totem, - GError **error); - -/** - * TotemPluginDeactivationFunc: - * @plugin: the #TotemPlugin - * @totem: a #TotemObject - * - * Called when the user has requested @plugin be deactivated, this function should destroy all resources - * created during the plugin's lifetime, especially those created in the activation function. - * - * It should be possible to activate and deactivate the plugin multiple times sequentially in a single Totem - * session without memory or resource leaks, or errors. - **/ -typedef void (*TotemPluginDeactivationFunc) (TotemPlugin *plugin, TotemObject *totem); - -/** - * TotemPluginWidgetFunc: - * @plugin: the #TotemPlugin - * - * Called when the configuration dialogue for the plugin needs to be built, this function should return - * a complete window which will be shown by the Totem code. The widget needs to be capable of hiding itself - * when configuration is complete. - * - * If your plugin is not configurable, do not define this function. - * - * Return value: a #GtkWidget - **/ -typedef GtkWidget * (*TotemPluginWidgetFunc) (TotemPlugin *plugin); -typedef gboolean (*TotemPluginBooleanFunc) (TotemPlugin *plugin); - -/** - * TotemPluginClass: - * @parent_class: the parent class - * @activate: function called when activating a plugin using totem_plugin_activate(). - * It must be set by inheriting classes, and should return %TRUE if it successfully created/got handles to - * the resources needed by the plugin. If it returns %FALSE, loading the plugin is abandoned. - * @deactivate: function called when deactivating a plugin using totem_plugin_deactivate(); - * It must be set by inheriting classes, and should free/unref any resources the plugin used. - * @create_configure_dialog: function called when configuring a plugin using totem_plugin_create_configure_dialog(). - * If non-%NULL, it should create and return the plugin's configuration dialog. If %NULL, the plugin is not - * configurable. - * - * The class structure for the #TotemPlParser type. - **/ -typedef struct { - GObjectClass parent_class; - - /* Virtual public methods */ - - TotemPluginActivationFunc activate; - TotemPluginDeactivationFunc deactivate; - TotemPluginWidgetFunc create_configure_dialog; - - /*< private >*/ - /* Plugins should not override this, it's handled automatically by - the TotemPluginClass */ - TotemPluginBooleanFunc is_configurable; -} TotemPluginClass; - -/** - * TotemPluginError: - * @TOTEM_PLUGIN_ERROR_ACTIVATION: there was an error activating the plugin - * - * Error codes returned by #TotemPlugin operations. - **/ -typedef enum { - TOTEM_PLUGIN_ERROR_ACTIVATION -} TotemPluginError; - -typedef struct TotemPluginPrivate TotemPluginPrivate; - -GType totem_plugin_error_get_type (void); -GQuark totem_plugin_error_quark (void); -#define TOTEM_TYPE_PLUGIN_ERROR (totem_remote_command_get_type()) -#define TOTEM_PLUGIN_ERROR (totem_plugin_error_quark ()) - -/* - * Public methods - */ -GType totem_plugin_get_type (void) G_GNUC_CONST; - -gboolean totem_plugin_activate (TotemPlugin *plugin, - TotemObject *totem, - GError **error); -void totem_plugin_deactivate (TotemPlugin *plugin, - TotemObject *totem); - -gboolean totem_plugin_is_configurable (TotemPlugin *plugin); -GtkWidget *totem_plugin_create_configure_dialog - (TotemPlugin *plugin); - -char * totem_plugin_find_file (TotemPlugin *plugin, - const char *file); - -GtkBuilder * totem_plugin_load_interface (TotemPlugin *plugin, - const char *name, - gboolean fatal, - GtkWindow *parent, - gpointer user_data); - -GList * totem_get_plugin_paths (void); - -/** - * TOTEM_PLUGIN_REGISTER: - * @PluginName: the plugin's name in camelcase - * @plugin_name: the plugin's name in lowercase, with underscores - * - * Registers a new Totem plugin type. A plugin is, at its core, just a class which is - * instantiated and activated on the user's request. This macro registers that class. - **/ -#define TOTEM_PLUGIN_REGISTER(PluginName, plugin_name) \ - TOTEM_PLUGIN_REGISTER_EXTENDED(PluginName, plugin_name, {}) - -/** - * TOTEM_PLUGIN_REGISTER_EXTENDED: - * @PluginName: the plugin's name in camelcase - * @plugin_name: the plugin's name in lowercase, with underscores - * @_C_: extra code to call in the module type registration function - * - * Registers a new Totem plugin type with custom code in the module type registration - * function. See TOTEM_PLUGIN_REGISTER() for more information about the registration - * process. - * - * A variable named @our_info is available with the module's #GTypeInfo information. - * @plugin_module_type is the plugin's #GTypeModule. - * @<replaceable>plugin_name</replaceable>_type is the plugin's newly-registered #GType - * (where <replaceable>plugin_name</replaceable> is the plugin name passed to the - * TOTEM_PLUGIN_REGISTER_EXTENDED() macro). - **/ -#define TOTEM_PLUGIN_REGISTER_EXTENDED(PluginName, plugin_name, _C_) \ - _TOTEM_PLUGIN_REGISTER_EXTENDED_BEGIN (PluginName, plugin_name) {_C_;} _TOTEM_PLUGIN_REGISTER_EXTENDED_END(plugin_name) - -#define _TOTEM_PLUGIN_REGISTER_EXTENDED_BEGIN(PluginName, plugin_name) \ - \ -static GType plugin_name##_type = 0; \ -static GTypeModule *plugin_module_type = NULL; \ - \ -GType \ -plugin_name##_get_type (void) \ -{ \ - return plugin_name##_type; \ -} \ - \ -static void plugin_name##_init (PluginName *self); \ -static void plugin_name##_class_init (PluginName##Class *klass); \ -static gpointer plugin_name##_parent_class = NULL; \ -static void plugin_name##_class_intern_init (gpointer klass) \ -{ \ - plugin_name##_parent_class = g_type_class_peek_parent (klass); \ - plugin_name##_class_init ((PluginName##Class *) klass); \ -} \ - \ -G_MODULE_EXPORT GType \ -register_totem_plugin (GTypeModule *module) \ -{ \ - const GTypeInfo our_info = \ - { \ - sizeof (PluginName##Class), \ - NULL, /* base_init */ \ - NULL, /* base_finalize */ \ - (GClassInitFunc) plugin_name##_class_intern_init, \ - NULL, \ - NULL, /* class_data */ \ - sizeof (PluginName), \ - 0, /* n_preallocs */ \ - (GInstanceInitFunc) plugin_name##_init, \ - NULL \ - }; \ - \ - /* Initialise the i18n stuff */ \ - bindtextdomain (GETTEXT_PACKAGE, GNOMELOCALEDIR); \ - bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); \ - \ - plugin_module_type = module; \ - plugin_name##_type = g_type_module_register_type (module, \ - TOTEM_TYPE_PLUGIN, \ - #PluginName, \ - &our_info, \ - 0); \ - { /* custom code follows */ - -#define _TOTEM_PLUGIN_REGISTER_EXTENDED_END(plugin_name) \ - /* following custom code */ \ - } \ - return plugin_name##_type; \ -} - -/** - * TOTEM_PLUGIN_REGISTER_TYPE: - * @type_name: the type's name in lowercase, with underscores - * - * Calls the type registration function for a type inside a plugin module previously - * defined with TOTEM_PLUGIN_DEFINE_TYPE(). - **/ -#define TOTEM_PLUGIN_REGISTER_TYPE(type_name) \ - type_name##_register_type (plugin_module_type) - -/** - * TOTEM_PLUGIN_DEFINE_TYPE: - * @TypeName: the type name in camelcase - * @type_name: the type name in lowercase, with underscores - * @TYPE_PARENT: the type's parent name in uppercase, with underscores - * - * Registers a type to be used inside a Totem plugin, but not the plugin's itself; - * use TOTEM_PLUGIN_REGISTER() for that. - **/ -#define TOTEM_PLUGIN_DEFINE_TYPE(TypeName, type_name, TYPE_PARENT) \ -static void type_name##_init (TypeName *self); \ -static void type_name##_class_init (TypeName##Class *klass); \ -static gpointer type_name##_parent_class = ((void *)0); \ -static GType type_name##_type_id = 0; \ - \ -static void \ -type_name##_class_intern_init (gpointer klass) \ -{ \ - type_name##_parent_class = g_type_class_peek_parent (klass); \ - type_name##_class_init ((TypeName##Class*) klass); \ -} \ - \ - \ -GType \ -type_name##_get_type (void) \ -{ \ - g_assert (type_name##_type_id != 0); \ - \ - return type_name##_type_id; \ -} \ - \ -GType \ -type_name##_register_type (GTypeModule *module) \ -{ \ - \ - const GTypeInfo g_define_type_info = { \ - sizeof (TypeName##Class), \ - (GBaseInitFunc) ((void *)0), \ - (GBaseFinalizeFunc) ((void *)0), \ - (GClassInitFunc) type_name##_class_intern_init, \ - (GClassFinalizeFunc) ((void *)0), \ - ((void *)0), \ - sizeof (TypeName), \ - 0, \ - (GInstanceInitFunc) type_name##_init, \ - ((void *)0) \ - }; \ - type_name##_type_id = \ - g_type_module_register_type (module, \ - TYPE_PARENT, \ - #TypeName, \ - &g_define_type_info, \ - (GTypeFlags) 0); \ - \ - return type_name##_type_id; \ -} - -G_END_DECLS - -#endif /* __TOTEM_PLUGIN_H__ */ diff --git a/totem-libzg/headers/totem-video-list.h b/totem-libzg/headers/totem-video-list.h deleted file mode 100644 index 7468edc..0000000 --- a/totem-libzg/headers/totem-video-list.h +++ /dev/null @@ -1,75 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* - * Copyright (C) 2001-2007 Philip Withnall <philip@tecnocode.co.uk> - * - * 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 Street, Fifth Floor, Boston, MA 02110-1301 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 <gtk/gtk.h> -#include <glib.h> - -#ifndef TOTEM_VIDEOLIST_H -#define TOTEM_VIDEOLIST_H - -G_BEGIN_DECLS - -#define TOTEM_TYPE_VIDEO_LIST (totem_video_list_get_type ()) -#define TOTEM_VIDEO_LIST(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), TOTEM_TYPE_VIDEO_LIST, TotemVideoList)) -#define TOTEM_VIDEO_LIST_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), TOTEM_TYPE_VIDEO_LIST, TotemVideoListClass)) -#define TOTEM_IS_VIDEO_LIST(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), TOTEM_TYPE_VIDEO_LIST)) -#define TOTEM_IS_VIDEO_LIST_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), TOTEM_TYPE_VIDEO_LIST)) -#define TOTEM_VIDEO_LIST_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), TOTEM_TYPE_VIDEO_LIST, TotemVideoListClass)) - -typedef struct _TotemVideoListPrivate TotemVideoListPrivate; - -/** - * TotemVideoList: - * - * All the fields in the #TotemVideoList structure are private and should never be accessed directly. - **/ -typedef struct { - GtkTreeView parent; - TotemVideoListPrivate *priv; -} TotemVideoList; - -/** - * TotemVideoListClass: - * @parent: the parent class - * @starting_video: the generic signal handler for the #TotemVideoList::starting-video signal, - * which can be overridden by inheriting classes - * - * The class structure for the #TotemVideoList type. - **/ -typedef struct { - GtkTreeViewClass parent; - gboolean (*starting_video) (TotemVideoList *video_list, GtkTreePath *path); -} TotemVideoListClass; - -GType totem_video_list_get_type (void); -TotemVideoList *totem_video_list_new (void); -GtkUIManager *totem_video_list_get_ui_manager (TotemVideoList *self); - -G_END_DECLS - -#endif /* TOTEM_VIDEOLIST_H */ diff --git a/totem-libzg/headers/totem.h b/totem-libzg/headers/totem.h deleted file mode 100644 index 3548588..0000000 --- a/totem-libzg/headers/totem.h +++ /dev/null @@ -1,284 +0,0 @@ -/* - * Copyright (C) 2001,2002,2003,2004,2005 Bastien Nocera <hadess@hadess.net> - * - * 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 Street, Fifth Floor, Boston, MA 02110-1301 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_H__ -#define __TOTEM_H__ - -#include <glib-object.h> -#include <gtk/gtk.h> -#include <totem-disc.h> -#include "totem-playlist.h" - -/** - * TOTEM_GCONF_PREFIX: - * - * The GConf prefix under which all Totem GConf keys are stored. - **/ -#define TOTEM_GCONF_PREFIX "/apps/totem" - -G_BEGIN_DECLS - -/** - * TotemRemoteCommand: - * @TOTEM_REMOTE_COMMAND_UNKNOWN: unknown command - * @TOTEM_REMOTE_COMMAND_PLAY: play the current stream - * @TOTEM_REMOTE_COMMAND_PAUSE: pause the current stream - * @TOTEM_REMOTE_COMMAND_STOP: stop playing the current stream - * @TOTEM_REMOTE_COMMAND_PLAYPAUSE: toggle play/pause on the current stream - * @TOTEM_REMOTE_COMMAND_NEXT: play the next playlist item - * @TOTEM_REMOTE_COMMAND_PREVIOUS: play the previous playlist item - * @TOTEM_REMOTE_COMMAND_SEEK_FORWARD: seek forwards in the current stream - * @TOTEM_REMOTE_COMMAND_SEEK_BACKWARD: seek backwards in the current stream - * @TOTEM_REMOTE_COMMAND_VOLUME_UP: increase the volume - * @TOTEM_REMOTE_COMMAND_VOLUME_DOWN: decrease the volume - * @TOTEM_REMOTE_COMMAND_FULLSCREEN: toggle fullscreen mode - * @TOTEM_REMOTE_COMMAND_QUIT: quit the instance of Totem - * @TOTEM_REMOTE_COMMAND_ENQUEUE: enqueue a new playlist item - * @TOTEM_REMOTE_COMMAND_REPLACE: replace an item in the playlist - * @TOTEM_REMOTE_COMMAND_SHOW: show the Totem instance - * @TOTEM_REMOTE_COMMAND_TOGGLE_CONTROLS: toggle the control visibility - * @TOTEM_REMOTE_COMMAND_UP: go up (DVD controls) - * @TOTEM_REMOTE_COMMAND_DOWN: go down (DVD controls) - * @TOTEM_REMOTE_COMMAND_LEFT: go left (DVD controls) - * @TOTEM_REMOTE_COMMAND_RIGHT: go right (DVD controls) - * @TOTEM_REMOTE_COMMAND_SELECT: select the current item (DVD controls) - * @TOTEM_REMOTE_COMMAND_DVD_MENU: go to the DVD menu - * @TOTEM_REMOTE_COMMAND_ZOOM_UP: increase the zoom level - * @TOTEM_REMOTE_COMMAND_ZOOM_DOWN: decrease the zoom level - * @TOTEM_REMOTE_COMMAND_EJECT: eject the current disc - * @TOTEM_REMOTE_COMMAND_PLAY_DVD: play a DVD in a drive - * @TOTEM_REMOTE_COMMAND_MUTE: toggle mute - * @TOTEM_REMOTE_COMMAND_TOGGLE_ASPECT: toggle the aspect ratio - * - * Represents a command which can be sent to a running Totem instance remotely. - **/ -typedef enum { - TOTEM_REMOTE_COMMAND_UNKNOWN = 0, - TOTEM_REMOTE_COMMAND_PLAY, - TOTEM_REMOTE_COMMAND_PAUSE, - TOTEM_REMOTE_COMMAND_STOP, - TOTEM_REMOTE_COMMAND_PLAYPAUSE, - TOTEM_REMOTE_COMMAND_NEXT, - TOTEM_REMOTE_COMMAND_PREVIOUS, - TOTEM_REMOTE_COMMAND_SEEK_FORWARD, - TOTEM_REMOTE_COMMAND_SEEK_BACKWARD, - TOTEM_REMOTE_COMMAND_VOLUME_UP, - TOTEM_REMOTE_COMMAND_VOLUME_DOWN, - TOTEM_REMOTE_COMMAND_FULLSCREEN, - TOTEM_REMOTE_COMMAND_QUIT, - TOTEM_REMOTE_COMMAND_ENQUEUE, - TOTEM_REMOTE_COMMAND_REPLACE, - TOTEM_REMOTE_COMMAND_SHOW, - TOTEM_REMOTE_COMMAND_TOGGLE_CONTROLS, - TOTEM_REMOTE_COMMAND_UP, - TOTEM_REMOTE_COMMAND_DOWN, - TOTEM_REMOTE_COMMAND_LEFT, - TOTEM_REMOTE_COMMAND_RIGHT, - TOTEM_REMOTE_COMMAND_SELECT, - TOTEM_REMOTE_COMMAND_DVD_MENU, - TOTEM_REMOTE_COMMAND_ZOOM_UP, - TOTEM_REMOTE_COMMAND_ZOOM_DOWN, - TOTEM_REMOTE_COMMAND_EJECT, - TOTEM_REMOTE_COMMAND_PLAY_DVD, - TOTEM_REMOTE_COMMAND_MUTE, - TOTEM_REMOTE_COMMAND_TOGGLE_ASPECT -} TotemRemoteCommand; - -/** - * TotemRemoteSetting: - * @TOTEM_REMOTE_SETTING_SHUFFLE: whether shuffle is enabled - * @TOTEM_REMOTE_SETTING_REPEAT: whether repeat is enabled - * - * Represents a boolean setting or preference on a remote Totem instance. - **/ -typedef enum { - TOTEM_REMOTE_SETTING_SHUFFLE, - TOTEM_REMOTE_SETTING_REPEAT -} TotemRemoteSetting; - -GType totem_remote_command_get_type (void); -GQuark totem_remote_command_quark (void); -#define TOTEM_TYPE_REMOTE_COMMAND (totem_remote_command_get_type()) -#define TOTEM_REMOTE_COMMAND totem_remote_command_quark () - -GType totem_remote_setting_get_type (void); -GQuark totem_remote_setting_quark (void); -#define TOTEM_TYPE_REMOTE_SETTING (totem_remote_setting_get_type()) -#define TOTEM_REMOTE_SETTING totem_remote_setting_quark () - -GType totem_disc_media_type_get_type (void); -GQuark totem_disc_media_type_quark (void); -#define TOTEM_TYPE_DISC_MEDIA_TYPE (totem_disc_media_type_get_type()) -#define TOTEM_DISC_MEDIA_TYPE totem_disc_media_type_quark () - -#define TOTEM_TYPE_OBJECT (totem_object_get_type ()) -#define TOTEM_OBJECT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), totem_object_get_type (), TotemObject)) -#define TOTEM_OBJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), totem_object_get_type (), TotemObjectClass)) -#define TOTEM_IS_OBJECT(obj) (G_TYPE_CHECK_INSTANCE_TYPE (obj, totem_object_get_type ())) -#define TOTEM_IS_OBJECT_CLASS(klass) (G_CHECK_INSTANCE_GET_CLASS ((klass), totem_object_get_type ())) - -/** - * Totem: - * - * The #Totem object is a handy synonym for #TotemObject, and the two can be used interchangably. - **/ - -/** - * TotemObject: - * - * All the fields in the #TotemObject structure are private and should never be accessed directly. - **/ -typedef struct _TotemObject Totem; -typedef struct _TotemObject TotemObject; - -/** - * TotemObjectClass: - * @parent_class: the parent class - * @file_opened: the generic signal handler for the #TotemObject::file-opened signal, - * which can be overridden by inheriting classes - * @file_closed: the generic signal handler for the #TotemObject::file-closed signal, - * which can be overridden by inheriting classes - * @metadata_updated: the generic signal handler for the #TotemObject::metadata-updated signal, - * which can be overridden by inheriting classes - * - * The class structure for the #TotemPlParser type. - **/ -typedef struct { - GObjectClass parent_class; - - void (*file_opened) (Totem *totem, const char *mrl); - void (*file_closed) (Totem *totem); - void (*metadata_updated) (Totem *totem, - const char *artist, - const char *title, - const char *album, - guint track_num); -} TotemObjectClass; - -GType totem_object_get_type (void); -void totem_object_plugins_init (TotemObject *totem); -void totem_object_plugins_shutdown (void); -void totem_file_opened (TotemObject *totem, - const char *mrl); -void totem_file_closed (TotemObject *totem); -void totem_metadata_updated (TotemObject *totem, - const char *artist, - const char *title, - const char *album, - guint track_num); - -void totem_action_exit (Totem *totem) G_GNUC_NORETURN; -void totem_action_play (Totem *totem); -void totem_action_stop (Totem *totem); -void totem_action_play_pause (Totem *totem); -void totem_action_pause (Totem *totem); -void totem_action_fullscreen_toggle (Totem *totem); -void totem_action_fullscreen (Totem *totem, gboolean state); -void totem_action_next (Totem *totem); -void totem_action_previous (Totem *totem); -void totem_action_seek_time (Totem *totem, gint64 sec); -void totem_action_seek_relative (Totem *totem, gint64 offset); -double totem_get_volume (Totem *totem); -void totem_action_volume (Totem *totem, double volume); -void totem_action_volume_relative (Totem *totem, double off_pct); -void totem_action_volume_toggle_mute (Totem *totem); -gboolean totem_action_set_mrl (Totem *totem, - const char *mrl, - const char *subtitle); -void totem_action_set_mrl_and_play (Totem *totem, - const char *mrl, - const char *subtitle); - -gboolean totem_action_set_mrl_with_warning (Totem *totem, - const char *mrl, - const char *subtitle, - gboolean warn); - -void totem_action_play_media (Totem *totem, - TotemDiscMediaType type, - const char *device); - -void totem_action_toggle_aspect_ratio (Totem *totem); -void totem_action_set_aspect_ratio (Totem *totem, int ratio); -int totem_action_get_aspect_ratio (Totem *totem); -void totem_action_toggle_controls (Totem *totem); -void totem_action_next_angle (Totem *totem); - -void totem_action_set_scale_ratio (Totem *totem, gfloat ratio); -void totem_action_error (const char *title, - const char *reason, - Totem *totem); -void totem_action_play_media_device (Totem *totem, - const char *device); - -gboolean totem_is_fullscreen (Totem *totem); -gboolean totem_is_playing (Totem *totem); -gboolean totem_is_paused (Totem *totem); -gboolean totem_is_seekable (Totem *totem); -GtkWindow *totem_get_main_window (Totem *totem); -GtkUIManager *totem_get_ui_manager (Totem *totem); -GtkWidget *totem_get_video_widget (Totem *totem); -char *totem_get_video_widget_backend_name (Totem *totem); -char *totem_get_version (void); - -/* Current media information */ -char * totem_get_short_title (Totem *totem); -gint64 totem_get_current_time (Totem *totem); - -/* Playlist handling */ -guint totem_get_playlist_length (Totem *totem); -void totem_action_set_playlist_index (Totem *totem, - guint index); -int totem_get_playlist_pos (Totem *totem); -char * totem_get_title_at_playlist_pos (Totem *totem, - guint playlist_index); -void totem_add_to_playlist_and_play (Totem *totem, - const char *uri, - const char *display_name, - gboolean add_to_recent); -char * totem_get_current_mrl (Totem *totem); -void totem_set_current_subtitle (Totem *totem, - const char *subtitle_uri); -/* Sidebar handling */ -void totem_add_sidebar_page (Totem *totem, - const char *page_id, - const char *title, - GtkWidget *main_widget); -void totem_remove_sidebar_page (Totem *totem, - const char *page_id); - -/* Remote actions */ -void totem_action_remote (Totem *totem, - TotemRemoteCommand cmd, - const char *url); -void totem_action_remote_set_setting (Totem *totem, - TotemRemoteSetting setting, - gboolean value); -gboolean totem_action_remote_get_setting (Totem *totem, - TotemRemoteSetting setting); - -#endif /* __TOTEM_H__ */ diff --git a/totem-libzg/libtotem_zeitgeist_plugin_la_vala.stamp b/totem-libzg/libtotem_zeitgeist_plugin_la_vala.stamp deleted file mode 100644 index e69de29..0000000 --- a/totem-libzg/libtotem_zeitgeist_plugin_la_vala.stamp +++ /dev/null diff --git a/totem-libzg/totem-zeitgeist-plugin.c b/totem-libzg/totem-zeitgeist-plugin.c deleted file mode 100644 index 411ef90..0000000 --- a/totem-libzg/totem-zeitgeist-plugin.c +++ /dev/null @@ -1,608 +0,0 @@ -/* totem-zeitgeist-plugin.c generated by valac 0.12.0, the Vala compiler - * generated from totem-zeitgeist-plugin.vala, do not modify */ - - -#include <glib.h> -#include <glib-object.h> -#include <stdlib.h> -#include <string.h> -#include <totem-plugin.h> -#include <zeitgeist.h> -#include <totem.h> -#include <bacon-video-widget.h> -#include <gio/gio.h> - - -#define TYPE_MEDIA_INFO (media_info_get_type ()) -typedef struct _MediaInfo MediaInfo; -#define _g_free0(var) (var = (g_free (var), NULL)) - -#define TYPE_ZEITGEIST_PLUGIN (zeitgeist_plugin_get_type ()) -#define ZEITGEIST_PLUGIN(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_ZEITGEIST_PLUGIN, ZeitgeistPlugin)) -#define ZEITGEIST_PLUGIN_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_ZEITGEIST_PLUGIN, ZeitgeistPluginClass)) -#define IS_ZEITGEIST_PLUGIN(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_ZEITGEIST_PLUGIN)) -#define IS_ZEITGEIST_PLUGIN_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_ZEITGEIST_PLUGIN)) -#define ZEITGEIST_PLUGIN_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_ZEITGEIST_PLUGIN, ZeitgeistPluginClass)) - -typedef struct _ZeitgeistPlugin ZeitgeistPlugin; -typedef struct _ZeitgeistPluginClass ZeitgeistPluginClass; -typedef struct _ZeitgeistPluginPrivate ZeitgeistPluginPrivate; -#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL))) -#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL))) - -struct _MediaInfo { - gint64 timestamp; - gboolean sent_access; - gchar* mrl; - gchar* mimetype; - gchar* title; - gchar* interpretation; - gchar* artist; - gchar* album; -}; - -struct _ZeitgeistPlugin { - TotemPlugin parent_instance; - ZeitgeistPluginPrivate * priv; -}; - -struct _ZeitgeistPluginClass { - TotemPluginClass parent_class; -}; - -struct _ZeitgeistPluginPrivate { - MediaInfo current_media; - guint media_info_timeout; - guint timeout_id; - gulong* signals; - gint signals_length1; - gint _signals_size_; - ZeitgeistLog* zg_log; - TotemObject* totem_object; -}; - - -static gpointer zeitgeist_plugin_parent_class = NULL; -static GType zeitgeist_plugin_type_id = 0; - -GType media_info_get_type (void) G_GNUC_CONST; -MediaInfo* media_info_dup (const MediaInfo* self); -void media_info_free (MediaInfo* self); -void media_info_copy (const MediaInfo* self, MediaInfo* dest); -void media_info_destroy (MediaInfo* self); -GType zeitgeist_plugin_get_type (void) G_GNUC_CONST; -GType zeitgeist_plugin_register_type (GTypeModule * module); -#define ZEITGEIST_PLUGIN_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TYPE_ZEITGEIST_PLUGIN, ZeitgeistPluginPrivate)) -enum { - ZEITGEIST_PLUGIN_DUMMY_PROPERTY -}; -static gboolean zeitgeist_plugin_real_activate (TotemPlugin* base, TotemObject* totem, GError** error); -static void zeitgeist_plugin_file_opened (ZeitgeistPlugin* self, const gchar* mrl, TotemObject* totem); -static void _vala_array_add1 (gulong** array, int* length, int* size, gulong value); -static void zeitgeist_plugin_file_closed (ZeitgeistPlugin* self, TotemObject* totem); -static void _vala_array_add2 (gulong** array, int* length, int* size, gulong value); -static void zeitgeist_plugin_metadata_changed (ZeitgeistPlugin* self, const gchar* artist, const gchar* title, const gchar* album, guint track_num, TotemObject* totem); -static void _vala_array_add3 (gulong** array, int* length, int* size, gulong value); -static void zeitgeist_plugin_playing_changed (ZeitgeistPlugin* self); -static void _vala_array_add4 (gulong** array, int* length, int* size, gulong value); -static void zeitgeist_plugin_real_deactivate (TotemPlugin* base, TotemObject* totem); -static void zeitgeist_plugin_restart_watcher (ZeitgeistPlugin* self, guint interval); -static gboolean zeitgeist_plugin_timeout_cb (ZeitgeistPlugin* self); -static gboolean _zeitgeist_plugin_timeout_cb_gsource_func (gpointer self); -static gboolean zeitgeist_plugin_wait_for_media_info (ZeitgeistPlugin* self); -static gboolean _zeitgeist_plugin_wait_for_media_info_gsource_func (gpointer self); -static void zeitgeist_plugin_send_event_to_zg (ZeitgeistPlugin* self, gboolean leave_event); -ZeitgeistPlugin* zeitgeist_plugin_new (void); -ZeitgeistPlugin* zeitgeist_plugin_construct (GType object_type); -static void zeitgeist_plugin_finalize (GObject* obj); -GType register_totem_plugin (GTypeModule* module); - - -void media_info_copy (const MediaInfo* self, MediaInfo* dest) { - dest->timestamp = self->timestamp; - dest->sent_access = self->sent_access; - dest->mrl = g_strdup (self->mrl); - dest->mimetype = g_strdup (self->mimetype); - dest->title = g_strdup (self->title); - dest->interpretation = g_strdup (self->interpretation); - dest->artist = g_strdup (self->artist); - dest->album = g_strdup (self->album); -} - - -void media_info_destroy (MediaInfo* self) { - _g_free0 ((*self).mrl); - _g_free0 ((*self).mimetype); - _g_free0 ((*self).title); - _g_free0 ((*self).interpretation); - _g_free0 ((*self).artist); - _g_free0 ((*self).album); -} - - -MediaInfo* media_info_dup (const MediaInfo* self) { - MediaInfo* dup; - dup = g_new0 (MediaInfo, 1); - media_info_copy (self, dup); - return dup; -} - - -void media_info_free (MediaInfo* self) { - media_info_destroy (self); - g_free (self); -} - - -GType media_info_get_type (void) { - static volatile gsize media_info_type_id__volatile = 0; - if (g_once_init_enter (&media_info_type_id__volatile)) { - GType media_info_type_id; - media_info_type_id = g_boxed_type_register_static ("MediaInfo", (GBoxedCopyFunc) media_info_dup, (GBoxedFreeFunc) media_info_free); - g_once_init_leave (&media_info_type_id__volatile, media_info_type_id); - } - return media_info_type_id__volatile; -} - - -static void _vala_array_add1 (gulong** array, int* length, int* size, gulong value) { - if ((*length) == (*size)) { - *size = (*size) ? (2 * (*size)) : 4; - *array = g_renew (gulong, *array, *size); - } - (*array)[(*length)++] = value; -} - - -static void _vala_array_add2 (gulong** array, int* length, int* size, gulong value) { - if ((*length) == (*size)) { - *size = (*size) ? (2 * (*size)) : 4; - *array = g_renew (gulong, *array, *size); - } - (*array)[(*length)++] = value; -} - - -static void _vala_array_add3 (gulong** array, int* length, int* size, gulong value) { - if ((*length) == (*size)) { - *size = (*size) ? (2 * (*size)) : 4; - *array = g_renew (gulong, *array, *size); - } - (*array)[(*length)++] = value; -} - - -static void _vala_array_add4 (gulong** array, int* length, int* size, gulong value) { - if ((*length) == (*size)) { - *size = (*size) ? (2 * (*size)) : 4; - *array = g_renew (gulong, *array, *size); - } - (*array)[(*length)++] = value; -} - - -static gboolean zeitgeist_plugin_real_activate (TotemPlugin* base, TotemObject* totem, GError** error) { - ZeitgeistPlugin * self; - gboolean result = FALSE; - ZeitgeistLog* _tmp0_ = NULL; - MediaInfo _tmp1_ = {0}; - MediaInfo _tmp2_ = {0}; - gulong _tmp3_; - gulong _tmp4_; - gulong _tmp5_; - gulong _tmp6_; - self = (ZeitgeistPlugin*) base; - g_return_val_if_fail (totem != NULL, FALSE); - _tmp0_ = zeitgeist_log_new (); - _g_object_unref0 (self->priv->zg_log); - self->priv->zg_log = _tmp0_; - self->priv->totem_object = totem; - memset (&_tmp1_, 0, sizeof (MediaInfo)); - _tmp2_ = _tmp1_; - media_info_destroy (&self->priv->current_media); - self->priv->current_media = _tmp2_; - _tmp3_ = g_signal_connect_swapped (totem, "file-opened", (GCallback) zeitgeist_plugin_file_opened, self); - _vala_array_add1 (&self->priv->signals, &self->priv->signals_length1, &self->priv->_signals_size_, _tmp3_); - _tmp4_ = g_signal_connect_swapped (totem, "file-closed", (GCallback) zeitgeist_plugin_file_closed, self); - _vala_array_add2 (&self->priv->signals, &self->priv->signals_length1, &self->priv->_signals_size_, _tmp4_); - _tmp5_ = g_signal_connect_swapped (totem, "metadata-updated", (GCallback) zeitgeist_plugin_metadata_changed, self); - _vala_array_add3 (&self->priv->signals, &self->priv->signals_length1, &self->priv->_signals_size_, _tmp5_); - _tmp6_ = g_signal_connect_swapped (totem, "notify::playing", (GCallback) zeitgeist_plugin_playing_changed, self); - _vala_array_add4 (&self->priv->signals, &self->priv->signals_length1, &self->priv->_signals_size_, _tmp6_); - result = TRUE; - return result; -} - - -static void zeitgeist_plugin_real_deactivate (TotemPlugin* base, TotemObject* totem) { - ZeitgeistPlugin * self; - self = (ZeitgeistPlugin*) base; - g_return_if_fail (totem != NULL); - zeitgeist_plugin_file_closed (self, totem); - self->priv->totem_object = NULL; - { - gulong* id_collection; - int id_collection_length1; - int id_it; - id_collection = self->priv->signals; - id_collection_length1 = self->priv->signals_length1; - for (id_it = 0; id_it < self->priv->signals_length1; id_it = id_it + 1) { - gulong id; - id = id_collection[id_it]; - { - g_signal_handler_disconnect (totem, id); - } - } - } - self->priv->signals = (g_free (self->priv->signals), NULL); - self->priv->signals = NULL; - self->priv->signals_length1 = 0; - self->priv->_signals_size_ = 0; - if (self->priv->media_info_timeout != 0) { - g_source_remove (self->priv->media_info_timeout); - } - if (self->priv->timeout_id != 0) { - g_source_remove (self->priv->timeout_id); - } - self->priv->media_info_timeout = (guint) 0; - self->priv->timeout_id = (guint) 0; -} - - -static gboolean _zeitgeist_plugin_timeout_cb_gsource_func (gpointer self) { - gboolean result; - result = zeitgeist_plugin_timeout_cb (self); - return result; -} - - -static void zeitgeist_plugin_restart_watcher (ZeitgeistPlugin* self, guint interval) { - guint _tmp0_; - g_return_if_fail (self != NULL); - if (self->priv->timeout_id != 0) { - g_source_remove (self->priv->timeout_id); - } - _tmp0_ = g_timeout_add_full (G_PRIORITY_DEFAULT, interval, _zeitgeist_plugin_timeout_cb_gsource_func, g_object_ref (self), g_object_unref); - self->priv->timeout_id = _tmp0_; -} - - -static gboolean _zeitgeist_plugin_wait_for_media_info_gsource_func (gpointer self) { - gboolean result; - result = zeitgeist_plugin_wait_for_media_info (self); - return result; -} - - -static void zeitgeist_plugin_file_opened (ZeitgeistPlugin* self, const gchar* mrl, TotemObject* totem) { - MediaInfo _tmp0_ = {0}; - MediaInfo _tmp1_ = {0}; - gchar* _tmp2_; - GTimeVal cur_time = {0}; - gint64 _tmp3_; - g_return_if_fail (self != NULL); - g_return_if_fail (mrl != NULL); - g_return_if_fail (totem != NULL); - if (self->priv->current_media.mrl != NULL) { - zeitgeist_plugin_file_closed (self, totem); - } - memset (&_tmp0_, 0, sizeof (MediaInfo)); - _tmp1_ = _tmp0_; - media_info_destroy (&self->priv->current_media); - self->priv->current_media = _tmp1_; - _tmp2_ = g_strdup (mrl); - _g_free0 (self->priv->current_media.mrl); - self->priv->current_media.mrl = _tmp2_; - g_get_current_time (&cur_time); - _tmp3_ = zeitgeist_timestamp_from_timeval (&cur_time); - self->priv->current_media.timestamp = _tmp3_; - if (self->priv->media_info_timeout == 0) { - guint _tmp4_; - _tmp4_ = g_timeout_add_full (G_PRIORITY_DEFAULT, (guint) 250, _zeitgeist_plugin_wait_for_media_info_gsource_func, g_object_ref (self), g_object_unref); - self->priv->media_info_timeout = _tmp4_; - zeitgeist_plugin_restart_watcher (self, (guint) 15000); - } else { - g_warning ("totem-zeitgeist-plugin.vala:85: already had timeout!"); - } -} - - -static void zeitgeist_plugin_file_closed (ZeitgeistPlugin* self, TotemObject* totem) { - gboolean _tmp0_ = FALSE; - g_return_if_fail (self != NULL); - g_return_if_fail (totem != NULL); - if (self->priv->current_media.sent_access) { - _tmp0_ = self->priv->current_media.mrl != NULL; - } else { - _tmp0_ = FALSE; - } - if (_tmp0_) { - GTimeVal cur_time = {0}; - gint64 _tmp1_; - g_get_current_time (&cur_time); - _tmp1_ = zeitgeist_timestamp_from_timeval (&cur_time); - self->priv->current_media.timestamp = _tmp1_; - zeitgeist_plugin_send_event_to_zg (self, TRUE); - _g_free0 (self->priv->current_media.mrl); - self->priv->current_media.mrl = NULL; - } - if (self->priv->media_info_timeout != 0) { - g_source_remove (self->priv->media_info_timeout); - } - self->priv->media_info_timeout = (guint) 0; - if (self->priv->timeout_id != 0) { - g_source_remove (self->priv->timeout_id); - } - self->priv->timeout_id = (guint) 0; -} - - -static void zeitgeist_plugin_metadata_changed (ZeitgeistPlugin* self, const gchar* artist, const gchar* title, const gchar* album, guint track_num, TotemObject* totem) { - g_return_if_fail (self != NULL); - g_return_if_fail (totem != NULL); - if (self->priv->media_info_timeout != 0) { - gchar* _tmp0_; - gchar* _tmp1_; - gchar* _tmp2_; - _tmp0_ = g_strdup (artist); - _g_free0 (self->priv->current_media.artist); - self->priv->current_media.artist = _tmp0_; - _tmp1_ = g_strdup (title); - _g_free0 (self->priv->current_media.title); - self->priv->current_media.title = _tmp1_; - _tmp2_ = g_strdup (album); - _g_free0 (self->priv->current_media.album); - self->priv->current_media.album = _tmp2_; - } -} - - -static gboolean zeitgeist_plugin_timeout_cb (ZeitgeistPlugin* self) { - gboolean result = FALSE; - g_return_val_if_fail (self != NULL, FALSE); - if (self->priv->media_info_timeout != 0) { - gchar* _tmp0_ = NULL; - g_source_remove (self->priv->media_info_timeout); - self->priv->media_info_timeout = (guint) 0; - _tmp0_ = totem_get_short_title (self->priv->totem_object); - _g_free0 (self->priv->current_media.title); - self->priv->current_media.title = _tmp0_; - self->priv->timeout_id = (guint) 0; - zeitgeist_plugin_wait_for_media_info (self); - } - self->priv->timeout_id = (guint) 0; - result = FALSE; - return result; -} - - -static gboolean zeitgeist_plugin_wait_for_media_info (ZeitgeistPlugin* self) { - gboolean result = FALSE; - gboolean _tmp0_ = FALSE; - GError * _inner_error_ = NULL; - g_return_val_if_fail (self != NULL, FALSE); - if (self->priv->current_media.title != NULL) { - gboolean _tmp1_; - _tmp1_ = totem_is_playing (self->priv->totem_object); - _tmp0_ = _tmp1_; - } else { - _tmp0_ = FALSE; - } - if (_tmp0_) { - GValue val = {0}; - GtkWidget* _tmp2_ = NULL; - GtkWidget* _tmp3_; - BaconVideoWidget* video; - GValue _tmp4_ = {0}; - const gchar* _tmp5_ = NULL; - gboolean _tmp6_; - gchar* _tmp7_; - GFile* _tmp8_ = NULL; - GFile* f; - gboolean _tmp9_; - _tmp2_ = totem_get_video_widget (self->priv->totem_object); - _tmp3_ = _tmp2_; - video = BACON_IS_VIDEO_WIDGET (_tmp3_) ? ((BaconVideoWidget*) _tmp3_) : NULL; - bacon_video_widget_get_metadata (video, BVW_INFO_HAS_VIDEO, &_tmp4_); - G_IS_VALUE (&val) ? (g_value_unset (&val), NULL) : NULL; - val = _tmp4_; - _tmp6_ = g_value_get_boolean (&val); - if (_tmp6_) { - _tmp5_ = ZEITGEIST_NFO_VIDEO; - } else { - _tmp5_ = ZEITGEIST_NFO_AUDIO; - } - _tmp7_ = g_strdup (_tmp5_); - _g_free0 (self->priv->current_media.interpretation); - self->priv->current_media.interpretation = _tmp7_; - _tmp8_ = g_file_new_for_uri (self->priv->current_media.mrl); - f = _tmp8_; - _tmp9_ = g_file_query_exists (f, NULL); - if (_tmp9_) { - GFileInfo* _tmp10_ = NULL; - GFileInfo* fi; - const gchar* _tmp11_ = NULL; - gchar* _tmp12_; - _tmp10_ = g_file_query_info (f, G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE, 0, NULL, &_inner_error_); - fi = _tmp10_; - if (_inner_error_ != NULL) { - goto __catch0_g_error; - } - _tmp11_ = g_file_info_get_content_type (fi); - _tmp12_ = g_strdup (_tmp11_); - _g_free0 (self->priv->current_media.mimetype); - self->priv->current_media.mimetype = _tmp12_; - _g_object_unref0 (fi); - goto __finally0; - __catch0_g_error: - { - GError * err; - err = _inner_error_; - _inner_error_ = NULL; - g_warning ("totem-zeitgeist-plugin.vala:146: %s", err->message); - _g_error_free0 (err); - } - __finally0: - if (_inner_error_ != NULL) { - _g_object_unref0 (f); - _g_object_unref0 (video); - G_IS_VALUE (&val) ? (g_value_unset (&val), NULL) : NULL; - g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code); - g_clear_error (&_inner_error_); - return FALSE; - } - } - zeitgeist_plugin_send_event_to_zg (self, FALSE); - self->priv->current_media.sent_access = TRUE; - if (self->priv->timeout_id != 0) { - g_source_remove (self->priv->timeout_id); - } - self->priv->timeout_id = (guint) 0; - self->priv->media_info_timeout = (guint) 0; - result = FALSE; - _g_object_unref0 (f); - _g_object_unref0 (video); - G_IS_VALUE (&val) ? (g_value_unset (&val), NULL) : NULL; - return result; - } - result = TRUE; - return result; -} - - -static void zeitgeist_plugin_playing_changed (ZeitgeistPlugin* self) { - gboolean _tmp0_ = FALSE; - gboolean _tmp1_ = FALSE; - gboolean _tmp2_; - g_return_if_fail (self != NULL); - if (self->priv->media_info_timeout == 0) { - _tmp0_ = self->priv->current_media.sent_access == FALSE; - } else { - _tmp0_ = FALSE; - } - if (_tmp0_) { - zeitgeist_plugin_wait_for_media_info (self); - } - _tmp2_ = totem_is_playing (self->priv->totem_object); - if (!_tmp2_) { - _tmp1_ = self->priv->current_media.sent_access; - } else { - _tmp1_ = FALSE; - } - if (_tmp1_) { - zeitgeist_plugin_file_closed (self, self->priv->totem_object); - } -} - - -static void zeitgeist_plugin_send_event_to_zg (ZeitgeistPlugin* self, gboolean leave_event) { - gboolean _tmp0_ = FALSE; - g_return_if_fail (self != NULL); - if (self->priv->current_media.mrl != NULL) { - _tmp0_ = self->priv->current_media.title != NULL; - } else { - _tmp0_ = FALSE; - } - if (_tmp0_) { - const gchar* _tmp1_ = NULL; - gchar* _tmp2_; - gchar* event_interpretation; - gchar* _tmp3_; - gchar* origin; - const gchar* _tmp4_ = NULL; - const gchar* substr; - ZeitgeistSubject* _tmp6_ = NULL; - ZeitgeistSubject* subject; - ZeitgeistEvent* _tmp7_ = NULL; - ZeitgeistEvent* event; - if (leave_event) { - _tmp1_ = ZEITGEIST_ZG_LEAVE_EVENT; - } else { - _tmp1_ = ZEITGEIST_ZG_ACCESS_EVENT; - } - _tmp2_ = g_strdup (_tmp1_); - event_interpretation = _tmp2_; - _tmp3_ = g_strdup (""); - origin = _tmp3_; - _tmp4_ = g_utf8_strrchr (self->priv->current_media.mrl, (gssize) (-1), (gunichar) '/'); - substr = _tmp4_; - if (substr != NULL) { - gsize n; - gchar* _tmp5_ = NULL; - n = ((gchar*) substr) - ((gchar*) self->priv->current_media.mrl); - _tmp5_ = g_strndup (self->priv->current_media.mrl, n); - _g_free0 (origin); - origin = _tmp5_; - } - _tmp6_ = zeitgeist_subject_new_full (self->priv->current_media.mrl, self->priv->current_media.interpretation, ZEITGEIST_NFO_FILE_DATA_OBJECT, self->priv->current_media.mimetype, origin, self->priv->current_media.title, ""); - subject = g_object_ref_sink (_tmp6_); - _tmp7_ = zeitgeist_event_new_full (event_interpretation, ZEITGEIST_ZG_USER_ACTIVITY, "application://totem.desktop", subject, NULL, NULL); - event = g_object_ref_sink (_tmp7_); - zeitgeist_event_set_timestamp (event, self->priv->current_media.timestamp); - zeitgeist_log_insert_events_no_reply (self->priv->zg_log, event, NULL, NULL); - _g_object_unref0 (event); - _g_object_unref0 (subject); - _g_free0 (origin); - _g_free0 (event_interpretation); - } -} - - -ZeitgeistPlugin* zeitgeist_plugin_construct (GType object_type) { - ZeitgeistPlugin * self = NULL; - self = (ZeitgeistPlugin*) g_object_new (object_type, NULL); - return self; -} - - -ZeitgeistPlugin* zeitgeist_plugin_new (void) { - return zeitgeist_plugin_construct (TYPE_ZEITGEIST_PLUGIN); -} - - -static void zeitgeist_plugin_class_init (ZeitgeistPluginClass * klass) { - zeitgeist_plugin_parent_class = g_type_class_peek_parent (klass); - g_type_class_add_private (klass, sizeof (ZeitgeistPluginPrivate)); - TOTEM_PLUGIN_CLASS (klass)->activate = zeitgeist_plugin_real_activate; - TOTEM_PLUGIN_CLASS (klass)->deactivate = zeitgeist_plugin_real_deactivate; - G_OBJECT_CLASS (klass)->finalize = zeitgeist_plugin_finalize; -} - - -static void zeitgeist_plugin_instance_init (ZeitgeistPlugin * self) { - self->priv = ZEITGEIST_PLUGIN_GET_PRIVATE (self); -} - - -static void zeitgeist_plugin_finalize (GObject* obj) { - ZeitgeistPlugin * self; - self = ZEITGEIST_PLUGIN (obj); - media_info_destroy (&self->priv->current_media); - self->priv->signals = (g_free (self->priv->signals), NULL); - _g_object_unref0 (self->priv->zg_log); - G_OBJECT_CLASS (zeitgeist_plugin_parent_class)->finalize (obj); -} - - -GType zeitgeist_plugin_get_type (void) { - return zeitgeist_plugin_type_id; -} - - -GType zeitgeist_plugin_register_type (GTypeModule * module) { - static const GTypeInfo g_define_type_info = { sizeof (ZeitgeistPluginClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) zeitgeist_plugin_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ZeitgeistPlugin), 0, (GInstanceInitFunc) zeitgeist_plugin_instance_init, NULL }; - zeitgeist_plugin_type_id = g_type_module_register_type (module, TOTEM_TYPE_PLUGIN, "ZeitgeistPlugin", &g_define_type_info, 0); - return zeitgeist_plugin_type_id; -} - - -GType register_totem_plugin (GTypeModule* module) { - GType result = 0UL; - g_return_val_if_fail (module != NULL, 0UL); - zeitgeist_plugin_register_type (module); - result = TYPE_ZEITGEIST_PLUGIN; - return result; -} - - - diff --git a/totem-libzg/totem-zeitgeist-plugin.vala b/totem-libzg/totem-zeitgeist-plugin.vala deleted file mode 100644 index b246532..0000000 --- a/totem-libzg/totem-zeitgeist-plugin.vala +++ /dev/null @@ -1,216 +0,0 @@ -using Totem; - -struct MediaInfo { - int64 timestamp; - bool sent_access; - string? mrl; - string? mimetype; - string? title; - string? interpretation; - string? artist; - string? album; -} - -class ZeitgeistPlugin: Totem.Plugin { - private MediaInfo current_media; - // timer waiting while we get some info about current playing media - private uint media_info_timeout; - // timer making sure we don't wait indefinitely - private uint timeout_id; - private ulong[] signals; - - private Zeitgeist.Log zg_log; - private unowned Totem.Object totem_object; - - public override bool activate (Totem.Object totem) throws GLib.Error { - zg_log = new Zeitgeist.Log (); - totem_object = totem; - current_media = MediaInfo (); - - signals += Signal.connect_swapped (totem, "file-opened", - (Callback) file_opened, this); - signals += Signal.connect_swapped (totem, "file-closed", - (Callback)file_closed, this); - signals += Signal.connect_swapped (totem, "metadata-updated", - (Callback) metadata_changed, this); - signals += Signal.connect_swapped (totem, "notify::playing", - (Callback) playing_changed, this); - return true; - } - - public override void deactivate (Totem.Object totem) { - // we don't always get file-closed, so lets simulate it - file_closed (totem); - - totem_object = null; - - foreach (ulong id in signals) { - SignalHandler.disconnect (totem, id); - } - signals = null; - - // cleanup timers - if (media_info_timeout != 0) Source.remove (media_info_timeout); - if (timeout_id != 0) Source.remove (timeout_id); - - media_info_timeout = 0; - timeout_id = 0; - } - - private void restart_watcher (uint interval) { - if (timeout_id != 0) { - Source.remove (timeout_id); - } - timeout_id = Timeout.add (interval, timeout_cb); - } - - private void file_opened (string mrl, Totem.Object totem) { - if (current_media.mrl != null) { - // we don't always get file-closed, so lets simulate it - file_closed (totem); - } - - current_media = MediaInfo (); - current_media.mrl = mrl; - - TimeVal cur_time = TimeVal (); - current_media.timestamp = Zeitgeist.Timestamp.from_timeval (cur_time); - - // wait a bit for the media info - if (media_info_timeout == 0) { - media_info_timeout = Timeout.add (250, wait_for_media_info); - // but make sure we dont wait indefinitely - restart_watcher (15000); - } else { - warning ("already had timeout!"); - } - } - - private void file_closed (Totem.Object totem) { - if (current_media.sent_access && current_media.mrl != null) { - // send close event - TimeVal cur_time = TimeVal (); - current_media.timestamp = Zeitgeist.Timestamp.from_timeval (cur_time); - send_event_to_zg (true); - - current_media.mrl = null; - } - - // kill timers - if (media_info_timeout != 0) Source.remove (media_info_timeout); - media_info_timeout = 0; - if (timeout_id != 0) Source.remove (timeout_id); - timeout_id = 0; - } - - private void metadata_changed (string? artist, string? title, string? album, - uint track_num, Totem.Object totem) { - // we can get some notification after sending event to ZG, so ignore it - if (media_info_timeout != 0) { - current_media.artist = artist; - current_media.title = title; - current_media.album = album; - } - } - - private bool timeout_cb () { - if (media_info_timeout != 0) { - // we don't have any info besides the url, so use the short_title - - Source.remove (media_info_timeout); - media_info_timeout = 0; - - current_media.title = totem_object.get_short_title (); - timeout_id = 0; - wait_for_media_info (); - } - - timeout_id = 0; - return false; - } - - private bool wait_for_media_info () { - if (current_media.title != null && totem_object.is_playing ()) { - Value val; - var video = totem_object.get_video_widget () as Bacon.VideoWidget; - video.get_metadata (Bacon.MetadataType.HAS_VIDEO, out val); - current_media.interpretation = val.get_boolean () ? - Zeitgeist.NFO_VIDEO : Zeitgeist.NFO_AUDIO; - - var f = File.new_for_uri (current_media.mrl); - if (f.query_exists (null)) { - try { - var fi = f.query_info (FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE, 0, null); - current_media.mimetype = fi.get_content_type (); - } catch (GLib.Error err) { - warning ("%s", err.message); - } - } - - // send event - send_event_to_zg (); - current_media.sent_access = true; - - // cleanup timers - if (timeout_id != 0) Source.remove (timeout_id); - timeout_id = 0; - media_info_timeout = 0; - return false; - } - // wait longer - return true; - } - - private void playing_changed () { - if (media_info_timeout == 0 && current_media.sent_access == false) { - wait_for_media_info (); - } - - // end of playlist - if (!totem_object.is_playing () && current_media.sent_access) { - // FIXME: sends leave event even if the user just pauses - // the playback for a little while - file_closed (totem_object); - } - } - - private void send_event_to_zg (bool leave_event = false) { - if (current_media.mrl != null && current_media.title != null) { - string event_interpretation = leave_event ? - Zeitgeist.ZG_LEAVE_EVENT : Zeitgeist.ZG_ACCESS_EVENT; - /* - debug ("About to send %s event to ZG for: %s [%s] (%s)", - leave_event ? "LEAVE" : "ACCESS", - current_media.mrl, - current_media.title, - current_media.mimetype); - */ - string origin = ""; - unowned string substr = current_media.mrl.rchr (-1, '/'); - if (substr != null) { - size_t n = (char*)substr - (char*)current_media.mrl; - origin = current_media.mrl.ndup (n); - } - var subject = new Zeitgeist.Subject.full (current_media.mrl, - current_media.interpretation, - Zeitgeist.NFO_FILE_DATA_OBJECT, - current_media.mimetype, - origin, - current_media.title, - ""); - var event = new Zeitgeist.Event.full (event_interpretation, - Zeitgeist.ZG_USER_ACTIVITY, - "application://totem.desktop", - subject, null); - event.set_timestamp (current_media.timestamp); - zg_log.insert_events_no_reply (event, null); - } - } -} - -[ModuleInit] -public GLib.Type register_totem_plugin (GLib.TypeModule module) -{ - return typeof (ZeitgeistPlugin); -} - diff --git a/totem-libzg/vapi/bacon-video.vapi b/totem-libzg/vapi/bacon-video.vapi deleted file mode 100644 index 1612a7d..0000000 --- a/totem-libzg/vapi/bacon-video.vapi +++ /dev/null @@ -1,40 +0,0 @@ -[CCode (cprefix = "Bacon", lower_case_cprefix = "bacon_")] - -namespace Bacon { - [CCode (cheader_filename = "bacon-video-widget.h")] - public class VideoWidget : Gtk.EventBox { - [CCode (has_construct_function = false)] - public VideoWidget (int width, int height, UseType type) throws GLib.Error; - - public void get_metadata (MetadataType type, out GLib.Value val); - } - [CCode (cprefix = "BVW_USE_TYPE_", cheader_filename = "bacon-video-widget.h")] - public enum UseType { - VIDEO, - AUDIO, - CAPTURE, - METADATA - } - [CCode (cprefix = "BVW_INFO_", cheader_filename = "bacon-video-widget.h")] - public enum MetadataType { - TITLE, - ARTIST, - YEAR, - COMMENT, - ALBUM, - DURATION, - TRACK_NUMBER, - COVER, - HAS_VIDEO, - DIMENSION_X, - DIMENSION_Y, - VIDEO_BITRATE, - VIDEO_CODEC, - FPS, - HAS_AUDIO, - AUDIO_BITRATE, - AUDIO_CODEC, - AUDIO_SAMPLE_RATE, - AUDIO_CHANNELS - } -} diff --git a/totem-libzg/vapi/totem.deps b/totem-libzg/vapi/totem.deps deleted file mode 100644 index 24a2237..0000000 --- a/totem-libzg/vapi/totem.deps +++ /dev/null @@ -1 +0,0 @@ -gtk+-2.0 diff --git a/totem-libzg/vapi/totem.vapi b/totem-libzg/vapi/totem.vapi deleted file mode 100644 index e144219..0000000 --- a/totem-libzg/vapi/totem.vapi +++ /dev/null @@ -1,127 +0,0 @@ -[CCode (cprefix = "Totem", lower_case_cprefix = "totem_")] - -namespace Totem { - [CCode (cheader_filename = "totem.h")] - public class Object : GLib.Object { - [CCode (cname = "totem_object_get_type")] - public static GLib.Type get_type (); - - [CCode (cname = "totem_file_opened")] - public void file_opened (string mrl); - [CCode (cname = "totem_file_closed")] - public void file_closed (); - [CCode (cname = "totem_metadata_updated")] - public void metadata_updated (string artist, string title, string album, uint track_num); - - [CCode (cname = "totem_action_error", instance_pos = 3)] - public void action_error (string title, string reason); - - [CCode (cname = "totem_add_to_playlist_and_play")] - public void add_to_playlist_and_play (string uri, string display_name, bool add_to_recent); - [CCode (cname = "totem_action_exit")] - public void action_exit (); - [CCode (cname = "totem_action_play")] - public void action_play (); - [CCode (cname = "totem_action_stop")] - public void action_stop (); - [CCode (cname = "totem_action_play_pause")] - public void action_play_pause (); - [CCode (cname = "totem_action_pause")] - public void action_pause (); - [CCode (cname = "totem_action_next")] - public void action_next (); - [CCode (cname = "totem_action_previous")] - public void action_previous (); - [CCode (cname = "totem_action_seek_time")] - public void action_seek_time (int64 sec); - [CCode (cname = "totem_action_seek_relative")] - public void action_seek_relative (int64 offset); - - [CCode (cname = "totem_get_volume")] - public double get_volume (); - [CCode (cname = "totem_action_volume")] - public void action_volume (double volume); - [CCode (cname = "totem_action_volume_relative")] - public void action_volume_relative (double off_pct); - [CCode (cname = "totem_action_volume_toggle_mute")] - public void action_volume_toggle_mute (); - - [CCode (cname = "totem_action_fullscreen_toggle")] - public void action_fullscreen_toggle (); - [CCode (cname = "totem_action_fullscreen")] - public void action_fullscreen (bool state); - - [CCode (cname = "totem_is_fullscreen")] - public bool is_fullscreen (); - [CCode (cname = "totem_is_playing")] - public bool is_playing (); - [CCode (cname = "totem_is_paused")] - public bool is_paused (); - [CCode (cname = "totem_is_seekable")] - public bool is_seekable (); - - [CCode (cname = "totem_get_main_window")] - public Gtk.Window get_main_window (); - [CCode (cname = "totem_get_ui_manager")] - public Gtk.UIManager get_ui_manager (); - [CCode (cname = "totem_get_video_widget")] - public Gtk.Widget get_video_widget (); - - /* Current media information */ - [CCode (cname = "totem_get_short_title")] - public string get_short_title (); - [CCode (cname = "totem_get_current_time")] - public int64 get_current_time (); - - /* Sidebar handling */ - [CCode (cname = "totem_add_sidebar_page")] - public void add_sidebar_page (string page_id, string title, Gtk.Widget main_widget); - [CCode (cname = "totem_remove_sidebar_page")] - public void remove_sidebar_page (string page_id); - } - - [CCode (cheader_filename = "totem-cell-renderer-video.h")] - public class CellRendererVideo : Gtk.CellRenderer { - [CCode (cname = "totem_cell_renderer_video_get_type")] - public static GLib.Type get_type (); - [CCode (cname = "totem_cell_renderer_video_new")] - public CellRendererVideo (bool use_placeholder); - } - - [CCode (cheader_filename = "totem-video-list.h")] - public class VideoList : Gtk.TreeView { - [CCode (cname = "totem_video_list_get_type")] - public static GLib.Type get_type (); - [CCode (cname = "totem_video_list_new")] - [CCode (has_construct_function = false)] - public VideoList (); - [CCode (cname = "totem_video_list_get_ui_manager")] - public Gtk.UIManager get_ui_manager (); - - public virtual signal bool starting_video (Gtk.TreePath path); - } - - [CCode (cheader_filename = "totem-plugin.h")] - public abstract class Plugin : GLib.Object { - [CCode (has_construct_function = false)] - protected Plugin (); - - [CCode (cname = "totem_plugin_get_type")] - public static GLib.Type get_type (); - - [CCode (cname = "totem_plugin_activate")] - public abstract bool activate (Totem.Object totem) throws GLib.Error; - [CCode (cname = "totem_plugin_deactivate")] - public abstract void deactivate (Totem.Object totem); - - [CCode (cname = "totem_plugin_is_configurable")] - public virtual bool is_configurable (); - [CCode (cname = "totem_plugin_create_configure_dialog")] - public virtual Gtk.Widget create_configure_dialog (); - [CCode (cname = "totem_plugin_load_interface")] - public Gtk.Builder load_interface (string name, bool fatal, Gtk.Window parent, void* user_data = null); - - [CCode (cname = "totem_plugin_find_file")] - public virtual unowned string find_file (string file); - } -} diff --git a/totem-libzg/zeitgeist.totem-plugin b/totem-libzg/zeitgeist.totem-plugin deleted file mode 100644 index 771ab46..0000000 --- a/totem-libzg/zeitgeist.totem-plugin +++ /dev/null @@ -1,8 +0,0 @@ -[Totem Plugin] -Module=totem-zeitgeist-plugin -IAge=1 -Name=Zeitgeist Plugin -Description=A plugin sending events to Zeitgeist -Authors=Michal Hruby <michal.mhr@gmail.com> -Copyright=Copyright © 2010 Michal Hruby -Website=http://www.gnome.org/projects/totem/ |