* Implemented BDragger::{Show|Hide}AllDraggers() and its backend in the app_server.
This fixes bug #242. The value is currently stored in a separate file. * Removed some unused codes from ServerProtocol.h. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20188 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -67,18 +67,23 @@ class BDragger : public BView {
|
|||||||
|
|
||||||
virtual BBitmap* DragBitmap(BPoint* offset, drawing_mode *mode);
|
virtual BBitmap* DragBitmap(BPoint* offset, drawing_mode *mode);
|
||||||
|
|
||||||
|
class Private;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
bool IsVisibilityChanging() const;
|
bool IsVisibilityChanging() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
friend class BPrivate::ShelfContainerViewFilter;
|
friend class BPrivate::ShelfContainerViewFilter;
|
||||||
friend class BPrivate::replicant_data;
|
friend class BPrivate::replicant_data;
|
||||||
|
friend class Private;
|
||||||
friend class BShelf;
|
friend class BShelf;
|
||||||
|
|
||||||
virtual void _ReservedDragger2();
|
virtual void _ReservedDragger2();
|
||||||
virtual void _ReservedDragger3();
|
virtual void _ReservedDragger3();
|
||||||
virtual void _ReservedDragger4();
|
virtual void _ReservedDragger4();
|
||||||
|
|
||||||
|
static void _UpdateShowAllDraggers(bool visible);
|
||||||
|
|
||||||
BDragger& operator=(const BDragger& other);
|
BDragger& operator=(const BDragger& other);
|
||||||
|
|
||||||
void _AddToList();
|
void _AddToList();
|
||||||
|
|||||||
@@ -17,9 +17,9 @@
|
|||||||
// Server port names. The input port is the port which is used to receive
|
// Server port names. The input port is the port which is used to receive
|
||||||
// input messages from the Input Server. The other is the "main" port for
|
// input messages from the Input Server. The other is the "main" port for
|
||||||
// the server and is utilized mostly by BApplication objects.
|
// the server and is utilized mostly by BApplication objects.
|
||||||
#define SERVER_PORT_NAME "OBappserver"
|
#define SERVER_PORT_NAME "haiku app_server"
|
||||||
#if TEST_MODE
|
#if TEST_MODE
|
||||||
# define SERVER_INPUT_PORT "OBinputport"
|
# define SERVER_INPUT_PORT "haiku input port"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define AS_REQUEST_COLOR_KEY 0x00010000
|
#define AS_REQUEST_COLOR_KEY 0x00010000
|
||||||
@@ -29,8 +29,10 @@ enum {
|
|||||||
// NOTE: all defines have to start with "AS_" to let the "code_to_name"
|
// NOTE: all defines have to start with "AS_" to let the "code_to_name"
|
||||||
// utility work correctly
|
// utility work correctly
|
||||||
|
|
||||||
AS_REGISTER_INPUT_SERVER = 1,
|
|
||||||
AS_GET_DESKTOP,
|
AS_GET_DESKTOP,
|
||||||
|
AS_REGISTER_INPUT_SERVER = 1,
|
||||||
|
AS_EVENT_STREAM_CLOSED,
|
||||||
|
// Notification of event stream closing to restart input_server
|
||||||
|
|
||||||
// Desktop definitions (through the ServerApp, though)
|
// Desktop definitions (through the ServerApp, though)
|
||||||
AS_GET_WINDOW_LIST,
|
AS_GET_WINDOW_LIST,
|
||||||
@@ -93,7 +95,6 @@ enum {
|
|||||||
AS_SET_SIZE_LIMITS,
|
AS_SET_SIZE_LIMITS,
|
||||||
AS_ACTIVATE_WINDOW,
|
AS_ACTIVATE_WINDOW,
|
||||||
AS_IS_FRONT_WINDOW,
|
AS_IS_FRONT_WINDOW,
|
||||||
AS_UPDATE_IF_NEEDED,
|
|
||||||
|
|
||||||
// BPicture definitions
|
// BPicture definitions
|
||||||
AS_CREATE_PICTURE,
|
AS_CREATE_PICTURE,
|
||||||
@@ -176,14 +177,13 @@ enum {
|
|||||||
AS_GET_MENU_INFO,
|
AS_GET_MENU_INFO,
|
||||||
AS_SET_MENU_INFO,
|
AS_SET_MENU_INFO,
|
||||||
AS_IDLE_TIME,
|
AS_IDLE_TIME,
|
||||||
AS_SELECT_PRINTER_PANEL,
|
|
||||||
AS_ADD_PRINTER_PANEL,
|
|
||||||
AS_RUN_BE_ABOUT,
|
|
||||||
AS_SET_MOUSE_MODE,
|
AS_SET_MOUSE_MODE,
|
||||||
AS_GET_MOUSE_MODE,
|
AS_GET_MOUSE_MODE,
|
||||||
AS_GET_MOUSE,
|
AS_GET_MOUSE,
|
||||||
AS_SET_DECORATOR_SETTINGS,
|
AS_SET_DECORATOR_SETTINGS,
|
||||||
AS_GET_DECORATOR_SETTINGS,
|
AS_GET_DECORATOR_SETTINGS,
|
||||||
|
AS_GET_SHOW_ALL_DRAGGERS,
|
||||||
|
AS_SET_SHOW_ALL_DRAGGERS,
|
||||||
|
|
||||||
// Graphics calls
|
// Graphics calls
|
||||||
AS_SET_HIGH_COLOR,
|
AS_SET_HIGH_COLOR,
|
||||||
@@ -289,9 +289,6 @@ enum {
|
|||||||
AS_DIRECT_WINDOW_GET_SYNC_DATA,
|
AS_DIRECT_WINDOW_GET_SYNC_DATA,
|
||||||
AS_DIRECT_WINDOW_SET_FULLSCREEN,
|
AS_DIRECT_WINDOW_SET_FULLSCREEN,
|
||||||
|
|
||||||
// Notification of event stream closing to restart input_server
|
|
||||||
AS_EVENT_STREAM_CLOSED,
|
|
||||||
|
|
||||||
AS_LAST_CODE
|
AS_LAST_CODE
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,23 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2007, Haiku, Inc. All Rights Reserved.
|
||||||
|
* Distributed under the terms of the MIT License.
|
||||||
|
*/
|
||||||
|
#ifndef _DRAGGER_PRIVATE_H
|
||||||
|
#define _DRAGGER_PRIVATE_H
|
||||||
|
|
||||||
|
|
||||||
|
#include <Dragger.h>
|
||||||
|
|
||||||
|
|
||||||
|
class BDragger::Private {
|
||||||
|
public:
|
||||||
|
Private(BDragger* dragger) : fDragger(dragger) {}
|
||||||
|
|
||||||
|
static void UpdateShowAllDraggers(bool visible)
|
||||||
|
{ BDragger::_UpdateShowAllDraggers(visible); }
|
||||||
|
|
||||||
|
private:
|
||||||
|
BDragger* fDragger;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // _DRAGGER_PRIVATE_H
|
||||||
@@ -9,16 +9,20 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#include <new>
|
#include <AppMisc.h>
|
||||||
#include <stdio.h>
|
#include <AppServerLink.h>
|
||||||
#include <stdlib.h>
|
#include <DraggerPrivate.h>
|
||||||
#include <string.h>
|
#include <LooperList.h>
|
||||||
#include <unistd.h>
|
#include <MenuWindow.h>
|
||||||
|
#include <ObjectLocker.h>
|
||||||
|
#include <PortLink.h>
|
||||||
|
#include <RosterPrivate.h>
|
||||||
|
#include <ServerMemoryAllocator.h>
|
||||||
|
#include <ServerProtocol.h>
|
||||||
|
|
||||||
#include <Alert.h>
|
#include <Alert.h>
|
||||||
#include <AppFileInfo.h>
|
#include <AppFileInfo.h>
|
||||||
#include <Application.h>
|
#include <Application.h>
|
||||||
#include <AppMisc.h>
|
|
||||||
#include <MessageRunner.h>
|
#include <MessageRunner.h>
|
||||||
#include <Cursor.h>
|
#include <Cursor.h>
|
||||||
#include <Debug.h>
|
#include <Debug.h>
|
||||||
@@ -30,20 +34,16 @@
|
|||||||
#include <RegistrarDefs.h>
|
#include <RegistrarDefs.h>
|
||||||
#include <Resources.h>
|
#include <Resources.h>
|
||||||
#include <Roster.h>
|
#include <Roster.h>
|
||||||
#include <RosterPrivate.h>
|
|
||||||
#include <Window.h>
|
#include <Window.h>
|
||||||
|
|
||||||
#include <AppServerLink.h>
|
#include <new>
|
||||||
#include <LooperList.h>
|
#include <stdio.h>
|
||||||
#include <MenuWindow.h>
|
#include <stdlib.h>
|
||||||
#include <ObjectLocker.h>
|
#include <string.h>
|
||||||
#include <PortLink.h>
|
#include <unistd.h>
|
||||||
#include <ServerMemoryAllocator.h>
|
|
||||||
#include <ServerProtocol.h>
|
|
||||||
|
|
||||||
using namespace BPrivate;
|
using namespace BPrivate;
|
||||||
|
|
||||||
// Globals ---------------------------------------------------------------------
|
|
||||||
BApplication *be_app = NULL;
|
BApplication *be_app = NULL;
|
||||||
BMessenger be_app_messenger;
|
BMessenger be_app_messenger;
|
||||||
|
|
||||||
@@ -953,9 +953,11 @@ BApplication::DispatchMessage(BMessage *message, BHandler *handler)
|
|||||||
|
|
||||||
case _SHOW_DRAG_HANDLES_:
|
case _SHOW_DRAG_HANDLES_:
|
||||||
{
|
{
|
||||||
bool visible = false;
|
bool show;
|
||||||
message->FindBool("visible", &visible);
|
if (message->FindBool("show", &show) != B_OK)
|
||||||
// TODO: Call the registrar or whoever is responsible for this
|
break;
|
||||||
|
|
||||||
|
BDragger::Private::UpdateShowAllDraggers(show);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2001-2006, Haiku.
|
* Copyright 2001-2007, Haiku.
|
||||||
* Distributed under the terms of the MIT License.
|
* Distributed under the terms of the MIT License.
|
||||||
*
|
*
|
||||||
* Authors:
|
* Authors:
|
||||||
@@ -8,6 +8,9 @@
|
|||||||
|
|
||||||
//! BDragger represents a replicant "handle".
|
//! BDragger represents a replicant "handle".
|
||||||
|
|
||||||
|
|
||||||
|
#include <AppServerLink.h>
|
||||||
|
#include <ServerProtocol.h>
|
||||||
#include <ViewPrivate.h>
|
#include <ViewPrivate.h>
|
||||||
|
|
||||||
#include <Alert.h>
|
#include <Alert.h>
|
||||||
@@ -270,8 +273,8 @@ BDragger::MessageReceived(BMessage *msg)
|
|||||||
"Can't delete this replicant from its original application. Life goes on.",
|
"Can't delete this replicant from its original application. Life goes on.",
|
||||||
"OK", NULL, NULL, B_WIDTH_FROM_WIDEST, B_WARNING_ALERT))->Go(NULL);
|
"OK", NULL, NULL, B_WIDTH_FROM_WIDEST, B_WARNING_ALERT))->Go(NULL);
|
||||||
}
|
}
|
||||||
} else if (msg->what == B_SCREEN_CHANGED) {
|
} else if (msg->what == _SHOW_DRAG_HANDLES_) {
|
||||||
// TODO: this code is to be called whenever the "are draggers drawn" option is changed
|
// this code is used whenever the "are draggers drawn" option is changed
|
||||||
if (fRelation == TARGET_IS_CHILD) {
|
if (fRelation == TARGET_IS_CHILD) {
|
||||||
fTransition = true;
|
fTransition = true;
|
||||||
Invalidate();
|
Invalidate();
|
||||||
@@ -306,16 +309,34 @@ BDragger::FrameResized(float newWidth, float newHeight)
|
|||||||
status_t
|
status_t
|
||||||
BDragger::ShowAllDraggers()
|
BDragger::ShowAllDraggers()
|
||||||
{
|
{
|
||||||
// TODO: Implement. Should ask the registrar or the app server
|
BPrivate::AppServerLink link;
|
||||||
return B_OK;
|
link.StartMessage(AS_SET_SHOW_ALL_DRAGGERS);
|
||||||
|
link.Attach<bool>(true);
|
||||||
|
|
||||||
|
status_t status = link.Flush();
|
||||||
|
if (status == B_OK) {
|
||||||
|
sVisible = true;
|
||||||
|
sVisibleInitialized = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
status_t
|
status_t
|
||||||
BDragger::HideAllDraggers()
|
BDragger::HideAllDraggers()
|
||||||
{
|
{
|
||||||
// TODO: Implement. Should ask the registrar or the app server
|
BPrivate::AppServerLink link;
|
||||||
return B_OK;
|
link.StartMessage(AS_SET_SHOW_ALL_DRAGGERS);
|
||||||
|
link.Attach<bool>(false);
|
||||||
|
|
||||||
|
status_t status = link.Flush();
|
||||||
|
if (status == B_OK) {
|
||||||
|
sVisible = false;
|
||||||
|
sVisibleInitialized = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -325,10 +346,17 @@ BDragger::AreDraggersDrawn()
|
|||||||
BAutolock _(sLock);
|
BAutolock _(sLock);
|
||||||
|
|
||||||
if (!sVisibleInitialized) {
|
if (!sVisibleInitialized) {
|
||||||
// TODO: Implement. Should ask the registrar or the app server
|
BPrivate::AppServerLink link;
|
||||||
sVisible = true;
|
link.StartMessage(AS_GET_SHOW_ALL_DRAGGERS);
|
||||||
|
|
||||||
|
status_t status;
|
||||||
|
if (link.FlushWithReply(status) == B_OK && status == B_OK) {
|
||||||
|
link.Read<bool>(&sVisible);
|
||||||
sVisibleInitialized = true;
|
sVisibleInitialized = true;
|
||||||
|
} else
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return sVisible;
|
return sVisible;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -451,6 +479,22 @@ BDragger::operator=(const BDragger &)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*static*/ void
|
||||||
|
BDragger::_UpdateShowAllDraggers(bool visible)
|
||||||
|
{
|
||||||
|
BAutolock _(sLock);
|
||||||
|
|
||||||
|
sVisibleInitialized = true;
|
||||||
|
sVisible = visible;
|
||||||
|
|
||||||
|
for (int32 i = sList.CountItems(); i-- > 0;) {
|
||||||
|
BDragger* dragger = (BDragger*)sList.ItemAt(i);
|
||||||
|
BMessenger target(dragger);
|
||||||
|
target.SendMessage(_SHOW_DRAG_HANDLES_);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
BDragger::_AddToList()
|
BDragger::_AddToList()
|
||||||
{
|
{
|
||||||
@@ -482,8 +526,6 @@ BDragger::_RemoveFromList()
|
|||||||
status_t
|
status_t
|
||||||
BDragger::_DetermineRelationship()
|
BDragger::_DetermineRelationship()
|
||||||
{
|
{
|
||||||
status_t err = B_OK;
|
|
||||||
|
|
||||||
if (fTarget) {
|
if (fTarget) {
|
||||||
if (fTarget == Parent())
|
if (fTarget == Parent())
|
||||||
fRelation = TARGET_IS_PARENT;
|
fRelation = TARGET_IS_PARENT;
|
||||||
@@ -497,10 +539,10 @@ BDragger::_DetermineRelationship()
|
|||||||
else if (fRelation == TARGET_IS_CHILD)
|
else if (fRelation == TARGET_IS_CHILD)
|
||||||
fTarget = ChildAt(0);
|
fTarget = ChildAt(0);
|
||||||
else
|
else
|
||||||
err = B_ERROR;
|
return B_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
return err;
|
return B_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2005-2006, Haiku.
|
* Copyright 2005-2007, Haiku.
|
||||||
* Distributed under the terms of the MIT License.
|
* Distributed under the terms of the MIT License.
|
||||||
*
|
*
|
||||||
* Authors:
|
* Authors:
|
||||||
@@ -46,12 +46,13 @@ DesktopSettingsPrivate::_SetDefaults()
|
|||||||
fFixedFont = *gFontManager->DefaultFixedFont();
|
fFixedFont = *gFontManager->DefaultFixedFont();
|
||||||
|
|
||||||
fMouseMode = B_NORMAL_MOUSE;
|
fMouseMode = B_NORMAL_MOUSE;
|
||||||
|
fShowAllDraggers = true;
|
||||||
|
|
||||||
// init scrollbar info
|
// init scrollbar info
|
||||||
fScrollBarInfo.proportional = true;
|
fScrollBarInfo.proportional = true;
|
||||||
fScrollBarInfo.double_arrows = false;
|
fScrollBarInfo.double_arrows = false;
|
||||||
// look of the knob (R5: (0, 1, 2), 1 = default)
|
|
||||||
fScrollBarInfo.knob = 1;
|
fScrollBarInfo.knob = 1;
|
||||||
|
// look of the knob (R5: (0, 1, 2), 1 = default)
|
||||||
fScrollBarInfo.min_knob_size = 15;
|
fScrollBarInfo.min_knob_size = 15;
|
||||||
|
|
||||||
// init menu info
|
// init menu info
|
||||||
@@ -60,9 +61,8 @@ DesktopSettingsPrivate::_SetDefaults()
|
|||||||
fMenuInfo.font_size = fPlainFont.Size();
|
fMenuInfo.font_size = fPlainFont.Size();
|
||||||
fMenuInfo.background_color.set_to(216, 216, 216);
|
fMenuInfo.background_color.set_to(216, 216, 216);
|
||||||
|
|
||||||
// look of the separator (R5: (0, 1, 2), default 0)
|
|
||||||
// TODO: we could just choose a nice one and remove the others
|
|
||||||
fMenuInfo.separator = 0;
|
fMenuInfo.separator = 0;
|
||||||
|
// look of the separator (R5: (0, 1, 2), default 0)
|
||||||
fMenuInfo.click_to_open = true; // always true
|
fMenuInfo.click_to_open = true; // always true
|
||||||
fMenuInfo.triggers_always_shown = false;
|
fMenuInfo.triggers_always_shown = false;
|
||||||
|
|
||||||
@@ -288,6 +288,20 @@ DesktopSettingsPrivate::Save(uint32 mask)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (mask & kDraggerSettings) {
|
||||||
|
BPath path(basePath);
|
||||||
|
if (path.Append("dragger") == B_OK) {
|
||||||
|
BMessage settings('asdg');
|
||||||
|
settings.AddBool("show", fShowAllDraggers);
|
||||||
|
|
||||||
|
BFile file;
|
||||||
|
status = file.SetTo(path.Path(), B_CREATE_FILE | B_ERASE_FILE | B_READ_WRITE);
|
||||||
|
if (status == B_OK) {
|
||||||
|
status = settings.Flatten(&file, NULL);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (mask & kAppearanceSettings) {
|
if (mask & kAppearanceSettings) {
|
||||||
BPath path(basePath);
|
BPath path(basePath);
|
||||||
if (path.Append("appearance") == B_OK) {
|
if (path.Append("appearance") == B_OK) {
|
||||||
@@ -410,6 +424,21 @@ DesktopSettingsPrivate::FocusFollowsMouse() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
DesktopSettingsPrivate::SetShowAllDraggers(bool show)
|
||||||
|
{
|
||||||
|
fShowAllDraggers = show;
|
||||||
|
Save(kDraggerSettings);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool
|
||||||
|
DesktopSettingsPrivate::ShowAllDraggers() const
|
||||||
|
{
|
||||||
|
return fShowAllDraggers;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
DesktopSettingsPrivate::SetWorkspacesCount(int32 number)
|
DesktopSettingsPrivate::SetWorkspacesCount(int32 number)
|
||||||
{
|
{
|
||||||
@@ -513,6 +542,13 @@ DesktopSettings::FocusFollowsMouse() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool
|
||||||
|
DesktopSettings::ShowAllDraggers() const
|
||||||
|
{
|
||||||
|
return fSettings->ShowAllDraggers();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
int32
|
int32
|
||||||
DesktopSettings::WorkspacesCount() const
|
DesktopSettings::WorkspacesCount() const
|
||||||
{
|
{
|
||||||
@@ -531,12 +567,10 @@ DesktopSettings::WorkspacesMessage(int32 index) const
|
|||||||
|
|
||||||
|
|
||||||
LockedDesktopSettings::LockedDesktopSettings(Desktop* desktop)
|
LockedDesktopSettings::LockedDesktopSettings(Desktop* desktop)
|
||||||
:
|
: DesktopSettings(desktop),
|
||||||
fSettings(desktop->fSettings),
|
|
||||||
fDesktop(desktop)
|
fDesktop(desktop)
|
||||||
{
|
{
|
||||||
// TODO: this only works in MultiLocker's DEBUG mode
|
#if DEBUG
|
||||||
#if 0
|
|
||||||
if (desktop->fWindowLock.IsReadLocked())
|
if (desktop->fWindowLock.IsReadLocked())
|
||||||
debugger("desktop read locked when trying to change settings");
|
debugger("desktop read locked when trying to change settings");
|
||||||
#endif
|
#endif
|
||||||
@@ -593,3 +627,9 @@ LockedDesktopSettings::SetMouseMode(const mode_mouse mode)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
LockedDesktopSettings::SetShowAllDraggers(bool show)
|
||||||
|
{
|
||||||
|
fSettings->SetShowAllDraggers(show);
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2001-2005, Haiku.
|
* Copyright 2001-2007, Haiku.
|
||||||
* Distributed under the terms of the MIT License.
|
* Distributed under the terms of the MIT License.
|
||||||
*
|
*
|
||||||
* Authors:
|
* Authors:
|
||||||
@@ -26,6 +26,7 @@ enum {
|
|||||||
kFontSettings = 0x02,
|
kFontSettings = 0x02,
|
||||||
kAppearanceSettings = 0x04,
|
kAppearanceSettings = 0x04,
|
||||||
kMouseSettings = 0x08,
|
kMouseSettings = 0x08,
|
||||||
|
kDraggerSettings = 0x10,
|
||||||
};
|
};
|
||||||
|
|
||||||
class DesktopSettings {
|
class DesktopSettings {
|
||||||
@@ -44,16 +45,16 @@ class DesktopSettings {
|
|||||||
mode_mouse MouseMode() const;
|
mode_mouse MouseMode() const;
|
||||||
bool FocusFollowsMouse() const;
|
bool FocusFollowsMouse() const;
|
||||||
|
|
||||||
|
bool ShowAllDraggers() const;
|
||||||
|
|
||||||
int32 WorkspacesCount() const;
|
int32 WorkspacesCount() const;
|
||||||
const BMessage* WorkspacesMessage(int32 index) const;
|
const BMessage* WorkspacesMessage(int32 index) const;
|
||||||
|
|
||||||
private:
|
protected:
|
||||||
// friend class Desktop;
|
|
||||||
|
|
||||||
DesktopSettingsPrivate* fSettings;
|
DesktopSettingsPrivate* fSettings;
|
||||||
};
|
};
|
||||||
|
|
||||||
class LockedDesktopSettings {
|
class LockedDesktopSettings : public DesktopSettings {
|
||||||
public:
|
public:
|
||||||
LockedDesktopSettings(Desktop* desktop);
|
LockedDesktopSettings(Desktop* desktop);
|
||||||
~LockedDesktopSettings();
|
~LockedDesktopSettings();
|
||||||
@@ -67,10 +68,9 @@ class LockedDesktopSettings {
|
|||||||
|
|
||||||
void SetMouseMode(mode_mouse mode);
|
void SetMouseMode(mode_mouse mode);
|
||||||
|
|
||||||
private:
|
void SetShowAllDraggers(bool show);
|
||||||
// friend class Desktop;
|
|
||||||
|
|
||||||
DesktopSettingsPrivate* fSettings;
|
private:
|
||||||
Desktop* fDesktop;
|
Desktop* fDesktop;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2005-2006, Haiku.
|
* Copyright 2005-2007, Haiku.
|
||||||
* Distributed under the terms of the MIT License.
|
* Distributed under the terms of the MIT License.
|
||||||
*
|
*
|
||||||
* Authors:
|
* Authors:
|
||||||
@@ -43,6 +43,9 @@ class DesktopSettingsPrivate {
|
|||||||
mode_mouse MouseMode() const;
|
mode_mouse MouseMode() const;
|
||||||
bool FocusFollowsMouse() const;
|
bool FocusFollowsMouse() const;
|
||||||
|
|
||||||
|
void SetShowAllDraggers(bool show);
|
||||||
|
bool ShowAllDraggers() const;
|
||||||
|
|
||||||
void SetWorkspacesCount(int32 number);
|
void SetWorkspacesCount(int32 number);
|
||||||
int32 WorkspacesCount() const;
|
int32 WorkspacesCount() const;
|
||||||
|
|
||||||
@@ -61,6 +64,7 @@ class DesktopSettingsPrivate {
|
|||||||
scroll_bar_info fScrollBarInfo;
|
scroll_bar_info fScrollBarInfo;
|
||||||
menu_info fMenuInfo;
|
menu_info fMenuInfo;
|
||||||
mode_mouse fMouseMode;
|
mode_mouse fMouseMode;
|
||||||
|
bool fShowAllDraggers;
|
||||||
int32 fWorkspacesCount;
|
int32 fWorkspacesCount;
|
||||||
BMessage fWorkspaceMessages[kMaxWorkspaces];
|
BMessage fWorkspaceMessages[kMaxWorkspaces];
|
||||||
|
|
||||||
|
|||||||
@@ -77,6 +77,7 @@
|
|||||||
|
|
||||||
using std::nothrow;
|
using std::nothrow;
|
||||||
|
|
||||||
|
static const uint32 kMsgUpdateShowAllDraggers = '_adg';
|
||||||
static const uint32 kMsgAppQuit = 'appQ';
|
static const uint32 kMsgAppQuit = 'appQ';
|
||||||
|
|
||||||
|
|
||||||
@@ -1037,6 +1038,58 @@ ServerApp::_DispatchMessage(int32 code, BPrivate::LinkReceiver& link)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
case AS_GET_SHOW_ALL_DRAGGERS:
|
||||||
|
{
|
||||||
|
STRACE(("ServerApp %s: Get Show All Draggers\n", Signature()));
|
||||||
|
|
||||||
|
if (fDesktop->LockSingleWindow()) {
|
||||||
|
DesktopSettings settings(fDesktop);
|
||||||
|
|
||||||
|
fLink.StartMessage(B_OK);
|
||||||
|
fLink.Attach<bool>(settings.ShowAllDraggers());
|
||||||
|
|
||||||
|
fDesktop->UnlockSingleWindow();
|
||||||
|
} else
|
||||||
|
fLink.StartMessage(B_ERROR);
|
||||||
|
|
||||||
|
fLink.Flush();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case AS_SET_SHOW_ALL_DRAGGERS:
|
||||||
|
{
|
||||||
|
STRACE(("ServerApp %s: Set Show All Draggers\n", Signature()));
|
||||||
|
|
||||||
|
bool changed = false;
|
||||||
|
bool show;
|
||||||
|
if (link.Read<bool>(&show) == B_OK) {
|
||||||
|
LockedDesktopSettings settings(fDesktop);
|
||||||
|
if (show != settings.ShowAllDraggers()) {
|
||||||
|
settings.SetShowAllDraggers(show);
|
||||||
|
changed = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (changed)
|
||||||
|
fDesktop->BroadcastToAllApps(kMsgUpdateShowAllDraggers);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case kMsgUpdateShowAllDraggers:
|
||||||
|
{
|
||||||
|
bool show = false;
|
||||||
|
if (fDesktop->LockSingleWindow()) {
|
||||||
|
DesktopSettings settings(fDesktop);
|
||||||
|
show = settings.ShowAllDraggers();
|
||||||
|
fDesktop->UnlockSingleWindow();
|
||||||
|
}
|
||||||
|
BMessage update(_SHOW_DRAG_HANDLES_);
|
||||||
|
update.AddBool("show", show);
|
||||||
|
|
||||||
|
SendMessageToClient(&update);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
/* font messages */
|
/* font messages */
|
||||||
|
|
||||||
case AS_SET_SYSTEM_FONT:
|
case AS_SET_SYSTEM_FONT:
|
||||||
|
|||||||
Reference in New Issue
Block a user