39 lines
13 KiB
HTML
39 lines
13 KiB
HTML
<?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 Input Server</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="TheInputServer.html" title="The Input Server" /><link rel="prev" href="BInputServerFilter.html" title="BInputServerFilter" /><link rel="next" href="TheInputServer_Functions.html" title="Functions" /></head><body><div id="header"><div id="headerT"><div id="headerTL"><a accesskey="p" href="BInputServerFilter.html" title="BInputServerFilter"><img src="./images/navigation/prev.png" alt="Prev" /></a> <a accesskey="u" href="TheInputServer.html" title="The Input Server"><img src="./images/navigation/up.png" alt="Up" /></a> <a accesskey="n" href="TheInputServer_Functions.html" title="Functions"><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 Input Server</div></div><div id="headerB">Prev: <a href="BInputServerFilter.html">BInputServerFilter</a> Up: <a href="TheInputServer.html">The Input Server</a> Next: <a href="TheInputServer_Functions.html">Functions</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="BInputServerMethod"></a>BInputServerMethod</h2></div></div></div><a id="id962380" 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><a class="link" href="BInputServerFilter.html" title="BInputServerFilter"><code class="classname">BInputServerFilter</code></a></td></tr><tr><td>Mix-in Classes:</td><td>–</td></tr><tr><td>Declared In:</td><td><code class="filename">add-ons/input_server/InputServerMethod.h</code></td></tr><tr><td>Library:</td><td><code class="filename">libbe.so</code></td></tr><tr><td>Allocation:</td><td>By the Input Server only</td></tr></tbody></table></td><td>
|
||
<a class="link overview" href="BInputServerMethod_Overview.html" title="BInputServerMethod">Class Overview</a>
|
||
<div class="toc"><ul><li><span class="section"><a href="BInputServerMethod.html#BInputServerMethod_ConstructorDestructor">Constructor and Destructor</a></span></li><li><span class="section"><a href="BInputServerMethod.html#BInputServerMethod_HookFunctions">Hook Functions</a></span></li><li><span class="section"><a href="BInputServerMethod.html#BInputServerMethod_MemberFunctions">Member Functions</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="BInputServerMethod_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="BInputServerMethod_Constructor"></a>BInputServerMethod()</h4></div></div></div><code class="constructorsynopsis cpp"><span class="methodname">BInputServerMethod</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">uchar* </span><span class="parameter">icon</span></span>);</code><p>Creates a new <code class="classname">BInputServerMethod</code> object. You can initialize the
|
||
object—set initial values, spawn threads, etc.—either here or
|
||
in the inherited function
|
||
<a class="link" href="BInputServerFilter.html#BInputServerFilter_InitCheck" title="InitCheck()"><code class="methodname">InitCheck()</code></a>
|
||
function, which is called immediately after the constructor.</p><p><code class="parameter">name</code> is a textual name describing the input
|
||
method, and <code class="parameter">icon</code> is the raw data for a 16x16 8-bit
|
||
icon built from the standard BeOS palette. This name and icon will be
|
||
displayed in the input method menu (the little keyboard icon in the
|
||
Deskbar). When the user selects your input method from the menu, your
|
||
<a class="link" href="BInputServerMethod.html#BInputServerMethod_MethodActivated" title="MethodActivated()"><code class="methodname">MethodActivated()</code></a>
|
||
function is called.
|
||
</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="BInputServerMethod_Destructor"></a>~BInputServerMethod()</h4></div></div></div><code class="destructorsynopsis cpp"><span class="methodname">BInputServerMethod</span>();</code><p>Deletes the <code class="classname">BInputServerMethod</code> object. The destructor is invoked by the
|
||
Input Server only—you never delete a <code class="classname">BInputServerMethod</code> object from
|
||
your own code. If this object has spawned its own threads or allocated
|
||
memory on the heap, it must clean up after itself here.</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="BInputServerMethod_HookFunctions"></a>Hook 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="BInputServerMethod_MethodActivated"></a>MethodActivated()</h4></div></div></div><code class="methodsynopsis cpp"><span class="modifier">virtual </span><span class="type">status_t </span><span class="methodname">MethodActivated</span>(<span class="methodparam"><span class="type">bool </span><span class="parameter">active</span></span>);</code><p>The <code class="methodname">MethodActivated()</code> hook function is
|
||
invoked by the Input Server when the user activates your input method
|
||
(<code class="parameter">active</code> is <code class="constant">true</code>) or deactivates
|
||
it (<code class="parameter">active</code> is <code class="constant">false</code>). This is
|
||
your chance to activate any helper threads or loopers to the fact that
|
||
you'll be handling input events soon.</p><p>Return <code class="constant">B_OK</code> if that's OK, or something else if it's not. The default
|
||
implementation returns <code class="constant">B_OK</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="BInputServerMethod_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="BInputServerMethod_EnqueueMessage"></a>EnqueueMessage()</h4></div></div></div><code class="methodsynopsis cpp"><span class="type">status_t </span><span class="methodname">EnqueueMessage</span>(<span class="methodparam"><span class="type"><a class="link" href="BMessage.html" title="BMessage"><code class="classname">BMessage</code></a>* </span><span class="parameter">message</span></span>);</code><p>Inserts the specified <code class="parameter">message</code> into the Input Server's event queue; the
|
||
message continues down-stream from this point, passing through additional
|
||
active input methods and input filters on its way to the App Server.</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="BInputServerMethod_SetName"></a>SetName()</h4></div></div></div><code class="methodsynopsis cpp"><span class="type">status_t </span><span class="methodname">SetName</span>(<span class="methodparam"><span class="modifier">const </span><span class="type">char* </span><span class="parameter">name</span></span>);</code><p>Changes your input method's name, as found in the input method menu of
|
||
the Deskbar.</p><p>The Input Server makes a copy of <code class="parameter">name</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="BInputServerMethod_SetIcon"></a>SetIcon()</h4></div></div></div><code class="methodsynopsis cpp"><span class="type">status_t </span><span class="methodname">SetIcon</span>(<span class="methodparam"><span class="modifier">const </span><span class="type">uchar* </span><span class="parameter">icon</span></span>);</code><p>Changes your input method's icon, as found in the input method menu of
|
||
the Deskbar. <code class="parameter">icon</code> should be raw data for a 16x16 8-bit icon built from
|
||
the standard BeOS palette.</p><p>The Input Server makes a copy of <code class="parameter">icon</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="BInputServerMethod_SetMenu"></a>SetMenu()</h4></div></div></div><code class="methodsynopsis cpp"><span class="type">status_t </span><span class="methodname">SetMenu</span>(<span class="methodparam"><span class="modifier">const </span><span class="type"><a class="link" href="BMenu.html" title="BMenu"><code class="classname">BMenu</code></a>* </span><span class="parameter">menu</span></span>,<br /> <span class="methodparam"><span class="modifier">const </span><span class="type"><a class="link" href="BMessenger.html" title="BMessenger"><code class="classname">BMessenger</code></a> </span><span class="parameter">target</span></span>);</code><p>Lets you assign a menu to your input method's entry in the input method
|
||
menu of the Deskbar. Messages generated by the menu are sent to target.</p><p>Passing a <code class="constant">NULL</code> <code class="parameter">menu</code>
|
||
disables your input method's menu.</p><p>You retain ownership of <code class="parameter">menu</code>; be careful not
|
||
to delete it while the Input Server is still using it.</p></div></div></div><div id="footer"><hr /><div id="footerT">Prev: <a href="BInputServerFilter.html">BInputServerFilter</a> Up: <a href="TheInputServer.html">The Input Server</a> Next: <a href="TheInputServer_Functions.html">Functions</a> </div><div id="footerB"><div id="footerBL"><a href="BInputServerFilter.html" title="BInputServerFilter"><img src="./images/navigation/prev.png" alt="Prev" /></a> <a href="TheInputServer.html" title="The Input Server"><img src="./images/navigation/up.png" alt="Up" /></a> <a href="TheInputServer_Functions.html" title="Functions"><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>
|