Merge branch 'master' into sam460ex
This commit is contained in:
commit
c4a2fb4bd7
2
3rdparty/mmu_man/scripts/dev-perso
vendored
2
3rdparty/mmu_man/scripts/dev-perso
vendored
@ -164,7 +164,7 @@ dev() {
|
||||
test -n "$DEVUPCMD" && history -s "$DEVUPCMD"
|
||||
|
||||
# spice up terminal window title for git, add current branch name
|
||||
test -d .git && PROMPT_COMMAND='echo -en "\033]0;['$DEVPROJ':`git branch | sed "/^[^*]/d;s/^\*\s//"`:${PWD##*/}]\a"'
|
||||
test -d .git && PROMPT_COMMAND='echo -en "\033]0;['$DEVPROJ':`git branch 2>/dev/null | sed "/^[^*]/d;s/^\*\s//"`:${PWD##*/}]\a"'
|
||||
}
|
||||
|
||||
complete -W complete -W "$(dev)" dev
|
||||
|
@ -658,21 +658,21 @@ if [ IsOptionalHaikuImagePackageAdded DevelopmentBase ]
|
||||
# gcc and binutils
|
||||
if $(HAIKU_GCC_VERSION[1]) = 2 || $(isHybridBuild) {
|
||||
InstallOptionalHaikuImagePackage
|
||||
gcc-2.95.3-r1a4-x86-gcc2-2012-10-12.zip
|
||||
: $(baseURL)/gcc-2.95.3-r1a4-x86-gcc2-2012-10-12.zip ;
|
||||
gcc-2.95.3-r1a4-x86-gcc2-2012-11-01.zip
|
||||
: $(baseURL)/gcc-2.95.3-r1a4-x86-gcc2-2012-11-01.zip ;
|
||||
}
|
||||
|
||||
if $(HAIKU_GCC_VERSION[1]) = 2 {
|
||||
# symlink to the appropriate system/lib[/gcc2] folder
|
||||
AddSymlinkToHaikuHybridImage
|
||||
develop abi x86 gcc2 tools gcc-2.95.3-haiku-121012 lib
|
||||
develop abi x86 gcc2 tools gcc-2.95.3-haiku-121101 lib
|
||||
: /system/lib libstdc++.r4.so : : true ;
|
||||
}
|
||||
|
||||
if $(HAIKU_GCC_VERSION[1]) = 4 || $(isHybridBuild) {
|
||||
InstallOptionalHaikuImagePackage
|
||||
gcc-4.6.3-r1a4-x86-gcc4-2012-10-18.zip
|
||||
: $(baseURL)/gcc-4.6.3-r1a4-x86-gcc4-2012-10-18.zip ;
|
||||
gcc-4.6.3-r1a4-x86-gcc4-2012-11-01.zip
|
||||
: $(baseURL)/gcc-4.6.3-r1a4-x86-gcc4-2012-11-01.zip ;
|
||||
}
|
||||
|
||||
if $(HAIKU_GCC_VERSION[1]) = 4 {
|
||||
@ -684,7 +684,7 @@ if [ IsOptionalHaikuImagePackageAdded DevelopmentBase ]
|
||||
local libs = libstdc++.so libsupc++.so ;
|
||||
for lib in $(libs) {
|
||||
AddSymlinkToHaikuHybridImage
|
||||
develop abi x86 gcc4 tools gcc-4.6.3-haiku-121018 lib
|
||||
develop abi x86 gcc4 tools gcc-4.6.3-haiku-121101 lib
|
||||
: /system/lib $(lib) : : true ;
|
||||
}
|
||||
}
|
||||
@ -1651,8 +1651,8 @@ if [ IsOptionalHaikuImagePackageAdded Puri ] {
|
||||
Echo "No optional package Puri for gcc2" ;
|
||||
} else {
|
||||
InstallOptionalHaikuImagePackage
|
||||
puri-0.3.9.1-r1a4-x86-gcc4-2012-08-31.zip
|
||||
: $(baseURL)/puri-0.3.9.1-r1a4-x86-gcc4-2012-08-31.zip ;
|
||||
puri-0.3.9.1-x86-gcc4-2012-11-01.zip
|
||||
: $(baseURL)/puri-0.3.9.1-x86-gcc4-2012-11-01.zip ;
|
||||
AddSymlinkToHaikuImage home config settings deskbar Applications
|
||||
: /boot/apps/Puri/Puri ;
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2005-2010, Haiku Inc. All Rights Reserved.
|
||||
* Copyright 2005-2012, Haiku Inc. All Rights Reserved.
|
||||
* Distributed under the terms of the MIT License.
|
||||
*
|
||||
* Authors:
|
||||
@ -9,6 +9,8 @@
|
||||
#define _MESSAGE_H
|
||||
|
||||
|
||||
#include <new>
|
||||
|
||||
#include <BeBuild.h>
|
||||
#include <DataIO.h>
|
||||
#include <Flattenable.h>
|
||||
@ -19,6 +21,7 @@
|
||||
#include <AppDefs.h> /* For convenience */
|
||||
#include <TypeConstants.h> /* For convenience */
|
||||
|
||||
|
||||
class BAlignment;
|
||||
class BBlockCache;
|
||||
class BMessenger;
|
||||
@ -45,341 +48,432 @@ enum {
|
||||
// app-defined specifiers start at B_SPECIFIERS_END + 1
|
||||
};
|
||||
|
||||
|
||||
class BMessage {
|
||||
public:
|
||||
uint32 what;
|
||||
public:
|
||||
uint32 what;
|
||||
|
||||
BMessage();
|
||||
BMessage(uint32 what);
|
||||
BMessage(const BMessage &other);
|
||||
virtual ~BMessage();
|
||||
BMessage();
|
||||
BMessage(uint32 what);
|
||||
BMessage(const BMessage& other);
|
||||
virtual ~BMessage();
|
||||
|
||||
BMessage &operator=(const BMessage &other);
|
||||
BMessage& operator=(const BMessage& other);
|
||||
|
||||
// Statistics and misc info
|
||||
status_t GetInfo(type_code typeRequested, int32 index,
|
||||
char **nameFound, type_code *typeFound,
|
||||
int32 *countFound = NULL) const;
|
||||
status_t GetInfo(const char *name, type_code *typeFound,
|
||||
int32 *countFound = NULL) const;
|
||||
status_t GetInfo(const char *name, type_code *typeFound,
|
||||
bool *fixedSize) const;
|
||||
status_t GetInfo(const char *name, type_code *typeFound,
|
||||
int32 *countFound, bool *fixedSize) const;
|
||||
// Statistics and misc info
|
||||
status_t GetInfo(type_code typeRequested, int32 index,
|
||||
char** nameFound, type_code* typeFound,
|
||||
int32* countFound = NULL) const;
|
||||
status_t GetInfo(const char* name, type_code* typeFound,
|
||||
int32* countFound = NULL) const;
|
||||
status_t GetInfo(const char* name, type_code* typeFound,
|
||||
bool* fixedSize) const;
|
||||
status_t GetInfo(const char* name, type_code* typeFound,
|
||||
int32* countFound, bool* fixedSize) const;
|
||||
|
||||
int32 CountNames(type_code type) const;
|
||||
bool IsEmpty() const;
|
||||
bool IsSystem() const;
|
||||
bool IsReply() const;
|
||||
void PrintToStream() const;
|
||||
int32 CountNames(type_code type) const;
|
||||
bool IsEmpty() const;
|
||||
bool IsSystem() const;
|
||||
bool IsReply() const;
|
||||
void PrintToStream() const;
|
||||
|
||||
status_t Rename(const char *oldEntry, const char *newEntry);
|
||||
status_t Rename(const char* oldEntry,
|
||||
const char* newEntry);
|
||||
|
||||
// Delivery info
|
||||
bool WasDelivered() const;
|
||||
bool IsSourceWaiting() const;
|
||||
bool IsSourceRemote() const;
|
||||
BMessenger ReturnAddress() const;
|
||||
const BMessage *Previous() const;
|
||||
bool WasDropped() const;
|
||||
BPoint DropPoint(BPoint *offset = NULL) const;
|
||||
// Delivery info
|
||||
bool WasDelivered() const;
|
||||
bool IsSourceWaiting() const;
|
||||
bool IsSourceRemote() const;
|
||||
BMessenger ReturnAddress() const;
|
||||
const BMessage* Previous() const;
|
||||
bool WasDropped() const;
|
||||
BPoint DropPoint(BPoint* offset = NULL) const;
|
||||
|
||||
// Replying
|
||||
status_t SendReply(uint32 command, BHandler *replyTo = NULL);
|
||||
status_t SendReply(BMessage *reply, BHandler *replyTo = NULL,
|
||||
bigtime_t timeout = B_INFINITE_TIMEOUT);
|
||||
status_t SendReply(BMessage *reply, BMessenger replyTo,
|
||||
bigtime_t timeout = B_INFINITE_TIMEOUT);
|
||||
// Replying
|
||||
status_t SendReply(uint32 command,
|
||||
BHandler* replyTo = NULL);
|
||||
status_t SendReply(BMessage* reply,
|
||||
BHandler* replyTo = NULL,
|
||||
bigtime_t timeout = B_INFINITE_TIMEOUT);
|
||||
status_t SendReply(BMessage* reply, BMessenger replyTo,
|
||||
bigtime_t timeout = B_INFINITE_TIMEOUT);
|
||||
|
||||
status_t SendReply(uint32 command, BMessage *replyToReply);
|
||||
status_t SendReply(BMessage *the_reply, BMessage *replyToReply,
|
||||
bigtime_t sendTimeout = B_INFINITE_TIMEOUT,
|
||||
bigtime_t replyTimeout = B_INFINITE_TIMEOUT);
|
||||
status_t SendReply(uint32 command,
|
||||
BMessage* replyToReply);
|
||||
status_t SendReply(BMessage* reply,
|
||||
BMessage* replyToReply,
|
||||
bigtime_t sendTimeout = B_INFINITE_TIMEOUT,
|
||||
bigtime_t replyTimeout
|
||||
= B_INFINITE_TIMEOUT);
|
||||
|
||||
// Flattening data
|
||||
ssize_t FlattenedSize() const;
|
||||
status_t Flatten(char *buffer, ssize_t size) const;
|
||||
status_t Flatten(BDataIO *stream, ssize_t *size = NULL) const;
|
||||
status_t Unflatten(const char *flatBuffer);
|
||||
status_t Unflatten(BDataIO *stream);
|
||||
// Flattening data
|
||||
ssize_t FlattenedSize() const;
|
||||
status_t Flatten(char* buffer, ssize_t size) const;
|
||||
status_t Flatten(BDataIO* stream,
|
||||
ssize_t* size = NULL) const;
|
||||
status_t Unflatten(const char* flatBuffer);
|
||||
status_t Unflatten(BDataIO* stream);
|
||||
|
||||
// Specifiers (scripting)
|
||||
status_t AddSpecifier(const char *property);
|
||||
status_t AddSpecifier(const char *property, int32 index);
|
||||
status_t AddSpecifier(const char *property, int32 index, int32 range);
|
||||
status_t AddSpecifier(const char *property, const char *name);
|
||||
status_t AddSpecifier(const BMessage *specifier);
|
||||
// Specifiers (scripting)
|
||||
status_t AddSpecifier(const char* property);
|
||||
status_t AddSpecifier(const char* property, int32 index);
|
||||
status_t AddSpecifier(const char* property, int32 index,
|
||||
int32 range);
|
||||
status_t AddSpecifier(const char* property,
|
||||
const char* name);
|
||||
status_t AddSpecifier(const BMessage* specifier);
|
||||
|
||||
status_t SetCurrentSpecifier(int32 index);
|
||||
status_t GetCurrentSpecifier(int32 *index,
|
||||
BMessage *specifier = NULL, int32 *what = NULL,
|
||||
const char **property = NULL) const;
|
||||
bool HasSpecifiers() const;
|
||||
status_t PopSpecifier();
|
||||
status_t SetCurrentSpecifier(int32 index);
|
||||
status_t GetCurrentSpecifier(int32* index,
|
||||
BMessage* specifier = NULL,
|
||||
int32* what = NULL,
|
||||
const char** property = NULL) const;
|
||||
bool HasSpecifiers() const;
|
||||
status_t PopSpecifier();
|
||||
|
||||
// Adding data
|
||||
status_t AddAlignment(const char* name,
|
||||
const BAlignment& alignment);
|
||||
status_t AddRect(const char *name, BRect aRect);
|
||||
status_t AddPoint(const char *name, BPoint aPoint);
|
||||
status_t AddSize(const char* name, BSize aSize);
|
||||
status_t AddString(const char *name, const char *aString);
|
||||
status_t AddString(const char *name, const BString &aString);
|
||||
status_t AddInt8(const char *name, int8 value);
|
||||
status_t AddUInt8(const char *name, uint8 value);
|
||||
status_t AddInt16(const char *name, int16 value);
|
||||
status_t AddUInt16(const char *name, uint16 value);
|
||||
status_t AddInt32(const char *name, int32 value);
|
||||
status_t AddUInt32(const char *name, uint32 value);
|
||||
status_t AddInt64(const char *name, int64 value);
|
||||
status_t AddUInt64(const char *name, uint64 value);
|
||||
status_t AddBool(const char *name, bool aBoolean);
|
||||
status_t AddFloat(const char *name, float aFloat);
|
||||
status_t AddDouble(const char *name, double aDouble);
|
||||
status_t AddPointer(const char *name, const void *aPointer);
|
||||
status_t AddMessenger(const char *name, BMessenger messenger);
|
||||
status_t AddRef(const char *name, const entry_ref *ref);
|
||||
status_t AddMessage(const char *name, const BMessage *message);
|
||||
status_t AddFlat(const char *name, BFlattenable *object,
|
||||
int32 count = 1);
|
||||
status_t AddData(const char *name, type_code type,
|
||||
const void *data, ssize_t numBytes,
|
||||
bool isFixedSize = true, int32 count = 1);
|
||||
// Adding data
|
||||
status_t AddAlignment(const char* name,
|
||||
const BAlignment& alignment);
|
||||
status_t AddRect(const char* name, BRect rect);
|
||||
status_t AddPoint(const char* name, BPoint point);
|
||||
status_t AddSize(const char* name, BSize size);
|
||||
status_t AddString(const char* name, const char* string);
|
||||
status_t AddString(const char* name,
|
||||
const BString& string);
|
||||
status_t AddInt8(const char* name, int8 value);
|
||||
status_t AddUInt8(const char* name, uint8 value);
|
||||
status_t AddInt16(const char* name, int16 value);
|
||||
status_t AddUInt16(const char* name, uint16 value);
|
||||
status_t AddInt32(const char* name, int32 value);
|
||||
status_t AddUInt32(const char* name, uint32 value);
|
||||
status_t AddInt64(const char* name, int64 value);
|
||||
status_t AddUInt64(const char* name, uint64 value);
|
||||
status_t AddBool(const char* name, bool value);
|
||||
status_t AddFloat(const char* name, float value);
|
||||
status_t AddDouble(const char* name, double value);
|
||||
status_t AddPointer(const char* name,
|
||||
const void* pointer);
|
||||
status_t AddMessenger(const char* name,
|
||||
BMessenger messenger);
|
||||
status_t AddRef(const char* name, const entry_ref* ref);
|
||||
status_t AddMessage(const char* name,
|
||||
const BMessage* message);
|
||||
status_t AddFlat(const char* name, BFlattenable* object,
|
||||
int32 count = 1);
|
||||
status_t AddData(const char* name, type_code type,
|
||||
const void* data, ssize_t numBytes,
|
||||
bool isFixedSize = true, int32 count = 1);
|
||||
|
||||
// Removing data
|
||||
status_t RemoveData(const char *name, int32 index = 0);
|
||||
status_t RemoveName(const char *name);
|
||||
status_t MakeEmpty();
|
||||
status_t Append(const BMessage& message);
|
||||
|
||||
// Finding data
|
||||
status_t FindAlignment(const char* name,
|
||||
BAlignment* alignment) const;
|
||||
status_t FindAlignment(const char* name, int32 index,
|
||||
BAlignment* alignment) const;
|
||||
// Removing data
|
||||
status_t RemoveData(const char* name, int32 index = 0);
|
||||
status_t RemoveName(const char* name);
|
||||
status_t MakeEmpty();
|
||||
|
||||
status_t FindRect(const char *name, BRect *rect) const;
|
||||
status_t FindRect(const char *name, int32 index, BRect *rect) const;
|
||||
status_t FindPoint(const char *name, BPoint *point) const;
|
||||
status_t FindPoint(const char *name, int32 index, BPoint *point) const;
|
||||
// Finding data
|
||||
status_t FindAlignment(const char* name,
|
||||
BAlignment* alignment) const;
|
||||
status_t FindAlignment(const char* name, int32 index,
|
||||
BAlignment* alignment) const;
|
||||
|
||||
status_t FindSize(const char *name, BSize* size) const;
|
||||
status_t FindSize(const char *name,
|
||||
int32 index, BSize* size) const;
|
||||
status_t FindRect(const char* name, BRect* rect) const;
|
||||
status_t FindRect(const char* name, int32 index,
|
||||
BRect* rect) const;
|
||||
status_t FindPoint(const char* name,
|
||||
BPoint* point) const;
|
||||
status_t FindPoint(const char* name, int32 index,
|
||||
BPoint* point) const;
|
||||
|
||||
status_t FindString(const char *name, const char **string) const;
|
||||
status_t FindString(const char *name, int32 index, const char **string) const;
|
||||
status_t FindString(const char *name, BString *string) const;
|
||||
status_t FindString(const char *name, int32 index, BString *string) const;
|
||||
status_t FindInt8(const char *name, int8 *value) const;
|
||||
status_t FindInt8(const char *name, int32 index, int8 *value) const;
|
||||
status_t FindUInt8(const char *name, uint8 *value) const;
|
||||
status_t FindUInt8(const char *name, int32 index, uint8 *value) const;
|
||||
status_t FindInt16(const char *name, int16 *value) const;
|
||||
status_t FindInt16(const char *name, int32 index, int16 *value) const;
|
||||
status_t FindUInt16(const char *name, uint16 *value) const;
|
||||
status_t FindUInt16(const char *name, int32 index, uint16 *value) const;
|
||||
status_t FindInt32(const char *name, int32 *value) const;
|
||||
status_t FindInt32(const char *name, int32 index, int32 *value) const;
|
||||
status_t FindUInt32(const char *name, uint32 *value) const;
|
||||
status_t FindUInt32(const char *name, int32 index, uint32 *value) const;
|
||||
status_t FindInt64(const char *name, int64 *value) const;
|
||||
status_t FindInt64(const char *name, int32 index, int64 *value) const;
|
||||
status_t FindUInt64(const char *name, uint64 *value) const;
|
||||
status_t FindUInt64(const char *name, int32 index, uint64 *value) const;
|
||||
status_t FindBool(const char *name, bool *value) const;
|
||||
status_t FindBool(const char *name, int32 index, bool *value) const;
|
||||
status_t FindFloat(const char *name, float *value) const;
|
||||
status_t FindFloat(const char *name, int32 index, float *value) const;
|
||||
status_t FindDouble(const char *name, double *value) const;
|
||||
status_t FindDouble(const char *name, int32 index, double *value) const;
|
||||
status_t FindPointer(const char *name, void **pointer) const;
|
||||
status_t FindPointer(const char *name, int32 index, void **pointer) const;
|
||||
status_t FindMessenger(const char *name, BMessenger *messenger) const;
|
||||
status_t FindMessenger(const char *name, int32 index, BMessenger *messenger) const;
|
||||
status_t FindRef(const char *name, entry_ref *ref) const;
|
||||
status_t FindRef(const char *name, int32 index, entry_ref *ref) const;
|
||||
status_t FindMessage(const char *name, BMessage *message) const;
|
||||
status_t FindMessage(const char *name, int32 index, BMessage *message) const;
|
||||
status_t FindFlat(const char *name, BFlattenable *object) const;
|
||||
status_t FindFlat(const char *name, int32 index, BFlattenable *object) const;
|
||||
status_t FindData(const char *name, type_code type,
|
||||
const void **data, ssize_t *numBytes) const;
|
||||
status_t FindData(const char *name, type_code type, int32 index,
|
||||
const void **data, ssize_t *numBytes) const;
|
||||
status_t FindSize(const char* name, BSize* size) const;
|
||||
status_t FindSize(const char* name, int32 index,
|
||||
BSize* size) const;
|
||||
|
||||
// Replacing data
|
||||
status_t ReplaceAlignment(const char* name,
|
||||
const BAlignment& alignment);
|
||||
status_t ReplaceAlignment(const char* name, int32 index,
|
||||
const BAlignment& alignment);
|
||||
status_t FindString(const char* name,
|
||||
const char** string) const;
|
||||
status_t FindString(const char* name, int32 index,
|
||||
const char** string) const;
|
||||
status_t FindString(const char* name,
|
||||
BString* string) const;
|
||||
status_t FindString(const char* name, int32 index,
|
||||
BString* string) const;
|
||||
status_t FindInt8(const char* name, int8* value) const;
|
||||
status_t FindInt8(const char* name, int32 index,
|
||||
int8* value) const;
|
||||
status_t FindUInt8(const char* name, uint8* value) const;
|
||||
status_t FindUInt8(const char* name, int32 index,
|
||||
uint8* value) const;
|
||||
status_t FindInt16(const char* name, int16* value) const;
|
||||
status_t FindInt16(const char* name, int32 index,
|
||||
int16* value) const;
|
||||
status_t FindUInt16(const char* name,
|
||||
uint16* value) const;
|
||||
status_t FindUInt16(const char* name, int32 index,
|
||||
uint16* value) const;
|
||||
status_t FindInt32(const char* name, int32* value) const;
|
||||
status_t FindInt32(const char* name, int32 index,
|
||||
int32* value) const;
|
||||
status_t FindUInt32(const char* name,
|
||||
uint32* value) const;
|
||||
status_t FindUInt32(const char* name, int32 index,
|
||||
uint32* value) const;
|
||||
status_t FindInt64(const char* name, int64* value) const;
|
||||
status_t FindInt64(const char* name, int32 index,
|
||||
int64* value) const;
|
||||
status_t FindUInt64(const char* name,
|
||||
uint64* value) const;
|
||||
status_t FindUInt64(const char* name, int32 index,
|
||||
uint64* value) const;
|
||||
status_t FindBool(const char* name, bool* value) const;
|
||||
status_t FindBool(const char* name, int32 index,
|
||||
bool* value) const;
|
||||
status_t FindFloat(const char* name, float* value) const;
|
||||
status_t FindFloat(const char* name, int32 index,
|
||||
float* value) const;
|
||||
status_t FindDouble(const char* name,
|
||||
double* value) const;
|
||||
status_t FindDouble(const char* name, int32 index,
|
||||
double* value) const;
|
||||
status_t FindPointer(const char* name,
|
||||
void** pointer) const;
|
||||
status_t FindPointer(const char* name, int32 index,
|
||||
void** pointer) const;
|
||||
status_t FindMessenger(const char* name,
|
||||
BMessenger* messenger) const;
|
||||
status_t FindMessenger(const char* name, int32 index,
|
||||
BMessenger* messenger) const;
|
||||
status_t FindRef(const char* name, entry_ref* ref) const;
|
||||
status_t FindRef(const char* name, int32 index,
|
||||
entry_ref* ref) const;
|
||||
status_t FindMessage(const char* name,
|
||||
BMessage* message) const;
|
||||
status_t FindMessage(const char* name, int32 index,
|
||||
BMessage* message) const;
|
||||
status_t FindFlat(const char* name,
|
||||
BFlattenable* object) const;
|
||||
status_t FindFlat(const char* name, int32 index,
|
||||
BFlattenable* object) const;
|
||||
status_t FindData(const char* name, type_code type,
|
||||
const void** data, ssize_t* numBytes) const;
|
||||
status_t FindData(const char* name, type_code type,
|
||||
int32 index, const void** data,
|
||||
ssize_t* numBytes) const;
|
||||
|
||||
status_t ReplaceRect(const char *name, BRect aRect);
|
||||
status_t ReplaceRect(const char *name, int32 index, BRect aRect);
|
||||
// Replacing data
|
||||
status_t ReplaceAlignment(const char* name,
|
||||
const BAlignment& alignment);
|
||||
status_t ReplaceAlignment(const char* name, int32 index,
|
||||
const BAlignment& alignment);
|
||||
|
||||
status_t ReplacePoint(const char *name, BPoint aPoint);
|
||||
status_t ReplacePoint(const char *name, int32 index, BPoint aPoint);
|
||||
status_t ReplaceSize(const char* name, BSize aSize);
|
||||
status_t ReplaceSize(const char* name, int32 index, BSize aSize);
|
||||
status_t ReplaceRect(const char* name, BRect rect);
|
||||
status_t ReplaceRect(const char* name, int32 index,
|
||||
BRect rect);
|
||||
|
||||
status_t ReplaceString(const char *name, const char *aString);
|
||||
status_t ReplaceString(const char *name, int32 index, const char *aString);
|
||||
status_t ReplaceString(const char *name, const BString &aString);
|
||||
status_t ReplaceString(const char *name, int32 index, const BString &aString);
|
||||
status_t ReplaceInt8(const char *name, int8 value);
|
||||
status_t ReplaceInt8(const char *name, int32 index, int8 value);
|
||||
status_t ReplaceUInt8(const char *name, uint8 value);
|
||||
status_t ReplaceUInt8(const char *name, int32 index, uint8 value);
|
||||
status_t ReplaceInt16(const char *name, int16 value);
|
||||
status_t ReplaceInt16(const char *name, int32 index, int16 value);
|
||||
status_t ReplaceUInt16(const char *name, uint16 value);
|
||||
status_t ReplaceUInt16(const char *name, int32 index, uint16 value);
|
||||
status_t ReplaceInt32(const char *name, int32 value);
|
||||
status_t ReplaceInt32(const char *name, int32 index, int32 value);
|
||||
status_t ReplaceUInt32(const char *name, uint32 value);
|
||||
status_t ReplaceUInt32(const char *name, int32 index, uint32 value);
|
||||
status_t ReplaceInt64(const char *name, int64 value);
|
||||
status_t ReplaceInt64(const char *name, int32 index, int64 value);
|
||||
status_t ReplaceUInt64(const char *name, uint64 value);
|
||||
status_t ReplaceUInt64(const char *name, int32 index, uint64 value);
|
||||
status_t ReplaceBool(const char *name, bool aBoolean);
|
||||
status_t ReplaceBool(const char *name, int32 index, bool aBoolean);
|
||||
status_t ReplaceFloat(const char *name, float aFloat);
|
||||
status_t ReplaceFloat(const char *name, int32 index, float aFloat);
|
||||
status_t ReplaceDouble(const char *name, double aDouble);
|
||||
status_t ReplaceDouble(const char *name, int32 index, double aDouble);
|
||||
status_t ReplacePointer(const char *name, const void *pointer);
|
||||
status_t ReplacePointer(const char *name,int32 index,const void *pointer);
|
||||
status_t ReplaceMessenger(const char *name, BMessenger messenger);
|
||||
status_t ReplaceMessenger(const char *name, int32 index, BMessenger messenger);
|
||||
status_t ReplaceRef( const char *name,const entry_ref *ref);
|
||||
status_t ReplaceRef( const char *name, int32 index, const entry_ref *ref);
|
||||
status_t ReplaceMessage(const char *name, const BMessage *message);
|
||||
status_t ReplaceMessage(const char *name, int32 index, const BMessage *message);
|
||||
status_t ReplaceFlat(const char *name, BFlattenable *object);
|
||||
status_t ReplaceFlat(const char *name, int32 index, BFlattenable *object);
|
||||
status_t ReplaceData(const char *name, type_code type,
|
||||
const void *data, ssize_t numBytes);
|
||||
status_t ReplaceData(const char *name, type_code type, int32 index,
|
||||
const void *data, ssize_t numBytes);
|
||||
status_t ReplacePoint(const char* name, BPoint aPoint);
|
||||
status_t ReplacePoint(const char* name, int32 index,
|
||||
BPoint aPoint);
|
||||
status_t ReplaceSize(const char* name, BSize aSize);
|
||||
status_t ReplaceSize(const char* name, int32 index,
|
||||
BSize aSize);
|
||||
|
||||
// Comparing data - Haiku experimental API
|
||||
bool HasSameData(const BMessage &other,
|
||||
bool ignoreFieldOrder = true, bool deep = false) const;
|
||||
status_t ReplaceString(const char* name,
|
||||
const char* string);
|
||||
status_t ReplaceString(const char* name, int32 index,
|
||||
const char* string);
|
||||
status_t ReplaceString(const char* name,
|
||||
const BString& string);
|
||||
status_t ReplaceString(const char* name, int32 index,
|
||||
const BString& string);
|
||||
status_t ReplaceInt8(const char* name, int8 value);
|
||||
status_t ReplaceInt8(const char* name, int32 index,
|
||||
int8 value);
|
||||
status_t ReplaceUInt8(const char* name, uint8 value);
|
||||
status_t ReplaceUInt8(const char* name, int32 index,
|
||||
uint8 value);
|
||||
status_t ReplaceInt16(const char* name, int16 value);
|
||||
status_t ReplaceInt16(const char* name, int32 index,
|
||||
int16 value);
|
||||
status_t ReplaceUInt16(const char* name, uint16 value);
|
||||
status_t ReplaceUInt16(const char* name, int32 index,
|
||||
uint16 value);
|
||||
status_t ReplaceInt32(const char* name, int32 value);
|
||||
status_t ReplaceInt32(const char* name, int32 index,
|
||||
int32 value);
|
||||
status_t ReplaceUInt32(const char* name, uint32 value);
|
||||
status_t ReplaceUInt32(const char* name, int32 index,
|
||||
uint32 value);
|
||||
status_t ReplaceInt64(const char* name, int64 value);
|
||||
status_t ReplaceInt64(const char* name, int32 index,
|
||||
int64 value);
|
||||
status_t ReplaceUInt64(const char* name, uint64 value);
|
||||
status_t ReplaceUInt64(const char* name, int32 index,
|
||||
uint64 value);
|
||||
status_t ReplaceBool(const char* name, bool aBoolean);
|
||||
status_t ReplaceBool(const char* name, int32 index,
|
||||
bool value);
|
||||
status_t ReplaceFloat(const char* name, float value);
|
||||
status_t ReplaceFloat(const char* name, int32 index,
|
||||
float value);
|
||||
status_t ReplaceDouble(const char* name, double value);
|
||||
status_t ReplaceDouble(const char* name, int32 index,
|
||||
double value);
|
||||
status_t ReplacePointer(const char* name,
|
||||
const void* pointer);
|
||||
status_t ReplacePointer(const char* name, int32 index,
|
||||
const void* pointer);
|
||||
status_t ReplaceMessenger(const char* name,
|
||||
BMessenger messenger);
|
||||
status_t ReplaceMessenger(const char* name, int32 index,
|
||||
BMessenger messenger);
|
||||
status_t ReplaceRef(const char* name,
|
||||
const entry_ref* ref);
|
||||
status_t ReplaceRef(const char* name, int32 index,
|
||||
const entry_ref* ref);
|
||||
status_t ReplaceMessage(const char* name,
|
||||
const BMessage* message);
|
||||
status_t ReplaceMessage(const char* name, int32 index,
|
||||
const BMessage* message);
|
||||
status_t ReplaceFlat(const char* name,
|
||||
BFlattenable* object);
|
||||
status_t ReplaceFlat(const char* name, int32 index,
|
||||
BFlattenable* object);
|
||||
status_t ReplaceData(const char* name, type_code type,
|
||||
const void* data, ssize_t numBytes);
|
||||
status_t ReplaceData(const char* name, type_code type,
|
||||
int32 index, const void* data,
|
||||
ssize_t numBytes);
|
||||
|
||||
void *operator new(size_t size);
|
||||
void *operator new(size_t, void *pointer);
|
||||
void operator delete(void *pointer, size_t size);
|
||||
// Comparing data - Haiku experimental API
|
||||
bool HasSameData(const BMessage& other,
|
||||
bool ignoreFieldOrder = true,
|
||||
bool deep = false) const;
|
||||
|
||||
// Private, reserved, or obsolete
|
||||
bool HasAlignment(const char*, int32 n = 0) const;
|
||||
bool HasRect(const char *, int32 n = 0) const;
|
||||
bool HasPoint(const char *, int32 n = 0) const;
|
||||
bool HasSize(const char*, int32 n = 0) const;
|
||||
bool HasString(const char *, int32 n = 0) const;
|
||||
bool HasInt8(const char *, int32 n = 0) const;
|
||||
bool HasUInt8(const char *, int32 n = 0) const;
|
||||
bool HasInt16(const char *, int32 n = 0) const;
|
||||
bool HasUInt16(const char *, int32 n = 0) const;
|
||||
bool HasInt32(const char *, int32 n = 0) const;
|
||||
bool HasUInt32(const char *, int32 n = 0) const;
|
||||
bool HasInt64(const char *, int32 n = 0) const;
|
||||
bool HasUInt64(const char *, int32 n = 0) const;
|
||||
bool HasBool(const char *, int32 n = 0) const;
|
||||
bool HasFloat(const char *, int32 n = 0) const;
|
||||
bool HasDouble(const char *, int32 n = 0) const;
|
||||
bool HasPointer(const char *, int32 n = 0) const;
|
||||
bool HasMessenger(const char *, int32 n = 0) const;
|
||||
bool HasRef(const char *, int32 n = 0) const;
|
||||
bool HasMessage(const char *, int32 n = 0) const;
|
||||
bool HasFlat(const char *, const BFlattenable *) const;
|
||||
bool HasFlat(const char *, int32 n, const BFlattenable *) const;
|
||||
bool HasData(const char *, type_code , int32 n = 0) const;
|
||||
BRect FindRect(const char *, int32 n = 0) const;
|
||||
BPoint FindPoint(const char *, int32 n = 0) const;
|
||||
const char *FindString(const char *, int32 n = 0) const;
|
||||
int8 FindInt8(const char *, int32 n = 0) const;
|
||||
int16 FindInt16(const char *, int32 n = 0) const;
|
||||
int32 FindInt32(const char *, int32 n = 0) const;
|
||||
int64 FindInt64(const char *, int32 n = 0) const;
|
||||
bool FindBool(const char *, int32 n = 0) const;
|
||||
float FindFloat(const char *, int32 n = 0) const;
|
||||
double FindDouble(const char *, int32 n = 0) const;
|
||||
void* operator new(size_t size);
|
||||
void* operator new(size_t, void* pointer);
|
||||
void* operator new(size_t,
|
||||
const std::nothrow_t& noThrow);
|
||||
void operator delete(void* pointer, size_t size);
|
||||
|
||||
class Private;
|
||||
struct message_header;
|
||||
struct field_header;
|
||||
// Private, reserved, or obsolete
|
||||
bool HasAlignment(const char* name,
|
||||
int32 n = 0) const;
|
||||
bool HasRect(const char* name, int32 n = 0) const;
|
||||
bool HasPoint(const char* name, int32 n = 0) const;
|
||||
bool HasSize(const char* name, int32 n = 0) const;
|
||||
bool HasString(const char* name, int32 n = 0) const;
|
||||
bool HasInt8(const char* name, int32 n = 0) const;
|
||||
bool HasUInt8(const char* name, int32 n = 0) const;
|
||||
bool HasInt16(const char* name, int32 n = 0) const;
|
||||
bool HasUInt16(const char* name, int32 n = 0) const;
|
||||
bool HasInt32(const char* name, int32 n = 0) const;
|
||||
bool HasUInt32(const char* name, int32 n = 0) const;
|
||||
bool HasInt64(const char* name, int32 n = 0) const;
|
||||
bool HasUInt64(const char* name, int32 n = 0) const;
|
||||
bool HasBool(const char* name, int32 n = 0) const;
|
||||
bool HasFloat(const char* name, int32 n = 0) const;
|
||||
bool HasDouble(const char* name, int32 n = 0) const;
|
||||
bool HasPointer(const char* name, int32 n = 0) const;
|
||||
bool HasMessenger(const char* name,
|
||||
int32 n = 0) const;
|
||||
bool HasRef(const char* name, int32 n = 0) const;
|
||||
bool HasMessage(const char* name, int32 n = 0) const;
|
||||
bool HasFlat(const char* name,
|
||||
const BFlattenable* ) const;
|
||||
bool HasFlat(const char* name, int32 n,
|
||||
const BFlattenable* ) const;
|
||||
bool HasData(const char* name, type_code ,
|
||||
int32 n = 0) const;
|
||||
BRect FindRect(const char* name, int32 n = 0) const;
|
||||
BPoint FindPoint(const char* name, int32 n = 0) const;
|
||||
const char* FindString(const char* name, int32 n = 0) const;
|
||||
int8 FindInt8(const char* name, int32 n = 0) const;
|
||||
int16 FindInt16(const char* name, int32 n = 0) const;
|
||||
int32 FindInt32(const char* name, int32 n = 0) const;
|
||||
int64 FindInt64(const char* name, int32 n = 0) const;
|
||||
bool FindBool(const char* name, int32 n = 0) const;
|
||||
float FindFloat(const char* name, int32 n = 0) const;
|
||||
double FindDouble(const char* name, int32 n = 0) const;
|
||||
|
||||
private:
|
||||
friend class Private;
|
||||
friend class BMessageQueue;
|
||||
class Private;
|
||||
struct message_header;
|
||||
struct field_header;
|
||||
|
||||
status_t _InitCommon(bool initHeader);
|
||||
status_t _InitHeader();
|
||||
status_t _Clear();
|
||||
private:
|
||||
friend class Private;
|
||||
friend class BMessageQueue;
|
||||
|
||||
status_t _FlattenToArea(message_header **_header) const;
|
||||
status_t _CopyForWrite();
|
||||
status_t _Reference();
|
||||
status_t _Dereference();
|
||||
status_t _InitCommon(bool initHeader);
|
||||
status_t _InitHeader();
|
||||
status_t _Clear();
|
||||
|
||||
status_t _ValidateMessage();
|
||||
status_t _FlattenToArea(message_header** _header) const;
|
||||
status_t _CopyForWrite();
|
||||
status_t _Reference();
|
||||
status_t _Dereference();
|
||||
|
||||
status_t _ResizeData(uint32 offset, int32 change);
|
||||
status_t _ValidateMessage();
|
||||
|
||||
uint32 _HashName(const char* name) const;
|
||||
status_t _FindField(const char* name, type_code type,
|
||||
field_header** _result) const;
|
||||
status_t _AddField(const char* name, type_code type,
|
||||
bool isFixedSize, field_header** _result);
|
||||
status_t _RemoveField(field_header* field);
|
||||
status_t _ResizeData(uint32 offset, int32 change);
|
||||
|
||||
void _PrintToStream(const char* indent) const;
|
||||
uint32 _HashName(const char* name) const;
|
||||
status_t _FindField(const char* name, type_code type,
|
||||
field_header** _result) const;
|
||||
status_t _AddField(const char* name, type_code type,
|
||||
bool isFixedSize, field_header** _result);
|
||||
status_t _RemoveField(field_header* field);
|
||||
|
||||
private:
|
||||
message_header* fHeader;
|
||||
field_header* fFields;
|
||||
uint8* fData;
|
||||
void _PrintToStream(const char* indent) const;
|
||||
|
||||
uint32 fFieldsAvailable;
|
||||
size_t fDataAvailable;
|
||||
private:
|
||||
BMessage(BMessage* message);
|
||||
// deprecated
|
||||
|
||||
mutable BMessage* fOriginal;
|
||||
virtual void _ReservedMessage1();
|
||||
virtual void _ReservedMessage2();
|
||||
virtual void _ReservedMessage3();
|
||||
|
||||
BMessage* fQueueLink;
|
||||
// fQueueLink is used by BMessageQueue to build a linked list
|
||||
status_t _SendMessage(port_id port, team_id portOwner,
|
||||
int32 token, bigtime_t timeout,
|
||||
bool replyRequired,
|
||||
BMessenger& replyTo) const;
|
||||
status_t _SendMessage(port_id port, team_id portOwner,
|
||||
int32 token, BMessage* reply,
|
||||
bigtime_t sendTimeout,
|
||||
bigtime_t replyTimeout) const;
|
||||
static status_t _SendFlattenedMessage(void* data, int32 size,
|
||||
port_id port, int32 token,
|
||||
bigtime_t timeout);
|
||||
|
||||
void* fArchivingPointer;
|
||||
static void _StaticInit();
|
||||
static void _StaticReInitForkedChild();
|
||||
static void _StaticCleanup();
|
||||
static void _StaticCacheCleanup();
|
||||
static int32 _StaticGetCachedReplyPort();
|
||||
|
||||
uint32 fReserved[8];
|
||||
private:
|
||||
message_header* fHeader;
|
||||
field_header* fFields;
|
||||
uint8* fData;
|
||||
|
||||
// deprecated
|
||||
BMessage(BMessage *message);
|
||||
uint32 fFieldsAvailable;
|
||||
size_t fDataAvailable;
|
||||
|
||||
virtual void _ReservedMessage1();
|
||||
virtual void _ReservedMessage2();
|
||||
virtual void _ReservedMessage3();
|
||||
mutable BMessage* fOriginal;
|
||||
|
||||
status_t _SendMessage(port_id port, team_id portOwner, int32 token,
|
||||
bigtime_t timeout, bool replyRequired,
|
||||
BMessenger &replyTo) const;
|
||||
status_t _SendMessage(port_id port, team_id portOwner,
|
||||
int32 token, BMessage *reply, bigtime_t sendTimeout,
|
||||
bigtime_t replyTimeout) const;
|
||||
static status_t _SendFlattenedMessage(void *data, int32 size,
|
||||
port_id port, int32 token, bigtime_t timeout);
|
||||
BMessage* fQueueLink;
|
||||
// fQueueLink is used by BMessageQueue to build a linked list
|
||||
|
||||
static void _StaticInit();
|
||||
static void _StaticReInitForkedChild();
|
||||
static void _StaticCleanup();
|
||||
static void _StaticCacheCleanup();
|
||||
static int32 _StaticGetCachedReplyPort();
|
||||
void* fArchivingPointer;
|
||||
|
||||
enum { sNumReplyPorts = 3 };
|
||||
static port_id sReplyPorts[sNumReplyPorts];
|
||||
static int32 sReplyPortInUse[sNumReplyPorts];
|
||||
static int32 sGetCachedReplyPort();
|
||||
uint32 fReserved[8];
|
||||
|
||||
static BBlockCache* sMsgCache;
|
||||
enum { sNumReplyPorts = 3 };
|
||||
static port_id sReplyPorts[sNumReplyPorts];
|
||||
static int32 sReplyPortInUse[sNumReplyPorts];
|
||||
static int32 sGetCachedReplyPort();
|
||||
|
||||
static BBlockCache* sMsgCache;
|
||||
};
|
||||
|
||||
|
||||
#endif // _MESSAGE_H
|
||||
|
@ -19,6 +19,13 @@
|
||||
#define DISABLES_ON_WINDOW_DEACTIVATION 1
|
||||
|
||||
|
||||
enum {
|
||||
B_KNOB_STYLE_NONE = 0,
|
||||
B_KNOB_STYLE_DOTS,
|
||||
B_KNOB_STYLE_LINES
|
||||
};
|
||||
|
||||
|
||||
class BScrollBar : public BView {
|
||||
public:
|
||||
BScrollBar(BRect frame, const char* name,
|
||||
|
@ -28,6 +28,7 @@ int32 kFreeTypeCookie = 0x87654321;
|
||||
|
||||
char *kFailBackMime = {"application/octet-stream"};
|
||||
char *kDirectoryMime = {"application/x-vnd.Be-directory"};
|
||||
char *kAttrTypeName = {"BEOS:TYPE"};
|
||||
|
||||
|
||||
status_t set_mime(vnode *node, const char *filename)
|
||||
@ -35,7 +36,7 @@ status_t set_mime(vnode *node, const char *filename)
|
||||
struct ext_mime *p;
|
||||
int32 namelen;
|
||||
int32 ext_len;
|
||||
node->mime = kFailBackMime;
|
||||
node->mime = NULL;
|
||||
|
||||
if (filename == NULL)
|
||||
{
|
||||
@ -56,7 +57,10 @@ status_t set_mime(vnode *node, const char *filename)
|
||||
if (!strcasecmp(filename + namelen - ext_len, p->extension))
|
||||
break;
|
||||
}
|
||||
node->mime = p->mime;
|
||||
if(p->mime==NULL)
|
||||
node->mime = kFailBackMime;
|
||||
else
|
||||
node->mime = p->mime;
|
||||
return B_NO_ERROR;
|
||||
}
|
||||
|
||||
@ -189,8 +193,8 @@ fake_read_attrib_dir(fs_volume *_vol, fs_vnode *_node, void *_cookie,
|
||||
|
||||
entry->d_ino = node->vnid;
|
||||
entry->d_dev = ns->id;
|
||||
entry->d_reclen = sizeof(struct dirent) + 10;
|
||||
strcpy(entry->d_name, "BEOS:TYPE");
|
||||
entry->d_reclen = sizeof(struct dirent) + strlen(kAttrTypeName);
|
||||
strcpy(entry->d_name, kAttrTypeName);
|
||||
}
|
||||
|
||||
*cookie = kCloseTypeCookie;
|
||||
@ -207,24 +211,19 @@ fake_create_attrib(fs_volume *_vol, fs_vnode *_node, const char* name,
|
||||
uint32 type, int openMode, void** _cookie)
|
||||
{
|
||||
nspace *ns = (nspace *)_vol->private_volume;
|
||||
int result = B_NO_ERROR;
|
||||
|
||||
|
||||
LOCK_VOL(ns);
|
||||
|
||||
TRACE("fake_create_attrib - ENTER (name = [%s])\n",name);
|
||||
|
||||
if (strcmp(name, "BEOS:TYPE") != 0)
|
||||
goto exit;
|
||||
|
||||
*_cookie = &kSetTypeCookie;
|
||||
if (strcmp(name, kAttrTypeName) == 0)
|
||||
*_cookie = &kSetTypeCookie;
|
||||
|
||||
exit:
|
||||
|
||||
TRACE("fake_create_attrib - EXIT, result is %s\n", strerror(result));
|
||||
TRACE("fake_create_attrib - EXIT\n");
|
||||
|
||||
UNLOCK_VOL(ns);
|
||||
|
||||
return result;
|
||||
return B_NO_ERROR;
|
||||
}
|
||||
|
||||
status_t
|
||||
@ -232,18 +231,16 @@ fake_open_attrib(fs_volume *_vol, fs_vnode *_node, const char *name,
|
||||
int openMode, void **_cookie)
|
||||
{
|
||||
nspace *ns = (nspace *)_vol->private_volume;
|
||||
int result = B_NO_ERROR;
|
||||
|
||||
status_t result = B_NO_ERROR;
|
||||
|
||||
LOCK_VOL(ns);
|
||||
|
||||
TRACE("fake_open_attrib - ENTER (name = [%s])\n",name);
|
||||
|
||||
if (strcmp(name, "BEOS:TYPE") != 0)
|
||||
goto exit;
|
||||
|
||||
*_cookie = &kSetTypeCookie;
|
||||
|
||||
exit:
|
||||
if (strcmp(name, kAttrTypeName) == 0)
|
||||
*_cookie = &kSetTypeCookie;
|
||||
else
|
||||
result = ENOENT;
|
||||
|
||||
TRACE("fake_open_attrib - EXIT, result is %s\n", strerror(result));
|
||||
|
||||
|
@ -36,6 +36,7 @@
|
||||
|
||||
#include <driver_settings.h>
|
||||
#include <KernelExport.h>
|
||||
#include <disk_device_manager.h>
|
||||
|
||||
#include "attributes.h"
|
||||
#include "fake_attributes.h"
|
||||
@ -43,11 +44,11 @@
|
||||
#include "ntfs.h"
|
||||
#include "volume_util.h"
|
||||
|
||||
static const char* kNTFSUntitled = {"NTFS Untitled"};
|
||||
static const char* kNTFSUnnamed = {"NTFS Unnamed"};
|
||||
|
||||
typedef struct identify_cookie {
|
||||
NTFS_BOOT_SECTOR boot;
|
||||
char label[256];
|
||||
char label[MAX_PATH];
|
||||
} identify_cookie;
|
||||
|
||||
|
||||
@ -257,10 +258,11 @@ fs_identify_partition(int fd, partition_data *partition, void **_cookie)
|
||||
return -1;
|
||||
}
|
||||
|
||||
strcpy(cookie->label, kNTFSUntitled);
|
||||
cookie->label[0]='\0';
|
||||
memcpy(&cookie->boot, &boot, 512);
|
||||
|
||||
// try get path for device
|
||||
if (ioctl(fd, B_GET_PATH_FOR_DEVICE, devpath)) {
|
||||
// get path for device
|
||||
if (ioctl(fd, B_GET_PATH_FOR_DEVICE, devpath) != 0) {
|
||||
// try mount
|
||||
ntVolume = utils_mount_volume(devpath, MS_RDONLY | MS_RECOVER);
|
||||
if (ntVolume != NULL) {
|
||||
@ -270,7 +272,26 @@ fs_identify_partition(int fd, partition_data *partition, void **_cookie)
|
||||
}
|
||||
}
|
||||
|
||||
memcpy(&cookie->boot, &boot, 512);
|
||||
// generate a more or less descriptive name for unnamed volume
|
||||
if (cookie->label[0]=='\0') {
|
||||
double size;
|
||||
off_t diskSize = sle64_to_cpu(boot.number_of_sectors)
|
||||
* le16_to_cpu(boot.bpb.bytes_per_sector);
|
||||
off_t divisor = 1ULL << 40;
|
||||
char unit = 'T';
|
||||
if (diskSize < divisor) {
|
||||
divisor = 1UL << 30;
|
||||
unit = 'G';
|
||||
if (diskSize < divisor) {
|
||||
divisor = 1UL << 20;
|
||||
unit = 'M';
|
||||
}
|
||||
}
|
||||
|
||||
size = (double)((10 * diskSize + divisor - 1) / divisor);
|
||||
snprintf(cookie->label, MAX_PATH - 1, "%g %cB NTFS File System",
|
||||
size / 10, unit);
|
||||
}
|
||||
|
||||
*_cookie = cookie;
|
||||
|
||||
@ -468,7 +489,7 @@ fs_rfsstat(fs_volume *_vol, struct fs_info *fss)
|
||||
break;
|
||||
}
|
||||
if (i < 0)
|
||||
strcpy(fss->volume_name, kNTFSUntitled);
|
||||
strcpy(fss->volume_name, kNTFSUnnamed);
|
||||
else
|
||||
fss->volume_name[i + 1] = 0;
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2005-2011, Haiku Inc. All rights reserved.
|
||||
* Copyright 2005-2012, Haiku Inc. All rights reserved.
|
||||
* Distributed under the terms of the MIT License.
|
||||
*
|
||||
* Authors:
|
||||
@ -245,8 +245,15 @@ void *
|
||||
BMessage::operator new(size_t size)
|
||||
{
|
||||
DEBUG_FUNCTION_ENTER2;
|
||||
void *pointer = sMsgCache->Get(size);
|
||||
return pointer;
|
||||
return sMsgCache->Get(size);
|
||||
}
|
||||
|
||||
|
||||
void *
|
||||
BMessage::operator new(size_t size, const std::nothrow_t &noThrow)
|
||||
{
|
||||
DEBUG_FUNCTION_ENTER2;
|
||||
return sMsgCache->Get(size);
|
||||
}
|
||||
|
||||
|
||||
@ -2622,6 +2629,34 @@ BMessage::AddFlat(const char *name, BFlattenable *object, int32 count)
|
||||
}
|
||||
|
||||
|
||||
status_t
|
||||
BMessage::Append(const BMessage &other)
|
||||
{
|
||||
field_header *field = other.fFields;
|
||||
for (uint32 i = 0; i < other.fHeader->field_count; i++, field++) {
|
||||
const char *name = (const char *)(other.fData + field->offset);
|
||||
const void *data = (const void *)(other.fData + field->offset
|
||||
+ field->name_length);
|
||||
bool isFixed = (field->flags & FIELD_FLAG_FIXED_SIZE) != 0;
|
||||
size_t size = field->data_size / field->count;
|
||||
|
||||
for (uint32 j = 0; j < field->count; j++) {
|
||||
if (!isFixed)
|
||||
size = *(uint32 *)data;
|
||||
|
||||
status_t status = AddData(name, field->type, data, size,
|
||||
isFixed != 0, 1);
|
||||
if (status != B_OK)
|
||||
return status;
|
||||
|
||||
data = (const void *)((const char *)data + size
|
||||
+ (isFixed ? 0 : sizeof(uint32)));
|
||||
}
|
||||
}
|
||||
return B_OK;
|
||||
}
|
||||
|
||||
|
||||
status_t
|
||||
BMessage::FindAlignment(const char *name, BAlignment *alignment) const
|
||||
{
|
||||
|
@ -846,6 +846,7 @@ BScrollBar::Draw(BRect updateRect)
|
||||
EndLineArray();
|
||||
} else
|
||||
StrokeRect(bounds);
|
||||
|
||||
bounds.InsetBy(1.0, 1.0);
|
||||
|
||||
bool enabled = fPrivateData->fEnabled && fMin < fMax
|
||||
@ -1152,6 +1153,69 @@ BScrollBar::Draw(BRect updateRect)
|
||||
FillRect(rect);
|
||||
}
|
||||
}
|
||||
|
||||
if (fPrivateData->fScrollBarInfo.knob == B_KNOB_STYLE_NONE)
|
||||
return;
|
||||
|
||||
// draw the scrollbar thumb knobs
|
||||
bool square = fPrivateData->fScrollBarInfo.knob == B_KNOB_STYLE_DOTS;
|
||||
int32 knobWidth = 0;
|
||||
int32 knobHeight = 0;
|
||||
|
||||
if (square) {
|
||||
knobWidth = 2;
|
||||
knobHeight = 2;
|
||||
} else {
|
||||
knobWidth = 1;
|
||||
knobHeight = 3;
|
||||
}
|
||||
|
||||
int32 flags = 0;
|
||||
if (!enabled)
|
||||
flags |= BControlLook::B_DISABLED;
|
||||
|
||||
float hmiddle = rect.Width() / 2;
|
||||
float vmiddle = rect.Height() / 2;
|
||||
|
||||
BRect middleKnob = BRect(
|
||||
rect.left + hmiddle
|
||||
- (fOrientation == B_HORIZONTAL ? knobWidth : knobHeight),
|
||||
rect.top + vmiddle
|
||||
- (fOrientation == B_HORIZONTAL ? knobHeight : knobWidth),
|
||||
rect.left + hmiddle
|
||||
+ (fOrientation == B_HORIZONTAL ? knobWidth : knobHeight),
|
||||
rect.top + vmiddle
|
||||
+ (fOrientation == B_HORIZONTAL ? knobHeight : knobWidth));
|
||||
|
||||
if (fOrientation == B_HORIZONTAL) {
|
||||
BRect leftKnob = middleKnob.OffsetByCopy(knobWidth * -4, 0);
|
||||
if (leftKnob.left > rect.left + knobWidth) {
|
||||
be_control_look->DrawButtonBackground(this, leftKnob, updateRect,
|
||||
normal, flags, BControlLook::B_ALL_BORDERS, fOrientation);
|
||||
}
|
||||
|
||||
BRect rightKnob = middleKnob.OffsetByCopy(knobWidth * 4, 0);
|
||||
if (rightKnob.right < rect.right - knobWidth) {
|
||||
be_control_look->DrawButtonBackground(this, rightKnob, updateRect,
|
||||
normal, flags, BControlLook::B_ALL_BORDERS, fOrientation);
|
||||
}
|
||||
} else {
|
||||
BRect topKnob = middleKnob.OffsetByCopy(0, knobWidth * -4);
|
||||
if (topKnob.top > rect.top + knobHeight) {
|
||||
be_control_look->DrawButtonBackground(this, topKnob, updateRect,
|
||||
normal, flags, BControlLook::B_ALL_BORDERS, fOrientation);
|
||||
}
|
||||
|
||||
BRect bottomKnob = middleKnob.OffsetByCopy(0, knobWidth * 4);
|
||||
if (bottomKnob.bottom < rect.bottom - knobHeight) {
|
||||
be_control_look->DrawButtonBackground(this, bottomKnob, updateRect,
|
||||
normal, flags, BControlLook::B_ALL_BORDERS, fOrientation);
|
||||
}
|
||||
}
|
||||
|
||||
// draw middle knob last because it modifies middleKnob
|
||||
be_control_look->DrawButtonBackground(this, middleKnob, updateRect,
|
||||
normal, flags, BControlLook::B_ALL_BORDERS, fOrientation);
|
||||
}
|
||||
|
||||
|
||||
|
@ -50,19 +50,19 @@ APRWindow::APRWindow(BRect frame)
|
||||
|
||||
BTabView* tabView = new BTabView("tabview", B_WIDTH_FROM_LABEL);
|
||||
|
||||
fLookAndFeelSettings = new LookAndFeelSettingsView(
|
||||
B_TRANSLATE("Look and feel"));
|
||||
|
||||
fFontSettings = new FontView(B_TRANSLATE("Fonts"));
|
||||
|
||||
fColorsView = new APRView(B_TRANSLATE("Colors"));
|
||||
|
||||
fLookAndFeelSettings = new LookAndFeelSettingsView(
|
||||
B_TRANSLATE("Look and feel"));
|
||||
|
||||
fAntialiasingSettings = new AntialiasingSettingsView(
|
||||
B_TRANSLATE("Antialiasing"));
|
||||
|
||||
tabView->AddTab(fLookAndFeelSettings);
|
||||
tabView->AddTab(fFontSettings);
|
||||
tabView->AddTab(fColorsView);
|
||||
tabView->AddTab(fLookAndFeelSettings);
|
||||
tabView->AddTab(fAntialiasingSettings);
|
||||
|
||||
_UpdateButtons();
|
||||
|
360
src/preferences/appearance/FakeScrollBar.cpp
Normal file
360
src/preferences/appearance/FakeScrollBar.cpp
Normal file
@ -0,0 +1,360 @@
|
||||
/*
|
||||
* Copyright 2010-2012 Haiku, Inc. All rights reserved.
|
||||
* Distributed under the terms of the MIT license.
|
||||
*
|
||||
* Authors:
|
||||
* DarkWyrm <bpmagic@columbus.rr.com>
|
||||
* John Scipione <jscipione@gmail.com>
|
||||
*/
|
||||
|
||||
|
||||
#include "FakeScrollBar.h"
|
||||
|
||||
#include <Box.h>
|
||||
#include <ControlLook.h>
|
||||
#include <Message.h>
|
||||
#include <ScrollBar.h>
|
||||
#include <Shape.h>
|
||||
#include <Size.h>
|
||||
#include <Window.h>
|
||||
|
||||
|
||||
typedef enum {
|
||||
ARROW_LEFT = 0,
|
||||
ARROW_RIGHT,
|
||||
ARROW_UP,
|
||||
ARROW_DOWN,
|
||||
ARROW_NONE
|
||||
} arrow_direction;
|
||||
|
||||
|
||||
FakeScrollBar::FakeScrollBar(bool drawArrows, bool doubleArrows,
|
||||
int32 knobStyle, BMessage* message)
|
||||
:
|
||||
BControl("FakeScrollBar", NULL, message, B_WILL_DRAW | B_NAVIGABLE),
|
||||
fDrawArrows(drawArrows),
|
||||
fDoubleArrows(doubleArrows),
|
||||
fKnobStyle(knobStyle)
|
||||
{
|
||||
SetExplicitMinSize(BSize(160, 20));
|
||||
SetExplicitMaxSize(BSize(B_SIZE_UNLIMITED, 20));
|
||||
}
|
||||
|
||||
|
||||
FakeScrollBar::~FakeScrollBar(void)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
FakeScrollBar::Draw(BRect updateRect)
|
||||
{
|
||||
BRect bounds = Bounds();
|
||||
|
||||
rgb_color normal = ui_color(B_PANEL_BACKGROUND_COLOR);
|
||||
|
||||
if (IsFocus()) {
|
||||
// draw the focus indicator
|
||||
SetHighColor(ui_color(B_NAVIGATION_BASE_COLOR));
|
||||
StrokeRect(bounds);
|
||||
bounds.InsetBy(1.0, 1.0);
|
||||
|
||||
// Draw the selected border (1px)
|
||||
if (Value() == B_CONTROL_ON)
|
||||
SetHighColor(ui_color(B_CONTROL_MARK_COLOR));
|
||||
else
|
||||
SetHighColor(normal);
|
||||
|
||||
StrokeRect(bounds);
|
||||
bounds.InsetBy(1.0, 1.0);
|
||||
} else {
|
||||
// Draw the selected border (2px)
|
||||
if (Value() == B_CONTROL_ON)
|
||||
SetHighColor(ui_color(B_CONTROL_MARK_COLOR));
|
||||
else
|
||||
SetHighColor(normal);
|
||||
|
||||
StrokeRect(bounds);
|
||||
bounds.InsetBy(1.0, 1.0);
|
||||
StrokeRect(bounds);
|
||||
bounds.InsetBy(1.0, 1.0);
|
||||
}
|
||||
|
||||
// draw a gap (1px)
|
||||
SetHighColor(normal);
|
||||
StrokeRect(bounds);
|
||||
bounds.InsetBy(1.0, 1.0);
|
||||
|
||||
// draw a border around control (1px)
|
||||
SetHighColor(tint_color(normal, B_DARKEN_1_TINT));
|
||||
StrokeRect(bounds);
|
||||
bounds.InsetBy(1.0, 1.0);
|
||||
|
||||
BRect thumbBG = bounds;
|
||||
BRect bgRect = bounds;
|
||||
|
||||
if (fDrawArrows) {
|
||||
// draw arrows
|
||||
SetDrawingMode(B_OP_OVER);
|
||||
|
||||
BRect buttonFrame(bounds.left, bounds.top,
|
||||
bounds.left + bounds.Height(), bounds.bottom);
|
||||
|
||||
_DrawArrowButton(ARROW_LEFT, fDoubleArrows, buttonFrame, updateRect);
|
||||
|
||||
if (fDoubleArrows) {
|
||||
buttonFrame.OffsetBy(bounds.Height() + 1, 0.0);
|
||||
_DrawArrowButton(ARROW_RIGHT, fDoubleArrows, buttonFrame,
|
||||
updateRect);
|
||||
|
||||
buttonFrame.OffsetTo(bounds.right - ((bounds.Height() * 2) + 1),
|
||||
bounds.top);
|
||||
_DrawArrowButton(ARROW_LEFT, fDoubleArrows, buttonFrame,
|
||||
updateRect);
|
||||
|
||||
thumbBG.left += bounds.Height() * 2 + 2;
|
||||
thumbBG.right -= bounds.Height() * 2 + 2;
|
||||
} else {
|
||||
thumbBG.left += bounds.Height() + 1;
|
||||
thumbBG.right -= bounds.Height() + 1;
|
||||
}
|
||||
|
||||
buttonFrame.OffsetTo(bounds.right - bounds.Height(), bounds.top);
|
||||
_DrawArrowButton(ARROW_RIGHT, fDoubleArrows, buttonFrame, updateRect);
|
||||
|
||||
SetDrawingMode(B_OP_COPY);
|
||||
|
||||
bgRect = bounds.InsetByCopy(48, 0);
|
||||
} else
|
||||
bgRect = bounds.InsetByCopy(16, 0);
|
||||
|
||||
// fill background besides the thumb
|
||||
BRect leftOfThumb(thumbBG.left, thumbBG.top, bgRect.left - 1,
|
||||
thumbBG.bottom);
|
||||
BRect rightOfThumb(bgRect.right + 1, thumbBG.top, thumbBG.right,
|
||||
thumbBG.bottom);
|
||||
|
||||
be_control_look->DrawScrollBarBackground(this, leftOfThumb,
|
||||
rightOfThumb, updateRect, normal, 0, B_HORIZONTAL);
|
||||
|
||||
// Draw scroll thumb
|
||||
|
||||
// fill the clickable surface of the thumb
|
||||
be_control_look->DrawButtonBackground(this, bgRect, updateRect,
|
||||
normal, 0, BControlLook::B_ALL_BORDERS, B_HORIZONTAL);
|
||||
|
||||
if (fKnobStyle == B_KNOB_STYLE_NONE)
|
||||
return;
|
||||
|
||||
// draw the scrollbar thumb knobs
|
||||
bool square = fKnobStyle == B_KNOB_STYLE_DOTS;
|
||||
int32 knobWidth = 0;
|
||||
int32 knobHeight = 0;
|
||||
|
||||
if (square) {
|
||||
knobWidth = 2;
|
||||
knobHeight = 2;
|
||||
} else {
|
||||
knobWidth = 1;
|
||||
knobHeight = 3;
|
||||
}
|
||||
|
||||
float hmiddle = bgRect.Width() / 2;
|
||||
float vmiddle = bgRect.Height() / 2;
|
||||
|
||||
BRect middleKnob = BRect(bgRect.left + hmiddle - knobWidth,
|
||||
bgRect.top + vmiddle - knobHeight,
|
||||
bgRect.left + hmiddle + knobWidth,
|
||||
bgRect.top + vmiddle + knobHeight);
|
||||
|
||||
BRect leftKnob = middleKnob.OffsetByCopy(knobWidth * -4, 0);
|
||||
be_control_look->DrawButtonBackground(this, leftKnob, updateRect,
|
||||
normal, 0, BControlLook::B_ALL_BORDERS, B_HORIZONTAL);
|
||||
|
||||
BRect rightKnob = middleKnob.OffsetByCopy(knobWidth * 4, 0);
|
||||
be_control_look->DrawButtonBackground(this, rightKnob, updateRect,
|
||||
normal, 0, BControlLook::B_ALL_BORDERS, B_HORIZONTAL);
|
||||
|
||||
// draw middle knob last because it modifies middleKnob
|
||||
be_control_look->DrawButtonBackground(this, middleKnob, updateRect,
|
||||
normal, 0, BControlLook::B_ALL_BORDERS, B_HORIZONTAL);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
FakeScrollBar::MouseDown(BPoint point)
|
||||
{
|
||||
BControl::MouseDown(point);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
FakeScrollBar::MouseMoved(BPoint point, uint32 transit,
|
||||
const BMessage* message)
|
||||
{
|
||||
BControl::MouseMoved(point, transit, message);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
FakeScrollBar::MouseUp(BPoint point)
|
||||
{
|
||||
SetValue(B_CONTROL_ON);
|
||||
Invoke();
|
||||
|
||||
Invalidate();
|
||||
|
||||
BControl::MouseUp(point);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
FakeScrollBar::SetValue(int32 value)
|
||||
{
|
||||
if (value != Value()) {
|
||||
BControl::SetValueNoUpdate(value);
|
||||
Invalidate();
|
||||
}
|
||||
|
||||
if (!value)
|
||||
return;
|
||||
|
||||
BView* parent = Parent();
|
||||
BView* child = NULL;
|
||||
|
||||
if (parent != NULL) {
|
||||
// If the parent is a BBox, the group parent is the parent of the BBox
|
||||
BBox* box = dynamic_cast<BBox*>(parent);
|
||||
|
||||
if (box && box->LabelView() == this)
|
||||
parent = box->Parent();
|
||||
|
||||
if (parent != NULL) {
|
||||
BBox* box = dynamic_cast<BBox*>(parent);
|
||||
|
||||
// If the parent is a BBox, skip the label if there is one
|
||||
if (box && box->LabelView())
|
||||
child = parent->ChildAt(1);
|
||||
else
|
||||
child = parent->ChildAt(0);
|
||||
} else
|
||||
child = Window()->ChildAt(0);
|
||||
} else if (Window())
|
||||
child = Window()->ChildAt(0);
|
||||
|
||||
while (child) {
|
||||
FakeScrollBar* scrollbar = dynamic_cast<FakeScrollBar*>(child);
|
||||
|
||||
if (scrollbar != NULL && (scrollbar != this))
|
||||
scrollbar->SetValue(B_CONTROL_OFF);
|
||||
else {
|
||||
// If the child is a BBox, check if the label is a scrollbarbutton
|
||||
BBox* box = dynamic_cast<BBox*>(child);
|
||||
|
||||
if (box && box->LabelView()) {
|
||||
scrollbar = dynamic_cast<FakeScrollBar*>(box->LabelView());
|
||||
|
||||
if (scrollbar != NULL && (scrollbar != this))
|
||||
scrollbar->SetValue(B_CONTROL_OFF);
|
||||
}
|
||||
}
|
||||
|
||||
child = child->NextSibling();
|
||||
}
|
||||
|
||||
//ASSERT(Value() == B_CONTROL_ON);
|
||||
}
|
||||
|
||||
|
||||
// #pragma mark -
|
||||
|
||||
|
||||
void
|
||||
FakeScrollBar::SetDoubleArrows(bool doubleArrows)
|
||||
{
|
||||
fDoubleArrows = doubleArrows;
|
||||
Invalidate();
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
FakeScrollBar::SetKnobStyle(uint32 knobStyle)
|
||||
{
|
||||
fKnobStyle = knobStyle;
|
||||
Invalidate();
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
FakeScrollBar::SetFromScrollBarInfo(const scroll_bar_info &info)
|
||||
{
|
||||
fDoubleArrows = info.double_arrows;
|
||||
fKnobStyle = info.knob;
|
||||
Invalidate();
|
||||
}
|
||||
|
||||
|
||||
// #pragma mark -
|
||||
|
||||
|
||||
void
|
||||
FakeScrollBar::_DrawArrowButton(int32 direction, bool doubleArrows, BRect r,
|
||||
const BRect& updateRect)
|
||||
{
|
||||
if (!updateRect.Intersects(r))
|
||||
return;
|
||||
|
||||
rgb_color c = ui_color(B_PANEL_BACKGROUND_COLOR);
|
||||
rgb_color light = tint_color(c, B_LIGHTEN_MAX_TINT);
|
||||
rgb_color dark = tint_color(c, B_DARKEN_1_TINT);
|
||||
rgb_color darker = tint_color(c, B_DARKEN_2_TINT);
|
||||
rgb_color normal = c;
|
||||
rgb_color arrow = tint_color(c,
|
||||
(B_DARKEN_MAX_TINT + B_DARKEN_4_TINT) / 2.0);
|
||||
|
||||
BPoint tri1, tri2, tri3;
|
||||
float hInset = r.Width() / 3;
|
||||
float vInset = r.Height() / 3;
|
||||
r.InsetBy(hInset, vInset);
|
||||
|
||||
switch (direction) {
|
||||
case ARROW_LEFT:
|
||||
tri1.Set(r.right, r.top);
|
||||
tri2.Set(r.right - r.Width() / 1.33, (r.top + r.bottom + 1) / 2);
|
||||
tri3.Set(r.right, r.bottom + 1);
|
||||
break;
|
||||
|
||||
case ARROW_RIGHT:
|
||||
tri1.Set(r.left, r.bottom + 1);
|
||||
tri2.Set(r.left + r.Width() / 1.33, (r.top + r.bottom + 1) / 2);
|
||||
tri3.Set(r.left, r.top);
|
||||
break;
|
||||
|
||||
case ARROW_UP:
|
||||
tri1.Set(r.left, r.bottom);
|
||||
tri2.Set((r.left + r.right + 1) / 2, r.bottom - r.Height() / 1.33);
|
||||
tri3.Set(r.right + 1, r.bottom);
|
||||
break;
|
||||
|
||||
default:
|
||||
tri1.Set(r.left, r.top);
|
||||
tri2.Set((r.left + r.right + 1) / 2, r.top + r.Height() / 1.33);
|
||||
tri3.Set(r.right + 1, r.top);
|
||||
break;
|
||||
}
|
||||
|
||||
r.InsetBy(-(hInset - 1), -(vInset - 1));
|
||||
BRect temp(r.InsetByCopy(-1, -1));
|
||||
be_control_look->DrawButtonBackground(this, temp, updateRect,
|
||||
normal, 0, BControlLook::B_ALL_BORDERS, B_HORIZONTAL);
|
||||
|
||||
BShape arrowShape;
|
||||
arrowShape.MoveTo(tri1);
|
||||
arrowShape.LineTo(tri2);
|
||||
arrowShape.LineTo(tri3);
|
||||
|
||||
SetHighColor(arrow);
|
||||
SetPenSize(ceilf(hInset / 2.0));
|
||||
StrokeShape(&arrowShape);
|
||||
SetPenSize(1.0);
|
||||
}
|
46
src/preferences/appearance/FakeScrollBar.h
Normal file
46
src/preferences/appearance/FakeScrollBar.h
Normal file
@ -0,0 +1,46 @@
|
||||
/*
|
||||
* Copyright 2010-2012 Haiku, Inc. All rights reserved.
|
||||
* Distributed under the terms of the MIT license.
|
||||
*
|
||||
* Authors:
|
||||
* DarkWyrm <bpmagic@columbus.rr.com>
|
||||
* John Scipione <jscipione@gmail.com>
|
||||
*/
|
||||
#ifndef FAKE_SCROLL_BAR_H
|
||||
#define FAKE_SCROLL_BAR_H
|
||||
|
||||
|
||||
#include <Control.h>
|
||||
|
||||
|
||||
class FakeScrollBar : public BControl {
|
||||
public:
|
||||
FakeScrollBar(bool drawArrows, bool doubleArrows,
|
||||
int32 knobStyle, BMessage* message);
|
||||
~FakeScrollBar(void);
|
||||
|
||||
virtual void MouseDown(BPoint point);
|
||||
virtual void MouseMoved(BPoint point, uint32 transit,
|
||||
const BMessage *message);
|
||||
virtual void MouseUp(BPoint point);
|
||||
|
||||
virtual void Draw(BRect updateRect);
|
||||
|
||||
virtual void SetValue(int32 value);
|
||||
|
||||
void SetDoubleArrows(bool doubleArrows);
|
||||
void SetKnobStyle(uint32 knobStyle);
|
||||
|
||||
void SetFromScrollBarInfo(const scroll_bar_info &info);
|
||||
|
||||
private:
|
||||
void _DrawArrowButton(int32 direction,
|
||||
bool doubleArrows, BRect r,
|
||||
const BRect& updateRect);
|
||||
|
||||
bool fDrawArrows;
|
||||
bool fDoubleArrows;
|
||||
int32 fKnobStyle;
|
||||
};
|
||||
|
||||
#endif // FAKE_SCROLL_BAR_H
|
@ -10,6 +10,7 @@ Preference Appearance :
|
||||
APRMain.cpp
|
||||
AntialiasingSettingsView.cpp
|
||||
LookAndFeelSettingsView.cpp
|
||||
FakeScrollBar.cpp
|
||||
FontSelectionView.cpp
|
||||
FontView.cpp
|
||||
APRView.cpp
|
||||
|
@ -3,8 +3,9 @@
|
||||
* Distributed under the terms of the MIT license.
|
||||
*
|
||||
* Authors:
|
||||
* Alexander von Gluck, kallisti5@unixzen.com
|
||||
* Stephan Aßmus <superstippi@gmx.de>
|
||||
* Alexander von Gluck <kallisti5@unixzen.com>
|
||||
* John Scipione <jscipione@gmail.com>
|
||||
* Ryan Leavengood <leavengood@gmail.com>
|
||||
*/
|
||||
|
||||
@ -22,15 +23,22 @@
|
||||
#include <GridLayoutBuilder.h>
|
||||
#include <GroupLayoutBuilder.h>
|
||||
#include <InterfaceDefs.h>
|
||||
#include <LayoutBuilder.h>
|
||||
#include <Locale.h>
|
||||
#include <MenuField.h>
|
||||
#include <MenuItem.h>
|
||||
#include <PopUpMenu.h>
|
||||
#include <RadioButton.h>
|
||||
#include <ScrollBar.h>
|
||||
#include <StringView.h>
|
||||
#include <Size.h>
|
||||
#include <Slider.h>
|
||||
#include <SpaceLayoutItem.h>
|
||||
#include <StringView.h>
|
||||
#include <TextView.h>
|
||||
|
||||
#include "APRWindow.h"
|
||||
#include "FakeScrollBar.h"
|
||||
|
||||
|
||||
#undef B_TRANSLATION_CONTEXT
|
||||
@ -40,9 +48,17 @@
|
||||
|
||||
static const int32 kMsgSetDecor = 'deco';
|
||||
static const int32 kMsgDecorInfo = 'idec';
|
||||
static const int32 kMsgDoubleScrollbarArrows = 'dsba';
|
||||
|
||||
static const bool kDefaultDoubleScrollbarArrowsSetting = false;
|
||||
static const int32 kMsgDoubleScrollBarArrows = 'dsba';
|
||||
|
||||
static const int32 kMsgArrowStyleSingle = 'mass';
|
||||
static const int32 kMsgArrowStyleDouble = 'masd';
|
||||
|
||||
static const int32 kMsgKnobStyleNone = 'mksn';
|
||||
static const int32 kMsgKnobStyleDots = 'mksd';
|
||||
static const int32 kMsgKnobStyleLines = 'mksl';
|
||||
|
||||
static const bool kDefaultDoubleScrollBarArrowsSetting = false;
|
||||
|
||||
|
||||
// #pragma mark -
|
||||
@ -53,8 +69,7 @@ LookAndFeelSettingsView::LookAndFeelSettingsView(const char* name)
|
||||
BView(name, 0),
|
||||
fDecorInfoButton(NULL),
|
||||
fDecorMenuField(NULL),
|
||||
fDecorMenu(NULL),
|
||||
fDoubleScrollbarArrowsCheckBox(NULL)
|
||||
fDecorMenu(NULL)
|
||||
{
|
||||
// Decorator menu
|
||||
_BuildDecorMenu();
|
||||
@ -64,24 +79,79 @@ LookAndFeelSettingsView::LookAndFeelSettingsView(const char* name)
|
||||
fDecorInfoButton = new BButton(B_TRANSLATE("About"),
|
||||
new BMessage(kMsgDecorInfo));
|
||||
|
||||
fDoubleScrollbarArrowsCheckBox = new BCheckBox("doubleScrollbarArrows",
|
||||
B_TRANSLATE("Use double scrollbar arrows"),
|
||||
new BMessage(kMsgDoubleScrollbarArrows));
|
||||
// scrollbar arrow style
|
||||
BBox* arrowStyleBox = new BBox("arrow style");
|
||||
arrowStyleBox->SetLabel(B_TRANSLATE("Arrow style"));
|
||||
|
||||
fSavedDoubleArrowsValue = _GetDoubleScrollbarArrowsSetting();
|
||||
fDoubleScrollbarArrowsCheckBox->SetValue(fSavedDoubleArrowsValue);
|
||||
fSavedDoubleArrowsValue = _DoubleScrollBarArrows();
|
||||
|
||||
fArrowStyleSingle = new FakeScrollBar(true, false, B_KNOB_STYLE_LINES,
|
||||
new BMessage(kMsgArrowStyleSingle));
|
||||
fArrowStyleDouble = new FakeScrollBar(true, true, B_KNOB_STYLE_LINES,
|
||||
new BMessage(kMsgArrowStyleDouble));
|
||||
|
||||
BView* arrowStyleView;
|
||||
arrowStyleView = BLayoutBuilder::Group<>()
|
||||
.AddGroup(B_VERTICAL, 1)
|
||||
.Add(new BStringView("single", B_TRANSLATE("Single:")))
|
||||
.Add(fArrowStyleSingle)
|
||||
.Add(new BStringView("spacer", ""))
|
||||
.Add(new BStringView("double", B_TRANSLATE("Double:")))
|
||||
.Add(fArrowStyleDouble)
|
||||
.Add(BSpaceLayoutItem::CreateVerticalStrut(0))
|
||||
.SetInsets(B_USE_DEFAULT_SPACING, B_USE_DEFAULT_SPACING,
|
||||
B_USE_DEFAULT_SPACING, B_USE_DEFAULT_SPACING)
|
||||
.End()
|
||||
.View();
|
||||
arrowStyleBox->AddChild(arrowStyleView);
|
||||
|
||||
// scrollbar knob style
|
||||
fSavedKnobStyleValue = _ScrollBarKnobStyle();
|
||||
|
||||
BBox* knobStyleBox = new BBox("knob style");
|
||||
knobStyleBox->SetLabel(B_TRANSLATE("Knob style"));
|
||||
|
||||
fKnobStyleNone = new FakeScrollBar(false, false, B_KNOB_STYLE_NONE,
|
||||
new BMessage(kMsgKnobStyleNone));
|
||||
fKnobStyleDots = new FakeScrollBar(false, false, B_KNOB_STYLE_DOTS,
|
||||
new BMessage(kMsgKnobStyleDots));
|
||||
fKnobStyleLines = new FakeScrollBar(false, false, B_KNOB_STYLE_LINES,
|
||||
new BMessage(kMsgKnobStyleLines));
|
||||
|
||||
BView* knobStyleView;
|
||||
knobStyleView = BLayoutBuilder::Group<>()
|
||||
.AddGroup(B_VERTICAL, 0)
|
||||
.Add(fKnobStyleNone)
|
||||
.Add(new BStringView("spacer", ""))
|
||||
.Add(fKnobStyleDots)
|
||||
.Add(new BStringView("spacer", ""))
|
||||
.Add(fKnobStyleLines)
|
||||
.SetInsets(B_USE_DEFAULT_SPACING, B_USE_DEFAULT_SPACING,
|
||||
B_USE_DEFAULT_SPACING, B_USE_DEFAULT_SPACING)
|
||||
.End()
|
||||
.View();
|
||||
knobStyleBox->AddChild(knobStyleView);
|
||||
|
||||
SetLayout(new BGroupLayout(B_VERTICAL));
|
||||
|
||||
// control layout
|
||||
AddChild(BGridLayoutBuilder(10, 10)
|
||||
.Add(fDecorMenuField->CreateLabelLayoutItem(), 0, 0)
|
||||
.Add(fDecorMenuField->CreateMenuBarLayoutItem(), 1, 0)
|
||||
.Add(fDecorInfoButton, 2, 0)
|
||||
|
||||
.Add(fDoubleScrollbarArrowsCheckBox, 0, 3, 2)
|
||||
.Add(BSpaceLayoutItem::CreateGlue(), 0, 4, 2)
|
||||
.SetInsets(10, 10, 10, 10)
|
||||
AddChild(BGroupLayoutBuilder(B_VERTICAL, B_USE_DEFAULT_SPACING)
|
||||
.AddGroup(B_VERTICAL, B_USE_DEFAULT_SPACING)
|
||||
.Add(BGridLayoutBuilder(B_USE_DEFAULT_SPACING,
|
||||
B_USE_DEFAULT_SPACING)
|
||||
.Add(fDecorMenuField->CreateLabelLayoutItem(), 0, 0)
|
||||
.Add(fDecorMenuField->CreateMenuBarLayoutItem(), 1, 0)
|
||||
.Add(fDecorInfoButton, 2, 0)
|
||||
)
|
||||
.Add(new BStringView("label", B_TRANSLATE("Scroll bars:")))
|
||||
.AddGroup(B_HORIZONTAL, B_USE_DEFAULT_SPACING)
|
||||
.Add(arrowStyleBox)
|
||||
.Add(knobStyleBox)
|
||||
.End()
|
||||
.AddGlue()
|
||||
.End()
|
||||
.SetInsets(B_USE_DEFAULT_SPACING, B_USE_DEFAULT_SPACING,
|
||||
B_USE_DEFAULT_SPACING, B_USE_DEFAULT_SPACING)
|
||||
);
|
||||
// TODO : Decorator Preview Image?
|
||||
}
|
||||
@ -102,7 +172,30 @@ LookAndFeelSettingsView::AttachedToWindow()
|
||||
|
||||
fDecorMenu->SetTargetForItems(this);
|
||||
fDecorInfoButton->SetTarget(this);
|
||||
fDoubleScrollbarArrowsCheckBox->SetTarget(this);
|
||||
fArrowStyleSingle->SetTarget(this);
|
||||
fArrowStyleDouble->SetTarget(this);
|
||||
fKnobStyleNone->SetTarget(this);
|
||||
fKnobStyleDots->SetTarget(this);
|
||||
fKnobStyleLines->SetTarget(this);
|
||||
|
||||
if (fSavedDoubleArrowsValue)
|
||||
fArrowStyleDouble->SetValue(B_CONTROL_ON);
|
||||
else
|
||||
fArrowStyleSingle->SetValue(B_CONTROL_ON);
|
||||
|
||||
switch (fSavedKnobStyleValue) {
|
||||
case B_KNOB_STYLE_NONE:
|
||||
fKnobStyleNone->SetValue(B_CONTROL_ON);
|
||||
break;
|
||||
|
||||
case B_KNOB_STYLE_DOTS:
|
||||
fKnobStyleDots->SetValue(B_CONTROL_ON);
|
||||
break;
|
||||
|
||||
case B_KNOB_STYLE_LINES:
|
||||
fKnobStyleLines->SetValue(B_CONTROL_ON);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -117,6 +210,7 @@ LookAndFeelSettingsView::MessageReceived(BMessage *msg)
|
||||
_SetDecor(newDecor);
|
||||
break;
|
||||
}
|
||||
|
||||
case kMsgDecorInfo:
|
||||
{
|
||||
DecorInfo* decor = fDecorUtility.FindDecorator(fCurrentDecor);
|
||||
@ -145,8 +239,25 @@ LookAndFeelSettingsView::MessageReceived(BMessage *msg)
|
||||
|
||||
break;
|
||||
}
|
||||
case kMsgDoubleScrollbarArrows:
|
||||
_SetDoubleScrollbarArrowsSetting(fDoubleScrollbarArrowsCheckBox->Value());
|
||||
|
||||
case kMsgArrowStyleSingle:
|
||||
_SetDoubleScrollBarArrows(false);
|
||||
break;
|
||||
|
||||
case kMsgArrowStyleDouble:
|
||||
_SetDoubleScrollBarArrows(true);
|
||||
break;
|
||||
|
||||
case kMsgKnobStyleNone:
|
||||
_SetScrollBarKnobStyle(B_KNOB_STYLE_NONE);
|
||||
break;
|
||||
|
||||
case kMsgKnobStyleDots:
|
||||
_SetScrollBarKnobStyle(B_KNOB_STYLE_DOTS);
|
||||
break;
|
||||
|
||||
case kMsgKnobStyleLines:
|
||||
_SetScrollBarKnobStyle(B_KNOB_STYLE_LINES);
|
||||
break;
|
||||
|
||||
default:
|
||||
@ -221,7 +332,7 @@ LookAndFeelSettingsView::_AdoptInterfaceToCurrentDecor()
|
||||
|
||||
|
||||
bool
|
||||
LookAndFeelSettingsView::_GetDoubleScrollbarArrowsSetting()
|
||||
LookAndFeelSettingsView::_DoubleScrollBarArrows()
|
||||
{
|
||||
scroll_bar_info info;
|
||||
get_scroll_bar_info(&info);
|
||||
@ -231,42 +342,84 @@ LookAndFeelSettingsView::_GetDoubleScrollbarArrowsSetting()
|
||||
|
||||
|
||||
void
|
||||
LookAndFeelSettingsView::_SetDoubleScrollbarArrowsSetting(bool value)
|
||||
LookAndFeelSettingsView::_SetDoubleScrollBarArrows(bool doubleArrows)
|
||||
{
|
||||
scroll_bar_info info;
|
||||
get_scroll_bar_info(&info);
|
||||
|
||||
info.double_arrows = value;
|
||||
info.double_arrows = doubleArrows;
|
||||
set_scroll_bar_info(&info);
|
||||
|
||||
if (doubleArrows)
|
||||
fArrowStyleDouble->SetValue(B_CONTROL_ON);
|
||||
else
|
||||
fArrowStyleSingle->SetValue(B_CONTROL_ON);
|
||||
|
||||
Window()->PostMessage(kMsgUpdate);
|
||||
}
|
||||
|
||||
|
||||
int32
|
||||
LookAndFeelSettingsView::_ScrollBarKnobStyle()
|
||||
{
|
||||
scroll_bar_info info;
|
||||
get_scroll_bar_info(&info);
|
||||
|
||||
return info.knob;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
LookAndFeelSettingsView::_SetScrollBarKnobStyle(int32 knobStyle)
|
||||
{
|
||||
scroll_bar_info info;
|
||||
get_scroll_bar_info(&info);
|
||||
|
||||
info.knob = knobStyle;
|
||||
set_scroll_bar_info(&info);
|
||||
|
||||
switch (knobStyle) {
|
||||
case B_KNOB_STYLE_NONE:
|
||||
fKnobStyleNone->SetValue(B_CONTROL_ON);
|
||||
break;
|
||||
|
||||
case B_KNOB_STYLE_DOTS:
|
||||
fKnobStyleDots->SetValue(B_CONTROL_ON);
|
||||
break;
|
||||
|
||||
case B_KNOB_STYLE_LINES:
|
||||
fKnobStyleLines->SetValue(B_CONTROL_ON);
|
||||
break;
|
||||
}
|
||||
|
||||
Window()->PostMessage(kMsgUpdate);
|
||||
}
|
||||
|
||||
|
||||
bool
|
||||
LookAndFeelSettingsView::IsDefaultable()
|
||||
{
|
||||
return fCurrentDecor != fDecorUtility.DefaultDecorator()->Name()
|
||||
|| _DoubleScrollBarArrows() != false
|
||||
|| _ScrollBarKnobStyle() != B_KNOB_STYLE_DOTS;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
LookAndFeelSettingsView::SetDefaults()
|
||||
{
|
||||
_SetDecor(fDecorUtility.DefaultDecorator());
|
||||
_SetDoubleScrollbarArrowsSetting(kDefaultDoubleScrollbarArrowsSetting);
|
||||
fDoubleScrollbarArrowsCheckBox->SetValue(
|
||||
kDefaultDoubleScrollbarArrowsSetting);
|
||||
}
|
||||
|
||||
|
||||
bool
|
||||
LookAndFeelSettingsView::IsDefaultable()
|
||||
{
|
||||
return fCurrentDecor != fDecorUtility.DefaultDecorator()->Name() ||
|
||||
fDoubleScrollbarArrowsCheckBox->Value() !=
|
||||
kDefaultDoubleScrollbarArrowsSetting;
|
||||
_SetDoubleScrollBarArrows(false);
|
||||
_SetScrollBarKnobStyle(B_KNOB_STYLE_DOTS);
|
||||
}
|
||||
|
||||
|
||||
bool
|
||||
LookAndFeelSettingsView::IsRevertable()
|
||||
{
|
||||
return fCurrentDecor != fSavedDecor ||
|
||||
fDoubleScrollbarArrowsCheckBox->Value() != fSavedDoubleArrowsValue;
|
||||
return fCurrentDecor != fSavedDecor
|
||||
|| _DoubleScrollBarArrows() != fSavedDoubleArrowsValue
|
||||
|| _ScrollBarKnobStyle() != fSavedKnobStyleValue;
|
||||
}
|
||||
|
||||
|
||||
@ -274,6 +427,6 @@ void
|
||||
LookAndFeelSettingsView::Revert()
|
||||
{
|
||||
_SetDecor(fSavedDecor);
|
||||
_SetDoubleScrollbarArrowsSetting(fSavedDoubleArrowsValue);
|
||||
fDoubleScrollbarArrowsCheckBox->SetValue(fSavedDoubleArrowsValue);
|
||||
_SetScrollBarKnobStyle(fSavedKnobStyleValue);
|
||||
_SetDoubleScrollBarArrows(fSavedDoubleArrowsValue);
|
||||
}
|
||||
|
@ -2,9 +2,10 @@
|
||||
* Copyright 2010-2012 Haiku, Inc. All rights reserved.
|
||||
* Distributed under the terms of the MIT license.
|
||||
*
|
||||
* Authors:
|
||||
* Alexander von Gluck, kallisti5@unixzen.com
|
||||
* Authors:
|
||||
* Stephan Aßmus <superstippi@gmx.de>
|
||||
* Alexander von Gluck <kallisti5@unixzen.com>
|
||||
* John Scipione <jscipione@gmail.com>
|
||||
* Ryan Leavengood <leavengood@gmail.com>
|
||||
*/
|
||||
#ifndef LOOK_AND_FEEL_SETTINGS_VIEW_H
|
||||
@ -20,7 +21,7 @@ class BButton;
|
||||
class BCheckBox;
|
||||
class BMenuField;
|
||||
class BPopUpMenu;
|
||||
|
||||
class FakeScrollBar;
|
||||
|
||||
class LookAndFeelSettingsView : public BView {
|
||||
public:
|
||||
@ -30,10 +31,11 @@ public:
|
||||
virtual void AttachedToWindow();
|
||||
virtual void MessageReceived(BMessage* message);
|
||||
|
||||
void SetDefaults();
|
||||
void Revert();
|
||||
bool IsDefaultable();
|
||||
void SetDefaults();
|
||||
|
||||
bool IsRevertable();
|
||||
void Revert();
|
||||
|
||||
private:
|
||||
void _SetDecor(const BString& name);
|
||||
@ -42,8 +44,12 @@ private:
|
||||
void _BuildDecorMenu();
|
||||
void _AdoptToCurrentDecor();
|
||||
void _AdoptInterfaceToCurrentDecor();
|
||||
bool _GetDoubleScrollbarArrowsSetting();
|
||||
void _SetDoubleScrollbarArrowsSetting(bool value);
|
||||
|
||||
bool _DoubleScrollBarArrows();
|
||||
void _SetDoubleScrollBarArrows(bool doubleArrows);
|
||||
|
||||
int32 _ScrollBarKnobStyle();
|
||||
void _SetScrollBarKnobStyle(int32 knobStyle);
|
||||
|
||||
private:
|
||||
DecorInfoUtility fDecorUtility;
|
||||
@ -51,11 +57,19 @@ private:
|
||||
BButton* fDecorInfoButton;
|
||||
BMenuField* fDecorMenuField;
|
||||
BPopUpMenu* fDecorMenu;
|
||||
BCheckBox* fDoubleScrollbarArrowsCheckBox;
|
||||
|
||||
FakeScrollBar* fArrowStyleSingle;
|
||||
FakeScrollBar* fArrowStyleDouble;
|
||||
|
||||
FakeScrollBar* fKnobStyleNone;
|
||||
FakeScrollBar* fKnobStyleDots;
|
||||
FakeScrollBar* fKnobStyleLines;
|
||||
|
||||
BString fSavedDecor;
|
||||
BString fCurrentDecor;
|
||||
|
||||
bool fSavedDoubleArrowsValue;
|
||||
int32 fSavedKnobStyleValue;
|
||||
};
|
||||
|
||||
#endif // LOOK_AND_FEEL_SETTINGS_VIEW_H
|
||||
|
Loading…
Reference in New Issue
Block a user