~ubuntu-branches/ubuntu/utopic/awn-extras-applets/utopic

« back to all changes in this revision

Viewing changes to src/libawn-extras/awn-extras.h

  • Committer: Bazaar Package Importer
  • Author(s): Julien Lavergne
  • Date: 2010-01-13 21:50:33 UTC
  • mfrom: (1.1.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20100113215033-kd9otcdjrajmiag0
Tags: 0.3.9~bzr1944-0ubuntu1
* New upstream snapshot.
 - Catch error in weather applet (LP: #359668)
* debian/patches: Refresh.
* debian/*.install: 
 - Update to new location and new applets.
 - Disable dialect applet until python-xklavier is in the archive.
 - Disable MiMenu and Pandora applets, there are unmaintained and not stable.
* debian/awn-applets-c-core: Dropped, not needed.
* debian/control:
 - Update description with new applets.
 - Remove libawn-extras and python-awnlib, all merged in python-awn-extras.
 - Replace awn-manager by awn-settings.
 - Drop build-depends on libgnome-desktop-dev, python*-dev, python2.5,
   awn-manager, libglade2-dev and libgnomeui-dev.
 - Add build-depends on libdesktop-agnostic-bin and vala-awn.
 - Bump build-depends of libawn-dev (>= 0.3.9~bzr1890), valac (>= 0.7.7) and
   debhelper (>= 7.0.50~).
 - Bump Standards-Version to 3.8.3 (no change needed).
 - Demote gconf-editor to Suggest, it's only needed for very advanced
   settings.
 - Update Recommends for python applets with new applets.
 - Suggest python-gconf for notification-area and alacarte for YAMA.
 - Add a debug package for C applets.
* debian/libawn-extras*: Removed, libawn-extras was removed upstream.
* debian/python-awnlib*: Merged with python-awn-extras.
* debian/rules:
 - Rewrite to use overrides.
* debian/copyright:
 - Update copyright and licenses.
* debian/README.source: Added.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 * Copyright (c) 2007   Rodney (moonbeam) Cryderman <rcryderman@gmail.com>
3
 
 *
4
 
 * urlencdoe and urldecode Copyright (C) 2001-2002 Open Source Telecom Corporation.
5
 
 *
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.
10
 
 *
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.
15
 
 *
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.
20
 
 */
21
 
 
22
 
 
23
 
#ifndef _AWN_EXTRS_UTIL
24
 
#define _AWN_EXTRS_UTIL
25
 
 
26
 
#include <libawn/awn-cairo-utils.h>
27
 
#include <libawn/awn-applet.h>
28
 
#include <libawn/awn-applet-simple.h>
29
 
#include <gtk/gtk.h>
30
 
#include <string.h>
31
 
#include <gdk/gdk.h>
32
 
#include <glib.h>
33
 
#include <libnotify/notify.h>
34
 
 
35
 
char *urlencode(const char *source, char *dest, unsigned max);
36
 
char *urldecode(char *source, char *dest);
37
 
 
38
 
/*
39
 
surface_2_pixbuf
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.
42
 
*/
43
 
GdkPixbuf * surface_2_pixbuf( GdkPixbuf * pixbuf, cairo_surface_t * surface);
44
 
GdkPixbuf * get_pixbuf_from_surface(cairo_surface_t * surface);
45
 
 
46
 
/* 
47
 
awncolor_to_string
48
 
        Given an AwnColor argument returns an allocated string in the form of RRGGBBAA
49
 
*/
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);
53
 
 
54
 
/*
55
 
void notify_message
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       
62
 
*/
63
 
gboolean notify_message(gchar * summary, gchar * body,gchar * icon_str,glong timeout);
64
 
/*
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.
71
 
        
72
 
Implementation Notes:
73
 
        -Uses fork()
74
 
*/
75
 
void notify_message_async(gchar * summary, gchar * body,gchar * icon_str,glong timeout);
76
 
/*
77
 
void notify_message
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       
86
 
*/
87
 
void notify_message_extended(gchar * summary, gchar * body,gchar * icon_str,NotifyUrgency urgency,glong timeout,GError **perror);
88
 
 
89
 
 
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")
93
 
 
94
 
/* 
95
 
share_config_bool
96
 
        returns a boolean shared configuration key.
97
 
*/
98
 
 
99
 
gboolean share_config_bool(const gchar * key);
100
 
 
101
 
/*
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
108
 
*
109
 
*  Returns:
110
 
*    A gtk_menu_item or NULL if the generic applet preferences configuration is
111
 
*    disabled
112
 
*
113
 
*  Notes:
114
 
*    There is no need to attach the returned item to a
115
 
*  signal as this is handled by the function.
116
 
*/
117
 
GtkWidget *shared_menuitem_create_applet_prefs(gchar *instance,gchar *baseconf,
118
 
                                              gchar * applet_name);
119
 
 
120
 
 
121
 
/*Setting the acceptable values starting at 10... makes it rather unlikely
122
 
that someone can specify a license type by accident.*/
123
 
typedef enum
124
 
{
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
129
 
}AwnAppletLicense;
130
 
 
131
 
/* 
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.
135
 
*  Returns:
136
 
*    A about applet gtk_menu_item 
137
 
*/
138
 
GtkWidget *shared_menuitem_about_applet_simple(const gchar * copyright,
139
 
                                        AwnAppletLicense license,
140
 
                                        const gchar * program_name,
141
 
                                        const gchar * version);
142
 
 
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);
155
 
 
156
 
 
157
 
#endif