forked from enlightenment/efl
Elementary: Removed trailing whitespaces.
Keep removing trailing whitespaces :) SVN revision: 59919
This commit is contained in:
parent
c5a6a93ae9
commit
8e91672a42
|
@ -66,7 +66,7 @@ vert(GLfloat *p, GLfloat x, GLfloat y, GLfloat z, GLfloat *n)
|
|||
|
||||
/* Draw a gear wheel. You'll probably want to call this function when
|
||||
* building a display list since we do a lot of trig here.
|
||||
*
|
||||
*
|
||||
* Input: inner_radius - radius of hole at center
|
||||
* outer_radius - radius at center of teeth
|
||||
* width - width of gear
|
||||
|
@ -102,7 +102,7 @@ make_gear(GLData *gld, GLfloat inner_radius, GLfloat outer_radius, GLfloat width
|
|||
s[4] = 0;
|
||||
c[4] = 1;
|
||||
v = gear->vertices;
|
||||
for (i = 0; i < teeth; i++)
|
||||
for (i = 0; i < teeth; i++)
|
||||
{
|
||||
s[0] = s[4];
|
||||
c[0] = c[4];
|
||||
|
@ -182,7 +182,7 @@ multiply(GLfloat *m, const GLfloat *n)
|
|||
div_t d;
|
||||
int i, j;
|
||||
|
||||
for (i = 0; i < 16; i++)
|
||||
for (i = 0; i < 16; i++)
|
||||
{
|
||||
tmp[i] = 0;
|
||||
d = div(i, 4);
|
||||
|
@ -201,10 +201,10 @@ rotate(GLfloat *m, GLfloat angle, GLfloat x, GLfloat y, GLfloat z)
|
|||
|
||||
s = sin(angle);
|
||||
c = cos(angle);
|
||||
GLfloat r[16] =
|
||||
GLfloat r[16] =
|
||||
{
|
||||
x * x * (1 - c) + c, y * x * (1 - c) + z * s, x * z * (1 - c) - y * s, 0,
|
||||
x * y * (1 - c) - z * s, y * y * (1 - c) + c, y * z * (1 - c) + x * s, 0,
|
||||
x * y * (1 - c) - z * s, y * y * (1 - c) + c, y * z * (1 - c) + x * s, 0,
|
||||
x * z * (1 - c) + y * s, y * z * (1 - c) - x * s, z * z * (1 - c) + c, 0,
|
||||
0, 0, 0, 1
|
||||
};
|
||||
|
@ -253,7 +253,7 @@ gears_draw(GLData *gld)
|
|||
static const GLfloat red[4] = { 0.8, 0.1, 0.0, 1.0 };
|
||||
static const GLfloat green[4] = { 0.0, 0.8, 0.2, 1.0 };
|
||||
static const GLfloat blue[4] = { 0.2, 0.2, 1.0, 1.0 };
|
||||
GLfloat m[16];
|
||||
GLfloat m[16];
|
||||
|
||||
gl->glClearColor(0.8, 0.8, 0.1, 0.5);
|
||||
gl->glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
||||
|
@ -288,7 +288,7 @@ gears_reshape(GLData *gld, int width, int height)
|
|||
0.0, 0.0, 0.1, 0.0,
|
||||
0.0, 0.0, 0.0, 1.0,
|
||||
};
|
||||
|
||||
|
||||
if (width < height)
|
||||
ar = width;
|
||||
else
|
||||
|
@ -387,9 +387,9 @@ gldata_init(GLData *gld)
|
|||
gld->view_rotz = 0.0;
|
||||
gld->angle = 0.0;
|
||||
|
||||
gld->light[0] = 1.0;
|
||||
gld->light[1] = 1.0;
|
||||
gld->light[2] = -5.0;
|
||||
gld->light[0] = 1.0;
|
||||
gld->light[1] = 1.0;
|
||||
gld->light[2] = -5.0;
|
||||
}
|
||||
|
||||
|
||||
|
@ -402,7 +402,7 @@ _draw_gl(Evas_Object *obj)
|
|||
Evas_GL_API *gl = elm_glview_gl_api_get(obj);
|
||||
GLData *gld = evas_object_data_get(obj, "gld");
|
||||
if (!gld) return;
|
||||
|
||||
|
||||
elm_glview_size_get(obj, &w, &h);
|
||||
|
||||
if (!gld->initialized)
|
||||
|
@ -437,7 +437,7 @@ static void
|
|||
_del(void *data, Evas *evas __UNUSED__, Evas_Object *obj, void *event_info __UNUSED__)
|
||||
{
|
||||
GLData *gld = evas_object_data_get(data, "gld");
|
||||
if (!gld)
|
||||
if (!gld)
|
||||
{
|
||||
printf("Unable to get GLData. \n");
|
||||
return;
|
||||
|
@ -455,7 +455,7 @@ _del(void *data, Evas *evas __UNUSED__, Evas_Object *obj, void *event_info __UNU
|
|||
}
|
||||
|
||||
|
||||
static void
|
||||
static void
|
||||
_key_down(void *data, Evas *e __UNUSED__, Evas_Object *obj, void *event_info)
|
||||
{
|
||||
Evas_Event_Key_Down *ev;
|
||||
|
@ -493,14 +493,14 @@ _key_down(void *data, Evas *e __UNUSED__, Evas_Object *obj, void *event_info)
|
|||
}
|
||||
}
|
||||
|
||||
static void
|
||||
static void
|
||||
_mouse_down(void *data __UNUSED__, Evas *e __UNUSED__, Evas_Object *obj, void *event_info __UNUSED__)
|
||||
{
|
||||
GLData *gld = evas_object_data_get(obj, "gld");
|
||||
gld->mouse_down = 1;
|
||||
}
|
||||
|
||||
static void
|
||||
static void
|
||||
_mouse_move(void *data __UNUSED__, Evas *e __UNUSED__, Evas_Object *obj, void *event_info __UNUSED__)
|
||||
{
|
||||
Evas_Event_Mouse_Move *ev;
|
||||
|
@ -518,21 +518,21 @@ _mouse_move(void *data __UNUSED__, Evas *e __UNUSED__, Evas_Object *obj, void *e
|
|||
}
|
||||
}
|
||||
|
||||
static void
|
||||
static void
|
||||
_mouse_up(void *data __UNUSED__, Evas *e __UNUSED__, Evas_Object *obj, void *event_info __UNUSED__)
|
||||
{
|
||||
GLData *gld = evas_object_data_get(obj, "gld");
|
||||
gld->mouse_down = 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void
|
||||
test_glview(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
|
||||
{
|
||||
Evas_Object *win, *bg, *bx, *bt, *gl;
|
||||
Ecore_Animator *ani;
|
||||
GLData *gld = NULL;
|
||||
|
||||
|
||||
if (!(gld = calloc(1, sizeof(GLData)))) return;
|
||||
gldata_init(gld);
|
||||
|
||||
|
@ -549,7 +549,7 @@ test_glview(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info
|
|||
evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
||||
elm_win_resize_object_add(win, bx);
|
||||
evas_object_show(bx);
|
||||
|
||||
|
||||
gl = elm_glview_add(win);
|
||||
evas_object_size_hint_align_set(gl, EVAS_HINT_FILL, EVAS_HINT_FILL);
|
||||
evas_object_size_hint_weight_set(gl, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
||||
|
@ -573,7 +573,7 @@ test_glview(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info
|
|||
evas_object_data_set(gl, "ani", ani);
|
||||
evas_object_data_set(gl, "gld", gld);
|
||||
evas_object_event_callback_add(gl, EVAS_CALLBACK_DEL, _del, gl);
|
||||
|
||||
|
||||
bt = elm_button_add(win);
|
||||
elm_button_label_set(bt, "OK");
|
||||
evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
|
||||
|
|
|
@ -45,7 +45,7 @@ _del_hook(Evas_Object *obj)
|
|||
{
|
||||
Widget_Data *wd = elm_widget_data_get(obj);
|
||||
if (!wd) return;
|
||||
|
||||
|
||||
if (wd->render_idle_enterer) ecore_idle_enterer_del(wd->render_idle_enterer);
|
||||
|
||||
if (wd->surface) evas_gl_surface_destroy(wd->evasgl, wd->surface);
|
||||
|
@ -85,14 +85,14 @@ _glview_update_surface(Evas_Object *obj)
|
|||
evas_gl_surface_destroy(wd->evasgl, wd->surface);
|
||||
wd->surface = NULL;
|
||||
}
|
||||
|
||||
|
||||
evas_object_image_size_set(wd->glview_image, wd->w, wd->h);
|
||||
|
||||
if (!wd->surface)
|
||||
|
||||
if (!wd->surface)
|
||||
{
|
||||
Evas_Native_Surface ns;
|
||||
|
||||
wd->surface = evas_gl_surface_create(wd->evasgl, &wd->config,
|
||||
|
||||
wd->surface = evas_gl_surface_create(wd->evasgl, &wd->config,
|
||||
wd->w, wd->h);
|
||||
evas_gl_native_surface_get(wd->evasgl, wd->surface, &ns);
|
||||
evas_object_image_native_surface_set(wd->glview_image, &ns);
|
||||
|
@ -107,7 +107,7 @@ _glview_resize(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void
|
|||
Evas_Coord w, h;
|
||||
|
||||
if (!wd) return;
|
||||
if (wd->scale_policy == ELM_GLVIEW_RESIZE_POLICY_RECREATE)
|
||||
if (wd->scale_policy == ELM_GLVIEW_RESIZE_POLICY_RECREATE)
|
||||
{
|
||||
evas_object_geometry_get(wd->glview_image, NULL, NULL, &w, &h);
|
||||
if ((w == 0) || (h == 0))
|
||||
|
@ -128,7 +128,7 @@ _glview_resize(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void
|
|||
}
|
||||
|
||||
|
||||
static Eina_Bool
|
||||
static Eina_Bool
|
||||
_render_cb(void *obj)
|
||||
{
|
||||
Widget_Data *wd = elm_widget_data_get(obj);
|
||||
|
@ -176,13 +176,13 @@ _set_render_policy_callback(Evas_Object *obj)
|
|||
ecore_idle_enterer_del(wd->render_idle_enterer);
|
||||
wd->render_idle_enterer = NULL;
|
||||
}
|
||||
|
||||
|
||||
// Set pixel getter callback
|
||||
evas_object_image_pixels_get_callback_set
|
||||
(wd->glview_image, (Evas_Object_Image_Pixels_Get_Cb)_render_cb, obj);
|
||||
break;
|
||||
case ELM_GLVIEW_RENDER_POLICY_ALWAYS:
|
||||
|
||||
|
||||
// Unset the pixel getter callback if set already
|
||||
evas_object_image_pixels_get_callback_set(wd->glview_image, NULL, NULL);
|
||||
break;
|
||||
|
@ -208,8 +208,8 @@ elm_glview_add(Evas_Object *parent)
|
|||
Evas_Object *obj;
|
||||
Evas *e;
|
||||
Widget_Data *wd;
|
||||
Evas_GL_Config cfg = { EVAS_GL_RGB_8,
|
||||
EVAS_GL_DEPTH_NONE,
|
||||
Evas_GL_Config cfg = { EVAS_GL_RGB_8,
|
||||
EVAS_GL_DEPTH_NONE,
|
||||
EVAS_GL_STENCIL_NONE };
|
||||
|
||||
ELM_WIDGET_STANDARD_SETUP(wd, Widget_Data, parent, e, obj, NULL);
|
||||
|
@ -249,7 +249,7 @@ elm_glview_add(Evas_Object *parent)
|
|||
|
||||
wd->render_idle_enterer = NULL;
|
||||
|
||||
// Create Context
|
||||
// Create Context
|
||||
if (!wd->context)
|
||||
{
|
||||
wd->context = evas_gl_context_create(wd->evasgl, NULL);
|
||||
|
@ -285,10 +285,10 @@ elm_glview_gl_api_get(Evas_Object *obj)
|
|||
|
||||
|
||||
/**
|
||||
* Set the mode of the GLView. Supports Three simple modes.
|
||||
* Set the mode of the GLView. Supports Three simple modes.
|
||||
*
|
||||
* @param obj The glview object
|
||||
* @param mode The mode Options OR'ed enabling Alpha, Depth, Stencil.
|
||||
* @param mode The mode Options OR'ed enabling Alpha, Depth, Stencil.
|
||||
* @return True if set properly.
|
||||
*
|
||||
* @ingroup GLView
|
||||
|
@ -298,8 +298,8 @@ elm_glview_mode_set(Evas_Object *obj, Elm_GLView_Mode mode)
|
|||
{
|
||||
ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
|
||||
Widget_Data *wd = elm_widget_data_get(obj);
|
||||
Evas_GL_Config cfg = { EVAS_GL_RGBA_8,
|
||||
EVAS_GL_DEPTH_NONE,
|
||||
Evas_GL_Config cfg = { EVAS_GL_RGBA_8,
|
||||
EVAS_GL_DEPTH_NONE,
|
||||
EVAS_GL_STENCIL_NONE };
|
||||
if (!wd) return EINA_FALSE;
|
||||
|
||||
|
@ -316,12 +316,12 @@ elm_glview_mode_set(Evas_Object *obj, Elm_GLView_Mode mode)
|
|||
// Check for Alpha Channel and enable it
|
||||
if (mode & ELM_GLVIEW_ALPHA)
|
||||
evas_object_image_alpha_set(wd->glview_image, EINA_TRUE);
|
||||
else
|
||||
else
|
||||
evas_object_image_alpha_set(wd->glview_image, EINA_FALSE);
|
||||
|
||||
|
||||
wd->mode = mode;
|
||||
wd->config = cfg;
|
||||
|
||||
|
||||
elm_glview_changed_set(obj);
|
||||
|
||||
return EINA_TRUE;
|
||||
|
@ -335,9 +335,9 @@ elm_glview_mode_set(Evas_Object *obj, Elm_GLView_Mode mode)
|
|||
*
|
||||
* By default, the scaling policy is set to ELM_GLVIEW_RESIZE_POLICY_RECREATE.
|
||||
* When resize is called it destroys the previous surface and recreates the newly
|
||||
* specified size. If the policy is set to ELM_GLVIEW_RESIZE_POLICY_SCALE, however,
|
||||
* specified size. If the policy is set to ELM_GLVIEW_RESIZE_POLICY_SCALE, however,
|
||||
* glview only scales the image object and not the underlying GL Surface.
|
||||
*
|
||||
*
|
||||
* @ingroup GLView
|
||||
*/
|
||||
EAPI Eina_Bool
|
||||
|
@ -371,9 +371,9 @@ elm_glview_scale_policy_set(Evas_Object *obj, Elm_GLView_Resize_Policy policy)
|
|||
* By default, the render policy is set to ELM_GLVIEW_RENDER_POLICY_ON_DEMAND.
|
||||
* This policy is set such that during the render loop, glview is only redrawn
|
||||
* if it needs to be redrawn. (i.e. When it is visible) If the policy is set
|
||||
* to ELM_GLVIEWW_RENDER_POLICY_ALWAYS, it redraws regardless of whether it is
|
||||
* to ELM_GLVIEWW_RENDER_POLICY_ALWAYS, it redraws regardless of whether it is
|
||||
* visible/need redrawing or not.
|
||||
*
|
||||
*
|
||||
* @ingroup GLView
|
||||
*/
|
||||
EAPI Eina_Bool
|
||||
|
@ -383,7 +383,7 @@ elm_glview_render_policy_set(Evas_Object *obj, Elm_GLView_Render_Policy policy)
|
|||
Widget_Data *wd = elm_widget_data_get(obj);
|
||||
if (!wd) return EINA_FALSE;
|
||||
|
||||
if ((policy != ELM_GLVIEW_RENDER_POLICY_ON_DEMAND) &&
|
||||
if ((policy != ELM_GLVIEW_RENDER_POLICY_ON_DEMAND) &&
|
||||
(policy != ELM_GLVIEW_RENDER_POLICY_ALWAYS))
|
||||
{
|
||||
ERR("Invalid Render Policy.\n");
|
||||
|
@ -411,7 +411,7 @@ elm_glview_size_set(Evas_Object *obj, int width, int height)
|
|||
ELM_CHECK_WIDTYPE(obj, widtype);
|
||||
Widget_Data *wd = elm_widget_data_get(obj);
|
||||
if (!wd) return;
|
||||
|
||||
|
||||
if ((width == wd->w) && (height == wd->h)) return;
|
||||
wd->w = width;
|
||||
wd->h = height;
|
||||
|
@ -438,7 +438,7 @@ elm_glview_size_get(Evas_Object *obj, int *width, int *height)
|
|||
ELM_CHECK_WIDTYPE(obj, widtype);
|
||||
Widget_Data *wd = elm_widget_data_get(obj);
|
||||
if (!wd) return;
|
||||
|
||||
|
||||
if (width) *width = wd->w;
|
||||
if (height) *height = wd->h;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue