]> git.mdlowis.com Git - proto/labwc.git/commitdiff
Make append_actions() public
authortokyo4j <hrak1529@gmail.com>
Mon, 4 Aug 2025 03:54:29 +0000 (12:54 +0900)
committerJohan Malm <johanmalm@users.noreply.github.com>
Mon, 4 Aug 2025 20:41:14 +0000 (21:41 +0100)
Also rename it to append_parsed_actions()

include/config/rcxml.h
src/config/rcxml.c

index a96b662085bbc62072e06f70948c51efa6291a9b..65107440453f3a4e1279e598c23f7f3e91a7c9cf 100644 (file)
@@ -5,6 +5,7 @@
 #include <stdbool.h>
 #include <stdio.h>
 #include <wayland-server-core.h>
+#include <libxml/tree.h>
 
 #include "common/border.h"
 #include "common/buf.h"
@@ -196,4 +197,10 @@ void rcxml_parse_xml(struct buf *b);
 void rcxml_read(const char *filename);
 void rcxml_finish(void);
 
+/*
+ * Parse the child <action> nodes and append them to the list.
+ * FIXME: move this function to somewhere else.
+ */
+void append_parsed_actions(xmlNode *node, struct wl_list *list);
+
 #endif /* LABWC_RCXML_H */
index 928784912c22bf16fd45286b0a17b98a36420cda..b913f0c46059a387a41776d0fcd24eb89b1d1086 100644 (file)
@@ -253,8 +253,6 @@ set_property(const char *str, enum property *variable)
        *variable = ret ? LAB_PROP_TRUE : LAB_PROP_FALSE;
 }
 
-static void append_actions(xmlNode *node, struct wl_list *list);
-
 static void
 fill_window_rule(xmlNode *node)
 {
@@ -315,7 +313,7 @@ fill_window_rule(xmlNode *node)
                }
        }
 
-       append_actions(node, &window_rule->actions);
+       append_parsed_actions(node, &window_rule->actions);
 }
 
 static void
@@ -482,7 +480,7 @@ parse_action_args(xmlNode *node, struct action *action)
                                action_arg_add_actionlist(action, "then");
                                actions = action_get_actionlist(action, "then");
                        }
-                       append_actions(child, actions);
+                       append_parsed_actions(child, actions);
                } else if (!strcasecmp(key, "else")) {
                        struct wl_list *actions =
                                action_get_actionlist(action, "else");
@@ -490,7 +488,7 @@ parse_action_args(xmlNode *node, struct action *action)
                                action_arg_add_actionlist(action, "else");
                                actions = action_get_actionlist(action, "else");
                        }
-                       append_actions(child, actions);
+                       append_parsed_actions(child, actions);
                } else if (!strcasecmp(key, "none")) {
                        struct wl_list *actions =
                                action_get_actionlist(action, "none");
@@ -498,7 +496,7 @@ parse_action_args(xmlNode *node, struct action *action)
                                action_arg_add_actionlist(action, "none");
                                actions = action_get_actionlist(action, "none");
                        }
-                       append_actions(child, actions);
+                       append_parsed_actions(child, actions);
                } else if (!strcasecmp(key, "name")) {
                        /* Ignore <action name=""> */
                } else if (lab_xml_node_is_leaf(child)) {
@@ -530,8 +528,8 @@ parse_action(xmlNode *node)
        return action;
 }
 
-static void
-append_actions(xmlNode *node, struct wl_list *list)
+void
+append_parsed_actions(xmlNode *node, struct wl_list *list)
 {
        xmlNode *child;
        char *key, *content;
@@ -576,7 +574,7 @@ fill_keybind(xmlNode *node)
        lab_xml_get_bool(node, "layoutDependent", &keybind->use_syms_only);
        lab_xml_get_bool(node, "allowWhenLocked", &keybind->allow_when_locked);
 
-       append_actions(node, &keybind->actions);
+       append_parsed_actions(node, &keybind->actions);
 }
 
 static void
@@ -608,7 +606,7 @@ fill_mousebind(xmlNode *node, const char *context)
                mousebind->mouse_event = mousebind_event_from_str(buf);
        }
 
-       append_actions(node, &mousebind->actions);
+       append_parsed_actions(node, &mousebind->actions);
 }
 
 static void