diff --git a/docs/develop/servers/app_server/AppServer.htm b/docs/develop/servers/app_server/AppServer.htm index 4430dcb101..9b1ad587d7 100644 --- a/docs/develop/servers/app_server/AppServer.htm +++ b/docs/develop/servers/app_server/AppServer.htm @@ -82,21 +82,21 @@ Decorator * instantiate_decorator(Layer *owner, uint32 wflags, uint32 wlook)

AppServer(void)


-Create the message and input ports

-

Create any necessary semaphores for regulating the 3 main threads

-

Initialize all member variables

-

Allocate the application BList

-

Read in and process all configuration data

-

Initialize the desktop

-

Spawn the Picasso and Poller threads

+1) Create the message and input ports

+

2) Create any necessary semaphores for regulating the 3 main threads

+

3) Initialize all member variables

+

4) Allocate the application BList

+

5) Read in and process all configuration data

+

6) Initialize the desktop

+

7) Spawn the Picasso and Poller threads



~AppServer(void)


-Shut down the desktop

-

Empty and delete the application list

-

Wait for Picasso and Poller to exit

-

Free any allocated heap space

+1) Shut down the desktop

+

2) Empty and delete the application list

+

3) Wait for Picasso and Poller to exit

+

4) Free any allocated heap space



void MainLoop(void)

@@ -123,7 +123,7 @@ Attached Data:


- +
+ + + + @@ -113,16 +113,55 @@ Member Functions


1) Set driver pointer to gfxmodule

2) If driver pointer is non-NULL and driver->Initialize() is true, set initialized flag to true

-

3) If initialized, create and populate workspace list

-

4) Clear all workspaces

+

3) If initialized, get the appropriate display driver info and save it internally

+

4) Create and populate workspace list

+

5) Clear all workspaces


-~Screen(void)

-

void AddWorkspace(int32 index=-1)

-

void Delete Workspace(int32 index)

-

int32 CountWorkspaces(void)

-

void SetWorkspaceCount(int32 count)

-

int32 CurrentWorkspace(void)

-

void SetWorkspace(int32 workspace)

+~Screen(void)

+


+1) Remove all workspaces from the list and delete them

+

2) Delete the workspace list

+


+
+void AddWorkspace(int32 index=-1)

+


+Adds a workspace to the screen object, setting its settings to the default, and adding it to the list in the specified index or the end of the list if the index is -1

+


+1) Create a workspace object

+

2) Add it to the workspace list - to the end if the index is -1, and to the particular index if not

+


+
+void DeleteWorkspace(int32 index)

+


+Deletes the workspace at the specified index.

+


+1) Remove the item at the specified index and if non-NULL, delete it.

+


+
+int32 CountWorkspaces(void)

+


+Returns the number of workspaces kept by the particular Screen objects

+


+1) Return the workspace list's CountItems() value

+


+
+void SetWorkspaceCount(int32 count)

+


+Sets the number of workspaces available to count. If count is less than the number of current workspaces, the last workspaces are deleted first. Workspaces are added to the end of the list. If a delete workspace should include the active workspace, then the workspace with the index count-1 is activated. There must be at least one workspace.

+


+1) if count equals the workspace list's CountItems value, return

+

2) If count is less than 1, set count to 1. If greater than 32, set to 32.

+

3) If active workspace index is greater than count-1, call SetWorkspace(count-1)

+

4) If count is greater than the workspace list's CountItems value, call AddWorkspace the appropriate number of times.

+

5) If count is less than the workspace list's CountItems, call RemoveWorkspace the appropriate number of times

+


+
+int32 CurrentWorkspace(void)

+


+Returns the active workspace index

+


+
+void SetWorkspace(int32 workspace)

void Activate(bool active=true)

DisplayDriver *GetDriver(void)

status_t SetSpace(int32 index, int32 res, bool stick=true)

@@ -139,17 +178,17 @@ Member Functions

Workspace class members


-

port_id reply_port

@@ -140,6 +140,14 @@ Attached Data:

message port for the requesting BApplication

+

int16 sig_length

+
+

length of the following application signature

+

const char *signature

@@ -525,8 +533,48 @@ Attached Data:


