diff mde/gui/renderer/IRenderer.d @ 41:b3a6ca4516b4

The renderer now controls which parts of the window border allow resizing. committer: Diggory Hardy <diggory.hardy@gmail.com>
author Diggory Hardy <diggory.hardy@gmail.com>
date Tue, 13 May 2008 12:02:36 +0100
parents 8c4c96f04e7f
children 1530d9c04d4d
line wrap: on
line diff
--- a/mde/gui/renderer/IRenderer.d	Thu May 08 16:05:51 2008 +0100
+++ b/mde/gui/renderer/IRenderer.d	Tue May 13 12:02:36 2008 +0100
@@ -39,17 +39,29 @@
         }
     }
     
-    /// An enum for border types
-    enum BORDER_TYPES {
-        WINDOW_TOTAL,
-        WINDOW_RESIZE,
+    /** Use to set and reset these parameters, and to get the border size (which may depend on
+     * them). */
+    BorderDimensions setSizable (bool wSizable, bool hSizable);
+    
+    /// Which edges of a window are being resized
+    enum RESIZE_TYPE : ubyte {
+        NONE = 0x0, L = 0x1, R = 0x2, T = 0x4, B = 0x8
     }
     
-    /** Return the renderer's window border width.
-     *
-     * Type should be an element of BORDER_TYPES; if not the method may throw or simply return
-     * without an error. */
-    BorderDimensions getBorder (BORDER_TYPES type);
+    /** Used to tell if a click on a window's border is for resizing or moving.
+    *
+    * Depends on setSizable's parameters.
+    *
+    * Params:
+    *   cx =
+    *   cy = click coordinates relative to window border
+    *   w  =
+    *   h  = window size
+    *
+    * Returns:
+    *   RESIZE_TYPE = NONE for a move, an or'd combination of L/R/T/B for resizing.
+    */
+    RESIZE_TYPE getResizeType (int cx, int cy, int w, int h);
     
     /** Return the renderer's between-widget spacing (for layout widgets). */
     int layoutSpacing ();