Dear All,

This is Myoungwoon Roy Kim.

This patches are for supporting the indicator's opacity mode and made by
Jeonhoon Park(jh1979.p...@samsung.com) who is responsible for Indicator
application.

Requirements:
- In mobile device, Indicator area should be displayed as Opacity,
Transparency, or sometimes Translucency according to the UX requirements.
This requirement can be applied in case of fullscreen based menu and
fullscreen applications like video player etc.

Functional requirements:
1. User can set indicator's opacity mode as opacity, transparency, and
translucency
2. User can get the current indicator's opacity mode.

Currently there are no APIs for supporting the upper functional
requirements.

Thus, he added support for indicator's opacity mode.
It is designed for EFL developers easily to set the indicator's opacity
like the existing indicator's mode.
He added a Elm_Win_Indicator_Opacity_Mode structure variable into Elm_Win
structure.
Meanwhile, new two APIs are implemented independently from the existing
source code.

Anybody please review this and apply it to upstream code.

Thanks.

Best regards,
Roy.


=====================================
Myoung-Woon Roy Kim
Next-Generation Computing Lab.
Software Center
Digital Media & Communications Business
SAMSUNG ELECTRONICS CO., LTD

anycall: +82-10-9530-0295
fax: +82-31-279-5521
e-mail : myoungwoon....@samsung.com
"Be myself!"
=====================================
Index: src/lib/elm_win.c
===================================================================
--- src/lib/elm_win.c	(revision 68780)
+++ src/lib/elm_win.c	(working copy)
@@ -19,6 +19,7 @@
    Elm_Win_Type type;
    Elm_Win_Keyboard_Mode kbdmode;
    Elm_Win_Indicator_Mode indmode;
+   Elm_Win_Indicator_Opacity_Mode ind_o_mode;
    struct {
       const char *info;
       Ecore_Timer *timer;
@@ -2830,6 +2831,43 @@
 }
 
 EAPI void