- -
+ + + + + + + + + + + + + + + + + + + + + +
+

int64 when

+
+

event time in seconds since 1/1/70

+
+

int32 rawcode

+
+

code for the physical key pressed

+
+

int32 modifiers

+
+

flags signifying the states of the modifier keys

+
+

int8 state_count

+
+

number of bytes to follow containing the state of all keys

+
+

int8 *states

+
+

array of the state of all keys at the time of the event

+



@@ -542,7 +590,51 @@ B_UNMAPPED_KEY_UP:

Attached Data:


-

?

+

+ + + + + + + + + + + + + + + + + + + + + +
+

int64 when

+
+

event time in seconds since 1/1/70

+
+

int32 rawcode

+
+

code for the physical key pressed

+
+

int32 modifiers

+
+

flags signifying the states of the modifier keys

+
+

int8 state_count

+
+

number of bytes to follow containing the state of all keys

+
+

int8 *states

+
+

array of the state of all keys at the time of the event

+
+


+


1) Acquire the active application lock

2) Create a PortLink instance, target the active ServerApp's sender port, set the opcode to B_UNMAPPED_KEY_UP, attach the buffer en masse, and send it to the BApplication.

@@ -557,11 +649,57 @@ Attached Data:

Attached Data:


-

?

+

+ + + + + + + + + + + + + + + + + + + + + +
+

int64 when

+
+

event time in seconds since 1/1/70

+
+

int32 modifiers

+
+

flags signifying the states of the modifier keys

+
+

int32 old_modifiers

+
+

former states of the modifier keys

+
+

int8 state_count

+
+

number of bytes to follow containing the state of all keys

+
+

int8 *states

+
+

array of the state of all keys at the time of the event

+
+


+


1) Acquire the active application lock

2) Create a PortLink instance, target the active ServerApp's sender port, set the opcode to B_MODIFIERS_CHANGED, attach the buffer en masse, and send it to the BApplication.

3) Release the active application lock

+
+
diff --git a/docs/develop/servers/app_server/CursorManager.htm b/docs/develop/servers/app_server/CursorManager.htm index 286d3a6c3d..2164c31b28 100644 --- a/docs/develop/servers/app_server/CursorManager.htm +++ b/docs/develop/servers/app_server/CursorManager.htm @@ -93,7 +93,7 @@ Member Functions

Enumerated Types:


cursor_which {

-

CURSOR_ARROW

+

CURSOR_DEFAULT

CURSOR_TEXT

CURSOR_MOVE

CURSOR_DRAG

diff --git a/docs/develop/servers/app_server/Decorator.htm b/docs/develop/servers/app_server/Decorator.htm index 6befdc37ec..d4bcd703e8 100644 --- a/docs/develop/servers/app_server/Decorator.htm +++ b/docs/develop/servers/app_server/Decorator.htm @@ -29,7 +29,7 @@ Member Functions


- +
- - +

int32 _TitleWidth(void)

+

Decorator(BRect int32 wlook, int32 wfeel, int32 wflags)

@@ -95,16 +95,16 @@ Member Functions

+

void SetTitle(const char *string)

+

void SetFont(SFont *sf)

-

void _ClipTitle(void)

+

int32 _ClipTitle(float width)

void SetFocus(bool is_active)

@@ -115,8 +115,8 @@ Member Functions

bool GetFocus(void)

-   -


@@ -125,7 +125,7 @@ Member Functions

Virtual Functions


- +
- - +

void MoveBy(float x, float y)

@@ -207,12 +207,12 @@ Virtual Functions

+

void _SetFocus(void)

-   - +

BRect SlideTab(float dx, float dy=0)

+


@@ -279,11 +279,17 @@ Empty.


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.


-void ClipTitle(void)

+int32 _ClipTitle(float width)


-ClipTitle calculates how much of the title will actually be displayed when _DrawTitle() is called.

+ClipTitle calculates how much of the title, in characters, can be displayed in the given width.


-<To be fleshed out once font subsystem is better understood>

+1) Call StringWidth() on the title.

+

2) If the string's width is less thanwidth, return the string's character count

+

3) while the character count to display is > 0

+

a) calculate the string's width

+

b) if the string's width is less than width, return the character count

