Re: gdk_pixbuf_new_from_inline to Gresource conversion



On 6 September 2017 at 13:55, Charles Curley
<charlescurley charlescurley com> wrote:
On Wed, 6 Sep 2017 11:22:25 +0100
Chris Vine <vine35792468 gmail com> wrote:

I am not going to answer your question I am afraid, but I am going to
make the observation that since GTK+2 will not be updated except for
bug fixes, unless you are thinking of porting your code to GTK+3 or
GTK+4 you might as well leave it as it is.  If the warning bothers
you, you can add -Wno-deprecated-declarations to your CFLAGS to
suppress it.

GdkPixbuf is separate from GTK+, so its deprecation warnings are
actually useful even if you're never going to port to newer GTK+
versions.

In this case, the idea is to remove the "inline image" support in
GdkPixbuf and replace it with GResources, which allow to portably and
safely embed any kind of resources inside the binary (either
application or shared library) or inside a blob that can be loaded at
run time.

More information about GResource is available here:
  https://developer.gnome.org/gio/stable/GResource.html

In short:

 - write an XML catalogue with the list of files to be included in the resource
 - generate the GResource from the catalogue using
`glib-compile-resources` as part of your build
  - you can either generate C source and header files, and compile
them into your own project
  - or you can generate a gresource binary blob and install it
somewhere alongside the rest of your project

Ciao,
 Emmanuele.

-- 
https://www.bassi.io
[@] ebassi [@gmail.com]


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]