1 /*
2  * This file is part of gtkD.
3  *
4  * gtkD is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU Lesser General Public License
6  * as published by the Free Software Foundation; either version 3
7  * of the License, or (at your option) any later version, with
8  * some exceptions, please read the COPYING file.
9  *
10  * gtkD 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
13  * GNU Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public License
16  * along with gtkD; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA
18  */
19  
20 // generated automatically - do not change
21 // find conversion definition on APILookup.txt
22 // implement new conversion functionalities on the wrap.utils pakage
23 
24 /*
25  * Conversion parameters:
26  * inFile  = cairo-Error-handling.html
27  * outPack = cairo
28  * outFile = Status
29  * strct   = 
30  * realStrct=
31  * ctorStrct=
32  * clss    = Status
33  * interf  = 
34  * class Code: No
35  * interface Code: No
36  * template for:
37  * extend  = 
38  * implements:
39  * prefixes:
40  * 	- cairo_status_t
41  * 	- cairo_
42  * omit structs:
43  * omit prefixes:
44  * omit code:
45  * omit signals:
46  * imports:
47  * 	- glib.Str
48  * structWrap:
49  * module aliases:
50  * local aliases:
51  * overrides:
52  */
53 
54 module cairo.Status;
55 
56 public  import gtkc.cairotypes;
57 
58 private import gtkc.cairo;
59 private import glib.ConstructionException;
60 
61 
62 private import glib.Str;
63 
64 
65 
66 
67 /**
68  * Cairo uses a single status type to represent all kinds of errors. A status
69  * value of CAIRO_STATUS_SUCCESS represents no error and has an integer value
70  * of zero. All other status values represent an error.
71  *
72  * Cairo's error handling is designed to be easy to use and safe. All major
73  * cairo objects retain an error status internally which
74  * can be queried anytime by the users using cairo*_status() calls. In
75  * the mean time, it is safe to call all cairo functions normally even if the
76  * underlying object is in an error status. This means that no error handling
77  * code is required before or after each individual cairo function call.
78  */
79 public class Status
80 {
81 	
82 	/**
83 	 */
84 	
85 	/**
86 	 * Provides a human-readable description of a cairo_status_t.
87 	 * Since 1.0
88 	 * Params:
89 	 * status = a cairo status
90 	 * Returns: a string representation of the status
91 	 */
92 	public static string oString(cairo_status_t status)
93 	{
94 		// const char * cairo_status_to_string (cairo_status_t status);
95 		return Str.toString(cairo_status_to_string(status));
96 	}
97 	
98 	/**
99 	 * Resets all static data within cairo to its original state,
100 	 * (ie. identical to the state at the time of program invocation). For
101 	 * example, all caches within cairo will be flushed empty.
102 	 * This function is intended to be useful when using memory-checking
103 	 * tools such as valgrind. When valgrind's memcheck analyzes a
104 	 * cairo-using program without a call to cairo_debug_reset_static_data(),
105 	 * it will report all data reachable via cairo's static objects as
106 	 * "still reachable". Calling cairo_debug_reset_static_data() just prior
107 	 * to program termination will make it easier to get squeaky clean
108 	 * reports from valgrind.
109 	 * WARNING: It is only safe to call this function when there are no
110 	 * active cairo objects remaining, (ie. the appropriate destroy
111 	 * functions have been called as necessary). If there are active cairo
112 	 * objects, this call is likely to cause a crash, (eg. an assertion
113 	 * failure due to a hash table being destroyed when non-empty).
114 	 * Since 1.0
115 	 */
116 	public static void debugResetStaticData()
117 	{
118 		// void cairo_debug_reset_static_data (void);
119 		cairo_debug_reset_static_data();
120 	}
121 }