+

c) decrement the character count

+

4) If the loop completes itself without returning a value, it can't fit, so return 0.



void SetFocus(bool is_active)

@@ -301,6 +307,11 @@ Returns the focus state held by the decorator

1) Return the focus flag



+int32 _TitleWidth(void)

+


+Returns the character count of the title or 0 if it is NULL.

+


+
Virtual Functions


Most of these functions have a default behavior which can be overridden, but are implemented to handle the more common implementations.

@@ -336,22 +347,23 @@ Main drawing call which checks the intersection of the rectangle passed to it an


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.


+
void DrawFrame(void)

protected: void _DrawFrame(BRect r)


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.


+
void DrawTab(void)

protected: void _DrawTab(BRect r)


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.


+
void DrawTitle(void)

protected: void _DrawTitle(BRect r)


-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.

-


-<To be fleshed out once font subsystem is better understood>

+These cause the window's title to be drawn. DrawTitle() amounts to _DrawTitle(titlerect).



void _SetFocus(void)

@@ -369,6 +381,10 @@ This returns the "footprint" of the decorator, i.e. the area which is occupied b 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.



+BRect SlideTab(float dx, dy=0)

+


+SlideTab is implemented only for those decorators which allow the user to somehow slide the tab (if there is one) along the window. Currently, only the horizontal direction is supported. It returns the rectangle of the invalid region which needs redrawn as a result of the slide.

+


extern "C" Decorator *create_decorator(BRect frame, int32 wlook, int32 wfeel, int32 wflags)


Required export function which simply allocates an instance of the decorator and returns it.

diff --git a/docs/develop/servers/app_server/Desktop.htm b/docs/develop/servers/app_server/Desktop.htm index 28b60e63bb..b54ed482e3 100644 --- a/docs/develop/servers/app_server/Desktop.htm +++ b/docs/develop/servers/app_server/Desktop.htm @@ -48,7 +48,20 @@ void AddWindowToDesktop(ServerWindow *win, int32 workspace=B_CURRENT_WORKSPACE,

void RemoveWindowFromDesktop(ServerWindow *win)

ServerWindow *GetActiveWindow(void)

void SetActiveWindow(ServerWindow *win)

-

Layer *GetRootLayer(int32 workspace=B_CURRENT_WORKSPACE, screen_id screen=B_MAIN_SCREEN_ID)

+

Layer *GetRootLayer(int32 workspace=B_CURRENT_WORKSPACE, screen_id s

+

screen=B_MAIN_SCREEN_ID)

+


+void set_drag_message(int32 size, int8 *flattened)

+

int8* get_drag_message(int32 *size)

+

void empty_drag_ message(void)

+


+Namespaces

+


+desktop_private {

+

int8 *dragmessage

+

int32 dragmessagesize

+

sem_id draglock

+

}



@@ -60,14 +73,19 @@ Sets up all the stuff necessary for the system's desktop.

2) Create and populate Screen list, pointing each Screen instance to its Driver instance

3) Create layer and workspace locks

4) Set screen 0 to active

+

5) Create the desktop_private::draglock semaphore


+
void ShutdownDesktop(void)


Undoes everything done in InitDesktop().


1) Delete all locks

2) Delete all screens in the list

+

3) Delete the desktop_private::draglock semaphore

+

4) If desktop_private::dragmessage is non-NULL, delete it.


+
void AddWorkspace(int32 index=-1)

void DeleteWorkspace(int32 index)

int32 CountWorkspaces(void)

@@ -77,6 +95,7 @@ Undoes everything done in InitDesktop().


Each of these calls the appropriate method in the Screen class. Add and Delete workspace functions operate on all screens.


+
void SetScreen(screen_id id)

int32 CountScreens(void)

screen_id ActiveScreen(void)

@@ -85,6 +104,7 @@ Each of these calls the appropriate method in the Screen class. Add and Delete w


Each of these calls operate on the objects in the Screen list, calling methods as appropriate.


+
void AddWindowToDesktop(ServerWindow *win, int32 workspace=B_CURRENT_WORKSPACE, screen_id screen=B_MAIN_SCREEN_ID)

void RemoveWindowFromDesktop(ServerWindow *win)

