1 // This file is part of Golly. 2 // See docs/License.html for the copyright notice. 3 4 #ifndef _WXRENDER_H_ 5 #define _WXRENDER_H_ 6 7 // Routines and data for rendering the viewport window: 8 9 void DestroyDrawingData(); 10 // Call this when the main window is destroyed. 11 12 void DrawView(int tileindex); 13 // Draw the current pattern, grid lines, selection, etc. 14 // The given tile index is only used when drawing tiled layers. 15 16 void DrawOneIcon(wxDC& dc, int x, int y, wxBitmap* icon, 17 unsigned char deadr, unsigned char deadg, unsigned char deadb, 18 unsigned char liver, unsigned char liveg, unsigned char liveb, 19 bool multicolor); 20 // Draw the given icon using the given dead cell and live cell colors. 21 // This routine does not use OpenGL -- it's for drawing icons outside the 22 // viewport (eg. in the edit bar). 23 24 class Layer; 25 26 void InitPaste(Layer* pastelayer, wxRect& bbox); 27 // Initialize some globals used to draw the pattern stored in pastelayer. 28 // The given bounding box is not necessarily the *minimal* bounding box because 29 // the paste pattern might have blank borders (in fact it could be empty). 30 31 void CreateTranslucentControls(); 32 // Create the bitmap for translucent controls and set controlswd and 33 // controlsht. Must be called BEFORE the viewport window is created. 34 35 extern int controlswd; // width of translucent controls 36 extern int controlsht; // height of translucent controls 37 38 // control ids must match button order in controls bitmap 39 typedef enum { 40 NO_CONTROL = 0, // no current control (must be first) 41 STEP1_CONTROL, // set step exponent to zero (ie. step by 1) 42 SLOWER_CONTROL, // decrease step exponent 43 FASTER_CONTROL, // increase step exponent 44 FIT_CONTROL, // fit entire pattern in viewport 45 ZOOMIN_CONTROL, // zoom in 46 ZOOMOUT_CONTROL, // zoom out 47 NW_CONTROL, // pan north west 48 UP_CONTROL, // pan up 49 NE_CONTROL, // pan north east 50 LEFT_CONTROL, // pan left 51 MIDDLE_CONTROL, // pan to 0,0 52 RIGHT_CONTROL, // pan right 53 SW_CONTROL, // pan south west 54 DOWN_CONTROL, // pan down 55 SE_CONTROL // pan south east 56 } control_id; 57 58 extern control_id currcontrol; // currently clicked control 59 60 control_id WhichControl(int x, int y); 61 // Return the control at the given location in the controls bitmap. 62 63 #endif 64