2
* Copyright (c) 2007 Rodney (moonbeam) Cryderman <rcryderman@gmail.com>
4
* urlencdoe and urldecode Copyright (C) 2001-2002 Open Source Telecom Corporation.
6
* This library is free software; you can redistribute it and/or
7
* modify it under the terms of the GNU Lesser General Public
8
* License as published by the Free Software Foundation; either
9
* version 2 of the License, or (at your option) any later version.
11
* This library is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14
* Lesser General Public License for more details.
16
* You should have received a copy of the GNU Lesser General Public
17
* License along with this library; if not, write to the
18
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
19
* Boston, MA 02111-1307, USA.
23
#ifndef _AWN_EXTRS_UTIL
24
#define _AWN_EXTRS_UTIL
26
#include <libawn/awn-cairo-utils.h>
27
#include <libawn/awn-applet.h>
28
#include <libawn/awn-applet-simple.h>
33
#include <libnotify/notify.h>
35
char *urlencode(const char *source, char *dest, unsigned max);
36
char *urldecode(char *source, char *dest);
40
-copies a cairo image surface to an allocated pixbuf of the same dimensions.
41
-the heights and width must match. Both must be ARGB.
43
GdkPixbuf * surface_2_pixbuf( GdkPixbuf * pixbuf, cairo_surface_t * surface);
44
GdkPixbuf * get_pixbuf_from_surface(cairo_surface_t * surface);
48
Given an AwnColor argument returns an allocated string in the form of RRGGBBAA
50
gchar * awncolor_to_string(AwnColor * colour);
51
AwnColor gdkcolor_to_awncolor_with_alpha( GdkColor * gdk_color,double alpha);
52
AwnColor gdkcolor_to_awncolor( GdkColor * gdk_colour);
56
Sends a notificication to a notification daemon.
57
summary - message summary.
58
body - body of message
59
icon - full path to icon to display. NULL indicates no icon.
60
timeout - notificiation window timeout in ms. 0 indicates default should be used.
61
returns TRUE on success, FALSE on failure
63
gboolean notify_message(gchar * summary, gchar * body,gchar * icon_str,glong timeout);
65
void notify_message_async
66
Sends a notificication to a notification daemon in an asyncronous manner
67
summary - message summary.
68
body - body of message
69
icon - full path to icon to display. NULL indicates no icon.
70
timeout - notificiation window timeout in ms. 0 indicates default should be used.
75
void notify_message_async(gchar * summary, gchar * body,gchar * icon_str,glong timeout);
78
Sends a notificication to a notification daemon.
79
summary - message summary.
80
body - body of message
81
icon - full path to icon to display. NULL indicates no icon.
82
urgency - Urgency of notification.
83
timeout - notificiation window timeout in ms. 0 indicates default should be used.
84
perror - typical g_error situation.
85
returns TRUE on success, FALSE on failure
87
void notify_message_extended(gchar * summary, gchar * body,gchar * icon_str,NotifyUrgency urgency,glong timeout,GError **perror);
90
#define SHR_KEY_CONFIG_KEY(key) key
91
#define SHR_KEY_FOCUS_LOSS SHR_KEY_CONFIG_KEY("dialog_focus_loss_behavior")
92
#define SHR_KEY_GENERIC_PREFS SHR_KEY_CONFIG_KEY("allow_generic_config_edit")
96
returns a boolean shared configuration key.
99
gboolean share_config_bool(const gchar * key);
102
* Create a menu item that invokes a generic applet preferences dialog.
103
* instance - The folder name containing the configuration key within the applets
104
* configuration folder.
105
* baseconf - If there is a default configuration location that is different than
106
* the instance provided. Otherwise NULL.
107
* applet_name - applet name used to reference the associated schema-ini
110
* A gtk_menu_item or NULL if the generic applet preferences configuration is
114
* There is no need to attach the returned item to a
115
* signal as this is handled by the function.
117
GtkWidget *shared_menuitem_create_applet_prefs(gchar *instance,gchar *baseconf,
118
gchar * applet_name);
121
/*Setting the acceptable values starting at 10... makes it rather unlikely
122
that someone can specify a license type by accident.*/
125
AWN_APPLET_LICENSE_GPLV2=10,
126
AWN_APPLET_LICENSE_GPLV3=11,
127
AWN_APPLET_LICENSE_LGPLV2_1=12,
128
AWN_APPLET_LICENSE_LGPLV3=13
132
* see GtkAboutDialog() for a description of args other than license.
133
* license must be one of the values enumerated in AwnAppletLicense.
134
* copyright,license and program_name are mandatory.
136
* A about applet gtk_menu_item
138
GtkWidget *shared_menuitem_about_applet_simple(const gchar * copyright,
139
AwnAppletLicense license,
140
const gchar * program_name,
141
const gchar * version);
143
GtkWidget *shared_menuitem_about_applet(const gchar * copyright,
144
AwnAppletLicense license,
145
const gchar * program_name,
146
const gchar * version,
147
const gchar * comments,
148
const gchar * website,
149
const gchar * website_label,
150
const gchar * icon_name,
151
const gchar * translator_credits,
152
const gchar **authors,
153
const gchar **artists,
154
const gchar **documenters);