2001-07-30 09:59:37 -07:00
|
|
|
#include <libefsd.h>
|
|
|
|
|
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 "view.h"
|
2001-09-30 15:24:24 -07:00
|
|
|
#include "cursors.h"
|
2001-07-30 09:59:37 -07:00
|
|
|
#include "config.h"
|
|
|
|
#include "border.h"
|
|
|
|
#include "menu.h"
|
|
|
|
#include "menubuild.h"
|
|
|
|
#include "fs.h"
|
2001-11-03 01:07:40 -08:00
|
|
|
#include "file.h"
|
2001-07-30 09:59:37 -07:00
|
|
|
#include "util.h"
|
2001-12-18 19:30:47 -08:00
|
|
|
#include "icons.h"
|
2002-03-06 12:44:48 -08:00
|
|
|
#include "e_dir.h"
|
2002-02-25 10:09:13 -08:00
|
|
|
#include "e_view_machine.h"
|
|
|
|
#include "e_file.h"
|
|
|
|
#include "globals.h"
|
2003-01-15 10:29:56 -08:00
|
|
|
#include <Ebg.h>
|
2000-12-18 13:28:44 -08:00
|
|
|
|
2001-10-17 15:34:27 -07:00
|
|
|
static Ecore_Event *current_ev = NULL;
|
2000-12-27 14:42:59 -08:00
|
|
|
|
2002-03-03 02:40:07 -08:00
|
|
|
static char **dnd_files = NULL;
|
|
|
|
static int dnd_num_files = 0;
|
|
|
|
static E_dnd_enum dnd_pending_mode;
|
|
|
|
static E_View *v_dnd_source;
|
|
|
|
|
2003-01-15 10:29:56 -08:00
|
|
|
static void e_bg_down_cb(void *_data, Evas * _e, Evas_Object * _o,
|
|
|
|
void *event_info);
|
|
|
|
static void e_bg_up_cb(void *_data, Evas * _e, Evas_Object * _o,
|
|
|
|
void *event_info);
|
|
|
|
static void e_bg_move_cb(void *_data, Evas * _e, Evas_Object * _o,
|
|
|
|
void *event_info);
|
2002-03-03 02:40:07 -08:00
|
|
|
static void e_idle(void *data);
|
|
|
|
static void e_wheel(Ecore_Event * ev);
|
|
|
|
static void e_key_down(Ecore_Event * ev);
|
|
|
|
static void e_key_up(Ecore_Event * ev);
|
|
|
|
static void e_mouse_down(Ecore_Event * ev);
|
|
|
|
static void e_mouse_up(Ecore_Event * ev);
|
|
|
|
static void e_mouse_move(Ecore_Event * ev);
|
|
|
|
static void e_mouse_in(Ecore_Event * ev);
|
|
|
|
static void e_mouse_out(Ecore_Event * ev);
|
|
|
|
static void e_window_expose(Ecore_Event * ev);
|
|
|
|
static void e_configure(Ecore_Event * ev);
|
|
|
|
static void e_property(Ecore_Event * ev);
|
|
|
|
static void e_unmap(Ecore_Event * ev);
|
|
|
|
static void e_visibility(Ecore_Event * ev);
|
|
|
|
static void e_focus_in(Ecore_Event * ev);
|
|
|
|
static void e_focus_out(Ecore_Event * ev);
|
|
|
|
static void e_delete(Ecore_Event * ev);
|
|
|
|
static void e_dnd_status(Ecore_Event * ev);
|
|
|
|
static void e_dnd_data_request(Ecore_Event * ev);
|
|
|
|
static void e_dnd_drop_end(Ecore_Event * ev);
|
|
|
|
static void e_dnd_drop_position(Ecore_Event * ev);
|
|
|
|
static void e_dnd_drop(Ecore_Event * ev);
|
|
|
|
static void e_dnd_drop_request(Ecore_Event * ev);
|
|
|
|
static void e_dnd_drop_request_free(void);
|
|
|
|
static void e_dnd_handle_drop(E_View * v);
|
|
|
|
static void e_view_resort_timeout(int val, void *data);
|
|
|
|
static int e_view_restart_alphabetical_qsort_cb(const void *data1,
|
|
|
|
const void *data2);
|
|
|
|
static void e_view_geometry_record_timeout(int val, void *data);
|
|
|
|
static void e_view_scrollbar_v_change_cb(void *_data, E_Scrollbar * sb,
|
|
|
|
double val);
|
|
|
|
static void e_view_scrollbar_h_change_cb(void *_data, E_Scrollbar * sb,
|
|
|
|
double val);
|
|
|
|
static void e_view_write_icon_xy_timeout(int val, void *data);
|
2001-09-30 22:23:42 -07:00
|
|
|
|
|
|
|
static void
|
|
|
|
e_view_write_icon_xy_timeout(int val, void *data)
|
|
|
|
{
|
2002-03-03 02:40:07 -08:00
|
|
|
E_View *v;
|
2003-01-15 10:29:56 -08:00
|
|
|
Evas_List * l;
|
2002-03-03 02:40:07 -08:00
|
|
|
E_Icon *ic;
|
|
|
|
double t_in;
|
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;
|
2002-03-03 02:40:07 -08:00
|
|
|
|
2001-09-30 22:23:42 -07:00
|
|
|
v = data;
|
2001-11-19 23:01:53 -08:00
|
|
|
/* FIXME: this is a problem if we have 1000's of icons */
|
|
|
|
t_in = ecore_get_time();
|
2001-09-30 22:23:42 -07:00
|
|
|
for (l = v->icons; l; l = l->next)
|
|
|
|
{
|
|
|
|
ic = l->data;
|
|
|
|
if (ic->q.write_xy)
|
|
|
|
{
|
2002-03-03 02:40:07 -08:00
|
|
|
char buf[PATH_MAX];
|
|
|
|
|
2001-09-30 22:23:42 -07:00
|
|
|
ic->q.write_xy = 0;
|
2002-02-25 10:09:13 -08:00
|
|
|
/* FIXME */
|
2002-03-06 12:44:48 -08:00
|
|
|
snprintf(buf, PATH_MAX, "%s/%s", ic->view->dir->dir,
|
2002-03-03 02:40:07 -08:00
|
|
|
ic->file->file);
|
|
|
|
|
|
|
|
D("write meta xy for icon for file %s\n", ic->file->file);
|
2001-09-30 22:23:42 -07:00
|
|
|
efsd_set_metadata_int(e_fs_get_connection(),
|
2002-03-03 02:40:07 -08:00
|
|
|
"/pos/x", buf, ic->geom.x);
|
2001-09-30 22:23:42 -07:00
|
|
|
efsd_set_metadata_int(e_fs_get_connection(),
|
2002-03-03 02:40:07 -08:00
|
|
|
"/pos/y", buf, ic->geom.y);
|
2001-09-30 22:23:42 -07:00
|
|
|
}
|
2001-11-19 23:01:53 -08:00
|
|
|
if ((ecore_get_time() - t_in) > 0.10)
|
|
|
|
{
|
2002-03-03 02:40:07 -08:00
|
|
|
char name[PATH_MAX];
|
|
|
|
|
2002-03-06 12:44:48 -08:00
|
|
|
snprintf(name, PATH_MAX, "icon_xy_record.%s", v->dir->dir);
|
2002-03-03 02:40:07 -08:00
|
|
|
ecore_add_event_timer(name, 0.01, e_view_write_icon_xy_timeout, 0,
|
|
|
|
v);
|
2001-11-19 23:01:53 -08:00
|
|
|
D_RETURN;
|
|
|
|
}
|
2001-09-30 22:23:42 -07: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_RETURN;
|
2001-11-03 01:07:40 -08:00
|
|
|
UN(val);
|
2001-09-30 22:23:42 -07:00
|
|
|
}
|
2001-02-06 00:23:36 -08:00
|
|
|
|
2001-07-12 09:40:13 -07:00
|
|
|
void
|
2002-03-03 02:40:07 -08:00
|
|
|
e_view_selection_update(E_View * v)
|
2001-07-12 09:40:13 -07: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;
|
2002-03-03 02:40:07 -08:00
|
|
|
|
2001-07-12 09:40:13 -07:00
|
|
|
if ((v->select.on) && (!v->select.obj.middle))
|
|
|
|
{
|
2001-08-05 05:48:18 -07:00
|
|
|
/* create select objects */
|
2003-01-15 10:29:56 -08:00
|
|
|
v->select.obj.middle = evas_object_rectangle_add(v->evas);
|
|
|
|
evas_object_color_set(v->select.obj.middle,
|
2001-07-12 09:40:13 -07:00
|
|
|
v->select.config.middle.r,
|
|
|
|
v->select.config.middle.g,
|
2002-03-03 02:40:07 -08:00
|
|
|
v->select.config.middle.b, v->select.config.middle.a);
|
2003-01-15 10:29:56 -08:00
|
|
|
evas_object_layer_set(v->select.obj.middle, 300);
|
|
|
|
v->select.obj.edge_l = evas_object_rectangle_add(v->evas);
|
|
|
|
evas_object_color_set(v->select.obj.edge_l,
|
2001-07-12 09:40:13 -07:00
|
|
|
v->select.config.edge_l.r,
|
|
|
|
v->select.config.edge_l.g,
|
2002-03-03 02:40:07 -08:00
|
|
|
v->select.config.edge_l.b, v->select.config.edge_l.a);
|
2003-01-15 10:29:56 -08:00
|
|
|
evas_object_layer_set(v->select.obj.edge_l, 300);
|
|
|
|
v->select.obj.edge_r = evas_object_rectangle_add(v->evas);
|
|
|
|
evas_object_color_set(v->select.obj.edge_r,
|
2001-07-12 09:40:13 -07:00
|
|
|
v->select.config.edge_r.r,
|
|
|
|
v->select.config.edge_r.g,
|
2002-03-03 02:40:07 -08:00
|
|
|
v->select.config.edge_r.b, v->select.config.edge_r.a);
|
2003-01-15 10:29:56 -08:00
|
|
|
evas_object_layer_set(v->select.obj.edge_r, 300);
|
|
|
|
v->select.obj.edge_t = evas_object_rectangle_add(v->evas);
|
|
|
|
evas_object_color_set(v->select.obj.edge_t,
|
2001-07-12 09:40:13 -07:00
|
|
|
v->select.config.edge_t.r,
|
|
|
|
v->select.config.edge_t.g,
|
2002-03-03 02:40:07 -08:00
|
|
|
v->select.config.edge_t.b, v->select.config.edge_t.a);
|
2003-01-15 10:29:56 -08:00
|
|
|
evas_object_layer_set(v->select.obj.edge_t, 300);
|
|
|
|
v->select.obj.edge_b = evas_object_rectangle_add(v->evas);
|
|
|
|
evas_object_color_set(v->select.obj.edge_b,
|
2001-07-12 09:40:13 -07:00
|
|
|
v->select.config.edge_b.r,
|
|
|
|
v->select.config.edge_b.g,
|
2002-03-03 02:40:07 -08:00
|
|
|
v->select.config.edge_b.b, v->select.config.edge_b.a);
|
2003-01-15 10:29:56 -08:00
|
|
|
evas_object_layer_set(v->select.obj.edge_b, 300);
|
2002-03-03 02:40:07 -08:00
|
|
|
|
2003-01-15 10:29:56 -08:00
|
|
|
v->select.obj.grad_l = evas_object_gradient_add(v->evas);
|
|
|
|
evas_object_gradient_angle_set(v->select.obj.grad_l, 270);
|
|
|
|
evas_object_gradient_color_add(v->select.obj.grad_l,
|
2001-07-12 09:40:13 -07:00
|
|
|
v->select.config.grad_l.r,
|
|
|
|
v->select.config.grad_l.g,
|
|
|
|
v->select.config.grad_l.b,
|
|
|
|
v->select.config.grad_l.a, 8);
|
2003-01-15 10:29:56 -08:00
|
|
|
evas_object_gradient_color_add(v->select.obj.grad_l,
|
2001-07-12 09:40:13 -07:00
|
|
|
v->select.config.grad_l.r,
|
|
|
|
v->select.config.grad_l.g,
|
2002-03-03 02:40:07 -08:00
|
|
|
v->select.config.grad_l.b, 0, 8);
|
2003-01-15 10:29:56 -08:00
|
|
|
evas_object_layer_set(v->select.obj.grad_l, 300);
|
|
|
|
v->select.obj.grad_r = evas_object_gradient_add(v->evas);
|
|
|
|
evas_object_gradient_angle_set(v->select.obj.grad_r, 90);
|
|
|
|
evas_object_gradient_color_add(v->select.obj.grad_r,
|
2001-07-12 09:40:13 -07:00
|
|
|
v->select.config.grad_r.r,
|
|
|
|
v->select.config.grad_r.g,
|
|
|
|
v->select.config.grad_r.b,
|
|
|
|
v->select.config.grad_r.a, 8);
|
2003-01-15 10:29:56 -08:00
|
|
|
evas_object_gradient_color_add(v->select.obj.grad_r,
|
2001-07-12 09:40:13 -07:00
|
|
|
v->select.config.grad_r.r,
|
|
|
|
v->select.config.grad_r.g,
|
2002-03-03 02:40:07 -08:00
|
|
|
v->select.config.grad_r.b, 0, 8);
|
2003-01-15 10:29:56 -08:00
|
|
|
evas_object_layer_set(v->select.obj.grad_r, 300);
|
|
|
|
v->select.obj.grad_t = evas_object_gradient_add(v->evas);
|
|
|
|
evas_object_gradient_angle_set(v->select.obj.grad_t, 0);
|
|
|
|
evas_object_gradient_color_add(v->select.obj.grad_t,
|
2001-07-12 09:40:13 -07:00
|
|
|
v->select.config.grad_t.r,
|
|
|
|
v->select.config.grad_t.g,
|
|
|
|
v->select.config.grad_t.b,
|
|
|
|
v->select.config.grad_t.a, 8);
|
2003-01-15 10:29:56 -08:00
|
|
|
evas_object_gradient_color_add(v->select.obj.grad_t,
|
2001-07-12 09:40:13 -07:00
|
|
|
v->select.config.grad_t.r,
|
|
|
|
v->select.config.grad_t.g,
|
2002-03-03 02:40:07 -08:00
|
|
|
v->select.config.grad_t.b, 0, 8);
|
2003-01-15 10:29:56 -08:00
|
|
|
evas_object_layer_set(v->select.obj.grad_t, 300);
|
|
|
|
v->select.obj.grad_b = evas_object_gradient_add(v->evas);
|
|
|
|
evas_object_gradient_angle_set(v->select.obj.grad_b, 180);
|
|
|
|
evas_object_gradient_color_add(v->select.obj.grad_b,
|
2001-07-12 09:40:13 -07:00
|
|
|
v->select.config.grad_b.r,
|
|
|
|
v->select.config.grad_b.g,
|
|
|
|
v->select.config.grad_b.b,
|
|
|
|
v->select.config.grad_b.a, 8);
|
2003-01-15 10:29:56 -08:00
|
|
|
evas_object_gradient_color_add(v->select.obj.grad_b,
|
2001-07-12 09:40:13 -07:00
|
|
|
v->select.config.grad_b.r,
|
|
|
|
v->select.config.grad_b.g,
|
2002-03-03 02:40:07 -08:00
|
|
|
v->select.config.grad_b.b, 0, 8);
|
2003-01-15 10:29:56 -08:00
|
|
|
evas_object_layer_set(v->select.obj.grad_b, 300);
|
|
|
|
v->select.obj.clip = evas_object_rectangle_add(v->evas);
|
|
|
|
evas_object_color_set(v->select.obj.clip, 255, 255, 255, 255);
|
|
|
|
evas_object_clip_set(v->select.obj.grad_l, v->select.obj.clip);
|
|
|
|
evas_object_clip_set(v->select.obj.grad_r, v->select.obj.clip);
|
|
|
|
evas_object_clip_set(v->select.obj.grad_t, v->select.obj.clip);
|
|
|
|
evas_object_clip_set(v->select.obj.grad_b, v->select.obj.clip);
|
2001-07-12 09:40:13 -07:00
|
|
|
}
|
|
|
|
if ((!v->select.on) && (v->select.obj.middle))
|
|
|
|
{
|
|
|
|
/* destroy select objects */
|
2003-01-15 10:29:56 -08:00
|
|
|
evas_object_del(v->select.obj.middle);
|
|
|
|
evas_object_del(v->select.obj.edge_l);
|
|
|
|
evas_object_del(v->select.obj.edge_r);
|
|
|
|
evas_object_del(v->select.obj.edge_t);
|
|
|
|
evas_object_del(v->select.obj.edge_b);
|
|
|
|
evas_object_del(v->select.obj.grad_l);
|
|
|
|
evas_object_del(v->select.obj.grad_r);
|
|
|
|
evas_object_del(v->select.obj.grad_t);
|
|
|
|
evas_object_del(v->select.obj.grad_b);
|
|
|
|
evas_object_del(v->select.obj.clip);
|
2001-07-12 09:40:13 -07:00
|
|
|
v->select.obj.middle = NULL;
|
2002-02-26 13:12:45 -08:00
|
|
|
v->changed = 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;
|
2001-07-12 09:40:13 -07:00
|
|
|
}
|
2002-03-03 02:40:07 -08:00
|
|
|
if (!v->select.on)
|
|
|
|
D_RETURN;
|
2001-07-12 09:40:13 -07:00
|
|
|
/* move & resize select objects */
|
2002-03-03 02:40:07 -08:00
|
|
|
{
|
2003-01-15 10:29:56 -08:00
|
|
|
evas_object_move(v->select.obj.edge_l, v->select.x, v->select.y + 1);
|
|
|
|
evas_object_resize(v->select.obj.edge_l, 1, v->select.h - 1);
|
|
|
|
evas_object_move(v->select.obj.edge_r, v->select.x + v->select.w - 1,
|
2002-03-03 02:40:07 -08:00
|
|
|
v->select.y);
|
2003-01-15 10:29:56 -08:00
|
|
|
evas_object_resize(v->select.obj.edge_r, 1, v->select.h - 1);
|
|
|
|
evas_object_move(v->select.obj.edge_t, v->select.x, v->select.y);
|
|
|
|
evas_object_resize(v->select.obj.edge_t, v->select.w - 1, 1);
|
|
|
|
evas_object_move(v->select.obj.edge_b, v->select.x + 1,
|
2002-03-03 02:40:07 -08:00
|
|
|
v->select.y + v->select.h - 1);
|
2003-01-15 10:29:56 -08:00
|
|
|
evas_object_resize(v->select.obj.edge_b, v->select.w - 1, 1);
|
|
|
|
evas_object_move(v->select.obj.middle, v->select.x + 1,
|
2002-03-03 02:40:07 -08:00
|
|
|
v->select.y + 1);
|
2003-01-15 10:29:56 -08:00
|
|
|
evas_object_resize(v->select.obj.middle, v->select.w - 1 - 1,
|
2002-03-03 02:40:07 -08:00
|
|
|
v->select.h - 1 - 1);
|
2003-01-15 10:29:56 -08:00
|
|
|
evas_object_move(v->select.obj.grad_l, v->select.x + 1,
|
2002-03-03 02:40:07 -08:00
|
|
|
v->select.y + 1);
|
2003-01-15 10:29:56 -08:00
|
|
|
evas_object_resize(v->select.obj.grad_l, v->select.config.grad_size.l,
|
2002-03-03 02:40:07 -08:00
|
|
|
v->select.h - 1 - 1);
|
2003-01-15 10:29:56 -08:00
|
|
|
evas_object_move(v->select.obj.grad_r,
|
2002-03-03 02:40:07 -08:00
|
|
|
v->select.x + v->select.w - 1 - v->select.config.grad_size.r,
|
|
|
|
v->select.y + 1);
|
2003-01-15 10:29:56 -08:00
|
|
|
evas_object_resize(v->select.obj.grad_r, v->select.config.grad_size.r,
|
2002-03-03 02:40:07 -08:00
|
|
|
v->select.h - 1 - 1);
|
2003-01-15 10:29:56 -08:00
|
|
|
evas_object_move(v->select.obj.grad_t, v->select.x + 1,
|
2002-03-03 02:40:07 -08:00
|
|
|
v->select.y + 1);
|
2003-01-15 10:29:56 -08:00
|
|
|
evas_object_resize(v->select.obj.grad_t, v->select.w - 1 - 1,
|
2002-03-03 02:40:07 -08:00
|
|
|
v->select.config.grad_size.t);
|
2003-01-15 10:29:56 -08:00
|
|
|
evas_object_move(v->select.obj.grad_b, v->select.x + 1,
|
2002-03-03 02:40:07 -08:00
|
|
|
v->select.y + v->select.h - 1 - v->select.config.grad_size.b);
|
2003-01-15 10:29:56 -08:00
|
|
|
evas_object_resize(v->select.obj.grad_b, v->select.w - 1 - 1,
|
2002-03-03 02:40:07 -08:00
|
|
|
v->select.config.grad_size.b);
|
2003-01-15 10:29:56 -08:00
|
|
|
evas_object_move(v->select.obj.clip, v->select.x + 1, v->select.y + 1);
|
|
|
|
evas_object_resize(v->select.obj.clip, v->select.w - 1 - 1,
|
2002-03-03 02:40:07 -08:00
|
|
|
v->select.h - 1 - 1);
|
|
|
|
}
|
|
|
|
|
2003-01-15 10:29:56 -08:00
|
|
|
evas_object_show(v->select.obj.middle);
|
|
|
|
evas_object_show(v->select.obj.edge_l);
|
|
|
|
evas_object_show(v->select.obj.edge_r);
|
|
|
|
evas_object_show(v->select.obj.edge_t);
|
|
|
|
evas_object_show(v->select.obj.edge_b);
|
|
|
|
evas_object_show(v->select.obj.grad_l);
|
|
|
|
evas_object_show(v->select.obj.grad_r);
|
|
|
|
evas_object_show(v->select.obj.grad_t);
|
|
|
|
evas_object_show(v->select.obj.grad_b);
|
|
|
|
evas_object_show(v->select.obj.clip);
|
2002-02-26 13:12:45 -08:00
|
|
|
v->changed = 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;
|
2001-07-12 09:40:13 -07:00
|
|
|
}
|
2001-03-04 19:04:33 -08:00
|
|
|
|
2001-08-12 23:35:14 -07:00
|
|
|
static void
|
2002-03-03 02:40:07 -08:00
|
|
|
e_view_scrollbar_v_change_cb(void *_data, E_Scrollbar * sb, double val)
|
2001-08-12 23:35:14 -07:00
|
|
|
{
|
2002-03-03 02:40:07 -08:00
|
|
|
E_View *v;
|
|
|
|
|
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;
|
2002-03-03 02:40:07 -08:00
|
|
|
|
2001-08-12 23:35:14 -07:00
|
|
|
v = _data;
|
|
|
|
e_view_scroll_to(v, v->scroll.x, v->spacing.window.t - sb->val);
|
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-08-12 23:35:14 -07:00
|
|
|
UN(val);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2002-03-03 02:40:07 -08:00
|
|
|
e_view_scrollbar_h_change_cb(void *_data, E_Scrollbar * sb, double val)
|
2001-08-12 23:35:14 -07:00
|
|
|
{
|
2002-03-03 02:40:07 -08:00
|
|
|
E_View *v;
|
|
|
|
|
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;
|
2002-03-03 02:40:07 -08:00
|
|
|
|
2001-08-12 23:35:14 -07:00
|
|
|
v = _data;
|
|
|
|
e_view_scroll_to(v, v->spacing.window.l - sb->val, v->scroll.y);
|
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-08-12 23:35:14 -07:00
|
|
|
UN(val);
|
|
|
|
}
|
|
|
|
|
2001-02-17 18:56:37 -08:00
|
|
|
static void
|
2003-01-15 10:29:56 -08:00
|
|
|
e_bg_down_cb(void *_data, Evas * _e, Evas_Object * _o, void *event_info)
|
2001-02-17 18:56:37 -08:00
|
|
|
{
|
2002-03-03 02:40:07 -08:00
|
|
|
Ecore_Event_Mouse_Down *ev;
|
|
|
|
E_View *v;
|
2003-01-15 10:29:56 -08:00
|
|
|
Evas_Event_Mouse_Down *ev_info = event_info;
|
2002-03-03 02:40:07 -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;
|
2002-02-25 10:09:13 -08:00
|
|
|
|
2002-03-03 02:40:07 -08:00
|
|
|
if (!current_ev)
|
|
|
|
D_RETURN;
|
2001-02-17 18:56:37 -08:00
|
|
|
ev = current_ev->event;
|
|
|
|
v = _data;
|
2001-11-03 07:33:21 -08:00
|
|
|
|
|
|
|
if (!(ev->mods & (multi_select_mod | range_select_mod)))
|
|
|
|
{
|
2002-03-03 02:40:07 -08:00
|
|
|
v->select.last_count = v->select.count;
|
2002-03-04 15:57:56 -08:00
|
|
|
e_view_deselect_all(v);
|
2001-11-03 07:33:21 -08:00
|
|
|
}
|
|
|
|
|
2003-01-15 10:29:56 -08:00
|
|
|
if (ev_info->button == 1)
|
2001-02-17 18:56:37 -08:00
|
|
|
{
|
2003-01-15 10:29:56 -08:00
|
|
|
v->select.down.x = ev_info->output.x;
|
|
|
|
v->select.down.y = ev_info->output.y;
|
2001-07-12 09:40:13 -07:00
|
|
|
v->select.on = 1;
|
2003-01-15 10:29:56 -08:00
|
|
|
if (ev_info->output.x < v->select.down.x)
|
2001-07-12 09:40:13 -07:00
|
|
|
{
|
2003-01-15 10:29:56 -08:00
|
|
|
v->select.x = ev_info->output.x;
|
2001-07-12 09:40:13 -07:00
|
|
|
v->select.w = v->select.down.x - v->select.x + 1;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
v->select.x = v->select.down.x;
|
2003-01-15 10:29:56 -08:00
|
|
|
v->select.w = ev_info->output.x - v->select.down.x + 1;
|
2001-07-12 09:40:13 -07:00
|
|
|
}
|
2003-01-15 10:29:56 -08:00
|
|
|
if (ev_info->output.y < v->select.down.y)
|
2001-02-17 18:56:37 -08:00
|
|
|
{
|
2003-01-15 10:29:56 -08:00
|
|
|
v->select.y = ev_info->output.y;
|
2001-07-12 09:40:13 -07:00
|
|
|
v->select.h = v->select.down.y - v->select.y + 1;
|
2001-02-17 18:56:37 -08:00
|
|
|
}
|
2001-07-12 09:40:13 -07:00
|
|
|
else
|
|
|
|
{
|
|
|
|
v->select.y = v->select.down.y;
|
2003-01-15 10:29:56 -08:00
|
|
|
v->select.h = ev_info->output.y - v->select.down.y + 1;
|
2001-07-12 09:40:13 -07:00
|
|
|
}
|
|
|
|
e_view_selection_update(v);
|
2001-02-17 18:56:37 -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
|
|
|
|
2003-01-15 10:29:56 -08:00
|
|
|
if (ev_info->button == 2 && ev->double_click)
|
2002-03-03 02:40:07 -08:00
|
|
|
ecore_event_loop_quit();
|
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-07-30 18:12:02 -07:00
|
|
|
UN(_e);
|
|
|
|
UN(_o);
|
2001-02-17 18:56:37 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2003-01-15 10:29:56 -08:00
|
|
|
e_bg_up_cb(void *_data, Evas * _e, Evas_Object * _o, void *event_info)
|
2002-03-03 02:40:07 -08:00
|
|
|
{
|
|
|
|
Ecore_Event_Mouse_Up *ev;
|
|
|
|
E_View *v;
|
|
|
|
int dx, dy;
|
2003-01-15 10:29:56 -08:00
|
|
|
Evas_Event_Mouse_Up *ev_info = event_info;
|
2002-03-03 02:40:07 -08:00
|
|
|
|
|
|
|
D_ENTER;
|
|
|
|
|
|
|
|
if (!current_ev)
|
|
|
|
D_RETURN;
|
2001-02-17 18:56:37 -08:00
|
|
|
ev = current_ev->event;
|
|
|
|
v = _data;
|
2001-07-12 09:40:13 -07:00
|
|
|
dx = 0;
|
|
|
|
dy = 0;
|
2001-11-03 07:33:21 -08:00
|
|
|
|
2001-07-12 09:40:13 -07:00
|
|
|
if (v->select.on)
|
2001-02-17 18:56:37 -08:00
|
|
|
{
|
2003-01-15 10:29:56 -08:00
|
|
|
dx = v->select.down.x - ev_info->output.x;
|
|
|
|
dy = v->select.down.y - ev_info->output.y;
|
2002-03-03 02:40:07 -08:00
|
|
|
if (dx < 0)
|
|
|
|
dx = -dx;
|
|
|
|
if (dy < 0)
|
|
|
|
dy = -dy;
|
2003-01-15 10:29:56 -08:00
|
|
|
if (ev_info->button == 1)
|
2002-03-03 02:40:07 -08:00
|
|
|
v->select.on = 0;
|
2001-07-12 09:40:13 -07:00
|
|
|
e_view_selection_update(v);
|
|
|
|
}
|
2001-11-03 07:33:21 -08:00
|
|
|
|
2003-01-15 10:29:56 -08:00
|
|
|
if ((ev_info->button == 1) && ((dx > 3) || (dy > 3)))
|
2001-07-12 09:40:13 -07:00
|
|
|
{
|
2003-01-15 10:29:56 -08:00
|
|
|
Evas_List * l;
|
2002-03-03 02:40:07 -08:00
|
|
|
|
2001-07-12 09:40:13 -07:00
|
|
|
for (l = v->icons; l; l = l->next)
|
2001-02-17 18:56:37 -08:00
|
|
|
{
|
2002-03-03 02:40:07 -08:00
|
|
|
E_Icon *ic;
|
|
|
|
|
2001-07-12 09:40:13 -07:00
|
|
|
ic = l->data;
|
|
|
|
if (INTERSECTS(v->select.x, v->select.y, v->select.w, v->select.h,
|
2002-03-03 02:40:07 -08:00
|
|
|
v->scroll.x + ic->geom.x,
|
2001-07-31 21:45:14 -07:00
|
|
|
v->scroll.y + ic->geom.y, ic->geom.w, ic->geom.h))
|
2001-02-17 18:56:37 -08:00
|
|
|
{
|
2001-07-12 09:40:13 -07:00
|
|
|
if (ic->state.visible)
|
|
|
|
{
|
2001-11-03 06:55:21 -08:00
|
|
|
e_icon_invert_selection(ic);
|
2001-07-12 09:40:13 -07:00
|
|
|
}
|
2001-02-17 18:56:37 -08:00
|
|
|
}
|
2001-07-12 09:40:13 -07:00
|
|
|
}
|
|
|
|
}
|
2001-11-03 07:33:21 -08:00
|
|
|
else if (v->select.last_count == 0)
|
2001-07-12 09:40:13 -07:00
|
|
|
{
|
2003-01-15 10:29:56 -08:00
|
|
|
if (ev_info->button == 1)
|
2001-07-12 09:40:13 -07:00
|
|
|
{
|
2001-11-03 07:33:21 -08:00
|
|
|
if (!(ev->mods & (multi_select_mod | range_select_mod)))
|
2001-02-17 18:56:37 -08:00
|
|
|
{
|
2001-07-12 09:40:13 -07:00
|
|
|
static E_Build_Menu *buildmenu = NULL;
|
2002-03-03 02:40:07 -08:00
|
|
|
|
2001-07-12 09:40:13 -07:00
|
|
|
if (!buildmenu)
|
|
|
|
{
|
2002-03-03 02:40:07 -08:00
|
|
|
char *apps_menu_db;
|
|
|
|
|
2001-07-12 09:40:13 -07:00
|
|
|
apps_menu_db = e_config_get("apps_menu");
|
2002-03-03 02:40:07 -08:00
|
|
|
if (apps_menu_db)
|
|
|
|
buildmenu = e_build_menu_new_from_db(apps_menu_db);
|
2001-07-12 09:40:13 -07:00
|
|
|
}
|
|
|
|
if (buildmenu)
|
|
|
|
{
|
2002-03-03 02:40:07 -08:00
|
|
|
static E_Menu *menu = NULL;
|
|
|
|
|
2001-07-12 09:40:13 -07:00
|
|
|
menu = buildmenu->menu;
|
|
|
|
if (menu)
|
2001-09-25 09:37:00 -07:00
|
|
|
{
|
2002-03-03 02:40:07 -08:00
|
|
|
e_menu_show_at_mouse(menu, ev->rx, ev->ry,
|
|
|
|
ev->time);
|
|
|
|
}
|
2001-07-12 09:40:13 -07:00
|
|
|
}
|
2001-02-17 18:56:37 -08:00
|
|
|
}
|
|
|
|
}
|
2003-01-15 10:29:56 -08:00
|
|
|
else if (ev_info->button == 2)
|
2001-08-16 01:45:37 -07:00
|
|
|
{
|
2002-01-24 00:12:12 -08:00
|
|
|
#if 1
|
2002-01-23 17:08:52 -08:00
|
|
|
static E_Build_Menu *buildmenu = NULL;
|
|
|
|
|
|
|
|
if (!buildmenu)
|
2002-03-03 02:40:07 -08:00
|
|
|
{
|
|
|
|
D("building iconified windows menu\n");
|
|
|
|
buildmenu = e_build_menu_new_from_iconified_borders();
|
|
|
|
}
|
|
|
|
if (buildmenu && buildmenu->changed)
|
|
|
|
{
|
|
|
|
D("buildmenu changed! rebuild!\n");
|
|
|
|
e_build_menu_iconified_borders_rebuild(buildmenu);
|
|
|
|
}
|
2002-01-23 17:08:52 -08:00
|
|
|
if (buildmenu)
|
2002-03-03 02:40:07 -08:00
|
|
|
{
|
|
|
|
static E_Menu *menu = NULL;
|
2002-01-27 21:41:29 -08:00
|
|
|
|
2002-03-03 02:40:07 -08:00
|
|
|
menu = buildmenu->menu;
|
2002-01-27 21:41:29 -08:00
|
|
|
|
2002-03-03 02:40:07 -08:00
|
|
|
if (menu)
|
|
|
|
{
|
|
|
|
D("showing iconified window menu\n");
|
|
|
|
e_menu_show_at_mouse(menu, ev->rx, ev->ry, ev->time);
|
|
|
|
}
|
|
|
|
}
|
2002-01-23 17:08:52 -08:00
|
|
|
#endif
|
|
|
|
}
|
2003-01-15 10:29:56 -08:00
|
|
|
else if (ev_info->button == 3)
|
2001-02-17 18:56:37 -08:00
|
|
|
{
|
2001-03-20 20:39:45 -08:00
|
|
|
static E_Build_Menu *buildmenu = NULL;
|
2002-03-03 02:40:07 -08:00
|
|
|
|
2001-03-20 20:39:45 -08:00
|
|
|
if (!buildmenu)
|
2002-03-03 02:40:07 -08:00
|
|
|
{
|
|
|
|
buildmenu =
|
|
|
|
e_build_menu_new_from_gnome_apps("/usr/share/gnome/apps");
|
2001-03-20 20:39:45 -08:00
|
|
|
}
|
|
|
|
if (buildmenu)
|
|
|
|
{
|
2002-03-03 02:40:07 -08:00
|
|
|
static E_Menu *menu = NULL;
|
|
|
|
|
2001-03-20 20:39:45 -08:00
|
|
|
menu = buildmenu->menu;
|
|
|
|
if (menu)
|
2002-03-03 02:40:07 -08:00
|
|
|
e_menu_show_at_mouse(menu, ev->rx, ev->ry, ev->time);
|
2001-03-20 20:39:45 -08:00
|
|
|
}
|
2001-07-12 09:40:13 -07:00
|
|
|
}
|
|
|
|
}
|
2003-01-15 10:29:56 -08:00
|
|
|
if (ev_info->button == 1)
|
2001-07-12 09:40:13 -07:00
|
|
|
{
|
2003-01-15 10:29:56 -08:00
|
|
|
v->select.x = ev_info->output.x;
|
|
|
|
v->select.y = ev_info->output.y;
|
2001-07-12 09:40:13 -07: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_RETURN;
|
2001-07-30 18:12:02 -07:00
|
|
|
UN(_e);
|
|
|
|
UN(_o);
|
2001-07-12 09:40:13 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2003-01-15 10:29:56 -08:00
|
|
|
e_bg_move_cb(void *_data, Evas * _e, Evas_Object * _o, void *event_info)
|
2001-07-12 09:40:13 -07:00
|
|
|
{
|
2002-03-03 02:40:07 -08:00
|
|
|
Ecore_Event_Mouse_Down *ev;
|
|
|
|
E_View *v;
|
2003-01-15 10:29:56 -08:00
|
|
|
Evas_Event_Mouse_Move *ev_info = event_info;
|
2002-03-03 02:40:07 -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;
|
2002-03-03 02:40:07 -08:00
|
|
|
|
|
|
|
if (!current_ev)
|
|
|
|
D_RETURN;
|
2001-07-12 09:40:13 -07:00
|
|
|
ev = current_ev->event;
|
|
|
|
v = _data;
|
|
|
|
if (v->select.on)
|
|
|
|
{
|
2003-01-15 10:29:56 -08:00
|
|
|
if (ev_info->cur.output.x < v->select.down.x)
|
2001-07-12 09:40:13 -07:00
|
|
|
{
|
2003-01-15 10:29:56 -08:00
|
|
|
v->select.x = ev_info->cur.output.x;
|
2001-07-12 09:40:13 -07:00
|
|
|
v->select.w = v->select.down.x - v->select.x + 1;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
v->select.x = v->select.down.x;
|
2003-01-15 10:29:56 -08:00
|
|
|
v->select.w = ev_info->cur.output.x - v->select.down.x + 1;
|
2001-07-12 09:40:13 -07:00
|
|
|
}
|
2003-01-15 10:29:56 -08:00
|
|
|
if (ev_info->cur.output.y < v->select.down.y)
|
2001-07-12 09:40:13 -07:00
|
|
|
{
|
2003-01-15 10:29:56 -08:00
|
|
|
v->select.y = ev_info->cur.output.y;
|
2001-07-12 09:40:13 -07:00
|
|
|
v->select.h = v->select.down.y - v->select.y + 1;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
v->select.y = v->select.down.y;
|
2003-01-15 10:29:56 -08:00
|
|
|
v->select.h = ev_info->cur.output.y - v->select.down.y + 1;
|
2001-07-12 09:40:13 -07:00
|
|
|
}
|
|
|
|
e_view_selection_update(v);
|
2001-11-03 02:59:17 -08:00
|
|
|
|
2001-07-12 09:40:13 -07: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_RETURN;
|
2001-07-30 18:12:02 -07:00
|
|
|
UN(_e);
|
|
|
|
UN(_o);
|
2001-07-12 09:40:13 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2002-03-06 12:59:16 -08:00
|
|
|
e_view_deselect_all(E_View * v)
|
2001-07-12 09:40:13 -07:00
|
|
|
{
|
2003-01-15 10:29:56 -08:00
|
|
|
Evas_List * l;
|
2002-03-01 08:31:29 -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;
|
2002-03-04 14:00:16 -08:00
|
|
|
|
2002-03-06 12:59:16 -08:00
|
|
|
for (l = v->icons; l; l = l->next)
|
|
|
|
{
|
|
|
|
E_Icon *ic;
|
2002-03-04 14:00:16 -08:00
|
|
|
|
2002-03-06 12:59:16 -08:00
|
|
|
ic = l->data;
|
|
|
|
e_icon_deselect(ic);
|
|
|
|
}
|
2002-03-04 14:00:16 -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_RETURN;
|
2001-07-12 09:40:13 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2002-03-03 02:40:07 -08:00
|
|
|
e_view_deselect_all_except(E_Icon * not_ic)
|
2001-07-12 09:40:13 -07:00
|
|
|
{
|
2003-01-15 10:29:56 -08:00
|
|
|
Evas_List * l;
|
2002-03-01 08:31:29 -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;
|
2002-03-04 14:00:16 -08:00
|
|
|
|
2002-03-04 15:57:56 -08:00
|
|
|
for (l = not_ic->view->icons; l; l = l->next)
|
2002-03-03 02:40:07 -08:00
|
|
|
{
|
2002-03-04 15:57:56 -08:00
|
|
|
E_Icon *ic;
|
2002-03-04 14:00:16 -08:00
|
|
|
|
2002-03-04 15:57:56 -08:00
|
|
|
ic = l->data;
|
|
|
|
if (ic != not_ic)
|
2002-03-06 12:59:16 -08:00
|
|
|
e_icon_deselect(ic);
|
2002-03-03 02:40:07 -08:00
|
|
|
}
|
2002-03-04 14:00:16 -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_RETURN;
|
2001-07-12 09:40:13 -07:00
|
|
|
}
|
|
|
|
|
2001-07-31 21:45:14 -07:00
|
|
|
void
|
2002-03-03 02:40:07 -08:00
|
|
|
e_view_icons_get_extents(E_View * v, int *min_x, int *min_y, int *max_x,
|
|
|
|
int *max_y)
|
2001-07-31 21:45:14 -07:00
|
|
|
{
|
2003-01-15 10:29:56 -08:00
|
|
|
Evas_List * l;
|
2002-03-03 02:40:07 -08:00
|
|
|
int x1, x2, y1, y2;
|
|
|
|
|
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;
|
2002-03-03 02:40:07 -08:00
|
|
|
|
2001-08-12 23:35:14 -07:00
|
|
|
x1 = v->extents.x1;
|
|
|
|
x2 = v->extents.x2;
|
|
|
|
y1 = v->extents.y1;
|
|
|
|
y2 = v->extents.y2;
|
|
|
|
if (!v->extents.valid)
|
|
|
|
{
|
|
|
|
x1 = 999999999;
|
|
|
|
x2 = -999999999;
|
|
|
|
y1 = 999999999;
|
|
|
|
y2 = -999999999;
|
|
|
|
if (!v->icons)
|
|
|
|
{
|
2002-03-03 02:40:07 -08:00
|
|
|
if (min_x)
|
|
|
|
*min_x = 0;
|
|
|
|
if (min_y)
|
|
|
|
*min_y = 0;
|
|
|
|
if (max_x)
|
|
|
|
*max_x = 1;
|
|
|
|
if (max_y)
|
|
|
|
*max_y = 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;
|
2001-08-12 23:35:14 -07:00
|
|
|
}
|
|
|
|
for (l = v->icons; l; l = l->next)
|
|
|
|
{
|
2002-03-03 02:40:07 -08:00
|
|
|
E_Icon *ic;
|
|
|
|
|
2001-08-12 23:35:14 -07:00
|
|
|
ic = l->data;
|
2002-03-03 02:40:07 -08:00
|
|
|
if (ic->geom.x < x1)
|
|
|
|
x1 = ic->geom.x;
|
|
|
|
if (ic->geom.y < y1)
|
|
|
|
y1 = ic->geom.y;
|
|
|
|
if (ic->geom.x + ic->geom.w > x2)
|
|
|
|
x2 = ic->geom.x + ic->geom.w;
|
|
|
|
if (ic->geom.y + ic->geom.h > y2)
|
|
|
|
y2 = ic->geom.y + ic->geom.h;
|
2001-08-12 23:35:14 -07:00
|
|
|
}
|
|
|
|
v->extents.x1 = x1;
|
|
|
|
v->extents.y1 = y1;
|
|
|
|
v->extents.x2 = x2;
|
|
|
|
v->extents.y2 = y2;
|
2001-07-31 21:45:14 -07:00
|
|
|
}
|
2001-08-12 23:35:14 -07:00
|
|
|
v->extents.valid = 1;
|
2002-03-03 02:40:07 -08:00
|
|
|
if (x1 > 0)
|
|
|
|
x1 = 0;
|
|
|
|
if (y1 > 0)
|
|
|
|
y1 = 0;
|
|
|
|
if (min_x)
|
|
|
|
*min_x = x1;
|
|
|
|
if (min_y)
|
|
|
|
*min_y = y1;
|
|
|
|
if (max_x)
|
|
|
|
*max_x = x2 - 1;
|
|
|
|
if (max_y)
|
|
|
|
*max_y = y2 - 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;
|
2001-07-31 21:45:14 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2002-03-03 02:40:07 -08:00
|
|
|
e_view_icons_apply_xy(E_View * v)
|
2001-07-31 21:45:14 -07:00
|
|
|
{
|
2003-01-15 10:29:56 -08:00
|
|
|
Evas_List * l;
|
2002-03-03 02:40:07 -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;
|
2002-03-03 02:40:07 -08:00
|
|
|
|
2001-07-31 21:45:14 -07:00
|
|
|
for (l = v->icons; l; l = l->next)
|
|
|
|
{
|
2002-03-03 02:40:07 -08:00
|
|
|
E_Icon *ic;
|
|
|
|
|
2001-07-31 21:45:14 -07:00
|
|
|
ic = l->data;
|
2001-11-03 06:55:21 -08:00
|
|
|
e_icon_apply_xy(ic);
|
2001-07-31 21:45:14 -07: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
|
|
|
|
2002-03-04 15:57:56 -08:00
|
|
|
v->changed = 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;
|
2001-07-31 21:45:14 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2002-03-03 02:40:07 -08:00
|
|
|
e_view_scroll_to(E_View * v, int sx, int sy)
|
2001-07-31 21:45:14 -07:00
|
|
|
{
|
2002-03-03 02:40:07 -08:00
|
|
|
int min_x, min_y, max_x, max_y;
|
|
|
|
|
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;
|
2002-03-03 02:40:07 -08:00
|
|
|
|
2001-07-31 21:45:14 -07:00
|
|
|
e_view_icons_get_extents(v, &min_x, &min_y, &max_x, &max_y);
|
2002-01-06 02:22:31 -08:00
|
|
|
|
2001-07-31 21:45:14 -07:00
|
|
|
if (sx < v->size.w - v->spacing.window.r - max_x)
|
2002-03-03 02:40:07 -08:00
|
|
|
sx = v->size.w - v->spacing.window.r - max_x;
|
2001-07-31 21:45:14 -07:00
|
|
|
if (sx > v->spacing.window.l - min_x)
|
2002-03-03 02:40:07 -08:00
|
|
|
sx = v->spacing.window.l - min_x;
|
2001-07-31 21:45:14 -07:00
|
|
|
if (sy < v->size.h - v->spacing.window.b - max_y)
|
2002-03-03 02:40:07 -08:00
|
|
|
sy = v->size.h - v->spacing.window.b - max_y;
|
2001-07-31 21:45:14 -07:00
|
|
|
if (sy > v->spacing.window.t - min_y)
|
2002-03-03 02:40:07 -08:00
|
|
|
sy = v->spacing.window.t - min_y;
|
2002-01-06 02:22:31 -08:00
|
|
|
|
2002-03-03 02:40:07 -08:00
|
|
|
if ((sx == v->scroll.x) && (v->scroll.y == sy))
|
|
|
|
D_RETURN;
|
2001-07-31 21:45:14 -07:00
|
|
|
v->scroll.x = sx;
|
|
|
|
v->scroll.y = sy;
|
|
|
|
e_view_icons_apply_xy(v);
|
2002-03-03 02:40:07 -08:00
|
|
|
if (v->bg)
|
|
|
|
e_bg_set_scroll(v->bg, v->scroll.x, v->scroll.y);
|
2002-03-04 14:00:16 -08:00
|
|
|
v->changed = 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;
|
2001-07-31 21:45:14 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2002-03-03 02:40:07 -08:00
|
|
|
e_view_scroll_by(E_View * v, int sx, int sy)
|
2001-07-31 21:45:14 -07: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;
|
2002-03-03 02:40:07 -08:00
|
|
|
|
2001-07-31 21:45:14 -07:00
|
|
|
e_view_scroll_to(v, v->scroll.x + sx, v->scroll.y + sy);
|
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-07-31 21:45:14 -07:00
|
|
|
}
|
|
|
|
|
2001-08-05 05:48:18 -07:00
|
|
|
void
|
2002-03-03 02:40:07 -08:00
|
|
|
e_view_scroll_to_percent(E_View * v, double psx, double psy)
|
2001-08-05 05:48:18 -07:00
|
|
|
{
|
2002-03-03 02:40:07 -08:00
|
|
|
int min_x, min_y, max_x, max_y;
|
|
|
|
int sx, sy;
|
|
|
|
|
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;
|
2002-03-03 02:40:07 -08:00
|
|
|
|
2001-08-05 05:48:18 -07:00
|
|
|
e_view_icons_get_extents(v, &min_x, &min_y, &max_x, &max_y);
|
|
|
|
sx = (psx * ((double)max_x - (double)min_x)) - min_x;
|
|
|
|
sy = (psy * ((double)max_y - (double)min_y)) - min_y;
|
2002-03-03 02:40:07 -08:00
|
|
|
|
2001-08-05 05:48:18 -07:00
|
|
|
if (sx < v->size.w - v->spacing.window.r - max_x)
|
2002-03-03 02:40:07 -08:00
|
|
|
sx = v->size.w - v->spacing.window.r - max_x;
|
2001-08-05 05:48:18 -07:00
|
|
|
if (sx > v->spacing.window.l - min_x)
|
2002-03-03 02:40:07 -08:00
|
|
|
sx = v->spacing.window.l - min_x;
|
2001-08-05 05:48:18 -07:00
|
|
|
if (sy < v->size.h - v->spacing.window.b - max_y)
|
2002-03-03 02:40:07 -08:00
|
|
|
sy = v->size.h - v->spacing.window.b - max_y;
|
2001-08-05 05:48:18 -07:00
|
|
|
if (sy > v->spacing.window.t - min_y)
|
2002-03-03 02:40:07 -08:00
|
|
|
sy = v->spacing.window.t - min_y;
|
2002-01-06 02:22:31 -08:00
|
|
|
|
2002-03-03 02:40:07 -08:00
|
|
|
if ((sx == v->scroll.x) && (v->scroll.y == sy))
|
|
|
|
D_RETURN;
|
2001-08-05 05:48:18 -07:00
|
|
|
v->scroll.x = sx;
|
|
|
|
v->scroll.y = sy;
|
|
|
|
e_view_icons_apply_xy(v);
|
2002-03-03 02:40:07 -08:00
|
|
|
if (v->bg)
|
|
|
|
e_bg_set_scroll(v->bg, v->scroll.x, v->scroll.y);
|
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-08-05 05:48:18 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2002-03-03 02:40:07 -08:00
|
|
|
e_view_get_viewable_percentage(E_View * v, double *vw, double *vh)
|
2001-08-05 05:48:18 -07:00
|
|
|
{
|
2002-03-03 02:40:07 -08:00
|
|
|
int min_x, min_y, max_x, max_y;
|
|
|
|
double p;
|
|
|
|
|
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;
|
2002-03-03 02:40:07 -08:00
|
|
|
|
2001-08-05 05:48:18 -07:00
|
|
|
e_view_icons_get_extents(v, &min_x, &min_y, &max_x, &max_y);
|
|
|
|
if (min_x == max_x)
|
|
|
|
{
|
2002-03-03 02:40:07 -08:00
|
|
|
if (vw)
|
|
|
|
*vw = 0;
|
2001-08-05 05:48:18 -07:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
p = ((double)(v->size.w - v->spacing.window.l - v->spacing.window.r)) /
|
2002-03-03 02:40:07 -08:00
|
|
|
((double)(max_x - min_x));
|
|
|
|
if (vw)
|
|
|
|
*vw = p;
|
2001-08-05 05:48:18 -07:00
|
|
|
}
|
|
|
|
if (min_y == max_y)
|
|
|
|
{
|
2002-03-03 02:40:07 -08:00
|
|
|
if (vh)
|
|
|
|
*vh = 0;
|
2001-08-05 05:48:18 -07:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
p = ((double)(v->size.h - v->spacing.window.t - v->spacing.window.b)) /
|
2002-03-03 02:40:07 -08:00
|
|
|
((double)(max_y - min_y));
|
|
|
|
if (vh)
|
|
|
|
*vh = p;
|
2001-08-05 05:48:18 -07: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_RETURN;
|
2001-08-05 05:48:18 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2002-03-03 02:40:07 -08:00
|
|
|
e_view_get_position_percentage(E_View * v, double *vx, double *vy)
|
2001-08-05 05:48:18 -07:00
|
|
|
{
|
2002-03-03 02:40:07 -08:00
|
|
|
int min_x, min_y, max_x, max_y;
|
|
|
|
double p;
|
|
|
|
|
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;
|
2002-03-03 02:40:07 -08:00
|
|
|
|
2001-08-05 05:48:18 -07:00
|
|
|
e_view_icons_get_extents(v, &min_x, &min_y, &max_x, &max_y);
|
|
|
|
if (min_x == max_x)
|
|
|
|
{
|
2002-03-03 02:40:07 -08:00
|
|
|
if (vx)
|
|
|
|
*vx = 0;
|
2001-08-05 05:48:18 -07:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
p = ((double)(v->scroll.x - min_x)) / ((double)(max_x - min_x));
|
2002-03-03 02:40:07 -08:00
|
|
|
if (vx)
|
|
|
|
*vx = p;
|
2001-08-05 05:48:18 -07:00
|
|
|
}
|
|
|
|
if (min_y == max_y)
|
|
|
|
{
|
2002-03-03 02:40:07 -08:00
|
|
|
if (vy)
|
|
|
|
*vy = 0;
|
2001-08-05 05:48:18 -07:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
p = ((double)(v->scroll.y - min_y)) / ((double)(max_y - min_y));
|
2002-03-03 02:40:07 -08:00
|
|
|
if (vy)
|
|
|
|
*vy = p;
|
2001-08-05 05:48:18 -07: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_RETURN;
|
2001-08-05 05:48:18 -07:00
|
|
|
}
|
|
|
|
|
2001-02-06 00:23:36 -08:00
|
|
|
static void
|
2001-11-01 15:54:48 -08:00
|
|
|
e_idle(void *data)
|
2001-02-06 00:23:36 -08:00
|
|
|
{
|
2003-01-15 10:29:56 -08:00
|
|
|
Evas_List * l;
|
2001-02-12 10:58:51 -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;
|
2002-03-03 02:40:07 -08:00
|
|
|
|
2002-02-25 10:09:13 -08:00
|
|
|
for (l = VM->views; l; l = l->next)
|
2001-02-06 00:23:36 -08:00
|
|
|
{
|
2002-03-03 02:40:07 -08:00
|
|
|
E_View *v;
|
2002-02-25 10:09:13 -08:00
|
|
|
|
2001-02-06 00:23:36 -08:00
|
|
|
v = l->data;
|
2001-02-08 14:11:30 -08:00
|
|
|
e_view_update(v);
|
2001-02-06 00:23:36 -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_RETURN;
|
2001-02-08 14:11:30 -08:00
|
|
|
UN(data);
|
2001-02-06 00:23:36 -08:00
|
|
|
}
|
|
|
|
|
2001-08-01 16:14:06 -07:00
|
|
|
void
|
2002-03-03 02:40:07 -08:00
|
|
|
e_view_geometry_record(E_View * v)
|
2001-08-01 16:14:06 -07: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;
|
2002-03-03 02:40:07 -08:00
|
|
|
|
2001-08-01 16:14:06 -07:00
|
|
|
if (e_fs_get_connection())
|
|
|
|
{
|
2002-03-03 02:40:07 -08:00
|
|
|
int left, top;
|
|
|
|
|
2001-11-19 23:01:53 -08:00
|
|
|
D("Record geom for view\n");
|
2002-03-03 02:40:07 -08:00
|
|
|
ecore_window_get_frame_size(v->win.base, &left, NULL, &top, NULL);
|
2001-08-01 16:14:06 -07:00
|
|
|
efsd_set_metadata_int(e_fs_get_connection(),
|
2002-03-06 12:44:48 -08:00
|
|
|
"/view/x", v->dir->dir, v->location.x - left);
|
2001-08-01 16:14:06 -07:00
|
|
|
efsd_set_metadata_int(e_fs_get_connection(),
|
2002-03-06 12:44:48 -08:00
|
|
|
"/view/y", v->dir->dir, v->location.y - top);
|
2001-08-01 16:14:06 -07:00
|
|
|
efsd_set_metadata_int(e_fs_get_connection(),
|
2002-03-06 12:44:48 -08:00
|
|
|
"/view/w", v->dir->dir, v->size.w);
|
2001-08-01 16:14:06 -07:00
|
|
|
efsd_set_metadata_int(e_fs_get_connection(),
|
2002-03-06 12:44:48 -08:00
|
|
|
"/view/h", v->dir->dir, v->size.h);
|
2001-08-01 16:14:06 -07: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_RETURN;
|
2001-08-01 16:14:06 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
e_view_geometry_record_timeout(int val, void *data)
|
|
|
|
{
|
2002-03-03 02:40:07 -08:00
|
|
|
E_View *v;
|
|
|
|
|
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;
|
2002-03-03 02:40:07 -08:00
|
|
|
|
2001-08-01 16:14:06 -07:00
|
|
|
v = data;
|
|
|
|
e_view_geometry_record(v);
|
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-08-01 16:14:06 -07:00
|
|
|
UN(val);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2002-03-03 02:40:07 -08:00
|
|
|
e_view_queue_geometry_record(E_View * v)
|
2001-08-01 16:14:06 -07:00
|
|
|
{
|
2002-03-03 02:40:07 -08:00
|
|
|
char name[PATH_MAX];
|
|
|
|
|
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;
|
2002-03-03 02:40:07 -08:00
|
|
|
|
2002-03-06 12:44:48 -08:00
|
|
|
snprintf(name, PATH_MAX, "geometry_record.%s", v->dir->dir);
|
2001-10-17 15:34:27 -07:00
|
|
|
ecore_add_event_timer(name, 0.10, e_view_geometry_record_timeout, 0, v);
|
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-08-01 16:14:06 -07:00
|
|
|
}
|
|
|
|
|
2001-09-30 22:23:42 -07:00
|
|
|
void
|
2002-03-03 02:40:07 -08:00
|
|
|
e_view_queue_icon_xy_record(E_View * v)
|
2001-09-30 22:23:42 -07:00
|
|
|
{
|
2002-03-03 02:40:07 -08:00
|
|
|
char name[PATH_MAX];
|
|
|
|
|
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;
|
2002-03-03 02:40:07 -08:00
|
|
|
|
2002-03-06 12:44:48 -08:00
|
|
|
snprintf(name, PATH_MAX, "icon_xy_record.%s", v->dir->dir);
|
2001-10-17 15:34:27 -07:00
|
|
|
ecore_add_event_timer(name, 0.10, e_view_write_icon_xy_timeout, 0, v);
|
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-09-30 22:23:42 -07:00
|
|
|
}
|
|
|
|
|
2001-08-01 16:14:06 -07:00
|
|
|
static void
|
2001-10-17 15:34:27 -07:00
|
|
|
e_configure(Ecore_Event * ev)
|
2001-07-12 18:22:10 -07:00
|
|
|
{
|
2001-10-17 15:34:27 -07:00
|
|
|
Ecore_Event_Window_Configure *e;
|
2002-03-06 12:59:16 -08:00
|
|
|
E_View *v;
|
2002-03-03 02:40:07 -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;
|
2002-03-03 02:40:07 -08:00
|
|
|
|
2001-07-12 18:22:10 -07:00
|
|
|
e = ev->event;
|
2002-03-10 09:23:43 -08:00
|
|
|
if (!e || !e->win)
|
|
|
|
D_RETURN;
|
|
|
|
v = e_view_machine_get_view_by_base_window(e->win);
|
|
|
|
if (!v)
|
|
|
|
D_RETURN;
|
|
|
|
/* win, root, x, y, w, h, wm_generated */
|
|
|
|
D("Configure for view: %s\n", v->name);
|
|
|
|
if (e->wm_generated)
|
|
|
|
{
|
|
|
|
D("wm generated %i %i, %ix%i\n", e->x, e->y, e->w, e->h);
|
|
|
|
if ((e->x != v->location.x) || (e->y != v->location.y))
|
|
|
|
{
|
|
|
|
D("new spot!\n");
|
|
|
|
v->location.x = e->x;
|
|
|
|
v->location.y = e->y;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
D("size %ix%i\n", e->w, e->h);
|
|
|
|
if ((e->w != v->size.w) || (e->h != v->size.h) || (v->size.force))
|
|
|
|
{
|
|
|
|
v->size.force = 0;
|
|
|
|
D("... a new size!\n");
|
|
|
|
v->size.w = e->w;
|
|
|
|
v->size.h = e->h;
|
|
|
|
if (v->pmap)
|
|
|
|
ecore_pixmap_free(v->pmap);
|
|
|
|
v->pmap = 0;
|
|
|
|
ecore_window_resize(v->win.main, v->size.w, v->size.h);
|
|
|
|
if (v->options.back_pixmap)
|
|
|
|
{
|
2003-01-15 10:29:56 -08:00
|
|
|
Evas_Engine_Info_Software_X11 *info;
|
|
|
|
|
2002-03-10 09:23:43 -08:00
|
|
|
v->pmap =
|
|
|
|
ecore_pixmap_new(v->win.main, v->size.w, v->size.h,
|
|
|
|
0);
|
2003-01-15 10:29:56 -08:00
|
|
|
info = (Evas_Engine_Info_Software_X11 *)evas_engine_info_get(v->evas);
|
|
|
|
info->info.drawable = v->pmap;
|
|
|
|
evas_engine_info_set(v->evas, (Evas_Engine_Info *)info);
|
2002-03-10 09:23:43 -08:00
|
|
|
ecore_window_set_background_pixmap(v->win.main, v->pmap);
|
|
|
|
ecore_window_clear(v->win.main);
|
|
|
|
}
|
|
|
|
if (v->bg)
|
|
|
|
e_bg_resize(v->bg, v->size.w, v->size.h);
|
|
|
|
D("evas_set_output_viewpor(%p)\n", v->evas);
|
2003-01-15 10:29:56 -08:00
|
|
|
evas_output_viewport_set(v->evas, 0, 0, v->size.w, v->size.h);
|
|
|
|
evas_output_size_set(v->evas, v->size.w, v->size.h);
|
2002-03-10 09:23:43 -08:00
|
|
|
e_view_scroll_to(v, v->scroll.x, v->scroll.y);
|
|
|
|
e_view_arrange(v);
|
|
|
|
e_view_layout_update(v->layout);
|
|
|
|
}
|
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-07-12 18:22:10 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2001-10-17 15:34:27 -07:00
|
|
|
e_property(Ecore_Event * ev)
|
2001-07-12 18:22:10 -07:00
|
|
|
{
|
2001-10-17 15:34:27 -07:00
|
|
|
Ecore_Event_Window_Configure *e;
|
2002-03-06 12:59:16 -08:00
|
|
|
E_View *v;
|
2002-03-01 12:50:46 -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;
|
2002-03-04 14:00:16 -08:00
|
|
|
|
2001-07-12 18:22:10 -07:00
|
|
|
e = ev->event;
|
2002-03-04 15:57:56 -08:00
|
|
|
if (e && e->win)
|
2002-03-03 02:40:07 -08:00
|
|
|
{
|
2002-03-06 12:59:16 -08:00
|
|
|
if ((v = e_view_machine_get_view_by_base_window(e->win)))
|
|
|
|
{
|
|
|
|
}
|
2002-03-03 02:40:07 -08:00
|
|
|
}
|
2002-03-04 14:00:16 -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_RETURN;
|
2001-07-12 18:22:10 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2001-10-17 15:34:27 -07:00
|
|
|
e_unmap(Ecore_Event * ev)
|
2001-07-12 18:22:10 -07:00
|
|
|
{
|
2001-10-17 15:34:27 -07:00
|
|
|
Ecore_Event_Window_Unmap *e;
|
2002-03-06 12:59:16 -08:00
|
|
|
E_View *v;
|
2002-03-01 12:50:46 -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;
|
2002-03-04 14:00:16 -08:00
|
|
|
|
2001-07-12 18:22:10 -07:00
|
|
|
e = ev->event;
|
2002-03-04 15:57:56 -08:00
|
|
|
if (e && e->win)
|
2002-03-03 02:40:07 -08:00
|
|
|
{
|
2002-03-06 12:59:16 -08:00
|
|
|
if ((v = e_view_machine_get_view_by_base_window(e->win)))
|
|
|
|
{
|
2002-03-03 02:40:07 -08:00
|
|
|
}
|
|
|
|
}
|
2002-03-04 14:00:16 -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_RETURN;
|
2001-07-12 18:22:10 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2001-10-17 15:34:27 -07:00
|
|
|
e_visibility(Ecore_Event * ev)
|
2001-07-12 18:22:10 -07:00
|
|
|
{
|
2001-10-17 15:34:27 -07:00
|
|
|
Ecore_Event_Window_Unmap *e;
|
2002-03-06 12:59:16 -08:00
|
|
|
E_View *v;
|
2002-03-01 12:50:46 -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;
|
2002-03-04 14:00:16 -08:00
|
|
|
|
2001-07-12 18:22:10 -07:00
|
|
|
e = ev->event;
|
2002-03-04 15:57:56 -08:00
|
|
|
if (e && e->win)
|
2002-03-03 02:40:07 -08:00
|
|
|
{
|
2002-03-06 12:59:16 -08:00
|
|
|
if ((v = e_view_machine_get_view_by_base_window(e->win)))
|
2002-03-03 02:40:07 -08:00
|
|
|
{
|
|
|
|
}
|
|
|
|
}
|
2002-03-04 14:00:16 -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_RETURN;
|
2001-07-12 18:22:10 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2001-11-01 15:54:48 -08:00
|
|
|
e_focus_in(Ecore_Event * ev)
|
2001-07-12 18:22:10 -07:00
|
|
|
{
|
2001-10-17 15:34:27 -07:00
|
|
|
Ecore_Event_Window_Focus_In *e;
|
2002-03-06 12:59:16 -08:00
|
|
|
E_View *v;
|
2002-03-01 12:50:46 -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;
|
2002-03-04 14:00:16 -08:00
|
|
|
|
2001-07-12 18:22:10 -07:00
|
|
|
e = ev->event;
|
2002-03-04 15:57:56 -08:00
|
|
|
if (e && e->win)
|
2002-03-03 02:40:07 -08:00
|
|
|
{
|
2002-03-06 12:59:16 -08:00
|
|
|
if ((v = e_view_machine_get_view_by_base_window(e->win)))
|
2002-03-03 02:40:07 -08:00
|
|
|
{
|
|
|
|
}
|
|
|
|
}
|
2002-03-04 14:00:16 -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_RETURN;
|
2001-07-12 18:22:10 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2001-11-01 15:54:48 -08:00
|
|
|
e_focus_out(Ecore_Event * ev)
|
2001-07-12 18:22:10 -07:00
|
|
|
{
|
2001-10-17 15:34:27 -07:00
|
|
|
Ecore_Event_Window_Focus_Out *e;
|
2002-03-06 12:59:16 -08:00
|
|
|
E_View *v;
|
2002-03-01 12:50:46 -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;
|
2002-03-04 14:00:16 -08:00
|
|
|
|
2001-07-12 18:22:10 -07:00
|
|
|
e = ev->event;
|
2002-03-04 15:57:56 -08:00
|
|
|
if (e && e->win)
|
2002-03-03 02:40:07 -08:00
|
|
|
{
|
2002-03-06 12:59:16 -08:00
|
|
|
if ((v = e_view_machine_get_view_by_base_window(e->win)))
|
2002-03-03 02:40:07 -08:00
|
|
|
{
|
|
|
|
}
|
|
|
|
}
|
2002-03-04 14:00:16 -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_RETURN;
|
2001-07-12 18:22:10 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2001-10-17 15:34:27 -07:00
|
|
|
e_delete(Ecore_Event * ev)
|
2001-07-12 18:22:10 -07:00
|
|
|
{
|
2001-10-17 15:34:27 -07:00
|
|
|
Ecore_Event_Window_Delete *e;
|
2002-03-06 12:59:16 -08:00
|
|
|
E_View *v;
|
2002-03-01 12:50:46 -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;
|
2002-03-04 14:00:16 -08:00
|
|
|
|
2001-07-12 18:22:10 -07:00
|
|
|
e = ev->event;
|
2002-03-04 15:57:56 -08:00
|
|
|
if (e && e->win)
|
2002-03-03 02:40:07 -08:00
|
|
|
{
|
2002-03-06 12:59:16 -08:00
|
|
|
if ((v = e_view_machine_get_view_by_base_window(e->win)))
|
2002-03-03 02:40:07 -08:00
|
|
|
{
|
|
|
|
e_object_unref(E_OBJECT(v));
|
2002-03-04 14:00:16 -08:00
|
|
|
D_RETURN;
|
2002-03-03 02:40:07 -08:00
|
|
|
}
|
|
|
|
}
|
2002-03-04 14:00:16 -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_RETURN;
|
2001-07-12 18:22:10 -07:00
|
|
|
}
|
|
|
|
|
2001-12-05 18:50:17 -08:00
|
|
|
/*
|
|
|
|
* dnd status handler
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
static void
|
|
|
|
e_dnd_status(Ecore_Event * ev)
|
|
|
|
{
|
|
|
|
Ecore_Event_Dnd_Drop_Status *e;
|
2002-03-03 02:40:07 -08:00
|
|
|
|
2001-12-05 18:50:17 -08:00
|
|
|
/*
|
2002-03-04 14:00:16 -08:00
|
|
|
* typedef struct _ecore_event_dnd_drop_status
|
|
|
|
* {
|
|
|
|
* Window win, root, source_win;
|
|
|
|
* int x, y, w, h;
|
|
|
|
* int copy, link, move, private;
|
|
|
|
* int all_position_msgs;
|
|
|
|
* int ok;
|
|
|
|
* } Ecore_Event_Dnd_Drop_Status;
|
2002-03-03 02:40:07 -08:00
|
|
|
*/
|
2002-03-06 12:59:16 -08:00
|
|
|
E_View *v;
|
2002-03-01 12:50:46 -08:00
|
|
|
|
2001-12-05 18:50:17 -08:00
|
|
|
D_ENTER;
|
2002-03-04 14:00:16 -08:00
|
|
|
|
2001-12-05 18:50:17 -08:00
|
|
|
e = ev->event;
|
2002-03-04 15:57:56 -08:00
|
|
|
if (e && e->win)
|
2002-03-03 02:40:07 -08:00
|
|
|
{
|
2002-03-06 12:59:16 -08:00
|
|
|
if ((v = e_view_machine_get_view_by_base_window(e->win)))
|
2002-03-03 02:40:07 -08:00
|
|
|
{
|
|
|
|
if (dnd_pending_mode != E_DND_DELETED &&
|
|
|
|
dnd_pending_mode != E_DND_COPIED)
|
|
|
|
{
|
|
|
|
if (e->copy)
|
|
|
|
dnd_pending_mode = E_DND_COPY;
|
|
|
|
else if (e->move)
|
|
|
|
dnd_pending_mode = E_DND_MOVE;
|
|
|
|
else if (e->link)
|
|
|
|
dnd_pending_mode = E_DND_LINK;
|
|
|
|
else
|
|
|
|
dnd_pending_mode = E_DND_ASK;
|
|
|
|
}
|
2002-03-04 14:00:16 -08:00
|
|
|
|
2002-03-03 02:40:07 -08:00
|
|
|
ecore_window_dnd_ok(e->ok);
|
2002-03-04 14:00:16 -08:00
|
|
|
|
2002-03-03 02:40:07 -08:00
|
|
|
v->changed = 1;
|
|
|
|
v->drag.icon_hide = 1;
|
|
|
|
}
|
|
|
|
}
|
2002-03-04 14:00:16 -08:00
|
|
|
|
2001-12-05 18:50:17 -08:00
|
|
|
D_RETURN;
|
|
|
|
}
|
|
|
|
|
2002-03-03 02:40:07 -08:00
|
|
|
static void
|
2001-10-17 15:34:27 -07:00
|
|
|
e_wheel(Ecore_Event * ev)
|
2001-02-06 00:23:36 -08:00
|
|
|
{
|
2002-03-03 02:40:07 -08:00
|
|
|
Ecore_Event_Wheel *e;
|
2002-03-06 12:59:16 -08:00
|
|
|
E_View *v;
|
2002-03-01 12:50:46 -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;
|
2002-03-04 14:00:16 -08:00
|
|
|
|
2001-02-06 00:23:36 -08:00
|
|
|
e = ev->event;
|
2002-03-04 15:57:56 -08:00
|
|
|
if (e && e->win)
|
2002-03-03 02:40:07 -08:00
|
|
|
{
|
2002-03-06 12:59:16 -08:00
|
|
|
if ((v = e_view_machine_get_view_by_main_window(e->win)))
|
2002-03-03 02:40:07 -08:00
|
|
|
{
|
|
|
|
}
|
|
|
|
}
|
2002-03-04 14:00:16 -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_RETURN;
|
2001-02-06 00:23:36 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2001-11-01 15:54:48 -08:00
|
|
|
e_key_down(Ecore_Event * ev)
|
2001-02-06 00:23:36 -08:00
|
|
|
{
|
2002-03-03 02:40:07 -08:00
|
|
|
Ecore_Event_Key_Down *e;
|
2002-03-06 12:59:16 -08:00
|
|
|
E_View *v;
|
2002-03-01 12:50:46 -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;
|
2002-03-04 14:00:16 -08:00
|
|
|
|
2001-02-06 00:23:36 -08:00
|
|
|
e = ev->event;
|
2002-03-04 15:57:56 -08:00
|
|
|
if (e && e->win)
|
2002-03-03 02:40:07 -08:00
|
|
|
{
|
2002-03-06 12:59:16 -08:00
|
|
|
if ((v = e_view_machine_get_view_by_main_window(e->win))
|
|
|
|
|| (v = e_view_machine_get_view_by_base_window(e->win)))
|
2002-03-03 02:40:07 -08:00
|
|
|
{
|
|
|
|
if (!strcmp(e->key, "Up"))
|
|
|
|
{
|
|
|
|
e_scrollbar_set_value(v->scrollbar.v,
|
|
|
|
v->scrollbar.v->val - 8);
|
|
|
|
}
|
|
|
|
else if (!strcmp(e->key, "Down"))
|
|
|
|
{
|
|
|
|
e_scrollbar_set_value(v->scrollbar.v,
|
|
|
|
v->scrollbar.v->val + 8);
|
|
|
|
}
|
|
|
|
else if (!strcmp(e->key, "Left"))
|
|
|
|
{
|
|
|
|
e_scrollbar_set_value(v->scrollbar.h,
|
|
|
|
v->scrollbar.h->val - 8);
|
|
|
|
}
|
|
|
|
else if (!strcmp(e->key, "Right"))
|
|
|
|
{
|
|
|
|
e_scrollbar_set_value(v->scrollbar.h,
|
|
|
|
v->scrollbar.h->val + 8);
|
|
|
|
}
|
|
|
|
else if (!strcmp(e->key, "Escape"))
|
|
|
|
{
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
char *type;
|
|
|
|
|
|
|
|
type = ecore_keypress_translate_into_typeable(e);
|
|
|
|
if (type)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
}
|
2002-03-04 14:00:16 -08:00
|
|
|
D_RETURN;
|
2002-03-03 02:40:07 -08:00
|
|
|
}
|
|
|
|
}
|
2002-03-04 14:00:16 -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_RETURN;
|
2001-02-06 00:23:36 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2001-11-01 15:54:48 -08:00
|
|
|
e_key_up(Ecore_Event * ev)
|
2001-02-06 00:23:36 -08:00
|
|
|
{
|
2002-03-03 02:40:07 -08:00
|
|
|
Ecore_Event_Key_Up *e;
|
2002-03-06 12:59:16 -08:00
|
|
|
E_View *v;
|
2002-03-03 02:40:07 -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;
|
2002-03-04 14:00:16 -08:00
|
|
|
|
2001-02-06 00:23:36 -08:00
|
|
|
e = ev->event;
|
2002-03-04 15:57:56 -08:00
|
|
|
if (e && e->win)
|
2002-03-03 02:40:07 -08:00
|
|
|
{
|
2002-03-06 12:59:16 -08:00
|
|
|
if ((v = e_view_machine_get_view_by_base_window(e->win)))
|
2002-03-04 15:57:56 -08:00
|
|
|
{
|
|
|
|
}
|
2002-03-03 02:40:07 -08:00
|
|
|
}
|
2002-03-04 14:00:16 -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_RETURN;
|
2001-02-06 00:23:36 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2001-10-17 15:34:27 -07:00
|
|
|
e_mouse_down(Ecore_Event * ev)
|
2001-02-06 00:23:36 -08:00
|
|
|
{
|
2002-03-03 02:40:07 -08:00
|
|
|
Ecore_Event_Mouse_Down *e;
|
2002-03-06 12:59:16 -08:00
|
|
|
E_View *v;
|
2002-03-01 12:50:46 -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;
|
2002-03-04 14:00:16 -08:00
|
|
|
|
2001-02-06 00:23:36 -08:00
|
|
|
e = ev->event;
|
2001-02-17 18:56:37 -08:00
|
|
|
current_ev = ev;
|
2002-03-04 15:57:56 -08:00
|
|
|
if (e && e->win)
|
2002-03-03 02:40:07 -08:00
|
|
|
{
|
2002-03-06 12:59:16 -08:00
|
|
|
if ((v = e_view_machine_get_view_by_main_window(e->win)))
|
2002-03-03 02:40:07 -08:00
|
|
|
{
|
|
|
|
int focus_mode;
|
|
|
|
|
2003-01-15 10:29:56 -08:00
|
|
|
focus_mode = config_data->window->focus_mode;
|
2002-03-03 02:40:07 -08:00
|
|
|
if (focus_mode == 2)
|
|
|
|
ecore_focus_to_window(v->win.base);
|
2003-01-15 10:29:56 -08:00
|
|
|
evas_event_feed_mouse_down(v->evas, e->button);
|
2002-03-03 02:40:07 -08:00
|
|
|
current_ev = NULL;
|
|
|
|
D_RETURN;
|
|
|
|
}
|
|
|
|
}
|
2001-02-17 18:56:37 -08:00
|
|
|
current_ev = NULL;
|
2002-03-04 14:00:16 -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_RETURN;
|
2001-02-06 00:23:36 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2001-10-17 15:34:27 -07:00
|
|
|
e_mouse_up(Ecore_Event * ev)
|
2001-02-06 00:23:36 -08:00
|
|
|
{
|
2002-03-03 02:40:07 -08:00
|
|
|
Ecore_Event_Mouse_Up *e;
|
2002-03-06 12:59:16 -08:00
|
|
|
E_View *v;
|
2002-03-01 12:50:46 -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;
|
2002-03-04 14:00:16 -08:00
|
|
|
|
2001-02-06 00:23:36 -08:00
|
|
|
e = ev->event;
|
2001-02-17 18:56:37 -08:00
|
|
|
current_ev = ev;
|
2002-03-04 15:57:56 -08:00
|
|
|
if (e && e->win)
|
2002-03-03 02:40:07 -08:00
|
|
|
{
|
2002-03-06 12:59:16 -08:00
|
|
|
if ((v = e_view_machine_get_view_by_main_window(e->win)))
|
2002-03-03 02:40:07 -08:00
|
|
|
{
|
2003-01-15 10:29:56 -08:00
|
|
|
evas_event_feed_mouse_up(v->evas, e->button);
|
2002-03-04 14:00:16 -08:00
|
|
|
current_ev = NULL;
|
|
|
|
D_RETURN;
|
2002-03-03 02:40:07 -08:00
|
|
|
}
|
|
|
|
}
|
2001-02-17 18:56:37 -08:00
|
|
|
current_ev = NULL;
|
2002-03-04 14:00:16 -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_RETURN;
|
2001-02-06 00:23:36 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2001-10-17 15:34:27 -07:00
|
|
|
e_mouse_move(Ecore_Event * ev)
|
2001-02-06 00:23:36 -08:00
|
|
|
{
|
2002-03-03 02:40:07 -08:00
|
|
|
Ecore_Event_Mouse_Move *e;
|
2002-03-06 12:59:16 -08:00
|
|
|
E_View *v;
|
2002-03-01 12:50:46 -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;
|
2002-03-04 14:00:16 -08:00
|
|
|
|
2001-02-06 00:23:36 -08:00
|
|
|
e = ev->event;
|
2001-07-12 09:40:13 -07:00
|
|
|
current_ev = ev;
|
2002-03-04 15:57:56 -08:00
|
|
|
if (e && e->win)
|
2002-03-03 02:40:07 -08:00
|
|
|
{
|
2002-03-06 12:59:16 -08:00
|
|
|
if ((v = e_view_machine_get_view_by_main_window(e->win)))
|
2002-03-03 02:40:07 -08:00
|
|
|
{
|
2003-01-15 10:29:56 -08:00
|
|
|
evas_event_feed_mouse_move(v->evas, e->x, e->y);
|
2002-03-04 14:00:16 -08:00
|
|
|
current_ev = NULL;
|
|
|
|
D_RETURN;
|
2002-03-03 02:40:07 -08:00
|
|
|
}
|
|
|
|
}
|
2001-07-12 09:40:13 -07:00
|
|
|
current_ev = NULL;
|
2002-03-04 14:00:16 -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_RETURN;
|
2001-02-06 00:23:36 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2001-10-17 15:34:27 -07:00
|
|
|
e_mouse_in(Ecore_Event * ev)
|
2001-02-06 00:23:36 -08:00
|
|
|
{
|
2002-03-03 02:40:07 -08:00
|
|
|
Ecore_Event_Window_Enter *e;
|
2002-03-06 12:59:16 -08:00
|
|
|
E_View *v;
|
2002-03-03 02:40:07 -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;
|
2002-03-04 14:00:16 -08:00
|
|
|
|
2001-02-06 00:23:36 -08:00
|
|
|
e = ev->event;
|
2001-09-24 14:21:25 -07:00
|
|
|
current_ev = ev;
|
2002-03-04 15:57:56 -08:00
|
|
|
if (e && e->win)
|
2002-03-03 02:40:07 -08:00
|
|
|
{
|
2002-03-06 12:59:16 -08:00
|
|
|
if ((v = e_view_machine_get_view_by_main_window(e->win)))
|
2002-03-03 02:40:07 -08:00
|
|
|
{
|
2002-03-10 09:23:43 -08:00
|
|
|
if (v->is_desktop)
|
2002-03-03 02:40:07 -08:00
|
|
|
{
|
2003-01-15 10:29:56 -08:00
|
|
|
evas_event_feed_mouse_in(v->evas);
|
2002-03-03 02:40:07 -08:00
|
|
|
}
|
2002-03-04 14:00:16 -08:00
|
|
|
current_ev = NULL;
|
|
|
|
D_RETURN;
|
2002-03-03 02:40:07 -08:00
|
|
|
}
|
|
|
|
}
|
2001-09-24 14:21:25 -07:00
|
|
|
current_ev = NULL;
|
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-02-06 00:23:36 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2001-10-17 15:34:27 -07:00
|
|
|
e_mouse_out(Ecore_Event * ev)
|
2001-02-06 00:23:36 -08:00
|
|
|
{
|
2002-03-03 02:40:07 -08:00
|
|
|
Ecore_Event_Window_Leave *e;
|
2002-03-06 12:59:16 -08:00
|
|
|
E_View *v;
|
2002-03-03 02:40:07 -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;
|
2002-03-04 14:00:16 -08:00
|
|
|
|
2001-02-06 00:23:36 -08:00
|
|
|
e = ev->event;
|
2001-09-24 14:21:25 -07:00
|
|
|
current_ev = ev;
|
2002-03-04 15:57:56 -08:00
|
|
|
if (e && e->win)
|
2002-03-03 02:40:07 -08:00
|
|
|
{
|
2002-03-06 12:59:16 -08:00
|
|
|
if ((v = e_view_machine_get_view_by_main_window(e->win)))
|
2002-03-03 02:40:07 -08:00
|
|
|
{
|
2003-01-15 10:29:56 -08:00
|
|
|
evas_event_feed_mouse_out(v->evas);
|
2002-03-04 14:00:16 -08:00
|
|
|
current_ev = NULL;
|
|
|
|
D_RETURN;
|
2002-03-03 02:40:07 -08:00
|
|
|
}
|
|
|
|
}
|
2001-09-24 14:21:25 -07:00
|
|
|
current_ev = NULL;
|
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-02-06 00:23:36 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2001-11-01 15:54:48 -08:00
|
|
|
e_window_expose(Ecore_Event * ev)
|
2001-02-06 00:23:36 -08:00
|
|
|
{
|
2002-03-03 02:40:07 -08:00
|
|
|
Ecore_Event_Window_Expose *e;
|
2002-03-06 12:59:16 -08:00
|
|
|
E_View *v;
|
2002-03-01 12:50:46 -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;
|
2002-03-04 14:00:16 -08:00
|
|
|
|
2001-02-06 00:23:36 -08:00
|
|
|
e = ev->event;
|
2002-03-04 15:57:56 -08:00
|
|
|
current_ev = ev;
|
|
|
|
if (e && e->win)
|
2002-03-03 02:40:07 -08:00
|
|
|
{
|
2002-03-06 12:59:16 -08:00
|
|
|
if ((v = e_view_machine_get_view_by_main_window(e->win)))
|
2002-03-03 02:40:07 -08:00
|
|
|
{
|
|
|
|
if (!(v->pmap))
|
2003-01-15 10:29:56 -08:00
|
|
|
evas_damage_rectangle_add(v->evas, e->x, e->y, e->w, e->h);
|
2002-03-03 02:40:07 -08:00
|
|
|
v->changed = 1;
|
2002-03-04 14:00:16 -08:00
|
|
|
D_RETURN;
|
2002-03-03 02:40:07 -08:00
|
|
|
}
|
|
|
|
}
|
2002-03-04 14:00:16 -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_RETURN;
|
2001-02-06 00:23:36 -08:00
|
|
|
}
|
|
|
|
|
2002-03-03 02:40:07 -08:00
|
|
|
Ecore_Event *
|
2001-03-31 15:50:22 -08:00
|
|
|
e_view_get_current_event(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;
|
2002-03-03 02:40:07 -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_RETURN_(current_ev);
|
2001-03-31 15:50:22 -08:00
|
|
|
}
|
|
|
|
|
2001-02-12 10:58:51 -08:00
|
|
|
int
|
2002-03-03 02:40:07 -08:00
|
|
|
e_view_filter_file(E_View * v, char *file)
|
2001-02-12 10:58:51 -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;
|
2002-03-03 02:40:07 -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
|
|
|
if (file[0] == '.')
|
2002-03-03 02:40:07 -08:00
|
|
|
D_RETURN_(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_(1);
|
2001-07-30 18:12:02 -07:00
|
|
|
UN(v);
|
2001-02-12 10:58:51 -08:00
|
|
|
}
|
|
|
|
|
2001-07-12 09:40:13 -07:00
|
|
|
static int
|
2001-07-30 09:59:37 -07:00
|
|
|
e_view_restart_alphabetical_qsort_cb(const void *data1, const void *data2)
|
2001-07-12 09:40:13 -07:00
|
|
|
{
|
2002-03-03 02:40:07 -08:00
|
|
|
E_Icon *ic, *ic2;
|
|
|
|
|
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;
|
2002-03-03 02:40:07 -08:00
|
|
|
|
|
|
|
ic = *((E_Icon **) data1);
|
|
|
|
ic2 = *((E_Icon **) data2);
|
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
|
|
|
|
2002-02-25 10:09:13 -08:00
|
|
|
D_RETURN_(strcmp(ic->file->file, ic2->file->file));
|
2001-07-12 09:40:13 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2002-03-03 02:40:07 -08:00
|
|
|
e_view_resort_alphabetical(E_View * v)
|
2001-07-12 09:40:13 -07:00
|
|
|
{
|
2003-01-15 10:29:56 -08:00
|
|
|
Evas_List *icons = NULL, *l;
|
2002-03-03 02:40:07 -08:00
|
|
|
E_Icon **array;
|
|
|
|
int i, count;
|
|
|
|
|
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;
|
2002-03-03 02:40:07 -08:00
|
|
|
|
|
|
|
if (!v->icons)
|
|
|
|
D_RETURN;
|
|
|
|
for (count = 0, l = v->icons; l; l = l->next)
|
|
|
|
count++;
|
2001-07-12 09:40:13 -07:00
|
|
|
array = malloc(sizeof(E_Icon *) * count);
|
2002-03-03 02:40:07 -08:00
|
|
|
for (i = 0, l = v->icons; l; l = l->next)
|
|
|
|
array[i++] = l->data;
|
2001-11-03 01:07:40 -08:00
|
|
|
D("qsort %i elements...\n", count);
|
2002-03-03 02:40:07 -08:00
|
|
|
qsort(array, count, sizeof(E_Icon *), e_view_restart_alphabetical_qsort_cb);
|
|
|
|
for (i = 0; i < count; i++)
|
|
|
|
icons = evas_list_append(icons, array[i]);
|
2002-03-11 12:03:14 -08:00
|
|
|
FREE(array);
|
2002-03-03 02:40:07 -08:00
|
|
|
|
2001-07-12 09:40:13 -07:00
|
|
|
evas_list_free(v->icons);
|
|
|
|
v->icons = icons;
|
2002-03-03 02:40:07 -08:00
|
|
|
|
2001-11-03 01:07:40 -08:00
|
|
|
D("done...\n");
|
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-07-12 09:40:13 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2002-03-03 02:40:07 -08:00
|
|
|
e_view_arrange(E_View * v)
|
2001-07-12 09:40:13 -07:00
|
|
|
{
|
2003-01-15 10:29:56 -08:00
|
|
|
Evas_List * l;
|
2002-03-03 02:40:07 -08:00
|
|
|
int x, y;
|
|
|
|
int x1, x2, y1, y2;
|
|
|
|
double sv, sr, sm;
|
|
|
|
|
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;
|
2002-02-25 10:09:13 -08:00
|
|
|
|
2001-07-12 09:40:13 -07:00
|
|
|
x = v->spacing.window.l;
|
|
|
|
y = v->spacing.window.t;
|
2002-01-06 02:22:31 -08:00
|
|
|
|
2001-07-12 09:40:13 -07:00
|
|
|
for (l = v->icons; l; l = l->next)
|
|
|
|
{
|
2002-03-03 02:40:07 -08:00
|
|
|
E_Icon *ic;
|
|
|
|
|
2001-07-12 09:40:13 -07:00
|
|
|
ic = l->data;
|
2002-03-03 02:40:07 -08:00
|
|
|
if ((x != v->spacing.window.l) &&
|
2001-08-16 01:45:37 -07:00
|
|
|
((x + ic->geom.w) > v->size.w - v->spacing.window.r))
|
2001-07-12 09:40:13 -07:00
|
|
|
{
|
|
|
|
x = v->spacing.window.l;
|
|
|
|
y += ic->geom.h + v->spacing.icon.b;
|
|
|
|
}
|
|
|
|
ic->geom.x = x;
|
|
|
|
ic->geom.y = y;
|
2001-11-03 06:55:21 -08:00
|
|
|
e_icon_apply_xy(ic);
|
2001-07-12 09:40:13 -07:00
|
|
|
x += ic->geom.w + v->spacing.icon.s;
|
|
|
|
}
|
2002-03-03 02:40:07 -08:00
|
|
|
|
2001-08-12 23:35:14 -07:00
|
|
|
e_view_icons_get_extents(v, &x1, &y1, &x2, &y2);
|
|
|
|
|
2002-03-03 02:40:07 -08:00
|
|
|
sv = -(v->scroll.y - v->spacing.window.t);
|
2001-08-12 23:35:14 -07:00
|
|
|
sr = v->size.h - v->spacing.window.t - v->spacing.window.b;
|
|
|
|
sm = y2 - y1;
|
2002-03-03 02:40:07 -08:00
|
|
|
if (sr > sm)
|
|
|
|
sr = sm;
|
2001-08-12 23:35:14 -07:00
|
|
|
e_scrollbar_set_range(v->scrollbar.v, sr);
|
2002-03-03 02:40:07 -08:00
|
|
|
e_scrollbar_set_max(v->scrollbar.v, sm);
|
2002-02-23 22:48:14 -08:00
|
|
|
e_scrollbar_set_value(v->scrollbar.v, sv);
|
2002-03-03 02:40:07 -08:00
|
|
|
if (sr < sm)
|
|
|
|
e_scrollbar_show(v->scrollbar.v);
|
|
|
|
else
|
|
|
|
e_scrollbar_hide(v->scrollbar.v);
|
2001-08-12 23:35:14 -07:00
|
|
|
|
2002-03-03 02:40:07 -08:00
|
|
|
sv = -(v->scroll.x - v->spacing.window.l);
|
2001-08-12 23:35:14 -07:00
|
|
|
sr = v->size.w - v->spacing.window.l - v->spacing.window.r;
|
|
|
|
sm = x2 - x1;
|
2002-03-03 02:40:07 -08:00
|
|
|
if (sr > sm)
|
|
|
|
sr = sm;
|
2001-08-12 23:35:14 -07:00
|
|
|
e_scrollbar_set_range(v->scrollbar.h, sr);
|
2002-03-03 02:40:07 -08:00
|
|
|
e_scrollbar_set_max(v->scrollbar.h, sm);
|
2002-02-23 22:48:14 -08:00
|
|
|
e_scrollbar_set_value(v->scrollbar.h, sv);
|
2002-03-03 02:40:07 -08:00
|
|
|
if (sr < sm)
|
|
|
|
e_scrollbar_show(v->scrollbar.h);
|
|
|
|
else
|
|
|
|
e_scrollbar_hide(v->scrollbar.h);
|
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
|
|
|
|
2002-02-26 13:12:45 -08:00
|
|
|
v->changed = 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;
|
2001-07-12 09:40:13 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2002-03-03 02:40:07 -08:00
|
|
|
e_view_resort(E_View * v)
|
2001-07-12 09:40:13 -07: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;
|
2002-03-03 02:40:07 -08:00
|
|
|
|
2001-07-12 09:40:13 -07:00
|
|
|
e_view_resort_alphabetical(v);
|
|
|
|
e_view_arrange(v);
|
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-07-12 09:40:13 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
e_view_resort_timeout(int val, void *data)
|
|
|
|
{
|
2002-03-03 02:40:07 -08:00
|
|
|
E_View *v;
|
|
|
|
|
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;
|
2002-03-03 02:40:07 -08:00
|
|
|
|
2001-07-12 09:40:13 -07:00
|
|
|
v = data;
|
|
|
|
e_view_resort(v);
|
|
|
|
v->have_resort_queued = 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-07-30 18:12:02 -07:00
|
|
|
UN(val);
|
2001-07-12 09:40:13 -07:00
|
|
|
}
|
|
|
|
|
2002-03-10 09:23:43 -08:00
|
|
|
static void
|
|
|
|
e_view_layout_reload_timeout(int val, void *data)
|
|
|
|
{
|
|
|
|
E_View *v;
|
|
|
|
D_ENTER;
|
|
|
|
v = data;
|
|
|
|
e_view_layout_reload(v);
|
|
|
|
D_RETURN;
|
|
|
|
UN(val);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
e_view_bg_reload_timeout(int val, void *data)
|
|
|
|
{
|
|
|
|
E_View *v;
|
|
|
|
D_ENTER;
|
|
|
|
v = data;
|
|
|
|
e_view_bg_reload(v);
|
|
|
|
D_RETURN;
|
|
|
|
UN(val);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
e_view_ib_reload_timeout(int val, void *data)
|
|
|
|
{
|
|
|
|
E_View *v;
|
|
|
|
D_ENTER;
|
|
|
|
v = data;
|
|
|
|
e_view_ib_reload(v);
|
|
|
|
D_RETURN;
|
|
|
|
UN(val);
|
|
|
|
}
|
|
|
|
|
2001-07-12 09:40:13 -07:00
|
|
|
void
|
2002-03-03 02:40:07 -08:00
|
|
|
e_view_queue_resort(E_View * v)
|
2001-07-12 09:40:13 -07:00
|
|
|
{
|
2002-03-03 02:40:07 -08:00
|
|
|
char name[PATH_MAX];
|
|
|
|
|
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;
|
2002-03-03 02:40:07 -08:00
|
|
|
|
|
|
|
if (v->have_resort_queued)
|
|
|
|
D_RETURN;
|
2001-07-12 09:40:13 -07:00
|
|
|
v->have_resort_queued = 1;
|
2002-02-25 10:09:13 -08:00
|
|
|
snprintf(name, PATH_MAX, "resort_timer.%s", v->name);
|
2001-10-17 15:34:27 -07:00
|
|
|
ecore_add_event_timer(name, 1.0, e_view_resort_timeout, 0, v);
|
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-07-12 09:40:13 -07: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
|
|
|
static void
|
2002-03-03 02:40:07 -08:00
|
|
|
e_view_cleanup(E_View * v)
|
2000-12-27 14:42:59 -08:00
|
|
|
{
|
2002-03-03 02:40:07 -08:00
|
|
|
char name[PATH_MAX];
|
|
|
|
|
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;
|
2002-02-25 10:09:13 -08:00
|
|
|
/* write geometry to metadata. This is done directly and
|
|
|
|
* not via a timeout, because we will destroy the object after this.*/
|
|
|
|
e_view_geometry_record(v);
|
2002-03-03 02:40:07 -08:00
|
|
|
|
2002-03-04 15:57:56 -08:00
|
|
|
if (v->bg)
|
2002-03-06 12:59:16 -08:00
|
|
|
e_bg_free(v->bg);
|
2002-03-03 02:40:07 -08:00
|
|
|
if (v->scrollbar.h)
|
|
|
|
e_object_unref(E_OBJECT(v->scrollbar.h));
|
|
|
|
if (v->scrollbar.v)
|
|
|
|
e_object_unref(E_OBJECT(v->scrollbar.v));
|
2002-03-04 15:57:56 -08:00
|
|
|
if (v->layout)
|
|
|
|
e_object_unref(E_OBJECT(v->layout));
|
|
|
|
|
2001-10-17 15:34:27 -07:00
|
|
|
ecore_window_destroy(v->win.base);
|
2002-03-03 02:40:07 -08:00
|
|
|
|
2002-02-25 10:09:13 -08:00
|
|
|
snprintf(name, PATH_MAX, "resort_timer.%s", v->name);
|
|
|
|
ecore_del_event_timer(name);
|
2001-11-03 02:59:17 -08:00
|
|
|
|
2002-03-06 12:44:48 -08:00
|
|
|
/* unregister with the underlying dir and the global list of views */
|
2002-03-10 09:23:43 -08:00
|
|
|
e_observer_unregister_observee(E_OBSERVER(v), E_OBSERVEE(v->dir));
|
|
|
|
e_object_unref(E_OBJECT(v->dir));
|
|
|
|
v->dir = NULL;
|
2002-03-04 15:57:56 -08:00
|
|
|
e_view_machine_unregister_view(v);
|
2002-02-25 10:09:13 -08:00
|
|
|
/* FIXME: clean up the rest!!! this leaks ... */
|
2002-03-03 02:40:07 -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
|
|
|
/* Call the destructor of the base class */
|
2002-03-11 09:35:51 -08:00
|
|
|
e_observer_cleanup(E_OBSERVER(v));
|
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-27 14:42:59 -08:00
|
|
|
}
|
|
|
|
|
2002-03-10 09:23:43 -08:00
|
|
|
void
|
|
|
|
e_view_file_event_handler(E_Observer *obs, E_Observee *o, E_Event_Type event, void *data)
|
|
|
|
{
|
|
|
|
E_View *v = (E_View *) obs;
|
|
|
|
E_File *f = (E_File *) data;
|
|
|
|
char buf[PATH_MAX];
|
|
|
|
|
|
|
|
D_ENTER;
|
|
|
|
|
|
|
|
if (event & E_EVENT_FILE_ADD)
|
|
|
|
e_view_file_add(v, f);
|
|
|
|
else if (event & E_EVENT_FILE_DELETE)
|
|
|
|
e_view_file_delete(v, f);
|
|
|
|
else if (event & E_EVENT_FILE_CHANGE)
|
|
|
|
e_view_file_changed(v, f);
|
|
|
|
else if (event & E_EVENT_FILE_INFO)
|
|
|
|
e_view_file_try_to_show(v, f);
|
|
|
|
else if (event & E_EVENT_BG_CHANGED)
|
|
|
|
{
|
|
|
|
snprintf(buf, PATH_MAX, "background_reload:%s", v->name);
|
2003-01-15 10:29:56 -08:00
|
|
|
e_view_bg_reload(v);
|
|
|
|
//ecore_add_event_timer(buf, 0.5, e_view_bg_reload_timeout, 0, v);
|
2002-03-10 09:23:43 -08:00
|
|
|
}
|
|
|
|
else if (event & E_EVENT_ICB_CHANGED)
|
|
|
|
{
|
|
|
|
snprintf(buf, PATH_MAX, "iconbar_reload:%s", v->name);
|
|
|
|
ecore_add_event_timer(buf, 0.5, e_view_ib_reload_timeout, 0, v);
|
|
|
|
}
|
|
|
|
else if (event & E_EVENT_LAYOUT_CHANGED)
|
|
|
|
{
|
|
|
|
snprintf(buf, PATH_MAX, "layout_reload:%s", v->name);
|
|
|
|
ecore_add_event_timer(buf, 0.5, e_view_layout_reload_timeout, 0, v);
|
|
|
|
}
|
|
|
|
|
|
|
|
D_RETURN;
|
|
|
|
UN(o);
|
|
|
|
}
|
|
|
|
|
2002-03-03 02:40:07 -08:00
|
|
|
E_View *
|
2000-12-18 13:28:44 -08:00
|
|
|
e_view_new(void)
|
|
|
|
{
|
2002-03-03 02:40:07 -08:00
|
|
|
E_View *v;
|
|
|
|
|
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;
|
2002-03-03 02:40:07 -08:00
|
|
|
|
2000-12-18 13:28:44 -08:00
|
|
|
v = NEW(E_View, 1);
|
|
|
|
ZERO(v, E_View, 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
|
|
|
|
2002-03-10 09:23:43 -08:00
|
|
|
e_observer_init(E_OBSERVER(v),
|
|
|
|
E_EVENT_FILE_ADD | E_EVENT_FILE_DELETE | E_EVENT_FILE_CHANGE
|
|
|
|
| E_EVENT_FILE_INFO | E_EVENT_BG_CHANGED | E_EVENT_ICB_CHANGED
|
|
|
|
| E_EVENT_LAYOUT_CHANGED ,
|
|
|
|
(E_Notify_Func) e_view_file_event_handler,
|
|
|
|
(E_Cleanup_Func) e_view_cleanup);
|
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
|
|
|
|
2002-03-10 09:23:43 -08:00
|
|
|
|
2001-03-04 19:04:33 -08:00
|
|
|
#define SOFT_DESK
|
2001-02-19 11:45:24 -08:00
|
|
|
/* #define X_DESK */
|
2001-03-04 19:04:33 -08:00
|
|
|
/* #define GL_DESK */
|
2002-03-03 02:40:07 -08:00
|
|
|
|
2001-02-19 11:45:24 -08:00
|
|
|
#ifdef SOFT_DESK
|
2001-02-12 10:58:51 -08:00
|
|
|
/* ONLY alpha software can be "backing stored" */
|
2003-01-15 10:29:56 -08:00
|
|
|
/*v->options.render_method = RENDER_METHOD_ALPHA_SOFTWARE;*/
|
|
|
|
v->options.back_pixmap = 0;
|
2001-02-12 10:58:51 -08:00
|
|
|
#else
|
2001-02-19 11:45:24 -08:00
|
|
|
#ifdef X_DESK
|
2003-01-15 10:29:56 -08:00
|
|
|
/*v->options.render_method = RENDER_METHOD_BASIC_HARDWARE;*/
|
2001-02-12 10:58:51 -08:00
|
|
|
v->options.back_pixmap = 0;
|
2001-02-19 11:45:24 -08:00
|
|
|
#else
|
2003-01-15 10:29:56 -08:00
|
|
|
/*v->options.render_method = RENDER_METHOD_3D_HARDWARE;*/
|
2001-02-19 11:45:24 -08:00
|
|
|
v->options.back_pixmap = 0;
|
2002-03-03 02:40:07 -08:00
|
|
|
#endif
|
2001-02-12 10:58:51 -08:00
|
|
|
#endif
|
2001-07-12 09:40:13 -07:00
|
|
|
v->select.config.grad_size.l = 8;
|
|
|
|
v->select.config.grad_size.r = 8;
|
|
|
|
v->select.config.grad_size.t = 8;
|
|
|
|
v->select.config.grad_size.b = 8;
|
|
|
|
#define SETCOL(_member, _r, _g, _b, _a) \
|
|
|
|
_member.r = _r; _member.g = _g; _member.b = _b; _member.a = _a;
|
|
|
|
SETCOL(v->select.config.edge_l, 0, 0, 0, 255);
|
|
|
|
SETCOL(v->select.config.edge_r, 0, 0, 0, 255);
|
|
|
|
SETCOL(v->select.config.edge_t, 0, 0, 0, 255);
|
|
|
|
SETCOL(v->select.config.edge_b, 0, 0, 0, 255);
|
|
|
|
SETCOL(v->select.config.middle, 255, 255, 255, 100);
|
|
|
|
SETCOL(v->select.config.grad_l, 255, 255, 255, 100);
|
|
|
|
SETCOL(v->select.config.grad_r, 255, 255, 255, 100);
|
|
|
|
SETCOL(v->select.config.grad_t, 255, 255, 255, 100);
|
|
|
|
SETCOL(v->select.config.grad_b, 255, 255, 255, 100);
|
2001-03-15 17:14:42 -08:00
|
|
|
|
2001-07-12 09:40:13 -07:00
|
|
|
v->spacing.window.l = 3;
|
2001-08-12 23:35:14 -07:00
|
|
|
v->spacing.window.r = 15;
|
2001-07-12 09:40:13 -07:00
|
|
|
v->spacing.window.t = 3;
|
2001-08-12 23:35:14 -07:00
|
|
|
v->spacing.window.b = 15;
|
2001-08-01 22:08:49 -07:00
|
|
|
v->spacing.icon.s = 7;
|
|
|
|
v->spacing.icon.g = 7;
|
|
|
|
v->spacing.icon.b = 7;
|
2002-01-04 21:01:08 -08:00
|
|
|
|
2002-02-25 10:09:13 -08:00
|
|
|
e_view_machine_register_view(v);
|
2002-03-03 02:40:07 -08:00
|
|
|
|
2002-03-10 09:23:43 -08:00
|
|
|
|
2002-03-03 02:40:07 -08:00
|
|
|
D_RETURN_(v);
|
2000-12-18 13:28:44 -08:00
|
|
|
}
|
|
|
|
|
2001-02-08 14:11:30 -08:00
|
|
|
void
|
2002-03-10 09:23:43 -08:00
|
|
|
e_view_set_look(E_View * v, char *path)
|
|
|
|
{
|
|
|
|
E_View_Look *l = NULL;
|
|
|
|
char buf[PATH_MAX];
|
|
|
|
D_ENTER;
|
|
|
|
|
|
|
|
if (v->look)
|
|
|
|
e_object_unref(E_OBJECT(v->look));
|
|
|
|
|
|
|
|
if(!path)
|
|
|
|
{
|
|
|
|
/*
|
|
|
|
* no path specified, lets look in the view's dir. If
|
|
|
|
* there is a e_layout dir there, use whats in there.
|
|
|
|
* Otherwise use the default dir.
|
|
|
|
*/
|
|
|
|
snprintf(buf, PATH_MAX, "%s/.e_layout", v->dir->dir);
|
|
|
|
if (e_file_exists(buf) && e_file_is_dir(buf))
|
|
|
|
path = buf;
|
|
|
|
else
|
|
|
|
{
|
|
|
|
snprintf(buf, PATH_MAX, "%s/appearance", e_config_user_dir());
|
|
|
|
path = buf;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if ( !(l=e_view_machine_look_lookup(path)) )
|
|
|
|
{
|
|
|
|
v->look = e_view_look_new();
|
|
|
|
e_view_look_set_dir (v->look, path);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
v->look = l;
|
|
|
|
e_object_ref(E_OBJECT(v->look));
|
|
|
|
}
|
|
|
|
if(v->look)
|
|
|
|
{
|
|
|
|
e_observer_register_observee(E_OBSERVER(v), E_OBSERVEE(v->look->obj));
|
|
|
|
|
|
|
|
e_view_bg_reload(v);
|
|
|
|
e_view_layout_reload(v);
|
|
|
|
e_view_ib_reload(v);
|
|
|
|
}
|
|
|
|
D_RETURN;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
e_view_set_dir(E_View * v, char *path)
|
2002-02-25 10:09:13 -08:00
|
|
|
{
|
2002-03-06 12:44:48 -08:00
|
|
|
E_Dir *d = NULL;
|
2002-03-03 02:40:07 -08:00
|
|
|
char buf[PATH_MAX];
|
2002-02-27 14:46:14 -08:00
|
|
|
|
2002-02-25 10:09:13 -08:00
|
|
|
D_ENTER;
|
2002-02-27 14:46:14 -08:00
|
|
|
|
|
|
|
if (!v || !path || *path == 0)
|
2002-03-03 02:40:07 -08:00
|
|
|
D_RETURN;
|
2002-02-27 14:46:14 -08:00
|
|
|
|
2002-03-06 12:44:48 -08:00
|
|
|
if (!(d = e_view_machine_dir_lookup(path)))
|
2002-03-03 02:40:07 -08:00
|
|
|
{
|
|
|
|
D("Model for this dir doesn't exist, make a new one\n");
|
2002-03-06 12:44:48 -08:00
|
|
|
d = e_dir_new();
|
|
|
|
e_dir_set_dir(d, path);
|
2002-03-03 02:40:07 -08:00
|
|
|
}
|
2002-03-10 09:23:43 -08:00
|
|
|
else
|
|
|
|
e_object_ref(E_OBJECT(d));
|
2002-02-27 14:46:14 -08:00
|
|
|
|
2002-03-06 12:44:48 -08:00
|
|
|
if (d)
|
2002-03-03 02:40:07 -08:00
|
|
|
{
|
2002-03-10 09:23:43 -08:00
|
|
|
v->dir = d;
|
|
|
|
e_observer_register_observee(E_OBSERVER(v), E_OBSERVEE(d));
|
2002-03-03 02:40:07 -08:00
|
|
|
/* FIXME do a real naming scheme here */
|
2002-03-10 09:23:43 -08:00
|
|
|
snprintf(buf, PATH_MAX, "%s:%d", v->dir->dir, e_object_get_usecount(E_OBJECT(v->dir)));
|
2002-03-03 02:40:07 -08:00
|
|
|
e_strdup(v->name, buf);
|
|
|
|
D("assigned name to view: %s\n", v->name);
|
|
|
|
|
|
|
|
/* Request metadata via efsd */
|
|
|
|
v->geom_get.x = efsd_get_metadata(e_fs_get_connection(),
|
2002-03-06 12:44:48 -08:00
|
|
|
"/view/x", v->dir->dir, EFSD_INT);
|
2002-03-03 02:40:07 -08:00
|
|
|
v->geom_get.y = efsd_get_metadata(e_fs_get_connection(),
|
2002-03-06 12:44:48 -08:00
|
|
|
"/view/y", v->dir->dir, EFSD_INT);
|
2002-03-03 02:40:07 -08:00
|
|
|
v->geom_get.w = efsd_get_metadata(e_fs_get_connection(),
|
2002-03-06 12:44:48 -08:00
|
|
|
"/view/w", v->dir->dir, EFSD_INT);
|
2002-03-03 02:40:07 -08:00
|
|
|
v->geom_get.h = efsd_get_metadata(e_fs_get_connection(),
|
2002-03-06 12:44:48 -08:00
|
|
|
"/view/h", v->dir->dir, EFSD_INT);
|
2002-03-03 02:40:07 -08:00
|
|
|
v->geom_get.busy = 1;
|
|
|
|
}
|
2002-02-27 14:46:14 -08:00
|
|
|
else
|
2002-03-03 02:40:07 -08:00
|
|
|
{
|
2002-03-10 09:23:43 -08:00
|
|
|
D("Couldnt set dir for view! Bad!");
|
2002-03-03 02:40:07 -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_RETURN;
|
2001-02-08 14:11:30 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2002-03-03 02:40:07 -08:00
|
|
|
e_view_realize(E_View * v)
|
|
|
|
{
|
|
|
|
char *font_dir;
|
|
|
|
|
|
|
|
D_ENTER;
|
|
|
|
if (v->evas)
|
|
|
|
D_RETURN;
|
|
|
|
v->win.base = ecore_window_new(0,
|
|
|
|
v->location.x, v->location.y,
|
|
|
|
v->size.w, v->size.h);
|
2001-10-17 15:34:27 -07:00
|
|
|
ecore_window_set_delete_inform(v->win.base);
|
2001-02-08 14:11:30 -08:00
|
|
|
font_dir = e_config_get("fonts");
|
2003-01-15 10:29:56 -08:00
|
|
|
|
|
|
|
v->evas = e_evas_new_all(ecore_display_get(),
|
2001-02-08 14:11:30 -08:00
|
|
|
v->win.base,
|
|
|
|
0, 0, v->size.w, v->size.h,
|
2003-01-15 10:29:56 -08:00
|
|
|
font_dir);
|
|
|
|
v->win.main = e_evas_get_window(v->evas);
|
2001-09-24 14:21:25 -07:00
|
|
|
e_cursors_display_in_window(v->win.main, "View");
|
2003-01-15 10:29:56 -08:00
|
|
|
evas_event_feed_mouse_move(v->evas, -999999, -999999);
|
2001-10-17 15:34:27 -07:00
|
|
|
ecore_window_set_events(v->win.base,
|
2002-03-03 02:40:07 -08:00
|
|
|
XEV_VISIBILITY | XEV_CONFIGURE |
|
|
|
|
XEV_PROPERTY | XEV_FOCUS);
|
|
|
|
ecore_window_set_events(v->win.main,
|
|
|
|
XEV_EXPOSE | XEV_MOUSE_MOVE |
|
|
|
|
XEV_BUTTON | XEV_IN_OUT | XEV_KEY);
|
2001-02-08 14:11:30 -08:00
|
|
|
if (v->options.back_pixmap)
|
|
|
|
{
|
2003-01-15 10:29:56 -08:00
|
|
|
Evas_Engine_Info_Software_X11 *info;
|
|
|
|
|
2001-10-17 15:34:27 -07:00
|
|
|
v->pmap = ecore_pixmap_new(v->win.main, v->size.w, v->size.h, 0);
|
2003-01-15 10:29:56 -08:00
|
|
|
info = (Evas_Engine_Info_Software_X11 *)evas_engine_info_get(v->evas);
|
|
|
|
info->info.drawable = v->pmap;
|
|
|
|
evas_engine_info_set(v->evas, (Evas_Engine_Info *)info);
|
2002-03-03 02:40:07 -08:00
|
|
|
ecore_window_set_background_pixmap(v->win.main, v->pmap);
|
2003-01-15 10:29:56 -08:00
|
|
|
ecore_window_clear(v->win.main);
|
2001-02-08 14:11:30 -08:00
|
|
|
}
|
2002-03-04 14:00:16 -08:00
|
|
|
v->scrollbar.v = e_scrollbar_new(v);
|
2001-08-12 23:35:14 -07:00
|
|
|
e_scrollbar_set_change_func(v->scrollbar.v, e_view_scrollbar_v_change_cb, v);
|
|
|
|
e_scrollbar_set_direction(v->scrollbar.v, 1);
|
|
|
|
e_scrollbar_add_to_evas(v->scrollbar.v, v->evas);
|
|
|
|
e_scrollbar_set_layer(v->scrollbar.v, 2000);
|
|
|
|
e_scrollbar_set_value(v->scrollbar.v, 0.0);
|
|
|
|
e_scrollbar_set_range(v->scrollbar.v, 1.0);
|
|
|
|
e_scrollbar_set_max(v->scrollbar.v, 1.0);
|
|
|
|
|
2002-03-04 14:00:16 -08:00
|
|
|
v->scrollbar.h = e_scrollbar_new(v);
|
2001-08-12 23:35:14 -07:00
|
|
|
e_scrollbar_set_change_func(v->scrollbar.h, e_view_scrollbar_h_change_cb, v);
|
|
|
|
e_scrollbar_set_direction(v->scrollbar.h, 0);
|
|
|
|
e_scrollbar_add_to_evas(v->scrollbar.h, v->evas);
|
|
|
|
e_scrollbar_set_layer(v->scrollbar.h, 2000);
|
|
|
|
e_scrollbar_set_value(v->scrollbar.h, 0.0);
|
|
|
|
e_scrollbar_set_range(v->scrollbar.h, 1.0);
|
|
|
|
e_scrollbar_set_max(v->scrollbar.h, 1.0);
|
2002-03-03 02:40:07 -08:00
|
|
|
|
2001-12-05 18:50:17 -08:00
|
|
|
/* I support dnd */
|
2002-03-03 02:40:07 -08:00
|
|
|
ecore_window_dnd_advertise(v->win.base);
|
2001-10-17 15:34:27 -07:00
|
|
|
ecore_window_show(v->win.main);
|
2002-03-03 02:40:07 -08:00
|
|
|
|
2001-02-08 14:11:30 -08:00
|
|
|
v->changed = 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;
|
2001-02-08 14:11:30 -08:00
|
|
|
}
|
|
|
|
|
2002-02-25 10:09:13 -08:00
|
|
|
void
|
2002-03-03 02:40:07 -08:00
|
|
|
e_view_populate(E_View * v)
|
2002-02-25 10:09:13 -08:00
|
|
|
{
|
2003-01-15 10:29:56 -08:00
|
|
|
Evas_List * l;
|
2002-03-03 02:40:07 -08:00
|
|
|
|
2002-02-25 10:09:13 -08:00
|
|
|
/* populate with icons for all files in the dir we are monitoring.
|
|
|
|
* This has to be called _after_ view_realize because
|
|
|
|
* view_add_file needs the evas to be intialized */
|
2002-03-06 12:44:48 -08:00
|
|
|
for (l = v->dir->files; l; l = l->next)
|
2002-03-03 02:40:07 -08:00
|
|
|
{
|
|
|
|
E_File *f = (E_File *) l->data;
|
|
|
|
|
|
|
|
e_view_file_add(v, f);
|
|
|
|
/* try to show the icons for the file. If this is not the first for
|
|
|
|
* the dir this will succeed because filetype and stat info have
|
|
|
|
* already been received. If not, it'll be shown when those arrive. */
|
2002-03-10 09:23:43 -08:00
|
|
|
e_view_file_try_to_show(v, f);
|
2002-03-03 02:40:07 -08:00
|
|
|
}
|
2002-02-25 10:09:13 -08:00
|
|
|
}
|
|
|
|
|
2001-02-08 14:11:30 -08:00
|
|
|
void
|
2002-03-03 02:40:07 -08:00
|
|
|
e_view_update(E_View * v)
|
2001-02-08 14:11:30 -08:00
|
|
|
{
|
2003-01-15 10:29:56 -08:00
|
|
|
Evas_List * l;
|
2002-03-03 02:40:07 -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;
|
2002-02-25 10:09:13 -08:00
|
|
|
|
2002-02-26 13:12:45 -08:00
|
|
|
if (!v->changed)
|
|
|
|
D_RETURN;
|
2002-03-03 02:40:07 -08:00
|
|
|
|
|
|
|
if (v->drag.icon_hide)
|
|
|
|
{
|
|
|
|
for (l = v->icons; l; l = l->next)
|
|
|
|
{
|
|
|
|
E_Icon *ic;
|
|
|
|
|
|
|
|
ic = l->data;
|
|
|
|
e_icon_hide_delete_pending(ic);
|
|
|
|
}
|
|
|
|
v->drag.icon_hide = 0;
|
|
|
|
v_dnd_source = v;
|
|
|
|
}
|
|
|
|
if (v->drag.icon_show)
|
|
|
|
{
|
|
|
|
for (l = v->icons; l; l = l->next)
|
|
|
|
{
|
|
|
|
E_Icon *ic;
|
|
|
|
|
|
|
|
ic = l->data;
|
|
|
|
e_icon_show_delete_end(ic, dnd_pending_mode);
|
|
|
|
}
|
|
|
|
dnd_pending_mode = E_DND_NONE;
|
|
|
|
v->drag.icon_show = 0;
|
|
|
|
}
|
2002-02-25 10:09:13 -08:00
|
|
|
if (v->drag.update)
|
2002-03-03 02:40:07 -08:00
|
|
|
{
|
|
|
|
ecore_window_move(v->drag.win, v->drag.x, v->drag.y);
|
|
|
|
v->drag.update = 0;
|
|
|
|
}
|
2001-02-08 14:11:30 -08:00
|
|
|
if (v->options.back_pixmap)
|
|
|
|
{
|
2003-01-15 10:29:56 -08:00
|
|
|
Evas_List *up, *fp;
|
|
|
|
Evas_Rectangle *u;
|
2002-03-03 02:40:07 -08:00
|
|
|
|
2003-01-15 10:29:56 -08:00
|
|
|
fp = up = evas_render_updates(v->evas);
|
2001-07-12 09:40:13 -07:00
|
|
|
/* special code to handle if we are double buffering to a pixmap */
|
|
|
|
/* and clear sections of the window if they got updated */
|
2003-01-15 10:29:56 -08:00
|
|
|
while (up)
|
2001-02-08 14:11:30 -08:00
|
|
|
{
|
2003-01-15 10:29:56 -08:00
|
|
|
u = up->data;
|
|
|
|
ecore_window_clear_area(v->win.main, u->x, u->y, u->w, u->h);
|
|
|
|
up = evas_list_next(up);
|
2001-02-08 14:11:30 -08:00
|
|
|
}
|
2003-01-15 10:29:56 -08:00
|
|
|
evas_render_updates_free(fp);
|
2001-02-08 14:11:30 -08:00
|
|
|
}
|
|
|
|
else
|
2002-03-03 02:40:07 -08:00
|
|
|
evas_render(v->evas);
|
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
|
|
|
|
2002-03-03 02:40:07 -08:00
|
|
|
v->changed = 0;
|
2002-03-04 14:00:16 -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_RETURN;
|
2001-02-06 00:23:36 -08:00
|
|
|
}
|
|
|
|
|
2002-02-25 10:09:13 -08:00
|
|
|
void
|
2002-03-03 02:40:07 -08:00
|
|
|
e_view_file_add(E_View * v, E_File * f)
|
2001-07-12 09:40:13 -07: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-11-03 01:07:40 -08:00
|
|
|
|
2002-02-25 10:09:13 -08:00
|
|
|
if (!e_icon_find_by_file(v, f->file))
|
2002-03-03 02:40:07 -08:00
|
|
|
{
|
|
|
|
E_Icon *ic;
|
|
|
|
|
|
|
|
ic = e_icon_new();
|
|
|
|
ic->view = v;
|
|
|
|
ic->file = f;
|
|
|
|
ic->changed = 1;
|
|
|
|
/* this basically allocates the obj.icon struct. Its image will be
|
|
|
|
* set later in icon_update_state */
|
2003-01-15 10:29:56 -08:00
|
|
|
ic->obj.icon = evas_object_image_add(ic->view->evas);
|
2002-03-03 02:40:07 -08:00
|
|
|
ic->obj.text = e_text_new(ic->view->evas, f->file, "filename");
|
|
|
|
v->icons = evas_list_append(v->icons, ic);
|
|
|
|
v->extents.valid = 0;
|
|
|
|
}
|
2002-02-25 10:09:13 -08:00
|
|
|
e_view_queue_resort(v);
|
|
|
|
v->changed = 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;
|
2001-07-12 09:40:13 -07:00
|
|
|
}
|
|
|
|
|
2001-11-18 13:28:35 -08:00
|
|
|
void
|
2002-03-03 02:40:07 -08:00
|
|
|
e_view_file_changed(E_View * v, E_File * f)
|
2001-11-18 13:28:35 -08:00
|
|
|
{
|
2002-03-03 02:40:07 -08:00
|
|
|
E_Icon *ic;
|
|
|
|
|
2001-11-16 18:45:43 -08:00
|
|
|
D_ENTER;
|
|
|
|
|
2002-02-25 10:09:13 -08:00
|
|
|
ic = e_icon_find_by_file(v, f->file);
|
|
|
|
if (ic)
|
2002-03-03 02:40:07 -08:00
|
|
|
{
|
2002-03-10 09:23:43 -08:00
|
|
|
e_icon_update_state(ic);
|
2002-03-03 02:40:07 -08:00
|
|
|
}
|
2002-02-26 13:12:45 -08:00
|
|
|
v->changed = 1;
|
2001-11-16 18:45:43 -08:00
|
|
|
D_RETURN;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2002-03-10 09:23:43 -08:00
|
|
|
e_view_file_try_to_show(E_View * v, E_File * f)
|
2001-11-16 18:45:43 -08:00
|
|
|
{
|
2002-03-03 02:40:07 -08:00
|
|
|
E_Icon *ic;
|
|
|
|
|
2001-11-16 18:45:43 -08:00
|
|
|
D_ENTER;
|
2002-03-10 09:23:43 -08:00
|
|
|
ic = e_icon_find_by_file(v, f->file);
|
|
|
|
if (ic)
|
|
|
|
{
|
|
|
|
e_icon_update_state(ic);
|
|
|
|
e_icon_initial_show(ic);
|
|
|
|
}
|
|
|
|
v->changed = 1;
|
|
|
|
D_RETURN;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
e_view_file_delete(E_View * v, E_File * f)
|
|
|
|
{
|
|
|
|
E_Icon *ic;
|
2001-11-16 18:45:43 -08:00
|
|
|
|
2002-03-10 09:23:43 -08:00
|
|
|
D_ENTER;
|
2001-11-26 05:08:34 -08:00
|
|
|
|
2002-02-25 10:09:13 -08:00
|
|
|
ic = e_icon_find_by_file(v, f->file);
|
|
|
|
if (ic)
|
2002-03-03 02:40:07 -08:00
|
|
|
{
|
|
|
|
e_icon_hide(ic);
|
|
|
|
v->icons = evas_list_remove(v->icons, ic);
|
2002-03-10 09:23:43 -08:00
|
|
|
e_object_unref(E_OBJECT(ic));
|
2002-03-03 02:40:07 -08:00
|
|
|
v->changed = 1;
|
|
|
|
v->extents.valid = 0;
|
|
|
|
e_view_queue_resort(v);
|
|
|
|
}
|
2001-11-26 05:08:34 -08:00
|
|
|
D_RETURN;
|
|
|
|
}
|
|
|
|
|
2002-03-10 09:23:43 -08:00
|
|
|
void
|
|
|
|
e_view_layout_reload(E_View * v)
|
|
|
|
{
|
|
|
|
D_ENTER;
|
|
|
|
if (!v || !v->look)
|
|
|
|
D_RETURN;
|
|
|
|
|
|
|
|
if (e_object_unref(E_OBJECT(v->layout)) == 0)
|
|
|
|
v->layout = NULL;
|
|
|
|
|
|
|
|
/* try load a new layout */
|
|
|
|
v->layout = e_view_layout_new(v);
|
|
|
|
|
|
|
|
/* if the layout loaded and theres an evas - we're realized */
|
|
|
|
/* so realize the layout */
|
|
|
|
if ((v->layout) && (v->evas))
|
|
|
|
e_view_layout_realize(v->layout);
|
|
|
|
|
|
|
|
e_view_layout_update(v->layout);
|
|
|
|
|
|
|
|
v->changed = 1;
|
|
|
|
D_RETURN;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2001-11-26 05:08:34 -08:00
|
|
|
void
|
2002-03-03 02:40:07 -08:00
|
|
|
e_view_ib_reload(E_View * v)
|
2001-11-26 05:08:34 -08:00
|
|
|
{
|
2002-03-03 02:40:07 -08:00
|
|
|
D_ENTER;
|
2002-03-10 09:23:43 -08:00
|
|
|
|
|
|
|
|
2002-03-03 02:40:07 -08:00
|
|
|
/* if we have an iconbar.. well nuke it */
|
|
|
|
if (e_object_unref(E_OBJECT(v->iconbar)) == 0)
|
|
|
|
v->iconbar = NULL;
|
2002-03-10 09:23:43 -08:00
|
|
|
|
|
|
|
/* no iconbar in our look */
|
|
|
|
if(!v->look->obj->icb || !v->look->obj->icb_bits)
|
|
|
|
D_RETURN;
|
2001-11-16 18:45:43 -08:00
|
|
|
|
2002-03-03 02:40:07 -08:00
|
|
|
/* try load a new iconbar */
|
|
|
|
if (!v->iconbar)
|
|
|
|
v->iconbar = e_iconbar_new(v);
|
2002-02-25 10:09:13 -08:00
|
|
|
|
2002-03-03 02:40:07 -08:00
|
|
|
/* if the iconbar loaded and theres an evas - we're realized */
|
|
|
|
/* so realize the iconbar */
|
|
|
|
if ((v->iconbar) && (v->evas))
|
|
|
|
e_iconbar_realize(v->iconbar);
|
2002-02-25 10:09:13 -08:00
|
|
|
|
2002-03-03 02:40:07 -08:00
|
|
|
D_RETURN;
|
2001-11-16 18:45:43 -08:00
|
|
|
}
|
|
|
|
|
2001-11-26 05:08:34 -08:00
|
|
|
void
|
2002-03-03 02:40:07 -08:00
|
|
|
e_view_bg_reload(E_View * v)
|
2001-11-26 05:08:34 -08:00
|
|
|
{
|
2002-03-10 09:23:43 -08:00
|
|
|
E_Background bg = NULL;
|
2002-03-03 02:40:07 -08:00
|
|
|
|
2002-02-25 10:09:13 -08:00
|
|
|
/* This should only be called if the background did really
|
2002-03-06 12:44:48 -08:00
|
|
|
* change in the underlying dir. We dont check again
|
2002-02-25 10:09:13 -08:00
|
|
|
* here. */
|
2001-11-26 05:08:34 -08:00
|
|
|
D_ENTER;
|
2002-02-25 10:09:13 -08:00
|
|
|
|
2002-03-10 09:23:43 -08:00
|
|
|
if (!v || !v->look)
|
|
|
|
D_RETURN;
|
|
|
|
|
|
|
|
/* nuke the old one */
|
2002-03-03 02:40:07 -08:00
|
|
|
if (v->bg)
|
|
|
|
{
|
|
|
|
int size;
|
|
|
|
|
|
|
|
e_bg_free(v->bg);
|
|
|
|
v->bg = NULL;
|
|
|
|
if (v->evas)
|
2002-03-10 09:23:43 -08:00
|
|
|
{
|
2003-01-24 10:26:13 -08:00
|
|
|
size = evas_image_cache_get(v->evas);
|
|
|
|
evas_image_cache_flush(v->evas);
|
|
|
|
evas_image_cache_set(v->evas, size);
|
2002-03-10 09:23:43 -08:00
|
|
|
}
|
2002-03-03 02:40:07 -08:00
|
|
|
e_db_flush();
|
|
|
|
}
|
2002-03-10 09:23:43 -08:00
|
|
|
if(v->look->obj->bg)
|
|
|
|
{
|
|
|
|
bg = e_bg_load(v->look->obj->bg);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
/* Our look doesnt provide a bg, falls back */
|
|
|
|
char buf[PATH_MAX];
|
|
|
|
if(v->is_desktop)
|
|
|
|
snprintf(buf, PATH_MAX, "%s/default.bg.db", e_config_get("backgrounds"));
|
|
|
|
else
|
|
|
|
snprintf(buf, PATH_MAX, "%s/view.bg.db", e_config_get("backgrounds"));
|
|
|
|
|
|
|
|
bg = e_bg_load(buf);
|
|
|
|
}
|
2002-02-25 10:09:13 -08:00
|
|
|
if (bg)
|
2002-03-10 09:23:43 -08:00
|
|
|
{
|
|
|
|
v->bg = bg;
|
|
|
|
if (v->evas)
|
|
|
|
{
|
|
|
|
e_bg_add_to_evas(v->bg, v->evas);
|
|
|
|
e_bg_set_scroll(v->bg, v->scroll.x, v->scroll.y);
|
|
|
|
e_bg_set_layer(v->bg, 100);
|
|
|
|
e_bg_resize(v->bg, v->size.w, v->size.h);
|
|
|
|
|
2003-01-15 10:29:56 -08:00
|
|
|
e_bg_callback_add(v->bg, EVAS_CALLBACK_MOUSE_UP, e_bg_up_cb, v);
|
|
|
|
e_bg_callback_add(v->bg, EVAS_CALLBACK_MOUSE_DOWN, e_bg_down_cb, v);
|
|
|
|
e_bg_callback_add(v->bg, EVAS_CALLBACK_MOUSE_MOVE, e_bg_move_cb, v);
|
2002-03-10 09:23:43 -08:00
|
|
|
|
|
|
|
e_bg_show(v->bg);
|
|
|
|
}
|
|
|
|
}
|
2002-02-26 13:12:45 -08:00
|
|
|
v->changed = 1;
|
2001-11-26 05:08:34 -08:00
|
|
|
D_RETURN;
|
|
|
|
}
|
|
|
|
|
2000-12-18 13:28:44 -08:00
|
|
|
void
|
|
|
|
e_view_init(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;
|
2002-03-03 02:40:07 -08:00
|
|
|
|
|
|
|
ecore_event_filter_handler_add(ECORE_EVENT_MOUSE_DOWN, e_mouse_down);
|
|
|
|
ecore_event_filter_handler_add(ECORE_EVENT_MOUSE_UP, e_mouse_up);
|
|
|
|
ecore_event_filter_handler_add(ECORE_EVENT_MOUSE_MOVE, e_mouse_move);
|
|
|
|
ecore_event_filter_handler_add(ECORE_EVENT_MOUSE_IN, e_mouse_in);
|
|
|
|
ecore_event_filter_handler_add(ECORE_EVENT_MOUSE_OUT, e_mouse_out);
|
|
|
|
ecore_event_filter_handler_add(ECORE_EVENT_WINDOW_EXPOSE, e_window_expose);
|
|
|
|
ecore_event_filter_handler_add(ECORE_EVENT_KEY_DOWN, e_key_down);
|
|
|
|
ecore_event_filter_handler_add(ECORE_EVENT_KEY_UP, e_key_up);
|
|
|
|
ecore_event_filter_handler_add(ECORE_EVENT_MOUSE_WHEEL, e_wheel);
|
|
|
|
ecore_event_filter_handler_add(ECORE_EVENT_WINDOW_CONFIGURE, e_configure);
|
|
|
|
ecore_event_filter_handler_add(ECORE_EVENT_WINDOW_PROPERTY, e_property);
|
|
|
|
ecore_event_filter_handler_add(ECORE_EVENT_WINDOW_UNMAP, e_unmap);
|
|
|
|
ecore_event_filter_handler_add(ECORE_EVENT_WINDOW_VISIBILITY, e_visibility);
|
|
|
|
ecore_event_filter_handler_add(ECORE_EVENT_WINDOW_FOCUS_IN, e_focus_in);
|
|
|
|
ecore_event_filter_handler_add(ECORE_EVENT_WINDOW_FOCUS_OUT, e_focus_out);
|
|
|
|
ecore_event_filter_handler_add(ECORE_EVENT_WINDOW_DELETE, e_delete);
|
2001-12-05 18:50:17 -08:00
|
|
|
/* dnd source handlers */
|
2002-03-03 02:40:07 -08:00
|
|
|
ecore_event_filter_handler_add(ECORE_EVENT_DND_DROP_STATUS, e_dnd_status);
|
|
|
|
ecore_event_filter_handler_add(ECORE_EVENT_DND_DATA_REQUEST,
|
|
|
|
e_dnd_data_request);
|
|
|
|
ecore_event_filter_handler_add(ECORE_EVENT_DND_DROP_END, e_dnd_drop_end);
|
2001-12-05 18:50:17 -08:00
|
|
|
/* dnd target handlers */
|
2002-03-03 02:40:07 -08:00
|
|
|
ecore_event_filter_handler_add(ECORE_EVENT_DND_DROP_POSITION,
|
|
|
|
e_dnd_drop_position);
|
|
|
|
ecore_event_filter_handler_add(ECORE_EVENT_DND_DROP, e_dnd_drop);
|
|
|
|
ecore_event_filter_handler_add(ECORE_EVENT_DND_DROP_REQUEST,
|
|
|
|
e_dnd_drop_request);
|
2001-12-05 18:50:17 -08:00
|
|
|
|
2001-11-01 15:54:48 -08:00
|
|
|
ecore_event_filter_idle_handler_add(e_idle, NULL);
|
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-18 13:28:44 -08:00
|
|
|
}
|
2001-12-05 18:50:17 -08:00
|
|
|
|
|
|
|
/*
|
|
|
|
* send the dnd data to the target app
|
|
|
|
*
|
2001-12-08 13:07:44 -08:00
|
|
|
* uri-list (http://www.faqs.org/rfcs/rfc2483.html)
|
2001-12-05 18:50:17 -08:00
|
|
|
* URL formatting per RFC 1738
|
2001-12-08 13:07:44 -08:00
|
|
|
* (or not. Looks like a lot of apps ignore this. So do we! )
|
2001-12-05 18:50:17 -08:00
|
|
|
*/
|
|
|
|
static void
|
|
|
|
e_dnd_data_request(Ecore_Event * ev)
|
|
|
|
{
|
2002-03-03 02:40:07 -08:00
|
|
|
Ecore_Event_Dnd_Data_Request *e;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* typedef struct _ecore_event_dnd_data_request
|
|
|
|
* {
|
|
|
|
* Window win, root, source_win;
|
|
|
|
* int plain_text;
|
|
|
|
* Atom destination_atom;
|
|
|
|
* } Ecore_Event_Dnd_Data_Request;
|
|
|
|
*/
|
|
|
|
E_View *v;
|
2003-01-15 10:29:56 -08:00
|
|
|
Evas_List * ll;
|
2002-03-03 02:40:07 -08:00
|
|
|
char *data = NULL;
|
2001-12-05 18:50:17 -08:00
|
|
|
|
|
|
|
D_ENTER;
|
2002-02-25 10:09:13 -08:00
|
|
|
/* Me, my null, and an extra for the end '/r/n'... */
|
|
|
|
e_strdup(data, "");
|
|
|
|
|
2001-12-05 18:50:17 -08:00
|
|
|
e = ev->event;
|
2002-03-04 15:57:56 -08:00
|
|
|
if (!(v = e_view_machine_get_view_by_base_window(e->win)))
|
2002-03-06 12:59:16 -08:00
|
|
|
D_RETURN;
|
2001-12-05 18:50:17 -08:00
|
|
|
|
2002-02-25 10:09:13 -08:00
|
|
|
if (e->uri_list)
|
2002-03-03 02:40:07 -08:00
|
|
|
{
|
|
|
|
int first = 1;
|
|
|
|
|
|
|
|
for (ll = v->icons; ll; ll = ll->next)
|
|
|
|
{
|
|
|
|
E_Icon *ic;
|
|
|
|
|
|
|
|
ic = ll->data;
|
|
|
|
if (ic->state.selected)
|
|
|
|
{
|
2003-01-15 10:29:56 -08:00
|
|
|
int size;
|
2002-03-03 02:40:07 -08:00
|
|
|
char buf[PATH_MAX];
|
|
|
|
|
|
|
|
if (first)
|
|
|
|
{
|
|
|
|
/*FIXME */
|
2002-03-06 12:44:48 -08:00
|
|
|
snprintf(buf, PATH_MAX, "file:%s/%s", v->dir->dir,
|
2002-03-03 02:40:07 -08:00
|
|
|
ic->file->file);
|
|
|
|
first = 0;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
/* FIXME */
|
2002-03-06 12:44:48 -08:00
|
|
|
snprintf(buf, PATH_MAX, "\r\nfile:%s/%s", v->dir->dir,
|
2002-03-03 02:40:07 -08:00
|
|
|
ic->file->file);
|
2003-01-15 10:29:56 -08:00
|
|
|
size = strlen(data) + strlen(buf) + 1;
|
|
|
|
REALLOC(data, char, size);
|
2002-03-03 02:40:07 -08:00
|
|
|
|
2003-01-15 10:29:56 -08:00
|
|
|
strncat(data, buf, size);
|
2002-03-03 02:40:07 -08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
ecore_dnd_send_data(e->source_win, e->win,
|
|
|
|
data, strlen(data) + 1,
|
|
|
|
e->destination_atom, DND_TYPE_URI_LIST);
|
|
|
|
}
|
2002-02-25 10:09:13 -08:00
|
|
|
else if (e->plain_text)
|
2002-03-03 02:40:07 -08:00
|
|
|
{
|
|
|
|
int first = 1;
|
|
|
|
|
|
|
|
for (ll = v->icons; ll; ll = ll->next)
|
|
|
|
{
|
|
|
|
E_Icon *ic;
|
|
|
|
|
|
|
|
ic = ll->data;
|
|
|
|
if (ic->state.selected)
|
|
|
|
{
|
2003-01-15 10:29:56 -08:00
|
|
|
int size;
|
2002-03-03 02:40:07 -08:00
|
|
|
char buf[PATH_MAX];
|
|
|
|
|
|
|
|
if (first)
|
|
|
|
{
|
|
|
|
/*FIXME */
|
2002-03-06 12:44:48 -08:00
|
|
|
snprintf(buf, PATH_MAX, "%s/%s\n", v->dir->dir,
|
2002-03-03 02:40:07 -08:00
|
|
|
ic->file->file);
|
|
|
|
first = 0;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
/*FIXME */
|
2002-03-06 12:44:48 -08:00
|
|
|
snprintf(buf, PATH_MAX, "\n%s/%s", v->dir->dir,
|
2002-03-03 02:40:07 -08:00
|
|
|
ic->file->file);
|
2003-01-15 10:29:56 -08:00
|
|
|
size = strlen(data) + strlen(buf) + 1;
|
|
|
|
REALLOC(data, char, size);
|
2002-03-03 02:40:07 -08:00
|
|
|
|
2003-01-15 10:29:56 -08:00
|
|
|
strncat(data, buf, size);
|
2002-03-03 02:40:07 -08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
ecore_dnd_send_data(e->source_win, e->win,
|
|
|
|
data, strlen(data) + 1,
|
|
|
|
e->destination_atom, DND_TYPE_PLAIN_TEXT);
|
|
|
|
}
|
|
|
|
else /* if (e->moz_url) */
|
|
|
|
{
|
|
|
|
FREE(data);
|
|
|
|
data = NULL;
|
|
|
|
|
|
|
|
for (ll = v->icons; ll; ll = ll->next)
|
|
|
|
{
|
|
|
|
E_Icon *ic;
|
|
|
|
|
|
|
|
ic = ll->data;
|
|
|
|
if (ic->state.selected)
|
|
|
|
{
|
|
|
|
char buf[16384];
|
|
|
|
|
|
|
|
/* FIXME */
|
2002-03-06 12:44:48 -08:00
|
|
|
snprintf(buf, PATH_MAX, "file:%s/%s", v->dir->dir,
|
2002-03-03 02:40:07 -08:00
|
|
|
ic->file->file);
|
|
|
|
data = strdup(buf);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (data)
|
|
|
|
{
|
|
|
|
ecore_dnd_send_data(e->source_win, e->win,
|
|
|
|
data, strlen(data) + 1,
|
|
|
|
e->destination_atom, DND_TYPE_NETSCAPE_URL);
|
|
|
|
}
|
|
|
|
}
|
2002-02-25 10:09:13 -08:00
|
|
|
IF_FREE(data);
|
2001-12-05 18:50:17 -08:00
|
|
|
D_RETURN;
|
|
|
|
}
|
|
|
|
|
2002-03-01 12:50:46 -08:00
|
|
|
static void
|
2001-12-05 18:50:17 -08:00
|
|
|
e_dnd_drop_end(Ecore_Event * ev)
|
|
|
|
{
|
2002-02-25 10:09:13 -08:00
|
|
|
Ecore_Event_Dnd_Drop_End *e;
|
2002-03-03 02:40:07 -08:00
|
|
|
|
2002-02-25 10:09:13 -08:00
|
|
|
/*
|
2002-03-03 02:40:07 -08:00
|
|
|
* * typedef struct _ecore_event_dnd_drop_end
|
|
|
|
* * {
|
|
|
|
* * Window win, root, source_win;
|
|
|
|
* * } Ecore_Event_Dnd_Drop_End;
|
|
|
|
*/
|
2002-03-06 12:59:16 -08:00
|
|
|
E_View *v;
|
2002-02-25 10:09:13 -08:00
|
|
|
|
2001-12-05 18:50:17 -08:00
|
|
|
D_ENTER;
|
2002-02-25 10:09:13 -08:00
|
|
|
|
2001-12-05 18:50:17 -08:00
|
|
|
e = ev->event;
|
2002-03-04 15:57:56 -08:00
|
|
|
if (e && e->win)
|
2002-03-03 02:40:07 -08:00
|
|
|
{
|
2002-03-06 12:59:16 -08:00
|
|
|
if ((v = e_view_machine_get_view_by_base_window(e->win)))
|
2002-03-03 02:40:07 -08:00
|
|
|
{
|
|
|
|
if (v_dnd_source)
|
|
|
|
{
|
|
|
|
if (dnd_pending_mode != E_DND_DELETED &&
|
|
|
|
dnd_pending_mode != E_DND_COPIED)
|
|
|
|
{
|
|
|
|
dnd_pending_mode = E_DND_COPIED;
|
|
|
|
}
|
|
|
|
if (v_dnd_source->drag.matching_drop_attempt)
|
|
|
|
{
|
|
|
|
v_dnd_source->drag.matching_drop_attempt = 0;
|
|
|
|
dnd_pending_mode = E_DND_COPIED;
|
|
|
|
}
|
|
|
|
v_dnd_source->changed = 1;
|
|
|
|
v_dnd_source->drag.icon_show = 1;
|
|
|
|
}
|
2002-03-04 14:00:16 -08:00
|
|
|
|
2002-03-03 02:40:07 -08:00
|
|
|
e_dnd_drop_request_free();
|
|
|
|
}
|
|
|
|
}
|
2002-03-04 14:00:16 -08:00
|
|
|
|
2001-12-05 18:50:17 -08:00
|
|
|
D_RETURN;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
e_dnd_drop_position(Ecore_Event * ev)
|
|
|
|
{
|
2002-03-01 12:50:46 -08:00
|
|
|
Ecore_Event_Dnd_Drop_Position *e;
|
2002-03-03 02:40:07 -08:00
|
|
|
|
2002-03-01 12:50:46 -08:00
|
|
|
/*
|
2002-03-04 14:00:16 -08:00
|
|
|
* typedef struct _ecore_event_dnd_drop_position
|
|
|
|
* {
|
|
|
|
* Window win, root, source_win;
|
|
|
|
* int x, y;
|
|
|
|
* } Ecore_Event_Dnd_Drop_Position;
|
2002-03-03 02:40:07 -08:00
|
|
|
*/
|
2002-03-06 12:59:16 -08:00
|
|
|
E_View *v;
|
2002-03-01 12:50:46 -08:00
|
|
|
|
2001-12-05 18:50:17 -08:00
|
|
|
D_ENTER;
|
2002-03-04 14:00:16 -08:00
|
|
|
|
2001-12-05 18:50:17 -08:00
|
|
|
e = ev->event;
|
2002-03-04 15:57:56 -08:00
|
|
|
if (e && e->win)
|
2002-03-03 02:40:07 -08:00
|
|
|
{
|
2002-03-06 12:59:16 -08:00
|
|
|
if ((v = e_view_machine_get_view_by_base_window(e->win)))
|
2002-03-03 02:40:07 -08:00
|
|
|
{
|
|
|
|
if (v->iconbar)
|
|
|
|
{
|
|
|
|
if (e->x >= v->iconbar->icon_area.x &&
|
|
|
|
e->x <= v->iconbar->icon_area.x + v->iconbar->icon_area.w
|
|
|
|
&& e->y >= v->iconbar->icon_area.y
|
|
|
|
&& e->y <=
|
|
|
|
v->iconbar->icon_area.y + v->iconbar->icon_area.h)
|
|
|
|
{
|
|
|
|
v->iconbar->dnd.x = e->x;
|
|
|
|
v->iconbar->dnd.y = e->y;
|
|
|
|
/* for iconbar drops, allow from same view */
|
|
|
|
v->drag.matching_drop_attempt = 0;
|
|
|
|
dnd_pending_mode = E_DND_ICONBAR_ADD;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* send XdndStatus (even to same view, we'll */
|
|
|
|
/* ignore actions within the same view later */
|
|
|
|
/* during the drop action.) */
|
|
|
|
ecore_window_dnd_send_status_ok(v->win.base, e->source_win,
|
|
|
|
v->location.x, v->location.y,
|
|
|
|
v->size.w, v->size.h);
|
|
|
|
|
|
|
|
/* todo - cache window extents, don't send again within these extents. */
|
|
|
|
}
|
|
|
|
}
|
2002-03-04 14:00:16 -08:00
|
|
|
|
2001-12-05 18:50:17 -08:00
|
|
|
D_RETURN;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
e_dnd_drop(Ecore_Event * ev)
|
|
|
|
{
|
2002-03-03 02:40:07 -08:00
|
|
|
Ecore_Event_Dnd_Drop *e;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* typedef struct _ecore_event_dnd_drop
|
|
|
|
* {
|
|
|
|
* Window win, root, source_win;
|
|
|
|
* } Ecore_Event_Dnd_Drop;
|
|
|
|
*/
|
2002-03-06 12:59:16 -08:00
|
|
|
E_View *v;
|
2002-03-01 12:50:46 -08:00
|
|
|
|
2001-12-05 18:50:17 -08:00
|
|
|
D_ENTER;
|
2002-03-04 14:00:16 -08:00
|
|
|
|
2001-12-05 18:50:17 -08:00
|
|
|
e = ev->event;
|
2002-03-04 15:57:56 -08:00
|
|
|
if (e && e->win)
|
2002-03-03 02:40:07 -08:00
|
|
|
{
|
2002-03-06 12:59:16 -08:00
|
|
|
if ((v = e_view_machine_get_view_by_base_window(e->win)))
|
2002-03-03 02:40:07 -08:00
|
|
|
{
|
|
|
|
/* Dropped! Handle data */
|
|
|
|
/* Same view or same underlying dir? Mark to skip action */
|
2002-03-06 12:44:48 -08:00
|
|
|
if (e->win == e->source_win || v->dir == v_dnd_source->dir)
|
2002-03-04 15:57:56 -08:00
|
|
|
v_dnd_source->drag.matching_drop_attempt = 1;
|
2002-03-03 02:40:07 -08:00
|
|
|
/* Perform the action... */
|
|
|
|
e_dnd_handle_drop(v);
|
|
|
|
|
|
|
|
ecore_window_dnd_send_finished(v->win.base, e->source_win);
|
|
|
|
e_dnd_drop_request_free();
|
|
|
|
}
|
|
|
|
}
|
2002-03-04 14:00:16 -08:00
|
|
|
|
2001-12-05 18:50:17 -08:00
|
|
|
D_RETURN;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
e_dnd_drop_request(Ecore_Event * ev)
|
|
|
|
{
|
2002-03-03 02:40:07 -08:00
|
|
|
Ecore_Event_Dnd_Drop_Request *e;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* typedef struct _ecore_event_dnd_drop_request
|
|
|
|
* {
|
|
|
|
* Window win, root, source_win;
|
|
|
|
* int num_files;
|
|
|
|
* char **files;
|
|
|
|
* int copy, link, move;
|
|
|
|
* } Ecore_Event_Dnd_Drop_Request;
|
|
|
|
*/
|
2002-03-06 12:59:16 -08:00
|
|
|
E_View *v;
|
2002-03-03 02:40:07 -08:00
|
|
|
|
|
|
|
D_ENTER;
|
2002-03-04 14:00:16 -08:00
|
|
|
|
2002-03-03 02:40:07 -08:00
|
|
|
e = ev->event;
|
2002-03-04 15:57:56 -08:00
|
|
|
if (e && e->win)
|
2002-03-03 02:40:07 -08:00
|
|
|
{
|
2002-03-06 12:59:16 -08:00
|
|
|
if ((v = e_view_machine_get_view_by_base_window(e->win)))
|
2002-03-03 02:40:07 -08:00
|
|
|
{
|
|
|
|
/* if it exists, we already have the data... */
|
|
|
|
if ((!dnd_files) && (e->num_files > 0))
|
|
|
|
{
|
|
|
|
int i;
|
|
|
|
|
|
|
|
dnd_files = NEW_PTR(e->num_files);
|
|
|
|
|
|
|
|
/* copy the file list locally, for use in a dnd_drop */
|
|
|
|
for (i = 0; i < e->num_files; i++)
|
|
|
|
dnd_files[i] = strdup(e->files[i]);
|
|
|
|
|
|
|
|
dnd_num_files = e->num_files;
|
|
|
|
|
|
|
|
/* if the dnd source is e itself then dont use the event mode */
|
2002-03-04 15:57:56 -08:00
|
|
|
if ((v ==
|
2002-03-06 12:59:16 -08:00
|
|
|
e_view_machine_get_view_by_base_window(e->source_win)))
|
2002-03-03 02:40:07 -08:00
|
|
|
{
|
|
|
|
dnd_pending_mode = v->drag.drop_mode;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (e->copy)
|
|
|
|
dnd_pending_mode = E_DND_COPY;
|
|
|
|
else if (e->move)
|
|
|
|
dnd_pending_mode = E_DND_MOVE;
|
|
|
|
else if (e->link)
|
|
|
|
dnd_pending_mode = E_DND_LINK;
|
|
|
|
else
|
|
|
|
dnd_pending_mode = E_DND_ASK;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2002-03-04 14:00:16 -08:00
|
|
|
|
2002-03-03 02:40:07 -08:00
|
|
|
D_RETURN;
|
2001-12-05 18:50:17 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
e_dnd_drop_request_free(void)
|
|
|
|
{
|
2002-03-03 02:40:07 -08:00
|
|
|
D_ENTER;
|
2001-12-05 18:50:17 -08:00
|
|
|
|
2002-03-03 02:40:07 -08:00
|
|
|
if (dnd_files)
|
|
|
|
{
|
|
|
|
int i;
|
2001-12-05 18:50:17 -08:00
|
|
|
|
2002-03-03 02:40:07 -08:00
|
|
|
for (i = 0; i < dnd_num_files; i++)
|
|
|
|
FREE(dnd_files[i]);
|
2001-12-05 18:50:17 -08:00
|
|
|
|
2002-03-03 02:40:07 -08:00
|
|
|
FREE(dnd_files);
|
2001-12-05 18:50:17 -08:00
|
|
|
|
2002-03-03 02:40:07 -08:00
|
|
|
dnd_num_files = 0;
|
|
|
|
}
|
|
|
|
D_RETURN;
|
2001-12-05 18:50:17 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2002-03-03 02:40:07 -08:00
|
|
|
e_dnd_handle_drop(E_View * v)
|
2001-12-05 18:50:17 -08:00
|
|
|
{
|
2002-03-03 02:40:07 -08:00
|
|
|
int in, out;
|
|
|
|
char *filename;
|
|
|
|
|
2001-12-07 22:34:06 -08:00
|
|
|
D_ENTER;
|
2002-03-03 02:40:07 -08:00
|
|
|
|
2001-12-07 22:34:06 -08:00
|
|
|
/* Make space for destination in file list */
|
|
|
|
dnd_num_files++;
|
|
|
|
REALLOC_PTR(dnd_files, dnd_num_files);
|
2002-03-03 02:40:07 -08:00
|
|
|
dnd_files[dnd_num_files - 1] = NULL;
|
2001-12-05 18:50:17 -08:00
|
|
|
|
2001-12-07 22:34:06 -08:00
|
|
|
/* Verify files are local, convert to non-URL */
|
2002-03-03 02:40:07 -08:00
|
|
|
for (in = 0, out = 0; in < dnd_num_files - 1; in++)
|
2001-12-07 22:34:06 -08:00
|
|
|
{
|
2002-03-03 02:40:07 -08:00
|
|
|
filename = e_util_de_url_and_verify(dnd_files[in]);
|
2001-12-07 22:34:06 -08:00
|
|
|
/* Need a overlap safe copy here, like memmove() */
|
2002-03-03 02:40:07 -08:00
|
|
|
if (filename)
|
|
|
|
memmove(dnd_files[out++], filename, strlen(filename) + 1);
|
2001-12-07 22:34:06 -08:00
|
|
|
}
|
2002-03-03 02:40:07 -08:00
|
|
|
|
2001-12-07 22:34:06 -08:00
|
|
|
/* Append destination for efsd */
|
2002-03-03 02:40:07 -08:00
|
|
|
if (dnd_files[out])
|
|
|
|
FREE(dnd_files[out]);
|
|
|
|
|
2002-03-06 12:44:48 -08:00
|
|
|
dnd_files[out++] = strdup(v->dir->dir);
|
2002-03-03 02:40:07 -08:00
|
|
|
|
|
|
|
switch (dnd_pending_mode)
|
|
|
|
{
|
|
|
|
case E_DND_COPY:
|
2001-12-07 22:34:06 -08:00
|
|
|
/* Copy files */
|
2002-03-03 02:40:07 -08:00
|
|
|
efsd_copy(e_fs_get_connection(), out, dnd_files, efsd_ops(0));
|
2001-12-12 15:58:45 -08:00
|
|
|
dnd_pending_mode = E_DND_COPIED;
|
2001-12-07 22:34:06 -08:00
|
|
|
break;
|
2002-03-03 02:40:07 -08:00
|
|
|
case E_DND_MOVE:
|
|
|
|
efsd_move(e_fs_get_connection(), out, dnd_files, efsd_ops(0));
|
2001-12-12 15:58:45 -08:00
|
|
|
dnd_pending_mode = E_DND_DELETED;
|
2001-12-07 22:34:06 -08:00
|
|
|
break;
|
2002-03-03 02:40:07 -08:00
|
|
|
case E_DND_ICONBAR_ADD:
|
|
|
|
e_iconbar_dnd_add_files(v, v_dnd_source, out, dnd_files);
|
|
|
|
/*FIXME: should this be ICONBAR_ADDED? */
|
|
|
|
dnd_pending_mode = E_DND_NONE;
|
|
|
|
default:
|
2001-12-07 22:34:06 -08:00
|
|
|
/* nothing yet */
|
|
|
|
break;
|
|
|
|
}
|
2001-12-12 15:58:45 -08:00
|
|
|
|
2002-03-03 02:40:07 -08:00
|
|
|
D_RETURN;
|
2001-12-05 18:50:17 -08:00
|
|
|
}
|