ServerWindow *GetActiveWindow(void)

@@ -93,7 +113,36 @@ Each of these calls operate on the objects in the Screen list, calling methods a


These operate on the layer structure in the active Screen object, calling methods as appropriate.


-

+
+void set_drag_message(int32 size, int8 *flattened)

+


+This assigns a BMessage in its flattened state to the internal storage. Only one message can be stored at a time. Once an assignment is made, another cannot be made until the current one is emptied. If additional calls are made while there is a drag message assigned, the new assignment will not be made. Note that this merely passes a pointer around. No copies are made and the caller is responsible for freeing any allocated objects from the heap.

+


+1) Acquire the draglock

+

2) release the lock and return if winborder_private::dragmessage is non-NULL

+

3) Assign parameters to the private variables

+

4) Release the draglock

+


+
+int8* get_drag_message(int32 *size)

+


+Retrieve the current drag message in use. This function will fail if a NULL pointer is passed to it. Note that this does not free the current drag message from use. The size of the flattened message is stored in the size parameter. Note that if there is no message in use, it will return NULL and set size to 0.

+


+1) return NULL if size pointer is NULL

+

2) acquire the draglock

+

3) set value of size parameter to winborder_private::dragmessagesize

+

4) assign a temporary pointer the value of desktop_private::dragmessage

+

5) release the draglock

+

6) return the temporary pointer

+


+
+void empty_drag_ message(void)

+


+This empties the current drag message from use and allows for other messages to be assigned.

+


+1) acquire draglock

+

2) assign 0 to desktop_private::dragmessagesize and set desktop_private::dragmessage to NULL

+

3) release draglock

diff --git a/docs/develop/servers/app_server/DesktopClasses.htm b/docs/develop/servers/app_server/DesktopClasses.htm index d851a41b7e..c52b12b6e3 100644 --- a/docs/develop/servers/app_server/DesktopClasses.htm +++ b/docs/develop/servers/app_server/DesktopClasses.htm @@ -43,7 +43,7 @@ Member Functions

void AddWorkspace(int32 index=-1)

-

void Delete Workspace(int32 index)

+

void DeleteWorkspace(int32 index)

+
- - - - - + + + +
-

Workspace(void)

+
+

Workspace(graphics_card_info *gcinfo, frame_buffer_info *fbinfo)

+

~Workspace(void)

+

void SetBGColor(const RGBColor &c)

@@ -157,21 +196,66 @@ Member Functions

+

RootLayer *GetRoot(void)

+ +

void SetData(graphics_card_info *gcinfo, frame_buffer_info *fbinfo)

+
+

void GetData(graphics_card_info *gcinfo, frame_buffer_info *fbinfo)

+
 



-Workspace(void)

-

~Workspace(void)

-

void SetBGColor(const RGBColor &c)

-

RGBColor BGColor(void)

-

RootLayer *GetRoot(void)

+
+Workspace(void)

+


+1) Set background color to RGB(51,102,160)

+

2) Copy frame_buffer_info and graphics_card_info structure values

+

3) Create a RootLayer object using the values from the two structures

+


+
+~Workspace(void)

+


+1) Call the RootLayer object's PruneTree method and delete it

+


+
+void SetBGColor(const RGBColor &c)

+


+Sets the particular color for the workspace. Note that this does not refresh the display.

+


+1) Set the internal background RGBColor object to the color parameter

+


+
+RGBColor BGColor(void)

+


+Returns the internal background color

+


+
+RootLayer *GetRoot(void)

+


+Returns the pointer to the RootLayer object

+


+
+void SetData(graphics_card_info *gcinfo, frame_buffer_info *fbinfo)

+


+Changes the graphics data and resizes the RootLayer accordingly.

+


+1) Copy the two structures to the internal one

+

2) Resize the RootLayer

+

3) If the RootLayer was resized larger, Invalidate the new areas

+


+
+void GetData(graphics_card_info *gcinfo, frame_buffer_info *fbinfo)

+


+Copies the two data structures into the parameters passed.



