1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 2<html xml:lang="en-US" lang="en-US" xmlns="http://www.w3.org/1999/xhtml"> 3 <head> 4 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 5 <meta http-equiv="Content-Style-Type" content="text/css" /> 6 <link rel="stylesheet" href="../../../css/manpage.css" type="text/css" /> 7<title>IsExpectedToProcessHomeButton</title> 8 </head> 9 <body> 10<h1><CODE><a href="../../../nn/Overview.html">nn</a>::<a href="../../../nn/applet/Overview.html">applet</a>::<a href="../../../nn/applet/CTR/Overview.html">CTR</a>::IsExpectedToProcessHomeButton</CODE> Function</h1> 11<h2>Syntax</h2> 12 <div class="section"> 13 <pre class="definition"> 14bool IsExpectedToProcessHomeButton( 15 void 16); 17</pre> 18 </div> 19<h2>Arguments</h2> 20 <div class="section"> 21<p>None.</p> 22 </div> 23<h2>Return Values</h2> 24<div class="section">Returns whether there was a processing request. If <CODE>true</CODE>, the HOME Button must be processed. </div> 25<h2>Description</h2> 26 <div class="section"> 27<p>Determines whether there has been a request to process the HOME Button.</p><!-- write here --><P> 28A return value of <CODE>true</CODE> indicates that either the HOME Button was pressed to jump to the HOME Menu, or some other applet made a similar request to jump to the HOME Menu. 29</P><P> 30In such cases, call the <a href="../../../nn/applet/CTR/ProcessHomeButton.html"><CODE>nn::applet::CTR::ProcessHomeButton</CODE></a> to process the HOME Button. Then call <a href="../../../nn/applet/CTR/WaitForStarting.html"><CODE>nn::applet::CTR::WaitForStarting</CODE></a> to wait for starting if required. 31</P><P> 32Example 33</P><PRE> 34 // HOME Button transition check 35 if ( <FONT color="red">applet::IsExpectedToProcessHomeButton()</FONT> ) 36 { 37 _save_my_data(); 38 39 // HOME Button transition process 40 applet::ProcessHomeButton(); 41 42 // Await 43 applet::WaitForStarting(); 44 45 if( applet::IsExpectedToCloseApplication() ) 46 { 47 _close_application(); 48 } 49 50 _recover_my_data(); 51 } 52</PRE><P> 53Prevent applet-transition functions from being called between this function and <a href="../../../nn/applet/CTR/ProcessHomeButton.html"><CODE>nn::applet::CTR::ProcessHomeButton</CODE></a>. For example, if you attempt to preload library applets from another thread between these two function calls, an assert statement will trigger a warning because of an inconsistency in internal states. 54</P><P> 55Also, it was originally assumed that determination functions, such as this one, and actual transition operation functions would be called in sequence from the same thread, but it is possible to have a mechanism where they are respectively called from separate threads. In such cases, however, sufficient care is needed such that there is nothing following the transition target operation during the working of the determination thread. 56</P></div> 57<h2>Revision History</h2> 58 <div class="section"> 59 <dl class="history"> 60 <dt>2012/11/09</dt> 61<dd>Added information on calling determination functions and transition functions from separate threads. 62<br /> </dd> 63 <dt>2011/11/01</dt> 64<dd>Added a note related to calling applet-transition functions between this function and <CODE>ProcessHomeButton</CODE>. 65 </dd> 66 <dt>2011/06/14</dt> 67<dd>Deleted <CODE>ClearHomeButtonState</CODE> function from an example.<BR> 68 </dd> 69 <dt>2010/11/10</dt> 70<dd>Initial version.<br /> 71 </dd> 72 </dl> 73 </div> 74 <hr><p>CONFIDENTIAL</p></body> 75</html>