]> Pileus Git - ~andy/gtk/blob - contrib/gdk-pixbuf-xlib/gdk-pixbuf-xlib.c
Include "config.h" instead of <config.h> Command used: find -name
[~andy/gtk] / contrib / gdk-pixbuf-xlib / gdk-pixbuf-xlib.c
1 /* GdkPixbuf library - Initialization functions
2  *
3  * Author: John Harper <john@dcs.warwick.ac.uk>
4  *
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.
9  *
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.
14  *
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.
19  */
20
21 #include "config.h"
22 #include <X11/Xlib.h>
23 #include <gdk-pixbuf/gdk-pixbuf-private.h>
24 #include "gdk-pixbuf-xlib-private.h"
25
26 Display *gdk_pixbuf_dpy = NULL;
27 int gdk_pixbuf_screen = -1;
28
29 /**
30  * gdk_pixbuf_xlib_init:
31  * @display: X display to use.
32  * @screen_num: Screen number.
33  * 
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.
37  **/
38 void
39 gdk_pixbuf_xlib_init (Display *display, int screen_num)
40 {
41     xlib_rgb_init (display, ScreenOfDisplay (display, screen_num));
42     gdk_pixbuf_dpy = display;
43     gdk_pixbuf_screen = screen_num;
44 }
45
46 /**
47  * gdk_pixbuf_xlib_init_with_depth:
48  * @display: X display to use.
49  * @screen_num: Screen number.
50  * @prefDepth: Preferred depth for XlibRGB.
51  * 
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.
54  **/
55 void
56 gdk_pixbuf_xlib_init_with_depth (Display *display,
57                                  int screen_num, int prefDepth)
58 {
59     xlib_rgb_init_with_depth (display, ScreenOfDisplay (display, screen_num),
60                               prefDepth);
61     gdk_pixbuf_dpy = display;
62     gdk_pixbuf_screen = screen_num;
63 }