rute 0.0.6

UI library implemented on top of Qt
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
// This file is auto-generated by rute_gen. DO NOT EDIT.
use std::cell::Cell;
use std::rc::Rc;

#[allow(unused_imports)]
use std::marker::PhantomData;

#[allow(unused_imports)]
use std::os::raw::c_void;

#[allow(unused_imports)]
use std::mem::transmute;

#[allow(unused_imports)]
use std::ffi::{CStr, CString};

use rute_ffi_base::*;

#[allow(unused_imports)]
use auto::*;

/// **Notice these docs are heavy WIP and not very relevent yet**
///
/// This class is mainly used to create mouse cursors that are
/// associated with particular widgets and to get and set the position
/// of the mouse cursor.
///
/// Qt has a number of standard cursor shapes, but you can also make
/// custom cursor shapes based on a QBitmap, a mask and a hotspot.
///
/// To associate a cursor with a widget, use QWidget::setCursor(). To
/// associate a cursor with all widgets (normally for a short period
/// of time), use QGuiApplication::setOverrideCursor().
///
/// To set a cursor shape use QCursor::setShape() or use the QCursor
/// constructor which takes the shape as argument, or you can use one
/// of the predefined cursors defined in the [Qt::CursorShape](Qt::CursorShape)
/// enum.
///
/// If you want to create a cursor with your own bitmap, either use
/// the QCursor constructor which takes a bitmap and a mask or the
/// constructor which takes a pixmap as arguments.
///
/// To set or get the position of the mouse cursor use the static
/// methods QCursor::pos() and QCursor::setPos().
///
/// **Note:** It is possible to create a QCursor before
/// QGuiApplication, but it is not useful except as a place-holder for a
/// real QCursor created after QGuiApplication. Attempting to use a
/// QCursor that was created before QGuiApplication will result in a
/// crash.
///
/// # A Note for X11 Users
///
/// On X11, Qt supports the [Xcursor](Xcursor)
///
/// library, which allows for full color icon themes. The table below
/// shows the cursor name used for each Qt::CursorShape value. If a
/// cursor cannot be found using the name shown below, a standard X11
/// cursor will be used instead. Note: X11 does not provide
/// appropriate cursors for all possible Qt::CursorShape values. It
/// is possible that some cursors will be taken from the Xcursor
/// theme, while others will use an internal bitmap cursor.
///
/// * Shape
/// * Qt::CursorShape Value
/// * Cursor Name
/// * Shape
/// * Qt::CursorShape Value
/// * Cursor Name
/// * ![cursor-arrow.png](cursor-arrow.png)
///
/// * Qt::ArrowCursor
/// * `left_ptr`
/// * ![cursor-sizev.png](cursor-sizev.png)
///
/// * Qt::SizeVerCursor
/// * `size_ver`
/// * ![cursor-uparrow.png](cursor-uparrow.png)
///
/// * Qt::UpArrowCursor
/// * `up_arrow`
/// * ![cursor-sizeh.png](cursor-sizeh.png)
///
/// * Qt::SizeHorCursor
/// * `size_hor`
/// * ![cursor-cross.png](cursor-cross.png)
///
/// * Qt::CrossCursor
/// * `cross`
/// * ![cursor-sizeb.png](cursor-sizeb.png)
///
/// * Qt::SizeBDiagCursor
/// * `size_bdiag`
/// * ![cursor-ibeam.png](cursor-ibeam.png)
///
/// * Qt::IBeamCursor
/// * `ibeam`
/// * ![cursor-sizef.png](cursor-sizef.png)
///
/// * Qt::SizeFDiagCursor
/// * `size_fdiag`
/// * ![cursor-wait.png](cursor-wait.png)
///
/// * Qt::WaitCursor
/// * `wait`
/// * ![cursor-sizeall.png](cursor-sizeall.png)
///
/// * Qt::SizeAllCursor
/// * `size_all`
/// * ![cursor-busy.png](cursor-busy.png)
///
/// * Qt::BusyCursor
/// * `left_ptr_watch`
/// * ![cursor-vsplit.png](cursor-vsplit.png)
///
/// * Qt::SplitVCursor
/// * `split_v`
/// * ![cursor-forbidden.png](cursor-forbidden.png)
///
/// * Qt::ForbiddenCursor
/// * `forbidden`
/// * ![cursor-hsplit.png](cursor-hsplit.png)
///
/// * Qt::SplitHCursor
/// * `split_h`
/// * ![cursor-hand.png](cursor-hand.png)
///
/// * Qt::PointingHandCursor
/// * `pointing_hand`
/// * ![cursor-openhand.png](cursor-openhand.png)
///
/// * Qt::OpenHandCursor
/// * `openhand`
/// * ![cursor-whatsthis.png](cursor-whatsthis.png)
///
/// * Qt::WhatsThisCursor
/// * `whats_this`
/// * ![cursor-closedhand.png](cursor-closedhand.png)
///
/// * Qt::ClosedHandCursor
/// * `closedhand`
///
/// * Qt::DragMoveCursor
/// * `dnd-move` or `move`
///
/// * Qt::DragCopyCursor
/// * `dnd-copy` or `copy`
///
/// * Qt::DragLinkCursor
/// * `dnd-link` or `link`
///
/// **See also:** [`Widget`]
/// {fowler}{GUI Design Handbook: Cursors}
/// # Licence
///
/// The documentation is an adoption of the original [Qt Documentation](http://doc.qt.io/) and provided herein is licensed under the terms of the [GNU Free Documentation License version 1.3](http://www.gnu.org/licenses/fdl.html) as published by the Free Software Foundation.
#[derive(Clone)]
pub struct Cursor<'a> {
    #[doc(hidden)]
    pub data: Rc<Cell<Option<*const RUBase>>>,
    #[doc(hidden)]
    pub all_funcs: *const RUCursorAllFuncs,
    #[doc(hidden)]
    pub owned: bool,
    #[doc(hidden)]
    pub _marker: PhantomData<::std::cell::Cell<&'a ()>>,
}

