Clean up options/config file parsing

* Pass a options_t, not session_t
* Slightly improve error handling when setting vsync method via dbus

The goal here is to limit the scope of what a given function can access.
And session_t contains basically everything, so don't pass it around.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
This commit is contained in:
Yuxuan Shui
2018-12-21 16:25:28 +00:00
parent ee2be09958
commit cb7d852b0f
12 changed files with 729 additions and 609 deletions

View File

@ -2,9 +2,15 @@
// Copyright (c) Yuxuan Shui <yshuiv7@gmail.com>
#pragma once
/// Parse command line options
#include <stdbool.h>
#include <xcb/render.h> // for xcb_render_fixed_t
#include "compiler.h"
#include "config.h"
#include "types.h"
#include "win.h" // for wintype_t
typedef struct session session_t;
@ -15,5 +21,15 @@ bool get_early_config(int argc, char *const *argv, char **config_file, bool *all
/**
* Process arguments and configuration files.
*
* Parameters:
* shadow_enable = Carry overs from parse_config
* fading_enable
* conv_kern_hasneg
* winopt_mask
*/
void get_cfg(session_t *ps, int argc, char *const *argv);
void get_cfg(options_t *opt, int argc, char *const *argv, bool shadow_enable,
bool fading_enable, bool conv_kern_hasneg,
win_option_mask_t *winopt_mask);
// vim: set noet sw=8 ts=8: