1
0
mirror of https://github.com/gryf/wmaker.git synced 2026-01-04 12:54:20 +01:00

Update for 0.52.0. This is a test version, which brings the Appearance

section to WPrefs for testing purposes.
This commit is contained in:
dan
1999-03-14 22:35:50 +00:00
parent ea5d3bcde3
commit c56756dc73
50 changed files with 2255 additions and 1007 deletions

View File

@@ -23,6 +23,9 @@
#include "WPrefs.h"
#include <unistd.h>
#include <errno.h>
#include "TexturePanel.h"
typedef struct _Panel {
@@ -54,17 +57,17 @@ typedef struct _Panel {
proplist_t menuTex;
proplist_t mtitleTex;
proplist_t backTex;
int ftitleIndex;
int utitleIndex;
int ptitleIndex;
int iconIndex;
int menuIndex;
int mtitleIndex;
int backIndex;
int textureIndex[8];
WMFont *smallFont;
WMFont *normalFont;
WMFont *selectedFont;
WMFont *boldFont;
TexturePanel *texturePanel;
WMPixmap *onLed;
WMPixmap *offLed;
/* for preview shit */
Pixmap preview;
@@ -75,9 +78,26 @@ typedef struct _Panel {
Pixmap back;
Pixmap mtitle;
Pixmap mitem;
char *fprefix;
} _Panel;
typedef struct {
char *title;
char *texture;
proplist_t prop;
Pixmap preview;
char *path;
char selectedFor;
unsigned current:1;
} TextureListItem;
static void showData(_Panel *panel);
#define ICON_FILE "appearance"
@@ -87,23 +107,249 @@ typedef struct _Panel {
#define TEXTR_FILE "textr"
/* XPM */
static char * blueled_xpm[] = {
"8 8 17 1",
" c None",
". c #020204",
"+ c #16B6FC",
"@ c #176AFC",
"# c #163AFC",
"$ c #72D2FC",
"% c #224CF4",
"& c #76D6FC",
"* c #16AAFC",
"= c #CEE9FC",
"- c #229EFC",
"; c #164CFC",
"> c #FAFEFC",
", c #2482FC",
"' c #1652FC",
") c #1E76FC",
"! c #1A60FC",
" .... ",
" .=>-@. ",
".=>$@@'.",
".=$@!;;.",
".!@*+!#.",
".#'*+*,.",
" .@)@,. ",
" .... "};
/* XPM */
static char *blueled2_xpm[] = {
/* width height num_colors chars_per_pixel */
" 8 8 17 1",
/* colors */
". c None",
"# c #090909",
"a c #4b63a4",
"b c #011578",
"c c #264194",
"d c #04338c",
"e c #989dac",
"f c #011a7c",
"g c #465c9c",
"h c #03278a",
"i c #6175ac",
"j c #011e74",
"k c #043a90",
"l c #042f94",
"m c #0933a4",
"n c #022184",
"o c #012998",
/* pixels */
"..####..",
".#aimn#.",
"#aechnf#",
"#gchnjf#",
"#jndknb#",
"#bjdddl#",
".#nono#.",
"..####.."
};
#define FTITLE (1<<0)
#define UTITLE (1<<1)
#define OTITLE (1<<2)
#define ICON (1<<3)
#define BACK (1<<4)
#define MTITLE (1<<5)
#define MITEM (1<<6)
#define MTITLE (1<<3)
#define MITEM (1<<4)
#define ICON (1<<5)
#define BACK (1<<6)
#define EVERYTHING 0xff
static Pixmap
renderTexture(_Panel *panel, char *texture, int width, int height,
Bool bordered)
#define TEXPREV_WIDTH 40
#define TEXPREV_HEIGHT 24
static void
str2rcolor(RContext *rc, char *name, RColor *color)
{
return None;
XColor xcolor;
XParseColor(rc->dpy, rc->cmap, name, &xcolor);
color->alpha = 255;
color->red = xcolor.red >> 8;
color->green = xcolor.green >> 8;
color->blue = xcolor.blue >> 8;
}
static void
dumpRImage(char *path, RImage *image)
{
FILE *f;
f = fopen(path, "w");
if (!f) {
wsyserror(path);
return;
}
fprintf(f, "%02x%02x%1x", image->width, image->height,
image->data[3]!=NULL ? 4 : 3);
fwrite(image->data[0], 1, image->width * image->height, f);
fwrite(image->data[1], 1, image->width * image->height, f);
fwrite(image->data[2], 1, image->width * image->height, f);
if (image->data[3])
fwrite(image->data[3], 1, image->width * image->height, f);
if (fclose(f) < 0) {
wsyserror(path);
}
}
static Pixmap
renderTexture(WMScreen *scr, proplist_t texture, int width, int height,
char *path, Bool bordered)
{
char *type;
RImage *image;
Pixmap pixmap;
RContext *rc = WMScreenRContext(scr);
char *str;
RColor rcolor;
type = PLGetString(PLGetArrayElement(texture, 0));
image = RCreateImage(width, height, False);
if (strcasecmp(type, "solid")==0) {
str = PLGetString(PLGetArrayElement(texture, 1));
str2rcolor(rc, str, &rcolor);
RClearImage(image, &rcolor);
} else if (strcasecmp(&type[1], "gradient")==0) {
int style;
RColor rcolor2;
switch (toupper(type[0])) {
case 'V':
style = RVerticalGradient;
break;
case 'H':
style = RHorizontalGradient;
break;
case 'D':
style = RDiagonalGradient;
break;
}
str = PLGetString(PLGetArrayElement(texture, 1));
str2rcolor(rc, str, &rcolor);
str = PLGetString(PLGetArrayElement(texture, 2));
str2rcolor(rc, str, &rcolor2);
image = RRenderGradient(width, height, &rcolor, &rcolor2, style);
} else if (strcasecmp(&type[2], "gradient")==0) {
int style;
RColor **colors;
int i, j;
switch (toupper(type[1])) {
case 'V':
style = RVerticalGradient;
break;
case 'H':
style = RHorizontalGradient;
break;
case 'D':
style = RDiagonalGradient;
break;
}
j = PLGetNumberOfElements(texture);
if (j > 0) {
colors = wmalloc(j * sizeof(RColor*));
for (i = 2; i < j; i++) {
str = PLGetString(PLGetArrayElement(texture, i));
colors[i-2] = wmalloc(sizeof(RColor));
str2rcolor(rc, str, colors[i-2]);
}
colors[i-2] = NULL;
image = RRenderMultiGradient(width, height, colors, style);
for (i = 0; colors[i]!=NULL; i++)
free(colors[i]);
free(colors);
}
} else if (strcasecmp(&type[1], "pixmap")==0) {
int style;
RImage *timage;
int w, h;
char *path;
str = PLGetString(PLGetArrayElement(texture, 1));
path = wfindfileinarray(GetObjectForKey("PixmapPath"), str);
timage = RLoadImage(rc, path, 0);
free(path);
if (timage) {
w = timage->width;
h = timage->height;
if (w - TEXPREV_WIDTH > h - TEXPREV_HEIGHT) {
h = (w * TEXPREV_HEIGHT)/TEXPREV_WIDTH;
} else {
w = (h * TEXPREV_WIDTH)/TEXPREV_HEIGHT;
}
image = RScaleImage(timage, w, h);
RDestroyImage(timage);
}
}
if (path) {
dumpRImage(path, image);
}
RConvertImage(rc, image, &pixmap);
RDestroyImage(image);
return pixmap;
}
#if 0
static void
updatePreviewBox(_Panel *panel, int elements)
@@ -125,7 +371,7 @@ updatePreviewBox(_Panel *panel, int elements)
if (panel->ftitle)
XFreePixmap(dpy, panel->ftitle);
panel->ftitle = renderTexture(panel, tmp, 180, 20, True);
panel->ftitle = renderTexture(scr, tmp, 180, 20, NULL, True);
free(tmp);
}
@@ -163,11 +409,193 @@ getStrArrayForKey(char *key)
static void
newTexture(WMButton *bPtr, void *data)
cancelNewTexture(void *data)
{
_Panel *panel = (_Panel*)data;
HideTexturePanel(panel->texturePanel);
}
static char*
makeFileName(char *prefix, char *name)
{
char *fname, *str;
int i;
str = wstrappend(prefix, name);
fname = wstrdup(str);
i = 1;
while (access(fname, F_OK)==0) {
char buf[16];
free(fname);
sprintf(buf, "%i", i++);
fname = wstrappend(str, buf);
}
free(str);
return fname;
}
static void
okNewTexture(void *data)
{
_Panel *panel = (_Panel*)data;
WMListItem *item;
char *name;
char *str;
proplist_t prop;
TextureListItem *titem;
WMScreen *scr = WMWidgetScreen(panel->win);
titem = wmalloc(sizeof(TextureListItem));
memset(titem, 0, sizeof(TextureListItem));
HideTexturePanel(panel->texturePanel);
name = GetTexturePanelTextureName(panel->texturePanel);
prop = GetTexturePanelTexture(panel->texturePanel);
str = PLGetDescription(prop);
titem->title = name;
titem->prop = prop;
titem->texture = str;
titem->selectedFor = 0;
titem->path = makeFileName(panel->fprefix, name);
titem->preview = renderTexture(scr, prop, TEXPREV_WIDTH, TEXPREV_HEIGHT,
titem->path, False);
item = WMAddListItem(panel->texLs, "");
item->clientData = titem;
WMSetListPosition(panel->texLs, WMGetListNumberOfRows(panel->texLs));
}
static void
okEditTexture(void *data)
{
_Panel *panel = (_Panel*)data;
WMListItem *item;
char *name;
char *str;
proplist_t prop;
TextureListItem *titem;
item = WMGetListItem(panel->texLs, WMGetListSelectedItemRow(panel->texLs));
titem = (TextureListItem*)item->clientData;
HideTexturePanel(panel->texturePanel);
name = GetTexturePanelTextureName(panel->texturePanel);
prop = GetTexturePanelTexture(panel->texturePanel);
str = PLGetDescription(prop);
free(titem->title);
titem->title = name;
PLRelease(titem->prop);
titem->prop = prop;
free(titem->texture);
titem->texture = str;
XFreePixmap(WMScreenDisplay(WMWidgetScreen(panel->texLs)), titem->preview);
titem->preview = renderTexture(WMWidgetScreen(panel->texLs), titem->prop,
TEXPREV_WIDTH, TEXPREV_HEIGHT,
titem->path, False);
WMRedisplayWidget(panel->texLs);
}
static void
editTexture(WMWidget *w, void *data)
{
_Panel *panel = (_Panel*)data;
WMListItem *item;
TextureListItem *titem;
item = WMGetListItem(panel->texLs, WMGetListSelectedItemRow(panel->texLs));
titem = (TextureListItem*)item->clientData;
SetTexturePanelTexture(panel->texturePanel, titem->title, titem->prop);
SetTexturePanelCancelAction(panel->texturePanel, cancelNewTexture, panel);
SetTexturePanelOkAction(panel->texturePanel, okEditTexture, panel);
SetTexturePanelPixmapPath(panel->texturePanel,
GetObjectForKey("PixmapPath"));
ShowTexturePanel(panel->texturePanel);
}
static void
newTexture(WMWidget *w, void *data)
{
_Panel *panel = (_Panel*)data;
SetTexturePanelTexture(panel->texturePanel, "New Texture", NULL);
SetTexturePanelCancelAction(panel->texturePanel, cancelNewTexture, panel);
SetTexturePanelOkAction(panel->texturePanel, okNewTexture, panel);
SetTexturePanelPixmapPath(panel->texturePanel,
GetObjectForKey("PixmapPath"));
ShowTexturePanel(panel->texturePanel);
}
static void
deleteTexture(WMWidget *w, void *data)
{
_Panel *panel = (_Panel*)data;
WMListItem *item;
TextureListItem *titem;
int row;
int section;
section = WMGetPopUpButtonSelectedItem(panel->secP);
row = WMGetListSelectedItemRow(panel->texLs);
item = WMGetListItem(panel->texLs, row);
titem = (TextureListItem*)item->clientData;
if (titem->selectedFor & (1 << section)) {
TextureListItem *titem2;
panel->textureIndex[section] = section;
item = WMGetListItem(panel->texLs, section);
titem2 = (TextureListItem*)item->clientData;
titem2->selectedFor |= 1 << section;
}
free(titem->title);
free(titem->texture);
PLRelease(titem->prop);
if (titem->path) {
if (remove(titem->path) < 0 && errno != ENOENT) {
wsyserror("could not remove file %s", titem->path);
}
free(titem->path);
}
free(titem);
WMRemoveListItem(panel->texLs, row);
WMSetButtonEnabled(panel->delB, False);
}
@@ -179,34 +607,183 @@ changePage(WMWidget *w, void *data)
section = WMGetPopUpButtonSelectedItem(panel->secP);
WMSelectListItem(panel->texLs, section);
WMSelectListItem(panel->texLs, panel->textureIndex[section]);
WMSetListPosition(panel->texLs, panel->textureIndex[section]
- WMGetListNumberOfRows(panel->texLs)/2);
}
static void
selectTexture(WMWidget *w, void *data)
textureClick(WMWidget *w, void *data)
{
_Panel *panel = (_Panel*)data;
int section;
int i;
WMListItem *item;
TextureListItem *titem;
section = WMGetListSelectedItemRow(panel->secP);
i = WMGetListSelectedItemRow(panel->texLs);
item = WMGetListItem(panel->texLs, i);
titem = (TextureListItem*)item->clientData;
if (titem->current) {
WMSetButtonEnabled(panel->delB, False);
} else {
WMSetButtonEnabled(panel->delB, True);
}
}
static void
textureDoubleClick(WMWidget *w, void *data)
{
_Panel *panel = (_Panel*)data;
int i, section;
WMListItem *item;
TextureListItem *titem;
/* unselect old texture */
section = WMGetPopUpButtonSelectedItem(panel->secP);
item = WMGetListItem(panel->texLs, panel->textureIndex[section]);
titem = (TextureListItem*)item->clientData;
titem->selectedFor &= ~(1 << section);
/* select new texture */
i = WMGetListSelectedItemRow(panel->texLs);
item = WMGetListItem(panel->texLs, i);
titem = (TextureListItem*)item->clientData;
titem->selectedFor |= 1<<section;
panel->textureIndex[section] = i;
WMRedisplayWidget(panel->texLs);
}
static void
paintListItem(WMList *lPtr, int index, Drawable d, char *text, int state,
WMRect *rect)
{
_Panel *panel = (_Panel*)WMGetHangedData(lPtr);
WMScreen *scr = WMWidgetScreen(lPtr);
int width, height, x, y;
Display *dpy = WMScreenDisplay(scr);
WMColor *white = WMWhiteColor(scr);
WMListItem *item;
WMColor *black = WMBlackColor(scr);
TextureListItem *titem;
width = rect->size.width;
height = rect->size.height;
x = rect->pos.x;
y = rect->pos.y;
if (state & WLDSSelected)
XFillRectangle(dpy, d, WMColorGC(white), x, y, width, height);
else
XClearArea(dpy, d, x, y, width, height, False);
item = WMGetListItem(lPtr, index);
titem = (TextureListItem*)item->clientData;
if (titem->preview)
XCopyArea(dpy, titem->preview, d, WMColorGC(black), 0, 0, TEXPREV_WIDTH,
TEXPREV_HEIGHT, x + 5, y + 5);
if ((1 << WMGetPopUpButtonSelectedItem(panel->secP)) & titem->selectedFor)
WMDrawPixmap(panel->onLed, d, x + TEXPREV_WIDTH + 10, y + 6);
else if (titem->selectedFor)
WMDrawPixmap(panel->offLed, d, x + TEXPREV_WIDTH + 10, y + 6);
WMDrawString(scr, d, WMColorGC(black), panel->boldFont,
x + TEXPREV_WIDTH + 22, y + 2, titem->title,
strlen(titem->title));
WMDrawString(scr, d, WMColorGC(black), panel->smallFont,
x + TEXPREV_WIDTH + 14, y + 18, titem->texture,
strlen(titem->texture));
WMReleaseColor(white);
WMReleaseColor(black);
}
static Pixmap
loadRImage(WMScreen *scr, char *path)
{
FILE *f;
RImage *image;
int w, h, d;
int i;
Pixmap pixmap;
f = fopen(path, "r");
if (!f)
return None;
fscanf(f, "%02x%02x%1x", &w, &h, &d);
image = RCreateImage(w, h, d == 4);
for (i = 0; i < d; i++) {
fread(image->data[i], 1, w*h, f);
}
fclose(f);
RConvertImage(WMScreenRContext(scr), image, &pixmap);
RDestroyImage(image);
return pixmap;
}
static void
fillTextureList(WMList *lPtr)
{
proplist_t textures;
proplist_t textureList;
proplist_t texture;
WMUserDefaults *udb = WMGetStandardUserDefaults();
int i;
TextureListItem *titem;
WMScreen *scr = WMWidgetScreen(lPtr);
textures = WMGetUDObjectForKey(udb, "Textures");
if (!textures)
textureList = WMGetUDObjectForKey(udb, "TextureList");
if (!textureList)
return;
for (i = 0; i < PLGetNumberOfElements(textureList); i++) {
WMListItem *item;
texture = PLGetArrayElement(textureList, i);
titem = wmalloc(sizeof(TextureListItem));
memset(titem, 0, sizeof(TextureListItem));
titem->title = wstrdup(PLGetString(PLGetArrayElement(texture, 0)));
titem->prop = PLRetain(PLGetArrayElement(texture, 1));
titem->texture = PLGetDescription(titem->prop);
titem->selectedFor = 0;
titem->path = wstrdup(PLGetString(PLGetArrayElement(texture, 2)));
titem->preview = loadRImage(scr, titem->path);
if (!titem->preview) {
titem->preview = renderTexture(scr, titem->prop, TEXPREV_WIDTH,
TEXPREV_HEIGHT, NULL, False);
}
item = WMAddListItem(lPtr, "");
item->clientData = titem;
}
}
@@ -218,6 +795,35 @@ createPanel(Panel *p)
WMFont *font;
WMScreen *scr = WMWidgetScreen(panel->win);
char *tmp;
Bool ok = True;
panel->fprefix = wstrappend(wusergnusteppath(), "/.AppInfo");
if (access(panel->fprefix, F_OK)!=0) {
if (mkdir(panel->fprefix, 0755) < 0) {
wsyserror(panel->fprefix);
ok = False;
}
}
if (ok) {
tmp = wstrappend(panel->fprefix, "/WPrefs/");
free(panel->fprefix);
panel->fprefix = tmp;
if (access(panel->fprefix, F_OK)!=0) {
if (mkdir(panel->fprefix, 0755) < 0) {
wsyserror(panel->fprefix);
}
}
}
panel->smallFont = WMSystemFontOfSize(scr, 10);
panel->normalFont = WMSystemFontOfSize(scr, 12);
panel->boldFont = WMBoldSystemFontOfSize(scr, 12);
panel->onLed = WMCreatePixmapFromXPMData(scr, blueled_xpm);
panel->offLed = WMCreatePixmapFromXPMData(scr, blueled2_xpm);
panel->frame = WMCreateFrame(panel->win);
WMResizeWidget(panel->frame, FRAME_WIDTH, FRAME_HEIGHT);
WMMoveWidget(panel->frame, FRAME_LEFT, FRAME_TOP);
@@ -238,7 +844,8 @@ createPanel(Panel *p)
WMAddPopUpButtonItem(panel->secP, _("Titlebar of Menus"));
WMAddPopUpButtonItem(panel->secP, _("Menu Items"));
WMAddPopUpButtonItem(panel->secP, _("Icon Background"));
WMAddPopUpButtonItem(panel->secP, _("Workspace Backgrounds"));
/* WMAddPopUpButtonItem(panel->secP, _("Workspace Backgrounds"));
*/
WMSetPopUpButtonAction(panel->secP, changePage, panel);
/* texture list */
@@ -263,7 +870,12 @@ createPanel(Panel *p)
panel->texLs = WMCreateList(panel->frame);
WMResizeWidget(panel->texLs, 225, 144);
WMMoveWidget(panel->texLs, 285, 30);
WMSetListUserDrawItemHeight(panel->texLs, 35);
WMSetListUserDrawProc(panel->texLs, paintListItem);
WMHangData(panel->texLs, panel);
WMSetListAction(panel->texLs, textureClick, panel);
WMSetListDoubleAction(panel->texLs, textureDoubleClick, panel);
/* command buttons */
font = WMSystemFontOfSize(scr, 10);
@@ -275,6 +887,7 @@ createPanel(Panel *p)
WMSetButtonFont(panel->newB, font);
WMSetButtonImagePosition(panel->newB, WIPAbove);
WMSetButtonText(panel->newB, _("New"));
WMSetButtonAction(panel->newB, newTexture, panel);
SetButtonAlphaImage(scr, panel->newB, TNEW_FILE);
panel->ripB = WMCreateCommandButton(panel->frame);
@@ -285,6 +898,8 @@ createPanel(Panel *p)
WMSetButtonText(panel->ripB, _("Extract..."));
SetButtonAlphaImage(scr, panel->ripB, TEXTR_FILE);
WMSetButtonEnabled(panel->ripB, False);
panel->editB = WMCreateCommandButton(panel->frame);
WMResizeWidget(panel->editB, 56, 48);
WMMoveWidget(panel->editB, 397, 180);
@@ -292,7 +907,7 @@ createPanel(Panel *p)
WMSetButtonImagePosition(panel->editB, WIPAbove);
WMSetButtonText(panel->editB, _("Edit"));
SetButtonAlphaImage(scr, panel->editB, TEDIT_FILE);
WMSetButtonEnabled(panel->editB, False);
WMSetButtonAction(panel->editB, editTexture, panel);
panel->delB = WMCreateCommandButton(panel->frame);
WMResizeWidget(panel->delB, 56, 48);
@@ -302,6 +917,7 @@ createPanel(Panel *p)
WMSetButtonText(panel->delB, _("Delete"));
SetButtonAlphaImage(scr, panel->delB, TDEL_FILE);
WMSetButtonEnabled(panel->delB, False);
WMSetButtonAction(panel->delB, deleteTexture, panel);
WMReleaseFont(font);
@@ -316,61 +932,133 @@ createPanel(Panel *p)
fillTextureList(panel->texLs);
panel->texturePanel = CreateTexturePanel(panel->win);
}
static proplist_t
setupTextureFor(WMList *list, char *key, char *defValue, char *title)
setupTextureFor(WMList *list, char *key, char *defValue, char *title,
int index)
{
WMListItem *item;
char *tex, *str;
proplist_t prop;
TextureListItem *titem;
prop = GetObjectForKey(key);
if (!prop) {
prop = PLMakeString(defValue);
titem = wmalloc(sizeof(TextureListItem));
memset(titem, 0, sizeof(TextureListItem));
titem->title = wstrdup(title);
titem->prop = GetObjectForKey(key);
if (!titem->prop) {
titem->prop = PLGetProplistWithDescription(defValue);
} else {
PLRetain(titem->prop);
}
tex = PLGetDescription(prop);
str = wstrappend(title, tex);
free(tex);
item = WMAddListItem(list, str);
free(str);
item->clientData = prop;
titem->texture = PLGetDescription((proplist_t)titem->prop);
titem->current = 1;
titem->selectedFor = 1<<index;
return prop;
titem->preview = renderTexture(WMWidgetScreen(list), titem->prop,
TEXPREV_WIDTH, TEXPREV_HEIGHT, NULL, False);
item = WMAddListItem(list, "");
item->clientData = titem;
return titem->prop;
}
static void
showData(_Panel *panel)
{
int i = 0;
panel->ftitleTex = setupTextureFor(panel->texLs, "FTitleBack",
"(solid, black)", "[Focused]:");
panel->ftitleIndex = 0;
"(solid, black)", "[Focused]", i);
panel->textureIndex[i] = i++;
panel->utitleTex = setupTextureFor(panel->texLs, "UTitleBack",
"(solid, gray)", "[Unfocused]:");
panel->utitleIndex = 1;
"(solid, gray)", "[Unfocused]", i);
panel->textureIndex[i] = i++;
panel->ptitleTex = setupTextureFor(panel->texLs, "PTitleBack",
"(solid, \"#616161\")",
"[Owner of Focused]:");
panel->ptitleIndex = 2;
"[Owner of Focused]", i);
panel->textureIndex[i] = i++;
panel->mtitleTex = setupTextureFor(panel->texLs, "MenuTitleBack",
"(solid, black)", "[Menu Title]:");
panel->mtitleIndex = 3;
"(solid, black)", "[Menu Title]", i);
panel->textureIndex[i] = i++;
panel->menuTex = setupTextureFor(panel->texLs, "MenuTextBack",
"(solid, gray)", "[Menu Item]:");
panel->menuIndex = 4;
"(solid, gray)", "[Menu Item]", i);
panel->textureIndex[i] = i++;
panel->iconTex = setupTextureFor(panel->texLs, "IconBack",
"(solid, gray)", "[Icon]:");
panel->iconIndex = 5;
"(solid, gray)", "[Icon]", i);
panel->textureIndex[i] = i++;
/*
panel->backTex = setupTextureFor(panel->texLs, "WorkspaceBack",
"(solid, black)", "[Workspace]:");
panel->backIndex = 6;
"(solid, black)", "[Workspace]", i);
panel->textureIndex[i] = i++;
*/
}
static void
storeData(_Panel *panel)
{
proplist_t textureList;
proplist_t texture;
int i;
TextureListItem *titem;
WMListItem *item;
WMUserDefaults *udb = WMGetStandardUserDefaults();
textureList = PLMakeArrayFromElements(NULL, NULL);
/* store list of textures */
for (i = 6; i < WMGetListNumberOfRows(panel->texLs); i++) {
item = WMGetListItem(panel->texLs, i);
titem = (TextureListItem*)item->clientData;
texture = PLMakeArrayFromElements(PLMakeString(titem->title),
PLRetain(titem->prop),
PLMakeString(titem->path),
NULL);
PLAppendArrayElement(textureList, texture);
}
WMSetUDObjectForKey(udb, textureList, "TextureList");
PLRelease(textureList);
item = WMGetListItem(panel->texLs, panel->textureIndex[0]);
titem = (TextureListItem*)item->clientData;
SetObjectForKey(titem->prop, "FTitleBack");
item = WMGetListItem(panel->texLs, panel->textureIndex[1]);
titem = (TextureListItem*)item->clientData;
SetObjectForKey(titem->prop, "UTitleBack");
item = WMGetListItem(panel->texLs, panel->textureIndex[2]);
titem = (TextureListItem*)item->clientData;
SetObjectForKey(titem->prop, "PTitleBack");
item = WMGetListItem(panel->texLs, panel->textureIndex[3]);
titem = (TextureListItem*)item->clientData;
SetObjectForKey(titem->prop, "MenuTextBack");
item = WMGetListItem(panel->texLs, panel->textureIndex[4]);
titem = (TextureListItem*)item->clientData;
SetObjectForKey(titem->prop, "MenuItemBack");
item = WMGetListItem(panel->texLs, panel->textureIndex[5]);
titem = (TextureListItem*)item->clientData;
SetObjectForKey(titem->prop, "IconBack");
}
@@ -388,6 +1076,7 @@ InitAppearance(WMScreen *scr, WMWindow *win)
panel->win = win;
panel->callbacks.createWidgets = createPanel;
panel->callbacks.updateDomain = storeData;
AddSection(panel, ICON_FILE);