Permalink
Browse files

indent -linx --no-tabs

  • Loading branch information...
1 parent b8004f5 commit e82da9d5e7850aea25712ec43fadf0529656906f @knopwob knopwob committed Feb 21, 2013
Showing with 592 additions and 577 deletions.
  1. +23 −20 config.def.h
  2. +178 −175 dbus.c
  3. +1 −1 dbus.h
  4. +30 −51 dunst.c
  5. +0 −4 dunst.h
  6. +125 −128 menu.c
  7. +42 −43 notification.c
  8. +2 −3 notification.h
  9. +5 −3 option_parser.c
  10. +9 −10 rules.c
  11. +4 −4 rules.h
  12. +33 −29 settings.c
  13. +2 −2 utils.c
  14. +130 −96 x.c
  15. +8 −8 x.h
View
@@ -23,13 +23,13 @@ int sticky_history = True;
int verbosity = 0;
int word_wrap = False;
int ignore_newline = False;
-int line_height = 0; /* if line height < font height, it will be raised to font height */
+int line_height = 0; /* if line height < font height, it will be raised to font height */
-int separator_height = 2; /* height of the separator line between two notifications */
+int separator_height = 2; /* height of the separator line between two notifications */
int padding = 0;
-int h_padding = 0; /* horizontal padding */
-enum separator_color sep_color = AUTO; /* AUTO, FOREGROUND, FRAME, CUSTOM */
-char *sep_custom_color_str = NULL; /* custom color if sep_color is set to CUSTOM */
+int h_padding = 0; /* horizontal padding */
+enum separator_color sep_color = AUTO; /* AUTO, FOREGROUND, FRAME, CUSTOM */
+char *sep_custom_color_str = NULL; /* custom color if sep_color is set to CUSTOM */
int frame_width = 0;
char *frame_color = "#888888";
@@ -39,7 +39,6 @@ char *frame_color = "#888888";
* */
int startup_notification = False;
-
/* monitor to display notifications on */
int monitor = 0;
@@ -63,25 +62,29 @@ enum follow_mode f_mode = FOLLOW_NONE;
* use "none" to disable
*/
keyboard_shortcut close_ks = {.str = "none",
- .code = 0, .sym = NoSymbol,.is_valid = False}; /* ignore this */
+ .code = 0,.sym = NoSymbol,.is_valid = False
+}; /* ignore this */
keyboard_shortcut close_all_ks = {.str = "none",
- .code = 0, .sym = NoSymbol,.is_valid = False}; /* ignore this */
+ .code = 0,.sym = NoSymbol,.is_valid = False
+}; /* ignore this */
keyboard_shortcut history_ks = {.str = "none",
- .code = 0, .sym = NoSymbol,.is_valid = False}; /* ignore this */
+ .code = 0,.sym = NoSymbol,.is_valid = False
+}; /* ignore this */
keyboard_shortcut context_ks = {.str = "none",
- .code = 0, .sym = NoSymbol,.is_valid = False}; /* ignore this */
+ .code = 0,.sym = NoSymbol,.is_valid = False
+}; /* ignore this */
rule_t default_rules[] = {
- /* name can be any unique string. It is used to identify the rule in dunstrc to override it there */
-
- /* name, appname, summary, body, icon, timeout, urgency, fg, bg, format, script */
- { "empty", NULL, NULL, NULL, NULL, -1, -1, NULL, NULL, NULL, NULL},
- /* { "rule1", "notify-send", NULL, NULL, NULL, -1, -1, NULL, NULL, "%s %b", NULL }, */
- /* { "rule2", "Pidgin", "*says*, NULL, NULL, -1, CRITICAL, NULL, NULL, NULL, NULL }, */
- /* { "rule3", "Pidgin", "*signed on*", NULL, NULL, -1, LOW, NULL, NULL, NULL, NULL }, */
- /* { "rule4", "Pidgin", "*signed off*", NULL, NULL, -1, LOW, NULL, NULL, NULL, NULL }, */
- /* { "rule5", NULL, "*foobar*", NULL, NULL, -1, -1, NULL, "#00FF00", NULL, NULL }, */
- };
+ /* name can be any unique string. It is used to identify the rule in dunstrc to override it there */
+
+ /* name, appname, summary, body, icon, timeout, urgency, fg, bg, format, script */
+ {"empty", NULL, NULL, NULL, NULL, -1, -1, NULL, NULL, NULL, NULL},
+ /* { "rule1", "notify-send", NULL, NULL, NULL, -1, -1, NULL, NULL, "%s %b", NULL }, */
+ /* { "rule2", "Pidgin", "*says*, NULL, NULL, -1, CRITICAL, NULL, NULL, NULL, NULL }, */
+ /* { "rule3", "Pidgin", "*signed on*", NULL, NULL, -1, LOW, NULL, NULL, NULL, NULL }, */
+ /* { "rule4", "Pidgin", "*signed off*", NULL, NULL, -1, LOW, NULL, NULL, NULL, NULL }, */
+ /* { "rule5", NULL, "*foobar*", NULL, NULL, -1, -1, NULL, "#00FF00", NULL, NULL }, */
+};
View
353 dbus.c

