SET(INCLUDEDIR "\${prefix}/include")
SET(VERSION 1.0)
-ADD_DEFINITIONS("-D_USE_DLOG_")
-ADD_DEFINITIONS("-D_USE_SECURE_LOG_")
ADD_DEFINITIONS("-DLOCALEDIR=\"${LOCALEDIR}\"")
ADD_DEFINITIONS("-DPACKAGE=\"${PROJECT_NAME}\"")
ADD_DEFINITIONS("-DPREFIX=\"${CMAKE_INSTALL_PREFIX}\"")
-ADD_DEFINITIONS("-DFEATURE_SIZE_CHECK")
AUX_SOURCE_DIRECTORY(${CMAKE_CURRENT_SOURCE_DIR}/src MAIN_UG_SRCS)
AUX_SOURCE_DIRECTORY(${CMAKE_CURRENT_SOURCE_DIR}/src/data DATA_UG_SRCS)
Copyright (c) 2000 - 2015 Samsung Electronics Co., Ltd. All rights reserved.
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
+ Flora License
+ Version 1.1, April, 2013
+ http://floralicense.org/license
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
+ "Tizen Certified Platform" shall mean a software platform that complies
+ with the standards set forth in the Tizen Compliance Specification and
+ passes the Tizen Compliance Tests as defined from time to time by the
+ Tizen Technical Steering Group and certified by the Tizen Association
+ or its designated agent.
+
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
+ use, offer to sell, sell, import, and otherwise transfer the Work
+ solely as incorporated into a Tizen Certified Platform, where
+ such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
+ with the Work solely as incorporated into a Tizen Certified Platform
+ to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
+ Work or Derivative Works thereof pursuant to the copyright
+ license above, in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
+ the conditions stated in this License and your own copyright statement
+ or terms and conditions do not conflict the conditions stated in this
+ License including section 3.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
END OF TERMS AND CONDITIONS
- APPENDIX: How to apply the Apache License to your work.
+ APPENDIX: How to apply the Flora License to your work
- To apply the Apache License to your work, attach the following
+ To apply the Flora License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
Copyright [yyyy] [name of copyright owner]
- Licensed under the Apache License, Version 2.0 (the "License");
+ Licensed under the Flora License, Version 1.1 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
- http://www.apache.org/licenses/LICENSE-2.0
+ http://floralicense.org/license
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
See the License for the specific language governing permissions and
limitations under the License.
+
/*
-* Copyright (c) 2000-2015 Samsung Electronics Co., Ltd All Rights Reserved
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*
-*/
+ * Copyright (c) 2015 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://floralicense.org/license/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
#ifndef __GALLERY_EFL_H__
#define __GALLERY_EFL_H__
#ifdef __cplusplus
extern "C" {
-#endif /* __cplusplus */
+#endif /* __cplusplus */
-#define GALLERY_APP_ICON_DIR "/usr/share/icons/default/small/"
#define GE_UG_RES_DIR PREFIX"/res/"
#define GE_IMAGES_DIR GE_UG_RES_DIR"images/"PACKAGE"/images/"
#define GE_EDJ_DIR GE_UG_RES_DIR"edje/"PACKAGE"/"
#define GE_EDJ_FILE GE_EDJ_DIR"attach-panel-gallery.edj"
-#ifdef _USE_CUSTOMIZED_GENGRID_STYLE
-#define GE_GENGRID_STYLE_GALLERY "gallery_efl"
-#endif
-#define GE_GRP_GRIDVIEW "gallery_efl/gridview"
#define GE_GRP_ALBUMVIEW "gallery_efl/albumview"
-#define GE_CBAR_STYLE_DEFAULT "gallery_efl/default"
-#define GE_NAVIFRAME_STYLE_DEFAULT "gallery_efl/default"
-#define GE_CHECKBOX_STYLE_GRID "gallery_efl/grid"
-
-#define GE_BUNDLE_LAUNCH_TYPE "launch-type"
+#define GE_BUNDLE_LAUNCH_TYPE "launch-type"
#define GE_BUNDLE_SELECTION_MODE_SINGLE "single"
#define GE_BUNDLE_SELECTION_MODE_MULTI "multiple"
-#define GE_BUNDLE_FILE_TYPE "file-type"
-#define GE_BUNDLE_SETAS_TYPE "setas-type"
-
-#define GE_LAUNCH_SELECT_ALBUM "select-album"
-
-#define GE_ALBUM_SELECT_RETURN_ID "album-id"
-#define GE_ALBUM_SELECT_RETURN_PATH "folder-path"
-
-#define GE_LAUNCH_SELECT_SLIDESHOW "select-slideshow"
-
-#define GE_LAUNCH_SELECT_ONE "select-one"
-#define GE_LAUNCH_SELECT_MULTIPLE "select-multiple"
-#define GE_LAUNCH_SELECT_SETAS "select-setas"
-#define GE_LAUNCH_SELECT_IMFT "select-imft"
-
-#define GE_FILE_MAX_COUNT "max-count"
+#define GE_BUNDLE_FILE_TYPE "file-type"
-#define GE_FILE_TYPE_IMAGE "image"
-#define GE_FILE_TYPE_VIDEO "video"
-#define GE_FILE_TYPE_ALL "all"
+#define GE_LAUNCH_SELECT_ONE "select-one"
+#define GE_LAUNCH_SELECT_MULTIPLE "select-multiple"
-#define GE_SETAS_WALLPAPER "wallpaper"
-#define GE_SETAS_LOCKSCREEN "lockscreen"
-#define GE_SETAS_WALLPAPER_AND_LOCKSCREEN "wallpaper and lockscreen"
-#define GE_SETAS_CROP_WALLPAPER "crop-wallpaper"
-#define GE_SETAS_CALLERID "callerid"
+#define GE_FILE_TYPE_IMAGE "image"
+#define GE_FILE_TYPE_ALL "all"
-#define GE_FILE_SELECT_RETURN_COUNT "count"
-#define GE_FILE_SELECT_RETURN_PATH "path"
-
-#define GE_SETAS_IMAGE_PATH "image-path"
-#define GE_BUNDLE_HOMESCREEN_PATH "homescreen_path"
-#define GE_BUNDLE_LOCKSCREEN_PATH "lockscreen_path"
-#define GE_IMAGEVIEWER_RETURN_ERROR "Error"
+#define GE_FILE_SELECT_RETURN_COUNT "count"
+#define GE_FILE_SELECT_RETURN_PATH "path"
/* MIME type */
#define GE_MIME_IMAGE_ALL "image/*"
-#define GE_MIME_VIDEO_ALL "video/*"
-
-#define GE_NAVIFRAME_POP_CB_KEY "ge_naviframe_pop_cb_key"
#define GE_IF_DEL_TIMER(timer) if (timer) { ecore_timer_del(timer); timer = NULL; }
#define GE_IF_DEL_IDLER(idler) if (idler) { ecore_idler_del(idler); idler = NULL; }
#define GE_IF_DEL_OBJ(obj) if (obj) { evas_object_del(obj); obj = NULL; }
-#define GE_IF_DEL_JOB(job) if (job) { ecore_job_del(job); job = NULL; }
#ifdef __cplusplus
}
-#endif /* __cplusplus */
-
-
-#endif /* __GALLERY_EFL_H__ */
-
+#endif /* __cplusplus */
+#endif /* __GALLERY_EFL_H__ */
/*
-* Copyright (c) 2000-2015 Samsung Electronics Co., Ltd All Rights Reserved
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*
-*/
+ * Copyright (c) 2015 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://floralicense.org/license/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
#ifndef _GE_ALBUMS_H_
#define _GE_ALBUMS_H_
#include "gallery-efl.h"
-int ge_update_gengrid(ge_ugdata *ugd);
-int ge_create_gengrid(ge_ugdata *ugd);
-int _ge_albums_update_view(ge_ugdata *ugd);
-Evas_Object* __ge_add_albums_split_view(ge_ugdata *ugd, Evas_Object *parent);
-void __ge_grid_reset_view(ge_ugdata *ugd);
-
-#endif /* _GE_ALBUMS_H_ */
+int ge_update_gengrid(ge_ugdata * ugd);
+int ge_create_gengrid(ge_ugdata * ugd);
+int _ge_albums_update_view(ge_ugdata * ugd);
+Evas_Object *__ge_add_albums_split_view(ge_ugdata * ugd,
+ Evas_Object * parent);
+void __ge_grid_reset_view(ge_ugdata * ugd);
+void _ge_grid_change_selection_mode(ge_ugdata * ugd, bool state);
+#endif /* _GE_ALBUMS_H_ */
+++ /dev/null
-/*
-* Copyright (c) 2000-2015 Samsung Electronics Co., Ltd All Rights Reserved
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*
-*/
-
-#ifndef _GE_BUTTON_H_
-#define _GE_BUTTON_H_
-
-#include "gallery-efl.h"
-
-/**< Evas smart objects' "smart callback" function signature */
-typedef void (*But_Smart_Cb)(void *data, Evas_Object *obj, void *event_info);
-
-Evas_Object *_ge_but_create_but(Evas_Object *parent, Elm_Theme *theme,
- const char *icon, const char *text,
- const char *style, But_Smart_Cb cb_func,
- const void *data);
-Evas_Object *_ge_but_create_image_but(Evas_Object *parent, const char *icon,
- const char *text, const char *style,
- Evas_Smart_Cb cb_func, void *data,
- Eina_Bool flag_propagate);
-
-#endif /* _GE_BUTTON_H_ */
-
/*
-* Copyright (c) 2000-2015 Samsung Electronics Co., Ltd All Rights Reserved
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*
-*/
+ * Copyright (c) 2015 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://floralicense.org/license/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
#ifndef _GE_DATA_TYPE_H_
#define _GE_DATA_TYPE_H_
#define GE_FREEIF(ptr) \
do { \
- if (ptr != NULL) \
- { \
+ if (ptr != NULL) { \
free(ptr); \
ptr = NULL; \
} \
x->func.del = NULL; \
elm_genlist_item_class_free(x); \
} \
- } while(0)
+ } while (0)
#define GE_GFREE(ptr) \
do { \
typedef struct _ge_media_t ge_media_s;
struct _ge_album_t {
- int gtype; /*self-defination type, when free this struct space, use it*/
- char *uuid; /*folder UUID*/
- char *display_name; /*album name*/
- char *path; /*the full path of this folder*/
- int type; /*storage type*/
- time_t mtime; /*modified time*/
- int count; /*the media count in this folder*/
+ int gtype; /*self-defination type, when free this struct space, use it */
+ char *uuid; /*folder UUID */
+ char *display_name; /*album name */
+ char *path; /*the full path of this folder */
+ int type; /*storage type */
+ time_t mtime; /*modified time */
+ int count; /*the media count in this folder */
};
struct _ge_media_t {
- int gtype; /*self-defination type, when free this struct space, use it*/
- media_info_h media_h; /*the handle of operating this media*/
- char *uuid; /*meida id*/
- int type; /*meida type, image or video*/
- char *thumb_url; /*the thumbnail full path of this meida file*/
- char *file_url; /*the full path of this meida file*/
- time_t mtime; /*modified time*/
- char *display_name; /*item name*/
- int mode; /* Show icon indicates different camera shot mode */
- media_content_storage_e storage_type; /* Storage type got from DB */
+ int gtype; /*self-defination type, when free this struct space, use it */
+ media_info_h media_h; /*the handle of operating this media */
+ char *uuid; /*meida id */
+ int type; /*meida type, image or video */
+ char *thumb_url; /*the thumbnail full path of this meida file */
+ char *file_url; /*the full path of this meida file */
+ time_t mtime; /*modified time */
+ char *display_name; /*item name */
+ int mode; /* Show icon indicates different camera shot mode */
+ media_content_storage_e storage_type; /* Storage type got from DB */
bool b_create_thumb; /* Request DB to create thumbnail */
};
-int _ge_data_type_new_media(ge_media_s **item);
-int _ge_data_type_new_album(ge_album_s **album);
+int _ge_data_type_new_media(ge_media_s ** item);
-int _ge_data_type_free_media_list(Eina_List **list);
-int _ge_data_type_free_album_list(Eina_List **list);
int _ge_data_type_free_geitem(void **item);
#endif
-
/*
-* Copyright (c) 2000-2015 Samsung Electronics Co., Ltd All Rights Reserved
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*
-*/
+ * Copyright (c) 2015 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://floralicense.org/license/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
#ifndef _GE_DATA_UTIL_H_
#define _GE_DATA_UTIL_H_
#define GE_CAMERA_PATH_MMC "/opt/storage/sdcard/DCIM/Camera"
#define GE_DOWNLOADS_PATH "/opt/usr/media/Downloads"
-#define GE_ROOT_PATH_PHONE "/opt/usr/media"
-#define GE_ROOT_PATH_MMC "/opt/storage/sdcard"
+#define GE_ROOT_PATH_PHONE "/opt/usr/media"
+#define GE_ROOT_PATH_MMC "/opt/storage/sdcard"
#define GE_DCIM "DCIM"
#define GE_ALBUM_ALL_ID "GALLERY_ALBUM_ALL_ALBUMS_ID"
#define GE_FILE_PATH_LEN_MAX (4095 * GE_MAX_BYTES_FOR_CHAR + 1)
#define GE_DIR_PATH_LEN_MAX GE_FILE_PATH_LEN_MAX
-#define GE_TIME_SECOND_MILLISECOND 1000 // 1s=1000ms
+#define GE_TIME_SECOND_MILLISECOND 1000 // 1s=1000ms
#define GE_TIME_USEC_PER_SEC 1000000L
-#define GE_TIME_MINUTE_SECOND 60 // 1min=60s
-#define GE_TIME_HOUR_MINUTE 60 // 1h=60min
-#define GE_TIME_HOUR_SECOND (GE_TIME_HOUR_MINUTE * GE_TIME_MINUTE_SECOND) // 1h=(60x60)s
+#define GE_TIME_MINUTE_SECOND 60 // 1min=60s
+#define GE_TIME_HOUR_MINUTE 60 // 1h=60min
+#define GE_TIME_HOUR_SECOND (GE_TIME_HOUR_MINUTE * GE_TIME_MINUTE_SECOND) // 1h=(60x60)s
#define GE_FIRST_VIEW_START_POS 0
#define GE_GET_ONE_RECORD 1
#define GE_GET_UNTIL_LAST_RECORD 65536 /* Fixme: Do not use 65536. */
#define GE_GET_ALL_RECORDS -1
-typedef struct _ge_transfer_data_t ge_transfer_data_s;
-
-struct _ge_transfer_data_t {
- void **userdata;
- char *album_id;
- bool with_meta;
- bool b_mtype;
- int list_type;
-};
-
-typedef struct _ge_filter_t ge_filter_s;
-
-struct _ge_filter_t {
- char cond[CONDITION_LENGTH]; /*set media type or favorite type, or other query statement*/
- media_content_collation_e collate_type; /*collate type*/
- media_content_order_e sort_type; /*sort type*/
- char sort_keyword[KEYWORD_LENGTH]; /*sort keyword*/
- int offset; /*offset*/
- int count; /*count*/
- bool with_meta; /*whether get image or video info*/
- int list_type;
-};
-
-typedef enum {
- GE_ALBUM_LIST_NONE, /**< */
- GE_ALBUM_LIST_FIRST, /**< Get first several albums except Camera and Downloads */
- GE_ALBUM_LIST_PATH, /**< Get a album via path */
- GE_ALBUM_LIST_ALL, /**< Get all albums except Camera and Downloads */
-} ge_album_list_e;
-
-typedef enum {
- GE_ALBUM_SNS_NONE,
- GE_ALBUM_SNS_PICASA,
- GE_ALBUM_SNS_FACEBOOK,
-} ge_album_sns_type;
-
-ge_item* _ge_data_util_calloc_geitem(void);
-int _ge_data_util_free_geitem(ge_item* gitem);
-int _ge_data_util_free_mtype_items(Eina_List **elist);
-int _ge_data_util_free_cluster(ge_cluster* gcluster);
-ge_cluster_list *_ge_data_util_calloc_clusters_list(void);
-ge_cluster *_ge_data_util_calloc_cluster(void);
-ge_cluster *_ge_data_util_new_cluster_all(ge_ugdata *ugd, int count);
-ge_item *_ge_data_util_new_item_mitem(ge_media_s *mitem);
-int _ge_data_util_free_item(ge_item *gitem);
-ge_sel_item_s *_ge_data_util_new_sel_item(ge_item *gitem);
-int _ge_data_util_free_sel_item(ge_sel_item_s *item);
-ge_sel_album_s *_ge_data_util_new_sel_album(char *album_uuid);
-int _ge_data_util_create_filter2(char *cond, char *keyword, int offset,
- int count, filter_h *filter);
-int _ge_data_util_create_filter(ge_filter_s *condition, filter_h *filter);
-int _ge_data_util_destroy_filter(filter_h filter);
-bool _ge_data_util_clone_media(media_info_h media, ge_media_s **pitem,
- bool b_meta);
-int _ge_data_util_get_geo_cond(char *cond, double longmin, double longmax,
- double latmin, double latmax);
-int _ge_data_util_get_type_cond(char *cond, int file_t);
+ typedef struct _ge_transfer_data_t ge_transfer_data_s;
+
+ struct _ge_transfer_data_t {
+ void **userdata;
+ char *album_id;
+ bool with_meta;
+ bool b_mtype;
+ int list_type;
+ };
+
+ typedef struct _ge_filter_t ge_filter_s;
+
+ struct _ge_filter_t {
+ char cond[CONDITION_LENGTH]; /*set media type or favorite type, or other query statement */
+ media_content_collation_e collate_type; /*collate type */
+ media_content_order_e sort_type; /*sort type */
+ char sort_keyword[KEYWORD_LENGTH]; /*sort keyword */
+ int offset; /*offset */
+ int count; /*count */
+ bool with_meta; /*whether get image or video info */
+ int list_type;
+ };
+
+ typedef enum {
+ GE_ALBUM_LIST_NONE,
+ /**< */
+ GE_ALBUM_LIST_FIRST,/**< Get first several albums except Camera and Downloads */
+ GE_ALBUM_LIST_PATH, /**< Get a album via path */
+ GE_ALBUM_LIST_ALL,
+ /**< Get all albums except Camera and Downloads */
+ } ge_album_list_e;
+
+ typedef enum {
+ GE_ALBUM_SNS_NONE,
+ GE_ALBUM_SNS_PICASA,
+ GE_ALBUM_SNS_FACEBOOK,
+ } ge_album_sns_type;
+
+ ge_item *_ge_data_util_calloc_geitem(void);
+ int _ge_data_util_free_geitem(ge_item * gitem);
+ int _ge_data_util_free_mtype_items(Eina_List ** elist);
+ int _ge_data_util_free_item(ge_item * gitem);
+ ge_sel_item_s *_ge_data_util_new_sel_item(ge_item * gitem);
+ int _ge_data_util_free_sel_item(ge_sel_item_s * item);
+ int _ge_data_util_create_filter(ge_filter_s * condition,
+ filter_h * filter);
+ int _ge_data_util_destroy_filter(filter_h filter);
+ bool _ge_data_util_clone_media(media_info_h media, ge_media_s ** pitem,
+ bool b_meta);
+ void _ge_free_sel_info(ge_ugdata * ugd);
#ifdef _cplusplus
}
#endif
-
-#endif //_GE_DATA_UTIL_H_
-
+#endif //_GE_DATA_UTIL_H_
/*
-* Copyright (c) 2000-2015 Samsung Electronics Co., Ltd All Rights Reserved
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*
-*/
+ * Copyright (c) 2015 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://floralicense.org/license/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
#ifndef _GE_DATA_H_
#define _GE_DATA_H_
#define GE_ALBUMS_FIRST_COUNT 8
-typedef enum {
- GE_SORT_BY_NONE, /**< No Sort */
- GE_SORT_BY_NAME_DESC, /**< Sort by display name descending */
- GE_SORT_BY_NAME_ASC, /**< Sort by display name ascending */
- GE_SORT_BY_DATE_DESC, /**< Sort by modified_date descending */
- GE_SORT_BY_DATE_ASC, /**< Sort by modified_date ascending */
-} ge_sort_type_e;
+ typedef enum {
+ GE_SORT_BY_NONE,/**< No Sort */
+ GE_SORT_BY_NAME_DESC,
+ /**< Sort by display name descending */
+ GE_SORT_BY_NAME_ASC,/**< Sort by display name ascending */
+ GE_SORT_BY_DATE_DESC,
+ /**< Sort by modified_date descending */
+ GE_SORT_BY_DATE_ASC,/**< Sort by modified_date ascending */
+ } ge_sort_type_e;
-typedef enum {
- GE_ALBUM_DATA_NONE, /**< First time, default type */
- GE_ALBUM_DATA_LOCAL, /**< There some local/web albums need to be got */
- GE_ALBUM_DATA_WEB, /**< There some web albums need to be got */
- GE_ALBUM_DATA_DONE, /**< Data getting done */
-} ge_album_data_e;
+ typedef enum {
+ GE_ALBUM_DATA_NONE,
+ /**< First time, default type */
+ GE_ALBUM_DATA_LOCAL,/**< There some local/web albums need to be got */
+ GE_ALBUM_DATA_WEB,
+ /**< There some web albums need to be got */
+ GE_ALBUM_DATA_DONE, /**< Data getting done */
+ } ge_album_data_e;
-typedef int (*ge_restore_selected_cb)(Eina_List *sel_id, ge_item *gitem);
+ typedef int (*ge_restore_selected_cb) (Eina_List * sel_id,
+ ge_item * gitem);
-int _ge_data_get_sel_cnt(ge_ugdata *ugd);
-int _ge_data_get_sel_paths(ge_ugdata *ugd, char **filepath, char ***filepath_arr, int *cnt);
-int _ge_data_get_album_sel_cnt(ge_ugdata *ugd, char *uuid, int *cnt);
-int _ge_data_check_sel_items(ge_ugdata *ugd);
-int _ge_data_free_sel_albums(ge_ugdata *ugd);
-bool _ge_data_check_selected_id(Eina_List *sel_id_list, const char *id);
-int _ge_data_update_items_cnt(ge_ugdata *ugd, ge_cluster *album);
-int _ge_data_free_clusters(ge_ugdata *ugd);
-int _ge_data_get_clusters(ge_ugdata *ugd, int type);
-int _ge_data_get_cluster(ge_ugdata *ugd, char *uuid, ge_cluster **cluster);
-int _ge_data_free_cluster(ge_cluster *cluster);
-int _ge_data_free_medias(Eina_List **elist);
-int _ge_data_get_medias(ge_ugdata *ugd, char *uuid, int type, int start_pos,
- int end_pos, Eina_List **pmedias_elist,
- ge_restore_selected_cb restore_cb, Eina_List *sel_id);
-int _ge_data_update_medias(ge_ugdata *ugd, char *uuid, int type,
- Eina_List **pmedias_elist,
- ge_restore_selected_cb restore_cb,
- Eina_List *sel_id);
-int _ge_data_get_album_cover(ge_ugdata *ugd, ge_cluster *album,
- ge_item **pgitem, media_content_order_e sort_type);
-int _ge_data_get_item_cnt(ge_ugdata *ugd, const char *cluster_id,
- int album_type, int *item_cnt);
-bool _ge_data_check_update(ge_ugdata *ugd);
-int _ge_data_del_media_by_id(ge_ugdata* ugd, const char *media_id);
-int _ge_data_free_selected_medias(Eina_List **elist);
-bool _ge_data_is_default_album(const char *match_folder, ge_album_s *mcluster);
-bool _ge_data_is_camera_album(ge_album_s *mcluster);
-bool _ge_data_check_root_type(const char *path, const char *root);
-bool _ge_data_is_root_path(const char *path);
-int _ge_data_create_thumb(ge_media_s *item,
- media_thumbnail_completed_cb callback, void *data);
-int _ge_data_cancel_thumb(ge_media_s *item);
-int _ge_data_restore_selected(Eina_List *sel_ids, ge_item *gitem);
-int _ge_data_init(ge_ugdata* ugd);
-int _ge_data_finalize(ge_ugdata* ugd);
+ int _ge_data_get_sel_paths(ge_ugdata * ugd, char **filepath,
+ char ***filepath_arr, int *cnt);
+ int _ge_data_get_medias(ge_ugdata * ugd, char *uuid, int type,
+ int start_pos, int end_pos,
+ Eina_List ** pmedias_elist,
+ ge_restore_selected_cb restore_cb,
+ Eina_List * sel_id);
+ int _ge_data_get_item_cnt(ge_ugdata * ugd, const char *cluster_id,
+ int album_type, int *item_cnt);
+ int _ge_data_del_media_by_id(ge_ugdata * ugd, const char *media_id);
+ int _ge_data_create_thumb(ge_media_s * item,
+ media_thumbnail_completed_cb callback,
+ void *data);
+ int _ge_data_init(ge_ugdata * ugd);
+ int _ge_data_finalize(ge_ugdata * ugd);
#ifdef _cplusplus
}
#endif
-#endif /* _GE_DATA_H_ */
-
+#endif /* _GE_DATA_H_ */
/*
-* Copyright (c) 2000-2015 Samsung Electronics Co., Ltd All Rights Reserved
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*
-*/
+ * Copyright (c) 2015 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://floralicense.org/license/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
#ifndef _GE_DB_UPDATE_H_
#define _GE_DB_UPDATE_H_
#include "ge-ugdata.h"
-bool _ge_db_update_reg_cb(ge_ugdata *ugd);
-bool _ge_db_update_finalize(ge_ugdata *ugd);
-int _ge_db_update_get_info(void *data,
- media_content_db_update_item_type_e *update_item,
- media_content_db_update_type_e *update_type);
-
-#endif //_GE_DB_UPDATE_H_
-
+bool _ge_db_update_reg_cb(ge_ugdata * ugd);
+bool _ge_db_update_finalize(ge_ugdata * ugd);
+#endif //_GE_DB_UPDATE_H_
/*
-* Copyright (c) 2000-2015 Samsung Electronics Co., Ltd All Rights Reserved
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*
-*/
+ * Copyright (c) 2015 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://floralicense.org/license/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
#ifndef _GL_DEBUG_H_
#define _GL_DEBUG_H_
#define LOG_TAG "ATTACH_PANEL_GALLERY"
-typedef enum {
- DEBUG_CRITICAL,
- DEBUG_CHECK,
- MB_DEBUG_LOG,
- DEBUG_MAX
-} GlDebugType;
+ typedef enum {
+ DEBUG_CRITICAL,
+ DEBUG_CHECK,
+ MB_DEBUG_LOG,
+ DEBUG_MAX
+ } GlDebugType;
/* anci c color type */
#define FONT_COLOR_RESET "\033[0m"
#define FONT_COLOR_CYAN "\033[36m"
#define FONT_COLOR_GRAY "\033[37m"
-#ifdef _USE_DLOG_
-
#define ge_dbg(fmt, arg...) LOGD(FONT_COLOR_BLUE fmt FONT_COLOR_RESET, ##arg)
#define ge_dbgW(fmt, arg...) LOGW(FONT_COLOR_GREEN fmt FONT_COLOR_RESET, ##arg)
#define ge_dbgE(fmt, arg...) LOGE(FONT_COLOR_RED fmt FONT_COLOR_RESET, ##arg)
-#else
-
-#define ge_dbg(fmt,arg...)
-#define ge_dbgW(fmt, arg...)
-#define ge_dbgE(fmt, arg...)
-#endif
-
-#ifdef _USE_SECURE_LOG_
#define ge_sdbg(fmt, arg...) SECURE_LOGD(FONT_COLOR_BLUE fmt FONT_COLOR_RESET, ##arg)
#define ge_sdbgW(fmt, arg...) SECURE_LOGI(FONT_COLOR_GREEN fmt FONT_COLOR_RESET, ##arg)
#define ge_sdbgE(fmt, arg...) SECURE_LOGE(FONT_COLOR_RED fmt FONT_COLOR_RESET, ##arg)
-#endif
#define ge_warn_if(expr, fmt, arg...) do { \
if (expr) { \
} while (0)
-#define GE_CHECK_VAL(expr, val) ge_retvm_if(!(expr), val, "Invalid parameter, return ERROR code!")
-#define GE_CHECK_NULL(expr) ge_retvm_if(!(expr), NULL, "Invalid parameter, return NULL!")
-#define GE_CHECK_FALSE(expr) ge_retvm_if(!(expr), false, "Invalid parameter, return FALSE!")
-#define GE_CHECK_CANCEL(expr) ge_retvm_if(!(expr), ECORE_CALLBACK_CANCEL, "Invalid parameter, return ECORE_CALLBACK_CANCEL!")
-#define GE_CHECK(expr) ge_retm_if(!(expr), "Invalid parameter, return!")
+#define GE_CHECK_VAL(expr, val) ge_retvm_if(!(expr), val, "Invalid parameter, return ERROR code!")
+#define GE_CHECK_NULL(expr) ge_retvm_if(!(expr), NULL, "Invalid parameter, return NULL!")
+#define GE_CHECK_FALSE(expr) ge_retvm_if(!(expr), false, "Invalid parameter, return FALSE!")
+#define GE_CHECK_CANCEL(expr) ge_retvm_if(!(expr), ECORE_CALLBACK_CANCEL, "Invalid parameter, return ECORE_CALLBACK_CANCEL!")
+#define GE_CHECK(expr) ge_retm_if(!(expr), "Invalid parameter, return!")
#include <time.h>
#include <sys/time.h>
-void _ge_print_debug_time_ex(long start, long end, const char* func_name, char* time_string);
#ifdef _cplusplus
}
#endif
-
-#endif //_GL_DEBUG_H_
-
+#endif //_GL_DEBUG_H_
+++ /dev/null
-/*
-* Copyright (c) 2000-2015 Samsung Electronics Co., Ltd All Rights Reserved
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*
-*/
-
-#ifdef _USE_ROTATE_BG_GE
-
-#ifndef _GE_EXIF_H_
-#define _GE_EXIF_H_
-
-#include <stdbool.h>
-#include <stdio.h>
-
-#ifdef _cplusplus
-extern "C"
-{
-#endif
-
-/*
-Orientation - angle
-1 - 0
-3 - 180
-6 - 90
-8 - 270
-*/
-typedef enum _ge_orientation_rot_t ge_orientation_rot_e;
-
-enum _ge_orientation_rot_t {
- GE_ORIENTATION_ROT_ERR = 0,
- GE_ORIENTATION_ROT_0 = 1,
- GE_ORIENTATION_ROT_180 = 3,
- GE_ORIENTATION_ROT_90 = 6,
- GE_ORIENTATION_ROT_270 = 8,
-};
-
-int _ge_exif_get_orientation(char *file_path, unsigned int *orientation);
-
-#ifdef _cplusplus
-}
-#endif
-
-#endif //_GE_EXIF_H_
-
-#endif //_USE_ROTATE_BG_GE
-
+++ /dev/null
-/*
-* Copyright (c) 2000-2015 Samsung Electronics Co., Ltd All Rights Reserved
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*
-*/
-
-#ifndef _GE_EXT_EXEC_H_
-#define _GE_EXT_EXEC_H_
-
-#include "gallery-efl.h"
-
-typedef enum {
- LAUNCH_FAIL,
- LAUNCH_SUCCESS
-} GeLaunchStatus;
-
-typedef enum {
- APPNONE = -1,
- FILETRANSFER,
-} GeExtAppType;
-
-int _ge_ext_load_app(ge_ugdata *ugd, GeExtAppType type, char *paths, int count);
-
-#endif //_GE_EXT_EXEC_H_
+++ /dev/null
-/*
-* Copyright (c) 2000-2015 Samsung Electronics Co., Ltd All Rights Reserved
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*
-*/
-
-#ifndef _GE_EXT_UG_LOAD_H_
-#define _GE_EXT_UG_LOAD_H_
-
-#include <ui-gadget.h>
-#include "gallery-efl.h"
-
-int _ge_ext_load_iv_ug(ge_ugdata *ugd, char *filt_url, char *album_index, int image_index);
-int _ge_ext_load_iv_ug_for_help(ge_ugdata *ugd, const char *uri);
-
-#endif //_GE_EXT_UG_LOAD_H_
-
/*
-* Copyright (c) 2000-2015 Samsung Electronics Co., Ltd All Rights Reserved
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*
-*/
+ * Copyright (c) 2015 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://floralicense.org/license/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
#ifndef _GE_FILE_UTIL_H_
#define _GE_FILE_UTIL_H_
#include <libgen.h>
#ifdef __cplusplus
-extern "C"
-{
+extern "C" {
#endif
-int ge_file_exists(const char *path);
+ int ge_file_exists(const char *path);
-int ge_file_size(const char *filename);
+ int ge_file_size(const char *filename);
-char* ge_file_dir_get(const char path[]);
#ifdef __cplusplus
}
#endif
-
-#endif //_GE_FILE_UTIL_H_
+#endif //_GE_FILE_UTIL_H_
+++ /dev/null
-/*
-* Copyright (c) 2000-2015 Samsung Electronics Co., Ltd All Rights Reserved
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*
-*/
-
-#ifndef _GE_GRIDVIEW_H_
-#define _GE_GRIDVIEW_H_
-
-#include "gallery-efl.h"
-
-int _ge_grid_get_selected_ids(ge_ugdata *ugd, Eina_List **ids_list);
-int _ge_grid_create_thumb(ge_cluster *album);
-int _ge_grid_create_split_view_thumb(ge_cluster *album);
-int _ge_grid_create_view(ge_ugdata *ugd, ge_thumbs_s *thumbs_d);
-int _ge_grid_update_view(ge_ugdata *ugd);
-Evas_Object *_ge_grid_get_layout(ge_ugdata *ugd);
-int _ge_grid_update_lang(ge_ugdata *ugd);
-int _ge_grid_update_data(ge_ugdata *ugd);
-int _ge_grid_get_store_type(ge_ugdata *ugd);
-int _ge_grid_create_main_view(ge_ugdata *ugd);
-void _ge_grid_change_selection_mode(ge_ugdata *ugd, bool state);
-int _ge_grid_sel_one(ge_ugdata *ugd, char *file_url);
-bool _ge_is_grid_view(ge_ugdata *ugd);
-
-#endif //_GE_GRIDVIEW_H_
-
/*
-* Copyright (c) 2000-2015 Samsung Electronics Co., Ltd All Rights Reserved
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*
-*/
+ * Copyright (c) 2015 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://floralicense.org/license/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
#ifndef __GE_ICON_H__
#define __GE_ICON_H__
#include "gallery-efl.h"
-#define GE_IMAGES_EDJ_FILE GE_EDJ_DIR"/attach-panel-gallery-images.edj"
-
-#define GE_DEFAULT_APP_ICON GALLERY_APP_ICON_DIR"org.tizen.gallery.png"
-#define GE_ALBUM_ICON_CAMERA "T01_album_icon_camera.png"
-#define GE_ALBUM_ICON_DOWNLOAD "T01_album_icon_download.png"
-#define GE_ALBUM_ICON_FOLDER "T01_album_icon_folder.png"
-#define GE_LOCK_ICON "T01_icon_lock.png"
-#define GE_THUMB_BOOKMARK "T01_icon_thumbnail_bookmark.png"
-#define GE_DB_DEFAULT_THUMB "/opt/usr/data/file-manager-service/.thumb/thumb_default.png"
-#define GE_ICON_TITLE_SELECT_ALL "T01_title_icon_select_all.png"
-#define GE_ICON_TITLE_SELECT_OK "T01_album_edit_check_on.png"
-#define GE_ICON_TITLE_SELECT_NOT_OK "T01_album_edit_check_off.png"
-#define GE_ICON_TITLE_SELECT_OK "T01_album_edit_check_on.png"
-#define GE_ICON_TITLE_SELECT_NOT_OK "T01_album_edit_check_off.png"
-#define GE_ICON_SOUND_SHOT "T01_icon_sound_shot.png"
-#define GE_ICON_PANORAMA "T01_icon_panorama.png"
-#define GE_ICON_NO_THUMBNAIL GE_IMAGES_DIR"No_thumbnail_351X261.png"
#define GE_ICON_CONTENTS_BROKEN GE_IMAGES_DIR"Contents_broken_351X261.png"
#define GE_ICON_MEMORY_CARD PREFIX"/res/images/attach-panel-gallery/images/T01_album_icon_sd_card.png"
-#endif //__GE_ICON_H__
-
+#endif //__GE_ICON_H__
+++ /dev/null
-/*
-* Copyright (c) 2000-2015 Samsung Electronics Co., Ltd All Rights Reserved
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*
-*/
-
-#ifndef _GE_LANG_H_
-#define _GE_LANG_H_
-
-#include "gallery-efl.h"
-
-#ifdef _cplusplus
-extern "C"
-{
-#endif
-
-int _ge_lang_update(ge_ugdata *ugd);
-
-#ifdef _cplusplus
-}
-#endif
-
-#endif //_GE_LANG_H_
-
/*
-* Copyright (c) 2000-2015 Samsung Electronics Co., Ltd All Rights Reserved
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*
-*/
+ * Copyright (c) 2015 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://floralicense.org/license/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
#ifndef _GE_LOCAL_DATA_H_
#define _GE_LOCAL_DATA_H_
int _ge_local_data_connect(void);
int _ge_local_data_disconnect(void);
-int _ge_local_data_get_album_by_path(char *path, ge_album_s **album);
-int _ge_local_data_get_album_list(ge_filter_s *condition, Eina_List **elilst);
-int _ge_local_data_get_media_count(const char *cluster_id, ge_filter_s *filter,
- int *item_cnt);
-int _ge_local_data_get_all_media_count(ge_filter_s *filter, int *item_cnt);
-int _ge_local_data_get_media(const char *media_id, ge_media_s **mitem);
-int _ge_local_data_get_album_cover(char *album_id, ge_filter_s *condition,
- Eina_List **elist);
-int _ge_local_data_get_all_albums_cover(ge_filter_s *condition,
- Eina_List **elist);
-int _ge_local_data_get_album_media_list(char *album_id, ge_filter_s *condition,
- Eina_List **elist);
-int _ge_local_data_get_all_albums_media_list(ge_filter_s *condition,
- Eina_List **elist);
-int _ge_local_data_get_album_by_id(char *album_id, ge_album_s **cluster);
-int _ge_local_data_get_media_by_id(char *media_id, ge_media_s **mitem);
-int _ge_local_data_get_duration(media_info_h media, int *duration);
-
-#endif //_GE_LOCAL_DATA_H_
+int _ge_local_data_get_media_count(const char *cluster_id,
+ ge_filter_s * filter, int *item_cnt);
+int _ge_local_data_get_all_media_count(ge_filter_s * filter,
+ int *item_cnt);
+int _ge_local_data_get_all_albums_media_list(ge_filter_s * condition,
+ Eina_List ** elist);
+#endif //_GE_LOCAL_DATA_H_
/*
-* Copyright (c) 2000-2015 Samsung Electronics Co., Ltd All Rights Reserved
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*
-*/
+ * Copyright (c) 2015 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://floralicense.org/license/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
#ifndef __GE_MAIN_VIEW_H__
GE_CTRL_TAB_CNT,
} ge_ctrl_tab_mode;
-int _ge_main_create_view(ge_ugdata *ugd);
-
-#endif //__GE_MAIN_VIEW_H__
+int _ge_main_create_view(ge_ugdata * ugd);
+#endif //__GE_MAIN_VIEW_H__
/*
-* Copyright (c) 2000-2015 Samsung Electronics Co., Ltd All Rights Reserved
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*
-*/
+ * Copyright (c) 2015 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://floralicense.org/license/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
#ifndef _GE_NOCONTENT_H_
#define _GE_NOCONTENT_H_
-Evas_Object *_ge_nocontents_create(ge_ugdata *ugd);
-
-#endif //_GE_NOCONTENT_H_
+Evas_Object *_ge_nocontents_create(ge_ugdata * ugd);
+#endif //_GE_NOCONTENT_H_
+++ /dev/null
-/*
-* Copyright (c) 2000-2015 Samsung Electronics Co., Ltd All Rights Reserved
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*
-*/
-
-#ifdef _USE_ROTATE_BG_GE
-
-#ifndef _GE_ROTATE_BG_H_
-#define _GE_ROTATE_BG_H_
-
-#include "gallery-efl.h"
-
-Evas_Object *_ge_rotate_bg_add(Evas_Object *parent, bool b_preload);
-int _ge_rotate_bg_set_file(Evas_Object *bg, const char *file, int w, int h);
-int _ge_rotate_bg_rotate_image(Evas_Object *bg, unsigned int orient);
-int _ge_rotate_bg_add_image(Evas_Object *bg, int w, int h);
-int _ge_rotate_bg_set_image_file(Evas_Object *bg, const char *file);
-
-#endif //_GE_ROTATE_BG_H_
-
-#endif //_USE_ROTATE_BG_GE
/*
-* Copyright (c) 2000-2015 Samsung Electronics Co., Ltd All Rights Reserved
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*
-*/
+ * Copyright (c) 2015 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://floralicense.org/license/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
#ifndef _GE_STRINGS_H_
#define _GE_STRINGS_H_
#define GE_POPUP_ADD_SHORTCUT_FAILED _("Add shortcut failed!")
#define GE_STR_SR_TITLE _("title")
#define GE_STR_ID_SELECT_ITEM "IDS_MEDIABR_HEADER_SELECT_ITEM"
-#define GE_STR_ID_SELECT_ITEMS _GE_GETLOCALSTR("IDS_MEDIABR_BODY_SELECT_ITEMS")//"IDS_MEDIABR_BODY_SELECT_ITEMS"
+#define GE_STR_ID_SELECT_ITEMS _GE_GETLOCALSTR("IDS_MEDIABR_BODY_SELECT_ITEMS") //"IDS_MEDIABR_BODY_SELECT_ITEMS"
#define GE_STR_ID_ALBUMS "IDS_COM_BODY_ALBUMS"
#define GL_STR_ID_TIME_LINE "IDS_MEDIABR_HEADER_TIMELINE_ABB"
#define GE_STR_ID_CANCEL "IDS_COM_SK_CANCEL"
#define GE_STR_PD_SELECTED _GE_GETLOCALSTR("IDS_MEDIABR_HEADER_PD_SELECTED")
/* system strings which are included in sys-string-0 po files */
-#define GE_STR_CAMERA _GE_GETSYSTEMSTR("IDS_COM_BODY_CAMERA")
-#define GE_STR_DOWNLOADS _GE_GETSYSTEMSTR("IDS_COM_BODY_DOWNLOADS")
+#define GE_STR_CAMERA _GE_GETSYSTEMSTR("IDS_COM_BODY_CAMERA")
+#define GE_STR_DOWNLOADS _GE_GETSYSTEMSTR("IDS_COM_BODY_DOWNLOADS")
#define GE_STR_NO_VIDEOS _GE_GETSYSTEMSTR("IDS_COM_BODY_NO_VIDEOS")
#define GE_STR_NO_IMAGES _GE_GETSYSTEMSTR("IDS_COM_BODY_NO_IMAGES")
#define GE_STR_NO_ITEMS _GE_GETSYSTEMSTR("IDS_COM_BODY_NO_ITEMS")
#ifdef _cplusplus
}
#endif
-#endif //_GE_STRINGS_H_
+#endif //_GE_STRINGS_H_
+++ /dev/null
-/*
-* Copyright (c) 2000-2015 Samsung Electronics Co., Ltd All Rights Reserved
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*
-*/
-
-#ifndef _GE_THUMB_H_
-#define _GE_THUMB_H_
-
-typedef enum _ge_cm_mode_t {
- GE_CM_MODE_NORMAL = 0,
- GE_CM_MODE_PANORAMA = 1,
- GE_CM_MODE_SOUND = 2,
- GE_CM_MODE_ANIMATE = 3,
- GE_CM_MODE_BEST = 4,
- GE_CM_MODE_FB = 5,
- GE_CM_MODE_VOICE_REC = 10,
- GE_CM_MODE_MAX,
-} ge_cm_mode_e;
-
-Evas_Object *_ge_thumb_show_part_icon_image(Evas_Object *obj, char *path,
- unsigned int orient, bool b_favor,
- int item_w, int item_h);
-
-Evas_Object *_ge_thumb_show_part_icon_video(Evas_Object *obj, char *path,
- unsigned int v_dur, int bk_len,
- bool b_favor, int item_w, int item_h);
-int _ge_thumb_set_size(ge_ugdata *ugd, Evas_Object *view, int rotate_mode,
- int *size_w, int *size_h);
-Evas_Object *_ge_thumb_show_mode(Evas_Object *obj, ge_cm_mode_e mode);
-
-#endif //_GE_THUMB_H_
-
+++ /dev/null
-/*
-* Copyright (c) 2000-2015 Samsung Electronics Co., Ltd All Rights Reserved
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*
-*/
-
-#ifndef _GE_TILE_H_
-#define _GE_TILE_H_
-
-#include "ge-data.h"
-
-#define GE_TILE_ICON "elm.swallow.icon"
-#define GE_TILE_LABEL "label_bg"
-#define GE_TILE_TYPE_ICON "elm.swallow.type_icon"
-
-/* type for showing different icon in typeicon part in edc */
-typedef enum _ge_tile_type {
- GE_TILE_TYPE_NONE,
- GE_TILE_TYPE_FACEBOOK, /* Facebook album */
- GE_TILE_TYPE_CLOUD, /* Cloud album */
- GE_TILE_TYPE_CAMERA, /* Camera album */
- GE_TILE_TYPE_DOWNLOAD, /* Download album */
- GE_TILE_TYPE_FOLDER, /* Folder album */
- GE_TILE_TYPE_PEOPLE, /* People album */
-} ge_tile_type;
-
-typedef enum {
- GE_ICON_NORMAL,
- GE_ICON_CORRUPTED_FILE
-} ge_icon_type;
-
-typedef ge_icon_type (*bg_file_set_cb)(Evas_Object *bg, void *data);
-
-Evas_Object *_ge_tile_show_part_icon(Evas_Object *obj, const char *part,
- int length, bg_file_set_cb func,
- void *data);
-int _ge_tile_update_item_size(ge_ugdata *ugd, Evas_Object *grid,
- int rotate_mode, bool b_update);
-Evas_Object *_ge_tile_show_part_type_icon(Evas_Object *obj, int type);
-
-#endif //_GE_TILE_H_
-
/*
-* Copyright (c) 2000-2015 Samsung Electronics Co., Ltd All Rights Reserved
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*
-*/
+ * Copyright (c) 2015 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://floralicense.org/license/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
#ifndef __GE_UGDATA_H__
#define __GE_UGDATA_H__
#ifdef __cplusplus
extern "C" {
-#endif /* __cplusplus */
+#endif /* __cplusplus */
#define GE_MAX_BYTES_FOR_CHAR 3
#define GE_ALBUM_NAME_LEN_MAX (255 * GE_MAX_BYTES_FOR_CHAR + 1)
/*Image viewer UG service parameters-End*/
-typedef enum {
- GE_ALBUM_SELECT_T_NONE,
- GE_ALBUM_SELECT_T_ONE,
-} ge_album_select_e;
-
-typedef enum {
- GE_FILE_SELECT_T_NONE,
- GE_FILE_SELECT_T_ONE,
- GE_FILE_SELECT_T_MULTIPLE,
- GE_FILE_SELECT_T_SETAS,
- GE_FILE_SELECT_T_IMFT,
- GE_FILE_SELECT_T_SLIDESHOW,
-} ge_file_select_e;
-
-typedef enum {
- GE_SETAS_T_NONE,
- GE_SETAS_T_WALLPAPER,
- GE_SETAS_T_LOCKPAPER,
- GE_SETAS_T_WALLPAPER_LOCKPAPER,
- GE_SETAS_T_CROP_WALLPAPER,
- GE_SETAS_T_CALLERID,
-} ge_file_select_setas_e;
-
-typedef enum {
- GE_FILE_T_NONE,
- GE_FILE_T_IMAGE,
- GE_FILE_T_VIDEO,
- GE_FILE_T_ALL,
-} ge_file_type_e;
-
-typedef enum view_by_mode_e {
- GE_VIEW_ALBUMS,
- GE_VIEW_PEOPLE,
- GE_VIEW_THUMBS,
- GE_VIEW_THUMBS_EDIT,
-} ge_view_mode;
-
-typedef enum {
- GE_ROTATE_NONE,
- GE_ROTATE_PORTRAIT,
- GE_ROTATE_PORTRAIT_UPSIDEDOWN,
- GE_ROTATE_LANDSCAPE,
- GE_ROTATE_LANDSCAPE_UPSIDEDOWN,
-} ge_rotate_mode;
-
-typedef enum {
- GE_UPDATE_NONE,
- GE_UPDATE_NORMAL,
- GE_UPDATE_MMC_REMOVED,
- GE_UPDATE_MMC_ADDED,
- GE_UPDATE_VIEW_INOTIFY
-} ge_update_mode;
-
-typedef enum {
- GE_VIEW_BY_NONE,
- GE_VIEW_BY_ALL,
- GE_VIEW_BY_ALBUMS,
- GE_VIEW_BY_MAX,
-} ge_viewby_mode;
-
-typedef struct _ge_ugdata ge_ugdata;
-typedef struct _ge_item ge_item;
-typedef struct _ge_sel_album_t ge_sel_album_s;
-typedef struct _ge_sel_item_t ge_sel_item_s;
-typedef struct _ge_cluster ge_cluster;
-typedef struct _ge_thumbs_t ge_thumbs_s;
-typedef struct ge_db_noti_t ge_db_noti_s;
-
-typedef int (*ge_albums_append_cb)(ge_ugdata *ugd, ge_cluster *album);
-typedef int (*ge_rotate_view_cb)(ge_ugdata *ugd);
-
-typedef struct {
- Eina_List *clist;
- int data_type;
- int local_cnt;
- int web_cnt;
- ge_albums_append_cb append_cb;
- bool b_updated;
- int all_medias_cnt;
- time_t last_mtime;
-}ge_cluster_list;
-
-struct _ge_sel_album_t {
- union {
- char *uuid; /*album's uuid*/
- int id; /*people album's id*/
+ typedef enum {
+ GE_ALBUM_SELECT_T_NONE,
+ GE_ALBUM_SELECT_T_ONE,
+ } ge_album_select_e;
+
+ typedef enum {
+ GE_FILE_SELECT_T_NONE,
+ GE_FILE_SELECT_T_ONE,
+ GE_FILE_SELECT_T_MULTIPLE,
+ } ge_file_select_e;
+
+ typedef enum {
+ GE_FILE_T_NONE,
+ GE_FILE_T_IMAGE,
+ GE_FILE_T_ALL,
+ } ge_file_type_e;
+
+ typedef enum {
+ GE_ROTATE_NONE,
+ GE_ROTATE_PORTRAIT,
+ GE_ROTATE_PORTRAIT_UPSIDEDOWN,
+ GE_ROTATE_LANDSCAPE,
+ GE_ROTATE_LANDSCAPE_UPSIDEDOWN,
+ } ge_rotate_mode;
+
+ typedef enum {
+ GE_UPDATE_NONE,
+ GE_UPDATE_NORMAL,
+ GE_UPDATE_MMC_REMOVED,
+ GE_UPDATE_MMC_ADDED,
+ GE_UPDATE_VIEW_INOTIFY
+ } ge_update_mode;
+
+ typedef enum {
+ GE_VIEW_BY_NONE,
+ GE_VIEW_BY_ALL,
+ GE_VIEW_BY_ALBUMS,
+ GE_VIEW_BY_MAX,
+ } ge_viewby_mode;
+
+ typedef struct _ge_ugdata ge_ugdata;
+ typedef struct _ge_item ge_item;
+ typedef struct _ge_sel_album_t ge_sel_album_s;
+ typedef struct _ge_sel_item_t ge_sel_item_s;
+ typedef struct _ge_cluster ge_cluster;
+ typedef struct _ge_thumbs_t ge_thumbs_s;
+ typedef struct ge_db_noti_t ge_db_noti_s;
+
+ typedef int (*ge_albums_append_cb) (ge_ugdata * ugd,
+ ge_cluster * album);
+ typedef int (*ge_rotate_view_cb) (ge_ugdata * ugd);
+
+ typedef struct {
+ Eina_List *clist;
+ int data_type;
+ int local_cnt;
+ int web_cnt;
+ ge_albums_append_cb append_cb;
+ bool b_updated;
+ int all_medias_cnt;
+ time_t last_mtime;
+ } ge_cluster_list;
+
+ struct _ge_sel_album_t {
+ union {
+ char *uuid; /*album's uuid */
+ int id; /*people album's id */
+ };
+ Eina_List *elist;
};
- Eina_List *elist;
-};
-
-struct _ge_sel_item_t {
- char *uuid;
- char *file_url;
- int store_type;
- int valid;
- int sequence;
-};
-
-struct _ge_item {
- ge_media_s* item;
- ge_ugdata* ugd;
- Elm_Object_Item *elm_item;
- bool checked;
- ge_cluster *album;
- int store_type;
- int sequence;
-};
-struct _ge_cluster {
- ge_album_s *cluster;
- ge_ugdata *ugd;
- int index;
-
- Elm_Object_Item *griditem;
- ge_item *cover;
- int cover_thumbs_cnt;
- int sel_cnt; /* Selected medias count of current album */
- bool select;
-};
-
-typedef enum {
- ATTACH_PANEL_NONE,
- ATTACH_PANEL_FULL_MODE,
- ATTACH_PANEL_HALF_MODE,
-}_ge_attach_panel_display_mode;
-
-struct _ge_ugdata {
- Evas_Object *win;
- Evas_Object *ly_parent;
- Evas_Object *ly_main;
- Evas_Object *bg;
- Elm_Theme *th;
- Evas_Object *naviframe;
- Elm_Object_Item *nf_it;
- Evas_Object *conform;
- Evas_Object *image_object;
-//#ifdef _USE_HIDE_INDICATOR
- Elm_Win_Indicator_Opacity_Mode indi_o_mode;
- Elm_Win_Indicator_Mode indi_mode;
- bool overlap_mode;
-//#endif
-#ifdef _USE_ADD_ACCOUNT
- WebMediaHandle *db_handle;
-#endif
- ge_view_mode view_mode;
- int rotate_mode;
- int tab_mode;
- Eina_List *rotate_cbs;
-
- Evas_Object *main_view_ly;
- Elm_Gengrid_Item_Class *album_gic;
- Evas_Object *albums_view;
- Evas_Object *albums_view_ly;
- Evas_Object *nocontents;
- Evas_Object *popup;
- Elm_Object_Item *done_it;
- Ecore_Timer *del_timer;
- int popup_mode;
+ struct _ge_sel_item_t {
+ char *uuid;
+ char *file_url;
+ int store_type;
+ int valid;
+ int sequence;
+ };
- ge_cluster_list* cluster_list;
- ui_gadget_h ug_called_by_me;
- ui_gadget_h ug;
- char *ug_path;
- app_control_h service; /*added for "ug_send_result"*/
- bool b_destroy_me;
- Ecore_Idler *album_idler;
- Ecore_Idler *sel_album_idler;
- Eina_List *selected_elist;
- Eina_Bool ck_state;
- int album_select_mode;
- int file_select_mode;
- int file_type_mode;
- int file_select_contact_id;
- int file_select_setas_mode;
- int file_select_setas_status;
- char *file_select_setas_path;
- char *slideshow_album_id;
- int slideshow_viewby;
- int max_count;
- char* file_setas_image_path;
- char* file_setas_crop_image_path;
- char albums_view_title[GE_ALBUM_NAME_LEN_MAX];
+ struct _ge_item {
+ ge_media_s *item;
+ ge_ugdata *ugd;
+ Elm_Object_Item *elm_item;
+ bool checked;
+ ge_cluster *album;
+ int store_type;
+ int sequence;
+ };
- Evas_Object *selinfo_ly;
- bool b_multifile; /* Multipe files selection */
- bool b_hide_indicator;
- ge_thumbs_s *thumbs_d;
- ge_db_noti_s *db_noti_d;
- _ge_attach_panel_display_mode attach_panel_display_mode;
- bool is_attach_panel;
- ge_cluster *album_item;
- Elm_Object_Item *selected_griditem;
- Ecore_Event_Handler *key_down_handler;
- long long int selsize;
- long long int limitsize;
- bool ug_launched;
- app_control_h gallery_handle;
-};
+ struct _ge_cluster {
+ ge_album_s *cluster;
+ ge_ugdata *ugd;
+ int index;
-struct _ge_thumbs_t {
- ge_ugdata *ugd;
- Evas_Object *view;
- Evas_Object *check;
- Evas_Object *nocontents;
- Evas_Object *layout;
- Evas_Object *split_view;
- Elm_Gengrid_Item_Class *gic;
- Elm_Gengrid_Item_Class *gic_first;
- Elm_Gengrid_Item_Class *no_content;
- Elm_Object_Item *nf_it;
- Elm_Object_Item *done_it;
+ Elm_Object_Item *griditem;
+ ge_item *cover;
+ int cover_thumbs_cnt;
+ int sel_cnt; /* Selected medias count of current album */
+ bool select;
+ };
- Ecore_Idler *append_idler;
- /* It's thumbnails icon size, not grid item size */
- int icon_w;
- int icon_h;
+ typedef enum {
+ ATTACH_PANEL_NONE,
+ ATTACH_PANEL_FULL_MODE,
+ ATTACH_PANEL_HALF_MODE,
+ } _ge_attach_panel_display_mode;
+
+ struct _ge_ugdata {
+ Evas_Object *win;
+ Evas_Object *ly_parent;
+ Evas_Object *ly_main;
+ Evas_Object *bg;
+ Elm_Theme *th;
+ Evas_Object *naviframe;
+ Elm_Object_Item *nf_it;
+ Evas_Object *conform;
+ Evas_Object *image_object;
+ Elm_Win_Indicator_Opacity_Mode indi_o_mode;
+ Elm_Win_Indicator_Mode indi_mode;
+ bool overlap_mode;
+ int rotate_mode;
+ int tab_mode;
+ Eina_List *rotate_cbs;
+
+ Evas_Object *main_view_ly;
+ Elm_Gengrid_Item_Class *album_gic;
+ Evas_Object *albums_view;
+ Evas_Object *albums_view_ly;
+ Evas_Object *nocontents;
+ Evas_Object *popup;
+ Elm_Object_Item *done_it;
+ Ecore_Timer *del_timer;
+ int popup_mode;
+
+ ge_cluster_list *cluster_list;
+ ui_gadget_h ug_called_by_me;
+ ui_gadget_h ug;
+ char *ug_path;
+ app_control_h service; /*added for "ug_send_result" */
+ bool b_destroy_me;
+ Ecore_Idler *album_idler;
+ Ecore_Idler *sel_album_idler;
+ Eina_List *selected_elist;
+ Eina_Bool ck_state;
+ int album_select_mode;
+ int file_select_mode;
+ int file_type_mode;
+ int file_select_contact_id;
+ int file_select_setas_mode;
+ int file_select_setas_status;
+ char *file_select_setas_path;
+ char *slideshow_album_id;
+ int slideshow_viewby;
+ int max_count;
+ char *file_setas_image_path;
+ char *file_setas_crop_image_path;
+ char albums_view_title[GE_ALBUM_NAME_LEN_MAX];
+
+ Evas_Object *selinfo_ly;
+ bool b_multifile; /* Multipe files selection */
+ bool b_hide_indicator;
+ ge_thumbs_s *thumbs_d;
+ ge_db_noti_s *db_noti_d;
+ _ge_attach_panel_display_mode attach_panel_display_mode;
+ bool is_attach_panel;
+ ge_cluster *album_item;
+ Elm_Object_Item *selected_griditem;
+ Ecore_Event_Handler *key_down_handler;
+ long long int selsize;
+ long long int limitsize;
+ bool ug_launched;
+ app_control_h gallery_handle;
+ media_content_noti_h noti_handle;
+ };
- /* Data from parent album */
- char *album_uuid;
- int store_type;
- int tot_selected;
- /* Data from DB */
- int medias_cnt;
- Eina_List *medias_elist;
- bool b_multifile; /* Multiple file selection */
- bool b_mainview; /* First level view */
- ge_cluster *album;
- bool b_editmode;
- Evas_Object *gengrid;
- Eina_List *check_list;
- Eina_List *image_layout_list;
-};
+ struct _ge_thumbs_t {
+ ge_ugdata *ugd;
+ Evas_Object *view;
+ Evas_Object *check;
+ Evas_Object *nocontents;
+ Evas_Object *layout;
+ Evas_Object *split_view;
+ Elm_Gengrid_Item_Class *gic;
+ Elm_Gengrid_Item_Class *gic_first;
+ Elm_Gengrid_Item_Class *no_content;
+ Elm_Object_Item *nf_it;
+ Elm_Object_Item *done_it;
+
+ Ecore_Idler *append_idler;
+ /* It's thumbnails icon size, not grid item size */
+ int icon_w;
+ int icon_h;
+
+ /* Data from parent album */
+ char *album_uuid;
+ int store_type;
+ int tot_selected;
+ /* Data from DB */
+ int medias_cnt;
+ Eina_List *medias_elist;
+ bool b_multifile; /* Multiple file selection */
+ bool b_mainview; /* First level view */
+ ge_cluster *album;
+ bool b_editmode;
+ Evas_Object *gengrid;
+ Eina_List *check_list;
+ Eina_List *image_layout_list;
+ };
#ifdef __cplusplus
}
-#endif /* __cplusplus */
-
-
-#endif /* __GE_UGDATA_H__ */
-
+#endif /* __cplusplus */
+#endif /* __GE_UGDATA_H__ */
/*
-* Copyright (c) 2000-2015 Samsung Electronics Co., Ltd All Rights Reserved
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*
-*/
+ * Copyright (c) 2015 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://floralicense.org/license/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
#ifndef _GE_UI_UTIL_H_
#define _GE_UI_UTIL_H_
#define _EDJ(o) elm_layout_edje_get(o)
-#define _GE_GET_ICON(_path) \
- ((1 == ge_file_exists(_path) && (ge_file_size(_path) > 0)) ? _path : GE_ICON_NO_THUMBNAIL)
-#define _GE_GET_APP_ICON(_path) \
- ((1 == ge_file_exists(_path) && (ge_file_size(_path) > 0)) ? _path : GE_DEFAULT_APP_ICON)
-
-typedef enum {
- GE_POPUP_NOBUT,
- GE_POPUP_ONEBUT,
- GE_POPUP_TWOBUT,
- GE_POPUP_EXIT,
-} ge_popup_mode_e;
-
-Evas_Object* ge_ui_create_naviframe(ge_ugdata *ugd, Evas_Object *parent);
-Evas_Object *ge_ui_create_main_ly(Evas_Object *parent);
-Evas_Object* ge_ui_load_edj(Evas_Object *parent, const char *file, const char *group);
-Evas_Object* ge_ui_create_nocontents(ge_ugdata* ugd);
-int ge_ui_lock_albums(ge_cluster* album_item);
-Evas_Object* ge_ui_create_popup(ge_ugdata* ugd, ge_popup_mode_e mode,
- char* desc);
-int _ge_ui_create_notiinfo(const char *text);
-char* _ge_ui_get_i18n_album_name(ge_album_s *cluster);
-int _ge_ui_reset_scroller_pos(Evas_Object *obj);
-int _ge_ui_del_scroller_pos(Evas_Object *obj);
-int _ge_ui_save_scroller_pos(Evas_Object *obj);
-int _ge_ui_restore_scroller_pos(Evas_Object *obj);
-int _ge_ui_set_translate_str(Evas_Object *obj, const char *str);
-int _ge_ui_set_translate_part_str(Evas_Object *obj, const char *part,
- const char *str);
-int _ge_ui_set_translatable_item(Elm_Object_Item *nf_it, const char *str);
-int _ge_ui_update_label_text(Elm_Object_Item *nf_it, int sel_cnt,
- const char *text);
-int _ge_ui_get_indicator_state(ge_ugdata *ugd);
-int _ge_ui_hide_indicator(ge_ugdata *ugd);
-#ifdef _USE_HIDE_INDICATOR
-int _ge_ui_reset_indicator(ge_ugdata *ugd);
-#endif
-Evas_Object *_ge_ui_add_toolbar(Evas_Object *parent);
-Elm_Object_Item *_ge_ui_append_item(Evas_Object *obj, const char *icon,
- const char *label, Evas_Smart_Cb func,
- const void *data);
-int _ge_ui_disable_item(Elm_Object_Item *it, Eina_Bool b_disabled);
+ typedef enum {
+ GE_POPUP_NOBUT,
+ GE_POPUP_ONEBUT,
+ GE_POPUP_TWOBUT,
+ GE_POPUP_EXIT,
+ } ge_popup_mode_e;
+
+ Evas_Object *ge_ui_create_naviframe(ge_ugdata * ugd,
+ Evas_Object * parent);
+ Evas_Object *ge_ui_create_main_ly(Evas_Object * parent);
+ Evas_Object *ge_ui_load_edj(Evas_Object * parent, const char *file,
+ const char *group);
+ int ge_ui_lock_albums(ge_cluster * album_item);
+ int _ge_ui_reset_scroller_pos(Evas_Object * obj);
+ int _ge_ui_set_translate_str(Evas_Object * obj, const char *str);
+ int _ge_ui_set_translate_part_str(Evas_Object * obj, const char *part,
+ const char *str);
+ int _ge_ui_get_indicator_state(ge_ugdata * ugd);
+ int _ge_ui_hide_indicator(ge_ugdata * ugd);
#ifdef _cplusplus
}
#endif
-
-#endif //_GE_UI_UTIL_H_
+#endif //_GE_UI_UTIL_H_
/*
-* Copyright (c) 2000-2015 Samsung Electronics Co., Ltd All Rights Reserved
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*
-*/
+ * Copyright (c) 2015 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://floralicense.org/license/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
#ifndef _GE_UTIL_H_
#define _GE_UTIL_H_
#define GE_FILE_EXISTS(path) \
(path && (1 == ge_file_exists(path)) && (ge_file_size(path) > 0))
-#define GE_ICON_SET_FILE(icon, img) \
- elm_image_file_set(icon, GE_IMAGES_EDJ_FILE, img)
-
-
-void _ge_set_current_item(ge_item* gitem);
-int ge_reg_db_update_noti(ge_ugdata* ugd);
+void _ge_set_current_item(ge_item * gitem);
+int ge_reg_db_update_noti(ge_ugdata * ugd);
int ge_dereg_db_update_noti(void);
-Eina_Bool ge_update_view(ge_ugdata* ugd, int mode);
-bool _ge_is_image_valid(void *data, char *filepath);
-char *_ge_get_duration_string(unsigned int v_dur);
-ge_view_mode _ge_get_view_mode(ge_ugdata *ugd);
-int _ge_set_view_mode(ge_ugdata *ugd, ge_view_mode mode);
-double _ge_get_win_factor(Evas_Object *win, bool b_hide_indicator, int *width,
- int *height);
-int _ge_addhome_image(ge_ugdata *ugd, char *path);
-int _ge_send_result(ge_ugdata *ugd);
+Eina_Bool ge_update_view(ge_ugdata * ugd, int mode);
+int _ge_addhome_image(ge_ugdata * ugd, char *path);
int _ge_atoi(const char *number);
-char *_ge_str(char *str_id);
-
-#endif //_GE_UTIL_H_
+#endif //_GE_UTIL_H_
Version: 1.3.21
Release: 1
Group: Applications
-License: Apache-2.0
+License: Flora-1.1
Source0: %{name}-%{version}.tar.gz
%if "%{?tizen_profile_name}" == "wearable" || "%{?tizen_profile_name}" == "tv"
+++ /dev/null
-/*
-* Copyright (c) 2000-2015 Samsung Electronics Co., Ltd All Rights Reserved
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*
-*/
-
-#define CHECK_STYLE_DEFAULT_BG_NORMAL_MIN_MAX_INC 64 64
-
-#define CHECK_DEFAULT_TEXT_NORMAL_COLOR_INC 255 255 255 255
-#define CHECK_DEFAULT_TEXT_PRESSED_COLOR_INC 255 255 255 255
-#define CHECK_DEFAULT_TEXT_DISABLED_COLOR_INC 136 136 136 136
-
-////////////////////////////////////////////////////////////////////////////////////////
-//
-// check default textblock style
-//
-///////////////////////////////////////////////////////////////////////////////////////
- styles {
- style { name: "check_label_textblock_style";
- base: "font=Tizen:style=Roman text_class=tizen font_size=32 color=#ffffff wrap=char";
- tag: "br" "\n";
- tag: "ps" "ps";
- tag: "hilight" "+ font=Tizen:style=Bold text_class=tizen";
- tag: "b" "+ font=Tizen:style=Bold text_class=tizen";
- tag: "whitecolor" "+ color=#ffffff";
- tag: "tab" "\t";
- }
- }
-
-#define CHECK_STATE_DEFAULT 0
-#define CHECK_STATE_VISIBLE 1
-#define CHECK_STATE_DISABLED_VISIBLE 2
-#define CHECK_STATE_DISABLED 3
-
-////////////////////////////////////////////////////////////////////////////////
-#define CHECK_STYLE_DEFAULT(style_name, image_bg, image_checking, image_nocheck, min_width, min_height, check_visible) \
- group { name: "elm/check/base/"style_name; \
- images { \
- image: image_bg COMP; \
- image: GE_EDC_IMAGE_CHECK_BG_DIM COMP; \
- image: image_checking COMP; \
- image: image_nocheck COMP; \
- } \
- script { \
- public check_state = CHECK_STATE_DEFAULT; \
- } \
- parts { \
- part { name: "back_bg"; \
- type: RECT; \
- scale: 1; \
- description { state: "default" 0.0; \
- rel2.relative: 1.0 1.0; \
- align: 0 0.5; \
- min: min_width min_height; \
- fixed: 1 1; \
- color: 0 0 0 0; \
- } \
- } \
- part { name: "bg"; \
- mouse_events: 0; \
- scale: 1; \
- description { state: "default" 0.0; \
- min: CHECK_STYLE_DEFAULT_BG_NORMAL_MIN_MAX_INC; \
- max: CHECK_STYLE_DEFAULT_BG_NORMAL_MIN_MAX_INC; \
- fixed: 1 1; \
- rel1.to: "back_bg"; \
- rel2.to: "back_bg"; \
- image.normal: image_bg; \
- fill.smooth : 0; \
- } \
- description { state: "disabled" 0.0; \
- inherit: "default" 0.0; \
- image.normal: GE_EDC_IMAGE_CHECK_BG_DIM; \
- fill.smooth : 0; \
- } \
- } \
- part { name: "check"; \
- mouse_events: 0; \
- scale: 1; \
- description { state: "default" 0.0; \
- rel1.to: "bg"; \
- rel2.to: "bg"; \
- visible: check_visible; \
- image.normal: image_nocheck; \
- } \
- description { state: "visible" 0.0; \
- inherit: "default" 0.0; \
- visible: 1; \
- image.normal: image_checking; \
- } \
- description { state: "disabled_visible" 0.0; \
- inherit: "default" 0.0; \
- image.normal: image_checking; \
- visible: 1; \
- } \
- } \
- part { name: "elm.swallow.content"; \
- type: SWALLOW; \
- description { state: "default" 0.0; \
- fixed: 1 0; \
- visible: 0; \
- color: 255 255 255 255; \
- align: 0.0 0.5; \
- rel1 { \
- to_x: "bg"; \
- relative: 1.0 0.0; \
- offset: 1 1; \
- } \
- rel2 { \
- to_x: "bg"; \
- relative: 1.0 1.0; \
- offset: 2 -2; \
- } \
- } \
- description { state: "visible" 0.0; \
- inherit: "default" 0.0; \
- fixed: 1 1; \
- visible: 1; \
- aspect: 1.0 1.0; \
- aspect_preference: VERTICAL; \
- } \
- description { state: "disabled" 0.0; \
- inherit: "default" 0.0; \
- color: 128 128 128 128; \
- } \
- description { state: "disabled_visible" 0.0; \
- inherit: "default" 0.0; \
- color: 128 128 128 128; \
- fixed: 1 1; \
- visible: 1; \
- aspect: 1.0 1.0; \
- } \
- } \
- part { name: "elm.text"; \
- type: TEXTBLOCK; \
- mouse_events: 0; \
- scale: 1; \
- description { state: "default" 0.0; \
- visible: 0; \
- fixed: 0 1; \
- rel1 { \
- relative: 1.0 0.5; \
- offset: 1 1; \
- to_x: "elm.swallow.content"; \
- } \
- rel2 { \
- relative: 1.0 0.5; \
- offset: -2 -2; \
- } \
- align: 0.0 0.5; \
- text { \
- style: "check_label_textblock_style"; \
- min: 0 0; \
- } \
- color: CHECK_DEFAULT_TEXT_NORMAL_COLOR_INC; \
- } \
- description { state: "visible" 0.0; \
- inherit: "default" 0.0; \
- visible: 1; \
- text.min: 1 1; \
- } \
- description { state: "disabled" 0.0; \
- inherit: "default" 0.0; \
- } \
- description { state: "disabled_visible" 0.0; \
- inherit: "default" 0.0; \
- visible: 1; \
- text.min: 1 1; \
- color: CHECK_DEFAULT_TEXT_DISABLED_COLOR_INC; \
- } \
- } \
- part { name: "events1"; \
- type: RECT; \
- ignore_flags: ON_HOLD; \
- description { state: "default" 0.0; \
- color: 0 0 0 0; \
- } \
- } \
- part { name: "events2"; \
- type: RECT; \
- repeat_events: 1; \
- description { state: "default" 0.0; \
- color: 0 0 0 0; \
- } \
- } \
- part { name: "disabler"; \
- type: RECT; \
- description { state: "default" 0.0; \
- color: 0 0 0 0; \
- visible: 0; \
- } \
- description { state: "disabled" 0.0; \
- inherit: "default" 0.0; \
- visible: 1; \
- } \
- } \
- } \
- programs { \
- program { name: "click"; \
- signal: "mouse,clicked,1"; \
- source: "events1"; \
- action: SIGNAL_EMIT "elm,action,check,toggle" ""; \
- } \
- program { name: "check_on"; \
- signal: "elm,state,check,on"; \
- source: "elm"; \
- script { \
- set_int(check_state, CHECK_STATE_VISIBLE); \
- set_state(PART:"check", "visible", 0.0); \
- } \
- } \
- program { name: "check_off"; \
- signal: "elm,state,check,off"; \
- source: "elm"; \
- action: STATE_SET "default" 0.0; \
- target: "check"; \
- script { \
- if (get_int(check_state) == CHECK_STATE_VISIBLE) \
- { \
- set_int(check_state, CHECK_STATE_DEFAULT); \
- set_state(PART:"check", "default", 0.0); \
- } \
- } \
- } \
- program { name: "text_show"; \
- signal: "elm,state,text,visible"; \
- source: "elm"; \
- action: STATE_SET "visible" 0.0; \
- target: "elm.text"; \
- } \
- program { name: "text_hide"; \
- signal: "elm,state,text,hidden"; \
- source: "elm"; \
- action: STATE_SET "default" 0.0; \
- target: "elm.text"; \
- } \
- program { name: "icon_show"; \
- signal: "elm,state,icon,visible"; \
- source: "elm"; \
- action: STATE_SET "visible" 0.0; \
- target: "elm.swallow.content"; \
- } \
- program { name: "icon_hide"; \
- signal: "elm,state,icon,hidden"; \
- source: "elm"; \
- action: STATE_SET "default" 0.0; \
- target: "elm.swallow.content"; \
- } \
- program { name: "disable"; \
- signal: "elm,state,disabled"; \
- source: "elm"; \
- action: STATE_SET "disabled" 0.0; \
- target: "disabler"; \
- target: "bg"; \
- after: "disable_text"; \
- } \
- program { name: "disable_text"; \
- script { \
- new st[31]; \
- new Float:vl; \
- get_state(PART:"elm.text", st, 30, vl); \
- if (!strcmp(st, "visible")) \
- set_state(PART:"elm.text", "disabled_visible", 0.0); \
- else \
- set_state(PART:"elm.text", "disabled", 0.0); \
- get_state(PART:"elm.swallow.content", st, 30, vl); \
- if (!strcmp(st, "visible")) \
- set_state(PART:"elm.swallow.content", "disabled_visible", 0.0); \
- else \
- set_state(PART:"elm.swallow.content", "disabled", 0.0); \
- get_state(PART:"check", st, 30, vl); \
- if (!strcmp(st, "visible")) \
- { \
- set_state(PART:"check", "disabled_visible", 0.0); \
- set_int(check_state, CHECK_STATE_DISABLED_VISIBLE); \
- } \
- } \
- } \
- program { name: "enable"; \
- signal: "elm,state,enabled"; \
- source: "elm"; \
- action: STATE_SET "default" 0.0; \
- target: "disabler"; \
- target: "bg"; \
- after: "enable_text"; \
- } \
- program { name: "enable_text"; \
- script { \
- new st[31]; \
- new Float:vl; \
- get_state(PART:"elm.text", st, 30, vl); \
- if (!strcmp(st, "disabled_visible")) \
- set_state(PART:"elm.text", "visible", 0.0); \
- else \
- set_state(PART:"elm.text", "default", 0.0); \
- get_state(PART:"elm.swallow.content", st, 30, vl); \
- if (!strcmp(st, "visible")) \
- set_state(PART:"elm.swallow.content", "visible", 0.0); \
- else \
- set_state(PART:"elm.swallow.content", "default", 0.0); \
- get_state(PART:"check", st, 30, vl); \
- if (!strcmp(st, "disabled_visible")) \
- { \
- set_state(PART:"check", "visible", 0.0); \
- set_int(check_state, CHECK_STATE_VISIBLE); \
- } \
- else \
- set_int(check_state, CHECK_STATE_DEFAULT); \
- } \
- } \
- } \
- }
-
-////////////////////////////////////////////////////////////////////////////////
- CHECK_STYLE_DEFAULT("gallery_efl/grid", GE_EDC_IMAGE_CHECK_ALBUM_BG, GE_EDC_IMAGE_CHECK_ALBUM_EDIT_CHECKON,GE_EDC_IMAGE_CHECK_ALBUM_BG, 64, 64, 1)
-
-
-#undef CHECK_STATE_DEFAULT
-#undef CHECK_STATE_VISIBLE
-#undef CHECK_STATE_DISABLED_VISIBLE
-#undef CHECK_STATE_DISABLED
-
/*
-* Copyright (c) 2000-2015 Samsung Electronics Co., Ltd All Rights Reserved
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*
-*/
+ * Copyright (c) 2015 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://floralicense.org/license/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
/* Definition of image path used in edc file */
#define GE_EDC_IMAGE_BUTTON_ICON_ARROW "00_button_icon_arrow.png"
#define GE_EDC_SOUND_TOUCH_30MS "S_Touch_30ms.wav"
-
+++ /dev/null
-/*
-* Copyright (c) 2000-2015 Samsung Electronics Co., Ltd All Rights Reserved
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*
-*/
-
-#define BUTTON_STATE_ENABLED 0
-#define BUTTON_STATE_DISABLED 1
-
-#define BUTTON_EDIT_STYLE_BORDER_INC 8 0 5 5
-
- sounds {
- sample {
- name: "touch_sound" AS_IS;
- source: GE_EDC_SOUND_TOUCH_30MS;
- }
- }
-
-#define NAVIFRAME_TITLE_TEXT_BG_H_INC 88
-#define NAVIFRAME_LANDSCAPE_TITLE_TEXT_BG_H_INC 76
-#define NAVIFRAME_TITLE_BG_IMAGE_BORDER_INC 8 8 2 2
-#define NAVIFRAME_TITLE_H_INC 96
-#define NAVIFRAME_LANDSCAPE_TITLE_H_INC 91
-#define NAVIFRAME_TAB_TITLE_H_INC 165
-#define NAVIFRAME_LANDSCAPE_TAB_TITLE_H_INC 145
-#define NAVIFRAME_TAB_TITLE_H2_INC 126
-#define NAVIFRAME_TOOLBAR_HEIGHT_INC 98
-#define NAVIFRAME_LANDSCAPE_TOOLBAR_HEIGHT_INC 85
-#define NAVIFRAME_TITLE_FUNC_BTN_SIZE_INC 115 96
-#define NAVIFRAME_LANDSCAPE_TITLE_FUNC_BTN_SIZE_INC 115 91
-#define NAVIFRAME_PREV_FUNC_BTN_SIZE_INC 85 98
-#define NAVIFRAME_LANDSCAPE_PREV_FUNC_BTN_SIZE_INC 85 85
-#define NAVIFRAME_TITLE_TAB_H_INC 75
-#define NAVIFRAME_TITLE_TAB_FONT_SIZE_INC 44
-#define NAVIFRAME_LANDSCAPE_TITLE_TAB_FONT_SIZE_INC 38
-#define NAVIFRAME_TITLE_TAB_TEXT_H_INC 90
-#define NAVIFRAME_LANDSCAPE_TITLE_TAB_TEXT_H_INC 70
-#define NAVIFRAME_TITLE_FONT_SIZE_INC 50
-#define NAVIFRAME_TITLE_FONT_MIN_SIZE_INC 46
-#define NAVIFRAME_LANDSCAPE_TITLE_FONT_SIZE_INC 50
-#define NAVIFRAME_TITLE_SMALL_FONT_SIZE_INC 44
-#define NAVIFRAME_LANDSCAPE_TITLE_SMALL_FONT_SIZE_INC 38
-#define NAVIFRAME_ICON_SIZE_INC 45 45
-#define NAVIFRAME_PADDING_INC 26 0
-#define NAVIFRAME_PADDING2_INC 16 0
-#define NAVIFRAME_BADGE_LEFT_PADDING_INC 8 0
-#define NAVIFRAME_BADGE_TOP_PADDING_INC 0 10
-#define NAVIFRAME_BADGE_TEXT_LEFT_PADDING_INC 12 54
-#define NAVIFRAME_BADGE_TEXT_RIGHT_PADDING_INC 10 54
-#define NAVIFRAME_BADGE_TEXT_H_INC 34
-#define NAVIFRAME_BADGE_TEXT_MIN_W_INC 30
-#define NAVIFRAME_BADGE_TEXT_MAX_W_INC 60
-#define NAVIFRAME_BADGE_BG_IMAGE_SIZE_INC 54 54
-#define NAVIFRAME_BADGE_BG_IMAGE_BORDER_INC 26 26 0 0
-#define NAVIFRAME_TOOLBAR_BUTTON_BG_PADDING_INC 112 0
-#define NAVIFRAME_ICON_PADDING_INC 77 0
-#define NAVIFRAME_TITLE_TEXT_COLOR_INC 250 250 250 255
-#define NAVIFRAME_TITLE_STYLE_COLOR_INC "#FAFAFA"
-#define NAVIFRAME_SUBTITLE_TEXT_COLOR_INC 250 250 250 255
-#define NAVIFRAME_SUBTITLE_FONT_SIZE_INC 32
-#define NAVIFRAME_LANDSCAPE_SUBTITLE_FONT_SIZE_INC 28
-#define NAVIFRAME_SUBTITLE_H_INC 37
-#define NAVIFRAME_LANDSCAPE_SUBTITLE_H_INC 30
-#define NAVIFRAME_SUBTITLE_TOP_PADDING_H_INC 6
-#define NAVIFRAME_LANDSCAPE_SUBTITLE_TOP_PADDING_H_INC 4
-#define NAVIFRAME_TITLE_TEXT_UNSELECTED_COLOR_INC 153 153 153 255
-#define NAVIFRAME_BADGE_TEXT_COLOR_INC 250 250 250 255;
-#define NAVIFRAME_TITLE_BUTTON_DIVIDER_COLOR_INC 255 255 255 82
-
-
-#define GE_TITLE_DROPDOWN \
- part { name: "dropdown_padding"; \
- type: RECT; \
- scale: 1; \
- mouse_events: 0; \
- description { state: "default" 0.0; \
- align: 0.0 0.0; \
- rel1 { \
- to: "maintitle_text_bg"; \
- relative: 0.0 0.0; \
- } \
- rel2 { \
- to: "maintitle_text_bg"; \
- relative: 0.0 1.0; \
- } \
- min: 6 0; \
- fixed: 1 0; \
- visible: 0; \
- } \
- } \
- part { name: "elm.image.dropdown"; \
- mouse_events: 0; \
- scale: 1; \
- description { state: "default" 0.0; \
- visible: 1; \
- min: 54 54; \
- fixed: 1 1; \
- rel1 { \
- to: "left.padding.text"; \
- relative: 0.0 0.0; \
- } \
- rel2 { \
- to: "right.padding.text"; \
- relative: 1.0 1.0; \
- } \
- image { \
- normal: GE_EDC_IMAGE_POPUP_DROPDOWN_TITLE_BG; \
- border: 8 8 8 8; \
- border_scale: 1; \
- } \
- } \
- description { state: "clicked" 0.0; \
- inherit: "default" 0.0; \
- image.normal: GE_EDC_IMAGE_POPUP_DROPDOWN_TITLE_BG_PRESS; \
- } \
- description { state: "disabled" 0.0; \
- inherit: "default" 0.0; \
- image.normal: GE_EDC_IMAGE_POPUP_DROPDOWN_TITLE_BG; \
- visible: 0; \
- } \
- description { state: "focused" 0.0; \
- inherit: "default" 0.0; \
- image.normal: GE_EDC_IMAGE_POPUP_DROPDOWN_TITLE_BG_PRESS; \
- } \
- description { state: "hide" 0.0; \
- inherit: "default" 0.0; \
- visible: 0; \
- } \
- } \
- part { name: "focus_image"; \
- scale: 1; \
- mouse_events: 0; \
- repeat_events: 1; \
- description { state: "default" 0.0; \
- min: 54 54; \
- max: 54 54; \
- visible: 0; \
- rel1.to : "elm.image.dropdown"; \
- rel2.to : "elm.image.dropdown"; \
- image { \
- normal: GE_EDC_IMAGE_POPUP_DROPDOWN_TITLE_BG_FOCUS; \
- border: 8 8 8 8; \
- border_scale: 1; \
- } \
- } \
- description { state: "focused" 0.0; \
- inherit: "default" 0.0; \
- visible: 1; \
- } \
- description { state: "hide" 0.0; \
- inherit: "default" 0.0; \
- visible: 0; \
- } \
- } \
- part { name: "left.padding.text"; \
- type: RECT; \
- mouse_events: 0; \
- scale: 1; \
- description { \
- state: "default" 0.0; \
- visible: 0; \
- fixed: 1 0; \
- min: 16 54; \
- rel1 { \
- to: "dropdown_padding"; \
- relative: 0.0 0.0; \
- } \
- rel2 { \
- to: "dropdown_padding"; \
- relative: 0.0 1.0; \
- } \
- align: 0.0 0.0; \
- } \
- } \
- part { name: "right.padding.text"; \
- type: RECT; \
- mouse_events: 0; \
- scale: 1; \
- description { \
- state: "default" 0.0; \
- visible: 0; \
- fixed: 1 1; \
- min: 12 0; \
- rel1 { \
- to_x: "arrow_icon"; \
- to_y: "elm.text.dropdown"; \
- relative: 1.0 0.0; \
- } \
- rel2 { \
- to_x: "arrow_icon"; \
- to_y: "elm.text.dropdown"; \
- relative: 1.0 1.0; \
- } \
- align: 0.0 0.0; \
- } \
- } \
- part { name: "elm.text.dropdown"; \
- type: TEXT; \
- mouse_events: 0; \
- effect: FAR_SHADOW BOTTOM; \
- scale: 1; \
- description { \
- state: "default" 0.0; \
- visible: 1; \
- rel1 { \
- to: "left.padding.text"; \
- relative: 1.0 0.0; \
- } \
- rel2 { \
- to: "left.padding.text"; \
- relative: 1.0 1.0; \
- } \
- min: 30 0; \
- fixed: 1 0; \
- align: 0.0 0.5; \
- color: 250 250 250 255; \
- color2: 0 0 0 192; \
- text { \
- font: "Tizen:style=Regular"; \
- size: 44; \
- min: 1 0; \
- text_class: "tizen"; \
- } \
- } \
- description { state: "visible" 0.0; \
- inherit: "default" 0.0; \
- visible: 1; \
- } \
- description { state: "clicked" 0.0; \
- inherit: "default" 0.0; \
- visible: 1; \
- color: 250 250 250 255; \
- } \
- description { state: "disabled" 0.0; \
- inherit: "default" 0.0; \
- visible: 0; \
- } \
- description { state: "focused" 0.0; \
- inherit: "default" 0.0; \
- visible: 1; \
- color: 250 250 250 255; \
- } \
- description { state: "hide" 0.0; \
- inherit: "default" 0.0; \
- visible: 0; \
- } \
- } \
- part { name: "arrow_icon_padding"; \
- scale: 1; \
- mouse_events: 0; \
- type: RECT; \
- description { state: "default" 0.0; \
- min: 6 5; \
- fixed: 1 1; \
- align: 0.0 0.5; \
- rel1 { \
- relative: 1.0 0.0; \
- to: "elm.text.dropdown"; \
- } \
- visible: 0; \
- rel2.to: "elm.text.dropdown"; \
- } \
- } \
- part { name: "arrow_icon_bottom_padding"; \
- scale: 1; \
- mouse_events: 0; \
- type: RECT; \
- description { state: "default" 0.0; \
- min: 18 26; \
- max: 18 26; \
- fixed: 1 1; \
- align: 0.0 1.0; \
- rel1 { \
- relative: 1.0 1.0; \
- to_x: "arrow_icon_padding"; \
- to_y: "elm.text.dropdown"; \
- } \
- rel2 { \
- relative: 1.0 1.0; \
- to_x: "arrow_icon_padding"; \
- to_y: "elm.text.dropdown"; \
- } \
- visible: 0; \
- } \
- } \
- part { name: "arrow_icon"; \
- scale: 1; \
- mouse_events: 0; \
- description { state: "default" 0.0; \
- min: 18 18; \
- max: 18 18; \
- fixed: 1 1; \
- align: 0.0 1.0; \
- rel1 { \
- relative: 1.0 0.0; \
- to_x: "arrow_icon_padding"; \
- to_y: "arrow_icon_bottom_padding"; \
- offset: 0 6; \
- } \
- rel2 { \
- relative: 1.0 0.0; \
- to_x: "arrow_icon_padding"; \
- to_y: "arrow_icon_bottom_padding"; \
- } \
- image.normal: GE_EDC_IMAGE_BUTTON_ICON_ARROW; \
- } \
- description { state: "clicked" 0.0; \
- inherit: "default" 0.0; \
- image.normal: GE_EDC_IMAGE_BUTTON_ICON_ARROW_PRESS; \
- } \
- description { state: "hide" 0.0; \
- inherit: "default" 0.0; \
- visible: 0; \
- } \
- } \
- part { name: "access.title"; \
- type: RECT; \
- repeat_events: 1; \
- description { state: "default" 0.0; \
- fixed: 1 1; \
- rel1.to: "elm.image.dropdown"; \
- rel2.to: "elm.image.dropdown"; \
- color: 0 0 0 0; \
- } \
- } \
- part { name: "over2"; \
- type: RECT; \
- repeat_events: 1; \
- ignore_flags: ON_HOLD; \
- description { state: "default" 0.0; \
- rel1.to: "elm.image.dropdown"; \
- rel2.to: "elm.image.dropdown"; \
- color: 0 0 0 0; \
- } \
- } \
- part { name: "over3"; \
- type: RECT; \
- repeat_events: 1; \
- description { state: "default" 0.0; \
- rel1.to: "elm.image.dropdown"; \
- rel2.to: "elm.image.dropdown"; \
- color: 0 0 0 0; \
- } \
- } \
- part { name: "disabler"; \
- type: RECT; \
- description { state: "default" 0.0; \
- rel1.to: "elm.image.dropdown"; \
- rel2.to: "elm.image.dropdown"; \
- color: 0 0 0 0; \
- visible: 0; \
- } \
- description { state: "disabled" 0.0; \
- inherit: "default" 0.0; \
- visible: 1; \
- } \
- }
-
-#define GL_TITLE_DROPDOWN_PGS \
- program { name: "button_click"; \
- signal: "mouse,down,1"; \
- source: "over2"; \
- action: SIGNAL_EMIT "elm,action,press" ""; \
- after: "button_click_anim"; \
- } \
- program { name: "button_click_anim"; \
- action: STATE_SET "clicked" 0.0; \
- target: "elm.image.dropdown"; \
- target: "elm.text.dropdown"; \
- target: "arrow_icon"; \
- } \
- program { name: "button_double_click"; \
- signal: "mouse,down,1,double"; \
- source: "over2"; \
- after: "button_click_anim"; \
- } \
- program { name: "button_unpress"; \
- action: SIGNAL_EMIT "elm,action,unpress" ""; \
- } \
- program { name: "button_mouseout_clicked"; \
- signal: "mouse,up,1"; \
- source: "over3"; \
- script { \
- new st[31]; \
- new Float:vl; \
- get_state(PART:"elm.text.dropdown", st, 30, vl); \
- if (!strcmp(st, "clicked") || !strcmp(st, "focused")) \
- { \
- emit("elm,action,default,text,set", ""); \
- set_state(PART:"elm.text.dropdown", "visible", 0.0); \
- } \
- if (get_int(button_state) != BUTTON_STATE_DISABLED) \
- set_state(PART:"elm.image.dropdown", "default", 0.0); \
- set_state(PART:"arrow_icon", "default", 0.0); \
- } \
- after: button_unpress; \
- } \
- program { name: "touch_snd"; \
- signal: "mouse,clicked,1"; \
- source: "over2"; \
- action: PLAY_SAMPLE "touch_sound" 1.0; \
- after: button_unclick3; \
- } \
- program { name: "button_unclick3"; \
- action: SIGNAL_EMIT "elm,action,click" ""; \
- } \
- program { name: "disable"; \
- signal: "elm,state,disabled"; \
- source: "elm"; \
- action: STATE_SET "disabled" 0.0; \
- target: "elm.image.dropdown"; \
- target: "disabler"; \
- after: "disable_text"; \
- } \
- program { name: "disable_text"; \
- script { \
- new st[31]; \
- new Float:vl; \
- get_state(PART:"elm.text.dropdown", st, 30, vl); \
- if (!strcmp(st, "visible")) \
- set_state(PART:"elm.text.dropdown", "disabled_visible", 0.0); \
- else \
- set_state(PART:"elm.text.dropdown", "disabled", 0.0); \
- set_int(button_state, BUTTON_STATE_DISABLED); \
- } \
- } \
- program { name: "enable"; \
- signal: "elm,state,enabled"; \
- source: "elm"; \
- action: STATE_SET "default" 0.0; \
- target: "elm.image.dropdown"; \
- target: "disabler"; \
- after: "enable_text"; \
- } \
- program { name: "enable_text"; \
- script { \
- new st[31]; \
- new Float:vl; \
- get_state(PART:"elm.text.dropdown", st, 30, vl); \
- if (!strcmp(st, "disabled_visible")) \
- set_state(PART:"elm.text.dropdown", "visible", 0.0); \
- else \
- set_state(PART:"elm.text.dropdown", "default", 0.0); \
- set_int(button_state, BUTTON_STATE_ENABLED); \
- } \
- } \
- program { name: "expn_title_show"; \
- signal: "elm,action,dropdown,show"; \
- source: "elm"; \
- action: STATE_SET "default" 0.0; \
- target: "elm.image.dropdown"; \
- target: "focus_image"; \
- target: "elm.text.dropdown"; \
- target: "arrow_icon"; \
- target: "elm.text.title"; \
- after: enable; \
- } \
- program { name: "expn_title_hide"; \
- signal: "elm,action,dropdown,hide"; \
- source: "elm"; \
- action: STATE_SET "hide" 0.0; \
- target: "elm.image.dropdown"; \
- target: "focus_image"; \
- target: "elm.text.dropdown"; \
- target: "arrow_icon"; \
- target: "elm.text.title"; \
- after: disable; \
- } \
- program { name: "action_focus"; \
- signal: "elm,action,focus_highlight,show"; \
- source: "elm"; \
- action: STATE_SET "focused" 0.0; \
- target: "focus_image"; \
- } \
- program { name: "action_unfocus"; \
- signal: "elm,action,focus_highlight,hide"; \
- source: "elm"; \
- action: STATE_SET "default" 0.0; \
- target: "focus_image"; \
- }
-
-
-
-group {
- name: "ge_naviframe_expanded_title";
-
- image: GE_EDC_IMAGE_TITLE_BG COMP;
- image: GE_EDC_IMAGE_POPUP_DROPDOWN_TITLE_BG COMP;
- image: GE_EDC_IMAGE_POPUP_DROPDOWN_TITLE_BG_PRESS COMP;
- image: GE_EDC_IMAGE_POPUP_DROPDOWN_TITLE_BG_FOCUS COMP;
- image: GE_EDC_IMAGE_BUTTON_ICON_ARROW_PRESS COMP;
- image: GE_EDC_IMAGE_BUTTON_ICON_ARROW COMP;
-
- script {
- public button_state = BUTTON_STATE_ENABLED;
- public landscape = 0; //Landscape mode status
- }
-
- parts {
- part { name: "base";
- type: RECT;
- mouse_events: 0;
- description { state: "default" 0.0;
- visible: 0;
- min: 1 NAVIFRAME_TITLE_H_INC;
- rel1 { relative: 0.0 0.0; }
- rel2 { relative: 1.0 1.0; }
- align: 0.0 0.5;
- }
- description { state: "landscape" 0.0;
- inherit: "default" 0.0;
- min: 1 NAVIFRAME_LANDSCAPE_TITLE_H_INC;
- }
- }
- part { name: "title_bg";
- type: IMAGE;
- scale: 1;
- description { state: "default" 0.0;
- min: 1 NAVIFRAME_TITLE_H_INC;
- max: -1 NAVIFRAME_TITLE_H_INC;
- align: 0.0 0.0;
- fixed: 0 1;
- rel1 { relative: 0.0 0.0; to: "base"; }
- rel2 { relative: 1.0 0.0; to: "base"; }
- image {
- normal: GE_EDC_IMAGE_TITLE_BG;
- border: NAVIFRAME_TITLE_BG_IMAGE_BORDER_INC;
- border_scale: 1;
- }
- }
- description { state: "landscape" 0.0;
- inherit: "default" 0.0;
- min: 1 NAVIFRAME_LANDSCAPE_TITLE_H_INC;
- max: -1 NAVIFRAME_LANDSCAPE_TITLE_H_INC;
- }
- description { state: "hide" 0.0;
- inherit: "default" 0.0;
- min: 0 0;
- max: 0 0;
- fixed: 1 1;
- }
- }
- part { name: "title_right_padding";
- type: RECT;
- mouse_events: 0;
- scale: 1;
- description { state: "default" 0.0;
- min: NAVIFRAME_PADDING_INC;
- fixed: 1 0;
- align: 1.0 0.0;
- rel1 { relative: 1.0 0.0; to: "divider2"; }
- rel2 { relative: 1.0 1.0; to: "divider2"; }
- visible: 0;
- }
- description { state: "title_left_btn_set" 0.0;
- inherit: "default" 0.0;
- rel1 { relative: 1.0 0.0; to: "divider1"; }
- rel2 { relative: 1.0 1.0; to: "divider1"; }
- }
- }
- part { name: "title_left_padding";
- type: RECT;
- scale: 1;
- mouse_events: 0;
- description { state: "default" 0.0;
- min: 10 0;
- fixed: 1 0;
- align: 0.0 0.0;
- rel1 { relative: 0.0 0.0; to: "title_bg"; }
- rel2 { relative: 0.0 1.0; to: "title_bg"; }
- visible: 0;
- }
- description { state: "icon" 0.0;
- inherit: "default" 0.0;
- min: NAVIFRAME_ICON_PADDING_INC;
- }
- }
- part { name: "title_left_padding2";
- type: RECT;
- scale: 1;
- mouse_events: 0;
- description { state: "default" 0.0;
- min: 26 0;
- fixed: 1 0;
- align: 0.0 0.0;
- rel1 { relative: 0.0 0.0; to: "title_bg"; }
- rel2 { relative: 0.0 1.0; to: "title_bg"; }
- visible: 0;
- }
- description { state: "icon" 0.0;
- inherit: "default" 0.0;
- min: NAVIFRAME_ICON_PADDING_INC;
- }
- }
- part { name: "title_text_bg";
- type: RECT;
- scale: 1;
- mouse_events: 0;
- description { state: "default" 0.0;
- visible: 0;
- min: 0 NAVIFRAME_TITLE_TEXT_BG_H_INC;
- max: -1 NAVIFRAME_TITLE_TEXT_BG_H_INC;
- fixed: 0 1;
- rel1 { relative: 1.0 0.0; to_x: "title_left_padding"; to_y: "title_bg"; }
- rel2 { relative: 0.0 1.0; to_x: "title_right_padding"; to_y: "title_bg"; }
- }
- }
- part { name: "maintitle_text_bg";
- type: RECT;
- mouse_events: 0;
- description { state: "default" 0.0;
- visible: 0;
- rel1 { relative: 0.0 0.0; to: "title_text_bg"; }
- rel2 { relative: 0.0 1.0; to_x: "title_right_padding"; to_y: "title_text_bg"; }
- }
- }
- part { name: "maintitle_text_bg2";
- type: RECT;
- mouse_events: 0;
- description { state: "default" 0.0;
- visible: 0;
- rel1 { relative: 1.0 0.0; to_x: "title_left_padding2"; to_y: "title_text_bg"; }
- rel2 { relative: 0.0 1.0; to_x: "title_right_padding"; to_y: "title_text_bg"; }
- }
- }
- GE_TITLE_DROPDOWN
- part { name: "elm.text.title";
- type: TEXT;
- effect: FAR_SHADOW BOTTOM;
- scale: 1;
- description { state: "default" 0.0;
- text { font: "Tizen:style=Bold";
- size: NAVIFRAME_TITLE_FONT_SIZE_INC;
- size_range: NAVIFRAME_TITLE_FONT_MIN_SIZE_INC NAVIFRAME_TITLE_FONT_SIZE_INC;
- fit: 1 0;
- min: 0 0;
- max: 1 0;
- align: 0.0 0.5;
- text_class: "tizen";
- }
- color: NAVIFRAME_TITLE_TEXT_COLOR_INC;
- color3: 0 0 0 255;
- align: 0.0 0.5;
- rel1.to: "maintitle_text_bg2";
- rel2.to: "maintitle_text_bg2";
- visible: 0;
- }
- description { state: "hide" 0.0;
- inherit: "default" 0.0;
- visible: 1;
- }
- }
- part { name: "padding_before_text";
- type: RECT;
- scale: 1;
- mouse_events: 0;
- description { state: "default" 0.0;
- align: 1.0 0.5;
- rel1 { relative: 0.0 0.0; to: "title_text_bg"; }
- rel2 { relative: 0.0 1.0; to: "title_text_bg"; }
- fixed: 1 0;
- min: NAVIFRAME_PADDING2_INC;
- visible: 0;
- }
- }
- part { name: "divider1";
- type: RECT;
- description { state: "default" 0.0;
- min: 0 0;
- max: 0 -1;
- fixed: 1 1;
- color: NAVIFRAME_TITLE_BUTTON_DIVIDER_COLOR_INC;
- rel1 { relative: 0.0 0.0; to: "title_left_btn"; }
- rel2 { relative: 0.0 1.0; to: "title_left_btn"; }
- align: 1.0 0.5;
- }
- description { state: "visible" 0.0;
- inherit: "default" 0.0;
- min: 2 48;
- max: 2 48;
- }
- }
- part { name: "title_left_btn";
- type: SWALLOW;
- scale: 1;
- description { state: "default" 0.0;
- max: NAVIFRAME_TITLE_FUNC_BTN_SIZE_INC;
- fixed: 1 1;
- align: 1.0 0.5;
- rel1 { relative: 0.0 0.0; to: "divider2"; }
- rel2 { relative: 0.0 1.0; to: "divider2"; }
- }
- description { state: "landscape" 0.0;
- inherit: "default" 0.0;
- max: NAVIFRAME_LANDSCAPE_TITLE_FUNC_BTN_SIZE_INC;
- }
- }
- part { name: "divider2";
- type: RECT;
- description { state: "default" 0.0;
- min: 0 0;
- max: 0 -1;
- fixed: 1 1;
- color: NAVIFRAME_TITLE_BUTTON_DIVIDER_COLOR_INC;
- rel1 { relative: 0.0 0.0; to: "title_right_btn"; }
- rel2 { relative: 0.0 1.0; to: "title_right_btn"; }
- align: 1.0 0.5;
- }
- description { state: "visible" 0.0;
- inherit: "default" 0.0;
- min: 2 48;
- max: 2 48;
- }
- }
- part { name: "elm.swallow.icon";
- type: SWALLOW;
- scale: 1;
- description { state: "default" 0.0;
- max: NAVIFRAME_ICON_SIZE_INC;
- fixed: 1 1;
- rel1 { relative: 0.0 0.0; to: "padding_before_text"; }
- rel2 { relative: 0.0 1.0; to: "padding_before_text"; }
- aspect: 1.0 1.0;
- aspect_preference: VERTICAL;
- align: 1.0 0.5;
- }
- }
- part { name: "title_right_btn";
- type: SWALLOW;
- scale: 1;
- description { state: "default" 0.0;
- max: NAVIFRAME_TITLE_FUNC_BTN_SIZE_INC;
- align: 1.0 0.5;
- fixed: 1 1;
- rel1 { relative: 1.0 0.0; to: "title_bg"; }
- rel2 { relative: 1.0 1.0; to: "title_bg"; }
- }
- description { state: "landscape" 0.0;
- inherit: "default" 0.0;
- max: NAVIFRAME_LANDSCAPE_TITLE_FUNC_BTN_SIZE_INC;
- }
- }
- }
- programs {
- program { name: "title_show";
- signal: "elm,state,title,show";
- source: "elm";
- script {
- if (!get_int(landscape)) {
- set_state(PART:"base", "default", 0.0);
- set_state(PART:"title_bg", "default", 0.0);
- } else {
- set_state(PART:"base", "landscape", 0.0);
- set_state(PART:"title_bg", "landscape", 0.0);
- }
- }
- }
- program {
- name: "change_to_landscape";
- signal: "elm,state,landscape";
- source: "elm";
- script {
- if (!get_int(landscape)) {
- set_state(PART:"base", "landscape", 0.0);
- set_state(PART:"title_text_bg", "landscape", 0.0);
- set_state(PART:"title_left_btn", "landscape", 0.0);
- set_state(PART:"title_right_btn", "landscape", 0.0);
-
- new st[31];
- new Float:vl;
- get_state(PART:"title_bg", st, 30, vl);
- if (!strcmp(st, "default"))
- set_state(PART:"title_bg", "landscape", 0.0);
-
- set_int(landscape, 1);
- }
- }
- }
- program {
- name: "change_to_portrait";
- signal: "elm,state,portrait";
- source: "elm";
- script {
- if (get_int(landscape)) {
- set_state(PART:"base", "default", 0.0);
- set_state(PART:"title_text_bg", "default", 0.0);
- set_state(PART:"title_left_btn", "default", 0.0);
- set_state(PART:"title_right_btn", "default", 0.0);
-
- new st[31];
- new Float:vl;
- get_state(PART:"title_bg", st, 30, vl);
- if (!strcmp(st, "landscape"))
- set_state(PART:"title_bg", "default", 0.0);
-
- set_int(landscape, 0);
- }
- }
- }
- program { name: "title_left_btn_show";
- signal: "elm,state,title_left_btn,show";
- source: "elm";
- script {
- set_state(PART:"divider1", "visible", 0.0);
- set_state(PART:"title_right_padding", "title_left_btn_set", 0.0);
- }
- }
- program { name: "title_left_btn_hide";
- signal: "elm,state,title_left_btn,hide";
- source: "elm";
- script {
- set_state(PART:"divider1", "default", 0.0);
- set_state(PART:"title_right_padding", "default", 0.0);
- }
- }
- program { name: "title_right_btn_show";
- signal: "elm,state,title_right_btn,show";
- source: "elm";
- action: STATE_SET "visible" 0.0;
- target: "divider2";
- }
- program { name: "title_right_btn_hide";
- signal: "elm,state,title_right_btn,hide";
- source: "elm";
- action: STATE_SET "default" 0.0;
- target: "divider2";
- }
- GL_TITLE_DROPDOWN_PGS
-
- }
- }
-
-#undef BUTTON_STATE_ENABLED
-#undef BUTTON_STATE_DISABLED
-
+++ /dev/null
-/*
-* Copyright (c) 2000-2015 Samsung Electronics Co., Ltd All Rights Reserved
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*
-*/
-
-/* 720/2 */
-#define ALBUM_ITEM_W 360
-/* 1071/3 - 3 */
-#define ALBUM_ITEM_H 294
-
-#define ALBUM_ICON_GAP_L (4)
-#define ALBUM_ICON_GAP_R (4)
-#define ALBUM_ICON_GAP_T (4)
-#define ALBUM_ICON_GAP_B (4)
-
-#define ALBUM_ICON_W (ALBUM_ITEM_W-ALBUM_ICON_GAP_L-ALBUM_ICON_GAP_R)
-#define ALBUM_ICON_H (ALBUM_ITEM_H-ALBUM_ICON_GAP_T-ALBUM_ICON_GAP_B)
-
-/* 7 + 31 + 31*/
-#define ALBUM_TEXT_BG_H 70
-#define ALBUM_TEXT_GAP_L 10
-#define ALBUM_TEXT_GAP_R 8
-#define ALBUM_TEXT_GAP_T 6
-#define ALBUM_TEXT_SNS_X 60
-#define ALBUM_TEXT_DATE_H 31
-
-#define ALBUM_TYPE_GAP_T 8
-
-#define ALBUM_NAME_COLOR_INC 255 255 255 255
-#define ALBUM_NAME_TEXT_SIZE 15
-
-#define ALBUM_COUNT_COLOR_INC 255 255 255 255
-#define ALBUM_COUNT_SHADOW_COLOR_INC 0 0 0 127
-
-#define ALBUM_COUNT_TEXT_SIZE 15
-
-#define ALBUM_TYPE_ICON_W 48
-#define ALBUM_TYPE_ICON_H 48
-
-#define ALBUM_PBAR_W 183
-#define ALBUM_PBAR_H 6
-#define ALBUM_PBAR_GAP_L 6
-#define ALBUM_PBAR_GAP_T 8
-
-#define ALBUM_RENAME_BTN_W 64
-#define ALBUM_RENAME_BTN_H 64
-
-#define ALBUM_CHECKBOX_W 64
-#define ALBUM_CHECKBOX_H 64
-#define ALBUM_CHECKBOX_GAP_L 6
-#define ALBUM_CHECKBOX_GAP_T 6
-#define SPLIT_ALBUM_NAME_TEXT_SIZE 10
-
-#define PARTS_PADDING_LEFT(param_padding_name, param_padding_size ) \
- part { name: param_padding_name; \
- type: RECT; \
- scale: 1; \
- description { \
- state: "default" 0.0; \
- min: param_padding_size 0; \
- fixed: 1 0; \
- visible: 0; \
- rel2.relative: 0.0 1.0; \
- align: 0.0 0.0; \
- } \
- }
-
-#define PARTS_PADDING_RIGHT(param_padding_name, param_padding_size ) \
- part { name: param_padding_name; \
- type: RECT; \
- scale: 1; \
- description { state: "default" 0.0; \
- min: param_padding_size 0; \
- fixed: 1 0; \
- visible: 0; \
- rel1.relative: 1.0 0.0; \
- align: 1.0 0.0; \
- } \
- }
-#define PARTS_PADDING_TOP(param_padding_name, param_padding_size ) \
- part { name: param_padding_name; \
- type: RECT; \
- scale: 1; \
- description { \
- state: "default" 0.0; \
- min: 0 param_padding_size; \
- fixed: 0 1; \
- visible: 0; \
- rel2.relative: 1.0 0.0; \
- align: 0.0 0.0; \
- } \
- }
-
-#define GE_ALBUM_BG \
- part { \
- name: "bg"; \
- type: RECT; \
- description { \
- state: "default" 0.0; \
- color: 255 0 0 0; \
- rel1 { relative: 0.0 0.0; } \
- rel2 { relative: 1.0 1.0; } \
- } \
- }
-
-#define GE_ALBUM_BG_IMAGE \
- part { \
- name: "bg_image"; \
- type: IMAGE; \
- scale : 1; \
- description { \
- state: "default" 0.0; \
- visible: 0; \
- rel1 { relative: 0.0 0.0; to:"bg"; } \
- rel2 { relative: 1.0 1.0; to:"bg"; } \
- image.normal: GE_EDC_IMAGE_ALBUM_BG; \
- image.border: 10 10 10 10; \
- image.middle: 0; \
- } \
- }
-
-#define GE_ALBUM_ICON_BG \
- part { name: "icon_bg"; \
- type: RECT; \
- mouse_events: 1; \
- repeat_events: 1; \
- scale : 1; \
- description { \
- state: "default" 0.0; \
- color: 230 230 230 255; \
- rel1 { relative: 0.0 0.0; to:"elm.icon.clipper"; } \
- rel2 { relative: 1.0 1.0; to:"elm.icon.clipper"; } \
- } \
- }
-
-#define GE_ALBUM_ICON \
- part { \
- name: "elm.swallow.icon"; \
- type: SWALLOW; \
- clip_to: "elm.icon.clipper"; \
- mouse_events: 1; \
- description { \
- state: "default" 0.0; \
- rel1.to: "elm.icon.clipper"; \
- rel2.to: "elm.icon.clipper"; \
- } \
- } \
- part { \
- name: "elm.icon.clipper"; \
- type: RECT; \
- description { \
- state: "default" 0.0; \
- rel1 { relative: ALBUM_ICON_GAP_L/ALBUM_ITEM_W ALBUM_ICON_GAP_T/ALBUM_ITEM_H; to:"bg_image"; } \
- rel2 { relative: (ALBUM_ITEM_W-ALBUM_ICON_GAP_R)/ALBUM_ITEM_W (ALBUM_ITEM_H-ALBUM_ICON_GAP_B)/ALBUM_ITEM_H; to:"bg_image"; } \
- } \
- }
-
-#define GE_ALBUM_LABEL_BG \
- part { \
- name: "label_bg"; \
- type: RECT; \
- mouse_events: 1; \
- repeat_events: 1; \
- description { \
- state: "default" 0.0; \
- color: 0 0 0 153; \
- rel1 { relative: 0.0 (ALBUM_ITEM_H-ALBUM_TEXT_BG_H)/ALBUM_ITEM_H; to:"bg_image"; } \
- rel2 { relative: 1.0 1.0; to:"bg_image"; } \
- } \
- }
-
-#define GE_ALBUM_TYPE_ICON \
- part { \
- name: "elm.swallow.type_icon"; \
- type: SWALLOW; \
- mouse_events: 1; \
- repeat_events: 1; \
- description { \
- state: "default" 0.0; \
- rel1 { relative: ALBUM_TEXT_GAP_L/ALBUM_ICON_W ALBUM_TYPE_GAP_T/ALBUM_TEXT_BG_H; to: "label_bg"; } \
- rel2 { relative: (ALBUM_TYPE_ICON_W+ALBUM_TEXT_GAP_L)/ALBUM_ICON_W (ALBUM_TYPE_GAP_T+ALBUM_TYPE_ICON_H)/ALBUM_TEXT_BG_H; to: "label_bg"; } \
- } \
- }
-
-#define GE_ALBUM_COUNT \
- part { \
- name: "elm.pad.right_count"; \
- type: TEXT; \
- mouse_events: 1; \
- repeat_events: 1; \
- scale: 1; \
- description { \
- state: "default" 0.0; \
- visible: 0; \
- rel1 { relative: 1.0 0.0; to: "label_bg"; } \
- rel2 { relative: 1.0 1.0; to: "label_bg"; } \
- min: 10 0; \
- fixed: 1 0; \
- align: 1.0 0.5; \
- } \
- } \
- part { \
- name: "elm.text.count"; \
- type: TEXT; \
- mouse_events: 1; \
- effect: FAR_SHADOW TOP; \
- repeat_events: 1; \
- scale: 1; \
- description { \
- state: "default" 0.0; \
- visible: 1; \
- rel1 { relative: 0.0 0.0; to: "elm.pad.right_count"; } \
- rel2 { relative: 0.0 1.0; to: "elm.pad.right_count"; } \
- min: 10 0; \
- fixed: 1 0; \
- align: 1.0 0.5; \
- color: ALBUM_COUNT_COLOR_INC; \
- color2: ALBUM_COUNT_SHADOW_COLOR_INC; \
- text { \
- font: "Tizen:style=Bold"; \
- text_class: "tizen"; \
- size: ALBUM_COUNT_TEXT_SIZE; \
- min: 1 0; \
- align: 1.0 0.5; \
- } \
- } \
- }
-
-#define GE_ALBUM_NAME \
- part { \
- name: "elm.text.name"; \
- type: TEXT; \
- mouse_events: 1; \
- effect: FAR_SHADOW TOP; \
- repeat_events: 1; \
- scale: 1; \
- description { \
- state: "default" 0.0; \
- rel1 { relative: 1.0 0.0; to_x: "elm.swallow.type_icon"; to_y: "label_bg"; } \
- rel2 { relative: 0.0 1.0; to: "elm.text.count"; } \
- color: ALBUM_NAME_COLOR_INC; \
- color2: ALBUM_COUNT_SHADOW_COLOR_INC; \
- align: 0.0 0.5; \
- text { \
- font: "Tizen:style=Bold"; \
- text_class: "tizen"; \
- size: ALBUM_NAME_TEXT_SIZE; \
- align: 0.0 0.5; \
- } \
- } \
- }
-
-
-#define GE_ALBUM_BADGE \
- part { name: "padding.badge"; \
- type: RECT; \
- scale: 1; \
- mouse_events: 0; \
- description { state: "default" 0.0; \
- align: 1.0 0.0; \
- rel1 { \
- relative: 1.0 0.0; \
- } \
- rel2 { \
- relative: 1.0 0.03; \
- } \
- min: 10 10; \
- fixed: 1 1; \
- visible: 0; \
- } \
- description { state: "default" 0.10; \
- inherit: "default" 0.0; \
- min: 10 10; \
- } \
- description { state: "default" 0.06; \
- inherit: "default" 0.0; \
- min: 6 10; \
- } \
- description { state: "default" 0.04; \
- inherit: "default" 0.0; \
- min: 4 10; \
- } \
- } \
- part { name: "elm.image.badge"; \
- mouse_events: 0; \
- scale: 1; \
- description { state: "default" 0.0; \
- visible: 0; \
- min: 54 54; \
- fixed: 1 1; \
- rel1 { \
- to: "left.padding.text"; \
- relative: 0.0 0.0; \
- } \
- rel2 { \
- to: "right.padding.text"; \
- relative: 1.0 1.0; \
- } \
- image { \
- normal: GE_EDC_IMAGE_BADGE_BG; \
- border: 26 26 0 0; \
- border_scale: 1; \
- } \
- } \
- description { state: "visible" 0.0; \
- inherit: "default" 0.0; \
- visible: 1; \
- } \
- } \
- part { name: "left.padding.text"; \
- type: RECT; \
- scale: 1; \
- description { \
- state: "default" 0.0; \
- visible: 0; \
- fixed: 1 1; \
- min: 12 54; \
- rel1 { \
- to: "elm.text.badge"; \
- relative: 0.0 0.0; \
- } \
- rel2 { \
- to: "elm.text.badge"; \
- relative: 0.0 1.0; \
- } \
- align: 1.0 0.0; \
- } \
- } \
- part { name: "right.padding.text"; \
- type: RECT; \
- scale: 1; \
- description { \
- state: "default" 0.0; \
- visible: 0; \
- fixed: 1 1; \
- min: 12 54; \
- rel1 { \
- to: "padding.badge"; \
- relative: 0.0 1.0; \
- } \
- rel2 { \
- to: "padding.badge"; \
- relative: 0.0 1.0; \
- } \
- align: 1.0 0.0; \
- } \
- } \
- part { name: "elm.text.badge"; \
- type: TEXT; \
- mouse_events: 0; \
- scale: 1; \
- description { \
- state: "default" 0.0; \
- visible: 0; \
- rel1 { \
- to: "right.padding.text"; \
- relative: 0.0 0.0; \
- } \
- rel2 { \
- to: "right.padding.text"; \
- relative: 0.0 1.0; \
- } \
- min: 30 0; \
- fixed: 1 0; \
- align: 1.0 0.5; \
- color: 250 250 250 255; \
- text { \
- font: "Tizen:style=Bold"; \
- size: 34; \
- min: 1 0; \
- text_class: "tizen"; \
- } \
- } \
- description { state: "visible" 0.0; \
- inherit: "default" 0.0; \
- visible: 1; \
- } \
- }
-
-
-group {
- name: "elm/gengrid/item/gallery_efl/albums_view/default";
-
- data.item: "texts" "elm.text.name elm.text.date elm.text.count elm.text.badge";
- data.item: "contents" "elm.swallow.icon elm.swallow.type_icon";
- images {
- image: GE_EDC_IMAGE_ALBUM_BG COMP;
- image: GE_EDC_IMAGE_THUMBS_BG_FOCUS COMP;
- image: GE_EDC_IMAGE_BADGE_BG COMP;
- }
- parts {
- PARTS_PADDING_LEFT("padding.check.left", ALBUM_ICON_GAP_L)
- PARTS_PADDING_LEFT("padding.check.right", ALBUM_ICON_GAP_L+ALBUM_CHECKBOX_W)
- PARTS_PADDING_RIGHT("padding.rename.left", ALBUM_ICON_GAP_R+ALBUM_RENAME_BTN_W)
- PARTS_PADDING_RIGHT("padding.rename.right", ALBUM_ICON_GAP_R)
- PARTS_PADDING_TOP("padding.rename.top", ALBUM_ICON_GAP_T)
- PARTS_PADDING_TOP("padding.rename.bottom", ALBUM_ICON_GAP_T+ALBUM_RENAME_BTN_H)
- PARTS_PADDING_TOP("padding.check.top", ALBUM_CHECKBOX_GAP_T)
- PARTS_PADDING_TOP("padding.check.bottom", ALBUM_CHECKBOX_GAP_T+ALBUM_CHECKBOX_H)
- GE_ALBUM_BG
- GE_GENGRID_FOCUS_BG
- GE_ALBUM_BG_IMAGE
- GE_ALBUM_ICON_BG
- GE_ALBUM_ICON
- GE_ALBUM_LABEL_BG
- GE_ALBUM_TYPE_ICON
- GE_ALBUM_COUNT
- GE_ALBUM_NAME
- GE_ALBUM_BADGE
- }
- programs {
- GE_GENGRID_FOCUS("elm.swallow.icon")
- GE_GENGRID_SOUND("elm.swallow.icon")
- GE_GENGRID_PLAY_SOUND
- program { name: "badge_show";
- signal: "elm,state,elm.text.badge,visible";
- source: "elm";
- action: STATE_SET "visible" 0.0;
- target: "elm.text.badge";
- target: "elm.image.badge";
- }
- program { name: "badge_hide";
- signal: "elm,state,elm.text.badge,hidden";
- source: "elm";
- action: STATE_SET "default" 0.0;
- target: "elm.text.badge";
- target: "elm.image.badge";
- }
- }
-}
-
-group {
- name: "elm/gengrid/item/gallery_efl/albums_split_view/default";
-
- data.item: "texts" "elm.text.name elm.text.date elm.text.badge";
- data.item: "contents" "elm.swallow.icon elm.swallow.type_icon";
- images {
- image: GE_EDC_IMAGE_THUMBS_BG_FOCUS COMP;
- image: GE_EDC_IMAGE_BADGE_BG COMP;
- }
- parts {
- part {
- name: "bg";
- type: RECT;
- description {
- state: "default" 0.0;
- rel1.relative: 0 0;
- rel2.relative: 1 1;
- color: 0 0 0 0;
- }
- }
- part { name: "padding.top";
- type: RECT;
- scale: 1;
- description {
- state: "default" 0.0;
- visible: 1;
- min: 0 0;
- max: 0 0;
- fixed: 1 1;
- align: 0.0 0.0;
- }
- description {
- state: "show" 0.0;
- inherit: "default" 0.0;
- visible: 0;
- min: 0 0;
- max: 0 0;
- fixed: 0 1;
- rel2 { relative: 1.0 0.0;}
- align: 0.0 0.0;
- }
- }
- part { name: "focus_bg";
- type: IMAGE;
- mouse_events: 1;
- repeat_events: 1;
- description { state: "default" 0.0;
- visible: 0;
- image.normal: GE_EDC_IMAGE_THUMBS_BG_FOCUS;
- image.border: 13 13 13 13;
- rel1 { relative: 0.0 0.0; to: "bg"; }
- rel2 { relative: 1.0 270/330; to: "bg"; }
- }
- description { state: "enabled" 0.0;
- inherit: "default" 0.0;
- visible: 1;
- }
- }
- part {
- name: "elm.icon.clipper";
- type: RECT;
- description {
- state: "default" 0.0;
- rel1 { relative: 0 0; offset: 4 4; to:"bg"; }
- rel2 { relative: 1 270/330; offset: -4 -4; to:"bg"; }
- }
- }
- part {
- name: "elm.swallow.icon";
- type: SWALLOW;
- clip_to: "elm.icon.clipper";
- mouse_events: 1;
- description {
- state: "default" 0.0;
- rel1.to: "elm.icon.clipper";
- rel2.to: "elm.icon.clipper";
- }
- }
- part {
- name: "elm.text.name.rect";
- type: RECT;
- mouse_events: 1;
- repeat_events: 1;
- description {
- state: "default" 0.0;
- rel1 { relative: 0.0 1.0; to: elm.swallow.icon; }
- rel2 { relative: 1.0 1.27; to: elm.swallow.icon; }
- color: 0 0 0 0;
- align: 0.5 0.5;
- }
- }
- part {
- name: "elm.text.name";
- type: TEXT;
- mouse_events: 1;
- repeat_events: 1;
- scale: 1;
- description {
- state: "default" 0.0;
- rel1 { relative: 0.0 0.0; to: elm.text.name.rect; }
- rel2 { relative: 1.0 1.0; to: elm.text.name.rect; }
- color: 0 0 0 255;
- color2: ALBUM_COUNT_SHADOW_COLOR_INC;
- min: 0 30;
- align: 0.5 0.5;
- text {
- font: "Tizen:style=Bold";
- text_class: "tizen";
- size: SPLIT_ALBUM_NAME_TEXT_SIZE;
- align: 0.5 0.5;
- }
- }
- }
- part {
- name: "elm.swallow.type_icon";
- type: SWALLOW;
- mouse_events: 1;
- repeat_events: 1;
- description {
- state: "default" 0.0;
- align: 0.5 0.5;
- rel1 { relative: 0.78 0.75; to: "elm.swallow.icon"; }
- rel2 { relative: 0.98 0.95; to: "elm.swallow.icon"; }
- }
- }
- part {
- name: "padding.badge";
- type: RECT;
- scale: 1;
- mouse_events: 0;
- description {
- state: "default" 0.0;
- align: 1.0 0.0;
- rel1 {
- relative: 1.0 0.0;
- }
- rel2 {
- relative: 1.0 0.03;
- }
- min: 6 2;
- fixed: 1 1;
- visible: 0;
- }
- description {
- state: "default" 0.10;
- inherit: "default" 0.0;
- min: 10 10;
- }
- description {
- state: "default" 0.06;
- inherit: "default" 0.0;
- min: 6 10;
- }
- description {
- state: "default" 0.04;
- inherit: "default" 0.0;
- min: 4 10;
- }
- }
- part {
- name: "elm.image.badge";
- mouse_events: 0;
- scale: 1;
- description {
- state: "default" 0.0;
- visible: 0;
- min: 25 25;
- fixed: 1 1;
- rel1 {
- to: "left.padding.text";
- relative: 0.0 0.0;
- }
- rel2 {
- to: "right.padding.text";
- relative: 1.0 1.0;
- }
- image {
- normal: GE_EDC_IMAGE_BADGE_BG;
- border_scale: 1;
- }
- }
- description {
- state: "visible" 0.0;
- inherit: "default" 0.0;
- visible: 1;
- }
- }
- part {
- name: "left.padding.text";
- type: RECT;
- scale: 1;
- description {
- state: "default" 0.0;
- visible: 0;
- fixed: 1 1;
- min: 5 25;
- rel1 {
- to: "elm.text.badge";
- relative: 0.0 0.0;
- }
- rel2 {
- to: "elm.text.badge";
- relative: 0.0 1.0;
- }
- align: 1.0 0.0;
- }
- }
- part {
- name: "right.padding.text";
- type: RECT;
- scale: 1;
- description {
- state: "default" 0.0;
- visible: 0;
- fixed: 1 1;
- min: 5 25;
- rel1 {
- to: "padding.badge";
- relative: 0.0 1.0;
- }
- rel2 {
- to: "padding.badge";
- relative: 0.0 1.0;
- }
- align: 1.0 0.0;
- }
- }
- part {
- name: "elm.text.badge";
- type: TEXT;
- mouse_events: 0;
- scale: 1;
- description {
- state: "default" 0.0;
- visible: 0;
- rel1 {
- to: "right.padding.text";
- relative: 0.0 0.0;
- }
- rel2 {
- to: "right.padding.text";
- relative: 0.0 1.0;
- }
- min: 12 0;
- fixed: 1 0;
- align: 1.0 0.5;
- color: 250 250 250 255;
- text {
- font: "Tizen:style=Bold";
- size: 12;
- min: 1 0;
- text_class: "tizen";
- }
- }
- description {
- state: "visible" 0.0;
- inherit: "default" 0.0;
- visible: 1;
- }
- }
- }
- programs {
- GE_GENGRID_FOCUS("elm.swallow.icon")
- GE_GENGRID_SOUND("elm.swallow.icon")
- GE_GENGRID_PLAY_SOUND
- program { name: "badge_show";
- signal: "elm,state,elm.text.badge,visible";
- source: "elm";
- action: STATE_SET "visible" 0.0;
- target: "elm.text.badge";
- target: "elm.image.badge";
- }
- program { name: "badge_hide";
- signal: "elm,state,elm.text.badge,hidden";
- source: "elm";
- action: STATE_SET "default" 0.0;
- target: "elm.text.badge";
- target: "elm.image.badge";
- }
- }
-}
-
+++ /dev/null
-/*
-* Copyright (c) 2000-2015 Samsung Electronics Co., Ltd All Rights Reserved
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*
-*/
-
-#define THUMBNAILS_BG_COLOR 190 189 189 255
-
-#define W 180
-#define H 180
-#define W2 240
-#define H2 168
-#define W3 360
-#define H3 252
-#define GAP_W 2
-#define GAP_H 2
-#define THUMB_CHECK_W 64
-#define THUMB_CHECK_H 64
-#define THUMB_CHECK_BORDER_L 1
-#define THUMB_CHECK_BORDER_T 3
-#define MODE_W 64
-#define MODE_H 64
-
-#define BURST_W 16
-#define BURST_H 12
-#define BURST_PAD_R 4
-#define BURST_PAD_L 1
-
-/* Favourites icon boundary size */
-#define FAVOR_ICON_W 30
-#define FAVOR_ICON_H 30
-
-#define GE_GRID_PART_ICON \
- part { \
- name: "elm.swallow.icon"; \
- type: SWALLOW; \
- clip_to: "elm.icon.clipper"; \
- description { \
- state: "default" 0.0; \
- rel1.to: "elm.icon.clipper"; \
- rel2.to: "elm.icon.clipper"; \
- } \
- } \
- part { \
- name: "elm.icon.clipper"; \
- type: RECT; \
- description { \
- state: "default" 0.0; \
- rel1 { relative: GAP_W/W GAP_H/H;} \
- rel2 { relative: (W-GAP_W)/W (H-GAP_H)/H;} \
- } \
- }
-
-#define PARTS_PADDING_LEFT(param_padding_name, param_padding_size) \
- part { name: param_padding_name; \
- type: RECT; \
- scale: 1; \
- description { \
- state: "default" 0.0; \
- min: param_padding_size 0; \
- fixed: 1 0; \
- visible: 0; \
- rel2.relative: 0.9 0.0; \
- rel2.offset: -35 0; \
- align: 0.0 0.0; \
- } \
- }
-
-#define PARTS_PADDING_TOP(param_padding_name, param_padding_size) \
- part { name: param_padding_name; \
- type: RECT; \
- scale: 1; \
- description { \
- state: "default" 0.0; \
- min: 0 param_padding_size; \
- fixed: 0 1; \
- visible: 0; \
- rel2.relative: 1.0 0.0; \
- align: 0.0 0.0; \
- } \
- }
-
-#define PARTS_PADDING_BOT(param_padding_name, param_padding_size) \
- part { name: param_padding_name; \
- type: RECT; \
- scale: 1; \
- description { \
- state: "default" 0.0; \
- min: 0 param_padding_size; \
- fixed: 0 1; \
- visible: 0; \
- rel1.relative: 0.0 1.0; \
- align: 0.0 1.0; \
- } \
- }
-
-group {
- name: "elm/gengrid/item/gallery_efl/thumbnail_view/default";
-
- data.item: "contents" "elm.swallow.icon elm.swallow.mode elm.swallow.end";
- images {
- image: GE_EDC_IMAGE_THUMBS_BG_FOCUS COMP;
- }
- parts {
- PARTS_PADDING_LEFT("padding.end.left", THUMB_CHECK_BORDER_L);
- PARTS_PADDING_LEFT("padding.end.right", THUMB_CHECK_BORDER_L+THUMB_CHECK_W);
- PARTS_PADDING_TOP("padding.end.top", THUMB_CHECK_BORDER_T);
- PARTS_PADDING_TOP("padding.end.bottom", THUMB_CHECK_BORDER_T+THUMB_CHECK_H);
- PARTS_PADDING_LEFT("padding.end.left2", GAP_W);
- PARTS_PADDING_LEFT("padding.end.right2", GAP_W+MODE_W);
- PARTS_PADDING_BOT("padding.end.top2", GAP_H+MODE_H);
- PARTS_PADDING_BOT("padding.end.bottom2", GAP_H);
- part {
- name: "bg";
- type: RECT;
- description {
- state: "default" 0.0;
- color: 0 0 0 0;
- rel1 { relative: 0.0 0.0;}
- rel2 { relative: 1.0 1.0;}
- }
- }
- part {
- name: "icon_bg";
- type: RECT;
- scale : 1;
- description {
- state: "default" 0.0;
- align: 0.5 0.5;
- visible: 0;
- color: 0 0 0 0;
- rel1 { relative: 0.0 0.0;to:"bg"; }
- rel2 { relative: 1.0 1.0;to:"bg"; }
-
- }
- }
- part {
- name: "icon_bg_color";
- type: RECT;
- scale : 1;
- description {
- state: "default" 0.0;
- align: 0.5 0.5;
- visible: 1;
- rel1.to : "elm.swallow.icon";
- rel1.offset : 2 2;
- rel2.to : "elm.swallow.icon";
- color: 230 230 230 255;
- }
- }
-
- part {
- name: "elm.swallow.icon";
- type: SWALLOW;
- mouse_events: 1;
- description {
- state: "default" 0.0;
- color: 0 0 0 0;
- rel1 { relative: 0.0 0.0; to: "icon_bg"; }
- rel2 { relative: 1.0 1.0; to: "icon_bg"; }
- }
- }
- part {
- name: "elm.swallow.mode";
- type: SWALLOW;
- description {
- state: "default" 0.0;
- rel1 {relative: 1.0 0.0; to_x: "padding.end.left2"; to_y: "padding.end.top2"; }
- rel2 {relative: 1.0 0.0; to_x: "padding.end.right2"; to_y: "padding.end.bottom2"; }
- }
- }
- GE_GENGRID_FOCUS_BG
- part {
- name: "elm.swallow.end";
- type: SWALLOW;
- description {
- state: "default" 0.0;
- align: 0 0;
- min: 10 10;
- max: 10 10;
- rel1 {relative: 1.0 1.0; to_x: "padding.end.left"; to_y: "padding.end.top"; }
- rel2 {relative: 1.0 1.0; to_x: "padding.end.right"; to_y: "padding.end.bottom"; }
- }
- }
- }
-
- programs {
- GE_GENGRID_FOCUS("elm.swallow.icon")
- GE_GENGRID_SOUND("elm.swallow.end")
- GE_GENGRID_SOUND("elm.swallow.icon")
- GE_GENGRID_PLAY_SOUND
- }
-}
-
-group
-{
- name: "elm/gengrid/photoframe/default_layout";
-
- parts {
- part {
- name: "bg";
- type: RECT;
- description {
- state: "default" 0.0;
- rel1 { relative: 0.0 0.0;}
- rel2 { relative: 1.0 1.0;}
- color: 0 0 0 0;
- }
- }
- GE_GRID_PART_ICON
- }
-}
-
-group
-{
- name: "elm/gengrid/photoframe/default_layout_video";
- images {
- image: GE_EDC_IMAGE_BUTTON_VIDEO_PLAY COMP;
- }
-
- parts {
- part {
- name: "bg";
- type: RECT;
- mouse_events: 1;
- description {
- state: "default" 0.0;
- rel1 { relative: 0.0 0.0;}
- rel2 { relative: 1.0 1.0;}
- color: 0 0 0 0;
- }
- }
- GE_GRID_PART_ICON
- part {
- name: "elm.swallow.videoicon";
- type: IMAGE;
- mouse_events: 0;
- repeat_events: 0;
- scale: 1;
- description {
- state: "default" 0.0;
- rel1 {
- relative: 0.5 0.45;
- to: bg;
- }
- rel2 {
- relative: 0.5 0.45;
- to: bg;
- }
- min: 36 36;
- max: 36 36;
- align: 0.5 0.5;
- image.normal: GE_EDC_IMAGE_BUTTON_VIDEO_PLAY;
- }
- }
- part {
- name: "elm.text.bg";
- type: RECT;
- mouse_events: 0;
- scale : 1;
- description {
- state: "default" 0.0;
- color: 0 0 0 130;
- align: 0.0 1.0;
- rel1 { relative: 0 1; offset: 0 -40; to: "elm.swallow.icon"; }
- rel2 { relative: 1 1; to: "elm.swallow.icon"; }
- }
- }
- part {
- name: "elm.text";
- type: TEXT;
- mouse_events: 1;
- repeat_events: 1;
- scale: 1;
- description {
- state: "default" 0.0;
- align: 0.0 1.0;
- rel1 { relative: 0.0 0.0; to: "elm.text.bg"; }
- rel2 { relative: 1.0 1.0; to: "elm.text.bg"; }
- color: 255 255 255 255;
- text {
- font: "Tizen:style=Bold";
- text_class: "tizen";
- size: 13;
- align: 0.0 0.5;
- }
- }
- }
- }
-}
+++ /dev/null
-/*
-* Copyright (c) 2000-2015 Samsung Electronics Co., Ltd All Rights Reserved
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*
-*/
-
-//////////Copied from scroller.edc//////////////////////
-
-#define SCROLLER_DEFAULT_SCROLLBAR_VBAR_IMAGE "00_scroll_bar.png"
-#define SCROLLER_DEFAULT_SCROLLBAR_HBAR_IMAGE "00_scroll_bar.png"
-#define SCROLLER_DEFAULT_SCROLLBAR_VBAR_IMAGE_BORDER 5 10 5 10
-#define SCROLLER_DEFAULT_SCROLLBAR_HBAR_IMAGE_BORDER 5 10 5 10
-#define SCROLLER_DEFAULT_SCROLLBAR_VBAR_MIN_SIZE_INC 16 238
-#define SCROLLER_DEFAULT_SCROLLBAR_VBAR_MAX_SIZE_INC 16 99999
-#define SCROLLER_DEFAULT_SCROLLBAR_HBAR_MIN_SIZE_INC 208 16
-#define SCROLLER_DEFAULT_SCROLLBAR_HBAR_MAX_SIZE_INC 99999 16
-#define SCROLLER_DEFAULT_SCROLLBAR_VBAR_PADDING_SIZE 6
-#define SCROLLER_DEFAULT_SCROLLBAR_HBAR_PADDING_SIZE 6
-
-sounds {
- sample {
- name: "touch_sound" RAW;
- source: GE_EDC_SOUND_TOUCH_30MS;
- }
-}
-
-#define GE_GENGRID_SOUND(src) \
- program { name: src"mouse_clicked"; \
- signal: "mouse,clicked,1"; \
- source: src; \
- transition: DECELERATE 0.2; \
- after: "touch_snd"; \
- }
-
-#define GE_GENGRID_PLAY_SOUND \
- program { name: "touch_snd"; \
- action: RUN_PLUGIN "touch_sound_plugin"; \
- }
-
-#define GE_GENGRID_FOCUS_BG \
- part { name: "focus_bg"; \
- type: IMAGE; \
- mouse_events: 1; \
- repeat_events: 1; \
- description { state: "default" 0.0; \
- visible: 0; \
- image.normal: GE_EDC_IMAGE_THUMBS_BG_FOCUS; \
- image.border: 13 13 13 13; \
- } \
- description { state: "enabled" 0.0; \
- inherit: "default" 0.0; \
- visible: 1; \
- } \
- }
-
-#define GE_GENGRID_FOCUS(src) \
- program { \
- name: "go_mouse_down_"src; \
- signal: "mouse,down,1"; \
- source: src; \
- action: STATE_SET "enabled" 0.0; \
- target: "focus_bg"; \
- transition: ACCELERATE 0.2; \
- } \
- program { \
- name: "go_mouse_up_"src; \
- signal: "mouse,up,1"; \
- source: src; \
- action: STATE_SET "default" 0.0; \
- target: "focus_bg"; \
- transition: DECELERATE 0.2; \
- } \
- program { name: "focus_in"; \
- signal: "elm,state,focused"; \
- source: "elm"; \
- action: STATE_SET "enabled" 0.0; \
- target: "focus_bg"; \
- } \
- program { name: "focus_out"; \
- signal: "elm,state,unfocused"; \
- source: "elm"; \
- action: STATE_SET "default" 0.0; \
- target: "focus_bg"; \
- }
-
-
-/*
- * vim:ts=3
-*/
-group { name: "elm/scroller/base/gallery_efl";
-
- data {
- item: "focus_highlight" "on";
- }
-
- script {
- public sbvis_v, sbvis_h, sbalways_v, sbalways_h, sbvis_timer;
- public sh_v, sh_h, sh_timer, edge_timer;
- public timer0(val) {
- new v;
- v = get_int(sbvis_v);
- if (v) {
- v = get_int(sbalways_v);
- if (!v) {
- emit("do-hide-vbar", "");
- set_int(sbvis_v, 0);
- }
- }
- v = get_int(sbvis_h);
- if (v) {
- v = get_int(sbalways_h);
- if (!v) {
- emit("do-hide-hbar", "");
- set_int(sbvis_h, 0);
- }
- }
- set_int(sbvis_timer, 0);
- return 0;
- }
- public timer1(val) {
- emit("do-hide-vshadow", "");
- emit("do-hide-hshadow", "");
- set_int(sh_timer, 0);
- return 0;
- }
- public timer2(val) {
- emit("do-hide-vshadow", "");
- emit("do-hide-hshadow", "");
- set_int(edge_timer, 0);
- return 0;
- }
- }
- images {
- image: SCROLLER_DEFAULT_SCROLLBAR_VBAR_IMAGE COMP;
- image: SCROLLER_DEFAULT_SCROLLBAR_HBAR_IMAGE COMP;
- }
- parts {
- part { name: "bg";
- type: RECT;
- scale: 1;
- description { state: "default" 0.0;
- rel1.offset: 0 0;
- rel2.offset: -1 -1;
- color: 255 255 255 0;
- }
- }
- part { name: "clipper";
- type: RECT;
- mouse_events: 0;
- scale: 1;
- description { state: "default" 0.0;
- rel1.to: "bg";
- rel2.to: "bg";
- rel1.offset: 0 0;
- rel2.offset: -1 -1;
- }
- }
- part { name: "elm.swallow.content";
- clip_to: "clipper";
- type: SWALLOW;
- scale: 1;
- description { state: "default" 0.0;
- rel1.to: "bg";
- rel2.to: "bg";
- rel1.offset: 0 0;
- rel2.offset: -1 -1;
- }
- }
- part { name: "sb_vbar_clip_master";
- type: RECT;
- mouse_events: 0;
- scale: 1;
- description { state: "default" 0.0;
- }
- description { state: "hidden" 0.0;
- visible: 0;
- color: 255 255 255 0;
- }
- }
- part { name: "sb_vbar_clip";
- clip_to: "sb_vbar_clip_master";
- type: RECT;
- mouse_events: 0;
- scale: 1;
- description { state: "default" 0.0;
- }
- description { state: "hidden" 0.0;
- visible: 0;
- color: 255 255 255 0;
- }
- }
- part { name: "sb_vbar";
- type: RECT;
- mouse_events: 0;
- scale: 1;
- description { state: "default" 0.0;
- fixed: 1 1;
- visible: 0;
- min: SCROLLER_DEFAULT_SCROLLBAR_VBAR_MIN_SIZE_INC;
- align: 1.0 0.0;
- rel1 {
- relative: 1.0 0.0;
- offset: 0 0;
- to_y: "elm.swallow.content";
- to_x: "elm.swallow.content";
- }
- rel2 {
- relative: 1.0 1.0;
- offset: -1 1;
- to_y: "elm.swallow.content";
- to_x: "elm.swallow.content";
- }
- }
- }
- part { name: "elm.dragable.vbar";
- clip_to: "sb_vbar_clip";
- mouse_events: 0;
- scale: 1;
- dragable {
- x: 0 0 0;
- y: 1 1 0;
- confine: "sb_vbar";
- }
- description { state: "default" 0.0;
- fixed: 1 1;
- min: SCROLLER_DEFAULT_SCROLLBAR_VBAR_MIN_SIZE_INC;
- max: SCROLLER_DEFAULT_SCROLLBAR_VBAR_MAX_SIZE_INC;
- rel1 {
- relative: 0.5 0.5;
- offset: 0 0;
- to: "sb_vbar";
- }
- rel2 {
- relative: 0.5 0.5;
- offset: 0 0;
- to: "sb_vbar";
- }
- image {
- normal: SCROLLER_DEFAULT_SCROLLBAR_VBAR_IMAGE;
- border: SCROLLER_DEFAULT_SCROLLBAR_VBAR_IMAGE_BORDER;
- border_scale: 1;
- middle: DEFAULT;
- }
- }
- }
- part { name: "sb_hbar_clip_master";
- type: RECT;
- mouse_events: 0;
- scale: 1;
- description { state: "default" 0.0;
- }
- description { state: "hidden" 0.0;
- visible: 0;
- color: 255 255 255 0;
- }
- }
- part { name: "sb_hbar_clip";
- clip_to: "sb_hbar_clip_master";
- type: RECT;
- mouse_events: 0;
- scale: 1;
- description { state: "default" 0.0;
- }
- description { state: "hidden" 0.0;
- visible: 0;
- color: 255 255 255 0;
- }
- }
- part { name: "sb_hbar";
- type: RECT;
- mouse_events: 0;
- scale: 1;
- description { state: "default" 0.0;
- fixed: 1 1;
- visible: 0;
- min: SCROLLER_DEFAULT_SCROLLBAR_HBAR_MIN_SIZE_INC;
- align: 0.0 1.0;
- rel1 {
- relative: 0.0 1.0;
- offset: 0 0;
- to_x: "elm.swallow.content";
- to_y: "elm.swallow.content";
- }
- rel2 {
- relative: 1.0 1.0;
- offset: -1 -1;
- to_x: "elm.swallow.content";
- to_y: "elm.swallow.content";
- }
- }
- }
- part { name: "elm.dragable.hbar";
- clip_to: "sb_hbar_clip";
- mouse_events: 0;
- scale: 1;
- dragable {
- x: 1 1 0;
- y: 0 0 0;
- confine: "sb_hbar";
- }
- description { state: "default" 0.0;
- fixed: 1 1;
- min: SCROLLER_DEFAULT_SCROLLBAR_HBAR_MIN_SIZE_INC;
- max: SCROLLER_DEFAULT_SCROLLBAR_HBAR_MAX_SIZE_INC;
- rel1 {
- relative: 0.5 0.5;
- offset: 0 0;
- to: "sb_hbar";
- }
- rel2 {
- relative: 0.5 0.5;
- offset: 0 0;
- to: "sb_hbar";
- }
- image {
- normal: SCROLLER_DEFAULT_SCROLLBAR_HBAR_IMAGE;
- border: SCROLLER_DEFAULT_SCROLLBAR_HBAR_IMAGE_BORDER;
- border_scale: 1;
- middle: DEFAULT;
- }
- }
- }
- part { name: "disabler";
- type: RECT;
- scale: 1;
- description { state: "default" 0.0;
- rel1.to: "clipper";
- rel2.to: "clipper";
- color: 0 0 0 0;
- visible: 0;
- }
- description { state: "disabled" 0.0;
- inherit: "default" 0.0;
- visible: 1;
- color: 128 128 128 128;
- }
- }
- }
- programs {
- program { name: "load";
- signal: "load";
- source: "";
- script {
- set_state(PART:"sb_hbar_clip", "hidden", 0.0);
- set_state(PART:"sb_vbar_clip", "hidden", 0.0);
- set_int(sbvis_h, 0);
- set_int(sbvis_v, 0);
- set_int(sbalways_v, 0);
- set_int(sbalways_h, 0);
- set_int(sbvis_timer, 0);
- }
- }
-
- program { name: "vbar_show";
- signal: "elm,action,show,vbar";
- source: "elm";
- action: STATE_SET "default" 0.0;
- target: "sb_vbar_clip_master";
- }
- program { name: "vbar_hide";
- signal: "elm,action,hide,vbar";
- source: "elm";
- action: STATE_SET "hidden" 0.0;
- target: "sb_vbar_clip_master";
- }
- program { name: "vbar_show_always";
- signal: "elm,action,show_always,vbar";
- source: "elm";
- script {
- new v;
- v = get_int(sbvis_v);
- v |= get_int(sbalways_v);
- if (!v) {
- set_int(sbalways_v, 1);
- emit("do-show-vbar", "");
- set_int(sbvis_v, 1);
- }
- }
- }
- program { name: "vbar_show_notalways";
- signal: "elm,action,show_notalways,vbar";
- source: "elm";
- script {
- new v;
- v = get_int(sbalways_v);
- if (v) {
- set_int(sbalways_v, 0);
- v = get_int(sbvis_v);
- if (!v) {
- emit("do-hide-vbar", "");
- set_int(sbvis_v, 0);
- }
- }
- }
- }
- program { name: "sb_vbar_show";
- signal: "do-show-vbar";
- source: "";
- action: STATE_SET "default" 0.0;
- transition: LINEAR 0.5;
- target: "sb_vbar_clip";
- }
- program { name: "sb_vbar_hide";
- signal: "do-hide-vbar";
- source: "";
- action: STATE_SET "hidden" 0.0;
- transition: LINEAR 0.5;
- target: "sb_vbar_clip";
- }
-
- program { name: "hbar_show";
- signal: "elm,action,show,hbar";
- source: "elm";
- action: STATE_SET "default" 0.0;
- target: "sb_hbar_clip_master";
- }
- program { name: "hbar_hide";
- signal: "elm,action,hide,hbar";
- source: "elm";
- action: STATE_SET "hidden" 0.0;
- target: "sb_hbar_clip_master";
- }
- program { name: "hbar_show_always";
- signal: "elm,action,show_always,hbar";
- source: "elm";
- script {
- new v;
- v = get_int(sbvis_h);
- v |= get_int(sbalways_h);
- if (!v) {
- set_int(sbalways_h, 1);
- emit("do-show-hbar", "");
- set_int(sbvis_h, 1);
- }
- }
- }
- program { name: "hbar_show_notalways";
- signal: "elm,action,show_notalways,hbar";
- source: "elm";
- script {
- new v;
- v = get_int(sbalways_h);
- if (v) {
- set_int(sbalways_h, 0);
- v = get_int(sbvis_h);
- if (!v) {
- emit("do-hide-hbar", "");
- set_int(sbvis_h, 0);
- }
- }
- }
- }
- program { name: "sb_hbar_show";
- signal: "do-show-hbar";
- source: "";
- action: STATE_SET "default" 0.0;
- transition: LINEAR 0.5;
- target: "sb_hbar_clip";
- }
- program { name: "sb_hbar_hide";
- signal: "do-hide-hbar";
- source: "";
- action: STATE_SET "hidden" 0.0;
- transition: LINEAR 0.5;
- target: "sb_hbar_clip";
- }
-
- program { name: "scroll";
- signal: "elm,action,scroll";
- source: "elm";
- script {
- new v;
- v = get_int(sbvis_v);
- v |= get_int(sbalways_v);
- if (!v) {
- emit("do-show-vbar", "");
- set_int(sbvis_v, 1);
- }
- v = get_int(sbvis_h);
- v |= get_int(sbalways_h);
- if (!v) {
- emit("do-show-hbar", "");
- set_int(sbvis_h, 1);
- }
- v = get_int(sbvis_timer);
- if (v > 0) cancel_timer(v);
- v = timer(1.0, "timer0", 0);
- set_int(sbvis_timer, v);
- }
- }
- program { name: "disable";
- signal: "elm,state,disabled";
- source: "elm";
- action: STATE_SET "disabled" 0.0;
- target: "disabler";
- }
- program { name: "enable";
- signal: "elm,state,enabled";
- source: "elm";
- action: STATE_SET "default" 0.0;
- target: "disabler";
- }
- }
-}
-
-group { name: "elm/gengrid/base/gallery_efl";
- inherit: "elm/scroller/base/gallery_efl";
-
- images {
- //image: GE_EDC_IMAGE_OS_TOP COMP;
- //image: GE_EDC_IMAGE_OS_BOTTOM COMP;
- image: GE_EDC_IMAGE_OS_LEFT COMP;
- image: GE_EDC_IMAGE_OS_RIGHT COMP;
- }
-
- parts {
- part { name: "shadow_clip";
- type: RECT;
- mouse_events: 0;
- scale: 1;
- description { state: "default" 0.0;
- }
- description { state: "hidden" 0.0;
- visible: 0;
- color: 0 0 0 0;
- }
- }
- /*part { name: "shadow_top";
- clip_to: "shadow_clip";
- type: IMAGE;
- scale: 1;
- description { state: "default" 0.0;
- min: 0 30;
- fixed: 1 1;
- align: 0.5 0.0;
- color: 0 0 0 80;
- rel1.relative: 0.0 0.0;
- rel2.relative: 1.0 0.0;
- rel1.to: "elm.swallow.content";
- rel2.to: "elm.swallow.content";
- image.normal: GE_EDC_IMAGE_OS_TOP;
- }
- description { state: "edge" 0.0;
- inherit: "default" 0.0;
- color: 0 0 0 255;
- }
- }
- part { name: "shadow_bottom";
- clip_to: "shadow_clip";
- type: IMAGE;
- scale: 1;
- description { state: "default" 0.0;
- min: 0 30;
- fixed: 1 1;
- align: 0.5 1.0;
- color: 0 0 0 80;
- rel1.relative: 0.0 1.0;
- rel2.relative: 1.0 1.0;
- rel1.to: "elm.swallow.content";
- rel2.to: "elm.swallow.content";
- image.normal: GE_EDC_IMAGE_OS_BOTTOM;
- }
- description { state: "edge" 0.0;
- inherit: "default" 0.0;
- color: 0 0 0 255;
- }
- }*/
- part { name: "shadow_left";
- clip_to: "shadow_clip";
- type: IMAGE;
- scale: 1;
- description { state: "default" 0.0;
- min: 30 0;
- fixed: 1 1;
- align: 0.0 0.5;
- color: 0 0 0 80;
- rel1.relative: 0.0 0.0;
- rel2.relative: 0.0 1.0;
- rel1.to: "elm.swallow.content";
- rel2.to: "elm.swallow.content";
- image.normal: GE_EDC_IMAGE_OS_LEFT;
- }
- description { state: "edge" 0.0;
- inherit: "default" 0.0;
- color: 0 0 0 255;
- }
- }
- part { name: "shadow_right";
- clip_to: "shadow_clip";
- type: IMAGE;
- scale: 1;
- description { state: "default" 0.0;
- min: 30 0;
- fixed: 1 1;
- align: 1.0 0.5;
- color: 0 0 0 80;
- rel1.relative: 1.0 0.0;
- rel2.relative: 1.0 1.0;
- rel1.to: "elm.swallow.content";
- rel2.to: "elm.swallow.content";
- image.normal: GE_EDC_IMAGE_OS_RIGHT;
- }
- description { state: "edge" 0.0;
- inherit: "default" 0.0;
- color: 0 0 0 255;
- }
- }
- }
- programs {
- program { name: "load";
- script {
- set_state(PART:"sb_hbar_clip", "hidden", 0.0);
- set_state(PART:"sb_vbar_clip", "hidden", 0.0);
- set_state(PART:"shadow_clip", "hidden", 0.0);
- set_int(sbvis_h, 0);
- set_int(sbvis_v, 0);
- set_int(sbalways_v, 0);
- set_int(sbalways_h, 0);
- set_int(sbvis_timer, 0);
- set_int(sh_v, 0);
- set_int(sh_timer, 0);
- set_int(edge_timer, 0);
- }
- }
- program { name: "vshadow_show";
- signal: "do-show-vshadow";
- source: "";
- action: STATE_SET "default" 0.0;
- transition: LINEAR 0.5;
- target: "shadow_clip";
- }
- program { name: "vshadow_hide";
- signal: "do-hide-vshadow";
- source: "";
- action: STATE_SET "hidden" 0.0;
- transition: LINEAR 0.5;
- target: "shadow_clip";
- }
- program { name: "scroll";
- signal: "elm,action,scroll";
- source: "elm";
- script {
- new v;
- v = get_int(sbvis_v);
- v |= get_int(sbalways_v);
- if (!v) {
- emit("do-show-vbar", "");
- set_int(sbvis_v, 1);
- }
- v = get_int(sbvis_h);
- v |= get_int(sbalways_h);
- if (!v) {
- emit("do-show-hbar", "");
- set_int(sbvis_h, 1);
- }
- v = get_int(sbvis_timer);
- if (v > 0) cancel_timer(v);
- v = timer(1, "timer0", 0);
- set_int(sbvis_timer, v);
-
- v = get_int(edge_timer);
- if (!v) {
- //set_state(PART:"shadow_top", "default", 0.0);
- //set_state(PART:"shadow_bottom", "default", 0.0);
- set_state(PART:"shadow_left", "default", 0.0);
- set_state(PART:"shadow_right", "default", 0.0);
- emit("do-show-vshadow", "");
- v = get_int(sh_timer);
- if (v > 0) cancel_timer(v);
- v = timer(0.2, "timer1", 0);
- set_int(sh_timer, v);
- }
- }
- }
- /*program { name: "edge_top";
- signal: "elm,edge,top";
- source: "elm";
- after: "edge";
- }
- program { name: "edge_bottom";
- signal: "elm,edge,bottom";
- source: "elm";
- after: "edge";
- }*/
- program { name: "edge_left";
- signal: "elm,edge,left";
- source: "elm";
- after: "edge";
- }
- program { name: "edge_right";
- signal: "elm,edge,right";
- source: "elm";
- after: "edge";
- }
- program { name: "edge";
- script {
- new v;
- v = get_int(sh_timer);
- if (v > 0) cancel_timer(v);
- //set_state(PART:"shadow_top", "edge", 0.0);
- //set_state(PART:"shadow_bottom", "edge", 0.0);
- set_state(PART:"shadow_left", "edge", 0.0);
- set_state(PART:"shadow_right", "edge", 0.0);
- v = get_int(edge_timer);
- if (!v) {
- emit("do-show-vshadow", "");
- }
- if (v > 0) cancel_timer(v);
- v = timer(0.2, "timer2", 0);
- set_int(edge_timer, v);
- }
- }
- program { name: "show";
- signal: "show";
- source: "";
- script {
- new v;
- emit("do-show-vbar", "");
- set_int(sbvis_v, 1);
- v = get_int(sbalways_v);
- if (!v) {
- v = get_int(sbvis_timer);
- if (v > 0) cancel_timer(v);
- v = timer(1.0, "timer0", 0);
- set_int(sbvis_timer, v);
- }
- emit("do-show-hbar", "");
- set_int(sbvis_h, 1);
- v = get_int(sbalways_h);
- if (!v) {
- v = get_int(sbvis_timer);
- if (v > 0) cancel_timer(v);
- v = timer(1.0, "timer0", 0);
- set_int(sbvis_timer, v);
- }
- }
- }
- }
-}
-
+++ /dev/null
-/*
-* Copyright (c) 2000-2015 Samsung Electronics Co., Ltd All Rights Reserved
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*
-*/
-
-#define NOCONTENT_TEXT_BLOCK_TEXT_SIZE_INC 32
-#define NOCONTENT_TEXT_BLOCK_STYLE_COLOR_INC 173 170 165 255
-
- group {
- name: "elm/layout/nocontents/gallery_efl";
- styles{
- style { name: "nocontent_style";
- base: "font=Tizen:style=Roman text_class=tizen font_size="NOCONTENT_TEXT_BLOCK_TEXT_SIZE_INC" align=center color=#ffffff wrap=word";
- tag: "br" "\n";
- tag: "hilight" "+ font=Tizen:style=Bold text_class=tizen";
- tag: "b" "+ font=Tizen:style=Bold text_class=tizen";
- tag: "tab" "\t";
- }
- }
- images {
- image: GE_EDC_IMAGE_NOCONTENTS_PIC COMP;
- }
- parts {
- part { name: "bg";
- scale: 1;
- type: RECT;
- description { state: "default" 0.0;
- visible: 1;
- rel1 { relative: 0.0 0.0;}
- rel2 { relative: 1.0 1.0;}
- color: 0 0 0 0;
- }
- }
- part { name: "nocontents.image";
- description { state: "default" 0.0;
- visible: 1;
- align: 0.5 0.0;
- rel1 { relative: 203/720 296/1016; to: "bg";}
- rel2 { relative: (203+314)/720 (296+310)/1016; to: "bg";}
- image {
- normal: GE_EDC_IMAGE_NOCONTENTS_PIC;
- border: 1 1 1 1;
- border_scale: 1;
- }
- aspect: 1.0 1.0;
- aspect_preference: BOTH;
- }
- }
- part { name: "middle.padding";
- scale: 1;
- type: RECT;
- description { state: "default" 0.0;
- visible: 0;
- align: 0.5 0.0;
- rel1 { relative: 0.0 1.0; to_y: "nocontents.image";}
- rel2 { relative: 1.0 (296+310+54)/1016; to: "bg";}
- }
- }
- part { name: "elm.text";
- type: TEXTBLOCK;
- description { state: "default" 0.0;
- fixed: 0 1;
- align: 0.5 0.0;
- visible: 1;
- rel1 { relative: 0.0 1.0; to_x: "bg"; to_y: "middle.padding";}
- rel2 { relative: 1.0 1.0; to: "bg";}
- color: NOCONTENT_TEXT_BLOCK_STYLE_COLOR_INC;
- text {
- style: "nocontent_style";
- align: 0.5 0.5;
- min: 0 0;
- max: 0 1;
- }
- }
- }
- }
- }
-
/*
-* Copyright (c) 2000-2015 Samsung Electronics Co., Ltd All Rights Reserved
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*
-*/
+ * Copyright (c) 2015 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://floralicense.org/license/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
#define FONT_ROM "HelveticaNeue:style=Roman"
#define FONT_MED "HelveticaNeue:style=Medium"
param: "FEEDBACK_TYPE_SOUND FEEDBACK_PATTERN_TAP";
}
}
+
+#define GAP_W 2
+#define GAP_H 2
+#define W 180
+#define H 180
-#include "attach-panel-gallery-gengrid.edc"
-#include "attach-panel-gallery-gengrid-item-thumbview.edc"
-#include "attach-panel-gallery-gengrid-item-albums.edc"
-#include "attach-panel-gallery-check.edc"
-#include "attach-panel-gallery-nocontents.edc"
-#include "attach-panel-gallery-expanded-title.edc"
-
-
-group {
- name: "gallery_efl/gridview";
- parts {
- part {
- name: "background";
- type, RECT;
- description {
- state: "default" 0.0;
- rel1 { relative: 0.0 0.0;}
- rel2 { relative: 1.0 1.0; }
- color, 0 0 0 0;
- }
- }
- part {
- name: "split.view.bg.color";
- type: RECT;
- mouse_events: 1;
- description {
- state: "default" 0.0;
- rel1 { relative: 0.0 0.0; to: split.view; }
- rel2 { relative: 1.0 1.0; to: split.view; }
- color: 230 230 230 255;
- }
- }
- part {
- name: "split.view";
- type: SWALLOW;
- mouse_events: 1;
- description {
- state: "default" 0.0;
- min: 0 0;
- max: 0 0;
- align: 0 0;
- rel1 { relative: 0.0 0.0; }
- rel2 { relative: 1.0 1.0; }
- color : 0 255 0 255;
- }
- description {
- state: "visible" 0.0;
- rel1 { relative: 0.0 0.0; }
- rel2 { relative: 179/540 1.0; }
- fixed: 1 0;
- min: 0 0;
- max: -1 -1;
- color : 0 255 0 255;
- }
- }
- part {
- name: "select.all.area.bg";
- type: RECT;
- mouse_events: 0;
- description {
- state: "default" 0.0;
- min: 0 0;
- max: 0 0;
- align: 0 0;
- rel1 { relative: 1.0 0.0; to: "split.view"; }
- rel2 { relative: 1.0 1.0; }
- color: 255 255 255 255;
- }
- description {
- state: "visible" 0.0;
- inherit: "default" 0.0;
- min: 0 0;
- max: -1 60;
- }
- }
- part {
- name: "select.all.area.label";
- type: TEXT;
- mouse_events: 0;
- scale: 1;
- description {
- state: "default" 0.0;
- rel1 { relative: 24/540 0.0; to: "select.all.area.bg";}
- rel2 { relative: 0.6 1.0; to: "select.all.area.bg";}
- text {
- text: "Select All";
- size: 18;
- align: 0.0 0.5;
- }
- color: 0 0 255 255;
- visible: 0;
- }
- description {
- state: "visible" 0.0;
- inherit: "default" 0.0;
- visible: 1;
- }
- }
- part {
- name: "select.all.area.check";
- type: SWALLOW;
- mouse_events: 0;
- description {
- state: "default" 0.0;
- rel1 { relative: 1.0 0.1; to: "select.all.area.bg"; offset: -60 0;}
- rel2 { relative: 1.0 0.9; to: "select.all.area.bg";}
- visible: 0;
- }
- description {
- state: "visible" 0.0;
- inherit: "default" 0.0;
- visible: 1;
- }
- }
- part {
- name: "select.all.area.check.fg";
- type: SWALLOW;
- mouse_events: 1;
- repeat_events: 0;
- description {
- state: "default" 0.0;
- rel1 { relative: 0 0; to: "select.all.area.check";}
- rel2 { relative: 1 1; to: "select.all.area.check";}
- align: 1 0.5;
- visible: 0;
- }
- description {
- state: "visible" 0.0;
- inherit: "default" 0.0;
- visible: 1;
- }
- }
- part {
- name: "contents";
- type: SWALLOW;
- mouse_events: 1;
- scale: 1;
- description {
- state: "default" 0.0;
- rel1 { relative: 0.0 1.0; to: "select.all.area.bg";}
- rel2 { relative: 1.0 1.0; to: "background";}
- }
- description {
- state: "moveup" 0.0;
- rel1 { relative: 0.0 0.0; to: "background";}
- rel2 { relative: 1.0 1.0; to: "elm.selinfo.clipper"; }
- }
- }
- part {
- name: "elm.swallow.selinfo";
- type: SWALLOW;
- scale: 1;
- clip_to: "elm.selinfo.clipper";
- description {
- state: "default" 0.0;
- rel1.to: "elm.selinfo.clipper";
- rel2.to: "elm.selinfo.clipper";
- }
- }
- part {
- name: "elm.selinfo.clipper";
- type: RECT;
- scale: 1;
- description {
- state: "default" 0.0;
- min: 0 SELINFO_H; // bottom padding size for selectioninfo
- fixed: 0 1;
- align: 0.5 1.0;
- rel1.relative: 0.0 1.0;
- visible: 0;
- }
- description { state: "show" 0.0;
- inherit: "default" 0.0;
- visible: 1;
- color: GALLERY_EDC_COLOR_BG;
- }
- }
- }
- script {
- public message(Msg_Type:type,id, ...)
- {
- if((type == MSG_INT) && (id == 1))
- {
- new a;
- a = getarg(2);
- custom_state(PART:"split.view","default",0.0);
- set_state_val(PART:"split.view",STATE_MAX,a,-1);
- set_state(PART:"split.view","custom",0.0);
- }
- if((type == MSG_INT) && (id == 2))
- {
- new a;
- new x, y;
- a = getarg(2);
- custom_state(PART:"select.all.area.bg","default",0.0);
- get_state_val(PART:"select.all.area.bg",STATE_MAX,x,y);
- set_state_val(PART:"select.all.area.bg",STATE_MIN,0,60);
- set_state_val(PART:"select.all.area.bg",STATE_MAX,a,60);
- set_state(PART:"select.all.area.bg","custom",0.0);
- }
- }
- }
- programs {
- program {
- name: "thumb_view_default";
- signal: "elm,thumb_view,state,default";
- source: "elm";
- script {
- set_state(PART:"contents", "default", 0.0);
- set_state(PART:"elm.selinfo.clipper", "default", 0.0);
- }
- }
- program {
- name: "thumb_view_moveup";
- signal: "elm,thumb_view,state,moveup";
- source: "elm";
- script {
- set_state(PART:"contents", "moveup", 0.0);
- set_state(PART:"elm.selinfo.clipper", "show", 0.0);
- }
- }
- program {
- name: "selectall_visible";
- signal: "elm,selectall,state,visible";
- source: "elm";
- script {
- set_state(PART:"select.all.area.label", "visible", 0.0);
- set_state(PART:"select.all.area.check", "visible", 0.0);
- set_state(PART:"select.all.area.check.fg", "visible", 0.0);
- }
- }
- program {
- name: "selectall_visible_bg";
- signal: "elm,selectall,state,visible,bg";
- source: "elm";
- script {
- set_state(PART:"select.all.area.bg", "visible", 0.0);
- }
- }
- program {
- name: "selectall_default";
- signal: "elm,selectall,state,default";
- source: "elm";
- script {
- set_state(PART:"select.all.area.label", "default", 0.0);
- set_state(PART:"select.all.area.check", "default", 0.0);
- set_state(PART:"select.all.area.bg", "default", 0.0);
- set_state(PART:"select.all.area.check", "default", 0.0);
- }
- }
- program {
- name: "split_view_default";
- signal: "elm,splitview,state,default";
- source: "elm";
- action: STATE_SET "default" 0.0;
- target: "split.view";
- transition : LINEAR 0.5;
- }
- program {
- name: "split_view_visible";
- signal: "elm,splitview,state,visible";
- source: "elm";
- action: STATE_SET "custom" 0.0;
- target: "split.view";
- transition : LINEAR 0.5;
- }
- program {
- name: "touch_snd";
- signal : "mouse,clicked,1";
- source : "select.all.area.check.fg";
- action: PLAY_SAMPLE "touch_sound" 1.0;
- }
- }
+#define GE_GRID_PART_ICON \
+ part { \
+ name: "elm.swallow.icon"; \
+ type: SWALLOW; \
+ clip_to: "elm.icon.clipper"; \
+ description { \
+ state: "default" 0.0; \
+ rel1.to: "elm.icon.clipper"; \
+ rel2.to: "elm.icon.clipper"; \
+ } \
+ } \
+ part { \
+ name: "elm.icon.clipper"; \
+ type: RECT; \
+ description { \
+ state: "default" 0.0; \
+ rel1 { relative: GAP_W/W GAP_H/H;} \
+ rel2 { relative: (W-GAP_W)/W (H-GAP_H)/H;} \
+ } \
}
-
group {
name: "elm/gengrid/item/gengrid_first_item/default";
data.item: "texts" "tile_layout_text tile_layout_text_second";
color: 0 0 0 0;
}
}
+ part {
+ name: "content_touch_rect";
+ type: RECT;
+ mouse_events: 1;
+ repeat_events: 1;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ rel1 { relative: 0.0 0.0; to: "background";}
+ rel2 { relative: 1.0 1.0; to: "background";}
+ color : 0 0 0 0;
+ }
+ }
}
programs {
program {
}
program {
name: "touch_snd";
- source: "content_swallow";
+ source: "content_touch_rect";
signal: "mouse,clicked,1";
transition: DECELERATE 0.2;
action: RUN_PLUGIN "touch_sound_plugin";
}
}
}
- group { name: "ge_bg_layout";
- parts {
- part { name: "bg";
- type: RECT;
- mouse_events: 0;
- description { state: "default" 0.0;
- color: 255 255 255 45;
- }
- }
- part { name: "elm.swallow.image";
- type: SWALLOW;
- description { state: "default" 0.0;
- }
- }
- }
- }
-
- group { name: "ge_help_layout";
+ group
+ {
+ name: "elm/gengrid/photoframe/default_layout";
+
parts {
- part { name: "bg";
+ part {
+ name: "bg";
type: RECT;
- mouse_events: 0;
- description { state: "default" 0.0;
- }
- }
- part { name: "elm.swallow.image";
- type: SWALLOW;
- description { state: "default" 0.0;
+ description {
+ state: "default" 0.0;
+ rel1 { relative: 0.0 0.0;}
+ rel2 { relative: 1.0 1.0;}
+ color: 0 0 0 0;
}
}
+ GE_GRID_PART_ICON
}
}
-
+}
\ No newline at end of file
/*
-* Copyright (c) 2000-2015 Samsung Electronics Co., Ltd All Rights Reserved
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*
-*/
+ * Copyright (c) 2015 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://floralicense.org/license/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
#define RESOURCE_IMAGE( FILE_NAME ) \
/*
-* Copyright (c) 2000-2015 Samsung Electronics Co., Ltd All Rights Reserved
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*
-*/
+ * Copyright (c) 2015 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://floralicense.org/license/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
#include <media_content.h>
#include "ge-data-type.h"
#include "ge-debug.h"
-int _ge_data_type_new_media(ge_media_s **item)
+int _ge_data_type_new_media(ge_media_s ** item)
{
GE_CHECK_VAL(item, -1);
- ge_media_s *tmp_item = (ge_media_s *)calloc(1, sizeof(ge_media_s));
+ ge_media_s *tmp_item = (ge_media_s *) calloc(1, sizeof(ge_media_s));
GE_CHECK_VAL(tmp_item, -1);
tmp_item->gtype = GE_TYPE_MEDIA;
- *item = tmp_item;
+ *item = tmp_item;
return 0;
}
-int _ge_data_type_new_album(ge_album_s **album)
-{
- GE_CHECK_VAL(album, -1);
- ge_album_s *tmp_item = (ge_album_s *)calloc(1, sizeof(ge_album_s));
- GE_CHECK_VAL(tmp_item, -1);
- tmp_item->gtype = GE_TYPE_ALBUM;
- *album = tmp_item;
- return 0;
-}
-
-static int __ge_data_type_free_media(ge_media_s **item)
+static int __ge_data_type_free_media(ge_media_s ** item)
{
GE_CHECK_VAL(item, -1);
GE_CHECK_VAL(*item, -1);
return 0;
}
-int _ge_data_type_free_media_list(Eina_List **list)
-{
- GE_CHECK_VAL(list, -1);
- GE_CHECK_VAL(*list, -1);
- ge_media_s *item = NULL;
- Eina_List *tmp_list = *list;
- EINA_LIST_FREE(tmp_list, item) {
- if (item) {
- __ge_data_type_free_media(&item);
- }
- }
- *list = NULL;
- return 0;
-}
-
-static int __ge_data_type_free_album(ge_album_s **album)
+static int __ge_data_type_free_album(ge_album_s ** album)
{
GE_CHECK_VAL(album, -1);
GE_CHECK_VAL(*album, -1);
return 0;
}
-int _ge_data_type_free_album_list(Eina_List **list)
-{
- GE_CHECK_VAL(list, -1);
- GE_CHECK_VAL(*list, -1);
- ge_album_s *item = NULL;
- Eina_List *tmp_list = *list;
- EINA_LIST_FREE(tmp_list, item) {
- if (item) {
- __ge_data_type_free_album(&item);
- }
- }
- *list = NULL;
- return 0;
-}
-
int _ge_data_type_free_geitem(void **item)
{
GE_CHECK_VAL(item, -1);
GE_CHECK_VAL(*item, -1);
int ret = -1;
- if (((ge_album_s *)*item)->gtype == GE_TYPE_ALBUM) {
- ret = __ge_data_type_free_album((ge_album_s **)item);
- } else if (((ge_media_s *)*item)->gtype == GE_TYPE_MEDIA ||
- ((ge_media_s *)*item)->gtype == GE_TYPE_WEB_MEDIA) {
- ret = __ge_data_type_free_media((ge_media_s **)item);
+ if (((ge_album_s *) * item)->gtype == GE_TYPE_ALBUM) {
+ ret = __ge_data_type_free_album((ge_album_s **) item);
+ } else if (((ge_media_s *) * item)->gtype == GE_TYPE_MEDIA ||
+ ((ge_media_s *) * item)->gtype == GE_TYPE_WEB_MEDIA) {
+ ret = __ge_data_type_free_media((ge_media_s **) item);
}
if (ret < 0) {
return 0;
}
}
-
/*
-* Copyright (c) 2000-2015 Samsung Electronics Co., Ltd All Rights Reserved
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*
-*/
+ * Copyright (c) 2015 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://floralicense.org/license/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
#include "ge-data-util.h"
*/
ge_item *_ge_data_util_calloc_geitem(void)
{
- ge_item *gitem = (ge_item*)calloc(1, sizeof(ge_item));
+ ge_item *gitem = (ge_item *) calloc(1, sizeof(ge_item));
GE_CHECK_NULL(gitem);
return gitem;
}
/*
* destroy a ge_item
*/
-int _ge_data_util_free_geitem(ge_item* gitem)
+int _ge_data_util_free_geitem(ge_item * gitem)
{
if (gitem) {
if (gitem->item) {
- _ge_data_type_free_geitem((void **)&(gitem->item));
+ _ge_data_type_free_geitem((void **) &(gitem->item));
gitem->item = NULL;
}
GE_FREE(gitem);
return 0;
}
-int _ge_data_util_free_mtype_items(Eina_List **elist)
+int _ge_data_util_free_mtype_items(Eina_List ** elist)
{
void *current = NULL;
ge_dbg("Clear Mitems list.");
EINA_LIST_FREE(*elist, current) {
if (current) {
- _ge_data_type_free_geitem((void **)¤t);
+ _ge_data_type_free_geitem((void **) ¤t);
current = NULL;
}
}
return 0;
}
-int _ge_data_util_free_cluster(ge_cluster* gcluster)
-{
- GE_CHECK_VAL(gcluster, -1);
- if (gcluster->cover) {
- _ge_data_util_free_item(gcluster->cover);
- gcluster->cover = NULL;
- }
- if (gcluster->cluster) {
- _ge_data_type_free_geitem((void **)&(gcluster->cluster));
- gcluster->cluster = NULL;
- }
- GE_FREE(gcluster);
- return 0;
-}
-
-ge_cluster_list *_ge_data_util_calloc_clusters_list(void)
-{
- ge_cluster_list* clus_list = (ge_cluster_list*)calloc(1,
- sizeof(ge_cluster_list));
- GE_CHECK_NULL(clus_list);
- return clus_list;
-}
-
-ge_cluster *_ge_data_util_calloc_cluster(void)
-{
- ge_cluster* gcluster = (ge_cluster*)calloc(1, sizeof(ge_cluster));
- GE_CHECK_NULL(gcluster);
- return gcluster;
-}
-
-/* Create 'All' album */
-ge_cluster *_ge_data_util_new_cluster_all(ge_ugdata *ugd, int count)
-{
- GE_CHECK_NULL(ugd);
- ge_cluster* gcluster = _ge_data_util_calloc_cluster();
- GE_CHECK_NULL(gcluster);
-
- /* Pass -1 to get a mcluster from libmedia-info, not a real record in DB */
- ge_album_s *cluster = NULL;
- _ge_data_type_new_album(&cluster);
- if (cluster == NULL) {
- GE_FREE(gcluster);
- return NULL;
- }
-
- cluster->uuid = strdup(GE_ALBUM_ALL_ID);
- cluster->display_name = strdup(GE_ALBUM_ALL_NAME);
- cluster->count = count;
- cluster->type = GE_ALL;
- gcluster->cluster = cluster;
- gcluster->ugd = ugd;
- gcluster->index = 0;
-
- return gcluster;
-}
-
-ge_item *_ge_data_util_new_item_mitem(ge_media_s *mitem)
-{
- ge_item *gitem = _ge_data_util_calloc_geitem();
- GE_CHECK_NULL(gitem);
- gitem->item = mitem;
-
- return gitem;
-}
-
-int _ge_data_util_free_item(ge_item *gitem)
+int _ge_data_util_free_item(ge_item * gitem)
{
GE_CHECK_VAL(gitem, -1);
/*
* Create a gitem for selected item
*/
-ge_sel_item_s *_ge_data_util_new_sel_item(ge_item *gitem)
+ge_sel_item_s *_ge_data_util_new_sel_item(ge_item * gitem)
{
GE_CHECK_NULL(gitem);
GE_CHECK_NULL(gitem->item);
- ge_sel_item_s *item = (ge_sel_item_s *)calloc(1, sizeof(ge_sel_item_s));
+ ge_sel_item_s *item =
+ (ge_sel_item_s *) calloc(1, sizeof(ge_sel_item_s));
GE_CHECK_NULL(item);
item->uuid = strdup(gitem->item->uuid);
item->file_url = strdup(gitem->item->file_url);
/*
* Free a ge_sel_item_s item
*/
-int _ge_data_util_free_sel_item(ge_sel_item_s *item)
+int _ge_data_util_free_sel_item(ge_sel_item_s * item)
{
GE_CHECK_VAL(item, -1);
GE_FREEIF(item->uuid);
return 0;
}
-/*
-* Create a album for selected item's album
-*/
-ge_sel_album_s *_ge_data_util_new_sel_album(char *album_uuid)
-{
- GE_CHECK_NULL(album_uuid);
- ge_sel_album_s *album = NULL;
-
- album = (ge_sel_album_s *)calloc(1, sizeof(ge_sel_album_s));
- GE_CHECK_NULL(album);
- album->uuid = strdup(album_uuid);
- return album;
-}
-
-int _ge_data_util_create_filter2(char *cond, char *keyword, int offset, int count, filter_h *filter)
-{
- GE_CHECK_VAL(filter, -1);
- int ret = -1;
- filter_h _filter = NULL;
-
- ret = media_filter_create(&_filter);
- if (ret != MEDIA_CONTENT_ERROR_NONE) {
- ge_dbgE("Fail to create filter!");
- return -1;
- }
-
- if (cond && strlen(cond) > 0) {
- ret = media_filter_set_condition(_filter, cond,
- MEDIA_CONTENT_COLLATE_NOCASE);
- if (ret != MEDIA_CONTENT_ERROR_NONE) {
- ge_dbgE("Fail to set condition!");
- goto GE_DATA_UTIL_FAILED;
- }
- }
-
- if (keyword && strlen(keyword) > 0) {
- media_content_order_e order_type = MEDIA_CONTENT_ORDER_DESC;
- if (!g_strcmp0(MEDIA_DISPLAY_NAME, keyword)) {
- order_type = MEDIA_CONTENT_ORDER_ASC;
- }
- ret = media_filter_set_order(_filter, order_type, keyword,
- MEDIA_CONTENT_COLLATE_NOCASE);
- if (ret != MEDIA_CONTENT_ERROR_NONE) {
- ge_dbgE("Fail to set order!");
- goto GE_DATA_UTIL_FAILED;
- }
- }
-
- if (offset != -1) {
- ge_dbg("offset: %d, count: %d", offset, count);
- ret = media_filter_set_offset(_filter, offset, count);
- if (ret != MEDIA_CONTENT_ERROR_NONE) {
- ge_dbgE("Fail to set offset!");
- goto GE_DATA_UTIL_FAILED;
- }
- }
-
- *filter = _filter;
- return 0;
-
-GE_DATA_UTIL_FAILED:
-
- if (_filter) {
- media_filter_destroy(_filter);
- _filter = NULL;
- *filter = NULL;
- }
- return -1;
-}
-
-int _ge_data_util_create_filter(ge_filter_s *condition, filter_h *filter)
+int _ge_data_util_create_filter(ge_filter_s * condition, filter_h * filter)
{
GE_CHECK_VAL(filter, -1);
GE_CHECK_VAL(condition, -1);
if (strlen(condition->cond) > 0) {
ret = media_filter_set_condition(tmp_filter, condition->cond,
- condition->collate_type);
+ condition->collate_type);
if (ret != MEDIA_CONTENT_ERROR_NONE) {
ge_dbgE("Fail to set condition!");
goto GE_DATA_UTIL_FAILED;
if (strlen(condition->sort_keyword) > 0) {
ret = media_filter_set_order(tmp_filter, condition->sort_type,
- condition->sort_keyword,
- condition->collate_type);
+ condition->sort_keyword,
+ condition->collate_type);
if (ret != MEDIA_CONTENT_ERROR_NONE) {
ge_dbgE("Fail to set order!");
goto GE_DATA_UTIL_FAILED;
ge_dbg("offset: %d, count: %d", condition->offset, condition->count);
if (condition->offset != -1) {
ret = media_filter_set_offset(tmp_filter, condition->offset,
- condition->count);
+ condition->count);
if (ret != MEDIA_CONTENT_ERROR_NONE) {
ge_dbgE("Fail to set offset!");
goto GE_DATA_UTIL_FAILED;
*filter = tmp_filter;
return 0;
-GE_DATA_UTIL_FAILED:
+ GE_DATA_UTIL_FAILED:
if (tmp_filter) {
media_filter_destroy(tmp_filter);
return 0;
}
-bool _ge_data_util_clone_media(media_info_h media, ge_media_s **pitem,
- bool b_meta)
+bool _ge_data_util_clone_media(media_info_h media, ge_media_s ** pitem,
+ bool b_meta)
{
GE_CHECK_FALSE(pitem);
ge_media_s *item = NULL;
*pitem = NULL;
- item = (ge_media_s *)calloc(1, sizeof(ge_media_s));
+ item = (ge_media_s *) calloc(1, sizeof(ge_media_s));
GE_CHECK_FALSE(item);
item->gtype = GE_TYPE_MEDIA;
- if (media_info_clone(&(item->media_h), media) != MEDIA_CONTENT_ERROR_NONE) {
+ if (media_info_clone(&(item->media_h), media) !=
+ MEDIA_CONTENT_ERROR_NONE) {
ge_dbgE("Clone media handle error");
goto GE_DATA_UTIL_FAILED;
}
- if (media_info_get_media_id(media, &(item->uuid)) != MEDIA_CONTENT_ERROR_NONE) {
+ if (media_info_get_media_id(media, &(item->uuid)) !=
+ MEDIA_CONTENT_ERROR_NONE) {
ge_dbgE("Get media id error");
goto GE_DATA_UTIL_FAILED;
}
- if (media_info_get_display_name(media, &(item->display_name)) != MEDIA_CONTENT_ERROR_NONE) {
+ if (media_info_get_display_name(media, &(item->display_name)) !=
+ MEDIA_CONTENT_ERROR_NONE) {
ge_dbgE("Get media display name error");
goto GE_DATA_UTIL_FAILED;
}
- if (media_info_get_file_path(media, &(item->file_url)) != MEDIA_CONTENT_ERROR_NONE) {
+ if (media_info_get_file_path(media, &(item->file_url)) !=
+ MEDIA_CONTENT_ERROR_NONE) {
ge_dbgE("Get media file path error");
goto GE_DATA_UTIL_FAILED;
}
- if (media_info_get_media_type(media, (media_content_type_e *)&(item->type)) != MEDIA_CONTENT_ERROR_NONE) {
+ if (media_info_get_media_type
+ (media,
+ (media_content_type_e *) & (item->type)) !=
+ MEDIA_CONTENT_ERROR_NONE) {
ge_dbgE("Get media type error");
goto GE_DATA_UTIL_FAILED;
}
- if (media_info_get_thumbnail_path(media, &(item->thumb_url)) != MEDIA_CONTENT_ERROR_NONE) {
+ if (media_info_get_thumbnail_path(media, &(item->thumb_url)) !=
+ MEDIA_CONTENT_ERROR_NONE) {
ge_dbgE("Get media thumbnail path error");
goto GE_DATA_UTIL_FAILED;
}
ge_sdbg("thumb_url: %s", item->thumb_url);
- if (media_info_get_timeline(media, &(item->mtime)) != MEDIA_CONTENT_ERROR_NONE) {
+ if (media_info_get_timeline(media, &(item->mtime)) !=
+ MEDIA_CONTENT_ERROR_NONE) {
ge_dbgE("Get media modified time error");
goto GE_DATA_UTIL_FAILED;
}
-// if (media_info_get_mode(media, (media_content_mode_e *)&(item->mode)) != MEDIA_CONTENT_ERROR_NONE) {
-// ge_dbgE("Get media mode failed!");
-// goto GE_DATA_UTIL_FAILED;
-// }
media_content_storage_e storage_type = 0;
- if (media_info_get_storage_type(media, &storage_type) != MEDIA_CONTENT_ERROR_NONE) {
+ if (media_info_get_storage_type(media, &storage_type) !=
+ MEDIA_CONTENT_ERROR_NONE) {
ge_dbgE("Get storage type failed!");
goto GE_DATA_UTIL_FAILED;
}
- if (storage_type == MEDIA_CONTENT_STORAGE_INTERNAL) { /* The device's internal storage */
+ if (storage_type == MEDIA_CONTENT_STORAGE_INTERNAL) { /* The device's internal storage */
item->storage_type = GE_PHONE;
- } else if (storage_type == MEDIA_CONTENT_STORAGE_EXTERNAL) { /* The device's external storage */
+ } else if (storage_type == MEDIA_CONTENT_STORAGE_EXTERNAL) { /* The device's external storage */
item->storage_type = GE_MMC;
} else {
ge_dbgE("Undefined mode[%d]!", storage_type);
*pitem = item;
return true;
-GE_DATA_UTIL_FAILED:
+ GE_DATA_UTIL_FAILED:
- _ge_data_type_free_geitem((void **)(&item));
+ _ge_data_type_free_geitem((void **) (&item));
return false;
}
-
-/** @cond is allocated by caller, maybe it's an array */
-int _ge_data_util_get_geo_cond(char *cond, double longmin, double longmax,
- double latmin, double latmax)
-{
- GE_CHECK_VAL(cond, -1);
-
- char *long_max = g_new0(char, G_ASCII_DTOSTR_BUF_SIZE);
- char *long_min = g_new0(char, G_ASCII_DTOSTR_BUF_SIZE);
- char *lat_max = g_new0(char, G_ASCII_DTOSTR_BUF_SIZE);
- char *lat_min = g_new0(char, G_ASCII_DTOSTR_BUF_SIZE);
- int ret = -1;
-
- if (long_max == NULL || long_min == NULL || lat_max == NULL ||
- lat_min == NULL) {
- ge_dbgE("Failed to malloc memory!");
- goto GE_DATA_UTIL_FAILED;
- }
-
- ge_sdbg("Double, Region: LongMax %f, LongMin %f, LatMax %f, LatMin %f",
- longmax, longmin, latmax, latmin);
- /* 2013.04.23
- * The format %lf in snprintf has a bug:
- * The longitude should be 127.05998, but the result after snprintf is 127,05998.
- * This cause media db operation failure(dot->comma).
- * To avoid this bug, float/double number is converted to string first, then put %s to snprintf.
- * This extra conversion can be deleted if the format bug in snprintf is fixed.
- */
- g_ascii_dtostr(long_min, G_ASCII_DTOSTR_BUF_SIZE, longmin);
- g_ascii_dtostr(long_max, G_ASCII_DTOSTR_BUF_SIZE, longmax);
- g_ascii_dtostr(lat_min, G_ASCII_DTOSTR_BUF_SIZE, latmin);
- g_ascii_dtostr(lat_max, G_ASCII_DTOSTR_BUF_SIZE, latmax);
- ge_sdbg("String, Region: LongMax %s, LongMin %s, LatMax %s, LatMin %s",
- long_max, long_min, lat_max, lat_min);
- g_snprintf(cond, CONDITION_LENGTH,
- "(%s>=%s AND %s<=%s) AND (%s>=%s AND %s<=%s)",
- MEDIA_LONGITUDE, long_min, MEDIA_LONGITUDE, long_max,
- MEDIA_LATITUDE, lat_min, MEDIA_LATITUDE, lat_max);
- ge_sdbg("g_snprintf, %s", cond);
- ret = 0;
-
-GE_DATA_UTIL_FAILED:
-
- GE_GFREEIF(long_max);
- GE_GFREEIF(long_min);
- GE_GFREEIF(lat_max);
- GE_GFREEIF(lat_min);
- return ret;
-}
-
-int _ge_data_util_get_type_cond(char *cond, int file_t)
-{
- if (file_t == GE_FILE_T_IMAGE) {
- g_strlcpy(cond, GE_CONDITION_IMAGE, CONDITION_LENGTH);
- } else if (file_t == GE_FILE_T_VIDEO) {
- g_strlcpy(cond, GE_CONDITION_VIDEO, CONDITION_LENGTH);
- } else {
- g_strlcpy(cond, GE_CONDITION_IMAGE_VIDEO, CONDITION_LENGTH);
- }
- return 0;
-}
-
/*
-* Copyright (c) 2000-2015 Samsung Electronics Co., Ltd All Rights Reserved
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*
-*/
+ * Copyright (c) 2015 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://floralicense.org/license/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
#include "ge-data.h"
#include "ge-debug.h"
/*
* Free a ge_sel_album_s album
*/
-int _ge_data_free_sel_album(ge_sel_album_s *album)
+int _ge_data_free_sel_album(ge_sel_album_s * album)
{
GE_CHECK_VAL(album, -1);
if (album->elist) {
return 0;
}
-/* Remove album */
-int _ge_data_remove_sel_album(ge_ugdata *ugd, ge_sel_album_s *salbum)
-{
- if (ugd == NULL || ugd->selected_elist == NULL || salbum == NULL) {
- return 0;
- }
-
- /* Check album is created or not */
- ugd->selected_elist = eina_list_remove(ugd->selected_elist, salbum);
- _ge_data_free_sel_album(salbum);
- return 0;
-}
-
-/* Get count of selected items */
-int _ge_data_get_sel_cnt(ge_ugdata *ugd)
-{
- if (ugd == NULL || ugd->selected_elist == NULL) {
- return 0;
- }
-
- /* Check album is created or not */
- ge_sel_album_s *salbum = NULL;
- int cnt = 0;
- Eina_List *l = NULL;
- EINA_LIST_FOREACH(ugd->selected_elist, l, salbum) {
- if (salbum == NULL || salbum->elist == NULL) {
- continue;
- }
- cnt += eina_list_count(salbum->elist);
- salbum = NULL;
- }
- ge_dbg("Count: %d", cnt);
- return cnt;
-}
-
/* Append items' path */
-int _ge_data_get_sel_paths(ge_ugdata *ugd, char **filepath, char ***filepath_arr, int *cnt)
+int _ge_data_get_sel_paths(ge_ugdata * ugd, char **filepath,
+ char ***filepath_arr, int *cnt)
{
- if (filepath == NULL || ugd == NULL || ugd->selected_elist == NULL || filepath_arr == NULL) {
+ if (filepath == NULL || ugd == NULL || ugd->selected_elist == NULL
+ || filepath_arr == NULL) {
ge_dbgE("Invalid input!");
return -1;
}
EINA_LIST_FOREACH(ugd->selected_elist, l, sit) {
if (sit) {
g_string_append(selected_path, sit->file_url);
- g_string_append_c(selected_path, ';');
- path_list = eina_list_append(path_list, sit);
- _cnt++;
- sit = NULL;
- }
+ g_string_append_c(selected_path, ';');
+ path_list = eina_list_append(path_list, sit);
+ _cnt++;
+ sit = NULL;
}
+ }
/* copy path from path_list to path_array */
int idx = 0;
sit = NULL;
if (_cnt > 0) {
- *filepath_arr = (char **)calloc(_cnt, sizeof(char *));
+ *filepath_arr = (char **) calloc(_cnt, sizeof(char *));
EINA_LIST_FREE(path_list, sit) {
if (sit && sit->file_url) {
(*filepath_arr)[idx] = strdup(sit->file_url);
return 0;
}
-int _ge_data_get_album_sel_cnt(ge_ugdata *ugd, char *uuid, int *cnt)
-{
- GE_CHECK_VAL(cnt, -1);
- GE_CHECK_VAL(uuid, -1);
- GE_CHECK_VAL(ugd, -1);
- if (ugd->selected_elist == NULL) {
- ge_dbgW("Empty selected list!");
- return -1;
- }
- *cnt = 0;
-
- ge_sel_album_s *salbum = NULL;
- Eina_List *l = NULL;
- EINA_LIST_FOREACH(ugd->selected_elist, l, salbum) {
- if (salbum == NULL || salbum->elist == NULL ||
- salbum->uuid == NULL) {
- ge_dbgW("Empty salbum!");
- continue;
- }
- if (!g_strcmp0(salbum->uuid, uuid)) {
- *cnt = eina_list_count(salbum->elist);
- return 0;
- }
- salbum = NULL;
- }
- return -1;
-}
-
-/* Check items */
-int _ge_data_check_sel_items(ge_ugdata *ugd)
-{
- if (ugd == NULL) {
- ge_dbgE("Error input!");
- return -1;
- }
-
- /* Check album is appended or not */
- ge_sel_album_s *salbum = NULL;
- Eina_List *l = NULL;
- Eina_List *l2 = NULL;
- ge_sel_item_s *sit = NULL;
- EINA_LIST_FOREACH(ugd->selected_elist, l, salbum) {
- if (salbum == NULL || salbum->uuid == NULL) {
- continue;
- }
- EINA_LIST_FOREACH(salbum->elist, l2, sit) {
- if (sit == NULL) {
- continue;
- }
- if (sit->uuid == NULL || sit->file_url == NULL)
- salbum->elist = eina_list_remove(salbum->elist,
- sit);
- sit = NULL;
- }
- salbum = NULL;
- }
- return 0;
-}
-
-/* Remove sel albums */
-int _ge_data_free_sel_albums(ge_ugdata *ugd)
-{
- if (ugd == NULL || ugd->selected_elist == NULL) {
- return 0;
- }
-
- /* Check album is created or not */
- ge_sel_album_s *salbum = NULL;
- EINA_LIST_FREE(ugd->selected_elist, salbum) {
- if (salbum == NULL || salbum->elist == NULL) {
- continue;
- }
- _ge_data_free_sel_album(salbum);
- salbum = NULL;
- }
- return 0;
-}
-
-/* Check ID is in the list or not */
-bool _ge_data_check_selected_id(Eina_List *sel_id_list, const char *id)
-{
- GE_CHECK_FALSE(sel_id_list);
- GE_CHECK_FALSE(id);
- Eina_List *tmp_elist = NULL;
- ge_sel_item_s *sit = NULL;
-
- if (eina_list_count(sel_id_list) == 0) {
- ge_dbgE("sel_id_list is empty!");
- return false;
- }
-
- EINA_LIST_FOREACH(sel_id_list, tmp_elist, sit) {
- if (sit == NULL || sit->uuid == NULL) {
- ge_dbgE("Invalid p_id!");
- sit = NULL;
- continue;
- }
- if (g_strcmp0(id, sit->uuid)) {
- sit = NULL;
- continue;
- }
-
- sit->valid = 1;
- return true;
- }
- return false;
-}
-
-int _ge_data_update_items_cnt(ge_ugdata *ugd, ge_cluster *album)
-{
- GE_CHECK_VAL(album, -1);
- GE_CHECK_VAL(album->cluster, -1);
- GE_CHECK_VAL(album->cluster->uuid, -1);
- GE_CHECK_VAL(ugd, -1);
- int err = -1;
- int item_count = 0;
-
- ge_filter_s filter;
- memset(&filter, 0x00, sizeof(ge_filter_s));
- filter.sort_type = MEDIA_CONTENT_ORDER_DESC;
- g_strlcpy(filter.sort_keyword, GE_CONDITION_ORDER, KEYWORD_LENGTH);
- filter.collate_type = MEDIA_CONTENT_COLLATE_NOCASE;
- filter.offset = GE_GET_ALL_RECORDS;
- filter.count = GE_GET_ALL_RECORDS;
- g_strlcpy(filter.cond, GE_CONDITION_IMAGE_VIDEO, CONDITION_LENGTH);
- filter.with_meta = false;
-
- if (ugd->file_type_mode == GE_FILE_T_IMAGE) {
- g_strlcpy(filter.cond, GE_CONDITION_IMAGE, CONDITION_LENGTH);
- } else if (ugd->file_type_mode == GE_FILE_T_VIDEO) {
- g_strlcpy(filter.cond, GE_CONDITION_VIDEO, CONDITION_LENGTH);
- }
-
- if (g_strcmp0(album->cluster->uuid, GE_ALBUM_ALL_ID)) {
- err = _ge_local_data_get_media_count(album->cluster->uuid,
- &filter, &item_count);
- } else {
- /* "All albums" album */
- ge_dbg("all media count");
- err = _ge_local_data_get_all_media_count(&filter, &item_count);
- /* Update flag */
- if (ugd->cluster_list->b_updated) {
- ge_dbgW("Update flag: all media count!");
- ugd->cluster_list->all_medias_cnt = item_count;
- }
- }
- if (err < 0) {
- ge_dbgE("Get item count failed(%d)!", err);
- return -1;
- }
-
- ge_dbg("cluster media count : old=%d, new=%d", album->cluster->count,
- item_count);
- album->cluster->count = item_count;
-
- return 0;
-}
-
-int _ge_data_free_clusters(ge_ugdata *ugd)
-{
- GE_CHECK_VAL(ugd, -1);
- if (ugd->cluster_list) {
- if (ugd->cluster_list->clist) {
- ge_dbg("Clear clusters");
- ge_cluster *album = NULL;
- EINA_LIST_FREE(ugd->cluster_list->clist, album) {
- if (album) {
- _ge_data_util_free_cluster(album);
- }
-
- album = NULL;
- }
- ugd->cluster_list->clist = NULL;
- }
-
- GE_FREE(ugd->cluster_list);
- }
- return 0;
-}
-
-int _ge_data_get_clusters(ge_ugdata *ugd, int type)
-{
- GE_CHECK_VAL(ugd, -1);
- int length = 0;
- int all_local_cnt = 0;
- Eina_List *list = NULL;
- ge_album_s *album = NULL;
- ge_album_s *camera_album = NULL;
- ge_album_s *downloads_album = NULL;
- ge_cluster *camera_cluster = NULL;
- ge_cluster* gcluster = NULL;
- int medias_cnt = 0;
- int err = -1;
- ge_filter_s filter;
- int local_cnt = 0;
- int data_type = GE_ALBUM_DATA_DONE;
- bool b_8_albums_got = false;
-
- if (type == GE_ALBUM_DATA_NONE) {
- if (ugd->cluster_list == NULL) {
- ugd->cluster_list = _ge_data_util_calloc_clusters_list();
- GE_CHECK_VAL(ugd->cluster_list, -1);
- } else {
- if (ugd->cluster_list->clist) {
- ge_dbg("Clear clusters list");
- EINA_LIST_FREE(ugd->cluster_list->clist, gcluster) {
- if (gcluster) {
- _ge_data_util_free_cluster(gcluster);
- gcluster = NULL;
- }
- }
- ugd->cluster_list->clist = NULL;
- }
- ugd->cluster_list->data_type = GE_ALBUM_DATA_NONE;
- ugd->cluster_list->local_cnt = 0;
- ugd->cluster_list->web_cnt = 0;
- }
- ugd->cluster_list->b_updated = true;
- }
- GE_CHECK_VAL(ugd->cluster_list, -1);
-
-GE_DATA_AGAIN:
-
- /* Get local albums for first time and local albums is more than 9 */
- if (type == GE_ALBUM_DATA_NONE || type == GE_ALBUM_DATA_LOCAL) {
- /* Get real albums */
- memset(&filter, 0x00, sizeof(ge_filter_s));
- g_strlcpy(filter.cond, GE_CONDITION_IMAGE_VIDEO,
- CONDITION_LENGTH);
- filter.collate_type = MEDIA_CONTENT_COLLATE_NOCASE;
- filter.sort_type = MEDIA_CONTENT_ORDER_ASC;
- g_strlcpy(filter.sort_keyword, FOLDER_NAME, KEYWORD_LENGTH);
- if (type == GE_ALBUM_DATA_NONE) {
- _ge_local_data_get_album_by_path(GE_CAMERA_PATH_PHONE,
- &camera_album);
- if (camera_album) {
- list = eina_list_append(list, camera_album);
- }
- camera_album = NULL;
- _ge_local_data_get_album_by_path(GE_CAMERA_PATH_MMC,
- &camera_album);
- if (camera_album) {
- list = eina_list_append(list, camera_album);
- }
- _ge_local_data_get_album_by_path(GE_DOWNLOADS_PATH,
- &downloads_album);
- if (downloads_album) {
- list = eina_list_append(list, downloads_album);
- }
-
- filter.count = GE_ALBUMS_FIRST_COUNT;
- filter.list_type = GE_ALBUM_LIST_FIRST;
- } else {
- filter.count = -1;
- filter.list_type = GE_ALBUM_LIST_ALL;
- }
- filter.offset = ugd->cluster_list->local_cnt;
- filter.with_meta = false;
-
- err = _ge_local_data_get_album_list(&filter, &list);
- if (err != 0) {
- ge_dbgW("No record");
- if (list) {
- _ge_data_util_free_mtype_items(&list);
- }
- } else {
- memset(&filter, 0x00, sizeof(ge_filter_s));
- if (ugd->file_type_mode == GE_FILE_T_IMAGE)
- g_strlcpy(filter.cond, GE_CONDITION_IMAGE,
- CONDITION_LENGTH);
- else if (ugd->file_type_mode == GE_FILE_T_VIDEO)
- g_strlcpy(filter.cond, GE_CONDITION_VIDEO,
- CONDITION_LENGTH);
- else
- g_strlcpy(filter.cond, GE_CONDITION_IMAGE_VIDEO,
- CONDITION_LENGTH);
- filter.sort_type = MEDIA_CONTENT_ORDER_DESC;
- g_strlcpy(filter.sort_keyword, MEDIA_DISPLAY_NAME,
- KEYWORD_LENGTH);
- filter.offset = GE_GET_ALL_RECORDS;
- filter.count = GE_GET_ALL_RECORDS;
- filter.with_meta = false;
-
- local_cnt = eina_list_count(list);
- ugd->cluster_list->local_cnt += local_cnt;
- }
- ge_dbg("Local albums count: %d", local_cnt);
- }
- /* Need to get albums again from local album */
- if (type == GE_ALBUM_DATA_NONE) {
- data_type = GE_ALBUM_DATA_LOCAL;
- if (local_cnt == GE_ALBUMS_FIRST_COUNT) {
- ge_dbg("8 albums got");
- b_8_albums_got = true;
- } else {
- b_8_albums_got = false;
- }
- }
-
- Eina_List *clist = ugd->cluster_list->clist;
- EINA_LIST_FREE(list, album) {
- if (album == NULL || album->uuid == NULL) {
- /* Invalid data, next one */
- ge_dbgE("Invalid ge_album_s!");
- continue;
- }
- ge_sdbg("Cluster ID: %s.", album->uuid);
-
- err = _ge_local_data_get_media_count(album->uuid,
- &filter,
- &medias_cnt);
- if (err == 0 && medias_cnt > 0) {
- album->count = medias_cnt;
- all_local_cnt += medias_cnt;
- } else {
- ge_dbgW("local album is empty!");
- _ge_data_type_free_geitem((void **)&album);
- continue;
- }
- gcluster = _ge_data_util_calloc_cluster();
- if (gcluster == NULL) {
- ge_dbgE("_ge_data_util_calloc_cluster failed!");
- _ge_data_type_free_geitem((void **)&album);
- continue;
- }
-
- gcluster->cluster = album;
- gcluster->ugd = ugd;
- length += album->count;
-
- clist = eina_list_append(clist, gcluster);
- if (type == GE_ALBUM_DATA_NONE) {
- if (_ge_data_is_camera_album(album)) {
- /*if (_ge_data_check_root_type(album->path, GE_ROOT_PATH_PHONE))
- camera_cluster = gcluster;
- else MMC album
- camera_cluster = gcluster;*/
- camera_cluster = gcluster;
- }
- } else {
- if (ugd->cluster_list->append_cb) {
- ugd->cluster_list->append_cb(ugd, gcluster);
- }
- }
- ugd->cluster_list->clist = clist;
- }
- ge_dbgW("Get clusters Done[%d]!", all_local_cnt);
- if (type == GE_ALBUM_DATA_NONE && all_local_cnt) {
- /* Create "All" album if any file exists */
- gcluster = _ge_data_util_new_cluster_all(ugd, all_local_cnt);
- GE_CHECK_VAL(gcluster, -1);
-
- if (camera_cluster) {
- clist = eina_list_append_relative(clist, gcluster,
- camera_cluster);
- } else {
- clist = eina_list_prepend(clist, gcluster);
- }
-
- ugd->cluster_list->clist = clist;
- ge_dbg("<All albums> added!");
- } else if (type == GE_ALBUM_DATA_NONE && b_8_albums_got) {
- ge_dbgW("Again!");
- goto GE_DATA_AGAIN;
- }
-
- _ge_data_check_sel_items(ugd);
- ugd->cluster_list->data_type = data_type;
- return data_type;
-}
-
-int _ge_data_get_cluster(ge_ugdata *ugd, char *uuid, ge_cluster **cluster)
-{
- GE_CHECK_VAL(cluster, -1);
- GE_CHECK_VAL(uuid, -1);
- GE_CHECK_VAL(ugd, -1);
- int ret = -1;
- *cluster = NULL;
- ge_cluster *_cluster = NULL;
-
- if (!g_strcmp0(uuid, GE_ALBUM_ALL_ID)) {
- int cnt = 0;
- ret = _ge_data_get_item_cnt(ugd, GE_ALBUM_ALL_ID, GE_ALL, &cnt);
- _cluster = _ge_data_util_new_cluster_all(ugd, cnt);
- } else {
- ge_album_s *mcluster = NULL;
- ret = _ge_local_data_get_album_by_id(ugd->slideshow_album_id,
- &mcluster);
- if (ret < 0 || mcluster == NULL) {
- if (mcluster) {
- _ge_data_type_free_geitem((void **)&mcluster);
- }
- return -1;
- }
-
- _cluster = _ge_data_util_calloc_cluster();
- if (_cluster == NULL) {
- ge_dbgE("_ge_data_util_calloc_cluster failed!");
- _ge_data_type_free_geitem((void **)&mcluster);
- return -1;
- }
-
- _cluster->cluster = mcluster;
- _cluster->ugd = ugd;
- }
-
- if (ret < 0 || _cluster == NULL) {
- if (_cluster) {
- _ge_data_util_free_cluster(_cluster);
- _cluster = NULL;
- }
- return -1;
- }
-
- *cluster = _cluster;
- return 0;
-}
-
-int _ge_data_free_cluster(ge_cluster *cluster)
-{
- return _ge_data_util_free_cluster(cluster);
-}
-
-/* Clear items list */
-int _ge_data_free_medias(Eina_List **elist)
-{
- if (elist == NULL || *elist == NULL) {
- return -1;
- }
- ge_item *gitem = NULL;
- ge_dbg("Clear medias");
- EINA_LIST_FREE(*elist, gitem) {
- _ge_data_util_free_geitem(gitem);
- gitem = NULL;
- }
- return 0;
-}
-
-int _ge_data_get_medias(ge_ugdata *ugd, char *uuid, int type, int start_pos,
- int end_pos, Eina_List **pmedias_elist,
- ge_restore_selected_cb restore_cb, Eina_List *sel_id)
+int _ge_data_get_medias(ge_ugdata * ugd, char *uuid, int type,
+ int start_pos, int end_pos,
+ Eina_List ** pmedias_elist,
+ ge_restore_selected_cb restore_cb,
+ Eina_List * sel_id)
{
GE_CHECK_VAL(pmedias_elist, -1);
GE_CHECK_VAL(ugd, -1);
ge_dbg("--start_pos[%d], end_pos[%d]--", start_pos, end_pos);
if (ugd->file_type_mode == GE_FILE_T_IMAGE) {
g_strlcpy(filter.cond, GE_CONDITION_IMAGE, CONDITION_LENGTH);
- } else if (ugd->file_type_mode == GE_FILE_T_VIDEO) {
- g_strlcpy(filter.cond, GE_CONDITION_VIDEO, CONDITION_LENGTH);
} else {
- g_strlcpy(filter.cond, GE_CONDITION_IMAGE_VIDEO,
- CONDITION_LENGTH);
+ g_strlcpy(filter.cond, GE_CONDITION_IMAGE_VIDEO, CONDITION_LENGTH);
}
filter.collate_type = MEDIA_CONTENT_COLLATE_NOCASE;
ge_dbg("--Album All--");
- err = _ge_local_data_get_all_albums_media_list(&filter,
- &itemlist);
+ err = _ge_local_data_get_all_albums_media_list(&filter, &itemlist);
if ((err == 0) && (itemlist != NULL)) {
ge_media_s *item = NULL;
- ge_item* gitem = NULL;
+ ge_item *gitem = NULL;
EINA_LIST_FREE(itemlist, item) {
if (item == NULL || item->uuid == NULL) {
ge_dbgE("Invalid item!");
gitem = _ge_data_util_calloc_geitem();
if (gitem == NULL) {
ge_dbgE("_ge_data_util_calloc_geitem() failed");
- _ge_data_type_free_geitem((void **)&item);
+ _ge_data_type_free_geitem((void **) &item);
continue;
}
gitem->item = item;
gitem->ugd = ugd;
gitem->store_type = type;
- *pmedias_elist = eina_list_append(*pmedias_elist,
- gitem);
+ *pmedias_elist = eina_list_append(*pmedias_elist, gitem);
if (restore_cb && sel_id) {
restore_cb(sel_id, gitem);
return err;
}
-/* Update items list, especially used in thumbnails edit view */
-int _ge_data_update_medias(ge_ugdata *ugd, char *uuid, int type,
- Eina_List **pmedias_elist,
- ge_restore_selected_cb restore_cb,
- Eina_List *sel_id)
-{
- GE_CHECK_VAL(pmedias_elist, -1);
- GE_CHECK_VAL(uuid, -1);
- GE_CHECK_VAL(ugd, -1);
- Eina_List* itemlist = NULL;
- int err = -1;
- ge_sdbg("Update content of %s", uuid);
-
- ge_filter_s filter;
- memset(&filter, 0x00, sizeof(ge_filter_s));
- if (ugd->file_type_mode == GE_FILE_T_IMAGE) {
- g_strlcpy(filter.cond, GE_CONDITION_IMAGE, CONDITION_LENGTH);
- } else if (ugd->file_type_mode == GE_FILE_T_VIDEO) {
- g_strlcpy(filter.cond, GE_CONDITION_VIDEO, CONDITION_LENGTH);
- } else {
- g_strlcpy(filter.cond, GE_CONDITION_IMAGE_VIDEO,
- CONDITION_LENGTH);
- }
-
- filter.collate_type = MEDIA_CONTENT_COLLATE_NOCASE;
- filter.sort_type = MEDIA_CONTENT_ORDER_DESC;
- g_strlcpy(filter.sort_keyword, GE_CONDITION_ORDER, KEYWORD_LENGTH);
- filter.offset = GE_GET_ALL_RECORDS;
- filter.count = GE_GET_ALL_RECORDS;
- filter.with_meta = true;
-
- if (g_strcmp0(uuid, GE_ALBUM_ALL_ID)) {
- err = _ge_local_data_get_album_media_list(uuid, &filter,
- &itemlist);
- } else {
- err = _ge_local_data_get_all_albums_media_list(&filter,
- &itemlist);
- }
-
- if ((err != 0) || (itemlist == NULL)) {
- ge_dbgE("(err != 0) || (itemlist == NULL)");
- /* Free Mitems */
- if (itemlist) {
- _ge_data_util_free_mtype_items(&itemlist);
- }
- return err;
- }
-
- ge_media_s *item = NULL;
- ge_item* gitem = NULL;
- EINA_LIST_FREE(itemlist, item) {
- if (item == NULL || item->uuid == NULL) {
- ge_dbgE("Invalid item!");
- continue;
- }
- gitem = _ge_data_util_calloc_geitem();
- if (gitem == NULL) {
- ge_dbgE("_ge_data_util_calloc_geitem() failed");
- _ge_data_type_free_geitem((void **)&item);
- continue;
- }
-
- gitem->item = item;
- gitem->ugd = ugd;
- gitem->store_type = type;
- *pmedias_elist = eina_list_append(*pmedias_elist, gitem);
-
- if (restore_cb && sel_id) {
- restore_cb(sel_id, gitem);
- }
- item = NULL;
- gitem = NULL;
- }
-
- ge_dbg("medias_elist=%p", *pmedias_elist);
- return err;
-}
-
-int _ge_data_get_album_cover(ge_ugdata *ugd, ge_cluster *album,
- ge_item **pgitem, media_content_order_e sort_type)
-{
- GE_CHECK_VAL(pgitem, -1);
- GE_CHECK_VAL(album, -1);
- GE_CHECK_VAL(album->cluster, -1);
- GE_CHECK_VAL(album->cluster->uuid, -1);
- GE_CHECK_VAL(ugd, -1);
-
- Eina_List *item_list = NULL;
- ge_media_s *item = NULL;
- ge_item* gitem = NULL;
- int err = -1;
- ge_filter_s filter;
-
- memset(&filter, 0x00, sizeof(ge_filter_s));
- if (ugd->file_type_mode == GE_FILE_T_IMAGE) {
- g_strlcpy(filter.cond, GE_CONDITION_IMAGE, CONDITION_LENGTH);
- } else if (ugd->file_type_mode == GE_FILE_T_VIDEO) {
- g_strlcpy(filter.cond, GE_CONDITION_VIDEO, CONDITION_LENGTH);
- } else {
- g_strlcpy(filter.cond, GE_CONDITION_IMAGE_VIDEO,
- CONDITION_LENGTH);
- }
-
- filter.collate_type = MEDIA_CONTENT_COLLATE_NOCASE;
- filter.sort_type = sort_type;
- g_strlcpy(filter.sort_keyword, GE_CONDITION_ORDER, KEYWORD_LENGTH);
- filter.offset = 0;
- filter.count = 1;
- filter.with_meta = false;
-
- if (g_strcmp0(album->cluster->uuid, GE_ALBUM_ALL_ID)) {
- /*real album */
- err = _ge_local_data_get_album_cover(album->cluster->uuid,
- &filter, &item_list);
- if (err != 0 || item_list == NULL) {
- ge_dbgE("Get albums media list failed[%d]!", err);
- goto DB_FAILED;
- }
- } else {
- /* add "All" album */
- err = _ge_local_data_get_all_albums_cover(&filter, &item_list);
- if (err != 0 || item_list == NULL) {
- ge_dbgE("Get all albums media list failed[%d]!", err);
- goto DB_FAILED;
- }
- }
-
- EINA_LIST_FREE(item_list, item) {
- if (item == NULL) {
- ge_dbgE("Invalid ge_meida_s!");
- goto DB_FAILED;
- }
- gitem = _ge_data_util_calloc_geitem();
- if (gitem == NULL) {
- ge_dbgE("_ge_data_util_calloc_geitem failed!");
- _ge_data_type_free_geitem((void **)&item);
- goto DB_FAILED;
- }
- gitem->item = item;
- gitem->album = album;
- gitem->store_type = album->cluster->type;
- /* Update flag */
- if (ugd->cluster_list->b_updated &&
- !g_strcmp0(album->cluster->uuid, GE_ALBUM_ALL_ID)) {
- ge_dbgW("Update flag: last mtime!");
- ugd->cluster_list->b_updated = false;
- ugd->cluster_list->last_mtime = item->mtime;
- }
- *pgitem = gitem;
- break;
- }
-
- ge_sdbg("First items of [%s]", album->cluster->display_name);
- return 0;
-
-DB_FAILED:
-
- /* Free Mitems */
- if (item_list) {
- _ge_data_util_free_mtype_items(&item_list);
- }
- return -1;
-}
-
-int _ge_data_get_item_cnt(ge_ugdata *ugd, const char *cluster_id,
- int album_type, int *item_cnt)
+int _ge_data_get_item_cnt(ge_ugdata * ugd, const char *cluster_id,
+ int album_type, int *item_cnt)
{
GE_CHECK_VAL(item_cnt, -1);
GE_CHECK_VAL(ugd, -1);
filter.with_meta = false;
if (ugd->file_type_mode == GE_FILE_T_IMAGE) {
g_strlcpy(filter.cond, GE_CONDITION_IMAGE, CONDITION_LENGTH);
- } else if (ugd->file_type_mode == GE_FILE_T_VIDEO) {
- g_strlcpy(filter.cond, GE_CONDITION_VIDEO, CONDITION_LENGTH);
} else {
- g_strlcpy(filter.cond, GE_CONDITION_IMAGE_VIDEO,
- CONDITION_LENGTH);
+ g_strlcpy(filter.cond, GE_CONDITION_IMAGE_VIDEO, CONDITION_LENGTH);
}
GE_CHECK_VAL(cluster_id, -1);
if (album_type == GE_PHONE || album_type == GE_MMC) {
- /*It's normal album*/
+ /*It's normal album */
err = _ge_local_data_get_media_count(cluster_id, &filter,
- item_cnt);
+ item_cnt);
} else if (album_type == GE_ALL) {
/* All albums */
ge_dbg("All albums media count");
return 0;
}
-bool _ge_data_check_update(ge_ugdata *ugd)
-{
- GE_CHECK_FALSE(ugd);
- GE_CHECK_FALSE(ugd->cluster_list);
- int err = -1;
- Eina_List *item_list = NULL;
- ge_media_s *mitem = NULL;
- int cnt = 0;
- ge_filter_s filter;
-
- memset(&filter, 0x00, sizeof(ge_filter_s));
- filter.sort_type = MEDIA_CONTENT_ORDER_DESC;
- g_strlcpy(filter.sort_keyword, GE_CONDITION_ORDER, KEYWORD_LENGTH);
- filter.collate_type = MEDIA_CONTENT_COLLATE_NOCASE;
- filter.with_meta = false;
- filter.offset = GE_FIRST_VIEW_START_POS;
- filter.count = GE_GET_ONE_RECORD;
- if (ugd->file_type_mode == GE_FILE_T_IMAGE) {
- g_strlcpy(filter.cond, GE_CONDITION_IMAGE, CONDITION_LENGTH);
- } else if (ugd->file_type_mode == GE_FILE_T_VIDEO) {
- g_strlcpy(filter.cond, GE_CONDITION_VIDEO, CONDITION_LENGTH);
- } else
- g_strlcpy(filter.cond, GE_CONDITION_IMAGE_VIDEO,
- CONDITION_LENGTH);
-
- /* Get latest item */
- err = _ge_local_data_get_all_albums_media_list(&filter, &item_list);
- if (err != 0 || item_list == NULL) {
- goto DB_NEED_UPDATE;
- }
-
- mitem = eina_list_nth(item_list, 0);
- /* Compare modified time */
- if (mitem == NULL || mitem->mtime != ugd->cluster_list->last_mtime) {
- goto DB_NEED_UPDATE;
- }
-
- /* Get all medias count */
- err = _ge_data_get_item_cnt(ugd, GE_ALBUM_ALL_ID, GE_ALL, &cnt);
- if (err != 0) {
- goto DB_NEED_UPDATE;
- }
-
- /* Compare medias count */
- if (cnt != ugd->cluster_list->all_medias_cnt) {
- goto DB_NEED_UPDATE;
- }
-
- _ge_data_type_free_geitem((void **)&mitem);
- mitem = NULL;
- return false;
-
-DB_NEED_UPDATE:
-
- _ge_data_type_free_geitem((void **)&mitem);
- mitem = NULL;
- ge_dbgW("Need to update data and view!");
- return true;
-}
-
-int _ge_data_del_media_by_id(ge_ugdata* ugd, const char *media_id)
+int _ge_data_del_media_by_id(ge_ugdata * ugd, const char *media_id)
{
GE_CHECK_VAL(media_id, -1);
int ret = media_info_delete_from_db(media_id);
return 0;
}
-int _ge_data_free_selected_medias(Eina_List **elist)
-{
- if (elist && *elist) {
- ge_item* gitem = NULL;
- EINA_LIST_FREE(*elist, gitem) {
- if (gitem) {
- gitem->checked = false;
- }
- }
- *elist = NULL;
- }
- return 0;
-}
-
-/*
-* Check it's default album, Camera, Downloads
-*/
-bool _ge_data_is_default_album(const char *match_folder, ge_album_s *album)
-{
- GE_CHECK_FALSE(album);
- GE_CHECK_FALSE(album->display_name);
- GE_CHECK_FALSE(match_folder);
- int ret = -1;
-
- /* Name is 'Camera shot' and folder locates in Phone */
- ret = g_strcmp0(album->display_name, match_folder);
- if (ret == 0 && album->type == GE_PHONE) {
- ge_dbg("Full path: %s", album->path);
- /* Get parent directory */
- char *parent_path = ge_file_dir_get(album->path);
- GE_CHECK_FALSE(parent_path);
- ge_dbg("Parent path: %s", parent_path);
-
- /* Parent directory is same as Phone root path, it's default folder */
- ret = g_strcmp0(parent_path, GE_ROOT_PATH_PHONE);
- GE_FREE(parent_path);
-
- if (ret == 0) {
- ge_dbgW("Default folder!");
- return true;
- }
- }
-
- return false;
-}
-
-/*
-* Check it's default album camera
-*/
-bool _ge_data_is_camera_album(ge_album_s *mcluster)
-{
- GE_CHECK_FALSE(mcluster);
- GE_CHECK_FALSE(mcluster->display_name);
-
- /* Name is 'Camera' folder locates in Phone */
- if (!g_strcmp0(mcluster->display_name, GE_ALBUM_CAMERA_NAME)) {
- const char *root = NULL;
- if (mcluster->type == GE_PHONE) {
- root = GE_ROOT_PATH_PHONE;
- } else {
- root = GE_ROOT_PATH_MMC;
- }
-
- ge_dbg("Full path: %s", mcluster->path);
- char *parent_path = ge_file_dir_get(mcluster->path);
- GE_CHECK_FALSE(parent_path);
- ge_dbg("Parent path: %s.", parent_path);
-
- char *dcim_path = g_strdup_printf("%s/%s", root, GE_DCIM);
- if (dcim_path == NULL) {
- GE_GFREE(parent_path);
- return false;
- }
- /* And parent folder is Phone root path, it's default folder */
- bool ret = false;
- ret = !g_strcmp0(dcim_path, parent_path);
-
- GE_GFREE(dcim_path);
- GE_GFREE(parent_path);
- return ret;
- }
-
- return false;
-}
-
-bool _ge_data_check_root_type(const char *path, const char *root)
-{
- if (path == NULL || root == NULL) {
- return false;
- }
-
- if (!strncmp(root, path, strlen(root))) {
- ge_dbg("Root path: %s", path);
- return true;
- }
-
- return false;
-}
-
-bool _ge_data_is_root_path(const char *path)
-{
- GE_CHECK_FALSE(path);
-
- if (!g_strcmp0(GE_ROOT_PATH_PHONE, path) ||
- !g_strcmp0(GE_ROOT_PATH_MMC, path)) {
- ge_dbg("Root path: %s", path);
- return true;
- }
-
- return false;
-}
-
/* Creates a thumbnail image for given the media, asynchronously */
-int _ge_data_create_thumb(ge_media_s *item,
- media_thumbnail_completed_cb callback, void *data)
+int _ge_data_create_thumb(ge_media_s * item,
+ media_thumbnail_completed_cb callback,
+ void *data)
{
GE_CHECK_VAL(item, -1);
GE_CHECK_VAL(item->media_h, -1);
return 0;
}
-int _ge_data_cancel_thumb(ge_media_s *item)
-{
- GE_CHECK_VAL(item, -1);
- GE_CHECK_VAL(item->media_h, -1);
-
- media_info_cancel_thumbnail(item->media_h);
- item->b_create_thumb = false;
- return 0;
-}
-
-int _ge_data_restore_selected(Eina_List *sel_ids, ge_item *gitem)
-{
- GE_CHECK_VAL(gitem, -1);
- GE_CHECK_VAL(gitem->item, -1);
- ge_dbg("gitem->item->uuid:%s", gitem->item->uuid);
- if (sel_ids) {
- bool b_selected = false;
- b_selected = _ge_data_check_selected_id(sel_ids,
- gitem->item->uuid);
- if (b_selected) {
- ge_dbg("b_selected");
- b_selected = false;
- /* Set checkbox state */
- gitem->checked = true;
- }
- }
- return 0;
-}
-
-int _ge_data_init(ge_ugdata* ugd)
+int _ge_data_init(ge_ugdata * ugd)
{
ge_dbg("Connect to DB!");
GE_CHECK_VAL(ugd, -1);
return 0;
}
-int _ge_data_finalize(ge_ugdata* ugd)
+int _ge_data_finalize(ge_ugdata * ugd)
{
ge_dbg("Free memory and disconnect with DB!");
GE_CHECK_VAL(ugd, -1);
return 0;
}
-
/*
-* Copyright (c) 2000-2015 Samsung Electronics Co., Ltd All Rights Reserved
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*
-*/
+ * Copyright (c) 2015 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://floralicense.org/license/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
#include <stdio.h>
#include <media_content.h>
#include "ge-local-data.h"
#include "ge-debug.h"
-static bool __ge_local_data_clone_album(media_folder_h folder, bool b_path,
- ge_album_s **palbum)
-{
- GE_CHECK_FALSE(folder);
- GE_CHECK_FALSE(palbum);
- ge_album_s *album = NULL;
-
- album = (ge_album_s *)calloc(1, sizeof(ge_album_s));
- if (album == NULL) {
- ge_dbgE("Failed to calloc!");
- return false;
- }
- album->gtype = GE_TYPE_ALBUM;
-
- if (b_path) {
- if (media_folder_get_path(folder, &(album->path)) != MEDIA_CONTENT_ERROR_NONE) {
- ge_dbgE("Get folder path failed!");
- goto GE_LOCAL_FAILED;
- }
- }
- if (media_folder_get_folder_id(folder, &(album->uuid)) != MEDIA_CONTENT_ERROR_NONE) {
- ge_dbgE("Get folder id failed!");
- goto GE_LOCAL_FAILED;
- }
- if (media_folder_get_modified_time(folder, &(album->mtime)) != MEDIA_CONTENT_ERROR_NONE) {
- ge_dbgE("Get modified time failed!");
- goto GE_LOCAL_FAILED;
- }
-
- media_content_storage_e storage_type;
- if (media_folder_get_storage_type(folder, &storage_type) != MEDIA_CONTENT_ERROR_NONE) {
- ge_dbgE("Get storage type failed!");
- goto GE_LOCAL_FAILED;
- }
-
- if (storage_type == MEDIA_CONTENT_STORAGE_INTERNAL) { /* The device's internal storage */
- album->type = GE_PHONE;
- } else if (storage_type == MEDIA_CONTENT_STORAGE_EXTERNAL) { /* The device's external storage */
- album->type = GE_MMC;
- } else {
- ge_dbgE("Undefined mode[%d]!", storage_type);
- }
-
- if (media_folder_get_name(folder, &(album->display_name)) != MEDIA_CONTENT_ERROR_NONE) {
- ge_dbgE("Get folder name failed!");
- goto GE_LOCAL_FAILED;
- }
-
- *palbum = album;
- return true;
-
-GE_LOCAL_FAILED:
-
- _ge_data_type_free_geitem((void **)(&album));
- *palbum = NULL;
- return false;
-}
-
-static bool __ge_local_data_get_album_list_cb(media_folder_h folder,
- void *data)
-{
- GE_CHECK_FALSE(data);
- ge_transfer_data_s *tmp_data = (ge_transfer_data_s *)data;
- GE_CHECK_FALSE(tmp_data->userdata);
- GE_CHECK_FALSE(folder);
- Eina_List **elist = (Eina_List **)(tmp_data->userdata);
- ge_album_s *album = NULL;
-
- char *path = NULL;
- if (media_folder_get_path(folder, &path) != MEDIA_CONTENT_ERROR_NONE) {
- ge_dbgE("Get folder path failed!");
- return false;
- }
- GE_CHECK_FALSE(path);
-
- if (tmp_data->list_type != GE_ALBUM_LIST_PATH) {
- if (!g_strcmp0(GE_CAMERA_PATH_PHONE, path) ||
- !g_strcmp0(GE_CAMERA_PATH_MMC, path) ||
- !g_strcmp0(GE_DOWNLOADS_PATH, path)) {
- ge_dbgW("Camera or Downloads!");
- GE_FREE(path);
- return true;
- }
- }
-
- __ge_local_data_clone_album(folder, false, &album);
- if (album == NULL) {
- GE_FREE(path);
- ge_dbgE("Failed clone album!");
- return false;
- }
- album->path = path;
-
- *elist = eina_list_append(*elist, album);
- return true;
-}
-
-static bool __ge_local_data_get_media_list_cb(media_info_h media, void *data)
+static bool __ge_local_data_get_media_list_cb(media_info_h media,
+ void *data)
{
GE_CHECK_FALSE(data);
- ge_transfer_data_s *td = (ge_transfer_data_s *)data;
+ ge_transfer_data_s *td = (ge_transfer_data_s *) data;
GE_CHECK_FALSE(td->userdata);
GE_CHECK_FALSE(media);
ge_media_s *item = NULL;
- Eina_List **elist = (Eina_List **)(td->userdata);
+ Eina_List **elist = (Eina_List **) (td->userdata);
if (_ge_data_util_clone_media(media, &item, td->with_meta)) {
*elist = eina_list_append(*elist, item);
}
}
-static bool __ge_local_data_get_cover_cb(media_info_h media, void *data)
-{
- GE_CHECK_FALSE(data);
- GE_CHECK_FALSE(media);
- Eina_List **elist = (Eina_List **)data;
- ge_media_s *item = NULL;
-
- item = (ge_media_s *)calloc(1, sizeof(ge_media_s));
- GE_CHECK_FALSE(item);
- item->gtype = GE_TYPE_MEDIA;
-
- if (media_info_clone(&(item->media_h), media) != MEDIA_CONTENT_ERROR_NONE) {
- ge_dbgE("Clone media handle error");
- goto GE_LOCAL_FAILED;
- }
- if (media_info_get_file_path(media, &(item->file_url)) != MEDIA_CONTENT_ERROR_NONE) {
- ge_dbgE("Get media file path error");
- goto GE_LOCAL_FAILED;
- }
- if (media_info_get_media_type(media, (media_content_type_e *)&(item->type)) != MEDIA_CONTENT_ERROR_NONE) {
- ge_dbgE("Get media type error");
- goto GE_LOCAL_FAILED;
- }
- if (media_info_get_thumbnail_path(media, &(item->thumb_url)) != MEDIA_CONTENT_ERROR_NONE) {
- ge_dbgE("Get media thumbnail path error");
- goto GE_LOCAL_FAILED;
- }
- ge_sdbg("thumb_url: %s", item->thumb_url);
- *elist = eina_list_append(*elist, item);
- return true;
-
-GE_LOCAL_FAILED:
-
- _ge_data_type_free_geitem((void **)(&item));
- return false;
-}
-
int _ge_local_data_connect(void)
{
int ret = -1;
}
}
-int _ge_local_data_get_media_by_id(char *media_id, ge_media_s **mitem)
-{
- GE_CHECK_VAL(mitem, -1);
-
- if (media_id == NULL) {
- //ge_dbg("Create a empty media");
- _ge_data_type_new_media(mitem);
- return 0;
- }
-
- int ret = -1;
- Eina_List *list = NULL;
- ge_media_s *_mitem = NULL;
- media_info_h media_h = NULL;
- int i = 0;
- ge_sdbg("media id: %s", media_id);
-
- ret = media_info_get_media_from_db(media_id, &media_h);
- if (ret != MEDIA_CONTENT_ERROR_NONE || media_h == NULL) {
- ge_dbgE("Failed to get media handle[%d]!", ret);
- if (media_h) {
- media_info_destroy(media_h);
- }
- return -1;
- }
-
- ge_transfer_data_s tran_data;
- memset(&tran_data, 0x00, sizeof(ge_transfer_data_s));
- tran_data.userdata = (void **)&list;
- tran_data.album_id = NULL;
- tran_data.with_meta = false;
-
- bool b_ret = __ge_local_data_get_media_list_cb(media_h, &tran_data);
-
- media_info_destroy(media_h);
-
- if (b_ret && list) {
- *mitem = eina_list_nth(list, 0);
- i = 1;
- ret = 0;
- } else {
- ge_dbgE("Failed to get media list!");
- ret = -1;
- }
-
- /* Free other items */
- if (list) {
- int len = eina_list_count(list);
- ge_dbg("len: %d", len);
-
- for (; i < len; i++) {
- _mitem = eina_list_nth(list, i);
- _ge_data_type_free_geitem((void **)(&_mitem));
- }
-
- eina_list_free(list);
- }
-
- return ret;
-}
-
-int _ge_local_data_get_album_by_path(char *path, ge_album_s **album)
-{
- GE_CHECK_VAL(path, -1);
- GE_CHECK_VAL(album, -1);
- int ret = -1;
- Eina_List *list = NULL;
- ge_filter_s condition;
- ge_album_s *_item = NULL;
- int i = 0;
-
- if (strlen(path) <= 0) {
- ge_dbgE("Invalid path!");
- return -1;
- }
- ge_dbg("path: %s", path);
-
- memset(&condition, 0x00, sizeof(ge_filter_s));
- condition.collate_type = MEDIA_CONTENT_COLLATE_NOCASE;
- condition.sort_type = MEDIA_CONTENT_ORDER_DESC;
- condition.offset = -1;
- condition.count = -1;
- condition.with_meta = false;
- condition.list_type = GE_ALBUM_LIST_PATH;
-
- snprintf(condition.cond, CONDITION_LENGTH, "%s AND %s=\'%s\'",
- GE_CONDITION_IMAGE_VIDEO, FOLDER_PATH, path);
-
- ret = _ge_local_data_get_album_list(&condition, &list);
- if (ret != 0 || NULL == list) {
- ge_dbgE("Failed to get album list[%d]!", ret);
- ret = -1;
- } else if (NULL != list) {
- *album = eina_list_nth(list, 0);
- i = 1;
- ret = 0;
- }
-
- /* Free other items */
- if (list) {
- int len = eina_list_count(list);
- ge_dbg("len: %d", len);
-
- for (; i < len; i++) {
- _item = eina_list_nth(list, i);
- _ge_data_type_free_geitem((void **)(&_item));
- }
-
- eina_list_free(list);
- }
-
- return ret;
-}
-
-int _ge_local_data_get_album_list(ge_filter_s *condition, Eina_List **elilst)
-{
- GE_CHECK_VAL(elilst, -1);
- GE_CHECK_VAL(condition, -1);
- int ret = -1;
- filter_h filter = NULL;
-
- ret = _ge_data_util_create_filter(condition, &filter);
- if (ret != 0) {
- ge_dbgE("Create filter failed[%d]!", ret);
- return -1;
- }
-
- ge_transfer_data_s tran_data;
- memset(&tran_data, 0x00, sizeof(ge_transfer_data_s));
- tran_data.userdata = (void **)elilst;
- tran_data.album_id = NULL;
- tran_data.with_meta = false;
- tran_data.list_type = condition->list_type;
-
- ge_dbg("Get folders--start");
- ret = media_folder_foreach_folder_from_db(filter,
- __ge_local_data_get_album_list_cb,
- &tran_data);
- ge_dbg("Get folders--over");
-
- _ge_data_util_destroy_filter(filter);
-
- if (ret != MEDIA_CONTENT_ERROR_NONE) {
- ge_dbgE("Get folders failed[%d]!", ret);
- return -1;
- }
-
- return 0;
-}
-
-int _ge_local_data_get_media_count(const char *cluster_id, ge_filter_s *condition,
- int *item_cnt)
+int _ge_local_data_get_media_count(const char *cluster_id,
+ ge_filter_s * condition, int *item_cnt)
{
GE_CHECK_VAL(cluster_id, -1);
GE_CHECK_VAL(condition, -1);
ge_dbg("Get media count--start");
ret = media_folder_get_media_count_from_db(cluster_id, filter,
- item_cnt);
+ item_cnt);
ge_dbg("Get media count--over");
_ge_data_util_destroy_filter(filter);
return 0;
}
-int _ge_local_data_get_all_media_count(ge_filter_s *condtion, int *item_cnt)
+int _ge_local_data_get_all_media_count(ge_filter_s * condtion,
+ int *item_cnt)
{
GE_CHECK_VAL(condtion, -1);
GE_CHECK_VAL(item_cnt, -1);
return 0;
}
-int _ge_local_data_get_media(const char *media_id, ge_media_s **mitem)
-{
- GE_CHECK_VAL(mitem, -1);
-
- if (media_id == NULL) {
- ge_dbg("Create a empty media");
- _ge_data_type_new_media(mitem);
- return 0;
- }
-
- int ret = -1;
- Eina_List *list = NULL;
- ge_media_s *_mitem = NULL;
- int i = 0;
-
- ge_sdbg("media id: %s", media_id);
- media_info_h media_h = NULL;
-
- ret = media_info_get_media_from_db(media_id, &media_h);
- if (ret != MEDIA_CONTENT_ERROR_NONE) {
- ge_dbgE("Get media handle failed[%d]!", ret);
- if (media_h) {
- media_info_destroy(media_h);
- }
- return -1;
- }
-
- ge_transfer_data_s tran_data;
- memset(&tran_data, 0x00, sizeof(ge_transfer_data_s));
- tran_data.userdata = (void **)&list;
- tran_data.album_id = NULL;
- tran_data.with_meta = false;
-
- ge_dbg("Get media list--start");
- bool b_ret = __ge_local_data_get_media_list_cb(media_h, &tran_data);
- ge_dbg("Get media list--over");
-
- media_info_destroy(media_h);
-
- if (b_ret && list) {
- *mitem = eina_list_nth(list, 0);
- i = 1;
- ret = 0;
- } else {
- ge_dbgE("Failed to get media list!");
- ret = -1;
- }
-
- /* Free other items */
- if (list) {
- int len = eina_list_count(list);
- ge_dbg("len: %d", len);
-
- for (; i < len; i++) {
- _mitem = eina_list_nth(list, i);
- _ge_data_type_free_geitem((void **)(&_mitem));
- }
-
- eina_list_free(list);
- }
-
- return ret;
-}
-
-int _ge_local_data_get_album_cover(char *album_id, ge_filter_s *condition,
- Eina_List **elist)
-{
- GE_CHECK_VAL(elist, -1);
- GE_CHECK_VAL(album_id, -1);
- GE_CHECK_VAL(condition, -1);
- int ret = -1;
- filter_h filter = NULL;
-
- ret = _ge_data_util_create_filter(condition, &filter);
- if (ret != 0) {
- ge_dbgE("Create filter failed!");
- return -1;
- }
-
- ge_dbg("Get medias--start");
- ret = media_folder_foreach_media_from_db(album_id, filter,
- __ge_local_data_get_cover_cb,
- elist);
- ge_dbg("Get medias--over");
-
- _ge_data_util_destroy_filter(filter);
-
- if (ret != MEDIA_CONTENT_ERROR_NONE) {
- ge_dbgE("Get medias failed[d]!", ret);
- return -1;
- }
-
- return 0;
-}
-
-int _ge_local_data_get_all_albums_cover(ge_filter_s *condition,
- Eina_List **elist)
-{
- GE_CHECK_VAL(elist, -1);
- GE_CHECK_VAL(condition, -1);
- int ret = -1;
- filter_h filter = NULL;
-
- ret = _ge_data_util_create_filter(condition, &filter);
- if (ret != 0) {
- ge_dbgE("Create filter failed!");
- return -1;
- }
-
- ge_dbg("Get all medias--start");
- ret = media_info_foreach_media_from_db(filter,
- __ge_local_data_get_cover_cb,
- elist);
- ge_dbg("Get all medias--over");
-
- _ge_data_util_destroy_filter(filter);
-
- if (ret != MEDIA_CONTENT_ERROR_NONE) {
- ge_dbgE("Get all medias failed[d]!", ret);
- return -1;
- }
-
- return 0;
-}
-
-int _ge_local_data_get_album_media_list(char *album_id, ge_filter_s *condition,
- Eina_List **elist)
-{
- GE_CHECK_VAL(elist, -1);
- GE_CHECK_VAL(album_id, -1);
- GE_CHECK_VAL(condition, -1);
- int ret = -1;
- filter_h filter = NULL;
-
- ret = _ge_data_util_create_filter(condition, &filter);
- if (ret != 0) {
- ge_dbgE("Create filter failed!");
- return -1;
- }
-
- ge_transfer_data_s tran_data;
- memset(&tran_data, 0x00, sizeof(ge_transfer_data_s));
- tran_data.userdata = (void **)elist;
- tran_data.album_id = album_id;
- tran_data.with_meta = condition->with_meta;
-
- ge_dbg("Get medias--start");
- ret = media_folder_foreach_media_from_db(album_id, filter,
- __ge_local_data_get_media_list_cb,
- &tran_data);
- ge_dbg("Get medias--over");
-
- _ge_data_util_destroy_filter(filter);
-
- if (ret != MEDIA_CONTENT_ERROR_NONE) {
- ge_dbgE("Get medias failed[d]!", ret);
- return -1;
- }
-
- return 0;
-}
-
-int _ge_local_data_get_all_albums_media_list(ge_filter_s *condition,
- Eina_List **elist)
+int _ge_local_data_get_all_albums_media_list(ge_filter_s * condition,
+ Eina_List ** elist)
{
GE_CHECK_VAL(elist, -1);
GE_CHECK_VAL(condition, -1);
ge_transfer_data_s tran_data;
memset(&tran_data, 0x00, sizeof(ge_transfer_data_s));
- tran_data.userdata = (void **)elist;
+ tran_data.userdata = (void **) elist;
tran_data.album_id = NULL;
tran_data.with_meta = condition->with_meta;
ge_dbg("Get all medias--start");
ret = media_info_foreach_media_from_db(filter,
- __ge_local_data_get_media_list_cb,
- &tran_data);
+ __ge_local_data_get_media_list_cb,
+ &tran_data);
ge_dbg("Get all medias--over");
_ge_data_util_destroy_filter(filter);
return 0;
}
-
-int _ge_local_data_get_album_by_id(char *album_id, ge_album_s **cluster)
-{
- GE_CHECK_VAL(cluster, -1);
- GE_CHECK_VAL(album_id, -1);
- media_folder_h folder_h = NULL;
-
- if (media_folder_get_folder_from_db(album_id, &folder_h) != MEDIA_CONTENT_ERROR_NONE) {
- ge_sdbgE("Failed to get album[%s]!", album_id);
- if (folder_h) {
- media_folder_destroy(folder_h);
- }
- return -1;
- }
- if (folder_h == NULL) {
- return -1;
- }
- if (!__ge_local_data_clone_album(folder_h, true, cluster)) {
- ge_sdbgE("Failed to clone album[%s]!", album_id);
- media_folder_destroy(folder_h);
- return -1;
- }
- media_folder_destroy(folder_h);
- return 0;
-}
-
-int _ge_local_data_get_duration(media_info_h media, int *duration)
-{
- GE_CHECK_VAL(duration, -1);
- GE_CHECK_VAL(media, -1);
- video_meta_h video_handle = NULL;
- int ret = -1;
-
- ret = media_info_get_video(media, &video_handle);
- if (ret != MEDIA_CONTENT_ERROR_NONE) {
- ge_dbgE("Failed to get video handle[%d]!", ret);
- return -1;
- }
-
- ret = video_meta_get_duration(video_handle, duration);
- if (ret != MEDIA_CONTENT_ERROR_NONE) {
- ge_dbgE("Get video duration failed[%d]!", ret);
- video_meta_destroy(video_handle);
- return -1;
- }
-
- video_meta_destroy(video_handle);
- return 0;
-}
-
/*
-* Copyright (c) 2000-2015 Samsung Electronics Co., Ltd All Rights Reserved
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*
-*/
+ * Copyright (c) 2015 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://floralicense.org/license/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
#ifndef UG_MODULE_API
#define UG_MODULE_API __attribute__ ((visibility("default")))
#include <app.h>
#include "gallery-efl.h"
#include "ge-albums.h"
-#include "ge-gridview.h"
#include "ge-data.h"
#include "ge-ui-util.h"
#include "ge-util.h"
#include "ge-db-update.h"
-#include "ge-ext-ug-load.h"
-#include "ge-lang.h"
#include "ge-main-view.h"
#define GE_BG_COLOR_DEFAULT 0
#define GE_BG_COLOR_A 255
-static int __ge_create_main_view(ge_ugdata *ugd)
+static int __ge_create_main_view(ge_ugdata * ugd)
{
GE_CHECK_VAL(ugd, -1);
GE_CHECK_VAL(ugd->naviframe, -1);
- if (ugd->file_select_mode == GE_FILE_SELECT_T_SLIDESHOW) {
- ge_dbgE("file select mode is slideshow>>>>>>> grid view");
- _ge_grid_create_main_view(ugd);
- } else {
-
- ge_dbgE("no slide show mode>>>>>>>>>");
- _ge_main_create_view(ugd);
- }
+ ge_dbgE("Creating main view");
+ _ge_main_create_view(ugd);
return 0;
}
-static Evas_Object *_ge_create_bg(Evas_Object *parent)
+static Evas_Object *_ge_create_bg(Evas_Object * parent)
{
ge_dbg("");
GE_CHECK_NULL(parent);
/* Show special color of background */
bg = evas_object_rectangle_add(evas_object_evas_get(parent));
evas_object_color_set(bg, GE_BG_COLOR_DEFAULT, GE_BG_COLOR_DEFAULT,
- GE_BG_COLOR_DEFAULT, GE_BG_COLOR_A);
+ GE_BG_COLOR_DEFAULT, GE_BG_COLOR_A);
evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND,
- EVAS_HINT_EXPAND);
+ EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(bg, EVAS_HINT_FILL, EVAS_HINT_FILL);
evas_object_show(bg);
* After we add window rotation callback to get rotation event as fast as possible,
* so view updating/rotation is invisible for user.
*/
-static void __ge_win_rot_changed_cb(void *data, Evas_Object *obj,
- void *event)
+static void __ge_win_rot_changed_cb(void *data, Evas_Object * obj,
+ void *event)
{
GE_CHECK(data);
GE_CHECK(obj);
- ge_ugdata *ugd = (ge_ugdata *)data;
+ ge_ugdata *ugd = (ge_ugdata *) data;
/* changed_ang value is 0 90 180 270 */
int changed_ang = elm_win_rotation_get(obj);
}
}
-static int _ge_init_view(ge_ugdata *ugd)
+static int _ge_init_view(ge_ugdata * ugd)
{
ge_dbg("");
GE_CHECK_VAL(ugd, -1);
return 0;
}
-static int _ge_create_view(ge_ugdata *ugd)
+static int _ge_create_view(ge_ugdata * ugd)
{
ge_dbg("");
GE_CHECK_VAL(ugd, -1);
return 0;
}
-void _ge_free_sel_info(ge_ugdata *ugd)
+void _ge_free_sel_info(ge_ugdata * ugd)
{
ge_dbg("Deleting selected media data");
GE_CHECK(ugd);
ge_dbg("Deleting selected media data done");
}
-void _ge_free_medias(ge_ugdata *ugd)
+void _ge_free_medias(ge_ugdata * ugd)
{
ge_dbg("Deleting media data");
GE_CHECK(ugd);
ge_dbg("Deleting media data done");
}
-void _ge_free_thumb_data(ge_ugdata *ugd)
+void _ge_free_thumb_data(ge_ugdata * ugd)
{
ge_dbg("Deleting thumb data");
GE_CHECK(ugd);
}
-static int _ge_close_view(ge_ugdata *ugd)
+static int _ge_close_view(ge_ugdata * ugd)
{
GE_CHECK_VAL(ugd, -1);
/************* Remove Callbacks **************/
GE_IF_DEL_TIMER(ugd->del_timer)
- /* Remove win rotation callback */
- evas_object_smart_callback_del(ugd->win, "wm,rotation,changed",
- __ge_win_rot_changed_cb);
+ /* Remove win rotation callback */
+ evas_object_smart_callback_del(ugd->win, "wm,rotation,changed",
+ __ge_win_rot_changed_cb);
ge_dereg_db_update_noti();
/************* Destroy UI objects **************/
ugd->ug_called_by_me = NULL;
}
GE_IF_DEL_OBJ(ugd->popup)
- GE_IF_DEL_OBJ(ugd->ly_main)
- if (ugd->th) {
+ GE_IF_DEL_OBJ(ugd->ly_main)
+ if (ugd->th) {
elm_theme_extension_del(ugd->th, GE_EDJ_FILE);
elm_theme_free(ugd->th);
ugd->th = NULL;
}
-#ifdef _USE_HIDE_INDICATOR
- _ge_ui_reset_indicator(ugd);
-#endif
/************* Free data **************/
if (ugd->service) {
GE_FREEIF(ugd->file_setas_crop_image_path);
GE_FREEIF(ugd->slideshow_album_id);
GE_FREEIF(ugd->ug_path);
- /*Finalize db update callback*/
+ /*Finalize db update callback */
_ge_db_update_finalize(ugd);
/* Disconnet with libmedia-info */
_ge_data_finalize(ugd);
return 0;
}
-static int __ge_parse_param_setas(ge_ugdata *ugd, app_control_h service)
-{
- GE_CHECK_VAL(ugd, -1);
- GE_CHECK_VAL(service, -1);
- char *setas_type = NULL;
-
- app_control_get_extra_data(service, GE_BUNDLE_SETAS_TYPE, &setas_type);
- if (setas_type == NULL) {
- ge_dbgW("setas-type NULL");
- return -1;
- }
-
- if (!strcasecmp(setas_type, GE_SETAS_WALLPAPER)) {
- ugd->file_select_setas_mode = GE_SETAS_T_WALLPAPER;
- } else if (!strcasecmp(setas_type, GE_SETAS_LOCKSCREEN)) {
- ugd->file_select_setas_mode = GE_SETAS_T_LOCKPAPER;
- } else if (!strcasecmp(setas_type, GE_SETAS_WALLPAPER_AND_LOCKSCREEN)) {
- ugd->file_select_setas_mode = GE_SETAS_T_WALLPAPER_LOCKPAPER;
- } else if (!strcasecmp(setas_type, GE_SETAS_CROP_WALLPAPER)) {
- ugd->file_select_setas_mode = GE_SETAS_T_CROP_WALLPAPER;
- } else if (!strcasecmp(setas_type, GE_SETAS_CALLERID)) {
- ugd->file_select_setas_mode = GE_SETAS_T_CALLERID;
- } else if (!strcasecmp(setas_type, "crop")) {
- ugd->file_select_setas_mode = GE_SETAS_T_CROP_WALLPAPER;
- }
- GE_FREE(setas_type);
- return 0;
-}
-
-static int __ge_parse_param_file(ge_ugdata *ugd, app_control_h service)
+static int __ge_parse_param_file(ge_ugdata * ugd, app_control_h service)
{
GE_CHECK_VAL(ugd, -1);
GE_CHECK_VAL(service, -1);
if (mime) {
if (!g_strcmp0(mime, GE_MIME_IMAGE_ALL)) {
ugd->file_type_mode = GE_FILE_T_IMAGE;
- } else if (!g_strcmp0(mime, GE_MIME_VIDEO_ALL)) {
- ugd->file_type_mode = GE_FILE_T_VIDEO;
} else {
ugd->file_type_mode = GE_FILE_T_ALL;
}
ugd->file_type_mode = GE_FILE_T_IMAGE;
GE_FREE(file_type);
return 0;
- } else if (!strcasecmp(file_type, GE_FILE_TYPE_VIDEO)) {
- ugd->file_type_mode = GE_FILE_T_VIDEO;
- GE_FREE(file_type);
- return 0;
}
GE_FREEIF(file_type);
-GE_DEFAULT_FILE_TYPE:
+ GE_DEFAULT_FILE_TYPE:
ge_dbg("file type is default, set default type(ALL).");
- ugd->file_type_mode = GE_FILE_T_ALL;
- return 0;
-}
-
-static int __ge_parse_param_slideshow(ge_ugdata *ugd, app_control_h service)
-{
- GE_CHECK_VAL(ugd, -1);
- GE_CHECK_VAL(service, -1);
- ugd->file_select_mode = GE_FILE_SELECT_T_SLIDESHOW;
- ugd->b_multifile = true;
- char *viewby = NULL;
- char *tmp = NULL;
-
- app_control_get_extra_data(service, "view-by", &viewby);
- if (viewby) {
- if (!strcasecmp(viewby, "all")) {
- ugd->slideshow_viewby = GE_VIEW_BY_ALL;
- ugd->slideshow_album_id = g_strdup(GE_ALBUM_ALL_ID);
- ge_sdbg("album id: %s", ugd->slideshow_album_id);
- } else if (!strcasecmp(viewby, "albums")) {
- ugd->slideshow_viewby = GE_VIEW_BY_ALBUMS;
- app_control_get_extra_data(service, "album-id", &tmp);
- if (tmp) {
- ugd->slideshow_album_id = g_strdup(tmp);
- GE_FREE(tmp);
- } else {
- ugd->slideshow_album_id = g_strdup(GE_ALBUM_ALL_ID);
- }
- ge_sdbg("album id: %s", ugd->slideshow_album_id);
- }
- GE_FREE(viewby);
- } else {
- ge_dbgW("vieweby does not exist! set viewby all as default");
- ugd->slideshow_viewby = GE_VIEW_BY_ALL;
- ugd->slideshow_album_id = g_strdup(GE_ALBUM_ALL_ID);
- }
-
- ge_sdbg("viewby: %d", ugd->slideshow_viewby);
+ ugd->file_type_mode = GE_FILE_T_IMAGE;
return 0;
}
/* analysis parameters */
-static int _ge_parse_param(ge_ugdata *ugd, app_control_h service)
+static int _ge_parse_param(ge_ugdata * ugd, app_control_h service)
{
GE_CHECK_VAL(ugd, -1);
GE_CHECK_VAL(service, -1);
app_control_get_operation(service, &operation);
ge_sdbg("operation [%s]", operation);
-#ifdef FEATURE_SIZE_CHECK
- char *total_size = NULL;
- int ret = app_control_get_extra_data(service, "http://tizen.org/appcontrol/data/total_size", &(total_size));
- if (ret != APP_CONTROL_ERROR_NONE) {
- if(total_size) {
- ugd->limitsize = atol(total_size);
- } else {
- ugd->limitsize = -1;
- }
+ char *total_size = NULL;
+ int ret =
+ app_control_get_extra_data(service, APP_CONTROL_DATA_TOTAL_SIZE,
+ &(total_size));
+ if (ret != APP_CONTROL_ERROR_NONE) {
+ if (total_size) {
+ ugd->limitsize = atol(total_size);
} else {
ugd->limitsize = -1;
}
-#endif
+ } else {
+ ugd->limitsize = -1;
+ }
app_control_get_extra_data(service, APP_CONTROL_DATA_SELECTION_MODE,
- &select_mode);
+ &select_mode);
if (select_mode) {
if (!strcasecmp(select_mode, GE_BUNDLE_SELECTION_MODE_SINGLE)) {
launch_type = strdup(GE_LAUNCH_SELECT_ONE);
- } else if (!strcasecmp(select_mode, GE_BUNDLE_SELECTION_MODE_MULTI)) {
+ } else
+ if (!strcasecmp(select_mode, GE_BUNDLE_SELECTION_MODE_MULTI)) {
launch_type = strdup(GE_LAUNCH_SELECT_MULTIPLE);
}
GE_FREE(select_mode);
}
if (launch_type == NULL) {
app_control_get_extra_data(service, GE_BUNDLE_LAUNCH_TYPE,
- &launch_type);
+ &launch_type);
}
if (launch_type == NULL) {
if (operation &&
- !strcasecmp(operation, APP_CONTROL_OPERATION_PICK)) {
+ !strcasecmp(operation, APP_CONTROL_OPERATION_PICK)) {
launch_type = strdup(GE_LAUNCH_SELECT_ONE);
ge_dbg("Set launch-type to default");
} else {
}
if (launch_type) {
ge_dbg("launch-type [%s]", launch_type);
- if (!strcasecmp(launch_type, GE_LAUNCH_SELECT_ALBUM)) {
- ugd->album_select_mode = GE_ALBUM_SELECT_T_ONE;
- } else if (!strcasecmp(launch_type, GE_LAUNCH_SELECT_SETAS)) {
- ugd->file_select_mode = GE_FILE_SELECT_T_SETAS;
- __ge_parse_param_setas(ugd, service);
- /* Checkme: Only image type is offered in SETAS case */
- ugd->file_type_mode = GE_FILE_T_IMAGE;
+ if (!strcasecmp(launch_type, GE_LAUNCH_SELECT_ONE)) {
+ ugd->file_select_mode = GE_FILE_SELECT_T_ONE;
+ } else if (!strcasecmp(launch_type, GE_LAUNCH_SELECT_MULTIPLE)) {
+ ugd->file_select_mode = GE_FILE_SELECT_T_MULTIPLE;
+ ugd->b_multifile = true;
} else {
- if (!strcasecmp(launch_type, GE_LAUNCH_SELECT_ONE)) {
- ugd->file_select_mode = GE_FILE_SELECT_T_ONE;
- } else if (!strcasecmp(launch_type, GE_LAUNCH_SELECT_MULTIPLE)) {
- ugd->file_select_mode = GE_FILE_SELECT_T_MULTIPLE;
- ugd->b_multifile = true;
- } else if (!strcasecmp(launch_type, GE_LAUNCH_SELECT_IMFT)) {
- ugd->file_select_mode = GE_FILE_SELECT_T_IMFT;
- ugd->b_multifile = true;
-
- char *contact_id = NULL;
- app_control_get_extra_data(service, "contact", &contact_id);
- if (contact_id) {
- ugd->file_select_contact_id = atoi(contact_id);
- GE_FREE(contact_id);
- } else {
- ugd->file_select_mode = GE_FILE_SELECT_T_NONE;
- ugd->file_select_contact_id = -1;
- ge_dbg("Invalid args");
- GE_FREEIF(operation);
- GE_FREEIF(launch_type);
- return -1;
- }
-
- ge_sdbg("contact_id: %d", ugd->file_select_contact_id);
- } else if (!strcasecmp(launch_type, GE_LAUNCH_SELECT_SLIDESHOW)) {
- __ge_parse_param_slideshow(ugd, service);
- } else {
- ge_dbgE("Wrong launch type!");
- }
-
- __ge_parse_param_file(ugd, service);
+ ge_dbgE("Wrong launch type!");
}
+
+ __ge_parse_param_file(ugd, service);
} else {
//using default values
ge_dbg("Set launch-type to default");
ugd->max_count = -1;
char *max_cnt = NULL;
- app_control_get_extra_data(service, APP_CONTROL_DATA_TOTAL_COUNT, &max_cnt);
+ app_control_get_extra_data(service, APP_CONTROL_DATA_TOTAL_COUNT,
+ &max_cnt);
if (max_cnt) {
ugd->max_count = _ge_atoi(max_cnt);
GE_FREE(max_cnt);
return 0;
}
-static int __ge_get_rotate_value(ge_ugdata *ugd)
+static int __ge_get_rotate_value(ge_ugdata * ugd)
{
GE_CHECK_VAL(ugd, -1);
GE_CHECK_VAL(ugd->win, -1);
*
* @return
*/
-static void * _ge_create(ui_gadget_h ug, enum ug_mode mode, app_control_h service, void *priv)
+static void *_ge_create(ui_gadget_h ug, enum ug_mode mode,
+ app_control_h service, void *priv)
{
ge_dbg("Enter...");
ge_ugdata *ugd = NULL;
GE_CHECK_NULL(ug);
ge_dbgW("Gallery UG start...");
- ugd = (ge_ugdata *)priv;
+ ugd = (ge_ugdata *) priv;
ugd->ug = ug;
ugd->attach_panel_display_mode = ATTACH_PANEL_NONE;
/* Get window */
- ugd->win = (Evas_Object *)ug_get_window();
+ ugd->win = (Evas_Object *) ug_get_window();
GE_CHECK_NULL(ugd->win);
/* Get conformant */
ugd->conform = ug_get_conformant();
GE_CHECK_NULL(ugd->conform);
/* Get caller layout */
- ugd->ly_parent = (Evas_Object *)ug_get_parent_layout(ug);
+ ugd->ly_parent = (Evas_Object *) ug_get_parent_layout(ug);
GE_CHECK_NULL(ugd->ly_parent);
/* Bind text domain for internalization */
- bindtextdomain("attach-panel-gallery" , "/usr/ug/res/locale");
+ bindtextdomain("attach-panel-gallery", "/usr/ug/res/locale");
/* Reset inited flag, it would be set as TRUE if albums view created */
_ge_ui_get_indicator_state(ugd);
-#ifdef _USE_HIDE_INDICATOR
- _ge_ui_hide_indicator(ugd);
-#endif
/* Add window rotation callback to rotate view as fast as possible */
evas_object_smart_callback_add(ugd->win, "wm,rotation,changed",
- __ge_win_rot_changed_cb, (void *)ugd);
+ __ge_win_rot_changed_cb, (void *) ugd);
__ge_get_rotate_value(ugd);
app_control_clone(&(ugd->service), service);
if (_ge_data_init(ugd) != 0) {
ge_dbgE("_ge_data_init failed!");
}
- /*Register db udpate callback*/
+ /*Register db udpate callback */
_ge_db_update_reg_cb(ugd);
/* Parse parameters passed from parent */
if (_ge_parse_param(ugd, service) != 0) {
ge_dbgE("Failed to parse parameters!");
- ug_send_result_full(ugd->ug, ugd->service, APP_CONTROL_RESULT_FAILED);
+ ug_send_result_full(ugd->ug, ugd->service,
+ APP_CONTROL_RESULT_FAILED);
return NULL;
}
char *contact_id = NULL;
ge_dbg("Normal mode");
}
if ((ugd->file_select_mode != GE_FILE_SELECT_T_NONE) ||
- (ugd->album_select_mode != GE_ALBUM_SELECT_T_NONE)) {
+ (ugd->album_select_mode != GE_ALBUM_SELECT_T_NONE)) {
/* create gallery UG */
if (_ge_create_view(ugd) != 0) {
ge_dbgE("Failed to create Gallery UG view!");
}
} else {
ge_dbgE("Wrong file_select_mode[%d] or album_select_mode[%d]",
- ugd->file_select_mode, ugd->album_select_mode);
+ ugd->file_select_mode, ugd->album_select_mode);
}
return ugd->ly_main;
{
ge_dbg("");
GE_CHECK(priv);
- ge_ugdata *ugd = (ge_ugdata *)priv;
+ ge_ugdata *ugd = (ge_ugdata *) priv;
if (ugd->ug_launched) {
__ge_grid_reset_view(ugd);
ugd->ug_launched = false;
ge_dbgW("");
GE_CHECK(ug);
GE_CHECK(priv);
- _ge_close_view((ge_ugdata *)priv);
+ _ge_close_view((ge_ugdata *) priv);
ge_dbgW("Destroy gallery UG done!");
}
* @param data
* @param priv
*/
-static void _ge_message(ui_gadget_h ug, app_control_h msg, app_control_h service, void *priv)
+static void _ge_message(ui_gadget_h ug, app_control_h msg,
+ app_control_h service, void *priv)
{
ge_dbg("");
GE_CHECK(priv);
- ge_ugdata *ugd = (ge_ugdata *)priv;
+ ge_ugdata *ugd = (ge_ugdata *) priv;
char *display_mode = NULL;
char *initialized_mode = NULL;
char *pd_selected = GE_STR_PD_SELECTED;
elm_win_screen_size_get(ugd->win, &win_x, &win_y, &win_w, &win_h);
if (ugd->is_attach_panel) {
ge_dbg("called by attach panel ");
- app_control_get_extra_data(msg, APP_CONTROL_DATA_SELECTION_MODE, &display_mode);
- app_control_get_extra_data(msg, "__ATTACH_PANEL_INITIALIZE__", &initialized_mode);
+ app_control_get_extra_data(msg, APP_CONTROL_DATA_SELECTION_MODE,
+ &display_mode);
+ app_control_get_extra_data(msg, "__ATTACH_PANEL_INITIALIZE__",
+ &initialized_mode);
char *max_cnt = NULL;
- app_control_get_extra_data(msg, APP_CONTROL_DATA_TOTAL_COUNT, &max_cnt);
+ app_control_get_extra_data(msg, APP_CONTROL_DATA_TOTAL_COUNT,
+ &max_cnt);
if (max_cnt) {
ugd->max_count = _ge_atoi(max_cnt);
GE_FREE(max_cnt);
//change to single selection
ge_dbg("single_selection ");
if (ugd->nocontents) {
- elm_gengrid_item_size_set(ugd->thumbs_d->gengrid, win_w, win_h / 3);
+ elm_gengrid_item_size_set(ugd->thumbs_d->gengrid,
+ win_w, win_h / 3);
}
ugd->attach_panel_display_mode = ATTACH_PANEL_HALF_MODE;
ugd->file_select_mode = GE_FILE_SELECT_T_ONE;
elm_gengrid_realized_items_update(ugd->thumbs_d->gengrid);
- Eina_List *l = NULL;
- ge_item *gitem = NULL;
-
- EINA_LIST_FOREACH(ugd->thumbs_d->medias_elist, l, gitem) {
- if (gitem) {
- gitem->checked = false;
- }
- }
-
- _ge_free_sel_info(ugd);
-
- ugd->thumbs_d->tot_selected = 0;
- elm_naviframe_item_title_enabled_set(ugd->nf_it, EINA_FALSE, EINA_FALSE);
+ elm_naviframe_item_title_enabled_set(ugd->nf_it,
+ EINA_FALSE,
+ EINA_FALSE);
} else if (display_mode && !strcmp(display_mode, "multiple")) {
//change to multi selection
ge_dbg("multiple_selection");
if (ugd->nocontents) {
double scale = elm_config_scale_get();
- if (ugd->rotate_mode == GE_ROTATE_LANDSCAPE_UPSIDEDOWN || ugd->rotate_mode == GE_ROTATE_LANDSCAPE) {
+ if (ugd->rotate_mode == GE_ROTATE_LANDSCAPE_UPSIDEDOWN
+ || ugd->rotate_mode == GE_ROTATE_LANDSCAPE) {
if ((scale - 1.8) < 0.0001) {
- elm_gengrid_item_size_set(ugd->thumbs_d->gengrid, win_h, LANDSCAPE_HEIGHT_WVGA);
+ elm_gengrid_item_size_set(ugd->thumbs_d->
+ gengrid, win_h,
+ LANDSCAPE_HEIGHT_WVGA);
} else {
- elm_gengrid_item_size_set(ugd->thumbs_d->gengrid, win_h, LANDSCAPE_HEIGHT);
+ elm_gengrid_item_size_set(ugd->thumbs_d->
+ gengrid, win_h,
+ LANDSCAPE_HEIGHT);
}
} else {
if ((scale - 1.8) < 0.0001) {
- elm_gengrid_item_size_set(ugd->thumbs_d->gengrid, win_w, FULL_MODE_PORTRAIT_HEIGHT_WVGA);
+ elm_gengrid_item_size_set(ugd->thumbs_d->
+ gengrid, win_w,
+ FULL_MODE_PORTRAIT_HEIGHT_WVGA);
} else {
- elm_gengrid_item_size_set(ugd->thumbs_d->gengrid, win_w, FULL_MODE_PORTRAIT_HEIGHT);
+ elm_gengrid_item_size_set(ugd->thumbs_d->
+ gengrid, win_w,
+ FULL_MODE_PORTRAIT_HEIGHT);
}
}
}
elm_gengrid_realized_items_update(ugd->thumbs_d->gengrid);
- ugd->thumbs_d->tot_selected = eina_list_count(ugd->selected_elist);
+ ugd->thumbs_d->tot_selected =
+ eina_list_count(ugd->selected_elist);
- /*Update Title*/
- elm_naviframe_item_title_enabled_set(ugd->nf_it, EINA_TRUE, EINA_FALSE);
- text = g_strdup_printf(pd_selected, ugd->thumbs_d->tot_selected);
+ /*Update Title */
+ elm_naviframe_item_title_enabled_set(ugd->nf_it, EINA_TRUE,
+ EINA_FALSE);
+ text =
+ g_strdup_printf(pd_selected,
+ ugd->thumbs_d->tot_selected);
elm_object_item_text_set(ugd->nf_it, text);
GE_FREEIF(text);
/*Disable DONE Button if count is zero */
if (!ugd->thumbs_d->tot_selected) {
- btn = elm_object_item_part_content_get(ugd->nf_it , GE_NAVIFRAME_TITLE_RIGHT_BTN);
+ btn =
+ elm_object_item_part_content_get(ugd->nf_it,
+ GE_NAVIFRAME_TITLE_RIGHT_BTN);
if (btn == NULL) {
ge_dbgE("Failed to get part information");
}
}
} else if (initialized_mode) {
if (!strcmp(initialized_mode, "enable")) {
- if (_ge_is_grid_view(ugd)) {
- elm_naviframe_item_pop(ugd->naviframe);
- } else {
- ge_dbg("Album view");
- }
elm_naviframe_item_pop(ugd->naviframe);
elm_gengrid_realized_items_update(ugd->albums_view);
}
* @param data
* @param priv
*/
-static void _ge_event(ui_gadget_h ug, enum ug_event event, app_control_h service, void *priv)
+static void _ge_event(ui_gadget_h ug, enum ug_event event,
+ app_control_h service, void *priv)
{
GE_CHECK(priv);
- ge_ugdata *ugd = (ge_ugdata *)priv;
+ ge_ugdata *ugd = (ge_ugdata *) priv;
switch (event) {
case UG_EVENT_LOW_MEMORY:
case UG_EVENT_LANG_CHANGE:
ge_dbg("UG_EVENT_LANG_CHANGE");
- _ge_lang_update(ugd);
break;
case UG_EVENT_ROTATE_PORTRAIT:
return;
-UG_ROTATE_EVENT:
+ UG_ROTATE_EVENT:
/* Update rotate mode and view */
ge_dbg("rotate_mode: %d", ugd->rotate_mode);
int size = (win_w / 4);
int landscape_size = (win_h / 7);
- if (ugd->rotate_mode == GE_ROTATE_LANDSCAPE_UPSIDEDOWN || ugd->rotate_mode == GE_ROTATE_LANDSCAPE) {
+ if (ugd->rotate_mode == GE_ROTATE_LANDSCAPE_UPSIDEDOWN
+ || ugd->rotate_mode == GE_ROTATE_LANDSCAPE) {
if (ugd->nocontents) {
double scale = elm_config_scale_get();
if ((scale - 1.8) < 0.0001) {
- elm_gengrid_item_size_set(ugd->thumbs_d->gengrid, win_h, LANDSCAPE_HEIGHT_WVGA);
+ elm_gengrid_item_size_set(ugd->thumbs_d->gengrid, win_h,
+ LANDSCAPE_HEIGHT_WVGA);
} else {
- elm_gengrid_item_size_set(ugd->thumbs_d->gengrid, win_h, LANDSCAPE_HEIGHT);
+ elm_gengrid_item_size_set(ugd->thumbs_d->gengrid, win_h,
+ LANDSCAPE_HEIGHT);
}
} else {
- elm_gengrid_item_size_set(ugd->thumbs_d->gengrid, landscape_size, landscape_size);
+ elm_gengrid_item_size_set(ugd->thumbs_d->gengrid,
+ landscape_size, landscape_size);
}
} else {
if (ugd->nocontents) {
double scale = elm_config_scale_get();
if (ugd->attach_panel_display_mode == ATTACH_PANEL_FULL_MODE) {
if ((scale - 1.8) < 0.0001) {
- elm_gengrid_item_size_set(ugd->thumbs_d->gengrid, win_w, FULL_MODE_PORTRAIT_HEIGHT_WVGA);
+ elm_gengrid_item_size_set(ugd->thumbs_d->gengrid,
+ win_w,
+ FULL_MODE_PORTRAIT_HEIGHT_WVGA);
} else {
- elm_gengrid_item_size_set(ugd->thumbs_d->gengrid, win_w, FULL_MODE_PORTRAIT_HEIGHT);
+ elm_gengrid_item_size_set(ugd->thumbs_d->gengrid,
+ win_w,
+ FULL_MODE_PORTRAIT_HEIGHT);
}
} else {
if ((scale - 1.8) < 0.0001) {
- elm_gengrid_item_size_set(ugd->thumbs_d->gengrid, win_w, HALF_MODE_PORTRAIT_HEIGHT_WVGA);
+ elm_gengrid_item_size_set(ugd->thumbs_d->gengrid,
+ win_w,
+ HALF_MODE_PORTRAIT_HEIGHT_WVGA);
} else {
- elm_gengrid_item_size_set(ugd->thumbs_d->gengrid, win_w, HALF_MODE_PORTRAIT_HEIGHT);
+ elm_gengrid_item_size_set(ugd->thumbs_d->gengrid,
+ win_w,
+ HALF_MODE_PORTRAIT_HEIGHT);
}
}
} else {
}
}
-static void _ge_key_event(ui_gadget_h ug, enum ug_key_event event, app_control_h service, void *priv)
+static void _ge_key_event(ui_gadget_h ug, enum ug_key_event event,
+ app_control_h service, void *priv)
{
ge_dbg("");
GE_CHECK(ug);
GE_CHECK(priv);
- ge_ugdata *ugd = (ge_ugdata *)priv;
+ ge_ugdata *ugd = (ge_ugdata *) priv;
switch (event) {
case UG_KEY_EVENT_END:
ge_dbg("Receive key end event");
GE_FREEIF(ops->priv);
ge_dbgW("UG_MODULE_EXIT");
}
-
/*
-* Copyright (c) 2000-2015 Samsung Electronics Co., Ltd All Rights Reserved
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*
-*/
+ * Copyright (c) 2015 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://floralicense.org/license/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
#include <media_content.h>
#include "gallery-efl.h"
#define GE_MONITOE_TIME_DELAY 1.0f
struct ge_db_noti_t {
- Ecore_Timer *db_timer; /*For update db data*/
- /*Make ture calling db update callback after other operations complete*/
+ Ecore_Timer *db_timer; /*For update db data */
+ /*Make ture calling db update callback after other operations complete */
Ecore_Idler *db_idl;
//media_content_noti_h cloud_h; /* Notify handle fro cloud content updating in DB */
media_content_db_update_item_type_e update_item;
media_content_db_update_type_e update_type;
- int count; /* All media count got from DB */
+ int count; /* All media count got from DB */
};
static Eina_Bool __ge_db_update_idler(void *data)
{
GE_CHECK_FALSE(data);
- ge_ugdata *ugd = (ge_ugdata *)data;
+ ge_ugdata *ugd = (ge_ugdata *) data;
GE_CHECK_FALSE(ugd->db_noti_d);
ge_db_noti_s *db_noti = ugd->db_noti_d;
ge_update_view(ugd, GE_UPDATE_VIEW_INOTIFY);
evas_object_smart_callback_call(ugd->naviframe,
- "gallery,db,data,updated", ugd);
+ "gallery,db,data,updated", ugd);
GE_IF_DEL_IDLER(db_noti->db_idl);
return ECORE_CALLBACK_CANCEL;
}
static Eina_Bool __ge_db_update_timer_cb(void *data)
{
GE_CHECK_FALSE(data);
- ge_ugdata *ugd = (ge_ugdata *)data;
+ ge_ugdata *ugd = (ge_ugdata *) data;
GE_CHECK_FALSE(ugd->db_noti_d);
ge_db_noti_s *db_noti = ugd->db_noti_d;
return ECORE_CALLBACK_CANCEL;
}
-static int __ge_db_update_add_timer(ge_ugdata *ugd)
+static int __ge_db_update_add_timer(ge_ugdata * ugd)
{
GE_CHECK_VAL(ugd, -1);
GE_CHECK_VAL(ugd->db_noti_d, -1);
GE_IF_DEL_TIMER(db_noti->db_timer);
db_noti->db_timer = ecore_timer_add(GE_MONITOE_TIME_DELAY,
- __ge_db_update_timer_cb, ugd);
+ __ge_db_update_timer_cb, ugd);
ge_dbgW("TIMER[1.0f] added!");
return 0;
}
static int __ge_db_update_op(media_content_error_e error, int pid,
- media_content_db_update_item_type_e update_item,
- media_content_db_update_type_e update_type,
- media_content_type_e media_type, char *uuid,
- char *path, char *mime_type, void *data)
+ media_content_db_update_item_type_e
+ update_item,
+ media_content_db_update_type_e update_type,
+ media_content_type_e media_type, char *uuid,
+ char *path, char *mime_type, void *data)
{
GE_CHECK_VAL(data, -1);
- ge_ugdata *ugd = (ge_ugdata *)data;
+ ge_ugdata *ugd = (ge_ugdata *) data;
GE_CHECK_VAL(ugd->db_noti_d, -1);
ge_db_noti_s *db_noti = ugd->db_noti_d;
return -1;
}
if (update_item == MEDIA_ITEM_FILE &&
- MEDIA_CONTENT_TYPE_IMAGE != media_type &&
- MEDIA_CONTENT_TYPE_VIDEO != media_type) {
+ MEDIA_CONTENT_TYPE_IMAGE != media_type) {
ge_dbg("Media type is wrong");
return -1;
- } else if (update_item == MEDIA_ITEM_DIRECTORY && media_type == -1) {
- /* Batch operation, DB wouldn't return media type */
- int cnt = 0;
- int ret = -1;
- ret = _ge_data_get_item_cnt(ugd, GE_ALBUM_ALL_ID, GE_ALL, &cnt);
- if (ret != 0 || cnt == 0) {
- ge_dbgE("Empty!");
- }
- ge_dbg("old: %d, new: %d", db_noti->count, cnt);
- if (cnt == db_noti->count) {
- ge_dbg("Nothing changed");
- if (path &&
- !strcmp(path, GE_ROOT_PATH_MMC)) {
- ge_dbg("MMC insert or remove!");
- } else if (path) {
- ge_album_s *album = NULL;
- _ge_local_data_get_album_by_path(path, &album);
- if (!album) {
- return -1;
- } else {
- _ge_data_type_free_geitem((void **)&album);
- ge_dbgW("Updated album contains images");
- }
- } else {
- return -1;
- }
- } else {
- db_noti->count = cnt;
- }
}
db_noti->update_item = update_item;
}
static void __ge_db_update_cb(media_content_error_e error, int pid,
- media_content_db_update_item_type_e update_item,
- media_content_db_update_type_e update_type,
- media_content_type_e media_type, char *uuid,
- char *path, char *mime_type, void *data)
+ media_content_db_update_item_type_e
+ update_item,
+ media_content_db_update_type_e update_type,
+ media_content_type_e media_type, char *uuid,
+ char *path, char *mime_type, void *data)
{
ge_dbg("update_item[%d], update_type[%d], media_type[%d]", update_item,
- update_type, media_type);
+ update_type, media_type);
GE_CHECK(data);
ge_dbg("uuid[%s], path[%s]", uuid, path);
__ge_db_update_op(error, pid, update_item, update_type, media_type,
- uuid, path, mime_type, data);
-}
-
-/*
-static void __ge_db_update_coud_cb(media_content_error_e error, int pid,
- media_content_db_update_item_type_e update_item,
- media_content_db_update_type_e update_type,
- media_content_type_e media_type, char *uuid,
- char *path, char *mime_type, void *data)
-{
- ge_dbg("update_item[%d], update_type[%d], media_type[%d]", update_item,
- update_type, media_type);
- GE_CHECK(data);
- __ge_db_update_op(error, pid, update_item, update_type, media_type,
- uuid, path, mime_type, data);
-}
-*/
-
-int _ge_db_update_get_info(void *data,
- media_content_db_update_item_type_e *update_item,
- media_content_db_update_type_e *update_type)
-{
- GE_CHECK_VAL(data, -1);
- ge_ugdata *ugd = (ge_ugdata *)data;
- GE_CHECK_VAL(ugd->db_noti_d, -1);
-
- if (update_item) {
- *update_item = ugd->db_noti_d->update_item;
- }
- if (update_type) {
- *update_type = ugd->db_noti_d->update_type;
- }
-
- return 0;
+ uuid, path, mime_type, data);
}
/*Add media-content update callback*/
-bool _ge_db_update_reg_cb(ge_ugdata *ugd)
+bool _ge_db_update_reg_cb(ge_ugdata * ugd)
{
GE_CHECK_FALSE(ugd);
- /*Init data*/
- ge_db_noti_s *db_noti = (ge_db_noti_s *)calloc(1, sizeof(ge_db_noti_s));
+ /*Init data */
+ ge_db_noti_s *db_noti =
+ (ge_db_noti_s *) calloc(1, sizeof(ge_db_noti_s));
GE_CHECK_FALSE(db_noti);
ugd->db_noti_d = db_noti;
int ret = -1;
ge_dbg("Set db updated callback");
- ret = media_content_set_db_updated_cb(__ge_db_update_cb, ugd);
+ ret =
+ media_content_add_db_updated_cb(__ge_db_update_cb, ugd,
+ &ugd->noti_handle);
if (ret != MEDIA_CONTENT_ERROR_NONE) {
ge_dbgE("Set db updated cb failed[%d]!", ret);
}
-// ret = media_content_set_db_updated_cloud_cb(&(ugd->db_noti_d->cloud_h),
-// __ge_db_update_coud_cb,
-// ugd);
-// if (ret != MEDIA_CONTENT_ERROR_NONE)
-// ge_dbgE("Set db updated cloud cb failed[%d]!", ret);
return true;
}
-bool _ge_db_update_finalize(ge_ugdata *ugd)
+bool _ge_db_update_finalize(ge_ugdata * ugd)
{
int ret = -1;
ge_dbg("Unset db updated callback");
- ret = media_content_unset_db_updated_cb();
+ ret = media_content_remove_db_updated_cb(ugd->noti_handle);
if (ret != MEDIA_CONTENT_ERROR_NONE) {
ge_dbgE("UNSet db updated cb failed[%d]!", ret);
}
GE_CHECK_FALSE(ugd->db_noti_d);
ge_db_noti_s *db_noti = ugd->db_noti_d;
-// if (db_noti->cloud_h) {
-// ret = media_content_unset_db_updated_cloud_cb(db_noti->cloud_h);
-// if (ret != MEDIA_CONTENT_ERROR_NONE)
-// ge_dbgE("UNSet db updated cloud cb failed[%d]!", ret);
-// ugd->db_noti_d->cloud_h = NULL;
-// }
GE_IF_DEL_TIMER(db_noti->db_timer);
GE_IF_DEL_IDLER(db_noti->db_idl);
GE_FREE(ugd->db_noti_d);
return true;
}
-
-
+++ /dev/null
-/*
-* Copyright (c) 2000-2015 Samsung Electronics Co., Ltd All Rights Reserved
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*
-*/
-
-#include <stdio.h>
-#include <unistd.h>
-#include <string.h>
-#include "ge-debug.h"
-
-#ifdef _USE_LOG_FILE_
-static char _g_file_path[GE_DB_FILE_LEN_MAX] = { 0, };
-#endif
-
-
+++ /dev/null
-/*
-* Copyright (c) 2000-2015 Samsung Electronics Co., Ltd All Rights Reserved
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*
-*/
-
-/**
- * The Exif specification defines an Orientation Tag to indicate the orientation of the
- * camera relative to the captured scene. This can be used by the camera either to
- * indicate the orientation automatically by an orientation sensor,
- * or to allow the user to indicate the orientation manually by a menu switch,
- * without actually transforming the image data itself.
- * Here is an explanation given by TsuruZoh Tachibanaya in
- * his description of the Exif file format:
- *
- * The orientation of the camera relative to the scene, when the image was captured.
- * The relation of the '0th row' and '0th column' to visual position is shown as below.
- *
- * Value 0th Row 0th Column
- * 1 top left side
- * 2 top right side
- * 3 bottom right side
- * 4 bottom left side
- * 5 left side top
- * 6 right side top
- * 7 right side bottom
- * 8 left side bottom
- *
- * Read this table as follows (thanks to Peter Nielsen for clarifying this - see also below):
- * Entry #6 in the table says that the 0th row in the stored image is the right side of
- * the captured scene, and the 0th column in the stored image is the top side of
- * the captured scene.
- *
- * Here is another description given by Adam M. Costello:
- *
- * For convenience, here is what the letter F would look like if it were tagged correctly
- * and displayed by a program that ignores the orientation tag
- * (thus showing the stored image):
- *
- * 1 2 3 4 5 6 7 8
- *
- * 888888 888888 88 88 8888888888 88 88 8888888888
- * 88 88 88 88 88 88 88 88 88 88 88 88
- * 8888 8888 8888 8888 88 8888888888 8888888888 88
- * 88 88 88 88
- * 88 88 888888 888888
-*/
-
-#ifdef _USE_ROTATE_BG_GE
-
-#include <stdlib.h>
-#include <string.h>
-#include <time.h>
-#include <Elementary.h>
-#include "ge-exif.h"
-#include "ge-debug.h"
-#include "ge-data-type.h"
-
-#define GE_EXIF_BUF_LEN_MAX 65536L
-#define GE_EXIF_BUF_TIME_LEN_MAX 20
-#define GE_EXIF_DEFAULT_YEAR 1900
-
-#define GE_EXIF_SOI 0xD8
-#define GE_EXIF_TAG 0xFF
-#define GE_EXIF_APP0 0xE0
-#define GE_EXIF_APP1 0xE1
-#define GE_EXIF_JFIF_00 0x00
-#define GE_EXIF_JFIF_01 0x01
-#define GE_EXIF_JFIF_02 0x02
-
-#define GE_EXIF_IFD_DATA_FORMAT_UNSIGNED_BYTE 1
-#define GE_EXIF_IFD_DATA_FORMAT_ASCII_STRINGS 1
-#define GE_EXIF_IFD_DATA_FORMAT_UNSIGNED_SHORT 2
-#define GE_EXIF_IFD_DATA_FORMAT_UNSIGNED_LONG 4
-#define GE_EXIF_IFD_DATA_FORMAT_UNSIGNED_RATIONAL 8
-#define GE_EXIF_IFD_DATA_FORMAT_SIGNED_BYTE 1
-#define GE_EXIF_IFD_DATA_FORMAT_UNDEFINED 1
-#define GE_EXIF_IFD_DATA_FORMAT_SIGNED_SHORT 2
-#define GE_EXIF_IFD_DATA_FORMAT_SIGNED_LONG 4
-#define GE_EXIF_IFD_DATA_FORMAT_SIGNED_RATIONAL 8
-#define GE_EXIF_IFD_DATA_FORMAT_SIGNED_FLOAT 4
-#define GE_EXIF_IFD_DATA_FORMAT_DOUBLE_FLOAT 8
-
-#define GE_EXI_TMP_JPEG_FILE "/opt/usr/apps/org.tizen.gallery/data/.gallery_tmp_write_exif.jpg"
-
-/* Read one byte, testing for EOF */
-static int __ge_exif_read_1_byte(FILE *fd)
-{
- int c = 0;
-
- /* Return next input byte, or EOF if no more */
- c = getc(fd);
- if (c == EOF) {
- ge_dbgE("Premature EOF in JPEG file!");
- return -1;
- }
-
- return c;
-}
-
-/* Read 2 bytes, convert to unsigned int */
-/* All 2-byte quantities in JPEG markers are MSB first */
-static int __ge_exif_read_2_bytes(FILE *fd, unsigned int *len)
-{
- int c1 = 0;
- int c2 = 0;
-
- /* Return next input byte, or EOF if no more */
- c1 = getc(fd);
- if (c1 == EOF) {
- ge_dbgE("Premature EOF in JPEG file!");
- return -1;
- }
-
- /* Return next input byte, or EOF if no more */
- c2 = getc(fd);
- if (c2 == EOF) {
- ge_dbgE("Premature EOF in JPEG file!");
- return -1;
- }
-
- if (len) {
- *len = (((unsigned int)c1) << 8) + ((unsigned int)c2);
- }
-
- return 0;
-}
-
-static int __ge_exif_rw_jfif(FILE *fd, char *file_path,
- unsigned int *orientation)
-{
- GE_CHECK_VAL(fd, -1);
- GE_CHECK_VAL(file_path, -1);
- GE_CHECK_VAL(orientation, -1);
- unsigned char tmp[GE_EXIF_BUF_LEN_MAX] = { 0, };
- int i = 0;
- unsigned int length = 0;
- int tmp_exif = -1;
- bool is_motorola = false; /* Flag for byte order */
- unsigned int offset = 0;
- int ret = -1;
- /*unsigned char version = 0x00; */
-
- if (__ge_exif_read_2_bytes(fd, &length) < 0) {
- goto GE_EXIF_FAILED;
- }
- ge_dbg("length: %d", length);
-
- for (i = 0; i < 5; i++) {
- tmp_exif = __ge_exif_read_1_byte(fd);
- if (tmp_exif < 0) {
- goto GE_EXIF_FAILED;
- }
- tmp[i] = (unsigned char)tmp_exif;
- }
-
- /* JFIF0 */
- if (tmp[0] != 0x4A || tmp[1] != 0x46 || tmp[2] != 0x49 ||
- tmp[3] != 0x46 || tmp[4] != 0x00) {
- ge_dbgE("Not met Jfif!");
- goto GE_EXIF_FAILED;
- }
-
- for (i = 0; i < 2; i++) {
- tmp_exif = __ge_exif_read_1_byte(fd);
- if (tmp_exif < 0) {
- goto GE_EXIF_FAILED;
- }
- tmp[i] = (unsigned char)tmp_exif;
- }
-
- /* Check JFIF version */
- if (tmp[0] == 0x01 && tmp[1] == GE_EXIF_JFIF_00) {
- ge_dbg("Jfif 1.00");
- } else if (tmp[0] == 0x01 && tmp[1] == GE_EXIF_JFIF_01) {
- ge_dbg("Jfif 1.01");
- } else if (tmp[0] == 0x01 && tmp[1] == GE_EXIF_JFIF_02) {
- ge_dbg("Jfif 1.02");
- } else {
- ge_dbgE("Unknow Jfif version[%d.%d]!", tmp[0], tmp[1]);
- goto GE_EXIF_FAILED;
- }
-
- /* Save version */
- /*version = tmp[1]; */
-
- /* Find APP1 */
- bool b_tag_ff = false;
- while (1) {
- tmp_exif = __ge_exif_read_1_byte(fd);
- if (tmp_exif < 0) {
- goto GE_EXIF_FAILED;
- }
-
- tmp[0] = (unsigned char)tmp_exif;
-
- ge_dbg("- %02X", tmp[0]);
- if (!b_tag_ff) {
- /* Get first tag */
- if (tmp[0] == GE_EXIF_TAG) {
- ge_dbgW("0xFF!");
- b_tag_ff = true;
- }
- continue;
- }
-
- /* Get APP1 */
- if (tmp[0] == GE_EXIF_APP1) {
- ge_dbgW("Exif in APP1!");
- break;
- }
-
- ge_dbgW("No Exif in APP1!");
-
- /* Close file */
- fclose(fd);
- /* Normal orientation = 0degree = 1 */
- *orientation = 1;
- return 0;
-
- }
-
- /* Find Exif */
- while (1) {
- tmp_exif = __ge_exif_read_1_byte(fd);
- if (tmp_exif < 0) {
- goto GE_EXIF_FAILED;
- }
-
- tmp[0] = (unsigned char)tmp_exif;
- if (tmp[0] != 0x45) {
- continue;
- }
-
- for (i = 0; i < 5; i++) {
- tmp_exif = __ge_exif_read_1_byte(fd);
- if (tmp_exif < 0) {
- goto GE_EXIF_FAILED;
- }
-
- tmp[i] = (unsigned char)tmp_exif;
- ge_dbg("- %02X", tmp[i]);
- }
- if (tmp[0] == 0x78 && tmp[1] == 0x69 && tmp[2] == 0x66 &&
- tmp[3] == 0x00 && tmp[4] == 0x00) {
- ge_dbgW("Met Exif!");
- break;
- } else {
- ge_dbgW("Not met Exif!");
- goto GE_EXIF_FAILED;
- }
- }
-
- /* Read Exif body */
- for (i = 0; i < 4; i++) {
- tmp_exif = __ge_exif_read_1_byte(fd);
- if (tmp_exif < 0) {
- goto GE_EXIF_FAILED;
- }
- tmp[i] = (unsigned char)tmp_exif;
- }
-
- /* Check byte order and Tag Mark , "II(0x4949)" or "MM(0x4d4d)" */
- if (tmp[0] == 0x49 && tmp[1] == 0x49 && tmp[2] == 0x2A &&
- tmp[3] == 0x00) {
- ge_dbg("Intel");
- is_motorola = false;
- } else if (tmp[0] == 0x4D && tmp[1] == 0x4D && tmp[2] == 0x00 &&
- tmp[3] == 0x2A) {
- ge_dbg("Motorola");
- is_motorola = true;
- } else {
- goto GE_EXIF_FAILED;
- }
-
- for (i = 0; i < 4; i++) {
- tmp_exif = __ge_exif_read_1_byte(fd);
- if (tmp_exif < 0) {
- goto GE_EXIF_FAILED;
- }
-
- tmp[i] = (unsigned char)tmp_exif;
- ge_dbg("- %02X", tmp[i]);
- }
-
- /* Get first IFD offset (offset to IFD0) , MM-08000000, II-00000008 */
- if (is_motorola) {
- if (tmp[0] != 0 && tmp[1] != 0) {
- goto GE_EXIF_FAILED;
- }
- offset = tmp[2];
- offset <<= 8;
- offset += tmp[3];
- } else {
- if (tmp[3] != 0 && tmp[2] != 0) {
- goto GE_EXIF_FAILED;
- }
- offset = tmp[1];
- offset <<= 8;
- offset += tmp[0];
- }
- ge_dbg("offset: %d", offset);
-
- /* IFD: Image File Directory */
- /* Get the number of directory entries contained in this IFD, - 2 bytes, EE */
- unsigned int tags_cnt = 0;
- for (i = 0; i < 2; i++) {
- tmp_exif = __ge_exif_read_1_byte(fd);
- if (tmp_exif < 0) {
- goto GE_EXIF_FAILED;
- }
-
- tmp[i] = (unsigned char)tmp_exif;
- }
- if (is_motorola) {
- tags_cnt = tmp[0];
- tags_cnt <<= 8;
- tags_cnt += tmp[1];
- } else {
- tags_cnt = tmp[1];
- tags_cnt <<= 8;
- tags_cnt += tmp[0];
- }
- ge_dbg("tags_cnt: %d", tags_cnt);
- if (tags_cnt == 0) {
- ge_dbgE("tags_cnt == 0 - 2");
- goto GE_EXIF_FAILED;
- }
-
- /* Search for Orientation Tag in IFD0 */
- unsigned int tag_num = 0;
- while (1) {
- /* Every directory entry size is 12 */
- for (i = 0; i < 12; i++) {
- tmp_exif = __ge_exif_read_1_byte(fd);
- if (tmp_exif < 0) {
- goto GE_EXIF_FAILED;
- }
-
- tmp[i] = (unsigned char)tmp_exif;
- }
- /* Get Tag number */
- if (is_motorola) {
- tag_num = tmp[0];
- tag_num <<= 8;
- tag_num += tmp[1];
- } else {
- tag_num = tmp[1];
- tag_num <<= 8;
- tag_num += tmp[0];
- }
- /* found Orientation Tag */
- if (tag_num == 0x0112) {
- ge_dbgW("Found orientation tag!");
- break;
- }
- if (--tags_cnt == 0) {
- ge_dbgW("tags_cnt == 0, no found orientation tag!");
- /* Normal orientation = 0degree = 1 */
- *orientation = 1;
- ret = 0;
- goto GE_EXIF_FAILED;
- }
- }
-
- /* |TT|ff|NNNN|DDDD| --- TT - 2 bytes, tag NO. ;ff - 2 bytes, data format
- NNNN - 4 bytes, entry count; DDDD - 4 bytes Data value */
- /* Get the Orientation value */
- if (is_motorola) {
- if (tmp[8] != 0) {
- ge_dbgE("tmp[8] != 0");
- goto GE_EXIF_FAILED;
- }
- *orientation = (unsigned int)tmp[9];
- } else {
- if (tmp[9] != 0) {
- ge_dbgE("tmp[9] != 0");
- goto GE_EXIF_FAILED;
- }
- *orientation = (unsigned int)tmp[8];
- }
- if (*orientation > 8) {
- ge_dbgE("*orient > 8");
- goto GE_EXIF_FAILED;
- }
- ge_dbg("Read: %d", *orientation);
- ret = 0;
-
-GE_EXIF_FAILED:
-
- fclose(fd);
- ge_dbg("All done");
- return ret;
-}
-
-static int __ge_exif_rw_orient(char *file_path, unsigned int *orient)
-{
- GE_CHECK_VAL(file_path, -1);
- unsigned int length = 0;
- unsigned int i = 0;
- bool is_motorola = false; /* Flag for byte order */
- unsigned int offset = 0;
- unsigned int tags_cnt = 0;
- unsigned int tag_num = 0;
- int tmp_exif = -1;
- unsigned char exif_data[GE_EXIF_BUF_LEN_MAX] = { 0, };
- FILE *fd = NULL;
- int ret = -1;
-
- if ((fd = fopen(file_path, "rb")) == NULL) {
- ge_sdbgE("Can't open %s!", file_path);
- return -1;
- }
-
-
- /* Read File head, check for JPEG SOI + Exif APP1 */
- for (i = 0; i < 4; i++) {
- tmp_exif = __ge_exif_read_1_byte(fd);
- if (tmp_exif < 0) {
- goto GE_EXIF_FAILED;
- }
-
- exif_data[i] = (unsigned char)tmp_exif;
- }
-
- if (exif_data[0] == GE_EXIF_TAG && exif_data[1] == GE_EXIF_SOI) {
- ge_dbg("JPEG file");
- } else {
- ge_dbgE("Not a JPEG file!");
- goto GE_EXIF_FAILED;
- }
-
- if (exif_data[2] == GE_EXIF_TAG && exif_data[3] == GE_EXIF_APP1) {
- ge_dbgW("Exif in APP1!");
- } else if (exif_data[2] == GE_EXIF_TAG &&
- exif_data[3] == GE_EXIF_APP0) {
- ge_dbgW("Jfif in APP0!");
- int ret = __ge_exif_rw_jfif(fd, file_path, orient);
- return ret;
- } else {
- ge_dbgE("Not a Exif in APP1 or Jiff in APP2[%d]!", exif_data[3]);
- goto GE_EXIF_FAILED;
- }
-
- /* Get the marker parameter length count */
- if (__ge_exif_read_2_bytes(fd, &length) < 0) {
- goto GE_EXIF_FAILED;
- }
- ge_dbg("length: %d", length);
- /* Length includes itself, so must be at least 2
- Following Exif data length must be at least 6 */
- if (length < 8) {
- ge_dbgE("length < 8");
- goto GE_EXIF_FAILED;
- }
- length -= 8;
-
- /* Length of an IFD entry */
- if (length < 12) {
- ge_dbgE("length < 12");
- goto GE_EXIF_FAILED;
- }
-
- /* Read Exif head, check for "Exif" */
- for (i = 0; i < 6; i++) {
- tmp_exif = __ge_exif_read_1_byte(fd);
- if (tmp_exif < 0) {
- goto GE_EXIF_FAILED;
- }
-
- exif_data[i] = (unsigned char)tmp_exif;
- ge_dbg("- %02X", exif_data[i]);
- }
-
- if (exif_data[0] != 0x45 || exif_data[1] != 0x78 ||
- exif_data[2] != 0x69 || exif_data[3] != 0x66 ||
- exif_data[4] != 0x00 || exif_data[5] != 0x00) {
- ge_dbgE("Not met Exif!");
- goto GE_EXIF_FAILED;
- }
-
- /* Read Exif body */
- for (i = 0; i < length; i++) {
- tmp_exif = __ge_exif_read_1_byte(fd);
- if (tmp_exif < 0) {
- goto GE_EXIF_FAILED;
- }
- exif_data[i] = (unsigned char)tmp_exif;
- }
-
- /* Check byte order and Tag Mark , "II(0x4949)" or "MM(0x4d4d)" */
- if (exif_data[0] == 0x49 && exif_data[1] == 0x49 &&
- exif_data[2] == 0x2A && exif_data[3] == 0x00) {
- ge_dbg("Intel");
- is_motorola = false;
- } else if (exif_data[0] == 0x4D && exif_data[1] == 0x4D &&
- exif_data[2] == 0x00 && exif_data[3] == 0x2A) {
- ge_dbg("Motorola");
- is_motorola = true;
- } else {
- goto GE_EXIF_FAILED;
- }
-
- /* Get first IFD offset (offset to IFD0) , MM-00000008, II-08000000 */
- if (is_motorola) {
- if (exif_data[4] != 0 && exif_data[5] != 0) {
- goto GE_EXIF_FAILED;
- }
- offset = exif_data[6];
- offset <<= 8;
- offset += exif_data[7];
- } else {
- if (exif_data[7] != 0 && exif_data[6] != 0) {
- goto GE_EXIF_FAILED;
- }
- offset = exif_data[5];
- offset <<= 8;
- offset += exif_data[4];
- }
- /* check end of data segment */
- if (offset > length - 2) {
- ge_dbgE("offset > length - 2");
- goto GE_EXIF_FAILED;
- }
-
- /* IFD: Image File Directory */
- /* Get the number of directory entries contained in this IFD, - EEEE */
- if (is_motorola) {
- tags_cnt = exif_data[offset];
- tags_cnt <<= 8;
- tags_cnt += exif_data[offset + 1];
- } else {
- tags_cnt = exif_data[offset + 1];
- tags_cnt <<= 8;
- tags_cnt += exif_data[offset];
- }
- if (tags_cnt == 0) {
- ge_dbgE("tags_cnt == 0 - 2");
- goto GE_EXIF_FAILED;
- }
- offset += 2;
-
- /* check end of data segment */
- if (offset > length - 12) {
- ge_dbgE("offset > length - 12");
- goto GE_EXIF_FAILED;
- }
-
- /* Search for Orientation Tag in IFD0 */
- while (1) {
- /* Get Tag number */
- if (is_motorola) {
- tag_num = exif_data[offset];
- tag_num <<= 8;
- tag_num += exif_data[offset + 1];
- } else {
- tag_num = exif_data[offset + 1];
- tag_num <<= 8;
- tag_num += exif_data[offset];
- }
- /* found Orientation Tag */
- if (tag_num == 0x0112) {
- ge_dbgW("Found orientation tag!");
- break;
- }
- if (--tags_cnt == 0) {
- ge_dbgW("tags_cnt == 0, no found orientation tag!");
- /* Normal orientation = 0degree = 1 */
- *orient = 1;
- ret = 0;
- goto GE_EXIF_FAILED;
- }
-
- /* Every directory entry size is 12 */
- offset += 12;
- }
-
- /* Get the Orientation value */
- if (is_motorola) {
- if (exif_data[offset + 8] != 0) {
- ge_dbgE("exif_data[offset+8] != 0");
- goto GE_EXIF_FAILED;
- }
- *orient = (unsigned int)exif_data[offset + 9];
- } else {
- if (exif_data[offset + 9] != 0) {
- ge_dbgE("exif_data[offset+9] != 0");
- goto GE_EXIF_FAILED;
- }
- *orient = (unsigned int)exif_data[offset + 8];
- }
- if (*orient > 8) {
- ge_dbgE("*orient > 8");
- goto GE_EXIF_FAILED;
- }
- ge_dbg("Read: %d", *orient);
-
- ret = 0;
-
-GE_EXIF_FAILED:
-
- fclose(fd);
- ge_dbg("All done");
- return ret;
-}
-
-int _ge_exif_get_orientation(char *file_path, unsigned int *orientation)
-{
- GE_CHECK_VAL(orientation, -1);
- GE_CHECK_VAL(file_path, -1);
- ge_sdbg("file_path: %s", file_path);
-
- return __ge_exif_rw_orient(file_path, orientation);
-}
-
-#endif
-
+++ /dev/null
-/*
-* Copyright (c) 2000-2015 Samsung Electronics Co., Ltd All Rights Reserved
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*
-*/
-
-#include "ge-ext-exec.h"
-#include "ge-debug.h"
-#include "ge-data.h"
-#include "ge-util.h"
-#include "ge-gridview.h"
-
-#define GE_EXT_FILETRANSFER "com.samsung.rcs-im"
-#define GE_EXT_CMD_ARGS_LEN 20
-#define GE_EXT_LAUNCH_TYPE "launch-type"
-#define GE_EXT_LAUNCH_FT_WITH_CONTACT "ft-with-contact"
-#define GE_EXT_FT_FILE "file"
-#define GE_EXT_FT_CONTACT "contact"
-
-static int __ge_ext_compose_cmd(ge_ugdata *ugd, GeExtAppType type,
- app_control_h service, char **pkg_name, char *paths,
- int count)
-{
- ge_dbg("type:%d", type);
- GE_CHECK_VAL(pkg_name, LAUNCH_FAIL);
- GE_CHECK_VAL(service, LAUNCH_FAIL);
- GE_CHECK_VAL(ugd, LAUNCH_FAIL);
-
- switch (type) {
- case FILETRANSFER: {
- app_control_add_extra_data(service, GE_EXT_LAUNCH_TYPE,
- GE_EXT_LAUNCH_FT_WITH_CONTACT);
- app_control_add_extra_data(service, GE_EXT_FT_FILE, paths);
-
- char index_arg[GE_EXT_CMD_ARGS_LEN] = { 0, };
- snprintf(index_arg, sizeof(index_arg), "%d",
- ugd->file_select_contact_id);
- app_control_add_extra_data(service, GE_EXT_FT_CONTACT, index_arg);
- *pkg_name = GE_EXT_FILETRANSFER;
- break;
- }
- default:
- *pkg_name = NULL;
- return LAUNCH_FAIL;
- }
-
- return LAUNCH_SUCCESS;
-}
-
-int _ge_ext_load_app(ge_ugdata *ugd, GeExtAppType type, char *paths, int count)
-{
- GE_CHECK_VAL(ugd, LAUNCH_FAIL);
- app_control_h service = NULL;
- char *pkg_name = NULL;
-
- app_control_create(&service);
- GE_CHECK_VAL(service, LAUNCH_FAIL);
-
- __ge_ext_compose_cmd(ugd, type, service, &pkg_name, paths, count);
- if (pkg_name == NULL) {
- ge_dbgE("pkg_name is NULL!");
- app_control_destroy(service);
- return LAUNCH_FAIL;
- }
-
- int ret = 0;
- app_control_set_operation(service, APP_CONTROL_OPERATION_DEFAULT);
- if (APP_CONTROL_ERROR_NONE != app_control_set_app_id(service, pkg_name)) {
- ge_dbgE("app_control_set_app_id failed");
- }
- ret = app_control_send_launch_request(service, NULL, NULL);
- if (ret != APP_CONTROL_ERROR_NONE) {
- app_control_destroy(service);
- ge_dbgE("app_control_send_launch_request failed[%d]!", ret);
- return LAUNCH_FAIL;
- }
-
- ret = app_control_destroy(service);
- if (ret != APP_CONTROL_ERROR_NONE) {
- return LAUNCH_FAIL;
- } else {
- return LAUNCH_SUCCESS;
- }
-}
-
+++ /dev/null
-/*
-* Copyright (c) 2000-2015 Samsung Electronics Co., Ltd All Rights Reserved
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*
-*/
-
-#include "ge-ext-ug-load.h"
-#include "ge-debug.h"
-#include "ge-ui-util.h"
-#include "ge-util.h"
-#include "ge-albums.h"
-#include "ge-gridview.h"
-
-#define GE_IV_UG_NAME "image-viewer-efl"
-#define GE_IV_STR_LEN_MAX 32
-#define GE_VIEW_MODE "View Mode"
-#define GE_SETAS_TYPE "Setas type"
-#define GE_VIEW_BY "View By"
-#define GE_MEDIA_TYPE "Media type"
-#define GE_PATH "Path"
-
-static void _ge_ext_destroy_me(ge_ugdata *ugd)
-{
- ge_dbg("");
- GE_CHECK(ugd);
- GE_CHECK(ugd->ug_called_by_me);
- GE_CHECK(ugd->ug);
- GE_CHECK(ugd->service);
- bool send_result = false;
-
- if (ugd->ug_called_by_me) {
- ge_dbg("Destroy ug_called_by_me");
- ug_destroy(ugd->ug_called_by_me);
- ugd->ug_called_by_me = NULL;
- } else {
- ge_dbg("ug_called_by_me does not exist!");
- }
-
- if (ugd->file_select_mode == GE_FILE_SELECT_T_SLIDESHOW) {
- ugd->b_destroy_me = false;
- }
-
- if (!ugd->b_destroy_me) {
- ge_dbg("gallery ug is still alive");
- return;
- }
- if (ugd->file_select_mode == GE_FILE_SELECT_T_SETAS) {
- if (ugd->file_setas_image_path) {
- ge_dbg("GE_SETAS_IMAGE_PATH:%s", ugd->file_setas_image_path);
- app_control_add_extra_data(ugd->service,
- GE_SETAS_IMAGE_PATH,
- ugd->file_setas_image_path);
-
- GE_FREE(ugd->file_setas_image_path);
- send_result = true;
- }
-
- if (ugd->file_setas_crop_image_path &&
- (ugd->file_select_setas_mode == GE_SETAS_T_CALLERID ||
- ugd->file_select_setas_mode == GE_SETAS_T_CROP_WALLPAPER)) {
- ge_dbg("GE_SETAS_CALLERID_CROP_IMAGE_PATH:%s",
- ugd->file_setas_crop_image_path);
- app_control_add_extra_data(ugd->service,
- APP_CONTROL_DATA_SELECTED,
- ugd->file_setas_crop_image_path);
-
- GE_FREE(ugd->file_setas_crop_image_path);
- send_result = true;
- }
-
- if (send_result) {
- ge_dbg("Call ug_send_result_full() to send result.");
- ug_send_result_full(ugd->ug, ugd->service, APP_CONTROL_RESULT_SUCCEEDED);
- }
- }
-
- if (ugd->b_destroy_me) {
- ge_dbg("Setting is appllied, destroy gallery UG.");
- ugd->b_destroy_me = false;
- /* Destroy self */
- if (!ugd->is_attach_panel) {
- ug_destroy_me(ugd->ug);
- }
- } else {
- ge_dbg("Cancel button tapped, back to thumbnails view.");
- }
-}
-
-static void _ge_ext_iv_layout_cb(ui_gadget_h ug, enum ug_mode mode, void* priv)
-{
- ge_dbg("");
- GE_CHECK(priv);
- GE_CHECK(ug);
-
- Evas_Object *base = (Evas_Object *)ug_get_layout(ug);
- if (!base) {
- ge_dbgE("ug_get_layout failed!");
- ug_destroy(ug);
- return;
- }
-
- evas_object_size_hint_weight_set(base, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
- /* Disable effect to avoid BS caused by ui-gadget to
- unset ug layout after deleting it */
- ug_disable_effect(ug);
- evas_object_show(base);
-}
-
-static void _ge_ext_iv_result_cb(ui_gadget_h ug, app_control_h result, void *priv)
-{
- ge_dbg("");
- GE_CHECK(priv);
- GE_CHECK(result);
- ge_ugdata *ugd = (ge_ugdata *)priv;
- char *path = NULL;
- char *status = NULL;
-
- if (ugd->file_select_mode == GE_FILE_SELECT_T_SETAS) {
- /*If set wallpaper success, homescreen_path should not be null.
- And if setting wallpaper was canceled in IV, gallery-efl doesn't exit immediately*/
- app_control_get_extra_data(result, GE_BUNDLE_HOMESCREEN_PATH,
- &path);
- if (NULL == path)
- app_control_get_extra_data(result, GE_BUNDLE_LOCKSCREEN_PATH,
- &path);
- ge_dbg("SETAS_IMAGE_PATH");
- app_control_get_extra_data(result, "Result", &status);
- ugd->file_select_setas_mode = 0;
- if (strcmp(status, "Cancel")) {
- ugd->file_select_setas_mode = 1;
- }
-
- if (path) {
- ge_dbg(":%s", path);
- ugd->b_destroy_me = true;
- ugd->file_setas_image_path = path;
- } else {
- ugd->b_destroy_me = false;
- }
- /*If has got homescreen_path, setats_mode should not be callerid and
- crop wallpaper*/
- if (path == NULL &&
- (ugd->file_select_setas_mode == GE_SETAS_T_CALLERID ||
- ugd->file_select_setas_mode == GE_SETAS_T_CROP_WALLPAPER)) {
- app_control_get_extra_data(result, APP_CONTROL_DATA_SELECTED,
- &path);
- ge_dbg("CALLERID_CROP_IMAGE_PATH");
- if (path) {
- ge_dbg(":%s", path);
- ugd->b_destroy_me = true;
- ugd->file_setas_crop_image_path = path;
- } else {
- ugd->b_destroy_me = false;
- }
- }
- }
-
- char *error_state = NULL;
- app_control_get_extra_data(result, GE_IMAGEVIEWER_RETURN_ERROR,
- &error_state);
- if (error_state) {
- ge_dbg("error string : %s", error_state);
-
- if (!g_strcmp0(error_state, "not_supported_file_type")) {
- ugd->b_destroy_me = false;
- if (ugd->ug_path == NULL) {
- ge_dbgE("current item is NULL");
- GE_FREE(error_state);
- return;
- }
- app_control_h service;
- app_control_create(&service);
- GE_CHECK(service);
- app_control_set_operation(service, APP_CONTROL_OPERATION_VIEW);
- app_control_set_uri(service, ugd->ug_path);
- app_control_send_launch_request(service, NULL, NULL);
- app_control_destroy(service);
- }
- GE_FREE(error_state);
- }
-}
-
-static void _ge_ext_iv_destroy_cb(ui_gadget_h ug, void *priv)
-{
- ge_dbg("");
- GE_CHECK(priv);
- _ge_ext_destroy_me((ge_ugdata *)priv);
-}
-
-static void __ge_ext_iv_end_cb(ui_gadget_h ug, void *priv)
-{
- ge_dbg("");
- GE_CHECK(priv);
- ge_ugdata *ugd = (ge_ugdata *)priv;
-
- if (ugd->file_select_setas_mode == 1) {
- _ge_grid_sel_one(ugd, ugd->file_select_setas_path);
- }
-
- if (ugd->b_hide_indicator) {
- _ge_ui_hide_indicator((ge_ugdata *)priv);
- }
-}
-
-static char **__ge_ext_get_select_index(ge_ugdata *ugd, int *size)
-{
- GE_CHECK_NULL(ugd);
- GE_CHECK_NULL(ugd->selected_elist);
- char *index = NULL;
- int i = 0;
- char **media_index = NULL;
- int pos = 0;
- int sel_cnt = 0;
- ge_item *git = NULL;
- Eina_List *l = NULL;
- ge_dbg("Media count: %d", eina_list_count(ugd->selected_elist));
-
- sel_cnt = eina_list_count(ugd->selected_elist);
- ge_dbg("Item count: %d", sel_cnt);
- media_index = (char **)calloc(sel_cnt, sizeof(char *));
- GE_CHECK_NULL(media_index);
-
- EINA_LIST_FOREACH(ugd->selected_elist, l, git) {
- index = (char *)calloc(1, GE_IV_STR_LEN_MAX);
- if (git == NULL || index == NULL) {
- for (pos = 0; pos < i; ++pos) {
- GE_FREEIF(media_index[pos]);
- }
-
- GE_FREEIF(index);
- GE_FREE(media_index);
- return NULL;
- }
- ge_dbg("Sequence: %d", git->sequence - 1);
- snprintf(index, GE_IV_STR_LEN_MAX, "%d", git->sequence - 1);
- media_index[i++] = index;
- index = NULL;
- git = NULL;
- }
-
-
- if (size) {
- *size = sel_cnt;
- }
-
- return media_index;
-}
-
-/* Slideshow selected images */
-static int __ge_ext_slideshow_selected(ge_ugdata *ugd, app_control_h service)
-{
- GE_CHECK_VAL(service, -1);
- GE_CHECK_VAL(ugd, -1);
- char **media_index = NULL;
- int media_size = 0;
-#define GE_SELECTED_FILES "Selected index"
-#define GE_INDEX "Index"
-#define GE_INDEX_VALUE "1"
-
- media_index = __ge_ext_get_select_index(ugd, &media_size);
- if (media_index == NULL) {
- ge_dbgE("Invalid select index!");
- return -1;
- }
- ge_dbg("Set selected medias, media_index[%p], size[%d]", media_index,
- media_size);
- app_control_add_extra_data_array(service, GE_SELECTED_FILES,
- (const char **)media_index, media_size);
- /*free space of the medias index*/
- int i = 0;
- for (i = 0; i < media_size; ++i) {
- ge_dbg("Set selected medias, media_index[%s]", media_index[i]);
- GE_FREEIF(media_index[i]);
- }
- GE_FREE(media_index);
- media_index = NULL;
-
- app_control_add_extra_data(service, GE_INDEX, GE_INDEX_VALUE);
- return 0;
-}
-
-static int __ge_ext_set_slideshow_data(ge_ugdata *ugd, char *file_url,
- app_control_h service)
-{
- GE_CHECK_VAL(service, -1);
- GE_CHECK_VAL(file_url, -1);
- GE_CHECK_VAL(ugd, -1);
-
- app_control_add_extra_data(service, GE_PATH, file_url);
- app_control_add_extra_data(service, GE_VIEW_MODE, "SLIDESHOW");
- app_control_add_extra_data(service, "Sort By", "DateDesc");
- if (ugd->file_type_mode == GE_FILE_T_IMAGE) {
- app_control_add_extra_data(service, GE_MEDIA_TYPE, "Image");
- } else if (ugd->file_type_mode == GE_FILE_T_VIDEO) {
- app_control_add_extra_data(service, GE_MEDIA_TYPE, "Video");
- } else {
- app_control_add_extra_data(service, GE_MEDIA_TYPE, "All");
- }
- if (__ge_ext_slideshow_selected(ugd, service) != 0) {
- ge_dbgE("Create UG failed!");
- return -1;
- }
-
- switch (ugd->slideshow_viewby) {
- case GE_VIEW_BY_ALL:
- case GE_VIEW_BY_ALBUMS:
- if (ugd->slideshow_album_id == NULL) {
- ge_dbgE("Create UG failed!");
- return -1;
- }
- app_control_add_extra_data(service, "Album index", ugd->slideshow_album_id);
- if (!g_strcmp0(ugd->slideshow_album_id, GE_ALBUM_ALL_ID)) {
- app_control_add_extra_data(service, GE_VIEW_BY, "All");
- } else {
- app_control_add_extra_data(service, GE_VIEW_BY, "By Folder");
- }
- break;
- default:
- return -1;
- }
- return 0;
-}
-
-static int __ge_ext_set_setas_data(ge_ugdata *ugd, char *file_url,
- app_control_h service)
-{
- GE_CHECK_VAL(service, -1);
- GE_CHECK_VAL(file_url, -1);
- GE_CHECK_VAL(ugd, -1);
-
- if (file_url) {
- app_control_add_extra_data(service, GE_PATH, file_url);
- GE_FREEIF(ugd->ug_path);
- ugd->ug_path = strdup(file_url);
- }
- app_control_add_extra_data(service, GE_VIEW_MODE, "SETAS");
-
- if (ugd->file_select_setas_mode == GE_SETAS_T_WALLPAPER) {
- app_control_add_extra_data(service, GE_SETAS_TYPE, "Wallpaper");
- } else if (ugd->file_select_setas_mode == GE_SETAS_T_LOCKPAPER) {
- app_control_add_extra_data(service, GE_SETAS_TYPE, "Lockscreen");
- } else if (ugd->file_select_setas_mode == GE_SETAS_T_WALLPAPER_LOCKPAPER) {
- app_control_add_extra_data(service, GE_SETAS_TYPE, "Wallpaper & Lockscreen");
- } else if (ugd->file_select_setas_mode == GE_SETAS_T_CROP_WALLPAPER) {
- app_control_add_extra_data(service, GE_SETAS_TYPE, "Wallpaper Crop");
- app_control_add_extra_data(service, "Fixed ratio", "TRUE");
-
- int x = 0;
- int y = 0;
- int w = 0;
- int h = 0;
- elm_win_screen_size_get((Evas_Object *)ug_get_window(), &x, &y, &w, &h);
- char *reso_str = (char *)calloc(1, GE_IV_STR_LEN_MAX);
- if (reso_str == NULL) {
- ge_dbgE("Calloc failed!");
- return -1;
- }
- snprintf(reso_str, GE_IV_STR_LEN_MAX, "%dx%d", w, h);
- ge_dbgW("Window Resolution: %dx%d, %s", w, h, reso_str);
- app_control_add_extra_data(service, "Resolution", reso_str);
- GE_FREE(reso_str);
- } else if (ugd->file_select_setas_mode == GE_SETAS_T_CALLERID) {
- app_control_add_extra_data(service, GE_SETAS_TYPE, "CallerID");
- }
- return 0;
-}
-
-int _ge_ext_load_iv_ug(ge_ugdata *ugd, char *file_url, char *album_index, int image_index)
-{
- GE_CHECK_VAL(file_url, -1);
- GE_CHECK_VAL(ugd, -1);
- struct ug_cbs cbs;
- ui_gadget_h ug = NULL;
- app_control_h service = NULL;
-
- if (ugd->ug_called_by_me) {
- ge_dbgW("Already exits some UG called by me!");
- return -1;
- }
-
- memset(&cbs, 0x00, sizeof(struct ug_cbs));
- cbs.layout_cb = _ge_ext_iv_layout_cb;
- cbs.result_cb = _ge_ext_iv_result_cb;
- cbs.destroy_cb = _ge_ext_iv_destroy_cb;
- cbs.end_cb = __ge_ext_iv_end_cb;
- cbs.priv = ugd;
-
- app_control_create(&service);
- GE_CHECK_VAL(service, -1);
-
- if (ugd->file_select_mode == GE_FILE_SELECT_T_SLIDESHOW) {
- if (__ge_ext_set_slideshow_data(ugd, file_url, service) < 0) {
- ge_dbgE("Set slideshow data failed!");
- app_control_destroy(service);
- return -1;
- }
- } else {
- if (__ge_ext_set_setas_data(ugd, file_url, service) < 0) {
- ge_dbgE("Set setas data failed!");
- app_control_destroy(service);
- return -1;
- }
- }
-
- evas_object_smart_callback_call(ugd->naviframe, "gallery,freeze,resize", (void *)1);
- app_control_add_extra_data(service, "View By", "All");
- app_control_add_extra_data(service, "Album index", album_index);
- app_control_add_extra_data(service, "Path", file_url);
- app_control_add_extra_data(service, "Sort By", "Name");
- char image_index_str[12];
- eina_convert_itoa(image_index, image_index_str);
- app_control_add_extra_data(service, "Index", image_index_str);
-
- app_control_set_app_id(service, GE_IV_UG_NAME);
- ug = ug_create(ugd->ug, GE_IV_UG_NAME, UG_MODE_FULLVIEW, service, &cbs);
- ugd->ug_called_by_me = ug;
-
- app_control_destroy(service);
- if (!ug) {
- ge_dbgE("Create UG failed!");
- return -1;
- } else {
- ge_dbg("Create UG successully");
- return 0;
- }
-
-}
-
-int _ge_ext_load_iv_ug_for_help(ge_ugdata *ugd, const char *uri)
-{
- GE_CHECK_VAL(ugd, -1);
- struct ug_cbs cbs;
- ui_gadget_h ug = NULL;
- app_control_h service = NULL;
-
- if (ugd->ug_called_by_me) {
- ge_dbgW("Already exits some UG called by me!");
- return -1;
- }
-
- memset(&cbs, 0x00, sizeof(struct ug_cbs));
- cbs.layout_cb = _ge_ext_iv_layout_cb;
- cbs.result_cb = _ge_ext_iv_result_cb;
- cbs.destroy_cb = _ge_ext_iv_destroy_cb;
- cbs.end_cb = __ge_ext_iv_end_cb;
- cbs.priv = ugd;
-
- app_control_create(&service);
- GE_CHECK_VAL(service, -1);
-
- /* Set "HELP" to "View Mode" */
- app_control_add_extra_data(service, GE_VIEW_MODE, "HELP");
-
- /* Set help uri to file path */
- app_control_add_extra_data(service, GE_PATH, uri);
-
- ug = ug_create(ugd->ug, GE_IV_UG_NAME, UG_MODE_FULLVIEW, service, &cbs);
- ugd->ug_called_by_me = ug;
- app_control_destroy(service);
- if (ug != NULL) {
- ge_dbg("Create UG successully");
- return 0;
- } else {
- ge_dbgE("Create UG failed!");
- return -1;
- }
-}
/*
-* Copyright (c) 2000-2015 Samsung Electronics Co., Ltd All Rights Reserved
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*
-*/
+ * Copyright (c) 2015 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://floralicense.org/license/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
#include "ge-file-util.h"
#include <string.h>
-char* ge_file_dir_get(const char path[])
-{
- char *p = NULL;
- char buf[256] = {0,};
- struct stat info = {0,};
-
- if (stat(path, &info) == 0) {
- strncpy(buf, path, 256);
- buf[256 - 1] = 0;
- p = dirname(buf);
- return strdup(p);
- } else {
- return "";
- }
-}
int ge_file_exists(const char *path)
{
- struct stat info = {0,};
+ struct stat info = { 0, };
if (stat(path, &info) == 0) {
return 1;
int ge_file_size(const char *filename)
{
- struct stat info = {0,};
+ struct stat info = { 0, };
if (stat(filename, &info) == 0) {
if (!S_ISDIR(info.st_mode)) {
return info.st_size;
+++ /dev/null
-/*
-* Copyright (c) 2000-2015 Samsung Electronics Co., Ltd All Rights Reserved
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*
-*/
-
-#include "ge-lang.h"
-#include "ge-ui-util.h"
-#include "ge-util.h"
-#include "ge-data.h"
-#include "ge-gridview.h"
-#include "ge-main-view.h"
-
-int _ge_lang_update(ge_ugdata *ugd)
-{
- GE_CHECK_VAL(ugd, -1);
- int view_m = _ge_get_view_mode(ugd);
- ge_dbg("view: %d", view_m);
-
- if (view_m == GE_VIEW_THUMBS || view_m == GE_VIEW_THUMBS_EDIT) {
- _ge_grid_update_lang(ugd);
- }
- return 0;
-}
-
/*
-* Copyright (c) 2000-2015 Samsung Electronics Co., Ltd All Rights Reserved
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*
-*/
+ * Copyright (c) 2015 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://floralicense.org/license/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
#include <notification.h>
#include "ge-ui-util.h"
#include "ge-util.h"
-#include "ge-button.h"
-#include "ge-gridview.h"
#include "ge-albums.h"
#include "ge-data.h"
#include "ge-icon.h"
#include <efl_extension.h>
-#define GE_NOBUT_EXIT_POPUP_HIDE_TIME_DELAY 3.0
-static void _ge_ui_response_cb(void *data, Evas_Object *obj, void *ei)
-{
- GE_CHECK(data);
- ge_ugdata *ugd = (ge_ugdata *)data;
- ge_dbg("popup mode: %d", ugd->popup_mode);
-
- evas_object_del(obj);
- ugd->popup = NULL;
-}
-
-static Eina_Bool __ge_popup_timeout_cb(void *data)
-{
- GE_CHECK_FALSE(data);
- ge_ugdata *ugd = (ge_ugdata *)data;
- if (ugd->del_timer) {
- ecore_timer_del(ugd->del_timer);
- ugd->del_timer = NULL;
- }
-
- /* Used for adding shortcut failed */
- if (ugd->popup_mode == GE_POPUP_EXIT) {
- ge_dbgW("Terminate me!");
- if (!ugd->is_attach_panel) {
- ug_destroy_me(ugd->ug);
- ugd->ug = NULL;
- }
- }
-
- GE_IF_DEL_OBJ(ugd->popup);
- return ECORE_CALLBACK_CANCEL;
-}
-
-static int __ge_popup_add_timer(void *data, double to_inc)
-{
- GE_CHECK_VAL(data, -1);
- ge_ugdata *ugd = (ge_ugdata *)data;
- if (ugd->del_timer) {
- ecore_timer_del(ugd->del_timer);
- ugd->del_timer = NULL;
- }
-
- ugd->del_timer = ecore_timer_add(to_inc, __ge_popup_timeout_cb, data);
- return 0;
-}
-
-Evas_Object* ge_ui_load_edj(Evas_Object *parent, const char *file, const char *group)
+Evas_Object *ge_ui_load_edj(Evas_Object * parent, const char *file,
+ const char *group)
{
GE_CHECK_NULL(parent);
GE_CHECK_NULL(file);
return NULL;
}
- evas_object_size_hint_weight_set(eo, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
- evas_object_size_hint_align_set(eo, EVAS_HINT_FILL, EVAS_HINT_FILL);
+ evas_object_size_hint_weight_set(eo, EVAS_HINT_EXPAND,
+ EVAS_HINT_EXPAND);
+ evas_object_size_hint_align_set(eo, EVAS_HINT_FILL,
+ EVAS_HINT_FILL);
}
return eo;
}
-Evas_Object* ge_ui_create_nocontents(ge_ugdata* ugd)
-{
- GE_CHECK_NULL(ugd);
- Evas_Object *layout = NULL;
- char label_str[GE_NOCONTENTS_LABEL_LEN_MAX] = {0,};
-
- if (_ge_get_view_mode(ugd) == GE_VIEW_THUMBS ||
- _ge_get_view_mode(ugd) == GE_VIEW_THUMBS_EDIT) {
- if (ugd->file_type_mode) {
- if (ugd->file_type_mode == GE_FILE_T_IMAGE)
- snprintf(label_str, sizeof(label_str),
- "%s", (char*)GE_STR_NO_IMAGES);
- else if (ugd->file_type_mode == GE_FILE_T_VIDEO)
- snprintf(label_str, sizeof(label_str),
- "%s", (char*)GE_STR_NO_VIDEOS);
- else
- snprintf(label_str, sizeof(label_str),
- "%s", (char*)GE_STR_NO_ITEMS);
- } else {
- snprintf(label_str, sizeof(label_str), "%s",
- (char*)GE_STR_NO_ITEMS);
- }
- } else if (_ge_get_view_mode(ugd) == GE_VIEW_ALBUMS) {
- snprintf(label_str, sizeof(label_str), "%s",
- (char*)GE_STR_NO_ALBUMS);
- } else {
- ge_dbgE("view mode is error.");
- }
-
- ge_dbg("\nNocontents label: %s", label_str);
- /* Full nocontents view layout */
- layout = elm_layout_add(ugd->naviframe);
- GE_CHECK_NULL(layout);
- elm_layout_theme_set(layout, "layout", "nocontents", "text");
- elm_object_part_text_set(layout, "elm.text", label_str);
-
- return layout;
-}
-
-Evas_Object *ge_ui_create_main_ly(Evas_Object *parent)
+Evas_Object *ge_ui_create_main_ly(Evas_Object * parent)
{
GE_CHECK_NULL(parent);
Evas_Object *layout = NULL;
/* Apply the layout style */
const char *profile = elm_config_profile_get();
ge_dbg("profile: %s", profile);
- if (!g_strcmp0(profile, "mobile")) {
- elm_layout_theme_set(layout, "layout", "application",
- "default");
+ if (!g_strcmp0(profile, "mobile")) {
+ elm_layout_theme_set(layout, "layout", "application", "default");
} else if (!g_strcmp0(profile, "extension")) {
elm_layout_theme_set(layout, "layout", "application",
- "noindicator");
+ "noindicator");
} else {
- elm_layout_theme_set(layout, "layout", "application",
- "default");
+ elm_layout_theme_set(layout, "layout", "application", "default");
}
evas_object_size_hint_weight_set(layout, EVAS_HINT_EXPAND,
- EVAS_HINT_EXPAND);
+ EVAS_HINT_EXPAND);
evas_object_show(layout);
return layout;
}
-Evas_Object* ge_ui_create_naviframe(ge_ugdata *ugd, Evas_Object *parent)
+Evas_Object *ge_ui_create_naviframe(ge_ugdata * ugd, Evas_Object * parent)
{
GE_CHECK_NULL(ugd);
GE_CHECK_NULL(parent);
return nf;
}
-Evas_Object* ge_ui_create_popup(ge_ugdata* ugd, ge_popup_mode_e mode,
- char* desc)
-{
- ge_dbg("");
- GE_CHECK_NULL(ugd);
- GE_CHECK_NULL(desc);
-
- if (ugd->popup) {
- ge_dbg("The existed popup is deleted");
- evas_object_del(ugd->popup);
- ugd->popup = NULL;
- }
-
- Evas_Object *popup = NULL;
-
- popup = elm_popup_add(ugd->ly_main);
- GE_CHECK_NULL(popup);
-
- /*Delete the Popup if the Popup has a BACK event.*/
- eext_object_event_callback_add(popup, EEXT_CALLBACK_BACK, eext_popup_back_cb,
- NULL);
-
- evas_object_size_hint_weight_set(popup, EVAS_HINT_EXPAND,
- EVAS_HINT_EXPAND);
- elm_object_text_set(popup, desc);
-
- switch (mode) {
- case GE_POPUP_NOBUT:
- case GE_POPUP_EXIT:
- __ge_popup_add_timer(ugd, GE_NOBUT_EXIT_POPUP_HIDE_TIME_DELAY);
- break;
- case GE_POPUP_ONEBUT: {
- Evas_Object *btn = NULL;
- btn = _ge_but_create_but(popup, ugd->th, NULL, GE_STR_ID_OK,
- GE_BTN_POPUP, _ge_ui_response_cb, ugd);
- elm_object_part_content_set(popup, "button1", btn);
- break;
- }
- case GE_POPUP_TWOBUT: {
- Evas_Object *btn1 = NULL;
- btn1 = _ge_but_create_but(popup, ugd->th, NULL, GE_STR_ID_OK,
- GE_BTN_POPUP, _ge_ui_response_cb,
- ugd);
- elm_object_part_content_set(popup, "button1", btn1);
- Evas_Object *btn2 = NULL;
- btn2 = _ge_but_create_but(popup, ugd->th, NULL, GE_STR_ID_CANCEL,
- GE_BTN_POPUP, _ge_ui_response_cb,
- ugd);
- elm_object_part_content_set(popup, "button2", btn2);
- break;
- }
- default:
- ge_dbgE("mode is not supported...");
- break;
- }
-
- evas_object_show(popup);
-
- ugd->popup = popup;
- ugd->popup_mode = mode;
-
- return popup;
-}
-
-int _ge_ui_create_notiinfo(const char *text)
-{
- GE_CHECK_VAL(text, -1);
- int ret = notification_status_message_post(text);
- if (ret != 0) {
- ge_sdbgE("status_message_post()... [0x%x]!", ret);
- }
- return ret;
-}
-
-/* *
-* In case of system folder, the displayed name should be translated into system language
-*
-* @param name
-* check album display name for getting proper translation
-*
-* @return
-* the translated album display name
-*/
-char *_ge_ui_get_i18n_album_name(ge_album_s *cluster)
-{
- GE_CHECK_NULL(cluster);
- char *i18n_name = NULL;
-
- if (_ge_data_is_camera_album(cluster)) {
- /* system folder name: Camera */
- i18n_name = GE_STR_CAMERA;
- } else if (_ge_data_is_default_album(GE_ALBUM_DOWNLOADS_NAME, cluster)) {
- /* system folder name: Downloads */
- i18n_name = GE_STR_DOWNLOADS;
- } else if (cluster->type == GE_ALL) {
- /* Update data in memory */
- GE_FREEIF(cluster->display_name);
- cluster->display_name = strdup(GE_ALBUM_ALL_NAME);
- i18n_name = cluster->display_name;
- } else if (cluster->type == GE_PHONE || cluster->type == GE_MMC) {
- if (_ge_data_is_root_path(cluster->path)) {
- /* check root case */
- i18n_name = GE_ALBUM_ROOT_NAME;
- } else {
- /* if the folder is not a system folder, return itself */
- i18n_name = cluster->display_name;
- }
- } else {
- /* if the folder is not a system folder, return itself */
- i18n_name = cluster->display_name;
- }
-
- if (i18n_name == NULL || strlen(i18n_name) <= 0) {
- i18n_name = GE_ALBUM_ROOT_NAME;
- }
-
- return i18n_name;
-}
-
-int _ge_ui_reset_scroller_pos(Evas_Object *obj)
+int _ge_ui_reset_scroller_pos(Evas_Object * obj)
{
GE_CHECK_VAL(obj, -1);
- evas_object_data_set(obj, "prev_scroller_x", (void *)0);
- evas_object_data_set(obj, "prev_scroller_y", (void *)0);
- evas_object_data_set(obj, "prev_scroller_w", (void *)0);
- evas_object_data_set(obj, "prev_scroller_h", (void *)0);
+ evas_object_data_set(obj, "prev_scroller_x", (void *) 0);
+ evas_object_data_set(obj, "prev_scroller_y", (void *) 0);
+ evas_object_data_set(obj, "prev_scroller_w", (void *) 0);
+ evas_object_data_set(obj, "prev_scroller_h", (void *) 0);
return 0;
}
-int _ge_ui_del_scroller_pos(Evas_Object *obj)
-{
- GE_CHECK_VAL(obj, -1);
- evas_object_data_del(obj, "prev_scroller_x");
- evas_object_data_del(obj, "prev_scroller_y");
- evas_object_data_del(obj, "prev_scroller_w");
- evas_object_data_del(obj, "prev_scroller_h");
- return 0;
-}
-
-int _ge_ui_save_scroller_pos(Evas_Object *obj)
-{
- GE_CHECK_VAL(obj, -1);
- Evas_Coord x = 0;
- Evas_Coord y = 0;
- Evas_Coord w = 0;
- Evas_Coord h = 0;
-
- elm_scroller_region_get(obj, &x, &y, &w, &h);
- ge_dbg("(%dx%d), (%dx%d)", x, y, w, h);
- evas_object_data_set(obj, "prev_scroller_x", (void *)x);
- evas_object_data_set(obj, "prev_scroller_y", (void *)y);
- evas_object_data_set(obj, "prev_scroller_w", (void *)w);
- evas_object_data_set(obj, "prev_scroller_h", (void *)h);
- return 0;
-}
-
-int _ge_ui_restore_scroller_pos(Evas_Object *obj)
-{
- GE_CHECK_VAL(obj, -1);
- Evas_Coord x = 0;
- Evas_Coord y = 0;
- Evas_Coord w = 0;
- Evas_Coord h = 0;
-
- x = (Evas_Coord)evas_object_data_get(obj, "prev_scroller_x");
- y = (Evas_Coord)evas_object_data_get(obj, "prev_scroller_y");
- w = (Evas_Coord)evas_object_data_get(obj, "prev_scroller_w");
- h = (Evas_Coord)evas_object_data_get(obj, "prev_scroller_h");
- ge_dbg("(%dx%d), (%dx%d)", x, y, w, h);
- if (w > 0 && h > 0) {
- elm_scroller_region_show(obj, x, y, w, h);
- }
- return 0;
-}
-
-int _ge_ui_set_translate_str(Evas_Object *obj, const char *str)
+int _ge_ui_set_translate_str(Evas_Object * obj, const char *str)
{
GE_CHECK_VAL(str, -1);
GE_CHECK_VAL(obj, -1);
return 0;
}
-int _ge_ui_set_translate_part_str(Evas_Object *obj, const char *part,
- const char *str)
+int _ge_ui_set_translate_part_str(Evas_Object * obj, const char *part,
+ const char *str)
{
GE_CHECK_VAL(str, -1);
GE_CHECK_VAL(part, -1);
return 0;
}
-int _ge_ui_set_translatable_item(Elm_Object_Item *nf_it, const char *str)
-{
- GE_CHECK_VAL(str, -1);
- GE_CHECK_VAL(nf_it, -1);
- char *domain = GE_STR_DOMAIN_LOCAL;
- elm_object_item_domain_text_translatable_set(nf_it, domain, EINA_TRUE);
- return 0;
-}
-
-/* Update the label text for selected item showed in naviframe title */
-int _ge_ui_update_label_text(Elm_Object_Item *nf_it, int sel_cnt,
- const char *text)
-{
- GE_CHECK_VAL(nf_it, -1);
- ge_sdbg("Count: %d, text: %s", sel_cnt, text);
- char *pd_selected = GE_STR_PD_SELECTED;
-
- /* Update the label text */
- if (sel_cnt > 0) {
- char *text = NULL;
- text = g_strdup_printf(pd_selected, sel_cnt);
- elm_object_item_text_set(nf_it, text);
- GE_GFREEIF(text);
- } else {
- /* Don't need to update text if it's called by language_changed_cb*/
- elm_object_item_text_set(nf_it, text);
- _ge_ui_set_translatable_item(nf_it, text);
- }
- return 0;
-}
-
-int _ge_ui_get_indicator_state(ge_ugdata *ugd)
+int _ge_ui_get_indicator_state(ge_ugdata * ugd)
{
GE_CHECK_VAL(ugd, -1);
/* Save old view's indicator values */
ugd->indi_mode = elm_win_indicator_mode_get(ugd->win);
ugd->indi_o_mode = elm_win_indicator_opacity_get(ugd->win);
ge_dbgW("indi_o_mode: %d, indi_mode: %d", ugd->indi_o_mode,
- ugd->indi_mode);
+ ugd->indi_mode);
/* Save old view's overlap mode */
- ugd->overlap_mode = (int)evas_object_data_get(ugd->conform, "overlap");
+ ugd->overlap_mode =
+ (int) evas_object_data_get(ugd->conform, "overlap");
ge_dbgW("overlap_mode: %d", ugd->overlap_mode);
return 0;
}
-int _ge_ui_hide_indicator(ge_ugdata *ugd)
+int _ge_ui_hide_indicator(ge_ugdata * ugd)
{
GE_CHECK_VAL(ugd, -1);
/* transparent indicator setting */
elm_win_indicator_mode_set(ugd->win, ELM_WIN_INDICATOR_SHOW);
elm_win_indicator_opacity_set(ugd->win, ELM_WIN_INDICATOR_TRANSPARENT);
/* Modify to start content from 0,0 */
- elm_object_signal_emit(ugd->conform, "elm,state,indicator,overlap", "");
+ elm_object_signal_emit(ugd->conform, "elm,state,indicator,overlap",
+ "");
/* Save overlap mode when showing new view(ex: ug) */
- evas_object_data_set(ugd->conform, "overlap", (void *)EINA_TRUE);
- return 0;
-}
-
-#ifdef _USE_HIDE_INDICATOR
-/********Restore indicator state of caller*********/
-int _ge_ui_reset_indicator(ge_ugdata *ugd)
-{
- GE_CHECK_VAL(ugd, -1);
- ge_dbgW("indi_o_mode: %d, indi_mode: %d", ugd->indi_o_mode,
- ugd->indi_mode);
- ge_dbgW("overlap_mode: %d", ugd->overlap_mode);
- /* Set old view's indicator */
- elm_win_indicator_mode_set(ugd->win, ugd->indi_mode);
- elm_win_indicator_opacity_set(ugd->win, ugd->indi_o_mode);
- /* set old view's conformant overlap mode
- if layout is different with new view and needs starts from (0,60) */
- if (!ugd->overlap_mode) {
- elm_object_signal_emit(ugd->conform,
- "elm,state,indicator,nooverlap", "");
- evas_object_data_set(ugd->conform, "overlap", NULL);
- }
- ge_dbgW("indicator restored done!");
- return 0;
-}
-#endif
-
-Evas_Object *_ge_ui_add_toolbar(Evas_Object *parent)
-{
- Evas_Object *toolbar = elm_toolbar_add(parent);
- GE_CHECK_NULL(toolbar);
- elm_object_style_set(toolbar, "default");
- elm_toolbar_shrink_mode_set(toolbar, ELM_TOOLBAR_SHRINK_EXPAND);
- elm_toolbar_transverse_expanded_set(toolbar, EINA_TRUE);
- elm_toolbar_select_mode_set(toolbar, ELM_OBJECT_SELECT_MODE_NONE);
- return toolbar;
-}
-
-Elm_Object_Item *_ge_ui_append_item(Evas_Object *obj, const char *icon,
- const char *label, Evas_Smart_Cb func,
- const void *data)
-{
- Elm_Object_Item *it = NULL;
- it = elm_toolbar_item_append(obj, icon, label, func, data);
- _ge_ui_set_translatable_item(it, label);
- return it;
-}
-
-int _ge_ui_disable_item(Elm_Object_Item *it, Eina_Bool b_disabled)
-{
- GE_CHECK_VAL(it, -1);
- /* dlog fatal is enabled. Elm_Object_Item cannot be NULL. */
- elm_object_item_disabled_set(it, b_disabled);
+ evas_object_data_set(ugd->conform, "overlap", (void *) EINA_TRUE);
return 0;
}
-
/*
-* Copyright (c) 2000-2015 Samsung Electronics Co., Ltd All Rights Reserved
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*
-*/
+ * Copyright (c) 2015 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://floralicense.org/license/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
#include <sys/stat.h>
#include <errno.h>
#include <math.h>
#include <storage.h>
#include "ge-albums.h"
-#include "ge-gridview.h"
#include "ge-data.h"
#include "ge-util.h"
#include "ge-ui-util.h"
#include "ge-icon.h"
-#include "ge-ext-exec.h"
-
-#define GE_AUL_PREFIX "gallery:"
-/* For local album */
-#define GE_AUL_ALBUM "album"
-/* For IMAGE */
-#define GE_AUL_IMAGEVIEWER "imageviewer"
-#define GE_TIME_MSEC_PER_SEC 1000
-#define GE_TIME_SEC_PER_MIN 60
-#define GE_TIME_MIN_PER_HOUR 60
-#define GE_TIME_SEC_PER_HOUR (GE_TIME_MIN_PER_HOUR * GE_TIME_SEC_PER_MIN)
-
-#define GE_PERIOD_LIVEBOX 30.0
static int __externalStorageId = 0;
-bool getSupportedStorages_cb(int storageId, storage_type_e type, storage_state_e state, const char *path, void *userData)
+bool getSupportedStorages_cb(int storageId, storage_type_e type,
+ storage_state_e state, const char *path,
+ void *userData)
{
ge_dbg("");
return true;
}
-static void _ge_db_update_sdcard_info(int storage_id, storage_state_e state, void *user_data)
+static void _ge_db_update_sdcard_info(int storage_id,
+ storage_state_e state,
+ void *user_data)
{
ge_dbgW("Storage state changed!");
GE_CHECK(user_data);
- int error = storage_foreach_device_supported(getSupportedStorages_cb, NULL);
+ int error =
+ storage_foreach_device_supported(getSupportedStorages_cb, NULL);
if (error == STORAGE_ERROR_NONE) {
storage_state_e mmc_state;
int ret = storage_get_state(__externalStorageId, &mmc_state);
/* Update view */
if (mmc_state == STORAGE_STATE_MOUNTED) {
ge_dbg("mmc_state[%d]: STORAGE_STATE_MOUNTED", mmc_state);
- ge_update_view((ge_ugdata*)user_data, GE_UPDATE_MMC_ADDED);
+ ge_update_view((ge_ugdata *) user_data, GE_UPDATE_MMC_ADDED);
} else if (mmc_state == STORAGE_STATE_REMOVED) {
ge_dbg("mmc_state[%d]: STORAGE_STATE_REMOVED", mmc_state);
- ge_update_view((ge_ugdata*)user_data, GE_UPDATE_MMC_REMOVED);
+ ge_update_view((ge_ugdata *) user_data, GE_UPDATE_MMC_REMOVED);
} else if (mmc_state == STORAGE_STATE_UNMOUNTABLE) {
ge_dbg("mmc_state[%d]: STORAGE_STATE_UNMOUNTABLE", mmc_state);
- ge_update_view((ge_ugdata*)user_data, GE_UPDATE_MMC_REMOVED);
+ ge_update_view((ge_ugdata *) user_data, GE_UPDATE_MMC_REMOVED);
}
}
}
-Eina_Bool ge_update_view(ge_ugdata* ugd, int mode)
+Eina_Bool ge_update_view(ge_ugdata * ugd, int mode)
{
ge_dbg("mode: %d", mode);
GE_CHECK_FALSE(ugd);
- int view_mode = _ge_get_view_mode(ugd);
- ge_dbg("view_mode: %d", view_mode);
int ret = -1;
ret = ge_update_gengrid(ugd);
return EINA_TRUE;
}
-int ge_reg_db_update_noti(ge_ugdata* ugd)
+int ge_reg_db_update_noti(ge_ugdata * ugd)
{
ge_dbg("");
GE_CHECK_VAL(ugd, -1);
int error_code = 0;
- error_code = storage_set_state_changed_cb(__externalStorageId, _ge_db_update_sdcard_info, ugd);
+ error_code =
+ storage_set_state_changed_cb(__externalStorageId,
+ _ge_db_update_sdcard_info, ugd);
if (error_code != STORAGE_ERROR_NONE) {
ge_dbgE("storage_set_state_changed_cb failed!");
}
ge_dbg("");
int error_code = -1;
- error_code = storage_unset_state_changed_cb(__externalStorageId, _ge_db_update_sdcard_info);
+ error_code =
+ storage_unset_state_changed_cb(__externalStorageId,
+ _ge_db_update_sdcard_info);
if (error_code != STORAGE_ERROR_NONE) {
ge_dbgE("storage_set_state_changed_cb failed!");
}
return 0;
}
-bool _ge_is_image_valid(void *data, char *filepath)
-{
- GE_CHECK_FALSE(data);
- ge_ugdata *ugd = (ge_ugdata *)data;
- GE_CHECK_FALSE(filepath);
-
- Evas_Object *image = NULL;
- int width = 0;
- int height = 0;
- Evas *evas = NULL;
-
- evas = evas_object_evas_get(ugd->win);
- GE_CHECK_FALSE(evas);
-
- image = evas_object_image_add(evas);
- GE_CHECK_FALSE(image);
-
- evas_object_image_filled_set(image, 0);
- evas_object_image_load_scale_down_set(image, 0);
- evas_object_image_file_set(image, filepath, NULL);
- evas_object_image_size_get(image, &width, &height);
- if (image) {
- evas_object_del(image);
- image = NULL;
- }
-
- if (width <= 0 || height <= 0) {
- ge_sdbg("Cannot load file : %s", filepath);
- return false;
- }
-
- return true;
-}
-
-/* Change int to char * of video duration, caller need to free the allocated memory */
-char *_ge_get_duration_string(unsigned int v_dur)
-{
- char *dur_str = calloc(1, GE_FILE_PATH_LEN_MAX);
- GE_CHECK_NULL(dur_str);
- if (v_dur > 0) {
- int duration = floor(v_dur / GE_TIME_MSEC_PER_SEC);
- int dur_hr = 0;
- int dur_min = 0;
- int dur_sec = 0;
- int tmp = 0;
-
- if (duration >= GE_TIME_SEC_PER_HOUR) {
- dur_sec = duration % GE_TIME_SEC_PER_MIN;
- tmp = floor(duration / GE_TIME_SEC_PER_MIN);
- dur_min = tmp % GE_TIME_MIN_PER_HOUR;
- dur_hr = floor(tmp / GE_TIME_MIN_PER_HOUR);
- } else if (duration >= GE_TIME_SEC_PER_MIN) {
- dur_hr = 0;
- dur_min = floor(duration / GE_TIME_SEC_PER_MIN);
- dur_sec = duration % GE_TIME_SEC_PER_MIN;
- } else {
- dur_hr = 0;
- dur_min = 0;
- dur_sec = duration % GE_TIME_SEC_PER_MIN;
- }
-
- snprintf(dur_str, GE_FILE_PATH_LEN_MAX, "%02d:%02d:%02d",
- dur_hr, dur_min, dur_sec);
- } else {
- snprintf(dur_str, GE_FILE_PATH_LEN_MAX, "00:00:00");
- }
- dur_str[strlen(dur_str)] = '\0';
- return dur_str;
-}
-
-ge_view_mode _ge_get_view_mode(ge_ugdata *ugd)
-{
- GE_CHECK_VAL(ugd, -1);
- return ugd->view_mode;
-}
-
-int _ge_set_view_mode(ge_ugdata *ugd, ge_view_mode mode)
-{
- GE_CHECK_VAL(ugd, -1);
- ugd->view_mode = mode;
- return 0;
-}
-
-double _ge_get_win_factor(Evas_Object *win, bool b_hide_indicator, int *width,
- int *height)
-{
- if (win == NULL) {
- ge_dbgE("Invalid window!");
- return 1.0f;
- }
-
- double factor = 1.0f;
- int win_x = 0;
- int win_y = 0;
- int win_w = 0;
- int win_h = 0;
-
- elm_win_screen_size_get(win, &win_x, &win_y, &win_w, &win_h);
- ge_dbg("Window size: %dx%d, %dx%d", win_x, win_y, win_w, win_h);
- int win_p_h = win_w > win_h ? win_w : win_h;
- double scale = elm_config_scale_get();
- ge_dbg("scale: %f", scale);
- int fixed_h = GE_FIXED_HEIGHT;
- if (b_hide_indicator) {
- fixed_h = GE_FIXED_HEIGHT_HIDE;
- }
- if (win_p_h < GE_BASE_WIN_HEIGHT) {
- factor = (double)(win_p_h - (int)(fixed_h * scale)) / (double)(GE_BASE_WIN_HEIGHT - fixed_h);
- } else if (scale > factor) {
- factor = (GE_BASE_WIN_HEIGHT - fixed_h * scale) / (GE_BASE_WIN_HEIGHT - fixed_h);
- } else if (scale < factor) {
- factor = (GE_BASE_WIN_HEIGHT - fixed_h) / (GE_BASE_WIN_HEIGHT - fixed_h * scale);
- } else {
- factor = scale;
- }
- ge_dbg("factor: %f", factor);
- if (width) {
- *width = win_w;
- }
- if (height) {
- *height = win_h;
- }
- return factor;
-}
-
-int _ge_send_result(ge_ugdata *ugd)
-{
- GE_CHECK_VAL(ugd, -1);
- ge_dbg("");
-
- if (!ugd->b_multifile) {
- ge_dbgW("Not in multiple files selection mode!");
- return -1;
- }
- /* file selection mode */
- char *paths = NULL;
- char **path_array = NULL; /* the array size is sel_cnt */
- bool send_success = true;
- int sel_cnt = 0;
- int i = 0;
-
- _ge_data_get_sel_paths(ugd, &paths, &path_array, &sel_cnt);
- if (sel_cnt <= 0) {
- ge_dbgE("Invalid selected path count!");
- send_success = false;
- goto GE_SEND_RESULT_FINISHED;
- }
- if (sel_cnt <= 0 || !path_array) {
- ge_dbgE("Invalid selection or paths");
- app_control_add_extra_data(ugd->service,
- GE_FILE_SELECT_RETURN_COUNT, "0");
- app_control_add_extra_data(ugd->service, GE_FILE_SELECT_RETURN_PATH,
- NULL);
- app_control_add_extra_data(ugd->service, APP_CONTROL_DATA_SELECTED,
- NULL);
- app_control_add_extra_data(ugd->service, APP_CONTROL_DATA_PATH,
- NULL);
- ug_send_result_full(ugd->ug, ugd->service,
- APP_CONTROL_RESULT_FAILED);
- } else {
- if (ugd->file_select_mode == GE_FILE_SELECT_T_IMFT) {
- _ge_ext_load_app(ugd, FILETRANSFER, paths, sel_cnt);
- } else if (ugd->file_select_mode == GE_FILE_SELECT_T_MULTIPLE) {
- char t_str[32] = { 0, };
- eina_convert_itoa(sel_cnt, t_str);
-
- app_control_add_extra_data(ugd->service,
- GE_FILE_SELECT_RETURN_COUNT, t_str);
- app_control_add_extra_data(ugd->service, GE_FILE_SELECT_RETURN_PATH,
- paths);
- app_control_add_extra_data_array(ugd->service, APP_CONTROL_DATA_SELECTED,
- (const char **)path_array, sel_cnt);
- app_control_add_extra_data_array(ugd->service, APP_CONTROL_DATA_PATH,
- (const char **)path_array, sel_cnt);
- ug_send_result_full(ugd->ug, ugd->service, APP_CONTROL_RESULT_SUCCEEDED);
- }
- send_success = true;
- }
-
-GE_SEND_RESULT_FINISHED:
-
- if (paths) {
- g_free(paths);
- paths = NULL;
- }
- if (path_array) {
- for (i = 0; i < sel_cnt; i++) {
- GE_FREEIF(path_array[i]);
- }
- GE_FREE(path_array);
- }
- if (send_success == true) {
- return 0;
- } else {
- return -1;
- }
-}
-
int _ge_atoi(const char *number)
{
char *endptr = NULL;
val = strtol(number, &endptr, 10);
- if ((errno == ERANGE && (val == LONG_MAX || val == LONG_MIN)) || (errno != 0 && val == 0)) {
+ if ((errno == ERANGE && (val == LONG_MAX || val == LONG_MIN))
+ || (errno != 0 && val == 0)) {
ge_dbgE("strtol, val = %d", val);
return -1;
}
return -1;
}
- return (int)val;
-}
-
-char *_ge_str(char *str_id)
-{
- GE_CHECK_NULL(str_id);
- if (strstr(str_id, "IDS_")) {
- return dgettext(GE_STR_DOMAIN_LOCAL, str_id);
- } else {
- return str_id;
- }
+ return (int) val;
}
-
/*
-* Copyright (c) 2000-2015 Samsung Electronics Co., Ltd All Rights Reserved
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*
-*/
+ * Copyright (c) 2015 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://floralicense.org/license/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
#include "ge-albums.h"
-#include "ge-gridview.h"
#include "ge-ui-util.h"
#include "ge-util.h"
#include "ge-data.h"
#include "ge-icon.h"
-#include "ge-tile.h"
-#include "ge-rotate-bg.h"
-#include "ge-button.h"
#include "ge-main-view.h"
#include "ge-strings.h"
#include "ge-ugdata.h"
#include "ge-nocontent.h"
+#include "ge-data-util.h"
#include <notification.h>
#define DEFAULT_THUMBNAIL "/opt/usr/share/media/.thumb/thumb_default.png"
-/* Only for local medias */
-static void __ge_albums_create_thumb_cb(media_content_error_e error,
- const char *path, void *user_data)
-{
- if (GE_FILE_EXISTS(path) && error == MEDIA_CONTENT_ERROR_NONE) {
- GE_CHECK(user_data);
- ge_cluster *album = (ge_cluster *)user_data;
- album->cover->item->b_create_thumb = false;
- GE_CHECK(album->griditem);
- elm_gengrid_item_update(album->griditem);
- } else {
- ge_dbgE("Error number[%d]", error);
- }
-}
-
-/* Use file to create new thumb if possible */
-static int __ge_albums_create_thumb(ge_item *gitem, ge_cluster *album)
-{
- GE_CHECK_VAL(gitem, -1);
- GE_CHECK_VAL(gitem->item, -1);
- GE_CHECK_VAL(gitem->item->file_url, -1);
- GE_CHECK_VAL(album, -1);
-
- if (GE_FILE_EXISTS(gitem->item->file_url)) {
- _ge_data_create_thumb(gitem->item, __ge_albums_create_thumb_cb,
- album);
- return 0;
- }
- return -1;
-}
-
-static void __ge_split_albums_realized(void *data, Evas_Object *obj, void *ei)
-{
- GE_CHECK(data);
- ge_ugdata *ugd = (ge_ugdata *)data;
- GE_CHECK(ei);
- Elm_Object_Item *it = (Elm_Object_Item *)ei;
- ge_cluster *album = elm_object_item_data_get(it);
- GE_CHECK(album);
- GE_CHECK(album->cluster);
- GE_CHECK(album->cover);
- GE_CHECK(album->cover->item);
- ge_dbg("realized");
- if (album->select) {
- elm_object_item_signal_emit((Elm_Object_Item *)ei, "elm,state,focused", "elm");
- ugd->selected_griditem = it;
- album->select = false;
- }
- int sel_cnt;
- _ge_data_get_album_sel_cnt(ugd, album->cluster->uuid, &sel_cnt);
- if (sel_cnt > 0) {
- elm_object_item_signal_emit((Elm_Object_Item *)ei,
- "elm,state,elm.text.badge,visible",
- "elm");
- album->sel_cnt = sel_cnt;
- } else {
- album->sel_cnt = 0;
- elm_object_item_signal_emit((Elm_Object_Item *)ei,
- "elm,state,elm.text.badge,hidden",
- "elm");
- }
-}
-
-static void __ge_albums_realized(void *data, Evas_Object *obj, void *ei)
-{
- GE_CHECK(ei);
- Elm_Object_Item *it = (Elm_Object_Item *)ei;
- ge_cluster *album = elm_object_item_data_get(it);
- GE_CHECK(album);
- GE_CHECK(album->cluster);
- GE_CHECK(album->cover);
- GE_CHECK(album->cover->item);
-
- ge_dbg("realized");
- if (!GE_FILE_EXISTS(album->cover->item->thumb_url) &&
- GE_FILE_EXISTS(album->cover->item->file_url) &&
- (album->cluster->type == GE_PHONE ||
- album->cluster->type == GE_MMC ||
- album->cluster->type == GE_ALL)) {
- __ge_albums_create_thumb(album->cover, album);
- }
-
- GE_CHECK(album->ugd);
- ge_ugdata *ugd = album->ugd;
- if (ugd->b_multifile) {
- if (album->sel_cnt > 0)
- elm_object_item_signal_emit(album->griditem,
- "elm,state,elm.text.badge,visible",
- "elm");
- else
- elm_object_item_signal_emit(album->griditem,
- "elm,state,elm.text.badge,hidden",
- "elm");
- }
-}
-
-static void __ge_albums_unrealized(void *data, Evas_Object *obj, void *ei)
-{
- ge_dbg("unrealized");
- GE_CHECK(ei);
- Elm_Object_Item *it = (Elm_Object_Item *)ei;
- ge_cluster *album = elm_object_item_data_get(it);
- GE_CHECK(album);
- GE_CHECK(album->cluster);
- GE_CHECK(album->cover);
- GE_CHECK(album->cover->item);
-
- /* Checking for local files only */
- if (album->cluster->type == GE_PHONE ||
- album->cluster->type == GE_MMC ||
- album->cluster->type == GE_ALL) {
- if (album->cover->item->b_create_thumb) {
- _ge_data_cancel_thumb(album->cover->item);
-
- ge_dbgW("in the if part");
- }
- }
-}
-
-static int __ge_albums_open_album(ge_cluster *album)
-{
- GE_CHECK_VAL(album, -1);
- GE_CHECK_VAL(album->cluster, -1);
- GE_CHECK_VAL(album->ugd, -1);
- ge_ugdata *ugd = album->ugd;
- ge_sdbg("Album: %s", album->cluster->display_name);
-
- if (_ge_get_view_mode(ugd) != GE_VIEW_ALBUMS) {
- ge_dbgE("Wrong mode!");
- ugd->view_mode = GE_VIEW_ALBUMS;
- //return -1;
- ge_dbgE("new mode album view is assigned");
- }
-
- if (ugd->album_select_mode == GE_ALBUM_SELECT_T_ONE) {
- ge_dbg("One album selected, return album id");
- app_control_add_extra_data(ugd->service,
- GE_ALBUM_SELECT_RETURN_PATH,
- album->cluster->path);
- ge_dbg("return folder-path: %s", album->cluster->path);
- ug_send_result_full(ugd->ug, ugd->service, APP_CONTROL_RESULT_SUCCEEDED);
- if (!ugd->is_attach_panel) {
- ug_destroy_me(ugd->ug);
- ugd->ug = NULL;
- }
- return 0;
- }
-
- /* Add thumbnails view */
- _ge_grid_create_thumb(album);
- ge_dbg("Done");
- return 0;
-}
-
-static int __ge_split_albums_open_album(ge_cluster *album)
-{
- GE_CHECK_VAL(album, -1);
- GE_CHECK_VAL(album->cluster, -1);
- GE_CHECK_VAL(album->ugd, -1);
- ge_sdbg("Album: %s", album->cluster->display_name);
-
- /* Add thumbnails view */
- _ge_grid_create_split_view_thumb(album);
- ge_dbg("Done");
- return 0;
-}
-
-/* Add idler to make mouse click sound, other sound couldn' be played */
-static Eina_Bool __ge_albums_sel_idler_cb(void *data)
-{
- ge_dbg("Select album ---");
- GE_CHECK_FALSE(data);
- ge_cluster *album_item = (ge_cluster*)data;
- GE_CHECK_FALSE(album_item->cluster);
- GE_CHECK_FALSE(album_item->ugd);
- ge_ugdata *ugd = album_item->ugd;
- if (ugd->ug == NULL) {
- ge_dbg("UG already destroyed, return!");
- goto GE_ALBUMS_DONE;
- }
-
- if (album_item->cover) {
- _ge_data_util_free_item(album_item->cover);
- album_item->cover = NULL;
- }
-
- __ge_albums_open_album(album_item);
-
-GE_ALBUMS_DONE:
-
- ecore_idler_del(ugd->sel_album_idler);
- ugd->sel_album_idler = NULL;
- ge_dbg("Select album +++");
- return ECORE_CALLBACK_CANCEL;
-}
-
-static Eina_Bool __ge_split_albums_sel_idler_cb(void *data)
-{
- ge_dbg("Select album ---");
- GE_CHECK_FALSE(data);
- ge_cluster *album_item = (ge_cluster*)data;
- GE_CHECK_FALSE(album_item->cluster);
- GE_CHECK_FALSE(album_item->ugd);
- ge_ugdata *ugd = album_item->ugd;
- if (ugd->ug == NULL) {
- ge_dbg("UG already destroyed, return!");
- goto GE_ALBUMS_DONE;
- }
- if (album_item->cover) {
- _ge_data_util_free_item(album_item->cover);
- album_item->cover = NULL;
- }
- __ge_split_albums_open_album(album_item);
-
-GE_ALBUMS_DONE:
- ecore_idler_del(ugd->sel_album_idler);
- ugd->sel_album_idler = NULL;
- ge_dbg("Select album +++");
- return ECORE_CALLBACK_CANCEL;
-}
-
-static void __ge_albums_sel_cb(void *data, Evas_Object *obj, void *ei)
-{
- GE_CHECK(data);
- ge_cluster *album_item = (ge_cluster*)data;
- GE_CHECK(album_item->cluster);
- GE_CHECK(album_item->ugd);
- ge_ugdata *ugd = album_item->ugd;
- if (ugd->ug == NULL) {
- ge_dbg("UG already destroyed, return!");
- return;
- }
- ugd->album_item = album_item;
- ge_dbg("");
- if (ugd->sel_album_idler) {
- ge_dbg("Has selected an album");
- return;
- }
-
- elm_gengrid_item_selected_set(ei, EINA_FALSE);
-
- Ecore_Idler *idl = NULL;
- idl = ecore_idler_add(__ge_albums_sel_idler_cb, data);
- ugd->sel_album_idler = idl;
- /* Save scroller position before clearing gengrid */
- _ge_ui_save_scroller_pos(obj);
-}
-
-static void __ge_split_albums_sel_cb(void *data, Evas_Object *obj, void *ei)
-{
- GE_CHECK(data);
- ge_cluster *album_item = (ge_cluster*)data;
- GE_CHECK(album_item->cluster);
- GE_CHECK(album_item->ugd);
- ge_ugdata *ugd = album_item->ugd;
- if (ugd->ug == NULL) {
- ge_dbg("UG already destroyed, return!");
- return;
- }
- ugd->album_item = album_item;
- ge_dbg("");
- if (ugd->sel_album_idler) {
- ge_dbg("Has selected an album");
- return;
- }
- elm_gengrid_item_selected_set(ei, EINA_FALSE);
- Ecore_Idler *idl = NULL;
- idl = ecore_idler_add(__ge_split_albums_sel_idler_cb, data);
- ugd->sel_album_idler = idl;
- /* Save scroller position before clearing gengrid */
- _ge_ui_save_scroller_pos(obj);
-}
-
-static char *__ge_split_albums_get_text(void *data, Evas_Object *obj, const char *part)
-{
-#if 0
- GE_CHECK_NULL(part);
- GE_CHECK_NULL(data);
- ge_cluster *album = (ge_cluster *)data;
- GE_CHECK_NULL(album->cluster);
- GE_CHECK_NULL(album->cluster->uuid);
- GE_CHECK_NULL(album->ugd);
- ge_ugdata *ugd = album->ugd;
- char buf[GE_FILE_PATH_LEN_MAX] = { 0, };
-
- if (!g_strcmp0(part, "elm.text.name")) {
- GE_CHECK_NULL(album->cluster->display_name);
- int len;
- if (_ge_data_is_root_path(album->cluster->path)) {
- _ge_data_update_items_cnt(ugd, album);
- len = strlen(GE_ALBUM_ROOT_NAME);
- snprintf(buf, sizeof(buf), "%d", (int)(album->cluster->count));
- if (len > 5) {
- snprintf(buf, sizeof(buf), "%.5s... %d", GE_ALBUM_ROOT_NAME, (int)(album->cluster->count));
- } else {
- snprintf(buf, sizeof(buf), "%s %d", GE_ALBUM_ROOT_NAME, (int)(album->cluster->count));
- }
- buf[strlen(buf)] = '\0';
- } else if (album->cluster->display_name &&
- strlen(album->cluster->display_name)) {
- char *new_name = _ge_ui_get_i18n_album_name(album->cluster);
- _ge_data_update_items_cnt(ugd, album);
- len = strlen(new_name);
- snprintf(buf, sizeof(buf), "%d", (int)(album->cluster->count));
- if (len > 5) {
- snprintf(buf, sizeof(buf), "%.5s... %d", new_name, (int)(album->cluster->count));
- } else {
- snprintf(buf, sizeof(buf), "%s %d", new_name, (int)(album->cluster->count));
- }
- buf[strlen(buf)] = '\0';
- }
-
- /* Show blue folder name */
- if (!g_strcmp0(album->cluster->uuid, GE_ALBUM_ALL_ID) ||
- _ge_data_is_camera_album(album->cluster)) {
- Elm_Object_Item *grid_it = album->griditem;
- Evas_Object *it_obj = NULL;
- it_obj = elm_object_item_widget_get(grid_it);
- GE_CHECK_NULL(it_obj);
- edje_object_signal_emit(it_obj, "elm,name,show,blue",
- "elm");
- edje_object_message_signal_process(it_obj);
- }
- } else if (!g_strcmp0(part, "elm.text.date")) {
- if (album->cover) {
- _ge_data_util_free_item(album->cover);
- album->cover = NULL;
- }
-
- ge_item *item = NULL;
- _ge_data_get_album_cover(ugd, album, &item,
- MEDIA_CONTENT_ORDER_DESC);
- if (item == NULL || item->item == NULL) {
- album->cover_thumbs_cnt = 0;
- _ge_data_util_free_item(item);
- return NULL;
- }
-
- album->cover = item;
- album->cover_thumbs_cnt = GE_ALBUM_COVER_THUMB_NUM;
- } else if (!g_strcmp0(part, "elm.text.count")) {
- _ge_data_update_items_cnt(ugd, album);
- snprintf(buf, sizeof(buf), "%d", (int)(album->cluster->count));
- buf[strlen(buf)] = '\0';
- } else if (!g_strcmp0(part, "elm.text.badge") && ugd->b_multifile) {
- int sel_cnt = 0;
- _ge_data_get_album_sel_cnt(ugd, album->cluster->uuid, &sel_cnt);
- ge_dbg("count :%d", sel_cnt);
- if (sel_cnt > 0) {
- elm_object_item_signal_emit(album->griditem,
- "elm,state,elm.text.badge,visible",
- "elm");
- album->sel_cnt = sel_cnt;
- snprintf(buf, sizeof(buf), "%d", sel_cnt);
- } else {
- album->sel_cnt = 0;
- elm_object_item_signal_emit(album->griditem,
- "elm,state,elm.text.badge,hidden",
- "elm");
- }
- }
- return strdup(buf);
-#endif
- return NULL;
-}
-
-static ge_icon_type __ge_albums_set_bg_file(Evas_Object *bg, void *data)
-{
- GE_CHECK_VAL(data, -1);
- ge_item *git = (ge_item *)data;
- GE_CHECK_VAL(git->album, -1);
- ge_cluster *album = git->album;
- char *bg_path = GE_ICON_NO_THUMBNAIL;
- ge_icon_type ret_val = GE_ICON_CORRUPTED_FILE;
-
- if (git == NULL || git->item == NULL) {
- ge_dbgE("Invalid item :%p", git);
- goto GE_ALBUMS_FAILED;
- }
-
- ret_val = GE_ICON_NORMAL;
- if (GE_FILE_EXISTS(git->item->thumb_url)) {
- bg_path = git->item->thumb_url;
- } else if (album && (album->cluster->type == GE_MMC ||
- album->cluster->type == GE_PHONE ||
- album->cluster->type == GE_ALL)) {
- __ge_albums_create_thumb(git, album);
- } else {
- ret_val = -1;
- }
-
-GE_ALBUMS_FAILED:
-
-#ifdef _USE_ROTATE_BG_GE
- _ge_rotate_bg_set_image_file(bg, bg_path);
-#else
- elm_bg_file_set(bg, bg_path, NULL);
-#endif
-
- return ret_val;
-}
-
-static Evas_Object *__ge_split_albums_get_content(void *data, Evas_Object *obj, const char *part)
-{
- GE_CHECK_NULL(part);
- GE_CHECK_NULL(strlen(part));
- GE_CHECK_NULL(data);
- ge_cluster *album = (ge_cluster *)data;
- GE_CHECK_NULL(album->cluster);
- GE_CHECK_NULL(album->cluster->uuid);
- ge_dbg("");
-
- Evas_Object *_obj = NULL;
- if (!g_strcmp0(part, GE_TILE_ICON)) {
- _obj = _ge_tile_show_part_icon(obj, part,
- album->cover_thumbs_cnt,
- __ge_albums_set_bg_file,
- (void *)album->cover);
- }
- return _obj;
-}
-
-static int __ge_albums_append(ge_ugdata *ugd, ge_cluster *album)
-{
- GE_CHECK_VAL(album, -1);
- GE_CHECK_VAL(album->cluster, -1);
- GE_CHECK_VAL(ugd, -1);
-
- album->griditem = elm_gengrid_item_append(ugd->albums_view,
- ugd->album_gic, album,
- __ge_albums_sel_cb, album);
- ge_sdbg("Append [%s], id[%s]", album->cluster->display_name,
- album->cluster->uuid);
- _ge_tile_update_item_size(ugd, ugd->albums_view, ugd->rotate_mode,
- false);
- album->index = elm_gengrid_items_count(ugd->albums_view);
- return 0;
-}
-
-int __ge_split_albums_append(ge_ugdata *ugd, ge_cluster *album)
-{
- GE_CHECK_VAL(album, -1);
- GE_CHECK_VAL(album->cluster, -1);
- GE_CHECK_VAL(ugd, -1);
-
- album->griditem = elm_gengrid_item_append(ugd->albums_view,
- ugd->album_gic, album,
- __ge_split_albums_sel_cb, album);
- ge_sdbg("Append [%s], id[%s]", album->cluster->display_name,
- album->cluster->uuid);
- _ge_tile_update_item_size(ugd, ugd->albums_view, ugd->rotate_mode,
- false);
- album->index = elm_gengrid_items_count(ugd->albums_view);
- return 0;
-}
-
-static Eina_Bool __ge_albums_append_idler_cb(void *data)
-{
- ge_dbg("Append album ---");
- GE_CHECK_VAL(data, -1);
- ge_ugdata *ugd = (ge_ugdata *)data;
- GE_CHECK_VAL(ugd->cluster_list, -1);
-
- int old_cnt = eina_list_count(ugd->cluster_list->clist);
- _ge_data_get_clusters(ugd, ugd->cluster_list->data_type);
- ugd->cluster_list->data_type = GE_ALBUM_DATA_NONE;
- int new_cnt = eina_list_count(ugd->cluster_list->clist);
- if (old_cnt != new_cnt)
- _ge_tile_update_item_size(ugd, ugd->albums_view,
- ugd->rotate_mode, false);
- ecore_idler_del(ugd->album_idler);
- ugd->album_idler = NULL;
- ge_dbg("Append album +++");
- return ECORE_CALLBACK_CANCEL;
-}
-
-Eina_Bool __ge_split_albums_append_idler_cb(void *data)
-{
- ge_dbg("Append album ---");
- GE_CHECK_VAL(data, -1);
- ge_ugdata *ugd = (ge_ugdata *)data;
- GE_CHECK_VAL(ugd->cluster_list, -1);
-
- int old_cnt = eina_list_count(ugd->cluster_list->clist);
- ge_dbg("Albums list length old: %d", old_cnt);
- _ge_data_get_clusters(ugd, ugd->cluster_list->data_type);
- ugd->cluster_list->data_type = GE_ALBUM_DATA_NONE;
- int new_cnt = eina_list_count(ugd->cluster_list->clist);
- ge_dbg("Albums list length new: %d", new_cnt);
- ecore_idler_del(ugd->album_idler);
- ugd->album_idler = NULL;
- ge_dbg("Append album +++");
- return ECORE_CALLBACK_CANCEL;
-}
-
-static Eina_Bool __ge_albums_create_idler_cb(void *data)
-{
- ge_dbg("Create album ---");
- GE_CHECK_VAL(data, -1);
- ge_ugdata *ugd = (ge_ugdata *)data;
- int length = eina_list_count(ugd->cluster_list->clist);
- int i = 0;
- ge_cluster *album = NULL;
- ge_dbg("Albums list length: %d", length);
-
- /* First 8 albums is got from DB, and plus 'All albums', it's 9 totally */
- for (i = GE_ALBUMS_FIRST_COUNT + 1; i < length; i++) {
- album = eina_list_nth(ugd->cluster_list->clist, i);
- __ge_albums_append(ugd, album);
- }
- /* Restore previous position of scroller */
- _ge_ui_restore_scroller_pos(ugd->albums_view);
-
- ecore_idler_del(ugd->album_idler);
- ugd->album_idler = NULL;
- ge_dbg("Create album +++");
- return ECORE_CALLBACK_CANCEL;
-}
-
-Eina_Bool __ge_split_view_albums_create_idler_cb(void *data)
-{
- ge_dbg("Create album ---");
- GE_CHECK_VAL(data, -1);
- ge_ugdata *ugd = (ge_ugdata *)data;
- int length = eina_list_count(ugd->cluster_list->clist);
- int i = 0;
- ge_cluster *album = NULL;
- ge_dbg("Albums list length: %d", length);
-
- /* First 8 albums is got from DB, and plus 'All albums', it's 9 totally */
- for (i = GE_ALBUMS_FIRST_COUNT + 1; i < length; i++) {
- album = eina_list_nth(ugd->cluster_list->clist, i);
- __ge_split_albums_append(ugd, album);
- }
- /* Restore previous position of scroller */
- _ge_ui_restore_scroller_pos(ugd->albums_view);
-
- ecore_idler_del(ugd->album_idler);
- ugd->album_idler = NULL;
- ge_dbg("Create album +++");
- return ECORE_CALLBACK_CANCEL;
-}
-
-int __ge_split_view_append_albums(ge_ugdata *ugd, Evas_Object *parent, bool is_update)
-{
- GE_CHECK_VAL(parent, -1);
- GE_CHECK_VAL(ugd, -1);
- int i = 0;
- ge_cluster *album = NULL;
- int length = 0;
- if (elm_gengrid_items_count(parent) > 0) {
- /* Save scroller position before clearing gengrid */
- _ge_ui_save_scroller_pos(parent);
- elm_gengrid_clear(parent);
- }
- if (is_update) {
- _ge_data_get_clusters(ugd, GE_ALBUM_DATA_NONE);
- }
- if (ugd->cluster_list && ugd->cluster_list->clist) {
- length = eina_list_count(ugd->cluster_list->clist);
- } else {
- return -1;
- }
- ge_dbg("Albums list length: %d", length);
-
- if (ugd->th) {
- elm_object_theme_set(parent, ugd->th);
- }
- int grid_cnt = 0;
- Elm_Gengrid_Item_Class *gic = elm_gengrid_item_class_new();
- if (gic == NULL) {
- return -1;
- }
- gic->item_style = "gallery_efl/albums_split_view";
- gic->func.text_get = __ge_split_albums_get_text;
- gic->func.content_get = __ge_split_albums_get_content;
- for (i = 0; i < length; i++) {
- album = eina_list_nth(ugd->cluster_list->clist, i);
- if (!album || !album->cluster || !album->cluster->display_name) {
- ge_dbgE("Invalid parameter, return ERROR code!");
- elm_gengrid_clear(parent);
-
- if (gic) {
- elm_gengrid_item_class_free(gic);
- gic = NULL;
- }
- return -1;
- }
-
- if (album->cluster->type == GE_ALL) {
- continue;
- }
-
- album->griditem = elm_gengrid_item_append(parent,
- gic,
- album,
- __ge_split_albums_sel_cb,
- album);
- if (!strcmp(album->cluster->uuid, ugd->album_item->cluster->uuid)) {
- album->select = true;
- } else {
- album->select = false;
- }
- album->index = grid_cnt;
- grid_cnt++;
- ge_sdbg("Append [%s], id=%s.", album->cluster->display_name,
- album->cluster->uuid);
- }
- /* Restore previous position of scroller */
- _ge_ui_restore_scroller_pos(parent);
-
- if (gic) {
- elm_gengrid_item_class_free(gic);
- gic = NULL;
- }
- /* NOT jsut for updating view, but for updating view and data together */
- if (ugd->cluster_list->data_type == GE_ALBUM_DATA_LOCAL ||
- ugd->cluster_list->data_type == GE_ALBUM_DATA_WEB) {
- if (ugd->album_idler) {
- ecore_idler_del(ugd->album_idler);
- ugd->album_idler = NULL;
- }
- Ecore_Idler *idl = NULL;
- idl = ecore_idler_add(__ge_split_albums_append_idler_cb, ugd);
- ugd->album_idler = idl;
- }
- if (grid_cnt) {
- return 0;
- } else {
- ge_dbgW("None albums appended to view!");
- return -1;
- }
-}
-
-static int __ge_albums_append_albums(ge_ugdata *ugd, Evas_Object *parent, bool is_update)
-{
- GE_CHECK_VAL(parent, -1);
- GE_CHECK_VAL(ugd, -1);
- int i = 0;
- ge_cluster *album = NULL;
- int length = 0;
-
- if (elm_gengrid_items_count(parent) > 0) {
- /* Save scroller position before clearing gengrid */
- _ge_ui_save_scroller_pos(parent);
- elm_gengrid_clear(parent);
- }
- if (is_update) {
- _ge_data_get_clusters(ugd, GE_ALBUM_DATA_NONE);
- }
- if (ugd->cluster_list && ugd->cluster_list->clist) {
- length = eina_list_count(ugd->cluster_list->clist);
- } else {
- return -1;
- }
- ge_dbg("Albums list length: %d", length);
-
- if (ugd->th) {
- elm_object_theme_set(parent, ugd->th);
- }
-
- /* Jus for updating view, not updating data and view together */
- if (ugd->cluster_list->data_type == GE_ALBUM_DATA_NONE &&
- length > GE_ALBUMS_FIRST_COUNT + 1) {
- length = GE_ALBUMS_FIRST_COUNT + 1;
- if (ugd->album_idler) {
- ecore_idler_del(ugd->album_idler);
- ugd->album_idler = NULL;
- }
- Ecore_Idler *idl = NULL;
- idl = ecore_idler_add(__ge_albums_create_idler_cb, ugd);
- ugd->album_idler = idl;
- }
-
- int grid_cnt = 0;
- for (i = 0; i < length; i++) {
- album = eina_list_nth(ugd->cluster_list->clist, i);
- GE_CHECK_VAL(album, -1);
- GE_CHECK_VAL(album->cluster, -1);
- GE_CHECK_VAL(album->cluster->display_name, -1);
-
- if (album->cluster->type == GE_ALL) {
- continue;
- }
-
- album->griditem = elm_gengrid_item_append(parent,
- ugd->album_gic,
- album,
- __ge_albums_sel_cb,
- album);
- album->index = grid_cnt;
- grid_cnt++;
- ge_sdbg("Append [%s], id=%s.", album->cluster->display_name,
- album->cluster->uuid);
- }
- /* Restore previous position of scroller */
- _ge_ui_restore_scroller_pos(parent);
-
- /* NOT jsut for updating view, but for updating view and data together */
- if (ugd->cluster_list->data_type == GE_ALBUM_DATA_LOCAL ||
- ugd->cluster_list->data_type == GE_ALBUM_DATA_WEB) {
- if (ugd->album_idler) {
- ecore_idler_del(ugd->album_idler);
- ugd->album_idler = NULL;
- }
- Ecore_Idler *idl = NULL;
- idl = ecore_idler_add(__ge_albums_append_idler_cb, ugd);
- ugd->album_idler = idl;
- }
-
- if (grid_cnt) {
- _ge_tile_update_item_size(ugd, parent, ugd->rotate_mode, false);
- return 0;
- } else {
- ge_dbgW("None albums appended to view!");
- return -1;
- }
-}
-
-static int __ge_albums_del_cbs(Evas_Object *view)
-{
- if (view == NULL) {
- return -1;
- }
- ge_dbg("Delete albums callbacks!");
- evas_object_smart_callback_del(view, "realized",
- __ge_albums_realized);
- evas_object_smart_callback_del(view, "unrealized",
- __ge_albums_unrealized);
- return 0;
-}
-
-static void _ge_grid_move_stop_cb(void *data, Evas_Object *obj, void *ei)
+static void _ge_grid_move_stop_cb(void *data, Evas_Object * obj, void *ei)
{
ge_dbg("");
GE_CHECK(data);
- ge_ugdata *ugd = (ge_ugdata *)data;
+ ge_ugdata *ugd = (ge_ugdata *) data;
int x, y, w, h;
int ret;
elm_scroller_region_get(obj, &x, &y, &w, &h);
ret = app_control_create(&app_control);
if (ret == APP_CONTROL_ERROR_NONE) {
if (y == 0) {
- app_control_add_extra_data(app_control, ATTACH_PANEL_FLICK_MODE_KEY, ATTACH_PANEL_FLICK_MODE_ENABLE);
+ app_control_add_extra_data(app_control,
+ ATTACH_PANEL_FLICK_MODE_KEY,
+ ATTACH_PANEL_FLICK_MODE_ENABLE);
} else {
- app_control_add_extra_data(app_control, ATTACH_PANEL_FLICK_MODE_KEY, ATTACH_PANEL_FLICK_MODE_DISABLE);
+ app_control_add_extra_data(app_control,
+ ATTACH_PANEL_FLICK_MODE_KEY,
+ ATTACH_PANEL_FLICK_MODE_DISABLE);
}
- ret = ug_send_result_full(ugd->ug, app_control, APP_CONTROL_RESULT_SUCCEEDED);
+ ret =
+ ug_send_result_full(ugd->ug, app_control,
+ APP_CONTROL_RESULT_SUCCEEDED);
}
app_control_destroy(app_control);
}
-Evas_Object* __ge_add_albums_split_view(ge_ugdata *ugd, Evas_Object *parent)
-{
- ge_dbg("");
- GE_CHECK_NULL(parent);
- GE_CHECK_NULL(ugd);
- Evas_Object *grid = elm_gengrid_add(parent);
- GE_CHECK_NULL(grid);
- _ge_ui_reset_scroller_pos(grid);
- elm_gengrid_align_set(grid, 0.5f, 0.0);
- elm_gengrid_horizontal_set(grid, EINA_FALSE);
- elm_scroller_bounce_set(grid, EINA_FALSE, EINA_TRUE);
- elm_scroller_policy_set(grid, ELM_SCROLLER_POLICY_OFF,
- ELM_SCROLLER_POLICY_AUTO);
- elm_gengrid_multi_select_set(grid, EINA_TRUE);
- evas_object_size_hint_weight_set(grid, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
- evas_object_smart_callback_add(grid, "unrealized",
- __ge_albums_unrealized, ugd);
- evas_object_smart_callback_add(grid, "realized", __ge_split_albums_realized,
- ugd);
- if (__ge_split_view_append_albums(ugd, grid, false) != 0) {
- ge_dbgW("Failed to append album items!");
- __ge_albums_del_cbs(grid);
- evas_object_del(grid);
- grid = NULL;
- } else {
- evas_object_show(grid);
- }
- return grid;
-}
-
-static Evas_Object* __ge_albums_add_view(ge_ugdata *ugd, Evas_Object *parent)
+static Evas_Object *__ge_albums_add_view(ge_ugdata * ugd,
+ Evas_Object * parent)
{
ge_dbg("");
GE_CHECK_NULL(parent);
Evas_Object *layout = ge_ui_load_edj(parent, GE_EDJ_FILE,
- GE_GRP_ALBUMVIEW);
+ GE_GRP_ALBUMVIEW);
GE_CHECK_NULL(layout);
evas_object_show(layout);
return layout;
}
-static Eina_Bool __ge_main_back_cb(void *data, Elm_Object_Item *it)
+static Eina_Bool __ge_main_back_cb(void *data, Elm_Object_Item * it)
{
ge_dbg("");
GE_CHECK_FALSE(data);
- ge_ugdata *ugd = (ge_ugdata *)data;
+ ge_ugdata *ugd = (ge_ugdata *) data;
Eina_List *l = NULL;
ge_item *gitem = NULL;
- void *pop_cb = evas_object_data_get(ugd->naviframe,
- GE_NAVIFRAME_POP_CB_KEY);
- if (pop_cb) {
- Eina_Bool(*_pop_cb)(void * ugd);
- _pop_cb = pop_cb;
-
- if (_pop_cb(ugd)) {
- /* Just pop edit view, dont destroy me */
- return EINA_FALSE;
- }
- }
-
app_control_h app_control = NULL;
app_control_create(&app_control);
- app_control_add_extra_data(app_control, GE_FILE_SELECT_RETURN_COUNT, "0");
- app_control_add_extra_data(app_control, GE_FILE_SELECT_RETURN_PATH, NULL);
- app_control_add_extra_data(app_control, APP_CONTROL_DATA_SELECTED, NULL);
- app_control_add_extra_data_array(app_control, APP_CONTROL_DATA_PATH, NULL, 0);
+ app_control_add_extra_data(app_control, GE_FILE_SELECT_RETURN_COUNT,
+ "0");
+ app_control_add_extra_data(app_control, GE_FILE_SELECT_RETURN_PATH,
+ NULL);
+ app_control_add_extra_data(app_control, APP_CONTROL_DATA_SELECTED,
+ NULL);
+ app_control_add_extra_data_array(app_control, APP_CONTROL_DATA_PATH,
+ NULL, 0);
ug_send_result_full(ugd->ug, app_control, APP_CONTROL_RESULT_FAILED);
app_control_destroy(app_control);
- if (!ugd->is_attach_panel) {
- ug_destroy_me(ugd->ug);
- ge_dbg("ug_destroy_me");
- }
-
EINA_LIST_FOREACH(ugd->thumbs_d->medias_elist, l, gitem) {
if (gitem) {
gitem->checked = false;
}
ugd->selected_elist = eina_list_free(ugd->selected_elist);
- /*If return ture, ug will pop naviframe first.*/
+ /*If return ture, ug will pop naviframe first. */
return EINA_FALSE;
}
-void AppGetResource(const char *edj_file_in, char *edj_path_out, int edj_path_max)
+void AppGetResource(const char *edj_file_in, char *edj_path_out,
+ int edj_path_max)
{
char *res_path = app_get_resource_path();
if (res_path) {
- snprintf(edj_path_out, edj_path_max, "%s%s", res_path, edj_file_in);
+ snprintf(edj_path_out, edj_path_max, "%s%s", res_path,
+ edj_file_in);
free(res_path);
}
}
-Evas_Object *ge_thumb_show_part_icon_image(Evas_Object *obj, char *path,
- int item_w, int item_h)
+Evas_Object *ge_thumb_show_part_icon_image(Evas_Object * obj, char *path,
+ int item_w, int item_h)
{
GE_CHECK_NULL(obj);
elm_image_preload_disabled_set(bg, EINA_FALSE);
elm_image_fill_outside_set(bg, EINA_TRUE);
evas_object_size_hint_max_set(bg, item_w, item_h);
- evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND,
+ EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(bg, EVAS_HINT_FILL, EVAS_HINT_FILL);
elm_layout_theme_set(layout, "gengrid", "photoframe",
- "default_layout");
+ "default_layout");
elm_object_part_content_set(layout, "elm.swallow.icon", bg);
evas_object_show(layout);
return layout;
}
-static void
-__ge_grid_done_cb(void *data, Evas_Object *obj, void *ei)
+static void __ge_grid_done_cb(void *data, Evas_Object * obj, void *ei)
{
ge_dbgE("Transferring Data to caller");
- ge_ugdata *ugd = (ge_ugdata*)data;
+ ge_ugdata *ugd = (ge_ugdata *) data;
GE_CHECK(ugd);
/* file selection mode */
char *paths = NULL;
- char **path_array = NULL; /* the array size is sel_cnt */
+ char **path_array = NULL; /* the array size is sel_cnt */
int sel_cnt = 0;
int i = 0;
goto GE_SEND_RESULT_FINISHED;
}
- char t_str[32] = {0,};
+ char t_str[32] = { 0, };
eina_convert_itoa(sel_cnt, t_str);
app_control_add_extra_data(ugd->service,
- GE_FILE_SELECT_RETURN_COUNT, t_str);
+ GE_FILE_SELECT_RETURN_COUNT, t_str);
app_control_add_extra_data(ugd->service, GE_FILE_SELECT_RETURN_PATH,
- paths);
- app_control_add_extra_data_array(ugd->service, APP_CONTROL_DATA_SELECTED,
- (const char **)path_array, sel_cnt);
+ paths);
+ app_control_add_extra_data_array(ugd->service,
+ APP_CONTROL_DATA_SELECTED,
+ (const char **) path_array, sel_cnt);
app_control_add_extra_data_array(ugd->service, APP_CONTROL_DATA_PATH,
- (const char **)path_array, sel_cnt);
- ug_send_result_full(ugd->ug, ugd->service, APP_CONTROL_RESULT_SUCCEEDED);
+ (const char **) path_array, sel_cnt);
+ ug_send_result_full(ugd->ug, ugd->service,
+ APP_CONTROL_RESULT_SUCCEEDED);
ugd->selected_elist = eina_list_free(ugd->selected_elist);
-GE_SEND_RESULT_FINISHED:
+ GE_SEND_RESULT_FINISHED:
if (paths) {
g_free(paths);
}
static void
-__ge_check_state_changed_cb(void *data, Evas_Object *obj, void *ei)
+__ge_check_state_changed_cb(void *data, Evas_Object * obj, void *ei)
{
GE_CHECK(obj);
GE_CHECK(data);
- ge_item *gitem = (ge_item *)data;
+ ge_item *gitem = (ge_item *) data;
GE_CHECK(gitem->item);
GE_CHECK(gitem->item->file_url);
GE_CHECK(gitem->ugd);
sit = _ge_data_util_new_sel_item(gitem);
GE_CHECK(sit);
-#ifdef FEATURE_SIZE_CHECK
struct stat stFileInfo;
stat(sit->file_url, &stFileInfo);
-#endif
if (state == EINA_TRUE) {
- if ((!gitem->item->thumb_url) || (!g_strcmp0(gitem->item->thumb_url, DEFAULT_THUMBNAIL)) ||
- (strlen(gitem->item->thumb_url) == 0)) {
+ if ((!gitem->item->thumb_url)
+ || (!g_strcmp0(gitem->item->thumb_url, DEFAULT_THUMBNAIL))
+ || (strlen(gitem->item->thumb_url) == 0)) {
elm_check_state_set(obj, EINA_FALSE);
- char *pStrWarning = g_strdup_printf(
- GE_STR_UNSUPPORTED_FILE);
+ char *pStrWarning = g_strdup_printf(GE_STR_UNSUPPORTED_FILE);
notification_status_message_post(pStrWarning);
GE_FREE(pStrWarning);
_ge_data_util_free_sel_item(sit);
return;
}
- if ((ugd->max_count != -1) && (gitem->ugd->thumbs_d->tot_selected + 1 > ugd->max_count)) {
+ if ((ugd->max_count != -1)
+ && (gitem->ugd->thumbs_d->tot_selected + 1 > ugd->max_count)) {
elm_check_state_set(obj, EINA_FALSE);
char *noti_str = GE_STR_MAX_PICTURES_SELECTED;
- char *pStrWarning = g_strdup_printf(
- noti_str,
- ugd->max_count);
+ char *pStrWarning = g_strdup_printf(noti_str,
+ ugd->max_count);
notification_status_message_post(pStrWarning);
GE_FREE(pStrWarning);
_ge_data_util_free_sel_item(sit);
return;
}
-#ifdef FEATURE_SIZE_CHECK
- if (ugd->limitsize > 0 && ugd->selsize + stFileInfo.st_size > ugd->limitsize) {
+ if (ugd->limitsize > 0
+ && ugd->selsize + stFileInfo.st_size > ugd->limitsize) {
elm_check_state_set(obj, EINA_FALSE);
- notification_status_message_post("maximum of 2MB can be selected");
+ notification_status_message_post
+ ("maximum of 2MB can be selected");
_ge_data_util_free_sel_item(sit);
return;
}
-#endif
ge_sdbg("append Path: %s", sit->file_url);
ugd->selected_elist = eina_list_append(ugd->selected_elist, sit);
ugd->thumbs_d->tot_selected++;
-#ifdef FEATURE_SIZE_CHECK
ugd->selsize += stFileInfo.st_size;
-#endif
gitem->checked = TRUE;
} else {
ge_sdbg("remove Path: %s", sit->file_url);
EINA_LIST_FOREACH(ugd->selected_elist, l, sit1) {
if (sit1 && !strcmp(sit->file_url, sit1->file_url)) {
- ugd->selected_elist = eina_list_remove(ugd->selected_elist, sit1);
+ ugd->selected_elist =
+ eina_list_remove(ugd->selected_elist, sit1);
_ge_data_util_free_sel_item(sit1);
}
}
ugd->thumbs_d->tot_selected--;
-#ifdef FEATURE_SIZE_CHECK
ugd->selsize -= stFileInfo.st_size;
-#endif
gitem->checked = FALSE;
_ge_data_util_free_sel_item(sit);
}
char *text = NULL;
Evas_Object *btn = NULL;
- btn = elm_object_item_part_content_get(ugd->nf_it , GE_NAVIFRAME_TITLE_RIGHT_BTN);
+ btn =
+ elm_object_item_part_content_get(ugd->nf_it,
+ GE_NAVIFRAME_TITLE_RIGHT_BTN);
if (btn == NULL) {
ge_dbgE("Failed to get part information");
}
}
}
-static Evas_Object *
-__ge_nocontent_get(void *data, Evas_Object *obj, const char *part)
+static Evas_Object *__ge_nocontent_get(void *data, Evas_Object * obj,
+ const char *part)
{
- ge_ugdata *ugd = (ge_ugdata *)data;
+ ge_ugdata *ugd = (ge_ugdata *) data;
Evas_Object *layout = ge_ui_load_edj(ugd->albums_view, GE_EDJ_FILE,
- "nocontent");
+ "nocontent");
ge_dbg("Nocontents label: %s", GE_STR_NO_ITEMS);
/* Full view nocontents */
Evas_Object *noc_lay = elm_layout_add(layout);
elm_layout_theme_set(noc_lay, "layout", "nocontents", "text");
_ge_ui_set_translate_part_str(noc_lay, "elm.text", GE_STR_NO_ITEMS);
- _ge_ui_set_translate_part_str(noc_lay, "elm.help.text", GE_STR_NO_ITEMS_HELP_TEXT);
+ _ge_ui_set_translate_part_str(noc_lay, "elm.help.text",
+ GE_STR_NO_ITEMS_HELP_TEXT);
elm_layout_signal_emit(noc_lay, "text,disabled", "");
elm_layout_signal_emit(noc_lay, "align.center", "elm");
+ edje_object_message_signal_process(elm_layout_edje_get(noc_lay));
elm_object_part_content_set(layout, "swallow", noc_lay);
- evas_object_size_hint_weight_set(layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
- evas_object_size_hint_align_set(layout, EVAS_HINT_FILL, EVAS_HINT_FILL);
+ evas_object_size_hint_weight_set(layout, EVAS_HINT_EXPAND,
+ EVAS_HINT_EXPAND);
+ evas_object_size_hint_align_set(layout, EVAS_HINT_FILL,
+ EVAS_HINT_FILL);
GE_CHECK_NULL(layout);
evas_object_show(layout);
return layout;
}
-static Evas_Object *
-__ge_gengrid_item_content_get(void *data, Evas_Object *obj, const char *part)
+static Evas_Object *__ge_gengrid_item_content_get(void *data,
+ Evas_Object * obj,
+ const char *part)
{
ge_item *gitem = NULL;
return NULL;
}
- gitem = (ge_item*)data;
+ gitem = (ge_item *) data;
GE_CHECK_NULL(gitem->item);
GE_CHECK_NULL(gitem->ugd);
ge_ugdata *ugd = gitem->ugd;
if (!g_strcmp0(part, "content_swallow")) {
ge_dbgE("gitem->item->thumb_url : %s", gitem->item->thumb_url);
/* Use default image */
- if ((!gitem->item->thumb_url) || (!g_strcmp0(gitem->item->thumb_url, DEFAULT_THUMBNAIL)) ||
- (strlen(gitem->item->thumb_url) == 0)) {
+ if ((!gitem->item->thumb_url)
+ || (!g_strcmp0(gitem->item->thumb_url, DEFAULT_THUMBNAIL))
+ || (strlen(gitem->item->thumb_url) == 0)) {
path = GE_ICON_CONTENTS_BROKEN;
} else {
path = gitem->item->thumb_url;
if (gitem->item->type == MEDIA_CONTENT_TYPE_IMAGE) {
if (ugd->thumbs_d->image_layout_list) {
Evas_Object *bg = NULL;
- layout = eina_list_data_get(ugd->thumbs_d->image_layout_list);
+ layout =
+ eina_list_data_get(ugd->thumbs_d->image_layout_list);
GE_CHECK_NULL(layout);
- ugd->thumbs_d->image_layout_list = eina_list_remove(ugd->thumbs_d->image_layout_list, layout);
- bg = elm_object_part_content_get(layout, "elm.swallow.icon");
+ ugd->thumbs_d->image_layout_list =
+ eina_list_remove(ugd->thumbs_d->image_layout_list,
+ layout);
+ bg = elm_object_part_content_get(layout,
+ "elm.swallow.icon");
elm_image_file_set(bg, path, NULL);
} else {
layout = ge_thumb_show_part_icon_image(obj, path,
- ugd->thumbs_d->icon_w,
- ugd->thumbs_d->icon_h);
+ ugd->thumbs_d->
+ icon_w,
+ ugd->thumbs_d->
+ icon_h);
}
}
return layout;
- } else if (!g_strcmp0(part, "checkbox_swallow") && ugd->thumbs_d->b_editmode == true) {
- Evas_Object* ck = NULL;
+ } else if (!g_strcmp0(part, "checkbox_swallow")
+ && ugd->thumbs_d->b_editmode == true) {
+ Evas_Object *ck = NULL;
if (ugd->thumbs_d->check_list) {
ck = eina_list_data_get(ugd->thumbs_d->check_list);
GE_CHECK_NULL(ck);
- ugd->thumbs_d->check_list = eina_list_remove(ugd->thumbs_d->check_list, ck);
+ ugd->thumbs_d->check_list =
+ eina_list_remove(ugd->thumbs_d->check_list, ck);
} else {
ck = elm_check_add(obj);
elm_check_state_set(ck, gitem->checked);
ugd->thumbs_d->check = ck;
evas_object_smart_callback_add(ck, "changed",
- __ge_check_state_changed_cb, gitem);
+ __ge_check_state_changed_cb, gitem);
evas_object_show(ck);
return ck;
} else if (!g_strcmp0(part, "sd_card_icon")) {
- if (gitem->item->storage_type == (media_content_storage_e)GE_MMC) {
+ if (gitem->item->storage_type == (media_content_storage_e) GE_MMC) {
icon = elm_icon_add(obj);
elm_image_file_set(icon, sd_card_image_path, NULL);
- evas_object_size_hint_aspect_set(icon, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1);
+ evas_object_size_hint_aspect_set(icon,
+ EVAS_ASPECT_CONTROL_VERTICAL,
+ 1, 1);
return icon;
}
}
return layout;
}
-static char*
-__ge_gengrid_text_get_cb(void *data, Evas_Object *obj, const char *part)
+static char *__ge_gengrid_text_get_cb(void *data, Evas_Object * obj,
+ const char *part)
{
return strdup(GE_STR_GALLERY);
}
static void
-__ge_gallery_ug_result_cb(app_control_h request, app_control_h reply, app_control_result_e result, void *data)
+__ge_gallery_ug_result_cb(app_control_h request, app_control_h reply,
+ app_control_result_e result, void *data)
{
- ge_ugdata *ugd = (ge_ugdata *)data;
+ ge_ugdata *ugd = (ge_ugdata *) data;
char **pathArray = NULL;
int arrayLength = 0;
int i = 0;
+ ugd->ug_launched = false;
if ((result != APP_CONTROL_RESULT_SUCCEEDED) || !reply) {
ge_dbgE("ug-gallery-efl data get failed.");
return;
}
- app_control_get_extra_data_array(reply, APP_CONTROL_DATA_PATH, &pathArray, &arrayLength);
+ app_control_get_extra_data_array(reply, APP_CONTROL_DATA_PATH,
+ &pathArray, &arrayLength);
if (arrayLength != 0) {
ge_dbg("Receiving data from ug-gallery-efl.");
eina_convert_itoa(arrayLength, t_str);
app_control_add_extra_data(ugd->service,
- GE_FILE_SELECT_RETURN_COUNT, t_str);
- app_control_add_extra_data_array(ugd->service, APP_CONTROL_DATA_SELECTED,
- (const char **)pathArray, arrayLength);
- app_control_add_extra_data_array(ugd->service, APP_CONTROL_DATA_PATH,
- (const char **)pathArray, arrayLength);
- ug_send_result_full(ugd->ug, ugd->service, APP_CONTROL_RESULT_SUCCEEDED);
+ GE_FILE_SELECT_RETURN_COUNT, t_str);
+ app_control_add_extra_data_array(ugd->service,
+ APP_CONTROL_DATA_SELECTED,
+ (const char **) pathArray,
+ arrayLength);
+ app_control_add_extra_data_array(ugd->service,
+ APP_CONTROL_DATA_PATH,
+ (const char **) pathArray,
+ arrayLength);
+ ug_send_result_full(ugd->ug, ugd->service,
+ APP_CONTROL_RESULT_SUCCEEDED);
if (pathArray) {
for (i = 0; i < arrayLength; i++) {
}
}
-void
-__ge_grid_reset_view(ge_ugdata *ugd)
+void __ge_grid_reset_view(ge_ugdata * ugd)
{
ge_dbg("");
if (ugd->thumbs_d->tot_selected == 0) {
return;
}
- ge_item* gitem = NULL;
+ ge_item *gitem = NULL;
char *pd_selected = GE_STR_PD_SELECTED;
int i;
ugd->selected_elist = eina_list_free(ugd->selected_elist);
for (i = 0; i < ugd->thumbs_d->medias_cnt; i++) {
gitem = eina_list_nth(ugd->thumbs_d->medias_elist, i);
if (gitem == NULL || gitem->item == NULL ||
- gitem->item->uuid == NULL) {
+ gitem->item->uuid == NULL) {
ge_dbgE("Invalid gitem!");
continue;
}
elm_object_item_text_set(ugd->nf_it, text);
GE_FREEIF(text);
Evas_Object *btn = NULL;
- btn = elm_object_item_part_content_get(ugd->nf_it , GE_NAVIFRAME_TITLE_RIGHT_BTN);
+ btn =
+ elm_object_item_part_content_get(ugd->nf_it,
+ GE_NAVIFRAME_TITLE_RIGHT_BTN);
if (btn == NULL) {
ge_dbgE("Failed to get part information");
}
}
-static void
-__ge_launch_ug_gallery(void *data, Evas_Object *obj, void *ei)
+static void __ge_launch_ug_gallery(void *data, Evas_Object * obj, void *ei)
{
- ge_ugdata *ugd = (ge_ugdata *)data;
+ ge_ugdata *ugd = (ge_ugdata *) data;
GE_CHECK(ugd);
- char maximum_count [10];
+ char maximum_count[10];
snprintf(maximum_count, 10, "%d", ugd->max_count);
elm_gengrid_item_selected_set(ei, EINA_FALSE);
+ if (ugd->ug_launched) {
+ ge_dbg("ug-gallery-efl already launched.");
+ return;
+ }
app_control_h svc_handle = NULL;
if (!app_control_create(&svc_handle)) {
app_control_set_operation(svc_handle, APP_CONTROL_OPERATION_PICK);
- app_control_set_launch_mode(svc_handle, APP_CONTROL_LAUNCH_MODE_GROUP);
- app_control_set_app_id(svc_handle, "org.tizen.ug-gallery-efl");
+ app_control_set_launch_mode(svc_handle,
+ APP_CONTROL_LAUNCH_MODE_GROUP);
+ app_control_set_app_id(svc_handle, "org.tizen.ug-gallery-efl");
app_control_set_mime(svc_handle, "image/*");
- app_control_add_extra_data(svc_handle, APP_CONTROL_DATA_TOTAL_COUNT, maximum_count);
- app_control_add_extra_data(svc_handle, "launch-type", "select-multiple");
+ app_control_add_extra_data(svc_handle,
+ APP_CONTROL_DATA_TOTAL_COUNT,
+ maximum_count);
+ app_control_add_extra_data(svc_handle, "launch-type",
+ "select-multiple");
app_control_add_extra_data(svc_handle, "file-type", "image");
- int ret = app_control_send_launch_request(svc_handle, __ge_gallery_ug_result_cb, data);
+ int ret =
+ app_control_send_launch_request(svc_handle,
+ __ge_gallery_ug_result_cb,
+ data);
ugd->gallery_handle = svc_handle;
if (ret == 0) {
ge_dbgE("Launching ug-gallery-efl Failed.");
}
} else {
- ge_dbgE("app_control_service_handle creation failed. Unable to Launch ug-gallery-efl.");
+ ge_dbgE
+ ("app_control_service_handle creation failed. Unable to Launch ug-gallery-efl.");
}
}
-static int
-__ge_grid_select_one(ge_item *gitem, char *file_url)
+static int __ge_grid_select_one(ge_item * gitem, char *file_url)
{
GE_CHECK_VAL(file_url, -1);
GE_CHECK_VAL(gitem, -1);
- ge_ugdata *ugd = (ge_ugdata *)gitem->ugd;
+ ge_ugdata *ugd = (ge_ugdata *) gitem->ugd;
GE_CHECK_VAL(ugd, -1);
ge_sdbg("Service add:%s", file_url);
int ret = -1;
- if ((!gitem->item->thumb_url) || (!g_strcmp0(gitem->item->thumb_url, DEFAULT_THUMBNAIL)) ||
- (strlen(gitem->item->thumb_url) == 0)) {
+ if ((!gitem->item->thumb_url)
+ || (!g_strcmp0(gitem->item->thumb_url, DEFAULT_THUMBNAIL))
+ || (strlen(gitem->item->thumb_url) == 0)) {
char *pStrWarning = g_strdup_printf(GE_STR_UNSUPPORTED_FILE);
notification_status_message_post(pStrWarning);
GE_FREE(pStrWarning);
return ret;
}
- char **path_array = (char **)calloc(1, sizeof(char *));
+ char **path_array = (char **) calloc(1, sizeof(char *));
if (!path_array) {
ge_dbgW("failed to allocate path");
return ret;
}
path_array[0] = strdup(file_url);
- ret = app_control_add_extra_data(ugd->service, GE_FILE_SELECT_RETURN_PATH, file_url);
+ ret =
+ app_control_add_extra_data(ugd->service,
+ GE_FILE_SELECT_RETURN_PATH, file_url);
if (ret != APP_CONTROL_ERROR_NONE) {
ge_dbgW("Add file path failed!");
}
- ret = app_control_add_extra_data_array(ugd->service, APP_CONTROL_DATA_SELECTED,
- (const char **)path_array, 1);
- ret = app_control_add_extra_data_array(ugd->service, APP_CONTROL_DATA_PATH,
- (const char **)path_array, 1);
+ ret =
+ app_control_add_extra_data_array(ugd->service,
+ APP_CONTROL_DATA_SELECTED,
+ (const char **) path_array, 1);
+ ret =
+ app_control_add_extra_data_array(ugd->service,
+ APP_CONTROL_DATA_PATH,
+ (const char **) path_array, 1);
if (ret != APP_CONTROL_ERROR_NONE) {
ge_dbgW("Add selected path failed!");
}
ret = ug_send_result_full(ugd->ug, ugd->service,
- APP_CONTROL_RESULT_SUCCEEDED);
+ APP_CONTROL_RESULT_SUCCEEDED);
if (ret != 0) {
ge_dbgW("Send result failed!");
}
- if (!ugd->is_attach_panel) {
- ug_destroy_me(ugd->ug);
- }
GE_FREEIF(path_array[0]);
GE_FREEIF(path_array);
}
static void
-__ge_gengrid_item_sel_cb(void *data, Evas_Object *obj, void *ei)
+__ge_gengrid_item_sel_cb(void *data, Evas_Object * obj, void *ei)
{
GE_CHECK(data);
- ge_item *gitem = (ge_item*)data;
+ ge_item *gitem = (ge_item *) data;
GE_CHECK(gitem->item);
GE_CHECK(gitem->ugd);
ge_ugdata *ugd = gitem->ugd;
ge_dbgE("Data Transfer Failed.");
}
} else if (ugd->file_select_mode == GE_FILE_SELECT_T_MULTIPLE) {
- Evas_Object *ck = elm_object_item_part_content_get((Elm_Object_Item *) ei, "checkbox_swallow");
+ Evas_Object *ck =
+ elm_object_item_part_content_get((Elm_Object_Item *) ei,
+ "checkbox_swallow");
Eina_Bool bl = elm_check_state_get(ck);
if (bl == EINA_FALSE) {
- if ((!gitem->item->thumb_url) || (!g_strcmp0(gitem->item->thumb_url, DEFAULT_THUMBNAIL)) ||
- (strlen(gitem->item->thumb_url) == 0)) {
- char *pStrWarning = g_strdup_printf(
- GE_STR_UNSUPPORTED_FILE);
+ if ((!gitem->item->thumb_url)
+ || (!g_strcmp0(gitem->item->thumb_url, DEFAULT_THUMBNAIL))
+ || (strlen(gitem->item->thumb_url) == 0)) {
+ char *pStrWarning =
+ g_strdup_printf(GE_STR_UNSUPPORTED_FILE);
notification_status_message_post(pStrWarning);
GE_FREE(pStrWarning);
return;
}
- if ((ugd->max_count != -1) && (gitem->ugd->thumbs_d->tot_selected + 1 > ugd->max_count)) {
+ if ((ugd->max_count != -1)
+ && (gitem->ugd->thumbs_d->tot_selected + 1 >
+ ugd->max_count)) {
char *noti_str = GE_STR_MAX_PICTURES_SELECTED;
char *pStrWarning = g_strdup_printf(noti_str,
- ugd->max_count);
+ ugd->max_count);
notification_status_message_post(pStrWarning);
GE_FREE(pStrWarning);
return;
ge_dbgE("Invalid select item");
return;
}
-#ifdef FEATURE_SIZE_CHECK
struct stat stFileInfo;
stat(sit->file_url, &stFileInfo);
- if (ugd->limitsize > 0 && ugd->selsize + stFileInfo.st_size > ugd->limitsize) {
- notification_status_message_post("maximum of 2MB can be selected");
+ if (ugd->limitsize > 0
+ && ugd->selsize + stFileInfo.st_size > ugd->limitsize) {
+ notification_status_message_post
+ ("maximum of 2MB can be selected");
_ge_data_util_free_sel_item(sit);
return;
}
-#endif
ge_sdbg("append Path: %s", sit->file_url);
- ugd->selected_elist = eina_list_append(ugd->selected_elist, sit);
+ ugd->selected_elist =
+ eina_list_append(ugd->selected_elist, sit);
elm_check_state_set(ck, EINA_TRUE);
gitem->ugd->thumbs_d->tot_selected++;
-#ifdef FEATURE_SIZE_CHECK
ugd->selsize += stFileInfo.st_size;
-#endif
gitem->checked = TRUE;
} else {
sit = _ge_data_util_new_sel_item(gitem);
ge_dbgE("Invalid select item");
return;
}
-#ifdef FEATURE_SIZE_CHECK
struct stat stFileInfo;
stat(sit->file_url, &stFileInfo);
-#endif
ge_sdbg("remove Path: %s", sit->file_url);
EINA_LIST_FOREACH(ugd->selected_elist, l, sit1) {
if (sit1 && !strcmp(sit->file_url, sit1->file_url)) {
- ugd->selected_elist = eina_list_remove(ugd->selected_elist, sit1);
+ ugd->selected_elist =
+ eina_list_remove(ugd->selected_elist, sit1);
_ge_data_util_free_sel_item(sit1);
}
}
elm_check_state_set(ck, EINA_FALSE);
gitem->ugd->thumbs_d->tot_selected--;
-#ifdef FEATURE_SIZE_CHECK
ugd->selsize -= stFileInfo.st_size;
-#endif
gitem->checked = FALSE;
_ge_data_util_free_sel_item(sit);
}
- btn = elm_object_item_part_content_get(ugd->nf_it, GE_NAVIFRAME_TITLE_RIGHT_BTN);
+ btn =
+ elm_object_item_part_content_get(ugd->nf_it,
+ GE_NAVIFRAME_TITLE_RIGHT_BTN);
if (btn == NULL) {
ge_dbgE("Failed to get part information");
}
}
if (gitem->ugd->thumbs_d->tot_selected >= 0) {
- text = g_strdup_printf(pd_selected, gitem->ugd->thumbs_d->tot_selected);
+ text =
+ g_strdup_printf(pd_selected,
+ gitem->ugd->thumbs_d->tot_selected);
elm_object_item_text_set(gitem->ugd->nf_it, text);
GE_FREEIF(text);
}
}
}
-static void
-__ge_cancel_cb(void *data, Evas_Object *obj, void *ei)
+static void __ge_cancel_cb(void *data, Evas_Object * obj, void *ei)
{
- ge_ugdata *app_data = (ge_ugdata *)data;
+ ge_ugdata *app_data = (ge_ugdata *) data;
Eina_List *l = NULL;
ge_item *gitem = NULL;
- if (app_data->is_attach_panel && (app_data->attach_panel_display_mode == ATTACH_PANEL_FULL_MODE)) {
+ if (app_data->is_attach_panel
+ && (app_data->attach_panel_display_mode ==
+ ATTACH_PANEL_FULL_MODE)) {
int ret;
app_control_h app_control = NULL;
ret = app_control_create(&app_control);
if (ret == APP_CONTROL_ERROR_NONE) {
- app_control_add_extra_data(app_control, ATTACH_PANEL_FLICK_MODE_KEY, ATTACH_PANEL_FLICK_MODE_ENABLE);
- app_control_add_extra_data_array(app_control, APP_CONTROL_DATA_PATH,
- NULL, 0);
- /*ret = app_control_add_extra_data(app_control, "__ATTACH_PANEL_SHOW_PANEL__", "false");
-
- if (ret != APP_CONTROL_ERROR_NONE) {
- ge_dbgW("Attach panel show failed");
- }*/
- ret = ug_send_result_full(app_data->ug, app_control, APP_CONTROL_RESULT_FAILED);
+ app_control_add_extra_data(app_control,
+ ATTACH_PANEL_FLICK_MODE_KEY,
+ ATTACH_PANEL_FLICK_MODE_ENABLE);
+ app_control_add_extra_data_array(app_control,
+ APP_CONTROL_DATA_PATH, NULL,
+ 0);
+ ret =
+ ug_send_result_full(app_data->ug, app_control,
+ APP_CONTROL_RESULT_FAILED);
}
app_control_destroy(app_control);
}
elm_naviframe_item_pop(app_data->naviframe);
}
-int
-ge_update_gengrid(ge_ugdata *ugd)
+int ge_update_gengrid(ge_ugdata * ugd)
{
GE_CHECK_VAL(ugd, -1);
GE_CHECK_VAL(ugd->thumbs_d, -1);
int ret = 0;
int i = 0;
- ge_item* gitem = NULL;
+ ge_item *gitem = NULL;
int item_cnt = 0;
char *pd_selected = GE_STR_PD_SELECTED;
ge_sel_item_s *sit = NULL;
int size = (win_w / 4);
- if (ugd->rotate_mode == GE_ROTATE_LANDSCAPE_UPSIDEDOWN || ugd->rotate_mode == GE_ROTATE_LANDSCAPE) {
+ if (ugd->rotate_mode == GE_ROTATE_LANDSCAPE_UPSIDEDOWN
+ || ugd->rotate_mode == GE_ROTATE_LANDSCAPE) {
size = (win_h / 7);
}
ugd->thumbs_d->tot_selected = 0;
ret = _ge_data_get_medias(ugd, ugd->thumbs_d->album_uuid,
- GE_ALL,
- 0,
- GE_GET_UNTIL_LAST_RECORD,
- &(ugd->thumbs_d->medias_elist),
- NULL, NULL);
+ GE_ALL,
+ 0,
+ GE_GET_UNTIL_LAST_RECORD,
+ &(ugd->thumbs_d->medias_elist), NULL, NULL);
if (ret != 0) {
ge_dbgE("###Get items list over[%d]###", ret);
return ret;
}
- ugd->thumbs_d->medias_cnt = eina_list_count(ugd->thumbs_d->medias_elist);
+ ugd->thumbs_d->medias_cnt =
+ eina_list_count(ugd->thumbs_d->medias_elist);
ge_dbg("Grid view updated media count: %d", ugd->thumbs_d->medias_cnt);
if (ugd->thumbs_d->medias_cnt == 0) {
for (i = 0; i < ugd->thumbs_d->medias_cnt; i++) {
gitem = eina_list_nth(ugd->thumbs_d->medias_elist, i);
if (gitem == NULL || gitem->item == NULL ||
- gitem->item->uuid == NULL) {
+ gitem->item->uuid == NULL) {
ge_dbgE("Invalid gitem!");
continue;
}
- if (sit && strcmp(sit->file_url, gitem->item->file_url) == 0) {
+ if (sit
+ && strcmp(sit->file_url, gitem->item->file_url) == 0) {
flag = true;
break;
}
}
if (flag == false) {
- ugd->selected_elist = eina_list_remove(ugd->selected_elist, sit);
+ ugd->selected_elist =
+ eina_list_remove(ugd->selected_elist, sit);
_ge_data_util_free_sel_item(sit);
}
}
elm_gengrid_item_size_set(ugd->thumbs_d->gengrid, size, size);
elm_gengrid_item_append(ugd->thumbs_d->gengrid,
ugd->thumbs_d->gic_first,
- NULL, __ge_launch_ug_gallery,
- ugd);
+ NULL, __ge_launch_ug_gallery, ugd);
for (i = 0; i < ugd->thumbs_d->medias_cnt; i++) {
gitem = eina_list_nth(ugd->thumbs_d->medias_elist, i);
if (gitem == NULL || gitem->item == NULL ||
- gitem->item->uuid == NULL) {
+ gitem->item->uuid == NULL) {
ge_dbgE("Invalid gitem!");
continue;
}
if (ugd->selected_elist) {
EINA_LIST_FOREACH(ugd->selected_elist, l, sit) {
- if (sit && strcmp(sit->file_url, gitem->item->file_url) == 0) {
+ if (sit
+ && strcmp(sit->file_url,
+ gitem->item->file_url) == 0) {
gitem->checked = true;
ugd->thumbs_d->tot_selected++;
}
}
gitem->ugd = ugd;
- gitem->elm_item = elm_gengrid_item_append(ugd->thumbs_d->gengrid,
- ugd->thumbs_d->gic,
- gitem, __ge_gengrid_item_sel_cb,
- gitem);
+ gitem->elm_item =
+ elm_gengrid_item_append(ugd->thumbs_d->gengrid,
+ ugd->thumbs_d->gic, gitem,
+ __ge_gengrid_item_sel_cb, gitem);
item_cnt++;
gitem->sequence = item_cnt + 1;
double scale = elm_config_scale_get();
if (ugd->attach_panel_display_mode == ATTACH_PANEL_FULL_MODE) {
if ((scale - 1.8) < 0.0001) {
- elm_gengrid_item_size_set(ugd->thumbs_d->gengrid, win_w, FULL_MODE_PORTRAIT_HEIGHT_WVGA);
+ elm_gengrid_item_size_set(ugd->thumbs_d->gengrid, win_w,
+ FULL_MODE_PORTRAIT_HEIGHT_WVGA);
} else {
- elm_gengrid_item_size_set(ugd->thumbs_d->gengrid, win_w, FULL_MODE_PORTRAIT_HEIGHT);
+ elm_gengrid_item_size_set(ugd->thumbs_d->gengrid, win_w,
+ FULL_MODE_PORTRAIT_HEIGHT);
}
} else {
if ((scale - 1.8) < 0.0001) {
- elm_gengrid_item_size_set(ugd->thumbs_d->gengrid, win_w, HALF_MODE_PORTRAIT_HEIGHT_WVGA);
+ elm_gengrid_item_size_set(ugd->thumbs_d->gengrid, win_w,
+ HALF_MODE_PORTRAIT_HEIGHT_WVGA);
} else {
- elm_gengrid_item_size_set(ugd->thumbs_d->gengrid, win_w, HALF_MODE_PORTRAIT_HEIGHT);
+ elm_gengrid_item_size_set(ugd->thumbs_d->gengrid, win_w,
+ HALF_MODE_PORTRAIT_HEIGHT);
}
}
ugd->nocontents = _ge_nocontents_create(ugd);
elm_gengrid_item_append(ugd->thumbs_d->gengrid,
- ugd->thumbs_d->no_content ,
- ugd, NULL,
- ugd);
+ ugd->thumbs_d->no_content, ugd, NULL, ugd);
}
Evas_Object *btn = NULL;
- btn = elm_object_item_part_content_get(ugd->nf_it , GE_NAVIFRAME_TITLE_RIGHT_BTN);
+ btn =
+ elm_object_item_part_content_get(ugd->nf_it,
+ GE_NAVIFRAME_TITLE_RIGHT_BTN);
if (btn == NULL) {
ge_dbgE("Failed to get part information");
}
}
static void _ge_grid_thumb_created_cb(media_content_error_e error,
- const char *path, void *user_data)
+ const char *path, void *user_data)
{
if (GE_FILE_EXISTS(path) && error == MEDIA_CONTENT_ERROR_NONE) {
GE_CHECK(user_data);
- ge_item *gitem = (ge_item *)user_data;
+ ge_item *gitem = (ge_item *) user_data;
GE_CHECK(gitem->item);
ge_dbg("Update item with new thumb path[%s]", path);
/* Update thumb path */
}
}
-static void
-__ge_grid_realized(void *data, Evas_Object *obj, void *ei)
+static void __ge_grid_realized(void *data, Evas_Object * obj, void *ei)
{
GE_CHECK(ei);
GE_CHECK(data);
- ge_ugdata *ugd = (ge_ugdata *)data;
+ ge_ugdata *ugd = (ge_ugdata *) data;
if (ugd->nocontents) {
ge_dbgE("No content layout no need to update items");
return;
}
GE_CHECK(ugd->thumbs_d);
- Elm_Object_Item *item = (Elm_Object_Item *)ei;
- ge_item* gitem = elm_object_item_data_get(item);
+ Elm_Object_Item *item = (Elm_Object_Item *) ei;
+ ge_item *gitem = elm_object_item_data_get(item);
GE_CHECK(gitem);
GE_CHECK(gitem->item);
ge_dbg("realized");
if (!GE_FILE_EXISTS(gitem->item->thumb_url) &&
- GE_FILE_EXISTS(gitem->item->file_url) &&
- (gitem->store_type == GE_PHONE ||
- gitem->store_type == GE_MMC ||
- gitem->store_type == GE_ALL)) {
+ GE_FILE_EXISTS(gitem->item->file_url) &&
+ (gitem->store_type == GE_PHONE ||
+ gitem->store_type == GE_MMC || gitem->store_type == GE_ALL)) {
ge_dbg("Generating Thumbs");
_ge_data_create_thumb(gitem->item,
- _ge_grid_thumb_created_cb,
- gitem);
+ _ge_grid_thumb_created_cb, gitem);
}
- Elm_Gengrid_Item_Class *it = elm_gengrid_item_item_class_get(ei);
+ const Elm_Gengrid_Item_Class *it = elm_gengrid_item_item_class_get(ei);
GE_CHECK(it);
if (!it->item_style) {
ge_dbgE("item style is NULL");
}
}
-static void
-__ge_grid_unrealized(void *data, Evas_Object *obj, void *ei)
+static void __ge_grid_unrealized(void *data, Evas_Object * obj, void *ei)
{
ge_dbg("Grid unrealized");
GE_CHECK(ei);
- ge_ugdata *ugd = (ge_ugdata *)data;
+ ge_ugdata *ugd = (ge_ugdata *) data;
GE_CHECK(ugd);
GE_CHECK(ugd->thumbs_d);
- Elm_Object_Item *item = (Elm_Object_Item*)ei;
- Elm_Gengrid_Item_Class *it = elm_gengrid_item_item_class_get(ei);
+ Elm_Object_Item *item = (Elm_Object_Item *) ei;
+ const Elm_Gengrid_Item_Class *it = elm_gengrid_item_item_class_get(ei);
GE_CHECK(it);
if (!it->item_style) {
ge_dbgE("item style is NULL");
Eina_List *l = NULL;
Evas_Object *content = NULL;
elm_gengrid_item_all_contents_unset(ei, &l);
- EINA_LIST_FREE(l, content)
- {
+ EINA_LIST_FREE(l, content) {
if (evas_object_smart_type_check(content, "elm_check")) {
- ugd->thumbs_d->check_list = eina_list_append(ugd->thumbs_d->check_list, content);
- evas_object_smart_callback_del(content, "changed", __ge_check_state_changed_cb);
+ ugd->thumbs_d->check_list =
+ eina_list_append(ugd->thumbs_d->check_list, content);
+ evas_object_smart_callback_del(content, "changed",
+ __ge_check_state_changed_cb);
} else if (evas_object_smart_type_check(content, "elm_layout")) {
- ugd->thumbs_d->image_layout_list = eina_list_append(ugd->thumbs_d->image_layout_list, content);
+ ugd->thumbs_d->image_layout_list =
+ eina_list_append(ugd->thumbs_d->image_layout_list,
+ content);
} else {
- evas_object_del(content);
- }
- } elm_object_item_signal_emit(item, "show_default_image", "elm");
- } else {
+ evas_object_del(content);
+ }
+ }
+ elm_object_item_signal_emit(item, "show_default_image", "elm");
+ } else {
ge_dbg("item style not matched");
}
}
-int
-ge_create_gengrid(ge_ugdata *ugd)
+int ge_create_gengrid(ge_ugdata * ugd)
{
ge_dbgE("");
GE_CHECK_VAL(ugd, -1);
ugd->attach_panel_display_mode = ATTACH_PANEL_HALF_MODE;
- ge_dbgE("!!!!! album view !!!!!!!! is pushed in the naviframe instead of content set");
+ ge_dbgE
+ ("!!!!! album view !!!!!!!! is pushed in the naviframe instead of content set");
int i = 0;
- ge_item* gitem = NULL;
+ ge_item *gitem = NULL;
int item_cnt = 0;
int ret = -1;
ge_thumbs_s *thumbs_d = NULL;
- thumbs_d = (ge_thumbs_s *)calloc(1, sizeof(ge_thumbs_s));
+ thumbs_d = (ge_thumbs_s *) calloc(1, sizeof(ge_thumbs_s));
GE_CHECK_VAL(thumbs_d, -1);
ugd->thumbs_d = thumbs_d;
ugd->thumbs_d->store_type = GE_ALL;
ugd->file_select_mode = GE_FILE_SELECT_T_ONE;
ret = _ge_data_get_medias(ugd, ugd->thumbs_d->album_uuid,
- GE_ALL,
- 0,
- GE_GET_UNTIL_LAST_RECORD,
- &(ugd->thumbs_d->medias_elist),
- NULL, NULL);
+ GE_ALL,
+ 0,
+ GE_GET_UNTIL_LAST_RECORD,
+ &(ugd->thumbs_d->medias_elist), NULL, NULL);
if (ret != 0) {
ge_dbgE("###Get items list over[%d]###", ret);
}
- ugd->thumbs_d->medias_cnt = eina_list_count(ugd->thumbs_d->medias_elist);
+ ugd->thumbs_d->medias_cnt =
+ eina_list_count(ugd->thumbs_d->medias_elist);
ge_dbg("Grid view all medias count: %d", ugd->thumbs_d->medias_cnt);
Evas_Object *gengrid;
- char edj_path[PATH_MAX] = {0, };
+ char edj_path[PATH_MAX] = { 0, };
- AppGetResource(GE_EDJ_FILE, edj_path, (int)PATH_MAX);
+ AppGetResource(GE_EDJ_FILE, edj_path, (int) PATH_MAX);
gengrid = elm_gengrid_add(ugd->albums_view);
ugd->thumbs_d->gengrid = gengrid;
elm_scroller_bounce_set(gengrid, EINA_FALSE, EINA_TRUE);
#endif
elm_scroller_policy_set(gengrid, ELM_SCROLLER_POLICY_OFF,
- ELM_SCROLLER_POLICY_AUTO);
- evas_object_size_hint_weight_set(gengrid, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ ELM_SCROLLER_POLICY_AUTO);
+ evas_object_size_hint_weight_set(gengrid, EVAS_HINT_EXPAND,
+ EVAS_HINT_EXPAND);
- if (ugd->is_attach_panel && (ugd->attach_panel_display_mode != ATTACH_PANEL_FULL_MODE)) {
- elm_scroller_movement_block_set(gengrid, ELM_SCROLLER_MOVEMENT_BLOCK_VERTICAL);
+ if ((ugd->attach_panel_display_mode != ATTACH_PANEL_FULL_MODE)) {
+ elm_scroller_movement_block_set(gengrid,
+ ELM_SCROLLER_MOVEMENT_BLOCK_VERTICAL);
}
- if (ugd->is_attach_panel) {
- evas_object_smart_callback_add(gengrid, "scroll,anim,stop",
- _ge_grid_move_stop_cb, ugd);
- evas_object_smart_callback_add(gengrid, "scroll,drag,stop",
- _ge_grid_move_stop_cb, ugd);
- evas_object_smart_callback_add(gengrid, "realized", __ge_grid_realized,
- ugd);
- evas_object_smart_callback_add(gengrid, "unrealized", __ge_grid_unrealized, ugd);
- }
+ evas_object_smart_callback_add(gengrid, "scroll,anim,stop",
+ _ge_grid_move_stop_cb, ugd);
+ evas_object_smart_callback_add(gengrid, "scroll,drag,stop",
+ _ge_grid_move_stop_cb, ugd);
+ evas_object_smart_callback_add(gengrid, "realized", __ge_grid_realized,
+ ugd);
+ evas_object_smart_callback_add(gengrid, "unrealized",
+ __ge_grid_unrealized, ugd);
ugd->thumbs_d->gic = elm_gengrid_item_class_new();
if (ugd->thumbs_d->gic) {
ugd->thumbs_d->gic->item_style = "gengrid_items";
ugd->thumbs_d->gic->func.text_get = NULL;
- ugd->thumbs_d->gic->func.content_get = __ge_gengrid_item_content_get;
+ ugd->thumbs_d->gic->func.content_get =
+ __ge_gengrid_item_content_get;
ugd->thumbs_d->gic->func.state_get = NULL;
ugd->thumbs_d->gic->func.del = NULL;
}
elm_gengrid_item_size_set(gengrid, size, size);
elm_gengrid_item_append(gengrid,
ugd->thumbs_d->gic_first,
- NULL, __ge_launch_ug_gallery,
- ugd);
+ NULL, __ge_launch_ug_gallery, ugd);
/* From zeroth IMAGE item to last one */
for (i = 0; i < ugd->thumbs_d->medias_cnt; i++) {
gitem = eina_list_nth(ugd->thumbs_d->medias_elist, i);
if (gitem == NULL || gitem->item == NULL ||
- gitem->item->uuid == NULL) {
+ gitem->item->uuid == NULL) {
ge_dbgE("Invalid gitem!");
continue;
}
gitem->ugd = ugd;
gitem->elm_item = elm_gengrid_item_append(gengrid,
- ugd->thumbs_d->gic,
- gitem, __ge_gengrid_item_sel_cb,
- gitem);
+ ugd->thumbs_d->gic,
+ gitem,
+ __ge_gengrid_item_sel_cb,
+ gitem);
item_cnt++;
gitem->sequence = item_cnt + 1;
ugd->nocontents = _ge_nocontents_create(ugd);
double scale = elm_config_scale_get();
if ((scale - 1.8) < 0.0001) {
- elm_gengrid_item_size_set(gengrid, win_w, HALF_MODE_PORTRAIT_HEIGHT_WVGA);
+ elm_gengrid_item_size_set(gengrid, win_w,
+ HALF_MODE_PORTRAIT_HEIGHT_WVGA);
} else {
- elm_gengrid_item_size_set(gengrid, win_w, HALF_MODE_PORTRAIT_HEIGHT);
+ elm_gengrid_item_size_set(gengrid, win_w,
+ HALF_MODE_PORTRAIT_HEIGHT);
}
elm_gengrid_item_append(gengrid,
- ugd->thumbs_d->no_content,
- ugd, NULL,
- ugd);
+ ugd->thumbs_d->no_content, ugd, NULL, ugd);
}
evas_object_show(gengrid);
char *pd_selected = GE_STR_PD_SELECTED;
char *text = g_strdup_printf(pd_selected, ugd->thumbs_d->tot_selected);
- ugd->nf_it = elm_naviframe_item_push(ugd->naviframe, text, NULL, NULL, ugd->albums_view, "basic/transparent");
+ ugd->nf_it =
+ elm_naviframe_item_push(ugd->naviframe, text, NULL, NULL,
+ ugd->albums_view, "basic/transparent");
+ elm_object_item_color_class_color_set(ugd->nf_it, "bg_title", 150, 155, 158,
+ 255);
GE_FREEIF(text);
elm_object_style_set(btn1, "naviframe/title_left");
//elm_object_text_set(btn1, GE_STR_ID_CANCEL_CAP);
_ge_ui_set_translate_str(btn1, "IDS_TPLATFORM_ACBUTTON_CANCEL_ABB");
- elm_object_item_part_content_set(ugd->nf_it, GE_NAVIFRAME_TITLE_LEFT_BTN, btn1);
+ elm_object_item_part_content_set(ugd->nf_it,
+ GE_NAVIFRAME_TITLE_LEFT_BTN, btn1);
evas_object_show(btn1);
evas_object_smart_callback_add(btn1, "clicked", __ge_cancel_cb, ugd);
- /* Done Button*/
+ /* Done Button */
Evas_Object *btn2 = elm_button_add(ugd->naviframe);
elm_object_style_set(btn2, "naviframe/title_right");
- //elm_object_text_set(btn2, GE_STR_ID_DONE_CAP);
_ge_ui_set_translate_str(btn2, "IDS_TPLATFORM_ACBUTTON_DONE_ABB");
elm_object_disabled_set(btn2, EINA_TRUE);
- elm_object_item_part_content_set(ugd->nf_it, GE_NAVIFRAME_TITLE_RIGHT_BTN, btn2);
+ elm_object_item_part_content_set(ugd->nf_it,
+ GE_NAVIFRAME_TITLE_RIGHT_BTN, btn2);
evas_object_show(btn2);
- evas_object_smart_callback_add(btn2, "clicked", __ge_grid_done_cb, (void *)ugd);
+ evas_object_smart_callback_add(btn2, "clicked", __ge_grid_done_cb,
+ (void *) ugd);
- elm_naviframe_item_title_enabled_set(ugd->nf_it, EINA_FALSE, EINA_FALSE);
+ elm_naviframe_item_title_enabled_set(ugd->nf_it, EINA_FALSE,
+ EINA_FALSE);
elm_naviframe_item_pop_cb_set(ugd->nf_it, __ge_main_back_cb, ugd);
return 0;
}
-int _ge_albums_update_view(ge_ugdata *ugd)
+void _ge_grid_change_selection_mode(ge_ugdata * ugd, bool state)
{
- ge_dbg("");
- GE_CHECK_VAL(ugd, -1);
- GE_CHECK_VAL(ugd->cluster_list, -1);
- int sel_cnt = 0;
-
- /* Reset view mode */
- _ge_set_view_mode(ugd, GE_VIEW_ALBUMS);
-
- /* Changed to show no contents if needed */
- if (!ugd->cluster_list->clist ||
- (eina_list_count(ugd->cluster_list->clist) == 0)) {
- _ge_data_get_clusters(ugd, GE_ALBUM_DATA_NONE);
- ugd->cluster_list->append_cb = __ge_albums_append;
- if (!ugd->cluster_list->clist ||
- (eina_list_count(ugd->cluster_list->clist) == 0)) {
- ge_dbgW("Clusters list is empty!");
- goto ALBUMS_FAILED;
- }
- }
-
- if (ugd->nocontents && ugd->nocontents == ugd->albums_view) {
- /* It is nocontents, unset it first then create albums view*/
- evas_object_del(ugd->nocontents);
- ugd->nocontents = NULL;
-
- ugd->albums_view = __ge_albums_add_view(ugd, ugd->naviframe);
- GE_CHECK_VAL(ugd->albums_view, -1);
- Evas_Object *tmp = NULL;
- tmp = elm_object_part_content_get(ugd->albums_view_ly, "contents");
- if (tmp != NULL) {
- ge_dbgE("tmp was not empty");
- elm_object_part_content_unset(ugd->albums_view_ly, "contents");
- evas_object_hide(tmp);
- }
-
- elm_object_part_content_set(ugd->albums_view_ly, "contents",
- ugd->albums_view);
-
- ge_dbgE("!!!!! album view !!!!!!!! is pushed in the naviframe instead of content set");
- ugd->nf_it = elm_naviframe_item_push(ugd->naviframe, GE_ALBUM_NAME, NULL, NULL, ugd->albums_view, NULL);
-
- if (ugd->nf_it != NULL) {
- ge_dbgE("!!!! album view !!!!! is push successfully in the nf");
- } else {
- ge_dbgE("!!!!!! album view !!!!!1111 failed to push in nf ");
- }
-
-
-
- evas_object_show(ugd->albums_view);
- } else {
- if (__ge_albums_append_albums(ugd, ugd->albums_view, true) != 0) {
- goto ALBUMS_FAILED;
- } else {
- elm_naviframe_item_pop(ugd->naviframe);
- ugd->nf_it = elm_naviframe_item_push(ugd->naviframe, GE_ALBUM_NAME, NULL, NULL, ugd->albums_view, NULL);
-
- if (ugd->nf_it != NULL) {
- ge_dbgE("!!!! album view !!!!! is push successfully in the nf");
- } else {
- ge_dbgE("!!!!!! album view !!!!!1111 failed to push in nf ");
- }
- }
- }
-
- sel_cnt = _ge_data_get_sel_cnt(ugd);
- if (ugd->done_it != NULL) {
- if (sel_cnt > 0 && (ugd->max_count < 0 || sel_cnt <= ugd->max_count)) {
- _ge_ui_disable_item(ugd->done_it, false);
- } else {
- _ge_ui_disable_item(ugd->done_it, true);
- }
- } else {
- ge_dbgW("done item is NULL");
- }
-
- Elm_Object_Item *nf_it = elm_naviframe_bottom_item_get(ugd->naviframe);
- _ge_ui_update_label_text(nf_it, sel_cnt, ugd->albums_view_title);
- return 0;
-
-ALBUMS_FAILED:
-
- sel_cnt = _ge_data_get_sel_cnt(ugd);
- if (ugd->done_it != NULL) {
- if (sel_cnt > 0 && (ugd->max_count < 0 || sel_cnt <= ugd->max_count)) {
- _ge_ui_disable_item(ugd->done_it, false);
+ GE_CHECK(ugd);
+ GE_CHECK(ugd->thumbs_d);
+ if (ugd->thumbs_d->gengrid) {
+ if (ugd->is_attach_panel
+ && (ugd->attach_panel_display_mode !=
+ ATTACH_PANEL_FULL_MODE)) {
+ elm_scroller_movement_block_set(ugd->thumbs_d->gengrid,
+ ELM_SCROLLER_MOVEMENT_BLOCK_VERTICAL);
} else {
- _ge_ui_disable_item(ugd->done_it, true);
+ elm_scroller_movement_block_set(ugd->thumbs_d->gengrid,
+ ELM_SCROLLER_MOVEMENT_NO_BLOCK);
}
- } else {
- ge_dbgW("done item is NULL");
}
-
- if (ugd->albums_view && ugd->albums_view != ugd->nocontents) {
- __ge_albums_del_cbs(ugd->albums_view);
- }
-
- evas_object_del(ugd->albums_view);
-
- ge_dbgW("@@@@@@@ To create nocontents view @@@@@@@@");
- ugd->nocontents = ge_ui_create_nocontents(ugd);
- ugd->albums_view = ugd->nocontents;
- GE_CHECK_VAL(ugd->albums_view, -1);
- evas_object_show(ugd->albums_view);
-
- elm_object_part_content_set(ugd->albums_view_ly, "contents",
- ugd->albums_view);
-
-
- ge_dbgE("!!!!! album view !!!!!!!! is pushed in the naviframe instead of content set");
- ugd->nf_it = elm_naviframe_item_push(ugd->naviframe, GE_ALBUM_NAME, NULL, NULL, ugd->albums_view, NULL);
-
- if (ugd->nf_it != NULL) {
- ge_dbgE("!!!! album view !!!!! is push successfully in the nf");
- } else {
- ge_dbgE("!!!!!! album view !!!!!1111 failed to push in nf ");
- }
-
- return -1;
}
-
+++ /dev/null
-/*
-* Copyright (c) 2000-2015 Samsung Electronics Co., Ltd All Rights Reserved
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*
-*/
-
-#include "ge-gridview.h"
-#include "ge-ui-util.h"
-#include "ge-util.h"
-#include "ge-ext-ug-load.h"
-#include "ge-data.h"
-#include "ge-exif.h"
-#include "ge-thumb.h"
-#include "ge-albums.h"
-#include "ge-button.h"
-#include "ge-main-view.h"
-#include "ge-strings.h"
-#include "ge-tile.h"
-#include <string.h>
-
-int a = 0;
-int b = 0;
-int A = 0;
-/* Icon swallowed to part "elm.swallow.icon" */
-#define GE_GRID_ICON_SIZE 156
-#define GE_GRID_CHECKBOX "elm.swallow.end"
-int back_cnt = 0;
-
-static void __ge_grid_check_changed(void *data, Evas_Object *obj, void *ei);
-
-static void __ge_grid_done_cb(void *data, Evas_Object *obj, void *ei);
-
-static void __ge_grid_thumb_created_cb(media_content_error_e error,
- const char *path, void *user_data)
-{
- if (GE_FILE_EXISTS(path) && error == MEDIA_CONTENT_ERROR_NONE) {
- GE_CHECK(user_data);
- ge_item *gitem = (ge_item *)user_data;
- GE_CHECK(gitem->item);
- ge_dbg("Update item with new thumb path[%s]", path);
- /* Update thumb path */
- GE_FREEIF(gitem->item->thumb_url);
- gitem->item->thumb_url = strdup(path);
- gitem->item->b_create_thumb = false;
- elm_gengrid_item_update(gitem->elm_item);
- } else {
- ge_dbgE("Invalid thumb path! Error number[%d]", error);
- }
-}
-
-/* Append item */
-int __ge_grid_append_sel_item(ge_ugdata *ugd, ge_item *gitem)
-{
- if (ugd == NULL || ugd->thumbs_d == NULL ||
- ugd->thumbs_d->album_uuid == NULL || gitem == NULL ||
- gitem->item == NULL) {
- ge_dbgE("Error input!");
- return -1;
- }
-
- /* Check album is created or not */
- ge_sel_album_s *salbum = NULL;
- Eina_List *l = NULL;
- EINA_LIST_FOREACH(ugd->selected_elist, l, salbum) {
- if (salbum == NULL || salbum->uuid == NULL) {
- continue;
- }
-
- if (!g_strcmp0(salbum->uuid, ugd->thumbs_d->album_uuid)) {
- ge_dbg("Found[%s]", salbum->uuid);
- break;
- }
-
- salbum = NULL;
- }
-
- /* Add a new album */
- if (salbum == NULL) {
- ge_dbg("Add new select album");
- salbum = _ge_data_util_new_sel_album(ugd->thumbs_d->album_uuid);
- ugd->selected_elist = eina_list_append(ugd->selected_elist,
- salbum);
- ge_dbg("Album count: %d", eina_list_count(ugd->selected_elist));
- }
- if (salbum == NULL) {
- ge_dbgE("Invalid select album");
- return -1;
- }
-
- ge_sel_item_s *sit = NULL;
- sit = _ge_data_util_new_sel_item(gitem);
- /* Append item */
- if (sit == NULL) {
- ge_dbgE("Invalid select item");
- } else {
- ge_sdbg("Path: %s", sit->file_url);
- salbum->elist = eina_list_append(salbum->elist, sit);
- }
- return 0;
-}
-
-/* Remove item */
-int __ge_grid_remove_sel_item(ge_ugdata *ugd, ge_item *gitem)
-{
- if (ugd == NULL || ugd->thumbs_d == NULL ||
- ugd->thumbs_d->album_uuid == NULL || gitem == NULL ||
- gitem->item == NULL) {
- ge_dbgE("Error input!");
- return -1;
- }
-
- /* Check album is appended or not */
- ge_sel_album_s *salbum = NULL;
- Eina_List *l = NULL;
- EINA_LIST_FOREACH(ugd->selected_elist, l, salbum) {
- if (salbum == NULL || salbum->uuid == NULL) {
- continue;
- }
-
- if (!g_strcmp0(salbum->uuid, ugd->thumbs_d->album_uuid)) {
- ge_dbg("Found[%s]", salbum->uuid);
- break;
- }
-
- salbum = NULL;
- }
-
- if (salbum == NULL) {
- ge_dbgE("None select album!");
- return -1;
- }
-
- /* Remove item */
- ge_sel_item_s *sit = NULL;
- EINA_LIST_FOREACH(salbum->elist, l, sit) {
- if (sit == NULL || sit->uuid == NULL) {
- continue;
- }
- if (g_strcmp0(sit->uuid, gitem->item->uuid)) {
- continue;
- }
-
- salbum->elist = eina_list_remove(salbum->elist, sit);
- _ge_data_util_free_sel_item(sit);
- }
- return 0;
-}
-
-/* Check item */
-static int __ge_grid_check_sel_items(ge_ugdata *ugd)
-{
- if (ugd == NULL || ugd->thumbs_d == NULL ||
- ugd->thumbs_d->album_uuid == NULL) {
- ge_dbgE("Error input!");
- return -1;
- }
-
- /* Check album is appended or not */
- ge_sel_album_s *salbum = NULL;
- Eina_List *l = NULL;
- EINA_LIST_FOREACH(ugd->selected_elist, l, salbum) {
- if (salbum == NULL || salbum->uuid == NULL) {
- continue;
- }
-
- if (!g_strcmp0(salbum->uuid, ugd->thumbs_d->album_uuid)) {
- break;
- }
-
- salbum = NULL;
- }
-
- if (salbum == NULL) {
- ge_dbgE("None select album!");
- return -1;
- }
-
- /* Remove item */
- ge_sel_item_s *sit = NULL;
- EINA_LIST_FOREACH(salbum->elist, l, sit) {
- if (sit == NULL || sit->uuid == NULL) {
- continue;
- }
- if (sit->valid == 1) {
- sit->valid = 0;
- continue;
- } else {
- ge_dbgW("Remove invalid item!");
- salbum->elist = eina_list_remove(salbum->elist, sit);
- _ge_data_util_free_sel_item(sit);
- }
- }
- return 0;
-}
-
-/* Get count of selected items */
-static int __ge_grid_get_sel_cnt(ge_ugdata *ugd)
-{
- if (ugd == NULL || ugd->selected_elist == NULL ||
- ugd->thumbs_d == NULL) {
- return 0;
- }
-
- if (ugd->thumbs_d->b_mainview) {
- return eina_list_count(ugd->selected_elist);
- }
-
- if (ugd->thumbs_d->album_uuid == NULL) {
- return 0;
- }
- /* Check album is created or not */
- ge_sel_album_s *salbum = NULL;
- int cnt = 0;
- Eina_List *l = NULL;
- EINA_LIST_FOREACH(ugd->selected_elist, l, salbum) {
- if (salbum == NULL || salbum->elist == NULL ||
- salbum->uuid == NULL ||
- g_strcmp0(salbum->uuid, ugd->thumbs_d->album_uuid)) {
- continue;
- }
- cnt = eina_list_count(salbum->elist);
- break;
- }
- ge_dbg("Count: %d", cnt);
-
- int cnt_all = _ge_data_get_sel_cnt(ugd);
- if (cnt_all > 0) {
- ge_dbg("Album count if part ");
- Evas_Object *btn = NULL;
- btn = elm_object_item_part_content_get(ugd->thumbs_d->nf_it, GE_NAVIFRAME_TITLE_RIGHT_BTN);
- if (btn == NULL) {
- ge_dbgE("Failed to get part information");
- return 0;
- }
- elm_object_disabled_set(btn, EINA_FALSE);
- evas_object_smart_callback_add(btn, "clicked", __ge_grid_done_cb, (void *)ugd);
- } else {
- ge_dbg("Album count else part ");
- Evas_Object *btn = NULL;
- btn = elm_object_item_part_content_get(ugd->thumbs_d->nf_it , GE_NAVIFRAME_TITLE_RIGHT_BTN);
- if (btn == NULL) {
- ge_dbgE("Failed to get part information");
- return 0;
- }
- elm_object_disabled_set(btn, EINA_TRUE);
- evas_object_smart_callback_add(btn, "clicked", NULL, (void *)ugd);
- }
-
- return cnt;
-}
-
-static void __ge_grid_realized(void *data, Evas_Object *obj, void *ei)
-{
- ge_dbg("realized");
- GE_CHECK(ei);
- GE_CHECK(data); /* It's ad */
- Elm_Object_Item *it = (Elm_Object_Item *)ei;
- ge_item *gitem = elm_object_item_data_get(it);
- GE_CHECK(gitem);
- GE_CHECK(gitem->item);
- /* Checking for local files only */
- if (gitem->store_type == GE_MMC || gitem->store_type == GE_ALL ||
- gitem->store_type == GE_PHONE) {
- /* Use default image */
- if (!GE_FILE_EXISTS(gitem->item->thumb_url) &&
- GE_FILE_EXISTS(gitem->item->file_url)) {
- ge_sdbg("File[%s]", gitem->item->file_url);
- _ge_data_create_thumb(gitem->item,
- __ge_grid_thumb_created_cb,
- gitem);
- }
- }
-}
-
-static void __ge_grid_unrealized(void *data, Evas_Object *obj, void *ei)
-{
- ge_dbg("unrealized");
- GE_CHECK(ei);
- GE_CHECK(data); /* It's ad */
- Elm_Object_Item *it = (Elm_Object_Item *)ei;
- ge_item *gitem = elm_object_item_data_get(it);
- GE_CHECK(gitem);
- GE_CHECK(gitem->item);
- /* Checking for local files only */
- if (gitem->store_type == GE_MMC ||
- gitem->store_type == GE_ALL ||
- gitem->store_type == GE_PHONE) {
- if (gitem->item->b_create_thumb) {
- _ge_data_cancel_thumb(gitem->item);
- }
- }
-}
-
-int _ge_grid_sel_one(ge_ugdata *ugd, char *file_url)
-{
- GE_CHECK_VAL(file_url, -1);
- GE_CHECK_VAL(ugd, -1);
- ge_sdbg("Service add:%s", file_url);
-
- /* 2013.06.20
- * single pick operation also needs array for return value.
- * this array only has one element. */
- char **path_array = (char **)calloc(1, sizeof(char *));
- if (!path_array) {
- ge_dbgW("failed to allocate path");
- return 0;
- }
- path_array[0] = strdup(file_url);
-
- int ret = -1;
- ret = app_control_add_extra_data(ugd->service, GE_FILE_SELECT_RETURN_PATH, file_url);
- if (ret != APP_CONTROL_ERROR_NONE) {
- ge_dbgW("Add file path failed!");
- }
- ret = app_control_add_extra_data_array(ugd->service, APP_CONTROL_DATA_SELECTED,
- (const char **)path_array, 1);
- ret = app_control_add_extra_data_array(ugd->service, APP_CONTROL_DATA_PATH,
- (const char **)path_array, 1);
- if (ret != APP_CONTROL_ERROR_NONE) {
- ge_dbgW("Add selected path failed!");
- }
- ret = ug_send_result_full(ugd->ug, ugd->service,
- APP_CONTROL_RESULT_SUCCEEDED);
- if (ret != 0) {
- ge_dbgW("Send result failed!");
- }
- if (!ugd->is_attach_panel) {
- ug_destroy_me(ugd->ug);
- }
-
- GE_FREEIF(path_array[0]);
- GE_FREEIF(path_array);
- return 0;
-}
-
-static int __ge_grid_change_check(void *data, Elm_Object_Item *it)
-{
- GE_CHECK_VAL(it, -1);
- GE_CHECK_VAL(data, -1);
- Evas_Object *ck = NULL;
- ge_dbg("");
-
- ck = elm_object_item_part_content_get(it, GE_GRID_CHECKBOX);
- GE_CHECK_VAL(ck, -1);
-
- elm_check_state_set(ck, !elm_check_state_get(ck));
- __ge_grid_check_changed(data, ck, NULL);
- return 0;
-}
-
-static void __ge_grid_sel(void *data, Evas_Object *obj, void *ei)
-{
- ge_dbg("");
- GE_CHECK(data);
- ge_item *gitem = (ge_item*)data;
- GE_CHECK(gitem->item);
- GE_CHECK(gitem->ugd);
- ge_ugdata *ugd = gitem->ugd;
- char *fileurl = NULL;
-
- elm_gengrid_item_selected_set(ei, EINA_FALSE);
-
- if (gitem->item->file_url == NULL || strlen(gitem->item->file_url) <= 0) {
- ge_dbgE("file_url is invalid!");
- return;
- } else {
- ge_sdbg("file_url: %s.", gitem->item->file_url);
- }
- /* Save scroller position before clearing gengrid */
- _ge_ui_save_scroller_pos(obj);
-
- if (ugd->file_select_mode == GE_FILE_SELECT_T_SETAS) {
- /* imageviewer only supprot image type while setting wallpaper */
- if (gitem->item->type == MEDIA_CONTENT_TYPE_IMAGE) {
- ge_dbg("Loading UG-IMAGE(VIDEO)-VIEWER");
- char album_index_str[12] = {0,};
- eina_convert_itoa(gitem->sequence, album_index_str);
- ugd->file_select_setas_path = gitem->item->file_url;
- fileurl = strdup(GE_ALBUM_ALL_ID);
- _ge_ext_load_iv_ug(ugd, gitem->item->file_url, fileurl, gitem->sequence);
- } else if (gitem->item->type == MEDIA_CONTENT_TYPE_VIDEO &&
- ugd->popup == NULL) {
- ge_ui_create_popup(ugd, GE_POPUP_ONEBUT,
- GE_POPUP_ONLY_SUPPORT_IMAGE);
- }
-
- }
-#ifdef TODO
- else if (gitem->item->type == MEDIA_CONTENT_TYPE_IMAGE ||
- gitem->item->type == MEDIA_CONTENT_TYPE_VIDEO) {
- ge_dbg("Loading UG-IMAGE(VIDEO)-VIEWER");
- fileurl = strdup(GE_ALBUM_ALL_ID);
- _ge_ext_load_iv_ug(ugd, gitem->item->file_url, fileurl, gitem->sequence);
- }
-#endif
- GE_FREEIF(fileurl);
-
- if (ugd->file_select_mode != GE_FILE_SELECT_T_SETAS) {
- if (_ge_get_view_mode(ugd) != GE_VIEW_THUMBS) {
- ge_dbgW("Edit mode!");
- if (ugd->thumbs_d->b_multifile) {
- __ge_grid_change_check(data, (Elm_Object_Item *)ei);
- } else {
- _ge_grid_sel_one(ugd, gitem->item->file_url);
- }
- return;
- } else {
- ge_dbg("ViewMode");
- _ge_grid_sel_one(ugd, gitem->item->file_url);
- return;
- }
- }
-
-}
-
-static void __ge_grid_check_changed(void *data, Evas_Object *obj, void *ei)
-{
- ge_dbg("");
- GE_CHECK(obj);
- GE_CHECK(data);
- ge_item *gitem = (ge_item *)data;
- GE_CHECK(gitem->item);
- GE_CHECK(gitem->item->file_url);
- GE_CHECK(gitem->ugd);
- ge_ugdata *ugd = gitem->ugd;
- GE_CHECK(ugd->service);
- GE_CHECK(ugd->thumbs_d);
-
- if (_ge_get_view_mode(ugd) != GE_VIEW_THUMBS_EDIT) {
- ge_dbgE("Wrong view mode!");
- return;
- }
-
- Eina_Bool checked = elm_check_state_get(obj);
- if (checked) {
- ge_sdbg("Append:%s", gitem->item->file_url);
- if (!ugd->thumbs_d->b_mainview) {
- __ge_grid_append_sel_item(ugd, gitem);
- } else
- ugd->selected_elist = eina_list_append(ugd->selected_elist,
- gitem);
- } else {
- ge_sdbg("Remove:%s", gitem->item->file_url);
- if (!ugd->thumbs_d->b_mainview) {
- __ge_grid_remove_sel_item(ugd, gitem);
- } else
- ugd->selected_elist = eina_list_remove(ugd->selected_elist,
- gitem);
- }
- ugd->thumbs_d->album->select = true;
- elm_gengrid_item_update(ugd->thumbs_d->album->griditem);
-
- gitem->checked = checked;
- int local_sel_cnt = __ge_grid_get_sel_cnt(ugd);
- int sel_cnt = _ge_data_get_sel_cnt(ugd);
- _ge_ui_update_label_text(ugd->thumbs_d->nf_it, sel_cnt,
- ugd->albums_view_title);
- if (local_sel_cnt == ugd->thumbs_d->medias_cnt) {
- ugd->ck_state = EINA_TRUE;
- } else {
- ugd->ck_state = EINA_FALSE;
- }
- Evas_Object *ck = elm_object_part_content_get(ugd->thumbs_d->layout, "select.all.area.check");
- elm_check_state_set(ck, ugd->ck_state);
- bool b_disabled = false;
- if (!ugd->thumbs_d->b_mainview) {
- sel_cnt = _ge_data_get_sel_cnt(ugd);
- if (ugd->max_count > 0 && sel_cnt > ugd->max_count) {
- char *noti = NULL;
- noti = g_strdup_printf(GE_STR_MAXIMUM_COUNT);
- _ge_ui_create_notiinfo(noti);
- GE_GFREEIF(noti);
- b_disabled = true;
- }
- }
- if (ugd->thumbs_d->done_it != NULL) {
- if (sel_cnt > 0 && !b_disabled) {
- _ge_ui_disable_item(ugd->thumbs_d->done_it, false);
- } else {
- _ge_ui_disable_item(ugd->thumbs_d->done_it, true);
- }
- } else {
- ge_dbgW("done item is NULL");
- }
-}
-
-static Evas_Object *__ge_grid_get_content(void *data, Evas_Object *obj, const char *part)
-{
- GE_CHECK_NULL(data);
- GE_CHECK_NULL(part);
- GE_CHECK_NULL(obj);
- ge_item *gitem = NULL;
-
- if (strlen(part) <= 0) {
- ge_dbgE("part length <= 0");
- return NULL;
- }
-
- gitem = (ge_item*)data;
- GE_CHECK_NULL(gitem->item);
- GE_CHECK_NULL(gitem->ugd);
- ge_ugdata *ugd = gitem->ugd;
- GE_CHECK_NULL(ugd->thumbs_d);
-
- if (!g_strcmp0(part, "elm.swallow.icon")) {
- Evas_Object *layout = NULL;
- char *path = NULL;
- unsigned int orient = 0;
-
- /* Use default image */
- if (GE_FILE_EXISTS(gitem->item->thumb_url)) {
- path = gitem->item->thumb_url;
- } else {
- path = GE_ICON_NO_THUMBNAIL;
- }
-
- bool b_favor = false;
- int ret = -1;
- ret = media_info_get_favorite(gitem->item->media_h, &b_favor);
- if (ret != MEDIA_CONTENT_ERROR_NONE) {
- ge_dbg("media_info_get_favorite error! ERROR[%d]", ret);
- }
-
- if (gitem->item->type == MEDIA_CONTENT_TYPE_VIDEO) {
- int v_dur = 0;
- _ge_local_data_get_duration(gitem->item->media_h, &v_dur);
- layout = _ge_thumb_show_part_icon_video(obj, path,
- v_dur, 0, b_favor,
- ugd->thumbs_d->icon_w,
- ugd->thumbs_d->icon_h);
-
- } else {
- layout = _ge_thumb_show_part_icon_image(obj, path,
- orient, b_favor,
- ugd->thumbs_d->icon_w,
- ugd->thumbs_d->icon_h);
- }
- return layout;
- } else if (!g_strcmp0(part, GE_GRID_CHECKBOX) &&
- (_ge_get_view_mode(ugd) == GE_VIEW_THUMBS_EDIT) &&
- ugd->thumbs_d->b_multifile) { /* Show checkbox for multiple files selection */
- Evas_Object* ck = NULL;
- ck = elm_check_add(obj);
- GE_CHECK_NULL(ck);
-
- evas_object_propagate_events_set(ck, EINA_FALSE);
- elm_check_state_set(ck, gitem->checked);
- evas_object_smart_callback_add(ck, "changed",
- __ge_grid_check_changed, data);
- evas_object_show(ck);
-
- return ck;
- } else if (!g_strcmp0(part, "elm.swallow.mode")) {
- return _ge_thumb_show_mode(obj, gitem->item->mode);
- }
- return NULL;
-}
-
-static bool __ge_grid_append_thumb(ge_ugdata *ugd, Evas_Object *parent, bool is_update)
-{
- ge_dbg("");
- GE_CHECK_FALSE(parent);
- GE_CHECK_FALSE(ugd);
- GE_CHECK_FALSE(ugd->thumbs_d);
- int i = 0;
- ge_item* gitem = NULL;
- int item_cnt = 0;
- ge_dbg("List count : %d", ugd->thumbs_d->medias_cnt);
-
- if (elm_gengrid_items_count(parent) > 0) {
- /* Save scroller position before clearing gengrid */
- _ge_ui_save_scroller_pos(parent);
- elm_gengrid_clear(parent);
- }
- if (is_update) {
- _ge_grid_update_data(ugd);
- }
- if (ugd->th) {
- elm_object_theme_set(parent, ugd->th);
- }
-
- for (i = 0; i < ugd->thumbs_d->medias_cnt; i++) {
- gitem = eina_list_nth(ugd->thumbs_d->medias_elist, i);
- if (gitem == NULL || gitem->item == NULL ||
- gitem->item->uuid == NULL) {
- ge_dbgE("Invalid gitem!");
- continue;
- }
-
- if (!gitem->item->file_url) {
- _ge_data_del_media_by_id(ugd, gitem->item->uuid);
- _ge_data_util_free_item(gitem);
- ugd->thumbs_d->medias_cnt--;
- --i;
- continue;
- }
-
- gitem->ugd = ugd;
- gitem->elm_item = elm_gengrid_item_append(parent,
- ugd->thumbs_d->gic,
- gitem, __ge_grid_sel,
- gitem);
- item_cnt++;
- gitem->sequence = item_cnt;
- }
- /* Restore previous position of scroller */
- _ge_ui_restore_scroller_pos(parent);
-
- if (item_cnt == 0) {
- return EINA_FALSE;
- } else {
- return EINA_TRUE;
- }
-}
-
-static Evas_Object* __ge_grid_create_ly(Evas_Object *parent)
-{
- ge_dbg("");
- GE_CHECK_NULL(parent);
- Evas_Object* layout = NULL;
-
- layout = ge_ui_load_edj(parent, GE_EDJ_FILE, GE_GRP_GRIDVIEW);
- GE_CHECK_NULL(layout);
- evas_object_show(layout);
- return layout;
-}
-
-static int __ge_grid_del_cbs(Evas_Object *view)
-{
- if (view) {
- ge_dbg("Delete callbacks");
- evas_object_smart_callback_del(view, "realized",
- __ge_grid_realized);
- evas_object_smart_callback_del(view, "unrealized",
- __ge_grid_unrealized);
- }
- return 0;
-}
-
-static int __ge_grid_rotate_view(ge_ugdata *ugd)
-{
- if (ugd && ugd->thumbs_d && ugd->thumbs_d->view &&
- ugd->thumbs_d->nocontents != ugd->thumbs_d->view) {
- _ge_thumb_set_size(ugd, ugd->thumbs_d->view, ugd->rotate_mode,
- &(ugd->thumbs_d->icon_w),
- &(ugd->thumbs_d->icon_h));
- return 0;
- } else {
- return -1;
- }
-}
-
-/* Free data after layout deleted */
-static void __ge_grid_delete_layout_cb(void *data, Evas *e, Evas_Object *obj,
- void *ei)
-{
- ge_dbg("Delete layout ---");
- /* evas_object_event_callback_del(obj, EVAS_CALLBACK_DEL,
- __ge_grid_delete_layout_cb);*/
- GE_CHECK(data);
- ge_ugdata *ugd = (ge_ugdata *)data;
- GE_CHECK(ugd->thumbs_d);
-
- if (ugd->key_down_handler) {
- ecore_event_handler_del(ugd->key_down_handler);
- ugd->key_down_handler = NULL;
- }
-
- GE_IF_DEL_IDLER(ugd->thumbs_d->append_idler)
- if (ugd->file_select_mode == GE_FILE_SELECT_T_ONE) {
- app_control_remove_extra_data(ugd->service,
- GE_FILE_SELECT_RETURN_PATH);
- }
- ugd->rotate_cbs = eina_list_remove(ugd->rotate_cbs,
- __ge_grid_rotate_view);
-
- if (ugd->thumbs_d->nocontents != ugd->thumbs_d->view) {
- elm_gengrid_clear(ugd->thumbs_d->view);
- __ge_grid_del_cbs(ugd->thumbs_d->view);
- _ge_ui_del_scroller_pos(ugd->thumbs_d->view);
- }
- if (ugd->thumbs_d->gic) {
- elm_gengrid_item_class_free(ugd->thumbs_d->gic);
- }
- /* Clear view data */
- _ge_data_free_medias(&(ugd->thumbs_d->medias_elist));
- ugd->thumbs_d->medias_cnt = 0;
- GE_FREEIF(ugd->thumbs_d->album_uuid);
- /* Free thumbs data */
- GE_FREEIF(ugd->thumbs_d);
- ugd->thumbs_d = NULL;
-
- ge_dbg("Delete layout +++");
-}
-
-/*
-* When select album, show first (GE_FIRST_VIEW_END_POS+1) medias.
-* Then use idler to get other medias from DB and appened
-* them to gridview.
-* In order to reduce transit time of first show of thumbnails view.
-* Cause most of time is spent for getting records from DB,
-* so we get first (GE_FIRST_VIEW_END_POS+1) items and show thumbnails view,
-* it will accelerate view show.
-*/
-static int __ge_grid_idler_append_thumbs(void *data)
-{
- GE_CHECK_VAL(data, -1);
- ge_ugdata *ugd = (ge_ugdata *)data;
- GE_CHECK_VAL(ugd->thumbs_d, -1);
- int i = 0;
- int item_cnt = 0;
- ge_item* gitem = NULL;
- int ret = -1;
- ge_dbg("First view medias count: %d;", ugd->thumbs_d->medias_cnt);
-
- if (ugd->thumbs_d->medias_cnt != (GE_FIRST_VIEW_END_POS + 1)) {
- ge_dbg("No any more items!");
- if (ugd->thumbs_d->b_multifile) {
- __ge_grid_check_sel_items(ugd);
- }
- return -1;
- }
-
- Eina_List *sel_ids = NULL;
- if (ugd->thumbs_d->b_multifile) {
- ge_dbg("Edit view for multiple selection");
- /* Get ID list of selected items */
- _ge_grid_get_selected_ids(ugd, &sel_ids);
- }
- /* Get other items from DB */
- ret = _ge_data_get_medias(ugd, ugd->thumbs_d->album_uuid,
- ugd->thumbs_d->store_type,
- (GE_FIRST_VIEW_END_POS + 1),
- GE_GET_UNTIL_LAST_RECORD,
- &(ugd->thumbs_d->medias_elist),
- _ge_data_restore_selected, sel_ids);
- if (ugd->thumbs_d->b_multifile) {
- __ge_grid_check_sel_items(ugd);
- }
-
- ge_dbgW("###Get items list over[%d]###", ret);
- if (ret < 0) {
- ge_dbg("Get items list failed!");
- return ret;
- }
- ugd->thumbs_d->medias_cnt = eina_list_count(ugd->thumbs_d->medias_elist);
- ge_dbg("Grid view all medias count: %d", ugd->thumbs_d->medias_cnt);
-
-
- /* From (GE_FIRST_VIEW_END_POS + 1)th item to last one */
- for (i = GE_FIRST_VIEW_END_POS + 1; i < ugd->thumbs_d->medias_cnt; i++) {
- gitem = eina_list_nth(ugd->thumbs_d->medias_elist, i);
- if (gitem == NULL || gitem->item == NULL ||
- gitem->item->uuid == NULL) {
- ge_dbgE("Invalid gitem!");
- continue;
- }
-
- if (!gitem->item->file_url) {
- ge_dbgE("file_url is invalid!");
- _ge_data_del_media_by_id(ugd, gitem->item->uuid);
- _ge_data_util_free_item(gitem);
- ugd->thumbs_d->medias_cnt--;
- i--;
- gitem = NULL;
- continue;
- }
-
- gitem->ugd = ugd;
- gitem->elm_item = elm_gengrid_item_append(ugd->thumbs_d->view,
- ugd->thumbs_d->gic,
- gitem, __ge_grid_sel,
- gitem);
- item_cnt++;
- gitem->sequence = item_cnt + GE_FIRST_VIEW_END_POS + 1;
- }
-
- ge_dbgW("Use idler to append other medias--Done");
- if (item_cnt == 0) {
- return -1;
- } else {
- return 0;
- }
-}
-
-static Eina_Bool __ge_grid_append_thumb_idler_cb(void *data)
-{
- GE_CHECK_CANCEL(data);
- ge_ugdata *ugd = (ge_ugdata*)data;
- GE_CHECK_CANCEL(ugd->thumbs_d);
-
- /* Try to get other medias from DB and append them to gridview*/
- int ret = __ge_grid_idler_append_thumbs(data);
- if (ret != 0) {
- ge_dbg("Failed to append grid items!");
- } else {
- ge_dbg("Successful to append grid items!");
- }
-
- /* Remove idler after all items appended */
- GE_IF_DEL_IDLER(ugd->thumbs_d->append_idler);
- return ECORE_CALLBACK_CANCEL;
-}
-
-#if 0
-static Eina_Bool __ge_grid_back_cb(void *data, Elm_Object_Item *it)
-{
- ge_dbgW("return key call back");
- GE_CHECK_FALSE(data);
- ge_ugdata *ugd = (ge_ugdata *)data;
-
- if (ugd->file_select_mode == GE_FILE_SELECT_T_SLIDESHOW) {
- ug_send_result_full(ugd->ug, ugd->service,
- APP_CONTROL_RESULT_FAILED);
- //ug_destroy_me(ugd->ug);
- ge_dbg("ug_destroy_me");
- /*If return ture, ug will pop naviframe first.*/
- return EINA_FALSE;
- }
-
- else {
- //ug_destroy_me(ugd->ug);
- ge_dbgW("ug_destroy_me ug destroyed in the else part");
- }
- /* Reset view mode */
- ge_dbgW("To update albums view!");
- _ge_albums_update_view(data);
- //ug_destroy_me(ugd->ug);
-
- return EINA_TRUE;
-}
-
-static void __ge_grid_done_cb(void *data, Evas_Object *obj, void *ei)
-{
- ge_dbg("");
- GE_CHECK(data);
- ge_ugdata *ugd = (ge_ugdata *)data;
- GE_CHECK(ugd->thumbs_d);
-
- elm_toolbar_item_selected_set((Elm_Object_Item *)ei, EINA_FALSE);
- elm_object_disabled_set(obj, EINA_TRUE);
-
- if (ugd->file_select_mode == GE_FILE_SELECT_T_SLIDESHOW) {
- /*ge_sel_album_s *salbum = NULL;
- ge_sel_item_s *sit = NULL;
- salbum = (ge_sel_album_s *)eina_list_nth(ugd->selected_elist, 0);
- GE_CHECK(salbum);
- sit = (ge_sel_item_s *)eina_list_nth(salbum->elist, 0);*/
- ge_item *git = (ge_item *)eina_list_nth(ugd->selected_elist, 0);
- _ge_ext_load_iv_ug(ugd, git->item->file_url);
- return;
- }
-
- _ge_send_result(ugd);
- ug_destroy_me(ugd->ug);
-}
-
-static void __ge_grid_cancel_cb(void *data, Evas_Object *obj, void *ei)
-{
- ge_dbg("");
- GE_CHECK(data);
- ge_ugdata *ugd = (ge_ugdata *)data;
- elm_naviframe_item_pop(ugd->naviframe);
-}
-#endif
-
-/* Select-all checkbox selected/deselected */
-static void __ge_grid_selall_cb(void *data, Evas_Object *obj, void *ei)
-{
- GE_CHECK(data);
- ge_dbg("");
- int i = 0;
- ge_ugdata *ugd = (ge_ugdata *)data;
- ge_item *gitem = NULL;
- ugd->ck_state = !ugd->ck_state;
- ge_dbg("");
- Evas_Object *ck = elm_object_part_content_get(ugd->thumbs_d->layout, "select.all.area.check");
- ge_dbg("changing strate");
- elm_check_state_set(ck, ugd->ck_state);
- ge_dbg("state changed");
- for (; i < ugd->thumbs_d->medias_cnt; ++i) {
- gitem = eina_list_nth(ugd->thumbs_d->medias_elist, i);
- if (NULL == gitem || NULL == gitem->item ||
- NULL == gitem->item->file_url || NULL == gitem->elm_item) {
- continue;
- }
- if (gitem->checked == ugd->ck_state) {
- continue;
- }
- gitem->checked = ugd->ck_state;
- if (ugd->ck_state == EINA_TRUE) {
- __ge_grid_append_sel_item(ugd, gitem);
- } else {
- __ge_grid_remove_sel_item(ugd, gitem);
- }
- ck = elm_object_item_part_content_get(gitem->elm_item, GE_GRID_CHECKBOX);
- if (ck == NULL) {
- ge_dbgE("Invalid checkbox!");
- continue;
- }
- if (elm_check_state_get(ck) != ugd->ck_state) {
- elm_check_state_set(ck, ugd->ck_state);
- }
- }
- int sel_cnt = __ge_grid_get_sel_cnt(ugd);
- sel_cnt = _ge_data_get_sel_cnt(ugd);
- _ge_ui_update_label_text(ugd->thumbs_d->nf_it, sel_cnt,
- ugd->albums_view_title);
- elm_gengrid_item_update(ugd->thumbs_d->album->griditem);
-}
-static void __ge_grid_done_cb(void *data, Evas_Object *obj, void *ei)
-{
- GE_CHECK(data);
- ge_ugdata *ugd = (ge_ugdata *)data;
- ugd->ck_state = !ugd->ck_state;
- int i = 0;
- ge_item *gitem = NULL;
- Evas_Object *ck = NULL;
-
- /* Check album is created or not */
- ge_sel_album_s *salbum = NULL;
- int cnt = 0;
- Eina_List *l = NULL;
- EINA_LIST_FOREACH(ugd->selected_elist, l, salbum) {
- if (salbum == NULL || salbum->elist == NULL ||
- salbum->uuid == NULL ||
- g_strcmp0(salbum->uuid, ugd->thumbs_d->album_uuid)) {
- continue;
- }
- cnt = eina_list_count(salbum->elist);
- break;
- }
- ge_dbg("Count: %d", cnt);
-
- if (cnt == 0) {
- return;
- }
-
- for (; i < ugd->thumbs_d->medias_cnt; ++i) {
- gitem = eina_list_nth(ugd->thumbs_d->medias_elist, i);
- if (NULL == gitem || NULL == gitem->item ||
- NULL == gitem->item->file_url || NULL == gitem->elm_item) {
- continue;
- }
-
- if (gitem->checked == ugd->ck_state) {
- continue;
- }
-
- gitem->checked = ugd->ck_state;
- if (!ugd->thumbs_d->b_mainview) {
- if (ugd->ck_state == EINA_TRUE) {
- ge_dbgE("if part fun will be called ");
-// __ge_main_done_cb(ugd, NULL, NULL);
- _ge_send_result(ugd);
- if (!ugd->is_attach_panel) {
- ug_destroy_me(ugd->ug);
- }
- //__ge_grid_append_sel_item(ugd, gitem);
- } else {
- ge_dbgE("else part fun will be called ");
-// __ge_main_done_cb(ugd, NULL, NULL);
- _ge_send_result(ugd);
- if (!ugd->is_attach_panel) {
- ug_destroy_me(ugd->ug);
- }
- //__ge_grid_remove_sel_item(ugd, gitem);
- }
- } else {
- if (ugd->ck_state == EINA_TRUE)
- ugd->selected_elist = eina_list_append(ugd->selected_elist,
- gitem);
- else
- ugd->selected_elist = eina_list_remove(ugd->selected_elist,
- gitem);
- }
- ck = elm_object_item_part_content_get(gitem->elm_item, GE_GRID_CHECKBOX);
- if (ck == NULL) {
- ge_dbgE("Invalid checkbox!");
- continue;
- }
- if (elm_check_state_get(ck) != ugd->ck_state) {
- elm_check_state_set(ck, ugd->ck_state);
- }
- }
-
- int sel_cnt = __ge_grid_get_sel_cnt(ugd);
- _ge_ui_update_label_text(ugd->thumbs_d->nf_it, sel_cnt,
- ugd->albums_view_title);
-
- bool b_disabled = false;
- if (!ugd->thumbs_d->b_mainview) {
- sel_cnt = _ge_data_get_sel_cnt(ugd);
- if (ugd->max_count > 0 && sel_cnt > ugd->max_count) {
- char *noti = NULL;
- char *noti_str = GE_STR_MAXIMUM_COUNT;
- noti = g_strdup_printf(noti_str, ugd->max_count);
- _ge_ui_create_notiinfo(noti);
- GE_GFREEIF(noti);
- b_disabled = true;
- }
- }
- if (ugd->thumbs_d->done_it != NULL) {
- if (sel_cnt > 0 && !b_disabled) {
- _ge_ui_disable_item(ugd->thumbs_d->done_it, false);
- } else {
- _ge_ui_disable_item(ugd->thumbs_d->done_it, true);
- }
- } else {
- ge_dbgW("done item is NULL");
- }
-}
-
-static int __ge_grid_add_btns(ge_ugdata *ugd, Evas_Object *parent,
- Elm_Object_Item *nf_it)
-{
- ge_dbg("Multiple selection, show Done");
- /* Done */
- //Elm_Object_Item *tb_it = NULL;
- //Evas_Object *toolbar = _ge_ui_add_toolbar(parent);
-
- /*if (ugd->file_select_mode == GE_FILE_SELECT_T_SLIDESHOW) {
- _ge_ui_append_item(toolbar, NULL, GE_STR_ID_CANCEL,
- __ge_grid_cancel_cb, ugd);
- tb_it = _ge_ui_append_item(toolbar, NULL, GE_STR_ID_START,
- __ge_grid_done_cb, ugd);
- if (tb_it != NULL) {
- _ge_ui_disable_item(tb_it, true);
- }
- } else {
- _ge_ui_append_item(toolbar, NULL, GE_STR_ID_BACK,
- __ge_grid_cancel_cb, ugd);
- tb_it = _ge_ui_append_item(toolbar, NULL, GE_STR_ID_DONE,
- __ge_grid_done_cb, ugd);
- if (tb_it != NULL) {
- _ge_ui_disable_item(tb_it, true);
- }
- }
-
- ugd->thumbs_d->done_it = tb_it;*/
- //elm_object_item_part_content_set(nf_it, "toolbar", toolbar);
- return 0;
-}
-
-static Eina_Bool __ge_main_back_cb(void *data, Elm_Object_Item *it)
-{
- ge_dbgE("all ug will be destroyed now");
- GE_CHECK_FALSE(data);
- ge_ugdata *ugd = (ge_ugdata *)data;
-
- void *pop_cb = evas_object_data_get(ugd->naviframe,
- GE_NAVIFRAME_POP_CB_KEY);
- if (pop_cb) {
- Eina_Bool(*_pop_cb)(void * ugd);
- _pop_cb = pop_cb;
-
- if (_pop_cb(ugd)) {
- /* Just pop edit view, dont destroy me */
- return EINA_FALSE;
- }
- }
-
- app_control_add_extra_data(ugd->service, GE_FILE_SELECT_RETURN_COUNT, "0");
- app_control_add_extra_data(ugd->service, GE_FILE_SELECT_RETURN_PATH, NULL);
- app_control_add_extra_data(ugd->service, APP_CONTROL_DATA_SELECTED, NULL);
- app_control_add_extra_data_array(ugd->service, APP_CONTROL_DATA_PATH, NULL, 0);
- ug_send_result_full(ugd->ug, ugd->service, APP_CONTROL_RESULT_FAILED);
- //elm_naviframe_item_pop(it);
- if (!ugd->is_attach_panel) {
- ug_destroy_me(ugd->ug);
- ge_dbg("ug_destroy_me");
- }
- /*If return ture, ug will pop naviframe first.*/
- return EINA_FALSE;
-}
-
-void _my_custom_keydown_cb(void* data, int type, void* event)
-{
- Ecore_Event_Key* ev = (Ecore_Event_Key*)event;
- ge_ugdata *app_data = (ge_ugdata *)data;
- ge_dbgE("key down call back ");
- if (!strcmp(ev->keyname, "XF86Back")) {
- ge_dbg("back key event");
- if (app_data->is_attach_panel && (app_data->attach_panel_display_mode == ATTACH_PANEL_FULL_MODE)) {
- if (_ge_get_view_mode(app_data) != GE_VIEW_ALBUMS) {
- elm_scroller_movement_block_set(app_data->albums_view, ELM_SCROLLER_MOVEMENT_NO_BLOCK);
- int ret;
- app_control_h app_control = NULL;
- ret = app_control_create(&app_control);
- if (ret == APP_CONTROL_ERROR_NONE) {
- app_control_add_extra_data(app_control, ATTACH_PANEL_FLICK_MODE_KEY, ATTACH_PANEL_FLICK_MODE_ENABLE);
- ret = ug_send_result_full(app_data->ug, app_control, APP_CONTROL_RESULT_SUCCEEDED);
- }
- app_control_destroy(app_control);
- }
- }
- _ge_tile_update_item_size(app_data, app_data->albums_view, app_data->rotate_mode,
- false);
- } else if (!strcmp(ev->keyname, "XF86Stop")) {
- char label[100];
- Elm_Object_Item *top = elm_naviframe_top_item_get(app_data->naviframe);
-
- snprintf(label, sizeof(label), "______________ the label is %s", elm_object_item_part_text_get(top , NULL));
- ge_dbg("%s", label);
-
- back_cnt++;
-
- if (((a - b) == 1 || back_cnt <= 2)) {
- if (back_cnt == 1) {
- elm_naviframe_item_pop(app_data->naviframe);
- Eina_List *list = elm_naviframe_items_get(app_data->naviframe);
- A = eina_list_count(list);
- ge_dbg("middle the value of A is %d", A);
- } else if (A != 3) {
- A = 0;
- ge_dbgE("back key is pressed so item will be poped from naviframe here");
- ge_dbgE("Size of the list before pop");
- Eina_List *list = elm_naviframe_items_get(app_data->naviframe);
- char str[100];
- snprintf(str, sizeof(str), " --------> %d", eina_list_count(list));
- ge_dbg("%s", str);
- a = eina_list_count(list);
- ge_dbg(" value of a is %d", a);
- Elm_Object_Item *top = elm_naviframe_top_item_get(app_data->naviframe);
-
- elm_object_item_del(top);
-
- ge_dbgE("Size of the list after pop");
- list = elm_naviframe_items_get(app_data->naviframe);
- snprintf(str, sizeof(str), " --------> %d", eina_list_count(list));
- ge_dbg("%s", str);
- b = eina_list_count(list);
- ge_dbg("value of b is %d", b);
- elm_naviframe_item_push(app_data->naviframe, GE_ALBUM_NAME, NULL, NULL, app_data->albums_view, NULL);
-
- list = elm_naviframe_items_get(app_data->naviframe);
- b = eina_list_count(list);
- ge_dbg("after value of b is %d", b);
- }
- } else {
- ge_dbgE("first finally calling the ug destroy function");
- __ge_main_back_cb(app_data, NULL);
- }
-
- if ((back_cnt == 2) & (A == 3)) {
- ge_dbgE("second finally calling the ug destroy function");
- __ge_main_back_cb(app_data, NULL);
- }
- }
-}
-
-static void __ge_albums_detail_cancel_cb(void *data, Evas_Object *obj, void *ei)
-{
- ge_ugdata *app_data = (ge_ugdata *)data;
- ge_dbg("back key event");
- if (app_data->is_attach_panel && (app_data->attach_panel_display_mode == ATTACH_PANEL_FULL_MODE)) {
- if (_ge_get_view_mode(app_data) != GE_VIEW_ALBUMS) {
- elm_scroller_movement_block_set(app_data->albums_view, ELM_SCROLLER_MOVEMENT_NO_BLOCK);
- int ret;
- app_control_h app_control = NULL;
- ret = app_control_create(&app_control);
- if (ret == APP_CONTROL_ERROR_NONE) {
- app_control_add_extra_data(app_control, ATTACH_PANEL_FLICK_MODE_KEY, ATTACH_PANEL_FLICK_MODE_ENABLE);
- ret = ug_send_result_full(app_data->ug, app_control, APP_CONTROL_RESULT_SUCCEEDED);
- }
- app_control_destroy(app_control);
- }
- }
- _ge_tile_update_item_size(app_data, app_data->albums_view, app_data->rotate_mode,
- false);
- elm_naviframe_item_pop(app_data->naviframe);
-
-}
-
-static int __ge_grid_push_view(ge_ugdata *ugd, Evas_Object *parent,
- Evas_Object *obj, char *title)
-{
- GE_CHECK_VAL(ugd, -1);
- GE_CHECK_VAL(parent, -1);
- GE_CHECK_VAL(obj, -1);
- GE_CHECK_VAL(title, -1);
- GE_CHECK_VAL(ugd->thumbs_d, -1);
- Elm_Object_Item *nf_it = NULL;
-
- if (ugd->file_select_mode == GE_FILE_SELECT_T_NONE) {
- ge_dbgE("GE_FILE_SELECT_T_NONE!");
- return -1;
- }
- ge_dbg("title: %s", title);
- /* Add prev button */
- /* Evas_Object *prev_btn = NULL;
- Evas_Object *prev_item = NULL;
- prev_btn = _ge_but_create_but(obj, ugd->th, NULL, NULL,
- GE_BTN_NAVI_PRE, NULL, NULL);
- GE_CHECK_VAL(prev_btn, -1);
- */
- elm_naviframe_prev_btn_auto_pushed_set(parent, EINA_FALSE);
- nf_it = elm_naviframe_item_push(parent, title, NULL, NULL, obj,
- NULL);
- if (nf_it == NULL) {
- ge_dbgW("nf_it is NULL");
- } else {
- ge_dbgW("nf_it is NOT NULL");
- }
-
-
- Eina_List *list = elm_naviframe_items_get(ugd->naviframe);
- a = eina_list_count(list);
-
- ugd->thumbs_d->nf_it = nf_it;
- ugd->key_down_handler = ecore_event_handler_add(ECORE_EVENT_KEY_DOWN,
- (Ecore_Event_Handler_Cb)_my_custom_keydown_cb,
- ugd);
-
- Evas_Object *btn1 = elm_button_add(parent);
-
- /**
- * Add 'Done' item.
- */
- if (ugd->thumbs_d->b_multifile) {
- elm_object_style_set(btn1, "naviframe/title_left");
- elm_object_text_set(btn1, GE_STR_ID_CANCEL_CAP);
- elm_object_item_part_content_set(ugd->thumbs_d->nf_it, GE_NAVIFRAME_TITLE_LEFT_BTN, btn1);
- ge_dbg("Multiple selection, show Done");
- /* Done */
- ge_dbgE("all the buttons code removed from here");
- __ge_grid_add_btns(ugd, ugd->naviframe, nf_it);
- Evas_Object *btn2 = elm_button_add(parent);
- elm_object_style_set(btn2, "naviframe/title_right");
- elm_object_text_set(btn2, GE_STR_ID_DONE_CAP);
- elm_object_disabled_set(btn2, EINA_TRUE);
- elm_object_item_part_content_set(nf_it,
- GE_NAVIFRAME_TITLE_RIGHT_BTN,
- btn2);
- ugd->ck_state = EINA_FALSE;
- } else {
- elm_object_style_set(btn1, "naviframe/end_btn/default");
- elm_object_item_part_content_set(ugd->thumbs_d->nf_it, "prev_btn", btn1);
- }
- evas_object_smart_callback_add(btn1, "clicked", __ge_albums_detail_cancel_cb, ugd);
- return 0;
-}
-
-static void _ge_detail_view_grid_move_stop_cb(void *data, Evas_Object *obj, void *ei)
-{
- ge_dbg("");
- GE_CHECK(data);
- ge_ugdata *ugd = (ge_ugdata *)data;
- int x, y, w, h;
- int ret;
- elm_scroller_region_get(obj, &x, &y, &w, &h);
-
- app_control_h app_control = NULL;
- ret = app_control_create(&app_control);
- if (ret == APP_CONTROL_ERROR_NONE) {
- if (y == 0) {
- app_control_add_extra_data(app_control, ATTACH_PANEL_FLICK_MODE_KEY, ATTACH_PANEL_FLICK_MODE_ENABLE);
- } else {
- app_control_add_extra_data(app_control, ATTACH_PANEL_FLICK_MODE_KEY, ATTACH_PANEL_FLICK_MODE_DISABLE);
- }
- ret = ug_send_result_full(ugd->ug, app_control, APP_CONTROL_RESULT_SUCCEEDED);
- }
- app_control_destroy(app_control);
-}
-
-static Evas_Object *__ge_grid_add_view(ge_ugdata *ugd, Evas_Object *parent)
-{
- GE_CHECK_NULL(parent);
- GE_CHECK_NULL(ugd);
- GE_CHECK_NULL(ugd->thumbs_d);
- Evas_Object *grid = elm_gengrid_add(parent);
- GE_CHECK_NULL(grid);
-
-#ifdef _USE_CUSTOMIZED_GENGRID_STYLE
- elm_object_style_set(grid, GE_GENGRID_STYLE_GALLERY);
-#endif
- ge_dbg("");
-
- /* Register delete callback */
- evas_object_event_callback_add(parent, EVAS_CALLBACK_DEL,
- __ge_grid_delete_layout_cb, ugd);
- /* evas_object_smart_callback_add(grid, "unrealized",
- __ge_grid_unrealized, ugd);
- evas_object_smart_callback_add(grid, "realized",
- __ge_grid_realized, ugd);
- */
-
- if (ugd->is_attach_panel && (ugd->attach_panel_display_mode != ATTACH_PANEL_FULL_MODE)) {
- elm_scroller_movement_block_set(grid, ELM_SCROLLER_MOVEMENT_BLOCK_VERTICAL);
- }
- if (ugd->is_attach_panel) {
- evas_object_smart_callback_add(grid, "scroll,anim,stop",
- _ge_detail_view_grid_move_stop_cb, ugd);
- evas_object_smart_callback_add(grid, "scroll,drag,stop",
- _ge_detail_view_grid_move_stop_cb, ugd);
- }
-
- _ge_ui_reset_scroller_pos(parent);
-
- if (!__ge_grid_append_thumb(ugd, grid, false)) {
- __ge_grid_del_cbs(grid);
- evas_object_del(grid);
- grid = NULL;
-
- ugd->thumbs_d->nocontents = ge_ui_create_nocontents(ugd);
- evas_object_show(ugd->thumbs_d->nocontents);
- return ugd->thumbs_d->nocontents;
- } else {
- evas_object_show(grid);
- ugd->thumbs_d->nocontents = NULL;
- }
-
-#ifdef _USE_SCROL_HORIZONRAL
- elm_gengrid_align_set(grid, 0.5, 0.5);
- elm_gengrid_horizontal_set(grid, EINA_TRUE);
- elm_scroller_bounce_set(grid, EINA_TRUE, EINA_FALSE);
-#else
- elm_gengrid_align_set(grid, 0.5, 0.0);
- elm_gengrid_horizontal_set(grid, EINA_FALSE);
- elm_scroller_bounce_set(grid, EINA_FALSE, EINA_TRUE);
-#endif
- elm_scroller_policy_set(grid, ELM_SCROLLER_POLICY_OFF,
- ELM_SCROLLER_POLICY_AUTO);
- elm_gengrid_multi_select_set(grid, EINA_TRUE);
- evas_object_size_hint_weight_set(grid, EVAS_HINT_EXPAND,
- EVAS_HINT_EXPAND);
- _ge_thumb_set_size(ugd, grid, ugd->rotate_mode,
- &(ugd->thumbs_d->icon_w), &(ugd->thumbs_d->icon_h));
- return grid;
-}
-
-int _ge_grid_get_selected_ids(ge_ugdata *ugd, Eina_List **ids_list)
-{
- GE_CHECK_VAL(ids_list, -1);
- if (ugd == NULL || ugd->selected_elist == NULL ||
- ugd->thumbs_d == NULL || ugd->thumbs_d->album_uuid == NULL) {
- return -1;
- }
-
- /* Check album is created or not */
- ge_sel_album_s *salbum = NULL;
- Eina_List *l = NULL;
- EINA_LIST_FOREACH(ugd->selected_elist, l, salbum) {
- if (salbum == NULL || salbum->elist == NULL ||
- salbum->uuid == NULL) {
- continue;
- }
- if (g_strcmp0(salbum->uuid, ugd->thumbs_d->album_uuid)) {
- continue;
- }
-
- *ids_list = salbum->elist;
- return 0;
- }
- return -1;
-}
-
-int _ge_grid_create_view(ge_ugdata *ugd, ge_thumbs_s *thumbs_d)
-{
- GE_CHECK_VAL(thumbs_d, -1);
-
- if (ugd->file_select_mode == GE_FILE_SELECT_T_SETAS) {
- ge_dbg("setas mode->thumbnail is view mode");
- _ge_set_view_mode(ugd, GE_VIEW_THUMBS);
- } else {
- ge_dbg("select mode->thumbnail is edit mode");
- _ge_set_view_mode(ugd, GE_VIEW_THUMBS_EDIT);
- }
- thumbs_d->split_view = __ge_add_albums_split_view(ugd, ugd->naviframe);
- if (!thumbs_d->split_view) {
- ge_dbg("creating split view failed");
- goto GE_GRID_FAILED;
- }
-
- thumbs_d->layout = __ge_grid_create_ly(ugd->naviframe);
- if (thumbs_d->layout == NULL) {
- goto GE_GRID_FAILED;
- }
-
- thumbs_d->gic = elm_gengrid_item_class_new();
- if (thumbs_d->gic == NULL) {
- goto GE_GRID_FAILED;
- }
- ugd->thumbs_d->gic->item_style = "gallery_efl/thumbnail_view";
- ugd->thumbs_d->gic->func.text_get = NULL;
- ugd->thumbs_d->gic->func.content_get = __ge_grid_get_content;
-
- thumbs_d->view = __ge_grid_add_view(ugd, thumbs_d->layout);
- if (thumbs_d->view == NULL) {
- goto GE_GRID_FAILED;
- }
-
- int w = -1, h = -1;
- evas_object_geometry_get(ugd->win, NULL, NULL, &w, &h);
- Edje_Message_Int *msg = (Edje_Message_Int *)malloc(sizeof(Edje_Message_Int) + sizeof(int));
- GE_CHECK_VAL(msg, -1);
- msg->val = ((w < h) ? (w / 3) : (h / 3));
- edje_object_message_send(elm_layout_edje_get(thumbs_d->layout), EDJE_MESSAGE_INT, 1, msg);
- free(msg);
- elm_object_signal_emit(thumbs_d->layout, "elm,splitview,state,visible", "elm");
- if (ugd->thumbs_d->b_multifile) {
- elm_object_signal_emit(thumbs_d->layout, "elm,selectall,state,visible,bg", "elm");
- elm_object_signal_emit(thumbs_d->layout, "elm,selectall,state,visible", "elm");
- }
- elm_object_part_text_set(thumbs_d->layout, "select.all.area.label", "Select all");
-
- Evas_Object *sel_all_ck = elm_check_add(thumbs_d->layout);
- elm_check_state_set(sel_all_ck, EINA_FALSE);
- elm_object_part_content_set(thumbs_d->layout, "select.all.area.check", sel_all_ck);
- Evas_Object *sel_all_btn = elm_button_add(thumbs_d->layout);
- elm_object_part_content_set(thumbs_d->layout, "select.all.area.check.fg", sel_all_btn);
- elm_object_style_set(sel_all_btn, "transparent");
- evas_object_smart_callback_add(sel_all_btn, "clicked", __ge_grid_selall_cb, ugd);
- if (w < h) {
- elm_gengrid_item_size_set(thumbs_d->split_view, (w / 3) - 40, (w / 3) - 20);
- } else {
- elm_gengrid_item_size_set(thumbs_d->split_view, (h / 3) - 20, (h / 3) - 40);
- }
- elm_object_part_content_set(thumbs_d->layout, "contents",
- thumbs_d->view);
- elm_object_part_content_set(thumbs_d->layout, "split.view",
- thumbs_d->split_view);
- __ge_grid_push_view(ugd, ugd->naviframe, thumbs_d->layout,
- ugd->albums_view_title);
- int sel_cnt = _ge_data_get_sel_cnt(ugd);
- if (ugd->thumbs_d->done_it != NULL) {
- if (sel_cnt > 0 && (ugd->max_count < 0 || sel_cnt <= ugd->max_count)) {
- _ge_ui_disable_item(ugd->thumbs_d->done_it, false);
- } else {
- _ge_ui_disable_item(ugd->thumbs_d->done_it, true);
- }
- } else {
- ge_dbgW("done item is NULL");
- }
- int grid_sel_cnt = __ge_grid_get_sel_cnt(ugd);
- if (grid_sel_cnt == ugd->thumbs_d->medias_cnt) {
- ugd->ck_state = true;
- } else {
- ugd->ck_state = false;
- }
- Evas_Object *ck = elm_object_part_content_get(ugd->thumbs_d->layout, "select.all.area.check");
- elm_check_state_set(ck, ugd->ck_state);
- _ge_ui_update_label_text(ugd->thumbs_d->nf_it, sel_cnt,
- ugd->albums_view_title);
-
- if (ugd->thumbs_d->medias_cnt == (GE_FIRST_VIEW_END_POS + 1)) {
- ge_dbgW("Use idler to append other medias--Start");
- GE_IF_DEL_IDLER(ugd->thumbs_d->append_idler)
- ugd->thumbs_d->append_idler = ecore_idler_add(__ge_grid_append_thumb_idler_cb,
- ugd);
- } else {
- if (ugd->thumbs_d->b_multifile) {
- __ge_grid_check_sel_items(ugd);
- }
- }
- ugd->rotate_cbs = eina_list_append(ugd->rotate_cbs,
- __ge_grid_rotate_view);
- return 0;
-
-GE_GRID_FAILED:
-
- if (thumbs_d->gic) {
- elm_gengrid_item_class_free(thumbs_d->gic);
- thumbs_d->gic = NULL;
- }
- return -1;
-}
-
-int _ge_grid_create_split_view(ge_ugdata *ugd, ge_thumbs_s *thumbs_d)
-{
- GE_CHECK_VAL(thumbs_d, -1);
- ge_dbg(" ");
- thumbs_d->view = NULL;
- thumbs_d->view = __ge_grid_add_view(ugd, thumbs_d->layout);
- if (thumbs_d->view == NULL) {
- goto GE_GRID_FAILED;
- }
- elm_object_part_content_set(thumbs_d->layout, "contents",
- thumbs_d->view);
- int sel_cnt = _ge_data_get_sel_cnt(ugd);
- int grid_sel_cnt = __ge_grid_get_sel_cnt(ugd);
- if (grid_sel_cnt == ugd->thumbs_d->medias_cnt) {
- ugd->ck_state = true;
- } else {
- ugd->ck_state = false;
- }
- Evas_Object *ck = elm_object_part_content_get(ugd->thumbs_d->layout, "select.all.area.check");
- elm_object_part_text_set(ugd->thumbs_d->layout, "select.all.area.label", "Select all");
- if (ugd->thumbs_d->b_multifile) {
- elm_object_signal_emit(ugd->thumbs_d->layout, "elm,selectall,state,visible,bg", "elm");
- elm_object_signal_emit(ugd->thumbs_d->layout, "elm,selectall,state,visible", "elm");
- }
- elm_check_state_set(ck, ugd->ck_state);
- _ge_ui_update_label_text(ugd->thumbs_d->nf_it, sel_cnt,
- ugd->albums_view_title);
-
- if (ugd->thumbs_d->medias_cnt == (GE_FIRST_VIEW_END_POS + 1)) {
- ge_dbgW("Use idler to append other medias--Start");
- GE_IF_DEL_IDLER(ugd->thumbs_d->append_idler)
- ugd->thumbs_d->append_idler = ecore_idler_add(__ge_grid_append_thumb_idler_cb,
- ugd);
- } else {
- if (ugd->thumbs_d->b_multifile) {
- __ge_grid_check_sel_items(ugd);
- }
- }
- return 0;
-
-GE_GRID_FAILED:
-
- if (thumbs_d->gic) {
- elm_gengrid_item_class_free(thumbs_d->gic);
- thumbs_d->gic = NULL;
- }
- return -1;
-}
-
-int _ge_grid_get_first_data(ge_ugdata *ugd, ge_cluster *album)
-{
- GE_CHECK_VAL(ugd, -1);
- GE_CHECK_VAL(album, -1);
- GE_CHECK_VAL(ugd->thumbs_d, -1);
- Eina_List *sel_ids = NULL;
- if (ugd->b_multifile) {
- ge_dbg("Multiple selection");
- ugd->thumbs_d->b_multifile = ugd->b_multifile;
- /* Get ID list of selected items */
- _ge_grid_get_selected_ids(ugd, &sel_ids);
- }
- /* Get album contents from DB */
- _ge_data_get_medias(ugd, album->cluster->uuid, album->cluster->type,
- GE_FIRST_VIEW_START_POS, GE_FIRST_VIEW_END_POS,
- &(ugd->thumbs_d->medias_elist),
- _ge_data_restore_selected, sel_ids);
-
- ugd->thumbs_d->medias_cnt = eina_list_count(ugd->thumbs_d->medias_elist);
- return ugd->thumbs_d->medias_cnt;
-}
-
-int _ge_grid_create_split_view_thumb(ge_cluster *album)
-{
- if (back_cnt == 1) {
- A = 0;
- }
- ge_dbgE("split thumb view starts here");
- GE_CHECK_VAL(album, -1);
- GE_CHECK_VAL(album->cluster, -1);
- GE_CHECK_VAL(album->cluster->uuid, -1);
- GE_CHECK_VAL(album->ugd, -1);
- ge_ugdata *ugd = album->ugd;
- GE_CHECK_VAL(ugd->thumbs_d, -1);
- ge_thumbs_s *thumbs_d = ugd->thumbs_d;
-
- ugd->thumbs_d->album_uuid = strdup(album->cluster->uuid);
- ugd->thumbs_d->album = album;
-
- _ge_data_free_medias(&(ugd->thumbs_d->medias_elist));
-
- _ge_grid_get_first_data(ugd, album);
- ugd->thumbs_d->store_type = album->cluster->type;
-
- elm_object_item_signal_emit(album->griditem, "elm,state,focused", "elm");
-
- if (ugd->selected_griditem && album->griditem != ugd->selected_griditem) {
- elm_object_item_signal_emit(ugd->selected_griditem, "elm,state,unfocused", "elm");
- }
- ugd->selected_griditem = album->griditem;
-
- if (_ge_grid_create_split_view(ugd, thumbs_d) < 0) {
- goto GE_GRID_FAILED;
- }
-
- return 0;
-
-GE_GRID_FAILED:
-
- GE_FREEIF(ugd->thumbs_d->album_uuid);
- GE_FREE(thumbs_d);
- ugd->thumbs_d = NULL;
- return -1;
-}
-
-int _ge_grid_create_thumb(ge_cluster *album)
-{
- if (back_cnt == 1) {
- A = 0;
- }
- ge_dbgE("thumb view starts here");
- GE_CHECK_VAL(album, -1);
- GE_CHECK_VAL(album->cluster, -1);
- GE_CHECK_VAL(album->cluster->uuid, -1);
- GE_CHECK_VAL(album->ugd, -1);
- ge_ugdata *ugd = album->ugd;
- ge_thumbs_s *thumbs_d = NULL;
-
- thumbs_d = (ge_thumbs_s *)calloc(1, sizeof(ge_thumbs_s));
- GE_CHECK_VAL(thumbs_d, -1);
- ugd->thumbs_d = thumbs_d;
- ugd->thumbs_d->album_uuid = strdup(album->cluster->uuid);
- ugd->thumbs_d->album = album;
-
- _ge_grid_get_first_data(ugd, album);
- ugd->thumbs_d->store_type = album->cluster->type;
-
- elm_object_item_signal_emit(album->griditem, "elm,state,focused", "elm");
-
- if (_ge_grid_create_view(ugd, thumbs_d) < 0) {
- goto GE_GRID_FAILED;
- }
-
- return 0;
-
-GE_GRID_FAILED:
-
- GE_FREEIF(ugd->thumbs_d->album_uuid);
- GE_FREE(thumbs_d);
- ugd->thumbs_d = NULL;
- return -1;
-}
-
-int _ge_grid_update_view(ge_ugdata *ugd)
-{
- ge_dbg("");
- GE_CHECK_VAL(ugd, -1);
- GE_CHECK_VAL(ugd->thumbs_d, -1);
-
- if (!__ge_grid_append_thumb(ugd, ugd->thumbs_d->view, true)) {
- __ge_grid_del_cbs(ugd->thumbs_d->view);
- return -1;
- } else {
- _ge_thumb_set_size(ugd, ugd->thumbs_d->view, ugd->rotate_mode,
- &(ugd->thumbs_d->icon_w),
- &(ugd->thumbs_d->icon_h));
-
- int sel_cnt = __ge_grid_get_sel_cnt(ugd);
- _ge_ui_update_label_text(ugd->thumbs_d->nf_it, sel_cnt,
- ugd->albums_view_title);
- if (!ugd->thumbs_d->b_mainview) {
- sel_cnt = _ge_data_get_sel_cnt(ugd);
- if (ugd->thumbs_d->done_it != NULL) {
- if (sel_cnt > 0 && (ugd->max_count < 0 || sel_cnt <= ugd->max_count)) {
- _ge_ui_disable_item(ugd->thumbs_d->done_it, false);
- } else {
- _ge_ui_disable_item(ugd->thumbs_d->done_it, true);
- }
- } else {
- ge_dbgW("done item is NULL");
- }
- }
- }
-
- return 0;
-}
-
-Evas_Object *_ge_grid_get_layout(ge_ugdata *ugd)
-{
- if (ugd && ugd->thumbs_d) {
- return ugd->thumbs_d->layout;
- } else {
- return NULL;
- }
-}
-
-int _ge_grid_update_lang(ge_ugdata *ugd)
-{
- GE_CHECK_VAL(ugd, -1);
- GE_CHECK_VAL(ugd->thumbs_d, -1);
- ge_dbg("");
-
- Elm_Object_Item *nf_it = elm_naviframe_top_item_get(ugd->naviframe);
- if (nf_it == NULL) {
- ge_dbgE("Invalid naviframe item!");
- return -1;
- }
- int count = __ge_grid_get_sel_cnt(ugd);
- /* Update the label text */
- _ge_ui_update_label_text(nf_it, count, ugd->albums_view_title);
- return 0;
-}
-
-int _ge_grid_update_data(ge_ugdata *ugd)
-{
- GE_CHECK_VAL(ugd, -1);
- GE_CHECK_VAL(ugd->thumbs_d, -1);
- Eina_List *sel_ids = NULL;
- ge_dbg("current album: %s", ugd->thumbs_d->album_uuid);
-
- if (ugd->thumbs_d->b_multifile) {
- ge_dbg("Edit view for multiple selection");
- /* Get ID list of selected items */
- _ge_grid_get_selected_ids(ugd, &sel_ids);
- }
-
- if (ugd->thumbs_d->nocontents != ugd->thumbs_d->view) {
- _ge_ui_save_scroller_pos(ugd->thumbs_d->view);
- elm_gengrid_clear(ugd->thumbs_d->view);
- }
- /* Clear view data */
- _ge_data_free_medias(&(ugd->thumbs_d->medias_elist));
- ugd->thumbs_d->medias_cnt = 0;
-
- int ret = -1;
- if (ugd->tab_mode == GE_CTRL_TAB_ALBUMS) {
- ret = _ge_data_update_medias(ugd, ugd->thumbs_d->album_uuid,
- ugd->thumbs_d->store_type,
- &(ugd->thumbs_d->medias_elist),
- _ge_data_restore_selected,
- sel_ids);
- }
-
- if (ret < 0) {
- ugd->thumbs_d->medias_cnt = 0;
- } else {
- ugd->thumbs_d->medias_cnt = eina_list_count(ugd->thumbs_d->medias_elist);
- }
-
- if (ugd->thumbs_d->b_multifile) {
- __ge_grid_check_sel_items(ugd);
- }
-
- if (ugd->thumbs_d->medias_cnt <= 0) {
- ge_dbgW("Current album is empty!");
- return -1;
- }
- return 0;
-}
-
-int _ge_grid_get_store_type(ge_ugdata *ugd)
-{
- if (ugd && ugd->thumbs_d) {
- return ugd->thumbs_d->store_type;
- } else {
- return -1;
- }
-}
-
-int _ge_grid_create_main_view(ge_ugdata *ugd)
-{
- GE_CHECK_VAL(ugd, -1);
- ge_thumbs_s *thumbs_d = NULL;
-
- thumbs_d = (ge_thumbs_s *)calloc(1, sizeof(ge_thumbs_s));
- GE_CHECK_VAL(thumbs_d, -1);
- ugd->thumbs_d = thumbs_d;
- ugd->thumbs_d->store_type = GE_ALL;
- ugd->thumbs_d->b_multifile = ugd->b_multifile;
- ugd->thumbs_d->b_mainview = true;
-
- switch (ugd->slideshow_viewby) {
- case GE_VIEW_BY_ALL:
- case GE_VIEW_BY_ALBUMS:
- if (!ugd->slideshow_album_id) {
- goto GE_GRID_FAILED;
- }
- ugd->thumbs_d->album_uuid = strdup(ugd->slideshow_album_id);
- /* Get album contents from DB */
- _ge_data_get_medias(ugd, ugd->slideshow_album_id, GE_ALL,
- GE_FIRST_VIEW_START_POS,
- GE_FIRST_VIEW_END_POS,
- &(ugd->thumbs_d->medias_elist), NULL, NULL);
- break;
- default:
- goto GE_GRID_FAILED;
- }
-
- ugd->thumbs_d->medias_cnt = eina_list_count(ugd->thumbs_d->medias_elist);
-
- if (_ge_grid_create_view(ugd, thumbs_d) < 0) {
- goto GE_GRID_FAILED;
- }
- return 0;
-
-GE_GRID_FAILED:
-
- GE_FREEIF(ugd->thumbs_d->album_uuid);
- GE_FREE(thumbs_d);
- ugd->thumbs_d = NULL;
- return -1;
-}
-
-void _ge_grid_change_selection_mode(ge_ugdata *ugd, bool state)
-{
- GE_CHECK(ugd);
- GE_CHECK(ugd->thumbs_d);
- ge_dbg("changing selection type and mode is %d", _ge_get_view_mode(ugd));
-#if 0
- ugd->selected_elist = NULL;
- Evas_Object *grid = NULL;
- if (_ge_get_view_mode(ugd) == GE_VIEW_THUMBS_EDIT || _ge_get_view_mode(ugd) == GE_VIEW_THUMBS) {
- if (ugd->thumbs_d) {
- ugd->thumbs_d->b_multifile = state;
- _ge_grid_update_view(ugd);
- Evas_Object *btn1 = elm_button_add(ugd->naviframe);
- if (state) {
- elm_object_style_set(btn1, "naviframe/title_left");
- elm_object_text_set(btn1, GE_STR_ID_CANCEL_CAP);
- elm_object_item_part_content_set(ugd->thumbs_d->nf_it, GE_NAVIFRAME_TITLE_LEFT_BTN, btn1);
- Evas_Object *temp = elm_object_item_part_content_unset(ugd->thumbs_d->nf_it,
- "prev_btn");
- ge_dbg("Multiple selection, show Done");
- /* Done */
- __ge_grid_add_btns(ugd, ugd->naviframe, ugd->thumbs_d->nf_it);
- Evas_Object *btn2 = elm_button_add(ugd->naviframe);
- elm_object_style_set(btn2, "naviframe/title_right");
- elm_object_text_set(btn2, GE_STR_ID_DONE_CAP);
- elm_object_disabled_set(btn2, EINA_TRUE);
- elm_object_item_part_content_set(ugd->thumbs_d->nf_it,
- GE_NAVIFRAME_TITLE_RIGHT_BTN,
- btn2);
- ugd->ck_state = EINA_FALSE;
- elm_object_signal_emit(ugd->thumbs_d->layout, "elm,selectall,state,visible,bg", "elm");
- elm_object_signal_emit(ugd->thumbs_d->layout, "elm,selectall,state,visible", "elm");
- if (temp) {
- evas_object_hide(temp);
- }
- } else {
- Evas_Object *temp = elm_object_item_part_content_unset(ugd->thumbs_d->nf_it,
- GE_NAVIFRAME_TITLE_RIGHT_BTN);
- elm_object_style_set(btn1, "naviframe/end_btn/default");
- elm_object_item_part_content_set(ugd->thumbs_d->nf_it, "prev_btn", btn1);
- Evas_Object *temp1 = elm_object_item_part_content_unset(ugd->thumbs_d->nf_it,
- GE_NAVIFRAME_TITLE_LEFT_BTN);
- elm_object_signal_emit(ugd->thumbs_d->layout, "elm,selectall,state,default", "elm");
- if (temp) {
- evas_object_hide(temp);
- }
- if (temp1) {
- evas_object_hide(temp1);
- }
-
- //elm_gengrid_realized_items_update(ugd->thumbs_d->split_view);
- _ge_data_free_sel_albums(ugd);
- Elm_Object_Item *it = NULL;
- it = elm_gengrid_first_item_get(ugd->thumbs_d->split_view);
- while (it) {
- elm_gengrid_item_update(it);
- elm_object_item_signal_emit((Elm_Object_Item *)it,
- "elm,state,elm.text.badge,hidden",
- "elm");
- it = elm_gengrid_item_next_get(it);
- }
-
- Evas_Object *ck = elm_object_part_content_get(ugd->thumbs_d->layout, "select.all.area.check");
- ugd->ck_state = false;
- elm_check_state_set(ck, ugd->ck_state);
- }
- evas_object_smart_callback_add(btn1, "clicked", __ge_albums_detail_cancel_cb, ugd);
-
- grid = ugd->thumbs_d->view;
- } else {
- ge_dbg("thumb data is null ");
- }
- } else if (_ge_get_view_mode(ugd) == GE_VIEW_ALBUMS) {
- grid = ugd->albums_view;
- }
-#endif
-
- if (ugd->thumbs_d->gengrid) {
- if (ugd->is_attach_panel && (ugd->attach_panel_display_mode != ATTACH_PANEL_FULL_MODE)) {
- elm_scroller_movement_block_set(ugd->thumbs_d->gengrid, ELM_SCROLLER_MOVEMENT_BLOCK_VERTICAL);
- } else {
- elm_scroller_movement_block_set(ugd->thumbs_d->gengrid, ELM_SCROLLER_MOVEMENT_NO_BLOCK);
- }
- }
-}
-
-bool _ge_is_grid_view(ge_ugdata *ugd)
-{
- if (ugd->thumbs_d && ugd->thumbs_d->nf_it) {
- return true;
- }
- return false;
-}
/*
-* Copyright (c) 2000-2015 Samsung Electronics Co., Ltd All Rights Reserved
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*
-*/
+ * Copyright (c) 2015 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://floralicense.org/license/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
#include "gallery-efl.h"
#include "ge-main-view.h"
#include "ge-ui-util.h"
#include "ge-util.h"
-#include "ge-button.h"
#include "ge-albums.h"
-#if 0//unsued
-static void __ge_main_done_cb(void *data, Evas_Object *obj, void *ei)
-{
- ge_dbg("");
- GE_CHECK(data);
- ge_ugdata *ugd = (ge_ugdata *)data;
- elm_object_item_disabled_set((Elm_Object_Item *)ei, EINA_TRUE);
- _ge_send_result(ugd);
- ug_destroy_me(ugd->ug);
-}
-
-static void __ge_main_cancel_cb(void *data, Evas_Object *obj, void *ei)
-{
- ge_dbg("");
- GE_CHECK(data);
- ge_ugdata *ugd = (ge_ugdata *)data;
- elm_naviframe_item_pop(ugd->naviframe);
-}
-
-static int __ge_main_add_btns(ge_ugdata *ugd, Evas_Object *parent,
- Elm_Object_Item *nf_it)
-{
- ge_dbg("Multiple selection, show Done");
- /* Done */
- Elm_Object_Item *tb_it = NULL;
- Evas_Object *toolbar = _ge_ui_add_toolbar(parent);
- _ge_ui_append_item(toolbar, NULL, GE_STR_ID_CANCEL, __ge_main_cancel_cb,
- ugd);
- tb_it = _ge_ui_append_item(toolbar, NULL, GE_STR_ID_DONE,
- __ge_main_done_cb, ugd);
- if (tb_it != NULL) {
- _ge_ui_disable_item(tb_it, true);
- }
-
- ugd->done_it = tb_it;
- elm_object_item_part_content_set(nf_it, "toolbar", toolbar);
- return 0;
-}
-
-static Eina_Bool __ge_main_back_cb(void *data, Elm_Object_Item *it)
-{
- ge_dbg("");
- GE_CHECK_FALSE(data);
- ge_ugdata *ugd = (ge_ugdata *)data;
-
- void *pop_cb = evas_object_data_get(ugd->naviframe,
- GE_NAVIFRAME_POP_CB_KEY);
- if (pop_cb) {
- Eina_Bool(*_pop_cb)(void * ugd);
- _pop_cb = pop_cb;
-
- if (_pop_cb(ugd)) {
- /* Just pop edit view, dont destroy me */
- return EINA_FALSE;
- }
- }
-
- app_control_add_extra_data(ugd->service, GE_FILE_SELECT_RETURN_COUNT, "0");
- app_control_add_extra_data(ugd->service, GE_FILE_SELECT_RETURN_PATH, NULL);
- app_control_add_extra_data(ugd->service, APP_CONTROL_DATA_SELECTED, NULL);
- ug_send_result_full(ugd->ug, ugd->service, APP_CONTROL_RESULT_FAILED);
- //elm_naviframe_item_pop(it);
- ug_destroy_me(ugd->ug);
- ge_dbg("ug_destroy_me");
- /*If return ture, ug will pop naviframe first.*/
- return EINA_FALSE;
-}
-#endif
-
-static Evas_Object *__ge_main_create_ly(ge_ugdata *ugd, Evas_Object *parent)
+static Evas_Object *__ge_main_create_ly(ge_ugdata * ugd,
+ Evas_Object * parent)
{
ge_dbg("");
GE_CHECK_NULL(parent);
Evas_Object *layout = ge_ui_load_edj(parent, GE_EDJ_FILE,
- GE_GRP_ALBUMVIEW);
+ GE_GRP_ALBUMVIEW);
GE_CHECK_NULL(layout);
evas_object_show(layout);
return layout;
}
-int _ge_main_create_view(ge_ugdata *ugd)
+int _ge_main_create_view(ge_ugdata * ugd)
{
GE_CHECK_VAL(ugd, -1);
GE_CHECK_VAL(ugd->naviframe, -1);
ge_create_gengrid(ugd);
return 0;
}
-
+++ /dev/null
-/*
-* Copyright (c) 2000-2015 Samsung Electronics Co., Ltd All Rights Reserved
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*
-*/
-
-#include "ge-debug.h"
-#include "ge-button.h"
-#include "ge-util.h"
-#include "ge-ui-util.h"
-
-Evas_Object *_ge_but_create_but(Evas_Object *parent, Elm_Theme *theme,
- const char *icon, const char *text,
- const char *style, But_Smart_Cb cb_func,
- const void *data)
-{
- Evas_Object *btn = NULL;
- GE_CHECK_NULL(parent);
-
- btn = elm_button_add(parent);
- GE_CHECK_NULL(btn);
-
- if (theme) {
- elm_object_theme_set(btn, theme);
- }
-
- if (style) {
- elm_object_style_set(btn, style);
- }
- evas_object_size_hint_align_set(btn, EVAS_HINT_FILL, EVAS_HINT_FILL);
-
- if (icon) {
- ge_sdbg("Button icon: %s", icon);
- Evas_Object *ic = NULL;
- ic = elm_icon_add(btn);
- GE_CHECK_NULL(ic);
- GE_ICON_SET_FILE(ic, icon);
- elm_image_aspect_fixed_set(ic, EINA_TRUE);
- elm_image_fill_outside_set(ic, EINA_TRUE);
- evas_object_size_hint_aspect_set(ic,
- EVAS_ASPECT_CONTROL_VERTICAL,
- 1, 1);
- evas_object_size_hint_align_set(ic, EVAS_HINT_FILL,
- EVAS_HINT_FILL);
- evas_object_size_hint_weight_set(ic, EVAS_HINT_EXPAND,
- EVAS_HINT_EXPAND);
- elm_image_resizable_set(ic, EINA_TRUE, EINA_TRUE);
- elm_object_content_set(btn, ic);
- }
-
- if (text) {
- ge_sdbg("Button text: %s", text);
- _ge_ui_set_translate_str(btn, text);
- }
-
- if (cb_func) {
- evas_object_smart_callback_add(btn, "clicked", cb_func, data);
- }
-
- return btn;
-}
-
-Evas_Object *_ge_but_create_image_but(Evas_Object *parent, const char *icon,
- const char *text, const char *style,
- Evas_Smart_Cb cb_func, void *data,
- Eina_Bool flag_propagate)
-{
- GE_CHECK_NULL(parent);
- Evas_Object *btn;
- btn = elm_button_add(parent);
- GE_CHECK_NULL(btn);
- ge_ugdata *ugd = (ge_ugdata *)data;
-
- if (style) {
- elm_object_style_set(btn, style);
- }
- if (text) {
- ge_sdbg("Button text: %s", text);
- _ge_ui_set_translate_str(btn, text);
- }
-
- if (icon) {
- Evas_Object *ic = elm_image_add(parent);
- GE_CHECK_NULL(ic);
- ugd->image_object = ic;
- GE_ICON_SET_FILE(ic, icon);
- elm_image_resizable_set(ic, EINA_TRUE, EINA_TRUE);
- evas_object_show(ic);
- elm_object_content_set(btn, ic);
- }
-
- evas_object_propagate_events_set(btn, flag_propagate);
- if (cb_func) {
- evas_object_smart_callback_add(btn, "clicked", cb_func, (void *)data);
- }
- return btn;
-}
-
-
/*
-* Copyright (c) 2000-2015 Samsung Electronics Co., Ltd All Rights Reserved
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*
-*/
+ * Copyright (c) 2015 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://floralicense.org/license/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
#include "ge-ui-util.h"
#include "ge-debug.h"
-Evas_Object *_ge_nocontents_create(ge_ugdata *ugd)
+Evas_Object *_ge_nocontents_create(ge_ugdata * ugd)
{
GE_CHECK_NULL(ugd);
Evas_Object *noc_lay = NULL;
elm_layout_theme_set(noc_lay, "layout", "nocontents", "text");
_ge_ui_set_translate_part_str(noc_lay, "elm.text", GE_STR_NO_ITEMS);
- _ge_ui_set_translate_part_str(noc_lay, "elm.help.text", GE_STR_NO_ITEMS_HELP_TEXT);
+ _ge_ui_set_translate_part_str(noc_lay, "elm.help.text",
+ GE_STR_NO_ITEMS_HELP_TEXT);
elm_layout_signal_emit(noc_lay, "text,disabled", "");
elm_layout_signal_emit(noc_lay, "align.center", "elm");
return noc_lay;
}
-
+++ /dev/null
-/*
-* Copyright (c) 2000-2015 Samsung Electronics Co., Ltd All Rights Reserved
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*
-*/
-
-#ifdef _USE_ROTATE_BG_GE
-
-#include "ge-rotate-bg.h"
-#include "ge-exif.h"
-#include "ge-debug.h"
-#include "ge-icon.h"
-
-#define GE_ROTATE_BG_DATA_KEY "ge_bg_data"
-#define GE_ROTATE_BG_GROUP "ge_bg_layout"
-
-typedef struct _ge_bg {
- Evas_Object *base;
- Evas_Object *img;
- char *file;
- bool b_preload;
-} ge_bg;
-
-static int __ge_rotate_bg_image_rotate_180(Evas_Object *obj)
-{
- GE_CHECK_VAL(obj, -1);
- unsigned int *data = NULL;
- unsigned int *data2 = NULL;
- unsigned int *to = NULL;
- unsigned int *from = NULL;
- int x = 0;
- int hw = 0;
- int iw = 0;
- int ih = 0;
-
- evas_object_image_size_get(obj, &iw, &ih);
- int size = iw * ih * sizeof(unsigned int);
-
- /* EINA_FALSE for reading */
- data = evas_object_image_data_get(obj, EINA_FALSE);
- /* memcpy */
- data2 = calloc(1, size);
- GE_CHECK_VAL(data2, -1);
- memcpy(data2, data, size);
-
- data = evas_object_image_data_get(obj, EINA_TRUE);
-
- hw = iw * ih;
- x = hw;
- to = data;
- from = data2 + hw - 1;
- for (; --x >= 0;) {
- *to = *from;
- to++;
- from--;
- }
-
-
- GE_FREE(data2);
-
- evas_object_image_data_set(obj, data);
- evas_object_image_data_update_add(obj, 0, 0, iw, ih);
- return 0;
-}
-
-static int __ge_rotate_bg_image_rotate_90(Evas_Object *obj)
-{
- GE_CHECK_VAL(obj, -1);
- unsigned int *data = NULL;
- unsigned int *data2 = NULL;
- unsigned int *to = NULL;
- unsigned int *from = NULL;
- int x = 0;
- int y = 0;
- int w = 0;
- int hw = 0;
- int iw = 0;
- int ih = 0;
-
- evas_object_image_size_get(obj, &iw, &ih);
- int size = iw * ih * sizeof(unsigned int);
-
- /* EINA_FALSE for reading */
- data = evas_object_image_data_get(obj, EINA_FALSE);
- /* memcpy */
- data2 = calloc(1, size);
- GE_CHECK_VAL(data2, -1);
- memcpy(data2, data, size);
-
- /* set width, height */
- w = ih;
- ih = iw;
- iw = w;
- hw = w * ih;
-
- /* set width, height to image obj */
- evas_object_image_size_set(obj, iw, ih);
- data = evas_object_image_data_get(obj, EINA_TRUE);
- to = data + w - 1;
- hw = -hw - 1;
- from = data2;
-
- for (x = iw; --x >= 0;) {
- for (y = ih; --y >= 0;) {
- *to = *from;
- from++;
- to += w;
- }
-
- to += hw;
- }
-
- GE_FREE(data2);
-
- evas_object_image_data_set(obj, data);
- evas_object_image_data_update_add(obj, 0, 0, iw, ih);
- return 0;
-}
-
-static int __ge_rotate_bg_image_rotate_270(Evas_Object *obj)
-{
- GE_CHECK_VAL(obj, -1);
- unsigned int *data = NULL;
- unsigned int *data2 = NULL;
- unsigned int *to = NULL;
- unsigned int *from = NULL;
- int x = 0;
- int y = 0;
- int w = 0;
- int hw = 0;
- int iw = 0;
- int ih = 0;
-
- evas_object_image_size_get(obj, &iw, &ih);
- int size = iw * ih * sizeof(unsigned int);
-
- /* EINA_FALSE for reading */
- data = evas_object_image_data_get(obj, EINA_FALSE);
- /* memcpy */
- data2 = calloc(1, size);
- GE_CHECK_VAL(data2, -1);
- memcpy(data2, data, size);
-
- /* set width, height */
- w = ih;
- ih = iw;
- iw = w;
- hw = w * ih;
-
- /* set width, height to image obj */
- evas_object_image_size_set(obj, iw, ih);
- data = evas_object_image_data_get(obj, EINA_TRUE);
-
- to = data + hw - w;
- w = -w;
- hw = hw + 1;
- from = data2;
-
- for (x = iw; --x >= 0;) {
- for (y = ih; --y >= 0;) {
- *to = *from;
- from++;
- to += w;
- }
-
- to += hw;
- }
-
- GE_FREE(data2);
-
- evas_object_image_data_set(obj, data);
- evas_object_image_data_update_add(obj, 0, 0, iw, ih);
- return 0;
-}
-
-/* check its orientation */
-int __ge_rotate_bg_rotate_image(Evas_Object *obj, unsigned int orient)
-{
- switch (orient) {
- case GE_ORIENTATION_ROT_90:
- __ge_rotate_bg_image_rotate_90(obj);
- break;
- case GE_ORIENTATION_ROT_180:
- __ge_rotate_bg_image_rotate_180(obj);
- break;
- case GE_ORIENTATION_ROT_270:
- __ge_rotate_bg_image_rotate_270(obj);
- break;
- default:
- break;
- }
-
- return 0;
-}
-
-static void __ge_rotate_bg_delete_cb(void *data, Evas *e, Evas_Object *obj,
- void *ei)
-{
- if (data) {
- ge_bg *bg_data = (ge_bg *)data;
- GE_FREEIF(bg_data->file);
- GE_FREE(data);
- }
-}
-
-static void __ge_rotate_bg_custom_resize(void *data, Evas *e, Evas_Object *obj,
- void *ei)
-{
- GE_CHECK(data);
- ge_bg *bg_data = (ge_bg *)data;
- Evas_Coord bx = 0;
- Evas_Coord by = 0;
- Evas_Coord bw = 0;
- Evas_Coord bh = 0;
- Evas_Coord iw = 0;
- Evas_Coord ih = 0;
- Evas_Coord fx = 0;
- Evas_Coord fy = 0;
- Evas_Coord fw = 0;
- Evas_Coord fh = 0;
- Evas_Coord nx = 0;
- Evas_Coord ny = 0;
- Evas_Coord nw = 0;
- Evas_Coord nh = 0;
-
- if ((!bg_data->img) || (!bg_data->base)) {
- ge_dbgE("Invalid object!");
- return;
- }
- /* grab image size */
- evas_object_image_size_get(bg_data->img, &iw, &ih);
- if ((iw < 1) || (ih < 1)) {
- ge_dbgE("(iw < 1) || (ih < 1)!");
- return;
- }
-
- /* grab base object dimensions */
- evas_object_geometry_get(bg_data->base, &bx, &by, &bw, &bh);
-
- /* set some defaults */
- nx = bx;
- ny = by;
- nw = bw;
- nh = bh;
-
-
- fw = bw;
- fh = ((ih * fw) / iw);
- if (fh < bh) {
- fh = bh;
- fw = ((iw * fh) / ih);
- }
- fx = ((bw - fw) / 2);
- fy = ((bh - fh) / 2);
-
- evas_object_move(bg_data->img, nx, ny);
- evas_object_resize(bg_data->img, nw, nh);
- evas_object_image_fill_set(bg_data->img, fx, fy, fw, fh);
-}
-
-Evas_Object *_ge_rotate_bg_add_layout(Evas_Object *parent, const char *file,
- const char *group)
-{
- Evas_Object *eo = NULL;
- int r = 0;
-
- eo = elm_layout_add(parent);
- if (eo) {
- r = elm_layout_file_set(eo, file, group);
- if (!r) {
- evas_object_del(eo);
- return NULL;
- }
-
- evas_object_size_hint_weight_set(eo, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
- evas_object_size_hint_align_set(eo, EVAS_HINT_FILL, EVAS_HINT_FILL);
- }
-
- return eo;
-}
-
-Evas_Object *_ge_rotate_bg_add(Evas_Object *parent, bool b_preload)
-{
- GE_CHECK_NULL(parent);
-
- ge_bg *bg_data = (ge_bg *)calloc(1, sizeof(ge_bg));
- GE_CHECK_NULL(bg_data);
-
- Evas_Object *base = NULL;
- base = _ge_rotate_bg_add_layout(parent, GE_EDJ_FILE,
- GE_ROTATE_BG_GROUP);
- if (base == NULL) {
- GE_FREE(bg_data);
- return NULL;
- }
-
- bg_data->base = base;
- bg_data->b_preload = b_preload;
- if (!b_preload)
- evas_object_event_callback_add(base, EVAS_CALLBACK_RESIZE,
- __ge_rotate_bg_custom_resize,
- bg_data);
- evas_object_event_callback_add(base, EVAS_CALLBACK_DEL,
- __ge_rotate_bg_delete_cb, bg_data);
-
- evas_object_data_set(base, GE_ROTATE_BG_DATA_KEY, bg_data);
- return base;
-}
-
-int _ge_rotate_bg_set_file(Evas_Object *bg, const char *file, int w, int h)
-{
- GE_CHECK_VAL(file, -1);
- GE_CHECK_VAL(bg, -1);
-
- ge_bg *bg_data = evas_object_data_get(bg, GE_ROTATE_BG_DATA_KEY);
- GE_CHECK_VAL(bg_data, -1);
-
- Evas_Object *image_obj = NULL;
- if (!bg_data->b_preload) {
- image_obj = evas_object_image_add(evas_object_evas_get(bg));
- evas_object_repeat_events_set(image_obj, EINA_TRUE);
- bg_data->img = image_obj;
- bg_data->file = strdup(file);
- elm_object_part_content_set(bg, "elm.swallow.image", image_obj);
- evas_object_image_load_size_set(image_obj, w, h);
- evas_object_image_file_set(image_obj, file, NULL);
- evas_object_image_preload(image_obj, EINA_TRUE);
- } else {
- image_obj = elm_image_add(bg);
- evas_object_repeat_events_set(image_obj, EINA_TRUE);
- bg_data->img = image_obj;
- bg_data->file = strdup(file);
- elm_object_part_content_set(bg, "elm.swallow.image", image_obj);
- elm_image_fill_outside_set(image_obj, EINA_TRUE);
- elm_image_file_set(image_obj, file, NULL);
- elm_image_preload_disabled_set(image_obj, EINA_FALSE);
- elm_image_smooth_set(image_obj, EINA_FALSE);
- }
- return 0;
-}
-
-int _ge_rotate_bg_rotate_image(Evas_Object *bg, unsigned int orient)
-{
- GE_CHECK_VAL(bg, -1);
-
- ge_bg *bg_data = evas_object_data_get(bg, GE_ROTATE_BG_DATA_KEY);
- GE_CHECK_VAL(bg_data, -1);
-
- if (bg_data->file && g_strcmp0(bg_data->file, GE_ICON_NO_THUMBNAIL) &&
- g_strcmp0(bg_data->file, GE_ICON_CONTENTS_BROKEN)) {
- __ge_rotate_bg_rotate_image(bg_data->img, orient);
- } else {
- __ge_rotate_bg_rotate_image(bg_data->img, GE_ORIENTATION_ROT_0);
- }
- if (!bg_data->b_preload) {
- __ge_rotate_bg_custom_resize(bg_data, NULL, NULL, NULL);
- }
- return 0;
-}
-
-int _ge_rotate_bg_add_image(Evas_Object *bg, int w, int h)
-{
- GE_CHECK_VAL(bg, -1);
-
- ge_bg *bg_data = evas_object_data_get(bg, GE_ROTATE_BG_DATA_KEY);
- GE_CHECK_VAL(bg_data, -1);
-
- Evas_Object *image_obj = NULL;
- if (!bg_data->b_preload) {
- image_obj = evas_object_image_add(evas_object_evas_get(bg));
- evas_object_repeat_events_set(image_obj, EINA_TRUE);
- bg_data->img = image_obj;
- elm_object_part_content_set(bg, "elm.swallow.image", image_obj);
- evas_object_image_load_size_set(image_obj, w, h);
- } else {
- image_obj = elm_image_add(bg);
- evas_object_repeat_events_set(image_obj, EINA_TRUE);
- bg_data->img = image_obj;
- elm_object_part_content_set(bg, "elm.swallow.image", image_obj);
- }
- return 0;
-}
-
-int _ge_rotate_bg_set_image_file(Evas_Object *bg, const char *file)
-{
- GE_CHECK_VAL(bg, -1);
-
- ge_bg *bg_data = evas_object_data_get(bg, GE_ROTATE_BG_DATA_KEY);
- GE_CHECK_VAL(bg_data, -1);
- GE_CHECK_VAL(bg_data->img, -1);
-
- if (!bg_data->b_preload) {
- evas_object_image_file_set(bg_data->img, file, NULL);
- evas_object_image_preload(bg_data->img, EINA_FALSE);
- __ge_rotate_bg_custom_resize(bg_data, NULL, NULL, NULL);
- } else {
- elm_image_fill_outside_set(bg_data->img, EINA_TRUE);
- elm_image_file_set(bg_data->img, file, NULL);
- elm_image_preload_disabled_set(bg_data->img, EINA_FALSE);
- elm_image_smooth_set(bg_data->img, EINA_FALSE);
- }
- return 0;
-}
-
-#endif
+++ /dev/null
-/*
-* Copyright (c) 2000-2015 Samsung Electronics Co., Ltd All Rights Reserved
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*
-*/
-
-#include "ge-debug.h"
-#include "ge-util.h"
-#include "ge-strings.h"
-#include "ge-icon.h"
-#include "ge-thumb.h"
-#include "ge-util.h"
-#ifdef _USE_ROTATE_BG_GE
-#include "ge-rotate-bg.h"
-#include "ge-exif.h"
-#endif
-
-#define GE_PHOTOFRAME_STYLE_VIDEO "default_layout_video"
-#define GE_PHOTOFRAME_STYLE_DEFAULT "default_layout"
-
-#define GE_CLASS_GENGRID "gengrid"
-#define GE_GRP_PHOTOFRAME "photoframe"
-#define GE_GRID_TEXT "elm.text"
-
-Evas_Object *_ge_thumb_show_part_icon_image(Evas_Object *obj, char *path,
- unsigned int orient, bool b_favor,
- int item_w, int item_h)
-{
- GE_CHECK_NULL(obj);
-
- Evas_Object *layout = elm_layout_add(obj);
- GE_CHECK_NULL(layout);
-
-#ifdef _USE_ROTATE_BG_GE
- Evas_Object *bg = _ge_rotate_bg_add(layout, true);
-#else
- Evas_Object *bg = elm_bg_add(layout);
-#endif
- if (bg == NULL) {
- evas_object_del(layout);
- return NULL;
- }
-
-#ifdef _USE_ROTATE_BG_GE
- _ge_rotate_bg_set_file(bg, path, item_w, item_h);
- _ge_rotate_bg_rotate_image(bg, orient);
-#else
- elm_bg_file_set(bg, path, NULL);
- elm_bg_load_size_set(bg, item_w, item_h);
- evas_object_size_hint_max_set(bg, item_w, item_h);
- evas_object_size_hint_aspect_set(bg, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1);
- evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
- evas_object_size_hint_align_set(bg, EVAS_HINT_FILL, EVAS_HINT_FILL);
-#endif
-
- elm_layout_theme_set(layout, GE_CLASS_GENGRID, GE_GRP_PHOTOFRAME,
- GE_PHOTOFRAME_STYLE_DEFAULT);
- elm_object_part_content_set(layout, "elm.swallow.icon", bg);
-
- evas_object_show(layout);
- return layout;
-}
-
-Evas_Object *_ge_thumb_show_part_icon_video(Evas_Object *obj, char *path,
- unsigned int v_dur, int bk_len,
- bool b_favor, int item_w, int item_h)
-{
- GE_CHECK_NULL(obj);
-
- Evas_Object *layout = elm_layout_add(obj);
- GE_CHECK_NULL(layout);
-
-#ifdef _USE_ROTATE_BG_GE
- Evas_Object *bg = _ge_rotate_bg_add(layout, true);
-#else
- Evas_Object *bg = elm_bg_add(layout);
-#endif
- if (bg == NULL) {
- evas_object_del(layout);
- return NULL;
- }
-
-#ifdef _USE_ROTATE_BG_GE
- _ge_rotate_bg_set_file(bg, path, item_w, item_h);
- _ge_rotate_bg_rotate_image(bg, GE_ORIENTATION_ROT_0);
-#else
- elm_bg_file_set(bg, path, NULL);
- elm_bg_load_size_set(bg, item_w, item_h);
- evas_object_size_hint_max_set(bg, item_w, item_h);
- evas_object_size_hint_aspect_set(bg, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1);
- evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
- evas_object_size_hint_align_set(bg, EVAS_HINT_FILL, EVAS_HINT_FILL);
-#endif
-
- elm_layout_theme_set(layout, GE_CLASS_GENGRID, GE_GRP_PHOTOFRAME,
- GE_PHOTOFRAME_STYLE_VIDEO);
- elm_object_part_content_set(layout, "elm.swallow.icon", bg);
-
- if (bk_len) {
- Evas_Object *icon = elm_icon_add(layout);
- GE_ICON_SET_FILE(icon, GE_THUMB_BOOKMARK);
- evas_object_show(icon);
- elm_object_part_content_set(layout, "elm.swallow.bookmarkicon",
- icon);
- }
-
- char *dur_str = _ge_get_duration_string(v_dur);
- GE_CHECK_NULL(dur_str);
- elm_object_part_text_set(layout, GE_GRID_TEXT, dur_str);
- GE_FREE(dur_str);
-
- evas_object_show(layout);
- return layout;
-}
-
-/* Size of thumbnails in gridview */
-#define GE_GRID_ITEM_SIZE_W_ZOOM_03 240
-#define GE_GRID_ITEM_SIZE_H_ZOOM_03_HIDE 178
-/* Indicator show, only show 5 items per column, plus 23 pixels */
-#define GE_GRID_ITEM_SIZE_H_ZOOM_03 (178+23)
-
-#define GE_GRID_ITEM_SIZE_W_ZOOM_02 360
-#define GE_GRID_ITEM_SIZE_H_ZOOM_02_HIDE 267
-/* Indicator show, minus 15 pixels */
-#define GE_GRID_ITEM_SIZE_H_ZOOM_02 (267-15)
-
-#define GE_GRID_ITEM_SIZE_L_W GE_GRID_ITEM_SIZE_W_ZOOM_02
-#define GE_GRID_ITEM_SIZE_L_H_HIDE GE_GRID_ITEM_SIZE_H_ZOOM_02_HIDE
-#define GE_GRID_ITEM_SIZE_L_H GE_GRID_ITEM_SIZE_H_ZOOM_02
-
-#define GE_GRID_4_PER_ROW 4
-#define GE_GRID_3_PER_ROW 3
-#define GE_GRID_2_PER_ROW 2
-
-#define GE_GRID_ITEM_L_CNT 6
-#define GE_GRID_ITEM_S_CNT 5
-#define GE_GRID_ITEM_ZOOM_02_CNT 8
-#define GE_GRID_ITEM_ZOOM_03_CNT_HIDE 18
-#define GE_GRID_ITEM_ZOOM_03_CNT 15
-
-#ifdef _USE_SCROL_HORIZONRAL
-/* Change icon size and gengrid alignment */
-int _ge_thumb_set_size(ge_ugdata *ugd, Evas_Object *view, int rotate_mode,
- int *size_w, int *size_h)
-{
- GE_CHECK_VAL(view, -1);
- GE_CHECK_VAL(ugd, -1);
- int win_w = 0;
- int win_h = 0;
- double scale = _ge_get_win_factor(ugd->win, ugd->b_hide_indicator,
- &win_w, &win_h);
- int _w = 0;
- int _h = 0;
- int _w_l = 0;
- int _h_l = 0;
- int align_c = 0;
- double align_x = 0.0f;
- double align_y = 0.0f;
- int count = elm_gengrid_items_count(view);
- elm_gengrid_align_get(view, &align_x, &align_y);
- ge_dbg("rotate_mode: %d, count: %d", rotate_mode, count);
-
- _w_l = (int)(GE_GRID_ITEM_SIZE_L_W * scale);
- if (ugd->b_hide_indicator) {
- _h_l = (int)(GE_GRID_ITEM_SIZE_L_H_HIDE * scale);
- } else {
- _h_l = (int)(GE_GRID_ITEM_SIZE_L_H * scale);
- }
-
- if (count <= GE_GRID_ITEM_ZOOM_LEVEL_02_CNT) {
- _w = (int)(win_w / GE_GRID_2_PER_ROW);
- if (ugd->b_hide_indicator) {
- _h = (int)(GE_GRID_ITEM_SIZE_H_ZOOM_02_HIDE * scale);
- } else {
- _h = (int)(GE_GRID_ITEM_SIZE_H_ZOOM_02 * scale);
- }
- align_c = GE_GRID_ITEM_ZOOM_02_CNT;
- } else {
- _w = (int)(win_w / GE_GRID_3_PER_ROW);
- if (ugd->b_hide_indicator) {
- _h = (int)(GE_GRID_ITEM_SIZE_H_ZOOM_03_HIDE * scale);
- align_c = GE_GRID_ITEM_ZOOM_03_CNT_HIDE;
- } else {
- _h = (int)(GE_GRID_ITEM_SIZE_H_ZOOM_03 * scale);
- align_c = GE_GRID_ITEM_ZOOM_03_CNT;
- }
- }
-
- if ((rotate_mode == GE_ROTATE_LANDSCAPE) ||
- (rotate_mode == GE_ROTATE_LANDSCAPE_UPSIDEDOWN)) {
- align_c = GE_GRID_ITEM_L_CNT;
- elm_gengrid_item_size_set(view, _w_l, _h_l);
- if (size_w) {
- *size_w = _w_l - 4;
- }
- if (size_h) {
- *size_h = _h_l - 4;
- }
- } else {
- elm_gengrid_item_size_set(view, _w, _h);
- if (size_w) {
- *size_w = _w - 4;
- }
- if (size_h) {
- *size_h = _h - 4;
- }
- }
- elm_gengrid_align_set(view, 0.0, 0.0);
- if (size_w && size_h)
- ge_dbg("P: %dx%d, size_w: %d,size_h: %d", _w, _h, *size_w,
- *size_h);
- return 0;
-}
-#else
-/* Change icon size and gengrid alignment */
-int _ge_thumb_set_size(ge_ugdata *ugd, Evas_Object *view, int rotate_mode,
- int *size_w, int *size_h)
-{
- GE_CHECK_VAL(view, -1);
- GE_CHECK_VAL(ugd, -1);
- int win_w = 0;
- int win_h = 0;
- double scale = _ge_get_win_factor(ugd->win, ugd->b_hide_indicator,
- &win_w, &win_h);
- int _w = 0;
- int _h = 0;
- int _w_l = 0;
- int _h_l = 0;
- double align_x = 0.0f;
- double align_y = 0.0f;
- int count = elm_gengrid_items_count(view);
- elm_gengrid_align_get(view, &align_x, &align_y);
- ge_dbg("rotate_mode: %d, count: %d", rotate_mode, count);
-
- _w = (int)(win_w / GE_GRID_3_PER_ROW);
- _h = (int)(GE_GRID_ITEM_SIZE_H_ZOOM_02 * scale);
- _w_l = (int)(win_h / GE_GRID_ITEM_S_CNT);
- _h_l = (int)(356 * scale);
-
- if ((rotate_mode == GE_ROTATE_LANDSCAPE) ||
- (rotate_mode == GE_ROTATE_LANDSCAPE_UPSIDEDOWN)) {
- _h_l = _w_l;
- elm_gengrid_item_size_set(view, _w_l, _h_l);
- if (size_w) {
- *size_w = _w_l - 4;
- }
- if (size_h) {
- *size_h = _h_l - 4;
- }
- } else {
- _h = _w;
- elm_gengrid_item_size_set(view, _w, _h);
- if (size_w) {
- *size_w = _w - 4;
- }
- if (size_h) {
- *size_h = _h - 4;
- }
- }
- /*if (count <= align_c)
- elm_gengrid_align_set(view, 0.5, 0.5);
- else*/
- elm_gengrid_align_set(view, 0.0, 0.0);
- if (size_w && size_h)
- ge_dbg("P: %dx%d, size_w: %d,size_h: %d", _w, _h, *size_w,
- *size_h);
- return 0;
-}
-#endif
-Evas_Object *_ge_thumb_show_mode(Evas_Object *obj, ge_cm_mode_e mode)
-{
- Evas_Object *icon = NULL;
- const char *file = NULL;
-
- switch (mode) {
- case GE_CM_MODE_PANORAMA:
- file = GE_ICON_PANORAMA;
- break;
- case GE_CM_MODE_SOUND:
- file = GE_ICON_SOUND_SHOT;
- break;
- case GE_CM_MODE_ANIMATE:
- file = GE_ALBUM_ICON_FOLDER;
- break;
- case GE_CM_MODE_BEST:
- file = GE_ALBUM_ICON_DOWNLOAD;
- break;
- default:
- break;
- }
-
- if (file) {
- GE_CHECK_NULL(obj);
- icon = elm_icon_add(obj);
- GE_CHECK_NULL(icon);
- GE_ICON_SET_FILE(icon, file);
- evas_object_show(icon);
- }
- return icon;
-}
-
+++ /dev/null
-/*
-* Copyright (c) 2000-2015 Samsung Electronics Co., Ltd All Rights Reserved
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*
-*/
-
-#include "ge-debug.h"
-#include "ge-tile.h"
-#include "ge-button.h"
-#include "ge-icon.h"
-#include "ge-util.h"
-#ifdef _USE_ROTATE_BG_GE
-#include "ge-rotate-bg.h"
-#endif
-
-/* Width and height of album item (4+331, 4+331) */
-#define GE_TILE_ITEM_WIDTH 360
-#define GE_TILE_ITEM_HEIGHT_HIDE 354
-/* Indicator show, minus 20 pixels */
-#define GE_TILE_ITEM_HEIGHT (354-20)
-#define GE_TILE_ITEM_L_H 426
-#define GE_TILE_2_PER_ROW 2
-#define GE_TILE_3_PER_ROW 3
-#define GE_TILE_ITEM_CNT 6
-#define GE_TILE_ITEM_L_CNT 3
-/* Items count of each column */
-#define GE_TILE_ITEM_C_CNT 3
-/* Size of album icon */
-#define GE_TILE_W (GE_TILE_ITEM_WIDTH-8)
-#define GE_TILE_H (GE_TILE_ITEM_HEIGHT_HIDE-8)
-
-Evas_Object *__ge_tile_add_icon(Evas_Object *obj, bg_file_set_cb func, void *data)
-{
- GE_CHECK_NULL(func);
- GE_CHECK_NULL(obj);
- Evas_Object *bg = NULL;
-
-#ifdef _USE_ROTATE_BG_GE
- bg = _ge_rotate_bg_add(obj, true);
-#else
- bg = elm_bg_add(obj);
-#endif
- GE_CHECK_NULL(bg);
- double scale = elm_config_scale_get();
-
- if (data) {
- int wid = 0;
- int hei = 0;
-
- wid = (int)(GE_TILE_W * scale);
- hei = (int)(GE_TILE_H * scale);
-
-#ifdef _USE_ROTATE_BG_GE
- _ge_rotate_bg_add_image(bg, wid, hei);
-#else
- elm_bg_load_size_set(bg, wid, hei);
-#endif
-
- func(bg, data);
- }
-
- evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
- evas_object_size_hint_align_set(bg, 0.5, 0.5);
- evas_object_show(bg);
-
- return bg;
-}
-
-Evas_Object *_ge_tile_show_part_icon(Evas_Object *obj, const char *part,
- int length, bg_file_set_cb func,
- void *data)
-{
- GE_CHECK_NULL(part);
- GE_CHECK_NULL(strlen(part));
- GE_CHECK_NULL(obj);
- ge_dbg("part is %s", part);
-
- if (!g_strcmp0(part, GE_TILE_ICON)) {
- Evas_Object *bg = NULL;
- bg = __ge_tile_add_icon(obj, func, data);
- return bg;
- }
- return NULL;
-}
-
-Evas_Object *_ge_tile_show_part_type_icon(Evas_Object *obj, int type)
-{
- GE_CHECK_NULL(obj);
- Evas_Object *icon = elm_icon_add(obj);
- GE_CHECK_NULL(icon);
-
- switch (type) {
- case GE_TILE_TYPE_CAMERA:
- GE_ICON_SET_FILE(icon, GE_ALBUM_ICON_CAMERA);
- break;
- case GE_TILE_TYPE_DOWNLOAD:
- GE_ICON_SET_FILE(icon, GE_ALBUM_ICON_DOWNLOAD);
- break;
- case GE_TILE_TYPE_FOLDER:
- GE_ICON_SET_FILE(icon, GE_ALBUM_ICON_FOLDER);
- break;
- default:
- ge_dbgE("Unknow type[%d]!", type);
- }
-
- evas_object_show(icon);
- return icon;
-}
-
-#ifdef _USE_SCROL_HORIZONRAL
-/* Change icon size and gengrid alignment */
-int _ge_tile_update_item_size(ge_ugdata *ugd, Evas_Object *grid,
- int rotate_mode, bool b_update)
-{
- GE_CHECK_VAL(grid, -1);
- GE_CHECK_VAL(ugd, -1);
- int win_w = 0;
- int win_h = 0;
- double scale = _ge_get_win_factor(ugd->win, ugd->b_hide_indicator,
- &win_w, &win_h);
- int w = 0;
- int h = 0;
- int c = 0;
- int w_l = 0;
- int h_l = 0;
- int c_l = 0;
- ge_dbg("rotate_mode: %d, b_update: %d", rotate_mode, b_update);
-
- ge_dbg("scale: %f", scale);
- w = (int)(win_w / GE_TILE_2_PER_ROW);
- if (ugd->b_hide_indicator) {
- h = (int)(GE_TILE_ITEM_HEIGHT_HIDE * scale);
- } else {
- h = (int)(GE_TILE_ITEM_HEIGHT * scale);
- }
- w_l = (int)(win_h / GE_TILE_3_PER_ROW);
- h_l = (int)(GE_TILE_ITEM_L_H * scale);
- c = GE_TILE_ITEM_CNT;
- c_l = GE_TILE_ITEM_L_CNT;
- ge_dbg("Size: %dx%d L %dx%d C %dx%d", w, h, w_l, h_l, c, c_l);
-
- double align_x = 0.0f;
- double align_y = 0.0f;
- unsigned int count = 0;
- count = elm_gengrid_items_count(grid);
- elm_gengrid_align_get(grid, &align_x, &align_y);
- ge_dbg("count: %d, align_x: %f, align_y: %f", count, align_x, align_y);
-
- elm_gengrid_align_set(grid, 0.0, 0.0);
- if ((rotate_mode == GE_ROTATE_LANDSCAPE) ||
- (rotate_mode == GE_ROTATE_LANDSCAPE_UPSIDEDOWN)) {
- elm_gengrid_item_size_set(grid, w_l, h_l);
- } else {
- elm_gengrid_item_size_set(grid, w, h);
- }
-
- if (b_update) {
- elm_gengrid_realized_items_update(grid);
- }
- return 0;
-}
-#else
-/* Change icon size and gengrid alignment */
-int _ge_tile_update_item_size(ge_ugdata *ugd, Evas_Object *grid,
- int rotate_mode, bool b_update)
-{
- GE_CHECK_VAL(grid, -1);
- GE_CHECK_VAL(ugd, -1);
- int win_w = 0;
- int win_h = 0;
- double scale = _ge_get_win_factor(ugd->win, ugd->b_hide_indicator,
- &win_w, &win_h);
- int w = 0;
- int h = 0;
- int c = 0;
- int w_l = 0;
- int h_l = 0;
- int c_l = 0;
- ge_dbg("rotate_mode: %d, b_update: %d", rotate_mode, b_update);
-
- ge_dbg("scale: %f", scale);
- w = (int)(win_w / GE_TILE_2_PER_ROW);
- h = (int)(300 * scale);
- w_l = (int)(win_h / GE_TILE_3_PER_ROW);
- h_l = w_l;
- h = w;
- c = GE_TILE_ITEM_CNT;
- c_l = GE_TILE_ITEM_L_CNT;
- ge_dbg("P %dx%d L %dx%d C %dx%d", w, h, w_l, h_l, c, c_l);
-
- double align_x = 0.0f;
- double align_y = 0.0f;
- unsigned int count = 0;
- count = elm_gengrid_items_count(grid);
- elm_gengrid_align_get(grid, &align_x, &align_y);
- ge_dbg("count: %d, align_x: %f, align_y: %f", count, align_x, align_y);
-
- elm_gengrid_align_set(grid, 0.0, 0.0);
- if ((rotate_mode == GE_ROTATE_LANDSCAPE) ||
- (rotate_mode == GE_ROTATE_LANDSCAPE_UPSIDEDOWN)) {
- elm_gengrid_item_size_set(grid, w_l, h_l);
- } else {
- elm_gengrid_item_size_set(grid, w, h);
- }
-
- if (b_update) {
- elm_gengrid_realized_items_update(grid);
- }
- return 0;
-}
-#endif
-