summaryrefslogtreecommitdiff
path: root/src/lib/efl/interfaces/efl_file.eo
blob: 7c58d966e30a20f244fd09f3cb8f4e2acf7c6f4c (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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
import eina_types;

interface Efl.File {
   methods {
      @property mmap {
         set {
            [[Set the source mmaped file from where an image object must fetch the real
              image data (it must be an Eina_File).

              If the file supports multiple data stored in it (as Eet files do),
              you can specify the key to be used as the index of the image in
              this file.

              @since 1.8]]

            return: bool; [[$true = success, $false = error]]
         }
         get {
            [[Get the source mmaped file from where an image object must fetch the real
              image data (it must be an Eina_File).

              If the file supports multiple data stored in it (as Eet files do),
              you can get the key to be used as the index of the image in
              this file.

              @since 1.10]]
         }
         values {
            f: const(Eina.File)*; [[The handler to an Eina_File that will be used as image source]]
            key: string @optional; [[The group that the image belongs to, in case 
                                           it's an EET(including Edje case) file. This can be used
                                           as a key inside evas image cache if this is a normal image
                                           file not eet file.]]
         }
      }
      @property file {
         set {
            [[Set the source file from where an image object must fetch the real
              image data (it may be an Eet file, besides pure image ones).

              If the file supports multiple data stored in it (as Eet files do),
              you can specify the key to be used as the index of the image in
              this file.]]

            /* FIXME-doc
             * Example:
             * @code
             * img = evas_object_image_add(canvas);
             * evas_object_image_file_set(img, "/path/to/img", NULL);
             * err = evas_object_image_load_error_get(img);
             * if (err != EVAS_LOAD_ERROR_NONE)
             * {
             * fprintf(stderr, "could not load image '%s'. error string is \"%s\"\n",
             * valid_path, evas_load_error_str(err));
             * }
             * else
             * {
             * evas_object_image_fill_set(img, 0, 0, w, h);
             * evas_object_resize(img, w, h);
             * evas_object_show(img);
             * }
             * @endcode
             */

            return: bool;
         }
         get {
            [[Retrieve the source file from where an image object is to fetch the
              real image data (it may be an Eet file, besides pure image ones).

              You must not modify the strings on the returned pointers.

              Note: Use $null pointers on the file components you're not
              interested in: they'll be ignored by the function.]]
         }
         values {
            file: string; [[The image file path.]]
            key: string; [[The image key in $file (if its an Eet one), or
                                 $null, otherwise.]]
         }
      }
      @property async {
         set {
            [[If true, file open will happen asynchronously allowing for better
              performance in some situations. The file will be opened from a
              different thread. Classes implementing async open might then block
              and wait when querying information from the file (eg. image size).

              Only a few objects implement this feature, and this flag may
              be ignored by EFL. In that case, get() will always return false.]]
         }
         get {
            [[Retrieves the asynchronous open flag, which will be true only if
              enabled and supported by the object.]]
         }
         values {
            async: bool; [[Flag for asynchronous open.]]
         }
      }
      save @const {
         [[Save the given image object's contents to an (image) file.

           The extension suffix on $file will determine which saver
           module Evas is to use when saving, thus the final file's
           format. If the file supports multiple data stored in it (Eet ones),
           you can specify the key to be used as the index of the image in it.

           You can specify some flags when saving the image.  Currently
           acceptable flags are $quality and $compress. Eg.:
           "quality=100 compress=9"]]

         return: bool;
         params {
            @in file: string @nonull; [[The filename to be used to save the image (extension
                                              obligatory).]]
            @in key: string; [[The image key in the file (if an Eet one), or $null,
                                     otherwise.]]
            @in flags: string; [[String containing the flags to be used ($null for
                                       none).]]
         }
      }
      eject @const {
           [[Eject the represented object.

             Get rid of and clean the pointed resource.]]
      }
      async_wait @const {
         [[Block and wait until all asynchronous operations are completed. Unless
           the async flag was set on this object, this method has no effect.]]

         return: bool;[[$false if an error occurred, else $true]]
      }
   }
   events {
      async,opened; [[The file was successfully opened asynchronously]]
      async,error; [[Error occurred in asynchronous file operation]]
   }
}