Alright, I spent some time now reading e17's code. Here's what
I've changed, this is big, so read this carefully :)
* I've added debugging macros for messages and function call
tracing. Usage:
D("Creating item %i %i %i\n", x, y, z);
Define DEBUG to use the D macro.
D_ENTER;
D_RETURN;
D_RETURN_(x);
These are for call tracing. Use D_RETURN_(x) when returning
something from a function. Define DEBUG_NEST to use this.
* added iconbar header file to Makefile.am
* added proper new()/cleanup() calls for E_Delayed_Action;
* I've completely rewritten the object and observer handling. Bye
bye macros, this was nasty. It'll be hard enough to avoid leaks
with usecounting in C. We now basically have the same system as gtk.
There's a clear separation of observer and object code now.
An E_Object by itself has nothing to do with observing or being
observed, therefore, there are now E_Observers and E_Observees
that are derived from E_Object. IMPORTANT: The cleanup system now
reflects the reference count system, therefore, all ..._free()
calls are now static, because the destructor should never be called explicitly, but implicitly through e_object_unref(). The object handling
now is as follows:
- The cleanup functions clean up everything that is contained in
a struct, but NOT the struct itself. Instead of the final
free() call, they call the destructor of the base class. The
calls will walk up the hierarchy and clean up what's contained in
every struct, and the final e_object_cleanup() will free the
structure itself. E_Delayed_Action is a good example.
- The only calls that influence the reference count are
e_object_ref() and e_object_unref(). If you need to do things
before an object gets destroyed, you can query the use count using
e_object_get_usecount() and check if it's equal to 1. So this:
OBJ_UNREF(b);
OBJ_IF_FREE(b)
{
ecore_window_reparent(e->win, 0, 0, 0);
e_icccm_release(e->win);
OBJ_FREE(b);
}
now is this:
if (e_object_get_usecount(E_OBJECT(b)) == 1)
{
ecore_window_reparent(e->win, 0, 0, 0);
e_icccm_release(e->win);
}
e_object_unref(E_OBJECT(b));
object.h and observer.h are completely commented, it shouldn't be
too hard to understand. This'll need to be documented in the manual
anyway.
* E_Objects are now used in lots of places where void* were used as
pointers to objects before, especially in the actions code. This is
obviously better, as it will generate compiler warnings when people
want to pass things to functions that expect E_Objects. This could
probably be more restrictive.
* Added typedefs for the function prototypes in E_Action_Impl. Those
fat signatures were just painful to read in the function
declarations/implementations.
* I've also tried to give parameters more useful names. Calling an
object "o" is a lot of fun when you want to grep for it.
* Included is also Graham's latest menu.c patch. Sorry for the
delay, Graham.
* I've added checks to the menu code that make sure that menus
don't pop up when they're empty (which resulted in a little useless
rectangle).
I guess that's it for now. Sorry if I broke anything, but this was
necessary imho.
SVN revision: 5605
2001-11-02 09:07:52 -08:00
|
|
|
#include "debug.h"
|
2001-07-30 09:59:37 -07:00
|
|
|
#include "config.h"
|
|
|
|
#include "util.h"
|
2000-12-13 16:12:16 -08:00
|
|
|
|
2000-12-15 13:27:23 -08:00
|
|
|
static char cfg_root[] = "";
|
|
|
|
|
2000-12-14 15:13:08 -08:00
|
|
|
#define E_CONF(_key, _var, _args...) \
|
|
|
|
{ \
|
|
|
|
if (!strcmp(type, _key)) \
|
|
|
|
{ \
|
Alright, I spent some time now reading e17's code. Here's what
I've changed, this is big, so read this carefully :)
* I've added debugging macros for messages and function call
tracing. Usage:
D("Creating item %i %i %i\n", x, y, z);
Define DEBUG to use the D macro.
D_ENTER;
D_RETURN;
D_RETURN_(x);
These are for call tracing. Use D_RETURN_(x) when returning
something from a function. Define DEBUG_NEST to use this.
* added iconbar header file to Makefile.am
* added proper new()/cleanup() calls for E_Delayed_Action;
* I've completely rewritten the object and observer handling. Bye
bye macros, this was nasty. It'll be hard enough to avoid leaks
with usecounting in C. We now basically have the same system as gtk.
There's a clear separation of observer and object code now.
An E_Object by itself has nothing to do with observing or being
observed, therefore, there are now E_Observers and E_Observees
that are derived from E_Object. IMPORTANT: The cleanup system now
reflects the reference count system, therefore, all ..._free()
calls are now static, because the destructor should never be called explicitly, but implicitly through e_object_unref(). The object handling
now is as follows:
- The cleanup functions clean up everything that is contained in
a struct, but NOT the struct itself. Instead of the final
free() call, they call the destructor of the base class. The
calls will walk up the hierarchy and clean up what's contained in
every struct, and the final e_object_cleanup() will free the
structure itself. E_Delayed_Action is a good example.
- The only calls that influence the reference count are
e_object_ref() and e_object_unref(). If you need to do things
before an object gets destroyed, you can query the use count using
e_object_get_usecount() and check if it's equal to 1. So this:
OBJ_UNREF(b);
OBJ_IF_FREE(b)
{
ecore_window_reparent(e->win, 0, 0, 0);
e_icccm_release(e->win);
OBJ_FREE(b);
}
now is this:
if (e_object_get_usecount(E_OBJECT(b)) == 1)
{
ecore_window_reparent(e->win, 0, 0, 0);
e_icccm_release(e->win);
}
e_object_unref(E_OBJECT(b));
object.h and observer.h are completely commented, it shouldn't be
too hard to understand. This'll need to be documented in the manual
anyway.
* E_Objects are now used in lots of places where void* were used as
pointers to objects before, especially in the actions code. This is
obviously better, as it will generate compiler warnings when people
want to pass things to functions that expect E_Objects. This could
probably be more restrictive.
* Added typedefs for the function prototypes in E_Action_Impl. Those
fat signatures were just painful to read in the function
declarations/implementations.
* I've also tried to give parameters more useful names. Calling an
object "o" is a lot of fun when you want to grep for it.
* Included is also Graham's latest menu.c patch. Sorry for the
delay, Graham.
* I've added checks to the menu code that make sure that menus
don't pop up when they're empty (which resulted in a little useless
rectangle).
I guess that's it for now. Sorry if I broke anything, but this was
necessary imho.
SVN revision: 5605
2001-11-02 09:07:52 -08:00
|
|
|
if ((_var)[0]) D_RETURN_(_var); \
|
2000-12-14 15:13:08 -08:00
|
|
|
sprintf((_var), ## _args); \
|
Alright, I spent some time now reading e17's code. Here's what
I've changed, this is big, so read this carefully :)
* I've added debugging macros for messages and function call
tracing. Usage:
D("Creating item %i %i %i\n", x, y, z);
Define DEBUG to use the D macro.
D_ENTER;
D_RETURN;
D_RETURN_(x);
These are for call tracing. Use D_RETURN_(x) when returning
something from a function. Define DEBUG_NEST to use this.
* added iconbar header file to Makefile.am
* added proper new()/cleanup() calls for E_Delayed_Action;
* I've completely rewritten the object and observer handling. Bye
bye macros, this was nasty. It'll be hard enough to avoid leaks
with usecounting in C. We now basically have the same system as gtk.
There's a clear separation of observer and object code now.
An E_Object by itself has nothing to do with observing or being
observed, therefore, there are now E_Observers and E_Observees
that are derived from E_Object. IMPORTANT: The cleanup system now
reflects the reference count system, therefore, all ..._free()
calls are now static, because the destructor should never be called explicitly, but implicitly through e_object_unref(). The object handling
now is as follows:
- The cleanup functions clean up everything that is contained in
a struct, but NOT the struct itself. Instead of the final
free() call, they call the destructor of the base class. The
calls will walk up the hierarchy and clean up what's contained in
every struct, and the final e_object_cleanup() will free the
structure itself. E_Delayed_Action is a good example.
- The only calls that influence the reference count are
e_object_ref() and e_object_unref(). If you need to do things
before an object gets destroyed, you can query the use count using
e_object_get_usecount() and check if it's equal to 1. So this:
OBJ_UNREF(b);
OBJ_IF_FREE(b)
{
ecore_window_reparent(e->win, 0, 0, 0);
e_icccm_release(e->win);
OBJ_FREE(b);
}
now is this:
if (e_object_get_usecount(E_OBJECT(b)) == 1)
{
ecore_window_reparent(e->win, 0, 0, 0);
e_icccm_release(e->win);
}
e_object_unref(E_OBJECT(b));
object.h and observer.h are completely commented, it shouldn't be
too hard to understand. This'll need to be documented in the manual
anyway.
* E_Objects are now used in lots of places where void* were used as
pointers to objects before, especially in the actions code. This is
obviously better, as it will generate compiler warnings when people
want to pass things to functions that expect E_Objects. This could
probably be more restrictive.
* Added typedefs for the function prototypes in E_Action_Impl. Those
fat signatures were just painful to read in the function
declarations/implementations.
* I've also tried to give parameters more useful names. Calling an
object "o" is a lot of fun when you want to grep for it.
* Included is also Graham's latest menu.c patch. Sorry for the
delay, Graham.
* I've added checks to the menu code that make sure that menus
don't pop up when they're empty (which resulted in a little useless
rectangle).
I guess that's it for now. Sorry if I broke anything, but this was
necessary imho.
SVN revision: 5605
2001-11-02 09:07:52 -08:00
|
|
|
D_RETURN_(_var); \
|
2000-12-14 15:13:08 -08:00
|
|
|
} \
|
|
|
|
}
|
|
|
|
|
2001-10-12 13:13:01 -07:00
|
|
|
static char cfg_grabs_db[PATH_MAX] = "";
|
|
|
|
static char cfg_settings_db[PATH_MAX] = "";
|
|
|
|
static char cfg_actions_db[PATH_MAX] = "";
|
|
|
|
static char cfg_borders_db[PATH_MAX] = "";
|
|
|
|
static char cfg_apps_menu_db[PATH_MAX] = "";
|
|
|
|
static char cfg_menus_dir[PATH_MAX] = "";
|
|
|
|
static char cfg_entries_dir[PATH_MAX] = "";
|
|
|
|
static char cfg_selections_dir[PATH_MAX] = "";
|
|
|
|
static char cfg_scrollbars_dir[PATH_MAX] = "";
|
|
|
|
static char cfg_guides_dir[PATH_MAX] = "";
|
|
|
|
static char cfg_user_dir[PATH_MAX] = "";
|
|
|
|
static char cfg_images_dir[PATH_MAX] = "";
|
|
|
|
static char cfg_cursors_dir[PATH_MAX] = "";
|
|
|
|
static char cfg_backgrounds_dir[PATH_MAX] = "";
|
|
|
|
static char cfg_fonts_dir[PATH_MAX] = "";
|
2000-12-13 16:12:16 -08:00
|
|
|
|
2000-12-14 15:13:08 -08:00
|
|
|
char *
|
|
|
|
e_config_get(char *type)
|
|
|
|
{
|
Alright, I spent some time now reading e17's code. Here's what
I've changed, this is big, so read this carefully :)
* I've added debugging macros for messages and function call
tracing. Usage:
D("Creating item %i %i %i\n", x, y, z);
Define DEBUG to use the D macro.
D_ENTER;
D_RETURN;
D_RETURN_(x);
These are for call tracing. Use D_RETURN_(x) when returning
something from a function. Define DEBUG_NEST to use this.
* added iconbar header file to Makefile.am
* added proper new()/cleanup() calls for E_Delayed_Action;
* I've completely rewritten the object and observer handling. Bye
bye macros, this was nasty. It'll be hard enough to avoid leaks
with usecounting in C. We now basically have the same system as gtk.
There's a clear separation of observer and object code now.
An E_Object by itself has nothing to do with observing or being
observed, therefore, there are now E_Observers and E_Observees
that are derived from E_Object. IMPORTANT: The cleanup system now
reflects the reference count system, therefore, all ..._free()
calls are now static, because the destructor should never be called explicitly, but implicitly through e_object_unref(). The object handling
now is as follows:
- The cleanup functions clean up everything that is contained in
a struct, but NOT the struct itself. Instead of the final
free() call, they call the destructor of the base class. The
calls will walk up the hierarchy and clean up what's contained in
every struct, and the final e_object_cleanup() will free the
structure itself. E_Delayed_Action is a good example.
- The only calls that influence the reference count are
e_object_ref() and e_object_unref(). If you need to do things
before an object gets destroyed, you can query the use count using
e_object_get_usecount() and check if it's equal to 1. So this:
OBJ_UNREF(b);
OBJ_IF_FREE(b)
{
ecore_window_reparent(e->win, 0, 0, 0);
e_icccm_release(e->win);
OBJ_FREE(b);
}
now is this:
if (e_object_get_usecount(E_OBJECT(b)) == 1)
{
ecore_window_reparent(e->win, 0, 0, 0);
e_icccm_release(e->win);
}
e_object_unref(E_OBJECT(b));
object.h and observer.h are completely commented, it shouldn't be
too hard to understand. This'll need to be documented in the manual
anyway.
* E_Objects are now used in lots of places where void* were used as
pointers to objects before, especially in the actions code. This is
obviously better, as it will generate compiler warnings when people
want to pass things to functions that expect E_Objects. This could
probably be more restrictive.
* Added typedefs for the function prototypes in E_Action_Impl. Those
fat signatures were just painful to read in the function
declarations/implementations.
* I've also tried to give parameters more useful names. Calling an
object "o" is a lot of fun when you want to grep for it.
* Included is also Graham's latest menu.c patch. Sorry for the
delay, Graham.
* I've added checks to the menu code that make sure that menus
don't pop up when they're empty (which resulted in a little useless
rectangle).
I guess that's it for now. Sorry if I broke anything, but this was
necessary imho.
SVN revision: 5605
2001-11-02 09:07:52 -08:00
|
|
|
D_ENTER;
|
|
|
|
|
2000-12-14 15:13:08 -08:00
|
|
|
/* for now use the system defaults and not the user copied settings */
|
|
|
|
/* so if i chnage stuff i dont have to rm my personaly settings and */
|
|
|
|
/* have e re-install them. yes this is different from e16 - the */
|
|
|
|
/* complexity of merging system and user settings is just a bit */
|
|
|
|
/* much for my liking and have decided, for usability, and */
|
|
|
|
/* user-freindliness to keep all settings in the user's home dir, */
|
|
|
|
/* as well as all data - so the only place to look is there. If you */
|
|
|
|
/* have no data it is all copied over for you the first time E is */
|
|
|
|
/* run. It's a design decision. */
|
2000-12-15 13:27:23 -08:00
|
|
|
/* Later when things are a bit mroe stabilised these will look */
|
|
|
|
/* something like: */
|
|
|
|
/* E_CONF("grabs", cfg_grabs_db, */
|
|
|
|
/* "%sbehavior/default/grabs.db", e_config_user_dir()); */
|
|
|
|
/* notice it would use the user config location instead */
|
|
|
|
/* but for now i'm keeping it as is for development "ease" */
|
2000-12-14 15:13:08 -08:00
|
|
|
E_CONF("grabs", cfg_grabs_db,
|
2001-02-15 14:55:39 -08:00
|
|
|
"%s/behavior/grabs.db", e_config_user_dir());
|
2000-12-14 15:13:08 -08:00
|
|
|
E_CONF("settings", cfg_settings_db,
|
2001-02-15 14:55:39 -08:00
|
|
|
"%s/behavior/settings.db", e_config_user_dir());
|
2000-12-14 15:13:08 -08:00
|
|
|
E_CONF("actions", cfg_actions_db,
|
2001-02-15 14:55:39 -08:00
|
|
|
"%s/behavior/actions.db", e_config_user_dir());
|
2001-02-03 09:17:07 -08:00
|
|
|
E_CONF("apps_menu", cfg_apps_menu_db,
|
2001-02-15 14:55:39 -08:00
|
|
|
"%s/behavior/apps_menu.db", e_config_user_dir());
|
2000-12-14 15:13:08 -08:00
|
|
|
E_CONF("borders", cfg_borders_db,
|
|
|
|
PACKAGE_DATA_DIR"/data/config/appearance/default/borders/");
|
2001-02-03 09:17:07 -08:00
|
|
|
E_CONF("menus", cfg_menus_dir,
|
2001-01-02 15:10:12 -08:00
|
|
|
PACKAGE_DATA_DIR"/data/config/appearance/default/menus/");
|
2001-03-06 19:21:14 -08:00
|
|
|
E_CONF("entries", cfg_entries_dir,
|
|
|
|
PACKAGE_DATA_DIR"/data/config/appearance/default/entries/");
|
2001-07-12 09:40:13 -07:00
|
|
|
E_CONF("selections", cfg_selections_dir,
|
|
|
|
PACKAGE_DATA_DIR"/data/config/appearance/default/selections/");
|
2001-08-09 16:48:40 -07:00
|
|
|
E_CONF("scrollbars", cfg_scrollbars_dir,
|
|
|
|
PACKAGE_DATA_DIR"/data/config/appearance/default/scrollbars/");
|
2001-09-24 14:21:25 -07:00
|
|
|
E_CONF("guides", cfg_guides_dir,
|
|
|
|
PACKAGE_DATA_DIR"/data/config/appearance/default/guides/");
|
2000-12-14 15:13:08 -08:00
|
|
|
E_CONF("images", cfg_images_dir,
|
|
|
|
PACKAGE_DATA_DIR"/data/images/");
|
2001-09-24 14:21:25 -07:00
|
|
|
E_CONF("cursors", cfg_cursors_dir,
|
|
|
|
PACKAGE_DATA_DIR"/data/cursors/");
|
2001-07-28 20:26:39 -07:00
|
|
|
E_CONF("backgrounds", cfg_backgrounds_dir,
|
|
|
|
PACKAGE_DATA_DIR"/data/backgrounds/");
|
2000-12-14 15:13:08 -08:00
|
|
|
E_CONF("fonts", cfg_fonts_dir,
|
|
|
|
PACKAGE_DATA_DIR"/data/fonts/");
|
Alright, I spent some time now reading e17's code. Here's what
I've changed, this is big, so read this carefully :)
* I've added debugging macros for messages and function call
tracing. Usage:
D("Creating item %i %i %i\n", x, y, z);
Define DEBUG to use the D macro.
D_ENTER;
D_RETURN;
D_RETURN_(x);
These are for call tracing. Use D_RETURN_(x) when returning
something from a function. Define DEBUG_NEST to use this.
* added iconbar header file to Makefile.am
* added proper new()/cleanup() calls for E_Delayed_Action;
* I've completely rewritten the object and observer handling. Bye
bye macros, this was nasty. It'll be hard enough to avoid leaks
with usecounting in C. We now basically have the same system as gtk.
There's a clear separation of observer and object code now.
An E_Object by itself has nothing to do with observing or being
observed, therefore, there are now E_Observers and E_Observees
that are derived from E_Object. IMPORTANT: The cleanup system now
reflects the reference count system, therefore, all ..._free()
calls are now static, because the destructor should never be called explicitly, but implicitly through e_object_unref(). The object handling
now is as follows:
- The cleanup functions clean up everything that is contained in
a struct, but NOT the struct itself. Instead of the final
free() call, they call the destructor of the base class. The
calls will walk up the hierarchy and clean up what's contained in
every struct, and the final e_object_cleanup() will free the
structure itself. E_Delayed_Action is a good example.
- The only calls that influence the reference count are
e_object_ref() and e_object_unref(). If you need to do things
before an object gets destroyed, you can query the use count using
e_object_get_usecount() and check if it's equal to 1. So this:
OBJ_UNREF(b);
OBJ_IF_FREE(b)
{
ecore_window_reparent(e->win, 0, 0, 0);
e_icccm_release(e->win);
OBJ_FREE(b);
}
now is this:
if (e_object_get_usecount(E_OBJECT(b)) == 1)
{
ecore_window_reparent(e->win, 0, 0, 0);
e_icccm_release(e->win);
}
e_object_unref(E_OBJECT(b));
object.h and observer.h are completely commented, it shouldn't be
too hard to understand. This'll need to be documented in the manual
anyway.
* E_Objects are now used in lots of places where void* were used as
pointers to objects before, especially in the actions code. This is
obviously better, as it will generate compiler warnings when people
want to pass things to functions that expect E_Objects. This could
probably be more restrictive.
* Added typedefs for the function prototypes in E_Action_Impl. Those
fat signatures were just painful to read in the function
declarations/implementations.
* I've also tried to give parameters more useful names. Calling an
object "o" is a lot of fun when you want to grep for it.
* Included is also Graham's latest menu.c patch. Sorry for the
delay, Graham.
* I've added checks to the menu code that make sure that menus
don't pop up when they're empty (which resulted in a little useless
rectangle).
I guess that's it for now. Sorry if I broke anything, but this was
necessary imho.
SVN revision: 5605
2001-11-02 09:07:52 -08:00
|
|
|
|
|
|
|
D_RETURN_("");
|
2000-12-14 15:13:08 -08:00
|
|
|
}
|
|
|
|
|
2000-12-14 11:36:33 -08:00
|
|
|
void
|
|
|
|
e_config_init(void)
|
2000-12-13 16:12:16 -08:00
|
|
|
{
|
2001-10-12 13:13:01 -07:00
|
|
|
char buf[PATH_MAX];
|
2001-03-22 10:10:08 -08:00
|
|
|
|
Alright, I spent some time now reading e17's code. Here's what
I've changed, this is big, so read this carefully :)
* I've added debugging macros for messages and function call
tracing. Usage:
D("Creating item %i %i %i\n", x, y, z);
Define DEBUG to use the D macro.
D_ENTER;
D_RETURN;
D_RETURN_(x);
These are for call tracing. Use D_RETURN_(x) when returning
something from a function. Define DEBUG_NEST to use this.
* added iconbar header file to Makefile.am
* added proper new()/cleanup() calls for E_Delayed_Action;
* I've completely rewritten the object and observer handling. Bye
bye macros, this was nasty. It'll be hard enough to avoid leaks
with usecounting in C. We now basically have the same system as gtk.
There's a clear separation of observer and object code now.
An E_Object by itself has nothing to do with observing or being
observed, therefore, there are now E_Observers and E_Observees
that are derived from E_Object. IMPORTANT: The cleanup system now
reflects the reference count system, therefore, all ..._free()
calls are now static, because the destructor should never be called explicitly, but implicitly through e_object_unref(). The object handling
now is as follows:
- The cleanup functions clean up everything that is contained in
a struct, but NOT the struct itself. Instead of the final
free() call, they call the destructor of the base class. The
calls will walk up the hierarchy and clean up what's contained in
every struct, and the final e_object_cleanup() will free the
structure itself. E_Delayed_Action is a good example.
- The only calls that influence the reference count are
e_object_ref() and e_object_unref(). If you need to do things
before an object gets destroyed, you can query the use count using
e_object_get_usecount() and check if it's equal to 1. So this:
OBJ_UNREF(b);
OBJ_IF_FREE(b)
{
ecore_window_reparent(e->win, 0, 0, 0);
e_icccm_release(e->win);
OBJ_FREE(b);
}
now is this:
if (e_object_get_usecount(E_OBJECT(b)) == 1)
{
ecore_window_reparent(e->win, 0, 0, 0);
e_icccm_release(e->win);
}
e_object_unref(E_OBJECT(b));
object.h and observer.h are completely commented, it shouldn't be
too hard to understand. This'll need to be documented in the manual
anyway.
* E_Objects are now used in lots of places where void* were used as
pointers to objects before, especially in the actions code. This is
obviously better, as it will generate compiler warnings when people
want to pass things to functions that expect E_Objects. This could
probably be more restrictive.
* Added typedefs for the function prototypes in E_Action_Impl. Those
fat signatures were just painful to read in the function
declarations/implementations.
* I've also tried to give parameters more useful names. Calling an
object "o" is a lot of fun when you want to grep for it.
* Included is also Graham's latest menu.c patch. Sorry for the
delay, Graham.
* I've added checks to the menu code that make sure that menus
don't pop up when they're empty (which resulted in a little useless
rectangle).
I guess that's it for now. Sorry if I broke anything, but this was
necessary imho.
SVN revision: 5605
2001-11-02 09:07:52 -08:00
|
|
|
D_ENTER;
|
|
|
|
|
2001-03-22 10:10:08 -08:00
|
|
|
#if 1 /* for now don't do this. i think a cp -r will be needed later anyway */
|
2001-02-15 14:49:59 -08:00
|
|
|
if (!e_file_is_dir(e_config_user_dir())) e_file_mkdir(e_config_user_dir());
|
|
|
|
sprintf(buf, "%sappearance", e_config_user_dir());
|
|
|
|
if (!e_file_is_dir(buf)) e_file_mkdir(buf);
|
|
|
|
sprintf(buf, "%sappearance/borders", e_config_user_dir());
|
|
|
|
if (!e_file_is_dir(buf)) e_file_mkdir(buf);
|
|
|
|
sprintf(buf, "%sbehavior", e_config_user_dir());
|
|
|
|
if (!e_file_is_dir(buf)) e_file_mkdir(buf);
|
|
|
|
sprintf(buf, "%sbehavior/grabs.db", e_config_user_dir());
|
|
|
|
if (!e_file_exists(buf))
|
|
|
|
e_file_cp(PACKAGE_DATA_DIR"/data/config/behavior/default/grabs.db", buf);
|
|
|
|
sprintf(buf, "%sbehavior/settings.db", e_config_user_dir());
|
|
|
|
if (!e_file_exists(buf))
|
|
|
|
e_file_cp(PACKAGE_DATA_DIR"/data/config/behavior/default/settings.db", buf);
|
|
|
|
sprintf(buf, "%sbehavior/actions.db", e_config_user_dir());
|
|
|
|
if (!e_file_exists(buf))
|
|
|
|
e_file_cp(PACKAGE_DATA_DIR"/data/config/behavior/default/actions.db", buf);
|
|
|
|
sprintf(buf, "%sbehavior/apps_menu.db", e_config_user_dir());
|
|
|
|
if (!e_file_exists(buf))
|
|
|
|
e_file_cp(PACKAGE_DATA_DIR"/data/config/behavior/default/apps_menu.db", buf);
|
|
|
|
sprintf(buf, "%sappearance/borders/border.bits.db", e_config_user_dir());
|
2001-03-22 10:10:08 -08:00
|
|
|
#endif
|
2001-10-09 08:01:58 -07:00
|
|
|
#if 0
|
|
|
|
ts();
|
|
|
|
#endif
|
Alright, I spent some time now reading e17's code. Here's what
I've changed, this is big, so read this carefully :)
* I've added debugging macros for messages and function call
tracing. Usage:
D("Creating item %i %i %i\n", x, y, z);
Define DEBUG to use the D macro.
D_ENTER;
D_RETURN;
D_RETURN_(x);
These are for call tracing. Use D_RETURN_(x) when returning
something from a function. Define DEBUG_NEST to use this.
* added iconbar header file to Makefile.am
* added proper new()/cleanup() calls for E_Delayed_Action;
* I've completely rewritten the object and observer handling. Bye
bye macros, this was nasty. It'll be hard enough to avoid leaks
with usecounting in C. We now basically have the same system as gtk.
There's a clear separation of observer and object code now.
An E_Object by itself has nothing to do with observing or being
observed, therefore, there are now E_Observers and E_Observees
that are derived from E_Object. IMPORTANT: The cleanup system now
reflects the reference count system, therefore, all ..._free()
calls are now static, because the destructor should never be called explicitly, but implicitly through e_object_unref(). The object handling
now is as follows:
- The cleanup functions clean up everything that is contained in
a struct, but NOT the struct itself. Instead of the final
free() call, they call the destructor of the base class. The
calls will walk up the hierarchy and clean up what's contained in
every struct, and the final e_object_cleanup() will free the
structure itself. E_Delayed_Action is a good example.
- The only calls that influence the reference count are
e_object_ref() and e_object_unref(). If you need to do things
before an object gets destroyed, you can query the use count using
e_object_get_usecount() and check if it's equal to 1. So this:
OBJ_UNREF(b);
OBJ_IF_FREE(b)
{
ecore_window_reparent(e->win, 0, 0, 0);
e_icccm_release(e->win);
OBJ_FREE(b);
}
now is this:
if (e_object_get_usecount(E_OBJECT(b)) == 1)
{
ecore_window_reparent(e->win, 0, 0, 0);
e_icccm_release(e->win);
}
e_object_unref(E_OBJECT(b));
object.h and observer.h are completely commented, it shouldn't be
too hard to understand. This'll need to be documented in the manual
anyway.
* E_Objects are now used in lots of places where void* were used as
pointers to objects before, especially in the actions code. This is
obviously better, as it will generate compiler warnings when people
want to pass things to functions that expect E_Objects. This could
probably be more restrictive.
* Added typedefs for the function prototypes in E_Action_Impl. Those
fat signatures were just painful to read in the function
declarations/implementations.
* I've also tried to give parameters more useful names. Calling an
object "o" is a lot of fun when you want to grep for it.
* Included is also Graham's latest menu.c patch. Sorry for the
delay, Graham.
* I've added checks to the menu code that make sure that menus
don't pop up when they're empty (which resulted in a little useless
rectangle).
I guess that's it for now. Sorry if I broke anything, but this was
necessary imho.
SVN revision: 5605
2001-11-02 09:07:52 -08:00
|
|
|
|
|
|
|
D_RETURN;
|
2000-12-14 11:36:33 -08:00
|
|
|
}
|
|
|
|
|
2000-12-15 13:27:23 -08:00
|
|
|
void
|
|
|
|
e_config_set_user_dir(char *dir)
|
|
|
|
{
|
Alright, I spent some time now reading e17's code. Here's what
I've changed, this is big, so read this carefully :)
* I've added debugging macros for messages and function call
tracing. Usage:
D("Creating item %i %i %i\n", x, y, z);
Define DEBUG to use the D macro.
D_ENTER;
D_RETURN;
D_RETURN_(x);
These are for call tracing. Use D_RETURN_(x) when returning
something from a function. Define DEBUG_NEST to use this.
* added iconbar header file to Makefile.am
* added proper new()/cleanup() calls for E_Delayed_Action;
* I've completely rewritten the object and observer handling. Bye
bye macros, this was nasty. It'll be hard enough to avoid leaks
with usecounting in C. We now basically have the same system as gtk.
There's a clear separation of observer and object code now.
An E_Object by itself has nothing to do with observing or being
observed, therefore, there are now E_Observers and E_Observees
that are derived from E_Object. IMPORTANT: The cleanup system now
reflects the reference count system, therefore, all ..._free()
calls are now static, because the destructor should never be called explicitly, but implicitly through e_object_unref(). The object handling
now is as follows:
- The cleanup functions clean up everything that is contained in
a struct, but NOT the struct itself. Instead of the final
free() call, they call the destructor of the base class. The
calls will walk up the hierarchy and clean up what's contained in
every struct, and the final e_object_cleanup() will free the
structure itself. E_Delayed_Action is a good example.
- The only calls that influence the reference count are
e_object_ref() and e_object_unref(). If you need to do things
before an object gets destroyed, you can query the use count using
e_object_get_usecount() and check if it's equal to 1. So this:
OBJ_UNREF(b);
OBJ_IF_FREE(b)
{
ecore_window_reparent(e->win, 0, 0, 0);
e_icccm_release(e->win);
OBJ_FREE(b);
}
now is this:
if (e_object_get_usecount(E_OBJECT(b)) == 1)
{
ecore_window_reparent(e->win, 0, 0, 0);
e_icccm_release(e->win);
}
e_object_unref(E_OBJECT(b));
object.h and observer.h are completely commented, it shouldn't be
too hard to understand. This'll need to be documented in the manual
anyway.
* E_Objects are now used in lots of places where void* were used as
pointers to objects before, especially in the actions code. This is
obviously better, as it will generate compiler warnings when people
want to pass things to functions that expect E_Objects. This could
probably be more restrictive.
* Added typedefs for the function prototypes in E_Action_Impl. Those
fat signatures were just painful to read in the function
declarations/implementations.
* I've also tried to give parameters more useful names. Calling an
object "o" is a lot of fun when you want to grep for it.
* Included is also Graham's latest menu.c patch. Sorry for the
delay, Graham.
* I've added checks to the menu code that make sure that menus
don't pop up when they're empty (which resulted in a little useless
rectangle).
I guess that's it for now. Sorry if I broke anything, but this was
necessary imho.
SVN revision: 5605
2001-11-02 09:07:52 -08:00
|
|
|
D_ENTER;
|
|
|
|
|
2000-12-15 13:27:23 -08:00
|
|
|
strcpy(cfg_root, dir);
|
|
|
|
/* reset the cached dir paths */
|
|
|
|
cfg_grabs_db[0] = 0;
|
|
|
|
cfg_settings_db[0] = 0;
|
|
|
|
cfg_actions_db[0] = 0;
|
|
|
|
cfg_borders_db[0] = 0;
|
2001-03-06 19:21:14 -08:00
|
|
|
cfg_apps_menu_db[0]= 0;
|
|
|
|
cfg_menus_dir[0] = 0;
|
|
|
|
cfg_entries_dir[0] = 0;
|
2001-08-09 16:48:40 -07:00
|
|
|
cfg_selections_dir[0] = 0;
|
|
|
|
cfg_scrollbars_dir[0] = 0;
|
2001-09-24 14:21:25 -07:00
|
|
|
cfg_guides_dir[0] = 0;
|
2000-12-15 13:27:23 -08:00
|
|
|
cfg_user_dir[0] = 0;
|
|
|
|
cfg_images_dir[0] = 0;
|
2001-09-24 14:21:25 -07:00
|
|
|
cfg_cursors_dir[0] = 0;
|
2001-07-28 20:26:39 -07:00
|
|
|
cfg_backgrounds_dir[0] = 0;
|
2000-12-15 13:27:23 -08:00
|
|
|
cfg_fonts_dir[0] = 0;
|
|
|
|
/* init again - if the user hasnt got all the data */
|
|
|
|
e_config_init();
|
Alright, I spent some time now reading e17's code. Here's what
I've changed, this is big, so read this carefully :)
* I've added debugging macros for messages and function call
tracing. Usage:
D("Creating item %i %i %i\n", x, y, z);
Define DEBUG to use the D macro.
D_ENTER;
D_RETURN;
D_RETURN_(x);
These are for call tracing. Use D_RETURN_(x) when returning
something from a function. Define DEBUG_NEST to use this.
* added iconbar header file to Makefile.am
* added proper new()/cleanup() calls for E_Delayed_Action;
* I've completely rewritten the object and observer handling. Bye
bye macros, this was nasty. It'll be hard enough to avoid leaks
with usecounting in C. We now basically have the same system as gtk.
There's a clear separation of observer and object code now.
An E_Object by itself has nothing to do with observing or being
observed, therefore, there are now E_Observers and E_Observees
that are derived from E_Object. IMPORTANT: The cleanup system now
reflects the reference count system, therefore, all ..._free()
calls are now static, because the destructor should never be called explicitly, but implicitly through e_object_unref(). The object handling
now is as follows:
- The cleanup functions clean up everything that is contained in
a struct, but NOT the struct itself. Instead of the final
free() call, they call the destructor of the base class. The
calls will walk up the hierarchy and clean up what's contained in
every struct, and the final e_object_cleanup() will free the
structure itself. E_Delayed_Action is a good example.
- The only calls that influence the reference count are
e_object_ref() and e_object_unref(). If you need to do things
before an object gets destroyed, you can query the use count using
e_object_get_usecount() and check if it's equal to 1. So this:
OBJ_UNREF(b);
OBJ_IF_FREE(b)
{
ecore_window_reparent(e->win, 0, 0, 0);
e_icccm_release(e->win);
OBJ_FREE(b);
}
now is this:
if (e_object_get_usecount(E_OBJECT(b)) == 1)
{
ecore_window_reparent(e->win, 0, 0, 0);
e_icccm_release(e->win);
}
e_object_unref(E_OBJECT(b));
object.h and observer.h are completely commented, it shouldn't be
too hard to understand. This'll need to be documented in the manual
anyway.
* E_Objects are now used in lots of places where void* were used as
pointers to objects before, especially in the actions code. This is
obviously better, as it will generate compiler warnings when people
want to pass things to functions that expect E_Objects. This could
probably be more restrictive.
* Added typedefs for the function prototypes in E_Action_Impl. Those
fat signatures were just painful to read in the function
declarations/implementations.
* I've also tried to give parameters more useful names. Calling an
object "o" is a lot of fun when you want to grep for it.
* Included is also Graham's latest menu.c patch. Sorry for the
delay, Graham.
* I've added checks to the menu code that make sure that menus
don't pop up when they're empty (which resulted in a little useless
rectangle).
I guess that's it for now. Sorry if I broke anything, but this was
necessary imho.
SVN revision: 5605
2001-11-02 09:07:52 -08:00
|
|
|
|
|
|
|
D_RETURN;
|
2000-12-15 13:27:23 -08:00
|
|
|
}
|
|
|
|
|
2000-12-14 11:36:33 -08:00
|
|
|
char *
|
|
|
|
e_config_user_dir(void)
|
|
|
|
{
|
Alright, I spent some time now reading e17's code. Here's what
I've changed, this is big, so read this carefully :)
* I've added debugging macros for messages and function call
tracing. Usage:
D("Creating item %i %i %i\n", x, y, z);
Define DEBUG to use the D macro.
D_ENTER;
D_RETURN;
D_RETURN_(x);
These are for call tracing. Use D_RETURN_(x) when returning
something from a function. Define DEBUG_NEST to use this.
* added iconbar header file to Makefile.am
* added proper new()/cleanup() calls for E_Delayed_Action;
* I've completely rewritten the object and observer handling. Bye
bye macros, this was nasty. It'll be hard enough to avoid leaks
with usecounting in C. We now basically have the same system as gtk.
There's a clear separation of observer and object code now.
An E_Object by itself has nothing to do with observing or being
observed, therefore, there are now E_Observers and E_Observees
that are derived from E_Object. IMPORTANT: The cleanup system now
reflects the reference count system, therefore, all ..._free()
calls are now static, because the destructor should never be called explicitly, but implicitly through e_object_unref(). The object handling
now is as follows:
- The cleanup functions clean up everything that is contained in
a struct, but NOT the struct itself. Instead of the final
free() call, they call the destructor of the base class. The
calls will walk up the hierarchy and clean up what's contained in
every struct, and the final e_object_cleanup() will free the
structure itself. E_Delayed_Action is a good example.
- The only calls that influence the reference count are
e_object_ref() and e_object_unref(). If you need to do things
before an object gets destroyed, you can query the use count using
e_object_get_usecount() and check if it's equal to 1. So this:
OBJ_UNREF(b);
OBJ_IF_FREE(b)
{
ecore_window_reparent(e->win, 0, 0, 0);
e_icccm_release(e->win);
OBJ_FREE(b);
}
now is this:
if (e_object_get_usecount(E_OBJECT(b)) == 1)
{
ecore_window_reparent(e->win, 0, 0, 0);
e_icccm_release(e->win);
}
e_object_unref(E_OBJECT(b));
object.h and observer.h are completely commented, it shouldn't be
too hard to understand. This'll need to be documented in the manual
anyway.
* E_Objects are now used in lots of places where void* were used as
pointers to objects before, especially in the actions code. This is
obviously better, as it will generate compiler warnings when people
want to pass things to functions that expect E_Objects. This could
probably be more restrictive.
* Added typedefs for the function prototypes in E_Action_Impl. Those
fat signatures were just painful to read in the function
declarations/implementations.
* I've also tried to give parameters more useful names. Calling an
object "o" is a lot of fun when you want to grep for it.
* Included is also Graham's latest menu.c patch. Sorry for the
delay, Graham.
* I've added checks to the menu code that make sure that menus
don't pop up when they're empty (which resulted in a little useless
rectangle).
I guess that's it for now. Sorry if I broke anything, but this was
necessary imho.
SVN revision: 5605
2001-11-02 09:07:52 -08:00
|
|
|
D_ENTER;
|
|
|
|
|
|
|
|
if (cfg_user_dir[0]) D_RETURN_(cfg_user_dir);
|
|
|
|
if (cfg_root[0]) D_RETURN_(cfg_root);
|
2001-03-22 10:10:08 -08:00
|
|
|
#if 1 /* disabled for now - use system ones only */
|
2000-12-14 11:36:33 -08:00
|
|
|
sprintf(cfg_user_dir, "%s/.e/", e_file_home());
|
2001-03-22 10:10:08 -08:00
|
|
|
#else
|
|
|
|
sprintf(cfg_user_dir, PACKAGE_DATA_DIR"/data/config/");
|
|
|
|
#endif
|
Alright, I spent some time now reading e17's code. Here's what
I've changed, this is big, so read this carefully :)
* I've added debugging macros for messages and function call
tracing. Usage:
D("Creating item %i %i %i\n", x, y, z);
Define DEBUG to use the D macro.
D_ENTER;
D_RETURN;
D_RETURN_(x);
These are for call tracing. Use D_RETURN_(x) when returning
something from a function. Define DEBUG_NEST to use this.
* added iconbar header file to Makefile.am
* added proper new()/cleanup() calls for E_Delayed_Action;
* I've completely rewritten the object and observer handling. Bye
bye macros, this was nasty. It'll be hard enough to avoid leaks
with usecounting in C. We now basically have the same system as gtk.
There's a clear separation of observer and object code now.
An E_Object by itself has nothing to do with observing or being
observed, therefore, there are now E_Observers and E_Observees
that are derived from E_Object. IMPORTANT: The cleanup system now
reflects the reference count system, therefore, all ..._free()
calls are now static, because the destructor should never be called explicitly, but implicitly through e_object_unref(). The object handling
now is as follows:
- The cleanup functions clean up everything that is contained in
a struct, but NOT the struct itself. Instead of the final
free() call, they call the destructor of the base class. The
calls will walk up the hierarchy and clean up what's contained in
every struct, and the final e_object_cleanup() will free the
structure itself. E_Delayed_Action is a good example.
- The only calls that influence the reference count are
e_object_ref() and e_object_unref(). If you need to do things
before an object gets destroyed, you can query the use count using
e_object_get_usecount() and check if it's equal to 1. So this:
OBJ_UNREF(b);
OBJ_IF_FREE(b)
{
ecore_window_reparent(e->win, 0, 0, 0);
e_icccm_release(e->win);
OBJ_FREE(b);
}
now is this:
if (e_object_get_usecount(E_OBJECT(b)) == 1)
{
ecore_window_reparent(e->win, 0, 0, 0);
e_icccm_release(e->win);
}
e_object_unref(E_OBJECT(b));
object.h and observer.h are completely commented, it shouldn't be
too hard to understand. This'll need to be documented in the manual
anyway.
* E_Objects are now used in lots of places where void* were used as
pointers to objects before, especially in the actions code. This is
obviously better, as it will generate compiler warnings when people
want to pass things to functions that expect E_Objects. This could
probably be more restrictive.
* Added typedefs for the function prototypes in E_Action_Impl. Those
fat signatures were just painful to read in the function
declarations/implementations.
* I've also tried to give parameters more useful names. Calling an
object "o" is a lot of fun when you want to grep for it.
* Included is also Graham's latest menu.c patch. Sorry for the
delay, Graham.
* I've added checks to the menu code that make sure that menus
don't pop up when they're empty (which resulted in a little useless
rectangle).
I guess that's it for now. Sorry if I broke anything, but this was
necessary imho.
SVN revision: 5605
2001-11-02 09:07:52 -08:00
|
|
|
|
|
|
|
D_RETURN_(cfg_user_dir);
|
2000-12-14 11:36:33 -08:00
|
|
|
}
|
2001-10-09 08:01:58 -07:00
|
|
|
|
|
|
|
void
|
|
|
|
e_config_type_add_node(E_Config_Base_Type *base, char *prefix,
|
|
|
|
E_Config_Datatype type, E_Config_Base_Type *list_type,
|
2001-10-17 02:53:44 -07:00
|
|
|
int offset,
|
|
|
|
int def_int,
|
|
|
|
float def_float,
|
|
|
|
char *def_str)
|
2001-10-09 08:01:58 -07:00
|
|
|
{
|
|
|
|
E_Config_Node *cfg_node;
|
|
|
|
|
Alright, I spent some time now reading e17's code. Here's what
I've changed, this is big, so read this carefully :)
* I've added debugging macros for messages and function call
tracing. Usage:
D("Creating item %i %i %i\n", x, y, z);
Define DEBUG to use the D macro.
D_ENTER;
D_RETURN;
D_RETURN_(x);
These are for call tracing. Use D_RETURN_(x) when returning
something from a function. Define DEBUG_NEST to use this.
* added iconbar header file to Makefile.am
* added proper new()/cleanup() calls for E_Delayed_Action;
* I've completely rewritten the object and observer handling. Bye
bye macros, this was nasty. It'll be hard enough to avoid leaks
with usecounting in C. We now basically have the same system as gtk.
There's a clear separation of observer and object code now.
An E_Object by itself has nothing to do with observing or being
observed, therefore, there are now E_Observers and E_Observees
that are derived from E_Object. IMPORTANT: The cleanup system now
reflects the reference count system, therefore, all ..._free()
calls are now static, because the destructor should never be called explicitly, but implicitly through e_object_unref(). The object handling
now is as follows:
- The cleanup functions clean up everything that is contained in
a struct, but NOT the struct itself. Instead of the final
free() call, they call the destructor of the base class. The
calls will walk up the hierarchy and clean up what's contained in
every struct, and the final e_object_cleanup() will free the
structure itself. E_Delayed_Action is a good example.
- The only calls that influence the reference count are
e_object_ref() and e_object_unref(). If you need to do things
before an object gets destroyed, you can query the use count using
e_object_get_usecount() and check if it's equal to 1. So this:
OBJ_UNREF(b);
OBJ_IF_FREE(b)
{
ecore_window_reparent(e->win, 0, 0, 0);
e_icccm_release(e->win);
OBJ_FREE(b);
}
now is this:
if (e_object_get_usecount(E_OBJECT(b)) == 1)
{
ecore_window_reparent(e->win, 0, 0, 0);
e_icccm_release(e->win);
}
e_object_unref(E_OBJECT(b));
object.h and observer.h are completely commented, it shouldn't be
too hard to understand. This'll need to be documented in the manual
anyway.
* E_Objects are now used in lots of places where void* were used as
pointers to objects before, especially in the actions code. This is
obviously better, as it will generate compiler warnings when people
want to pass things to functions that expect E_Objects. This could
probably be more restrictive.
* Added typedefs for the function prototypes in E_Action_Impl. Those
fat signatures were just painful to read in the function
declarations/implementations.
* I've also tried to give parameters more useful names. Calling an
object "o" is a lot of fun when you want to grep for it.
* Included is also Graham's latest menu.c patch. Sorry for the
delay, Graham.
* I've added checks to the menu code that make sure that menus
don't pop up when they're empty (which resulted in a little useless
rectangle).
I guess that's it for now. Sorry if I broke anything, but this was
necessary imho.
SVN revision: 5605
2001-11-02 09:07:52 -08:00
|
|
|
D_ENTER;
|
|
|
|
|
2001-10-09 08:01:58 -07:00
|
|
|
cfg_node = NEW(E_Config_Node, 1);
|
|
|
|
ZERO(cfg_node, E_Config_Node, 1);
|
|
|
|
|
2001-10-17 02:53:44 -07:00
|
|
|
cfg_node->prefix = strdup(prefix);
|
|
|
|
cfg_node->type = type;
|
|
|
|
cfg_node->sub_type = list_type;
|
|
|
|
cfg_node->offset = offset;
|
|
|
|
cfg_node->def_int = def_int;
|
|
|
|
cfg_node->def_float = def_float;
|
|
|
|
if (cfg_node->def_str)
|
|
|
|
{
|
|
|
|
e_strdup(cfg_node->def_str, def_str);
|
|
|
|
}
|
2001-10-09 08:01:58 -07:00
|
|
|
base->nodes = evas_list_append(base->nodes, cfg_node);
|
Alright, I spent some time now reading e17's code. Here's what
I've changed, this is big, so read this carefully :)
* I've added debugging macros for messages and function call
tracing. Usage:
D("Creating item %i %i %i\n", x, y, z);
Define DEBUG to use the D macro.
D_ENTER;
D_RETURN;
D_RETURN_(x);
These are for call tracing. Use D_RETURN_(x) when returning
something from a function. Define DEBUG_NEST to use this.
* added iconbar header file to Makefile.am
* added proper new()/cleanup() calls for E_Delayed_Action;
* I've completely rewritten the object and observer handling. Bye
bye macros, this was nasty. It'll be hard enough to avoid leaks
with usecounting in C. We now basically have the same system as gtk.
There's a clear separation of observer and object code now.
An E_Object by itself has nothing to do with observing or being
observed, therefore, there are now E_Observers and E_Observees
that are derived from E_Object. IMPORTANT: The cleanup system now
reflects the reference count system, therefore, all ..._free()
calls are now static, because the destructor should never be called explicitly, but implicitly through e_object_unref(). The object handling
now is as follows:
- The cleanup functions clean up everything that is contained in
a struct, but NOT the struct itself. Instead of the final
free() call, they call the destructor of the base class. The
calls will walk up the hierarchy and clean up what's contained in
every struct, and the final e_object_cleanup() will free the
structure itself. E_Delayed_Action is a good example.
- The only calls that influence the reference count are
e_object_ref() and e_object_unref(). If you need to do things
before an object gets destroyed, you can query the use count using
e_object_get_usecount() and check if it's equal to 1. So this:
OBJ_UNREF(b);
OBJ_IF_FREE(b)
{
ecore_window_reparent(e->win, 0, 0, 0);
e_icccm_release(e->win);
OBJ_FREE(b);
}
now is this:
if (e_object_get_usecount(E_OBJECT(b)) == 1)
{
ecore_window_reparent(e->win, 0, 0, 0);
e_icccm_release(e->win);
}
e_object_unref(E_OBJECT(b));
object.h and observer.h are completely commented, it shouldn't be
too hard to understand. This'll need to be documented in the manual
anyway.
* E_Objects are now used in lots of places where void* were used as
pointers to objects before, especially in the actions code. This is
obviously better, as it will generate compiler warnings when people
want to pass things to functions that expect E_Objects. This could
probably be more restrictive.
* Added typedefs for the function prototypes in E_Action_Impl. Those
fat signatures were just painful to read in the function
declarations/implementations.
* I've also tried to give parameters more useful names. Calling an
object "o" is a lot of fun when you want to grep for it.
* Included is also Graham's latest menu.c patch. Sorry for the
delay, Graham.
* I've added checks to the menu code that make sure that menus
don't pop up when they're empty (which resulted in a little useless
rectangle).
I guess that's it for now. Sorry if I broke anything, but this was
necessary imho.
SVN revision: 5605
2001-11-02 09:07:52 -08:00
|
|
|
|
|
|
|
D_RETURN;
|
2001-10-09 08:01:58 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
E_Config_Base_Type *
|
|
|
|
e_config_type_new(void)
|
|
|
|
{
|
|
|
|
E_Config_Base_Type *t;
|
|
|
|
|
Alright, I spent some time now reading e17's code. Here's what
I've changed, this is big, so read this carefully :)
* I've added debugging macros for messages and function call
tracing. Usage:
D("Creating item %i %i %i\n", x, y, z);
Define DEBUG to use the D macro.
D_ENTER;
D_RETURN;
D_RETURN_(x);
These are for call tracing. Use D_RETURN_(x) when returning
something from a function. Define DEBUG_NEST to use this.
* added iconbar header file to Makefile.am
* added proper new()/cleanup() calls for E_Delayed_Action;
* I've completely rewritten the object and observer handling. Bye
bye macros, this was nasty. It'll be hard enough to avoid leaks
with usecounting in C. We now basically have the same system as gtk.
There's a clear separation of observer and object code now.
An E_Object by itself has nothing to do with observing or being
observed, therefore, there are now E_Observers and E_Observees
that are derived from E_Object. IMPORTANT: The cleanup system now
reflects the reference count system, therefore, all ..._free()
calls are now static, because the destructor should never be called explicitly, but implicitly through e_object_unref(). The object handling
now is as follows:
- The cleanup functions clean up everything that is contained in
a struct, but NOT the struct itself. Instead of the final
free() call, they call the destructor of the base class. The
calls will walk up the hierarchy and clean up what's contained in
every struct, and the final e_object_cleanup() will free the
structure itself. E_Delayed_Action is a good example.
- The only calls that influence the reference count are
e_object_ref() and e_object_unref(). If you need to do things
before an object gets destroyed, you can query the use count using
e_object_get_usecount() and check if it's equal to 1. So this:
OBJ_UNREF(b);
OBJ_IF_FREE(b)
{
ecore_window_reparent(e->win, 0, 0, 0);
e_icccm_release(e->win);
OBJ_FREE(b);
}
now is this:
if (e_object_get_usecount(E_OBJECT(b)) == 1)
{
ecore_window_reparent(e->win, 0, 0, 0);
e_icccm_release(e->win);
}
e_object_unref(E_OBJECT(b));
object.h and observer.h are completely commented, it shouldn't be
too hard to understand. This'll need to be documented in the manual
anyway.
* E_Objects are now used in lots of places where void* were used as
pointers to objects before, especially in the actions code. This is
obviously better, as it will generate compiler warnings when people
want to pass things to functions that expect E_Objects. This could
probably be more restrictive.
* Added typedefs for the function prototypes in E_Action_Impl. Those
fat signatures were just painful to read in the function
declarations/implementations.
* I've also tried to give parameters more useful names. Calling an
object "o" is a lot of fun when you want to grep for it.
* Included is also Graham's latest menu.c patch. Sorry for the
delay, Graham.
* I've added checks to the menu code that make sure that menus
don't pop up when they're empty (which resulted in a little useless
rectangle).
I guess that's it for now. Sorry if I broke anything, but this was
necessary imho.
SVN revision: 5605
2001-11-02 09:07:52 -08:00
|
|
|
D_ENTER;
|
|
|
|
|
2001-10-09 08:01:58 -07:00
|
|
|
t = NEW(E_Config_Base_Type, 1);
|
|
|
|
ZERO(t, E_Config_Base_Type, 1);
|
Alright, I spent some time now reading e17's code. Here's what
I've changed, this is big, so read this carefully :)
* I've added debugging macros for messages and function call
tracing. Usage:
D("Creating item %i %i %i\n", x, y, z);
Define DEBUG to use the D macro.
D_ENTER;
D_RETURN;
D_RETURN_(x);
These are for call tracing. Use D_RETURN_(x) when returning
something from a function. Define DEBUG_NEST to use this.
* added iconbar header file to Makefile.am
* added proper new()/cleanup() calls for E_Delayed_Action;
* I've completely rewritten the object and observer handling. Bye
bye macros, this was nasty. It'll be hard enough to avoid leaks
with usecounting in C. We now basically have the same system as gtk.
There's a clear separation of observer and object code now.
An E_Object by itself has nothing to do with observing or being
observed, therefore, there are now E_Observers and E_Observees
that are derived from E_Object. IMPORTANT: The cleanup system now
reflects the reference count system, therefore, all ..._free()
calls are now static, because the destructor should never be called explicitly, but implicitly through e_object_unref(). The object handling
now is as follows:
- The cleanup functions clean up everything that is contained in
a struct, but NOT the struct itself. Instead of the final
free() call, they call the destructor of the base class. The
calls will walk up the hierarchy and clean up what's contained in
every struct, and the final e_object_cleanup() will free the
structure itself. E_Delayed_Action is a good example.
- The only calls that influence the reference count are
e_object_ref() and e_object_unref(). If you need to do things
before an object gets destroyed, you can query the use count using
e_object_get_usecount() and check if it's equal to 1. So this:
OBJ_UNREF(b);
OBJ_IF_FREE(b)
{
ecore_window_reparent(e->win, 0, 0, 0);
e_icccm_release(e->win);
OBJ_FREE(b);
}
now is this:
if (e_object_get_usecount(E_OBJECT(b)) == 1)
{
ecore_window_reparent(e->win, 0, 0, 0);
e_icccm_release(e->win);
}
e_object_unref(E_OBJECT(b));
object.h and observer.h are completely commented, it shouldn't be
too hard to understand. This'll need to be documented in the manual
anyway.
* E_Objects are now used in lots of places where void* were used as
pointers to objects before, especially in the actions code. This is
obviously better, as it will generate compiler warnings when people
want to pass things to functions that expect E_Objects. This could
probably be more restrictive.
* Added typedefs for the function prototypes in E_Action_Impl. Those
fat signatures were just painful to read in the function
declarations/implementations.
* I've also tried to give parameters more useful names. Calling an
object "o" is a lot of fun when you want to grep for it.
* Included is also Graham's latest menu.c patch. Sorry for the
delay, Graham.
* I've added checks to the menu code that make sure that menus
don't pop up when they're empty (which resulted in a little useless
rectangle).
I guess that's it for now. Sorry if I broke anything, but this was
necessary imho.
SVN revision: 5605
2001-11-02 09:07:52 -08:00
|
|
|
|
|
|
|
D_RETURN_(t);
|
2001-10-09 08:01:58 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
void *
|
|
|
|
e_config_load(char *file, char *prefix, E_Config_Base_Type *type)
|
|
|
|
{
|
|
|
|
E_DB_File *db;
|
2001-10-12 13:13:01 -07:00
|
|
|
char buf[PATH_MAX];
|
2001-10-09 08:01:58 -07:00
|
|
|
Evas_List l;
|
|
|
|
char *data;
|
|
|
|
|
Alright, I spent some time now reading e17's code. Here's what
I've changed, this is big, so read this carefully :)
* I've added debugging macros for messages and function call
tracing. Usage:
D("Creating item %i %i %i\n", x, y, z);
Define DEBUG to use the D macro.
D_ENTER;
D_RETURN;
D_RETURN_(x);
These are for call tracing. Use D_RETURN_(x) when returning
something from a function. Define DEBUG_NEST to use this.
* added iconbar header file to Makefile.am
* added proper new()/cleanup() calls for E_Delayed_Action;
* I've completely rewritten the object and observer handling. Bye
bye macros, this was nasty. It'll be hard enough to avoid leaks
with usecounting in C. We now basically have the same system as gtk.
There's a clear separation of observer and object code now.
An E_Object by itself has nothing to do with observing or being
observed, therefore, there are now E_Observers and E_Observees
that are derived from E_Object. IMPORTANT: The cleanup system now
reflects the reference count system, therefore, all ..._free()
calls are now static, because the destructor should never be called explicitly, but implicitly through e_object_unref(). The object handling
now is as follows:
- The cleanup functions clean up everything that is contained in
a struct, but NOT the struct itself. Instead of the final
free() call, they call the destructor of the base class. The
calls will walk up the hierarchy and clean up what's contained in
every struct, and the final e_object_cleanup() will free the
structure itself. E_Delayed_Action is a good example.
- The only calls that influence the reference count are
e_object_ref() and e_object_unref(). If you need to do things
before an object gets destroyed, you can query the use count using
e_object_get_usecount() and check if it's equal to 1. So this:
OBJ_UNREF(b);
OBJ_IF_FREE(b)
{
ecore_window_reparent(e->win, 0, 0, 0);
e_icccm_release(e->win);
OBJ_FREE(b);
}
now is this:
if (e_object_get_usecount(E_OBJECT(b)) == 1)
{
ecore_window_reparent(e->win, 0, 0, 0);
e_icccm_release(e->win);
}
e_object_unref(E_OBJECT(b));
object.h and observer.h are completely commented, it shouldn't be
too hard to understand. This'll need to be documented in the manual
anyway.
* E_Objects are now used in lots of places where void* were used as
pointers to objects before, especially in the actions code. This is
obviously better, as it will generate compiler warnings when people
want to pass things to functions that expect E_Objects. This could
probably be more restrictive.
* Added typedefs for the function prototypes in E_Action_Impl. Those
fat signatures were just painful to read in the function
declarations/implementations.
* I've also tried to give parameters more useful names. Calling an
object "o" is a lot of fun when you want to grep for it.
* Included is also Graham's latest menu.c patch. Sorry for the
delay, Graham.
* I've added checks to the menu code that make sure that menus
don't pop up when they're empty (which resulted in a little useless
rectangle).
I guess that's it for now. Sorry if I broke anything, but this was
necessary imho.
SVN revision: 5605
2001-11-02 09:07:52 -08:00
|
|
|
D_ENTER;
|
|
|
|
|
|
|
|
if (!e_file_exists(file)) D_RETURN_(NULL);
|
2001-10-09 08:01:58 -07:00
|
|
|
db = e_db_open_read(file);
|
Alright, I spent some time now reading e17's code. Here's what
I've changed, this is big, so read this carefully :)
* I've added debugging macros for messages and function call
tracing. Usage:
D("Creating item %i %i %i\n", x, y, z);
Define DEBUG to use the D macro.
D_ENTER;
D_RETURN;
D_RETURN_(x);
These are for call tracing. Use D_RETURN_(x) when returning
something from a function. Define DEBUG_NEST to use this.
* added iconbar header file to Makefile.am
* added proper new()/cleanup() calls for E_Delayed_Action;
* I've completely rewritten the object and observer handling. Bye
bye macros, this was nasty. It'll be hard enough to avoid leaks
with usecounting in C. We now basically have the same system as gtk.
There's a clear separation of observer and object code now.
An E_Object by itself has nothing to do with observing or being
observed, therefore, there are now E_Observers and E_Observees
that are derived from E_Object. IMPORTANT: The cleanup system now
reflects the reference count system, therefore, all ..._free()
calls are now static, because the destructor should never be called explicitly, but implicitly through e_object_unref(). The object handling
now is as follows:
- The cleanup functions clean up everything that is contained in
a struct, but NOT the struct itself. Instead of the final
free() call, they call the destructor of the base class. The
calls will walk up the hierarchy and clean up what's contained in
every struct, and the final e_object_cleanup() will free the
structure itself. E_Delayed_Action is a good example.
- The only calls that influence the reference count are
e_object_ref() and e_object_unref(). If you need to do things
before an object gets destroyed, you can query the use count using
e_object_get_usecount() and check if it's equal to 1. So this:
OBJ_UNREF(b);
OBJ_IF_FREE(b)
{
ecore_window_reparent(e->win, 0, 0, 0);
e_icccm_release(e->win);
OBJ_FREE(b);
}
now is this:
if (e_object_get_usecount(E_OBJECT(b)) == 1)
{
ecore_window_reparent(e->win, 0, 0, 0);
e_icccm_release(e->win);
}
e_object_unref(E_OBJECT(b));
object.h and observer.h are completely commented, it shouldn't be
too hard to understand. This'll need to be documented in the manual
anyway.
* E_Objects are now used in lots of places where void* were used as
pointers to objects before, especially in the actions code. This is
obviously better, as it will generate compiler warnings when people
want to pass things to functions that expect E_Objects. This could
probably be more restrictive.
* Added typedefs for the function prototypes in E_Action_Impl. Those
fat signatures were just painful to read in the function
declarations/implementations.
* I've also tried to give parameters more useful names. Calling an
object "o" is a lot of fun when you want to grep for it.
* Included is also Graham's latest menu.c patch. Sorry for the
delay, Graham.
* I've added checks to the menu code that make sure that menus
don't pop up when they're empty (which resulted in a little useless
rectangle).
I guess that's it for now. Sorry if I broke anything, but this was
necessary imho.
SVN revision: 5605
2001-11-02 09:07:52 -08:00
|
|
|
|
|
|
|
if (!db)
|
|
|
|
D_RETURN_(NULL);
|
|
|
|
|
2001-10-09 08:01:58 -07:00
|
|
|
data = NEW(char, type->size);
|
|
|
|
ZERO(data, char , type->size);
|
|
|
|
for (l = type->nodes; l; l = l->next)
|
|
|
|
{
|
|
|
|
E_Config_Node *node;
|
|
|
|
|
|
|
|
node = l->data;
|
|
|
|
|
|
|
|
switch (node->type)
|
|
|
|
{
|
|
|
|
case E_CFG_TYPE_INT:
|
|
|
|
{
|
|
|
|
int val;
|
|
|
|
|
|
|
|
val = 0;
|
|
|
|
sprintf(buf, "%s/%s", prefix, node->prefix);
|
2001-10-17 02:53:44 -07:00
|
|
|
if (e_db_int_get(db, buf, &val))
|
|
|
|
(*((int *)(&(data[node->offset])))) = val;
|
|
|
|
else
|
|
|
|
(*((int *)(&(data[node->offset])))) = node->def_int;
|
2001-10-09 08:01:58 -07:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case E_CFG_TYPE_STR:
|
|
|
|
{
|
2001-10-17 02:53:44 -07:00
|
|
|
char *val;
|
2001-10-09 08:01:58 -07:00
|
|
|
|
|
|
|
sprintf(buf, "%s/%s", prefix, node->prefix);
|
2001-10-17 02:53:44 -07:00
|
|
|
if ((val = e_db_str_get(db, buf)))
|
|
|
|
(*((char **)(&(data[node->offset])))) = val;
|
|
|
|
else
|
|
|
|
e_strdup((*((char **)(&(data[node->offset])))), node->def_str);
|
2001-10-09 08:01:58 -07:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case E_CFG_TYPE_FLOAT:
|
|
|
|
{
|
|
|
|
float val;
|
|
|
|
|
|
|
|
val = 0;
|
|
|
|
sprintf(buf, "%s/%s", prefix, node->prefix);
|
2001-10-17 02:53:44 -07:00
|
|
|
if (e_db_float_get(db, buf, &val))
|
|
|
|
(*((float *)(&(data[node->offset])))) = val;
|
|
|
|
else
|
|
|
|
(*((float *)(&(data[node->offset])))) = node->def_float;
|
2001-10-09 08:01:58 -07:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case E_CFG_TYPE_LIST:
|
|
|
|
{
|
|
|
|
Evas_List l2;
|
|
|
|
int i, count;
|
|
|
|
|
|
|
|
l2 = NULL;
|
|
|
|
sprintf(buf, "%s/%s/count", prefix, node->prefix);
|
|
|
|
count = 0;
|
|
|
|
e_db_int_get(db, buf, &count);
|
|
|
|
for (i = 0; i < count; i++)
|
|
|
|
{
|
|
|
|
void *data2;
|
|
|
|
|
|
|
|
sprintf(buf, "%s/%s/%i", prefix, node->prefix, i);
|
|
|
|
data2 = e_config_load(file, buf, node->sub_type);
|
|
|
|
l2 = evas_list_append(l2, data2);
|
|
|
|
}
|
|
|
|
(*((Evas_List *)(&(data[node->offset])))) = l2;
|
|
|
|
}
|
|
|
|
break;
|
2001-10-19 02:13:18 -07:00
|
|
|
case E_CFG_TYPE_KEY:
|
|
|
|
{
|
|
|
|
char *val;
|
|
|
|
|
|
|
|
sprintf(buf, "%s/%s", prefix, node->prefix);
|
|
|
|
(*((char **)(&(data[node->offset])))) = strdup(buf);
|
|
|
|
}
|
|
|
|
break;
|
2001-10-09 08:01:58 -07:00
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
e_db_close(db);
|
Alright, I spent some time now reading e17's code. Here's what
I've changed, this is big, so read this carefully :)
* I've added debugging macros for messages and function call
tracing. Usage:
D("Creating item %i %i %i\n", x, y, z);
Define DEBUG to use the D macro.
D_ENTER;
D_RETURN;
D_RETURN_(x);
These are for call tracing. Use D_RETURN_(x) when returning
something from a function. Define DEBUG_NEST to use this.
* added iconbar header file to Makefile.am
* added proper new()/cleanup() calls for E_Delayed_Action;
* I've completely rewritten the object and observer handling. Bye
bye macros, this was nasty. It'll be hard enough to avoid leaks
with usecounting in C. We now basically have the same system as gtk.
There's a clear separation of observer and object code now.
An E_Object by itself has nothing to do with observing or being
observed, therefore, there are now E_Observers and E_Observees
that are derived from E_Object. IMPORTANT: The cleanup system now
reflects the reference count system, therefore, all ..._free()
calls are now static, because the destructor should never be called explicitly, but implicitly through e_object_unref(). The object handling
now is as follows:
- The cleanup functions clean up everything that is contained in
a struct, but NOT the struct itself. Instead of the final
free() call, they call the destructor of the base class. The
calls will walk up the hierarchy and clean up what's contained in
every struct, and the final e_object_cleanup() will free the
structure itself. E_Delayed_Action is a good example.
- The only calls that influence the reference count are
e_object_ref() and e_object_unref(). If you need to do things
before an object gets destroyed, you can query the use count using
e_object_get_usecount() and check if it's equal to 1. So this:
OBJ_UNREF(b);
OBJ_IF_FREE(b)
{
ecore_window_reparent(e->win, 0, 0, 0);
e_icccm_release(e->win);
OBJ_FREE(b);
}
now is this:
if (e_object_get_usecount(E_OBJECT(b)) == 1)
{
ecore_window_reparent(e->win, 0, 0, 0);
e_icccm_release(e->win);
}
e_object_unref(E_OBJECT(b));
object.h and observer.h are completely commented, it shouldn't be
too hard to understand. This'll need to be documented in the manual
anyway.
* E_Objects are now used in lots of places where void* were used as
pointers to objects before, especially in the actions code. This is
obviously better, as it will generate compiler warnings when people
want to pass things to functions that expect E_Objects. This could
probably be more restrictive.
* Added typedefs for the function prototypes in E_Action_Impl. Those
fat signatures were just painful to read in the function
declarations/implementations.
* I've also tried to give parameters more useful names. Calling an
object "o" is a lot of fun when you want to grep for it.
* Included is also Graham's latest menu.c patch. Sorry for the
delay, Graham.
* I've added checks to the menu code that make sure that menus
don't pop up when they're empty (which resulted in a little useless
rectangle).
I guess that's it for now. Sorry if I broke anything, but this was
necessary imho.
SVN revision: 5605
2001-11-02 09:07:52 -08:00
|
|
|
|
|
|
|
D_RETURN_(data);
|
2001-10-09 08:01:58 -07:00
|
|
|
}
|
|
|
|
|
2001-10-17 02:53:44 -07:00
|
|
|
|
2001-10-09 08:01:58 -07:00
|
|
|
#if 0
|
|
|
|
typedef struct _list_base List_Base;
|
|
|
|
typedef struct _list_element List_Element;
|
|
|
|
|
|
|
|
struct _list_base
|
|
|
|
{
|
|
|
|
Evas_List elements;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct _list_element
|
|
|
|
{
|
|
|
|
char *name;
|
|
|
|
int size;
|
|
|
|
float perc;
|
|
|
|
};
|
|
|
|
|
|
|
|
/* eg: */
|
|
|
|
void ts(void)
|
2001-10-17 02:53:44 -07:00
|
|
|
{
|
|
|
|
/* define the different config types and structs to the config engine */
|
2001-10-09 08:01:58 -07:00
|
|
|
E_Config_Base_Type *cf_list;
|
|
|
|
E_Config_Base_Type *cf_element;
|
|
|
|
|
Alright, I spent some time now reading e17's code. Here's what
I've changed, this is big, so read this carefully :)
* I've added debugging macros for messages and function call
tracing. Usage:
D("Creating item %i %i %i\n", x, y, z);
Define DEBUG to use the D macro.
D_ENTER;
D_RETURN;
D_RETURN_(x);
These are for call tracing. Use D_RETURN_(x) when returning
something from a function. Define DEBUG_NEST to use this.
* added iconbar header file to Makefile.am
* added proper new()/cleanup() calls for E_Delayed_Action;
* I've completely rewritten the object and observer handling. Bye
bye macros, this was nasty. It'll be hard enough to avoid leaks
with usecounting in C. We now basically have the same system as gtk.
There's a clear separation of observer and object code now.
An E_Object by itself has nothing to do with observing or being
observed, therefore, there are now E_Observers and E_Observees
that are derived from E_Object. IMPORTANT: The cleanup system now
reflects the reference count system, therefore, all ..._free()
calls are now static, because the destructor should never be called explicitly, but implicitly through e_object_unref(). The object handling
now is as follows:
- The cleanup functions clean up everything that is contained in
a struct, but NOT the struct itself. Instead of the final
free() call, they call the destructor of the base class. The
calls will walk up the hierarchy and clean up what's contained in
every struct, and the final e_object_cleanup() will free the
structure itself. E_Delayed_Action is a good example.
- The only calls that influence the reference count are
e_object_ref() and e_object_unref(). If you need to do things
before an object gets destroyed, you can query the use count using
e_object_get_usecount() and check if it's equal to 1. So this:
OBJ_UNREF(b);
OBJ_IF_FREE(b)
{
ecore_window_reparent(e->win, 0, 0, 0);
e_icccm_release(e->win);
OBJ_FREE(b);
}
now is this:
if (e_object_get_usecount(E_OBJECT(b)) == 1)
{
ecore_window_reparent(e->win, 0, 0, 0);
e_icccm_release(e->win);
}
e_object_unref(E_OBJECT(b));
object.h and observer.h are completely commented, it shouldn't be
too hard to understand. This'll need to be documented in the manual
anyway.
* E_Objects are now used in lots of places where void* were used as
pointers to objects before, especially in the actions code. This is
obviously better, as it will generate compiler warnings when people
want to pass things to functions that expect E_Objects. This could
probably be more restrictive.
* Added typedefs for the function prototypes in E_Action_Impl. Those
fat signatures were just painful to read in the function
declarations/implementations.
* I've also tried to give parameters more useful names. Calling an
object "o" is a lot of fun when you want to grep for it.
* Included is also Graham's latest menu.c patch. Sorry for the
delay, Graham.
* I've added checks to the menu code that make sure that menus
don't pop up when they're empty (which resulted in a little useless
rectangle).
I guess that's it for now. Sorry if I broke anything, but this was
necessary imho.
SVN revision: 5605
2001-11-02 09:07:52 -08:00
|
|
|
D_ENTER;
|
|
|
|
|
2001-10-09 08:01:58 -07:00
|
|
|
cf_element = e_config_type_new();
|
2001-10-17 02:53:44 -07:00
|
|
|
E_CONFIG_NODE(cf_element, "name", E_CFG_TYPE_STR, NULL, List_Element, name, 0, 0, "DEFAULT_NAME");
|
|
|
|
E_CONFIG_NODE(cf_element, "size", E_CFG_TYPE_INT, NULL, List_Element, size, 777, 0, NULL);
|
|
|
|
E_CONFIG_NODE(cf_element, "perc", E_CFG_TYPE_FLOAT, NULL, List_Element, perc, 0, 3.1415, NULL);
|
2001-10-09 08:01:58 -07:00
|
|
|
|
|
|
|
cf_list = e_config_type_new();
|
2001-10-17 02:53:44 -07:00
|
|
|
E_CONFIG_NODE(cf_list, "list", E_CFG_TYPE_LIST, cf_element, List_Base, elements, 0, 0, NULL);
|
|
|
|
|
|
|
|
/* now test it */
|
2001-10-09 08:01:58 -07:00
|
|
|
{
|
|
|
|
List_Base *cfg_data;
|
|
|
|
|
2001-10-17 02:53:44 -07:00
|
|
|
/* load the base data type from the base of the test db file */
|
2001-10-09 08:01:58 -07:00
|
|
|
cfg_data = e_config_load("test.db", "", cf_list);
|
2001-10-17 02:53:44 -07:00
|
|
|
/* no data file? */
|
2001-10-09 08:01:58 -07:00
|
|
|
if (!cfg_data)
|
|
|
|
{
|
|
|
|
printf("no load!\n");
|
|
|
|
}
|
2001-10-17 02:53:44 -07:00
|
|
|
/* got data */
|
2001-10-09 08:01:58 -07:00
|
|
|
else
|
|
|
|
{
|
|
|
|
Evas_List l;
|
|
|
|
|
|
|
|
for (l = cfg_data->elements; l; l = l->next)
|
|
|
|
{
|
|
|
|
List_Element *cfg_element;
|
|
|
|
|
|
|
|
printf("element\n");
|
|
|
|
cfg_element = l->data;
|
|
|
|
printf("... name %s\n", cfg_element->name);
|
|
|
|
printf("... size %i\n", cfg_element->size);
|
|
|
|
printf("... perc %3.3f\n", cfg_element->perc);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
exit(0);
|
|
|
|
}
|
Alright, I spent some time now reading e17's code. Here's what
I've changed, this is big, so read this carefully :)
* I've added debugging macros for messages and function call
tracing. Usage:
D("Creating item %i %i %i\n", x, y, z);
Define DEBUG to use the D macro.
D_ENTER;
D_RETURN;
D_RETURN_(x);
These are for call tracing. Use D_RETURN_(x) when returning
something from a function. Define DEBUG_NEST to use this.
* added iconbar header file to Makefile.am
* added proper new()/cleanup() calls for E_Delayed_Action;
* I've completely rewritten the object and observer handling. Bye
bye macros, this was nasty. It'll be hard enough to avoid leaks
with usecounting in C. We now basically have the same system as gtk.
There's a clear separation of observer and object code now.
An E_Object by itself has nothing to do with observing or being
observed, therefore, there are now E_Observers and E_Observees
that are derived from E_Object. IMPORTANT: The cleanup system now
reflects the reference count system, therefore, all ..._free()
calls are now static, because the destructor should never be called explicitly, but implicitly through e_object_unref(). The object handling
now is as follows:
- The cleanup functions clean up everything that is contained in
a struct, but NOT the struct itself. Instead of the final
free() call, they call the destructor of the base class. The
calls will walk up the hierarchy and clean up what's contained in
every struct, and the final e_object_cleanup() will free the
structure itself. E_Delayed_Action is a good example.
- The only calls that influence the reference count are
e_object_ref() and e_object_unref(). If you need to do things
before an object gets destroyed, you can query the use count using
e_object_get_usecount() and check if it's equal to 1. So this:
OBJ_UNREF(b);
OBJ_IF_FREE(b)
{
ecore_window_reparent(e->win, 0, 0, 0);
e_icccm_release(e->win);
OBJ_FREE(b);
}
now is this:
if (e_object_get_usecount(E_OBJECT(b)) == 1)
{
ecore_window_reparent(e->win, 0, 0, 0);
e_icccm_release(e->win);
}
e_object_unref(E_OBJECT(b));
object.h and observer.h are completely commented, it shouldn't be
too hard to understand. This'll need to be documented in the manual
anyway.
* E_Objects are now used in lots of places where void* were used as
pointers to objects before, especially in the actions code. This is
obviously better, as it will generate compiler warnings when people
want to pass things to functions that expect E_Objects. This could
probably be more restrictive.
* Added typedefs for the function prototypes in E_Action_Impl. Those
fat signatures were just painful to read in the function
declarations/implementations.
* I've also tried to give parameters more useful names. Calling an
object "o" is a lot of fun when you want to grep for it.
* Included is also Graham's latest menu.c patch. Sorry for the
delay, Graham.
* I've added checks to the menu code that make sure that menus
don't pop up when they're empty (which resulted in a little useless
rectangle).
I guess that's it for now. Sorry if I broke anything, but this was
necessary imho.
SVN revision: 5605
2001-11-02 09:07:52 -08:00
|
|
|
|
|
|
|
D_RETURN;
|
2001-10-09 08:01:58 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|