📄 gmag-events_8c-source.html
字号:
<a name="l00426"></a>00426 elem = g_queue_peek_head_link (mag_windows_list);<a name="l00427"></a>00427 <span class="keywordflow">while</span> (elem) {<a name="l00428"></a>00428 pgmag_win = (<a class="code" href="struct__GmagWin.html">GmagWinPtr</a>) elem->data;<a name="l00429"></a>00429 if (pgmag_win->damaged) {<a name="l00430"></a>00430 gmag_events_paint_window (pgmag_win,<a name="l00431"></a>00431 pgmag_win->damaged_region);<a name="l00432"></a>00432 XFixesSetRegion (dpy_conn,<a name="l00433"></a>00433 pgmag_win->damaged_region, 0, 0);<a name="l00434"></a>00434 pgmag_win->damaged = FALSE;<a name="l00435"></a>00435 }<a name="l00436"></a>00436 <a name="l00437"></a>00437 elem = g_list_next (elem);<a name="l00438"></a>00438 }<a name="l00439"></a>00439 }<a name="l00440"></a>00440 <a name="l00441"></a>00441 <span class="keyword">static</span> <span class="keywordtype">void</span><a name="l00442"></a>00442 gmag_events_circulate_notify_handler (XEvent *ev)<a name="l00443"></a>00443 {<a name="l00444"></a>00444 GList *elem;<a name="l00445"></a>00445 <a class="code" href="struct__GmagWin.html">GmagWinPtr</a> pgmag_win;<a name="l00446"></a>00446 <a name="l00447"></a>00447 <span class="preprocessor">#ifdef COMPOSITE_DEBUG</span><a name="l00448"></a>00448 <span class="preprocessor"></span> printf (<span class="stringliteral">"Received CirculateNotify event: 0x%x\n"</span>,<a name="l00449"></a>00449 (guint) ev->xcirculate.window);<a name="l00450"></a>00450 <span class="preprocessor">#endif </span><span class="comment">/* COMPOSITE_DEBUG */</span><a name="l00451"></a>00451 <span class="keywordflow">if</span> (ev->xcirculate.window == <a class="code" href="gmag-events_8c.html#d64ddbbd54eee237f99ba13f9d5c8655">mag_window</a>) {<a name="l00452"></a>00452 <span class="preprocessor">#ifdef HAVE_OVERLAY</span><a name="l00453"></a>00453 <span class="preprocessor"></span><span class="preprocessor">#ifdef COMPOSITE_DEBUG</span><a name="l00454"></a>00454 <span class="preprocessor"></span> printf (<span class="stringliteral">"Overlay window = 0x%x\n"</span>,<a name="l00455"></a>00455 (guint) gmag_events_overlay_window);<a name="l00456"></a>00456 <span class="preprocessor">#endif </span><span class="comment">/* COMPOSITE_DEBUG */</span><a name="l00457"></a>00457 <span class="preprocessor">#endif </span><span class="comment">/* HAVE_OVERLAY */</span><a name="l00458"></a>00458 <span class="keywordflow">return</span>;<a name="l00459"></a>00459 }<a name="l00460"></a>00460 elem = g_queue_find_custom (mag_windows_list,<a name="l00461"></a>00461 (gconstpointer) ev->xcirculate.window,<a name="l00462"></a>00462 (GCompareFunc) gmag_events_g_compare_func);<a name="l00463"></a>00463 <span class="keywordflow">if</span> (elem) {<a name="l00464"></a>00464 pgmag_win = (<a class="code" href="struct__GmagWin.html">GmagWinPtr</a>) elem->data;<a name="l00465"></a>00465 g_queue_remove (mag_windows_list, pgmag_win);<a name="l00466"></a>00466 <span class="keywordflow">if</span> (ev->xcirculate.place == PlaceOnTop) {<a name="l00467"></a>00467 g_queue_push_tail (mag_windows_list,<a name="l00468"></a>00468 pgmag_win);<a name="l00469"></a>00469 <span class="keywordflow">if</span> (pgmag_win->attr.map_state == IsViewable) {<a name="l00470"></a>00470 XFixesSubtractRegion (<a name="l00471"></a>00471 dpy_conn,<a name="l00472"></a>00472 tmp_region, pgmag_win->win_region,<a name="l00473"></a>00473 pgmag_win->clip);<a name="l00474"></a>00474 XFixesUnionRegion (<a name="l00475"></a>00475 dpy_conn,<a name="l00476"></a>00476 exp_region, exp_region, tmp_region);<a name="l00477"></a>00477 }<a name="l00478"></a>00478 } <span class="keywordflow">else</span> {<a name="l00479"></a>00479 g_queue_push_head (mag_windows_list,<a name="l00480"></a>00480 pgmag_win);<a name="l00481"></a>00481 <span class="keywordflow">if</span> (pgmag_win->attr.map_state == IsViewable)<a name="l00482"></a>00482 XFixesUnionRegion (<a name="l00483"></a>00483 dpy_conn,<a name="l00484"></a>00484 exp_region, exp_region,<a name="l00485"></a>00485 pgmag_win->clip);<a name="l00486"></a>00486 }<a name="l00487"></a>00487 }<a name="l00488"></a>00488 }<a name="l00489"></a>00489 <a name="l00490"></a>00490 <span class="keyword">static</span> <span class="keywordtype">void</span><a name="l00491"></a>00491 gmag_events_configure_notify_handler (XEvent *ev)<a name="l00492"></a>00492 {<a name="l00493"></a>00493 GList *elem;<a name="l00494"></a>00494 <a class="code" href="struct__GmagWin.html">GmagWinPtr</a> pgmag_win;<a name="l00495"></a>00495 <a name="l00496"></a>00496 <span class="preprocessor">#ifdef COMPOSITE_DEBUG</span><a name="l00497"></a>00497 <span class="preprocessor"></span> printf (<span class="stringliteral">"Received ConfigureNotify event: 0x%x\n"</span>,<a name="l00498"></a>00498 (guint) ev->xconfigure.window);<a name="l00499"></a>00499 <span class="preprocessor">#endif </span><span class="comment">/* COMPOSITE_DEBUG */</span><a name="l00500"></a>00500 <span class="keywordflow">if</span> (ev->xconfigure.window == <a class="code" href="gmag-events_8c.html#d64ddbbd54eee237f99ba13f9d5c8655">mag_window</a>) {<a name="l00501"></a>00501 <span class="preprocessor">#ifdef HAVE_OVERLAY</span><a name="l00502"></a>00502 <span class="preprocessor"></span><span class="preprocessor">#ifdef COMPOSITE_DEBUG</span><a name="l00503"></a>00503 <span class="preprocessor"></span> printf (<span class="stringliteral">"Overlay window = 0x%x\n"</span>,<a name="l00504"></a>00504 (guint) gmag_events_overlay_window);<a name="l00505"></a>00505 <span class="preprocessor">#endif </span><span class="comment">/* COMPOSITE_DEBUG */</span><a name="l00506"></a>00506 <span class="preprocessor">#endif </span><span class="comment">/* HAVE_OVERLAY */</span><a name="l00507"></a>00507 <span class="keywordflow">return</span>;<a name="l00508"></a>00508 }<a name="l00509"></a>00509 elem = g_queue_find_custom (mag_windows_list,<a name="l00510"></a>00510 (gconstpointer) ev->xconfigure.window,<a name="l00511"></a>00511 (GCompareFunc) gmag_events_g_compare_func);<a name="l00512"></a>00512 <span class="keywordflow">if</span> (elem) {<a name="l00513"></a>00513 pgmag_win = (<a class="code" href="struct__GmagWin.html">GmagWinPtr</a>) elem->data;<a name="l00514"></a>00514 if ((pgmag_win->attr.x != ev->xconfigure.x) ||<a name="l00515"></a>00515 (pgmag_win->attr.y != ev->xconfigure.y) ||<a name="l00516"></a>00516 (pgmag_win->attr.width != ev->xconfigure.width) ||<a name="l00517"></a>00517 (pgmag_win->attr.height != ev->xconfigure.height) ||<a name="l00518"></a>00518 (pgmag_win->attr.border_width !=<a name="l00519"></a>00519 ev->xconfigure.border_width)) {<a name="l00520"></a>00520 <span class="comment">/* If an attribute of the window has changed we could</span><a name="l00521"></a>00521 <span class="comment"> * have an exposed area that is not reported due to the</span><a name="l00522"></a>00522 <span class="comment"> * overlay window. So we subtract the new region, from</span><a name="l00523"></a>00523 <span class="comment"> * the old one, and we have the value of the exposed</span><a name="l00524"></a>00524 <span class="comment"> * region that must be repainted.</span><a name="l00525"></a>00525 <span class="comment"> */</span><a name="l00526"></a>00526 pgmag_win->attr.x = ev->xconfigure.x;<a name="l00527"></a>00527 pgmag_win->attr.y = ev->xconfigure.y;<a name="l00528"></a>00528 pgmag_win->attr.width = ev->xconfigure.width;<a name="l00529"></a>00529 pgmag_win->attr.height = ev->xconfigure.height;<a name="l00530"></a>00530 pgmag_win->attr.border_width =<a name="l00531"></a>00531 ev->xconfigure.border_width;<a name="l00532"></a>00532 <a name="l00533"></a>00533 <span class="keywordflow">if</span> (pgmag_win->attr.map_state == IsViewable) {<a name="l00534"></a>00534 XFixesCopyRegion (<a name="l00535"></a>00535 dpy_conn,<a name="l00536"></a>00536 old_region, pgmag_win->clip);<a name="l00537"></a>00537 gmag_events_calculate_window_clip (pgmag_win);<a name="l00538"></a>00538 XFixesCopyRegion (<a name="l00539"></a>00539 dpy_conn,<a name="l00540"></a>00540 new_region, pgmag_win->clip);<a name="l00541"></a>00541 XFixesUnionRegion (<a name="l00542"></a>00542 dpy_conn,<a name="l00543"></a>00543 exp_region, exp_region, old_region);<a name="l00544"></a>00544 XFixesUnionRegion (<a name="l00545"></a>00545 dpy_conn,<a name="l00546"></a>00546 exp_region, exp_region, new_region);<a name="l00547"></a>00547 }<a name="l00548"></a>00548 }<a name="l00549"></a>00549 <span class="keywordflow">if</span> (!ev->xconfigure.above) {<a name="l00550"></a>00550 g_queue_remove (mag_windows_list, pgmag_win);<a name="l00551"></a>00551 g_queue_push_head (mag_windows_list,<a name="l00552"></a>00552 pgmag_win);<a name="l00553"></a>00553 <span class="keywordflow">if</span> (pgmag_win->attr.map_state == IsViewable) {<a name="l00554"></a>00554 XFixesUnionRegion (<a name="l00555"></a>00555 dpy_conn,<a name="l00556"></a>00556 exp_region, exp_region,<a name="l00557"></a>00557 pgmag_win->win_region);<a name="l00558"></a>00558 }<a name="l00559"></a>00559 } <span class="keywordflow">else</span> {<a name="l00560"></a>00560 elem = g_queue_find_custom (<a name="l00561"></a>00561 mag_windows_list,<a name="l00562"></a>00562 (gconstpointer) ev->xconfigure.above,<a name="l00563"></a>00563 (GCompareFunc) gmag_events_g_compare_func);<a name="l00564"></a>00564 <span class="keywordflow">if</span> (elem) {<a name="l00565"></a>00565 g_queue_remove (mag_windows_list,<a name="l00566"></a>00566 pgmag_win);<a name="l00567"></a>00567 g_queue_insert_after (mag_windows_list,<a name="l00568"></a>00568 elem, pgmag_win);<a name="l00569"></a>00569 <span class="keywordflow">if</span> (pgmag_win->attr.map_state == IsViewable) {<a name="l00570"></a>00570 XFixesUnionRegion (<a name="l00571"></a>00571 dpy_conn,<a name="l00572"></a>00572 exp_region, exp_region,<a name="l00573"></a>00573 pgmag_win->win_region);<a name="l00574"></a>00574 }
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -