aboutsummaryrefslogtreecommitdiff
path: root/include/swaynag
diff options
context:
space:
mode:
Diffstat (limited to 'include/swaynag')
-rw-r--r--include/swaynag/nagbar.h20
-rw-r--r--include/swaynag/types.h25
2 files changed, 29 insertions, 16 deletions
diff --git a/include/swaynag/nagbar.h b/include/swaynag/nagbar.h
index 8b55e4fa..b5d9b2cb 100644
--- a/include/swaynag/nagbar.h
+++ b/include/swaynag/nagbar.h
@@ -1,8 +1,9 @@
#ifndef _SWAY_NAGBAR_NAGBAR_H
-#define _SWAY_NAGBAR_NAGNAR_H
+#define _SWAY_NAGBAR_NAGBAR_H
#include <stdint.h>
#include "list.h"
#include "pool-buffer.h"
+#include "swaynag/types.h"
#include "xdg-output-unstable-v1-client-protocol.h"
#define NAGBAR_BAR_BORDER_THICKNESS 2
@@ -16,25 +17,12 @@
#define NAGBAR_MAX_HEIGHT 500
-enum sway_nagbar_type {
- NAGBAR_ERROR,
- NAGBAR_WARNING,
-};
-
enum sway_nagbar_action_type {
NAGBAR_ACTION_DISMISS,
NAGBAR_ACTION_EXPAND,
NAGBAR_ACTION_COMMAND,
};
-struct sway_nagbar_colors {
- uint32_t button_background;
- uint32_t background;
- uint32_t text;
- uint32_t border;
- uint32_t border_bottom;
-};
-
struct sway_nagbar_pointer {
struct wl_pointer *pointer;
struct wl_cursor_theme *cursor_theme;
@@ -72,6 +60,7 @@ struct sway_nagbar_details {
int offset;
int visible_lines;
int total_lines;
+ struct sway_nagbar_button button_details;
struct sway_nagbar_button button_up;
struct sway_nagbar_button button_down;
};
@@ -97,8 +86,7 @@ struct sway_nagbar {
struct pool_buffer buffers[2];
struct pool_buffer *current_buffer;
- enum sway_nagbar_type type;
- struct sway_nagbar_colors colors;
+ struct sway_nagbar_type *type;
uint32_t anchors;
char *message;
char *font;
diff --git a/include/swaynag/types.h b/include/swaynag/types.h
new file mode 100644
index 00000000..32056514
--- /dev/null
+++ b/include/swaynag/types.h
@@ -0,0 +1,25 @@
+#ifndef _SWAY_NAGBAR_TYPES_H
+#define _SWAY_NAGBAR_TYPES_H
+
+struct sway_nagbar_type {
+ char *name;
+ uint32_t button_background;
+ uint32_t background;
+ uint32_t text;
+ uint32_t border;
+ uint32_t border_bottom;
+};
+
+void nagbar_types_add_default(list_t *types);
+
+struct sway_nagbar_type *nagbar_type_get(list_t *types, char *name);
+
+struct sway_nagbar_type *nagbar_type_clone(struct sway_nagbar_type *type);
+
+void nagbar_type_free(struct sway_nagbar_type *type);
+
+void nagbar_types_free(list_t *types);
+
+int nagbar_parse_type(int argc, char **argv, struct sway_nagbar_type *type);
+
+#endif