Initial checkin
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@955 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
fa822d727d
commit
fb49720446
567
docs/develop/servers/app_server/AppServer.htm
Normal file
567
docs/develop/servers/app_server/AppServer.htm
Normal file
@ -0,0 +1,567 @@
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<TITLE>AppServer.htm</TITLE>
|
||||
<style type="text/css">
|
||||
<!--
|
||||
.Default {background-color: rgb(255,255,255); color: rgb(0,0,0); font-family: 'Dutch801 Rm BT'; font-size: 12pt}
|
||||
.OBOS-Function-Def {background-color: rgb(255,255,255); color: rgb(0,0,0); font-family: 'Dutch801 Rm BT'; font-size: 16pt}
|
||||
.OBOS-Title {background-color: rgb(255,255,255); color: rgb(0,128,0); font-family: 'Dutch801 Rm BT'; font-size: 24pt}
|
||||
.Text-Background {background-color: rgb(255,255,255)}
|
||||
.GR-Default {}
|
||||
.Body {margin: 0px}
|
||||
.Footer {margin: 0px}
|
||||
.Header {margin: 0px}
|
||||
.WP-Default {text-align: left; text-indent: 0px; margin-left: 0px; margin-right: 0px}
|
||||
-->
|
||||
</style>
|
||||
</HEAD>
|
||||
<BODY BGCOLOR="#ffffff">
|
||||
<DIV class="sheet" id="Sheet 1">
|
||||
<P class="Body" style="margin: 0px"><span class="OBOS-Title">AppServer class</span><span style="color: rgb(0,0,0); font-size: 24pt"></span></P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
</P>
|
||||
<P class="Body" style="margin: 0px">The AppServer class sits at the top of the hierarchy, starting and stopping services, monitoring for messages, and so forth.</P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
<BR>
|
||||
<HR>
|
||||
</P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
Member Functions</P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
</P>
|
||||
<TABLE WIDTH=617 HEIGHT=113 BORDER=1 CELLPADDING=1 CELLSPACING=2>
|
||||
<TR>
|
||||
<TD WIDTH=203 HEIGHT=17>
|
||||
<P class="Body" style="margin: 0px">AppServer(void)</P>
|
||||
</TD>
|
||||
<TD WIDTH=260 HEIGHT=17>
|
||||
<P class="Body" style="margin: 0px">~AppServer(void)</P>
|
||||
</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD WIDTH=203 HEIGHT=17>
|
||||
<P class="Body" style="margin: 0px">static int32 Poller(void *data)</P>
|
||||
</TD>
|
||||
<TD WIDTH=260 HEIGHT=17>
|
||||
<P class="Body" style="margin: 0px">static int32 Picasso(void *data)</P>
|
||||
</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD WIDTH=203 HEIGHT=17>
|
||||
<P class="Body" style="margin: 0px">thread_id Run(void)</P>
|
||||
</TD>
|
||||
<TD WIDTH=260 HEIGHT=17>
|
||||
<P class="Body" style="margin: 0px">void MainLoop(void)</P>
|
||||
</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD WIDTH=203 HEIGHT=17>
|
||||
<P class="Body" style="margin: 0px">bool LoadDecorator(const char *path)</P>
|
||||
</TD>
|
||||
<TD WIDTH=260 HEIGHT=17>
|
||||
<P class="Body" style="margin: 0px">void DispatchMessage(int32 code, int8 *buffer)</P>
|
||||
</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD WIDTH=203 HEIGHT=17>
|
||||
<P class="Body" style="margin: 0px">void Broadcast(int32 code)</P>
|
||||
</TD>
|
||||
<TD WIDTH=260 HEIGHT=17>
|
||||
<P class="Body" style="margin: 0px"><span style="color: rgb(0,0,0)">void HandleKeyMessage(int32 code, int8 *buffer)</span></P>
|
||||
</TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
<BR>
|
||||
Global Functions</P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
Decorator * instantiate_decorator(Layer *owner, uint32 wflags, uint32 wlook)</P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
<BR>
|
||||
<HR>
|
||||
</P>
|
||||
<P class="Body" style="margin: 0px"><span class="OBOS-Function-Def">AppServer(void)</span><span style="font-size: 16pt"></span></P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
Create the message and input ports</P>
|
||||
<P class="Body" style="margin: 0px">Create any necessary semaphores for regulating the 3 main threads</P>
|
||||
<P class="Body" style="margin: 0px">Initialize all member variables</P>
|
||||
<P class="Body" style="margin: 0px">Allocate the application BList</P>
|
||||
<P class="Body" style="margin: 0px">Read in and process all configuration data</P>
|
||||
<P class="Body" style="margin: 0px">Initialize the desktop</P>
|
||||
<P class="Body" style="margin: 0px">Spawn the Picasso and Poller threads</P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
<BR>
|
||||
<span class="OBOS-Function-Def">~AppServer(void)</span></P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
Shut down the desktop</P>
|
||||
<P class="Body" style="margin: 0px">Empty and delete the application list</P>
|
||||
<P class="Body" style="margin: 0px">Wait for Picasso and Poller to exit</P>
|
||||
<P class="Body" style="margin: 0px">Free any allocated heap space</P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
<BR>
|
||||
<span class="OBOS-Function-Def">void MainLoop(void)</span></P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
MainLoop is one large loop used to monitor the main message port in the app_server thread. This is a standard port-monitoring loop code:</P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
1) Call port_buffer_size - which will block if the port is empty</P>
|
||||
<P class="Body" style="margin: 0px">2) Allocate a buffer on the heap if the port buffer size is greater than 0</P>
|
||||
<P class="Body" style="margin: 0px">3) Read the port</P>
|
||||
<P class="Body" style="margin: 0px">4) Pass specified messages to DispatchMessage() for processing, spitting out an error message to stderr if the message's code is unrecognized</P>
|
||||
<P class="Body" style="margin: 0px">5) Return from DispatchMessage() and free the message buffer if one was allocated</P>
|
||||
<P class="Body" style="margin: 0px">6) If the message code matches the B_QUIT_REQUESTED definition and the quit_server flag is true, fall out of the infinite message-monitoring loop</P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
<BR>
|
||||
<span class="OBOS-Function-Def">void DispatchMessage(int32 code, int8 *buffer)</span></P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
DispatchMessage implements all the code necessary to respond to a given message sent to the app_server on its main port. This allows for clearer and more manageable code.</P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
CREATE_APP:</P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
Sent by a new BApplication object via synchronous PortLink messaging. Set up the corresponding ServerApp and reply to the BApplication with the new port to which it will send future communications with the App Server.</P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
Attached Data:</P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
</P>
|
||||
<P class="Body" style="text-align: center; margin: 0px"></P>
|
||||
<TABLE WIDTH=573 HEIGHT=88 BORDER=1 CELLPADDING=1 CELLSPACING=2>
|
||||
<TR>
|
||||
<TD WIDTH=112 HEIGHT=32>
|
||||
<P class="Body" style="margin: 0px">port_id reply_port</P>
|
||||
</TD>
|
||||
<TD WIDTH=318 HEIGHT=32>
|
||||
<P class="Body" style="margin: 0px">port to which the server is to reply in response to the current message</P>
|
||||
</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD WIDTH=112 HEIGHT=17>
|
||||
<P class="Body" style="margin: 0px">port_id app_port</P>
|
||||
</TD>
|
||||
<TD WIDTH=318 HEIGHT=17>
|
||||
<P class="Body" style="margin: 0px">message port for the requesting BApplication</P>
|
||||
</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD WIDTH=112 HEIGHT=17>
|
||||
<P class="Body" style="margin: 0px">const char *signature</P>
|
||||
</TD>
|
||||
<TD WIDTH=318 HEIGHT=17>
|
||||
<P class="Body" style="margin: 0px">Signature of the requesting BApplication</P>
|
||||
</TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
<P class="Body" style="text-align: center; margin: 0px"><BR>
|
||||
</P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
1) Get all attached data</P>
|
||||
<P class="Body" style="margin: 0px">2) Acquire the application list lock</P>
|
||||
<P class="Body" style="margin: 0px">3) Allocate a ServerApp object and add it to the list</P>
|
||||
<P class="Body" style="margin: 0px">4) Release application list lock</P>
|
||||
<P class="Body" style="margin: 0px">5) Acquire active application pointer lock</P>
|
||||
<P class="Body" style="margin: 0px">6) Update active application pointer</P>
|
||||
<P class="Body" style="margin: 0px">7) Release active application lock</P>
|
||||
<P class="Body" style="margin: 0px">8) Send the message SET_SERVER_PORT (with the ServerApp's receiver port attached) to the reply port</P>
|
||||
<P class="Body" style="margin: 0px">9) Run() the new ServerApp instance</P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
<BR>
|
||||
DELETE_APP:</P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
Sent by a ServerApp when told to quit either by its BApplication or the Server itself (during shutdown). It is identified by the unique ID assigned to its thread.</P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
Attached Data:</P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
</P>
|
||||
<P class="Body" style="text-align: center; margin: 0px"></P>
|
||||
<TABLE WIDTH=568 HEIGHT=22 BORDER=1 CELLPADDING=1 CELLSPACING=2>
|
||||
<TR>
|
||||
<TD WIDTH=132 HEIGHT=17>
|
||||
<P class="Body" style="margin: 0px">thread_id app_thread</P>
|
||||
</TD>
|
||||
<TD WIDTH=294 HEIGHT=17>
|
||||
<P class="Body" style="margin: 0px">Thread id of the ServerApp sending this message</P>
|
||||
</TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
<P class="Body" style="text-align: center; margin: 0px"><BR>
|
||||
</P>
|
||||
<P class="Body" style="text-align: left; margin: 0px"><BR>
|
||||
1) Get app's thread_id</P>
|
||||
<P class="Body" style="text-align: left; margin: 0px">2) Acquire application list lock</P>
|
||||
<P class="Body" style="text-align: left; margin: 0px">3) Iterate through the application list, searching for the ServerApp object with the sent thread_id</P>
|
||||
<P class="Body" style="text-align: left; margin: 0px">4) Remove the object from the list and delete it</P>
|
||||
<P class="Body" style="text-align: left; margin: 0px">5) Acquire active application lock</P>
|
||||
<P class="Body" style="text-align: left; margin: 0px">6) Check to see if the application is active</P>
|
||||
<P class="Body" style="text-align: left; margin: 0px">7) If application is/was active, set it to the previous application in the list or NULL if there are no other active applications</P>
|
||||
<P class="Body" style="text-align: left; margin: 0px">8) Release application list lock</P>
|
||||
<P class="Body" style="text-align: left; margin: 0px">9) Release active application lock</P>
|
||||
<P class="Body" style="text-align: left; margin: 0px"><BR>
|
||||
<BR>
|
||||
GET_SCREEN_MODE:</P>
|
||||
<P class="Body" style="text-align: left; margin: 0px"><BR>
|
||||
Received from the OpenBeOS Input Server when requesting the current screen settings via synchronous PortLink messaging. This is a temporary solution which will be deprecated as soon as the BScreen class is complete.</P>
|
||||
<P class="Body" style="text-align: left; margin: 0px"><BR>
|
||||
</P>
|
||||
<P class="Body" style="margin: 0px">Attached Data:</P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
</P>
|
||||
<P class="Body" style="text-align: center; margin: 0px"></P>
|
||||
<TABLE WIDTH=573 HEIGHT=42 BORDER=1 CELLPADDING=1 CELLSPACING=2>
|
||||
<TR>
|
||||
<TD WIDTH=112 HEIGHT=32>
|
||||
<P class="Body" style="margin: 0px">port_id reply_port</P>
|
||||
</TD>
|
||||
<TD WIDTH=318 HEIGHT=32>
|
||||
<P class="Body" style="margin: 0px">port to which the server is to reply in response to the current message</P>
|
||||
</TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
<P class="Body" style="text-align: center; margin: 0px"><BR>
|
||||
</P>
|
||||
<P class="Body" style="text-align: left; margin: 0px"><BR>
|
||||
1) Get height, width, and color depth from the global graphics driver object</P>
|
||||
<P class="Body" style="text-align: left; margin: 0px">2) Attach via PortLink and reply to sender</P>
|
||||
<P class="Body" style="text-align: left; margin: 0px"><BR>
|
||||
B_QUIT_REQUESTED:</P>
|
||||
<P class="Body" style="text-align: left; margin: 0px"><BR>
|
||||
Encountered only under testing situations where the Server is told to quit.</P>
|
||||
<P class="Body" style="text-align: left; margin: 0px"><BR>
|
||||
Attached Data: None</P>
|
||||
<P class="Body" style="text-align: left; margin: 0px"><BR>
|
||||
1) Set quit_server flag to true</P>
|
||||
<P class="Body" style="text-align: left; margin: 0px">2) Call Broadcast(QUIT_APP)</P>
|
||||
<P class="Body" style="text-align: left; margin: 0px"><BR>
|
||||
<BR>
|
||||
SET_DECORATOR:</P>
|
||||
<P class="Body" style="text-align: left; margin: 0px"><BR>
|
||||
Received from just about anything when a new window decorator is chosen</P>
|
||||
<P class="Body" style="text-align: left; margin: 0px"><BR>
|
||||
</P>
|
||||
<P class="Body" style="margin: 0px">Attached Data:</P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
</P>
|
||||
<P class="Body" style="text-align: center; margin: 0px"></P>
|
||||
<TABLE WIDTH=548 HEIGHT=22 BORDER=1 CELLPADDING=1 CELLSPACING=2>
|
||||
<TR>
|
||||
<TD WIDTH=117 HEIGHT=17>
|
||||
<P class="Body" style="margin: 0px">const char *path</P>
|
||||
</TD>
|
||||
<TD WIDTH=294 HEIGHT=17>
|
||||
<P class="Body" style="margin: 0px">Path to the proposed new decorator</P>
|
||||
</TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
<P class="Body" style="text-align: center; margin: 0px"><BR>
|
||||
</P>
|
||||
<P class="Body" style="text-align: left; margin: 0px"><BR>
|
||||
1) Get the path from the buffer</P>
|
||||
<P class="Body" style="text-align: left; margin: 0px">2) Call LoadDecorator()</P>
|
||||
<P class="Body" style="text-align: left; margin: 0px"><BR>
|
||||
<BR>
|
||||
<span class="OBOS-Function-Def">void Run(void)</span></P>
|
||||
<P class="Body" style="text-align: left; margin: 0px"><BR>
|
||||
Run() exists mostly for consistency with other regular applications.</P>
|
||||
<P class="Body" style="text-align: left; margin: 0px"><BR>
|
||||
1) Call MainLoop()</P>
|
||||
<P class="Body" style="text-align: left; margin: 0px"><BR>
|
||||
<BR>
|
||||
<span class="OBOS-Function-Def">bool LoadDecorator(const char *path)</span></P>
|
||||
<P class="Body" style="text-align: left; margin: 0px"><BR>
|
||||
Allows for a simple way to change the current window decorator systemwide simply by specifying the path to the desired Decorator addon.</P>
|
||||
<P class="Body" style="text-align: left; margin: 0px"><BR>
|
||||
1) Load the passed string as the path to an addon.</P>
|
||||
<P class="Body" style="text-align: left; margin: 0px">2) Load all necessary symbols for the decorator</P>
|
||||
<P class="Body" style="text-align: left; margin: 0px">3) Return false if things didn't go so well</P>
|
||||
<P class="Body" style="text-align: left; margin: 0px">4) Call Broadcast(UPDATE_DECORATOR)</P>
|
||||
<P class="Body" style="text-align: left; margin: 0px">5) Return true</P>
|
||||
<P class="Body" style="text-align: left; margin: 0px"><BR>
|
||||
<span class="OBOS-Function-Def">static int32 Picasso(void *data)</span></P>
|
||||
<P class="Body" style="text-align: left; margin: 0px"><BR>
|
||||
Picasso is a function, despite its name, dedicated to ensuring that the server deallocates resources to a dead application. It consists of a while(!quit_server) loop as follows:</P>
|
||||
<P class="Body" style="text-align: left; margin: 0px"><BR>
|
||||
1) Acquire the appliction list lock</P>
|
||||
<P class="Body" style="text-align: left; margin: 0px">2) Iterate through the list, calling each ServerApp object's PingTarget() method.</P>
|
||||
<P class="Body" style="text-align: left; margin: 0px">3) If PingTarget returns false, remove the ServerApp from the list and delete it.</P>
|
||||
<P class="Body" style="text-align: left; margin: 0px">4) Release the appliction list lock</P>
|
||||
<P class="Body" style="text-align: left; margin: 0px">5) snooze for 3 seconds</P>
|
||||
<P class="Body" style="text-align: left; margin: 0px"><BR>
|
||||
<span class="OBOS-Function-Def">static int32 Poller(void *data)</span></P>
|
||||
<P class="Body" style="text-align: left; margin: 0px"><BR>
|
||||
Poller is the main workhorse of the AppServer class, polling the Server's input port constantly for any messages from the Input Server and calling the appropriate handlers. Like Picasso, it, too, is mostly a while(!quit_server) loop.</P>
|
||||
<P class="Body" style="text-align: left; margin: 0px"><BR>
|
||||
</P>
|
||||
<P class="Body" style="margin: 0px">1) Call port_buffer_size_etc() with a timeout of 3 seconds.</P>
|
||||
<P class="Body" style="margin: 0px">2) Check to see if the port_buffer_size_etc() timed out and do a continue to next iteration if it did.</P>
|
||||
<P class="Body" style="margin: 0px">3) Allocate a buffer on the heap if the port buffer size is greater than 0</P>
|
||||
<P class="Body" style="margin: 0px">4) Read the port</P>
|
||||
<P class="Body" style="margin: 0px">5) Pass specified messages to DispatchMessage() for processing, spitting out an error message to stderr if the message's code is unrecognized</P>
|
||||
<P class="Body" style="margin: 0px">6) Return from DispatchMessage() and free the message buffer if one was allocated</P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
<BR>
|
||||
<HR>
|
||||
</P>
|
||||
<P class="Body" style="margin: 0px"><span class="OBOS-Function-Def">Decorator * instantiate_decorator(Layer *owner, uint32 wflags, uint32 wlook)</span></P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
instantiate_decorator returns a new instance of the decorator currently in use. The caller is responsible for the memory allocated for the returned object.</P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
1) Acquire the decorator lock</P>
|
||||
<P class="Body" style="margin: 0px">2) If create_decorator is NULL, create a new instance of the default decorator</P>
|
||||
<P class="Body" style="margin: 0px">3) If create_decorator is non-NULL, create a new decorator instance by calling AppServer::create_decorator().</P>
|
||||
<P class="Body" style="margin: 0px">4) Release the decorator lock</P>
|
||||
<P class="Body" style="margin: 0px">5) Return the newly allocated instance</P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
<span class="OBOS-Function-Def">void Broadcast(int32 code)</span></P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
Broadcast() provides the AppServer class with an easy way to send a quick message to all ServerApps. Primarily, this is called when a font or decorator has changed, or when the server is shutting down. It is not intended to do anything except send a quick message which requires no extra data, such as for some upadate signalling.</P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
</P>
|
||||
<P class="Body" style="text-align: left; margin: 0px">1) Acquire application list lock</P>
|
||||
<P class="Body" style="text-align: left; margin: 0px">2) Create a PortLink instance and set its message code to the passed parameter.</P>
|
||||
<P class="Body" style="text-align: left; margin: 0px">3) Iterate through the application list, targeting the PortLink instance to each ServerApp's message port and calling Flush().</P>
|
||||
<P class="Body" style="text-align: left; margin: 0px">4) Release application list lock</P>
|
||||
<P class="Body" style="text-align: left; margin: 0px"><BR>
|
||||
<span class="OBOS-Function-Def">void HandleKeyMessage(int32 code, int8 *buffer)</span></P>
|
||||
<P class="Body" style="text-align: left; margin: 0px"><BR>
|
||||
</P>
|
||||
<P class="Body" style="margin: 0px">Called from DispatchMessage to filter out App Server events and otherwise send keystrokes to the active application. </P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
B_KEY_DOWN:</P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
Sent when the user presses (or holds down) a key that's been mapped to a character.</P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
Attached Data:</P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
</P>
|
||||
<P class="Body" style="text-align: center; margin: 0px"></P>
|
||||
<TABLE WIDTH=573 HEIGHT=246 BORDER=1 CELLPADDING=1 CELLSPACING=2>
|
||||
<TR>
|
||||
<TD WIDTH=112 HEIGHT=17>
|
||||
<P class="Body" style="margin: 0px">int64 when</P>
|
||||
</TD>
|
||||
<TD WIDTH=318 HEIGHT=17>
|
||||
<P class="Body" style="margin: 0px">event time in seconds since 1/1/70</P>
|
||||
</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD WIDTH=112 HEIGHT=17>
|
||||
<P class="Body" style="margin: 0px">int32 rawcode</P>
|
||||
</TD>
|
||||
<TD WIDTH=318 HEIGHT=17>
|
||||
<P class="Body" style="margin: 0px">code for the physical key pressed</P>
|
||||
</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD WIDTH=112 HEIGHT=17>
|
||||
<P class="Body" style="margin: 0px">int32 repeat_count</P>
|
||||
</TD>
|
||||
<TD WIDTH=318 HEIGHT=17>
|
||||
<P class="Body" style="margin: 0px">number of times a key has been repeated</P>
|
||||
</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD WIDTH=112 HEIGHT=17>
|
||||
<P class="Body" style="margin: 0px">int32 modifiers</P>
|
||||
</TD>
|
||||
<TD WIDTH=318 HEIGHT=17>
|
||||
<P class="Body" style="margin: 0px">flags signifying the states of the modifier keys</P>
|
||||
</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD WIDTH=112 HEIGHT=17>
|
||||
<P class="Body" style="margin: 0px">int32 state_count</P>
|
||||
</TD>
|
||||
<TD WIDTH=318 HEIGHT=17>
|
||||
<P class="Body" style="margin: 0px">number of bytes to follow containing the state of all keys</P>
|
||||
</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD WIDTH=112 HEIGHT=17>
|
||||
<P class="Body" style="margin: 0px">int8 *states</P>
|
||||
</TD>
|
||||
<TD WIDTH=318 HEIGHT=17>
|
||||
<P class="Body" style="margin: 0px">array of the state of all keys at the time of the event</P>
|
||||
</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD WIDTH=112 HEIGHT=17>
|
||||
<P class="Body" style="margin: 0px">int8 utf8data[3]</P>
|
||||
</TD>
|
||||
<TD WIDTH=318 HEIGHT=17>
|
||||
<P class="Body" style="margin: 0px">UTF-8 data generated</P>
|
||||
</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD WIDTH=112 HEIGHT=32>
|
||||
<P class="Body" style="margin: 0px">int8 charcount</P>
|
||||
</TD>
|
||||
<TD WIDTH=318 HEIGHT=32>
|
||||
<P class="Body" style="margin: 0px">number of bytes to follow containing the string generated (usually 1)</P>
|
||||
</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD WIDTH=112 HEIGHT=17>
|
||||
<P class="Body" style="margin: 0px">const char *string</P>
|
||||
</TD>
|
||||
<TD WIDTH=318 HEIGHT=17>
|
||||
<P class="Body" style="margin: 0px">null-terminated string generated by the keystroke</P>
|
||||
</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD WIDTH=112 HEIGHT=17>
|
||||
<P class="Body" style="margin: 0px">int32 raw_char</P>
|
||||
</TD>
|
||||
<TD WIDTH=318 HEIGHT=17>
|
||||
<P class="Body" style="margin: 0px">modifier-independent ASCII code for the character</P>
|
||||
</TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
<P class="Body" style="text-align: center; margin: 0px"><BR>
|
||||
</P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
1) Get all attached data</P>
|
||||
<P class="Body" style="margin: 0px">2) If the command modifier is down, check for Left Ctrl+Left Alt+Left Shift+F12 and reset the workspace to 640 x 480 x 256 @ 60Hz and return if true</P>
|
||||
<P class="Body" style="margin: 0px">3) If the command modifier is down, check for Alt+F1 through Alt+F12 and set workspace and return if true</P>
|
||||
<P class="Body" style="margin: 0px">4) If the control modifier is true, check for B_CONTROL_KEY+Tab and, if true, find and send to the Deskbar.</P>
|
||||
<P class="Body" style="margin: 0px">4) Acquire the active application lock</P>
|
||||
<P class="Body" style="margin: 0px">5) Create a PortLink instance, target the active ServerApp's sender port, set the opcode to B_KEY_DOWN, attach the buffer <span style="font-style: italic">en masse</span>, and send it to the BApplication.</P>
|
||||
<P class="Body" style="margin: 0px">6) Release the active application lock</P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
</P>
|
||||
<P class="Body" style="text-align: left; margin: 0px">B_KEY_UP:</P>
|
||||
<P class="Body" style="text-align: left; margin: 0px"><BR>
|
||||
</P>
|
||||
<P class="Body" style="margin: 0px">Sent when the user releases a key that's been mapped to a character.</P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
Attached Data:</P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
</P>
|
||||
<P class="Body" style="text-align: center; margin: 0px"></P>
|
||||
<TABLE WIDTH=573 HEIGHT=224 BORDER=1 CELLPADDING=1 CELLSPACING=2>
|
||||
<TR>
|
||||
<TD WIDTH=112 HEIGHT=17>
|
||||
<P class="Body" style="margin: 0px">int64 when</P>
|
||||
</TD>
|
||||
<TD WIDTH=318 HEIGHT=17>
|
||||
<P class="Body" style="margin: 0px">event time in seconds since 1/1/70</P>
|
||||
</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD WIDTH=112 HEIGHT=17>
|
||||
<P class="Body" style="margin: 0px">int32 rawcode</P>
|
||||
</TD>
|
||||
<TD WIDTH=318 HEIGHT=17>
|
||||
<P class="Body" style="margin: 0px">code for the physical key pressed</P>
|
||||
</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD WIDTH=112 HEIGHT=17>
|
||||
<P class="Body" style="margin: 0px">int32 modifiers</P>
|
||||
</TD>
|
||||
<TD WIDTH=318 HEIGHT=17>
|
||||
<P class="Body" style="margin: 0px">flags signifying the states of the modifier keys</P>
|
||||
</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD WIDTH=112 HEIGHT=17>
|
||||
<P class="Body" style="margin: 0px">int32 state_count</P>
|
||||
</TD>
|
||||
<TD WIDTH=318 HEIGHT=17>
|
||||
<P class="Body" style="margin: 0px">number of bytes to follow containing the state of all keys</P>
|
||||
</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD WIDTH=112 HEIGHT=17>
|
||||
<P class="Body" style="margin: 0px">int8 *states</P>
|
||||
</TD>
|
||||
<TD WIDTH=318 HEIGHT=17>
|
||||
<P class="Body" style="margin: 0px">array of the state of all keys at the time of the event</P>
|
||||
</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD WIDTH=112 HEIGHT=17>
|
||||
<P class="Body" style="margin: 0px">int8 utf8data[3]</P>
|
||||
</TD>
|
||||
<TD WIDTH=318 HEIGHT=17>
|
||||
<P class="Body" style="margin: 0px">UTF-8 data generated</P>
|
||||
</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD WIDTH=112 HEIGHT=32>
|
||||
<P class="Body" style="margin: 0px">int8 charcount</P>
|
||||
</TD>
|
||||
<TD WIDTH=318 HEIGHT=32>
|
||||
<P class="Body" style="margin: 0px">number of bytes to follow containing the string generated (usually 1)</P>
|
||||
</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD WIDTH=112 HEIGHT=17>
|
||||
<P class="Body" style="margin: 0px">const char *string</P>
|
||||
</TD>
|
||||
<TD WIDTH=318 HEIGHT=17>
|
||||
<P class="Body" style="margin: 0px">null-terminated string generated by the keystroke</P>
|
||||
</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD WIDTH=112 HEIGHT=17>
|
||||
<P class="Body" style="margin: 0px">int32 raw_char</P>
|
||||
</TD>
|
||||
<TD WIDTH=318 HEIGHT=17>
|
||||
<P class="Body" style="margin: 0px">modifier-independent ASCII code for the character</P>
|
||||
</TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
<P class="Body" style="text-align: center; margin: 0px"><BR>
|
||||
</P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
1) Get all attached data</P>
|
||||
<P class="Body" style="margin: 0px">2) Acquire the active application lock</P>
|
||||
<P class="Body" style="margin: 0px">3) Create a PortLink instance, target the active ServerApp's sender port, set the opcode to B_KEY_UP, attach the buffer <span style="font-style: italic">en masse</span>, and send it to the BApplication.</P>
|
||||
<P class="Body" style="margin: 0px">4) Release the active application lock</P>
|
||||
<P class="Body" style="text-align: left; margin: 0px"><BR>
|
||||
B_UNMAPPED_KEY_DOWN:</P>
|
||||
<P class="Body" style="text-align: left; margin: 0px"><BR>
|
||||
</P>
|
||||
<P class="Body" style="margin: 0px">Sent when the user presses a key that has not been mapped to a character.</P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
Attached Data:</P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
</P>
|
||||
<P class="Body" style="text-align: center; margin: 0px"></P>
|
||||
<TABLE HEIGHT=0 BORDER=0 CELLPADDING=1 CELLSPACING=2>
|
||||
</TABLE>
|
||||
<P class="Body" style="text-align: center; margin: 0px"><BR>
|
||||
</P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
1) Acquire the active application lock</P>
|
||||
<P class="Body" style="margin: 0px">2) Create a PortLink instance, target the active ServerApp's sender port, set the opcode to B_UNMAPPED_KEY_DOWN, attach the buffer <span style="font-style: italic">en masse</span>, and send it to the BApplication.</P>
|
||||
<P class="Body" style="margin: 0px">3) Release the active application lock</P>
|
||||
<P class="Body" style="text-align: left; margin: 0px"><BR>
|
||||
B_UNMAPPED_KEY_UP:</P>
|
||||
<P class="Body" style="text-align: left; margin: 0px"><BR>
|
||||
</P>
|
||||
<P class="Body" style="margin: 0px">Sent when the user presses a key that has not been mapped to a character.</P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
Attached Data:</P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
</P>
|
||||
<P class="Body" style="text-align: center; margin: 0px">?</P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
1) Acquire the active application lock</P>
|
||||
<P class="Body" style="margin: 0px">2) Create a PortLink instance, target the active ServerApp's sender port, set the opcode to B_UNMAPPED_KEY_UP, attach the buffer <span style="font-style: italic">en masse</span>, and send it to the BApplication.</P>
|
||||
<P class="Body" style="margin: 0px">3) Release the active application lock</P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
</P>
|
||||
<P class="Body" style="text-align: left; margin: 0px">B_MODIFIERS_CHANGED:</P>
|
||||
<P class="Body" style="text-align: left; margin: 0px"><BR>
|
||||
</P>
|
||||
<P class="Body" style="margin: 0px">Sent when the user presses or releases one of the modifier keys</P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
Attached Data:</P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
</P>
|
||||
<P class="Body" style="text-align: center; margin: 0px">?</P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
1) Acquire the active application lock</P>
|
||||
<P class="Body" style="margin: 0px">2) Create a PortLink instance, target the active ServerApp's sender port, set the opcode to B_MODIFIERS_CHANGED, attach the buffer <span style="font-style: italic">en masse</span>, and send it to the BApplication.</P>
|
||||
<P class="Body" style="margin: 0px">3) Release the active application lock</P>
|
||||
</DIV>
|
||||
</BODY>
|
||||
</HTML>
|
123
docs/develop/servers/app_server/BitmapManager.htm
Normal file
123
docs/develop/servers/app_server/BitmapManager.htm
Normal file
@ -0,0 +1,123 @@
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<TITLE>BitmapManager.htm</TITLE>
|
||||
<style type="text/css">
|
||||
<!--
|
||||
.Default {background-color: rgb(255,255,255); color: rgb(0,0,0); font-family: 'Dutch801 Rm BT'; font-size: 12pt}
|
||||
.OBOS-Function-Def {background-color: rgb(255,255,255); color: rgb(0,0,0); font-family: 'Dutch801 Rm BT'; font-size: 16pt}
|
||||
.OBOS-Title {background-color: rgb(255,255,255); color: rgb(0,128,0); font-family: 'Dutch801 Rm BT'; font-size: 24pt}
|
||||
.Text-Background {background-color: rgb(255,255,255)}
|
||||
.GR-Default {}
|
||||
.Body {margin: 0px}
|
||||
.Footer {margin: 0px}
|
||||
.Header {margin: 0px}
|
||||
.WP-Default {text-align: left; text-indent: 0px; margin-left: 0px; margin-right: 0px}
|
||||
-->
|
||||
</style>
|
||||
</HEAD>
|
||||
<BODY BGCOLOR="#ffffff">
|
||||
<DIV class="sheet" id="Sheet 1">
|
||||
<P class="Body" style="margin: 0px"><span class="OBOS-Title">BitmapManager class</span><span style="color: rgb(0,0,0); font-size: 24pt"></span></P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
</P>
|
||||
<P class="Body" style="margin: 0px">The BitmapManager object handles all ServerBitmap allocation and deallocation. The rest of the server uses CreateBitmap and DeleteBitmap instead of new and delete. It utilizes the outside pool manager BGET.</P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
<BR>
|
||||
<HR>
|
||||
</P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
Member Functions</P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
</P>
|
||||
<TABLE WIDTH=621 HEIGHT=105 BORDER=1 CELLPADDING=1 CELLSPACING=2>
|
||||
<TR>
|
||||
<TD WIDTH=238 HEIGHT=17>
|
||||
<P class="Body" style="margin: 0px">BitmapManager(void)</P>
|
||||
</TD>
|
||||
<TD WIDTH=228 HEIGHT=17>
|
||||
<P class="Body" style="margin: 0px">~BitmapManager(void)</P>
|
||||
</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD WIDTH=238 HEIGHT=62>
|
||||
<P class="Body" style="margin: 0px">ServerBitmap *CreateBitmap(BRect bounds, color_space space, int32 flags, int32 bytes_per_row=-1, screen_id screen=B_MAIN_SCREEN_ID)</P>
|
||||
</TD>
|
||||
<TD WIDTH=228 HEIGHT=62>
|
||||
<P class="Body" style="margin: 0px">void DeleteBitmap(ServerBitmap *bitmap)</P>
|
||||
</TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
<BR>
|
||||
Global Functions</P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
extern "C" void set_area_buffer_management(void);</P>
|
||||
<P class="Body" style="margin: 0px">void * expand_area_storage(long size)</P>
|
||||
<P class="Body" style="margin: 0px">void contract_area_storage(void *buffer)</P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
<HR>
|
||||
</P>
|
||||
<P class="Body" style="margin: 0px"><span class="OBOS-Function-Def">BitmapManager(void)</span></P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
1) Create the bitmap list</P>
|
||||
<P class="Body" style="margin: 0px">2) Create the bitmap area</P>
|
||||
<P class="Body" style="margin: 0px">3) Allocate the access semaphore</P>
|
||||
<P class="Body" style="margin: 0px">4) Call set_buffer_area_management</P>
|
||||
<P class="Body" style="margin: 0px">5) Set up the buffer pool via bpool</P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
<span class="OBOS-Function-Def">~BitmapManager(void)</span></P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
1) Iterate over each item in the bitmap list, removing each item, calling brel() on its buffer, and deleting it.</P>
|
||||
<P class="Body" style="margin: 0px">2) Delete the bitmap list</P>
|
||||
<P class="Body" style="margin: 0px">3) Delete the bitmap area</P>
|
||||
<P class="Body" style="margin: 0px">4) Free the access semaphore</P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
<span class="OBOS-Function-Def">ServerBitmap *CreateBitmap(BRect bounds, color_space space, int32 flags, int32 bytes_per_row=-1, screen_id screen=B_MAIN_SCREEN_ID)</span></P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
CreateBitmap is called by outside objects to allocate a ServerBitmap object. If a problem occurs, it returns NULL.</P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
1) Acquire the access semaphore</P>
|
||||
<P class="Body" style="margin: 0px">2) Verify parameters and if any are invalid, spew an error to stderr and return NULL</P>
|
||||
<P class="Body" style="margin: 0px">3) Allocate a new ServerBitmap</P>
|
||||
<P class="Body" style="margin: 0px">4) Allocate a buffer for the bitmap via bget() with the bitmap's theoretical buffer length</P>
|
||||
<P class="Body" style="margin: 0px">5) If NULL, delete the bitmap and return NULL</P>
|
||||
<P class="Body" style="margin: 0px">6) Set the bitmap's area and buffer to the appropriate values (area_for buffer and buffer)</P>
|
||||
<P class="Body" style="margin: 0px">7) Add the bitmap to the bitmap list</P>
|
||||
<P class="Body" style="margin: 0px">8) Release the access semaphore</P>
|
||||
<P class="Body" style="margin: 0px">9) Return the bitmap</P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
<span class="OBOS-Function-Def">void DeleteBitmap(ServerBitmap *bitmap)</span></P>
|
||||
<P class="Body" style="margin: 0px"><span class="Default"><BR>
|
||||
Frees a ServerBitmap allocated by CreateBitmap()</span></P>
|
||||
<P class="Body" style="margin: 0px"><span class="Default"><BR>
|
||||
1) Acquire the access semaphore</span></P>
|
||||
<P class="Body" style="margin: 0px"><span class="Default">2) Find the bitmap in the list</span></P>
|
||||
<P class="Body" style="margin: 0px"><span class="Default">3) Remove the bitmap from the list or release the semaphore and return if not found</span></P>
|
||||
<P class="Body" style="margin: 0px"><span class="Default">4) call brel() on the bitmap's buffer if it is non-NULL</span></P>
|
||||
<P class="Body" style="margin: 0px"><span class="Default">5) delete the bitmap</span></P>
|
||||
<P class="Body" style="margin: 0px"><span class="Default">6) Release the access semaphore</span></P>
|
||||
<P class="Body" style="margin: 0px"><span class="Default"><BR>
|
||||
</span><span class="OBOS-Function-Def">extern "C" void set_area_buffer_management(void)</span></P>
|
||||
<P class="Body" style="margin: 0px"><span class="Default"><BR>
|
||||
C function defined externally to point the BGET manager to our homegrown area allocation and deallocation functions.</span></P>
|
||||
<P class="Body" style="margin: 0px"><span class="Default"><BR>
|
||||
</span><span class="OBOS-Function-Def">void * expand_area_storage(long size)</span></P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
"Internal" global function accessed only by set_area_buffer_management and BGET to handle the task of adding more area space to make room for more bitmaps.</P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
1) If size is less than B_PAGE_SIZE, set the area size to B_PAGE_SIZE</P>
|
||||
<P class="Body" style="margin: 0px">2) If size % B_PAGE_SIZE, set area size to (size/B_PAGE_SIZE)+1)*B_PAGE_SIZE, otherwise setting it to the given size</P>
|
||||
<P class="Body" style="margin: 0px">3) Call create_area with the area size.</P>
|
||||
<P class="Body" style="margin: 0px">4) If it couldn't allocate an area, write a panic message to stderr and return NULL, otherwise, return the pointer to the area.</P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
<span class="OBOS-Function-Def">void contract_area_storage(void *buffer)</span></P>
|
||||
<P class="Body" style="margin: 0px"><span class="Default"><BR>
|
||||
</span>"Internal" global function accessed only by set_area_buffer_management and BGET to <span class="Default">remove the area which was previously used for the bitmap pool</span></P>
|
||||
<P class="Body" style="margin: 0px"><span class="Default"><BR>
|
||||
1) Call area_for on the buffer</span></P>
|
||||
<P class="Body" style="margin: 0px"><span class="Default">2) If the area_id is not B_ERROR, call delete_area on its area_id.</span></P>
|
||||
<DIV class="layer" id="Layer 1">
|
||||
</DIV>
|
||||
</DIV>
|
||||
</BODY>
|
||||
</HTML>
|
123
docs/develop/servers/app_server/ColorUtils.htm
Normal file
123
docs/develop/servers/app_server/ColorUtils.htm
Normal file
@ -0,0 +1,123 @@
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<TITLE>ColorUtils.htm</TITLE>
|
||||
<style type="text/css">
|
||||
<!--
|
||||
.Default {background-color: rgb(255,255,255); color: rgb(0,0,0); font-family: 'Dutch801 Rm BT'; font-size: 12pt}
|
||||
.OBOS-Function-Def {background-color: rgb(255,255,255); color: rgb(0,0,0); font-family: 'Dutch801 Rm BT'; font-size: 16pt}
|
||||
.OBOS-Title {background-color: rgb(255,255,255); color: rgb(0,128,0); font-family: 'Dutch801 Rm BT'; font-size: 24pt}
|
||||
.Text-Background {background-color: rgb(255,255,255)}
|
||||
.GR-Default {}
|
||||
.Body {margin: 0px}
|
||||
.Footer {margin: 0px}
|
||||
.Header {margin: 0px}
|
||||
.WP-Default {text-align: left; text-indent: 0px; margin-left: 0px; margin-right: 0px}
|
||||
-->
|
||||
</style>
|
||||
</HEAD>
|
||||
<BODY BGCOLOR="#ffffff">
|
||||
<DIV class="sheet" id="Sheet 1">
|
||||
<P class="Body" style="margin: 0px"><span class="OBOS-Title">ColorUtils</span><span style="color: rgb(0,0,0); font-size: 24pt"></span></P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
</P>
|
||||
<P class="Body" style="margin: 0px">These functions are used for general purpose color-related tasks.</P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
<BR>
|
||||
<HR>
|
||||
</P>
|
||||
<P class="Body" style="margin: 0px">Global Functions</P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
void SetRGBColor32(rgb_color *col, uint8 r, uint8 g, uint8 b, uint8 a=255)</P>
|
||||
<P class="Body" style="margin: 0px">void SetRGBAColor32(rgb_color *col, uint16 color16)</P>
|
||||
<P class="Body" style="margin: 0px">void SetRGBColor16(uint16 *col, uint8 r, uint8 g, uint8 b)</P>
|
||||
<P class="Body" style="margin: 0px">void SetRGBAColor15(uint16 *col, uint8 r, uint8 g, uint8 b, bool opaque=true)</P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
uint8 FindClosestColor(rgb_color *palette,rgb_color col)</P>
|
||||
<P class="Body" style="margin: 0px">uint16 FindClosestColor16(rgb_color col)</P>
|
||||
<P class="Body" style="margin: 0px">uint16 FindClosestColor15(rgb_color col)</P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
rgb_color MakeBlendColor(rgb_color col, rgb_color col2, float position)</P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
<HR>
|
||||
</P>
|
||||
<P class="Body" style="margin: 0px"><span class="OBOS-Function-Def">void SetRGBColor32(rgb_color *col, uint8 r, uint8 g, uint8 b, uint8 a=255)</span></P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
Simply assigns the passed parameters to the internal members of the passed color</P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
<BR>
|
||||
<span class="OBOS-Function-Def">void SetRGBAColor32(rgb_color *col, uint16 color16)</span></P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
Maps a 16-bit color to a 32-bit one.</P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
gggbbbbb arrrrrgg</P>
|
||||
<P class="Body" style="margin: 0px">1) Extract component values using the following calculations:</P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
red16 = (uint8[1] & 124) >> 2</P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
green16 = ((uint8[0] & 224) >> 5) | ((uint8[1] & 3) << 3)</P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
blue16 = uint8[0] & 31</P>
|
||||
<P class="Body" style="margin: 0px">2) Use cross-multiplication to map each 16-bit color component from 0-31 space to 0-255 space, i.e. red32 = (red16 / 31) * 255</P>
|
||||
<P class="Body" style="margin: 0px">3) Assign mapped values to the rgb_color passed to the function</P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
<BR>
|
||||
<span class="OBOS-Function-Def">void SetRGBColor16(uint16 *col, uint8 r, uint8 g, uint8 b)</span></P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
Used for easy assignment of opaque (B_RGB16) 16-bit colors.</P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
1) Clip parameters via a bitwise AND with 31 (var &=31)</P>
|
||||
<P class="Body" style="margin: 0px">2) Create a uint8 * to the passed color</P>
|
||||
<P class="Body" style="margin: 0px">3) Assign as follows and return:</P>
|
||||
<P class="Body" style="margin: 0px"> a) uint8[0] = ( (g & 7) << 5) | (b & 31)</P>
|
||||
<P class="Body" style="margin: 0px"> b) uint8[1] = ( (r & 31) << 3) | ( (g & 56) >> 3)</P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
<BR>
|
||||
<span class="OBOS-Function-Def">void SetRGBAColor15(uint16 *col, uint8 r, uint8 g, uint8 b, bool opaque=true)</span></P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
Used for easy assignment of alpha-aware (B_RGBA16) 16-bit colors.</P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
1) Clip parameters via a bitwise AND with 31 (var &=31)</P>
|
||||
<P class="Body" style="margin: 0px">2) Create a uint8 * to the passed color</P>
|
||||
<P class="Body" style="margin: 0px">3) Assign as follows and return:</P>
|
||||
<P class="Body" style="margin: 0px"> a) uint8[0] = ( (g & 7) << 5) | (b & 31)</P>
|
||||
<P class="Body" style="margin: 0px"> b) uint8[1] = ( (r & 31) << 2) | ( (g & 24) >> 3) | (a) ? 128 : 0</P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
<BR>
|
||||
<span class="OBOS-Function-Def">uint8 FindClosestColor(rgb_color *palette,rgb_color col)</span></P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
Finds the color which most closely resembles the given one in the given palette.</P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
1) Set the saved delta value to 765 (maximum difference)</P>
|
||||
<P class="Body" style="margin: 0px">2) Loop through all the colors in the palette. For each color,</P>
|
||||
<P class="Body" style="margin: 0px"> a) calculate the delta value for each color component and add them together</P>
|
||||
<P class="Body" style="margin: 0px"> b) compare the new combined delta with the saved one</P>
|
||||
<P class="Body" style="margin: 0px"> c) if the delta is 0, immediately return the current index</P>
|
||||
<P class="Body" style="margin: 0px"> d) if the new one is smaller, save it and also the palette index</P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
<BR>
|
||||
<span class="OBOS-Function-Def">uint16 FindClosestColor16(rgb_color col)</span></P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
Returns a 16-bit approximation of the given 32-bit color. Alpha values are ignored.</P>
|
||||
<P class="Body" style="margin: 0px">1) Create an opaque, 16-bit approximation of col using the following calculations:</P>
|
||||
<P class="Body" style="margin: 0px"> r16=(31*col.red)/255</P>
|
||||
<P class="Body" style="margin: 0px"> g16=(31*col.green)/255</P>
|
||||
<P class="Body" style="margin: 0px"> b16=(31*col.blue)/255</P>
|
||||
<P class="Body" style="margin: 0px">2) Assign it to a uint16 using the same code as in SetRGBColor16() and return it.</P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
<BR>
|
||||
<span class="OBOS-Function-Def">uint16 FindClosestColor15(rgb_color col)</span></P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
This functions almost exactly like the 16-bit version, but this also takes into account the alpha transparency bit and works in the color space B_RGBA15. Follow the same algorithm as FindClosestColor16(), but assign the return value using SetRGBColor15.</P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
<BR>
|
||||
<span class="OBOS-Function-Def">rgb_color MakeBlendColor(rgb_color col, rgb_color col2, float position)</span></P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
MakeBlendColor calculates a color that is somewhere between start color col and end color col2, based on position, where 0<= position <= 1. If position is out of these bounds, a color of {0,0,0,0} is returned. If position is 0, the start color is returned. If position is 1, col2 is returned. Otherwise, the color is calculated thus:</P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
1) calculate delta values for each channel, i.e. int16 delta_r=col.red-col2.red</P>
|
||||
<P class="Body" style="margin: 0px">2) Based on these delta values, calculate the blend values for each channel, i.e. blend_color.red=uint8(col1.red - (delta_r * position) )</P>
|
||||
<DIV class="layer" id="Layer 1">
|
||||
</DIV>
|
||||
</DIV>
|
||||
</BODY>
|
||||
</HTML>
|
179
docs/develop/servers/app_server/CursorManager.htm
Normal file
179
docs/develop/servers/app_server/CursorManager.htm
Normal file
@ -0,0 +1,179 @@
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<TITLE>CursorManager.htm</TITLE>
|
||||
<style type="text/css">
|
||||
<!--
|
||||
.Default {background-color: rgb(255,255,255); color: rgb(0,0,0); font-family: 'Dutch801 Rm BT'; font-size: 12pt}
|
||||
.OBOS-Function-Def {background-color: rgb(255,255,255); color: rgb(0,0,0); font-family: 'Dutch801 Rm BT'; font-size: 16pt}
|
||||
.OBOS-Title {background-color: rgb(255,255,255); color: rgb(0,128,0); font-family: 'Dutch801 Rm BT'; font-size: 24pt}
|
||||
.Text-Background {background-color: rgb(255,255,255)}
|
||||
.GR-Default {}
|
||||
.Body {margin: 0px}
|
||||
.Footer {margin: 0px}
|
||||
.Header {margin: 0px}
|
||||
.WP-Default {text-align: left; text-indent: 0px; margin-left: 0px; margin-right: 0px}
|
||||
-->
|
||||
</style>
|
||||
</HEAD>
|
||||
<BODY BGCOLOR="#ffffff">
|
||||
<DIV class="sheet" id="Sheet 1">
|
||||
<P class="Body" style="margin: 0px"><span class="OBOS-Title">CursorManager class</span><span style="color: rgb(0,0,0); font-size: 24pt"></span></P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
</P>
|
||||
<P class="Body" style="margin: 0px">The CursorManager class handles token creation, calling the cursor-related graphics driver functions, and freeing heap memory for all ServerCursor instances.</P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
<BR>
|
||||
<HR>
|
||||
</P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
Member Functions</P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
</P>
|
||||
<TABLE WIDTH=634 HEIGHT=156 BORDER=1 CELLPADDING=1 CELLSPACING=2>
|
||||
<TR>
|
||||
<TD WIDTH=216 HEIGHT=17>
|
||||
<P class="Body" style="margin: 0px">CursorManager(void)</P>
|
||||
</TD>
|
||||
<TD WIDTH=260 HEIGHT=17>
|
||||
<P class="Body" style="margin: 0px">~CursorManager(void)</P>
|
||||
</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD WIDTH=216 HEIGHT=17>
|
||||
<P class="Body" style="margin: 0px">int32 AddCursor(ServerCursor *c)</P>
|
||||
</TD>
|
||||
<TD WIDTH=260 HEIGHT=17>
|
||||
<P class="Body" style="margin: 0px">void DeleteCursor(int32 token)</P>
|
||||
</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD WIDTH=216 HEIGHT=17>
|
||||
<P class="Body" style="margin: 0px">void RemoveAppCursors(ServerApp *a)</P>
|
||||
</TD>
|
||||
<TD WIDTH=260 HEIGHT=17>
|
||||
<P class="Body" style="margin: 0px">void ShowCursor(void)</P>
|
||||
</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD WIDTH=216 HEIGHT=17>
|
||||
<P class="Body" style="margin: 0px">void HideCursor(void)</P>
|
||||
</TD>
|
||||
<TD WIDTH=260 HEIGHT=17>
|
||||
<P class="Body" style="margin: 0px">void ObscureCursor(void)</P>
|
||||
</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD WIDTH=216 HEIGHT=17>
|
||||
<P class="Body" style="margin: 0px">void SetCursor(int32 token)</P>
|
||||
</TD>
|
||||
<TD WIDTH=260 HEIGHT=17>
|
||||
<P class="Body" style="margin: 0px">ServerCursor *GetCursor(cursor_which which)</P>
|
||||
</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD WIDTH=216 HEIGHT=32>
|
||||
<P class="Body" style="margin: 0px">void SetCursor(cursor_which which)</P>
|
||||
</TD>
|
||||
<TD WIDTH=260 HEIGHT=32>
|
||||
<P class="Body" style="margin: 0px">void ChangeCursor(cursor_which which,</P>
|
||||
<P class="Body" style="margin: 0px">int32 token)</P>
|
||||
</TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
<BR>
|
||||
<HR>
|
||||
</P>
|
||||
<P class="Body" style="margin: 0px"><span class="OBOS-Function-Def">CursorManager(void)</span><span style="font-size: 16pt"></span></P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
<BR>
|
||||
1) Create the cursor list empty</P>
|
||||
<P class="Body" style="margin: 0px">2) Set the token index to 0</P>
|
||||
<P class="Body" style="margin: 0px">3) Allocate the default system cursor and pass it to AddCursor</P>
|
||||
<P class="Body" style="margin: 0px">4) Initialize the member pointer for the graphics driver</P>
|
||||
<P class="Body" style="margin: 0px">5) Create the cursorlock semaphore</P>
|
||||
<P class="Body" style="margin: 0px">6) Call SetDefaultCursor</P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
<BR>
|
||||
<span class="OBOS-Function-Def">~CursorManager(void)</span></P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
1) Empty and delete the cursor list</P>
|
||||
<P class="Body" style="margin: 0px">2) Delete the cursorlock semaphore</P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
<BR>
|
||||
<span class="OBOS-Function-Def">int32 AddCursor(ServerCursor *sc)</span></P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
AddCursor() is used to register the cursor in question with the manager, allowing for the user application to have the identifying token, if necessary. The cursor becomes the property of the manager. If a user application deletes a BCursor, its ServerApp will call DeleteCursor().</P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
1) Acquire cursor lock</P>
|
||||
<P class="Body" style="margin: 0px">2) Add *sc to the cursor list</P>
|
||||
<P class="Body" style="margin: 0px">3) Set sc->token to the current token index value</P>
|
||||
<P class="Body" style="margin: 0px">4) Increment the token index</P>
|
||||
<P class="Body" style="margin: 0px">5) Assign sc->token to temporary variable</P>
|
||||
<P class="Body" style="margin: 0px">6) Release cursor lock</P>
|
||||
<P class="Body" style="margin: 0px">7) Return the saved token value</P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
<BR>
|
||||
<span class="OBOS-Function-Def">void DeleteCursor(int32 ctoken)</span></P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
1) Acquire cursor lock</P>
|
||||
<P class="Body" style="margin: 0px">2) Iterate through the cursor list, looking for ctoken</P>
|
||||
<P class="Body" style="margin: 0px">3) If any ServerCursor->token equals ctoken, remove and delete it</P>
|
||||
<P class="Body" style="margin: 0px">4) Release cursor lock</P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
<BR>
|
||||
<span class="OBOS-Function-Def">void RemoveAppCursors(ServerApp *app)</span></P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
1) Acquire cursor lock</P>
|
||||
<P class="Body" style="margin: 0px">2) Iterate through the cursor list, checking each cursor's ServerApp pointer</P>
|
||||
<P class="Body" style="margin: 0px">3) If any have a ServerApp pointer which matches the passed pointer, remove and delete them</P>
|
||||
<P class="Body" style="margin: 0px">4) Release cursor lock</P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
<BR>
|
||||
<span class="OBOS-Function-Def">void ShowCursor(void)</span></P>
|
||||
<P class="Body" style="margin: 0px"><span class="OBOS-Function-Def">void HideCursor(void)</span></P>
|
||||
<P class="Body" style="margin: 0px"><span class="OBOS-Function-Def">void ObscureCursor(void)</span></P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
Simple pass-through functions which call the graphics driver's functions. Note that acquiring the cursor lock will be necessary for all three calls.</P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
<BR>
|
||||
<span class="OBOS-Function-Def">void SetCursor(int32 token)</span></P>
|
||||
<P class="Body" style="margin: 0px"><span class="OBOS-Function-Def">void SetCursor(cursor_which cursor)</span></P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
These set the current cursor for the graphics driver to the passed cursor, either one previously added via AddCursor or a system cursor.</P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
1) Acquire cursor lock</P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
Token version:</P>
|
||||
<P class="Body" style="margin: 0px">2) Find the cursor in the cursor list and call the graphics driver if non-NULL</P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
cursor_which version:</P>
|
||||
<P class="Body" style="margin: 0px">2) determine which cursor to use via a switch statement and call the graphics driver with the internal pointer for the appropriate cursor</P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
3) Release cursor lock</P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
<BR>
|
||||
<span class="OBOS-Function-Def">ServerCursor *GetCursor(cursor_which which)</span></P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
GetCursor is intended for use in figuring out what cursor is in use for a particular system cursor.</P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
1) Acquire cursor lock</P>
|
||||
<P class="Body" style="margin: 0px">2) use a switch statement to figure which cursor to return and assign a temporary pointer its value</P>
|
||||
<P class="Body" style="margin: 0px">3) Release cursor lock</P>
|
||||
<P class="Body" style="margin: 0px">4) Return the temporary pointer</P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
<BR>
|
||||
<span class="OBOS-Function-Def">void ChangeCursor(cursor_which which, int32 token)</span></P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
Calling ChangeCursor will allow a user to change a system cursor's appearance. Note that in calling this, the cursor changes ownership and belongs to the system. Thus, the BCursor destructor will not ultimately cause the cursor to be deleted.</P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
1) Acquire cursor lock</P>
|
||||
<P class="Body" style="margin: 0px">2) Call FindCursor and, if NULL, release the cursor lock and return</P>
|
||||
<P class="Body" style="margin: 0px">3) Look up the pointer for the system cursor in question and check to see if it is active. If active, then set the local active flag to true. Set the system cursor pointer to the one looked up.</P>
|
||||
<P class="Body" style="margin: 0px">4) If active flag is true, call SetCursor()</P>
|
||||
<P class="Body" style="margin: 0px">5) Release cursor lock</P>
|
||||
<DIV class="layer" id="Layer 1">
|
||||
</DIV>
|
||||
</DIV>
|
||||
</BODY>
|
||||
</HTML>
|
50
docs/develop/servers/app_server/DebugTools.htm
Normal file
50
docs/develop/servers/app_server/DebugTools.htm
Normal file
@ -0,0 +1,50 @@
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<TITLE>DebugTools.htm</TITLE>
|
||||
<style type="text/css">
|
||||
<!--
|
||||
.Default {background-color: rgb(255,255,255); color: rgb(0,0,0); font-family: 'Dutch801 Rm BT'; font-size: 12pt}
|
||||
.OBOS-Function-Def {background-color: rgb(255,255,255); color: rgb(0,0,0); font-family: 'Dutch801 Rm BT'; font-size: 16pt}
|
||||
.OBOS-Title {background-color: rgb(255,255,255); color: rgb(0,128,0); font-family: 'Dutch801 Rm BT'; font-size: 24pt}
|
||||
.Text-Background {background-color: rgb(255,255,255)}
|
||||
.GR-Default {}
|
||||
.Body {margin: 0px}
|
||||
.Footer {margin: 0px}
|
||||
.Header {margin: 0px}
|
||||
.WP-Default {text-align: left; text-indent: 0px; margin-left: 0px; margin-right: 0px}
|
||||
-->
|
||||
</style>
|
||||
</HEAD>
|
||||
<BODY BGCOLOR="#ffffff">
|
||||
<DIV class="sheet" id="Sheet 1">
|
||||
<P class="Body" style="margin: 0px"><span class="OBOS-Title">DebugUtils</span><span style="color: rgb(0,0,0); font-size: 24pt"></span></P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
</P>
|
||||
<P class="Body" style="margin: 0px">These functions are used to make print-based debugging easier.</P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
<BR>
|
||||
<HR>
|
||||
</P>
|
||||
<P class="Body" style="margin: 0px">Global Functions</P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
BString TranslateStatusToBString(status_t value)</P>
|
||||
<P class="Body" style="margin: 0px">BString TranslateColorSpaceToBString(color_space value)</P>
|
||||
<P class="Body" style="margin: 0px">BString TranslateMessageCodeToBString(int32 value)</P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
<BR>
|
||||
<HR>
|
||||
</P>
|
||||
<P class="Body" style="margin: 0px"><span class="OBOS-Function-Def">BString TranslateStatusToBString(status_t value)</span></P>
|
||||
<P class="Body" style="margin: 0px"><span class="OBOS-Function-Def">BString TranslateColorSpaceToBString(color_space value)</span></P>
|
||||
<P class="Body" style="margin: 0px"><span class="OBOS-Function-Def">BString TranslateMessageCodeToBString(int32 value)</span></P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
<span class="OBOS-Function-Def">const char * TranslateStatusToString(status_t value)</span></P>
|
||||
<P class="Body" style="margin: 0px"><span class="OBOS-Function-Def">const char * TranslateColorSpaceToString(color_space value)</span></P>
|
||||
<P class="Body" style="margin: 0px"><span class="OBOS-Function-Def">const char * TranslateMessageCodeToString(int32 value)</span></P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
All of these functions are essentially big switch() statements which assign an appropriate string for the passed parameter and return the assigned string. This way the string can be printed or otherwise easily used.</P>
|
||||
<DIV class="layer" id="Layer 1">
|
||||
</DIV>
|
||||
</DIV>
|
||||
</BODY>
|
||||
</HTML>
|
385
docs/develop/servers/app_server/Decorator.htm
Normal file
385
docs/develop/servers/app_server/Decorator.htm
Normal file
@ -0,0 +1,385 @@
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<TITLE>Decorator.htm</TITLE>
|
||||
<style type="text/css">
|
||||
<!--
|
||||
.Default {background-color: rgb(255,255,255); color: rgb(0,0,0); font-family: 'Dutch801 Rm BT'; font-size: 12pt}
|
||||
.OBOS-Function-Def {background-color: rgb(255,255,255); color: rgb(0,0,0); font-family: 'Dutch801 Rm BT'; font-size: 16pt}
|
||||
.OBOS-Title {background-color: rgb(255,255,255); color: rgb(0,128,0); font-family: 'Dutch801 Rm BT'; font-size: 24pt}
|
||||
.Text-Background {background-color: rgb(255,255,255)}
|
||||
.GR-Default {}
|
||||
.Body {margin: 0px}
|
||||
.Footer {margin: 0px}
|
||||
.Header {margin: 0px}
|
||||
.WP-Default {text-align: left; text-indent: 0px; margin-left: 0px; margin-right: 0px}
|
||||
-->
|
||||
</style>
|
||||
</HEAD>
|
||||
<BODY BGCOLOR="#ffffff">
|
||||
<DIV class="sheet" id="Sheet 1">
|
||||
<P class="Body" style="margin: 0px"><span class="OBOS-Title">Decorator class</span><span style="color: rgb(0,0,0); font-size: 24pt"></span></P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
</P>
|
||||
<P class="Body" style="margin: 0px">Decorators provide the actual drawing for a window's looks.</P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
<BR>
|
||||
<HR>
|
||||
</P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
Member Functions</P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
</P>
|
||||
<TABLE WIDTH=617 HEIGHT=270 BORDER=1 CELLPADDING=1 CELLSPACING=2>
|
||||
<TR>
|
||||
<TD WIDTH=203 HEIGHT=32>
|
||||
<P class="Body" style="margin: 0px">Decorator(SRect int32 wlook, int32 wfeel, int32 wflags)</P>
|
||||
</TD>
|
||||
<TD WIDTH=260 HEIGHT=32>
|
||||
<P class="Body" style="margin: 0px">~Decorator(void)</P>
|
||||
</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD WIDTH=203 HEIGHT=17>
|
||||
<P class="Body" style="margin: 0px">void SetColors(color_set colors)</P>
|
||||
</TD>
|
||||
<TD WIDTH=260 HEIGHT=17>
|
||||
<P class="Body" style="margin: 0px">void SetDriver(DisplayDriver *driver)</P>
|
||||
</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD WIDTH=203 HEIGHT=17>
|
||||
<P class="Body" style="margin: 0px">void SetClose(bool is_down)</P>
|
||||
</TD>
|
||||
<TD WIDTH=260 HEIGHT=17>
|
||||
<P class="Body" style="margin: 0px">void SetMinimize(bool is_down)</P>
|
||||
</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD WIDTH=203 HEIGHT=17>
|
||||
<P class="Body" style="margin: 0px">void SetZoom(bool is_down)</P>
|
||||
</TD>
|
||||
<TD WIDTH=260 HEIGHT=17>
|
||||
<P class="Body" style="margin: 0px">void SetFlags(int32 wflags)</P>
|
||||
</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD WIDTH=203 HEIGHT=17>
|
||||
<P class="Body" style="margin: 0px">void SetFeel(int32 wfeel)</P>
|
||||
</TD>
|
||||
<TD WIDTH=260 HEIGHT=17>
|
||||
<P class="Body" style="margin: 0px">void SetLook(int32 wlook)</P>
|
||||
</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD WIDTH=203 HEIGHT=17>
|
||||
<P class="Body" style="margin: 0px">bool GetClose(void)</P>
|
||||
</TD>
|
||||
<TD WIDTH=260 HEIGHT=17>
|
||||
<P class="Body" style="margin: 0px">bool GetMinimize(void)</P>
|
||||
</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD WIDTH=203 HEIGHT=17>
|
||||
<P class="Body" style="margin: 0px">bool GetZoom(void)</P>
|
||||
</TD>
|
||||
<TD WIDTH=260 HEIGHT=17>
|
||||
<P class="Body" style="margin: 0px">int32 GetLook(void)</P>
|
||||
</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD WIDTH=203 HEIGHT=18>
|
||||
<P class="Body" style="margin: 0px">int32 GetFeel(void)</P>
|
||||
</TD>
|
||||
<TD WIDTH=260 HEIGHT=18>
|
||||
<P class="Body" style="margin: 0px">int32 GetFlags(void)</P>
|
||||
</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD WIDTH=203 HEIGHT=17>
|
||||
<P class="Body" style="margin: 0px">void SetTitle(const char *string)</P>
|
||||
</TD>
|
||||
<TD WIDTH=260 HEIGHT=17>
|
||||
<P class="Body" style="margin: 0px">void SetFont(SFont *sf)</P>
|
||||
</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD WIDTH=203 HEIGHT=17>
|
||||
<P class="Body" style="margin: 0px">void _ClipTitle(void)</P>
|
||||
</TD>
|
||||
<TD WIDTH=260 HEIGHT=17>
|
||||
<P class="Body" style="margin: 0px">void SetFocus(bool is_active)</P>
|
||||
</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD WIDTH=203 HEIGHT=17>
|
||||
<P class="Body" style="margin: 0px">bool GetFocus(void)</P>
|
||||
</TD>
|
||||
<TD WIDTH=260 HEIGHT=17>
|
||||
|
||||
</TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
<BR>
|
||||
<BR>
|
||||
Virtual Functions</P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
</P>
|
||||
<TABLE WIDTH=617 HEIGHT=289 BORDER=1 CELLPADDING=1 CELLSPACING=2>
|
||||
<TR>
|
||||
<TD WIDTH=203 HEIGHT=17>
|
||||
<P class="Body" style="margin: 0px">void MoveBy(float x, float y)</P>
|
||||
</TD>
|
||||
<TD WIDTH=260 HEIGHT=17>
|
||||
<P class="Body" style="margin: 0px">void MoveBy(SPoint pt)</P>
|
||||
</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD WIDTH=203 HEIGHT=17>
|
||||
<P class="Body" style="margin: 0px">void ResizeBy(float x, float y)</P>
|
||||
</TD>
|
||||
<TD WIDTH=260 HEIGHT=17>
|
||||
<P class="Body" style="margin: 0px">void ResizeBy(SPoint pt)</P>
|
||||
</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD WIDTH=203 HEIGHT=17>
|
||||
<P class="Body" style="margin: 0px">void Draw(SRect r)</P>
|
||||
</TD>
|
||||
<TD WIDTH=260 HEIGHT=17>
|
||||
<P class="Body" style="margin: 0px">void Draw(void)</P>
|
||||
</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD WIDTH=203 HEIGHT=17>
|
||||
<P class="Body" style="margin: 0px">void DrawClose(void)</P>
|
||||
</TD>
|
||||
<TD WIDTH=260 HEIGHT=17>
|
||||
<P class="Body" style="margin: 0px">void DrawFrame(void)</P>
|
||||
</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD WIDTH=203 HEIGHT=17>
|
||||
<P class="Body" style="margin: 0px">void DrawMinimize(void)</P>
|
||||
</TD>
|
||||
<TD WIDTH=260 HEIGHT=17>
|
||||
<P class="Body" style="margin: 0px">void DrawTab(void)</P>
|
||||
</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD WIDTH=203 HEIGHT=17>
|
||||
<P class="Body" style="margin: 0px">void DrawTitle(void)</P>
|
||||
</TD>
|
||||
<TD WIDTH=260 HEIGHT=17>
|
||||
<P class="Body" style="margin: 0px">void DrawZoom(void)</P>
|
||||
</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD WIDTH=203 HEIGHT=17>
|
||||
<P class="Body" style="margin: 0px">void _DrawClose(SRect r)</P>
|
||||
</TD>
|
||||
<TD WIDTH=260 HEIGHT=17>
|
||||
<P class="Body" style="margin: 0px">void _DrawFrame(SRect r)</P>
|
||||
</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD WIDTH=203 HEIGHT=17>
|
||||
<P class="Body" style="margin: 0px">void _DrawMinimize(SRect r)</P>
|
||||
</TD>
|
||||
<TD WIDTH=260 HEIGHT=17>
|
||||
<P class="Body" style="margin: 0px">void _DrawTab(SRect r)</P>
|
||||
</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD WIDTH=203 HEIGHT=17>
|
||||
<P class="Body" style="margin: 0px">void _DrawTitle(SRect r)</P>
|
||||
</TD>
|
||||
<TD WIDTH=260 HEIGHT=17>
|
||||
<P class="Body" style="margin: 0px">void _DrawZoom(SRect r)</P>
|
||||
</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD WIDTH=203 HEIGHT=32>
|
||||
<P class="Body" style="margin: 0px">SRegion GetFootprint(void)</P>
|
||||
</TD>
|
||||
<TD WIDTH=260 HEIGHT=32>
|
||||
<P class="Body" style="margin: 0px">click_type Clicked(SPoint pt, int32 buttons, int32 modifiers)</P>
|
||||
</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD WIDTH=203 HEIGHT=32>
|
||||
<P class="Body" style="margin: 0px">void _SetFocus(void)</P>
|
||||
</TD>
|
||||
<TD WIDTH=260 HEIGHT=32>
|
||||
|
||||
</TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
<BR>
|
||||
_ Indicates a protected member function</P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
Exported C Functions</P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
Decorator *create_decorator(SRect frame, int32 wlook, int32 wfeel, int32 wflags)</P>
|
||||
<P class="Body" style="margin: 0px">float get_decorator_version(void)</P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
<BR>
|
||||
Enumerated Types</P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
click_type {</P>
|
||||
<P class="Body" style="margin: 0px"> CLICK_NONE</P>
|
||||
<P class="Body" style="margin: 0px"> CLICK_ZOOM</P>
|
||||
<P class="Body" style="margin: 0px"> CLICK_CLOSE</P>
|
||||
<P class="Body" style="margin: 0px"> CLICK_MINIMIZE</P>
|
||||
<P class="Body" style="margin: 0px"> CLICK_TAB</P>
|
||||
<P class="Body" style="margin: 0px"> CLICK_MOVE</P>
|
||||
<P class="Body" style="margin: 0px"> CLICK_MOVETOBACK</P>
|
||||
<P class="Body" style="margin: 0px"> CLICK_MOVETOFRONT</P>
|
||||
<P class="Body" style="margin: 0px"> CLICK_RESIZE</P>
|
||||
<P class="Body" style="margin: 0px"> CLICK_RESIZE_L</P>
|
||||
<P class="Body" style="margin: 0px"> CLICK_RESIZE_T</P>
|
||||
<P class="Body" style="margin: 0px"> CLICK_RESIZE_R</P>
|
||||
<P class="Body" style="margin: 0px"> CLICK_RESIZE_B</P>
|
||||
<P class="Body" style="margin: 0px"> CLICK_RESIZE_LT</P>
|
||||
<P class="Body" style="margin: 0px"> CLICK_RESIZE_RT</P>
|
||||
<P class="Body" style="margin: 0px"> CLICK_RESIZE_LB</P>
|
||||
<P class="Body" style="margin: 0px"> CLICK_RESIZE_RB</P>
|
||||
<P class="Body" style="margin: 0px">}</P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
<HR>
|
||||
</P>
|
||||
<P class="Body" style="margin: 0px"><span class="OBOS-Function-Def">Decorator(SRect int32 wlook, int32 wfeel, int32 wflags)</span></P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
Sets up internal variables common to all decorators.</P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
1) Assign parameters to respective data members</P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
<BR>
|
||||
<span class="OBOS-Function-Def">~Decorator(void)</span></P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
Empty.</P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
<span class="OBOS-Function-Def">void SetColors(color_set colors)</span></P>
|
||||
<P class="Body" style="margin: 0px"><span class="OBOS-Function-Def">void SetDriver(DisplayDriver *driver)</span></P>
|
||||
<P class="Body" style="margin: 0px"><span class="OBOS-Function-Def">void SetClose(bool is_down)</span></P>
|
||||
<P class="Body" style="margin: 0px"><span class="OBOS-Function-Def">void SetMinimize(bool is_down)</span></P>
|
||||
<P class="Body" style="margin: 0px"><span class="OBOS-Function-Def">void SetZoom(bool is_down)</span></P>
|
||||
<P class="Body" style="margin: 0px"><span class="OBOS-Function-Def">void SetFlags(int32 wflags)</span></P>
|
||||
<P class="Body" style="margin: 0px"><span class="OBOS-Function-Def">void SetFeel(int32 wfeel)</span></P>
|
||||
<P class="Body" style="margin: 0px"><span class="OBOS-Function-Def">void SetLook(int32 wlook)</span></P>
|
||||
<P class="Body" style="margin: 0px"><span class="OBOS-Function-Def">bool GetClose(void)</span></P>
|
||||
<P class="Body" style="margin: 0px"><span class="OBOS-Function-Def">bool GetMinimize(void)</span></P>
|
||||
<P class="Body" style="margin: 0px"><span class="OBOS-Function-Def">bool GetZoom(void)</span></P>
|
||||
<P class="Body" style="margin: 0px"><span class="OBOS-Function-Def">int32 GetLook(void)</span></P>
|
||||
<P class="Body" style="margin: 0px"><span class="OBOS-Function-Def">int32 GetFeel(void)</span></P>
|
||||
<P class="Body" style="margin: 0px"><span class="OBOS-Function-Def">int32 GetFlags(void)</span></P>
|
||||
<P class="Body" style="margin: 0px"><span class="OBOS-Function-Def">void SetTitle(const char *string)</span></P>
|
||||
<P class="Body" style="margin: 0px"><span class="OBOS-Function-Def">void SetFont(SFont *sf)</span></P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
These functions work with the internal members common to all Decorators - assigning them and returning them. Additionally, SetTitle() and SetFont() set the clip_font flag to true.</P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
<span class="OBOS-Function-Def">void ClipTitle(void)</span></P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
ClipTitle calculates how much of the title will actually be displayed when _DrawTitle() is called. </P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
<span style="color: rgb(255,51,0)"><To be fleshed out once font subsystem is better understood></span></P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
<BR>
|
||||
<span class="OBOS-Function-Def">void SetFocus(bool is_active)</span></P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
This is for handling color states when a window receives or loses the focus.</P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
1) Set focus flag to whatever is_active is.</P>
|
||||
<P class="Body" style="margin: 0px">2) call hook function _SetFocus()</P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
<BR>
|
||||
<span class="OBOS-Function-Def">bool GetFocus(void)</span></P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
Returns the focus state held by the decorator</P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
1) Return the focus flag</P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
<BR>
|
||||
<span class="OBOS-Function-Def">Virtual Functions</span></P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
Most of these functions have a default behavior which can be overridden, but are implemented to handle the more common implementations.</P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
<span class="OBOS-Function-Def">void MoveBy(float x, float y)</span></P>
|
||||
<P class="Body" style="margin: 0px"><span class="OBOS-Function-Def">void MoveBy(SPoint pt)</span></P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
Move all member rectangles of Decorator by the specified amount. </P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
<BR>
|
||||
<span class="OBOS-Function-Def">void ResizeBy(float x, float y)</span></P>
|
||||
<P class="Body" style="margin: 0px"><span class="OBOS-Function-Def">void ResizeBy(SPoint pt)</span></P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
Resize the client frame, window frame, and the tab frame (width only) by the specified amount. Button rectangles - close, minimize, and zoom - are not modified.</P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
<BR>
|
||||
<span class="OBOS-Function-Def">void Draw(SRect r)</span></P>
|
||||
<P class="Body" style="margin: 0px"><span class="OBOS-Function-Def">void Draw(void)</span></P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
Main drawing call which checks the intersection of the rectangle passed to it and draws all items which intersect it. Draw(void) simply performs drawing calls to draw the entire decorator's footprint area.</P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
1) Check for intersection with SRect which encompasses the decorator's footprint and return if no intersection.</P>
|
||||
<P class="Body" style="margin: 0px">2) Call _DrawFrame(intersection)</P>
|
||||
<P class="Body" style="margin: 0px">3) Call _DrawTab(intersection)</P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
<BR>
|
||||
<span class="OBOS-Function-Def">void DrawClose(void)</span></P>
|
||||
<P class="Body" style="margin: 0px"><span class="OBOS-Function-Def">protected: void _DrawClose(SRect r)</span></P>
|
||||
<P class="Body" style="margin: 0px"><span class="OBOS-Function-Def">void DrawMinimize(void)</span></P>
|
||||
<P class="Body" style="margin: 0px"><span class="OBOS-Function-Def">protected: void _DrawMinimize(SRect r)</span></P>
|
||||
<P class="Body" style="margin: 0px"><span class="OBOS-Function-Def">void DrawZoom(void)</span></P>
|
||||
<P class="Body" style="margin: 0px"><span class="OBOS-Function-Def">protected: void _DrawZoom(SRect r)</span></P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
Each of these is designed to utilize their respective button rectangles. The public (void) versions simply call the internal protected ones with the button rectangle. These protected versions are, by default, empty. The rectangle passed to them is the invalid area to be drawn, which is not necessarily the entire button's rectangle.</P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
<span class="OBOS-Function-Def">void DrawFrame(void)</span></P>
|
||||
<P class="Body" style="margin: 0px"><span class="OBOS-Function-Def">protected: void _DrawFrame(SRect r)</span></P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
Draws the frame, if any. The public version amounts to _DrawFrame(framerect). The protected version is expected to not cover up the client frame when drawing. Any drawing within the clientrect member will end up being drawn over by the window's child views.</P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
<span class="OBOS-Function-Def">void DrawTab(void)</span></P>
|
||||
<P class="Body" style="margin: 0px"><span class="OBOS-Function-Def">protected: void _DrawTab(SRect r)</span></P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
Draws the window's tab, if any. DrawTab() amounts to _DrawTab(tabrect). If window titles are displayed, the _DrawTitle call is expected to be made here. Button-drawing calls, assuming that a window's buttons are in the tab, should be made here, as well.</P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
<span class="OBOS-Function-Def">void DrawTitle(void)</span></P>
|
||||
<P class="Body" style="margin: 0px"><span class="OBOS-Function-Def">protected: void _DrawTitle(SRect r)</span></P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
These cause the window's title to be drawn. DrawTitle() amounts to _DrawTitle(titlerect). _DrawTitle() should check the clip_title flag and call ClipTitle() only if it is true.</P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
<span style="color: rgb(255,51,0)"><To be fleshed out once font subsystem is better understood></span></P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
<BR>
|
||||
<span class="OBOS-Function-Def">void _SetFocus(void)</span></P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
This hook function is primarily used to change colors used when a window changes focus states and is called immediately after the state is changed. If, for example, a decorator does not use OpenBeOS' GUI color set, it would change its drawing colors to reflect the change in focus.</P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
<BR>
|
||||
<span class="OBOS-Function-Def">SRegion GetFootprint(void)</span></P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
This returns the "footprint" of the decorator, i.e. the area which is occupied by the window which is is the border surrounding the main client rectangle. It is possible to have oddly-shaped window borders, like ellipses and circles, but the resulting performance hit would reduce the said decorator to a novelty and not something useable. All versions are to construct an SRegion which the border occupies. This footprint is permitted to include the client rectangle area, but this area must not be actually drawn upon by the decorator itself. The default version returns the frame which encompasses all other rectangles - the "frame" member which belongs to its window border.</P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
<BR>
|
||||
<span class="OBOS-Function-Def">click_type Clicked(SPoint pt, int32 buttons, int32 modifiers)</span></P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
Clicked() performs hit testing for the decorator, given input conditions. This function is required by ALL subclasses expecting to do more than display itself. The return type will cause the server to take the appropriate actions, such as close the window, get ready to move it, etc.</P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
<BR>
|
||||
<span class="OBOS-Function-Def">extern "C" Decorator *create_decorator(SRect frame, int32 wlook, int32 wfeel, int32 wflags)</span></P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
Required export function which simply allocates an instance of the decorator and returns it.</P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
<span class="OBOS-Function-Def">extern "C" float get_decorator_version(void)</span></P>
|
||||
<P class="Body" style="margin: 0px"><span class="Default"><BR>
|
||||
This should, for now, return 1.00.</span></P>
|
||||
<P class="Body" style="margin: 0px"><span class="Default"><BR>
|
||||
</span></P>
|
||||
<DIV class="layer" id="Layer 1">
|
||||
</DIV>
|
||||
</DIV>
|
||||
</BODY>
|
||||
</HTML>
|
202
docs/develop/servers/app_server/DisplayDriver.htm
Normal file
202
docs/develop/servers/app_server/DisplayDriver.htm
Normal file
@ -0,0 +1,202 @@
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<TITLE>DisplayDriver.htm</TITLE>
|
||||
<style type="text/css">
|
||||
<!--
|
||||
.Default {background-color: rgb(255,255,255); color: rgb(0,0,0); font-family: 'Dutch801 Rm BT'; font-size: 12pt}
|
||||
.OBOS-Function-Def {background-color: rgb(255,255,255); color: rgb(0,0,0); font-family: 'Dutch801 Rm BT'; font-size: 16pt}
|
||||
.OBOS-Title {background-color: rgb(255,255,255); color: rgb(0,128,0); font-family: 'Dutch801 Rm BT'; font-size: 24pt}
|
||||
.Text-Background {background-color: rgb(255,255,255)}
|
||||
.GR-Default {}
|
||||
.Body {margin: 0px}
|
||||
.Footer {margin: 0px}
|
||||
.Header {margin: 0px}
|
||||
.WP-Default {text-align: left; text-indent: 0px; margin-left: 0px; margin-right: 0px}
|
||||
-->
|
||||
</style>
|
||||
</HEAD>
|
||||
<BODY BGCOLOR="#ffffff">
|
||||
<DIV class="sheet" id="Sheet 1">
|
||||
<P class="Body" style="margin: 0px"><span class="OBOS-Title">DisplayDriver class</span><span style="color: rgb(0,0,0); font-size: 24pt"></span></P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
</P>
|
||||
<P class="Body" style="margin: 0px">The DisplayDriver class is not a useful class unto itself. It is to provide a consistent interface for the rest of the app_server to whatever rendering context it is utilizing, whether it be a remote screen, a ServerBitmap, installed graphics hardware, or whatever. Documentation below will describe the role of each function.</P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
<BR>
|
||||
<HR>
|
||||
</P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
Member Functions</P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
</P>
|
||||
<TABLE WIDTH=618 HEIGHT=537 BORDER=1 CELLPADDING=1 CELLSPACING=2>
|
||||
<TR>
|
||||
<TD WIDTH=224 HEIGHT=17>
|
||||
<P class="Body" style="margin: 0px">DisplayDriver(void)</P>
|
||||
</TD>
|
||||
<TD WIDTH=240 HEIGHT=17>
|
||||
<P class="Body" style="margin: 0px">~DisplayDriver(void)</P>
|
||||
</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD WIDTH=224 HEIGHT=17>
|
||||
<P class="Body" style="margin: 0px">bool Initialize(void)</P>
|
||||
</TD>
|
||||
<TD WIDTH=240 HEIGHT=17>
|
||||
<P class="Body" style="margin: 0px">void Shutdown(void)</P>
|
||||
</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD WIDTH=224 HEIGHT=32>
|
||||
<P class="Body" style="margin: 0px">void DrawBitmap(ServerBitmap *bmp, SRect src, SRect dest)</P>
|
||||
</TD>
|
||||
<TD WIDTH=240 HEIGHT=32>
|
||||
<P class="Body" style="margin: 0px">void DrawChar(char c, SPoint pt)</P>
|
||||
</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD WIDTH=224 HEIGHT=47>
|
||||
<P class="Body" style="margin: 0px">void DrawString(const char *string, int32 length, SPoint pt, escapement_delta *delta=NULL)</P>
|
||||
</TD>
|
||||
<TD WIDTH=240 HEIGHT=47>
|
||||
<P class="Body" style="margin: 0px">void Stroke/FillBezier(SPoint *pts, layerdata *d, int8 *pat)</P>
|
||||
</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD WIDTH=224 HEIGHT=32>
|
||||
<P class="Body" style="margin: 0px">void Stroke/FillEllipse(SRect r, layerdata *d, int8 *pattern)</P>
|
||||
</TD>
|
||||
<TD WIDTH=240 HEIGHT=32>
|
||||
<P class="Body" style="margin: 0px">void Stroke/FillArc(SRect r, float angle, float span, layerdata *d, int8 *pattern)</P>
|
||||
</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD WIDTH=224 HEIGHT=47>
|
||||
<P class="Body" style="margin: 0px">void StrokeLine(SPoint start, SPoint end, layerdata *d, int8 *pattern)</P>
|
||||
</TD>
|
||||
<TD WIDTH=240 HEIGHT=47>
|
||||
<P class="Body" style="margin: 0px">void StrokePolygon(SPoint *ptlist, int32 numpts, SRect rect, layerdata *d, int8 *pattern, bool is_closed=true)</P>
|
||||
</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD WIDTH=224 HEIGHT=47>
|
||||
<P class="Body" style="margin: 0px">void FillPolygon(SPoint *ptlist, int32 numpts, SRect rect, layerdata *d, int8 *pattern)</P>
|
||||
</TD>
|
||||
<TD WIDTH=240 HEIGHT=47>
|
||||
<P class="Body" style="margin: 0px">void Stroke/FillRect(SRect r, layerdata *d, int8 *pattern)</P>
|
||||
</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD WIDTH=224 HEIGHT=47>
|
||||
<P class="Body" style="margin: 0px">void Stroke/FillRoundRect(SRect r, float xrad, float yrad, layerdata *d, int8 *pattern)</P>
|
||||
</TD>
|
||||
<TD WIDTH=240 HEIGHT=47>
|
||||
<P class="Body" style="margin: 0px">void Stroke/FillShape(SShape *sh, layerdata *d, int8 *pattern)</P>
|
||||
</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD WIDTH=224 HEIGHT=32>
|
||||
<P class="Body" style="margin: 0px">void Stroke/FillTriangle(SPoints *pts, SRect r, layerdata *d, int8 *pattern)</P>
|
||||
</TD>
|
||||
<TD WIDTH=240 HEIGHT=32>
|
||||
<P class="Body" style="margin: 0px">void StrokeLineArray(SPoint *pts, int32 numlines, rgb_color *colors, layerdata *d)</P>
|
||||
</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD WIDTH=224 HEIGHT=17>
|
||||
<P class="Body" style="margin: 0px">void DrawPicture(SPicture *pic, SPoint pt)</P>
|
||||
</TD>
|
||||
<TD WIDTH=240 HEIGHT=17>
|
||||
<P class="Body" style="margin: 0px">void CopyBits(SRect src, SRect dest)</P>
|
||||
</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD WIDTH=224 HEIGHT=17>
|
||||
<P class="Body" style="margin: 0px">void InvertRect(SRect r)</P>
|
||||
</TD>
|
||||
<TD WIDTH=240 HEIGHT=17>
|
||||
<P class="Body" style="margin: 0px">uint8 GetDepth(void)</P>
|
||||
</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD WIDTH=224 HEIGHT=17>
|
||||
<P class="Body" style="margin: 0px">uint16 GetHeight(void)</P>
|
||||
</TD>
|
||||
<TD WIDTH=240 HEIGHT=17>
|
||||
<P class="Body" style="margin: 0px">uint16 GetWidth(void)</P>
|
||||
</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD WIDTH=224 HEIGHT=17>
|
||||
<P class="Body" style="margin: 0px">screen_mode GetMode(void)</P>
|
||||
</TD>
|
||||
<TD WIDTH=240 HEIGHT=17>
|
||||
<P class="Body" style="margin: 0px">void SetMode(screen_mode mode)</P>
|
||||
</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD WIDTH=224 HEIGHT=17>
|
||||
<P class="Body" style="margin: 0px">bool DumpToFile(const char *path)</P>
|
||||
</TD>
|
||||
<TD WIDTH=240 HEIGHT=17>
|
||||
|
||||
</TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
<BR>
|
||||
<BR>
|
||||
<HR>
|
||||
</P>
|
||||
<P class="Body" style="margin: 0px"><span class="OBOS-Function-Def">DisplayDriver(void)</span></P>
|
||||
<P class="Body" style="margin: 0px"><span class="OBOS-Function-Def">~DisplayDriver(void)</span></P>
|
||||
<P class="Body" style="margin: 0px"><span class="OBOS-Function-Def">bool Initialize(void)</span></P>
|
||||
<P class="Body" style="margin: 0px"><span class="OBOS-Function-Def">void Shutdown(void)</span></P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
These four are for general start and stop procedures. The constructor and destructor concern themselves with the internal members common to all drivers, such as the current cursor and the access semaphore. Subclasses will probably end up using these to handle memory allocation-related issues, but likely not much else. Initialize() and Shutdown() are for general setup internal to the module. Note that if Initialize() returns false, the server will not use the module, call Shutdown(), and then delete it as accordingly.</P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
<span class="OBOS-Function-Def">void CopyBits(SRect src, SRect dest)</span></P>
|
||||
<P class="Body" style="margin: 0px"><span class="OBOS-Function-Def">void InvertRect(SRect r)</span></P>
|
||||
<P class="Body" style="margin: 0px"><span class="OBOS-Function-Def">void DrawBitmap(ServerBitmap *bmp, SRect src, SRect dest, render_mode mode)</span></P>
|
||||
<P class="Body" style="margin: 0px"><span class="OBOS-Function-Def">void DrawPicture(SPicture *pic, SPoint pt)</span></P>
|
||||
<P class="Body" style="margin: 0px"><span class="OBOS-Function-Def">void DrawChar(char c, SPoint pt)</span></P>
|
||||
<P class="Body" style="margin: 0px"><span class="OBOS-Function-Def">void DrawString(const char *string, int32 length, SPoint pt, escapement_delta *delta=NULL)</span></P>
|
||||
<P class="Body" style="margin: 0px"><span class="OBOS-Function-Def"><BR>
|
||||
void StrokeArc(SRect r, float angle, float span, layerdata *d, int8 *pattern)</span></P>
|
||||
<P class="Body" style="margin: 0px"><span class="OBOS-Function-Def">void FillArc(SRect r, float angle, float span, layerdata *d, int8 *pattern)</span></P>
|
||||
<P class="Body" style="margin: 0px"><span class="OBOS-Function-Def">void StrokeBezier(SPoint *pts, layerdata *d, int8 *pat)</span></P>
|
||||
<P class="Body" style="margin: 0px"><span class="OBOS-Function-Def">void FillBezier(SPoint *pts, layerdata *d, int8 *pat)</span></P>
|
||||
<P class="Body" style="margin: 0px"><span class="OBOS-Function-Def">void StrokeEllipse(SRect r, layerdata *d, int8 *pattern)</span></P>
|
||||
<P class="Body" style="margin: 0px"><span class="OBOS-Function-Def">void FillEllipse(SRect r, layerdata *d, int8 *pattern)</span></P>
|
||||
<P class="Body" style="margin: 0px"><span class="OBOS-Function-Def">void StrokeLine(SPoint start, SPoint end, layerdata *d, int8 *pattern)</span></P>
|
||||
<P class="Body" style="margin: 0px"><span class="OBOS-Function-Def">void StrokeLineArray(SPoint *pts, int32 numlines, rgb_color *colors, layerdata *d)</span></P>
|
||||
<P class="Body" style="margin: 0px"><span class="OBOS-Function-Def">void StrokePolygon(SPoint *ptlist, int32 numpts, SRect rect, layerdata *d, int8 *pattern, bool is_closed=true)</span></P>
|
||||
<P class="Body" style="margin: 0px"><span class="OBOS-Function-Def">void FillPolygon(SPoint *ptlist, int32 numpts, SRect rect, layerdata *d, int8 *pattern)</span></P>
|
||||
<P class="Body" style="margin: 0px"><span class="OBOS-Function-Def">void StrokeRect(SRect r, layerdata *d, int8 *pattern)</span></P>
|
||||
<P class="Body" style="margin: 0px"><span class="OBOS-Function-Def">void FillRect(SRect r, layerdata *d, int8 *pattern)</span></P>
|
||||
<P class="Body" style="margin: 0px"><span class="OBOS-Function-Def">void StrokeRoundRect(SRect r, float xrad, float yrad, layerdata *d, int8 *pattern)</span></P>
|
||||
<P class="Body" style="margin: 0px"><span class="OBOS-Function-Def">void FillRoundRect(SRect r, float xrad, float yrad, layerdata *d, int8 *pattern)</span></P>
|
||||
<P class="Body" style="margin: 0px"><span class="OBOS-Function-Def">void StrokeShape(SShape *sh, layerdata *d, int8 *pattern)</span></P>
|
||||
<P class="Body" style="margin: 0px"><span class="OBOS-Function-Def">void FillShape(SShape *sh, layerdata *d, int8 *pattern)</span></P>
|
||||
<P class="Body" style="margin: 0px"><span class="OBOS-Function-Def">void StrokeTriangle(SPoints *pts, SRect r, layerdata *d, int8 *pattern)</span></P>
|
||||
<P class="Body" style="margin: 0px"><span class="OBOS-Function-Def">void FillTriangle(SPoints *pts, SRect r, layerdata *d, int8 *pattern)</span></P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
These drawing functions are the meat and potatoes of the graphics module. Defining any or all of them is completely optional. However, the default versions of these functions will do nothing. Thus, implementing them is likely a good idea, even if not required.</P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
<BR>
|
||||
<span class="OBOS-Function-Def">uint8 GetDepth(void)</span></P>
|
||||
<P class="Body" style="margin: 0px"><span class="OBOS-Function-Def">uint16 GetHeight(void)</span></P>
|
||||
<P class="Body" style="margin: 0px"><span class="OBOS-Function-Def">uint16 GetWidth(void)</span></P>
|
||||
<P class="Body" style="margin: 0px"><span class="OBOS-Function-Def">screen_mode GetMode(void)</span></P>
|
||||
<P class="Body" style="margin: 0px"><span class="OBOS-Function-Def">void SetMode(screen_mode mode)</span></P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
These five functions are called internally in order to get information about the current state of the buffer in the module. GetDepth should return 8, 16, or 32, in any event because the server handles RGB color spaces of these depths only.</P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
<span class="OBOS-Function-Def">bool DumpToFile(const char *path)</span></P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
DumpToFile is completely optional, providing a hook which allows screenshots to be taken. The default version does nothing but return false. If a screenshot is successful, return true.</P>
|
||||
<DIV class="layer" id="Layer 1">
|
||||
</DIV>
|
||||
</DIV>
|
||||
</BODY>
|
||||
</HTML>
|
118
docs/develop/servers/app_server/PatternHandler.htm
Normal file
118
docs/develop/servers/app_server/PatternHandler.htm
Normal file
@ -0,0 +1,118 @@
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<TITLE>PatternHandler.htm</TITLE>
|
||||
<style type="text/css">
|
||||
<!--
|
||||
.Default {background-color: rgb(255,255,255); color: rgb(0,0,0); font-family: 'Dutch801 Rm BT'; font-size: 12pt}
|
||||
.OBOS-Function-Def {background-color: rgb(255,255,255); color: rgb(0,0,0); font-family: 'Dutch801 Rm BT'; font-size: 16pt}
|
||||
.OBOS-Title {background-color: rgb(255,255,255); color: rgb(0,128,0); font-family: 'Dutch801 Rm BT'; font-size: 24pt}
|
||||
.Text-Background {background-color: rgb(255,255,255)}
|
||||
.GR-Default {}
|
||||
.Body {margin: 0px}
|
||||
.Footer {margin: 0px}
|
||||
.Header {margin: 0px}
|
||||
.WP-Default {text-align: left; text-indent: 0px; margin-left: 0px; margin-right: 0px}
|
||||
-->
|
||||
</style>
|
||||
</HEAD>
|
||||
<BODY BGCOLOR="#ffffff">
|
||||
<DIV class="sheet" id="Sheet 1">
|
||||
<P class="Body" style="margin: 0px"><span class="OBOS-Title">PatternHandler class</span><span style="color: rgb(0,0,0); font-size: 24pt"></span></P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
</P>
|
||||
<P class="Body" style="margin: 0px">PatternHandler provides an easy way to integrate pattern support into classes which require it, such as the DisplayDriver class.</P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
<BR>
|
||||
<HR>
|
||||
</P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
Member Functions</P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
</P>
|
||||
<TABLE WIDTH=618 HEIGHT=90 BORDER=1 CELLPADDING=1 CELLSPACING=2>
|
||||
<TR>
|
||||
<TD WIDTH=219 HEIGHT=17>
|
||||
<P class="Body" style="margin: 0px">PatternHandler(void)</P>
|
||||
</TD>
|
||||
<TD WIDTH=245 HEIGHT=17>
|
||||
<P class="Body" style="margin: 0px">~PatternHandler(void)</P>
|
||||
</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD WIDTH=219 HEIGHT=17>
|
||||
<P class="Body" style="margin: 0px">void SetTarget(int8 *pattern)</P>
|
||||
</TD>
|
||||
<TD WIDTH=245 HEIGHT=17>
|
||||
<P class="Body" style="margin: 0px">void SetColors(RGBColor c1, RGBColor c2)</P>
|
||||
</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD WIDTH=219 HEIGHT=17>
|
||||
<P class="Body" style="margin: 0px">RGBColor GetColor(SPoint pt)</P>
|
||||
</TD>
|
||||
<TD WIDTH=245 HEIGHT=17>
|
||||
<P class="Body" style="margin: 0px">RGBColor GetColor(float x, float y)</P>
|
||||
</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD WIDTH=219 HEIGHT=17>
|
||||
<P class="Body" style="margin: 0px">bool GetValue(float x, float y)</P>
|
||||
</TD>
|
||||
<TD WIDTH=245 HEIGHT=17>
|
||||
<P class="Body" style="margin: 0px">bool GetValue(SPoint pt)</P>
|
||||
</TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
<BR>
|
||||
Enumerated Types</P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
pattern_enum</P>
|
||||
<P class="Body" style="margin: 0px">{</P>
|
||||
<P class="Body" style="margin: 0px"> uint64 type64</P>
|
||||
<P class="Body" style="margin: 0px"> uint8 type8 [8]</P>
|
||||
<P class="Body" style="margin: 0px">}</P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
<HR>
|
||||
</P>
|
||||
<P class="Body" style="margin: 0px"><span class="OBOS-Function-Def">PatternHandler()</span><span style="font-size: 16pt"></span></P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
1) Initialize internal RGBColor variables to black and white, respectively.</P>
|
||||
<P class="Body" style="margin: 0px">2) Set internal pattern to B_SOLID_HIGH (all 1's)</P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
<BR>
|
||||
<span class="OBOS-Function-Def">~PatternHandler()</span><span style="font-size: 16pt"></span></P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
Empty</P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
<BR>
|
||||
<span class="OBOS-Function-Def">void SetTarget(int8 *pattern)</span></P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
Updates the pattern handler's pattern. It copies the pattern passed to it, so it does NOT take responsibility for freeing any memory.</P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
1) cast the passed pointer in such a way to copy it as a uint64 to the pattern_enum.type64 member</P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
<span class="OBOS-Function-Def">void SetColors(RGBColor c1, RGBColor c2)</span></P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
Sets the internal high and low colors for the pattern handler. These will be the colors returned when GetColor() is called.</P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
1) Assign c1 to high color and c2 to low color</P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
<BR>
|
||||
<span class="OBOS-Function-Def">RGBColor GetColor(SPoint pt)
|
||||
RGBColor GetColor (float x, float y)</span></P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
<span class="OBOS-Function-Def">bool GetValue(SPoint pt)
|
||||
bool GetValue (float x, float y)</span></P>
|
||||
<P class="Body" style="margin: 0px"><span class="OBOS-Function-Def"><BR>
|
||||
</span><span class="Default">GetColor returns the color in the pattern at the specified location. GetValue returns true for the high color and false for the low color.</span></P>
|
||||
<P class="Body" style="margin: 0px"><span class="Default"><BR>
|
||||
1) xpos = x % 8, ypos = y % 8
|
||||
2) value = pointer [ ypos ] & ( 1 << (7 - xpos) )</span></P>
|
||||
<P class="Body" style="margin: 0px"><span class="Default">3) GetValue: return (value==0)?false:true</span></P>
|
||||
<P class="Body" style="margin: 0px"><span class="Default">GetColor: return (value==0)?lowcolor:highcolor</span></P>
|
||||
<DIV class="layer" id="Layer 1">
|
||||
</DIV>
|
||||
</DIV>
|
||||
</BODY>
|
||||
</HTML>
|
189
docs/develop/servers/app_server/RGBColor.htm
Normal file
189
docs/develop/servers/app_server/RGBColor.htm
Normal file
@ -0,0 +1,189 @@
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<TITLE>RGBColor.htm</TITLE>
|
||||
<style type="text/css">
|
||||
<!--
|
||||
.Default {background-color: rgb(255,255,255); color: rgb(0,0,0); font-family: 'Dutch801 Rm BT'; font-size: 12pt}
|
||||
.OBOS-Function-Def {background-color: rgb(255,255,255); color: rgb(0,0,0); font-family: 'Dutch801 Rm BT'; font-size: 16pt}
|
||||
.OBOS-Title {background-color: rgb(255,255,255); color: rgb(0,128,0); font-family: 'Dutch801 Rm BT'; font-size: 24pt}
|
||||
.Text-Background {background-color: rgb(255,255,255)}
|
||||
.GR-Default {}
|
||||
.Body {margin: 0px}
|
||||
.Footer {margin: 0px}
|
||||
.Header {margin: 0px}
|
||||
.WP-Default {text-align: left; text-indent: 0px; margin-left: 0px; margin-right: 0px}
|
||||
-->
|
||||
</style>
|
||||
</HEAD>
|
||||
<BODY BGCOLOR="#ffffff">
|
||||
<DIV class="sheet" id="Sheet 1">
|
||||
<P class="Body" style="margin: 0px"><span class="OBOS-Title">RGBColor class</span><span style="color: rgb(0,0,0); font-size: 24pt"></span></P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
</P>
|
||||
<P class="Body" style="margin: 0px">RGBColor objects provide a simplified interface to colors for the app_server, especially the DisplayDriver class</P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
<BR>
|
||||
<HR>
|
||||
</P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
Member Functions</P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
</P>
|
||||
<TABLE WIDTH=617 HEIGHT=264 BORDER=1 CELLPADDING=1 CELLSPACING=2>
|
||||
<TR>
|
||||
<TD WIDTH=203 HEIGHT=32>
|
||||
<P class="Body" style="margin: 0px">RGBColor(uint8 r, uint8 g, uint8 b, uint8 a=255)</P>
|
||||
</TD>
|
||||
<TD WIDTH=260 HEIGHT=32>
|
||||
<P class="Body" style="margin: 0px">RGBColor(rgb_color col)</P>
|
||||
</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD WIDTH=203 HEIGHT=17>
|
||||
<P class="Body" style="margin: 0px">RGBColor(uint16 color16)</P>
|
||||
</TD>
|
||||
<TD WIDTH=260 HEIGHT=17>
|
||||
<P class="Body" style="margin: 0px">RGBColor(uint8 color8)</P>
|
||||
</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD WIDTH=203 HEIGHT=17>
|
||||
<P class="Body" style="margin: 0px">RGBColor(const RGBColor &color)</P>
|
||||
</TD>
|
||||
<TD WIDTH=260 HEIGHT=17>
|
||||
<P class="Body" style="margin: 0px">RGBColor(void)</P>
|
||||
</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD WIDTH=203 HEIGHT=17>
|
||||
<P class="Body" style="margin: 0px">void PrintToStream(void)</P>
|
||||
</TD>
|
||||
<TD WIDTH=260 HEIGHT=17>
|
||||
<P class="Body" style="margin: 0px">uint8 GetColor8(void)</P>
|
||||
</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD WIDTH=203 HEIGHT=17>
|
||||
<P class="Body" style="margin: 0px">uint16 GetColor16(void)</P>
|
||||
</TD>
|
||||
<TD WIDTH=260 HEIGHT=17>
|
||||
<P class="Body" style="margin: 0px">rgb_color GetColor32(void)</P>
|
||||
</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD WIDTH=203 HEIGHT=32>
|
||||
<P class="Body" style="margin: 0px">void SetColor(uint8 r, uint8 g, uint8 b, uint8 a=255)</P>
|
||||
</TD>
|
||||
<TD WIDTH=260 HEIGHT=32>
|
||||
<P class="Body" style="margin: 0px">void SetColor(uint16 color16)</P>
|
||||
</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD WIDTH=203 HEIGHT=17>
|
||||
<P class="Body" style="margin: 0px">void SetColor(uint8 color 8)</P>
|
||||
</TD>
|
||||
<TD WIDTH=260 HEIGHT=17>
|
||||
<P class="Body" style="margin: 0px">void SetColor(rgb_color color)</P>
|
||||
</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD WIDTH=203 HEIGHT=17>
|
||||
<P class="Body" style="margin: 0px">void SetColor(const RGBColor &col)</P>
|
||||
</TD>
|
||||
<TD WIDTH=260 HEIGHT=17>
|
||||
<P class="Body" style="margin: 0px">Operators: =,==,!=</P>
|
||||
</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD WIDTH=203 HEIGHT=32>
|
||||
<P class="Body" style="margin: 0px">RGBColor MakeBlendColor( RGBColor c, float position)</P>
|
||||
</TD>
|
||||
<TD WIDTH=260 HEIGHT=32>
|
||||
|
||||
</TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
<BR>
|
||||
<HR>
|
||||
</P>
|
||||
<P class="Body" style="margin: 0px"><span class="OBOS-Function-Def">RGBColor(uint8 r, uint8 g, uint8 b, uint8 a=255)</span><span style="font-size: 16pt"></span></P>
|
||||
<P class="Body" style="margin: 0px"><span class="OBOS-Function-Def">RGBColor(rgb_color col)</span><span style="font-size: 16pt"></span></P>
|
||||
<P class="Body" style="margin: 0px"><span class="OBOS-Function-Def">RGBColor(uint16 color16)</span><span style="font-size: 16pt"></span></P>
|
||||
<P class="Body" style="margin: 0px"><span class="OBOS-Function-Def">RGBColor(uint8 color8)</span><span style="font-size: 16pt"></span></P>
|
||||
<P class="Body" style="margin: 0px"><span class="OBOS-Function-Def">RGBColor(const RGBColor &color)</span><span style="font-size: 16pt"></span></P>
|
||||
<P class="Body" style="margin: 0px"><span class="OBOS-Function-Def">RGBColor(void)</span><span style="font-size: 16pt"></span></P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
1) In all cases, extract the color data by calling SetColor. Void version sets to (0,0,0,0)</P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
<BR>
|
||||
<span class="OBOS-Function-Def">void PrintToStream(void)</span></P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
Prints the color values of the color32 member via printf()</P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
<span class="OBOS-Function-Def">uint8 GetColor8(void)</span><span style="font-size: 16pt"></span></P>
|
||||
<P class="Body" style="margin: 0px"><span class="OBOS-Function-Def">uint16 GetColor16(void)</span><span style="font-size: 16pt"></span></P>
|
||||
<P class="Body" style="margin: 0px"><span class="OBOS-Function-Def">rgb_color GetColor32(void)</span><span style="font-size: 16pt"></span></P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
These are for obtaining space-specific versions of the color assigned to the object.</P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
1) In all cases, return the internal color storage members </P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
<BR>
|
||||
<span class="OBOS-Function-Def">void SetColor(const RGBColor &color)</span><span style="font-size: 16pt"></span></P>
|
||||
<P class="Body" style="margin: 0px"><span class="Default"><BR>
|
||||
Copy all internal members to the current object.</span></P>
|
||||
<P class="Body" style="margin: 0px"><span class="Default"><BR>
|
||||
<BR>
|
||||
</span><span class="OBOS-Function-Def">void SetColor(uint8 r, uint8 g, uint8 b, uint8 a=255)</span><span style="font-size: 16pt"></span></P>
|
||||
<P class="Body" style="margin: 0px"><span class="OBOS-Function-Def">void SetColor(rgb_color col)</span><span style="font-size: 16pt"></span></P>
|
||||
<P class="Body" style="margin: 0px"><span class="Default"><BR>
|
||||
</span><span class="Default">1) Assign parameters to internal rgb_color</span></P>
|
||||
<P class="Body" style="margin: 0px"><span class="Default">2) call SetRGBAColor15()</span></P>
|
||||
<P class="Body" style="margin: 0px"><span class="Default">3) call SystemPalette::FindClosestColor()</span></P>
|
||||
<P class="Body" style="margin: 0px"><span class="Default"><BR>
|
||||
</span><span class="Default"><BR>
|
||||
</span><span class="OBOS-Function-Def">void SetColor(uint16 color16)</span><span style="font-size: 16pt"></span></P>
|
||||
<P class="Body" style="margin: 0px"><span class="Default"><BR>
|
||||
1) Assign parameter to internal uint16</span></P>
|
||||
<P class="Body" style="margin: 0px"><span class="Default">2) call SetRGBAColor32()</span></P>
|
||||
<P class="Body" style="margin: 0px"><span class="Default">3) call SystemPalette::FindClosestColor()</span></P>
|
||||
<P class="Body" style="margin: 0px"><span style="font-size: 16pt"><BR>
|
||||
<BR>
|
||||
</span><span class="OBOS-Function-Def">void SetColor(uint8 color8)</span><span style="font-size: 16pt"></span></P>
|
||||
<P class="Body" style="margin: 0px"><span style="font-size: 16pt"><BR>
|
||||
</span><span class="Default">1) Assign parameter to internal uint8</span></P>
|
||||
<P class="Body" style="margin: 0px"><span class="Default">2) Get the 32-bit value from the palette and assign it to the internal rgb_color</span></P>
|
||||
<P class="Body" style="margin: 0px"><span class="Default">3) call SetRGBAColor16()</span></P>
|
||||
<P class="Body" style="margin: 0px"><span style="font-size: 16pt"><BR>
|
||||
<BR>
|
||||
</span><span class="OBOS-Function-Def">RGBColor & operator=(const RGBColor &from)</span><span style="font-size: 16pt"></span></P>
|
||||
<P class="Body" style="margin: 0px"><span class="Default"><BR>
|
||||
Copy all data members over and return the value of this (return *this;)</span></P>
|
||||
<P class="Body" style="margin: 0px"><span class="Default"><BR>
|
||||
</span><span class="OBOS-Function-Def">bool operator==(const RGBColor &from)</span><span style="font-size: 16pt"></span></P>
|
||||
<P class="Body" style="margin: 0px"><span class="Default"><BR>
|
||||
</span><span class="Default">Compare rgb_colors and if all members are equal, return true. Otherwise, return false.</span></P>
|
||||
<P class="Body" style="margin: 0px"><span class="Default"><BR>
|
||||
</span><span class="OBOS-Function-Def">bool operator!=(const RGBColor &from)</span><span style="font-size: 16pt"></span></P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
Compare rgb_colors and if all are equal, return false. <span class="Default">Otherwise, return true.</span></P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
<span class="OBOS-Function-Def">RGBColor MakeBlendColor(RGBColor c, float position)</span></P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
Returns a color which is (position * 100) of the way from the current color to the one passed to it. This would be an easy way to generate color gradients, for example, but with more control.</P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
1) Clip position to the range 0<=position<=1</P>
|
||||
<P class="Body" style="margin: 0px">2) For each color component,</P>
|
||||
<P class="Body" style="margin: 0px"> a) calculate the delta (delta=int16(c.component-thiscolor.component))</P>
|
||||
<P class="Body" style="margin: 0px"> b) calculate the modifier (mod=thiscolor.component+(delta * position))</P>
|
||||
<P class="Body" style="margin: 0px"> c) clip modifier to the range 0 <= modifier <= 255</P>
|
||||
<P class="Body" style="margin: 0px"> d) assign modifier to the component (thiscolor.component=int8(mod))</P>
|
||||
<P class="Body" style="margin: 0px">3) return a new RGBColor constructed around the new color</P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
</P>
|
||||
<DIV class="layer" id="Layer 1">
|
||||
</DIV>
|
||||
</DIV>
|
||||
</BODY>
|
||||
</HTML>
|
330
docs/develop/servers/app_server/ServerApp.htm
Normal file
330
docs/develop/servers/app_server/ServerApp.htm
Normal file
@ -0,0 +1,330 @@
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<TITLE>ServerApp.htm</TITLE>
|
||||
<style type="text/css">
|
||||
<!--
|
||||
.Default {background-color: rgb(255,255,255); color: rgb(0,0,0); font-family: 'Dutch801 Rm BT'; font-size: 12pt}
|
||||
.OBOS-Function-Def {background-color: rgb(255,255,255); color: rgb(0,0,0); font-family: 'Dutch801 Rm BT'; font-size: 16pt}
|
||||
.OBOS-Title {background-color: rgb(255,255,255); color: rgb(0,128,0); font-family: 'Dutch801 Rm BT'; font-size: 24pt}
|
||||
.Text-Background {background-color: rgb(255,255,255)}
|
||||
.GR-Default {}
|
||||
.Body {margin: 0px}
|
||||
.Footer {margin: 0px}
|
||||
.Header {margin: 0px}
|
||||
.WP-Default {text-align: left; text-indent: 0px; margin-left: 0px; margin-right: 0px}
|
||||
-->
|
||||
</style>
|
||||
</HEAD>
|
||||
<BODY BGCOLOR="#ffffff">
|
||||
<DIV class="sheet" id="Sheet 1">
|
||||
<P class="Body" style="margin: 0px"><span class="OBOS-Title">ServerApp class</span><span style="color: rgb(0,0,0); font-size: 24pt"></span></P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
</P>
|
||||
<P class="Body" style="margin: 0px">ServerApps are the server-side counterpart to BApplications. They monitor for messages for the BApplication, create BWindows and BBitmaps, and provide a channel for the app_server to send messages to a user application without having a window.</P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
<BR>
|
||||
<HR>
|
||||
</P>
|
||||
<P class="Body" style="margin: 0px">Member Functions</P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
</P>
|
||||
<TABLE WIDTH=681 HEIGHT=156 BORDER=1 CELLPADDING=1 CELLSPACING=2>
|
||||
<TR>
|
||||
<TD WIDTH=251 HEIGHT=32>
|
||||
<P class="Body" style="margin: 0px">ServerApp(port_id sendport, port_id rcvport, const char *signature, thread_id thread_bapp)</P>
|
||||
</TD>
|
||||
<TD WIDTH=260 HEIGHT=32>
|
||||
<P class="Body" style="margin: 0px">~ServerApp(void)</P>
|
||||
</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD WIDTH=251 HEIGHT=17>
|
||||
<P class="Body" style="margin: 0px">bool Run(void)</P>
|
||||
</TD>
|
||||
<TD WIDTH=260 HEIGHT=17>
|
||||
<P class="Body" style="margin: 0px">static int32 MonitorApp(void *data)</P>
|
||||
</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD WIDTH=251 HEIGHT=17>
|
||||
<P class="Body" style="margin: 0px">void Lock(void)</P>
|
||||
</TD>
|
||||
<TD WIDTH=260 HEIGHT=17>
|
||||
<P class="Body" style="margin: 0px">void Unlock(void)</P>
|
||||
</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD WIDTH=251 HEIGHT=17>
|
||||
<P class="Body" style="margin: 0px">bool IsLocked(void)</P>
|
||||
</TD>
|
||||
<TD WIDTH=260 HEIGHT=17>
|
||||
<P class="Body" style="margin: 0px">void WindowBroadcast(int32 code)</P>
|
||||
</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD WIDTH=251 HEIGHT=17>
|
||||
<P class="Body" style="margin: 0px">bool IsActive(void)</P>
|
||||
</TD>
|
||||
<TD WIDTH=260 HEIGHT=17>
|
||||
<P class="Body" style="margin: 0px">bool PingTarget(void)</P>
|
||||
</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD WIDTH=251 HEIGHT=17>
|
||||
<P class="Body" style="margin: 0px">void DispatchMessage(int32 code, int8 *buffer)</P>
|
||||
</TD>
|
||||
<TD WIDTH=260 HEIGHT=17>
|
||||
|
||||
</TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
<BR>
|
||||
Global Functions</P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
<BR>
|
||||
<HR>
|
||||
</P>
|
||||
<P class="Body" style="margin: 0px"><span class="OBOS-Function-Def">ServerApp(port_id sendport, port_id rcvport, const char *sig, thread_id thread_bapp)</span></P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
1) Create the window list as empty</P>
|
||||
<P class="Body" style="margin: 0px">2) Save sendport, rcvport, sig, and thread_bapp to the respective ServerApp members</P>
|
||||
<P class="Body" style="margin: 0px">3) Set quit_app flag to false</P>
|
||||
<P class="Body" style="margin: 0px">4) Create the window list lock</P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
<BR>
|
||||
<span class="OBOS-Function-Def">~ServerApp(void)</span><span style="font-size: 16pt"></span></P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
1) Empty and delete window list and accompanying windows</P>
|
||||
<P class="Body" style="margin: 0px">2) Wait for the monitoring thread to exit</P>
|
||||
<P class="Body" style="margin: 0px">3) Call CursorManager::RemoveAppCursors(this)</P>
|
||||
<P class="Body" style="margin: 0px">4) Delete the window list lock</P>
|
||||
<P class="Body" style="margin: 0px">5) If monitoring thread still active, kill it (in case app is deleted without a quit message)</P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
<BR>
|
||||
<span class="OBOS-Function-Def">bool Run(void)</span></P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
Run() simply makes a ServerApp start monitoring for messages from its BApplication, telling it to quit if there is a problem.</P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
1) Spawn the monitoring thread (which utilizes MonitorApp())
|
||||
2) If any error, tell the BApplication to quit, spit an error to stderr, and return false</P>
|
||||
<P class="Body" style="margin: 0px">3) Resume the monitoring thread</P>
|
||||
<P class="Body" style="margin: 0px">4) Return true</P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
<BR>
|
||||
<span class="OBOS-Function-Def">static int32 MonitorApp(void *data)</span></P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
Thread function for monitoring for messages from the ServerApp's BApplication.</P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
1) Call port_buffer_size - which will block if the port is empty</P>
|
||||
<P class="Body" style="margin: 0px">2) Allocate a buffer on the heap if the port buffer size is greater than 0</P>
|
||||
<P class="Body" style="margin: 0px">3) Read the port</P>
|
||||
<P class="Body" style="margin: 0px">4) Pass specified messages to DispatchMessage() for processing, spitting out an error message to stderr if the message's code is unrecognized</P>
|
||||
<P class="Body" style="margin: 0px">5) Return from DispatchMessage() and free the message buffer if one was allocated</P>
|
||||
<P class="Body" style="margin: 0px">6) If the message code matches the B_QUIT_REQUESTED definition and the quit_app flag is true, fall out of the infinite message-monitoring loop. Otherwise continue to next iteration</P>
|
||||
<P class="Body" style="text-align: left; margin: 0px">7) Send a DELETE_APP message to the server's main message to force deleting of the ServerApp instance and exit</P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
<BR>
|
||||
<BR>
|
||||
<span class="OBOS-Function-Def">bool IsActive(void)</span></P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
Used for determining whether the application is the active one. Simply returns the isactive flag.</P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
<BR>
|
||||
<span class="OBOS-Function-Def">void PingTarget(void)</span></P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
PingTarget() is called only from the Picasso thread of the app_server in order to determine whether its respective BApplication still exists. BApplications have been known to crash from time to time without the common courtesy of notifying the server of its intentions. ;D</P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
1) Call get_thread_info() with the app's thread_id</P>
|
||||
<P class="Body" style="margin: 0px">2) if it returns anything but B_OK, return false. Otherwise, return true.</P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
<BR>
|
||||
<span class="OBOS-Function-Def">void DispatchMessage(int32 code, int8 *buffer)</span></P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
DispatchMessage implements all the code necessary to respond to a given message sent to the ServerApp on its receiving message port. This allows for clearer and more manageable code.</P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
CREATE_WINDOW:</P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
Sent by a new BWindow object via synchronous PortLink messaging. Set up the corresponding ServerWindow and reply to the BWindow with the new port to which it will send future communications with the App Server.</P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
Attached Data:</P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
</P>
|
||||
<P class="Body" style="text-align: center; margin: 0px"></P>
|
||||
<TABLE WIDTH=573 HEIGHT=156 BORDER=1 CELLPADDING=1 CELLSPACING=2>
|
||||
<TR>
|
||||
<TD WIDTH=112 HEIGHT=32>
|
||||
<P class="Body" style="margin: 0px">port_id reply_port</P>
|
||||
</TD>
|
||||
<TD WIDTH=318 HEIGHT=32>
|
||||
<P class="Body" style="margin: 0px">port to which the server is to reply in response to the current message</P>
|
||||
</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD WIDTH=112 HEIGHT=17>
|
||||
<P class="Body" style="margin: 0px">BRect wframe</P>
|
||||
</TD>
|
||||
<TD WIDTH=318 HEIGHT=17>
|
||||
<P class="Body" style="margin: 0px">frame of the requesting BWindow</P>
|
||||
</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD WIDTH=112 HEIGHT=17>
|
||||
<P class="Body" style="margin: 0px">uint32 wflags</P>
|
||||
</TD>
|
||||
<TD WIDTH=318 HEIGHT=17>
|
||||
<P class="Body" style="margin: 0px">flag data of the requesting BWindow</P>
|
||||
</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD WIDTH=112 HEIGHT=17>
|
||||
<P class="Body" style="margin: 0px">port_id win_port</P>
|
||||
</TD>
|
||||
<TD WIDTH=318 HEIGHT=17>
|
||||
<P class="Body" style="margin: 0px">receiver port of the requesting BWindow</P>
|
||||
</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD WIDTH=112 HEIGHT=17>
|
||||
<P class="Body" style="margin: 0px">uint32 workspaces</P>
|
||||
</TD>
|
||||
<TD WIDTH=318 HEIGHT=17>
|
||||
<P class="Body" style="margin: 0px">workspaces on which the BWindow is to appear</P>
|
||||
</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD WIDTH=112 HEIGHT=17>
|
||||
<P class="Body" style="margin: 0px">const char *title</P>
|
||||
</TD>
|
||||
<TD WIDTH=318 HEIGHT=17>
|
||||
<P class="Body" style="margin: 0px">title of the requesting BWindow</P>
|
||||
</TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
<P class="Body" style="text-align: center; margin: 0px"><BR>
|
||||
</P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
1) Get all attached data</P>
|
||||
<P class="Body" style="margin: 0px">2) Acquire the window list lock</P>
|
||||
<P class="Body" style="margin: 0px">3) Allocate a ServerWindow object and add it to the list</P>
|
||||
<P class="Body" style="margin: 0px">4) Release window list lock</P>
|
||||
<P class="Body" style="margin: 0px">5) Send the message SET_SERVER_PORT (with the ServerWindow's receiver port attached to the reply port</P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
<BR>
|
||||
DELETE_APP:</P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
Sent by a ServerWindow when told to quit. It is identified by the unique ID assigned to its thread.</P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
Attached Data:</P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
</P>
|
||||
<P class="Body" style="text-align: center; margin: 0px"></P>
|
||||
<TABLE WIDTH=568 HEIGHT=22 BORDER=1 CELLPADDING=1 CELLSPACING=2>
|
||||
<TR>
|
||||
<TD WIDTH=132 HEIGHT=17>
|
||||
<P class="Body" style="margin: 0px">thread_id win_thread</P>
|
||||
</TD>
|
||||
<TD WIDTH=294 HEIGHT=17>
|
||||
<P class="Body" style="margin: 0px">Thread id of the ServerWindow sending this message</P>
|
||||
</TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
<P class="Body" style="text-align: center; margin: 0px"><BR>
|
||||
</P>
|
||||
<P class="Body" style="text-align: left; margin: 0px"><BR>
|
||||
1) Get window's thread_id</P>
|
||||
<P class="Body" style="text-align: left; margin: 0px">2) Acquire window list lock</P>
|
||||
<P class="Body" style="text-align: left; margin: 0px">3) Iterate through the window list, searching for the ServerWindow object with the sent thread_id</P>
|
||||
<P class="Body" style="text-align: left; margin: 0px">4) Remove the object from the list and delete it</P>
|
||||
<P class="Body" style="text-align: left; margin: 0px">5) Release window list lock</P>
|
||||
<P class="Body" style="text-align: left; margin: 0px"><BR>
|
||||
<BR>
|
||||
SET_CURSOR_DATA:</P>
|
||||
<P class="Body" style="text-align: left; margin: 0px"><BR>
|
||||
Received from the ServerApp's BApplication when SetCursor(const void *) is called. </P>
|
||||
<P class="Body" style="text-align: left; margin: 0px"><BR>
|
||||
</P>
|
||||
<P class="Body" style="margin: 0px">Attached Data:</P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
</P>
|
||||
<P class="Body" style="text-align: center; margin: 0px"></P>
|
||||
<TABLE WIDTH=573 HEIGHT=22 BORDER=1 CELLPADDING=1 CELLSPACING=2>
|
||||
<TR>
|
||||
<TD WIDTH=112 HEIGHT=17>
|
||||
<P class="Body" style="margin: 0px">int8 cursor[68]</P>
|
||||
</TD>
|
||||
<TD WIDTH=318 HEIGHT=17>
|
||||
<P class="Body" style="margin: 0px">Cursor data in the format as defined in the BeBook</P>
|
||||
</TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
<P class="Body" style="text-align: center; margin: 0px"><BR>
|
||||
</P>
|
||||
<P class="Body" style="text-align: left; margin: 0px"><BR>
|
||||
1) Create a ServerCursor from the attached cursor data</P>
|
||||
<P class="Body" style="text-align: left; margin: 0px">2) Add the new ServerCursor to the CursorManager and then call CursorManager::SetCursor</P>
|
||||
<P class="Body" style="text-align: left; margin: 0px">
|
||||
</P>
|
||||
<P class="Body" style="text-align: left; margin: 0px">SET_CURSOR_BCURSOR:</P>
|
||||
<P class="Body" style="text-align: left; margin: 0px"><BR>
|
||||
Received from the ServerApp's BApplication when SetCursor(BCursor *, bool) is called. </P>
|
||||
<P class="Body" style="text-align: left; margin: 0px"><BR>
|
||||
</P>
|
||||
<P class="Body" style="margin: 0px">Attached Data:</P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
</P>
|
||||
<P class="Body" style="text-align: center; margin: 0px"></P>
|
||||
<TABLE WIDTH=573 HEIGHT=22 BORDER=1 CELLPADDING=1 CELLSPACING=2>
|
||||
<TR>
|
||||
<TD WIDTH=112 HEIGHT=17>
|
||||
<P class="Body" style="margin: 0px">int32 token</P>
|
||||
</TD>
|
||||
<TD WIDTH=318 HEIGHT=17>
|
||||
<P class="Body" style="margin: 0px">Token identifier of cursor in the BCursor class</P>
|
||||
</TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
<P class="Body" style="text-align: center; margin: 0px"><BR>
|
||||
</P>
|
||||
<P class="Body" style="text-align: left; margin: 0px"><BR>
|
||||
1) Get the attached token and call CursorManager::SetCursor(token)</P>
|
||||
<P class="Body" style="text-align: left; margin: 0px"><BR>
|
||||
<BR>
|
||||
B_QUIT_REQUESTED:</P>
|
||||
<P class="Body" style="text-align: left; margin: 0px"><BR>
|
||||
Received from the BApplication when quits, so set the quit flag and ask the server to delete the object</P>
|
||||
<P class="Body" style="text-align: left; margin: 0px"><BR>
|
||||
Attached Data: None</P>
|
||||
<P class="Body" style="text-align: left; margin: 0px"><BR>
|
||||
1) Set quit_app flag to true</P>
|
||||
<P class="Body" style="text-align: left; margin: 0px"><BR>
|
||||
<BR>
|
||||
UPDATE_DECORATOR:</P>
|
||||
<P class="Body" style="text-align: left; margin: 0px"><BR>
|
||||
Received from the poller thread when the window decorator for the system has changed. </P>
|
||||
<P class="Body" style="text-align: left; margin: 0px"><BR>
|
||||
Attached Data: None</P>
|
||||
<P class="Body" style="text-align: left; margin: 0px"><BR>
|
||||
1) Call WindowBroadcast(UPDATE_DECORATOR)</P>
|
||||
<P class="Body" style="text-align: left; margin: 0px"><BR>
|
||||
<BR>
|
||||
<span class="OBOS-Function-Def">void WindowBroadcast(int32 code)</span></P>
|
||||
<P class="Body" style="text-align: left; margin: 0px"><BR>
|
||||
Similar to AppServer::Broadcast(), this sends a message to all ServerWindows which belong to the ServerApp.</P>
|
||||
<P class="Body" style="text-align: left; margin: 0px"><BR>
|
||||
1) Acquire window list lock</P>
|
||||
<P class="Body" style="text-align: left; margin: 0px">2) Create a PortLink instance and set its message code to the passed parameter.</P>
|
||||
<P class="Body" style="text-align: left; margin: 0px">3) Iterate through the window list, targeting the PortLink instance to each ServerWindow's message port and calling Flush().</P>
|
||||
<P class="Body" style="text-align: left; margin: 0px">4) Release window list lock</P>
|
||||
<P class="Body" style="text-align: left; margin: 0px"><BR>
|
||||
<BR>
|
||||
<span class="OBOS-Function-Def">void Lock(void)</span></P>
|
||||
<P class="Body" style="text-align: left; margin: 0px"><span class="OBOS-Function-Def">void Unlock(void)</span></P>
|
||||
<P class="Body" style="text-align: left; margin: 0px"><span class="OBOS-Function-Def">bool IsLocked(void)</span></P>
|
||||
<P class="Body" style="text-align: left; margin: 0px"><BR>
|
||||
These functions are used to regulate access to the ServerApp's data members. Lock() acquires the internal semaphore, Unlock() releases it, and IsLocked returns true only if the semaphore's value is positive.</P>
|
||||
<DIV class="layer" id="Layer 1">
|
||||
</DIV>
|
||||
</DIV>
|
||||
</BODY>
|
||||
</HTML>
|
118
docs/develop/servers/app_server/ServerBitmap.htm
Normal file
118
docs/develop/servers/app_server/ServerBitmap.htm
Normal file
@ -0,0 +1,118 @@
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<TITLE>ServerBitmap.htm</TITLE>
|
||||
<style type="text/css">
|
||||
<!--
|
||||
.Default {background-color: rgb(255,255,255); color: rgb(0,0,0); font-family: 'Dutch801 Rm BT'; font-size: 12pt}
|
||||
.OBOS-Function-Def {background-color: rgb(255,255,255); color: rgb(0,0,0); font-family: 'Dutch801 Rm BT'; font-size: 16pt}
|
||||
.OBOS-Title {background-color: rgb(255,255,255); color: rgb(0,128,0); font-family: 'Dutch801 Rm BT'; font-size: 24pt}
|
||||
.Text-Background {background-color: rgb(255,255,255)}
|
||||
.GR-Default {}
|
||||
.Body {margin: 0px}
|
||||
.Footer {margin: 0px}
|
||||
.Header {margin: 0px}
|
||||
.WP-Default {text-align: left; text-indent: 0px; margin-left: 0px; margin-right: 0px}
|
||||
-->
|
||||
</style>
|
||||
</HEAD>
|
||||
<BODY BGCOLOR="#ffffff">
|
||||
<DIV class="sheet" id="Sheet 1">
|
||||
<P class="Body" style="margin: 0px"><span class="OBOS-Title">ServerBitmap class</span><span style="color: rgb(0,0,0); font-size: 24pt"></span></P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
</P>
|
||||
<P class="Body" style="margin: 0px">ServerBitmaps are the server side counterpart to BBitmap.</P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
<BR>
|
||||
<HR>
|
||||
</P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
Member Functions</P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
</P>
|
||||
<TABLE WIDTH=621 HEIGHT=150 BORDER=1 CELLPADDING=1 CELLSPACING=2>
|
||||
<TR>
|
||||
<TD WIDTH=253 HEIGHT=47>
|
||||
<P class="Body" style="margin: 0px">ServerBitmap(SRect r, color_space cspace, int32 flags, int32 bytesperrow=-1, screen_id screen=B_MAIN_SCREEN_ID)</P>
|
||||
</TD>
|
||||
<TD WIDTH=213 HEIGHT=47>
|
||||
<P class="Body" style="margin: 0px">~ServerBitmap(void)</P>
|
||||
</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD WIDTH=253 HEIGHT=17>
|
||||
<P class="Body" style="margin: 0px">uint8 *Buffer(void)</P>
|
||||
</TD>
|
||||
<TD WIDTH=213 HEIGHT=17>
|
||||
<P class="Body" style="margin: 0px">area_id Area(void)</P>
|
||||
</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD WIDTH=253 HEIGHT=17>
|
||||
<P class="Body" style="margin: 0px">uint32 BitsLength(void)</P>
|
||||
</TD>
|
||||
<TD WIDTH=213 HEIGHT=17>
|
||||
<P class="Body" style="margin: 0px">SRect Bounds(void)</P>
|
||||
</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD WIDTH=253 HEIGHT=32>
|
||||
<P class="Body" style="margin: 0px">int32 BytesPerRow(void)</P>
|
||||
</TD>
|
||||
<TD WIDTH=213 HEIGHT=32>
|
||||
<P class="Body" style="margin: 0px">void _HandleSpace(color_space cs, int32 bytesperline=-1)</P>
|
||||
</TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
<BR>
|
||||
Global Functions</P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
If there are any global functions associated with the class, they are listed here.</P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
<BR>
|
||||
<HR>
|
||||
</P>
|
||||
<P class="Body" style="margin: 0px">ServerBitmap(SRect r, color_space cspace, int32 flags, int32 bytesperrow=-1, screen_id screen=B_MAIN_SCREEN_ID)</P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
1) Call _HandleSpace()</P>
|
||||
<P class="Body" style="margin: 0px">2) Call _HandleFlags()</P>
|
||||
<P class="Body" style="margin: 0px">3) Initialize remaining data members to parameters or safe values</P>
|
||||
<P class="Body" style="margin: 0px"><span class="Default"><BR>
|
||||
</span><span style="font-size: 16pt">~ServerBitmap(void)</span></P>
|
||||
<P class="Body" style="margin: 0px"><span class="Default"><BR>
|
||||
Empty</span></P>
|
||||
<P class="Body" style="margin: 0px"><span class="Default"><BR>
|
||||
<BR>
|
||||
</span><span class="OBOS-Function-Def">uint8 *Buffer(void)</span></P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
Returns the bitmap's buffer member</P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
<BR>
|
||||
<span class="OBOS-Function-Def">area_id Area(void)</span></P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
Returns the bitmap's buffer member.</P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
<BR>
|
||||
<span class="OBOS-Function-Def">uint32 BitsLength(void)</span></P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
Returns bytes_per_row * height</P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
<BR>
|
||||
<span class="OBOS-Function-Def">SRect Bounds(void)</span></P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
returns SRect(width-1,height-1)</P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
<BR>
|
||||
<span class="OBOS-Function-Def">int32 BytesPerRow(void)</span></P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
returns the bitmap's bytes_per_row member</P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
<BR>
|
||||
<span class="OBOS-Function-Def">void _HandleSpace(color_space cs, int32 bytesperline=-1)</span></P>
|
||||
<P class="Body" style="margin: 0px"><span class="Default"><BR>
|
||||
Large function which essentially consists of a switch() of the available color spaces and assigns the bits per pixel and bytes per line values based on the color space. If bytesperline is -1, the default is used, otherwise it uses the specified value.</span></P>
|
||||
<DIV class="layer" id="Layer 1">
|
||||
</DIV>
|
||||
</DIV>
|
||||
</BODY>
|
||||
</HTML>
|
249
docs/develop/servers/app_server/SystemPalette.htm
Normal file
249
docs/develop/servers/app_server/SystemPalette.htm
Normal file
@ -0,0 +1,249 @@
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<TITLE>SystemPalette.htm</TITLE>
|
||||
<style type="text/css">
|
||||
<!--
|
||||
.Default {background-color: rgb(255,255,255); color: rgb(0,0,0); font-family: 'Dutch801 Rm BT'; font-size: 12pt}
|
||||
.OBOS-Function-Def {background-color: rgb(255,255,255); color: rgb(0,0,0); font-family: 'Dutch801 Rm BT'; font-size: 16pt}
|
||||
.OBOS-Title {background-color: rgb(255,255,255); color: rgb(0,128,0); font-family: 'Dutch801 Rm BT'; font-size: 24pt}
|
||||
.Text-Background {background-color: rgb(255,255,255)}
|
||||
.GR-Default {}
|
||||
.Body {margin: 0px}
|
||||
.Footer {margin: 0px}
|
||||
.Header {margin: 0px}
|
||||
.WP-Default {text-align: left; text-indent: 0px; margin-left: 0px; margin-right: 0px}
|
||||
-->
|
||||
</style>
|
||||
</HEAD>
|
||||
<BODY BGCOLOR="#ffffff">
|
||||
<DIV class="sheet" id="Sheet 1">
|
||||
<P class="Body" style="margin: 0px"><span class="OBOS-Title">SystemPalette class</span><span style="color: rgb(0,0,0); font-size: 24pt"></span></P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
</P>
|
||||
<P class="Body" style="margin: 0px">This object does all the handling for system attribute colors and system palette management.</P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
<BR>
|
||||
<HR>
|
||||
</P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
Member Functions</P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
</P>
|
||||
<TABLE WIDTH=617 HEIGHT=196 BORDER=1 CELLPADDING=1 CELLSPACING=2>
|
||||
<TR>
|
||||
<TD WIDTH=203 HEIGHT=17>
|
||||
<P class="Body" style="margin: 0px">SystemPalette(void)</P>
|
||||
</TD>
|
||||
<TD WIDTH=260 HEIGHT=17>
|
||||
<P class="Body" style="margin: 0px">~SystemPalette(void)</P>
|
||||
</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD WIDTH=203 HEIGHT=32>
|
||||
<P class="Body" style="margin: 0px">void SetPalette(uint8 index, RGBColor col)</P>
|
||||
</TD>
|
||||
<TD WIDTH=260 HEIGHT=32>
|
||||
<P class="Body" style="margin: 0px">void SetPalette(uint8 index, rgb_color col)</P>
|
||||
</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD WIDTH=203 HEIGHT=32>
|
||||
<P class="Body" style="margin: 0px">RGBColor GetPalette(uint8 index)</P>
|
||||
</TD>
|
||||
<TD WIDTH=260 HEIGHT=32>
|
||||
<P class="Body" style="margin: 0px">void SetGUIColor(color_which which, RGBColor col)</P>
|
||||
</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD WIDTH=203 HEIGHT=32>
|
||||
<P class="Body" style="margin: 0px">RGBColor GetGUIColor(color_which which)</P>
|
||||
</TD>
|
||||
<TD WIDTH=260 HEIGHT=32>
|
||||
<P class="Body" style="margin: 0px">color_set GetGUIColors(void)</P>
|
||||
</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD WIDTH=203 HEIGHT=17>
|
||||
<P class="Body" style="margin: 0px">void SetGUIColors(color_set cset)</P>
|
||||
</TD>
|
||||
<TD WIDTH=260 HEIGHT=17>
|
||||
<P class="Body" style="margin: 0px">void _GenerateSystemPalette(rgb_color *palette)</P>
|
||||
</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD WIDTH=203 HEIGHT=17>
|
||||
<P class="Body" style="margin: 0px">void _SetDefaultGUIColors(void)</P>
|
||||
</TD>
|
||||
<TD WIDTH=260 HEIGHT=17>
|
||||
|
||||
</TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
<BR>
|
||||
_ Denotes a protected function</P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
Structures</P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
color_set {</P>
|
||||
<P class="Body" style="margin: 0px"> rgb_color panel_background</P>
|
||||
<P class="Body" style="margin: 0px"> rgb_color panel_text</P>
|
||||
<P class="Body" style="margin: 0px"> rgb_color document_background</P>
|
||||
<P class="Body" style="margin: 0px"> rgb_color document_text</P>
|
||||
<P class="Body" style="margin: 0px"> rgb_color control_background</P>
|
||||
<P class="Body" style="margin: 0px"> rgb_color control_text</P>
|
||||
<P class="Body" style="margin: 0px"> rgb_color control_border</P>
|
||||
<P class="Body" style="margin: 0px"> rgb_color control_highlight</P>
|
||||
<P class="Body" style="margin: 0px"> rgb_color tooltip_background</P>
|
||||
<P class="Body" style="margin: 0px"> rgb_color tooltip_text</P>
|
||||
<P class="Body" style="margin: 0px"> rgb_color menu_background</P>
|
||||
<P class="Body" style="margin: 0px"> rgb_color menu_selected_background</P>
|
||||
<P class="Body" style="margin: 0px"> rgb_color menu_text</P>
|
||||
<P class="Body" style="margin: 0px"> rgb_color menu_selected_text</P>
|
||||
<P class="Body" style="margin: 0px"> rgb_color menu_separator</P>
|
||||
<P class="Body" style="margin: 0px"> rgb_color menu_triggers</P>
|
||||
<P class="Body" style="margin: 0px">}</P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
<HR>
|
||||
</P>
|
||||
<P class="Body" style="margin: 0px"><span class="OBOS-Function-Def">SystemPalette(void)</span></P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
1) Allocate the rgb_color[256] palette on the heap and call _GenerateSystemPalette()</P>
|
||||
<P class="Body" style="margin: 0px">2) Initialize attribute variables to the defaults</P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
<BR>
|
||||
<span class="OBOS-Function-Def">~SystemPalette(void)</span></P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
1) Free the palette array</P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
<BR>
|
||||
<span class="OBOS-Function-Def">void SetPalette(uint8 index, RGBColor col)</span></P>
|
||||
<P class="Body" style="margin: 0px"><span class="OBOS-Function-Def">void SetPalette(uint8 index, rgb_color col)</span></P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
Sets the said index to the passed color value.</P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
<BR>
|
||||
<span class="OBOS-Function-Def">RGBColor GetPalette(uint8 index)</span></P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
Returns the color at said index in the palette.</P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
<BR>
|
||||
<span class="OBOS-Function-Def">void SetGUIColor(color_which which, RGBColor col)</span></P>
|
||||
<P class="Body" style="margin: 0px"><span class="OBOS-Function-Def">RGBColor GetGUIColor(color_which which)</span></P>
|
||||
<P class="Body" style="margin: 0px"><span class="OBOS-Function-Def">color_set GetGUIColors(void)</span></P>
|
||||
<P class="Body" style="margin: 0px"><span class="OBOS-Function-Def">void SetGUIColors(color_set cset)</span></P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
These tweak or return the system attribute colors, one at a time or all at once.</P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
<BR>
|
||||
<span class="OBOS-Function-Def">protected: void _GenerateSystemPalette(rgb_color *palette)</span></P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
Sets the passed palette to the BeOS R5 system colors, which follows.</P>
|
||||
<P class="Body" style="margin: 0px"><span class="Default">Grays:</span></P>
|
||||
<P class="Body" style="margin: 0px"><span class="Default">0,0,0 -> 248,248,248 by increments of 8</span></P>
|
||||
<P class="Body" style="margin: 0px"><span class="Default">Blues:</span></P>
|
||||
<P class="Body" style="margin: 0px"><span class="Default">0,0,255</span></P>
|
||||
<P class="Body" style="margin: 0px"><span class="Default">0,0,229</span></P>
|
||||
<P class="Body" style="margin: 0px"><span class="Default">0,0,204</span></P>
|
||||
<P class="Body" style="margin: 0px"><span class="Default">0,0,179</span></P>
|
||||
<P class="Body" style="margin: 0px"><span class="Default">0,0,154</span></P>
|
||||
<P class="Body" style="margin: 0px"><span class="Default">0,0,129</span></P>
|
||||
<P class="Body" style="margin: 0px"><span class="Default">0,0,105</span></P>
|
||||
<P class="Body" style="margin: 0px"><span class="Default">0,0,80</span></P>
|
||||
<P class="Body" style="margin: 0px"><span class="Default">0,0,55</span></P>
|
||||
<P class="Body" style="margin: 0px"><span class="Default">0,0,30</span></P>
|
||||
<P class="Body" style="margin: 0px"><span class="Default">Reds: as per blues, but red values are 1 less</span></P>
|
||||
<P class="Body" style="margin: 0px"><span class="Default">Greens: as per blues, but green values are 1 less</span></P>
|
||||
<P class="Body" style="margin: 0px"><span class="Default">0,152,51</span></P>
|
||||
<P class="Body" style="margin: 0px"><span class="Default">255,255,255</span></P>
|
||||
<P class="Body" style="margin: 0px"><span class="Default"><BR>
|
||||
The following sets use [255, 203, 152, 102, 51, 0] for the blue values, keeping the other colors the same:</span></P>
|
||||
<P class="Body" style="margin: 0px"><span class="Default"><BR>
|
||||
203,255, [value]</span></P>
|
||||
<P class="Body" style="margin: 0px"><span class="Default">152,255, [value]</span></P>
|
||||
<P class="Body" style="margin: 0px"><span class="Default">102,255, [value]</span></P>
|
||||
<P class="Body" style="margin: 0px"><span class="Default">51,255, [value]</span></P>
|
||||
<P class="Body" style="margin: 0px"><span class="Default">255,152, [value]</span></P>
|
||||
<P class="Body" style="margin: 0px"><span class="Default"><BR>
|
||||
0,102,255</span></P>
|
||||
<P class="Body" style="margin: 0px"><span class="Default">0,102,203</span></P>
|
||||
<P class="Body" style="margin: 0px"><span class="Default"><BR>
|
||||
203,203, [value]</span></P>
|
||||
<P class="Body" style="margin: 0px"><span class="Default">152,255, [value]</span></P>
|
||||
<P class="Body" style="margin: 0px"><span class="Default">102,255, [value]</span></P>
|
||||
<P class="Body" style="margin: 0px"><span class="Default">51,255, [value]</span></P>
|
||||
<P class="Body" style="margin: 0px"><span class="Default">255,102, [value]</span></P>
|
||||
<P class="Body" style="margin: 0px"><span class="Default"><BR>
|
||||
0,102,152</span></P>
|
||||
<P class="Body" style="margin: 0px"><span class="Default">0,102,102</span></P>
|
||||
<P class="Body" style="margin: 0px"><span class="Default"><BR>
|
||||
203,152, [value]</span></P>
|
||||
<P class="Body" style="margin: 0px"><span class="Default">152,152, [value]</span></P>
|
||||
<P class="Body" style="margin: 0px"><span class="Default">102,152, [value]</span></P>
|
||||
<P class="Body" style="margin: 0px"><span class="Default">51,152, [value]</span></P>
|
||||
<P class="Body" style="margin: 0px"><span class="Default"><BR>
|
||||
230,134,0</span></P>
|
||||
<P class="Body" style="margin: 0px"><span class="Default"><BR>
|
||||
255,51, [value excepting 255]</span></P>
|
||||
<P class="Body" style="margin: 0px"><span class="Default"><BR>
|
||||
0,102,51</span></P>
|
||||
<P class="Body" style="margin: 0px"><span class="Default">0,102,0</span></P>
|
||||
<P class="Body" style="margin: 0px"><span class="Default"><BR>
|
||||
203,102, [value]</span></P>
|
||||
<P class="Body" style="margin: 0px"><span class="Default">152,102, [value]</span></P>
|
||||
<P class="Body" style="margin: 0px"><span class="Default">102,102, [value]</span></P>
|
||||
<P class="Body" style="margin: 0px"><span class="Default">51,102, [value]</span></P>
|
||||
<P class="Body" style="margin: 0px"><span class="Default">255,0, [value excepting 0]</span></P>
|
||||
<P class="Body" style="margin: 0px"><span class="Default"><BR>
|
||||
255,175,19</span></P>
|
||||
<P class="Body" style="margin: 0px"><span class="Default">0,51,255</span></P>
|
||||
<P class="Body" style="margin: 0px"><span class="Default">0,51,203</span></P>
|
||||
<P class="Body" style="margin: 0px"><span class="Default"><BR>
|
||||
203,51, [value]</span></P>
|
||||
<P class="Body" style="margin: 0px"><span class="Default">152,51, [value]</span></P>
|
||||
<P class="Body" style="margin: 0px"><span class="Default">102,51, [value]</span></P>
|
||||
<P class="Body" style="margin: 0px"><span class="Default">51,51, [value]</span></P>
|
||||
<P class="Body" style="margin: 0px"><span class="Default"><BR>
|
||||
255,203,102 -> 255,203,255, stepping in the [value] increments</span></P>
|
||||
<P class="Body" style="margin: 0px"><span class="Default"><BR>
|
||||
0,51, [value, starting at 152]</span></P>
|
||||
<P class="Body" style="margin: 0px"><span class="Default">203,0, [value, excepting 0]</span></P>
|
||||
<P class="Body" style="margin: 0px"><span class="Default"><BR>
|
||||
255,227,70</span></P>
|
||||
<P class="Body" style="margin: 0px"><span class="Default"><BR>
|
||||
152,0, [value]</span></P>
|
||||
<P class="Body" style="margin: 0px"><span class="Default">102,0, [value]</span></P>
|
||||
<P class="Body" style="margin: 0px"><span class="Default">51,0, [value]</span></P>
|
||||
<P class="Body" style="margin: 0px"><span class="Default"><BR>
|
||||
255,203,51 </span></P>
|
||||
<P class="Body" style="margin: 0px"><span class="Default">255,203,0</span></P>
|
||||
<P class="Body" style="margin: 0px"><span class="Default"><BR>
|
||||
255,255, [values in reverse]</span></P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
<BR>
|
||||
<span class="OBOS-Function-Def">protected: void _SetDefaultGUIColors(void)</span></P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
Sets the internal color_set to the defaults, which is the following:</P>
|
||||
<P class="Body" style="margin: 0px"><BR>
|
||||
panel_background: 216,216, 216</P>
|
||||
<P class="Body" style="margin: 0px">panel_text: 0,0,0</P>
|
||||
<P class="Body" style="margin: 0px">document_background: 255,255,255</P>
|
||||
<P class="Body" style="margin: 0px">document_text: 0,0,0</P>
|
||||
<P class="Body" style="margin: 0px">control_background: 216,216,216</P>
|
||||
<P class="Body" style="margin: 0px">control_text: 0,0,0</P>
|
||||
<P class="Body" style="margin: 0px">control_border: 0,0,0</P>
|
||||
<P class="Body" style="margin: 0px">control_highlight: 0,0,255</P>
|
||||
<P class="Body" style="margin: 0px">tooltip_background: </P>
|
||||
<P class="Body" style="margin: 0px">tooltip_text: 0,0,0</P>
|
||||
<P class="Body" style="margin: 0px">menu_background: 216,216,216</P>
|
||||
<P class="Body" style="margin: 0px">menu_selected_background: 160,160,160</P>
|
||||
<P class="Body" style="margin: 0px">menu_text: 0,0,0</P>
|
||||
<P class="Body" style="margin: 0px">menu_selected_text: 0,0,0</P>
|
||||
<P class="Body" style="margin: 0px">menu_separator_high: 241,241,241</P>
|
||||
<P class="Body" style="margin: 0px">menu_separator_low: 186,186,186</P>
|
||||
<P class="Body" style="margin: 0px">menu_triggers: 0,0,0</P>
|
||||
<DIV class="layer" id="Layer 1">
|
||||
</DIV>
|
||||
</DIV>
|
||||
</BODY>
|
||||
</HTML>
|
271
docs/develop/servers/app_server/asis.htm
Normal file
271
docs/develop/servers/app_server/asis.htm
Normal file
@ -0,0 +1,271 @@
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<TITLE>App Server Interface Spec.htm</TITLE>
|
||||
<style type="text/css">
|
||||
<!--
|
||||
.Default {background-color: rgb(255,255,255); color: rgb(0,0,0); font-family: 'Dutch801 Rm BT'; font-size: 12pt}
|
||||
.Text-Background {background-color: rgb(255,255,255)}
|
||||
.GR-Default {}
|
||||
.Body {margin: 0px}
|
||||
.Footer {margin: 0px}
|
||||
.Header {margin: 0px}
|
||||
.WP-Default {text-align: left; text-indent: 0px; margin-left: 0px; margin-right: 0px}
|
||||
-->
|
||||
</style>
|
||||
</HEAD>
|
||||
<BODY BGCOLOR="#ffffff">
|
||||
<DIV class="sheet" id="Sheet 1">
|
||||
<P class="Body" style="margin: 0px"><span style="color: rgb(0,0,128); font-family: 'Swis721 BT'; font-size: 18pt">App Server Interface Specification v0.3</span><span style="color: rgb(0,0,128); font-family: 'Swis721 BT'; font-size: 12pt"></span></P>
|
||||
<P class="Body" style="margin: 0px"><span style="color: rgb(0,0,0); font-family: 'Swis721 BT'; font-size: 12pt"><BR>
|
||||
</span><span style="color: rgb(0,128,128); font-family: 'Swis721 BT'; font-size: 12pt">Purpose:</span></P>
|
||||
<P class="Body" style="margin: 0px"><span style="color: rgb(0,0,0); font-family: 'Swis721 BT'; font-size: 12pt">The app_server provides services to the OpenBeOS by managing processes, filtering and dispatching input from the Input Server to the appropriate applications, and managing all graphics-related tasks.</span><span style="color: rgb(0,128,128); font-family: 'Swis721 BT'; font-size: 12pt"></span></P>
|
||||
<P class="Body" style="margin: 0px"><span style="color: rgb(0,128,128); font-family: 'Swis721 BT'; font-size: 12pt"><BR>
|
||||
Tasks:</span></P>
|
||||
<P class="Body" style="margin: 0px"><span style="color: rgb(0,0,0); font-family: 'Swis721 BT'; font-size: 12pt">The tasks performed by the app_server are grouped in relation to its purpose.</span></P>
|
||||
<P class="Body" style="margin: 0px"><span style="color: rgb(0,0,0); font-family: 'Swis721 BT'; font-size: 12pt"><BR>
|
||||
</span><span style="color: rgb(0,0,0); font-family: 'Swis721 BT'; font-size: 11pt">Receives and redirects (dispatches) messages from the input server</span></P>
|
||||
<P class="Body" style="margin: 0px"><span style="color: rgb(0,0,0); font-family: 'Swis721 BT'; font-size: 11pt"><BR>
|
||||
Responds to messages from apps</span></P>
|
||||
<P class="Body" style="margin: 0px"><span style="color: rgb(0,0,0); font-family: 'Swis721 BT'; font-size: 11pt">Receives and consolidates requests from BView, BWindow, BBitmap, and others to draw stuff (draw bitmap, etc)</span></P>
|
||||
<P class="Body" style="margin: 0px"><span style="color: rgb(0,0,0); font-family: 'Swis721 BT'; font-size: 11pt">Utilizes ports to communicate with child processes</span></P>
|
||||
<P class="Body" style="margin: 0px"><span style="color: rgb(0,0,0); font-family: 'Swis721 BT'; font-size: 11pt">Handles drag & drop messaging</span></P>
|
||||
<P class="Body" style="margin: 0px"><span style="color: rgb(0,0,0); font-family: 'Swis721 BT'; font-size: 11pt">Manages the system clipboard</span></P>
|
||||
<P class="Body" style="margin: 0px"><span style="color: rgb(0,0,0); font-family: 'Swis721 BT'; font-size: 11pt"><BR>
|
||||
Loads and Kills processes</span></P>
|
||||
<P class="Body" style="margin: 0px"><span style="color: rgb(0,0,0); font-family: 'Swis721 BT'; font-size: 11pt">Detects absence of Input Server and restarts when not running</span></P>
|
||||
<P class="Body" style="margin: 0px"><span style="color: rgb(0,0,0); font-family: 'Swis721 BT'; font-size: 11pt">Aids in system shutdown</span></P>
|
||||
<P class="Body" style="margin: 0px"><span style="color: rgb(0,0,0); font-family: 'Swis721 BT'; font-size: 11pt"><BR>
|
||||
Dynamically loads accelerant portion of graphics driver</span></P>
|
||||
<P class="Body" style="margin: 0px"><span style="color: rgb(0,0,0); font-family: 'Swis721 BT'; font-size: 11pt">Creates a connection with BBitmaps requiring a child view</span></P>
|
||||
<P class="Body" style="margin: 0px"><span style="color: rgb(0,0,0); font-family: 'Swis721 BT'; font-size: 11pt">Draws the blue desktop screen</span></P>
|
||||
<P class="Body" style="margin: 0px"><span style="color: rgb(0,0,0); font-family: 'Swis721 BT'; font-size: 11pt">Provides workspace support</span></P>
|
||||
<P class="Body" style="margin: 0px"><span style="color: rgb(0,0,0); font-family: 'Swis721 BT'; font-size: 11pt">Provides functionality to the BeAPI for drawing primitives, such as rectangles, ellipses, and beziers</span></P>
|
||||
<P class="Body" style="margin: 0px"><span style="color: rgb(0,0,0); font-family: 'Swis721 BT'; font-size: 11pt">Provides a means for BViews to draw on BBitmaps</span></P>
|
||||
<P class="Body" style="margin: 0px"><span style="color: rgb(0,0,0); font-family: 'Swis721 BT'; font-size: 11pt">Manages window behavior with respect to redraw (move to front, minimize, etc)</span></P>
|
||||
<P class="Body" style="margin: 0px"><span style="color: rgb(0,0,0); font-family: 'Swis721 BT'; font-size: 11pt">Returns a frame buffer to direct-access classes</span></P>
|
||||
<P class="Body" style="margin: 0px"><span style="color: rgb(0,0,0); font-family: 'Swis721 BT'; font-size: 11pt">Caches fonts for screen and printer use</span></P>
|
||||
<P class="Body" style="margin: 0px"><span style="color: rgb(0,0,0); font-family: 'Swis721 BT'; font-size: 11pt">Draws text and provides other font API support for the BeAPI classes</span></P>
|
||||
<P class="Body" style="margin: 0px"><span style="color: rgb(0,0,0); font-family: 'Swis721 BT'; font-size: 11pt"><BR>
|
||||
</span><span style="color: rgb(0,0,0); font-family: 'Swis721 BT'; font-size: 16pt">Table of Contents</span></P>
|
||||
<P class="Body" style="margin: 0px"><span style="color: rgb(0,0,0); font-family: 'Swis721 BT'; font-size: 11pt"><BR>
|
||||
</span><span style="color: rgb(0,128,128); font-weight: bold; font-family: 'Swis721 BT'; font-size: 14pt">Graphics:</span><span style="color: rgb(0,128,128); font-family: 'Swis721 BT'; font-size: 14pt"></span></P>
|
||||
<P class="Body" style="margin: 0px"><span style="color: rgb(0,128,128); font-family: 'Swis721 BT'; font-size: 13pt"> I. Desktop Initialization</span></P>
|
||||
<P class="Body" style="margin: 0px"><span style="color: rgb(0,128,128); font-family: 'Swis721 BT'; font-size: 13pt"> II. Window management</span></P>
|
||||
<P class="Body" style="margin: 0px"><span style="color: rgb(0,128,128); font-family: 'Swis721 BT'; font-size: 13pt"> A. ServerApp</span></P>
|
||||
<P class="Body" style="margin: 0px"><span style="color: rgb(0,128,128); font-family: 'Swis721 BT'; font-size: 13pt"> B. ServerWindow</span></P>
|
||||
<P class="Body" style="margin: 0px"><span style="color: rgb(0,128,128); font-family: 'Swis721 BT'; font-size: 13pt"> C. Layer</span></P>
|
||||
<P class="Body" style="margin: 0px"><span style="color: rgb(0,128,128); font-family: 'Swis721 BT'; font-size: 13pt"> D. WindowBorder</span></P>
|
||||
<P class="Body" style="margin: 0px"><span style="color: rgb(0,128,128); font-family: 'Swis721 BT'; font-size: 13pt"> E. Decorator</span></P>
|
||||
<P class="Body" style="margin: 0px"><span style="color: rgb(0,128,128); font-family: 'Swis721 BT'; font-size: 13pt"> III. Screen updates</span></P>
|
||||
<P class="Body" style="margin: 0px"><span style="color: rgb(0,128,128); font-family: 'Swis721 BT'; font-size: 13pt"> IV. Cursor management</span></P>
|
||||
<P class="Body" style="margin: 0px"><span style="color: rgb(0,128,128); font-family: 'Swis721 BT'; font-size: 13pt"> V. Display Drivers</span></P>
|
||||
<P class="Body" style="margin: 0px"><span style="color: rgb(0,128,128); font-weight: bold; font-family: 'Swis721 BT'; font-size: 13pt">Process Management:</span></P>
|
||||
<P class="Body" style="margin: 0px"><span style="color: rgb(0,128,128); font-family: 'Swis721 BT'; font-size: 13pt"> I. BApplication execution</span></P>
|
||||
<P class="Body" style="margin: 0px"><span style="color: rgb(0,128,128); font-family: 'Swis721 BT'; font-size: 13pt"> II. Non-BApplication execution</span></P>
|
||||
<P class="Body" style="margin: 0px"><span style="color: rgb(0,128,128); font-family: 'Swis721 BT'; font-size: 13pt"> III. Killing/Exiting applications</span></P>
|
||||
<P class="Body" style="margin: 0px"><span style="color: rgb(0,128,128); font-family: 'Swis721 BT'; font-size: 13pt"> IV. System Shutdown</span><span style="color: rgb(0,128,128); font-family: 'Swis721 BT'; font-size: 12pt"></span></P>
|
||||
<P class="Body" style="margin: 0px"><span style="color: rgb(0,128,128); font-weight: bold; font-family: 'Swis721 BT'; font-size: 13pt">Input Processing:</span></P>
|
||||
<P class="Body" style="margin: 0px"><span style="color: rgb(0,128,128); font-family: 'Swis721 BT'; font-size: 13pt"> I. Input Server messages</span></P>
|
||||
<P class="Body" style="margin: 0px"><span style="color: rgb(0,128,128); font-family: 'Swis721 BT'; font-size: 13pt"> II. Mouse</span></P>
|
||||
<P class="Body" style="margin: 0px"><span style="color: rgb(0,128,128); font-family: 'Swis721 BT'; font-size: 13pt"> III. Keyboard</span><span style="color: rgb(0,128,128); font-family: 'Swis721 BT'; font-size: 12pt"></span></P>
|
||||
<P class="Body" style="margin: 0px"><span style="color: rgb(0,128,128); font-weight: bold; font-family: 'Swis721 BT'; font-size: 14pt">Messaging:</span><span style="color: rgb(0,128,128); font-family: 'Swis721 BT'; font-size: 14pt"></span></P>
|
||||
<P class="Body" style="margin: 0px"><span style="color: rgb(0,128,128); font-family: 'Swis721 BT'; font-size: 13pt"> I. Inter-Application messaging</span></P>
|
||||
<P class="Body" style="margin: 0px"><span style="color: rgb(0,128,128); font-family: 'Swis721 BT'; font-size: 13pt"> II. Drag-and-drop</span></P>
|
||||
<P class="Body" style="margin: 0px"><span style="color: rgb(0,128,128); font-family: 'Swis721 BT'; font-size: 13pt"> III. Methods</span></P>
|
||||
<P class="Body" style="margin: 0px"><span style="color: rgb(0,0,0); font-family: 'Swis721 BT'; font-size: 11pt"><BR>
|
||||
<BR>
|
||||
<BR>
|
||||
<BR>
|
||||
</span><span style="color: rgb(0,128,128); font-weight: bold; font-family: 'Swis721 BT'; font-size: 14pt">Graphics:</span><span style="color: rgb(0,128,128); font-family: 'Swis721 BT'; font-size: 14pt"></span></P>
|
||||
<P class="Body" style="margin: 0px"><span style="color: rgb(0,128,128); font-family: 'Swis721 BT'; font-size: 13pt"> I. Desktop Initialization</span></P>
|
||||
<P class="Body" style="margin: 0px"><span style="color: rgb(0,128,128); font-family: 'Swis721 BT'; font-size: 13pt"> II. Window management</span></P>
|
||||
<P class="Body" style="margin: 0px"><span style="color: rgb(0,128,128); font-family: 'Swis721 BT'; font-size: 13pt"> III. Screen updates</span><span style="color: rgb(0,0,0); font-family: 'Swis721 BT'; font-size: 13pt"></span></P>
|
||||
<P class="Body" style="margin: 0px"><span style="color: rgb(0,128,128); font-family: 'Swis721 BT'; font-size: 13pt"> IV. Cursor management</span><span style="color: rgb(0,0,0); font-family: 'Swis721 BT'; font-size: 13pt"></span></P>
|
||||
<P class="Body" style="margin: 0px"><span style="color: rgb(0,0,0); font-family: 'Swis721 BT'; font-size: 13pt"><BR>
|
||||
</span><span style="color: rgb(128,0,0); font-family: 'Swis721 BT'; font-size: 12pt">I. Desktop Initialization</span></P>
|
||||
<P class="Body" style="margin: 0px"><span style="color: rgb(0,0,0); font-family: 'Swis721 BT'; font-size: 12pt"><BR>
|
||||
The graphics hardware is abstracted from the rest of the app_server. When started, the server creates the desktop, which is little more than a collection of workspaces. The desktop actually creates a DisplayDriver and then calls the driver's method Inititialize() before calling a few high-level routines for setup. Below is the process by which the HWDriver class, which is used to access the primary graphics card in the system, followed by the steps taken to set up the desktop.</span></P>
|
||||
<P class="Body" style="margin: 0px"><span style="color: rgb(0,0,0); font-family: 'Swis721 BT'; font-size: 12pt"><BR>
|
||||
</span><span style="color: rgb(128,0,0); font-family: 'Swis721 BT'; font-size: 12pt">Load Accelerant</span></P>
|
||||
<P class="Body" style="margin: 0px"><span style="color: rgb(0,0,0); font-family: 'Swis721 BT'; font-size: 12pt"> The app_server looks in three paths when scanning for an accelerant:</span></P>
|
||||
<P class="Body" style="margin: 0px"><span style="color: rgb(0,0,0); font-family: 'Swis721 BT'; font-size: 12pt">/fd/beos/system/add-ons/app_server</span></P>
|
||||
<P class="Body" style="margin: 0px"><span style="color: rgb(0,0,0); font-family: 'Swis721 BT'; font-size: 12pt">/boot/home/config/add-ons/app_server</span></P>
|
||||
<P class="Body" style="margin: 0px"><span style="color: rgb(0,0,0); font-family: 'Swis721 BT'; font-size: 12pt">/boot/beos/system/add-ons/app_server</span></P>
|
||||
<P class="Body" style="margin: 0px"><span style="color: rgb(0,0,0); font-family: 'Swis721 BT'; font-size: 12pt"><BR>
|
||||
When the app_server searches a path, it simply prints to the debug stream on the serial port a message akin "Attempting to load accelerant so-and-so" when loading the accelerant. Following this, it is loads the accelerant via load_add_on(), obtains the hook function control_graphics_card is via get_image_symbol, and control_graphics_card(OPEN_GRAPHICS_CARD) is called. If this returns an error, the image is unloaded after a control_graphics_card(CLOSE_GRAPHICS_CARD) is called and the server spits out a message like "So-and-so is not an acceptable driver" to the serial port. Assuming that the OPEN call succeeds, the app_server serial prints "Using so-and-so as accelerant." Hook functions are then acquired through control_graphics_card(B_GET_GRAPHICS_CARD_HOOKS). At this point, it is a good idea to have a palette generated for 8-bit mode (just in case we're going to use it), so the server generates the system palette. The palette on the graphics card is then set through many calls to control_graphics_card(B_SET_INDEXED_COLOR). </span><span style="color: rgb(128,0,0); font-family: 'Swis721 BT'; font-size: 12pt"></span></P>
|
||||
<P class="Body" style="margin: 0px"><span style="color: rgb(128,0,0); font-family: 'Swis721 BT'; font-size: 12pt"><BR>
|
||||
Set up workspaces</span></P>
|
||||
<P class="Body" style="margin: 0px"><span style="color: rgb(0,0,0); font-family: 'Swis721 BT'; font-size: 12pt"> Workspace preferences are read in from disk. If they exist, they are used; otherwise the default of 3 workspace, each with the settings 640x480x256@59.9Hz, is used. Each workspace is initialized to the proper information (preferences or default). Additionally, all settings are checked and possibly "clipped" by information gained through the driver class. With the desktop having been given the proper settings, the default workspace, 0, is activated.</span></P>
|
||||
<P class="Body" style="margin: 0px"><span style="color: rgb(0,0,0); font-family: 'Swis721 BT'; font-size: 12pt"><BR>
|
||||
</span><span style="color: rgb(128,0,0); font-family: 'Swis721 BT'; font-size: 12pt">Display</span></P>
|
||||
<P class="Body" style="margin: 0px"><span style="color: rgb(0,0,0); font-family: 'Swis721 BT'; font-size: 12pt"> Provided that everything has gone well so far, the screen is filled to the user-set workspace color or RGB(51,102,160) Also, the global clipboard is created, which is nothing more than a BClipboard object. The Input Server will notify the app_server of its existence, at which point the cursor will be set to B_HAND_CURSOR and shown on the screen.</span></P>
|
||||
<P class="Body" style="margin: 0px"><span style="color: rgb(128,0,0); font-family: 'Swis721 BT'; font-size: 12pt"><BR>
|
||||
II. Window management</span></P>
|
||||
<P class="Body" style="margin: 0px"><span style="color: rgb(0,0,0); font-family: 'Swis721 BT'; font-size: 12pt"><BR>
|
||||
Window management is a complicated issue, requiring the cooperation of a number of different types of elements. Each BApplication, BWindow, and BView has a counterpart in the app_server which has a role to play. These objects are Decorators, ServerApps, ServerWindows, Layers, and WindowBorders.</span></P>
|
||||
<P class="Body" style="margin: 0px"><span style="color: rgb(0,0,0); font-family: 'Swis721 BT'; font-size: 12pt"><BR>
|
||||
</span><span style="color: rgb(128,0,0); font-family: 'Swis721 BT'; font-size: 12pt">A. ServerApps</span></P>
|
||||
<P class="Body" style="margin: 0px"><span style="color: rgb(0,0,0); font-family: 'Swis721 BT'; font-size: 12pt"><BR>
|
||||
ServerApp objects are created when a BApplication notifies the app_server of its presence. In acknowledging the BApplication's existence, the server creates a ServerApp which will handle future server-app communications and notifies the BApplication of the port to which it must send future messages.</span></P>
|
||||
<P class="Body" style="margin: 0px"><span style="color: rgb(0,0,0); font-family: 'Swis721 BT'; font-size: 12pt"><BR>
|
||||
ServerApps are each an independent thread which has a function similar to that of a BLooper, but with additional tasks. When a BWindow is created, it spawns a ServerWindow object to handle the new window. The same applies to when a window is destroyed. Cursor commands and all other BApplication functions which require server interaction are also handled. B_QUIT_REQUESTED messages are received and passed along to the main thread in order for the ServerApp object to be destroyed. The server's Picasso thread also utilizes ServerApp::PingTarget in order to determine whether the counterpart BApplication is still alive and running.</span></P>
|
||||
<P class="Body" style="margin: 0px"><span style="color: rgb(0,0,0); font-family: 'Swis721 BT'; font-size: 12pt"><BR>
|
||||
</span><span style="color: rgb(128,0,0); font-family: 'Swis721 BT'; font-size: 12pt">B. ServerWindows</span></P>
|
||||
<P class="Body" style="margin: 0px"><span style="color: rgb(0,0,0); font-family: 'Swis721 BT'; font-size: 12pt"><BR>
|
||||
ServerWindow objects' purpose is to take care of the needs of BWindows. This includes all calls which require a trip to the server, such as BView graphics calls and sending messages to invoke hook functions within a window.</span></P>
|
||||
<P class="Body" style="margin: 0px"><span style="color: rgb(0,0,0); font-family: 'Swis721 BT'; font-size: 12pt"><BR>
|
||||
</span><span style="color: rgb(128,0,0); font-family: 'Swis721 BT'; font-size: 12pt">C. Layers</span></P>
|
||||
<P class="Body" style="margin: 0px"><span style="color: rgb(0,0,0); font-family: 'Swis721 BT'; font-size: 12pt"><BR>
|
||||
Layers are shadowed BViews and are used to handle much BView functionality and also determine invalid screen regions. Hierarchal functions, such as AddChild, are mirrored. Invalid regions are tracked and generate Draw requests which are sent to the application for a specific BView to update its part of the screen.</span></P>
|
||||
<P class="Body" style="margin: 0px"><span style="color: rgb(0,0,0); font-family: 'Swis721 BT'; font-size: 12pt"><BR>
|
||||
</span><span style="color: rgb(128,0,0); font-family: 'Swis721 BT'; font-size: 12pt">D. WindowBorders</span></P>
|
||||
<P class="Body" style="margin: 0px"><span style="color: rgb(0,0,0); font-family: 'Swis721 BT'; font-size: 12pt"><BR>
|
||||
WindowBorders are a special kind of Layer with no BView counterpart, designed to handle window management issues, such as click tests, resize and move events, and ensuring that its decorator updates the screen appropriately.</span></P>
|
||||
<P class="Body" style="margin: 0px"><span style="color: rgb(0,0,0); font-family: 'Swis721 BT'; font-size: 12pt"><BR>
|
||||
</span><span style="color: rgb(128,0,0); font-family: 'Swis721 BT'; font-size: 12pt">F. Decorators</span></P>
|
||||
<P class="Body" style="margin: 0px"><span style="color: rgb(0,0,0); font-family: 'Swis721 BT'; font-size: 12pt"><BR>
|
||||
Decorators are addons which are intended to do one thing: draw the window frame. The Decorator API and development information is described in the Decorator Development Reference. They are essentially the means by which WindowBorders draw to the screen.</span></P>
|
||||
<P class="Body" style="margin: 0px"><span style="color: rgb(0,0,0); font-family: 'Swis721 BT'; font-size: 12pt"><BR>
|
||||
</span><span style="color: rgb(128,0,0); font-family: 'Swis721 BT'; font-size: 12pt">G. How It All Works</span></P>
|
||||
<P class="Body" style="margin: 0px"><span style="color: rgb(0,0,0); font-family: 'Swis721 BT'; font-size: 12pt"><BR>
|
||||
</span><span style="color: rgb(0,0,0); font-family: 'Swis721 BT'; font-size: 12pt">The app_server is one large, complex beast because of all the tasks it performs. It also utilizes the various objects to accomplish them. Input messages are received from the Input Server and all messages not specific to the server (such as Ctrl-Alt-Shift-Backspace) are passed to the active application, if any. Mouse clicks are passed to the ServerWindow class for hit testing. These hit tests can result in window tabs and buttons being clicked, or mouse click messages being passed to a specific view in a window.</span></P>
|
||||
<P class="Body" style="margin: 0px"><span style="color: rgb(0,0,0); font-family: 'Swis721 BT'; font-size: 12pt"><BR>
|
||||
These input messages which are passed to a running application will sometimes cause things to happen inside it, such as button presses, window closings/openings, etc. which will cause messages to be sent to the server. These messages are sent either from a BWindow to a ServerWindow or a BApplication to a ServerApp. When such messages are sent, then the corresponding app_server object performs an appropriate action.</span></P>
|
||||
<P class="Body" style="margin: 0px"><span style="color: rgb(0,0,0); font-family: 'Swis721 BT'; font-size: 12pt"><BR>
|
||||
</span><span style="color: rgb(128,0,0); font-family: 'Swis721 BT'; font-size: 12pt">III. Screen Updates</span></P>
|
||||
<P class="Body" style="margin: 0px"><span style="color: rgb(0,0,0); font-family: 'Swis721 BT'; font-size: 12pt"><BR>
|
||||
Screen updates are done entirely through the BView class or some subclass thereof, hereafter referred to as a view. A view's drawing commands will cause its window to store draw command messages in a message packet. At some point Flush() will be called and the command packet will be sent to the window's ServerWindow object inside the server.</span></P>
|
||||
<P class="Body" style="margin: 0px"><span style="color: rgb(0,0,0); font-family: 'Swis721 BT'; font-size: 12pt"><BR>
|
||||
The ServerWindow will receive the packet, check to ensure that its size is correct, and begin retrieving each command from the packet and dispatching it, taking the appropriate actions. Actual drawing commands, such as StrokeRect, will involve the ServerWindow object calling the appropriate command in the graphics module for the Layer corresponding to the view which sent the command.</span></P>
|
||||
<P class="Body" style="margin: 0px"><span style="color: rgb(0,0,0); font-family: 'Swis721 BT'; font-size: 12pt"><BR>
|
||||
</span><span style="color: rgb(128,0,0); font-family: 'Swis721 BT'; font-size: 12pt">IV. Cursor Management</span></P>
|
||||
<P class="Body" style="margin: 0px"><span style="color: rgb(0,0,0); font-family: 'Swis721 BT'; font-size: 12pt"><BR>
|
||||
The app_server handles all messiness to do with the cursor. The cursor commands which are members of the BApplication class will send a message to its ServerApp, which will then call the DisplayDriver's appropriate function. The DisplayDriver used will actually handle the drawing of the cursor and whether or not to do so at any given time.</span></P>
|
||||
<P class="Body" style="margin: 0px"><span style="color: rgb(0,0,0); font-family: 'Swis721 BT'; font-size: 12pt"><BR>
|
||||
OpenBeOS R1 will also include the advent of an extension of the API: SetCursor(BBitmap *), which will accept a BBitmap of color space RGB(A)32, RGBA16, CMAP8, GRAY8, or GRAY1. Thus, color cursors and cursors which are not 16x16 are now supported.</span></P>
|
||||
<P class="Body" style="margin: 0px"><span style="color: rgb(128,0,0); font-family: 'Swis721 BT'; font-size: 12pt"><BR>
|
||||
V. Display Drivers</span></P>
|
||||
<P class="Body" style="margin: 0px"><span style="color: rgb(0,0,0); font-family: 'Swis721 BT'; font-size: 12pt"><BR>
|
||||
Unlike the BeOS R5 app_server, OpenBeOS' server will have a special feature: a modular graphics driver access class. The class is not actually the graphics driver, but, rather, a generalized interface which is implemented to interact with various destinations for graphics output. This allows the server to draw to a BWindow/BView combination, a BDirectWindow, or the actual frame buffer of a particular graphics card. All that the rest of the server needs to do is call whichever graphics function that is needed.</span></P>
|
||||
<P class="Body" style="margin: 0px"><span style="color: rgb(128,0,0); font-family: 'Swis721 BT'; font-size: 12pt"><BR>
|
||||
</span><span style="color: rgb(0,128,128); font-weight: bold; font-family: 'Swis721 BT'; font-size: 13pt">Process Management:</span></P>
|
||||
<P class="Body" style="margin: 0px"><span style="color: rgb(0,128,128); font-family: 'Swis721 BT'; font-size: 13pt"> I. BApplication execution</span></P>
|
||||
<P class="Body" style="margin: 0px"><span style="color: rgb(0,128,128); font-family: 'Swis721 BT'; font-size: 13pt"> II. Non-BApplication execution</span></P>
|
||||
<P class="Body" style="margin: 0px"><span style="color: rgb(0,128,128); font-family: 'Swis721 BT'; font-size: 13pt"> III. Killing/Exiting applications</span></P>
|
||||
<P class="Body" style="margin: 0px"><span style="color: rgb(0,128,128); font-family: 'Swis721 BT'; font-size: 13pt"> IV. System Shutdown</span><span style="color: rgb(0,128,128); font-family: 'Swis721 BT'; font-size: 12pt"></span></P>
|
||||
<P class="Body" style="margin: 0px"><span style="color: rgb(0,128,128); font-family: 'Swis721 BT'; font-size: 12pt"><BR>
|
||||
</span><span style="color: rgb(128,0,0); font-family: 'Swis721 BT'; font-size: 12pt">I. BApplication execution</span></P>
|
||||
<P class="Body" style="margin: 0px"><span style="color: rgb(128,0,0); font-family: 'Swis721 BT'; font-size: 12pt"><BR>
|
||||
</span><span style="color: rgb(0,0,0); font-family: 'Swis721 BT'; font-size: 12pt">Applications will come in two types: those which communicate with the app_server and take advantage of its services, and those which do not. To access the app_server, an application must be derived from BApplication.</span></P>
|
||||
<P class="Body" style="margin: 0px"><span style="color: rgb(0,0,0); font-family: 'Swis721 BT'; font-size: 12pt"><BR>
|
||||
When a BApplication (referred to hereafter as a BApp) is executed, the app constructor creates its BLooper message port with the name AppLooperPort. This port's id, by means of BLooper, registers its port_id with the app_server so that the two can communicate with each other most easily.</span></P>
|
||||
<P class="Body" style="margin: 0px"><span style="color: rgb(0,0,0); font-family: 'Swis721 BT'; font-size: 12pt"><BR>
|
||||
When the app_server receives notification that an app has been created, the server creates an AppMonitor (with accompanying thread) in its own team to handle messages sent to it and sends a reply with the port_id of the AppMonitor, to which all future messages are sent. These AppMonitor objects are stored in a global BList created for the storage of such things.</span></P>
|
||||
<P class="Body" style="margin: 0px"><span style="color: rgb(0,0,0); font-family: 'Swis721 BT'; font-size: 12pt"><BR>
|
||||
</span><span style="color: rgb(128,0,0); font-family: 'Swis721 BT'; font-size: 12pt">II. non-BApplication execution</span></P>
|
||||
<P class="Body" style="margin: 0px"><span style="color: rgb(128,0,0); font-family: 'Swis721 BT'; font-size: 12pt"><BR>
|
||||
</span><span style="color: rgb(0,0,0); font-family: 'Swis721 BT'; font-size: 12pt">Other applications do not communicate with the app_server. These applications have no access to app services and do not generally pass BMessages. This includes, but is not limited to, UNIX apps. The app_server ignores such applications except when asked to kill them.</span></P>
|
||||
<P class="Body" style="margin: 0px"><span style="color: rgb(0,0,0); font-family: 'Swis721 BT'; font-size: 12pt"><BR>
|
||||
While, technically, these are not limited to being non-GUI applications, in practice these applications are command-line-only, for the application would be required to (1) render the app_server unable to access video hardware and (2) reinvent existing graphics code to load and use accelerants and draw onto the video buffer. This is extremely bad style and programming practice, not to mention more work than it is worth except in one case: the OpenBeOS app_server can coexist with the BeOS R5 app_server with some degree of peace because it can utilize extra video cards which the BeOS app_server does not use.</span></P>
|
||||
<P class="Body" style="margin: 0px"><span style="color: rgb(0,0,0); font-family: 'Swis721 BT'; font-size: 12pt"><BR>
|
||||
</span><span style="color: rgb(128,0,0); font-family: 'Swis721 BT'; font-size: 12pt">III. Killing/Exiting Applications</span></P>
|
||||
<P class="Body" style="margin: 0px"><span style="color: rgb(128,0,0); font-family: 'Swis721 BT'; font-size: 12pt"><BR>
|
||||
</span><span style="color: rgb(0,0,0); font-family: 'Swis721 BT'; font-size: 12pt">While the input server handles the Team Monitor window, the app_server actually takes care of shutting down teams, peacefully or not. Exiting an app is done simply by sending a B_QUIT_REQUESTED message to particular app. Killing an app is done via kill_team, but all the messy details are handled by the kernel itself through this call. When the user requests a team die via the Team Monitor, the Input Server sends a message to the app_server to kill the team, attaching the team_id. The app_server responds by happily nuking the respective team and notifies the registrar of its forcible removal from the roster.</span></P>
|
||||
<P class="Body" style="margin: 0px"><span style="color: rgb(128,0,0); font-family: 'Swis721 BT'; font-size: 12pt"><BR>
|
||||
IV. System Shutdown</span></P>
|
||||
<P class="Body" style="margin: 0px"><span style="color: rgb(128,0,0); font-family: 'Swis721 BT'; font-size: 12pt"><BR>
|
||||
</span><span style="color: rgb(0,0,0); font-family: 'Swis721 BT'; font-size: 12pt">Although the server maintains an internal list of running GUI applications, when a request to shut down the system is received by the app_server, it will pass the request on to the registrar, which will, in turn, increment its way through the app roster and request each app quit. When each quit request is sent, a timer is started and after timeout, the registrar will ask the server to kill the particular team and continue iterating through the application list.</span></P>
|
||||
<P class="Body" style="margin: 0px"><span style="color: rgb(0,0,0); font-family: 'Swis721 BT'; font-size: 12pt"><BR>
|
||||
</span><span style="color: rgb(0,128,128); font-weight: bold; font-family: 'Swis721 BT'; font-size: 13pt">Input Processing:</span></P>
|
||||
<P class="Body" style="margin: 0px"><span style="color: rgb(0,128,128); font-family: 'Swis721 BT'; font-size: 13pt"> I. Input Server messages</span></P>
|
||||
<P class="Body" style="margin: 0px"><span style="color: rgb(0,128,128); font-family: 'Swis721 BT'; font-size: 13pt"> II. Mouse</span></P>
|
||||
<P class="Body" style="margin: 0px"><span style="color: rgb(0,128,128); font-family: 'Swis721 BT'; font-size: 13pt"> III. Keyboard</span><span style="color: rgb(0,128,128); font-family: 'Swis721 BT'; font-size: 12pt"></span></P>
|
||||
<P class="Body" style="margin: 0px"><span style="color: rgb(128,0,0); font-family: 'Swis721 BT'; font-size: 12pt"><BR>
|
||||
I. Input Server messages</span></P>
|
||||
<P class="Body" style="margin: 0px"><span style="color: rgb(128,0,0); font-family: 'Swis721 BT'; font-size: 12pt"><BR>
|
||||
</span><span style="color: rgb(0,0,0); font-family: 'Swis721 BT'; font-size: 12pt">The Input Server collects information about keyboard and mouse events and forwards them to the app_server via messages. They are sent to port specifically for such messages, and the port is monitored by a thread whose task is to monitor, process, and dispatch them to the appropriate recipients. The Input Server is a regular BApplication, and unlike other applications, it requests a port to which it can send input messages.</span></P>
|
||||
<P class="Body" style="margin: 0px"><span style="color: rgb(0,0,0); font-family: 'Swis721 BT'; font-size: 12pt"><BR>
|
||||
</span><span style="color: rgb(128,0,0); font-family: 'Swis721 BT'; font-size: 12pt">II. Mouse</span></P>
|
||||
<P class="Body" style="margin: 0px"><span style="color: rgb(128,0,0); font-family: 'Swis721 BT'; font-size: 12pt"><BR>
|
||||
</span><span style="color: rgb(0,0,0); font-family: 'Swis721 BT'; font-size: 12pt">Mouse events consist of button changes, mouse movements, and the mouse wheel. The message will consist of the time of the event and attachments appropriate for each message listed below:</span></P>
|
||||
<P class="Body" style="margin: 0px"><span style="color: rgb(0,0,0); font-family: 'Swis721 BT'; font-size: 12pt"><BR>
|
||||
B_MOUSE_DOWN</span></P>
|
||||
<P class="Body" style="margin: 0px"><span style="color: rgb(0,0,0); font-family: 'Swis721 BT'; font-size: 12pt"> when</span></P>
|
||||
<P class="Body" style="margin: 0px"><span style="color: rgb(0,0,0); font-family: 'Swis721 BT'; font-size: 12pt"> location of the cursor</span></P>
|
||||
<P class="Body" style="margin: 0px"><span style="color: rgb(0,0,0); font-family: 'Swis721 BT'; font-size: 12pt"> button number</span></P>
|
||||
<P class="Body" style="margin: 0px"><span style="color: rgb(0,0,0); font-family: 'Swis721 BT'; font-size: 12pt"> modifiers</span></P>
|
||||
<P class="Body" style="margin: 0px"><span style="color: rgb(0,0,0); font-family: 'Swis721 BT'; font-size: 12pt"> clicks</span></P>
|
||||
<P class="Body" style="margin: 0px"><span style="color: rgb(0,0,0); font-family: 'Swis721 BT'; font-size: 12pt">B_MOUSE_UP</span></P>
|
||||
<P class="Body" style="margin: 0px"><span style="color: rgb(0,0,0); font-family: 'Swis721 BT'; font-size: 12pt"> time</span></P>
|
||||
<P class="Body" style="margin: 0px"><span style="color: rgb(0,0,0); font-family: 'Swis721 BT'; font-size: 12pt"> buttons' status // not implemented for R5 but included for future expansion</span></P>
|
||||
<P class="Body" style="margin: 0px"><span style="color: rgb(0,0,0); font-family: 'Swis721 BT'; font-size: 12pt"> location of the cursor</span></P>
|
||||
<P class="Body" style="margin: 0px"><span style="color: rgb(0,0,0); font-family: 'Swis721 BT'; font-size: 12pt"> modifiers</span></P>
|
||||
<P class="Body" style="margin: 0px"><span style="color: rgb(0,0,0); font-family: 'Swis721 BT'; font-size: 12pt">B_MOUSE_MOVED</span></P>
|
||||
<P class="Body" style="margin: 0px"><span style="color: rgb(0,0,0); font-family: 'Swis721 BT'; font-size: 12pt"> time</span></P>
|
||||
<P class="Body" style="margin: 0px"><span style="color: rgb(0,0,0); font-family: 'Swis721 BT'; font-size: 12pt"> location of the cursor</span></P>
|
||||
<P class="Body" style="margin: 0px"><span style="color: rgb(0,0,0); font-family: 'Swis721 BT'; font-size: 12pt"> buttons' status</span></P>
|
||||
<P class="Body" style="margin: 0px"><span style="color: rgb(0,0,0); font-family: 'Swis721 BT'; font-size: 12pt">B_MOUSE_WHEEL_CHANGED</span></P>
|
||||
<P class="Body" style="margin: 0px"><span style="color: rgb(0,0,0); font-family: 'Swis721 BT'; font-size: 12pt"> time</span></P>
|
||||
<P class="Body" style="margin: 0px"><span style="color: rgb(0,0,0); font-family: 'Swis721 BT'; font-size: 12pt"> location of the cursor</span></P>
|
||||
<P class="Body" style="margin: 0px"><span style="color: rgb(0,0,0); font-family: 'Swis721 BT'; font-size: 12pt"> transit - in or out</span></P>
|
||||
<P class="Body" style="margin: 0px"><span style="color: rgb(0,0,0); font-family: 'Swis721 BT'; font-size: 12pt"> x delta</span></P>
|
||||
<P class="Body" style="margin: 0px"><span style="color: rgb(0,0,0); font-family: 'Swis721 BT'; font-size: 12pt"> y delta</span></P>
|
||||
<P class="Body" style="margin: 0px"><span style="color: rgb(0,0,0); font-family: 'Swis721 BT'; font-size: 12pt"><BR>
|
||||
</span><span style="color: rgb(128,0,0); font-family: 'Swis721 BT'; font-size: 12pt">III. Keyboard</span></P>
|
||||
<P class="Body" style="margin: 0px"><span style="color: rgb(0,0,0); font-family: 'Swis721 BT'; font-size: 12pt"><BR>
|
||||
Keyboard events consist of notification when a key is pressed or released. Any keypress or release will evoke a message, regardless of whether or not the key is mapped. The message will consist of the appropriate code and attachments listed below:</span></P>
|
||||
<P class="Body" style="margin: 0px"><span style="color: rgb(0,0,0); font-family: 'Swis721 BT'; font-size: 12pt"><BR>
|
||||
B_KEY_DOWN</span></P>
|
||||
<P class="Body" style="margin: 0px"><span style="color: rgb(0,0,0); font-family: 'Swis721 BT'; font-size: 12pt"> time</span></P>
|
||||
<P class="Body" style="margin: 0px"><span style="color: rgb(0,0,0); font-family: 'Swis721 BT'; font-size: 12pt"> key code</span></P>
|
||||
<P class="Body" style="margin: 0px"><span style="color: rgb(0,0,0); font-family: 'Swis721 BT'; font-size: 12pt"> repeat count</span></P>
|
||||
<P class="Body" style="margin: 0px"><span style="color: rgb(0,0,0); font-family: 'Swis721 BT'; font-size: 12pt"> modifiers</span></P>
|
||||
<P class="Body" style="margin: 0px"><span style="color: rgb(0,0,0); font-family: 'Swis721 BT'; font-size: 12pt"> states</span></P>
|
||||
<P class="Body" style="margin: 0px"><span style="color: rgb(0,0,0); font-family: 'Swis721 BT'; font-size: 12pt"> UTF-8 code</span></P>
|
||||
<P class="Body" style="margin: 0px"><span style="color: rgb(0,0,0); font-family: 'Swis721 BT'; font-size: 12pt"> string generated</span></P>
|
||||
<P class="Body" style="margin: 0px"><span style="color: rgb(0,0,0); font-family: 'Swis721 BT'; font-size: 12pt"> modifier-independent ASCII code</span></P>
|
||||
<P class="Body" style="margin: 0px"><span style="color: rgb(0,0,0); font-family: 'Swis721 BT'; font-size: 12pt">B_KEY_UP</span></P>
|
||||
<P class="Body" style="margin: 0px"><span style="color: rgb(0,0,0); font-family: 'Swis721 BT'; font-size: 12pt"> time</span></P>
|
||||
<P class="Body" style="margin: 0px"><span style="color: rgb(0,0,0); font-family: 'Swis721 BT'; font-size: 12pt"> key code</span></P>
|
||||
<P class="Body" style="margin: 0px"><span style="color: rgb(0,0,0); font-family: 'Swis721 BT'; font-size: 12pt"> modifiers</span></P>
|
||||
<P class="Body" style="margin: 0px"><span style="color: rgb(0,0,0); font-family: 'Swis721 BT'; font-size: 12pt"> states</span></P>
|
||||
<P class="Body" style="margin: 0px"><span style="color: rgb(0,0,0); font-family: 'Swis721 BT'; font-size: 12pt"> UTF-8 code</span></P>
|
||||
<P class="Body" style="margin: 0px"><span style="color: rgb(0,0,0); font-family: 'Swis721 BT'; font-size: 12pt"> string generated</span></P>
|
||||
<P class="Body" style="margin: 0px"><span style="color: rgb(0,0,0); font-family: 'Swis721 BT'; font-size: 12pt"> modifier-independent ASCII code</span></P>
|
||||
<P class="Body" style="margin: 0px"><span style="color: rgb(0,0,0); font-family: 'Swis721 BT'; font-size: 12pt">B_UNMAPPED_KEY_DOWN</span></P>
|
||||
<P class="Body" style="margin: 0px"><span style="color: rgb(0,0,0); font-family: 'Swis721 BT'; font-size: 12pt"> time</span></P>
|
||||
<P class="Body" style="margin: 0px"><span style="color: rgb(0,0,0); font-family: 'Swis721 BT'; font-size: 12pt"> key code</span></P>
|
||||
<P class="Body" style="margin: 0px"><span style="color: rgb(0,0,0); font-family: 'Swis721 BT'; font-size: 12pt"> modifiers</span></P>
|
||||
<P class="Body" style="margin: 0px"><span style="color: rgb(0,0,0); font-family: 'Swis721 BT'; font-size: 12pt"> states</span></P>
|
||||
<P class="Body" style="margin: 0px"><span style="color: rgb(0,0,0); font-family: 'Swis721 BT'; font-size: 12pt">B_UNMAPPED_KEY_UP</span></P>
|
||||
<P class="Body" style="margin: 0px"><span style="color: rgb(0,0,0); font-family: 'Swis721 BT'; font-size: 12pt"> time</span></P>
|
||||
<P class="Body" style="margin: 0px"><span style="color: rgb(0,0,0); font-family: 'Swis721 BT'; font-size: 12pt"> key code</span></P>
|
||||
<P class="Body" style="margin: 0px"><span style="color: rgb(0,0,0); font-family: 'Swis721 BT'; font-size: 12pt"> modifiers</span></P>
|
||||
<P class="Body" style="margin: 0px"><span style="color: rgb(0,0,0); font-family: 'Swis721 BT'; font-size: 12pt"> states</span></P>
|
||||
<P class="Body" style="margin: 0px"><span style="color: rgb(0,0,0); font-family: 'Swis721 BT'; font-size: 12pt">B_MODIFIERS_CHANGED // sent when a modifier key changes</span></P>
|
||||
<P class="Body" style="margin: 0px"><span style="color: rgb(0,0,0); font-family: 'Swis721 BT'; font-size: 12pt"> time</span></P>
|
||||
<P class="Body" style="margin: 0px"><span style="color: rgb(0,0,0); font-family: 'Swis721 BT'; font-size: 12pt"> modifier states</span></P>
|
||||
<P class="Body" style="margin: 0px"><span style="color: rgb(0,0,0); font-family: 'Swis721 BT'; font-size: 12pt"> previous modifier states</span></P>
|
||||
<P class="Body" style="margin: 0px"><span style="color: rgb(0,0,0); font-family: 'Swis721 BT'; font-size: 12pt"> states</span></P>
|
||||
<P class="Body" style="margin: 0px"><span style="color: rgb(0,0,0); font-family: 'Swis721 BT'; font-size: 12pt"><BR>
|
||||
Nearly all keypresses received by the app_server are passed onto the appropriate application. Control-Tab, when held, is sent to the Deskbar for app switching. Command+F?? is intercepted and a workspace is switched. Left Control + Alt + Delete is not even intercepted by the app_server. The Input Server receives it and shows the Team Monitor window.</span></P>
|
||||
<P class="Body" style="margin: 0px"><span style="color: rgb(0,0,0); font-family: 'Swis721 BT'; font-size: 12pt"><BR>
|
||||
</span><span style="color: rgb(0,128,128); font-weight: bold; font-family: 'Swis721 BT'; font-size: 14pt">Messaging:</span><span style="color: rgb(0,128,128); font-family: 'Swis721 BT'; font-size: 14pt"></span></P>
|
||||
<P class="Body" style="margin: 0px"><span style="color: rgb(0,128,128); font-family: 'Swis721 BT'; font-size: 13pt"> I. Inter-Application messaging</span></P>
|
||||
<P class="Body" style="margin: 0px"><span style="color: rgb(0,128,128); font-family: 'Swis721 BT'; font-size: 13pt"> II. Drag-and-drop</span></P>
|
||||
<P class="Body" style="margin: 0px"><span style="color: rgb(0,128,128); font-family: 'Swis721 BT'; font-size: 13pt"> III. Methods</span></P>
|
||||
<P class="Body" style="margin: 0px"><span style="color: rgb(0,0,0); font-family: 'Swis721 BT'; font-size: 13pt"><BR>
|
||||
</span><span style="color: rgb(128,0,0); font-family: 'Swis721 BT'; font-size: 12pt">I. Inter-Application Messaging</span></P>
|
||||
<P class="Body" style="margin: 0px"><span style="color: rgb(128,0,0); font-family: 'Swis721 BT'; font-size: 12pt"><BR>
|
||||
</span><span style="color: rgb(0,0,0); font-family: 'Swis721 BT'; font-size: 12pt">The details of messaging are depicted under Process Management::BApplication.</span></P>
|
||||
<P class="Body" style="margin: 0px"><span style="color: rgb(0,0,0); font-family: 'Swis721 BT'; font-size: 12pt"><BR>
|
||||
</span><span style="color: rgb(128,0,0); font-family: 'Swis721 BT'; font-size: 12pt">II. Drag-and-drop</span></P>
|
||||
<P class="Body" style="margin: 0px"><span style="color: rgb(128,0,0); font-family: 'Swis721 BT'; font-size: 12pt"><BR>
|
||||
III. Methods</span></P>
|
||||
<P class="Body" style="margin: 0px"><span style="color: rgb(128,0,0); font-family: 'Swis721 BT'; font-size: 12pt"><BR>
|
||||
</span><span style="color: rgb(0,0,0); font-family: 'Swis721 BT'; font-size: 12pt">Messaging with the app_server is not done using BMessages because of the overhead required to send them costs time and speed. Instead, ports are utilized indirectly by means of the PortLink class, which simply makes attaching data to a port message easier, but requires very little overhead. </span></P>
|
||||
<DIV class="layer" id="Layer 1">
|
||||
</DIV>
|
||||
</DIV>
|
||||
</BODY>
|
||||
</HTML>
|
40
docs/develop/servers/app_server/toc.htm
Normal file
40
docs/develop/servers/app_server/toc.htm
Normal file
@ -0,0 +1,40 @@
|
||||
<html>
|
||||
<body bgcolor="#ffffff" text="#000000">
|
||||
|
||||
<center><h1><font color="#008000">OpenBeOS R1 Application Server Specification</font></h1>
|
||||
|
||||
<h2><font color="#800000">Table of Contents</font></h2></center>
|
||||
|
||||
<h3>Class Descriptions</h3>
|
||||
|
||||
<dd>Application Management</dd>
|
||||
|
||||
<ul>
|
||||
<li><a href="AppServer.htm">AppServer</a></li>
|
||||
<li><a href="DebugTools.htm">DebugTools</a></li>
|
||||
<li><a href="ServerApp.htm">ServerApp</a></li>
|
||||
</ul>
|
||||
|
||||
<dd>Graphics Management</dd>
|
||||
<P>
|
||||
<ul>
|
||||
<li><a href="ColorUtils.htm">ColorUtils</a></li>
|
||||
<li><a href="CursorManager.htm">CursorManager</a></li>
|
||||
<li><a href="Decorator.htm">Decorator</a></li>
|
||||
<li><a href="DisplayDriver.htm">DisplayDriver</a></li>
|
||||
<li><a href="PatternHandler.htm">PatternHandler</a></li>
|
||||
<li><a href="RGBColor.htm">RGBColor</a></li>
|
||||
<li><a href="SPoint.htm">SPoint</a></li>
|
||||
<li><a href="SRect.htm">SRect</a></li>
|
||||
<li><a href="ServerBitmap.htm">ServerBitmap</a></li>
|
||||
<li><a href="SystemPalette.htm">SystemPalette</a></li>
|
||||
</ul>
|
||||
|
||||
<h3>Other Documents</h3>
|
||||
|
||||
<ul>
|
||||
<li><a href="asis.htm">App Server Interface Specification</a></li>
|
||||
<li><a href="MultiMonitor.htm">Multiple Monitor Support Spec</a></li>
|
||||
</ul>
|
||||
</body>
|
||||
</html>
|
Loading…
Reference in New Issue
Block a user