+elm_win_indicator_opacity_set(Evas_Object *obj, Elm_Win_Indicator_Opacity_Mode mode)
+{
+   Elm_Win *win;
+   ELM_CHECK_WIDTYPE(obj, widtype);
+   win = elm_widget_data_get(obj);
+   if (!win) return;
+   if (mode == win->ind_o_mode) return;
+   win->ind_o_mode = mode;
+#ifdef HAVE_ELEMENTARY_X
+   _elm_win_xwindow_get(win);
+   if (win->xwin)
+     {
+        if (win->ind_o_mode == ELM_WIN_INDICATOR_OPAQUE)
+          ecore_x_e_illume_indicator_opacity_set
+          (win->xwin, ECORE_X_ILLUME_INDICATOR_OPAQUE);
+        else if (win->ind_o_mode == ELM_WIN_INDICATOR_TRANSLUCENT)
+          ecore_x_e_illume_indicator_opacity_set
+          (win->xwin, ECORE_X_ILLUME_INDICATOR_TRANSLUCENT);
+        else if (win->ind_o_mode == ELM_WIN_INDICATOR_TRANSPARENT)
+          ecore_x_e_illume_indicator_opacity_set
+          (win->xwin, ECORE_X_ILLUME_INDICATOR_TRANSPARENT);
+
+     }
+#endif
+}
+
+EAPI Elm_Win_Indicator_Opacity_Mode
+elm_win_indicator_opacity_get(const Evas_Object *obj)
+{
+   Elm_Win *win;
+   ELM_CHECK_WIDTYPE(obj, widtype) ELM_WIN_INDICATOR_OPACITY_UNKNOWN;
+   win = elm_widget_data_get(obj);
+   if (!win) return ELM_WIN_INDICATOR_OPACITY_UNKNOWN;
+   return win->ind_o_mode;
+}
+
+EAPI void
 elm_win_screen_position_get(const Evas_Object *obj, int *x, int *y)
 {
    Elm_Win *win;
Index: src/lib/elm_win.h
===================================================================
--- src/lib/elm_win.h	(revision 68780)
+++ src/lib/elm_win.h	(working copy)
@@ -193,6 +193,18 @@
 } Elm_Win_Indicator_Mode;
 
 /**
+ * Defines the opacity modes of indicator that can be shown
+ */
+
+typedef enum
+{
+   ELM_WIN_INDICATOR_OPACITY_UNKNOWN, /**< Unknown indicator opacity mode */
+   ELM_WIN_INDICATOR_OPAQUE, /**< Opacifies the indicator */
+   ELM_WIN_INDICATOR_TRANSLUCENT, /**< Be translucent the indicator */
+   ELM_WIN_INDICATOR_TRANSPARENT /**< Transparentizes the indicator */
+} Elm_Win_Indicator_Opacity_Mode;
+
+/**
  * Available commands that can be sent to the Illume manager.
  *
  * When running under an Illume session, a window may send commands to the
@@ -1023,6 +1035,22 @@
 EAPI Elm_Win_Indicator_Mode elm_win_indicator_mode_get(const Evas_Object *obj);
 
 /**
+ * Sets the indicator opacity mode of the window.
+ *
+ * @param obj The window object
+ * @param mode The mode to set, one of #Elm_Win_Indicator_Opacity_Mode
+ */
+EAPI void                  elm_win_indicator_opacity_set(Evas_Object *obj, Elm_Win_Indicator_Opacity_Mode mode);
+
+/**
+ * Gets the indicator opacity mode of the window.
+ *
+ * @param obj The window object
+ * @return The mode, one of #Elm_Win_Indicator_Opacity_Mode
+ */
+EAPI Elm_Win_Indicator_Opacity_Mode elm_win_indicator_opacity_get(const Evas_Object *obj);
+
+/**
  * Get the screen position of a window.
  *
  * @param obj The window object
Index: src/lib/ecore_x/ecore_x_atoms_decl.h
===================================================================
--- src/lib/ecore_x/ecore_x_atoms_decl.h	(revision 68780)
+++ src/lib/ecore_x/ecore_x_atoms_decl.h	(working copy)
@@ -267,6 +267,10 @@
 EAPI Ecore_X_Atom ECORE_X_ATOM_E_ILLUME_INDICATOR_STATE = 0;
 EAPI Ecore_X_Atom ECORE_X_ATOM_E_ILLUME_INDICATOR_ON = 0;
 EAPI Ecore_X_Atom ECORE_X_ATOM_E_ILLUME_INDICATOR_OFF = 0;
+EAPI Ecore_X_Atom ECORE_X_ATOM_E_ILLUME_INDICATOR_OPACITY_MODE = 0;
+EAPI Ecore_X_Atom ECORE_X_ATOM_E_ILLUME_INDICATOR_OPAQUE= 0;
+EAPI Ecore_X_Atom ECORE_X_ATOM_E_ILLUME_INDICATOR_TRANSLUCENT = 0;
+EAPI Ecore_X_Atom ECORE_X_ATOM_E_ILLUME_INDICATOR_TRANSPARENT = 0;
 
 EAPI Ecore_X_Atom ECORE_X_ATOM_E_COMP_SYNC_COUNTER = 0;
 EAPI Ecore_X_Atom ECORE_X_ATOM_E_COMP_SYNC_DRAW_DONE = 0;
Index: src/lib/ecore_x/Ecore_X.h
===================================================================
--- src/lib/ecore_x/Ecore_X.h	(revision 68780)
+++ src/lib/ecore_x/Ecore_X.h	(working copy)
@@ -1111,6 +1111,14 @@
    ECORE_X_ILLUME_INDICATOR_STATE_ON
 } Ecore_X_Illume_Indicator_State;
 
+typedef enum _Ecore_X_Illume_Indicator_Opacity_Mode
+{
+   ECORE_X_ILLUME_INDICATOR_OPACITY_UNKNOWN = 0,
+   ECORE_X_ILLUME_INDICATOR_OPAQUE,
+   ECORE_X_ILLUME_INDICATOR_TRANSLUCENT,
+   ECORE_X_ILLUME_INDICATOR_TRANSPARENT
+} Ecore_X_Illume_Indicator_Opacity_Mode;
+
 /* Window layer constants */
 #define ECORE_X_WINDOW_LAYER_BELOW  2
 #define ECORE_X_WINDOW_LAYER_NORMAL 4
