Skip to content

Commit

Permalink
Merge pull request dunst-project#531 from bebehei/typenames
Browse files Browse the repository at this point in the history
Refactor typenames
  • Loading branch information
tsipinakis authored Sep 24, 2018
2 parents fab2543 + 476ddc8 commit 09ef1b2
Showing 23 changed files with 266 additions and 264 deletions.
8 changes: 4 additions & 4 deletions config.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* see example dunstrc for additional explanations about these options */

settings_t defaults = {
struct settings defaults = {

.font = "-*-terminus-medium-r-*-*-16-*-*-*-*-*-*-*",
.markup = MARKUP_NO,
@@ -32,12 +32,12 @@ settings_t defaults = {
.indicate_hidden = true, /* show count of hidden messages */
.idle_threshold = 0, /* don't timeout notifications when idle for x seconds */
.show_age_threshold = -1, /* show age of notification, when notification is older than x seconds */
.align = left, /* text alignment [left/center/right] */
.align = ALIGN_LEFT, /* text alignment ALIGN_[LEFT|CENTER|RIGHT] */
.sticky_history = true,
.history_length = 20, /* max amount of notifications kept in history */
.show_indicators = true,
.word_wrap = false,
.ellipsize = middle,
.ellipsize = ELLIPSE_MIDDLE,
.ignore_newline = false,
.line_height = 0, /* if line height < font height, it will be raised to font height */
.notification_height = 0, /* if notification height < font height and padding, it will be raised */
@@ -110,7 +110,7 @@ settings_t defaults = {

};

rule_t default_rules[] = {
struct rule default_rules[] = {
/* name can be any unique string. It is used to identify
* the rule in dunstrc to override it there
*/
18 changes: 9 additions & 9 deletions src/dbus.c
Original file line number Diff line number Diff line change
@@ -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,
@@ -130,12 +130,12 @@ static void on_get_capabilities(GDBusConnection *connection,
g_dbus_connection_flush(connection, NULL, NULL, NULL);
}

static notification *dbus_message_to_notification(const gchar *sender, GVariant *parameters)
static struct notification *dbus_message_to_notification(const gchar *sender, GVariant *parameters)
{

notification *n = notification_create();
struct notification *n = notification_create();

n->actions = g_malloc0(sizeof(Actions));
n->actions = g_malloc0(sizeof(struct actions));
n->dbus_client = g_strdup(sender);

{
@@ -272,7 +272,7 @@ static void on_notify(GDBusConnection *connection,
GVariant *parameters,
GDBusMethodInvocation *invocation)
{
notification *n = dbus_message_to_notification(sender, parameters);
struct notification *n = dbus_message_to_notification(sender, parameters);
int id = queues_notification_insert(n);

GVariant *reply = g_variant_new("(u)", id);
@@ -314,7 +314,7 @@ static void on_get_server_information(GDBusConnection *connection,
g_dbus_connection_flush(connection, NULL, NULL, NULL);
}

void signal_notification_closed(notification *n, enum reason reason)
void signal_notification_closed(struct notification *n, enum reason reason)
{
if (reason < REASON_MIN || REASON_MAX < reason) {
LOG_W("Closing notification with reason '%d' not supported. "
@@ -344,7 +344,7 @@ void signal_notification_closed(notification *n, enum reason reason)

}

void signal_action_invoked(notification *n, const char *identifier)
void signal_action_invoked(const struct notification *n, const char *identifier)
{
GVariant *body = g_variant_new("(us)", n->id, identifier);
GError *err = NULL;
@@ -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;

4 changes: 2 additions & 2 deletions src/dbus.h
Original file line number Diff line number Diff line change
@@ -17,8 +17,8 @@ enum reason {

int initdbus(void);
void dbus_tear_down(int id);
void signal_notification_closed(notification *n, enum reason reason);
void signal_action_invoked(notification *n, const char *identifier);
void signal_notification_closed(struct notification *n, enum reason reason);
void signal_action_invoked(const struct notification *n, const char *identifier);

#endif
/* vim: set tabstop=8 shiftwidth=8 expandtab textwidth=0: */
Loading

0 comments on commit 09ef1b2

Please sign in to comment.