msg.h

Go to the documentation of this file.
00001 /**
00002  * \file msg.h <gre/msg.h>
00003  * \brief GRE::MSG class definitions
00004  *
00005  * \if NODOC
00006  * $Id: msg.h_v 1.7 2004/01/15 15:09:55 mju Exp $
00007  *
00008  * $Log: msg.h_v $
00009  * Revision 1.7  2004/01/15 15:09:55  mju
00010  * Add action_seqmask and action_none.
00011  *
00012  * Revision 1.6  2004/01/13 17:40:52  mju
00013  * Add unsequenced version of all action types so can index through table.
00014  *
00015  * Revision 1.5  2003/09/15 13:48:59  fileserver!dwilliss
00016  * Doxygen
00017  *
00018  * Revision 1.4  2003/07/30 15:32:09  mju
00019  * Ignore private sections.
00020  *
00021  * Revision 1.3  2003/06/24 20:23:02  mju
00022  * nc.
00023  *
00024  * Revision 1.2  2003/06/24 16:24:28  mju
00025  * Move VIEWEXPOSE msg here.
00026  *
00027  * Revision 1.1  2003/06/16 19:39:52  mju
00028  * Initial revision
00029  * \endif
00030 **/
00031 
00032 #ifndef  INC_GRE_MSG_H
00033 #define  INC_GRE_MSG_H
00034 
00035 #ifndef  INC_GRE_BASE_H
00036    #include <gre/base.h>
00037 #endif
00038 
00039 #ifndef  INC_MI32_ELEMTYPE_H
00040    #include <mi32/elemtype.h>
00041 #endif
00042 
00043 #ifndef  INC_MI32_RECT_H
00044    #include <mi32/rect.h>
00045 #endif
00046 
00047 //===================================================================================================================
00048 
00049 //! Callback message container.
00050 class GRE_CALLBACK_MSG {
00051    public:
00052 
00053       enum ACTION {
00054          ACTION_SeqNone =           0x0000,  //!< No sequence associated with action
00055          ACTION_SeqBegin =          0x1000,  //!< Beginning of action, will be followed (eventually) by same action with SeqEnd or SeqCancel
00056          ACTION_SeqEnd =            0x2000,  //!< Ending of action
00057          ACTION_SeqContinue =       0x4000,  //!< Continuing action
00058          ACTION_SeqCancel =         0x8000,  //!< Action cancelled
00059          ACTION_SeqMask =           0xF000,  //!< Mask for sequence
00060 
00061          ACTION_None =                    (0),                    //! No action (never actually sent to msg handler)
00062          ACTION_Create =                  (1|ACTION_SeqNone),     //! Object has just been created
00063          ACTION_Destroy =                 (2|ACTION_SeqNone),     //! Object is being destroyed
00064          ACTION_Selected =                (3|ACTION_SeqNone),     //! Object has been selected in list
00065          ACTION_Deselected =              (4|ACTION_SeqNone),     //! Object has been deselected in list
00066          ACTION_Change =                  (5|ACTION_SeqNone),     //! Unsequenced change made to object
00067          ACTION_ChangeBegin =             (5|ACTION_SeqBegin),    //! Begin non-specific change to object
00068          ACTION_ChangeEnd =               (5|ACTION_SeqEnd),      //! End non-specific change to object
00069          ACTION_ChangeCancel =            (5|ACTION_SeqCancel),   //! Cancel non-specific change to object
00070          ACTION_Expose =                  (6|ACTION_SeqNone),     //! Exposure event occurred for view DrawingArea
00071          ACTION_Draw =                    (7|ACTION_SeqNone),     //! Unsequenced draw operation
00072          ACTION_DrawBegin =               (7|ACTION_SeqBegin),    //! Begin draw operation
00073          ACTION_DrawEnd =                 (7|ACTION_SeqEnd),      //! End draw operation
00074          ACTION_DrawCancel =              (7|ACTION_SeqCancel),   //! Cancel draw operation
00075          ACTION_ChangeOrder =             (8|ACTION_SeqNone),     //! Change to order of object in list
00076          ACTION_ChangeOrderBegin =        (8|ACTION_SeqBegin),    //! Begin change to order of object in list
00077          ACTION_ChangeOrderEnd =          (8|ACTION_SeqEnd),      //! End change to order of object in list
00078          ACTION_CreateChildren =          (9|ACTION_SeqNone),     //! Creating children of object
00079          ACTION_CreateChildrenBegin =     (9|ACTION_SeqBegin),    //! Begin creating children of object
00080          ACTION_CreateChildrenEnd =       (9|ACTION_SeqEnd),      //! End creating children of object
00081          ACTION_DestroyChildren =         (10|ACTION_SeqNone),    //! Destroying children of object
00082          ACTION_DestroyChildrenBegin =    (10|ACTION_SeqBegin),   //! Begin destroying children of object
00083          ACTION_DestroyChildrenEnd =      (10|ACTION_SeqEnd),     //! End destroying children of object
00084          ACTION_ChangeObject =            (11|ACTION_SeqNone),    //! Selected object(s) for layer changed
00085          ACTION_ChangeName =              (12|ACTION_SeqNone),    //! Object name changed
00086          ACTION_Resized =                 (13|ACTION_SeqNone),    //! Object (view) has been resized
00087          ACTION_ElementSelect =           (14|ACTION_SeqNone),    //! Change to element highlight set
00088          ACTION_ElementSelectBegin =      (14|ACTION_SeqBegin),   //! Begin change to element highlight set
00089          ACTION_ElementSelectEnd =        (14|ACTION_SeqEnd),     //! End change to element highlight set
00090          ACTION_ChangeActiveElem =        (15|ACTION_SeqNone),    //! Active element changed (for layer)
00091          ACTION_RightButtonPress =        (16|ACTION_SeqNone),    //! Right mouse button pressed with no tool position set
00092          ACTION_ChangeVisible =           (17|ACTION_SeqNone),    //! Unsequenced visibility change for object
00093          ACTION_ChangeVisibleBegin =      (17|ACTION_SeqBegin),   //! Begin visibility change for object
00094          ACTION_ChangeVisibleEnd =        (17|ACTION_SeqEnd),     //! End visibility change for object
00095          ACTION_CursorEnter =             (18|ACTION_SeqNone),    //! Cursor has entered view
00096          ACTION_CursorLeave =             (19|ACTION_SeqNone),    //! Cursor has moved out of view
00097          ACTION_CreateView =              (20|ACTION_SeqNone),    //! Created view of object
00098          ACTION_Load =                    (21|ACTION_SeqNone),    //! Load layout/group
00099          ACTION_LoadBegin =               (21|ACTION_SeqBegin),   //! Begin load layout/group
00100          ACTION_LoadEnd =                 (21|ACTION_SeqEnd),     //! End load layout/group
00101          ACTION_Restore =                 (22|ACTION_SeqNone),    //! Restoring view from memory image
00102          ACTION_RestoreBegin =            (22|ACTION_SeqBegin),   //! Begin restoring view from memory image
00103          ACTION_RestoreContinue =         (22|ACTION_SeqContinue),//! Continue restoring view from memory image
00104          ACTION_RestoreEnd =              (22|ACTION_SeqEnd),     //! Begin restoring view from memory image
00105          ACTION_CloseRequest =            (23|ACTION_SeqNone),    //! User has requested "Close" on object
00106          ACTION_DataTipShown =            (24|ACTION_SeqNone),    //! DataTip has been shown in view
00107          ACTION_DataTipHidden =           (25|ACTION_SeqNone),    //! DataTip has been hidden in view
00108          ACTION_DestroyView =             (26|ACTION_SeqNone),    //! View of object about to be destroyed
00109          ACTION_DeactivateTool =          (27|ACTION_SeqNone),    //! Active tool for view about to be deactivated
00110          ACTION_ActivateTool =            (28|ACTION_SeqNone),    //! Active tool for view about to be activated
00111          ACTION_ElementSelectAll =        (29|ACTION_SeqNone),    //! Selecting/deselecting all elements
00112          ACTION_ElementSelectAllBegin =   (29|ACTION_SeqBegin),   //! Begin selecting/deselecting all elements
00113          ACTION_ElementSelectAllEnd =     (29|ACTION_SeqEnd),     //! End selecting/deselecting all elements
00114          ACTION_StyleObjEdited =          (30|ACTION_SeqNone),    //! Style object for layer has been edited
00115          ACTION_OverlayUpdate =           (31|ACTION_SeqNone),    //! Overlay update needed
00116          ACTION_Edited =                  (32|ACTION_SeqNone),    //! Object (layer) has been "edited" (for TNTedit)
00117          ACTION_ExtractedFrom =           (33|ACTION_SeqNone),    //! Object (layer) has been extracted from
00118          ACTION_SetComponentSelectable =  (34|ACTION_SeqNone),    //! Component has been made selectable/nonselectable
00119          ACTION_SetShowInternalTables =   (35|ACTION_SeqNone),    //! Change made to "show internal tables" setting
00120          ACTION_SetShowScaleRanges =      (36|ACTION_SeqNone),    //! Change made to "show scale ranges" setting
00121          ACTION_DrawMatte =               (37|ACTION_SeqNone),    //! Drawing Matte
00122          ACTION_DrawMatteBegin =          (37|ACTION_SeqBegin),   //! Begin Drawing Matte
00123          ACTION_DrawMatteEnd =            (37|ACTION_SeqEnd),     //! End Drawing Matte
00124          ACTION_ChangeLegend =            (38|ACTION_SeqNone),    //! Begin legend change for object
00125          ACTION_ChangeLegendBegin =       (38|ACTION_SeqBegin),   //! Begin legend change for object
00126          ACTION_ChangeLegendEnd =         (38|ACTION_SeqEnd),     //! End legend change for object
00127          ACTION_MAXTYPE =                 38                      //! Maximum action type
00128          };
00129 
00130       GRE_CALLBACK_MSG (
00131          ACTION action,
00132          GRE_OBJECT *object,
00133          GRE_VIEW *view = 0,
00134          ELEMTYPE elemtype = ELEMTYPE_Empty
00135          ) :
00136          m_action(action),
00137          m_object(object),
00138          m_view(view),
00139          m_elemtype(elemtype)
00140          {
00141          }
00142 
00143       GRE_CALLBACK_MSG (
00144          ACTION action,
00145          GRE_OBJECT *object,
00146          ELEMTYPE elemtype
00147          ) :
00148          m_action(action),
00149          m_object(object),
00150          m_view(0),
00151          m_elemtype(elemtype)
00152          {
00153          }
00154 
00155       //! Get action which caused this message to be sent.
00156       //! @return action type
00157       ACTION GetAction (
00158          ) const { return (m_action); }
00159 
00160       //! Get element type if applicable.
00161       //! @return element type
00162       ELEMTYPE GetElemType (
00163          ) const { return (m_elemtype); }
00164 
00165       //! Get object to which message applies.
00166       //! @return object pointer
00167       GRE_OBJECT* GetObject (
00168          ) const { return (m_object); }
00169 
00170       //! Get view message originated from if any.
00171       //! @return view pointer or 0 if not applicable
00172       GRE_VIEW* GetView (
00173          ) const { return (m_view); }
00174 
00175    private:
00176       #ifndef GENERATING_DOXYGEN_OUTPUT
00177 
00178       ACTION m_action;
00179       GRE_OBJECT *m_object;
00180       GRE_VIEW *m_view;
00181       ELEMTYPE m_elemtype;
00182 
00183       #endif //!< GENERATING_DOXYGEN_OUTPUT
00184    };
00185 
00186 
00187 //===================================================================================================================
00188 
00189 class GRE_CALLBACK_MSG_VIEWEXPOSE : public GRE_CALLBACK_MSG {
00190    public:
00191 
00192       //! Constructor.
00193       GRE_CALLBACK_MSG_VIEWEXPOSE (
00194          GRE_VIEW *view,
00195          const LRECT2D& rect,
00196          ACTION action = ACTION_Expose
00197          );
00198 
00199       //! Get rectangle for exposed area.
00200       const LRECT2D& GetRect (
00201          ) const { return (m_rect); }
00202 
00203    private:
00204       #ifndef GENERATING_DOXYGEN_OUTPUT
00205       LRECT2D m_rect;
00206       #endif //!< GENERATING_DOXYGEN_OUTPUT
00207    };
00208 
00209 //===================================================================================================================
00210 
00211 #endif   //!< INC_GRE_MSG_H

Generated on Tue Dec 14 13:18:14 2004 for TNTsdk by  doxygen 1.3.8-20040913