From fd578d9ec9b016d714c52f810577429e3b1b9f6d Mon Sep 17 00:00:00 2001 From: Carsten Haitzler Date: Tue, 8 Aug 2000 01:55:28 +0000 Subject: [PATCH] aaaaaaaaaah errrrrrr .... stuff! SVN revision: 3068 --- legacy/evas/src/Evas.h | 36 +++------------ legacy/evas/src/evas_gl_routines.c | 15 ++---- legacy/evas/src/evas_misc.c | 73 ++++++++++++++++++++++++++---- legacy/evas/src/evas_render.c | 9 ---- legacy/evas/test/evas_test.c | 9 ++++ 5 files changed, 84 insertions(+), 58 deletions(-) diff --git a/legacy/evas/src/Evas.h b/legacy/evas/src/Evas.h index 94658a4b1d..c44802d78b 100644 --- a/legacy/evas/src/Evas.h +++ b/legacy/evas/src/Evas.h @@ -8,10 +8,8 @@ typedef struct _Evas * Evas; typedef struct _Evas_Gradient * Evas_Gradient; typedef struct _Evas_Object_Any * Evas_Object; typedef struct _Evas_Object_Any * Evas_Object_Any; -typedef void * Evas_Group; typedef int Evas_Callback_Type; typedef int Evas_Image_Format; -typedef int Evas_Blend_Mode; typedef int Evas_Render_Method; typedef struct _Evas_Render_Data * Evas_Render_Data; typedef struct _Evas_List * Evas_List; @@ -25,7 +23,6 @@ typedef struct _Evas_Object_Rectangle * Evas_Object_Rectangle; typedef struct _Evas_Object_Line * Evas_Object_Line; typedef struct _Evas_Object_Gradient_Box * Evas_Object_Gradient_Box; typedef struct _Evas_Object_Bits * Evas_Object_Bits; -typedef struct _Evas_Object_Evas * Evas_Object_Evas; #define RENDER_METHOD_ALPHA_SOFTWARE 0 #define RENDER_METHOD_BASIC_HARDWARE 1 @@ -49,12 +46,6 @@ typedef struct _Evas_Object_Evas * Evas_Object_Evas; #define OBJECT_LINE 3 #define OBJECT_GRADIENT_BOX 4 #define OBJECT_BITS 5 -#define OBJECT_EVAS 6 - -#define BLEND_ONTOP 0 -#define BLEND_ADD 1 -#define BLEND_SUBTRACT 2 -#define BLEND_RESHADE 3 struct _Evas { @@ -63,11 +54,7 @@ struct _Evas Drawable drawable; Visual *visual; Colormap colormap; - - struct { - int x, y, w, h; - } output; - + struct { double x, y, w, h; } viewport; @@ -81,6 +68,8 @@ struct _Evas void (*object_renderer_data_free) (Evas _e, Evas_Object _o); void (*evas_renderer_data_free) (Evas _e); + int changed; + Evas_List layers; Evas_List updates; }; @@ -136,11 +125,12 @@ struct _Evas_Object_Any int type; struct { double x, y, w, h; - Evas_Blend_Mode mode; int zoomscale; int layer; } current, previous; + int changed; + void (*object_free) (Evas_Object _o); Evas_List callbacks; @@ -154,8 +144,8 @@ struct _Evas_Object_Image Evas_Object_Any object; struct { char *file; - double angle; - int new_data; + int new_data; + int scale; struct _fill { double x, y, w, h; } fill; @@ -167,7 +157,6 @@ struct _Evas_Object_Text Evas_Object_Any object; struct { char *text; - double angle; int r, g, b, a; } current, previous; }; @@ -206,14 +195,6 @@ struct _Evas_Object_Bits } current, previous; }; -struct _Evas_Object_Evas -{ - Evas_Object_Any object; - struct { - Evas *evas; - } current, previous; -}; - #ifdef __cplusplus extern "C" { #endif @@ -234,7 +215,6 @@ Colormap evas_get_optimal_colormap(Evas e, Display *disp); /* the output settings */ void evas_set_output(Evas e, Display *disp, Drawable d, Visual *v, Colormap c); -void evas_set_output_rect(Evas e, int x, int y, int w, int h); void evas_set_output_viewport(Evas e, double x, double y, double w, double h); void evas_set_output_method(Evas e, Evas_Render_Method method); @@ -249,7 +229,6 @@ Evas_Object evas_add_rectangle(Evas e, int r, int g, int b, int a); Evas_Object evas_add_line(Evas e, int r, int g, int b, int a); Evas_Object evas_add_gradient_box(Evas e); Evas_Object evas_add_bits(Evas e, char *file); -Evas_Object evas_add_evas(Evas e, Evas evas); /* set object settings */ void evas_set_image_file(Evas e, Evas_Object o, char *file); @@ -260,7 +239,6 @@ void evas_set_bits_file(Evas e, Evas_Object o, char *file); void evas_set_color(Evas e, Evas_Object o, int r, int g, int b, int a); void evas_set_gradient(Evas e, Evas_Object o, Evas_Gradient grad); void evas_set_angle(Evas e, Evas_Object o, double angle); -void evas_set_blend_mode(Evas e, Evas_Blend_Mode mode); void evas_set_zoom_scale(Evas e, Evas_Object o, int scale); void evas_set_line_xy(Evas e, Evas_Object o, double x1, double y1, double x2, double y2); diff --git a/legacy/evas/src/evas_gl_routines.c b/legacy/evas/src/evas_gl_routines.c index bf865095b2..a922202722 100644 --- a/legacy/evas/src/evas_gl_routines.c +++ b/legacy/evas/src/evas_gl_routines.c @@ -1481,24 +1481,19 @@ void __evas_gl_line_draw(Display *disp, Window win, dest_w = win_w; dest_h = win_h; } - if (a < 255) - { - glEnable(GL_BLEND); - glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); - } - else - glDisable(GL_BLEND); + glEnable(GL_BLEND); + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glEnable(GL_DITHER); glDisable(GL_TEXTURE_2D); glShadeModel(GL_FLAT); glPixelStorei(GL_UNPACK_ALIGNMENT, 4); glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_FASTEST); glHint(GL_LINE_SMOOTH_HINT, GL_NICEST); -/* glEnable(GL_LINE_SMOOTH);*/ + glEnable(GL_LINE_SMOOTH); glBegin(GL_LINES); - glVertex2i(x1, y1); - glVertex2i(x2, y2); + glVertex2d((double)x1 + 0.5, (double)y1 + 0.5); + glVertex2d((double)x2 + 0.5, (double)y2 + 0.5); glEnd(); glEnable(GL_TEXTURE_2D); diff --git a/legacy/evas/src/evas_misc.c b/legacy/evas/src/evas_misc.c index 231da9fd03..5672319be6 100644 --- a/legacy/evas/src/evas_misc.c +++ b/legacy/evas/src/evas_misc.c @@ -16,11 +16,7 @@ evas_new(void) e->current.viewport.y = 0.0; e->current.viewport.w = 0.0; e->current.viewport.h = 0.0; - e->current.output.x = 0; - e->current.output.y = 0; - e->current.output.w = 0; - e->current.output.h = 0; - e->current.render_method = RENDER_METHOD_BASIC_HARDWARE; + e->current.render_method = RENDER_METHOD_ALPHA_SOFTWARE; return e; } @@ -40,19 +36,76 @@ evas_free(Evas e) void evas_set_color(Evas e, Evas_Object o, int r, int g, int b, int a) { + switch (o->type) + { + case OBJECT_TEXT: + { + Evas_Object_Text oo; + + oo = (Evas_Object_Text)o; + oo->current.r = r; + oo->current.g = g; + oo->current.b = b; + oo->current.a = a; + } + o->changed = 1; + e->changed = 1; + break; + case OBJECT_RECTANGLE: + { + Evas_Object_Rectangle oo; + + oo = (Evas_Object_Rectangle)o; + oo->current.r = r; + oo->current.g = g; + oo->current.b = b; + oo->current.a = a; + } + o->changed = 1; + e->changed = 1; + break; + case OBJECT_LINE: + { + Evas_Object_Line oo; + + oo = (Evas_Object_Line)o; + oo->current.r = r; + oo->current.g = g; + oo->current.b = b; + oo->current.a = a; + } + o->changed = 1; + e->changed = 1; + break; + default: + break; + } } void evas_set_angle(Evas e, Evas_Object o, double angle) { -} - -void -evas_set_blend_mode(Evas e, Evas_Blend_Mode mode) -{ + switch (o->type) + { + case OBJECT_GRADIENT_BOX: + { + Evas_Object_Gradient_Box oo; + + oo = (Evas_Object_Gradient_Box)o; + oo->current.angle = angle; + } + o->changed = 1; + e->changed = 1; + break; + default: + break; + } } void evas_set_zoom_scale(Evas e, Evas_Object o, int scale) { + o->current.zoomscale = scale; + o->changed = 1; + e->changed = 1; } diff --git a/legacy/evas/src/evas_render.c b/legacy/evas/src/evas_render.c index 8fa86ca67f..84383c5a8b 100644 --- a/legacy/evas/src/evas_render.c +++ b/legacy/evas/src/evas_render.c @@ -45,15 +45,6 @@ evas_set_output(Evas e, Display *disp, Drawable d, Visual *v, Colormap c) e->current.colormap = c; } -void -evas_set_output_rect(Evas e, int x, int y, int w, int h) -{ - e->current.output.x = x; - e->current.output.y = y; - e->current.output.w = w; - e->current.output.h = h; -} - void evas_set_output_viewport(Evas e, double x, double y, double w, double h) { diff --git a/legacy/evas/test/evas_test.c b/legacy/evas/test/evas_test.c index a3523279c7..88047ec4b2 100644 --- a/legacy/evas/test/evas_test.c +++ b/legacy/evas/test/evas_test.c @@ -126,9 +126,18 @@ main(int argc, char **argv) __evas_gl_line_draw(d, win, win_w, win_h, 10, 20, 100, 160, 255, 255, 255, 255); + __evas_gl_line_draw(d, win, win_w, win_h, + 10, 20, 100, 40, + 0, 0, 255, 180); __evas_gl_line_draw(d, win, win_w, win_h, 10, 20, 100, 20, 0, 0, 0, 255); + __evas_gl_line_draw(d, win, win_w, win_h, + 10, 20, 100, 5, + 255, 0, 0, 255); + __evas_gl_line_draw(d, win, win_w, win_h, + 10, 20, 12, 2, + 80, 160, 80, 255); __evas_gl_line_draw(d, win, win_w, win_h, 10, 20, 10, 200, 255, 255, 0, 100);