Added Desktop, TokenHandler, and WinBorder class specs

git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1094 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
DarkWyrm 2002-09-19 23:56:12 +00:00
parent f5826b35dc
commit 0f107fa327
4 changed files with 661 additions and 2 deletions

View File

@ -0,0 +1,101 @@
<HTML>
<HEAD>
<TITLE>Desktop.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">Desktop module</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">There are no globally accessible objects in this section of code, but many function definitions to work with workspaces, screen attributes, and other such things. These functions work with the private desktop classes Screen and Workspace.</P>
<P class="Body" style="margin: 0px"><BR>
</P>
<P class="Body" style="margin: 0px">
<HR>
</P>
<P class="Body" style="margin: 0px">Global Functions</P>
<P class="Body" style="margin: 0px"><BR>
void InitDesktop(void)</P>
<P class="Body" style="margin: 0px">void ShutdownDesktop(void)</P>
<P class="Body" style="margin: 0px"><BR>
void AddWorkspace(int32 index=-1)</P>
<P class="Body" style="margin: 0px">void DeleteWorkspace(int32 index)</P>
<P class="Body" style="margin: 0px">int32 CountWorkspaces(void)</P>
<P class="Body" style="margin: 0px">void SetWorkspaceCount(int32 count)</P>
<P class="Body" style="margin: 0px">int32 CurrentWorkspace(screen_id screen=B_MAIN_SCREEN_ID)</P>
<P class="Body" style="margin: 0px">void SetWorkspace(int32 workspace, screen_id screen=B_MAIN_SCREEN_ID)</P>
<P class="Body" style="margin: 0px"><BR>
void SetScreen(screen_id id)</P>
<P class="Body" style="margin: 0px">int32 CountScreens(void)</P>
<P class="Body" style="margin: 0px">screen_id ActiveScreen(void)</P>
<P class="Body" style="margin: 0px">DisplayDriver *GetGfxDriver(screen_id screen=B_MAIN_SCREEN_ID)</P>
<P class="Body" style="margin: 0px">status_t SetSpace(int32 index, int32 res, bool stick=true, screen_id screen=B_MAIN_SCREEN_ID)</P>
<P class="Body" style="margin: 0px"><BR>
void AddWindowToDesktop(ServerWindow *win, int32 workspace=B_CURRENT_WORKSPACE, screen_id screen=B_MAIN_SCREEN_ID)</P>
<P class="Body" style="margin: 0px">void RemoveWindowFromDesktop(ServerWindow *win)</P>
<P class="Body" style="margin: 0px">ServerWindow *GetActiveWindow(void)</P>
<P class="Body" style="margin: 0px">void SetActiveWindow(ServerWindow *win)</P>
<P class="Body" style="margin: 0px">Layer *GetRootLayer(int32 workspace=B_CURRENT_WORKSPACE, screen_id screen=B_MAIN_SCREEN_ID)</P>
<P class="Body" style="margin: 0px"><BR>
<HR>
</P>
<P class="Body" style="margin: 0px"><span class="OBOS-Function-Def">void InitDesktop(void)</span></P>
<P class="Body" style="margin: 0px"><BR>
Sets up all the stuff necessary for the system's desktop.</P>
<P class="Body" style="margin: 0px"><BR>
1) Create a graphics module list by looping through allocation and initialization of display modules until failure is returned. If app_server exists, just create a ViewDriver module</P>
<P class="Body" style="margin: 0px">2) Create and populate Screen list, pointing each Screen instance to its Driver instance</P>
<P class="Body" style="margin: 0px">3) Create layer and workspace locks</P>
<P class="Body" style="margin: 0px">4) Set screen 0 to active</P>
<P class="Body" style="margin: 0px"><BR>
<span class="OBOS-Function-Def">void ShutdownDesktop(void)</span></P>
<P class="Body" style="margin: 0px"><BR>
Undoes everything done in InitDesktop().</P>
<P class="Body" style="margin: 0px"><BR>
1) Delete all locks</P>
<P class="Body" style="margin: 0px">2) Delete all screens in the list</P>
<P class="Body" style="margin: 0px"><BR>
<span class="OBOS-Function-Def">void AddWorkspace(int32 index=-1)</span></P>
<P class="Body" style="margin: 0px"><span class="OBOS-Function-Def">void DeleteWorkspace(int32 index)</span></P>
<P class="Body" style="margin: 0px"><span class="OBOS-Function-Def">int32 CountWorkspaces(void)</span></P>
<P class="Body" style="margin: 0px"><span class="OBOS-Function-Def">void SetWorkspaceCount(int32 count)</span></P>
<P class="Body" style="margin: 0px"><span class="OBOS-Function-Def">int32 CurrentWorkspace(screen_id screen=B_MAIN_SCREEN_ID)</span></P>
<P class="Body" style="margin: 0px"><span class="OBOS-Function-Def">void SetWorkspace(int32 workspace, screen_id screen=B_MAIN_SCREEN_ID)</span></P>
<P class="Body" style="margin: 0px"><BR>
Each of these calls the appropriate method in the Screen class. Add and Delete workspace functions operate on all screens.</P>
<P class="Body" style="margin: 0px"><BR>
<span class="OBOS-Function-Def">void SetScreen(screen_id id)</span></P>
<P class="Body" style="margin: 0px"><span class="OBOS-Function-Def">int32 CountScreens(void)</span></P>
<P class="Body" style="margin: 0px"><span class="OBOS-Function-Def">screen_id ActiveScreen(void)</span></P>
<P class="Body" style="margin: 0px"><span class="OBOS-Function-Def">DisplayDriver *GetGfxDriver(screen_id screen=B_MAIN_SCREEN_ID)</span></P>
<P class="Body" style="margin: 0px"><span class="OBOS-Function-Def">status_t SetSpace(int32 index, int32 res, bool stick=true, screen_id screen=B_MAIN_SCREEN_ID)</span></P>
<P class="Body" style="margin: 0px"><BR>
Each of these calls operate on the objects in the Screen list, calling methods as appropriate.</P>
<P class="Body" style="margin: 0px"><BR>
<span class="OBOS-Function-Def">void AddWindowToDesktop(ServerWindow *win, int32 workspace=B_CURRENT_WORKSPACE, screen_id screen=B_MAIN_SCREEN_ID)</span></P>
<P class="Body" style="margin: 0px"><span class="OBOS-Function-Def">void RemoveWindowFromDesktop(ServerWindow *win)</span></P>
<P class="Body" style="margin: 0px"><span class="OBOS-Function-Def">ServerWindow *GetActiveWindow(void)</span></P>
<P class="Body" style="margin: 0px"><span class="OBOS-Function-Def">void SetActiveWindow(ServerWindow *win)</span></P>
<P class="Body" style="margin: 0px"><span class="OBOS-Function-Def">Layer *GetRootLayer(int32 workspace=B_CURRENT_WORKSPACE, screen_id screen=B_MAIN_SCREEN_ID)</span></P>
<P class="Body" style="margin: 0px"><BR>
These operate on the layer structure in the active Screen object, calling methods as appropriate.</P>
<P class="Body" style="margin: 0px"><BR>
</P>
<DIV class="layer" id="Layer 1">
</DIV>
</DIV>
</BODY>
</HTML>

