haiku-website/static/legacy-docs/bebook/TheInterfaceKit_Functions.html

294 lines
40 KiB
HTML
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>The Be Book - Classes And Methods - The Interface Kit</title><link rel="stylesheet" href="be_book.css" type="text/css" media="all" /><link rel="shortcut icon" type="image/vnd.microsoft.icon" href="./images/favicon.ico" /><!--[if IE]>
<link rel="stylesheet" type="text/css" href="be_book_ie.css" />
<![endif]--><meta name="generator" content="DocBook XSL Stylesheets V1.73.2" /><meta name="keywords" content="Access, BeOS, BeBook, API" /><link rel="start" href="index.html" title="The Be Book" /><link rel="up" href="TheInterfaceKit.html" title="The Interface Kit" /><link rel="prev" href="BWindow.html" title="BWindow" /><link rel="next" href="TheInterfaceKit_GeneralConstants.html" title="General Constants" /></head><body><div id="header"><div id="headerT"><div id="headerTL"><a accesskey="p" href="BWindow.html" title="BWindow"><img src="./images/navigation/prev.png" alt="Prev" /></a> <a accesskey="u" href="TheInterfaceKit.html" title="The Interface Kit"><img src="./images/navigation/up.png" alt="Up" /></a> <a accesskey="n" href="TheInterfaceKit_GeneralConstants.html" title="General Constants"><img src="./images/navigation/next.png" alt="Next" /></a></div><div id="headerTR"><div id="navigpeople"><a href="http://www.haiku-os.org"><img src="./images/People_24.png" alt="haiku-os.org" title="Visit The Haiku Website" /></a></div><div class="navighome" title="Home"><a accesskey="h" href="index.html"><img src="./images/navigation/home.png" alt="Home" /></a></div><div class="navigboxed" id="navigindex"><a accesskey="i" href="ClassIndex.html" title="Index">I</a></div><div class="navigboxed" id="naviglang" title="English">en</div></div><div id="headerTC">The Be Book - Classes And Methods - The Interface Kit</div></div><div id="headerB">Prev: <a href="BWindow.html">BWindow</a>  Up: <a href="TheInterfaceKit.html">The Interface Kit</a>  Next: <a href="TheInterfaceKit_GeneralConstants.html">General Constants</a></div><hr /></div><div class="section"><div xmlns="" xmlns:d="http://docbook.org/ns/docbook" class="titlepage"><div><div xmlns:d="http://docbook.org/ns/docbook"><h2 xmlns="http://www.w3.org/1999/xhtml" class="title"><a id="TheInterfaceKit_Functions"></a>Functions</h2></div></div></div><p>
This section describes the global C functions defined in the Interface
Kit. All these functions deal with aspects of the system-wide environment
for the user interface—the screen, workspaces, installed fonts, the
list of possible colors, and various user preferences. For mouse and
keyboard functions, see
"<a class="link" href="TheInputServer_Functions.html" title="Functions">Input Functions</a>"
in <a class="link" href="TheInputServer.html" title="The Input Server">The Input Server</a>.
</p><p>
In almost all cases, you need a valid (but not necessarily running)
<code class="varname">be_app</code> object in order to call these functions.
</p><div class="section"><div xmlns="" xmlns:d="http://docbook.org/ns/docbook" class="titlepage"><div><hr /><div xmlns:d="http://docbook.org/ns/docbook"><h3 xmlns="http://www.w3.org/1999/xhtml" class="title"><a id="activate_workspace"></a><a id="current_workspace"></a>
activate_workspace(), current_workspace()</h3></div></div></div><a id="id1083102" class="indexterm"></a><a id="id1083109" class="indexterm"></a><code class="methodsynopsis c"><span class="type">void </span><span class="methodname">activate_workspace</span>(<span class="methodparam"><span class="type">int32 </span><span class="parameter">workspace</span></span>);</code><code class="methodsynopsis c"><span class="type">int32 </span><span class="methodname">current_workspace</span>();</code><p>Declared in: <code class="filename">interface/InterfaceDefs.h</code></p><p>These functions set and return the active workspace, the one that's
currently displayed on-screen. The workspace is identified by an index,
0-based.</p><p>See also:
<a class="link" href="BWindow.html#BWindow_WorkspaceActivated" title="WorkspaceActivated()"><code class="methodname">BWindow::WorkspaceActivated()</code></a></p></div><div class="section"><div xmlns="" xmlns:d="http://docbook.org/ns/docbook" class="titlepage"><div><hr /><div xmlns:d="http://docbook.org/ns/docbook"><h3 xmlns="http://www.w3.org/1999/xhtml" class="title"><a id="bitmaps_support_space"></a>bitmaps_support_space()</h3></div></div></div><a id="id1083191" class="indexterm"></a><code class="methodsynopsis c"><span class="type">bool </span><span class="methodname">bitmaps_support_space</span>(<span class="methodparam"><span class="type">color_space </span><span class="parameter">space</span></span>,<br />                           <span class="methodparam"><span class="type">uint32* </span><span class="parameter">supportFlags</span></span>);</code><p>Declared in: <code class="filename">interface/InterfaceDefs.h</code></p><p>
Returns <code class="constant">true</code> if
<a class="link" href="BBitmap.html" title="BBitmap"><code class="classname">BBitmap</code></a>s
can contain graphics in the specified color
space, or <code class="constant">false</code> if not.
</p><p>
The <span class="type">uint32</span> pointed to by <code class="parameter">supportFlags</code> will be set to a bit field of
flags, further describing the support for the specified color space by
the <a class="link" href="BBitmap.html" title="BBitmap"><code class="classname">BBitmap</code></a>s class. The flags are:
</p><table class="variablelist constants"><thead><tr><th>Constant</th><th>Description</th></tr></thead><tbody><tr><td><p><span class="term"><code class="constant">B_VIEWS_SUPPORT_DRAW_BITMAP</code></span></p></td><td><p><a class="link" href="BView.html#BView_DrawBitmap" title="DrawBitmap(), DrawBitmapAsync()"><code class="methodname">BView::DrawBitmap()</code></a>
supports drawing
<a class="link" href="BBitmap.html" title="BBitmap"><code class="classname">BBitmap</code></a>s
of the specified color space.</p></td></tr><tr><td><p><span class="term"><code class="constant">B_BITMAPS_SUPPORT_ATTACHED_VIEWS</code></span></p></td><td><p>Indicates that <a class="link" href="BBitmap.html" title="BBitmap"><code class="classname">BBitmap</code></a>s
in the specified color space support attached
<a class="link" href="BView.html" title="BView"><code class="classname">BView</code></a>s.</p></td></tr></tbody></table></div><div class="section"><div xmlns="" xmlns:d="http://docbook.org/ns/docbook" class="titlepage"><div><hr /><div xmlns:d="http://docbook.org/ns/docbook"><h3 xmlns="http://www.w3.org/1999/xhtml" class="title"><a id="get_deskbar_frame"></a>get_deskbar_frame()</h3></div></div></div><a id="id1083627" class="indexterm"></a><code class="methodsynopsis c"><span class="type">status_t </span><span class="methodname">get_deskbar_frame</span>(<span class="methodparam"><span class="type">color_space </span><span class="parameter">space</span></span>,<br />                           <span class="methodparam"><span class="type"><a class="link" href="BRect.html" title="BRect"><code class="classname">BRect</code></a>* </span><span class="parameter">frame</span></span>);</code><p>Declared in: <code class="filename">interface/InterfaceDefs.h</code></p><p>Writes the screen coordinates of the current frame of the Deskbar window
into <code class="parameter">frame</code>. Returns <code class="constant">B_OK</code>
on success or an appropriate error code on
failure.</p></div><div class="section"><div xmlns="" xmlns:d="http://docbook.org/ns/docbook" class="titlepage"><div><hr /><div xmlns:d="http://docbook.org/ns/docbook"><h3 xmlns="http://www.w3.org/1999/xhtml" class="title"><a id="get_font_family"></a><a id="count_font_families"></a>
<a id="get_font_style"></a>
<a id="count_font_styles"></a>
get_font_family(), count_font_families(), get_font_style(),
count_font_styles()</h3></div></div></div><a id="id1083718" class="indexterm"></a><a id="id1083725" class="indexterm"></a><a id="id1083732" class="indexterm"></a><a id="id1083739" class="indexterm"></a><code class="methodsynopsis c"><span class="type">status_t </span><span class="methodname">get_font_family</span>(<span class="methodparam"><span class="type">int32 </span><span class="parameter">index</span></span>,<br />                         <span class="methodparam"><span class="type">font_family* </span><span class="parameter">family</span></span>,<br />                         <span class="methodparam"><span class="type">uint32* </span><span class="parameter">flags</span><span class="initializer"> = <span class="constant">NULL</span></span></span>);</code><code class="methodsynopsis c"><span class="type">int32 </span><span class="methodname">count_font_families</span>();</code><code class="methodsynopsis c"><span class="type">status_t </span><span class="methodname">get_font_style</span>(<span class="methodparam"><span class="type">font_family </span><span class="parameter">family</span></span>,<br />                        <span class="methodparam"><span class="type">int32 </span><span class="parameter">index</span></span>,<br />                        <span class="methodparam"><span class="type">font_style* </span><span class="parameter">style</span></span>,<br />                        <span class="methodparam"><span class="type">uint32* </span><span class="parameter">flags</span><span class="initializer"> = <span class="constant">NULL</span></span></span>);</code><code class="methodsynopsis c"><span class="type">int32 </span><span class="methodname">count_font_styles</span>(<span class="methodparam"><span class="type">font_family </span><span class="parameter">family</span></span>);</code><p>Declared in: <code class="filename">interface/Font.h</code></p><p>
These functions are used in combination to get the names of the families
and styles of all installed fonts. For example:
</p><pre class="programlisting example cpp"><span class="type">int32</span> <code class="varname">numFamilies</code> = <code class="function">count_font_families</code>();
for ( <span class="type">int32</span> <code class="varname">i</code> = 0; <code class="varname">i</code> &lt; <code class="varname">numFamilies</code>; <code class="varname">i</code>++ ) {
<span class="type">font_family</span> <code class="varname">family</code>;
<span class="type">uint32</span> <code class="varname">flags</code>;
if ( <code class="function">get_font_family</code>(<code class="varname">i</code>, &amp;<code class="varname">family</code>, &amp;<code class="varname">flags</code>) == <code class="constant">B_OK</code> ) {
. . .
<span class="type">int32</span> <code class="varname">numStyles</code> = <code class="function">count_font_styles</code>(<code class="varname">family</code>);
for ( <span class="type">int32</span> <code class="varname">j</code> = 0; <code class="varname">j</code> &lt; <code class="varname">numStyles</code>; <code class="varname">j</code>++ ) {
<span class="type">font_style</span> <code class="varname">style</code>;
if ( <code class="function">get_font_style</code>(<code class="varname">family</code>, <code class="varname">j</code>, &amp;<code class="varname">style</code>, &amp;<code class="varname">flags</code>) == <code class="constant">B_OK</code> ) {
. . .
}
}
}
}</pre><p>
<code class="function">get_font_family()</code> reads one family name from the list of installed fonts,
the name at <code class="parameter">index</code>, and copies it into the <code class="parameter">family</code> buffer;
<code class="function">count_font_families()</code> returns the number of font families currently
installed. Similarly, <code class="function">get_font_style()</code> reads the name of the style at
<code class="parameter">index</code> and copies into the <code class="parameter">style</code>
buffer. Since each family can have a
different set of styles, a family name must be passed to
<code class="function">get_font_style()</code>; <code class="function">count_font_styles()</code>
returns the number of styles for
the particular <code class="parameter">family</code>. Family and style names can be up to 64 bytes long
including a null terminator. Indices begin at 0.
</p><p>
The names of installed font families and styles are not indexed in any
particular order. You might want to alphabetize them before displaying
them to the user in a menu or list.
</p><p>
If you pass a <code class="parameter">flags</code> argument to <code class="function">get_font_family()</code>
and <code class="function">get_font_style()</code>,
they will place a mask with useful information about the particular
family or style in the variable that the argument refers to. Currently
there are just two flags:
</p><table class="variablelist constants"><thead><tr><th>Constant</th><th>Description</th></tr></thead><tbody><tr><td><p><span class="term"><code class="constant">B_IS_FIXED</code></span></p></td><td><p>Indicates that the font is a nonproportional, or fixed-width,
font—one for which all characters have the same width.</p></td></tr><tr><td><p><span class="term"><code class="constant">B_HAS_TUNED_FONT</code></span></p></td><td><p>Indicates that the family or style has versions of the
font especially adapted or "tuned" for on-screen display.</p></td></tr></tbody></table><p>
If neither flag applies, the variable that <code class="parameter">flags</code> points to will be set to
0.
</p><p>
If you find a family and style that has a tuned font, you can set a
<a class="link" href="BFont.html" title="BFont"><code class="classname">BFont</code></a>
object to that family and style, then call the object's
<a class="link" href="BFont.html#BFont_GetTunedInfo" title="GetTunedInfo(), CountTuned(), tuned_font_info"><code class="methodname">GetTunedInfo()</code></a>
function to get details about exactly which combination of font
properties (for example, which font sizes) have tuned counterparts. If
you set a <a class="link" href="BFont.html" title="BFont"><code class="classname">BFont</code></a>
so that it has those properties and make it a
<a class="link" href="BView.html" title="BView"><code class="classname">BView</code></a>'s
current font, the tuned version will be used when the
<a class="link" href="BView.html" title="BView"><code class="classname">BView</code></a> draws to the
screen.
</p><p>
It's possible for the user to install or remove fonts while the
application is running. However, unless
<a class="link" href="TheInterfaceKit_Functions.html#update_font_families" title="update_font_families()"><code class="function">update_font_families()</code></a> has been
called to get the updated list, <code class="methodname">get_font_family()</code> will provide
information on the same set of fonts each time it's called. The list
isn't automatically updated.
</p><p>
See also:
<a class="link" href="TheInterfaceKit_Functions.html#update_font_families" title="update_font_families()"><code class="function">update_font_families()</code></a>,
<a class="link" href="BView.html#BView_SetFont" title="SetFont(), GetFont()"><code class="methodname">BView::SetFont()</code></a>,
<a class="link" href="BFont.html#BFont_SetFamilyAndStyle" title="SetFamilyAndStyle(), GetFamilyAndStyle(), FamilyAndStyle(), font_family, font_style"><code class="methodname">BFont::SetFamilyAndStyle()</code></a>
</p></div><div class="section"><div xmlns="" xmlns:d="http://docbook.org/ns/docbook" class="titlepage"><div><hr /><div xmlns:d="http://docbook.org/ns/docbook"><h3 xmlns="http://www.w3.org/1999/xhtml" class="title"><a id="get_pixel_size_for"></a>get_pixel_size_for()</h3></div></div></div><a id="id1084256" class="indexterm"></a><code class="methodsynopsis c"><span class="type">status_t </span><span class="methodname">get_pixel_size_for</span>(<span class="methodparam"><span class="type">color_space </span><span class="parameter">space</span></span>,<br />                            <span class="methodparam"><span class="type">size_t* </span><span class="parameter">pixelChunk</span></span>,<br />                            <span class="methodparam"><span class="type">size_t* </span><span class="parameter">rowAlignment</span></span>,<br />                            <span class="methodparam"><span class="type">size_t* </span><span class="parameter">pixelsPerChunk</span></span>);</code><p>Declared in: <code class="filename">interface/GraphicsDefs.h</code></p><p>Given the specified color space, returns information about pixel and row
alignment for that color space.</p></div><div class="section"><div xmlns="" xmlns:d="http://docbook.org/ns/docbook" class="titlepage"><div><hr /><div xmlns:d="http://docbook.org/ns/docbook"><h3 xmlns="http://www.w3.org/1999/xhtml" class="title"><a id="idle_time"></a>idle_time()</h3></div></div></div><a id="id1084337" class="indexterm"></a><code class="methodsynopsis c"><span class="type">bigtime_t </span><span class="methodname">idle_time</span>();</code><p>Declared in: <code class="filename">interface/InterfaceDefs.h</code></p><p>
Returns the number of microseconds since the user last manipulated the
mouse or keyboard. This information isn't specific to a particular
application; <code class="function">idle_time()</code> tells you when the user
last directed an action at any application, not just yours.
</p></div><div class="section"><div xmlns="" xmlns:d="http://docbook.org/ns/docbook" class="titlepage"><div><hr /><div xmlns:d="http://docbook.org/ns/docbook"><h3 xmlns="http://www.w3.org/1999/xhtml" class="title"><a id="keyboard_navigation_color"></a>keyboard_navigation_color()</h3></div></div></div><a id="id1084391" class="indexterm"></a><p>
Declared in: <code class="filename">interface/InterfaceDefs.h</code>
</p><code class="methodsynopsis c"><span class="type">rgb_color </span><span class="methodname">keyboard_navigation_color</span>();</code><p>
Returns the color that should be used to mark the
<a class="link" href="BView.html" title="BView"><code class="classname">BView</code></a> that's currently
in focus, when the user can change the focus from the keyboard. The
keyboard navigation color is typically used to underline the labels of
control devices and to outline text fields where the user can type.
</p></div><div class="section"><div xmlns="" xmlns:d="http://docbook.org/ns/docbook" class="titlepage"><div><hr /><div xmlns:d="http://docbook.org/ns/docbook"><h3 xmlns="http://www.w3.org/1999/xhtml" class="title"><a id="run_add_printer_panel"></a><a id="run_select_printer_panel"></a>
run_add_printer_panel(), run_select_printer_panel()</h3></div></div></div><a id="id1084456" class="indexterm"></a><a id="id1084463" class="indexterm"></a><code class="methodsynopsis c"><span class="type">void </span><span class="methodname">run_add_printer_panel</span>();</code><code class="methodsynopsis c"><span class="type">void </span><span class="methodname">run_select_printer_panel</span>();</code><p>Declared in: <code class="filename">interface/InterfaceDefs.h</code></p><p>
These two functions have the Print Server place panels on-screen where
the user can set up a printer and choose which printer to use.
<code class="function">run_add_printer_panel()</code> displays a panel that informs the server about a
new printer. <code class="function">run_select_printer_panel()</code> displays a panel that lists all
known printers and lets the user select one.
</p><p>
See also:
The <a class="link" href="BPrintJob.html" title="BPrintJob"><code class="classname">BPrintJob</code></a> class
</p></div><div class="section"><div xmlns="" xmlns:d="http://docbook.org/ns/docbook" class="titlepage"><div><hr /><div xmlns:d="http://docbook.org/ns/docbook"><h3 xmlns="http://www.w3.org/1999/xhtml" class="title"><a id="set_menu_info"></a><a id="get_menu_info"></a>
set_menu_info(), get_menu_info()</h3></div></div></div><a id="id1084553" class="indexterm"></a><a id="id1084560" class="indexterm"></a><code class="methodsynopsis c"><span class="type">status_t </span><span class="methodname">set_menu_info</span>(<span class="methodparam"><span class="type">menu_info* </span><span class="parameter">info</span></span>);</code><code class="methodsynopsis c"><span class="type">status_t </span><span class="methodname">get_menu_info</span>(<span class="methodparam"><span class="type">menu_info* </span><span class="parameter">info</span></span>);</code><p>Declared in: <code class="filename">interface/Menu.h</code></p><p>These functions set and get the user's preferences for how menus should
look and work. User's express their preferences with the Menu
application, which calls <code class="function">set_menu_info()</code>.
<code class="function">get_menu_info()</code> writes the
current preferences into the <span class="type">menu_info</span> structure that into refers to.
This structure contains the following fields:</p><table class="variablelist fields"><thead><tr><th>Field</th><th>Description</th></tr></thead><tbody><tr><td><p><span class="term"><span class="type">float</span> <code class="varname">font_size</code></span></p></td><td><p>
The size of the font that will be used to display menu items.
</p></td></tr><tr><td><p><span class="term"><span class="type">font_name</span> <code class="varname">font</code></span></p></td><td><p>
The name of the font that's used to display menu items.
</p></td></tr><tr><td><p><span class="term"><span class="type">rgb_color</span> <code class="varname">background_color</code></span></p></td><td><p>
The background color of the menu.
</p></td></tr><tr><td><p><span class="term"><span class="type">int32</span> <code class="varname">separator</code></span></p></td><td><p>
The style of horizontal line that separates groups of items in a menu.
The value is an index ranging from 0 through 2; there are three possible
separators.
</p></td></tr><tr><td><p><span class="term"><span class="type">bool</span> <code class="varname">click_to_open</code></span></p></td><td><p>
Whether it's possible to open a menu by clicking in the item that
controls it. The default value is true.
</p></td></tr><tr><td><p><span class="term"><span class="type">bool</span> <code class="varname">triggers_always_shown</code></span></p></td><td><p>
Whether trigger characters are always marked in menus and menu bars,
regardless of whether the menu hierarchy is the target for keyboard
actions. The default value is false.
</p></td></tr></tbody></table><p>
(At present, both functions always return <code class="constant">B_OK</code>.)
</p><p>
See also:
The <a class="link" href="BMenu.html" title="BMenu"><code class="classname">BMenu</code></a> class
</p></div><div class="section"><div xmlns="" xmlns:d="http://docbook.org/ns/docbook" class="titlepage"><div><hr /><div xmlns:d="http://docbook.org/ns/docbook"><h3 xmlns="http://www.w3.org/1999/xhtml" class="title"><a id="set_screen_space"></a>set_screen_space()</h3></div></div></div><a id="id1084786" class="indexterm"></a><code class="methodsynopsis c"><span class="type">status_t </span><span class="methodname">set_screen_space</span>(<span class="methodparam"><span class="type">int32 </span><span class="parameter">index</span></span>,<br />                          <span class="methodparam"><span class="type">uint32 </span><span class="parameter">space</span></span>,<br />                          <span class="methodparam"><span class="type">bool </span><span class="parameter">makeDefault</span><span class="initializer"> = <span class="constant">true</span></span></span>);</code><p>Declared in: <code class="filename">interface/InterfaceDefs.h</code></p><p>
Changes the configuration of the screen—its depth and
dimensions—to match the values specified in the <code class="parameter">space</code> constant,
which can be any of the following:
</p><ul class="itemizedlist nomarker"><li><p><code class="constant">B_8_BIT_640x400</code></p></li><li><p><code class="constant">B_8_BIT_640x480</code></p></li><li><p><code class="constant">B_8_BIT_800x600</code></p></li><li><p><code class="constant">B_8_BIT_1024x768</code></p></li><li><p><code class="constant">B_8_BIT_1152x900</code></p></li><li><p><code class="constant">B_8_BIT_1280x1024</code></p></li><li><p><code class="constant">B_8_BIT_1600x1200</code></p></li><li><p><code class="constant">B_15_BIT_640x480</code></p></li><li><p><code class="constant">B_15_BIT_800x600</code></p></li><li><p><code class="constant">B_15_BIT_1024x768</code></p></li><li><p><code class="constant">B_15_BIT_1152x900</code></p></li><li><p><code class="constant">B_15_BIT_1280x1024</code></p></li><li><p><code class="constant">B_15_BIT_1600x1200</code></p></li><li><p><code class="constant">B_16_BIT_640x480</code></p></li><li><p><code class="constant">B_16_BIT_800x600</code></p></li><li><p><code class="constant">B_16_BIT_1024x768</code></p></li><li><p><code class="constant">B_16_BIT_1152x900</code></p></li><li><p><code class="constant">B_16_BIT_1280x1024</code></p></li><li><p><code class="constant">B_16_BIT_1600x1200</code></p></li><li><p><code class="constant">B_32_BIT_640x480</code></p></li><li><p><code class="constant">B_32_BIT_800x600</code></p></li><li><p><code class="constant">B_32_BIT_1024x768</code></p></li><li><p><code class="constant">B_32_BIT_1152x900</code></p></li><li><p><code class="constant">B_32_BIT_1280x1024</code></p></li><li><p><code class="constant">B_32_BIT_1600x1200</code></p></li></ul><p>
The first part of the constant designates the screen depth and color space.
<code class="constant">B_8_BIT…</code> refers to the <code class="constant">B_CMAP8</code>
color space. The other values correspond to the
<code class="constant">B_RGB15</code>, <code class="constant">B_RGB16</code>, and
<code class="constant">B_RGB32</code> color spaces, as appropriate. Although
constants are defined for 15-bit screen depths, the operating system
currently doesn't support them. The second part of the constant designates
the pixel resolution of the screen. For example,
<code class="constant">B_32_BIT_1280x1024</code> means that the frame buffer is 32
bits deep (<code class="constant">B_RGB32</code>) while the screen grid is 1,280
pixels wide and 1,024 pixels high.
</p><p>
This function affects the screen at <code class="parameter">index</code>. Since the BeOS currently
doesn't support more than one screen, the only index that makes sense is
0.
</p><p>
The change to the screen takes effect immediately. If the
<code class="parameter">makeDefault</code> flag is <code class="constant">true</code>, the
new configuration also becomes the default and will be used the next time
the machine is turned on. If <code class="parameter">makeDefault</code> is
<code class="constant">false</code>, the configuration is in effect for the current
session only.
</p><p>
Since not all configurations are possible for all graphics cards,
<code class="function">set_screen_space()</code> can fail. It returns
<code class="constant">B_OK</code> if successful, and <code class="constant">B_ERROR</code>
if not.
</p><p>
This function is designed for preferences applications—like the
Screen application—that permit users to make system-wide choices
about the screen. Other applications should respect those choices and
refrain from modifying them.
</p><p>
The current screen configuration can be obtained from the
<a class="link" href="BScreen.html" title="BScreen"><code class="classname">BScreen</code></a> object.
</p><p>
See also:
<a class="link" href="BWindow.html#BWindow_ScreenChanged" title="ScreenChanged()"><code class="methodname">BWindow::ScreenChanged()</code></a>,
<a class="link" href="TheGameKit.html" title="The Game Kit">The Game Kit</a>
chapter
</p></div><div class="section"><div xmlns="" xmlns:d="http://docbook.org/ns/docbook" class="titlepage"><div><hr /><div xmlns:d="http://docbook.org/ns/docbook"><h3 xmlns="http://www.w3.org/1999/xhtml" class="title"><a id="set_scroll_bar_info"></a><a id="get_scroll_bar_info"></a>
set_scroll_bar_info(), get_scroll_bar_info()</h3></div></div></div><a id="id1085152" class="indexterm"></a><a id="id1085159" class="indexterm"></a><code class="methodsynopsis c"><span class="type">status_t </span><span class="methodname">set_scroll_bar_info</span>(<span class="methodparam"><span class="type">scroll_bar_info* </span><span class="parameter">info</span></span>);</code><code class="methodsynopsis c"><span class="type">status_t </span><span class="methodname">get_scroll_bar_info</span>(<span class="methodparam"><span class="type">scroll_bar_info* </span><span class="parameter">info</span></span>);</code><p>Declared in: <code class="filename">interface/InterfaceDefs.h</code></p><p>
These functions set and report preferences that the
<a class="link" href="BScrollBar.html" title="BScrollBar"><code class="classname">BScrollBar</code></a> class uses
when it creates a new scroll bar.
<code class="function">set_scroll_bar_info()</code> reads the values contained
in the <span class="type">scroll_bar_info</span> structure that
<code class="parameter">info</code> refers to and sets the system-wide preferences
accordingly; <code class="function">get_scroll_bar_info()</code> writes the
current preferences into the structure provided.
</p><p>
The <span class="type">scroll_bar_info</span> structure contains the following fields:
</p><table class="variablelist fields"><thead><tr><th>Field</th><th>Description</th></tr></thead><tbody><tr><td><p><span class="term"><span class="type">bool</span> <code class="varname">proportional</code></span></p></td><td><p>
<code class="constant">true</code> if scroll bars should have a knob that grows and shrinks to show
what proportion of the document is currently visible on-screen, and <code class="constant">false</code>
if not. Scroll knobs are proportional by default.
</p></td></tr><tr><td><p><span class="term"><span class="type">bool</span> <code class="varname">double_arrows</code></span></p></td><td><p>
<code class="constant">true</code> if a set of double arrows (for scrolling in both directions)
should appear at each end of the scroll bar, or <code class="constant">false</code> if only single
arrows (for scrolling in one direction only) should be used. Double
arrows are the default.
</p></td></tr><tr><td><p><span class="term"><span class="type">int32</span> <code class="varname">knob</code></span></p></td><td><p>
An index that picks the pattern for the knob. Only values of 0, 1, and
2 are currently valid. The patterns can be seen in the ScrollBar
preferences application. The pattern at index 1 is the default.
</p></td></tr><tr><td><p><span class="term"><span class="type">int32</span> <code class="varname">min_knob_size</code></span></p></td><td><p>
The length of the scroll knob, in pixels. This is the minimum size for
a proportional knob and the fixed size for one that's not proportional.
The default is 15.
</p></td></tr></tbody></table><p>
The user can set these preferences with the ScrollBar application.
Applications can call <code class="function">get_scroll_bar_info()</code> to find out what choices the
user made, but should refrain from calling <code class="function">set_scroll_bar_info()</code>. That
function is desigined for utilities, like the ScrollBar application, that
enable users to set preferences that are respected system-wide.
</p><p>
If successful, these functions return <code class="constant">B_OK</code>; if not,
they return <code class="constant">B_ERROR</code>.
</p><p>
See also:
The <a class="link" href="BScrollBar.html" title="BScrollBar"><code class="classname">BScrollBar</code></a> class
</p></div><div class="section"><div xmlns="" xmlns:d="http://docbook.org/ns/docbook" class="titlepage"><div><hr /><div xmlns:d="http://docbook.org/ns/docbook"><h3 xmlns="http://www.w3.org/1999/xhtml" class="title"><a id="set_workspace_count"></a><a id="count_workspaces"></a>
set_workspace_count(), count_workspaces()</h3></div></div></div><a id="id1085413" class="indexterm"></a><a id="id1085421" class="indexterm"></a><code class="methodsynopsis c"><span class="type">void </span><span class="methodname">set_workspace_count</span>(<span class="methodparam"><span class="type">int32 </span><span class="parameter">numWorkspaces</span></span>);</code><code class="methodsynopsis c"><span class="type">int32 </span><span class="methodname">count_workspaces</span>();</code><p>Declared in: <code class="filename">interface/InterfaceDefs.h</code></p><p>
These functions set and return the number of workspaces the user has
available. There can be as many as 32 workspaces and as few as 1. The
choice of how many there should be is usually left to the user and the
Workspaces application.
</p><p>
See also:
<a class="link" href="TheInterfaceKit_Functions.html#activate_workspace" title="activate_workspace(), current_workspace()"><code class="function">activate_workspace()</code></a>
</p></div><div class="section"><div xmlns="" xmlns:d="http://docbook.org/ns/docbook" class="titlepage"><div><hr /><div xmlns:d="http://docbook.org/ns/docbook"><h3 xmlns="http://www.w3.org/1999/xhtml" class="title"><a id="system_colors"></a>system_colors()</h3></div></div></div><a id="id1085505" class="indexterm"></a><code class="methodsynopsis c"><span class="type">const color_map* </span><span class="methodname">system_colors</span>();</code><p>Declared in: <code class="filename">interface/InterfaceDefs.h</code></p><p>
Returns a pointer to the system color map. This function duplicates the
<a class="link" href="BScreen.html" title="BScreen"><code class="classname">BScreen</code></a>
<a class="link" href="BScreen.html#BScreen_ColorMap" title="ColorMap(), IndexForColor(), ColorForIndex()"><code class="methodname">ColorMap()</code></a>
function, but it permits software that isn't concerned
about the on-screen display to get the color map without referring to a
particular screen. (Actually it returns the color map for the main
screen.)
</p><p>
The <span class="type">color_map</span> structure returned by this function belongs to the
operating system.
</p></div><div class="section"><div xmlns="" xmlns:d="http://docbook.org/ns/docbook" class="titlepage"><div><hr /><div xmlns:d="http://docbook.org/ns/docbook"><h3 xmlns="http://www.w3.org/1999/xhtml" class="title"><a id="tint_color"></a>tint_color()</h3></div></div></div><a id="id1085579" class="indexterm"></a><code class="methodsynopsis c"><span class="type">rgb_color </span><span class="methodname">tint_color</span>(<span class="methodparam"><span class="type">rgb_color </span><span class="parameter">color</span></span>,<br />                     <span class="methodparam"><span class="type">float </span><span class="parameter">tint</span></span>);</code><p>Declared in: <code class="filename">interface/InterfaceDefs.h</code></p><p><code class="function">tint_color()</code> lightens or darkens the color <code class="parameter">color</code>
by the <code class="parameter">tint</code> amount.</p><p>Tints less than 1.0 lighten the color and tints greater than 1.0 darken it.</p><p>Various <code class="parameter">tint</code> constants are defined by the Interface Kit
as seen <a class="link" href="TheInterfaceKit_Functions.html#tint_color" title="tint_color()">here</a>.</p></div><div class="section"><div xmlns="" xmlns:d="http://docbook.org/ns/docbook" class="titlepage"><div><hr /><div xmlns:d="http://docbook.org/ns/docbook"><h3 xmlns="http://www.w3.org/1999/xhtml" class="title"><a id="ui_color"></a>ui_color()</h3></div></div></div><a id="id1085669" class="indexterm"></a><code class="methodsynopsis c"><span class="type">rgb_color </span><span class="methodname">ui_color</span>(<span class="methodparam"><span class="type">color_which </span><span class="parameter">which</span></span>);</code><p>Declared in: <code class="filename">interface/InterfaceDefs.h</code></p><p>Converts the supplied
<a class="link" href="TheInterfaceKit_GeneralConstants.html#color_which" title="color_which Constants"><span class="type">color_which</span></a>
constant <code class="parameter">which</code> to the corresponding
<a class="link" href="TheInterfaceKit_DefinedTypes.html#rgb_color" title="rgb_color"><span class="type">rgb_color</span></a>
for the specified user interface element.</p></div><div class="section"><div xmlns="" xmlns:d="http://docbook.org/ns/docbook" class="titlepage"><div><hr /><div xmlns:d="http://docbook.org/ns/docbook"><h3 xmlns="http://www.w3.org/1999/xhtml" class="title"><a id="update_font_families"></a>update_font_families()</h3></div></div></div><a id="id1085741" class="indexterm"></a><code class="methodsynopsis c"><span class="type">bool </span><span class="methodname">update_font_families</span>(<span class="methodparam"><span class="type">bool </span><span class="parameter">update_font_families</span></span>);</code><p>Declared in: <code class="filename">interface/Font.h</code></p><p>
Updates the list of installed fonts, so that it reflects any that have
been added or removed since the last time the list was updated. Until the
list is updated,
<a class="link" href="TheInterfaceKit_Functions.html#get_font_family" title="get_font_family(), count_font_families(), get_font_style(), count_font_styles()"><code class="function">get_font_family()</code></a>
operates assuming the set of fonts
that were installed when the application started up. If the list is
unchanged since the last update (or since startup), this function returns
<code class="constant">false</code>; if a font has been installed or an installed font has been
removed, it returns <code class="constant">true</code>.
</p><p>
If the <code class="parameter">checkOnly</code> flag is <code class="constant">true</code>,
<a class="link" href="TheInterfaceKit_Functions.html#get_font_family" title="get_font_family(), count_font_families(), get_font_style(), count_font_styles()"><code class="function">get_font_family()</code></a>
only reports whether the
list has changed; it doesn't modify the current list. If the flag is
<code class="constant">false</code>, it contacts the Application Server to get the updated list, a much
more expensive operation.
</p></div></div><div id="footer"><hr /><div id="footerT">Prev: <a href="BWindow.html">BWindow</a>  Up: <a href="TheInterfaceKit.html">The Interface Kit</a>  Next: <a href="TheInterfaceKit_GeneralConstants.html">General Constants</a> </div><div id="footerB"><div id="footerBL"><a href="BWindow.html" title="BWindow"><img src="./images/navigation/prev.png" alt="Prev" /></a> <a href="TheInterfaceKit.html" title="The Interface Kit"><img src="./images/navigation/up.png" alt="Up" /></a> <a href="TheInterfaceKit_GeneralConstants.html" title="General Constants"><img src="./images/navigation/next.png" alt="Next" /></a></div><div id="footerBR"><div><a href="http://www.haiku-os.org"><img src="./images/People_24.png" alt="haiku-os.org" title="Visit The Haiku Website" /></a></div><div class="navighome" title="Home"><a accesskey="h" href="index.html"><img src="./images/navigation/home.png" alt="Home" /></a></div></div><div id="footerBC"><a href="http://www.access-company.com/home.html" title="ACCESS Co."><img alt="Access Company" src="./images/access_logo.png" /></a></div></div></div><div id="licenseFooter"><div id="licenseFooterBL"><a rel="license" href="http://creativecommons.org/licenses/by-nc-nd/3.0/" title="Creative Commons License"><img alt="Creative Commons License" style="border-width:0" src="https://licensebuttons.net/l/by-nc-nd/3.0/88x31.png" /></a></div><div id="licenseFooterBR"><a href="./LegalNotice.html">Legal Notice</a></div><div id="licenseFooterBC"><span id="licenseText">This work is licensed under a
<a rel="license" href="http://creativecommons.org/licenses/by-nc-nd/3.0/">Creative
Commons Attribution-Non commercial-No Derivative Works 3.0 License</a>.</span></div></div></body></html>