split that up.....


SVN revision: 2956
This commit is contained in:
Carsten Haitzler 2000-07-31 18:06:21 +00:00
parent 3f4531de45
commit 7c0f7a6f9a
15 changed files with 579 additions and 6 deletions

View File

@ -13,6 +13,7 @@ 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;
typedef struct _Evas_Layer * Evas_Layer;
typedef struct _Evas_Color_Point * Evas_Color_Point;
@ -30,6 +31,7 @@ typedef struct _Evas_Object_Evas * Evas_Object_Evas;
#define RENDER_METHOD_BASIC_HARDWARE 1
#define RENDER_METHOD_3D_HARDWARE 2
#define RENDER_METHOD_ALPHA_HARDWARE 3
#define RENDER_METHOD_COUNT 4
#define CALLBACK_MOUSE_IN 0
#define CALLBACK_MOUSE_OUT 1
@ -72,17 +74,22 @@ struct _Evas
Evas_Render_Method render_method;
void *renderer_data;
Evas_Render_Data renderer_data;
} current, previous;
void (*object_render_data_free) (Evas _e, Evas_Object _o);
void (*evas_render_data_free) (Evas _e);
void (*object_renderer_data_free) (Evas _e, Evas_Object _o);
void (*evas_renderer_data_free) (Evas _e);
Evas_List layers;
Evas_List updates;
};
struct _Evas_Render_Data
{
void *method[RENDER_METHOD_COUNT];
};
struct _Evas_Color_Point
{
int r, g, b, a;
@ -114,7 +121,7 @@ struct _Evas_Layer
int store;
} current, previous;
void *renderer_data;
Evas_Render_Data renderer_data;
};
struct _Evas_Callback

View File

@ -17,7 +17,9 @@ include_HEADERS = \
Evas.h
libevas_la_SOURCES = \
evas_main.c \
evas_bits.c evas_callbacks.c evas_events.c evas_gradient.c evas_image.c \
evas_line.c evas_list.c evas_main.c evas_misc.c evas_object.c \
evas_rectangle.c evas_render.c evas_text.c \
Evas.h
libevas_la_LIBADD = -lX11 -lXext -lttf -ldl -lm -lImlib2 $(LDFLAGS)

View File

@ -0,0 +1,31 @@
#include "Evas.h"
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
Evas_Object
evas_add_bits(Evas e, char *file)
{
}
/* evas bits ops */
void
evas_bits_get_padding(Evas e, Evas_Object o, double *l, double *r, double *t, double *b)
{
}
void
evas_bits_get_min(Evas e, Evas_Object o, double *w, double *h)
{
}
void
evas_bits_get_max(Evas e, Evas_Object o, double *w, double *h)
{
}
void
evas_bits_get_classed_bit_geoemtry(Evas e, Evas_Object o, char *class, double *x, double *y, double *w, double *h)
{
}

View File

@ -0,0 +1,17 @@
#include "Evas.h"
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
/* callbacks */
void
evas_callback_add(Evas e, Evas_Object o, Evas_Callback_Type callback, void (*func) (void *_data, Evas _e, char *_class, Evas_Object _o, int _b, int _x, int _y), void *data)
{
}
void
evas_callback_del(Evas e, Evas_Object o, Evas_Callback_Type callback)
{
}

View File

@ -0,0 +1,31 @@
#include "Evas.h"
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
/* events */
void
evas_event_button_down(Evas e, int x, int y, int b)
{
}
void
evas_event_button_up(Evas e, int x, int y, int b)
{
}
void
evas_event_move(Evas e, int x, int y)
{
}
void
evas_event_enter(Evas e)
{
}
void
evas_event_leave(Evas e)
{
}

View File

@ -0,0 +1,31 @@
#include "Evas.h"
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
Evas_Object
evas_add_gradient_box(Evas e)
{
}
void
evas_set_gradient(Evas e, Evas_Object o, Evas_Gradient grad)
{
}
/* gradient creating / deletion / modification */
Evas_Gradient
evas_gradient_new(void)
{
}
void
evas_gradient_free(Evas_Gradient grad)
{
}
void
evas_gradient_add_color(Evas_Gradient grad, int r, int g, int b, int a, int dist)
{
}

