/*****************************************************************************
** global variables
*****************************************************************************/
-const int x_offset_main_bg_text_pos = 518;
-const int y_offset_main_bg_text_pos = 300;
-const int x_offset_prog_bar_img_pos = 240;
-const int y_offset_prog_bar_img_pos = 355;
-int rotate_step = 0;
-int rollback_step = 0;
-int img_buf_width = 0;
-int img_buf_height = 0;
-
-FbInfo s_fbi;
-tdm_if_disp s_disp;
-
-int s_percent_to_draw = 0;
-int s_saved_percent = -1;
+static const int x_offset_main_bg_text_pos = 518;
+static const int y_offset_main_bg_text_pos = 300;
+static const int x_offset_prog_bar_img_pos = 240;
+static const int y_offset_prog_bar_img_pos = 355;
+static int rotate_step = 0;
+static int rollback_step = 0;
+static int img_buf_width = 0;
+static int img_buf_height = 0;
+
+static FbInfo s_fbi;
+static tdm_if_disp s_disp;
+
+static int s_percent_to_draw = 0;
+static int s_saved_percent = -1;
/*-----------------------------------------------------------------------------
fb_open()
#include "gui_general.h"
#include "gui_util.h"
#include "base_gui.h"
-
+/*
unsigned int __log_level__ =
(LOG_DEBUG | LOG_FLASH | LOG_FILE | LOG_FUNCS | LOG_GUI | LOG_SSENGINE | LOG_INFO);
+ */
FILE *__log_out_file__;
-int s_prog_percent = 0;
-int s_last_prog_percent = 0;
+static int s_prog_percent = 0;
+static int s_last_prog_percent = 0;
-int s_pid = -1;
+static int s_pid = -1;
static int wait_main(void)
{
#include "gui_general.h"
#include "fota_png.h"
-int png_img_width;
-int png_img_height;
+static int png_img_width;
+static int png_img_height;
/* clear screen based on img size */
//int png_img_width_batt_normal;
//int png_img_height_batt_normal;
-png_byte png_color_type;
-png_byte png_bit_depth;
+static png_byte png_color_type;
+static png_byte png_bit_depth;
-png_structp png_ptr;
-png_infop info_ptr;
-int number_of_passes;
-png_bytep *row_pointers;
+static png_structp png_ptr;
+static png_infop info_ptr;
+static int number_of_passes;
+static png_bytep *row_pointers;
/*-----------------------------------------------------------------------------
read_png_file()
#include <stdio.h>
-extern unsigned int __log_level__;
+//extern unsigned int __log_level__;
extern FILE *__log_out_file__;
#define LOG_INFO (1<<8)
#define LOG_PRFIX "FOTA_GUI"
#endif
+#define LOG_LEVEL (LOG_DEBUG | LOG_FLASH | LOG_FILE | LOG_FUNCS | LOG_GUI | LOG_SSENGINE | LOG_INFO)
+
+#define LOGL(mask, s, args...) do { if ((mask) & LOG_LEVEL) \
+ printf(LOG_PRFIX "/(%s): " s, __func__, ##args); } while (0)
+#define LOG(s, args...) LOGL(LOG_DEBUG, s, ##args)
+
#define DEBUG_STDOUT
//#define DEBUG_FILE
#ifdef DEBUG_STDOUT
#define LOGE(s, args...) printf(LOG_PRFIX "/ERROR(%s) " s, __func__, ##args) // Error log
-#define LOGL(mask, s, args...) do { if ((mask) & __log_level__) \
+#define LOGL(mask, s, args...) do { if ((mask) & LOG_LEVEL) \
printf(LOG_PRFIX "/(%s): " s, __func__, ##args); } while (0)
#define LOG(s, args...) LOGL(LOG_DEBUG, s, ##args)
#elif defined(DEBUG_FILE)
#define LOGE(s, args...) fprintf(__log_out_file__, LOG_PRFIX "/ERROR(%s) " s, __func__, ##args)
-#define LOGL(mask, s, args...) do { if ((mask) & __log_level__) \
+#define LOGL(mask, s, args...) do { if ((mask) & LOG_LEVEL) \
fprintf(__log_out_file__, LOG_PRFIX "/(%s): " s , __func__, ##args); } while (0)
#define LOG(s, args...) LOGL(LOG_DEBUG, s, ##args)
fprintf(__log_out_file__, LOG_PRFIX "/ERROR(%s) " s, __func__, ##args);\
} while (0)
#define LOGL(mask, s, args...) do { \
- if ((mask) & __log_level__) { \
+ if ((mask) & LOG_LEVEL) { \
printf(LOG_PRFIX "/(%s): " s , __func__, ##args);\
fprintf(__log_out_file__, LOG_PRFIX "/(%s): " s, __func__, ##args);\
} \
#include "gui_log.h"
-int s_fd_stdin = -1;
-int s_fd_stdout = -1;
-int s_fd_stderr = -1;
+static int s_fd_stdin = -1;
+static int s_fd_stdout = -1;
+static int s_fd_stderr = -1;
/*-----------------------------------------------------------------------------
set_default_stdio
BACK_BUFFER
} BUFFER_TYPE;
-extern tdm_if_disp s_disp;
+//extern tdm_if_disp s_disp;
int tdm_if_display_init(tdm_if_disp *st_disp);
void tdm_if_display_deinit(tdm_if_disp *st_disp);
/*****************************************************************************
** global variables
*****************************************************************************/
-FbInfo s_fbi;
-tdm_if_disp s_disp;
+static FbInfo s_fbi;
+static tdm_if_disp s_disp;
-int s_percent_to_draw = 0;
-int s_saved_percent = -1;
+static int s_percent_to_draw = 0;
+static int s_saved_percent = -1;
/*-----------------------------------------------------------------------------
fb_open()
//#define WAIT
//#undef WAIT
-
+/*
unsigned int __log_level__ =
(LOG_DEBUG | LOG_FLASH | LOG_FILE | LOG_FUNCS | LOG_GUI | LOG_SSENGINE | LOG_INFO);
+*/
FILE *__log_out_file__;
-int s_prog_percent = 0;
-int s_last_prog_percent = 0;
+static int s_prog_percent = 0;
+static int s_last_prog_percent = 0;
-int s_pid = -1;
+static int s_pid = -1;
static int wait_main_fota_ro(void)
{
#define FILE_IO_BUF_SIZE 128
#define CHG_ENV_BATT_STATUS "/sys/class/power_supply/battery/status"
-FbInfo fbi;
+static FbInfo fbi;
+static common_disp s_disp;
static pthread_t keyevent_thread;
#include <libintl.h> // dgettext
-CairoInfo cairoinfo;
+static CairoInfo cairoinfo;
#define DEFAULT_FONT "SamsungOneUI"
#define TEXT_COLOR 1, 1, 1 /* #12b4ff */
#define TEXT_FONT_SIZE_MAX 32
#define TEXT_FONT_SIZE_MIN 16
-cairo_surface_t *img_surf_main = NULL;
-cairo_surface_t *img_surf_popup = NULL;
-cairo_surface_t *img_surf_main_txt = NULL;
-cairo_surface_t *img_surf_prog[PROGRESS_IMG_CNT] = {NULL,};
-cairo_surface_t *img_surf_num[PROGRESS_NUM_CNT] = {NULL,};
-cairo_surface_t *img_surf_slash = NULL;
+static cairo_surface_t *img_surf_main = NULL;
+static cairo_surface_t *img_surf_popup = NULL;
+static cairo_surface_t *img_surf_main_txt = NULL;
+static cairo_surface_t *img_surf_prog[PROGRESS_IMG_CNT] = {NULL,};
+static cairo_surface_t *img_surf_num[PROGRESS_NUM_CNT] = {NULL,};
+static cairo_surface_t *img_surf_slash = NULL;
-int main_img_x = 0;
-int main_img_y = 0;
-int main_img_w = 0;
-int main_img_h = 0;
+static int main_img_x = 0;
+static int main_img_y = 0;
+static int main_img_w = 0;
+static int main_img_h = 0;
#define BG_COLOR 0.0, 0.0, 0.0
#define MAX_BUF_LEN 512
-char s_rw_process_msg1[MAX_BUF_LEN];
-char s_rw_process_msg2[MAX_BUF_LEN];
-int s_bnewline = 0;
+static char s_rw_process_msg1[MAX_BUF_LEN];
+static char s_rw_process_msg2[MAX_BUF_LEN];
+static int s_bnewline = 0;
static double s_text_x1 = 0.0;
static double s_text_x2 = 0.0;
static int s_font_sz = 0.0;
-int s_font_initialized = 0;
+static int s_font_initialized = 0;
/*-----------------------------------------------------------------------------
cairo_update_screen()
CHG_DEGREE_270 = 3,
};
-extern common_disp s_disp;
+//extern common_disp s_disp;
int chg_common_display_init(common_disp *st_disp);
void chg_common_display_deinit(common_disp *st_disp);
#endif
#include "rw-update_new_common_display.h"
-common_disp s_disp;
+static common_disp s_disp;
/*-----------------------------------------------------------------------------
fb_open()