display: Replace struct state with the libsyscommon 57/297457/1
authorYoungjae Cho <y0.cho@samsung.com>
Fri, 18 Aug 2023 10:49:41 +0000 (19:49 +0900)
committerYoungjae Cho <y0.cho@samsung.com>
Fri, 18 Aug 2023 10:50:03 +0000 (19:50 +0900)
Change-Id: I38890b7b0d1610b718299c4960d4915604fb5b2d
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
plugins/iot-headed/display/core.c
plugins/mobile/display/core.c
plugins/tv/display/core.c
plugins/wearable/display/core.c
src/display/core.h
src/display/display-plugin.h

index 38fc6de..9a4e228 100644 (file)
@@ -56,7 +56,7 @@
 
 static enum device_ops_status status = DEVICE_OPS_STATUS_UNINIT;
 
-static struct state states[SYSCOMMON_DEVICED_DISPLAY_STATE_END] = {
+static struct syscommon_deviced_display_state_info states[SYSCOMMON_DEVICED_DISPLAY_STATE_END] = {
        { SYSCOMMON_DEVICED_DISPLAY_STATE_START,    "SYSCOMMON_DEVICED_DISPLAY_STATE_START",    NULL,          NULL,           NULL,          NULL            },
        { SYSCOMMON_DEVICED_DISPLAY_STATE_ON,   "SYSCOMMON_DEVICED_DISPLAY_STATE_ON",   NULL,          NULL,           NULL,          NULL            },
        { SYSCOMMON_DEVICED_DISPLAY_STATE_DIM,   "SYSCOMMON_DEVICED_DISPLAY_STATE_DIM",   NULL,          NULL,           NULL,          NULL            },
@@ -102,7 +102,7 @@ inline const struct syscommon_deviced_display_config* get_var_display_config()
        return &display_conf;
 }
 
-inline struct state* state_st(enum syscommon_deviced_display_state state)
+inline struct syscommon_deviced_display_state_info* state_st(enum syscommon_deviced_display_state state)
 {
        return &states[state];
 }
index b284434..7a29b74 100644 (file)
@@ -85,7 +85,7 @@ static struct display_backlight_ops *backlight_ops;
 
 static enum device_ops_status status = DEVICE_OPS_STATUS_UNINIT;
 
-static struct state states[SYSCOMMON_DEVICED_DISPLAY_STATE_END] = {
+static struct syscommon_deviced_display_state_info states[SYSCOMMON_DEVICED_DISPLAY_STATE_END] = {
        { SYSCOMMON_DEVICED_DISPLAY_STATE_START,    "SYSCOMMON_DEVICED_DISPLAY_STATE_START",    NULL,          NULL,           NULL,          NULL            },
        { SYSCOMMON_DEVICED_DISPLAY_STATE_ON,   "SYSCOMMON_DEVICED_DISPLAY_STATE_ON",   NULL,          NULL,           NULL,          NULL            },
        { SYSCOMMON_DEVICED_DISPLAY_STATE_DIM,   "SYSCOMMON_DEVICED_DISPLAY_STATE_DIM",   NULL,          NULL,           NULL,          NULL            },
@@ -131,7 +131,7 @@ inline const struct syscommon_deviced_display_config* get_var_display_config()
        return &display_conf;
 }
 
-inline struct state* state_st(enum syscommon_deviced_display_state state)
+inline struct syscommon_deviced_display_state_info* state_st(enum syscommon_deviced_display_state state)
 {
        return &states[state];
 }
index 80f1cbd..4d1080a 100644 (file)
@@ -83,7 +83,7 @@ static struct display_backlight_ops *backlight_ops;
 
 static enum device_ops_status status = DEVICE_OPS_STATUS_UNINIT;
 
-static struct state states[SYSCOMMON_DEVICED_DISPLAY_STATE_END] = {
+static struct syscommon_deviced_display_state_info states[SYSCOMMON_DEVICED_DISPLAY_STATE_END] = {
        { SYSCOMMON_DEVICED_DISPLAY_STATE_START,    "SYSCOMMON_DEVICED_DISPLAY_STATE_START",    NULL,          NULL,           NULL,          NULL            },
        { SYSCOMMON_DEVICED_DISPLAY_STATE_ON,   "SYSCOMMON_DEVICED_DISPLAY_STATE_ON",   NULL,          NULL,           NULL,          NULL            },
        { SYSCOMMON_DEVICED_DISPLAY_STATE_DIM,   "SYSCOMMON_DEVICED_DISPLAY_STATE_DIM",   NULL,          NULL,           NULL,          NULL            },
@@ -129,7 +129,7 @@ inline const struct syscommon_deviced_display_config* get_var_display_config()
        return &display_conf;
 }
 
-inline struct state* state_st(enum syscommon_deviced_display_state state)
+inline struct syscommon_deviced_display_state_info* state_st(enum syscommon_deviced_display_state state)
 {
        return &states[state];
 }
index a48383c..fc5e4f8 100644 (file)
@@ -106,7 +106,7 @@ static bool lcdon_broadcast = true;
 static int default_trans(int evt);
 static int default_action(int timeout);
 
-static struct state states[SYSCOMMON_DEVICED_DISPLAY_STATE_END] = {
+static struct syscommon_deviced_display_state_info states[SYSCOMMON_DEVICED_DISPLAY_STATE_END] = {
        { SYSCOMMON_DEVICED_DISPLAY_STATE_START,    "SYSCOMMON_DEVICED_DISPLAY_STATE_START",    NULL,          NULL,           NULL,          NULL            },
        { SYSCOMMON_DEVICED_DISPLAY_STATE_ON,   "SYSCOMMON_DEVICED_DISPLAY_STATE_ON",   default_trans, default_action, NULL,          NULL            },
        { SYSCOMMON_DEVICED_DISPLAY_STATE_DIM,   "SYSCOMMON_DEVICED_DISPLAY_STATE_DIM",   default_trans, default_action, NULL,          NULL            },
@@ -154,7 +154,7 @@ inline const struct syscommon_deviced_display_config *get_var_display_config()
        return &display_conf;
 }
 
-inline struct state *state_st(enum syscommon_deviced_display_state state)
+inline struct syscommon_deviced_display_state_info *state_st(enum syscommon_deviced_display_state state)
 {
        return &states[state];
 }
@@ -352,7 +352,7 @@ static inline bool check_lcd_is_on(void)
 
 static gboolean timer_refresh_cb(gpointer data)
 {
-       struct state *st;
+       struct syscommon_deviced_display_state_info *st;
        int v, ret;
 
        ret = vconf_get_int(VCONFKEY_HOMESCREEN_WATCHFACE_VISIBILITY, &v);
@@ -382,7 +382,7 @@ static gboolean timer_refresh_cb(gpointer data)
 
 int custom_lcdon(int timeout)
 {
-       struct state *st;
+       struct syscommon_deviced_display_state_info *st;
        int ret, update;
        int tutorial = 0;
 
@@ -423,7 +423,7 @@ int custom_lcdon(int timeout)
 
 int custom_lcdoff(enum device_flags flag)
 {
-       struct state *st;
+       struct syscommon_deviced_display_state_info *st;
 
        if (display_lock_is_state_locked(SYSCOMMON_DEVICED_DISPLAY_STATE_ON) || display_lock_is_state_locked(SYSCOMMON_DEVICED_DISPLAY_STATE_DIM)) {
                /*
@@ -461,7 +461,7 @@ int custom_lcdoff(enum device_flags flag)
 
 int display_on_by_reason(const char *reason, int timeout)
 {
-       struct state *st;
+       struct syscommon_deviced_display_state_info *st;
        int flag;
        int str_len;
 
@@ -502,7 +502,7 @@ int display_on_by_reason(const char *reason, int timeout)
 
 int display_off_by_reason(const char *reason)
 {
-       struct state *st;
+       struct syscommon_deviced_display_state_info *st;
        int flag;
        int str_len;
 
@@ -600,7 +600,7 @@ static int default_proc_change_state(unsigned int cond, pid_t pid)
  */
 static int default_trans(int evt)
 {
-       struct state *st = &states[get_pm_cur_state()];
+       struct syscommon_deviced_display_state_info *st = &states[get_pm_cur_state()];
        int ret;
        enum syscommon_deviced_display_state next_state;
 
index 7122cf6..3d87ad4 100644 (file)
 #define MAX_LOG_COUNT 250
 #endif
 
-/*
- * @brief State structure
- */
-struct state {
-       enum syscommon_deviced_display_state state;           /**< state number */
-       const char *name;                   /**< state name (string) */
-       int (*trans) (int evt);       /**< transition function pointer */
-       int (*action) (int timeout);  /**< enter action */
-       int (*check) (int curr, int next); /**< transition check function */
-       GSourceFunc timeout_cb;
-       int timeout;
-};
-
-struct state *state_st(enum syscommon_deviced_display_state state);
+struct syscommon_deviced_display_state_info *state_st(enum syscommon_deviced_display_state state);
 
 /*
  * Global variables
@@ -79,7 +66,7 @@ typedef struct {
        unsigned int timeout2;
 } PMMsg;
 
-extern struct state state[SYSCOMMON_DEVICED_DISPLAY_STATE_END];
+extern struct syscommon_deviced_display_state_info state[SYSCOMMON_DEVICED_DISPLAY_STATE_END];
 
 /* setting.c */
 int get_lock_screen_bg_state(void);
index d690e1d..a543a5e 100644 (file)
@@ -77,7 +77,7 @@ struct display_plugin {
 
        struct syscommon_deviced_display_config *config;
        struct display_backlight_ops *backlight;
-       struct state* display_states[SYSCOMMON_DEVICED_DISPLAY_STATE_END];
+       struct syscommon_deviced_display_state_info* display_states[SYSCOMMON_DEVICED_DISPLAY_STATE_END];
 };
 extern struct display_plugin g_display_plugin;