From ac4bd2aa80938289e087fcd354d0ef0426a8f4da Mon Sep 17 00:00:00 2001 From: jp9000 Date: Wed, 20 Jul 2016 08:09:45 -0700 Subject: [PATCH] libobs: Add long description to properties Allows setting a "long" description for detailed explanation of certain properties that may need them, but don't want to display them on the user interface by default. --- libobs/obs-properties.c | 11 +++++++++++ libobs/obs-properties.h | 3 +++ 2 files changed, 14 insertions(+) diff --git a/libobs/obs-properties.c b/libobs/obs-properties.c index f8ea0521f..1c01017d8 100644 --- a/libobs/obs-properties.c +++ b/libobs/obs-properties.c @@ -145,6 +145,7 @@ struct obs_properties; struct obs_property { const char *name; const char *desc; + const char *long_desc; enum obs_property_type type; bool visible; bool enabled; @@ -605,6 +606,11 @@ void obs_property_set_description(obs_property_t *p, const char *description) if (p) p->desc = description; } +void obs_property_set_long_description(obs_property_t *p, const char *long_desc) +{ + if (p) p->long_desc = long_desc; +} + const char *obs_property_name(obs_property_t *p) { return p ? p->name : NULL; @@ -615,6 +621,11 @@ const char *obs_property_description(obs_property_t *p) return p ? p->desc : NULL; } +const char *obs_property_long_description(obs_property_t *p) +{ + return p ? p->long_desc : NULL; +} + enum obs_property_type obs_property_get_type(obs_property_t *p) { return p ? p->type : OBS_PROPERTY_INVALID; diff --git a/libobs/obs-properties.h b/libobs/obs-properties.h index 9e44483cf..c3b744606 100644 --- a/libobs/obs-properties.h +++ b/libobs/obs-properties.h @@ -235,9 +235,12 @@ EXPORT void obs_property_set_enabled(obs_property_t *p, bool enabled); EXPORT void obs_property_set_description(obs_property_t *p, const char *description); +EXPORT void obs_property_set_long_description(obs_property_t *p, + const char *long_description); EXPORT const char * obs_property_name(obs_property_t *p); EXPORT const char * obs_property_description(obs_property_t *p); +EXPORT const char * obs_property_long_description(obs_property_t *p); EXPORT enum obs_property_type obs_property_get_type(obs_property_t *p); EXPORT bool obs_property_enabled(obs_property_t *p); EXPORT bool obs_property_visible(obs_property_t *p);