@@ -3658,6 +3666,18 @@
 EAPI void
 ecore_x_e_illume_indicator_state_send(Ecore_X_Window win,
                                       Ecore_X_Illume_Indicator_State state);
+
+EAPI void
+ecore_x_e_illume_indicator_opacity_set(Ecore_X_Window win,
+                                     Ecore_X_Illume_Indicator_Opacity_Mode mode);
+
+EAPI Ecore_X_Illume_Indicator_Opacity_Mode
+ecore_x_e_illume_indicator_opacity_get(Ecore_X_Window win);
+
+EAPI void
+ecore_x_e_illume_indicator_opacity_send(Ecore_X_Window win,
+                                      Ecore_X_Illume_Indicator_Opacity_Mode mode);
+
 #ifdef __cplusplus
 }
 #endif // ifdef __cplusplus
Index: src/lib/ecore_x/xcb/ecore_xcb_e.c
===================================================================
--- src/lib/ecore_x/xcb/ecore_xcb_e.c	(revision 68780)
+++ src/lib/ecore_x/xcb/ecore_xcb_e.c	(working copy)
@@ -1138,3 +1138,77 @@
                                  0, 0, 0, 0);
 }
 
+static Ecore_X_Atom
+_ecore_x_e_indicator_opacity_atom_get(Ecore_X_Illume_Indicator_Opacity_Mode mode)
+{
+   switch (mode)
+     {
+      case ECORE_X_ILLUME_INDICATOR_OPAQUE:
+        return ECORE_X_ATOM_E_ILLUME_INDICATOR_OPAQUE;
+
+      case ECORE_X_ILLUME_INDICATOR_TRANSLUCENT:
+        return ECORE_X_ATOM_E_ILLUME_INDICATOR_TRANSLUCENT;
+
+      case ECORE_X_ILLUME_INDICATOR_TRANSPARENT:
+        return ECORE_X_ATOM_E_ILLUME_INDICATOR_TRANSPARENT;
+
+      default:
+        break;
+     }
+   return 0;
+}
+
+static Ecore_X_Illume_Indicator_Opacity_Mode
+_ecore_x_e_indicator_opacity_get(Ecore_X_Atom atom)
+{
+   if (atom == ECORE_X_ATOM_E_ILLUME_INDICATOR_OPAQUE)
+     return ECORE_X_ILLUME_INDICATOR_OPAQUE;
+
+   if (atom == ECORE_X_ATOM_E_ILLUME_INDICATOR_TRANSLUCENT)
+     return ECORE_X_ILLUME_INDICATOR_TRANSLUCENT;
+
+   if (atom == ECORE_X_ATOM_E_ILLUME_INDICATOR_TRANSPARENT)
+     return ECORE_X_ILLUME_INDICATOR_TRANSPARENT;
+
+   return ECORE_X_ILLUME_INDICATOR_OPACITY_UNKNOWN;
+}
+
+EAPI void
+ecore_x_e_illume_indicator_opacity_set(Ecore_X_Window win,
+                                     Ecore_X_Illume_Indicator_Opacity_Mode mode)
+{
+   Ecore_X_Atom atom = 0;
+
+   LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   atom = _ecore_x_e_indicator_opacity_atom_get(mode);
+   ecore_x_window_prop_atom_set(win,
+                                ECORE_X_ATOM_E_ILLUME_INDICATOR_OPACITY_MODE,
+                                &atom, 1);
+}
+
+EAPI Ecore_X_Illume_Indicator_Opacity_Mode
+ecore_x_e_illume_indicator_opacity_get(Ecore_X_Window win)
+{
+   Ecore_X_Atom atom;
+
+   LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   if (!ecore_x_window_prop_atom_get(win,
+                                     ECORE_X_ATOM_E_ILLUME_INDICATOR_OPACITY_MODE,
+                                     &atom, 1))
+     return ECORE_X_ILLUME_INDICATOR_OPACITY_UNKNOWN;
+
+   return _ecore_x_e_indicator_opacity_get(atom);
+}
+
+EAPI void
+ecore_x_e_illume_indicator_opacity_send(Ecore_X_Window win,
+                                      Ecore_X_Illume_Indicator_Opacity_Mode mode)
+{
+   LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   ecore_x_client_message32_send(win,
+                                 ECORE_X_ATOM_E_ILLUME_INDICATOR_OPACITY_MODE,
+                                 ECORE_X_EVENT_MASK_WINDOW_CONFIGURE,
+                                 _ecore_x_e_indicator_opacity_atom_get(mode),
+                                 0, 0, 0, 0);
+}
+
Index: src/lib/ecore_x/xlib/ecore_x_e.c
===================================================================
--- src/lib/ecore_x/xlib/ecore_x_e.c	(revision 68780)
+++ src/lib/ecore_x/xlib/ecore_x_e.c	(working copy)
@@ -1124,3 +1124,77 @@
                                  0, 0, 0, 0);
 }
 
