save a few bytes by packing structures better... simple savings :)

SVN revision: 30486
This commit is contained in:
Carsten Haitzler 2007-06-28 23:22:20 +00:00
parent 47b408af54
commit 0c4af24a33
11 changed files with 146 additions and 139 deletions

View File

@ -400,19 +400,12 @@ struct _Edje_Part_Collection
struct _Edje_Part
{
char *name; /* the name if any of the part */
int id; /* its id number */
unsigned char type; /* what type (image, rect, text) */
unsigned char effect; /* 0 = plain... */
unsigned char mouse_events; /* it will affect/respond to mouse events */
unsigned char repeat_events; /* it will repeat events to objects below */
int clip_to_id; /* the part id to clip this one to */
unsigned char use_alternate_font_metrics;
Edje_Part_Description *default_desc; /* the part descriptor for default */
Evas_List *other_desc; /* other possible descriptors */
char *source;
int id; /* its id number */
int clip_to_id; /* the part id to clip this one to */
struct {
signed char x; /* can u click & drag this bit in x dir */
signed char y; /* can u click & drag this bit in y dir */
int step_x; /* drag jumps n pixels (0 = no limit) */
int step_y; /* drag jumps n pixels (0 = no limit) */
@ -423,8 +416,15 @@ struct _Edje_Part
/* davinchi */
int events_id; /* If it is used as scrollbar */
char x; /* can u click & drag this bit in x dir */
char y; /* can u click & drag this bit in y dir */
} dragable;
char *source;
unsigned char type; /* what type (image, rect, text) */
unsigned char effect; /* 0 = plain... */
unsigned char mouse_events; /* it will affect/respond to mouse events */
unsigned char repeat_events; /* it will repeat events to objects below */
unsigned char use_alternate_font_metrics;
};
struct _Edje_Part_Image_Id
@ -435,12 +435,10 @@ struct _Edje_Part_Image_Id
struct _Edje_Part_Description
{
struct {
char *name; /* the named state if any */
double value; /* the value of the state (for ranges) */
char *name; /* the named state if any */
} state;
unsigned char visible; /* is it shown */
struct {
double x, y; /* 0 <-> 1.0 alignment within allocated space */
} align;
@ -472,14 +470,14 @@ struct _Edje_Part_Description
} rel1, rel2;
struct {
int id; /* the image id to use */
Evas_List *tween_list; /* list of Edje_Part_Image_Id */
int id; /* the image id to use */
} image;
struct {
int id; /* the spectrum id to use */
char *type; /* type of spectrum - 'linear', 'radial', etc */
char *params; /* params for spectrum type */
int id; /* the spectrum id to use */
int use_rel; /* 1 - use rel1,rel2; 0 - use fill */
struct {
double relative_x;
@ -495,32 +493,35 @@ struct _Edje_Part_Description
} border;
struct {
char smooth; /* fill with smooth scaling or not */
double pos_rel_x; /* fill offset x relative to area */
int pos_abs_x; /* fill offset x added to fill offset */
double rel_x; /* relative size compared to area */
int abs_x; /* size of fill added to relative fill */
double pos_rel_y; /* fill offset y relative to area */
int pos_abs_y; /* fill offset y added to fill offset */
double rel_y; /* relative size compared to area */
int pos_abs_x; /* fill offset x added to fill offset */
int abs_x; /* size of fill added to relative fill */
int pos_abs_y; /* fill offset y added to fill offset */
int abs_y; /* size of fill added to relative fill */
int angle; /* angle of fill -- currently only used by grads */
int spread; /* spread of fill -- currently only used by grads */
char smooth; /* fill with smooth scaling or not */
} fill;
char *color_class; /* how to modify the color */
struct {
unsigned char r, g, b, a; /* color for rect or text, shadow etc. */
} color, color2, color3;
struct {
char *text; /* if "" or NULL, then leave text unchanged */
char *text_class; /* how to apply/modify the font */
char *style; /* the text style if a textblock */
char *font; /* if a specific font is asked for */
struct {
double x, y; /* text alignment within bounds */
} align;
double elipsis; /* 0.0 - 1.0 defining where the elipsis align */
int size; /* 0 = use user set size */
int id_source; /* -1 if none */
int id_text_source; /* -1 if none */
unsigned char fit_x; /* resize font size down to fit in x dir */
unsigned char fit_y; /* resize font size down to fit in y dir */
@ -529,14 +530,13 @@ struct _Edje_Part_Description
unsigned char max_x; /* if text size should be part max size */
unsigned char max_y; /* if text size should be part max size */
struct {
double x, y; /* text alignment within bounds */
} align;
int id_source; /* -1 if none */
int id_text_source; /* -1 if none */
double elipsis; /* 0.0 - 1.0 defining where the elipsis align */
} text;
struct {
unsigned char r, g, b, a; /* color for rect or text, shadow etc. */
} color, color2, color3;
unsigned char visible; /* is it shown */
};
@ -572,6 +572,42 @@ struct _Edje
struct {
Evas_Coord w, h;
} min;
double paused_at;
Evas *evas; /* the Evas this Edje belongs to */
Evas_Object *obj; /* the smart object */
Evas_Object *clipper; /* a big rect to clip this Edje to */
Edje_File *file; /* the file the data comes form */
Edje_Part_Collection *collection; /* the description being used */
Evas_List *actions; /* currently running actions */
Evas_List *callbacks;
Evas_List *pending_actions;
Evas_List *color_classes;
Evas_List *text_classes;
/* variable pool for Edje Embryo scripts */
Edje_Var_Pool *var_pool;
/* for faster lookups to avoid nth list walks */
Edje_Real_Part **table_parts;
Edje_Program **table_programs;
int table_programs_size;
int table_parts_size;
int references;
int block;
int load_error;
int freeze;
struct {
void (*func) (void *data, Evas_Object *obj, const char *part);
void *data;
} text_change;
struct {
void (*func) (void *data, Evas_Object *obj, Edje_Message_Type type, int id, void *msg);
void *data;
int num;
} message;
int processing_messages;
unsigned short dirty : 1;
unsigned short recalc : 1;
unsigned short walking_callbacks : 1;
@ -584,45 +620,15 @@ struct _Edje
unsigned short walking_actions : 1;
unsigned short block_break : 1;
unsigned short delete_me : 1;
double paused_at;
Evas *evas; /* the Evas this Edje belongs to */
Evas_Object *obj; /* the smart object */
Evas_Object *clipper; /* a big rect to clip this Edje to */
Edje_File *file; /* the file the data comes form */
Edje_Part_Collection *collection; /* the description being used */
Evas_List *actions; /* currently running actions */
Evas_List *callbacks;
Evas_List *pending_actions;
Evas_List *color_classes;
Evas_List *text_classes;
int references;
int block;
int load_error;
int freeze;
/* variable pool for Edje Embryo scripts */
Edje_Var_Pool *var_pool;
/* for faster lookups to avoid nth list walks */
int table_parts_size;
Edje_Real_Part **table_parts;
int table_programs_size;
Edje_Program **table_programs;
struct {
void (*func) (void *data, Evas_Object *obj, const char *part);
void *data;
} text_change;
int processing_messages;
struct {
int num;
void (*func) (void *data, Evas_Object *obj, Edje_Message_Type type, int id, void *msg);
void *data;
} message;
};
struct _Edje_Real_Part
{
Edje *edje;
Evas_Object *object;
Evas_List *extra_objects;
Evas_Object *swallowed_object;
Edje_Part *part;
int x, y, w, h;
struct {
int x, y, w, h;
@ -630,38 +636,32 @@ struct _Edje_Real_Part
struct {
int x, y;
} offset;
Evas_Object *object;
Evas_List *extra_objects;
Evas_Object *swallowed_object;
struct {
struct {
int w, h;
} min, max;
struct {
unsigned char mode;
int w, h;
unsigned char mode;
} aspect;
} swallow_params;
unsigned char calculated;
unsigned char calculating;
int clicked_button;
unsigned char still_in : 1;
Edje_Part *part;
struct {
double x, y;
struct {
unsigned count;
double x, y;
} val, size, step, page;
struct {
unsigned int count;
int x, y;
} down;
struct {
int x, y;
} tmp;
double x, y;
unsigned char need_reset : 1;
struct {
double x, y;
} val, size, step, page;
} drag;
struct {
Edje_Real_Part *source;
Edje_Real_Part *text_source;
const char *text;
const char *font;
const char *style;
@ -676,12 +676,8 @@ struct _Edje_Real_Part
double elipsis;
int fit_x, fit_y;
} cache;
Edje_Real_Part *source;
Edje_Real_Part *text_source;
} text;
int gradient_id;
double description_pos;
Edje_Part_Description *chosen_description;
struct {
@ -697,6 +693,14 @@ struct _Edje_Real_Part
Edje_Running_Program *program;
Edje_Real_Part *events_to;
int clicked_button;
int gradient_id;
unsigned char calculated;
unsigned char calculating;
unsigned char still_in : 1;
};
struct _Edje_Running_Program
@ -726,8 +730,6 @@ struct _Edje_Calc_Params
struct {
int x, y, w, h;
} req_drag;
unsigned char visible : 1;
unsigned char smooth : 1;
struct {
int x, y, w, h;
int angle;
@ -749,6 +751,8 @@ struct _Edje_Calc_Params
int id;
char *type;
} gradient;
unsigned char visible : 1;
unsigned char smooth : 1;
};
struct _Edje_Pending_Program
@ -845,7 +849,6 @@ struct _Edje_Var_Pool
struct _Edje_Var
{
unsigned char type;
union {
Edje_Var_Int i;
Edje_Var_Float f;
@ -853,6 +856,7 @@ struct _Edje_Var
Edje_Var_List l;
Edje_Var_Hash h;
} data;
unsigned char type;
};