diff --git a/docs/develop/servers/app_server/DisplayDriver.htm b/docs/develop/servers/app_server/DisplayDriver.htm index 38572fa6c6..b6d0dd14c3 100644 --- a/docs/develop/servers/app_server/DisplayDriver.htm +++ b/docs/develop/servers/app_server/DisplayDriver.htm @@ -27,7 +27,7 @@

Member Functions


- +
- - @@ -153,8 +153,16 @@

bool IsCursorHidden(void)

+

void SetCursor(ServerCursor *csr)

+ + + + +

DisplayDriver(void)

@@ -101,10 +101,10 @@
+

void DrawPicture(SPicture *pic, BPoint pt)

+

void CopyBits(BRect src, BRect dest)

-   -
+

virtual float StringWidth(const char *string, int32 length, LayerData *d)

+
+

virtual float StringHeight(const char *string, int32 length, LayerData *d)

+


@@ -236,6 +244,9 @@ void StrokeArc(BRect r, float angle, float span, layerdata *d, int8 *pattern)void HideCursor(void)

void ObscureCursor(void)

bool IsCursorHidden(void)

+

void SetCursor(ServerCursor *csr)

+

float StringWidth(const char *string, int32 length, LayerData *d)

+

float StringHeight(const char *string, int32 length, LayerData *d)


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.


diff --git a/docs/develop/servers/app_server/FontFamily.htm b/docs/develop/servers/app_server/FontFamily.htm index 54eb520112..f353ea93a2 100644 --- a/docs/develop/servers/app_server/FontFamily.htm +++ b/docs/develop/servers/app_server/FontFamily.htm @@ -19,81 +19,121 @@

FontFamily class


-FontFamily objects are used to house all related font styles allocated as FontStyle objects.

+FontFamily objects are used to tie together all related font styles.



Member Functions


- +
- - + + + + + + + +
-

FontFamily(font_family name)

+

FontFamily(const char *name)

~FontFamily(void)

-

font_family GetName(void)

+
+

const char *GetName(void)

-

void AddStyle(FontStyle *style)

+
+

void AddStyle(const char *path, FT_Face face)

-

void RemoveStyle(FontStyle *style)

+

void RemoveStyle(const char *style)

-

FontStyle *FindStyle(font_style name)

+

FontStyle *GetStyle(const char *stylename)

+

const char *GetStyle(int32 index)

+
+

int32 CountStyles(void)

+
+

bool HasStyle(const char *style)

+
+   +





-

FontFamily(font_family name)

+

FontFamily(const char *name)


-1) Set internal name to the one passed to the constructor

+1) Create and set internal name to the one passed to the constructor

+

2) Create the styles list



~FontFamily(void)


-1) Does nothing

+1) delete the internal name

+

2) empty and delete the internal style list



-font_family GetName(void)

+const char *GetName(void)


Returns the internal family name



-void AddStyle(FontStyle *style)

+void AddStyle(const char *path, FT_Face face)


-Adds the style to the family. Note that the FontFamily object is not responsible for freeing FontStyle objects added in this way.

+Adds the style to the family.


-1) Add the style object to the internal STL map object for styles

+1) Create the FontStyle object and add it to the style list.



-void RemoveStyle(FontStyle *style)

+void RemoveStyle(const char *style)


Removes the style from the FontFamily object.


-1) Find the style in the style list. Return if not found.

-

2) Delete the style list's item

+1) Call GetStyle on the given pointer

+

2) If non-NULL, delete the object

3) If the style list is now empty, ask the FontServer to remove it from the family list



-FontStyle *FindStyle(font_style name)

+FontStyle *GetStyle(const char *style)


Looks up a FontStyle object based on its style name. Returns NULL if not found.


-1) Call the style list's find() method.

-

2) Return the appropriate FontStyle object or NULL if not found.

+1) Iterate through the style list

+

a) compare style to each FontStyle object's GetName method and return the object if they are the same

+

2) If all items have been checked and nothing has been returned, return NULL

+


+
+const char *GetStyle(int32 index)

+


+Returns the name of the style at index

+


+1) Get the FontStyle item at index obtained via the style list's ItemAt call

+


+
+int32 CountStyles(void)

+


+Returns the number of items in the style list and, thus, the number of styles in the family

+


+
+bool HasStyle(const char *stylename)

+


