Author: bonefish Date: 2011-06-14 13:42:49 +0200 (Tue, 14 Jun 2011) New Revision: 42179 Changeset: https://dev.haiku-os.org/changeset/42179 Added: haiku/trunk/headers/build/os/drivers/KernelExport.h haiku/trunk/headers/build/os/interface/Size.h haiku/trunk/headers/build/os/support/ObjectList.h haiku/trunk/headers/build/private/kernel/util/ haiku/trunk/headers/build/private/kernel/util/KMessage.h haiku/trunk/headers/build/private/shared/AutoLocker.h Removed: haiku/trunk/headers/build/os/storage/StorageDefs.Private.h haiku/trunk/headers/build/private/shared/ObjectLocker.h haiku/trunk/src/build/libbe/app/MessageAdapter.cpp haiku/trunk/src/build/libbe/app/MessageUtils.cpp haiku/trunk/src/build/libbe/app/TypeConstants.cpp haiku/trunk/src/build/libbe/interface/Point.cpp haiku/trunk/src/build/libbe/interface/Rect.cpp haiku/trunk/src/build/libbe/interface/Region.cpp haiku/trunk/src/build/libbe/interface/RegionSupport.cpp haiku/trunk/src/build/libbe/storage/EntryList.cpp haiku/trunk/src/build/libbe/storage/FileIO.cpp haiku/trunk/src/build/libbe/storage/FindDirectory.cpp haiku/trunk/src/build/libbe/storage/OffsetFile.cpp haiku/trunk/src/build/libbe/storage/Path.cpp haiku/trunk/src/build/libbe/storage/ResourceFile.cpp haiku/trunk/src/build/libbe/storage/ResourceItem.cpp haiku/trunk/src/build/libbe/storage/ResourceStrings.cpp haiku/trunk/src/build/libbe/storage/Resources.cpp haiku/trunk/src/build/libbe/storage/ResourcesContainer.cpp haiku/trunk/src/build/libbe/storage/SymLink.cpp haiku/trunk/src/build/libbe/storage/storage_support.cpp haiku/trunk/src/build/libbe/support/Beep.cpp haiku/trunk/src/build/libbe/support/BlockCache.cpp haiku/trunk/src/build/libbe/support/ByteOrder.cpp haiku/trunk/src/build/libbe/support/DataBuffer.cpp haiku/trunk/src/build/libbe/support/DataIO.cpp haiku/trunk/src/build/libbe/support/Flattenable.cpp haiku/trunk/src/build/libbe/support/List.cpp haiku/trunk/src/build/libbe/support/Locker.cpp haiku/trunk/src/build/libbe/support/PointerList.cpp haiku/trunk/src/build/libbe/support/StopWatch.cpp haiku/trunk/src/build/libbe/support/String.cpp Modified: haiku/trunk/build/jam/BuildSetup haiku/trunk/headers/build/config_build/types.h haiku/trunk/headers/build/os/app/AppDefs.h haiku/trunk/headers/build/os/app/Handler.h haiku/trunk/headers/build/os/app/Looper.h haiku/trunk/headers/build/os/app/MessageQueue.h haiku/trunk/headers/build/os/interface/GraphicsDefs.h haiku/trunk/headers/build/os/interface/InterfaceDefs.h haiku/trunk/headers/build/os/interface/Point.h haiku/trunk/headers/build/os/interface/Rect.h haiku/trunk/headers/build/os/interface/Region.h haiku/trunk/headers/build/os/kernel/OS.h haiku/trunk/headers/build/os/storage/Directory.h haiku/trunk/headers/build/os/storage/DiskDeviceDefs.h haiku/trunk/headers/build/os/storage/EntryList.h haiku/trunk/headers/build/os/storage/File.h haiku/trunk/headers/build/os/storage/FindDirectory.h haiku/trunk/headers/build/os/storage/NodeMonitor.h haiku/trunk/headers/build/os/storage/Path.h haiku/trunk/headers/build/os/storage/ResourceStrings.h haiku/trunk/headers/build/os/storage/Resources.h haiku/trunk/headers/build/os/storage/StorageDefs.h haiku/trunk/headers/build/os/storage/SymLink.h haiku/trunk/headers/build/os/support/BlockCache.h haiku/trunk/headers/build/os/support/ByteOrder.h haiku/trunk/headers/build/os/support/DataIO.h haiku/trunk/headers/build/os/support/Debug.h haiku/trunk/headers/build/os/support/Flattenable.h haiku/trunk/headers/build/os/support/List.h haiku/trunk/headers/build/os/support/Locker.h haiku/trunk/headers/build/os/support/String.h haiku/trunk/headers/build/os/support/SupportDefs.h haiku/trunk/headers/build/os/support/TypeConstants.h haiku/trunk/headers/build/private/app/LooperList.h haiku/trunk/headers/build/private/app/MessageAdapter.h haiku/trunk/headers/build/private/app/MessageUtils.h haiku/trunk/headers/build/private/app/RegistrarDefs.h haiku/trunk/headers/build/private/app/TokenSpace.h haiku/trunk/headers/build/private/interface/RegionSupport.h haiku/trunk/headers/build/private/interface/clipping.h haiku/trunk/headers/build/private/interface/utf8_functions.h haiku/trunk/headers/build/private/shared/AutoDeleter.h haiku/trunk/headers/build/private/shared/Keymap.h haiku/trunk/headers/build/private/storage/Elf.h haiku/trunk/headers/build/private/storage/ElfX.h haiku/trunk/headers/build/private/storage/Exception.h haiku/trunk/headers/build/private/storage/FileIO.h haiku/trunk/headers/build/private/storage/MimeTypes.h haiku/trunk/headers/build/private/storage/OffsetFile.h haiku/trunk/headers/build/private/storage/Pef.h haiku/trunk/headers/build/private/storage/ResourceFile.h haiku/trunk/headers/build/private/storage/ResourceItem.h haiku/trunk/headers/build/private/storage/ResourcesContainer.h haiku/trunk/headers/build/private/storage/ResourcesDefs.h haiku/trunk/headers/build/private/storage/storage_support.h haiku/trunk/src/build/libbe/app/Jamfile haiku/trunk/src/build/libbe/app/Message.cpp haiku/trunk/src/build/libbe/interface/Jamfile haiku/trunk/src/build/libbe/storage/Entry.cpp haiku/trunk/src/build/libbe/storage/File.cpp haiku/trunk/src/build/libbe/storage/Jamfile haiku/trunk/src/build/libbe/support/Jamfile haiku/trunk/src/build/libroot/Jamfile Log: * Added KMessage to libroot_build. * libbe_build: Where possible we directly use the actual Haiku headers and sources, now. In the headers/build headers we just include the respective Haiku headers as needed. That still allows overrides where necessary. The intention is to make it easier to keep the build stuff in sync. * Fixed a few printf() format and signed/unsigned comparison warnings. Modified: haiku/trunk/build/jam/BuildSetup =================================================================== --- haiku/trunk/build/jam/BuildSetup 2011-06-14 11:29:08 UTC (rev 42178) +++ haiku/trunk/build/jam/BuildSetup 2011-06-14 11:42:49 UTC (rev 42179) @@ -883,6 +883,7 @@ [ FDirName $(HAIKU_TOP) headers build os opengl ] [ FDirName $(HAIKU_TOP) headers build os storage ] [ FDirName $(HAIKU_TOP) headers build os support ] + [ FDirName $(HAIKU_TOP) headers build private ] ; HOST_BE_API_CCFLAGS = -include BeOSBuildCompatibility.h ; HOST_BE_API_C++FLAGS = $(HOST_BE_API_CCFLAGS) ; Modified: haiku/trunk/headers/build/config_build/types.h =================================================================== --- haiku/trunk/headers/build/config_build/types.h 2011-06-14 11:29:08 UTC (rev 42178) +++ haiku/trunk/headers/build/config_build/types.h 2011-06-14 11:42:49 UTC (rev 42179) @@ -1,5 +1,5 @@ /* - * Copyright 2009-2010, Haiku, Inc. All Rights Reserved. + * Copyright 2009-2011, Haiku, Inc. All Rights Reserved. * Distributed under the terms of the MIT License. */ #ifndef _CONFIG_BUILD_TYPES_H @@ -70,13 +70,42 @@ #endif #define __HAIKU_PHYS_SADDR_MIN (-__HAIKU_SADDR_MAX-1) + +/* printf()/scanf() format prefixes */ +/* TODO: The following are only guesses! We should define them in the + build/host headers. */ +#define __HAIKU_STD_PRI_PREFIX_32 "" +#ifdef __HAIKU_ARCH_64_BIT +# define __HAIKU_STD_PRI_PREFIX_64 "l" +#else +# define __HAIKU_STD_PRI_PREFIX_64 "ll" +#endif + +#define __HAIKU_PRI_PREFIX_32 __HAIKU_STD_PRI_PREFIX_32 +#define __HAIKU_PRI_PREFIX_64 __HAIKU_STD_PRI_PREFIX_64 + +#ifdef __HAIKU_ARCH_64_BIT +# define __HAIKU_PRI_PREFIX_ADDR __HAIKU_PRI_PREFIX_64 +#else +# define __HAIKU_PRI_PREFIX_ADDR __HAIKU_PRI_PREFIX_32 +#endif + +#ifdef __HAIKU_ARCH_PHYSICAL_64_BIT +# define __HAIKU_PRI_PREFIX_PHYS_ADDR __HAIKU_PRI_PREFIX_64 +#else +# define __HAIKU_PRI_PREFIX_PHYS_ADDR __HAIKU_PRI_PREFIX_32 +#endif + + /* a generic address type wide enough for virtual and physical addresses */ #if __HAIKU_ARCH_BITS >= __HAIKU_ARCH_PHYSICAL_BITS typedef __haiku_addr_t __haiku_generic_addr_t; # define __HAIKU_GENERIC_ADDR_MAX __HAIKU_ADDR_MAX +# define __HAIKU_PRI_PREFIX_GENERIC_ADDR __HAIKU_PRI_PREFIX_ADDR #else typedef __haiku_phys_addr_t __haiku_generic_addr_t; # define __HAIKU_GENERIC_ADDR_MAX __HAIKU_PHYS_ADDR_MAX +# define __HAIKU_PRI_PREFIX_GENERIC_ADDR __HAIKU_PRI_PREFIX_PHYS_ADDR #endif Modified: haiku/trunk/headers/build/os/app/AppDefs.h =================================================================== --- haiku/trunk/headers/build/os/app/AppDefs.h 2011-06-14 11:29:08 UTC (rev 42178) +++ haiku/trunk/headers/build/os/app/AppDefs.h 2011-06-14 11:42:49 UTC (rev 42179) @@ -1,170 +1 @@ -//------------------------------------------------------------------------------ -// 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: AppDefs.h -// Author: Erik Jaesler (erik@xxxxxxxxxxxxxx) -// Description: Message codes and the global cursors. -//------------------------------------------------------------------------------ - -#ifndef _APP_DEFS_H -#define _APP_DEFS_H - -// Standard Includes ----------------------------------------------------------- - -// System Includes ------------------------------------------------------------- -#include <BeBuild.h> - -// Project Includes ------------------------------------------------------------ - -// Local Includes -------------------------------------------------------------- - -// Local Defines --------------------------------------------------------------- - -// Globals --------------------------------------------------------------------- - - -// Global Cursors -------------------------------------------------------------- - -// Old-style cursors -extern const unsigned char B_HAND_CURSOR[]; -extern const unsigned char B_I_BEAM_CURSOR[]; - -// New-style cursors -#ifdef __cplusplus -class BCursor; -extern const BCursor *B_CURSOR_SYSTEM_DEFAULT; -extern const BCursor *B_CURSOR_I_BEAM; -#endif - -// System Message Codes -------------------------------------------------------- - -enum { - B_ABOUT_REQUESTED = '_ABR', - B_WINDOW_ACTIVATED = '_ACT', - B_APP_ACTIVATED = '_ACT', // Same as B_WINDOW_ACTIVATED - B_ARGV_RECEIVED = '_ARG', - B_QUIT_REQUESTED = '_QRQ', - B_CLOSE_REQUESTED = '_QRQ', // Obsolete; use B_QUIT_REQUESTED - B_CANCEL = '_CNC', - B_KEY_DOWN = '_KYD', - B_KEY_UP = '_KYU', - B_UNMAPPED_KEY_DOWN = '_UKD', - B_UNMAPPED_KEY_UP = '_UKU', - B_MODIFIERS_CHANGED = '_MCH', - B_MINIMIZE = '_WMN', - B_MOUSE_DOWN = '_MDN', - B_MOUSE_MOVED = '_MMV', - B_MOUSE_ENTER_EXIT = '_MEX', - B_MOUSE_UP = '_MUP', - B_MOUSE_WHEEL_CHANGED = '_MWC', - B_OPEN_IN_WORKSPACE = '_OWS', - B_PRINTER_CHANGED = '_PCH', - B_PULSE = '_PUL', - B_READY_TO_RUN = '_RTR', - B_REFS_RECEIVED = '_RRC', - B_RELEASE_OVERLAY_LOCK = '_ROV', - B_ACQUIRE_OVERLAY_LOCK = '_AOV', - B_SCREEN_CHANGED = '_SCH', - B_VALUE_CHANGED = '_VCH', - B_VIEW_MOVED = '_VMV', - B_VIEW_RESIZED = '_VRS', - B_WINDOW_MOVED = '_WMV', - B_WINDOW_RESIZED = '_WRS', - B_WORKSPACES_CHANGED = '_WCG', - B_WORKSPACE_ACTIVATED = '_WAC', - B_ZOOM = '_WZM', - _COLORS_UPDATED = '_CLU', // Currently internal-use only. Later, public as B_COLORS_UPDATED - _FONTS_UPDATED = '_FNU', // Currently internal-use only. Later, public as B_FONTS_UPDATED - _APP_MENU_ = '_AMN', - _BROWSER_MENUS_ = '_BRM', - _MENU_EVENT_ = '_MEV', - _PING_ = '_PBL', - _QUIT_ = '_QIT', - _VOLUME_MOUNTED_ = '_NVL', - _VOLUME_UNMOUNTED_ = '_VRM', - _MESSAGE_DROPPED_ = '_MDP', - _DISPOSE_DRAG_ = '_DPD', - _MENUS_DONE_ = '_MND', - _SHOW_DRAG_HANDLES_ = '_SDH', - _EVENTS_PENDING_ = '_EVP', - _UPDATE_ = '_UPD', - _UPDATE_IF_NEEDED_ = '_UPN', - _PRINTER_INFO_ = '_PIN', - _SETUP_PRINTER_ = '_SUP', - _SELECT_PRINTER_ = '_PSL' - // Media Kit reserves all reserved codes starting in '_TR' -}; - - -// Other Commands -------------------------------------------------------------- - -enum { - B_SET_PROPERTY = 'PSET', - B_GET_PROPERTY = 'PGET', - B_CREATE_PROPERTY = 'PCRT', - B_DELETE_PROPERTY = 'PDEL', - B_COUNT_PROPERTIES = 'PCNT', - B_EXECUTE_PROPERTY = 'PEXE', - B_GET_SUPPORTED_SUITES = 'SUIT', - B_UNDO = 'UNDO', - B_REDO = 'REDO', - B_CUT = 'CCUT', - B_COPY = 'COPY', - B_PASTE = 'PSTE', - B_SELECT_ALL = 'SALL', - B_SAVE_REQUESTED = 'SAVE', - B_MESSAGE_NOT_UNDERSTOOD = 'MNOT', - B_NO_REPLY = 'NONE', - B_REPLY = 'RPLY', - B_SIMPLE_DATA = 'DATA', - B_MIME_DATA = 'MIME', - B_ARCHIVED_OBJECT = 'ARCV', - B_UPDATE_STATUS_BAR = 'SBUP', - B_RESET_STATUS_BAR = 'SBRS', - B_NODE_MONITOR = 'NDMN', - B_QUERY_UPDATE = 'QUPD', - B_ENDORSABLE = 'ENDO', - B_COPY_TARGET = 'DDCP', - B_MOVE_TARGET = 'DDMV', - B_TRASH_TARGET = 'DDRM', - B_LINK_TARGET = 'DDLN', - B_INPUT_DEVICES_CHANGED = 'IDCH', - B_INPUT_METHOD_EVENT = 'IMEV', - B_WINDOW_MOVE_TO = 'WDMT', - B_WINDOW_MOVE_BY = 'WDMB', - B_SILENT_RELAUNCH = 'AREL', - B_OBSERVER_NOTICE_CHANGE = 'NTCH', - B_CONTROL_INVOKED = 'CIVK', - B_CONTROL_MODIFIED = 'CMOD' - - // Media Kit reserves all reserved codes starting in 'TRI' -}; -//------------------------------------------------------------------------------ - -#endif // _APP_DEFS_H - -/* - * $Log $ - * - * $Id $ - * - */ - +#include <../os/app/AppDefs.h> Modified: haiku/trunk/headers/build/os/app/Handler.h =================================================================== --- haiku/trunk/headers/build/os/app/Handler.h 2011-06-14 11:29:08 UTC (rev 42178) +++ haiku/trunk/headers/build/os/app/Handler.h 2011-06-14 11:42:49 UTC (rev 42179) @@ -1,149 +1 @@ -//------------------------------------------------------------------------------ -// 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: Handler.cpp -// Author: Erik Jaesler (erik@xxxxxxxxxxxxxx) -// Description: BHandler defines the message-handling protocol. -// MessageReceived() is its lynchpin. -//------------------------------------------------------------------------------ - -#ifndef _HANDLER_H -#define _HANDLER_H - -// Standard Includes ----------------------------------------------------------- - -// System Includes ------------------------------------------------------------- -#include <BeBuild.h> -#include <Archivable.h> - -// Project Includes ------------------------------------------------------------ - -// Local Includes -------------------------------------------------------------- - -// Local Defines --------------------------------------------------------------- - -// Globals --------------------------------------------------------------------- - -class BLooper; -class BMessageFilter; -class BMessage; -class BMessenger; -class BList; -class _ObserverList; - -#define B_OBSERVE_WHAT_CHANGE "be:observe_change_what" -#define B_OBSERVE_ORIGINAL_WHAT "be:observe_orig_what" -const uint32 B_OBSERVER_OBSERVE_ALL = 0xffffffff; - -// BHandler class -------------------------------------------------------------- -class BHandler : public BArchivable { - -public: - BHandler(const char* name = NULL); - virtual ~BHandler(); - - // Archiving - BHandler(BMessage* data); - static BArchivable* Instantiate(BMessage* data); - virtual status_t Archive(BMessage* data, bool deep = true) const; - - // BHandler guts. - virtual void MessageReceived(BMessage* message); - BLooper* Looper() const; - void SetName(const char* name); - const char* Name() const; - virtual void SetNextHandler(BHandler* handler); - BHandler* NextHandler() const; - - // Message filtering - virtual void AddFilter(BMessageFilter* filter); - virtual bool RemoveFilter(BMessageFilter* filter); - virtual void SetFilterList(BList* filters); - BList* FilterList(); - - bool LockLooper(); - status_t LockLooperWithTimeout(bigtime_t timeout); - void UnlockLooper(); - - // Scripting - virtual BHandler* ResolveSpecifier(BMessage* msg, - int32 index, - BMessage* specifier, - int32 form, - const char* property); - virtual status_t GetSupportedSuites(BMessage* data); - - // Observer calls, inter-looper and inter-team - status_t StartWatching(BMessenger, uint32 what); - status_t StartWatchingAll(BMessenger); - status_t StopWatching(BMessenger, uint32 what); - status_t StopWatchingAll(BMessenger); - - // Observer calls for observing targets in the same BLooper - status_t StartWatching(BHandler* , uint32 what); - status_t StartWatchingAll(BHandler* ); - status_t StopWatching(BHandler* , uint32 what); - status_t StopWatchingAll(BHandler* ); - - - // Reserved - virtual status_t Perform(perform_code d, void* arg); - - // Notifier calls - virtual void SendNotices(uint32 what, const BMessage* = 0); - bool IsWatched() const; - -//----- Private or reserved ----------------------------------------- -private: - typedef BArchivable _inherited; - friend inline int32 _get_object_token_(const BHandler* ); - friend class BLooper; - friend class BMessageFilter; - - virtual void _ReservedHandler2(); - virtual void _ReservedHandler3(); - virtual void _ReservedHandler4(); - - void InitData(const char* name); - - BHandler(const BHandler&); - BHandler& operator=(const BHandler&); - void SetLooper(BLooper* loop); - - int32 fToken; - char* fName; - BLooper* fLooper; - BHandler* fNextHandler; - BList* fFilters; - _ObserverList* fObserverList; - uint32 _reserved[3]; -}; -//------------------------------------------------------------------------------ - -#endif // _HANDLER_H - -/* - * $Log $ - * - * $Id $ - * - */ - +#include <../os/app/Handler.h> Modified: haiku/trunk/headers/build/os/app/Looper.h =================================================================== --- haiku/trunk/headers/build/os/app/Looper.h 2011-06-14 11:29:08 UTC (rev 42178) +++ haiku/trunk/headers/build/os/app/Looper.h 2011-06-14 11:42:49 UTC (rev 42179) @@ -1,238 +1 @@ -//------------------------------------------------------------------------------ -// 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: Looper.h -// Author(s): Erik Jaesler (erik@xxxxxxxxxxxxxx) -// DarkWyrm (bpmagic@xxxxxxxxxxxxxxx) -// Description: BLooper class spawns a thread that runs a message loop. -//------------------------------------------------------------------------------ - -#ifndef _LOOPER_H -#define _LOOPER_H - -// Standard Includes ----------------------------------------------------------- - -// System Includes ------------------------------------------------------------- -#include <BeBuild.h> -#include <Handler.h> -#include <List.h> -#include <OS.h> - -// Project Includes ------------------------------------------------------------ - -// Local Includes -------------------------------------------------------------- - -// Local Defines --------------------------------------------------------------- - -// Globals --------------------------------------------------------------------- - -class BMessage; -class BMessageQueue; -namespace BPrivate { - class BLooperList; -} -struct _loop_data_; - -// Port (Message Queue) Capacity ----------------------------------------------- -#define B_LOOPER_PORT_DEFAULT_CAPACITY 100 - - -// BLooper class --------------------------------------------------------------- -class BLooper : public BHandler { -public: - BLooper(const char* name = NULL, - int32 priority = B_NORMAL_PRIORITY, - int32 port_capacity = B_LOOPER_PORT_DEFAULT_CAPACITY); -virtual ~BLooper(); - -// Archiving - BLooper(BMessage* data); -static BArchivable* Instantiate(BMessage* data); -virtual status_t Archive(BMessage* data, bool deep = true) const; - -// Message transmission - status_t PostMessage(uint32 command); - status_t PostMessage(BMessage* message); - status_t PostMessage(uint32 command, - BHandler* handler, - BHandler* reply_to = NULL); - status_t PostMessage(BMessage* message, - BHandler* handler, - BHandler* reply_to = NULL); - -virtual void DispatchMessage(BMessage* message, BHandler* handler); -virtual void MessageReceived(BMessage* msg); - BMessage* CurrentMessage() const; - BMessage* DetachCurrentMessage(); - BMessageQueue* MessageQueue() const; - bool IsMessageWaiting() const; - -// Message handlers - void AddHandler(BHandler* handler); - bool RemoveHandler(BHandler* handler); - int32 CountHandlers() const; - BHandler* HandlerAt(int32 index) const; - int32 IndexOf(BHandler* handler) const; - - BHandler* PreferredHandler() const; - void SetPreferredHandler(BHandler* handler); - -// Loop control -virtual thread_id Run(); -virtual void Quit(); -virtual bool QuitRequested(); - bool Lock(); - void Unlock(); - bool IsLocked() const; - status_t LockWithTimeout(bigtime_t timeout); - thread_id Thread() const; - team_id Team() const; -static BLooper* LooperForThread(thread_id tid); - -// Loop debugging - thread_id LockingThread() const; - int32 CountLocks() const; - int32 CountLockRequests() const; - sem_id Sem() const; - -// Scripting -virtual BHandler* ResolveSpecifier(BMessage* msg, - int32 index, - BMessage* specifier, - int32 form, - const char* property); -virtual status_t GetSupportedSuites(BMessage* data); - -// Message filters (also see BHandler). -virtual void AddCommonFilter(BMessageFilter* filter); -virtual bool RemoveCommonFilter(BMessageFilter* filter); -virtual void SetCommonFilterList(BList* filters); - BList* CommonFilterList() const; - -// Private or reserved --------------------------------------------------------- -virtual status_t Perform(perform_code d, void* arg); - -protected: - // called from overridden task_looper - BMessage* MessageFromPort(bigtime_t = B_INFINITE_TIMEOUT); - -private: - typedef BHandler _inherited; - friend class BWindow; - friend class BApplication; - friend class BMessenger; - friend class BView; - friend class BHandler; - friend class BPrivate::BLooperList; - friend port_id _get_looper_port_(const BLooper* ); - friend status_t _safe_get_server_token_(const BLooper* , int32* ); - friend team_id _find_cur_team_id_(); - -virtual void _ReservedLooper1(); -virtual void _ReservedLooper2(); -virtual void _ReservedLooper3(); -virtual void _ReservedLooper4(); -virtual void _ReservedLooper5(); -virtual void _ReservedLooper6(); - - BLooper(const BLooper&); - BLooper& operator=(const BLooper&); - - BLooper(int32 priority, port_id port, const char* name); - - status_t _PostMessage(BMessage* msg, - BHandler* handler, - BHandler* reply_to); - -static status_t _Lock(BLooper* loop, - port_id port, - bigtime_t timeout); -static status_t _LockComplete(BLooper* loop, - int32 old, - thread_id this_tid, - sem_id sem, - bigtime_t timeout); - void InitData(); - void InitData(const char* name, int32 prio, int32 capacity); - void AddMessage(BMessage* msg); - void _AddMessagePriv(BMessage* msg); -static status_t _task0_(void* arg); - - void* ReadRawFromPort(int32* code, - bigtime_t tout = B_INFINITE_TIMEOUT); - BMessage* ReadMessageFromPort(bigtime_t tout = B_INFINITE_TIMEOUT); -virtual BMessage* ConvertToMessage(void* raw, int32 code); -virtual void task_looper(); - void do_quit_requested(BMessage* msg); - bool AssertLocked() const; - BHandler* top_level_filter(BMessage* msg, BHandler* t); - BHandler* handler_only_filter(BMessage* msg, BHandler* t); - BHandler* apply_filters( BList* list, - BMessage* msg, - BHandler* target); - void check_lock(); - BHandler* resolve_specifier(BHandler* target, BMessage* msg); - void UnlockFully(); - -static uint32 sLooperID; -static team_id sTeamID; - -// DEPRECATED -static void AddLooper(BLooper* l); -static bool IsLooperValid(const BLooper* l); -static void RemoveLooper(BLooper* l); -static void GetLooperList(BList* list); -static BLooper* LooperForName(const char* name); -static BLooper* LooperForPort(port_id port); - - uint32 fLooperID; - BMessageQueue* fQueue; - BMessage* fLastMessage; - port_id fMsgPort; - long fAtomicCount; - sem_id fLockSem; - long fOwnerCount; - thread_id fOwner; - thread_id fTaskID; - uint32 _unused1; - int32 fInitPriority; - BHandler* fPreferred; - BList fHandlers; - BList* fCommonFilters; - bool fTerminating; - bool fRunCalled; - thread_id fCachedPid; - size_t fCachedStack; - void* fMsgBuffer; - size_t fMsgBufferSize; - uint32 _reserved[6]; -}; -//------------------------------------------------------------------------------ - -#endif // _LOOPER_H - -/* - * $Log $ - * - * $Id $ - * - */ - +#include <../os/app/Looper.h> Modified: haiku/trunk/headers/build/os/app/MessageQueue.h =================================================================== --- haiku/trunk/headers/build/os/app/MessageQueue.h 2011-06-14 11:29:08 UTC (rev 42178) +++ haiku/trunk/headers/build/os/app/MessageQueue.h 2011-06-14 11:42:49 UTC (rev 42179) @@ -1,65 +1 @@ -// -// $Id: MessageQueue.h 1686 2002-10-26 18:59:16Z beveloper $ -// -// This is the BMessageQueue interface for OpenBeOS. It has been created -// to be source and binary compatible with the BeOS version of -// BMessageQueue. -// - - -#ifndef _OPENBEOS_MESSAGEQUEUE_H -#define _OPENBEOS_MESSAGEQUEUE_H - - -#include <Locker.h> -#include <Message.h> /* For convenience */ - - -#ifdef USE_OPENBEOS_NAMESPACE -namespace OpenBeOS { -#endif - -class BMessageQueue { -public: - BMessageQueue(); - virtual ~BMessageQueue(); - - void AddMessage(BMessage *message); - void RemoveMessage(BMessage *message); - - int32 CountMessages(void) const; - bool IsEmpty(void) const; - - BMessage *FindMessage(int32 index) const; - BMessage *FindMessage(uint32 what, int32 index=0) const; - - bool Lock(void); - void Unlock(void); - bool IsLocked(void); - - BMessage *NextMessage(void); - -private: - - // Reserved space in the vtable for future changes to BMessageQueue - virtual void _ReservedMessageQueue1(void); - virtual void _ReservedMessageQueue2(void); - virtual void _ReservedMessageQueue3(void); - - BMessageQueue(const BMessageQueue &); - BMessageQueue &operator=(const BMessageQueue &); - - BMessage *fTheQueue; - BMessage *fQueueTail; - int32 fMessageCount; - BLocker fLocker; - - // Reserved space for future changes to BMessageQueue - uint32 fReservedSpace[3]; -}; - -#ifdef USE_OPENBEOS_NAMESPACE -} -#endif - -#endif // _OPENBEOS_MESSAGEQUEUE_H +#include <../os/app/MessageQueue.h> Added: haiku/trunk/headers/build/os/drivers/KernelExport.h =================================================================== --- haiku/trunk/headers/build/os/drivers/KernelExport.h (rev 0) +++ haiku/trunk/headers/build/os/drivers/KernelExport.h 2011-06-14 11:42:49 UTC (rev 42179) @@ -0,0 +1,3 @@ +#define dprintf haiku_dprintf +#include <../os/drivers/KernelExport.h> +#undef dprintf Modified: haiku/trunk/headers/build/os/interface/GraphicsDefs.h =================================================================== --- haiku/trunk/headers/build/os/interface/GraphicsDefs.h 2011-06-14 11:29:08 UTC (rev 42178) +++ haiku/trunk/headers/build/os/interface/GraphicsDefs.h 2011-06-14 11:42:49 UTC (rev 42179) @@ -1,337 +1 @@ -//------------------------------------------------------------------------------ -// 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: GraphicsDefs.h -// Author: Frans van Nispen -// Description: BMessageFilter class creates objects that filter -// in-coming BMessages. -//------------------------------------------------------------------------------ - -#ifndef _GRAPHICS_DEFS_H -#define _GRAPHICS_DEFS_H - -// Standard Includes ----------------------------------------------------------- - -// System Includes ------------------------------------------------------------- -#include <BeBuild.h> -#include <SupportDefs.h> - -// Project Includes ------------------------------------------------------------ - -// Local Includes -------------------------------------------------------------- - -// Local Defines --------------------------------------------------------------- - -// Globals --------------------------------------------------------------------- - - -//------------------------------------------------------------------------------ - -typedef struct pattern { - uint8 data[8]; -} pattern; - -#ifdef __cplusplus - -inline bool -operator==(const pattern& a, const pattern& b) -{ - return (*(uint64*)a.data == *(uint64*)b.data); -} - -#endif // __cplusplus - -extern _IMPEXP_BE const pattern B_SOLID_HIGH; -extern _IMPEXP_BE const pattern B_MIXED_COLORS; -extern _IMPEXP_BE const pattern B_SOLID_LOW; - -//------------------------------------------------------------------------------ - -typedef struct rgb_color { - uint8 red; - uint8 green; - uint8 blue; - uint8 alpha; - -#if defined(__cplusplus) - // some convenient additions - - inline bool - operator==(const rgb_color& other) const - { - return *(const uint32 *)this == *(const uint32 *)&other; - } - - inline bool - operator!=(const rgb_color& other) const - { - return *(const uint32 *)this != *(const uint32 *)&other; - } -#endif -} rgb_color; - -//------------------------------------------------------------------------------ - -extern _IMPEXP_BE const rgb_color B_TRANSPARENT_COLOR; -extern _IMPEXP_BE const uint8 B_TRANSPARENT_MAGIC_CMAP8; -extern _IMPEXP_BE const uint16 B_TRANSPARENT_MAGIC_RGBA15; -extern _IMPEXP_BE const uint16 B_TRANSPARENT_MAGIC_RGBA15_BIG; -extern _IMPEXP_BE const uint32 B_TRANSPARENT_MAGIC_RGBA32; -extern _IMPEXP_BE const uint32 B_TRANSPARENT_MAGIC_RGBA32_BIG; - -extern _IMPEXP_BE const uint8 B_TRANSPARENT_8_BIT; -extern _IMPEXP_BE const rgb_color B_TRANSPARENT_32_BIT; - -//------------------------------------------------------------------------------ - -typedef struct color_map { - int32 id; - rgb_color color_list[256]; - uint8 inversion_map[256]; - uint8 index_map[32768]; -} color_map; - -typedef struct overlay_rect_limits { - uint16 horizontal_alignment; - uint16 vertical_alignment; - uint16 width_alignment; - uint16 height_alignment; - uint16 min_width; - uint16 max_width; - uint16 min_height; - uint16 max_height; - uint32 reserved[8]; -} overlay_rect_limits; - -typedef struct overlay_restrictions { - overlay_rect_limits source; - overlay_rect_limits destination; - float min_width_scale; - float max_width_scale; - float min_height_scale; - float max_height_scale; - uint32 reserved[8]; -} overlay_restrictions; - -//------------------------------------------------------------------------------ - -struct screen_id { int32 id; }; - -extern _IMPEXP_BE const struct screen_id B_MAIN_SCREEN_ID; - -//------------------------------------------------------------------------------ - -typedef enum -{ - B_NO_COLOR_SPACE = 0x0000, //* byte in memory order, high bit first - - // linear color space (little endian is the default) - B_RGB32 = 0x0008, //* B[7:0] G[7:0] R[7:0] -[7:0] - B_RGBA32 = 0x2008, // B[7:0] G[7:0] R[7:0] A[7:0] - B_RGB24 = 0x0003, // B[7:0] G[7:0] R[7:0] - B_RGB16 = 0x0005, // G[2:0],B[4:0] R[4:0],G[5:3] - B_RGB15 = 0x0010, // G[2:0],B[4:0] -[0],R[4:0],G[4:3] - B_RGBA15 = 0x2010, // G[2:0],B[4:0] A[0],R[4:0],G[4:3] - B_CMAP8 = 0x0004, // D[7:0] - B_GRAY8 = 0x0002, // Y[7:0] - B_GRAY1 = 0x0001, // Y0[0],Y1[0],Y2[0],Y3[0],Y4[0],Y5[0],Y6[0],Y7[0] - - // big endian version, when the encoding is not endianess independant - B_RGB32_BIG = 0x1008, // -[7:0] R[7:0] G[7:0] B[7:0] - B_RGBA32_BIG = 0x3008, // A[7:0] R[7:0] G[7:0] B[7:0] - B_RGB24_BIG = 0x1003, // R[7:0] G[7:0] B[7:0] - B_RGB16_BIG = 0x1005, // R[4:0],G[5:3] G[2:0],B[4:0] - B_RGB15_BIG = 0x1010, // -[0],R[4:0],G[4:3] G[2:0],B[4:0] - B_RGBA15_BIG = 0x3010, // A[0],R[4:0],G[4:3] G[2:0],B[4:0] - - // little-endian declarations, for completness - B_RGB32_LITTLE = B_RGB32, - B_RGBA32_LITTLE = B_RGBA32, - B_RGB24_LITTLE = B_RGB24, - B_RGB16_LITTLE = B_RGB16, - B_RGB15_LITTLE = B_RGB15, - B_RGBA15_LITTLE = B_RGBA15, - - // non linear color space -- note that these are here for exchange purposes; - // a BBitmap or BView may not necessarily support all these color spaces. - - // Loss/Saturation points are Y 16-235 (absoulte); Cb/Cr 16-240 (center 128) - - B_YCbCr422 = 0x4000, // Y0[7:0] Cb0[7:0] Y1[7:0] Cr0[7:0] Y2[7:0]... - // Cb2[7:0] Y3[7:0] Cr2[7:0] - B_YCbCr411 = 0x4001, // Cb0[7:0] Y0[7:0] Cr0[7:0] Y1[7:0] Cb4[7:0]... - // Y2[7:0] Cr4[7:0] Y3[7:0] Y4[7:0] Y5[7:0]... - // Y6[7:0] Y7[7:0] - B_YCbCr444 = 0x4003, // Y0[7:0] Cb0[7:0] Cr0[7:0] - B_YCbCr420 = 0x4004, // Non-interlaced only, Cb0 Y0 Y1 Cb2 Y2 Y3 - // on even scan lines, Cr0 Y0 Y1 Cr2 Y2 Y3 - // on odd scan lines - - // Extrema points are - // Y 0 - 207 (absolute) - // U -91 - 91 (offset 128) - // V -127 - 127 (offset 128) - // note that YUV byte order is different from YCbCr - // USE YCbCr, not YUV, when that's what you mean! - B_YUV422 = 0x4020, // U0[7:0] Y0[7:0] V0[7:0] Y1[7:0] ... - // U2[7:0] Y2[7:0] V2[7:0] Y3[7:0] - B_YUV411 = 0x4021, // U0[7:0] Y0[7:0] Y1[7:0] V0[7:0] Y2[7:0] Y3[7:0] - // U4[7:0] Y4[7:0] Y5[7:0] V4[7:0] Y6[7:0] Y7[7:0] - B_YUV444 = 0x4023, // U0[7:0] Y0[7:0] V0[7:0] U1[7:0] Y1[7:0] V1[7:0] - B_YUV420 = 0x4024, // Non-interlaced only, U0 Y0 Y1 U2 Y2 Y3 - // on even scan lines, V0 Y0 Y1 V2 Y2 Y3 - // on odd scan lines - B_YUV9 = 0x402C, // planar? 410? - B_YUV12 = 0x402D, // planar? 420? - - B_UVL24 = 0x4030, // U0[7:0] V0[7:0] L0[7:0] ... - B_UVL32 = 0x4031, // U0[7:0] V0[7:0] L0[7:0] X0[7:0]... - B_UVLA32 = 0x6031, // U0[7:0] V0[7:0] L0[7:0] A0[7:0]... - - B_LAB24 = 0x4032, // L0[7:0] a0[7:0] b0[7:0] ... (a is not alpha!) - B_LAB32 = 0x4033, // L0[7:0] a0[7:0] b0[7:0] X0[7:0] ... (b is not alpha!) - B_LABA32 = 0x6033, // L0[7:0] a0[7:0] b0[7:0] A0[7:0] ... (A is alpha) - - // red is at hue = 0 - - B_HSI24 = 0x4040, // H[7:0] S[7:0] I[7:0] - B_HSI32 = 0x4041, // H[7:0] S[7:0] I[7:0] X[7:0] - B_HSIA32 = 0x6041, // H[7:0] S[7:0] I[7:0] A[7:0] - - B_HSV24 = 0x4042, // H[7:0] S[7:0] V[7:0] - B_HSV32 = 0x4043, // H[7:0] S[7:0] V[7:0] X[7:0] - B_HSVA32 = 0x6043, // H[7:0] S[7:0] V[7:0] A[7:0] - - B_HLS24 = 0x4044, // H[7:0] L[7:0] S[7:0] - B_HLS32 = 0x4045, // H[7:0] L[7:0] S[7:0] X[7:0] - B_HLSA32 = 0x6045, // H[7:0] L[7:0] S[7:0] A[7:0] - - B_CMY24 = 0xC001, // C[7:0] M[7:0] Y[7:0] No gray removal done - B_CMY32 = 0xC002, // C[7:0] M[7:0] Y[7:0] X[7:0] No gray removal done - B_CMYA32 = 0xE002, // C[7:0] M[7:0] Y[7:0] A[7:0] No gray removal done - B_CMYK32 = 0xC003, // C[7:0] M[7:0] Y[7:0] K[7:0] - - // compatibility declarations - B_MONOCHROME_1_BIT = B_GRAY1, - B_GRAYSCALE_8_BIT = B_GRAY8, - B_COLOR_8_BIT = B_CMAP8, - B_RGB_32_BIT = B_RGB32, - B_RGB_16_BIT = B_RGB15, - B_BIG_RGB_32_BIT = B_RGB32_BIG, - B_BIG_RGB_16_BIT = B_RGB15_BIG -} color_space; - - -// Find out whether a specific color space is supported by BBitmaps. -// Support_flags will be set to what kinds of support are available. -// If support_flags is set to 0, false will be returned. -enum { - B_VIEWS_SUPPORT_DRAW_BITMAP = 0x1, - B_BITMAPS_SUPPORT_ATTACHED_VIEWS = 0x2 -}; -_IMPEXP_BE bool bitmaps_support_space(color_space space, uint32 * support_flags); - -//------------------------------------------------------------------------------ -// "pixel_chunk" is the native increment from one pixel starting on an integral byte -// to the next. "row_alignment" is the native alignment for pixel scanline starts. -// "pixels_per_chunk" is the number of pixels in a pixel_chunk. For instance, B_GRAY1 -// sets pixel_chunk to 1, row_alignment to 4 and pixels_per_chunk to 8, whereas -// B_RGB24 sets pixel_chunk to 3, row_alignment to 4 and pixels_per_chunk to 1. -//------------------------------------------------------------------------------ -_IMPEXP_BE status_t get_pixel_size_for(color_space space, size_t * pixel_chunk, - size_t * row_alignment, size_t * pixels_per_chunk); - - -enum buffer_orientation { - B_BUFFER_TOP_TO_BOTTOM, - B_BUFFER_BOTTOM_TO_TOP -}; - -enum buffer_layout { [... truncated: 7087 lines follow ...]