1 /* 2 3 Copyright (C) 2015-2018 Night Dive Studios, LLC. 4 5 This program is free software: you can redistribute it and/or modify 6 it under the terms of the GNU General Public License as published by 7 the Free Software Foundation, either version 3 of the License, or 8 (at your option) any later version. 9 10 This program is distributed in the hope that it will be useful, 11 but WITHOUT ANY WARRANTY; without even the implied warranty of 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 GNU General Public License for more details. 14 15 You should have received a copy of the GNU General Public License 16 along with this program. If not, see <http://www.gnu.org/licenses/>. 17 18 */ 19 #ifndef __MFDGADG_H 20 #define __MFDGADG_H 21 22 /* 23 * $Source: n:/project/cit/src/inc/RCS/mfdgadg.h $ 24 * $Revision: 1.5 $ 25 * $Author: mahk $ 26 * $Date: 1994/02/16 09:27:14 $ 27 * 28 * $Log: mfdgadg.h $ 29 * Revision 1.5 1994/02/16 09:27:14 mahk 30 * Fixed prototype bug. 31 * 32 * Revision 1.4 1994/02/16 09:23:57 mahk 33 * Added more goofy operations. 34 * 35 * Revision 1.3 1993/12/08 10:31:59 mahk 36 * Changed to mfdint.h 37 * 38 * Revision 1.2 1993/10/20 05:47:23 mahk 39 * Added a slider gadget. 40 * 41 * Revision 1.1 1993/09/15 10:50:30 mahk 42 * Initial revision 43 * 44 * 45 */ 46 47 // Includes 48 #include "mfdint.h" 49 #include "mfdext.h" 50 #include "mfddims.h" 51 52 //-------------------------------------------------------------------------------- 53 // MFD GADGETS 54 // 55 // As the name suggests, this file is a set of simple gadgets usable in MFDs. 56 57 // ------------------- 58 // BUTTON ARRAYS 59 // ------------------- 60 61 // A button array is a matrix of buttons. MFD button arrays do not 62 // draw themselves, only handle input. 63 64 // Defines 65 66 typedef uchar (*MFDBttnCallback)(MFD *mfd, LGPoint button, uiEvent *ev, void *data); 67 68 // Prototypes 69 errtype MFDBttnArrayInit(MFDhandler *h, LGRect *r, LGPoint bdims, LGPoint bsize, MFDBttnCallback cb, void *cbdata); 70 // Initialize h to handle a buttonarray in rect r of bdims.x buttons across by bdims.y buttons down. bsize 71 // describes the pixel dimensions of each button. Whenever a button is clicked on, cb will be called with the 72 // coordinates of the button, the mouse event, and the value of cbdata. 73 74 errtype MFDBttnArrayShutdown(MFDhandler *h); 75 // shuts down a button array. 76 77 errtype MFDBttnArrayResize(MFDhandler *h, LGRect *r, LGPoint bdims, LGPoint bsize); 78 // Changes the dimensions of an mfd button array. 79 80 // Globals 81 82 // ------------------ 83 // SLIDERS 84 // ------------------ 85 86 // A slider is a linear "analog" control. 87 88 typedef uchar (*MFDSliderCallback)(MFD *mfd, short val, uiEvent *ev, void *data); 89 90 errtype MFDSliderInit(MFDhandler *h, LGRect *r, MFDSliderCallback cb, void *data); 91 // Create a (horizontal) slider in a particular sub-rect of the MFD. 92 // Whenever the slider is adjusted, the callbad will be called with the 93 // mouse event and the horizontal (relative) position of the slider. 94 #endif // __MFDGADG_H 95