|
3 | 3 | // DO NOT EDIT
|
4 | 4 |
|
5 | 5 | use crate::{ffi, ColorState, MemoryFormat, Texture};
|
6 |
| -use glib::{ |
7 |
| - prelude::*, |
8 |
| - signal::{connect_raw, SignalHandlerId}, |
9 |
| - translate::*, |
10 |
| -}; |
11 |
| -use std::boxed::Box as Box_; |
| 6 | +use glib::translate::*; |
12 | 7 |
|
13 | 8 | glib::wrapper! {
|
14 | 9 | #[doc(alias = "GdkMemoryTextureBuilder")]
|
@@ -119,344 +114,6 @@ impl MemoryTextureBuilder {
|
119 | 114 | pub fn width(&self) -> i32 {
|
120 | 115 | unsafe { ffi::gdk_memory_texture_builder_get_width(self.to_glib_none().0) }
|
121 | 116 | }
|
122 |
| - |
123 |
| - #[doc(alias = "gdk_memory_texture_builder_set_bytes")] |
124 |
| - #[doc(alias = "bytes")] |
125 |
| - pub fn set_bytes(&self, bytes: Option<&glib::Bytes>) { |
126 |
| - unsafe { |
127 |
| - ffi::gdk_memory_texture_builder_set_bytes( |
128 |
| - self.to_glib_none().0, |
129 |
| - bytes.to_glib_none().0, |
130 |
| - ); |
131 |
| - } |
132 |
| - } |
133 |
| - |
134 |
| - #[doc(alias = "gdk_memory_texture_builder_set_color_state")] |
135 |
| - #[doc(alias = "color-state")] |
136 |
| - pub fn set_color_state(&self, color_state: Option<&ColorState>) { |
137 |
| - unsafe { |
138 |
| - ffi::gdk_memory_texture_builder_set_color_state( |
139 |
| - self.to_glib_none().0, |
140 |
| - color_state.to_glib_none().0, |
141 |
| - ); |
142 |
| - } |
143 |
| - } |
144 |
| - |
145 |
| - #[doc(alias = "gdk_memory_texture_builder_set_format")] |
146 |
| - #[doc(alias = "format")] |
147 |
| - pub fn set_format(&self, format: MemoryFormat) { |
148 |
| - unsafe { |
149 |
| - ffi::gdk_memory_texture_builder_set_format(self.to_glib_none().0, format.into_glib()); |
150 |
| - } |
151 |
| - } |
152 |
| - |
153 |
| - #[doc(alias = "gdk_memory_texture_builder_set_height")] |
154 |
| - #[doc(alias = "height")] |
155 |
| - pub fn set_height(&self, height: i32) { |
156 |
| - unsafe { |
157 |
| - ffi::gdk_memory_texture_builder_set_height(self.to_glib_none().0, height); |
158 |
| - } |
159 |
| - } |
160 |
| - |
161 |
| - #[cfg(feature = "v4_20")] |
162 |
| - #[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))] |
163 |
| - #[doc(alias = "gdk_memory_texture_builder_set_offset")] |
164 |
| - pub fn set_offset(&self, plane: u32, offset: usize) { |
165 |
| - unsafe { |
166 |
| - ffi::gdk_memory_texture_builder_set_offset(self.to_glib_none().0, plane, offset); |
167 |
| - } |
168 |
| - } |
169 |
| - |
170 |
| - #[doc(alias = "gdk_memory_texture_builder_set_stride")] |
171 |
| - #[doc(alias = "stride")] |
172 |
| - pub fn set_stride(&self, stride: usize) { |
173 |
| - unsafe { |
174 |
| - ffi::gdk_memory_texture_builder_set_stride(self.to_glib_none().0, stride); |
175 |
| - } |
176 |
| - } |
177 |
| - |
178 |
| - #[cfg(feature = "v4_20")] |
179 |
| - #[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))] |
180 |
| - #[doc(alias = "gdk_memory_texture_builder_set_stride_for_plane")] |
181 |
| - pub fn set_stride_for_plane(&self, plane: u32, stride: usize) { |
182 |
| - unsafe { |
183 |
| - ffi::gdk_memory_texture_builder_set_stride_for_plane( |
184 |
| - self.to_glib_none().0, |
185 |
| - plane, |
186 |
| - stride, |
187 |
| - ); |
188 |
| - } |
189 |
| - } |
190 |
| - |
191 |
| - #[doc(alias = "gdk_memory_texture_builder_set_update_region")] |
192 |
| - #[doc(alias = "update-region")] |
193 |
| - pub fn set_update_region(&self, region: Option<&cairo::Region>) { |
194 |
| - unsafe { |
195 |
| - ffi::gdk_memory_texture_builder_set_update_region( |
196 |
| - self.to_glib_none().0, |
197 |
| - mut_override(region.to_glib_none().0), |
198 |
| - ); |
199 |
| - } |
200 |
| - } |
201 |
| - |
202 |
| - #[doc(alias = "gdk_memory_texture_builder_set_update_texture")] |
203 |
| - #[doc(alias = "update-texture")] |
204 |
| - pub fn set_update_texture(&self, texture: Option<&impl IsA<Texture>>) { |
205 |
| - unsafe { |
206 |
| - ffi::gdk_memory_texture_builder_set_update_texture( |
207 |
| - self.to_glib_none().0, |
208 |
| - texture.map(|p| p.as_ref()).to_glib_none().0, |
209 |
| - ); |
210 |
| - } |
211 |
| - } |
212 |
| - |
213 |
| - #[doc(alias = "gdk_memory_texture_builder_set_width")] |
214 |
| - #[doc(alias = "width")] |
215 |
| - pub fn set_width(&self, width: i32) { |
216 |
| - unsafe { |
217 |
| - ffi::gdk_memory_texture_builder_set_width(self.to_glib_none().0, width); |
218 |
| - } |
219 |
| - } |
220 |
| - |
221 |
| - #[cfg(feature = "v4_16")] |
222 |
| - #[cfg_attr(docsrs, doc(cfg(feature = "v4_16")))] |
223 |
| - #[doc(alias = "bytes")] |
224 |
| - pub fn connect_bytes_notify<F: Fn(&Self) + Send + Sync + 'static>( |
225 |
| - &self, |
226 |
| - f: F, |
227 |
| - ) -> SignalHandlerId { |
228 |
| - unsafe extern "C" fn notify_bytes_trampoline< |
229 |
| - F: Fn(&MemoryTextureBuilder) + Send + Sync + 'static, |
230 |
| - >( |
231 |
| - this: *mut ffi::GdkMemoryTextureBuilder, |
232 |
| - _param_spec: glib::ffi::gpointer, |
233 |
| - f: glib::ffi::gpointer, |
234 |
| - ) { |
235 |
| - let f: &F = &*(f as *const F); |
236 |
| - f(&from_glib_borrow(this)) |
237 |
| - } |
238 |
| - unsafe { |
239 |
| - let f: Box_<F> = Box_::new(f); |
240 |
| - connect_raw( |
241 |
| - self.as_ptr() as *mut _, |
242 |
| - c"notify::bytes".as_ptr() as *const _, |
243 |
| - Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( |
244 |
| - notify_bytes_trampoline::<F> as *const (), |
245 |
| - )), |
246 |
| - Box_::into_raw(f), |
247 |
| - ) |
248 |
| - } |
249 |
| - } |
250 |
| - |
251 |
| - #[cfg(feature = "v4_16")] |
252 |
| - #[cfg_attr(docsrs, doc(cfg(feature = "v4_16")))] |
253 |
| - #[doc(alias = "color-state")] |
254 |
| - pub fn connect_color_state_notify<F: Fn(&Self) + Send + Sync + 'static>( |
255 |
| - &self, |
256 |
| - f: F, |
257 |
| - ) -> SignalHandlerId { |
258 |
| - unsafe extern "C" fn notify_color_state_trampoline< |
259 |
| - F: Fn(&MemoryTextureBuilder) + Send + Sync + 'static, |
260 |
| - >( |
261 |
| - this: *mut ffi::GdkMemoryTextureBuilder, |
262 |
| - _param_spec: glib::ffi::gpointer, |
263 |
| - f: glib::ffi::gpointer, |
264 |
| - ) { |
265 |
| - let f: &F = &*(f as *const F); |
266 |
| - f(&from_glib_borrow(this)) |
267 |
| - } |
268 |
| - unsafe { |
269 |
| - let f: Box_<F> = Box_::new(f); |
270 |
| - connect_raw( |
271 |
| - self.as_ptr() as *mut _, |
272 |
| - c"notify::color-state".as_ptr() as *const _, |
273 |
| - Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( |
274 |
| - notify_color_state_trampoline::<F> as *const (), |
275 |
| - )), |
276 |
| - Box_::into_raw(f), |
277 |
| - ) |
278 |
| - } |
279 |
| - } |
280 |
| - |
281 |
| - #[cfg(feature = "v4_16")] |
282 |
| - #[cfg_attr(docsrs, doc(cfg(feature = "v4_16")))] |
283 |
| - #[doc(alias = "format")] |
284 |
| - pub fn connect_format_notify<F: Fn(&Self) + Send + Sync + 'static>( |
285 |
| - &self, |
286 |
| - f: F, |
287 |
| - ) -> SignalHandlerId { |
288 |
| - unsafe extern "C" fn notify_format_trampoline< |
289 |
| - F: Fn(&MemoryTextureBuilder) + Send + Sync + 'static, |
290 |
| - >( |
291 |
| - this: *mut ffi::GdkMemoryTextureBuilder, |
292 |
| - _param_spec: glib::ffi::gpointer, |
293 |
| - f: glib::ffi::gpointer, |
294 |
| - ) { |
295 |
| - let f: &F = &*(f as *const F); |
296 |
| - f(&from_glib_borrow(this)) |
297 |
| - } |
298 |
| - unsafe { |
299 |
| - let f: Box_<F> = Box_::new(f); |
300 |
| - connect_raw( |
301 |
| - self.as_ptr() as *mut _, |
302 |
| - c"notify::format".as_ptr() as *const _, |
303 |
| - Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( |
304 |
| - notify_format_trampoline::<F> as *const (), |
305 |
| - )), |
306 |
| - Box_::into_raw(f), |
307 |
| - ) |
308 |
| - } |
309 |
| - } |
310 |
| - |
311 |
| - #[cfg(feature = "v4_16")] |
312 |
| - #[cfg_attr(docsrs, doc(cfg(feature = "v4_16")))] |
313 |
| - #[doc(alias = "height")] |
314 |
| - pub fn connect_height_notify<F: Fn(&Self) + Send + Sync + 'static>( |
315 |
| - &self, |
316 |
| - f: F, |
317 |
| - ) -> SignalHandlerId { |
318 |
| - unsafe extern "C" fn notify_height_trampoline< |
319 |
| - F: Fn(&MemoryTextureBuilder) + Send + Sync + 'static, |
320 |
| - >( |
321 |
| - this: *mut ffi::GdkMemoryTextureBuilder, |
322 |
| - _param_spec: glib::ffi::gpointer, |
323 |
| - f: glib::ffi::gpointer, |
324 |
| - ) { |
325 |
| - let f: &F = &*(f as *const F); |
326 |
| - f(&from_glib_borrow(this)) |
327 |
| - } |
328 |
| - unsafe { |
329 |
| - let f: Box_<F> = Box_::new(f); |
330 |
| - connect_raw( |
331 |
| - self.as_ptr() as *mut _, |
332 |
| - c"notify::height".as_ptr() as *const _, |
333 |
| - Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( |
334 |
| - notify_height_trampoline::<F> as *const (), |
335 |
| - )), |
336 |
| - Box_::into_raw(f), |
337 |
| - ) |
338 |
| - } |
339 |
| - } |
340 |
| - |
341 |
| - #[cfg(feature = "v4_16")] |
342 |
| - #[cfg_attr(docsrs, doc(cfg(feature = "v4_16")))] |
343 |
| - #[doc(alias = "stride")] |
344 |
| - pub fn connect_stride_notify<F: Fn(&Self) + Send + Sync + 'static>( |
345 |
| - &self, |
346 |
| - f: F, |
347 |
| - ) -> SignalHandlerId { |
348 |
| - unsafe extern "C" fn notify_stride_trampoline< |
349 |
| - F: Fn(&MemoryTextureBuilder) + Send + Sync + 'static, |
350 |
| - >( |
351 |
| - this: *mut ffi::GdkMemoryTextureBuilder, |
352 |
| - _param_spec: glib::ffi::gpointer, |
353 |
| - f: glib::ffi::gpointer, |
354 |
| - ) { |
355 |
| - let f: &F = &*(f as *const F); |
356 |
| - f(&from_glib_borrow(this)) |
357 |
| - } |
358 |
| - unsafe { |
359 |
| - let f: Box_<F> = Box_::new(f); |
360 |
| - connect_raw( |
361 |
| - self.as_ptr() as *mut _, |
362 |
| - c"notify::stride".as_ptr() as *const _, |
363 |
| - Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( |
364 |
| - notify_stride_trampoline::<F> as *const (), |
365 |
| - )), |
366 |
| - Box_::into_raw(f), |
367 |
| - ) |
368 |
| - } |
369 |
| - } |
370 |
| - |
371 |
| - #[cfg(feature = "v4_16")] |
372 |
| - #[cfg_attr(docsrs, doc(cfg(feature = "v4_16")))] |
373 |
| - #[doc(alias = "update-region")] |
374 |
| - pub fn connect_update_region_notify<F: Fn(&Self) + Send + Sync + 'static>( |
375 |
| - &self, |
376 |
| - f: F, |
377 |
| - ) -> SignalHandlerId { |
378 |
| - unsafe extern "C" fn notify_update_region_trampoline< |
379 |
| - F: Fn(&MemoryTextureBuilder) + Send + Sync + 'static, |
380 |
| - >( |
381 |
| - this: *mut ffi::GdkMemoryTextureBuilder, |
382 |
| - _param_spec: glib::ffi::gpointer, |
383 |
| - f: glib::ffi::gpointer, |
384 |
| - ) { |
385 |
| - let f: &F = &*(f as *const F); |
386 |
| - f(&from_glib_borrow(this)) |
387 |
| - } |
388 |
| - unsafe { |
389 |
| - let f: Box_<F> = Box_::new(f); |
390 |
| - connect_raw( |
391 |
| - self.as_ptr() as *mut _, |
392 |
| - c"notify::update-region".as_ptr() as *const _, |
393 |
| - Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( |
394 |
| - notify_update_region_trampoline::<F> as *const (), |
395 |
| - )), |
396 |
| - Box_::into_raw(f), |
397 |
| - ) |
398 |
| - } |
399 |
| - } |
400 |
| - |
401 |
| - #[cfg(feature = "v4_16")] |
402 |
| - #[cfg_attr(docsrs, doc(cfg(feature = "v4_16")))] |
403 |
| - #[doc(alias = "update-texture")] |
404 |
| - pub fn connect_update_texture_notify<F: Fn(&Self) + Send + Sync + 'static>( |
405 |
| - &self, |
406 |
| - f: F, |
407 |
| - ) -> SignalHandlerId { |
408 |
| - unsafe extern "C" fn notify_update_texture_trampoline< |
409 |
| - F: Fn(&MemoryTextureBuilder) + Send + Sync + 'static, |
410 |
| - >( |
411 |
| - this: *mut ffi::GdkMemoryTextureBuilder, |
412 |
| - _param_spec: glib::ffi::gpointer, |
413 |
| - f: glib::ffi::gpointer, |
414 |
| - ) { |
415 |
| - let f: &F = &*(f as *const F); |
416 |
| - f(&from_glib_borrow(this)) |
417 |
| - } |
418 |
| - unsafe { |
419 |
| - let f: Box_<F> = Box_::new(f); |
420 |
| - connect_raw( |
421 |
| - self.as_ptr() as *mut _, |
422 |
| - c"notify::update-texture".as_ptr() as *const _, |
423 |
| - Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( |
424 |
| - notify_update_texture_trampoline::<F> as *const (), |
425 |
| - )), |
426 |
| - Box_::into_raw(f), |
427 |
| - ) |
428 |
| - } |
429 |
| - } |
430 |
| - |
431 |
| - #[cfg(feature = "v4_16")] |
432 |
| - #[cfg_attr(docsrs, doc(cfg(feature = "v4_16")))] |
433 |
| - #[doc(alias = "width")] |
434 |
| - pub fn connect_width_notify<F: Fn(&Self) + Send + Sync + 'static>( |
435 |
| - &self, |
436 |
| - f: F, |
437 |
| - ) -> SignalHandlerId { |
438 |
| - unsafe extern "C" fn notify_width_trampoline< |
439 |
| - F: Fn(&MemoryTextureBuilder) + Send + Sync + 'static, |
440 |
| - >( |
441 |
| - this: *mut ffi::GdkMemoryTextureBuilder, |
442 |
| - _param_spec: glib::ffi::gpointer, |
443 |
| - f: glib::ffi::gpointer, |
444 |
| - ) { |
445 |
| - let f: &F = &*(f as *const F); |
446 |
| - f(&from_glib_borrow(this)) |
447 |
| - } |
448 |
| - unsafe { |
449 |
| - let f: Box_<F> = Box_::new(f); |
450 |
| - connect_raw( |
451 |
| - self.as_ptr() as *mut _, |
452 |
| - c"notify::width".as_ptr() as *const _, |
453 |
| - Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( |
454 |
| - notify_width_trampoline::<F> as *const (), |
455 |
| - )), |
456 |
| - Box_::into_raw(f), |
457 |
| - ) |
458 |
| - } |
459 |
| - } |
460 | 117 | }
|
461 | 118 |
|
462 | 119 | #[cfg(feature = "v4_16")]
|
|
0 commit comments