1 /*
2 * This file is part of EvinceD.
3 * EvinceD is based on GtkD.
4 *
5 * EvinceD is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU Lesser General Public License
7 * as published by the Free Software Foundation; either version 3
8 * of the License, or (at your option) any later version, with
9 * some exceptions, please read the COPYING file.
10 *
11 * EvinceD is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public License
17 * along with EvinceD; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA
19 */20 21 // generated automatically - do not change22 // find conversion definition on APILookup.txt23 24 25 moduleevince.document.MappingList;
26 27 privateimportevince.document.c.functions;
28 publicimportevince.document.c.types;
29 privateimportglib.ConstructionException;
30 privateimportglib.ListG;
31 privateimportgobject.ObjectG;
32 privateimportgtkd.Loader;
33 34 35 /** */36 publicclassMappingList37 {
38 /** the main Gtk struct */39 protectedEvMappingList* evMappingList;
40 protectedboolownedRef;
41 42 /** Get the main Gtk struct */43 publicEvMappingList* getMappingListStruct(booltransferOwnership = false)
44 {
45 if (transferOwnership)
46 ownedRef = false;
47 returnevMappingList;
48 }
49 50 /** the main Gtk struct as a void* */51 protectedvoid* getStruct()
52 {
53 returncast(void*)evMappingList;
54 }
55 56 /**
57 * Sets our main struct and passes it to the parent class.
58 */59 publicthis (EvMappingList* evMappingList, boolownedRef = false)
60 {
61 this.evMappingList = evMappingList;
62 this.ownedRef = ownedRef;
63 }
64 65 ~this ()
66 {
67 if ( Linker.isLoaded(LIBRARY_EVINCEDOCUMENT) && ownedRef )
68 ev_mapping_list_unref(evMappingList);
69 }
70 71 72 /** */73 publicstaticGTypegetType()
74 {
75 returnev_mapping_list_get_type();
76 }
77 78 /**
79 *
80 * Params:
81 * page = page index for this mapping
82 * list = a #GList of data for the page
83 * dataDestroyFunc = function to free a list element
84 * Returns: an #EvMappingList
85 *
86 * Throws: ConstructionException GTK+ fails to create the object.
87 */88 publicthis(uintpage, ListGlist, GDestroyNotifydataDestroyFunc)
89 {
90 auto__p = ev_mapping_list_new(page, (listisnull) ? null : list.getListGStruct(), dataDestroyFunc);
91 92 if(__pisnull)
93 {
94 thrownewConstructionException("null returned by new");
95 }
96 97 this(cast(EvMappingList*) __p);
98 }
99 100 /**
101 *
102 * Params:
103 * data = mapping data to find
104 * Returns: an #EvMapping
105 */106 publicEvMapping* find(void* data)
107 {
108 returnev_mapping_list_find(evMappingList, data);
109 }
110 111 /**
112 *
113 * Params:
114 * data = mapping data to find
115 * func = function to use for equality check
116 * Returns: an #EvMapping
117 */118 publicEvMapping* findCustom(void* data, GCompareFuncfunc)
119 {
120 returnev_mapping_list_find_custom(evMappingList, data, func);
121 }
122 123 /**
124 *
125 * Params:
126 * x = X coordinate
127 * y = Y coordinate
128 * Returns: the #EvMapping in the list at coordinates (x, y)
129 *
130 * Since: 3.12
131 */132 publicEvMapping* get(doublex, doubley)
133 {
134 returnev_mapping_list_get(evMappingList, x, y);
135 }
136 137 /**
138 *
139 * Params:
140 * x = X coordinate
141 * y = Y coordinate
142 * Returns: the data of a mapping in the list at coordinates (x, y)
143 */144 publicvoid* getData(doublex, doubley)
145 {
146 returnev_mapping_list_get_data(evMappingList, x, y);
147 }
148 149 /**
150 * Returns: the data for this mapping list
151 */152 publicListGgetList()
153 {
154 auto__p = ev_mapping_list_get_list(evMappingList);
155 156 if(__pisnull)
157 {
158 returnnull;
159 }
160 161 returnnewListG(cast(GList*) __p);
162 }
163 164 /** */165 publicuintgetPage()
166 {
167 returnev_mapping_list_get_page(evMappingList);
168 }
169 170 /** */171 publicuintlength()
172 {
173 returnev_mapping_list_length(evMappingList);
174 }
175 176 /**
177 *
178 * Params:
179 * n = the position to retrieve
180 * Returns: the #Evmapping at position @n in @mapping_list
181 */182 publicEvMapping* nth(uintn)
183 {
184 returnev_mapping_list_nth(evMappingList, n);
185 }
186 187 aliasdoref = ref_;
188 /** */189 publicMappingListref_()
190 {
191 auto__p = ev_mapping_list_ref(evMappingList);
192 193 if(__pisnull)
194 {
195 returnnull;
196 }
197 198 returnObjectG.getDObject!(MappingList)(cast(EvMappingList*) __p, true);
199 }
200 201 /** */202 publicvoidremove(EvMapping* mapping)
203 {
204 ev_mapping_list_remove(evMappingList, mapping);
205 }
206 207 /** */208 publicvoidunref()
209 {
210 ev_mapping_list_unref(evMappingList);
211 }
212 }