annotate src/aosd/aosd_osd.c @ 1484:97914b65790a

[security] Add g_thread_exit() to curl_manage_request() to avoid a resource starvation DoS. Incorrectly reported as a followup to Debian #435557.
author William Pitcock <nenolod@atheme-project.org>
date Mon, 13 Aug 2007 02:42:21 -0500
parents 0010163f8e25
children c8d55b929442
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
569
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
1 /*
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
2 *
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
3 * Author: Giacomo Lozito <james@develia.org>, (C) 2005-2007
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
4 *
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
5 * This program is free software; you can redistribute it and/or modify it
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
6 * under the terms of the GNU General Public License as published by the
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
7 * Free Software Foundation; either version 2 of the License, or (at your
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
8 * option) any later version.
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
9 *
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
10 * This program is distributed in the hope that it will be useful, but
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
13 * General Public License for more details.
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
14 *
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
15 * You should have received a copy of the GNU General Public License along
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
16 * with this program; if not, write to the Free Software Foundation, Inc.,
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
18 *
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
19 */
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
20
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
21 #include "aosd_osd.h"
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
22 #include "aosd_style.h"
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
23 #include "aosd_style_private.h"
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
24 #include "aosd_cfg.h"
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
25 #include <glib.h>
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
26 #include <X11/Xlib.h>
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
27 #include <cairo/cairo.h>
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
28 #include <pango/pangocairo.h>
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
29 #include <gdk/gdk.h>
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
30 #include <stdlib.h>
911
0010163f8e25 [svn] - aosd: added support to detect whether a composite manager is running (either standard with _NET_WM_CM_Sn or xcompmgr)
giacomo
parents: 908
diff changeset
31 #include <string.h>
569
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
32 #include <sys/time.h>
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
33 #include "ghosd.h"
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
34
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
35
780
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
36 #define AOSD_STATUS_HIDDEN 0
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
37 #define AOSD_STATUS_FADEIN 1
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
38 #define AOSD_STATUS_SHOW 2
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
39 #define AOSD_STATUS_FADEOUT 3
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
40 #define AOSD_STATUS_DESTROY 4
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
41 /* updating OSD every 50 msec */
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
42 #define AOSD_TIMING 50
569
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
43
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
44
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
45 typedef struct
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
46 {
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
47 cairo_surface_t * surface;
780
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
48 gfloat alpha;
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
49 gpointer user_data;
569
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
50 gint width;
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
51 gint height;
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
52 gint deco_code;
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
53 }
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
54 GhosdFadeData;
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
55
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
56
780
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
57 typedef struct
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
58 {
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
59 gchar * markup_message;
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
60 gboolean cfg_is_copied;
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
61 gfloat dalpha_in, dalpha_out, ddisplay_stay;
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
62
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
63 PangoContext *pango_context;
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
64 PangoLayout *pango_layout;
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
65
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
66 aosd_cfg_osd_t * cfg_osd;
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
67
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
68 GhosdFadeData fade_data;
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
69 }
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
70 GhosdData;
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
71
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
72
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
73 static gint osd_source_id = 0;
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
74 static gint osd_status = AOSD_STATUS_HIDDEN;
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
75 static Ghosd *osd;
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
76 static GhosdData *osd_data;
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
77
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
78
569
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
79 static void
780
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
80 aosd_osd_data_alloc ( gchar * markup_string , aosd_cfg_osd_t * cfg_osd , gboolean copy_cfg )
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
81 {
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
82 osd_data = g_malloc0(sizeof(GhosdData));
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
83 osd_data->markup_message = g_strdup( markup_string );
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
84 if ( copy_cfg == TRUE )
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
85 {
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
86 osd_data->cfg_osd = aosd_cfg_osd_copy( cfg_osd );
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
87 osd_data->cfg_is_copied = TRUE;
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
88 }
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
89 else
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
90 {
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
91 osd_data->cfg_osd = cfg_osd;
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
92 osd_data->cfg_is_copied = FALSE;
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
93 }
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
94 return;
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
95 }
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
96
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
97
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
98 static void
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
99 aosd_osd_data_free ( void )
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
100 {
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
101 if ( osd_data->fade_data.surface != NULL )
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
102 {
883
e6d51d079a46 [svn] - aosd: use a single ghosd object for all of the osd showups; this will be a lot gentler to XLib and should definitely help with stability
giacomo
parents: 875
diff changeset
103 cairo_surface_destroy( osd_data->fade_data.surface );
780
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
104 osd_data->fade_data.surface = NULL;
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
105 }
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
106
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
107 if ( osd_data->markup_message != NULL )
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
108 {
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
109 g_free( osd_data->markup_message );
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
110 osd_data->markup_message = NULL;
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
111 }
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
112
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
113 if ( osd_data->cfg_is_copied == TRUE )
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
114 {
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
115 aosd_cfg_osd_delete( osd_data->cfg_osd );
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
116 osd_data->cfg_osd = NULL;
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
117 }
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
118
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
119 if ( osd_data->pango_layout != NULL )
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
120 {
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
121 g_object_unref( osd_data->pango_layout );
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
122 osd_data->pango_layout = NULL;
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
123 }
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
124
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
125 if ( osd_data->pango_context != NULL )
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
126 {
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
127 g_object_unref( osd_data->pango_context );
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
128 osd_data->pango_context = NULL;
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
129 }
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
130
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
131 g_free( osd_data );
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
132 }
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
133
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
134
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
135 static void
883
e6d51d079a46 [svn] - aosd: use a single ghosd object for all of the osd showups; this will be a lot gentler to XLib and should definitely help with stability
giacomo
parents: 875
diff changeset
136 aosd_osd_hide ( void )
780
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
137 {
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
138 if ( osd != NULL )
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
139 {
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
140 ghosd_hide( osd );
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
141 ghosd_main_iterations( osd );
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
142 }
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
143 return;
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
144 }
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
145
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
146
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
147 static void
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
148 aosd_fade_func ( Ghosd * gosd , cairo_t * cr , void * user_data )
569
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
149 {
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
150 GhosdFadeData *fade_data = user_data;
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
151
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
152 if ( fade_data->surface == NULL )
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
153 {
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
154 cairo_t *rendered_cr;
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
155 fade_data->surface = cairo_surface_create_similar( cairo_get_target( cr ) ,
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
156 CAIRO_CONTENT_COLOR_ALPHA , fade_data->width , fade_data->height );
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
157 rendered_cr = cairo_create( fade_data->surface );
780
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
158 aosd_deco_style_render( fade_data->deco_code , gosd , rendered_cr , fade_data->user_data );
569
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
159 cairo_destroy( rendered_cr );
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
160 }
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
161
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
162 cairo_set_source_surface( cr , fade_data->surface , 0 , 0 );
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
163 cairo_paint_with_alpha( cr , fade_data->alpha );
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
164 }
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
165
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
166
592
546e779aba64 [svn] - aosd: immediately hide osd window by single clicking (with mouse button 1) on it
giacomo
parents: 591
diff changeset
167 static void
780
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
168 aosd_button_func ( Ghosd * gosd , GhosdEventButton * ev , void * user_data )
592
546e779aba64 [svn] - aosd: immediately hide osd window by single clicking (with mouse button 1) on it
giacomo
parents: 591
diff changeset
169 {
546e779aba64 [svn] - aosd: immediately hide osd window by single clicking (with mouse button 1) on it
giacomo
parents: 591
diff changeset
170 if ( ev->button == 1 )
546e779aba64 [svn] - aosd: immediately hide osd window by single clicking (with mouse button 1) on it
giacomo
parents: 591
diff changeset
171 {
780
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
172 osd_status = AOSD_STATUS_DESTROY; /* move to status destroy */
592
546e779aba64 [svn] - aosd: immediately hide osd window by single clicking (with mouse button 1) on it
giacomo
parents: 591
diff changeset
173 }
546e779aba64 [svn] - aosd: immediately hide osd window by single clicking (with mouse button 1) on it
giacomo
parents: 591
diff changeset
174 return;
546e779aba64 [svn] - aosd: immediately hide osd window by single clicking (with mouse button 1) on it
giacomo
parents: 591
diff changeset
175 }
546e779aba64 [svn] - aosd: immediately hide osd window by single clicking (with mouse button 1) on it
giacomo
parents: 591
diff changeset
176
546e779aba64 [svn] - aosd: immediately hide osd window by single clicking (with mouse button 1) on it
giacomo
parents: 591
diff changeset
177
780
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
178 static void
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
179 aosd_osd_create ( void )
569
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
180 {
586
26519231a4f4 [svn] - aosd: added experimental multiple monitor support, plus max_width setting
giacomo
parents: 569
diff changeset
181 gint max_width, layout_width, layout_height;
780
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
182 GdkScreen *screen = gdk_screen_get_default();
586
26519231a4f4 [svn] - aosd: added experimental multiple monitor support, plus max_width setting
giacomo
parents: 569
diff changeset
183 gint pos_x = 0, pos_y = 0;
569
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
184 gint pad_left = 0 , pad_right = 0 , pad_top = 0 , pad_bottom = 0;
586
26519231a4f4 [svn] - aosd: added experimental multiple monitor support, plus max_width setting
giacomo
parents: 569
diff changeset
185 gint screen_width, screen_height;
569
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
186 aosd_deco_style_data_t style_data;
586
26519231a4f4 [svn] - aosd: added experimental multiple monitor support, plus max_width setting
giacomo
parents: 569
diff changeset
187
26519231a4f4 [svn] - aosd: added experimental multiple monitor support, plus max_width setting
giacomo
parents: 569
diff changeset
188 /* calculate screen_width and screen_height */
780
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
189 if ( osd_data->cfg_osd->position.multimon_id > -1 )
586
26519231a4f4 [svn] - aosd: added experimental multiple monitor support, plus max_width setting
giacomo
parents: 569
diff changeset
190 {
26519231a4f4 [svn] - aosd: added experimental multiple monitor support, plus max_width setting
giacomo
parents: 569
diff changeset
191 /* adjust coordinates and size according to selected monitor */
26519231a4f4 [svn] - aosd: added experimental multiple monitor support, plus max_width setting
giacomo
parents: 569
diff changeset
192 GdkRectangle rect;
780
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
193 gdk_screen_get_monitor_geometry( screen , osd_data->cfg_osd->position.multimon_id , &rect );
586
26519231a4f4 [svn] - aosd: added experimental multiple monitor support, plus max_width setting
giacomo
parents: 569
diff changeset
194 pos_x = rect.x;
26519231a4f4 [svn] - aosd: added experimental multiple monitor support, plus max_width setting
giacomo
parents: 569
diff changeset
195 pos_y = rect.y;
26519231a4f4 [svn] - aosd: added experimental multiple monitor support, plus max_width setting
giacomo
parents: 569
diff changeset
196 screen_width = rect.width;
26519231a4f4 [svn] - aosd: added experimental multiple monitor support, plus max_width setting
giacomo
parents: 569
diff changeset
197 screen_height = rect.height;
26519231a4f4 [svn] - aosd: added experimental multiple monitor support, plus max_width setting
giacomo
parents: 569
diff changeset
198 }
26519231a4f4 [svn] - aosd: added experimental multiple monitor support, plus max_width setting
giacomo
parents: 569
diff changeset
199 else
26519231a4f4 [svn] - aosd: added experimental multiple monitor support, plus max_width setting
giacomo
parents: 569
diff changeset
200 {
26519231a4f4 [svn] - aosd: added experimental multiple monitor support, plus max_width setting
giacomo
parents: 569
diff changeset
201 /* use total space available, even when composed by multiple monitor */
26519231a4f4 [svn] - aosd: added experimental multiple monitor support, plus max_width setting
giacomo
parents: 569
diff changeset
202 screen_width = gdk_screen_get_width( screen );
26519231a4f4 [svn] - aosd: added experimental multiple monitor support, plus max_width setting
giacomo
parents: 569
diff changeset
203 screen_height = gdk_screen_get_height( screen );
26519231a4f4 [svn] - aosd: added experimental multiple monitor support, plus max_width setting
giacomo
parents: 569
diff changeset
204 pos_x = 0;
26519231a4f4 [svn] - aosd: added experimental multiple monitor support, plus max_width setting
giacomo
parents: 569
diff changeset
205 pos_y = 0;
26519231a4f4 [svn] - aosd: added experimental multiple monitor support, plus max_width setting
giacomo
parents: 569
diff changeset
206 }
569
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
207
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
208 /* pick padding from selected decoration style */
780
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
209 aosd_deco_style_get_padding( osd_data->cfg_osd->decoration.code ,
569
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
210 &pad_top , &pad_bottom , &pad_left , &pad_right );
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
211
780
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
212 if ( osd_data->cfg_osd->position.maxsize_width > 0 )
586
26519231a4f4 [svn] - aosd: added experimental multiple monitor support, plus max_width setting
giacomo
parents: 569
diff changeset
213 {
780
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
214 gint max_width_default = screen_width - pad_left - pad_right - abs(osd_data->cfg_osd->position.offset_x);
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
215 max_width = osd_data->cfg_osd->position.maxsize_width - pad_left - pad_right;
587
289c08270c7b [svn] - aosd: prevent user from setting an excessively large max_width
giacomo
parents: 586
diff changeset
216 /* ignore user-defined max_width if it is too small or too large */
588
1e2792ece36b [svn] - aosd: fix typo
giacomo
parents: 587
diff changeset
217 if (( max_width < 1 ) || ( max_width > max_width_default ))
587
289c08270c7b [svn] - aosd: prevent user from setting an excessively large max_width
giacomo
parents: 586
diff changeset
218 max_width = max_width_default;
586
26519231a4f4 [svn] - aosd: added experimental multiple monitor support, plus max_width setting
giacomo
parents: 569
diff changeset
219 }
26519231a4f4 [svn] - aosd: added experimental multiple monitor support, plus max_width setting
giacomo
parents: 569
diff changeset
220 else
26519231a4f4 [svn] - aosd: added experimental multiple monitor support, plus max_width setting
giacomo
parents: 569
diff changeset
221 {
780
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
222 max_width = screen_width - pad_left - pad_right - abs(osd_data->cfg_osd->position.offset_x);
586
26519231a4f4 [svn] - aosd: added experimental multiple monitor support, plus max_width setting
giacomo
parents: 569
diff changeset
223 }
780
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
224 osd_data->pango_context = pango_cairo_font_map_create_context(
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
225 PANGO_CAIRO_FONT_MAP(pango_cairo_font_map_get_default()));
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
226 osd_data->pango_layout = pango_layout_new(osd_data->pango_context);
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
227 pango_layout_set_markup( osd_data->pango_layout, osd_data->markup_message , -1 );
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
228 pango_layout_set_ellipsize( osd_data->pango_layout , PANGO_ELLIPSIZE_NONE );
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
229 pango_layout_set_justify( osd_data->pango_layout , FALSE );
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
230 pango_layout_set_width( osd_data->pango_layout , PANGO_SCALE * max_width );
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
231 pango_layout_get_pixel_size( osd_data->pango_layout , &layout_width , &layout_height );
569
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
232
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
233 /* osd position */
780
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
234 switch ( osd_data->cfg_osd->position.placement )
569
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
235 {
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
236 case AOSD_POSITION_PLACEMENT_TOP:
586
26519231a4f4 [svn] - aosd: added experimental multiple monitor support, plus max_width setting
giacomo
parents: 569
diff changeset
237 pos_x += (screen_width - (layout_width + pad_left + pad_right)) / 2;
26519231a4f4 [svn] - aosd: added experimental multiple monitor support, plus max_width setting
giacomo
parents: 569
diff changeset
238 pos_y += 0;
569
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
239 break;
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
240 case AOSD_POSITION_PLACEMENT_TOPRIGHT:
586
26519231a4f4 [svn] - aosd: added experimental multiple monitor support, plus max_width setting
giacomo
parents: 569
diff changeset
241 pos_x += screen_width - (layout_width + pad_left + pad_right);
26519231a4f4 [svn] - aosd: added experimental multiple monitor support, plus max_width setting
giacomo
parents: 569
diff changeset
242 pos_y += 0;
569
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
243 break;
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
244 case AOSD_POSITION_PLACEMENT_MIDDLELEFT:
586
26519231a4f4 [svn] - aosd: added experimental multiple monitor support, plus max_width setting
giacomo
parents: 569
diff changeset
245 pos_x += 0;
26519231a4f4 [svn] - aosd: added experimental multiple monitor support, plus max_width setting
giacomo
parents: 569
diff changeset
246 pos_y += (screen_height - (layout_height + pad_top + pad_bottom)) / 2;
569
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
247 break;
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
248 case AOSD_POSITION_PLACEMENT_MIDDLE:
586
26519231a4f4 [svn] - aosd: added experimental multiple monitor support, plus max_width setting
giacomo
parents: 569
diff changeset
249 pos_x += (screen_width - (layout_width + pad_left + pad_right)) / 2;
26519231a4f4 [svn] - aosd: added experimental multiple monitor support, plus max_width setting
giacomo
parents: 569
diff changeset
250 pos_y += (screen_height - (layout_height + pad_top + pad_bottom)) / 2;
569
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
251 break;
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
252 case AOSD_POSITION_PLACEMENT_MIDDLERIGHT:
586
26519231a4f4 [svn] - aosd: added experimental multiple monitor support, plus max_width setting
giacomo
parents: 569
diff changeset
253 pos_x += screen_width - (layout_width + pad_left + pad_right);
26519231a4f4 [svn] - aosd: added experimental multiple monitor support, plus max_width setting
giacomo
parents: 569
diff changeset
254 pos_y += (screen_height - (layout_height + pad_top + pad_bottom)) / 2;
569
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
255 break;
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
256 case AOSD_POSITION_PLACEMENT_BOTTOMLEFT:
586
26519231a4f4 [svn] - aosd: added experimental multiple monitor support, plus max_width setting
giacomo
parents: 569
diff changeset
257 pos_x += 0;
26519231a4f4 [svn] - aosd: added experimental multiple monitor support, plus max_width setting
giacomo
parents: 569
diff changeset
258 pos_y += screen_height - (layout_height + pad_top + pad_bottom);
569
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
259 break;
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
260 case AOSD_POSITION_PLACEMENT_BOTTOM:
586
26519231a4f4 [svn] - aosd: added experimental multiple monitor support, plus max_width setting
giacomo
parents: 569
diff changeset
261 pos_x += (screen_width - (layout_width + pad_left + pad_right)) / 2;
26519231a4f4 [svn] - aosd: added experimental multiple monitor support, plus max_width setting
giacomo
parents: 569
diff changeset
262 pos_y += screen_height - (layout_height + pad_top + pad_bottom);
569
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
263 break;
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
264 case AOSD_POSITION_PLACEMENT_BOTTOMRIGHT:
586
26519231a4f4 [svn] - aosd: added experimental multiple monitor support, plus max_width setting
giacomo
parents: 569
diff changeset
265 pos_x += screen_width - (layout_width + pad_left + pad_right);
26519231a4f4 [svn] - aosd: added experimental multiple monitor support, plus max_width setting
giacomo
parents: 569
diff changeset
266 pos_y += screen_height - (layout_height + pad_top + pad_bottom);
569
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
267 break;
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
268 case AOSD_POSITION_PLACEMENT_TOPLEFT:
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
269 default:
586
26519231a4f4 [svn] - aosd: added experimental multiple monitor support, plus max_width setting
giacomo
parents: 569
diff changeset
270 pos_x += 0;
26519231a4f4 [svn] - aosd: added experimental multiple monitor support, plus max_width setting
giacomo
parents: 569
diff changeset
271 pos_y += 0;
569
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
272 break;
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
273 }
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
274
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
275 /* add offset to position */
780
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
276 pos_x += osd_data->cfg_osd->position.offset_x;
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
277 pos_y += osd_data->cfg_osd->position.offset_y;
569
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
278
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
279 ghosd_set_position( osd , pos_x , pos_y ,
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
280 layout_width + pad_left + pad_right ,
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
281 layout_height + pad_top + pad_bottom );
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
282
780
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
283 ghosd_set_event_button_cb( osd , aosd_button_func , NULL );
569
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
284
780
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
285 style_data.layout = osd_data->pango_layout;
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
286 style_data.text = &(osd_data->cfg_osd->text);
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
287 style_data.decoration = &(osd_data->cfg_osd->decoration);
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
288 osd_data->fade_data.surface = NULL;
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
289 osd_data->fade_data.user_data = &style_data;
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
290 osd_data->fade_data.width = layout_width + pad_left + pad_right;
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
291 osd_data->fade_data.height = layout_height + pad_top + pad_bottom;
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
292 osd_data->fade_data.alpha = 0;
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
293 osd_data->fade_data.deco_code = osd_data->cfg_osd->decoration.code;
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
294 osd_data->dalpha_in = 1.0 / ( osd_data->cfg_osd->animation.timing_fadein / (gfloat)AOSD_TIMING );
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
295 osd_data->dalpha_out = 1.0 / ( osd_data->cfg_osd->animation.timing_fadeout / (gfloat)AOSD_TIMING );
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
296 osd_data->ddisplay_stay = 1.0 / ( osd_data->cfg_osd->animation.timing_display / (gfloat)AOSD_TIMING );
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
297 ghosd_set_render( osd , (GhosdRenderFunc)aosd_fade_func , &(osd_data->fade_data) , NULL );
569
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
298
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
299 /* show the osd (with alpha 0, invisible) */
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
300 ghosd_show( osd );
780
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
301 return;
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
302 }
569
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
303
780
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
304
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
305 static gboolean
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
306 aosd_timer_func ( gpointer none )
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
307 {
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
308 static gfloat display_time = 0;
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
309
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
310 switch ( osd_status )
569
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
311 {
780
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
312 case AOSD_STATUS_FADEIN:
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
313 {
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
314 /* fade in */
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
315 osd_data->fade_data.alpha += osd_data->dalpha_in;
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
316 if ( osd_data->fade_data.alpha < 1.0 )
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
317 {
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
318 ghosd_render( osd );
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
319 ghosd_main_iterations( osd );
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
320 }
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
321 else
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
322 {
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
323 osd_data->fade_data.alpha = 1.0;
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
324 display_time = 0;
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
325 osd_status = AOSD_STATUS_SHOW; /* move to next phase */
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
326 ghosd_render( osd );
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
327 ghosd_main_iterations( osd );
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
328 }
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
329 return TRUE;
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
330 }
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
331
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
332 case AOSD_STATUS_SHOW:
569
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
333 {
780
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
334 display_time += osd_data->ddisplay_stay;
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
335 if ( display_time >= 1.0 )
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
336 {
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
337 osd_status = AOSD_STATUS_FADEOUT; /* move to next phase */
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
338 ghosd_main_iterations( osd );
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
339 }
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
340 else
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
341 {
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
342 ghosd_main_iterations( osd );
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
343 }
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
344 return TRUE;
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
345 }
569
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
346
780
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
347 case AOSD_STATUS_FADEOUT:
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
348 {
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
349 /* fade out */
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
350 osd_data->fade_data.alpha -= osd_data->dalpha_out;
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
351 if ( osd_data->fade_data.alpha > 0.0 )
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
352 {
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
353 ghosd_render( osd );
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
354 ghosd_main_iterations( osd );
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
355 }
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
356 else
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
357 {
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
358 osd_data->fade_data.alpha = 0.0;
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
359 osd_status = AOSD_STATUS_DESTROY; /* move to next phase */
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
360 ghosd_render( osd );
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
361 ghosd_main_iterations( osd );
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
362 }
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
363 return TRUE;
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
364 }
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
365
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
366 case AOSD_STATUS_DESTROY:
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
367 {
883
e6d51d079a46 [svn] - aosd: use a single ghosd object for all of the osd showups; this will be a lot gentler to XLib and should definitely help with stability
giacomo
parents: 875
diff changeset
368 aosd_osd_hide();
780
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
369 aosd_osd_data_free();
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
370
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
371 osd_status = AOSD_STATUS_HIDDEN; /* reset status */
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
372 osd_source_id = 0;
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
373 return FALSE;
569
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
374 }
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
375 }
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
376
780
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
377 return TRUE;
569
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
378 }
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
379
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
380
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
381 gint
883
e6d51d079a46 [svn] - aosd: use a single ghosd object for all of the osd showups; this will be a lot gentler to XLib and should definitely help with stability
giacomo
parents: 875
diff changeset
382 aosd_osd_display ( gchar * markup_string , aosd_cfg_osd_t * cfg_osd , gboolean copy_cfg )
569
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
383 {
907
f20ca9b8cd7d [svn] aosd: added some more error checking
giacomo
parents: 906
diff changeset
384 if ( osd != NULL )
569
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
385 {
907
f20ca9b8cd7d [svn] aosd: added some more error checking
giacomo
parents: 906
diff changeset
386 if ( osd_status == AOSD_STATUS_HIDDEN )
f20ca9b8cd7d [svn] aosd: added some more error checking
giacomo
parents: 906
diff changeset
387 {
f20ca9b8cd7d [svn] aosd: added some more error checking
giacomo
parents: 906
diff changeset
388 aosd_osd_data_alloc( markup_string , cfg_osd , copy_cfg );
f20ca9b8cd7d [svn] aosd: added some more error checking
giacomo
parents: 906
diff changeset
389 aosd_osd_create();
f20ca9b8cd7d [svn] aosd: added some more error checking
giacomo
parents: 906
diff changeset
390 osd_status = AOSD_STATUS_FADEIN;
f20ca9b8cd7d [svn] aosd: added some more error checking
giacomo
parents: 906
diff changeset
391 osd_source_id = g_timeout_add_full( G_PRIORITY_DEFAULT_IDLE , AOSD_TIMING ,
f20ca9b8cd7d [svn] aosd: added some more error checking
giacomo
parents: 906
diff changeset
392 aosd_timer_func , NULL , NULL );
f20ca9b8cd7d [svn] aosd: added some more error checking
giacomo
parents: 906
diff changeset
393 }
f20ca9b8cd7d [svn] aosd: added some more error checking
giacomo
parents: 906
diff changeset
394 else
f20ca9b8cd7d [svn] aosd: added some more error checking
giacomo
parents: 906
diff changeset
395 {
f20ca9b8cd7d [svn] aosd: added some more error checking
giacomo
parents: 906
diff changeset
396 g_source_remove( osd_source_id ); /* remove timer */
f20ca9b8cd7d [svn] aosd: added some more error checking
giacomo
parents: 906
diff changeset
397 osd_source_id = 0;
f20ca9b8cd7d [svn] aosd: added some more error checking
giacomo
parents: 906
diff changeset
398 aosd_osd_hide();
f20ca9b8cd7d [svn] aosd: added some more error checking
giacomo
parents: 906
diff changeset
399 aosd_osd_data_free();
f20ca9b8cd7d [svn] aosd: added some more error checking
giacomo
parents: 906
diff changeset
400 osd_status = AOSD_STATUS_HIDDEN;
f20ca9b8cd7d [svn] aosd: added some more error checking
giacomo
parents: 906
diff changeset
401 /* now display new OSD */
f20ca9b8cd7d [svn] aosd: added some more error checking
giacomo
parents: 906
diff changeset
402 aosd_osd_data_alloc( markup_string , cfg_osd , copy_cfg );
f20ca9b8cd7d [svn] aosd: added some more error checking
giacomo
parents: 906
diff changeset
403 aosd_osd_create();
f20ca9b8cd7d [svn] aosd: added some more error checking
giacomo
parents: 906
diff changeset
404 osd_status = AOSD_STATUS_FADEIN;
f20ca9b8cd7d [svn] aosd: added some more error checking
giacomo
parents: 906
diff changeset
405 osd_source_id = g_timeout_add_full( G_PRIORITY_DEFAULT_IDLE , AOSD_TIMING ,
f20ca9b8cd7d [svn] aosd: added some more error checking
giacomo
parents: 906
diff changeset
406 aosd_timer_func , NULL , NULL );
f20ca9b8cd7d [svn] aosd: added some more error checking
giacomo
parents: 906
diff changeset
407 }
f20ca9b8cd7d [svn] aosd: added some more error checking
giacomo
parents: 906
diff changeset
408 return 0;
569
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
409 }
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
410 else
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
411 {
907
f20ca9b8cd7d [svn] aosd: added some more error checking
giacomo
parents: 906
diff changeset
412 g_warning( "OSD display requested, but no osd object is loaded!\n" );
569
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
413 }
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
414 }
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
415
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
416
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
417 void
883
e6d51d079a46 [svn] - aosd: use a single ghosd object for all of the osd showups; this will be a lot gentler to XLib and should definitely help with stability
giacomo
parents: 875
diff changeset
418 aosd_osd_shutdown ( void )
569
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
419 {
907
f20ca9b8cd7d [svn] aosd: added some more error checking
giacomo
parents: 906
diff changeset
420 if ( osd != NULL )
569
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
421 {
907
f20ca9b8cd7d [svn] aosd: added some more error checking
giacomo
parents: 906
diff changeset
422 if ( osd_status != AOSD_STATUS_HIDDEN ) /* osd is being displayed */
f20ca9b8cd7d [svn] aosd: added some more error checking
giacomo
parents: 906
diff changeset
423 {
f20ca9b8cd7d [svn] aosd: added some more error checking
giacomo
parents: 906
diff changeset
424 g_source_remove( osd_source_id ); /* remove timer */
f20ca9b8cd7d [svn] aosd: added some more error checking
giacomo
parents: 906
diff changeset
425 osd_source_id = 0;
f20ca9b8cd7d [svn] aosd: added some more error checking
giacomo
parents: 906
diff changeset
426 aosd_osd_hide();
f20ca9b8cd7d [svn] aosd: added some more error checking
giacomo
parents: 906
diff changeset
427 aosd_osd_data_free();
f20ca9b8cd7d [svn] aosd: added some more error checking
giacomo
parents: 906
diff changeset
428 osd_status = AOSD_STATUS_HIDDEN;
f20ca9b8cd7d [svn] aosd: added some more error checking
giacomo
parents: 906
diff changeset
429 }
f20ca9b8cd7d [svn] aosd: added some more error checking
giacomo
parents: 906
diff changeset
430 }
f20ca9b8cd7d [svn] aosd: added some more error checking
giacomo
parents: 906
diff changeset
431 else
f20ca9b8cd7d [svn] aosd: added some more error checking
giacomo
parents: 906
diff changeset
432 {
f20ca9b8cd7d [svn] aosd: added some more error checking
giacomo
parents: 906
diff changeset
433 g_warning( "OSD shutdown requested, but no osd object is loaded!\n" );
569
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
434 }
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
435 return;
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
436 }
883
e6d51d079a46 [svn] - aosd: use a single ghosd object for all of the osd showups; this will be a lot gentler to XLib and should definitely help with stability
giacomo
parents: 875
diff changeset
437
e6d51d079a46 [svn] - aosd: use a single ghosd object for all of the osd showups; this will be a lot gentler to XLib and should definitely help with stability
giacomo
parents: 875
diff changeset
438
e6d51d079a46 [svn] - aosd: use a single ghosd object for all of the osd showups; this will be a lot gentler to XLib and should definitely help with stability
giacomo
parents: 875
diff changeset
439 void
906
16e51fb5908e [svn] - aosd: beta4, ghosd source was rewritten to support argb visual (x composite extension) as an option, this allows to have real transparency in the OSD
giacomo
parents: 883
diff changeset
440 aosd_osd_init ( gint transparency_mode )
883
e6d51d079a46 [svn] - aosd: use a single ghosd object for all of the osd showups; this will be a lot gentler to XLib and should definitely help with stability
giacomo
parents: 875
diff changeset
441 {
e6d51d079a46 [svn] - aosd: use a single ghosd object for all of the osd showups; this will be a lot gentler to XLib and should definitely help with stability
giacomo
parents: 875
diff changeset
442 if ( osd == NULL )
e6d51d079a46 [svn] - aosd: use a single ghosd object for all of the osd showups; this will be a lot gentler to XLib and should definitely help with stability
giacomo
parents: 875
diff changeset
443 {
e6d51d079a46 [svn] - aosd: use a single ghosd object for all of the osd showups; this will be a lot gentler to XLib and should definitely help with stability
giacomo
parents: 875
diff changeset
444 /* create Ghosd object */
906
16e51fb5908e [svn] - aosd: beta4, ghosd source was rewritten to support argb visual (x composite extension) as an option, this allows to have real transparency in the OSD
giacomo
parents: 883
diff changeset
445 if ( transparency_mode == AOSD_MISC_TRANSPARENCY_FAKE )
16e51fb5908e [svn] - aosd: beta4, ghosd source was rewritten to support argb visual (x composite extension) as an option, this allows to have real transparency in the OSD
giacomo
parents: 883
diff changeset
446 osd = ghosd_new();
16e51fb5908e [svn] - aosd: beta4, ghosd source was rewritten to support argb visual (x composite extension) as an option, this allows to have real transparency in the OSD
giacomo
parents: 883
diff changeset
447 else
908
8b4b381b4399 [svn] aosd: added compile option in configure for composite support; this way, if support is compiled in, we can safely check if the composite module is loaded
giacomo
parents: 907
diff changeset
448 #ifdef HAVE_XCOMPOSITE
8b4b381b4399 [svn] aosd: added compile option in configure for composite support; this way, if support is compiled in, we can safely check if the composite module is loaded
giacomo
parents: 907
diff changeset
449 {
8b4b381b4399 [svn] aosd: added compile option in configure for composite support; this way, if support is compiled in, we can safely check if the composite module is loaded
giacomo
parents: 907
diff changeset
450 /* check if the composite module is actually loaded */
911
0010163f8e25 [svn] - aosd: added support to detect whether a composite manager is running (either standard with _NET_WM_CM_Sn or xcompmgr)
giacomo
parents: 908
diff changeset
451 if ( aosd_osd_check_composite_ext() )
908
8b4b381b4399 [svn] aosd: added compile option in configure for composite support; this way, if support is compiled in, we can safely check if the composite module is loaded
giacomo
parents: 907
diff changeset
452 osd = ghosd_new_with_argbvisual(); /* ok */
8b4b381b4399 [svn] aosd: added compile option in configure for composite support; this way, if support is compiled in, we can safely check if the composite module is loaded
giacomo
parents: 907
diff changeset
453 else
8b4b381b4399 [svn] aosd: added compile option in configure for composite support; this way, if support is compiled in, we can safely check if the composite module is loaded
giacomo
parents: 907
diff changeset
454 {
8b4b381b4399 [svn] aosd: added compile option in configure for composite support; this way, if support is compiled in, we can safely check if the composite module is loaded
giacomo
parents: 907
diff changeset
455 g_warning( "X Composite module not loaded; falling back to fake transparency.\n");
8b4b381b4399 [svn] aosd: added compile option in configure for composite support; this way, if support is compiled in, we can safely check if the composite module is loaded
giacomo
parents: 907
diff changeset
456 osd = ghosd_new(); /* fall back to fake transparency */
8b4b381b4399 [svn] aosd: added compile option in configure for composite support; this way, if support is compiled in, we can safely check if the composite module is loaded
giacomo
parents: 907
diff changeset
457 }
8b4b381b4399 [svn] aosd: added compile option in configure for composite support; this way, if support is compiled in, we can safely check if the composite module is loaded
giacomo
parents: 907
diff changeset
458 }
8b4b381b4399 [svn] aosd: added compile option in configure for composite support; this way, if support is compiled in, we can safely check if the composite module is loaded
giacomo
parents: 907
diff changeset
459 #else
8b4b381b4399 [svn] aosd: added compile option in configure for composite support; this way, if support is compiled in, we can safely check if the composite module is loaded
giacomo
parents: 907
diff changeset
460 osd = ghosd_new();
8b4b381b4399 [svn] aosd: added compile option in configure for composite support; this way, if support is compiled in, we can safely check if the composite module is loaded
giacomo
parents: 907
diff changeset
461 #endif
907
f20ca9b8cd7d [svn] aosd: added some more error checking
giacomo
parents: 906
diff changeset
462
f20ca9b8cd7d [svn] aosd: added some more error checking
giacomo
parents: 906
diff changeset
463 if ( osd == NULL )
f20ca9b8cd7d [svn] aosd: added some more error checking
giacomo
parents: 906
diff changeset
464 g_warning( "Unable to load osd object; OSD will not work properly!\n" );
883
e6d51d079a46 [svn] - aosd: use a single ghosd object for all of the osd showups; this will be a lot gentler to XLib and should definitely help with stability
giacomo
parents: 875
diff changeset
465 }
e6d51d079a46 [svn] - aosd: use a single ghosd object for all of the osd showups; this will be a lot gentler to XLib and should definitely help with stability
giacomo
parents: 875
diff changeset
466 return;
e6d51d079a46 [svn] - aosd: use a single ghosd object for all of the osd showups; this will be a lot gentler to XLib and should definitely help with stability
giacomo
parents: 875
diff changeset
467 }
e6d51d079a46 [svn] - aosd: use a single ghosd object for all of the osd showups; this will be a lot gentler to XLib and should definitely help with stability
giacomo
parents: 875
diff changeset
468
e6d51d079a46 [svn] - aosd: use a single ghosd object for all of the osd showups; this will be a lot gentler to XLib and should definitely help with stability
giacomo
parents: 875
diff changeset
469
e6d51d079a46 [svn] - aosd: use a single ghosd object for all of the osd showups; this will be a lot gentler to XLib and should definitely help with stability
giacomo
parents: 875
diff changeset
470 void
e6d51d079a46 [svn] - aosd: use a single ghosd object for all of the osd showups; this will be a lot gentler to XLib and should definitely help with stability
giacomo
parents: 875
diff changeset
471 aosd_osd_cleanup ( void )
e6d51d079a46 [svn] - aosd: use a single ghosd object for all of the osd showups; this will be a lot gentler to XLib and should definitely help with stability
giacomo
parents: 875
diff changeset
472 {
e6d51d079a46 [svn] - aosd: use a single ghosd object for all of the osd showups; this will be a lot gentler to XLib and should definitely help with stability
giacomo
parents: 875
diff changeset
473 if ( osd != NULL )
e6d51d079a46 [svn] - aosd: use a single ghosd object for all of the osd showups; this will be a lot gentler to XLib and should definitely help with stability
giacomo
parents: 875
diff changeset
474 {
e6d51d079a46 [svn] - aosd: use a single ghosd object for all of the osd showups; this will be a lot gentler to XLib and should definitely help with stability
giacomo
parents: 875
diff changeset
475 /* destroy Ghosd object */
e6d51d079a46 [svn] - aosd: use a single ghosd object for all of the osd showups; this will be a lot gentler to XLib and should definitely help with stability
giacomo
parents: 875
diff changeset
476 ghosd_destroy( osd );
e6d51d079a46 [svn] - aosd: use a single ghosd object for all of the osd showups; this will be a lot gentler to XLib and should definitely help with stability
giacomo
parents: 875
diff changeset
477 osd = NULL;
e6d51d079a46 [svn] - aosd: use a single ghosd object for all of the osd showups; this will be a lot gentler to XLib and should definitely help with stability
giacomo
parents: 875
diff changeset
478 }
e6d51d079a46 [svn] - aosd: use a single ghosd object for all of the osd showups; this will be a lot gentler to XLib and should definitely help with stability
giacomo
parents: 875
diff changeset
479 return;
e6d51d079a46 [svn] - aosd: use a single ghosd object for all of the osd showups; this will be a lot gentler to XLib and should definitely help with stability
giacomo
parents: 875
diff changeset
480 }
908
8b4b381b4399 [svn] aosd: added compile option in configure for composite support; this way, if support is compiled in, we can safely check if the composite module is loaded
giacomo
parents: 907
diff changeset
481
8b4b381b4399 [svn] aosd: added compile option in configure for composite support; this way, if support is compiled in, we can safely check if the composite module is loaded
giacomo
parents: 907
diff changeset
482 #ifdef HAVE_XCOMPOSITE
8b4b381b4399 [svn] aosd: added compile option in configure for composite support; this way, if support is compiled in, we can safely check if the composite module is loaded
giacomo
parents: 907
diff changeset
483 int
911
0010163f8e25 [svn] - aosd: added support to detect whether a composite manager is running (either standard with _NET_WM_CM_Sn or xcompmgr)
giacomo
parents: 908
diff changeset
484 aosd_osd_check_composite_ext ( void )
0010163f8e25 [svn] - aosd: added support to detect whether a composite manager is running (either standard with _NET_WM_CM_Sn or xcompmgr)
giacomo
parents: 908
diff changeset
485 {
0010163f8e25 [svn] - aosd: added support to detect whether a composite manager is running (either standard with _NET_WM_CM_Sn or xcompmgr)
giacomo
parents: 908
diff changeset
486 return ghosd_check_composite_ext();
0010163f8e25 [svn] - aosd: added support to detect whether a composite manager is running (either standard with _NET_WM_CM_Sn or xcompmgr)
giacomo
parents: 908
diff changeset
487 }
0010163f8e25 [svn] - aosd: added support to detect whether a composite manager is running (either standard with _NET_WM_CM_Sn or xcompmgr)
giacomo
parents: 908
diff changeset
488
0010163f8e25 [svn] - aosd: added support to detect whether a composite manager is running (either standard with _NET_WM_CM_Sn or xcompmgr)
giacomo
parents: 908
diff changeset
489 int
0010163f8e25 [svn] - aosd: added support to detect whether a composite manager is running (either standard with _NET_WM_CM_Sn or xcompmgr)
giacomo
parents: 908
diff changeset
490 aosd_osd_check_composite_mgr ( void )
908
8b4b381b4399 [svn] aosd: added compile option in configure for composite support; this way, if support is compiled in, we can safely check if the composite module is loaded
giacomo
parents: 907
diff changeset
491 {
911
0010163f8e25 [svn] - aosd: added support to detect whether a composite manager is running (either standard with _NET_WM_CM_Sn or xcompmgr)
giacomo
parents: 908
diff changeset
492 /* ghosd_check_composite_mgr() only checks for composite managers that
0010163f8e25 [svn] - aosd: added support to detect whether a composite manager is running (either standard with _NET_WM_CM_Sn or xcompmgr)
giacomo
parents: 908
diff changeset
493 adhere to the Extended Window Manager hint specification ver.1.4 from
0010163f8e25 [svn] - aosd: added support to detect whether a composite manager is running (either standard with _NET_WM_CM_Sn or xcompmgr)
giacomo
parents: 908
diff changeset
494 freedesktop ( where composite manager are identified with the hint
0010163f8e25 [svn] - aosd: added support to detect whether a composite manager is running (either standard with _NET_WM_CM_Sn or xcompmgr)
giacomo
parents: 908
diff changeset
495 _NET_WM_CM_Sn ); unfortunately, non-standard comp.managers and older
0010163f8e25 [svn] - aosd: added support to detect whether a composite manager is running (either standard with _NET_WM_CM_Sn or xcompmgr)
giacomo
parents: 908
diff changeset
496 ones (xcompmgr) do not use this hint; so let's also check if xcompmgr
0010163f8e25 [svn] - aosd: added support to detect whether a composite manager is running (either standard with _NET_WM_CM_Sn or xcompmgr)
giacomo
parents: 908
diff changeset
497 is running before reporting a likely absence of running comp.managers */
0010163f8e25 [svn] - aosd: added support to detect whether a composite manager is running (either standard with _NET_WM_CM_Sn or xcompmgr)
giacomo
parents: 908
diff changeset
498 int have_comp_mgr = ghosd_check_composite_mgr();
0010163f8e25 [svn] - aosd: added support to detect whether a composite manager is running (either standard with _NET_WM_CM_Sn or xcompmgr)
giacomo
parents: 908
diff changeset
499
0010163f8e25 [svn] - aosd: added support to detect whether a composite manager is running (either standard with _NET_WM_CM_Sn or xcompmgr)
giacomo
parents: 908
diff changeset
500 if ( have_comp_mgr != 0 )
0010163f8e25 [svn] - aosd: added support to detect whether a composite manager is running (either standard with _NET_WM_CM_Sn or xcompmgr)
giacomo
parents: 908
diff changeset
501 {
0010163f8e25 [svn] - aosd: added support to detect whether a composite manager is running (either standard with _NET_WM_CM_Sn or xcompmgr)
giacomo
parents: 908
diff changeset
502 DEBUGMSG("running composite manager found\n");
0010163f8e25 [svn] - aosd: added support to detect whether a composite manager is running (either standard with _NET_WM_CM_Sn or xcompmgr)
giacomo
parents: 908
diff changeset
503 return have_comp_mgr;
0010163f8e25 [svn] - aosd: added support to detect whether a composite manager is running (either standard with _NET_WM_CM_Sn or xcompmgr)
giacomo
parents: 908
diff changeset
504 }
0010163f8e25 [svn] - aosd: added support to detect whether a composite manager is running (either standard with _NET_WM_CM_Sn or xcompmgr)
giacomo
parents: 908
diff changeset
505 else
0010163f8e25 [svn] - aosd: added support to detect whether a composite manager is running (either standard with _NET_WM_CM_Sn or xcompmgr)
giacomo
parents: 908
diff changeset
506 {
0010163f8e25 [svn] - aosd: added support to detect whether a composite manager is running (either standard with _NET_WM_CM_Sn or xcompmgr)
giacomo
parents: 908
diff changeset
507 /* check if xcompmgr is running; assumes there's a working 'ps'
0010163f8e25 [svn] - aosd: added support to detect whether a composite manager is running (either standard with _NET_WM_CM_Sn or xcompmgr)
giacomo
parents: 908
diff changeset
508 utility in the system; not the most elegant of the checking
0010163f8e25 [svn] - aosd: added support to detect whether a composite manager is running (either standard with _NET_WM_CM_Sn or xcompmgr)
giacomo
parents: 908
diff changeset
509 systems, but this is more than enough for its purpose */
0010163f8e25 [svn] - aosd: added support to detect whether a composite manager is running (either standard with _NET_WM_CM_Sn or xcompmgr)
giacomo
parents: 908
diff changeset
510 gchar *soutput = NULL, *serror = NULL;
0010163f8e25 [svn] - aosd: added support to detect whether a composite manager is running (either standard with _NET_WM_CM_Sn or xcompmgr)
giacomo
parents: 908
diff changeset
511 gint exit_status;
0010163f8e25 [svn] - aosd: added support to detect whether a composite manager is running (either standard with _NET_WM_CM_Sn or xcompmgr)
giacomo
parents: 908
diff changeset
512
0010163f8e25 [svn] - aosd: added support to detect whether a composite manager is running (either standard with _NET_WM_CM_Sn or xcompmgr)
giacomo
parents: 908
diff changeset
513 if ( g_spawn_command_line_sync( "ps -eo comm" ,
0010163f8e25 [svn] - aosd: added support to detect whether a composite manager is running (either standard with _NET_WM_CM_Sn or xcompmgr)
giacomo
parents: 908
diff changeset
514 &soutput , &serror , &exit_status , NULL ) == TRUE )
0010163f8e25 [svn] - aosd: added support to detect whether a composite manager is running (either standard with _NET_WM_CM_Sn or xcompmgr)
giacomo
parents: 908
diff changeset
515 {
0010163f8e25 [svn] - aosd: added support to detect whether a composite manager is running (either standard with _NET_WM_CM_Sn or xcompmgr)
giacomo
parents: 908
diff changeset
516 if (( soutput != NULL ) && ( strstr( soutput , "\nxcompmgr\n" ) != NULL ))
0010163f8e25 [svn] - aosd: added support to detect whether a composite manager is running (either standard with _NET_WM_CM_Sn or xcompmgr)
giacomo
parents: 908
diff changeset
517 {
0010163f8e25 [svn] - aosd: added support to detect whether a composite manager is running (either standard with _NET_WM_CM_Sn or xcompmgr)
giacomo
parents: 908
diff changeset
518 DEBUGMSG("running xcompmgr found\n");
0010163f8e25 [svn] - aosd: added support to detect whether a composite manager is running (either standard with _NET_WM_CM_Sn or xcompmgr)
giacomo
parents: 908
diff changeset
519 have_comp_mgr = 1;
0010163f8e25 [svn] - aosd: added support to detect whether a composite manager is running (either standard with _NET_WM_CM_Sn or xcompmgr)
giacomo
parents: 908
diff changeset
520 }
0010163f8e25 [svn] - aosd: added support to detect whether a composite manager is running (either standard with _NET_WM_CM_Sn or xcompmgr)
giacomo
parents: 908
diff changeset
521 else
0010163f8e25 [svn] - aosd: added support to detect whether a composite manager is running (either standard with _NET_WM_CM_Sn or xcompmgr)
giacomo
parents: 908
diff changeset
522 {
0010163f8e25 [svn] - aosd: added support to detect whether a composite manager is running (either standard with _NET_WM_CM_Sn or xcompmgr)
giacomo
parents: 908
diff changeset
523 DEBUGMSG("running xcompmgr not found\n");
0010163f8e25 [svn] - aosd: added support to detect whether a composite manager is running (either standard with _NET_WM_CM_Sn or xcompmgr)
giacomo
parents: 908
diff changeset
524 have_comp_mgr = 0;
0010163f8e25 [svn] - aosd: added support to detect whether a composite manager is running (either standard with _NET_WM_CM_Sn or xcompmgr)
giacomo
parents: 908
diff changeset
525 }
0010163f8e25 [svn] - aosd: added support to detect whether a composite manager is running (either standard with _NET_WM_CM_Sn or xcompmgr)
giacomo
parents: 908
diff changeset
526 }
0010163f8e25 [svn] - aosd: added support to detect whether a composite manager is running (either standard with _NET_WM_CM_Sn or xcompmgr)
giacomo
parents: 908
diff changeset
527 else
0010163f8e25 [svn] - aosd: added support to detect whether a composite manager is running (either standard with _NET_WM_CM_Sn or xcompmgr)
giacomo
parents: 908
diff changeset
528 {
0010163f8e25 [svn] - aosd: added support to detect whether a composite manager is running (either standard with _NET_WM_CM_Sn or xcompmgr)
giacomo
parents: 908
diff changeset
529 g_warning("command 'ps -eo comm' failed, unable to check if xcompgr is running\n");
0010163f8e25 [svn] - aosd: added support to detect whether a composite manager is running (either standard with _NET_WM_CM_Sn or xcompmgr)
giacomo
parents: 908
diff changeset
530 have_comp_mgr = 0;
0010163f8e25 [svn] - aosd: added support to detect whether a composite manager is running (either standard with _NET_WM_CM_Sn or xcompmgr)
giacomo
parents: 908
diff changeset
531 }
0010163f8e25 [svn] - aosd: added support to detect whether a composite manager is running (either standard with _NET_WM_CM_Sn or xcompmgr)
giacomo
parents: 908
diff changeset
532
0010163f8e25 [svn] - aosd: added support to detect whether a composite manager is running (either standard with _NET_WM_CM_Sn or xcompmgr)
giacomo
parents: 908
diff changeset
533 g_free( soutput );
0010163f8e25 [svn] - aosd: added support to detect whether a composite manager is running (either standard with _NET_WM_CM_Sn or xcompmgr)
giacomo
parents: 908
diff changeset
534 g_free( serror );
0010163f8e25 [svn] - aosd: added support to detect whether a composite manager is running (either standard with _NET_WM_CM_Sn or xcompmgr)
giacomo
parents: 908
diff changeset
535 return have_comp_mgr;
0010163f8e25 [svn] - aosd: added support to detect whether a composite manager is running (either standard with _NET_WM_CM_Sn or xcompmgr)
giacomo
parents: 908
diff changeset
536 }
908
8b4b381b4399 [svn] aosd: added compile option in configure for composite support; this way, if support is compiled in, we can safely check if the composite module is loaded
giacomo
parents: 907
diff changeset
537 }
8b4b381b4399 [svn] aosd: added compile option in configure for composite support; this way, if support is compiled in, we can safely check if the composite module is loaded
giacomo
parents: 907
diff changeset
538 #endif