+Returns true if the family has a style with the name stylename

+


+1) Call GetStyle on the style name and return false if NULL, true if not.

+


+

diff --git a/docs/develop/servers/app_server/FontServer.htm b/docs/develop/servers/app_server/FontServer.htm index 63a8eded45..13e0fe5d34 100644 --- a/docs/develop/servers/app_server/FontServer.htm +++ b/docs/develop/servers/app_server/FontServer.htm @@ -27,7 +27,7 @@

Member Functions


- +
@@ -61,29 +61,53 @@ - - + + + + + + + + + + + +

FontServer(void)

@@ -46,10 +46,10 @@
-

FT_Library GetLibrary(void)

+

void SaveList(void)

-

void ScanDirectory(const char *path)

+

status_t ScanDirectory(const char *path)

-

int32 CountFontFamilies(void)

+
+

int32 CountFamiles(void)

-

status_t GetFamily(int32 index, font_family family)

+
+

status_t IsInitialized(void)

-

int32 CountFontStyles(font_family family)

+

int32 CountStyles(font_family family)

-

status_t GetStyle(font_family family, font_style style, int32 *flags)

+

FontStyle *GetStyle(font_family family, font_style style)

-

void RemoveFamily(FontFamily *family)

+

void RemoveFamily(const char *family)

FontFamily *_FindFamily(const char *name)

+

ServerFont *GetSystemPlain(void)

+
+

ServerFont *GetSystemBold(void)

+
+

ServerFont *GetSystemFixed(void)

+
+

bool SetSystemPlain(const char *family, const char *style, float size)

+
+

void RemoveUnusedFamilies(void)

+
+

bool FontsNeedUpdated(void)

+



@@ -94,7 +118,6 @@ 1) Create access semaphore

2) Call FT_Init_FreeType()

3) If no error initializing the FreeType library, set init flag to true

-

4) Call ScanDirectory() on /boot/beos/etc/fonts/psfonts, .../ttfonts, ~/config/fonts/psfonts and .../ttfonts



~FontServer(void)

@@ -108,25 +131,43 @@ These functions simply acquire and release the internal access semaphore.



-FT_Library GetLibrary(void)

+void SaveList(void)


-Returns the internal FT_Library object

+Saves the list of all scanned and valid font families and styles to disk

+


+1) create a BMessage for storing font family data (hereafter, the font message)

+

2) create a BMessage for storing a list of font family messages (hereafter, the list message)

+

3) create a boolean tuned flag and a boolean fixed flag

+

4) Iterate through all families

+

A) for each family, get its name and add its name to the font message as "name"

+

B) iterate through the families styles

+

a) get the style's name, and if valid, add it to the font message as "styles"

+

b) if IsTuned and IsScalable, set the tuned flag to true

+

c) if IsFixedWidth, set the fixed flag to true

+

C) if the tuned flag is set, add a boolean true to the font message as "tuned"

+

D) if the fixed flag is set, add a boolean true to the font message as "fixed"

+

E) add the font message to the list message as "family"

+

F) empty the font message

+

5) Create a BFile from the path definition SERVER_FONT_LIST for Read/Write, creating the file if nonexistent and erasing any existing one

+

6) Flatten the list message to the created BFile object

+

7) Set the needs_update flag to false



-void ScanDirectory(const char *path)

+status_t ScanDirectory(const char *path)


ScanDirectory is where the brunt of the work of the FontServer is done - scans the directory of all fonts which can be loaded.


-1) Iterate through the font family STL map and set each FontFamily object's Delete flag to true

+1) Make a BDirectory object pointer at the path parameter. If the init code is not B_OK, return it.

2) Enter a while() loop, iterating through each entry in the given directory, executing as follows:

a) Ensure that the entry is not '.' or '..'

b) Call FT_New_Face on the entry's full path

c) If a valid FT_Face is returned, iterate through to see if there are any supported character mappings in the current entry.

d) If there are no supported character mappings, dump the supported mappings to debug output, call FT_Done_Face(), and continue to the next entry

e) See if the entry's family has been added to the family list. If it hasn't, create one and add it.

-

f) Check to see if the font's style has been added to its family. If so, call set the family's Delete flag to false, call FT_Done_Face, and continue to the next entry

