1
0
mirror of https://github.com/gryf/wmaker.git synced 2026-07-10 04:36:36 +02:00

Compare commits

...

30 Commits

Author SHA1 Message Date
David Maciejak a383074c99 WPrefs: sort alphabetically the key shortcut actions and expert options
There are too many entries now in key shortcut actions and expert options,
better to sort them dynamically.
2023-03-03 14:15:19 +00:00
David Maciejak 52a623729d Coverity: fix WRaster convert uninitialized scalar variable 2023-03-03 14:15:19 +00:00
David Maciejak d4ee17f0b5 Coverity: fix WPrefs workspace negative array index read 2023-03-03 14:15:19 +00:00
David Maciejak 7475bc5d0a Coverity: fix util wmsetbg resource leak 2023-03-03 14:15:19 +00:00
David Maciejak 35f87b5592 WRaster: add new file references for translation
This patch is adding the references for the two newly added files
save_jpeg.c and save_png.c for translation (even if those new
files are not adding any new strings to be translated).
2023-03-03 09:51:24 +00:00
David Maciejak 5e37d13eb6 Coverity: fix wmgenmenu resource leak 2023-03-02 17:04:48 +00:00
David Maciejak 4b1aee3e79 Coverity: fix wmmenugen resource leak 2023-03-02 17:04:48 +00:00
David Maciejak 0ccc5bbde7 Coverity: fix wmspec dereference after null check 2023-03-02 17:04:48 +00:00
David Maciejak 59a686d22e Coverity: fix WPrefs appearance negative array index read 2023-03-02 17:04:48 +00:00
David Maciejak 26d46f6e16 Coverity: fix WPrefs menu negative array index read 2023-03-02 17:04:48 +00:00
David Maciejak ceafbf0629 Coverity: fix WPrefs mousesettings menu negative array index read 2023-03-02 17:04:48 +00:00
David Maciejak cf178d011b Coverity: fix WPrefs preference negative array index read 2023-03-02 17:04:48 +00:00
David Maciejak 682c2767c2 Coverity: fix WPrefs texturepanel negative array index read 2023-03-02 17:04:48 +00:00
David Maciejak 0e00c6b605 Coverity: fix dialog dereference null return value
This patch is making sure defaultPath returns from FindImage() is not null
and freeing the variables.
2023-03-02 17:04:48 +00:00
David Maciejak e9717ed719 Coverity: fix WPrefs appearance time of check time of use 2023-03-02 17:04:48 +00:00
David Maciejak 9e59d19507 Coverity: fix WPrefs editmenu uninitialized scalar variables 2023-03-02 17:04:48 +00:00
David Maciejak 94f98dcd25 Coverity: fix WRaster convert uninitialized scalar variable 2023-03-02 17:04:48 +00:00
David Maciejak 6c7266c338 Coverity: fix session resource leak 2023-03-02 17:04:48 +00:00
David Maciejak b4bd6d0cad Coverity: fix xmodifier uninitialized scalar variable 2023-03-02 17:04:48 +00:00
David Maciejak c7f7c10d7c Coverity: fix wmsetbg string not null terminated 2023-03-02 17:04:48 +00:00
David Maciejak d831766572 Coverity: fix rootmenu structurally dead code 2023-03-02 17:04:48 +00:00
David Maciejak e2ecfbfd54 Coverity: fix wcolorpanel uninitialized scalar value 2023-03-02 17:04:48 +00:00
David Maciejak a8ec32d41a Coverity: fix setstyle resource leak 2023-03-02 17:04:48 +00:00
David Maciejak 1215680b6d Coverity: fix misc resource leak 2023-03-02 17:04:48 +00:00
David Maciejak 77df89396c Coverity: fix menuparser_macro uninitialized pointer read 2023-03-02 17:04:48 +00:00
David Maciejak c8883fdbb0 WRaster: add functions to save image on disk
This patch adds the RSaveTitledImage() function to the WRaster lib
to be able to save file on disk either as a PNG or a JPEG file.
Those two formats depends on optional external libs.
The function can take an optional title/comment which will
be save inside the file.

