summaryrefslogtreecommitdiff
path: root/src/lib/evas/canvas/efl_canvas_vg.eo
blob: 398dd6cf2cd7cf2b2595deefa61926c2c1fbc298 (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
enum Efl.Canvas.Vg.Fill_Mode
{
   [[Enumeration that defines how viewbox will be filled int the vg canvs's viewport.
     default Fill_Mode is $none]]
   none,         [[Don't scale the viewbox. Placed it inside viewport taking
                  align property into account]]
   stretch,     [[Scale the viewbox so that it matches
                  the canvas viewport.
                  Aaspect ratio might be changed.]]
   meet,        [[Scale the viewbox
                  so that it fits inside canvas viewport
                  while maintaining the aspect ratio.
                  At least one of the dimensions of the viewbox
                  should be equal to the corresponding dimension
                  of the viewport.]]
   slice       [[Scale the viewbox
                  so that it covers the entire canvas viewport
                  while maintaining the aspect ratio.
                  At least one of the dimensions of the viewbox
                  should be equal to the corresponding
                  dimension of the viewport.]]
}

class Efl.Canvas.Vg (Efl.Canvas.Object, Efl.File)
{
   [[Efl vector graphics class]]
   legacy_prefix: evas_object_vg;
   methods {
      @property fill_mode {
         [[Control how the viewbox is mapped to the vg canvas's viewport.]]
         values {
            fill_mode: Efl.Canvas.Vg.Fill_Mode; [[Fill mode type]]
         }
      }
      @property viewbox {
         get {
            [[Get the current viewbox from the  evas_object_vg]]
         }
         set {
            [[Sets the viewbox for the evas vg canvas.
              viewbox if set should be mapped to the canvas geometry when rendering the vg tree.]]
         }
         values {
            viewbox: Eina.Rect; [[viewbox for the vg canvas]]
         }
      }
      @property viewbox_align {
         [[Control how the viewbox is positioned inside the viewport.]]
         values {
            align_x: double(0); [[Alignment in the horizontal axis (0 <= align_x <= 1).]]
            align_y: double(0); [[Alignment in the vertical axis (0 <= align_y <= 1).]]
         }
      }
      @property root_node {
         get {
            [[Get the root node of the evas_object_vg.
              @since 1.14]]
         }
         set {
            [[Set the root node of the evas_object_vg.

              Note: To manually create the shape object and show in the Vg
                    object canvas you must create the hierarchy and set as root node.

              It takes the ownership of the root node. ]]
         }
         values {
            root: Efl.VG; [[Root node of the VG canvas.]]
         }
      }
   }
   implements {
      Efl.Object.constructor;
      Efl.Object.finalize;
      Efl.Object.destructor;
      // FIXME: Implement mmap only (also fix cache keys)
      Efl.File.file { get; set; }
      Efl.File.save;
   }
}