View File

@ -0,0 +1,43 @@
#include "Evas.h"
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
/* adding objects */
Evas_Object
evas_add_image_from_file(Evas e, char *file)
{
}
Evas_Object
evas_add_image_from_data(Evas e, void *data, Evas_Image_Format format, int w, int h)
{
}
/* set object settings */
void
evas_set_image_file(Evas e, Evas_Object o, char *file)
{
}
void
evas_set_image_data(Evas e, Evas_Object o, void *data, Evas_Image_Format format, int w, int h)
{
}
void
evas_set_image_scale_smoothness(Evas e, Evas_Object o, int smooth)
{
}
void
evas_set_image_fill(Evas e, Evas_Object o, double x, double y, double w, double h)
{
}
/* image query ops */
void
evas_get_image_size(Evas e, Evas_Object o, int *w, int *h)
{
}

View File

@ -0,0 +1,15 @@
#include "Evas.h"
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
Evas_Object
evas_add_line(Evas e, int r, int g, int b, int a)
{
}
void
evas_set_line_xy(Evas e, Evas_Object o, double x1, double y1, double x2, double y2)
{
}

152
legacy/evas/src/evas_list.c Normal file
View File

@ -0,0 +1,152 @@
#include "Evas.h"
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
/* list ops */
Evas_List
evas_list_append(Evas_List list, void *data)
{
Evas_List l, new_l;
new_l = malloc(sizeof(struct _Evas_List));
new_l->next = NULL;
new_l->prev = NULL;
new_l->data = data;
if (!list) return new_l;
for (l = list; l; l = l->next)
{
if (!l->next)
{
l->next = new_l;
new_l->prev = l;
return list;
}
}
return list;
}
Evas_List
evas_list_prepend(Evas_List list, void *data)
{
Evas_List new_l;
new_l = malloc(sizeof(struct _Evas_List));
new_l->next = NULL;
new_l->prev = NULL;
new_l->data = data;
if (!list) return new_l;
new_l->next = list;
list->prev = new_l;
return new_l;
}
Evas_List
evas_list_append_relative(Evas_List list, void *data, void *relative)
{
Evas_List l;
for (l = list; l; l = l->next)
{
if (l->data == relative)
{
Evas_List new_l;
new_l = malloc(sizeof(struct _Evas_List));
new_l->next = NULL;
new_l->prev = NULL;
new_l->data = data;
if (l->next)
{
new_l->next = l->next;
l->next->prev = new_l;
}
l->next = new_l;
new_l->prev = l;
return list;
}
}
return evas_list_append(list, data);
}
Evas_List
evas_list_prepend_relative(Evas_List list, void *data, void *relative)
{
Evas_List l;
for (l = list; l; l = l->next)
{
if (l->data == relative)
{
Evas_List new_l;
new_l = malloc(sizeof(struct _Evas_List));
new_l->next = NULL;
new_l->prev = NULL;
new_l->data = data;
new_l->prev = l->prev;
new_l->next = l;
if (l->prev)
l->prev->next = new_l;
l->prev = new_l;
if (new_l->prev)
return list;
else
return new_l;
}
}
return evas_list_prepend(list, data);
}
Evas_List
evas_list_remove(Evas_List list, void *data)
{
Evas_List l, return_l;
for (l = list; l; l = l->next)
{
if (l->data == data)
{
if (l->next)
l->next->prev = l->prev;
if (l->prev)
{
l->prev->next = l->next;
return_l = l->prev;
}
else
return_l = l->next;
free(l);
return return_l;
}
}
return list;
}
void *
evas_list_find(Evas_List list, void *data)
{
Evas_List l;
for (l = list; l; l = l->next)
{
if (l->data == data) return data;
}
return NULL;
}
Evas_List
evas_list_free(Evas_List list)
{
Evas_List l, free_l;
for (l = list; l;)
{
free_l = l;
l = l->next;
free(free_l);
}
return NULL;
}

