]> git.lyx.org Git - lyx.git/blob - src/frontends/xforms/freebrowser.h
* Fix compilation with C89 compilers.
[lyx.git] / src / frontends / xforms / freebrowser.h
1 /**
2  * \file freebrowser.h
3  * This file is part of LyX, the document processor.
4  * Licence details can be found in the file COPYING.
5  *
6  * \author Angus Leeming
7  *
8  * Full author contact details are available in file CREDITS
9  *
10  * A freebrowser is a browser widget in its own form.
11  * It is used for example to instantiate the drop-down list beneath a
12  * combox.
13  */
14
15 #ifndef FL_FREEBROWSER_H
16 #define FL_FREEBROWSER_H
17
18 #if defined(__cplusplus)
19 extern "C"
20 {
21 #endif
22
23 typedef enum {
24     FL_FREEBROWSER_BELOW,
25     FL_FREEBROWSER_ABOVE
26 } FL_FREEBROWSER_POSITION;
27
28 typedef struct fl_freebrowser_ {
29     /** Use this and you'll be told when something happens.
30      *  \param == 0: the browser has merely been hidden.
31      *         == 1: a change has been made.
32      */
33     void (* callback) (struct fl_freebrowser_ *, int action);
34
35     /** Set this to 1 if you want to capture all KeyPress events
36      *  generating printable chars.
37      */
38     int want_printable;
39     /** Is set only if want_printable is true. */
40     char last_printable;
41
42     /** Details of the implementation. */
43     void * parent;
44     FL_FORM * form;
45     FL_OBJECT * browser;
46     Window save_window;
47 } FL_FREEBROWSER;
48
49
50 /** A function to create a freebrowser widget, "owned" by widget \param parent.
51  */
52 FL_EXPORT FL_FREEBROWSER * fl_create_freebrowser(void * parent);
53
54 FL_EXPORT void fl_free_freebrowser(FL_FREEBROWSER *);
55
56 /** \param abs_x, \param abs_y are the coordinates of the top left corner
57  *  of the browser relative to the top left hand corner of the _screen_.
58  *  \param w, \param h are the browser dimensions.
59  */
60 FL_EXPORT void fl_show_freebrowser(FL_FREEBROWSER *,
61                                    FL_Coord abs_x, FL_Coord abs_y,
62                                    FL_Coord w, FL_Coord h);
63
64 FL_EXPORT void fl_hide_freebrowser(FL_FREEBROWSER *);
65
66 /** Return the browser itself. */
67 FL_EXPORT FL_OBJECT * fl_get_freebrowser_browser(FL_FREEBROWSER *);
68
69 #if defined(__cplusplus)
70 }
71 #endif
72
73 #endif