The WRaster lib and header versions are bumped.
2023-03-02 10:23:47 +00:00
David Maciejak 3cc5808dcd Coverity: fix wmspec uninitialized layer variable 2023-02-28 13:40:48 +00:00
David Maciejak 8ca89f0141 Coverity: fix RContextAttributes uninitialized variable 2023-02-28 13:33:11 +00:00
David Maciejak 76fa91d21e Coverity: fix wmiv resource leak 2023-02-28 13:33:11 +00:00
David Maciejak d2d5297a1e Coverity: fix potential buffer overflow 2023-02-28 13:33:11 +00:00
36 changed files with 426 additions and 73 deletions
+1 -1
View File
@@ -615,7 +615,7 @@ static void menu_parser_condition_ifmacro(WMenuParser parser, Bool check_exists)
((!check_exists) && (macro != NULL)); ((!check_exists) && (macro != NULL));
} }
strcpy(parser->cond.stack[0].name, cmd_name); strncpy(parser->cond.stack[0].name, cmd_name, sizeof(parser->cond.stack[0].name) - 1);
parser->cond.stack[0].line = parser->line_number; parser->cond.stack[0].line = parser->line_number;
} }
+4 -1
View File
@@ -167,6 +167,7 @@ void menu_parser_define_macro(WMenuParser parser)
return; return;
} }
macro = wmalloc(sizeof(*macro)); macro = wmalloc(sizeof(*macro));
memset(arg_name, 0, MAX_MACRO_ARG_COUNT * sizeof(char *));
/* Isolate name of macro */ /* Isolate name of macro */
idx = 0; idx = 0;
@@ -392,6 +393,8 @@ void menu_parser_expand_macro(WMenuParser parser, WParserMacro *macro)
unsigned int size; unsigned int size;
int i, space_left; int i, space_left;
memset(arg_value, 0, MAX_MACRO_ARG_COUNT * sizeof(char *));
/* Skip the name of the macro, this was not done by caller */ /* Skip the name of the macro, this was not done by caller */
for (i = 0; macro->name[i] != '\0'; i++) for (i = 0; macro->name[i] != '\0'; i++)
parser->rd++; parser->rd++;
@@ -693,7 +696,7 @@ static void w_create_macro(WMenuParser parser, const char *name, WParserMacroFun
WParserMacro *macro; WParserMacro *macro;
macro = wmalloc(sizeof(*macro)); macro = wmalloc(sizeof(*macro));
strcpy(macro->name, name); strncpy(macro->name, name, sizeof(macro->name) - 1);
macro->function = handler; macro->function = handler;
macro->arg_count = -1; macro->arg_count = -1;
macro->next = parser->macros; macro->next = parser->macros;
+3 -3
View File
@@ -2259,7 +2259,7 @@ static void wheelPositionSelectionOutBounds(W_ColorPanel * panel, int x, int y)
static void wheelUpdateBrightnessGradientFromLocation(W_ColorPanel * panel) static void wheelUpdateBrightnessGradientFromLocation(W_ColorPanel * panel)
{ {
CPColor from; CPColor from = {};
unsigned long ofs; unsigned long ofs;
ofs = panel->coly * panel->wheelMtrx->width + panel->colx; ofs = panel->coly * panel->wheelMtrx->width + panel->colx;
@@ -2604,7 +2604,7 @@ static void cmykTextFieldCallback(void *observerData, WMNotification * notificat
static void hsbSliderCallback(WMWidget * w, void *data) static void hsbSliderCallback(WMWidget * w, void *data)
{ {
CPColor cpColor; CPColor cpColor = {};
int value[3]; int value[3];
char tmp[4]; char tmp[4];
W_ColorPanel *panel = (W_ColorPanel *) data; W_ColorPanel *panel = (W_ColorPanel *) data;
@@ -2640,7 +2640,7 @@ static void hsbSliderCallback(WMWidget * w, void *data)
static void hsbTextFieldCallback(void *observerData, WMNotification * notification) static void hsbTextFieldCallback(void *observerData, WMNotification * notification)
{ {
CPColor cpColor; CPColor cpColor = {};
int value[3]; int value[3];
char tmp[12]; /* We only 4 bytes needed, but compilers cannot know that */ char tmp[12]; /* We only 4 bytes needed, but compilers cannot know that */
int n; int n;
+17 -5
View File
@@ -1076,6 +1076,8 @@ static void deleteTexture(WMWidget * w, void *data)
(void) w; (void) w;
section = WMGetPopUpButtonSelectedItem(panel->secP); section = WMGetPopUpButtonSelectedItem(panel->secP);
if (section < 0)
return;
row = WMGetListSelectedItemRow(panel->texLs); row = WMGetListSelectedItemRow(panel->texLs);
item = WMGetListItem(panel->texLs, row); item = WMGetListItem(panel->texLs, row);
titem = (TextureListItem *) item->clientData; titem = (TextureListItem *) item->clientData;
@@ -1134,6 +1136,8 @@ static void changePage(WMWidget * w, void *data)
if (w) { if (w) {
section = WMGetPopUpButtonSelectedItem(panel->secP); section = WMGetPopUpButtonSelectedItem(panel->secP);
if (section < 0)
return;
WMSelectListItem(panel->texLs, panel->textureIndex[section]); WMSelectListItem(panel->texLs, panel->textureIndex[section]);
@@ -1233,6 +1237,8 @@ static void textureDoubleClick(WMWidget * w, void *data)
/* unselect old texture */ /* unselect old texture */
section = WMGetPopUpButtonSelectedItem(panel->secP); section = WMGetPopUpButtonSelectedItem(panel->secP);
if (section < 0)
return;
item = WMGetListItem(panel->texLs, panel->textureIndex[section]); item = WMGetListItem(panel->texLs, panel->textureIndex[section]);
titem = (TextureListItem *) item->clientData; titem = (TextureListItem *) item->clientData;
@@ -1261,7 +1267,7 @@ static void paintListItem(WMList * lPtr, int index, Drawable d, char *text, int
{ {
_Panel *panel = (_Panel *) WMGetHangedData(lPtr); _Panel *panel = (_Panel *) WMGetHangedData(lPtr);
WMScreen *scr = WMWidgetScreen(lPtr); WMScreen *scr = WMWidgetScreen(lPtr);
int width, height, x, y; int width, height, x, y, tmp;
Display *dpy = WMScreenDisplay(scr); Display *dpy = WMScreenDisplay(scr);
WMColor *back = (state & WLDSSelected) ? WMWhiteColor(scr) : WMGrayColor(scr); WMColor *back = (state & WLDSSelected) ? WMWhiteColor(scr) : WMGrayColor(scr);
WMListItem *item; WMListItem *item;
@@ -1290,7 +1296,8 @@ static void paintListItem(WMList * lPtr, int index, Drawable d, char *text, int
XCopyArea(dpy, titem->preview, d, WMColorGC(black), 0, 0, XCopyArea(dpy, titem->preview, d, WMColorGC(black), 0, 0,
TEXPREV_WIDTH, TEXPREV_HEIGHT, x + 5, y + 5); TEXPREV_WIDTH, TEXPREV_HEIGHT, x + 5, y + 5);
if ((1 << WMGetPopUpButtonSelectedItem(panel->secP)) & titem->selectedFor) tmp = WMGetPopUpButtonSelectedItem(panel->secP);
if ((tmp >= 0) && ((1 << tmp) & titem->selectedFor))
WMDrawPixmap(panel->onLed, d, x + TEXPREV_WIDTH + 10, y + 6); WMDrawPixmap(panel->onLed, d, x + TEXPREV_WIDTH + 10, y + 6);
else if (titem->selectedFor) else if (titem->selectedFor)
WMDrawPixmap(panel->offLed, d, x + TEXPREV_WIDTH + 10, y + 6); WMDrawPixmap(panel->offLed, d, x + TEXPREV_WIDTH + 10, y + 6);
@@ -1425,6 +1432,10 @@ static void changeColorPage(WMWidget * w, void *data)
WMScreen *scr = WMWidgetScreen(panel->box); WMScreen *scr = WMWidgetScreen(panel->box);
RContext *rc = WMScreenRContext(scr); RContext *rc = WMScreenRContext(scr);
section = WMGetPopUpButtonSelectedItem(panel->colP);
if (section < 0)
return;
if (panel->preview) { if (panel->preview) {
GC gc; GC gc;
@@ -1436,7 +1447,6 @@ static void changeColorPage(WMWidget * w, void *data)
colorOptions[panel->oldcsection].hand.y); colorOptions[panel->oldcsection].hand.y);
} }
if (w) { if (w) {
section = WMGetPopUpButtonSelectedItem(panel->colP);
panel->oldcsection = section; panel->oldcsection = section;
if (panel->preview) if (panel->preview)
@@ -1737,6 +1747,8 @@ static void colorWellObserver(void *self, WMNotification * n)
(void) n; (void) n;
p = WMGetPopUpButtonSelectedItem(panel->colP); p = WMGetPopUpButtonSelectedItem(panel->colP);
if (p < 0)
return;
WMReleaseColor(panel->colors[p]); WMReleaseColor(panel->colors[p]);
@@ -1831,7 +1843,7 @@ static void createPanel(Panel * p)
panel->fprefix = wstrconcat(wuserdatapath(), "/" PACKAGE_TARNAME); panel->fprefix = wstrconcat(wuserdatapath(), "/" PACKAGE_TARNAME);
if (access(panel->fprefix, F_OK) != 0) { if (access(panel->fprefix, F_OK) != 0) {
if (mkdir(panel->fprefix, 0755) < 0) { if (-1 == mkdir(panel->fprefix, 0755) && errno != EEXIST) {
werror("%s", panel->fprefix); werror("%s", panel->fprefix);
ok = False; ok = False;
} }
@@ -1841,7 +1853,7 @@ static void createPanel(Panel * p)
wfree(panel->fprefix); wfree(panel->fprefix);
panel->fprefix = tmp; panel->fprefix = tmp;
if (access(panel->fprefix, F_OK) != 0) { if (access(panel->fprefix, F_OK) != 0) {
if (mkdir(panel->fprefix, 0755) < 0) { if (-1 == mkdir(panel->fprefix, 0755) && errno != EEXIST) {
werror("%s", panel->fprefix); werror("%s", panel->fprefix);
} }
} }
+15 -1
View File
@@ -25,7 +25,7 @@
/* This structure containts the list of all the check-buttons to display in the /* This structure containts the list of all the check-buttons to display in the
* expert tab of the window with the corresponding information for effect * expert tab of the window with the corresponding information for effect
*/ */
static const struct { static struct expert_option {
const char *label; /* Text displayed to user */ const char *label; /* Text displayed to user */
int def_state; /* True/False: the default value, if not defined in current config */ int def_state; /* True/False: the default value, if not defined in current config */
@@ -172,6 +172,19 @@ static void upButtonCallback(WMWidget *self, void *data)
changeIntTextfield(data, 1); changeIntTextfield(data, 1);
} }
static int cmpExpertOptions(const void *v1, const void *v2)
{
int rc;
const struct expert_option *opt1 = (struct expert_option *)v1;
const struct expert_option *opt2 = (struct expert_option *)v2;
if ((rc = strcmp(opt1->label, opt2->label)) < 0)
return -1;
else if (rc > 0)
return 1;
return 0;
}
static void createPanel(Panel *p) static void createPanel(Panel *p)
{ {
_Panel *panel = (_Panel *) p; _Panel *panel = (_Panel *) p;
@@ -195,6 +208,7 @@ static void createPanel(Panel *p)
WMSetFrameRelief(f, WRFlat); WMSetFrameRelief(f, WRFlat);
udb = WMGetStandardUserDefaults(); udb = WMGetStandardUserDefaults();
qsort(expert_options, wlengthof(expert_options), sizeof(expert_options[0]), cmpExpertOptions);
for (i = 0; i < wlengthof(expert_options); i++) { for (i = 0; i < wlengthof(expert_options); i++) {
if (expert_options[i].class != OPTION_WMAKER_INT) { if (expert_options[i].class != OPTION_WMAKER_INT) {
panel->swi[i] = WMCreateSwitchButton(f); panel->swi[i] = WMCreateSwitchButton(f);
+16 -1
View File
@@ -65,7 +65,7 @@ typedef struct _Panel {
* First parameter is the internal keyword known by WMaker * First parameter is the internal keyword known by WMaker
* Second is the text displayed to the user * Second is the text displayed to the user
*/ */
static const struct { static struct keyOption {
const char *key; const char *key;
const char *title; const char *title;
} keyOptions[] = { } keyOptions[] = {
@@ -541,6 +541,20 @@ static void paintItem(WMList * lPtr, int index, Drawable d, char *text, int stat
WMDrawString(scr, d, panel->black, panel->font, x + 20, y, text, strlen(text)); WMDrawString(scr, d, panel->black, panel->font, x + 20, y, text, strlen(text));
} }
static int cmpKeyOptions(const void *v1, const void *v2)
{
int rc;
const struct keyOption *opt1 = (struct keyOption *)v1;
const struct keyOption *opt2 = (struct keyOption *)v2;
if ((rc = strcmp(opt1->title, opt2->title)) < 0)
return -1;
else if (rc > 0)
return 1;
return 0;
}
static void createPanel(Panel * p) static void createPanel(Panel * p)
{ {
_Panel *panel = (_Panel *) p; _Panel *panel = (_Panel *) p;
@@ -580,6 +594,7 @@ static void createPanel(Panel * p)
WMSetListUserDrawProc(panel->actLs, paintItem); WMSetListUserDrawProc(panel->actLs, paintItem);
WMHangData(panel->actLs, panel); WMHangData(panel->actLs, panel);
qsort(keyOptions, wlengthof(keyOptions), sizeof(keyOptions[0]), cmpKeyOptions);
for (i = 0; i < wlengthof(keyOptions); i++) { for (i = 0; i < wlengthof(keyOptions); i++) {
WMAddListItem(panel->actLs, _(keyOptions[i].title)); WMAddListItem(panel->actLs, _(keyOptions[i].title));
} }
+2
View File
@@ -291,6 +291,8 @@ static void changedItemPad(WMWidget * w, void *data)
_Panel *panel = (_Panel *) data; _Panel *panel = (_Panel *) data;
int padn = WMGetPopUpButtonSelectedItem(w); int padn = WMGetPopUpButtonSelectedItem(w);
if (padn < 0)
return;
WMUnmapWidget(panel->itemPad[panel->currentPad]); WMUnmapWidget(panel->itemPad[panel->currentPad]);
WMMapWidget(panel->itemPad[padn]); WMMapWidget(panel->itemPad[padn]);
+2
View File
@@ -748,6 +748,8 @@ static void storeData(_Panel * panel)
int action; int action;
action = WMGetPopUpButtonSelectedItem(panel->mouse_action[i].popup); action = WMGetPopUpButtonSelectedItem(panel->mouse_action[i].popup);
if (action < 0)
continue;
if (button_list[i].type == T_BUTTON) if (button_list[i].type == T_BUTTON)
db_value = button_actions[action].db_value; db_value = button_actions[action].db_value;
else else
+4
View File
@@ -196,9 +196,13 @@ static void storeData(_Panel * panel)
int i; int i;
i = WMGetPopUpButtonSelectedItem(panel->sizeP); i = WMGetPopUpButtonSelectedItem(panel->sizeP);
if (i < 0)
return;
SetStringForKey(resize_display[i].db_value, "ResizeDisplay"); SetStringForKey(resize_display[i].db_value, "ResizeDisplay");
i = WMGetPopUpButtonSelectedItem(panel->posiP); i = WMGetPopUpButtonSelectedItem(panel->posiP);
if (i < 0)
return;
SetStringForKey(move_display[i].db_value, "MoveDisplay"); SetStringForKey(move_display[i].db_value, "MoveDisplay");
lr = WMGetButtonSelected(panel->lrB); lr = WMGetButtonSelected(panel->lrB);
+1 -1
View File
@@ -689,7 +689,7 @@ static void changeTypeCallback(WMWidget *w, void *data)
int i; int i;
newType = WMGetPopUpButtonSelectedItem(w); newType = WMGetPopUpButtonSelectedItem(w);
if (newType == panel->currentType) if (newType < 0 || newType == panel->currentType)
return; return;
if (panel->currentType >= 0) { if (panel->currentType >= 0) {
+5 -2
View File
@@ -207,12 +207,15 @@ static void createPanel(Panel * p)
static void storeData(_Panel * panel) static void storeData(_Panel * panel)
{ {
int tmp = WMGetPopUpButtonSelectedItem(panel->posP);
if (tmp < 0)
return;
SetBoolForKey(!WMGetButtonSelected(panel->linkB), "DontLinkWorkspaces"); SetBoolForKey(!WMGetButtonSelected(panel->linkB), "DontLinkWorkspaces");
SetBoolForKey(WMGetButtonSelected(panel->cyclB), "CycleWorkspaces"); SetBoolForKey(WMGetButtonSelected(panel->cyclB), "CycleWorkspaces");
SetBoolForKey(WMGetButtonSelected(panel->newB), "AdvanceToNewWorkspace"); SetBoolForKey(WMGetButtonSelected(panel->newB), "AdvanceToNewWorkspace");
SetStringForKey(WSNamePositions[WMGetPopUpButtonSelectedItem(panel->posP)], SetStringForKey(WSNamePositions[tmp], "WorkspaceNameDisplayPosition");
"WorkspaceNameDisplayPosition");
} }
Panel *InitWorkspace(WMWidget *parent) Panel *InitWorkspace(WMWidget *parent)
+1 -1
View File
@@ -1150,7 +1150,7 @@ static void dragItem(WEditMenu * menu, WEditMenuItem * item, Bool copy)
static XColor back = { 0, 0xffff, 0xffff, 0xffff, DoRed | DoGreen | DoBlue, 0 }; static XColor back = { 0, 0xffff, 0xffff, 0xffff, DoRed | DoGreen | DoBlue, 0 };
Display *dpy = W_VIEW_DISPLAY(menu->view); Display *dpy = W_VIEW_DISPLAY(menu->view);
WMScreen *scr = W_VIEW_SCREEN(menu->view); WMScreen *scr = W_VIEW_SCREEN(menu->view);
int x, y; int x = 0, y = 0;
int dx, dy; int dx, dy;
Bool done = False; Bool done = False;
Window blaw; Window blaw;
+2 -2
View File
@@ -71,9 +71,9 @@ dnl 6. If any interfaces have been removed or changed since the last
dnl public release, then set age to 0. dnl public release, then set age to 0.
dnl dnl
dnl libwraster dnl libwraster
WRASTER_CURRENT=6 WRASTER_CURRENT=7
WRASTER_REVISION=0 WRASTER_REVISION=0
WRASTER_AGE=0 WRASTER_AGE=1
WRASTER_VERSION=$WRASTER_CURRENT:$WRASTER_REVISION:$WRASTER_AGE WRASTER_VERSION=$WRASTER_CURRENT:$WRASTER_REVISION:$WRASTER_AGE
AC_SUBST(WRASTER_VERSION) AC_SUBST(WRASTER_VERSION)
dnl dnl
+9 -7
View File
@@ -1103,14 +1103,16 @@ Bool wIconChooserDialog(WScreen *scr, char **file, const char *instance, const c
} else { } else {
defaultPath = FindImage(wPreferences.icon_path, *file); defaultPath = FindImage(wPreferences.icon_path, *file);
wantedPath = WMGetTextFieldText(panel->fileField); wantedPath = WMGetTextFieldText(panel->fileField);
/* if the file is not the default, use full path */ if (defaultPath) {
if (strcmp(wantedPath, defaultPath) != 0) { /* if the file is not the default, use full path */
*file = wantedPath; if (strcmp(wantedPath, defaultPath) != 0) {
} else { *file = wstrdup(wantedPath);
*file = wstrdup(*file); } else {
wfree(wantedPath); *file = wstrdup(*file);
}
wfree(defaultPath);
} }
wfree(defaultPath); wfree(wantedPath);
} }
} else { } else {
*file = NULL; *file = NULL;
+1
View File
@@ -799,6 +799,7 @@ char *GetShortcutString(const char *shortcut)
*k = 0; *k = 0;
mod = wXModifierFromKey(text); mod = wXModifierFromKey(text);
if (mod < 0) { if (mod < 0) {
wfree(buffer);
return wstrdup("bug"); return wstrdup("bug");
} }
lbl = wXModifierToShortcutLabel(mod); lbl = wXModifierToShortcutLabel(mod);
-2
View File
@@ -1038,8 +1038,6 @@ static WMenu *readMenu(WScreen *scr, const char *flat_file, FILE *file)
freeline(title, command, params, shortcut); freeline(title, command, params, shortcut);
break; break;
} }
freeline(title, command, params, shortcut);
} }
WMenuParserDelete(parser); WMenuParserDelete(parser);
+1 -1
View File
@@ -617,7 +617,7 @@ WScreen *wScreenInit(int screen_number)
{ {
WScreen *scr; WScreen *scr;
XIconSize icon_size[1]; XIconSize icon_size[1];
RContextAttributes rattr; RContextAttributes rattr = {};
long event_mask; long event_mask;
XErrorHandler oldHandler; XErrorHandler oldHandler;
int i; int i;
+2 -1
View File
@@ -203,7 +203,7 @@ static WMPropList *makeWindowState(WWindow * wwin, WApplication * wapp)
command = GetCommandForWindow(win); command = GetCommandForWindow(win);
if (!command) { if (!command) {
if (wapp->app_icon && wapp->app_icon->command) { if (wapp->app_icon && wapp->app_icon->command) {
command = wmalloc(strlen(wapp->app_icon->command)); command = wmalloc(strlen(wapp->app_icon->command) + 1);
strcpy(command, wapp->app_icon->command); strcpy(command, wapp->app_icon->command);
} else } else
return NULL; return NULL;
@@ -371,6 +371,7 @@ static pid_t execCommand(WScreen *scr, char *command)
wtokensplit(command, &argv, &argc); wtokensplit(command, &argv, &argc);
if (!argc) { if (!argc) {
wfree(argv);
return 0; return 0;
} }
+6 -4
View File
@@ -997,7 +997,7 @@ static void updateWorkspaceNames(WScreen *scr)
len = 0; len = 0;
for (i = 0; i < scr->workspace_count; i++) { for (i = 0; i < scr->workspace_count; i++) {
curr_size = strlen(scr->workspaces[i]->name); curr_size = strlen(scr->workspaces[i]->name);
strcpy(pos, scr->workspaces[i]->name); strncpy(pos, scr->workspaces[i]->name, sizeof(pos) - 1);
pos += (curr_size + 1); pos += (curr_size + 1);
len += (curr_size + 1); len += (curr_size + 1);
} }
@@ -1483,7 +1483,8 @@ void wNETWMPositionSplash(WWindow *wwin, int *x, int *y, int width, int height)
static void updateWindowType(WWindow *wwin) static void updateWindowType(WWindow *wwin)
{ {
Atom type_ret; Atom type_ret;
int fmt_ret, layer; int fmt_ret;
int layer = INT_MIN; //illegal level
unsigned long nitems_ret, bytes_after_ret; unsigned long nitems_ret, bytes_after_ret;
long *data = NULL; long *data = NULL;
@@ -1501,7 +1502,8 @@ static void updateWindowType(WWindow *wwin)
} }
if (wwin->frame != NULL) { if (wwin->frame != NULL) {
ChangeStackingLevel(wwin->frame->core, layer); if (layer != INT_MIN)
ChangeStackingLevel(wwin->frame->core, layer);
wwin->frame->flags.need_texture_change = 1; wwin->frame->flags.need_texture_change = 1;
wWindowConfigureBorders(wwin); wWindowConfigureBorders(wwin);
wFrameWindowPaint(wwin->frame); wFrameWindowPaint(wwin->frame);
@@ -1734,7 +1736,7 @@ Bool wNETWMProcessClientMessage(XClientMessageEvent *event)
if (wwin->frame->workspace == wwin->screen_ptr->current_workspace /* No workspace change */ if (wwin->frame->workspace == wwin->screen_ptr->current_workspace /* No workspace change */
|| event->data.l[0] == 2 /* Requested by pager */ || event->data.l[0] == 2 /* Requested by pager */
|| WFLAGP(wwin, focus_across_wksp) /* Explicitly allowed */) { || WFLAGP(wwin, focus_across_wksp) /* Explicitly allowed */) {
wNETWMShowingDesktop(scr, False); wNETWMShowingDesktop(wwin->screen_ptr, False);
wMakeWindowVisible(wwin); wMakeWindowVisible(wwin);
} }
return True; return True;
+1 -1
View File
@@ -175,7 +175,7 @@ static void x_reset_modifier_mapping(Display * display)
} }
code = x_modifier_keymap->modifiermap[modifier_index * mkpm + modifier_key]; code = x_modifier_keymap->modifiermap[modifier_index * mkpm + modifier_key];
sym = (code ? W_KeycodeToKeysym(display, code, column) : NoSymbol); sym = W_KeycodeToKeysym(display, code, column);
if (sym == last_sym) if (sym == last_sym)
continue; continue;
+1
View File
@@ -349,6 +349,7 @@ static void hackStyle(WMPropList * style)
t = WMCreatePLArray(WMCreatePLString("solid"), value, NULL); t = WMCreatePLArray(WMCreatePLString("solid"), value, NULL);
WMPutInPLDictionary(style, WMCreatePLString("ResizebarBack"), t); WMPutInPLDictionary(style, WMCreatePLString("ResizebarBack"), t);
WMReleasePropList(value);
} }
} }
} }
+1
View File
@@ -451,6 +451,7 @@ static void find_and_write(const char *group, char *list[][2], int this_is_termi
WMAddToPLArray(L2Menu, L3Menu); WMAddToPLArray(L2Menu, L3Menu);
wfree(t); wfree(t);
} }
wfree(argv);
i++; i++;
} }
if (L2Menu) if (L2Menu)
+3 -1
View File
@@ -435,6 +435,7 @@ int zoom_in_out(int z)
tmp->height + (int)(tmp->height * zoom_factor)); tmp->height + (int)(tmp->height * zoom_factor));
if (!img) { if (!img) {
img = old_img; img = old_img;
RReleaseImage(tmp);
return EXIT_FAILURE; return EXIT_FAILURE;
} }
} else { } else {
@@ -449,6 +450,7 @@ int zoom_in_out(int z)
img = RScaleImage(tmp, new_width, new_height); img = RScaleImage(tmp, new_width, new_height);
if (!img) { if (!img) {
img = old_img; img = old_img;
RReleaseImage(tmp);
return EXIT_FAILURE; return EXIT_FAILURE;
} }
} }
@@ -678,7 +680,7 @@ link_t *connect_dir(char *dirpath, linked_list_t *li)
int main(int argc, char **argv) int main(int argc, char **argv)
{ {
int option = -1; int option = -1;
RContextAttributes attr; RContextAttributes attr = {};
XEvent e; XEvent e;
KeySym keysym; KeySym keysym;
char *reading_filename = ""; char *reading_filename = "";
+24 -23
View File
@@ -275,45 +275,46 @@ static void assemblePLMenuFunc(WMTreeNode *aNode, void *data)
if (!wm->CmdLine) { /* new submenu */ if (!wm->CmdLine) { /* new submenu */
WMAddToArray(plMenuNodes, WMCreatePLArray(WMCreatePLString(wm->Name), NULL)); WMAddToArray(plMenuNodes, WMCreatePLArray(WMCreatePLString(wm->Name), NULL));
} else { /* new menu item */ } else { /* new menu item */
WMPropList *tmp1, *tmp2;
pl = WMPopFromArray(plMenuNodes); pl = WMPopFromArray(plMenuNodes);
if (wm->Flags & F_RESTART_OTHER) { /* RESTART, somewm */ if (wm->Flags & F_RESTART_OTHER) { /* RESTART, somewm */
char buf[1024]; char buf[1024];
WMPropList *tmp3;
memset(buf, 0, sizeof(buf)); memset(buf, 0, sizeof(buf));
snprintf(buf, sizeof(buf), "%s %s", _("Restart"), wm->Name); snprintf(buf, sizeof(buf), "%s %s", _("Restart"), wm->Name);
WMAddToPLArray(pl, WMCreatePLArray(
WMCreatePLString(buf), tmp1 = WMCreatePLString(buf);
WMCreatePLString("RESTART"), tmp2 = WMCreatePLString("RESTART");
WMCreatePLString(wm->CmdLine), tmp3 = WMCreatePLString(wm->CmdLine);
NULL) WMAddToPLArray(pl, WMCreatePLArray(tmp1, tmp2, tmp3, NULL));
); WMReleasePropList(tmp3);
} else if (wm->Flags & F_RESTART_SELF) {/* RESTART */ } else if (wm->Flags & F_RESTART_SELF) {/* RESTART */
WMAddToPLArray(pl, WMCreatePLArray( tmp1 = WMCreatePLString(_("Restart Window Maker"));
WMCreatePLString(_("Restart Window Maker")), tmp2 = WMCreatePLString("RESTART");
WMCreatePLString("RESTART"), WMAddToPLArray(pl, WMCreatePLArray(tmp1, tmp2, NULL));
NULL)
);
} else if (wm->Flags & F_QUIT) { /* EXIT */ } else if (wm->Flags & F_QUIT) { /* EXIT */
WMAddToPLArray(pl, WMCreatePLArray( tmp1 = WMCreatePLString(_("Exit Window Maker"));
WMCreatePLString(_("Exit Window Maker")), tmp2 = WMCreatePLString("EXIT");
WMCreatePLString("EXIT"), WMAddToPLArray(pl, WMCreatePLArray(tmp1, tmp2, NULL));
NULL)
);
} else { /* plain simple command */ } else { /* plain simple command */
char buf[1024]; char buf[1024];
WMPropList *tmp3;
memset(buf, 0, sizeof(buf)); memset(buf, 0, sizeof(buf));
if (wm->Flags & F_TERMINAL) /* XXX: quoting! */ if (wm->Flags & F_TERMINAL) /* XXX: quoting! */
snprintf(buf, sizeof(buf), "%s -e \"%s\"", terminal, wm->CmdLine); snprintf(buf, sizeof(buf), "%s -e \"%s\"", terminal, wm->CmdLine);
else else
snprintf(buf, sizeof(buf), "%s", wm->CmdLine); snprintf(buf, sizeof(buf), "%s", wm->CmdLine);
tmp1 = WMCreatePLString(wm->Name);
WMAddToPLArray(pl, WMCreatePLArray( tmp2 = WMCreatePLString("SHEXEC");
WMCreatePLString(wm->Name), tmp3 = WMCreatePLString(buf);
WMCreatePLString("SHEXEC"), WMAddToPLArray(pl, WMCreatePLArray(tmp1, tmp2, tmp3, NULL));
WMCreatePLString(buf), WMReleasePropList(tmp3);
NULL)
);
} }
WMReleasePropList(tmp1);
WMReleasePropList(tmp2);
WMAddToArray(plMenuNodes, pl); WMAddToArray(plMenuNodes, pl);
} }
+10 -1
View File
@@ -505,7 +505,15 @@ static BackgroundTexture *parseTexture(RContext * rc, char *text)
iheight = image->height; iheight = image->height;
} }
GETSTRORGOTO(val, tmp, 2, error); /* cannot use GETSTRORGOTO() here
* as we have to free image in case of error */
val = WMGetFromPLArray(texarray, 2);
if (!WMIsPLString(val)) {
wwarning("could not parse texture %s", text);
RReleaseImage(image);
goto error;
}
tmp = WMGetFromPLString(val);
if (!XParseColor(dpy, DefaultColormap(dpy, scr), tmp, &color)) { if (!XParseColor(dpy, DefaultColormap(dpy, scr), tmp, &color)) {
wwarning("could not parse color %s in texture %s", tmp, text); wwarning("could not parse color %s in texture %s", tmp, text);
@@ -898,6 +906,7 @@ static noreturn void helperLoop(RContext * rc)
int errcount = 4; int errcount = 4;
memset(textures, 0, WORKSPACE_COUNT * sizeof(BackgroundTexture *)); memset(textures, 0, WORKSPACE_COUNT * sizeof(BackgroundTexture *));
memset(buffer, 0, sizeof(buffer));
while (1) { while (1) {
int workspace = -1; int workspace = -1;
+2
View File
@@ -1,3 +1,5 @@
- added RSaveTitledImage()
- removed obsoleted RDestroyImage() - removed obsoleted RDestroyImage()
- removed Hermes code. - removed Hermes code.
- Put back asm/mmx optimized code. - Put back asm/mmx optimized code.
+2
View File
@@ -55,10 +55,12 @@ endif
if USE_JPEG if USE_JPEG
libwraster_la_SOURCES += load_jpeg.c libwraster_la_SOURCES += load_jpeg.c
libwraster_la_SOURCES += save_jpeg.c
endif endif
if USE_PNG if USE_PNG
libwraster_la_SOURCES += load_png.c libwraster_la_SOURCES += load_png.c
libwraster_la_SOURCES += save_png.c
endif endif
if USE_TIFF if USE_TIFF
+13 -2
View File
@@ -1,8 +1,19 @@
** API and ABI modifications since wmaker 0.92.0 ** API and ABI modifications
----------------------------------------------------
Sat 25 Feb 2023
RSaveImage: Improved
Able to save image on disk as PNG or JPEG file
RSaveTitledImage: Added
Image title can be set on the image to be saved
----------------------------------------------------
Since wmaker 0.92.0
RLightImage: ADDED RLightImage: ADDED
---------------------------------------------------- ----------------------------------------------------
Sat Apr 21 09:12:09 EEST 2001 -Dan Sat Apr 21 09:12:09 EEST 2001 -Dan
+8
View File
@@ -627,6 +627,10 @@ static RXImage *image2StandardPseudoColor(RContext * ctx, RImage * image)
RDestroyXImage(ctx, ximg); RDestroyXImage(ctx, ximg);
return NULL; return NULL;
} }
memset(err, 0, 3 * (image->width + 2) * sizeof(short));
memset(nerr, 0, 3 * (image->width + 2) * sizeof(short));
for (x = 0, x1 = 0; x < image->width * 3; x1 += channels - 3) { for (x = 0, x1 = 0; x < image->width * 3; x1 += channels - 3) {
err[x++] = ptr[x1++]; err[x++] = ptr[x1++];
err[x++] = ptr[x1++]; err[x++] = ptr[x1++];
@@ -778,6 +782,10 @@ static RXImage *image2GrayScale(RContext * ctx, RImage * image)
RDestroyXImage(ctx, ximg); RDestroyXImage(ctx, ximg);
return NULL; return NULL;
} }
memset(gerr, 0, (image->width + 2) * sizeof(short));
memset(ngerr, 0, (image->width + 2) * sizeof(short));
for (x = 0, y = 0; x < image->width; x++, y += channels) { for (x = 0, y = 0; x < image->width; x++, y += channels) {
gerr[x] = (ptr[y] * 30 + ptr[y + 1] * 59 + ptr[y + 2] * 11) / 100; gerr[x] = (ptr[y] * 30 + ptr[y + 1] * 59 + ptr[y + 2] * 11) / 100;
} }
+8 -2
View File
@@ -29,7 +29,6 @@
#ifndef IMGFORMAT_INTERNAL_H #ifndef IMGFORMAT_INTERNAL_H
#define IMGFORMAT_INTERNAL_H #define IMGFORMAT_INTERNAL_H
typedef enum { typedef enum {
IM_ERROR = -1, IM_ERROR = -1,
IM_UNKNOWN = 0, IM_UNKNOWN = 0,
@@ -82,8 +81,15 @@ void RReleaseMagick(void);
/* /*
* Function for Saving in a specific format * Function for Saving in a specific format
*/ */
Bool RSaveXPM(RImage *image, const char *file); Bool RSaveXPM(RImage *image, const char *filename);
#ifdef USE_PNG
Bool RSavePNG(RImage *image, const char *filename, char *title);
#endif
#ifdef USE_JPEG
Bool RSaveJPEG(RImage *image, const char *filename, char *title);
#endif
/* /*
* Function to terminate properly * Function to terminate properly
+2
View File
@@ -22,6 +22,8 @@ POTFILES = \
$(top_srcdir)/wrlib/rotate.c \ $(top_srcdir)/wrlib/rotate.c \
$(top_srcdir)/wrlib/flip.c \ $(top_srcdir)/wrlib/flip.c \
$(top_srcdir)/wrlib/convolve.c \ $(top_srcdir)/wrlib/convolve.c \
$(top_srcdir)/wrlib/save_jpeg.c \
$(top_srcdir)/wrlib/save_png.c \
$(top_srcdir)/wrlib/save_xpm.c \ $(top_srcdir)/wrlib/save_xpm.c \
$(top_srcdir)/wrlib/xutil.c \ $(top_srcdir)/wrlib/xutil.c \
$(top_srcdir)/wrlib/load_ppm.c \ $(top_srcdir)/wrlib/load_ppm.c \
+23 -8
View File
@@ -3,6 +3,7 @@
* Raster graphics library * Raster graphics library
* *
* Copyright (c) 1998-2003 Alfredo K. Kojima * Copyright (c) 1998-2003 Alfredo K. Kojima
* Copyright (c) 2013-2023 Window Maker Team
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public * modify it under the terms of the GNU Library General Public
@@ -29,18 +30,32 @@
#include <fcntl.h> #include <fcntl.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <string.h> #include <string.h>
#include <time.h>
#include "wraster.h" #include "wraster.h"
#include "imgformat.h" #include "imgformat.h"
#include "wr_i18n.h" #include "wr_i18n.h"
Bool RSaveImage(RImage *image, const char *filename, const char *format)
Bool RSaveImage(RImage * image, const char *filename, const char *format)
{ {
if (strcmp(format, "XPM") != 0) { return RSaveTitledImage(image, filename, format, NULL);
RErrorCode = RERR_BADFORMAT; }
return False;
} Bool RSaveTitledImage(RImage *image, const char *filename, const char *format, char *title)
return RSaveXPM(image, filename); {
#ifdef USE_PNG
if (strcasecmp(format, "PNG") == 0)
return RSavePNG(image, filename, title);
#endif
#ifdef USE_JPEG
if (strcasecmp(format, "JPG") == 0)
return RSaveJPEG(image, filename, title);
if (strcasecmp(format, "JPEG") == 0)
return RSaveJPEG(image, filename, title);
#endif
if (strcasecmp(format, "XPM") == 0)
return RSaveXPM(image, filename);
RErrorCode = RERR_BADFORMAT;
return False;
} }
+104
View File
@@ -0,0 +1,104 @@
/* save_jpeg.c - save JPEG image
*
* Raster graphics library
*
* Copyright (c) 2023 Window Maker Team
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the Free
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
* MA 02110-1301, USA.
*/
#include <config.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <assert.h>
#include <errno.h>
#include <jpeglib.h>
#include "wraster.h"
#include "imgformat.h"
#include "wr_i18n.h"
/*
* Save RImage to JPEG image
*/
Bool RSaveJPEG(RImage *img, const char *filename, char *title)
{
FILE *file;
int x, y, img_depth;
char *buffer;
RColor pixel;
struct jpeg_compress_struct cinfo;
struct jpeg_error_mgr jerr;
JSAMPROW row_pointer;
file = fopen(filename, "wb");
if (!file) {
RErrorCode = RERR_OPEN;
return False;
}
if (img->format == RRGBAFormat)
img_depth = 4;
else
img_depth = 3;
/* collect separate RGB values to a buffer */
buffer = malloc(sizeof(char) * 3 * img->width * img->height);
for (y = 0; y < img->height; y++) {
for (x = 0; x < img->width; x++) {
RGetPixel(img, x, y, &pixel);
buffer[y*img->width*3+x*3+0] = (char)(pixel.red);
buffer[y*img->width*3+x*3+1] = (char)(pixel.green);
buffer[y*img->width*3+x*3+2] = (char)(pixel.blue);
}
}
/* Setup Exception handling */
cinfo.err = jpeg_std_error(&jerr);
/* Initialize cinfo structure */
jpeg_create_compress(&cinfo);
jpeg_stdio_dest(&cinfo, file);
cinfo.image_width = img->width;
cinfo.image_height = img->height;
cinfo.input_components = 3;
cinfo.in_color_space = JCS_RGB;
jpeg_set_defaults(&cinfo);
jpeg_set_quality(&cinfo, 85, TRUE);
jpeg_start_compress(&cinfo, TRUE);
/* Set title if any */
if (title)
jpeg_write_marker(&cinfo, JPEG_COM, (const JOCTET*)title, strlen(title));
while (cinfo.next_scanline < cinfo.image_height) {
row_pointer = (JSAMPROW) &buffer[cinfo.next_scanline * img_depth * img->width];
jpeg_write_scanlines(&cinfo, &row_pointer, 1);
}
jpeg_finish_compress(&cinfo);
/* Clean */
free(buffer);
fclose(file);
return True;
}
+127
View File
@@ -0,0 +1,127 @@
/* save_png.c - save PNG image
*
* Raster graphics library
*
* Copyright (c) 2023 Window Maker Team
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the Free
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
* MA 02110-1301, USA.
*/
#include <config.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <assert.h>
#include <errno.h>
#include <png.h>
#include "wraster.h"
#include "imgformat.h"
#include "wr_i18n.h"
/*
* Save RImage to PNG image
*/
Bool RSavePNG(RImage *img, const char *filename, char *title)
{
FILE *file;
png_structp png_ptr;
png_infop png_info_ptr;
png_bytep png_row;
RColor pixel;
int x, y;
int width = img->width;
int height = img->height;
file = fopen(filename, "wb");
if (file == NULL) {
RErrorCode = RERR_OPEN;
return False;
}
/* Initialize write structure */
png_ptr = png_create_write_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL);
if (png_ptr == NULL) {
fclose(file);
RErrorCode = RERR_NOMEMORY;
return False;
}
/* Initialize info structure */
png_info_ptr = png_create_info_struct(png_ptr);
if (png_info_ptr == NULL) {
fclose(file);
RErrorCode = RERR_NOMEMORY;
return False;
}
/* Setup Exception handling */
if (setjmp(png_jmpbuf (png_ptr))) {
fclose(file);
RErrorCode = RERR_INTERNAL;
return False;
}
png_init_io(png_ptr, file);
/* Write header (8 bit colour depth) */
png_set_IHDR(png_ptr, png_info_ptr, width, height, 8, PNG_COLOR_TYPE_RGB,
PNG_INTERLACE_NONE, PNG_COMPRESSION_TYPE_BASE,
PNG_FILTER_TYPE_BASE);
/* Set title if any */
if (title) {
png_text title_text;
title_text.compression = PNG_TEXT_COMPRESSION_NONE;
title_text.key = "Title";
title_text.text = title;
png_set_text(png_ptr, png_info_ptr, &title_text, 1);
}
png_write_info(png_ptr, png_info_ptr);
/* Allocate memory for one row (3 bytes per pixel - RGB) */
png_row = (png_bytep) malloc(3 * width * sizeof(png_byte));
/* Write image data */
for (y = 0; y < height; y++) {
for (x = 0; x < width; x++) {
png_byte *ptr;
RGetPixel(img, x, y, &pixel);
ptr = &(png_row[x * 3]);
ptr[0] = pixel.red;
ptr[1] = pixel.green;
ptr[2] = pixel.blue;
}
png_write_row(png_ptr, png_row);
}
/* End write */
png_write_end(png_ptr, NULL);
/* Clean */
fclose(file);
if (png_info_ptr != NULL)
png_free_data(png_ptr, png_info_ptr, PNG_FREE_ALL, -1);
if (png_ptr != NULL)
png_destroy_write_struct(&png_ptr, (png_infopp) NULL);
if (png_row != NULL)
free(png_row);
return True;
}
+1 -1
View File
@@ -1,4 +1,4 @@
/* nxpm.c - load "normalized" XPM image /* save_xpm.c - save "normalized" XPM image
* *
* Raster graphics library * Raster graphics library
* *
+4 -1
View File
@@ -41,7 +41,7 @@
/* version of the header for the library */ /* version of the header for the library */
#define WRASTER_HEADER_VERSION 24 #define WRASTER_HEADER_VERSION 25
#include <X11/Xlib.h> #include <X11/Xlib.h>
@@ -391,6 +391,9 @@ RImage *RGetImageFromXPMData(RContext *context, char **xpmData)
Bool RSaveImage(RImage *image, const char *filename, const char *format) Bool RSaveImage(RImage *image, const char *filename, const char *format)
__wrlib_nonnull(1, 2, 3); __wrlib_nonnull(1, 2, 3);
Bool RSaveTitledImage(RImage *image, const char *filename, const char *format, char *title)
__wrlib_nonnull(1, 2, 3);
/* /*
* Area manipulation * Area manipulation
*/ */