/* -*- c++ -*- FILE: Machine.h RCS REVISION: $Revision: 1.16 $ 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 Machine 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 display. See EventHandler.h for caveats. */ #ifndef MACHINE_H #define MACHINE_H #include "EventHandler.h" class Widgets; class PuzzleState; class Preferences; class Machine { public: typedef void (EventHandler::*event_handler)(EventHandler::Event*, void *arg); virtual ~Machine() {}; static Machine* createMachine(EventHandler*, int& argc, char *argv[], Preferences& prefs, char const* machine_type); virtual void init(PuzzleState*) = 0; virtual void drawFrame(struct frame *) = 0; virtual void frontBuffer() = 0; virtual void backBuffer() = 0; virtual void swapBuffers() = 0; virtual void addEventHandler(unsigned int eventmask, event_handler handler, void *arg = 0) = 0; virtual void eventLoop() = 0; virtual void setColors() = 0; virtual void toggleOutline() = 0; virtual void turnBackgroundBlack() = 0; virtual void turnBackgroundWhite() = 0; virtual void bell() = 0; virtual bool getEventIfThereIsOne(int eventmask, EventHandler::Event* event) = 0; virtual Widgets* getWidgets() = 0; protected: Machine() {}; // puzzle_state is under external control PuzzleState* puzzle_state; private: // Prohibit copying and assignment Machine(Machine const&); Machine& operator=(Machine&); }; #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: