4 * A simple GLView widget that allows GL rendering.
6 * Signals that you can add callbacks for are:
11 typedef void (*Elm_GLView_Func_Cb)(Evas_Object *obj);
13 typedef enum _Elm_GLView_Mode
17 ELM_GLVIEW_STENCIL = 4
21 * Defines a policy for the glview resizing.
23 * @note Default is ELM_GLVIEW_RESIZE_POLICY_RECREATE
25 typedef enum _Elm_GLView_Resize_Policy
27 ELM_GLVIEW_RESIZE_POLICY_RECREATE = 1, /**< Resize the internal surface along with the image */
28 ELM_GLVIEW_RESIZE_POLICY_SCALE = 2 /**< Only reize the internal image and not the surface */
29 } Elm_GLView_Resize_Policy;
31 typedef enum _Elm_GLView_Render_Policy
33 ELM_GLVIEW_RENDER_POLICY_ON_DEMAND = 1, /**< Render only when there is a need for redrawing */
34 ELM_GLVIEW_RENDER_POLICY_ALWAYS = 2 /**< Render always even when it is not visible */
35 } Elm_GLView_Render_Policy;
38 * Add a new glview to the parent
40 * @param parent The parent object
41 * @return The new object or NULL if it cannot be created
46 elm_glview_add(Evas_Object *parent)
50 * Sets the size of the glview
52 * @param obj The glview object
53 * @param width width of the glview object
54 * @param height height of the glview object
58 EAPI void elm_glview_size_set(Evas_Object *obj, Evas_Coord width, Evas_Coord height) EINA_ARG_NONNULL(1);
61 * Gets the size of the glview.
63 * @param obj The glview object
64 * @param width width of the glview object
65 * @param height height of the glview object
67 * Note that this function returns the actual image size of the
68 * glview. This means that when the scale policy is set to
69 * ELM_GLVIEW_RESIZE_POLICY_SCALE, it'll return the non-scaled
74 EAPI void elm_glview_size_get(const Evas_Object *obj, Evas_Coord *width, Evas_Coord *height) EINA_ARG_NONNULL(1);
77 * Gets the gl api struct for gl rendering
79 * @param obj The glview object
80 * @return The api object or NULL if it cannot be created
84 EAPI Evas_GL_API *elm_glview_gl_api_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
87 * Set the mode of the GLView. Supports Three simple modes.
89 * @param obj The glview object
90 * @param mode The mode Options OR'ed enabling Alpha, Depth, Stencil.
91 * @return True if set properly.
95 EAPI Eina_Bool elm_glview_mode_set(Evas_Object *obj, Elm_GLView_Mode mode) EINA_ARG_NONNULL(1);
98 * Set the resize policy for the glview object.
100 * @param obj The glview object.
101 * @param policy The scaling policy.
103 * By default, the resize policy is set to
104 * ELM_GLVIEW_RESIZE_POLICY_RECREATE. When resize is called it
105 * destroys the previous surface and recreates the newly specified
106 * size. If the policy is set to ELM_GLVIEW_RESIZE_POLICY_SCALE,
107 * however, glview only scales the image object and not the underlying
112 EAPI Eina_Bool elm_glview_resize_policy_set(Evas_Object *obj, Elm_GLView_Resize_Policy policy) EINA_ARG_NONNULL(1);
115 * Set the render policy for the glview object.
117 * @param obj The glview object.
118 * @param policy The render policy.
120 * By default, the render policy is set to
121 * ELM_GLVIEW_RENDER_POLICY_ON_DEMAND. This policy is set such
122 * that during the render loop, glview is only redrawn if it needs
123 * to be redrawn. (i.e. When it is visible) If the policy is set to
124 * ELM_GLVIEWW_RENDER_POLICY_ALWAYS, it redraws regardless of
125 * whether it is visible/need redrawing or not.
129 EAPI Eina_Bool elm_glview_render_policy_set(Evas_Object *obj, Elm_GLView_Render_Policy policy) EINA_ARG_NONNULL(1);
132 * Set the init function that runs once in the main loop.
134 * @param obj The glview object.
135 * @param func The init function to be registered.
137 * The registered init function gets called once during the render loop.
141 EAPI void elm_glview_init_func_set(Evas_Object *obj, Elm_GLView_Func_Cb func) EINA_ARG_NONNULL(1);
144 * Set the render function that runs in the main loop.
146 * @param obj The glview object.
147 * @param func The delete function to be registered.
149 * The registered del function gets called when GLView object is deleted.
153 EAPI void elm_glview_del_func_set(Evas_Object *obj, Elm_GLView_Func_Cb func) EINA_ARG_NONNULL(1);
156 * Set the resize function that gets called when resize happens.
158 * @param obj The glview object.
159 * @param func The resize function to be registered.
163 EAPI void elm_glview_resize_func_set(Evas_Object *obj, Elm_GLView_Func_Cb func) EINA_ARG_NONNULL(1);
166 * Set the render function that runs in the main loop.
168 * @param obj The glview object.
169 * @param func The render function to be registered.
173 EAPI void elm_glview_render_func_set(Evas_Object *obj, Elm_GLView_Func_Cb func) EINA_ARG_NONNULL(1);
176 * Notifies that there has been changes in the GLView.
178 * @param obj The glview object.
182 EAPI void elm_glview_changed_set(Evas_Object *obj) EINA_ARG_NONNULL(1);