aboutsummaryrefslogtreecommitdiffstats
path: root/src/output.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/output.zig')
-rw-r--r--src/output.zig73
1 files changed, 0 insertions, 73 deletions
diff --git a/src/output.zig b/src/output.zig
index df219d2..b5c6885 100644
--- a/src/output.zig
+++ b/src/output.zig
@@ -2,7 +2,6 @@ const c = @import("c.zig");
const std = @import("std");
const cfg = @import("config.zig");
const gl = @import("gl.zig");
-const yaml = @import("yaml.zig");
pub const Output = struct {
update_fn: *const fn (output: *Output, texture_id: c.GLuint) bool,
@@ -35,38 +34,6 @@ pub const TSVOutput = struct {
pub const default: Config = .{
.name = "glsl-view",
};
-
- pub fn parse(parser: *c.yaml_parser_t, allocator: std.mem.Allocator) !Config {
- var self: Config = .default;
-
- while (true) {
- var event: c.yaml_event_t = undefined;
- if (c.yaml_parser_parse(parser, &event) != 1)
- return error.YAMLParserError;
- defer c.yaml_event_delete(&event);
-
- switch (event.type) {
- c.YAML_MAPPING_END_EVENT => break,
- c.YAML_SCALAR_EVENT => {
- const data = event.data.scalar;
- const key: []const u8 = data.value[0..data.length];
-
- if (std.mem.eql(u8, key, "name")) {
- self.name = try yaml.parseStringZ(parser, allocator);
- } else {
- std.debug.print("unknown key: '{s}'\n", .{key});
- try yaml.skipAny(parser);
- }
- },
- else => {
- std.debug.print("unexpected event: {}\n", .{event.type});
- return error.InvalidConfiguration;
- },
- }
- }
-
- return self;
- }
};
output: Output,
@@ -154,46 +121,6 @@ pub const WindowOutput = struct {
.monitor = "",
.fullscreen = false,
};
-
- pub fn parse(parser: *c.yaml_parser_t, allocator: std.mem.Allocator) !Config {
- var self: Config = .default;
-
- while (true) {
- var event: c.yaml_event_t = undefined;
- if (c.yaml_parser_parse(parser, &event) != 1)
- return error.YAMLParserError;
- defer c.yaml_event_delete(&event);
-
- switch (event.type) {
- c.YAML_MAPPING_END_EVENT => break,
- c.YAML_SCALAR_EVENT => {
- const data = event.data.scalar;
- const key: []const u8 = data.value[0..data.length];
-
- if (std.mem.eql(u8, key, "width")) {
- self.width = try yaml.parseInt(parser, i32);
- } else if (std.mem.eql(u8, key, "height")) {
- self.height = try yaml.parseInt(parser, i32);
- } else if (std.mem.eql(u8, key, "filter")) {
- self.filter = try yaml.parseEnum(parser, FilterMode);
- } else if (std.mem.eql(u8, key, "monitor")) {
- self.monitor = try yaml.parseString(parser, allocator);
- } else if (std.mem.eql(u8, key, "fullscreen")) {
- self.fullscreen = try yaml.parseBool(parser);
- } else {
- std.debug.print("unknown key: '{s}'\n", .{key});
- try yaml.skipAny(parser);
- }
- },
- else => {
- std.debug.print("unexpected event: {}\n", .{event.type});
- return error.InvalidConfiguration;
- },
- }
- }
-
- return self;
- }
};
output: Output,