+

f) Check to see if the font's style has been added to its family. If so, call FT_Done_Face, and continue to the next entry

g) If the style has not been added, create a new SFont for that family and face, increment the font count, and continue to the next entry.

-

3) Iterate through all styles in each family and delete all SFont objects which have a true Delete flag

+

3) set the needs_update flag to true

+

4) Return B_OK


Supported character mappings are Windows and Apple Unicode, Windows symbol, and Apple Roman character mappings, in order of preference from first to last.


@@ -148,22 +189,19 @@ Returns a usable instance of a specified font object with specified properties.<

2) Assuming that the FontStyle object is non-NULL, it calls its GetInstance method and returns the result.



-int32 CountFontFamilies(void)

+int32 CountFamilies(void)


Returns the number of valid font families available to the system.


1) Return the number of items in the family list



-status_t GetFamily(int32 index, font_family family)

+status_t IsInitialized(void)


-Gets the name of the family with the index passed to the function and sets the font_family object to the appropriate value.

-


-1) If index > family list count, return B_ERROR

-

2) Look up the string at the index, copy it, and return B_OK

+Returns the initialization status variable



-int32 CountFontStyles(font_family family)

+int32 CountStyles(font_family family)


Returns the number of styles available for a given font family.


@@ -171,21 +209,20 @@ Returns the number of styles available for a given font family.

2) If non-NULL, call its return the result of its CountStyles method



-status_t GetStyle(font_family family, font_style style, int32 *flags)

+FontStyle *GetStyle(font_family family, font_style style)


-Gets the name of the family with the index passed to the function and sets the font_family object to the appropriate value.

+Gets the FontStyle object of the family, style, and flags.


1) Call _FindFamily() to get the appropriate font family

-

2) If non-NULL, look up the string at the index, and copy it to the passed style object, otherwise, return B_ERROR

-

3) Get the style's FontStyle object and set flags to the flags contained in the FontStyle object

-

4) Return B_OK

+

2) If non-NULL, call the family's GetStyle method on the font_style parameter and return the result

+

3) If family is NULL, return NULL



-void RemoveFamily(FontFamily *family)

+void RemoveFamily(const char *family)


Removes a font family from the family list


-1) Look up font family in the family list

+1) Look up font family in the family list via _FindFamily()

2) If it exists, delete it



@@ -197,6 +234,39 @@ Looks up a FontFamily object based on its family name. Returns NULL if not found


1) Call the family list's find() method.

2) Return the appropriate FontFamily object or NULL if not found.

+


+
+ServerFont *GetSystemPlain(void)

+

ServerFont *GetSystemBold(void)

+

ServerFont *GetSystemFixed(void)

+


+These return a copy of a pointer to the system-wide ServerFont objects which represent the appropriate system font settings. It is the responsibility of the caller to delete the object returned. NULL is returned if no setting has been set for a particular system font.

+


+bool SetSystemPlain(const char *family, const char *style, float size)

+

bool SetSystemBold(const char *family, const char *style, float size)

+

bool SetSystemFixed(const char *family, const char *style, float size)

+


+The system fonts settings may be set via these calls by specifying the family, style, and size. They return true if everything worked out ok and false if not. Settings are not changed if false is returned.

+


+1) Call _FindFamily on the family parameter. if NULL, return false

+

2) Call the family's GetStyle member. if NULL, return false

+

3) if the appropriate system font pointer is non-NULL, delete it

+

4) call the style's Instantiate member with the size parameter

+


+
+void RemoveUnusedFamilies(void)

+


+The purpose of this function is to allow for a complete rescan of the fonts in the appropriate directories.

+


+1) Iterate through the family list

+

A) Get a family

+

B) if it has no dependents, remove it from the list and delete it

+

2) Set the needs_update flag to true

+


+
+bool FontsNeedUpdated(void)

+


+Returns the value of the needs_update flag

diff --git a/docs/develop/servers/app_server/Layer.htm b/docs/develop/servers/app_server/Layer.htm index 78f06d9a0a..97b3e5f426 100644 --- a/docs/develop/servers/app_server/Layer.htm +++ b/docs/develop/servers/app_server/Layer.htm @@ -27,126 +27,126 @@ Member Functions


