Removed headers and sources not needed for build platform version for libbe.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34212 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold
2009-11-24 18:59:40 +00:00
parent a85cf9d793
commit b5a20f9d11
171 changed files with 0 additions and 22616 deletions
@@ -1,110 +0,0 @@
//------------------------------------------------------------------------------
// 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: BMCPrivate.h
// Author: Marc Flerackers ([email protected])
// Description: The BMCPrivate classes are used by BMenuField.
//------------------------------------------------------------------------------
#ifndef _BMC_PRIVATE_H
#define _BMC_PRIVATE_H
// Standard Includes -----------------------------------------------------------
// System Includes -------------------------------------------------------------
#include <BeBuild.h>
#include <MenuBar.h>
#include <MenuItem.h>
// Project Includes ------------------------------------------------------------
// Local Includes --------------------------------------------------------------
// Local Defines ---------------------------------------------------------------
// Globals ---------------------------------------------------------------------
//------------------------------------------------------------------------------
class _BMCItem_ : public BMenuItem {
public:
_BMCItem_(BMenu *menu);
_BMCItem_(BMessage *message);
virtual ~_BMCItem_();
static BArchivable *Instantiate(BMessage *data);
void Draw();
void GetContentSize(float *width, float *height);
private:
friend class BMenuField;
bool fShowPopUpMarker;
};
//------------------------------------------------------------------------------
/*//------------------------------------------------------------------------------
_BMCFilter_::_BMCFilter_(BMenuField *menuField, uint32)
{
}
//------------------------------------------------------------------------------
_BMCFilter_::~_BMCFilter_()
{
}
//------------------------------------------------------------------------------
filter_result _BMCFilter_::Filter(BMessage *message, BHandler **handler)
{
}
//------------------------------------------------------------------------------
_BMCFilter_ &_BMCFilter_::operator=(const _BMCFilter_ &)
{
return *this;
}
//------------------------------------------------------------------------------*/
//------------------------------------------------------------------------------
class _BMCMenuBar_ : public BMenuBar {
public:
_BMCMenuBar_(BRect frame, bool fixed_size,
BMenuField *menuField);
_BMCMenuBar_(BMessage *data);
virtual ~_BMCMenuBar_();
static BArchivable *Instantiate(BMessage *data);
virtual void AttachedToWindow();
virtual void Draw(BRect updateRect);
virtual void FrameResized(float width, float height);
virtual void MessageReceived(BMessage* msg);
virtual void MakeFocus(bool focused = true);
private:
_BMCMenuBar_&operator=(const _BMCMenuBar_ &);
BMenuField *fMenuField;
bool fFixedSize;
BMessageRunner *fRunner;
};
//------------------------------------------------------------------------------
#endif // _BMC_PRIVATE_H
@@ -1,25 +0,0 @@
#ifndef CLIENT_FONT_LIST_H
#define CLIENT_FONT_LIST_H
#include <Font.h> // for BFont-related definitions
#include <List.h>
#include <Message.h>
#include <OS.h>
class ClientFontList
{
public:
ClientFontList(void);
~ClientFontList(void);
bool Update(bool check_only);
int32 CountFamilies(void);
status_t GetFamily(int32 index, font_family *name, uint32 *flags=NULL);
int32 CountStyles(font_family f);
status_t GetStyle(font_family family, int32 index, font_style *name,uint32 *flags=NULL, uint16 *face=NULL);
private:
BList *familylist;
sem_id fontlock;
};
#endif
@@ -1,103 +0,0 @@
/*
Open Tracker License
Terms and Conditions
Copyright (c) 1991-2000, Be Incorporated. All rights reserved.
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 applies to all licensees
and 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 TITLE, MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
BE INCORPORATED 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.
Except as contained in this notice, the name of Be Incorporated shall not be
used in advertising or otherwise to promote the sale, use or other dealings in
this Software without prior written authorization from Be Incorporated.
Tracker(TM), Be(R), BeOS(R), and BeIA(TM) are trademarks or registered trademarks
of Be Incorporated in the United States and other countries. Other brand product
names are registered trademarks or trademarks of their respective holders.
All rights reserved.
*/
/*******************************************************************************
/
/ File: ColorTools.h
/
/ Description: Additional experimental color manipulation functions.
/
/ Copyright 2000, Be Incorporated, All Rights Reserved
/
*******************************************************************************/
#ifndef _COLOR_TOOLS_H
#define _COLOR_TOOLS_H
#include <GraphicsDefs.h>
#if B_BEOS_VERSION <= B_BEOS_VERSION_5
namespace BExperimental {
// Comparison operators.
inline bool operator==(const rgb_color c1, const rgb_color c2)
{
return (*((uint32*)&c1)) == (*((uint32*)&c2));
}
inline bool operator!=(const rgb_color c1, const rgb_color c2)
{
return (*((uint32*)&c1)) != (*((uint32*)&c2));
}
// Color creation.
inline rgb_color make_color(uint8 red, uint8 green, uint8 blue, uint8 alpha=255)
{
rgb_color c;
c.red = red;
c.green = green;
c.blue = blue;
c.alpha = alpha;
return c;
}
// Mix two colors together, ignoring their relative alpha channels.
// If amount is 0, the result is color1; if 255, the result is color2;
// if another value, it is somewhere in-between. The resulting alpha
// channel is mixed exactly like the other color channels.
rgb_color mix_color(rgb_color color1, rgb_color color2, uint8 amount);
// Blend two colors together, weighting by their relative alpha channels.
// The resulting color is the same as mix_color(), except that the amount
// used from color1 and color2's color channels is dependent on that color's
// alpha channel. For example, if color1.alpha is 0 and color2.alpha is
// 255, the resulting red, green, and blue values will be the same as those
// in color2, regardless of 'amount'.
rgb_color blend_color(rgb_color color1, rgb_color color2, uint8 amount);
// Return a color that is the disabled representation of 'color' when drawn
// on a solid color 'background'.
rgb_color disable_color(rgb_color color, rgb_color background);
} // namespace BExperimental
using namespace BExperimental;
#endif
#endif
@@ -1,366 +0,0 @@
/*
Open Tracker License
Terms and Conditions
Copyright (c) 1991-2000, Be Incorporated. All rights reserved.
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 applies to all licensees
and 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 TITLE, MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
BE INCORPORATED 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.
Except as contained in this notice, the name of Be Incorporated shall not be
used in advertising or otherwise to promote the sale, use or other dealings in
this Software without prior written authorization from Be Incorporated.
Tracker(TM), Be(R), BeOS(R), and BeIA(TM) are trademarks or registered trademarks
of Be Incorporated in the United States and other countries. Other brand product
names are registered trademarks or trademarks of their respective holders.
All rights reserved.
*/
/*******************************************************************************
/
/ File: ColumnListView.h
/
/ Description: Experimental multi-column list view.
/
/ Copyright 2000+, Be Incorporated, All Rights Reserved
/
*******************************************************************************/
#ifndef _COLUMN_LIST_VIEW_H
#define _COLUMN_LIST_VIEW_H
#include <BeBuild.h>
#include <View.h>
#include <List.h>
#include <Invoker.h>
#include <ListView.h>
class BScrollBar;
namespace BPrivate {
class OutlineView;
class TitleView;
class BRowContainer;
class RecursiveOutlineIterator;
} // ns BPrivate
class BField;
class BRow;
class BColumn;
class BColumnListView;
enum LatchType {
B_NO_LATCH,
B_OPEN_LATCH,
B_PRESSED_LATCH,
B_CLOSED_LATCH
};
typedef enum {
B_ALLOW_COLUMN_NONE = 0,
B_ALLOW_COLUMN_MOVE = 1,
B_ALLOW_COLUMN_RESIZE = 2,
B_ALLOW_COLUMN_POPUP = 4,
B_ALLOW_COLUMN_REMOVE = 8,
} column_flags;
enum ColumnListViewColor {
B_COLOR_BACKGROUND = 0,
B_COLOR_TEXT = 1,
B_COLOR_ROW_DIVIDER = 2,
B_COLOR_SELECTION = 3,
B_COLOR_SELECTION_TEXT = 4,
B_COLOR_NON_FOCUS_SELECTION = 5,
B_COLOR_EDIT_BACKGROUND = 6,
B_COLOR_EDIT_TEXT = 7,
B_COLOR_HEADER_BACKGROUND = 8,
B_COLOR_HEADER_TEXT = 9,
B_COLOR_SEPARATOR_LINE = 10,
B_COLOR_SEPARATOR_BORDER = 11,
B_COLOR_TOTAL = 12
};
enum ColumnListViewFont {
B_FONT_ROW = 0,
B_FONT_HEADER = 1,
B_FONT_TOTAL = 2
};
// A single row/column intersection in the list.
class BField {
public:
BField();
virtual ~BField();
};
// A single line in the list. Each line contains a BField object
// for each column in the list, associated by their "logical field"
// index. Hierarchies are formed by adding other BRow objects as
// a parent of a row, using the AddRow() function in BColumnListView().
class BRow {
public:
BRow(float height = 16.0);
virtual ~BRow();
virtual bool HasLatch() const;
int32 CountFields() const;
BField* GetField(int32 logicalFieldIndex);
const BField* GetField(int32 logicalFieldIndex) const;
void SetField(BField* field, int32 logicalFieldIndex);
float Height() const;
bool IsExpanded() const;
private:
// Blows up into the debugger if the validation fails.
void ValidateFields() const;
void ValidateField(const BField *field, int32 logicalFieldIndex) const;
private:
BList fFields;
BPrivate::
BRowContainer* fChildList;
bool fIsExpanded;
float fHeight;
BRow* fNextSelected;
BRow* fPrevSelected;
BRow* fParent;
BColumnListView* fList;
friend class BColumnListView;
friend class BPrivate::RecursiveOutlineIterator;
friend class BPrivate::OutlineView;
};
// Information about a single column in the list. A column knows
// how to display the BField objects that occur at its location in
// each of the list's rows. See ColumnTypes.h for particular
// subclasses of BField and BColumn that handle common data types.
class BColumn
{
public:
BColumn(float width,
float minWidth,
float maxWidth,
alignment align = B_ALIGN_LEFT);
virtual ~BColumn();
float Width() const;
void SetWidth(float width);
float MinWidth() const;
float MaxWidth() const;
virtual void DrawTitle(BRect rect, BView *targetView);
virtual void DrawField(BField *field, BRect rect, BView *targetView);
virtual int CompareFields(BField *field1, BField *field2);
virtual void MouseMoved(BColumnListView *parent, BRow *row, BField *field,
BRect field_rect, BPoint point, uint32 buttons, int32 code);
virtual void MouseDown(BColumnListView *parent, BRow *row, BField *field,
BRect field_rect, BPoint point, uint32 buttons);
virtual void MouseUp(BColumnListView *parent, BRow *row, BField *field);
virtual void GetColumnName(BString* into) const;
bool IsVisible() const;
void SetVisible(bool);
bool WantsEvents() const;
void SetWantsEvents(bool);
bool ShowHeading() const;
void SetShowHeading(bool);
alignment Alignment() const;
void SetAlignment(alignment);
int32 LogicalFieldNum() const;
/*!
\param field The BField derivative to validate.
Implement this function on your BColumn derivatives to validate BField derivatives
that your BColumn will be drawing/manipulating.
This function will be called when BFields are added to the Column, use dynamic_cast<> to
determine if it is of a kind that your BColumn know how ot handle. return false if it is not.
\note The debugger will be called if you return false from here with information about
what type of BField and BColumn and the logical field index where it occured.
\note Do not call the inherited version of this, it just returns true;
*/
virtual bool AcceptsField(const BField* field) const;
private:
float fWidth;
float fMinWidth;
float fMaxWidth;
bool fVisible;
int32 fFieldID;
BColumnListView *fList;
bool fSortAscending;
bool fWantsEvents;
bool fShowHeading;
alignment fAlignment;
friend class BPrivate::OutlineView;
friend class BColumnListView;
friend class BPrivate::TitleView;
};
// The column list view class.
class BColumnListView : public BView, public BInvoker
{
public:
BColumnListView(BRect rect,
const char *name,
uint32 resizingMode,
uint32 drawFlags,
border_style = B_NO_BORDER,
bool showHorizontalScrollbar = true);
virtual ~BColumnListView();
// Interaction
virtual bool InitiateDrag(BPoint, bool wasSelected);
virtual void MessageDropped(BMessage*, BPoint point);
virtual void ExpandOrCollapse(BRow *row, bool expand);
virtual status_t Invoke(BMessage *message = NULL);
virtual void ItemInvoked();
virtual void SetInvocationMessage(BMessage*);
BMessage* InvocationMessage() const;
uint32 InvocationCommand() const;
BRow* FocusRow() const;
void SetFocusRow(int32 index, bool select=false);
void SetFocusRow(BRow *row, bool select=false);
void SetMouseTrackingEnabled(bool);
// Selection
list_view_type SelectionMode() const;
void Deselect(BRow *row);
void AddToSelection(BRow *row);
void DeselectAll();
BRow* CurrentSelection(BRow *lastSelected = 0) const;
virtual void SelectionChanged();
virtual void SetSelectionMessage(BMessage *);
BMessage* SelectionMessage();
uint32 SelectionCommand() const;
void SetSelectionMode(list_view_type); // list_view_type is defined in ListView.h.
// Sorting
void SetSortingEnabled(bool);
bool SortingEnabled() const;
void SetSortColumn(BColumn *column, bool add, bool ascending);
void ClearSortColumns();
// The status view is a little area in the lower left hand corner.
void AddStatusView(BView *view);
BView* RemoveStatusView();
// Column Manipulation
void AddColumn(BColumn*, int32 logicalFieldIndex);
void MoveColumn(BColumn*, int32 index);
void RemoveColumn(BColumn*);
int32 CountColumns() const;
BColumn* ColumnAt(int32 index) const;
void SetColumnVisible(BColumn*, bool isVisible);
void SetColumnVisible(int32, bool);
bool IsColumnVisible(int32) const;
void SetColumnFlags(column_flags flags);
// Row manipulation
const BRow* RowAt(int32 index, BRow *parent = 0) const;
BRow* RowAt(int32 index, BRow *parent = 0);
const BRow* RowAt(BPoint) const;
BRow* RowAt(BPoint);
bool GetRowRect(const BRow *row, BRect *outRect) const;
bool FindParent(BRow *row, BRow **outs_parent, bool *out_isVisible) const;
int32 IndexOf(BRow *row);
int32 CountRows(BRow *parent = 0) const;
void AddRow(BRow*, BRow *parent = 0);
void AddRow(BRow*, int32 index, BRow *parent = 0);
void ScrollTo(const BRow* Row);
// Does not delete row or children at this time.
// todo: Make delete row and children
void RemoveRow(BRow*);
void UpdateRow(BRow*);
void Clear();
// Appearance (DEPRECATED)
void GetFont(BFont* font) const {BView::GetFont(font);}
virtual void SetFont(const BFont *font, uint32 mask = B_FONT_ALL);
virtual void SetHighColor(rgb_color);
void SetSelectionColor(rgb_color);
void SetBackgroundColor(rgb_color);
void SetEditColor(rgb_color);
const rgb_color SelectionColor() const;
const rgb_color BackgroundColor() const;
const rgb_color EditColor() const;
// Appearance (NEW STYLE)
void SetColor(ColumnListViewColor color_num, rgb_color color);
void SetFont(ColumnListViewFont font_num, const BFont* font, uint32 mask = B_FONT_ALL);
rgb_color Color(ColumnListViewColor color_num) const;
void GetFont(ColumnListViewFont font_num, BFont* font) const;
BPoint SuggestTextPosition(const BRow* row, const BColumn* column=NULL) const;
void SetLatchWidth(float width);
float LatchWidth() const;
virtual void DrawLatch(BView*, BRect, LatchType, BRow*);
virtual void MakeFocus(bool isfocus = true);
void SaveState(BMessage *msg);
void LoadState(BMessage *msg);
BView* ScrollView() const { return (BView *)fOutlineView; }
void SetEditMode(bool state);
void Refresh();
protected:
virtual void MessageReceived(BMessage *message);
virtual void KeyDown(const char *bytes, int32 numBytes);
virtual void AttachedToWindow();
virtual void WindowActivated(bool active);
virtual void Draw(BRect);
private:
rgb_color fColorList[B_COLOR_TOTAL];
BPrivate::TitleView* fTitleView;
BPrivate::OutlineView* fOutlineView;
BList fColumns;
BScrollBar* fHorizontalScrollBar;
BScrollBar* fVerticalScrollBar;
BList fSortColumns;
BView* fStatusView;
BMessage* fSelectionMessage;
bool fSortingEnabled;
float fLatchWidth;
border_style fBorderStyle;
};
#endif
@@ -1,12 +0,0 @@
#ifndef __MENU_PRIVATE_H
#define __MENU_PRIVATE_H
enum menu_actions {
MENU_ACT_NONE = 0,
MENU_ACT_CLOSE = 5
};
#endif // __MENU_PRIVATE_H
@@ -1,47 +0,0 @@
//------------------------------------------------------------------------------
// Copyright (c) 2003-2004, Haiku, Inc.
//
// 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: MenuWindow.h
// Authors: Marc Flerackers ([email protected])
// Stefano Ceccherini ([email protected])
// Description: BMenuWindow is the custom BWindow for menus.
//------------------------------------------------------------------------------
#ifndef __MENUWINDOW_H
#define __MENUWINDOW_H
#include <Window.h>
class BMenu;
class BMenuScroller;
class BMenuWindow : public BWindow {
public:
BMenuWindow(const char *name);
virtual ~BMenuWindow();
void UpdateScrollers();
private:
BMenuScroller *fUpperScroller;
BMenuScroller *fLowerScroller;
};
#endif
@@ -1,213 +0,0 @@
#ifndef _PICTUREPROTOCOL_H
#define _PICTUREPROTOCOL_H
// BView dirty bits
enum {
B_PEN_SIZE_BIT = 0x00000001,
B_PEN_LOCATION_BIT = 0x00000002,
B_HIGH_COLOR_BIT = 0x00000004,
B_LOW_COLOR_BIT = 0x00000008,
B_DRAW_MODE_BIT = 0x00000010,
B_LINE_MODE_BIT = 0x00000020,
B_ORIGIN_BIT = 0x00000040,
B_FONT_BIT = 0x00000080,
B_PATTERN_BIT = 0x00000100,
B_BLEND_MODE_BIT = 0x00000200
};
// AppServer protocol
enum {
// Picture instructions
B_PIC_MOVE_PEN_BY = 0x0010,
B_PIC_STROKE_LINE = 0x0100,
B_PIC_STROKE_RECT = 0x0101,
B_PIC_FILL_RECT = 0x0102,
B_PIC_STROKE_ROUND_RECT = 0x0103,
B_PIC_FILL_ROUND_RECT = 0x0104,
B_PIC_STROKE_BEZIER = 0x0105,
B_PIC_FILL_BEZIER = 0x0106,
B_PIC_STROKE_POLYGON = 0x010B,
B_PIC_FILL_POLYGON = 0x010C,
B_PIC_STROKE_SHAPE = 0x010D,
B_PIC_FILL_SHAPE = 0x010E,
B_PIC_DRAW_STRING = 0x010F,
B_PIC_DRAW_PIXELS = 0x0110,
B_PIC_DRAW_PICTURE = 0x0112,
B_PIC_STROKE_ARC = 0x0113,
B_PIC_FILL_ARC = 0x0114,
B_PIC_STROKE_ELLIPSE = 0x0115,
B_PIC_FILL_ELLIPSE = 0x0116,
B_PIC_ENTER_STATE_CHANGE = 0x0200,
B_PIC_SET_CLIPPING_RECTS = 0x0201,
B_PIC_CLIP_TO_PICTURE = 0x0202,
B_PIC_PUSH_STATE = 0x0203,
B_PIC_POP_STATE = 0x0204,
B_PIC_CLEAR_CLIPPING_RECTS = 0x0205,
B_PIC_SET_ORIGIN = 0x0300,
B_PIC_SET_PEN_LOCATION = 0x0301,
B_PIC_SET_DRAWING_MODE = 0x0302,
B_PIC_SET_LINE_MODE = 0x0303,
B_PIC_SET_PEN_SIZE = 0x0304,
B_PIC_SET_SCALE = 0x0305,
B_PIC_SET_FORE_COLOR = 0x0306,
B_PIC_SET_BACK_COLOR = 0x0307,
B_PIC_SET_STIPLE_PATTERN = 0x0308,
B_PIC_ENTER_FONT_STATE = 0x0309,
B_PIC_SET_BLENDING_MODE = 0x030A,
B_PIC_SET_FONT_FAMILY = 0x0380,
B_PIC_SET_FONT_STYLE = 0x0381,
B_PIC_SET_FONT_SPACING = 0x0382,
B_PIC_SET_FONT_ENCODING = 0x0383,
B_PIC_SET_FONT_FLAGS = 0x0384,
B_PIC_SET_FONT_SIZE = 0x0385,
B_PIC_SET_FONT_ROTATE = 0x0386,
B_PIC_SET_FONT_SHEAR = 0x0387,
B_PIC_SET_FONT_BPP = 0x0388,
B_PIC_SET_FONT_FACE = 0x0389,
// View instructions
B_VIEW_CREATE = 0x0500,
B_VIEW_MOVE_BY = 0x0501,
// B_VIEW_MOVE_TO = 0x0502, // ????
B_VIEW_RESIZE_BY = 0x0503,
B_VIEW_RESIZE_TO = 0x0504,
B_VIEW_DELETE = 0x0505,
B_VIEW_FIND = 0x0506,
B_VIEW_BOUNDS = 0x0507, // ????
B_VIEW_SET_FLAGS = 0x0508,
B_VIEW_SET_EVENT_MASK = 0x0509,
B_VIEW_SET_MOUSE_EVENT_MASK = 0x050A,
B_VIEW_MOVE_TO = 0x050B, // ????
B_VIEW_SET_VIEW_CURSOR = 0x050C,
// Window instructions
// B_WINDOW_MOVE_BY = 0x0580,
// B_WINDOW_MOVE_TO = 0x0581,
B_WINDOW_RESIZE_BY = 0x0582,
B_WINDOW_RESIZE_TO = 0x0583,
B_WINDOW_ACTIVATE = 0x0584,
B_WINDOW_SET_OWNER = 0x0585,
B_WINDOW_SET_TITLE = 0x0587,
B_WINDOW_IS_FRONT = 0x0589,
B_WINDOW_HIDE = 0x058C,
B_WINDOW_SHOW = 0x058D,
B_WINDOW_SET_SIZE_LIMITS = 0x058E,
B_WINDOW_IS_ACTIVE = 0x058F,
// B_WINDOW_MINIMIZE = 0x0590, // ????
B_WINDOW_MINIMIZE = 0x0591,
B_WINDOW_SET_FLAGS = 0x0593,
B_WINDOW_SEND_BEHIND = 0x0594,
B_WINDOW_ADD_TO_SUBSET = 0x0595,
B_WINDOW_REMOVE_FROM_SUBSET = 0x0596,
B_WINDOW_SET_WINDOW_ALLIGNMENT = 0x0597,
B_WINDOW_GET_WINDOW_ALLIGNMENT = 0x0598,
B_WINDOW_SET_CURRENT_VIEW = 0x059A,
// Drawing instructions
B_MOVE_PEN_TO = 0x0600,
B_MOVE_PEN_BY = 0x0601,
B_STROKE_LINE = 0x0602,
B_STROKE_LINE_TO = 0x0603,
B_STROKE_RECT = 0x0604,
B_FILL_RECT = 0x0605,
B_STROKE_ARC_RECT = 0x0606,
B_FILL_ARC_RECT = 0x0607,
B_STROKE_ARC = 0x0608,
B_FILL_ARC = 0x0609,
B_STROKE_ROUND_RECT = 0x060A,
B_FILL_ROUND_RECT = 0x060B,
B_FILL_REGION = 0x060D,
B_STROKE_POLYGON = 0x060E,
B_FILL_POLYGON = 0x060F,
B_STROKE_BEZIER = 0x0610,
B_FILL_BEZIER = 0x0611,
B_STROKE_ELLIPSE_RECT = 0x0612,
B_FILL_ELLIPSE_RECT = 0x0613,
B_STROKE_ELLIPSE = 0x0614,
B_FILL_ELLIPSE = 0x0615,
B_DRAW_BITMAP = 0x0616,
B_STRETCH_BITMAP = 0x0617,
B_STRETCH_BITMAP_SRC = 0x0618,
B_DRAW_BITMAP_ASYNC = 0x0619,
B_STRETCH_BITMAP_ASYNC = 0x061A,
B_STRETCH_BITMAP_SRC_ASYNC = 0x061B,
B_DRAW_STRING = 0x061C, // ????
B_COPY_BITS = 0x061D,
B_INVERT_RECT = 0x061E,
B_DRAW_LINES = 0x061F,
B_DRAW_PICTURE = 0x0620,
B_STROKE_SHAPE = 0x0621,
B_FILL_SHAPE = 0x0622,
// Set instructions
B_SET_DRAWING_MODE = 0x0700,
B_SCROLL_TO = 0x0701,
B_SET_PEN_SIZE = 0x0702,
B_SET_VIEW_COLOR = 0x0703,
B_SET_LINE_MODE = 0x0704,
B_SET_FONT = 0x0705,
B_SET_FORE_COLOR = 0x0706,
B_SET_BACK_COLOR = 0x0707,
B_CLEAR_CLIPPING_REGION = 0x0708,
B_SET_CLIPPING_REGION = 0x0709,
B_SET_SCALE = 0x070A,
B_SET_ORIGIN = 0x070B,
B_PUSH_STATE = 0x070C,
B_POP_STATE = 0x070D,
B_SET_PATTERN = 0x070E,
B_SET_VIEW_BITMAP = 0x070F, // ????
B_FORCE_FONT_ANTIALIASING = 0x0710,
B_CLIP_TO_PICTURE = 0x0711,
B_SET_BLENDING_MODE = 0x0712,
// Get instructions
B_PEN_SIZE = 0x0780,
B_FORE_COLOR = 0x0781,
B_BACK_COLOR = 0x0782,
B_PEN_LOCATION = 0x0783,
// B_FRAME = 0x0784, // ????
B_DRAWING_MODE = 0x0785,
B_CLIPPING_REGION = 0x0786,
B_LINE_CAP_MODE = 0x0787,
B_LINE_JOIN_MODE = 0x0788,
B_LINE_MITER_LIMIT = 0x0789,
// B_ORIGIN = 0x078A,
B_BLENDING_MODE = 0x078B,
B_FONT = 0x078C,
B_FRAME = 0x078D,
// Misc instructions
B_CONVERT_TO = 0x0832,
B_CONVERT_FROM = 0x0833,
B_INVALIDATE_RECT = 0x0840,
B_DISABLE_UPDATES = 0x0841,
B_ENABLES_UPDATES = 0x0842,
//???? = 0x0845,
B_BEGIN_VIEW_TRANSACTION = 0x0846,
B_END_VIEW_TRANSACTION = 0x0847,
B_BEGIN_PICTURE = 0x0850,
B_APPEND_TO_PICTURE = 0x0851,
B_END_PICTURE = 0x0852,
B_GET_WORKSPACES = 0x0860,
B_SET_WORKSPACES = 0x0861,
// This is necessary because B_SHOW_CURSOR is defined in Accelerant.h
B_BPIC_SHOW_CURSOR = 0x0ECD,
B_HIDE_CURSOR = 0x0ECE,
B_OBSCURE_CURSOR = 0x0ECF,
B_IS_CURSOR_HIDDEN = 0x0EDA,
B_SET_CURSOR = 0x0F10,
};
#endif
@@ -1,96 +0,0 @@
//------------------------------------------------------------------------------
// Copyright (c) 2002-2005, Haiku
//
// 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: PrivateScreen.h
// Author: Stefano Ceccherini ([email protected])
// Description: BPrivateScreen is the class which does the real work
// for the proxy class BScreen (it interacts with the app server).
//------------------------------------------------------------------------------
#ifndef __PRIVATESCREEN_H
#define __PRIVATESCREEN_H
#include <Accelerant.h>
#include <GraphicsDefs.h>
struct screen_desc;
class BApplication;
class BWindow;
class BPrivateScreen {
// Constructor and destructor are private. Use the static methods
// CheckOut() and Return() instead.
public:
static BPrivateScreen* CheckOut(BWindow *win);
static BPrivateScreen* CheckOut(screen_id id);
static void Return(BPrivateScreen *screen);
status_t SetToNext();
color_space ColorSpace();
BRect Frame();
screen_id ID();
status_t WaitForRetrace(bigtime_t timeout);
uint8 IndexForColor(uint8 red, uint8 green, uint8 blue, uint8 alpha);
rgb_color ColorForIndex(const uint8 index);
uint8 InvertIndex(uint8 index);
const color_map *ColorMap();
status_t GetBitmap(BBitmap **bitmap, bool drawCursor, BRect *bound);
status_t ReadBitmap(BBitmap *bitmap, bool drawCursor, BRect *bound);
rgb_color DesktopColor(uint32 index);
void SetDesktopColor(rgb_color, uint32, bool);
status_t ProposeMode(display_mode *target, const display_mode *low, const display_mode *high);
status_t GetModeList(display_mode **mode_list, uint32 *count);
status_t GetMode(uint32 workspace, display_mode *mode);
status_t SetMode(uint32 workspace, display_mode *mode, bool makeDefault);
status_t GetDeviceInfo(accelerant_device_info *info);
status_t GetPixelClockLimits(display_mode *mode, uint32 *low, uint32 *high);
status_t GetTimingConstraints(display_timing_constraints *dtc);
status_t SetDPMS(uint32 dpmsState);
uint32 DPMSState();
uint32 DPMSCapabilites();
void* BaseAddress();
uint32 BytesPerRow();
status_t get_screen_desc(screen_desc *desc);
private:
color_map *fColorMap;
sem_id fRetraceSem;
bool fOwnsColorMap;
sem_id RetraceSemaphore();
BPrivateScreen();
~BPrivateScreen();
};
#endif // __PRIVATESCREEN_H
@@ -1,21 +0,0 @@
// TODO: This file is here just to be able to use BDirectWindow
// with BeOS R5. Remove it when we don't need it anymore
#ifndef _APP_SERVER_LINK_H
#define _APP_SERVER_LINK_H
#include <BeBuild.h>
#include <SupportDefs.h>
#include <OS.h>
#include <R5_Session.h>
class _BAppServerLink_ {
public:
_BAppServerLink_();
virtual ~_BAppServerLink_();
_BSession_ *fSession;
};
#endif
@@ -1,69 +0,0 @@
// TODO: This file is here just to be able to use BDirectWindow
// with BeOS R5. Remove it when we don't need it anymore
#ifndef _SESSION_H
#define _SESSION_H
#include <BeBuild.h>
#include <SupportDefs.h>
#include <Region.h>
#include <Rect.h>
#include <OS.h>
class _BSession_ {
public:
_BSession_(port_id receivePort, port_id sendPort);
_BSession_(int32, char *);
virtual ~_BSession_();
char *sread();
void sread_coo(float *coo);
void sread_coo_a(float *coo);
void sread_point(BPoint *point);
void sread_point_a(BPoint *point);
void sread_rect(clipping_rect *rect);
void sread_rect(BRect *rect);
void sread_rect_a(BRect *rect);
void sread(int32 size, void *data);
void sread2(int32 size, void *data);
void sreadd(int32 size, void *data);
void swrite_s(int16 s);
void swrite_l(int32 l);
void swrite(char *string);
void swrite_point(const BPoint *point);
void swrite_point_a(const BPoint *point);
void swrite_coo(float *coo);
void swrite_coo_a(float *coo);
void swrite_rect(const clipping_rect *rect);
void swrite_rect(const BRect *rect);
void swrite_rect_a(const BRect *rect);
void swrite(int32 size, void *data);
// void get_other(message *);
// void add_to_buffer(message *);
void recv_buffer();
void send_buffer();
void sync();
void sync_debug();
void sclose();
void xclose();
private:
port_id fSendPort;
port_id fReceivePort;
char *fSendBuffer;
int32 fSendBufferSize;
int32 fSendSize;
char *fReceiveBuffer;
int32 fReceiveSize;
int32 fReceivePos;
};
extern _IMPEXP_BE _BSession_ *main_session;
#endif
-118
View File
@@ -1,118 +0,0 @@
//------------------------------------------------------------------------------
// 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: TPicture.h
// Author: Marc Flerackers ([email protected])
// Description: TPicture is used to create and play picture data.
//------------------------------------------------------------------------------
#ifndef _TPICTURE_H
#define _TPICTURE_H
// Standard Includes -----------------------------------------------------------
// System Includes -------------------------------------------------------------
#include <GraphicsDefs.h>
#include <Point.h>
#include <Rect.h>
#include <DataIO.h>
// Project Includes ------------------------------------------------------------
// Local Includes --------------------------------------------------------------
// Local Defines ---------------------------------------------------------------
// Globals ---------------------------------------------------------------------
// TPicture class --------------------------------------------------------------
class TPicture {
public:
TPicture();
TPicture(void *data, int32 size, BList &pictures);
virtual ~TPicture();
int16 GetOp();
bool GetBool();
int16 GetInt8();
int16 GetInt16();
int32 GetInt32();
int64 GetInt64();
float GetFloat();
BPoint GetCoord();
BRect GetRect();
rgb_color GetColor();
//void GetString(char *);
void *GetData(int32);
void GetData(void *data, int32 size);
void AddInt8(int8);
void AddInt16(int16);
void AddInt32(int32);
void AddInt64(int64);
void AddFloat(float);
void AddCoord(BPoint);
void AddRect(BRect);
void AddColor(rgb_color);
void AddString(char *);
void AddData(void *data, int32 size);
// SwapOp();
// SwapInt8();
// SwapInt16();
// SwapInt32();
// SwapInt64();
// SwapFloat();
// SwapCoord();
// SwapRect();
// SwapIRect();
// SwapColor();
// SwapString();
// Swap();
// CheckPattern();
void BeginOp(int32);
void EndOp();
void EnterStateChange();
void ExitStateChange();
void EnterFontChange();
void ExitFontChange();
status_t Play(void **callBackTable, int32 tableEntries,
void *userData);
status_t Rewind();
private:
BMemoryIO fData;
int32 fSize;
BList &fPictures;
};
//------------------------------------------------------------------------------
//status_t do_playback(void *, long, BArray<BPicture *> &, void **, long, void *)
#endif // _TPICTURE_H
@@ -1,90 +0,0 @@
//------------------------------------------------------------------------------
// 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: TextInput.h
// Author: Frans van Nispen ([email protected])
// Description: The BTextView derivative owned by an instance of
// BTextControl.
//------------------------------------------------------------------------------
#ifndef _TEXT_CONTROLI_H
#define _TEXT_CONTROLI_H
// Standard Includes -----------------------------------------------------------
// System Includes -------------------------------------------------------------
#include <TextView.h>
// Project Includes ------------------------------------------------------------
// Local Includes --------------------------------------------------------------
// Local Defines ---------------------------------------------------------------
// Globals ---------------------------------------------------------------------
class BTextControl;
// _BTextInput_ class ----------------------------------------------------------
class _BTextInput_ : public BTextView {
public:
_BTextInput_(BRect frame, BRect textRect,
uint32 resizeMask,
uint32 flags = B_WILL_DRAW | B_PULSE_NEEDED);
_BTextInput_(BMessage *data);
~_BTextInput_();
static BArchivable* Instantiate(BMessage *data);
virtual status_t Archive(BMessage *data, bool deep = true) const;
virtual void FrameResized(float width, float height);
virtual void KeyDown(const char *bytes, int32 numBytes);
virtual void MakeFocus(bool focusState = true);
void AlignTextRect();
void SetInitialText();
virtual void Paste(BClipboard *clipboard);
protected:
virtual void InsertText(const char *inText, int32 inLength,
int32 inOffset, const text_run_array *inRuns);
virtual void DeleteText(int32 fromOffset, int32 toOffset);
private:
BTextControl *TextControl();
char *fPreviousText;
bool fBool;
};
//------------------------------------------------------------------------------
#endif // _TEXT_CONTROLI_H
/*
* $Log $
*
* $Id $
*
*/
@@ -1,145 +0,0 @@
//------------------------------------------------------------------------------
// Copyright (c) 2001-2004, Haiku, Inc.
//
// 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: TextViewSupportBuffer.h
// Authors Marc Flerackers ([email protected])
// Stefano Ceccherini ([email protected])
// Description: Template class used to implement the various BTextView
// buffer classes.
//------------------------------------------------------------------------------
#ifndef __TEXT_VIEW_SUPPORT_BUFFER__H__
#define __TEXT_VIEW_SUPPORT_BUFFER__H__
#include <cstdlib>
#include <cstring>
#include <OS.h>
#include <SupportDefs.h>
// _BTextViewSupportBuffer_ class ----------------------------------------------
template <class T>
class _BTextViewSupportBuffer_ {
public:
_BTextViewSupportBuffer_(int32 inExtraCount = 0, int32 inCount = 0);
virtual ~_BTextViewSupportBuffer_();
void InsertItemsAt(int32 inNumItems, int32 inAtIndex, const T *inItem);
void RemoveItemsAt(int32 inNumItems, int32 inAtIndex);
int32 ItemCount() const;
protected:
int32 fExtraCount;
int32 fItemCount;
int32 fBufferCount;
T* fBuffer;
};
template <class T>
_BTextViewSupportBuffer_<T>::_BTextViewSupportBuffer_(int32 inExtraCount,
int32 inCount)
: fExtraCount(inExtraCount),
fItemCount(inCount),
fBufferCount(fExtraCount + fItemCount),
fBuffer(NULL)
{
fBuffer = (T *)calloc(fExtraCount + fItemCount, sizeof(T));
}
template <class T>
_BTextViewSupportBuffer_<T>::~_BTextViewSupportBuffer_()
{
free(fBuffer);
}
template <class T>
void
_BTextViewSupportBuffer_<T>::InsertItemsAt(int32 inNumItems,
int32 inAtIndex,
const T *inItem)
{
if (inNumItems < 1)
return;
inAtIndex = (inAtIndex > fItemCount) ? fItemCount : inAtIndex;
inAtIndex = (inAtIndex < 0) ? 0 : inAtIndex;
int32 delta = inNumItems * sizeof(T);
int32 logSize = fItemCount * sizeof(T);
if ((logSize + delta) >= fBufferCount) {
fBufferCount = logSize + delta + (fExtraCount * sizeof(T));
fBuffer = (T *)realloc(fBuffer, fBufferCount);
if (fBuffer == NULL)
debugger("InsertItemsAt(): reallocation failed");
}
T *loc = fBuffer + inAtIndex;
memmove(loc + inNumItems, loc, (fItemCount - inAtIndex) * sizeof(T));
memcpy(loc, inItem, delta);
fItemCount += inNumItems;
}
template <class T>
void
_BTextViewSupportBuffer_<T>::RemoveItemsAt(int32 inNumItems,
int32 inAtIndex)
{
if (inNumItems < 1)
return;
inAtIndex = (inAtIndex > fItemCount - 1) ? (fItemCount - 1) : inAtIndex;
inAtIndex = (inAtIndex < 0) ? 0 : inAtIndex;
T *loc = fBuffer + inAtIndex;
memmove(loc, loc + inNumItems,
(fItemCount - (inNumItems + inAtIndex)) * sizeof(T));
int32 delta = inNumItems * sizeof(T);
int32 logSize = fItemCount * sizeof(T);
uint32 extraSize = fBufferCount - (logSize - delta);
if (extraSize > (fExtraCount * sizeof(T))) {
fBufferCount = (logSize - delta) + (fExtraCount * sizeof(T));
fBuffer = (T *)realloc(fBuffer, fBufferCount);
if (fBuffer == NULL)
debugger("RemoveItemsAt(): reallocation failed");
}
fItemCount -= inNumItems;
}
template<class T>
inline int32
_BTextViewSupportBuffer_<T>::ItemCount() const
{
return fItemCount;
}
#endif // __TEXT_VIEW_SUPPORT_BUFFER__H__
-135
View File
@@ -1,135 +0,0 @@
#ifndef _VIEWAUX_H_
#define _VIEWAUX_H_
#include <BeBuild.h>
#include <Font.h>
#include <InterfaceDefs.h>
#include <Point.h>
#include <Rect.h>
#include <Region.h>
const static uint32 kDeleteDragger = 'JAHA';
struct shape_data {
uint32 *opList;
int32 opCount;
int32 opSize;
int32 opBlockSize;
BPoint *ptList;
int32 ptCount;
int32 ptSize;
int32 ptBlockSize;
};
enum {
B_VIEW_FONT_BIT = 0x00000001,
B_VIEW_HIGH_COLOR_BIT = 0x00000002,
B_VIEW_DRAWING_MODE_BIT = 0x00000004,
B_VIEW_CLIP_REGION_BIT = 0x00000008,
B_VIEW_LINE_MODES_BIT = 0x00000010,
B_VIEW_BLENDING_BIT = 0x00000020,
B_VIEW_SCALE_BIT = 0x00000040,
B_VIEW_FONT_ALIASING_BIT = 0x00000080,
B_VIEW_FRAME_BIT = 0x00000100,
B_VIEW_ORIGIN_BIT = 0x00000200,
B_VIEW_PEN_SIZE_BIT = 0x00000400,
B_VIEW_PEN_LOCATION_BIT = 0x00000800,
B_VIEW_LOW_COLOR_BIT = 0x00008000,
B_VIEW_VIEW_COLOR_BIT = 0x00010000,
B_VIEW_PATTERN_BIT = 0x00020000,
B_VIEW_ALL_BITS = 0x0003ffff,
// these used for archiving only
B_VIEW_RESIZE_BIT = 0x00001000,
B_VIEW_FLAGS_BIT = 0x00002000,
B_VIEW_EVENT_MASK_BIT = 0x00004000
};
namespace BPrivate {
class ViewState {
public:
ViewState();
inline bool IsValid(uint32 bit) const;
inline bool IsAllValid() const;
void UpdateServerFontState(BPrivate::PortLink &link);
void UpdateServerState(BPrivate::PortLink &link);
void UpdateFrom(BPrivate::PortLink &link);
public:
BPoint pen_location;
float pen_size;
rgb_color high_color;
rgb_color low_color;
// This one is not affected by pop state/push state
rgb_color view_color;
::pattern pattern;
::drawing_mode drawing_mode;
BRegion clipping_region;
BPoint origin;
// line modes
join_mode line_join;
cap_mode line_cap;
float miter_limit;
// alpha blending
source_alpha alpha_source_mode;
alpha_function alpha_function_mode;
float scale;
// fonts
BFont font;
uint16 font_flags;
bool font_aliasing;
// font aliasing. Used for printing only!
// flags used for synchronization with app_server
uint32 valid_flags;
// flags used for archiving
uint32 archiving_flags;
};
inline bool
ViewState::IsValid(uint32 bit) const
{
return valid_flags & bit;
}
inline bool
ViewState::IsAllValid() const
{
return (valid_flags & B_VIEW_ALL_BITS & ~B_VIEW_CLIP_REGION_BIT)
== (B_VIEW_ALL_BITS & ~B_VIEW_CLIP_REGION_BIT);
}
} // namespace BPrivate
struct _array_hdr_{
float startX;
float startY;
float endX;
float endY;
rgb_color color;
};
struct _array_data_{
// the max number of points in the array
uint32 maxCount;
// the current number of points in the array
uint32 count;
// the array of points
_array_hdr_* array;
};
#endif /* _VIEWAUX_H_ */
@@ -1,75 +0,0 @@
/*
* Copyright (c) 2003-2004 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: WidthBuffer.cpp
* Author: Stefano Ceccherini ([email protected])
* Description: _BWidthBuffer_ stores charachters widths in a hash table, to be able
* to retrieve them without passing through the app server.
* Used by BTextView and OpenTracker.
*/
#ifndef __WIDTHBUFFER_H
#define __WIDTHBUFFER_H
#include "TextViewSupportBuffer.h"
class BFont; // forward declaration
// TODO: enable this as soon as we are sure opentracker works
// with our libraries, since using a BFont here (as Dano does) is much better,
// as fonts can be classified also by spacing mode and other attributes.
#define USE_DANO_WIDTHBUFFER 0
struct _width_table_ {
#if USE_DANO_WIDTHBUFFER
BFont font; // corresponding font
#else
int32 fontCode; // font code
float fontSize; // font size
#endif
int32 hashCount; // number of hashed items
int32 tableCount; // size of table
void *widths; // width table
};
class _BTextGapBuffer_;
class _BWidthBuffer_ : public _BTextViewSupportBuffer_<_width_table_> {
public:
_BWidthBuffer_();
virtual ~_BWidthBuffer_();
float StringWidth(const char *inText, int32 fromOffset, int32 length,
const BFont *inStyle);
float StringWidth(_BTextGapBuffer_ &gapBuffer, int32 fromOffset, int32 length,
const BFont *inStyle);
private:
bool FindTable(const BFont *font, int32 *outIndex);
int32 InsertTable(const BFont *font);
bool GetEscapement(uint32 value, int32 index, float *escapement);
float HashEscapements(const char *chars, int32 numChars, int32 numBytes,
int32 tableIndex, const BFont *font);
static uint32 Hash(uint32);
};
#endif // __WIDTHBUFFER_H
@@ -1,69 +0,0 @@
//------------------------------------------------------------------------------
// 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: WindowAux.h
// Author: Adrian Oanca ([email protected])
// Description: BWindowAux.h contains helper definitions for BWindow class
//
//------------------------------------------------------------------------------
#ifndef _WINDOWAUX_H
#define _WINDOWAUX_H
// Standard Includes -----------------------------------------------------------
// System Includes -------------------------------------------------------------
#include <BeBuild.h>
#include <Message.h>
#include <Handler.h>
// Project Includes ------------------------------------------------------------
// Local Includes --------------------------------------------------------------
// Local Defines ---------------------------------------------------------------
// Globals ---------------------------------------------------------------------
struct _BCmdKey{
uint32 key;
uint32 modifiers;
BMessage* message;
BHandler* target;
int32 targetToken;
_BCmdKey(uint32 k, uint32 mod, BMessage* m = NULL)
: key(k),
modifiers(mod),
message(m),
target(NULL),
targetToken(B_ANY_TOKEN)
{
}
~_BCmdKey()
{
delete message;
}
};
#endif // _WINDOWAUX_H
@@ -1,45 +0,0 @@
/*
* Copyright 2005, Haiku.
* Distributed under the terms of the MIT License.
*
* Authors:
* Axel Dörfler, [email protected]
*/
#ifndef _WINDOW_INFO_H_
#define _WINDOW_INFO_H_
#include <SupportDefs.h>
struct window_info {
team_id team;
int32 server_token;
int32 thread;
int32 client_token;
int32 client_port;
uint32 workspaces;
int32 layer; // whatever this is...
uint32 feel;
uint32 flags;
int32 window_left;
int32 window_top;
int32 window_right;
int32 window_bottom;
int32 show_hide_level;
bool is_mini;
} _PACKED;
struct client_window_info : window_info {
char name[1];
} _PACKED;
enum window_action {
B_MINIMIZE_WINDOW,
B_BRING_TO_FRONT
};
#endif // _WINDOW_INFO_H_
@@ -1,32 +0,0 @@
/*
* Copyright 2005, Jérôme Duval, [email protected].
* Distributed under the terms of the MIT License.
*/
#ifndef _WINDOW_PRIVATE_H
#define _WINDOW_PRIVATE_H
#include <Window.h>
/* Private window looks */
const window_look kDesktopWindowLook = window_look(4);
const window_look kLeftTitledWindowLook = window_look(25);
/* Private window feels */
const window_feel kDesktopWindowFeel = window_feel(1024);
const window_feel kMenuWindowFeel = window_feel(1025);
const window_feel kWindowScreenFeel = window_feel(1026);
/* Private window types */
const window_type kWindowScreenWindow = window_type(1026);
/* Private window flags */
const uint32 kWorkspacesWindowFlag = 0x8000;
const uint32 kWindowScreenFlag = 0x10000;
#endif // _WINDOW_PRIVATE_H
@@ -1,54 +0,0 @@
//------------------------------------------------------------------------------
// Copyright (c) 2001-2004, Haiku
//
// 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: ZombieReplicantView.h
// Author: Marc Flerackers ([email protected])
// Description: Class for Zombie replicants
//------------------------------------------------------------------------------
#ifndef _ZOMBIE_REPLICANT_VIEW_H
#define _ZOMBIE_REPLICANT_VIEW_H
#include <BeBuild.h>
#include <Box.h>
// _BZombieReplicantView_ class ------------------------------------------------
class _BZombieReplicantView_ : public BBox {
public:
_BZombieReplicantView_(BRect frame, status_t error);
virtual ~_BZombieReplicantView_();
virtual void MessageReceived(BMessage *msg);
virtual void Draw(BRect updateRect);
virtual void MouseDown(BPoint);
void SetArchive(BMessage *);
private:
status_t fError;
BMessage *fArchive;
};
#endif /* _ZOMBIE_REPLICANT_VIEW_H */
@@ -1,36 +0,0 @@
//------------------------------------------------------------------------------
// Copyright (c) 2004, Haiku
//
// 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: input_globals.h
// Author:
// Description:
//------------------------------------------------------------------------------
#ifndef __INPUT_GLOBALS_H
#define __INPUT_GLOBALS_H
#include <SupportDefs.h>
status_t _control_input_server_(BMessage *command, BMessage *reply);
status_t _restore_key_map_();
#endif // __INPUT_GLOBALS_H
-101
View File
@@ -1,101 +0,0 @@
#ifndef __MOREUTF8
#define __MOREUTF8
#include <stdio.h>
static inline bool
IsInsideGlyph(uchar ch)
{
return (ch & 0xC0) == 0x80;
}
static inline uint32
UTF8NextCharLenUnsafe(const char *text)
{
const char *ptr = text;
do {
ptr++;
} while (IsInsideGlyph(*ptr));
return ptr - text;
}
static inline uint32
UTF8NextCharLen(const char *text)
{
if (text == NULL || *text == 0)
return 0;
return UTF8NextCharLenUnsafe(text);
}
static inline uint32
UTF8PreviousCharLen(const char *text, const char *limit)
{
const char *ptr = text;
if (ptr == NULL || limit == NULL)
return 0;
do {
if (ptr == limit)
break;
ptr--;
} while (IsInsideGlyph(*ptr));
return text - ptr;
}
// TODO: use this function in other places of this file...
static inline uint32
count_utf8_bytes(uchar ch)
{
// the number of high bits set until the first
// unset bit determine the count of bytes used for
// this glyph from this byte on
uchar bit = 1 << 7;
uint32 count = 1;
if (ch & bit) {
bit = bit >> 1;
while (ch & bit) {
count++;
bit = bit >> 1;
}
}
return count;
}
static inline uint32
UTF8CountBytes(const char *text, uint32 numChars)
{
if (text) {
// iterate over numChars glyphs incrementing ptr by the
// number of bytes for each glyph, which is encoded in
// the first byte of any glyph.
const char *ptr = text;
while (numChars--) {
ptr += count_utf8_bytes(*ptr);
}
return ptr - text;
}
return 0;
}
static inline uint32
UTF8CountChars(const char *text, int32 numBytes)
{
const char* ptr = text;
const char* last = ptr + numBytes - 1;
uint32 count = 0;
while (ptr <= last) {
ptr += UTF8NextCharLen(ptr);
count++;
}
return count;
}
#endif
@@ -1,97 +0,0 @@
/*****************************************************************************/
// print_server Background Application.
//
// Version: 1.0.0d1
//
// The print_server manages the communication between applications and the
// printer and transport drivers.
//
//
// This application and all source files used in its construction, except
// where noted, are licensed under the MIT License, and have been written
// and are:
//
// Copyright (c) 2001 OpenBeOS Project
//
// 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.
/*****************************************************************************/
#ifndef _PR_SERVER_H_
#define _PR_SERVER_H_
// signature mime types
#define PSRV_SIGNATURE_TYPE "application/x-vnd.Be-PSRV"
#define PRNT_SIGNATURE_TYPE "application/x-vnd.Be-PRNT"
// messages understood by print_server
#define PSRV_GET_ACTIVE_PRINTER 'pgcp'
#define PSRV_MAKE_PRINTER_ACTIVE_QUIETLY 'pmaq'
#define PSRV_MAKE_PRINTER_ACTIVE 'pmac'
#define PSRV_MAKE_PRINTER 'selp'
#define PSRV_SHOW_PAGE_SETUP 'pgst'
#define PSRV_SHOW_PRINT_SETUP 'ppst'
#define PSRV_PRINT_SPOOLED_JOB 'psns'
#define PSRV_GET_DEFAULT_SETTINGS 'pdef'
// mime file types
#define PSRV_PRINTER_FILETYPE "application/x-vnd.Be.printer"
#define PSRV_SPOOL_FILETYPE "application/x-vnd.Be.printer-spool"
// spool Attributes
#define PSRV_SPOOL_ATTR_MIMETYPE "_spool/MimeType"
#define PSRV_SPOOL_ATTR_PAGECOUNT "_spool/Page Count"
#define PSRV_SPOOL_ATTR_DESCRIPTION "_spool/Description"
#define PSRV_SPOOL_ATTR_PRINTER "_spool/Printer"
#define PSRV_SPOOL_ATTR_STATUS "_spool/Status"
#define PSRV_SPOOL_ATTR_ERRCODE "_spool/_errorcode"
// spool file status attribute values
#define PSRV_JOB_STATUS_ ""
#define PSRV_JOB_STATUS_WAITING "Waiting"
#define PSRV_JOB_STATUS_PROCESSING "Processing"
#define PSRV_JOB_STATUS_FAILED "Failed"
#define PSRV_JOB_STATUS_COMPLETED "Completed"
// printer attributes
#define PSRV_PRINTER_ATTR_DRV_NAME "Driver Name"
#define PSRV_PRINTER_ATTR_PRT_NAME "Printer Name"
#define PSRV_PRINTER_ATTR_COMMENTS "Comments"
#define PSRV_PRINTER_ATTR_STATE "state"
#define PSRV_PRINTER_ATTR_TRANSPORT "transport"
#define PSRV_PRINTER_ATTR_TRANSPORT_ADDR "transport_address"
#define PSRV_PRINTER_ATTR_CNX "connection"
#define PSRV_PRINTER_ATTR_PNP "_PNP"
#define PSRV_PRINTER_ATTR_MDL "_MDL"
// job settings fields
#define PSRV_FIELD_CURRENT_PRINTER "current_printer"
#define PSRV_FIELD_XRES "xres"
#define PSRV_FIELD_YRES "yres"
#define PSRV_FIELD_PAPER_RECT "paper_rect"
#define PSRV_FIELD_PRINTABLE_RECT "printable_rect"
#define PSRV_FIELD_FIRST_PAGE "first_page"
#define PSRV_FIELD_LAST_PAGE "last_page"
// optional job settings field
#define PSRV_FIELD_ORIENTATION "orientation"
#define PSRV_FIELD_COPIES "copies"
#define PSRV_FIELD_SCALE "scale"
#define PSRV_FIELD_QUALITY "quality"
#endif
@@ -1,22 +0,0 @@
/*
* Copyright 2005, Stephan Aßmus <[email protected]>. All rights reserved.
* Distributed under the terms of the MIT License.
*
* a helper function to truncate strings
*
*/
#ifndef TRUNCATE_STRING_H
#define TRUNCATE_STRING_H
#include <SupportDefs.h>
// truncated_string
void
truncate_string(const char* string,
uint32 mode, float width, char* result,
const float* escapementArray, float fontSize,
float ellipsisWidth, int32 length, int32 numChars);
#endif // STRING_TRUNCATION_H