BDeskbar & Deskbar: export window bool settings to BDeskbar

Add methods to get and set "Always on top", "Auto raise", and "auto hide"
which are all booleans which control aspects of the Deskbar window to
BDeskbar.

Set the bool to the default value initially. Check if sending the
message succeeds, if so check the reply which also fills out the bool.
Don't check to see if reply succeeded because the bool will only be
overwritten if it did.

Follow the BDeskbar convention Is...() for getter, Set...() for setter
e.g IsAlwaysOnTop() is the getter, SetAlwaysOnTop() is the setter.

Define new message constants to call the newly created methods.
Follow BDeskbar convention: 'gtla' is used for getter, 'stla' for setter.
g/s for getter/setter, tla is an all-lowercase code unique to each
getter/setter pair.

Copy/paste these message constants into BarApp.h unchanged. Replace four
letter codes with imported message constants in BarApp.cpp and
BarWindow.cpp. Much nicer than using bare codes.

The new BDeskbar methods are all handled by TBarApp. The getters send
back a reply message containing the bool while the setters fall through
to existing setter cases.
This commit is contained in:
John Scipione
2017-11-27 11:05:22 -08:00
parent f8811591e1
commit fc23c09758
5 changed files with 159 additions and 27 deletions
+9
View File
@@ -41,6 +41,15 @@ public:
bool IsExpanded() const;
status_t Expand(bool expand);
bool IsAlwaysOnTop() const;
status_t SetAlwaysOnTop(bool alwaysOnTop);
bool IsAutoRaise() const;
status_t SetAutoRaise(bool autoRaise);
bool IsAutoHide() const;
status_t SetAutoHide(bool autoHide);
// Item querying methods
status_t GetItemInfo(int32 id, const char** _name) const;
status_t GetItemInfo(const char* name, int32* _id) const;