1 /* GdkPixbuf library - Initialization functions
3 * Author: John Harper <john@dcs.warwick.ac.uk>
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Library General Public License for more details.
15 * You should have received a copy of the GNU Library General Public
16 * License along with this library; if not, write to the
17 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 * Boston, MA 02111-1307, USA.
23 #include <gdk-pixbuf/gdk-pixbuf-private.h>
24 #include "gdk-pixbuf-xlib-private.h"
26 Display *gdk_pixbuf_dpy = NULL;
27 int gdk_pixbuf_screen = -1;
30 * gdk_pixbuf_xlib_init:
31 * @display: X display to use.
32 * @screen_num: Screen number.
34 * Initializes the gdk-pixbuf Xlib machinery by calling xlib_rgb_init(). This
35 * function should be called near the beginning of your program, or before using
36 * any of the gdk-pixbuf-xlib functions.
39 gdk_pixbuf_xlib_init (Display *display, int screen_num)
41 xlib_rgb_init (display, ScreenOfDisplay (display, screen_num));
42 gdk_pixbuf_dpy = display;
43 gdk_pixbuf_screen = screen_num;
47 * gdk_pixbuf_xlib_init_with_depth:
48 * @display: X display to use.
49 * @screen_num: Screen number.
50 * @prefDepth: Preferred depth for XlibRGB.
52 * Similar to gdk_pixbuf_xlib_init(), but also lets you specify the preferred
53 * depth for XlibRGB if you do not want it to use the default depth it picks.
56 gdk_pixbuf_xlib_init_with_depth (Display *display,
57 int screen_num, int prefDepth)
59 xlib_rgb_init_with_depth (display, ScreenOfDisplay (display, screen_num),
61 gdk_pixbuf_dpy = display;
62 gdk_pixbuf_screen = screen_num;