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 cairo.c.types; 57 58 private import cairo.c.functions; 59 private import glib.ConstructionException; 60 61 private import glib.Str; 62 63 64 65 /** 66 * Cairo uses a single status type to represent all kinds of errors. A status 67 * value of CAIRO_STATUS_SUCCESS represents no error and has an integer value 68 * of zero. All other status values represent an error. 69 * 70 * Cairo's error handling is designed to be easy to use and safe. All major 71 * cairo objects retain an error status internally which 72 * can be queried anytime by the users using cairo*_status() calls. In 73 * the mean time, it is safe to call all cairo functions normally even if the 74 * underlying object is in an error status. This means that no error handling 75 * code is required before or after each individual cairo function call. 76 */ 77 public class Status 78 { 79 80 /** 81 */ 82 83 /** 84 * Provides a human-readable description of a cairo_status_t. 85 * Since 1.0 86 * Params: 87 * status = a cairo status 88 * Returns: a string representation of the status 89 */ 90 public static string oString(cairo_status_t status) 91 { 92 // const char * cairo_status_to_string (cairo_status_t status); 93 return Str.toString(cairo_status_to_string(status)); 94 } 95 96 /** 97 * Resets all static data within cairo to its original state, 98 * (ie. identical to the state at the time of program invocation). For 99 * example, all caches within cairo will be flushed empty. 100 * This function is intended to be useful when using memory-checking 101 * tools such as valgrind. When valgrind's memcheck analyzes a 102 * cairo-using program without a call to cairo_debug_reset_static_data(), 103 * it will report all data reachable via cairo's static objects as 104 * "still reachable". Calling cairo_debug_reset_static_data() just prior 105 * to program termination will make it easier to get squeaky clean 106 * reports from valgrind. 107 * WARNING: It is only safe to call this function when there are no 108 * active cairo objects remaining, (ie. the appropriate destroy 109 * functions have been called as necessary). If there are active cairo 110 * objects, this call is likely to cause a crash, (eg. an assertion 111 * failure due to a hash table being destroyed when non-empty). 112 * Since 1.0 113 */ 114 public static void debugResetStaticData() 115 { 116 // void cairo_debug_reset_static_data (void); 117 cairo_debug_reset_static_data(); 118 } 119 }