├── .gitattributes ├── .github ├── ISSUE_TEMPLATE.md ├── ISSUE_TEMPLATE │ ├── BUG_REPORT.yml │ └── config.yml ├── actions │ ├── create-package │ │ ├── action.yml │ │ └── create-package.sh │ ├── install-dependencies │ │ ├── action.yml │ │ └── install-dependencies.sh │ └── setup-environment │ │ ├── action.yml │ │ ├── setup-environment.sh │ │ └── setup-versions.sh └── workflows │ ├── ci.yml │ └── docs.yml ├── .gitignore ├── .tx └── config ├── CODE_OF_CONDUCT.md ├── ChangeLog.md ├── Doxyfile ├── LICENSE.QT.TXT ├── LICENSE.TXT ├── README.md ├── app ├── app.pro ├── data │ ├── Info.plist │ ├── _pencil2d │ ├── app.qrc │ ├── background │ │ ├── checkerboard.png │ │ ├── dots.png │ │ ├── grid.jpg │ │ └── weave.jpg │ ├── icons │ │ ├── blue.png │ │ ├── general │ │ │ ├── checkerboard_smaller.png │ │ │ ├── cross.png │ │ │ ├── cursor-brush.svg │ │ │ ├── cursor-bucket.svg │ │ │ ├── cursor-diagonal-left.svg │ │ │ ├── cursor-diagonal-right.svg │ │ │ ├── cursor-eyedropper.svg │ │ │ ├── cursor-horizontal.svg │ │ │ ├── cursor-move.svg │ │ │ ├── cursor-pen.svg │ │ │ ├── cursor-pencil.svg │ │ │ ├── cursor-rotate.svg │ │ │ ├── cursor-smudge-liquify.svg │ │ │ ├── cursor-smudge.svg │ │ │ └── cursor-vertical.svg │ │ ├── green.png │ │ ├── icon.png │ │ ├── logo.png │ │ ├── mac_pcl_icon.icns │ │ ├── mac_pcl_icon.xcf │ │ ├── mac_pclx_icon.icns │ │ ├── red.png │ │ └── themes │ │ │ └── playful │ │ │ ├── controls │ │ │ ├── control-loop.svg │ │ │ ├── control-play-end.svg │ │ │ ├── control-play-start.svg │ │ │ ├── control-play.svg │ │ │ ├── control-sound-enable.svg │ │ │ ├── control-sound-scrub.svg │ │ │ └── control-stop.svg │ │ │ ├── dialog-error.svg │ │ │ ├── display │ │ │ ├── lines-invisible.svg │ │ │ ├── lines-outline.svg │ │ │ ├── mirror-horizontal.svg │ │ │ ├── mirror-vertical.svg │ │ │ ├── overlay-center.svg │ │ │ ├── overlay-golden-ratio.svg │ │ │ ├── overlay-grid.svg │ │ │ ├── overlay-safe.svg │ │ │ ├── overlay-thirds.svg │ │ │ ├── perspective-angle.svg │ │ │ ├── perspective-onepoint.svg │ │ │ ├── perspective-threepoints.svg │ │ │ └── perspective-twopoints.svg │ │ │ ├── menubar │ │ │ ├── clear-canvas.svg │ │ │ ├── copy.svg │ │ │ ├── cut.svg │ │ │ ├── new.svg │ │ │ ├── open.svg │ │ │ ├── paste.svg │ │ │ ├── redo.svg │ │ │ ├── save.svg │ │ │ ├── undo.svg │ │ │ ├── view-reset.svg │ │ │ ├── zoom-in.svg │ │ │ ├── zoom-out.svg │ │ │ └── zoom-select.svg │ │ │ ├── misc │ │ │ ├── add-color.svg │ │ │ ├── color-dialog.svg │ │ │ ├── more-options.svg │ │ │ └── remove-color.svg │ │ │ ├── onion │ │ │ ├── onionskin-blue.svg │ │ │ ├── onionskin-enable.svg │ │ │ └── onionskin-red.svg │ │ │ ├── preferences │ │ │ ├── preferences-files.svg │ │ │ ├── preferences-general.svg │ │ │ ├── preferences-shortcuts.svg │ │ │ ├── preferences-timeline.svg │ │ │ └── preferences-tools.svg │ │ │ ├── timeline │ │ │ ├── cell-bitmap.svg │ │ │ ├── cell-camera.svg │ │ │ ├── cell-sound.svg │ │ │ ├── cell-vector.svg │ │ │ ├── frame-add.svg │ │ │ ├── frame-duplicate.svg │ │ │ ├── frame-remove.svg │ │ │ ├── layer-add.svg │ │ │ ├── layer-duplicate.svg │ │ │ └── layer-remove.svg │ │ │ └── tools │ │ │ ├── tool-brush.svg │ │ │ ├── tool-bucket.svg │ │ │ ├── tool-camera-move.svg │ │ │ ├── tool-camera-rotate.svg │ │ │ ├── tool-camera-scale.svg │ │ │ ├── tool-eraser.svg │ │ │ ├── tool-eyedropper.svg │ │ │ ├── tool-hand.svg │ │ │ ├── tool-move.svg │ │ │ ├── tool-pen.svg │ │ │ ├── tool-pencil.svg │ │ │ ├── tool-polyline.svg │ │ │ ├── tool-select.svg │ │ │ └── tool-smudge.svg │ ├── mui.rc │ ├── org.pencil2d.Pencil2D.desktop │ ├── org.pencil2d.Pencil2D.metainfo.xml │ ├── org.pencil2d.Pencil2D.png │ ├── org.pencil2d.Pencil2D.xml │ ├── pencil2d │ ├── pencil2d.VisualElementsManifest.xml │ ├── pencil2d.icns │ ├── pencil2d.ico │ ├── pencil2d_quick_guide.pdf │ ├── resources.xml │ ├── resources │ │ ├── tile150.scale-100.png │ │ ├── tile150.scale-140.png │ │ ├── tile150.scale-180.png │ │ ├── tile150.scale-80.png │ │ ├── tile70.scale-100.png │ │ ├── tile70.scale-140.png │ │ ├── tile70.scale-180.png │ │ └── tile70.scale-80.png │ └── version.rc ├── src │ ├── aboutdialog.cpp │ ├── aboutdialog.h │ ├── actioncommands.cpp │ ├── actioncommands.h │ ├── addtransparencytopaperdialog.cpp │ ├── addtransparencytopaperdialog.h │ ├── app-pch.h │ ├── app_util.cpp │ ├── app_util.h │ ├── basedockwidget.cpp │ ├── basedockwidget.h │ ├── bucketoptionswidget.cpp │ ├── bucketoptionswidget.h │ ├── cameracontextmenu.cpp │ ├── cameracontextmenu.h │ ├── cameraoptionswidget.cpp │ ├── cameraoptionswidget.h │ ├── camerapropertiesdialog.cpp │ ├── camerapropertiesdialog.h │ ├── checkupdatesdialog.cpp │ ├── checkupdatesdialog.h │ ├── colorbox.cpp │ ├── colorbox.h │ ├── colorinspector.cpp │ ├── colorinspector.h │ ├── colorpalettewidget.cpp │ ├── colorpalettewidget.h │ ├── colorslider.cpp │ ├── colorslider.h │ ├── colorwheel.cpp │ ├── colorwheel.h │ ├── commandlineexporter.cpp │ ├── commandlineexporter.h │ ├── commandlineparser.cpp │ ├── commandlineparser.h │ ├── doubleprogressdialog.cpp │ ├── doubleprogressdialog.h │ ├── elidedlabel.cpp │ ├── elidedlabel.h │ ├── errordialog.cpp │ ├── errordialog.h │ ├── exportimagedialog.cpp │ ├── exportimagedialog.h │ ├── exportmoviedialog.cpp │ ├── exportmoviedialog.h │ ├── filedialog.cpp │ ├── filedialog.h │ ├── filespage.cpp │ ├── filespage.h │ ├── generalpage.cpp │ ├── generalpage.h │ ├── importexportdialog.cpp │ ├── importexportdialog.h │ ├── importimageseqdialog.cpp │ ├── importimageseqdialog.h │ ├── importlayersdialog.cpp │ ├── importlayersdialog.h │ ├── importpositiondialog.cpp │ ├── importpositiondialog.h │ ├── layeropacitydialog.cpp │ ├── layeropacitydialog.h │ ├── main.cpp │ ├── mainwindow2.cpp │ ├── mainwindow2.h │ ├── onionskinwidget.cpp │ ├── onionskinwidget.h │ ├── pegbaralignmentdialog.cpp │ ├── pegbaralignmentdialog.h │ ├── pencil2d.cpp │ ├── pencil2d.h │ ├── popupcolorpalettewidget.cpp │ ├── popupcolorpalettewidget.h │ ├── predefinedsetmodel.cpp │ ├── predefinedsetmodel.h │ ├── preferencesdialog.cpp │ ├── preferencesdialog.h │ ├── presetdialog.cpp │ ├── presetdialog.h │ ├── repositionframesdialog.cpp │ ├── repositionframesdialog.h │ ├── shortcutfilter.cpp │ ├── shortcutfilter.h │ ├── shortcutspage.cpp │ ├── shortcutspage.h │ ├── spinslider.cpp │ ├── spinslider.h │ ├── statusbar.cpp │ ├── statusbar.h │ ├── timecontrols.cpp │ ├── timecontrols.h │ ├── timeline.cpp │ ├── timeline.h │ ├── timelinecells.cpp │ ├── timelinecells.h │ ├── timelinepage.cpp │ ├── timelinepage.h │ ├── toolbox.cpp │ ├── toolbox.h │ ├── tooloptionwidget.cpp │ ├── tooloptionwidget.h │ ├── toolspage.cpp │ └── toolspage.h ├── translations │ ├── mui.pot │ ├── mui_cs.po │ ├── mui_de.po │ ├── mui_it.po │ ├── mui_yue.po │ ├── mui_zh_CN.po │ └── mui_zh_TW.po └── ui │ ├── aboutdialog.ui │ ├── addtransparencytopaperdialog.ui │ ├── bucketoptionswidget.ui │ ├── cameraoptionswidget.ui │ ├── camerapropertiesdialog.ui │ ├── colorinspector.ui │ ├── colorpalette.ui │ ├── doubleprogressdialog.ui │ ├── errordialog.ui │ ├── exportimageoptions.ui │ ├── exportmovieoptions.ui │ ├── filespage.ui │ ├── generalpage.ui │ ├── importexportdialog.ui │ ├── importimageseqoptions.ui │ ├── importimageseqpreview.ui │ ├── importlayersdialog.ui │ ├── importpositiondialog.ui │ ├── layeropacitydialog.ui │ ├── mainwindow2.ui │ ├── onionskin.ui │ ├── pegbaralignmentdialog.ui │ ├── preferencesdialog.ui │ ├── presetdialog.ui │ ├── repositionframesdialog.ui │ ├── shortcutspage.ui │ ├── timelinepage.ui │ ├── toolboxwidget.ui │ ├── tooloptions.ui │ └── toolspage.ui ├── core_lib ├── core_lib.pro ├── data │ ├── core_lib.qrc │ ├── icons │ │ ├── brush.png │ │ ├── bucketTool.png │ │ ├── eyedropper.png │ │ ├── liquify.png │ │ ├── pen.png │ │ ├── pencil2.png │ │ └── smudge.png │ └── resources │ │ └── kb.ini └── src │ ├── activeframepool.cpp │ ├── activeframepool.h │ ├── camerapainter.cpp │ ├── camerapainter.h │ ├── canvascursorpainter.cpp │ ├── canvascursorpainter.h │ ├── canvaspainter.cpp │ ├── canvaspainter.h │ ├── corelib-pch.h │ ├── external │ ├── linux │ │ └── linux.cpp │ ├── macosx │ │ ├── macosx.cpp │ │ ├── macosxnative.h │ │ └── macosxnative.mm │ ├── platformhandler.h │ └── win32 │ │ └── win32.cpp │ ├── graphics │ ├── bitmap │ │ ├── bitmapbucket.cpp │ │ ├── bitmapbucket.h │ │ ├── bitmapimage.cpp │ │ ├── bitmapimage.h │ │ ├── tile.cpp │ │ ├── tile.h │ │ ├── tiledbuffer.cpp │ │ └── tiledbuffer.h │ └── vector │ │ ├── bezierarea.cpp │ │ ├── bezierarea.h │ │ ├── beziercurve.cpp │ │ ├── beziercurve.h │ │ ├── colorref.cpp │ │ ├── colorref.h │ │ ├── vectorimage.cpp │ │ ├── vectorimage.h │ │ ├── vectorselection.cpp │ │ ├── vectorselection.h │ │ ├── vertexref.cpp │ │ └── vertexref.h │ ├── interface │ ├── backgroundwidget.cpp │ ├── backgroundwidget.h │ ├── editor.cpp │ ├── editor.h │ ├── flowlayout.cpp │ ├── flowlayout.h │ ├── legacybackupelement.cpp │ ├── legacybackupelement.h │ ├── recentfilemenu.cpp │ ├── recentfilemenu.h │ ├── scribblearea.cpp │ ├── scribblearea.h │ ├── undoredocommand.cpp │ └── undoredocommand.h │ ├── managers │ ├── basemanager.cpp │ ├── basemanager.h │ ├── clipboardmanager.cpp │ ├── clipboardmanager.h │ ├── colormanager.cpp │ ├── colormanager.h │ ├── layermanager.cpp │ ├── layermanager.h │ ├── overlaymanager.cpp │ ├── overlaymanager.h │ ├── playbackmanager.cpp │ ├── playbackmanager.h │ ├── preferencemanager.cpp │ ├── preferencemanager.h │ ├── selectionmanager.cpp │ ├── selectionmanager.h │ ├── soundmanager.cpp │ ├── soundmanager.h │ ├── toolmanager.cpp │ ├── toolmanager.h │ ├── undoredomanager.cpp │ ├── undoredomanager.h │ ├── viewmanager.cpp │ └── viewmanager.h │ ├── miniz.cpp │ ├── miniz.h │ ├── movieexporter.cpp │ ├── movieexporter.h │ ├── movieimporter.cpp │ ├── movieimporter.h │ ├── onionskinsubpainter.cpp │ ├── onionskinsubpainter.h │ ├── overlaypainter.cpp │ ├── overlaypainter.h │ ├── qminiz.cpp │ ├── qminiz.h │ ├── selectionpainter.cpp │ ├── selectionpainter.h │ ├── soundplayer.cpp │ ├── soundplayer.h │ ├── structure │ ├── camera.cpp │ ├── camera.h │ ├── filemanager.cpp │ ├── filemanager.h │ ├── keyframe.cpp │ ├── keyframe.h │ ├── layer.cpp │ ├── layer.h │ ├── layerbitmap.cpp │ ├── layerbitmap.h │ ├── layercamera.cpp │ ├── layercamera.h │ ├── layersound.cpp │ ├── layersound.h │ ├── layervector.cpp │ ├── layervector.h │ ├── object.cpp │ ├── object.h │ ├── objectdata.cpp │ ├── objectdata.h │ ├── pegbaraligner.cpp │ ├── pegbaraligner.h │ ├── soundclip.cpp │ └── soundclip.h │ ├── tool │ ├── basetool.cpp │ ├── basetool.h │ ├── brushtool.cpp │ ├── brushtool.h │ ├── buckettool.cpp │ ├── buckettool.h │ ├── cameratool.cpp │ ├── cameratool.h │ ├── erasertool.cpp │ ├── erasertool.h │ ├── eyedroppertool.cpp │ ├── eyedroppertool.h │ ├── handtool.cpp │ ├── handtool.h │ ├── movetool.cpp │ ├── movetool.h │ ├── penciltool.cpp │ ├── penciltool.h │ ├── pentool.cpp │ ├── pentool.h │ ├── polylinetool.cpp │ ├── polylinetool.h │ ├── selecttool.cpp │ ├── selecttool.h │ ├── smudgetool.cpp │ ├── smudgetool.h │ ├── strokeinterpolator.cpp │ ├── strokeinterpolator.h │ ├── stroketool.cpp │ └── stroketool.h │ └── util │ ├── blitrect.cpp │ ├── blitrect.h │ ├── cameraeasingtype.cpp │ ├── cameraeasingtype.h │ ├── camerafieldoption.h │ ├── colordictionary.h │ ├── fileformat.cpp │ ├── fileformat.h │ ├── filetype.h │ ├── importimageconfig.h │ ├── log.cpp │ ├── log.h │ ├── mathutils.h │ ├── movemode.h │ ├── onionskinpainteroptions.h │ ├── onionskinpaintstate.h │ ├── painterutils.h │ ├── pencildef.h │ ├── pencilerror.cpp │ ├── pencilerror.h │ ├── pencilsettings.cpp │ ├── pencilsettings.h │ ├── pointerevent.cpp │ ├── pointerevent.h │ ├── preferencesdef.h │ ├── transform.cpp │ ├── transform.h │ ├── util.cpp │ └── util.h ├── docs ├── .gitignore ├── build-options.md ├── build_linux.md ├── build_mac.md ├── build_win.md ├── dive-into-code.md ├── installer-development.md └── main.md ├── pencil2d.pro ├── tests ├── data │ ├── camera-path-test-2.pclx │ ├── camera-path-test.pclx │ ├── cjk-test.pclx │ ├── empty.pclx │ ├── fill-drag-test │ │ ├── fill-drag-test.pcl │ │ └── fill-drag-test.pcl.data │ │ │ └── 003.001.png │ └── tests.qrc ├── src │ ├── catch.hpp │ ├── main.cpp │ ├── test_bitmapbucket.cpp │ ├── test_bitmapimage.cpp │ ├── test_colormanager.cpp │ ├── test_filemanager.cpp │ ├── test_layer.cpp │ ├── test_layerbitmap.cpp │ ├── test_layercamera.cpp │ ├── test_layermanager.cpp │ ├── test_layersound.cpp │ ├── test_layervector.cpp │ ├── test_object.cpp │ ├── test_vectorimage.cpp │ └── test_viewmanager.cpp └── tests.pro ├── translations ├── pencil.ts ├── pencil_ar.ts ├── pencil_bg.ts ├── pencil_ca.ts ├── pencil_cs.ts ├── pencil_da.ts ├── pencil_de.ts ├── pencil_el.ts ├── pencil_en.ts ├── pencil_es.ts ├── pencil_et.ts ├── pencil_fa.ts ├── pencil_fr.ts ├── pencil_he.ts ├── pencil_hu_HU.ts ├── pencil_id.ts ├── pencil_it.ts ├── pencil_ja.ts ├── pencil_kab.ts ├── pencil_ko.ts ├── pencil_nb.ts ├── pencil_nl_NL.ts ├── pencil_pl.ts ├── pencil_pt.ts ├── pencil_pt_BR.ts ├── pencil_ru.ts ├── pencil_sl.ts ├── pencil_sv.ts ├── pencil_tr.ts ├── pencil_vi.ts ├── pencil_yue.ts ├── pencil_zh_CN.ts └── pencil_zh_TW.ts └── util ├── appveyor-mingw.yml ├── appveyor-msvc.yml ├── common.pri ├── docs ├── 404.xsl ├── extra.css ├── footer.html ├── header.html ├── layout.xml └── pencil2d.png ├── installer ├── cog-hover.png ├── cog-hover@2x.png ├── cog.png ├── cog.svg ├── cog@2x.png ├── okf_xml_wxl.fprm ├── pencil2d.bundle.wxs ├── pencil2d.cpp ├── pencil2d.def ├── pencil2d.ico ├── pencil2d.png ├── pencil2d.pro ├── pencil2d.thm ├── pencil2d.wxl ├── pencil2d.wxs ├── pencil2d@2x.png ├── translations │ ├── pencil2d.wxl.xlf │ ├── pencil2d_de.wxl.xlf │ ├── pencil2d_it.wxl.xlf │ ├── pencil2d_yue.wxl.xlf │ ├── pencil2d_zh_CN.wxl.xlf │ └── pencil2d_zh_TW.wxl.xlf ├── win_pcl_icon.ico ├── win_pcl_icon.xcf └── win_pclx_icon.ico └── win-deploy.ps1 /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | 4 | # Custom for Visual Studio 5 | *.cs diff=csharp 6 | *.sln merge=union 7 | *.csproj merge=union 8 | *.vbproj merge=union 9 | *.fsproj merge=union 10 | *.dbproj merge=union 11 | 12 | # Standard to msysgit 13 | *.doc diff=astextplain 14 | *.DOC diff=astextplain 15 | *.docx diff=astextplain 16 | *.DOCX diff=astextplain 17 | *.dot diff=astextplain 18 | *.DOT diff=astextplain 19 | *.pdf diff=astextplain 20 | *.PDF diff=astextplain 21 | *.rtf diff=astextplain 22 | *.RTF diff=astextplain 23 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | blank_issues_enabled: true 2 | contact_links: 3 | - name: Pencil2D forums 4 | url: https://discuss.pencil2d.org/ 5 | about: A place to discuss issues, share knowledge, showcase animations or request features. 6 | - name: Discord 7 | url: https://discord.com/invite/8FxdV2g 8 | about: Our primary communication and support channel. Most of the contributors hang around here. -------------------------------------------------------------------------------- /.github/actions/create-package/action.yml: -------------------------------------------------------------------------------- 1 | name: Create Package 2 | inputs: 3 | arch: 4 | description: Architecture 5 | required: true 6 | qt: 7 | description: Qt Version 8 | required: true 9 | outputs: 10 | output-basename: 11 | description: Output basename 12 | value: ${{steps.create-package.outputs.output-basename}} 13 | runs: 14 | using: composite 15 | steps: 16 | - id: create-package 17 | run: ${GITHUB_ACTION_PATH}/create-package.sh 18 | working-directory: build 19 | shell: bash 20 | env: 21 | RUNNER_OS: ${{runner.os}} 22 | INPUT_ARCH: ${{inputs.arch}} 23 | INPUT_QT: ${{inputs.qt}} 24 | IS_RELEASE: ${{ startsWith(github.ref, 'refs/heads/release/') }} 25 | -------------------------------------------------------------------------------- /.github/actions/install-dependencies/action.yml: -------------------------------------------------------------------------------- 1 | name: Install dependencies 2 | inputs: 3 | arch: 4 | description: Architecture 5 | required: true 6 | qt: 7 | description: Qt Version 8 | required: true 9 | runs: 10 | using: composite 11 | steps: 12 | - if: runner.os == 'Windows' 13 | uses: jurplel/install-qt-action@v3 14 | with: 15 | arch: ${{inputs.arch}} 16 | version: ${{matrix.qt == 6 && '6.4.2' || '5.15.2'}} 17 | modules: ${{matrix.qt == 6 && 'qtmultimedia' || ''}} 18 | - run: ${GITHUB_ACTION_PATH}/install-dependencies.sh 19 | shell: bash 20 | env: 21 | RUNNER_OS: ${{runner.os}} 22 | INPUT_ARCH: ${{inputs.arch}} 23 | INPUT_QT: ${{inputs.qt}} 24 | -------------------------------------------------------------------------------- /.github/actions/setup-environment/action.yml: -------------------------------------------------------------------------------- 1 | name: Set up environment 2 | inputs: 3 | arch: 4 | description: Architecture 5 | required: true 6 | runs: 7 | using: composite 8 | steps: 9 | - run: ${GITHUB_ACTION_PATH}/setup-environment.sh 10 | shell: bash 11 | env: 12 | RUNNER_OS: ${{runner.os}} 13 | INPUT_ARCH: ${{inputs.arch}} 14 | - run: ${GITHUB_ACTION_PATH}/setup-versions.sh 15 | shell: bash 16 | -------------------------------------------------------------------------------- /.github/actions/setup-environment/setup-environment.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | setup_linux() { 4 | echo "MAKEFLAGS=-j2" >> "${GITHUB_WORKSPACE}/env" 5 | # Our container image uses the non-Unicode C locale by default 6 | echo "LANG=C.UTF-8" >> "${GITHUB_WORKSPACE}/env" 7 | # Set up Qt environment variables and export them to the GitHub Actions workflow 8 | ${BUILD_CMD} bash -c 'if [ -f /opt/qt515/bin/qt515-env.sh ]; then (printenv; (. /opt/qt515/bin/qt515-env.sh; printenv)); fi' | sort -st= -k1,1 | uniq -u >> "${GITHUB_WORKSPACE}/env" 9 | } 10 | 11 | setup_macos() { 12 | echo "MAKEFLAGS=-j3" >> "${GITHUB_ENV}" 13 | } 14 | 15 | setup_windows() { 16 | # Set up MSVC environment variables and export them to the GitHub Actions workflow 17 | local platform="${INPUT_ARCH%%_*}" 18 | local vcvars="C:\\Program^ Files^ ^(x86^)\\Microsoft^ Visual^ Studio\\2019\\Enterprise\\VC\\Auxiliary\\Build\\vcvars${platform#win}.bat" 19 | ($(which cmd) //c set; $(which cmd) //c "${vcvars} 2>&1>nul && set") | sort -st= -k1,1 | uniq -u >> "${GITHUB_ENV}" 20 | echo "${JAVA_HOME_17_X64}\\bin" >> "${GITHUB_PATH}" 21 | realpath okapi/ >> "${GITHUB_PATH}" 22 | } 23 | 24 | "setup_$(echo "${RUNNER_OS}" | tr '[A-Z]' '[a-z]')" 25 | -------------------------------------------------------------------------------- /.github/actions/setup-environment/setup-versions.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # set env.VERSION_NUMBER from release branch names e.g., release/0.7.0 4 | if [[ "${GITHUB_REF_NAME}" == "release/"* ]]; then 5 | branchVerion=$(echo "${GITHUB_REF_NAME}" | sed 's/release\///') 6 | VERSION_NUMBER="$branchVerion.${GITHUB_RUN_NUMBER}" 7 | echo "VERSION_NUMBER=$VERSION_NUMBER" >> $GITHUB_ENV 8 | echo "VERSION_NUMBER is $VERSION_NUMBER" 9 | fi 10 | 11 | # set env.VERSION_NUMBER to 99.0.0.buildNumber if the branch is master 12 | if [ "${GITHUB_REF_NAME}" = "master" ]; then 13 | VERSION_NUMBER=99.0.0.${GITHUB_RUN_NUMBER} 14 | echo "VERSION_NUMBER=${VERSION_NUMBER}" >> "${GITHUB_ENV}" 15 | echo "VERSION_NUMBER is $VERSION_NUMBER" 16 | fi 17 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | 2 | # C++ objects and libs 3 | 4 | *.slo 5 | *.lo 6 | *.o 7 | *.a 8 | *.la 9 | *.lai 10 | *.so 11 | *.dll 12 | *.dylib 13 | .obj 14 | 15 | # Qt-es 16 | 17 | .qmake.cache 18 | .qmake.stash 19 | *.pro.user 20 | *.pro.user.* 21 | *.moc 22 | moc_*.cpp 23 | qrc_*.cpp 24 | ui_*.h 25 | Makefile* 26 | *-build-* 27 | .moc 28 | moc_predefs.h 29 | *-pch.h.cpp 30 | 31 | Makefile 32 | Makefile.Debug 33 | Makefile.Release 34 | qrc_pencil.cpp 35 | pencil-buildroot.amd64 36 | pencil-buildroot.i386 37 | Pencil2D.app 38 | *.zip 39 | 40 | # QtCreator 41 | 42 | *.autosave 43 | build-pencil-Desktop-Debug/* 44 | 45 | # Mac stuff 46 | 47 | .DS_Store 48 | *.pbproj 49 | *.xcodeproj 50 | *.xcworkspace 51 | xcshareddata 52 | *.pbxproj 53 | *.mak 54 | *.app 55 | 56 | # Visual Studio 57 | 58 | *.sln 59 | *.vcxproj 60 | *.vcxproj.user 61 | *.vcxproj.filters 62 | *.sdf 63 | *.opensdf 64 | *.suo 65 | *.pdb 66 | release 67 | debug 68 | ipch 69 | *.VC.db 70 | *.opendb 71 | .vs 72 | *.rc 73 | *.tlog 74 | 75 | /tests/tests 76 | /bin/* 77 | /tests/bin 78 | 79 | # Visual Studio Code 80 | .vscode 81 | 82 | # Build directory 83 | build 84 | .qtc_clangd 85 | app/resources.pri 86 | -------------------------------------------------------------------------------- /.tx/config: -------------------------------------------------------------------------------- 1 | [main] 2 | host = https://www.transifex.com 3 | 4 | [pencil2d.pencil] 5 | file_filter = translations/pencil_.ts 6 | source_file = translations/pencil.ts 7 | source_lang = en 8 | type = QT 9 | 10 | [pencil2d.desktop-entry] 11 | source_file = app/data/org.pencil2d.Pencil2D.desktop 12 | source_lang = en 13 | trans.en = app/data/org.pencil2d.Pencil2D.desktop 14 | type = DESKTOP 15 | 16 | -------------------------------------------------------------------------------- /app/data/_pencil2d: -------------------------------------------------------------------------------- 1 | #compdef pencil2d 2 | 3 | _arguments \ 4 | {-h,--help}'[Display help]' \ 5 | {-v,--version}'[Display version information]' \ 6 | {-o+,--export=}'[Render the file to the given path]:output file:_files' \ 7 | '--camera=[Name of the camera layer to use]:name of the camera layer to use:' \ 8 | '--width=[Width of the output frames]:width of the output frames:' \ 9 | '--height=[Height of the output frames]:height of the output frames:' \ 10 | '--start=[The first frame to export]:number of first frame to include:' \ 11 | '--end=[The last frame to include]:number of last frame to include:((last\:"Last frame containing animation" last-sound\:"Last frame containing animation or sound"))' \ 12 | '--transparency[Render transparency when possible]' \ 13 | '::input file:_files -g "*.pcl|*.pclx"' 14 | -------------------------------------------------------------------------------- /app/data/background/checkerboard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pencil2d/pencil/a9013b659d3ec6786ea4148c386fe61adad346a2/app/data/background/checkerboard.png -------------------------------------------------------------------------------- /app/data/background/dots.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pencil2d/pencil/a9013b659d3ec6786ea4148c386fe61adad346a2/app/data/background/dots.png -------------------------------------------------------------------------------- /app/data/background/grid.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pencil2d/pencil/a9013b659d3ec6786ea4148c386fe61adad346a2/app/data/background/grid.jpg -------------------------------------------------------------------------------- /app/data/background/weave.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pencil2d/pencil/a9013b659d3ec6786ea4148c386fe61adad346a2/app/data/background/weave.jpg -------------------------------------------------------------------------------- /app/data/icons/blue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pencil2d/pencil/a9013b659d3ec6786ea4148c386fe61adad346a2/app/data/icons/blue.png -------------------------------------------------------------------------------- /app/data/icons/general/checkerboard_smaller.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pencil2d/pencil/a9013b659d3ec6786ea4148c386fe61adad346a2/app/data/icons/general/checkerboard_smaller.png -------------------------------------------------------------------------------- /app/data/icons/general/cross.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pencil2d/pencil/a9013b659d3ec6786ea4148c386fe61adad346a2/app/data/icons/general/cross.png -------------------------------------------------------------------------------- /app/data/icons/general/cursor-bucket.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/data/icons/general/cursor-diagonal-left.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/data/icons/general/cursor-diagonal-right.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/data/icons/general/cursor-horizontal.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/data/icons/general/cursor-move.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/data/icons/general/cursor-rotate.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/data/icons/general/cursor-smudge.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/data/icons/general/cursor-vertical.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/data/icons/green.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pencil2d/pencil/a9013b659d3ec6786ea4148c386fe61adad346a2/app/data/icons/green.png -------------------------------------------------------------------------------- /app/data/icons/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pencil2d/pencil/a9013b659d3ec6786ea4148c386fe61adad346a2/app/data/icons/icon.png -------------------------------------------------------------------------------- /app/data/icons/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pencil2d/pencil/a9013b659d3ec6786ea4148c386fe61adad346a2/app/data/icons/logo.png -------------------------------------------------------------------------------- /app/data/icons/mac_pcl_icon.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pencil2d/pencil/a9013b659d3ec6786ea4148c386fe61adad346a2/app/data/icons/mac_pcl_icon.icns -------------------------------------------------------------------------------- /app/data/icons/mac_pcl_icon.xcf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pencil2d/pencil/a9013b659d3ec6786ea4148c386fe61adad346a2/app/data/icons/mac_pcl_icon.xcf -------------------------------------------------------------------------------- /app/data/icons/mac_pclx_icon.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pencil2d/pencil/a9013b659d3ec6786ea4148c386fe61adad346a2/app/data/icons/mac_pclx_icon.icns -------------------------------------------------------------------------------- /app/data/icons/red.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pencil2d/pencil/a9013b659d3ec6786ea4148c386fe61adad346a2/app/data/icons/red.png -------------------------------------------------------------------------------- /app/data/icons/themes/playful/controls/control-loop.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/data/icons/themes/playful/controls/control-play-end.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/data/icons/themes/playful/controls/control-play-start.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/data/icons/themes/playful/controls/control-play.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/data/icons/themes/playful/controls/control-sound-enable.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/data/icons/themes/playful/controls/control-sound-scrub.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/data/icons/themes/playful/controls/control-stop.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/data/icons/themes/playful/dialog-error.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/data/icons/themes/playful/display/lines-invisible.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/data/icons/themes/playful/display/lines-outline.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/data/icons/themes/playful/display/mirror-horizontal.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/data/icons/themes/playful/display/mirror-vertical.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/data/icons/themes/playful/display/overlay-center.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/data/icons/themes/playful/display/overlay-golden-ratio.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/data/icons/themes/playful/display/overlay-grid.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/data/icons/themes/playful/display/overlay-safe.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/data/icons/themes/playful/display/overlay-thirds.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/data/icons/themes/playful/display/perspective-angle.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/data/icons/themes/playful/display/perspective-onepoint.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/data/icons/themes/playful/display/perspective-threepoints.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/data/icons/themes/playful/display/perspective-twopoints.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/data/icons/themes/playful/menubar/clear-canvas.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/data/icons/themes/playful/menubar/copy.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/data/icons/themes/playful/menubar/cut.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/data/icons/themes/playful/menubar/new.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/data/icons/themes/playful/menubar/open.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/data/icons/themes/playful/menubar/paste.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/data/icons/themes/playful/menubar/redo.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/data/icons/themes/playful/menubar/save.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/data/icons/themes/playful/menubar/undo.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/data/icons/themes/playful/menubar/view-reset.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/data/icons/themes/playful/menubar/zoom-in.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/data/icons/themes/playful/menubar/zoom-out.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/data/icons/themes/playful/menubar/zoom-select.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/data/icons/themes/playful/misc/add-color.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/data/icons/themes/playful/misc/color-dialog.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/data/icons/themes/playful/misc/more-options.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/data/icons/themes/playful/misc/remove-color.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/data/icons/themes/playful/onion/onionskin-blue.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/data/icons/themes/playful/onion/onionskin-enable.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/data/icons/themes/playful/onion/onionskin-red.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/data/icons/themes/playful/preferences/preferences-files.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/data/icons/themes/playful/preferences/preferences-general.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/data/icons/themes/playful/preferences/preferences-timeline.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/data/icons/themes/playful/preferences/preferences-tools.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/data/icons/themes/playful/timeline/cell-bitmap.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/data/icons/themes/playful/timeline/cell-camera.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/data/icons/themes/playful/timeline/cell-sound.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/data/icons/themes/playful/timeline/cell-vector.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/data/icons/themes/playful/timeline/frame-add.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/data/icons/themes/playful/timeline/frame-duplicate.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/data/icons/themes/playful/timeline/frame-remove.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/data/icons/themes/playful/timeline/layer-add.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/data/icons/themes/playful/timeline/layer-duplicate.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/data/icons/themes/playful/timeline/layer-remove.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/data/icons/themes/playful/tools/tool-camera-move.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/data/icons/themes/playful/tools/tool-camera-rotate.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/data/icons/themes/playful/tools/tool-camera-scale.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/data/icons/themes/playful/tools/tool-eraser.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/data/icons/themes/playful/tools/tool-hand.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/data/icons/themes/playful/tools/tool-move.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/data/icons/themes/playful/tools/tool-pen.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/data/icons/themes/playful/tools/tool-pencil.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/data/icons/themes/playful/tools/tool-polyline.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/data/icons/themes/playful/tools/tool-select.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/data/icons/themes/playful/tools/tool-smudge.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/data/mui.rc: -------------------------------------------------------------------------------- 1 | #if defined(__MINGW32__) || defined(__MINGW64__) 2 | // This is needed for MinGW versions < 8 3 | // (not to be confused with the GCC version by which Qt labels their MinGW packages) 4 | #include 5 | #else 6 | #include 7 | #endif 8 | 9 | STRINGTABLE 10 | LANGUAGE LANG_ENGLISH, SUBLANG_NEUTRAL 11 | { 12 | 0 "Pencil2D" 13 | 1 "Pencil2D Animation" 14 | 2 "Pencil2D Animation (Old Format)" 15 | } 16 | -------------------------------------------------------------------------------- /app/data/org.pencil2d.Pencil2D.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pencil2d/pencil/a9013b659d3ec6786ea4148c386fe61adad346a2/app/data/org.pencil2d.Pencil2D.png -------------------------------------------------------------------------------- /app/data/org.pencil2d.Pencil2D.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Pencil2D animation (old format) 5 | Pencil2D-Animation (altes Format) 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | Pencil2D animation 15 | Pencil2D-Animation 16 | 17 | 18 | 19 | 20 | 21 | Pencil2D palette 22 | Pencil2D-Palette 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | Pencil2D shortcuts 31 | Pencil2D-Tastenkürzel 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /app/data/pencil2d: -------------------------------------------------------------------------------- 1 | _pencil2d() 2 | { 3 | local cur prev words cword opts 4 | _init_completion || return 5 | opts="-h --help -v --version -o --export --camera --width --height --start --end --transparency" 6 | 7 | case "${prev}" in 8 | --camera|--width|--height|--start) 9 | return 0 10 | ;; 11 | --end) 12 | COMPREPLY=( $(compgen -W "last last-sound" -- ${cur}) ) 13 | return 0 14 | ;; 15 | -o|--export) 16 | _filedir 17 | return 0 18 | ;; 19 | esac 20 | 21 | if [[ ${cur} == -* ]]; then 22 | COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) ) 23 | else 24 | _filedir "pcl?(x)" 25 | fi 26 | } && 27 | complete -F _pencil2d pencil2d 28 | -------------------------------------------------------------------------------- /app/data/pencil2d.VisualElementsManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | -------------------------------------------------------------------------------- /app/data/pencil2d.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pencil2d/pencil/a9013b659d3ec6786ea4148c386fe61adad346a2/app/data/pencil2d.icns -------------------------------------------------------------------------------- /app/data/pencil2d.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pencil2d/pencil/a9013b659d3ec6786ea4148c386fe61adad346a2/app/data/pencil2d.ico -------------------------------------------------------------------------------- /app/data/pencil2d_quick_guide.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pencil2d/pencil/a9013b659d3ec6786ea4148c386fe61adad346a2/app/data/pencil2d_quick_guide.pdf -------------------------------------------------------------------------------- /app/data/resources.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /app/data/resources/tile150.scale-100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pencil2d/pencil/a9013b659d3ec6786ea4148c386fe61adad346a2/app/data/resources/tile150.scale-100.png -------------------------------------------------------------------------------- /app/data/resources/tile150.scale-140.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pencil2d/pencil/a9013b659d3ec6786ea4148c386fe61adad346a2/app/data/resources/tile150.scale-140.png -------------------------------------------------------------------------------- /app/data/resources/tile150.scale-180.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pencil2d/pencil/a9013b659d3ec6786ea4148c386fe61adad346a2/app/data/resources/tile150.scale-180.png -------------------------------------------------------------------------------- /app/data/resources/tile150.scale-80.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pencil2d/pencil/a9013b659d3ec6786ea4148c386fe61adad346a2/app/data/resources/tile150.scale-80.png -------------------------------------------------------------------------------- /app/data/resources/tile70.scale-100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pencil2d/pencil/a9013b659d3ec6786ea4148c386fe61adad346a2/app/data/resources/tile70.scale-100.png -------------------------------------------------------------------------------- /app/data/resources/tile70.scale-140.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pencil2d/pencil/a9013b659d3ec6786ea4148c386fe61adad346a2/app/data/resources/tile70.scale-140.png -------------------------------------------------------------------------------- /app/data/resources/tile70.scale-180.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pencil2d/pencil/a9013b659d3ec6786ea4148c386fe61adad346a2/app/data/resources/tile70.scale-180.png -------------------------------------------------------------------------------- /app/data/resources/tile70.scale-80.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pencil2d/pencil/a9013b659d3ec6786ea4148c386fe61adad346a2/app/data/resources/tile70.scale-80.png -------------------------------------------------------------------------------- /app/src/aboutdialog.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Pencil2D - Traditional Animation Software 4 | Copyright (C) 2012-2020 Matthew Chiawen Chang 5 | 6 | This program is free software; you can redistribute it and/or 7 | modify it under the terms of the GNU General Public License 8 | as published by the Free Software Foundation; version 2 of the License. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | */ 16 | 17 | #ifndef ABOUTDIALOG_H 18 | #define ABOUTDIALOG_H 19 | 20 | #include 21 | 22 | namespace Ui { 23 | class AboutDialog; 24 | } 25 | 26 | class AboutDialog : public QDialog 27 | { 28 | Q_OBJECT 29 | 30 | public: 31 | explicit AboutDialog(QWidget* parent); 32 | ~AboutDialog(); 33 | void init(); 34 | 35 | private: 36 | Ui::AboutDialog* ui = nullptr; 37 | }; 38 | 39 | #endif // ABOUTDIALOG_H 40 | -------------------------------------------------------------------------------- /app/src/app-pch.h: -------------------------------------------------------------------------------- 1 | /* Add C includes here */ 2 | 3 | #if defined __cplusplus 4 | /* Add C++ includes here */ 5 | 6 | #include 7 | #include 8 | #include 9 | #endif 10 | -------------------------------------------------------------------------------- /app/src/app_util.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Pencil2D - Traditional Animation Software 4 | Copyright (C) 2005-2007 Patrick Corrieri & Pascal Naidon 5 | Copyright (C) 2012-2020 Matthew Chiawen Chang 6 | 7 | This program is free software; you can redistribute it and/or 8 | modify it under the terms of the GNU General Public License 9 | as published by the Free Software Foundation; version 2 of the License. 10 | 11 | This program is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | */ 17 | #include "app_util.h" 18 | #include 19 | #include 20 | #include "preferencemanager.h" 21 | 22 | void hideQuestionMark(QDialog& dlg) 23 | { 24 | dlg.setWindowFlags(dlg.windowFlags() & ~Qt::WindowContextHelpButtonHint); 25 | } 26 | 27 | void setMenuActionChecked(QAction* action, bool checked) 28 | { 29 | QSignalBlocker b(action); 30 | action->setChecked(checked); 31 | } 32 | 33 | void bindPreferenceSetting(QAction* action, PreferenceManager* prefs, const SETTING& setting) 34 | { 35 | Q_ASSERT(action->isCheckable()); 36 | Q_ASSERT(prefs); 37 | 38 | QSignalBlocker b(action); 39 | action->setChecked(prefs->isOn(setting)); // set initial state 40 | 41 | // 2-way binding 42 | QObject::connect(action, &QAction::triggered, [=](bool b) { prefs->set(setting, b); }); 43 | QObject::connect(prefs, &PreferenceManager::optionChanged, [=](SETTING s) 44 | { 45 | if (s == setting) 46 | { 47 | action->setChecked(prefs->isOn(setting)); 48 | } 49 | }); 50 | } 51 | -------------------------------------------------------------------------------- /app/src/app_util.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Pencil2D - Traditional Animation Software 4 | Copyright (C) 2005-2007 Patrick Corrieri & Pascal Naidon 5 | Copyright (C) 2012-2020 Matthew Chiawen Chang 6 | 7 | This program is free software; you can redistribute it and/or 8 | modify it under the terms of the GNU General Public License 9 | as published by the Free Software Foundation; version 2 of the License. 10 | 11 | This program is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | */ 17 | #ifndef APP_UTIL_H 18 | #define APP_UTIL_H 19 | 20 | class PreferenceManager; 21 | enum class SETTING; 22 | 23 | void hideQuestionMark(QDialog& dlg); 24 | void setMenuActionChecked(QAction* action, bool checked); 25 | void bindPreferenceSetting(QAction* action, PreferenceManager*, const SETTING&); 26 | 27 | #endif // APP_UTIL_H -------------------------------------------------------------------------------- /app/src/basedockwidget.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Pencil2D - Traditional Animation Software 4 | Copyright (C) 2005-2007 Patrick Corrieri & Pascal Naidon 5 | Copyright (C) 2012-2020 Matthew Chiawen Chang 6 | 7 | This program is free software; you can redistribute it and/or 8 | modify it under the terms of the GNU General Public License 9 | as published by the Free Software Foundation; version 2 of the License. 10 | 11 | This program is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | */ 17 | 18 | #include 19 | #include 20 | 21 | #include "basedockwidget.h" 22 | #include "platformhandler.h" 23 | 24 | BaseDockWidget::BaseDockWidget(QWidget* pParent) 25 | : QDockWidget(pParent, Qt::Tool) 26 | { 27 | 28 | #ifdef __APPLE__ 29 | if (PlatformHandler::isDarkMode()) 30 | { 31 | setStyleSheet("QDockWidget::title { background: QLinearGradient( x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #4e4f4d, stop: 1 #424241); " 32 | "background-repeat: repeat-x; text-align: center;" 33 | "border-style: solid; border-bottom-color: #000000;" 34 | "border-width: 1px; }"); 35 | } 36 | #endif 37 | } 38 | 39 | BaseDockWidget::~BaseDockWidget() 40 | { 41 | } 42 | -------------------------------------------------------------------------------- /app/src/basedockwidget.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Pencil2D - Traditional Animation Software 4 | Copyright (C) 2005-2007 Patrick Corrieri & Pascal Naidon 5 | Copyright (C) 2012-2020 Matthew Chiawen Chang 6 | 7 | This program is free software; you can redistribute it and/or 8 | modify it under the terms of the GNU General Public License 9 | as published by the Free Software Foundation; version 2 of the License. 10 | 11 | This program is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | */ 17 | 18 | #ifndef BASEDOCKWIDGET_H 19 | #define BASEDOCKWIDGET_H 20 | 21 | #include 22 | 23 | class Editor; 24 | 25 | 26 | class BaseDockWidget : public QDockWidget 27 | { 28 | Q_OBJECT 29 | protected: 30 | explicit BaseDockWidget(QWidget* pParent); 31 | virtual ~BaseDockWidget(); 32 | 33 | public: 34 | virtual void initUI() = 0; 35 | virtual void updateUI() = 0; 36 | 37 | Editor* editor() const { return mEditor; } 38 | void setEditor( Editor* e ) { mEditor = e; } 39 | 40 | private: 41 | Editor* mEditor = nullptr; 42 | }; 43 | 44 | #endif // BASEDOCKWIDGET_H 45 | -------------------------------------------------------------------------------- /app/src/cameracontextmenu.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Pencil2D - Traditional Animation Software 4 | Copyright (C) 2005-2007 Patrick Corrieri & Pascal Naidon 5 | Copyright (C) 2012-2020 Matthew Chiawen Chang 6 | 7 | This program is free software; you can redistribute it and/or 8 | modify it under the terms of the GNU General Public License 9 | as published by the Free Software Foundation; version 2 of the License. 10 | 11 | This program is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | */ 17 | 18 | #ifndef CAMERACONTEXTMENU_H 19 | #define CAMERACONTEXTMENU_H 20 | 21 | #include 22 | #include 23 | 24 | #include 25 | 26 | class LayerCamera; 27 | 28 | class CameraContextMenu : public QMenu 29 | { 30 | Q_OBJECT 31 | public: 32 | CameraContextMenu(int frameNumber, const LayerCamera* layer); 33 | 34 | private: 35 | int mFrameNumber; 36 | const LayerCamera* mCurrentLayer; 37 | }; 38 | 39 | #endif // CAMERACONTEXTMENU_H 40 | -------------------------------------------------------------------------------- /app/src/cameraoptionswidget.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Pencil2D - Traditional Animation Software 4 | Copyright (C) 2005-2007 Patrick Corrieri & Pascal Naidon 5 | Copyright (C) 2012-2020 Matthew Chiawen Chang 6 | 7 | This program is free software; you can redistribute it and/or 8 | modify it under the terms of the GNU General Public License 9 | as published by the Free Software Foundation; version 2 of the License. 10 | 11 | This program is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | */ 17 | #ifndef CAMERAOPTIONSWIDGET_H 18 | #define CAMERAOPTIONSWIDGET_H 19 | 20 | #include 21 | 22 | #include "pencildef.h" 23 | #include "camera.h" 24 | 25 | class Editor; 26 | class CameraTool; 27 | 28 | namespace Ui { 29 | class CameraOptionsWidget; 30 | } 31 | 32 | class CameraOptionsWidget : public QWidget 33 | { 34 | Q_OBJECT 35 | public: 36 | explicit CameraOptionsWidget(Editor* editor, QWidget *parent = nullptr); 37 | ~CameraOptionsWidget(); 38 | 39 | void updateUI(); 40 | 41 | void setShowCameraPath(bool showCameraPath); 42 | void setPathDotColorType(DotColorType index); 43 | void onToolPropertyChanged(ToolType, ToolPropertyType ePropertyType); 44 | 45 | private: 46 | Ui::CameraOptionsWidget *ui; 47 | Editor* mEditor = nullptr; 48 | 49 | CameraTool* mCameraTool = nullptr; 50 | }; 51 | 52 | #endif // CAMERAOPTIONSWIDGET_H 53 | -------------------------------------------------------------------------------- /app/src/camerapropertiesdialog.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Pencil2D - Traditional Animation Software 4 | Copyright (C) 2005-2007 Patrick Corrieri & Pascal Naidon 5 | Copyright (C) 2012-2020 Matthew Chiawen Chang 6 | 7 | This program is free software; you can redistribute it and/or 8 | modify it under the terms of the GNU General Public License 9 | as published by the Free Software Foundation; version 2 of the License. 10 | 11 | This program is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | */ 17 | 18 | #include "camerapropertiesdialog.h" 19 | #include "ui_camerapropertiesdialog.h" 20 | 21 | CameraPropertiesDialog::CameraPropertiesDialog(const QString& name, int width, int height) : 22 | QDialog(), 23 | ui(new Ui::CameraPropertiesDialog) 24 | { 25 | ui->setupUi(this); 26 | 27 | ui->nameBox->setText(name); 28 | ui->widthBox->setValue(width); 29 | ui->heightBox->setValue(height); 30 | } 31 | 32 | CameraPropertiesDialog::~CameraPropertiesDialog() 33 | { 34 | delete ui; 35 | } 36 | 37 | QString CameraPropertiesDialog::getName() 38 | { 39 | return ui->nameBox->text(); 40 | } 41 | 42 | void CameraPropertiesDialog::setName(const QString& name) 43 | { 44 | ui->nameBox->setText(name); 45 | } 46 | 47 | int CameraPropertiesDialog::getWidth() 48 | { 49 | return ui->widthBox->value(); 50 | } 51 | 52 | void CameraPropertiesDialog::setWidth(int width) 53 | { 54 | ui->widthBox->setValue(width); 55 | } 56 | 57 | int CameraPropertiesDialog::getHeight() 58 | { 59 | return ui->heightBox->value(); 60 | } 61 | 62 | void CameraPropertiesDialog::setHeight(int height) 63 | { 64 | ui->heightBox->setValue(height); 65 | } 66 | -------------------------------------------------------------------------------- /app/src/camerapropertiesdialog.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Pencil2D - Traditional Animation Software 4 | Copyright (C) 2005-2007 Patrick Corrieri & Pascal Naidon 5 | Copyright (C) 2012-2020 Matthew Chiawen Chang 6 | 7 | This program is free software; you can redistribute it and/or 8 | modify it under the terms of the GNU General Public License 9 | as published by the Free Software Foundation; version 2 of the License. 10 | 11 | This program is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | */ 17 | 18 | #ifndef CAMERAPROPERTIESDIALOG_H 19 | #define CAMERAPROPERTIESDIALOG_H 20 | 21 | #include 22 | 23 | namespace Ui { 24 | class CameraPropertiesDialog; 25 | } 26 | 27 | class CameraPropertiesDialog : public QDialog 28 | { 29 | Q_OBJECT 30 | public: 31 | CameraPropertiesDialog(const QString& name, int width, int height); 32 | ~CameraPropertiesDialog() override; 33 | QString getName(); 34 | void setName(const QString& name); 35 | int getWidth(); 36 | void setWidth(int); 37 | int getHeight(); 38 | void setHeight(int); 39 | 40 | private: 41 | Ui::CameraPropertiesDialog* ui = nullptr; 42 | }; 43 | 44 | #endif // CAMERAPROPERTIESDIALOG_H 45 | -------------------------------------------------------------------------------- /app/src/colorbox.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Pencil2D - Traditional Animation Software 4 | Copyright (C) 2012-2020 Matthew Chiawen Chang 5 | 6 | This program is free software; you can redistribute it and/or 7 | modify it under the terms of the GNU General Public License 8 | as published by the Free Software Foundation; version 2 of the License. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | */ 16 | #ifndef COLORBOX_H 17 | #define COLORBOX_H 18 | 19 | #include "basedockwidget.h" 20 | 21 | class ColorWheel; 22 | 23 | class ColorBox : public BaseDockWidget 24 | { 25 | Q_OBJECT 26 | 27 | public: 28 | explicit ColorBox( QWidget* parent ); 29 | virtual ~ColorBox() override; 30 | 31 | void initUI() override; 32 | void updateUI() override; 33 | 34 | QColor color(); 35 | void setColor(QColor); 36 | 37 | signals: 38 | void colorChanged(const QColor&); 39 | 40 | private: 41 | void onWheelMove(const QColor&); 42 | void onWheelRelease(const QColor&); 43 | 44 | ColorWheel* mColorWheel = nullptr; 45 | 46 | // ColorInspector* mColorInspector = nullptr; 47 | }; 48 | 49 | #endif // COLORBOX_H 50 | -------------------------------------------------------------------------------- /app/src/colorinspector.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Pencil2D - Traditional Animation Software 4 | Copyright (C) 2012-2020 Matthew Chiawen Chang 5 | 6 | This program is free software; you can redistribute it and/or 7 | modify it under the terms of the GNU General Public License 8 | as published by the Free Software Foundation; version 2 of the License. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | */ 16 | #ifndef COLORSPINBOXGROUP_H 17 | #define COLORSPINBOXGROUP_H 18 | 19 | #include 20 | #include "basedockwidget.h" 21 | 22 | namespace Ui { 23 | class ColorInspector; 24 | } 25 | 26 | class ColorInspector : public BaseDockWidget 27 | { 28 | Q_OBJECT 29 | 30 | friend class ColorSliders; 31 | 32 | public: 33 | explicit ColorInspector(QWidget *parent = nullptr); 34 | ~ColorInspector() override; 35 | QColor color(); 36 | 37 | void initUI() override; 38 | void updateUI() override; 39 | 40 | signals: 41 | void colorChanged(const QColor& c); 42 | void colorSpecChanged(const bool& isRgb); 43 | 44 | public slots: 45 | void setColor(QColor newColor); 46 | 47 | private slots: 48 | void onColorSpecChanged(); 49 | void onColorChanged(); 50 | void onColorChanged(const QColor& color); 51 | 52 | private: 53 | void updateControls(); 54 | 55 | Ui::ColorInspector* ui = nullptr; 56 | bool isRgbColors = true; 57 | QColor mCurrentColor; 58 | }; 59 | 60 | #endif // COLORSPINBOXGROUP_H 61 | -------------------------------------------------------------------------------- /app/src/commandlineparser.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Pencil2D - Traditional Animation Software 4 | Copyright (C) 2005-2007 Patrick Corrieri & Pascal Naidon 5 | Copyright (C) 2012-2020 Matthew Chiawen Chang 6 | 7 | This program is free software; you can redistribute it and/or 8 | modify it under the terms of the GNU General Public License 9 | as published by the Free Software Foundation; version 2 of the License. 10 | 11 | This program is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | */ 17 | 18 | #ifndef COMMANDLINEPARSER_H 19 | #define COMMANDLINEPARSER_H 20 | 21 | #include 22 | 23 | class CommandLineParser : QObject 24 | { 25 | Q_OBJECT 26 | 27 | public: 28 | explicit CommandLineParser(); 29 | 30 | void process(QStringList arguments); 31 | 32 | QString inputPath() const { return mInputPath; } 33 | QStringList outputPaths() const { return mOutputPaths; } 34 | QString camera() const { return mCamera; } 35 | int width() const { return mWidth; } 36 | int height() const { return mHeight; } 37 | int startFrame() const { return mStartFrame; } 38 | int endFrame() const { return mEndFrame; } 39 | bool transparency() const { return mTransparency; } 40 | 41 | private: 42 | QCommandLineParser mParser; 43 | 44 | QString mInputPath; 45 | QStringList mOutputPaths; 46 | QString mCamera; 47 | int mWidth = -1; 48 | int mHeight = -1; 49 | int mStartFrame = 1; 50 | int mEndFrame = -1; 51 | bool mTransparency = false; 52 | }; 53 | 54 | #endif // COMMANDLINEPARSER_H 55 | -------------------------------------------------------------------------------- /app/src/errordialog.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Pencil2D - Traditional Animation Software 4 | Copyright (C) 2012-2020 Matthew Chiawen Chang 5 | 6 | This program is free software; you can redistribute it and/or 7 | modify it under the terms of the GNU General Public License 8 | as published by the Free Software Foundation; version 2 of the License. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | */ 16 | 17 | #include "errordialog.h" 18 | #include "ui_errordialog.h" 19 | 20 | #include 21 | #include 22 | 23 | ErrorDialog::ErrorDialog( QString title, QString description, QString details, QWidget *parent ) : 24 | QDialog( parent ), 25 | ui(new Ui::ErrorDialog) 26 | { 27 | ui->setupUi( this ); 28 | 29 | setWindowTitle( title ); 30 | ui->title->setText( QString( "

