summaryrefslogtreecommitdiffstats
path: root/abs/mv-core/ghosd/ghosd-0.0.1/ghosd/ghosd-text.c
diff options
context:
space:
mode:
authorJames Meyer <james.meyer@operamail.com>2009-02-23 21:19:04 (GMT)
committerJames Meyer <james.meyer@operamail.com>2009-02-23 21:19:04 (GMT)
commit577c09bc1ea57e3fc5fe459ad91aafa4412b2297 (patch)
tree5fdcf480f545a75514783b155e3b23dea397eaf6 /abs/mv-core/ghosd/ghosd-0.0.1/ghosd/ghosd-text.c
parent1552b1b0221ed6a7e26e486187be25031408b453 (diff)
downloadlinhes_pkgbuild-577c09bc1ea57e3fc5fe459ad91aafa4412b2297.zip
linhes_pkgbuild-577c09bc1ea57e3fc5fe459ad91aafa4412b2297.tar.gz
linhes_pkgbuild-577c09bc1ea57e3fc5fe459ad91aafa4412b2297.tar.bz2
adding in ghosd
Diffstat (limited to 'abs/mv-core/ghosd/ghosd-0.0.1/ghosd/ghosd-text.c')
-rw-r--r--abs/mv-core/ghosd/ghosd-0.0.1/ghosd/ghosd-text.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/abs/mv-core/ghosd/ghosd-0.0.1/ghosd/ghosd-text.c b/abs/mv-core/ghosd/ghosd-0.0.1/ghosd/ghosd-text.c
new file mode 100644
index 0000000..ba62616
--- /dev/null
+++ b/abs/mv-core/ghosd/ghosd-0.0.1/ghosd/ghosd-text.c
@@ -0,0 +1,25 @@
+/* ghosd -- OSD with fake transparency, cairo, and pango.
+ * Copyright (C) 2006 Evan Martin <martine@danga.com>
+ */
+
+#include "config.h"
+
+#include <pango/pangocairo.h>
+#include "ghosd-internal.h"
+#include "ghosd-text.h"
+
+void
+ghosd_text_set_position(Ghosd *ghosd, int x, int y, PangoLayout *layout) {
+ PangoRectangle ink_rect;
+ pango_layout_get_pixel_extents(layout, &ink_rect, NULL);
+ /*printf("rect %d %d %d %d\n",
+ ink_rect.x, ink_rect.y,
+ ink_rect.width, ink_rect.height);*/
+
+ const int width = ink_rect.x + ink_rect.width+5;
+ const int height = ink_rect.y + ink_rect.height+5;
+
+ ghosd_set_position(ghosd, x, y, width, height);
+}
+
+/* vim: set ts=2 sw=2 et cino=(0 : */