Application Server¶
Purpose¶
The app_server provides services to the Haiku by managing processes, filtering and dispatching input from the Input Server to the appropriate applications, and managing all graphics-related tasks.
Tasks performed by app_server¶
The tasks performed by the app_server are grouped in relation to its purpose.
Receives and redirects (dispatches) messages from the input server
Responds to messages from apps
Receives and consolidates requests from BView, BWindow, BBitmap, and others to draw stuff (draw bitmap, etc)
Utilizes ports to communicate with child processes
Handles drag & drop messaging
Manages the system clipboard
Loads and Kills processes
Detects absence of Input Server and restarts when not running
Aids in system shutdown
Dynamically loads accelerant portion of graphics driver
Creates a connection with BBitmaps requiring a child view
Draws the blue desktop screen
Provides workspace support
Provides functionality to the BeAPI for drawing primitives, such as rectangles, ellipses, and beziers
Provides a means for BViews to draw on BBitmaps
Manages window behavior with respect to redraw (move to front, minimize, etc)
Returns a frame buffer to direct-access classes
Caches fonts for screen and printer use
Draws text and provides other font API support for the BeAPI classes
App server components¶
Class Descriptions¶
Application Management
- AppServer class
- Member Functions
- Global Functions
- AppServer(void)
- ~AppServer(void)
- void MainLoop(void)
- void DispatchMessage(int32 code, int8 *buffer)
- void Run(void)
- bool LoadDecorator(const char *path)
- static int32 Picasso(void *data)
- static int32 Poller(void *data)
- Decorator * instantiate_decorator(Layer *owner, uint32 wflags, uint32 wlook)
- void Broadcast(int32 code)
- void HandleKeyMessage(int32 code, int8 *buffer)
- ServerApp class
- Member Functions
- ServerApp(port_id sendport, port_id rcvport, const char *sig, thread_id thread_bapp)
- ~ServerApp(void)
- bool Run(void)
- static int32 MonitorApp(void *data)
- bool IsActive(void)
- void PingTarget(void)
- void DispatchMessage(int32 code, int8 *buffer)
- void WindowBroadcast(int32 code)
- void Lock(void), void Unlock(void), bool IsLocked(void)
- Member Functions
- SharedObject class
- TokenHandler class
- Debug Utility functions
Graphics Management
- BitmapManager class
- ColorUtils
- Global Functions
- void SetRGBColor32(rgb_color *col, uint8 r, uint8 g, uint8 b, uint8 a=255)
- void SetRGBAColor32(rgb_color *col, uint16 color16)
- void SetRGBColor16(uint16 *col, uint8 r, uint8 g, uint8 b)
- void SetRGBAColor15(uint16 *col, uint8 r, uint8 g, uint8 b, bool opaque=true)
- uint8 FindClosestColor(rgb_color *palette,rgb_color col)
- uint16 FindClosestColor16(rgb_color col)
- uint16 FindClosestColor15(rgb_color col)
- rgb_color MakeBlendColor(rgb_color col, rgb_color col2, float position)
- Global Functions
- CursorManager class
- Enumerated Types
- Member Functions
- CursorManager(void)
- ~CursorManager(void)
- int32 AddCursor(ServerCursor *sc)
- void DeleteCursor(int32 ctoken)
- void RemoveAppCursors(ServerApp *app)
- void ShowCursor(void), void HideCursor(void), void ObscureCursor(void)
- void SetCursor(int32 token), void SetCursor(cursor_which cursor)
- ServerCursor *GetCursor(cursor_which which)
- void ChangeCursor(cursor_which which, int32 token)
- cursor_which GetCursorWhich(void)
- Decorator class
- Member Functions
- Decorator(BRect int32 wlook, int32 wfeel, int32 wflags)
- ~Decorator(void)
- void SetColors(color_set colors)
- void SetDriver(DisplayDriver *driver)
- void SetClose(bool is_down)
- void SetMinimize(bool is_down)
- void SetZoom(bool is_down)
- void SetFlags(int32 wflags)
- void SetFeel(int32 wfeel)
- void SetLook(int32 wlook)
- bool GetClose(void)
- bool GetMinimize(void)
- bool GetZoom(void)
- int32 GetLook(void)
- int32 GetFeel(void)
- int32 GetFlags(void)
- void SetTitle(const char *string)
- void SetFont(SFont *sf)
- int32 _ClipTitle(float width)
- void SetFocus(bool is_active)
- bool GetFocus(void)
- int32 _TitleWidth(void)
- Virtual Functions
- void MoveBy(float x, float y)
- void MoveBy(BPoint pt)
- void ResizeBy(float x, float y)
- void ResizeBy(BPoint pt)
- void Draw(BRect r)
- void Draw(void)
- void DrawClose(void)
- protected: void _DrawClose(BRect r)
- void DrawMinimize(void)
- protected: void _DrawMinimize(BRect r)
- void DrawZoom(void)
- protected: void _DrawZoom(BRect r)
- void DrawFrame(void)
- protected: void _DrawFrame(BRect r)
- void DrawTab(void)
- protected: void _DrawTab(BRect r)
- void DrawTitle(void)
- protected: void _DrawTitle(BRect r)
- void _SetFocus(void)
- SRegion GetFootprint(void)
- click_type Clicked(BPoint pt, int32 buttons, int32 modifiers)
- BRect SlideTab(float dx, dy=0)
- Exported C Functions
- Enumerated Types
- Member Functions
- Desktop module
- Global Functions
- void InitDesktop(void)
- void ShutdownDesktop(void)
- void AddWorkspace(int32 index=-1)
- void DeleteWorkspace(int32 index)
- int32 CountWorkspaces(void)
- void SetWorkspaceCount(int32 count)
- int32 CurrentWorkspace(screen_id screen=B_MAIN_SCREEN_ID)
- void SetWorkspace(int32 workspace, screen_id screen=B_MAIN_SCREEN_ID)
- void SetScreen(screen_id id)
- int32 CountScreens(void)
- screen_id ActiveScreen(void)
- DisplayDriver *GetGfxDriver(screen_id screen=B_MAIN_SCREEN_ID)
- status_t SetSpace(int32 index, int32 res, bool stick=true, screen_id screen=B_MAIN_SCREEN_ID)
- void AddWindowToDesktop(ServerWindow *win, int32 workspace=B_CURRENT_WORKSPACE, screen_id screen=B_MAIN_SCREEN_ID)
- 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)
- void set_drag_message(int32 size, int8 *flattened)
- int8* get_drag_message(int32 *size)
- void empty_drag_ message(void)
- Namespaces
- Global Functions
- Screen class
- Member Functions
- Screen(DisplayDriver *gfxmodule, uint8 workspaces)
- ~Screen(void)
- void AddWorkspace(int32 index=-1)
- void DeleteWorkspace(int32 index)
- int32 CountWorkspaces(void)
- void SetWorkspaceCount(int32 count)
- int32 CurrentWorkspace(void)
- void SetWorkspace(int32 workspace)
- void Activate(bool active=true)
- DisplayDriver *GetDriver(void)
- status_t SetSpace(int32 index, int32 res, bool stick=true)
- void AddWindow(ServerWindow *win, int32 workspace=B_CURRENT_WORKSPACE)
- void RemoveWindow(ServerWindow *win)
- ServerWindow *ActiveWindow(void)
- void SetActiveWindow(ServerWindow *win)
- Layer *GetRootLayer(int32 workspace=B_CURRENT_WORKSPACE)
- bool IsInitialized(void)
- Workspace *GetActiveWorkspace(void)
- Workspace class members
- RootLayer class members
- Member Functions
- DisplayDriver class
- Member Functions
- DisplayDriver(void)
- ~DisplayDriver(void)
- bool Initialize(void)
- void Shutdown(void)
- void CopyBits(BRect src, BRect dest)
- void InvertRect(BRect r)
- void DrawBitmap(ServerBitmap *bmp, BRect src, BRect dest, render_mode mode)
- void DrawPicture(SPicture *pic, BPoint pt)
- void DrawChar(char c, BPoint pt)
- void DrawString(const char *string, int32 length, BPoint pt, escapement_delta *delta=NULL)
- void StrokeArc(BRect r, float angle, float span, layerdata *d, int8 *pattern)
- void FillArc(BRect r, float angle, float span, layerdata *d, int8 *pattern)
- void StrokeBezier(BPoint *pts, layerdata *d, int8 *pat)
- void FillBezier(BPoint *pts, layerdata *d, int8 *pat)
- void StrokeEllipse(BRect r, layerdata *d, int8 *pattern)
- void FillEllipse(BRect r, layerdata *d, int8 *pattern)
- void StrokeLine(BPoint start, BPoint end, layerdata *d, int8 *pattern)
- void StrokeLineArray(BPoint *pts, int32 numlines, rgb_color *colors, layerdata *d)
- void StrokePolygon(BPoint *ptlist, int32 numpts, BRect rect, layerdata *d, int8 *pattern, bool is_closed=true)
- void FillPolygon(BPoint *ptlist, int32 numpts, BRect rect, layerdata *d, int8 *pattern)
- void StrokeRect(BRect r, layerdata *d, int8 *pattern)
- void FillRect(BRect r, layerdata *d, int8 *pattern)
- void StrokeRoundRect(BRect r, float xrad, float yrad, layerdata *d, int8 *pattern)
- void FillRoundRect(BRect r, float xrad, float yrad, layerdata *d, int8 *pattern)
- void StrokeShape(SShape *sh, layerdata *d, int8 *pattern)
- void FillShape(SShape *sh, layerdata *d, int8 *pattern)
- void StrokeTriangle(BPoints *pts, BRect r, layerdata *d, int8 *pattern)
- void FillTriangle(BPoints *pts, BRect r, layerdata *d, int8 *pattern)
- void ShowCursor(void)
- 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)
- Protected Functions
- uint8 GetDepth(void)
- uint16 GetHeight(void)
- uint16 GetWidth(void)
- screen_mode GetMode(void)
- void SetMode(screen_mode mode)
- bool DumpToFile(const char *path)
- void Lock(void)
- void Unlock(void)
- void SetDepthInternal(uint8 d)
- void SetHeightInternal(uint16 h)
- void SetWidthInternal(uint16 w)
- void SetModeInternal(int32 m)
- void SetCursorHidden(bool state)
- void SetCursorObscured(bool state)
- bool IsCursorObscured(void)
- Member Functions
- Layer class
- 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 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)
- Member Functions
- PatternHandler class
- RGBColor class
- Member Functions
- RGBColor(uint8 r, uint8 g, uint8 b, uint8 a=255)
- RGBColor(rgb_color col)
- RGBColor(uint16 color16)
- RGBColor(uint8 color8)
- RGBColor(const RGBColor &color)
- RGBColor(void)
- void PrintToStream(void)
- uint8 GetColor8(void)
- uint16 GetColor16(void)
- rgb_color GetColor32(void)
- void SetColor(const RGBColor &color)
- void SetColor(uint8 r, uint8 g, uint8 b, uint8 a=255)
- void SetColor(rgb_color col)
- void SetColor(uint16 color16)
- void SetColor(uint8 color8)
- RGBColor & operator=(const RGBColor &from)
- bool operator==(const RGBColor &from)
- bool operator!=(const RGBColor &from)
- RGBColor MakeBlendColor(RGBColor c, float position)
- Member Functions
- ServerBitmap class
- SystemPalette class
- Member Functions
- SystemPalette(void)
- ~SystemPalette(void)
- void SetPalette(uint8 index, RGBColor col), void SetPalette(uint8 index, rgb_color col)
- RGBColor GetPalette(uint8 index)
- void SetGUIColor(color_which which, RGBColor col)
- RGBColor GetGUIColor(color_which which)
- color_set GetGUIColors(void)
- void SetGUIColors(color_set cset)
- protected: void _GenerateSystemPalette(rgb_color *palette)
- protected: void _SetDefaultGUIColors(void)
- Structures
- Member Functions
- WinBorder class : public Layer
- Member Functions
- WinBorder(BRect r, const char *name, int32 resize, int32 flags, ServerWindow *win)
- ~WinBorder(void)
- void RequestDraw(void)
- void MoveBy(BPoint pt), void MoveBy(float x, float y)
- void ResizeBy(BPoint pt), void ResizeBy(float x, float y)
- void MouseDown(int8 *buffer)
- void MouseUp(int8 *buffer)
- void MouseMoved(int8 *buffer)
- void UpdateDecorator(void)
- void UpdateColors(void)
- void UpdateFont(void)
- void UpdateScreen(void)
- void RebuildRegions(bool recursive=true)
- void Activate(bool state)
- Global Functions
- Namespaces
- Member Functions
Font Infrastructure
- FontServer class
- Member Functions
- FontServer(void)
- ~FontServer(void)
- void Lock(void), void Unlock(void)
- void SaveList(void)
- status_t ScanDirectory(const char *path)
- FontStyle *GetFont(font_family family, font_style face)
- FontInstance *GetInstance(font_family family, font_style face, int16 size, int16 rotation, int16 shear)
- int32 CountFamilies(void)
- status_t IsInitialized(void)
- int32 CountStyles(font_family family)
- FontStyle *GetStyle(font_family family, font_style style)
- 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)
- bool SetSystemBold(const char *family, const char *style, float size)
- bool SetSystemFixed(const char *family, const char *style, float size)
- void RemoveUnusedFamilies(void)
- bool FontsNeedUpdated(void)
- Member Functions
- FontFamily class