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

161 lines
33 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.

This file contains Unicode characters that might be confused with other characters. 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 Media 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="TheMediaKit.html" title="The Media Kit" /><link rel="prev" href="BMediaRoster.html" title="BMediaRoster" /><link rel="next" href="BMediaTrack.html" title="BMediaTrack" /></head><body><div id="header"><div id="headerT"><div id="headerTL"><a accesskey="p" href="BMediaRoster.html" title="BMediaRoster"><img src="./images/navigation/prev.png" alt="Prev" /></a> <a accesskey="u" href="TheMediaKit.html" title="The Media Kit"><img src="./images/navigation/up.png" alt="Up" /></a> <a accesskey="n" href="BMediaTrack.html" title="BMediaTrack"><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 Media Kit</div></div><div id="headerB">Prev: <a href="BMediaRoster.html">BMediaRoster</a>  Up: <a href="TheMediaKit.html">The Media Kit</a>  Next: <a href="BMediaTrack.html">BMediaTrack</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="BMediaTheme"></a>BMediaTheme</h2></div></div></div><a id="id1158608" class="indexterm"></a><div class="classheader"><table border="0"><colgroup><col /><col /></colgroup><tbody><tr><td><table width="100%" border="0"><colgroup><col /><col /></colgroup><tbody><tr><td>Derived From:</td><td></td></tr><tr><td>Mix-in Classes:</td><td></td></tr><tr><td>Declared In:</td><td><code class="filename">media/MediaTheme.h</code></td></tr><tr><td>Library:</td><td><code class="filename">libmedia.so</code></td></tr><tr><td>Allocation:</td><td>Constructor only</td></tr></tbody></table></td><td>
<a class="link overview" href="BMediaTheme_Overview.html" title="BMediaTheme">Class Overview</a>
<div class="toc"><ul><li><span class="section"><a href="BMediaTheme.html#BMediaTheme_ConstructorDestructor">Constructor and Destructor</a></span></li><li><span class="section"><a href="BMediaTheme.html#BMediaTheme_MemberFunctions">Member Functions</a></span></li><li><span class="section"><a href="BMediaTheme.html#BMediaTheme_Functions">Global C Functions</a></span></li><li><span class="section"><a href="BMediaTheme.html#BMediaTheme_Constants">Constants</a></span></li></ul></div>
</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="BMediaTheme_ConstructorDestructor"></a>Constructor and Destructor</h3></div></div></div><div class="section"><div xmlns="" xmlns:d="http://docbook.org/ns/docbook" class="titlepage"><div><div xmlns:d="http://docbook.org/ns/docbook"><h4 xmlns="http://www.w3.org/1999/xhtml" class="title"><a id="BMediaTheme_Constructor"></a>BMediaTheme()</h4></div><div xmlns:d="http://docbook.org/ns/docbook"><h5 xmlns="http://www.w3.org/1999/xhtml" class="subtitle">protected</h5></div></div></div><code class="constructorsynopsis cpp"><span class="methodname">BMediaTheme</span>(<span class="methodparam"><span class="modifier">const </span><span class="type">char* </span><span class="parameter">name</span></span>,<br />            <span class="methodparam"><span class="modifier">const </span><span class="type">char* </span><span class="parameter">info</span></span>,<br />            <span class="methodparam"><span class="modifier">const </span><span class="type">entry_ref* </span><span class="parameter">addOn</span><span class="initializer"> = <span class="constant">NULL</span></span></span>,<br />            <span class="methodparam"><span class="type">int32 </span><span class="parameter">themeID</span><span class="initializer"> = 0</span></span>);</code><p>The <code class="classname">BMediaTheme</code> constructor initializes
the theme so it can be used by the system or by an application. The
user-readable theme name is passed as the <code class="parameter">name</code>
argument, and some longer description of the theme in
<code class="parameter">info</code>.</p><p>The <code class="parameter">name</code> and
<code class="parameter">info</code> strings are copied; you can dispose of the
original strings if you wish. Both strings should be human-readable, as
they may be presented to the user in a user interface for selecting a theme
to be used.</p><p>If the theme lives in an add-on on disk, specify the
<span class="type">entry_ref</span> of the add-on file in
<code class="parameter">addOn</code> and the ID assigned to the theme by its
add-on in <code class="parameter">themeID</code>.</p></div><div class="section"><div xmlns="" xmlns:d="http://docbook.org/ns/docbook" class="titlepage"><div><div xmlns:d="http://docbook.org/ns/docbook"><h4 xmlns="http://www.w3.org/1999/xhtml" class="title"><a id="BMediaTheme_Destructor"></a>~BMediaTheme()</h4></div></div></div><code class="destructorsynopsis cpp"><span class="modifier">virtual </span><span class="methodname">BMediaTheme</span>();</code><p>Disposes of memory used by the theme. If you create a theme, be sure the
destructor frees any memory allocated by the theme.</p></div></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="BMediaTheme_MemberFunctions"></a>Member Functions</h3></div></div></div><div class="section"><div xmlns="" xmlns:d="http://docbook.org/ns/docbook" class="titlepage"><div><div xmlns:d="http://docbook.org/ns/docbook"><h4 xmlns="http://www.w3.org/1999/xhtml" class="title"><a id="BMediaTheme_BackgroundBitmapFor"></a>BackgroundBitmapFor()</h4></div></div></div><code class="methodsynopsis cpp"><span class="modifier">virtual </span><span class="type"><a class="link" href="BBitmap.html" title="BBitmap"><code class="classname">BBitmap</code></a>* </span><span class="methodname">BackgroundBitmapFor</span>(<span class="methodparam"><span class="type"><a class="link" href="BMediaTheme.html#Enums_bg_kind" title="Background Color and Bitmap Kinds">bg_kind</a> </span><span class="parameter">backgroundKind</span></span>);</code><p>Returns the
<a class="link" href="BBitmap.html" title="BBitmap"><code class="classname">BBitmap</code></a>
that should be used as the background for the
specified type of user interface object. Possible values for
<code class="parameter">backgroundKind</code> are detailed in
<span class="type"><a class="link" href="BMediaTheme.html#Enums_bg_kind" title="Background Color and Bitmap Kinds">bg_kind</a></span>.</p></div><div class="section"><div xmlns="" xmlns:d="http://docbook.org/ns/docbook" class="titlepage"><div><div xmlns:d="http://docbook.org/ns/docbook"><h4 xmlns="http://www.w3.org/1999/xhtml" class="title"><a id="BMediaTheme_BackgroundColorFor"></a>BackgroundColorFor()</h4></div></div></div><code class="methodsynopsis cpp"><span class="modifier">virtual </span><span class="type">rgb_color </span><span class="methodname">BackgroundBitmapFor</span>(<span class="methodparam"><span class="type"><a class="link" href="BMediaTheme.html#Enums_bg_kind" title="Background Color and Bitmap Kinds">bg_kind</a> </span><span class="parameter">backgroundKind</span></span>);</code><p>Returns the
<a class="link" href="TheInterfaceKit_DefinedTypes.html#rgb_color" title="rgb_color"><span class="type">rgb_color</span></a>
that should be used as the background for the
specified type of user interface object. Possible values for
<code class="parameter">backgroundKind</code> are detailed in
<span class="type"><a class="link" href="BMediaTheme.html#Enums_bg_kind" title="Background Color and Bitmap Kinds">bg_kind</a></span>.</p></div><div class="section"><div xmlns="" xmlns:d="http://docbook.org/ns/docbook" class="titlepage"><div><div xmlns:d="http://docbook.org/ns/docbook"><h4 xmlns="http://www.w3.org/1999/xhtml" class="title"><a id="BMediaTheme_ForegroundColorFor"></a>ForegroundColorFor()</h4></div></div></div><code class="methodsynopsis cpp"><span class="modifier">virtual </span><span class="type">rgb_color </span><span class="methodname">BackgroundBitmapFor</span>(<span class="methodparam"><span class="type"><a class="link" href="BMediaTheme.html#Enums_fg_kind" title="Foreground Color Kinds">fg_kind</a> </span><span class="parameter">foregroundKind</span></span>);</code><p>Returns the
<a class="link" href="TheInterfaceKit_DefinedTypes.html#rgb_color" title="rgb_color"><span class="type">rgb_color</span></a>
that should be used as the foreground for the
specified type of user interface object. Possible values for
foregroundKind are detailed in
<span class="type"><a class="link" href="BMediaTheme.html#Enums_fg_kind" title="Foreground Color Kinds">fg_kind</a></span>.</p></div><div class="section"><div xmlns="" xmlns:d="http://docbook.org/ns/docbook" class="titlepage"><div><div xmlns:d="http://docbook.org/ns/docbook"><h4 xmlns="http://www.w3.org/1999/xhtml" class="title"><a id="BMediaTheme_GetRef"></a>GetRef()</h4></div></div></div><code class="methodsynopsis cpp"><span class="type">bool </span><span class="methodname">GetRef</span>(<span class="methodparam"><span class="type">entry_ref* </span><span class="parameter">outRef</span></span>);</code><p>Sets <code class="parameter">outRef</code> to be a reference to the add-on file from which the theme was
loaded and returns <code class="constant">true</code>. If the theme wasn't loaded from an add-on, this
function returns <code class="constant">false</code>.</p></div><div class="section"><div xmlns="" xmlns:d="http://docbook.org/ns/docbook" class="titlepage"><div><div xmlns:d="http://docbook.org/ns/docbook"><h4 xmlns="http://www.w3.org/1999/xhtml" class="title"><a id="BMediaTheme_ID"></a>ID()</h4></div></div></div><code class="methodsynopsis cpp"><span class="type">int32 </span><span class="methodname">ID</span>();</code><p>Returns the theme's ID, as assigned by the add-on in which the theme
resides. The ID is unique only within that add-on.</p><p>If the theme isn't in an add-on, 0 is returned.</p></div><div class="section"><div xmlns="" xmlns:d="http://docbook.org/ns/docbook" class="titlepage"><div><div xmlns:d="http://docbook.org/ns/docbook"><h4 xmlns="http://www.w3.org/1999/xhtml" class="title"><a id="BMediaTheme_Info"></a>Info()</h4></div></div></div><code class="methodsynopsis cpp"><span class="modifier">const </span><span class="type">char* </span><span class="methodname">Info</span>();</code><p>Returns the user-readable long description of the theme, as specified
when the theme was created.</p></div><div class="section"><div xmlns="" xmlns:d="http://docbook.org/ns/docbook" class="titlepage"><div><div xmlns:d="http://docbook.org/ns/docbook"><h4 xmlns="http://www.w3.org/1999/xhtml" class="title"><a id="BMediaTheme_MakeControlFor"></a>MakeControlFor()</h4></div></div></div><code class="methodsynopsis cpp"><span class="modifier">virtual </span><span class="type"><a class="link" href="BControl.html" title="BControl"><code class="classname">BControl</code></a>* </span><span class="methodname">MakeControlFor</span>(<span class="methodparam"><span class="type"><a class="link" href="BParameter.html" title="BParameter"><code class="classname">BParameter</code></a>* </span><span class="parameter">parameter</span></span>) <span class="modifier"> = 0</span>;</code><p>If you create your own theme, your implementation of this function should
return an appropriate
<a class="link" href="BControl.html" title="BControl"><code class="classname">BControl</code></a>
to operate on the specified
<a class="link" href="BParameter.html" title="BParameter"><code class="classname">BParameter</code></a>.</p><p>Applications that want to use the theme to create the controls, but
handle their layout themselves, can call this function for each parameter
in the web, rather than rely upon
<a class="link" href="BMediaTheme.html#BMediaTheme_ViewFor" title="ViewFor()"><code class="methodname">ViewFor()</code></a>.
However, if an application uses <code class="methodname">MakeControlFor()</code>
to create individual controls rather than letting
<a class="link" href="BMediaTheme.html#BMediaTheme_ViewFor" title="ViewFor()"><code class="methodname">ViewFor()</code></a>
set up the entire view, the application assumes responsibility
for setting the control's value in response to value change messages.</p><p>If you want the control to send a specific message when invoked, you
should call
<a class="link" href="BInvoker.html#BInvoker_SetMessage" title="SetMessage(), Message(), Command()"><code class="methodname">BInvoker::SetMessage()</code></a>
on it.</p></div><div class="section"><div xmlns="" xmlns:d="http://docbook.org/ns/docbook" class="titlepage"><div><div xmlns:d="http://docbook.org/ns/docbook"><h4 xmlns="http://www.w3.org/1999/xhtml" class="title"><a id="BMediaTheme_MakeFallbackViewFor"></a>MakeFallbackViewFor()</h4></div></div></div><code class="methodsynopsis cpp"><span class="modifier">static </span><span class="type"><a class="link" href="BControl.html" title="BControl"><code class="classname">BControl</code></a>* </span><span class="methodname">MakeFallbackViewFor</span>(<span class="methodparam"><span class="type"><a class="link" href="BParameter.html" title="BParameter"><code class="classname">BParameter</code></a>* </span><span class="parameter">control</span></span>);</code><p>If you're implementing your own theme, and for whatever reason you want a
<a class="link" href="BParameter.html" title="BParameter"><code class="classname">BParameter</code></a>
to use the standard system theme's
<a class="link" href="BControl.html" title="BControl"><code class="classname">BControl</code></a>, call
<code class="methodname">MakeFallbackViewFor()</code> to obtain that
<a class="link" href="BControl.html" title="BControl"><code class="classname">BControl</code></a>.</p><p>This can be used if your theme is only intended to augment certain
controls, or if you receive a
<a class="link" href="BParameter.html" title="BParameter"><code class="classname">BParameter</code></a>
you don't know anything about.</p><div class="admonition note"><div class="title">Note</div><div class="graphic"><img class="icon" alt="Note" width="32" src="./images/admonitions/Info_32.png" /><div class="text"><p>Your
<a class="link" href="BMediaTheme.html#BMediaTheme_MakeControlFor" title="MakeControlFor()"><code class="methodname">MakeControlFor()</code></a>
implementation should always call
<code class="methodname">MakeFallbackViewFor()</code> if it's asked to create a
<a class="link" href="BControl.html" title="BControl"><code class="classname">BControl</code></a> for a
<a class="link" href="BParameter.html" title="BParameter"><code class="classname">BParameter</code></a>
it doesn't understand. This way, all
<a class="link" href="BParameter.html" title="BParameter"><code class="classname">BParameter</code></a>s
will get some form of user interface, even if your theme doesn't specifically know how to
handle some of them. This will let your theme remain compatible with
future versions of the BeOS.</p></div></div></div></div><div class="section"><div xmlns="" xmlns:d="http://docbook.org/ns/docbook" class="titlepage"><div><div xmlns:d="http://docbook.org/ns/docbook"><h4 xmlns="http://www.w3.org/1999/xhtml" class="title"><a id="BMediaTheme_MakeViewFor"></a>MakeViewFor()</h4></div></div></div><code class="methodsynopsis cpp"><span class="modifier">virtual </span><span class="type"><a class="link" href="BView.html" title="BView"><code class="classname">BView</code></a>* </span><span class="methodname">MakeViewFor</span>(<span class="methodparam"><span class="type"><a class="link" href="BParameterWeb.html" title="BParameterWeb"><code class="classname">BParameterWeb</code></a>* </span><span class="parameter">web</span></span>,<br />                           <span class="methodparam"><span class="modifier">const </span><span class="type"><a class="link" href="BRect.html" title="BRect"><code class="classname">BRect</code></a>* </span><span class="parameter">hintRect</span><span class="initializer"> = <span class="constant">NULL</span></span></span>) <span class="modifier"> = 0</span>;</code><p>Given the specified
<a class="link" href="BParameterWeb.html" title="BParameterWeb"><code class="classname">BParameterWeb</code></a> and
<code class="parameter">hintRect</code>, your implementation of
this function should construct a
<a class="link" href="BView.html" title="BView"><code class="classname">BView</code></a>
that contains the
<a class="link" href="BControl.html" title="BControl"><code class="classname">BControl</code></a>s
for manipulating the
<a class="link" href="BParameter.html" title="BParameter"><code class="classname">BParameter</code></a>s
in the web. The <code class="parameter">hintRect</code> is an area the
caller thinks is appropriate for you to fill with your
<a class="link" href="BView.html" title="BView"><code class="classname">BView</code></a>;
your theme should try to stay within that rectangle if possible.</p><p>The web returned by this function belongs to the theme; applications
shouldn't delete it (a properly-written theme will automatically dispose
of the web when the view is closed).</p><p>This function is called by
<a class="link" href="BMediaTheme.html#BMediaTheme_ViewFor" title="ViewFor()"><code class="methodname">ViewFor()</code></a>.</p></div><div class="section"><div xmlns="" xmlns:d="http://docbook.org/ns/docbook" class="titlepage"><div><div xmlns:d="http://docbook.org/ns/docbook"><h4 xmlns="http://www.w3.org/1999/xhtml" class="title"><a id="BMediaTheme_PreferredTheme"></a><a id="BMediaTheme_SetPreferredTheme"></a>
PreferredTheme(), SetPreferredTheme()</h4></div></div></div><code class="methodsynopsis cpp"><span class="modifier">static </span><span class="type"><span class="classname">BMediaTheme</span>* </span><span class="methodname">PreferredTheme</span>();</code><code class="methodsynopsis cpp"><span class="modifier">static </span><span class="type">status_t </span><span class="methodname">SetPreferredTheme</span>(<span class="methodparam"><span class="type"><span class="classname">BMediaTheme</span>* </span><span class="parameter">newPreferredTheme</span></span>);</code><p><code class="methodname">PreferredTheme()</code> returns the current preferred theme;
<code class="methodname">SetPreferredTheme()</code>
changes the preferred theme to the theme specified by
<code class="parameter">newPreferredTheme</code>.</p><p>The preferred theme is the theme that will be used for creating node
controlling user interfaces if no specific theme is requested when the
interface is created.</p><table class="variablelist returncodes"><thead><tr><th>Return Code</th><th>Description</th></tr></thead><tbody><tr><td><p><span class="term"><code class="constant">B_OK</code></span></p></td><td><p>The preferred theme was changed without error.</p></td></tr><tr><td><p><span class="term"><code class="constant">B_NOT_ALLOWED</code></span></p></td><td><p>Access to the settings file denied.</p></td></tr><tr><td><p><span class="term">Other errors.</span></p></td><td><p>Directory and file I/O errors may occur while updating the settings file.</p></td></tr></tbody></table><p>See also:
<a class="link" href="BMediaTheme.html#BMediaTheme_ViewFor" title="ViewFor()"><code class="methodname">ViewFor()</code></a>,
<a class="link" href="BMediaTheme.html#BMediaTheme_MakeViewFor" title="MakeViewFor()"><code class="methodname">MakeViewFor()</code></a></p></div><div class="section"><div xmlns="" xmlns:d="http://docbook.org/ns/docbook" class="titlepage"><div><div xmlns:d="http://docbook.org/ns/docbook"><h4 xmlns="http://www.w3.org/1999/xhtml" class="title"><a id="BMediaTheme_Name"></a>Name()</h4></div></div></div><code class="methodsynopsis cpp"><span class="modifier">const </span><span class="type">char* </span><span class="methodname">Name</span>();</code><p>Returns the user-readable name of the theme, as specified when the theme
was created.</p></div><div class="section"><div xmlns="" xmlns:d="http://docbook.org/ns/docbook" class="titlepage"><div><div xmlns:d="http://docbook.org/ns/docbook"><h4 xmlns="http://www.w3.org/1999/xhtml" class="title"><a id="BMediaTheme_ViewFor"></a>ViewFor()</h4></div></div></div><code class="methodsynopsis cpp"><span class="modifier">static </span><span class="type"><a class="link" href="BView.html" title="BView"><code class="classname">BView</code></a>* </span><span class="methodname">ViewFor</span>(<span class="methodparam"><span class="type"><a class="link" href="BParameterWeb.html" title="BParameterWeb"><code class="classname">BParameterWeb</code></a>* </span><span class="parameter">web</span></span>,<br />                      <span class="methodparam"><span class="modifier">const </span><span class="type"><a class="link" href="BRect.html" title="BRect"><code class="classname">BRect</code></a>* </span><span class="parameter">hintRect</span><span class="initializer"> = <span class="constant">NULL</span></span></span>,<br />                      <span class="methodparam"><span class="type">BMediaTheme* </span><span class="parameter">usingTheme</span><span class="initializer"> = <span class="constant">NULL</span></span></span>);</code><p>Given a
<a class="link" href="BParameterWeb.html" title="BParameterWeb"><code class="classname">BParameterWeb</code></a>
web, typically returned by
<a class="link" href="BMediaRoster.html#BMediaRoster_GetParameterWebFor" title="GetParameterWebFor()"><code class="classname">BMediaRoster::GetParameterWebFor</code></a>,
this function creates a
<a class="link" href="BView.html" title="BView"><code class="classname">BView</code></a>
suitable for adding to a
<a class="link" href="BWindow.html" title="BWindow"><code class="classname">BWindow</code></a>
to allow the user to configure the node the web
describes, including a diagram indicating the data flow path through the
node, and controls to let the user configure each control point.</p><div class="admonition note"><div class="title">Note</div><div class="graphic"><img class="icon" alt="Note" width="32" src="./images/admonitions/Info_32.png" /><div class="text"><p>This function is the public interface for creating a view for
configuring a node (the
<a class="link" href="BMediaTheme.html#BMediaTheme_MakeViewFor" title="MakeViewFor()"><code class="methodname">MakeViewFor()</code></a>
function is the hook you override
if you're implementing your own theme).</p></div></div></div><p>The returned view is created using the theme specified by <code class="parameter">usingTheme</code>; if
this argument is <code class="constant">NULL</code>, the preferred theme is used. The <code class="parameter">hintRect</code>
parameter specifies the rectangle the view should try to occupy, and is
passed to <code class="methodname">MakeViewFor()</code>.</p></div></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="BMediaTheme_Functions"></a>Global C Functions</h3></div></div></div><div class="section"><div xmlns="" xmlns:d="http://docbook.org/ns/docbook" class="titlepage"><div><div xmlns:d="http://docbook.org/ns/docbook"><h4 xmlns="http://www.w3.org/1999/xhtml" class="title"><a id="get_nth_theme"></a>get_nth_theme()</h4></div></div></div><a id="id1160014" class="indexterm"></a><code class="methodsynopsis c"><span class="type">status_t </span><span class="methodname">get_theme_at</span>(<span class="methodparam"><span class="type">int32 </span><span class="parameter">n</span></span>,<br />                      <span class="methodparam"><span class="modifier">const </span><span class="type">char** </span><span class="parameter">outName</span></span>,<br />                      <span class="methodparam"><span class="type">int32* </span><span class="parameter">outID</span></span>);</code><p>This function is called after the theme add-on is loaded, to
determine what themes are available in the add-on. It's called repeatedly,
with successively-higher values of <code class="parameter">n</code>, until it
returns an error.</p><p>Your add-on's implementation of this function should set
<code class="parameter">outName</code> to point to the
<code class="parameter">n</code>th theme's name,
<code class="parameter">outInfo</code> to point to information describing the
<code class="parameter">n</code>th theme, and <code class="parameter">outID</code>
should be set to the <code class="parameter">n</code>th theme's ID number,
which used internally by your add-on to distinguish among the themes it
supports.</p></div><div class="section"><div xmlns="" xmlns:d="http://docbook.org/ns/docbook" class="titlepage"><div><div xmlns:d="http://docbook.org/ns/docbook"><h4 xmlns="http://www.w3.org/1999/xhtml" class="title"><a id="make_theme"></a>make_theme()</h4></div></div></div><a id="id1160114" class="indexterm"></a><code class="methodsynopsis c"><span class="type"><span class="classname">BMediaTheme</span>* </span><span class="methodname">make_theme</span>(<span class="methodparam"><span class="type">int32 </span><span class="parameter">themeID</span></span>,<br />                        <span class="methodparam"><span class="type">image_id </span><span class="parameter">imageID</span></span>);</code><p>If you're writing a theme to be loaded from an add-on file, you
must implement <code class="function">make_theme()</code> to create a
<code class="classname">BMediaTheme</code> for the specified
<code class="parameter">themeID</code>. <code class="parameter">imageID</code> is
the <span class="type">image_id</span> of the add-on in which the theme is
located.</p></div></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="BMediaTheme_Constants"></a>Constants</h3></div></div></div><div class="section"><div xmlns="" xmlns:d="http://docbook.org/ns/docbook" class="titlepage"><div><div xmlns:d="http://docbook.org/ns/docbook"><h4 xmlns="http://www.w3.org/1999/xhtml" class="title"><a id="Enums_bg_kind"></a><a id="B_GENERAL_BG"></a>
<a id="B_SETTINGS_BG"></a>
<a id="B_PRESENTATION_BG"></a>
<a id="B_EDIT_BG"></a>
<a id="B_CONTROL_BG"></a>
<a id="B_HILITE_BG"></a>
Background Color and Bitmap Kinds</h4></div></div></div><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_GENERAL_BG</code></span></p></td><td><p>Used when nothing else is applicable.</p></td></tr><tr><td><p><span class="term"><code class="constant">B_SETTINGS_BG</code></span></p></td><td><p>Used for panels or windows full of controls.</p></td></tr><tr><td><p><span class="term"><code class="constant">B_PRESENTATION_BG</code></span></p></td><td><p>Used for windows that present actual media content.</p></td></tr><tr><td><p><span class="term"><code class="constant">B_EDIT_BG</code></span></p></td><td><p>Used for windows that edit media content.</p></td></tr><tr><td><p><span class="term"><code class="constant">B_CONTROL_BG</code></span></p></td><td><p>Used for drawing controls.</p></td></tr><tr><td><p><span class="term"><code class="constant">B_HILITE_BG</code></span></p></td><td><p>Used when highlighting information, such as selected media
data.</p></td></tr></tbody></table><p>These constants identify parts of the user interface that a theme can
customize the appearance of by altering the color or bitmap that's used
in the background for various user interface elements. They're used when
calling
<a class="link" href="BMediaTheme.html#BMediaTheme_BackgroundBitmapFor" title="BackgroundBitmapFor()"><code class="methodname">BackgroundBitmapFor()</code></a> and
<a class="link" href="BMediaTheme.html#BMediaTheme_BackgroundColorFor" title="BackgroundColorFor()"><code class="methodname">BackgroundColorFor()</code></a>.</p><p>For example, the <code class="constant">B_PRESENTATION_BG</code> color
and/or bitmap would be used as the background of a window in which an
oscilloscope display shows the waveform of a sound wave being played back,
and a window used for editing the waveform would have its' background in
the color specified by <code class="constant">B_EDIT_BG</code> (or using the
bitmap specified by <code class="constant">B_EDIT_BG</code>, if one exists),
except for the part of the wave that's selected by the user, which would
have the background color or bitmap specified by
<code class="constant">B_HILITE_BG</code>.</p></div><div class="section"><div xmlns="" xmlns:d="http://docbook.org/ns/docbook" class="titlepage"><div><div xmlns:d="http://docbook.org/ns/docbook"><h4 xmlns="http://www.w3.org/1999/xhtml" class="title"><a id="Enums_fg_kind"></a><a id="B_GENERAL_FG"></a>
<a id="B_SETTINGS_FG"></a>
<a id="B_PRESENTATION_FG"></a>
<a id="B_EDIT_FG"></a>
<a id="B_CONTROL_FG"></a>
<a id="B_HILITE_FG"></a>
Foreground Color Kinds</h4></div></div></div><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_GENERAL_FG</code></span></p></td><td><p>Used when nothing else is applicable.</p></td></tr><tr><td><p><span class="term"><code class="constant">B_SETTINGS_FG</code></span></p></td><td><p>Used for panels or windows full of controls.</p></td></tr><tr><td><p><span class="term"><code class="constant">B_PRESENTATION_FG</code></span></p></td><td><p>Used for windows that present actual media content.</p></td></tr><tr><td><p><span class="term"><code class="constant">B_EDIT_FG</code></span></p></td><td><p>Used for windows that edit media content.</p></td></tr><tr><td><p><span class="term"><code class="constant">B_CONTROL_FG</code></span></p></td><td><p>Used for drawing controls.</p></td></tr><tr><td><p><span class="term"><code class="constant">B_HILITE_FG</code></span></p></td><td><p>Used when highlighting information, such as selected media
data.</p></td></tr></tbody></table><p>The foreground color kinds are used when calling
<a class="link" href="BMediaTheme.html#BMediaTheme_ForegroundColorFor" title="ForegroundColorFor()"><code class="methodname">ForegroundColorFor()</code></a>
to obtain the color to use when drawing the foreground portions of various
interface elements.</p></div></div></div><div id="footer"><hr /><div id="footerT">Prev: <a href="BMediaRoster.html">BMediaRoster</a>  Up: <a href="TheMediaKit.html">The Media Kit</a>  Next: <a href="BMediaTrack.html">BMediaTrack</a> </div><div id="footerB"><div id="footerBL"><a href="BMediaRoster.html" title="BMediaRoster"><img src="./images/navigation/prev.png" alt="Prev" /></a> <a href="TheMediaKit.html" title="The Media Kit"><img src="./images/navigation/up.png" alt="Up" /></a> <a href="BMediaTrack.html" title="BMediaTrack"><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>