View File

@ -39,22 +39,20 @@ typedef struct _Eet_File_Directory Eet_File_Directory;
struct _Eet_File
{
char *path;
FILE *fp;
Eet_File_Header *header;
uint8_t *data;
int magic;
int references;
char *path;
FILE *fp;
Eet_File_Mode mode;
int data_size;
time_t mtime;
unsigned char writes_pending : 1;
unsigned char delete_me_now : 1;
Eet_File_Header *header;
uint8_t *data;
int data_size;
time_t mtime;
};
struct _Eet_File_Header
@ -71,16 +69,16 @@ struct _Eet_File_Directory
struct _Eet_File_Node
{
unsigned char free_name : 1;
unsigned char compression : 1;
char *name;
void *data;
Eet_File_Node *next; /* FIXME: make buckets linked lists */
int offset;
int size;
int data_size;
char *name;
void *data;
Eet_File_Node *next; /* FIXME: make buckets linked lists */
unsigned char free_name : 1;
unsigned char compression : 1;
};
#if 0

View File

@ -26,14 +26,14 @@ struct _Evas_Object_Gradient
char *name;
char *params;
} type;
unsigned char gradient_opaque : 1;
unsigned char gradient_opaque : 1;
} cur, prev;
void *engine_data;
unsigned char changed : 1;
unsigned char gradient_changed : 1;
unsigned char type_changed : 1;
void *engine_data;
};
/* private methods for gradient objects */

