From: junkyu han Date: Fri, 28 Apr 2017 10:25:02 +0000 (+0900) Subject: boot-animation can be build on TEST_APP mode X-Git-Tag: submit/tizen/20170428.120608^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F10%2F127710%2F5;p=apps%2Fnative%2Fboot-animation.git boot-animation can be build on TEST_APP mode Change-Id: I3a836d96530467d87ce4b3d88279fed2e815bec4 --- diff --git a/CMakeLists.txt b/CMakeLists.txt index b0e6fd8..e75da1b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,9 +1,32 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.6) PROJECT(boot-animation C) +INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/inc) SET(SRCS src/boot.c src/animation.c + + test/feature_test/feature_test.c + test/feature_test/group_feature_on_off_animation.c + + test/function_test/function_test.c + test/function_test/group_function_animation.c + + test/unit/unit_assert.c + test/unit/unit.c + test/unit/unit_group.c + test/unit/unit_log_buf.c + test/unit/unit_result.c + test/unit/unit_test/unit_test_append_log/unit_test_append_log.c + test/unit/unit_test/unit_test_assert_test/unit_test_assert.c + test/unit/unit_test/unit_test_function_test/unit_test_function.c + test/unit/unit_test/unit_test_function_test/unit_test_group_function.c + test/unit/unit_test/unit_test_function_test/unit_test_log_buf_function.c + test/unit/unit_test/unit_test_function_test/unit_test_unit_function.c + test/unit/unit_test/unit_test_group_test/unit_test_group.c + test/unit/unit_test/unit_test_group_test/unit_test_group_result.c + test/unit/unit_test/unit_test_main.c + test/test_main.c ) INCLUDE(FindPkgConfig) @@ -18,6 +41,8 @@ pkg_check_modules(pkgs REQUIRED capi-system-info capi-system-system-settings capi-ui-efl-util + dlog + capi-appfw-application ) FOREACH(flag ${pkgs_CFLAGS}) @@ -35,7 +60,6 @@ SET(CMAKE_C_FLAGS_CCOV "-O2 -g --coverage -fPIE") SET(CMAKE_CXX_FLAGS_CCOV "-O2 std=c++0x -g --coverage -fPIE") SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -pie") -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/inc) ADD_DEFINITIONS("-DPREFIX=\"${CMAKE_INSTALL_PREFIX}\"") ADD_EXECUTABLE(${PROJECT_NAME} ${SRCS}) diff --git a/inc/animation.h b/inc/animation.h index 92035cf..a7cd7c1 100644 --- a/inc/animation.h +++ b/inc/animation.h @@ -15,6 +15,9 @@ * */ +#ifndef __BOOT_ANIMATION__ +#define __BOOT_ANIMATION__ + #include int init_animation(int state); @@ -23,3 +26,5 @@ Evas_Object *create_layout(Evas_Object *win, const char *file_name); Evas_Object *create_window(void); char *get_layout_file_name(int state, int w, int h); Eina_Bool is_layout_file_exist(const char *file_name); + +#endif diff --git a/inc/app_log.h b/inc/app_log.h index ac49bed..0a160a3 100644 --- a/inc/app_log.h +++ b/inc/app_log.h @@ -5,34 +5,37 @@ #include "test.h" -#ifndef LOG_TAG +#undef LOG_TAG #define LOG_TAG "BOOT_ANIMATION" -#endif #ifndef __MODULE__ #define __MODULE__ (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__) #endif -#define LOG_(prio, tag, fmt, arg...) ({ dlog_print(prio, tag, "%s: %s(%d) > " fmt, __MODULE__, __func__, __LINE__, ##arg); }) +#undef __LOG +#define __LOG(prio, tag, fmt, arg...) ({ dlog_print(prio, tag, "%s: %s(%d) > " fmt, __MODULE__, __func__, __LINE__, ##arg); }) #if (TEST_MODE == TEST_UNIT) +#include "../test/unit/inc/unit.h" #define TEST_APP_LOG_TAG "TEST_APP" #define TEST_UNIT_LOG_TAG "TEST_UNIT" -#define __D(format, arg...) LOG_(DLOG_DEBUG, LOG_TAG, format, ##arg) -#define __I(format, arg...) LOG_(DLOG_INFO, LOG_TAG, format, ##arg) -#define __E(format, arg...) LOG_(DLOG_ERROR, LOG_TAG, format, ##arg) +#define __D(format, arg...) __LOG(DLOG_DEBUG, LOG_TAG, format, ##arg) +#define __I(format, arg...) __LOG(DLOG_INFO, LOG_TAG, format, ##arg) +#define __E(format, arg...) __LOG(DLOG_ERROR, LOG_TAG, format, ##arg) #define __T(format, arg...) ({ dlog_print(DLOG_DEBUG, TEST_APP_LOG_TAG, format, ##arg); unit_write_log(format, ##arg); }) -#define __TU(format, arg...) LOG_(DLOG_DEBUG, TEST_UNIT_LOG_TAG, format, ##arg) +#define __TU(format, arg...) __LOG(DLOG_DEBUG, TEST_UNIT_LOG_TAG, format, ##arg) #elif (TEST_MODE == TEST_APP) +#include "../test/unit/inc/unit.h" #define TEST_APP_LOG_TAG "TEST_APP" #define __D(format, arg...) ({ dlog_print(DLOG_DEBUG, LOG_TAG, format, ##arg); unit_write_log(format, ##arg); }) -#define __I(format, arg...) LOG_(DLOG_INFO, LOG_TAG, format, ##arg) -#define __E(format, arg...) LOG_(DLOG_ERROR, LOG_TAG, format, ##arg) -#define __T(format, arg...) LOG_(DLOG_DEBUG, TEST_APP_LOG_TAG, format, ##arg) +#define __I(format, arg...) __LOG(DLOG_INFO, LOG_TAG, format, ##arg) +#define __E(format, arg...) __LOG(DLOG_ERROR, LOG_TAG, format, ##arg) +#define __T(format, arg...) __LOG(DLOG_DEBUG, TEST_APP_LOG_TAG, format, ##arg) #else -#define __D(format, arg...) LOG_(DLOG_DEBUG, LOG_TAG, format, ##arg) -#define __I(format, arg...) LOG_(DLOG_INFO, LOG_TAG, format, ##arg) -#define __E(format, arg...) LOG_(DLOG_ERROR, LOG_TAG, format, ##arg) +#include +#define __D(format, arg...) ({__LOG(DLOG_DEBUG, LOG_TAG, format, ##arg); printf(format"\n", ##arg); }) +#define __I(format, arg...) __LOG(DLOG_INFO, LOG_TAG, format, ##arg) +#define __E(format, arg...) __LOG(DLOG_ERROR, LOG_TAG, format, ##arg) #endif #endif diff --git a/inc/avsys.h b/inc/avsys.h deleted file mode 100755 index 8bf1123..0000000 --- a/inc/avsys.h +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2009-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. - * - */ - -extern int init_avsys(void); -extern int play_avsys(int type); -extern int cleanup_avsys(void); -extern int fini_avsys(void); diff --git a/inc/boot.h b/inc/boot.h index 73909c6..1d77672 100644 --- a/inc/boot.h +++ b/inc/boot.h @@ -15,6 +15,9 @@ * */ +#ifndef __BOOT_H__ +#define __BOOT_H__ + #ifndef PREFIX #define PREFIX "/usr" #endif @@ -64,3 +67,4 @@ enum { extern void(*boot_exit)(void); +#endif diff --git a/inc/log.h b/inc/log.h deleted file mode 100644 index 1820203..0000000 --- a/inc/log.h +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) 2009-2015 Samsung Electronics Co., Ltd All Rights Reserved - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#include - -#undef LOG_TAG -#define LOG_TAG "BOOT_ANIMATION" - -#ifndef __MODULE__ -#define __MODULE__ (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__) -#endif - -#define LOG_V(prio, tag, fmt, arg...) \ - ({ do { \ - dlog_print(prio, tag, "%s: %s(%d) > " fmt, __MODULE__, __func__, __LINE__, ##arg);\ - } while (0); }) - -#define _D(format, arg...) LOG_V(DLOG_DEBUG, LOG_TAG, format, ##arg) -#define _I(format, arg...) LOG_V(DLOG_INFO, LOG_TAG, format, ##arg) -#define _W(format, arg...) LOG_V(DLOG_WARN, LOG_TAG, format, ##arg) -#define _E(format, arg...) LOG_V(DLOG_ERROR, LOG_TAG, format, ##arg) -#define _F(format, arg...) LOG_V(DLOG_FATAL, LOG_TAG, format, ##arg) diff --git a/inc/wav_parser.h b/inc/wav_parser.h deleted file mode 100755 index 68865c4..0000000 --- a/inc/wav_parser.h +++ /dev/null @@ -1,212 +0,0 @@ -/* - * Copyright (c) 2009-2015 Samsung Electronics Co., Ltd All Rights Reserved - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#define __PACK __attribute__((packed)) - -typedef struct chunk_header { - char chunkID[4]; - long chunkSize; -} chunk_header; - -#define RIFFID "RIFF" -#define WAVEID "WAVE" - -typedef struct { - char type[4]; /* WAVE */ -} __PACK RIFFChunk; - -/* FMT Sub chunk */ -#define FormatID "fmt " -typedef struct { - short wFormatTag; /* other than 1, compressed */ - unsigned short wChannels; - unsigned long dwSamplesPerSec; /* 11025, 22050, 44100 Khz ... */ - unsigned long dwAvBytesPerSec; /* dwSamplesPerSec * wBlockAlign */ - - /* 16-bit mono wave = 2 Bytes */ - /* 16-bit stereo wave = 4 Bytes */ - /* wChannels * (wBitsPerSample / 8) == Size of a sample frame, in terms of byte */ - unsigned short wBlockAlign; - unsigned short wBitsPerSample; /* 16-bit waveform would have 16 */ - - /* NOTE: Depends on wFormatTag, here could be more fields exists */ - -} __PACK FormatChunk; - -enum FORMAT { - IBM_FORMAT_MULAW = 0x0101, - IBM_FORMAT_ALAW = 0x0102, - IBM_FORMAT_ADPCM = 0x0103, -}; - -enum CHANNELS { - MONOPHONIC = 1, - STEREO = 2, - FOR_CHANNEL = 4, - /* ... ( 0x1 << nr of channels ) */ -}; - -#define DataID "DATA" - -typedef struct { - unsigned char waveformData[1]; -} __PACK DataChunk; - -typedef struct { - long dwIdentifier; - long dwPosition; - unsigned long fccChunk; - long dwChunkStart; - long dwBlockStart; - long dwSampleOffset; -} __PACK CuePoint; - -#define CueID "cue " - -typedef struct { - long dwCuePoints; - CuePoint points[]; -} __PACK CueChunk; - -typedef struct { - long dwIdentifier; - long dwLength; - long dwRepeats; -} __PACK Segment; - -#define PlaylistID "plst" - -typedef struct { - long dwSegments; - Segment Segments[]; -} __PACK PlaylistChunk; - -typedef struct { - unsigned long typeID; -} __PACK ListHeader; - -#define LabelID "labl" -typedef struct { - long dwIdentifier; - char dwText[]; -} __PACK LabelChunk; - -#define NoteID "note" -typedef struct { - long dwIdentifier; - char dwText[]; -} __PACK NoteChunk; - -#define LabelTextID "ltxt" -typedef struct { - long dwIdentifier; - long dwSampleLength; - long dwPurpose; - short wCountry; - short wLanguage; - short wDialect; - short wCodePage; - char dwText[]; -} __PACK LabelTextChunk; - -#define SamplerID "smpl" - -typedef struct { - long dwIdentifier; - long dwType; - long dwStart; - long dwEnd; - long dwFraction; - long dwPlayCount; -} __PACK SampleLoop; - -typedef struct { - long dwManufacturer; - long dwProduct; - long dwSamplePeriod; - long dwMIDIUnityNote; - long dwMIDIPitchFraction; - long dwSMPTEFormat; - long dwSMPTEOffset; - long cSampleLoops; - long cbSamplerData; - SampleLoop Loops[]; -} __PACK SamplerChunk; - -enum SMPTE { - FRAME24 = 24, - FRAME25 = 25, - FRAME30_WITH_DROP = 29, - FRAME30 = 30, -}; - -enum LOOP_TYPE { - FORWARD_LOOP = 0, - ALTERNATE_LOOP = 1, - BACKWARD_LOOP = 2, -}; - -#define InstrumentID "inst" -typedef struct { - unsigned char UnshiftedNote; - char FineTune; - char Gain; - unsigned char LowNote; - unsigned char HighNote; - unsigned char LowVelocity; - unsigned char HighVelocity; -} __PACK InstrumentChunk; - -#define ListID "list" -typedef struct { - char typeID[4]; - char text[]; -} __PACK ListChunk; - -#define FactID "fact" -typedef struct { - char data[1]; -} __PACK FactChunk; - -struct wave { - char *filename; - int fd; - - chunk_header riff_header; - off_t riff_off; - /* RIFFChunk *riff; */ - - chunk_header fmt_header; - off_t fmt_off; - /* FormatChunk *format; */ - - chunk_header data_header; - off_t data_off; - /* DataChunk *data; */ - - chunk_header list_header; - off_t list_off; - /* ListChunk *list; */ -}; - -extern struct wave *open_wave_file(const char *filename); -extern int get_wave_channel(struct wave *handle); -extern int get_wave_samples_per_sec(struct wave *handle); -extern int get_wave_bits_per_sample(struct wave *handle); -extern int get_wave_data_size(struct wave *handle); -extern int get_wave_data(struct wave *handle, void *data, int off, int size); -extern void close_wave_file(struct wave *handle); diff --git a/inc/wav_player.h b/inc/wav_player.h deleted file mode 100755 index 99b1f84..0000000 --- a/inc/wav_player.h +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright (c) 2009-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. - * - */ - -enum running_state { - STATE_UNKNOWN = 0x00, - STATE_READY = 0x01, - STATE_PLAY = 0x02, -}; - -struct player { - /* initializer will be invoked when the player is ready to play wave file. */ - /* normally, it is invoked at right after complete the format header loading */ - int (*init) (struct player * player, struct wave * handle); - /* Play if if is ready, normaly, this callback can - be invoked after the format header is loaded. */ - int (*play) (struct player * player, struct wave * handle); - /* After parsing all chunks in the wave file, this function will be invoked */ - int (*fini) (struct player * player); - - void *data; - enum running_state state; -}; - -extern struct player *create_player(void); -extern int set_player_initializer(struct player *player, - int (*init) (struct player * player, - struct wave * handle)); -extern int set_player_player(struct player *player, - int (*play) (struct player * player, - struct wave * handle)); -extern int set_player_finalizer(struct player *player, - int (*fini) (struct player * player)); -extern int init_player(struct player *player, struct wave *handle, void *data); -extern int play_player(struct player *player, struct wave *handle); -extern int fini_player(struct player *player); -extern void destroy_player(struct player *player); diff --git a/packaging/boot-animation.spec b/packaging/boot-animation.spec index 7dfc9ec..5486a39 100644 --- a/packaging/boot-animation.spec +++ b/packaging/boot-animation.spec @@ -23,6 +23,8 @@ BuildRequires: pkgconfig(capi-appfw-preference) BuildRequires: pkgconfig(capi-system-info) BuildRequires: pkgconfig(capi-system-system-settings) BuildRequires: pkgconfig(capi-ui-efl-util) +BuildRequires: pkgconfig(dlog) +BuildRequires: pkgconfig(capi-appfw-application) Requires: boot-animation-sound-file Recommends: boot-animation-sound-file-profile_common Requires(post): /usr/bin/vconftool diff --git a/src/animation.c b/src/animation.c index 6662a75..f633a0e 100644 --- a/src/animation.c +++ b/src/animation.c @@ -32,7 +32,7 @@ #include "boot.h" #include "animation.h" -#include "log.h" +#include "app_log.h" #define OVER_COUNT 19 @@ -58,7 +58,7 @@ static struct animation { static void win_del(void *data, Evas_Object * obj, void *event_info) { - _D("Window delete event received"); + __D("Window delete event received"); elm_exit(); } @@ -78,18 +78,22 @@ static Eina_Bool __end_cb(void *data) int type = (int) data; if (type == TYPE_OFF) { - _D("EXIT on SHUTDOWN"); + __D("EXIT on SHUTDOWN"); /* Delete Previous Layout */ if (s_animation.layout) { evas_object_del(s_animation.layout); s_animation.layout = NULL; } + /* boot-animation do not terminate on shutdown, so flush log now */ + fflush(stdout); + close(1); + __block_display(); } else { - _D("EXIT on BOOTING"); + __D("EXIT on BOOTING"); if (vconf_set_int(VCONFKEY_BOOT_ANIMATION_FINISHED, 1) != 0) { - _E("Failed to set finished set"); + __E("Failed to set finished set"); } boot_exit(); } @@ -99,13 +103,13 @@ static Eina_Bool __end_cb(void *data) static void __animation_finished_cb(void *d, Evas_Object * obj, const char *e, const char *s) { if (s_animation.state == TYPE_OFF) { - _D("TYPE OFF"); + __D("TYPE OFF"); if (vconf_set_int(VCONFKEY_BOOT_ANIMATION_FINISHED, 1) != 0) { - _E("Failed to set finished set"); + __E("Failed to set finished set"); } ecore_timer_add(1, __end_cb, (void *)TYPE_OFF); } else { - _D("TYPE_ON"); + __D("TYPE_ON"); __end_cb((void *)TYPE_ON); } } @@ -130,15 +134,13 @@ static void __fini_layout(void) Evas_Object *create_window(void) { - _D("Create Window"); - printf("Create Window\n"); + __D("Create Window"); Evas_Object *win; win = elm_win_add(NULL, "BOOT_ANIMATION", ELM_WIN_NOTIFICATION); if (!win) { - _E("Failed to create a new window"); - printf("Failed to create a new window\n"); + __E("Failed to create a new window"); return NULL; } elm_win_aux_hint_add(win, "wm.comp.win.always.selective.mode", "1"); @@ -165,12 +167,12 @@ char *get_layout_file_name(int state, int w, int h) } else { snprintf(file_name, sizeof(file_name), FILE_PATH"%dx%d_PowerOn.edj", w, h); } - _D("File name for Animation is: %s", file_name); + __D("File name for Animation is: %s", file_name); ret = access(file_name, 0); if (ret == 0) { } else { - _W("There's no Image same with [%s], So set Default[720x1280] image", file_name); + __E("There's no Image same with [%s], So set Default[720x1280] image", file_name); if (state == TYPE_OFF) { snprintf(file_name, sizeof(file_name), "%s", DEFAULT_OFF); } else { @@ -179,7 +181,7 @@ char *get_layout_file_name(int state, int w, int h) ret = access(file_name, 0); if (ret) { - _E("There's no Image file[%s] on target", file_name); + __E("There's no Image file[%s] on target", file_name); return NULL; } } @@ -203,7 +205,7 @@ Evas_Object *create_layout(Evas_Object *win, const char *file_name) { Evas_Object *layout = elm_layout_add(win); if (!layout) { - _E("Failed to create layout"); + __E("Failed to create layout"); return NULL; } evas_object_size_hint_weight_set(layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); @@ -211,7 +213,7 @@ Evas_Object *create_layout(Evas_Object *win, const char *file_name) elm_layout_signal_callback_add(layout, "end", "animation", __animation_finished_cb, NULL); if (!elm_layout_file_set(layout, file_name, GRP_ANIM)) { - _E("Failed to layout file set"); + __E("Failed to layout file set"); return NULL; } @@ -222,34 +224,32 @@ Evas_Object *create_layout(Evas_Object *win, const char *file_name) int init_animation(int state) { - _D("Init animation"); - printf("Init animation\n"); + __D("Init animation"); s_animation.state = state; s_animation.win = create_window(); if (!s_animation.win) { - _E("Failed to create a new window"); - printf("Failed to create a new window\n"); + __E("Failed to create a new window"); return EXIT_FAILURE; } char *layout_file_name = NULL; layout_file_name = get_layout_file_name(state, s_animation.w, s_animation.h); if (!layout_file_name) { - _E("Failed to get layout file name"); + __E("Failed to get layout file name"); return EXIT_FAILURE; } if (!is_layout_file_exist(layout_file_name)) { - _E("This file is not exist"); + __E("This file is not exist"); free(layout_file_name); return EXIT_FAILURE; } s_animation.layout = create_layout(s_animation.win, layout_file_name); if (!s_animation.layout) { - _E("Failed to create layout"); + __E("Failed to create layout"); free(layout_file_name); evas_object_del(s_animation.win); return EXIT_FAILURE; diff --git a/src/boot.c b/src/boot.c index 6093dab..360839d 100644 --- a/src/boot.c +++ b/src/boot.c @@ -30,17 +30,14 @@ #include #include - #include - #include #include - #include #include "animation.h" #include "boot.h" -#include "log.h" +#include "app_log.h" #include "test.h" #define XRGB8888 4 @@ -57,7 +54,7 @@ void(*boot_exit)(void); static void print_usages(char *argv0) { - printf("Usage) %s {--start|--stop}\n" + __D("Usage) %s {--start|--stop}\n" " Ex:" " # %s --start\n" " # %s --stop\n" @@ -69,10 +66,10 @@ static void print_usages(char *argv0) /* Sound is not supported Since Tizen 4.0 */ static int get_wav_file(int state, char *wavpath) { - _D("Get wav file"); + __D("Get wav file"); if (state == TYPE_ON) { snprintf(wavpath, FILE_PATH_MAX-1, "%s", DEFAULT_POWERON_WAV); - _D("Wav file: %s", wavpath); + __D("Wav file: %s", wavpath); } else return -1; @@ -99,8 +96,7 @@ static int __check_on_off_type(void *user_data) argv = args->argv; for (i = 0; i < argc; i++) { - _D("argc %d [%s]", i, argv[i]); - printf("argc %d [%s]\n", i, argv[i]); + __D("argc %d [%s]", i, argv[i]); } while ((c = getopt_long(argc, argv, "sopc", long_options, NULL)) >= 0) { @@ -120,8 +116,7 @@ static int __check_on_off_type(void *user_data) break; default: type = TYPE_UNKNOWN; - _D("[Boot-ani] unknown arg [%s]", optarg); - printf("[Boot-anim] unknown arg [%s]\n", optarg); + __D("[Boot-ani] unknown arg [%s]", optarg); return EXIT_FAILURE; } } @@ -139,40 +134,35 @@ static int __prepare_animation(keynode_t * node, void *user_data) int soundon = 1; /* default sound on */ if (vconf_get_bool(VCONFKEY_SETAPPL_SOUND_STATUS_BOOL, &soundon) < 0) { - _D("VCONFKEY_SETAPPL_SOUND_STATUS_BOOL ==> FAIL!!"); - printf("VCONFKEY_SETAPPL_SOUND_STATUS_BOOL ==> FAIL!!\n"); + __D("VCONFKEY_SETAPPL_SOUND_STATUS_BOOL ==> FAIL!!"); } - _D("Sound status: %d", soundon); - printf("Sound status: %d\n", soundon); + __D("Sound status: %d", soundon); #endif int type = -1; type = __check_on_off_type(user_data); if (type < 0) { - _E("Failed to get on off type or UNKNOWN_TYPE: %d", type); + __E("Failed to get on off type or UNKNOWN_TYPE: %d", type); return EXIT_FAILURE; } if (init_animation(type) != EXIT_SUCCESS) { - _E("Exit boot-animation"); - printf("Exit boot-animation\n"); + __E("Exit boot-animation"); return EXIT_FAILURE; } #ifdef SOUND_PROFILE if (soundon) { - _D("Sound on!!"); - printf("Sound on!!\n"); + __D("Sound on!!"); if (!get_wav_file(type, wav_path)) { - _D("File path: %s", wav_path); - printf("File path: %s\n", wav_path); + __D("File path: %s", wav_path); mm_sound_boot_ready(3); mm_sound_boot_play_sound(wav_path); } } #endif - _D("EXIT SUCESS"); + __D("EXIT SUCESS"); return EXIT_SUCCESS; } @@ -199,7 +189,7 @@ static void _boot_ani_ui_set_scale(void) snprintf(buf, sizeof(buf), "%lf", root_height / BA_DEFAULT_WINDOW_H); //snprintf(buf, sizeof(buf), "%lf", root_width / BA_DEFAULT_WINDOW_W); - _D("Boot animation scale : [%s]", buf); + __D("Boot animation scale : [%s]", buf); setenv("ELM_SCALE", buf, 1); setenv("SCALE_FACTOR", buf, 1); @@ -233,15 +223,13 @@ int main(int argc, char *argv[]) close(1); fd = open("/tmp/myfile.txt", O_CREAT|O_RDWR, S_IRWXU|S_IRWXO); - _D("result of open: %d", fd); - printf("[%s/%s/%d] fd == %d\n", __FILE__, __func__, __LINE__, fd); + __D("Result of log file open: %d", fd); elm_init(argc, argv); boot_exit = elm_exit; if (vconf_set_int(VCONFKEY_BOOT_ANIMATION_FINISHED, 0) != 0) { - _D("Failed to set finished value to 0\n"); - printf("[%s/%s/%d] Failed to set finished value to 0\n", __FILE__, __func__, __LINE__); + __D("Failed to set finished value to 0\n"); } if (__prepare_animation(NULL, &args) != EXIT_SUCCESS) { vconf_set_int(VCONFKEY_BOOT_ANIMATION_FINISHED, 1);