View File

@ -0,0 +1,135 @@
<HTML>
<HEAD>
<TITLE>TokenHandler.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">TokenHandler class</span><span style="color: rgb(0,0,0); font-size: 24pt"></span></P>
<P class="Body" style="margin: 0px"><BR>
This is a simple way to provide tokens for various reasons. </P>
<P class="Body" style="margin: 0px"><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">TokenHandler(void)</P>
</TD>
<TD WIDTH=260 HEIGHT=17>
<P class="Body" style="margin: 0px">~TokenHandler(void)</P>
</TD>
</TR>
<TR>
<TD WIDTH=203 HEIGHT=17>
<P class="Body" style="margin: 0px">int32 GetToken(void)</P>
</TD>
<TD WIDTH=260 HEIGHT=17>
<P class="Body" style="margin: 0px">void Reset(void)</P>
</TD>
</TR>
<TR>
<TD WIDTH=203 HEIGHT=17>
<P class="Body" style="margin: 0px">void ExcludeValue(int32 value)</P>
</TD>
<TD WIDTH=260 HEIGHT=17>
<P class="Body" style="margin: 0px">void ResetExcludes(void)</P>
</TD>
</TR>
<TR>
<TD WIDTH=203 HEIGHT=17>
<P class="Body" style="margin: 0px">bool IsExclude(int32 value)</P>
</TD>
<TD WIDTH=260 HEIGHT=17>
&nbsp;
</TD>
</TR>
<TR>
<TD WIDTH=203 HEIGHT=17>
&nbsp;
</TD>
<TD WIDTH=260 HEIGHT=17>
&nbsp;
</TD>
</TR>
</TABLE>
<P class="Body" style="margin: 0px"><BR>
<BR>
<HR>
</P>
<P class="Body" style="margin: 0px"><span class="OBOS-Function-Def">TokenHandler(void)</span></P>
<P class="Body" style="margin: 0px"><BR>
1) Initialize the index to -1</P>
<P class="Body" style="margin: 0px">2) create the access semaphore</P>
<P class="Body" style="margin: 0px">3) create the exclude list with no items</P>
<P class="Body" style="margin: 0px"><BR>
<BR>
<span class="OBOS-Function-Def">~TokenHandler(void)</span></P>
<P class="Body" style="margin: 0px"><BR>
1) delete the access lock</P>
<P class="Body" style="margin: 0px">2) call ResetExcludes and delete the exclude list</P>
<P class="Body" style="margin: 0px"><BR>
<BR>
<span class="OBOS-Function-Def">int32 GetToken(void)</span></P>
<P class="Body" style="margin: 0px"><BR>
Returns a unique token which is not equal to any excluded values</P>
<P class="Body" style="margin: 0px"><BR>
1) create a local variable to return the new token</P>
<P class="Body" style="margin: 0px">2) acquire the access semaphore</P>
<P class="Body" style="margin: 0px">3) Increment the internal index</P>
<P class="Body" style="margin: 0px">4) while IsExclude(index) is true, increment the index</P>
<P class="Body" style="margin: 0px">5) assign it to the local variable</P>
<P class="Body" style="margin: 0px">6) release the access semaphore</P>
<P class="Body" style="margin: 0px">7) return the local variable</P>
<P class="Body" style="margin: 0px"><BR>
<BR>
<span class="OBOS-Function-Def">void Reset(void)</span></P>
<P class="Body" style="margin: 0px"><BR>
1) acquire the access semaphore</P>
<P class="Body" style="margin: 0px">2) set the internal index to -1</P>
<P class="Body" style="margin: 0px">3) release the access semaphore</P>
<P class="Body" style="margin: 0px"><BR>
<BR>
<span class="OBOS-Function-Def">void ExcludeValue(int32 value)</span></P>
<P class="Body" style="margin: 0px"><BR>
1) acquire the access semaphore</P>
<P class="Body" style="margin: 0px">2) if IsExclude(value) is false, add it to the exclude list</P>
<P class="Body" style="margin: 0px">3) release the access semaphore</P>
<P class="Body" style="margin: 0px"><BR>
<BR>
<span class="OBOS-Function-Def">void ResetExcludes(void)</span></P>
<P class="Body" style="margin: 0px"><BR>
1) acquire the access semaphore</P>
<P class="Body" style="margin: 0px">2) Iterate through the exclude list, removing and deleting each item</P>
<P class="Body" style="margin: 0px">3) release the access semaphore</P>
<P class="Body" style="margin: 0px"><BR>
<BR>
<span class="OBOS-Function-Def">bool IsExclude(int32 value)</span></P>
<P class="Body" style="margin: 0px"><BR>
1) create a boolean match flag and set it to false</P>
<P class="Body" style="margin: 0px">2) acquire the access semaphore</P>
<P class="Body" style="margin: 0px">3) iterate through the exclude list and see if the value matches any in the list</P>
<P class="Body" style="margin: 0px">4) If there is a match, set the match flag to true and exit the loop</P>
<P class="Body" style="margin: 0px">5) release the access semaphore</P>
<P class="Body" style="margin: 0px">6) return the match flag</P>
<DIV class="layer" id="Layer 1">
</DIV>
</DIV>
</BODY>
</HTML>

