libroot/posix/stdio: Remove unused portions.
[haiku.git] / src / apps / icon-o-matic / MainWindow.h
blob432dd1eea70870fba70381f7b5becc7a5450f669
1 /*
2 * Copyright 2006-2010, Stephan Aßmus <superstippi@gmx.de>.
3 * All rights reserved. Distributed under the terms of the MIT License.
4 */
5 #ifndef MAIN_WINDOW_H
6 #define MAIN_WINDOW_H
9 #include <Entry.h>
10 #include <Window.h>
12 #include "IconBuild.h"
13 #include "Observer.h"
16 class BMenu;
17 class BMenuBar;
18 class BMenuItem;
19 class CanvasView;
20 class CurrentColor;
21 class Document;
22 class DocumentSaver;
23 class IconObjectListView;
24 class IconEditorApp;
25 class IconView;
26 class PathListView;
27 class ShapeListView;
28 class StyleListView;
29 class StyleView;
30 class SwatchGroup;
31 class TransformerListView;
33 _BEGIN_ICON_NAMESPACE
34 class Icon;
35 _END_ICON_NAMESPACE
37 _USING_ICON_NAMESPACE
40 class MultipleManipulatorState;
42 enum {
43 MSG_OPEN = 'open',
44 MSG_APPEND = 'apnd',
45 MSG_SAVE = 'save',
46 MSG_EXPORT = 'xprt',
50 class MainWindow : public BWindow, public Observer {
51 public:
52 MainWindow(BRect frame, IconEditorApp* app,
53 const BMessage* settings);
54 virtual ~MainWindow();
56 // BWindow interface
57 virtual void MessageReceived(BMessage* message);
58 virtual bool QuitRequested();
59 virtual void WorkspaceActivated(int32 workspace,
60 bool active);
61 virtual void WorkspacesChanged(uint32 oldWorkspaces,
62 uint32 newWorkspaces);
64 // Observer interface
65 virtual void ObjectChanged(const Observable* object);
67 // MainWindow
68 void MakeEmpty();
69 void SetIcon(Icon* icon);
71 void Open(const entry_ref& ref,
72 bool append = false);
73 void Open(const BMessenger& externalObserver,
74 const uint8* data, size_t size);
76 void StoreSettings(BMessage* archive);
77 void RestoreSettings(const BMessage* archive);
79 private:
80 void _Init();
81 void _CreateGUI();
82 BMenuBar* _CreateMenuBar();
84 void _ImproveScrollBarLayout(BView* target);
86 bool _CheckSaveIcon(const BMessage* currentMessage);
87 void _PickUpActionBeforeSave();
89 void _MakeIconEmpty();
90 DocumentSaver* _CreateSaver(const entry_ref& ref,
91 uint32 exportMode);
93 const char* _FileName(bool preferExporter) const;
94 void _UpdateWindowTitle();
96 private:
97 IconEditorApp* fApp;
98 Document* fDocument;
99 CurrentColor* fCurrentColor;
100 Icon* fIcon;
102 BMessage* fMessageAfterSave;
104 BMenu* fPathMenu;
105 BMenu* fStyleMenu;
106 BMenu* fShapeMenu;
107 BMenu* fTransformerMenu;
108 BMenu* fPropertyMenu;
109 BMenu* fSwatchMenu;
111 BMenuItem* fUndoMI;
112 BMenuItem* fRedoMI;
113 BMenuItem* fMouseFilterOffMI;
114 BMenuItem* fMouseFilter64MI;
115 BMenuItem* fMouseFilter32MI;
116 BMenuItem* fMouseFilter16MI;
118 CanvasView* fCanvasView;
119 SwatchGroup* fSwatchGroup;
120 StyleView* fStyleView;
122 IconView* fIconPreview16Folder;
123 IconView* fIconPreview16Menu;
124 IconView* fIconPreview32Folder;
125 IconView* fIconPreview32Desktop;
126 IconView* fIconPreview48;
127 IconView* fIconPreview64;
129 PathListView* fPathListView;
130 StyleListView* fStyleListView;
132 ShapeListView* fShapeListView;
133 TransformerListView* fTransformerListView;
134 IconObjectListView* fPropertyListView;
136 // TODO: for testing only...
137 MultipleManipulatorState* fState;
141 #endif // MAIN_WINDOW_H