summaryrefslogtreecommitdiff
path: root/efl/elementary/efl.elementary_window.pxi
blob: 373be07e2fb89dcc414f05fa7d261d636cb59536 (plain) (blame)
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
# Copyright (c) 2008-2009 Simon Busch
#
# This file is part of python-elementary.
#
# python-elementary is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# python-elementary is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with python-elementary.  If not, see <http://www.gnu.org/licenses/>.
#

# from efl.eo cimport object_from_instance
# from efl.evas cimport Evas
# from efl.evas cimport evas_object_evas_get
# from efl.evas cimport canvas_from_instance

cdef class Window(Object):

    def __init__(self, name, type):
        self._set_obj(elm_win_add(NULL, _cfruni(name), type))
#         self._add_obj(elm_obj_win_class_get(), NULL)

#         cdef Evas *e
#         e = evas_object_evas_get(self.obj)
#         canvas = Canvas_from_instance(e)
#         evasObject.__init__(self, canvas)

    def resize_object_add(self, evasObject subobj):
        elm_win_resize_object_add(self.obj, subobj.obj)

    def resize_object_del(self, evasObject subobj):
        elm_win_resize_object_del(self.obj, subobj.obj)

    def title_set(self, title):
        elm_win_title_set(self.obj, _cfruni(title))

    def title_get(self):
        return _ctouni(elm_win_title_get(self.obj))

    property title:
        def __get__(self):
            return _ctouni(elm_win_title_get(self.obj))
        def __set__(self, title):
            elm_win_title_set(self.obj, _cfruni(title))

    def icon_name_set(self, icon_name):
        elm_win_icon_name_set(self.obj, _cfruni(icon_name))

    def icon_name_get(self):
        return _ctouni(elm_win_icon_name_get(self.obj))

    property icon_name:
        def __get__(self):
            return _ctouni(elm_win_icon_name_get(self.obj))
        def __set__(self, icon_name):
            elm_win_icon_name_set(self.obj, _cfruni(icon_name))

    def role_set(self, role):
        elm_win_role_set(self.obj, _cfruni(role))

    def role_get(self):
        return _ctouni(elm_win_role_get(self.obj))

    property role:
        def __get__(self):
            return _ctouni(elm_win_role_get(self.obj))
        def __set__(self, role):
            elm_win_role_set(self.obj, _cfruni(role))

    def icon_object_set(self, evasObject icon):
        elm_win_icon_object_set(self.obj, icon.obj)

    def icon_object_get(self):
        return object_from_instance(elm_win_icon_object_get(self.obj))

    property icon_object:
        def __get__(self):
            return object_from_instance(elm_win_icon_object_get(self.obj))
        def __set__(self, evasObject icon):
            elm_win_icon_object_set(self.obj, icon.obj)

    def autodel_set(self, autodel):
        elm_win_autodel_set(self.obj, autodel)

    def autodel_get(self):
        return elm_win_autodel_get(self.obj)

    property autodel:
        def __get__(self):
            return elm_win_autodel_get(self.obj)
        def __set__(self, autodel):
            elm_win_autodel_set(self.obj, autodel)

    def activate(self):
        elm_win_activate(self.obj)

    def lower(self):
        elm_win_lower(self.obj)

    def _raise(self):
        elm_win_raise(self.obj)

    def center(self, h, v):
        elm_win_center(self.obj, h, v)

    def borderless_set(self, borderless):
        elm_win_borderless_set(self.obj, borderless)

    def borderless_get(self):
        return bool(elm_win_borderless_get(self.obj))

    property borderless:
        def __get__(self):
            return self.borderless_get()
        def __set__(self, borderless):
            self.borderless_set(borderless)

    def shaped_set(self,shaped):
        elm_win_shaped_set(self.obj, shaped)

    def shaped_get(self):
        return bool(elm_win_shaped_get(self.obj))

    property shaped:
        def __get__(self):
            return bool(elm_win_shaped_get(self.obj))
        def __set__(self, shaped):
            elm_win_shaped_set(self.obj, shaped)

    def alpha_set(self,alpha):
        elm_win_alpha_set(self.obj, alpha)

    def alpha_get(self):
        return bool(elm_win_alpha_get(self.obj))

    property alpha:
        def __get__(self):
            return bool(elm_win_alpha_get(self.obj))
        def __set__(self, alpha):
            elm_win_alpha_set(self.obj, alpha)

    def override_set(self, override):
        elm_win_override_set(self.obj, override)

    def override_get(self):
        return bool(elm_win_override_get(self.obj))

    property override:
        def __get__(self):
            return bool(elm_win_override_get(self.obj))
        def __set__(self, override):
            elm_win_override_set(self.obj, override)

    def fullscreen_set(self, fullscreen):
        elm_win_fullscreen_set(self.obj, fullscreen)

    def fullscreen_get(self):
        return bool(elm_win_fullscreen_get(self.obj))

    property fullscreen:
        def __get__(self):
            return bool(elm_win_fullscreen_get(self.obj))
        def __set__(self, fullscreen):
            elm_win_fullscreen_set(self.obj, fullscreen)

    def maximized_set(self, maximized):
        elm_win_maximized_set(self.obj, maximized)

    def maximized_get(self):
        return bool(elm_win_maximized_get(self.obj))

    property maximized:
        def __get__(self):
            return bool(elm_win_maximized_get(self.obj))
        def __set__(self, maximized):
            elm_win_maximized_set(self.obj, maximized)

    def iconified_set(self, iconified):
        elm_win_iconified_set(self.obj, iconified)

    def iconified_get(self):
        return bool(elm_win_iconified_get(self.obj))

    property iconified:
        def __get__(self):
            return bool(elm_win_iconified_get(self.obj))
        def __set__(self, iconified):
            elm_win_iconified_set(self.obj, iconified)

    def withdrawn_set(self, withdrawn):
        elm_win_withdrawn_set(self.obj, withdrawn)

    def withdrawn_get(self):
        return bool(elm_win_withdrawn_get(self.obj))

    property withdrawn:
        def __get__(self):
            return bool(elm_win_withdrawn_get(self.obj))
        def __set__(self, withdrawn):
            elm_win_withdrawn_set(self.obj, withdrawn)

    def urgent_set(self, urgent):
        elm_win_urgent_set(self.obj, urgent)

    def urgent_get(self):
        return bool(elm_win_urgent_get(self.obj))

    property urgent:
        def __get__(self):
            return bool(elm_win_urgent_get(self.obj))
        def __set__(self, urgent):
            elm_win_urgent_set(self.obj, urgent)

    def demand_attention_set(self, demand_attention):
        elm_win_demand_attention_set(self.obj, demand_attention)

    def demand_attention_get(self):
        return bool(elm_win_demand_attention_get(self.obj))

    property demand_attention:
        def __get__(self):
            return bool(elm_win_demand_attention_get(self.obj))
        def __set__(self, demand_attention):
            elm_win_demand_attention_set(self.obj, demand_attention)

    def modal_set(self, modal):
        elm_win_modal_set(self.obj, modal)

    def modal_get(self):
        return bool(elm_win_modal_get(self.obj))

    property modal:
        def __get__(self):
            return bool(elm_win_modal_get(self.obj))
        def __set__(self, modal):
            elm_win_modal_set(self.obj, modal)

    def aspect_set(self, aspect):
        elm_win_aspect_set(self.obj, aspect)

    def aspect_get(self):
        return elm_win_aspect_get(self.obj)

    property aspect:
        def __get__(self):
            return elm_win_aspect_get(self.obj)
        def __set__(self, aspect):
            elm_win_aspect_set(self.obj, aspect)

    property size_base:
        def __set__(self, value):
            w, h = value
            elm_win_size_base_set(self.obj, w, h)

        def __get__(self):
            cdef int w, h
            elm_win_size_base_get(self.obj, &w, &h)
            return (w, h)

    property size_step:
        def __set__(self, value):
            w, h = value
            elm_win_size_step_set(self.obj, w, h)

        def __get__(self):
            cdef int w, h
            elm_win_size_step_get(self.obj, &w, &h)
            return (w, h)

    def layer_set(self, layer):
        elm_win_layer_set(self.obj, layer)

    def layer_get(self):
        return elm_win_layer_get(self.obj)

    property layer:
        def __get__(self):
            return elm_win_layer_get(self.obj)
        def __set__(self, layer):
            elm_win_layer_set(self.obj, layer)

    def rotation_set(self, rotation):
        elm_win_rotation_set(self.obj, rotation)

    def rotation_get(self):
        return elm_win_rotation_get(self.obj)

    property rotation:
        def __get__(self):
            return elm_win_rotation_get(self.obj)
        def __set__(self, rotation):
            elm_win_rotation_set(self.obj, rotation)

    def rotation_with_resize_set(self, rotation):
        elm_win_rotation_set(self.obj, rotation)

    property rotation_with_resize:
        def __set__(self, rotation):
            elm_win_rotation_set(self.obj, rotation)

    def sticky_set(self, sticky):
        elm_win_sticky_set(self.obj, sticky)

    def sticky_get(self):
        return bool(elm_win_sticky_get(self.obj))

    property sticky:
        def __get__(self):
            return bool(elm_win_sticky_get(self.obj))
        def __set__(self, sticky):
            elm_win_sticky_set(self.obj, sticky)

    def conformant_set(self, conformant):
        elm_win_conformant_set(self.obj, conformant)

    def conformant_get(self):
        return bool(elm_win_conformant_get(self.obj))

    property conformant:
        def __get__(self):
            return bool(elm_win_conformant_get(self.obj))
        def __set__(self, conformant):
            elm_win_conformant_set(self.obj, conformant)

    def quickpanel_set(self, quickpanel):
        elm_win_quickpanel_set(self.obj, quickpanel)

    def quickpanel_get(self):
        return bool(elm_win_quickpanel_get(self.obj))

    property quickpanel:
        def __get__(self):
            return bool(elm_win_quickpanel_get(self.obj))
        def __set__(self, quickpanel):
            elm_win_quickpanel_set(self.obj, quickpanel)

    def quickpanel_priority_major_set(self, priority):
        elm_win_quickpanel_priority_major_set(self.obj, priority)

    def quickpanel_priority_major_get(self):
        return elm_win_quickpanel_priority_major_get(self.obj)

    property quickpanel_priority_major:
        def __get__(self):
            return elm_win_quickpanel_priority_major_get(self.obj)
        def __set__(self, priority):
            elm_win_quickpanel_priority_major_set(self.obj, priority)

    def quickpanel_priority_minor_set(self, priority):
        elm_win_quickpanel_priority_minor_set(self.obj, priority)

    def quickpanel_priority_minor_get(self):
        return elm_win_quickpanel_priority_minor_get(self.obj)

    property quickpanel_priority_minor:
        def __get__(self):
            return elm_win_quickpanel_priority_minor_get(self.obj)
        def __set__(self, priority):
            elm_win_quickpanel_priority_minor_set(self.obj, priority)

    def quickpanel_zone_set(self, zone):
        elm_win_quickpanel_zone_set(self.obj, zone)

    def quickpanel_zone_get(self):
        return elm_win_quickpanel_zone_get(self.obj)

    property quickpanel_zone:
        def __get__(self):
            return elm_win_quickpanel_zone_get(self.obj)
        def __set__(self, zone):
            elm_win_quickpanel_zone_set(self.obj, zone)

    def prop_focus_skip_set(self, skip):
        elm_win_prop_focus_skip_set(self.obj, skip)

    property focus_skip_set:
        def __set__(self, skip):
            elm_win_prop_focus_skip_set(self.obj, skip)

    def illume_command_send(self, command, *args, **kwargs):
        params = (args, kwargs)
        elm_win_illume_command_send(self.obj, command, params)

