mirror of
https://github.com/gryf/wmaker.git
synced 2026-01-07 22:34:18 +01:00
multiview and vertical splitview
some bug fixes configurable default font size etc
This commit is contained in:
21
WINGs/bag.c
21
WINGs/bag.c
@@ -130,8 +130,7 @@ WMRemoveFromBag(WMBag *bag, void *item)
|
||||
void
|
||||
WMDeleteFromBag(WMBag *bag, int index)
|
||||
{
|
||||
if (index < 0 || index >= bag->count)
|
||||
return;
|
||||
wassertr(index >= 0 && index < bag->count);
|
||||
|
||||
if (index < bag->count-1) {
|
||||
memmove(&bag->items[index], &bag->items[index + 1],
|
||||
@@ -144,9 +143,7 @@ WMDeleteFromBag(WMBag *bag, int index)
|
||||
void*
|
||||
WMGetFromBag(WMBag *bag, int index)
|
||||
{
|
||||
if (index < 0 || index >= bag->count) {
|
||||
return NULL;
|
||||
}
|
||||
wassertrv(index >= 0 && index < bag->count, NULL);
|
||||
|
||||
return bag->items[index];
|
||||
}
|
||||
@@ -203,3 +200,17 @@ WMMapBag(WMBag *bag, void *(*function)(void *))
|
||||
return new;
|
||||
}
|
||||
|
||||
|
||||
void*
|
||||
WMReplaceInBag(WMBag *bag, int index, void *item)
|
||||
{
|
||||
void *old;
|
||||
|
||||
wassertrv(index >= 0 && index < bag->count, NULL);
|
||||
|
||||
old = bag->items[index];
|
||||
|
||||
bag->items[index] = item;
|
||||
|
||||
return old;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user