mirror of
https://github.com/labwc/labwc.git
synced 2026-04-11 08:21:13 -04:00
icon-loader: support xpm icons
This commit is contained in:
parent
3394f191a4
commit
e1c85f0ef5
5 changed files with 1986 additions and 2 deletions
14
include/img/img-xpm.h
Normal file
14
include/img/img-xpm.h
Normal file
|
|
@ -0,0 +1,14 @@
|
||||||
|
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||||
|
#ifndef LABWC_IMG_XPM_H
|
||||||
|
#define LABWC_IMG_XPM_H
|
||||||
|
|
||||||
|
struct lab_data_buffer;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* img_xpm_load() - Convert xpm file to buffer with cairo surface
|
||||||
|
* @filename: xpm file
|
||||||
|
* @buffer: cairo-surface-buffer to create
|
||||||
|
*/
|
||||||
|
void img_xpm_load(const char *filename, struct lab_data_buffer **buffer);
|
||||||
|
|
||||||
|
#endif /* LABWC_IMG_XPM_H */
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
banned="malloc,g_strcmp0,sprintf,vsprintf,strcpy,strncpy,strcat,strncat,atof"
|
banned="malloc,g_strcmp0,sprintf,vsprintf,strcat,atof"
|
||||||
|
|
||||||
echo "Searching for banned functions"
|
echo "Searching for banned functions"
|
||||||
find src/ include/ \( -name "*.c" -o -name "*.h" \) -type f \
|
find src/ include/ \( -name "*.c" -o -name "*.h" \) -type f \
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,7 @@
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#include "icon-loader.h"
|
#include "icon-loader.h"
|
||||||
#include "img/img-png.h"
|
#include "img/img-png.h"
|
||||||
|
#include "img/img-xpm.h"
|
||||||
|
|
||||||
#if HAVE_RSVG
|
#if HAVE_RSVG
|
||||||
#include "img/img-svg.h"
|
#include "img/img-svg.h"
|
||||||
|
|
@ -179,7 +180,7 @@ icon_loader_lookup(struct server *server, const char *app_id, int size, int scal
|
||||||
#endif
|
#endif
|
||||||
break;
|
break;
|
||||||
case SFDO_ICON_FILE_FORMAT_XPM:
|
case SFDO_ICON_FILE_FORMAT_XPM:
|
||||||
/* XPM is not supported */
|
img_xpm_load(ctx.path, &icon_buffer);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
1968
src/img/img-xpm.c
Normal file
1968
src/img/img-xpm.c
Normal file
File diff suppressed because it is too large
Load diff
|
|
@ -1,6 +1,7 @@
|
||||||
labwc_sources += files(
|
labwc_sources += files(
|
||||||
'img-png.c',
|
'img-png.c',
|
||||||
'img-xbm.c',
|
'img-xbm.c',
|
||||||
|
'img-xpm.c',
|
||||||
)
|
)
|
||||||
|
|
||||||
if have_rsvg
|
if have_rsvg
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue