#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_CROP_WALLPAPER "crop"
#define GE_SETAS_CALLERID "callerid"
#define GE_FILE_SELECT_RETURN_COUNT "count"
+++ /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
-
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);
int __ge_grid_append_sel_item(ge_ugdata *ugd, ge_item *gitem);
int __ge_grid_remove_sel_item(ge_ugdata *ugd, ge_item *gitem);
+++ /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
#include "ge-util.h"
#include "ge-ext-ug-load.h"
#include "ge-data.h"
-#include "ge-exif.h"
#include "ge-thumb.h"
#include "ge-button.h"
#include "ge-main-view.h"
#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 view_by_mode_e {
GE_VIEW_ALBUMS,
- GE_VIEW_PEOPLE,
GE_VIEW_THUMBS,
GE_VIEW_THUMBS_EDIT,
GE_VIEW_TIME,
int image_cnt;
};
-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;
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;
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;
profile = mobile-3.0
# C Sources
-USER_SRCS = src/gallery-efl.c src/data/ge-data-util.c src/data/ge-data-type.c src/view/ge-albums.c src/util/ge-util.c src/util/ge-ext-exec.c src/util/ge-ext-ug-load.c src/util/ge-ui-util.c src/data/ge-data.c src/widget/ge-rotate-bg.c src/widget/ge-thumb.c src/util/ge-db-update.c src/util/ge-file-util.c src/view/ge-main-view.c src/widget/ge-tile.c src/widget/ge-nocontent.c src/widget/ge-button.c src/util/ge-exif.c src/data/ge-local-data.c src/view/ge-gridview.c src/util/ge-lang.c src/util/ge-debug.c src/view/ge-timeline.c
+USER_SRCS = src/gallery-efl.c src/data/ge-data-util.c src/data/ge-data-type.c src/view/ge-albums.c src/util/ge-util.c src/util/ge-ext-exec.c src/util/ge-ext-ug-load.c src/util/ge-ui-util.c src/data/ge-data.c src/widget/ge-thumb.c src/util/ge-db-update.c src/util/ge-file-util.c src/view/ge-main-view.c src/widget/ge-tile.c src/widget/ge-nocontent.c src/widget/ge-button.c src/data/ge-local-data.c src/view/ge-gridview.c src/util/ge-lang.c src/util/ge-debug.c src/view/ge-timeline.c
# EDC Sources
USER_EDCS =
USER_POS = res/po/ar.po res/po/az.po res/po/bg.po res/po/ca.po res/po/cs.po res/po/da.po res/po/de.po res/po/el_GR.po res/po/en_PH.po res/po/en.po res/po/en_US.po res/po/es_ES.po res/po/es_US.po res/po/et.po res/po/eu.po res/po/fi.po res/po/fr_CA.po res/po/fr.po res/po/ga.po res/po/gl.po res/po/hr.po res/po/hu.po res/po/hy.po res/po/is.po res/po/it_IT.po res/po/ja_JP.po res/po/ka.po res/po/kk.po res/po/ko_KR.po res/po/lt.po res/po/lv.po res/po/mk.po res/po/nb.po res/po/nl.po res/po/pl.po res/po/pt_BR.po res/po/pt_PT.po res/po/ro.po res/po/ru_RU.po res/po/sk.po res/po/sl.po res/po/sr.po res/po/sv.po res/po/tr_TR.po res/po/uk.po res/po/uz.po res/po/zh_CN.po res/po/zh_HK.po res/po/zh_TW.po
# User Defines
-USER_DEFS = PREFIX='"/home/owner/apps_rw/org.tizen.ug-gallery-efl"' _USE_SECURE_LOG_ _USE_DLOG_
+USER_DEFS = PREFIX='"/home/owner/apps_rw/org.tizen.ug-gallery-efl"' _USE_SECURE_LOG_ _USE_DLOG_
USER_CPP_DEFS =
# User Undefines
data/ge-local-data.c
util/ge-db-update.c
util/ge-debug.c
- util/ge-exif.c
util/ge-ext-exec.c
util/ge-ext-ug-load.c
util/ge-file-util.c
view/ge-main-view.c
widget/ge-button.c
widget/ge-nocontent.c
- widget/ge-rotate-bg.c
widget/ge-thumb.c
view/ge-albums.c
widget/ge-tile.c
ADD_DEFINITIONS("-D_USE_DLOG_")
ADD_DEFINITIONS("-D_USE_SECURE_LOG_")
-ADD_DEFINITIONS("-D_USE_ROTATE_BG_GE")
ADD_DEFINITIONS("-DLOCALEDIR=\"${LOCALEDIR}\"")
ADD_DEFINITIONS("-DPACKAGE=\"${PROJECT_NAME}\"")
ADD_DEFINITIONS("-DPREFIX=\"${CMAKE_INSTALL_PREFIX}\"")
#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)
{
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_main_create_view(ugd);
return 0;
}
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)) {
+ 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;
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);
- return 0;
-}
-
/* analysis parameters */
static int _ge_parse_param(ge_ugdata *ugd, app_control_h service)
{
app_control_get_operation(service, &operation);
ge_sdbg("operation [%s]", operation);
- app_control_get_extra_data(service, APP_CONTROL_DATA_SELECTION_MODE,
- &select_mode);
ugd->limitsize = -1;
int ret = 0;
char *max_size = NULL;
ugd->limitsize = _ge_atoi(max_size);
GE_FREE(max_size);
}
+ app_control_get_extra_data(service, APP_CONTROL_DATA_SELECTION_MODE,
+ &select_mode);
if (select_mode) {
+ ge_sdbg("select_mode [%s]", 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)) {
}
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)) {
+ 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 */
} 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_FREE(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_dbgW("Gallery UG start...");
ugd = (ge_ugdata *)priv;
- // ugd->ug = ug;
- ugd->attach_panel_display_mode = ATTACH_PANEL_NONE;
/* Get window */
ugd->win = elm_win_util_standard_add("ug-gallery-efl", "ug-gallery-efl");
_ge_db_update_reg_cb(ugd);
/* Parse parameters passed from parent */
- ugd->is_attach_panel = false;
-
if (ugd->overlap_mode) {
ugd->b_hide_indicator = true;
} else if (ugd->b_hide_indicator) {
ge_dbg("");
GE_CHECK(priv);
ge_ugdata *ugd = (ge_ugdata *)priv;
- /*update*/
- if (ugd->file_select_mode != GE_FILE_SELECT_T_SLIDESHOW) {
-// ge_update_view(ugd);
- }
}
/**
ui_app_exit();
return;
}
- if ((ugd->file_select_mode != GE_FILE_SELECT_T_NONE) ||
- (ugd->album_select_mode != GE_ALBUM_SELECT_T_NONE)) {
+ if ((ugd->file_select_mode != GE_FILE_SELECT_T_NONE)) {
/* create gallery UG */
if (_ge_create_view(ugd) != 0) {
ge_dbgE("Failed to create Gallery UG view!");
+++ /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
-
return;
}
- 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;
}
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) {
+ 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");
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;
- }
+ 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);
}
ui_app_exit();
} 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) {
+ 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(reply,
- GE_FILE_SELECT_RETURN_COUNT, t_str);
+ GE_FILE_SELECT_RETURN_COUNT, t_str);
app_control_add_extra_data(reply, GE_FILE_SELECT_RETURN_PATH,
- paths);
+ paths);
app_control_add_extra_data_array(reply, APP_CONTROL_DATA_SELECTED,
- (const char **)path_array, sel_cnt);
+ (const char **)path_array, sel_cnt);
app_control_add_extra_data_array(reply, APP_CONTROL_DATA_PATH,
- (const char **)path_array, sel_cnt);
+ (const char **)path_array, sel_cnt);
app_control_is_reply_requested(ugd->service, &reply_requested);
if (reply_requested) {
ge_sdbg("send reply to caller");
#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"
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);
- bool reply_requested;
- app_control_is_reply_requested(ugd->service, &reply_requested);
- if (reply_requested) {
- ge_sdbg("send reply to caller");
- app_control_h reply = NULL;
- app_control_create(&reply);
- app_control_add_extra_data(reply, GE_ALBUM_SELECT_RETURN_PATH, album->cluster->path);
- app_control_reply_to_launch_request(reply, ugd->service, APP_CONTROL_RESULT_SUCCEEDED);
- app_control_destroy(reply);
- }
- if (ugd->service) {
- app_control_destroy(ugd->service);
- ugd->service = NULL;
- }
- ui_app_exit();
- return 0;
- }
-
/* Add thumbnails view */
_ge_grid_create_thumb(album);
ge_dbg("Done");
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
+elm_bg_file_set(bg, bg_path, NULL);
+
return ret_val;
}
__ge_albums_unrealized, ugd);
evas_object_smart_callback_add(grid, "realized", __ge_albums_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_grid_move_stop_cb, ugd);
- evas_object_smart_callback_add(grid, "scroll,drag,stop",
- _ge_grid_move_stop_cb, ugd);
- }
if (__ge_albums_append_albums(ugd, grid, false) != 0) {
ge_dbgW("Failed to append album items!");
#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"
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);
- app_control_reply_to_launch_request(app_control, app_data->service, APP_CONTROL_RESULT_SUCCEEDED);
- }
- app_control_destroy(app_control);
- }
- }
/* Check album is created or not */
ge_sel_album_s *salbum = NULL;
app_data->selsize = 0;
- 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);
- app_control_reply_to_launch_request(app_control, app_data->service, APP_CONTROL_RESULT_SUCCEEDED);
- }
- app_control_destroy(app_control);
- }
- }
-
/* Check album is created or not */
ge_sel_album_s *salbum = NULL;
Eina_List *l = NULL;
/* 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);
- }
+ evas_object_smart_callback_add(grid, "realized",
+ __ge_grid_realized, ugd);
_ge_ui_reset_scroller_pos(parent);
return -1;
}
-void _ge_grid_change_selection_mode(ge_ugdata *ugd, bool state)
-{
- ge_dbg("changing selection type ");
- 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);
- }
- }
- 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;
- }
-
- if (grid) {
- 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);
- } else {
- elm_scroller_movement_block_set(grid, ELM_SCROLLER_MOVEMENT_NO_BLOCK);
- }
- }
-}
-
void _ge_add_remove_done_button_cb(void *btn, void *data, bool add)
{
if (btn && data) {
+++ /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
#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"
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);
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);
#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
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();
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);
}