nautilus-3.6.3/eel/eel-gdk-extensions.c

No issues found

 1 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
 2 
 3 /* eel-gdk-extensions.c: Graphics routines to augment what's in gdk.
 4 
 5    Copyright (C) 1999, 2000 Eazel, Inc.
 6 
 7    The Gnome Library is free software; you can redistribute it and/or
 8    modify it under the terms of the GNU Library General Public License as
 9    published by the Free Software Foundation; either version 2 of the
10    License, or (at your option) any later version.
11 
12    The Gnome Library is distributed in the hope that it will be useful,
13    but WITHOUT ANY WARRANTY; without even the implied warranty of
14    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15    Library General Public License for more details.
16 
17    You should have received a copy of the GNU Library General Public
18    License along with the Gnome Library; see the file COPYING.LIB.  If not,
19    write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
20    Boston, MA 02111-1307, USA.
21 
22    Authors: Darin Adler <darin@eazel.com>, 
23             Pavel Cisler <pavel@eazel.com>,
24             Ramiro Estrugo <ramiro@eazel.com>
25 */
26 
27 #include <config.h>
28 #include "eel-gdk-extensions.h"
29 
30 #include "eel-glib-extensions.h"
31 #include "eel-string.h"
32 #include <gdk-pixbuf/gdk-pixbuf.h>
33 #include <gdk/gdk.h>
34 #include <gdk/gdkx.h>
35 #include <stdlib.h>
36 #include <pango/pango.h>
37 
38 EelGdkGeometryFlags
39 eel_gdk_parse_geometry (const char *string, int *x_return, int *y_return,
40 			     guint *width_return, guint *height_return)
41 {
42 	int x11_flags;
43 	EelGdkGeometryFlags gdk_flags;
44 
45 	g_return_val_if_fail (string != NULL, EEL_GDK_NO_VALUE);
46 	g_return_val_if_fail (x_return != NULL, EEL_GDK_NO_VALUE);
47 	g_return_val_if_fail (y_return != NULL, EEL_GDK_NO_VALUE);
48 	g_return_val_if_fail (width_return != NULL, EEL_GDK_NO_VALUE);
49 	g_return_val_if_fail (height_return != NULL, EEL_GDK_NO_VALUE);
50 
51 	x11_flags = XParseGeometry (string, x_return, y_return,
52 				    width_return, height_return);
53 
54 	gdk_flags = EEL_GDK_NO_VALUE;
55 	if (x11_flags & XValue) {
56 		gdk_flags |= EEL_GDK_X_VALUE;
57 	}
58 	if (x11_flags & YValue) {
59 		gdk_flags |= EEL_GDK_Y_VALUE;
60 	}
61 	if (x11_flags & WidthValue) {
62 		gdk_flags |= EEL_GDK_WIDTH_VALUE;
63 	}
64 	if (x11_flags & HeightValue) {
65 		gdk_flags |= EEL_GDK_HEIGHT_VALUE;
66 	}
67 	if (x11_flags & XNegative) {
68 		gdk_flags |= EEL_GDK_X_NEGATIVE;
69 	}
70 	if (x11_flags & YNegative) {
71 		gdk_flags |= EEL_GDK_Y_NEGATIVE;
72 	}
73 
74 	return gdk_flags;
75 }