annotate src/aosd/ghosd.h @ 906:16e51fb5908e trunk

[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
author giacomo
date Sat, 31 Mar 2007 17:44:23 -0700
parents ff62f5530a36
children 8b4b381b4399
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
569
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
1 /* 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: 734
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: 734
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: 734
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 #ifndef __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
12 #define __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
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 <cairo/cairo.h>
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
15
734
ff62f5530a36 [svn] - freebsd portability fixes from "The_Paya". Closes #814.
nenolod
parents: 590
diff changeset
16 #include <limits.h> /* INT_MAX */
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
17 #include <sys/time.h> /* timeval */
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
18
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
19 typedef struct _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
20
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
21 /* minimal struct to handle button events */
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
22 typedef struct
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
23 {
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
24 int x, y;
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
25 int send_event;
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
26 int x_root, y_root;
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
27 unsigned int button;
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
28 unsigned long time;
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
29 }
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
30 GhosdEventButton;
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
31
569
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
32 typedef void (*GhosdRenderFunc)(Ghosd *ghosd, cairo_t *cr, void *user_data);
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
33 typedef void (*GhosdEventButtonCb)(Ghosd *ghosd, GhosdEventButton *event, void *user_data);
569
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
34
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
35 Ghosd *ghosd_new(void);
906
16e51fb5908e [svn] - aosd: beta4, ghosd source was rewritten to support argb visual (x composite extension) as an option, this allows to have real transparency in the OSD
giacomo
parents: 734
diff changeset
36 Ghosd *ghosd_new_with_argbvisual(void);
569
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
37 void ghosd_destroy(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
38
734
ff62f5530a36 [svn] - freebsd portability fixes from "The_Paya". Closes #814.
nenolod
parents: 590
diff changeset
39 #define GHOSD_COORD_CENTER INT_MAX
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
40 void 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
41 void 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
42 void 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
43 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
44
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
45 void 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
46 void ghosd_show(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
47 void 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
48
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
49 void ghosd_set_event_button_cb(Ghosd *ghosd, GhosdEventButtonCb cb, 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
50
569
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
51 void ghosd_main_iterations(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
52 void ghosd_main_until(Ghosd *ghosd, struct timeval *until);
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
53 void ghosd_flash(Ghosd *ghosd, int fade_ms, int total_display_ms);
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
54
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
55 int 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
56
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
57 #endif /* __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
58
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
59 /* vim: set ts=2 sw=2 et cino=(0 : */