~ken-vandine/libindicate/with_mono_and_python_bindings-packaging

« back to all changes in this revision

Viewing changes to tests/test-indicator-display-server.c

  • Committer: Ken VanDine
  • Date: 2009-09-10 14:39:40 UTC
  • mfrom: (223.2.6 ubuntu)
  • Revision ID: ken.vandine@canonical.com-20090910143940-wjoeay60p7mfhhca
* New upstream release (LP: #427364)
  - Big change is renaming some signal names. :(
  - Bug fixes in getting properties.
  - Removing looking at the type on indicator lists.
  - Fixing the count callback.
* debian/control:
  - Increasing library versions to libindicate3
    and libindicate-gtk1.  Moving .install files as well.
* libindicate-dev and libindicate-gtk-dev.install change to
  /usr/include/libindicate-0.2 from 0.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
 
 
2
#include <glib.h>
 
3
#include "libindicate/listener.h"
 
4
#include "test-max-indicators-list.h"
 
5
 
 
6
static gboolean passed = TRUE;
 
7
static GMainLoop * mainloop = NULL;
 
8
 
 
9
 
 
10
static void
 
11
indicator_added (IndicateListener * listener, IndicateListenerServer * server, IndicateListenerIndicator * indicator, gpointer data)
 
12
{
 
13
        return indicate_listener_displayed(listener, server, indicator, TRUE);
 
14
}
 
15
 
 
16
static gboolean
 
17
failed_cb (gpointer data)
 
18
{
 
19
        g_debug("Done indicatating displayed");
 
20
        g_main_loop_quit(mainloop);
 
21
        return FALSE;
 
22
}
 
23
 
 
24
static void
 
25
server_removed (void)
 
26
{
 
27
        g_debug("Server went away, exiting.");
 
28
        g_main_loop_quit(mainloop);
 
29
        return;
 
30
}
 
31
 
 
32
int
 
33
main (int argc, char * argv)
 
34
{
 
35
        g_type_init();
 
36
 
 
37
        IndicateListener * listener = indicate_listener_ref_default();
 
38
 
 
39
        g_signal_connect(listener, INDICATE_LISTENER_SIGNAL_INDICATOR_ADDED, G_CALLBACK(indicator_added), NULL);
 
40
        g_signal_connect(listener, INDICATE_LISTENER_SIGNAL_SERVER_REMOVED, G_CALLBACK(server_removed), NULL);
 
41
 
 
42
        g_timeout_add_seconds(2, failed_cb, NULL);
 
43
 
 
44
        mainloop = g_main_loop_new(NULL, FALSE);
 
45
        g_main_loop_run(mainloop);
 
46
 
 
47
        return !passed;
 
48
}