mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-22 14:08:06 +01:00
WPrefs: Code formatting in TexturePanel.c; minimizes checkpatch.pl warnings.
This commit is contained in:
committed by
Carlos R. Mafra
parent
bf6f81434b
commit
9f7e51e66d
@@ -201,19 +201,17 @@ static void updateTGradImage(TexturePanel * panel)
|
|||||||
to.green = WMGreenComponentOfColor(color) >> 8;
|
to.green = WMGreenComponentOfColor(color) >> 8;
|
||||||
to.blue = WMBlueComponentOfColor(color) >> 8;
|
to.blue = WMBlueComponentOfColor(color) >> 8;
|
||||||
|
|
||||||
if (panel->image->width < 141 || panel->image->height < 91) {
|
if (panel->image->width < 141 || panel->image->height < 91)
|
||||||
image = RMakeTiledImage(panel->image, 141, 91);
|
image = RMakeTiledImage(panel->image, 141, 91);
|
||||||
} else {
|
else
|
||||||
image = RCloneImage(panel->image);
|
image = RCloneImage(panel->image);
|
||||||
}
|
|
||||||
|
|
||||||
if (WMGetButtonSelected(panel->dirhB)) {
|
if (WMGetButtonSelected(panel->dirhB))
|
||||||
gradient = RRenderGradient(image->width, image->height, &from, &to, RHorizontalGradient);
|
gradient = RRenderGradient(image->width, image->height, &from, &to, RHorizontalGradient);
|
||||||
} else if (WMGetButtonSelected(panel->dirvB)) {
|
else if (WMGetButtonSelected(panel->dirvB))
|
||||||
gradient = RRenderGradient(image->width, image->height, &from, &to, RVerticalGradient);
|
gradient = RRenderGradient(image->width, image->height, &from, &to, RVerticalGradient);
|
||||||
} else {
|
else
|
||||||
gradient = RRenderGradient(image->width, image->height, &from, &to, RDiagonalGradient);
|
gradient = RRenderGradient(image->width, image->height, &from, &to, RDiagonalGradient);
|
||||||
}
|
|
||||||
|
|
||||||
RCombineImagesWithOpaqueness(image, gradient, WMGetSliderValue(panel->topaS));
|
RCombineImagesWithOpaqueness(image, gradient, WMGetSliderValue(panel->topaS));
|
||||||
RReleaseImage(gradient);
|
RReleaseImage(gradient);
|
||||||
@@ -417,9 +415,8 @@ static void sliderChangeCallback(WMWidget * w, void *data)
|
|||||||
}
|
}
|
||||||
colors[i] = NULL;
|
colors[i] = NULL;
|
||||||
|
|
||||||
if (panel->gimage != None) {
|
if (panel->gimage != None)
|
||||||
XFreePixmap(WMScreenDisplay(scr), panel->gimage);
|
XFreePixmap(WMScreenDisplay(scr), panel->gimage);
|
||||||
}
|
|
||||||
|
|
||||||
image = RRenderMultiGradient(30, i * WMGetListItemHeight(panel->gcolL), colors, RVerticalGradient);
|
image = RRenderMultiGradient(30, i * WMGetListItemHeight(panel->gcolL), colors, RVerticalGradient);
|
||||||
RConvertImage(WMScreenRContext(scr), image, &panel->gimage);
|
RConvertImage(WMScreenRContext(scr), image, &panel->gimage);
|
||||||
@@ -618,7 +615,7 @@ static void browseImageCallback(WMWidget * w, void *data)
|
|||||||
TexturePanel *panel = (TexturePanel *) data;
|
TexturePanel *panel = (TexturePanel *) data;
|
||||||
WMOpenPanel *opanel;
|
WMOpenPanel *opanel;
|
||||||
WMScreen *scr = WMWidgetScreen(w);
|
WMScreen *scr = WMWidgetScreen(w);
|
||||||
static char *ipath = NULL;
|
static char *ipath;
|
||||||
|
|
||||||
opanel = WMGetOpenPanel(scr);
|
opanel = WMGetOpenPanel(scr);
|
||||||
WMSetFilePanelCanChooseDirectories(opanel, False);
|
WMSetFilePanelCanChooseDirectories(opanel, False);
|
||||||
@@ -674,12 +671,11 @@ static void buttonCallback(WMWidget * w, void *data)
|
|||||||
{
|
{
|
||||||
TexturePanel *panel = (TexturePanel *) data;
|
TexturePanel *panel = (TexturePanel *) data;
|
||||||
|
|
||||||
if (w == panel->okB) {
|
if (w == panel->okB)
|
||||||
(*panel->okAction) (panel->okData);
|
(*panel->okAction) (panel->okData);
|
||||||
} else {
|
else
|
||||||
(*panel->cancelAction) (panel->cancelData);
|
(*panel->cancelAction) (panel->cancelData);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
static void changeTypeCallback(WMWidget *w, void *data)
|
static void changeTypeCallback(WMWidget *w, void *data)
|
||||||
{
|
{
|
||||||
@@ -775,9 +771,8 @@ void SetTexturePanelTexture(TexturePanel * panel, const char *name, WMPropList *
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
p = WMGetFromPLArray(texture, 0);
|
p = WMGetFromPLArray(texture, 0);
|
||||||
if (!p) {
|
if (!p)
|
||||||
goto bad_texture;
|
goto bad_texture;
|
||||||
}
|
|
||||||
type = WMGetFromPLString(p);
|
type = WMGetFromPLString(p);
|
||||||
|
|
||||||
/*............................................... */
|
/*............................................... */
|
||||||
@@ -786,11 +781,10 @@ void SetTexturePanelTexture(TexturePanel * panel, const char *name, WMPropList *
|
|||||||
WMSetPopUpButtonSelectedItem(panel->typeP, TYPE_SOLID);
|
WMSetPopUpButtonSelectedItem(panel->typeP, TYPE_SOLID);
|
||||||
|
|
||||||
p = WMGetFromPLArray(texture, 1);
|
p = WMGetFromPLArray(texture, 1);
|
||||||
if (!p) {
|
if (!p)
|
||||||
str = "black";
|
str = "black";
|
||||||
} else {
|
else
|
||||||
str = WMGetFromPLString(p);
|
str = WMGetFromPLString(p);
|
||||||
}
|
|
||||||
color = WMCreateNamedColor(scr, str, False);
|
color = WMCreateNamedColor(scr, str, False);
|
||||||
|
|
||||||
WMSetColorWellColor(panel->defcW, color);
|
WMSetColorWellColor(panel->defcW, color);
|
||||||
@@ -803,11 +797,10 @@ void SetTexturePanelTexture(TexturePanel * panel, const char *name, WMPropList *
|
|||||||
WMSetPopUpButtonSelectedItem(panel->typeP, TYPE_SGRADIENT);
|
WMSetPopUpButtonSelectedItem(panel->typeP, TYPE_SGRADIENT);
|
||||||
|
|
||||||
p = WMGetFromPLArray(texture, 1);
|
p = WMGetFromPLArray(texture, 1);
|
||||||
if (!p) {
|
if (!p)
|
||||||
str = "black";
|
str = "black";
|
||||||
} else {
|
else
|
||||||
str = WMGetFromPLString(p);
|
str = WMGetFromPLString(p);
|
||||||
}
|
|
||||||
color = WMCreateNamedColor(scr, str, False);
|
color = WMCreateNamedColor(scr, str, False);
|
||||||
|
|
||||||
WMSetColorWellColor(panel->tcol1W, color);
|
WMSetColorWellColor(panel->tcol1W, color);
|
||||||
@@ -815,11 +808,10 @@ void SetTexturePanelTexture(TexturePanel * panel, const char *name, WMPropList *
|
|||||||
WMReleaseColor(color);
|
WMReleaseColor(color);
|
||||||
|
|
||||||
p = WMGetFromPLArray(texture, 2);
|
p = WMGetFromPLArray(texture, 2);
|
||||||
if (!p) {
|
if (!p)
|
||||||
str = "black";
|
str = "black";
|
||||||
} else {
|
else
|
||||||
str = WMGetFromPLString(p);
|
str = WMGetFromPLString(p);
|
||||||
}
|
|
||||||
color = WMCreateNamedColor(scr, str, False);
|
color = WMCreateNamedColor(scr, str, False);
|
||||||
|
|
||||||
WMSetColorWellColor(panel->tcol2W, color);
|
WMSetColorWellColor(panel->tcol2W, color);
|
||||||
@@ -846,11 +838,10 @@ void SetTexturePanelTexture(TexturePanel * panel, const char *name, WMPropList *
|
|||||||
WMSetSliderValue(panel->topaS, i);
|
WMSetSliderValue(panel->topaS, i);
|
||||||
|
|
||||||
p = WMGetFromPLArray(texture, 3);
|
p = WMGetFromPLArray(texture, 3);
|
||||||
if (!p) {
|
if (!p)
|
||||||
str = "black";
|
str = "black";
|
||||||
} else {
|
else
|
||||||
str = WMGetFromPLString(p);
|
str = WMGetFromPLString(p);
|
||||||
}
|
|
||||||
color = WMCreateNamedColor(scr, str, False);
|
color = WMCreateNamedColor(scr, str, False);
|
||||||
|
|
||||||
WMSetColorWellColor(panel->tcol1W, color);
|
WMSetColorWellColor(panel->tcol1W, color);
|
||||||
@@ -858,11 +849,10 @@ void SetTexturePanelTexture(TexturePanel * panel, const char *name, WMPropList *
|
|||||||
WMReleaseColor(color);
|
WMReleaseColor(color);
|
||||||
|
|
||||||
p = WMGetFromPLArray(texture, 4);
|
p = WMGetFromPLArray(texture, 4);
|
||||||
if (!p) {
|
if (!p)
|
||||||
str = "black";
|
str = "black";
|
||||||
} else {
|
else
|
||||||
str = WMGetFromPLString(p);
|
str = WMGetFromPLString(p);
|
||||||
}
|
|
||||||
color = WMCreateNamedColor(scr, str, False);
|
color = WMCreateNamedColor(scr, str, False);
|
||||||
|
|
||||||
WMSetColorWellColor(panel->tcol2W, color);
|
WMSetColorWellColor(panel->tcol2W, color);
|
||||||
@@ -873,9 +863,9 @@ void SetTexturePanelTexture(TexturePanel * panel, const char *name, WMPropList *
|
|||||||
|
|
||||||
if (panel->imageFile)
|
if (panel->imageFile)
|
||||||
wfree(panel->imageFile);
|
wfree(panel->imageFile);
|
||||||
if ((panel->imageFile = wfindfileinarray(panel->pathList,
|
panel->imageFile = wfindfileinarray(panel->pathList,
|
||||||
WMGetFromPLString(WMGetFromPLArray(texture, 1)))) !=
|
WMGetFromPLString(WMGetFromPLArray(texture, 1)));
|
||||||
NULL) {
|
if (panel->imageFile != NULL) {
|
||||||
|
|
||||||
panel->image = RLoadImage(WMScreenRContext(scr), panel->imageFile, 0);
|
panel->image = RLoadImage(WMScreenRContext(scr), panel->imageFile, 0);
|
||||||
updateTGradImage(panel);
|
updateTGradImage(panel);
|
||||||
@@ -899,11 +889,10 @@ void SetTexturePanelTexture(TexturePanel * panel, const char *name, WMPropList *
|
|||||||
WMSetPopUpButtonSelectedItem(panel->typeP, TYPE_GRADIENT);
|
WMSetPopUpButtonSelectedItem(panel->typeP, TYPE_GRADIENT);
|
||||||
|
|
||||||
p = WMGetFromPLArray(texture, 1);
|
p = WMGetFromPLArray(texture, 1);
|
||||||
if (!p) {
|
if (!p)
|
||||||
str = "black";
|
str = "black";
|
||||||
} else {
|
else
|
||||||
str = WMGetFromPLString(p);
|
str = WMGetFromPLString(p);
|
||||||
}
|
|
||||||
color = WMCreateNamedColor(scr, str, False);
|
color = WMCreateNamedColor(scr, str, False);
|
||||||
|
|
||||||
WMSetColorWellColor(panel->defcW, color);
|
WMSetColorWellColor(panel->defcW, color);
|
||||||
@@ -915,11 +904,10 @@ void SetTexturePanelTexture(TexturePanel * panel, const char *name, WMPropList *
|
|||||||
XColor xcolor;
|
XColor xcolor;
|
||||||
|
|
||||||
p = WMGetFromPLArray(texture, i);
|
p = WMGetFromPLArray(texture, i);
|
||||||
if (!p) {
|
if (!p)
|
||||||
str = "black";
|
str = "black";
|
||||||
} else {
|
else
|
||||||
str = WMGetFromPLString(p);
|
str = WMGetFromPLString(p);
|
||||||
}
|
|
||||||
|
|
||||||
XParseColor(WMScreenDisplay(scr), WMScreenRContext(scr)->cmap, str, &xcolor);
|
XParseColor(WMScreenDisplay(scr), WMScreenRContext(scr)->cmap, str, &xcolor);
|
||||||
|
|
||||||
@@ -1104,13 +1092,12 @@ WMPropList *GetTexturePanelTexture(TexturePanel * panel)
|
|||||||
color = WMGetColorWellColor(panel->defcW);
|
color = WMGetColorWellColor(panel->defcW);
|
||||||
str = WMGetColorRGBDescription(color);
|
str = WMGetColorRGBDescription(color);
|
||||||
|
|
||||||
if (WMGetButtonSelected(panel->dirdB)) {
|
if (WMGetButtonSelected(panel->dirdB))
|
||||||
prop = WMCreatePLArray(WMCreatePLString("mdgradient"), WMCreatePLString(str), NULL);
|
prop = WMCreatePLArray(WMCreatePLString("mdgradient"), WMCreatePLString(str), NULL);
|
||||||
} else if (WMGetButtonSelected(panel->dirvB)) {
|
else if (WMGetButtonSelected(panel->dirvB))
|
||||||
prop = WMCreatePLArray(WMCreatePLString("mvgradient"), WMCreatePLString(str), NULL);
|
prop = WMCreatePLArray(WMCreatePLString("mvgradient"), WMCreatePLString(str), NULL);
|
||||||
} else {
|
else
|
||||||
prop = WMCreatePLArray(WMCreatePLString("mhgradient"), WMCreatePLString(str), NULL);
|
prop = WMCreatePLArray(WMCreatePLString("mhgradient"), WMCreatePLString(str), NULL);
|
||||||
}
|
|
||||||
wfree(str);
|
wfree(str);
|
||||||
|
|
||||||
for (i = 0; i < WMGetListNumberOfRows(panel->gcolL); i++) {
|
for (i = 0; i < WMGetListNumberOfRows(panel->gcolL); i++) {
|
||||||
@@ -1510,7 +1497,7 @@ void testCancelButton(WMWidget * self, void *data)
|
|||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void wAbort()
|
void wAbort(void)
|
||||||
{
|
{
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user