11 #ifndef __WXLUAWRAPS_H__
12 #define __WXLUAWRAPS_H__
20 #include "wx/editor/candoc.h"
28 #include "wxbind/include/wxcore_bind.h"
30 #include "wxlua/wxlstate.h"
31 #include "wxlua/wxlbind.h"
34 #include "wx/luawraps/wxledit.h"
36 #define a2dLUAWRAP_VERSION "1.0"
38 #ifdef A2DLUAWRAPMAKINGDLL
39 #define A2DLUAWRAPDLLEXP WXEXPORT
40 #define A2DLUAWRAPDLLEXP_DATA(type) WXEXPORT type
41 #define A2DLUAWRAPDLLEXP_CTORFN
42 #elif defined(WXART2D_USINGDLL)
43 #define A2DLUAWRAPDLLEXP WXIMPORT
44 #define A2DLUAWRAPDLLEXP_DATA(type) WXIMPORT type
45 #define A2DLUAWRAPDLLEXP_CTORFN
46 #else // not making nor using DLL
47 #define A2DLUAWRAPDLLEXP
48 #define A2DLUAWRAPDLLEXP_DATA(type) type
49 #define A2DLUAWRAPDLLEXP_CTORFN
66 a2dCanvasObjectLua(
double x = 0 ,
double y = 0,
const wxString& script = wxT(
"" ),
const wxString&
function = wxT(
"" ) );
79 void SetField( wxLuaState lst,
const wxString& field,
const wxString& value );
80 void SetField( wxLuaState lst,
const wxString& field,
long value );
81 void SetField( wxLuaState lst,
const wxString& field,
double value );
82 void SetField( wxLuaState lst,
const wxString& field,
bool value );
83 void SetField( wxLuaState lst,
const wxString& name, wxColour value );
91 #endif //wxART2D_USE_CVGIO
125 const wxPoint& pos = wxDefaultPosition,
126 const wxSize& size = wxDefaultSize,
128 long options = WXLUAIDE_DEFAULT,
129 const wxString& name = wxT(
"a2dLuaConsole" ) );
131 void OnLua( wxLuaEvent& event );
139 DECLARE_EVENT_TABLE();
149 long style = ( wxDEFAULT_DIALOG_STYLE ),
const wxString& name = _T(
"frame" ) );
155 void OnCloseWindow( wxCloseEvent& event );
165 void OnCharHook( wxKeyEvent& event );
175 DECLARE_EVENT_TABLE()
195 bool initialize =
true,
196 int maxCommands = -1 );
210 bool Execute(
const wxString& commandsString,
bool withUndo = TRUE );
212 virtual bool ExecuteF(
bool withUndo, wxChar* Format, ... );
214 bool ExecuteFile(
const wxString& fileName );
216 bool ShowDlg(
const a2dCommandId* comID,
bool modal,
bool onTop );
220 bool FileOpen(
const wxString& path );
224 bool FileSaveAs(
const wxString& path,
bool silent =
true );
226 bool FileImport(
const wxString& path,
const wxString& description );
228 bool FileExport(
const wxString& path,
const wxString& description,
bool silent =
true );
231 bool PushTool(
const a2dCommandId& which,
bool shiftadd =
false,
bool oneshot =
false );
233 bool SetDocumentLayers(
const wxString& propertyname,
const wxString& value );
236 a2dLayers* LoadLayers(
const wxString& filename );
239 bool SetLayersDocument(
a2dLayers* layers );
240 bool SetLayersGlobal(
a2dLayers* layers );
242 bool SaveLayersDocument(
const wxString& filename );
243 bool SaveLayersGlobal(
const wxString& filename );
245 bool SetLayer( wxUint16 layer );
247 bool SetTarget( wxUint16 target );
249 bool ClearGroup(
const wxString& group );
251 bool UnGroup(
bool selected,
bool deep );
258 bool ConvertToArcsGroupA(
bool detectCircle =
false );
259 bool ConvertPolygonToArcsGroupA(
bool detectCircle =
false );
260 bool ConvertToPolygonPolylinesWithArcsGroupA();
261 bool ConvertToPolygonPolylinesWithoutArcsGroupA();
262 bool ConvertPolylineToArcsGroupA();
263 bool ConvertToVPathsGroupA();
264 bool ConvertLinesArcsGroupA();
265 bool ConvertToPolylinesGroupA();
266 bool DetectSmallGroupA();
267 bool RemoveRedundantGroupA();
269 void AddGroupA( wxUint16 layer );
270 void AddGroupB( wxUint16 layer );
271 void SetSelectedOnlyA(
bool selectedOnlyA );
272 bool GetSelectedOnlyA();
273 void SetSelectedOnlyB(
bool selectedOnlyB );
274 bool GetSelectedOnlyB();
277 #if wxART2D_USE_KBOOL
279 #endif //wxART2D_USE_KBOOL
281 bool Message(
const wxString& message );
283 bool SetVariable(
const wxString& varname,
const wxString& varvalue );
285 wxString GetVariable(
const wxString& varname );
287 void AddConfigPath(
const wxString& path );
289 void AddLayersPath(
const wxString& path );
291 void AddFontPath(
const wxString& path );
293 void AddImagePath(
const wxString& path );
295 void AddIconPath(
const wxString& path );
297 bool SetSnap(
bool snap );
299 bool SetSnapFeatures( wxUint32 features );
301 void SetCursor(
double x,
double y );
303 bool Find(
const wxString& objectname );
305 bool Ask(
const wxString& variablename,
const wxString& mes );
307 bool AskFile(
const wxString& storeInVariable,
308 const wxString& message = _(
"Give Name of file" ),
309 const wxString& defaultDir = _T(
"./" ),
310 const wxString& extension = _T(
"*" ),
311 const wxString& fileFilter = _T(
"*" )
315 const wxString& message = _(
"Give Name of file" ),
316 const wxString& defaultDir = _T(
"./" ),
317 const wxString& extension = _T(
"*" ),
318 const wxString& fileFilter = _T(
"*" )
321 bool ShowVariable(
const wxString& variableName,
const wxString& message );
323 bool ViewAsImageAdv(
const wxFileName& file, wxBitmapType type,
bool onView =
false );
325 bool DrawWireFrame(
bool onOff =
true );
326 bool DrawGridLines(
bool onOff =
true );
327 bool DrawGridAtFront(
bool onOff =
true );
328 bool DrawGrid(
bool onOff =
true );
331 bool InsertGroupRef(
double x,
double y );
332 bool AddGroupObject(
const wxString& groupName,
double x = 0,
double y = 0, wxUint16 layer = 0 );
333 bool NewPin(
double x,
double y,
const wxString& groupname );
334 bool PushInto(
const wxString& name );
337 bool SelectedChangeLayer(
long layer );
338 bool SetFillStrokeSelected();
341 bool DeleteSelected();
342 bool MoveSelected(
double x,
double y,
long layer );
343 bool CopySelected(
double x,
double y,
long layer );
344 bool TransformSelected(
const wxString& str );
358 a2dOrigin* Add_a2dOrigin(
double w,
double h );
361 a2dRectC* Add_a2dRectC(
double xc,
double yc,
double w,
double h,
double angle = 0 ,
double radius = 0 );
364 a2dArrow* Add_a2dArrow(
double xt,
double yt,
double l1,
double l2,
double b,
bool spline =
false );
367 a2dRect* Add_a2dRect(
double x,
double y,
double w,
double h ,
double radius = 0 );
370 a2dCircle* Add_a2dCircle(
double x,
double y,
double radius );
373 a2dEllipse* Add_a2dEllipse(
double xc,
double yc,
double width,
double height );
376 a2dEllipticArc* Add_a2dEllipticArc(
double xc,
double yc,
double width,
double height,
double start,
double end );
379 a2dArc* Add_a2dArc(
double xc,
double yc,
double radius,
double start,
double end );
382 a2dSLine* Add_a2dSLine(
double x1,
double y1,
double x2,
double y2 );
385 a2dEndsLine* Add_a2dEndsLine(
double x1,
double y1,
double x2,
double y2 );
388 a2dImage* Add_a2dImage(
const wxImage& image,
double xc,
double yc,
double w,
double h );
391 a2dImage* Add_a2dImage(
const wxString& imagefile, wxBitmapType type,
double xc,
double yc,
double w,
double h );
394 a2dText* Add_a2dText(
const wxString& text,
double x,
double y,
double angle,
const a2dFont& font );
402 bool Add_Point(
double x,
double y );
404 bool Move_Point(
int index ,
double x,
double y );
406 wxLuaState& GetLuaState() {
return m_interp; }
409 bool IsShowna2dLuaExecDlg();
417 bool ShowLuaExecDlg();
425 extern const long SCRIPT_lua_script;
426 extern const long EXECDLG_lua;
431 DECLARE_EVENT_TABLE()
447 const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxDEFAULT_FRAME_STYLE );
453 bool CallLuaScriptThemeFunction(
const wxString& fileName,
const wxString&
function );
455 void OnUpdateUI( wxUpdateUIEvent& event );
457 void OnShowExecDlg2( wxCommandEvent& event );
459 void OnRunScript( wxCommandEvent& event );
a2dCircle at x,y, and with radius
wxString AskFile(const wxString &message, const wxString &default_path="", const wxString &default_filename="", const wxString &default_extension="", const wxString &wildcard="*.*", int flags=0, int x=-1, int y=-1)
ask for a file using a file selector.
all basic primitives derived from a2dCanvasObject
a2dCanvasObjectReference is a reference to any a2dCanvasObject derived class.
virtual a2dObject * DoClone(CloneOptions options, a2dRefMap *refs) const
Clone this object and return a pointer to the new object.
class to map references to objects stored in XML, in order to make the connection later on...
dialog for defining style on an a2dCanvasObject
polygon defined with list of points.
a2dError FileOpen(a2dDocumentPtr &doc, const wxFileName &file=wxFileName(wxT("")), a2dTemplateFlagMask docTemplateFlags=a2dTemplateFlag::VISIBLE|a2dTemplateFlag::LOAD)
Creates a new document and reads in the selected file.
Defines a font to be set to a2dDrawer2D or stored in a2dCanvsObject etc.
Input and output handler for the XmlSer format.
UpdateMode
Various mode flags for Update.
OVERLAP
Result of a a2dBoundingBox intersection or hittest.
a2dRectC is a centered rectangle
The base class for all drawable objects in a a2dCanvasDocument.
a2dError FileNew(a2dDocumentPtr &doc, a2dTemplateFlagMask docTemplateFlags=a2dTemplateFlag::VISIBLE)
Creates a document from a list of templates (if more than one template).
virtual void DoLoad(wxObject *parent, a2dIOHandlerXmlSerIn &parser, a2dXmlSer_flag xmlparts)
load object specific CVG data
a2dCanvasObject is the base class for Canvas Objects.
vertex list of line and arc segments.
virtual void DoRender(a2dIterC &ic, OVERLAP clipparent)
render derived object
used to theme a a2dEditorFrame
layer dialog for changing layer settings.
a2dText is an abstract base class.
a2dOrigin stays at World Coordinate Zero (0,0) not matter what.
a2dEllipse centered at x,y.
polyline defined with list of points.
bool FileSaveAs(const wxFileName &file=wxFileName(wxT("")), a2dDocumentFlagMask flags=a2dREFDOC_NON)
Calls wxDocument::SaveAs for the current document.
One object of this class may be created in an application, to manage all the templates and documents...
a2dImage (will scale/rotate image when needed)
virtual void DoSave(wxObject *parent, a2dIOHandlerXmlSerOut &out, a2dXmlSer_flag xmlparts, a2dObjectList *towrite)
write object specific CVGL data
a2dBaseTool * PopTool()
pop a tool from the tool stack of the current active a2dCanvasView
Input and output handler for the XmlSer format.
holds the central a2dCentralCanvasCommandProcessor which is
bool FileImport(const wxFileName &file=wxFileName(wxT("")), const wxString &description=wxT(""), a2dDocumentFlagMask flags=a2dREFDOC_NON)
Calls a2dDocument::Import for the current document.
a2dArrow is used for having line begin and ends on specific objects.
void Refresh()
refresh what is documents and shown on views
Each a2dCommand is given a command id at construction.
sepcialized Frame for editor of a2dCanvas
while iterating a a2dCanvasDocument, this holds the context.
ready made editing class for a a2dCanvas and/or a2dCanvasView
a2dDoWhat
defines what to do
bool FileExport(const wxFileName &file=wxFileName(wxT("")), const wxString &description=wxT(""), a2dDocumentFlagMask flags=a2dREFDOC_NON)
Calls a2dDocument::Export for the current document.
Lua script used to draw the object.
sepcialized Frame for editor of a2dCanvas
virtual void OnExit()
cleaup modeless dialogs created from here
a2dEndsLine with begin and/or end object.
Event sent to a2dCommandProcessor.
The a2dBoundingBox class stores one a2dBoundingBox of a a2dCanvasObject.
virtual bool DoUpdate(UpdateMode mode, const a2dBoundingBox &childbox, const a2dBoundingBox &clipbox, const a2dBoundingBox &propbox)
Update derived Object specific things ( mainly boundingbox)
a command wrapper specially designed to work with wxArt2D docview classes and rest.
CloneOptions
options for cloning
a2dEllipticArc centered at x,y