-
Notifications
You must be signed in to change notification settings - Fork 12
/
mode.h
43 lines (28 loc) · 774 Bytes
/
mode.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#ifndef MODE_H
#define MODE_H
#include <stdbool.h>
#include <stdint.h>
#include "cfg.h"
#include "list.h"
struct Mode {
struct Head *head;
struct zwlr_output_mode_v1 *zwlr_mode;
int32_t width;
int32_t height;
int32_t refresh_mhz;
bool preferred;
};
struct ModesResRefresh {
int32_t width;
int32_t height;
int32_t refresh_hz;
struct SList *modes;
};
int32_t mhz_to_hz(int32_t mhz);
double mode_dpi(struct Mode *mode);
struct SList *modes_res_refresh(struct SList *modes);
bool mrr_satisfies_user_mode(struct ModesResRefresh *mrr, struct UserMode *user_mode);
void mode_free(void *mode);
void mode_res_refresh_free(void *mode);
struct Mode *mode_user_mode(struct SList *modes, struct SList *modes_failed, struct UserMode *user_mode);
#endif // MODE_H