forked from old/legacy-imlib2
Added a function to retrieve the image filename, if it has one. It returns
a pointer to an internal string, so if you want to alter the filename, you MUST strdup() it. SVN revision: 2464
This commit is contained in:
parent
06825b3645
commit
a621fc8a1f
31
src/Imlib2.h
31
src/Imlib2.h
|
@ -116,21 +116,22 @@ Imlib_Image imlib_load_image_with_error_return(const char *file, Imlib_Load_Erro
|
|||
void imlib_free_image(void);
|
||||
void imlib_free_image_and_decache(void);
|
||||
|
||||
int imlib_image_get_width(void);
|
||||
int imlib_image_get_height(void);
|
||||
DATA32 *imlib_image_get_data(void);
|
||||
DATA32 *imlib_image_get_data_for_reading_only(void);
|
||||
void imlib_image_put_back_data(DATA32 *data);
|
||||
char imlib_image_has_alpha(void);
|
||||
void imlib_image_set_never_changes_on_disk(Imlib_Image image);
|
||||
void imlib_image_get_border(Imlib_Border *border);
|
||||
void imlib_image_set_border(Imlib_Border *border);
|
||||
void imlib_image_set_format(const char *format);
|
||||
void imlib_image_set_irrelevant_format(char irrelevant);
|
||||
void imlib_image_set_irrelevant_border(char irrelevant);
|
||||
void imlib_image_set_irrelevant_alpha(char irrelevant);
|
||||
char *imlib_image_format(void);
|
||||
void imlib_image_set_has_alpha(char has_alpha);
|
||||
int imlib_image_get_width(void);
|
||||
int imlib_image_get_height(void);
|
||||
const char *imlib_image_get_filename(void);
|
||||
DATA32 *imlib_image_get_data(void);
|
||||
DATA32 *imlib_image_get_data_for_reading_only(void);
|
||||
void imlib_image_put_back_data(DATA32 *data);
|
||||
char imlib_image_has_alpha(void);
|
||||
void imlib_image_set_never_changes_on_disk(Imlib_Image image);
|
||||
void imlib_image_get_border(Imlib_Border *border);
|
||||
void imlib_image_set_border(Imlib_Border *border);
|
||||
void imlib_image_set_format(const char *format);
|
||||
void imlib_image_set_irrelevant_format(char irrelevant);
|
||||
void imlib_image_set_irrelevant_border(char irrelevant);
|
||||
void imlib_image_set_irrelevant_alpha(char irrelevant);
|
||||
char *imlib_image_format(void);
|
||||
void imlib_image_set_has_alpha(char has_alpha);
|
||||
|
||||
void imlib_render_pixmaps_for_whole_image(Pixmap *pixmap_return, Pixmap *mask_return, char create_dithered_mask);
|
||||
void imlib_render_pixmaps_for_whole_image_at_size(Pixmap *pixmap_return, Pixmap *mask_return, char create_dithered_mask, int width, int height);
|
||||
|
|
11
src/api.c
11
src/api.c
|
@ -498,6 +498,17 @@ imlib_image_get_height(void)
|
|||
return im->h;
|
||||
}
|
||||
|
||||
const char *
|
||||
imlib_image_get_filename(void)
|
||||
{
|
||||
ImlibImage *im;
|
||||
|
||||
CHECK_PARAM_POINTER_RETURN("imlib_image_get_filename", "image", ctxt_image, 0);
|
||||
CAST_IMAGE(im, ctxt_image);
|
||||
/* strdup() the returned value if you want to alter it! */
|
||||
return (const char *) (im->file);
|
||||
}
|
||||
|
||||
DATA32 *
|
||||
imlib_image_get_data(void)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue