* Workspaces can now be a replicant.
* The view must be a follow all view since the workspaces are handled differently. * No longer needs to use kWorkspacesWindowFlag; this makes it no longer work on BeOS. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24387 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -10,14 +10,10 @@
|
|||||||
* Matt Madia
|
* Matt Madia
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*!
|
|
||||||
Workspaces window trick found by Michael "Minox" Paine.
|
|
||||||
(using B_ALL_WORKSPACES as flags in BWindow)
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
#include <Alert.h>
|
#include <Alert.h>
|
||||||
#include <Application.h>
|
#include <Application.h>
|
||||||
|
#include <Dragger.h>
|
||||||
#include <Entry.h>
|
#include <Entry.h>
|
||||||
#include <File.h>
|
#include <File.h>
|
||||||
#include <FindDirectory.h>
|
#include <FindDirectory.h>
|
||||||
@@ -36,7 +32,7 @@
|
|||||||
#include <WindowPrivate.h>
|
#include <WindowPrivate.h>
|
||||||
|
|
||||||
|
|
||||||
static const char *kWorkspacesSignature = "application/x-vnd.Be-WORK";
|
static const char *kSignature = "application/x-vnd.Be-WORK";
|
||||||
static const char *kWorkspacesSettingFile = "Workspace_data";
|
static const char *kWorkspacesSettingFile = "Workspace_data";
|
||||||
|
|
||||||
static const float kScreenBorderOffset = 10.0;
|
static const float kScreenBorderOffset = 10.0;
|
||||||
@@ -61,8 +57,12 @@ class WorkspacesPreferences {
|
|||||||
class WorkspacesView : public BView {
|
class WorkspacesView : public BView {
|
||||||
public:
|
public:
|
||||||
WorkspacesView(BRect frame);
|
WorkspacesView(BRect frame);
|
||||||
|
WorkspacesView(BMessage* archive);
|
||||||
~WorkspacesView();
|
~WorkspacesView();
|
||||||
|
|
||||||
|
static WorkspacesView* Instantiate(BMessage* archive);
|
||||||
|
virtual status_t Archive(BMessage* archive, bool deep = true) const;
|
||||||
|
|
||||||
virtual void MouseMoved(BPoint where, uint32 transit,
|
virtual void MouseMoved(BPoint where, uint32 transit,
|
||||||
const BMessage* dragMessage);
|
const BMessage* dragMessage);
|
||||||
virtual void MouseDown(BPoint where);
|
virtual void MouseDown(BPoint where);
|
||||||
@@ -204,7 +204,19 @@ WorkspacesPreferences::SetWindowFrame(BRect frame)
|
|||||||
|
|
||||||
|
|
||||||
WorkspacesView::WorkspacesView(BRect frame)
|
WorkspacesView::WorkspacesView(BRect frame)
|
||||||
: BView(frame, "workspaces", B_FOLLOW_NONE, kWorkspacesViewFlag)
|
: BView(frame, "workspaces", B_FOLLOW_ALL, kWorkspacesViewFlag)
|
||||||
|
{
|
||||||
|
frame.OffsetTo(B_ORIGIN);
|
||||||
|
frame.top = frame.bottom - 7;
|
||||||
|
frame.left = frame.right - 7;
|
||||||
|
BDragger* dragger = new BDragger(frame, this,
|
||||||
|
B_FOLLOW_RIGHT | B_FOLLOW_BOTTOM);
|
||||||
|
AddChild(dragger);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
WorkspacesView::WorkspacesView(BMessage* archive)
|
||||||
|
: BView(archive)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -214,6 +226,29 @@ WorkspacesView::~WorkspacesView()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*static*/ WorkspacesView*
|
||||||
|
WorkspacesView::Instantiate(BMessage* archive)
|
||||||
|
{
|
||||||
|
if (!validate_instantiation(archive, "WorkspacesView"))
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
return new WorkspacesView(archive);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
status_t
|
||||||
|
WorkspacesView::Archive(BMessage* archive, bool deep) const
|
||||||
|
{
|
||||||
|
status_t status = BView::Archive(archive, deep);
|
||||||
|
if (status == B_OK)
|
||||||
|
status = archive->AddString("add_on", kSignature);
|
||||||
|
if (status == B_OK)
|
||||||
|
status = archive->AddString("class", "WorkspacesView");
|
||||||
|
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
WorkspacesView::MouseMoved(BPoint where, uint32 transit,
|
WorkspacesView::MouseMoved(BPoint where, uint32 transit,
|
||||||
const BMessage* dragMessage)
|
const BMessage* dragMessage)
|
||||||
@@ -254,8 +289,7 @@ WorkspacesView::MouseDown(BPoint where)
|
|||||||
|
|
||||||
WorkspacesWindow::WorkspacesWindow(WorkspacesPreferences *preferences)
|
WorkspacesWindow::WorkspacesWindow(WorkspacesPreferences *preferences)
|
||||||
: BWindow(preferences->WindowFrame(), "Workspaces", B_TITLED_WINDOW_LOOK,
|
: BWindow(preferences->WindowFrame(), "Workspaces", B_TITLED_WINDOW_LOOK,
|
||||||
B_NORMAL_WINDOW_FEEL,
|
B_NORMAL_WINDOW_FEEL, B_AVOID_FRONT | B_WILL_ACCEPT_FIRST_CLICK,
|
||||||
kWorkspacesWindowFlag | B_AVOID_FRONT | B_WILL_ACCEPT_FIRST_CLICK,
|
|
||||||
B_ALL_WORKSPACES),
|
B_ALL_WORKSPACES),
|
||||||
fPreferences(preferences)
|
fPreferences(preferences)
|
||||||
{
|
{
|
||||||
@@ -347,7 +381,7 @@ WorkspacesWindow::SetAutoRaise()
|
|||||||
|
|
||||||
|
|
||||||
WorkspacesApp::WorkspacesApp()
|
WorkspacesApp::WorkspacesApp()
|
||||||
: BApplication(kWorkspacesSignature)
|
: BApplication(kSignature)
|
||||||
{
|
{
|
||||||
fWindow = new WorkspacesWindow(new WorkspacesPreferences());
|
fWindow = new WorkspacesWindow(new WorkspacesPreferences());
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user