public
Description: A Clutter-based Twitter client
Homepage: http://live.gnome.org/Tweet
Clone URL: git://github.com/ebassi/tweet.git
Search Repo:
Add TweetApp, an instance for controlling the Tweet application

TweetApp is just an object wrapper for instantiating and running the
main application; in theory, it should set its name on the session
bus and any other instance should check whether the name exist and
then set the is-running field accordingly - thus creating a single
instance application.
Emmanuele Bassi (author)
Fri Apr 11 06:31:50 -0700 2008
commit  e2490767c32668b0d93846e31bd6932cd6d83e9e
tree    0a655dfec9e7a71b5f106e02ef9bccca30461d48
parent  c8a4eb7ad681a507a22930764337453ef41b4020
...
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
0
@@ -1 +1,63 @@
0
+#ifdef HAVE_CONFIG_H
0
+#include "config.h"
0
+#endif
0
+
0
+#include <string.h>
0
+#include <stdlib.h>
0
+
0
+#include <glib.h>
0
+
0
+#include <clutter/clutter.h>
0
+#include <clutter-gtk/clutter-gtk.h>
0
+
0
+#include "tweet-app.h"
0
+
0
+static TweetApp *default_app = NULL;
0
+
0
+G_DEFINE_TYPE (TweetApp, tweet_app, G_TYPE_OBJECT);
0
+
0
+static void
0
+tweet_app_class_init (TweetAppClass *klass)
0
+{
0
+}
0
+
0
+static void
0
+tweet_app_init (TweetApp *app)
0
+{
0
+}
0
+
0
+TweetApp *
0
+tweet_app_get_default (int *argc,
0
+ char ***argv,
0
+ GError **error)
0
+{
0
+ if (!default_app)
0
+ {
0
+ gtk_init (argc, argv);
0
+ clutter_init (argc, argv);
0
+
0
+ default_app = g_object_new (TWEET_TYPE_APP, NULL);
0
+ }
0
+
0
+ return default_app;
0
+}
0
+
0
+gboolean
0
+tweet_app_is_running (TweetApp *app)
0
+{
0
+ g_return_val_if_fail (TWEET_IS_APP (app), FALSE);
0
+
0
+ return app->is_running;
0
+}
0
+
0
+gint
0
+tweet_app_run (TweetApp *app)
0
+{
0
+ g_return_val_if_fail (TWEET_IS_APP (app), EXIT_FAILURE);
0
+ g_return_val_if_fail (tweet_app_is_running (app), EXIT_SUCCESS);
0
+
0
+ gtk_main ();
0
+
0
+ return EXIT_SUCCESS;
0
+}
...
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
0
@@ -1 +1,44 @@
0
+#ifndef __TWEET_APP_H__
0
+#define __TWEET_APP_H__
0
+
0
+#include <glib-object.h>
0
+#include <gtk/gtk.h>
0
+
0
+G_BEGIN_DECLS
0
+
0
+#define TWEET_TYPE_APP (tweet_app_get_type ())
0
+#define TWEET_APP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TWEET_TYPE_APP, TweetApp))
0
+#define TWEET_IS_APP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TWEET_TYPE_APP))
0
+#define TWEET_APP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TWEET_TYPE_APP, TweetAppClass))
0
+#define TWEET_IS_APP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TWEET_TYPE_APP))
0
+#define TWEET_APP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TWEET_TYPE_APP, TweetAppClass))
0
+
0
+typedef struct _TweetApp TweetApp;
0
+typedef struct _TweetAppClass TweetAppClass;
0
+
0
+struct _TweetApp
0
+{
0
+ GObject parent_instance;
0
+
0
+ GtkWidget *main_window;
0
+
0
+ guint is_running : 1;
0
+};
0
+
0
+struct _TweetAppClass
0
+{
0
+ GObjectClass parent_class;
0
+};
0
+
0
+GType tweet_app_get_type (void) G_GNUC_CONST;
0
+
0
+TweetApp *tweet_app_get_default (int *argc,
0
+ char ***argv,
0
+ GError **error);
0
+gboolean tweet_app_is_running (TweetApp *app);
0
+gint tweet_app_run (TweetApp *app);
0
+
0
+G_END_DECLS
0
+
0
+#endif /* __TWEET_APP_H__ */

Comments

    No one has commented yet.