Make cvs stop bitching, and move the static functions back into the

headers. Headers are for functions shared across .c files. :P


SVN revision: 3970
This commit is contained in:
Term 2000-12-10 00:29:46 +00:00
parent cad2b0e407
commit a4698d23af
5 changed files with 1132 additions and 1030 deletions

15
.cvsignore Normal file
View File

@ -0,0 +1,15 @@
ABOUT-NLS
mkinstalldirs
missing
install-sh
aclocal.m4
Makefile.in
configure
config.log
intl
config.status
config.cache
Makefile
stamp-h
config.h
po

6
src/.cvsignore Normal file
View File

@ -0,0 +1,6 @@
e
*.o
*.lo
core
Makefile.in
Makefile

View File

@ -1,16 +1,14 @@
## Process this file with automake to produce Makefile.in ## Process this file with automake to produce Makefile.in
INCLUDES = \ INCLUDES = \
-I$(top_srcdir)/intl \ -I$(top_srcdir)/intl \
@evas_cflags@ @edb_cflags@ @ebits_cflags@ @ecore_cflags@ @evas_cflags@ @edb_cflags@ @ebits_cflags@ @ecore_cflags@
bin_PROGRAMS = e bin_PROGRAMS = e
e_SOURCES = \ e_SOURCES = \
actions.c \ actions.c \
actions.h \
border.c \ border.c \
border.h \
desktops.c \ desktops.c \
icccm.c \ icccm.c \
icccm.h \ icccm.h \

View File

