/* -*- c++ -*- FILE: WidgetsX.h RCS REVISION: $Revision: 1.13 $ 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: This is the Athena Widgets version of the Widgets interface. */ #ifndef WIDGETSX_H #define WIDGETSX_H #include "Widgets.h" #include #include #include #include class WidgetsX; class MacroManager; // XXX class WidgetsX: public Widgets { public: WidgetsX(Preferences&, EventHandler*, Widget toplevel, Widget& drawingwindow); virtual ~WidgetsX(); // ButtonData* is an array virtual void addMenuButton(char *name, int nbuttons, ButtonData*); virtual void addButton(ButtonData); virtual char* getMacroName(int i); virtual void* addMacro(char* name, void* prev_ui_data); virtual void removeMacro(void* ui_data); // Create a dialog box with up to three buttons. virtual void createDialog(char *s, int nbuttons, ButtonData*); virtual void destroyDialog(); virtual void updateFastButton(int fast_automoves); virtual void debuggingHack(MacroManager*); private: class MacroUIData { public: MacroUIData(Widget box, Widget apply, Widget invert, MacroUIData* prev) : box(box), apply(apply), invert(invert), prev(prev), next(0) { } Widget box; Widget apply; Widget invert; MacroUIData* prev; MacroUIData* next; }; static int const MAX_DIALOGS = 10;// maximum simultaneous dialog boxes EventHandler* event_handler; Widget buttonbox; Widget macrosform; Widget toplevel; Widget bigform; Widget drawingwindow; Widget deletebutton; Widget macrocontrols; Widget fast_toggle; static XtActionsRec actions[]; Widget transientshells[MAX_DIALOGS]; EventHandler::Callback** dialog_callbacks[MAX_DIALOGS]; int cur_transientshell; static std::map apply_to_ui_data; static std::map invert_to_ui_data; // Functions that we wish were part of Xt // Use this function to get the size of a widget that's not // managed yet. static void XtForceDimensionsOfUnmanagedWidget(Widget w); static void XtGetLowerRight(Widget w, Position *x, Position *y); static void XtSetLowerRight(Widget w, Position x, Position y); static void XtGetCenter(Widget w, Position *x, Position *y); static void XtSetCenter(Widget w, Position x, Position y); static void macroApply_cb(Widget, XtPointer arg, XtPointer); static void macroInvert_cb(Widget, XtPointer arg, XtPointer); static void callCallback(Widget, XtPointer arg, XtPointer); void resizeToplevelToMatchBigform(); void createMacrosForm(); }; #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: