[Pkg-wmaker-commits] [wmcliphist] 14/49: wmcliphist: Migrate to GTK3; remove bitmaps in favor of Cairo for mask.
Doug Torrance
dtorrance-guest at moszumanska.debian.org
Tue Aug 18 01:51:34 UTC 2015
This is an automated email from the git hooks/post-receive script.
dtorrance-guest pushed a commit to branch master
in repository wmcliphist.
commit a0d7fa55efe378e39de18063d7f900f3332f4388
Author: Doug Torrance <dtorrance at monmouthcollege.edu>
Date: Sat Nov 22 20:48:46 2014 -0600
wmcliphist: Migrate to GTK3; remove bitmaps in favor of Cairo for mask.
---
Makefile | 8 +++-----
gui.c | 4 ----
icon/ico_16x16.xcf.bz2 | Bin 383 -> 0 bytes
icon/ico_16x16_mask.xbm | 7 -------
icon/ico_30x30.xcf.bz2 | Bin 2134 -> 0 bytes
icon/ico_30x30_mask.xbm | 14 --------------
icon/ico_40x40.xcf.bz2 | Bin 3309 -> 0 bytes
icon/ico_40x40_mask.xbm | 21 ---------------------
icon/ico_60x60.xcf.bz2 | Bin 5612 -> 0 bytes
icon/ico_60x60_mask.xbm | 44 --------------------------------------------
wmcliphist.c | 33 +++++++++------------------------
wmcliphist.h | 4 ----
12 files changed, 12 insertions(+), 123 deletions(-)
diff --git a/Makefile b/Makefile
index 2b0eb3b..109834c 100644
--- a/Makefile
+++ b/Makefile
@@ -3,7 +3,7 @@ INSTALL = install
PREFIX = /usr/local
BINDIR = $(PREFIX)/bin
DATADIR = $(PREFIX)/share/wmcliphist
-INCLUDES = `pkg-config --cflags gtk+-2.0 x11`
+INCLUDES = `pkg-config --cflags gtk+-3.0 x11`
# for normal use
CFLAGS += -Wall -ansi -pedantic $(INCLUDES) -DDATADIR=\"$(DATADIR)\"
@@ -15,7 +15,7 @@ DEBUG =
#CFLAGS += -Wall -g -ansi $(INCLUDES) -DFNCALL_DEBUG
#DEBUG = debug.o
-LIBS = `pkg-config --libs gtk+-2.0 x11`
+LIBS = `pkg-config --libs gtk+-3.0 x11`
OBJECTS = wmcliphist.o clipboard.o gui.o rcconfig.o history.o hotkeys.o utils.o $(DEBUG)
TARGET = wmcliphist
@@ -34,9 +34,7 @@ lclint:
wmcliphist: $(OBJECTS)
$(CC) $(LDFLAGS) $(OBJECTS) $(LIBS) -o $@
-wmcliphist.o: wmcliphist.c wmcliphist.h \
- icon/ico_60x60_mask.xbm icon/ico_40x40_mask.xbm \
- icon/ico_30x30_mask.xbm icon/ico_16x16_mask.xbm
+wmcliphist.o: wmcliphist.c wmcliphist.h
clipboard.o: clipboard.c wmcliphist.h
diff --git a/gui.c b/gui.c
index 550a0d9..0b02b5e 100644
--- a/gui.c
+++ b/gui.c
@@ -34,10 +34,6 @@ GtkWidget *button;
/* pixmap */
GtkWidget *pixmap;
-GdkPixmap *icon;
-GdkBitmap *icon_mask;
-GdkBitmap *mask;
-
/* ==========================================================================
* clipboard history menu
diff --git a/icon/ico_16x16.xcf.bz2 b/icon/ico_16x16.xcf.bz2
deleted file mode 100644
index ee1e4fc..0000000
Binary files a/icon/ico_16x16.xcf.bz2 and /dev/null differ
diff --git a/icon/ico_16x16_mask.xbm b/icon/ico_16x16_mask.xbm
deleted file mode 100644
index 3b82ead..0000000
--- a/icon/ico_16x16_mask.xbm
+++ /dev/null
@@ -1,7 +0,0 @@
-/* Created with The GIMP */
-#define ico_16x16_mask_width 16
-#define ico_16x16_mask_height 16
-static unsigned char ico_16x16_mask_bits[] = {
- 0xc0, 0x03, 0xf8, 0x1f, 0xfc, 0x3f, 0xfc, 0x7f, 0xfc, 0x7f, 0xfc, 0x7f,
- 0xfc, 0x7f, 0xfc, 0x7f, 0xfc, 0x7f, 0xfc, 0x7f, 0xfc, 0x7f, 0xfc, 0x7f,
- 0xfc, 0x7f, 0xfc, 0x7f, 0xf8, 0x7f, 0xf0, 0x3f };
diff --git a/icon/ico_30x30.xcf.bz2 b/icon/ico_30x30.xcf.bz2
deleted file mode 100644
index 6bb2f11..0000000
Binary files a/icon/ico_30x30.xcf.bz2 and /dev/null differ
diff --git a/icon/ico_30x30_mask.xbm b/icon/ico_30x30_mask.xbm
deleted file mode 100644
index fd44d1b..0000000
--- a/icon/ico_30x30_mask.xbm
+++ /dev/null
@@ -1,14 +0,0 @@
-/* Created with The GIMP */
-#define ico_30x30_mask_width 30
-#define ico_30x30_mask_height 30
-static unsigned char ico_30x30_mask_bits[] = {
- 0x00, 0xf8, 0x00, 0x00, 0x00, 0xfc, 0x01, 0x00, 0x00, 0xfc, 0x03, 0x00,
- 0xf8, 0xff, 0xff, 0x07, 0xf8, 0xff, 0xff, 0x07, 0xf8, 0xff, 0xff, 0x07,
- 0xf8, 0xff, 0xff, 0x07, 0xf8, 0xff, 0xff, 0x07, 0xf8, 0xff, 0xff, 0x07,
- 0xfc, 0xff, 0xff, 0x07, 0xfe, 0xff, 0xff, 0x07, 0xfe, 0xff, 0xff, 0x07,
- 0xfe, 0xff, 0xff, 0x07, 0xfe, 0xff, 0xff, 0x07, 0xfe, 0xff, 0xff, 0x07,
- 0xfc, 0xff, 0xff, 0x07, 0xfc, 0xff, 0xff, 0x07, 0xfc, 0xff, 0xff, 0x07,
- 0xf8, 0xff, 0xff, 0x07, 0xf8, 0xff, 0xff, 0x07, 0xf8, 0xff, 0xff, 0x07,
- 0xf8, 0xff, 0xff, 0x07, 0xf8, 0xff, 0xff, 0x07, 0xf8, 0xff, 0xff, 0x07,
- 0xf8, 0xff, 0xff, 0x07, 0xf8, 0xff, 0xff, 0x07, 0xf8, 0xff, 0xff, 0x07,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
diff --git a/icon/ico_40x40.xcf.bz2 b/icon/ico_40x40.xcf.bz2
deleted file mode 100644
index 22425be..0000000
Binary files a/icon/ico_40x40.xcf.bz2 and /dev/null differ
diff --git a/icon/ico_40x40_mask.xbm b/icon/ico_40x40_mask.xbm
deleted file mode 100644
index 559724e..0000000
--- a/icon/ico_40x40_mask.xbm
+++ /dev/null
@@ -1,21 +0,0 @@
-/* Created with The GIMP */
-#define ico_40x40_mask_width 40
-#define ico_40x40_mask_height 40
-static unsigned char ico_40x40_mask_bits[] = {
- 0x00, 0x80, 0x1f, 0x00, 0x00, 0x00, 0xc0, 0x3f, 0x00, 0x00, 0x00, 0xe0,
- 0x7f, 0x00, 0x00, 0x00, 0xe0, 0xfb, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff,
- 0x0f, 0xf0, 0xff, 0xff, 0xff, 0x0f, 0xf0, 0xff, 0xff, 0xff, 0x0f, 0xf0,
- 0xff, 0xff, 0xff, 0x0f, 0xf0, 0xff, 0xff, 0xff, 0x0f, 0xf0, 0xff, 0xff,
- 0xff, 0x0f, 0xf0, 0xff, 0xff, 0xff, 0x0f, 0xf0, 0xff, 0xff, 0xff, 0x0f,
- 0xf0, 0xff, 0xff, 0xff, 0x0f, 0xfc, 0xff, 0xff, 0xff, 0x0f, 0xfe, 0xff,
- 0xff, 0xff, 0x0f, 0xfe, 0xff, 0xff, 0xff, 0x0f, 0xfe, 0xff, 0xff, 0xff,
- 0x0f, 0xfe, 0xff, 0xff, 0xff, 0x0f, 0xfe, 0xff, 0xff, 0xff, 0x0f, 0xfc,
- 0xff, 0xff, 0xff, 0x0f, 0xfc, 0xff, 0xff, 0xff, 0x0f, 0xfc, 0xff, 0xff,
- 0xff, 0x0f, 0xf8, 0xff, 0xff, 0xff, 0x0f, 0xf8, 0xff, 0xff, 0xff, 0x0f,
- 0xf8, 0xff, 0xff, 0xff, 0x0f, 0xf8, 0xff, 0xff, 0xff, 0x0f, 0xf0, 0xff,
- 0xff, 0xff, 0x0f, 0xf0, 0xff, 0xff, 0xff, 0x0f, 0xf0, 0xff, 0xff, 0xff,
- 0x0f, 0xf0, 0xff, 0xff, 0xff, 0x0f, 0xf0, 0xff, 0xff, 0xff, 0x0f, 0xf0,
- 0xff, 0xff, 0xff, 0x0f, 0xf0, 0xff, 0xff, 0xff, 0x0f, 0xf0, 0xff, 0xff,
- 0xff, 0x0f, 0xf0, 0xff, 0xff, 0xff, 0x0f, 0xf0, 0xff, 0xff, 0xff, 0x0f,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
diff --git a/icon/ico_60x60.xcf.bz2 b/icon/ico_60x60.xcf.bz2
deleted file mode 100644
index 2ec3167..0000000
Binary files a/icon/ico_60x60.xcf.bz2 and /dev/null differ
diff --git a/icon/ico_60x60_mask.xbm b/icon/ico_60x60_mask.xbm
deleted file mode 100644
index 42ac06e..0000000
--- a/icon/ico_60x60_mask.xbm
+++ /dev/null
@@ -1,44 +0,0 @@
-#define ico_60x60_mask_width 60
-#define ico_60x60_mask_height 60
-static unsigned char ico_60x60_mask_bits[] = {
- 0x00, 0x00, 0x00, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff,
- 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0x03, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0xe0, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff,
- 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xe7, 0x1f, 0x00, 0x00, 0x00,
- 0xc0, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0x00, 0xc0, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0x3f, 0x00, 0xc0, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0x00,
- 0xc0, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0x00, 0xc0, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0x3f, 0x00, 0xc0, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0x00,
- 0xc0, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0x00, 0xc0, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0x3f, 0x00, 0xc0, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0x00,
- 0xc0, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0x00, 0xc0, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0x3f, 0x00, 0xc0, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0x00,
- 0xc0, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0x00, 0xe0, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0x3f, 0x00, 0xf8, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0x00,
- 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0x00, 0xfc, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0x3f, 0x00, 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0x00,
- 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0x00, 0xfc, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0x3f, 0x00, 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0x00,
- 0xf8, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0x00, 0xf8, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0x3f, 0x00, 0xf8, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0x00,
- 0xf8, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0x00, 0xf0, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0x3f, 0x00, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0x00,
- 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0x00, 0xf0, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0x3f, 0x00, 0xe0, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0x00,
- 0xe0, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0x00, 0xe0, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0x3f, 0x00, 0xc0, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0x00,
- 0xc0, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0x00, 0xc0, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0x3f, 0x00, 0xc0, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0x00,
- 0xc0, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0x00, 0xc0, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0x3f, 0x00, 0xc0, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0x00,
- 0xc0, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0x00, 0xc0, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0x3f, 0x00, 0xc0, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0x00,
- 0xc0, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0x00, 0xc0, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0x3f, 0x00, 0xc0, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0x00,
- 0xc0, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0x00, 0xc0, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0x3f, 0x00, 0xc0, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- };
diff --git a/wmcliphist.c b/wmcliphist.c
index e167f6b..63d276e 100644
--- a/wmcliphist.c
+++ b/wmcliphist.c
@@ -4,11 +4,6 @@
#include "wmcliphist.h"
-#include "icon/ico_60x60_mask.xbm"
-#include "icon/ico_40x40_mask.xbm"
-#include "icon/ico_30x30_mask.xbm"
-#include "icon/ico_16x16_mask.xbm"
-
/*
* print some help
*/
@@ -195,11 +190,6 @@ main(int argc, char **argv)
/* create icon_mask */
if (icon_size == 60) {
/* 60x60 icon */
- icon_mask = gdk_bitmap_create_from_data(gtk_widget_get_window(main_window),
- (gchar *) ico_60x60_mask_bits,
- ico_60x60_mask_width,
- ico_60x60_mask_height);
- /* create icon */
if (icon_number == 0) {
icon_file = "ico_60x60_gray.png";
} else if (icon_number == 1) {
@@ -209,10 +199,6 @@ main(int argc, char **argv)
}
} else if (icon_size == 40) {
/* 40x40 icon */
- icon_mask = gdk_bitmap_create_from_data(gtk_widget_get_window(main_window),
- (gchar *) ico_40x40_mask_bits,
- ico_40x40_mask_width,
- ico_40x40_mask_height);
/* create icon */
if (icon_number == 0) {
icon_file = "ico_40x40_gray.png";
@@ -223,10 +209,6 @@ main(int argc, char **argv)
}
} else if (icon_size == 30) {
/* 30x30 icon */
- icon_mask = gdk_bitmap_create_from_data(gtk_widget_get_window(main_window),
- (gchar *) ico_30x30_mask_bits,
- ico_30x30_mask_width,
- ico_30x30_mask_height);
/* create icon */
if (icon_number == 0) {
icon_file = "ico_30x30_gray.png";
@@ -237,10 +219,6 @@ main(int argc, char **argv)
}
} else {
/* 16x16 icon */
- icon_mask = gdk_bitmap_create_from_data(gtk_widget_get_window(main_window),
- (gchar *) ico_16x16_mask_bits,
- ico_16x16_mask_width,
- ico_16x16_mask_height);
/* create icon */
icon_file = "ico_16x16.png";
}
@@ -365,6 +343,9 @@ main(int argc, char **argv)
if (icon_size) {
+ cairo_region_t *region;
+ cairo_surface_t *surface;
+
/* connect signal for menu popup */
gtk_widget_add_events(dock_app, GDK_BUTTON_PRESS_MASK);
g_signal_connect(G_OBJECT(dock_app),
@@ -372,8 +353,12 @@ main(int argc, char **argv)
G_CALLBACK(button_press),
G_OBJECT(menu_hist));
- gdk_window_shape_combine_mask(gtk_widget_get_window(main_window), icon_mask, 0, 0);
- gdk_window_shape_combine_mask(gtk_widget_get_window(dock_app), icon_mask, 0, 0);
+ surface = cairo_image_surface_create_from_png(icon_file);
+ region = gdk_cairo_region_create_from_surface(surface);
+ gdk_window_shape_combine_region(gtk_widget_get_window(dock_app),
+ region, 0, 0);
+
+
}
diff --git a/wmcliphist.h b/wmcliphist.h
index 29b101b..0ea3c7d 100644
--- a/wmcliphist.h
+++ b/wmcliphist.h
@@ -280,10 +280,6 @@ extern GtkWidget *button;
/* pixmap */
extern GtkWidget *pixmap;
-extern GdkPixmap *icon;
-extern GdkBitmap *icon_mask;
-extern GdkBitmap *mask;
-
/*
* dock button click response
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-wmaker/wmcliphist.git
More information about the Pkg-wmaker-commits
mailing list