i've gone over vd's - read the diff :)

SVN revision: 14123
This commit is contained in:
Carsten Haitzler 2005-04-09 00:13:09 +00:00
parent 8af31e445f
commit 6ca778ea55
4 changed files with 76 additions and 98 deletions

9
TODO
View File

@ -1,6 +1,6 @@
\MINI FREEZE: MINI FREEZE:
Status: ON Status: OFF
What is this: What is this:
@ -29,9 +29,7 @@ Current freeze issues are:
ISSUES: ISSUES:
* virtual desktops need an overhaul. hacked in waay too quickly. <EMPTY>
* virtual desktops need fixing to work with zones properly
* gadman gadget menu needs icons :)
<add more issues as they are found> <add more issues as they are found>
@ -57,6 +55,7 @@ Also look at all the .c files - they have their own localized TODO lists
These are in no particular order: These are in no particular order:
* gadman gadget menu needs icons :)
* module api needs to change entry calls, move label and icon to data file, not api * module api needs to change entry calls, move label and icon to data file, not api
* gadman edit mode for simgple gadgets with a key combo (eg alt+click on module) * gadman edit mode for simgple gadgets with a key combo (eg alt+click on module)
* edit mode keybindings :) * edit mode keybindings :)

View File

@ -11,17 +11,12 @@
static void _e_desk_free(E_Desk *desk); static void _e_desk_free(E_Desk *desk);
static void _e_border_event_desk_show_free(void *data, void *ev); static void _e_border_event_desk_show_free(void *data, void *ev);
static int desk_count;
int E_EVENT_DESK_SHOW = 0; int E_EVENT_DESK_SHOW = 0;
int int
e_desk_init(void) e_desk_init(void)
{ {
desk_count = 0;
E_EVENT_DESK_SHOW = ecore_event_type_new(); E_EVENT_DESK_SHOW = ecore_event_type_new();
return 1; return 1;
} }
@ -44,7 +39,8 @@ e_desk_new(E_Zone *zone, int x, int y)
if (!desk) return NULL; if (!desk) return NULL;
desk->zone = zone; desk->zone = zone;
desk->num = ++desk_count; desk->x = x;
desk->y = y;
snprintf(name, sizeof(name), "Desktop %d, %d", x, y); snprintf(name, sizeof(name), "Desktop %d, %d", x, y);
desk->name = strdup(name); desk->name = strdup(name);
return desk; return desk;
@ -76,25 +72,22 @@ e_desk_show(E_Desk *desk)
if (bd->desk->zone == desk->zone && !bd->iconic) if (bd->desk->zone == desk->zone && !bd->iconic)
{ {
if (bd->desk == desk || bd->sticky) if ((bd->desk == desk) || (bd->sticky))
{
e_border_show(bd); e_border_show(bd);
}
else else
{
e_border_hide(bd, 1); e_border_hide(bd, 1);
} }
} }
}
for (x = 0; x < desk->zone->desk_x_count; x++) for (x = 0; x < desk->zone->desk_x_count; x++)
{ {
for (y = 0; y < desk->zone->desk_y_count; y++) for (y = 0; y < desk->zone->desk_y_count; y++)
{ {
E_Desk *next; E_Desk *desk2;
next = e_desk_at_xy_get(desk->zone,x, y);
next->visible = 0; desk2 = e_desk_at_xy_get(desk->zone,x, y);
if (next == desk) desk2->visible = 0;
if (desk2 == desk)
{ {
desk->zone->desk_x_current = x; desk->zone->desk_x_current = x;
desk->zone->desk_y_current = y; desk->zone->desk_y_current = y;
@ -138,7 +131,6 @@ e_desk_current_get(E_Zone *zone)
{ {
E_OBJECT_CHECK_RETURN(zone, NULL); E_OBJECT_CHECK_RETURN(zone, NULL);
E_OBJECT_TYPE_CHECK_RETURN(zone, E_ZONE_TYPE, NULL); E_OBJECT_TYPE_CHECK_RETURN(zone, E_ZONE_TYPE, NULL);
return e_desk_at_xy_get(zone, zone->desk_x_current, zone->desk_y_current); return e_desk_at_xy_get(zone, zone->desk_x_current, zone->desk_y_current);
} }
@ -162,21 +154,8 @@ e_desk_xy_get(E_Desk *desk, int *x, int *y)
E_OBJECT_CHECK(desk); E_OBJECT_CHECK(desk);
E_OBJECT_TYPE_CHECK(desk, E_DESK_TYPE); E_OBJECT_TYPE_CHECK(desk, E_DESK_TYPE);
for (xx = 0; xx < desk->zone->desk_x_count; xx++) if (x) *x = desk->x;
{ if (y) *y = desk->y;
for (yy = 0; yy < desk->zone->desk_y_count; yy++)
{
E_Desk *next;
next = e_desk_at_xy_get(desk->zone, xx, yy);
if (next == desk)
{
*x = xx;
*y = yy;
return;
}
}
}
} }
void void
@ -187,7 +166,8 @@ e_desk_next(E_Zone *zone)
E_OBJECT_CHECK(zone); E_OBJECT_CHECK(zone);
E_OBJECT_TYPE_CHECK(zone, E_ZONE_TYPE); E_OBJECT_TYPE_CHECK(zone, E_ZONE_TYPE);
if (zone->desk_x_count < 2 && zone->desk_y_count < 2) if ((zone->desk_x_count < 2) &&
(zone->desk_y_count < 2))
return; return;
x = zone->desk_x_current; x = zone->desk_x_current;
@ -198,8 +178,7 @@ e_desk_next(E_Zone *zone)
{ {
x = 0; x = 0;
y++; y++;
if (y >= zone->desk_y_count) if (y >= zone->desk_y_count) y = 0;
y = 0;
} }
e_desk_show(e_desk_at_xy_get(zone, x, y)); e_desk_show(e_desk_at_xy_get(zone, x, y));
@ -213,7 +192,8 @@ e_desk_prev(E_Zone *zone)
E_OBJECT_CHECK(zone); E_OBJECT_CHECK(zone);
E_OBJECT_TYPE_CHECK(zone, E_ZONE_TYPE); E_OBJECT_TYPE_CHECK(zone, E_ZONE_TYPE);
if (zone->desk_x_count < 2 && zone->desk_y_count < 2) if ((zone->desk_x_count < 2) &&
(zone->desk_y_count < 2))
return; return;
x = zone->desk_x_current; x = zone->desk_x_current;
@ -224,11 +204,8 @@ e_desk_prev(E_Zone *zone)
{ {
x = zone->desk_x_count - 1; x = zone->desk_x_count - 1;
y--; y--;
if (y < 0) if (y < 0) y = zone->desk_y_count - 1;
y = zone->desk_y_count - 1;
} }
e_desk_show(e_desk_at_xy_get(zone, x, y)); e_desk_show(e_desk_at_xy_get(zone, x, y));
} }

View File

@ -18,7 +18,7 @@ struct _E_Desk
E_Zone *zone; E_Zone *zone;
char *name; char *name;
int num; int x, y;
char visible : 1; char visible : 1;
Evas_Object *bg_object; Evas_Object *bg_object;

View File

@ -313,26 +313,26 @@ e_zone_desk_count_set(E_Zone *zone, int x_count, int y_count)
E_Event_Zone_Desk_Count_Set *ev; E_Event_Zone_Desk_Count_Set *ev;
xx = x_count; xx = x_count;
if (xx < 1) if (xx < 1) xx = 1;
xx = 1;
yy = y_count; yy = y_count;
if (yy < 1) if (yy < 1) yy = 1;
yy = 1;
new_desks = malloc(xx * yy * sizeof(E_Desk *)); new_desks = malloc(xx * yy * sizeof(E_Desk *));
for (x = 0; x < xx; x++) for (x = 0; x < xx; x++)
{
for (y = 0; y < yy; y++) for (y = 0; y < yy; y++)
{ {
if (x < zone->desk_x_count && y < zone->desk_y_count) if ((x < zone->desk_x_count) && (y < zone->desk_y_count))
desk = zone->desks[x + (y * zone->desk_x_count)]; desk = zone->desks[x + (y * zone->desk_x_count)];
else else
desk = e_desk_new(zone, x, y); desk = e_desk_new(zone, x, y);
new_desks[x + (y * xx)] = desk; new_desks[x + (y * xx)] = desk;
} }
}
/* catch windoes that have fallen off the end if we got smaller */ /* catch windoes that have fallen off the end if we got smaller */
if (xx < zone->desk_x_count) if (xx < zone->desk_x_count)
{
for (y = 0; y < zone->desk_y_count; y++) for (y = 0; y < zone->desk_y_count; y++)
{ {
new_desk = zone->desks[xx - 1 + (y * zone->desk_x_count)]; new_desk = zone->desks[xx - 1 + (y * zone->desk_x_count)];
@ -349,7 +349,9 @@ e_zone_desk_count_set(E_Zone *zone, int x_count, int y_count)
e_object_del(E_OBJECT(desk)); e_object_del(E_OBJECT(desk));
} }
} }
}
if (yy < zone->desk_y_count) if (yy < zone->desk_y_count)
{
for (x = 0; x < zone->desk_x_count; x++) for (x = 0; x < zone->desk_x_count; x++)
{ {
new_desk = zone->desks[x + ((yy - 1) * zone->desk_x_count)]; new_desk = zone->desks[x + ((yy - 1) * zone->desk_x_count)];
@ -366,7 +368,7 @@ e_zone_desk_count_set(E_Zone *zone, int x_count, int y_count)
e_object_del(E_OBJECT(desk)); e_object_del(E_OBJECT(desk));
} }
} }
}
if (zone->desks) free(zone->desks); if (zone->desks) free(zone->desks);
zone->desks = new_desks; zone->desks = new_desks;