summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKim Woelders <kim@woelders.dk>2021-12-06 19:43:51 +0100
committerKim Woelders <kim@woelders.dk>2021-12-21 06:05:32 +0100
commit40b6498281467638012a5da87e96ba6d6dacb9ba (patch)
treecf83330d35ec01f026e19fe7c7c6cf0c180de156
parentb28d9110e4d083552d10104beb56b52f85e9d69a (diff)
downloadimlib2-40b6498281467638012a5da87e96ba6d6dacb9ba.tar.gz
Drop some intermediate type definitions
Not helpful, IMO.
-rw-r--r--src/lib/Imlib2.h.in31
-rw-r--r--src/lib/api.c23
-rw-r--r--src/lib/colormod.h6
-rw-r--r--src/lib/dynamic_filters.c4
-rw-r--r--src/lib/dynamic_filters.h16
-rw-r--r--src/lib/filter.h16
-rw-r--r--src/lib/font.h29
-rw-r--r--src/lib/font_draw.c4
-rw-r--r--src/lib/font_main.c4
-rw-r--r--src/lib/grad.h13
-rw-r--r--src/lib/image.c2
-rw-r--r--src/lib/image.h22
-rw-r--r--src/lib/polygon.c39
-rw-r--r--src/lib/rgbadraw.h33
-rw-r--r--src/lib/script.h18
-rw-r--r--src/lib/updates.h8
-rw-r--r--src/lib/x11_context.h8
-rw-r--r--src/lib/x11_pixmap.h8
-rw-r--r--src/modules/filters/filter_bumpmap.c12
-rw-r--r--src/modules/filters/filter_colormod.c8
-rw-r--r--src/modules/filters/filter_common.h4
-rw-r--r--src/modules/filters/filter_test.c4
22 files changed, 132 insertions, 180 deletions
diff --git a/src/lib/Imlib2.h.in b/src/lib/Imlib2.h.in
index 697ad1b..5e67aeb 100644
--- a/src/lib/Imlib2.h.in
+++ b/src/lib/Imlib2.h.in
@@ -49,27 +49,25 @@ typedef void *Imlib_Updates;
typedef void *Imlib_Font;
typedef void *Imlib_Color_Range;
typedef void *Imlib_Filter;
-typedef struct _imlib_border Imlib_Border;
-typedef struct _imlib_color Imlib_Color;
typedef void *ImlibPolygon;
/* blending operations */
-enum _imlib_operation {
+typedef enum {
IMLIB_OP_COPY,
IMLIB_OP_ADD,
IMLIB_OP_SUBTRACT,
IMLIB_OP_RESHADE
-};
+} Imlib_Operation;
-enum _imlib_text_direction {
+typedef enum {
IMLIB_TEXT_TO_RIGHT = 0,
IMLIB_TEXT_TO_LEFT = 1,
IMLIB_TEXT_TO_DOWN = 2,
IMLIB_TEXT_TO_UP = 3,
IMLIB_TEXT_TO_ANGLE = 4
-};
+} Imlib_Text_Direction;
-enum _imlib_load_error {
+typedef enum {
IMLIB_LOAD_ERROR_NONE,
IMLIB_LOAD_ERROR_FILE_DOES_NOT_EXIST,
IMLIB_LOAD_ERROR_FILE_IS_DIRECTORY,
@@ -85,29 +83,24 @@ enum _imlib_load_error {
IMLIB_LOAD_ERROR_PERMISSION_DENIED_TO_WRITE,
IMLIB_LOAD_ERROR_OUT_OF_DISK_SPACE,
IMLIB_LOAD_ERROR_UNKNOWN
-};
+} Imlib_Load_Error;
/* Encodings known to Imlib2 (so far) */
-enum _imlib_TTF_encoding {
+typedef enum {
IMLIB_TTF_ENCODING_ISO_8859_1,
IMLIB_TTF_ENCODING_ISO_8859_2,
IMLIB_TTF_ENCODING_ISO_8859_3,
IMLIB_TTF_ENCODING_ISO_8859_4,
IMLIB_TTF_ENCODING_ISO_8859_5
-};
+} Imlib_TTF_Encoding;
-typedef enum _imlib_operation Imlib_Operation;
-typedef enum _imlib_load_error Imlib_Load_Error;
-typedef enum _imlib_text_direction Imlib_Text_Direction;
-typedef enum _imlib_TTF_encoding Imlib_TTF_Encoding;
-
-struct _imlib_border {
+typedef struct {
int left, right, top, bottom;
-};
+} Imlib_Border;
-struct _imlib_color {
+typedef struct {
int alpha, red, green, blue;
-};
+} Imlib_Color;
/* Progressive loading callbacks */
typedef int (*Imlib_Progress_Function)(Imlib_Image im, char percent,
diff --git a/src/lib/api.c b/src/lib/api.c
index 6b68528..b2f77c4 100644
--- a/src/lib/api.c
+++ b/src/lib/api.c
@@ -100,11 +100,10 @@ typedef struct {
char dirty;
} ImlibContext;
-typedef struct _imlibcontextitem ImlibContextItem;
-struct _imlibcontextitem {
+typedef struct _ImlibContextItem {
ImlibContext *context;
- ImlibContextItem *below;
-};
+ struct _ImlibContextItem *below;
+} ImlibContextItem;
#define DefaultContext { \
.anti_alias = 1, \
@@ -4368,6 +4367,7 @@ imlib_save_image_with_error_return(const char *filename,
Imlib_Load_Error * error_return)
{
ImlibImage *im;
+ int er;
CHECK_PARAM_POINTER("image", ctx->image);
CHECK_PARAM_POINTER("filename", filename);
@@ -4378,7 +4378,8 @@ imlib_save_image_with_error_return(const char *filename,
return;
__imlib_SaveImage(im, filename, (ImlibProgressFunction) ctx->progress_func,
- ctx->progress_granularity, error_return);
+ ctx->progress_granularity, &er);
+ *error_return = er;
}
/**
@@ -4856,7 +4857,7 @@ EAPI void
imlib_polygon_add_point(ImlibPolygon poly, int x, int y)
{
CHECK_PARAM_POINTER("polygon", poly);
- __imlib_polygon_add_point((ImlibPoly) poly, x, y);
+ __imlib_polygon_add_point((ImlibPoly *) poly, x, y);
}
/**
@@ -4868,7 +4869,7 @@ EAPI void
imlib_polygon_free(ImlibPolygon poly)
{
CHECK_PARAM_POINTER("polygon", poly);
- __imlib_polygon_free((ImlibPoly) poly);
+ __imlib_polygon_free((ImlibPoly *) poly);
}
/**
@@ -4890,7 +4891,7 @@ imlib_image_draw_polygon(ImlibPolygon poly, unsigned char closed)
if (__imlib_LoadImageData(im))
return;
__imlib_DirtyImage(im);
- __imlib_Polygon_DrawToImage((ImlibPoly) poly, closed, ctx->pixel,
+ __imlib_Polygon_DrawToImage((ImlibPoly *) poly, closed, ctx->pixel,
im, ctx->cliprect.x, ctx->cliprect.y,
ctx->cliprect.w, ctx->cliprect.h,
ctx->operation, ctx->blend, ctx->anti_alias);
@@ -4912,7 +4913,7 @@ imlib_image_fill_polygon(ImlibPolygon poly)
if (__imlib_LoadImageData(im))
return;
__imlib_DirtyImage(im);
- __imlib_Polygon_FillToImage((ImlibPoly) poly, ctx->pixel,
+ __imlib_Polygon_FillToImage((ImlibPoly *) poly, ctx->pixel,
im, ctx->cliprect.x, ctx->cliprect.y,
ctx->cliprect.w, ctx->cliprect.h,
ctx->operation, ctx->blend, ctx->anti_alias);
@@ -4934,7 +4935,7 @@ imlib_polygon_get_bounds(ImlibPolygon poly, int *px1, int *py1, int *px2,
int *py2)
{
CHECK_PARAM_POINTER("polygon", poly);
- __imlib_polygon_get_bounds((ImlibPoly) poly, px1, py1, px2, py2);
+ __imlib_polygon_get_bounds((ImlibPoly *) poly, px1, py1, px2, py2);
}
/**
@@ -5006,7 +5007,7 @@ EAPI unsigned char
imlib_polygon_contains_point(ImlibPolygon poly, int x, int y)
{
CHECK_PARAM_POINTER_RETURN("polygon", poly, 0);
- return __imlib_polygon_contains_point((ImlibPoly) poly, x, y);
+ return __imlib_polygon_contains_point((ImlibPoly *) poly, x, y);
}
EAPI void
diff --git a/src/lib/colormod.h b/src/lib/colormod.h
index 05ff5c6..aeb0384 100644
--- a/src/lib/colormod.h
+++ b/src/lib/colormod.h
@@ -4,15 +4,13 @@
#include "common.h"
#include "image.h"
-typedef struct _imlib_color_modifier ImlibColorModifier;
-
-struct _imlib_color_modifier {
+typedef struct {
DATA8 red_mapping[256];
DATA8 green_mapping[256];
DATA8 blue_mapping[256];
DATA8 alpha_mapping[256];
DATABIG modification_count;
-};
+} ImlibColorModifier;
#define CMOD_APPLY_RGB(cm, r, g, b) \
(r) = (cm)->red_mapping[(int)(r)]; \
diff --git a/src/lib/dynamic_filters.c b/src/lib/dynamic_filters.c
index 1d86156..275d25c 100644
--- a/src/lib/dynamic_filters.c
+++ b/src/lib/dynamic_filters.c
@@ -30,7 +30,7 @@ static ImlibExternalFilter *
__imlib_LoadFilter(char *file)
{
ImlibExternalFilter *ptr;
- struct imlib_filter_info *info;
+ ImlibFilterInfo *info;
/* printf( "Loading filter %s\n", file ); */
MALLOCSHOW;
@@ -57,7 +57,7 @@ __imlib_LoadFilter(char *file)
free(ptr);
return NULL;
}
- info = malloc(sizeof(struct imlib_filter_info));
+ info = malloc(sizeof(ImlibFilterInfo));
ptr->init_filter(info);
ptr->num_filters = info->num_filters;
ptr->filters = info->filters;
diff --git a/src/lib/dynamic_filters.h b/src/lib/dynamic_filters.h
index 829e7f6..2b0ec8b 100644
--- a/src/lib/dynamic_filters.h
+++ b/src/lib/dynamic_filters.h
@@ -3,17 +3,15 @@
#include "script.h"
-struct imlib_filter_info {
+typedef struct {
char *name;
char *author;
char *description;
char **filters;
int num_filters;
-};
+} ImlibFilterInfo;
-typedef struct _imlib_external_filter ImlibExternalFilter;
-
-struct _imlib_external_filter {
+typedef struct _ImlibExternalFilter {
char *name;
char *author;
char *description;
@@ -21,12 +19,12 @@ struct _imlib_external_filter {
char *filename;
void *handle;
char **filters;
- void (*init_filter)(struct imlib_filter_info * info);
+ void (*init_filter)(ImlibFilterInfo * info);
void (*deinit_filter)(void);
void *(*exec_filter)(char *filter, void *im,
- pIFunctionParam params);
- ImlibExternalFilter *next;
-};
+ IFunctionParam * params);
+ struct _ImlibExternalFilter *next;
+} ImlibExternalFilter;
void __imlib_dynamic_filters_init(void);
void __imlib_dynamic_filters_deinit(void);
diff --git a/src/lib/filter.h b/src/lib/filter.h
index 56ea46a..57d7df1 100644
--- a/src/lib/filter.h
+++ b/src/lib/filter.h
@@ -3,24 +3,20 @@
#include "common.h"
-typedef struct _imlib_filter ImlibFilter;
-typedef struct _imlib_filter_color ImlibFilterColor;
-typedef struct _imlib_filter_pixel ImlibFilterPixel;
-
-struct _imlib_filter_pixel {
+typedef struct {
int xoff, yoff;
int a, r, g, b;
-};
+} ImlibFilterPixel;
-struct _imlib_filter_color {
+typedef struct {
int size, entries;
int div, cons;
ImlibFilterPixel *pixels;
-};
+} ImlibFilterColor;
-struct _imlib_filter {
+typedef struct {
ImlibFilterColor alpha, red, green, blue;
-};
+} ImlibFilter;
ImlibFilter *__imlib_CreateFilter(int size);
void __imlib_FreeFilter(ImlibFilter * fil);
diff --git a/src/lib/font.h b/src/lib/font.h
index e9b86fd..520e299 100644
--- a/src/lib/font.h
+++ b/src/lib/font.h
@@ -6,29 +6,22 @@
/* TODO separate fonts and data stuff */
-typedef struct _Imlib_Font ImlibFont;
-typedef struct _Imlib_Font_Glyph Imlib_Font_Glyph;
+typedef struct _Imlib_Object_List {
+ struct _Imlib_Object_List *next, *prev;
+} Imlib_Object_List;
-typedef struct _Imlib_Object_List Imlib_Object_List;
-typedef struct _Imlib_Hash Imlib_Hash;
-typedef struct _Imlib_Hash_El Imlib_Hash_El;
-
-struct _Imlib_Object_List {
- Imlib_Object_List *next, *prev;
-};
-
-struct _Imlib_Hash {
+typedef struct {
int population;
Imlib_Object_List *buckets[256];
-};
+} Imlib_Hash;
-struct _Imlib_Hash_El {
+typedef struct {
Imlib_Object_List _list_data;
char *key;
void *data;
-};
+} Imlib_Hash_El;
-struct _Imlib_Font {
+typedef struct _Imlib_Font {
Imlib_Object_List _list_data;
char *name;
char *file;
@@ -47,12 +40,12 @@ struct _Imlib_Font {
/* using a double-linked list for the fallback chain */
struct _Imlib_Font *fallback_prev;
struct _Imlib_Font *fallback_next;
-};
+} ImlibFont;
-struct _Imlib_Font_Glyph {
+typedef struct {
FT_Glyph glyph;
FT_BitmapGlyph glyph_out;
-};
+} Imlib_Font_Glyph;
/* functions */
diff --git a/src/lib/font_draw.c b/src/lib/font_draw.c
index 9756f9c..d0326fe 100644
--- a/src/lib/font_draw.c
+++ b/src/lib/font_draw.c
@@ -39,10 +39,10 @@ __imlib_font_cache_glyph_get(ImlibFont * fn, FT_UInt index)
if (error)
return NULL;
- fg = malloc(sizeof(struct _Imlib_Font_Glyph));
+ fg = malloc(sizeof(Imlib_Font_Glyph));
if (!fg)
return NULL;
- memset(fg, 0, (sizeof(struct _Imlib_Font_Glyph)));
+ memset(fg, 0, sizeof(Imlib_Font_Glyph));
error = FT_Get_Glyph(fn->ft.face->glyph, &(fg->glyph));
if (error)
diff --git a/src/lib/font_main.c b/src/lib/font_main.c
index 1133a0a..2e5e47c 100644
--- a/src/lib/font_main.c
+++ b/src/lib/font_main.c
@@ -254,14 +254,14 @@ __imlib_hash_add(Imlib_Hash * hash, const char *key, const void *data)
_imlib_hash_alloc_error = 0;
if (!hash)
{
- hash = calloc(1, sizeof(struct _Imlib_Hash));
+ hash = calloc(1, sizeof(Imlib_Hash));
if (!hash)
{
_imlib_hash_alloc_error = 1;
return NULL;
}
}
- if (!(el = malloc(sizeof(struct _Imlib_Hash_El))))
+ if (!(el = malloc(sizeof(Imlib_Hash_El))))
{
if (hash->population <= 0)
{
diff --git a/src/lib/grad.h b/src/lib/grad.h
index ac41b27..a2f1e08 100644
--- a/src/lib/grad.h
+++ b/src/lib/grad.h
@@ -3,18 +3,15 @@
#include "common.h"
-typedef struct _imlib_range ImlibRange;
-typedef struct _imlib_range_color ImlibRangeColor;
-
-struct _imlib_range_color {
+typedef struct _ImlibRangeColor {
DATA8 red, green, blue, alpha;
int distance;
- ImlibRangeColor *next;
-};
+ struct _ImlibRangeColor *next;
+} ImlibRangeColor;
-struct _imlib_range {
+typedef struct {
ImlibRangeColor *color;
-};
+} ImlibRange;
ImlibRange *__imlib_CreateRange(void);
void __imlib_FreeRange(ImlibRange * rg);
diff --git a/src/lib/image.c b/src/lib/image.c
index cb711d1..57ffcb7 100644
--- a/src/lib/image.c
+++ b/src/lib/image.c
@@ -719,7 +719,7 @@ __imlib_DirtyImage(ImlibImage * im)
void
__imlib_SaveImage(ImlibImage * im, const char *file,
ImlibProgressFunction progress, char progress_granularity,
- ImlibLoadError * er)
+ int *er)
{
ImlibLoader *l;
char e, *pfile;
diff --git a/src/lib/image.h b/src/lib/image.h
index 77e9a38..de8e27e 100644
--- a/src/lib/image.h
+++ b/src/lib/image.h
@@ -3,13 +3,10 @@
#include "common.h"
-typedef struct _imlibimage ImlibImage;
typedef struct _imlibldctx ImlibLdCtx;
-
-typedef struct _imlibborder ImlibBorder;
typedef struct _imlibloader ImlibLoader;
-typedef struct _imlibimagetag ImlibImageTag;
-typedef enum _imlib_load_error ImlibLoadError;
+
+typedef struct _ImlibImage ImlibImage;
typedef int (*ImlibProgressFunction)(ImlibImage * im, char percent,
int update_x, int update_y,
@@ -36,19 +33,19 @@ typedef enum _iflags ImlibImageFlags;
#define FF_IMAGE_ANIMATED (1 << 0) /* Frames are an animated sequence */
#define FF_FRAME_CLEAR (1 << 1) /* Clear before rendering frame */
-struct _imlibborder {
+typedef struct {
int left, right, top, bottom;
-};
+} ImlibBorder;
-struct _imlibimagetag {
+typedef struct _ImlibImageTag {
char *key;
int val;
void *data;
void (*destructor)(ImlibImage * im, void *data);
- ImlibImageTag *next;
-};
+ struct _ImlibImageTag *next;
+} ImlibImageTag;
-struct _imlibimage {
+struct _ImlibImage {
char *file;
int w, h;
DATA32 *data;
@@ -108,8 +105,7 @@ void __imlib_DirtyImage(ImlibImage * im);
void __imlib_FreeImage(ImlibImage * im);
void __imlib_SaveImage(ImlibImage * im, const char *file,
ImlibProgressFunction progress,
- char progress_granularity,
- ImlibLoadError * er);
+ char progress_granularity, int *er);
DATA32 *__imlib_AllocateData(ImlibImage * im);
void __imlib_FreeData(ImlibImage * im);
diff --git a/src/lib/polygon.c b/src/lib/polygon.c
index c06df45..f508fba 100644
--- a/src/lib/polygon.c
+++ b/src/lib/polygon.c
@@ -6,20 +6,20 @@
#include "rgbadraw.h"
#include "span.h"
-ImlibPoly
+ImlibPoly *
__imlib_polygon_new()
{
- ImlibPoly poly;
+ ImlibPoly *poly;
- poly = malloc(sizeof(_ImlibPoly));
+ poly = malloc(sizeof(ImlibPoly));
if (!poly)
return NULL;
- memset(poly, 0, sizeof(_ImlibPoly));
+ memset(poly, 0, sizeof(ImlibPoly));
return poly;
}
void
-__imlib_polygon_add_point(ImlibPoly poly, int x, int y)
+__imlib_polygon_add_point(ImlibPoly * poly, int x, int y)
{
if (!poly->points)
{
@@ -59,7 +59,7 @@ __imlib_polygon_add_point(ImlibPoly poly, int x, int y)
}
void
-__imlib_polygon_free(ImlibPoly poly)
+__imlib_polygon_free(ImlibPoly * poly)
{
free(poly->points);
free(poly);
@@ -77,7 +77,7 @@ __imlib_polygon_free(ImlibPoly poly)
__imlib_segments_intersect(p_x, p_y, p_x, p_y, s1_x, s1_y, s2_x, s2_y)
void
-__imlib_polygon_get_bounds(ImlibPoly poly, int *px1, int *py1, int *px2,
+__imlib_polygon_get_bounds(ImlibPoly * poly, int *px1, int *py1, int *px2,
int *py2)
{
if (!poly || !poly->points || (poly->pointcount < 1))
@@ -139,7 +139,7 @@ __imlib_segments_intersect(int r1_x, int r1_y, int r2_x, int r2_y, int s1_x,
}
unsigned char
-__imlib_polygon_contains_point(ImlibPoly poly, int x, int y)
+__imlib_polygon_contains_point(ImlibPoly * poly, int x, int y)
{
int count = 0;
int start = 0;
@@ -213,21 +213,18 @@ __imlib_polygon_contains_point(ImlibPoly poly, int x, int y)
#define SHALLOW_EDGE 1
#define HORZ_EDGE 2
-typedef struct _PolyEdge PolyEdge;
-typedef struct _IndexedValue IndexedValue;
-
-struct _PolyEdge {
+typedef struct {
int type;
int xx;
int dxx, dyy;
ImlibPoint *v0, *v1;
int index;
-};
+} PolyEdge;
-struct _IndexedValue {
+typedef struct {
int val;
int index;
-};
+} IndexedValue;
static int
poly_value_sorter(const void *a, const void *b)
@@ -473,7 +470,7 @@ do { \
/* draws the poly-line defined by the sequence of vertices */
static void
-__imlib_Polygon_DrawToData(ImlibPoly poly, char close, DATA32 color,
+__imlib_Polygon_DrawToData(ImlibPoly * poly, char close, DATA32 color,
DATA32 * dst, int dstw,
int clx, int cly, int clw, int clh,
ImlibOp op, char dst_alpha, char blend)
@@ -712,7 +709,7 @@ __imlib_Polygon_DrawToData(ImlibPoly poly, char close, DATA32 color,
/* anti-aliased drawing */
static void
-__imlib_Polygon_DrawToData_AA(ImlibPoly poly, char close, DATA32 color,
+__imlib_Polygon_DrawToData_AA(ImlibPoly * poly, char close, DATA32 color,
DATA32 * dst, int dstw,
int clx, int cly, int clw, int clh,
ImlibOp op, char dst_alpha, char blend)
@@ -1041,7 +1038,7 @@ __imlib_Polygon_DrawToData_AA(ImlibPoly poly, char close, DATA32 color,
}
void
-__imlib_Polygon_DrawToImage(ImlibPoly poly, char close, DATA32 color,
+__imlib_Polygon_DrawToImage(ImlibPoly * poly, char close, DATA32 color,
ImlibImage * im, int clx, int cly, int clw, int clh,
ImlibOp op, char blend, char anti_alias)
{
@@ -1097,7 +1094,7 @@ __imlib_Polygon_DrawToImage(ImlibPoly poly, char close, DATA32 color,
/* aliased filling */
static void
-__imlib_Polygon_FillToData(ImlibPoly poly, DATA32 color,
+__imlib_Polygon_FillToData(ImlibPoly * poly, DATA32 color,
DATA32 * dst, int dstw,
int clx, int cly, int clw, int clh,
ImlibOp op, char dst_alpha, char blend)
@@ -1414,7 +1411,7 @@ __imlib_Polygon_FillToData(ImlibPoly poly, DATA32 color,
/* anti-aliased filling */
static void
-__imlib_Polygon_FillToData_AA(ImlibPoly poly, DATA32 color,
+__imlib_Polygon_FillToData_AA(ImlibPoly * poly, DATA32 color,
DATA32 * dst, int dstw,
int clx, int cly, int clw, int clh,
ImlibOp op, char dst_alpha, char blend)
@@ -1796,7 +1793,7 @@ __imlib_Polygon_FillToData_AA(ImlibPoly poly, DATA32 color,
}
void
-__imlib_Polygon_FillToImage(ImlibPoly poly, DATA32 color,
+__imlib_Polygon_FillToImage(ImlibPoly * poly, DATA32 color,
ImlibImage * im, int clx, int cly, int clw, int clh,
ImlibOp op, char blend, char anti_alias)
{
diff --git a/src/lib/rgbadraw.h b/src/lib/rgbadraw.h
index 2e11092..4a6d35d 100644
--- a/src/lib/rgbadraw.h
+++ b/src/lib/rgbadraw.h
@@ -37,27 +37,20 @@ do { \
#define MULT(na, a0, a1, tmp) \
DIV_255(na, (a0) * (a1), tmp)
-typedef struct _imlib_point ImlibPoint;
-
-struct _imlib_point {
+typedef struct {
int x, y;
-};
-
-typedef struct _imlib_rectangle Imlib_Rectangle;
+} ImlibPoint;
-struct _imlib_rectangle {
+typedef struct {
int x, y, w, h;
-};
-
-typedef struct _imlib_polygon _ImlibPoly;
-typedef _ImlibPoly *ImlibPoly;
+} Imlib_Rectangle;
-struct _imlib_polygon {
+typedef struct {
ImlibPoint *points;
int pointcount;
int lx, rx;
int ty, by;
-};
+} ImlibPoly;
/* image related operations: in rgbadraw.c */
@@ -125,24 +118,24 @@ void __imlib_Ellipse_FillToImage(int xc, int yc, int a, int b,
/* polygon handling functions: in polygon.c */
-ImlibPoly __imlib_polygon_new(void);
-void __imlib_polygon_free(ImlibPoly poly);
-void __imlib_polygon_add_point(ImlibPoly poly, int x, int y);
-unsigned char __imlib_polygon_contains_point(ImlibPoly poly,
+ImlibPoly *__imlib_polygon_new(void);
+void __imlib_polygon_free(ImlibPoly * poly);
+void __imlib_polygon_add_point(ImlibPoly * poly, int x, int y);
+unsigned char __imlib_polygon_contains_point(ImlibPoly * poly,
int x, int y);
-void __imlib_polygon_get_bounds(ImlibPoly poly,
+void __imlib_polygon_get_bounds(ImlibPoly * poly,
int *px1, int *py1,
int *px2, int *py2);
/* polygon drawing and filling: in polygon.c */
-void __imlib_Polygon_DrawToImage(ImlibPoly poly, char closed,
+void __imlib_Polygon_DrawToImage(ImlibPoly * poly, char closed,
DATA32 color, ImlibImage * im,
int clx, int cly,
int clw, int clh,
ImlibOp op, char blend,
char anti_alias);
-void __imlib_Polygon_FillToImage(ImlibPoly poly, DATA32 color,
+void __imlib_Polygon_FillToImage(ImlibPoly * poly, DATA32 color,
ImlibImage * im,
int clx, int cly,
int clw, int clh,
diff --git a/src/lib/script.h b/src/lib/script.h
index 578786f..5abc1e9 100644
--- a/src/lib/script.h
+++ b/src/lib/script.h
@@ -29,22 +29,18 @@
} \
}
-typedef struct _imlib_function_param IFunctionParam;
-typedef struct _imlib_function_param *pIFunctionParam;
-struct _imlib_function_param {
+typedef struct _IFunctionParam {
char *key;
int type;
void *data;
- pIFunctionParam next;
-};
+ struct _IFunctionParam *next;
+} IFunctionParam;
-typedef struct _imlib_function IFunction;
-typedef struct _imlib_function *pIFunction;
-struct _imlib_function {
+typedef struct _IFunction {
char *name;
- pIFunctionParam params;
- pIFunction next;
-};
+ IFunctionParam *params;
+ struct _IFunction *next;
+} IFunction;
typedef struct _imlib_variable {
void *ptr;
diff --git a/src/lib/updates.h b/src/lib/updates.h
index 1d3ac5d..7736b50 100644
--- a/src/lib/updates.h
+++ b/src/lib/updates.h
@@ -3,12 +3,10 @@
#include "common.h"
-typedef struct _imlibupdate ImlibUpdate;
-
-struct _imlibupdate {
+typedef struct _ImlibUpdate {
int x, y, w, h;
- ImlibUpdate *next;
-};
+ struct _ImlibUpdate *next;
+} ImlibUpdate;
ImlibUpdate *__imlib_AddUpdate(ImlibUpdate * u,
int x, int y, int w, int h);
diff --git a/src/lib/x11_context.h b/src/lib/x11_context.h
index 6bd0006..c8d9ab0 100644
--- a/src/lib/x11_context.h
+++ b/src/lib/x11_context.h
@@ -3,22 +3,20 @@
#include "common.h"
-typedef struct _context Context;
-
-struct _context {
+typedef struct _Context {
int last_use;
Display *display;
Visual *visual;
Colormap colormap;
int depth;
- Context *next;
+ struct _Context *next;
DATA8 *palette;
DATA8 palette_type;
void *r_dither;
void *g_dither;
void *b_dither;
-};
+} Context;
void __imlib_SetMaxContexts(int num);
int __imlib_GetMaxContexts(void);
diff --git a/src/lib/x11_pixmap.h b/src/lib/x11_pixmap.h
index 85d4b2b..595c902 100644
--- a/src/lib/x11_pixmap.h
+++ b/src/lib/x11_pixmap.h
@@ -5,9 +5,7 @@
#include "image.h"
-typedef struct _imlibimagepixmap ImlibImagePixmap;
-
-struct _imlibimagepixmap {
+typedef struct _ImlibImagePixmap {
int w, h;
Pixmap pixmap, mask;
Display *display;
@@ -22,8 +20,8 @@ struct _imlibimagepixmap {
char dirty;
int references;
DATABIG modification_count;
- ImlibImagePixmap *next;
-};
+ struct _ImlibImagePixmap *next;
+} ImlibImagePixmap;
ImlibImagePixmap *__imlib_FindCachedImagePixmap(ImlibImage * im, int w, int h,
Display * d, Visual * v,
diff --git a/src/modules/filters/filter_bumpmap.c b/src/modules/filters/filter_bumpmap.c
index 21598ef..b11bce0 100644
--- a/src/modules/filters/filter_bumpmap.c
+++ b/src/modules/filters/filter_bumpmap.c
@@ -8,10 +8,10 @@
#define PI (4 * atan(1))
static Imlib_Image
-bump_map(Imlib_Image im, pIFunctionParam par)
+bump_map(Imlib_Image im, IFunctionParam * par)
{
Imlib_Image map = im;
- pIFunctionParam ptr;
+ IFunctionParam *ptr;
double an = 0, el = 30, d = 0x200;
double red = 0x200, green = 0x200, blue = 0x200;
double ambient = 0;
@@ -126,10 +126,10 @@ bump_map(Imlib_Image im, pIFunctionParam par)
}
static Imlib_Image
-bump_map_point(Imlib_Image im, pIFunctionParam par)
+bump_map_point(Imlib_Image im, IFunctionParam * par)
{
Imlib_Image map = im;
- pIFunctionParam ptr;
+ IFunctionParam *ptr;
double x = 0, y = 0, z = 30, d = 0x200;
double red = 0x200, green = 0x200, blue = 0x200;
double ambient = 0;
@@ -244,7 +244,7 @@ bump_map_point(Imlib_Image im, pIFunctionParam par)
}
void
-init(struct imlib_filter_info *info)
+init(ImlibFilterInfo * info)
{
static const char *const filters[] = { "bump_map_point", "bump_map" };
int i = ARRAY_SIZE(filters);
@@ -267,7 +267,7 @@ deinit()
}
void *
-exec(char *filter, void *im, pIFunctionParam par)
+exec(char *filter, void *im, IFunctionParam * par)
{
if (!strcmp(filter, "bump_map"))
return bump_map((Imlib_Image) im, par);
diff --git a/src/modules/filters/filter_colormod.c b/src/modules/filters/filter_colormod.c
index ebd55f4..28d74b9 100644
--- a/src/modules/filters/filter_colormod.c
+++ b/src/modules/filters/filter_colormod.c
@@ -52,11 +52,11 @@ mod_tint(double t[256], double v)
}
static Imlib_Image
-colormod(Imlib_Image im, pIFunctionParam par)
+colormod(Imlib_Image im, IFunctionParam * par)
{
double a_d[256], r_d[256], g_d[256], b_d[256];
DATA8 a_b[256], r_b[256], g_b[256], b_b[256];
- pIFunctionParam ptr;
+ IFunctionParam *ptr;
int x = 0, y = 0, h, w, i;
double v = 0.0;
@@ -225,7 +225,7 @@ colormod(Imlib_Image im, pIFunctionParam par)
}
void
-init(struct imlib_filter_info *info)
+init(ImlibFilterInfo * info)
{
static const char *const filters[] = { "colormod" };
int i = ARRAY_SIZE(filters);
@@ -247,7 +247,7 @@ deinit()
}
void *
-exec(char *filter, void *im, pIFunctionParam par)
+exec(char *filter, void *im, IFunctionParam * par)
{
if (!strcmp(filter, "colormod"))
return colormod((Imlib_Image) im, par);
diff --git a/src/modules/filters/filter_common.h b/src/modules/filters/filter_common.h
index 2b03694..e47863c 100644
--- a/src/modules/filters/filter_common.h
+++ b/src/modules/filters/filter_common.h
@@ -6,8 +6,8 @@
#include "dynamic_filters.h"
#include "image.h"
-__EXPORT__ void init(struct imlib_filter_info *info);
+__EXPORT__ void init(ImlibFilterInfo * info);
__EXPORT__ void deinit(void);
-__EXPORT__ void *exec(char *filter, void *im, pIFunctionParam params);
+__EXPORT__ void *exec(char *filter, void *im, IFunctionParam * params);
#endif /* __FILTER_COMMON_H */
diff --git a/src/modules/filters/filter_test.c b/src/modules/filters/filter_test.c
index 6264c2c..f484ed8 100644
--- a/src/modules/filters/filter_test.c
+++ b/src/modules/filters/filter_test.c
@@ -3,7 +3,7 @@
#include <Imlib2.h>
void
-init(struct imlib_filter_info *info)
+init(ImlibFilterInfo * info)
{
static const char *const filters[] = { "tint", "cool_text", "gradient" };
int i = 0;
@@ -26,7 +26,7 @@ deinit(void)
}
void *
-exec(char *filter, void *im, pIFunctionParam params)
+exec(char *filter, void *im, IFunctionParam * params)
{
Imlib_Image imge = im;
Imlib_Image anoim;