aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/eo/eina_types.eot
blob: 41b89215a4b42ccdebf314ca341cb87ed34b1aa6 (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
/* FIXME: Move to Eina when we decide they are handled properly. */
struct @extern @free(eina_rectangle_free) Eina.Rect {
    [[A rectangle in pixel dimensions.]]
    x: int; [[X coordinate of the rectangle, from the top-left corner.]]
    y: int; [[Y coordinate of the rectangle, from the top-left corner.]]
    w: int; [[Width of the rectangle in pixels.]]
    h: int; [[Height of the rectangle in pixels.]]
}

struct @extern Eina.Position2D {
   [[A 2D location in pixels.]]
   x: int; [[X position in pixels, from the top-left corner.]]
   y: int; [[Y position in pixels, from the top-left corner.]]
}

struct @extern Eina.Size2D {
   [[A 2D size in pixels.]]
   w: int; [[X position in pixels, from the top-left corner.]]
   h: int; [[Y position in pixels, from the top-left corner.]]
}

struct @extern Eina.File; [[Eina file data structure]]

struct @extern Eina.Vector2 {
   [[A simple 2D vector type using floating point values.]]
   x: double; [[X coordinate.]]
   y: double; [[Y coordinate.]]
}

struct @extern Eina.Matrix3 {
   [[Eina 3x3 Matrix]]
   xx: double; [[XX matrix value]]
   xy: double; [[XY matrix value]]
   xz: double; [[XZ matrix value]]

   yx: double; [[YX matrix value]]
   yy: double; [[YY matrix value]]
   yz: double; [[YZ matrix value]]

   zx: double; [[ZX matrix value]]
   zy: double; [[ZY matrix value]]
   zz: double; [[ZZ matrix value]]
}

struct @extern Eina.Inarray; [[Eina inarray data structure]]

type @extern Eina.Unicode: uint32; [[Eina unicode type]]

struct @extern Eina.File.Direct.Info; [[Eina file direct information data structure]]
/*{
   path_lenght:    size_t;              [[Size of the whole path]]
   name_length:    size_t;              [[Size of the filename/basename component]]
   name_start:     size_t;              [[Start position of the filename/basename component]]
   type:           Eina_File_Type;      [[File type]]
   path:           char[EINA_PATH_MAX]; [[The path]]
};*/

enum @extern Eina.Xattr.Flags {
  [[Eina file extended attributes flags]]
  insert, [[This is the default behaviour, it will either create or replace the extended attribute]]
  replace, [[This will only succeed if the extended attribute previously existed]]
  created [[This will only succeed if the extended attribute wasn't previously set]]
}

type @extern Eina.Error: int; [[Eina error type]]

struct @extern @free(eina_binbuf_free) Eina.Binbuf; [[Eina binbuf data structure]]
struct @extern @free(eina_strbuf_free) Eina.Strbuf; [[Eina strbuf data structure]]

struct @extern Eina.Slice {
    [[A linear, read-only, memory segment]]
    len: size; [[Length of the memory segment]]
    mem: const(void_ptr); [[Pointer to memory segment]]
}

struct @extern Eina.Rw_Slice {
    [[A linear, read-write, memory segment]]
    len: size; [[Length of the memory segment]]
    mem: void_ptr; [[Pointer to memory segment]]
}

struct @extern Eina.Value.Type; [[Eina value type]]

struct @extern Eina.Future; [[Eina_Future handle]]
struct @extern Eina.Promise; [[Eina_Promise handle]]
struct @extern @free(eina_future_desc_flush) Eina_Future_Desc; [[A struct used to define a callback and data for a future.]]
struct @extern @free(eina_future_cb_easy_desc_flush) Eina_Future_Cb_Easy_Desc; [[A struct with callbacks to be used by eina_future_cb_easy_from_desc() and eina_future_cb_easy()]]
struct @extern Eina_Future_Cb_Console_Desc; [[A struct used to define the prefix and suffix to be printed
                                              along side the a future value. This struct is used by
                                              eina_future_cb_console_from_desc()]]
struct @extern Eina_Future_Schedule_Entry; [[A struct that represents an scheduled event.
                                             This struct may be used by Eina to cancel
                                             a scheduled future.]]
struct @extern Eina.Future.Scheduler; [[This struct is used as a bridge between Eina and the future scheduler.
                                        By using the provided functions Eina can schedule futures resolutions,
                                        rejections and cancelations to a safe context.]]

function @extern Eina.Future.Cb {
    params {
       value: const(generic_value); [[An Eina_Value which contains the operation result. Before using
                                      the value, its type must be checked in order to avoid errors. This is needed, because
                                      if an operation fails the Eina_Value type will be EINA_VALUE_TYPE_ERROR
                                      which is a different type than the expected operation result.]]
       dead_ptr: const(ptr(Eina.Future)); [[A pointer to the future that was completed]]
    }
    return: generic_value; [[An Eina_Value to pass to the next Eina_Future in the chain (if any).
                             If there is no need to convert the received value, it's recommended
                             to pass-thru value argument. If you need to convert to a different type
                             or generate a new value, use eina_value_setup() on another Eina_Value
                             and return it. By returning an promise Eina_Value (eina_promise_as_value()) the
                             whole chain will wait until the promise is resolved in order to continue its execution.
                             Note that the value contents must survive this function scope,
                             that is, do not use stack allocated blobs, arrays, structures or types that
                             keeps references to memory you give. Values will be automatically cleaned up
                             using eina_value_flush() once they are unused (no more future or futures
                             returned a new value).]]
};

function @extern Eina.Promise.Cancel.Cb {
   params {
     dead_promise: const(ptr(Eina.Promise)); [[The canceled promise.]]
   }
};

function @extern Eina.Future.Success.Cb {
   params {
      value: const(generic_value); [[The operation result]]
   }
   return: generic_value;  [[An Eina_Value to pass to the next Eina_Future in the chain (if any).
                             If there is no need to convert the received value, it's recommended
                             to pass-thru value argument. If you need to convert to a different type
                             or generate a new value, use eina_value_setup() on another Eina_Value
                             and return it. By returning an promise Eina_Value (eina_promise_as_value()) the
                             whole chain will wait until the promise is resolved in order to continue its execution.
                             Note that the value contents must survive this function scope,
                             that is, do not use stack allocated blobs, arrays, structures or types that
                             keeps references to memory you give. Values will be automatically cleaned up
                             using eina_value_flush() once they are unused (no more future or futures
                             returned a new value).]]
};

function @extern Eina.Future.Error.Cb {
   params {
      error: const(Eina.Error); [[The operation error]]
   }
   return: generic_value;  [[An Eina_Value to pass to the next Eina_Future in the chain (if any).
                             If there is no need to convert the received value, it's recommended
                             to pass-thru value argument. If you need to convert to a different type
                             or generate a new value, use eina_value_setup() on another Eina_Value
                             and return it. By returning an promise Eina_Value (eina_promise_as_value()) the
                             whole chain will wait until the promise is resolved in order to continue its execution.
                             Note that the value contents must survive this function scope,
                             that is, do not use stack allocated blobs, arrays, structures or types that
                             keeps references to memory you give. Values will be automatically cleaned up
                             using eina_value_flush() once they are unused (no more future or futures
                             returned a new value).]]
};

function @extern Eina.Future.Free.Cb {
   params {
      dead_future: const(ptr(Eina.Future)); [[The future that was freed]]
   }
};