💾 Archived View for lofi.haiku-os.org › docs › develop › servers › app_server › toc.gmi captured on 2023-09-28 at 15:58:39. Gemini links have been rewritten to link to archived content

View Raw

More Information

-=-=-=-=-=-=-

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.

App server components

Graphics

Design overview

Desktop Initialization

Load Accelerant

Set up workspaces

Display

Window management

ServerApps

ServerWindows

Layers

WindowBorders

Decorators

How It All Works

Screen Updates

Managing invalidation

Getting things drawn on screen

Offscreen views

Overlays

Cursor Management

Display Drivers

Process Management

BApplication execution

non-BApplication execution

Killing/Exiting Applications

System Shutdown

Input Processing

Input Server messages

Mouse

B_MOUSE_DOWN

B_MOUSE_UP

B_MOUSE_MOVED

B_MOUSE_WHEEL_CHANGED

Keyboard

B_KEY_DOWN

B_KEY_UP

B_UNMAPPED_KEY_DOWN

B_UNMAPPED_KEY_UP

B_MODIFIERS_CHANGED

Messaging

Inter-Application Messaging

Drag-and-drop

Methods

Multiple Monitor Support Spec

Class Descriptions

Application Management

AppServer class

Member Functions

Global Functions

AppServer(void)

~AppServer(void)

void MainLoop(void)

void DispatchMessage(int32 code, int8 *buffer)

CREATE_APP

DELETE_APP

GET_SCREEN_MODE

B_QUIT_REQUESTED

SET_DECORATOR

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)

B_KEY_DOWN

B_KEY_UP

B_UNMAPPED_KEY_DOWN

B_UNMAPPED_KEY_UP

B_MODIFIERS_CHANGED

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)

CREATE_WINDOW

DELETE_APP

SET_CURSOR_DATA

SET_CURSOR_BCURSOR

B_QUIT_REQUESTED

UPDATE_DECORATOR

void WindowBroadcast(int32 code)

void Lock(void), void Unlock(void), bool IsLocked(void)

SharedObject class

Member Functions

TokenHandler class

Member Functions

TokenHandler(void)

~TokenHandler(void)

int32 GetToken(void)

void Reset(void)

void ExcludeValue(int32 value)

void ResetExcludes(void)

bool IsExclude(int32 value)

Debug Utility functions

Graphics Management

BitmapManager class

Member Functions

BitmapManager(void)

~BitmapManager(void)

ServerBitmap *CreateBitmap(BRect bounds, color_space space, int32 flags, int32 bytes_per_row=-1, screen_id screen=B_MAIN_SCREEN_ID)

void DeleteBitmap(ServerBitmap *bitmap)

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)

CursorManager class

Enumerated Types

cursor_which

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

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

extern “C” float get_decorator_version(void)

Enumerated Types

click_type

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

desktop_private

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

Workspace(void)

~Workspace(void)

void SetBGColor(const RGBColor &c)

RGBColor BGColor(void)

RootLayer *GetRoot(void)

void SetData(graphics_card_info *gcinfo, frame_buffer_info *fbinfo)

void GetData(graphics_card_info *gcinfo, frame_buffer_info *fbinfo)

RootLayer class members

~RootLayer(void)

void RequestDraw(const BRect &r)

void MoveBy(BPoint pt), void MoveBy(float x, float y)

void SetDriver(DisplayDriver *d)

void RebuildRegions(bool recursive=false)

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)

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)

PatternHandler class

Enumerated Types

pattern_enum

Member Functions

PatternHandler()

~PatternHandler()

void SetTarget(int8 *pattern)

void SetColors(RGBColor c1, RGBColor c2)

RGBColor GetColor(BPoint pt) RGBColor GetColor (float x, float y)

bool GetValue(BPoint pt) bool GetValue (float x, float y)

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)

ServerBitmap class

Member Functions

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

~ServerBitmap(void)

uint8 *Bits(void)

area_id Area(void)

uint32 BitsLength(void)

BRect Bounds(void)

int32 BytesPerRow(void)

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

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)

Grays:

Blues:

Reds:

Greens:

protected: void _SetDefaultGUIColors(void)

Structures

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

bool is_moving_window(void), void set_is_moving_window(bool state)

bool is_resizing_window(void), void set_is_resizing_window(bool state)

void set_active_winborder(WinBorder *win), WinBorder * get_active_winborder(void)

Namespaces

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)

FontFamily class

Member Functions

FontFamily(const char *name)

~FontFamily(void)

const char *GetName(void)

void AddStyle(const char *path, FT_Face face)

void RemoveStyle(const char *style)

FontStyle *GetStyle(const char *style)

const char *GetStyle(int32 index)

int32 CountStyles(void)

bool HasStyle(const char *stylename)