From 5ca921b28d5ca2964e19dad8f9b8614b2aebca4d Mon Sep 17 00:00:00 2001 From: Nick Bowler Date: Sun, 4 Dec 2011 23:22:18 -0500 Subject: [PATCH] liblbx: Kill the LBXimg typedef. --- src/gui/lbxgui.c | 12 ++++++------ src/gui/render.c | 2 +- src/gui/render.h | 2 +- src/image.h | 21 +++++++++++---------- src/lbximg.c | 8 ++++---- 5 files changed, 23 insertions(+), 22 deletions(-) diff --git a/src/gui/lbxgui.c b/src/gui/lbxgui.c index bdc1d50..a3212a6 100644 --- a/src/gui/lbxgui.c +++ b/src/gui/lbxgui.c @@ -37,7 +37,7 @@ static GtkBuilder *builder; static GtkWidget *canvas; static GdkGC *bg_gc; -static LBXimg *image; +static struct lbx_image *image; static GdkPixbuf *framebuf; @@ -152,7 +152,7 @@ gboolean canvas_expose(GtkWidget *canvas, GdkEventExpose *event, gpointer data) return TRUE; } -static int alloc_framebuffer(LBXimg *image) +static int alloc_framebuffer(struct lbx_image *image) { struct lbx_imginfo info; GtkSpinButton *spin; @@ -179,10 +179,10 @@ static int close_image(void *handle) return 0; } -static LBXimg *load_lbx_image(struct lbx *archive, unsigned index) +static struct lbx_image *load_lbx_image(struct lbx *archive, unsigned index) { LBXfile *file; - LBXimg *image; + struct lbx_image *image; file = lbx_file_open(archive, index); g_return_val_if_fail(file, NULL); @@ -198,7 +198,7 @@ void set_override(GtkComboBox *combo) GtkTreeIter iter; gpointer lbx; guint index; - LBXimg *img; + struct lbx_image *img; memset(palette_override, 0, sizeof palette_override); if (!gtk_combo_box_get_active_iter(combo, &iter)) @@ -248,7 +248,7 @@ void set_image(GtkComboBox *combo) GtkTreeIter iter; gpointer lbx; guint index; - LBXimg *img; + struct lbx_image *img; if (image) { lbx_img_close(image); diff --git a/src/gui/render.c b/src/gui/render.c index 584cfd2..370c816 100644 --- a/src/gui/render.c +++ b/src/gui/render.c @@ -46,7 +46,7 @@ static void get_colour(unsigned char index, unsigned char out[static 4]) out[3] = -1; /* opaque */ } -int render_to_pixbuf(LBXimg *image, GdkPixbuf *pixbuf, unsigned frame) +int render_to_pixbuf(struct lbx_image *image, GdkPixbuf *pixbuf, unsigned frame) { unsigned char **framedata, **framemask, *outbuf; struct lbx_imginfo info; diff --git a/src/gui/render.h b/src/gui/render.h index 3ebd0d2..f24e47b 100644 --- a/src/gui/render.h +++ b/src/gui/render.h @@ -7,6 +7,6 @@ extern struct lbx_colour palette_external[256]; extern struct lbx_colour palette_internal[256]; extern struct lbx_colour palette_override[256]; -int render_to_pixbuf(LBXimg *image, GdkPixbuf *pixbuf, unsigned frame); +int render_to_pixbuf(struct lbx_image *image, GdkPixbuf *pixbuf, unsigned frame); #endif diff --git a/src/image.h b/src/image.h index a614837..2679bab 100644 --- a/src/image.h +++ b/src/image.h @@ -5,10 +5,10 @@ struct lbx_file_ops; -typedef struct lbx_image { +struct lbx_image { unsigned short width, height; unsigned char frames, chunk; -} LBXimg; +}; struct lbx_colour { unsigned char red; @@ -23,18 +23,19 @@ struct lbx_imginfo { int palettesz, looping; }; -LBXimg *lbx_img_open(void *f, const struct lbx_file_ops *fops, - int (*destructor)(void *)); -LBXimg *lbx_img_fopen(const char *file); -int lbx_img_close(LBXimg *img); +struct lbx_image *lbx_img_open(void *f, const struct lbx_file_ops *fops, + int (*destructor)(void *)); +struct lbx_image *lbx_img_fopen(const char *file); +int lbx_img_close(struct lbx_image *img); -unsigned char **lbx_img_getframe(LBXimg *img, int frame); -unsigned char **lbx_img_getmask(LBXimg *img); +unsigned char **lbx_img_getframe(struct lbx_image *img, int frame); +unsigned char **lbx_img_getmask(struct lbx_image *img); int lbx_img_loadpalette(void *f, const struct lbx_file_ops *fops, struct lbx_colour palette[static 256]); -int lbx_img_getpalette(LBXimg *img, struct lbx_colour palette[static 256]); +int lbx_img_getpalette(struct lbx_image *img, + struct lbx_colour palette[static 256]); -void lbx_img_getinfo(LBXimg *img, struct lbx_imginfo *info); +void lbx_img_getinfo(struct lbx_image *img, struct lbx_imginfo *info); #endif diff --git a/src/lbximg.c b/src/lbximg.c index fc12a73..43406f1 100644 --- a/src/lbximg.c +++ b/src/lbximg.c @@ -235,7 +235,7 @@ err: static int loadoverride(FILE *f, struct lbx_colour palette[static 256]) { - LBXimg *overimg = lbx_img_open(f, &lbx_default_fops, NULL); + struct lbx_image *overimg = lbx_img_open(f, &lbx_default_fops, NULL); struct lbx_imginfo info; if (!overimg) { @@ -260,7 +260,7 @@ static int loadoverride(FILE *f, struct lbx_colour palette[static 256]) return 0; } -static int loadpalette(LBXimg *img, struct lbx_imginfo *info, +static int loadpalette(struct lbx_image *img, struct lbx_imginfo *info, FILE *palf, FILE *override, struct lbx_colour palette[static 256]) { @@ -306,7 +306,7 @@ static int loadpalette(LBXimg *img, struct lbx_imginfo *info, return 0; } -int decode(LBXimg *img, FILE *palf, FILE *override, char **argv) +int decode(struct lbx_image *img, FILE *palf, FILE *override, char **argv) { unsigned char *framebits; struct lbx_colour palette[256]; @@ -374,7 +374,7 @@ int main(int argc, char **argv) struct lbx_pipe_state stdin_handle = { .f = stdin }; FILE *palf = NULL, *overf = NULL; const char *file = NULL; - LBXimg *img; + struct lbx_image *img; static const char *sopts = "idnvf:p:O:V"; static const struct option lopts[] = { -- 2.43.0