- Elementary
- Main
- Authors
- Examples
- Files
- Pages
- Types
- Modules

Functions
Photo

## Functions
Evas_Object * | elm_photo_add (Evas_Object *parent)
| Add a new photo to the parent. More...
Eina_Bool | elm_photo_file_set (Evas_Object *obj, const char *file)
| Set the file that will be used as the photo widget's image. More...
void | elm_photo_thumb_set (const Evas_Object *obj, const char *file, const char *group)
| Set the file that will be used as thumbnail in the photo. More...
void | elm_photo_size_set (Evas_Object *obj, int size)
| Set the size that will be used on the photo. More...
void | elm_photo_fill_inside_set (Evas_Object *obj, Eina_Bool fill)
| Set if the photo should be completely visible or not. More...
void | elm_photo_aspect_fixed_set (Evas_Object *obj, Eina_Bool fixed)
| Set whether the original aspect ratio of the photo should be kept on resize. More...
Eina_Bool | elm_photo_aspect_fixed_get (const Evas_Object *obj)
| Get if the object keeps the original aspect ratio. More...
#define | elm_obj_photo_add(ret) ELM_OBJ_PHOTO_ID(ELM_OBJ_PHOTO_SUB_ID_ADD), EO_TYPECHECK(Evas_Object **, ret)
#define | elm_obj_photo_file_set(file, ret) ELM_OBJ_PHOTO_ID(ELM_OBJ_PHOTO_SUB_ID_FILE_SET), EO_TYPECHECK(const char *, file), EO_TYPECHECK(Eina_Bool *, ret)
#define | elm_obj_photo_size_set(size) ELM_OBJ_PHOTO_ID(ELM_OBJ_PHOTO_SUB_ID_SIZE_SET), EO_TYPECHECK(int, size)
#define | elm_obj_photo_size_get(ret) ELM_OBJ_PHOTO_ID(ELM_OBJ_PHOTO_SUB_ID_SIZE_GET), EO_TYPECHECK(int *, ret)
#define | elm_obj_photo_fill_inside_set(fill) ELM_OBJ_PHOTO_ID(ELM_OBJ_PHOTO_SUB_ID_FILL_INSIDE_SET), EO_TYPECHECK(Eina_Bool, fill)
#define | elm_obj_photo_fill_inside_get(ret) ELM_OBJ_PHOTO_ID(ELM_OBJ_PHOTO_SUB_ID_FILL_INSIDE_GET), EO_TYPECHECK(Eina_Bool *, ret)
#define | elm_obj_photo_editable_set(set) ELM_OBJ_PHOTO_ID(ELM_OBJ_PHOTO_SUB_ID_EDITABLE_SET), EO_TYPECHECK(Eina_Bool, set)
#define | elm_obj_photo_editable_get(ret) ELM_OBJ_PHOTO_ID(ELM_OBJ_PHOTO_SUB_ID_EDITABLE_GET), EO_TYPECHECK(Eina_Bool *, ret)
#define | elm_obj_photo_thumb_set(file, group) ELM_OBJ_PHOTO_ID(ELM_OBJ_PHOTO_SUB_ID_THUMB_SET), EO_TYPECHECK(const char *, file), EO_TYPECHECK(const char *, group)
#define | elm_obj_photo_aspect_fixed_set(fixed) ELM_OBJ_PHOTO_ID(ELM_OBJ_PHOTO_SUB_ID_ASPECT_FIXED_SET), EO_TYPECHECK(Eina_Bool, fixed)
#define | elm_obj_photo_aspect_fixed_get(ret) ELM_OBJ_PHOTO_ID(ELM_OBJ_PHOTO_SUB_ID_ASPECT_FIXED_GET), EO_TYPECHECK(Eina_Bool *, ret)

## Detailed Description

The Elementary photo widget is intended for displaying a photo, for ex., a person's image (contact). Simple, yet with a very specific purpose. It has a decorative frame around the inner image itself, on the default theme. If and while no photo is set on it, it displays a person icon, indicating it's a photo placeholder.

This widget relies on an internal Icon, so that the APIs of these two widgets are similar (drag and drop is also possible here, for example).

Signals that you can add callbacks for are:

- `"clicked"` - This is called when a user has clicked the photo
- `"drag,start"` - One has started dragging the inner image out of the photo's frame
- `"drag,end"` - One has dropped the dragged image somewhere

## Macro Definition Documentation

#define elm_obj_photo_add | ( |  | ret | ) | ELM_OBJ_PHOTO_ID(ELM_OBJ_PHOTO_SUB_ID_ADD), EO_TYPECHECK(Evas_Object **, ret)

Since
  1.8

Add a new photo to the parent

Parameters

  [out] | ret |

See Also
  elm_photo_add

#define elm_obj_photo_aspect_fixed_get | ( |  | ret | ) | ELM_OBJ_PHOTO_ID(ELM_OBJ_PHOTO_SUB_ID_ASPECT_FIXED_GET), EO_TYPECHECK(Eina_Bool *, ret)

Since
  1.8

Get if the object keeps the original aspect ratio.

Parameters

  [out] | ret |

See Also
  elm_photo_aspect_fixed_get

Referenced by elm_photo_aspect_fixed_get().

#define elm_obj_photo_aspect_fixed_set | ( |  | fixed | ) | ELM_OBJ_PHOTO_ID(ELM_OBJ_PHOTO_SUB_ID_ASPECT_FIXED_SET), EO_TYPECHECK(Eina_Bool, fixed)

Since
  1.8

Set whether the original aspect ratio of the photo should be kept on resize.

Parameters

  [in] | fixed |

See Also
  elm_photo_aspect_fixed_set

Referenced by elm_photo_aspect_fixed_set().

#define elm_obj_photo_editable_get | ( |  | ret | ) | ELM_OBJ_PHOTO_ID(ELM_OBJ_PHOTO_SUB_ID_EDITABLE_GET), EO_TYPECHECK(Eina_Bool *, ret)

Since
  1.8

Get editability of the photo.

Parameters

  [out] | ret |

Note
  There is no elm_photo_editable_get

See Also
  elm_photo_editable_set
  elm_obj_photo_editable_set

#define elm_obj_photo_editable_set | ( |  | set | ) | ELM_OBJ_PHOTO_ID(ELM_OBJ_PHOTO_SUB_ID_EDITABLE_SET), EO_TYPECHECK(Eina_Bool, set)

Since
  1.8

Set editability of the photo.

Parameters

  [in] | set |

See Also
  elm_photo_editable_set

#define elm_obj_photo_file_set | ( |  | file,
|  |  | ret
| ) |  | ELM_OBJ_PHOTO_ID(ELM_OBJ_PHOTO_SUB_ID_FILE_SET), EO_TYPECHECK(const char *, file), EO_TYPECHECK(Eina_Bool *, ret)

Since
  1.8

Set the file that will be used as the photo widget's image.

Parameters

  [in] | file |
  [out] | ret |

See Also
  elm_photo_file_set

Referenced by elm_photo_file_set().

#define elm_obj_photo_fill_inside_get | ( |  | ret | ) | ELM_OBJ_PHOTO_ID(ELM_OBJ_PHOTO_SUB_ID_FILL_INSIDE_GET), EO_TYPECHECK(Eina_Bool *, ret)

Since
  1.8

Get if the photo should be completely visible or not.

Parameters

  [out] | ret |

Note
  There is no elm_photo_fill_inside_get

See Also
  elm_photo_fill_inside_set
  elm_obj_photo_fill_inside_set

#define elm_obj_photo_fill_inside_set | ( |  | fill | ) | ELM_OBJ_PHOTO_ID(ELM_OBJ_PHOTO_SUB_ID_FILL_INSIDE_SET), EO_TYPECHECK(Eina_Bool, fill)

Since
  1.8

Set if the photo should be completely visible or not.

Parameters

  [in] | fill |

See Also
  elm_photo_fill_inside_set

Referenced by elm_photo_fill_inside_set().

