├── CHANGELOG.md ├── LICENSE ├── README.md ├── android ├── build.gradle ├── gradle.properties ├── settings.gradle └── src │ └── main │ ├── AndroidManifest.xml │ ├── java │ ├── com │ │ └── cloudwebrtc │ │ │ └── fluttertouchvg │ │ │ ├── FlutterTouchvg.java │ │ │ ├── FlutterTouchvgPlugin.java │ │ │ ├── TouchVGView.java │ │ │ └── WebFactory.java │ └── rhcad │ │ └── touchvg │ │ ├── Const.java │ │ ├── IGraphView.java │ │ ├── IViewHelper.java │ │ ├── ViewFactory.java │ │ ├── core │ │ ├── Box2d.java │ │ ├── Chars.java │ │ ├── CmdObserver.java │ │ ├── CmdObserverDefault.java │ │ ├── CmdSubject.java │ │ ├── ConstShapes.java │ │ ├── Floats.java │ │ ├── GiCanvas.java │ │ ├── GiColor.java │ │ ├── GiContext.java │ │ ├── GiCoreView.java │ │ ├── GiCoreViewData.java │ │ ├── GiGestureState.java │ │ ├── GiGestureType.java │ │ ├── GiGraphics.java │ │ ├── GiHandleTypes.java │ │ ├── GiPlayShapes.java │ │ ├── GiPlaying.java │ │ ├── GiSaveClipBox.java │ │ ├── GiSaveModelTransform.java │ │ ├── GiTransform.java │ │ ├── GiView.java │ │ ├── Ints.java │ │ ├── Longs.java │ │ ├── Matrix2d.java │ │ ├── MgActionDispatcher.java │ │ ├── MgArc.java │ │ ├── MgBaseLines.java │ │ ├── MgBaseRect.java │ │ ├── MgBaseShape.java │ │ ├── MgCmdArc3P.java │ │ ├── MgCmdArcCSE.java │ │ ├── MgCmdArcTan.java │ │ ├── MgCmdCompass.java │ │ ├── MgCmdDrawRect.java │ │ ├── MgCmdManager.java │ │ ├── MgCmdManagerFactory.java │ │ ├── MgCmdSector.java │ │ ├── MgCommand.java │ │ ├── MgCommandDraw.java │ │ ├── MgComposite.java │ │ ├── MgContextAction.java │ │ ├── MgCoreShapeFactory.java │ │ ├── MgCoreView.java │ │ ├── MgDiamond.java │ │ ├── MgDot.java │ │ ├── MgEllipse.java │ │ ├── MgFindImageCallback.java │ │ ├── MgGestureState.java │ │ ├── MgGrid.java │ │ ├── MgGroup.java │ │ ├── MgHandleType.java │ │ ├── MgHitResult.java │ │ ├── MgImageShape.java │ │ ├── MgJsonFile.java │ │ ├── MgJsonStorage.java │ │ ├── MgLayer.java │ │ ├── MgLine.java │ │ ├── MgLines.java │ │ ├── MgMotion.java │ │ ├── MgObject.java │ │ ├── MgOptionCallback.java │ │ ├── MgParallel.java │ │ ├── MgPath.java │ │ ├── MgPathNode.java │ │ ├── MgPathShape.java │ │ ├── MgRecordShapes.java │ │ ├── MgRect.java │ │ ├── MgRegenLocker.java │ │ ├── MgRoundRect.java │ │ ├── MgSelDrawFlags.java │ │ ├── MgSelState.java │ │ ├── MgSelection.java │ │ ├── MgShape.java │ │ ├── MgShapeBit.java │ │ ├── MgShapeDoc.java │ │ ├── MgShapeFactory.java │ │ ├── MgShapeIterator.java │ │ ├── MgShapeType.java │ │ ├── MgShapes.java │ │ ├── MgSnap.java │ │ ├── MgSnapOptions.java │ │ ├── MgSnapType.java │ │ ├── MgSplines.java │ │ ├── MgStorage.java │ │ ├── MgStringCallback.java │ │ ├── MgView.java │ │ ├── Point2d.java │ │ ├── RECT_2D.java │ │ ├── Shapes.java │ │ ├── TestCanvas.java │ │ ├── Tol.java │ │ ├── Vector2d.java │ │ ├── mgbase.java │ │ ├── mgcurv.java │ │ ├── mglnrel.java │ │ ├── mgnear.java │ │ ├── touchvg.java │ │ └── touchvgJNI.java │ │ ├── package-info.java │ │ └── view │ │ ├── BaseGraphView.java │ │ ├── CanvasAdapter.java │ │ ├── SFGraphView.java │ │ ├── StdGraphView.java │ │ ├── ViewHelperImpl.java │ │ ├── impl │ │ ├── ContextHelper.java │ │ ├── FileUtil.java │ │ ├── Snapshot.java │ │ └── ViewCreator.java │ │ ├── internal │ │ ├── BaseViewAdapter.java │ │ ├── ContextAction.java │ │ ├── GestureListener.java │ │ ├── ImageCache.java │ │ ├── LogHelper.java │ │ ├── RecordRunnable.java │ │ ├── ResourceUtil.java │ │ ├── ShapeRunnable.java │ │ ├── UndoRunnable.java │ │ └── ViewUtil.java │ │ └── package-info.java │ ├── jniLibs │ ├── android-support-v4.jar │ ├── androidsvg-1.2.2-beta-1-2.jar │ ├── armeabi-v7a │ │ └── libtouchvg.so │ └── x86 │ │ └── libtouchvg.so │ └── res │ ├── drawable-hdpi │ ├── brush.png │ ├── colorwheel.png │ ├── ellipse.png │ ├── eraser.png │ ├── ic_launcher.png │ ├── line.png │ ├── rect.png │ ├── select.png │ ├── snapshot.png │ ├── triangle.png │ ├── vg_back.png │ ├── vg_clone.png │ ├── vg_delete.png │ ├── vg_edit.png │ ├── vg_endedit.png │ ├── vg_fixlen.png │ ├── vg_freelen.png │ ├── vg_group.png │ ├── vg_lock.png │ ├── vg_overturn.png │ ├── vg_selall.png │ ├── vg_ungroup.png │ ├── vg_unlock.png │ ├── vgcen.png │ ├── vgcross.png │ ├── vgdot1.png │ ├── vgdot2.png │ ├── vgdot3.png │ ├── vgmid.png │ ├── vgnear.png │ ├── vgnode.png │ ├── vgparallel.png │ ├── vgpivot.png │ ├── vgquad.png │ ├── vgredo.png │ ├── vgtangent.png │ └── vgundo.png │ ├── drawable-mdpi │ ├── brush.png │ ├── colorwheel.png │ ├── ellipse.png │ ├── eraser.png │ ├── ic_launcher.png │ ├── line.png │ ├── rect.png │ ├── select.png │ ├── snapshot.png │ ├── triangle.png │ ├── vg_back.png │ ├── vg_clone.png │ ├── vg_delete.png │ ├── vg_edit.png │ ├── vg_endedit.png │ ├── vg_fixlen.png │ ├── vg_freelen.png │ ├── vg_group.png │ ├── vg_lock.png │ ├── vg_overturn.png │ ├── vg_selall.png │ ├── vg_ungroup.png │ ├── vg_unlock.png │ ├── vgcen.png │ ├── vgcross.png │ ├── vgdot1.png │ ├── vgdot2.png │ ├── vgdot3.png │ ├── vgmid.png │ ├── vgnear.png │ ├── vgnode.png │ ├── vgparallel.png │ ├── vgpivot.png │ ├── vgquad.png │ ├── vgredo.png │ ├── vgtangent.png │ └── vgundo.png │ ├── drawable-xhdpi │ └── ic_launcher.png │ ├── drawable │ ├── background.jpg │ ├── background_repeat.xml │ ├── brush.png │ ├── demo_switch.png │ ├── vg_translucent.png │ └── vg_translucent_bg.xml │ ├── layout │ └── activity_main.xml │ └── values │ ├── dimens.xml │ ├── strings.xml │ ├── styles.xml │ └── vg_action_captions.xml ├── example ├── README.md ├── android │ ├── app │ │ ├── build.gradle │ │ └── src │ │ │ └── main │ │ │ ├── AndroidManifest.xml │ │ │ ├── java │ │ │ └── com │ │ │ │ └── cloudwebrtc │ │ │ │ └── fluttertouchvgexample │ │ │ │ └── MainActivity.java │ │ │ └── res │ │ │ ├── drawable │ │ │ └── launch_background.xml │ │ │ ├── mipmap-hdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-mdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xhdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xxhdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xxxhdpi │ │ │ └── ic_launcher.png │ │ │ └── values │ │ │ └── styles.xml │ ├── build.gradle │ ├── gradle.properties │ ├── gradle │ │ └── wrapper │ │ │ └── gradle-wrapper.properties │ └── settings.gradle ├── assets │ └── fonts │ │ └── MaterialCommunityIcons.ttf ├── ios │ ├── Flutter │ │ ├── AppFrameworkInfo.plist │ │ ├── Debug.xcconfig │ │ └── Release.xcconfig │ ├── Podfile │ ├── Runner.xcodeproj │ │ ├── project.pbxproj │ │ ├── project.xcworkspace │ │ │ └── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ └── xcschemes │ │ │ └── Runner.xcscheme │ ├── Runner.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ └── WorkspaceSettings.xcsettings │ └── Runner │ │ ├── AppDelegate.h │ │ ├── AppDelegate.m │ │ ├── Assets.xcassets │ │ ├── AppIcon.appiconset │ │ │ ├── Contents.json │ │ │ ├── Icon-App-1024x1024@1x.png │ │ │ ├── Icon-App-20x20@1x.png │ │ │ ├── Icon-App-20x20@2x.png │ │ │ ├── Icon-App-20x20@3x.png │ │ │ ├── Icon-App-29x29@1x.png │ │ │ ├── Icon-App-29x29@2x.png │ │ │ ├── Icon-App-29x29@3x.png │ │ │ ├── Icon-App-40x40@1x.png │ │ │ ├── Icon-App-40x40@2x.png │ │ │ ├── Icon-App-40x40@3x.png │ │ │ ├── Icon-App-60x60@2x.png │ │ │ ├── Icon-App-60x60@3x.png │ │ │ ├── Icon-App-76x76@1x.png │ │ │ ├── Icon-App-76x76@2x.png │ │ │ └── Icon-App-83.5x83.5@2x.png │ │ └── LaunchImage.imageset │ │ │ ├── Contents.json │ │ │ ├── LaunchImage.png │ │ │ ├── LaunchImage@2x.png │ │ │ ├── LaunchImage@3x.png │ │ │ └── README.md │ │ ├── Base.lproj │ │ ├── LaunchScreen.storyboard │ │ └── Main.storyboard │ │ ├── Info.plist │ │ └── main.m ├── lib │ └── main.dart ├── pubspec.yaml └── test │ └── widget_test.dart ├── flutter_touchvg.iml ├── ios ├── .gitignore ├── Assets │ └── .gitkeep ├── Classes │ ├── FlutterTouchvg.h │ ├── FlutterTouchvg.m │ ├── FlutterTouchvgPlugin.h │ ├── FlutterTouchvgPlugin.m │ ├── TouchVG │ │ ├── LICENSE │ │ ├── README.md │ │ ├── TouchVG.bundle │ │ │ ├── Info.plist │ │ │ ├── en.lproj │ │ │ │ └── Localizable.strings │ │ │ ├── magnifier-mask@2x.png │ │ │ ├── magnifier@2x.png │ │ │ ├── translucent@2x.png │ │ │ ├── vg_addvertex@2x.png │ │ │ ├── vg_back@2x.png │ │ │ ├── vg_clone@2x.png │ │ │ ├── vg_delete@2x.png │ │ │ ├── vg_delvertex@2x.png │ │ │ ├── vg_edit@2x.png │ │ │ ├── vg_endedit@2x.png │ │ │ ├── vg_fixlen@2x.png │ │ │ ├── vg_freelen@2x.png │ │ │ ├── vg_group@2x.png │ │ │ ├── vg_lock@2x.png │ │ │ ├── vg_overturn@2x.png │ │ │ ├── vg_selall@2x.png │ │ │ ├── vg_ungroup@2x.png │ │ │ ├── vg_unlock@2x.png │ │ │ ├── vgcen@2x.png │ │ │ ├── vgcross@2x.png │ │ │ ├── vgdot1@2x.png │ │ │ ├── vgdot2@2x.png │ │ │ ├── vgdot3@2x.png │ │ │ ├── vgmid@2x.png │ │ │ ├── vgnear@2x.png │ │ │ ├── vgnode@2x.png │ │ │ ├── vgparallel@2x.png │ │ │ ├── vgpivot@2x.png │ │ │ ├── vgquad@2x.png │ │ │ ├── vgtangent@2x.png │ │ │ └── zh-Hans.lproj │ │ │ │ └── Localizable.strings │ │ ├── include │ │ │ ├── ARCMacro.h │ │ │ ├── GiCanvasAdapter.h │ │ │ ├── GiPaintView.h │ │ │ ├── GiPaintViewDelegate.h │ │ │ ├── GiPaintViewXIB.h │ │ │ ├── GiShapeAdapter.h │ │ │ ├── GiViewEnums.h │ │ │ ├── GiViewHelper+Layer.h │ │ │ ├── GiViewHelper.h │ │ │ └── NSString+Drawing.h │ │ └── src │ │ │ ├── GiCanvasAdapter.mm │ │ │ ├── GiDpiUtil.mm │ │ │ ├── GiImageCache.h │ │ │ ├── GiImageCache.mm │ │ │ ├── GiMagnifierView.h │ │ │ ├── GiMagnifierView.m │ │ │ ├── GiPaintView.mm │ │ │ ├── GiPaintViewXIB.mm │ │ │ ├── GiShapeAdapter.mm │ │ │ ├── GiViewAdapter.mm │ │ │ ├── GiViewHelper+Layer.mm │ │ │ ├── GiViewHelper.mm │ │ │ ├── GiViewImpl.h │ │ │ └── NSString+Drawing.m │ └── TouchVGCore │ │ ├── LICENSE │ │ ├── README.md │ │ └── core │ │ ├── include │ │ ├── canvas │ │ │ └── gicanvas.h │ │ ├── cmd │ │ │ ├── mgaction.h │ │ │ ├── mgcmd.h │ │ │ ├── mgcoreview.h │ │ │ ├── mglocal.h │ │ │ ├── mgselect.h │ │ │ ├── mgsnap.h │ │ │ └── mgview.h │ │ ├── cmdbase │ │ │ ├── mgcmddraw.h │ │ │ ├── mgdrawarc.h │ │ │ ├── mgdrawline.h │ │ │ └── mgdrawrect.h │ │ ├── cmdbasic │ │ │ ├── cmdbasic.h │ │ │ ├── mgdrawcircle.h │ │ │ ├── mgdrawdiamond.h │ │ │ ├── mgdrawellipse.h │ │ │ ├── mgdrawfreelines.h │ │ │ ├── mgdrawgrid.h │ │ │ ├── mgdrawlines.h │ │ │ ├── mgdrawparallel.h │ │ │ ├── mgdrawpolygon.h │ │ │ ├── mgdrawquadrangle.h │ │ │ ├── mgdrawsplines.h │ │ │ ├── mgdrawsquare.h │ │ │ └── mgdrawtriang.h │ │ ├── cmdmgr │ │ │ ├── mgcmdmgr.h │ │ │ └── mgcmdmgrfactory.h │ │ ├── cmdobserver │ │ │ ├── cmdobserver.h │ │ │ └── cmdsubject.h │ │ ├── export │ │ │ ├── girecordcanvas.h │ │ │ ├── girecordshape.h │ │ │ └── svgcanvas.h │ │ ├── geom │ │ │ ├── mgbase.h │ │ │ ├── mgbox.h │ │ │ ├── mgcurv.h │ │ │ ├── mgdef.h │ │ │ ├── mglnrel.h │ │ │ ├── mgmat.h │ │ │ ├── mgnear.h │ │ │ ├── mgpath.h │ │ │ ├── mgpnt.h │ │ │ ├── mgtol.h │ │ │ └── mgvec.h │ │ ├── graph │ │ │ ├── gicolor.h │ │ │ ├── gicontxt.h │ │ │ ├── gigraph.h │ │ │ ├── gilock.h │ │ │ └── gixform.h │ │ ├── gshape │ │ │ ├── mgarc.h │ │ │ ├── mgbasesp.h │ │ │ ├── mgcshapes.h │ │ │ ├── mgdiamond.h │ │ │ ├── mgdot.h │ │ │ ├── mgellipse.h │ │ │ ├── mggrid.h │ │ │ ├── mgline.h │ │ │ ├── mglines.h │ │ │ ├── mgobject.h │ │ │ ├── mgparallel.h │ │ │ ├── mgpathsp.h │ │ │ ├── mgrdrect.h │ │ │ ├── mgrect.h │ │ │ ├── mgshape_.h │ │ │ ├── mgshapetype.h │ │ │ └── mgsplines.h │ │ ├── jsonstorage │ │ │ └── mgjsonstorage.h │ │ ├── mglog.h │ │ ├── mgstrcallback.h │ │ ├── mgvector.h │ │ ├── record │ │ │ └── recordshapes.h │ │ ├── shape │ │ │ ├── mgbasicspreg.h │ │ │ ├── mgbasicsps.h │ │ │ ├── mgcomposite.h │ │ │ ├── mgimagesp.h │ │ │ ├── mgshape.h │ │ │ ├── mgshapes.h │ │ │ ├── mgshapet.h │ │ │ └── mgspfactory.h │ │ ├── shapedoc │ │ │ ├── mglayer.h │ │ │ ├── mgshapedoc.h │ │ │ └── spfactoryimpl.h │ │ ├── storage │ │ │ └── mgstorage.h │ │ ├── test │ │ │ ├── RandomShape.h │ │ │ └── testcanvas.h │ │ └── view │ │ │ ├── gicoreview.h │ │ │ ├── gigesture.h │ │ │ ├── gimousehelper.h │ │ │ ├── giplaying.h │ │ │ └── giview.h │ │ └── src │ │ ├── cmdbase │ │ ├── mgcmddraw.cpp │ │ ├── mgdrawarc.cpp │ │ ├── mgdrawline.cpp │ │ └── mgdrawrect.cpp │ │ ├── cmdbasic │ │ ├── cmdbasic.cpp │ │ ├── mgcmderase.cpp │ │ ├── mgcmderase.h │ │ ├── mgdrawcircle.cpp │ │ ├── mgdrawdiamond.cpp │ │ ├── mgdrawellipse.cpp │ │ ├── mgdrawfreelines.cpp │ │ ├── mgdrawgrid.cpp │ │ ├── mgdrawlines.cpp │ │ ├── mgdrawparallel.cpp │ │ ├── mgdrawpolygon.cpp │ │ ├── mgdrawsplines.cpp │ │ ├── mgdrawsquare.cpp │ │ └── mgdrawtriang.cpp │ │ ├── cmdmgr │ │ ├── cmdsubject.cpp │ │ ├── mgactions.cpp │ │ ├── mgcmdmgr2.cpp │ │ ├── mgcmdmgr_.cpp │ │ ├── mgcmdmgr_.h │ │ ├── mgcmdselect.cpp │ │ ├── mgcmdselect.h │ │ └── mgsnapimpl.cpp │ │ ├── corever.h │ │ ├── export │ │ ├── girecordcanvas.cpp │ │ ├── simple_svg.hpp │ │ └── svgcanvas.cpp │ │ ├── geom │ │ ├── fitcurves.cpp │ │ ├── mgbase.cpp │ │ ├── mgbox.cpp │ │ ├── mgcurv.cpp │ │ ├── mgdblpt.h │ │ ├── mglnrel.cpp │ │ ├── mgmat.cpp │ │ ├── mgnear.cpp │ │ ├── mgnearbz.cpp │ │ ├── mgpath.cpp │ │ ├── mgpnt.cpp │ │ ├── mgvec.cpp │ │ └── nanosvg.cpp │ │ ├── graph │ │ ├── gigraph.cpp │ │ ├── gigraph_.h │ │ ├── giplclip.h │ │ └── gixform.cpp │ │ ├── gshape │ │ ├── mgarc.cpp │ │ ├── mgarccross.cpp │ │ ├── mgbasesp.cpp │ │ ├── mgcshapes.cpp │ │ ├── mgdiamond.cpp │ │ ├── mgdot.cpp │ │ ├── mgellipse.cpp │ │ ├── mggrid.cpp │ │ ├── mgline.cpp │ │ ├── mglines.cpp │ │ ├── mgparallel.cpp │ │ ├── mgpathsp.cpp │ │ ├── mgrdrect.cpp │ │ ├── mgrect.cpp │ │ └── mgsplines.cpp │ │ ├── jsonstorage │ │ ├── mgjsonstorage.cpp │ │ ├── rapidjson │ │ │ ├── document.h │ │ │ ├── filestream.h │ │ │ ├── internal │ │ │ │ ├── pow10.h │ │ │ │ ├── stack.h │ │ │ │ └── strfunc.h │ │ │ ├── prettywriter.h │ │ │ ├── rapidjson.h │ │ │ ├── reader.h │ │ │ ├── stringbuffer.h │ │ │ └── writer.h │ │ ├── utf8_core.h │ │ └── utf8_unchecked.h │ │ ├── record │ │ └── recordshapes.cpp │ │ ├── shape │ │ ├── mgbasicspreg.cpp │ │ ├── mgcomposite.cpp │ │ ├── mgimagesp.cpp │ │ ├── mgshape.cpp │ │ └── mgshapes.cpp │ │ ├── shapedoc │ │ ├── mglayer.cpp │ │ ├── mgshapedoc.cpp │ │ └── spfactoryimpl.cpp │ │ ├── test │ │ ├── RandomShape.cpp │ │ └── testcanvas.cpp │ │ └── view │ │ ├── GcBaseView.h │ │ ├── GcGraphView.cpp │ │ ├── GcGraphView.h │ │ ├── GcMagnifierView.cpp │ │ ├── GcMagnifierView.h │ │ ├── GcShapeDoc.cpp │ │ ├── GcShapeDoc.h │ │ ├── gicorerecord.cpp │ │ ├── gicoreview.cpp │ │ ├── gicoreviewdata.h │ │ ├── gicoreviewimpl.h │ │ └── gimousehelper.cpp └── flutter_touchvg.podspec ├── lib └── flutter_touchvg.dart ├── pubspec.yaml └── screenshots ├── android.png └── ios.png /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## 0.0.1 2 | 3 | * TODO: Describe initial release. 4 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 玄微子 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # flutter_touchvg 2 | a flutter whiteboard plugin. 3 | 4 | ## Usage 5 | - `git clone https://github.com/kangshaojun/flutter_touchvg.git` 6 | - `cd flutter_touchvg` 7 | - `flutter packages get` 8 | - `flutter run` 9 | 10 | ## Study 11 | 此插件配有视频教程: 12 | https://ke.qq.com/course/391960?tuin=10ea64b9 13 | 14 | ## screenshots 15 | # iOS 16 | 17 | # Android 18 | -------------------------------------------------------------------------------- /android/build.gradle: -------------------------------------------------------------------------------- 1 | group 'com.cloudwebrtc.fluttertouchvg' 2 | version '1.0-SNAPSHOT' 3 | buildscript { 4 | repositories { 5 | google() 6 | jcenter() 7 | } 8 | 9 | dependencies { 10 | classpath 'com.android.tools.build:gradle:3.2.1' 11 | } 12 | } 13 | rootProject.allprojects { 14 | repositories { 15 | google() 16 | jcenter() 17 | } 18 | } 19 | apply plugin: 'com.android.library' 20 | android { 21 | compileSdkVersion 27 22 | 23 | defaultConfig { 24 | minSdkVersion 16 25 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 26 | } 27 | lintOptions { 28 | disable 'InvalidPackage' 29 | } 30 | 31 | buildTypes { 32 | release { 33 | minifyEnabled false 34 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt' 35 | } 36 | sourceSets { 37 | main { 38 | jni.srcDirs = [] 39 | } 40 | } 41 | } 42 | } 43 | 44 | dependencies { 45 | implementation 'com.android.support:support-v4:27.1.1' 46 | } -------------------------------------------------------------------------------- /android/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx1536M 2 | -------------------------------------------------------------------------------- /android/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'flutter_touchvg' 2 | -------------------------------------------------------------------------------- /android/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | -------------------------------------------------------------------------------- /android/src/main/java/com/cloudwebrtc/fluttertouchvg/FlutterTouchvgPlugin.java: -------------------------------------------------------------------------------- 1 | package com.cloudwebrtc.fluttertouchvg; 2 | 3 | import io.flutter.plugin.common.PluginRegistry.Registrar; 4 | 5 | /** FlutterTouchvgPlugin */ 6 | public class FlutterTouchvgPlugin { 7 | 8 | /** Registering viewfactory */ 9 | public static void registerWith(Registrar registrar) { 10 | registrar 11 | .platformViewRegistry() 12 | .registerViewFactory( 13 | "flutter_touchvg", new WebFactory(registrar)); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /android/src/main/java/com/cloudwebrtc/fluttertouchvg/TouchVGView.java: -------------------------------------------------------------------------------- 1 | package com.cloudwebrtc.fluttertouchvg; 2 | 3 | import rhcad.touchvg.IGraphView; 4 | import rhcad.touchvg.IGraphView.OnSelectionChangedListener; 5 | import rhcad.touchvg.IViewHelper; 6 | import android.content.Context; 7 | import android.view.ViewGroup; 8 | import android.widget.FrameLayout; 9 | 10 | public class TouchVGView extends ViewGroup implements OnSelectionChangedListener { 11 | private IViewHelper mHelper = null; 12 | private static final String PATH = "mnt/sdcard/WhiteBoard/"; 13 | 14 | FrameLayout layout; 15 | 16 | public TouchVGView(Context context, IViewHelper helper) { 17 | super(context); 18 | mHelper = helper; 19 | mHelper.createGraphView(context, this); 20 | mHelper.getGraphView().setOnSelectionChangedListener(this); 21 | // mHelper.startUndoRecord(PATH + "undo"); 22 | // mHelper.setBackgroundDrawable(this.getResources().getDrawable(R.drawable.background_repeat)); 23 | 24 | } 25 | 26 | public IViewHelper helper(){ 27 | return this.mHelper; 28 | } 29 | 30 | /** 31 | * {@inheritDoc} 32 | */ 33 | @Override 34 | protected void onLayout(boolean changed, int l, int t, int r, int b) { 35 | int height = b - t; 36 | int width = r - l; 37 | mHelper.getView().layout(l,t - 100, r, b - 100); 38 | } 39 | 40 | @Override 41 | public void onSelectionChanged(IGraphView view) { 42 | 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /android/src/main/java/com/cloudwebrtc/fluttertouchvg/WebFactory.java: -------------------------------------------------------------------------------- 1 | package com.cloudwebrtc.fluttertouchvg; 2 | 3 | import android.content.Context; 4 | import io.flutter.plugin.common.StandardMessageCodec; 5 | import io.flutter.plugin.platform.PlatformView; 6 | import io.flutter.plugin.platform.PlatformViewFactory; 7 | 8 | import static io.flutter.plugin.common.PluginRegistry.Registrar; 9 | 10 | public class WebFactory extends PlatformViewFactory { 11 | 12 | private final Registrar mPluginRegistrar; 13 | 14 | public WebFactory(Registrar registrar) { 15 | super(StandardMessageCodec.INSTANCE); 16 | mPluginRegistrar = registrar; 17 | } 18 | 19 | @Override 20 | public PlatformView create(Context context, int i, Object o) { 21 | return new FlutterTouchvg(context, mPluginRegistrar, i); 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /android/src/main/java/rhcad/touchvg/Const.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2015, https://github.com/rhcad/vgandroid, BSD license 2 | 3 | package rhcad.touchvg; 4 | 5 | public class Const { 6 | public static final int GESTURE_TAP = 2; 7 | public static final int GESTURE_DBLTAP = 3; 8 | public static final int GESTURE_PRESS = 4; 9 | 10 | public static final int SOLID_LINE = 0; 11 | public static final int DASH_LINE = 1; 12 | public static final int DOT_LINE = 2; 13 | public static final int DASH_DOT = 3; 14 | public static final int DASH_DOT_DOT = 4; 15 | public static final int NULL_LINE = 5; 16 | public static final int MAX_LINESTYLE = 5; 17 | 18 | public static final int ARROWHEAD_NONE = 0; 19 | public static final int ARROWHEAD_SHARPCLOSED = 1; 20 | public static final int ARROWHEAD_SHARPLINE = 2; 21 | public static final int ARROWHEAD_TLINE = 3; 22 | public static final int ARROWHEAD_SLASHLINE = 4; 23 | public static final int ARROWHEAD_CLOSEDCIRCLE = 5; 24 | public static final int ARROWHEAD_OPENEDCIRCLE = 6; 25 | public static final int MAX_ARROWHEAD = 6; 26 | 27 | private Const() { 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /android/src/main/java/rhcad/touchvg/core/Chars.java: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------------- 2 | * This file was automatically generated by SWIG (http://www.swig.org). 3 | * Version 3.0.12 4 | * 5 | * Do not make changes to this file unless you know what you are doing--modify 6 | * the SWIG interface file instead. 7 | * ----------------------------------------------------------------------------- */ 8 | 9 | package rhcad.touchvg.core; 10 | 11 | public class Chars { 12 | private transient long swigCPtr; 13 | protected transient boolean swigCMemOwn; 14 | 15 | protected Chars(long cPtr, boolean cMemoryOwn) { 16 | swigCMemOwn = cMemoryOwn; 17 | swigCPtr = cPtr; 18 | } 19 | 20 | protected static long getCPtr(Chars obj) { 21 | return (obj == null) ? 0 : obj.swigCPtr; 22 | } 23 | 24 | protected void finalize() { 25 | delete(); 26 | } 27 | 28 | public synchronized void delete() { 29 | if (swigCPtr != 0) { 30 | if (swigCMemOwn) { 31 | swigCMemOwn = false; 32 | touchvgJNI.delete_Chars(swigCPtr); 33 | } 34 | swigCPtr = 0; 35 | } 36 | } 37 | 38 | public Chars(int n) { 39 | this(touchvgJNI.new_Chars__SWIG_0(n), true); 40 | } 41 | 42 | public Chars() { 43 | this(touchvgJNI.new_Chars__SWIG_1(), true); 44 | } 45 | 46 | public void setSize(int n) { 47 | touchvgJNI.Chars_setSize(swigCPtr, this, n); 48 | } 49 | 50 | public Chars(char v1, char v2) { 51 | this(touchvgJNI.new_Chars__SWIG_2(v1, v2), true); 52 | } 53 | 54 | public Chars(char v1, char v2, char v3, char v4) { 55 | this(touchvgJNI.new_Chars__SWIG_3(v1, v2, v3, v4), true); 56 | } 57 | 58 | public int count() { 59 | return touchvgJNI.Chars_count(swigCPtr, this); 60 | } 61 | 62 | public char get(int index) { 63 | return touchvgJNI.Chars_get(swigCPtr, this, index); 64 | } 65 | 66 | public void set(int index, char value) { 67 | touchvgJNI.Chars_set__SWIG_0(swigCPtr, this, index, value); 68 | } 69 | 70 | public void set(int index, char v1, char v2) { 71 | touchvgJNI.Chars_set__SWIG_1(swigCPtr, this, index, v1, v2); 72 | } 73 | 74 | } 75 | -------------------------------------------------------------------------------- /android/src/main/java/rhcad/touchvg/core/CmdSubject.java: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------------- 2 | * This file was automatically generated by SWIG (http://www.swig.org). 3 | * Version 3.0.12 4 | * 5 | * Do not make changes to this file unless you know what you are doing--modify 6 | * the SWIG interface file instead. 7 | * ----------------------------------------------------------------------------- */ 8 | 9 | package rhcad.touchvg.core; 10 | 11 | public class CmdSubject extends CmdObserver { 12 | private transient long swigCPtr; 13 | 14 | protected CmdSubject(long cPtr, boolean cMemoryOwn) { 15 | super(touchvgJNI.CmdSubject_SWIGUpcast(cPtr), cMemoryOwn); 16 | swigCPtr = cPtr; 17 | } 18 | 19 | protected static long getCPtr(CmdSubject obj) { 20 | return (obj == null) ? 0 : obj.swigCPtr; 21 | } 22 | 23 | protected void finalize() { 24 | delete(); 25 | } 26 | 27 | public synchronized void delete() { 28 | if (swigCPtr != 0) { 29 | if (swigCMemOwn) { 30 | swigCMemOwn = false; 31 | touchvgJNI.delete_CmdSubject(swigCPtr); 32 | } 33 | swigCPtr = 0; 34 | } 35 | super.delete(); 36 | } 37 | 38 | public void registerObserver(CmdObserver observer) { 39 | touchvgJNI.CmdSubject_registerObserver(swigCPtr, this, CmdObserver.getCPtr(observer), observer); 40 | } 41 | 42 | public void unregisterObserver(CmdObserver observer) { 43 | touchvgJNI.CmdSubject_unregisterObserver(swigCPtr, this, CmdObserver.getCPtr(observer), observer); 44 | } 45 | 46 | public boolean registerNamedObserver(String name, CmdObserver observer) { 47 | return touchvgJNI.CmdSubject_registerNamedObserver(swigCPtr, this, name, CmdObserver.getCPtr(observer), observer); 48 | } 49 | 50 | public CmdObserver findNamedObserver(String name) { 51 | long cPtr = touchvgJNI.CmdSubject_findNamedObserver(swigCPtr, this, name); 52 | return (cPtr == 0) ? null : new CmdObserver(cPtr, false); 53 | } 54 | 55 | } 56 | -------------------------------------------------------------------------------- /android/src/main/java/rhcad/touchvg/core/GiPlayShapes.java: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------------- 2 | * This file was automatically generated by SWIG (http://www.swig.org). 3 | * Version 3.0.12 4 | * 5 | * Do not make changes to this file unless you know what you are doing--modify 6 | * the SWIG interface file instead. 7 | * ----------------------------------------------------------------------------- */ 8 | 9 | package rhcad.touchvg.core; 10 | 11 | public class GiPlayShapes { 12 | private transient long swigCPtr; 13 | protected transient boolean swigCMemOwn; 14 | 15 | protected GiPlayShapes(long cPtr, boolean cMemoryOwn) { 16 | swigCMemOwn = cMemoryOwn; 17 | swigCPtr = cPtr; 18 | } 19 | 20 | protected static long getCPtr(GiPlayShapes obj) { 21 | return (obj == null) ? 0 : obj.swigCPtr; 22 | } 23 | 24 | protected void finalize() { 25 | delete(); 26 | } 27 | 28 | public synchronized void delete() { 29 | if (swigCPtr != 0) { 30 | if (swigCMemOwn) { 31 | swigCMemOwn = false; 32 | touchvgJNI.delete_GiPlayShapes(swigCPtr); 33 | } 34 | swigCPtr = 0; 35 | } 36 | } 37 | 38 | public void setPlaying(GiPlaying value) { 39 | touchvgJNI.GiPlayShapes_playing_set(swigCPtr, this, GiPlaying.getCPtr(value), value); 40 | } 41 | 42 | public GiPlaying getPlaying() { 43 | long cPtr = touchvgJNI.GiPlayShapes_playing_get(swigCPtr, this); 44 | return (cPtr == 0) ? null : new GiPlaying(cPtr, false); 45 | } 46 | 47 | public void setPlayer(MgRecordShapes value) { 48 | touchvgJNI.GiPlayShapes_player_set(swigCPtr, this, MgRecordShapes.getCPtr(value), value); 49 | } 50 | 51 | public MgRecordShapes getPlayer() { 52 | long cPtr = touchvgJNI.GiPlayShapes_player_get(swigCPtr, this); 53 | return (cPtr == 0) ? null : new MgRecordShapes(cPtr, false); 54 | } 55 | 56 | public GiPlayShapes() { 57 | this(touchvgJNI.new_GiPlayShapes(), true); 58 | } 59 | 60 | } 61 | -------------------------------------------------------------------------------- /android/src/main/java/rhcad/touchvg/core/GiSaveClipBox.java: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------------- 2 | * This file was automatically generated by SWIG (http://www.swig.org). 3 | * Version 3.0.12 4 | * 5 | * Do not make changes to this file unless you know what you are doing--modify 6 | * the SWIG interface file instead. 7 | * ----------------------------------------------------------------------------- */ 8 | 9 | package rhcad.touchvg.core; 10 | 11 | public class GiSaveClipBox { 12 | private transient long swigCPtr; 13 | protected transient boolean swigCMemOwn; 14 | 15 | protected GiSaveClipBox(long cPtr, boolean cMemoryOwn) { 16 | swigCMemOwn = cMemoryOwn; 17 | swigCPtr = cPtr; 18 | } 19 | 20 | protected static long getCPtr(GiSaveClipBox obj) { 21 | return (obj == null) ? 0 : obj.swigCPtr; 22 | } 23 | 24 | protected void finalize() { 25 | delete(); 26 | } 27 | 28 | public synchronized void delete() { 29 | if (swigCPtr != 0) { 30 | if (swigCMemOwn) { 31 | swigCMemOwn = false; 32 | touchvgJNI.delete_GiSaveClipBox(swigCPtr); 33 | } 34 | swigCPtr = 0; 35 | } 36 | } 37 | 38 | public GiSaveClipBox(GiGraphics gs, Box2d rectWorld) { 39 | this(touchvgJNI.new_GiSaveClipBox(GiGraphics.getCPtr(gs), gs, Box2d.getCPtr(rectWorld), rectWorld), true); 40 | } 41 | 42 | public boolean succeed() { 43 | return touchvgJNI.GiSaveClipBox_succeed(swigCPtr, this); 44 | } 45 | 46 | } 47 | -------------------------------------------------------------------------------- /android/src/main/java/rhcad/touchvg/core/GiSaveModelTransform.java: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------------- 2 | * This file was automatically generated by SWIG (http://www.swig.org). 3 | * Version 3.0.12 4 | * 5 | * Do not make changes to this file unless you know what you are doing--modify 6 | * the SWIG interface file instead. 7 | * ----------------------------------------------------------------------------- */ 8 | 9 | package rhcad.touchvg.core; 10 | 11 | public class GiSaveModelTransform { 12 | private transient long swigCPtr; 13 | protected transient boolean swigCMemOwn; 14 | 15 | protected GiSaveModelTransform(long cPtr, boolean cMemoryOwn) { 16 | swigCMemOwn = cMemoryOwn; 17 | swigCPtr = cPtr; 18 | } 19 | 20 | protected static long getCPtr(GiSaveModelTransform obj) { 21 | return (obj == null) ? 0 : obj.swigCPtr; 22 | } 23 | 24 | protected void finalize() { 25 | delete(); 26 | } 27 | 28 | public synchronized void delete() { 29 | if (swigCPtr != 0) { 30 | if (swigCMemOwn) { 31 | swigCMemOwn = false; 32 | touchvgJNI.delete_GiSaveModelTransform(swigCPtr); 33 | } 34 | swigCPtr = 0; 35 | } 36 | } 37 | 38 | public GiSaveModelTransform(GiTransform xform, Matrix2d mat) { 39 | this(touchvgJNI.new_GiSaveModelTransform(GiTransform.getCPtr(xform), xform, Matrix2d.getCPtr(mat), mat), true); 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /android/src/main/java/rhcad/touchvg/core/Ints.java: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------------- 2 | * This file was automatically generated by SWIG (http://www.swig.org). 3 | * Version 3.0.12 4 | * 5 | * Do not make changes to this file unless you know what you are doing--modify 6 | * the SWIG interface file instead. 7 | * ----------------------------------------------------------------------------- */ 8 | 9 | package rhcad.touchvg.core; 10 | 11 | public class Ints { 12 | private transient long swigCPtr; 13 | protected transient boolean swigCMemOwn; 14 | 15 | protected Ints(long cPtr, boolean cMemoryOwn) { 16 | swigCMemOwn = cMemoryOwn; 17 | swigCPtr = cPtr; 18 | } 19 | 20 | protected static long getCPtr(Ints obj) { 21 | return (obj == null) ? 0 : obj.swigCPtr; 22 | } 23 | 24 | protected void finalize() { 25 | delete(); 26 | } 27 | 28 | public synchronized void delete() { 29 | if (swigCPtr != 0) { 30 | if (swigCMemOwn) { 31 | swigCMemOwn = false; 32 | touchvgJNI.delete_Ints(swigCPtr); 33 | } 34 | swigCPtr = 0; 35 | } 36 | } 37 | 38 | public Ints(int n) { 39 | this(touchvgJNI.new_Ints__SWIG_0(n), true); 40 | } 41 | 42 | public Ints() { 43 | this(touchvgJNI.new_Ints__SWIG_1(), true); 44 | } 45 | 46 | public void setSize(int n) { 47 | touchvgJNI.Ints_setSize(swigCPtr, this, n); 48 | } 49 | 50 | public Ints(int v1, int v2) { 51 | this(touchvgJNI.new_Ints__SWIG_2(v1, v2), true); 52 | } 53 | 54 | public Ints(int v1, int v2, int v3, int v4) { 55 | this(touchvgJNI.new_Ints__SWIG_3(v1, v2, v3, v4), true); 56 | } 57 | 58 | public int count() { 59 | return touchvgJNI.Ints_count(swigCPtr, this); 60 | } 61 | 62 | public int get(int index) { 63 | return touchvgJNI.Ints_get(swigCPtr, this, index); 64 | } 65 | 66 | public void set(int index, int value) { 67 | touchvgJNI.Ints_set__SWIG_0(swigCPtr, this, index, value); 68 | } 69 | 70 | public void set(int index, int v1, int v2) { 71 | touchvgJNI.Ints_set__SWIG_1(swigCPtr, this, index, v1, v2); 72 | } 73 | 74 | } 75 | -------------------------------------------------------------------------------- /android/src/main/java/rhcad/touchvg/core/Longs.java: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------------- 2 | * This file was automatically generated by SWIG (http://www.swig.org). 3 | * Version 3.0.12 4 | * 5 | * Do not make changes to this file unless you know what you are doing--modify 6 | * the SWIG interface file instead. 7 | * ----------------------------------------------------------------------------- */ 8 | 9 | package rhcad.touchvg.core; 10 | 11 | public class Longs { 12 | private transient long swigCPtr; 13 | protected transient boolean swigCMemOwn; 14 | 15 | protected Longs(long cPtr, boolean cMemoryOwn) { 16 | swigCMemOwn = cMemoryOwn; 17 | swigCPtr = cPtr; 18 | } 19 | 20 | protected static long getCPtr(Longs obj) { 21 | return (obj == null) ? 0 : obj.swigCPtr; 22 | } 23 | 24 | protected void finalize() { 25 | delete(); 26 | } 27 | 28 | public synchronized void delete() { 29 | if (swigCPtr != 0) { 30 | if (swigCMemOwn) { 31 | swigCMemOwn = false; 32 | touchvgJNI.delete_Longs(swigCPtr); 33 | } 34 | swigCPtr = 0; 35 | } 36 | } 37 | 38 | public Longs(int n) { 39 | this(touchvgJNI.new_Longs__SWIG_0(n), true); 40 | } 41 | 42 | public Longs() { 43 | this(touchvgJNI.new_Longs__SWIG_1(), true); 44 | } 45 | 46 | public void setSize(int n) { 47 | touchvgJNI.Longs_setSize(swigCPtr, this, n); 48 | } 49 | 50 | public Longs(int v1, int v2) { 51 | this(touchvgJNI.new_Longs__SWIG_2(v1, v2), true); 52 | } 53 | 54 | public Longs(int v1, int v2, int v3, int v4) { 55 | this(touchvgJNI.new_Longs__SWIG_3(v1, v2, v3, v4), true); 56 | } 57 | 58 | public int count() { 59 | return touchvgJNI.Longs_count(swigCPtr, this); 60 | } 61 | 62 | public int get(int index) { 63 | return touchvgJNI.Longs_get(swigCPtr, this, index); 64 | } 65 | 66 | public void set(int index, int value) { 67 | touchvgJNI.Longs_set__SWIG_0(swigCPtr, this, index, value); 68 | } 69 | 70 | public void set(int index, int v1, int v2) { 71 | touchvgJNI.Longs_set__SWIG_1(swigCPtr, this, index, v1, v2); 72 | } 73 | 74 | } 75 | -------------------------------------------------------------------------------- /android/src/main/java/rhcad/touchvg/core/MgActionDispatcher.java: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------------- 2 | * This file was automatically generated by SWIG (http://www.swig.org). 3 | * Version 3.0.12 4 | * 5 | * Do not make changes to this file unless you know what you are doing--modify 6 | * the SWIG interface file instead. 7 | * ----------------------------------------------------------------------------- */ 8 | 9 | package rhcad.touchvg.core; 10 | 11 | public class MgActionDispatcher { 12 | private transient long swigCPtr; 13 | protected transient boolean swigCMemOwn; 14 | 15 | protected MgActionDispatcher(long cPtr, boolean cMemoryOwn) { 16 | swigCMemOwn = cMemoryOwn; 17 | swigCPtr = cPtr; 18 | } 19 | 20 | protected static long getCPtr(MgActionDispatcher obj) { 21 | return (obj == null) ? 0 : obj.swigCPtr; 22 | } 23 | 24 | protected void finalize() { 25 | delete(); 26 | } 27 | 28 | public synchronized void delete() { 29 | if (swigCPtr != 0) { 30 | if (swigCMemOwn) { 31 | swigCMemOwn = false; 32 | touchvgJNI.delete_MgActionDispatcher(swigCPtr); 33 | } 34 | swigCPtr = 0; 35 | } 36 | } 37 | 38 | public boolean showInSelect(MgMotion sender, int selState, MgShape shape, Box2d selbox) { 39 | return touchvgJNI.MgActionDispatcher_showInSelect(swigCPtr, this, MgMotion.getCPtr(sender), sender, selState, MgShape.getCPtr(shape), shape, Box2d.getCPtr(selbox), selbox); 40 | } 41 | 42 | public boolean showInDrawing(MgMotion sender, MgShape shape) { 43 | return touchvgJNI.MgActionDispatcher_showInDrawing(swigCPtr, this, MgMotion.getCPtr(sender), sender, MgShape.getCPtr(shape), shape); 44 | } 45 | 46 | public boolean doAction(MgMotion sender, int action) { 47 | return touchvgJNI.MgActionDispatcher_doAction(swigCPtr, this, MgMotion.getCPtr(sender), sender, action); 48 | } 49 | 50 | } 51 | -------------------------------------------------------------------------------- /android/src/main/java/rhcad/touchvg/core/MgCmdArcCSE.java: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------------- 2 | * This file was automatically generated by SWIG (http://www.swig.org). 3 | * Version 3.0.12 4 | * 5 | * Do not make changes to this file unless you know what you are doing--modify 6 | * the SWIG interface file instead. 7 | * ----------------------------------------------------------------------------- */ 8 | 9 | package rhcad.touchvg.core; 10 | 11 | public class MgCmdArcCSE extends MgCmdArc3P { 12 | private transient long swigCPtr; 13 | 14 | protected MgCmdArcCSE(long cPtr, boolean cMemoryOwn) { 15 | super(touchvgJNI.MgCmdArcCSE_SWIGUpcast(cPtr), cMemoryOwn); 16 | swigCPtr = cPtr; 17 | } 18 | 19 | protected static long getCPtr(MgCmdArcCSE obj) { 20 | return (obj == null) ? 0 : obj.swigCPtr; 21 | } 22 | 23 | protected void finalize() { 24 | delete(); 25 | } 26 | 27 | public synchronized void delete() { 28 | if (swigCPtr != 0) { 29 | if (swigCMemOwn) { 30 | swigCMemOwn = false; 31 | touchvgJNI.delete_MgCmdArcCSE(swigCPtr); 32 | } 33 | swigCPtr = 0; 34 | } 35 | super.delete(); 36 | } 37 | 38 | public MgCmdArcCSE(String name) { 39 | this(touchvgJNI.new_MgCmdArcCSE__SWIG_0(name), true); 40 | } 41 | 42 | public MgCmdArcCSE() { 43 | this(touchvgJNI.new_MgCmdArcCSE__SWIG_1(), true); 44 | } 45 | 46 | public void release() { 47 | touchvgJNI.MgCmdArcCSE_release(swigCPtr, this); 48 | } 49 | 50 | public boolean draw(MgMotion sender, GiGraphics gs) { 51 | return touchvgJNI.MgCmdArcCSE_draw(swigCPtr, this, MgMotion.getCPtr(sender), sender, GiGraphics.getCPtr(gs), gs); 52 | } 53 | 54 | } 55 | -------------------------------------------------------------------------------- /android/src/main/java/rhcad/touchvg/core/MgCmdArcTan.java: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------------- 2 | * This file was automatically generated by SWIG (http://www.swig.org). 3 | * Version 3.0.12 4 | * 5 | * Do not make changes to this file unless you know what you are doing--modify 6 | * the SWIG interface file instead. 7 | * ----------------------------------------------------------------------------- */ 8 | 9 | package rhcad.touchvg.core; 10 | 11 | public class MgCmdArcTan extends MgCmdArc3P { 12 | private transient long swigCPtr; 13 | 14 | protected MgCmdArcTan(long cPtr, boolean cMemoryOwn) { 15 | super(touchvgJNI.MgCmdArcTan_SWIGUpcast(cPtr), cMemoryOwn); 16 | swigCPtr = cPtr; 17 | } 18 | 19 | protected static long getCPtr(MgCmdArcTan obj) { 20 | return (obj == null) ? 0 : obj.swigCPtr; 21 | } 22 | 23 | protected void finalize() { 24 | delete(); 25 | } 26 | 27 | public synchronized void delete() { 28 | if (swigCPtr != 0) { 29 | if (swigCMemOwn) { 30 | swigCMemOwn = false; 31 | touchvgJNI.delete_MgCmdArcTan(swigCPtr); 32 | } 33 | swigCPtr = 0; 34 | } 35 | super.delete(); 36 | } 37 | 38 | public MgCmdArcTan(String name) { 39 | this(touchvgJNI.new_MgCmdArcTan__SWIG_0(name), true); 40 | } 41 | 42 | public MgCmdArcTan() { 43 | this(touchvgJNI.new_MgCmdArcTan__SWIG_1(), true); 44 | } 45 | 46 | public void release() { 47 | touchvgJNI.MgCmdArcTan_release(swigCPtr, this); 48 | } 49 | 50 | } 51 | -------------------------------------------------------------------------------- /android/src/main/java/rhcad/touchvg/core/MgCmdCompass.java: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------------- 2 | * This file was automatically generated by SWIG (http://www.swig.org). 3 | * Version 3.0.12 4 | * 5 | * Do not make changes to this file unless you know what you are doing--modify 6 | * the SWIG interface file instead. 7 | * ----------------------------------------------------------------------------- */ 8 | 9 | package rhcad.touchvg.core; 10 | 11 | public class MgCmdCompass extends MgCmdArc3P { 12 | private transient long swigCPtr; 13 | 14 | protected MgCmdCompass(long cPtr, boolean cMemoryOwn) { 15 | super(touchvgJNI.MgCmdCompass_SWIGUpcast(cPtr), cMemoryOwn); 16 | swigCPtr = cPtr; 17 | } 18 | 19 | protected static long getCPtr(MgCmdCompass obj) { 20 | return (obj == null) ? 0 : obj.swigCPtr; 21 | } 22 | 23 | protected void finalize() { 24 | delete(); 25 | } 26 | 27 | public synchronized void delete() { 28 | if (swigCPtr != 0) { 29 | if (swigCMemOwn) { 30 | swigCMemOwn = false; 31 | touchvgJNI.delete_MgCmdCompass(swigCPtr); 32 | } 33 | swigCPtr = 0; 34 | } 35 | super.delete(); 36 | } 37 | 38 | public MgCmdCompass(String name) { 39 | this(touchvgJNI.new_MgCmdCompass__SWIG_0(name), true); 40 | } 41 | 42 | public MgCmdCompass() { 43 | this(touchvgJNI.new_MgCmdCompass__SWIG_1(), true); 44 | } 45 | 46 | public void release() { 47 | touchvgJNI.MgCmdCompass_release(swigCPtr, this); 48 | } 49 | 50 | public boolean initialize(MgMotion sender, MgStorage s) { 51 | return touchvgJNI.MgCmdCompass_initialize(swigCPtr, this, MgMotion.getCPtr(sender), sender, MgStorage.getCPtr(s), s); 52 | } 53 | 54 | public boolean draw(MgMotion sender, GiGraphics gs) { 55 | return touchvgJNI.MgCmdCompass_draw(swigCPtr, this, MgMotion.getCPtr(sender), sender, GiGraphics.getCPtr(gs), gs); 56 | } 57 | 58 | public boolean click(MgMotion sender) { 59 | return touchvgJNI.MgCmdCompass_click(swigCPtr, this, MgMotion.getCPtr(sender), sender); 60 | } 61 | 62 | } 63 | -------------------------------------------------------------------------------- /android/src/main/java/rhcad/touchvg/core/MgCmdManagerFactory.java: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------------- 2 | * This file was automatically generated by SWIG (http://www.swig.org). 3 | * Version 3.0.12 4 | * 5 | * Do not make changes to this file unless you know what you are doing--modify 6 | * the SWIG interface file instead. 7 | * ----------------------------------------------------------------------------- */ 8 | 9 | package rhcad.touchvg.core; 10 | 11 | public class MgCmdManagerFactory { 12 | private transient long swigCPtr; 13 | protected transient boolean swigCMemOwn; 14 | 15 | protected MgCmdManagerFactory(long cPtr, boolean cMemoryOwn) { 16 | swigCMemOwn = cMemoryOwn; 17 | swigCPtr = cPtr; 18 | } 19 | 20 | protected static long getCPtr(MgCmdManagerFactory obj) { 21 | return (obj == null) ? 0 : obj.swigCPtr; 22 | } 23 | 24 | protected void finalize() { 25 | delete(); 26 | } 27 | 28 | public synchronized void delete() { 29 | if (swigCPtr != 0) { 30 | if (swigCMemOwn) { 31 | swigCMemOwn = false; 32 | touchvgJNI.delete_MgCmdManagerFactory(swigCPtr); 33 | } 34 | swigCPtr = 0; 35 | } 36 | } 37 | 38 | public static MgCmdManager create() { 39 | long cPtr = touchvgJNI.MgCmdManagerFactory_create(); 40 | return (cPtr == 0) ? null : new MgCmdManager(cPtr, false); 41 | } 42 | 43 | public MgCmdManagerFactory() { 44 | this(touchvgJNI.new_MgCmdManagerFactory(), true); 45 | } 46 | 47 | } 48 | -------------------------------------------------------------------------------- /android/src/main/java/rhcad/touchvg/core/MgCmdSector.java: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------------- 2 | * This file was automatically generated by SWIG (http://www.swig.org). 3 | * Version 3.0.12 4 | * 5 | * Do not make changes to this file unless you know what you are doing--modify 6 | * the SWIG interface file instead. 7 | * ----------------------------------------------------------------------------- */ 8 | 9 | package rhcad.touchvg.core; 10 | 11 | public class MgCmdSector extends MgCmdArcCSE { 12 | private transient long swigCPtr; 13 | 14 | protected MgCmdSector(long cPtr, boolean cMemoryOwn) { 15 | super(touchvgJNI.MgCmdSector_SWIGUpcast(cPtr), cMemoryOwn); 16 | swigCPtr = cPtr; 17 | } 18 | 19 | protected static long getCPtr(MgCmdSector obj) { 20 | return (obj == null) ? 0 : obj.swigCPtr; 21 | } 22 | 23 | protected void finalize() { 24 | delete(); 25 | } 26 | 27 | public synchronized void delete() { 28 | if (swigCPtr != 0) { 29 | if (swigCMemOwn) { 30 | swigCMemOwn = false; 31 | touchvgJNI.delete_MgCmdSector(swigCPtr); 32 | } 33 | swigCPtr = 0; 34 | } 35 | super.delete(); 36 | } 37 | 38 | public MgCmdSector(String name) { 39 | this(touchvgJNI.new_MgCmdSector__SWIG_0(name), true); 40 | } 41 | 42 | public MgCmdSector() { 43 | this(touchvgJNI.new_MgCmdSector__SWIG_1(), true); 44 | } 45 | 46 | public boolean initialize(MgMotion sender, MgStorage s) { 47 | return touchvgJNI.MgCmdSector_initialize(swigCPtr, this, MgMotion.getCPtr(sender), sender, MgStorage.getCPtr(s), s); 48 | } 49 | 50 | } 51 | -------------------------------------------------------------------------------- /android/src/main/java/rhcad/touchvg/core/MgCoreShapeFactory.java: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------------- 2 | * This file was automatically generated by SWIG (http://www.swig.org). 3 | * Version 3.0.12 4 | * 5 | * Do not make changes to this file unless you know what you are doing--modify 6 | * the SWIG interface file instead. 7 | * ----------------------------------------------------------------------------- */ 8 | 9 | package rhcad.touchvg.core; 10 | 11 | public class MgCoreShapeFactory { 12 | private transient long swigCPtr; 13 | protected transient boolean swigCMemOwn; 14 | 15 | protected MgCoreShapeFactory(long cPtr, boolean cMemoryOwn) { 16 | swigCMemOwn = cMemoryOwn; 17 | swigCPtr = cPtr; 18 | } 19 | 20 | protected static long getCPtr(MgCoreShapeFactory obj) { 21 | return (obj == null) ? 0 : obj.swigCPtr; 22 | } 23 | 24 | protected void finalize() { 25 | delete(); 26 | } 27 | 28 | public synchronized void delete() { 29 | if (swigCPtr != 0) { 30 | if (swigCMemOwn) { 31 | swigCMemOwn = false; 32 | touchvgJNI.delete_MgCoreShapeFactory(swigCPtr); 33 | } 34 | swigCPtr = 0; 35 | } 36 | } 37 | 38 | public MgCoreShapeFactory() { 39 | this(touchvgJNI.new_MgCoreShapeFactory(), true); 40 | } 41 | 42 | public MgBaseShape createShape(int type) { 43 | long cPtr = touchvgJNI.MgCoreShapeFactory_createShape(swigCPtr, this, type); 44 | return (cPtr == 0) ? null : new MgBaseShape(cPtr, false); 45 | } 46 | 47 | } 48 | -------------------------------------------------------------------------------- /android/src/main/java/rhcad/touchvg/core/MgFindImageCallback.java: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------------- 2 | * This file was automatically generated by SWIG (http://www.swig.org). 3 | * Version 3.0.12 4 | * 5 | * Do not make changes to this file unless you know what you are doing--modify 6 | * the SWIG interface file instead. 7 | * ----------------------------------------------------------------------------- */ 8 | 9 | package rhcad.touchvg.core; 10 | 11 | public class MgFindImageCallback { 12 | private transient long swigCPtr; 13 | protected transient boolean swigCMemOwn; 14 | 15 | protected MgFindImageCallback(long cPtr, boolean cMemoryOwn) { 16 | swigCMemOwn = cMemoryOwn; 17 | swigCPtr = cPtr; 18 | } 19 | 20 | protected static long getCPtr(MgFindImageCallback obj) { 21 | return (obj == null) ? 0 : obj.swigCPtr; 22 | } 23 | 24 | protected void finalize() { 25 | delete(); 26 | } 27 | 28 | public synchronized void delete() { 29 | if (swigCPtr != 0) { 30 | if (swigCMemOwn) { 31 | swigCMemOwn = false; 32 | touchvgJNI.delete_MgFindImageCallback(swigCPtr); 33 | } 34 | swigCPtr = 0; 35 | } 36 | } 37 | 38 | protected void swigDirectorDisconnect() { 39 | swigCMemOwn = false; 40 | delete(); 41 | } 42 | 43 | public void swigReleaseOwnership() { 44 | swigCMemOwn = false; 45 | touchvgJNI.MgFindImageCallback_change_ownership(this, swigCPtr, false); 46 | } 47 | 48 | public void swigTakeOwnership() { 49 | swigCMemOwn = true; 50 | touchvgJNI.MgFindImageCallback_change_ownership(this, swigCPtr, true); 51 | } 52 | 53 | public void onFindImage(int sid, String name) { 54 | touchvgJNI.MgFindImageCallback_onFindImage(swigCPtr, this, sid, name); 55 | } 56 | 57 | public MgFindImageCallback() { 58 | this(touchvgJNI.new_MgFindImageCallback(), true); 59 | touchvgJNI.MgFindImageCallback_director_connect(this, swigCPtr, swigCMemOwn, true); 60 | } 61 | 62 | } 63 | -------------------------------------------------------------------------------- /android/src/main/java/rhcad/touchvg/core/MgJsonFile.java: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------------- 2 | * This file was automatically generated by SWIG (http://www.swig.org). 3 | * Version 3.0.12 4 | * 5 | * Do not make changes to this file unless you know what you are doing--modify 6 | * the SWIG interface file instead. 7 | * ----------------------------------------------------------------------------- */ 8 | 9 | package rhcad.touchvg.core; 10 | 11 | public class MgJsonFile { 12 | private transient long swigCPtr; 13 | protected transient boolean swigCMemOwn; 14 | 15 | protected MgJsonFile(long cPtr, boolean cMemoryOwn) { 16 | swigCMemOwn = cMemoryOwn; 17 | swigCPtr = cPtr; 18 | } 19 | 20 | protected static long getCPtr(MgJsonFile obj) { 21 | return (obj == null) ? 0 : obj.swigCPtr; 22 | } 23 | 24 | protected void finalize() { 25 | delete(); 26 | } 27 | 28 | public synchronized void delete() { 29 | if (swigCPtr != 0) { 30 | if (swigCMemOwn) { 31 | swigCMemOwn = false; 32 | touchvgJNI.delete_MgJsonFile(swigCPtr); 33 | } 34 | swigCPtr = 0; 35 | } 36 | } 37 | 38 | public MgJsonFile(String filename, boolean forRead) { 39 | this(touchvgJNI.new_MgJsonFile(filename, forRead), true); 40 | } 41 | 42 | public boolean opened() { 43 | return touchvgJNI.MgJsonFile_opened(swigCPtr, this); 44 | } 45 | 46 | public void close() { 47 | touchvgJNI.MgJsonFile_close(swigCPtr, this); 48 | } 49 | 50 | } 51 | -------------------------------------------------------------------------------- /android/src/main/java/rhcad/touchvg/core/MgRegenLocker.java: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------------- 2 | * This file was automatically generated by SWIG (http://www.swig.org). 3 | * Version 3.0.12 4 | * 5 | * Do not make changes to this file unless you know what you are doing--modify 6 | * the SWIG interface file instead. 7 | * ----------------------------------------------------------------------------- */ 8 | 9 | package rhcad.touchvg.core; 10 | 11 | public class MgRegenLocker { 12 | private transient long swigCPtr; 13 | protected transient boolean swigCMemOwn; 14 | 15 | protected MgRegenLocker(long cPtr, boolean cMemoryOwn) { 16 | swigCMemOwn = cMemoryOwn; 17 | swigCPtr = cPtr; 18 | } 19 | 20 | protected static long getCPtr(MgRegenLocker obj) { 21 | return (obj == null) ? 0 : obj.swigCPtr; 22 | } 23 | 24 | protected void finalize() { 25 | delete(); 26 | } 27 | 28 | public synchronized void delete() { 29 | if (swigCPtr != 0) { 30 | if (swigCMemOwn) { 31 | swigCMemOwn = false; 32 | touchvgJNI.delete_MgRegenLocker(swigCPtr); 33 | } 34 | swigCPtr = 0; 35 | } 36 | } 37 | 38 | public MgRegenLocker(MgView view) { 39 | this(touchvgJNI.new_MgRegenLocker(MgView.getCPtr(view), view), true); 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /android/src/main/java/rhcad/touchvg/core/MgShapeFactory.java: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------------- 2 | * This file was automatically generated by SWIG (http://www.swig.org). 3 | * Version 3.0.12 4 | * 5 | * Do not make changes to this file unless you know what you are doing--modify 6 | * the SWIG interface file instead. 7 | * ----------------------------------------------------------------------------- */ 8 | 9 | package rhcad.touchvg.core; 10 | 11 | public class MgShapeFactory { 12 | private transient long swigCPtr; 13 | protected transient boolean swigCMemOwn; 14 | 15 | protected MgShapeFactory(long cPtr, boolean cMemoryOwn) { 16 | swigCMemOwn = cMemoryOwn; 17 | swigCPtr = cPtr; 18 | } 19 | 20 | protected static long getCPtr(MgShapeFactory obj) { 21 | return (obj == null) ? 0 : obj.swigCPtr; 22 | } 23 | 24 | protected void finalize() { 25 | delete(); 26 | } 27 | 28 | public synchronized void delete() { 29 | if (swigCPtr != 0) { 30 | if (swigCMemOwn) { 31 | swigCMemOwn = false; 32 | touchvgJNI.delete_MgShapeFactory(swigCPtr); 33 | } 34 | swigCPtr = 0; 35 | } 36 | } 37 | 38 | public MgShape createShape(int type) { 39 | long cPtr = touchvgJNI.MgShapeFactory_createShape(swigCPtr, this, type); 40 | return (cPtr == 0) ? null : new MgShape(cPtr, false); 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /android/src/main/java/rhcad/touchvg/core/MgShapeIterator.java: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------------- 2 | * This file was automatically generated by SWIG (http://www.swig.org). 3 | * Version 3.0.12 4 | * 5 | * Do not make changes to this file unless you know what you are doing--modify 6 | * the SWIG interface file instead. 7 | * ----------------------------------------------------------------------------- */ 8 | 9 | package rhcad.touchvg.core; 10 | 11 | public class MgShapeIterator { 12 | private transient long swigCPtr; 13 | protected transient boolean swigCMemOwn; 14 | 15 | protected MgShapeIterator(long cPtr, boolean cMemoryOwn) { 16 | swigCMemOwn = cMemoryOwn; 17 | swigCPtr = cPtr; 18 | } 19 | 20 | protected static long getCPtr(MgShapeIterator obj) { 21 | return (obj == null) ? 0 : obj.swigCPtr; 22 | } 23 | 24 | protected void finalize() { 25 | delete(); 26 | } 27 | 28 | public synchronized void delete() { 29 | if (swigCPtr != 0) { 30 | if (swigCMemOwn) { 31 | swigCMemOwn = false; 32 | touchvgJNI.delete_MgShapeIterator(swigCPtr); 33 | } 34 | swigCPtr = 0; 35 | } 36 | } 37 | 38 | public MgShapeIterator(MgShapes s) { 39 | this(touchvgJNI.new_MgShapeIterator(MgShapes.getCPtr(s), s), true); 40 | } 41 | 42 | public boolean hasNext() { 43 | return touchvgJNI.MgShapeIterator_hasNext(swigCPtr, this); 44 | } 45 | 46 | public MgShape getNext() { 47 | long cPtr = touchvgJNI.MgShapeIterator_getNext(swigCPtr, this); 48 | return (cPtr == 0) ? null : new MgShape(cPtr, false); 49 | } 50 | 51 | public MgShapes shapes() { 52 | long cPtr = touchvgJNI.MgShapeIterator_shapes(swigCPtr, this); 53 | return (cPtr == 0) ? null : new MgShapes(cPtr, false); 54 | } 55 | 56 | } 57 | -------------------------------------------------------------------------------- /android/src/main/java/rhcad/touchvg/core/MgStringCallback.java: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------------- 2 | * This file was automatically generated by SWIG (http://www.swig.org). 3 | * Version 3.0.12 4 | * 5 | * Do not make changes to this file unless you know what you are doing--modify 6 | * the SWIG interface file instead. 7 | * ----------------------------------------------------------------------------- */ 8 | 9 | package rhcad.touchvg.core; 10 | 11 | public class MgStringCallback { 12 | private transient long swigCPtr; 13 | protected transient boolean swigCMemOwn; 14 | 15 | protected MgStringCallback(long cPtr, boolean cMemoryOwn) { 16 | swigCMemOwn = cMemoryOwn; 17 | swigCPtr = cPtr; 18 | } 19 | 20 | protected static long getCPtr(MgStringCallback obj) { 21 | return (obj == null) ? 0 : obj.swigCPtr; 22 | } 23 | 24 | protected void finalize() { 25 | delete(); 26 | } 27 | 28 | public synchronized void delete() { 29 | if (swigCPtr != 0) { 30 | if (swigCMemOwn) { 31 | swigCMemOwn = false; 32 | touchvgJNI.delete_MgStringCallback(swigCPtr); 33 | } 34 | swigCPtr = 0; 35 | } 36 | } 37 | 38 | protected void swigDirectorDisconnect() { 39 | swigCMemOwn = false; 40 | delete(); 41 | } 42 | 43 | public void swigReleaseOwnership() { 44 | swigCMemOwn = false; 45 | touchvgJNI.MgStringCallback_change_ownership(this, swigCPtr, false); 46 | } 47 | 48 | public void swigTakeOwnership() { 49 | swigCMemOwn = true; 50 | touchvgJNI.MgStringCallback_change_ownership(this, swigCPtr, true); 51 | } 52 | 53 | public void onGetString(String text) { 54 | touchvgJNI.MgStringCallback_onGetString(swigCPtr, this, text); 55 | } 56 | 57 | public MgStringCallback() { 58 | this(touchvgJNI.new_MgStringCallback(), true); 59 | touchvgJNI.MgStringCallback_director_connect(this, swigCPtr, swigCMemOwn, true); 60 | } 61 | 62 | } 63 | -------------------------------------------------------------------------------- /android/src/main/java/rhcad/touchvg/core/Tol.java: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------------- 2 | * This file was automatically generated by SWIG (http://www.swig.org). 3 | * Version 3.0.12 4 | * 5 | * Do not make changes to this file unless you know what you are doing--modify 6 | * the SWIG interface file instead. 7 | * ----------------------------------------------------------------------------- */ 8 | 9 | package rhcad.touchvg.core; 10 | 11 | public class Tol { 12 | private transient long swigCPtr; 13 | protected transient boolean swigCMemOwn; 14 | 15 | protected Tol(long cPtr, boolean cMemoryOwn) { 16 | swigCMemOwn = cMemoryOwn; 17 | swigCPtr = cPtr; 18 | } 19 | 20 | protected static long getCPtr(Tol obj) { 21 | return (obj == null) ? 0 : obj.swigCPtr; 22 | } 23 | 24 | protected void finalize() { 25 | delete(); 26 | } 27 | 28 | public synchronized void delete() { 29 | if (swigCPtr != 0) { 30 | if (swigCMemOwn) { 31 | swigCMemOwn = false; 32 | touchvgJNI.delete_Tol(swigCPtr); 33 | } 34 | swigCPtr = 0; 35 | } 36 | } 37 | 38 | public static Tol gTol() { 39 | return new Tol(touchvgJNI.Tol_gTol(), true); 40 | } 41 | 42 | public static Tol minTol() { 43 | return new Tol(touchvgJNI.Tol_minTol(), true); 44 | } 45 | 46 | public Tol() { 47 | this(touchvgJNI.new_Tol__SWIG_0(), true); 48 | } 49 | 50 | public Tol(float tolPoint, float tolVector) { 51 | this(touchvgJNI.new_Tol__SWIG_1(tolPoint, tolVector), true); 52 | } 53 | 54 | public Tol(float tolPoint) { 55 | this(touchvgJNI.new_Tol__SWIG_2(tolPoint), true); 56 | } 57 | 58 | public float equalPoint() { 59 | return touchvgJNI.Tol_equalPoint(swigCPtr, this); 60 | } 61 | 62 | public float equalVector() { 63 | return touchvgJNI.Tol_equalVector(swigCPtr, this); 64 | } 65 | 66 | public void setEqualPoint(float tol) { 67 | touchvgJNI.Tol_setEqualPoint(swigCPtr, this, tol); 68 | } 69 | 70 | public void setEqualVector(float tol) { 71 | touchvgJNI.Tol_setEqualVector(swigCPtr, this, tol); 72 | } 73 | 74 | } 75 | -------------------------------------------------------------------------------- /android/src/main/java/rhcad/touchvg/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * TouchVG is a lightweight 2D vector drawing framework. 3 | * @author Zhang Yungui 4 | */ 5 | package rhcad.touchvg; 6 | -------------------------------------------------------------------------------- /android/src/main/java/rhcad/touchvg/view/BaseGraphView.java: -------------------------------------------------------------------------------- 1 | //! \file BaseGraphView.java 2 | //! \brief 绘图视图接口 3 | // Copyright (c) 2012-2015, https://github.com/rhcad/vgandroid, BSD license 4 | 5 | package rhcad.touchvg.view; 6 | 7 | import rhcad.touchvg.IGraphView; 8 | import rhcad.touchvg.core.GiView; 9 | import rhcad.touchvg.view.internal.ImageCache; 10 | 11 | //! 绘图视图接口 12 | public interface BaseGraphView extends IGraphView { 13 | 14 | //! 返回视图回调适配器对象 15 | public GiView viewAdapter(); 16 | 17 | //! 返回图像对象缓存 18 | public ImageCache getImageCache(); 19 | 20 | //! 销毁数据,内部调用 21 | public void tearDown(); 22 | } 23 | -------------------------------------------------------------------------------- /android/src/main/java/rhcad/touchvg/view/internal/RecordRunnable.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2015, https://github.com/rhcad/vgandroid, BSD license 2 | 3 | package rhcad.touchvg.view.internal; 4 | 5 | import rhcad.touchvg.core.GiCoreView; 6 | import android.util.Log; 7 | 8 | public class RecordRunnable extends ShapeRunnable { 9 | public static final int TYPE = 2; 10 | protected BaseViewAdapter mViewAdapter; 11 | 12 | public RecordRunnable(BaseViewAdapter viewAdapter, String path) { 13 | super(path, TYPE, viewAdapter.coreView()); 14 | this.mViewAdapter = viewAdapter; 15 | } 16 | 17 | @Override 18 | protected boolean beforeStopped() { 19 | synchronized (GiCoreView.class) { 20 | boolean ret = mViewAdapter.onStopped(this); 21 | if (ret) { 22 | synchronized (mCoreView) { 23 | mCoreView.stopRecord(false); 24 | } 25 | } 26 | return ret; 27 | } 28 | } 29 | 30 | @Override 31 | protected void afterStopped(boolean normal) { 32 | mViewAdapter = null; 33 | } 34 | 35 | @Override 36 | protected void process(int tick, int change, int doc, int shapes) { 37 | if (!mCoreView.recordShapes(false, tick, change, doc, shapes, null, 38 | mViewAdapter.createRecordCallback(true))) { 39 | Log.e(TAG, "Fail to record shapes for playing, tick=" + tick 40 | + ", doc=" + doc + ", shapes=" + shapes); 41 | } 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /android/src/main/java/rhcad/touchvg/view/internal/UndoRunnable.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2015, https://github.com/rhcad/vgandroid, BSD license 2 | 3 | package rhcad.touchvg.view.internal; 4 | 5 | import rhcad.touchvg.core.GiCoreView; 6 | import android.util.Log; 7 | 8 | public class UndoRunnable extends ShapeRunnable { 9 | public static final int TYPE = 1; 10 | public static final int UNDO = 0xFFFFFF10; 11 | public static final int REDO = 0xFFFFFF20; 12 | private BaseViewAdapter mViewAdapter; 13 | 14 | public UndoRunnable(BaseViewAdapter viewAdapter, String path) { 15 | super(path, TYPE, viewAdapter.coreView()); 16 | this.mViewAdapter = viewAdapter; 17 | } 18 | 19 | @Override 20 | protected boolean beforeStopped() { 21 | synchronized (GiCoreView.class) { 22 | boolean ret = mViewAdapter.onStopped(this); 23 | if (ret) { 24 | synchronized (mCoreView) { 25 | mCoreView.stopRecord(true); 26 | } 27 | } 28 | return ret; 29 | } 30 | } 31 | 32 | @Override 33 | protected void afterStopped(boolean normal) { 34 | mViewAdapter = null; 35 | } 36 | 37 | @Override 38 | protected void process(int tick, int change, int doc, int shapes) { 39 | if (tick == UNDO) { 40 | synchronized (mCoreView) { 41 | mCoreView.undo(mViewAdapter); 42 | } 43 | } else if (tick == REDO) { 44 | synchronized (mCoreView) { 45 | mCoreView.redo(mViewAdapter); 46 | } 47 | } else if (!mCoreView.recordShapes(true, tick, change, doc, shapes)) { 48 | Log.e(TAG, "Fail to record shapes for undoing, tick=" + tick + ", doc=" + doc); 49 | } 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /android/src/main/java/rhcad/touchvg/view/internal/ViewUtil.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2015, https://github.com/rhcad/vgandroid, BSD license 2 | 3 | package rhcad.touchvg.view.internal; 4 | 5 | import java.util.ArrayList; 6 | import java.util.List; 7 | 8 | import rhcad.touchvg.view.BaseGraphView; 9 | 10 | //! 记录当前视图和所有视图对象的辅助类 11 | public class ViewUtil { 12 | private static BaseGraphView mActiveView; 13 | private static List mViews = new ArrayList(); 14 | 15 | private ViewUtil() { 16 | } 17 | 18 | public static void onAddView(BaseGraphView view) { 19 | mViews.add(view); 20 | if (mActiveView == null) { 21 | mActiveView = view; 22 | } 23 | } 24 | 25 | public static void onRemoveView(BaseGraphView view) { 26 | mViews.remove(view); 27 | if (mActiveView == view) { 28 | mActiveView = mViews.isEmpty() ? null : mViews.get(0); 29 | } 30 | } 31 | 32 | public static List views() { 33 | return mViews; 34 | } 35 | 36 | public static BaseGraphView activeView() { 37 | return mActiveView; 38 | } 39 | 40 | public static void activateView(BaseGraphView view) { 41 | if (mActiveView != view) { 42 | mActiveView = view; 43 | } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /android/src/main/java/rhcad/touchvg/view/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * TouchVG is a lightweight 2D vector drawing framework. 3 | * @author Zhang Yungui 4 | */ 5 | package rhcad.touchvg.view; 6 | -------------------------------------------------------------------------------- /android/src/main/jniLibs/android-support-v4.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kangshaojun/flutter_touchvg/ccd4dc2c910e5aa6f9fff230af6de3be7a8da082/android/src/main/jniLibs/android-support-v4.jar -------------------------------------------------------------------------------- /android/src/main/jniLibs/androidsvg-1.2.2-beta-1-2.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kangshaojun/flutter_touchvg/ccd4dc2c910e5aa6f9fff230af6de3be7a8da082/android/src/main/jniLibs/androidsvg-1.2.2-beta-1-2.jar -------------------------------------------------------------------------------- /android/src/main/jniLibs/armeabi-v7a/libtouchvg.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kangshaojun/flutter_touchvg/ccd4dc2c910e5aa6f9fff230af6de3be7a8da082/android/src/main/jniLibs/armeabi-v7a/libtouchvg.so -------------------------------------------------------------------------------- /android/src/main/jniLibs/x86/libtouchvg.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kangshaojun/flutter_touchvg/ccd4dc2c910e5aa6f9fff230af6de3be7a8da082/android/src/main/jniLibs/x86/libtouchvg.so -------------------------------------------------------------------------------- /android/src/main/res/drawable-hdpi/brush.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kangshaojun/flutter_touchvg/ccd4dc2c910e5aa6f9fff230af6de3be7a8da082/android/src/main/res/drawable-hdpi/brush.png -------------------------------------------------------------------------------- /android/src/main/res/drawable-hdpi/colorwheel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kangshaojun/flutter_touchvg/ccd4dc2c910e5aa6f9fff230af6de3be7a8da082/android/src/main/res/drawable-hdpi/colorwheel.png -------------------------------------------------------------------------------- /android/src/main/res/drawable-hdpi/ellipse.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kangshaojun/flutter_touchvg/ccd4dc2c910e5aa6f9fff230af6de3be7a8da082/android/src/main/res/drawable-hdpi/ellipse.png -------------------------------------------------------------------------------- /android/src/main/res/drawable-hdpi/eraser.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kangshaojun/flutter_touchvg/ccd4dc2c910e5aa6f9fff230af6de3be7a8da082/android/src/main/res/drawable-hdpi/eraser.png -------------------------------------------------------------------------------- /android/src/main/res/drawable-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kangshaojun/flutter_touchvg/ccd4dc2c910e5aa6f9fff230af6de3be7a8da082/android/src/main/res/drawable-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/src/main/res/drawable-hdpi/line.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kangshaojun/flutter_touchvg/ccd4dc2c910e5aa6f9fff230af6de3be7a8da082/android/src/main/res/drawable-hdpi/line.png -------------------------------------------------------------------------------- /android/src/main/res/drawable-hdpi/rect.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kangshaojun/flutter_touchvg/ccd4dc2c910e5aa6f9fff230af6de3be7a8da082/android/src/main/res/drawable-hdpi/rect.png -------------------------------------------------------------------------------- /android/src/main/res/drawable-hdpi/select.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kangshaojun/flutter_touchvg/ccd4dc2c910e5aa6f9fff230af6de3be7a8da082/android/src/main/res/drawable-hdpi/select.png -------------------------------------------------------------------------------- /android/src/main/res/drawable-hdpi/snapshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kangshaojun/flutter_touchvg/ccd4dc2c910e5aa6f9fff230af6de3be7a8da082/android/src/main/res/drawable-hdpi/snapshot.png -------------------------------------------------------------------------------- /android/src/main/res/drawable-hdpi/triangle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kangshaojun/flutter_touchvg/ccd4dc2c910e5aa6f9fff230af6de3be7a8da082/android/src/main/res/drawable-hdpi/triangle.png -------------------------------------------------------------------------------- /android/src/main/res/drawable-hdpi/vg_back.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kangshaojun/flutter_touchvg/ccd4dc2c910e5aa6f9fff230af6de3be7a8da082/android/src/main/res/drawable-hdpi/vg_back.png -------------------------------------------------------------------------------- /android/src/main/res/drawable-hdpi/vg_clone.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kangshaojun/flutter_touchvg/ccd4dc2c910e5aa6f9fff230af6de3be7a8da082/android/src/main/res/drawable-hdpi/vg_clone.png -------------------------------------------------------------------------------- /android/src/main/res/drawable-hdpi/vg_delete.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kangshaojun/flutter_touchvg/ccd4dc2c910e5aa6f9fff230af6de3be7a8da082/android/src/main/res/drawable-hdpi/vg_delete.png -------------------------------------------------------------------------------- /android/src/main/res/drawable-hdpi/vg_edit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kangshaojun/flutter_touchvg/ccd4dc2c910e5aa6f9fff230af6de3be7a8da082/android/src/main/res/drawable-hdpi/vg_edit.png -------------------------------------------------------------------------------- /android/src/main/res/drawable-hdpi/vg_endedit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kangshaojun/flutter_touchvg/ccd4dc2c910e5aa6f9fff230af6de3be7a8da082/android/src/main/res/drawable-hdpi/vg_endedit.png -------------------------------------------------------------------------------- /android/src/main/res/drawable-hdpi/vg_fixlen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kangshaojun/flutter_touchvg/ccd4dc2c910e5aa6f9fff230af6de3be7a8da082/android/src/main/res/drawable-hdpi/vg_fixlen.png -------------------------------------------------------------------------------- /android/src/main/res/drawable-hdpi/vg_freelen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kangshaojun/flutter_touchvg/ccd4dc2c910e5aa6f9fff230af6de3be7a8da082/android/src/main/res/drawable-hdpi/vg_freelen.png -------------------------------------------------------------------------------- /android/src/main/res/drawable-hdpi/vg_group.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kangshaojun/flutter_touchvg/ccd4dc2c910e5aa6f9fff230af6de3be7a8da082/android/src/main/res/drawable-hdpi/vg_group.png -------------------------------------------------------------------------------- /android/src/main/res/drawable-hdpi/vg_lock.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kangshaojun/flutter_touchvg/ccd4dc2c910e5aa6f9fff230af6de3be7a8da082/android/src/main/res/drawable-hdpi/vg_lock.png -------------------------------------------------------------------------------- /android/src/main/res/drawable-hdpi/vg_overturn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kangshaojun/flutter_touchvg/ccd4dc2c910e5aa6f9fff230af6de3be7a8da082/android/src/main/res/drawable-hdpi/vg_overturn.png -------------------------------------------------------------------------------- /android/src/main/res/drawable-hdpi/vg_selall.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kangshaojun/flutter_touchvg/ccd4dc2c910e5aa6f9fff230af6de3be7a8da082/android/src/main/res/drawable-hdpi/vg_selall.png -------------------------------------------------------------------------------- /android/src/main/res/drawable-hdpi/vg_ungroup.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kangshaojun/flutter_touchvg/ccd4dc2c910e5aa6f9fff230af6de3be7a8da082/android/src/main/res/drawable-hdpi/vg_ungroup.png -------------------------------------------------------------------------------- /android/src/main/res/drawable-hdpi/vg_unlock.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kangshaojun/flutter_touchvg/ccd4dc2c910e5aa6f9fff230af6de3be7a8da082/android/src/main/res/drawable-hdpi/vg_unlock.png -------------------------------------------------------------------------------- /android/src/main/res/drawable-hdpi/vgcen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kangshaojun/flutter_touchvg/ccd4dc2c910e5aa6f9fff230af6de3be7a8da082/android/src/main/res/drawable-hdpi/vgcen.png -------------------------------------------------------------------------------- /android/src/main/res/drawable-hdpi/vgcross.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kangshaojun/flutter_touchvg/ccd4dc2c910e5aa6f9fff230af6de3be7a8da082/android/src/main/res/drawable-hdpi/vgcross.png -------------------------------------------------------------------------------- /android/src/main/res/drawable-hdpi/vgdot1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kangshaojun/flutter_touchvg/ccd4dc2c910e5aa6f9fff230af6de3be7a8da082/android/src/main/res/drawable-hdpi/vgdot1.png -------------------------------------------------------------------------------- /android/src/main/res/drawable-hdpi/vgdot2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kangshaojun/flutter_touchvg/ccd4dc2c910e5aa6f9fff230af6de3be7a8da082/android/src/main/res/drawable-hdpi/vgdot2.png -------------------------------------------------------------------------------- /android/src/main/res/drawable-hdpi/vgdot3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kangshaojun/flutter_touchvg/ccd4dc2c910e5aa6f9fff230af6de3be7a8da082/android/src/main/res/drawable-hdpi/vgdot3.png -------------------------------------------------------------------------------- /android/src/main/res/drawable-hdpi/vgmid.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kangshaojun/flutter_touchvg/ccd4dc2c910e5aa6f9fff230af6de3be7a8da082/android/src/main/res/drawable-hdpi/vgmid.png -------------------------------------------------------------------------------- /android/src/main/res/drawable-hdpi/vgnear.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kangshaojun/flutter_touchvg/ccd4dc2c910e5aa6f9fff230af6de3be7a8da082/android/src/main/res/drawable-hdpi/vgnear.png -------------------------------------------------------------------------------- /android/src/main/res/drawable-hdpi/vgnode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kangshaojun/flutter_touchvg/ccd4dc2c910e5aa6f9fff230af6de3be7a8da082/android/src/main/res/drawable-hdpi/vgnode.png -------------------------------------------------------------------------------- /android/src/main/res/drawable-hdpi/vgparallel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kangshaojun/flutter_touchvg/ccd4dc2c910e5aa6f9fff230af6de3be7a8da082/android/src/main/res/drawable-hdpi/vgparallel.png -------------------------------------------------------------------------------- /android/src/main/res/drawable-hdpi/vgpivot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kangshaojun/flutter_touchvg/ccd4dc2c910e5aa6f9fff230af6de3be7a8da082/android/src/main/res/drawable-hdpi/vgpivot.png -------------------------------------------------------------------------------- /android/src/main/res/drawable-hdpi/vgquad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kangshaojun/flutter_touchvg/ccd4dc2c910e5aa6f9fff230af6de3be7a8da082/android/src/main/res/drawable-hdpi/vgquad.png -------------------------------------------------------------------------------- /android/src/main/res/drawable-hdpi/vgredo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kangshaojun/flutter_touchvg/ccd4dc2c910e5aa6f9fff230af6de3be7a8da082/android/src/main/res/drawable-hdpi/vgredo.png -------------------------------------------------------------------------------- /android/src/main/res/drawable-hdpi/vgtangent.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kangshaojun/flutter_touchvg/ccd4dc2c910e5aa6f9fff230af6de3be7a8da082/android/src/main/res/drawable-hdpi/vgtangent.png -------------------------------------------------------------------------------- /android/src/main/res/drawable-hdpi/vgundo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kangshaojun/flutter_touchvg/ccd4dc2c910e5aa6f9fff230af6de3be7a8da082/android/src/main/res/drawable-hdpi/vgundo.png -------------------------------------------------------------------------------- /android/src/main/res/drawable-mdpi/brush.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kangshaojun/flutter_touchvg/ccd4dc2c910e5aa6f9fff230af6de3be7a8da082/android/src/main/res/drawable-mdpi/brush.png -------------------------------------------------------------------------------- /android/src/main/res/drawable-mdpi/colorwheel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kangshaojun/flutter_touchvg/ccd4dc2c910e5aa6f9fff230af6de3be7a8da082/android/src/main/res/drawable-mdpi/colorwheel.png -------------------------------------------------------------------------------- /android/src/main/res/drawable-mdpi/ellipse.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kangshaojun/flutter_touchvg/ccd4dc2c910e5aa6f9fff230af6de3be7a8da082/android/src/main/res/drawable-mdpi/ellipse.png -------------------------------------------------------------------------------- /android/src/main/res/drawable-mdpi/eraser.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kangshaojun/flutter_touchvg/ccd4dc2c910e5aa6f9fff230af6de3be7a8da082/android/src/main/res/drawable-mdpi/eraser.png -------------------------------------------------------------------------------- /android/src/main/res/drawable-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kangshaojun/flutter_touchvg/ccd4dc2c910e5aa6f9fff230af6de3be7a8da082/android/src/main/res/drawable-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/src/main/res/drawable-mdpi/line.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kangshaojun/flutter_touchvg/ccd4dc2c910e5aa6f9fff230af6de3be7a8da082/android/src/main/res/drawable-mdpi/line.png -------------------------------------------------------------------------------- /android/src/main/res/drawable-mdpi/rect.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kangshaojun/flutter_touchvg/ccd4dc2c910e5aa6f9fff230af6de3be7a8da082/android/src/main/res/drawable-mdpi/rect.png -------------------------------------------------------------------------------- /android/src/main/res/drawable-mdpi/select.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kangshaojun/flutter_touchvg/ccd4dc2c910e5aa6f9fff230af6de3be7a8da082/android/src/main/res/drawable-mdpi/select.png -------------------------------------------------------------------------------- /android/src/main/res/drawable-mdpi/snapshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kangshaojun/flutter_touchvg/ccd4dc2c910e5aa6f9fff230af6de3be7a8da082/android/src/main/res/drawable-mdpi/snapshot.png -------------------------------------------------------------------------------- /android/src/main/res/drawable-mdpi/triangle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kangshaojun/flutter_touchvg/ccd4dc2c910e5aa6f9fff230af6de3be7a8da082/android/src/main/res/drawable-mdpi/triangle.png -------------------------------------------------------------------------------- /android/src/main/res/drawable-mdpi/vg_back.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kangshaojun/flutter_touchvg/ccd4dc2c910e5aa6f9fff230af6de3be7a8da082/android/src/main/res/drawable-mdpi/vg_back.png -------------------------------------------------------------------------------- /android/src/main/res/drawable-mdpi/vg_clone.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kangshaojun/flutter_touchvg/ccd4dc2c910e5aa6f9fff230af6de3be7a8da082/android/src/main/res/drawable-mdpi/vg_clone.png -------------------------------------------------------------------------------- /android/src/main/res/drawable-mdpi/vg_delete.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kangshaojun/flutter_touchvg/ccd4dc2c910e5aa6f9fff230af6de3be7a8da082/android/src/main/res/drawable-mdpi/vg_delete.png -------------------------------------------------------------------------------- /android/src/main/res/drawable-mdpi/vg_edit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kangshaojun/flutter_touchvg/ccd4dc2c910e5aa6f9fff230af6de3be7a8da082/android/src/main/res/drawable-mdpi/vg_edit.png -------------------------------------------------------------------------------- /android/src/main/res/drawable-mdpi/vg_endedit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kangshaojun/flutter_touchvg/ccd4dc2c910e5aa6f9fff230af6de3be7a8da082/android/src/main/res/drawable-mdpi/vg_endedit.png -------------------------------------------------------------------------------- /android/src/main/res/drawable-mdpi/vg_fixlen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kangshaojun/flutter_touchvg/ccd4dc2c910e5aa6f9fff230af6de3be7a8da082/android/src/main/res/drawable-mdpi/vg_fixlen.png -------------------------------------------------------------------------------- /android/src/main/res/drawable-mdpi/vg_freelen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kangshaojun/flutter_touchvg/ccd4dc2c910e5aa6f9fff230af6de3be7a8da082/android/src/main/res/drawable-mdpi/vg_freelen.png -------------------------------------------------------------------------------- /android/src/main/res/drawable-mdpi/vg_group.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kangshaojun/flutter_touchvg/ccd4dc2c910e5aa6f9fff230af6de3be7a8da082/android/src/main/res/drawable-mdpi/vg_group.png -------------------------------------------------------------------------------- /android/src/main/res/drawable-mdpi/vg_lock.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kangshaojun/flutter_touchvg/ccd4dc2c910e5aa6f9fff230af6de3be7a8da082/android/src/main/res/drawable-mdpi/vg_lock.png -------------------------------------------------------------------------------- /android/src/main/res/drawable-mdpi/vg_overturn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kangshaojun/flutter_touchvg/ccd4dc2c910e5aa6f9fff230af6de3be7a8da082/android/src/main/res/drawable-mdpi/vg_overturn.png -------------------------------------------------------------------------------- /android/src/main/res/drawable-mdpi/vg_selall.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kangshaojun/flutter_touchvg/ccd4dc2c910e5aa6f9fff230af6de3be7a8da082/android/src/main/res/drawable-mdpi/vg_selall.png -------------------------------------------------------------------------------- /android/src/main/res/drawable-mdpi/vg_ungroup.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kangshaojun/flutter_touchvg/ccd4dc2c910e5aa6f9fff230af6de3be7a8da082/android/src/main/res/drawable-mdpi/vg_ungroup.png -------------------------------------------------------------------------------- /android/src/main/res/drawable-mdpi/vg_unlock.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kangshaojun/flutter_touchvg/ccd4dc2c910e5aa6f9fff230af6de3be7a8da082/android/src/main/res/drawable-mdpi/vg_unlock.png -------------------------------------------------------------------------------- /android/src/main/res/drawable-mdpi/vgcen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kangshaojun/flutter_touchvg/ccd4dc2c910e5aa6f9fff230af6de3be7a8da082/android/src/main/res/drawable-mdpi/vgcen.png -------------------------------------------------------------------------------- /android/src/main/res/drawable-mdpi/vgcross.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kangshaojun/flutter_touchvg/ccd4dc2c910e5aa6f9fff230af6de3be7a8da082/android/src/main/res/drawable-mdpi/vgcross.png -------------------------------------------------------------------------------- /android/src/main/res/drawable-mdpi/vgdot1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kangshaojun/flutter_touchvg/ccd4dc2c910e5aa6f9fff230af6de3be7a8da082/android/src/main/res/drawable-mdpi/vgdot1.png -------------------------------------------------------------------------------- /android/src/main/res/drawable-mdpi/vgdot2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kangshaojun/flutter_touchvg/ccd4dc2c910e5aa6f9fff230af6de3be7a8da082/android/src/main/res/drawable-mdpi/vgdot2.png -------------------------------------------------------------------------------- /android/src/main/res/drawable-mdpi/vgdot3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kangshaojun/flutter_touchvg/ccd4dc2c910e5aa6f9fff230af6de3be7a8da082/android/src/main/res/drawable-mdpi/vgdot3.png -------------------------------------------------------------------------------- /android/src/main/res/drawable-mdpi/vgmid.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kangshaojun/flutter_touchvg/ccd4dc2c910e5aa6f9fff230af6de3be7a8da082/android/src/main/res/drawable-mdpi/vgmid.png -------------------------------------------------------------------------------- /android/src/main/res/drawable-mdpi/vgnear.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kangshaojun/flutter_touchvg/ccd4dc2c910e5aa6f9fff230af6de3be7a8da082/android/src/main/res/drawable-mdpi/vgnear.png -------------------------------------------------------------------------------- /android/src/main/res/drawable-mdpi/vgnode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kangshaojun/flutter_touchvg/ccd4dc2c910e5aa6f9fff230af6de3be7a8da082/android/src/main/res/drawable-mdpi/vgnode.png -------------------------------------------------------------------------------- /android/src/main/res/drawable-mdpi/vgparallel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kangshaojun/flutter_touchvg/ccd4dc2c910e5aa6f9fff230af6de3be7a8da082/android/src/main/res/drawable-mdpi/vgparallel.png -------------------------------------------------------------------------------- /android/src/main/res/drawable-mdpi/vgpivot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kangshaojun/flutter_touchvg/ccd4dc2c910e5aa6f9fff230af6de3be7a8da082/android/src/main/res/drawable-mdpi/vgpivot.png -------------------------------------------------------------------------------- /android/src/main/res/drawable-mdpi/vgquad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kangshaojun/flutter_touchvg/ccd4dc2c910e5aa6f9fff230af6de3be7a8da082/android/src/main/res/drawable-mdpi/vgquad.png -------------------------------------------------------------------------------- /android/src/main/res/drawable-mdpi/vgredo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kangshaojun/flutter_touchvg/ccd4dc2c910e5aa6f9fff230af6de3be7a8da082/android/src/main/res/drawable-mdpi/vgredo.png -------------------------------------------------------------------------------- /android/src/main/res/drawable-mdpi/vgtangent.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kangshaojun/flutter_touchvg/ccd4dc2c910e5aa6f9fff230af6de3be7a8da082/android/src/main/res/drawable-mdpi/vgtangent.png -------------------------------------------------------------------------------- /android/src/main/res/drawable-mdpi/vgundo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kangshaojun/flutter_touchvg/ccd4dc2c910e5aa6f9fff230af6de3be7a8da082/android/src/main/res/drawable-mdpi/vgundo.png -------------------------------------------------------------------------------- /android/src/main/res/drawable-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kangshaojun/flutter_touchvg/ccd4dc2c910e5aa6f9fff230af6de3be7a8da082/android/src/main/res/drawable-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/src/main/res/drawable/background.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kangshaojun/flutter_touchvg/ccd4dc2c910e5aa6f9fff230af6de3be7a8da082/android/src/main/res/drawable/background.jpg -------------------------------------------------------------------------------- /android/src/main/res/drawable/background_repeat.xml: -------------------------------------------------------------------------------- 1 | 4 | -------------------------------------------------------------------------------- /android/src/main/res/drawable/brush.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kangshaojun/flutter_touchvg/ccd4dc2c910e5aa6f9fff230af6de3be7a8da082/android/src/main/res/drawable/brush.png -------------------------------------------------------------------------------- /android/src/main/res/drawable/demo_switch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kangshaojun/flutter_touchvg/ccd4dc2c910e5aa6f9fff230af6de3be7a8da082/android/src/main/res/drawable/demo_switch.png -------------------------------------------------------------------------------- /android/src/main/res/drawable/vg_translucent.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kangshaojun/flutter_touchvg/ccd4dc2c910e5aa6f9fff230af6de3be7a8da082/android/src/main/res/drawable/vg_translucent.png -------------------------------------------------------------------------------- /android/src/main/res/drawable/vg_translucent_bg.xml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /android/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 7 | 8 | 12 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /android/src/main/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 16dp 5 | 16dp 6 | 7 | 8 | -------------------------------------------------------------------------------- /android/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 14 | 15 | 16 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /android/src/main/res/values/vg_action_captions.xml: -------------------------------------------------------------------------------- 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 | -------------------------------------------------------------------------------- /example/README.md: -------------------------------------------------------------------------------- 1 | # flutter_touchvg_example 2 | 3 | Demonstrates how to use the flutter_touchvg plugin. 4 | 5 | ## Getting Started 6 | 7 | This project is a starting point for a Flutter application. 8 | 9 | A few resources to get you started if this is your first Flutter project: 10 | 11 | - [Lab: Write your first Flutter app](https://flutter.io/docs/get-started/codelab) 12 | - [Cookbook: Useful Flutter samples](https://flutter.io/docs/cookbook) 13 | 14 | For help getting started with Flutter, view our 15 | [online documentation](https://flutter.io/docs), which offers tutorials, 16 | samples, guidance on mobile development, and a full API reference. 17 | -------------------------------------------------------------------------------- /example/android/app/build.gradle: -------------------------------------------------------------------------------- 1 | def localProperties = new Properties() 2 | def localPropertiesFile = rootProject.file('local.properties') 3 | if (localPropertiesFile.exists()) { 4 | localPropertiesFile.withReader('UTF-8') { reader -> 5 | localProperties.load(reader) 6 | } 7 | } 8 | 9 | def flutterRoot = localProperties.getProperty('flutter.sdk') 10 | if (flutterRoot == null) { 11 | throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") 12 | } 13 | 14 | def flutterVersionCode = localProperties.getProperty('flutter.versionCode') 15 | if (flutterVersionCode == null) { 16 | flutterVersionCode = '1' 17 | } 18 | 19 | def flutterVersionName = localProperties.getProperty('flutter.versionName') 20 | if (flutterVersionName == null) { 21 | flutterVersionName = '1.0' 22 | } 23 | 24 | apply plugin: 'com.android.application' 25 | apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" 26 | 27 | android { 28 | compileSdkVersion 27 29 | 30 | lintOptions { 31 | disable 'InvalidPackage' 32 | } 33 | 34 | defaultConfig { 35 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). 36 | applicationId "com.cloudwebrtc.fluttertouchvgexample" 37 | minSdkVersion 16 38 | targetSdkVersion 27 39 | versionCode flutterVersionCode.toInteger() 40 | versionName flutterVersionName 41 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 42 | } 43 | 44 | buildTypes { 45 | release { 46 | // TODO: Add your own signing config for the release build. 47 | // Signing with the debug keys for now, so `flutter run --release` works. 48 | signingConfig signingConfigs.debug 49 | } 50 | } 51 | } 52 | 53 | flutter { 54 | source '../..' 55 | } 56 | 57 | dependencies { 58 | testImplementation 'junit:junit:4.12' 59 | androidTestImplementation 'com.android.support.test:runner:1.0.2' 60 | androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2' 61 | } 62 | 63 | -------------------------------------------------------------------------------- /example/android/app/src/main/java/com/cloudwebrtc/fluttertouchvgexample/MainActivity.java: -------------------------------------------------------------------------------- 1 | package com.cloudwebrtc.fluttertouchvgexample; 2 | 3 | import android.os.Bundle; 4 | import io.flutter.app.FlutterActivity; 5 | import io.flutter.plugins.GeneratedPluginRegistrant; 6 | 7 | public class MainActivity extends FlutterActivity { 8 | @Override 9 | protected void onCreate(Bundle savedInstanceState) { 10 | super.onCreate(savedInstanceState); 11 | GeneratedPluginRegistrant.registerWith(this); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/drawable/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kangshaojun/flutter_touchvg/ccd4dc2c910e5aa6f9fff230af6de3be7a8da082/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kangshaojun/flutter_touchvg/ccd4dc2c910e5aa6f9fff230af6de3be7a8da082/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kangshaojun/flutter_touchvg/ccd4dc2c910e5aa6f9fff230af6de3be7a8da082/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kangshaojun/flutter_touchvg/ccd4dc2c910e5aa6f9fff230af6de3be7a8da082/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kangshaojun/flutter_touchvg/ccd4dc2c910e5aa6f9fff230af6de3be7a8da082/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | -------------------------------------------------------------------------------- /example/android/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | repositories { 3 | google() 4 | jcenter() 5 | } 6 | 7 | dependencies { 8 | classpath 'com.android.tools.build:gradle:3.2.1' 9 | } 10 | } 11 | 12 | allprojects { 13 | repositories { 14 | google() 15 | jcenter() 16 | } 17 | } 18 | 19 | rootProject.buildDir = '../build' 20 | subprojects { 21 | project.buildDir = "${rootProject.buildDir}/${project.name}" 22 | } 23 | subprojects { 24 | project.evaluationDependsOn(':app') 25 | } 26 | 27 | task clean(type: Delete) { 28 | delete rootProject.buildDir 29 | } 30 | -------------------------------------------------------------------------------- /example/android/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx1536M 2 | -------------------------------------------------------------------------------- /example/android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Fri Jun 23 08:50:38 CEST 2017 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-all.zip 7 | -------------------------------------------------------------------------------- /example/android/settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | 3 | def flutterProjectRoot = rootProject.projectDir.parentFile.toPath() 4 | 5 | def plugins = new Properties() 6 | def pluginsFile = new File(flutterProjectRoot.toFile(), '.flutter-plugins') 7 | if (pluginsFile.exists()) { 8 | pluginsFile.withReader('UTF-8') { reader -> plugins.load(reader) } 9 | } 10 | 11 | plugins.each { name, path -> 12 | def pluginDirectory = flutterProjectRoot.resolve(path).resolve('android').toFile() 13 | include ":$name" 14 | project(":$name").projectDir = pluginDirectory 15 | } 16 | -------------------------------------------------------------------------------- /example/assets/fonts/MaterialCommunityIcons.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kangshaojun/flutter_touchvg/ccd4dc2c910e5aa6f9fff230af6de3be7a8da082/example/assets/fonts/MaterialCommunityIcons.ttf -------------------------------------------------------------------------------- /example/ios/Flutter/AppFrameworkInfo.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | App 9 | CFBundleIdentifier 10 | io.flutter.flutter.app 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | App 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1.0 23 | MinimumOSVersion 24 | 8.0 25 | 26 | 27 | -------------------------------------------------------------------------------- /example/ios/Flutter/Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" 2 | #include "Generated.xcconfig" 3 | -------------------------------------------------------------------------------- /example/ios/Flutter/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" 2 | #include "Generated.xcconfig" 3 | -------------------------------------------------------------------------------- /example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /example/ios/Runner.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /example/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | BuildSystemType 6 | Original 7 | 8 | 9 | -------------------------------------------------------------------------------- /example/ios/Runner/AppDelegate.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | 4 | @interface AppDelegate : FlutterAppDelegate 5 | 6 | @end 7 | -------------------------------------------------------------------------------- /example/ios/Runner/AppDelegate.m: -------------------------------------------------------------------------------- 1 | #include "AppDelegate.h" 2 | #include "GeneratedPluginRegistrant.h" 3 | 4 | @implementation AppDelegate 5 | 6 | - (BOOL)application:(UIApplication *)application 7 | didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 8 | [GeneratedPluginRegistrant registerWithRegistry:self]; 9 | // Override point for customization after application launch. 10 | return [super application:application didFinishLaunchingWithOptions:launchOptions]; 11 | } 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kangshaojun/flutter_touchvg/ccd4dc2c910e5aa6f9fff230af6de3be7a8da082/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kangshaojun/flutter_touchvg/ccd4dc2c910e5aa6f9fff230af6de3be7a8da082/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kangshaojun/flutter_touchvg/ccd4dc2c910e5aa6f9fff230af6de3be7a8da082/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kangshaojun/flutter_touchvg/ccd4dc2c910e5aa6f9fff230af6de3be7a8da082/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kangshaojun/flutter_touchvg/ccd4dc2c910e5aa6f9fff230af6de3be7a8da082/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kangshaojun/flutter_touchvg/ccd4dc2c910e5aa6f9fff230af6de3be7a8da082/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kangshaojun/flutter_touchvg/ccd4dc2c910e5aa6f9fff230af6de3be7a8da082/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kangshaojun/flutter_touchvg/ccd4dc2c910e5aa6f9fff230af6de3be7a8da082/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kangshaojun/flutter_touchvg/ccd4dc2c910e5aa6f9fff230af6de3be7a8da082/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kangshaojun/flutter_touchvg/ccd4dc2c910e5aa6f9fff230af6de3be7a8da082/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kangshaojun/flutter_touchvg/ccd4dc2c910e5aa6f9fff230af6de3be7a8da082/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kangshaojun/flutter_touchvg/ccd4dc2c910e5aa6f9fff230af6de3be7a8da082/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kangshaojun/flutter_touchvg/ccd4dc2c910e5aa6f9fff230af6de3be7a8da082/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kangshaojun/flutter_touchvg/ccd4dc2c910e5aa6f9fff230af6de3be7a8da082/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kangshaojun/flutter_touchvg/ccd4dc2c910e5aa6f9fff230af6de3be7a8da082/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "LaunchImage.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "LaunchImage@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "LaunchImage@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kangshaojun/flutter_touchvg/ccd4dc2c910e5aa6f9fff230af6de3be7a8da082/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kangshaojun/flutter_touchvg/ccd4dc2c910e5aa6f9fff230af6de3be7a8da082/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kangshaojun/flutter_touchvg/ccd4dc2c910e5aa6f9fff230af6de3be7a8da082/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md: -------------------------------------------------------------------------------- 1 | # Launch Screen Assets 2 | 3 | You can customize the launch screen with your own desired assets by replacing the image files in this directory. 4 | 5 | You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images. -------------------------------------------------------------------------------- /example/ios/Runner/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 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 | -------------------------------------------------------------------------------- /example/ios/Runner/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | io.flutter.embedded_views_preview 6 | 7 | CFBundleDevelopmentRegion 8 | en 9 | CFBundleExecutable 10 | $(EXECUTABLE_NAME) 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | flutter_touchvg_example 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | $(FLUTTER_BUILD_NAME) 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | $(FLUTTER_BUILD_NUMBER) 25 | LSRequiresIPhoneOS 26 | 27 | UILaunchStoryboardName 28 | LaunchScreen 29 | UIMainStoryboardFile 30 | Main 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | UISupportedInterfaceOrientations~ipad 38 | 39 | UIInterfaceOrientationPortrait 40 | UIInterfaceOrientationPortraitUpsideDown 41 | UIInterfaceOrientationLandscapeLeft 42 | UIInterfaceOrientationLandscapeRight 43 | 44 | UIViewControllerBasedStatusBarAppearance 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /example/ios/Runner/main.m: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | #import "AppDelegate.h" 4 | 5 | int main(int argc, char* argv[]) { 6 | @autoreleasepool { 7 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /example/test/widget_test.dart: -------------------------------------------------------------------------------- 1 | // This is a basic Flutter widget test. 2 | // 3 | // To perform an interaction with a widget in your test, use the WidgetTester 4 | // utility that Flutter provides. For example, you can send tap and scroll 5 | // gestures. You can also use WidgetTester to find child widgets in the widget 6 | // tree, read text, and verify that the values of widget properties are correct. 7 | 8 | import 'package:flutter/material.dart'; 9 | import 'package:flutter_test/flutter_test.dart'; 10 | 11 | import 'package:flutter_touchvg_example/main.dart'; 12 | 13 | void main() { 14 | testWidgets('Verify Platform version', (WidgetTester tester) async { 15 | // Build our app and trigger a frame. 16 | await tester.pumpWidget(MyApp()); 17 | 18 | // Verify that platform version is retrieved. 19 | expect( 20 | find.byWidgetPredicate( 21 | (Widget widget) => widget is Text && 22 | widget.data.startsWith('Running on:'), 23 | ), 24 | findsOneWidget, 25 | ); 26 | }); 27 | } 28 | -------------------------------------------------------------------------------- /flutter_touchvg.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /ios/.gitignore: -------------------------------------------------------------------------------- 1 | .idea/ 2 | .vagrant/ 3 | .sconsign.dblite 4 | .svn/ 5 | 6 | .DS_Store 7 | *.swp 8 | profile 9 | 10 | DerivedData/ 11 | build/ 12 | GeneratedPluginRegistrant.h 13 | GeneratedPluginRegistrant.m 14 | 15 | .generated/ 16 | 17 | *.pbxuser 18 | *.mode1v3 19 | *.mode2v3 20 | *.perspectivev3 21 | 22 | !default.pbxuser 23 | !default.mode1v3 24 | !default.mode2v3 25 | !default.perspectivev3 26 | 27 | xcuserdata 28 | 29 | *.moved-aside 30 | 31 | *.pyc 32 | *sync/ 33 | Icon? 34 | .tags* 35 | 36 | /Flutter/Generated.xcconfig 37 | -------------------------------------------------------------------------------- /ios/Assets/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kangshaojun/flutter_touchvg/ccd4dc2c910e5aa6f9fff230af6de3be7a8da082/ios/Assets/.gitkeep -------------------------------------------------------------------------------- /ios/Classes/FlutterTouchvg.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | 4 | @interface FlutterTouchvgController : NSObject 5 | 6 | - (instancetype)initWithWithFrame:(CGRect)frame 7 | viewIdentifier:(int64_t)viewId 8 | arguments:(id _Nullable)args 9 | binaryMessenger:(NSObject*)messenger; 10 | 11 | - (UIView*)view; 12 | @end 13 | 14 | @interface FlutterTouchvgFactory : NSObject 15 | - (instancetype)initWithMessenger:(NSObject*)messenger; 16 | @end 17 | 18 | -------------------------------------------------------------------------------- /ios/Classes/FlutterTouchvgPlugin.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | @interface FlutterTouchvgPlugin : NSObject 4 | @end 5 | -------------------------------------------------------------------------------- /ios/Classes/FlutterTouchvgPlugin.m: -------------------------------------------------------------------------------- 1 | #import "FlutterTouchvgPlugin.h" 2 | #import "FlutterTouchvg.h" 3 | 4 | @implementation FlutterTouchvgPlugin 5 | 6 | + (void)registerWithRegistrar:(NSObject*)registrar { 7 | FlutterTouchvgFactory* webviewFactory = 8 | [[FlutterTouchvgFactory alloc] initWithMessenger:registrar.messenger]; 9 | [registrar registerViewFactory:webviewFactory withId:@"flutter_touchvg"]; 10 | } 11 | 12 | @end 13 | -------------------------------------------------------------------------------- /ios/Classes/TouchVG/LICENSE: -------------------------------------------------------------------------------- 1 | BSD License 2 | 3 | For TouchVG framework 4 | 5 | Copyright (c) 2012-2016, Zhang Yungui . All rights reserved. 6 | 7 | Redistribution and use in source and binary forms, with or without modification, 8 | are permitted provided that the following conditions are met: 9 | 10 | * Redistributions of source code must retain the above copyright notice, this 11 | list of conditions and the following disclaimer. 12 | 13 | * Redistributions in binary form must reproduce the above copyright notice, 14 | this list of conditions and the following disclaimer in the documentation 15 | and/or other materials provided with the distribution. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 18 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 19 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 20 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR 21 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 22 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 23 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 24 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 26 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | -------------------------------------------------------------------------------- /ios/Classes/TouchVG/TouchVG.bundle/Info.plist: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kangshaojun/flutter_touchvg/ccd4dc2c910e5aa6f9fff230af6de3be7a8da082/ios/Classes/TouchVG/TouchVG.bundle/Info.plist -------------------------------------------------------------------------------- /ios/Classes/TouchVG/TouchVG.bundle/magnifier-mask@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kangshaojun/flutter_touchvg/ccd4dc2c910e5aa6f9fff230af6de3be7a8da082/ios/Classes/TouchVG/TouchVG.bundle/magnifier-mask@2x.png -------------------------------------------------------------------------------- /ios/Classes/TouchVG/TouchVG.bundle/magnifier@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kangshaojun/flutter_touchvg/ccd4dc2c910e5aa6f9fff230af6de3be7a8da082/ios/Classes/TouchVG/TouchVG.bundle/magnifier@2x.png -------------------------------------------------------------------------------- /ios/Classes/TouchVG/TouchVG.bundle/translucent@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kangshaojun/flutter_touchvg/ccd4dc2c910e5aa6f9fff230af6de3be7a8da082/ios/Classes/TouchVG/TouchVG.bundle/translucent@2x.png -------------------------------------------------------------------------------- /ios/Classes/TouchVG/TouchVG.bundle/vg_addvertex@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kangshaojun/flutter_touchvg/ccd4dc2c910e5aa6f9fff230af6de3be7a8da082/ios/Classes/TouchVG/TouchVG.bundle/vg_addvertex@2x.png -------------------------------------------------------------------------------- /ios/Classes/TouchVG/TouchVG.bundle/vg_back@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kangshaojun/flutter_touchvg/ccd4dc2c910e5aa6f9fff230af6de3be7a8da082/ios/Classes/TouchVG/TouchVG.bundle/vg_back@2x.png -------------------------------------------------------------------------------- /ios/Classes/TouchVG/TouchVG.bundle/vg_clone@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kangshaojun/flutter_touchvg/ccd4dc2c910e5aa6f9fff230af6de3be7a8da082/ios/Classes/TouchVG/TouchVG.bundle/vg_clone@2x.png -------------------------------------------------------------------------------- /ios/Classes/TouchVG/TouchVG.bundle/vg_delete@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kangshaojun/flutter_touchvg/ccd4dc2c910e5aa6f9fff230af6de3be7a8da082/ios/Classes/TouchVG/TouchVG.bundle/vg_delete@2x.png -------------------------------------------------------------------------------- /ios/Classes/TouchVG/TouchVG.bundle/vg_delvertex@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kangshaojun/flutter_touchvg/ccd4dc2c910e5aa6f9fff230af6de3be7a8da082/ios/Classes/TouchVG/TouchVG.bundle/vg_delvertex@2x.png -------------------------------------------------------------------------------- /ios/Classes/TouchVG/TouchVG.bundle/vg_edit@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kangshaojun/flutter_touchvg/ccd4dc2c910e5aa6f9fff230af6de3be7a8da082/ios/Classes/TouchVG/TouchVG.bundle/vg_edit@2x.png -------------------------------------------------------------------------------- /ios/Classes/TouchVG/TouchVG.bundle/vg_endedit@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kangshaojun/flutter_touchvg/ccd4dc2c910e5aa6f9fff230af6de3be7a8da082/ios/Classes/TouchVG/TouchVG.bundle/vg_endedit@2x.png -------------------------------------------------------------------------------- /ios/Classes/TouchVG/TouchVG.bundle/vg_fixlen@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kangshaojun/flutter_touchvg/ccd4dc2c910e5aa6f9fff230af6de3be7a8da082/ios/Classes/TouchVG/TouchVG.bundle/vg_fixlen@2x.png -------------------------------------------------------------------------------- /ios/Classes/TouchVG/TouchVG.bundle/vg_freelen@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kangshaojun/flutter_touchvg/ccd4dc2c910e5aa6f9fff230af6de3be7a8da082/ios/Classes/TouchVG/TouchVG.bundle/vg_freelen@2x.png -------------------------------------------------------------------------------- /ios/Classes/TouchVG/TouchVG.bundle/vg_group@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kangshaojun/flutter_touchvg/ccd4dc2c910e5aa6f9fff230af6de3be7a8da082/ios/Classes/TouchVG/TouchVG.bundle/vg_group@2x.png -------------------------------------------------------------------------------- /ios/Classes/TouchVG/TouchVG.bundle/vg_lock@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kangshaojun/flutter_touchvg/ccd4dc2c910e5aa6f9fff230af6de3be7a8da082/ios/Classes/TouchVG/TouchVG.bundle/vg_lock@2x.png -------------------------------------------------------------------------------- /ios/Classes/TouchVG/TouchVG.bundle/vg_overturn@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kangshaojun/flutter_touchvg/ccd4dc2c910e5aa6f9fff230af6de3be7a8da082/ios/Classes/TouchVG/TouchVG.bundle/vg_overturn@2x.png -------------------------------------------------------------------------------- /ios/Classes/TouchVG/TouchVG.bundle/vg_selall@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kangshaojun/flutter_touchvg/ccd4dc2c910e5aa6f9fff230af6de3be7a8da082/ios/Classes/TouchVG/TouchVG.bundle/vg_selall@2x.png -------------------------------------------------------------------------------- /ios/Classes/TouchVG/TouchVG.bundle/vg_ungroup@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kangshaojun/flutter_touchvg/ccd4dc2c910e5aa6f9fff230af6de3be7a8da082/ios/Classes/TouchVG/TouchVG.bundle/vg_ungroup@2x.png -------------------------------------------------------------------------------- /ios/Classes/TouchVG/TouchVG.bundle/vg_unlock@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kangshaojun/flutter_touchvg/ccd4dc2c910e5aa6f9fff230af6de3be7a8da082/ios/Classes/TouchVG/TouchVG.bundle/vg_unlock@2x.png -------------------------------------------------------------------------------- /ios/Classes/TouchVG/TouchVG.bundle/vgcen@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kangshaojun/flutter_touchvg/ccd4dc2c910e5aa6f9fff230af6de3be7a8da082/ios/Classes/TouchVG/TouchVG.bundle/vgcen@2x.png -------------------------------------------------------------------------------- /ios/Classes/TouchVG/TouchVG.bundle/vgcross@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kangshaojun/flutter_touchvg/ccd4dc2c910e5aa6f9fff230af6de3be7a8da082/ios/Classes/TouchVG/TouchVG.bundle/vgcross@2x.png -------------------------------------------------------------------------------- /ios/Classes/TouchVG/TouchVG.bundle/vgdot1@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kangshaojun/flutter_touchvg/ccd4dc2c910e5aa6f9fff230af6de3be7a8da082/ios/Classes/TouchVG/TouchVG.bundle/vgdot1@2x.png -------------------------------------------------------------------------------- /ios/Classes/TouchVG/TouchVG.bundle/vgdot2@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kangshaojun/flutter_touchvg/ccd4dc2c910e5aa6f9fff230af6de3be7a8da082/ios/Classes/TouchVG/TouchVG.bundle/vgdot2@2x.png -------------------------------------------------------------------------------- /ios/Classes/TouchVG/TouchVG.bundle/vgdot3@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kangshaojun/flutter_touchvg/ccd4dc2c910e5aa6f9fff230af6de3be7a8da082/ios/Classes/TouchVG/TouchVG.bundle/vgdot3@2x.png -------------------------------------------------------------------------------- /ios/Classes/TouchVG/TouchVG.bundle/vgmid@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kangshaojun/flutter_touchvg/ccd4dc2c910e5aa6f9fff230af6de3be7a8da082/ios/Classes/TouchVG/TouchVG.bundle/vgmid@2x.png -------------------------------------------------------------------------------- /ios/Classes/TouchVG/TouchVG.bundle/vgnear@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kangshaojun/flutter_touchvg/ccd4dc2c910e5aa6f9fff230af6de3be7a8da082/ios/Classes/TouchVG/TouchVG.bundle/vgnear@2x.png -------------------------------------------------------------------------------- /ios/Classes/TouchVG/TouchVG.bundle/vgnode@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kangshaojun/flutter_touchvg/ccd4dc2c910e5aa6f9fff230af6de3be7a8da082/ios/Classes/TouchVG/TouchVG.bundle/vgnode@2x.png -------------------------------------------------------------------------------- /ios/Classes/TouchVG/TouchVG.bundle/vgparallel@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kangshaojun/flutter_touchvg/ccd4dc2c910e5aa6f9fff230af6de3be7a8da082/ios/Classes/TouchVG/TouchVG.bundle/vgparallel@2x.png -------------------------------------------------------------------------------- /ios/Classes/TouchVG/TouchVG.bundle/vgpivot@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kangshaojun/flutter_touchvg/ccd4dc2c910e5aa6f9fff230af6de3be7a8da082/ios/Classes/TouchVG/TouchVG.bundle/vgpivot@2x.png -------------------------------------------------------------------------------- /ios/Classes/TouchVG/TouchVG.bundle/vgquad@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kangshaojun/flutter_touchvg/ccd4dc2c910e5aa6f9fff230af6de3be7a8da082/ios/Classes/TouchVG/TouchVG.bundle/vgquad@2x.png -------------------------------------------------------------------------------- /ios/Classes/TouchVG/TouchVG.bundle/vgtangent@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kangshaojun/flutter_touchvg/ccd4dc2c910e5aa6f9fff230af6de3be7a8da082/ios/Classes/TouchVG/TouchVG.bundle/vgtangent@2x.png -------------------------------------------------------------------------------- /ios/Classes/TouchVG/TouchVG.bundle/zh-Hans.lproj/Localizable.strings: -------------------------------------------------------------------------------- 1 | /* 2 | Localizable.strings for TouchVG 3 | */ 4 | 5 | "shape_too_small" = "图形太小,请重新绘制"; 6 | "shape1_deleted" = "已删除一个图形"; 7 | "shape_n_deleted" = "已删除 %d 个图形"; 8 | "invalid_gridcell" = "单元格太小或太大"; 9 | "undo_ok" = "已撤销"; 10 | "redo_ok" = "已恢复"; 11 | "nodept" = "顶点"; 12 | "centerpt" = "圆心"; 13 | "midpt" = "中点"; 14 | "quadpt" = "象限点"; 15 | "crosspt" = "交点"; 16 | "parallelpt" = "平行"; 17 | "nearpt" = "线上点"; 18 | "perppt" = "垂足"; 19 | "tanpt" = "切点"; 20 | "degrees" = "°"; 21 | 22 | "settings" = "设置"; 23 | "snap_enabled" = "允许吸附"; 24 | "snap_vertex" = "吸附到顶点"; 25 | "snap_center" = "吸附到圆心"; 26 | "snap_midpoint" = "吸附到中点"; 27 | "snap_quadrant" = "吸附到象限点"; 28 | "snap_perp" = "吸附到垂线"; 29 | "snap_parallel" = "吸附到平行线"; 30 | "snap_cross" = "吸附到交点"; 31 | "snap_tangent" = "吸附到切点"; 32 | "snap_edge" = "吸附到边"; 33 | "snap_extend" = "吸附到延长线上"; 34 | "snap_pt_tol" = "点吸附距离"; 35 | "snap_edge_tol" = "边吸附距离"; 36 | "snap_toltip" = "1~100 mm"; 37 | "context_actions" = "上下文按钮"; 38 | "zoom_enabled" = "允许放缩"; 39 | "zoom_shape_enabled" = "允许双指缩放图形"; 40 | "show_magnifier" = "显示放大镜"; 41 | "start_must_vertex" = "起点必须吸到顶点"; 42 | "rotate_handle_enabled" = "允许绕顶点旋转"; 43 | "move_handle_enabled" = "允许移动顶点"; 44 | "move_shape_enabled" = "允许移动图形"; 45 | "boxsel_enabled" = "允许框选"; 46 | "degree_decimal" = "度数小数位"; 47 | "dist_decimal" = "长度小数位"; 48 | "snap_round_cell" = "坐标小数位"; 49 | -------------------------------------------------------------------------------- /ios/Classes/TouchVG/include/ARCMacro.h: -------------------------------------------------------------------------------- 1 | /* 2 | * ARCMacro.h 1.1 2012/05/29 https://gist.github.com/2823399 3 | * 4 | * ARCMacro.h realizes coexistence of both the ARC (Automatic 5 | * Reference Counting) mode and the Non-ARC mode of Objective-C 6 | * in the same source code. This macro works for iOS and Mac OS X. 7 | * 8 | * This is a by-product of joint research by AIST and The University of Ryukyu. 9 | * HIRANO Satoshi (AIST), NAKAMURA Morikazu (U. Ryukyu) and GUAN Senlin (U. Ryukyu) 10 | * 11 | * Author: HIRANO Satoshi (AIST, Japan) on 2011/11/14 12 | * Copyright 2011-2012 National Institute of Advanced Industrial Science 13 | * and Technology (AIST), Japan. Apache License 2.0. 14 | * 15 | * Usage: 16 | * #import "ARCMacro.h" 17 | * [o1 RETAIN]; 18 | * o2 = [[o3 RETAIN] AUTORELEASE]; 19 | * [super DEALLOC]; 20 | */ 21 | 22 | #ifndef RELEASEOBJ 23 | #if __has_feature(objc_arc) 24 | #define RETAIN self 25 | #define AUTORELEASE self 26 | #define RELEASEOBJ self 27 | #define DEALLOC self 28 | #define WEAK weak 29 | #define STRONG strong 30 | #else 31 | #define RETAIN retain 32 | #define AUTORELEASE autorelease 33 | #define RELEASEOBJ release 34 | #define DEALLOC dealloc 35 | #define WEAK assign 36 | #define STRONG retain 37 | #endif 38 | #endif 39 | -------------------------------------------------------------------------------- /ios/Classes/TouchVG/include/GiPaintViewDelegate.h: -------------------------------------------------------------------------------- 1 | //! \file GiPaintViewDelegate.h 2 | //! \brief 定义绘图消息的观察者协议 GiPaintViewDelegate 3 | // Copyright (c) 2014, https://github.com/rhcad/touchvg 4 | 5 | #import 6 | 7 | //! 绘图消息的观察者协议 8 | /*! 也可以在 GiPaintView 派生类直接实现这些通知函数。 9 | \ingroup GROUP_IOS 10 | \see GiPaintView, GiViewHelper 11 | */ 12 | @protocol GiPaintViewDelegate 13 | @optional 14 | 15 | - (void)onCommandChanged:(id)view; //!< 当前命令改变的通知 16 | - (void)onSelectionChanged:(id)view; //!< 图形选择集改变的通知 17 | - (void)onContentChanged:(id)view; //!< 图形数据改变的通知 18 | - (void)onDynamicChanged:(id)view; //!< 图形动态改变的通知 19 | - (void)onResizeFrame:(id)view; //!< 视图大小改变(setFrame:)的通知 20 | - (void)onZoomChanged:(id)view; //!< 视图放缩的通知 21 | - (void)onFirstRegen:(id)view; //!< 第一次后台渲染结束的通知 22 | - (void)onDynDrawEnded:(id)view; //!< 动态绘图完成的通知 23 | - (void)onShapesRecorded:(NSDictionary *)info; //!< 录制的通知 24 | - (void)onShapeWillDelete:(id)num; //!< 图形将删除的通知, [NSNumber intValue] 25 | - (void)onShapeDeleted:(id)num; //!< 图形已删除的通知, [NSNumber intValue] 26 | - (BOOL)onShapeDblClick:(NSDictionary *)info; //!< 图形双击编辑的通知 27 | - (BOOL)onShapeClicked:(NSDictionary *)info; //!< 图形点击的通知 28 | 29 | - (BOOL)onGestureShouldBegin:(UIGestureRecognizer *)g; //!< 手势生效前的判断 30 | - (void)onGestureBegan:(UIGestureRecognizer *)g; //!< 手势开始的通知 31 | - (void)onGestureEnded:(UIGestureRecognizer *)g; //!< 手势结束的通知 32 | 33 | @end 34 | -------------------------------------------------------------------------------- /ios/Classes/TouchVG/include/GiViewEnums.h: -------------------------------------------------------------------------------- 1 | //! \file GiViewEnums.h 2 | //! \brief 定义iOS绘图视图的枚举值 3 | // Copyright (c) 2012-2015, https://github.com/rhcad/vgios, BSD License 4 | 5 | #ifndef __TOUCHVG_VIEWENUMS_H 6 | #define __TOUCHVG_VIEWENUMS_H 7 | 8 | typedef NS_ENUM(int, GILineStyle) { //!< 线型 9 | GILineStyleSolid, //!< ---------- 10 | GILineStyleDash, //!< - - - - 11 | GILineStyleDot, //!< .......... 12 | GILineStyleDashDot, //!< _._._._._ 13 | GILineStyleDashDotdot, //!< _.._.._.._ 14 | GILineStyleNull //!< Not draw. 15 | }; 16 | 17 | typedef NS_ENUM(int, GIArrowHead) { //!< 线端箭头 18 | GIArrowHeadNone = 0, //!< 无箭头 19 | GIArrowHeadSharpClosed, //!< 实心尖头 20 | GIArrowHeadSharpLine, //!< 简单线条尖头 21 | GIArrowHeadTLine, //!< T型箭头 22 | GIArrowHeadSlashLine, //!< 斜线箭头 23 | GIArrowHeadClosedCircle, //!< 实心圆头 24 | GIArrowHeadOpenedCircle //!< 空心圆头 25 | }; 26 | 27 | typedef NS_ENUM(int, GIViewFlags) { //!< 视图创建标志 28 | GIViewFlagsNoBackLayer = 1, //!< 不使用分层异步渲染 29 | GIViewFlagsNoDynDrawView = 2, //!< 不使用双视图显示 30 | GIViewFlagsNotDynDraw = 4, //!< 屏蔽动态显示 31 | GIViewFlagsZoomExtent = 8, //!< 自动放缩到图形范围 32 | GIViewFlagsNoCmd = 16, //!< 不使用交互命令 33 | GIViewFlagsMagnifier = 32, //!< 显示跟随放大镜 34 | GIViewFlagsDummyView = (GIViewFlagsNoBackLayer|GIViewFlagsNoDynDrawView 35 | |GIViewFlagsZoomExtent|GIViewFlagsNoCmd) 36 | }; 37 | 38 | #endif // __TOUCHVG_VIEWENUMS_H 39 | -------------------------------------------------------------------------------- /ios/Classes/TouchVG/include/GiViewHelper+Layer.h: -------------------------------------------------------------------------------- 1 | //! \file GiViewHelper+Layer.h 2 | //! \brief 定义iOS绘图视图辅助类 GiViewHelper 的图层转换器部分 3 | // Copyright (c) 2013-2015, https://github.com/rhcad/vgios, BSD License 4 | 5 | #import "GiViewHelper.h" 6 | 7 | /*! \category GiViewHelper(Layer) 8 | \brief GiViewHelper 的图层转换器部分 9 | */ 10 | @interface GiViewHelper(Layer) 11 | 12 | //! 将静态图形转换到三级层,第二级为每个图形的层,其下有CAShapeLayer,返回顶级层 13 | - (CALayer *)exportLayerTree:(BOOL)hidden; 14 | 15 | //! 将静态图形转换到二级层,第二级为每个路径的CAShapeLayer,不按图形分组 16 | - (CALayer *)exportLayers; 17 | 18 | //! 将指定句柄(MgShape)的图形转换到二级层,第二级为多个CAShapeLayer 19 | - (CALayer *)exportLayersForShape:(long)handle; 20 | 21 | //! 得到指定句柄(MgShape)的图形的所有路径对象(UIBezierPath) 22 | - (NSArray *)exportPathsForShape:(long)handle; 23 | 24 | @end 25 | -------------------------------------------------------------------------------- /ios/Classes/TouchVG/include/NSString+Drawing.h: -------------------------------------------------------------------------------- 1 | // NSString+Drawing.h 2 | // Copyright (c) 2012-2015, https://github.com/rhcad/vgios, BSD License 3 | 4 | #import 5 | #include 6 | 7 | #ifdef __cplusplus 8 | extern "C" { 9 | #endif 10 | 11 | CGSize sizeWithAttributes6(NSString *str, NSDictionary *attrs); 12 | void drawAtPoint6(NSString *str, CGPoint point, NSDictionary *attrs); 13 | void drawInRect6(NSString *str, CGRect rect, NSDictionary *attrs); 14 | CGRect boundingRectWithSize6(NSString *str, CGSize size, NSStringDrawingOptions options, 15 | NSDictionary *attrs, NSStringDrawingContext *context); 16 | 17 | NSString *giRoundString(CGFloat num); 18 | 19 | #ifdef __cplusplus 20 | } 21 | #endif 22 | -------------------------------------------------------------------------------- /ios/Classes/TouchVG/src/GiDpiUtil.mm: -------------------------------------------------------------------------------- 1 | // GiDpiUtil.cpp 2 | // Copyright (c) 2012-2015, https://github.com/rhcad/vgios, BSD License 3 | 4 | #import 5 | #include 6 | 7 | int giGetScreenDpi() 8 | { 9 | static int dpi = 0; 10 | 11 | if (dpi == 0) { 12 | size_t size = 15; 13 | char machine[15 + 1] = ""; 14 | 15 | sysctlbyname("hw.machine", machine, &size, NULL, 0); 16 | 17 | if (strcmp(machine, "i386") == 0) { // Simulator 18 | dpi = 72; 19 | } else { // Identifier: http://theiphonewiki.com/wiki/Models 20 | bool iPadMini = (strcmp(machine, "iPad2,5") == 0 || 21 | strcmp(machine, "iPad2,6") == 0 || 22 | strcmp(machine, "iPad2,7") == 0 || 23 | strcmp(machine, "iPad4,4") == 0 || 24 | strcmp(machine, "iPad4,5") == 0); 25 | BOOL iPad = (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad); 26 | 27 | dpi = (iPad && !iPadMini) ? 132 : 163; 28 | } 29 | } 30 | 31 | return dpi; 32 | } 33 | -------------------------------------------------------------------------------- /ios/Classes/TouchVG/src/GiImageCache.h: -------------------------------------------------------------------------------- 1 | //! \file GiImageCache.h 2 | //! \brief 定义图像对象缓存类 GiImageCache 3 | // Copyright (c) 2012-2015, https://github.com/rhcad/vgios, BSD License 4 | 5 | #import 6 | #include "ARCMacro.h" 7 | 8 | //! 图像对象缓存类 9 | @interface GiImageCache : NSObject { 10 | NSMutableDictionary *_images; 11 | NSMutableDictionary *_spirits; 12 | } 13 | 14 | @property (nonatomic, STRONG) NSString *imagePath; //!< 图像文件的默认路径(可以没有末尾的分隔符) 15 | @property (nonatomic, STRONG) NSString *playPath; //!< 播放路径 16 | 17 | - (void)clearCachedData; //!< 释放临时数据内存 18 | + (UIImage *)getImageFromSVGFile:(NSString *)filename maxSize:(CGSize)size; //!< 得到SVG文件的图像 19 | 20 | - (UIImage *)loadImage:(NSString *)name; //!< 根据名称查找或加载图像对象 21 | - (CGSize)getImageSize:(NSString *)name; //!< 根据名称查找图像大小 22 | - (CGSize)addPNGFromResource:(NSString *)name :(NSString **)key; //!< 插入一个程序资源中的图片(name.png) 23 | - (CGSize)addSVGFromResource:(NSString *)name :(NSString **)key; //!< 插入一个程序资源中的图片(name.svg) 24 | 25 | - (CGSize)addImageFromPath:(NSString *)path :(NSString**)name; //!< 在默认位置插入一个图像文件 26 | - (CGSize)addImageFromFile:(NSString *)filename :(NSString **)name; //!< 在默认位置插入一个图像文件 27 | 28 | //! Convert tag$png:prefix%d.png to png:prefixnum.png 29 | - (void)setCurrentImage:(NSString *)spiritName newName:(NSString *)name; 30 | 31 | @end 32 | -------------------------------------------------------------------------------- /ios/Classes/TouchVG/src/GiMagnifierView.h: -------------------------------------------------------------------------------- 1 | // GiMagnifierView.h 2 | // Copyright (c) 2012-2015, https://github.com/rhcad/vgios, BSD License 3 | 4 | 5 | #import 6 | #include "ARCMacro.h" 7 | 8 | //! 放大镜图形视图类 9 | @interface GiMagnifierView : UIView { 10 | CGFloat _topMargin; 11 | } 12 | 13 | @property (nonatomic, WEAK) UIView *viewToMagnify; 14 | @property (nonatomic) CGPoint touchPoint; 15 | @property (nonatomic) BOOL followFinger; 16 | @property (nonatomic) CGFloat scale; 17 | 18 | - (void)show; 19 | - (void)hide; 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /ios/Classes/TouchVGCore/LICENSE: -------------------------------------------------------------------------------- 1 | BSD License 2 | 3 | For TouchVGCore framework 4 | 5 | Copyright (c) 2004-2016, Zhang Yungui . All rights reserved. 6 | 7 | Redistribution and use in source and binary forms, with or without modification, 8 | are permitted provided that the following conditions are met: 9 | 10 | * Redistributions of source code must retain the above copyright notice, this 11 | list of conditions and the following disclaimer. 12 | 13 | * Redistributions in binary form must reproduce the above copyright notice, 14 | this list of conditions and the following disclaimer in the documentation 15 | and/or other materials provided with the distribution. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 18 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 19 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 20 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR 21 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 22 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 23 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 24 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 26 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | -------------------------------------------------------------------------------- /ios/Classes/TouchVGCore/core/include/cmd/mgaction.h: -------------------------------------------------------------------------------- 1 | //! \file mgaction.h 2 | //! \brief 定义上下文动作接口 MgActionDispatcher 3 | // Copyright (c) 2004-2015, https://github.com/rhcad/vgcore, BSD License 4 | 5 | #ifndef TOUCHVG_MGACTION_H_ 6 | #define TOUCHVG_MGACTION_H_ 7 | 8 | //! 默认上下文动作 9 | /*! \ingroup CORE_COMMAND 10 | */ 11 | typedef enum { 12 | kMgActionInvalid = 0, 13 | kMgActionSelAll = 1, //!< 全选 14 | kMgActionSelReset = 2, //!< 重选 15 | kMgActionDraw = 3, //!< 绘图 16 | kMgActionCancel = 4, //!< 取消 17 | kMgActionDelete = 5, //!< 删除 18 | kMgActionClone = 6, //!< 克隆 19 | kMgActionFixedLength = 7, //!< 定长 20 | kMgActionFreeLength = 8, //!< 不定长 21 | kMgActionLocked = 9, //!< 锁定 22 | kMgActionUnlocked = 10, //!< 解锁 23 | kMgActionEditVertex = 11, //!< 编辑顶点 24 | kMgActionHideVertex = 12, //!< 隐藏顶点 25 | kMgActionClosed = 13, //!< 闭合 26 | kMgActionOpened = 14, //!< 不闭合 27 | kMgActionAddVertex = 15, //!< 加点 28 | kMgActionDelVertex = 16, //!< 删点 29 | kMgActionGroup = 17, //!< 成组 30 | kMgActionUngroup = 18, //!< 解组 31 | kMgActionOverturn = 19, //!< 翻转 32 | kMgActionCustomized = 100 //!< 定制的起始值 33 | } MgContextAction; 34 | 35 | class MgMotion; 36 | class MgShape; 37 | class Box2d; 38 | 39 | //! 上下文动作分发接口 40 | /*! \ingroup CORE_COMMAND 41 | \interface MgActionDispatcher 42 | \see MgCmdManager, MgContextAction 43 | */ 44 | struct MgActionDispatcher { 45 | virtual ~MgActionDispatcher() {} 46 | virtual bool showInSelect(const MgMotion* sender, int selState, const MgShape* shape, const Box2d& selbox) = 0; 47 | virtual bool showInDrawing(const MgMotion* sender, const MgShape* shape) = 0; 48 | virtual bool doAction(const MgMotion* sender, int action) = 0; 49 | }; 50 | 51 | #endif // TOUCHVG_MGACTION_H_ 52 | -------------------------------------------------------------------------------- /ios/Classes/TouchVGCore/core/include/cmd/mglocal.h: -------------------------------------------------------------------------------- 1 | //! \file mglocal.h 2 | //! \brief 定义本地化文字的辅助类 MgLocalized 3 | // Copyright (c) 2004-2015, https://github.com/rhcad/vgcore, BSD License 4 | 5 | #ifndef TOUCHVG_CORE_LOCALSTR_H 6 | #define TOUCHVG_CORE_LOCALSTR_H 7 | 8 | #include 9 | 10 | struct MgView; 11 | 12 | //! 本地化文字的辅助类 13 | struct MgLocalized { 14 | static std::string getString(MgView* view, const char* name); 15 | static int formatString(char *buffer, int size, MgView* view, const char *format, ...); 16 | }; 17 | 18 | #endif // TOUCHVG_CORE_LOCALSTR_H 19 | -------------------------------------------------------------------------------- /ios/Classes/TouchVGCore/core/include/cmdbase/mgdrawrect.h: -------------------------------------------------------------------------------- 1 | //! \file mgdrawrect.h 2 | //! \brief 定义矩形绘图命令类 MgCmdDrawRect 3 | // Copyright (c) 2004-2015, https://github.com/rhcad/vgcore, BSD License 4 | 5 | #ifndef TOUCHVG_CMD_DRAW_RECT_H_ 6 | #define TOUCHVG_CMD_DRAW_RECT_H_ 7 | 8 | #include "mgcmddraw.h" 9 | 10 | //! 矩形绘图命令类 11 | /*! \ingroup CORE_COMMAND 12 | \see MgRect 13 | */ 14 | class MgCmdDrawRect : public MgCommandDraw 15 | { 16 | public: 17 | MgCmdDrawRect(const char* name = Name()) : MgCommandDraw(name) {} 18 | #ifndef SWIG 19 | static const char* Name() { return "rect"; } 20 | static MgCommand* Create() { return new MgCmdDrawRect; } 21 | #endif 22 | virtual void release() { delete this; } 23 | virtual bool initialize(const MgMotion* sender, MgStorage* s); 24 | virtual bool backStep(const MgMotion* sender); 25 | virtual bool touchBegan(const MgMotion* sender); 26 | virtual bool touchMoved(const MgMotion* sender); 27 | virtual bool touchEnded(const MgMotion* sender); 28 | 29 | protected: 30 | virtual void addRectShape(const MgMotion* sender); 31 | 32 | protected: 33 | Point2d m_startPt; 34 | }; 35 | 36 | #endif // TOUCHVG_CMD_DRAW_RECT_H_ 37 | -------------------------------------------------------------------------------- /ios/Classes/TouchVGCore/core/include/cmdbasic/cmdbasic.h: -------------------------------------------------------------------------------- 1 | //! \file cmdbasic.h 2 | //! \brief 定义基本绘图命令工厂类 MgBasicCommands 3 | // Copyright (c) 2004-2015, https://github.com/rhcad/vgcore, BSD License 4 | 5 | #ifndef TOUCHVG_BASIC_CMDS_H_ 6 | #define TOUCHVG_BASIC_CMDS_H_ 7 | 8 | struct MgView; 9 | 10 | //! 基本绘图命令工厂类 11 | /*! \ingroup CORE_COMMAND 12 | */ 13 | class MgBasicCommands 14 | { 15 | public: 16 | //! 登记绘图命令 17 | static void registerCmds(MgView* view); 18 | }; 19 | 20 | #endif // TOUCHVG_BASIC_CMDS_H_ 21 | -------------------------------------------------------------------------------- /ios/Classes/TouchVGCore/core/include/cmdbasic/mgdrawcircle.h: -------------------------------------------------------------------------------- 1 | //! \file mgdrawcircle.h 2 | //! \brief 定义圆绘图命令类 MgCmdDrawCircle 3 | // Copyright (c) 2004-2015, https://github.com/rhcad/vgcore, BSD License 4 | 5 | #ifndef TOUCHVG_CMD_DRAW_CIRCLE_H_ 6 | #define TOUCHVG_CMD_DRAW_CIRCLE_H_ 7 | 8 | #include "mgdrawellipse.h" 9 | 10 | //! 圆绘图命令类 11 | /*! \ingroup CORE_COMMAND 12 | \see MgEllipse 13 | */ 14 | class MgCmdDrawCircle : public MgCmdDrawEllipse 15 | { 16 | public: 17 | MgCmdDrawCircle(const char* name = Name()) : MgCmdDrawEllipse(name) {} 18 | #ifndef SWIG 19 | static const char* Name() { return "circle2p"; } 20 | static MgCommand* Create() { return new MgCmdDrawCircle(); } 21 | #endif 22 | virtual void release() { delete this; } 23 | virtual bool initialize(const MgMotion* sender, MgStorage* s); 24 | }; 25 | 26 | //! 三点画圆命令类 27 | /*! \ingroup CORE_COMMAND 28 | \see MgEllipse 29 | */ 30 | class MgCmdDrawCircle3P : public MgCommandDraw 31 | { 32 | public: 33 | MgCmdDrawCircle3P(const char* name = Name()) : MgCommandDraw(name) {} 34 | #ifndef SWIG 35 | static const char* Name() { return "circle3p"; } 36 | static MgCommand* Create() { return new MgCmdDrawCircle3P; } 37 | #endif 38 | virtual void release() { delete this; } 39 | virtual bool touchBegan(const MgMotion* sender) { return touchBeganStep(sender); } 40 | virtual bool touchMoved(const MgMotion* sender) { return touchMovedStep(sender); } 41 | virtual bool touchEnded(const MgMotion* sender) { return touchEndedStep(sender); } 42 | virtual bool initialize(const MgMotion* sender, MgStorage* s); 43 | virtual bool draw(const MgMotion* sender, GiGraphics* gs); 44 | 45 | protected: 46 | virtual void setStepPoint(const MgMotion* sender, int step, const Point2d& pt); 47 | virtual void drawHandles(const MgMotion* sender, GiGraphics* gs); 48 | 49 | protected: 50 | Point2d _points[3]; 51 | }; 52 | 53 | #endif // TOUCHVG_CMD_DRAW_CIRCLE_H_ 54 | -------------------------------------------------------------------------------- /ios/Classes/TouchVGCore/core/include/cmdbasic/mgdrawdiamond.h: -------------------------------------------------------------------------------- 1 | //! \file mgdrawdiamond.h 2 | //! \brief 定义菱形绘图命令类 MgCmdDrawDiamond 3 | // Copyright (c) 2004-2015, https://github.com/rhcad/vgcore, BSD License 4 | 5 | #ifndef TOUCHVG_CMD_DRAW_DIAMOND_H_ 6 | #define TOUCHVG_CMD_DRAW_DIAMOND_H_ 7 | 8 | #include "mgdrawellipse.h" 9 | 10 | //! 菱形绘图命令类 11 | /*! \ingroup CORE_COMMAND 12 | \see MgDiamond 13 | */ 14 | class MgCmdDrawDiamond : public MgCmdDrawEllipse 15 | { 16 | public: 17 | static const char* Name() { return "diamond"; } 18 | static MgCommand* Create() { return new MgCmdDrawDiamond; } 19 | 20 | private: 21 | MgCmdDrawDiamond() : MgCmdDrawEllipse(Name()) {} 22 | virtual void release() { delete this; } 23 | virtual bool initialize(const MgMotion* sender, MgStorage* s); 24 | }; 25 | 26 | #endif // TOUCHVG_CMD_DRAW_DIAMOND_H_ 27 | -------------------------------------------------------------------------------- /ios/Classes/TouchVGCore/core/include/cmdbasic/mgdrawellipse.h: -------------------------------------------------------------------------------- 1 | //! \file mgdrawellipse.h 2 | //! \brief 定义椭圆绘图命令类 MgCmdDrawEllipse 3 | // Copyright (c) 2004-2015, https://github.com/rhcad/vgcore, BSD License 4 | 5 | #ifndef TOUCHVG_CMD_DRAW_ELLIPSE_H_ 6 | #define TOUCHVG_CMD_DRAW_ELLIPSE_H_ 7 | 8 | #include "mgdrawrect.h" 9 | 10 | //! 椭圆绘图命令类 11 | /*! \ingroup CORE_COMMAND 12 | \see MgEllipse 13 | */ 14 | class MgCmdDrawEllipse : public MgCmdDrawRect 15 | { 16 | public: 17 | MgCmdDrawEllipse(const char* name = Name()) : MgCmdDrawRect(name) {} 18 | #ifndef SWIG 19 | static const char* Name() { return "ellipse"; } 20 | static MgCommand* Create() { return new MgCmdDrawEllipse; } 21 | #endif 22 | virtual void release() { delete this; } 23 | virtual bool initialize(const MgMotion* sender, MgStorage* s); 24 | virtual bool draw(const MgMotion* sender, GiGraphics* gs); 25 | }; 26 | 27 | #endif // TOUCHVG_CMD_DRAW_ELLIPSE_H_ 28 | -------------------------------------------------------------------------------- /ios/Classes/TouchVGCore/core/include/cmdbasic/mgdrawfreelines.h: -------------------------------------------------------------------------------- 1 | //! \file mgdrawfreelines.h 2 | //! \brief 定义自由折线绘图命令类 MgCmdDrawFreeLines 3 | // Copyright (c) 2004-2015, https://github.com/rhcad/vgcore, BSD License 4 | 5 | #ifndef TOUCHVG_CMD_DRAW_FREELINES_H_ 6 | #define TOUCHVG_CMD_DRAW_FREELINES_H_ 7 | 8 | #include "mgcmddraw.h" 9 | 10 | //! 自由折线绘图命令类 11 | /*! \ingroup CORE_COMMAND 12 | \see MgLines 13 | */ 14 | class MgCmdDrawFreeLines : public MgCommandDraw 15 | { 16 | public: 17 | static const char* Name() { return "freelines"; } 18 | static MgCommand* Create() { return new MgCmdDrawFreeLines; } 19 | 20 | private: 21 | MgCmdDrawFreeLines() : MgCommandDraw(Name()) {} 22 | virtual void release() { delete this; } 23 | 24 | virtual bool initialize(const MgMotion* sender, MgStorage* s); 25 | virtual bool backStep(const MgMotion* sender); 26 | virtual bool draw(const MgMotion* sender, GiGraphics* gs); 27 | virtual bool touchBegan(const MgMotion* sender); 28 | virtual bool touchMoved(const MgMotion* sender); 29 | virtual bool touchEnded(const MgMotion* sender); 30 | 31 | private: 32 | bool canAddPoint(const MgMotion* sender, bool ended); 33 | }; 34 | 35 | #endif // TOUCHVG_CMD_DRAW_FREELINES_H_ 36 | -------------------------------------------------------------------------------- /ios/Classes/TouchVGCore/core/include/cmdbasic/mgdrawgrid.h: -------------------------------------------------------------------------------- 1 | //! \file mgdrawgrid.h 2 | //! \brief 定义网格绘图命令类 MgCmdDrawGrid 3 | // Copyright (c) 2004-2015, https://github.com/rhcad/vgcore, BSD License 4 | 5 | #ifndef TOUCHVG_CMD_DRAW_GRID_H_ 6 | #define TOUCHVG_CMD_DRAW_GRID_H_ 7 | 8 | #include "mgdrawrect.h" 9 | 10 | //! 网格绘图命令类 11 | /*! \ingroup CORE_COMMAND 12 | \see MgGrid 13 | */ 14 | class MgCmdDrawGrid : public MgCmdDrawRect 15 | { 16 | public: 17 | static const char* Name() { return "grid"; } 18 | static MgCommand* Create() { return new MgCmdDrawGrid; } 19 | 20 | private: 21 | MgCmdDrawGrid() : MgCmdDrawRect(Name()) {} 22 | virtual void release() { delete this; } 23 | virtual bool initialize(const MgMotion* sender, MgStorage* s); 24 | virtual bool draw(const MgMotion* sender, GiGraphics* gs); 25 | virtual bool touchBegan(const MgMotion* sender); 26 | virtual bool touchMoved(const MgMotion* sender); 27 | virtual bool touchEnded(const MgMotion* sender); 28 | 29 | virtual void addRectShape(const MgMotion* sender); 30 | }; 31 | 32 | #endif // TOUCHVG_CMD_DRAW_GRID_H_ 33 | -------------------------------------------------------------------------------- /ios/Classes/TouchVGCore/core/include/cmdbasic/mgdrawlines.h: -------------------------------------------------------------------------------- 1 | //! \file mgdrawlines.h 2 | //! \brief 定义折线绘图命令类 MgCmdDrawLines 3 | // Copyright (c) 2004-2015, https://github.com/rhcad/vgcore, BSD License 4 | 5 | #ifndef TOUCHVG_CMD_DRAW_LINES_H_ 6 | #define TOUCHVG_CMD_DRAW_LINES_H_ 7 | 8 | #include "mgcmddraw.h" 9 | 10 | //! 折线绘图命令类 11 | /*! \ingroup CORE_COMMAND 12 | \see MgLines 13 | */ 14 | class MgCmdDrawLines : public MgCommandDraw 15 | { 16 | protected: 17 | MgCmdDrawLines(const char* name = Name()) : MgCommandDraw(name) {} 18 | virtual ~MgCmdDrawLines() {} 19 | 20 | public: 21 | static const char* Name() { return "lines"; } 22 | static MgCommand* Create() { return new MgCmdDrawLines; } 23 | 24 | private: 25 | virtual bool needCheckClosed() { return true; } 26 | virtual bool needEnded() { return false; } 27 | 28 | virtual void release() { delete this; } 29 | virtual bool initialize(const MgMotion* sender, MgStorage* s); 30 | virtual bool backStep(const MgMotion* sender); 31 | virtual bool draw(const MgMotion* sender, GiGraphics* gs); 32 | virtual bool touchBegan(const MgMotion* sender); 33 | virtual bool touchMoved(const MgMotion* sender); 34 | virtual bool touchEnded(const MgMotion* sender); 35 | virtual bool click(const MgMotion* sender); 36 | virtual bool doubleClick(const MgMotion* sender); 37 | virtual bool cancel(const MgMotion* sender); 38 | 39 | private: 40 | bool checkClosed(const MgMotion* sender, const Point2d& pnt); 41 | bool canAddPoint(const MgMotion* sender, const Point2d& pnt); 42 | 43 | private: 44 | int m_index; 45 | }; 46 | 47 | #endif // TOUCHVG_CMD_DRAW_LINES_H_ 48 | -------------------------------------------------------------------------------- /ios/Classes/TouchVGCore/core/include/cmdbasic/mgdrawparallel.h: -------------------------------------------------------------------------------- 1 | //! \file mgdrawparallel.h 2 | //! \brief 定义平行四边形绘图命令类 MgCmdParallel 3 | // Copyright (c) 2004-2015, https://github.com/rhcad/vgcore, BSD License 4 | 5 | #ifndef TOUCHVG_CMD_DRAW_PARALLEL_H_ 6 | #define TOUCHVG_CMD_DRAW_PARALLEL_H_ 7 | 8 | #include "mgcmddraw.h" 9 | 10 | //! 平行四边形绘图命令类 11 | /*! \ingroup CORE_COMMAND 12 | \see MgParallel 13 | */ 14 | class MgCmdParallel : public MgCommandDraw 15 | { 16 | public: 17 | static const char* Name() { return "parallel"; } 18 | static MgCommand* Create() { return new MgCmdParallel; } 19 | private: 20 | MgCmdParallel() : MgCommandDraw(Name()) {} 21 | virtual void release() { delete this; } 22 | virtual bool initialize(const MgMotion* sender, MgStorage* s); 23 | virtual bool touchBegan(const MgMotion* sender) { return touchBeganStep(sender); } 24 | virtual bool touchMoved(const MgMotion* sender) { return touchMovedStep(sender); } 25 | virtual bool touchEnded(const MgMotion* sender) { return touchEndedStep(sender); } 26 | }; 27 | 28 | #endif // TOUCHVG_CMD_DRAW_PARALLEL_H_ 29 | -------------------------------------------------------------------------------- /ios/Classes/TouchVGCore/core/include/cmdbasic/mgdrawpolygon.h: -------------------------------------------------------------------------------- 1 | //! \file mgdrawpolygon.h 2 | //! \brief 定义多边形绘图命令类 MgCmdDrawPolygon 3 | // Copyright (c) 2004-2015, https://github.com/rhcad/vgcore, BSD License 4 | 5 | #ifndef TOUCHVG_CMD_DRAW_POLYGON_H_ 6 | #define TOUCHVG_CMD_DRAW_POLYGON_H_ 7 | 8 | #include "mgdrawlines.h" 9 | 10 | //! 多边形绘图命令类 11 | /*! \ingroup CORE_COMMAND 12 | \see MgLines 13 | */ 14 | class MgCmdDrawPolygon : public MgCmdDrawLines 15 | { 16 | protected: 17 | MgCmdDrawPolygon(const char* name = Name(), int maxEdges = 20) 18 | : MgCmdDrawLines(name), _maxEdges(maxEdges) {} 19 | 20 | public: 21 | static const char* Name() { return "polygon"; } 22 | static MgCommand* Create() { return new MgCmdDrawPolygon; } 23 | 24 | private: 25 | virtual bool needCheckClosed() { return false; } 26 | virtual bool needEnded() { return (int)m_step >= _maxEdges - 1; } 27 | 28 | virtual void release() { delete this; } 29 | virtual bool initialize(const MgMotion* sender, MgStorage* s); 30 | 31 | int _maxEdges; 32 | }; 33 | 34 | #endif // TOUCHVG_CMD_DRAW_POLYGON_H_ 35 | -------------------------------------------------------------------------------- /ios/Classes/TouchVGCore/core/include/cmdbasic/mgdrawquadrangle.h: -------------------------------------------------------------------------------- 1 | //! \file mgdrawquadrangle.h 2 | //! \brief 定义四边形绘图命令类 MgCmdDrawQuadrangle 3 | // Copyright (c) 2004-2015, https://github.com/rhcad/vgcore, BSD License 4 | 5 | #ifndef TOUCHVG_CMD_DRAW_QUADRANGLE_H_ 6 | #define TOUCHVG_CMD_DRAW_QUADRANGLE_H_ 7 | 8 | #include "mgdrawpolygon.h" 9 | 10 | //! 四边形绘图命令类 11 | /*! \ingroup CORE_COMMAND 12 | \see MgLines 13 | */ 14 | class MgCmdDrawQuadrangle : public MgCmdDrawPolygon 15 | { 16 | public: 17 | static const char* Name() { return "quadrangle"; } 18 | static MgCommand* Create() { return new MgCmdDrawQuadrangle; } 19 | 20 | private: 21 | MgCmdDrawQuadrangle() : MgCmdDrawPolygon(Name(), 4) {} 22 | virtual void release() { delete this; } 23 | }; 24 | 25 | #endif // TOUCHVG_CMD_DRAW_QUADRANGLE_H_ 26 | -------------------------------------------------------------------------------- /ios/Classes/TouchVGCore/core/include/cmdbasic/mgdrawsplines.h: -------------------------------------------------------------------------------- 1 | //! \file mgdrawsplines.h 2 | //! \brief 定义样条曲线绘图命令类 MgCmdDrawSplines 3 | // Copyright (c) 2004-2015, https://github.com/rhcad/vgcore, BSD License 4 | 5 | #ifndef TOUCHVG_CMD_DRAW_SPLINES_H_ 6 | #define TOUCHVG_CMD_DRAW_SPLINES_H_ 7 | 8 | #include "mgcmddraw.h" 9 | 10 | //! 样条曲线绘图命令类 11 | /*! \ingroup CORE_COMMAND 12 | \see MgSplines 13 | */ 14 | class MgCmdDrawSplines : public MgCommandDraw 15 | { 16 | protected: 17 | MgCmdDrawSplines(const char* name = Name(), bool freehand = true); 18 | virtual ~MgCmdDrawSplines() {} 19 | 20 | public: 21 | static const char* Name() { return "splines"; } 22 | static MgCommand* Create() { return new MgCmdDrawSplines; } 23 | 24 | private: 25 | virtual void release() { delete this; } 26 | virtual bool initialize(const MgMotion* sender, MgStorage* s); 27 | virtual bool backStep(const MgMotion* sender); 28 | virtual bool draw(const MgMotion* sender, GiGraphics* gs); 29 | virtual bool touchBegan(const MgMotion* sender); 30 | virtual bool touchMoved(const MgMotion* sender); 31 | virtual bool touchEnded(const MgMotion* sender); 32 | virtual bool click(const MgMotion* sender); 33 | virtual bool cancel(const MgMotion* sender); 34 | virtual bool mouseHover(const MgMotion* sender); 35 | 36 | private: 37 | bool canAddPoint(const MgMotion* sender, bool ended); 38 | 39 | bool m_freehand; 40 | }; 41 | 42 | //! 用点击绘制样条曲线的命令类 43 | /*! \ingroup CORE_COMMAND 44 | \see MgSplines 45 | */ 46 | class MgCmdDrawSplineMouse : public MgCmdDrawSplines 47 | { 48 | public: 49 | static const char* Name() { return "spline_mouse"; } 50 | static MgCommand* Create() { return new MgCmdDrawSplineMouse; } 51 | private: 52 | MgCmdDrawSplineMouse() : MgCmdDrawSplines(Name(), false) {} 53 | }; 54 | 55 | #endif // TOUCHVG_CMD_DRAW_SPLINES_H_ 56 | -------------------------------------------------------------------------------- /ios/Classes/TouchVGCore/core/include/cmdbasic/mgdrawsquare.h: -------------------------------------------------------------------------------- 1 | //! \file mgdrawsquare.h 2 | //! \brief 定义正方形绘图命令类 MgCmdDrawSquare 3 | // Copyright (c) 2004-2015, https://github.com/rhcad/vgcore, BSD License 4 | 5 | #ifndef TOUCHVG_CMD_DRAW_SQUARE_H_ 6 | #define TOUCHVG_CMD_DRAW_SQUARE_H_ 7 | 8 | #include "mgdrawrect.h" 9 | 10 | //! 正方形绘图命令类 11 | /*! \ingroup CORE_COMMAND 12 | \see MgRect 13 | */ 14 | class MgCmdDrawSquare : public MgCmdDrawRect 15 | { 16 | public: 17 | static const char* Name() { return "square"; } 18 | static MgCommand* Create() { return new MgCmdDrawSquare; } 19 | 20 | private: 21 | MgCmdDrawSquare(const char* name = Name()) : MgCmdDrawRect(name) {} 22 | virtual void release() { delete this; } 23 | virtual bool initialize(const MgMotion* sender, MgStorage* s); 24 | }; 25 | 26 | #endif // TOUCHVG_CMD_DRAW_SQUARE_H_ 27 | -------------------------------------------------------------------------------- /ios/Classes/TouchVGCore/core/include/cmdbasic/mgdrawtriang.h: -------------------------------------------------------------------------------- 1 | //! \file mgdrawtriang.h 2 | //! \brief 定义三角形绘图命令 MgCmdDrawTriangle 3 | // Copyright (c) 2004-2015, https://github.com/rhcad/vgcore, BSD License 4 | 5 | #ifndef TOUCHVG_CMD_DRAW_TRIANGLE_H_ 6 | #define TOUCHVG_CMD_DRAW_TRIANGLE_H_ 7 | 8 | #include "mgcmddraw.h" 9 | 10 | //! 三角形绘图命令 11 | /*! \ingroup CORE_COMMAND 12 | */ 13 | class MgCmdDrawTriangle : public MgCommandDraw 14 | { 15 | public: 16 | static const char* Name() { return "triangle"; } 17 | static MgCommand* Create() { return new MgCmdDrawTriangle; } 18 | 19 | private: 20 | MgCmdDrawTriangle(const char* name = Name()) : MgCommandDraw(name) {} 21 | virtual void release() { delete this; } 22 | virtual bool initialize(const MgMotion* sender, MgStorage* s); 23 | virtual bool touchBegan(const MgMotion* sender); 24 | virtual bool touchMoved(const MgMotion* sender); 25 | virtual bool touchEnded(const MgMotion* sender); 26 | }; 27 | 28 | #endif // TOUCHVG_CMD_DRAW_TRIANGLE_H_ 29 | -------------------------------------------------------------------------------- /ios/Classes/TouchVGCore/core/include/cmdmgr/mgcmdmgrfactory.h: -------------------------------------------------------------------------------- 1 | //! \file mgcmdmgrfactory.h 2 | //! \brief 定义命令管理器的创建类 MgCmdManagerFactory 3 | // Copyright (c) 2004-2015, https://github.com/rhcad/vgcore, BSD License 4 | 5 | #ifndef TOUCHVG_CMDMGR_FACTORY_H_ 6 | #define TOUCHVG_CMDMGR_FACTORY_H_ 7 | 8 | struct MgCmdManager; 9 | 10 | //! 命令管理器的创建类 11 | /*! \ingroup CORE_COMMAND 12 | */ 13 | class MgCmdManagerFactory { 14 | public: 15 | //! 创建命令管理器 16 | static MgCmdManager* create(); 17 | }; 18 | 19 | #endif // TOUCHVG_CMDMGR_FACTORY_H_ 20 | -------------------------------------------------------------------------------- /ios/Classes/TouchVGCore/core/include/cmdobserver/cmdsubject.h: -------------------------------------------------------------------------------- 1 | //! \file cmdsubject.h 2 | //! \brief 定义命令扩展目标接口 CmdSubject 3 | // Copyright (c) 2004-2015, https://github.com/rhcad/vgcore, BSD License 4 | 5 | #ifndef TOUCHVG_CMDSUBJECT_H_ 6 | #define TOUCHVG_CMDSUBJECT_H_ 7 | 8 | #include "cmdobserver.h" 9 | 10 | //! 命令扩展目标接口 11 | /*! \ingroup CORE_COMMAND 12 | */ 13 | struct CmdSubject : public CmdObserver { 14 | //! 注册观察者 15 | virtual void registerObserver(CmdObserver* observer) = 0; 16 | //! 注销观察者 17 | virtual void unregisterObserver(CmdObserver* observer) = 0; 18 | 19 | //! 注册命名观察者 20 | virtual bool registerNamedObserver(const char* name, CmdObserver* observer) = 0; 21 | //! 查找命名观察者 22 | virtual CmdObserver* findNamedObserver(const char* name) = 0; 23 | }; 24 | 25 | #endif // TOUCHVG_CMDSUBJECT_H_ 26 | -------------------------------------------------------------------------------- /ios/Classes/TouchVGCore/core/include/gshape/mgcshapes.h: -------------------------------------------------------------------------------- 1 | //! \file mgcshapes.h 2 | //! \brief 定义基本图形的工厂类 MgCoreShapeFactory 3 | // Copyright (c) 2004-2014, Zhang Yungui 4 | // Copyright (c) 2004-2015, https://github.com/rhcad/vgcore, BSD License 5 | 6 | #ifndef TOUCHVG_CORESHAPE_FACTORY_H_ 7 | #define TOUCHVG_CORESHAPE_FACTORY_H_ 8 | 9 | class MgBaseShape; 10 | 11 | //! 基本图形的工厂类 12 | /*! \ingroup CORE_SHAPE 13 | */ 14 | class MgCoreShapeFactory 15 | { 16 | public: 17 | MgCoreShapeFactory(); 18 | ~MgCoreShapeFactory(); 19 | 20 | //! 根据指定的图形类型创建图形对象 21 | MgBaseShape* createShape(int type); 22 | 23 | #ifndef SWIG 24 | //! 登记类型号对应的图形创建函数,creator为NULL则取消登记 25 | void registerShape(int type, MgBaseShape* (*creator)()); 26 | #endif 27 | 28 | private: 29 | struct Impl; 30 | Impl* impl; 31 | }; 32 | 33 | #endif // TOUCHVG_CORESHAPE_FACTORY_H_ 34 | -------------------------------------------------------------------------------- /ios/Classes/TouchVGCore/core/include/gshape/mgdiamond.h: -------------------------------------------------------------------------------- 1 | //! \file mgdiamond.h 2 | //! \brief 定义菱形图形类 MgDiamond 3 | // Copyright (c) 2004-2014, Zhang Yungui 4 | // License: LGPL, https://github.com/rhcad/vgcore 5 | 6 | #ifndef TOUCHVG_DIAMOND_SHAPE_H_ 7 | #define TOUCHVG_DIAMOND_SHAPE_H_ 8 | 9 | #include "mgrect.h" 10 | 11 | //! 菱形图形类 12 | /*! \ingroup CORE_SHAPE 13 | */ 14 | class MgDiamond : public MgBaseRect 15 | { 16 | MG_INHERIT_CREATE(MgDiamond, MgBaseRect, 14) 17 | protected: 18 | int _getHandleCount() const; 19 | Point2d _getHandlePoint(int index) const; 20 | bool _setHandlePoint(int index, const Point2d& pt, float tol); 21 | int _getHandleType(int index) const; 22 | bool _isHandleFixed(int index) const; 23 | void _update(); 24 | float _hitTest(const Point2d& pt, float tol, MgHitResult& res) const; 25 | bool _hitTestBox(const Box2d& rect) const; 26 | bool _rotateHandlePoint(int index, const Point2d& pt); 27 | void _output(MgPath& path) const; 28 | }; 29 | 30 | #endif // TOUCHVG_DIAMOND_SHAPE_H_ 31 | -------------------------------------------------------------------------------- /ios/Classes/TouchVGCore/core/include/gshape/mgdot.h: -------------------------------------------------------------------------------- 1 | //! \file mgdot.h 2 | //! \brief 定义点图形类 MgDot 3 | // Copyright (c) 2004-2014, Zhang Yungui 4 | // License: LGPL, https://github.com/rhcad/vgcore 5 | 6 | #ifndef TOUCHVG_DOT_SHAPE_H_ 7 | #define TOUCHVG_DOT_SHAPE_H_ 8 | 9 | #include "mgbasesp.h" 10 | 11 | //! 点图形类 12 | /*! \ingroup CORE_SHAPE 13 | */ 14 | class MgDot : public MgBaseShape 15 | { 16 | MG_DECLARE_CREATE(MgDot, MgBaseShape, 31) 17 | public: 18 | //! 返回点图案类型 19 | int getPointType() const { return _type; } 20 | 21 | //! 设置点图案类型. 0:默认, 1-19: GiHandleTypes+1, kGiHandleCustom~99:应用自定义图片 22 | void setPointType(int type) { _type = type; } 23 | 24 | protected: 25 | bool _isClosed() const { return false; } 26 | void _output(MgPath& path) const; 27 | bool _save(MgStorage* s) const; 28 | bool _load(MgShapeFactory* factory, MgStorage* s); 29 | 30 | private: 31 | Point2d _point; 32 | int _type; 33 | }; 34 | 35 | #endif // TOUCHVG_DOT_SHAPE_H_ 36 | -------------------------------------------------------------------------------- /ios/Classes/TouchVGCore/core/include/gshape/mggrid.h: -------------------------------------------------------------------------------- 1 | //! \file mggrid.h 2 | //! \brief 定义网格图形类 3 | // Copyright (c) 2004-2015, https://github.com/rhcad/vgcore, BSD License 4 | 5 | #ifndef TOUCHVG_GRIDSHAPE_H_ 6 | #define TOUCHVG_GRIDSHAPE_H_ 7 | 8 | #include "mgrect.h" 9 | 10 | //! 网格图形类 11 | /*! \ingroup CORE_SHAPE 12 | */ 13 | class MgGrid : public MgBaseRect 14 | { 15 | MG_INHERIT_CREATE(MgGrid, MgBaseRect, 20) 16 | public: 17 | virtual int snap(Point2d& pnt, Point2d& dist) const; 18 | const Vector2d& getCellSize() const { return m_cell; } 19 | bool isValid(float tol) const; 20 | 21 | protected: 22 | virtual void setFlag(MgShapeBit bit, bool on); 23 | void _copy(const MgGrid& src); 24 | bool _equals(const MgGrid& src) const; 25 | void _clear(); 26 | bool _save(MgStorage* s) const; 27 | bool _load(MgShapeFactory* factory, MgStorage* s); 28 | int _getHandleCount() const; 29 | Point2d _getHandlePoint(int index) const; 30 | bool _setHandlePoint(int index, const Point2d& pt, float tol); 31 | bool isFloatingCommand() { return true; } 32 | 33 | protected: 34 | Vector2d m_cell; 35 | }; 36 | 37 | #endif // TOUCHVG_GRIDSHAPE_H_ 38 | -------------------------------------------------------------------------------- /ios/Classes/TouchVGCore/core/include/gshape/mgobject.h: -------------------------------------------------------------------------------- 1 | //! \file mgobject.h 2 | //! \brief 定义图形对象基类 MgObject 3 | // Copyright (c) 2004-2015, https://github.com/rhcad/vgcore, BSD License 4 | 5 | #ifndef TOUCHVG_MGOBJECT_H_ 6 | #define TOUCHVG_MGOBJECT_H_ 7 | 8 | //! 图形对象基类 9 | /*! \ingroup CORE_SHAPE 10 | */ 11 | class MgObject 12 | { 13 | public: 14 | //! 复制出一个新对象 15 | virtual MgObject* clone() const = 0; 16 | 17 | //! 复制对象数据 18 | virtual void copy(const MgObject& src) = 0; 19 | 20 | //! 释放引用计数,为0时销毁对象 21 | virtual void release() = 0; 22 | 23 | //! 添加引用计数 24 | virtual void addRef() = 0; 25 | 26 | //! 比较与另一同类对象是否相同 27 | virtual bool equals(const MgObject& src) const = 0; 28 | 29 | //! 返回对象类型 30 | virtual int getType() const = 0; 31 | 32 | //! 返回是否能转化为指定类型的对象,即本类为指定类或其派生类 33 | virtual bool isKindOf(int type) const = 0; 34 | 35 | #ifndef SWIG 36 | MgObject& operator=(const MgObject& src) { copy(src); return *this; } 37 | bool operator==(const MgObject& src) const { return equals(src); } 38 | bool operator!=(const MgObject& src) const { return !equals(src); } 39 | 40 | template static void release_pointer(T*& p) { if (p) { p->release(); p = (T*)0; } } 41 | #endif // SWIG 42 | 43 | protected: 44 | virtual ~MgObject() {} 45 | }; 46 | 47 | #endif // TOUCHVG_MGOBJECT_H_ 48 | -------------------------------------------------------------------------------- /ios/Classes/TouchVGCore/core/include/gshape/mgparallel.h: -------------------------------------------------------------------------------- 1 | //! \file mgparallel.h 2 | //! \brief 定义平行四边形图形类 MgParallel 3 | // Copyright (c) 2004-2014, Zhang Yungui 4 | // License: LGPL, https://github.com/rhcad/vgcore 5 | 6 | #ifndef TOUCHVG_PARALLEL_SHAPE_H_ 7 | #define TOUCHVG_PARALLEL_SHAPE_H_ 8 | 9 | #include "mgbasesp.h" 10 | 11 | //! 平行四边形图形类 12 | /*! \ingroup CORE_SHAPE 13 | */ 14 | class MgParallel : public MgBaseShape 15 | { 16 | MG_DECLARE_CREATE(MgParallel, MgBaseShape, 17) 17 | public: 18 | //! 返回中心点 19 | Point2d getCenter() const { return (_points[0] + _points[2]) / 2; } 20 | 21 | //! 返回矩形框,是本对象未旋转时的形状 22 | Box2d getRect() const { return Box2d(getCenter(), getWidth(), getHeight()); } 23 | 24 | //! 返回宽度 25 | float getWidth() const { return _points[0].distanceTo(_points[1]); } 26 | 27 | //! 返回高度 28 | float getHeight() const { return _points[2].distanceTo(_points[1]); } 29 | 30 | //! 返回角度, [-PI, PI) 31 | float angle() const { return (_points[2] - _points[3]).angleTo2(_points[0] - _points[3]); } 32 | 33 | //! 返回是否为空矩形 34 | bool isEmpty(float minDist) const { 35 | return getWidth() <= minDist || getHeight() <= minDist; } 36 | 37 | #ifndef SWIG 38 | virtual const Point2d* getPoints() const { return _points; } 39 | #endif 40 | 41 | protected: 42 | bool _isClosed() const { return true; } 43 | int _getHandleCount() const; 44 | Point2d _getHandlePoint(int index) const; 45 | bool _setHandlePoint(int index, const Point2d& pt, float tol); 46 | int _getHandleType(int index) const; 47 | bool _isHandleFixed(int index) const; 48 | bool _offset(const Vector2d& vec, int segment); 49 | bool _rotateHandlePoint(int index, const Point2d& pt); 50 | bool _hitTestBox(const Box2d& rect) const; 51 | void _output(MgPath& path) const; 52 | bool _save(MgStorage* s) const; 53 | bool _load(MgShapeFactory* factory, MgStorage* s); 54 | 55 | protected: 56 | Point2d _points[4]; // 从左上角起顺时针的四个角点 57 | }; 58 | 59 | #endif // TOUCHVG_PARALLEL_SHAPE_H_ 60 | -------------------------------------------------------------------------------- /ios/Classes/TouchVGCore/core/include/gshape/mgpathsp.h: -------------------------------------------------------------------------------- 1 | //! \file mgpathsp.h 2 | //! \brief 定义路径图形 MgPathShape 3 | // Copyright (c) 2004-2014, Zhang Yungui 4 | // License: LGPL, https://github.com/rhcad/vgcore 5 | 6 | #ifndef TOUCHVG_PATH_SHAPE_H_ 7 | #define TOUCHVG_PATH_SHAPE_H_ 8 | 9 | #include "mgbasesp.h" 10 | 11 | //! 路径图形类 12 | /*! \ingroup CORE_SHAPE 13 | */ 14 | class MgPathShape : public MgBaseShape 15 | { 16 | MG_DECLARE_CREATE(MgPathShape, MgBaseShape, 32) 17 | public: 18 | //! 返回路径对象 19 | const MgPath& pathc() const { return _path; } 20 | MgPath& path() { return _path; } 21 | 22 | //! 用SVG路径的d坐标序列设置形状 23 | bool importSVGPath(const char* d); 24 | 25 | //! 输出SVG路径的d坐标序列 26 | int exportSVGPath(char* buf, int size) const; 27 | static int exportSVGPath(const MgPath& path, char* buf, int size); 28 | 29 | #ifndef SWIG 30 | virtual bool isCurve() const; 31 | #endif 32 | 33 | protected: 34 | bool _isClosed() const; 35 | bool _hitTestBox(const Box2d& rect) const; 36 | void _output(MgPath& path) const { path.append(_path); } 37 | bool _save(MgStorage* s) const; 38 | bool _load(MgShapeFactory* factory, MgStorage* s); 39 | 40 | private: 41 | MgPath _path; 42 | }; 43 | 44 | #endif // TOUCHVG_PATH_SHAPE_H_ 45 | -------------------------------------------------------------------------------- /ios/Classes/TouchVGCore/core/include/gshape/mgrdrect.h: -------------------------------------------------------------------------------- 1 | //! \file mgrdrect.h 2 | //! \brief 定义圆角矩形类 MgRoundRect 3 | // Copyright (c) 2004-2014, Zhang Yungui 4 | // License: LGPL, https://github.com/rhcad/vgcore 5 | 6 | #ifndef TOUCHVG_ROUNDRECT_SHAPE_H_ 7 | #define TOUCHVG_ROUNDRECT_SHAPE_H_ 8 | 9 | #include "mgrect.h" 10 | 11 | //! 圆角矩形类 12 | /*! \ingroup CORE_SHAPE 13 | */ 14 | class MgRoundRect : public MgBaseRect 15 | { 16 | MG_INHERIT_CREATE(MgRoundRect, MgBaseRect, 13) 17 | public: 18 | //! 返回X圆角半径 19 | float getRadiusX() const { return _rx; } 20 | 21 | //! 返回Y圆角半径 22 | float getRadiusY() const { return _ry; } 23 | 24 | //! 设置圆角半径 25 | void setRadius(float rx, float ry = 0.0); 26 | 27 | #ifndef SWIG 28 | virtual bool isCurve() const; 29 | #endif 30 | 31 | protected: 32 | void _copy(const MgRoundRect& src); 33 | bool _equals(const MgRoundRect& src) const; 34 | void _clear(); 35 | float _hitTest(const Point2d& pt, float tol, MgHitResult& res) const; 36 | void _output(MgPath& path) const; 37 | bool _save(MgStorage* s) const; 38 | bool _load(MgShapeFactory* factory, MgStorage* s); 39 | 40 | protected: 41 | float _rx; 42 | float _ry; 43 | }; 44 | 45 | #endif // TOUCHVG_ROUNDRECT_SHAPE_H_ 46 | -------------------------------------------------------------------------------- /ios/Classes/TouchVGCore/core/include/gshape/mgshapetype.h: -------------------------------------------------------------------------------- 1 | //! \file mgshapetype.h 2 | //! \brief 定义图形类型号 MgShapeType 3 | // Copyright (c) 2004-2015, https://github.com/rhcad/vgcore, BSD License 4 | 5 | #ifndef TOUCHVG_SHAPETYPE_H_ 6 | #define TOUCHVG_SHAPETYPE_H_ 7 | 8 | //! 基本图形的类型号 9 | /*! \ingroup CORE_SHAPE 10 | 1-40为内置图形类型,41以上为其他应用可用的类型号 11 | */ 12 | typedef enum { 13 | kMgShapeMultiType = 9999, //!< 混合图形类型 14 | kMgShapeNone = 0, //!< 没有图形 15 | kMgShapeList = 1, //!< 图形列表, MgShapes 16 | kMgShapeWrapper = 2, //!< 封装图形, MgShape 17 | kMgShapeBase = 3, //!< 图形基类, MgBaseShape 18 | kMgShapeBaseRect = 4, //!< 矩形基类, MgBaseRect 19 | kMgShapeBaseLines = 5, //!< 折线基类, MgBaseLines 20 | kMgShapeComposite = 6, //!< 复合图形, MgComposite 21 | kMgShapeLayer = 7, //!< 图层, MgLayer 22 | kMgShapeDoc = 8, //!< 图形文档, MgShapeDoc 23 | 24 | kMgShapeGroup = 9, //!< 成组图形, MgGroup 25 | kMgShapeLine = 10, //!< 线段, MgLine 26 | kMgShapeRect = 11, //!< 矩形、正方形, MgRect 27 | kMgShapeEllipse = 12, //!< 椭圆、圆, MgEllipse 28 | kMgShapeRoundRect = 13, //!< 圆角矩形, MgRoundRect 29 | kMgShapeDiamond = 14, //!< 菱形, MgDiamond 30 | kMgShapeLines = 15, //!< 折线、多边形, MgLines 31 | kMgShapeSplines = 16, //!< 二次样条曲线类, MgSplines 32 | kMgShapeParallel = 17, //!< 平行四边形, MgParallel 33 | kMgShapeImage = 18, //!< 图像矩形, MgImageShape 34 | kMgShapeArc = 19, //!< 圆弧, MgArc 35 | kMgShapeGrid = 20, //!< 网格, MgGrid 36 | 37 | kMgShapeRecord = 30, //!< 录制, MgRecordShape 38 | kMgShapeDot = 31, //!< 点, MgDot 39 | kMgShapePath = 32, //!< 路径, MgPathShape 40 | } MgShapeType; 41 | 42 | #endif // TOUCHVG_SHAPETYPE_H_ 43 | -------------------------------------------------------------------------------- /ios/Classes/TouchVGCore/core/include/gshape/mgsplines.h: -------------------------------------------------------------------------------- 1 | //! \file mgsplines.h 2 | //! \brief 定义二次样条曲线类 MgSplines 3 | // Copyright (c) 2004-2014, Zhang Yungui 4 | // License: LGPL, https://github.com/rhcad/vgcore 5 | 6 | #ifndef TOUCHVG_SPLINES_SHAPE_H_ 7 | #define TOUCHVG_SPLINES_SHAPE_H_ 8 | 9 | #include "mglines.h" 10 | 11 | //! 二次样条曲线类 12 | /*! \ingroup CORE_SHAPE 13 | */ 14 | class MgSplines : public MgBaseLines 15 | { 16 | MG_INHERIT_CREATE(MgSplines, MgBaseLines, 16) 17 | public: 18 | 19 | bool smooth(const Matrix2d& m2d, float tol); 20 | int smoothForPoints(int count, const Point2d* points, const Matrix2d& m2d, float tol); 21 | void clearVectors(); 22 | #ifndef SWIG 23 | const Vector2d* getVectors() const { return _knotvs; } 24 | virtual bool isCurve() const { return true; } 25 | virtual bool resize(int count); 26 | virtual bool addPoint(const Point2d& pt); 27 | virtual bool insertPoint(int segment, const Point2d& pt); 28 | virtual bool removePoint(int index); 29 | #endif 30 | 31 | protected: 32 | void _copy(const MgSplines& src); 33 | bool _equals(const MgSplines& src) const; 34 | void _transform(const Matrix2d& mat); 35 | void _clear(); 36 | void _setPoint(int index, const Point2d& pt); 37 | bool _setHandlePoint(int index, const Point2d& pt, float tol); 38 | float _hitTest(const Point2d& pt, float tol, MgHitResult& res) const; 39 | bool _hitTestBox(const Box2d& rect) const; 40 | void _output(MgPath& path) const; 41 | bool _save(MgStorage* s) const; 42 | bool _load(MgShapeFactory* factory, MgStorage* s); 43 | 44 | Vector2d* _knotvs; 45 | }; 46 | 47 | #endif // TOUCHVG_SPLINES_SHAPE_H_ 48 | -------------------------------------------------------------------------------- /ios/Classes/TouchVGCore/core/include/mglog.h: -------------------------------------------------------------------------------- 1 | // mglog.h 2 | 3 | #ifndef TOUCHVG_LOG_H 4 | #define TOUCHVG_LOG_H 5 | 6 | #ifndef LOGD 7 | 8 | #ifdef __ANDROID__ 9 | 10 | #include 11 | #define LOGD(...) __android_log_print(ANDROID_LOG_DEBUG,"vgjni",__VA_ARGS__) 12 | #define LOGE(...) __android_log_print(ANDROID_LOG_ERROR,"vgjni",__VA_ARGS__) 13 | 14 | #elif defined(__APPLE__) 15 | 16 | #include 17 | 18 | #define __CLOG_VARGS_LOG(LEVEL) \ 19 | va_list ap; \ 20 | va_start(ap, fmt); \ 21 | __clog_log(LEVEL, fmt, ap); \ 22 | va_end(ap); 23 | 24 | static inline void __clog_log(int level, const char * fmt, va_list ap) { 25 | aslmsg msg; 26 | static aslclient __clog_client = (aslclient)0; 27 | 28 | if (!__clog_client) { 29 | __clog_client = asl_open("touchvg", "com.apple.console", ASL_OPT_STDERR | ASL_OPT_NO_DELAY); 30 | } 31 | if (__clog_client) { 32 | msg = asl_new(ASL_TYPE_MSG); 33 | asl_set(msg, ASL_KEY_FACILITY, "com.apple.console"); 34 | asl_vlog(__clog_client, msg, level, fmt, ap); 35 | asl_free(msg); 36 | } 37 | } 38 | 39 | inline void LOGD(const char * fmt, ...) { 40 | __CLOG_VARGS_LOG(ASL_LEVEL_DEBUG); 41 | } 42 | inline void LOGE(const char * fmt, ...) { 43 | __CLOG_VARGS_LOG(ASL_LEVEL_ERR); 44 | } 45 | 46 | #else 47 | #define NO_LOGD 48 | #define LOGD(...) 49 | #define LOGE(...) 50 | #endif 51 | 52 | #endif // LOGD 53 | 54 | #endif // TOUCHVG_LOG_H 55 | -------------------------------------------------------------------------------- /ios/Classes/TouchVGCore/core/include/mgstrcallback.h: -------------------------------------------------------------------------------- 1 | //! \file mgstrcallback.h 2 | //! \brief 定义获取字符串的回调接口 MgStringCallback 3 | // Copyright (c) 2004-2015, https://github.com/rhcad/vgcore, BSD License 4 | 5 | #ifndef TOUCHVG_CORE_STR_CALLBACK_H 6 | #define TOUCHVG_CORE_STR_CALLBACK_H 7 | 8 | //! 获取字符串的回调接口,可避免JNI串泄露 9 | /*! \ingroup CORE_VIEW 10 | \interface MgStringCallback 11 | */ 12 | struct MgStringCallback { 13 | virtual ~MgStringCallback() {} 14 | virtual void onGetString(const char* text) = 0; 15 | }; 16 | 17 | #endif // TOUCHVG_CORE_STR_CALLBACK_H 18 | -------------------------------------------------------------------------------- /ios/Classes/TouchVGCore/core/include/shape/mgbasicspreg.h: -------------------------------------------------------------------------------- 1 | //! \file mgbasicspreg.h 2 | //! \brief 定义基本图形的工厂类 MgBasicShapes 3 | // Copyright (c) 2004-2015, https://github.com/rhcad/vgcore, BSD License 4 | 5 | #ifndef TOUCHVG_BASICSHAPE_FACTORY_H_ 6 | #define TOUCHVG_BASICSHAPE_FACTORY_H_ 7 | 8 | #include "mgspfactory.h" 9 | 10 | //! 基本图形的工厂类 11 | /*! \ingroup CORE_SHAPE 12 | */ 13 | class MgBasicShapes 14 | { 15 | public: 16 | //! 登记图形类型 17 | static void registerShapes(MgShapeFactory* factory); 18 | }; 19 | 20 | #endif // TOUCHVG_BASICSHAPE_FACTORY_H_ 21 | -------------------------------------------------------------------------------- /ios/Classes/TouchVGCore/core/include/shape/mgbasicsps.h: -------------------------------------------------------------------------------- 1 | //! \file mgbasicsps.h 2 | //! \brief Include basic shape headers. 3 | // Copyright (c) 2004-2015, https://github.com/rhcad/vgcore, BSD License 4 | 5 | #ifndef TOUCHVG_BASIC_SHAPES_H_ 6 | #define TOUCHVG_BASIC_SHAPES_H_ 7 | 8 | #include "mgshapetype.h" 9 | #include "mgarc.h" 10 | #include "mgdiamond.h" 11 | #include "mgdot.h" 12 | #include "mgellipse.h" 13 | #include "mggrid.h" 14 | #include "mgline.h" 15 | #include "mglines.h" 16 | #include "mgparallel.h" 17 | #include "mgpathsp.h" 18 | #include "mgrdrect.h" 19 | #include "mgrect.h" 20 | #include "mgsplines.h" 21 | 22 | #endif // TOUCHVG_BASIC_SHAPES_H_ 23 | -------------------------------------------------------------------------------- /ios/Classes/TouchVGCore/core/include/shape/mgimagesp.h: -------------------------------------------------------------------------------- 1 | //! \file mgimagesp.h 2 | //! \brief 定义图像矩形类 MgImageShape 3 | // Copyright (c) 2004-2014, Zhang Yungui 4 | // License: LGPL, https://github.com/rhcad/vgcore 5 | 6 | #ifndef TOUCHVG_IMAGE_SHAPE_H_ 7 | #define TOUCHVG_IMAGE_SHAPE_H_ 8 | 9 | #include "mgrect.h" 10 | #include "mgshape.h" 11 | 12 | //! 图像矩形类 13 | /*! \ingroup CORE_SHAPE 14 | */ 15 | class MgImageShape : public MgBaseRect 16 | { 17 | MG_INHERIT_CREATE(MgImageShape, MgBaseRect, 18) 18 | public: 19 | #ifndef SWIG 20 | const char* getName() const { return _name; } 21 | #endif 22 | void setName(const char* name); 23 | 24 | Vector2d getImageSize() const { return _size; } 25 | void setImageSize(Vector2d size); 26 | 27 | static const MgShape* findShapeByImageID(const MgShapes* shapes, const char* name); 28 | 29 | protected: 30 | void _copy(const MgImageShape& src); 31 | bool _equals(const MgImageShape& src) const; 32 | void _clear(); 33 | bool _draw(int mode, GiGraphics& gs, const GiContext& ctx, int segment) const; 34 | bool _save(MgStorage* s) const; 35 | bool _load(MgShapeFactory* factory, MgStorage* s); 36 | 37 | protected: 38 | char _name[64]; 39 | Vector2d _size; 40 | }; 41 | 42 | #endif // TOUCHVG_IMAGE_SHAPE_H_ 43 | -------------------------------------------------------------------------------- /ios/Classes/TouchVGCore/core/include/shape/mgspfactory.h: -------------------------------------------------------------------------------- 1 | //! \file mgspfactory.h 2 | //! \brief 定义图形工厂接口 MgShapeFactory 3 | // Copyright (c) 2004-2015, https://github.com/rhcad/vgcore, BSD License 4 | 5 | #ifndef TOUCHVG_SHAPE_FACTORY_H_ 6 | #define TOUCHVG_SHAPE_FACTORY_H_ 7 | 8 | class MgShape; 9 | 10 | //! 图形工厂接口 11 | /*! \ingroup CORE_SHAPE 12 | \interface MgShapeFactory 13 | */ 14 | struct MgShapeFactory 15 | { 16 | virtual ~MgShapeFactory() {} 17 | #ifndef SWIG 18 | //! 登记类型号对应的图形创建函数,creator为NULL则取消登记 19 | virtual void registerShape(int type, MgShape* (*creator)()) = 0; 20 | #endif 21 | //! 根据类型号创建图形对象 22 | virtual MgShape* createShape(int type) = 0; 23 | }; 24 | 25 | #endif // TOUCHVG_SHAPE_FACTORY_H_ 26 | -------------------------------------------------------------------------------- /ios/Classes/TouchVGCore/core/include/shapedoc/mglayer.h: -------------------------------------------------------------------------------- 1 | //! \file mglayer.h 2 | //! \brief 定义图形文档 MgShapeDoc 3 | // Copyright (c) 2004-2015, https://github.com/rhcad/vgcore, BSD License 4 | 5 | #ifndef TOUCHVG_SHAPELAYER_H_ 6 | #define TOUCHVG_SHAPELAYER_H_ 7 | 8 | #include "mgshapes.h" 9 | 10 | class MgShapeDoc; 11 | 12 | //! 图层类 13 | /*! \ingroup CORE_SHAPE 14 | */ 15 | class MgLayer : public MgShapes 16 | { 17 | public: 18 | //! 返回本对象的类型 19 | static int Type() { return 7; } 20 | 21 | //! 复制出一个新图层对象 22 | MgLayer* cloneLayer() const { return (MgLayer*)clone(); } 23 | 24 | //! 创建图层对象 25 | static MgLayer* create(MgShapeDoc* doc, int index); 26 | 27 | MgShapeDoc* doc() const; //!< 返回所属文档对象 28 | 29 | bool isHided() const { return !!_bits.hided; } //!< 返回图层是否隐藏 30 | void setHided(bool hided) { _bits.hided = hided; } //!< 设置图层是否隐藏 31 | bool isLocked() const { return !!_bits.locked; } //!< 返回图层是否锁定 32 | void setLocked(bool locked) { _bits.locked = locked; } //!< 设置图层是否锁定 33 | 34 | public: 35 | virtual MgObject* clone() const; 36 | virtual void copy(const MgObject& src); 37 | virtual void release(); 38 | virtual bool equals(const MgObject& src) const; 39 | virtual int getType() const { return Type(); } 40 | virtual bool isKindOf(int type) const { return type == Type() || type == MgShapes::Type(); } 41 | 42 | protected: 43 | MgLayer(MgShapeDoc* doc, int index); 44 | virtual ~MgLayer(); 45 | virtual bool saveExtra(MgStorage* s) const; 46 | virtual bool loadExtra(MgStorage* s); 47 | 48 | private: 49 | union { 50 | int _flags; 51 | struct { 52 | int hided:1; 53 | int locked:1; 54 | } _bits; 55 | }; 56 | }; 57 | 58 | #endif // TOUCHVG_SHAPELAYER_H_ 59 | -------------------------------------------------------------------------------- /ios/Classes/TouchVGCore/core/include/shapedoc/spfactoryimpl.h: -------------------------------------------------------------------------------- 1 | //! \file spfactoryimpl.h 2 | //! \brief 定义图形工厂接口的默认实现类 MgShapeFactoryImpl 3 | // Copyright (c) 2013, Zhang Yungui 4 | // Copyright (c) 2004-2015, https://github.com/rhcad/vgcore, BSD License 5 | 6 | #ifndef TOUCHVG_SHAPEFACTORY_IMPL_H_ 7 | #define TOUCHVG_SHAPEFACTORY_IMPL_H_ 8 | 9 | #include "mgspfactory.h" 10 | #include 11 | 12 | //! 图形工厂接口的默认实现类 13 | /*! \ingroup CORE_SHAPE 14 | */ 15 | class MgShapeFactoryImpl : public MgShapeFactory 16 | { 17 | std::map _shapeCreators; 18 | public: 19 | MgShapeFactoryImpl(); 20 | virtual ~MgShapeFactoryImpl(); 21 | 22 | virtual void registerShape(int type, MgShape* (*creator)()); 23 | virtual MgShape* createShape(int type); 24 | }; 25 | 26 | #endif // TOUCHVG_SHAPEFACTORY_IMPL_H_ 27 | -------------------------------------------------------------------------------- /ios/Classes/TouchVGCore/core/include/test/RandomShape.h: -------------------------------------------------------------------------------- 1 | #ifndef _TEST_RANDOMSHAPE_H 2 | #define _TEST_RANDOMSHAPE_H 3 | 4 | #include "mgshapes.h" 5 | #include "mgshape.h" 6 | 7 | struct RandomParam 8 | { 9 | int lineCount; 10 | int rectCount; 11 | int arcCount; 12 | int curveCount; 13 | bool randomLineStyle; 14 | bool fill; 15 | 16 | static void init(); 17 | 18 | RandomParam(int n = 1000) : lineCount(n), rectCount(n), arcCount(n) 19 | , curveCount(n), randomLineStyle(false), fill(false) {} 20 | 21 | int getShapeCount() const { return lineCount + rectCount + arcCount + curveCount; } 22 | int addShapes(MgShapes* shapes); 23 | void setShapeProp(GiContext& ctx); 24 | 25 | static float RandF(float fMin, float fMax); 26 | static int RandInt(int nMin, int nMax); 27 | static unsigned char RandUInt8(int nMin, int nMax); 28 | }; 29 | 30 | #endif // _TEST_RANDOMSHAPE_H 31 | -------------------------------------------------------------------------------- /ios/Classes/TouchVGCore/core/include/test/testcanvas.h: -------------------------------------------------------------------------------- 1 | //! \file testcanvas.h 2 | //! \brief Define the testing class: TestCanvas. 3 | // Copyright (c) 2004-2015, https://github.com/rhcad/vgcore, BSD License 4 | 5 | #ifndef TOUCHVG_TESTCANVAS_H 6 | #define TOUCHVG_TESTCANVAS_H 7 | 8 | class GiCanvas; 9 | 10 | //! The testing class for GiCanvas. 11 | /*! \ingroup GRAPH_INTERFACE 12 | */ 13 | struct TestCanvas { 14 | enum { 15 | kRect = 0x01, 16 | kLine = 0x02, 17 | kTextAt = 0x04, 18 | kEllipse = 0x08, 19 | kQuadBezier = 0x10, 20 | kCubicBezier = 0x20, 21 | kPolygon = 0x40, 22 | kClearRect = 0x80, 23 | kClipPath = 0x100, 24 | kHandle = 0x200, 25 | kDynCurves = 0x400, 26 | kRotateText = 0x800, 27 | kClearPolygon = 0x80|0x40|0x02, 28 | }; 29 | static void initRand(); 30 | static int randInt(int minv, int maxv); 31 | static float randFloat(float minv, float maxv); 32 | 33 | static void test(GiCanvas* canvas, int bits, int n = 100, bool randStyle = true); 34 | 35 | static void testRect(GiCanvas* canvas, int n); 36 | static void testLine(GiCanvas* canvas, int n); 37 | static void testEllipse(GiCanvas* canvas, int n); 38 | static void testQuadBezier(GiCanvas* canvas, int n); 39 | static void testCubicBezier(GiCanvas* canvas, int n); 40 | static void testPolygon(GiCanvas* canvas, int n); 41 | static void testClipPath(GiCanvas* canvas, int n); 42 | static void testHandle(GiCanvas* canvas, int n); 43 | static void testDynCurves(GiCanvas* canvas); 44 | static void testTextAt(GiCanvas* canvas, int n); 45 | static void testRotateText(GiCanvas* canvas, int n); 46 | }; 47 | 48 | #endif // TOUCHVG_TESTCANVAS_H 49 | -------------------------------------------------------------------------------- /ios/Classes/TouchVGCore/core/include/view/gigesture.h: -------------------------------------------------------------------------------- 1 | //! \file gigesture.h 2 | //! \brief 定义手势类型 GiGestureType 3 | // Copyright (c) 2004-2015, https://github.com/rhcad/vgcore, BSD License 4 | 5 | #ifndef TOUCHVG_CORE_GESTURE_H 6 | #define TOUCHVG_CORE_GESTURE_H 7 | 8 | typedef enum { //!< 手势类型 9 | kGiGestureUnknown, //!< 未知的手势 10 | kGiGesturePan, //!< 单指滑动 11 | kGiGestureTap, //!< 单指单击 12 | kGiGestureDblTap, //!< 单指双击 13 | kGiGesturePress, //!< 单指长按 14 | kGiTwoFingersMove, //!< 双指移动(可放缩旋转) 15 | } GiGestureType; 16 | 17 | typedef enum { //!< 手势状态 18 | kGiGesturePossible, //!< 待检查手势有效性 19 | kGiGestureBegan, //!< 开始 20 | kGiGestureMoved, //!< 改变 21 | kGiGestureEnded, //!< 结束 22 | kGiGestureCancel, //!< 取消 23 | } GiGestureState; 24 | 25 | #endif // TOUCHVG_CORE_GESTURE_H 26 | -------------------------------------------------------------------------------- /ios/Classes/TouchVGCore/core/include/view/gimousehelper.h: -------------------------------------------------------------------------------- 1 | //! \file gimousehelper.h 2 | //! \brief 定义鼠标转手势的辅助类 GiMouseHelper 3 | // Copyright (c) 2012-2013, https://github.com/rhcad/touchvg 4 | 5 | #ifndef TOUCHVG_CORE_MOUSEHELPER_H 6 | #define TOUCHVG_CORE_MOUSEHELPER_H 7 | 8 | #include "gicoreview.h" 9 | 10 | //! 鼠标转手势的辅助类 11 | /*! \ingroup CORE_VIEW 12 | */ 13 | class GiMouseHelper 14 | { 15 | public: 16 | GiMouseHelper(GiView* view, GiCoreView* coreView); 17 | 18 | bool onLButtonDown(float x, float y, bool ctrl, bool shift); 19 | bool onRButtonDown(float x, float y); 20 | bool onMouseUp(float x, float y); 21 | bool onMouseMove(float x, float y, bool ldown, bool rdown); 22 | bool onLButtonDblClk(float x, float y); 23 | bool onKeyDown(int code); 24 | 25 | private: 26 | GiView* _view; 27 | GiCoreView* _coreView; 28 | float _startX; 29 | float _startY; 30 | bool _moved; 31 | bool _ldown; 32 | bool _rdown; 33 | }; 34 | 35 | #endif // TOUCHVG_CORE_MOUSEHELPER_H 36 | -------------------------------------------------------------------------------- /ios/Classes/TouchVGCore/core/include/view/giplaying.h: -------------------------------------------------------------------------------- 1 | //! \file giplaying.h 2 | //! \brief 定义图形播放项类 GiPlaying 3 | // Copyright (c) 2004-2015, https://github.com/rhcad/vgcore, BSD License 4 | 5 | #ifndef TOUCHVG_CORE_PLAYING_H 6 | #define TOUCHVG_CORE_PLAYING_H 7 | 8 | struct MgCoreView; 9 | class MgShapeDoc; 10 | class MgShapes; 11 | 12 | //! 图形播放项 13 | /*! 14 | \ingroup CORE_VIEW 15 | */ 16 | class GiPlaying 17 | { 18 | public: 19 | static GiPlaying* fromHandle(long h) { GiPlaying* p; *(long*)&p = h; return p; } //!< 转为对象 20 | long toHandle() const { long h; *(const GiPlaying**)&h = this; return h; } //!< 得到句柄 21 | 22 | enum { kDrawingTag = -1, kPlayingTag = -2 }; 23 | static GiPlaying* create(MgCoreView* v, int tag, bool doubleSided = true); //!< 创建播放项 24 | 25 | void release(MgCoreView* v); //!< 销毁播放项 26 | void clear(); //!< 清除图形 27 | int getTag() const; //!< 得到标识号 28 | 29 | long acquireFrontDoc(); //!< 得到显示用的图形文档句柄,需要并发保护 30 | static void releaseDoc(long doc); //!< 释放 acquireDoc() 返回的句柄 31 | MgShapeDoc* getBackDoc(); //!< 得到修改图形用的图形文档 32 | void submitBackDoc(); //!< 提交图形文档结果,需要并发保护 33 | 34 | long acquireFrontShapes(); //!< 得到显示用的图形列表句柄,需要并发保护 35 | static void releaseShapes(long shapes); //!< 释放 acquireShapes() 返回的句柄 36 | long getBackShapesHandle(bool needClear); //!< 得到修改图形用的动态图形列表句柄 37 | MgShapes* getBackShapes(bool needClear); //!< 得到修改图形用的动态图形列表 38 | void submitBackShapes(); //!< 提交动态图形列表结果,需要并发保护 39 | 40 | void stop(); //!< 标记需要停止 41 | bool isStopping() const; //!< 返回是否待停止 42 | 43 | private: 44 | GiPlaying(int tag, bool doubleSided); 45 | ~GiPlaying(); 46 | 47 | struct Impl; 48 | Impl* impl; 49 | }; 50 | 51 | #endif // TOUCHVG_CORE_PLAYING_H 52 | -------------------------------------------------------------------------------- /ios/Classes/TouchVGCore/core/src/cmdbase/mgdrawrect.cpp: -------------------------------------------------------------------------------- 1 | // mgdrawrect.cpp 2 | // Copyright (c) 2004-2015, https://github.com/rhcad/vgcore, BSD License 3 | 4 | #include "mgdrawrect.h" 5 | #include "mgbasicsps.h" 6 | 7 | bool MgCmdDrawRect::initialize(const MgMotion* sender, MgStorage* s) 8 | { 9 | return _initialize(MgRect::Type(), sender, s); 10 | } 11 | 12 | bool MgCmdDrawRect::backStep(const MgMotion* sender) 13 | { 14 | return MgCommandDraw::backStep(sender); 15 | } 16 | 17 | bool MgCmdDrawRect::touchBegan(const MgMotion* sender) 18 | { 19 | m_step = 1; 20 | m_startPt = snapPoint(sender, true); 21 | ((MgBaseRect*)dynshape()->shape())->setRect2P(m_startPt, m_startPt); 22 | dynshape()->shape()->update(); 23 | 24 | return MgCommandDraw::touchBegan(sender); 25 | } 26 | 27 | bool MgCmdDrawRect::touchMoved(const MgMotion* sender) 28 | { 29 | Point2d pt1(m_startPt); 30 | Point2d pt2(snapPoint(sender)); 31 | MgBaseRect* shape = (MgBaseRect*)dynshape()->shape(); 32 | 33 | shape->setRect2P(pt1, pt2); 34 | dynshape()->shape()->update(); 35 | 36 | return MgCommandDraw::touchMoved(sender); 37 | } 38 | 39 | bool MgCmdDrawRect::touchEnded(const MgMotion* sender) 40 | { 41 | MgBaseRect* shape = (MgBaseRect*)dynshape()->shape(); 42 | float minDist = sender->displayMmToModel(2.f); 43 | 44 | if (shape->getWidth() > minDist && shape->getHeight() > minDist 45 | && shape->getDiagonalLength() > 2 * minDist) { 46 | addRectShape(sender); 47 | } else if (sender->point.distanceTo(sender->startPt) < 2) { 48 | return _click(sender); 49 | } else { 50 | shape->clear(); 51 | m_step = 0; 52 | sender->view->showMessage("@shape_too_small"); 53 | } 54 | 55 | return MgCommandDraw::touchEnded(sender); 56 | } 57 | 58 | void MgCmdDrawRect::addRectShape(const MgMotion* sender) 59 | { 60 | addShape(sender); 61 | m_step = 0; 62 | } 63 | -------------------------------------------------------------------------------- /ios/Classes/TouchVGCore/core/src/cmdbasic/cmdbasic.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kangshaojun/flutter_touchvg/ccd4dc2c910e5aa6f9fff230af6de3be7a8da082/ios/Classes/TouchVGCore/core/src/cmdbasic/cmdbasic.cpp -------------------------------------------------------------------------------- /ios/Classes/TouchVGCore/core/src/cmdbasic/mgcmderase.h: -------------------------------------------------------------------------------- 1 | //! \file mgcmderase.h 2 | //! \brief 定义橡皮擦命令类 MgCmdErase 3 | // Copyright (c) 2004-2015, https://github.com/rhcad/vgcore, BSD License 4 | 5 | #ifndef TOUCHVG_CMD_ERASE_H_ 6 | #define TOUCHVG_CMD_ERASE_H_ 7 | 8 | #include "mgcmd.h" 9 | #include 10 | 11 | //! 橡皮擦命令类 12 | /*! \ingroup CORE_COMMAND 13 | */ 14 | class MgCmdErase : public MgCommand 15 | { 16 | public: 17 | static const char* Name() { return "erase"; } 18 | static MgCommand* Create() { return new MgCmdErase; } 19 | 20 | private: 21 | MgCmdErase() : MgCommand(Name()) {} 22 | virtual void release() { delete this; } 23 | virtual bool cancel(const MgMotion* sender); 24 | virtual bool initialize(const MgMotion* sender, MgStorage* s); 25 | virtual bool backStep(const MgMotion* sender); 26 | virtual bool draw(const MgMotion* sender, GiGraphics* gs); 27 | virtual bool click(const MgMotion* sender); 28 | virtual bool longPress(const MgMotion* sender); 29 | virtual bool touchBegan(const MgMotion* sender); 30 | virtual bool touchMoved(const MgMotion* sender); 31 | virtual bool touchEnded(const MgMotion* sender); 32 | 33 | private: 34 | int getStep() { return 0; } 35 | const MgShape* hitTest(const MgMotion* sender); 36 | bool isIntersectMode(const MgMotion* sender); 37 | 38 | std::vector m_delIds; 39 | bool m_boxsel; 40 | }; 41 | 42 | #endif // TOUCHVG_CMD_ERASE_H_ 43 | -------------------------------------------------------------------------------- /ios/Classes/TouchVGCore/core/src/cmdbasic/mgdrawcircle.cpp: -------------------------------------------------------------------------------- 1 | // mgdrawcircle.cpp: 实现圆绘图命令类 MgCmdDrawCircle 2 | // Copyright (c) 2004-2015, https://github.com/rhcad/vgcore, BSD License 3 | 4 | #include "mgdrawcircle.h" 5 | #include "mgbasicsps.h" 6 | 7 | bool MgCmdDrawCircle::initialize(const MgMotion* sender, MgStorage* s) 8 | { 9 | _initialize(MgEllipse::Type(), sender); 10 | 11 | ((MgBaseRect*)dynshape()->shape())->setSquare(true); 12 | 13 | return _initialize(0, sender, s); 14 | } 15 | 16 | bool MgCmdDrawCircle3P::initialize(const MgMotion* sender, MgStorage* s) 17 | { 18 | _initialize(MgEllipse::Type(), sender); 19 | 20 | ((MgBaseRect*)dynshape()->shape())->setSquare(true); 21 | 22 | return _initialize(0, sender, s); 23 | } 24 | 25 | void MgCmdDrawCircle3P::drawHandles(const MgMotion* sender, GiGraphics* gs) 26 | { 27 | if (m_step > 0 && m_step < 3 && !getSnappedType(sender)) { 28 | gs->drawHandle(_points[m_step], kGiHandleHotVertex); 29 | } 30 | } 31 | 32 | bool MgCmdDrawCircle3P::draw(const MgMotion* sender, GiGraphics* gs) 33 | { 34 | drawHandles(sender, gs); 35 | if (m_step > 0) { 36 | GiContext ctx(0, dynshape()->context().getLineColor(), GiContext::kDotLine); 37 | gs->drawLine(&ctx, _points[0], _points[1]); 38 | } 39 | return MgCommandDraw::draw(sender, gs); 40 | } 41 | 42 | void MgCmdDrawCircle3P::setStepPoint(const MgMotion*, int step, const Point2d& pt) 43 | { 44 | MgEllipse* c = (MgEllipse*)dynshape()->shape(); 45 | 46 | if (step == 0) { 47 | _points[0] = pt; 48 | } 49 | else if (step == 1) { 50 | _points[1] = pt; 51 | _points[2] = pt; 52 | c->setCircle2P(_points[0], pt); 53 | } 54 | else if (step == 2) { 55 | _points[2] = pt; 56 | c->setCircle3P(_points[0], _points[1], pt); 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /ios/Classes/TouchVGCore/core/src/cmdbasic/mgdrawdiamond.cpp: -------------------------------------------------------------------------------- 1 | // mgdrawdiamond.cpp 2 | // Copyright (c) 2004-2015, https://github.com/rhcad/vgcore, BSD License 3 | 4 | #include "mgdrawdiamond.h" 5 | #include "mgbasicsps.h" 6 | 7 | bool MgCmdDrawDiamond::initialize(const MgMotion* sender, MgStorage* s) 8 | { 9 | return _initialize(MgDiamond::Type(), sender, s); 10 | } 11 | -------------------------------------------------------------------------------- /ios/Classes/TouchVGCore/core/src/cmdbasic/mgdrawellipse.cpp: -------------------------------------------------------------------------------- 1 | // mgdrawellipse.cpp 2 | // Copyright (c) 2004-2015, https://github.com/rhcad/vgcore, BSD License 3 | 4 | #include "mgdrawellipse.h" 5 | #include "mgbasicsps.h" 6 | 7 | bool MgCmdDrawEllipse::initialize(const MgMotion* sender, MgStorage* s) 8 | { 9 | return _initialize(MgEllipse::Type(), sender, s); 10 | } 11 | 12 | bool MgCmdDrawEllipse::draw(const MgMotion* sender, GiGraphics* gs) 13 | { 14 | if (getStep() > 0 && sender->dragging()) { 15 | GiContext ctxshap(0, GiColor(0, 0, 255, 128), GiContext::kDashLine); 16 | gs->drawRect(&ctxshap, dynshape()->shape()->getExtent()); 17 | } 18 | return MgCmdDrawRect::draw(sender, gs); 19 | } 20 | -------------------------------------------------------------------------------- /ios/Classes/TouchVGCore/core/src/cmdbasic/mgdrawgrid.cpp: -------------------------------------------------------------------------------- 1 | // mgdrawgrid.cpp 2 | // Copyright (c) 2004-2015, https://github.com/rhcad/vgcore, BSD License 3 | 4 | #include "mgdrawgrid.h" 5 | #include "mgbasicsps.h" 6 | 7 | bool MgCmdDrawGrid::initialize(const MgMotion* sender, MgStorage* s) 8 | { 9 | return _initialize(MgGrid::Type(), sender, s); 10 | } 11 | 12 | bool MgCmdDrawGrid::draw(const MgMotion* sender, GiGraphics* gs) 13 | { 14 | if (getStep() == 2) { 15 | gs->drawHandle(dynshape()->getHandlePoint(8), kGiHandleVertex); 16 | } 17 | return MgCmdDrawRect::draw(sender, gs); 18 | } 19 | 20 | bool MgCmdDrawGrid::touchBegan(const MgMotion* sender) 21 | { 22 | if (m_step == 0) { 23 | return MgCmdDrawRect::touchBegan(sender); 24 | } 25 | m_step = 3; 26 | return MgCommandDraw::touchBegan(sender); 27 | } 28 | 29 | bool MgCmdDrawGrid::touchMoved(const MgMotion* sender) 30 | { 31 | if (m_step == 1) { 32 | return MgCmdDrawRect::touchMoved(sender); 33 | } 34 | 35 | dynshape()->shape()->setHandlePoint(8, snapPoint(sender), 0); 36 | dynshape()->shape()->update(); 37 | 38 | return MgCommandDraw::touchMoved(sender); 39 | } 40 | 41 | bool MgCmdDrawGrid::touchEnded(const MgMotion* sender) 42 | { 43 | if (m_step == 1) { 44 | return MgCmdDrawRect::touchEnded(sender); 45 | } 46 | 47 | if ( ((MgGrid*)dynshape()->shape())->isValid(sender->displayMmToModel(1.f)) ) { 48 | dynshape()->setContext(GiContext(), GiContext::kFillARGB); 49 | addShape(sender); 50 | m_step = 0; 51 | sender->view->toSelectCommand(); 52 | } 53 | else { 54 | dynshape()->shape()->setHandlePoint(8, dynshape()->getPoint(3), 0); 55 | m_step = 2; 56 | sender->view->showMessage("@invalid_gridcell"); 57 | } 58 | 59 | return MgCommandDraw::touchEnded(sender); 60 | } 61 | 62 | void MgCmdDrawGrid::addRectShape(const MgMotion* sender) 63 | { 64 | m_step = 2; 65 | sender->view->redraw(); 66 | } 67 | -------------------------------------------------------------------------------- /ios/Classes/TouchVGCore/core/src/cmdbasic/mgdrawparallel.cpp: -------------------------------------------------------------------------------- 1 | // mgdrawparallel.cpp: 实现平行四边形绘图命令类 MgCmdParallel 2 | // Copyright (c) 2004-2015, https://github.com/rhcad/vgcore, BSD License 3 | 4 | #include "mgdrawparallel.h" 5 | #include "mgbasicsps.h" 6 | 7 | bool MgCmdParallel::initialize(const MgMotion* sender, MgStorage* s) 8 | { 9 | return _initialize(MgParallel::Type(), sender, s); 10 | } 11 | -------------------------------------------------------------------------------- /ios/Classes/TouchVGCore/core/src/cmdbasic/mgdrawpolygon.cpp: -------------------------------------------------------------------------------- 1 | // mgdrawpolygon.cpp: 实现多边形绘图命令类 MgCmdDrawPolygon 2 | // Copyright (c) 2004-2015, https://github.com/rhcad/vgcore, BSD License 3 | 4 | #include "mgdrawpolygon.h" 5 | #include "mgbasicsps.h" 6 | 7 | bool MgCmdDrawPolygon::initialize(const MgMotion* sender, MgStorage* s) 8 | { 9 | _initialize(MgLines::Type(), sender); 10 | 11 | ((MgBaseLines*)dynshape()->shape())->setClosed(true); 12 | 13 | return _initialize(0, sender, s); 14 | } 15 | -------------------------------------------------------------------------------- /ios/Classes/TouchVGCore/core/src/cmdbasic/mgdrawsquare.cpp: -------------------------------------------------------------------------------- 1 | // mgdrawsquare.cpp: 实现正方形绘图命令类 MgCmdDrawSquare 2 | // Copyright (c) 2004-2015, https://github.com/rhcad/vgcore, BSD License 3 | 4 | #include "mgdrawsquare.h" 5 | #include "mgbasicsps.h" 6 | 7 | bool MgCmdDrawSquare::initialize(const MgMotion* sender, MgStorage* s) 8 | { 9 | _initialize(MgRect::Type(), sender); 10 | 11 | ((MgBaseRect*)dynshape()->shape())->setSquare(true); 12 | 13 | return _initialize(0, sender, s); 14 | } 15 | -------------------------------------------------------------------------------- /ios/Classes/TouchVGCore/core/src/cmdbasic/mgdrawtriang.cpp: -------------------------------------------------------------------------------- 1 | // mgdrawtriang.cpp 2 | // Copyright (c) 2004-2015, https://github.com/rhcad/vgcore, BSD License 3 | 4 | #include "mgdrawtriang.h" 5 | #include "mgbasicsps.h" 6 | 7 | bool MgCmdDrawTriangle::initialize(const MgMotion* sender, MgStorage* s) 8 | { 9 | return _initialize(MgLines::Type(), sender, s); 10 | } 11 | 12 | bool MgCmdDrawTriangle::touchBegan(const MgMotion* sender) 13 | { 14 | MgBaseLines* lines = (MgBaseLines*)dynshape()->shape(); 15 | 16 | if (0 == m_step) { 17 | m_step = 1; 18 | lines->setClosed(true); 19 | lines->resize(3); 20 | Point2d pnt(snapPoint(sender, true)); 21 | for (int i = 0; i < 3; i++) { 22 | dynshape()->shape()->setPoint(i, pnt); 23 | } 24 | } 25 | else { 26 | dynshape()->shape()->setPoint(m_step, snapPoint(sender)); 27 | } 28 | 29 | dynshape()->shape()->update(); 30 | 31 | return MgCommandDraw::touchBegan(sender); 32 | } 33 | 34 | bool MgCmdDrawTriangle::touchMoved(const MgMotion* sender) 35 | { 36 | dynshape()->shape()->setPoint(m_step, snapPoint(sender)); 37 | dynshape()->shape()->update(); 38 | 39 | return MgCommandDraw::touchMoved(sender); 40 | } 41 | 42 | bool MgCmdDrawTriangle::touchEnded(const MgMotion* sender) 43 | { 44 | float distmin = sender->displayMmToModel(2.f); 45 | Point2d lastpt(dynshape()->getPoint(m_step - 1)); 46 | 47 | if (dynshape()->getPoint(m_step).distanceTo(lastpt) > distmin) { 48 | m_step++; 49 | if (3 == m_step) { 50 | addShape(sender); 51 | m_step = 0; 52 | } 53 | } 54 | 55 | return MgCommandDraw::touchEnded(sender); 56 | } 57 | -------------------------------------------------------------------------------- /ios/Classes/TouchVGCore/core/src/corever.h: -------------------------------------------------------------------------------- 1 | // COREVERSION is used by GiCoreView::getVersion(). 2 | // TODO: change COREVERSION after any change 3 | 4 | #define COREVERSION 65 5 | -------------------------------------------------------------------------------- /ios/Classes/TouchVGCore/core/src/geom/mgpnt.cpp: -------------------------------------------------------------------------------- 1 | // mgpnt.cpp 2 | // Copyright (c) 2004-2015, https://github.com/rhcad/vgcore, BSD License 3 | 4 | #include "mgpnt.h" 5 | 6 | #if !defined(NAN) && defined(_WIN32) 7 | static const unsigned long __nan[2] = {0xffffffff, 0x7fffffff}; 8 | #define NAN (*(const float *) __nan) 9 | #endif 10 | 11 | const Point2d Point2d::kInvalid() { return Point2d(NAN, NAN); } 12 | 13 | Point2d Point2d::rulerPoint(const Point2d& dir, float yoff) const 14 | { 15 | float len = distanceTo(dir); 16 | if (len < _MGZERO) { 17 | return Point2d(x, y + yoff); 18 | } 19 | yoff /= len; 20 | return Point2d(x - (dir.y - y) * yoff, y + (dir.x - x) * yoff); 21 | } 22 | 23 | Point2d Point2d::rulerPoint(const Point2d& dir, float xoff, float yoff) const 24 | { 25 | float len = distanceTo(dir); 26 | if (len < _MGZERO) 27 | return Point2d(x + xoff, y + yoff); 28 | float dcos = (dir.x - x) / len; 29 | float dsin = (dir.y - y) / len; 30 | return Point2d(x + xoff * dcos - yoff * dsin, 31 | y + xoff * dsin + yoff * dcos); 32 | } 33 | -------------------------------------------------------------------------------- /ios/Classes/TouchVGCore/core/src/gshape/mgdot.cpp: -------------------------------------------------------------------------------- 1 | // mgdot.cpp 2 | // Copyright (c) 2004-2015, https://github.com/rhcad/vgcore, BSD License 3 | 4 | #include "mgdot.h" 5 | #include "mgshape_.h" 6 | 7 | MG_IMPLEMENT_CREATE(MgDot) 8 | 9 | MgDot::MgDot() : _type(0) 10 | { 11 | } 12 | 13 | MgDot::~MgDot() 14 | { 15 | } 16 | 17 | int MgDot::_getPointCount() const 18 | { 19 | return 1; 20 | } 21 | 22 | Point2d MgDot::_getPoint(int) const 23 | { 24 | return _point; 25 | } 26 | 27 | void MgDot::_setPoint(int, const Point2d& pt) 28 | { 29 | _point = pt; 30 | } 31 | 32 | void MgDot::_copy(const MgDot& src) 33 | { 34 | _point = src._point; 35 | _type = src._type; 36 | __super::_copy(src); 37 | } 38 | 39 | bool MgDot::_equals(const MgDot& src) const 40 | { 41 | return (_point == src._point && _type == src._type && __super::_equals(src)); 42 | } 43 | 44 | void MgDot::_update() 45 | { 46 | _extent.set(_point, 0.1f, 0.f); 47 | __super::_update(); 48 | } 49 | 50 | void MgDot::_transform(const Matrix2d& mat) 51 | { 52 | _point *= mat; 53 | __super::_transform(mat); 54 | } 55 | 56 | void MgDot::_clear() 57 | { 58 | _point = Point2d::kOrigin(); 59 | __super::_clear(); 60 | } 61 | 62 | float MgDot::_hitTest(const Point2d& pt, float, MgHitResult& res) const 63 | { 64 | res.nearpt = _point; 65 | return pt.distanceTo(_point); 66 | } 67 | 68 | void MgDot::_output(MgPath&) const 69 | { 70 | } 71 | 72 | bool MgDot::_save(MgStorage* s) const 73 | { 74 | bool ret = __super::_save(s); 75 | s->writeInt("ptype", _type); 76 | s->writeFloat("x", _point.x); 77 | s->writeFloat("y", _point.y); 78 | return ret; 79 | } 80 | 81 | bool MgDot::_load(MgShapeFactory* factory, MgStorage* s) 82 | { 83 | bool ret = __super::_load(factory, s); 84 | _type = s->readInt("ptype", _type); 85 | _point.set(s->readFloat("x", _point.x), s->readFloat("y", _point.y)); 86 | return ret; 87 | } 88 | -------------------------------------------------------------------------------- /ios/Classes/TouchVGCore/core/src/jsonstorage/rapidjson/filestream.h: -------------------------------------------------------------------------------- 1 | #ifndef RAPIDJSON_FILESTREAM_H_ 2 | #define RAPIDJSON_FILESTREAM_H_ 3 | 4 | #include 5 | 6 | namespace rapidjson { 7 | 8 | //! Wrapper of C file stream for input or output. 9 | /*! 10 | This simple wrapper does not check the validity of the stream. 11 | \implements Stream 12 | */ 13 | class FileStream { 14 | public: 15 | typedef char Ch; //!< Character type. Only support char. 16 | 17 | FileStream(FILE* fp) : fp_(fp), count_(0) { Read(); } 18 | char Peek() const { return current_; } 19 | char Take() { char c = current_; Read(); return c; } 20 | size_t Tell() const { return count_; } 21 | void Put(char c) { fputc(c, fp_); } 22 | 23 | // Not implemented 24 | char* PutBegin() { return 0; } 25 | size_t PutEnd(char*) { return 0; } 26 | 27 | private: 28 | void Read() { 29 | RAPIDJSON_ASSERT(fp_ != 0); 30 | int c = fgetc(fp_); 31 | if (c != EOF) { 32 | current_ = (char)c; 33 | count_++; 34 | } 35 | else 36 | current_ = '\0'; 37 | } 38 | 39 | FILE* fp_; 40 | char current_; 41 | size_t count_; 42 | }; 43 | 44 | } // namespace rapidjson 45 | 46 | #endif // RAPIDJSON_FILESTREAM_H_ 47 | -------------------------------------------------------------------------------- /ios/Classes/TouchVGCore/core/src/jsonstorage/rapidjson/internal/strfunc.h: -------------------------------------------------------------------------------- 1 | #ifndef RAPIDJSON_INTERNAL_STRFUNC_H_ 2 | #define RAPIDJSON_INTERNAL_STRFUNC_H_ 3 | 4 | namespace rapidjson { 5 | namespace internal { 6 | 7 | //! Custom strlen() which works on different character types. 8 | /*! \tparam Ch Character type (e.g. char, wchar_t, short) 9 | \param s Null-terminated input string. 10 | \return Number of characters in the string. 11 | \note This has the same semantics as strlen(), the return value is not number of Unicode codepoints. 12 | */ 13 | template 14 | inline SizeType StrLen(const Ch* s) { 15 | const Ch* p = s; 16 | while (*p != '\0') 17 | ++p; 18 | return SizeType(p - s); 19 | } 20 | 21 | } // namespace internal 22 | } // namespace rapidjson 23 | 24 | #endif // RAPIDJSON_INTERNAL_STRFUNC_H_ 25 | -------------------------------------------------------------------------------- /ios/Classes/TouchVGCore/core/src/jsonstorage/rapidjson/stringbuffer.h: -------------------------------------------------------------------------------- 1 | #ifndef RAPIDJSON_STRINGBUFFER_H_ 2 | #define RAPIDJSON_STRINGBUFFER_H_ 3 | 4 | #include "rapidjson.h" 5 | #include "internal/stack.h" 6 | 7 | namespace rapidjson { 8 | 9 | //! Represents an in-memory output stream. 10 | /*! 11 | \tparam Encoding Encoding of the stream. 12 | \tparam Allocator type for allocating memory buffer. 13 | \implements Stream 14 | */ 15 | template 16 | struct GenericStringBuffer { 17 | typedef typename Encoding::Ch Ch; 18 | 19 | GenericStringBuffer(Allocator* allocator = 0, size_t capacity = kDefaultCapacity) : stack_(allocator, capacity) {} 20 | 21 | void Put(Ch c) { *stack_.template Push() = c; } 22 | 23 | void Clear() { stack_.Clear(); } 24 | 25 | const char* GetString() const { 26 | // Push and pop a null terminator. This is safe. 27 | *stack_.template Push() = '\0'; 28 | stack_.template Pop(1); 29 | 30 | return stack_.template Bottom(); 31 | } 32 | 33 | size_t Size() const { return stack_.GetSize(); } 34 | 35 | static const size_t kDefaultCapacity = 256; 36 | mutable internal::Stack stack_; 37 | }; 38 | 39 | typedef GenericStringBuffer > StringBuffer; 40 | 41 | //! Implement specialized version of PutN() with memset() for better performance. 42 | template<> 43 | inline void PutN(GenericStringBuffer >& stream, char c, size_t n) { 44 | memset(stream.stack_.Push(n), c, n * sizeof(c)); 45 | } 46 | 47 | } // namespace rapidjson 48 | 49 | #endif // RAPIDJSON_STRINGBUFFER_H_ 50 | -------------------------------------------------------------------------------- /ios/Classes/TouchVGCore/core/src/shapedoc/mglayer.cpp: -------------------------------------------------------------------------------- 1 | //! \file mglayer.cpp 2 | //! \brief 实现图形文档 MgLayer 3 | // Copyright (c) 2004-2015, https://github.com/rhcad/vgcore, BSD License 4 | 5 | #include "mglayer.h" 6 | #include "mgshapedoc.h" 7 | #include "mgstorage.h" 8 | 9 | MgLayer::MgLayer(MgShapeDoc* doc, int index) : MgShapes(doc, index), _flags(0) 10 | { 11 | } 12 | 13 | MgLayer::~MgLayer() 14 | { 15 | } 16 | 17 | MgLayer* MgLayer::create(MgShapeDoc* doc, int index) 18 | { 19 | return new MgLayer(doc, index); 20 | } 21 | 22 | void MgLayer::release() 23 | { 24 | delete this; 25 | } 26 | 27 | MgShapeDoc* MgLayer::doc() const 28 | { 29 | return (MgShapeDoc*)getOwner(); 30 | } 31 | 32 | MgObject* MgLayer::clone() const 33 | { 34 | MgObject* p = new MgLayer(doc(), -1); 35 | p->copy(*this); 36 | return p; 37 | } 38 | 39 | void MgLayer::copy(const MgObject& src) 40 | { 41 | MgShapes::copy(src); 42 | if (src.isKindOf(Type())) { 43 | const MgLayer& layer = (const MgLayer&)src; 44 | _flags = layer._flags; 45 | } 46 | } 47 | 48 | bool MgLayer::equals(const MgObject& src) const 49 | { 50 | if (src.isKindOf(Type()) && MgShapes::equals(src)) { 51 | const MgLayer& layer = (const MgLayer&)src; 52 | return _flags == layer._flags; 53 | } 54 | return false; 55 | } 56 | 57 | bool MgLayer::saveExtra(MgStorage* s) const 58 | { 59 | s->writeUInt("flags", _flags); 60 | return true; 61 | } 62 | 63 | bool MgLayer::loadExtra(MgStorage* s) 64 | { 65 | _flags = s->readInt("flags", _flags); 66 | return true; 67 | } 68 | -------------------------------------------------------------------------------- /ios/Classes/TouchVGCore/core/src/shapedoc/spfactoryimpl.cpp: -------------------------------------------------------------------------------- 1 | //! \file spfactoryimpl.cpp 2 | //! \brief 实现图形工厂接口的默认实现类 MgShapeFactoryImpl 3 | // Copyright (c) 2013, Zhang Yungui 4 | // Copyright (c) 2004-2015, https://github.com/rhcad/vgcore, BSD License 5 | 6 | #include "spfactoryimpl.h" 7 | #include "mgbasicspreg.h" 8 | #include "mgshape.h" 9 | 10 | MgShapeFactoryImpl::MgShapeFactoryImpl() 11 | { 12 | MgBasicShapes::registerShapes(this); 13 | } 14 | 15 | MgShapeFactoryImpl::~MgShapeFactoryImpl() 16 | { 17 | } 18 | 19 | void MgShapeFactoryImpl::registerShape(int type, MgShape* (*creator)()) 20 | { 21 | type = type & 0xFFFF; 22 | if (creator) { 23 | _shapeCreators[type] = creator; 24 | } else { 25 | _shapeCreators.erase(type); 26 | } 27 | } 28 | 29 | MgShape* MgShapeFactoryImpl::createShape(int type) 30 | { 31 | std::map::const_iterator it = _shapeCreators.find(type & 0xFFFF); 32 | return it != _shapeCreators.end() ? (it->second)() : MgShape::Null(); 33 | } 34 | -------------------------------------------------------------------------------- /ios/Classes/TouchVGCore/core/src/view/GcGraphView.h: -------------------------------------------------------------------------------- 1 | //! \file GcGraphView.h 2 | //! \brief 定义主绘图视图类 GcGraphView 3 | // Copyright (c) 2004-2015, https://github.com/rhcad/vgcore, BSD License 4 | 5 | #ifndef TOUCHVG_CORE_MAINVIEW_H 6 | #define TOUCHVG_CORE_MAINVIEW_H 7 | 8 | #include "GcBaseView.h" 9 | 10 | //! 主绘图视图类 11 | /*! \ingroup CORE_VIEW 12 | */ 13 | class GcGraphView : public GcBaseView 14 | { 15 | public: 16 | GcGraphView(MgView* mgview, GiView *view); 17 | virtual ~GcGraphView(); 18 | 19 | virtual void draw(GiGraphics& gs); 20 | }; 21 | 22 | #endif // TOUCHVG_CORE_MAINVIEW_H 23 | -------------------------------------------------------------------------------- /ios/Classes/TouchVGCore/core/src/view/GcMagnifierView.cpp: -------------------------------------------------------------------------------- 1 | // GcMagnifierView.cpp 2 | // Copyright (c) 2004-2015, https://github.com/rhcad/vgcore, BSD License 3 | 4 | #include "GcMagnifierView.h" 5 | 6 | GcMagnifierView::GcMagnifierView(MgView* mgview, GiView *view, GcGraphView* mainView) 7 | : GcBaseView(mgview, view), _mainView(mainView) 8 | { 9 | } 10 | 11 | GcMagnifierView::~GcMagnifierView() 12 | { 13 | } 14 | -------------------------------------------------------------------------------- /ios/Classes/TouchVGCore/core/src/view/GcMagnifierView.h: -------------------------------------------------------------------------------- 1 | //! \file GcMagnifierView.h 2 | //! \brief 定义放大镜视图类 GcMagnifierView 3 | // Copyright (c) 2004-2015, https://github.com/rhcad/vgcore, BSD License 4 | 5 | #ifndef TOUCHVG_CORE_MAGNIFIERVIEW_H 6 | #define TOUCHVG_CORE_MAGNIFIERVIEW_H 7 | 8 | #include "GcGraphView.h" 9 | 10 | //! 放大镜视图类 11 | /*! \ingroup CORE_VIEW 12 | */ 13 | class GcMagnifierView : public GcBaseView 14 | { 15 | public: 16 | GcMagnifierView(MgView* mgview, GiView *view, GcGraphView* mainView); 17 | virtual ~GcMagnifierView(); 18 | 19 | GcGraphView* getMainView() const { return _mainView; } 20 | 21 | private: 22 | GcGraphView* _mainView; 23 | }; 24 | 25 | #endif // TOUCHVG_CORE_MAGNIFIERVIEW_H 26 | -------------------------------------------------------------------------------- /ios/Classes/TouchVGCore/core/src/view/GcShapeDoc.cpp: -------------------------------------------------------------------------------- 1 | // GcShapeDoc.cpp 2 | // Copyright (c) 2004-2015, https://github.com/rhcad/vgcore, BSD License 3 | 4 | #include "GcShapeDoc.h" 5 | #include "GcBaseView.h" 6 | 7 | GcShapeDoc::GcShapeDoc() 8 | { 9 | } 10 | 11 | GcShapeDoc::~GcShapeDoc() 12 | { 13 | } 14 | 15 | bool GcShapeDoc::addView(GcBaseView* view) 16 | { 17 | if (view && view->deviceView() && view->cmdView()->document() == this 18 | && !findView(view->deviceView())) { 19 | _views.push_back(view); 20 | return true; 21 | } 22 | return false; 23 | } 24 | 25 | bool GcShapeDoc::removeView(GcBaseView* view) 26 | { 27 | std::vector::iterator it; 28 | 29 | for (it = _views.begin(); it != _views.end(); ++it) { 30 | if (*it == view) { 31 | _views.erase(it); 32 | return true; 33 | } 34 | } 35 | return false; 36 | } 37 | 38 | GcBaseView* GcShapeDoc::findView(GiView* view) const 39 | { 40 | std::vector::const_iterator it; 41 | 42 | for (it = _views.begin(); it != _views.end(); ++it) { 43 | if ((*it)->deviceView() == view) { 44 | return *it; 45 | } 46 | } 47 | return (GcBaseView*)0; 48 | } 49 | 50 | GcBaseView* GcShapeDoc::getView(int index) const 51 | { 52 | return index >= 0 && index < getViewCount() ? _views[index] : (GcBaseView*)0; 53 | } 54 | 55 | int GcShapeDoc::getViewCount() const 56 | { 57 | return (int)_views.size(); 58 | } 59 | 60 | GcBaseView* GcShapeDoc::firstView() const 61 | { 62 | return !_views.empty() ? _views.front() : (GcBaseView*)0; 63 | } 64 | -------------------------------------------------------------------------------- /ios/Classes/TouchVGCore/core/src/view/GcShapeDoc.h: -------------------------------------------------------------------------------- 1 | //! \file GcShapeDoc.h 2 | //! \brief 定义图形文档类 GcShapeDoc 3 | // Copyright (c) 2004-2015, https://github.com/rhcad/vgcore, BSD License 4 | 5 | #ifndef TOUCHVG_CORE_SHAPEDOC_H 6 | #define TOUCHVG_CORE_SHAPEDOC_H 7 | 8 | #include 9 | 10 | class GcBaseView; 11 | class GiView; 12 | class MgShapeDoc; 13 | 14 | //! 图形文档类 15 | /*! \ingroup CORE_VIEW 16 | */ 17 | class GcShapeDoc 18 | { 19 | public: 20 | GcShapeDoc(); 21 | ~GcShapeDoc(); 22 | 23 | bool addView(GcBaseView* view); 24 | bool removeView(GcBaseView* view); 25 | GcBaseView* findView(GiView* view) const; 26 | GcBaseView* getView(int index) const; 27 | int getViewCount() const; 28 | GcBaseView* firstView() const; 29 | 30 | private: 31 | std::vector _views; 32 | }; 33 | 34 | #endif // TOUCHVG_CORE_SHAPEDOC_H 35 | -------------------------------------------------------------------------------- /ios/flutter_touchvg.podspec: -------------------------------------------------------------------------------- 1 | # 2 | # To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html 3 | # 4 | Pod::Spec.new do |s| 5 | s.name = 'flutter_touchvg' 6 | s.version = '0.0.1' 7 | s.summary = 'A new Flutter plugin.' 8 | s.description = <<-DESC 9 | A new Flutter plugin. 10 | DESC 11 | s.homepage = 'http://example.com' 12 | s.license = { :file => '../LICENSE' } 13 | s.author = { 'Your Company' => 'email@example.com' } 14 | s.source = { :path => '.' } 15 | s.source_files = 'Classes/**/*' 16 | s.public_header_files = 'Classes/**/*.h' 17 | s.resources = "Classes/TouchVG/TouchVG.bundle" 18 | s.dependency 'Flutter' 19 | 20 | s.ios.deployment_target = '8.0' 21 | end 22 | 23 | -------------------------------------------------------------------------------- /pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: flutter_touchvg 2 | description: A new Flutter plugin. 3 | version: 0.0.1 4 | author: 5 | homepage: 6 | 7 | environment: 8 | sdk: ">=2.0.0-dev.68.0 <3.0.0" 9 | 10 | dependencies: 11 | flutter: 12 | sdk: flutter 13 | 14 | # For information on the generic Dart part of this file, see the 15 | # following page: https://www.dartlang.org/tools/pub/pubspec 16 | 17 | # The following section is specific to Flutter. 18 | flutter: 19 | # This section identifies this Flutter project as a plugin project. 20 | # The androidPackage and pluginClass identifiers should not ordinarily 21 | # be modified. They are used by the tooling to maintain consistency when 22 | # adding or updating assets for this project. 23 | plugin: 24 | androidPackage: com.cloudwebrtc.fluttertouchvg 25 | pluginClass: FlutterTouchvgPlugin 26 | 27 | # To add assets to your plugin package, add an assets section, like this: 28 | # assets: 29 | # - images/a_dot_burr.jpeg 30 | # - images/a_dot_ham.jpeg 31 | # 32 | # For details regarding assets in packages, see 33 | # https://flutter.io/assets-and-images/#from-packages 34 | # 35 | # An image asset can refer to one or more resolution-specific "variants", see 36 | # https://flutter.io/assets-and-images/#resolution-aware. 37 | 38 | # To add custom fonts to your plugin package, add a fonts section here, 39 | # in this "flutter" section. Each entry in this list should have a 40 | # "family" key with the font family name, and a "fonts" key with a 41 | # list giving the asset and other descriptors for the font. For 42 | # example: 43 | # fonts: 44 | # - family: Schyler 45 | # fonts: 46 | # - asset: fonts/Schyler-Regular.ttf 47 | # - asset: fonts/Schyler-Italic.ttf 48 | # style: italic 49 | # - family: Trajan Pro 50 | # fonts: 51 | # - asset: fonts/TrajanPro.ttf 52 | # - asset: fonts/TrajanPro_Bold.ttf 53 | # weight: 700 54 | # 55 | # For details regarding fonts in packages, see 56 | # https://flutter.io/custom-fonts/#from-packages 57 | -------------------------------------------------------------------------------- /screenshots/android.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kangshaojun/flutter_touchvg/ccd4dc2c910e5aa6f9fff230af6de3be7a8da082/screenshots/android.png -------------------------------------------------------------------------------- /screenshots/ios.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kangshaojun/flutter_touchvg/ccd4dc2c910e5aa6f9fff230af6de3be7a8da082/screenshots/ios.png --------------------------------------------------------------------------------