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 module gobject.Flags; 26 27 private import glib.Str; 28 private import gtkc.gobject; 29 public import gtkc.gobjecttypes; 30 31 32 /** */ 33 public struct Flags 34 { 35 36 /** 37 * This function is meant to be called from the complete_type_info() 38 * function of a #GTypePlugin implementation, see the example for 39 * g_enum_complete_type_info() above. 40 * 41 * Params: 42 * gFlagsType = the type identifier of the type being completed 43 * info = the #GTypeInfo struct to be filled in 44 * constValues = An array of #GFlagsValue structs for the possible 45 * enumeration values. The array is terminated by a struct with all 46 * members being 0. 47 */ 48 public static void completeTypeInfo(GType gFlagsType, out GTypeInfo info, GFlagsValue* constValues) 49 { 50 g_flags_complete_type_info(gFlagsType, &info, constValues); 51 } 52 53 /** 54 * Returns the first #GFlagsValue which is set in @value. 55 * 56 * Params: 57 * flagsClass = a #GFlagsClass 58 * value = the value 59 * 60 * Returns: the first #GFlagsValue which is set in 61 * @value, or %NULL if none is set 62 */ 63 public static GFlagsValue* getFirstValue(GFlagsClass* flagsClass, uint value) 64 { 65 return g_flags_get_first_value(flagsClass, value); 66 } 67 68 /** 69 * Looks up a #GFlagsValue by name. 70 * 71 * Params: 72 * flagsClass = a #GFlagsClass 73 * name = the name to look up 74 * 75 * Returns: the #GFlagsValue with name @name, 76 * or %NULL if there is no flag with that name 77 */ 78 public static GFlagsValue* getValueByName(GFlagsClass* flagsClass, string name) 79 { 80 return g_flags_get_value_by_name(flagsClass, Str.toStringz(name)); 81 } 82 83 /** 84 * Looks up a #GFlagsValue by nickname. 85 * 86 * Params: 87 * flagsClass = a #GFlagsClass 88 * nick = the nickname to look up 89 * 90 * Returns: the #GFlagsValue with nickname @nick, 91 * or %NULL if there is no flag with that nickname 92 */ 93 public static GFlagsValue* getValueByNick(GFlagsClass* flagsClass, string nick) 94 { 95 return g_flags_get_value_by_nick(flagsClass, Str.toStringz(nick)); 96 } 97 98 /** 99 * Registers a new static flags type with the name @name. 100 * 101 * It is normally more convenient to let [glib-mkenums][glib-mkenums] 102 * generate a my_flags_get_type() function from a usual C enumeration 103 * definition than to write one yourself using g_flags_register_static(). 104 * 105 * Params: 106 * name = A nul-terminated string used as the name of the new type. 107 * constStaticValues = An array of #GFlagsValue structs for the possible 108 * flags values. The array is terminated by a struct with all members being 0. 109 * GObject keeps a reference to the data, so it cannot be stack-allocated. 110 * 111 * Returns: The new type identifier. 112 */ 113 public static GType registerStatic(string name, GFlagsValue* constStaticValues) 114 { 115 return g_flags_register_static(Str.toStringz(name), constStaticValues); 116 } 117 }