Add to git.
[monolith.git] / src / ml_form_input.c
1 /* Monolith form input class.
2  * - by Richard W.M. Jones <rich@annexia.org>
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Library General Public
6  * License as published by the Free Software Foundation; either
7  * version 2 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12  * Library General Public License for more details.
13  *
14  * You should have received a copy of the GNU Library General Public
15  * License along with this library; if not, write to the Free
16  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
17  *
18  * $Id: ml_form_input.c,v 1.3 2002/08/30 14:28:47 rich Exp $
19  */
20
21 #include "config.h"
22
23 #include "monolith.h"
24 #include "ml_widget.h"
25 #include "ml_form_input.h"
26
27 /* This is what generic form input objects *actually* look like inside. */
28 struct form_input
29 {
30   struct ml_widget_operations *ops;
31   struct ml_form_input_operations *fops;
32 };
33
34 void
35 ml_form_input_set_value (void *vw, const char *value)
36 {
37   struct form_input *w = (struct form_input *) vw;
38
39   w->fops->set_value (vw, value);
40 }
41
42 const char *
43 ml_form_input_get_value (void *vw)
44 {
45   struct form_input *w = (struct form_input *) vw;
46
47   return w->fops->get_value (vw);
48 }
49
50 void
51 ml_form_input_clear_value (void *vw)
52 {
53   struct form_input *w = (struct form_input *) vw;
54
55   w->fops->clear_value (vw);
56 }