-
Notifications
You must be signed in to change notification settings - Fork 47
/
ShaderClipboard.h
80 lines (60 loc) · 1.7 KB
/
ShaderClipboard.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
#pragma once
#include "imap.h"
#include "Texturable.h"
#include <sigc++/signal.h>
#include <sigc++/trackable.h>
namespace selection
{
class ShaderClipboard :
public sigc::trackable
{
private:
// The source and target Texturables
Texturable _source;
bool _updatesDisabled;
sigc::signal<void> _signalSourceChanged;
public:
ShaderClipboard();
/** greebo: Tries to find the best source Texturable object
* with the given SelectionTest (SelectionVolume)
*/
void setSource(SelectionTest& test);
/** greebo: Sets the source patch to the given <sourcePatch>
*/
void setSource(Patch& sourcePatch);
/** greebo: Sets the source face to the given <sourceFace>
*/
void setSource(Face& sourceFace);
/** greebo: Sets the source face to the given <shader>
*/
void setSource(std::string shader);
/** greebo: Retrieves the current source Texturable
*/
Texturable& getSource();
/**
* Is emitted when the shader source changes.
*/
sigc::signal<void> signal_sourceChanged() const;
/** greebo: Clears both the source and target texturables.
* Call this as soon as the objects might be deleted
* or the map is changed.
*/
void clear();
private:
// UndoSystem callbacks
void onUndoRedoOperation();
void onMapEvent(IMap::MapEvent ev);
/** greebo: Updates the shader information in the status bar.
*/
void updateStatusText();
/** greebo: Sets the media browser / texwindow focus to the
* new source shader.
*/
void updateMediaBrowsers();
/** greebo: Retrieves the best texturable object from the
* given SelectionTest.
*/
Texturable getTexturable(SelectionTest& test);
};
} // namespace selection
selection::ShaderClipboard& GlobalShaderClipboard();