@ -1,7 +1,61 @@
#include "e.h" #include "e.h"
#include "actions.h"
/* static prototypes */
static void _e_action_find(char *action, int act, int button, char *key, Ev_Key_Modifiers mods, void *o);
static void _e_action_free(E_Action *a);
static void e_act_move_start (void *o, E_Action *a, void *data, int x, int y, int rx, int ry);
static void e_act_move_stop (void *o, E_Action *a, void *data, int x, int y, int rx, int ry);
static void e_act_move_go (void *o, E_Action *a, void *data, int x, int y, int rx, int ry, int dx, int dy);
static void e_act_resize_start (void *o, E_Action *a, void *data, int x, int y,
int rx, int ry);
static void e_act_resize_stop (void *o, E_Action *a, void *data, int x, int y,
int rx, int ry);
static void e_act_resize_go (void *o, E_Action *a, void *data, int x, int y,
int rx, int ry, int dx, int dy);
static void e_act_resize_h_start (void *o, E_Action *a, void *data, int x, int y, int rx, int ry);
static void e_act_resize_h_stop (void *o, E_Action *a, void *data, int x, int y, int rx, int ry);
static void e_act_resize_h_go (void *o, E_Action *a, void *data, int x, int y, int rx, int ry, int dx, int dy);
static void e_act_resize_v_start (void *o, E_Action *a, void *data, int x, int y, int rx, int ry);
static void e_act_resize_v_stop (void *o, E_Action *a, void *data, int x, int y, int rx, int ry);
static void e_act_resize_v_go (void *o, E_Action *a, void *data, int x, int y, int rx, int ry, int dx, int dy);
static void e_act_close_start (void *o, E_Action *a, void *data, int x, int y, int rx, int ry);
static void e_act_kill_start (void *o, E_Action *a, void *data, int x, int y, int rx, int ry);
static void e_act_shade_start (void *o, E_Action *a, void *data, int x, int y, int rx, int ry);
static void e_act_raise_start (void *o, E_Action *a, void *data, int x, int y, int rx, int ry);
static void e_act_lower_start (void *o, E_Action *a, void *data, int x, int y, int rx, int ry);
static void e_act_raise_lower_start (void *o, E_Action *a, void *data, int x, int y, int rx, int ry);
static void e_act_exec_start (void *o, E_Action *a, void *data, int x, int y, int rx, int ry);
static void e_act_menu_start (void *o, E_Action *a, void *data, int x, int y, int rx, int ry);
static void e_act_exit_start (void *o, E_Action *a, void *data, int x, int y, int rx, int ry);
static void e_act_restart_start (void *o, E_Action *a, void *data, int x, int y, int rx, int ry);
static void e_act_stick_start (void *o, E_Action *a, void *data, int x, int y, int rx, int ry);
static void e_act_sound_start (void *o, E_Action *a, void *data, int x, int y, int rx, int ry);
static void e_act_iconify_start (void *o, E_Action *a, void *data, int x, int y, int rx, int ry);
static void e_act_max_start (void *o, E_Action *a, void *data, int x, int y, int rx, int ry);
static void e_act_snap_start (void *o, E_Action *a, void *data, int x, int y, int rx, int ry);
static void e_act_zoom_start (void *o, E_Action *a, void *data, int x, int y, int rx, int ry);
/* static globals */
static Evas_List action_protos = NULL; static Evas_List action_protos = NULL;
static Evas_List current_actions = NULL; static Evas_List current_actions = NULL;
@ -25,76 +79,76 @@ _e_action_find(char *action, int act, int button, char *key, Ev_Key_Modifiers mo
if (!e_db_int_get(db, "/actions/count", &num)) goto error; if (!e_db_int_get(db, "/actions/count", &num)) goto error;
for (i = 0; i < num; i++) for (i = 0; i < num; i++)
{ {
char buf[4096]; char buf[4096];
Evas_List l; Evas_List l;
a = NULL; a = NULL;
a = NULL; a = NULL;
sprintf(buf, "/actions/%i/name", i); sprintf(buf, "/actions/%i/name", i);
a_name = e_db_str_get(db, buf); a_name = e_db_str_get(db, buf);
sprintf(buf, "/actions/%i/action", i); sprintf(buf, "/actions/%i/action", i);
a_action = e_db_str_get(db, buf); a_action = e_db_str_get(db, buf);
sprintf(buf, "/actions/%i/params", i); sprintf(buf, "/actions/%i/params", i);
a_params = e_db_str_get(db, buf); a_params = e_db_str_get(db, buf);
sprintf(buf, "/actions/%i/event", i); sprintf(buf, "/actions/%i/event", i);
e_db_int_get(db, buf, &a_event); e_db_int_get(db, buf, &a_event);
sprintf(buf, "/actions/%i/button", i); sprintf(buf, "/actions/%i/button", i);
e_db_int_get(db, buf, &a_button); e_db_int_get(db, buf, &a_button);
sprintf(buf, "/actions/%i/key", i); sprintf(buf, "/actions/%i/key", i);
a_key = e_db_str_get(db, buf); a_key = e_db_str_get(db, buf);
sprintf(buf, "/actions/%i/modifiers", i); sprintf(buf, "/actions/%i/modifiers", i);
e_db_int_get(db, buf, &a_modifiers); e_db_int_get(db, buf, &a_modifiers);
if (act != a_event) goto next; if (act != a_event) goto next;
if (!((a_name) && if (!((a_name) &&
(action) && (action) &&
(!strcmp(a_name, action)))) goto next; (!strcmp(a_name, action)))) goto next;
if ((act >= ACT_MOUSE_CLICK) && if ((act >= ACT_MOUSE_CLICK) &&
(act <= ACT_MOUSE_CLICKED) && (act <= ACT_MOUSE_CLICKED) &&
(!((a_button == -1) || (!((a_button == -1) ||
(a_button == button)))) goto next; (a_button == button)))) goto next;
if ((act >= ACT_KEY_DOWN) && if ((act >= ACT_KEY_DOWN) &&
(act <= ACT_KEY_UP) && (act <= ACT_KEY_UP) &&
(!((a_key) && (key) && (!((a_key) && (key) &&
(!strcmp(a_key, key))))) goto next; (!strcmp(a_key, key))))) goto next;
if ((act >= ACT_MOUSE_CLICK) && if ((act >= ACT_MOUSE_CLICK) &&
(act <= ACT_KEY_UP) && (act <= ACT_KEY_UP) &&
(!((a_modifiers == -1) || (!((a_modifiers == -1) ||
(a_modifiers == (int)mods)))) goto next; (a_modifiers == (int)mods)))) goto next;
for (l = action_protos; l; l = l->next) for (l = action_protos; l; l = l->next)
{ {
E_Action_Proto *ap; E_Action_Proto *ap;
ap = l->data; ap = l->data;
if (!strcmp(ap->action, a_action)) if (!strcmp(ap->action, a_action))
{ {
a = NEW(E_Action, 1); a = NEW(E_Action, 1);
ZERO(a, E_Action, 1); ZERO(a, E_Action, 1);
OBJ_INIT(a, _e_action_free); OBJ_INIT(a, _e_action_free);
a->name = a_name; a->name = a_name;
a->action = a_action; a->action = a_action;
a->params = a_params; a->params = a_params;
a->event = a_event; a->event = a_event;
a->button = a_button; a->button = a_button;
a->key = a_key; a->key = a_key;
a->modifiers = a_modifiers; a->modifiers = a_modifiers;
a->action_proto = ap; a->action_proto = ap;
a->object = o; a->object = o;
a->started = 0; a->started = 0;
current_actions = evas_list_append(current_actions, a); current_actions = evas_list_append(current_actions, a);
} }
} }
next: next:
if (!a) if (!a)
{ {
IF_FREE(a_name); IF_FREE(a_name);
IF_FREE(a_action); IF_FREE(a_action);
IF_FREE(a_params); IF_FREE(a_params);
IF_FREE(a_key); IF_FREE(a_key);
} }
} }
error: error:
e_db_close(db); e_db_close(db);
@ -119,32 +173,32 @@ e_action_start(char *action, int act, int button, char *key, Ev_Key_Modifiers mo
again: again:
for (l = current_actions; l; l = l->next) for (l = current_actions; l; l = l->next)
{ {
E_Action *a; E_Action *a;
a = l->data; a = l->data;
if (!a->started) if (!a->started)
{ {
if (a->action_proto->func_stop) if (a->action_proto->func_stop)
a->started = 1; a->started = 1;
if (a->action_proto->func_start) if (a->action_proto->func_start)
{ {
E_Object *obj; E_Object *obj;
if (a->object) if (a->object)
{ {
obj = a->object; obj = a->object;
if (a->started) if (a->started)
OBJ_REF(obj); OBJ_REF(obj);
} }
a->action_proto->func_start(a->object, a, data, x, y, rx, ry); a->action_proto->func_start(a->object, a, data, x, y, rx, ry);
} }
} }
if (!a->started) if (!a->started)
{ {
current_actions = evas_list_remove(current_actions, a); current_actions = evas_list_remove(current_actions, a);
OBJ_DO_FREE(a); OBJ_DO_FREE(a);
goto again; goto again;
} }
} }
} }
@ -156,58 +210,58 @@ e_action_stop(char *action, int act, int button, char *key, Ev_Key_Modifiers mod
again: again:
for (l = current_actions; l; l = l->next) for (l = current_actions; l; l = l->next)
{ {
E_Action *a; E_Action *a;
a = l->data; a = l->data;
if ((a->started) && (a->action_proto->func_stop)) if ((a->started) && (a->action_proto->func_stop))
{ {
int ok = 0; int ok = 0;
if ((a->event == ACT_MOUSE_IN) && if ((a->event == ACT_MOUSE_IN) &&
(act == ACT_MOUSE_OUT)) (act == ACT_MOUSE_OUT))
ok = 1; ok = 1;
if ((a->event == ACT_MOUSE_OUT) && if ((a->event == ACT_MOUSE_OUT) &&
(act == ACT_MOUSE_IN)) (act == ACT_MOUSE_IN))
ok = 1; ok = 1;
if ((a->event >= ACT_MOUSE_CLICK) && if ((a->event >= ACT_MOUSE_CLICK) &&
(a->event <= ACT_MOUSE_TRIPLE) && (a->event <= ACT_MOUSE_TRIPLE) &&
(act >= ACT_MOUSE_UP) && (act >= ACT_MOUSE_UP) &&
(act <= ACT_MOUSE_CLICKED) && (act <= ACT_MOUSE_CLICKED) &&
(a->button == button)) (a->button == button))
ok = 1; ok = 1;
if ((a->event == ACT_MOUSE_MOVE) && if ((a->event == ACT_MOUSE_MOVE) &&
((act == ACT_MOUSE_OUT) || ((act == ACT_MOUSE_OUT) ||
(act == ACT_MOUSE_IN) || (act == ACT_MOUSE_IN) ||
((act >= ACT_MOUSE_CLICK) && ((act >= ACT_MOUSE_CLICK) &&
(act <= ACT_MOUSE_TRIPLE)) || (act <= ACT_MOUSE_TRIPLE)) ||
(act >= ACT_MOUSE_UP))) (act >= ACT_MOUSE_UP)))
ok = 1; ok = 1;
if ((a->event == ACT_KEY_DOWN) && if ((a->event == ACT_KEY_DOWN) &&
(act == ACT_KEY_UP) && (act == ACT_KEY_UP) &&
(key) && (a->key) && (!strcmp(key, a->key))) (key) && (a->key) && (!strcmp(key, a->key)))
ok = 1; ok = 1;
if ((a->event == ACT_KEY_UP) && if ((a->event == ACT_KEY_UP) &&
(act == ACT_KEY_DOWN)) (act == ACT_KEY_DOWN))
ok = 1; ok = 1;
if (ok) if (ok)
{ {
E_Object *obj; E_Object *obj;
if (a->object) if (a->object)
{ {
obj = a->object; obj = a->object;
OBJ_UNREF(obj); OBJ_UNREF(obj);
} }
a->action_proto->func_stop(a->object, a, data, x, y, rx, ry); a->action_proto->func_stop(a->object, a, data, x, y, rx, ry);
a->started = 0; a->started = 0;
} }
} }
if (!a->started) if (!a->started)
{ {
current_actions = evas_list_remove(current_actions, a); current_actions = evas_list_remove(current_actions, a);
OBJ_DO_FREE(a); OBJ_DO_FREE(a);
goto again; goto again;
} }
} }
} }
@ -218,11 +272,11 @@ e_action_go(char *action, int act, int button, char *key, Ev_Key_Modifiers mods,
for (l = current_actions; l; l = l->next) for (l = current_actions; l; l = l->next)
{ {
E_Action *a; E_Action *a;
a = l->data; a = l->data;
if ((a->started) && (a->action_proto->func_go)) if ((a->started) && (a->action_proto->func_go))
a->action_proto->func_go(a->object, a, data, x, y, rx, ry, dx, dy); a->action_proto->func_go(a->object, a, data, x, y, rx, ry, dx, dy);
} }
} }
@ -234,33 +288,33 @@ e_action_stop_by_object(void *o, void *data, int x, int y, int rx, int ry)
again: again:
for (l = current_actions; l; l = l->next) for (l = current_actions; l; l = l->next)
{ {
E_Action *a; E_Action *a;
a = l->data; a = l->data;
if ((a->started) && (o == a->object)) if ((a->started) && (o == a->object))
{ {
E_Object *obj; E_Object *obj;
if (a->object) if (a->object)
{ {
obj = a->object; obj = a->object;
OBJ_UNREF(obj); OBJ_UNREF(obj);
} }
if (a->action_proto->func_stop) if (a->action_proto->func_stop)
a->action_proto->func_stop(a->object, a, data, x, y, rx, ry); a->action_proto->func_stop(a->object, a, data, x, y, rx, ry);
a->started = 0; a->started = 0;
current_actions = evas_list_remove(current_actions, a); current_actions = evas_list_remove(current_actions, a);
OBJ_DO_FREE(a); OBJ_DO_FREE(a);
goto again; goto again;
} }
} }
} }
void void
e_action_add_proto(char *action, e_action_add_proto(char *action,
void (*func_start) (void *o, E_Action *a, void *data, int x, int y, int rx, int ry), void (*func_start) (void *o, E_Action *a, void *data, int x, int y, int rx, int ry),
void (*func_stop) (void *o, E_Action *a, void *data, int x, int y, int rx, int ry), void (*func_stop) (void *o, E_Action *a, void *data, int x, int y, int rx, int ry),
void (*func_go) (void *o, E_Action *a, void *data, int x, int y, int rx, int ry, int dx, int dy)) void (*func_go) (void *o, E_Action *a, void *data, int x, int y, int rx, int ry, int dx, int dy))
{ {
E_Action_Proto *ap; E_Action_Proto *ap;
@ -363,29 +417,29 @@ e_act_resize_start (void *o, E_Action *a, void *data, int x, int y, int rx, int
/* 2 | 3 */ /* 2 | 3 */
if (x > (b->current.w / 2)) if (x > (b->current.w / 2))
{ {
if (y > (b->current.h / 2)) if (y > (b->current.h / 2))
{ {
b->mode.resize = 3; b->mode.resize = 3;
SET_BORDER_GRAVITY(b, NorthWestGravity); SET_BORDER_GRAVITY(b, NorthWestGravity);
} }
else else
{ {
b->mode.resize = 1; b->mode.resize = 1;
SET_BORDER_GRAVITY(b, SouthWestGravity); SET_BORDER_GRAVITY(b, SouthWestGravity);
} }
} }
else else
{ {
if (y > (b->current.h / 2)) if (y > (b->current.h / 2))
{ {
b->mode.resize = 2; b->mode.resize = 2;
SET_BORDER_GRAVITY(b, NorthEastGravity); SET_BORDER_GRAVITY(b, NorthEastGravity);
} }
else else
{ {
b->mode.resize = 0; b->mode.resize = 0;
SET_BORDER_GRAVITY(b, SouthEastGravity); SET_BORDER_GRAVITY(b, SouthEastGravity);
} }
} }
} }
@ -412,27 +466,27 @@ e_act_resize_go (void *o, E_Action *a, void *data, int x, int y, int rx, int
b = o; b = o;
if (b->mode.resize == 0) if (b->mode.resize == 0)
{ {
b->current.requested.w -= dx; b->current.requested.w -= dx;
b->current.requested.h -= dy; b->current.requested.h -= dy;
b->current.requested.x += dx; b->current.requested.x += dx;
b->current.requested.y += dy; b->current.requested.y += dy;
} }
else if (b->mode.resize == 1) else if (b->mode.resize == 1)
{ {
b->current.requested.w += dx; b->current.requested.w += dx;
b->current.requested.h -= dy; b->current.requested.h -= dy;
b->current.requested.y += dy; b->current.requested.y += dy;
} }
else if (b->mode.resize == 2) else if (b->mode.resize == 2)
{ {
b->current.requested.w -= dx; b->current.requested.w -= dx;
b->current.requested.h += dy; b->current.requested.h += dy;
b->current.requested.x += dx; b->current.requested.x += dx;
} }
else if (b->mode.resize == 3) else if (b->mode.resize == 3)
{ {
b->current.requested.w += dx; b->current.requested.w += dx;
b->current.requested.h += dy; b->current.requested.h += dy;
} }
b->changed = 1; b->changed = 1;
e_border_adjust_limits(b); e_border_adjust_limits(b);
@ -448,13 +502,13 @@ e_act_resize_h_start (void *o, E_Action *a, void *data, int x, int y, int rx, in
/* 4 | 5 */ /* 4 | 5 */
if (x > (b->current.w / 2)) if (x > (b->current.w / 2))
{ {
b->mode.resize = 5; b->mode.resize = 5;
SET_BORDER_GRAVITY(b, NorthWestGravity); SET_BORDER_GRAVITY(b, NorthWestGravity);
} }
else else
{ {
b->mode.resize = 4; b->mode.resize = 4;
SET_BORDER_GRAVITY(b, NorthEastGravity); SET_BORDER_GRAVITY(b, NorthEastGravity);
} }
} }
@ -481,12 +535,12 @@ e_act_resize_h_go (void *o, E_Action *a, void *data, int x, int y, int rx, in
b = o; b = o;
if (b->mode.resize == 4) if (b->mode.resize == 4)
{ {
b->current.requested.w -= dx; b->current.requested.w -= dx;
b->current.requested.x += dx; b->current.requested.x += dx;
} }
else if (b->mode.resize == 5) else if (b->mode.resize == 5)
{ {
b->current.requested.w += dx; b->current.requested.w += dx;
} }
b->changed = 1; b->changed = 1;
e_border_adjust_limits(b); e_border_adjust_limits(b);
@ -504,13 +558,13 @@ e_act_resize_v_start (void *o, E_Action *a, void *data, int x, int y, int rx, in
/* 7 */ /* 7 */
if (y > (b->current.h / 2)) if (y > (b->current.h / 2))
{ {
b->mode.resize = 7; b->mode.resize = 7;
SET_BORDER_GRAVITY(b, NorthWestGravity); SET_BORDER_GRAVITY(b, NorthWestGravity);
} }
else else
{ {
b->mode.resize = 6; b->mode.resize = 6;
SET_BORDER_GRAVITY(b, SouthWestGravity); SET_BORDER_GRAVITY(b, SouthWestGravity);
} }
} }
@ -537,12 +591,12 @@ e_act_resize_v_go (void *o, E_Action *a, void *data, int x, int y, int rx, in
b = o; b = o;
if (b->mode.resize == 6) if (b->mode.resize == 6)
{ {
b->current.requested.h -= dy; b->current.requested.h -= dy;
b->current.requested.y += dy; b->current.requested.y += dy;
} }
else if (b->mode.resize == 7) else if (b->mode.resize == 7)
{ {
b->current.requested.h += dy; b->current.requested.h += dy;
} }
e_border_adjust_limits(b); e_border_adjust_limits(b);
b->changed = 1; b->changed = 1;

File diff suppressed because it is too large Load Diff