Просмотр исходного кода

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.
jp9000 9 лет назад
Родитель
Сommit
ac4bd2aa80
2 измененных файлов с 14 добавлено и 0 удалено
  1. 11 0
      libobs/obs-properties.c
  2. 3 0
      libobs/obs-properties.h

+ 11 - 0
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;

+ 3 - 0
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);