Large diffs are not rendered by default.

Oops, something went wrong.
View
2 dbus.h
@@ -11,7 +11,7 @@ int initdbus(void);
void dbus_tear_down(int id);
/* void dbus_poll(int timeout); */
void notificationClosed(notification * n, int reason);
-void actionInvoked(notification *n, const char *identifier);
+void actionInvoked(notification * n, const char *identifier);
#endif
View
81 dunst.c
@@ -37,7 +37,6 @@
#include "option_parser.h"
#include "settings.h"
-
#define LENGTH(X) (sizeof X / sizeof X[0])
#ifndef VERSION
@@ -54,9 +53,6 @@ typedef struct _x11_source {
Window w;
} x11_source_t;
-
-
-
/* index of colors fit to urgency level */
bool pause_display = false;
@@ -65,37 +61,22 @@ bool timer_active = false;
bool force_redraw = false;
-
/* notification lists */
-GQueue *queue = NULL; /* all new notifications get into here */
-GQueue *displayed = NULL; /* currently displayed notifications */
-GQueue *history = NULL; /* history of displayed notifications */
+GQueue *queue = NULL; /* all new notifications get into here */
+GQueue *displayed = NULL; /* currently displayed notifications */
+GQueue *history = NULL; /* history of displayed notifications */
GSList *rules = NULL;
-
-
-
/* misc funtions */
-
-
-
-
-
-
-
-
-
-
-
-
void check_timeouts(void)
{
/* nothing to do */
if (displayed->length == 0)
return;
- for (GList *iter = g_queue_peek_head_link(displayed); iter; iter = iter->next) {
+ for (GList * iter = g_queue_peek_head_link(displayed); iter;
+ iter = iter->next) {
notification *n = iter->data;
/* don't timeout when user is idle */
@@ -128,7 +109,8 @@ void update_lists()
if (pause_display) {
while (displayed->length > 0) {
- g_queue_insert_sorted(queue, g_queue_pop_head(queue), notification_cmp_data, NULL);
+ g_queue_insert_sorted(queue, g_queue_pop_head(queue),
+ notification_cmp_data, NULL);
}
return;
}
@@ -143,7 +125,6 @@ void update_lists()
limit = xctx.geometry.h;
}
-
/* move notifications from queue to displayed */
while (queue->length > 0) {
@@ -163,11 +144,11 @@ void update_lists()
notification_run_script(n);
}
- g_queue_insert_sorted(displayed, n, notification_cmp_data, NULL);
+ g_queue_insert_sorted(displayed, n, notification_cmp_data,
+ NULL);
}
}
-
void move_all_to_history()
{
while (displayed->length > 0) {
@@ -205,7 +186,7 @@ void update(void)
/* move messages from notification_queue to displayed_notifications */
update_lists();
- if (displayed->length > 0 && ! xctx.visible) {
+ if (displayed->length > 0 && !xctx.visible) {
x_win_show();
}
if (displayed->length == 0 && xctx.visible) {
@@ -248,18 +229,13 @@ gboolean run(void *data)
return true;
}
-
-
-
-
int main(int argc, char *argv[])
{
history = g_queue_new();
displayed = g_queue_new();
queue = g_queue_new();
-
cmdline_load(argc, argv);
if (cmdline_get_bool("-v/-version", false, "Print version")
@@ -282,11 +258,11 @@ int main(int argc, char *argv[])
x_setup();
- signal (SIGUSR1, pause_signal_handler);
- signal (SIGUSR2, pause_signal_handler);
+ signal(SIGUSR1, pause_signal_handler);
+ signal(SIGUSR2, pause_signal_handler);
if (settings.startup_notification) {
- notification *n = malloc(sizeof (notification));
+ notification *n = malloc(sizeof(notification));
n->appname = "dunst";
n->summary = "startup";
n->body = "dunst is up and running";
@@ -305,29 +281,31 @@ int main(int argc, char *argv[])
mainloop = g_main_loop_new(NULL, FALSE);
- GPollFD dpy_pollfd = {xctx.dc->dpy->fd,
- G_IO_IN | G_IO_HUP | G_IO_ERR, 0 };
+ GPollFD dpy_pollfd = { xctx.dc->dpy->fd,
+ G_IO_IN | G_IO_HUP | G_IO_ERR, 0
+ };
GSourceFuncs x11_source_funcs = {
x_mainloop_fd_prepare,
x_mainloop_fd_check,
x_mainloop_fd_dispatch,
NULL,
NULL,
- NULL };
+ NULL
+ };
GSource *x11_source =
- g_source_new(&x11_source_funcs, sizeof(x11_source_t));
- ((x11_source_t*)x11_source)->dpy = xctx.dc->dpy;
- ((x11_source_t*)x11_source)->w = xctx.win;
- g_source_add_poll(x11_source, &dpy_pollfd);
+ g_source_new(&x11_source_funcs, sizeof(x11_source_t));
+ ((x11_source_t *) x11_source)->dpy = xctx.dc->dpy;
+ ((x11_source_t *) x11_source)->w = xctx.win;
+ g_source_add_poll(x11_source, &dpy_pollfd);
- g_source_attach(x11_source, NULL);
+ g_source_attach(x11_source, NULL);
- run(NULL);
- g_main_loop_run(mainloop);
+ run(NULL);
+ g_main_loop_run(mainloop);
- dbus_tear_down(owner_id);
+ dbus_tear_down(owner_id);
return 0;
}
@@ -341,7 +319,7 @@ void pause_signal_handler(int sig)
pause_display = false;
}
- signal (sig, pause_signal_handler);
+ signal(sig, pause_signal_handler);
}
void usage(int exit_status)
@@ -355,8 +333,9 @@ void usage(int exit_status)
void print_version(void)
{
- printf("Dunst - A customizable and lightweight notification-daemon %s\n",
- VERSION);
+ printf
+ ("Dunst - A customizable and lightweight notification-daemon %s\n",
+ VERSION);
exit(EXIT_SUCCESS);
}
View
@@ -11,7 +11,6 @@
#define PERR(msg, errnum) printf("(%d) %s : %s\n", __LINE__, (msg), (strerror(errnum)))
#define LENGTH(X) (sizeof X / sizeof X[0])
-
#define ColLast 2
#define ColFG 1
#define ColBG 0
@@ -20,7 +19,6 @@ enum alignment { left, center, right };
enum separator_color { FOREGROUND, AUTO, FRAME, CUSTOM };
enum follow_mode { FOLLOW_NONE, FOLLOW_MOUSE, FOLLOW_KEYBOARD };
-
extern int verbosity;
extern GQueue *queue;
extern GQueue *displayed;
@@ -30,8 +28,6 @@ extern bool pause_display;
extern const char *color_strings[2][3];
extern DC *dc;
-
-
/* return id of notification */
gboolean run(void *data);
void wake_up(void);
Oops, something went wrong.

0 comments on commit e82da9d

Please sign in to comment.