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 = GtkIMMulticontext.html 27 * outPack = gtk 28 * outFile = IMMulticontext 29 * strct = GtkIMMulticontext 30 * realStrct= 31 * ctorStrct=GtkIMContext 32 * clss = IMMulticontext 33 * interf = 34 * class Code: No 35 * interface Code: No 36 * template for: 37 * extend = 38 * implements: 39 * prefixes: 40 * - gtk_im_multicontext_ 41 * omit structs: 42 * omit prefixes: 43 * omit code: 44 * omit signals: 45 * imports: 46 * - glib.Str 47 * - gtk.MenuShell 48 * structWrap: 49 * - GtkMenuShell* -> MenuShell 50 * module aliases: 51 * local aliases: 52 * overrides: 53 */ 54 55 module gtk.IMMulticontext; 56 57 public import gtkc.gtktypes; 58 59 private import gtkc.gtk; 60 private import glib.ConstructionException; 61 private import gobject.ObjectG; 62 63 private import glib.Str; 64 private import gtk.MenuShell; 65 66 67 private import gtk.IMContext; 68 69 /** 70 */ 71 public class IMMulticontext : IMContext 72 { 73 74 /** the main Gtk struct */ 75 protected GtkIMMulticontext* gtkIMMulticontext; 76 77 78 /** Get the main Gtk struct */ 79 public GtkIMMulticontext* getIMMulticontextStruct() 80 { 81 return gtkIMMulticontext; 82 } 83 84 85 /** the main Gtk struct as a void* */ 86 protected override void* getStruct() 87 { 88 return cast(void*)gtkIMMulticontext; 89 } 90 91 /** 92 * Sets our main struct and passes it to the parent class 93 */ 94 public this (GtkIMMulticontext* gtkIMMulticontext) 95 { 96 super(cast(GtkIMContext*)gtkIMMulticontext); 97 this.gtkIMMulticontext = gtkIMMulticontext; 98 } 99 100 protected override void setStruct(GObject* obj) 101 { 102 super.setStruct(obj); 103 gtkIMMulticontext = cast(GtkIMMulticontext*)obj; 104 } 105 106 /** 107 */ 108 109 /** 110 * Creates a new GtkIMMulticontext. 111 * Throws: ConstructionException GTK+ fails to create the object. 112 */ 113 public this () 114 { 115 // GtkIMContext * gtk_im_multicontext_new (void); 116 auto p = gtk_im_multicontext_new(); 117 if(p is null) 118 { 119 throw new ConstructionException("null returned by gtk_im_multicontext_new()"); 120 } 121 this(cast(GtkIMMulticontext*) p); 122 } 123 124 /** 125 * Warning 126 * gtk_im_multicontext_append_menuitems has been deprecated since version 3.10 and should not be used in newly-written code. It is better to use the system-wide input 127 * method framework for changing input methods. Modern 128 * desktop shells offer on-screen displays for this that 129 * can triggered with a keyboard shortcut, e.g. Super-Space. 130 * Add menuitems for various available input methods to a menu; 131 * the menuitems, when selected, will switch the input method 132 * for the context and the global default input method. 133 * Params: 134 * menushell = a GtkMenuShell 135 */ 136 public void appendMenuitems(MenuShell menushell) 137 { 138 // void gtk_im_multicontext_append_menuitems (GtkIMMulticontext *context, GtkMenuShell *menushell); 139 gtk_im_multicontext_append_menuitems(gtkIMMulticontext, (menushell is null) ? null : menushell.getMenuShellStruct()); 140 } 141 142 /** 143 * Gets the id of the currently active slave of the context. 144 * Since 2.16 145 * Returns: the id of the currently active slave 146 */ 147 public string getContextId() 148 { 149 // const char * gtk_im_multicontext_get_context_id (GtkIMMulticontext *context); 150 return Str.toString(gtk_im_multicontext_get_context_id(gtkIMMulticontext)); 151 } 152 153 /** 154 * Sets the context id for context. 155 * This causes the currently active slave of context to be 156 * replaced by the slave corresponding to the new context id. 157 * Since 2.16 158 * Params: 159 * context = a GtkIMMulticontext 160 * contextId = the id to use 161 */ 162 public void setContextId(string contextId) 163 { 164 // void gtk_im_multicontext_set_context_id (GtkIMMulticontext *context, const char *context_id); 165 gtk_im_multicontext_set_context_id(gtkIMMulticontext, Str.toStringz(contextId)); 166 } 167 }