- +
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +
+

Layer(BRect frame, const char *name, int32 resize, int32 flags, ServerWindow *win)

+

~Layer(void)

+

void AddChild(Layer *child, Layer *before=NULL, bool rebuild=true)

+

RemoveChild(Layer *child, bool rebuild=true)

+

void RemoveSelf(bool rebuild=true)

+

void Invalidate(BRect r)

+

void Invalidate(BRegion *region)

+

BRect Frame(void)

+

BRect Bounds(void)

+

void MoveBy(BPoint pt)

+

void MoveBy(float x, float y)

+

void ResizeBy(BPoint pt)

+

void ResizeBy(float x, float y)

+

int32 CountChildren(void)

+

bool IsDirty(void)

+

BRect ConvertToTop(const BRect &r)

+

BRegion ConvertToTop(const BRegion &r)

+

BRect ConvertFromTop(const BRect &r)

+

BRegion ConvertFromTop(const BRegion &r)

+

BRect ConvertToParent(const BRect &r)

+

BRegion ConvertToParent(const BRegion &r)

+

BRect ConvertFromParent(const BRect &r)

+

BRegion ConvertFromParent(const BRegion &r)

+

void RebuildRegions(bool recursive=false)

+

void MakeTopChild(void)

+

void MakeBottomChild(void)

+

void RequestDraw(const BRect &r)

+

Layer *FindLayer(int32 token)

+

Layer *GetChildAt(BPoint pt, bool recursive=false)

-   - +

PortLink *GetLink(void)

+


@@ -377,6 +377,11 @@ if recursive is false:

B) if the child is hidden, continue to the next iteration

C) if the child's frame contains the point, return the child

D) if none of the children contain the point, return this

+


+
+PortLink *GetLink(void)

+


+Returns the layer's internal PortLink object so a message can be sent to the Layer's window.

diff --git a/docs/develop/servers/app_server/ServerBitmap.htm b/docs/develop/servers/app_server/ServerBitmap.htm index cb74b8a374..d8c810d492 100644 --- a/docs/develop/servers/app_server/ServerBitmap.htm +++ b/docs/develop/servers/app_server/ServerBitmap.htm @@ -20,7 +20,7 @@

ServerBitmap class


-

ServerBitmaps are the server side counterpart to BBitmap.

+

ServerBitmaps are the server side counterpart to BBitmap. Note that they are not allocated like other objects - the BitmapManager handles all allocation and deletion tasks.




@@ -29,14 +29,22 @@ Member Functions


- +
+ + + + - - - -

ServerBitmap(BRect r, color_space cspace, int32 flags, int32 bytesperrow=-1, screen_id screen=B_MAIN_SCREEN_ID)

+

void _HandleSpace(color_space cs, int32 bytesperline=-1)

+

~ServerBitmap(void)

+

int32 BytesPerRow(void)

+
@@ -54,14 +62,6 @@ Member Functions

BRect Bounds(void)

-

int32 BytesPerRow(void)

-
-

void _HandleSpace(color_space cs, int32 bytesperline=-1)

-



@@ -72,13 +72,14 @@ If there are any global functions associated with the class, they are listed her


-

ServerBitmap(BRect r, color_space cspace, int32 flags, int32 bytesperrow=-1, screen_id screen=B_MAIN_SCREEN_ID)

+

ServerBitmap(BRect r, color_space cspace, int32 flags, int32 bytesperrow=-1, screen_id screen=B_MAIN_SCREEN_ID)


1) Call _HandleSpace()

2) Call _HandleFlags()

3) Initialize remaining data members to parameters or safe values


-
~ServerBitmap(void)

+
+~ServerBitmap(void)


Empty


diff --git a/docs/develop/servers/app_server/toc.htm b/docs/develop/servers/app_server/toc.htm index 0107daa0ae..15038379cc 100644 --- a/docs/develop/servers/app_server/toc.htm +++ b/docs/develop/servers/app_server/toc.htm @@ -13,16 +13,21 @@

  • AppServer
  • DebugTools
  • ServerApp
  • +
  • SharedObject
  • TokenHandler
  • Graphics Management