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 gtk.IMContextSimple; 26 27 private import glib.ConstructionException; 28 private import gobject.ObjectG; 29 private import gtk.IMContext; 30 private import gtkc.gtk; 31 public import gtkc.gtktypes; 32 33 34 public class IMContextSimple : IMContext 35 { 36 /** the main Gtk struct */ 37 protected GtkIMContextSimple* gtkIMContextSimple; 38 39 /** Get the main Gtk struct */ 40 public GtkIMContextSimple* getIMContextSimpleStruct() 41 { 42 return gtkIMContextSimple; 43 } 44 45 /** the main Gtk struct as a void* */ 46 protected override void* getStruct() 47 { 48 return cast(void*)gtkIMContextSimple; 49 } 50 51 protected override void setStruct(GObject* obj) 52 { 53 gtkIMContextSimple = cast(GtkIMContextSimple*)obj; 54 super.setStruct(obj); 55 } 56 57 /** 58 * Sets our main struct and passes it to the parent class. 59 */ 60 public this (GtkIMContextSimple* gtkIMContextSimple, bool ownedRef = false) 61 { 62 this.gtkIMContextSimple = gtkIMContextSimple; 63 super(cast(GtkIMContext*)gtkIMContextSimple, ownedRef); 64 } 65 66 /** 67 */ 68 69 public static GType getType() 70 { 71 return gtk_im_context_simple_get_type(); 72 } 73 74 /** 75 * Creates a new #GtkIMContextSimple. 76 * 77 * Return: a new #GtkIMContextSimple. 78 * 79 * Throws: ConstructionException GTK+ fails to create the object. 80 */ 81 public this() 82 { 83 auto p = gtk_im_context_simple_new(); 84 85 if(p is null) 86 { 87 throw new ConstructionException("null returned by new"); 88 } 89 90 this(cast(GtkIMContextSimple*) p, true); 91 } 92 93 /** 94 * Adds an additional table to search to the input context. 95 * Each row of the table consists of @max_seq_len key symbols 96 * followed by two #guint16 interpreted as the high and low 97 * words of a #gunicode value. Tables are searched starting 98 * from the last added. 99 * 100 * The table must be sorted in dictionary order on the 101 * numeric value of the key symbol fields. (Values beyond 102 * the length of the sequence should be zero.) 103 * 104 * Params: 105 * data = the table 106 * maxSeqLen = Maximum length of a sequence in the table 107 * (cannot be greater than #GTK_MAX_COMPOSE_LEN) 108 * nSeqs = number of sequences in the table 109 */ 110 public void addTable(ushort[] data, int maxSeqLen, int nSeqs) 111 { 112 gtk_im_context_simple_add_table(gtkIMContextSimple, data.ptr, maxSeqLen, nSeqs); 113 } 114 }