some more meat......

SVN revision: 2944
This commit is contained in:
Carsten Haitzler 2000-07-30 22:42:55 +00:00
parent 1c8ee0b297
commit cd75e0b1eb
2 changed files with 177 additions and 7 deletions

View File

@ -15,6 +15,7 @@ typedef int Evas_Blend_Mode;
typedef struct _Evas_List * Evas_List;
typedef struct _Evas_Layer * Evas_Layer;
typedef struct _Evas_Color_Point * Evas_Color_Point;
typedef struct _Evas_Callback * Evas_Callback;
typedef struct _Evas_Object_Image * Evas_Object_Image;
typedef struct _Evas_Object_Text * Evas_Object_Text;
typedef struct _Evas_Object_Rectangle * Evas_Object_Rectangle;
@ -53,7 +54,7 @@ struct _Evas
double x, y, w, h;
} viewport;
Evas_List *layers;
Evas_List layers;
int render_method;
@ -62,7 +63,7 @@ struct _Evas
} current, previous;
/* externally provided updates for drawable relative rects */
Evas_List *updates;
Evas_List updates;
};
struct _Evas_Color_Point
@ -73,20 +74,20 @@ struct _Evas_Color_Point
struct _Evas_Gradient
{
Evas_List *color_points;
Evas_List color_points;
};
struct _Evas_List
{
Evas_List *prev, *next;
Evas_List prev, next;
void *data;
};
struct _Evas_Layer
{
int layer;
Evas_List *objects;
Evas_List *groups;
Evas_List objects;
Evas_List groups;
struct {
int store;
@ -95,6 +96,13 @@ struct _Evas_Layer
void *renderer_data;
};
struct _Evas_Callback
{
Evas_Callback_Type type;
void *data;
void (*callback) (void *_data, Evas _e, char *_class, Evas_Object _o, int _b, int _x, int _y);
};
struct _Evas_Object_Any
{
int type;
@ -103,9 +111,12 @@ struct _Evas_Object_Any
Evas_Blend_Mode mode;
int zoomscale;
} current, previous;
Evas_List *groups;
Evas_List groups;
Evas_List callbacks;
void *renderer_data;
};
struct _Evas_Object_Image
@ -270,6 +281,15 @@ void evas_event_leave(Evas e);
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);
/* list ops */
Evas_List evas_list_append(Evas_List list, void *data);
Evas_List evas_list_prepend(Evas_List list, void *data);
Evas_List evas_list_append_relative(Evas_List list, void *data, void *relative);
Evas_List evas_list_prepend_relative(Evas_List list, void *data, void *relative);
Evas_List evas_list_remove(Evas_List list, void *data);
void * evas_list_find(Evas_List list, void *data);
Evas_List evas_list_free(Evas_List list);
#ifdef __cplusplus
}
#endif

View File

@ -1,4 +1,7 @@
#include "Evas.h"
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
/* create and destroy */
Evas
@ -300,6 +303,7 @@ evas_event_leave(Evas e)
/* 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)
{
}
@ -308,3 +312,149 @@ evas_callback_del(Evas e, Evas_Object o, Evas_Callback_Type callback)
{
}
/* 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;
}