%1

" ).arg( title ) ); 31 | ui->description->setText( description ); 32 | if ( details.isEmpty() ) 33 | { 34 | ui->details->setVisible( false ); 35 | } 36 | else 37 | { 38 | ui->details->setText( QString( "
%1
" ).arg( details ) ); 39 | } 40 | 41 | QPushButton* copyToClipboard = new QPushButton(tr("Copy to Clipboard")); 42 | ui->buttonBox->addButton(copyToClipboard, QDialogButtonBox::ActionRole); 43 | 44 | connect(copyToClipboard, &QPushButton::clicked, this, &ErrorDialog::onCopyToClipboard); 45 | } 46 | 47 | ErrorDialog::~ErrorDialog() 48 | { 49 | delete ui; 50 | } 51 | 52 | void ErrorDialog::onCopyToClipboard() { 53 | QGuiApplication::clipboard()->setText(ui->details->toPlainText()); 54 | } 55 | -------------------------------------------------------------------------------- /app/src/errordialog.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Pencil2D - Traditional Animation Software 4 | Copyright (C) 2005-2007 Patrick Corrieri & Pascal Naidon 5 | Copyright (C) 2012-2020 Matthew Chiawen Chang 6 | 7 | This program is free software; you can redistribute it and/or 8 | modify it under the terms of the GNU General Public License 9 | as published by the Free Software Foundation; version 2 of the License. 10 | 11 | This program is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | */ 17 | 18 | #ifndef ERRORDIALOG_H 19 | #define ERRORDIALOG_H 20 | 21 | #include 22 | 23 | namespace Ui { 24 | class ErrorDialog; 25 | } 26 | 27 | class ErrorDialog : public QDialog 28 | { 29 | Q_OBJECT 30 | 31 | public: 32 | explicit ErrorDialog(QString title, QString description, QString details = QString(), QWidget *parent = nullptr); 33 | ~ErrorDialog(); 34 | 35 | public slots: 36 | void onCopyToClipboard(); 37 | 38 | private: 39 | Ui::ErrorDialog *ui; 40 | }; 41 | 42 | #endif // ERRORDIALOG_H 43 | -------------------------------------------------------------------------------- /app/src/filespage.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Pencil2D - Traditional Animation Software 4 | Copyright (C) 2005-2007 Patrick Corrieri & Pascal Naidon 5 | Copyright (C) 2012-2020 Matthew Chiawen Chang 6 | 7 | This program is free software; you can redistribute it and/or 8 | modify it under the terms of the GNU General Public License 9 | as published by the Free Software Foundation; version 2 of the License. 10 | 11 | This program is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | */ 17 | 18 | #ifndef FILESPAGE_H 19 | #define FILESPAGE_H 20 | 21 | #include 22 | 23 | class PreferenceManager; 24 | class QListWidgetItem; 25 | class QSettings; 26 | 27 | namespace Ui { 28 | class FilesPage; 29 | } 30 | 31 | class FilesPage : public QWidget 32 | { 33 | Q_OBJECT 34 | 35 | public: 36 | FilesPage(); 37 | ~FilesPage() override; 38 | void setManager(PreferenceManager* p) { mManager = p; } 39 | 40 | public slots: 41 | void initPreset(); 42 | void addPreset(); 43 | void removePreset(); 44 | void setDefaultPreset(); 45 | void presetNameChanged(QListWidgetItem* item); 46 | 47 | void updateValues(); 48 | void askForPresetChange(int b); 49 | void loadMostRecentChange(int b); 50 | void loadDefaultPreset(int b); 51 | void autoSaveChange(int b); 52 | void autoSaveNumberChange(int number); 53 | 54 | signals: 55 | void clearRecentList(); 56 | 57 | private: 58 | Ui::FilesPage* ui = nullptr; 59 | PreferenceManager* mManager = nullptr; 60 | QSettings* mPresetSettings = nullptr; 61 | QDir mPresetDir; 62 | int mMaxPresetIndex = 0; 63 | }; 64 | 65 | #endif // FILESPAGE_H 66 | -------------------------------------------------------------------------------- /app/src/importlayersdialog.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Pencil2D - Traditional Animation Software 4 | Copyright (C) 2005-2007 Patrick Corrieri & Pascal Naidon 5 | Copyright (C) 2012-2020 Matthew Chiawen Chang 6 | 7 | This program is free software; you can redistribute it and/or 8 | modify it under the terms of the GNU General Public License 9 | as published by the Free Software Foundation; version 2 of the License. 10 | 11 | This program is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | */ 17 | #ifndef IMPORTLAYERSDIALOG_H 18 | #define IMPORTLAYERSDIALOG_H 19 | 20 | #include 21 | #include "object.h" 22 | #include "editor.h" 23 | 24 | namespace Ui { 25 | class ImportLayersDialog; 26 | } 27 | 28 | class ImportLayersDialog : public QDialog 29 | { 30 | Q_OBJECT 31 | 32 | public: 33 | explicit ImportLayersDialog(QWidget* parent); 34 | ~ImportLayersDialog(); 35 | 36 | void setCore(Editor *editor); 37 | 38 | public slots: 39 | void getFileName(); 40 | void listWidgetChanged(); 41 | void importLayers(); 42 | void cancel(); 43 | 44 | private: 45 | Ui::ImportLayersDialog *ui; 46 | 47 | void getLayers(); 48 | 49 | std::unique_ptr mImportObject; 50 | Layer* mImportLayer = nullptr; 51 | Editor* mEditor = nullptr; 52 | QString mFileName; 53 | QList mItemsSelected; 54 | void loadKeyFrames(Layer* importedLayer); 55 | }; 56 | 57 | #endif // IMPORTLAYERSDIALOG_H 58 | -------------------------------------------------------------------------------- /app/src/main.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Pencil2D - Traditional Animation Software 4 | Copyright (C) 2005-2007 Patrick Corrieri & Pascal Naidon 5 | Copyright (C) 2012-2020 Matthew Chiawen Chang 6 | 7 | This program is free software; you can redistribute it and/or 8 | modify it under the terms of the GNU General Public License 9 | as published by the Free Software Foundation; version 2 of the License. 10 | 11 | This program is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | */ 17 | 18 | #include "log.h" 19 | #include "pencil2d.h" 20 | #include "pencilerror.h" 21 | #include "platformhandler.h" 22 | 23 | /** 24 | * This is the entrypoint of the program. It performs basic initialization, then 25 | * boots the actual application (@ref Pencil2D). 26 | */ 27 | int main(int argc, char* argv[]) 28 | { 29 | Q_INIT_RESOURCE(core_lib); 30 | PlatformHandler::initialise(); 31 | initCategoryLogging(); 32 | 33 | Pencil2D app(argc, argv); 34 | 35 | switch (app.handleCommandLineOptions().code()) 36 | { 37 | case Status::OK: 38 | return Pencil2D::exec(); 39 | case Status::SAFE: 40 | return EXIT_SUCCESS; 41 | default: 42 | return EXIT_FAILURE; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /app/src/onionskinwidget.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Pencil2D - Traditional Animation Software 4 | Copyright (C) 2012-2020 Matthew Chiawen Chang 5 | 6 | This program is free software; you can redistribute it and/or 7 | modify it under the terms of the GNU General Public License 8 | as published by the Free Software Foundation; version 2 of the License. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | */ 16 | 17 | #ifndef ONIONSKINWIDGET_H 18 | #define ONIONSKINWIDGET_H 19 | 20 | #include "basedockwidget.h" 21 | 22 | namespace Ui 23 | { 24 | class OnionSkin; 25 | } 26 | 27 | class Editor; 28 | class QToolButton; 29 | class ViewManager; 30 | 31 | class OnionSkinWidget : public BaseDockWidget 32 | { 33 | Q_OBJECT 34 | 35 | public: 36 | explicit OnionSkinWidget(QWidget* parent); 37 | virtual ~OnionSkinWidget() override; 38 | 39 | void initUI() override; 40 | void updateUI() override; 41 | 42 | private slots: 43 | void playbackStateChanged(int); 44 | void prevFramesGroupClicked(bool); 45 | void nextFramesGroupClicked(bool); 46 | void onionBlueButtonClicked(bool); 47 | void onionRedButtonClicked(bool); 48 | void onionMaxOpacityChange(int); 49 | void onionMinOpacityChange(int); 50 | void onionPrevFramesNumChange(int); 51 | void onionNextFramesNumChange(int); 52 | void onionSkinModeChange(int); 53 | void onionSkinMultipleLayersEnabled(bool value); 54 | 55 | private: 56 | void makeConnections(); 57 | Ui::OnionSkin* ui = nullptr; 58 | }; 59 | 60 | #endif // ONIONSKINWIDGET_H 61 | -------------------------------------------------------------------------------- /app/src/pegbaralignmentdialog.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Pencil2D - Traditional Animation Software 4 | Copyright (C) 2005-2007 Patrick Corrieri & Pascal Naidon 5 | Copyright (C) 2012-2020 Matthew Chiawen Chang 6 | 7 | This program is free software; you can redistribute it and/or 8 | modify it under the terms of the GNU General Public License 9 | as published by the Free Software Foundation; version 2 of the License. 10 | 11 | This program is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | */ 17 | #ifndef PEGBARALIGNMENTDIALOG_H 18 | #define PEGBARALIGNMENTDIALOG_H 19 | 20 | #include 21 | #include 22 | #include "editor.h" 23 | 24 | namespace Ui { 25 | class PegBarAlignmentDialog; 26 | } 27 | 28 | class PegBarAlignmentDialog : public QDialog 29 | { 30 | Q_OBJECT 31 | 32 | public: 33 | explicit PegBarAlignmentDialog(Editor* editor, QWidget* parent = nullptr); 34 | ~PegBarAlignmentDialog(); 35 | 36 | public slots: 37 | void updateAlignButton(); 38 | 39 | private: 40 | void updatePegRegLayers(); 41 | void updatePegRegDialog(); 42 | void alignPegs(); 43 | void setLayerList(QStringList layerList); 44 | void updateRefKeyLabel(QString text); 45 | 46 | QStringList getLayerList(); 47 | 48 | void setAreaSelected(bool b); 49 | void setReferenceSelected(bool b); 50 | void setLayerSelected(bool b); 51 | void closeClicked(); 52 | 53 | Ui::PegBarAlignmentDialog* ui; 54 | QStringList mLayernames; 55 | Editor* mEditor = nullptr; 56 | bool mAreaSelected = false; 57 | bool mReferenceSelected = false; 58 | bool mLayerSelected = false; 59 | }; 60 | 61 | #endif // PEGBARALIGNMENTDIALOG_H 62 | -------------------------------------------------------------------------------- /app/src/popupcolorpalettewidget.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Pencil2D - Traditional Animation Software 4 | Copyright (C) 2005-2007 Patrick Corrieri & Pascal Naidon 5 | Copyright (C) 2012-2020 Matthew Chiawen Chang 6 | 7 | This program is free software; you can redistribute it and/or 8 | modify it under the terms of the GNU General Public License 9 | as published by the Free Software Foundation; version 2 of the License. 10 | 11 | This program is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | */ 17 | #ifndef POPUPCOLORPALETTEWIDGET_H 18 | #define POPUPCOLORPALETTEWIDGET_H 19 | 20 | #include 21 | 22 | class ColorBox; 23 | class ScribbleArea; 24 | class QPushButton; 25 | 26 | 27 | class PopupColorPaletteWidget : public QWidget 28 | { 29 | Q_OBJECT 30 | 31 | public: 32 | PopupColorPaletteWidget( ScribbleArea *parent = 0 ); 33 | QPushButton* closeButton; 34 | ColorBox* getColorBox() { return mColorBox; } 35 | void popup(); 36 | 37 | private slots: 38 | void onColorChanged(const QColor& color); 39 | 40 | protected: 41 | ScribbleArea* mContainer; 42 | ColorBox* mColorBox = nullptr; 43 | void keyPressEvent(QKeyEvent *event); 44 | }; 45 | 46 | #endif // POPUPCOLORPALETTEWIDGET_H 47 | -------------------------------------------------------------------------------- /app/src/preferencesdialog.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Pencil2D - Traditional Animation Software 4 | Copyright (C) 2005-2007 Patrick Corrieri & Pascal Naidon 5 | Copyright (C) 2012-2020 Matthew Chiawen Chang 6 | 7 | This program is free software; you can redistribute it and/or 8 | modify it under the terms of the GNU General Public License 9 | as published by the Free Software Foundation; version 2 of the License. 10 | 11 | This program is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | */ 17 | #ifndef PREFERENCESDIALOG_H 18 | #define PREFERENCESDIALOG_H 19 | 20 | #include 21 | 22 | class PreferenceManager; 23 | class QListWidgetItem; 24 | 25 | namespace Ui { 26 | class PreferencesDialog; 27 | } 28 | 29 | class PreferencesDialog : public QDialog 30 | { 31 | Q_OBJECT 32 | 33 | public: 34 | explicit PreferencesDialog(QWidget* parent); 35 | ~PreferencesDialog() override; 36 | 37 | void init(PreferenceManager* m); 38 | void updateRecentListBtn(bool isEmpty); 39 | 40 | public slots: 41 | void changePage(QListWidgetItem* current, QListWidgetItem* previous); 42 | 43 | signals: 44 | void windowOpacityChange(int); 45 | void soundScrubChanged(bool b); 46 | void soundScrubMsecChanged(int mSec); 47 | void curveOpacityChange(int); 48 | void clearRecentList(); 49 | void updateRecentFileListBtn(); 50 | 51 | protected: 52 | void closeEvent(QCloseEvent*) override; 53 | 54 | private: 55 | Ui::PreferencesDialog* ui = nullptr; 56 | 57 | PreferenceManager* mPrefManager = nullptr; 58 | }; 59 | 60 | #endif // PREFERENCESDIALOG_H 61 | -------------------------------------------------------------------------------- /app/src/presetdialog.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Pencil2D - Traditional Animation Software 4 | Copyright (C) 2005-2007 Patrick Corrieri & Pascal Naidon 5 | Copyright (C) 2012-2020 Matthew Chiawen Chang 6 | 7 | This program is free software; you can redistribute it and/or 8 | modify it under the terms of the GNU General Public License 9 | as published by the Free Software Foundation; version 2 of the License. 10 | 11 | This program is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | */ 17 | #ifndef PRESETDIALOG_H 18 | #define PRESETDIALOG_H 19 | 20 | #include 21 | #include "preferencemanager.h" 22 | 23 | namespace Ui 24 | { 25 | class PresetDialog; 26 | } 27 | 28 | class PresetDialog : public QDialog 29 | { 30 | Q_OBJECT 31 | 32 | public: 33 | explicit PresetDialog(PreferenceManager* preferences, QWidget* parent = nullptr); 34 | ~PresetDialog() override; 35 | 36 | static QString getPresetPath(int index); 37 | 38 | int getPresetIndex(); 39 | bool shouldAlwaysUse(); 40 | 41 | private: 42 | void initPresets(); 43 | 44 | Ui::PresetDialog* ui; 45 | PreferenceManager* mPrefs = nullptr; 46 | }; 47 | 48 | #endif // PRESETDIALOG_H 49 | -------------------------------------------------------------------------------- /app/src/repositionframesdialog.h: -------------------------------------------------------------------------------- 1 | #ifndef REPOSITIONFRAMESDIALOG_H 2 | #define REPOSITIONFRAMESDIALOG_H 3 | 4 | #include 5 | #include 6 | 7 | #include "editor.h" 8 | 9 | class ToolManager; 10 | 11 | namespace Ui { 12 | class RepositionFramesDialog; 13 | } 14 | 15 | class RepositionFramesDialog : public QDialog 16 | { 17 | Q_OBJECT 18 | 19 | public: 20 | explicit RepositionFramesDialog(QWidget* parent); 21 | ~RepositionFramesDialog(); 22 | 23 | void setCore(Editor* editor); 24 | void initUI(); 25 | 26 | void setCurrentPolygonF(QPolygonF polygon) { mCurrentPolygonF = polygon; } 27 | 28 | public slots: 29 | void updateDialogText(); 30 | void updateDialogSelectedFrames(); 31 | void repositionFrames(); 32 | void updateRadioButtons(); 33 | void checkboxStateChanged(int i); 34 | void updateLayersBox(); 35 | 36 | signals: 37 | void closeDialog(); 38 | 39 | private: 40 | Ui::RepositionFramesDialog *ui; 41 | 42 | void closeClicked(); 43 | void updateLayersToSelect(); 44 | QPoint getRepositionPoint(); 45 | void prepareRepositionSelectedImages(int repositionFrame); 46 | 47 | int mRepositionFrame = 0; 48 | QList mLayerIndexes; 49 | 50 | QPolygonF mCurrentPolygonF; 51 | QPolygonF mOriginalPolygonF; 52 | QPoint mStartPoint = QPoint(0,0); 53 | QPoint mEndPoint = QPoint(0,0); 54 | Editor* mEditor = nullptr; 55 | }; 56 | 57 | #endif // REPOSITIONFRAMESDIALOG_H 58 | -------------------------------------------------------------------------------- /app/src/shortcutfilter.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Pencil2D - Traditional Animation Software 4 | Copyright (C) 2005-2007 Patrick Corrieri & Pascal Naidon 5 | Copyright (C) 2012-2020 Matthew Chiawen Chang 6 | 7 | This program is free software; you can redistribute it and/or 8 | modify it under the terms of the GNU General Public License 9 | as published by the Free Software Foundation; version 2 of the License. 10 | 11 | This program is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | */ 17 | 18 | #include "shortcutfilter.h" 19 | 20 | ShortcutFilter::ShortcutFilter(ScribbleArea* scribbleArea , QObject* parent) : 21 | QObject(parent) 22 | { 23 | mScribbleArea = scribbleArea; 24 | } 25 | 26 | bool ShortcutFilter::eventFilter(QObject* obj, QEvent* event) 27 | { 28 | if (mScribbleArea->isMouseInUse()) 29 | { 30 | return true; 31 | } 32 | return QObject::eventFilter(obj, event); 33 | } 34 | -------------------------------------------------------------------------------- /app/src/shortcutfilter.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Pencil2D - Traditional Animation Software 4 | Copyright (C) 2005-2007 Patrick Corrieri & Pascal Naidon 5 | Copyright (C) 2012-2020 Matthew Chiawen Chang 6 | 7 | This program is free software; you can redistribute it and/or 8 | modify it under the terms of the GNU General Public License 9 | as published by the Free Software Foundation; version 2 of the License. 10 | 11 | This program is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | */ 17 | #ifndef SHORTCUTFILTER_H 18 | #define SHORTCUTFILTER_H 19 | 20 | #include 21 | #include "scribblearea.h" 22 | 23 | class ShortcutFilter : public QObject 24 | { 25 | Q_OBJECT 26 | 27 | public: 28 | ShortcutFilter(ScribbleArea* scribbleArea, QObject* parent); 29 | protected: 30 | bool eventFilter(QObject* obj, QEvent* event) override; 31 | ScribbleArea* mScribbleArea = nullptr; 32 | }; 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /app/src/toolspage.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Pencil2D - Traditional Animation Software 4 | Copyright (C) 2005-2007 Patrick Corrieri & Pascal Naidon 5 | Copyright (C) 2012-2020 Matthew Chiawen Chang 6 | 7 | This program is free software; you can redistribute it and/or 8 | modify it under the terms of the GNU General Public License 9 | as published by the Free Software Foundation; version 2 of the License. 10 | 11 | This program is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | */ 17 | 18 | #ifndef TOOLSPAGE_H 19 | #define TOOLSPAGE_H 20 | 21 | class PreferenceManager; 22 | 23 | namespace Ui { 24 | class ToolsPage; 25 | } 26 | 27 | class ToolsPage : public QWidget 28 | { 29 | Q_OBJECT 30 | public: 31 | ToolsPage(); 32 | ~ToolsPage() override; 33 | void setManager(PreferenceManager* p) { mManager = p; } 34 | 35 | public slots: 36 | void updateValues(); 37 | void quickSizingChange(int); 38 | void setRotationIncrement(int); 39 | void rotationIncrementChange(int); 40 | void invertZoomDirectionChange(int); 41 | private: 42 | Ui::ToolsPage* ui = nullptr; 43 | PreferenceManager* mManager = nullptr; 44 | }; 45 | 46 | #endif // TOOLSPAGE_H 47 | -------------------------------------------------------------------------------- /app/translations/mui.pot: -------------------------------------------------------------------------------- 1 | #. extracted from data\mui.rc 2 | msgid "" 3 | msgstr "" 4 | "Project-Id-Version: PACKAGE VERSION\n" 5 | "Report-Msgid-Bugs-To: \n" 6 | "POT-Creation-Date: 2023-09-22 15:26+0200\n" 7 | "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 8 | "Last-Translator: FULL NAME \n" 9 | "Language-Team: LANGUAGE \n" 10 | "MIME-Version: 1.0\n" 11 | "Content-Type: text/plain; charset=UTF-8\n" 12 | "Content-Transfer-Encoding: 8bit\n" 13 | "X-Accelerator-Marker: &\n" 14 | "X-Generator: Translate Toolkit 3.9.0\n" 15 | "X-Merge-On: location\n" 16 | 17 | #: STRINGTABLE.0 18 | msgid "Pencil2D" 19 | msgstr "" 20 | 21 | #: STRINGTABLE.1 22 | msgid "Pencil2D Animation" 23 | msgstr "" 24 | 25 | #: STRINGTABLE.2 26 | msgid "Pencil2D Animation (Old Format)" 27 | msgstr "" 28 | -------------------------------------------------------------------------------- /app/translations/mui_cs.po: -------------------------------------------------------------------------------- 1 | # 2 | # Translators: 3 | # fri, 2024 4 | # 5 | msgid "" 6 | msgstr "" 7 | "Project-Id-Version: PACKAGE VERSION\n" 8 | "Report-Msgid-Bugs-To: \n" 9 | "POT-Creation-Date: 2023-09-22 15:26+0200\n" 10 | "PO-Revision-Date: 2024-05-19 14:29+0000\n" 11 | "Last-Translator: fri, 2024\n" 12 | "Language-Team: Czech (https://app.transifex.com/pencil2d/teams/76612/cs/)\n" 13 | "MIME-Version: 1.0\n" 14 | "Content-Type: text/plain; charset=UTF-8\n" 15 | "Content-Transfer-Encoding: 8bit\n" 16 | "Language: cs\n" 17 | "Plural-Forms: nplurals=4; plural=(n == 1 && n % 1 == 0) ? 0 : (n >= 2 && n <= 4 && n % 1 == 0) ? 1: (n % 1 != 0 ) ? 2 : 3;\n" 18 | "X-Accelerator-Marker: &\n" 19 | "X-Generator: Translate Toolkit 3.9.0\n" 20 | "X-Merge-On: location\n" 21 | 22 | #: STRINGTABLE.0 23 | msgid "Pencil2D" 24 | msgstr "Pencil2D" 25 | 26 | #: STRINGTABLE.1 27 | msgid "Pencil2D Animation" 28 | msgstr "Animace Pencil2D" 29 | 30 | #: STRINGTABLE.2 31 | msgid "Pencil2D Animation (Old Format)" 32 | msgstr "Animace Pencil2D (starý formát)" 33 | -------------------------------------------------------------------------------- /app/translations/mui_de.po: -------------------------------------------------------------------------------- 1 | # 2 | # Translators: 3 | # Jakob , 2024 4 | # 5 | msgid "" 6 | msgstr "" 7 | "Project-Id-Version: PACKAGE VERSION\n" 8 | "Report-Msgid-Bugs-To: \n" 9 | "POT-Creation-Date: 2023-09-22 15:26+0200\n" 10 | "PO-Revision-Date: 2024-05-19 14:29+0000\n" 11 | "Last-Translator: Jakob , 2024\n" 12 | "Language-Team: German (https://app.transifex.com/pencil2d/teams/76612/de/)\n" 13 | "MIME-Version: 1.0\n" 14 | "Content-Type: text/plain; charset=UTF-8\n" 15 | "Content-Transfer-Encoding: 8bit\n" 16 | "Language: de\n" 17 | "Plural-Forms: nplurals=2; plural=(n != 1);\n" 18 | "X-Accelerator-Marker: &\n" 19 | "X-Generator: Translate Toolkit 3.9.0\n" 20 | "X-Merge-On: location\n" 21 | 22 | #: STRINGTABLE.0 23 | msgid "Pencil2D" 24 | msgstr "Pencil2D" 25 | 26 | #: STRINGTABLE.1 27 | msgid "Pencil2D Animation" 28 | msgstr "Pencil2D-Animation" 29 | 30 | #: STRINGTABLE.2 31 | msgid "Pencil2D Animation (Old Format)" 32 | msgstr "Pencil2D-Animation (altes Format)" 33 | -------------------------------------------------------------------------------- /app/translations/mui_it.po: -------------------------------------------------------------------------------- 1 | # 2 | # Translators: 3 | # Mattia Rizzolo , 2024 4 | # albanobattistella , 2024 5 | # 6 | msgid "" 7 | msgstr "" 8 | "Project-Id-Version: PACKAGE VERSION\n" 9 | "Report-Msgid-Bugs-To: \n" 10 | "POT-Creation-Date: 2023-09-22 15:26+0200\n" 11 | "PO-Revision-Date: 2024-05-19 14:29+0000\n" 12 | "Last-Translator: albanobattistella , 2024\n" 13 | "Language-Team: Italian (https://app.transifex.com/pencil2d/teams/76612/it/)\n" 14 | "MIME-Version: 1.0\n" 15 | "Content-Type: text/plain; charset=UTF-8\n" 16 | "Content-Transfer-Encoding: 8bit\n" 17 | "Language: it\n" 18 | "Plural-Forms: nplurals=3; plural=n == 1 ? 0 : n != 0 && n % 1000000 == 0 ? 1 : 2;\n" 19 | "X-Accelerator-Marker: &\n" 20 | "X-Generator: Translate Toolkit 3.9.0\n" 21 | "X-Merge-On: location\n" 22 | 23 | #: STRINGTABLE.0 24 | msgid "Pencil2D" 25 | msgstr "Pencil2D" 26 | 27 | #: STRINGTABLE.1 28 | msgid "Pencil2D Animation" 29 | msgstr "Animazione Pencil2D" 30 | 31 | #: STRINGTABLE.2 32 | msgid "Pencil2D Animation (Old Format)" 33 | msgstr "Animazione Pencil2D (vecchio formato)" 34 | -------------------------------------------------------------------------------- /app/translations/mui_yue.po: -------------------------------------------------------------------------------- 1 | # 2 | # Translators: 3 | # Yu Chen , 2024 4 | # Matt Chang, 2024 5 | # 6 | msgid "" 7 | msgstr "" 8 | "Project-Id-Version: PACKAGE VERSION\n" 9 | "Report-Msgid-Bugs-To: \n" 10 | "POT-Creation-Date: 2023-09-22 15:26+0200\n" 11 | "PO-Revision-Date: 2024-05-19 14:29+0000\n" 12 | "Last-Translator: Matt Chang, 2024\n" 13 | "Language-Team: Cantonese (https://app.transifex.com/pencil2d/teams/76612/yue/)\n" 14 | "MIME-Version: 1.0\n" 15 | "Content-Type: text/plain; charset=UTF-8\n" 16 | "Content-Transfer-Encoding: 8bit\n" 17 | "Language: yue\n" 18 | "Plural-Forms: nplurals=1; plural=0;\n" 19 | "X-Accelerator-Marker: &\n" 20 | "X-Generator: Translate Toolkit 3.9.0\n" 21 | "X-Merge-On: location\n" 22 | 23 | #: STRINGTABLE.0 24 | msgid "Pencil2D" 25 | msgstr "Pencil2D" 26 | 27 | #: STRINGTABLE.1 28 | msgid "Pencil2D Animation" 29 | msgstr "Pencil2D動畫" 30 | 31 | #: STRINGTABLE.2 32 | msgid "Pencil2D Animation (Old Format)" 33 | msgstr "Pencil2D動畫 (舊格式)" 34 | -------------------------------------------------------------------------------- /app/translations/mui_zh_CN.po: -------------------------------------------------------------------------------- 1 | # 2 | # Translators: 3 | # Yu Chen , 2024 4 | # Matt Chang, 2024 5 | # 6 | msgid "" 7 | msgstr "" 8 | "Project-Id-Version: PACKAGE VERSION\n" 9 | "Report-Msgid-Bugs-To: \n" 10 | "POT-Creation-Date: 2023-09-22 15:26+0200\n" 11 | "PO-Revision-Date: 2024-05-19 14:29+0000\n" 12 | "Last-Translator: Matt Chang, 2024\n" 13 | "Language-Team: Chinese (China) (https://app.transifex.com/pencil2d/teams/76612/zh_CN/)\n" 14 | "MIME-Version: 1.0\n" 15 | "Content-Type: text/plain; charset=UTF-8\n" 16 | "Content-Transfer-Encoding: 8bit\n" 17 | "Language: zh_CN\n" 18 | "Plural-Forms: nplurals=1; plural=0;\n" 19 | "X-Accelerator-Marker: &\n" 20 | "X-Generator: Translate Toolkit 3.9.0\n" 21 | "X-Merge-On: location\n" 22 | 23 | #: STRINGTABLE.0 24 | msgid "Pencil2D" 25 | msgstr "Pencil2D" 26 | 27 | #: STRINGTABLE.1 28 | msgid "Pencil2D Animation" 29 | msgstr "Pencil2D動畫" 30 | 31 | #: STRINGTABLE.2 32 | msgid "Pencil2D Animation (Old Format)" 33 | msgstr "Pencil2D動畫 (舊格式)" 34 | -------------------------------------------------------------------------------- /app/translations/mui_zh_TW.po: -------------------------------------------------------------------------------- 1 | # 2 | # Translators: 3 | # Matt Chang, 2024 4 | # 5 | msgid "" 6 | msgstr "" 7 | "Project-Id-Version: PACKAGE VERSION\n" 8 | "Report-Msgid-Bugs-To: \n" 9 | "POT-Creation-Date: 2023-09-22 15:26+0200\n" 10 | "PO-Revision-Date: 2024-05-19 14:29+0000\n" 11 | "Last-Translator: Matt Chang, 2024\n" 12 | "Language-Team: Chinese (Taiwan) (https://app.transifex.com/pencil2d/teams/76612/zh_TW/)\n" 13 | "MIME-Version: 1.0\n" 14 | "Content-Type: text/plain; charset=UTF-8\n" 15 | "Content-Transfer-Encoding: 8bit\n" 16 | "Language: zh_TW\n" 17 | "Plural-Forms: nplurals=1; plural=0;\n" 18 | "X-Accelerator-Marker: &\n" 19 | "X-Generator: Translate Toolkit 3.9.0\n" 20 | "X-Merge-On: location\n" 21 | 22 | #: STRINGTABLE.0 23 | msgid "Pencil2D" 24 | msgstr "Pencil2D" 25 | 26 | #: STRINGTABLE.1 27 | msgid "Pencil2D Animation" 28 | msgstr "Pencil2D動畫" 29 | 30 | #: STRINGTABLE.2 31 | msgid "Pencil2D Animation (Old Format)" 32 | msgstr "Pencil2D動畫 (舊格式)" 33 | -------------------------------------------------------------------------------- /app/ui/doubleprogressdialog.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | DoubleProgressDialog 4 | 5 | 6 | 7 | 0 8 | 0 9 | 400 10 | 132 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 24 21 | 22 | 23 | 24 | 25 | 26 | 27 | Loading... 28 | 29 | 30 | 31 | 32 | 33 | 34 | 24 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | Qt::Horizontal 44 | 45 | 46 | 47 | 40 48 | 20 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | Cancel 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | -------------------------------------------------------------------------------- /app/ui/importimageseqoptions.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | ImportImageSeqOptions 4 | 5 | 6 | 7 | 0 8 | 0 9 | 210 10 | 90 11 | 12 | 13 | 14 | 15 | 0 16 | 0 17 | 18 | 19 | 20 | 21 | 0 22 | 23 | 24 | 2 25 | 26 | 27 | 0 28 | 29 | 30 | 2 31 | 32 | 33 | 0 34 | 35 | 36 | 37 | 38 | Import an image every # frame 39 | 40 | 41 | 42 | 43 | 44 | 45 | 1 46 | 47 | 48 | 64 49 | 50 | 51 | 1 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | -------------------------------------------------------------------------------- /app/ui/importimageseqpreview.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | ImportImageSeqPreviewGroupBox 4 | 5 | 6 | 7 | 0 8 | 0 9 | 400 10 | 300 11 | 12 | 13 | 14 | GroupBox 15 | 16 | 17 | 18 | 0 19 | 20 | 21 | 2 22 | 23 | 24 | 0 25 | 26 | 27 | 2 28 | 29 | 30 | 0 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /core_lib/data/core_lib.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | resources/kb.ini 4 | 5 | 6 | -------------------------------------------------------------------------------- /core_lib/data/icons/brush.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pencil2d/pencil/a9013b659d3ec6786ea4148c386fe61adad346a2/core_lib/data/icons/brush.png -------------------------------------------------------------------------------- /core_lib/data/icons/bucketTool.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pencil2d/pencil/a9013b659d3ec6786ea4148c386fe61adad346a2/core_lib/data/icons/bucketTool.png -------------------------------------------------------------------------------- /core_lib/data/icons/eyedropper.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pencil2d/pencil/a9013b659d3ec6786ea4148c386fe61adad346a2/core_lib/data/icons/eyedropper.png -------------------------------------------------------------------------------- /core_lib/data/icons/liquify.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pencil2d/pencil/a9013b659d3ec6786ea4148c386fe61adad346a2/core_lib/data/icons/liquify.png -------------------------------------------------------------------------------- /core_lib/data/icons/pen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pencil2d/pencil/a9013b659d3ec6786ea4148c386fe61adad346a2/core_lib/data/icons/pen.png -------------------------------------------------------------------------------- /core_lib/data/icons/pencil2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pencil2d/pencil/a9013b659d3ec6786ea4148c386fe61adad346a2/core_lib/data/icons/pencil2.png -------------------------------------------------------------------------------- /core_lib/data/icons/smudge.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pencil2d/pencil/a9013b659d3ec6786ea4148c386fe61adad346a2/core_lib/data/icons/smudge.png -------------------------------------------------------------------------------- /core_lib/src/corelib-pch.h: -------------------------------------------------------------------------------- 1 | 2 | /* Add C includes here */ 3 | 4 | #if defined __cplusplus 5 | /* Add C++ includes here */ 6 | 7 | #include 8 | #include 9 | #include 10 | #endif 11 | -------------------------------------------------------------------------------- /core_lib/src/external/macosx/macosxnative.h: -------------------------------------------------------------------------------- 1 | #ifndef MACOSXNATIVE_H 2 | #define MACOSXNATIVE_H 3 | 4 | namespace MacOSXNative 5 | { 6 | void removeUnwantedMenuItems(); 7 | 8 | bool isMouseCoalescingEnabled(); 9 | void setMouseCoalescingEnabled(bool enabled); 10 | bool isDarkMode(); 11 | } 12 | 13 | #endif // MACOSXNATIVE_H 14 | -------------------------------------------------------------------------------- /core_lib/src/external/macosx/macosxnative.mm: -------------------------------------------------------------------------------- 1 | #include "macosxnative.h" 2 | 3 | #include 4 | #include 5 | #include 6 | 7 | namespace MacOSXNative 8 | { 9 | #if !defined(MAC_OS_X_VERSION_10_14) || MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_14 10 | NSString* const NSAppearanceNameDarkAqua = @"NSAppearanceNameDarkAqua"; 11 | #endif 12 | 13 | void removeUnwantedMenuItems() 14 | { 15 | // Remove "Show Tab Bar" option from the "View" menu if possible 16 | 17 | if ([NSWindow respondsToSelector:@selector(allowsAutomaticWindowTabbing)]) 18 | { 19 | NSWindow.allowsAutomaticWindowTabbing = NO; 20 | } 21 | } 22 | 23 | bool isMouseCoalescingEnabled() 24 | { 25 | return NSEvent.isMouseCoalescingEnabled; 26 | } 27 | 28 | void setMouseCoalescingEnabled(bool enabled) 29 | { 30 | NSEvent.mouseCoalescingEnabled = enabled; 31 | } 32 | 33 | bool isDarkMode() 34 | { 35 | if (@available(macOS 10.14, *)) 36 | { 37 | NSAppearanceName appearance = 38 | [[NSApp effectiveAppearance] bestMatchFromAppearancesWithNames:@[ 39 | NSAppearanceNameAqua, NSAppearanceNameDarkAqua 40 | ]]; 41 | return [appearance isEqual:NSAppearanceNameDarkAqua]; 42 | } 43 | return false; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /core_lib/src/external/platformhandler.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Pencil2D - Traditional Animation Software 4 | Copyright (C) 2005-2007 Patrick Corrieri & Pascal Naidon 5 | Copyright (C) 2012-2020 Matthew Chiawen Chang 6 | 7 | This program is free software; you can redistribute it and/or 8 | modify it under the terms of the GNU General Public License 9 | as published by the Free Software Foundation; version 2 of the License. 10 | 11 | This program is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | */ 17 | #ifndef PLATFORMHANDLER_H 18 | #define PLATFORMHANDLER_H 19 | 20 | namespace PlatformHandler 21 | { 22 | 23 | void configurePlatformSpecificSettings(); 24 | bool isDarkMode(); 25 | void initialise(); 26 | 27 | } 28 | 29 | #endif // PLATFORMHANDLER_H 30 | -------------------------------------------------------------------------------- /core_lib/src/graphics/bitmap/tile.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Pencil2D - Traditional Animation Software 4 | Copyright (C) 2012-2020 Matthew Chiawen Chang 5 | 6 | This program is free software; you can redistribute it and/or 7 | modify it under the terms of the GNU General Public License 8 | as published by the Free Software Foundation; version 2 of the License. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | */ 16 | 17 | #include "tile.h" 18 | 19 | #include 20 | 21 | Tile::Tile(const QPoint& pos, QSize size): 22 | mTilePixmap(size), 23 | mPosF(pos), 24 | mPos(pos), 25 | mBounds(pos, size), 26 | mSize(size) 27 | { 28 | clear(); //Default tiles are transparent 29 | } 30 | 31 | Tile::~Tile() 32 | { 33 | } 34 | 35 | void Tile::load(const QImage& image, const QPoint& topLeft) 36 | { 37 | QPainter painter(&mTilePixmap); 38 | 39 | painter.translate(-mPos); 40 | painter.drawImage(topLeft, image); 41 | painter.end(); 42 | } 43 | 44 | void Tile::clear() 45 | { 46 | mTilePixmap.fill(Qt::transparent); 47 | } 48 | -------------------------------------------------------------------------------- /core_lib/src/graphics/bitmap/tile.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Pencil2D - Traditional Animation Software 4 | Copyright (C) 2012-2020 Matthew Chiawen Chang 5 | 6 | This program is free software; you can redistribute it and/or 7 | modify it under the terms of the GNU General Public License 8 | as published by the Free Software Foundation; version 2 of the License. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | */ 16 | 17 | #ifndef TILE_H 18 | #define TILE_H 19 | 20 | #include 21 | #include 22 | 23 | class Tile 24 | { 25 | public: 26 | 27 | explicit Tile (const QPoint& pos, QSize size); 28 | ~Tile(); 29 | 30 | const QPixmap& pixmap() const { return mTilePixmap; } 31 | QPixmap& pixmap() { return mTilePixmap; } 32 | 33 | const QPoint& pos() const { return mPos; } 34 | const QPointF& posF() const { return mPosF; } 35 | const QRect& bounds() const { return mBounds; } 36 | const QSize& size() const { return mSize; } 37 | 38 | /** Loads the input image into the tile */ 39 | void load(const QImage& image, const QPoint& topLeft); 40 | void clear(); 41 | 42 | private: 43 | QPixmap mTilePixmap; 44 | QPointF mPosF; 45 | QPoint mPos; 46 | QRect mBounds; 47 | QSize mSize; 48 | }; 49 | 50 | #endif // TILE_H 51 | -------------------------------------------------------------------------------- /core_lib/src/graphics/vector/bezierarea.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Pencil2D - Traditional Animation Software 4 | Copyright (C) 2005-2007 Patrick Corrieri & Pascal Naidon 5 | Copyright (C) 2012-2020 Matthew Chiawen Chang 6 | 7 | This program is free software; you can redistribute it and/or 8 | modify it under the terms of the GNU General Public License 9 | as published by the Free Software Foundation; version 2 of the License. 10 | 11 | This program is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | */ 17 | #ifndef BEZIERAREA_H 18 | #define BEZIERAREA_H 19 | 20 | 21 | #include 22 | 23 | #include "vertexref.h" 24 | 25 | class Status; 26 | class QXmlStreamWriter; 27 | class QDomElement; 28 | 29 | 30 | class BezierArea 31 | { 32 | public: 33 | BezierArea(); 34 | BezierArea(QList vertexList, int color); 35 | 36 | Status createDomElement(QXmlStreamWriter& xmlStream); 37 | void loadDomElement(const QDomElement& element); 38 | 39 | VertexRef getVertexRef(int i); 40 | int getColorNumber() { return mColorNumber; } 41 | void decreaseColorNumber() { mColorNumber--; } 42 | void setSelected(bool YesOrNo); 43 | bool isSelected() const { return mSelected; } 44 | void setColorNumber(int cn) { mColorNumber = cn; } 45 | 46 | QList mVertex; 47 | QPainterPath mPath; 48 | int mColorNumber = 0; 49 | 50 | private: 51 | bool mSelected = false; 52 | bool mIsFilled = false; 53 | }; 54 | 55 | #endif 56 | -------------------------------------------------------------------------------- /core_lib/src/graphics/vector/colorref.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Pencil2D - Traditional Animation Software 4 | Copyright (C) 2005-2007 Patrick Corrieri & Pascal Naidon 5 | Copyright (C) 2012-2020 Matthew Chiawen Chang 6 | 7 | This program is free software; you can redistribute it and/or 8 | modify it under the terms of the GNU General Public License 9 | as published by the Free Software Foundation; version 2 of the License. 10 | 11 | This program is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | */ 17 | 18 | #ifndef COLORREF_H 19 | #define COLORREF_H 20 | 21 | #include 22 | #include 23 | #include 24 | 25 | class ColorRef 26 | { 27 | Q_DECLARE_TR_FUNCTIONS(ColorRef) 28 | public: 29 | ColorRef(); 30 | ColorRef(QColor theColor, QString theName = QString()); 31 | bool operator==(ColorRef colorRef1); 32 | bool operator!=(ColorRef colorRef1); 33 | 34 | QColor color; 35 | QString name; 36 | 37 | static QString getDefaultColorName(const QColor c); 38 | }; 39 | 40 | QDebug& operator<<(QDebug debug, const ColorRef &colorRef); 41 | 42 | #endif 43 | -------------------------------------------------------------------------------- /core_lib/src/graphics/vector/vectorselection.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Pencil2D - Traditional Animation Software 4 | Copyright (C) 2005-2007 Patrick Corrieri & Pascal Naidon 5 | Copyright (C) 2012-2020 Matthew Chiawen Chang 6 | 7 | This program is free software; you can redistribute it and/or 8 | modify it under the terms of the GNU General Public License 9 | as published by the Free Software Foundation; version 2 of the License. 10 | 11 | This program is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | */ 17 | 18 | #include "vectorselection.h" 19 | 20 | VectorSelection::VectorSelection() 21 | { 22 | } 23 | 24 | void VectorSelection::clear() 25 | { 26 | vertex.clear(); 27 | curve.clear(); 28 | } 29 | 30 | void VectorSelection::add(int curveNumber) 31 | { 32 | curve << curveNumber; 33 | } 34 | 35 | void VectorSelection::add(QList list) 36 | { 37 | if (list.size() > 0) add(list[0]); 38 | } 39 | 40 | void VectorSelection::add(VertexRef point) 41 | { 42 | vertex << point; 43 | add(point.curveNumber); 44 | } 45 | 46 | void VectorSelection::add(QList list) 47 | { 48 | if (list.size() > 0) add(list[0]); 49 | } 50 | -------------------------------------------------------------------------------- /core_lib/src/graphics/vector/vectorselection.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Pencil2D - Traditional Animation Software 4 | Copyright (C) 2005-2007 Patrick Corrieri & Pascal Naidon 5 | Copyright (C) 2012-2020 Matthew Chiawen Chang 6 | 7 | This program is free software; you can redistribute it and/or 8 | modify it under the terms of the GNU General Public License 9 | as published by the Free Software Foundation; version 2 of the License. 10 | 11 | This program is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | */ 17 | 18 | #ifndef VECTORSELECTION_H 19 | #define VECTORSELECTION_H 20 | 21 | 22 | #include 23 | #include "vertexref.h" 24 | 25 | class VectorSelection 26 | { 27 | public: 28 | VectorSelection(); 29 | 30 | void clear(); 31 | void add(int curveNumber); 32 | void add(QList curveNumbers); 33 | void add(VertexRef point); 34 | void add(QList points); 35 | 36 | QList vertex; 37 | QList curve; 38 | }; 39 | 40 | #endif // VECTORSELECTION_H 41 | -------------------------------------------------------------------------------- /core_lib/src/graphics/vector/vertexref.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Pencil2D - Traditional Animation Software 4 | Copyright (C) 2005-2007 Patrick Corrieri & Pascal Naidon 5 | Copyright (C) 2012-2020 Matthew Chiawen Chang 6 | 7 | This program is free software; you can redistribute it and/or 8 | modify it under the terms of the GNU General Public License 9 | as published by the Free Software Foundation; version 2 of the License. 10 | 11 | This program is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | */ 17 | 18 | #include "vertexref.h" 19 | 20 | VertexRef::VertexRef() 21 | { 22 | } 23 | 24 | VertexRef::VertexRef(int curveN, int vertexN) 25 | { 26 | curveNumber = curveN; 27 | vertexNumber = vertexN; 28 | } 29 | 30 | VertexRef VertexRef::nextVertex() const 31 | { 32 | return VertexRef(curveNumber, vertexNumber+1); 33 | } 34 | 35 | VertexRef VertexRef::prevVertex() const 36 | { 37 | return VertexRef(curveNumber, vertexNumber-1); 38 | } 39 | 40 | bool VertexRef::operator==(VertexRef vertexRef1) const 41 | { 42 | if ( (curveNumber == vertexRef1.curveNumber) && (vertexNumber == vertexRef1.vertexNumber)) 43 | { 44 | return true; 45 | } 46 | else 47 | { 48 | return false; 49 | } 50 | } 51 | 52 | bool VertexRef::operator!=(VertexRef vertexRef1) const 53 | { 54 | if ( (curveNumber != vertexRef1.curveNumber) || (vertexNumber != vertexRef1.vertexNumber)) 55 | { 56 | return true; 57 | } 58 | else 59 | { 60 | return false; 61 | } 62 | } 63 | 64 | 65 | -------------------------------------------------------------------------------- /core_lib/src/graphics/vector/vertexref.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Pencil2D - Traditional Animation Software 4 | Copyright (C) 2005-2007 Patrick Corrieri & Pascal Naidon 5 | Copyright (C) 2012-2020 Matthew Chiawen Chang 6 | 7 | This program is free software; you can redistribute it and/or 8 | modify it under the terms of the GNU General Public License 9 | as published by the Free Software Foundation; version 2 of the License. 10 | 11 | This program is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | */ 17 | 18 | #ifndef VERTEXREF_H 19 | #define VERTEXREF_H 20 | 21 | class VertexRef 22 | { 23 | public: 24 | VertexRef(); 25 | VertexRef(int curveN, int vertexN); 26 | VertexRef nextVertex() const; 27 | VertexRef prevVertex() const; 28 | bool operator==(VertexRef vertexRef1) const; 29 | bool operator!=(VertexRef vertexRef1) const; 30 | 31 | int curveNumber = -1; 32 | int vertexNumber = -1; 33 | }; 34 | 35 | #endif 36 | 37 | -------------------------------------------------------------------------------- /core_lib/src/interface/backgroundwidget.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Pencil2D - Traditional Animation Software 4 | Copyright (C) 2005-2007 Patrick Corrieri & Pascal Naidon 5 | Copyright (C) 2012-2020 Matthew Chiawen Chang 6 | 7 | This program is free software; you can redistribute it and/or 8 | modify it under the terms of the GNU General Public License 9 | as published by the Free Software Foundation; version 2 of the License. 10 | 11 | This program is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | */ 17 | 18 | #ifndef BACKGROUNDWIDGET_H 19 | #define BACKGROUNDWIDGET_H 20 | 21 | #include 22 | #include "preferencemanager.h" 23 | 24 | 25 | class BackgroundWidget : public QWidget 26 | { 27 | Q_OBJECT 28 | public: 29 | BackgroundWidget( QWidget* parent ); 30 | ~BackgroundWidget() override; 31 | 32 | void init(PreferenceManager* prefs); 33 | 34 | public slots: 35 | 36 | protected: 37 | 38 | void paintEvent(QPaintEvent* event) override; 39 | 40 | 41 | private slots: 42 | 43 | void settingUpdated(SETTING setting); 44 | 45 | private: 46 | 47 | void drawShadow(QPainter& painter); 48 | void loadBackgroundStyle(); 49 | 50 | PreferenceManager* mPrefs = nullptr; 51 | 52 | QString mStyle; 53 | bool mHasShadow = false; 54 | 55 | }; 56 | 57 | #endif // BACKGROUNDWIDGET_H 58 | -------------------------------------------------------------------------------- /core_lib/src/managers/basemanager.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Pencil2D - Traditional Animation Software 4 | Copyright (C) 2005-2007 Patrick Corrieri & Pascal Naidon 5 | Copyright (C) 2012-2020 Matthew Chiawen Chang 6 | 7 | This program is free software; you can redistribute it and/or 8 | modify it under the terms of the GNU General Public License 9 | as published by the Free Software Foundation; version 2 of the License. 10 | 11 | This program is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | */ 17 | 18 | #include "basemanager.h" 19 | #include "editor.h" 20 | #include 21 | 22 | BaseManager::BaseManager(Editor* editor, const QString& name) : QObject(editor) 23 | { 24 | Q_ASSERT(editor != nullptr); 25 | mEditor = editor; 26 | setObjectName(name); 27 | } 28 | 29 | BaseManager::~BaseManager() 30 | { 31 | mEditor = nullptr; 32 | } 33 | 34 | Object* BaseManager::object() const 35 | { 36 | return mEditor->object(); 37 | } 38 | -------------------------------------------------------------------------------- /core_lib/src/managers/basemanager.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Pencil2D - Traditional Animation Software 4 | Copyright (C) 2005-2007 Patrick Corrieri & Pascal Naidon 5 | Copyright (C) 2012-2020 Matthew Chiawen Chang 6 | 7 | This program is free software; you can redistribute it and/or 8 | modify it under the terms of the GNU General Public License 9 | as published by the Free Software Foundation; version 2 of the License. 10 | 11 | This program is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | */ 17 | 18 | #ifndef BASEMANAGER_H 19 | #define BASEMANAGER_H 20 | 21 | #include 22 | #include "pencilerror.h" 23 | 24 | class Object; 25 | class Layer; 26 | class Editor; 27 | 28 | class BaseManager : public QObject 29 | { 30 | Q_OBJECT 31 | protected: 32 | explicit BaseManager(Editor* editor, const QString& name); 33 | virtual ~BaseManager(); 34 | 35 | public: 36 | Editor* editor() const { return mEditor; } 37 | Object* object() const; 38 | 39 | virtual bool init() = 0; 40 | virtual Status load(Object* o) = 0; 41 | virtual Status save(Object* o) = 0; 42 | virtual void workingLayerChanged(Layer*) {} 43 | 44 | private: 45 | Editor* mEditor = nullptr; 46 | }; 47 | 48 | #endif // BASEMANAGER_H 49 | -------------------------------------------------------------------------------- /core_lib/src/managers/soundmanager.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Pencil2D - Traditional Animation Software 4 | Copyright (C) 2005-2007 Patrick Corrieri & Pascal Naidon 5 | Copyright (C) 2012-2020 Matthew Chiawen Chang 6 | 7 | This program is free software; you can redistribute it and/or 8 | modify it under the terms of the GNU General Public License 9 | as published by the Free Software Foundation; version 2 of the License. 10 | 11 | This program is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | */ 17 | 18 | #ifndef SOUNDMANAGER_H 19 | #define SOUNDMANAGER_H 20 | 21 | #include 22 | #include "basemanager.h" 23 | 24 | class Layer; 25 | class SoundClip; 26 | class SoundPlayer; 27 | 28 | 29 | class SoundManager : public BaseManager 30 | { 31 | Q_OBJECT 32 | public: 33 | 34 | explicit SoundManager(Editor* editor); 35 | ~SoundManager() override; 36 | 37 | bool init() override; 38 | Status load(Object*) override; 39 | Status save(Object*) override; 40 | 41 | Status loadSound(SoundClip* soundClip, QString strSoundFile); 42 | Status processSound(SoundClip* soundClip); 43 | 44 | int soundClipCount() const; 45 | 46 | signals: 47 | void soundClipDurationChanged(); 48 | 49 | private: 50 | void onDurationChanged(SoundPlayer* player, int64_t duration); 51 | 52 | Status createMediaPlayer(SoundClip*); 53 | }; 54 | 55 | #endif // SOUNDMANAGER_H 56 | -------------------------------------------------------------------------------- /core_lib/src/onionskinsubpainter.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Pencil2D - Traditional Animation Software 4 | Copyright (C) 2012-2020 Matthew Chiawen Chang 5 | 6 | This program is free software; you can redistribute it and/or 7 | modify it under the terms of the GNU General Public License 8 | as published by the Free Software Foundation; version 2 of the License. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | */ 16 | #ifndef ONIONSKINSUBPAINTER_H 17 | #define ONIONSKINSUBPAINTER_H 18 | 19 | #include 20 | 21 | #include "onionskinpaintstate.h" 22 | 23 | class Layer; 24 | struct OnionSkinPainterOptions; 25 | class QPainter; 26 | 27 | /// A Sub Painter class is meant to be used in existing painter classes 28 | /// It does not and should not cary the same responsibility as a Painter class 29 | /// It works as a sort of utility class for functionality that makes sense to reuse 30 | /// Eg. OnionSkinSubPainter is used by CanvasPainter and CameraPainter 31 | class OnionSkinSubPainter 32 | { 33 | public: 34 | explicit OnionSkinSubPainter(); 35 | void paint(QPainter& painter, const Layer* layer, const OnionSkinPainterOptions& options, int frameIndex, const std::function& state) const; 36 | }; 37 | 38 | #endif // ONIONSKINSUBPAINTER_H 39 | -------------------------------------------------------------------------------- /core_lib/src/qminiz.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Pencil2D - Traditional Animation Software 4 | Copyright (C) 2012-2020 Matthew Chiawen Chang 5 | 6 | This program is free software; you can redistribute it and/or 7 | modify it under the terms of the GNU General Public License 8 | as published by the Free Software Foundation; version 2 of the License. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | */ 16 | #ifndef QMINIZ_H 17 | #define QMINIZ_H 18 | 19 | #include 20 | #include "miniz.h" 21 | #include "pencilerror.h" 22 | 23 | namespace MiniZ 24 | { 25 | Status sanityCheck(const QString& sZipFilePath); 26 | size_t istreamReadCallback(void *pOpaque, mz_uint64 file_ofs, void * pBuf, size_t n); 27 | Status compressFolder(QString zipFilePath, QString srcFolderPath, const QStringList& fileList, QString mimetype); 28 | Status uncompressFolder(QString zipFilePath, QString destPath); 29 | } 30 | #endif 31 | -------------------------------------------------------------------------------- /core_lib/src/selectionpainter.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Pencil2D - Traditional Animation Software 4 | Copyright (C) 2005-2007 Patrick Corrieri & Pascal Naidon 5 | Copyright (C) 2012-2020 Matthew Chiawen Chang 6 | 7 | This program is free software; you can redistribute it and/or 8 | modify it under the terms of the GNU General Public License 9 | as published by the Free Software Foundation; version 2 of the License. 10 | 11 | This program is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | */ 17 | #ifndef SelectionPainter_H 18 | #define SelectionPainter_H 19 | 20 | #include 21 | #include 22 | #include 23 | 24 | class QPainter; 25 | class Object; 26 | class BaseTool; 27 | 28 | struct TransformParameters 29 | { 30 | QRectF originalSelectionRectF; 31 | 32 | QTransform viewTransform; 33 | QTransform selectionTransform; 34 | }; 35 | 36 | class SelectionPainter 37 | { 38 | public: 39 | SelectionPainter(); 40 | 41 | void paint(QPainter& painter, const Object* object, int layerIndex, BaseTool* tool, TransformParameters& transformParameters); 42 | 43 | private: 44 | void paintSelectionInfo(QPainter& painter, const QTransform& mergedTransform, const QTransform& viewTransform, const QRectF& selectionRect, const QPolygonF& projectedPolygonF); 45 | 46 | const static int HANDLE_WIDTH = 6; 47 | }; 48 | 49 | #endif // SelectionPainter_H 50 | -------------------------------------------------------------------------------- /core_lib/src/soundplayer.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Pencil2D - Traditional Animation Software 4 | Copyright (C) 2012-2020 Matthew Chiawen Chang 5 | 6 | This program is free software; you can redistribute it and/or 7 | modify it under the terms of the GNU General Public License 8 | as published by the Free Software Foundation; version 2 of the License. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | */ 16 | 17 | #ifndef SOUNDPLAYER_H 18 | #define SOUNDPLAYER_H 19 | 20 | #include 21 | #include 22 | #include 23 | #include "pencilerror.h" 24 | #include "keyframe.h" 25 | 26 | class SoundClip; 27 | class QMediaPlayer; 28 | 29 | class SoundPlayer : public QObject, public KeyFrameEventListener 30 | { 31 | Q_OBJECT 32 | public: 33 | SoundPlayer(); 34 | ~SoundPlayer() override; 35 | 36 | void init(SoundClip*); 37 | void onKeyFrameDestroy(KeyFrame*) override; 38 | bool isValid(); 39 | 40 | void play(); 41 | void pause(); 42 | void stop(); 43 | 44 | int64_t duration(); 45 | SoundClip* clip() { return mSoundClip; } 46 | 47 | void setMediaPlayerPosition(qint64 pos); 48 | 49 | signals: 50 | void corruptedSoundFile(SoundClip*); 51 | void durationChanged(SoundPlayer*, int64_t duration); 52 | 53 | private: 54 | void makeConnections(); 55 | 56 | SoundClip* mSoundClip = nullptr; 57 | QMediaPlayer* mMediaPlayer = nullptr; 58 | QBuffer mBuffer; 59 | }; 60 | 61 | #endif // SOUNDPLAYER_H 62 | -------------------------------------------------------------------------------- /core_lib/src/structure/layersound.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Pencil2D - Traditional Animation Software 4 | Copyright (C) 2005-2007 Patrick Corrieri & Pascal Naidon 5 | Copyright (C) 2012-2020 Matthew Chiawen Chang 6 | 7 | This program is free software; you can redistribute it and/or 8 | modify it under the terms of the GNU General Public License 9 | as published by the Free Software Foundation; version 2 of the License. 10 | 11 | This program is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | */ 17 | #ifndef LAYERSOUND_H 18 | #define LAYERSOUND_H 19 | 20 | #include 21 | #include "keyframe.h" 22 | #include "layer.h" 23 | 24 | class SoundClip; 25 | class LayerSound : public Layer 26 | { 27 | Q_DECLARE_TR_FUNCTIONS(LayerSound) 28 | 29 | public: 30 | explicit LayerSound(int id); 31 | ~LayerSound(); 32 | QDomElement createDomElement(QDomDocument& doc) const override; 33 | void loadDomElement(const QDomElement& element, QString dataDirPath, ProgressCallback progressStep) override; 34 | 35 | void replaceKeyFrame(const KeyFrame* soundClip) override; 36 | 37 | Status loadSoundClipAtFrame( const QString& sSoundClipName, const QString& filePathString, int frame ); 38 | void updateFrameLengths(int fps); 39 | 40 | SoundClip* getSoundClipWhichCovers(int frameNumber); 41 | 42 | protected: 43 | Status saveKeyFrameFile(KeyFrame*, QString path) override; 44 | KeyFrame* createKeyFrame(int position) override; 45 | }; 46 | 47 | #endif 48 | -------------------------------------------------------------------------------- /core_lib/src/structure/objectdata.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Pencil2D - Traditional Animation Software 4 | Copyright (C) 2005-2007 Patrick Corrieri & Pascal Naidon 5 | Copyright (C) 2012-2020 Matthew Chiawen Chang 6 | 7 | This program is free software; you can redistribute it and/or 8 | modify it under the terms of the GNU General Public License 9 | as published by the Free Software Foundation; version 2 of the License. 10 | 11 | This program is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | */ 17 | 18 | #include "objectdata.h" 19 | #include 20 | 21 | ObjectData::ObjectData() 22 | { 23 | QSettings settings(PENCIL2D, PENCIL2D); 24 | mFps = settings.value(SETTING_FPS).toInt(); 25 | if (mFps < 1) 26 | mFps = 12; 27 | } 28 | 29 | -------------------------------------------------------------------------------- /core_lib/src/structure/pegbaraligner.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Pencil2D - Traditional Animation Software 4 | Copyright (C) 2005-2007 Patrick Corrieri & Pascal Naidon 5 | Copyright (C) 2012-2020 Matthew Chiawen Chang 6 | 7 | This program is free software; you can redistribute it and/or 8 | modify it under the terms of the GNU General Public License 9 | as published by the Free Software Foundation; version 2 of the License. 10 | 11 | This program is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | */ 17 | #ifndef PEGBARALIGNER_H 18 | #define PEGBARALIGNER_H 19 | 20 | #include 21 | 22 | #include 23 | #include 24 | 25 | class BitmapImage; 26 | class Editor; 27 | 28 | class PegStatus : public Status 29 | { 30 | public: 31 | PegStatus(ErrorCode code, QPoint point = {}); 32 | QPoint point; 33 | }; 34 | 35 | class PegBarAligner 36 | { 37 | Q_DECLARE_TR_FUNCTIONS(PegBarAligner) 38 | public: 39 | PegBarAligner(Editor* editor, QRect searchRect); 40 | 41 | Status align(const QStringList& layers); 42 | 43 | private: 44 | PegStatus findPoint(const BitmapImage& image) const; 45 | 46 | Editor* mEditor = nullptr; 47 | 48 | const int mGrayThreshold = 121; 49 | QRect mPegSearchRect; 50 | }; 51 | 52 | #endif // PEGBARALIGNER_H 53 | -------------------------------------------------------------------------------- /core_lib/src/tool/erasertool.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Pencil2D - Traditional Animation Software 4 | Copyright (C) 2005-2007 Patrick Corrieri & Pascal Naidon 5 | Copyright (C) 2012-2020 Matthew Chiawen Chang 6 | 7 | This program is free software; you can redistribute it and/or 8 | modify it under the terms of the GNU General Public License 9 | as published by the Free Software Foundation; version 2 of the License. 10 | 11 | This program is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | */ 17 | 18 | #ifndef ERASERTOOL_H 19 | #define ERASERTOOL_H 20 | 21 | #include "stroketool.h" 22 | 23 | class EraserTool : public StrokeTool 24 | { 25 | Q_OBJECT 26 | 27 | public: 28 | explicit EraserTool(QObject* parent = nullptr); 29 | ToolType type() override; 30 | void loadSettings() override; 31 | void saveSettings() override; 32 | void resetToDefault() override; 33 | QCursor cursor() override; 34 | 35 | void pointerMoveEvent(PointerEvent*) override; 36 | void pointerPressEvent(PointerEvent*) override; 37 | void pointerReleaseEvent(PointerEvent*) override; 38 | 39 | void drawStroke(); 40 | void paintAt(QPointF point); 41 | void removeVectorPaint(); 42 | void updateStrokes(); 43 | 44 | void setWidth(const qreal width) override; 45 | void setFeather(const qreal feather) override; 46 | void setUseFeather(const bool usingFeather) override; 47 | void setPressure(const bool pressure) override; 48 | void setAA(const int aa) override; 49 | void setStabilizerLevel(const int level) override; 50 | 51 | protected: 52 | QPointF mLastBrushPoint; 53 | QPointF mMouseDownPoint; 54 | }; 55 | 56 | #endif // ERASERTOOL_H 57 | -------------------------------------------------------------------------------- /core_lib/src/tool/eyedroppertool.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Pencil2D - Traditional Animation Software 4 | Copyright (C) 2005-2007 Patrick Corrieri & Pascal Naidon 5 | Copyright (C) 2012-2020 Matthew Chiawen Chang 6 | 7 | This program is free software; you can redistribute it and/or 8 | modify it under the terms of the GNU General Public License 9 | as published by the Free Software Foundation; version 2 of the License. 10 | 11 | This program is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | */ 17 | 18 | #ifndef EYEDROPPERTOOL_H 19 | #define EYEDROPPERTOOL_H 20 | 21 | #include "basetool.h" 22 | 23 | class LayerBitmap; 24 | class LayerVector; 25 | 26 | class EyedropperTool : public BaseTool 27 | { 28 | Q_OBJECT 29 | public: 30 | explicit EyedropperTool( QObject* parent = 0 ); 31 | ToolType type() override { return EYEDROPPER; } 32 | void loadSettings() override; 33 | void saveSettings() override; 34 | QCursor cursor() override; 35 | QCursor cursor( const QColor color ); 36 | 37 | void pointerPressEvent( PointerEvent* ) override; 38 | void pointerReleaseEvent( PointerEvent* event ) override; 39 | void pointerMoveEvent( PointerEvent* event ) override; 40 | 41 | /** Updates front color for bitmap and color index for vector */ 42 | void updateFrontColor(const QPointF& pos); 43 | 44 | private: 45 | /** Retrieves color of the pixel under the cursor for a bitmap layer */ 46 | QColor getBitmapColor(LayerBitmap* layer, const QPointF& pos); 47 | /** Retrieves the color index of the pixel under the cursor for a vector layer */ 48 | int getVectorColor(LayerVector *layer, const QPointF& pos); 49 | }; 50 | 51 | #endif // EYEDROPPERTOOL_H 52 | -------------------------------------------------------------------------------- /core_lib/src/tool/handtool.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Pencil2D - Traditional Animation Software 4 | Copyright (C) 2005-2007 Patrick Corrieri & Pascal Naidon 5 | Copyright (C) 2012-2020 Matthew Chiawen Chang 6 | 7 | This program is free software; you can redistribute it and/or 8 | modify it under the terms of the GNU General Public License 9 | as published by the Free Software Foundation; version 2 of the License. 10 | 11 | This program is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | */ 17 | 18 | #ifndef HANDTOOL_H 19 | #define HANDTOOL_H 20 | 21 | #include "basetool.h" 22 | #include "preferencemanager.h" 23 | 24 | 25 | class HandTool : public BaseTool 26 | { 27 | Q_OBJECT 28 | public: 29 | explicit HandTool( QObject* parent = 0 ); 30 | ToolType type() override { return HAND; } 31 | void loadSettings() override; 32 | void saveSettings() override; 33 | QCursor cursor() override; 34 | 35 | void pointerPressEvent(PointerEvent *) override; 36 | void pointerReleaseEvent(PointerEvent *) override; 37 | void pointerMoveEvent(PointerEvent *) override; 38 | void pointerDoubleClickEvent(PointerEvent *) override; 39 | 40 | private: 41 | void updateSettings(const SETTING setting); 42 | void transformView(Qt::KeyboardModifiers keyMod, const QPointF& pos, Qt::MouseButtons buttons); 43 | 44 | QPointF mLastPixel; 45 | QPointF mStartPoint; 46 | bool mIsHeld = false; 47 | int mDeltaFactor = 1; 48 | }; 49 | 50 | #endif 51 | -------------------------------------------------------------------------------- /core_lib/src/tool/pentool.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Pencil2D - Traditional Animation Software 4 | Copyright (C) 2005-2007 Patrick Corrieri & Pascal Naidon 5 | Copyright (C) 2012-2020 Matthew Chiawen Chang 6 | 7 | This program is free software; you can redistribute it and/or 8 | modify it under the terms of the GNU General Public License 9 | as published by the Free Software Foundation; version 2 of the License. 10 | 11 | This program is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | */ 17 | 18 | #ifndef PENTOOL_H 19 | #define PENTOOL_H 20 | 21 | #include "stroketool.h" 22 | 23 | class Layer; 24 | 25 | class PenTool : public StrokeTool 26 | { 27 | Q_OBJECT 28 | public: 29 | PenTool(QObject* parent = 0); 30 | ToolType type() override { return PEN; } 31 | void loadSettings() override; 32 | void saveSettings() override; 33 | QCursor cursor() override; 34 | void resetToDefault() override; 35 | 36 | void pointerPressEvent(PointerEvent*) override; 37 | void pointerMoveEvent(PointerEvent*) override; 38 | void pointerReleaseEvent(PointerEvent*) override; 39 | 40 | void drawStroke(); 41 | void paintAt(QPointF point); 42 | void paintVectorStroke(Layer *layer); 43 | 44 | void setWidth(const qreal width) override; 45 | void setPressure(const bool pressure) override; 46 | void setAA(const int AA) override; 47 | void setStabilizerLevel(const int level) override; 48 | 49 | private: 50 | QPointF mLastBrushPoint; 51 | QPointF mMouseDownPoint; 52 | }; 53 | 54 | #endif // PENTOOL_H 55 | -------------------------------------------------------------------------------- /core_lib/src/util/blitrect.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Pencil2D - Traditional Animation Software 4 | Copyright (C) 2005-2007 Patrick Corrieri & Pascal Naidon 5 | Copyright (C) 2012-2020 Matthew Chiawen Chang 6 | 7 | This program is free software; you can redistribute it and/or 8 | modify it under the terms of the GNU General Public License 9 | as published by the Free Software Foundation; version 2 of the License. 10 | 11 | This program is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | */ 17 | 18 | #ifndef BLITRECT_H 19 | #define BLITRECT_H 20 | 21 | #include 22 | #include 23 | 24 | class BlitRect : public QRect 25 | { 26 | public: 27 | explicit BlitRect(); 28 | explicit BlitRect(const QPoint p); 29 | explicit BlitRect(const QRect rect); 30 | void extend(const QPoint p); 31 | void extend(const QPoint& p, const QSize& size); 32 | void extend(const QRect& rect); 33 | 34 | private: 35 | bool mInitialized = false; 36 | }; 37 | 38 | #endif // BLITRECT_H 39 | -------------------------------------------------------------------------------- /core_lib/src/util/cameraeasingtype.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Pencil2D - Traditional Animation Software 4 | Copyright (C) 2005-2007 Patrick Corrieri & Pascal Naidon 5 | Copyright (C) 2012-2020 Matthew Chiawen Chang 6 | 7 | This program is free software; you can redistribute it and/or 8 | modify it under the terms of the GNU General Public License 9 | as published by the Free Software Foundation; version 2 of the License. 10 | 11 | This program is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | */ 17 | #ifndef CAMERAEASINGTYPE_H 18 | #define CAMERAEASINGTYPE_H 19 | 20 | // new enums MUST be appended to the end! 21 | enum class CameraEasingType { 22 | LINEAR, 23 | INQUAD, 24 | OUTQUAD, 25 | INOUTQUAD, 26 | OUTINQUAD, 27 | INCUBIC, 28 | OUTCUBIC, 29 | INOUTCUBIC, 30 | OUTINCUBIC, 31 | INQUART, 32 | OUTQUART, 33 | INOUTQUART, 34 | OUTINQUART, 35 | INQUINT, 36 | OUTQUINT, 37 | INOUTQUINT, 38 | OUTINQUINT, 39 | INSINE, 40 | OUTSINE, 41 | INOUTSINE, 42 | OUTINSINE, 43 | INEXPO, 44 | OUTEXPO, 45 | INOUTEXPO, 46 | OUTINEXPO, 47 | INCIRC, 48 | OUTCIRC, 49 | INOUTCIRC, 50 | OUTINCIRC, 51 | INELASTIC, 52 | OUTELASTIC, 53 | INOUTELASTIC, 54 | OUTINELASTIC, 55 | INBACK, 56 | OUTBACK, 57 | INOUTBACK, 58 | OUTINBACK, 59 | INBOUNCE, 60 | OUTBOUNCE, 61 | INOUTBOUNCE, 62 | OUTINBOUNCE 63 | }; 64 | 65 | QString getInterpolationText(CameraEasingType type); 66 | 67 | #endif // CAMERAEASINGTYPE_H 68 | -------------------------------------------------------------------------------- /core_lib/src/util/camerafieldoption.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Pencil2D - Traditional Animation Software 4 | Copyright (C) 2005-2007 Patrick Corrieri & Pascal Naidon 5 | Copyright (C) 2012-2020 Matthew Chiawen Chang 6 | 7 | This program is free software; you can redistribute it and/or 8 | modify it under the terms of the GNU General Public License 9 | as published by the Free Software Foundation; version 2 of the License. 10 | 11 | This program is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | */ 17 | #ifndef CAMERAFIELDOPTION_H 18 | #define CAMERAFIELDOPTION_H 19 | 20 | enum class CameraFieldOption { 21 | RESET_FIELD, 22 | RESET_TRANSLATION, 23 | RESET_SCALING, 24 | RESET_ROTATION, 25 | ALIGN_HORIZONTAL, 26 | ALIGN_VERTICAL, 27 | HOLD_FRAME 28 | }; 29 | 30 | #endif // CAMERAFIELDOPTION_H 31 | -------------------------------------------------------------------------------- /core_lib/src/util/filetype.h: -------------------------------------------------------------------------------- 1 | #ifndef FILETYPE_H 2 | #define FILETYPE_H 3 | 4 | enum class FileType 5 | { 6 | ANIMATION, 7 | IMAGE, 8 | IMAGE_SEQUENCE, 9 | GIF, 10 | ANIMATED_IMAGE, 11 | MOVIE, 12 | SOUND, 13 | PALETTE 14 | }; 15 | 16 | #endif // FILETYPE_H 17 | -------------------------------------------------------------------------------- /core_lib/src/util/importimageconfig.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Pencil2D - Traditional Animation Software 4 | Copyright (C) 2005-2007 Patrick Corrieri & Pascal Naidon 5 | Copyright (C) 2012-2020 Matthew Chiawen Chang 6 | 7 | This program is free software; you can redistribute it and/or 8 | modify it under the terms of the GNU General Public License 9 | as published by the Free Software Foundation; version 2 of the License. 10 | 11 | This program is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | */ 17 | 18 | #ifndef IMPORTIMAGECONFIG_H 19 | #define IMPORTIMAGECONFIG_H 20 | 21 | struct ImportImageConfig 22 | { 23 | enum PositionType { 24 | CenterOfView, 25 | CenterOfCanvas, 26 | CenterOfCamera, 27 | CenterOfCameraFollowed, 28 | None 29 | }; 30 | 31 | int importFrame = 1; 32 | PositionType positionType = None; 33 | }; 34 | 35 | #endif // IMPORTIMAGECONFIG_H 36 | -------------------------------------------------------------------------------- /core_lib/src/util/log.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "log.h" 3 | 4 | Q_LOGGING_CATEGORY(logCanvasPainter, "core.canvasPainter"); 5 | Q_LOGGING_CATEGORY(logFileManager, "core.FileManager"); 6 | 7 | void initCategoryLogging() 8 | { 9 | const QString logRules = 10 | "*.debug=false\n" 11 | "default.debug=true\n" 12 | "core.canvasPainter.debug=false\n" 13 | "core.fileManager.debug=false"; 14 | 15 | QLoggingCategory::setFilterRules(logRules); 16 | } -------------------------------------------------------------------------------- /core_lib/src/util/log.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Pencil2D - Traditional Animation Software 4 | Copyright (C) 2005-2007 Patrick Corrieri & Pascal Naidon 5 | Copyright (C) 2012-2020 Matthew Chiawen Chang 6 | 7 | This program is free software; you can redistribute it and/or 8 | modify it under the terms of the GNU General Public License 9 | as published by the Free Software Foundation; version 2 of the License. 10 | 11 | This program is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | */ 17 | 18 | #pragma once 19 | #include 20 | 21 | 22 | /** 23 | * With Qt Category logging, it allows devs to turn on/off the debug log for certain modules 24 | * Uncomment the following #define DEBUG_LOG_ModuleName to enable the category logging 25 | */ 26 | 27 | //#define DEBUG_LOG_CANVASPAINTER 28 | //#define DEBUG_LOG_FILEMANAGER 29 | 30 | #ifdef DEBUG_LOG_CANVASPAINTER 31 | Q_DECLARE_LOGGING_CATEGORY(logCanvasPainter); 32 | #define CANVASPAINTER_LOG(...) qCDebug(logCanvasPainter, __VA_ARGS__) 33 | #else 34 | #define CANVASPAINTER_LOG(...) ((void)0) 35 | #endif 36 | 37 | #ifdef DEBUG_LOG_FILEMANAGER 38 | Q_DECLARE_LOGGING_CATEGORY(logFileManager); 39 | #define FILEMANAGER_LOG(...) qCDebug(logFileManager, __VA_ARGS__) 40 | #else 41 | #define FILEMANAGER_LOG(...) ((void)0) 42 | #endif 43 | 44 | void initCategoryLogging(); 45 | -------------------------------------------------------------------------------- /core_lib/src/util/mathutils.h: -------------------------------------------------------------------------------- 1 | #ifndef MATHUTILS_H 2 | #define MATHUTILS_H 3 | 4 | #include 5 | #include 6 | 7 | namespace MathUtils 8 | { 9 | /** Get the angle from the difference vector a->b to the x-axis. 10 | * 11 | * \param a Start point of vector 12 | * \param b End point of vector 13 | * \return Angle in radians from [-pi,+pi] 14 | */ 15 | inline qreal getDifferenceAngle(const QPointF a, const QPointF b) 16 | { 17 | return qAtan2(b.y() - a.y(), b.x() - a.x()); 18 | } 19 | 20 | /** Map one range onto another 21 | * \param x The input value 22 | * \param inputMin The input min value 23 | * \param inputMax The input max value 24 | * \param outputMin The output min value 25 | * \param outputMax The output max value 26 | * \return The value of x mapped to the corresponding range between outputMin and outputMax 27 | */ 28 | inline qreal map(qreal x, qreal inputMin, qreal inputMax, qreal outputMin, qreal outputMax) 29 | { 30 | qreal slope = (outputMax - outputMin) / (inputMax - inputMin); 31 | return outputMin + slope * (x - inputMin); 32 | } 33 | 34 | /** Normalize x to a value between 0 and 1; 35 | * \param x The input value 36 | * \param min The input min value 37 | * \param max The input max value 38 | * \return The value of x normalized to a range between 0 and 1 39 | */ 40 | inline qreal normalize(qreal x, qreal min, qreal max) 41 | { 42 | return qAbs((x - max) / (min - max)); 43 | } 44 | } 45 | 46 | #endif // MATHUTILS_H 47 | -------------------------------------------------------------------------------- /core_lib/src/util/movemode.h: -------------------------------------------------------------------------------- 1 | #ifndef MOVEMODE_H 2 | #define MOVEMODE_H 3 | 4 | 5 | enum class MoveMode { 6 | MIDDLE, 7 | TOPLEFT, 8 | TOPRIGHT, 9 | BOTTOMLEFT, 10 | BOTTOMRIGHT, 11 | ROTATION, 12 | ROTATIONLEFT, 13 | ROTATIONRIGHT, 14 | SYMMETRY, 15 | REPOSITION, 16 | PERSP_SINGLE, 17 | PERSP_LEFT, 18 | PERSP_RIGHT, 19 | PERSP_MIDDLE, 20 | CENTER, 21 | NONE 22 | }; 23 | 24 | #endif // MOVEMODE_H 25 | -------------------------------------------------------------------------------- /core_lib/src/util/onionskinpainteroptions.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Pencil2D - Traditional Animation Software 4 | Copyright (C) 2012-2020 Matthew Chiawen Chang 5 | 6 | This program is free software; you can redistribute it and/or 7 | modify it under the terms of the GNU General Public License 8 | as published by the Free Software Foundation; version 2 of the License. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | */ 16 | 17 | #ifndef ONIONSKINPAINTEROPTIONS_H 18 | #define ONIONSKINPAINTEROPTIONS_H 19 | 20 | struct OnionSkinPainterOptions { 21 | bool enabledWhilePlaying = false; 22 | bool isPlaying = false; 23 | float minOpacity = 0; 24 | float maxOpacity = 100; 25 | bool skinPrevFrames = false; 26 | bool skinNextFrames = false; 27 | bool colorizePrevFrames = false; 28 | bool colorizeNextFrames = false; 29 | int framesToSkinPrev = 0; 30 | int framesToSkinNext = 0; 31 | bool isAbsolute = false; 32 | }; 33 | #endif // ONIONSKINPAINTEROPTIONS_H 34 | -------------------------------------------------------------------------------- /core_lib/src/util/onionskinpaintstate.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Pencil2D - Traditional Animation Software 4 | Copyright (C) 2012-2020 Matthew Chiawen Chang 5 | 6 | This program is free software; you can redistribute it and/or 7 | modify it under the terms of the GNU General Public License 8 | as published by the Free Software Foundation; version 2 of the License. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | */ 16 | 17 | #ifndef ONIONSKINPAINTSTATE_H 18 | #define ONIONSKINPAINTSTATE_H 19 | 20 | enum OnionSkinPaintState { 21 | PREV, 22 | NEXT, 23 | CURRENT 24 | }; 25 | 26 | #endif // ONIONSKINPAINTSTATE_H 27 | -------------------------------------------------------------------------------- /core_lib/src/util/painterutils.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Pencil2D - Traditional Animation Software 4 | Copyright (C) 2005-2007 Patrick Corrieri & Pascal Naidon 5 | Copyright (C) 2012-2020 Matthew Chiawen Chang 6 | 7 | This program is free software; you can redistribute it and/or 8 | modify it under the terms of the GNU General Public License 9 | as published by the Free Software Foundation; version 2 of the License. 10 | 11 | This program is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | */ 17 | 18 | #ifndef PAINTERUTILS_H 19 | #define PAINTERUTILS_H 20 | 21 | #include 22 | 23 | /** Calculate layer opacity based on current layer offset */ 24 | inline qreal calculateRelativeOpacityForLayer(int currentLayerIndex, int layerIndexNext, float threshold) 25 | { 26 | int layerOffset = currentLayerIndex - layerIndexNext; 27 | int absoluteOffset = qAbs(layerOffset); 28 | qreal newOpacity = 1.0; 29 | if (absoluteOffset != 0) 30 | { 31 | newOpacity = qPow(static_cast(threshold), absoluteOffset); 32 | } 33 | return newOpacity; 34 | }; 35 | 36 | #endif // PAINTERUTILS_H 37 | -------------------------------------------------------------------------------- /core_lib/src/util/pencilsettings.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Pencil2D - Traditional Animation Software 4 | Copyright (C) 2005-2007 Patrick Corrieri & Pascal Naidon 5 | Copyright (C) 2012-2020 Matthew Chiawen Chang 6 | 7 | This program is free software; you can redistribute it and/or 8 | modify it under the terms of the GNU General Public License 9 | as published by the Free Software Foundation; version 2 of the License. 10 | 11 | This program is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | */ 17 | 18 | #ifndef PENCILSETTINGS_H 19 | #define PENCILSETTINGS_H 20 | 21 | #include 22 | #include 23 | #include "pencildef.h" 24 | 25 | QSettings& pencilSettings(); 26 | void restoreToDefaultSetting(); 27 | 28 | void restoreShortcutsToDefault(); 29 | void checkExistingShortcuts(); 30 | 31 | #endif // PENCILSETTINGS_H 32 | -------------------------------------------------------------------------------- /core_lib/src/util/transform.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Pencil2D - Traditional Animation Software 4 | Copyright (C) 2005-2007 Patrick Corrieri & Pascal Naidon 5 | Copyright (C) 2012-2020 Matthew Chiawen Chang 6 | 7 | This program is free software; you can redistribute it and/or 8 | modify it under the terms of the GNU General Public License 9 | as published by the Free Software Foundation; version 2 of the License. 10 | 11 | This program is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | */ 17 | #include 18 | 19 | #include "transform.h" 20 | 21 | QRectF Transform::mapFromLocalRect(const QTransform& transform, const QRect& rect) 22 | { 23 | return QRectF(transform.inverted().mapRect(QRectF(rect))); 24 | } 25 | 26 | QRectF Transform::mapToWorldRect(const QTransform& transform, const QTransform& worldT, const QRect rect) 27 | { 28 | return worldT.mapRect(mapFromLocalRect(transform, rect)); 29 | } 30 | 31 | QPointF Transform::mapFromLocalPoint(const QTransform& transform, const QPoint& point) 32 | { 33 | return QPointF(transform.inverted().map(QPointF(point))); 34 | } 35 | 36 | QPointF Transform::mapToWorldPoint(const QTransform& transform, const QTransform& worldT, const QPoint& point) 37 | { 38 | return worldT.map(mapFromLocalPoint(transform, point)); 39 | } 40 | 41 | QPolygonF Transform::mapFromLocalPolygon(const QTransform& transform, const QRect& rect) 42 | { 43 | return QPolygonF(transform.inverted().map(QPolygonF(QRectF(rect)))); 44 | } 45 | 46 | QPolygonF Transform::mapToWorldPolygon(const QTransform& transform, const QTransform& worldT, const QRect& rect) 47 | { 48 | return worldT.map(mapFromLocalPolygon(transform, rect)); 49 | } 50 | -------------------------------------------------------------------------------- /docs/.gitignore: -------------------------------------------------------------------------------- 1 | # Doxygen 2 | html 3 | latex 4 | rtf 5 | man 6 | xml 7 | docbook -------------------------------------------------------------------------------- /docs/build-options.md: -------------------------------------------------------------------------------- 1 | Build Options {#build_options} 2 | ============= 3 | 4 | ## Commonly Used Options 5 | 6 | These are options you might want to pass to QMake when configuring your build. 7 | 8 | - `-spec …`: Used to specify the platform and compiler of the build. There is no comprehensive list of available options, but usually you will only need the ones mentioned in our build guides ([macOS](@ref build_macos), [Linux](@ref build_linux), [Windows](@ref build_windows)) 9 | - `QMAKE_CXX=…`: Used to overwrite the C++ compiler binary 10 | - `CONFIG+=release` / `CONFIG+=debug`: Indicates that the build is meant for release or development, respectively. On non-Windows systems `CONFIG+=release` is the default, while on Windows, both a release and a development build are generated by default 11 | - `CONFIG+=PENCIL2D_NIGHTLY`: Marks the build as a nightly build 12 | - `CONFIG+=PENCIL2D_RELEASE`: Marks the build as a released version of Pencil2D 13 | - `CONFIG+=GIT`: Signifies that the git command line program is available and causes information about the current state of the repository to be included in the build. Currently this does nothing without `CONFIG+=PENCIL2D_NIGHTLY` 14 | - `CONFIG+=NO_TESTS`: Disables unit tests 15 | 16 | Please note that there is little benefit in using `CONFIG+=NIGHTLY` or `CONFIG+=GIT` in development builds; in fact these options might prevent build acceleration tools such as ccache from working properly. 17 | 18 | ## Common Build Configurations 19 | 20 | - Development builds: `CONFIG+=debug` 21 | - Nightly builds: `CONFIG+=release CONFIG+=PENCIL2D_NIGHTLY CONFIG+=GIT` 22 | - Release builds: `CONFIG+=release CONFIG+=PENCIL2D_RELEASE CONFIG+=GIT` 23 | - Windows legacy build: `CONFIG+=release CONFIG+=PENCIL2D_RELEASE CONFIG+=WIN_LEGACY CONFIG+=NO_TESTS` 24 | - This build should use Visual Studio 2013 Community and Qt 5.6.3 (VS2013 32bit) 25 | -------------------------------------------------------------------------------- /docs/main.md: -------------------------------------------------------------------------------- 1 | Contribute {#mainpage} 2 | ========== 3 | 4 | Welcome! This documentation is aimed at developers working *on* Pencil2D, if you’re just looking for help working *with* Pencil2D, please have a look at [our user documentation](https://www.pencil2d.org/doc/) and [our community](https://www.pencil2d.org/community/) instead. Also please note that this documentation is still very much work in progress and far from complete. It is generated from comments in the source code and pages in the docs/ directory, so if you’d like to help out don’t hesitate to contribute! 5 | 6 | To work on Pencil2D, you will need to use C++ and %Qt. If you have any difficulties getting involved or finding answers to your questions, please bring those to [our Discord chat room](https://discord.gg/8FxdV2g) or [our forum](https://discuss.pencil2d.org) so that we can help you. 7 | 8 | ## Getting Started 9 | 10 | Get started with this documentation and start building and fixing bugs in just a few steps. 11 | 12 | - [How to compile Pencil2D on macOS](@ref build_macos) 13 | - [How to compile Pencil2D on Linux](@ref build_linux) 14 | - [How to compile Pencil2D on Windows](@ref build_windows) 15 | 16 | ## Development 17 | 18 | - [Current Development Status](https://github.com/pencil2d/pencil/projects/1): See what developers are doing at the moment 19 | - [Issue List](https://github.com/pencil2d/pencil/issues/): A pending list of bugs, information and to-do tasks 20 | - [Roadmap](https://github.com/pencil2d/pencil/issues/540) 21 | - Developers’ online chat room (both channels are synced): 22 | - [\#pencil2d on Libera Chat IRC](https://web.libera.chat/#pencil2d) 23 | - \#general-development on [our Discord server](https://discord.gg/8FxdV2g) 24 | -------------------------------------------------------------------------------- /pencil2d.pro: -------------------------------------------------------------------------------- 1 | ###################################################################### 2 | # Automatically generated by qmake (2.01a) sam. janv. 13 17:20:35 2007 3 | ###################################################################### 4 | 5 | TEMPLATE = subdirs 6 | 7 | # build the project sequentially as listed in SUBDIRS ! 8 | CONFIG += ordered 9 | 10 | SUBDIRS += core_lib 11 | core_lib.subdir = core_lib 12 | 13 | SUBDIRS += app 14 | app.subdir = app 15 | app.depends = core_lib 16 | 17 | SUBDIRS += tests 18 | tests.subdir = tests 19 | tests.depends = core_lib 20 | 21 | NO_TESTS { 22 | SUBDIRS -= tests 23 | } 24 | 25 | TRANSLATIONS += $$PWD/translations/pencil.ts 26 | 27 | -------------------------------------------------------------------------------- /tests/data/camera-path-test-2.pclx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pencil2d/pencil/a9013b659d3ec6786ea4148c386fe61adad346a2/tests/data/camera-path-test-2.pclx -------------------------------------------------------------------------------- /tests/data/camera-path-test.pclx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pencil2d/pencil/a9013b659d3ec6786ea4148c386fe61adad346a2/tests/data/camera-path-test.pclx -------------------------------------------------------------------------------- /tests/data/cjk-test.pclx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pencil2d/pencil/a9013b659d3ec6786ea4148c386fe61adad346a2/tests/data/cjk-test.pclx -------------------------------------------------------------------------------- /tests/data/empty.pclx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pencil2d/pencil/a9013b659d3ec6786ea4148c386fe61adad346a2/tests/data/empty.pclx -------------------------------------------------------------------------------- /tests/data/fill-drag-test/fill-drag-test.pcl: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 0.6.6 30 | 31 | -------------------------------------------------------------------------------- /tests/data/fill-drag-test/fill-drag-test.pcl.data/003.001.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pencil2d/pencil/a9013b659d3ec6786ea4148c386fe61adad346a2/tests/data/fill-drag-test/fill-drag-test.pcl.data/003.001.png -------------------------------------------------------------------------------- /tests/data/tests.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | empty.pclx 4 | cjk-test.pclx 5 | fill-drag-test/fill-drag-test.pcl 6 | fill-drag-test/fill-drag-test.pcl.data/003.001.png 7 | camera-path-test.pclx 8 | camera-path-test-2.pclx 9 | 10 | 11 | -------------------------------------------------------------------------------- /tests/src/main.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Pencil2D - Traditional Animation Software 4 | Copyright (C) 2012-2020 Matthew Chiawen Chang 5 | 6 | This program is free software; you can redistribute it and/or 7 | modify it under the terms of the GNU General Public License 8 | as published by the Free Software Foundation; version 2 of the License. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | */ 16 | 17 | #define CATCH_CONFIG_RUNNER 18 | #include "catch.hpp" 19 | 20 | #include 21 | 22 | int main(int argc, char* argv[]) 23 | { 24 | QApplication a(argc, argv); 25 | 26 | int result = Catch::Session().run(argc, argv); 27 | 28 | return result; 29 | } 30 | -------------------------------------------------------------------------------- /tests/src/test_vectorimage.cpp: -------------------------------------------------------------------------------- 1 | #include "vectorimage.h" 2 | #include "catch.hpp" 3 | 4 | TEST_CASE("VectorImage removeColor") 5 | { 6 | auto vImage = VectorImage(); 7 | auto bezier = BezierCurve({ QPoint(50,50), QPoint(100,100)}); 8 | SECTION("Ensure that number is changed") 9 | { 10 | bezier.setColorNumber(3); 11 | vImage.addCurve(bezier, 1.0); 12 | 13 | vImage.removeColor(3); 14 | 15 | REQUIRE(vImage.curve(0).getColorNumber() == 2); 16 | } 17 | 18 | SECTION("Can't get below zero") 19 | { 20 | bezier.setColorNumber(0); 21 | vImage.addCurve(bezier, 1.0); 22 | 23 | vImage.removeColor(0); 24 | 25 | REQUIRE(vImage.curve(0).getColorNumber() == 0); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /util/appveyor-mingw.yml: -------------------------------------------------------------------------------- 1 | 2 | clone_depth: 1 3 | 4 | image: 5 | - Visual Studio 2019 6 | 7 | platform: 8 | - x86 9 | - x64 10 | 11 | skip_commits: 12 | files: 13 | - '*.md' 14 | - docs/* 15 | - util/appveyor-msvc.yml 16 | - /.github/* 17 | 18 | init: 19 | - ver 20 | - echo %PLATFORM% 21 | 22 | before_build: 23 | - set QTDIR=C:\Qt\%qt% 24 | - set PATH=%QTDIR%\bin;C:\Qt\Tools\%mingw%\bin;%PATH%; 25 | - qmake --version 26 | 27 | build_script: 28 | - echo %APPVEYOR_BUILD_FOLDER% 29 | - md build 30 | - cd build 31 | - qmake "%APPVEYOR_BUILD_FOLDER%\pencil2d.pro" CONFIG+=GIT CONFIG+=Release CONFIG+=PENCIL2D_NIGHTLY 32 | - mingw32-make -j2 33 | 34 | after_build: 35 | - windeployqt "%APPVEYOR_BUILD_FOLDER%\build\app\release\pencil2d.exe" 36 | 37 | test_script: 38 | - echo "Running tests" 39 | - cd "%APPVEYOR_BUILD_FOLDER%\build\tests\release" 40 | - tests.exe 41 | 42 | for: 43 | - matrix: 44 | only: 45 | - image: Visual Studio 2019 46 | install: 47 | - if %PLATFORM%==x86 set qt=5.15\mingw81_32 48 | - if %PLATFORM%==x64 set qt=5.15\mingw81_64 49 | - if %PLATFORM%==x86 set mingw=mingw810_32 50 | - if %PLATFORM%==x64 set mingw=mingw810_64 51 | -------------------------------------------------------------------------------- /util/appveyor-msvc.yml: -------------------------------------------------------------------------------- 1 | 2 | clone_depth: 1 3 | 4 | image: 5 | - Visual Studio 2019 6 | 7 | platform: 8 | - x86 9 | - x64 10 | 11 | skip_commits: 12 | files: 13 | - '*.md' 14 | - docs/* 15 | - util/appveyor-mingw.yml 16 | - /.github/* 17 | 18 | init: 19 | - ver 20 | - echo %PLATFORM% 21 | 22 | before_build: 23 | - set QTDIR=C:\Qt\%qt% 24 | - set PATH=%PATH%;%QTDIR%\bin 25 | - qmake --version 26 | 27 | build_script: 28 | - cd 29 | - md build 30 | - cd build 31 | - qmake "..\pencil2d.pro" CONFIG+=GIT CONFIG+=Release CONFIG+=PENCIL2D_NIGHTLY 32 | - nmake 33 | 34 | after_build: 35 | - windeployqt "%APPVEYOR_BUILD_FOLDER%\build\app\release\pencil2d.exe" 36 | 37 | test_script: 38 | - echo "Running tests" 39 | - tests\release\tests.exe 40 | 41 | for: 42 | - matrix: 43 | only: 44 | - image: Visual Studio 2019 45 | install: 46 | - if %PLATFORM%==x86 call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvars32.bat" 47 | - if %PLATFORM%==x64 call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvars64.bat" 48 | - if %PLATFORM%==x86 set qt=5.15\msvc2019 49 | - if %PLATFORM%==x64 set qt=5.15\msvc2019_64 50 | -------------------------------------------------------------------------------- /util/docs/404.xsl: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 404 Error | 6 | 7 | 8 | 9 | 10 | 11 | 404 Error 12 | 13 | 14 | 15 | Ah snap! We could not find what you are looking for! 16 | 17 | 18 | 19 | 20 | 21 |
Ah snap! We could not find what you are looking for!
22 |
23 |
24 |
25 | 26 | 27 |

Try to get back to the Home Page and start over!

28 |

Go to the Home Page

29 |
30 | 31 | 32 | 33 | 34 | 35 |
36 | -------------------------------------------------------------------------------- /util/docs/pencil2d.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pencil2d/pencil/a9013b659d3ec6786ea4148c386fe61adad346a2/util/docs/pencil2d.png -------------------------------------------------------------------------------- /util/installer/cog-hover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pencil2d/pencil/a9013b659d3ec6786ea4148c386fe61adad346a2/util/installer/cog-hover.png -------------------------------------------------------------------------------- /util/installer/cog-hover@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pencil2d/pencil/a9013b659d3ec6786ea4148c386fe61adad346a2/util/installer/cog-hover@2x.png -------------------------------------------------------------------------------- /util/installer/cog.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pencil2d/pencil/a9013b659d3ec6786ea4148c386fe61adad346a2/util/installer/cog.png -------------------------------------------------------------------------------- /util/installer/cog.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 8 | 9 | 10 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /util/installer/cog@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pencil2d/pencil/a9013b659d3ec6786ea4148c386fe61adad346a2/util/installer/cog@2x.png -------------------------------------------------------------------------------- /util/installer/okf_xml_wxl.fprm: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | #v1 13 | count.i=1 14 | rule0=\[[A-Z]\w*\] 15 | 16 | 17 | -------------------------------------------------------------------------------- /util/installer/pencil2d.def: -------------------------------------------------------------------------------- 1 | EXPORTS 2 | BAFunctionsCreate 3 | BAFunctionsDestroy 4 | -------------------------------------------------------------------------------- /util/installer/pencil2d.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pencil2d/pencil/a9013b659d3ec6786ea4148c386fe61adad346a2/util/installer/pencil2d.ico -------------------------------------------------------------------------------- /util/installer/pencil2d.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pencil2d/pencil/a9013b659d3ec6786ea4148c386fe61adad346a2/util/installer/pencil2d.png -------------------------------------------------------------------------------- /util/installer/pencil2d.pro: -------------------------------------------------------------------------------- 1 | TEMPLATE = lib 2 | # Flags based on WiX example project 3 | CONFIG += shared static_runtime exceptions_off optimize_size 4 | QMAKE_CXXFLAGS_RELEASE += -guard:cf -Gy -Oi 5 | QMAKE_LFLAGS_RELEASE += /GUARD:CF 6 | DEFINES += _WIN32_MSI=500 _WIN32_WINNT=0x0600 7 | QT -= core gui 8 | INCLUDEPATH += WixToolset.DUtil/build/native/include \ 9 | WixToolset.BootstrapperApplicationApi/build/native/include \ 10 | WixToolset.WixStandardBootstrapperApplicationFunctionApi/lib/native/include 11 | equals(QMAKE_TARGET.arch, "x86") { 12 | LIBS += "-L$$PWD/WixToolset.DUtil/build/native/v14/x86" \ 13 | "-L$$PWD/WixToolset.BootstrapperApplicationApi/build/native/v14/x86" \ 14 | "-L$$PWD/WixToolset.WixStandardBootstrapperApplicationFunctionApi/lib/native/v14/x86" 15 | } 16 | equals(QMAKE_TARGET.arch, "x86_64") { 17 | LIBS += "-L$$PWD/WixToolset.DUtil/build/native/v14/x64" \ 18 | "-L$$PWD/WixToolset.BootstrapperApplicationApi/build/native/v14/x64" \ 19 | "-L$$PWD/WixToolset.WixStandardBootstrapperApplicationFunctionApi/lib/native/v14/x64" 20 | } 21 | LIBS += User32.lib Advapi32.lib Ole32.lib OleAut32.lib Version.lib Shell32.lib wixstdfn.lib balutil.lib dutil.lib 22 | SOURCES += pencil2d.cpp 23 | DEF_FILE = pencil2d.def 24 | -------------------------------------------------------------------------------- /util/installer/pencil2d@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pencil2d/pencil/a9013b659d3ec6786ea4148c386fe61adad346a2/util/installer/pencil2d@2x.png -------------------------------------------------------------------------------- /util/installer/win_pcl_icon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pencil2d/pencil/a9013b659d3ec6786ea4148c386fe61adad346a2/util/installer/win_pcl_icon.ico -------------------------------------------------------------------------------- /util/installer/win_pcl_icon.xcf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pencil2d/pencil/a9013b659d3ec6786ea4148c386fe61adad346a2/util/installer/win_pcl_icon.xcf -------------------------------------------------------------------------------- /util/installer/win_pclx_icon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pencil2d/pencil/a9013b659d3ec6786ea4148c386fe61adad346a2/util/installer/win_pclx_icon.ico --------------------------------------------------------------------------------