/usr/include/wxsmith/wxwidgets/wxsevents.h is in libwxsmithlib-dev 13.12+dfsg-4.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 | /*
* This file is part of wxSmith plugin for Code::Blocks Studio
* Copyright (C) 2006-2007 Bartlomiej Swiecki
*
* wxSmith is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* wxSmith is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with wxSmith. If not, see <http://www.gnu.org/licenses/>.
*
* $Revision: 8251 $
* $Id: wxsevents.h 8251 2012-08-28 02:31:00Z ollydbg $
* $HeadURL: http://svn.code.sf.net/p/codeblocks/code/branches/release-xx.yy/src/plugins/contrib/wxSmith/wxwidgets/wxsevents.h $
*/
#ifndef WXSEVENTS_H
#define WXSEVENTS_H
#include <wx/arrstr.h>
#include <tinyxml/tinyxml.h>
#include <wx/arrstr.h>
#include "wxscodercontext.h"
// Forward declarations
class wxsItem;
/** \brief Structure describing one event */
struct wxsEventDesc
{
enum EntryType
{
Id, ///< \brief Event using one identifier
IdRange, ///< \brief Event using range of identifiers
NoId, ///< \brief Event without id (can be used for root element only)
Category, ///< \brief Not really entry, but starts new category
EndOfList ///< \brief End of list of events
};
EntryType ET; ///< \brief Type of entry
wxString Entry; ///< \brief Name of entry inside event table
wxString Type; ///< \brief Macro of event type used inside event table
wxString ArgType; ///< \brief Name of type of argument passed to event-processing function
wxString NewFuncNameBase; ///< \brief Base for new function name, it will be created as "On" + VarName + NewFuncName
};
/** \brief Beginning definition of events array (source file) */
#define WXS_EV_BEGIN(name) \
static wxsEventDesc name[] = {
/** \brief Adding new event into list (entry without id, will be connected to widget using wxsEvtHandler::Connect function) */
#define WXS_EV(entry,type,arg,funcbase) \
{ wxsEventDesc::NoId, _T(#entry), _T(#type), _T(#arg), _T(#funcbase) } ,
/** \brief Adding new event into list (entry with id, standard one) */
#define WXS_EVI(entry,type,arg,funcbase) \
{ wxsEventDesc::Id, _T(#entry), _T(#type), _T(#arg), _T(#funcbase) } ,
/** \brief Adding new event into list (entry using range of ids, currently not supported by wxSmith, but may be in future) */
#define WXS_EV2I(entry,type,arg,funcbase) \
{ wxsEventDesc::IdRange, _T(#entry), _T(#type), _T(#arg), _T(#funcbase) } ,
/** \brief Beginning new category */
#define WXS_EV_CATEGORY(name) \
{ wxsEventDesc::Category, name, _T(""), _T(""), _T("") },
/** \brief Ending creation of list */
#define WXS_EV_END() \
{ wxsEventDesc::EndOfList, _T(""), _T(""), _T(""), _T("") } };
/** \brief Adding all default paint events */
#define WXS_EV_PAINT() \
WXS_EV_CATEGORY(_("Paint events")) \
WXS_EV(EVT_PAINT,wxEVT_PAINT,wxPaintEvent,Paint) \
WXS_EV(EVT_ERASE_BACKGROUND,wxEVT_ERASE_BACKGROUND,wxEraseEvent,EraseBackground) \
/** \brief Adding all keyboard events */
#define WXS_EV_KEYBOARD() \
WXS_EV_CATEGORY(_("Keyboard events")) \
WXS_EV(EVT_KEY_DOWN,wxEVT_KEY_DOWN,wxKeyEvent,KeyDown) \
WXS_EV(EVT_KEY_UP,wxEVT_KEY_UP,wxKeyEvent,KeyUp) \
WXS_EV(EVT_CHAR,wxEVT_CHAR,wxKeyEvent,Char) \
WXS_EV(EVT_SET_FOCUS,wxEVT_SET_FOCUS,wxFocusEvent,SetFocus) \
WXS_EV(EVT_KILL_FOCUS,wxEVT_KILL_FOCUS,wxFocusEvent,KillFocus)
#define WXS_EV_MOUSE() \
WXS_EV_CATEGORY(_T("Mouse events")) \
WXS_EV(EVT_LEFT_DOWN,wxEVT_LEFT_DOWN,wxMouseEvent,LeftDown) \
WXS_EV(EVT_LEFT_UP,wxEVT_LEFT_UP,wxMouseEvent,LeftUp) \
WXS_EV(EVT_LEFT_DCLICK,wxEVT_LEFT_DCLICK,wxMouseEvent,LeftDClick) \
WXS_EV(EVT_MIDDLE_DOWN,wxEVT_MIDDLE_DOWN,wxMouseEvent,MiddleDown) \
WXS_EV(EVT_MIDDLE_UP,wxEVT_MIDDLE_UP,wxMouseEvent,MiddleUp) \
WXS_EV(EVT_MIDDLE_DCLICK,wxEVT_MIDDLE_DCLICK,wxMouseEvent,MiddleDClick) \
WXS_EV(EVT_RIGHT_DOWN,wxEVT_RIGHT_DOWN,wxMouseEvent,RightDown) \
WXS_EV(EVT_RIGHT_UP,wxEVT_RIGHT_UP,wxMouseEvent,RightUp) \
WXS_EV(EVT_RIGHT_DCLICK,wxEVT_RIGHT_DCLICK,wxMouseEvent,RightDClick) \
WXS_EV(EVT_MOTION,wxEVT_MOTION,wxMouseEvent,MouseMove) \
WXS_EV(EVT_ENTER_WINDOW,wxEVT_ENTER_WINDOW,wxMouseEvent,MouseEnter) \
WXS_EV(EVT_LEAVE_WINDOW,wxEVT_LEAVE_WINDOW,wxMouseEvent,MouseLeave) \
WXS_EV(EVT_MOUSEWHEEL,wxEVT_MOUSEWHEEL,wxMouseEvent,MouseWheel) \
WXS_EV(EVT_SET_CURSOR,wxEVT_SET_CURSOR,wxSetCursorEvent,SetCursor) \
/** \brief Adding all size-related events */
#define WXS_EV_SIZE() \
WXS_EV(EVT_SIZE,wxEVT_SIZE,wxSizeEvent,Resize)
/** \brief Adding all default events */
#define WXS_EV_DEFAULTS() \
WXS_EV_PAINT() \
WXS_EV_KEYBOARD() \
WXS_EV_MOUSE() \
WXS_EV_SIZE()
/** \brief Class managing events used by item
*
* This class manages event used by widget (but it's not responsible for editing
* them).
*
* After building new wxsEvents class, SetEventArray() should be called to
* connect class with specified set of events
*
*/
class wxsEvents
{
public:
/** \brief Ctor */
wxsEvents(const wxsEventDesc* Events,wxsItem* Item);
/** \brief Getting number of events */
inline int GetCount() { return m_Count; }
/** \brief Getting event description */
inline const wxsEventDesc* GetDesc(int Index) { return &m_EventArray[Index]; }
/** \brief Getting event handler name */
inline const wxString& GetHandler(int Index) { return m_Functions[Index]; }
/** \brief Setting event handler name */
inline void SetHandler(int Index,const wxString& Name) { m_Functions[Index] = Name; }
/** \brief Function generating code which binds events with main resource class
*
* Connecting events is done through wxsEvtHandler::Connect function.
* Event table is not used because not all events could be processed.
*/
void GenerateBindingCode(wxsCoderContext* Context,const wxString& IdString,const wxString& VarNameString);
/** \brief Function loading associated function names from Xml node. */
void XmlLoadFunctions(TiXmlElement* Element);
/** \brief Function adding handlers to given Xml element */
void XmlSaveFunctions(TiXmlElement* Element);
private:
wxsItem* m_Item; ///< Item whose events are managed
const wxsEventDesc* m_EventArray; ///< Array of events fetched from item
wxArrayString m_Functions; ///< Array of function names used for each entry item
int m_Count; ///< Number of events
};
#endif
|