diff options
author | Kai Huuhko <kai.huuhko@gmail.com> | 2015-03-12 18:52:08 +0200 |
---|---|---|
committer | Kai Huuhko <kai.huuhko@gmail.com> | 2015-03-12 18:52:08 +0200 |
commit | dd5b35ef8fc034ff7b23c708fa63e164b5aa2782 (patch) | |
tree | e68d018d2440a9f5c85311f71171ff9d13b1fef4 | |
parent | 6fa1b78256fee7fdb237bb20b9788e63d4e1d895 (diff) |
Evas.Object: Re-order the methods into sections, cosmetic
-rw-r--r-- | efl/evas/efl.evas_object.pxi | 1046 |
1 files changed, 534 insertions, 512 deletions
diff --git a/efl/evas/efl.evas_object.pxi b/efl/evas/efl.evas_object.pxi index ec14248..a38f7e1 100644 --- a/efl/evas/efl.evas_object.pxi +++ b/efl/evas/efl.evas_object.pxi | |||
@@ -222,7 +222,6 @@ cdef class Object(Eo): | |||
222 | """ | 222 | """ |
223 | evas_object_del(self.obj) | 223 | evas_object_del(self.obj) |
224 | 224 | ||
225 | |||
226 | property evas: | 225 | property evas: |
227 | """ The evas Canvas that owns this object. | 226 | """ The evas Canvas that owns this object. |
228 | 227 | ||
@@ -255,6 +254,441 @@ cdef class Object(Eo): | |||
255 | """Removes this object as a member of a smart object.""" | 254 | """Removes this object as a member of a smart object.""" |
256 | evas_object_smart_member_del(self.obj) | 255 | evas_object_smart_member_del(self.obj) |
257 | 256 | ||
257 | |||
258 | def show(self): | ||
259 | """show() | ||
260 | |||
261 | Show the object. | ||
262 | |||
263 | """ | ||
264 | evas_object_show(self.obj) | ||
265 | |||
266 | def hide(self): | ||
267 | """hide() | ||
268 | |||
269 | Hide the object. | ||
270 | |||
271 | """ | ||
272 | evas_object_hide(self.obj) | ||
273 | |||
274 | property visible: | ||
275 | """Whenever it's visible or not. | ||
276 | |||
277 | :type: bool | ||
278 | |||
279 | """ | ||
280 | def __get__(self): | ||
281 | return bool(evas_object_visible_get(self.obj)) | ||
282 | |||
283 | def __set__(self, spec): | ||
284 | if spec: | ||
285 | self.show() | ||
286 | else: | ||
287 | self.hide() | ||
288 | |||
289 | def visible_get(self): | ||
290 | return bool(evas_object_visible_get(self.obj)) | ||
291 | def visible_set(self, spec): | ||
292 | if spec: | ||
293 | self.show() | ||
294 | else: | ||
295 | self.hide() | ||
296 | |||
297 | property precise_is_inside: | ||
298 | """Set whether to use precise (usually expensive) point collision | ||
299 | detection for a given Evas object. | ||
300 | |||
301 | Use this function to make Evas treat objects' transparent areas as | ||
302 | **not** belonging to it with regard to mouse pointer events. By | ||
303 | default, all of the object's boundary rectangle will be taken in | ||
304 | account for them. | ||
305 | |||
306 | :type: bool | ||
307 | |||
308 | .. warning:: By using precise point collision detection you'll be | ||
309 | making Evas more resource intensive. | ||
310 | |||
311 | """ | ||
312 | def __set__(self, precise): | ||
313 | evas_object_precise_is_inside_set(self.obj, precise) | ||
314 | |||
315 | def __get__(self): | ||
316 | return bool(evas_object_precise_is_inside_get(self.obj)) | ||
317 | |||
318 | def precise_is_inside_set(self, precise): | ||
319 | evas_object_precise_is_inside_set(self.obj, precise) | ||
320 | |||
321 | def precise_is_inside_get(self): | ||
322 | return bool(evas_object_precise_is_inside_get(self.obj)) | ||
323 | |||
324 | property static_clip: | ||
325 | """A hint flag on the object, whether this is used as a static clipper | ||
326 | or not. | ||
327 | |||
328 | :type: bool | ||
329 | |||
330 | """ | ||
331 | def __get__(self): | ||
332 | return bool(evas_object_static_clip_get(self.obj)) | ||
333 | |||
334 | def __set__(self, value): | ||
335 | evas_object_static_clip_set(self.obj, value) | ||
336 | |||
337 | def static_clip_get(self): | ||
338 | return bool(evas_object_static_clip_get(self.obj)) | ||
339 | def static_clip_set(self, int value): | ||
340 | evas_object_static_clip_set(self.obj, value) | ||
341 | |||
342 | property render_op: | ||
343 | """Render operation used at drawing. | ||
344 | |||
345 | :type: Evas_Render_Op | ||
346 | |||
347 | """ | ||
348 | def __get__(self): | ||
349 | return evas_object_render_op_get(self.obj) | ||
350 | |||
351 | def __set__(self, int value): | ||
352 | evas_object_render_op_set(self.obj, <Evas_Render_Op>value) | ||
353 | |||
354 | def render_op_get(self): | ||
355 | return evas_object_render_op_get(self.obj) | ||
356 | def render_op_set(self, int value): | ||
357 | evas_object_render_op_set(self.obj, <Evas_Render_Op>value) | ||
358 | |||
359 | property anti_alias: | ||
360 | """If anti-aliased primitives should be used. | ||
361 | |||
362 | :type: bool | ||
363 | |||
364 | """ | ||
365 | def __get__(self): | ||
366 | return bool(evas_object_anti_alias_get(self.obj)) | ||
367 | |||
368 | def __set__(self, int value): | ||
369 | evas_object_anti_alias_set(self.obj, value) | ||
370 | |||
371 | def anti_alias_get(self): | ||
372 | return bool(evas_object_anti_alias_get(self.obj)) | ||
373 | def anti_alias_set(self, int value): | ||
374 | evas_object_anti_alias_set(self.obj, value) | ||
375 | |||
376 | property scale: | ||
377 | """The scaling factor for an Evas object. Does not affect all objects. | ||
378 | |||
379 | Value of ``1.0`` means no scaling, default size. | ||
380 | |||
381 | This will multiply the object's dimension by the given factor, thus | ||
382 | altering its geometry (width and height). Useful when you want | ||
383 | scalable UI elements, possibly at run time. | ||
384 | |||
385 | :type: double | ||
386 | |||
387 | .. note:: Only text and textblock objects have scaling change | ||
388 | handlers. Other objects won't change visually on this call. | ||
389 | |||
390 | """ | ||
391 | def __set__(self, scale): | ||
392 | evas_object_scale_set(self.obj, scale) | ||
393 | |||
394 | def __get__(self): | ||
395 | return evas_object_scale_get(self.obj) | ||
396 | |||
397 | def scale_set(self, double scale): | ||
398 | evas_object_scale_set(self.obj, scale) | ||
399 | |||
400 | def scale_get(self): | ||
401 | return evas_object_scale_get(self.obj) | ||
402 | |||
403 | property color: | ||
404 | """Object's (r, g, b, a) color, in pre-multiply colorspace. | ||
405 | |||
406 | :type: (int **r**, int **g**, int **b**, int **a**) | ||
407 | |||
408 | """ | ||
409 | |||
410 | def __get__(self): | ||
411 | cdef int r, g, b, a | ||
412 | evas_object_color_get(self.obj, &r, &g, &b, &a) | ||
413 | return (r, g, b, a) | ||
414 | |||
415 | def __set__(self, color): | ||
416 | cdef int r, g, b, a | ||
417 | r, g, b, a = color | ||
418 | evas_object_color_set(self.obj, r, g, b, a) | ||
419 | |||
420 | def color_set(self, int r, int g, int b, int a): | ||
421 | evas_object_color_set(self.obj, r, g, b, a) | ||
422 | def color_get(self): | ||
423 | cdef int r, g, b, a | ||
424 | evas_object_color_get(self.obj, &r, &g, &b, &a) | ||
425 | return (r, g, b, a) | ||
426 | |||
427 | property clip: | ||
428 | """Object's clipper. | ||
429 | |||
430 | :type: :py:class:`efl.evas.Object` | ||
431 | |||
432 | """ | ||
433 | def __get__(self): | ||
434 | return object_from_instance(evas_object_clip_get(self.obj)) | ||
435 | |||
436 | def __set__(self, value): | ||
437 | cdef Evas_Object *clip | ||
438 | cdef Object o | ||
439 | if value is None: | ||
440 | evas_object_clip_unset(self.obj) | ||
441 | elif isinstance(value, Object): | ||
442 | o = <Object>value | ||
443 | clip = o.obj | ||
444 | evas_object_clip_set(self.obj, clip) | ||
445 | else: | ||
446 | raise ValueError("clip must be evas.Object or None") | ||
447 | |||
448 | def __del__(self): | ||
449 | evas_object_clip_unset(self.obj) | ||
450 | |||
451 | def clip_get(self): | ||
452 | return object_from_instance(evas_object_clip_get(self.obj)) | ||
453 | |||
454 | def clip_set(self, value): | ||
455 | cdef Evas_Object *clip | ||
456 | cdef Object o | ||
457 | if value is None: | ||
458 | evas_object_clip_unset(self.obj) | ||
459 | elif isinstance(value, Object): | ||
460 | o = <Object>value | ||
461 | clip = o.obj | ||
462 | evas_object_clip_set(self.obj, clip) | ||
463 | else: | ||
464 | raise ValueError("clip must be evas.Object or None") | ||
465 | |||
466 | def clip_unset(self): | ||
467 | evas_object_clip_unset(self.obj) | ||
468 | |||
469 | property clipees: | ||
470 | """Objects that this object clips. | ||
471 | |||
472 | :type: tuple of :py:class:`efl.evas.Object` | ||
473 | |||
474 | """ | ||
475 | def __get__(self): | ||
476 | return self.clipees_get() | ||
477 | |||
478 | def clipees_get(self): | ||
479 | return eina_list_objects_to_python_list(evas_object_clipees_get(self.obj)) | ||
480 | |||
481 | property name: | ||
482 | """Object name or *None*. | ||
483 | |||
484 | :type: string | ||
485 | |||
486 | """ | ||
487 | def __get__(self): | ||
488 | return _ctouni(evas_object_name_get(self.obj)) | ||
489 | |||
490 | def __set__(self, value): | ||
491 | if isinstance(value, unicode): value = PyUnicode_AsUTF8String(value) | ||
492 | evas_object_name_set(self.obj, | ||
493 | <const char *>value if value is not None else NULL) | ||
494 | |||
495 | def name_get(self): | ||
496 | return _ctouni(evas_object_name_get(self.obj)) | ||
497 | def name_set(self, value): | ||
498 | if isinstance(value, unicode): value = PyUnicode_AsUTF8String(value) | ||
499 | evas_object_name_set(self.obj, | ||
500 | <const char *>value if value is not None else NULL) | ||
501 | |||
502 | property focus: | ||
503 | """Whenever object currently have the focus. | ||
504 | |||
505 | :type: bool | ||
506 | |||
507 | """ | ||
508 | def __get__(self): | ||
509 | return bool(evas_object_focus_get(self.obj)) | ||
510 | |||
511 | def __set__(self, value): | ||
512 | evas_object_focus_set(self.obj, value) | ||
513 | |||
514 | def focus_get(self): | ||
515 | return bool(evas_object_focus_get(self.obj)) | ||
516 | def focus_set(self, value): | ||
517 | evas_object_focus_set(self.obj, value) | ||
518 | |||
519 | property pointer_mode: | ||
520 | """If pointer should be grabbed while processing events. | ||
521 | |||
522 | If *EVAS_OBJECT_POINTER_MODE_AUTOGRAB*, then when mouse is | ||
523 | down at this object, events will be restricted to it as source, mouse | ||
524 | moves, for example, will be emitted even if outside this object area. | ||
525 | |||
526 | If *EVAS_OBJECT_POINTER_MODE_NOGRAB*, then events will be emitted | ||
527 | just when inside this object area. | ||
528 | |||
529 | The default value is *EVAS_OBJECT_POINTER_MODE_AUTOGRAB*. | ||
530 | |||
531 | :type: Evas_Object_Pointer_Mode | ||
532 | |||
533 | """ | ||
534 | def __get__(self): | ||
535 | return <int>evas_object_pointer_mode_get(self.obj) | ||
536 | |||
537 | def __set__(self, int value): | ||
538 | evas_object_pointer_mode_set(self.obj, <Evas_Object_Pointer_Mode>value) | ||
539 | |||
540 | def pointer_mode_get(self): | ||
541 | return <int>evas_object_pointer_mode_get(self.obj) | ||
542 | def pointer_mode_set(self, int value): | ||
543 | evas_object_pointer_mode_set(self.obj, <Evas_Object_Pointer_Mode>value) | ||
544 | |||
545 | property smart_parent: | ||
546 | """Object that this object is member of, or *None*. | ||
547 | |||
548 | :type: :py:class:`efl.evas.Object` | ||
549 | |||
550 | .. versionchanged:: 1.14 | ||
551 | |||
552 | This was renamed from ``parent`` as it was clashing with | ||
553 | :py:meth:`efl.eo.Eo.parent_get` and is more correct in regards to | ||
554 | C api naming. | ||
555 | |||
556 | """ | ||
557 | def __get__(self): | ||
558 | cdef Evas_Object *obj | ||
559 | obj = evas_object_smart_parent_get(self.obj) | ||
560 | return object_from_instance(obj) | ||
561 | |||
562 | def smart_parent_get(self): | ||
563 | cdef Evas_Object *obj | ||
564 | obj = evas_object_smart_parent_get(self.obj) | ||
565 | return object_from_instance(obj) | ||
566 | |||
567 | property map_enabled: | ||
568 | """Map enabled state | ||
569 | |||
570 | :type: bool | ||
571 | |||
572 | """ | ||
573 | def __get__(self): | ||
574 | return bool(evas_object_map_enable_get(self.obj)) | ||
575 | def __set__(self, value): | ||
576 | evas_object_map_enable_set(self.obj, bool(value)) | ||
577 | |||
578 | def map_enabled_set(self, enabled): | ||
579 | evas_object_map_enable_set(self.obj, bool(enabled)) | ||
580 | def map_enabled_get(self): | ||
581 | return bool(evas_object_map_enable_get(self.obj)) | ||
582 | |||
583 | property map: | ||
584 | """Map | ||
585 | |||
586 | :type: :py:class:`Map` | ||
587 | |||
588 | """ | ||
589 | def __get__(self): | ||
590 | cdef Map ret = Map.__new__(Map) | ||
591 | ret.map = <Evas_Map *>evas_object_map_get(self.obj) | ||
592 | return ret | ||
593 | def __set__(self, Map m): | ||
594 | evas_object_map_set(self.obj, m.map) | ||
595 | |||
596 | def map_set(self, Map m): | ||
597 | evas_object_map_set(self.obj, m.map) | ||
598 | |||
599 | def map_get(self): | ||
600 | cdef Map ret = Map.__new__(Map) | ||
601 | ret.map = <Evas_Map *>evas_object_map_get(self.obj) | ||
602 | return ret | ||
603 | |||
604 | def key_grab(self, keyname not None, Evas_Modifier_Mask modifiers, Evas_Modifier_Mask not_modifiers, bint exclusive): | ||
605 | """Requests ``keyname`` key events be directed to ``obj``. | ||
606 | |||
607 | :param keyname: the key to request events for. | ||
608 | :param modifiers: a mask of modifiers that must be present to | ||
609 | trigger the event. | ||
610 | :type modifiers: Evas_Modifier_Mask | ||
611 | :param not_modifiers: a mask of modifiers that must **not** be present | ||
612 | to trigger the event. | ||
613 | :type not_modifiers: Evas_Modifier_Mask | ||
614 | :param exclusive: request that the ``obj`` is the only object | ||
615 | receiving the ``keyname`` events. | ||
616 | :type exclusive: bool | ||
617 | :raise RuntimeError: if grabbing the key was unsuccesful | ||
618 | |||
619 | Key grabs allow one or more objects to receive key events for | ||
620 | specific key strokes even if other objects have focus. Whenever a | ||
621 | key is grabbed, only the objects grabbing it will get the events | ||
622 | for the given keys. | ||
623 | |||
624 | ``keyname`` is a platform dependent symbolic name for the key | ||
625 | pressed | ||
626 | |||
627 | ``modifiers`` and ``not_modifiers`` are bit masks of all the | ||
628 | modifiers that must and mustn't, respectively, be pressed along | ||
629 | with ``keyname`` key in order to trigger this new key | ||
630 | grab. Modifiers can be things such as Shift and Ctrl as well as | ||
631 | user defined types via evas_key_modifier_add(). Retrieve them with | ||
632 | evas_key_modifier_mask_get() or use ``0`` for empty masks. | ||
633 | |||
634 | ``exclusive`` will make the given object the only one permitted to | ||
635 | grab the given key. If given ``EINA_TRUE``, subsequent calls on this | ||
636 | function with different ``obj`` arguments will fail, unless the key | ||
637 | is ungrabbed again. | ||
638 | |||
639 | .. warning:: Providing impossible modifier sets creates undefined behavior | ||
640 | |||
641 | :see: evas_object_key_ungrab | ||
642 | :see: evas_object_focus_set | ||
643 | :see: evas_object_focus_get | ||
644 | :see: evas_focus_get | ||
645 | :see: evas_key_modifier_add | ||
646 | |||
647 | """ | ||
648 | if isinstance(keyname, unicode): keyname = PyUnicode_AsUTF8String(keyname) | ||
649 | if not evas_object_key_grab(self.obj, <const char *>keyname, modifiers, not_modifiers, exclusive): | ||
650 | raise RuntimeError("Could not grab key.") | ||
651 | |||
652 | def key_ungrab(self, keyname not None, Evas_Modifier_Mask modifiers, Evas_Modifier_Mask not_modifiers): | ||
653 | """Removes the grab on ``keyname`` key events by ``obj``. | ||
654 | |||
655 | :param keyname: the key the grab is set for. | ||
656 | :param modifiers: a mask of modifiers that must be present to | ||
657 | trigger the event. | ||
658 | :param not_modifiers: a mask of modifiers that must not not be | ||
659 | present to trigger the event. | ||
660 | |||
661 | Removes a key grab on ``obj`` if ``keyname``, ``modifiers``, and | ||
662 | ``not_modifiers`` match. | ||
663 | |||
664 | :see: evas_object_key_grab | ||
665 | :see: evas_object_focus_set | ||
666 | :see: evas_object_focus_get | ||
667 | :see: evas_focus_get | ||
668 | |||
669 | """ | ||
670 | if isinstance(keyname, unicode): keyname = PyUnicode_AsUTF8String(keyname) | ||
671 | evas_object_key_ungrab(self.obj, <const char *>keyname, modifiers, not_modifiers) | ||
672 | |||
673 | property is_frame_object: | ||
674 | """:type: bool""" | ||
675 | def __set__(self, bint is_frame): | ||
676 | evas_object_is_frame_object_set(self.obj, is_frame) | ||
677 | |||
678 | def __get__(self): | ||
679 | return bool(evas_object_is_frame_object_get(self.obj)) | ||
680 | |||
681 | def is_frame_object_set(self, bint is_frame): | ||
682 | evas_object_is_frame_object_set(self.obj, is_frame) | ||
683 | |||
684 | def is_frame_object_get(self): | ||
685 | return bool(evas_object_is_frame_object_get(self.obj)) | ||
686 | |||
687 | |||
688 | ################## | ||
689 | #### Stacking #### | ||
690 | ################## | ||
691 | |||
258 | property layer: | 692 | property layer: |
259 | """Object's layer number. | 693 | """Object's layer number. |
260 | 694 | ||
@@ -347,6 +781,11 @@ cdef class Object(Eo): | |||
347 | def bottom_get(self): | 781 | def bottom_get(self): |
348 | return self.evas.bottom_get() | 782 | return self.evas.bottom_get() |
349 | 783 | ||
784 | |||
785 | ######################## | ||
786 | #### Pixel geometry #### | ||
787 | ######################## | ||
788 | |||
350 | property geometry: | 789 | property geometry: |
351 | """Object's position and size. | 790 | """Object's position and size. |
352 | 791 | ||
@@ -708,6 +1147,38 @@ cdef class Object(Eo): | |||
708 | evas_object_move(self.obj, r.x0, r.y0) | 1147 | evas_object_move(self.obj, r.x0, r.y0) |
709 | evas_object_resize(self.obj, r._w, r._h) | 1148 | evas_object_resize(self.obj, r._w, r._h) |
710 | 1149 | ||
1150 | |||
1151 | def move(self, int x, int y): | ||
1152 | """Same as assigning to :py:attr:`pos`. | ||
1153 | |||
1154 | :param x: | ||
1155 | :type x: int | ||
1156 | :param y: | ||
1157 | :type y: int | ||
1158 | |||
1159 | """ | ||
1160 | evas_object_move(self.obj, x, y) | ||
1161 | |||
1162 | def move_relative(self, int dx, int dy): | ||
1163 | """Move relatively to objects current position. | ||
1164 | |||
1165 | :param dx: | ||
1166 | :type dx: int | ||
1167 | :param dy: | ||
1168 | :type dy: int | ||
1169 | |||
1170 | """ | ||
1171 | cdef int x, y, x2, y2 | ||
1172 | evas_object_geometry_get(self.obj, &x, &y, NULL, NULL) | ||
1173 | x2 = x + dx | ||
1174 | y2 = y + dy | ||
1175 | evas_object_move(self.obj, x2, y2) | ||
1176 | |||
1177 | |||
1178 | #################### | ||
1179 | #### Size hints #### | ||
1180 | #################### | ||
1181 | |||
711 | property size_hint_min: | 1182 | property size_hint_min: |
712 | """Hint about minimum size. | 1183 | """Hint about minimum size. |
713 | 1184 | ||
@@ -1010,292 +1481,111 @@ cdef class Object(Eo): | |||
1010 | def size_hint_padding_set(self, int l, int r, int t, int b): | 1481 | def size_hint_padding_set(self, int l, int r, int t, int b): |
1011 | evas_object_size_hint_padding_set(self.obj, l, r, t, b) | 1482 | evas_object_size_hint_padding_set(self.obj, l, r, t, b) |
1012 | 1483 | ||
1013 | def move(self, int x, int y): | ||
1014 | """Same as assigning to :py:attr:`pos`. | ||
1015 | |||
1016 | :param x: | ||
1017 | :type x: int | ||
1018 | :param y: | ||
1019 | :type y: int | ||
1020 | |||
1021 | """ | ||
1022 | evas_object_move(self.obj, x, y) | ||
1023 | |||
1024 | def move_relative(self, int dx, int dy): | ||
1025 | """Move relatively to objects current position. | ||
1026 | |||
1027 | :param dx: | ||
1028 | :type dx: int | ||
1029 | :param dy: | ||
1030 | :type dy: int | ||
1031 | |||
1032 | """ | ||
1033 | cdef int x, y, x2, y2 | ||
1034 | evas_object_geometry_get(self.obj, &x, &y, NULL, NULL) | ||
1035 | x2 = x + dx | ||
1036 | y2 = y + dy | ||
1037 | evas_object_move(self.obj, x2, y2) | ||
1038 | |||
1039 | def show(self): | ||
1040 | """show() | ||
1041 | |||
1042 | Show the object. | ||
1043 | |||
1044 | """ | ||
1045 | evas_object_show(self.obj) | ||
1046 | 1484 | ||
1047 | def hide(self): | 1485 | ############################ |
1048 | """hide() | 1486 | #### Evas_Object Events #### |
1487 | ############################ | ||
1049 | 1488 | ||
1050 | Hide the object. | 1489 | property pass_events: |
1490 | """Whenever object should ignore and pass events. | ||
1051 | 1491 | ||
1052 | """ | 1492 | If True, this will cause events on it to be ignored. They will be |
1053 | evas_object_hide(self.obj) | 1493 | triggered on the next lower object (that is not set to pass events) |
1494 | instead. | ||
1054 | 1495 | ||
1055 | property visible: | 1496 | Objects that pass events will also not be accounted in some operations |
1056 | """Whenever it's visible or not. | 1497 | unless explicitly required, like |
1498 | :py:func:`efl.evas.Canvas.top_at_xy_get`, | ||
1499 | :py:func:`efl.evas.Canvas.top_in_rectangle_get`, | ||
1500 | :py:func:`efl.evas.Canvas.objects_at_xy_get`, | ||
1501 | :py:func:`efl.evas.Canvas.objects_in_rectangle_get`. | ||
1057 | 1502 | ||
1058 | :type: bool | 1503 | :type: bool |
1059 | 1504 | ||
1060 | """ | 1505 | """ |
1061 | def __get__(self): | 1506 | def __get__(self): |
1062 | return bool(evas_object_visible_get(self.obj)) | 1507 | return bool(evas_object_pass_events_get(self.obj)) |
1063 | |||
1064 | def __set__(self, spec): | ||
1065 | if spec: | ||
1066 | self.show() | ||
1067 | else: | ||
1068 | self.hide() | ||
1069 | |||
1070 | def visible_get(self): | ||
1071 | return bool(evas_object_visible_get(self.obj)) | ||
1072 | def visible_set(self, spec): | ||
1073 | if spec: | ||
1074 | self.show() | ||
1075 | else: | ||
1076 | self.hide() | ||
1077 | |||
1078 | property precise_is_inside: | ||
1079 | """Set whether to use precise (usually expensive) point collision | ||
1080 | detection for a given Evas object. | ||
1081 | |||
1082 | Use this function to make Evas treat objects' transparent areas as | ||
1083 | **not** belonging to it with regard to mouse pointer events. By | ||
1084 | default, all of the object's boundary rectangle will be taken in | ||
1085 | account for them. | ||
1086 | |||
1087 | :type: bool | ||
1088 | |||
1089 | .. warning:: By using precise point collision detection you'll be | ||
1090 | making Evas more resource intensive. | ||
1091 | |||
1092 | """ | ||
1093 | def __set__(self, precise): | ||
1094 | evas_object_precise_is_inside_set(self.obj, precise) | ||
1095 | 1508 | ||
1096 | def __get__(self): | 1509 | def __set__(self, int value): |
1097 | return bool(evas_object_precise_is_inside_get(self.obj)) | 1510 | evas_object_pass_events_set(self.obj, value) |
1098 | 1511 | ||
1099 | def precise_is_inside_set(self, precise): | 1512 | def pass_events_get(self): |
1100 | evas_object_precise_is_inside_set(self.obj, precise) | 1513 | return bool(evas_object_pass_events_get(self.obj)) |
1514 | def pass_events_set(self, value): | ||
1515 | evas_object_pass_events_set(self.obj, value) | ||
1101 | 1516 | ||
1102 | def precise_is_inside_get(self): | 1517 | property repeat_events: |
1103 | return bool(evas_object_precise_is_inside_get(self.obj)) | 1518 | """Whenever object should process and then repeat events. |
1104 | 1519 | ||
1105 | property static_clip: | 1520 | If True, this will cause events on it to be processed but then |
1106 | """A hint flag on the object, whether this is used as a static clipper | 1521 | they will be triggered on the next lower object (that is not set to |
1107 | or not. | 1522 | pass events). |
1108 | 1523 | ||
1109 | :type: bool | 1524 | :type: bool |
1110 | 1525 | ||
1111 | """ | 1526 | """ |
1112 | def __get__(self): | 1527 | def __get__(self): |
1113 | return bool(evas_object_static_clip_get(self.obj)) | 1528 | return bool(evas_object_repeat_events_get(self.obj)) |
1114 | |||
1115 | def __set__(self, value): | ||
1116 | evas_object_static_clip_set(self.obj, value) | ||
1117 | |||
1118 | def static_clip_get(self): | ||
1119 | return bool(evas_object_static_clip_get(self.obj)) | ||
1120 | def static_clip_set(self, int value): | ||
1121 | evas_object_static_clip_set(self.obj, value) | ||
1122 | |||
1123 | property render_op: | ||
1124 | """Render operation used at drawing. | ||
1125 | |||
1126 | :type: Evas_Render_Op | ||
1127 | |||
1128 | """ | ||
1129 | def __get__(self): | ||
1130 | return evas_object_render_op_get(self.obj) | ||
1131 | 1529 | ||
1132 | def __set__(self, int value): | 1530 | def __set__(self, int value): |
1133 | evas_object_render_op_set(self.obj, <Evas_Render_Op>value) | 1531 | evas_object_repeat_events_set(self.obj, value) |
1134 | 1532 | ||
1135 | def render_op_get(self): | 1533 | def repeat_events_get(self): |
1136 | return evas_object_render_op_get(self.obj) | 1534 | return bool(evas_object_repeat_events_get(self.obj)) |
1137 | def render_op_set(self, int value): | 1535 | def repeat_events_set(self, value): |
1138 | evas_object_render_op_set(self.obj, <Evas_Render_Op>value) | 1536 | evas_object_repeat_events_set(self.obj, value) |
1139 | 1537 | ||
1140 | property anti_alias: | 1538 | property propagate_events: |
1141 | """If anti-aliased primitives should be used. | 1539 | """Whenever object should propagate events to its parent. |
1540 | |||
1541 | If True, this will cause events on this object to propagate to its | ||
1542 | :py:class:`efl.evas.SmartObject` parent, if it's a member | ||
1543 | of one. | ||
1142 | 1544 | ||
1143 | :type: bool | 1545 | :type: bool |
1144 | 1546 | ||
1145 | """ | 1547 | """ |
1146 | def __get__(self): | 1548 | def __get__(self): |
1147 | return bool(evas_object_anti_alias_get(self.obj)) | 1549 | return bool(evas_object_propagate_events_get(self.obj)) |
1148 | 1550 | ||
1149 | def __set__(self, int value): | 1551 | def __set__(self, int value): |
1150 | evas_object_anti_alias_set(self.obj, value) | 1552 | evas_object_propagate_events_set(self.obj, value) |
1151 | |||
1152 | def anti_alias_get(self): | ||
1153 | return bool(evas_object_anti_alias_get(self.obj)) | ||
1154 | def anti_alias_set(self, int value): | ||
1155 | evas_object_anti_alias_set(self.obj, value) | ||
1156 | |||
1157 | property scale: | ||
1158 | """The scaling factor for an Evas object. Does not affect all objects. | ||
1159 | |||
1160 | Value of ``1.0`` means no scaling, default size. | ||
1161 | |||
1162 | This will multiply the object's dimension by the given factor, thus | ||
1163 | altering its geometry (width and height). Useful when you want | ||
1164 | scalable UI elements, possibly at run time. | ||
1165 | |||
1166 | :type: double | ||
1167 | |||
1168 | .. note:: Only text and textblock objects have scaling change | ||
1169 | handlers. Other objects won't change visually on this call. | ||
1170 | |||
1171 | """ | ||
1172 | def __set__(self, scale): | ||
1173 | evas_object_scale_set(self.obj, scale) | ||
1174 | |||
1175 | def __get__(self): | ||
1176 | return evas_object_scale_get(self.obj) | ||
1177 | |||
1178 | def scale_set(self, double scale): | ||
1179 | evas_object_scale_set(self.obj, scale) | ||
1180 | |||
1181 | def scale_get(self): | ||
1182 | return evas_object_scale_get(self.obj) | ||
1183 | |||
1184 | property color: | ||
1185 | """Object's (r, g, b, a) color, in pre-multiply colorspace. | ||
1186 | |||
1187 | :type: (int **r**, int **g**, int **b**, int **a**) | ||
1188 | |||
1189 | """ | ||
1190 | |||
1191 | def __get__(self): | ||
1192 | cdef int r, g, b, a | ||
1193 | evas_object_color_get(self.obj, &r, &g, &b, &a) | ||
1194 | return (r, g, b, a) | ||
1195 | |||
1196 | def __set__(self, color): | ||
1197 | cdef int r, g, b, a | ||
1198 | r, g, b, a = color | ||
1199 | evas_object_color_set(self.obj, r, g, b, a) | ||
1200 | |||
1201 | def color_set(self, int r, int g, int b, int a): | ||
1202 | evas_object_color_set(self.obj, r, g, b, a) | ||
1203 | def color_get(self): | ||
1204 | cdef int r, g, b, a | ||
1205 | evas_object_color_get(self.obj, &r, &g, &b, &a) | ||
1206 | return (r, g, b, a) | ||
1207 | |||
1208 | property clip: | ||
1209 | """Object's clipper. | ||
1210 | |||
1211 | :type: :py:class:`efl.evas.Object` | ||
1212 | |||
1213 | """ | ||
1214 | def __get__(self): | ||
1215 | return object_from_instance(evas_object_clip_get(self.obj)) | ||
1216 | 1553 | ||
1217 | def __set__(self, value): | 1554 | def propagate_events_get(self): |
1218 | cdef Evas_Object *clip | 1555 | return bool(evas_object_propagate_events_get(self.obj)) |
1219 | cdef Object o | 1556 | def propagate_events_set(self, value): |
1220 | if value is None: | 1557 | evas_object_propagate_events_set(self.obj, value) |
1221 | evas_object_clip_unset(self.obj) | ||
1222 | elif isinstance(value, Object): | ||
1223 | o = <Object>value | ||
1224 | clip = o.obj | ||
1225 | evas_object_clip_set(self.obj, clip) | ||
1226 | else: | ||
1227 | raise ValueError("clip must be evas.Object or None") | ||
1228 | 1558 | ||
1229 | def __del__(self): | 1559 | property freeze_events: |
1230 | evas_object_clip_unset(self.obj) | 1560 | """Whether an Evas object is to freeze (discard) events. |
1231 | 1561 | ||
1232 | def clip_get(self): | 1562 | If True, events will be **discarded**. Unlike :py:attr:`pass_events`, |
1233 | return object_from_instance(evas_object_clip_get(self.obj)) | 1563 | events will not be passed to **next** lower object. This API can be used |
1564 | for blocking events while the object is on transiting. | ||
1234 | 1565 | ||
1235 | def clip_set(self, value): | 1566 | If False, events will be processed as normal. |
1236 | cdef Evas_Object *clip | ||
1237 | cdef Object o | ||
1238 | if value is None: | ||
1239 | evas_object_clip_unset(self.obj) | ||
1240 | elif isinstance(value, Object): | ||
1241 | o = <Object>value | ||
1242 | clip = o.obj | ||
1243 | evas_object_clip_set(self.obj, clip) | ||
1244 | else: | ||
1245 | raise ValueError("clip must be evas.Object or None") | ||
1246 | 1567 | ||
1247 | def clip_unset(self): | 1568 | :type: bool |
1248 | evas_object_clip_unset(self.obj) | ||
1249 | 1569 | ||
1250 | property clipees: | 1570 | .. seealso:: |
1251 | """Objects that this object clips. | ||
1252 | 1571 | ||
1253 | :type: tuple of :py:class:`efl.evas.Object` | 1572 | :py:attr:`pass_events` |
1573 | :py:attr:`repeat_events` | ||
1574 | :py:attr:`propagate_events` | ||
1254 | 1575 | ||
1255 | """ | 1576 | """ |
1256 | def __get__(self): | 1577 | def __set__(self, freeze): |
1257 | return self.clipees_get() | 1578 | evas_object_freeze_events_set(self.obj, freeze) |
1258 | |||
1259 | def clipees_get(self): | ||
1260 | return eina_list_objects_to_python_list(evas_object_clipees_get(self.obj)) | ||
1261 | |||
1262 | property name: | ||
1263 | """Object name or *None*. | ||
1264 | |||
1265 | :type: string | ||
1266 | 1579 | ||
1267 | """ | ||
1268 | def __get__(self): | 1580 | def __get__(self): |
1269 | return _ctouni(evas_object_name_get(self.obj)) | 1581 | return bool(evas_object_freeze_events_get(self.obj)) |
1270 | |||
1271 | def __set__(self, value): | ||
1272 | if isinstance(value, unicode): value = PyUnicode_AsUTF8String(value) | ||
1273 | evas_object_name_set(self.obj, | ||
1274 | <const char *>value if value is not None else NULL) | ||
1275 | |||
1276 | def name_get(self): | ||
1277 | return _ctouni(evas_object_name_get(self.obj)) | ||
1278 | def name_set(self, value): | ||
1279 | if isinstance(value, unicode): value = PyUnicode_AsUTF8String(value) | ||
1280 | evas_object_name_set(self.obj, | ||
1281 | <const char *>value if value is not None else NULL) | ||
1282 | |||
1283 | property focus: | ||
1284 | """Whenever object currently have the focus. | ||
1285 | |||
1286 | :type: bool | ||
1287 | 1582 | ||
1288 | """ | 1583 | def freeze_events_set(self, freeze): |
1289 | def __get__(self): | 1584 | evas_object_freeze_events_set(self.obj, freeze) |
1290 | return bool(evas_object_focus_get(self.obj)) | ||
1291 | 1585 | ||
1292 | def __set__(self, value): | 1586 | def freeze_events_get(self): |
1293 | evas_object_focus_set(self.obj, value) | 1587 | return bool(evas_object_freeze_events_get(self.obj)) |
1294 | 1588 | ||
1295 | def focus_get(self): | ||
1296 | return bool(evas_object_focus_get(self.obj)) | ||
1297 | def focus_set(self, value): | ||
1298 | evas_object_focus_set(self.obj, value) | ||
1299 | 1589 | ||
1300 | def event_callback_add(self, Evas_Callback_Type type, func, *args, **kargs): | 1590 | def event_callback_add(self, Evas_Callback_Type type, func, *args, **kargs): |
1301 | """Add a new callback for the given event. | 1591 | """Add a new callback for the given event. |
@@ -1594,271 +1884,3 @@ cdef class Object(Eo): | |||
1594 | def on_changed_size_hints_del(self, func): | 1884 | def on_changed_size_hints_del(self, func): |
1595 | """Same as event_callback_del(EVAS_CALLBACK_CHANGED_SIZE_HINTS, ...)""" | 1885 | """Same as event_callback_del(EVAS_CALLBACK_CHANGED_SIZE_HINTS, ...)""" |
1596 | self.event_callback_del(EVAS_CALLBACK_CHANGED_SIZE_HINTS, func) | 1886 | self.event_callback_del(EVAS_CALLBACK_CHANGED_SIZE_HINTS, func) |
1597 | |||
1598 | property pass_events: | ||
1599 | """Whenever object should ignore and pass events. | ||
1600 | |||
1601 | If True, this will cause events on it to be ignored. They will be | ||
1602 | triggered on the next lower object (that is not set to pass events) | ||
1603 | instead. | ||
1604 | |||
1605 | Objects that pass events will also not be accounted in some operations | ||
1606 | unless explicitly required, like | ||
1607 | :py:func:`efl.evas.Canvas.top_at_xy_get`, | ||
1608 | :py:func:`efl.evas.Canvas.top_in_rectangle_get`, | ||
1609 | :py:func:`efl.evas.Canvas.objects_at_xy_get`, | ||
1610 | :py:func:`efl.evas.Canvas.objects_in_rectangle_get`. | ||
1611 | |||
1612 | :type: bool | ||
1613 | |||
1614 | """ | ||
1615 | def __get__(self): | ||
1616 | return bool(evas_object_pass_events_get(self.obj)) | ||
1617 | |||
1618 | def __set__(self, int value): | ||
1619 | evas_object_pass_events_set(self.obj, value) | ||
1620 | |||
1621 | def pass_events_get(self): | ||
1622 | return bool(evas_object_pass_events_get(self.obj)) | ||
1623 | def pass_events_set(self, value): | ||
1624 | evas_object_pass_events_set(self.obj, value) | ||
1625 | |||
1626 | property repeat_events: | ||
1627 | """Whenever object should process and then repeat events. | ||
1628 | |||
1629 | If True, this will cause events on it to be processed but then | ||
1630 | they will be triggered on the next lower object (that is not set to | ||
1631 | pass events). | ||
1632 | |||
1633 | :type: bool | ||
1634 | |||
1635 | """ | ||
1636 | def __get__(self): | ||
1637 | return bool(evas_object_repeat_events_get(self.obj)) | ||
1638 | |||
1639 | def __set__(self, int value): | ||
1640 | evas_object_repeat_events_set(self.obj, value) | ||
1641 | |||
1642 | def repeat_events_get(self): | ||
1643 | return bool(evas_object_repeat_events_get(self.obj)) | ||
1644 | def repeat_events_set(self, value): | ||
1645 | evas_object_repeat_events_set(self.obj, value) | ||
1646 | |||
1647 | property propagate_events: | ||
1648 | """Whenever object should propagate events to its parent. | ||
1649 | |||
1650 | If True, this will cause events on this object to propagate to its | ||
1651 | :py:class:`efl.evas.SmartObject` parent, if it's a member | ||
1652 | of one. | ||
1653 | |||
1654 | :type: bool | ||
1655 | |||
1656 | """ | ||
1657 | def __get__(self): | ||
1658 | return bool(evas_object_propagate_events_get(self.obj)) | ||
1659 | |||
1660 | def __set__(self, int value): | ||
1661 | evas_object_propagate_events_set(self.obj, value) | ||
1662 | |||
1663 | def propagate_events_get(self): | ||
1664 | return bool(evas_object_propagate_events_get(self.obj)) | ||
1665 | def propagate_events_set(self, value): | ||
1666 | evas_object_propagate_events_set(self.obj, value) | ||
1667 | |||
1668 | property freeze_events: | ||
1669 | """Whether an Evas object is to freeze (discard) events. | ||
1670 | |||
1671 | If True, events will be **discarded**. Unlike :py:attr:`pass_events`, | ||
1672 | events will not be passed to **next** lower object. This API can be used | ||
1673 | for blocking events while the object is on transiting. | ||
1674 | |||
1675 | If False, events will be processed as normal. | ||
1676 | |||
1677 | :type: bool | ||
1678 | |||
1679 | .. seealso:: | ||
1680 | |||
1681 | :py:attr:`pass_events` | ||
1682 | :py:attr:`repeat_events` | ||
1683 | :py:attr:`propagate_events` | ||
1684 | |||
1685 | """ | ||
1686 | def __set__(self, freeze): | ||
1687 | evas_object_freeze_events_set(self.obj, freeze) | ||
1688 | |||
1689 | def __get__(self): | ||
1690 | return bool(evas_object_freeze_events_get(self.obj)) | ||
1691 | |||
1692 | def freeze_events_set(self, freeze): | ||
1693 | evas_object_freeze_events_set(self.obj, freeze) | ||
1694 | |||
1695 | def freeze_events_get(self): | ||
1696 | return bool(evas_object_freeze_events_get(self.obj)) | ||
1697 | |||
1698 | property pointer_mode: | ||
1699 | """If pointer should be grabbed while processing events. | ||
1700 | |||
1701 | If *EVAS_OBJECT_POINTER_MODE_AUTOGRAB*, then when mouse is | ||
1702 | down at this object, events will be restricted to it as source, mouse | ||
1703 | moves, for example, will be emitted even if outside this object area. | ||
1704 | |||
1705 | If *EVAS_OBJECT_POINTER_MODE_NOGRAB*, then events will be emitted | ||
1706 | just when inside this object area. | ||
1707 | |||
1708 | The default value is *EVAS_OBJECT_POINTER_MODE_AUTOGRAB*. | ||
1709 | |||
1710 | :type: Evas_Object_Pointer_Mode | ||
1711 | |||
1712 | """ | ||
1713 | def __get__(self): | ||
1714 | return <int>evas_object_pointer_mode_get(self.obj) | ||
1715 | |||
1716 | def __set__(self, int value): | ||
1717 | evas_object_pointer_mode_set(self.obj, <Evas_Object_Pointer_Mode>value) | ||
1718 | |||
1719 | def pointer_mode_get(self): | ||
1720 | return <int>evas_object_pointer_mode_get(self.obj) | ||
1721 | def pointer_mode_set(self, int value): | ||
1722 | evas_object_pointer_mode_set(self.obj, <Evas_Object_Pointer_Mode>value) | ||
1723 | |||
1724 | property smart_parent: | ||
1725 | """Object that this object is member of, or *None*. | ||
1726 | |||
1727 | :type: :py:class:`efl.evas.Object` | ||
1728 | |||
1729 | .. versionchanged:: 1.14 | ||
1730 | |||
1731 | This was renamed from ``parent`` as it was clashing with | ||
1732 | :py:meth:`efl.eo.Eo.parent_get` and is more correct in regards to | ||
1733 | C api naming. | ||
1734 | |||
1735 | """ | ||
1736 | def __get__(self): | ||
1737 | cdef Evas_Object *obj | ||
1738 | obj = evas_object_smart_parent_get(self.obj) | ||
1739 | return object_from_instance(obj) | ||
1740 | |||
1741 | def smart_parent_get(self): | ||
1742 | cdef Evas_Object *obj | ||
1743 | obj = evas_object_smart_parent_get(self.obj) | ||
1744 | return object_from_instance(obj) | ||
1745 | |||
1746 | property map_enabled: | ||
1747 | """Map enabled state | ||
1748 | |||
1749 | :type: bool | ||
1750 | |||
1751 | """ | ||
1752 | def __get__(self): | ||
1753 | return bool(evas_object_map_enable_get(self.obj)) | ||
1754 | def __set__(self, value): | ||
1755 | evas_object_map_enable_set(self.obj, bool(value)) | ||
1756 | |||
1757 | def map_enabled_set(self, enabled): | ||
1758 | evas_object_map_enable_set(self.obj, bool(enabled)) | ||
1759 | def map_enabled_get(self): | ||
1760 | return bool(evas_object_map_enable_get(self.obj)) | ||
1761 | |||
1762 | property map: | ||
1763 | """Map | ||
1764 | |||
1765 | :type: :py:class:`Map` | ||
1766 | |||
1767 | """ | ||
1768 | def __get__(self): | ||
1769 | cdef Map ret = Map.__new__(Map) | ||
1770 | ret.map = <Evas_Map *>evas_object_map_get(self.obj) | ||
1771 | return ret | ||
1772 | def __set__(self, Map m): | ||
1773 | evas_object_map_set(self.obj, m.map) | ||
1774 | |||
1775 | def map_set(self, Map m): | ||
1776 | evas_object_map_set(self.obj, m.map) | ||
1777 | |||
1778 | def map_get(self): | ||
1779 | cdef Map ret = Map.__new__(Map) | ||
1780 | ret.map = <Evas_Map *>evas_object_map_get(self.obj) | ||
1781 | return ret | ||
1782 | |||
1783 | def key_grab(self, keyname not None, Evas_Modifier_Mask modifiers, Evas_Modifier_Mask not_modifiers, bint exclusive): | ||
1784 | """Requests ``keyname`` key events be directed to ``obj``. | ||
1785 | |||
1786 | :param keyname: the key to request events for. | ||
1787 | :param modifiers: a mask of modifiers that must be present to | ||
1788 | trigger the event. | ||
1789 | :type modifiers: Evas_Modifier_Mask | ||
1790 | :param not_modifiers: a mask of modifiers that must **not** be present | ||
1791 | to trigger the event. | ||
1792 | :type not_modifiers: Evas_Modifier_Mask | ||
1793 | :param exclusive: request that the ``obj`` is the only object | ||
1794 | receiving the ``keyname`` events. | ||
1795 | :type exclusive: bool | ||
1796 | :raise RuntimeError: if grabbing the key was unsuccesful | ||
1797 | |||
1798 | Key grabs allow one or more objects to receive key events for | ||
1799 | specific key strokes even if other objects have focus. Whenever a | ||
1800 | key is grabbed, only the objects grabbing it will get the events | ||
1801 | for the given keys. | ||
1802 | |||
1803 | ``keyname`` is a platform dependent symbolic name for the key | ||
1804 | pressed | ||
1805 | |||
1806 | ``modifiers`` and ``not_modifiers`` are bit masks of all the | ||
1807 | modifiers that must and mustn't, respectively, be pressed along | ||
1808 | with ``keyname`` key in order to trigger this new key | ||
1809 | grab. Modifiers can be things such as Shift and Ctrl as well as | ||
1810 | user defined types via evas_key_modifier_add(). Retrieve them with | ||
1811 | evas_key_modifier_mask_get() or use ``0`` for empty masks. | ||
1812 | |||
1813 | ``exclusive`` will make the given object the only one permitted to | ||
1814 | grab the given key. If given ``EINA_TRUE``, subsequent calls on this | ||
1815 | function with different ``obj`` arguments will fail, unless the key | ||
1816 | is ungrabbed again. | ||
1817 | |||
1818 | .. warning:: Providing impossible modifier sets creates undefined behavior | ||
1819 | |||
1820 | :see: evas_object_key_ungrab | ||
1821 | :see: evas_object_focus_set | ||
1822 | :see: evas_object_focus_get | ||
1823 | :see: evas_focus_get | ||
1824 | :see: evas_key_modifier_add | ||
1825 | |||
1826 | """ | ||
1827 | if isinstance(keyname, unicode): keyname = PyUnicode_AsUTF8String(keyname) | ||
1828 | if not evas_object_key_grab(self.obj, <const char *>keyname, modifiers, not_modifiers, exclusive): | ||
1829 | raise RuntimeError("Could not grab key.") | ||
1830 | |||
1831 | def key_ungrab(self, keyname not None, Evas_Modifier_Mask modifiers, Evas_Modifier_Mask not_modifiers): | ||
1832 | """Removes the grab on ``keyname`` key events by ``obj``. | ||
1833 | |||
1834 | :param keyname: the key the grab is set for. | ||
1835 | :param modifiers: a mask of modifiers that must be present to | ||
1836 | trigger the event. | ||
1837 | :param not_modifiers: a mask of modifiers that must not not be | ||
1838 | present to trigger the event. | ||
1839 | |||
1840 | Removes a key grab on ``obj`` if ``keyname``, ``modifiers``, and | ||
1841 | ``not_modifiers`` match. | ||
1842 | |||
1843 | :see: evas_object_key_grab | ||
1844 | :see: evas_object_focus_set | ||
1845 | :see: evas_object_focus_get | ||
1846 | :see: evas_focus_get | ||
1847 | |||
1848 | """ | ||
1849 | if isinstance(keyname, unicode): keyname = PyUnicode_AsUTF8String(keyname) | ||
1850 | evas_object_key_ungrab(self.obj, <const char *>keyname, modifiers, not_modifiers) | ||
1851 | |||
1852 | property is_frame_object: | ||
1853 | """:type: bool""" | ||
1854 | def __set__(self, bint is_frame): | ||
1855 | evas_object_is_frame_object_set(self.obj, is_frame) | ||
1856 | |||
1857 | def __get__(self): | ||
1858 | return bool(evas_object_is_frame_object_get(self.obj)) | ||
1859 | |||
1860 | def is_frame_object_set(self, bint is_frame): | ||
1861 | evas_object_is_frame_object_set(self.obj, is_frame) | ||
1862 | |||
1863 | def is_frame_object_get(self): | ||
1864 | return bool(evas_object_is_frame_object_get(self.obj)) | ||