]> git.lyx.org Git - lyx.git/blob - src/frontends/lyx_gui.h
enable Font cache only for MacOSX and inline width() for other platform.
[lyx.git] / src / frontends / lyx_gui.h
1 // -*- C++ -*-
2 /**
3  * \file lyx_gui.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author John Levon
8  *
9  * Full author contact details are available in file CREDITS.
10  */
11
12 #ifndef LYX_GUI_H
13 #define LYX_GUI_H
14
15
16 #include "FuncStatus.h"
17
18 #include <boost/function.hpp>
19
20 #include <string>
21 #include <vector>
22
23 class Dialogs;
24 class LColor_color;
25 class LyXFont;
26 class LyXComm;
27 class FuncRequest;
28 class LyXView;
29 namespace lyx {
30 struct RGBColor;
31 }
32
33 /// GUI interaction
34 namespace lyx_gui {
35
36 /// are we using the GUI at all
37 extern bool use_gui;
38
39 /**
40  * set up GUI parameters. At this point lyxrc may
41  * be used.
42  */
43 void parse_lyxrc();
44
45 /**
46  * Enter the main event loop (\sa LyX::exec2)
47  */
48 int exec(int & argc, char * argv[]);
49
50 /**
51  * Synchronise all pending events.
52  */
53 void sync_events();
54
55 /**
56  * return the status flag for a given action. This can be used to tell
57  * that a given lfun is not implemented by a frontend
58  */
59 FuncStatus getStatus(FuncRequest const & ev);
60
61 /**
62  * Given col, fills r, g, b in the range 0-255.
63  * The function returns true if successful.
64  * It returns false on failure and sets r, g, b to 0.
65  */
66 bool getRGBColor(LColor_color col, lyx::RGBColor & rgbcol);
67
68 /** Eg, passing LColor::black returns "000000",
69  *      passing LColor::white returns "ffffff".
70  */
71 std::string const hexname(LColor_color col);
72
73 /**
74  * update an altered GUI color
75  */
76 void update_color(LColor_color col);
77
78 /**
79  * add a callback for socket read notification
80  * @param fd socket descriptor (file/socket/etc)
81  */
82 void register_socket_callback(int fd, boost::function<void()> func);
83
84 /**
85  * remove a I/O read callback
86  * @param fd socket descriptor (file/socket/etc)
87  */
88 void unregister_socket_callback(int fd);
89
90 } // namespace lyx_gui
91
92 #endif // LYX_GUI_H