#define elm_obj_photo_size_get | ( |  | ret | ) | ELM_OBJ_PHOTO_ID(ELM_OBJ_PHOTO_SUB_ID_SIZE_GET), EO_TYPECHECK(int *, ret)

Since
  1.8

Get the size that will be used on the photo

Parameters

  [out] | ret |

Note
  There is no elm_photo_size_get

See Also
  elm_photo_size_set
  elm_obj_photo_size_set

#define elm_obj_photo_size_set | ( |  | size | ) | ELM_OBJ_PHOTO_ID(ELM_OBJ_PHOTO_SUB_ID_SIZE_SET), EO_TYPECHECK(int, size)

Since
  1.8

Set the size that will be used on the photo

Parameters

  [in] | size |

See Also
  elm_photo_size_set

Referenced by elm_photo_size_set().

#define elm_obj_photo_thumb_set | ( |  | file,
|  |  | group
| ) |  | ELM_OBJ_PHOTO_ID(ELM_OBJ_PHOTO_SUB_ID_THUMB_SET), EO_TYPECHECK(const char *, file), EO_TYPECHECK(const char *, group)

Since
  1.8

Set the file that will be used as thumbnail in the photo.

Parameters

  [in] | file |
  [in] | group |

See Also
  elm_photo_thumb_set

Referenced by elm_photo_thumb_set().

## Function Documentation

Evas_Object* elm_photo_add | ( | Evas_Object * | parent | ) |

Add a new photo to the parent.

Parameters

  parent | The parent object

Returns
  The new object or NULL if it cannot be created

Eina_Bool elm_photo_aspect_fixed_get | ( | const Evas_Object * | obj | ) |

Get if the object keeps the original aspect ratio.

Parameters

  obj | The photo object.

Returns
  `EINA_TRUE` if the object keeps the original aspect, `EINA_FALSE` otherwise.

References elm_obj_photo_aspect_fixed_get.

void elm_photo_aspect_fixed_set | ( | Evas_Object * | obj,
|  | Eina_Bool | fixed
| ) |  |

Set whether the original aspect ratio of the photo should be kept on resize.

Parameters

  obj | The photo object.
  fixed | `EINA_TRUE` if the photo should fix the aspect, `EINA_FALSE` otherwise.

The original aspect ratio (width / height) of the photo is usually distorted to match the object's size. Enabling this option will fix this original aspect, and the way that the photo is fit into the object's area

See Also
  elm_photo_aspect_fixed_get()

References elm_obj_photo_aspect_fixed_set.

Eina_Bool elm_photo_file_set | ( | Evas_Object * | obj,
|  | const char * | file
| ) |  |

Set the file that will be used as the photo widget's image.

Parameters

  obj | The photo object
  file | The path to file that will be used as obj's image.

Returns
  `EINA_TRUE` on success, `EINA_FALSE` otherwise

Note
  Use `NULL` on file to set the photo widget back to it's initial state, which indicates "no photo".

References elm_obj_photo_file_set.

void elm_photo_fill_inside_set | ( | Evas_Object * | obj,
|  | Eina_Bool | fill
| ) |  |

Set if the photo should be completely visible or not.

Parameters

  obj | The photo object
  fill | if true the photo will be completely visible

References elm_obj_photo_fill_inside_set.

void elm_photo_size_set | ( | Evas_Object * | obj,
|  | int | size
| ) |  |

Set the size that will be used on the photo.

Parameters

  obj | The photo object
  size | The size of the photo

References elm_obj_photo_size_set.

void elm_photo_thumb_set | ( | const Evas_Object * | obj,
|  | const char * | file,
|  | const char * | group
| ) |  |

Set the file that will be used as thumbnail in the photo.

Parameters

  obj | The photo object.
  file | The path to file that will be used as thumbnail.
  group | The key used in case of an EET file.

References elm_obj_photo_thumb_set.

Copyright ©2000-2014 Enlightenment.org - Samsung Electronics supports the EFL Documentation Project - Generated Wed Jan 8 2014 20:51:14