📄 magnifier-main_8c-source.html
字号:
<a name="l00169"></a>00169 <a class="code" href="GNOME__Magnifier_8h.html#7804bd3fd4edd2aae1f9daf2dfc94524">Bonobo_PropertyBag</a> properties;<a name="l00170"></a>00170 CORBA_Environment ev;<a name="l00171"></a>00171 <a class="code" href="structGNOME__Magnifier__RectBounds__type.html">GNOME_Magnifier_RectBounds</a> roi;<a name="l00172"></a>00172 <span class="keywordtype">int</span> x_roi, y_roi;<a name="l00173"></a>00173 <a name="l00174"></a>00174 <span class="comment">/* Only iterate the number of times specified */</span><a name="l00175"></a>00175 <span class="keywordflow">if</span> (<a class="code" href="magnifier-main_8c.html#b4d2b03157ec9554d008ee134e28172c">global_options</a>.<a class="code" href="structMagnifierOptions.html#a8079ebec7dc413e42b4cc31e5023a4b">timing_iterations</a> > 0) {<a name="l00176"></a>00176 <span class="keywordflow">if</span> (timing_counter > <a class="code" href="magnifier-main_8c.html#b4d2b03157ec9554d008ee134e28172c">global_options</a>.<a class="code" href="structMagnifierOptions.html#a8079ebec7dc413e42b4cc31e5023a4b">timing_iterations</a>) {<a name="l00177"></a>00177 CORBA_exception_init (&ev);<a name="l00178"></a>00178 properties = <a class="code" href="GNOME__Magnifier-stubs_8c.html#c78f67754e01769f66bed39db2b6ee33">GNOME_Magnifier_ZoomRegion_getProperties</a> (<a class="code" href="magnifier-main_8c.html#7155900ae5785c02d682d6ebdfdfa432">zoom_region</a>, &ev);<a name="l00179"></a>00179 <span class="keywordflow">if</span> (BONOBO_EX (&ev))<a name="l00180"></a>00180 fprintf (stderr, <span class="stringliteral">"EXCEPTION\n"</span>);<a name="l00181"></a>00181 <a name="l00182"></a>00182 bonobo_pbclient_set_boolean (properties, <span class="stringliteral">"exit-magnifier"</span>,<a name="l00183"></a>00183 TRUE, &ev);<a name="l00184"></a>00184 }<a name="l00185"></a>00185 }<a name="l00186"></a>00186 <a name="l00187"></a>00187 CORBA_exception_init (&ev);<a name="l00188"></a>00188 <a name="l00189"></a>00189 x_roi = <a class="code" href="magnifier-main_8c.html#b4d2b03157ec9554d008ee134e28172c">global_options</a>.<a class="code" href="structMagnifierOptions.html#c719917bdc9caff26d923f34a88b0887">timing_delta_x</a> * timing_x_pos;<a name="l00190"></a>00190 roi.<a class="code" href="structGNOME__Magnifier__RectBounds__type.html#da72b580c4e14d8f1dcd85b2da3a8759">x1</a> = x_roi;<a name="l00191"></a>00191 roi.<a class="code" href="structGNOME__Magnifier__RectBounds__type.html#721fd6fb9a4c3c6c3813402b31de633a">x2</a> = (<a class="code" href="magnifier-main_8c.html#a4d434a8b93410ea0ed660e48dac41c6">screen_width</a> / <a class="code" href="magnifier-main_8c.html#b4d2b03157ec9554d008ee134e28172c">global_options</a>.<a class="code" href="structMagnifierOptions.html#002ef34f3ec4073b1a3cdfb9c8378105">zoom_factor</a>) + roi.<a class="code" href="structGNOME__Magnifier__RectBounds__type.html#da72b580c4e14d8f1dcd85b2da3a8759">x1</a>;<a name="l00192"></a>00192 x_roi = <a class="code" href="magnifier-main_8c.html#b4d2b03157ec9554d008ee134e28172c">global_options</a>.<a class="code" href="structMagnifierOptions.html#c719917bdc9caff26d923f34a88b0887">timing_delta_x</a> * (timing_x_pos + x_direction);<a name="l00193"></a>00193 <a name="l00194"></a>00194 <span class="comment">/* Determine if magnifier hit an edge and should reverse direction */</span><a name="l00195"></a>00195 <span class="keywordflow">if</span> (x_roi + (<a class="code" href="magnifier-main_8c.html#a4d434a8b93410ea0ed660e48dac41c6">screen_width</a> / <a class="code" href="magnifier-main_8c.html#b4d2b03157ec9554d008ee134e28172c">global_options</a>.<a class="code" href="structMagnifierOptions.html#002ef34f3ec4073b1a3cdfb9c8378105">zoom_factor</a>) > <a class="code" href="magnifier-main_8c.html#a4d434a8b93410ea0ed660e48dac41c6">screen_width</a>)<a name="l00196"></a>00196 x_direction = -1;<a name="l00197"></a>00197 <span class="keywordflow">else</span> <span class="keywordflow">if</span> (x_roi < 0)<a name="l00198"></a>00198 x_direction = 1;<a name="l00199"></a>00199 <a name="l00200"></a>00200 timing_x_pos += x_direction;<a name="l00201"></a>00201 <a name="l00202"></a>00202 y_roi = <a class="code" href="magnifier-main_8c.html#b4d2b03157ec9554d008ee134e28172c">global_options</a>.<a class="code" href="structMagnifierOptions.html#2a0ccfc882c403b2bae0d2cea8ae9c76">timing_delta_y</a> * timing_y_pos;<a name="l00203"></a>00203 <a name="l00204"></a>00204 <span class="comment">/* Calculate size of screen not covered by magnifier */</span><a name="l00205"></a>00205 <span class="keywordflow">if</span> (<a class="code" href="magnifier-main_8c.html#b4d2b03157ec9554d008ee134e28172c">global_options</a>.<a class="code" href="structMagnifierOptions.html#0869c5d254017a23c3e77e0026c144ba">horizontal_split</a>)<a name="l00206"></a>00206 roi.<a class="code" href="structGNOME__Magnifier__RectBounds__type.html#24de0d98768b0b42dc53ab51950760c0">y1</a> = y_roi + <a class="code" href="magnifier-main_8c.html#3b4a1bd850991355b91c7bfc15247d49">screen_height</a>;<a name="l00207"></a>00207 <span class="keywordflow">else</span><a name="l00208"></a>00208 roi.<a class="code" href="structGNOME__Magnifier__RectBounds__type.html#24de0d98768b0b42dc53ab51950760c0">y1</a> = y_roi;<a name="l00209"></a>00209 roi.<a class="code" href="structGNOME__Magnifier__RectBounds__type.html#3ba20b4c1f0db87a1b9f21169e20b5f3">y2</a> = (screen_height / <a class="code" href="magnifier-main_8c.html#b4d2b03157ec9554d008ee134e28172c">global_options</a>.<a class="code" href="structMagnifierOptions.html#002ef34f3ec4073b1a3cdfb9c8378105">zoom_factor</a>) + roi.<a class="code" href="structGNOME__Magnifier__RectBounds__type.html#24de0d98768b0b42dc53ab51950760c0">y1</a>;<a name="l00210"></a>00210 <a name="l00211"></a>00211 y_roi = <a class="code" href="magnifier-main_8c.html#b4d2b03157ec9554d008ee134e28172c">global_options</a>.<a class="code" href="structMagnifierOptions.html#2a0ccfc882c403b2bae0d2cea8ae9c76">timing_delta_y</a> * (timing_y_pos + y_direction);<a name="l00212"></a>00212 <a name="l00213"></a>00213 <span class="comment">/* The counter is increased each time the y-direction changes */</span><a name="l00214"></a>00214 <span class="keywordflow">if</span> (y_roi + (screen_height / <a class="code" href="magnifier-main_8c.html#b4d2b03157ec9554d008ee134e28172c">global_options</a>.<a class="code" href="structMagnifierOptions.html#002ef34f3ec4073b1a3cdfb9c8378105">zoom_factor</a>) > screen_height) {<a name="l00215"></a>00215 timing_counter++;<a name="l00216"></a>00216 y_direction = -1;<a name="l00217"></a>00217 }<a name="l00218"></a>00218 <span class="keywordflow">else</span> <span class="keywordflow">if</span> (y_roi < 0) {<a name="l00219"></a>00219 timing_counter++;<a name="l00220"></a>00220 y_direction = 1;<a name="l00221"></a>00221 }<a name="l00222"></a>00222 <a name="l00223"></a>00223 timing_y_pos += y_direction;<a name="l00224"></a>00224 <a name="l00225"></a>00225 <span class="keywordflow">if</span> (!<a class="code" href="magnifier_8h.html#971fc276bc83e8071c4b450136ac5d5c">IS_MAGNIFIER</a> (magnifier))<a name="l00226"></a>00226 <span class="keywordflow">return</span> FALSE;<a name="l00227"></a>00227 <a name="l00228"></a>00228 magnifier->priv->cursor_x = (roi.<a class="code" href="structGNOME__Magnifier__RectBounds__type.html#721fd6fb9a4c3c6c3813402b31de633a">x2</a> + roi.<a class="code" href="structGNOME__Magnifier__RectBounds__type.html#da72b580c4e14d8f1dcd85b2da3a8759">x1</a>) / 2;<a name="l00229"></a>00229 magnifier->priv->cursor_y = (roi.<a class="code" href="structGNOME__Magnifier__RectBounds__type.html#3ba20b4c1f0db87a1b9f21169e20b5f3">y2</a> + roi.<a class="code" href="structGNOME__Magnifier__RectBounds__type.html#24de0d98768b0b42dc53ab51950760c0">y1</a>) / 2;<a name="l00230"></a>00230 <a name="l00231"></a>00231 zoom_regions =<a name="l00232"></a>00232 <a class="code" href="GNOME__Magnifier-stubs_8c.html#c33a7910d9b85a8028dcca5cbd95641d">GNOME_Magnifier_Magnifier_getZoomRegions</a> (<a name="l00233"></a>00233 BONOBO_OBJREF (magnifier),<a name="l00234"></a>00234 &ev);<a name="l00235"></a>00235 <a name="l00236"></a>00236 <span class="keywordflow">if</span> (zoom_regions && (zoom_regions-><a class="code" href="structCORBA__sequence__CORBA__Object.html#1c9d5e101124da8d205b44b0cec055fd">_length</a> > 0)) {<a name="l00237"></a>00237 <a name="l00238"></a>00238 <a class="code" href="GNOME__Magnifier-stubs_8c.html#83228cd517d6b914e6b19ed5ead36171">GNOME_Magnifier_ZoomRegion_setROI</a> (<a name="l00239"></a>00239 zoom_regions-><a class="code" href="structCORBA__sequence__CORBA__Object.html#83bd7017c176eb283bae20b433c602dd">_buffer</a>[0], &roi, &ev);<a name="l00240"></a>00240 }<a name="l00241"></a>00241 <a name="l00242"></a>00242 <span class="keywordflow">return</span> TRUE;<a name="l00243"></a>00243 }<a name="l00244"></a>00244 <a name="l00245"></a><a class="code" href="magnifier-main_8c.html#31e24c11fe7b55913887a78bff6ed30e">00245</a> <span class="keyword">static</span> <span class="keywordtype">int</span> <a class="code" href="magnifier-main_8c.html#bbf254766520cad4d7fe189eb184194c">last_x</a> = 0, <a class="code" href="magnifier-main_8c.html#31e24c11fe7b55913887a78bff6ed30e">last_y</a> = 0;<a name="l00246"></a>00246 <a name="l00247"></a>00247 <span class="keyword">static</span> <span class="keywordtype">int</span><a name="l00248"></a><a class="code" href="magnifier-main_8c.html#b22ec9608227fbe62818f04b27d2f639">00248</a> <a class="code" href="magnifier-main_8c.html#b22ec9608227fbe62818f04b27d2f639">magnifier_main_pan_image</a> (gpointer data)<a name="l00249"></a>00249 {<a name="l00250"></a>00250 <a class="code" href="structMagnifier.html">Magnifier</a> *magnifier = (<a class="code" href="structMagnifier.html">Magnifier</a> *) data;<a name="l00251"></a>00251 <a class="code" href="structCORBA__sequence__CORBA__Object.html">GNOME_Magnifier_ZoomRegionList</a> *zoom_regions;<a name="l00252"></a>00252 <a class="code" href="GNOME__Magnifier_8h.html#47a2db1506250f354913a189dfa1bb36">GNOME_Magnifier_ZoomRegion</a> <a class="code" href="magnifier-main_8c.html#7155900ae5785c02d682d6ebdfdfa432">zoom_region</a>;<a name="l00253"></a>00253 CORBA_Environment ev;<a name="l00254"></a>00254 <a class="code" href="structGNOME__Magnifier__RectBounds__type.html">GNOME_Magnifier_RectBounds</a> roi;<a name="l00255"></a>00255 <span class="keywordtype">int</span> mouse_x_return, mouse_y_return;<a name="l00256"></a>00256 <span class="keywordtype">int</span> w, h;<a name="l00257"></a>00257 GdkModifierType mask_return;<a name="l00258"></a>00258 <a name="l00259"></a>00259 CORBA_exception_init (&ev);<a name="l00260"></a>00260 <a name="l00261"></a>00261 <span class="keywordflow">if</span> (<a class="code" href="magnifier-main_8c.html#b4d2b03157ec9554d008ee134e28172c">global_options</a>.<a class="code" href="structMagnifierOptions.html#4adede66ab7d856234a35b97220e2988">mouse_follow</a> && <a class="code" href="magnifier_8h.html#971fc276bc83e8071c4b450136ac5d5c">IS_MAGNIFIER</a> (magnifier))<a name="l00262"></a>00262 {<a name="l00263"></a>00263 gdk_window_get_pointer (
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -