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
devs/princeamd/enlightenment-0.17-elive
Term 22 years ago
parent cad2b0e407
commit a4698d23af
  1. 15
      .cvsignore
  2. 6
      src/.cvsignore
  3. 6
      src/Makefile.am
  4. 498
      src/actions.c
  5. 1645
      src/border.c

@ -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

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

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

@ -1,7 +1,61 @@
#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 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;
for (i = 0; i < num; i++)
{
char buf[4096];
Evas_List l;
a = NULL;
a = NULL;
sprintf(buf, "/actions/%i/name", i);
a_name = e_db_str_get(db, buf);
sprintf(buf, "/actions/%i/action", i);
a_action = e_db_str_get(db, buf);
sprintf(buf, "/actions/%i/params", i);
a_params = e_db_str_get(db, buf);
sprintf(buf, "/actions/%i/event", i);
e_db_int_get(db, buf, &a_event);
sprintf(buf, "/actions/%i/button", i);
e_db_int_get(db, buf, &a_button);
sprintf(buf, "/actions/%i/key", i);
a_key = e_db_str_get(db, buf);
sprintf(buf, "/actions/%i/modifiers", i);
e_db_int_get(db, buf, &a_modifiers);
if (act != a_event) goto next;
if (!((a_name) &&
(action) &&
(!strcmp(a_name, action)))) goto next;
if ((act >= ACT_MOUSE_CLICK) &&
(act <= ACT_MOUSE_CLICKED) &&
(!((a_button == -1) ||
(a_button == button)))) goto next;
if ((act >= ACT_KEY_DOWN) &&
(act <= ACT_KEY_UP) &&
(!((a_key) && (key) &&
(!strcmp(a_key, key))))) goto next;
if ((act >= ACT_MOUSE_CLICK) &&
(act <= ACT_KEY_UP) &&
(!((a_modifiers == -1) ||
(a_modifiers == (int)mods)))) goto next;
for (l = action_protos; l; l = l->next)
{
E_Action_Proto *ap;
ap = l->data;
if (!strcmp(ap->action, a_action))
{
a = NEW(E_Action, 1);
ZERO(a, E_Action, 1);
OBJ_INIT(a, _e_action_free);
a->name = a_name;
a->action = a_action;
a->params = a_params;
a->event = a_event;
a->button = a_button;
a->key = a_key;
a->modifiers = a_modifiers;
a->action_proto = ap;
a->object = o;
a->started = 0;
current_actions = evas_list_append(current_actions, a);
}
}
next:
if (!a)
{
IF_FREE(a_name);
IF_FREE(a_action);
IF_FREE(a_params);
IF_FREE(a_key);
}
char buf[4096];
Evas_List l;
a = NULL;
a = NULL;
sprintf(buf, "/actions/%i/name", i);
a_name = e_db_str_get(db, buf);
sprintf(buf, "/actions/%i/action", i);
a_action = e_db_str_get(db, buf);
sprintf(buf, "/actions/%i/params", i);
a_params = e_db_str_get(db, buf);
sprintf(buf, "/actions/%i/event", i);
e_db_int_get(db, buf, &a_event);
sprintf(buf, "/actions/%i/button", i);
e_db_int_get(db, buf, &a_button);
sprintf(buf, "/actions/%i/key", i);
a_key = e_db_str_get(db, buf);
sprintf(buf, "/actions/%i/modifiers", i);
e_db_int_get(db, buf, &a_modifiers);
if (act != a_event) goto next;
if (!((a_name) &&
(action) &&
(!strcmp(a_name, action)))) goto next;
if ((act >= ACT_MOUSE_CLICK) &&
(act <= ACT_MOUSE_CLICKED) &&
(!((a_button == -1) ||
(a_button == button)))) goto next;
if ((act >= ACT_KEY_DOWN) &&
(act <= ACT_KEY_UP) &&
(!((a_key) && (key) &&
(!strcmp(a_key, key))))) goto next;
if ((act >= ACT_MOUSE_CLICK) &&
(act <= ACT_KEY_UP) &&
(!((a_modifiers == -1) ||
(a_modifiers == (int)mods)))) goto next;
for (l = action_protos; l; l = l->next)
{
E_Action_Proto *ap;
ap = l->data;
if (!strcmp(ap->action, a_action))
{
a = NEW(E_Action, 1);
ZERO(a, E_Action, 1);
OBJ_INIT(a, _e_action_free);
a->name = a_name;
a->action = a_action;
a->params = a_params;
a->event = a_event;
a->button = a_button;
a->key = a_key;
a->modifiers = a_modifiers;
a->action_proto = ap;
a->object = o;
a->started = 0;
current_actions = evas_list_append(current_actions, a);
}
}
next:
if (!a)
{
IF_FREE(a_name);
IF_FREE(a_action);
IF_FREE(a_params);
IF_FREE(a_key);
}
}
error:
e_db_close(db);
@ -119,32 +173,32 @@ e_action_start(char *action, int act, int button, char *key, Ev_Key_Modifiers mo
again:
for (l = current_actions; l; l = l->next)
{
E_Action *a;
a = l->data;
if (!a->started)
{
if (a->action_proto->func_stop)
a->started = 1;
if (a->action_proto->func_start)
{
E_Object *obj;
if (a->object)
{
obj = a->object;
if (a->started)
OBJ_REF(obj);
}
a->action_proto->func_start(a->object, a, data, x, y, rx, ry);
}
}
if (!a->started)
{
current_actions = evas_list_remove(current_actions, a);
OBJ_DO_FREE(a);
goto again;
}
E_Action *a;
a = l->data;
if (!a->started)
{
if (a->action_proto->func_stop)
a->started = 1;
if (a->action_proto->func_start)
{
E_Object *obj;
if (a->object)
{
obj = a->object;
if (a->started)
OBJ_REF(obj);
}
a->action_proto->func_start(a->object, a, data, x, y, rx, ry);
}
}
if (!a->started)
{
current_actions = evas_list_remove(current_actions, a);
OBJ_DO_FREE(a);
goto again;
}
}
}
@ -156,58 +210,58 @@ e_action_stop(char *action, int act, int button, char *key, Ev_Key_Modifiers mod
again:
for (l = current_actions; l; l = l->next)
{
E_Action *a;
a = l->data;
if ((a->started) && (a->action_proto->func_stop))
{
int ok = 0;
if ((a->event == ACT_MOUSE_IN) &&
(act == ACT_MOUSE_OUT))
ok = 1;
if ((a->event == ACT_MOUSE_OUT) &&
(act == ACT_MOUSE_IN))
ok = 1;
if ((a->event >= ACT_MOUSE_CLICK) &&
(a->event <= ACT_MOUSE_TRIPLE) &&
(act >= ACT_MOUSE_UP) &&
(act <= ACT_MOUSE_CLICKED) &&
(a->button == button))
ok = 1;
if ((a->event == ACT_MOUSE_MOVE) &&
((act == ACT_MOUSE_OUT) ||
(act == ACT_MOUSE_IN) ||
((act >= ACT_MOUSE_CLICK) &&
(act <= ACT_MOUSE_TRIPLE)) ||
(act >= ACT_MOUSE_UP)))
ok = 1;
if ((a->event == ACT_KEY_DOWN) &&
(act == ACT_KEY_UP) &&
(key) && (a->key) && (!strcmp(key, a->key)))
ok = 1;
if ((a->event == ACT_KEY_UP) &&
(act == ACT_KEY_DOWN))
ok = 1;
if (ok)
{
E_Object *obj;
if (a->object)
{
obj = a->object;
OBJ_UNREF(obj);
}
a->action_proto->func_stop(a->object, a, data, x, y, rx, ry);
a->started = 0;
}
}
if (!a->started)
{
current_actions = evas_list_remove(current_actions, a);
OBJ_DO_FREE(a);
goto again;
}
E_Action *a;
a = l->data;
if ((a->started) && (a->action_proto->func_stop))
{
int ok = 0;
if ((a->event == ACT_MOUSE_IN) &&
(act == ACT_MOUSE_OUT))
ok = 1;
if ((a->event == ACT_MOUSE_OUT) &&
(act == ACT_MOUSE_IN))
ok = 1;
if ((a->event >= ACT_MOUSE_CLICK) &&
(a->event <= ACT_MOUSE_TRIPLE) &&
(act >= ACT_MOUSE_UP) &&
(act <= ACT_MOUSE_CLICKED) &&
(a->button == button))
ok = 1;
if ((a->event == ACT_MOUSE_MOVE) &&
((act == ACT_MOUSE_OUT) ||
(act == ACT_MOUSE_IN) ||
((act >= ACT_MOUSE_CLICK) &&
(act <= ACT_MOUSE_TRIPLE)) ||
(act >= ACT_MOUSE_UP)))
ok = 1;
if ((a->event == ACT_KEY_DOWN) &&
(act == ACT_KEY_UP) &&
(key) && (a->key) && (!strcmp(key, a->key)))
ok = 1;
if ((a->event == ACT_KEY_UP) &&
(act == ACT_KEY_DOWN))
ok = 1;
if (ok)
{
E_Object *obj;
if (a->object)
{
obj = a->object;
OBJ_UNREF(obj);
}
a->action_proto->func_stop(a->object, a, data, x, y, rx, ry);
a->started = 0;
}
}
if (!a->started)
{
current_actions = evas_list_remove(current_actions, a);
OBJ_DO_FREE(a);
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)
{
E_Action *a;
a = l->data;
if ((a->started) && (a->action_proto->func_go))
a->action_proto->func_go(a->object, a, data, x, y, rx, ry, dx, dy);
E_Action *a;
a = l->data;
if ((a->started) && (a->action_proto->func_go))
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:
for (l = current_actions; l; l = l->next)
{
E_Action *a;
a = l->data;
if ((a->started) && (o == a->object))
{
E_Object *obj;
if (a->object)
{
obj = a->object;
OBJ_UNREF(obj);
}
if (a->action_proto->func_stop)
a->action_proto->func_stop(a->object, a, data, x, y, rx, ry);
a->started = 0;
current_actions = evas_list_remove(current_actions, a);
OBJ_DO_FREE(a);
goto again;
}
E_Action *a;
a = l->data;
if ((a->started) && (o == a->object))
{
E_Object *obj;
if (a->object)
{
obj = a->object;
OBJ_UNREF(obj);
}
if (a->action_proto->func_stop)
a->action_proto->func_stop(a->object, a, data, x, y, rx, ry);
a->started = 0;
current_actions = evas_list_remove(current_actions, a);
OBJ_DO_FREE(a);
goto again;
}
}
}
void
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_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_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_go) (void *o, E_Action *a, void *data, int x, int y, int rx, int ry, int dx, int dy))
{
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 */
if (x > (b->current.w / 2))
{
if (y > (b->current.h / 2))
{
b->mode.resize = 3;
SET_BORDER_GRAVITY(b, NorthWestGravity);
}
else
{
b->mode.resize = 1;
SET_BORDER_GRAVITY(b, SouthWestGravity);
}
if (y > (b->current.h / 2))
{
b->mode.resize = 3;
SET_BORDER_GRAVITY(b, NorthWestGravity);
}
else
{
b->mode.resize = 1;
SET_BORDER_GRAVITY(b, SouthWestGravity);
}
}
else
{
if (y > (b->current.h / 2))
{
b->mode.resize = 2;
SET_BORDER_GRAVITY(b, NorthEastGravity);
}
else
{
b->mode.resize = 0;
SET_BORDER_GRAVITY(b, SouthEastGravity);
}
if (y > (b->current.h / 2))
{
b->mode.resize = 2;
SET_BORDER_GRAVITY(b, NorthEastGravity);
}
else
{
b->mode.resize = 0;
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;
if (b->mode.resize == 0)
{
b->current.requested.w -= dx;
b->current.requested.h -= dy;
b->current.requested.x += dx;
b->current.requested.y += dy;
b->current.requested.w -= dx;
b->current.requested.h -= dy;
b->current.requested.x += dx;
b->current.requested.y += dy;
}
else if (b->mode.resize == 1)
{
b->current.requested.w += dx;
b->current.requested.h -= dy;
b->current.requested.y += dy;
b->current.requested.w += dx;
b->current.requested.h -= dy;
b->current.requested.y += dy;
}
else if (b->mode.resize == 2)
{
b->current.requested.w -= dx;
b->current.requested.h += dy;
b->current.requested.x += dx;
b->current.requested.w -= dx;
b->current.requested.h += dy;
b->current.requested.x += dx;
}
else if (b->mode.resize == 3)
{
b->current.requested.w += dx;
b->current.requested.h += dy;
b->current.requested.w += dx;
b->current.requested.h += dy;
}
b->changed = 1;
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 */
if (x > (b->current.w / 2))
{
b->mode.resize = 5;
SET_BORDER_GRAVITY(b, NorthWestGravity);
b->mode.resize = 5;
SET_BORDER_GRAVITY(b, NorthWestGravity);
}
else
{
b->mode.resize = 4;
SET_BORDER_GRAVITY(b, NorthEastGravity);
b->mode.resize = 4;
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;
if (b->mode.resize == 4)
{
b->current.requested.w -= dx;
b->current.requested.x += dx;
b->current.requested.w -= dx;
b->current.requested.x += dx;
}
else if (b->mode.resize == 5)
{
b->current.requested.w += dx;
b->current.requested.w += dx;
}
b->changed = 1;
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 */
if (y > (b->current.h / 2))
{
b->mode.resize = 7;
SET_BORDER_GRAVITY(b, NorthWestGravity);
b->mode.resize = 7;
SET_BORDER_GRAVITY(b, NorthWestGravity);
}
else
{
b->mode.resize = 6;
SET_BORDER_GRAVITY(b, SouthWestGravity);
b->mode.resize = 6;
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;
if (b->mode.resize == 6)
{
b->current.requested.h -= dy;
b->current.requested.y += dy;
b->current.requested.h -= dy;
b->current.requested.y += dy;
}
else if (b->mode.resize == 7)
{
b->current.requested.h += dy;
b->current.requested.h += dy;
}
e_border_adjust_limits(b);
b->changed = 1;

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save