View File

@ -4,6 +4,8 @@
#include <unistd.h>
#include <string.h>
#if 0
/* create and destroy */
Evas
evas_new(void)
@ -116,8 +118,9 @@ evas_del_object(Evas e, Evas_Object o)
if (layer->layer == o->current.layer)
{
layer->objects = evas_list_remove(layer->objects, o);
e->object_renderer_data_free(e, o);
o->object_free(o);
e->object_render_data_free(e, o);
return;
}
}
}
@ -505,3 +508,4 @@ evas_list_free(Evas_List list)
return NULL;
}
#endif

View File

@ -0,0 +1,58 @@
#include "Evas.h"
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
/* create and destroy */
Evas
evas_new(void)
{
Evas e;
e = malloc(sizeof(struct _Evas));
memset(e, 0, sizeof(struct _Evas));
e->current.viewport.x = 0.0;
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;
return e;
}
void
evas_free(Evas e)
{
Evas_List l;
for (l = e->layers; l; l = l->next)
{
/* FIXME: free layer */
}
if (e->layers) evas_list_free(e->layers);
free(e);
}
void
evas_set_color(Evas e, Evas_Object o, int r, int g, int b, int a)
{
}
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)
{
}

View File

@ -0,0 +1,92 @@
#include "Evas.h"
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
/* deleting objects */
void
evas_del_object(Evas e, Evas_Object o)
{
Evas_List l;
for (l = e->layers; l; l = l->next)
{
Evas_Layer layer;
layer = l->data;
if (layer->layer == o->current.layer)
{
layer->objects = evas_list_remove(layer->objects, o);
e->object_renderer_data_free(e, o);
o->object_free(o);
return;
}
}
}
/* adding objects */
Evas_Object
evas_add_evas(Evas e, Evas evas)
{
}
/* layer stacking for object */
void
evas_set_layer(Evas e, Evas_Object o, int l)
{
}
void
evas_set_layer_store(Evas e, int l, int store)
{
}
/* stacking within a layer */
void
evas_raise(Evas e, Evas_Object o)
{
}
void
evas_lower(Evas e, Evas_Object o)
{
}
void
evas_stack_above(Evas e, Evas_Object o, int above)
{
}
void
evas_stack_below(Evas e, Evas_Object o, int above)
{
}
/* object geoemtry */
void
evas_move(Evas e, Evas_Object o, double x, double y)
{
}
void
evas_resize(Evas e, Evas_Object o, double w, double h)
{
}
void
evas_get_geometry(Evas e, Evas_Object o, double *x, double *y, double *w, double *h)
{
}
/* object visibility */
void
evas_show(Evas e, Evas_Object o)
{
}
void
evas_hide(Evas e, Evas_Object o)
{
}

View File

@ -0,0 +1,10 @@
#include "Evas.h"
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
Evas_Object
evas_add_rectangle(Evas e, int r, int g, int b, int a)
{
}

View File

@ -0,0 +1,70 @@
#include "Evas.h"
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
/* for exposes or forced redraws (relative to output drawable) */
void
evas_update_rect(Evas e, int x, int y, int w, int h)
{
Evas_Rectangle r;
r = malloc(sizeof(struct _Evas_Rectangle));
r->x = x;
r->y = y;
r->w = w;
r->h = h;
e->updates = evas_list_prepend(e->updates, r);
}
/* drawing */
void
evas_render(Evas e)
{
}
/* query for settings to use */
Visual *
evas_get_optimal_visual(Evas e, Display *disp)
{
}
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)
{
e->current.display = disp;
e->current.drawable = d;
e->current.visual = v;
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)
{
e->current.viewport.x = x;
e->current.viewport.y = y;
e->current.viewport.w = w;
e->current.viewport.h = h;
}
void
evas_set_output_method(Evas e, Evas_Render_Method method)
{
e->current.render_method = method;
}

View File

@ -0,0 +1,10 @@
#include "Evas.h"
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
Evas_Object
evas_add_text(Evas e, char *font, int size, char *text)
{
}