public
Description: A Clutter-based Twitter client
Homepage: http://live.gnome.org/Tweet
Clone URL: git://github.com/ebassi/tweet.git
Emmanuele Bassi (author)
Thu Apr 17 21:45:48 -0700 2008
commit  5eace09ef4f7bdbdde82eae3fc09c618225ab5bb
tree    06b7243880e9e823453c72fb810cddaa129ea439
parent  9a22165ae7c824a7c7948d0869c54a826ac2d526
tweet / src / tweet-app.c
100644 68 lines (51 sloc) 1.218 kb
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
63
64
65
66
67
68
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
 
#include <string.h>
#include <stdlib.h>
 
#include <glib.h>
 
#include <clutter/clutter.h>
#include <clutter-gtk/gtk-clutter-embed.h>
 
#include "tweet-app.h"
#include "tweet-config.h"
#include "tweet-window.h"
 
static TweetApp *default_app = NULL;
 
G_DEFINE_TYPE (TweetApp, tweet_app, G_TYPE_OBJECT);
 
static void
tweet_app_class_init (TweetAppClass *klass)
{
}
 
static void
tweet_app_init (TweetApp *app)
{
  app->config = tweet_config_get_default ();
  app->main_window = tweet_window_new ();
}
 
TweetApp *
tweet_app_get_default (int *argc,
                       char ***argv,
                       GError **error)
{
  if (!default_app)
    {
      g_thread_init (NULL);
      gtk_init (argc, argv);
      clutter_init (argc, argv);
 
      default_app = g_object_new (TWEET_TYPE_APP, NULL);
    }
 
  return default_app;
}
 
gboolean
tweet_app_is_running (TweetApp *app)
{
  g_return_val_if_fail (TWEET_IS_APP (app), FALSE);
 
  return app->is_running;
}
 
gint
tweet_app_run (TweetApp *app)
{
  g_return_val_if_fail (TWEET_IS_APP (app), EXIT_FAILURE);
  g_return_val_if_fail (!tweet_app_is_running (app), EXIT_SUCCESS);
 
  gtk_main ();
 
  return EXIT_SUCCESS;
}