/* -*- c++ -*- FILE: Widgets.h RCS REVISION: $Revision: 1.19 $ COPYRIGHT: (c) 1999 -- 2003 Melinda Green, Don Hatch, and Jay Berkenbilt - Superliminal Software LICENSE: Free to use and modify for non-commercial purposes as long as the following conditions are adhered to: 1) Obvious credit for the source of this code and the designs it embodies are clearly made, and 2) Ports and derived versions of 4D Magic Cube programs are not distributed without the express written permission of the authors. DESCRIPTION: Generic Widgets interface. This class defines a generic interface that can be used as a base class for the machine-dependent (or sytem-dependent) code that handles the creation of user interface objects on the display. */ #ifndef WIDGETS_H #define WIDGETS_H #include "EventHandler.h" class Preferences; class MacroManager; // XXX class Widgets { public: virtual ~Widgets() {}; class ButtonData { public: ButtonData(char *l = 0, EventHandler::callback_fn cb = 0, void* cbd = 0) : label(l), callback(cb), cb_arg(cbd) { } char *label; EventHandler::callback_fn callback; void *cb_arg; }; // ButtonData* is an array virtual void addMenuButton(char *name, int nbuttons, ButtonData*) = 0; virtual void addButton(ButtonData) = 0; virtual char* getMacroName(int i) = 0; virtual void* addMacro(char* name, void* prev_ui_data) = 0; virtual void removeMacro(void* ui_data) = 0; // Create a dialog box with up to three buttons. virtual void createDialog(char *s, int nbuttons, ButtonData*) = 0; virtual void destroyDialog() = 0; // Make fast button properly reflect state of fast_automoves virtual void updateFastButton(int fast_automoves) = 0; virtual void debuggingHack(MacroManager*) = 0; protected: Widgets(Preferences& p) : preferences(p) { } Preferences& preferences; }; #endif // Local Variables: // c-basic-offset: 4 // c-comment-only-line-offset: 0 // c-file-offsets: ((defun-block-intro . +) (block-open . 0) (substatement-open . 0) (statement-cont . +) (statement-case-open . +4) (arglist-intro . +) (arglist-close . +) (inline-open . 0)) // indent-tabs-mode: nil // End: