[haiku-commits] r35259 - haiku/trunk/src/servers/app

  • From: axeld@xxxxxxxxxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Sat, 23 Jan 2010 13:43:48 +0100 (CET)

Author: axeld
Date: 2010-01-23 13:43:48 +0100 (Sat, 23 Jan 2010)
New Revision: 35259
Changeset: http://dev.haiku-os.org/changeset/35259/haiku

Modified:
   haiku/trunk/src/servers/app/Decorator.cpp
   haiku/trunk/src/servers/app/Decorator.h
   haiku/trunk/src/servers/app/DefaultDecorator.cpp
   haiku/trunk/src/servers/app/Window.cpp
Log:
* Renamed all DEC_* constants to CLICK_*.
* Renamed DEC_MOVETOBACK to CLICK_MOVE_TO_BACK, and DEC_SLIDETAB to
  CLICK_SLIDE_TAB.


Modified: haiku/trunk/src/servers/app/Decorator.cpp
===================================================================
--- haiku/trunk/src/servers/app/Decorator.cpp   2010-01-23 12:27:17 UTC (rev 
35258)
+++ haiku/trunk/src/servers/app/Decorator.cpp   2010-01-23 12:43:48 UTC (rev 
35259)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2001-2008, Haiku.
+ * Copyright 2001-2010, Haiku.
  * Distributed under the terms of the MIT License.
  *
  * Authors:
@@ -335,7 +335,7 @@
 click_type
 Decorator::Clicked(BPoint point, int32 buttons, int32 modifiers)
 {
-       return DEC_NONE;
+       return CLICK_NONE;
 }
 
 

Modified: haiku/trunk/src/servers/app/Decorator.h
===================================================================
--- haiku/trunk/src/servers/app/Decorator.h     2010-01-23 12:27:17 UTC (rev 
35258)
+++ haiku/trunk/src/servers/app/Decorator.h     2010-01-23 12:43:48 UTC (rev 
35259)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2001-2008, Haiku.
+ * Copyright 2001-2010, Haiku.
  * Distributed under the terms of the MIT License.
  *
  * Authors:
@@ -24,16 +24,16 @@
 
 
 enum click_type {
-       DEC_NONE = 0,
-       DEC_ZOOM,
-       DEC_CLOSE,
-       DEC_MINIMIZE,
-       DEC_TAB,
-       DEC_DRAG,
-       DEC_MOVETOBACK,
-       DEC_SLIDETAB,
+       CLICK_NONE = 0,
+       CLICK_ZOOM,
+       CLICK_CLOSE,
+       CLICK_MINIMIZE,
+       CLICK_TAB,
+       CLICK_DRAG,
+       CLICK_MOVE_TO_BACK,
+       CLICK_SLIDE_TAB,
 
-       DEC_RESIZE,
+       CLICK_RESIZE,
        CLICK_RESIZE_L,
        CLICK_RESIZE_T,
        CLICK_RESIZE_R,

Modified: haiku/trunk/src/servers/app/DefaultDecorator.cpp
===================================================================
--- haiku/trunk/src/servers/app/DefaultDecorator.cpp    2010-01-23 12:27:17 UTC 
(rev 35258)
+++ haiku/trunk/src/servers/app/DefaultDecorator.cpp    2010-01-23 12:43:48 UTC 
(rev 35259)
@@ -537,16 +537,16 @@
        // the user might be clicking on and gradually work our way out into 
larger
        // rectangles.
        if (!(fFlags & B_NOT_CLOSABLE) && fCloseRect.Contains(point))
-               return DEC_CLOSE;
+               return CLICK_CLOSE;
 
        if (!(fFlags & B_NOT_ZOOMABLE) && fZoomRect.Contains(point))
-               return DEC_ZOOM;
+               return CLICK_ZOOM;
 
        if ((buttons & B_SECONDARY_MOUSE_BUTTON) != 0)
-               return DEC_MOVETOBACK;
+               return CLICK_MOVE_TO_BACK;
 
        if (fLook == B_DOCUMENT_WINDOW_LOOK && fResizeRect.Contains(point))
-               return DEC_RESIZE;
+               return CLICK_RESIZE;
 
        if (fTabRect.Contains(point)) {
                // Clicked in the tab
@@ -554,7 +554,7 @@
                // tab sliding in any case if either shift key is held down
                // except sliding up-down by moving mouse left-right would look 
strange
                if ((modifiers & B_SHIFT_KEY) && (fLook != 
kLeftTitledWindowLook))
-                       return DEC_SLIDETAB;
+                       return CLICK_SLIDE_TAB;
        } else if (fLeftBorder.Contains(point) || fRightBorder.Contains(point)
                || fTopBorder.Contains(point) || fBottomBorder.Contains(point)) 
{
                // Clicked on border
@@ -568,17 +568,17 @@
                        BRect temp(BPoint(fBottomBorder.right - 22,
                                fBottomBorder.bottom - 22), 
fBottomBorder.RightBottom());
                        if (temp.Contains(point))
-                               return DEC_RESIZE;
+                               return CLICK_RESIZE;
                }
        } else {
                // Guess user didn't click anything
-               return DEC_NONE;
+               return CLICK_NONE;
        }
 
        if (fWasDoubleClick && !(fFlags & B_NOT_MINIMIZABLE))
