* 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:
Axel Dörfler 2006-10-29 16:45:16 +00:00
parent b13c090ef3
commit e2db304337
2 changed files with 41 additions and 70 deletions

View File

@ -1,51 +1,18 @@
//------------------------------------------------------------------------------
// Copyright (c) 2001-2002, OpenBeOS
//
// 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 (jrand@magma.ca)
// Description: BDeskbar allows one to control the deskbar from an
// application.
//------------------------------------------------------------------------------
/*
* Copyright 2006, Haiku, Inc. All Rights Reserved.
* Distributed under the terms of the MIT License.
*/
#ifndef _DESKBAR_H
#define _DESKBAR_H
// Standard Includes -----------------------------------------------------------
// System Includes -------------------------------------------------------------
#include <BeBuild.h>
#include <Rect.h>
// Project Includes ------------------------------------------------------------
// Local Includes --------------------------------------------------------------
// Local Defines ---------------------------------------------------------------
// Globals ---------------------------------------------------------------------
class BMessenger;
class BView;
// enum for deskbar locations --------------------------------------------------
enum deskbar_location {
B_DESKBAR_TOP,
B_DESKBAR_BOTTOM,
@ -55,31 +22,30 @@ enum deskbar_location {
B_DESKBAR_RIGHT_BOTTOM
};
// BDeskbar class -------------------------------------------------------------
class BDeskbar
{
class BDeskbar {
public:
BDeskbar();
~BDeskbar();
bool IsRunning() const;
// Location member functions
BRect Frame(void) const;
deskbar_location Location(bool *isExpanded = NULL) const;
BRect Frame() const;
deskbar_location Location(bool* _isExpanded = NULL) const;
status_t SetLocation(deskbar_location location, bool expanded = false);
bool IsExpanded(void) const;
bool IsExpanded() const;
status_t Expand(bool expand);
// Item querying member functions
status_t GetItemInfo(int32 id, const char **name) const;
status_t GetItemInfo(const char *name, int32 *id) const;
status_t GetItemInfo(int32 id, const char** _name) const;
status_t GetItemInfo(const char* name, int32* _id) const;
bool HasItem(int32 id) const;
bool HasItem(const char* name) const;
uint32 CountItems(void) const;
uint32 CountItems() const;
// Item modification member functions
status_t AddItem(BView *archivableView, int32 *id = NULL);
status_t AddItem(entry_ref *addon, int32 *id = NULL);
status_t AddItem(BView* archivableView, int32* _id = NULL);
status_t AddItem(entry_ref* addOn, int32* _id = NULL);
status_t RemoveItem(int32 id);
status_t RemoveItem(const char* name);
@ -87,7 +53,5 @@ private:
BMessenger* fMessenger;
uint32 _reserved[12];
};
//------------------------------------------------------------------------------
#endif // _DESKBAR_H

View File

@ -77,8 +77,15 @@ BDeskbar::~BDeskbar()
}
bool
BDeskbar::IsRunning() const
{
return fMessenger->IsValid();
}
BRect
BDeskbar::Frame(void) const
BDeskbar::Frame() const
{
BRect frame(0.0, 0.0, 0.0, 0.0);
get_deskbar_frame(&frame);