1
/* remote-video-main.c generated by valac 0.20.1, the Vala compiler
2
* generated from remote-video-main.vala, do not modify */
5
* Copyright (C) 2012 Canonical Ltd
7
* This program is free software: you can redistribute it and/or modify
8
* it under the terms of the GNU General Public License version 3 as
9
* published by the Free Software Foundation.
11
* This program is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
* GNU General Public License for more details.
16
* You should have received a copy of the GNU General Public License
17
* along with this program. If not, see <http://www.gnu.org/licenses/>.
21
#include <glib-object.h>
26
#include <glib/gi18n-lib.h>
28
#include <unity-extras.h>
31
#define UNITY_VIDEO_LENS_TYPE_REMOTE_VIDEO_SCOPE (unity_video_lens_remote_video_scope_get_type ())
32
#define UNITY_VIDEO_LENS_REMOTE_VIDEO_SCOPE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), UNITY_VIDEO_LENS_TYPE_REMOTE_VIDEO_SCOPE, UnityVideoLensRemoteVideoScope))
33
#define UNITY_VIDEO_LENS_REMOTE_VIDEO_SCOPE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), UNITY_VIDEO_LENS_TYPE_REMOTE_VIDEO_SCOPE, UnityVideoLensRemoteVideoScopeClass))
34
#define UNITY_VIDEO_LENS_IS_REMOTE_VIDEO_SCOPE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), UNITY_VIDEO_LENS_TYPE_REMOTE_VIDEO_SCOPE))
35
#define UNITY_VIDEO_LENS_IS_REMOTE_VIDEO_SCOPE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), UNITY_VIDEO_LENS_TYPE_REMOTE_VIDEO_SCOPE))
36
#define UNITY_VIDEO_LENS_REMOTE_VIDEO_SCOPE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), UNITY_VIDEO_LENS_TYPE_REMOTE_VIDEO_SCOPE, UnityVideoLensRemoteVideoScopeClass))
38
typedef struct _UnityVideoLensRemoteVideoScope UnityVideoLensRemoteVideoScope;
39
typedef struct _UnityVideoLensRemoteVideoScopeClass UnityVideoLensRemoteVideoScopeClass;
40
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
41
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
44
extern UnityDeprecatedScope* unity_video_lens_scope;
45
UnityDeprecatedScope* unity_video_lens_scope = NULL;
46
extern GApplication* unity_video_lens_app;
47
GApplication* unity_video_lens_app = NULL;
49
#define UNITY_VIDEO_LENS_BUS_NAME "net.launchpad.scope.YoukuVideos"
50
gint unity_video_lens_main (gchar** args, int args_length1);
51
#define CONFIG_PACKAGE "unity-china-video-scope"
52
#define CONFIG_LOCALEDIR "/usr/share/locale"
53
static void ___lambda2_ (void);
54
UnityVideoLensRemoteVideoScope* unity_video_lens_remote_video_scope_new (void);
55
UnityVideoLensRemoteVideoScope* unity_video_lens_remote_video_scope_construct (GType object_type);
56
GType unity_video_lens_remote_video_scope_get_type (void) G_GNUC_CONST;
57
static void ____lambda2__unity_extras_create_scope_callback (gpointer self);
60
static void ___lambda2_ (void) {
61
UnityVideoLensRemoteVideoScope* _tmp0_;
62
UnityDeprecatedScope* _tmp1_;
63
GError * _inner_error_ = NULL;
64
_tmp0_ = unity_video_lens_remote_video_scope_new ();
65
_g_object_unref0 (unity_video_lens_scope);
66
unity_video_lens_scope = (UnityDeprecatedScope*) _tmp0_;
67
_tmp1_ = unity_video_lens_scope;
68
unity_deprecated_scope_base_export ((UnityDeprecatedScopeBase*) _tmp1_, &_inner_error_);
69
if (_inner_error_ != NULL) {
70
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);
71
g_clear_error (&_inner_error_);
77
static void ____lambda2__unity_extras_create_scope_callback (gpointer self) {
82
gint unity_video_lens_main (gchar** args, int args_length1) {
87
GError * _inner_error_ = NULL;
88
g_set_prgname ("unity-remote-video-scope");
89
textdomain (CONFIG_PACKAGE);
90
bindtextdomain (CONFIG_PACKAGE, CONFIG_LOCALEDIR);
91
bind_textdomain_codeset (CONFIG_PACKAGE, "UTF-8");
92
setlocale (LC_ALL, "");
94
GApplication* _tmp0_ = NULL;
96
_tmp0_ = unity_extras_dbus_own_name (UNITY_VIDEO_LENS_BUS_NAME, ____lambda2__unity_extras_create_scope_callback, NULL, &_inner_error_);
98
if (_inner_error_ != NULL) {
99
goto __catch0_g_error;
101
_g_object_unref0 (unity_video_lens_app);
102
unity_video_lens_app = _tmp1_;
111
_inner_error_ = NULL;
113
_tmp3_ = _tmp2_->message;
114
g_warning ("remote-video-main.vala:47: Failed to start video lens daemon: %s\n", _tmp3_);
120
if (_inner_error_ != NULL) {
121
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);
122
g_clear_error (&_inner_error_);
125
_tmp4_ = unity_video_lens_app;
126
if (_tmp4_ == NULL) {
127
g_warning ("remote-video-main.vala:53: %s", "Another instance of the Unity Videos Lens " "already appears to be running.\nBailing out.\n");
131
_tmp5_ = unity_video_lens_app;
132
_tmp6_ = g_application_run (_tmp5_, 0, NULL);
138
int main (int argc, char ** argv) {
140
return unity_video_lens_main (argv, argc);