jpeg pushed a commit to branch master.

http://git.enlightenment.org/core/elementary.git/commit/?id=0799bb1f8db164e6bfa934bedd862ff1dd98fed4

commit 0799bb1f8db164e6bfa934bedd862ff1dd98fed4
Author: Jean-Philippe Andre <[email protected]>
Date:   Fri Sep 19 13:10:02 2014 +0900

    GLView: Add support for client-side rotation
    
    See recent changes in Evas GL for reference.
    
    This also introduces the EO function rotation_get()
    
    @feature
---
 src/lib/elm_glview.c        | 12 ++++++++++++
 src/lib/elm_glview.eo       | 22 ++++++++++++++++++++++
 src/lib/elm_glview_common.h | 15 ++++++++++++++-
 3 files changed, 48 insertions(+), 1 deletion(-)

diff --git a/src/lib/elm_glview.c b/src/lib/elm_glview.c
index 7d2a236..97e2dfc 100644
--- a/src/lib/elm_glview.c
+++ b/src/lib/elm_glview.c
@@ -355,6 +355,12 @@ _elm_glview_mode_set(Eo *obj, Elm_Glview_Data *sd, 
Elm_GLView_Mode mode)
    if (mode & ELM_GLVIEW_CLIENT_SIDE_ROTATION)
      sd->config->options_bits |= EVAS_GL_OPTIONS_CLIENT_SIDE_ROTATION;
 
+   // Check for Alpha Channel and enable it
+   if (mode & ELM_GLVIEW_ALPHA)
+     evas_object_image_alpha_set(wd->resize_obj, EINA_TRUE);
+   else
+     evas_object_image_alpha_set(wd->resize_obj, EINA_FALSE);
+
    sd->mode = mode;
 
    _glview_update_surface(obj);
@@ -466,6 +472,12 @@ _elm_glview_evas_gl_get(Eo *obj EINA_UNUSED, 
Elm_Glview_Data *sd)
    return sd->evasgl;
 }
 
+EOLIAN static int
+_elm_glview_rotation_get(Eo *obj EINA_UNUSED, Elm_Glview_Data *sd)
+{
+   return evas_gl_rotation_get(sd->evasgl);
+}
+
 static void
 _elm_glview_class_constructor(Eo_Class *klass)
 {
diff --git a/src/lib/elm_glview.eo b/src/lib/elm_glview.eo
index cbd0653..839cb66 100644
--- a/src/lib/elm_glview.eo
+++ b/src/lib/elm_glview.eo
@@ -176,9 +176,31 @@ class Elm_Glview (Elm_Widget)
             @return The Evas_GL used by this GLView.
 
             @ingroup GLView */
+            legacy: null;
             return: Evas_GL *;
          }
       }
+      rotation {
+         get {
+            /*@
+            Get the current GL view's rotation when using direct rendering
+
+            @return A window rotation in degrees (0, 90, 180 or 270)
+
+            @note This rotation can be different from the device orientation. 
This
+                  rotation value must be used in case of direct rendering and 
should be
+                  taken into account by the application when setting the 
internal rotation
+                  matrix for the view.
+
+            @see ELM_GLVIEW_CLIENT_SIDE_ROTATION
+
+            @since 1.12
+
+            @ingroup GLView */
+            legacy: null;
+            return: int;
+         }
+      }
    }
    implements {
       class.constructor;
diff --git a/src/lib/elm_glview_common.h b/src/lib/elm_glview_common.h
index 7e6dc96..6df9f61 100644
--- a/src/lib/elm_glview_common.h
+++ b/src/lib/elm_glview_common.h
@@ -1,8 +1,21 @@
 typedef void (*Elm_GLView_Func_Cb)(Evas_Object *obj);
 
 /**
- * Defines mode of GLView
+ * @brief Selects the target surface properties
  *
+ * An OR combination of @c Elm_GLView_Mode values should be passed to
+ * @ref elm_glview_mode_set when setting up a GL widget. These flags will
+ * specify the properties of the rendering target surface; in particular,
+ * the mode can request the surface to support alpha, depth and stencil 
buffers.
+ *
+ * @note @c ELM_GLVIEW_CLIENT_SIDE_ROTATION is a special value that indicates
+ *       to EFL that the application will handle the view rotation when the
+ *       device is rotated. This is needed only when the application requests
+ *       direct rendering. Please refer to @ref Evas_GL
+ *       for more information about direct rendering.
+ *
+ * @see elm_glview_mode_set
+ * @see @ref elm_opengl_page
  * @ingroup GLView
  */
 typedef enum _Elm_GLView_Mode

-- 


Reply via email to