]> git.mdlowis.com Git - proto/labwc.git/commitdiff
src/keybind.c: move keybind_print() to dbg.c
authorJohan Malm <jgm323@gmail.com>
Thu, 18 Jun 2020 19:39:55 +0000 (20:39 +0100)
committerJohan Malm <jgm323@gmail.com>
Thu, 18 Jun 2020 19:39:55 +0000 (20:39 +0100)
include/labwc.h
src/config/keybind.c
src/config/rcxml.c
src/debug/dbg.c
src/output.c
src/theme/theme.c

index 8011cdd9a41ca1cc479ae293c400b70f8dcc757d..f8202fcc86a3b922e4a229ae73d25a8cb3d18481 100644 (file)
@@ -182,5 +182,6 @@ void action(struct server *server, struct keybind *keybind);
 
 void dbg_show_one_view(struct view *view);
 void dbg_show_views(struct server *server);
+void dbg_show_keybinds();
 
 #endif /* LABWC_H */
index e6764daec58ec639df76d0c8a4f9ea363aa084de..81f53c01264e997767492de86dd15d014c823ffa 100644 (file)
@@ -60,13 +60,3 @@ void keybind_init()
        keybind_add(&rc.keybinds, "A-Tab", "NextWindow");
        keybind_add(&rc.keybinds, "A-F3", "Execute");
 }
-
-void keybind_print()
-{
-       struct keybind *keybind;
-       wl_list_for_each_reverse (keybind, &rc.keybinds, link) {
-               printf("KEY=%s-", keybind->action);
-               for (size_t i = 0; i < keybind->keysyms_len; i++)
-                       printf("    %d\n", keybind->keysyms[i]);
-       }
-}
index 27417869e08a16aa65e5e0c0101347eabc7a6616..3efb15e7bc740699685dcac188a05417d6f45585 100644 (file)
@@ -168,7 +168,6 @@ void rcxml_init()
        LIBXML_TEST_VERSION
        wl_list_init(&rc.keybinds);
        keybind_init();
-       keybind_print();
 }
 
 void rcxml_read(const char *filename)
@@ -176,7 +175,6 @@ void rcxml_read(const char *filename)
        FILE *stream;
        char *line = NULL;
        size_t len = 0;
-       ssize_t n_read;
        struct buf b;
 
        /* Read <filename> into buffer and then call rcxml_parse_xml() */
@@ -186,7 +184,7 @@ void rcxml_read(const char *filename)
                return;
        }
        buf_init(&b);
-       while ((n_read = getline(&line, &len, stream) != -1)) {
+       while (getline(&line, &len, stream) != -1) {
                char *p = strrchr(line, '\n');
                if (p)
                        *p = '\0';
index 86a65cea1b75c214f52e4b531a3c46a35b52d50c..0da3ffd977af99130ba9232e2c9f5f8b92bda594 100644 (file)
@@ -1,4 +1,5 @@
 #include "labwc.h"
+#include "rcxml.h"
 
 static void show_one_xdg_view(struct view *view)
 {
@@ -72,3 +73,13 @@ void dbg_show_views(struct server *server)
        wl_list_for_each_reverse (view, &server->views, link)
                dbg_show_one_view(view);
 }
+
+void dbg_show_keybinds()
+{
+       struct keybind *keybind;
+       wl_list_for_each_reverse (keybind, &rc.keybinds, link) {
+               printf("KEY=%s-", keybind->action);
+               for (size_t i = 0; i < keybind->keysyms_len; i++)
+                       printf("    %d\n", keybind->keysyms[i]);
+       }
+}
index dd62bc4ea43238bfddeb432fa78a243349f81dc6..a668b8f7980573de33e4c36468bad704e853abc6 100644 (file)
@@ -51,7 +51,6 @@ static void render_decorations(struct wlr_output *output, struct view *view)
        draw_rect(&ddata, deco_box(view, LAB_DECO_PART_BOTTOM));
        draw_rect(&ddata, deco_box(view, LAB_DECO_PART_LEFT));
 
-
        if (view_hasfocus(view))
                ddata.rgba = theme.window_active_title_bg_color;
        else
index f9951e85b12fe8fa049a5624b9f8caeb21016449..8a44cf4fbf88b0b7074b4e74be18e6eb8bbc293b 100644 (file)
@@ -85,14 +85,13 @@ void theme_read(const char *filename)
        FILE *stream;
        char *line = NULL;
        size_t len = 0;
-       ssize_t n_read;
 
        stream = fopen(filename, "r");
        if (!stream) {
                fprintf(stderr, "warn: cannot read '%s'\n", filename);
                return;
        }
-       while ((n_read = getline(&line, &len, stream) != -1)) {
+       while (getline(&line, &len, stream) != -1) {
                char *p = strrchr(line, '\n');
                if (p)
                        *p = '\0';