2006-02-21 14:18:17 +03:00
|
|
|
/*
|
2007-04-14 22:11:42 +04:00
|
|
|
* Copyright 2001-2007, Haiku Inc. All Rights Reserved.
|
2006-02-21 14:18:17 +03:00
|
|
|
* Distributed under the terms of the MIT License.
|
|
|
|
*
|
|
|
|
* Authors:
|
|
|
|
* Erik Jaesler (erik@cgsoftware.com)
|
|
|
|
*/
|
2002-07-09 16:24:59 +04:00
|
|
|
#ifndef _APP_DEFS_H
|
|
|
|
#define _APP_DEFS_H
|
|
|
|
|
|
|
|
|
|
|
|
#include <BeBuild.h>
|
|
|
|
|
|
|
|
|
|
|
|
// 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
|
|
|
|
|
|
|
|
|
2007-04-14 22:11:42 +04:00
|
|
|
// System Message Codes
|
2023-07-09 16:33:32 +03:00
|
|
|
enum system_message_code {
|
2002-07-09 16:24:59 +04:00
|
|
|
B_ABOUT_REQUESTED = '_ABR',
|
|
|
|
B_WINDOW_ACTIVATED = '_ACT',
|
|
|
|
B_APP_ACTIVATED = '_ACT', // Same as B_WINDOW_ACTIVATED
|
2015-11-08 13:27:14 +03:00
|
|
|
B_ARGV_RECEIVED = '_ARG',
|
|
|
|
B_QUIT_REQUESTED = '_QRQ',
|
|
|
|
B_CLOSE_REQUESTED = '_QRQ', // Obsolete; use B_QUIT_REQUESTED
|
2002-07-09 16:24:59 +04:00
|
|
|
B_CANCEL = '_CNC',
|
2007-04-14 22:11:42 +04:00
|
|
|
B_INVALIDATE = '_IVL',
|
2015-11-08 13:27:14 +03:00
|
|
|
B_KEY_DOWN = '_KYD',
|
|
|
|
B_KEY_UP = '_KYU',
|
|
|
|
B_UNMAPPED_KEY_DOWN = '_UKD',
|
|
|
|
B_UNMAPPED_KEY_UP = '_UKU',
|
2019-08-25 04:26:23 +03:00
|
|
|
B_KEY_MAP_LOADED = '_KML',
|
2006-08-26 20:21:15 +04:00
|
|
|
B_LAYOUT_WINDOW = '_LAY',
|
2002-07-09 16:24:59 +04:00
|
|
|
B_MODIFIERS_CHANGED = '_MCH',
|
|
|
|
B_MINIMIZE = '_WMN',
|
2015-11-08 13:27:14 +03:00
|
|
|
B_MOUSE_DOWN = '_MDN',
|
|
|
|
B_MOUSE_MOVED = '_MMV',
|
2002-07-09 16:24:59 +04:00
|
|
|
B_MOUSE_ENTER_EXIT = '_MEX',
|
2009-08-03 18:47:41 +04:00
|
|
|
B_MOUSE_IDLE = '_MSI',
|
2015-11-08 13:27:14 +03:00
|
|
|
B_MOUSE_UP = '_MUP',
|
2002-07-09 16:24:59 +04:00
|
|
|
B_MOUSE_WHEEL_CHANGED = '_MWC',
|
|
|
|
B_OPEN_IN_WORKSPACE = '_OWS',
|
2014-06-17 11:46:48 +04:00
|
|
|
B_PACKAGE_UPDATE = '_PKU',
|
2002-07-09 16:24:59 +04:00
|
|
|
B_PRINTER_CHANGED = '_PCH',
|
2015-11-08 13:27:14 +03:00
|
|
|
B_PULSE = '_PUL',
|
|
|
|
B_READY_TO_RUN = '_RTR',
|
|
|
|
B_REFS_RECEIVED = '_RRC',
|
2002-07-09 16:24:59 +04:00
|
|
|
B_RELEASE_OVERLAY_LOCK = '_ROV',
|
|
|
|
B_ACQUIRE_OVERLAY_LOCK = '_AOV',
|
2015-11-08 13:27:14 +03:00
|
|
|
B_SCREEN_CHANGED = '_SCH',
|
|
|
|
B_VALUE_CHANGED = '_VCH',
|
2006-04-29 22:02:46 +04:00
|
|
|
B_TRANSLATOR_ADDED = '_ART',
|
|
|
|
B_TRANSLATOR_REMOVED = '_RRT',
|
Make sure images containing BTranslators are not unloaded early
When a translator is uninstalled, BTranslatorPrivate::_RemoveTranslators is
called. This method used to unload the image containing the translator after
calling Release() on it resulting in several problems:
- If the translator was still busy, e.g. translating something while being
installed, it crashed since the image was unloaded even though its refcount
was larger than 0.
- Applications using code from one of the translators (e.g. its config view)
would crash when the translator is uninstalled (this is bug #12005).
This problem is now fixed. The roster keeps track of all translators whose
image it manages (even if the translator was already removed from the roster).
It also keeps a refcount to all images. When a translator's refcount drops to
zero and it belonged to a roster at some point, it does not delete itself, but
notifies the roster that it is ready to destruct, which then removes it from
the roster if the translator is still in it, destroys the translator, decrements
the refcount of the image and if the new refcount is zero, unloads the image.
All of this is done in a message handler, since if the translator called
TranslatorDeleted like before, the unloaded image would be referenced when
the stack is walked up.
Finally, the DataTranslations preflet is required to Acquire() the translator
whose config view it is showing, because otherwise its refcount could be reduced
to 0 and the image unloaded. BTranslatorRoster now enables users to acquire a
translator by ID. By the time the translator has to be released, it might not
be part of the roster anymore though. Since BTranslatorRoster tries not to give
out raw pointers to the translators it manages, users who acquire a translator
through a roster now are given a BTranslatorReleaseDelegate, which allows for
releasing the BTranslator exactly once and then self-destructs.
Signed-off-by: Axel Dörfler <axeld@pinc-software.de>
2015-11-08 18:16:05 +03:00
|
|
|
B_DELETE_TRANSLATOR = '_DRT',
|
2015-11-08 13:27:14 +03:00
|
|
|
B_VIEW_MOVED = '_VMV',
|
|
|
|
B_VIEW_RESIZED = '_VRS',
|
|
|
|
B_WINDOW_MOVED = '_WMV',
|
|
|
|
B_WINDOW_RESIZED = '_WRS',
|
2002-07-09 16:24:59 +04:00
|
|
|
B_WORKSPACES_CHANGED = '_WCG',
|
|
|
|
B_WORKSPACE_ACTIVATED = '_WAC',
|
|
|
|
B_ZOOM = '_WZM',
|
Set*UIColor, etc.
The inseparable changes necessary to support live color updating across the
system in a sane, safe, and performant manner.
BView gains:
HasSystemColors()
HasDefaultColors()
AdoptSystemColors()
AdoptParentColors()
AdoptViewColor(BView*)
SetViewUIColor(color_which, float tint)
SetHighUIColor(...
SetLowUIColor(...
ViewUIColor(float* tint)
HighUIColor(...
LowUIColor(...
DelayedInvalidate()
BWindow gains a simple helper method:
IsOffscreenWindow()
BMessage gains:
AddColor()
FindColor()
GetColor()
HasColor() * allegedly this API is deprecated, but I implemented it anyway
ReplaceColor()
SetColor()
Previous private ColorTools methods are made public and moved into GraphicsDefs:
mix_color, blend_color, disable_color
These are fully compatible with BeOS dan0 R5.1 methods and are just code cleanup
of BeOS example code under the OpenTracker license.
In addition, four new colors are created:
B_LINK_TEXT_COLOR
B_LINK_HOVER_COLOR
B_LINK_ACTIVE_COLOR
B_LINK_VISITED_COLOR
These changes are documented in their proper user documentation files.
In addition, due to a history rewrite, B_FOLLOW_LEFT_TOP has been defined and
used in lieu of B_FOLLOW_TOP | B_FOLLOW_LEFT and is included in this commit.
On the app_server side, the following has changed:
Add DelayedMessage - a system by which messages can be sent at a scheduled time,
and can also be merged according to set rules. A single thread is used to service the
message queue and multiple recipients can be set for each message.
Desktop gains the ability to add message ports to a DelayedMessage so that
said messages can target either all applications or all windows, as needed.
Desktop maintains a BMessage which is used to queue up all pending color changes
and the delayed messaging system is used to enact these changes after a short
period of time has passed. This prevents abuse and allows the system to merge
repeated set_ui_color events into one event for client applications, improving
performance drastically.
In addition, B_COLORS_UPDATED is sent to the BApplication, which forwards the message
to each BWindow. This is done to improve performance over having the app_server
independently informing each window.
Decorator changes are live now, which required some reworking.
Signed-off-by: Augustin Cavalier <waddlesplash@gmail.com>
2015-12-10 21:52:48 +03:00
|
|
|
B_COLORS_UPDATED = '_CLU',
|
|
|
|
B_FONTS_UPDATED = '_FNU',
|
2018-05-04 21:35:28 +03:00
|
|
|
B_TRACKER_ADDON_MESSAGE = '_TAM',
|
2002-07-09 16:24:59 +04:00
|
|
|
_APP_MENU_ = '_AMN',
|
|
|
|
_BROWSER_MENUS_ = '_BRM',
|
2015-11-08 13:27:14 +03:00
|
|
|
_MENU_EVENT_ = '_MEV',
|
2002-07-09 16:24:59 +04:00
|
|
|
_PING_ = '_PBL',
|
2015-11-08 13:27:14 +03:00
|
|
|
_QUIT_ = '_QIT',
|
|
|
|
_VOLUME_MOUNTED_ = '_NVL',
|
2002-07-09 16:24:59 +04:00
|
|
|
_VOLUME_UNMOUNTED_ = '_VRM',
|
2015-11-08 13:27:14 +03:00
|
|
|
_MESSAGE_DROPPED_ = '_MDP',
|
|
|
|
_DISPOSE_DRAG_ = '_DPD',
|
2002-07-09 16:24:59 +04:00
|
|
|
_MENUS_DONE_ = '_MND',
|
|
|
|
_SHOW_DRAG_HANDLES_ = '_SDH',
|
2015-11-08 13:27:14 +03:00
|
|
|
_EVENTS_PENDING_ = '_EVP',
|
|
|
|
_UPDATE_ = '_UPD',
|
2002-07-09 16:24:59 +04:00
|
|
|
_UPDATE_IF_NEEDED_ = '_UPN',
|
|
|
|
_PRINTER_INFO_ = '_PIN',
|
|
|
|
_SETUP_PRINTER_ = '_SUP',
|
|
|
|
_SELECT_PRINTER_ = '_PSL'
|
|
|
|
// Media Kit reserves all reserved codes starting in '_TR'
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2007-04-14 22:11:42 +04:00
|
|
|
// Other Commands
|
2023-07-09 16:33:32 +03:00
|
|
|
enum command_code {
|
2002-07-09 16:24:59 +04:00
|
|
|
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',
|
2004-02-24 18:32:16 +03:00
|
|
|
B_REDO = 'REDO',
|
2015-11-08 13:27:14 +03:00
|
|
|
B_CUT = 'CCUT',
|
|
|
|
B_COPY = 'COPY',
|
|
|
|
B_PASTE = 'PSTE',
|
2002-07-09 16:24:59 +04:00
|
|
|
B_SELECT_ALL = 'SALL',
|
2015-11-08 13:27:14 +03:00
|
|
|
B_SAVE_REQUESTED = 'SAVE',
|
2002-07-09 16:24:59 +04:00
|
|
|
B_MESSAGE_NOT_UNDERSTOOD = 'MNOT',
|
2015-11-08 13:27:14 +03:00
|
|
|
B_NO_REPLY = 'NONE',
|
|
|
|
B_REPLY = 'RPLY',
|
2002-07-09 16:24:59 +04:00
|
|
|
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',
|
2015-11-08 13:27:14 +03:00
|
|
|
B_OBSERVER_NOTICE_CHANGE = 'NTCH',
|
2002-07-09 16:24:59 +04:00
|
|
|
B_CONTROL_INVOKED = 'CIVK',
|
|
|
|
B_CONTROL_MODIFIED = 'CMOD'
|
|
|
|
|
|
|
|
// Media Kit reserves all reserved codes starting in 'TRI'
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // _APP_DEFS_H
|