~wongchiachen/ubuntu/precise/totem/hey_about_dialog

« back to all changes in this revision

Viewing changes to src/plugins/thumbnail/totem-thumbnail.c

  • Committer: Bazaar Package Importer
  • Author(s): Sebastien Bacher
  • Date: 2011-05-20 16:38:02 UTC
  • mfrom: (1.11.13 upstream) (2.1.17 experimental)
  • Revision ID: james.westby@ubuntu.com-20110520163802-p3lohdmfvws2jqeo
Tags: 3.0.1-0ubuntu1
* Resynchronize on Debian, remaining diffs:
* debian/control.in:
  - use suggests rather than recommends for universe gstreamer components
  - add totem-plugins-extra for the components which have depends in universe
  - add build-depends on gnome-common, dh-autoreconf, 
    liblaunchpad-intrgration-3.0-dev, hardening-wrapper
  - drop build-depends on libepc-ui-dev, python-feedparser, xulrunner-dev,
    libtracker-sparql-0.10-dev
  - add XB-Npp-Description and XB-Npp-Filename header to the 
    totem-mozilla package to improve ubufox/ubuntu plugin db integration 
  - change refences from Iceweasel to Firefox
  - recommends gnome-icon-theme-symbolic rather than depending on it
  - list firefox as a totem-mozilla recommends before epiphany-browser
  - libtotem replaces totem (<< 3.0.1-1) for ppa upgrades
* debian/totem-common.install:
  - Install apport hook
* debian/totem-plugins-extra.install:
  - Plugins split out ouf totem-plugins
* debian/totem-plugins.install:    
  - Move some plugins to totem-plugins-extra
* debian/totem.preinst:
  - No longer required as Lucid has been released
* debian/patches/01_fake_keypresses.patch:
  - dropped it's an old workaround and should not be required
* debian/patches/02_lpi.patch:
  - Launchpad integration
* debian/patches/03_default_options.patch: 
  - enable the youtube option by default
* debian/patches/70_bbc_plugin.patch:
  - bbc content viewer, needs to be fixed for the new version
* debian/source_totem.py:
  - ubuntu apport debugging
* debian/rules:
  - run autoreconf on build
* debian/watch:
  - Watch for unstable versions

Show diffs side-by-side

added added

removed removed

Lines of Context:
30
30
#include <glib.h>
31
31
#include <glib-object.h>
32
32
#include <glib/gi18n-lib.h>
 
33
#include <libpeas/peas-activatable.h>
 
34
#include <libpeas/peas-extension-base.h>
 
35
#include <libpeas/peas-object-module.h>
33
36
#include <gmodule.h>
34
37
#include <string.h>
35
38
 
51
54
        TotemObject *totem;
52
55
} TotemThumbnailPluginPrivate;
53
56
 
54
 
typedef struct
55
 
{
56
 
        TotemPlugin parent;
57
 
        TotemThumbnailPluginPrivate *priv;
58
 
} TotemThumbnailPlugin;
59
 
 
60
 
typedef struct
61
 
{
62
 
        TotemPluginClass parent_class;
63
 
} TotemThumbnailPluginClass;
64
 
 
65
 
G_MODULE_EXPORT GType register_totem_plugin     (GTypeModule *module);
66
 
GType totem_thumbnail_plugin_get_type           (void) G_GNUC_CONST;
67
 
 
68
 
static gboolean impl_activate                   (TotemPlugin *plugin, TotemObject *totem, GError **error);
69
 
static void impl_deactivate                     (TotemPlugin *plugin, TotemObject *totem);
70
 
 
71
 
TOTEM_PLUGIN_REGISTER (TotemThumbnailPlugin, totem_thumbnail_plugin)
72
 
 
73
 
static void
74
 
totem_thumbnail_plugin_class_init (TotemThumbnailPluginClass *klass)
75
 
{
76
 
        TotemPluginClass *plugin_class = TOTEM_PLUGIN_CLASS (klass);
77
 
 
78
 
        g_type_class_add_private (klass, sizeof (TotemThumbnailPluginPrivate));
79
 
 
80
 
        plugin_class->activate = impl_activate;
81
 
        plugin_class->deactivate = impl_deactivate;
82
 
}
83
 
 
84
 
static void
85
 
totem_thumbnail_plugin_init (TotemThumbnailPlugin *plugin)
86
 
{
87
 
        plugin->priv = G_TYPE_INSTANCE_GET_PRIVATE (plugin,
88
 
                                                    TOTEM_TYPE_THUMBNAIL_PLUGIN,
89
 
                                                    TotemThumbnailPluginPrivate);
90
 
}
 
57
TOTEM_PLUGIN_REGISTER(TOTEM_TYPE_THUMBNAIL_PLUGIN, TotemThumbnailPlugin, totem_thumbnail_plugin)
91
58
 
92
59
static void
93
60
set_icon_to_default (TotemObject *totem)
174
141
        update_from_state (pi->priv, totem, NULL);
175
142
}
176
143
 
177
 
static gboolean
178
 
impl_activate (TotemPlugin *plugin,
179
 
               TotemObject *totem,
180
 
               GError **error)
 
144
static void
 
145
impl_activate (PeasActivatable *plugin)
181
146
{
182
147
        TotemThumbnailPlugin *pi = TOTEM_THUMBNAIL_PLUGIN (plugin);
183
148
        char *mrl;
184
149
 
185
 
        pi->priv->window = totem_get_main_window (totem);
186
 
        pi->priv->totem = totem;
 
150
        pi->priv->totem = g_object_get_data (G_OBJECT (plugin), "object");
 
151
        pi->priv->window = totem_get_main_window (pi->priv->totem);
187
152
 
188
 
        pi->priv->file_opened_handler_id = g_signal_connect (G_OBJECT (totem),
 
153
        pi->priv->file_opened_handler_id = g_signal_connect (G_OBJECT (pi->priv->totem),
189
154
                                                             "file-opened",
190
155
                                                             G_CALLBACK (file_opened_cb),
191
156
                                                             pi);
192
 
        pi->priv->file_closed_handler_id = g_signal_connect (G_OBJECT (totem),
 
157
        pi->priv->file_closed_handler_id = g_signal_connect (G_OBJECT (pi->priv->totem),
193
158
                                                             "file-closed",
194
159
                                                             G_CALLBACK (file_closed_cb),
195
160
                                                             pi);
196
161
 
197
 
        g_object_get (totem, "current-mrl", &mrl, NULL);
 
162
        g_object_get (pi->priv->totem, "current-mrl", &mrl, NULL);
198
163
 
199
 
        update_from_state (pi->priv, totem, mrl);
 
164
        update_from_state (pi->priv, pi->priv->totem, mrl);
200
165
 
201
166
        g_free (mrl);
202
 
 
203
 
        return TRUE;
204
167
}
205
168
 
206
169
static void
207
 
impl_deactivate (TotemPlugin *plugin,
208
 
                 TotemObject *totem)
 
170
impl_deactivate (PeasActivatable *plugin)
209
171
{
210
172
        TotemThumbnailPlugin *pi = TOTEM_THUMBNAIL_PLUGIN (plugin);
211
173
 
212
 
        g_signal_handler_disconnect (totem, pi->priv->file_opened_handler_id);
213
 
        g_signal_handler_disconnect (totem, pi->priv->file_closed_handler_id);
 
174
        g_signal_handler_disconnect (pi->priv->totem, pi->priv->file_opened_handler_id);
 
175
        g_signal_handler_disconnect (pi->priv->totem, pi->priv->file_closed_handler_id);
214
176
 
215
 
        set_icon_to_default (totem);
 
177
        set_icon_to_default (pi->priv->totem);
216
178
}
217
179