annotate src/aosd/aosd_osd.c @ 3203:f5456241bff9 default tip

changed include path from audacious to audlegacy.
author Yoshiki Yazawa <yaz@honeyplanet.jp>
date Tue, 10 Nov 2009 05:19:25 +0900
parents 94dae4df1e10
children
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;
2250
94dae4df1e10 Hope it's the final italics fix.
Eugene Paskevich <eugene@raptor.kiev.ua>
parents: 2235
diff changeset
182 PangoRectangle ink, log;
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
183 GdkScreen *screen = gdk_screen_get_default();
586
26519231a4f4 [svn] - aosd: added experimental multiple monitor support, plus max_width setting
giacomo
parents: 569
diff changeset
184 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
185 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
186 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
187 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
188
26519231a4f4 [svn] - aosd: added experimental multiple monitor support, plus max_width setting
giacomo
parents: 569
diff changeset
189 /* 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
190 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
191 {
26519231a4f4 [svn] - aosd: added experimental multiple monitor support, plus max_width setting
giacomo
parents: 569
diff changeset
192 /* 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
193 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
194 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
195 pos_x = rect.x;
26519231a4f4 [svn] - aosd: added experimental multiple monitor support, plus max_width setting
giacomo
parents: 569
diff changeset
196 pos_y = rect.y;
26519231a4f4 [svn] - aosd: added experimental multiple monitor support, plus max_width setting
giacomo
parents: 569
diff changeset
197 screen_width = rect.width;
26519231a4f4 [svn] - aosd: added experimental multiple monitor support, plus max_width setting
giacomo
parents: 569
diff changeset
198 screen_height = rect.height;
26519231a4f4 [svn] - aosd: added experimental multiple monitor support, plus max_width setting
giacomo
parents: 569
diff changeset
199 }
26519231a4f4 [svn] - aosd: added experimental multiple monitor support, plus max_width setting
giacomo
parents: 569
diff changeset
200 else
26519231a4f4 [svn] - aosd: added experimental multiple monitor support, plus max_width setting
giacomo
parents: 569
diff changeset
201 {
26519231a4f4 [svn] - aosd: added experimental multiple monitor support, plus max_width setting
giacomo
parents: 569
diff changeset
202 /* 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
203 screen_width = gdk_screen_get_width( screen );
26519231a4f4 [svn] - aosd: added experimental multiple monitor support, plus max_width setting
giacomo
parents: 569
diff changeset
204 screen_height = gdk_screen_get_height( screen );
26519231a4f4 [svn] - aosd: added experimental multiple monitor support, plus max_width setting
giacomo
parents: 569
diff changeset
205 pos_x = 0;
26519231a4f4 [svn] - aosd: added experimental multiple monitor support, plus max_width setting
giacomo
parents: 569
diff changeset
206 pos_y = 0;
26519231a4f4 [svn] - aosd: added experimental multiple monitor support, plus max_width setting
giacomo
parents: 569
diff changeset
207 }
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
208
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
209 /* 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
210 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
211 &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
212
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
213 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
214 {
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
215 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
216 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
217 /* ignore user-defined max_width if it is too small or too large */
588
1e2792ece36b [svn] - aosd: fix typo
giacomo
parents: 587
diff changeset
218 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
219 max_width = max_width_default;
586
26519231a4f4 [svn] - aosd: added experimental multiple monitor support, plus max_width setting
giacomo
parents: 569
diff changeset
220 }
26519231a4f4 [svn] - aosd: added experimental multiple monitor support, plus max_width setting
giacomo
parents: 569
diff changeset
221 else
26519231a4f4 [svn] - aosd: added experimental multiple monitor support, plus max_width setting
giacomo
parents: 569
diff changeset
222 {
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
223 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
224 }
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
225 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
226 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
227 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
228 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
229 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
230 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
231 pango_layout_set_width( osd_data->pango_layout , PANGO_SCALE * max_width );
2250
94dae4df1e10 Hope it's the final italics fix.
Eugene Paskevich <eugene@raptor.kiev.ua>
parents: 2235
diff changeset
232 pango_layout_get_pixel_extents( osd_data->pango_layout , &ink , &log );
94dae4df1e10 Hope it's the final italics fix.
Eugene Paskevich <eugene@raptor.kiev.ua>
parents: 2235
diff changeset
233 layout_width = ink.width;
94dae4df1e10 Hope it's the final italics fix.
Eugene Paskevich <eugene@raptor.kiev.ua>
parents: 2235
diff changeset
234 layout_height = log.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
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 /* 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
237 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
238 {
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 case AOSD_POSITION_PLACEMENT_TOP:
586
26519231a4f4 [svn] - aosd: added experimental multiple monitor support, plus max_width setting
giacomo
parents: 569
diff changeset
240 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
241 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
242 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
243 case AOSD_POSITION_PLACEMENT_TOPRIGHT:
586
26519231a4f4 [svn] - aosd: added experimental multiple monitor support, plus max_width setting
giacomo
parents: 569
diff changeset
244 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
245 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
246 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
247 case AOSD_POSITION_PLACEMENT_MIDDLELEFT:
586
26519231a4f4 [svn] - aosd: added experimental multiple monitor support, plus max_width setting
giacomo
parents: 569
diff changeset
248 pos_x += 0;
26519231a4f4 [svn] - aosd: added experimental multiple monitor support, plus max_width setting
giacomo
parents: 569
diff changeset
249 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
250 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
251 case AOSD_POSITION_PLACEMENT_MIDDLE:
586
26519231a4f4 [svn] - aosd: added experimental multiple monitor support, plus max_width setting
giacomo
parents: 569
diff changeset
252 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
253 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
254 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
255 case AOSD_POSITION_PLACEMENT_MIDDLERIGHT:
586
26519231a4f4 [svn] - aosd: added experimental multiple monitor support, plus max_width setting
giacomo
parents: 569
diff changeset
256 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
257 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
258 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
259 case AOSD_POSITION_PLACEMENT_BOTTOMLEFT:
586
26519231a4f4 [svn] - aosd: added experimental multiple monitor support, plus max_width setting
giacomo
parents: 569
diff changeset
260 pos_x += 0;
26519231a4f4 [svn] - aosd: added experimental multiple monitor support, plus max_width setting
giacomo
parents: 569
diff changeset
261 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
262 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
263 case AOSD_POSITION_PLACEMENT_BOTTOM:
586
26519231a4f4 [svn] - aosd: added experimental multiple monitor support, plus max_width setting
giacomo
parents: 569
diff changeset
264 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
265 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
266 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
267 case AOSD_POSITION_PLACEMENT_BOTTOMRIGHT:
586
26519231a4f4 [svn] - aosd: added experimental multiple monitor support, plus max_width setting
giacomo
parents: 569
diff changeset
268 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
269 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
270 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
271 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
272 default:
586
26519231a4f4 [svn] - aosd: added experimental multiple monitor support, plus max_width setting
giacomo
parents: 569
diff changeset
273 pos_x += 0;
26519231a4f4 [svn] - aosd: added experimental multiple monitor support, plus max_width setting
giacomo
parents: 569
diff changeset
274 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
275 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
276 }
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
277
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 /* 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
279 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
280 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
281
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 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
283 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
284 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
285
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
286 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
287
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
288 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
289 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
290 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
291 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
292 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
293 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
294 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
295 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
296 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
297 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
298 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
299 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
300 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
301
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
302 /* 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
303 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
304 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
305 }
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
306
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
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 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
309 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
310 {
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
311 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
312
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 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
314 {
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
315 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
316 {
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 /* 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
318 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
319 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
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 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
322 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
323 }
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 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
325 {
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 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
327 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
328 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
329 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
330 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
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 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
333 }
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
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 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
336 {
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
337 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
338 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
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 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
341 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
342 }
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 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
344 {
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 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
346 }
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 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
348 }
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
349
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
350 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
351 {
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 /* 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
353 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
354 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
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 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
357 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
358 }
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 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
360 {
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 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
362 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
363 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
364 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
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 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
367 }
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
368
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 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
370 {
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
371 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
372 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
373
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
374 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
375 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
376 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
377 }
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
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
380 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
381 }
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
382
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
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
384 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
385 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
386 {
907
f20ca9b8cd7d [svn] aosd: added some more error checking
giacomo
parents: 906
diff changeset
387 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
388 {
907
f20ca9b8cd7d [svn] aosd: added some more error checking
giacomo
parents: 906
diff changeset
389 if ( osd_status == AOSD_STATUS_HIDDEN )
f20ca9b8cd7d [svn] aosd: added some more error checking
giacomo
parents: 906
diff changeset
390 {
f20ca9b8cd7d [svn] aosd: added some more error checking
giacomo
parents: 906
diff changeset
391 aosd_osd_data_alloc( markup_string , cfg_osd , copy_cfg );
f20ca9b8cd7d [svn] aosd: added some more error checking
giacomo
parents: 906
diff changeset
392 aosd_osd_create();
f20ca9b8cd7d [svn] aosd: added some more error checking
giacomo
parents: 906
diff changeset
393 osd_status = AOSD_STATUS_FADEIN;
f20ca9b8cd7d [svn] aosd: added some more error checking
giacomo
parents: 906
diff changeset
394 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
395 aosd_timer_func , NULL , NULL );
f20ca9b8cd7d [svn] aosd: added some more error checking
giacomo
parents: 906
diff changeset
396 }
f20ca9b8cd7d [svn] aosd: added some more error checking
giacomo
parents: 906
diff changeset
397 else
f20ca9b8cd7d [svn] aosd: added some more error checking
giacomo
parents: 906
diff changeset
398 {
f20ca9b8cd7d [svn] aosd: added some more error checking
giacomo
parents: 906
diff changeset
399 g_source_remove( osd_source_id ); /* remove timer */
f20ca9b8cd7d [svn] aosd: added some more error checking
giacomo
parents: 906
diff changeset
400 osd_source_id = 0;
f20ca9b8cd7d [svn] aosd: added some more error checking
giacomo
parents: 906
diff changeset
401 aosd_osd_hide();
f20ca9b8cd7d [svn] aosd: added some more error checking
giacomo
parents: 906
diff changeset
402 aosd_osd_data_free();
f20ca9b8cd7d [svn] aosd: added some more error checking
giacomo
parents: 906
diff changeset
403 osd_status = AOSD_STATUS_HIDDEN;
f20ca9b8cd7d [svn] aosd: added some more error checking
giacomo
parents: 906
diff changeset
404 /* now display new OSD */
f20ca9b8cd7d [svn] aosd: added some more error checking
giacomo
parents: 906
diff changeset
405 aosd_osd_data_alloc( markup_string , cfg_osd , copy_cfg );
f20ca9b8cd7d [svn] aosd: added some more error checking
giacomo
parents: 906
diff changeset
406 aosd_osd_create();
f20ca9b8cd7d [svn] aosd: added some more error checking
giacomo
parents: 906
diff changeset
407 osd_status = AOSD_STATUS_FADEIN;
f20ca9b8cd7d [svn] aosd: added some more error checking
giacomo
parents: 906
diff changeset
408 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
409 aosd_timer_func , NULL , NULL );
f20ca9b8cd7d [svn] aosd: added some more error checking
giacomo
parents: 906
diff changeset
410 }
f20ca9b8cd7d [svn] aosd: added some more error checking
giacomo
parents: 906
diff changeset
411 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
412 }
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 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
414 {
907
f20ca9b8cd7d [svn] aosd: added some more error checking
giacomo
parents: 906
diff changeset
415 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
416 }
2064
c8d55b929442 Just to hush down the warnings...
Eugene Paskevich <eugene@raptor.kiev.ua>
parents: 911
diff changeset
417 return 1;
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
418 }
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
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
420
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 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
422 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
423 {
907
f20ca9b8cd7d [svn] aosd: added some more error checking
giacomo
parents: 906
diff changeset
424 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
425 {
907
f20ca9b8cd7d [svn] aosd: added some more error checking
giacomo
parents: 906
diff changeset
426 if ( osd_status != AOSD_STATUS_HIDDEN ) /* osd is being displayed */
f20ca9b8cd7d [svn] aosd: added some more error checking
giacomo
parents: 906
diff changeset
427 {
f20ca9b8cd7d [svn] aosd: added some more error checking
giacomo
parents: 906
diff changeset
428 g_source_remove( osd_source_id ); /* remove timer */
f20ca9b8cd7d [svn] aosd: added some more error checking
giacomo
parents: 906
diff changeset
429 osd_source_id = 0;
f20ca9b8cd7d [svn] aosd: added some more error checking
giacomo
parents: 906
diff changeset
430 aosd_osd_hide();
f20ca9b8cd7d [svn] aosd: added some more error checking
giacomo
parents: 906
diff changeset
431 aosd_osd_data_free();
f20ca9b8cd7d [svn] aosd: added some more error checking
giacomo
parents: 906
diff changeset
432 osd_status = AOSD_STATUS_HIDDEN;
f20ca9b8cd7d [svn] aosd: added some more error checking
giacomo
parents: 906
diff changeset
433 }
f20ca9b8cd7d [svn] aosd: added some more error checking
giacomo
parents: 906
diff changeset
434 }
f20ca9b8cd7d [svn] aosd: added some more error checking
giacomo
parents: 906
diff changeset
435 else
f20ca9b8cd7d [svn] aosd: added some more error checking
giacomo
parents: 906
diff changeset
436 {
f20ca9b8cd7d [svn] aosd: added some more error checking
giacomo
parents: 906
diff changeset
437 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
438 }
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
439 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
440 }
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
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 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
444 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
445 {
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
446 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
447 {
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
448 /* 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
449 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
450 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
451 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
452 #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
453 {
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 /* 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
455 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
456 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
457 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
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 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
460 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
461 }
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
462 }
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
463 #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
464 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
465 #endif
907
f20ca9b8cd7d [svn] aosd: added some more error checking
giacomo
parents: 906
diff changeset
466
f20ca9b8cd7d [svn] aosd: added some more error checking
giacomo
parents: 906
diff changeset
467 if ( osd == NULL )
f20ca9b8cd7d [svn] aosd: added some more error checking
giacomo
parents: 906
diff changeset
468 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
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 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
471 }
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
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 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
475 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
476 {
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 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
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 /* 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
480 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
481 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
482 }
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
483 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
484 }
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
485
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
486 #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
487 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
488 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
489 {
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 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
491 }
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
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 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
494 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
495 {
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
496 /* 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
497 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
498 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
499 _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
500 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
501 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
502 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
503
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 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
505 {
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 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
507 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
508 }
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 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
510 {
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 /* 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
512 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
513 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
514 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
515 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
516
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 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
518 &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
519 {
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 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
521 {
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 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
523 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
524 }
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 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
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 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
528 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
529 }
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 }
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 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
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_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
534 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
535 }
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
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
537 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
538 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
539 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
540 }
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
541 }
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
542 #endif