Formatting & whitespace removal.

No need to call all these _inits() as E already handles init'n those.
Don't need the extra headers included here either as they are already
included via e.h.



SVN revision: 45268
This commit is contained in:
Christopher Michael 2010-01-17 20:21:42 +00:00
parent 205308dd9f
commit 8d1f4a54af
4 changed files with 89 additions and 122 deletions

View File

@ -1,6 +1,5 @@
#include "e.h" #include "e.h"
/***************************************************************************/
typedef struct _Instance Instance; typedef struct _Instance Instance;
struct _Instance struct _Instance
@ -11,8 +10,6 @@ struct _Instance
int on; int on;
}; };
/***************************************************************************/
/**/
/* gadcon requirements */ /* gadcon requirements */
static E_Gadcon_Client *_gc_init(E_Gadcon *gc, const char *name, const char *id, const char *style); static E_Gadcon_Client *_gc_init(E_Gadcon *gc, const char *name, const char *id, const char *style);
static void _gc_shutdown(E_Gadcon_Client *gcc); static void _gc_shutdown(E_Gadcon_Client *gcc);
@ -32,8 +29,6 @@ static const E_Gadcon_Client_Class _gadcon_class =
E_GADCON_CLIENT_STYLE_PLAIN E_GADCON_CLIENT_STYLE_PLAIN
}; };
static E_Module *mod = NULL; static E_Module *mod = NULL;
/**/
/***************************************************************************/
static int _cb_poll(void *data); static int _cb_poll(void *data);
@ -57,14 +52,14 @@ static Evas_Object *
_theme_obj_new(Evas *e, const char *custom_dir, const char *group) _theme_obj_new(Evas *e, const char *custom_dir, const char *group)
{ {
Evas_Object *o; Evas_Object *o;
o = edje_object_add(e); o = edje_object_add(e);
if (!e_theme_edje_object_set(o, "base/theme/modules/illume", group)) if (!e_theme_edje_object_set(o, "base/theme/modules/illume", group))
{ {
if (custom_dir) if (custom_dir)
{ {
char buf[PATH_MAX]; char buf[PATH_MAX];
snprintf(buf, sizeof(buf), "%s/illume.edj", custom_dir); snprintf(buf, sizeof(buf), "%s/illume.edj", custom_dir);
if (edje_object_file_set(o, buf, group)) if (edje_object_file_set(o, buf, group))
{ {
@ -81,7 +76,7 @@ _gc_init(E_Gadcon *gc, const char *name, const char *id, const char *style)
Evas_Object *o; Evas_Object *o;
E_Gadcon_Client *gcc; E_Gadcon_Client *gcc;
Instance *inst; Instance *inst;
inst = E_NEW(Instance, 1); inst = E_NEW(Instance, 1);
o = _theme_obj_new(gc->evas, e_module_dir_get(mod), o = _theme_obj_new(gc->evas, e_module_dir_get(mod),
"e/modules/illume/gadget/bluetooth"); "e/modules/illume/gadget/bluetooth");
@ -94,7 +89,7 @@ _gc_init(E_Gadcon *gc, const char *name, const char *id, const char *style)
inst->on = -1; inst->on = -1;
inst->poller = ecore_poller_add(ECORE_POLLER_CORE, 16, _cb_poll, inst); inst->poller = ecore_poller_add(ECORE_POLLER_CORE, 16, _cb_poll, inst);
return gcc; return gcc;
} }
@ -102,7 +97,7 @@ static void
_gc_shutdown(E_Gadcon_Client *gcc) _gc_shutdown(E_Gadcon_Client *gcc)
{ {
Instance *inst; Instance *inst;
inst = gcc->data; inst = gcc->data;
ecore_poller_del(inst->poller); ecore_poller_del(inst->poller);
evas_object_del(inst->obj); evas_object_del(inst->obj);
@ -114,7 +109,7 @@ _gc_orient(E_Gadcon_Client *gcc, E_Gadcon_Orient orient)
{ {
Instance *inst; Instance *inst;
Evas_Coord mw, mh, mxw, mxh; Evas_Coord mw, mh, mxw, mxh;
inst = gcc->data; inst = gcc->data;
mw = 0, mh = 0; mw = 0, mh = 0;
edje_object_size_min_get(inst->obj, &mw, &mh); edje_object_size_min_get(inst->obj, &mw, &mh);
@ -160,14 +155,14 @@ static int
_find_interface_class(int iclass) _find_interface_class(int iclass)
{ {
Eina_List *devs; Eina_List *devs;
char *name; char *name;
devs = ecore_file_ls("/sys/bus/usb/devices"); devs = ecore_file_ls("/sys/bus/usb/devices");
EINA_LIST_FREE(devs, name) EINA_LIST_FREE(devs, name)
{ {
char buf[PATH_MAX]; char buf[PATH_MAX];
FILE *f; FILE *f;
snprintf(buf, sizeof(buf), "%s/%s/%s", snprintf(buf, sizeof(buf), "%s/%s/%s",
"/sys/bus/usb/devices", name, "bInterfaceClass"); "/sys/bus/usb/devices", name, "bInterfaceClass");
f = fopen(buf, "r"); f = fopen(buf, "r");
@ -176,12 +171,12 @@ _find_interface_class(int iclass)
if (fgets(buf, sizeof(buf), f)) if (fgets(buf, sizeof(buf), f))
{ {
int id = -1; int id = -1;
sscanf(buf, "%x", &id); sscanf(buf, "%x", &id);
if (iclass == id) if (iclass == id)
{ {
EINA_LIST_FREE(devs, name) EINA_LIST_FREE(devs, name)
free(name); free(name);
fclose(f); fclose(f);
return 1; return 1;
} }
@ -199,7 +194,7 @@ _cb_poll(void *data)
{ {
Instance *inst; Instance *inst;
int pon; int pon;
inst = data; inst = data;
/* FIXME: get bt status and emit signal */ /* FIXME: get bt status and emit signal */
pon = inst->on; pon = inst->on;

View File

@ -1,10 +1,5 @@
#include "e.h" #include "e.h"
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
static E_DBus_Connection *conn = NULL; static E_DBus_Connection *conn = NULL;
static E_DBus_Connection *conn_system = NULL; static E_DBus_Connection *conn_system = NULL;
static E_DBus_Signal_Handler *changed_h = NULL; static E_DBus_Signal_Handler *changed_h = NULL;
@ -25,7 +20,6 @@ typedef enum _Phone_Sys
static Phone_Sys detected_system = PH_SYS_UNKNOWN; static Phone_Sys detected_system = PH_SYS_UNKNOWN;
/***************************************************************************/
typedef struct _Instance Instance; typedef struct _Instance Instance;
struct _Instance struct _Instance
@ -36,8 +30,6 @@ struct _Instance
char *oper; char *oper;
}; };
/***************************************************************************/
/**/
/* gadcon requirements */ /* gadcon requirements */
static E_Gadcon_Client *_gc_init(E_Gadcon *gc, const char *name, const char *id, const char *style); static E_Gadcon_Client *_gc_init(E_Gadcon *gc, const char *name, const char *id, const char *style);
static void _gc_shutdown(E_Gadcon_Client *gcc); static void _gc_shutdown(E_Gadcon_Client *gcc);
@ -57,8 +49,6 @@ static const E_Gadcon_Client_Class _gadcon_class =
E_GADCON_CLIENT_STYLE_PLAIN E_GADCON_CLIENT_STYLE_PLAIN
}; };
static E_Module *mod = NULL; static E_Module *mod = NULL;
/**/
/***************************************************************************/
static int try_again(void *data); static int try_again(void *data);
static void *signal_unmarhsall(DBusMessage *msg, DBusError *err); static void *signal_unmarhsall(DBusMessage *msg, DBusError *err);
@ -106,14 +96,14 @@ static Evas_Object *
_theme_obj_new(Evas *e, const char *custom_dir, const char *group) _theme_obj_new(Evas *e, const char *custom_dir, const char *group)
{ {
Evas_Object *o; Evas_Object *o;
o = edje_object_add(e); o = edje_object_add(e);
if (!e_theme_edje_object_set(o, "base/theme/modules/illume", group)) if (!e_theme_edje_object_set(o, "base/theme/modules/illume", group))
{ {
if (custom_dir) if (custom_dir)
{ {
char buf[PATH_MAX]; char buf[PATH_MAX];
snprintf(buf, sizeof(buf), "%s/illume.edj", custom_dir); snprintf(buf, sizeof(buf), "%s/illume.edj", custom_dir);
if (edje_object_file_set(o, buf, group)) if (edje_object_file_set(o, buf, group))
{ {
@ -130,7 +120,7 @@ _gc_init(E_Gadcon *gc, const char *name, const char *id, const char *style)
Evas_Object *o; Evas_Object *o;
E_Gadcon_Client *gcc; E_Gadcon_Client *gcc;
Instance *inst; Instance *inst;
inst = E_NEW(Instance, 1); inst = E_NEW(Instance, 1);
o = _theme_obj_new(gc->evas, e_module_dir_get(mod), o = _theme_obj_new(gc->evas, e_module_dir_get(mod),
"e/modules/illume/gadget/gsm"); "e/modules/illume/gadget/gsm");
@ -140,14 +130,10 @@ _gc_init(E_Gadcon *gc, const char *name, const char *id, const char *style)
inst->gcc = gcc; inst->gcc = gcc;
inst->obj = o; inst->obj = o;
e_gadcon_client_util_menu_attach(gcc); e_gadcon_client_util_menu_attach(gcc);
inst->strength = -1; inst->strength = -1;
inst->oper = NULL; inst->oper = NULL;
ecore_init();
ecore_string_init();
e_dbus_init();
conn = e_dbus_bus_get(DBUS_BUS_SESSION); conn = e_dbus_bus_get(DBUS_BUS_SESSION);
conn_system = e_dbus_bus_get(DBUS_BUS_SYSTEM); conn_system = e_dbus_bus_get(DBUS_BUS_SYSTEM);
@ -195,7 +181,7 @@ _gc_init(E_Gadcon *gc, const char *name, const char *id, const char *style)
} }
get_signal(inst); get_signal(inst);
get_operator(inst); get_operator(inst);
return gcc; return gcc;
} }
@ -203,13 +189,10 @@ static void
_gc_shutdown(E_Gadcon_Client *gcc) _gc_shutdown(E_Gadcon_Client *gcc)
{ {
Instance *inst; Instance *inst;
if (conn) e_dbus_connection_close(conn); if (conn) e_dbus_connection_close(conn);
if (conn_system) e_dbus_connection_close(conn_system); if (conn_system) e_dbus_connection_close(conn_system);
e_dbus_shutdown();
ecore_string_shutdown();
ecore_shutdown();
inst = gcc->data; inst = gcc->data;
evas_object_del(inst->obj); evas_object_del(inst->obj);
if (inst->oper) free(inst->oper); if (inst->oper) free(inst->oper);
@ -221,7 +204,7 @@ _gc_orient(E_Gadcon_Client *gcc, E_Gadcon_Orient orient)
{ {
Instance *inst; Instance *inst;
Evas_Coord mw, mh, mxw, mxh; Evas_Coord mw, mh, mxw, mxh;
inst = gcc->data; inst = gcc->data;
mw = 0, mh = 0; mw = 0, mh = 0;
edje_object_size_min_get(inst->obj, &mw, &mh); edje_object_size_min_get(inst->obj, &mw, &mh);
@ -268,7 +251,7 @@ update_operator(char *op, void *data)
{ {
Instance *inst = data; Instance *inst = data;
char *poper; char *poper;
poper = inst->oper; poper = inst->oper;
if ((poper) && (op) && (!strcmp(op, poper))) return; if ((poper) && (op) && (!strcmp(op, poper))) return;
if (op) inst->oper = strdup(op); if (op) inst->oper = strdup(op);
@ -276,7 +259,7 @@ update_operator(char *op, void *data)
if (inst->oper != poper) if (inst->oper != poper)
{ {
Edje_Message_String msg; Edje_Message_String msg;
if (inst->oper) msg.str = inst->oper; if (inst->oper) msg.str = inst->oper;
else msg.str = ""; else msg.str = "";
edje_object_message_send(inst->obj, EDJE_MESSAGE_STRING, 1, &msg); edje_object_message_send(inst->obj, EDJE_MESSAGE_STRING, 1, &msg);
@ -289,7 +272,7 @@ update_signal(int sig, void *data)
{ {
Instance *inst = data; Instance *inst = data;
int pstrength; int pstrength;
pstrength = inst->strength; pstrength = inst->strength;
inst->strength = sig; inst->strength = sig;
@ -297,7 +280,7 @@ update_signal(int sig, void *data)
{ {
Edje_Message_Float msg; Edje_Message_Float msg;
double level; double level;
level = (double)inst->strength / 100.0; level = (double)inst->strength / 100.0;
if (level < 0.0) level = 0.0; if (level < 0.0) level = 0.0;
else if (level > 1.0) level = 1.0; else if (level > 1.0) level = 1.0;
@ -315,11 +298,11 @@ static void *
signal_unmarhsall(DBusMessage *msg, DBusError *err) signal_unmarhsall(DBusMessage *msg, DBusError *err)
{ {
dbus_int32_t val = -1; dbus_int32_t val = -1;
if (dbus_message_get_args(msg, NULL, DBUS_TYPE_INT32, &val, DBUS_TYPE_INVALID)) if (dbus_message_get_args(msg, NULL, DBUS_TYPE_INT32, &val, DBUS_TYPE_INVALID))
{ {
int *val_ret; int *val_ret;
val_ret = malloc(sizeof(int)); val_ret = malloc(sizeof(int));
if (val_ret) if (val_ret)
{ {
@ -338,7 +321,7 @@ operator_unmarhsall(DBusMessage *msg, DBusError *err)
if (dbus_message_get_args(msg, NULL, DBUS_TYPE_STRING, &str, DBUS_TYPE_INVALID)) if (dbus_message_get_args(msg, NULL, DBUS_TYPE_STRING, &str, DBUS_TYPE_INVALID))
{ {
char *str_ret; char *str_ret;
str_ret = malloc(strlen(str)+1); str_ret = malloc(strlen(str)+1);
if (str_ret) if (str_ret)
{ {
@ -356,16 +339,16 @@ _fso_operator_unmarhsall(DBusMessage *msg)
* informations get ingnored for the gadget for now */ * informations get ingnored for the gadget for now */
const char *provider = 0 , *name = 0, *reg_stat = 0; const char *provider = 0 , *name = 0, *reg_stat = 0;
DBusMessageIter iter, a_iter, s_iter, v_iter; DBusMessageIter iter, a_iter, s_iter, v_iter;
if (!dbus_message_has_signature(msg, "a{sv}")) return NULL; if (!dbus_message_has_signature(msg, "a{sv}")) return NULL;
dbus_message_iter_init(msg, &iter); dbus_message_iter_init(msg, &iter);
dbus_message_iter_recurse(&iter, &a_iter); dbus_message_iter_recurse(&iter, &a_iter);
while (dbus_message_iter_get_arg_type(&a_iter) != DBUS_TYPE_INVALID) while (dbus_message_iter_get_arg_type(&a_iter) != DBUS_TYPE_INVALID)
{ {
dbus_message_iter_recurse(&a_iter, &s_iter); dbus_message_iter_recurse(&a_iter, &s_iter);
dbus_message_iter_get_basic(&s_iter, &name); dbus_message_iter_get_basic(&s_iter, &name);
if (strcmp(name, "registration") == 0) if (strcmp(name, "registration") == 0)
{ {
dbus_message_iter_next(&s_iter); dbus_message_iter_next(&s_iter);
@ -380,7 +363,7 @@ _fso_operator_unmarhsall(DBusMessage *msg)
} }
dbus_message_iter_next(&a_iter); dbus_message_iter_next(&a_iter);
} }
if (!reg_stat) return NULL; if (!reg_stat) return NULL;
if (strcmp(reg_stat, "unregistered") == 0) provider = "No Service"; if (strcmp(reg_stat, "unregistered") == 0) provider = "No Service";
else if (strcmp(reg_stat, "busy") == 0) provider = "Searching..."; else if (strcmp(reg_stat, "busy") == 0) provider = "Searching...";
@ -404,7 +387,7 @@ signal_callback_qtopia(void *data, void *ret, DBusError *err)
if (ret) if (ret)
{ {
int *val_ret; int *val_ret;
if ((detected_system == PH_SYS_UNKNOWN) && (changed_h) && (conn)) if ((detected_system == PH_SYS_UNKNOWN) && (changed_h) && (conn))
{ {
e_dbus_signal_handler_del(conn, changed_h); e_dbus_signal_handler_del(conn, changed_h);
@ -435,7 +418,7 @@ signal_callback_fso(void *data, void *ret, DBusError *err)
if (ret) if (ret)
{ {
int *val_ret; int *val_ret;
if ((detected_system == PH_SYS_UNKNOWN) && (changed_fso_h) && (conn_system)) if ((detected_system == PH_SYS_UNKNOWN) && (changed_fso_h) && (conn_system))
{ {
e_dbus_signal_handler_del(conn_system, changed_fso_h); e_dbus_signal_handler_del(conn_system, changed_fso_h);
@ -531,7 +514,7 @@ static void
get_signal(void *data) get_signal(void *data)
{ {
DBusMessage *msg; DBusMessage *msg;
// printf("GSM-gadget: Get signal called\n"); // printf("GSM-gadget: Get signal called\n");
if (((detected_system == PH_SYS_UNKNOWN) || (detected_system == PH_SYS_QTOPIA)) && (conn)) if (((detected_system == PH_SYS_UNKNOWN) || (detected_system == PH_SYS_QTOPIA)) && (conn))
{ {
@ -608,7 +591,7 @@ signal_changed(void *data, DBusMessage *msg)
{ {
DBusError err; DBusError err;
dbus_int32_t val = -1; dbus_int32_t val = -1;
dbus_error_init(&err); dbus_error_init(&err);
if (!dbus_message_get_args(msg, &err, DBUS_TYPE_INT32, &val, DBUS_TYPE_INVALID)) if (!dbus_message_get_args(msg, &err, DBUS_TYPE_INT32, &val, DBUS_TYPE_INVALID))
return; return;
@ -620,7 +603,7 @@ operator_changed(void *data, DBusMessage *msg)
{ {
DBusError err; DBusError err;
char *str = NULL; char *str = NULL;
dbus_error_init(&err); dbus_error_init(&err);
if (!dbus_message_get_args(msg, &err, DBUS_TYPE_STRING, &str, DBUS_TYPE_INVALID)) if (!dbus_message_get_args(msg, &err, DBUS_TYPE_STRING, &str, DBUS_TYPE_INVALID))
return; return;
@ -631,6 +614,7 @@ static void
fso_operator_changed(void *data, DBusMessage *msg) fso_operator_changed(void *data, DBusMessage *msg)
{ {
char *provider; char *provider;
provider = _fso_operator_unmarhsall(msg); provider = _fso_operator_unmarhsall(msg);
update_operator(provider, data); update_operator(provider, data);
} }
@ -640,7 +624,7 @@ name_changed(void *data, DBusMessage *msg)
{ {
DBusError err; DBusError err;
const char *s1, *s2, *s3; const char *s1, *s2, *s3;
dbus_error_init(&err); dbus_error_init(&err);
if (!dbus_message_get_args(msg, &err, if (!dbus_message_get_args(msg, &err,
DBUS_TYPE_STRING, &s1, DBUS_TYPE_STRING, &s1,

View File

@ -1,6 +1,5 @@
#include "e.h" #include "e.h"
/***************************************************************************/
typedef struct _Instance Instance; typedef struct _Instance Instance;
struct _Instance struct _Instance
@ -11,8 +10,6 @@ struct _Instance
int on; int on;
}; };
/***************************************************************************/
/**/
/* gadcon requirements */ /* gadcon requirements */
static E_Gadcon_Client *_gc_init(E_Gadcon *gc, const char *name, const char *id, const char *style); static E_Gadcon_Client *_gc_init(E_Gadcon *gc, const char *name, const char *id, const char *style);
static void _gc_shutdown(E_Gadcon_Client *gcc); static void _gc_shutdown(E_Gadcon_Client *gcc);
@ -32,8 +29,6 @@ static const E_Gadcon_Client_Class _gadcon_class =
E_GADCON_CLIENT_STYLE_PLAIN E_GADCON_CLIENT_STYLE_PLAIN
}; };
static E_Module *mod = NULL; static E_Module *mod = NULL;
/**/
/***************************************************************************/
static int _cb_poll(void *data); static int _cb_poll(void *data);
@ -57,14 +52,14 @@ static Evas_Object *
_theme_obj_new(Evas *e, const char *custom_dir, const char *group) _theme_obj_new(Evas *e, const char *custom_dir, const char *group)
{ {
Evas_Object *o; Evas_Object *o;
o = edje_object_add(e); o = edje_object_add(e);
if (!e_theme_edje_object_set(o, "base/theme/modules/illume", group)) if (!e_theme_edje_object_set(o, "base/theme/modules/illume", group))
{ {
if (custom_dir) if (custom_dir)
{ {
char buf[PATH_MAX]; char buf[PATH_MAX];
snprintf(buf, sizeof(buf), "%s/illume.edj", custom_dir); snprintf(buf, sizeof(buf), "%s/illume.edj", custom_dir);
if (edje_object_file_set(o, buf, group)) if (edje_object_file_set(o, buf, group))
{ {
@ -81,7 +76,7 @@ _gc_init(E_Gadcon *gc, const char *name, const char *id, const char *style)
Evas_Object *o; Evas_Object *o;
E_Gadcon_Client *gcc; E_Gadcon_Client *gcc;
Instance *inst; Instance *inst;
inst = E_NEW(Instance, 1); inst = E_NEW(Instance, 1);
o = _theme_obj_new(gc->evas, e_module_dir_get(mod), o = _theme_obj_new(gc->evas, e_module_dir_get(mod),
"e/modules/illume/gadget/usb"); "e/modules/illume/gadget/usb");
@ -94,7 +89,7 @@ _gc_init(E_Gadcon *gc, const char *name, const char *id, const char *style)
inst->on = -1; inst->on = -1;
inst->poller = ecore_poller_add(ECORE_POLLER_CORE, 16, _cb_poll, inst); inst->poller = ecore_poller_add(ECORE_POLLER_CORE, 16, _cb_poll, inst);
return gcc; return gcc;
} }
@ -102,7 +97,7 @@ static void
_gc_shutdown(E_Gadcon_Client *gcc) _gc_shutdown(E_Gadcon_Client *gcc)
{ {
Instance *inst; Instance *inst;
inst = gcc->data; inst = gcc->data;
ecore_poller_del(inst->poller); ecore_poller_del(inst->poller);
evas_object_del(inst->obj); evas_object_del(inst->obj);
@ -114,7 +109,7 @@ _gc_orient(E_Gadcon_Client *gcc, E_Gadcon_Orient orient)
{ {
Instance *inst; Instance *inst;
Evas_Coord mw, mh, mxw, mxh; Evas_Coord mw, mh, mxw, mxh;
inst = gcc->data; inst = gcc->data;
mw = 0, mh = 0; mw = 0, mh = 0;
edje_object_size_min_get(inst->obj, &mw, &mh); edje_object_size_min_get(inst->obj, &mw, &mh);
@ -160,14 +155,14 @@ static int
_find_interface_class(int iclass) _find_interface_class(int iclass)
{ {
Eina_List *devs; Eina_List *devs;
char *name; char *name;
devs = ecore_file_ls("/sys/bus/usb/devices"); devs = ecore_file_ls("/sys/bus/usb/devices");
EINA_LIST_FREE(devs, name) EINA_LIST_FREE(devs, name)
{ {
char buf[PATH_MAX]; char buf[PATH_MAX];
FILE *f; FILE *f;
snprintf(buf, sizeof(buf), "%s/%s/%s", snprintf(buf, sizeof(buf), "%s/%s/%s",
"/sys/bus/usb/devices", name, "bInterfaceClass"); "/sys/bus/usb/devices", name, "bInterfaceClass");
f = fopen(buf, "r"); f = fopen(buf, "r");
@ -176,12 +171,12 @@ _find_interface_class(int iclass)
if (fgets(buf, sizeof(buf), f)) if (fgets(buf, sizeof(buf), f))
{ {
int id = -1; int id = -1;
sscanf(buf, "%x", &id); sscanf(buf, "%x", &id);
if (iclass == id) if (iclass == id)
{ {
EINA_LIST_FREE(devs, name) EINA_LIST_FREE(devs, name)
free(name); free(name);
fclose(f); fclose(f);
return 1; return 1;
} }
@ -199,7 +194,7 @@ _cb_poll(void *data)
{ {
Instance *inst; Instance *inst;
int pon; int pon;
inst = data; inst = data;
/* FIXME: get bt status and emit signal */ /* FIXME: get bt status and emit signal */
pon = inst->on; pon = inst->on;

View File

@ -82,7 +82,7 @@ _e_mod_layout_init(E_Module *m)
handlers = eina_list_append handlers = eina_list_append
(handlers, ecore_event_handler_add (handlers, ecore_event_handler_add
(E_EVENT_ZONE_MOVE_RESIZE, _cb_event_zone_move_resize, NULL)); (E_EVENT_ZONE_MOVE_RESIZE, _cb_event_zone_move_resize, NULL));
{ {
E_Zone *zone; E_Zone *zone;
unsigned int area[4]; unsigned int area[4];
@ -90,7 +90,7 @@ _e_mod_layout_init(E_Module *m)
int wx2 = 0, wy2 = 0, ww2 = 0, wh2 = 0; int wx2 = 0, wy2 = 0, ww2 = 0, wh2 = 0;
Ecore_X_Atom *supported, *supported_new; Ecore_X_Atom *supported, *supported_new;
int i, supported_num; int i, supported_num;
zone = e_util_zone_current_get(e_manager_current_get()); zone = e_util_zone_current_get(e_manager_current_get());
e_slipshelf_safe_app_region_get(zone, &wx, &wy, &ww, &wh); e_slipshelf_safe_app_region_get(zone, &wx, &wy, &ww, &wh);
e_kbd_safe_app_region_get(zone, &wx2, &wy2, &ww2, &wh2); e_kbd_safe_app_region_get(zone, &wx2, &wy2, &ww2, &wh2);
@ -101,12 +101,12 @@ _e_mod_layout_init(E_Module *m)
area[3] = wh; area[3] = wh;
ecore_x_netwm_desk_workareas_set(zone->container->manager->root, ecore_x_netwm_desk_workareas_set(zone->container->manager->root,
area, 1); area, 1);
if (ecore_x_netwm_supported_get(zone->container->manager->root, if (ecore_x_netwm_supported_get(zone->container->manager->root,
&supported, &supported_num)) &supported, &supported_num))
{ {
int have_it = 0; int have_it = 0;
for (i = 0; i < supported_num; i++) for (i = 0; i < supported_num; i++)
{ {
if (supported[i] == ECORE_X_ATOM_NET_WORKAREA) if (supported[i] == ECORE_X_ATOM_NET_WORKAREA)
@ -133,7 +133,7 @@ _e_mod_layout_init(E_Module *m)
else else
{ {
Ecore_X_Atom atom; Ecore_X_Atom atom;
atom = ECORE_X_ATOM_NET_WORKAREA; atom = ECORE_X_ATOM_NET_WORKAREA;
ecore_x_netwm_supported_set(zone->container->manager->root, ecore_x_netwm_supported_set(zone->container->manager->root,
&atom, 1); &atom, 1);
@ -198,7 +198,7 @@ _e_mod_layout_apply_all(void)
for (l = borders; l; l = l->next) for (l = borders; l; l = l->next)
{ {
E_Border *bd; E_Border *bd;
bd = l->data; bd = l->data;
if (e_object_is_del(E_OBJECT(bd))) continue; if (e_object_is_del(E_OBJECT(bd))) continue;
_e_mod_layout_post_border_assign(bd, 1); _e_mod_layout_post_border_assign(bd, 1);
@ -211,7 +211,7 @@ _e_mod_layout_cb_effect_animator(void *data)
{ {
Effect *ef; Effect *ef;
double t, p; double t, p;
ef = data; ef = data;
t = ecore_loop_time_get() - ef->time_start; t = ecore_loop_time_get() - ef->time_start;
if (ef->in > 0.0) if (ef->in > 0.0)
@ -223,7 +223,7 @@ _e_mod_layout_cb_effect_animator(void *data)
{ {
t = 1.0; t = 1.0;
} }
p = 1.0 - t; p = 1.0 - t;
p = 1.0 - (p * p * p * p); p = 1.0 - (p * p * p * p);
@ -231,7 +231,7 @@ _e_mod_layout_cb_effect_animator(void *data)
e_border_fx_offset(ef->border, 0, (-ef->border->zone->h * (1.0 - p))); e_border_fx_offset(ef->border, 0, (-ef->border->zone->h * (1.0 - p)));
else else
e_border_fx_offset(ef->border, 0, (-ef->border->zone->h * p)); e_border_fx_offset(ef->border, 0, (-ef->border->zone->h * p));
if (t >= 1.0) if (t >= 1.0)
{ {
if (ef->post == POST_HIDE) if (ef->post == POST_HIDE)
@ -264,7 +264,7 @@ static void
_e_mod_layout_effect_slide_out(E_Border *bd, double in, int post) _e_mod_layout_effect_slide_out(E_Border *bd, double in, int post)
{ {
Effect *ef; Effect *ef;
ef = E_NEW(Effect, 1); ef = E_NEW(Effect, 1);
ef->border = bd; ef->border = bd;
ef->animator = ecore_animator_add(_e_mod_layout_cb_effect_animator, ef); ef->animator = ecore_animator_add(_e_mod_layout_cb_effect_animator, ef);
@ -273,7 +273,7 @@ _e_mod_layout_effect_slide_out(E_Border *bd, double in, int post)
ef->direction = 0; ef->direction = 0;
ef->post = post; ef->post = post;
effects = eina_list_append(effects, ef); effects = eina_list_append(effects, ef);
e_border_fx_offset(ef->border, 0, 0); e_border_fx_offset(ef->border, 0, 0);
if (in <= 0.0) if (in <= 0.0)
{ {
@ -288,7 +288,7 @@ static void
_e_mod_layout_effect_slide_in(E_Border *bd, double in, int post) _e_mod_layout_effect_slide_in(E_Border *bd, double in, int post)
{ {
Effect *ef; Effect *ef;
ef = E_NEW(Effect, 1); ef = E_NEW(Effect, 1);
ef->border = bd; ef->border = bd;
ef->animator = ecore_animator_add(_e_mod_layout_cb_effect_animator, ef); ef->animator = ecore_animator_add(_e_mod_layout_cb_effect_animator, ef);
@ -353,7 +353,7 @@ static int
_is_dialog(E_Border *bd) _is_dialog(E_Border *bd)
{ {
int isdialog = 0, i; int isdialog = 0, i;
if (bd->client.icccm.transient_for != 0) if (bd->client.icccm.transient_for != 0)
isdialog = 1; isdialog = 1;
if (bd->client.netwm.type == ECORE_X_WINDOW_TYPE_DIALOG) if (bd->client.netwm.type == ECORE_X_WINDOW_TYPE_DIALOG)
@ -414,7 +414,7 @@ _e_mod_layout_post_border_assign(E_Border *bd, int not_new)
int wx2 = 0, wy2 = 0, ww2 = 0, wh2 = 0; int wx2 = 0, wy2 = 0, ww2 = 0, wh2 = 0;
int isdialog = 0; int isdialog = 0;
int pbx, pby, pbw, pbh; int pbx, pby, pbw, pbh;
if (bd->stolen) return; if (bd->stolen) return;
/* FIXME: make some modification based on policy */ /* FIXME: make some modification based on policy */
if ((bd->new_client) && (not_new)) return; if ((bd->new_client) && (not_new)) return;
@ -432,7 +432,7 @@ _e_mod_layout_post_border_assign(E_Border *bd, int not_new)
{ {
{ {
unsigned int area[4]; unsigned int area[4];
dockwin = bd; dockwin = bd;
dockwin->lock_focus_out = 1; dockwin->lock_focus_out = 1;
area[0] = wx; area[0] = wx;
@ -452,10 +452,7 @@ _e_mod_layout_post_border_assign(E_Border *bd, int not_new)
} }
else if (isdialog) else if (isdialog)
{ {
if (dockwin) if (dockwin) wh -= dockwin->h;
{
wh -= dockwin->h;
}
// if (ww > (bd->client.icccm.min_w + bd->client_inset.l + bd->client_inset.r)) // if (ww > (bd->client.icccm.min_w + bd->client_inset.l + bd->client_inset.r))
// ww = bd->client.icccm.min_w + bd->client_inset.l + bd->client_inset.r; // ww = bd->client.icccm.min_w + bd->client_inset.l + bd->client_inset.r;
bd->w = ww; bd->w = ww;
@ -477,9 +474,7 @@ _e_mod_layout_post_border_assign(E_Border *bd, int not_new)
// if (bd->client.icccm.min_h > (wh - bd->client_inset.t - bd->client_inset.b)) // if (bd->client.icccm.min_h > (wh - bd->client_inset.t - bd->client_inset.b))
// bd->client.icccm.min_h = wh - bd->client_inset.t - bd->client_inset.b; // bd->client.icccm.min_h = wh - bd->client_inset.t - bd->client_inset.b;
if (bd->new_client) if (bd->new_client)
{ _e_mod_layout_effect_slide_in(bd, (double)illume_cfg->sliding.layout.duration / 1000.0, POST_NONE);
_e_mod_layout_effect_slide_in(bd, (double)illume_cfg->sliding.layout.duration / 1000.0, POST_NONE);
}
} }
else else
{ {
@ -489,9 +484,7 @@ _e_mod_layout_post_border_assign(E_Border *bd, int not_new)
wh -= dockwin->h; wh -= dockwin->h;
} }
if (bd->new_client) if (bd->new_client)
{ _e_mod_layout_effect_slide_in(bd, (double)illume_cfg->sliding.layout.duration / 1000.0, POST_NONE);
_e_mod_layout_effect_slide_in(bd, (double)illume_cfg->sliding.layout.duration / 1000.0, POST_NONE);
}
} }
if (bd == dockwin) if (bd == dockwin)
@ -500,7 +493,7 @@ _e_mod_layout_post_border_assign(E_Border *bd, int not_new)
bd->y = wy + wh - bd->h; bd->y = wy + wh - bd->h;
bd->w = ww; bd->w = ww;
bd->h = bd->h; bd->h = bd->h;
if ((pbx != bd->x) || (pby != bd->y) || if ((pbx != bd->x) || (pby != bd->y) ||
(pbw != bd->w) || (pbh != bd->h)) (pbw != bd->w) || (pbh != bd->h))
{ {
@ -518,9 +511,9 @@ _e_mod_layout_post_border_assign(E_Border *bd, int not_new)
bd->changes.pos = 1; bd->changes.pos = 1;
bd->changes.size = 1; bd->changes.size = 1;
} }
bd->lock_border = 1; bd->lock_border = 1;
bd->lock_client_location = 1; bd->lock_client_location = 1;
bd->lock_client_size = 1; bd->lock_client_size = 1;
// bd->lock_client_stacking = 1; // bd->lock_client_stacking = 1;
@ -528,7 +521,7 @@ _e_mod_layout_post_border_assign(E_Border *bd, int not_new)
bd->lock_client_sticky = 1; bd->lock_client_sticky = 1;
bd->lock_client_shade = 1; bd->lock_client_shade = 1;
bd->lock_client_maximize = 1; bd->lock_client_maximize = 1;
bd->lock_user_location = 1; bd->lock_user_location = 1;
bd->lock_user_size = 1; bd->lock_user_size = 1;
// bd->lock_user_stacking = 1; // bd->lock_user_stacking = 1;
@ -569,16 +562,16 @@ _e_mod_layout_post_border_assign(E_Border *bd, int not_new)
} }
} }
bd->placed = 1; bd->placed = 1;
bd->lock_border = 1; bd->lock_border = 1;
bd->lock_client_location = 1; bd->lock_client_location = 1;
// bd->lock_client_size = 1; // bd->lock_client_size = 1;
bd->lock_client_desk = 1; bd->lock_client_desk = 1;
bd->lock_client_sticky = 1; bd->lock_client_sticky = 1;
bd->lock_client_shade = 1; bd->lock_client_shade = 1;
bd->lock_client_maximize = 1; bd->lock_client_maximize = 1;
bd->lock_user_location = 1; bd->lock_user_location = 1;
bd->lock_user_size = 1; bd->lock_user_size = 1;
// bd->lock_user_desk = 1; // bd->lock_user_desk = 1;
@ -651,7 +644,7 @@ _e_mod_layout_post_border_assign(E_Border *bd, int not_new)
bd->remember = NULL; bd->remember = NULL;
} }
bd->lock_border = 1; bd->lock_border = 1;
bd->lock_client_location = 1; bd->lock_client_location = 1;
bd->lock_client_size = 1; bd->lock_client_size = 1;
// bd->lock_client_stacking = 1; // bd->lock_client_stacking = 1;
@ -659,7 +652,7 @@ _e_mod_layout_post_border_assign(E_Border *bd, int not_new)
bd->lock_client_sticky = 1; bd->lock_client_sticky = 1;
bd->lock_client_shade = 1; bd->lock_client_shade = 1;
bd->lock_client_maximize = 1; bd->lock_client_maximize = 1;
bd->lock_user_location = 1; bd->lock_user_location = 1;
bd->lock_user_size = 1; bd->lock_user_size = 1;
// bd->lock_user_stacking = 1; // bd->lock_user_stacking = 1;
@ -667,7 +660,7 @@ _e_mod_layout_post_border_assign(E_Border *bd, int not_new)
bd->lock_user_sticky = 1; bd->lock_user_sticky = 1;
// bd->lock_user_shade = 1; // bd->lock_user_shade = 1;
// bd->lock_user_maximize = 1; // bd->lock_user_maximize = 1;
bd->client.icccm.base_w = 1; bd->client.icccm.base_w = 1;
bd->client.icccm.base_h = 1; bd->client.icccm.base_h = 1;
bd->client.icccm.min_w = 1; bd->client.icccm.min_w = 1;
@ -703,7 +696,7 @@ static int
_cb_event_border_add(void *data, int type, void *event) _cb_event_border_add(void *data, int type, void *event)
{ {
E_Event_Border_Add *ev; E_Event_Border_Add *ev;
ev = event; ev = event;
if (ev->border->stolen) return 1; if (ev->border->stolen) return 1;
return 1; return 1;
@ -714,7 +707,7 @@ _cb_event_border_remove(void *data, int type, void *event)
{ {
E_Event_Border_Remove *ev; E_Event_Border_Remove *ev;
Eina_List *l, *pl; Eina_List *l, *pl;
ev = event; ev = event;
if (ev->border->stolen) return 1; if (ev->border->stolen) return 1;
if (ev->border == dockwin) if (ev->border == dockwin)
@ -722,7 +715,7 @@ _cb_event_border_remove(void *data, int type, void *event)
unsigned int area[4]; unsigned int area[4];
int wx = 0, wy = 0, ww = 0, wh = 0; int wx = 0, wy = 0, ww = 0, wh = 0;
int wx2 = 0, wy2 = 0, ww2 = 0, wh2 = 0; int wx2 = 0, wy2 = 0, ww2 = 0, wh2 = 0;
dockwin = NULL; dockwin = NULL;
dockwin_use = 0; dockwin_use = 0;
e_slipshelf_safe_app_region_get(ev->border->zone, &wx, &wy, &ww, &wh); e_slipshelf_safe_app_region_get(ev->border->zone, &wx, &wy, &ww, &wh);
@ -738,7 +731,7 @@ _cb_event_border_remove(void *data, int type, void *event)
for (l = effects; l;) for (l = effects; l;)
{ {
Effect *ef; Effect *ef;
ef = l->data; ef = l->data;
pl = l; pl = l;
l = l->next; l = l->next;
@ -757,7 +750,7 @@ _cb_event_border_focus_in(void *data, int type, void *event)
{ {
E_Event_Border_Focus_In *ev; E_Event_Border_Focus_In *ev;
E_Border *bd; E_Border *bd;
ev = event; ev = event;
if (ev->border->stolen) return 1; if (ev->border->stolen) return 1;
bd = ev->border; bd = ev->border;
@ -782,7 +775,7 @@ _cb_event_border_focus_out(void *data, int type, void *event)
{ {
E_Event_Border_Focus_Out *ev; E_Event_Border_Focus_Out *ev;
E_Border *bd; E_Border *bd;
ev = event; ev = event;
if (ev->border->stolen) return 1; if (ev->border->stolen) return 1;
bd = ev->border; bd = ev->border;
@ -801,7 +794,7 @@ static int
_cb_event_border_show(void *data, int type, void *event) _cb_event_border_show(void *data, int type, void *event)
{ {
E_Event_Border_Show *ev; E_Event_Border_Show *ev;
ev = event; ev = event;
if (ev->border->stolen) return 1; if (ev->border->stolen) return 1;
return 1; return 1;
@ -811,7 +804,7 @@ static int
_cb_event_border_hide(void *data, int type, void *event) _cb_event_border_hide(void *data, int type, void *event)
{ {
E_Event_Border_Hide *ev; E_Event_Border_Hide *ev;
ev = event; ev = event;
if (ev->border->stolen) return 1; if (ev->border->stolen) return 1;
return 1; return 1;