impl<'a> Cursor<'a> {
    pub fn new() -> Cursor<'a> {
        let data = Rc::new(Cell::new(None));

        let ffi_data = unsafe {
            ((*rute_ffi_get()).create_cursor)(
                ::std::ptr::null(),
                transmute(rute_object_delete_callback as usize),
                Rc::into_raw(data.clone()) as *const c_void,
            )
        };

        data.set(Some(ffi_data.qt_data));

        Cursor {
            data,
            all_funcs: ffi_data.all_funcs,
            owned: true,
            _marker: PhantomData,
        }
    }
    #[allow(dead_code)]
    pub(crate) fn new_from_rc(ffi_data: RUCursor) -> Cursor<'a> {
        Cursor {
            data: unsafe { Rc::from_raw(ffi_data.host_data as *const Cell<Option<*const RUBase>>) },
            all_funcs: ffi_data.all_funcs,
            owned: false,
            _marker: PhantomData,
        }
    }

    #[allow(dead_code)]
    pub(crate) fn new_from_owned(ffi_data: RUCursor) -> Cursor<'a> {
        Cursor {
            data: Rc::new(Cell::new(Some(ffi_data.qt_data as *const RUBase))),
            all_funcs: ffi_data.all_funcs,
            owned: true,
            _marker: PhantomData,
        }
    }

    #[allow(dead_code)]
    pub(crate) fn new_from_temporary(ffi_data: RUCursor) -> Cursor<'a> {
        Cursor {
            data: Rc::new(Cell::new(Some(ffi_data.qt_data as *const RUBase))),
            all_funcs: ffi_data.all_funcs,
            owned: false,
            _marker: PhantomData,
        }
    }
    ///
    /// Swaps this cursor with the *other* cursor.
    pub fn swap<C: CursorTrait<'a>>(&self, other: &C) -> &Self {
        let (obj_other_1, _funcs) = other.get_cursor_obj_funcs();

        let (obj_data, funcs) = self.get_cursor_obj_funcs();
        unsafe {
            ((*funcs).swap)(obj_data, obj_other_1);
        }
        self
    }
    ///
    /// Returns the cursor shape identifier. The return value is one of
    /// the [Qt::CursorShape](Qt::CursorShape)
    /// enum values (cast to an int).
    ///
    /// **See also:** [`set_shape()`]
    pub fn shape(&self) -> CursorShape {
        let (obj_data, funcs) = self.get_cursor_obj_funcs();
        unsafe {
            let ret_val = ((*funcs).shape)(obj_data);
            let ret_val = CursorShape::from_bits_truncate(ret_val);
            ret_val
        }
    }
    ///
    /// Sets the cursor to the shape identified by *shape.*
    ///
    /// See [Qt::CursorShape](Qt::CursorShape)
    /// for the list of cursor shapes.
    ///
    /// **See also:** [`shape()`]
    pub fn set_shape(&self, new_shape: CursorShape) -> &Self {
        let enum_new_shape_1 = new_shape.bits();

        let (obj_data, funcs) = self.get_cursor_obj_funcs();
        unsafe {
            ((*funcs).set_shape)(obj_data, enum_new_shape_1);
        }
        self
    }
    ///
    /// Returns the cursor bitmap, or 0 if it is one of the standard
    /// cursors.
    pub fn bitmap(&self) -> Option<Bitmap> {
        let (obj_data, funcs) = self.get_cursor_obj_funcs();
        unsafe {
            let ret_val = ((*funcs).bitmap)(obj_data);
            if ret_val.qt_data == ::std::ptr::null() {
                return None;
            }
            let t = ret_val;
            let ret_val;
            if t.host_data != ::std::ptr::null() {
                ret_val = Bitmap::new_from_rc(t);
            } else {
                ret_val = Bitmap::new_from_owned(t);
            }
            Some(ret_val)
        }
    }
    ///
    /// Returns the cursor bitmap mask, or 0 if it is one of the standard
    /// cursors.
    pub fn mask(&self) -> Option<Bitmap> {
        let (obj_data, funcs) = self.get_cursor_obj_funcs();
        unsafe {
            let ret_val = ((*funcs).mask)(obj_data);
            if ret_val.qt_data == ::std::ptr::null() {
                return None;
            }
            let t = ret_val;
            let ret_val;
            if t.host_data != ::std::ptr::null() {
                ret_val = Bitmap::new_from_rc(t);
            } else {
                ret_val = Bitmap::new_from_owned(t);
            }
            Some(ret_val)
        }
    }
    ///
    /// Returns the cursor pixmap. This is only valid if the cursor is a
    /// pixmap cursor.
    pub fn pixmap(&self) -> Pixmap {
        let (obj_data, funcs) = self.get_cursor_obj_funcs();
        unsafe {
            let ret_val = ((*funcs).pixmap)(obj_data);
            let t = ret_val;
            let ret_val;
            if t.host_data != ::std::ptr::null() {
                ret_val = Pixmap::new_from_rc(t);
            } else {
                ret_val = Pixmap::new_from_owned(t);
            }
            ret_val
        }
    }
    ///
    /// Returns the cursor hot spot, or (0, 0) if it is one of the
    /// standard cursors.
    pub fn hot_spot(&self) -> Point {
        let (obj_data, funcs) = self.get_cursor_obj_funcs();
        unsafe {
            let ret_val = ((*funcs).hot_spot)(obj_data);
            let t = ret_val;
            let ret_val;
            if t.host_data != ::std::ptr::null() {
                ret_val = Point::new_from_rc(t);
            } else {
                ret_val = Point::new_from_owned(t);
            }
            ret_val
        }
    }
    ///
    /// Returns the position of the cursor (hot spot) of the *screen*
    /// in global screen coordinates.
    ///
    /// You can call QWidget::mapFromGlobal() to translate it to widget
    /// coordinates.
    ///
    /// **See also:** [`set_pos()`]
    /// [`Widget::map_from_global`]
    /// [`Widget::map_to_global`]
    ///
    /// Returns the position of the cursor (hot spot) of
    /// the primary screen in global screen coordinates.
    ///
    /// You can call QWidget::mapFromGlobal() to translate it to widget
    /// coordinates.
    ///
    /// **Note**: The position is queried from the windowing system. If mouse events are generated
    /// via other means (e.g., via QWindowSystemInterface in a unit test), those fake mouse
    /// moves will not be reflected in the returned value.
    ///
    /// **Note**: On platforms where there is no windowing system or cursors are not available, the returned
    /// position is based on the mouse move events generated via QWindowSystemInterface.
    ///
    /// **See also:** [`set_pos()`]
    /// [`Widget::map_from_global`]
    /// [`Widget::map_to_global`]
    /// [`GuiApplication::primary_screen`]
    pub fn pos() -> Point<'a> {
        let (obj_data, funcs) = unsafe {
            (
                ::std::ptr::null(),
                (*((*rute_ffi_get()).get_cursor)(::std::ptr::null()).all_funcs).cursor_funcs,
            )
        };
        unsafe {
            let ret_val = ((*funcs).pos)(obj_data);
            let t = ret_val;
            let ret_val;
            if t.host_data != ::std::ptr::null() {
                ret_val = Point::new_from_rc(t);
            } else {
                ret_val = Point::new_from_owned(t);
            }
            ret_val
        }
    }
    ///
    /// Returns the position of the cursor (hot spot) of the *screen*
    /// in global screen coordinates.
    ///
    /// You can call QWidget::mapFromGlobal() to translate it to widget
    /// coordinates.
    ///
    /// **See also:** [`set_pos()`]
    /// [`Widget::map_from_global`]
    /// [`Widget::map_to_global`]
    ///
    /// Returns the position of the cursor (hot spot) of
    /// the primary screen in global screen coordinates.
    ///
    /// You can call QWidget::mapFromGlobal() to translate it to widget
    /// coordinates.
    ///
    /// **Note**: The position is queried from the windowing system. If mouse events are generated
    /// via other means (e.g., via QWindowSystemInterface in a unit test), those fake mouse
    /// moves will not be reflected in the returned value.
    ///
    /// **Note**: On platforms where there is no windowing system or cursors are not available, the returned
    /// position is based on the mouse move events generated via QWindowSystemInterface.
    ///
    /// **See also:** [`set_pos()`]
    /// [`Widget::map_from_global`]
    /// [`Widget::map_to_global`]
    /// [`GuiApplication::primary_screen`]
    pub fn pos_2<S: ScreenTrait<'a>>(screen: &S) -> Point<'a> {
        let (obj_screen_1, _funcs) = screen.get_screen_obj_funcs();

        let (obj_data, funcs) = unsafe {
            (
                ::std::ptr::null(),
                (*((*rute_ffi_get()).get_cursor)(::std::ptr::null()).all_funcs).cursor_funcs,
            )
        };
        unsafe {
            let ret_val = ((*funcs).pos_2)(obj_data, obj_screen_1);
            let t = ret_val;
            let ret_val;
            if t.host_data != ::std::ptr::null() {
                ret_val = Point::new_from_rc(t);
            } else {
                ret_val = Point::new_from_owned(t);
            }
            ret_val
        }
    }
    ///
    /// Moves the cursor (hot spot) of the *screen* to the global
    /// screen position ( *x,* *y).*
    ///
    /// You can call QWidget::mapToGlobal() to translate widget
    /// coordinates to global screen coordinates.
    ///
    /// **Note**: Calling this function results in changing the cursor position through the windowing
    /// system. The windowing system will typically respond by sending mouse events to the application's
    /// window. This means that the usage of this function should be avoided in unit tests and
    /// everywhere where fake mouse events are being injected via QWindowSystemInterface because the
    /// windowing system's mouse state (with regards to buttons for example) may not match the state in
    /// the application-generated events.
    ///
    /// **Note**: On platforms where there is no windowing system or cursors are not available, this
    /// function may do nothing.
    ///
    /// **See also:** [`pos()`]
    /// [`Widget::map_from_global`]
    /// [`Widget::map_to_global`]
    ///
    /// Moves the cursor (hot spot) of the primary screen
    /// to the global screen position ( *x,* *y).*
    ///
    /// You can call QWidget::mapToGlobal() to translate widget
    /// coordinates to global screen coordinates.
    ///
    /// **See also:** [`pos()`]
    /// [`Widget::map_from_global`]
    /// [`Widget::map_to_global`]
    /// [`GuiApplication::primary_screen`]
    ///
    /// **Overloads**
    /// Moves the cursor (hot spot) to the global screen position at point
    /// *p.*
    ///
    /// **Overloads**
    /// Moves the cursor (hot spot) to the global screen position of the
    /// *screen* at point *p.*
    pub fn set_pos(x: i32, y: i32) {
        let (obj_data, funcs) = unsafe {
            (
                ::std::ptr::null(),
                (*((*rute_ffi_get()).get_cursor)(::std::ptr::null()).all_funcs).cursor_funcs,
            )
        };
        unsafe {
            ((*funcs).set_pos)(obj_data, x, y);
        }
    }
    ///
    /// Moves the cursor (hot spot) of the *screen* to the global
    /// screen position ( *x,* *y).*
    ///
    /// You can call QWidget::mapToGlobal() to translate widget
    /// coordinates to global screen coordinates.
    ///
    /// **Note**: Calling this function results in changing the cursor position through the windowing
    /// system. The windowing system will typically respond by sending mouse events to the application's
    /// window. This means that the usage of this function should be avoided in unit tests and
    /// everywhere where fake mouse events are being injected via QWindowSystemInterface because the
    /// windowing system's mouse state (with regards to buttons for example) may not match the state in
    /// the application-generated events.
    ///
    /// **Note**: On platforms where there is no windowing system or cursors are not available, this
    /// function may do nothing.
    ///
    /// **See also:** [`pos()`]
    /// [`Widget::map_from_global`]
    /// [`Widget::map_to_global`]
    ///
    /// Moves the cursor (hot spot) of the primary screen
    /// to the global screen position ( *x,* *y).*
    ///
    /// You can call QWidget::mapToGlobal() to translate widget
    /// coordinates to global screen coordinates.
    ///
    /// **See also:** [`pos()`]
    /// [`Widget::map_from_global`]
    /// [`Widget::map_to_global`]
    /// [`GuiApplication::primary_screen`]
    ///
    /// **Overloads**
    /// Moves the cursor (hot spot) to the global screen position at point
    /// *p.*
    ///
    /// **Overloads**
    /// Moves the cursor (hot spot) to the global screen position of the
    /// *screen* at point *p.*
    pub fn set_pos_2<S: ScreenTrait<'a>>(screen: &S, x: i32, y: i32) {
        let (obj_screen_1, _funcs) = screen.get_screen_obj_funcs();

        let (obj_data, funcs) = unsafe {
            (
                ::std::ptr::null(),
                (*((*rute_ffi_get()).get_cursor)(::std::ptr::null()).all_funcs).cursor_funcs,
            )
        };
        unsafe {
            ((*funcs).set_pos_2)(obj_data, obj_screen_1, x, y);
        }
    }
    ///
    /// Moves the cursor (hot spot) of the *screen* to the global
    /// screen position ( *x,* *y).*
    ///
    /// You can call QWidget::mapToGlobal() to translate widget
    /// coordinates to global screen coordinates.
    ///
    /// **Note**: Calling this function results in changing the cursor position through the windowing
    /// system. The windowing system will typically respond by sending mouse events to the application's
    /// window. This means that the usage of this function should be avoided in unit tests and
    /// everywhere where fake mouse events are being injected via QWindowSystemInterface because the
    /// windowing system's mouse state (with regards to buttons for example) may not match the state in
    /// the application-generated events.
    ///
    /// **Note**: On platforms where there is no windowing system or cursors are not available, this
    /// function may do nothing.
    ///
    /// **See also:** [`pos()`]
    /// [`Widget::map_from_global`]
    /// [`Widget::map_to_global`]
    ///
    /// Moves the cursor (hot spot) of the primary screen
    /// to the global screen position ( *x,* *y).*
    ///
    /// You can call QWidget::mapToGlobal() to translate widget
    /// coordinates to global screen coordinates.
    ///
    /// **See also:** [`pos()`]
    /// [`Widget::map_from_global`]
    /// [`Widget::map_to_global`]
    /// [`GuiApplication::primary_screen`]
    ///
    /// **Overloads**
    /// Moves the cursor (hot spot) to the global screen position at point
    /// *p.*
    ///
    /// **Overloads**
    /// Moves the cursor (hot spot) to the global screen position of the
    /// *screen* at point *p.*
    pub fn set_pos_3<P: PointTrait<'a>>(p: &P) {
        let (obj_p_1, _funcs) = p.get_point_obj_funcs();

        let (obj_data, funcs) = unsafe {
            (
                ::std::ptr::null(),
                (*((*rute_ffi_get()).get_cursor)(::std::ptr::null()).all_funcs).cursor_funcs,
            )
        };
        unsafe {
            ((*funcs).set_pos_3)(obj_data, obj_p_1);
        }
    }
    ///
    /// Moves the cursor (hot spot) of the *screen* to the global
    /// screen position ( *x,* *y).*
    ///
    /// You can call QWidget::mapToGlobal() to translate widget
    /// coordinates to global screen coordinates.
    ///
    /// **Note**: Calling this function results in changing the cursor position through the windowing
    /// system. The windowing system will typically respond by sending mouse events to the application's
    /// window. This means that the usage of this function should be avoided in unit tests and
    /// everywhere where fake mouse events are being injected via QWindowSystemInterface because the
    /// windowing system's mouse state (with regards to buttons for example) may not match the state in
    /// the application-generated events.
    ///
    /// **Note**: On platforms where there is no windowing system or cursors are not available, this
    /// function may do nothing.
    ///
    /// **See also:** [`pos()`]
    /// [`Widget::map_from_global`]
    /// [`Widget::map_to_global`]
    ///
    /// Moves the cursor (hot spot) of the primary screen
    /// to the global screen position ( *x,* *y).*
    ///
    /// You can call QWidget::mapToGlobal() to translate widget
    /// coordinates to global screen coordinates.
    ///
    /// **See also:** [`pos()`]
    /// [`Widget::map_from_global`]
    /// [`Widget::map_to_global`]
    /// [`GuiApplication::primary_screen`]
    ///
    /// **Overloads**
    /// Moves the cursor (hot spot) to the global screen position at point
    /// *p.*
    ///
    /// **Overloads**
    /// Moves the cursor (hot spot) to the global screen position of the
    /// *screen* at point *p.*
    pub fn set_pos_4<P: PointTrait<'a>, S: ScreenTrait<'a>>(screen: &S, p: &P) {
        let (obj_screen_1, _funcs) = screen.get_screen_obj_funcs();
        let (obj_p_2, _funcs) = p.get_point_obj_funcs();

        let (obj_data, funcs) = unsafe {
            (
                ::std::ptr::null(),
                (*((*rute_ffi_get()).get_cursor)(::std::ptr::null()).all_funcs).cursor_funcs,
            )
        };
        unsafe {
            ((*funcs).set_pos_4)(obj_data, obj_screen_1, obj_p_2);
        }
    }

    pub fn build(&self) -> Self {
        self.clone()
    }
}
pub trait CursorTrait<'a> {
    #[inline]
    #[doc(hidden)]
    fn get_cursor_obj_funcs(&self) -> (*const RUBase, *const RUCursorFuncs);
}

impl<'a> CursorTrait<'a> for Cursor<'a> {
    #[doc(hidden)]
    fn get_cursor_obj_funcs(&self) -> (*const RUBase, *const RUCursorFuncs) {
        let obj = self.data.get().unwrap();
        unsafe { (obj, (*self.all_funcs).cursor_funcs) }
    }
}