summaryrefslogtreecommitdiffstats
path: root/src/applet/applet_gtk.h
blob: 0bcf47b703aad8561defd95c2a46b84fe7ea339b (plain)
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
/*
    Copyright (C) 2009  Jiri Moskovcak (jmoskovc@redhat.com)
    Copyright (C) 2009  RedHat inc.

    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License along
    with this program; if not, write to the Free Software Foundation, Inc.,
    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#ifndef CC_APPLET_H_
#define CC_APPLET_H_

#include <gtk/gtk.h>
#include <libnotify/notify.h>

enum ICON_STAGES
{
    ICON_DEFAULT,
    ICON_STAGE1,
    ICON_STAGE2,
    ICON_STAGE3,
    ICON_STAGE4,
    ICON_STAGE5,
    /* this must be always the last */
    ICON_STAGE_LAST
};

#ifdef __cplusplus
extern "C" {
#endif

struct applet {
    GtkStatusIcon *ap_status_icon;
    GtkWidget *ap_menu;
    bool ap_daemon_running;
    int ap_animation_stage;
    guint ap_animator;
    unsigned ap_anim_countdown;
    bool ap_icons_loaded;
    const char *ap_last_crash_id;
    GdkPixbuf *ap_icon_stages_buff[ICON_STAGE_LAST];
};

struct applet* applet_new(const char *app_name);
void applet_destroy(struct applet *applet);

void show_icon(struct applet *applet);
void hide_icon(struct applet *applet);
void set_icon_tooltip(struct applet *applet, const char *format, ...);
void show_crash_notification(struct applet *applet, const char* crash_id, const char *format, ...);
void show_msg_notification(struct applet *applet, const char *format, ...);
void disable(struct applet *applet, const char *reason);
void enable(struct applet *applet, const char *reason);

#ifdef __cplusplus
}
#endif

#endif