]> git.lyx.org Git - lyx.git/blob - src/frontends/xforms/freebrowser.h
Tiny clean-ups.
[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 #include "lyx_forms.h"
19
20 #if defined(__cplusplus)
21 extern "C"
22 {
23 #endif
24
25 typedef enum {
26     FL_FREEBROWSER_BELOW,
27     FL_FREEBROWSER_ABOVE
28 } FL_FREEBROWSER_POSITION;
29
30 typedef struct fl_freebrowser_ {
31     /** Use this and you'll be told when something happens.
32      *  \param == 0: the browser has merely been hidden.
33      *         == 1: a change has been made.
34      */
35     void (* callback) (struct fl_freebrowser_ *, int action);
36
37     /** Set this to 1 if you want to capture all KeyPress events
38      *  generating printable chars.
39      */
40     int want_printable;
41     /** Is set only if want_printable is true. */
42     char last_printable;
43
44     /** The "owner" of the freebrowser. Not used by the struct. */
45     void * parent;
46     /** The browser itself. */
47     FL_OBJECT * browser;
48
49     /** Details of the implementation. */
50     FL_FORM * form;
51     Window save_window;
52 } FL_FREEBROWSER;
53
54
55 /** A function to create a freebrowser widget, "owned" by \c parent. */
56 FL_EXPORT FL_FREEBROWSER *
57 fl_create_freebrowser(void * parent);
58
59 /** Free all memory allocated to \param ptr and to its components. */
60 FL_EXPORT void
61 fl_free_freebrowser(FL_FREEBROWSER * ptr);
62
63 /** \c abs_x, \c abs_y are the coordinates of the top left corner
64  *  of the browser relative to the top left hand corner of the _screen_.
65  *  \c w, \c h are the browser dimensions.
66  */
67 FL_EXPORT void
68 fl_show_freebrowser(FL_FREEBROWSER *,
69                     FL_Coord abs_x, FL_Coord abs_y, FL_Coord w, FL_Coord h);
70
71 FL_EXPORT void
72 fl_hide_freebrowser(FL_FREEBROWSER *);
73
74 #if defined(__cplusplus)
75 }
76 #endif
77
78 #endif /* not FL_FREEBROWSER_H */