73 made to <xref href="GUID-643DDA78-C7A7-386D-AB3F-8710141DDDA9.dita#GUID-643DDA78-C7A7-386D-AB3F-8710141DDDA9/GUID-DADAFFD6-4B63-35EE-8F50-F397C119CC27"><apiname>RWsSession::RedrawReady()</apiname></xref> to enable the client |
73 made to <xref href="GUID-643DDA78-C7A7-386D-AB3F-8710141DDDA9.dita#GUID-643DDA78-C7A7-386D-AB3F-8710141DDDA9/GUID-DADAFFD6-4B63-35EE-8F50-F397C119CC27"><apiname>RWsSession::RedrawReady()</apiname></xref> to enable the client |
74 to listen for further requests from the Window Server. </p> <p>The following |
74 to listen for further requests from the Window Server. </p> <p>The following |
75 diagram demonstrates that typically the <xref href="GUID-12C281FF-546C-318D-8783-F26B0F619E11.dita"><apiname>RunL()</apiname></xref> starts with |
75 diagram demonstrates that typically the <xref href="GUID-12C281FF-546C-318D-8783-F26B0F619E11.dita"><apiname>RunL()</apiname></xref> starts with |
76 a <xref href="GUID-C57CFECB-72CD-39EB-A83E-82A9E985F56B.dita"><apiname>GetRedraw()</apiname></xref> and ends with a call to <xref href="GUID-E3F0CB70-58E4-32FD-9828-71DF2F9976D3.dita"><apiname>RedrawReady()</apiname></xref>. </p> <fig id="GUID-B092D136-8C18-5237-A095-F8C3BBFFDDB4"> |
76 a <xref href="GUID-C57CFECB-72CD-39EB-A83E-82A9E985F56B.dita"><apiname>GetRedraw()</apiname></xref> and ends with a call to <xref href="GUID-E3F0CB70-58E4-32FD-9828-71DF2F9976D3.dita"><apiname>RedrawReady()</apiname></xref>. </p> <fig id="GUID-B092D136-8C18-5237-A095-F8C3BBFFDDB4"> |
77 <title> Window Server-initiated redraw </title> |
77 <title> Window Server-initiated redraw </title> |
78 <image href="GUID-0528A294-AC1B-5CDD-B59C-A105F39D748F_d0e190203_href.png" placement="inline"/> |
78 <image href="GUID-0528A294-AC1B-5CDD-B59C-A105F39D748F_d0e195174_href.png" placement="inline"/> |
79 </fig> <p>A redrawer's <codeph>RunL()</codeph> function must <b>not</b> perform |
79 </fig> <p>A redrawer's <codeph>RunL()</codeph> function must <b>not</b> perform |
80 any non-redraw drawing (that is, any drawing operations that are not bracketed |
80 any non-redraw drawing (that is, any drawing operations that are not bracketed |
81 within the calls to <codeph>BeginRedraw()</codeph> and <codeph>EndRedraw()</codeph>). |
81 within the calls to <codeph>BeginRedraw()</codeph> and <codeph>EndRedraw()</codeph>). |
82 If it does, this causes a panic with code 79 (<codeph>EWservPanicWindowBeginRedrawNotCalled</codeph>) |
82 If it does, this causes a panic with code 79 (<codeph>EWservPanicWindowBeginRedrawNotCalled</codeph>) |
83 in the ScreenPlay variant. This is to avoid the infinite loop that would otherwise |
83 in the ScreenPlay variant. This is to avoid the infinite loop that would otherwise |
105 commands. </p> </li> |
105 commands. </p> </li> |
106 <li id="GUID-B2474EE6-CC03-55A8-9972-071B76512B26"><p>Calls <xref href="GUID-683603DD-F3D3-3193-BEB3-8236C7DE7F79.dita#GUID-683603DD-F3D3-3193-BEB3-8236C7DE7F79/GUID-3DE16607-AD3B-3946-BEB3-88512EAAB9CE"><apiname>RWindow::EndRedraw()</apiname></xref>. </p> </li> |
106 <li id="GUID-B2474EE6-CC03-55A8-9972-071B76512B26"><p>Calls <xref href="GUID-683603DD-F3D3-3193-BEB3-8236C7DE7F79.dita#GUID-683603DD-F3D3-3193-BEB3-8236C7DE7F79/GUID-3DE16607-AD3B-3946-BEB3-88512EAAB9CE"><apiname>RWindow::EndRedraw()</apiname></xref>. </p> </li> |
107 </ol> <fig id="GUID-6E2637DC-F92A-56DE-BB07-F109F5CA681B"> |
107 </ol> <fig id="GUID-6E2637DC-F92A-56DE-BB07-F109F5CA681B"> |
108 <title> Application-initiated redrawing, "draw now" scenario |
108 <title> Application-initiated redrawing, "draw now" scenario |
109 </title> |
109 </title> |
110 <image href="GUID-4BC95F70-2F3F-5CFE-B057-0C5A97430573_d0e190311_href.png" placement="inline"/> |
110 <image href="GUID-4BC95F70-2F3F-5CFE-B057-0C5A97430573_d0e195282_href.png" placement="inline"/> |
111 </fig> <p><b>The "draw deferred" scenario </b> </p> <p>The "draw deferred" redraw scenario |
111 </fig> <p><b>The "draw deferred" scenario </b> </p> <p>The "draw deferred" redraw scenario |
112 is when an application simply marks a window or a rectangle within a window |
112 is when an application simply marks a window or a rectangle within a window |
113 as invalid. This eventually triggers a Window Server-initiated redraw. Typically |
113 as invalid. This eventually triggers a Window Server-initiated redraw. Typically |
114 the application does this by calling <xref href="GUID-B06F99BD-F032-3B87-AB26-5DD6EBE8C160.dita#GUID-B06F99BD-F032-3B87-AB26-5DD6EBE8C160/GUID-9FB682AC-0209-302A-83F3-7BCB1162B998"><apiname>CCoeControl::DrawDeferred()</apiname></xref>. |
114 the application does this by calling <xref href="GUID-B06F99BD-F032-3B87-AB26-5DD6EBE8C160.dita#GUID-B06F99BD-F032-3B87-AB26-5DD6EBE8C160/GUID-9FB682AC-0209-302A-83F3-7BCB1162B998"><apiname>CCoeControl::DrawDeferred()</apiname></xref>. |
115 However, it is also possible to do this by calling <xref href="GUID-683603DD-F3D3-3193-BEB3-8236C7DE7F79.dita#GUID-683603DD-F3D3-3193-BEB3-8236C7DE7F79/GUID-28202F81-52FE-30F5-8B8C-ABED0915822E"><apiname>RWindow::Invalidate()</apiname></xref>. </p> <fig id="GUID-8B78CE09-EE92-50B3-8000-731BD9C20890"> |
115 However, it is also possible to do this by calling <xref href="GUID-683603DD-F3D3-3193-BEB3-8236C7DE7F79.dita#GUID-683603DD-F3D3-3193-BEB3-8236C7DE7F79/GUID-28202F81-52FE-30F5-8B8C-ABED0915822E"><apiname>RWindow::Invalidate()</apiname></xref>. </p> <fig id="GUID-8B78CE09-EE92-50B3-8000-731BD9C20890"> |
116 <title> Application-initiated redrawing, "draw deferred" scenario |
116 <title> Application-initiated redrawing, "draw deferred" scenario |
117 </title> |
117 </title> |
118 <image href="GUID-21EF9E6F-A0BF-5EB2-9E3F-CA6A011D4C89_d0e190335_href.png" placement="inline"/> |
118 <image href="GUID-21EF9E6F-A0BF-5EB2-9E3F-CA6A011D4C89_d0e195306_href.png" placement="inline"/> |
119 </fig> <p>This approach is useful when the data to be displayed might be updated |
119 </fig> <p>This approach is useful when the data to be displayed might be updated |
120 frequently but it is not necessary to update the display instantaneously. </p> <p>To |
120 frequently but it is not necessary to update the display instantaneously. </p> <p>To |
121 illustrate how it works, consider a window that has a rectangle that is used |
121 illustrate how it works, consider a window that has a rectangle that is used |
122 to display icons (a star, a cross and a triangle) that represent three different |
122 to display icons (a star, a cross and a triangle) that represent three different |
123 events that can occur in the application. Suppose the events can occur in |
123 events that can occur in the application. Suppose the events can occur in |
124 quick succession. If you use the "draw now" approach when each event occurs, |
124 quick succession. If you use the "draw now" approach when each event occurs, |
125 the Window Server updates the display separately for each one, as shown in |
125 the Window Server updates the display separately for each one, as shown in |
126 the following diagram. </p> <fig id="GUID-04BCFA21-8D44-5FEA-BE29-57B40AC9CF99"> |
126 the following diagram. </p> <fig id="GUID-04BCFA21-8D44-5FEA-BE29-57B40AC9CF99"> |
127 <title> Icons displayed using the "draw now" approach |
127 <title> Icons displayed using the "draw now" approach |
128 </title> |
128 </title> |
129 <image href="GUID-89185EBD-223F-5F52-B1CA-9F9692F7D21F_d0e190349_href.png" placement="inline"/> |
129 <image href="GUID-89185EBD-223F-5F52-B1CA-9F9692F7D21F_d0e195320_href.png" placement="inline"/> |
130 </fig> <p>However, if you use the "draw deferred" approach when each event |
130 </fig> <p>However, if you use the "draw deferred" approach when each event |
131 occurs, the Window Server may not update the display for each one. For example, |
131 occurs, the Window Server may not update the display for each one. For example, |
132 the Window Server does not update the display when it is superceded by a later |
132 the Window Server does not update the display when it is superceded by a later |
133 call. </p> <fig id="GUID-1E0E2A3C-1E63-58F6-940F-0D439FA6C721"> |
133 call. </p> <fig id="GUID-1E0E2A3C-1E63-58F6-940F-0D439FA6C721"> |
134 <title> Icons displayed using the "draw deferred" approach |
134 <title> Icons displayed using the "draw deferred" approach |
135 </title> |
135 </title> |
136 <image href="GUID-EDC405DC-F222-59CD-836E-180F8E1D2D11_d0e190360_href.png" placement="inline"/> |
136 <image href="GUID-EDC405DC-F222-59CD-836E-180F8E1D2D11_d0e195331_href.png" placement="inline"/> |
137 </fig> <p>If it is important that the display is updated immediately, you |
137 </fig> <p>If it is important that the display is updated immediately, you |
138 would generally use the "draw now" approach. However, if a short delay in |
138 would generally use the "draw now" approach. However, if a short delay in |
139 the display being updated is unlikely to inconvenience the user, the "draw |
139 the display being updated is unlikely to inconvenience the user, the "draw |
140 deferred" approach might be appropriate and has a performance advantage. </p> </section> |
140 deferred" approach might be appropriate and has a performance advantage. </p> </section> |
141 </conbody><related-links> |
141 </conbody><related-links> |