View File

@ -0,0 +1,423 @@
<HTML>
<HEAD>
<TITLE>WinBorder.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">WinBorder class : public Layer</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">WinBorder objects provide window management functionality and ensure that the border for each window is drawn.</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=201 BORDER=1 CELLPADDING=1 CELLSPACING=2>
<TR>
<TD WIDTH=294 HEIGHT=32>
<P class="Body" style="margin: 0px">WinBorder(BRect r, const char *name, int32 resize, int32 flags, ServerWindow *win)</P>
</TD>
<TD WIDTH=172 HEIGHT=32>
<P class="Body" style="margin: 0px">~WinBorder(void)</P>
</TD>
</TR>
<TR>
<TD WIDTH=294 HEIGHT=17>
<P class="Body" style="margin: 0px">void RequestDraw(void)</P>
</TD>
<TD WIDTH=172 HEIGHT=17>
<P class="Body" style="margin: 0px">void MoveBy(BPoint pt)</P>
</TD>
</TR>
<TR>
<TD WIDTH=294 HEIGHT=17>
<P class="Body" style="margin: 0px">void MoveBy(float x, float y)</P>
</TD>
<TD WIDTH=172 HEIGHT=17>
<P class="Body" style="margin: 0px">void ResizeBy(BPoint pt)</P>
</TD>
</TR>
<TR>
<TD WIDTH=294 HEIGHT=17>
<P class="Body" style="margin: 0px">void ResizeBy(float x, float y)</P>
</TD>
<TD WIDTH=172 HEIGHT=17>
<P class="Body" style="margin: 0px">void MouseDown(int8 *buffer)</P>
</TD>
</TR>
<TR>
<TD WIDTH=294 HEIGHT=17>
<P class="Body" style="margin: 0px">void MouseUp(int8 *buffer)</P>
</TD>
<TD WIDTH=172 HEIGHT=17>
<P class="Body" style="margin: 0px">void MouseMoved(int8 *buffer)</P>
</TD>
</TR>
<TR>
<TD WIDTH=294 HEIGHT=17>
<P class="Body" style="margin: 0px">void UpdateDecorator(void)</P>
</TD>
<TD WIDTH=172 HEIGHT=17>
<P class="Body" style="margin: 0px">void UpdateColors(void)</P>
</TD>
</TR>
<TR>
<TD WIDTH=294 HEIGHT=17>
<P class="Body" style="margin: 0px">void UpdateFont(void)</P>
</TD>
<TD WIDTH=172 HEIGHT=17>
<P class="Body" style="margin: 0px">void UpdateScreen(void)</P>
</TD>
</TR>
<TR>
<TD WIDTH=294 HEIGHT=17>
<P class="Body" style="margin: 0px">void RebuildRegions(bool recursive=true)</P>
</TD>
<TD WIDTH=172 HEIGHT=17>
<P class="Body" style="margin: 0px">void Activate(bool state)</P>
</TD>
</TR>
</TABLE>
<P class="Body" style="margin: 0px"><BR>
<BR>
Global Functions</P>
<P class="Body" style="margin: 0px"><BR>
bool is_moving_window(void)</P>
<P class="Body" style="margin: 0px">void set_is_moving_window(bool state)</P>
<P class="Body" style="margin: 0px">bool is_resizing_window(void)</P>
<P class="Body" style="margin: 0px">void set_is_resizing_window(bool state)</P>
<P class="Body" style="margin: 0px">void set_active_winborder(WinBorder *win)</P>
<P class="Body" style="margin: 0px">WinBorder * get_active_winborder(void)</P>
<P class="Body" style="margin: 0px"><BR>
Namespaces</P>
<P class="Body" style="margin: 0px"><BR>
winborder_private {</P>
<P class="Body" style="margin: 0px"> bool is_moving_a_window</P>
<P class="Body" style="margin: 0px"> bool is_resizing_a_window</P>
<P class="Body" style="margin: 0px"> WinBorder *active_winborder</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">WinBorder(BRect r, const char *name, int32 resize, int32 flags, ServerWindow *win)</span></P>
<P class="Body" style="margin: 0px"><BR>
1) Pass parameters to Layer constructor</P>
<P class="Body" style="margin: 0px">2) Instantiate a decorator</P>
<P class="Body" style="margin: 0px">3) Initialize visible and full regions via Decorator::GetFootprint()</P>
<P class="Body" style="margin: 0px"><BR>
<BR>
<span class="OBOS-Function-Def">~WinBorder(void)</span></P>
<P class="Body" style="margin: 0px"><BR>
1) Delete decorator instance</P>
<P class="Body" style="margin: 0px"><BR>
<BR>
<span class="OBOS-Function-Def">void RequestDraw(void)</span></P>
<P class="Body" style="margin: 0px"><BR>
Reimplements Layer::RequestDraw() because it has no corresponding BView</P>
<P class="Body" style="margin: 0px"><BR>
1) if IsDirty()==false, return</P>
<P class="Body" style="margin: 0px">2) Iterate through each BRect in the invalid region and call Decorator::Draw(BRect) for each invalid rectangle</P>
<P class="Body" style="margin: 0px">3) Perform recursive child calls as in Layer::RequestDraw()</P>
<P class="Body" style="margin: 0px"><BR>
<BR>
<span class="OBOS-Function-Def">void MoveBy(BPoint pt)</span></P>
<P class="Body" style="margin: 0px"><span class="OBOS-Function-Def">void MoveBy(float x, float y)</span></P>
<P class="Body" style="margin: 0px"><BR>
Moves the WinBorder's position on screen - reimplements Layer::MoveBy()</P>
<P class="Body" style="margin: 0px"><BR>
1) Call the decorator's MoveBy()</P>
<P class="Body" style="margin: 0px">2) Call Layer::MoveBy()</P>
<P class="Body" style="margin: 0px"><BR>
<BR>
<span class="OBOS-Function-Def">void ResizeBy(BPoint pt)</span></P>
<P class="Body" style="margin: 0px"><span class="OBOS-Function-Def">void ResizeBy(float x, float y)</span></P>
<P class="Body" style="margin: 0px"><BR>
Resizes the WinBorder - reimplements Layer::MoveBy()</P>
<P class="Body" style="margin: 0px"><BR>
1) Call the decorator's ResizeBy()</P>
<P class="Body" style="margin: 0px">2) Call Layer::ResizeBy()</P>
<P class="Body" style="margin: 0px"><BR>
<BR>
<span class="OBOS-Function-Def">void MouseDown(int8 *buffer)</span></P>
<P class="Body" style="margin: 0px"><BR>
Figures out what to do with B_MOUSE_DOWN messages sent to the window's border.</P>
<P class="Body" style="margin: 0px"><BR>
1) Extract data from the buffer</P>
<P class="Body" style="margin: 0px">2) Call the decorator's Clicked() function</P>
<P class="Body" style="margin: 0px">3) Feed return value to a switch() function (table below)</P>
<P class="Body" style="margin: 0px">4) Call the ServerWindow's Activate() function</P>
<P class="Body" style="margin: 0px"><BR>
</P>
<TABLE WIDTH=561 HEIGHT=324 BORDER=1 CELLPADDING=1 CELLSPACING=2>
<TR>
<TD WIDTH=158 HEIGHT=17>
<P class="Body" style="margin: 0px">CLICK_MOVETOBACK</P>
</TD>
<TD WIDTH=263 HEIGHT=17>
<P class="Body" style="margin: 0px">call MoveToBack()</P>
</TD>
</TR>
<TR>
<TD WIDTH=158 HEIGHT=17>
<P class="Body" style="margin: 0px">CLICK_MOVETOFRONT</P>
</TD>
<TD WIDTH=263 HEIGHT=17>
<P class="Body" style="margin: 0px">call MoveToFront()</P>
</TD>
</TR>
<TR>
<TD WIDTH=158 HEIGHT=32>
<P class="Body" style="margin: 0px">CLICK_CLOSE</P>
</TD>
<TD WIDTH=263 HEIGHT=32>
<P class="Body" style="margin: 0px">1) call SetCloseButton(true)</P>
<P class="Body" style="margin: 0px">2) call decorator-&gt;DrawClose</P>
</TD>
</TR>
<TR>
<TD WIDTH=158 HEIGHT=32>
<P class="Body" style="margin: 0px">CLICK_ZOOM</P>
</TD>
<TD WIDTH=263 HEIGHT=32>
<P class="Body" style="margin: 0px">1) call SetZoomButton(true)</P>
<P class="Body" style="margin: 0px">2) call decorator-&gt;DrawZoom</P>
</TD>
</TR>
<TR>
<TD WIDTH=158 HEIGHT=32>
<P class="Body" style="margin: 0px">CLICK_MINIMIZE</P>
</TD>
<TD WIDTH=263 HEIGHT=32>
<P class="Body" style="margin: 0px">1) call SetMinimizeButton(true)</P>
<P class="Body" style="margin: 0px">2) call decorator-&gt;DrawMinimize</P>
</TD>
</TR>
<TR>
<TD WIDTH=158 HEIGHT=47>
<P class="Body" style="margin: 0px">CLICK_DRAG</P>
</TD>
<TD WIDTH=263 HEIGHT=47>
<P class="Body" style="margin: 0px">1) call MoveToFront()</P>
<P class="Body" style="margin: 0px">2) call set_is_win_moving(true)</P>
<P class="Body" style="margin: 0px">3) Save the mouse position</P>
</TD>
</TR>
<TR>
<TD WIDTH=158 HEIGHT=32>
<P class="Body" style="margin: 0px">CLICK_RESIZE</P>
</TD>
<TD WIDTH=263 HEIGHT=32>
<P class="Body" style="margin: 0px">1) call MoveToFront()</P>
<P class="Body" style="margin: 0px">2) call set_is_win_resizing(true)</P>
</TD>
</TR>
<TR>
<TD WIDTH=158 HEIGHT=17>
<P class="Body" style="margin: 0px">CLICK_NONE</P>
</TD>
<TD WIDTH=263 HEIGHT=17>
<P class="Body" style="margin: 0px">do nothing</P>
</TD>
</TR>
<TR>
<TD WIDTH=158 HEIGHT=17>
<P class="Body" style="margin: 0px">default:</P>
</TD>
<TD WIDTH=263 HEIGHT=17>
<P class="Body" style="margin: 0px">Spew an error to stderr and return</P>
</TD>
</TR>
</TABLE>
<P class="Body" style="margin: 0px"><BR>
<BR>
<BR>
<span class="OBOS-Function-Def">void MouseUp(int8 *buffer)</span></P>
<P class="Body" style="margin: 0px"><BR>
Figures out what to do with B_MOUSE_UP messages sent to the window's border.</P>
<P class="Body" style="margin: 0px"><BR>
1) Extract data from the buffer</P>
<P class="Body" style="margin: 0px">2) Call the decorator's Clicked() function</P>
<P class="Body" style="margin: 0px">3) Feed return value to a switch() function (table below)</P>
<P class="Body" style="margin: 0px">4) if is_resizing_window, call set_is_resizing_window(false)</P>
<P class="Body" style="margin: 0px">5) if is_moving_window, call set_is_moving_window(false)</P>
<P class="Body" style="margin: 0px"></P>
<TABLE WIDTH=612 HEIGHT=371 BORDER=1 CELLPADDING=1 CELLSPACING=2>
<TR>
<TD WIDTH=172 HEIGHT=17>
<P class="Body" style="margin: 0px">CLICK_MOVETOBACK</P>
</TD>
<TD WIDTH=286 HEIGHT=17>
<P class="Body" style="margin: 0px">call MoveToBack()</P>
</TD>
</TR>
<TR>
<TD WIDTH=172 HEIGHT=17>
<P class="Body" style="margin: 0px">CLICK_MOVETOFRONT</P>
</TD>
<TD WIDTH=286 HEIGHT=17>
<P class="Body" style="margin: 0px">call MoveToFront()</P>
</TD>
</TR>
<TR>
<TD WIDTH=172 HEIGHT=63>
<P class="Body" style="margin: 0px">CLICK_CLOSE</P>
</TD>
<TD WIDTH=286 HEIGHT=63>
<P class="Body" style="margin: 0px">1) call SetCloseButton(false)</P>
<P class="Body" style="margin: 0px">2) call decorator-&gt;DrawClose</P>
<P class="Body" style="margin: 0px">3) send B_QUIT_REQUESTED to the target BWindow</P>
</TD>
</TR>
<TR>
<TD WIDTH=172 HEIGHT=48>
<P class="Body" style="margin: 0px">CLICK_ZOOM</P>
</TD>
<TD WIDTH=286 HEIGHT=48>
<P class="Body" style="margin: 0px">1) call SetZoomButton(false)</P>
<P class="Body" style="margin: 0px">2) call decorator-&gt;DrawZoom</P>
<P class="Body" style="margin: 0px">3) send B_ZOOM to the target BWindow</P>
</TD>
</TR>
<TR>
<TD WIDTH=172 HEIGHT=48>
<P class="Body" style="margin: 0px">CLICK_MINIMIZE</P>
</TD>
<TD WIDTH=286 HEIGHT=48>
<P class="Body" style="margin: 0px">1) call SetMinimizeButton(false)</P>
<P class="Body" style="margin: 0px">2) call decorator-&gt;DrawMinimize</P>
<P class="Body" style="margin: 0px">3) send B_MINIMIZE to the target BWindow</P>
</TD>
</TR>
<TR>
<TD WIDTH=172 HEIGHT=24>
<P class="Body" style="margin: 0px">CLICK_DRAG</P>
</TD>
<TD WIDTH=286 HEIGHT=24>
<P class="Body" style="margin: 0px">call set_is_win_moving(false)</P>
</TD>
</TR>
<TR>
<TD WIDTH=172 HEIGHT=24>
<P class="Body" style="margin: 0px">CLICK_RESIZE</P>
</TD>
<TD WIDTH=286 HEIGHT=24>
<P class="Body" style="margin: 0px">call set_is_win_resizing(false)</P>
</TD>
</TR>
<TR>
<TD WIDTH=172 HEIGHT=17>
<P class="Body" style="margin: 0px">CLICK_NONE</P>
</TD>
<TD WIDTH=286 HEIGHT=17>
<P class="Body" style="margin: 0px">do nothing</P>
</TD>
</TR>
<TR>
<TD WIDTH=172 HEIGHT=17>
<P class="Body" style="margin: 0px">default:</P>
</TD>
<TD WIDTH=286 HEIGHT=17>
<P class="Body" style="margin: 0px">Spew an error to stderr</P>
</TD>
</TR>
</TABLE>
<P class="Body" style="margin: 0px"><BR>
<BR>
<BR>
<span class="OBOS-Function-Def">void MouseMoved(int8 *buffer)</span></P>
<P class="Body" style="margin: 0px"><BR>
Figures out what to do with B_MOUSE_MOVED messages sent to the window's border.</P>
<P class="Body" style="margin: 0px"><BR>
1) Extract data from the buffer</P>
<P class="Body" style="margin: 0px">2) Call the decorator's Clicked() function</P>
<P class="Body" style="margin: 0px">3) If not CLICK_CLOSE and decorator-&gt;GetClose is true, call SetClose(false) and DrawClose()</P>
<P class="Body" style="margin: 0px">4) If not CLICK_ZOOM and decorator-&gt;GetZoom is true, call SetZoom(false) and DrawZoom()</P>
<P class="Body" style="margin: 0px">5) If not CLICK_MINIMIZE and decorator-&gt;GetMinimize is true, call SetMinimize(false) and DrawMinimize()</P>
<P class="Body" style="margin: 0px">6) if CLICK_RESIZE or its variants, call CursorManager::SetCursor() with the appropriate system cursor.</P>
<P class="Body" style="margin: 0px">7) if is_moving_window() is true, calculate the amount the mouse has moved and call decorator-&gt;MoveBy() followed by Layer::MoveBy()</P>
<P class="Body" style="margin: 0px">8) if is_resizing_window() is true, calculate the amount the mouse has moved and call decorator-&gt;ResizeBy() followed by Layer::ResizeBy()</P>
<P class="Body" style="margin: 0px"><BR>
<BR>
<span class="OBOS-Function-Def">void UpdateDecorator(void)</span></P>
<P class="Body" style="margin: 0px"><BR>
Hook function called by the WinBorder's ServerWindow when the decorator used is changed.</P>
<P class="Body" style="margin: 0px"><BR>
1) Delete the current decorator</P>
<P class="Body" style="margin: 0px">2) Call instantiate_decorator</P>
<P class="Body" style="margin: 0px">3) Get the new decorator's footprint region and assign it to the full and visible regions</P>
<P class="Body" style="margin: 0px">4) Call RebuildRegions and then RequestDraw</P>
<P class="Body" style="margin: 0px"><BR>
<BR>
<span class="OBOS-Function-Def">void UpdateColors(void)</span></P>
<P class="Body" style="margin: 0px"><BR>
Hook function called by the WinBorder's ServerWindow when system colors change</P>
<P class="Body" style="margin: 0px"><BR>
1) Call the decorator's SetColors(), passing the SystemPalette's GetGUIColors() value</P>
<P class="Body" style="margin: 0px"><BR>
<BR>
<span class="OBOS-Function-Def">void UpdateFont(void)</span></P>
<P class="Body" style="margin: 0px"><BR>
Hook function called by the WinBorder's ServerWindow when system fonts change</P>
<P class="Body" style="margin: 0px"><BR>
TODO: implementation details</P>
<P class="Body" style="margin: 0px"><BR>
<BR>
<span class="OBOS-Function-Def">void UpdateScreen(void)</span></P>
<P class="Body" style="margin: 0px"><BR>
Hook function called by the WinBorder's ServerWindow when screen attributes change</P>
<P class="Body" style="margin: 0px"><BR>
1) Call the decorator's UpdateScreen and then RequestDraw</P>
<P class="Body" style="margin: 0px"><BR>
<BR>
<span class="OBOS-Function-Def">void RebuildRegions(bool recursive=true)</span></P>
<P class="Body" style="margin: 0px"><BR>
Reimplementation of Layer::RebuildRegions which changes it such that lower siblings are clipped to the footprint instead of the frame.</P>
<P class="Body" style="margin: 0px"><BR>
<BR>
<span class="OBOS-Function-Def">void Activate(bool state)</span></P>
<P class="Body" style="margin: 0px"><BR>
This function is never directly called except from within set_active_winborder. It exists to force redraw and set the internal state information to the proper values for when a window receives or loses focus.</P>
<P class="Body" style="margin: 0px"><BR>
1) call the decorator's SetFocus(state)</P>
<P class="Body" style="margin: 0px">2) set the internal is_active flag to state</P>
<P class="Body" style="margin: 0px">3) iterate through each rectangle in the visible region and call the decorator's Draw on it.</P>
<P class="Body" style="margin: 0px"><BR>
<BR>
<span class="OBOS-Function-Def">bool is_moving_window(void)</span></P>
<P class="Body" style="margin: 0px"><span class="OBOS-Function-Def">void set_is_moving_window(bool state)</span></P>
<P class="Body" style="margin: 0px"><BR>
These two functions set and return the variable winborder_private::is_moving_a_window.</P>
<P class="Body" style="margin: 0px"><BR>
<BR>
<span class="OBOS-Function-Def">bool is_resizing_window(void)</span></P>
<P class="Body" style="margin: 0px"><span class="OBOS-Function-Def">void set_is_resizing_window(bool state)</span></P>
<P class="Body" style="margin: 0px"><BR>
These two functions set and return the variable winborder_private::is_resizing_a_window.</P>
<P class="Body" style="margin: 0px"><BR>
<BR>
<span class="OBOS-Function-Def">void set_active_winborder(WinBorder *win)</span></P>
<P class="Body" style="margin: 0px"><span class="OBOS-Function-Def">WinBorder * get_active_winborder(void)</span></P>
<P class="Body" style="margin: 0px"><BR>
These two functions set and return the variable winborder_private::active_winborder</P>
<DIV class="layer" id="Layer 1">
</DIV>
</DIV>
</BODY>
</HTML>

View File

@ -13,6 +13,7 @@
<li><a href="AppServer.htm">AppServer</a></li>
<li><a href="DebugTools.htm">DebugTools</a></li>
<li><a href="ServerApp.htm">ServerApp</a></li>
<li><a href="TokenHandler.htm">TokenHandler</a></li>
</ul>
<dd>Graphics Management</dd>
@ -24,10 +25,9 @@
<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>
<li><a href="WinBorder.htm">WinBorder</a></li>
</ul>
<h3>Other Documents</h3>