summaryrefslogtreecommitdiffstats
path: root/options/m_option.h
diff options
context:
space:
mode:
authorKacper Michajłow <kasper93@gmail.com>2023-08-25 19:00:31 +0200
committerDudemanguy <random342@airmail.cc>2023-08-31 17:37:42 +0000
commit21048291bed43bbd790424ac458f2b09b618a85f (patch)
treebde73abb64576dc618b5dc74f9a9604069dce8bb /options/m_option.h
parent765b68f9714c776b0afe57a077194d2afb000d59 (diff)
downloadmpv-21048291bed43bbd790424ac458f2b09b618a85f.tar.bz2
mpv-21048291bed43bbd790424ac458f2b09b618a85f.tar.xz
m_option: add OPT_RECT
Parsed as WxH+X+Y to mp_rect. Allows also WxH without the offset.
Diffstat (limited to 'options/m_option.h')
-rw-r--r--options/m_option.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/options/m_option.h b/options/m_option.h
index c868487b3e..0683822988 100644
--- a/options/m_option.h
+++ b/options/m_option.h
@@ -25,6 +25,7 @@
#include "misc/bstr.h"
#include "audio/chmap.h"
+#include "common/common.h"
// m_option allows to parse, print and copy data of various types.
@@ -66,6 +67,7 @@ extern const m_option_type_t m_option_type_channels;
extern const m_option_type_t m_option_type_aspect;
extern const m_option_type_t m_option_type_obj_settings_list;
extern const m_option_type_t m_option_type_node;
+extern const m_option_type_t m_option_type_rect;
// Used internally by m_config.c
extern const m_option_type_t m_option_type_alias;
@@ -103,6 +105,7 @@ struct m_geometry {
void m_geometry_apply(int *xpos, int *ypos, int *widw, int *widh,
int scrw, int scrh, struct m_geometry *gm);
+void m_rect_apply(struct mp_rect *rc, int scrw, int scrh, struct m_geometry *gm);
struct m_channels {
bool set : 1;
@@ -654,6 +657,9 @@ extern const char m_option_path_separator;
#define OPT_SIZE_BOX(field) \
OPT_TYPED_FIELD(m_option_type_size_box, struct m_geometry, field)
+#define OPT_RECT(field) \
+ OPT_TYPED_FIELD(m_option_type_rect, struct m_geometry, field)
+
#define OPT_TRACKCHOICE(field) \
OPT_CHOICE(field, {"no", -2}, {"auto", -1}), \
M_RANGE(0, 8190)