return NULL;
}
-static void
+static Eina_Bool
_load(Evas_Object *obj)
{
Widget_Data *wd = elm_widget_data_get(obj);
char *text;
- if (!wd) return;
+ if (!wd) return EINA_FALSE;
if (!wd->file)
{
elm_object_text_set(obj, "");
- return;
+ return EINA_TRUE;
}
switch (wd->format)
{
{
elm_object_text_set(obj, text);
free(text);
+ return EINA_TRUE;
}
else
- elm_object_text_set(obj, "");
+ {
+ elm_object_text_set(obj, "");
+ return EINA_FALSE;
+ }
}
static void
*insert = 0;
}
-EAPI void
+EAPI Eina_Bool
elm_entry_file_set(Evas_Object *obj, const char *file, Elm_Text_Format format)
{
- ELM_CHECK_WIDTYPE(obj, widtype);
+ ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
Widget_Data *wd = elm_widget_data_get(obj);
- if (!wd) return;
+ if (!wd) return EINA_FALSE;
if (wd->delay_write)
{
ecore_timer_del(wd->delay_write);
if (wd->autosave) _save(obj);
eina_stringshare_replace(&wd->file, file);
wd->format = format;
- _load(obj);
+ return _load(obj);
}
EAPI void
* @param obj The entry object
* @param file The path to the file to load and save
* @param format The file format
+ * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise
*/
-EAPI void elm_entry_file_set(Evas_Object *obj, const char *file, Elm_Text_Format format);
+EAPI Eina_Bool elm_entry_file_set(Evas_Object *obj, const char *file, Elm_Text_Format format);
/**
* Gets the file being edited by the entry.
#endif
}
-EAPI void
+EAPI Eina_Bool
elm_video_file_set(Evas_Object *video, const char *filename)
{
#ifdef HAVE_EMOTION
- ELM_CHECK_WIDTYPE(video, widtype);
+ ELM_CHECK_WIDTYPE(video, widtype) EINA_FALSE;
Widget_Data *wd = elm_widget_data_get(video);
if (wd->remember) emotion_object_last_position_save(wd->emotion);
wd->stop = EINA_FALSE;
- emotion_object_file_set(wd->emotion, filename);
+ if (!emotion_object_file_set(wd->emotion, filename)) return EINA_FALSE;
if ((!strncmp(filename, "file://", 7)) || (!strstr(filename, "://")))
emotion_object_last_position_load(wd->emotion);
edje_object_signal_emit(wd->layout, "elm,video,load", "elm");
+
+ return EINA_TRUE;
#else
(void) video;
(void) filename;
+
+ return EINA_FALSE;
#endif
}
* WebCam (v4l2://). (You can use Emotion API to request and list
* the available Webcam on your system).
*
+ * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise
+ *
* This function will explicitly define a file or URI as a source
* for the video of the Elm_Video object.
*
*
* @ingroup Video
*/
-EAPI void elm_video_file_set(Evas_Object *video, const char *filename);
+EAPI Eina_Bool elm_video_file_set(Evas_Object *video, const char *filename);
/**
* @brief Get the underlying Emotion object.