View File

@ -31,9 +31,6 @@ struct _Evas_Object_Image
char has_alpha :1;
} cur, prev;
char changed : 1;
char dirty_pixels : 1;
int pixels_checked_out;
int load_error;
Evas_List *pixel_updates;
@ -50,6 +47,9 @@ struct _Evas_Object_Image
} func;
void *engine_data;
char changed : 1;
char dirty_pixels : 1;
};
/* private methods for image objects */

View File

@ -19,9 +19,10 @@ struct _Evas_Object_Line
} cache;
Evas_Coord x1, y1, x2, y2;
} cur, prev;
char changed : 1;
void *engine_data;
char changed : 1;
};
/* private methods for line objects */

View File

@ -12,9 +12,10 @@ struct _Evas_Object_Polygon
{
DATA32 magic;
Evas_List *points;
char changed : 1;
void *engine_data;
char changed : 1;
};
struct _Evas_Polygon_Point

View File

@ -13,9 +13,9 @@ struct _Evas_Object_Smart
struct _Evas_Smart_Callback
{
const char *event;
char delete_me : 1;
void (*func) (void *data, Evas_Object *obj, void *event_info);
void *func_data;
char delete_me : 1;
};
/* private methods for smart objects */

View File

@ -26,12 +26,13 @@ struct _Evas_Object_Text
unsigned char style;
} cur, prev;
char changed : 1;
float ascent, descent;
float max_ascent, max_descent;
void *engine_data;
char changed : 1;
};
/* private methods for text objects */

View File

@ -34,8 +34,8 @@ struct _Evas_Object_Style_Tag
struct _Evas_Object_Textblock_Node
{ Evas_Object_List _list_data;
int type;
char *text;
int type;
int len, alloc;
};
@ -50,13 +50,13 @@ struct _Evas_Object_Textblock_Line
struct _Evas_Object_Textblock_Item
{ Evas_Object_List _list_data;
unsigned char type;
char *text;
int x, w, h;
int inset, baseline;
Evas_Object_Textblock_Format *format;
Evas_Object_Textblock_Node *source_node;
int x, w, h;
int inset, baseline;
int source_pos;
unsigned char type;
};
struct _Evas_Object_Textblock_Format_Item
@ -126,13 +126,13 @@ struct _Evas_Object_Textblock
int l, r, t, b;
} style_pad;
char *markup_text;
char changed : 1;
void *engine_data;
struct {
int w, h;
unsigned char valid : 1;
} formatted, native;
unsigned char redraw : 1;
unsigned char changed : 1;
};
/* private methods for textblock objects */

