From: Enlightenment S. <no-...@en...> - 2010-07-18 18:52:58
|
Log: Eliminate GetZoomEWin() and InZoom(). Author: kwo Date: 2010-07-18 11:52:52 -0700 (Sun, 18 Jul 2010) New Revision: 50350 Modified: trunk/E16/e/src/ewin-ops.c trunk/E16/e/src/ewins.c trunk/E16/e/src/ewins.h trunk/E16/e/src/ipc.c trunk/E16/e/src/zoom.c Modified: trunk/E16/e/src/ewin-ops.c =================================================================== --- trunk/E16/e/src/ewin-ops.c 2010-07-18 18:52:50 UTC (rev 50349) +++ trunk/E16/e/src/ewin-ops.c 2010-07-18 18:52:52 UTC (rev 50350) @@ -534,9 +534,6 @@ if (!ewin) return; - if (GetZoomEWin() == ewin) - Zoom(NULL); - if (ewin->state.inhibit_iconify) return; @@ -547,6 +544,8 @@ return; call_depth++; + Zoom(ewin, 0); + /* Save position at which the window was iconified */ EwinRememberPositionSet(ewin); @@ -751,7 +750,7 @@ if ((ewin->border->border.left == 0) && (ewin->border->border.right == 0) && (ewin->border->border.top == 0) && (ewin->border->border.bottom == 0)) return; - if (GetZoomEWin() == ewin) + if (ewin->state.zoomed) return; if (ewin->state.shaded && !force) return; @@ -801,7 +800,7 @@ XSetWindowAttributes att; int x, y, w, h; - if (GetZoomEWin() == ewin) + if (ewin->state.zoomed) return; if (!ewin->state.shaded) return; @@ -1036,7 +1035,7 @@ if ((ewin->border->border.left == 0) && (ewin->border->border.right == 0) && (ewin->border->border.top == 0) && (ewin->border->border.bottom == 0)) return; - if (GetZoomEWin() == ewin) + if (ewin->state.zoomed) return; if (ewin->state.shaded || ewin->state.shading || ewin->state.iconified) return; @@ -1258,7 +1257,7 @@ { _ewin_shade_data *esd; - if (GetZoomEWin() == ewin) + if (ewin->state.zoomed) return; TIMER_DEL(ewin->timer); if (!ewin->state.shaded || ewin->state.shading || ewin->state.iconified) Modified: trunk/E16/e/src/ewins.c =================================================================== --- trunk/E16/e/src/ewins.c 2010-07-18 18:52:50 UTC (rev 50349) +++ trunk/E16/e/src/ewins.c 2010-07-18 18:52:52 UTC (rev 50350) @@ -1019,8 +1019,7 @@ { /* The client may have been unmapped but the frame is not yet */ - if (GetZoomEWin() == ewin) - Zoom(NULL); + Zoom(ewin, 0); MoveResizeEnd(ewin); } Modified: trunk/E16/e/src/ewins.h =================================================================== --- trunk/E16/e/src/ewins.h 2010-07-18 18:52:50 UTC (rev 50349) +++ trunk/E16/e/src/ewins.h 2010-07-18 18:52:52 UTC (rev 50350) @@ -92,6 +92,7 @@ unsigned maximized_horz:1; unsigned maximized_vert:1; unsigned fullscreen:1; + unsigned zoomed:1; unsigned active:1; unsigned modal:1; @@ -475,9 +476,7 @@ #define EwinListGetAll EwinListStackGet /* zoom.c */ -EWin *GetZoomEWin(void); +void Zoom(EWin * ewin, int on); void ReZoom(EWin * ewin); -char InZoom(void); -void Zoom(EWin * ewin); #endif /* _EWIN_H_ */ Modified: trunk/E16/e/src/ipc.c =================================================================== --- trunk/E16/e/src/ipc.c 2010-07-18 18:52:50 UTC (rev 50349) +++ trunk/E16/e/src/ipc.c 2010-07-18 18:52:52 UTC (rev 50350) @@ -669,10 +669,9 @@ break; case EWIN_OP_ZOOM: - if (InZoom()) - Zoom(NULL); - else - Zoom(ewin); + on = ewin->state.zoomed; + if (SetEwinBoolean(wop->name, &on, param1, 1)) + Zoom(ewin, on); break; case EWIN_OP_LAYER: Modified: trunk/E16/e/src/zoom.c =================================================================== --- trunk/E16/e/src/zoom.c 2010-07-18 18:52:50 UTC (rev 50349) +++ trunk/E16/e/src/zoom.c 2010-07-18 18:52:52 UTC (rev 50350) @@ -162,30 +162,16 @@ return mode; } -EWin * -GetZoomEWin(void) -{ - return zoom_last_ewin; -} - void ReZoom(EWin * ewin) { if (zoom_last_ewin && ewin == zoom_last_ewin) { - Zoom(NULL); - Zoom(ewin); + Zoom(ewin, 0); + Zoom(ewin, 1); } } -char -InZoom(void) -{ - if (zoom_last_ewin) - return 1; - return 0; -} - static void ZoomInit(void) { @@ -220,7 +206,7 @@ } void -Zoom(EWin * ewin) +Zoom(EWin * ewin, int on) { const XF86VidModeModeInfo *mode; @@ -230,7 +216,7 @@ if (zoom_can <= 0) return; - if (!ewin) + if (!on) { if (zoom_last_ewin) { @@ -247,6 +233,7 @@ EDestroyWindow(zoom_mask_4); SwitchRes(0, 0, 0, 0, 0); EwinWarpTo(ewin, 1); + ewin->state.zoomed = 0; ESync(0); zoom_last_ewin = NULL; } @@ -289,6 +276,7 @@ EwinRaise(ewin); EwinBorderGetSize(ewin, &bl, &br, &bt, &bb); EwinMove(ewin, -bl + x1, -bt + y1); + ewin->state.zoomed = 1; FocusToEWin(ewin, FOCUS_SET); EwinWarpTo(ewin, 1); #if 0 /* Doesn't work as intended */ @@ -309,24 +297,12 @@ #else -EWin * -GetZoomEWin(void) -{ - return NULL; -} - void ReZoom(EWin * ewin) { ewin = NULL; } -char -InZoom(void) -{ - return 0; -} - void Zoom(EWin * ewin) { |