Mercurial > audlegacy-plugins
annotate src/aosd/ghosd.c @ 1882:eed7c270e8dd
Fix MILLIONS of Makefiles.
author | Jonathan Schleifer <js@h3c.de> |
---|---|
date | Wed, 26 Sep 2007 14:53:37 +0200 |
parents | 5911d74d2954 |
children | 5a06a09a0bbe |
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 /* ghosd -- OSD with fake transparency, cairo, and pango. |
d401f87f89f7
[svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from 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 * Copyright (C) 2006 Evan Martin <martine@danga.com> |
590
6584e697e6da
[svn] - aosd: extended ghosd source with ghosd_set_event_button_cb to capture and handle button events in osd
giacomo
parents:
569
diff
changeset
|
3 * |
6584e697e6da
[svn] - aosd: extended ghosd source with ghosd_set_event_button_cb to capture and handle button events in osd
giacomo
parents:
569
diff
changeset
|
4 * With further development by Giacomo Lozito <james@develia.org> |
6584e697e6da
[svn] - aosd: extended ghosd source with ghosd_set_event_button_cb to capture and handle button events in osd
giacomo
parents:
569
diff
changeset
|
5 * for the ghosd-based Audacious OSD |
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:
899
diff
changeset
|
6 * - added real transparency with X Composite Extension |
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:
899
diff
changeset
|
7 * - added mouse event handling on OSD window |
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:
899
diff
changeset
|
8 * - added/changed some other stuff |
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
|
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 |
d401f87f89f7
[svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from 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 #include "config.h" |
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
|
12 #include "aosd_common.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
|
13 |
d401f87f89f7
[svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from 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 #include <stdio.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
|
15 #include <stdlib.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
|
16 #include <cairo/cairo-xlib-xrender.h> |
1759
5911d74d2954
- add an explicit include for Xlib.h, just in case it's needed for some xorg versions
Giacomo Lozito <james@develia.org>
parents:
911
diff
changeset
|
17 #include <X11/Xlib.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
|
18 #include <X11/Xatom.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
|
19 |
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
|
20 #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
|
21 #include <X11/extensions/Xcomposite.h> |
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
|
22 #endif |
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
|
23 |
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
|
24 #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
|
25 #include "ghosd-internal.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 |
614
354389b85dce
[svn] - aosd, further work on ghosd source: do not use a override_redirect=true window and give the WM information about initial pos/size of osd (prevents flickering with normal windows); now the osd won't be displayed in multiple workspaces, only in the one where it's initially triggered
giacomo
parents:
590
diff
changeset
|
27 static unsigned long |
354389b85dce
[svn] - aosd, further work on ghosd source: do not use a override_redirect=true window and give the WM information about initial pos/size of osd (prevents flickering with normal windows); now the osd won't be displayed in multiple workspaces, only in the one where it's initially triggered
giacomo
parents:
590
diff
changeset
|
28 get_current_workspace(Ghosd *ghosd) { |
354389b85dce
[svn] - aosd, further work on ghosd source: do not use a override_redirect=true window and give the WM information about initial pos/size of osd (prevents flickering with normal windows); now the osd won't be displayed in multiple workspaces, only in the one where it's initially triggered
giacomo
parents:
590
diff
changeset
|
29 Atom cur_workspace_atom; |
354389b85dce
[svn] - aosd, further work on ghosd source: do not use a override_redirect=true window and give the WM information about initial pos/size of osd (prevents flickering with normal windows); now the osd won't be displayed in multiple workspaces, only in the one where it's initially triggered
giacomo
parents:
590
diff
changeset
|
30 Atom type; |
354389b85dce
[svn] - aosd, further work on ghosd source: do not use a override_redirect=true window and give the WM information about initial pos/size of osd (prevents flickering with normal windows); now the osd won't be displayed in multiple workspaces, only in the one where it's initially triggered
giacomo
parents:
590
diff
changeset
|
31 int format; |
354389b85dce
[svn] - aosd, further work on ghosd source: do not use a override_redirect=true window and give the WM information about initial pos/size of osd (prevents flickering with normal windows); now the osd won't be displayed in multiple workspaces, only in the one where it's initially triggered
giacomo
parents:
590
diff
changeset
|
32 unsigned long nitems, bytes_after; |
354389b85dce
[svn] - aosd, further work on ghosd source: do not use a override_redirect=true window and give the WM information about initial pos/size of osd (prevents flickering with normal windows); now the osd won't be displayed in multiple workspaces, only in the one where it's initially triggered
giacomo
parents:
590
diff
changeset
|
33 unsigned char *data; |
354389b85dce
[svn] - aosd, further work on ghosd source: do not use a override_redirect=true window and give the WM information about initial pos/size of osd (prevents flickering with normal windows); now the osd won't be displayed in multiple workspaces, only in the one where it's initially triggered
giacomo
parents:
590
diff
changeset
|
34 |
354389b85dce
[svn] - aosd, further work on ghosd source: do not use a override_redirect=true window and give the WM information about initial pos/size of osd (prevents flickering with normal windows); now the osd won't be displayed in multiple workspaces, only in the one where it's initially triggered
giacomo
parents:
590
diff
changeset
|
35 cur_workspace_atom = XInternAtom(ghosd->dpy, "_NET_CURRENT_DESKTOP", False); |
354389b85dce
[svn] - aosd, further work on ghosd source: do not use a override_redirect=true window and give the WM information about initial pos/size of osd (prevents flickering with normal windows); now the osd won't be displayed in multiple workspaces, only in the one where it's initially triggered
giacomo
parents:
590
diff
changeset
|
36 XGetWindowProperty(ghosd->dpy, DefaultRootWindow(ghosd->dpy), cur_workspace_atom, |
354389b85dce
[svn] - aosd, further work on ghosd source: do not use a override_redirect=true window and give the WM information about initial pos/size of osd (prevents flickering with normal windows); now the osd won't be displayed in multiple workspaces, only in the one where it's initially triggered
giacomo
parents:
590
diff
changeset
|
37 0, ULONG_MAX, False, XA_CARDINAL, &type, &format, &nitems, &bytes_after, &data); |
354389b85dce
[svn] - aosd, further work on ghosd source: do not use a override_redirect=true window and give the WM information about initial pos/size of osd (prevents flickering with normal windows); now the osd won't be displayed in multiple workspaces, only in the one where it's initially triggered
giacomo
parents:
590
diff
changeset
|
38 |
354389b85dce
[svn] - aosd, further work on ghosd source: do not use a override_redirect=true window and give the WM information about initial pos/size of osd (prevents flickering with normal windows); now the osd won't be displayed in multiple workspaces, only in the one where it's initially triggered
giacomo
parents:
590
diff
changeset
|
39 if ( type == XA_CARDINAL ) |
354389b85dce
[svn] - aosd, further work on ghosd source: do not use a override_redirect=true window and give the WM information about initial pos/size of osd (prevents flickering with normal windows); now the osd won't be displayed in multiple workspaces, only in the one where it's initially triggered
giacomo
parents:
590
diff
changeset
|
40 { |
354389b85dce
[svn] - aosd, further work on ghosd source: do not use a override_redirect=true window and give the WM information about initial pos/size of osd (prevents flickering with normal windows); now the osd won't be displayed in multiple workspaces, only in the one where it's initially triggered
giacomo
parents:
590
diff
changeset
|
41 unsigned long cur_workspace = (unsigned long)*data; |
354389b85dce
[svn] - aosd, further work on ghosd source: do not use a override_redirect=true window and give the WM information about initial pos/size of osd (prevents flickering with normal windows); now the osd won't be displayed in multiple workspaces, only in the one where it's initially triggered
giacomo
parents:
590
diff
changeset
|
42 g_print("debug: %i\n", cur_workspace); |
354389b85dce
[svn] - aosd, further work on ghosd source: do not use a override_redirect=true window and give the WM information about initial pos/size of osd (prevents flickering with normal windows); now the osd won't be displayed in multiple workspaces, only in the one where it's initially triggered
giacomo
parents:
590
diff
changeset
|
43 XFree( data ); |
354389b85dce
[svn] - aosd, further work on ghosd source: do not use a override_redirect=true window and give the WM information about initial pos/size of osd (prevents flickering with normal windows); now the osd won't be displayed in multiple workspaces, only in the one where it's initially triggered
giacomo
parents:
590
diff
changeset
|
44 return cur_workspace; |
354389b85dce
[svn] - aosd, further work on ghosd source: do not use a override_redirect=true window and give the WM information about initial pos/size of osd (prevents flickering with normal windows); now the osd won't be displayed in multiple workspaces, only in the one where it's initially triggered
giacomo
parents:
590
diff
changeset
|
45 } |
354389b85dce
[svn] - aosd, further work on ghosd source: do not use a override_redirect=true window and give the WM information about initial pos/size of osd (prevents flickering with normal windows); now the osd won't be displayed in multiple workspaces, only in the one where it's initially triggered
giacomo
parents:
590
diff
changeset
|
46 |
354389b85dce
[svn] - aosd, further work on ghosd source: do not use a override_redirect=true window and give the WM information about initial pos/size of osd (prevents flickering with normal windows); now the osd won't be displayed in multiple workspaces, only in the one where it's initially triggered
giacomo
parents:
590
diff
changeset
|
47 /* fall back to desktop number 0 */ |
354389b85dce
[svn] - aosd, further work on ghosd source: do not use a override_redirect=true window and give the WM information about initial pos/size of osd (prevents flickering with normal windows); now the osd won't be displayed in multiple workspaces, only in the one where it's initially triggered
giacomo
parents:
590
diff
changeset
|
48 return 0; |
354389b85dce
[svn] - aosd, further work on ghosd source: do not use a override_redirect=true window and give the WM information about initial pos/size of osd (prevents flickering with normal windows); now the osd won't be displayed in multiple workspaces, only in the one where it's initially triggered
giacomo
parents:
590
diff
changeset
|
49 } |
354389b85dce
[svn] - aosd, further work on ghosd source: do not use a override_redirect=true window and give the WM information about initial pos/size of osd (prevents flickering with normal windows); now the osd won't be displayed in multiple workspaces, only in the one where it's initially triggered
giacomo
parents:
590
diff
changeset
|
50 |
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
|
51 #ifdef HAVE_XCOMPOSITE |
909
cb0bb8e6d6e9
[svn] - aosd: added function to detect if a composite manager is active for a certain screen; this is not used for now, cause the _NET_WM_CM_Sn hint is pretty new; it will certainly prove useful at some time
giacomo
parents:
908
diff
changeset
|
52 static Bool |
cb0bb8e6d6e9
[svn] - aosd: added function to detect if a composite manager is active for a certain screen; this is not used for now, cause the _NET_WM_CM_Sn hint is pretty new; it will certainly prove useful at some time
giacomo
parents:
908
diff
changeset
|
53 composite_find_manager(Display *dpy, int scr) |
cb0bb8e6d6e9
[svn] - aosd: added function to detect if a composite manager is active for a certain screen; this is not used for now, cause the _NET_WM_CM_Sn hint is pretty new; it will certainly prove useful at some time
giacomo
parents:
908
diff
changeset
|
54 { |
cb0bb8e6d6e9
[svn] - aosd: added function to detect if a composite manager is active for a certain screen; this is not used for now, cause the _NET_WM_CM_Sn hint is pretty new; it will certainly prove useful at some time
giacomo
parents:
908
diff
changeset
|
55 Atom comp_manager_atom; |
cb0bb8e6d6e9
[svn] - aosd: added function to detect if a composite manager is active for a certain screen; this is not used for now, cause the _NET_WM_CM_Sn hint is pretty new; it will certainly prove useful at some time
giacomo
parents:
908
diff
changeset
|
56 char comp_manager_hint[32]; |
cb0bb8e6d6e9
[svn] - aosd: added function to detect if a composite manager is active for a certain screen; this is not used for now, cause the _NET_WM_CM_Sn hint is pretty new; it will certainly prove useful at some time
giacomo
parents:
908
diff
changeset
|
57 Window win; |
cb0bb8e6d6e9
[svn] - aosd: added function to detect if a composite manager is active for a certain screen; this is not used for now, cause the _NET_WM_CM_Sn hint is pretty new; it will certainly prove useful at some time
giacomo
parents:
908
diff
changeset
|
58 |
cb0bb8e6d6e9
[svn] - aosd: added function to detect if a composite manager is active for a certain screen; this is not used for now, cause the _NET_WM_CM_Sn hint is pretty new; it will certainly prove useful at some time
giacomo
parents:
908
diff
changeset
|
59 snprintf(comp_manager_hint, 32, "_NET_WM_CM_S%d", scr); |
cb0bb8e6d6e9
[svn] - aosd: added function to detect if a composite manager is active for a certain screen; this is not used for now, cause the _NET_WM_CM_Sn hint is pretty new; it will certainly prove useful at some time
giacomo
parents:
908
diff
changeset
|
60 comp_manager_atom = XInternAtom(dpy, comp_manager_hint, False); |
cb0bb8e6d6e9
[svn] - aosd: added function to detect if a composite manager is active for a certain screen; this is not used for now, cause the _NET_WM_CM_Sn hint is pretty new; it will certainly prove useful at some time
giacomo
parents:
908
diff
changeset
|
61 win = XGetSelectionOwner(dpy, comp_manager_atom); |
cb0bb8e6d6e9
[svn] - aosd: added function to detect if a composite manager is active for a certain screen; this is not used for now, cause the _NET_WM_CM_Sn hint is pretty new; it will certainly prove useful at some time
giacomo
parents:
908
diff
changeset
|
62 |
cb0bb8e6d6e9
[svn] - aosd: added function to detect if a composite manager is active for a certain screen; this is not used for now, cause the _NET_WM_CM_Sn hint is pretty new; it will certainly prove useful at some time
giacomo
parents:
908
diff
changeset
|
63 if (win != None) |
cb0bb8e6d6e9
[svn] - aosd: added function to detect if a composite manager is active for a certain screen; this is not used for now, cause the _NET_WM_CM_Sn hint is pretty new; it will certainly prove useful at some time
giacomo
parents:
908
diff
changeset
|
64 { |
cb0bb8e6d6e9
[svn] - aosd: added function to detect if a composite manager is active for a certain screen; this is not used for now, cause the _NET_WM_CM_Sn hint is pretty new; it will certainly prove useful at some time
giacomo
parents:
908
diff
changeset
|
65 return True; |
cb0bb8e6d6e9
[svn] - aosd: added function to detect if a composite manager is active for a certain screen; this is not used for now, cause the _NET_WM_CM_Sn hint is pretty new; it will certainly prove useful at some time
giacomo
parents:
908
diff
changeset
|
66 } |
cb0bb8e6d6e9
[svn] - aosd: added function to detect if a composite manager is active for a certain screen; this is not used for now, cause the _NET_WM_CM_Sn hint is pretty new; it will certainly prove useful at some time
giacomo
parents:
908
diff
changeset
|
67 else |
cb0bb8e6d6e9
[svn] - aosd: added function to detect if a composite manager is active for a certain screen; this is not used for now, cause the _NET_WM_CM_Sn hint is pretty new; it will certainly prove useful at some time
giacomo
parents:
908
diff
changeset
|
68 { |
cb0bb8e6d6e9
[svn] - aosd: added function to detect if a composite manager is active for a certain screen; this is not used for now, cause the _NET_WM_CM_Sn hint is pretty new; it will certainly prove useful at some time
giacomo
parents:
908
diff
changeset
|
69 return False; |
cb0bb8e6d6e9
[svn] - aosd: added function to detect if a composite manager is active for a certain screen; this is not used for now, cause the _NET_WM_CM_Sn hint is pretty new; it will certainly prove useful at some time
giacomo
parents:
908
diff
changeset
|
70 } |
cb0bb8e6d6e9
[svn] - aosd: added function to detect if a composite manager is active for a certain screen; this is not used for now, cause the _NET_WM_CM_Sn hint is pretty new; it will certainly prove useful at some time
giacomo
parents:
908
diff
changeset
|
71 } |
cb0bb8e6d6e9
[svn] - aosd: added function to detect if a composite manager is active for a certain screen; this is not used for now, cause the _NET_WM_CM_Sn hint is pretty new; it will certainly prove useful at some time
giacomo
parents:
908
diff
changeset
|
72 |
cb0bb8e6d6e9
[svn] - aosd: added function to detect if a composite manager is active for a certain screen; this is not used for now, cause the _NET_WM_CM_Sn hint is pretty new; it will certainly prove useful at some time
giacomo
parents:
908
diff
changeset
|
73 static Visual * |
cb0bb8e6d6e9
[svn] - aosd: added function to detect if a composite manager is active for a certain screen; this is not used for now, cause the _NET_WM_CM_Sn hint is pretty new; it will certainly prove useful at some time
giacomo
parents:
908
diff
changeset
|
74 composite_find_argb_visual(Display *dpy, int scr) |
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:
899
diff
changeset
|
75 { |
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:
899
diff
changeset
|
76 XVisualInfo *xvi; |
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:
899
diff
changeset
|
77 XVisualInfo template; |
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:
899
diff
changeset
|
78 int nvi, i; |
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:
899
diff
changeset
|
79 XRenderPictFormat *format; |
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:
899
diff
changeset
|
80 Visual *visual; |
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:
899
diff
changeset
|
81 |
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:
899
diff
changeset
|
82 template.screen = scr; |
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:
899
diff
changeset
|
83 template.depth = 32; |
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:
899
diff
changeset
|
84 template.class = TrueColor; |
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:
899
diff
changeset
|
85 xvi = XGetVisualInfo (dpy, |
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:
899
diff
changeset
|
86 VisualScreenMask | VisualDepthMask | VisualClassMask, |
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:
899
diff
changeset
|
87 &template, &nvi); |
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:
899
diff
changeset
|
88 if (xvi == NULL) |
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:
899
diff
changeset
|
89 return NULL; |
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:
899
diff
changeset
|
90 |
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:
899
diff
changeset
|
91 visual = NULL; |
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:
899
diff
changeset
|
92 for (i = 0; i < nvi; i++) |
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:
899
diff
changeset
|
93 { |
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:
899
diff
changeset
|
94 format = XRenderFindVisualFormat (dpy, xvi[i].visual); |
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:
899
diff
changeset
|
95 if (format->type == PictTypeDirect && format->direct.alphaMask) |
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:
899
diff
changeset
|
96 { |
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:
899
diff
changeset
|
97 visual = xvi[i].visual; |
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:
899
diff
changeset
|
98 break; |
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:
899
diff
changeset
|
99 } |
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:
899
diff
changeset
|
100 } |
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:
899
diff
changeset
|
101 XFree (xvi); |
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:
899
diff
changeset
|
102 |
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:
899
diff
changeset
|
103 return visual; |
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:
899
diff
changeset
|
104 } |
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
|
105 #endif |
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:
899
diff
changeset
|
106 |
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
|
107 static Pixmap |
d401f87f89f7
[svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff
changeset
|
108 take_snapshot(Ghosd *ghosd) { |
d401f87f89f7
[svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff
changeset
|
109 Pixmap pixmap; |
d401f87f89f7
[svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff
changeset
|
110 GC gc; |
d401f87f89f7
[svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff
changeset
|
111 |
d401f87f89f7
[svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff
changeset
|
112 /* create a pixmap to hold the screenshot. */ |
d401f87f89f7
[svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff
changeset
|
113 pixmap = XCreatePixmap(ghosd->dpy, ghosd->win, |
d401f87f89f7
[svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff
changeset
|
114 ghosd->width, ghosd->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
|
115 DefaultDepth(ghosd->dpy, DefaultScreen(ghosd->dpy))); |
d401f87f89f7
[svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff
changeset
|
116 |
d401f87f89f7
[svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff
changeset
|
117 /* then copy the screen into the pixmap. */ |
d401f87f89f7
[svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff
changeset
|
118 gc = XCreateGC(ghosd->dpy, pixmap, 0, 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
|
119 XSetSubwindowMode(ghosd->dpy, gc, IncludeInferiors); |
d401f87f89f7
[svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff
changeset
|
120 XCopyArea(ghosd->dpy, DefaultRootWindow(ghosd->dpy), pixmap, gc, |
d401f87f89f7
[svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff
changeset
|
121 ghosd->x, ghosd->y, ghosd->width, ghosd->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
|
122 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
|
123 XSetSubwindowMode(ghosd->dpy, gc, ClipByChildren); |
d401f87f89f7
[svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff
changeset
|
124 XFreeGC(ghosd->dpy, gc); |
d401f87f89f7
[svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff
changeset
|
125 |
d401f87f89f7
[svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff
changeset
|
126 return pixmap; |
d401f87f89f7
[svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff
changeset
|
127 } |
d401f87f89f7
[svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff
changeset
|
128 |
d401f87f89f7
[svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff
changeset
|
129 void |
d401f87f89f7
[svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff
changeset
|
130 ghosd_render(Ghosd *ghosd) { |
d401f87f89f7
[svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff
changeset
|
131 Pixmap pixmap; |
d401f87f89f7
[svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff
changeset
|
132 GC gc; |
d401f87f89f7
[svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff
changeset
|
133 |
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:
899
diff
changeset
|
134 if (ghosd->composite) |
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:
899
diff
changeset
|
135 { |
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:
899
diff
changeset
|
136 pixmap = XCreatePixmap(ghosd->dpy, ghosd->win, ghosd->width, ghosd->height, 32); |
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:
899
diff
changeset
|
137 gc = XCreateGC(ghosd->dpy, pixmap, 0, 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
|
138 XFillRectangle(ghosd->dpy, pixmap, gc, |
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:
899
diff
changeset
|
139 0, 0, ghosd->width, ghosd->height); |
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:
899
diff
changeset
|
140 } |
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:
899
diff
changeset
|
141 else |
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:
899
diff
changeset
|
142 { |
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:
899
diff
changeset
|
143 pixmap = XCreatePixmap(ghosd->dpy, ghosd->win, ghosd->width, ghosd->height, |
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:
899
diff
changeset
|
144 DefaultDepth(ghosd->dpy, DefaultScreen(ghosd->dpy))); |
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:
899
diff
changeset
|
145 gc = XCreateGC(ghosd->dpy, pixmap, 0, NULL); |
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:
899
diff
changeset
|
146 if (ghosd->transparent) { |
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:
899
diff
changeset
|
147 /* make our own copy of the background pixmap as the initial surface. */ |
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:
899
diff
changeset
|
148 XCopyArea(ghosd->dpy, ghosd->background.pixmap, pixmap, gc, |
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:
899
diff
changeset
|
149 0, 0, ghosd->width, ghosd->height, 0, 0); |
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:
899
diff
changeset
|
150 } else { |
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:
899
diff
changeset
|
151 XFillRectangle(ghosd->dpy, pixmap, gc, |
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:
899
diff
changeset
|
152 0, 0, ghosd->width, ghosd->height); |
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:
899
diff
changeset
|
153 } |
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
|
154 } |
d401f87f89f7
[svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from 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 XFreeGC(ghosd->dpy, gc); |
d401f87f89f7
[svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from 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 |
d401f87f89f7
[svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from 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 /* render with cairo. */ |
d401f87f89f7
[svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff
changeset
|
158 if (ghosd->render.func) { |
d401f87f89f7
[svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from 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 /* create cairo surface using the pixmap. */ |
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:
899
diff
changeset
|
160 XRenderPictFormat *xrformat; |
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:
899
diff
changeset
|
161 cairo_surface_t *surf; |
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:
899
diff
changeset
|
162 if (ghosd->composite) { |
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:
899
diff
changeset
|
163 xrformat = XRenderFindVisualFormat(ghosd->dpy, ghosd->visual); |
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:
899
diff
changeset
|
164 surf = cairo_xlib_surface_create_with_xrender_format( |
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:
899
diff
changeset
|
165 ghosd->dpy, pixmap, |
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:
899
diff
changeset
|
166 ScreenOfDisplay(ghosd->dpy, ghosd->screen_num), |
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:
899
diff
changeset
|
167 xrformat, ghosd->width, ghosd->height); |
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:
899
diff
changeset
|
168 } else { |
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:
899
diff
changeset
|
169 xrformat = XRenderFindVisualFormat(ghosd->dpy, |
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:
899
diff
changeset
|
170 DefaultVisual(ghosd->dpy, DefaultScreen(ghosd->dpy))); |
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:
899
diff
changeset
|
171 surf = cairo_xlib_surface_create_with_xrender_format( |
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:
899
diff
changeset
|
172 ghosd->dpy, pixmap, |
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:
899
diff
changeset
|
173 ScreenOfDisplay(ghosd->dpy, DefaultScreen(ghosd->dpy)), |
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:
899
diff
changeset
|
174 xrformat, ghosd->width, ghosd->height); |
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:
899
diff
changeset
|
175 } |
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
|
176 |
d401f87f89f7
[svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff
changeset
|
177 /* draw some stuff. */ |
d401f87f89f7
[svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff
changeset
|
178 cairo_t *cr = cairo_create(surf); |
d401f87f89f7
[svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff
changeset
|
179 ghosd->render.func(ghosd, cr, ghosd->render.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
|
180 cairo_destroy(cr); |
889 | 181 cairo_surface_destroy(surf); |
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
|
182 } |
d401f87f89f7
[svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff
changeset
|
183 |
d401f87f89f7
[svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff
changeset
|
184 /* point window at its new backing pixmap. */ |
d401f87f89f7
[svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from 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 XSetWindowBackgroundPixmap(ghosd->dpy, ghosd->win, pixmap); |
d401f87f89f7
[svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff
changeset
|
186 /* I think it's ok to free it here because XCreatePixmap(3X11) says: "the X |
d401f87f89f7
[svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from 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 * server frees the pixmap storage when there are no references to 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
|
188 */ |
d401f87f89f7
[svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff
changeset
|
189 XFreePixmap(ghosd->dpy, pixmap); |
d401f87f89f7
[svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff
changeset
|
190 |
d401f87f89f7
[svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff
changeset
|
191 /* and tell the window to redraw with this pixmap. */ |
d401f87f89f7
[svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff
changeset
|
192 XClearWindow(ghosd->dpy, ghosd->win); |
d401f87f89f7
[svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff
changeset
|
193 } |
d401f87f89f7
[svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff
changeset
|
194 |
d401f87f89f7
[svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff
changeset
|
195 static void |
d401f87f89f7
[svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff
changeset
|
196 set_hints(Display *dpy, Window win) { |
617
312bc3bb686e
[svn] - aosd: added window class hints (aosd.Audacious)
giacomo
parents:
616
diff
changeset
|
197 XClassHint *classhints; |
312bc3bb686e
[svn] - aosd: added window class hints (aosd.Audacious)
giacomo
parents:
616
diff
changeset
|
198 char *res_class = "Audacious"; |
312bc3bb686e
[svn] - aosd: added window class hints (aosd.Audacious)
giacomo
parents:
616
diff
changeset
|
199 char *res_name = "aosd"; |
312bc3bb686e
[svn] - aosd: added window class hints (aosd.Audacious)
giacomo
parents:
616
diff
changeset
|
200 |
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
|
201 /* we're almost a _NET_WM_WINDOW_TYPE_SPLASH, but we don't want |
d401f87f89f7
[svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff
changeset
|
202 * to be centered on the screen. instead, manually request 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
|
203 * behavior we want. */ |
d401f87f89f7
[svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff
changeset
|
204 |
d401f87f89f7
[svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff
changeset
|
205 /* turn off window decorations. |
d401f87f89f7
[svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff
changeset
|
206 * we could pull this in from a motif header, but it's easier to |
d401f87f89f7
[svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff
changeset
|
207 * use this snippet i found on a mailing list. */ |
d401f87f89f7
[svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from 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 Atom mwm_hints = XInternAtom(dpy, "_MOTIF_WM_HINTS", False); |
d401f87f89f7
[svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from 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 #define MWM_HINTS_DECORATIONS (1<<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
|
210 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
|
211 long flags, functions, decorations, input_mode; |
d401f87f89f7
[svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from 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 } mwm_hints_setting = { |
d401f87f89f7
[svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff
changeset
|
213 MWM_HINTS_DECORATIONS, 0, 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
|
214 }; |
d401f87f89f7
[svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff
changeset
|
215 XChangeProperty(dpy, win, |
d401f87f89f7
[svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff
changeset
|
216 mwm_hints, mwm_hints, 32, PropModeReplace, |
d401f87f89f7
[svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff
changeset
|
217 (unsigned char *)&mwm_hints_setting, 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
|
218 |
d401f87f89f7
[svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff
changeset
|
219 /* always on top, not in taskbar or pager. */ |
d401f87f89f7
[svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff
changeset
|
220 Atom win_state = XInternAtom(dpy, "_NET_WM_STATE", False); |
d401f87f89f7
[svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff
changeset
|
221 Atom win_state_setting[] = { |
d401f87f89f7
[svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff
changeset
|
222 XInternAtom(dpy, "_NET_WM_STATE_ABOVE", False), |
d401f87f89f7
[svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff
changeset
|
223 XInternAtom(dpy, "_NET_WM_STATE_SKIP_TASKBAR", False), |
d401f87f89f7
[svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff
changeset
|
224 XInternAtom(dpy, "_NET_WM_STATE_SKIP_PAGER", False) |
d401f87f89f7
[svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff
changeset
|
225 }; |
d401f87f89f7
[svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff
changeset
|
226 XChangeProperty(dpy, win, win_state, XA_ATOM, 32, |
d401f87f89f7
[svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff
changeset
|
227 PropModeReplace, (unsigned char*)&win_state_setting, 3); |
614
354389b85dce
[svn] - aosd, further work on ghosd source: do not use a override_redirect=true window and give the WM information about initial pos/size of osd (prevents flickering with normal windows); now the osd won't be displayed in multiple workspaces, only in the one where it's initially triggered
giacomo
parents:
590
diff
changeset
|
228 |
354389b85dce
[svn] - aosd, further work on ghosd source: do not use a override_redirect=true window and give the WM information about initial pos/size of osd (prevents flickering with normal windows); now the osd won't be displayed in multiple workspaces, only in the one where it's initially triggered
giacomo
parents:
590
diff
changeset
|
229 /* give initial pos/size information to window manager |
354389b85dce
[svn] - aosd, further work on ghosd source: do not use a override_redirect=true window and give the WM information about initial pos/size of osd (prevents flickering with normal windows); now the osd won't be displayed in multiple workspaces, only in the one where it's initially triggered
giacomo
parents:
590
diff
changeset
|
230 about the window, this prevents flickering */ |
624 | 231 /* NOTE: unneeded if override_redirect is set to True |
614
354389b85dce
[svn] - aosd, further work on ghosd source: do not use a override_redirect=true window and give the WM information about initial pos/size of osd (prevents flickering with normal windows); now the osd won't be displayed in multiple workspaces, only in the one where it's initially triggered
giacomo
parents:
590
diff
changeset
|
232 sizehints = XAllocSizeHints(); |
354389b85dce
[svn] - aosd, further work on ghosd source: do not use a override_redirect=true window and give the WM information about initial pos/size of osd (prevents flickering with normal windows); now the osd won't be displayed in multiple workspaces, only in the one where it's initially triggered
giacomo
parents:
590
diff
changeset
|
233 sizehints->flags = USPosition | USSize; |
354389b85dce
[svn] - aosd, further work on ghosd source: do not use a override_redirect=true window and give the WM information about initial pos/size of osd (prevents flickering with normal windows); now the osd won't be displayed in multiple workspaces, only in the one where it's initially triggered
giacomo
parents:
590
diff
changeset
|
234 sizehints->x = -1; |
354389b85dce
[svn] - aosd, further work on ghosd source: do not use a override_redirect=true window and give the WM information about initial pos/size of osd (prevents flickering with normal windows); now the osd won't be displayed in multiple workspaces, only in the one where it's initially triggered
giacomo
parents:
590
diff
changeset
|
235 sizehints->y = -1; |
354389b85dce
[svn] - aosd, further work on ghosd source: do not use a override_redirect=true window and give the WM information about initial pos/size of osd (prevents flickering with normal windows); now the osd won't be displayed in multiple workspaces, only in the one where it's initially triggered
giacomo
parents:
590
diff
changeset
|
236 sizehints->width = 1; |
354389b85dce
[svn] - aosd, further work on ghosd source: do not use a override_redirect=true window and give the WM information about initial pos/size of osd (prevents flickering with normal windows); now the osd won't be displayed in multiple workspaces, only in the one where it's initially triggered
giacomo
parents:
590
diff
changeset
|
237 sizehints->height = 1; |
354389b85dce
[svn] - aosd, further work on ghosd source: do not use a override_redirect=true window and give the WM information about initial pos/size of osd (prevents flickering with normal windows); now the osd won't be displayed in multiple workspaces, only in the one where it's initially triggered
giacomo
parents:
590
diff
changeset
|
238 XSetWMNormalHints(dpy, win, sizehints); |
624 | 239 XFree( sizehints );*/ |
617
312bc3bb686e
[svn] - aosd: added window class hints (aosd.Audacious)
giacomo
parents:
616
diff
changeset
|
240 |
312bc3bb686e
[svn] - aosd: added window class hints (aosd.Audacious)
giacomo
parents:
616
diff
changeset
|
241 classhints = XAllocClassHint(); |
312bc3bb686e
[svn] - aosd: added window class hints (aosd.Audacious)
giacomo
parents:
616
diff
changeset
|
242 classhints->res_name = res_name; |
312bc3bb686e
[svn] - aosd: added window class hints (aosd.Audacious)
giacomo
parents:
616
diff
changeset
|
243 classhints->res_class = res_class; |
312bc3bb686e
[svn] - aosd: added window class hints (aosd.Audacious)
giacomo
parents:
616
diff
changeset
|
244 XSetClassHint(dpy, win, classhints); |
312bc3bb686e
[svn] - aosd: added window class hints (aosd.Audacious)
giacomo
parents:
616
diff
changeset
|
245 XFree( classhints ); |
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 } |
d401f87f89f7
[svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from 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 |
d401f87f89f7
[svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff
changeset
|
248 static Window |
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:
899
diff
changeset
|
249 make_window(Display *dpy, Window root_win, Visual *visual, Colormap colormap, Bool use_argbvisual) { |
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 Window win; |
d401f87f89f7
[svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from 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 XSetWindowAttributes att; |
d401f87f89f7
[svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff
changeset
|
252 |
d401f87f89f7
[svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff
changeset
|
253 att.backing_store = WhenMapped; |
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:
899
diff
changeset
|
254 att.background_pixel = 0x0; |
569
d401f87f89f7
[svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff
changeset
|
255 att.border_pixel = 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
|
256 att.background_pixmap = None; |
d401f87f89f7
[svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff
changeset
|
257 att.save_under = True; |
590
6584e697e6da
[svn] - aosd: extended ghosd source with ghosd_set_event_button_cb to capture and handle button events in osd
giacomo
parents:
569
diff
changeset
|
258 att.event_mask = ExposureMask | StructureNotifyMask | ButtonPressMask; |
624 | 259 att.override_redirect = 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
|
260 |
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:
899
diff
changeset
|
261 if ( use_argbvisual ) |
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:
899
diff
changeset
|
262 { |
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:
899
diff
changeset
|
263 att.colormap = colormap; |
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:
899
diff
changeset
|
264 win = XCreateWindow(dpy, root_win, |
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:
899
diff
changeset
|
265 -1, -1, 1, 1, 0, 32, InputOutput, visual, |
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:
899
diff
changeset
|
266 CWBackingStore | CWBackPixel | CWBackPixmap | CWBorderPixel | |
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:
899
diff
changeset
|
267 CWColormap | CWEventMask | CWSaveUnder | CWOverrideRedirect, |
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:
899
diff
changeset
|
268 &att); |
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:
899
diff
changeset
|
269 } else { |
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:
899
diff
changeset
|
270 win = XCreateWindow(dpy, root_win, |
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:
899
diff
changeset
|
271 -1, -1, 1, 1, 0, CopyFromParent, InputOutput, CopyFromParent, |
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:
899
diff
changeset
|
272 CWBackingStore | CWBackPixel | CWBackPixmap | CWBorderPixel | |
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
|
273 CWEventMask | CWSaveUnder | CWOverrideRedirect, |
d401f87f89f7
[svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff
changeset
|
274 &att); |
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:
899
diff
changeset
|
275 } |
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
|
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 set_hints(dpy, win); |
d401f87f89f7
[svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff
changeset
|
278 |
d401f87f89f7
[svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff
changeset
|
279 return win; |
d401f87f89f7
[svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff
changeset
|
280 } |
d401f87f89f7
[svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from 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 void |
d401f87f89f7
[svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from 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 ghosd_show(Ghosd *ghosd) { |
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:
899
diff
changeset
|
284 if ((!ghosd->composite) && (ghosd->transparent)) { |
889 | 285 if (ghosd->background.set) |
286 { | |
287 XFreePixmap(ghosd->dpy, ghosd->background.pixmap); | |
288 ghosd->background.set = 0; | |
289 } | |
290 ghosd->background.pixmap = take_snapshot(ghosd); | |
291 ghosd->background.set = 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
|
292 } |
d401f87f89f7
[svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff
changeset
|
293 |
d401f87f89f7
[svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff
changeset
|
294 ghosd_render(ghosd); |
899
68508f8cdf25
[svn] - aosd: use XMapRaised in place of XMapWindow to ensure that the osd window is raised with some window managers
giacomo
parents:
889
diff
changeset
|
295 XMapRaised(ghosd->dpy, ghosd->win); |
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
|
296 } |
d401f87f89f7
[svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff
changeset
|
297 |
d401f87f89f7
[svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff
changeset
|
298 void |
d401f87f89f7
[svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff
changeset
|
299 ghosd_hide(Ghosd *ghosd) { |
d401f87f89f7
[svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff
changeset
|
300 XUnmapWindow(ghosd->dpy, ghosd->win); |
d401f87f89f7
[svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from 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 |
d401f87f89f7
[svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from 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 void |
d401f87f89f7
[svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff
changeset
|
304 ghosd_set_transparent(Ghosd *ghosd, int transparent) { |
d401f87f89f7
[svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff
changeset
|
305 ghosd->transparent = (transparent != 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
|
306 } |
d401f87f89f7
[svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff
changeset
|
307 |
d401f87f89f7
[svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff
changeset
|
308 void |
d401f87f89f7
[svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff
changeset
|
309 ghosd_set_render(Ghosd *ghosd, GhosdRenderFunc render_func, |
d401f87f89f7
[svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff
changeset
|
310 void *user_data, void (*user_data_d)(void*)) { |
d401f87f89f7
[svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff
changeset
|
311 ghosd->render.func = render_func; |
d401f87f89f7
[svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff
changeset
|
312 ghosd->render.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
|
313 ghosd->render.data_destroy = user_data_d; |
d401f87f89f7
[svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from 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 } |
d401f87f89f7
[svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff
changeset
|
315 |
d401f87f89f7
[svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff
changeset
|
316 void |
d401f87f89f7
[svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff
changeset
|
317 ghosd_set_position(Ghosd *ghosd, int x, int y, int width, int 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
|
318 const int dpy_width = DisplayWidth(ghosd->dpy, DefaultScreen(ghosd->dpy)); |
d401f87f89f7
[svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff
changeset
|
319 const int dpy_height = DisplayHeight(ghosd->dpy, DefaultScreen(ghosd->dpy)); |
d401f87f89f7
[svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff
changeset
|
320 |
d401f87f89f7
[svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff
changeset
|
321 if (x == GHOSD_COORD_CENTER) { |
d401f87f89f7
[svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff
changeset
|
322 x = (dpy_width - width) / 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
|
323 } else if (x < 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
|
324 x = dpy_width - width + x; |
d401f87f89f7
[svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff
changeset
|
325 } |
d401f87f89f7
[svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff
changeset
|
326 |
d401f87f89f7
[svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff
changeset
|
327 if (y == GHOSD_COORD_CENTER) { |
d401f87f89f7
[svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff
changeset
|
328 y = (dpy_height - height) / 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
|
329 } else if (y < 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
|
330 y = dpy_height - height + 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
|
331 } |
d401f87f89f7
[svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff
changeset
|
332 |
d401f87f89f7
[svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff
changeset
|
333 ghosd->x = x; |
d401f87f89f7
[svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff
changeset
|
334 ghosd->y = 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
|
335 ghosd->width = 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
|
336 ghosd->height = 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
|
337 |
d401f87f89f7
[svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff
changeset
|
338 XMoveResizeWindow(ghosd->dpy, ghosd->win, |
d401f87f89f7
[svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff
changeset
|
339 ghosd->x, ghosd->y, ghosd->width, ghosd->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
|
340 } |
d401f87f89f7
[svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff
changeset
|
341 |
590
6584e697e6da
[svn] - aosd: extended ghosd source with ghosd_set_event_button_cb to capture and handle button events in osd
giacomo
parents:
569
diff
changeset
|
342 void |
6584e697e6da
[svn] - aosd: extended ghosd source with ghosd_set_event_button_cb to capture and handle button events in osd
giacomo
parents:
569
diff
changeset
|
343 ghosd_set_event_button_cb(Ghosd *ghosd, GhosdEventButtonCb func, void *user_data) |
6584e697e6da
[svn] - aosd: extended ghosd source with ghosd_set_event_button_cb to capture and handle button events in osd
giacomo
parents:
569
diff
changeset
|
344 { |
6584e697e6da
[svn] - aosd: extended ghosd source with ghosd_set_event_button_cb to capture and handle button events in osd
giacomo
parents:
569
diff
changeset
|
345 ghosd->eventbutton.func = func; |
6584e697e6da
[svn] - aosd: extended ghosd source with ghosd_set_event_button_cb to capture and handle button events in osd
giacomo
parents:
569
diff
changeset
|
346 ghosd->eventbutton.data = user_data; |
6584e697e6da
[svn] - aosd: extended ghosd source with ghosd_set_event_button_cb to capture and handle button events in osd
giacomo
parents:
569
diff
changeset
|
347 } |
6584e697e6da
[svn] - aosd: extended ghosd source with ghosd_set_event_button_cb to capture and handle button events in osd
giacomo
parents:
569
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 #if 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
|
350 static int |
d401f87f89f7
[svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff
changeset
|
351 x_error_handler(Display *dpy, XErrorEvent* evt) { |
d401f87f89f7
[svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff
changeset
|
352 /* segfault so we can get a backtrace. */ |
d401f87f89f7
[svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff
changeset
|
353 char *x = 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
|
354 *x = 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
|
355 return 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
|
356 } |
d401f87f89f7
[svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff
changeset
|
357 #endif |
d401f87f89f7
[svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff
changeset
|
358 |
d401f87f89f7
[svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff
changeset
|
359 Ghosd* |
d401f87f89f7
[svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff
changeset
|
360 ghosd_new(void) { |
d401f87f89f7
[svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff
changeset
|
361 Ghosd *ghosd; |
d401f87f89f7
[svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff
changeset
|
362 Display *dpy; |
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:
899
diff
changeset
|
363 Window win, root_win; |
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:
899
diff
changeset
|
364 int screen_num; |
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:
899
diff
changeset
|
365 Visual *visual; |
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:
899
diff
changeset
|
366 Colormap colormap; |
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:
899
diff
changeset
|
367 Bool use_argbvisual = 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
|
368 |
d401f87f89f7
[svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff
changeset
|
369 dpy = XOpenDisplay(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
|
370 if (dpy == 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
|
371 fprintf(stderr, "Couldn't open display: (XXX FIXME)\n"); |
d401f87f89f7
[svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff
changeset
|
372 return 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
|
373 } |
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:
899
diff
changeset
|
374 |
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:
899
diff
changeset
|
375 screen_num = DefaultScreen(dpy); |
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:
899
diff
changeset
|
376 root_win = RootWindow(dpy, screen_num); |
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:
899
diff
changeset
|
377 visual = NULL; /* unused */ |
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:
899
diff
changeset
|
378 colormap = None; /* unused */ |
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
|
379 |
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:
899
diff
changeset
|
380 win = make_window(dpy, root_win, visual, colormap, use_argbvisual); |
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 ghosd = calloc(1, sizeof(Ghosd)); |
d401f87f89f7
[svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from 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 ghosd->dpy = dpy; |
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:
899
diff
changeset
|
384 ghosd->visual = visual; |
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:
899
diff
changeset
|
385 ghosd->colormap = colormap; |
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 ghosd->win = win; |
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:
899
diff
changeset
|
387 ghosd->root_win = root_win; |
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:
899
diff
changeset
|
388 ghosd->screen_num = screen_num; |
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
|
389 ghosd->transparent = 1; |
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:
899
diff
changeset
|
390 ghosd->composite = 0; |
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:
899
diff
changeset
|
391 ghosd->eventbutton.func = NULL; |
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:
899
diff
changeset
|
392 ghosd->background.set = 0; |
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:
899
diff
changeset
|
393 |
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:
899
diff
changeset
|
394 return ghosd; |
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:
899
diff
changeset
|
395 } |
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:
899
diff
changeset
|
396 |
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
|
397 #ifdef HAVE_XCOMPOSITE |
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:
899
diff
changeset
|
398 Ghosd * |
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:
899
diff
changeset
|
399 ghosd_new_with_argbvisual(void) { |
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:
899
diff
changeset
|
400 Ghosd *ghosd; |
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:
899
diff
changeset
|
401 Display *dpy; |
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:
899
diff
changeset
|
402 Window win, root_win; |
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:
899
diff
changeset
|
403 int screen_num; |
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:
899
diff
changeset
|
404 Visual *visual; |
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:
899
diff
changeset
|
405 Colormap colormap; |
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:
899
diff
changeset
|
406 Bool use_argbvisual = True; |
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:
899
diff
changeset
|
407 |
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:
899
diff
changeset
|
408 dpy = XOpenDisplay(NULL); |
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:
899
diff
changeset
|
409 if (dpy == NULL) { |
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:
899
diff
changeset
|
410 fprintf(stderr, "Couldn't open display: (XXX FIXME)\n"); |
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:
899
diff
changeset
|
411 return NULL; |
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:
899
diff
changeset
|
412 } |
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:
899
diff
changeset
|
413 |
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:
899
diff
changeset
|
414 screen_num = DefaultScreen(dpy); |
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:
899
diff
changeset
|
415 root_win = RootWindow(dpy, screen_num); |
909
cb0bb8e6d6e9
[svn] - aosd: added function to detect if a composite manager is active for a certain screen; this is not used for now, cause the _NET_WM_CM_Sn hint is pretty new; it will certainly prove useful at some time
giacomo
parents:
908
diff
changeset
|
416 visual = composite_find_argb_visual(dpy, screen_num); |
907 | 417 if (visual == NULL) |
418 return NULL; | |
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:
899
diff
changeset
|
419 colormap = XCreateColormap(dpy, root_win, visual, AllocNone); |
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:
899
diff
changeset
|
420 |
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:
899
diff
changeset
|
421 win = make_window(dpy, root_win, visual, colormap, use_argbvisual); |
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:
899
diff
changeset
|
422 |
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:
899
diff
changeset
|
423 ghosd = calloc(1, sizeof(Ghosd)); |
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:
899
diff
changeset
|
424 ghosd->dpy = dpy; |
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:
899
diff
changeset
|
425 ghosd->visual = visual; |
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:
899
diff
changeset
|
426 ghosd->colormap = colormap; |
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:
899
diff
changeset
|
427 ghosd->win = win; |
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:
899
diff
changeset
|
428 ghosd->root_win = root_win; |
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:
899
diff
changeset
|
429 ghosd->screen_num = screen_num; |
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:
899
diff
changeset
|
430 ghosd->transparent = 1; |
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:
899
diff
changeset
|
431 ghosd->composite = 1; |
590
6584e697e6da
[svn] - aosd: extended ghosd source with ghosd_set_event_button_cb to capture and handle button events in osd
giacomo
parents:
569
diff
changeset
|
432 ghosd->eventbutton.func = NULL; |
889 | 433 ghosd->background.set = 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
|
434 |
d401f87f89f7
[svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff
changeset
|
435 return ghosd; |
d401f87f89f7
[svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff
changeset
|
436 } |
d401f87f89f7
[svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff
changeset
|
437 |
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
|
438 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:
909
diff
changeset
|
439 ghosd_check_composite_ext(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
|
440 { |
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
|
441 Display *dpy; |
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:
909
diff
changeset
|
442 int have_composite_x = 0; |
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
|
443 int composite_event_base = 0, composite_error_base = 0; |
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
|
444 |
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
|
445 dpy = XOpenDisplay(NULL); |
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
|
446 if (dpy == NULL) { |
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
|
447 fprintf(stderr, "Couldn't open display: (XXX FIXME)\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
|
448 return 0; |
8b4b381b4399
[svn] aosd: added compile option in configure for composite support; this way, if support is compiled in, we can safely check if the composite module is loaded
giacomo
parents:
907
diff
changeset
|
449 } |
8b4b381b4399
[svn] aosd: added compile option in configure for composite support; this way, if support is compiled in, we can safely check if the composite module is loaded
giacomo
parents:
907
diff
changeset
|
450 |
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
|
451 if (!XCompositeQueryExtension(dpy, |
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 &composite_event_base, &composite_error_base)) |
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:
909
diff
changeset
|
453 have_composite_x = 0; |
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
|
454 else |
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:
909
diff
changeset
|
455 have_composite_x = 1; |
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 |
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 XCloseDisplay(dpy); |
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:
909
diff
changeset
|
458 return have_composite_x; |
0010163f8e25
[svn] - aosd: added support to detect whether a composite manager is running (either standard with _NET_WM_CM_Sn or xcompmgr)
giacomo
parents:
909
diff
changeset
|
459 } |
0010163f8e25
[svn] - aosd: added support to detect whether a composite manager is running (either standard with _NET_WM_CM_Sn or xcompmgr)
giacomo
parents:
909
diff
changeset
|
460 |
0010163f8e25
[svn] - aosd: added support to detect whether a composite manager is running (either standard with _NET_WM_CM_Sn or xcompmgr)
giacomo
parents:
909
diff
changeset
|
461 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:
909
diff
changeset
|
462 ghosd_check_composite_mgr(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:
909
diff
changeset
|
463 { |
0010163f8e25
[svn] - aosd: added support to detect whether a composite manager is running (either standard with _NET_WM_CM_Sn or xcompmgr)
giacomo
parents:
909
diff
changeset
|
464 Display *dpy; |
0010163f8e25
[svn] - aosd: added support to detect whether a composite manager is running (either standard with _NET_WM_CM_Sn or xcompmgr)
giacomo
parents:
909
diff
changeset
|
465 int have_composite_m = 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:
909
diff
changeset
|
466 |
0010163f8e25
[svn] - aosd: added support to detect whether a composite manager is running (either standard with _NET_WM_CM_Sn or xcompmgr)
giacomo
parents:
909
diff
changeset
|
467 dpy = XOpenDisplay(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:
909
diff
changeset
|
468 if (dpy == 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:
909
diff
changeset
|
469 fprintf(stderr, "Couldn't open display: (XXX FIXME)\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:
909
diff
changeset
|
470 return 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:
909
diff
changeset
|
471 } |
0010163f8e25
[svn] - aosd: added support to detect whether a composite manager is running (either standard with _NET_WM_CM_Sn or xcompmgr)
giacomo
parents:
909
diff
changeset
|
472 |
0010163f8e25
[svn] - aosd: added support to detect whether a composite manager is running (either standard with _NET_WM_CM_Sn or xcompmgr)
giacomo
parents:
909
diff
changeset
|
473 if (!composite_find_manager(dpy, DefaultScreen(dpy))) |
0010163f8e25
[svn] - aosd: added support to detect whether a composite manager is running (either standard with _NET_WM_CM_Sn or xcompmgr)
giacomo
parents:
909
diff
changeset
|
474 have_composite_m = 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:
909
diff
changeset
|
475 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:
909
diff
changeset
|
476 have_composite_m = 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:
909
diff
changeset
|
477 |
0010163f8e25
[svn] - aosd: added support to detect whether a composite manager is running (either standard with _NET_WM_CM_Sn or xcompmgr)
giacomo
parents:
909
diff
changeset
|
478 XCloseDisplay(dpy); |
0010163f8e25
[svn] - aosd: added support to detect whether a composite manager is running (either standard with _NET_WM_CM_Sn or xcompmgr)
giacomo
parents:
909
diff
changeset
|
479 return have_composite_m; |
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
|
480 } |
8b4b381b4399
[svn] aosd: added compile option in configure for composite support; this way, if support is compiled in, we can safely check if the composite module is loaded
giacomo
parents:
907
diff
changeset
|
481 #endif |
8b4b381b4399
[svn] aosd: added compile option in configure for composite support; this way, if support is compiled in, we can safely check if the composite module is loaded
giacomo
parents:
907
diff
changeset
|
482 |
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
|
483 void |
d401f87f89f7
[svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff
changeset
|
484 ghosd_destroy(Ghosd* ghosd) { |
889 | 485 if (ghosd->background.set) |
486 { | |
487 XFreePixmap(ghosd->dpy, ghosd->background.pixmap); | |
488 ghosd->background.set = 0; | |
489 } | |
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:
899
diff
changeset
|
490 if (ghosd->composite) |
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:
899
diff
changeset
|
491 { |
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:
899
diff
changeset
|
492 XFreeColormap(ghosd->dpy, ghosd->colormap); |
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:
899
diff
changeset
|
493 } |
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
|
494 XDestroyWindow(ghosd->dpy, ghosd->win); |
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:
899
diff
changeset
|
495 XCloseDisplay(ghosd->dpy); |
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
|
496 } |
d401f87f89f7
[svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff
changeset
|
497 |
d401f87f89f7
[svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff
changeset
|
498 int |
d401f87f89f7
[svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff
changeset
|
499 ghosd_get_socket(Ghosd *ghosd) { |
d401f87f89f7
[svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff
changeset
|
500 return ConnectionNumber(ghosd->dpy); |
d401f87f89f7
[svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff
changeset
|
501 } |
d401f87f89f7
[svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff
changeset
|
502 |
d401f87f89f7
[svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff
changeset
|
503 /* vim: set ts=2 sw=2 et cino=(0 : */ |