~macslow/notify-osd/mouse-movement-monitor

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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
////////////////////////////////////////////////////////////////////////////////
//3456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
//      10        20        30        40        50        60        70        80
//
// notify-osd
//
// notification.h - notification object storing attributes like title- and body-
//                  text, value, icon, id, sender-pid etc.
//
// Copyright 2009 Canonical Ltd.
//
// Authors:
//    Mirco "MacSlow" Mueller <mirco.mueller@canonical.com>
//
// This program is free software: you can redistribute it and/or modify it
// under the terms of the GNU General Public License version 3, as published
// by the Free Software Foundation.
//
// This program is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranties of
// MERCHANTABILITY, SATISFACTORY QUALITY, 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, see <http://www.gnu.org/licenses/>.
//
////////////////////////////////////////////////////////////////////////////////

#ifndef __NOTIFICATION_H
#define __NOTIFICATION_H

#include <glib-object.h>
#include <gdk-pixbuf/gdk-pixbuf.h>

G_BEGIN_DECLS

#define NOTIFICATION_TYPE            (notification_get_type ())
#define NOTIFICATION(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), NOTIFICATION_TYPE, Notification))
#define NOTIFICATION_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), NOTIFICATION_TYPE, NotificationClass))
#define IS_NOTIFICATION(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NOTIFICATION_TYPE))
#define IS_NOTIFICATION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), NOTIFICATION_TYPE))
#define NOTIFICATION_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), NOTIFICATION_TYPE, NotificationClass))

#define NOTIFICATION_VALUE_MIN_ALLOWED  -1
#define NOTIFICATION_VALUE_MAX_ALLOWED 101

typedef struct _Notification        Notification;
typedef struct _NotificationClass   NotificationClass;
typedef struct _NotificationPrivate NotificationPrivate;

typedef enum
{
	URGENCY_LOW = 0,
	URGENCY_NORMAL,
	URGENCY_HIGH,
	URGENCY_NONE	
} Urgency;

// instance structure
struct _Notification
{
	GObject parent;

	//< private >
	NotificationPrivate* priv;
};

// class structure
struct _NotificationClass
{
	GObjectClass parent;

	//< signals >
};

GType Notification_get_type (void);

Notification*
notification_new ();

gint
notification_get_id (Notification* n);

void
notification_set_id (Notification* n,
		     const gint    id);

gchar*
notification_get_title (Notification* n);

void
notification_set_title (Notification* n,
			const gchar*  title);

gchar*
notification_get_body (Notification* n);

void
notification_set_body (Notification* n,
		       const gchar*  body);

gint
notification_get_value (Notification* n);

void
notification_set_value (Notification* n,
			const gint    value);

gchar*
notification_get_icon_themename (Notification* n);

void
notification_set_icon_themename (Notification* n,
				 const gchar*  icon_themename);

gchar*
notification_get_icon_filename (Notification* n);

void
notification_set_icon_filename (Notification* n,
				const gchar*  icon_filename);

GdkPixbuf*
notification_get_icon_pixbuf (Notification* n);

void
notification_set_icon_pixbuf (Notification*    n,
			      const GdkPixbuf* icon_pixbuf);

gint
notification_get_onscreen_time (Notification* n);

void
notification_set_onscreen_time (Notification* n,
				const gint    onscreen_time);

gchar*
notification_get_sender_name (Notification* n);

void
notification_set_sender_name (Notification* n,
			      const gchar*  sender_name);

gint
notification_get_sender_pid (Notification* n);

void
notification_set_sender_pid (Notification* n,
			     const gint    sender_pid);

GTimeVal*
notification_get_timestamp (Notification* n);

void
notification_set_timestamp (Notification*   n,
			    const GTimeVal* timestamp);

gint
notification_get_urgency (Notification* n);

void
notification_set_urgency (Notification* n,
			  const Urgency urgency);

G_END_DECLS

#endif // __NOTIFICATION_H