From: Jiansong Jin Date: Tue, 4 Sep 2012 08:08:14 +0000 (+0900) Subject: Refine codes about button creation X-Git-Tag: 2.0_alpha~4 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1d2a1754e442d02e65e7e0caf1ef9ee04f61aaed;p=apps%2Fcore%2Fpreloaded%2Fgallery.git Refine codes about button creation Change-Id: Ib0109c27aa16875cfbd87a1cbc0799b3062f759f --- diff --git a/ug/ug-gallery-efl/include/gallery-efl.h b/ug/ug-gallery-efl/include/gallery-efl.h index 06c7b6b..605e35d 100755 --- a/ug/ug-gallery-efl/include/gallery-efl.h +++ b/ug/ug-gallery-efl/include/gallery-efl.h @@ -112,22 +112,22 @@ extern "C" { #define GE_BUNDLE_HOMESCREEN_PATH "homescreen-path" #define GE_BUNDLE_LOCKSCREEN_PATH "lockscreen-path" -#define GE_ALBUM_SELECT_ONE "select-album" +#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_FILE_SELECT_ONE "select-one" -#define GE_FILE_SELECT_MULTIPLE "select-multiple" -#define GE_FILE_SELECT_SETAS "select-setas" -#define GE_FILE_SELECT_IMFT "select-imft" +#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_SELECT_TYPE_IMAGE "image" -#define GE_FILE_SELECT_TYPE_VIDEO "video" -#define GE_FILE_SELECT_TYPE_ALL "all" +#define GE_FILE_TYPE_IMAGE "image" +#define GE_FILE_TYPE_VIDEO "video" +#define GE_FILE_TYPE_ALL "all" -#define GE_FILE_SELECT_SETAS_WALLPALER "wallpaper" -#define GE_FILE_SELECT_SETAS_CROP_WALLPALER "crop-wallpaper" -#define GE_FILE_SELECT_SETAS_CALLERID "callerid" +#define GE_SETAS_WALLPAPER "wallpaper" +#define GE_SETAS_CROP_WALLPAPER "crop-wallpaper" +#define GE_SETAS_CALLERID "callerid" #define GE_FILE_SELECT_RETURN_COUNT "count" #define GE_FILE_SELECT_RETURN_PATH "path" @@ -151,36 +151,35 @@ extern "C" { /*Image viewer UG service parameters-End*/ typedef enum { - GE_Album_Select_None, - GE_Album_Select_One, -} ge_album_select; + GE_ALBUM_SELECT_T_NONE, + GE_ALBUM_SELECT_T_ONE, +} ge_album_select_e; typedef enum { - GE_File_Select_None, - GE_File_Select_One, - GE_File_Select_Multiple, - GE_File_Select_Setas, -} ge_file_select; + GE_FILE_SELECT_T_NONE, + GE_FILE_SELECT_T_ONE, + GE_FILE_SELECT_T_MULTIPLE, + GE_FILE_SELECT_T_SETAS, +} ge_file_select_e; typedef enum { - GE_File_Select_Setas_None, - GE_File_Select_Setas_Wallpaper, - GE_FILE_SELECT_SETAS_MODE_CROP_WALLPAPER, - GE_File_Select_Setas_CallerID, -} ge_file_select_setas; + GE_SETAS_T_NONE, + GE_SETAS_T_WALLPAPER, + GE_SETAS_T_CROP_WALLPAPER, + GE_SETAS_T_CALLERID, +} ge_file_select_setas_e; typedef enum { - GE_File_Select_Type_None, - GE_File_Select_Type_Image, - GE_File_Select_Type_Video, - GE_File_Select_Type_All, -} ge_file_type; - -typedef enum view_by_mode_e -{ - GE_AlbumsView_Mode, - GE_ThumbnailView_Mode, - GE_ThumbnailEdit_Mode, + 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_THUMBS, + GE_VIEW_THUMBS_EDIT, } ge_view_mode; typedef enum { diff --git a/ug/ug-gallery-efl/include/ge-button.h b/ug/ug-gallery-efl/include/ge-button.h index 5cdce15..b933a65 100755 --- a/ug/ug-gallery-efl/include/ge-button.h +++ b/ug/ug-gallery-efl/include/ge-button.h @@ -19,14 +19,13 @@ #include "gallery-efl.h" -typedef enum _ge_but_mode { - GE_BUT_CANCEL, - GE_BUT_OK, - GE_BUT_DONE, -} ge_but_mode; +/**< Evas smart objects' "smart callback" function signature */ +typedef void (*But_Smart_Cb) (void *data, Evas_Object *obj, void *event_info); -typedef void (*But_Smart_Cb) (void *data, Evas_Object *obj, void *event_info); /**< Evas smart objects' "smart callback" function signature */ - -Evas_Object *_ge_but_create_but(Evas_Object *parent, ge_but_mode mode, But_Smart_Cb cb_func, const void *data); +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); #endif /* _GE_BUTTON_H_ */ + diff --git a/ug/ug-gallery-efl/include/ge-data-type.h b/ug/ug-gallery-efl/include/ge-data-type.h index 48816df..11850bc 100755 --- a/ug/ug-gallery-efl/include/ge-data-type.h +++ b/ug/ug-gallery-efl/include/ge-data-type.h @@ -18,13 +18,13 @@ #define _GE_TYPE_H_ #include +#include #include #include #include #include #include #include -#include #define FREE_DATA(ptr) \ do { \ diff --git a/ug/ug-gallery-efl/include/ge-exif.h b/ug/ug-gallery-efl/include/ge-exif.h index 060470d..0fea711 100755 --- a/ug/ug-gallery-efl/include/ge-exif.h +++ b/ug/ug-gallery-efl/include/ge-exif.h @@ -1,27 +1,18 @@ /* - * ug-gallery-efl + * Copyright 2012 Samsung Electronics Co., Ltd * - * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: Sangjin Han , - * Jiansong Jin , - * Jonghyuk Lee , - * Chaolong Lin , - * Yongjun Zhao - * - * Licensed under the Apache License, Version 2.0 (the "License"); + * Licensed under the Flora License, Version 1.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 + * http://www.tizenopensource.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. - * - */ + */ #ifdef _USE_ROTATE_BG_GE diff --git a/ug/ug-gallery-efl/include/ge-rotate-bg.h b/ug/ug-gallery-efl/include/ge-rotate-bg.h index 5ab0592..f3f33e8 100755 --- a/ug/ug-gallery-efl/include/ge-rotate-bg.h +++ b/ug/ug-gallery-efl/include/ge-rotate-bg.h @@ -1,27 +1,18 @@ /* - * ug-gallery-efl + * Copyright 2012 Samsung Electronics Co., Ltd * - * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: Sangjin Han , - * Jiansong Jin , - * Jonghyuk Lee , - * Chaolong Lin , - * Yongjun Zhao - * - * Licensed under the Apache License, Version 2.0 (the "License"); + * Licensed under the Flora License, Version 1.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 + * http://www.tizenopensource.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. - * - */ + */ #ifdef _USE_ROTATE_BG_GE diff --git a/ug/ug-gallery-efl/include/ge-strings.h b/ug/ug-gallery-efl/include/ge-strings.h index 1533b17..49658a5 100755 --- a/ug/ug-gallery-efl/include/ge-strings.h +++ b/ug/ug-gallery-efl/include/ge-strings.h @@ -45,6 +45,8 @@ extern "C" { #define GE_LABEL_NO_VIDEOS _GE_GETSYSTEMSTR("IDS_COM_BODY_NO_VIDEOS") #define GE_SELINFO_SELECTED _GE_GETSYSTEMSTR("IDS_COM_POP_SELECTED") #define GE_POPUP_NO_FILES_SELECTED _GE_GETSYSTEMSTR("IDS_COM_POP_NO_FILES_SELECTED") +#define GE_STR_OK _GE_GETSYSTEMSTR("IDS_COM_SK_OK") +#define GE_STR_CANCEL _GE_GETSYSTEMSTR("IDS_COM_SK_CANCEL") #ifdef _cplusplus } diff --git a/ug/ug-gallery-efl/include/ge-thumb.h b/ug/ug-gallery-efl/include/ge-thumb.h index 06d498c..65f6483 100755 --- a/ug/ug-gallery-efl/include/ge-thumb.h +++ b/ug/ug-gallery-efl/include/ge-thumb.h @@ -1,27 +1,18 @@ /* - * ug-gallery-efl + * Copyright 2012 Samsung Electronics Co., Ltd * - * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: Sangjin Han , - * Jiansong Jin , - * Jonghyuk Lee , - * Chaolong Lin , - * Yongjun Zhao - * - * Licensed under the Apache License, Version 2.0 (the "License"); + * Licensed under the Flora License, Version 1.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 + * http://www.tizenopensource.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_THUMB_H_ #define _GE_THUMB_H_ diff --git a/ug/ug-gallery-efl/include/ge-tile.h b/ug/ug-gallery-efl/include/ge-tile.h index 1c2ebe6..04668fb 100755 --- a/ug/ug-gallery-efl/include/ge-tile.h +++ b/ug/ug-gallery-efl/include/ge-tile.h @@ -1,27 +1,18 @@ /* - * ug-gallery-efl + * Copyright 2012 Samsung Electronics Co., Ltd * - * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: Sangjin Han , - * Jiansong Jin , - * Jonghyuk Lee , - * Chaolong Lin , - * Yongjun Zhao - * - * Licensed under the Apache License, Version 2.0 (the "License"); + * Licensed under the Flora License, Version 1.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 + * http://www.tizenopensource.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_TILE_H_ #define _GE_TILE_H_ @@ -84,3 +75,4 @@ Evas_Object *_ge_tile_show_part_label(Evas_Object *obj, int index, bool b_default); #endif + diff --git a/ug/ug-gallery-efl/include/ge-ui-util.h b/ug/ug-gallery-efl/include/ge-ui-util.h index 34ce69e..cee29f6 100755 --- a/ug/ug-gallery-efl/include/ge-ui-util.h +++ b/ug/ug-gallery-efl/include/ge-ui-util.h @@ -25,33 +25,33 @@ extern "C" { #define _EDJ(o) elm_layout_edje_get(o) -#define _GETICON(_path) \ +#define _GE_GET_ICON(_path) \ ((1 == ecore_file_exists(_path) && (ecore_file_size(_path) > 0)) ? _path : GE_DEFAULT_THUMB_ICON) typedef enum { - AlbumsView_Title, - ThumbnailView_Title, -}NaviTitleMode; + GE_NAVI_ALBUMS, + GE_NAVI_THUMBS, +} ge_navi_mode_e; typedef enum { - GE_Popup_NoButton, - GE_Popup_OneButton, - GE_Popup_TwoButton, - GE_Popup_UgExit, -}GE_PopupMode; + GE_POPUP_NOBUT, + GE_POPUP_ONEBUT, + GE_POPUP_TWOBUT, +} ge_popup_mode_e; int ge_ui_cancel_album_lock(ge_ugdata *ugd); int ge_ui_set_album_lock(ge_cluster* album); Evas_Object* ge_ui_create_navibar(ge_ugdata* ugd, Evas_Object* parent); Evas_Object* ge_ui_create_main_ly(ge_ugdata* ugd, Evas_Object* parent); int ge_ui_create_title_and_push(ge_ugdata *ugd, Evas_Object* parent, - Evas_Object* obj, NaviTitleMode mode, + Evas_Object* obj, ge_navi_mode_e mode, char* title); void ge_ui_set_rotate_angle(int rotate_mode); 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_PopupMode mode, char* desc); +Evas_Object* ge_ui_create_popup(ge_ugdata* ugd, ge_popup_mode_e mode, + char* desc); int ge_ui_create_selinfo(ge_ugdata* ugd, Evas_Object* parent); int ge_ui_destroy_selinfo(ge_ugdata* ugd); int ge_ui_rotate_selinfo(ge_ugdata* ugd); diff --git a/ug/ug-gallery-efl/src/gallery-efl.c b/ug/ug-gallery-efl/src/gallery-efl.c index f5fbcc5..2bd16fe 100755 --- a/ug/ug-gallery-efl/src/gallery-efl.c +++ b/ug/ug-gallery-efl/src/gallery-efl.c @@ -29,7 +29,7 @@ #include "ge-ext-ug-load.h" #include "ge-strings.h" -static ge_view_mode g_view_mode = GE_AlbumsView_Mode; +static ge_view_mode g_view_mode = GE_VIEW_ALBUMS; #define GE_BG_COLOR_DEFAULT 255 #define GE_BG_ALPHA_DEFAULT 255 @@ -76,7 +76,7 @@ static int _ge_create_ly_view(ge_ugdata *ugd) ugd->albums_view); ge_ui_create_title_and_push(ugd, ugd->navi_bar, ugd->albums_view_ly, - AlbumsView_Title, ugd->albums_view_title); + GE_NAVI_ALBUMS, ugd->albums_view_title); return 0; } @@ -226,8 +226,8 @@ static int __ge_parse_param_launch_type_setas(ge_ugdata *ugd, service_h service) return -1; } - if (!strcasecmp(setas_type, GE_FILE_SELECT_SETAS_WALLPALER)) { - ugd->file_select_setas_mode = GE_File_Select_Setas_Wallpaper; + if (!strcasecmp(setas_type, GE_SETAS_WALLPAPER)) { + ugd->file_select_setas_mode = GE_SETAS_T_WALLPAPER; g_strlcpy(ugd->albums_view_title, GE_TITLE_CHANGE_WALLPAPER, GE_ALBUM_NAME_LEN_MAX); @@ -244,12 +244,12 @@ static int __ge_parse_param_launch_type_setas(ge_ugdata *ugd, service_h service) ge_dbg("path:%s", lockscreen_path); ugd->file_setas_lockscreen_path = lockscreen_path; } - } else if (!strcasecmp(setas_type, GE_FILE_SELECT_SETAS_CROP_WALLPALER)) { - ugd->file_select_setas_mode = GE_FILE_SELECT_SETAS_MODE_CROP_WALLPAPER; + } else if (!strcasecmp(setas_type, GE_SETAS_CROP_WALLPAPER)) { + ugd->file_select_setas_mode = GE_SETAS_T_CROP_WALLPAPER; g_strlcpy(ugd->albums_view_title, GE_TITLE_CHANGE_WALLPAPER, GE_ALBUM_NAME_LEN_MAX); - } else if (!strcasecmp(setas_type, GE_FILE_SELECT_SETAS_CALLERID)) { - ugd->file_select_setas_mode = GE_File_Select_Setas_CallerID; + } else if (!strcasecmp(setas_type, GE_SETAS_CALLERID)) { + ugd->file_select_setas_mode = GE_SETAS_T_CALLERID; g_strlcpy(ugd->albums_view_title, GE_TITLE_CHANGE_CALLER_ID, GE_ALBUM_NAME_LEN_MAX); @@ -281,7 +281,7 @@ static int __ge_parse_param_file_type(ge_ugdata *ugd, service_h service) char file_type_str[GE_ALBUM_NAME_LEN_MAX] = {0,}; bool b_singular = true; - if(ugd->file_select_mode == GE_File_Select_Multiple) + if(ugd->file_select_mode == GE_FILE_SELECT_T_MULTIPLE) b_singular = false; /* file-type */ @@ -292,8 +292,8 @@ static int __ge_parse_param_file_type(ge_ugdata *ugd, service_h service) } ge_dbg("file_type: %s", file_type); - if (!strcasecmp(file_type, GE_FILE_SELECT_TYPE_IMAGE)) { - ugd->file_type_mode = GE_File_Select_Type_Image; + if (!strcasecmp(file_type, GE_FILE_TYPE_IMAGE)) { + ugd->file_type_mode = GE_FILE_T_IMAGE; if(b_singular) { g_strlcat(ugd->albums_view_title, GE_TITLE_IMAGE, sizeof(ugd->albums_view_title)); @@ -304,8 +304,8 @@ static int __ge_parse_param_file_type(ge_ugdata *ugd, service_h service) GE_FREE_MEM(file_type); return 0; - } else if (!strcasecmp(file_type, GE_FILE_SELECT_TYPE_VIDEO)) { - ugd->file_type_mode = GE_File_Select_Type_Video; + } else if (!strcasecmp(file_type, GE_FILE_TYPE_VIDEO)) { + ugd->file_type_mode = GE_FILE_T_VIDEO; if(b_singular) { g_strlcat(ugd->albums_view_title, GE_TITLE_VIDEO, sizeof(ugd->albums_view_title)); @@ -322,7 +322,7 @@ static int __ge_parse_param_file_type(ge_ugdata *ugd, service_h service) GE_DEFAULT_FILE_TYPE: ge_dbg("file type is default, set default type(ALL)."); - ugd->file_type_mode = GE_File_Select_Type_All; + ugd->file_type_mode = GE_FILE_T_ALL; if(b_singular) { g_strlcpy(file_type_str, GE_TITLE_FILE, sizeof(file_type_str)); } else { @@ -349,24 +349,24 @@ static int _ge_parse_param(ge_ugdata *ugd, service_h service) } ge_dbg("launch-type [%s]", launch_type); - if(!strcasecmp(launch_type, GE_ALBUM_SELECT_ONE)) { - ugd->album_select_mode = GE_Album_Select_One; + if(!strcasecmp(launch_type, GE_LAUNCH_SELECT_ALBUM)) { + ugd->album_select_mode = GE_ALBUM_SELECT_T_ONE; g_strlcpy(ugd->albums_view_title, GE_TITLE_ALBUMS, GE_ALBUM_NAME_LEN_MAX); - } else if (!strcasecmp(launch_type, GE_FILE_SELECT_SETAS)) { - ugd->file_select_mode = GE_File_Select_Setas; + } else if (!strcasecmp(launch_type, GE_LAUNCH_SELECT_SETAS)) { + ugd->file_select_mode = GE_FILE_SELECT_T_SETAS; __ge_parse_param_launch_type_setas(ugd, service); /* Checkme: Only image type is offered in SETAS case */ - ugd->file_type_mode = GE_File_Select_Type_Image; + ugd->file_type_mode = GE_FILE_T_IMAGE; } else { g_strlcpy(ugd->albums_view_title, GE_TITLE_ADD, GE_ALBUM_NAME_LEN_MAX); g_strlcat(ugd->albums_view_title, " ", GE_ALBUM_NAME_LEN_MAX); - if (!strcasecmp(launch_type, GE_FILE_SELECT_ONE)) - ugd->file_select_mode = GE_File_Select_One; - else if (!strcasecmp(launch_type, GE_FILE_SELECT_MULTIPLE)) - ugd->file_select_mode = GE_File_Select_Multiple; + 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; else ge_dbgE("Wrong launch type!"); @@ -409,7 +409,7 @@ static void * _ge_create(ui_gadget_h ug, enum ug_mode mode, service_h service, v /* Reset inited flag, it would be set as TRUE if albums view created */ ugd->b_inited_view = false; /* Set view mode */ - _ge_set_view_mode(GE_AlbumsView_Mode); + _ge_set_view_mode(GE_VIEW_ALBUMS); Ecore_X_Window x_win = ecore_x_window_focus_get(); GE_CHECK_NULL(x_win); @@ -425,9 +425,9 @@ static void * _ge_create(ui_gadget_h ug, enum ug_mode mode, service_h service, v return NULL; } - if ((ugd->file_select_mode == GE_File_Select_Setas) || - (ugd->file_select_mode != GE_File_Select_None) || - (ugd->album_select_mode != GE_Album_Select_None)) { + if ((ugd->file_select_mode == GE_FILE_SELECT_T_SETAS) || + (ugd->file_select_mode != GE_FILE_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!"); @@ -576,12 +576,10 @@ UG_ROTATE_EVENT: ge_ui_set_rotate_angle(rotate_mode); - if((ugd->file_select_mode == GE_File_Select_Multiple) && - (_ge_get_view_mode() == GE_ThumbnailEdit_Mode)) - { + if((ugd->file_select_mode == GE_FILE_SELECT_T_MULTIPLE) && + (_ge_get_view_mode() == GE_VIEW_THUMBS_EDIT)) ge_ui_rotate_selinfo(ugd); } -} static void _ge_key_event(ui_gadget_h ug, enum ug_key_event event, service_h service, void *priv) { diff --git a/ug/ug-gallery-efl/src/ge-albums.c b/ug/ug-gallery-efl/src/ge-albums.c index af5f01c..8ad4c08 100755 --- a/ug/ug-gallery-efl/src/ge-albums.c +++ b/ug/ug-gallery-efl/src/ge-albums.c @@ -267,7 +267,7 @@ static ge_icon_type __ge_albums_set_bg_file(Evas_Object *bg, void *data) } ret_val= GE_ICON_NORMAL; - bg_path = _GETICON(git->item->thumb_url); + bg_path = _GE_GET_ICON(git->item->thumb_url); GE_ALBUMS_FAILED: @@ -423,7 +423,7 @@ int ge_albums_back_to_view(ge_ugdata *ugd) ge_dbg(""); GE_CHECK_VAL(ugd, -1); - if(ugd->file_select_mode == GE_File_Select_Multiple) + if(ugd->file_select_mode == GE_FILE_SELECT_T_MULTIPLE) { ge_ui_destroy_selinfo(ugd); _ge_data_selected_list_finalize(); @@ -431,10 +431,12 @@ int ge_albums_back_to_view(ge_ugdata *ugd) GE_IF_DEL_IDLER(ugd->grid_append_idler) + _ge_set_current_album(NULL); + ge_albums_update_view(ugd); ge_grid_clear_view(ugd); - _ge_set_view_mode(GE_AlbumsView_Mode); + _ge_set_view_mode(GE_VIEW_ALBUMS); return 0; } @@ -446,13 +448,10 @@ int ge_albums_sel_album(ge_cluster* album_item) GE_CHECK_VAL(album_item->cluster->uuid, -1); GE_CHECK_VAL(album_item->ugd, -1); - if(_ge_get_view_mode() != GE_AlbumsView_Mode) - { - ge_dbgE("error mode.. now return!"); + if(_ge_get_view_mode() != GE_VIEW_ALBUMS) { + ge_dbgE("Wrong mode!"); return -1; - } - else - { + } else { ge_dbg("ViewMode"); } @@ -462,17 +461,12 @@ int ge_albums_sel_album(ge_cluster* album_item) ge_dbg("Album: %s, id: %s.", album_item->cluster->display_name, album_item->cluster->uuid); - if(ugd->album_select_mode == GE_Album_Select_One) - { - ge_dbg("One album selected, return album id and destroy the ug!"); - - char folder_path[GE_DIR_PATH_LEN_MAX] = { 0, }; - g_strlcpy(folder_path, album_item->cluster->path, - GE_DIR_PATH_LEN_MAX); + if(ugd->album_select_mode == GE_ALBUM_SELECT_T_ONE) { + ge_dbg("One album selected, return album id"); service_add_extra_data(ugd->service, GE_ALBUM_SELECT_RETURN_PATH, - folder_path); - ge_dbg("return folder-path: %s", folder_path); + album_item->cluster->path); + ge_dbg("return folder-path: %s", album_item->cluster->path); ug_send_result(ugd->ug, ugd->service); ug_destroy_me(ugd->ug); ugd->ug = NULL; @@ -487,15 +481,12 @@ int ge_albums_sel_album(ge_cluster* album_item) _ge_data_get_items_list(ugd, album_item, GE_FIRST_VIEW_START_POS, GE_FIRST_VIEW_END_POS); - if(ugd->file_select_mode == GE_File_Select_Setas) - { + if(ugd->file_select_mode == GE_FILE_SELECT_T_SETAS) { ge_dbg("setas mode->thumbnail is view mode"); - _ge_set_view_mode(GE_ThumbnailView_Mode); - } - else - { + _ge_set_view_mode(GE_VIEW_THUMBS); + } else { ge_dbg("select mode->thumbnail is edit mode"); - _ge_set_view_mode(GE_ThumbnailEdit_Mode); + _ge_set_view_mode(GE_VIEW_THUMBS_EDIT); } ugd->thumbs_view_ly = ge_grid_create_ly(ugd->navi_bar); @@ -515,28 +506,26 @@ int ge_albums_sel_album(ge_cluster* album_item) /* Checkme: clear albums view for animation effect pause issue */ elm_gengrid_clear(ugd->albums_view); - if(_ge_get_view_mode() == GE_ThumbnailView_Mode) - { + if(_ge_get_view_mode() == GE_VIEW_THUMBS) { /* Check root case */ if(_ge_data_is_root_path(album_item->cluster->path)) - { ge_ui_create_title_and_push(ugd, ugd->navi_bar, - ugd->thumbs_view_ly, ThumbnailView_Title, GE_ALBUM_ROOT_NAME); - } + ugd->thumbs_view_ly, + GE_NAVI_THUMBS, + GE_ALBUM_ROOT_NAME); else - { ge_ui_create_title_and_push(ugd, ugd->navi_bar, - ugd->thumbs_view_ly, ThumbnailView_Title, album_item->cluster->display_name); - } - } - else - { + ugd->thumbs_view_ly, + GE_NAVI_THUMBS, + album_item->cluster->display_name); + } else { ge_ui_create_title_and_push(ugd, ugd->navi_bar, - ugd->thumbs_view_ly, ThumbnailView_Title, ugd->albums_view_title); + ugd->thumbs_view_ly, + GE_NAVI_THUMBS, + ugd->albums_view_title); } - if(_ge_data_get_count_all() == (GE_FIRST_VIEW_END_POS+1)) - { + if(_ge_data_get_count_all() == (GE_FIRST_VIEW_END_POS+1)) { ge_dbg("\n\n>>>>>>>>Use idler to append other medias--Start>>>>>>>>\n"); ugd->grid_append_idler = ecore_idler_add(_ge_albums_append_grid_idler, ugd); } diff --git a/ug/ug-gallery-efl/src/ge-button.c b/ug/ug-gallery-efl/src/ge-button.c index cd7905f..268940b 100755 --- a/ug/ug-gallery-efl/src/ge-button.c +++ b/ug/ug-gallery-efl/src/ge-button.c @@ -15,31 +15,45 @@ */ #include "ge-debug.h" -#include "ge-ui-util.h" -#include "ge-util.h" #include "ge-button.h" -#include "ge-strings.h" -Evas_Object *_ge_but_create_but(Evas_Object *parent, ge_but_mode mode, But_Smart_Cb cb_func, const void *data) +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) { - ge_dbg("Button mode: %d", mode); Evas_Object *btn = NULL; GE_CHECK_NULL(parent); btn = elm_button_add(parent); GE_CHECK_NULL(btn); + elm_object_focus_allow_set(btn, EINA_FALSE); - switch (mode) { - case GE_BUT_OK: - elm_object_text_set(btn, - (char*)_GE_GETSYSTEMSTR("IDS_COM_SK_OK")); - break; - case GE_BUT_CANCEL: - elm_object_text_set(btn, - (char*)_GE_GETSYSTEMSTR("IDS_COM_SK_CANCEL")); - break; - default: - break; + 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_dbg("Button icon: %s", icon); + Evas_Object *ic = NULL; + ic = elm_icon_add(btn); + GE_CHECK_NULL(ic); + elm_icon_file_set(ic, icon, NULL); + 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); + elm_icon_resizable_set(ic, EINA_TRUE, EINA_TRUE); + elm_object_content_set(btn, ic); + } + + if (text) { + ge_dbg("Button text: %s", text); + elm_object_text_set(btn, text); } if (cb_func) @@ -47,3 +61,4 @@ Evas_Object *_ge_but_create_but(Evas_Object *parent, ge_but_mode mode, But_Smart return btn; } + diff --git a/ug/ug-gallery-efl/src/ge-data.c b/ug/ug-gallery-efl/src/ge-data.c index a57adf1..08b1826 100755 --- a/ug/ug-gallery-efl/src/ge-data.c +++ b/ug/ug-gallery-efl/src/ge-data.c @@ -210,23 +210,10 @@ static int __ge_data_get_clusters_list(ge_ugdata* ugd) if (item_list) __ge_data_free_mtype_items_list(&item_list); return err; - } - - Eina_List* clist = ugd->cluster_list->clist; - - EINA_LIST_FREE(item_list, f_data) { - if (f_data == NULL || f_data->uuid == NULL) { - /* Invalid data, next one */ - ge_dbgE("Invalid ge_album_s!"); - continue; - } - ge_dbg("Cluster ID: %s.", f_data->uuid); - - /* only image is valid in setas mode. */ - if (ugd->file_type_mode == GE_File_Select_Type_Image || - ugd->file_type_mode == GE_File_Select_Type_Video) { + } else if (ugd->file_type_mode == GE_FILE_T_IMAGE || + ugd->file_type_mode == GE_FILE_T_VIDEO) { memset(&filter,0x00,sizeof(ge_filter_s)); - if(ugd->file_type_mode == GE_File_Select_Type_Image) + if(ugd->file_type_mode == GE_FILE_T_IMAGE) g_strlcpy(filter.cond, GE_CONDITION_IMAGE, CONDITION_LENGTH); else @@ -238,7 +225,20 @@ static int __ge_data_get_clusters_list(ge_ugdata* ugd) filter.offset = GE_GET_ALL_RECORDS; filter.count = GE_GET_ALL_RECORDS; filter.with_meta = false; + } + Eina_List* clist = ugd->cluster_list->clist; + EINA_LIST_FREE(item_list, f_data) { + if (f_data == NULL || f_data->uuid == NULL) { + /* Invalid data, next one */ + ge_dbgE("Invalid ge_album_s!"); + continue; + } + ge_dbg("Cluster ID: %s.", f_data->uuid); + + /* only image is valid in setas mode. */ + if (ugd->file_type_mode == GE_FILE_T_IMAGE || + ugd->file_type_mode == GE_FILE_T_VIDEO) { err = _ge_local_data_get_media_count(f_data->uuid, &filter, &medias_cnt); @@ -395,9 +395,9 @@ int _ge_data_update_items_cnt(ge_ugdata* ugd, ge_cluster *album) g_strlcpy(filter.cond, GE_CONDITION_IMAGE_VIDEO, CONDITION_LENGTH); filter.with_meta = false; - if(ugd->file_type_mode == GE_File_Select_Type_Image) + 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_Select_Type_Video) + 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)) { /* Local album */ @@ -409,6 +409,7 @@ int _ge_data_update_items_cnt(ge_ugdata* ugd, ge_cluster *album) ge_dbg("all media count"); err = _ge_local_data_get_all_media_count(&filter, &item_count); } + if(err < 0) { ge_dbgE("Get item count failed(%d)!", err); return -1; @@ -459,9 +460,9 @@ int _ge_data_get_items_list(ge_ugdata* ugd, ge_cluster *album, int start_pos, memset(&filter, 0, sizeof(ge_filter_s)); ge_dbg("--start_pos[%d], end_pos[%d]--", start_pos, end_pos); - if(ugd->file_type_mode == GE_File_Select_Type_Image) { + 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_Select_Type_Video) { + } 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, @@ -555,8 +556,8 @@ int _ge_data_update_items_list(ge_ugdata* ugd, ge_cluster *album) int view_mode = _ge_get_view_mode(); Eina_List *sel_id_list = NULL; - if (view_mode == GE_ThumbnailEdit_Mode && - ugd->file_select_mode != GE_File_Select_One) { + if (view_mode == GE_VIEW_THUMBS_EDIT && + ugd->file_select_mode != GE_FILE_SELECT_T_ONE) { ge_dbg("Edit view for multiple selection."); /* Get ID list of selected items */ __ge_data_get_selected_item_id_list(&sel_id_list); @@ -564,9 +565,9 @@ int _ge_data_update_items_list(ge_ugdata* ugd, ge_cluster *album) ge_filter_s filter; memset(&filter, 0x00, sizeof(ge_filter_s)); - if(ugd->file_type_mode == GE_File_Select_Type_Image) { + 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_Select_Type_Video) { + } 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, @@ -671,9 +672,9 @@ int _ge_data_get_first_several_items(ge_ugdata* ugd, ge_cluster *album, ge_filter_s filter; memset(&filter, 0x00, sizeof(ge_filter_s)); - if (ugd->file_type_mode == GE_File_Select_Type_Image) { + 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_Select_Type_Video) { + } 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, @@ -697,7 +698,7 @@ int _ge_data_get_first_several_items(ge_ugdata* ugd, ge_cluster *album, goto DB_FAILED; } } else { - //add "All" album + /* add "All" album */ err = _ge_local_data_get_all_albums_media_list(&filter, &item_list); if (err != 0 || item_list == NULL) { diff --git a/ug/ug-gallery-efl/src/ge-exif.c b/ug/ug-gallery-efl/src/ge-exif.c index 4c6bc50..5d09789 100755 --- a/ug/ug-gallery-efl/src/ge-exif.c +++ b/ug/ug-gallery-efl/src/ge-exif.c @@ -1,27 +1,18 @@ /* - * ug-gallery-efl + * Copyright 2012 Samsung Electronics Co., Ltd * - * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: Sangjin Han , - * Jiansong Jin , - * Jonghyuk Lee , - * Chaolong Lin , - * Yongjun Zhao - * - * Licensed under the Apache License, Version 2.0 (the "License"); + * Licensed under the Flora License, Version 1.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 + * http://www.tizenopensource.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. - * - */ + */ /** * The Exif specification defines an Orientation Tag to indicate the orientation of the diff --git a/ug/ug-gallery-efl/src/ge-ext-ug-load.c b/ug/ug-gallery-efl/src/ge-ext-ug-load.c index 3672628..b96e39d 100755 --- a/ug/ug-gallery-efl/src/ge-ext-ug-load.c +++ b/ug/ug-gallery-efl/src/ge-ext-ug-load.c @@ -47,7 +47,7 @@ static void _ge_ext_destroy_me(ge_ugdata *ugd) ug_destroy(ugd->ug_called_by_me); ugd->ug_called_by_me = NULL; } - if(ugd->file_select_mode == GE_File_Select_Setas) + if(ugd->file_select_mode == GE_FILE_SELECT_T_SETAS) { if(ugd->file_setas_image_path) { @@ -62,8 +62,8 @@ static void _ge_ext_destroy_me(ge_ugdata *ugd) } if(ugd->file_setas_crop_image_path && - (ugd->file_select_setas_mode == GE_File_Select_Setas_CallerID || - ugd->file_select_setas_mode == GE_FILE_SELECT_SETAS_MODE_CROP_WALLPAPER)) { + (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); service_add_extra_data(ugd->service, @@ -128,7 +128,7 @@ static void _ge_ext_iv_result_cb(ui_gadget_h ug, service_h result, void *priv) ge_ugdata *ugd = (ge_ugdata *)priv; char* path = NULL; - if(ugd->file_select_mode == GE_File_Select_Setas) + if(ugd->file_select_mode == GE_FILE_SELECT_T_SETAS) { service_get_extra_data(result, GE_IMAGEVIEWER_IMAGE_PATH, &path); ge_dbg("SETAS_IMAGE_PATH"); @@ -140,8 +140,8 @@ static void _ge_ext_iv_result_cb(ui_gadget_h ug, service_h result, void *priv) path = NULL; } - if(ugd->file_select_setas_mode == GE_File_Select_Setas_CallerID || - ugd->file_select_setas_mode == GE_FILE_SELECT_SETAS_MODE_CROP_WALLPAPER) { + if(ugd->file_select_setas_mode == GE_SETAS_T_CALLERID || + ugd->file_select_setas_mode == GE_SETAS_T_CROP_WALLPAPER) { service_get_extra_data(result, GE_IMAGEVIEWER_CROP_IMAGE_PATH, &path); @@ -226,7 +226,7 @@ int ge_ext_load_iv_ug(ge_ugdata* ugd) service_add_extra_data(service, "View Mode", "SETAS" ); service_add_extra_data(service, "Path", cur_item->item->file_url); - if(ugd->file_select_setas_mode == GE_File_Select_Setas_Wallpaper) { + if(ugd->file_select_setas_mode == GE_SETAS_T_WALLPAPER) { service_add_extra_data(service, "Setas type", "Wallpaper"); if(ugd->file_setas_homescreen_path) @@ -244,7 +244,7 @@ int ge_ext_load_iv_ug(ge_ugdata* ugd) free(ugd->file_setas_lockscreen_path); ugd->file_setas_lockscreen_path = NULL; } - } else if(ugd->file_select_setas_mode == GE_FILE_SELECT_SETAS_MODE_CROP_WALLPAPER) { + } else if(ugd->file_select_setas_mode == GE_SETAS_T_CROP_WALLPAPER) { service_add_extra_data(service, "Setas type", "Crop"); service_add_extra_data(service, "Fixed ratio", "TRUE"); @@ -259,7 +259,7 @@ int ge_ext_load_iv_ug(ge_ugdata* ugd) service_add_extra_data(service, "Resolution", reso_str); free(reso_str); reso_str = NULL; - } else if(ugd->file_select_setas_mode == GE_File_Select_Setas_CallerID) { + } else if(ugd->file_select_setas_mode == GE_SETAS_T_CALLERID) { service_add_extra_data(service, "Setas type", "CallerID"); if(ugd->file_setas_callid_size) { diff --git a/ug/ug-gallery-efl/src/ge-gridview.c b/ug/ug-gallery-efl/src/ge-gridview.c index 905651e..2f6b90f 100755 --- a/ug/ug-gallery-efl/src/ge-gridview.c +++ b/ug/ug-gallery-efl/src/ge-gridview.c @@ -92,8 +92,8 @@ static void _ge_grid_sel(void *data, Evas_Object *obj, void *event_info) { ge_dbg(""); GE_CHECK(data); - if (_ge_get_view_mode() != GE_ThumbnailView_Mode) { - //ge_dbgE("EditMode.. now return."); + if (_ge_get_view_mode() != GE_VIEW_THUMBS) { + ge_dbgE("Wrong mode!"); return; } else { ge_dbg("ViewMode"); @@ -111,7 +111,7 @@ static void _ge_grid_sel(void *data, Evas_Object *obj, void *event_info) ge_dbg("file_url: %s.", gitem->item->file_url); } - if (ugd->file_select_mode == GE_File_Select_Setas) { + 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_set_current_item(gitem); @@ -119,7 +119,8 @@ static void _ge_grid_sel(void *data, Evas_Object *obj, void *event_info) ge_ext_load_iv_ug(ugd); } else if (gitem->item->type == MEDIA_CONTENT_TYPE_VIDEO && ugd->popup == NULL) { - ge_ui_create_popup(ugd, GE_Popup_OneButton, GE_POPUP_ONLY_SUPPORT_IMAGE); + ge_ui_create_popup(ugd, GE_POPUP_ONEBUT, + GE_POPUP_ONLY_SUPPORT_IMAGE); } } else if (gitem->item->type == MEDIA_CONTENT_TYPE_IMAGE || @@ -239,21 +240,16 @@ static void _ge_grid_check_changed(void *data, Evas_Object *obj, void *event_inf ge_ugdata *ugd = gitem->ugd; GE_CHECK(ugd->service); - if(_ge_get_view_mode() != GE_ThumbnailEdit_Mode) - { - //ge_dbgE("ViewMode.. now return."); + if(_ge_get_view_mode() != GE_VIEW_THUMBS_EDIT) { + ge_dbgE("Wrong view mode!"); return; } - else - { - //ge_dbg("EditMode"); - } + Eina_Bool checked = elm_check_state_get(obj); - if(checked) - { - if(ugd->file_select_mode == GE_File_Select_One) // add for one file selection - { + if(checked) { + /* add for one file selection */ + if(ugd->file_select_mode == GE_FILE_SELECT_T_ONE) { ge_dbg("Service add:%s", gitem->item->file_url); /* Hide checked state in one file selection */ elm_check_state_set(obj, false); @@ -270,13 +266,13 @@ static void _ge_grid_check_changed(void *data, Evas_Object *obj, void *event_inf _ge_data_selected_list_append( gitem ); } } - else if(ugd->file_select_mode != GE_File_Select_One) + else if(ugd->file_select_mode != GE_FILE_SELECT_T_ONE) { ge_dbg("Remove:%s", gitem->item->file_url); _ge_data_selected_list_remove( gitem ); } - if(ugd->file_select_mode != GE_File_Select_One) + if(ugd->file_select_mode != GE_FILE_SELECT_T_ONE) { gitem->checked = checked; ge_ui_create_selinfo(ugd, ugd->thumbs_view_ly); @@ -338,9 +334,9 @@ static Evas_Object *__ge_grid_get_content(void *data, Evas_Object *obj, const ch path = GE_DEFAULT_THUMB_ICON; } else { char *drm_path = ge_drm_get_file_path(gitem); - path = _GETICON(drm_path); + path = _GE_GET_ICON(drm_path); if (_ge_is_image_valid(ugd, path) == false) - path = _GETICON(gitem->item->thumb_url); + path = _GE_GET_ICON(gitem->item->thumb_url); #ifdef _USE_ROTATE_BG_GE /* Rotate bg if it's created from original file */ if (!g_strcmp0(path, gitem->item->file_url)) @@ -393,7 +389,7 @@ static Evas_Object *__ge_grid_get_content(void *data, Evas_Object *obj, const ch return layout; } else if (!g_strcmp0(part, "elm.swallow.end") && - (_ge_get_view_mode() == GE_ThumbnailEdit_Mode)) { + (_ge_get_view_mode() == GE_VIEW_THUMBS_EDIT)) { Evas_Object* ck = NULL; ck = elm_check_add(obj); @@ -454,7 +450,7 @@ static bool _ge_grid_create_thumb(ge_ugdata* ugd, Evas_Object* parent) continue; } - /*if(_ge_get_view_mode() == GE_ThumbnailEdit_Mode) + /*if(_ge_get_view_mode() == GE_VIEW_THUMBS_EDIT) { ge_media_s *new_item = NULL; _ge_local_data_get_media(gitem->item->uuid, &new_item); @@ -680,14 +676,11 @@ Evas_Object* ge_grid_create_view(ge_ugdata* ugd, Evas_Object* parent) int ge_grid_clear_view(ge_ugdata *ugd) { GE_CHECK_VAL(ugd, -1); - if(ugd->file_select_mode == GE_File_Select_One) - { + if(ugd->file_select_mode == GE_FILE_SELECT_T_ONE) service_remove_extra_data(ugd->service, GE_FILE_SELECT_RETURN_PATH); - } - if(ugd->thumbs_view) - { + if(ugd->thumbs_view) { if(ugd->thumbs_nocontents != ugd->thumbs_view) ge_grid_del_callbacks(ugd); diff --git a/ug/ug-gallery-efl/src/ge-rotate-bg.c b/ug/ug-gallery-efl/src/ge-rotate-bg.c index f7fa8ef..187bbf9 100755 --- a/ug/ug-gallery-efl/src/ge-rotate-bg.c +++ b/ug/ug-gallery-efl/src/ge-rotate-bg.c @@ -1,26 +1,17 @@ /* - * ug-gallery-efl + * Copyright 2012 Samsung Electronics Co., Ltd * - * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: Sangjin Han , - * Jiansong Jin , - * Jonghyuk Lee , - * Chaolong Lin , - * Yongjun Zhao - * - * Licensed under the Apache License, Version 2.0 (the "License"); + * Licensed under the Flora License, Version 1.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 + * http://www.tizenopensource.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. - * */ #ifdef _USE_ROTATE_BG_GE diff --git a/ug/ug-gallery-efl/src/ge-thumb.c b/ug/ug-gallery-efl/src/ge-thumb.c index 24afc9b..989341b 100755 --- a/ug/ug-gallery-efl/src/ge-thumb.c +++ b/ug/ug-gallery-efl/src/ge-thumb.c @@ -1,26 +1,17 @@ /* - * ug-gallery-efl + * Copyright 2012 Samsung Electronics Co., Ltd * - * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: Sangjin Han , - * Jiansong Jin , - * Jonghyuk Lee , - * Chaolong Lin , - * Yongjun Zhao - * - * Licensed under the Apache License, Version 2.0 (the "License"); + * Licensed under the Flora License, Version 1.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 + * http://www.tizenopensource.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-debug.h" @@ -146,7 +137,6 @@ Evas_Object *_ge_thumb_show_part_icon_video(Evas_Object *obj, char *path, evas_object_show(icon); elm_object_part_content_set(layout, "elm.swallow.favoricon", icon); - /* Set favourites icon */ } if (bk_len) { diff --git a/ug/ug-gallery-efl/src/ge-tile.c b/ug/ug-gallery-efl/src/ge-tile.c index ef22ddb..58003ea 100755 --- a/ug/ug-gallery-efl/src/ge-tile.c +++ b/ug/ug-gallery-efl/src/ge-tile.c @@ -1,32 +1,22 @@ /* - * ug-gallery-efl + * Copyright 2012 Samsung Electronics Co., Ltd * - * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: Sangjin Han , - * Jiansong Jin , - * Jonghyuk Lee , - * Chaolong Lin , - * Yongjun Zhao - * - * Licensed under the Apache License, Version 2.0 (the "License"); + * Licensed under the Flora License, Version 1.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 + * http://www.tizenopensource.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-debug.h" #include "ge-tile.h" #include "ge-button.h" -#include "gallery.h" #ifdef _USE_ROTATE_BG_GE #include "ge-rotate-bg.h" #endif @@ -650,7 +640,7 @@ Evas_Object *_ge_tile_show_part_icon(Evas_Object *obj, const char *part, return NULL; Evas_Object *tb = NULL; - tb = __ge_tile_add_icon(obj, length, scale, func, data); + tb = __ge_tile_add_icon(obj, length, scale, func, data, NULL); return tb; } #endif diff --git a/ug/ug-gallery-efl/src/ge-ui-util.c b/ug/ug-gallery-efl/src/ge-ui-util.c index 6a6fe41..8905ea5 100755 --- a/ug/ug-gallery-efl/src/ge-ui-util.c +++ b/ug/ug-gallery-efl/src/ge-ui-util.c @@ -29,7 +29,8 @@ #define GE_NOBUT_EXIT_POPUP_HIDE_TIME_DELAY 3.0 #define GE_SELINFO_HIDE_TIME_DELAY 3.0 #define GE_CTRLBAR_STYLE_NAVIFRAME "naviframe" -#define GE_BUTTON_STYLE_NAVIBAR_PRE "naviframe/back_btn/default" +#define GE_BTN_NAVIBAR_PRE "naviframe/back_btn/default" +#define GE_BTN_POPUP "popup_button/default" #define GE_NAVIFRAME_PREB_BTN "prev_btn" #define GE_NAVIFRAME_CONTROLBAR "controlbar" #define GE_TRANS_FINISHED "transition,finished" @@ -43,11 +44,6 @@ static void _ge_ui_response_cb(void *data, Evas_Object *obj, void *event_info) ge_ugdata *ugd = (ge_ugdata *)data; ge_dbg("popup mode: %d", ugd->popup_mode); - if(ugd->popup_mode == GE_Popup_UgExit) - { - ug_destroy_me(ugd->ug); - } - evas_object_del(obj); ugd->popup = NULL; } @@ -61,10 +57,8 @@ static Eina_Bool __ge_popup_timeout_cb(void *data) ugd->del_timer = NULL; } - if (ugd->popup) { - evas_object_del(ugd->popup); - ugd->popup = NULL; - } + + GE_IF_DEL_OBJ(ugd->popup); return ECORE_CALLBACK_CANCEL; } @@ -99,11 +93,12 @@ static void __ge_ui_done_cb(void *data, Evas_Object *obj, void *event_info) if(sel_cnt == 0) { ge_dbg("No thumbs selected, return!"); - ge_ui_create_popup(ugd, GE_Popup_NoButton, GE_POPUP_NO_FILES_SELECTED); + ge_ui_create_popup(ugd, GE_POPUP_NOBUT, + GE_POPUP_NO_FILES_SELECTED); return; } - if(ugd->file_select_mode == GE_File_Select_Multiple) { + if(ugd->file_select_mode == GE_FILE_SELECT_T_MULTIPLE) { GString* selected_path = g_string_new(NULL); for(i = 1; i <= sel_cnt; i++ ) { @@ -197,8 +192,8 @@ static void _ge_ui_destroy_me_cb(void *data, Evas_Object *obj, void *event_info) /* Delete callback when it is clicked to prevent it is called for many times */ evas_object_smart_callback_del(obj, "clicked", _ge_ui_destroy_me_cb); - if (_ge_get_view_mode() != GE_AlbumsView_Mode) { - if(ugd->file_select_mode == GE_File_Select_Multiple) { + if (_ge_get_view_mode() != GE_VIEW_ALBUMS) { + if(ugd->file_select_mode == GE_FILE_SELECT_T_MULTIPLE) { ge_ui_destroy_selinfo(ugd); _ge_data_selected_list_finalize(); } @@ -231,7 +226,7 @@ int _ge_ui_get_rotate_angle(void) } int ge_ui_create_title_and_push(ge_ugdata *ugd, Evas_Object* parent, - Evas_Object* obj, NaviTitleMode mode, + Evas_Object *obj, ge_navi_mode_e mode, char* title) { ge_dbg(""); @@ -241,26 +236,23 @@ int ge_ui_create_title_and_push(ge_ugdata *ugd, Evas_Object* parent, GE_CHECK_VAL(title, -1); Elm_Object_Item *nf_it = NULL; - if (mode == AlbumsView_Title) { - ge_dbg("AlbumsView_Title"); + if (mode == GE_NAVI_ALBUMS) { + ge_dbg("GE_NAVI_ALBUMS"); /* Add cancel button */ Evas_Object *cancel_btn = NULL; - cancel_btn = elm_button_add(obj); - GE_CHECK_VAL(cancel_btn, -1); - if(ugd->th) - elm_object_theme_set(cancel_btn, ugd->th); - elm_object_style_set(cancel_btn, GE_BUTTON_STYLE_NAVIBAR_PRE); - evas_object_smart_callback_add(cancel_btn, "clicked", + cancel_btn = _ge_but_create_but(obj, ugd->th, NULL, GE_STR_OK, + GE_BTN_NAVIBAR_PRE, _ge_ui_destroy_me_cb, ugd); + GE_CHECK_VAL(cancel_btn, -1); nf_it = elm_naviframe_item_push(parent, title, cancel_btn, NULL, obj, NULL); - } else if(mode == ThumbnailView_Title) { - if(ugd->file_select_mode == GE_File_Select_None) { - ge_dbgE("file_select_mode == GE_File_Select_None!"); + } else if (mode == GE_NAVI_THUMBS) { + if(ugd->file_select_mode == GE_FILE_SELECT_T_NONE) { + ge_dbgE("file_select_mode == GE_FILE_SELECT_T_NONE!"); return -1; } - ge_dbg("ThumbnailView_Title"); + ge_dbg("GE_NAVI_THUMBS"); /* Add transition finished callback */ evas_object_smart_callback_add(parent, GE_TRANS_FINISHED, __ge_ui_trans_finished_cb, ugd); @@ -272,15 +264,15 @@ int ge_ui_create_title_and_push(ge_ugdata *ugd, Evas_Object* parent, GE_NAVIFRAME_PREB_BTN); if(ugd->th) elm_object_theme_set(back_btn, ugd->th); - elm_object_style_set(back_btn, GE_BUTTON_STYLE_NAVIBAR_PRE); + elm_object_style_set(back_btn, GE_BTN_NAVIBAR_PRE); evas_object_smart_callback_add(back_btn, "clicked", _ge_ui_back_to_albums_cb, ugd); /** * Add 'Done' item. */ - if ((ugd->file_select_mode != GE_File_Select_One) && - (_ge_get_view_mode() == GE_ThumbnailEdit_Mode)) { + if ((ugd->file_select_mode != GE_FILE_SELECT_T_ONE) && + (_ge_get_view_mode() == GE_VIEW_THUMBS_EDIT)) { ge_dbg("Multiple selection, show Done"); /* create tool controlbar downside */ Evas_Object *bot_bar = NULL; @@ -345,14 +337,14 @@ Evas_Object* ge_ui_create_nocontents(ge_ugdata* ugd) Evas_Object *layout = NULL; char label_str[GE_NOCONTENTS_LABEL_LEN_MAX] ={0,}; - if(_ge_get_view_mode() == GE_ThumbnailView_Mode || - _ge_get_view_mode() == GE_ThumbnailEdit_Mode) { + if(_ge_get_view_mode() == GE_VIEW_THUMBS || + _ge_get_view_mode() == GE_VIEW_THUMBS_EDIT) { if(ugd->file_type_mode) { - if (ugd->file_type_mode == GE_File_Select_Type_Image) + if (ugd->file_type_mode == GE_FILE_T_IMAGE) snprintf(label_str, sizeof(label_str), "%s", (char*)(_GE_GETSYSTEMSTR("IDS_COM_BODY_NO_IMAGES"))); - else if (ugd->file_type_mode == GE_File_Select_Type_Video) + else if (ugd->file_type_mode == GE_FILE_T_VIDEO) snprintf(label_str, sizeof(label_str), "%s", (char*)GE_LABEL_NO_VIDEOS); @@ -364,7 +356,7 @@ Evas_Object* ge_ui_create_nocontents(ge_ugdata* ugd) snprintf(label_str, sizeof(label_str), "%s", (char*)(_GE_GETSYSTEMSTR("IDS_COM_BODY_NO_ITEMS"))); } - } else if(_ge_get_view_mode() == GE_AlbumsView_Mode) { + } else if(_ge_get_view_mode() == GE_VIEW_ALBUMS) { snprintf(label_str, sizeof(label_str), "%s", (char*)GE_LABEL_NO_ALBUMS); } else { @@ -426,7 +418,8 @@ Evas_Object* ge_ui_create_navibar(ge_ugdata* ugd, Evas_Object* parent) return navi_bar; } -Evas_Object *ge_ui_create_popup(ge_ugdata* ugd, GE_PopupMode mode, char* desc) +Evas_Object* ge_ui_create_popup(ge_ugdata* ugd, ge_popup_mode_e mode, + char* desc) { ge_dbg(""); GE_CHECK_NULL(ugd); @@ -443,31 +436,33 @@ Evas_Object *ge_ui_create_popup(ge_ugdata* ugd, GE_PopupMode mode, char* desc) popup = elm_popup_add(ugd->ly_main); GE_CHECK_NULL(popup); - evas_object_size_hint_weight_set(popup, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_weight_set(popup, EVAS_HINT_EXPAND, + EVAS_HINT_EXPAND); elm_object_text_set(popup, desc); switch (mode) { - case GE_Popup_NoButton: - case GE_Popup_UgExit: + case GE_POPUP_NOBUT: __ge_popup_add_timer(ugd, GE_NOBUT_EXIT_POPUP_HIDE_TIME_DELAY); break; - case GE_Popup_OneButton: + case GE_POPUP_ONEBUT: { Evas_Object *btn = NULL; - btn = _ge_but_create_but(popup, GE_BUT_OK, _ge_ui_response_cb, - ugd); + btn = _ge_but_create_but(popup, ugd->th, NULL, GE_STR_OK, + GE_BTN_POPUP, _ge_ui_response_cb, ugd); elm_object_part_content_set(popup, "button1", btn); break; } - case GE_Popup_TwoButton: + case GE_POPUP_TWOBUT: { Evas_Object *btn1 = NULL; - btn1 = _ge_but_create_but(popup, GE_BUT_OK, _ge_ui_response_cb, + btn1 = _ge_but_create_but(popup, ugd->th, NULL, GE_STR_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, GE_BUT_CANCEL, - _ge_ui_response_cb, ugd); + btn2 = _ge_but_create_but(popup, ugd->th, NULL, GE_STR_CANCEL, + GE_BTN_POPUP, _ge_ui_response_cb, + ugd); elm_object_part_content_set(popup, "button2", btn2); break; } @@ -518,7 +513,7 @@ int ge_ui_create_selinfo(ge_ugdata* ugd, Evas_Object* parent) if(count <= 0) { __ge_ui_disable_done_item(ugd, true); - if(ugd->file_select_mode == GE_File_Select_Multiple) + if(ugd->file_select_mode == GE_FILE_SELECT_T_MULTIPLE) { ge_ui_destroy_selinfo(ugd); } @@ -528,8 +523,9 @@ int ge_ui_create_selinfo(ge_ugdata* ugd, Evas_Object* parent) __ge_ui_disable_done_item(ugd, false); - if(ugd->file_select_mode == GE_File_Select_One) + if(ugd->file_select_mode == GE_FILE_SELECT_T_ONE) { + ge_dbgW("In select one mode!"); return -1; } @@ -582,20 +578,19 @@ int ge_ui_destroy_selinfo(ge_ugdata* ugd) GE_CHECK_VAL(ugd, -1); GE_CHECK_VAL(ugd->thumbs_view_ly, -1); - edje_object_signal_emit(_EDJ(ugd->thumbs_view_ly), "elm,thumb_view,state,default", "elm");/* reset view to default status.*/ - if(ugd->file_select_mode != GE_File_Select_One && ugd->selectioninfo) - { - evas_object_smart_callback_del(ugd->selectioninfo, "timeout", _ge_ui_selinfo_destroy_cb); - } + /* reset view to default status */ + edje_object_signal_emit(_EDJ(ugd->thumbs_view_ly), + "elm,thumb_view,state,default", "elm"); + if(ugd->file_select_mode != GE_FILE_SELECT_T_ONE && ugd->selectioninfo) + evas_object_smart_callback_del(ugd->selectioninfo, "timeout", + _ge_ui_selinfo_destroy_cb); - if(ugd->selectioninfo_ly) - { + if(ugd->selectioninfo_ly) { evas_object_del(ugd->selectioninfo_ly); ugd->selectioninfo_ly = NULL; } - if(ugd->selectioninfo) - { + if(ugd->selectioninfo) { evas_object_del(ugd->selectioninfo); ugd->selectioninfo = NULL; } diff --git a/ug/ug-gallery-efl/src/ge-util.c b/ug/ug-gallery-efl/src/ge-util.c index c3e9f80..49c131a 100755 --- a/ug/ug-gallery-efl/src/ge-util.c +++ b/ug/ug-gallery-efl/src/ge-util.c @@ -155,13 +155,10 @@ Eina_Bool ge_update_view(ge_ugdata* ugd, int mode) int view_mode = _ge_get_view_mode(); ge_dbg("view_mode: %d", view_mode); - if (view_mode == GE_AlbumsView_Mode) - { + if (view_mode == GE_VIEW_ALBUMS) { _ge_refresh_albums_list(ugd); ge_albums_update_view(ugd); - } - else if (view_mode == GE_ThumbnailView_Mode) - { + } else if (view_mode == GE_VIEW_THUMBS) { _ge_refresh_albums_list(ugd); if(_ge_get_current_album() == NULL) { @@ -173,9 +170,7 @@ Eina_Bool ge_update_view(ge_ugdata* ugd, int mode) } ge_grid_update_view(ugd); - } - else if (view_mode == GE_ThumbnailEdit_Mode) - { + } else if (view_mode == GE_VIEW_THUMBS_EDIT) { ge_cluster* cur_album = _ge_get_current_album(); /* MMC removed */