summaryrefslogtreecommitdiff
path: root/src/lib/edje/efl_layout_calc.eo
blob: 77852fefff03a3c2b16ab59359577ab42708a31d (plain)
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
import eina_types;

interface Efl.Layout.Calc
{
   [[This interface defines a common set of APIs used to trigger calculations
     with layout objects.

     This defines all the APIs supported by legacy "Edje" object, known in EO
     API as Efl.Canvas.Layout.

     @since 1.21
   ]]
   event_prefix: efl_layout;
   methods {
      @property calc_auto_update_hints {
         [[Whether this object updates its size hints automatically.

           By default edje doesn't set size hints on itself. If this property
           is set to $true, size hints will be updated after recalculation.
           Be careful, as recalculation may happen often, enabling this
           property may have a considerable performance impact as other widgets
           will be notified of the size hints changes.

           A layout recalculation can be triggered by @.calc_size_min(),
           @.calc_size_min(), @.calc_parts_extends() or even any other internal
           event.
         ]]
         set {
            [[Enable or disable auto-update of size hints.]]
         }
         get {
            [[Whether this object updates its size hints automatically.]]
         }
         values {
            update: bool(false); [[Whether or not update the size hints.]]
         }
      }
      calc_size_min {
         [[Calculates the minimum required size for a given layout object.

           This call will trigger an internal recalculation of all parts of
           the object, in order to return its minimum required dimensions for
           width and height. The user might choose to impose those minimum
           sizes, making the resulting calculation to get to values greater or
           equal than $restricted in both directions.

           Note: At the end of this call, the object won't be automatically
           resized to the new dimensions, but just return the calculated sizes.
           The caller is the one up to change its geometry or not.

           Warning: Be advised that invisible parts in the object will be taken
           into account in this calculation.
         ]]
         return: Eina.Size2D; [[The minimum required size.]]
         params {
            @in restricted: Eina.Size2D @optional;
               [[The minimum size constraint as input, the returned size
                 can not be lower than this (in both directions).]]
         }
      }
      calc_parts_extends {
         [[Calculates the geometry of the region, relative to a given layout
           object's area, occupied by all parts in the object.

           This function gets the geometry of the rectangle equal to the area
           required to group all parts in obj's group/collection. The x
           and y coordinates are relative to the top left corner of the
           whole obj object's area. Parts placed out of the group's
           boundaries will also be taken in account, so that x and y
           may be negative.

           Note: On failure, this function will make all non-$null geometry
           pointers' pointed variables be set to zero.
         ]]
         return: Eina.Rect; [[The calculated region.]]
      }
      calc_freeze {
         [[Freezes the layout object.

           This function puts all changes on hold. Successive freezes will
           nest, requiring an equal number of thaws.

           See also @.calc_thaw.
         ]]
         return: int; [[The frozen state or 0 on error]]
      }
      calc_thaw {
         [[Thaws the layout object.

           This function thaws (in other words "unfreezes") the given layout
           object.

           Note: If sucessive freezes were done, an equal number of thaws will
           be required.

           See also @.calc_freeze.
         ]]
         return: int; [[The frozen state or 0 if the object is not frozen or on error.]]
      }
      calc_force @protected {
         [[Forces a Size/Geometry calculation.

           Forces the object to recalculate its layout regardless of
           freeze/thaw. This API should be used carefully.

           See also @.calc_freeze and @.calc_thaw.
         ]]
      }
   }
   events {
      recalc; [[The layout was recalculated.]]
      circular,dependency; [[A circular dependency between parts of the
         object was found.]]
   }
}