[libwnck/wip/muktupavels/wnck-image-menu-item] avoid deprecated gdk_pixbuf_new_from_inline
- From: Alberts Muktupāvels <muktupavels src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libwnck/wip/muktupavels/wnck-image-menu-item] avoid deprecated gdk_pixbuf_new_from_inline
- Date: Sat, 12 Nov 2016 02:01:35 +0000 (UTC)
commit 70d034957033efe0660159615e431433ffa143ec
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date: Sat Nov 12 04:01:00 2016 +0200
avoid deprecated gdk_pixbuf_new_from_inline
configure.ac | 9 +--------
libwnck/Makefile.am | 42 +++++++++++++++++++++---------------------
libwnck/selector.c | 3 +--
libwnck/util.c | 1 -
libwnck/wnck.gresource.xml | 6 ++++++
libwnck/xutils.c | 6 +-----
6 files changed, 30 insertions(+), 37 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 5d3724e..c1a95b5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -78,6 +78,7 @@ AM_GLIB_GNU_GETTEXT
wncklocaledir='${prefix}/${DATADIRNAME}/locale'
AC_SUBST(wncklocaledir)
+AC_PATH_PROG([GLIB_COMPILE_RESOURCES], [glib-compile-resources])
AC_PATH_PROG(PKG_CONFIG, pkg-config)
AC_CHECK_LIBM
@@ -156,14 +157,6 @@ PKG_CHECK_MODULES([LIBWNCK],[
$XRES_PACKAGE
])
-AC_PATH_PROG(GDK_PIXBUF_CSOURCE, gdk-pixbuf-csource, no)
-
-if test x"$GDK_PIXBUF_CSOURCE" = xno; then
- AC_MSG_ERROR([gdk-pixbuf-csource executable not found in your path - should be installed with GTK])
-fi
-
-AC_SUBST(GDK_PIXBUF_CSOURCE)
-
##################################################
# Checks for gtk-doc and docbook-tools
##################################################
diff --git a/libwnck/Makefile.am b/libwnck/Makefile.am
index 4bbe863..06a9161 100644
--- a/libwnck/Makefile.am
+++ b/libwnck/Makefile.am
@@ -1,3 +1,5 @@
+NULL =
+
lib_LTLIBRARIES = libwnck-3.la
bin_PROGRAMS =
noinst_PROGRAMS = \
@@ -41,12 +43,10 @@ wnck_headers = \
window-action-menu.h \
workspace.h
-wnck_built_installed_headers = wnck-enum-types.h
-
libwnckincludedir = $(includedir)/libwnck-3.0/libwnck
libwnckinclude_HEADERS = \
$(wnck_headers) \
- $(wnck_built_installed_headers) \
+ wnck-enum-types.h \
version.h
# Sources that are relevant for introspection
@@ -72,12 +72,8 @@ wnck_accessibility_files = \
workspace-accessible-factory.c \
workspace-accessible-factory.h
-wnck_built_headers = $(wnck_built_installed_headers) inlinepixbufs.h
-wnck_built_cfiles = wnck-enum-types.c
-
libwnck_3_la_SOURCES = \
- $(wnck_built_headers) \
- $(wnck_built_cfiles) \
+ $(BUILT_SOURCES) \
$(wnck_sources) \
private.h \
xutils.c \
@@ -86,8 +82,6 @@ libwnck_3_la_SOURCES = \
wnck-image-menu-item-private.h \
$(wnck_accessibility_files)
-$(libwnck_3_la_OBJECTS): $(wnck_built_headers)
-
libwnck_3_la_CPPFLAGS = \
$(AM_CPPFLAGS) \
$(XLIB_CFLAGS) \
@@ -152,20 +146,26 @@ wnck-enum-types.c: $(wnck_headers)
--vtail " return type;\n}\n\n" \
$^ > $@
-inlinepixbufs_SOURCES = default_icon.png
-inlinepixbufs_pairs = \
- default_icon_data $(srcdir)/default_icon.png
+wnck-resources.h wnck-resources.c: wnck.gresource.xml \
+ $(shell $(GLIB_COMPILE_RESOURCES) --sourcedir=$(srcdir) --generate-dependencies
$(srcdir)/wnck.gresource.xml)
+ $(AM_V_GEN) $(GLIB_COMPILE_RESOURCES) --target=$@ --sourcedir=$(srcdir) --generate --c-name libwnck $<
-inlinepixbufs.h: $(inlinepixbufs_SOURCES)
- $(AM_V_GEN)$(GDK_PIXBUF_CSOURCE) --raw --build-list $(inlinepixbufs_pairs) > $@
+BUILT_SOURCES = \
+ wnck-enum-types.c \
+ wnck-enum-types.h \
+ wnck-resources.c \
+ wnck-resources.h \
+ $(NULL)
CLEANFILES = \
- $(wnck_built_cfiles) \
- $(wnck_built_headers)
-
-EXTRA_DIST = \
- $(inlinepixbufs_SOURCES) \
- version.h.in
+ $(BUILT_SOURCES) \
+ $(NULL)
+
+EXTRA_DIST = \
+ default_icon.png \
+ wnck.gresource.xml \
+ version.h.in \
+ $(NULL)
# Introspection
-include $(INTROSPECTION_MAKEFILE)
diff --git a/libwnck/selector.c b/libwnck/selector.c
index d90f2ec..c24b6c7 100644
--- a/libwnck/selector.c
+++ b/libwnck/selector.c
@@ -31,7 +31,6 @@
#include <glib/gi18n-lib.h>
#include "selector.h"
-#include "inlinepixbufs.h"
#include "libwnck.h"
#include "screen.h"
#include "wnck-image-menu-item-private.h"
@@ -131,7 +130,7 @@ wnck_selector_get_default_window_icon (void)
if (retval)
return retval;
- retval = gdk_pixbuf_new_from_inline (-1, default_icon_data, FALSE, NULL);
+ retval = gdk_pixbuf_new_from_resource ("/org/gnome/libwnck/default_icon.png", NULL);
g_assert (retval);
diff --git a/libwnck/util.c b/libwnck/util.c
index 01901b7..3164a9e 100644
--- a/libwnck/util.c
+++ b/libwnck/util.c
@@ -25,7 +25,6 @@
#include "util.h"
#include "xutils.h"
#include "private.h"
-#include "inlinepixbufs.h"
#include <gdk/gdkx.h>
#include <string.h>
#ifdef HAVE_XRES
diff --git a/libwnck/wnck.gresource.xml b/libwnck/wnck.gresource.xml
new file mode 100644
index 0000000..a1eb536
--- /dev/null
+++ b/libwnck/wnck.gresource.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<gresources>
+ <gresource prefix="/org/gnome/libwnck">
+ <file>default_icon.png</file>
+ </gresource>
+</gresources>
diff --git a/libwnck/xutils.c b/libwnck/xutils.c
index e7dc56a..bf31383 100644
--- a/libwnck/xutils.c
+++ b/libwnck/xutils.c
@@ -30,7 +30,6 @@
#include "screen.h"
#include "window.h"
#include "private.h"
-#include "inlinepixbufs.h"
gboolean
_wnck_get_cardinal (Screen *screen,
@@ -2311,12 +2310,9 @@ static GdkPixbuf*
default_icon_at_size (int width,
int height)
{
-
GdkPixbuf *base;
- base = gdk_pixbuf_new_from_inline (-1, default_icon_data,
- FALSE,
- NULL);
+ base = gdk_pixbuf_new_from_resource ("/org/gnome/libwnck/default_icon.png", NULL);
g_assert (base);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]