summaryrefslogtreecommitdiff
path: root/src/config.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/config.h')
-rw-r--r--src/config.h69
1 files changed, 69 insertions, 0 deletions
diff --git a/src/config.h b/src/config.h
new file mode 100644
index 0000000..f8824ab
--- /dev/null
+++ b/src/config.h
@@ -0,0 +1,69 @@
+/* SPDX-License-Identifier: GPL-3.0-or-later */
+/*
+ * vfetch - neofetch but the ascii part is a video
+ *
+ * Copyright (C) 2026 Doan Luu Duc Tai
+ *
+ */
+
+#ifndef SRC__CONFIG_H
+#define SRC__CONFIG_H
+
+#include <glib.h>
+#include <stdbool.h>
+#include <stddef.h>
+#include <stdint.h>
+#include "error.h"
+
+typedef enum {
+ ARG_HANDLER_BOOLEAN,
+ ARG_HANDLER_CHAFA_MAP,
+ ARG_HANDLER_CHAFA_FLAG,
+ ARG_HANDLER_BOUNDED_FLOAT,
+ ARG_HANDLER_CUSTOM
+} ArgHandlerType;
+
+typedef struct VfetchArgs {
+ GHashTable *chafa_options;
+ gchar *filename;
+ gchar *colors_arg;
+ gchar *fetch_tool_arg;
+ gchar *fg_color_arg;
+ gchar *bg_color_arg;
+ gchar *format_arg;
+ double cell_aspect_ratio;
+ double fps;
+ uint32_t width;
+ uint32_t height;
+ uint32_t pad_x;
+ uint32_t pad_y;
+ uint32_t num_frames;
+ uint16_t refresh_rate;
+ bool audio;
+ bool loop;
+ bool debug;
+ bool verbose;
+} VfetchArgs;
+
+typedef struct BoundedFloatData {
+ size_t offset;
+ float min;
+ float max;
+} BoundedFloatData;
+
+typedef VfetchError (*CustomArgParserFunc)(int *idx,
+ int argc,
+ const char *argv[],
+ VfetchArgs *args);
+typedef struct ArgumentHandler {
+ union {
+ BoundedFloatData bounded_float;
+ CustomArgParserFunc custom_parser;
+ const char *chafa_key;
+ size_t boolean_offset;
+ } data;
+ const char *name;
+ ArgHandlerType type;
+} ArgumentHandler;
+
+#endif /* SRC__CONFIG_H */