#     def inlined_image_object_get(self):
#         cdef evasImage img = evasImage()
#         cdef Evas_Object *obj = elm_win_inlined_image_object_get(self.obj)
#         img.obj = obj
#         return img

#     property inlined_image_object:
#         def __get__(self):
#             cdef evasImage img = evasImage()
#             cdef Evas_Object *obj = elm_win_inlined_image_object_get(self.obj)
#             img.obj = obj
#             return img

    def focus_get(self):
        return bool(elm_win_focus_get(self.obj))

    property focus:
        def __get__(self):
            return bool(elm_win_focus_get(self.obj))

    def screen_constrain_set(self, constrain):
        elm_win_screen_constrain_set(self.obj, constrain)

    def screen_constrain_get(self):
        return bool(elm_win_screen_constrain_get(self.obj))

    property screen_constrain:
        def __get__(self):
            return bool(elm_win_screen_constrain_get(self.obj))
        def __set__(self, constrain):
            elm_win_screen_constrain_set(self.obj, constrain)

    def screen_size_get(self):
        cdef int x, y, w, h
        elm_win_screen_size_get(self.obj, &x, &y, &w, &h)
        return (x, y, w, h)

    property screen_size:
        def __get__(self):
            cdef int x, y, w, h
            elm_win_screen_size_get(self.obj, &x, &y, &w, &h)
            return (x, y, w, h)

    def focus_highlight_enabled_set(self, enabled):
        elm_win_focus_highlight_enabled_set(self.obj, enabled)

    def focus_highlight_enabled_get(self):
        return bool(elm_win_focus_highlight_enabled_get(self.obj))

    property focus_highlight_enabled:
        def __get__(self):
            return bool(elm_win_focus_highlight_enabled_get(self.obj))
        def __set__(self, enabled):
            elm_win_focus_highlight_enabled_set(self.obj, enabled)

    def focus_highlight_style_set(self, style):
        elm_win_focus_highlight_style_set(self.obj, _cfruni(style))

    def focus_highlight_style_get(self):
        return _ctouni(elm_win_focus_highlight_style_get(self.obj))

    property focus_highlight_style:
        def __get__(self):
            return _ctouni(elm_win_focus_highlight_style_get(self.obj))
        def __set__(self, style):
            elm_win_focus_highlight_style_set(self.obj, _cfruni(style))

    def keyboard_mode_set(self, mode):
        elm_win_keyboard_mode_set(self.obj, mode)

    def keyboard_mode_get(self):
        return elm_win_keyboard_mode_get(self.obj)

    property keyboard_mode:
        def __get__(self):
            return elm_win_keyboard_mode_get(self.obj)
        def __set__(self, mode):
            elm_win_keyboard_mode_set(self.obj, mode)

    def keyboard_win_set(self, is_keyboard):
        elm_win_keyboard_win_set(self.obj, is_keyboard)

    def keyboard_win_get(self):
        return bool(elm_win_keyboard_win_get(self.obj))

    property keyboard_win:
        def __get__(self):
            return bool(elm_win_keyboard_win_get(self.obj))
        def __set__(self, is_keyboard):
            elm_win_keyboard_win_set(self.obj, is_keyboard)

    def indicator_mode_set(self, mode):
        elm_win_indicator_mode_set(self.obj, mode)

    def indicator_mode_get(self):
        return elm_win_indicator_mode_get(self.obj)

    property indicator_mode:
        def __get__(self):
            return elm_win_indicator_mode_get(self.obj)
        def __set__(self, mode):
            elm_win_indicator_mode_set(self.obj, mode)

    def indicator_opacity_set(self, mode):
        elm_win_indicator_opacity_set(self.obj, mode)

    def indicator_opacity_get(self):
        return elm_win_indicator_opacity_get(self.obj)

    property indicator_opacity:
        def __get__(self):
            return elm_win_indicator_opacity_get(self.obj)
        def __set__(self, mode):
            elm_win_indicator_opacity_set(self.obj, mode)

    def screen_position_get(self):
        cdef int x, y
        elm_win_screen_position_get(self.obj, &x, &y)
        return (x, y)

    property screen_position:
        def __get__(self):
            cdef int x, y
            elm_win_screen_position_get(self.obj, &x, &y)
            return (x, y)

    def socket_listen(self, svcname, svcnum, svcsys):
        return bool(elm_win_socket_listen(self.obj, _cfruni(svcname), svcnum, svcsys))

    def xwindow_xid_get(self):
        cdef Ecore_X_Window xwin
        xwin = elm_win_xwindow_get(self.obj)
        return xwin

    property xwindow_xid:
        def __get__(self):
            cdef Ecore_X_Window xwin
            xwin = elm_win_xwindow_get(self.obj)
            return xwin

    def callback_delete_request_add(self, func, *args, **kwargs):
        self._callback_add("delete,request", func, *args, **kwargs)

    def callback_delete_request_del(self, func):
        self._callback_del("delete,request", func)

    def callback_focus_in_add(self, func, *args, **kwargs):
        self._callback_add("focus,in", func, *args, **kwargs)

    def callback_focus_in_del(self, func):
        self._callback_del("focus,in", func)

    def callback_focus_out_add(self, func, *args, **kwargs):
        self._callback_add("focus,out", func, *args, **kwargs)

    def callback_focus_out_del(self, func):
        self._callback_del("focus,out")

    def callback_moved_add(self, func, *args, **kwargs):
        self._callback_add("moved", func, *args, **kwargs)

    def callback_moved_del(self, func):
        self._callback_del("moved")

    def callback_withdrawn_add(self, func, *args, **kwargs):
        self._callback_add("withdrawn", func, *args, **kwargs)

    def callback_withdrawn_del(self, func):
        self._callback_del("withdrawn")

    def callback_iconified_add(self, func, *args, **kwargs):
        self._callback_add("iconified", func, *args, **kwargs)

    def callback_iconified_del(self, func):
        self._callback_del("iconified")

    def callback_normal_add(self, func, *args, **kwargs):
        self._callback_add("normal", func, *args, **kwargs)

    def callback_normal_del(self, func):
        self._callback_del("normal")

    def callback_stick_add(self, func, *args, **kwargs):
        self._callback_add("stick", func, *args, **kwargs)

    def callback_stick_del(self, func):
        self._callback_del("stick")

    def callback_unstick_add(self, func, *args, **kwargs):
        self._callback_add("unstick", func, *args, **kwargs)

    def callback_unstick_del(self, func):
        self._callback_del("unstick")

    def callback_fullscreen_add(self, func, *args, **kwargs):
        self._callback_add("fullscreen", func, *args, **kwargs)

    def callback_fullscreen_del(self, func):
        self._callback_del("fullscreen")

    def callback_unfullscreen_add(self, func, *args, **kwargs):
        self._callback_add("unfullscreen", func, *args, **kwargs)

    def callback_unfullscreen_del(self, func):
        self._callback_del("unfullscreen")

    def callback_maximized_add(self, func, *args, **kwargs):
        self._callback_add("maximized", func, *args, **kwargs)

    def callback_maximized_del(self, func):
        self._callback_del("maximized")

    def callback_unmaximized_add(self, func, *args, **kwargs):
        self._callback_add("unmaximized", func, *args, **kwargs)

    def callback_unmaximized_del(self, func):
        self._callback_del("unmaximized")

_object_mapping_register("elm_win", Window)


cdef class StandardWindow(Window):

    def __init__(self, name, title):
        self._set_obj(elm_win_util_standard_add(_cfruni(name), _cfruni(title)))


_object_mapping_register("elm_standardwin", StandardWindow)