1.7.2
by Sjoerd Simons
Import upstream version 3.10.1 |
1 |
/* totem-rotation-plugin.c generated by valac 0.22.0, the Vala compiler
|
1.4.8
by Michael Biebl
Import upstream version 3.2.1 |
2 |
* generated from totem-rotation-plugin.vala, do not modify */
|
3 |
||
4 |
/*
|
|
5 |
* Copyright (C) Simon Wenner 2011 <simon@wenner.ch>
|
|
6 |
*
|
|
7 |
* This program is free software; you can redistribute it and/or modify
|
|
8 |
* it under the terms of the GNU General Public License as published by
|
|
9 |
* the Free Software Foundation; either version 2 of the License, or
|
|
10 |
* (at your option) any later version.
|
|
11 |
*
|
|
12 |
* This program is distributed in the hope that it will be useful,
|
|
13 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
14 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
15 |
* GNU Library General Public License for more details.
|
|
16 |
*
|
|
17 |
* You should have received a copy of the GNU General Public License
|
|
18 |
* along with this program; if not, write to the Free Software
|
|
19 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor Boston, MA 02110-1301, USA
|
|
20 |
*/
|
|
21 |
||
22 |
#include <glib.h> |
|
23 |
#include <glib-object.h> |
|
24 |
#include <stdlib.h> |
|
25 |
#include <string.h> |
|
26 |
#include <libpeas/peas.h> |
|
1.5.10
by Iain Lane
Import upstream version 3.6.3 |
27 |
#include "bacon-video-widget.h" |
1.4.8
by Michael Biebl
Import upstream version 3.2.1 |
28 |
#include <gtk/gtk.h> |
1.5.9
by Robert Ancell
Import upstream version 3.4.3 |
29 |
#include <totem.h> |
1.4.8
by Michael Biebl
Import upstream version 3.2.1 |
30 |
#include <glib/gi18n-lib.h> |
31 |
#include <gio/gio.h> |
|
32 |
||
33 |
||
34 |
#define TYPE_ROTATION_PLUGIN (rotation_plugin_get_type ())
|
|
35 |
#define ROTATION_PLUGIN(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_ROTATION_PLUGIN, RotationPlugin))
|
|
36 |
#define ROTATION_PLUGIN_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_ROTATION_PLUGIN, RotationPluginClass))
|
|
37 |
#define IS_ROTATION_PLUGIN(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_ROTATION_PLUGIN))
|
|
38 |
#define IS_ROTATION_PLUGIN_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_ROTATION_PLUGIN))
|
|
39 |
#define ROTATION_PLUGIN_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_ROTATION_PLUGIN, RotationPluginClass))
|
|
40 |
||
41 |
typedef struct _RotationPlugin RotationPlugin; |
|
42 |
typedef struct _RotationPluginClass RotationPluginClass; |
|
43 |
typedef struct _RotationPluginPrivate RotationPluginPrivate; |
|
44 |
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
|
|
45 |
#define _g_free0(var) (var = (g_free (var), NULL))
|
|
46 |
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
|
|
47 |
typedef struct _RotationPluginStoreStateData RotationPluginStoreStateData; |
|
48 |
typedef struct _RotationPluginTryRestoreStateData RotationPluginTryRestoreStateData; |
|
49 |
||
50 |
struct _RotationPlugin { |
|
51 |
GObject parent_instance; |
|
52 |
RotationPluginPrivate * priv; |
|
53 |
};
|
|
54 |
||
55 |
struct _RotationPluginClass { |
|
56 |
GObjectClass parent_class; |
|
57 |
};
|
|
58 |
||
59 |
struct _RotationPluginPrivate { |
|
60 |
GObject* _object; |
|
1.5.10
by Iain Lane
Import upstream version 3.6.3 |
61 |
BaconVideoWidget* bvw; |
1.4.8
by Michael Biebl
Import upstream version 3.2.1 |
62 |
guint ui_id; |
63 |
GtkActionGroup* action_group; |
|
64 |
};
|
|
65 |
||
66 |
struct _RotationPluginStoreStateData { |
|
67 |
int _state_; |
|
68 |
GObject* _source_object_; |
|
69 |
GAsyncResult* _res_; |
|
70 |
GSimpleAsyncResult* _async_result; |
|
71 |
RotationPlugin* self; |
|
1.7.1
by Jeremy Bicha
Import upstream version 3.8.2 |
72 |
TotemObject* t; |
1.4.8
by Michael Biebl
Import upstream version 3.2.1 |
73 |
GObject* _tmp0_; |
1.4.9
by Michael Biebl
Import upstream version 3.4.2 |
74 |
GObject* _tmp1_; |
1.7.1
by Jeremy Bicha
Import upstream version 3.8.2 |
75 |
gchar* mrl; |
1.4.8
by Michael Biebl
Import upstream version 3.2.1 |
76 |
TotemObject* _tmp2_; |
77 |
gchar* _tmp3_; |
|
78 |
const gchar* _tmp4_; |
|
1.7.1
by Jeremy Bicha
Import upstream version 3.8.2 |
79 |
GFile* file; |
1.4.8
by Michael Biebl
Import upstream version 3.2.1 |
80 |
const gchar* _tmp5_; |
81 |
GFile* _tmp6_; |
|
1.5.10
by Iain Lane
Import upstream version 3.6.3 |
82 |
BvwRotation rotation; |
1.7.1
by Jeremy Bicha
Import upstream version 3.8.2 |
83 |
GFileInfo* file_info; |
1.4.8
by Michael Biebl
Import upstream version 3.2.1 |
84 |
GFile* _tmp7_; |
85 |
GFileInfo* _tmp8_; |
|
1.7.1
by Jeremy Bicha
Import upstream version 3.8.2 |
86 |
gchar* state_str; |
1.4.8
by Michael Biebl
Import upstream version 3.2.1 |
87 |
gchar* _tmp9_; |
1.5.10
by Iain Lane
Import upstream version 3.6.3 |
88 |
BaconVideoWidget* _tmp10_; |
89 |
BvwRotation _tmp11_; |
|
90 |
BvwRotation _tmp12_; |
|
91 |
BvwRotation _tmp13_; |
|
92 |
gchar* _tmp14_; |
|
93 |
GFileInfo* _tmp15_; |
|
94 |
const gchar* _tmp16_; |
|
95 |
GFile* _tmp17_; |
|
96 |
GFileInfo* _tmp18_; |
|
1.4.8
by Michael Biebl
Import upstream version 3.2.1 |
97 |
GError* e; |
1.5.10
by Iain Lane
Import upstream version 3.6.3 |
98 |
GError* _tmp19_; |
99 |
const gchar* _tmp20_; |
|
1.4.8
by Michael Biebl
Import upstream version 3.2.1 |
100 |
GError * _inner_error_; |
101 |
};
|
|
102 |
||
103 |
struct _RotationPluginTryRestoreStateData { |
|
104 |
int _state_; |
|
105 |
GObject* _source_object_; |
|
106 |
GAsyncResult* _res_; |
|
107 |
GSimpleAsyncResult* _async_result; |
|
108 |
RotationPlugin* self; |
|
109 |
gchar* mrl; |
|
1.7.1
by Jeremy Bicha
Import upstream version 3.8.2 |
110 |
GFile* file; |
1.4.8
by Michael Biebl
Import upstream version 3.2.1 |
111 |
const gchar* _tmp0_; |
112 |
GFile* _tmp1_; |
|
1.7.2
by Sjoerd Simons
Import upstream version 3.10.1 |
113 |
gboolean _tmp2_; |
114 |
GFile* _tmp3_; |
|
115 |
gboolean _tmp4_; |
|
116 |
GFile* _tmp5_; |
|
117 |
gboolean _tmp6_; |
|
118 |
gboolean _tmp7_; |
|
1.7.1
by Jeremy Bicha
Import upstream version 3.8.2 |
119 |
GFileInfo* file_info; |
1.7.2
by Sjoerd Simons
Import upstream version 3.10.1 |
120 |
GFile* _tmp8_; |
121 |
GFileInfo* _tmp9_; |
|
1.7.1
by Jeremy Bicha
Import upstream version 3.8.2 |
122 |
gchar* state_str; |
1.7.2
by Sjoerd Simons
Import upstream version 3.10.1 |
123 |
GFileInfo* _tmp10_; |
124 |
const gchar* _tmp11_; |
|
125 |
gchar* _tmp12_; |
|
126 |
const gchar* _tmp13_; |
|
1.7.1
by Jeremy Bicha
Import upstream version 3.8.2 |
127 |
gint state; |
1.7.2
by Sjoerd Simons
Import upstream version 3.10.1 |
128 |
const gchar* _tmp14_; |
129 |
guint64 _tmp15_; |
|
130 |
BaconVideoWidget* _tmp16_; |
|
131 |
gint _tmp17_; |
|
1.4.8
by Michael Biebl
Import upstream version 3.2.1 |
132 |
GError* e; |
1.7.2
by Sjoerd Simons
Import upstream version 3.10.1 |
133 |
GError* _tmp18_; |
134 |
const gchar* _tmp19_; |
|
1.4.8
by Michael Biebl
Import upstream version 3.2.1 |
135 |
GError * _inner_error_; |
136 |
};
|
|
137 |
||
138 |
||
139 |
static gpointer rotation_plugin_parent_class = NULL; |
|
140 |
static PeasActivatableInterface* rotation_plugin_peas_activatable_parent_iface = NULL; |
|
141 |
static GType rotation_plugin_type_id = 0; |
|
142 |
||
143 |
#define GIO_ROTATION_FILE_ATTRIBUTE "metadata::totem::rotation"
|
|
144 |
GType rotation_plugin_get_type (void) G_GNUC_CONST; |
|
145 |
GType rotation_plugin_register_type (GTypeModule * module); |
|
146 |
#define ROTATION_PLUGIN_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TYPE_ROTATION_PLUGIN, RotationPluginPrivate))
|
|
147 |
enum { |
|
148 |
ROTATION_PLUGIN_DUMMY_PROPERTY, |
|
149 |
ROTATION_PLUGIN_OBJECT
|
|
150 |
};
|
|
151 |
#define ROTATION_PLUGIN_STATE_COUNT 4
|
|
152 |
static void rotation_plugin_real_activate (PeasActivatable* base); |
|
153 |
static void rotation_plugin_cb_rotate_right (RotationPlugin* self); |
|
154 |
static void _rotation_plugin_cb_rotate_right_gtk_action_activate (GtkAction* _sender, gpointer self); |
|
155 |
static void rotation_plugin_cb_rotate_left (RotationPlugin* self); |
|
156 |
static void _rotation_plugin_cb_rotate_left_gtk_action_activate (GtkAction* _sender, gpointer self); |
|
157 |
static void rotation_plugin_try_restore_state (RotationPlugin* self, const gchar* mrl, GAsyncReadyCallback _callback_, gpointer _user_data_); |
|
158 |
static void rotation_plugin_try_restore_state_finish (RotationPlugin* self, GAsyncResult* _res_); |
|
159 |
static void rotation_plugin_cb_file_closed (RotationPlugin* self); |
|
160 |
static void _rotation_plugin_cb_file_closed_totem_object_file_closed (TotemObject* _sender, gpointer self); |
|
161 |
static void rotation_plugin_cb_file_opened (RotationPlugin* self, const gchar* mrl); |
|
162 |
static void _rotation_plugin_cb_file_opened_totem_object_file_opened (TotemObject* _sender, const gchar* mrl, gpointer self); |
|
163 |
static void rotation_plugin_real_deactivate (PeasActivatable* base); |
|
164 |
static void rotation_plugin_real_update_state (PeasActivatable* base); |
|
165 |
static void rotation_plugin_store_state (RotationPlugin* self, GAsyncReadyCallback _callback_, gpointer _user_data_); |
|
166 |
static void rotation_plugin_store_state_finish (RotationPlugin* self, GAsyncResult* _res_); |
|
167 |
static void rotation_plugin_store_state_data_free (gpointer _data); |
|
168 |
static gboolean rotation_plugin_store_state_co (RotationPluginStoreStateData* _data_); |
|
169 |
static void rotation_plugin_store_state_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_); |
|
170 |
static void rotation_plugin_try_restore_state_data_free (gpointer _data); |
|
171 |
static gboolean rotation_plugin_try_restore_state_co (RotationPluginTryRestoreStateData* _data_); |
|
172 |
static void rotation_plugin_try_restore_state_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_); |
|
173 |
RotationPlugin* rotation_plugin_new (void); |
|
174 |
RotationPlugin* rotation_plugin_construct (GType object_type); |
|
175 |
static void rotation_plugin_finalize (GObject* obj); |
|
176 |
static void _vala_rotation_plugin_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec); |
|
177 |
static void _vala_rotation_plugin_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec); |
|
178 |
void peas_register_types (GTypeModule* module); |
|
179 |
||
180 |
||
181 |
static void _rotation_plugin_cb_rotate_right_gtk_action_activate (GtkAction* _sender, gpointer self) { |
|
182 |
rotation_plugin_cb_rotate_right (self); |
|
183 |
}
|
|
184 |
||
185 |
||
186 |
static void _rotation_plugin_cb_rotate_left_gtk_action_activate (GtkAction* _sender, gpointer self) { |
|
187 |
rotation_plugin_cb_rotate_left (self); |
|
188 |
}
|
|
189 |
||
190 |
||
191 |
static void _rotation_plugin_cb_file_closed_totem_object_file_closed (TotemObject* _sender, gpointer self) { |
|
192 |
rotation_plugin_cb_file_closed (self); |
|
193 |
}
|
|
194 |
||
195 |
||
196 |
static void _rotation_plugin_cb_file_opened_totem_object_file_opened (TotemObject* _sender, const gchar* mrl, gpointer self) { |
|
197 |
rotation_plugin_cb_file_opened (self, mrl); |
|
198 |
}
|
|
199 |
||
200 |
||
201 |
static void rotation_plugin_real_activate (PeasActivatable* base) { |
|
202 |
RotationPlugin * self; |
|
1.7.1
by Jeremy Bicha
Import upstream version 3.8.2 |
203 |
TotemObject* t = NULL; |
1.4.9
by Michael Biebl
Import upstream version 3.4.2 |
204 |
GObject* _tmp0_ = NULL; |
1.7.2
by Sjoerd Simons
Import upstream version 3.10.1 |
205 |
GObject* _tmp1_ = NULL; |
1.7.1
by Jeremy Bicha
Import upstream version 3.8.2 |
206 |
gchar* mrl = NULL; |
1.7.2
by Sjoerd Simons
Import upstream version 3.10.1 |
207 |
TotemObject* _tmp2_ = NULL; |
1.5.10
by Iain Lane
Import upstream version 3.6.3 |
208 |
gchar* _tmp3_ = NULL; |
1.7.2
by Sjoerd Simons
Import upstream version 3.10.1 |
209 |
TotemObject* _tmp4_ = NULL; |
1.5.10
by Iain Lane
Import upstream version 3.6.3 |
210 |
GtkWidget* _tmp5_ = NULL; |
1.7.2
by Sjoerd Simons
Import upstream version 3.10.1 |
211 |
BaconVideoWidget* _tmp6_ = NULL; |
1.7.1
by Jeremy Bicha
Import upstream version 3.8.2 |
212 |
GtkUIManager* ui_manager = NULL; |
1.7.2
by Sjoerd Simons
Import upstream version 3.10.1 |
213 |
TotemObject* _tmp7_ = NULL; |
1.7.1
by Jeremy Bicha
Import upstream version 3.8.2 |
214 |
GtkUIManager* _tmp8_ = NULL; |
1.7.2
by Sjoerd Simons
Import upstream version 3.10.1 |
215 |
GtkUIManager* _tmp9_ = NULL; |
1.7.1
by Jeremy Bicha
Import upstream version 3.8.2 |
216 |
guint _tmp10_ = 0U; |
1.7.2
by Sjoerd Simons
Import upstream version 3.10.1 |
217 |
GtkUIManager* _tmp11_ = NULL; |
218 |
guint _tmp12_ = 0U; |
|
219 |
GtkUIManager* _tmp13_ = NULL; |
|
220 |
guint _tmp14_ = 0U; |
|
1.7.1
by Jeremy Bicha
Import upstream version 3.8.2 |
221 |
GtkAction* rotate_right = NULL; |
222 |
const gchar* _tmp15_ = NULL; |
|
1.7.2
by Sjoerd Simons
Import upstream version 3.10.1 |
223 |
GtkAction* _tmp16_ = NULL; |
224 |
GtkAction* _tmp17_ = NULL; |
|
1.7.1
by Jeremy Bicha
Import upstream version 3.8.2 |
225 |
GtkAction* rotate_left = NULL; |
226 |
const gchar* _tmp18_ = NULL; |
|
1.7.2
by Sjoerd Simons
Import upstream version 3.10.1 |
227 |
GtkAction* _tmp19_ = NULL; |
228 |
GtkAction* _tmp20_ = NULL; |
|
229 |
GtkActionGroup* _tmp21_ = NULL; |
|
230 |
GtkActionGroup* _tmp22_ = NULL; |
|
231 |
GtkAction* _tmp23_ = NULL; |
|
232 |
GtkActionGroup* _tmp24_ = NULL; |
|
233 |
GtkAction* _tmp25_ = NULL; |
|
234 |
const gchar* _tmp26_ = NULL; |
|
235 |
GtkUIManager* _tmp28_ = NULL; |
|
236 |
GtkActionGroup* _tmp29_ = NULL; |
|
237 |
const gchar* _tmp30_ = NULL; |
|
238 |
TotemObject* _tmp32_ = NULL; |
|
239 |
TotemObject* _tmp33_ = NULL; |
|
1.4.8
by Michael Biebl
Import upstream version 3.2.1 |
240 |
self = (RotationPlugin*) base; |
1.4.9
by Michael Biebl
Import upstream version 3.4.2 |
241 |
g_object_get ((PeasActivatable*) self, "object", &_tmp0_, NULL); |
242 |
_tmp1_ = _tmp0_; |
|
1.5.10
by Iain Lane
Import upstream version 3.6.3 |
243 |
t = G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, totem_object_get_type (), TotemObject); |
1.4.8
by Michael Biebl
Import upstream version 3.2.1 |
244 |
_tmp2_ = t; |
1.5.10
by Iain Lane
Import upstream version 3.6.3 |
245 |
_tmp3_ = totem_object_get_current_mrl (_tmp2_); |
246 |
mrl = _tmp3_; |
|
247 |
_tmp4_ = t; |
|
248 |
_tmp5_ = totem_object_get_video_widget (_tmp4_); |
|
1.7.1
by Jeremy Bicha
Import upstream version 3.8.2 |
249 |
_tmp6_ = G_TYPE_CHECK_INSTANCE_TYPE (_tmp5_, BACON_TYPE_VIDEO_WIDGET) ? ((BaconVideoWidget*) _tmp5_) : NULL; |
250 |
if (_tmp6_ == NULL) { |
|
251 |
_g_object_unref0 (_tmp5_); |
|
252 |
}
|
|
1.5.10
by Iain Lane
Import upstream version 3.6.3 |
253 |
_g_object_unref0 (self->priv->bvw); |
1.7.1
by Jeremy Bicha
Import upstream version 3.8.2 |
254 |
self->priv->bvw = _tmp6_; |
255 |
_tmp7_ = t; |
|
256 |
_tmp8_ = totem_object_get_ui_manager (_tmp7_); |
|
257 |
ui_manager = _tmp8_; |
|
258 |
_tmp9_ = ui_manager; |
|
259 |
_tmp10_ = gtk_ui_manager_new_merge_id (_tmp9_); |
|
260 |
self->priv->ui_id = _tmp10_; |
|
261 |
_tmp11_ = ui_manager; |
|
262 |
_tmp12_ = self->priv->ui_id; |
|
263 |
gtk_ui_manager_add_ui (_tmp11_, _tmp12_, "/ui/tmw-menubar/view/next-angle", "rotate-left", "rotate-left", GTK_UI_MANAGER_AUTO, FALSE); |
|
264 |
_tmp13_ = ui_manager; |
|
265 |
_tmp14_ = self->priv->ui_id; |
|
266 |
gtk_ui_manager_add_ui (_tmp13_, _tmp14_, "/ui/tmw-menubar/view/next-angle", "rotate-right", "rotate-right", GTK_UI_MANAGER_AUTO, FALSE); |
|
267 |
_tmp15_ = _ ("_Rotate Clockwise"); |
|
268 |
_tmp16_ = gtk_action_new ("rotate-right", _tmp15_, NULL, NULL); |
|
269 |
rotate_right = _tmp16_; |
|
270 |
_tmp17_ = rotate_right; |
|
271 |
g_signal_connect_object (_tmp17_, "activate", (GCallback) _rotation_plugin_cb_rotate_right_gtk_action_activate, self, 0); |
|
272 |
_tmp18_ = _ ("Rotate Counterc_lockwise"); |
|
273 |
_tmp19_ = gtk_action_new ("rotate-left", _tmp18_, NULL, NULL); |
|
274 |
rotate_left = _tmp19_; |
|
275 |
_tmp20_ = rotate_left; |
|
276 |
g_signal_connect_object (_tmp20_, "activate", (GCallback) _rotation_plugin_cb_rotate_left_gtk_action_activate, self, 0); |
|
277 |
_tmp21_ = gtk_action_group_new ("RotationActions"); |
|
1.4.8
by Michael Biebl
Import upstream version 3.2.1 |
278 |
_g_object_unref0 (self->priv->action_group); |
1.7.1
by Jeremy Bicha
Import upstream version 3.8.2 |
279 |
self->priv->action_group = _tmp21_; |
280 |
_tmp22_ = self->priv->action_group; |
|
281 |
_tmp23_ = rotate_right; |
|
282 |
gtk_action_group_add_action_with_accel (_tmp22_, _tmp23_, "<ctrl>R"); |
|
283 |
_tmp24_ = self->priv->action_group; |
|
284 |
_tmp25_ = rotate_left; |
|
285 |
gtk_action_group_add_action_with_accel (_tmp24_, _tmp25_, "<ctrl><shift>R"); |
|
286 |
_tmp26_ = mrl; |
|
287 |
if (_tmp26_ == NULL) { |
|
1.7.2
by Sjoerd Simons
Import upstream version 3.10.1 |
288 |
GtkActionGroup* _tmp27_ = NULL; |
1.7.1
by Jeremy Bicha
Import upstream version 3.8.2 |
289 |
_tmp27_ = self->priv->action_group; |
290 |
gtk_action_group_set_sensitive (_tmp27_, FALSE); |
|
291 |
}
|
|
292 |
_tmp28_ = ui_manager; |
|
293 |
_tmp29_ = self->priv->action_group; |
|
294 |
gtk_ui_manager_insert_action_group (_tmp28_, _tmp29_, 0); |
|
295 |
_tmp30_ = mrl; |
|
296 |
if (_tmp30_ != NULL) { |
|
1.7.2
by Sjoerd Simons
Import upstream version 3.10.1 |
297 |
const gchar* _tmp31_ = NULL; |
1.7.1
by Jeremy Bicha
Import upstream version 3.8.2 |
298 |
_tmp31_ = mrl; |
299 |
rotation_plugin_try_restore_state (self, _tmp31_, NULL, NULL); |
|
300 |
}
|
|
1.5.10
by Iain Lane
Import upstream version 3.6.3 |
301 |
_tmp32_ = t; |
1.7.1
by Jeremy Bicha
Import upstream version 3.8.2 |
302 |
g_signal_connect_object (_tmp32_, "file-closed", (GCallback) _rotation_plugin_cb_file_closed_totem_object_file_closed, self, 0); |
303 |
_tmp33_ = t; |
|
304 |
g_signal_connect_object (_tmp33_, "file-opened", (GCallback) _rotation_plugin_cb_file_opened_totem_object_file_opened, self, 0); |
|
1.4.8
by Michael Biebl
Import upstream version 3.2.1 |
305 |
_g_object_unref0 (rotate_left); |
306 |
_g_object_unref0 (rotate_right); |
|
307 |
_g_free0 (mrl); |
|
308 |
_g_object_unref0 (t); |
|
309 |
}
|
|
310 |
||
311 |
||
312 |
static void rotation_plugin_real_deactivate (PeasActivatable* base) { |
|
313 |
RotationPlugin * self; |
|
1.7.1
by Jeremy Bicha
Import upstream version 3.8.2 |
314 |
TotemObject* t = NULL; |
1.4.9
by Michael Biebl
Import upstream version 3.4.2 |
315 |
GObject* _tmp0_ = NULL; |
1.7.2
by Sjoerd Simons
Import upstream version 3.10.1 |
316 |
GObject* _tmp1_ = NULL; |
1.5.10
by Iain Lane
Import upstream version 3.6.3 |
317 |
guint _tmp2_ = 0U; |
1.4.8
by Michael Biebl
Import upstream version 3.2.1 |
318 |
guint _tmp3_ = 0U; |
1.7.1
by Jeremy Bicha
Import upstream version 3.8.2 |
319 |
GtkUIManager* ui_manager = NULL; |
1.5.10
by Iain Lane
Import upstream version 3.6.3 |
320 |
GtkUIManager* _tmp4_ = NULL; |
1.7.2
by Sjoerd Simons
Import upstream version 3.10.1 |
321 |
guint _tmp5_ = 0U; |
322 |
GtkActionGroup* _tmp6_ = NULL; |
|
323 |
BaconVideoWidget* _tmp7_ = NULL; |
|
1.4.8
by Michael Biebl
Import upstream version 3.2.1 |
324 |
self = (RotationPlugin*) base; |
1.4.9
by Michael Biebl
Import upstream version 3.4.2 |
325 |
g_object_get ((PeasActivatable*) self, "object", &_tmp0_, NULL); |
326 |
_tmp1_ = _tmp0_; |
|
1.5.10
by Iain Lane
Import upstream version 3.6.3 |
327 |
t = G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, totem_object_get_type (), TotemObject); |
328 |
g_signal_parse_name ("file-closed", totem_object_get_type (), &_tmp2_, NULL, FALSE); |
|
329 |
g_signal_handlers_disconnect_matched (t, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp2_, 0, NULL, (GCallback) _rotation_plugin_cb_file_closed_totem_object_file_closed, self); |
|
330 |
g_signal_parse_name ("file-opened", totem_object_get_type (), &_tmp3_, NULL, FALSE); |
|
331 |
g_signal_handlers_disconnect_matched (t, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp3_, 0, NULL, (GCallback) _rotation_plugin_cb_file_opened_totem_object_file_opened, self); |
|
332 |
_tmp4_ = totem_object_get_ui_manager (t); |
|
333 |
ui_manager = _tmp4_; |
|
334 |
_tmp5_ = self->priv->ui_id; |
|
335 |
gtk_ui_manager_remove_ui (ui_manager, _tmp5_); |
|
336 |
_tmp6_ = self->priv->action_group; |
|
337 |
gtk_ui_manager_remove_action_group (ui_manager, _tmp6_); |
|
338 |
_tmp7_ = self->priv->bvw; |
|
339 |
bacon_video_widget_set_rotation (_tmp7_, BVW_ROTATION_R_ZERO); |
|
1.4.8
by Michael Biebl
Import upstream version 3.2.1 |
340 |
_g_object_unref0 (t); |
341 |
}
|
|
342 |
||
343 |
||
344 |
static void rotation_plugin_real_update_state (PeasActivatable* base) { |
|
345 |
RotationPlugin * self; |
|
346 |
self = (RotationPlugin*) base; |
|
347 |
}
|
|
348 |
||
349 |
||
350 |
static void rotation_plugin_cb_rotate_left (RotationPlugin* self) { |
|
1.7.1
by Jeremy Bicha
Import upstream version 3.8.2 |
351 |
gint state = 0; |
1.7.2
by Sjoerd Simons
Import upstream version 3.10.1 |
352 |
BaconVideoWidget* _tmp0_ = NULL; |
1.5.10
by Iain Lane
Import upstream version 3.6.3 |
353 |
BvwRotation _tmp1_ = 0; |
1.7.2
by Sjoerd Simons
Import upstream version 3.10.1 |
354 |
BaconVideoWidget* _tmp2_ = NULL; |
1.4.8
by Michael Biebl
Import upstream version 3.2.1 |
355 |
g_return_if_fail (self != NULL); |
1.5.10
by Iain Lane
Import upstream version 3.6.3 |
356 |
_tmp0_ = self->priv->bvw; |
357 |
_tmp1_ = bacon_video_widget_get_rotation (_tmp0_); |
|
358 |
state = (gint) ((_tmp1_ - 1) % ROTATION_PLUGIN_STATE_COUNT); |
|
359 |
_tmp2_ = self->priv->bvw; |
|
360 |
bacon_video_widget_set_rotation (_tmp2_, (BvwRotation) state); |
|
1.4.8
by Michael Biebl
Import upstream version 3.2.1 |
361 |
rotation_plugin_store_state (self, NULL, NULL); |
362 |
}
|
|
363 |
||
364 |
||
365 |
static void rotation_plugin_cb_rotate_right (RotationPlugin* self) { |
|
1.7.1
by Jeremy Bicha
Import upstream version 3.8.2 |
366 |
gint state = 0; |
1.7.2
by Sjoerd Simons
Import upstream version 3.10.1 |
367 |
BaconVideoWidget* _tmp0_ = NULL; |
1.5.10
by Iain Lane
Import upstream version 3.6.3 |
368 |
BvwRotation _tmp1_ = 0; |
1.7.2
by Sjoerd Simons
Import upstream version 3.10.1 |
369 |
BaconVideoWidget* _tmp2_ = NULL; |
1.4.8
by Michael Biebl
Import upstream version 3.2.1 |
370 |
g_return_if_fail (self != NULL); |
1.5.10
by Iain Lane
Import upstream version 3.6.3 |
371 |
_tmp0_ = self->priv->bvw; |
372 |
_tmp1_ = bacon_video_widget_get_rotation (_tmp0_); |
|
373 |
state = (gint) ((_tmp1_ + 1) % ROTATION_PLUGIN_STATE_COUNT); |
|
374 |
_tmp2_ = self->priv->bvw; |
|
375 |
bacon_video_widget_set_rotation (_tmp2_, (BvwRotation) state); |
|
1.4.8
by Michael Biebl
Import upstream version 3.2.1 |
376 |
rotation_plugin_store_state (self, NULL, NULL); |
377 |
}
|
|
378 |
||
379 |
||
380 |
static void rotation_plugin_cb_file_closed (RotationPlugin* self) { |
|
1.7.2
by Sjoerd Simons
Import upstream version 3.10.1 |
381 |
BaconVideoWidget* _tmp0_ = NULL; |
382 |
GtkActionGroup* _tmp1_ = NULL; |
|
1.4.8
by Michael Biebl
Import upstream version 3.2.1 |
383 |
g_return_if_fail (self != NULL); |
1.5.10
by Iain Lane
Import upstream version 3.6.3 |
384 |
_tmp0_ = self->priv->bvw; |
385 |
bacon_video_widget_set_rotation (_tmp0_, BVW_ROTATION_R_ZERO); |
|
386 |
_tmp1_ = self->priv->action_group; |
|
387 |
gtk_action_group_set_sensitive (_tmp1_, FALSE); |
|
1.4.8
by Michael Biebl
Import upstream version 3.2.1 |
388 |
}
|
389 |
||
390 |
||
391 |
static void rotation_plugin_cb_file_opened (RotationPlugin* self, const gchar* mrl) { |
|
1.7.2
by Sjoerd Simons
Import upstream version 3.10.1 |
392 |
GtkActionGroup* _tmp0_ = NULL; |
393 |
const gchar* _tmp1_ = NULL; |
|
1.4.8
by Michael Biebl
Import upstream version 3.2.1 |
394 |
g_return_if_fail (self != NULL); |
395 |
g_return_if_fail (mrl != NULL); |
|
396 |
_tmp0_ = self->priv->action_group; |
|
397 |
gtk_action_group_set_sensitive (_tmp0_, TRUE); |
|
398 |
_tmp1_ = mrl; |
|
399 |
rotation_plugin_try_restore_state (self, _tmp1_, NULL, NULL); |
|
400 |
}
|
|
401 |
||
402 |
||
403 |
static void rotation_plugin_store_state_data_free (gpointer _data) { |
|
404 |
RotationPluginStoreStateData* _data_; |
|
405 |
_data_ = _data; |
|
406 |
_g_object_unref0 (_data_->self); |
|
407 |
g_slice_free (RotationPluginStoreStateData, _data_); |
|
408 |
}
|
|
409 |
||
410 |
||
1.5.10
by Iain Lane
Import upstream version 3.6.3 |
411 |
static gpointer _g_object_ref0 (gpointer self) { |
412 |
return self ? g_object_ref (self) : NULL; |
|
413 |
}
|
|
414 |
||
415 |
||
1.4.8
by Michael Biebl
Import upstream version 3.2.1 |
416 |
static void rotation_plugin_store_state (RotationPlugin* self, GAsyncReadyCallback _callback_, gpointer _user_data_) { |
417 |
RotationPluginStoreStateData* _data_; |
|
1.7.2
by Sjoerd Simons
Import upstream version 3.10.1 |
418 |
RotationPlugin* _tmp0_ = NULL; |
1.4.8
by Michael Biebl
Import upstream version 3.2.1 |
419 |
_data_ = g_slice_new0 (RotationPluginStoreStateData); |
420 |
_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, rotation_plugin_store_state); |
|
421 |
g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, rotation_plugin_store_state_data_free); |
|
422 |
_tmp0_ = _g_object_ref0 (self); |
|
423 |
_data_->self = _tmp0_; |
|
424 |
rotation_plugin_store_state_co (_data_); |
|
425 |
}
|
|
426 |
||
427 |
||
428 |
static void rotation_plugin_store_state_finish (RotationPlugin* self, GAsyncResult* _res_) { |
|
429 |
RotationPluginStoreStateData* _data_; |
|
430 |
_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_)); |
|
431 |
}
|
|
432 |
||
433 |
||
434 |
static void rotation_plugin_store_state_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) { |
|
435 |
RotationPluginStoreStateData* _data_; |
|
436 |
_data_ = _user_data_; |
|
437 |
_data_->_source_object_ = source_object; |
|
438 |
_data_->_res_ = _res_; |
|
439 |
rotation_plugin_store_state_co (_data_); |
|
440 |
}
|
|
441 |
||
442 |
||
443 |
static gboolean rotation_plugin_store_state_co (RotationPluginStoreStateData* _data_) { |
|
444 |
switch (_data_->_state_) { |
|
445 |
case 0: |
|
446 |
goto _state_0; |
|
447 |
case 1: |
|
448 |
goto _state_1; |
|
449 |
case 2: |
|
450 |
goto _state_2; |
|
451 |
default: |
|
452 |
g_assert_not_reached (); |
|
453 |
}
|
|
454 |
_state_0: |
|
1.4.9
by Michael Biebl
Import upstream version 3.4.2 |
455 |
_data_->_tmp0_ = NULL; |
456 |
g_object_get ((PeasActivatable*) _data_->self, "object", &_data_->_tmp0_, NULL); |
|
1.7.2
by Sjoerd Simons
Import upstream version 3.10.1 |
457 |
_data_->_tmp1_ = NULL; |
1.4.9
by Michael Biebl
Import upstream version 3.4.2 |
458 |
_data_->_tmp1_ = _data_->_tmp0_; |
1.5.10
by Iain Lane
Import upstream version 3.6.3 |
459 |
_data_->t = G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp1_, totem_object_get_type (), TotemObject); |
1.7.2
by Sjoerd Simons
Import upstream version 3.10.1 |
460 |
_data_->_tmp2_ = NULL; |
1.4.8
by Michael Biebl
Import upstream version 3.2.1 |
461 |
_data_->_tmp2_ = _data_->t; |
462 |
_data_->_tmp3_ = NULL; |
|
463 |
_data_->_tmp3_ = totem_object_get_current_mrl (_data_->_tmp2_); |
|
464 |
_data_->mrl = _data_->_tmp3_; |
|
1.7.2
by Sjoerd Simons
Import upstream version 3.10.1 |
465 |
_data_->_tmp4_ = NULL; |
1.4.8
by Michael Biebl
Import upstream version 3.2.1 |
466 |
_data_->_tmp4_ = _data_->mrl; |
467 |
if (_data_->_tmp4_ == NULL) { |
|
468 |
_g_free0 (_data_->mrl); |
|
469 |
_g_object_unref0 (_data_->t); |
|
470 |
if (_data_->_state_ == 0) { |
|
471 |
g_simple_async_result_complete_in_idle (_data_->_async_result); |
|
472 |
} else { |
|
473 |
g_simple_async_result_complete (_data_->_async_result); |
|
474 |
}
|
|
475 |
g_object_unref (_data_->_async_result); |
|
476 |
return FALSE; |
|
477 |
}
|
|
1.7.2
by Sjoerd Simons
Import upstream version 3.10.1 |
478 |
_data_->_tmp5_ = NULL; |
1.4.8
by Michael Biebl
Import upstream version 3.2.1 |
479 |
_data_->_tmp5_ = _data_->mrl; |
480 |
_data_->_tmp6_ = NULL; |
|
481 |
_data_->_tmp6_ = g_file_new_for_uri (_data_->_tmp5_); |
|
482 |
_data_->file = _data_->_tmp6_; |
|
483 |
{
|
|
1.7.2
by Sjoerd Simons
Import upstream version 3.10.1 |
484 |
_data_->_tmp7_ = NULL; |
1.4.8
by Michael Biebl
Import upstream version 3.2.1 |
485 |
_data_->_tmp7_ = _data_->file; |
486 |
_data_->_state_ = 1; |
|
487 |
g_file_query_info_async (_data_->_tmp7_, GIO_ROTATION_FILE_ATTRIBUTE, G_FILE_QUERY_INFO_NONE, G_PRIORITY_DEFAULT, NULL, rotation_plugin_store_state_ready, _data_); |
|
488 |
return FALSE; |
|
489 |
_state_1: |
|
490 |
_data_->_tmp8_ = NULL; |
|
491 |
_data_->_tmp8_ = g_file_query_info_finish (_data_->_tmp7_, _data_->_res_, &_data_->_inner_error_); |
|
492 |
_data_->file_info = _data_->_tmp8_; |
|
493 |
if (_data_->_inner_error_ != NULL) { |
|
494 |
goto __catch0_g_error; |
|
495 |
}
|
|
1.7.2
by Sjoerd Simons
Import upstream version 3.10.1 |
496 |
_data_->_tmp9_ = NULL; |
1.4.8
by Michael Biebl
Import upstream version 3.2.1 |
497 |
_data_->_tmp9_ = g_strdup (""); |
498 |
_data_->state_str = _data_->_tmp9_; |
|
1.7.2
by Sjoerd Simons
Import upstream version 3.10.1 |
499 |
_data_->_tmp10_ = NULL; |
1.5.10
by Iain Lane
Import upstream version 3.6.3 |
500 |
_data_->_tmp10_ = _data_->self->priv->bvw; |
501 |
_data_->_tmp11_ = 0; |
|
502 |
_data_->_tmp11_ = bacon_video_widget_get_rotation (_data_->_tmp10_); |
|
503 |
_data_->rotation = _data_->_tmp11_; |
|
1.7.2
by Sjoerd Simons
Import upstream version 3.10.1 |
504 |
_data_->_tmp12_ = 0; |
1.5.10
by Iain Lane
Import upstream version 3.6.3 |
505 |
_data_->_tmp12_ = _data_->rotation; |
506 |
if (_data_->_tmp12_ != BVW_ROTATION_R_ZERO) { |
|
1.7.2
by Sjoerd Simons
Import upstream version 3.10.1 |
507 |
_data_->_tmp13_ = 0; |
1.5.10
by Iain Lane
Import upstream version 3.6.3 |
508 |
_data_->_tmp13_ = _data_->rotation; |
509 |
_data_->_tmp14_ = NULL; |
|
510 |
_data_->_tmp14_ = g_strdup_printf ("%u", (guint) _data_->_tmp13_); |
|
1.4.8
by Michael Biebl
Import upstream version 3.2.1 |
511 |
_g_free0 (_data_->state_str); |
1.5.10
by Iain Lane
Import upstream version 3.6.3 |
512 |
_data_->state_str = _data_->_tmp14_; |
1.4.8
by Michael Biebl
Import upstream version 3.2.1 |
513 |
}
|
1.7.2
by Sjoerd Simons
Import upstream version 3.10.1 |
514 |
_data_->_tmp15_ = NULL; |
1.5.10
by Iain Lane
Import upstream version 3.6.3 |
515 |
_data_->_tmp15_ = _data_->file_info; |
1.7.2
by Sjoerd Simons
Import upstream version 3.10.1 |
516 |
_data_->_tmp16_ = NULL; |
1.5.10
by Iain Lane
Import upstream version 3.6.3 |
517 |
_data_->_tmp16_ = _data_->state_str; |
518 |
g_file_info_set_attribute_string (_data_->_tmp15_, GIO_ROTATION_FILE_ATTRIBUTE, _data_->_tmp16_); |
|
1.7.2
by Sjoerd Simons
Import upstream version 3.10.1 |
519 |
_data_->_tmp17_ = NULL; |
1.5.10
by Iain Lane
Import upstream version 3.6.3 |
520 |
_data_->_tmp17_ = _data_->file; |
1.7.2
by Sjoerd Simons
Import upstream version 3.10.1 |
521 |
_data_->_tmp18_ = NULL; |
1.5.10
by Iain Lane
Import upstream version 3.6.3 |
522 |
_data_->_tmp18_ = _data_->file_info; |
1.4.8
by Michael Biebl
Import upstream version 3.2.1 |
523 |
_data_->_state_ = 2; |
1.5.10
by Iain Lane
Import upstream version 3.6.3 |
524 |
g_file_set_attributes_async (_data_->_tmp17_, _data_->_tmp18_, G_FILE_QUERY_INFO_NONE, G_PRIORITY_DEFAULT, NULL, rotation_plugin_store_state_ready, _data_); |
1.4.8
by Michael Biebl
Import upstream version 3.2.1 |
525 |
return FALSE; |
526 |
_state_2: |
|
1.5.10
by Iain Lane
Import upstream version 3.6.3 |
527 |
g_file_set_attributes_finish (_data_->_tmp17_, _data_->_res_, NULL, &_data_->_inner_error_); |
1.4.8
by Michael Biebl
Import upstream version 3.2.1 |
528 |
if (_data_->_inner_error_ != NULL) { |
529 |
_g_free0 (_data_->state_str); |
|
530 |
_g_object_unref0 (_data_->file_info); |
|
531 |
goto __catch0_g_error; |
|
532 |
}
|
|
533 |
_g_free0 (_data_->state_str); |
|
534 |
_g_object_unref0 (_data_->file_info); |
|
535 |
}
|
|
536 |
goto __finally0; |
|
537 |
__catch0_g_error: |
|
538 |
{
|
|
539 |
_data_->e = _data_->_inner_error_; |
|
540 |
_data_->_inner_error_ = NULL; |
|
1.7.2
by Sjoerd Simons
Import upstream version 3.10.1 |
541 |
_data_->_tmp19_ = NULL; |
1.5.10
by Iain Lane
Import upstream version 3.6.3 |
542 |
_data_->_tmp19_ = _data_->e; |
1.7.2
by Sjoerd Simons
Import upstream version 3.10.1 |
543 |
_data_->_tmp20_ = NULL; |
1.5.10
by Iain Lane
Import upstream version 3.6.3 |
544 |
_data_->_tmp20_ = _data_->_tmp19_->message; |
545 |
g_warning ("totem-rotation-plugin.vala:145: Could not store file attribute: %s", _data_->_tmp20_); |
|
1.4.8
by Michael Biebl
Import upstream version 3.2.1 |
546 |
_g_error_free0 (_data_->e); |
547 |
}
|
|
548 |
__finally0: |
|
549 |
if (_data_->_inner_error_ != NULL) { |
|
550 |
_g_object_unref0 (_data_->file); |
|
551 |
_g_free0 (_data_->mrl); |
|
552 |
_g_object_unref0 (_data_->t); |
|
553 |
g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code); |
|
554 |
g_clear_error (&_data_->_inner_error_); |
|
555 |
return FALSE; |
|
556 |
}
|
|
557 |
_g_object_unref0 (_data_->file); |
|
558 |
_g_free0 (_data_->mrl); |
|
559 |
_g_object_unref0 (_data_->t); |
|
560 |
if (_data_->_state_ == 0) { |
|
561 |
g_simple_async_result_complete_in_idle (_data_->_async_result); |
|
562 |
} else { |
|
563 |
g_simple_async_result_complete (_data_->_async_result); |
|
564 |
}
|
|
565 |
g_object_unref (_data_->_async_result); |
|
566 |
return FALSE; |
|
567 |
}
|
|
568 |
||
569 |
||
570 |
static void rotation_plugin_try_restore_state_data_free (gpointer _data) { |
|
571 |
RotationPluginTryRestoreStateData* _data_; |
|
572 |
_data_ = _data; |
|
573 |
_g_free0 (_data_->mrl); |
|
574 |
_g_object_unref0 (_data_->self); |
|
575 |
g_slice_free (RotationPluginTryRestoreStateData, _data_); |
|
576 |
}
|
|
577 |
||
578 |
||
579 |
static void rotation_plugin_try_restore_state (RotationPlugin* self, const gchar* mrl, GAsyncReadyCallback _callback_, gpointer _user_data_) { |
|
580 |
RotationPluginTryRestoreStateData* _data_; |
|
1.7.2
by Sjoerd Simons
Import upstream version 3.10.1 |
581 |
RotationPlugin* _tmp0_ = NULL; |
582 |
const gchar* _tmp1_ = NULL; |
|
583 |
gchar* _tmp2_ = NULL; |
|
1.4.8
by Michael Biebl
Import upstream version 3.2.1 |
584 |
_data_ = g_slice_new0 (RotationPluginTryRestoreStateData); |
585 |
_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, rotation_plugin_try_restore_state); |
|
586 |
g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, rotation_plugin_try_restore_state_data_free); |
|
587 |
_tmp0_ = _g_object_ref0 (self); |
|
588 |
_data_->self = _tmp0_; |
|
589 |
_tmp1_ = mrl; |
|
590 |
_tmp2_ = g_strdup (_tmp1_); |
|
1.5.11
by Sjoerd Simons
Import upstream version 3.7.93 |
591 |
_g_free0 (_data_->mrl); |
1.4.8
by Michael Biebl
Import upstream version 3.2.1 |
592 |
_data_->mrl = _tmp2_; |
593 |
rotation_plugin_try_restore_state_co (_data_); |
|
594 |
}
|
|
595 |
||
596 |
||
597 |
static void rotation_plugin_try_restore_state_finish (RotationPlugin* self, GAsyncResult* _res_) { |
|
598 |
RotationPluginTryRestoreStateData* _data_; |
|
599 |
_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_)); |
|
600 |
}
|
|
601 |
||
602 |
||
603 |
static void rotation_plugin_try_restore_state_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) { |
|
604 |
RotationPluginTryRestoreStateData* _data_; |
|
605 |
_data_ = _user_data_; |
|
606 |
_data_->_source_object_ = source_object; |
|
607 |
_data_->_res_ = _res_; |
|
608 |
rotation_plugin_try_restore_state_co (_data_); |
|
609 |
}
|
|
610 |
||
611 |
||
612 |
static guint64 uint64_parse (const gchar* str) { |
|
613 |
guint64 result = 0ULL; |
|
1.7.2
by Sjoerd Simons
Import upstream version 3.10.1 |
614 |
const gchar* _tmp0_ = NULL; |
1.4.8
by Michael Biebl
Import upstream version 3.2.1 |
615 |
guint64 _tmp1_ = 0ULL; |
616 |
g_return_val_if_fail (str != NULL, 0ULL); |
|
617 |
_tmp0_ = str; |
|
618 |
_tmp1_ = g_ascii_strtoull (_tmp0_, NULL, (guint) 0); |
|
619 |
result = _tmp1_; |
|
620 |
return result; |
|
621 |
}
|
|
622 |
||
623 |
||
624 |
static gboolean rotation_plugin_try_restore_state_co (RotationPluginTryRestoreStateData* _data_) { |
|
625 |
switch (_data_->_state_) { |
|
626 |
case 0: |
|
627 |
goto _state_0; |
|
628 |
case 1: |
|
629 |
goto _state_1; |
|
630 |
default: |
|
631 |
g_assert_not_reached (); |
|
632 |
}
|
|
633 |
_state_0: |
|
1.7.2
by Sjoerd Simons
Import upstream version 3.10.1 |
634 |
_data_->_tmp0_ = NULL; |
1.4.8
by Michael Biebl
Import upstream version 3.2.1 |
635 |
_data_->_tmp0_ = _data_->mrl; |
636 |
_data_->_tmp1_ = NULL; |
|
637 |
_data_->_tmp1_ = g_file_new_for_uri (_data_->_tmp0_); |
|
638 |
_data_->file = _data_->_tmp1_; |
|
1.7.2
by Sjoerd Simons
Import upstream version 3.10.1 |
639 |
_data_->_tmp3_ = NULL; |
640 |
_data_->_tmp3_ = _data_->file; |
|
641 |
_data_->_tmp4_ = FALSE; |
|
642 |
_data_->_tmp4_ = g_file_has_uri_scheme (_data_->_tmp3_, "http"); |
|
643 |
if (_data_->_tmp4_) { |
|
644 |
_data_->_tmp2_ = TRUE; |
|
645 |
} else { |
|
646 |
_data_->_tmp5_ = NULL; |
|
647 |
_data_->_tmp5_ = _data_->file; |
|
648 |
_data_->_tmp6_ = FALSE; |
|
649 |
_data_->_tmp6_ = g_file_has_uri_scheme (_data_->_tmp5_, "dvd"); |
|
650 |
_data_->_tmp2_ = _data_->_tmp6_; |
|
651 |
}
|
|
652 |
_data_->_tmp7_ = FALSE; |
|
653 |
_data_->_tmp7_ = _data_->_tmp2_; |
|
654 |
if (_data_->_tmp7_) { |
|
655 |
_g_object_unref0 (_data_->file); |
|
656 |
if (_data_->_state_ == 0) { |
|
657 |
g_simple_async_result_complete_in_idle (_data_->_async_result); |
|
658 |
} else { |
|
659 |
g_simple_async_result_complete (_data_->_async_result); |
|
660 |
}
|
|
661 |
g_object_unref (_data_->_async_result); |
|
662 |
return FALSE; |
|
663 |
}
|
|
1.4.8
by Michael Biebl
Import upstream version 3.2.1 |
664 |
{
|
1.7.2
by Sjoerd Simons
Import upstream version 3.10.1 |
665 |
_data_->_tmp8_ = NULL; |
666 |
_data_->_tmp8_ = _data_->file; |
|
1.4.8
by Michael Biebl
Import upstream version 3.2.1 |
667 |
_data_->_state_ = 1; |
1.7.2
by Sjoerd Simons
Import upstream version 3.10.1 |
668 |
g_file_query_info_async (_data_->_tmp8_, GIO_ROTATION_FILE_ATTRIBUTE, G_FILE_QUERY_INFO_NONE, G_PRIORITY_DEFAULT, NULL, rotation_plugin_try_restore_state_ready, _data_); |
1.4.8
by Michael Biebl
Import upstream version 3.2.1 |
669 |
return FALSE; |
670 |
_state_1: |
|
1.7.2
by Sjoerd Simons
Import upstream version 3.10.1 |
671 |
_data_->_tmp9_ = NULL; |
672 |
_data_->_tmp9_ = g_file_query_info_finish (_data_->_tmp8_, _data_->_res_, &_data_->_inner_error_); |
|
673 |
_data_->file_info = _data_->_tmp9_; |
|
1.4.8
by Michael Biebl
Import upstream version 3.2.1 |
674 |
if (_data_->_inner_error_ != NULL) { |
675 |
goto __catch1_g_error; |
|
676 |
}
|
|
1.7.2
by Sjoerd Simons
Import upstream version 3.10.1 |
677 |
_data_->_tmp10_ = NULL; |
678 |
_data_->_tmp10_ = _data_->file_info; |
|
679 |
_data_->_tmp11_ = NULL; |
|
680 |
_data_->_tmp11_ = g_file_info_get_attribute_string (_data_->_tmp10_, GIO_ROTATION_FILE_ATTRIBUTE); |
|
681 |
_data_->_tmp12_ = NULL; |
|
682 |
_data_->_tmp12_ = g_strdup (_data_->_tmp11_); |
|
683 |
_data_->state_str = _data_->_tmp12_; |
|
684 |
_data_->_tmp13_ = NULL; |
|
685 |
_data_->_tmp13_ = _data_->state_str; |
|
686 |
if (_data_->_tmp13_ != NULL) { |
|
687 |
_data_->_tmp14_ = NULL; |
|
688 |
_data_->_tmp14_ = _data_->state_str; |
|
689 |
_data_->_tmp15_ = 0ULL; |
|
690 |
_data_->_tmp15_ = uint64_parse (_data_->_tmp14_); |
|
691 |
_data_->state = (gint) ((BvwRotation) _data_->_tmp15_); |
|
692 |
_data_->_tmp16_ = NULL; |
|
693 |
_data_->_tmp16_ = _data_->self->priv->bvw; |
|
694 |
_data_->_tmp17_ = 0; |
|
695 |
_data_->_tmp17_ = _data_->state; |
|
696 |
bacon_video_widget_set_rotation (_data_->_tmp16_, (BvwRotation) _data_->_tmp17_); |
|
1.4.8
by Michael Biebl
Import upstream version 3.2.1 |
697 |
}
|
698 |
_g_free0 (_data_->state_str); |
|
699 |
_g_object_unref0 (_data_->file_info); |
|
700 |
}
|
|
701 |
goto __finally1; |
|
702 |
__catch1_g_error: |
|
703 |
{
|
|
704 |
_data_->e = _data_->_inner_error_; |
|
705 |
_data_->_inner_error_ = NULL; |
|
1.7.2
by Sjoerd Simons
Import upstream version 3.10.1 |
706 |
_data_->_tmp18_ = NULL; |
707 |
_data_->_tmp18_ = _data_->e; |
|
708 |
_data_->_tmp19_ = NULL; |
|
709 |
_data_->_tmp19_ = _data_->_tmp18_->message; |
|
710 |
g_warning ("totem-rotation-plugin.vala:163: Could not query file attribute: %s", _data_->_tmp19_); |
|
1.4.8
by Michael Biebl
Import upstream version 3.2.1 |
711 |
_g_error_free0 (_data_->e); |
712 |
}
|
|
713 |
__finally1: |
|
714 |
if (_data_->_inner_error_ != NULL) { |
|
715 |
_g_object_unref0 (_data_->file); |
|
716 |
g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code); |
|
717 |
g_clear_error (&_data_->_inner_error_); |
|
718 |
return FALSE; |
|
719 |
}
|
|
720 |
_g_object_unref0 (_data_->file); |
|
721 |
if (_data_->_state_ == 0) { |
|
722 |
g_simple_async_result_complete_in_idle (_data_->_async_result); |
|
723 |
} else { |
|
724 |
g_simple_async_result_complete (_data_->_async_result); |
|
725 |
}
|
|
726 |
g_object_unref (_data_->_async_result); |
|
727 |
return FALSE; |
|
728 |
}
|
|
729 |
||
730 |
||
731 |
RotationPlugin* rotation_plugin_construct (GType object_type) { |
|
732 |
RotationPlugin * self = NULL; |
|
733 |
self = (RotationPlugin*) g_object_new (object_type, NULL); |
|
734 |
return self; |
|
735 |
}
|
|
736 |
||
737 |
||
738 |
RotationPlugin* rotation_plugin_new (void) { |
|
739 |
return rotation_plugin_construct (TYPE_ROTATION_PLUGIN); |
|
740 |
}
|
|
741 |
||
742 |
||
1.4.9
by Michael Biebl
Import upstream version 3.4.2 |
743 |
static GObject* rotation_plugin_real_get_object (PeasActivatable* base) { |
1.4.8
by Michael Biebl
Import upstream version 3.2.1 |
744 |
GObject* result; |
1.4.9
by Michael Biebl
Import upstream version 3.4.2 |
745 |
RotationPlugin* self; |
1.7.2
by Sjoerd Simons
Import upstream version 3.10.1 |
746 |
GObject* _tmp0_ = NULL; |
747 |
GObject* _tmp1_ = NULL; |
|
1.4.9
by Michael Biebl
Import upstream version 3.4.2 |
748 |
self = (RotationPlugin*) base; |
1.4.8
by Michael Biebl
Import upstream version 3.2.1 |
749 |
_tmp0_ = self->priv->_object; |
1.4.9
by Michael Biebl
Import upstream version 3.4.2 |
750 |
_tmp1_ = _g_object_ref0 (_tmp0_); |
751 |
result = _tmp1_; |
|
1.4.8
by Michael Biebl
Import upstream version 3.2.1 |
752 |
return result; |
753 |
}
|
|
754 |
||
755 |
||
1.4.9
by Michael Biebl
Import upstream version 3.4.2 |
756 |
static void rotation_plugin_real_set_object (PeasActivatable* base, GObject* value) { |
757 |
RotationPlugin* self; |
|
1.7.2
by Sjoerd Simons
Import upstream version 3.10.1 |
758 |
GObject* _tmp0_ = NULL; |
759 |
GObject* _tmp1_ = NULL; |
|
1.4.9
by Michael Biebl
Import upstream version 3.4.2 |
760 |
self = (RotationPlugin*) base; |
1.4.8
by Michael Biebl
Import upstream version 3.2.1 |
761 |
_tmp0_ = value; |
1.4.9
by Michael Biebl
Import upstream version 3.4.2 |
762 |
_tmp1_ = _g_object_ref0 (_tmp0_); |
763 |
_g_object_unref0 (self->priv->_object); |
|
764 |
self->priv->_object = _tmp1_; |
|
1.4.8
by Michael Biebl
Import upstream version 3.2.1 |
765 |
g_object_notify ((GObject *) self, "object"); |
766 |
}
|
|
767 |
||
768 |
||
769 |
static void rotation_plugin_class_init (RotationPluginClass * klass) { |
|
770 |
rotation_plugin_parent_class = g_type_class_peek_parent (klass); |
|
771 |
g_type_class_add_private (klass, sizeof (RotationPluginPrivate)); |
|
772 |
G_OBJECT_CLASS (klass)->get_property = _vala_rotation_plugin_get_property; |
|
773 |
G_OBJECT_CLASS (klass)->set_property = _vala_rotation_plugin_set_property; |
|
774 |
G_OBJECT_CLASS (klass)->finalize = rotation_plugin_finalize; |
|
1.5.9
by Robert Ancell
Import upstream version 3.4.3 |
775 |
g_object_class_install_property (G_OBJECT_CLASS (klass), ROTATION_PLUGIN_OBJECT, g_param_spec_object ("object", "object", "object", G_TYPE_OBJECT, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); |
1.4.8
by Michael Biebl
Import upstream version 3.2.1 |
776 |
}
|
777 |
||
778 |
||
779 |
static void rotation_plugin_peas_activatable_interface_init (PeasActivatableInterface * iface) { |
|
780 |
rotation_plugin_peas_activatable_parent_iface = g_type_interface_peek_parent (iface); |
|
781 |
iface->activate = (void (*)(PeasActivatable*)) rotation_plugin_real_activate; |
|
782 |
iface->deactivate = (void (*)(PeasActivatable*)) rotation_plugin_real_deactivate; |
|
783 |
iface->update_state = (void (*)(PeasActivatable*)) rotation_plugin_real_update_state; |
|
784 |
}
|
|
785 |
||
786 |
||
787 |
static void rotation_plugin_instance_init (RotationPlugin * self) { |
|
788 |
self->priv = ROTATION_PLUGIN_GET_PRIVATE (self); |
|
1.5.10
by Iain Lane
Import upstream version 3.6.3 |
789 |
self->priv->bvw = NULL; |
1.4.8
by Michael Biebl
Import upstream version 3.2.1 |
790 |
}
|
791 |
||
792 |
||
793 |
static void rotation_plugin_finalize (GObject* obj) { |
|
794 |
RotationPlugin * self; |
|
1.5.10
by Iain Lane
Import upstream version 3.6.3 |
795 |
self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_ROTATION_PLUGIN, RotationPlugin); |
1.4.9
by Michael Biebl
Import upstream version 3.4.2 |
796 |
_g_object_unref0 (self->priv->_object); |
1.5.10
by Iain Lane
Import upstream version 3.6.3 |
797 |
_g_object_unref0 (self->priv->bvw); |
1.4.8
by Michael Biebl
Import upstream version 3.2.1 |
798 |
_g_object_unref0 (self->priv->action_group); |
799 |
G_OBJECT_CLASS (rotation_plugin_parent_class)->finalize (obj); |
|
800 |
}
|
|
801 |
||
802 |
||
803 |
GType rotation_plugin_get_type (void) { |
|
804 |
return rotation_plugin_type_id; |
|
805 |
}
|
|
806 |
||
807 |
||
808 |
GType rotation_plugin_register_type (GTypeModule * module) { |
|
809 |
static const GTypeInfo g_define_type_info = { sizeof (RotationPluginClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) rotation_plugin_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (RotationPlugin), 0, (GInstanceInitFunc) rotation_plugin_instance_init, NULL }; |
|
810 |
static const GInterfaceInfo peas_activatable_info = { (GInterfaceInitFunc) rotation_plugin_peas_activatable_interface_init, (GInterfaceFinalizeFunc) NULL, NULL}; |
|
811 |
rotation_plugin_type_id = g_type_module_register_type (module, G_TYPE_OBJECT, "RotationPlugin", &g_define_type_info, 0); |
|
812 |
g_type_module_add_interface (module, rotation_plugin_type_id, peas_activatable_get_type (), &peas_activatable_info); |
|
813 |
return rotation_plugin_type_id; |
|
814 |
}
|
|
815 |
||
816 |
||
817 |
static void _vala_rotation_plugin_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) { |
|
818 |
RotationPlugin * self; |
|
1.5.10
by Iain Lane
Import upstream version 3.6.3 |
819 |
self = G_TYPE_CHECK_INSTANCE_CAST (object, TYPE_ROTATION_PLUGIN, RotationPlugin); |
1.4.8
by Michael Biebl
Import upstream version 3.2.1 |
820 |
switch (property_id) { |
821 |
case ROTATION_PLUGIN_OBJECT: |
|
1.4.9
by Michael Biebl
Import upstream version 3.4.2 |
822 |
g_value_take_object (value, rotation_plugin_real_get_object ((PeasActivatable*) self)); |
1.4.8
by Michael Biebl
Import upstream version 3.2.1 |
823 |
break; |
824 |
default: |
|
825 |
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); |
|
826 |
break; |
|
827 |
}
|
|
828 |
}
|
|
829 |
||
830 |
||
831 |
static void _vala_rotation_plugin_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) { |
|
832 |
RotationPlugin * self; |
|
1.5.10
by Iain Lane
Import upstream version 3.6.3 |
833 |
self = G_TYPE_CHECK_INSTANCE_CAST (object, TYPE_ROTATION_PLUGIN, RotationPlugin); |
1.4.8
by Michael Biebl
Import upstream version 3.2.1 |
834 |
switch (property_id) { |
835 |
case ROTATION_PLUGIN_OBJECT: |
|
1.4.9
by Michael Biebl
Import upstream version 3.4.2 |
836 |
rotation_plugin_real_set_object ((PeasActivatable*) self, g_value_get_object (value)); |
1.4.8
by Michael Biebl
Import upstream version 3.2.1 |
837 |
break; |
838 |
default: |
|
839 |
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); |
|
840 |
break; |
|
841 |
}
|
|
842 |
}
|
|
843 |
||
844 |
||
845 |
void peas_register_types (GTypeModule* module) { |
|
1.7.1
by Jeremy Bicha
Import upstream version 3.8.2 |
846 |
PeasObjectModule* objmodule = NULL; |
1.7.2
by Sjoerd Simons
Import upstream version 3.10.1 |
847 |
GTypeModule* _tmp0_ = NULL; |
848 |
PeasObjectModule* _tmp1_ = NULL; |
|
1.4.8
by Michael Biebl
Import upstream version 3.2.1 |
849 |
g_return_if_fail (module != NULL); |
850 |
rotation_plugin_register_type (module); |
|
851 |
_tmp0_ = module; |
|
1.5.10
by Iain Lane
Import upstream version 3.6.3 |
852 |
_tmp1_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp0_, peas_object_module_get_type ()) ? ((PeasObjectModule*) _tmp0_) : NULL); |
1.4.8
by Michael Biebl
Import upstream version 3.2.1 |
853 |
objmodule = _tmp1_; |
854 |
peas_object_module_register_extension_type (objmodule, peas_activatable_get_type (), TYPE_ROTATION_PLUGIN); |
|
855 |
_g_object_unref0 (objmodule); |
|
856 |
}
|
|
857 |
||
858 |
||
859 |