Data Structures | Public Member Functions | Static Public Member Functions
eo_cxx::efl::file Struct Reference

Data Structures

struct  address_const_of
 
struct  address_of
 

Public Member Functions

bool save (std::string file_,::efl::eina::optional< std::string > key_,::efl::eina::optional< std::string > flags_) const
 Save the given image object's contents to an (image) file. More...
 
void eject () const
 Eject the represented object. More...
 
void file_get (const char **file_, const char **key_) const
 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). More...
 
bool file_set (::efl::eina::optional< std::string > file_,::efl::eina::optional< std::string > key_) const
 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). More...
 
 operator::efl::file () const
 
 operator::efl::file & ()
 
 operator::efl::file const & () const
 

Static Public Member Functions

static Eo_Class const * _eo_class ()
 

Member Function Documentation

bool eo_cxx::efl::file::save ( std::string  file_,
::efl::eina::optional< std::string >  key_,
::efl::eina::optional< std::string >  flags_ 
) const
inline

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"

Parameters
fileThe filename to be used to save the image (extension obligatory).
keyThe image key in the file (if an Eet one), or NULL, otherwise.
flagsString containing the flags to be used (NULL for none).
void eo_cxx::efl::file::eject ( ) const
inline

Eject the represented object.

Get rid of and clean the pointed resource.

void eo_cxx::efl::file::file_get ( const char **  file_,
const char **  key_ 
) const
inline

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.
Parameters
fileThe image file path.
keyThe image key in file (if its an Eet one), or NULL, otherwise.
bool eo_cxx::efl::file::file_set ( ::efl::eina::optional< std::string >  file_,
::efl::eina::optional< std::string >  key_ 
) const
inline

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.

Example:

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);
}
Parameters
fileThe image file path.
keyThe image key in file (if its an Eet one), or NULL, otherwise.