* Added new Haiku method IsRunning().
* Rewrote header. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19144 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -1,51 +1,18 @@
|
|||||||
//------------------------------------------------------------------------------
|
/*
|
||||||
// Copyright (c) 2001-2002, OpenBeOS
|
* Copyright 2006, Haiku, Inc. All Rights Reserved.
|
||||||
//
|
* Distributed under the terms of the MIT License.
|
||||||
// Permission is hereby granted, free of charge, to any person obtaining a
|
*/
|
||||||
// copy of this software and associated documentation files (the "Software"),
|
|
||||||
// to deal in the Software without restriction, including without limitation
|
|
||||||
// the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
|
||||||
// and/or sell copies of the Software, and to permit persons to whom the
|
|
||||||
// Software is furnished to do so, subject to the following conditions:
|
|
||||||
//
|
|
||||||
// The above copyright notice and this permission notice shall be included in
|
|
||||||
// all copies or substantial portions of the Software.
|
|
||||||
//
|
|
||||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
||||||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
|
||||||
// DEALINGS IN THE SOFTWARE.
|
|
||||||
//
|
|
||||||
// File Name: Deskbar.h
|
|
||||||
// Author: Jeremy Rand ([email protected])
|
|
||||||
// Description: BDeskbar allows one to control the deskbar from an
|
|
||||||
// application.
|
|
||||||
//------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
#ifndef _DESKBAR_H
|
#ifndef _DESKBAR_H
|
||||||
#define _DESKBAR_H
|
#define _DESKBAR_H
|
||||||
|
|
||||||
// Standard Includes -----------------------------------------------------------
|
|
||||||
|
|
||||||
// System Includes -------------------------------------------------------------
|
|
||||||
#include <BeBuild.h>
|
#include <BeBuild.h>
|
||||||
#include <Rect.h>
|
#include <Rect.h>
|
||||||
|
|
||||||
// Project Includes ------------------------------------------------------------
|
|
||||||
|
|
||||||
// Local Includes --------------------------------------------------------------
|
|
||||||
|
|
||||||
// Local Defines ---------------------------------------------------------------
|
|
||||||
|
|
||||||
// Globals ---------------------------------------------------------------------
|
|
||||||
|
|
||||||
class BMessenger;
|
class BMessenger;
|
||||||
class BView;
|
class BView;
|
||||||
|
|
||||||
// enum for deskbar locations --------------------------------------------------
|
|
||||||
enum deskbar_location {
|
enum deskbar_location {
|
||||||
B_DESKBAR_TOP,
|
B_DESKBAR_TOP,
|
||||||
B_DESKBAR_BOTTOM,
|
B_DESKBAR_BOTTOM,
|
||||||
@@ -55,31 +22,30 @@ enum deskbar_location {
|
|||||||
B_DESKBAR_RIGHT_BOTTOM
|
B_DESKBAR_RIGHT_BOTTOM
|
||||||
};
|
};
|
||||||
|
|
||||||
|
class BDeskbar {
|
||||||
// BDeskbar class -------------------------------------------------------------
|
|
||||||
class BDeskbar
|
|
||||||
{
|
|
||||||
public:
|
public:
|
||||||
BDeskbar();
|
BDeskbar();
|
||||||
~BDeskbar();
|
~BDeskbar();
|
||||||
|
|
||||||
|
bool IsRunning() const;
|
||||||
|
|
||||||
// Location member functions
|
// Location member functions
|
||||||
BRect Frame(void) const;
|
BRect Frame() const;
|
||||||
deskbar_location Location(bool *isExpanded = NULL) const;
|
deskbar_location Location(bool* _isExpanded = NULL) const;
|
||||||
status_t SetLocation(deskbar_location location, bool expanded = false);
|
status_t SetLocation(deskbar_location location, bool expanded = false);
|
||||||
bool IsExpanded(void) const;
|
bool IsExpanded() const;
|
||||||
status_t Expand(bool expand);
|
status_t Expand(bool expand);
|
||||||
|
|
||||||
// Item querying member functions
|
// Item querying member functions
|
||||||
status_t GetItemInfo(int32 id, const char **name) const;
|
status_t GetItemInfo(int32 id, const char** _name) const;
|
||||||
status_t GetItemInfo(const char *name, int32 *id) const;
|
status_t GetItemInfo(const char* name, int32* _id) const;
|
||||||
bool HasItem(int32 id) const;
|
bool HasItem(int32 id) const;
|
||||||
bool HasItem(const char* name) const;
|
bool HasItem(const char* name) const;
|
||||||
uint32 CountItems(void) const;
|
uint32 CountItems() const;
|
||||||
|
|
||||||
// Item modification member functions
|
// Item modification member functions
|
||||||
status_t AddItem(BView *archivableView, int32 *id = NULL);
|
status_t AddItem(BView* archivableView, int32* _id = NULL);
|
||||||
status_t AddItem(entry_ref *addon, int32 *id = NULL);
|
status_t AddItem(entry_ref* addOn, int32* _id = NULL);
|
||||||
status_t RemoveItem(int32 id);
|
status_t RemoveItem(int32 id);
|
||||||
status_t RemoveItem(const char* name);
|
status_t RemoveItem(const char* name);
|
||||||
|
|
||||||
@@ -87,7 +53,5 @@ private:
|
|||||||
BMessenger* fMessenger;
|
BMessenger* fMessenger;
|
||||||
uint32 _reserved[12];
|
uint32 _reserved[12];
|
||||||
};
|
};
|
||||||
//------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
#endif // _DESKBAR_H
|
#endif // _DESKBAR_H
|
||||||
|
|
||||||
|
|||||||
@@ -77,8 +77,15 @@ BDeskbar::~BDeskbar()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool
|
||||||
|
BDeskbar::IsRunning() const
|
||||||
|
{
|
||||||
|
return fMessenger->IsValid();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
BRect
|
BRect
|
||||||
BDeskbar::Frame(void) const
|
BDeskbar::Frame() const
|
||||||
{
|
{
|
||||||
BRect frame(0.0, 0.0, 0.0, 0.0);
|
BRect frame(0.0, 0.0, 0.0, 0.0);
|
||||||
get_deskbar_frame(&frame);
|
get_deskbar_frame(&frame);
|
||||||
|
|||||||
Reference in New Issue
Block a user