actually on reflection - doyoun - indicator mode should be like this.

SVN revision: 68432
This commit is contained in:
Carsten Haitzler 2012-02-25 05:14:19 +00:00
parent 57d5595d97
commit 8b615e6dda
2 changed files with 77 additions and 10 deletions

View File

@ -18,6 +18,7 @@ struct _Elm_Win
Elm_Win_Type type;
Elm_Win_Keyboard_Mode kbdmode;
Elm_Win_Indicator_Mode indmode;
struct {
const char *info;
Ecore_Timer *timer;
@ -863,6 +864,12 @@ _elm_win_xwin_update(Elm_Win *win)
}
ecore_x_e_virtual_keyboard_state_set
(win->xwin, (Ecore_X_Virtual_Keyboard_State)win->kbdmode);
if (win->indmode == ELM_WIN_INDICATOR_SHOW)
ecore_x_e_illume_indicator_state_set
(win->xwin, ECORE_X_ILLUME_INDICATOR_STATE_ON);
else if (win->indmode == ELM_WIN_INDICATOR_HIDE)
ecore_x_e_illume_indicator_state_set
(win->xwin, ECORE_X_ILLUME_INDICATOR_STATE_OFF);
}
#endif
@ -1560,6 +1567,9 @@ elm_win_add(Evas_Object *parent, const char *name, Elm_Win_Type type)
} while (0)
#define ENGINE_COMPARE(name) (_elm_config->engine && !strcmp(_elm_config->engine, name))
win->kbdmode = ELM_WIN_KEYBOARD_UNKNOWN;
win->indmode = ELM_WIN_INDICATOR_UNKNOWN;
switch (type)
{
case ELM_WIN_INLINED_IMAGE:
@ -2405,6 +2415,41 @@ elm_win_keyboard_win_get(const Evas_Object *obj)
return EINA_FALSE;
}
EAPI void
elm_win_indicator_mode_set(Evas_Object *obj, Elm_Win_Indicator_Mode mode)
{
Elm_Win *win;
ELM_CHECK_WIDTYPE(obj, widtype);
win = elm_widget_data_get(obj);
if (!win) return;
if (mode == win->indmode) return;
#ifdef HAVE_ELEMENTARY_X
_elm_win_xwindow_get(win);
#endif
win->indmode = mode;
#ifdef HAVE_ELEMENTARY_X
if (win->xwin)
{
if (win->indmode == ELM_WIN_INDICATOR_SHOW)
ecore_x_e_illume_indicator_state_set
(win->xwin, ECORE_X_ILLUME_INDICATOR_STATE_ON);
else if (win->indmode == ELM_WIN_INDICATOR_HIDE)
ecore_x_e_illume_indicator_state_set
(win->xwin, ECORE_X_ILLUME_INDICATOR_STATE_OFF);
}
#endif
}
EAPI Elm_Win_Indicator_Mode
elm_win_indicator_mode_get(const Evas_Object *obj)
{
Elm_Win *win;
ELM_CHECK_WIDTYPE(obj, widtype) ELM_WIN_INDICATOR_UNKNOWN;
win = elm_widget_data_get(obj);
if (!win) return ELM_WIN_INDICATOR_UNKNOWN;
return win->indmode;
}
EAPI void
elm_win_screen_position_get(const Evas_Object *obj, int *x, int *y)
{
@ -2673,14 +2718,6 @@ elm_win_illume_command_send(Evas_Object *obj, Elm_Illume_Command command, void *
case ELM_ILLUME_COMMAND_CLOSE:
ecore_x_e_illume_close_send(win->xwin);
break;
case ELM_ILLUME_COMMAND_INDICATOR_SHOW:
ecore_x_e_illume_indicator_state_set
(win->xwin, ECORE_X_ILLUME_INDICATOR_STATE_ON);
break;
case ELM_ILLUME_COMMAND_INDICATOR_HIDE:
ecore_x_e_illume_indicator_state_set
(win->xwin, ECORE_X_ILLUME_INDICATOR_STATE_OFF);
break;
default:
break;
}

View File

@ -168,6 +168,22 @@ typedef enum
ELM_WIN_KEYBOARD_J2ME /**< J2ME keyboard layout */
} Elm_Win_Keyboard_Mode;
/**
* In some environments, like phones, you may have an indicator that
* shows battery status, reception, time etc. This is the indicator.
*
* Sometimes you don't want it because you provide the same functionality
* inside your app, so this will request that the indicator is hidden in
* this circumstance if you use ELM_ILLUME_INDICATOR_HIDE. The default
* is to have the indicator shown.
*/
typedef enum
{
ELM_WIN_INDICATOR_UNKNOWN, /**< Unknown indicator state */
ELM_WIN_INDICATOR_HIDE, /**< Hides the indicator */
ELM_WIN_INDICATOR_SHOW /**< Shows the indicator */
} Elm_Win_Indicator_Mode;
/**
* Available commands that can be sent to the Illume manager.
*
@ -180,8 +196,6 @@ typedef enum
ELM_ILLUME_COMMAND_FOCUS_FORWARD, /**< Sends focus to the next window in the list */
ELM_ILLUME_COMMAND_FOCUS_HOME, /**< Hides all windows to show the Home screen */
ELM_ILLUME_COMMAND_CLOSE, /**< Closes the currently active window */
ELM_ILLUME_COMMAND_INDICATOR_SHOW, /**< Shows the indicator */
ELM_ILLUME_COMMAND_INDICATOR_HIDE /**< Hides the indicator */
} Elm_Illume_Command;
/**
@ -875,6 +889,22 @@ EAPI void elm_win_keyboard_win_set(Evas_Object *obj, Eina_Bool
*/
EAPI Eina_Bool elm_win_keyboard_win_get(const Evas_Object *obj);
/**
* Sets the indicator mode of the window.
*
* @param obj The window object
* @param mode The mode to set, one of #Elm_Win_Indicator_Mode
*/
EAPI void elm_win_indicator_mode_set(Evas_Object *obj, Elm_Win_Indicator_Mode mode);
/**
* Gets the indicator mode of the window.
*
* @param obj The window object
* @return The mode, one of #Elm_Win_Indicator_Mode
*/
EAPI Elm_Win_Indicator_Mode elm_win_indicator_mode_get(const Evas_Object *obj);
/**
* Get the screen position of a window.
*