]> git.lyx.org Git - lyx.git/blob - src/frontends/controllers/ControlGraphics.C
Controller-view split of Graphics and Index popups.
[lyx.git] / src / frontends / controllers / ControlGraphics.C
1 /* This file is part of
2  * ====================================================== 
3  *
4  *           LyX, The Document Processor
5  *
6  *           Copyright 2001 The LyX Team.
7  *
8  * ======================================================
9  *
10  * \file ControlGraphics.C
11  * \author Angus Leeming <a.leeming@ic.ac.uk>
12  */
13
14 #include <config.h> 
15
16 #ifdef __GNUG__
17 #pragma implementation
18 #endif 
19
20 #include "ControlGraphics.h"
21 #include "buffer.h"
22 #include "Dialogs.h"
23 #include "lyxfunc.h"
24 #include "LyXView.h"
25
26 #include "insets/insetgraphics.h"
27
28 ControlGraphics::ControlGraphics(LyXView & lv, Dialogs & d)
29         : ControlInset<InsetGraphics, InsetGraphicsParams>(lv, d)
30 {
31         d_.showGraphics.connect(SigC::slot(this, &ControlGraphics::showInset));
32 }
33
34
35 LyXView * ControlGraphics::lv() const
36 {
37         return &lv_;
38 }
39
40
41 InsetGraphicsParams const ControlGraphics::getParams(string const &)
42 {
43         return InsetGraphicsParams();
44 }
45
46
47 InsetGraphicsParams const
48 ControlGraphics::getParams(InsetGraphics const & inset)
49 {
50         return inset.getParams();
51 }
52
53
54 void ControlGraphics::applyParamsToInset()
55 {
56         // Set the parameters in the inset, it also returns true if the new
57         // parameters are different from what was in the inset already.
58         bool changed = inset()->setParams(params());
59         // Tell LyX we've got a change, and mark the document dirty,
60         // if it changed.
61         lv_.view()->updateInset(inset(), changed);
62 }
63
64
65 void ControlGraphics::applyParamsNoInset()
66 {}