-               return DEC_MINIMIZE;
+               return CLICK_MINIMIZE;
 
-       return DEC_DRAG;
+       return CLICK_DRAG;
 }
 
 
@@ -1015,7 +1015,7 @@
        int32 index = (fButtonFocus ? 0 : 1) + (GetClose() ? 0 : 2);
        ServerBitmap* bitmap = fCloseBitmaps[index];
        if (bitmap == NULL) {
-               bitmap = _GetBitmapForButton(DEC_CLOSE, GetClose(), 
fButtonFocus,
+               bitmap = _GetBitmapForButton(CLICK_CLOSE, GetClose(), 
fButtonFocus,
                        rect.IntegerWidth(), rect.IntegerHeight(), this);
                fCloseBitmaps[index] = bitmap;
        }
@@ -1068,7 +1068,7 @@
        int32 index = (fButtonFocus ? 0 : 1) + (GetZoom() ? 0 : 2);
        ServerBitmap* bitmap = fZoomBitmaps[index];
        if (bitmap == NULL) {
-               bitmap = _GetBitmapForButton(DEC_ZOOM, GetZoom(), fButtonFocus,
+               bitmap = _GetBitmapForButton(CLICK_ZOOM, GetZoom(), 
fButtonFocus,
                        rect.IntegerWidth(), rect.IntegerHeight(), this);
                fZoomBitmaps[index] = bitmap;
        }
@@ -1310,14 +1310,14 @@
        BRect rect(0, 0, width - 1, height - 1);
 
        STRACE(("DefaultDecorator creating bitmap for %s %sfocus %s at size 
%ldx%ld\n",
-               item == DEC_CLOSE ? "close" : "zoom", focus ? "" : "non-",
+               item == CLICK_CLOSE ? "close" : "zoom", focus ? "" : "non-",
                down ? "down" : "up", width, height));
        switch (item) {
-               case DEC_CLOSE:
+               case CLICK_CLOSE:
                        object->_DrawBlendedRect(sBitmapDrawingEngine, rect, 
down, focus);
                        break;
 
-               case DEC_ZOOM:
+               case CLICK_ZOOM:
                {
                        // init the background
                        sBitmapDrawingEngine->FillRect(rect, 
B_TRANSPARENT_COLOR);

Modified: haiku/trunk/src/servers/app/Window.cpp
===================================================================
--- haiku/trunk/src/servers/app/Window.cpp      2010-01-23 12:27:17 UTC (rev 
35258)
+++ haiku/trunk/src/servers/app/Window.cpp      2010-01-23 12:43:48 UTC (rev 
35259)
@@ -791,61 +791,61 @@
        if (windowModifier || inBorderRegion) {
                // clicking Window visible area
 
-               click_type action = DEC_NONE;
+               click_type action = CLICK_NONE;
                int32 buttons = _ExtractButtons(message);
 
                if (inBorderRegion && fDecorator != NULL)
                        action = _ActionFor(message, buttons, modifiers);
                else {
                        if ((buttons & B_SECONDARY_MOUSE_BUTTON) != 0)
-                               action = DEC_MOVETOBACK;
+                               action = CLICK_MOVE_TO_BACK;
                        else if ((fFlags & B_NOT_MOVABLE) == 0 && fDecorator != 
NULL)
-                               action = DEC_DRAG;
+                               action = CLICK_DRAG;
                }
 
                if (!desktopSettings.AcceptFirstClick()) {
                        // ignore clicks on decorator buttons if the
                        // non-floating window doesn't have focus
-                       if (!IsFocus() && !IsFloating() && action != 
DEC_MOVETOBACK
-                               && action != DEC_RESIZE && action != 
DEC_SLIDETAB)
-                               action = DEC_DRAG;
+                       if (!IsFocus() && !IsFloating() && action != 
CLICK_MOVE_TO_BACK
+                               && action != CLICK_RESIZE && action != 
CLICK_SLIDE_TAB)
+                               action = CLICK_DRAG;
                }
 
                // set decorator internals
                switch (action) {
-                       case DEC_CLOSE:
+                       case CLICK_CLOSE:
                                fIsClosing = true;
-                               STRACE_CLICK(("===> DEC_CLOSE\n"));
+                               STRACE_CLICK(("===> CLICK_CLOSE\n"));
                                break;
 
-                       case DEC_ZOOM:
+                       case CLICK_ZOOM:
                                fIsZooming = true;
-                               STRACE_CLICK(("===> DEC_ZOOM\n"));
+                               STRACE_CLICK(("===> CLICK_ZOOM\n"));
                                break;
 
-                       case DEC_MINIMIZE:
+                       case CLICK_MINIMIZE:
                                if ((Flags() & B_NOT_MINIMIZABLE) == 0) {
                                        fIsMinimizing = true;
-                                       STRACE_CLICK(("===> DEC_MINIMIZE\n"));
+                                       STRACE_CLICK(("===> CLICK_MINIMIZE\n"));
                                }
                                break;
 
-                       case DEC_DRAG:
+                       case CLICK_DRAG:
                                fIsDragging = true;
                                fLastMousePosition = where;
-                               STRACE_CLICK(("===> DEC_DRAG\n"));
+                               STRACE_CLICK(("===> CLICK_DRAG\n"));
                                break;
 
-                       case DEC_RESIZE:
+                       case CLICK_RESIZE:
                                fIsResizing = true;
                                fLastMousePosition = where;
-                               STRACE_CLICK(("===> DEC_RESIZE\n"));
+                               STRACE_CLICK(("===> CLICK_RESIZE\n"));
                                break;
 
-                       case DEC_SLIDETAB:
+                       case CLICK_SLIDE_TAB:
                                fIsSlidingTab = true;
                                fLastMousePosition = where;
-                               STRACE_CLICK(("===> DEC_SLIDETAB\n"));
+                               STRACE_CLICK(("===> CLICK_SLIDE_TAB\n"));
                                break;
 
                        default:
@@ -875,7 +875,7 @@
                        fRegionPool.Recycle(visibleBorder);
                }
 
-               if (action == DEC_MOVETOBACK) {
+               if (action == CLICK_MOVE_TO_BACK) {
                        if (desktopSettings.MouseMode() == 
B_CLICK_TO_FOCUS_MOUSE) {
                                bool covered = true;
                                BRegion fullRegion;
@@ -899,7 +899,7 @@
                        else {
                                fDesktop->SetFocusWindow(this);
                                if (desktopSettings.MouseMode() == 
B_FOCUS_FOLLOWS_MOUSE
-                                       && (action == DEC_DRAG || action == 
DEC_RESIZE)) {
+                                       && (action == CLICK_DRAG || action == 
CLICK_RESIZE)) {
                                        fActivateOnMouseUp = true;
                                        fMouseMoveDistance = 0.0f;
                                        fLastMoveTime = system_time();
@@ -963,7 +963,7 @@
                if (fIsZooming) {
                        fIsZooming = false;
                        fDecorator->SetZoom(false);
-                       if (action == DEC_ZOOM) {
+                       if (action == CLICK_ZOOM) {
                                invalidate = true;
                                fWindow->NotifyZoom();
                        }
@@ -971,7 +971,7 @@
                if (fIsClosing) {
                        fIsClosing = false;
                        fDecorator->SetClose(false);
-                       if (action == DEC_CLOSE) {
+                       if (action == CLICK_CLOSE) {
                                invalidate = true;
                                fWindow->NotifyQuitRequested();
                        }
@@ -979,7 +979,7 @@
                if (fIsMinimizing) {
                        fIsMinimizing = false;
                        fDecorator->SetMinimize(false);
-                       if (action == DEC_MINIMIZE) {
+                       if (action == CLICK_MINIMIZE) {
                                invalidate = true;
                                fWindow->NotifyMinimize(true);
                        }
@@ -1075,11 +1075,11 @@
                engine->ConstrainClippingRegion(visibleBorder);
 
                if (fIsZooming) {
-                       fDecorator->SetZoom(_ActionFor(message) == DEC_ZOOM);
+                       fDecorator->SetZoom(_ActionFor(message) == CLICK_ZOOM);
                } else if (fIsClosing) {
-                       fDecorator->SetClose(_ActionFor(message) == DEC_CLOSE);
+                       fDecorator->SetClose(_ActionFor(message) == 
CLICK_CLOSE);
                } else if (fIsMinimizing) {
-                       fDecorator->SetMinimize(_ActionFor(message) == 
DEC_MINIMIZE);
+                       fDecorator->SetMinimize(_ActionFor(message) == 
CLICK_MINIMIZE);
                }
 
                engine->UnlockParallelAccess();
@@ -2240,7 +2240,7 @@
 Window::_ActionFor(const BMessage* message) const
 {
        if (fDecorator == NULL)
-               return DEC_NONE;
+               return CLICK_NONE;
 
        int32 buttons = _ExtractButtons(message);
        int32 modifiers = _ExtractModifiers(message);
@@ -2253,11 +2253,11 @@
        int32 modifiers) const
 {
        if (fDecorator == NULL)
-               return DEC_NONE;
+               return CLICK_NONE;
 
        BPoint where;
        if (message->FindPoint("where", &where) != B_OK)
-               return DEC_NONE;
+               return CLICK_NONE;
 
        return fDecorator->Clicked(where, buttons, modifiers);
 }


Other related posts: