first cut at virtualizing


			
			
				devs/princeamd/enlightenment-0.17-elive
			
			
		
Carsten Haitzler 22 years ago
parent e79f8efd51
commit 21009504f9
  1. 1
      src/Makefile.am
  2. 3
      src/actions.c
  3. 29
      src/border.c
  4. 48
      src/config.c
  5. 10
      src/desktops.c
  6. 1
      src/e.h

@ -9,6 +9,7 @@ bin_PROGRAMS = enlightenment
enlightenment_SOURCES = \
actions.c \
border.c \
config.c \
desktops.c \
exec.c \
icccm.c \

@ -57,7 +57,7 @@ static void e_act_zoom_start (void *o, E_Action *a, void *data, int x, int y, in
static void
_e_action_find(char *action, int act, int button, char *key, Ev_Key_Modifiers mods, void *o)
{
char *actions_db = PACKAGE_DATA_DIR"/data/config/behavior/default/actions.db";
char *actions_db;
E_DB_File *db;
int i, num;
char *a_name = NULL;
@ -69,6 +69,7 @@ _e_action_find(char *action, int act, int button, char *key, Ev_Key_Modifiers mo
int a_modifiers = 0;
E_Action *a;
actions_db = e_config_get("actions");
db = e_db_open_read(actions_db);
if (!db) return;
if (!e_db_int_get(db, "/actions/count", &num)) goto error;

@ -377,11 +377,12 @@ e_focus_out(Eevent * ev)
b = e_border_find_by_window(e->win);
if (b)
{
char *settings_db = PACKAGE_DATA_DIR"/data/config/behavior/default/settings.db";
char *settings_db;
E_DB_File *db;
int focus_mode;
char buf[4096];
settings_db = e_config_get("settings");
b->current.selected = 0;
/* settings - click to focus would affect grabs */
db = e_db_open_read(settings_db);
@ -986,12 +987,17 @@ void
e_border_apply_border(E_Border *b)
{
int pl, pr, pt, pb;
char *borders, buf[4096], *border;
if ((!b->client.titlebar) &&
(!b->client.border)) e_border_set_bits(b, PACKAGE_DATA_DIR"/data/config/appearance/default/borders/borderless.bits.db");
else if (b->current.selected) e_border_set_bits(b, PACKAGE_DATA_DIR"/data/config/appearance/default/borders/border.bits.db");
else e_border_set_bits(b, PACKAGE_DATA_DIR"/data/config/appearance/default/borders/border2.bits.db");
(!b->client.border)) border = "borderless.bits.db";
else if (b->current.selected) border = "border.bits.db";
else border = "border2.bits.db";
borders = e_config_get("borders");
sprintf(buf, "%s%s", borders, border);
e_border_set_bits(b, buf);
pl = pr = pt = pb = 0;
if (b->bits.t) ebits_get_insets(b->bits.t, &pl, &pr, &pt, &pb);
e_icccm_set_frame_size(b->win.client, pl, pr, pt, pb);
@ -1066,9 +1072,10 @@ e_border_new(void)
int max_colors = 216;
int font_cache = 1024 * 1024;
int image_cache = 8192 * 1024;
char *font_dir = PACKAGE_DATA_DIR"/data/fonts";
char *font_dir;
E_Desktop *desk;
font_dir = e_config_get("fonts");
b = NEW(E_Border, 1);
ZERO(b, E_Border, 1);
@ -1223,12 +1230,14 @@ e_border_remove_mouse_grabs(E_Border *b)
void
e_border_attach_mouse_grabs(E_Border *b)
{
char *grabs_db = PACKAGE_DATA_DIR"/data/config/behavior/default/grabs.db";
char *settings_db = PACKAGE_DATA_DIR"/data/config/behavior/default/settings.db";
char *grabs_db;
char *settings_db;
E_DB_File *db;
int focus_mode;
char buf[4096];
grabs_db = e_config_get("grabs");
settings_db = e_config_get("settings");
/* settings - click to focus would affect grabs */
db = e_db_open_read(settings_db);
sprintf(buf, "/focus/mode");
@ -1316,14 +1325,16 @@ e_border_attach_all_mouse_grabs(void)
void
e_border_redo_grabs(void)
{
char *grabs_db = PACKAGE_DATA_DIR"/data/config/behavior/default/grabs.db";
char *settings_db = PACKAGE_DATA_DIR"/data/config/behavior/default/settings.db";
char *grabs_db;
char *settings_db;
static time_t mod_date_grabs = 0;
static time_t mod_date_settings = 0;
time_t mod;
int changed = 0;
Evas_List l;
grabs_db = e_config_get("grabs");
settings_db = e_config_get("settings");
mod = e_file_modified_time(grabs_db);
if (mod != mod_date_grabs) changed = 1;
mod_date_grabs = mod;

@ -0,0 +1,48 @@
#include "e.h"
static char cfg_grabs_db[4096];
static char cfg_settings_db[4096];
static char cfg_actions_db[4096];
static char cfg_borders[4096];
char *
e_config_get(char *type)
{
if (!strcmp(type, "grabs"))
{
sprintf(cfg_grabs_db,
PACKAGE_DATA_DIR"/data/config/behavior/default/grabs.db");
return cfg_grabs_db;
}
if (!strcmp(type, "settings"))
{
sprintf(cfg_settings_db,
PACKAGE_DATA_DIR"/data/config/behavior/default/settings.db");
return cfg_settings_db;
}
if (!strcmp(type, "actions"))
{
sprintf(cfg_actions_db,
PACKAGE_DATA_DIR"/data/config/behavior/default/actions.db");
return cfg_actions_db;
}
if (!strcmp(type, "borders"))
{
sprintf(cfg_borders,
PACKAGE_DATA_DIR"/data/config/appearance/default/borders/");
return cfg_borders;
}
if (!strcmp(type, "images"))
{
sprintf(cfg_borders,
PACKAGE_DATA_DIR"/data/images/");
return cfg_borders;
}
if (!strcmp(type, "fonts"))
{
sprintf(cfg_borders,
PACKAGE_DATA_DIR"/data/fonts/");
return cfg_borders;
}
return "";
}

@ -372,8 +372,9 @@ e_desktops_init_file_display(E_Desktop *desk)
int max_colors = 216;
int font_cache = 1024 * 1024;
int image_cache = 8192 * 1024;
char *font_dir = PACKAGE_DATA_DIR"/data/fonts";
char *font_dir;
font_dir = e_config_get("fonts");
/* software */
desk->evas.desk = evas_new_all(e_display_get(),
desk->win.container,
@ -396,13 +397,16 @@ e_desktops_init_file_display(E_Desktop *desk)
{
Evas_Object o;
Evas e;
char buf[4096];
e = desk->evas.desk;
o = evas_add_image_from_file(e, PACKAGE_DATA_DIR"/data/images/bg.png");
sprintf(buf, "%sbg.png", e_config_get("images"));
o = evas_add_image_from_file(e, buf);
evas_move(e, o, 0, 0);
evas_resize(e, o, screen_w, screen_h);
evas_show(e, o);
o = evas_add_image_from_file(e, PACKAGE_DATA_DIR"/data/images/e_logo.png");
sprintf(buf, "%se_logo.png", e_config_get("images"));
o = evas_add_image_from_file(e, buf);
evas_move(e, o, 0, 0);
evas_show(e, o);
}

@ -355,3 +355,4 @@ pid_t e_exec_run(char *exe);
pid_t e_exec_run_in_dir(char *exe, char *dir);
pid_t e_run_in_dir_with_env(char *exe, char *dir, int *launch_id_ret, char **env, char *launch_path);
char *e_config_get(char *type);

Loading…
Cancel
Save