grim/guifications2

Parents a65fa49017db
Children 90f10c7d5338
hacking on gf_display.c got some stuff left to do in it, but need to finish getting the build mostly working
--- a/src/gf_display.c Fri May 24 00:07:23 2013 -0500
+++ b/src/gf_display.c Fri May 24 00:27:59 2013 -0500
@@ -25,6 +25,7 @@
#include <glib.h>
#include <gtk/gtk.h>
#include <gdk/gdk.h>
+#include <cairo.h>
#include <math.h>
#include <string.h>
@@ -152,59 +153,6 @@
return FALSE;
}
-/*******************************************************************************
- * Gtk 2.0.0 stuff
- *
- * This is the default behavior of 2.0 and 1.x
- ******************************************************************************/
-#if !GTK_CHECK_VERSION(2,2,0)
-static void
-gf_display_get_geometry(gint *x, gint *y, gint *width, gint *height) {
- *x = *y = 0;
- *width = gdk_screen_width();
- *height = gdk_screen_height();
-}
-
-static void
-gf_display_shape(GfDisplay *display) {
- if(display->has_alpha) {
- GdkBitmap *bitmap = NULL;
- GdkPixbuf *pixbuf;
-
- if(display->state == GF_DISPLAY_STATE_SHOWING ||
- display->state == GF_DISPLAY_STATE_HIDING)
- {
- pixbuf = gtk_image_get_pixbuf(GTK_IMAGE(display->image));
-
- if(!pixbuf) {
- /* image has no pixbuf.. so we have no business continuing */
- return;
- }
- } else {
- pixbuf = display->pixbuf;
- }
-
- gdk_pixbuf_render_pixmap_and_mask(pixbuf, NULL, &bitmap, 255);
- if(bitmap) {
- gtk_widget_shape_combine_mask(display->window, bitmap, 0, 0);
- g_object_unref(G_OBJECT(bitmap));
- }
- }
-}
-
-static void
-gf_display_move(GfDisplay *display) {
- gtk_window_move(GTK_WINDOW(display->window), display->x, display->y);
-}
-
-#else /* !GTK_CHECK_VERSION(2,2,0) */
-/*******************************************************************************
- * Gtk 2.2.0 and up stuff
- *
- * Allows users to specify which screen to display the notifications on and
- * in the case of xinerama, to position it correctly
- ******************************************************************************/
-
static void
gf_display_get_geometry(gint *x, gint *y, gint *width, gint *height) {
GdkDisplay *display;
@@ -233,13 +181,13 @@
static void
gf_display_shape(GfDisplay *display) {
if(display->has_alpha) {
- GdkBitmap *bmap;
- GdkColormap *cmap;
GdkPixbuf *pixbuf;
GdkScreen *screen;
+ cairo_t *cr = NULL;
+ cairo_surface_t *surface = NULL;
+ gint width, height;
screen = gdk_display_get_screen(gdk_display_get_default(), disp_screen);
- cmap = gdk_screen_get_system_colormap(screen);
if(display->state == GF_DISPLAY_STATE_SHOWING ||
display->state == GF_DISPLAY_STATE_HIDING)
@@ -254,14 +202,13 @@
pixbuf = display->pixbuf;
}
- gdk_pixbuf_render_pixmap_and_mask_for_colormap(pixbuf, cmap, NULL,
- &bmap, 255);
+ width = gdk_pixbuf_get_width(pixbuf);
+ height = gdk_pixbuf_get_height(pixbuf);
- if(bmap) {
- gtk_widget_shape_combine_mask(display->window, bmap, 0, 0);
- if(bmap)
- g_object_unref(G_OBJECT(bmap));
- }
+ surface = cairo_image_surface_create(CAIRO_FORMAT_ARGB32, width, height);
+ cr = cairo_create(surface);
+
+# warning finish me!
}
}
@@ -273,8 +220,11 @@
screen_s = gtk_window_get_screen(GTK_WINDOW(display->window));
if(gdk_screen_get_number(screen_s) != gdk_screen_get_number(screen_t)) {
+# warning figure out what to do here
+#if 0
if(display->has_alpha)
gtk_widget_shape_combine_mask(display->window, NULL, 0, 0);
+#endif
gtk_window_set_screen(GTK_WINDOW(display->window), screen_t);
@@ -322,8 +272,6 @@
return monitors - 1;
}
-#endif /* GTK_CHECK_VERSION(2,2,0) */
-
/*******************************************************************************
* The normal code (tm)
******************************************************************************/