diff --git a/src/dbus.c b/src/dbus.c index 6196a1e..1a5379d 100644 --- a/src/dbus.c +++ b/src/dbus.c @@ -81,7 +81,7 @@ static void on_get_server_information(GDBusConnection *connection, const gchar *sender, const GVariant *parameters, GDBusMethodInvocation *invocation); -static RawImage *get_raw_image_from_data_hint(GVariant *icon_data); +static struct raw_image *get_raw_image_from_data_hint(GVariant *icon_data); void handle_method_call(GDBusConnection *connection, const gchar *sender, @@ -520,9 +520,9 @@ static void on_name_lost(GDBusConnection *connection, exit(1); } -static RawImage *get_raw_image_from_data_hint(GVariant *icon_data) +static struct raw_image *get_raw_image_from_data_hint(GVariant *icon_data) { - RawImage *image = g_malloc(sizeof(RawImage)); + struct raw_image *image = g_malloc(sizeof(struct raw_image)); GVariant *data_variant; gsize expected_len; diff --git a/src/icon.c b/src/icon.c index 9721961..4356a2b 100644 --- a/src/icon.c +++ b/src/icon.c @@ -126,7 +126,7 @@ GdkPixbuf *get_pixbuf_from_icon(const char *iconname) return pixbuf; } -GdkPixbuf *get_pixbuf_from_raw_image(const RawImage *raw_image) +GdkPixbuf *get_pixbuf_from_raw_image(const struct raw_image *raw_image) { GdkPixbuf *pixbuf = NULL; diff --git a/src/icon.h b/src/icon.h index 2b3d92a..54aa3e4 100644 --- a/src/icon.h +++ b/src/icon.h @@ -26,9 +26,9 @@ GdkPixbuf *get_pixbuf_from_file(const char *filename); */ GdkPixbuf *get_pixbuf_from_icon(const char *iconname); -/** Convert a RawImage to a `GdkPixbuf` +/** Convert a struct raw_image to a `GdkPixbuf` */ -GdkPixbuf *get_pixbuf_from_raw_image(const RawImage *raw_image); +GdkPixbuf *get_pixbuf_from_raw_image(const struct raw_image *raw_image); /** * Get a cairo surface with the appropriate icon for the notification, scaled diff --git a/src/notification.c b/src/notification.c index cc7511d..dbb1b10 100644 --- a/src/notification.c +++ b/src/notification.c @@ -197,7 +197,7 @@ void actions_free(struct actions *a) } /* see notification.h */ -void rawimage_free(RawImage *i) +void rawimage_free(struct raw_image *i) { if (!i) return; diff --git a/src/notification.h b/src/notification.h index e6ef0ae..55ed0d0 100644 --- a/src/notification.h +++ b/src/notification.h @@ -26,7 +26,7 @@ enum urgency { URG_MAX = 2, /**< Maximum value, useful for boundary checking */ }; -typedef struct _raw_image { +struct raw_image { int width; int height; int rowstride; @@ -34,7 +34,7 @@ typedef struct _raw_image { int bits_per_sample; int n_channels; unsigned char *data; -} RawImage; +}; struct actions { char **actions; @@ -53,7 +53,7 @@ typedef struct _notification { enum urgency urgency; char *icon; /**< plain icon information (may be a path or just a name) */ - RawImage *raw_icon; /**< passed icon data of notification, takes precedence over icon */ + struct raw_image *raw_icon; /**< passed icon data of notification, takes precedence over icon */ gint64 start; /**< begin of current display */ gint64 timestamp; /**< arrival time */ @@ -111,11 +111,11 @@ void notification_init(notification *n); void actions_free(struct actions *a); /** - * Free a #RawImage + * Free a #raw_image * - * @param i (nullable): pointer to #RawImage + * @param i (nullable): pointer to #raw_image */ -void rawimage_free(RawImage *i); +void rawimage_free(struct raw_image *i); /** * Free the memory used by the given notification. diff --git a/test/notification.c b/test/notification.c index a9c02d6..ba74fb8 100644 --- a/test/notification.c +++ b/test/notification.c @@ -39,19 +39,19 @@ TEST test_notification_is_duplicate(void *notifications) settings.icon_position = icons_off; ASSERT(notification_is_duplicate(a, b)); //Setting pointer to a random value since we are checking for null - b->raw_icon = (RawImage*)0xff; + b->raw_icon = (struct raw_image*)0xff; ASSERT(notification_is_duplicate(a, b)); b->raw_icon = NULL; settings.icon_position = icons_left; ASSERT_FALSE(notification_is_duplicate(a, b)); - b->raw_icon = (RawImage*)0xff; + b->raw_icon = (struct raw_image*)0xff; ASSERT_FALSE(notification_is_duplicate(a, b)); b->raw_icon = NULL; settings.icon_position = icons_right; ASSERT_FALSE(notification_is_duplicate(a, b)); - b->raw_icon = (RawImage*)0xff; + b->raw_icon = (struct raw_image*)0xff; ASSERT_FALSE(notification_is_duplicate(a, b)); b->raw_icon = NULL;