+static Ecore_X_Atom
+_ecore_x_e_indicator_opacity_atom_get(Ecore_X_Illume_Indicator_Opacity_Mode mode)
+{
+   switch (mode)
+     {
+      case ECORE_X_ILLUME_INDICATOR_OPAQUE:
+        return ECORE_X_ATOM_E_ILLUME_INDICATOR_OPAQUE;
+
+      case ECORE_X_ILLUME_INDICATOR_TRANSLUCENT:
+        return ECORE_X_ATOM_E_ILLUME_INDICATOR_TRANSLUCENT;
+
+      case ECORE_X_ILLUME_INDICATOR_TRANSPARENT:
+        return ECORE_X_ATOM_E_ILLUME_INDICATOR_TRANSPARENT;
+
+      default:
+        break;
+     }
+   return 0;
+}
+
+static Ecore_X_Illume_Indicator_Opacity_Mode
+_ecore_x_e_indicator_opacity_get(Ecore_X_Atom atom)
+{
+   if (atom == ECORE_X_ATOM_E_ILLUME_INDICATOR_OPAQUE)
+     return ECORE_X_ILLUME_INDICATOR_OPAQUE;
+
+   if (atom == ECORE_X_ATOM_E_ILLUME_INDICATOR_TRANSLUCENT)
+     return ECORE_X_ILLUME_INDICATOR_TRANSLUCENT;
+
+   if (atom == ECORE_X_ATOM_E_ILLUME_INDICATOR_TRANSPARENT)
+     return ECORE_X_ILLUME_INDICATOR_TRANSPARENT;
+
+   return ECORE_X_ILLUME_INDICATOR_OPACITY_UNKNOWN;
+}
+
+EAPI void
+ecore_x_e_illume_indicator_opacity_set(Ecore_X_Window win,
+                                     Ecore_X_Illume_Indicator_Opacity_Mode mode)
+{
+   Ecore_X_Atom atom = 0;
+
+   LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   atom = _ecore_x_e_indicator_opacity_atom_get(mode);
+   ecore_x_window_prop_atom_set(win,
+                                ECORE_X_ATOM_E_ILLUME_INDICATOR_OPACITY_MODE,
+                                &atom, 1);
+}
+
+EAPI Ecore_X_Illume_Indicator_Opacity_Mode
+ecore_x_e_illume_indicator_opacity_get(Ecore_X_Window win)
+{
+   Ecore_X_Atom atom;
+
+   LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   if (!ecore_x_window_prop_atom_get(win,
+                                     ECORE_X_ATOM_E_ILLUME_INDICATOR_OPACITY_MODE,
+                                     &atom, 1))
+     return ECORE_X_ILLUME_INDICATOR_OPACITY_UNKNOWN;
+
+   return _ecore_x_e_indicator_opacity_get(atom);
+}
+
+EAPI void
+ecore_x_e_illume_indicator_opacity_send(Ecore_X_Window win,
+                                      Ecore_X_Illume_Indicator_Opacity_Mode mode)
+{
+   LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   ecore_x_client_message32_send(win,
+                                 ECORE_X_ATOM_E_ILLUME_INDICATOR_OPACITY_MODE,
+                                 ECORE_X_EVENT_MASK_WINDOW_CONFIGURE,
+                                 _ecore_x_e_indicator_opacity_atom_get(mode),
+                                 0, 0, 0, 0);
+}
+
------------------------------------------------------------------------------
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing 
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
_______________________________________________
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to