View File

@ -263,8 +263,8 @@ struct _RGBA_Draw_Context
DATA32 col;
} col;
struct RGBA_Draw_Context_clip {
char use : 1;
int x, y, w, h;
char use : 1;
} clip;
Cutout_Rects cutout;
struct {
@ -289,8 +289,8 @@ struct _RGBA_Surface
{
int w, h;
DATA32 *data;
char no_free : 1;
RGBA_Image *im;
char no_free : 1;
};
struct _RGBA_Pipe_Op
@ -358,17 +358,16 @@ struct _RGBA_Image
{
void *module;
void *loader;
// int format;
char *file;
char *real_file;
char *key;
char *comment;
// int format;
} info;
int references;
void *extended_info;
RGBA_Image_Loadopts load_opts;
unsigned char scale;
RGBA_Pipe *pipe;
int references;
RGBA_Image_Loadopts load_opts;
int ref;
time_t timestamp;
time_t laststat;
@ -378,6 +377,7 @@ struct _RGBA_Image
unsigned char no_free : 1;
unsigned char dirty : 1;
} cs;
unsigned char scale;
};
struct _RGBA_Gradient_Color_Stop
@ -400,26 +400,24 @@ struct _RGBA_Gradient
{
DATA32 *data;
int len;
unsigned char has_alpha : 1;
float angle;
int direction;
float offset;
unsigned char has_alpha : 1;
} map;
struct {
Evas_Object_List *stops;
int nstops;
DATA32 *data;
int nstops;
int len;
} color;
struct {
Evas_Object_List *stops;
int nstops;
DATA8 *data;
int nstops;
int len;
} alpha;
unsigned char imported_data : 1;
unsigned char has_alpha : 1;
struct
{
@ -436,6 +434,9 @@ struct _RGBA_Gradient
} type;
int references;
unsigned char imported_data : 1;
unsigned char has_alpha : 1;
};
struct _RGBA_Gradient_Type

View File

@ -39,19 +39,20 @@ struct _Evas_Module
void *handle; /* the dlopen handle */
char *path; /* the path where this modules is */
char *name; /* the name of the dir where this module is */
Evas_Module_Type type; /* the type detected by the path */
struct
{
int (*open)(Evas_Module *);
void (*close)(Evas_Module *);
} func;
unsigned char loaded : 1;
void *functions; /* this are the functions exported by the module */
void *data; /* some internal data for the module i.e the id for engines */
Evas_Module_Type type; /* the type detected by the path */
int ref; /* how many refs */
int last_used; /* the cycle count when it was last used */
unsigned char loaded : 1;
};
@ -219,10 +220,11 @@ struct _Evas_Smart
int usage;
Evas_Smart_Class *smart_class;
unsigned char delete_me : 1;
unsigned char class_allocated : 1;
Evas_Smart_Class *smart_class;
};
struct _Evas_Modifier
@ -245,9 +247,9 @@ struct _Evas_Lock
struct _Evas_Callbacks
{
unsigned char deletions_waiting : 1;
int walking_list;
Evas_Object_List *callbacks;
int walking_list;
unsigned char deletions_waiting : 1;
/*
Evas_Object_List *down;
Evas_Object_List *up;
@ -299,8 +301,6 @@ struct _Evas
unsigned char changed : 1;
} output;
int output_validity;
Evas_List *damages;
Evas_List *obscures;
@ -308,7 +308,7 @@ struct _Evas
Evas_Hash *name_hash;
unsigned char changed : 1;
int output_validity;
int walking_list;
int events_frozen;
@ -333,13 +333,14 @@ struct _Evas
Evas_List *font_path;
Evas_Object *focused;
void *attach_data;
Evas_Modifier modifiers;
Evas_Lock locks;
unsigned int last_timestamp;
void *attach_data;
int last_mouse_down_counter;
int last_mouse_up_counter;
Evas_Font_Hinting_Flags hinting;
unsigned char changed : 1;
unsigned char delete_me : 1;
};
@ -477,7 +478,6 @@ struct _Evas_Font_Dir
struct _Evas_Font
{
char type;
struct {
const char *prop[14];
} x;
@ -485,6 +485,7 @@ struct _Evas_Font
const char *name;
} simple;
const char *path;
char type;
};
struct _Evas_Font_Alias