summaryrefslogtreecommitdiff
path: root/render/form.c
diff options
context:
space:
mode:
authorVincent Sanders <vince@kyllikki.org>2014-11-13 21:52:08 +0000
committerVincent Sanders <vince@kyllikki.org>2014-11-13 21:52:08 +0000
commit79e501075a0c301f435cf579518900e393be6fbf (patch)
tree2a75077894650e493c95d1062cc4945980985309 /render/form.c
parent9fde3502b659d3858cd1978d2c6535c57efbe924 (diff)
downloadnetsurf-79e501075a0c301f435cf579518900e393be6fbf.tar.gz
netsurf-79e501075a0c301f435cf579518900e393be6fbf.tar.bz2
make the form select menu API smaller.
By hiding all but the form selection menu option structure from code outside of render this reduces the API to the absolute minimum to support this feature.
Diffstat (limited to 'render/form.c')
-rw-r--r--render/form.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/render/form.c b/render/form.c
index 94cbcfcd3..7c90a5250 100644
--- a/render/form.c
+++ b/render/form.c
@@ -1332,6 +1332,26 @@ nserror form_select_process_selection(struct form_control *control, int item)
return form__select_process_selection(control->html, control, item);
}
+/* exported interface documented in render/form.h */
+struct form_option *
+form_select_get_option(struct form_control *control, int item)
+{
+ struct form_option *opt;
+
+ opt = control->data.select.items;
+ while ((opt != NULL) && (item > 0)) {
+ opt = opt->next;
+ item--;
+ }
+ return opt;
+}
+
+/* exported interface documented in render/form.h */
+char *form_control_get_name(struct form_control *control)
+{
+ return control->name;
+}
+
/**
* Handle a click on the area of the currently opened select menu.
*