2 * Copyright 2006-2011, Stephan Aßmus <superstippi@gmx.de>.
3 * All rights reserved. Distributed under the terms of the MIT License.
14 MSG_SHOW_BORDER
= 'shbr',
15 MSG_HIDE_BORDER
= 'hdbr',
17 MSG_TOGGLE_AUTORAISE
= 'tgar',
18 MSG_SHOW_ON_ALL_WORKSPACES
= 'awrk',
20 MSG_SET_DESCRIPTION
= 'dscr',
22 MSG_ADD_WINDOW
= 'addw',
23 MSG_SETTINGS_CHANGED
= 'stch',
27 class MainWindow
: public BWindow
{
29 MainWindow(const char* name
, BRect frame
,
30 bool addDefaultButtons
= false);
31 MainWindow(const char* name
, BRect frame
,
33 virtual ~MainWindow();
36 virtual bool QuitRequested();
37 virtual void MessageReceived(BMessage
* message
);
40 virtual void ScreenChanged(BRect frame
, color_space format
);
41 virtual void WorkspaceActivated(int32 workspace
, bool active
);
42 virtual void FrameMoved(BPoint origin
);
43 virtual void FrameResized(float width
, float height
);
46 void ToggleAutoRaise();
47 bool AutoRaise() const
48 { return fAutoRaise
; }
49 bool ShowOnAllWorkspaces() const
50 { return fShowOnAllWorkspaces
; }
52 BPoint
ScreenPosition() const
53 { return fScreenPosition
; }
55 bool LoadSettings(const BMessage
* message
);
56 void SaveSettings(BMessage
* message
);
57 BMessage
* Settings() const
62 void _AdjustLocation(BRect frame
);
63 void _AddDefaultButtons();
64 void _AddEmptyButtons();
66 void _NotifySettingsChanged();
73 BPoint fScreenPosition
;
74 // not really the position, 0...1 = left...right
77 bool fShowOnAllWorkspaces
;
80 #endif // MAIN_WINDOW_H