comparison mde/gui/renderer/IRenderer.d @ 58:d43523ed4b62

Included a wdim typedef for all variables to do with window position or size instead of just using int.
author Diggory Hardy <diggory.hardy@gmail.com>
date Sat, 14 Jun 2008 17:15:06 +0100
parents 1530d9c04d4d
children 25cb7420dc91
comparison
equal deleted inserted replaced
57:9e1f05fbbcef 58:d43523ed4b62
14 along with this program. If not, see <http://www.gnu.org/licenses/>. */ 14 along with this program. If not, see <http://www.gnu.org/licenses/>. */
15 15
16 /** Interface for the renderer. This is planned to replace decoration.d */ 16 /** Interface for the renderer. This is planned to replace decoration.d */
17 module mde.gui.renderer.IRenderer; 17 module mde.gui.renderer.IRenderer;
18 18
19 public import mde.gui.IGui; // wdim type is used by just about everything including this
20
19 /** Interface for renderers. 21 /** Interface for renderers.
20 * 22 *
21 * Renderers provide unified drawing methods for widget, e.g. to draw a window background, a frame, 23 * Renderers provide unified drawing methods for widget, e.g. to draw a window background, a frame,
22 * or a button. The renderer will effectively be synonymous with the theme, except that a scripted 24 * or a button. The renderer will effectively be synonymous with the theme, except that a scripted
23 * renderer may also be available. 25 * renderer may also be available.
27 { 29 {
28 //BEGIN Get dimensions 30 //BEGIN Get dimensions
29 /// A container for the dimensions 31 /// A container for the dimensions
30 struct BorderDimensions { 32 struct BorderDimensions {
31 /// The dimensions: left, top, right, bottom 33 /// The dimensions: left, top, right, bottom
32 ubyte l, t, r, b; 34 wdim l, t, r, b;
33 35
34 void opAddAssign (BorderDimensions d) { 36 void opAddAssign (BorderDimensions d) {
35 l += d.l; 37 l += d.l;
36 t += d.t; 38 t += d.t;
37 r += d.r; 39 r += d.r;
59 * h = window size 61 * h = window size
60 * 62 *
61 * Returns: 63 * Returns:
62 * RESIZE_TYPE = NONE for a move, an or'd combination of L/R/T/B for resizing. 64 * RESIZE_TYPE = NONE for a move, an or'd combination of L/R/T/B for resizing.
63 */ 65 */
64 RESIZE_TYPE getResizeType (int cx, int cy, int w, int h); 66 RESIZE_TYPE getResizeType (wdim cx, wdim cy, wdim w, wdim h);
65 67
66 /** Return the renderer's between-widget spacing (for layout widgets). */ 68 /** Return the renderer's between-widget spacing (for layout widgets). */
67 int layoutSpacing (); 69 wdim layoutSpacing ();
68 //END Get dimensions 70 //END Get dimensions
69 71
70 //BEGIN draw routines 72 //BEGIN draw routines
71 /** Draw a window border plus background. */ 73 /** Draw a window border plus background. */
72 void drawWindow (int x, int y, int w, int h); 74 void drawWindow (wdim x, wdim y, wdim w, wdim h);
73 75
74 /** Draws a widget background. Usually doesn't do anything since backgrounds are transparent. */ 76 /** Draws a widget background. Usually doesn't do anything since backgrounds are transparent. */
75 void drawWidgetBack (int x, int y, int w, int h); 77 void drawWidgetBack (wdim x, wdim y, wdim w, wdim h);
76 78
77 /** Draws a blank widget (temporary) */ 79 /** Draws a blank widget (temporary) */
78 void drawBlank (int x, int y, int w, int h); 80 void drawBlank (wdim x, wdim y, wdim w, wdim h);
79 81
80 /** Draws a button frame, in if pushed == true. */ 82 /** Draws a button frame, in if pushed == true. */
81 void drawButton (int x, int y, int w, int h, bool pushed); 83 void drawButton (wdim x, wdim y, wdim w, wdim h, bool pushed);
82 //END draw routines 84 //END draw routines
83 } 85 }