├── .flatpak-manifest.json ├── .flatpak-manifest.json.license ├── .git-blame-ignore-revs ├── .gitignore ├── .gitlab-ci.yml ├── .kateconfig ├── .kde-ci.yml ├── .krazy ├── CMakeLists.txt ├── CMakePresets.json ├── CMakePresets.json.license ├── COPYING ├── COPYING.DOC ├── Messages.sh ├── NEWS ├── README.md ├── app ├── CMakeLists.txt ├── abstractcontextmanageritem.cpp ├── abstractcontextmanageritem.h ├── advancedconfigpage.ui ├── alignwithsidebarwidgetaction.cpp ├── alignwithsidebarwidgetaction.h ├── browsemainpage.cpp ├── browsemainpage.h ├── browsemainpage.ui ├── configdialog.cpp ├── configdialog.h ├── documentinfoprovider.cpp ├── documentinfoprovider.h ├── fileoperations.cpp ├── fileoperations.h ├── fileopscontextmanageritem.cpp ├── fileopscontextmanageritem.h ├── filtercontroller.cpp ├── filtercontroller.h ├── folderviewcontextmanageritem.cpp ├── folderviewcontextmanageritem.h ├── fullscreenconfigwidget.ui ├── fullscreencontent.cpp ├── fullscreencontent.h ├── generalconfigpage.ui ├── gvcore.cpp ├── gvcore.h ├── gwenview.qrc ├── gwenviewui.rc ├── imagemetainfodialog.cpp ├── imagemetainfodialog.h ├── imageopscontextmanageritem.cpp ├── imageopscontextmanageritem.h ├── imageviewconfigpage.ui ├── infocontextmanageritem.cpp ├── infocontextmanageritem.h ├── main.cpp ├── mainwindow.cpp ├── mainwindow.h ├── org.kde.gwenview.appdata.xml ├── org.kde.gwenview.desktop.cmake ├── preloader.cpp ├── preloader.h ├── renamedialog.cpp ├── renamedialog.h ├── renamedialog.ui ├── saveallhelper.cpp ├── saveallhelper.h ├── savebar.cpp ├── savebar.h ├── semanticinfocontextmanageritem.cpp ├── semanticinfocontextmanageritem.h ├── semanticinfodialog.ui ├── semanticinfosidebaritem.ui ├── sidebar.cpp ├── sidebar.h ├── slideshowfileitemaction.cpp ├── slideshowfileitemaction.h ├── slideshowfileitemaction.json ├── splitter.h ├── spotlightmode.cpp ├── spotlightmode.h ├── startmainpage.cpp ├── startmainpage.h ├── startmainpage.ui ├── thumbnailviewhelper.cpp ├── thumbnailviewhelper.h ├── viewmainpage.cpp └── viewmainpage.h ├── cmake ├── FindCFitsio.cmake └── FindLCMS2.cmake ├── color-schemes ├── CMakeLists.txt └── fullscreen.colors ├── config-gwenview.h.cmake ├── cursors ├── CMakeLists.txt ├── zoom.png └── zoom.svg ├── devdoc ├── CONTRIBUTING.md ├── ENVIRONMENT_VARIABLES.md └── OVERVIEW.md ├── doc ├── CMakeLists.txt ├── browse_mode.png ├── fullscreen-browse.png ├── fullscreen-view.png ├── importer-picking-root-folder.png ├── importer.png ├── index.docbook ├── modified-bar.png ├── start-page.png └── view_mode.png ├── icons ├── 128-actions-document-share.png ├── 128-apps-gwenview.png ├── 16-actions-document-share.png ├── 16-apps-gwenview.png ├── 22-actions-document-share.png ├── 22-apps-gwenview.png ├── 32-actions-document-share.png ├── 32-apps-gwenview.png ├── 48-actions-document-share.png ├── 48-apps-gwenview.png ├── 64-actions-document-share.png ├── 64-apps-gwenview.png └── CMakeLists.txt ├── images ├── CMakeLists.txt └── background.png ├── importer ├── CMakeLists.txt ├── dialogpage.cpp ├── dialogpage.h ├── dialogpage.ui ├── documentdirfinder.cpp ├── documentdirfinder.h ├── filenameformater.cpp ├── filenameformater.h ├── fileutils.cpp ├── fileutils.h ├── gwenview_importer.desktop ├── gwenview_importer_camera.desktop ├── importdialog.cpp ├── importdialog.h ├── importer.cpp ├── importer.h ├── importerconfig.kcfg ├── importerconfig.kcfgc ├── importerconfigdialog.cpp ├── importerconfigdialog.h ├── importerconfigdialog.ui ├── main.cpp ├── org.kde.gwenview_importer.desktop ├── progresspage.cpp ├── progresspage.h ├── progresspage.ui ├── serializedurlmap.cpp ├── serializedurlmap.h ├── thumbnailpage.cpp ├── thumbnailpage.h └── thumbnailpage.ui ├── lib ├── CMakeLists.txt ├── about.cpp ├── about.h ├── abstractimageoperation.cpp ├── abstractimageoperation.h ├── annotate │ ├── annotatedialog.cpp │ ├── annotatedialog.h │ ├── annotateoperation.cpp │ └── annotateoperation.h ├── archiveutils.cpp ├── archiveutils.h ├── bcg │ ├── bcgimageoperation.cpp │ ├── bcgimageoperation.h │ ├── bcgtool.cpp │ ├── bcgtool.h │ ├── bcgwidget.cpp │ ├── bcgwidget.h │ ├── imageutils.cpp │ └── imageutils.h ├── binder.cpp ├── binder.h ├── cms │ ├── .clang-format-ignore │ ├── cmsprofile.cpp │ ├── cmsprofile.h │ ├── cmsprofile_png.cpp │ ├── cmsprofile_png.h │ ├── iccjpeg.c │ └── iccjpeg.h ├── contextmanager.cpp ├── contextmanager.h ├── crop │ ├── cropimageoperation.cpp │ ├── cropimageoperation.h │ ├── croptool.cpp │ ├── croptool.h │ ├── cropwidget.cpp │ └── cropwidget.h ├── datewidget.cpp ├── datewidget.h ├── decoratedtag │ ├── decoratedtag.cpp │ └── decoratedtag.h ├── dialogguard.h ├── disabledactionshortcutmonitor.cpp ├── disabledactionshortcutmonitor.h ├── document │ ├── abstractdocumenteditor.h │ ├── abstractdocumentimpl.cpp │ ├── abstractdocumentimpl.h │ ├── animateddocumentloadedimpl.cpp │ ├── animateddocumentloadedimpl.h │ ├── document.cpp │ ├── document.h │ ├── document_p.h │ ├── documentfactory.cpp │ ├── documentfactory.h │ ├── documentjob.cpp │ ├── documentjob.h │ ├── documentloadedimpl.cpp │ ├── documentloadedimpl.h │ ├── emptydocumentimpl.cpp │ ├── emptydocumentimpl.h │ ├── jpegdocumentloadedimpl.cpp │ ├── jpegdocumentloadedimpl.h │ ├── loadingdocumentimpl.cpp │ ├── loadingdocumentimpl.h │ ├── loadingjob.cpp │ ├── loadingjob.h │ ├── savejob.cpp │ ├── savejob.h │ ├── svgdocumentloadedimpl.cpp │ ├── svgdocumentloadedimpl.h │ ├── videodocumentloadedimpl.cpp │ └── videodocumentloadedimpl.h ├── documentonlyproxymodel.cpp ├── documentonlyproxymodel.h ├── documentview │ ├── abstractdocumentviewadapter.cpp │ ├── abstractdocumentviewadapter.h │ ├── abstractimageview.cpp │ ├── abstractimageview.h │ ├── abstractrasterimageviewtool.cpp │ ├── abstractrasterimageviewtool.h │ ├── alphabackgrounditem.cpp │ ├── alphabackgrounditem.h │ ├── birdeyeview.cpp │ ├── birdeyeview.h │ ├── documentview.cpp │ ├── documentview.h │ ├── documentviewcontainer.cpp │ ├── documentviewcontainer.h │ ├── documentviewcontroller.cpp │ ├── documentviewcontroller.h │ ├── documentviewsynchronizer.cpp │ ├── documentviewsynchronizer.h │ ├── loadingindicator.cpp │ ├── loadingindicator.h │ ├── messageview.ui │ ├── messageviewadapter.cpp │ ├── messageviewadapter.h │ ├── rasterimageitem.cpp │ ├── rasterimageitem.h │ ├── rasterimageview.cpp │ ├── rasterimageview.h │ ├── rasterimageviewadapter.cpp │ ├── rasterimageviewadapter.h │ ├── svgviewadapter.cpp │ ├── svgviewadapter.h │ ├── videoviewadapter.cpp │ └── videoviewadapter.h ├── eventwatcher.cpp ├── eventwatcher.h ├── exiv2imageloader.cpp ├── exiv2imageloader.h ├── flowlayout.cpp ├── flowlayout.h ├── fullscreenbackground.h ├── fullscreenbar.cpp ├── fullscreenbar.h ├── graphicswidgetfloater.cpp ├── graphicswidgetfloater.h ├── gvdebug.h ├── gwenviewconfig.kcfg ├── gwenviewconfig.kcfgc ├── historymodel.cpp ├── historymodel.h ├── hud │ ├── hudbutton.cpp │ ├── hudbutton.h │ ├── hudbuttonbox.cpp │ ├── hudbuttonbox.h │ ├── hudcountdown.cpp │ ├── hudcountdown.h │ ├── hudlabel.cpp │ ├── hudlabel.h │ ├── hudmessagebubble.cpp │ ├── hudmessagebubble.h │ ├── hudslider.cpp │ ├── hudslider.h │ ├── hudtheme.cpp │ ├── hudtheme.h │ ├── hudwidget.cpp │ └── hudwidget.h ├── imageformats │ ├── fitsformat │ │ ├── bayer.c │ │ ├── bayer.h │ │ ├── fitsdata.cpp │ │ └── fitsdata.h │ ├── fitshandler.cpp │ ├── fitshandler.h │ ├── fitsplugin.cpp │ ├── fitsplugin.h │ └── fitsplugin.json ├── imagemetainfomodel.cpp ├── imagemetainfomodel.h ├── imageutils.cpp ├── imageutils.h ├── invisiblebuttongroup.cpp ├── invisiblebuttongroup.h ├── iodevicejpegsourcemanager.cpp ├── iodevicejpegsourcemanager.h ├── jpegcontent.cpp ├── jpegcontent.h ├── jpegerrormanager.h ├── kindproxymodel.cpp ├── kindproxymodel.h ├── libjpeg-62 │ ├── .clang-format │ ├── README.jpeg │ ├── jinclude.h │ ├── jpegint.h │ ├── transupp.c │ └── transupp.h ├── libjpeg-80 │ ├── .clang-format │ ├── README.jpeg │ ├── jinclude.h │ ├── jpegint.h │ ├── transupp.c │ └── transupp.h ├── libjpeg-90 │ ├── .clang-format │ ├── README.jpeg │ ├── jinclude.h │ ├── jpegint.h │ ├── transupp.c │ └── transupp.h ├── memoryutils.cpp ├── memoryutils.h ├── mimetypeutils.cpp ├── mimetypeutils.h ├── mimetypeutils_p.h ├── mousewheelbehavior.h ├── mpris2 │ ├── dbusabstractadaptor.cpp │ ├── dbusabstractadaptor.h │ ├── lockscreenwatcher.cpp │ ├── lockscreenwatcher.h │ ├── mpris2service.cpp │ ├── mpris2service.h │ ├── mprismediaplayer2.cpp │ ├── mprismediaplayer2.h │ ├── mprismediaplayer2player.cpp │ ├── mprismediaplayer2player.h │ └── org.freedesktop.ScreenSaver.xml ├── orientation.h ├── paintutils.cpp ├── paintutils.h ├── placetreemodel.cpp ├── placetreemodel.h ├── preferredimagemetainfomodel.cpp ├── preferredimagemetainfomodel.h ├── print │ ├── printhelper.cpp │ ├── printhelper.h │ ├── printoptionspage.cpp │ ├── printoptionspage.h │ └── printoptionspage.ui ├── ramp.h ├── recentfilesmodel.cpp ├── recentfilesmodel.h ├── recursivedirmodel.cpp ├── recursivedirmodel.h ├── redeyereduction │ ├── redeyereductionimageoperation.cpp │ ├── redeyereductionimageoperation.h │ ├── redeyereductiontool.cpp │ ├── redeyereductiontool.h │ └── redeyereductionwidget.ui ├── renderingintent.h ├── resize │ ├── resizeimagedialog.cpp │ ├── resizeimagedialog.h │ ├── resizeimageoperation.cpp │ ├── resizeimageoperation.h │ └── resizeimagewidget.ui ├── scrollerutils.cpp ├── scrollerutils.h ├── semanticinfo │ ├── abstractsemanticinfobackend.cpp │ ├── abstractsemanticinfobackend.h │ ├── baloosemanticinfobackend.cpp │ ├── baloosemanticinfobackend.h │ ├── fakesemanticinfobackend.cpp │ ├── fakesemanticinfobackend.h │ ├── semanticinfodirmodel.cpp │ ├── semanticinfodirmodel.h │ ├── sorteddirmodel.cpp │ ├── sorteddirmodel.h │ ├── tagitemdelegate.cpp │ ├── tagitemdelegate.h │ ├── tagmodel.cpp │ ├── tagmodel.h │ ├── tagwidget.cpp │ └── tagwidget.h ├── shadowfilter.cpp ├── shadowfilter.h ├── signalblocker.h ├── slidecontainer.cpp ├── slidecontainer.h ├── slideshow.cpp ├── slideshow.h ├── sorting.h ├── statusbartoolbutton.cpp ├── statusbartoolbutton.h ├── stylesheetutils.cpp ├── stylesheetutils.h ├── thumbnailactions.h ├── thumbnailgroup.h ├── thumbnailprovider │ ├── thumbnailgenerator.cpp │ ├── thumbnailgenerator.h │ ├── thumbnailprovider.cpp │ ├── thumbnailprovider.h │ ├── thumbnailwriter.cpp │ └── thumbnailwriter.h ├── thumbnailview │ ├── abstractdocumentinfoprovider.cpp │ ├── abstractdocumentinfoprovider.h │ ├── abstractthumbnailviewhelper.cpp │ ├── abstractthumbnailviewhelper.h │ ├── dragpixmapgenerator.cpp │ ├── dragpixmapgenerator.h │ ├── itemeditor.cpp │ ├── itemeditor.h │ ├── previewitemdelegate.cpp │ ├── previewitemdelegate.h │ ├── thumbnailbarview.cpp │ ├── thumbnailbarview.h │ ├── thumbnailslider.cpp │ ├── thumbnailslider.h │ ├── thumbnailview.cpp │ ├── thumbnailview.h │ ├── tooltipwidget.cpp │ └── tooltipwidget.h ├── timeutils.cpp ├── timeutils.h ├── touch │ ├── doubletap.cpp │ ├── doubletap.h │ ├── oneandtwofingerswipe.cpp │ ├── oneandtwofingerswipe.h │ ├── tapholdandmoving.cpp │ ├── tapholdandmoving.h │ ├── touch.cpp │ ├── touch.h │ ├── touch_helper.cpp │ ├── touch_helper.h │ ├── twofingerpan.cpp │ ├── twofingerpan.h │ ├── twofingertap.cpp │ └── twofingertap.h ├── transformimageoperation.cpp ├── transformimageoperation.h ├── urlutils.cpp ├── urlutils.h ├── waylandgestures │ ├── waylandgestures.cpp │ └── waylandgestures.h ├── widgetfloater.cpp ├── widgetfloater.h ├── zoomcombobox │ ├── zoomcombobox.cpp │ ├── zoomcombobox.h │ └── zoomcombobox_p.h ├── zoommode.h ├── zoomslider.cpp ├── zoomslider.h ├── zoomwidget.cpp └── zoomwidget.h ├── logo.png ├── part ├── CMakeLists.txt ├── gvbrowserextension.cpp ├── gvbrowserextension.h ├── gvpart.cpp ├── gvpart.desktop.cmake ├── gvpart.h ├── gvpart.json.cmake ├── gvpart.qrc └── gvpart.rc ├── po ├── ar │ └── gwenview.po ├── ast │ └── gwenview.po ├── az │ └── gwenview.po ├── be │ └── gwenview.po ├── bg │ └── gwenview.po ├── bn │ └── gwenview.po ├── bs │ └── gwenview.po ├── ca │ ├── docs │ │ └── gwenview │ │ │ ├── browse_mode.png │ │ │ ├── index.docbook │ │ │ ├── modified-bar.png │ │ │ ├── start-page.png │ │ │ └── view_mode.png │ └── gwenview.po ├── ca@valencia │ └── gwenview.po ├── cs │ └── gwenview.po ├── da │ └── gwenview.po ├── de │ ├── docs │ │ └── gwenview │ │ │ ├── browse_mode.png │ │ │ ├── fullscreen_mode.png │ │ │ ├── index.docbook │ │ │ └── view_mode.png │ └── gwenview.po ├── el │ └── gwenview.po ├── en_GB │ └── gwenview.po ├── eo │ └── gwenview.po ├── es │ ├── docs │ │ └── gwenview │ │ │ └── index.docbook │ └── gwenview.po ├── et │ └── gwenview.po ├── eu │ └── gwenview.po ├── fi │ └── gwenview.po ├── fr │ └── gwenview.po ├── ga │ └── gwenview.po ├── gl │ └── gwenview.po ├── he │ └── gwenview.po ├── hi │ └── gwenview.po ├── hne │ └── gwenview.po ├── hr │ └── gwenview.po ├── hsb │ └── gwenview.po ├── hu │ └── gwenview.po ├── ia │ └── gwenview.po ├── id │ ├── docs │ │ └── gwenview │ │ │ └── index.docbook │ └── gwenview.po ├── ie │ └── gwenview.po ├── is │ └── gwenview.po ├── it │ ├── docs │ │ └── gwenview │ │ │ ├── browse_mode.png │ │ │ ├── fullscreen-browse.png │ │ │ ├── fullscreen-view.png │ │ │ ├── importer-picking-root-folder.png │ │ │ ├── importer.png │ │ │ ├── index.docbook │ │ │ ├── modified-bar.png │ │ │ ├── start-page.png │ │ │ └── view_mode.png │ └── gwenview.po ├── ja │ └── gwenview.po ├── ka │ └── gwenview.po ├── kk │ └── gwenview.po ├── km │ └── gwenview.po ├── ko │ └── gwenview.po ├── ku │ └── gwenview.po ├── lt │ └── gwenview.po ├── lv │ └── gwenview.po ├── ml │ └── gwenview.po ├── mr │ └── gwenview.po ├── nb │ └── gwenview.po ├── nds │ └── gwenview.po ├── nl │ ├── docs │ │ └── gwenview │ │ │ └── index.docbook │ └── gwenview.po ├── nn │ └── gwenview.po ├── oc │ └── gwenview.po ├── pa │ └── gwenview.po ├── pl │ └── gwenview.po ├── pt │ ├── docs │ │ └── gwenview │ │ │ └── index.docbook │ └── gwenview.po ├── pt_BR │ ├── docs │ │ └── gwenview │ │ │ └── index.docbook │ └── gwenview.po ├── ro │ └── gwenview.po ├── ru │ ├── docs │ │ └── gwenview │ │ │ └── index.docbook │ └── gwenview.po ├── sa │ └── gwenview.po ├── sk │ └── gwenview.po ├── sl │ ├── docs │ │ └── gwenview │ │ │ └── index.docbook │ └── gwenview.po ├── sq │ └── gwenview.po ├── sr │ ├── docs │ │ └── gwenview │ │ │ └── index.docbook │ └── gwenview.po ├── sr@ijekavian │ └── gwenview.po ├── sr@ijekavianlatin │ └── gwenview.po ├── sr@latin │ ├── docs │ │ └── gwenview │ │ │ └── index.docbook │ └── gwenview.po ├── sv │ ├── docs │ │ └── gwenview │ │ │ └── index.docbook │ └── gwenview.po ├── ta │ └── gwenview.po ├── th │ └── gwenview.po ├── tr │ ├── docs │ │ └── gwenview │ │ │ └── index.docbook │ └── gwenview.po ├── ug │ └── gwenview.po ├── uk │ ├── docs │ │ └── gwenview │ │ │ ├── browse_mode.png │ │ │ ├── fullscreen-browse.png │ │ │ ├── fullscreen-view.png │ │ │ ├── importer-picking-root-folder.png │ │ │ ├── importer.png │ │ │ ├── index.docbook │ │ │ ├── modified-bar.png │ │ │ ├── start-page.png │ │ │ └── view_mode.png │ └── gwenview.po ├── wa │ └── gwenview.po ├── zh_CN │ └── gwenview.po └── zh_TW │ └── gwenview.po └── tests ├── CMakeLists.txt ├── auto ├── CMakeLists.txt ├── README_REMOTE_TESTS ├── cmsprofiletest.cpp ├── cmsprofiletest.h ├── contextmanagertest.cpp ├── contextmanagertest.h ├── documenttest.cpp ├── documenttest.h ├── historymodeltest.cpp ├── historymodeltest.h ├── imagemetainfomodeltest.cpp ├── imagemetainfomodeltest.h ├── importertest.cpp ├── importertest.h ├── jpegcontenttest.cpp ├── jpegcontenttest.h ├── placetreemodeltest.cpp ├── placetreemodeltest.h ├── recursivedirmodeltest.cpp ├── recursivedirmodeltest.h ├── semanticinfobackendtest.cpp ├── semanticinfobackendtest.h ├── slidecontainerautotest.cpp ├── slidecontainerautotest.h ├── sorteddirmodeltest.cpp ├── sorteddirmodeltest.h ├── testutils.cpp ├── testutils.h ├── thumbnailprovidertest.cpp ├── thumbnailprovidertest.h ├── timeutilstest.cpp ├── timeutilstest.h ├── transformimageoperationtest.cpp ├── transformimageoperationtest.h ├── urlutilstest.cpp └── urlutilstest.h ├── data ├── .gitignore ├── 160216_no_size_before_decoding.eps ├── 160382_corrupted.jpeg ├── 185523_1frame_with_graphic_control_extension.gif ├── 188191_does_not_load.tga ├── 1frame.gif ├── 1x10k.jpg ├── 1x10k.png ├── 289819_does_not_load.png ├── 302350_exiv_0.23_exception.jpg ├── 40frames.gif ├── 4frames.gif ├── cms │ ├── Lower_Left.jpg │ ├── Lower_Right.jpg │ ├── Upper_Left.jpg │ ├── Upper_Right.jpg │ ├── colourTestFakeBRG.png │ └── colourTestsRGB.png ├── date │ ├── exif-datetime-only.jpg │ └── exif-datetimeoriginal.jpg ├── embedded-thumbnail.jpg ├── empty.png ├── fetch_testing_raw.sh ├── import │ ├── pict0001.jpg │ ├── pict0002.jpg │ └── pict0003.jpg ├── jpg-with-gif-extension.gif ├── orient1_vflip.jpg ├── orient6-small.jpg ├── orient6.jpg ├── png-with-jpeg-extension.jpg ├── test.png ├── test.svg └── test.xcf └── manual ├── CMakeLists.txt ├── browse.txt ├── compare.txt ├── imageloadbench.cpp ├── slidecontainertest.cpp └── thumbnailgen.cpp /.flatpak-manifest.json.license: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: None 2 | # SPDX-License-Identifier: CC0-1.0 -------------------------------------------------------------------------------- /.git-blame-ignore-revs: -------------------------------------------------------------------------------- 1 | #clang-format 2 | b5a4be4ba909a13cb557f76f0505dfac8ace3a3c 3 | 084629e4118e87240c3a81f1180b3831321a7f0d 4 | f70830eb281d84a83c752b1a55f3865998a7493b 5 | 0d70c7a60f7a78f4847dc854a213bbfb7cb970dd 6 | 70bed266937f3be03364eca7eefdfa8537bed4eb 7 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .*.swp 2 | tags 3 | .kdev4/ 4 | *.kdev4 5 | app/build*/ 6 | /build*/ 7 | CMakeLists.txt.user* 8 | .cmake/ 9 | 10 | # LSP & IDE 11 | /.clang-format 12 | /compile_commands.json 13 | .clangd 14 | .cache 15 | .idea 16 | /cmake-build* 17 | -------------------------------------------------------------------------------- /.gitlab-ci.yml: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: None 2 | # SPDX-License-Identifier: CC0-1.0 3 | 4 | include: 5 | - project: sysadmin/ci-utilities 6 | file: 7 | - /gitlab-templates/clang-format.yml 8 | - /gitlab-templates/linux-qt6.yml 9 | - /gitlab-templates/linux-qt6-next.yml 10 | - /gitlab-templates/freebsd-qt6.yml 11 | - /gitlab-templates/flatpak.yml 12 | - /gitlab-templates/xml-lint.yml 13 | - /gitlab-templates/yaml-lint.yml 14 | -------------------------------------------------------------------------------- /.kateconfig: -------------------------------------------------------------------------------- 1 | kate: tab-indents off; indent-width 4; replace-tabs on; 2 | -------------------------------------------------------------------------------- /.kde-ci.yml: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: None 2 | # SPDX-License-Identifier: CC0-1.0 3 | 4 | Dependencies: 5 | - 'on': ['@all'] 6 | 'require': 7 | 'frameworks/extra-cmake-modules': '@latest-kf6' 8 | 'frameworks/kcoreaddons': '@latest-kf6' 9 | 'frameworks/kwidgetsaddons': '@latest-kf6' 10 | 'frameworks/kdbusaddons': '@latest-kf6' 11 | 'frameworks/knotifications': '@latest-kf6' 12 | 'frameworks/kconfig': '@latest-kf6' 13 | 'frameworks/ki18n': '@latest-kf6' 14 | 'frameworks/kio': '@latest-kf6' 15 | 'frameworks/kwindowsystem': '@latest-kf6' 16 | 'frameworks/kdoctools': '@latest-kf6' 17 | 'frameworks/knewstuff': '@latest-kf6' 18 | 'frameworks/kglobalaccel': '@latest-kf6' 19 | 'frameworks/kxmlgui': '@latest-kf6' 20 | 'frameworks/purpose': '@latest-kf6' 21 | 'frameworks/kguiaddons': '@latest-kf6' 22 | 'frameworks/kitemmodels': '@latest-kf6' 23 | 'frameworks/kiconthemes': '@latest-kf6' 24 | 'frameworks/kparts': '@latest-kf6' 25 | 'frameworks/kcrash': '@latest-kf6' 26 | 'plasma/plasma-activities': '@latest-kf6' 27 | 'graphics/libkdcraw': '@same' 28 | 'third-party/wayland': '@latest' 29 | 'third-party/wayland-protocols': '@latest' 30 | -------------------------------------------------------------------------------- /.krazy: -------------------------------------------------------------------------------- 1 | SKIP /lib/libjpeg/ 2 | -------------------------------------------------------------------------------- /CMakePresets.json.license: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: 2021 Laurent Montel 2 | # SPDX-License-Identifier: BSD-3-Clause 3 | -------------------------------------------------------------------------------- /Messages.sh: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | $EXTRACTRC `find . -name "*.ui" -o -name "*.rc" -o -name "*.kcfg" ` >> rc.cpp 3 | $XGETTEXT `find . -name "*.cpp" -o -name "*.h" | grep -v '/tests/'` -o $podir/gwenview.pot 4 | -------------------------------------------------------------------------------- /app/abstractcontextmanageritem.h: -------------------------------------------------------------------------------- 1 | /* 2 | Gwenview: an image viewer 3 | Copyright 2007 Aurélien Gâteau 4 | 5 | This program is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU General Public License 7 | as published by the Free Software Foundation; either version 2 8 | of the License, or (at your option) any later version. 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 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 18 | 19 | */ 20 | 21 | #ifndef ABSTRACTCONTEXTMANAGERITEM_H 22 | #define ABSTRACTCONTEXTMANAGERITEM_H 23 | 24 | // Qt 25 | #include 26 | 27 | namespace Gwenview 28 | { 29 | class ContextManager; 30 | 31 | struct AbstractContextManagerItemPrivate; 32 | class AbstractContextManagerItem : public QObject 33 | { 34 | Q_OBJECT 35 | public: 36 | AbstractContextManagerItem(ContextManager *); 37 | ~AbstractContextManagerItem() override; 38 | 39 | QWidget *widget() const; 40 | 41 | ContextManager *contextManager() const; 42 | 43 | protected: 44 | void setWidget(QWidget *widget); 45 | 46 | private: 47 | AbstractContextManagerItemPrivate *const d; 48 | }; 49 | 50 | } // namespace 51 | 52 | #endif /* ABSTRACTCONTEXTMANAGERITEM_H */ 53 | -------------------------------------------------------------------------------- /app/documentinfoprovider.h: -------------------------------------------------------------------------------- 1 | // vim: set tabstop=4 shiftwidth=4 expandtab: 2 | /* 3 | Gwenview: an image viewer 4 | Copyright 2010 Aurélien Gâteau 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; either version 2 9 | of the License, or (at your option) any later version. 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 | You should have received a copy of the GNU General Public License 17 | along with this program; if not, write to the Free Software 18 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Cambridge, MA 02110-1301, USA. 19 | 20 | */ 21 | #ifndef DOCUMENTINFOPROVIDER_H 22 | #define DOCUMENTINFOPROVIDER_H 23 | 24 | // Qt 25 | 26 | // KF 27 | 28 | // Local 29 | #include 30 | 31 | namespace Gwenview 32 | { 33 | class SortedDirModel; 34 | 35 | class DocumentInfoProvider : public AbstractDocumentInfoProvider 36 | { 37 | Q_OBJECT 38 | public: 39 | DocumentInfoProvider(SortedDirModel *model); 40 | 41 | bool isBusy(const QUrl &url) override; 42 | 43 | bool isModified(const QUrl &url) override; 44 | 45 | void thumbnailForDocument(const QUrl &url, ThumbnailGroup::Enum group, QPixmap *outPix, QSize *outFullSize) const override; 46 | 47 | private: 48 | SortedDirModel *const mDirModel; 49 | }; 50 | 51 | } // namespace 52 | 53 | #endif /* DOCUMENTINFOPROVIDER_H */ 54 | -------------------------------------------------------------------------------- /app/gwenview.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | gwenviewui.rc 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/imagemetainfodialog.h: -------------------------------------------------------------------------------- 1 | // vim: set tabstop=4 shiftwidth=4 expandtab: 2 | /* 3 | Gwenview: an image viewer 4 | Copyright 2007 Aurélien Gâteau 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; either version 2 9 | of the License, or (at your option) any later version. 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 | You should have received a copy of the GNU General Public License 17 | along with this program; if not, write to the Free Software 18 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 19 | 20 | */ 21 | #ifndef IMAGEMETAINFODIALOG_H 22 | #define IMAGEMETAINFODIALOG_H 23 | 24 | // Qt 25 | #include 26 | 27 | // KF 28 | 29 | // Local 30 | 31 | namespace Gwenview 32 | { 33 | class ImageMetaInfoModel; 34 | 35 | struct ImageMetaInfoDialogPrivate; 36 | class ImageMetaInfoDialog : public QDialog 37 | { 38 | Q_OBJECT 39 | public: 40 | explicit ImageMetaInfoDialog(QWidget *parent); 41 | ~ImageMetaInfoDialog() override; 42 | 43 | /** 44 | * Defines the image metainfo model and the preferred metainfo key list. 45 | */ 46 | void setMetaInfo(ImageMetaInfoModel *, const QStringList &list); 47 | 48 | QSize sizeHint() const override; 49 | 50 | Q_SIGNALS: 51 | void preferredMetaInfoKeyListChanged(const QStringList &); 52 | 53 | private: 54 | ImageMetaInfoDialogPrivate *const d; 55 | }; 56 | 57 | } // namespace 58 | 59 | #endif /* IMAGEMETAINFODIALOG_H */ 60 | -------------------------------------------------------------------------------- /app/preloader.h: -------------------------------------------------------------------------------- 1 | // vim: set tabstop=4 shiftwidth=4 expandtab: 2 | /* 3 | Gwenview: an image viewer 4 | Copyright 2008 Aurélien Gâteau 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; either version 2 9 | of the License, or (at your option) any later version. 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 | You should have received a copy of the GNU General Public License 17 | along with this program; if not, write to the Free Software 18 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Cambridge, MA 02110-1301, USA. 19 | 20 | */ 21 | #ifndef PRELOADER_H 22 | #define PRELOADER_H 23 | 24 | // Qt 25 | #include 26 | 27 | // KF 28 | 29 | // Local 30 | 31 | class QSize; 32 | 33 | class QUrl; 34 | 35 | namespace Gwenview 36 | { 37 | struct PreloaderPrivate; 38 | 39 | /** 40 | * This class preloads a document to fit a specific size. 41 | */ 42 | class Preloader : public QObject 43 | { 44 | Q_OBJECT 45 | public: 46 | explicit Preloader(QObject *parent); 47 | ~Preloader() override; 48 | 49 | void preload(const QUrl &, const QSize &); 50 | 51 | private Q_SLOTS: 52 | void doPreload(); 53 | 54 | private: 55 | PreloaderPrivate *const d; 56 | }; 57 | 58 | } // namespace 59 | 60 | #endif /* PRELOADER_H */ 61 | -------------------------------------------------------------------------------- /app/renamedialog.h: -------------------------------------------------------------------------------- 1 | // vim: set tabstop=4 shiftwidth=4 expandtab: 2 | /* 3 | Gwenview: an image viewer 4 | Copyright 2018 Aurélien Gâteau 5 | Copyright 2018 Peter Mühlenpfordt 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; either version 2 10 | of the License, or (at your option) any later version. 11 | 12 | This program is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU General Public License for more details. 16 | 17 | You should have received a copy of the GNU General Public License 18 | along with this program; if not, write to the Free Software 19 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Cambridge, MA 02110-1301, USA. 20 | 21 | */ 22 | #ifndef RENAMEDIALOG_H 23 | #define RENAMEDIALOG_H 24 | 25 | // Qt 26 | #include 27 | 28 | // KF 29 | 30 | // Local 31 | 32 | namespace Gwenview 33 | { 34 | struct RenameDialogPrivate; 35 | class RenameDialog : public QDialog 36 | { 37 | Q_OBJECT 38 | public: 39 | explicit RenameDialog(QWidget *parent); 40 | ~RenameDialog() override; 41 | 42 | void setFilename(const QString &filename); 43 | QString filename() const; 44 | 45 | private: 46 | RenameDialogPrivate *const d; 47 | 48 | void updateButtons(); 49 | }; 50 | 51 | } // namespace 52 | 53 | #endif /* RENAMEDIALOG_H */ 54 | -------------------------------------------------------------------------------- /app/saveallhelper.h: -------------------------------------------------------------------------------- 1 | // vim: set tabstop=4 shiftwidth=4 expandtab: 2 | /* 3 | Gwenview: an image viewer 4 | Copyright 2010 Aurélien Gâteau 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; either version 2 9 | of the License, or (at your option) any later version. 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 | You should have received a copy of the GNU General Public License 17 | along with this program; if not, write to the Free Software 18 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Cambridge, MA 02110-1301, USA. 19 | 20 | */ 21 | #ifndef SAVEALLHELPER_H 22 | #define SAVEALLHELPER_H 23 | 24 | // Qt 25 | #include 26 | 27 | // KF 28 | 29 | // Local 30 | 31 | class KJob; 32 | 33 | namespace Gwenview 34 | { 35 | struct SaveAllHelperPrivate; 36 | class SaveAllHelper : public QObject 37 | { 38 | Q_OBJECT 39 | public: 40 | explicit SaveAllHelper(QWidget *parent); 41 | ~SaveAllHelper() override; 42 | 43 | void save(); 44 | 45 | private Q_SLOTS: 46 | void slotCanceled(); 47 | void slotResult(KJob *); 48 | 49 | private: 50 | SaveAllHelperPrivate *const d; 51 | }; 52 | 53 | } // namespace 54 | 55 | #endif /* SAVEALLHELPER_H */ 56 | -------------------------------------------------------------------------------- /app/savebar.h: -------------------------------------------------------------------------------- 1 | // vim: set tabstop=4 shiftwidth=4 expandtab: 2 | /* 3 | Gwenview: an image viewer 4 | Copyright 2007 Aurélien Gâteau 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; either version 2 9 | of the License, or (at your option) any later version. 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 | You should have received a copy of the GNU General Public License 17 | along with this program; if not, write to the Free Software 18 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 19 | 20 | */ 21 | #ifndef SAVEBAR_H 22 | #define SAVEBAR_H 23 | 24 | // Qt 25 | 26 | // KF 27 | 28 | // Local 29 | #include 30 | 31 | class KActionCollection; 32 | class QUrl; 33 | 34 | namespace Gwenview 35 | { 36 | struct SaveBarPrivate; 37 | class SaveBar : public SlideContainer 38 | { 39 | Q_OBJECT 40 | public: 41 | SaveBar(QWidget *parent, KActionCollection *collection); 42 | ~SaveBar() override; 43 | 44 | void setFullScreenMode(bool); 45 | 46 | public Q_SLOTS: 47 | void setCurrentUrl(const QUrl &); 48 | 49 | Q_SIGNALS: 50 | void requestSaveAll(); 51 | void goToUrl(const QUrl &); 52 | 53 | private: 54 | SaveBarPrivate *const d; 55 | 56 | private Q_SLOTS: 57 | void updateContent(); 58 | void triggerAction(const QString &action); 59 | }; 60 | 61 | } // namespace 62 | 63 | #endif /* SAVEBAR_H */ 64 | -------------------------------------------------------------------------------- /app/slideshowfileitemaction.h: -------------------------------------------------------------------------------- 1 | // vim: set tabstop=4 shiftwidth=4 expandtab: 2 | /* 3 | Gwenview: an image viewer 4 | Copyright 2020 Méven Car 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; either version 2 9 | of the License, or (at your option) any later version. 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 | You should have received a copy of the GNU General Public License 17 | along with this program; if not, write to the Free Software 18 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 19 | 20 | */ 21 | #ifndef SLIDESHOWFILEITEMACTION_H 22 | #define SLIDESHOWFILEITEMACTION_H 23 | 24 | #include 25 | #include 26 | 27 | class QAction; 28 | class QWidget; 29 | 30 | class SlideShowFileItemAction : public KAbstractFileItemActionPlugin 31 | { 32 | Q_OBJECT 33 | 34 | public: 35 | SlideShowFileItemAction(QObject *parent, const QVariantList &args); 36 | 37 | QList actions(const KFileItemListProperties &fileItemInfos, QWidget *parentWidget) override; 38 | 39 | private: 40 | QAction *createAction(const QIcon &icon, const QString &name, QWidget *parent, const QList &urls, const QString &exec); 41 | }; 42 | 43 | #endif // SLIDESHOWFILEITEMACTION_H 44 | -------------------------------------------------------------------------------- /app/splitter.h: -------------------------------------------------------------------------------- 1 | /* 2 | Gwenview: an image viewer 3 | Copyright 2009 Aurélien Gâteau 4 | 5 | This program is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU General Public License 7 | as published by the Free Software Foundation; either version 2 8 | of the License, or (at your option) any later version. 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 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 18 | 19 | */ 20 | #ifndef SPLITTER_H 21 | #define SPLITTER_H 22 | 23 | // Qt 24 | #include 25 | 26 | namespace Gwenview 27 | { 28 | class SplitterHandle : public QSplitterHandle 29 | { 30 | public: 31 | SplitterHandle(Qt::Orientation orientation, QSplitter *parent) 32 | : QSplitterHandle(orientation, parent) 33 | { 34 | } 35 | }; 36 | 37 | /** 38 | * Home made splitter to be able to define a custom handle which is border with 39 | * "mid" colored lines. 40 | */ 41 | class Splitter : public QSplitter 42 | { 43 | public: 44 | Splitter(Qt::Orientation orientation, QWidget *parent) 45 | : QSplitter(orientation, parent) 46 | { 47 | } 48 | 49 | protected: 50 | QSplitterHandle *createHandle() override 51 | { 52 | return new SplitterHandle(orientation(), this); 53 | } 54 | }; 55 | 56 | } // namespace 57 | 58 | #endif /* SPLITTER_H */ 59 | -------------------------------------------------------------------------------- /app/spotlightmode.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of the KDE project 3 | SPDX-License-Identifier: GPL-2.0-or-later 4 | 5 | Project idea and initial maintainer: Aurélien Gâteau 6 | SPDX-FileCopyrightText: 2024 Ravil Saifullin 7 | 8 | */ 9 | #include "spotlightmode.h" 10 | 11 | // Qt 12 | #include 13 | #include 14 | 15 | // Local 16 | #include "gwenview_app_debug.h" 17 | #include 18 | 19 | namespace Gwenview 20 | { 21 | 22 | struct SpotlightModePrivate { 23 | SpotlightMode *q = nullptr; 24 | QToolButton *mButtonQuit = nullptr; 25 | KActionCollection *mActionCollection = nullptr; 26 | }; 27 | 28 | SpotlightMode::SpotlightMode(QWidget *parent, KActionCollection *actionCollection) 29 | : QHBoxLayout(parent) 30 | , d(new SpotlightModePrivate) 31 | { 32 | d->q = this; 33 | d->mActionCollection = actionCollection; 34 | d->mButtonQuit = new QToolButton(); 35 | d->mButtonQuit->setIcon(QIcon::fromTheme(QStringLiteral("window-close"))); 36 | d->mButtonQuit->setAutoRaise(true); 37 | d->mButtonQuit->setVisible(false); 38 | addWidget(d->mButtonQuit, 0, Qt::AlignTop | Qt::AlignRight); 39 | 40 | connect(d->mButtonQuit, &QPushButton::released, this, &SpotlightMode::emitButtonQuitClicked); 41 | } 42 | 43 | SpotlightMode::~SpotlightMode() 44 | { 45 | delete d; 46 | } 47 | 48 | void SpotlightMode::setVisibleSpotlightModeQuitButton(bool visible) 49 | { 50 | d->mButtonQuit->setVisible(visible); 51 | } 52 | 53 | void SpotlightMode::emitButtonQuitClicked() 54 | { 55 | GwenviewConfig::setSpotlightMode(false); 56 | d->mActionCollection->action(QStringLiteral("view_toggle_spotlightmode"))->trigger(); 57 | } 58 | 59 | } // namespace 60 | 61 | #include "moc_spotlightmode.cpp" 62 | -------------------------------------------------------------------------------- /app/spotlightmode.h: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of the KDE project 3 | SPDX-License-Identifier: GPL-2.0-or-later 4 | 5 | Project idea and initial maintainer: Aurélien Gâteau 6 | SPDX-FileCopyrightText: 2024 Ravil Saifullin 7 | 8 | */ 9 | #ifndef SPOTLIGHTMODE_H 10 | #define SPOTLIGHTMODE_H 11 | 12 | // Qt 13 | #include 14 | #include 15 | 16 | // KF 17 | #include 18 | 19 | namespace Gwenview 20 | { 21 | struct SpotlightModePrivate; 22 | class SpotlightMode : public QHBoxLayout 23 | { 24 | Q_OBJECT 25 | public: 26 | SpotlightMode(QWidget *parent, KActionCollection *actionCollection); 27 | void setVisibleSpotlightModeQuitButton(bool visibe); 28 | ~SpotlightMode() override; 29 | 30 | private: 31 | void emitButtonQuitClicked(); 32 | SpotlightModePrivate *const d; 33 | }; 34 | 35 | } // namespace 36 | 37 | #endif /* SPOTLIGHTMODE_H */ 38 | -------------------------------------------------------------------------------- /app/thumbnailviewhelper.h: -------------------------------------------------------------------------------- 1 | // vim: set tabstop=4 shiftwidth=4 expandtab: 2 | /* 3 | Gwenview: an image viewer 4 | Copyright 2007 Aurélien Gâteau 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; either version 2 9 | of the License, or (at your option) any later version. 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 | You should have received a copy of the GNU General Public License 17 | along with this program; if not, write to the Free Software 18 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 19 | 20 | */ 21 | #ifndef THUMBNAILVIEWHELPER_H 22 | #define THUMBNAILVIEWHELPER_H 23 | 24 | // Qt 25 | 26 | // KF 27 | 28 | // Local 29 | #include 30 | 31 | class KActionCollection; 32 | 33 | namespace Gwenview 34 | { 35 | struct ThumbnailViewHelperPrivate; 36 | class ThumbnailViewHelper : public AbstractThumbnailViewHelper 37 | { 38 | Q_OBJECT 39 | public: 40 | ThumbnailViewHelper(QObject *parent, KActionCollection *); 41 | ~ThumbnailViewHelper() override; 42 | 43 | void showContextMenu(QWidget *parent) override; 44 | 45 | void showMenuForUrlDroppedOnViewport(QWidget *parent, const QList &) override; 46 | 47 | void showMenuForUrlDroppedOnDir(QWidget *parent, const QList &, const QUrl &) override; 48 | 49 | public Q_SLOTS: 50 | void setCurrentDirUrl(const QUrl &); 51 | 52 | private: 53 | ThumbnailViewHelperPrivate *const d; 54 | }; 55 | 56 | } // namespace 57 | 58 | #endif /* THUMBNAILVIEWHELPER_H */ 59 | -------------------------------------------------------------------------------- /color-schemes/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | install( 2 | FILES fullscreen.colors 3 | DESTINATION ${KDE_INSTALL_DATADIR}/gwenview/color-schemes/ 4 | ) 5 | -------------------------------------------------------------------------------- /config-gwenview.h.cmake: -------------------------------------------------------------------------------- 1 | #cmakedefine GWENVIEW_SEMANTICINFO_BACKEND_NONE 1 2 | #cmakedefine GWENVIEW_SEMANTICINFO_BACKEND_FAKE 1 3 | #cmakedefine GWENVIEW_SEMANTICINFO_BACKEND_BALOO 1 4 | #define GV_TEST_DATA_DIR "@CMAKE_CURRENT_SOURCE_DIR@/tests/data" 5 | #cmakedefine HAVE_X11 ${HAVE_X11} 6 | #cmakedefine HAVE_FITS ${HAVE_FITS} 7 | #cmakedefine HAVE_QTDBUS ${HAVE_QTDBUS} 8 | #cmakedefine01 HAVE_KACTIVITIES 9 | #cmakedefine01 HAVE_PURPOSE 10 | #cmakedefine HAVE_TIFF 1 11 | #cmakedefine KIMAGEANNOTATOR_FOUND ${KIMAGEANNOTATOR-Qt6_FOUND} 12 | #cmakedefine GWENVIEW_NO_WAYLAND_GESTURES 1 13 | -------------------------------------------------------------------------------- /cursors/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | install( 2 | FILES zoom.png 3 | DESTINATION ${KDE_INSTALL_DATADIR}/gwenview/cursors/ 4 | ) 5 | -------------------------------------------------------------------------------- /cursors/zoom.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/gwenview/b7d675da69765cde021ee05982ef8e4f904b712c/cursors/zoom.png -------------------------------------------------------------------------------- /devdoc/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Intro 2 | 3 | Great to hear you want to contribute to Gwenview! Patches are always welcome. 4 | 5 | # Mailing list 6 | 7 | If you want to discuss development of Gwenview, you can subscribe to 8 | gwenview-devel mailing list: 9 | . 10 | 11 | # Bug tracker 12 | 13 | Gwenview bugs are tracked on KDE Bugzilla (). They are 14 | assigned to a fake user by default: `gwenview-bugs-null@kde.org`. To get 15 | notified when new bugs are filed, add this user to the list of users you follow. 16 | You can do so from Bugzilla by editing your user preferences, then go in the 17 | "Email Preferences" tab () 18 | 19 | # Code review 20 | 21 | Patches should be sent for review on . You will 22 | get faster answers by posting them there rather than attaching them to a 23 | Bugzilla bug report. 24 | 25 | # Commits for stable branch 26 | 27 | Commits to stable branch should be made to the stable branch first, then merged 28 | back to master. 29 | 30 | Here is an example work-flow. 31 | 32 | First fix something in KDE/4.x: 33 | 34 | git checkout KDE/4.x 35 | # Fix something, get it reviewed 36 | git commit 37 | git push 38 | 39 | Now merge the commit in master. Note the use of `--no-ff` in `git merge`. This 40 | is required to make it easy to rollback the merge if need be. 41 | 42 | git checkout master 43 | git merge --no-ff origin/KDE/4.x 44 | # Check merge is correct 45 | git push 46 | -------------------------------------------------------------------------------- /devdoc/ENVIRONMENT_VARIABLES.md: -------------------------------------------------------------------------------- 1 | This document describe environment variables you can set to debug Gwenview 2 | 3 | # `GV_MAX_UNREFERENCED_IMAGES` 4 | 5 | How many unreferenced images (images which are not currently displayed and have 6 | not been modified) should be kept in memory. 7 | 8 | Defaults to 3 9 | 10 | # `GV_THUMBNAIL_DIR` 11 | 12 | Defines the dir where thumbnails should be generated. 13 | 14 | Defaults to $HOME/.thumbnails/ 15 | 16 | # `GV_REMOTE_TESTS_BASE_URL` 17 | 18 | Used by documenttest. Define a base url where documenttest will put images to 19 | test loading from remote urls. 20 | 21 | If not set, remote url tests are skipped. 22 | 23 | Should be set to something like `sftp://localhost/tmp` 24 | 25 | # `GV_FATAL_FAILS` 26 | 27 | If set, when a `GV_RETURN*_IF_FAIL` method fails, then `kFatal()` will be 28 | called, which makes it possible to stop at the place of the failure with the 29 | debugger and also makes it possible for users to report backtraces if they 30 | experiment those failures. 31 | -------------------------------------------------------------------------------- /devdoc/OVERVIEW.md: -------------------------------------------------------------------------------- 1 | # "Model" 2 | 3 | ## Document 4 | 5 | A document can hold either a raster image, an svg image or a video. 6 | 7 | The DocumentKind enum represents what kind of document it is. 8 | 9 | Holds the data, responsible for loading and saving. 10 | 11 | ## DocumentFactory 12 | 13 | Creates Document instances. Can cache them. 14 | 15 | # "View" 16 | 17 | ## DocumentView 18 | 19 | Can display a document. Depending on the document kind, the DocumentView will 20 | use a different adapter (see AbstractDocumentViewAdapter) 21 | 22 | ## DocumentViewContainer 23 | 24 | DocumentViewContainer is responsible for creating and deleting DocumentViews. 25 | 26 | Every time a new document is visible, a new DocumentView is created. When it is 27 | no longer visible the document view is deleted. This means when user goes from 28 | 1.jpg to 2.jpg, the DocumentView displaying 1.jpg is deleted and a new one is 29 | created for 2.jpg. 30 | 31 | DocumentViewContainer is also responsible for laying out the different views 32 | when comparing them. 33 | -------------------------------------------------------------------------------- /doc/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ########### install files ############### 2 | # 3 | # 4 | if(KF6DocTools_FOUND) 5 | kdoctools_create_handbook(index.docbook INSTALL_DESTINATION ${KDE_INSTALL_DOCBUNDLEDIR}/en SUBDIR gwenview) 6 | endif() 7 | -------------------------------------------------------------------------------- /doc/browse_mode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/gwenview/b7d675da69765cde021ee05982ef8e4f904b712c/doc/browse_mode.png -------------------------------------------------------------------------------- /doc/fullscreen-browse.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/gwenview/b7d675da69765cde021ee05982ef8e4f904b712c/doc/fullscreen-browse.png -------------------------------------------------------------------------------- /doc/fullscreen-view.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/gwenview/b7d675da69765cde021ee05982ef8e4f904b712c/doc/fullscreen-view.png -------------------------------------------------------------------------------- /doc/importer-picking-root-folder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/gwenview/b7d675da69765cde021ee05982ef8e4f904b712c/doc/importer-picking-root-folder.png -------------------------------------------------------------------------------- /doc/importer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/gwenview/b7d675da69765cde021ee05982ef8e4f904b712c/doc/importer.png -------------------------------------------------------------------------------- /doc/modified-bar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/gwenview/b7d675da69765cde021ee05982ef8e4f904b712c/doc/modified-bar.png -------------------------------------------------------------------------------- /doc/start-page.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/gwenview/b7d675da69765cde021ee05982ef8e4f904b712c/doc/start-page.png -------------------------------------------------------------------------------- /doc/view_mode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/gwenview/b7d675da69765cde021ee05982ef8e4f904b712c/doc/view_mode.png -------------------------------------------------------------------------------- /icons/128-actions-document-share.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/gwenview/b7d675da69765cde021ee05982ef8e4f904b712c/icons/128-actions-document-share.png -------------------------------------------------------------------------------- /icons/128-apps-gwenview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/gwenview/b7d675da69765cde021ee05982ef8e4f904b712c/icons/128-apps-gwenview.png -------------------------------------------------------------------------------- /icons/16-actions-document-share.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/gwenview/b7d675da69765cde021ee05982ef8e4f904b712c/icons/16-actions-document-share.png -------------------------------------------------------------------------------- /icons/16-apps-gwenview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/gwenview/b7d675da69765cde021ee05982ef8e4f904b712c/icons/16-apps-gwenview.png -------------------------------------------------------------------------------- /icons/22-actions-document-share.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/gwenview/b7d675da69765cde021ee05982ef8e4f904b712c/icons/22-actions-document-share.png -------------------------------------------------------------------------------- /icons/22-apps-gwenview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/gwenview/b7d675da69765cde021ee05982ef8e4f904b712c/icons/22-apps-gwenview.png -------------------------------------------------------------------------------- /icons/32-actions-document-share.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/gwenview/b7d675da69765cde021ee05982ef8e4f904b712c/icons/32-actions-document-share.png -------------------------------------------------------------------------------- /icons/32-apps-gwenview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/gwenview/b7d675da69765cde021ee05982ef8e4f904b712c/icons/32-apps-gwenview.png -------------------------------------------------------------------------------- /icons/48-actions-document-share.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/gwenview/b7d675da69765cde021ee05982ef8e4f904b712c/icons/48-actions-document-share.png -------------------------------------------------------------------------------- /icons/48-apps-gwenview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/gwenview/b7d675da69765cde021ee05982ef8e4f904b712c/icons/48-apps-gwenview.png -------------------------------------------------------------------------------- /icons/64-actions-document-share.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/gwenview/b7d675da69765cde021ee05982ef8e4f904b712c/icons/64-actions-document-share.png -------------------------------------------------------------------------------- /icons/64-apps-gwenview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/gwenview/b7d675da69765cde021ee05982ef8e4f904b712c/icons/64-apps-gwenview.png -------------------------------------------------------------------------------- /icons/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ecm_install_icons( ICONS 128-actions-document-share.png 2 | 128-apps-gwenview.png 3 | 16-actions-document-share.png 4 | 16-apps-gwenview.png 5 | 22-actions-document-share.png 6 | 22-apps-gwenview.png 7 | 32-actions-document-share.png 8 | 32-apps-gwenview.png 9 | 48-actions-document-share.png 10 | 48-apps-gwenview.png 11 | 64-actions-document-share.png 12 | 64-apps-gwenview.png 13 | DESTINATION ${KDE_INSTALL_ICONDIR} THEME hicolor ) 14 | -------------------------------------------------------------------------------- /images/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | install(FILES background.png 2 | DESTINATION ${KDE_INSTALL_DATADIR}/gwenview/images/ 3 | ) 4 | -------------------------------------------------------------------------------- /images/background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/gwenview/b7d675da69765cde021ee05982ef8e4f904b712c/images/background.png -------------------------------------------------------------------------------- /importer/dialogpage.h: -------------------------------------------------------------------------------- 1 | // vim: set tabstop=4 shiftwidth=4 expandtab: 2 | /* 3 | Gwenview: an image viewer 4 | Copyright 2009 Aurélien Gâteau 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; either version 2 9 | of the License, or (at your option) any later version. 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 | You should have received a copy of the GNU General Public License 17 | along with this program; if not, write to the Free Software 18 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Cambridge, MA 02110-1301, USA. 19 | 20 | */ 21 | #ifndef DIALOGPAGE_H 22 | #define DIALOGPAGE_H 23 | 24 | // Qt 25 | #include 26 | 27 | // KF 28 | 29 | // Local 30 | 31 | class KGuiItem; 32 | 33 | namespace Gwenview 34 | { 35 | struct DialogPagePrivate; 36 | class DialogPage : public QWidget 37 | { 38 | Q_OBJECT 39 | public: 40 | explicit DialogPage(QWidget *parent = nullptr); 41 | ~DialogPage() override; 42 | 43 | void removeButtons(); 44 | void setText(const QString &); 45 | int addButton(const KGuiItem &); 46 | int exec(); 47 | 48 | public Q_SLOTS: 49 | void slotShowErrors(const QStringList &, const QStringList &); 50 | void slotShowFailedFileDetails(); 51 | void slotShowFailedDirDetails(); 52 | 53 | private: 54 | DialogPagePrivate *const d; 55 | }; 56 | 57 | } // namespace 58 | 59 | #endif /* DIALOGPAGE_H */ 60 | -------------------------------------------------------------------------------- /importer/filenameformater.h: -------------------------------------------------------------------------------- 1 | // vim: set tabstop=4 shiftwidth=4 expandtab: 2 | /* 3 | Gwenview: an image viewer 4 | Copyright 2009 Aurélien Gâteau 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; either version 2 9 | of the License, or (at your option) any later version. 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 | You should have received a copy of the GNU General Public License 17 | along with this program; if not, write to the Free Software 18 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Cambridge, MA 02110-1301, USA. 19 | 20 | */ 21 | #ifndef FILENAMEFORMATER_H 22 | #define FILENAMEFORMATER_H 23 | 24 | // Qt 25 | #include 26 | 27 | // KF 28 | 29 | // Local 30 | 31 | class QDateTime; 32 | class QString; 33 | class QUrl; 34 | 35 | namespace Gwenview 36 | { 37 | struct FileNameFormaterPrivate; 38 | class FileNameFormater 39 | { 40 | public: 41 | using HelpMap = QMap; 42 | 43 | explicit FileNameFormater(const QString &format); 44 | ~FileNameFormater(); 45 | 46 | /** 47 | * Given an url and its dateTime, returns a filename according to the 48 | * format passed to the constructor 49 | */ 50 | QString format(const QUrl &url, const QDateTime &dateTime); 51 | 52 | /** 53 | * Returns a map whose keys are the available keywords and values are the 54 | * keyword help 55 | */ 56 | static HelpMap helpMap(); 57 | 58 | private: 59 | FileNameFormaterPrivate *const d; 60 | }; 61 | 62 | } // namespace 63 | 64 | #endif /* FILENAMEFORMATER_H */ 65 | -------------------------------------------------------------------------------- /importer/fileutils.h: -------------------------------------------------------------------------------- 1 | // vim: set tabstop=4 shiftwidth=4 expandtab: 2 | /* 3 | Gwenview: an image viewer 4 | Copyright 2009 Aurélien Gâteau 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; either version 2 9 | of the License, or (at your option) any later version. 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 | You should have received a copy of the GNU General Public License 17 | along with this program; if not, write to the Free Software 18 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Cambridge, MA 02110-1301, USA. 19 | 20 | */ 21 | #ifndef FILEUTILS_H 22 | #define FILEUTILS_H 23 | 24 | class QWidget; 25 | class QUrl; 26 | 27 | namespace Gwenview 28 | { 29 | namespace FileUtils 30 | { 31 | enum RenameResult { 32 | RenamedOK, /** Renamed without problem */ 33 | RenamedUnderNewName, /** Destination already existed, so rename() added a suffix to make the name unique */ 34 | Skipped, /** Destination already existed and contained the same data as source, so rename() just removed the source */ 35 | RenameFailed, /** Rename failed */ 36 | }; 37 | 38 | /** 39 | * Compare content of two urls, returns whether they are the same 40 | */ 41 | bool contentsAreIdentical(const QUrl &url1, const QUrl &url2, QWidget *authWindow = nullptr); 42 | 43 | /** 44 | * Rename src to dst, returns RenameResult 45 | */ 46 | RenameResult rename(const QUrl &src, const QUrl &dst, QWidget *authWindow = nullptr); 47 | 48 | } // namespace 49 | } // namespace 50 | 51 | #endif /* FILEUTILS_H */ 52 | -------------------------------------------------------------------------------- /importer/importdialog.h: -------------------------------------------------------------------------------- 1 | // vim: set tabstop=4 shiftwidth=4 expandtab: 2 | /* 3 | Gwenview: an image viewer 4 | Copyright 2009 Aurélien Gâteau 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; either version 2 9 | of the License, or (at your option) any later version. 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 | You should have received a copy of the GNU General Public License 17 | along with this program; if not, write to the Free Software 18 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Cambridge, MA 02110-1301, USA. 19 | 20 | */ 21 | #ifndef IMPORTDIALOG_H 22 | #define IMPORTDIALOG_H 23 | 24 | // Qt 25 | #include 26 | 27 | // KF 28 | #include 29 | 30 | // Local 31 | 32 | namespace Gwenview 33 | { 34 | class ImportDialogPrivate; 35 | class ImportDialog : public KMainWindow 36 | { 37 | Q_OBJECT 38 | public: 39 | ImportDialog(); 40 | ~ImportDialog() override; 41 | 42 | QSize sizeHint() const override; 43 | 44 | public Q_SLOTS: 45 | void setSourceUrl(const QUrl &, const QString &deviceUdi); 46 | 47 | private Q_SLOTS: 48 | void startImport(); 49 | void slotImportFinished(); 50 | void showImportError(const QString &); 51 | 52 | Q_SIGNALS: 53 | void showErrors(const QStringList &, const QStringList &); 54 | 55 | private: 56 | ImportDialogPrivate *const d; 57 | }; 58 | 59 | } // namespace 60 | 61 | #endif /* IMPORTDIALOG_H */ 62 | -------------------------------------------------------------------------------- /importer/importerconfig.kcfg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | true 14 | 15 | 16 | {date}_{time}.{ext.lower} 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /importer/importerconfig.kcfgc: -------------------------------------------------------------------------------- 1 | File=importerconfig.kcfg 2 | ClassName=ImporterConfig 3 | NameSpace=Gwenview 4 | Singleton=true 5 | Mutators=true 6 | UseEnumTypes=true 7 | -------------------------------------------------------------------------------- /importer/importerconfigdialog.h: -------------------------------------------------------------------------------- 1 | // vim: set tabstop=4 shiftwidth=4 expandtab: 2 | /* 3 | Gwenview: an image viewer 4 | Copyright 2009 Aurélien Gâteau 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; either version 2 9 | of the License, or (at your option) any later version. 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 | You should have received a copy of the GNU General Public License 17 | along with this program; if not, write to the Free Software 18 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Cambridge, MA 02110-1301, USA. 19 | 20 | */ 21 | #ifndef IMPORTERCONFIGDIALOG_H 22 | #define IMPORTERCONFIGDIALOG_H 23 | 24 | // Qt 25 | 26 | // KF 27 | #include 28 | 29 | // Local 30 | 31 | namespace Gwenview 32 | { 33 | struct ImporterConfigDialogPrivate; 34 | class ImporterConfigDialog : public KConfigDialog 35 | { 36 | Q_OBJECT 37 | public: 38 | explicit ImporterConfigDialog(QWidget *); 39 | ~ImporterConfigDialog() override; 40 | 41 | private Q_SLOTS: 42 | void slotHelpLinkActivated(const QString &keyword); 43 | void updatePreview(); 44 | 45 | private: 46 | ImporterConfigDialogPrivate *const d; 47 | }; 48 | 49 | } // namespace 50 | 51 | #endif /* IMPORTERCONFIGDIALOG_H */ 52 | -------------------------------------------------------------------------------- /importer/org.kde.gwenview_importer.desktop: -------------------------------------------------------------------------------- 1 | [Desktop Entry] 2 | Name=Gwenview Importer 3 | Name[ar]=مستورد جوِينفيو 4 | Name[az]=Gwenview idxalçısı 5 | Name[be]=Сродак імпарту Gwenview 6 | Name[bg]=Импортиране с Gwenview 7 | Name[ca]=Importador del Gwenview 8 | Name[ca@valencia]=Importador de Gwenview 9 | Name[cs]=Import pro Gwenview 10 | Name[da]=Gwenview importør 11 | Name[de]=Gwenview-Import 12 | Name[el]=Εισαγωγέας Gwenview 13 | Name[en_GB]=Gwenview Importer 14 | Name[eo]=Gwenview Importilo 15 | Name[es]=Importador de Gwenview 16 | Name[eu]=Gwenview inportatzailea 17 | Name[fi]=Gwenview-tuonti 18 | Name[fr]=Outil d'importation de Gwenview 19 | Name[gl]=Importador de Gwenview 20 | Name[he]=המייבא של Gwenview 21 | Name[hi]=ग्वेन-व्यू छवि आयातक 22 | Name[hu]=Gwenview importáló 23 | Name[ia]=Importator de Gwenview 24 | Name[id]=Pengimpor Gwenview 25 | Name[ie]=Importator de Gwenview 26 | Name[is]=Gwenview-innflutningur 27 | Name[it]=Importazione di Gwenview 28 | Name[ka]=Gwenview-ის შემომტანი 29 | Name[ko]=Gwenview 가져오기 도구 30 | Name[lt]=Gwenview importavimo pagelbiklis 31 | Name[lv]=„Gwenview“ importētājs 32 | Name[nl]=Gwenview-importprogramma 33 | Name[nn]=Gwenview-importering 34 | Name[pa]=ਗਵਿਨ-ਵਿਊ ਇੰਪੋਰਟਰ 35 | Name[pl]=Importowanie Gwenview 36 | Name[pt]=Importação do Gwenview 37 | Name[pt_BR]=Importador do Gwenview 38 | Name[ro]=Importator Gwenview 39 | Name[ru]=Средство импорта Gwenview 40 | Name[sa]=ग्वेनव्यू आयातक 41 | Name[sk]=Import pre Gwenview 42 | Name[sl]=Uvoznik Gwenview 43 | Name[sv]=Gwenview importverktyg 44 | Name[ta]=குவென்வியூ இறக்குமதி நிரல் 45 | Name[tr]=Gwenview İçe Aktarıcısı 46 | Name[uk]=Інструмент імпортування Gwenview 47 | Name[x-test]=xxGwenview Importerxx 48 | Name[zh_CN]=Gwenview 导入程序 49 | Name[zh_TW]=Gwenview 匯入器 50 | Exec=gwenview_importer %u 51 | Icon=gwenview 52 | Type=Application 53 | X-DocPath=gwenview/importer.html 54 | NoDisplay=true 55 | StartupWMClass=gwenview 56 | -------------------------------------------------------------------------------- /importer/progresspage.cpp: -------------------------------------------------------------------------------- 1 | // vim: set tabstop=4 shiftwidth=4 expandtab: 2 | /* 3 | Gwenview: an image viewer 4 | Copyright 2009 Aurélien Gâteau 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; either version 2 9 | of the License, or (at your option) any later version. 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 | You should have received a copy of the GNU General Public License 17 | along with this program; if not, write to the Free Software 18 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Cambridge, MA 02110-1301, USA. 19 | 20 | */ 21 | // Self 22 | #include "progresspage.h" 23 | 24 | // Local 25 | #include "importer.h" 26 | #include 27 | 28 | namespace Gwenview 29 | { 30 | struct ProgressPagePrivate : public Ui_ProgressPage { 31 | ProgressPage *q = nullptr; 32 | Importer *mImporter = nullptr; 33 | }; 34 | 35 | ProgressPage::ProgressPage(Importer *importer) 36 | : d(new ProgressPagePrivate) 37 | { 38 | d->q = this; 39 | d->mImporter = importer; 40 | d->setupUi(this); 41 | 42 | connect(d->mImporter, &Importer::progressChanged, d->mProgressBar, &QProgressBar::setValue); 43 | connect(d->mImporter, &Importer::maximumChanged, d->mProgressBar, &QProgressBar::setMaximum); 44 | } 45 | 46 | ProgressPage::~ProgressPage() 47 | { 48 | delete d; 49 | } 50 | 51 | } // namespace 52 | 53 | #include "moc_progresspage.cpp" 54 | -------------------------------------------------------------------------------- /importer/progresspage.h: -------------------------------------------------------------------------------- 1 | // vim: set tabstop=4 shiftwidth=4 expandtab: 2 | /* 3 | Gwenview: an image viewer 4 | Copyright 2009 Aurélien Gâteau 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; either version 2 9 | of the License, or (at your option) any later version. 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 | You should have received a copy of the GNU General Public License 17 | along with this program; if not, write to the Free Software 18 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Cambridge, MA 02110-1301, USA. 19 | 20 | */ 21 | #ifndef PROGRESSPAGE_H 22 | #define PROGRESSPAGE_H 23 | 24 | // Qt 25 | #include 26 | 27 | // KF 28 | 29 | // Local 30 | 31 | namespace Gwenview 32 | { 33 | class Importer; 34 | 35 | struct ProgressPagePrivate; 36 | class ProgressPage : public QWidget 37 | { 38 | Q_OBJECT 39 | public: 40 | explicit ProgressPage(Importer *); 41 | ~ProgressPage() override; 42 | 43 | private: 44 | ProgressPagePrivate *const d; 45 | }; 46 | 47 | } // namespace 48 | 49 | #endif /* PROGRESSPAGE_H */ 50 | -------------------------------------------------------------------------------- /importer/progresspage.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | ProgressPage 4 | 5 | 6 | 7 | 0 8 | 0 9 | 400 10 | 300 11 | 12 | 13 | 14 | 15 | 16 | 17 | Qt::Vertical 18 | 19 | 20 | 21 | 20 22 | 112 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | Importing documents... 31 | 32 | 33 | 34 | 35 | 36 | 37 | 0 38 | 39 | 40 | 41 | 42 | 43 | 44 | Qt::Vertical 45 | 46 | 47 | 48 | 20 49 | 111 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | QDialogButtonBox::Cancel 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | -------------------------------------------------------------------------------- /importer/serializedurlmap.h: -------------------------------------------------------------------------------- 1 | // vim: set tabstop=4 shiftwidth=4 expandtab: 2 | /* 3 | Gwenview: an image viewer 4 | Copyright 2012 Aurélien Gâteau 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; either version 2 9 | of the License, or (at your option) any later version. 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 | You should have received a copy of the GNU General Public License 17 | along with this program; if not, write to the Free Software 18 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Cambridge, MA 02110-1301, USA. 19 | 20 | */ 21 | #ifndef SERIALIZEDURLMAP_H 22 | #define SERIALIZEDURLMAP_H 23 | 24 | // Local 25 | 26 | // KF 27 | 28 | // Qt 29 | 30 | class KConfigGroup; 31 | class QUrl; 32 | 33 | namespace Gwenview 34 | { 35 | struct SerializedUrlMapPrivate; 36 | /** 37 | * A map-like QUrl=>QUrl object, serialized in a KConfigGroup 38 | */ 39 | class SerializedUrlMap 40 | { 41 | public: 42 | SerializedUrlMap(); 43 | ~SerializedUrlMap(); 44 | 45 | void setConfigGroup(const KConfigGroup &); 46 | 47 | QUrl value(const QUrl &) const; 48 | 49 | void insert(const QUrl &key, const QUrl &value); 50 | 51 | private: 52 | SerializedUrlMapPrivate *const d; 53 | }; 54 | 55 | } // namespace 56 | 57 | #endif /* SERIALIZEDURLMAP_H */ 58 | -------------------------------------------------------------------------------- /lib/about.cpp: -------------------------------------------------------------------------------- 1 | // vim: set tabstop=4 shiftwidth=4 expandtab: 2 | /* 3 | Gwenview: an image viewer 4 | Copyright 2012 Aurélien Gâteau 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; either version 2 9 | of the License, or (at your option) any later version. 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 | You should have received a copy of the GNU General Public License 17 | along with this program. If not, see . 18 | */ 19 | // Self 20 | #include "about.h" 21 | 22 | // Local 23 | #include "gwenview_version.h" 24 | 25 | // KF 26 | #include 27 | #include 28 | 29 | // Qt 30 | #include 31 | 32 | namespace Gwenview 33 | { 34 | KAboutData *createAboutData(const QString &appName, const QString &programName) 35 | { 36 | auto data = new KAboutData(appName, programName, QStringLiteral(GWENVIEW_VERSION_STRING)); 37 | data->setLicense(KAboutLicense::GPL); 38 | data->setCopyrightStatement(i18n("Copyright 2000-2022 Gwenview authors")); 39 | data->setProductName("gwenview"); 40 | data->addAuthor(QStringLiteral("Lukáš Tinkl"), i18n("Current Maintainer"), QStringLiteral("ltinkl@redhat.com")); 41 | data->addAuthor(QStringLiteral("Aurélien Gâteau"), i18n("Developer"), QStringLiteral("agateau@kde.org")); 42 | data->addAuthor(QStringLiteral("Benjamin Löwe"), i18n("Developer"), QStringLiteral("benni@mytum.de")); 43 | return data; 44 | } 45 | 46 | } // namespace 47 | -------------------------------------------------------------------------------- /lib/about.h: -------------------------------------------------------------------------------- 1 | // vim: set tabstop=4 shiftwidth=4 expandtab: 2 | /* 3 | Gwenview: an image viewer 4 | Copyright 2013 Aurélien Gâteau 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; either version 2 9 | of the License, or (at your option) any later version. 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 | You should have received a copy of the GNU General Public License 17 | along with this program. If not, see . 18 | */ 19 | #ifndef ABOUT_H 20 | #define ABOUT_H 21 | 22 | #include 23 | 24 | // Local 25 | 26 | // KF 27 | 28 | // Qt 29 | 30 | class KAboutData; 31 | class QString; 32 | 33 | namespace Gwenview 34 | { 35 | GWENVIEWLIB_EXPORT KAboutData *createAboutData(const QString &appName, const QString &programName); 36 | 37 | } // namespace 38 | 39 | #endif /* ABOUT_H */ 40 | -------------------------------------------------------------------------------- /lib/annotate/annotatedialog.h: -------------------------------------------------------------------------------- 1 | /* 2 | Gwenview: an image viewer 3 | Copyright 2022 Ilya Pominov 4 | 5 | This program is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU General Public License 7 | as published by the Free Software Foundation; either version 2 8 | of the License, or (at your option) any later version. 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 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 18 | 19 | */ 20 | #ifndef ANNOTATEDIALOG_H 21 | #define ANNOTATEDIALOG_H 22 | 23 | #include 24 | 25 | // Qt 26 | #include 27 | 28 | namespace kImageAnnotator 29 | { 30 | class KImageAnnotator; 31 | }; 32 | 33 | namespace Gwenview 34 | { 35 | 36 | class GWENVIEWLIB_EXPORT AnnotateDialog : public QDialog 37 | { 38 | public: 39 | explicit AnnotateDialog(QWidget *parent); 40 | ~AnnotateDialog(); 41 | 42 | void setImage(const QImage &image); 43 | QImage getImage() const; 44 | 45 | private: 46 | kImageAnnotator::KImageAnnotator *mAnnotator; 47 | }; 48 | 49 | } // namespace 50 | 51 | #endif // ANNOTATEDIALOG_H 52 | -------------------------------------------------------------------------------- /lib/annotate/annotateoperation.h: -------------------------------------------------------------------------------- 1 | /* 2 | Gwenview: an image viewer 3 | Copyright 2022 Ilya Pominov 4 | 5 | This program is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU General Public License 7 | as published by the Free Software Foundation; either version 2 8 | of the License, or (at your option) any later version. 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 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 18 | 19 | */ 20 | #ifndef ANNOTATEOPERATION_H 21 | #define ANNOTATEOPERATION_H 22 | 23 | #include 24 | 25 | // Local 26 | #include 27 | 28 | namespace Gwenview 29 | { 30 | class AnnotateOperationPrivate; 31 | 32 | class GWENVIEWLIB_EXPORT AnnotateOperation : public AbstractImageOperation 33 | { 34 | public: 35 | explicit AnnotateOperation(const QImage &image); 36 | ~AnnotateOperation() override; 37 | 38 | void redo() override; 39 | void undo() override; 40 | 41 | private: 42 | AnnotateOperationPrivate *const d; 43 | }; 44 | 45 | } // namespace 46 | 47 | #endif /* ANNOTATEOPERATION_H */ 48 | -------------------------------------------------------------------------------- /lib/archiveutils.h: -------------------------------------------------------------------------------- 1 | // vim: set tabstop=4 shiftwidth=4 expandtab 2 | /* 3 | Gwenview - A simple image viewer for KDE 4 | Copyright 2000-2004 Aurélien Gâteau 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; either version 2 9 | of the License, or (at your option) any later version. 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 | You should have received a copy of the GNU General Public License 17 | along with this program; if not, write to the Free Software 18 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 19 | 20 | */ 21 | #ifndef ARCHIVEUTILS_H 22 | #define ARCHIVEUTILS_H 23 | 24 | #include 25 | 26 | // Qt 27 | #include 28 | class KFileItem; 29 | 30 | namespace Gwenview 31 | { 32 | /** 33 | * Helper functions to deal with archives 34 | */ 35 | namespace ArchiveUtils 36 | { 37 | /** 38 | * Returns true if @p item is an archive 39 | */ 40 | GWENVIEWLIB_EXPORT bool fileItemIsArchive(const KFileItem &item); 41 | 42 | /** 43 | * Returns true if @p item is a dir or an archive 44 | */ 45 | GWENVIEWLIB_EXPORT bool fileItemIsDirOrArchive(const KFileItem &item); 46 | 47 | /** 48 | * Returns the protocol for an archive mime type. Similar to 49 | * KProtocolManager::protocolForArchiveMimetype(), except it tries parent 50 | * mimetypes if it can't find anything (useful for .cbz and co) 51 | */ 52 | GWENVIEWLIB_EXPORT QString protocolForMimeType(const QString &mimeType); 53 | 54 | } // namespace ArchiveUtils 55 | 56 | } // namespace Gwenview 57 | #endif 58 | -------------------------------------------------------------------------------- /lib/bcg/bcgimageoperation.h: -------------------------------------------------------------------------------- 1 | /* 2 | Gwenview: an image viewer 3 | Copyright 2022 Ilya Pominov 4 | 5 | This program is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU General Public License 7 | as published by the Free Software Foundation; either version 2 8 | of the License, or (at your option) any later version. 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 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 18 | 19 | */ 20 | #ifndef BCGIMAGEOPERATION_H 21 | #define BCGIMAGEOPERATION_H 22 | 23 | #include 24 | 25 | // Qt 26 | 27 | // KF 28 | 29 | // Local 30 | #include 31 | 32 | namespace Gwenview 33 | { 34 | struct BCGImageOperationPrivate; 35 | class GWENVIEWLIB_EXPORT BCGImageOperation : public AbstractImageOperation 36 | { 37 | Q_OBJECT 38 | public: 39 | struct BrightnessContrastGamma { 40 | int brightness = 0; 41 | int contrast = 0; 42 | int gamma = 0; 43 | }; 44 | 45 | BCGImageOperation(const BrightnessContrastGamma &bcg); 46 | ~BCGImageOperation() override; 47 | 48 | void redo() override; 49 | void undo() override; 50 | 51 | static void apply(QImage &img, const BrightnessContrastGamma &bcg); 52 | 53 | private: 54 | BCGImageOperationPrivate *const d; 55 | }; 56 | 57 | } // namespace 58 | 59 | #endif /*BCGIMAGEOPERATION_H */ 60 | -------------------------------------------------------------------------------- /lib/bcg/bcgtool.h: -------------------------------------------------------------------------------- 1 | /* 2 | Gwenview: an image viewer 3 | Copyright 2022 Ilya Pominov 4 | 5 | This program is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU General Public License 7 | as published by the Free Software Foundation; either version 2 8 | of the License, or (at your option) any later version. 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 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 18 | 19 | */ 20 | #ifndef BCGTOOL_H 21 | #define BCGTOOL_H 22 | 23 | #include 24 | 25 | // Qt 26 | 27 | // KF 28 | 29 | // Local 30 | #include 31 | 32 | namespace Gwenview 33 | { 34 | class AbstractImageOperation; 35 | 36 | struct BCGToolPrivate; 37 | class GWENVIEWLIB_EXPORT BCGTool : public AbstractRasterImageViewTool 38 | { 39 | Q_OBJECT 40 | public: 41 | BCGTool(RasterImageView *parent); 42 | ~BCGTool() override; 43 | 44 | void paint(QPainter *painter) override; 45 | void keyPressEvent(QKeyEvent *event) override; 46 | QWidget *widget() const override; 47 | 48 | Q_SIGNALS: 49 | void done(); 50 | void imageOperationRequested(AbstractImageOperation *); 51 | 52 | private Q_SLOTS: 53 | void slotBCGRequested(); 54 | 55 | private: 56 | BCGToolPrivate *const d; 57 | }; 58 | 59 | } // namespace 60 | 61 | #endif /* BCGTOOL_H */ 62 | -------------------------------------------------------------------------------- /lib/bcg/bcgwidget.h: -------------------------------------------------------------------------------- 1 | /* 2 | Gwenview: an image viewer 3 | Copyright 2022 Ilya Pominov 4 | 5 | This program is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU General Public License 7 | as published by the Free Software Foundation; either version 2 8 | of the License, or (at your option) any later version. 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 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 18 | 19 | */ 20 | #ifndef BCGWIDGET_H 21 | #define BCGWIDGET_H 22 | 23 | #include 24 | 25 | // Qt 26 | #include 27 | 28 | // KF 29 | 30 | // Local 31 | #include 32 | 33 | namespace Gwenview 34 | { 35 | struct BCGWidgetPrivate; 36 | class GWENVIEWLIB_EXPORT BCGWidget : public QWidget 37 | { 38 | Q_OBJECT 39 | public: 40 | BCGWidget(); 41 | ~BCGWidget() override; 42 | 43 | int brightness() const; 44 | int contrast() const; 45 | int gamma() const; 46 | 47 | Q_SIGNALS: 48 | void bcgChanged(); 49 | void reset(); 50 | void done(bool accept); 51 | 52 | private: 53 | BCGWidgetPrivate *const d; 54 | }; 55 | 56 | } // namespace 57 | 58 | #endif /* BCGWIDGET_H */ 59 | -------------------------------------------------------------------------------- /lib/bcg/imageutils.h: -------------------------------------------------------------------------------- 1 | /* 2 | Gwenview: an image viewer 3 | Copyright 2000-2004 Aurélien Gâteau 4 | Copyright 2022 Ilya Pominov 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; either version 2 9 | of the License, or (at your option) any later version. 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 | You should have received a copy of the GNU General Public License 17 | along with this program; if not, write to the Free Software 18 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 19 | 20 | */ 21 | #ifndef IMAGEUTILS_H 22 | #define IMAGEUTILS_H 23 | 24 | #include 25 | 26 | // Qt 27 | #include 28 | 29 | namespace Gwenview 30 | { 31 | namespace ImageUtils 32 | { 33 | QImage changeBrightness(const QImage &image, int brightness); 34 | QImage changeContrast(const QImage &image, int contrast); 35 | QImage changeGamma(const QImage &image, int gamma); 36 | } 37 | 38 | } 39 | #endif 40 | -------------------------------------------------------------------------------- /lib/binder.cpp: -------------------------------------------------------------------------------- 1 | // vim: set tabstop=4 shiftwidth=4 expandtab: 2 | /* 3 | Gwenview: an image viewer 4 | Copyright 2009 Aurélien Gâteau 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; either version 2 9 | of the License, or (at your option) any later version. 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 | You should have received a copy of the GNU General Public License 17 | along with this program; if not, write to the Free Software 18 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Cambridge, MA 02110-1301, USA. 19 | 20 | */ 21 | // Self 22 | #include 23 | 24 | namespace Gwenview 25 | { 26 | BinderInternal::BinderInternal(QObject *parent) 27 | : QObject(parent) 28 | { 29 | } 30 | 31 | BinderInternal::~BinderInternal() = default; 32 | 33 | } // namespace 34 | 35 | #include "moc_binder.cpp" 36 | -------------------------------------------------------------------------------- /lib/cms/.clang-format-ignore: -------------------------------------------------------------------------------- 1 | # Don't format the iccjpeg 3rd party code 2 | iccjpeg* 3 | -------------------------------------------------------------------------------- /lib/cms/cmsprofile_png.h: -------------------------------------------------------------------------------- 1 | // vim: set tabstop=4 shiftwidth=4 expandtab: 2 | /* 3 | Gwenview: an image viewer 4 | Copyright 2012 Aurélien Gâteau 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; either version 2 9 | of the License, or (at your option) any later version. 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 | You should have received a copy of the GNU General Public License 17 | along with this program; if not, write to the Free Software 18 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Cambridge, MA 02110-1301, USA. 19 | 20 | */ 21 | #ifndef CMSPROFILE_PNG_H 22 | #define CMSPROFILE_PNG_H 23 | 24 | // Local 25 | 26 | // KF 27 | 28 | // Qt 29 | #include 30 | 31 | using cmsHPROFILE = void *; 32 | 33 | namespace Gwenview 34 | { 35 | 36 | namespace Cms 37 | { 38 | 39 | /** 40 | * This code is in its own file because it cannot be compiled in the same .cpp 41 | * file as jpeg code: libpng complains about setjmp being included twice. 42 | */ 43 | 44 | cmsHPROFILE loadFromPngData(const QByteArray &data); 45 | 46 | } // namespace Cms 47 | } // namespace Gwenview 48 | 49 | #endif /* CMSPROFILE_PNG_H */ 50 | -------------------------------------------------------------------------------- /lib/crop/cropimageoperation.h: -------------------------------------------------------------------------------- 1 | // vim: set tabstop=4 shiftwidth=4 expandtab: 2 | /* 3 | Gwenview: an image viewer 4 | Copyright 2007 Aurélien Gâteau 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; either version 2 9 | of the License, or (at your option) any later version. 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 | You should have received a copy of the GNU General Public License 17 | along with this program; if not, write to the Free Software 18 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 19 | 20 | */ 21 | #ifndef CROPIMAGEOPERATION_H 22 | #define CROPIMAGEOPERATION_H 23 | 24 | #include 25 | 26 | // Qt 27 | 28 | // KF 29 | 30 | // Local 31 | #include 32 | 33 | class QRect; 34 | 35 | namespace Gwenview 36 | { 37 | struct CropImageOperationPrivate; 38 | class GWENVIEWLIB_EXPORT CropImageOperation : public AbstractImageOperation 39 | { 40 | Q_OBJECT 41 | public: 42 | CropImageOperation(const QRect &); 43 | ~CropImageOperation() override; 44 | 45 | void redo() override; 46 | void undo() override; 47 | 48 | private: 49 | CropImageOperationPrivate *const d; 50 | }; 51 | 52 | } // namespace 53 | 54 | #endif /* CROPIMAGEOPERATION_H */ 55 | -------------------------------------------------------------------------------- /lib/datewidget.h: -------------------------------------------------------------------------------- 1 | // vim: set tabstop=4 shiftwidth=4 expandtab: 2 | /* 3 | Gwenview: an image viewer 4 | Copyright 2008 Aurélien Gâteau 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; either version 2 9 | of the License, or (at your option) any later version. 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 | You should have received a copy of the GNU General Public License 17 | along with this program; if not, write to the Free Software 18 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Cambridge, MA 02110-1301, USA. 19 | 20 | */ 21 | #ifndef DATEWIDGET_H 22 | #define DATEWIDGET_H 23 | 24 | #include "gwenviewlib_export.h" 25 | 26 | // Qt 27 | #include 28 | 29 | // KF 30 | 31 | // Local 32 | 33 | class QDate; 34 | 35 | namespace Gwenview 36 | { 37 | struct DateWidgetPrivate; 38 | class GWENVIEWLIB_EXPORT DateWidget : public QWidget 39 | { 40 | Q_OBJECT 41 | public: 42 | explicit DateWidget(QWidget *parent = nullptr); 43 | ~DateWidget() override; 44 | 45 | QDate date() const; 46 | 47 | Q_SIGNALS: 48 | void dateChanged(const QDate &); 49 | 50 | private Q_SLOTS: 51 | void showDatePicker(); 52 | void slotDatePickerModified(const QDate &date); 53 | void goToPrevious(); 54 | void goToNext(); 55 | 56 | private: 57 | friend struct DateWidgetPrivate; 58 | DateWidgetPrivate *const d; 59 | }; 60 | 61 | } // namespace 62 | 63 | #endif /* DATEWIDGET_H */ 64 | -------------------------------------------------------------------------------- /lib/decoratedtag/decoratedtag.h: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: 2021 Noah Davis 2 | // SPDX-License-Identifier: LGPL-2.1-or-later 3 | 4 | #ifndef GWENVIEW_DECORATEDTAG_H 5 | #define GWENVIEW_DECORATEDTAG_H 6 | 7 | #include 8 | #include 9 | 10 | namespace Gwenview 11 | { 12 | class DecoratedTagPrivate; 13 | 14 | /** 15 | * A label with a custom background under it. 16 | * 17 | * TODO: Turn this into a more interactive control and make it look like Manuel's mockup. 18 | * Should probably be turned into a QAbstractButton subclass or something. 19 | */ 20 | class GWENVIEWLIB_EXPORT DecoratedTag : public QLabel 21 | { 22 | Q_OBJECT 23 | public: 24 | explicit DecoratedTag(QWidget *parent = nullptr, Qt::WindowFlags f = Qt::WindowFlags()); 25 | explicit DecoratedTag(const QString &text, QWidget *parent = nullptr, Qt::WindowFlags f = Qt::WindowFlags()); 26 | ~DecoratedTag() override; 27 | 28 | protected: 29 | void changeEvent(QEvent *event) override; 30 | void paintEvent(QPaintEvent *event) override; 31 | 32 | private: 33 | const std::unique_ptr d_ptr; 34 | Q_DECLARE_PRIVATE(DecoratedTag) 35 | }; 36 | 37 | } 38 | 39 | #endif // GWENVIEW_DECORATEDTAG_H 40 | -------------------------------------------------------------------------------- /lib/dialogguard.h: -------------------------------------------------------------------------------- 1 | /* 2 | Gwenview: an image viewer 3 | Copyright 2018 Anthony Fieroni 4 | 5 | This program is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU General Public License 7 | as published by the Free Software Foundation; either version 2 8 | of the License, or (at your option) any later version. 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 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Cambridge, MA 02110-1301, USA. 18 | 19 | */ 20 | #ifndef DIALOGGUARD_H 21 | #define DIALOGGUARD_H 22 | 23 | // std 24 | #include 25 | 26 | // Qt 27 | #include 28 | 29 | template 30 | class DialogGuard 31 | { 32 | QPointer m_dialog; 33 | 34 | public: 35 | template 36 | DialogGuard(Args &&...args) 37 | { 38 | m_dialog = new T(std::forward(args)...); 39 | } 40 | 41 | ~DialogGuard() 42 | { 43 | delete m_dialog; 44 | } 45 | 46 | T *data() const 47 | { 48 | return m_dialog.data(); 49 | } 50 | 51 | T *operator->() const 52 | { 53 | return m_dialog.data(); 54 | } 55 | 56 | operator bool() const 57 | { 58 | return !m_dialog.isNull(); 59 | } 60 | }; 61 | 62 | #endif // DIALOGGUARD_H 63 | -------------------------------------------------------------------------------- /lib/document/emptydocumentimpl.cpp: -------------------------------------------------------------------------------- 1 | // vim: set tabstop=4 shiftwidth=4 expandtab: 2 | /* 3 | Gwenview: an image viewer 4 | Copyright 2007 Aurélien Gâteau 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; either version 2 9 | of the License, or (at your option) any later version. 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 | You should have received a copy of the GNU General Public License 17 | along with this program; if not, write to the Free Software 18 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 19 | 20 | */ 21 | // Self 22 | #include "emptydocumentimpl.h" 23 | 24 | // Qt 25 | 26 | // KF 27 | 28 | // Local 29 | 30 | namespace Gwenview 31 | { 32 | EmptyDocumentImpl::EmptyDocumentImpl(Document *document) 33 | : AbstractDocumentImpl(document) 34 | { 35 | } 36 | 37 | EmptyDocumentImpl::~EmptyDocumentImpl() = default; 38 | 39 | void EmptyDocumentImpl::init() 40 | { 41 | } 42 | 43 | Document::LoadingState EmptyDocumentImpl::loadingState() const 44 | { 45 | return Document::LoadingFailed; 46 | } 47 | 48 | } // namespace 49 | -------------------------------------------------------------------------------- /lib/document/emptydocumentimpl.h: -------------------------------------------------------------------------------- 1 | // vim: set tabstop=4 shiftwidth=4 expandtab: 2 | /* 3 | Gwenview: an image viewer 4 | Copyright 2007 Aurélien Gâteau 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; either version 2 9 | of the License, or (at your option) any later version. 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 | You should have received a copy of the GNU General Public License 17 | along with this program; if not, write to the Free Software 18 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 19 | 20 | */ 21 | #ifndef EMPTYDOCUMENTIMPL_H 22 | #define EMPTYDOCUMENTIMPL_H 23 | 24 | // Qt 25 | 26 | // KF 27 | 28 | // Local 29 | #include 30 | 31 | namespace Gwenview 32 | { 33 | class EmptyDocumentImpl : public AbstractDocumentImpl 34 | { 35 | public: 36 | EmptyDocumentImpl(Document *); 37 | ~EmptyDocumentImpl() override; 38 | 39 | void init() override; 40 | Document::LoadingState loadingState() const override; 41 | }; 42 | 43 | } // namespace 44 | 45 | #endif /* EMPTYDOCUMENTIMPL_H */ 46 | -------------------------------------------------------------------------------- /lib/document/jpegdocumentloadedimpl.h: -------------------------------------------------------------------------------- 1 | // vim: set tabstop=4 shiftwidth=4 expandtab: 2 | /* 3 | Gwenview: an image viewer 4 | Copyright 2007 Aurélien Gâteau 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; either version 2 9 | of the License, or (at your option) any later version. 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 | You should have received a copy of the GNU General Public License 17 | along with this program; if not, write to the Free Software 18 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 19 | 20 | */ 21 | #ifndef JPEGDOCUMENTLOADEDIMPL_H 22 | #define JPEGDOCUMENTLOADEDIMPL_H 23 | 24 | // Qt 25 | 26 | // KF 27 | 28 | // Local 29 | #include 30 | 31 | class QByteArray; 32 | 33 | namespace Gwenview 34 | { 35 | class JpegContent; 36 | 37 | struct JpegDocumentLoadedImplPrivate; 38 | class JpegDocumentLoadedImpl : public DocumentLoadedImpl 39 | { 40 | Q_OBJECT 41 | public: 42 | JpegDocumentLoadedImpl(Document *, JpegContent *); 43 | ~JpegDocumentLoadedImpl() override; 44 | QByteArray rawData() const override; 45 | 46 | protected: 47 | bool saveInternal(QIODevice *device, const QByteArray &format) override; 48 | 49 | // AbstractDocumentEditor 50 | void setImage(const QImage &) override; 51 | void applyTransformation(Orientation orientation) override; 52 | // 53 | 54 | private: 55 | JpegDocumentLoadedImplPrivate *const d; 56 | }; 57 | 58 | } // namespace 59 | 60 | #endif /* JPEGDOCUMENTLOADEDIMPL_H */ 61 | -------------------------------------------------------------------------------- /lib/document/loadingjob.h: -------------------------------------------------------------------------------- 1 | // vim: set tabstop=4 shiftwidth=4 expandtab: 2 | /* 3 | Gwenview: an image viewer 4 | Copyright 2010 Aurélien Gâteau 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; either version 2 9 | of the License, or (at your option) any later version. 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 | You should have received a copy of the GNU General Public License 17 | along with this program; if not, write to the Free Software 18 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Cambridge, MA 02110-1301, USA. 19 | 20 | */ 21 | #ifndef LOADINGJOB_H 22 | #define LOADINGJOB_H 23 | 24 | // Qt 25 | 26 | // KF 27 | 28 | // Local 29 | #include 30 | 31 | namespace Gwenview 32 | { 33 | class LoadingJob : public DocumentJob 34 | { 35 | Q_OBJECT 36 | protected: 37 | void doStart() override; 38 | 39 | private Q_SLOTS: 40 | void slotLoaded(); 41 | void slotLoadingFailed(); 42 | }; 43 | 44 | } // namespace 45 | 46 | #endif /* LOADINGJOB_H */ 47 | -------------------------------------------------------------------------------- /lib/document/savejob.h: -------------------------------------------------------------------------------- 1 | // vim: set tabstop=4 shiftwidth=4 expandtab: 2 | /* 3 | Gwenview: an image viewer 4 | Copyright 2010 Aurélien Gâteau 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; either version 2 9 | of the License, or (at your option) any later version. 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 | You should have received a copy of the GNU General Public License 17 | along with this program; if not, write to the Free Software 18 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Cambridge, MA 02110-1301, USA. 19 | 20 | */ 21 | #ifndef SAVEJOB_H 22 | #define SAVEJOB_H 23 | 24 | #include 25 | 26 | // Qt 27 | 28 | // KF 29 | 30 | // Local 31 | #include 32 | 33 | class QByteArray; 34 | class QUrl; 35 | 36 | namespace Gwenview 37 | { 38 | class DocumentLoadedImpl; 39 | 40 | struct SaveJobPrivate; 41 | class GWENVIEWLIB_EXPORT SaveJob : public DocumentJob 42 | { 43 | Q_OBJECT 44 | public: 45 | SaveJob(DocumentLoadedImpl *impl, const QUrl &url, const QByteArray &format); 46 | ~SaveJob() override; 47 | void saveInternal(); 48 | 49 | QUrl oldUrl() const; 50 | QUrl newUrl() const; 51 | 52 | protected Q_SLOTS: 53 | void doStart() override; 54 | void slotResult(KJob *) override; 55 | 56 | protected: 57 | bool doKill() override; 58 | 59 | private Q_SLOTS: 60 | void finishSave(); 61 | 62 | private: 63 | SaveJobPrivate *const d; 64 | }; 65 | 66 | } // namespace 67 | 68 | #endif /* SAVEJOB_H */ 69 | -------------------------------------------------------------------------------- /lib/document/svgdocumentloadedimpl.h: -------------------------------------------------------------------------------- 1 | // vim: set tabstop=4 shiftwidth=4 expandtab: 2 | /* 3 | Gwenview: an image viewer 4 | Copyright 2008 Aurélien Gâteau 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; either version 2 9 | of the License, or (at your option) any later version. 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 | You should have received a copy of the GNU General Public License 17 | along with this program; if not, write to the Free Software 18 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Cambridge, MA 02110-1301, USA. 19 | 20 | */ 21 | #ifndef SVGDOCUMENTLOADEDIMPL_H 22 | #define SVGDOCUMENTLOADEDIMPL_H 23 | 24 | // Qt 25 | 26 | // KF 27 | 28 | // Local 29 | #include 30 | 31 | namespace Gwenview 32 | { 33 | struct SvgDocumentLoadedImplPrivate; 34 | class SvgDocumentLoadedImpl : public AbstractDocumentImpl 35 | { 36 | Q_OBJECT 37 | public: 38 | SvgDocumentLoadedImpl(Document *, const QByteArray &); 39 | ~SvgDocumentLoadedImpl() override; 40 | 41 | void init() override; 42 | 43 | Document::LoadingState loadingState() const override; 44 | 45 | virtual void setImage(const QImage &); 46 | 47 | QByteArray rawData() const override; 48 | 49 | QSvgRenderer *svgRenderer() const override; 50 | 51 | private: 52 | SvgDocumentLoadedImplPrivate *const d; 53 | }; 54 | 55 | } // namespace 56 | 57 | #endif /* SVGDOCUMENTLOADEDIMPL_H */ 58 | -------------------------------------------------------------------------------- /lib/document/videodocumentloadedimpl.cpp: -------------------------------------------------------------------------------- 1 | // vim: set tabstop=4 shiftwidth=4 expandtab: 2 | /* 3 | Gwenview: an image viewer 4 | Copyright 2009 Aurélien Gâteau 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; either version 2 9 | of the License, or (at your option) any later version. 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 | You should have received a copy of the GNU General Public License 17 | along with this program; if not, write to the Free Software 18 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Cambridge, MA 02110-1301, USA. 19 | 20 | */ 21 | // Self 22 | #include "videodocumentloadedimpl.h" 23 | 24 | // Qt 25 | 26 | // KF 27 | 28 | // Local 29 | #include "gwenview_lib_debug.h" 30 | 31 | namespace Gwenview 32 | { 33 | struct VideoDocumentLoadedImplPrivate { 34 | }; 35 | 36 | VideoDocumentLoadedImpl::VideoDocumentLoadedImpl(Document *document) 37 | : AbstractDocumentImpl(document) 38 | , d(new VideoDocumentLoadedImplPrivate) 39 | { 40 | } 41 | 42 | VideoDocumentLoadedImpl::~VideoDocumentLoadedImpl() 43 | { 44 | delete d; 45 | } 46 | 47 | void VideoDocumentLoadedImpl::init() 48 | { 49 | Q_EMIT loaded(); 50 | } 51 | 52 | Document::LoadingState VideoDocumentLoadedImpl::loadingState() const 53 | { 54 | return Document::Loaded; 55 | } 56 | 57 | void VideoDocumentLoadedImpl::setImage(const QImage &) 58 | { 59 | qCWarning(GWENVIEW_LIB_LOG) << "Should not be called"; 60 | } 61 | 62 | } // namespace 63 | 64 | #include "moc_videodocumentloadedimpl.cpp" 65 | -------------------------------------------------------------------------------- /lib/document/videodocumentloadedimpl.h: -------------------------------------------------------------------------------- 1 | // vim: set tabstop=4 shiftwidth=4 expandtab: 2 | /* 3 | Gwenview: an image viewer 4 | Copyright 2009 Aurélien Gâteau 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; either version 2 9 | of the License, or (at your option) any later version. 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 | You should have received a copy of the GNU General Public License 17 | along with this program; if not, write to the Free Software 18 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Cambridge, MA 02110-1301, USA. 19 | 20 | */ 21 | #ifndef VIDEODOCUMENTLOADEDIMPL_H 22 | #define VIDEODOCUMENTLOADEDIMPL_H 23 | 24 | // Qt 25 | 26 | // KF 27 | 28 | // Local 29 | #include 30 | 31 | namespace Gwenview 32 | { 33 | struct VideoDocumentLoadedImplPrivate; 34 | class VideoDocumentLoadedImpl : public AbstractDocumentImpl 35 | { 36 | Q_OBJECT 37 | public: 38 | VideoDocumentLoadedImpl(Document *); 39 | ~VideoDocumentLoadedImpl() override; 40 | 41 | void init() override; 42 | 43 | Document::LoadingState loadingState() const override; 44 | 45 | virtual void setImage(const QImage &); 46 | 47 | private: 48 | VideoDocumentLoadedImplPrivate *const d; 49 | }; 50 | 51 | } // namespace 52 | 53 | #endif /* VIDEODOCUMENTLOADEDIMPL_H */ 54 | -------------------------------------------------------------------------------- /lib/documentonlyproxymodel.cpp: -------------------------------------------------------------------------------- 1 | // vim: set tabstop=4 shiftwidth=4 expandtab: 2 | /* 3 | Gwenview: an image viewer 4 | Copyright 2013 Aurélien Gâteau 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; either version 2 9 | of the License, or (at your option) any later version. 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 | You should have received a copy of the GNU General Public License 17 | along with this program; if not, write to the Free Software 18 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Cambridge, MA 02110-1301, USA. 19 | 20 | */ 21 | // Self 22 | #include 23 | 24 | // Local 25 | #include 26 | 27 | // KF 28 | #include 29 | 30 | // Qt 31 | 32 | namespace Gwenview 33 | { 34 | struct DocumentOnlyProxyModelPrivate { 35 | }; 36 | 37 | DocumentOnlyProxyModel::DocumentOnlyProxyModel(QObject *parent) 38 | : QSortFilterProxyModel(parent) 39 | , d(new DocumentOnlyProxyModelPrivate) 40 | { 41 | setDynamicSortFilter(true); 42 | } 43 | 44 | DocumentOnlyProxyModel::~DocumentOnlyProxyModel() 45 | { 46 | delete d; 47 | } 48 | 49 | bool DocumentOnlyProxyModel::filterAcceptsRow(int row, const QModelIndex &parent) const 50 | { 51 | const QModelIndex index = sourceModel()->index(row, 0, parent); 52 | const KFileItem fileItem = index.data(KDirModel::FileItemRole).value(); 53 | return !ArchiveUtils::fileItemIsDirOrArchive(fileItem); 54 | } 55 | 56 | } // namespace 57 | 58 | #include "moc_documentonlyproxymodel.cpp" 59 | -------------------------------------------------------------------------------- /lib/documentonlyproxymodel.h: -------------------------------------------------------------------------------- 1 | // vim: set tabstop=4 shiftwidth=4 expandtab: 2 | /* 3 | Gwenview: an image viewer 4 | Copyright 2013 Aurélien Gâteau 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; either version 2 9 | of the License, or (at your option) any later version. 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 | You should have received a copy of the GNU General Public License 17 | along with this program; if not, write to the Free Software 18 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Cambridge, MA 02110-1301, USA. 19 | 20 | */ 21 | #ifndef DOCUMENTONLYPROXYMODEL_H 22 | #define DOCUMENTONLYPROXYMODEL_H 23 | 24 | // Local 25 | #include 26 | 27 | // KF 28 | 29 | // Qt 30 | #include 31 | 32 | namespace Gwenview 33 | { 34 | struct DocumentOnlyProxyModelPrivate; 35 | /** 36 | * A proxy model which lists items which are neither dirs nor archives. 37 | * Only works with models which expose a KDirModel::FileItemRole. 38 | */ 39 | class GWENVIEWLIB_EXPORT DocumentOnlyProxyModel : public QSortFilterProxyModel 40 | { 41 | Q_OBJECT 42 | public: 43 | explicit DocumentOnlyProxyModel(QObject *parent = nullptr); 44 | ~DocumentOnlyProxyModel() override; 45 | 46 | protected: 47 | bool filterAcceptsRow(int row, const QModelIndex &parent) const override; 48 | 49 | private: 50 | DocumentOnlyProxyModelPrivate *const d; 51 | }; 52 | 53 | } // namespace 54 | 55 | #endif /* DOCUMENTONLYPROXYMODEL_H */ 56 | -------------------------------------------------------------------------------- /lib/documentview/alphabackgrounditem.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: 2021 Arjen Hiemstra 3 | * 4 | * SPDX-License-Identifier: LGPL-2.1-or-later 5 | */ 6 | 7 | #ifndef BACKGROUNDITEM_H 8 | #define BACKGROUNDITEM_H 9 | 10 | #include 11 | 12 | #include 13 | 14 | #include "abstractimageview.h" 15 | 16 | namespace Gwenview 17 | { 18 | /** 19 | * A QGraphicsItem subclass that draws the appropriate background for alpha images. 20 | */ 21 | class GWENVIEWLIB_EXPORT AlphaBackgroundItem : public QGraphicsItem 22 | { 23 | public: 24 | AlphaBackgroundItem(AbstractImageView *parent); 25 | ~AlphaBackgroundItem() override; 26 | 27 | AbstractImageView::AlphaBackgroundMode mode() const; 28 | void setMode(AbstractImageView::AlphaBackgroundMode mode); 29 | 30 | QColor color(); 31 | void setColor(const QColor &color); 32 | 33 | void paint(QPainter *painter, const QStyleOptionGraphicsItem * /*option*/, QWidget * /*widget*/) override; 34 | 35 | QRectF boundingRect() const override; 36 | 37 | private: 38 | void createCheckBoardTexture(); 39 | 40 | AbstractImageView *mParent; 41 | AbstractImageView::AlphaBackgroundMode mMode = AbstractImageView::AlphaBackgroundCheckBoard; 42 | QColor mColor = Qt::black; 43 | 44 | // This pixmap will be used to fill the background when mMode is 45 | // AlphaBackgroundCheckBoard. 46 | std::unique_ptr mCheckBoardTexture; 47 | }; 48 | 49 | } 50 | 51 | #endif // BACKGROUNDITEM_H 52 | -------------------------------------------------------------------------------- /lib/documentview/loadingindicator.h: -------------------------------------------------------------------------------- 1 | // vim: set tabstop=4 shiftwidth=4 expandtab: 2 | /* 3 | Gwenview: an image viewer 4 | Copyright 2011 Aurélien Gâteau 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; either version 2 9 | of the License, or (at your option) any later version. 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 | You should have received a copy of the GNU General Public License 17 | along with this program; if not, write to the Free Software 18 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Cambridge, MA 02110-1301, USA. 19 | 20 | */ 21 | #ifndef LOADINGINDICATOR_H 22 | #define LOADINGINDICATOR_H 23 | 24 | // Local 25 | 26 | // KF 27 | 28 | // Qt 29 | #include 30 | 31 | namespace Gwenview 32 | { 33 | struct LoadingIndicatorPrivate; 34 | /** 35 | * A graphics widget which shows a spinner 36 | */ 37 | class LoadingIndicator : public QGraphicsWidget 38 | { 39 | Q_OBJECT 40 | public: 41 | explicit LoadingIndicator(QGraphicsItem *parent = nullptr); 42 | ~LoadingIndicator() override; 43 | 44 | void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = nullptr) override; 45 | 46 | QRectF boundingRect() const override; 47 | 48 | private Q_SLOTS: 49 | void showNextFrame(); 50 | 51 | protected: 52 | QVariant itemChange(GraphicsItemChange change, const QVariant &value) override; 53 | 54 | private: 55 | LoadingIndicatorPrivate *const d; 56 | }; 57 | 58 | } // namespace 59 | 60 | #endif /* LOADINGINDICATOR_H */ 61 | -------------------------------------------------------------------------------- /lib/eventwatcher.h: -------------------------------------------------------------------------------- 1 | /* 2 | Gwenview: an image viewer 3 | Copyright 2009 Aurélien Gâteau 4 | 5 | This program is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU General Public License 7 | as published by the Free Software Foundation; either version 2 8 | of the License, or (at your option) any later version. 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 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 18 | 19 | */ 20 | #ifndef EVENTWATCHER_H 21 | #define EVENTWATCHER_H 22 | 23 | // Qt 24 | #include 25 | #include 26 | #include 27 | 28 | // Local 29 | #include "gwenviewlib_export.h" 30 | 31 | namespace Gwenview 32 | { 33 | /** 34 | * This class emits a signal when some events are triggered on a watched 35 | * object. 36 | */ 37 | class GWENVIEWLIB_EXPORT EventWatcher : public QObject 38 | { 39 | Q_OBJECT 40 | public: 41 | EventWatcher(QObject *watched, const QList &eventTypes); 42 | 43 | static EventWatcher *install(QObject *watched, const QList &eventTypes, QObject *receiver, const char *slot); 44 | 45 | static EventWatcher *install(QObject *watched, QEvent::Type eventType, QObject *receiver, const char *slot); 46 | 47 | Q_SIGNALS: 48 | void eventTriggered(QEvent *); 49 | 50 | protected: 51 | bool eventFilter(QObject *, QEvent *event) override; 52 | 53 | private: 54 | QList mEventTypes; 55 | }; 56 | 57 | } 58 | 59 | #endif /* EVENTWATCHER_H */ 60 | -------------------------------------------------------------------------------- /lib/exiv2imageloader.h: -------------------------------------------------------------------------------- 1 | // vim: set tabstop=4 shiftwidth=4 expandtab: 2 | /* 3 | Gwenview: an image viewer 4 | Copyright 2007 Aurélien Gâteau 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; either version 2 9 | of the License, or (at your option) any later version. 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 | You should have received a copy of the GNU General Public License 17 | along with this program; if not, write to the Free Software 18 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 19 | 20 | */ 21 | #ifndef EXIV2IMAGELOADER_H 22 | #define EXIV2IMAGELOADER_H 23 | 24 | #include 25 | 26 | // STL 27 | #include 28 | 29 | // Qt 30 | 31 | // KF 32 | 33 | // Exiv2 34 | namespace Exiv2 35 | { 36 | class Image; 37 | } 38 | 39 | // Local 40 | 41 | class QByteArray; 42 | class QString; 43 | 44 | namespace Gwenview 45 | { 46 | struct Exiv2ImageLoaderPrivate; 47 | 48 | /** 49 | * This helper class loads image using libexiv2, and takes care of exception 50 | * handling for the different versions of libexiv2. 51 | */ 52 | class GWENVIEWLIB_EXPORT Exiv2ImageLoader 53 | { 54 | public: 55 | Exiv2ImageLoader(); 56 | ~Exiv2ImageLoader(); 57 | 58 | bool load(const QString &); 59 | bool load(const QByteArray &); 60 | QString errorMessage() const; 61 | std::unique_ptr popImage(); 62 | 63 | private: 64 | Exiv2ImageLoaderPrivate *const d; 65 | }; 66 | 67 | } // namespace 68 | 69 | #endif /* EXIV2IMAGELOADER_H */ 70 | -------------------------------------------------------------------------------- /lib/fullscreenbackground.h: -------------------------------------------------------------------------------- 1 | // vim: set tabstop=4 shiftwidth=4 expandtab: 2 | /* 3 | Gwenview: an image viewer 4 | Copyright 2021 Antonio Prcela 5 | 6 | This program is free software; you can redistribute it and/or modify it 7 | under the terms of the GNU General Public License as published by the 8 | Free Software Foundation; either version 2 of the License, or (at your 9 | option) any later version. 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 | You should have received a copy of the GNU General Public License along 17 | with this program; if not, write to the Free Software Foundation, Inc., 18 | 51 Franklin Street, Fifth Floor, Cambridge, MA 02110-1301, USA. 19 | 20 | */ 21 | #ifndef FULLSCREENBACKGROUND_H 22 | #define FULLSCREENBACKGROUND_H 23 | 24 | // Qt 25 | 26 | // KF 27 | 28 | // Local 29 | 30 | namespace Gwenview 31 | { 32 | namespace FullScreenBackground 33 | { 34 | /** 35 | * This enum represents the different background types in fullscreen mode 36 | */ 37 | enum Enum { 38 | Black, 39 | Image, 40 | }; 41 | 42 | } // namespace FullScreenBackground 43 | 44 | } // namespace Gwenview 45 | 46 | #endif /* FULLSCREENBACKGROUND_H */ 47 | -------------------------------------------------------------------------------- /lib/gwenviewconfig.kcfgc: -------------------------------------------------------------------------------- 1 | File=gwenviewconfig.kcfg 2 | ClassName=GwenviewConfig 3 | NameSpace=Gwenview 4 | Singleton=true 5 | Mutators=true 6 | UseEnumTypes=true 7 | IncludeFiles=lib/gwenviewlib_export.h 8 | Visibility=GWENVIEWLIB_EXPORT 9 | -------------------------------------------------------------------------------- /lib/hud/hudbuttonbox.h: -------------------------------------------------------------------------------- 1 | // vim: set tabstop=4 shiftwidth=4 expandtab: 2 | /* 3 | Gwenview: an image viewer 4 | Copyright 2014 Aurélien Gâteau 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; either version 2 9 | of the License, or (at your option) any later version. 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 | You should have received a copy of the GNU General Public License 17 | along with this program. If not, see . 18 | */ 19 | #ifndef HUDBUTTONBOX_H 20 | #define HUDBUTTONBOX_H 21 | 22 | #include 23 | 24 | // Local 25 | #include 26 | 27 | // KF 28 | 29 | // Qt 30 | 31 | class QAction; 32 | class QGraphicsWidget; 33 | 34 | namespace Gwenview 35 | { 36 | class HudButton; 37 | 38 | struct HudButtonBoxPrivate; 39 | /** 40 | * A hud widget which shows a list of buttons 41 | */ 42 | class GWENVIEWLIB_EXPORT HudButtonBox : public HudWidget 43 | { 44 | Q_OBJECT 45 | public: 46 | HudButtonBox(QGraphicsWidget *parent = nullptr); 47 | ~HudButtonBox() override; 48 | 49 | void setText(const QString &text); 50 | 51 | HudButton *addButton(const QString &text); 52 | 53 | HudButton *addAction(QAction *action, const QString &overrideText = QString()); 54 | 55 | void addCountDown(qreal ms); 56 | 57 | protected: 58 | void showEvent(QShowEvent *event) override; 59 | 60 | private: 61 | HudButtonBoxPrivate *const d; 62 | }; 63 | 64 | } // namespace 65 | 66 | #endif /* HUDBUTTONBOX_H */ 67 | -------------------------------------------------------------------------------- /lib/hud/hudcountdown.h: -------------------------------------------------------------------------------- 1 | // vim: set tabstop=4 shiftwidth=4 expandtab: 2 | /* 3 | Gwenview: an image viewer 4 | Copyright 2014 Aurélien Gâteau 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; either version 2 9 | of the License, or (at your option) any later version. 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 | You should have received a copy of the GNU General Public License 17 | along with this program. If not, see . 18 | */ 19 | #ifndef HUDCOUNTDOWN_H 20 | #define HUDCOUNTDOWN_H 21 | 22 | // Local 23 | 24 | // KF 25 | 26 | // Qt 27 | #include 28 | 29 | namespace Gwenview 30 | { 31 | struct HudCountDownPrivate; 32 | 33 | /** 34 | * Displays a count-down pie-chart 35 | */ 36 | class HudCountDown : public QGraphicsWidget 37 | { 38 | Q_OBJECT 39 | public: 40 | explicit HudCountDown(QGraphicsWidget *parent = nullptr); 41 | ~HudCountDown() override; 42 | 43 | void start(qreal ms); 44 | 45 | void paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *) override; 46 | 47 | Q_SIGNALS: 48 | void timeout(); 49 | 50 | private Q_SLOTS: 51 | void doUpdate(); 52 | 53 | private: 54 | HudCountDownPrivate *const d; 55 | }; 56 | 57 | } // namespace 58 | 59 | #endif /* HUDCOUNTDOWN_H */ 60 | -------------------------------------------------------------------------------- /lib/hud/hudlabel.h: -------------------------------------------------------------------------------- 1 | // vim: set tabstop=4 shiftwidth=4 expandtab: 2 | /* 3 | Gwenview: an image viewer 4 | Copyright 2011 Aurélien Gâteau 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; either version 2 9 | of the License, or (at your option) any later version. 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 | You should have received a copy of the GNU General Public License 17 | along with this program; if not, write to the Free Software 18 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Cambridge, MA 02110-1301, USA. 19 | 20 | */ 21 | #ifndef HUDLABEL_H 22 | #define HUDLABEL_H 23 | 24 | #include 25 | 26 | // Local 27 | 28 | // KF 29 | 30 | // Qt 31 | #include 32 | 33 | namespace Gwenview 34 | { 35 | struct HudLabelPrivate; 36 | /** 37 | * 38 | */ 39 | class GWENVIEWLIB_EXPORT HudLabel : public QGraphicsWidget 40 | { 41 | Q_OBJECT 42 | public: 43 | explicit HudLabel(QGraphicsItem *parent = nullptr); 44 | ~HudLabel() override; 45 | 46 | void setText(const QString &); 47 | 48 | void paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *) override; 49 | 50 | private: 51 | HudLabelPrivate *const d; 52 | }; 53 | 54 | } // namespace 55 | 56 | #endif /* HUDLABEL_H */ 57 | -------------------------------------------------------------------------------- /lib/hud/hudmessagebubble.h: -------------------------------------------------------------------------------- 1 | // vim: set tabstop=4 shiftwidth=4 expandtab: 2 | /* 3 | Gwenview: an image viewer 4 | Copyright 2009 Aurélien Gâteau 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; either version 2 9 | of the License, or (at your option) any later version. 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 | You should have received a copy of the GNU General Public License 17 | along with this program; if not, write to the Free Software 18 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Cambridge, MA 02110-1301, USA. 19 | 20 | */ 21 | #ifndef HUDMESSAGEBUBBLE_H 22 | #define HUDMESSAGEBUBBLE_H 23 | 24 | #include 25 | 26 | // Qt 27 | 28 | // KF 29 | 30 | // Local 31 | #include 32 | 33 | class KGuiItem; 34 | 35 | namespace Gwenview 36 | { 37 | class HudButton; 38 | 39 | struct HudMessageBubblePrivate; 40 | /** 41 | * Shows a bubble with a QLabel and optional buttons. 42 | * Automatically goes away after a while. 43 | */ 44 | class GWENVIEWLIB_EXPORT HudMessageBubble : public HudWidget 45 | { 46 | Q_OBJECT 47 | public: 48 | explicit HudMessageBubble(QGraphicsWidget *parent = nullptr); 49 | ~HudMessageBubble() override; 50 | 51 | void setText(const QString &text); 52 | 53 | HudButton *addButton(const KGuiItem &); 54 | 55 | private: 56 | HudMessageBubblePrivate *const d; 57 | }; 58 | 59 | } // namespace 60 | 61 | #endif /* HUDMESSAGEBUBBLE_H */ 62 | -------------------------------------------------------------------------------- /lib/hud/hudtheme.h: -------------------------------------------------------------------------------- 1 | // vim: set tabstop=4 shiftwidth=4 expandtab: 2 | /* 3 | Gwenview: an image viewer 4 | Copyright 2008 Aurélien Gâteau 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; either version 2 9 | of the License, or (at your option) any later version. 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 | You should have received a copy of the GNU General Public License 17 | along with this program; if not, write to the Free Software 18 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Cambridge, MA 02110-1301, USA. 19 | 20 | */ 21 | #ifndef HUDTHEME_H 22 | #define HUDTHEME_H 23 | 24 | #include 25 | 26 | // Qt 27 | #include 28 | #include 29 | 30 | // KF 31 | 32 | // Local 33 | 34 | namespace Gwenview 35 | { 36 | namespace HudTheme 37 | { 38 | struct RenderInfo { 39 | RenderInfo() 40 | : borderRadius(0) 41 | , padding(0) 42 | { 43 | } 44 | qreal borderRadius; 45 | QPen borderPen; 46 | QBrush bgBrush; 47 | qreal padding; 48 | QPen textPen; 49 | }; 50 | 51 | enum State { 52 | NormalState, 53 | MouseOverState, 54 | DownState, 55 | }; 56 | 57 | enum WidgetType { 58 | ButtonWidget, 59 | FrameWidget, 60 | CountDown, 61 | SliderWidgetHandle, 62 | SliderWidgetGroove, 63 | }; 64 | 65 | GWENVIEWLIB_EXPORT RenderInfo renderInfo(WidgetType, State = NormalState); 66 | 67 | } // HudTheme namespace 68 | 69 | } // Gwenview namespace 70 | 71 | #endif /* HUDTHEME_H */ 72 | -------------------------------------------------------------------------------- /lib/imageformats/fitshandler.h: -------------------------------------------------------------------------------- 1 | // vim: set tabstop=4 shiftwidth=4 expandtab: 2 | /* 3 | Gwenview: an image viewer 4 | Copyright 2008 Aurélien Gâteau 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; either version 2 9 | of the License, or (at your option) any later version. 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 | You should have received a copy of the GNU General Public License 17 | along with this program; if not, write to the Free Software 18 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Cambridge, MA 02110-1301, USA. 19 | 20 | */ 21 | 22 | #pragma once 23 | 24 | #include 25 | 26 | namespace Gwenview 27 | { 28 | /** 29 | * A FITS handler. 30 | */ 31 | class FitsHandler : public QImageIOHandler 32 | { 33 | public: 34 | bool canRead() const override; 35 | bool read(QImage *image) override; 36 | 37 | bool supportsOption(ImageOption option) const override; 38 | QVariant option(ImageOption option) const override; 39 | }; 40 | 41 | } // namespace 42 | -------------------------------------------------------------------------------- /lib/imageformats/fitsplugin.h: -------------------------------------------------------------------------------- 1 | // vim: set tabstop=4 shiftwidth=4 expandtab: 2 | /* 3 | Gwenview: an image viewer 4 | Copyright 2008 Aurélien Gâteau 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; either version 2 9 | of the License, or (at your option) any later version. 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 | You should have received a copy of the GNU General Public License 17 | along with this program; if not, write to the Free Software 18 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Cambridge, MA 02110-1301, USA. 19 | 20 | */ 21 | 22 | #pragma once 23 | 24 | #define QT_STATICPLUGIN 25 | 26 | #include 27 | #include 28 | 29 | class QImageIOHandler; 30 | class QIODevice; 31 | 32 | extern const QStaticPlugin qt_static_plugin_FitsPlugin(); 33 | 34 | class Q_CORE_EXPORT FitsPlugin : public QImageIOPlugin 35 | { 36 | Q_OBJECT 37 | Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QImageIOHandlerFactoryInterface" FILE "fitsplugin.json") 38 | 39 | public: 40 | ~FitsPlugin() override 41 | { 42 | } 43 | 44 | Capabilities capabilities(QIODevice *device, const QByteArray &format) const override; 45 | QImageIOHandler *create(QIODevice *device, const QByteArray &format = QByteArray()) const override; 46 | }; 47 | -------------------------------------------------------------------------------- /lib/imageformats/fitsplugin.json: -------------------------------------------------------------------------------- 1 | { 2 | "Keys": [ "fits", "fit", "fts" ], 3 | "MimeTypes": [ "image/fits", "image/fits", "image/fits" ] 4 | } 5 | -------------------------------------------------------------------------------- /lib/imageutils.h: -------------------------------------------------------------------------------- 1 | // vim: set tabstop=4 shiftwidth=4 expandtab: 2 | /* 3 | Gwenview: an image viewer 4 | Copyright 2007 Aurélien Gâteau 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; either version 2 9 | of the License, or (at your option) any later version. 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 | You should have received a copy of the GNU General Public License 17 | along with this program; if not, write to the Free Software 18 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 19 | 20 | */ 21 | #ifndef IMAGEUTILS_H 22 | #define IMAGEUTILS_H 23 | 24 | #include 25 | #include 26 | 27 | class QTransform; 28 | 29 | namespace Gwenview 30 | { 31 | namespace ImageUtils 32 | { 33 | GWENVIEWLIB_EXPORT QTransform transformMatrix(Orientation); 34 | 35 | } // namespace 36 | } // namespace 37 | 38 | #endif /* IMAGEUTILS_H */ 39 | -------------------------------------------------------------------------------- /lib/iodevicejpegsourcemanager.h: -------------------------------------------------------------------------------- 1 | // vim: set tabstop=4 shiftwidth=4 expandtab: 2 | /* 3 | Gwenview: an image viewer 4 | Copyright 2008 Aurélien Gâteau 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; either version 2 9 | of the License, or (at your option) any later version. 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 | You should have received a copy of the GNU General Public License 17 | along with this program; if not, write to the Free Software 18 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Cambridge, MA 02110-1301, USA. 19 | 20 | */ 21 | #ifndef IODEVICEJPEGSOURCEMANAGER_H 22 | #define IODEVICEJPEGSOURCEMANAGER_H 23 | 24 | // Qt 25 | 26 | // KF 27 | 28 | // Local 29 | 30 | class QIODevice; 31 | struct jpeg_decompress_struct; 32 | 33 | namespace Gwenview 34 | { 35 | /** 36 | * This namespace provides a function which makes it possible to decode JPEG 37 | * files with libjpeg from a QIODevice instance. 38 | * 39 | * To use it, simply call setup() to initialize your jpeg_decompress_struct 40 | * with QIODevice-ready callbacks. The device should be opened for reading. 41 | */ 42 | namespace IODeviceJpegSourceManager 43 | { 44 | void setup(jpeg_decompress_struct *cinfo, QIODevice *ioDevice); 45 | 46 | } // namespace 47 | } // namespace 48 | 49 | #endif /* IODEVICEJPEGSOURCEMANAGER_H */ 50 | -------------------------------------------------------------------------------- /lib/kindproxymodel.h: -------------------------------------------------------------------------------- 1 | // vim: set tabstop=4 shiftwidth=4 expandtab: 2 | /* 3 | Gwenview: an image viewer 4 | Copyright 2012 Aurélien Gâteau 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; either version 2 9 | of the License, or (at your option) any later version. 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 | You should have received a copy of the GNU General Public License 17 | along with this program; if not, write to the Free Software 18 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Cambridge, MA 02110-1301, USA. 19 | 20 | */ 21 | #ifndef KINDPROXYMODEL_H 22 | #define KINDPROXYMODEL_H 23 | 24 | // Local 25 | #include 26 | #include 27 | 28 | // KF 29 | 30 | // Qt 31 | #include 32 | 33 | namespace Gwenview 34 | { 35 | struct KindProxyModelPrivate; 36 | /** 37 | * A simple proxy model allowing only objects of a certain kind 38 | */ 39 | class GWENVIEWLIB_EXPORT KindProxyModel : public QSortFilterProxyModel 40 | { 41 | Q_OBJECT 42 | public: 43 | explicit KindProxyModel(QObject *parent = nullptr); 44 | ~KindProxyModel() override; 45 | 46 | void setKindFilter(MimeTypeUtils::Kinds); 47 | MimeTypeUtils::Kinds kindFilter() const; 48 | 49 | protected: 50 | bool filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const override; 51 | 52 | private: 53 | KindProxyModelPrivate *const d; 54 | }; 55 | 56 | } // namespace 57 | 58 | #endif /* KINDPROXYMODEL_H */ 59 | -------------------------------------------------------------------------------- /lib/libjpeg-62/.clang-format: -------------------------------------------------------------------------------- 1 | DisableFormat: true 2 | SortIncludes: false 3 | -------------------------------------------------------------------------------- /lib/libjpeg-80/.clang-format: -------------------------------------------------------------------------------- 1 | DisableFormat: true 2 | SortIncludes: false 3 | -------------------------------------------------------------------------------- /lib/libjpeg-90/.clang-format: -------------------------------------------------------------------------------- 1 | DisableFormat: true 2 | SortIncludes: false 3 | -------------------------------------------------------------------------------- /lib/memoryutils.h: -------------------------------------------------------------------------------- 1 | // vim: set tabstop=4 shiftwidth=4 expandtab: 2 | /* 3 | Gwenview: an image viewer 4 | Copyright 2008 Aurélien Gâteau 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; either version 2 9 | of the License, or (at your option) any later version. 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 | You should have received a copy of the GNU General Public License 17 | along with this program; if not, write to the Free Software 18 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Cambridge, MA 02110-1301, USA. 19 | 20 | */ 21 | #ifndef MEMORYUTILS_H 22 | #define MEMORYUTILS_H 23 | 24 | #include 25 | 26 | // Qt 27 | #include 28 | 29 | // KF 30 | 31 | // Local 32 | 33 | namespace Gwenview 34 | { 35 | namespace MemoryUtils 36 | { 37 | /** 38 | * This function returns the amount of total memory installed on the system 39 | * FIXME: It lacks *BSD and MacOSX support! 40 | */ 41 | GWENVIEWLIB_EXPORT qulonglong getTotalMemory(); 42 | 43 | /** 44 | * This function returns the amount of available free memory installed on the 45 | * system 46 | * FIXME: It lacks *BSD and MacOSX support! 47 | */ 48 | GWENVIEWLIB_EXPORT qulonglong getFreeMemory(); 49 | 50 | } // namespace 51 | 52 | } // namespace 53 | 54 | #endif /* MEMORYUTILS_H */ 55 | -------------------------------------------------------------------------------- /lib/mousewheelbehavior.h: -------------------------------------------------------------------------------- 1 | // vim: set tabstop=4 shiftwidth=4 expandtab: 2 | /* 3 | Gwenview: an image viewer 4 | Copyright 2010 Aurélien Gâteau 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; either version 2 9 | of the License, or (at your option) any later version. 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 | You should have received a copy of the GNU General Public License 17 | along with this program; if not, write to the Free Software 18 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Cambridge, MA 02110-1301, USA. 19 | 20 | */ 21 | #ifndef MOUSEWHEELBEHAVIOR_H 22 | #define MOUSEWHEELBEHAVIOR_H 23 | 24 | // Qt 25 | 26 | // KF 27 | 28 | // Local 29 | 30 | namespace Gwenview 31 | { 32 | namespace MouseWheelBehavior 33 | { 34 | enum Enum { 35 | Scroll, 36 | Browse, 37 | Zoom, 38 | }; 39 | 40 | } // namespace MouseWheelBehavior 41 | 42 | } // namespace Gwenview 43 | 44 | #endif /* MOUSEWHEELBEHAVIOR_H */ 45 | -------------------------------------------------------------------------------- /lib/mpris2/lockscreenwatcher.h: -------------------------------------------------------------------------------- 1 | /* 2 | Gwenview: an image viewer 3 | Copyright 2018 Friedrich W. H. Kossebau 4 | 5 | This program is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU General Public License 7 | as published by the Free Software Foundation; either version 2 8 | of the License, or (at your option) any later version. 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 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 18 | */ 19 | 20 | #ifndef LOCKSCREENWATCHER_H 21 | #define LOCKSCREENWATCHER_H 22 | 23 | // Qt 24 | #include 25 | 26 | class OrgFreedesktopScreenSaverInterface; 27 | class QDBusPendingCallWatcher; 28 | 29 | namespace Gwenview 30 | { 31 | class LockScreenWatcher : public QObject 32 | { 33 | Q_OBJECT 34 | 35 | public: 36 | explicit LockScreenWatcher(QObject *parent); 37 | ~LockScreenWatcher() override; 38 | 39 | public: 40 | bool isLocked() const; 41 | 42 | Q_SIGNALS: 43 | void isLockedChanged(bool locked); 44 | 45 | private: 46 | void onScreenSaverActiveChanged(bool isActive); 47 | void onActiveQueried(QDBusPendingCallWatcher *watcher); 48 | void onScreenSaverServiceOwnerChanged(const QString &serviceName, const QString &oldOwner, const QString &newOwner); 49 | void onServiceRegisteredQueried(); 50 | void onServiceOwnerQueried(); 51 | 52 | private: 53 | OrgFreedesktopScreenSaverInterface *mScreenSaverInterface = nullptr; 54 | bool mLocked = false; 55 | }; 56 | 57 | } 58 | 59 | #endif 60 | -------------------------------------------------------------------------------- /lib/mpris2/org.freedesktop.ScreenSaver.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /lib/print/printhelper.h: -------------------------------------------------------------------------------- 1 | // vim: set tabstop=4 shiftwidth=4 expandtab: 2 | /* 3 | Gwenview: an image viewer 4 | Copyright 2007 Aurélien Gâteau 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; either version 2 9 | of the License, or (at your option) any later version. 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 | You should have received a copy of the GNU General Public License 17 | along with this program; if not, write to the Free Software 18 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 19 | 20 | */ 21 | #ifndef PRINTHELPER_H 22 | #define PRINTHELPER_H 23 | 24 | #include 25 | 26 | // Qt 27 | 28 | // KF 29 | 30 | // Local 31 | #include 32 | 33 | class QWidget; 34 | 35 | namespace Gwenview 36 | { 37 | struct PrintHelperPrivate; 38 | class GWENVIEWLIB_EXPORT PrintHelper 39 | { 40 | public: 41 | explicit PrintHelper(QWidget *parent); 42 | ~PrintHelper(); 43 | 44 | void print(Document::Ptr doc); 45 | void printPreview(Document::Ptr doc); 46 | 47 | private: 48 | PrintHelperPrivate *const d; 49 | }; 50 | 51 | } // namespace 52 | 53 | #endif /* PRINTHELPER_H */ 54 | -------------------------------------------------------------------------------- /lib/ramp.h: -------------------------------------------------------------------------------- 1 | // vim: set tabstop=4 shiftwidth=4 expandtab: 2 | /* 3 | Gwenview: an image viewer 4 | Copyright 2008 Aurélien Gâteau 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; either version 2 9 | of the License, or (at your option) any later version. 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 | You should have received a copy of the GNU General Public License 17 | along with this program; if not, write to the Free Software 18 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 19 | 20 | */ 21 | #ifndef RAMP_H 22 | #define RAMP_H 23 | 24 | namespace Gwenview 25 | { 26 | /** 27 | * This class maps values on a linear ramp. 28 | * It's useful to do mappings like this: 29 | * 30 | * x | -oo x1 x2 +oo 31 | * --+-------------------------------------- 32 | * y | y1 y1 (linear ramp) y2 y2 33 | * 34 | * Note that y1 can be greater than y2 if necessary 35 | */ 36 | class Ramp 37 | { 38 | public: 39 | Ramp(qreal x1, qreal x2, qreal y1, qreal y2) 40 | : mX1(x1) 41 | , mX2(x2) 42 | , mY1(y1) 43 | , mY2(y2) 44 | { 45 | mK = (y2 - y1) / (x2 - x1); 46 | } 47 | 48 | qreal operator()(qreal x) const 49 | { 50 | if (x < mX1) { 51 | return mY1; 52 | } 53 | if (x > mX2) { 54 | return mY2; 55 | } 56 | return mY1 + (x - mX1) * mK; 57 | } 58 | 59 | private: 60 | qreal mX1, mX2, mY1, mY2, mK; 61 | }; 62 | 63 | } // namespace 64 | 65 | #endif /* RAMP_H */ 66 | -------------------------------------------------------------------------------- /lib/redeyereduction/redeyereductionimageoperation.h: -------------------------------------------------------------------------------- 1 | // vim: set tabstop=4 shiftwidth=4 expandtab: 2 | /* 3 | Gwenview: an image viewer 4 | Copyright 2007 Aurélien Gâteau 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; either version 2 9 | of the License, or (at your option) any later version. 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 | You should have received a copy of the GNU General Public License 17 | along with this program; if not, write to the Free Software 18 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 19 | 20 | */ 21 | #ifndef REDEYEREDUCTIONIMAGEOPERATION_H 22 | #define REDEYEREDUCTIONIMAGEOPERATION_H 23 | 24 | #include 25 | 26 | // Qt 27 | 28 | // KF 29 | 30 | // Local 31 | #include 32 | 33 | class QRectF; 34 | 35 | namespace Gwenview 36 | { 37 | struct RedEyeReductionImageOperationPrivate; 38 | class GWENVIEWLIB_EXPORT RedEyeReductionImageOperation : public AbstractImageOperation 39 | { 40 | public: 41 | RedEyeReductionImageOperation(const QRectF &); 42 | ~RedEyeReductionImageOperation() override; 43 | 44 | void redo() override; 45 | void undo() override; 46 | 47 | static void apply(QImage *img, const QRectF &rectF); 48 | 49 | private: 50 | RedEyeReductionImageOperationPrivate *const d; 51 | }; 52 | 53 | } // namespace 54 | 55 | #endif /* REDEYEREDUCTIONIMAGEOPERATION_H */ 56 | -------------------------------------------------------------------------------- /lib/renderingintent.h: -------------------------------------------------------------------------------- 1 | // vim: set tabstop=4 shiftwidth=4 expandtab: 2 | /* 3 | Gwenview: an image viewer 4 | Copyright 2018 Nate Graham 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; either version 2 9 | of the License, or (at your option) any later version. 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 | You should have received a copy of the GNU General Public License 17 | along with this program; if not, write to the Free Software 18 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Cambridge, MA 02110-1301, USA. 19 | 20 | */ 21 | #ifndef RENDERINGINTENT_H 22 | #define RENDERINGINTENT_H 23 | 24 | #include 25 | 26 | namespace Gwenview 27 | { 28 | namespace RenderingIntent 29 | { 30 | /** 31 | * This enum represents the different color rendering modes 32 | */ 33 | enum Enum : cmsUInt32Number { 34 | Perceptual = INTENT_PERCEPTUAL, 35 | Relative = INTENT_RELATIVE_COLORIMETRIC, 36 | }; 37 | 38 | } // namespace RenderingIntent 39 | 40 | } // namespace Gwenview 41 | 42 | #endif /* RENDERINGINTENT_H */ 43 | -------------------------------------------------------------------------------- /lib/resize/resizeimageoperation.h: -------------------------------------------------------------------------------- 1 | // vim: set tabstop=4 shiftwidth=4 expandtab: 2 | /* 3 | Gwenview: an image viewer 4 | Copyright 2007 Aurélien Gâteau 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; either version 2 9 | of the License, or (at your option) any later version. 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 | You should have received a copy of the GNU General Public License 17 | along with this program; if not, write to the Free Software 18 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 19 | 20 | */ 21 | #ifndef RESIZEIMAGEOPERATION_H 22 | #define RESIZEIMAGEOPERATION_H 23 | 24 | #include 25 | 26 | // Qt 27 | 28 | // KF 29 | 30 | // Local 31 | #include 32 | 33 | namespace Gwenview 34 | { 35 | struct ResizeImageOperationPrivate; 36 | class GWENVIEWLIB_EXPORT ResizeImageOperation : public AbstractImageOperation 37 | { 38 | public: 39 | ResizeImageOperation(const QSize &size); 40 | ~ResizeImageOperation() override; 41 | 42 | void redo() override; 43 | void undo() override; 44 | 45 | private: 46 | ResizeImageOperationPrivate *const d; 47 | }; 48 | 49 | } // namespace 50 | 51 | #endif /* RESIZEIMAGEOPERATION_H */ 52 | -------------------------------------------------------------------------------- /lib/scrollerutils.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Gwenview: an image viewer 3 | Copyright 2019 Steffen Hartleib 4 | 5 | This program is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU General Public License 7 | as published by the Free Software Foundation; either version 2 8 | of the License, or (at your option) any later version. 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 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 18 | 19 | */ 20 | #include "scrollerutils.h" 21 | 22 | // Qt 23 | #include 24 | 25 | namespace Gwenview 26 | { 27 | namespace ScrollerUtils 28 | { 29 | QScroller *setQScroller(QObject *viewport) 30 | { 31 | QScroller *scroller = QScroller::scroller(viewport); 32 | QScrollerProperties scrollerProperties = scroller->scrollerProperties(); 33 | scrollerProperties.setScrollMetric(QScrollerProperties::HorizontalOvershootPolicy, QScrollerProperties::OvershootAlwaysOff); 34 | scrollerProperties.setScrollMetric(QScrollerProperties::VerticalOvershootPolicy, QScrollerProperties::OvershootAlwaysOff); 35 | scroller->setScrollerProperties(scrollerProperties); 36 | scroller->grabGesture(viewport); 37 | return scroller; 38 | } 39 | 40 | } // namespace 41 | } // namespace 42 | -------------------------------------------------------------------------------- /lib/scrollerutils.h: -------------------------------------------------------------------------------- 1 | /* 2 | Gwenview: an image viewer 3 | Copyright 2019 Steffen Hartleib 4 | 5 | This program is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU General Public License 7 | as published by the Free Software Foundation; either version 2 8 | of the License, or (at your option) any later version. 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 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 18 | 19 | */ 20 | #ifndef SCROLLERUTILS_H 21 | #define SCROLLERUTILS_H 22 | 23 | #include 24 | 25 | class QScroller; 26 | class QObject; 27 | 28 | namespace Gwenview 29 | { 30 | namespace ScrollerUtils 31 | { 32 | GWENVIEWLIB_EXPORT QScroller *setQScroller(QObject *); 33 | 34 | } // namespace 35 | } // namespace 36 | 37 | #endif /* SCROLLERUTILS_H */ 38 | -------------------------------------------------------------------------------- /lib/shadowfilter.h: -------------------------------------------------------------------------------- 1 | // vim: set tabstop=4 shiftwidth=4 expandtab: 2 | /* 3 | Gwenview: an image viewer 4 | Copyright 2011 Aurélien Gâteau 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; either version 2 9 | of the License, or (at your option) any later version. 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 | You should have received a copy of the GNU General Public License 17 | along with this program; if not, write to the Free Software 18 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Cambridge, MA 02110-1301, USA. 19 | 20 | */ 21 | #ifndef SHADOWFILTER_H 22 | #define SHADOWFILTER_H 23 | 24 | #include 25 | 26 | // Local 27 | 28 | // KF 29 | 30 | // Qt 31 | #include 32 | 33 | class QColor; 34 | class QWidget; 35 | 36 | namespace Gwenview 37 | { 38 | struct ShadowFilterPrivate; 39 | /** 40 | * Paint shadows on widget edges 41 | */ 42 | class GWENVIEWLIB_EXPORT ShadowFilter : public QObject 43 | { 44 | Q_OBJECT 45 | public: 46 | enum WidgetEdge { 47 | LeftEdge, 48 | TopEdge, 49 | RightEdge, 50 | BottomEdge, 51 | }; 52 | explicit ShadowFilter(QWidget *parent); 53 | ~ShadowFilter() override; 54 | 55 | void setShadow(WidgetEdge edge, const QColor &color); 56 | void reset(); 57 | 58 | protected: 59 | bool eventFilter(QObject *, QEvent *) override; 60 | 61 | private: 62 | ShadowFilterPrivate *const d; 63 | }; 64 | 65 | } // namespace 66 | 67 | #endif /* SHADOWFILTER_H */ 68 | -------------------------------------------------------------------------------- /lib/signalblocker.h: -------------------------------------------------------------------------------- 1 | // vim: set tabstop=4 shiftwidth=4 expandtab: 2 | /* 3 | Gwenview: an image viewer 4 | Copyright 2007 Aurélien Gâteau 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; either version 2 9 | of the License, or (at your option) any later version. 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 | You should have received a copy of the GNU General Public License 17 | along with this program; if not, write to the Free Software 18 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 19 | 20 | */ 21 | #ifndef SIGNALBLOCKER_H 22 | #define SIGNALBLOCKER_H 23 | 24 | #include 25 | 26 | namespace Gwenview 27 | { 28 | /** 29 | * An RAII class to block and unblock signals from a QObject instance 30 | */ 31 | class SignalBlocker 32 | { 33 | public: 34 | explicit SignalBlocker(QObject *object) 35 | { 36 | mObject = object; 37 | mWasBlocked = object->blockSignals(true); 38 | } 39 | 40 | ~SignalBlocker() 41 | { 42 | mObject->blockSignals(mWasBlocked); 43 | } 44 | 45 | private: 46 | QObject *mObject; 47 | bool mWasBlocked; 48 | }; 49 | 50 | } // namespace 51 | 52 | #endif /* SIGNALBLOCKER_H */ 53 | -------------------------------------------------------------------------------- /lib/sorting.h: -------------------------------------------------------------------------------- 1 | // vim: set tabstop=4 shiftwidth=4 expandtab: 2 | /* 3 | Gwenview: an image viewer 4 | Copyright 2008 Aurélien Gâteau 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; either version 2 9 | of the License, or (at your option) any later version. 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 | You should have received a copy of the GNU General Public License 17 | along with this program; if not, write to the Free Software 18 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Cambridge, MA 02110-1301, USA. 19 | 20 | */ 21 | #ifndef SORTING_H 22 | #define SORTING_H 23 | 24 | // Do not assume every file that includes this one, includes the config.h 25 | #include 26 | 27 | // Qt 28 | 29 | // KF 30 | 31 | // Local 32 | 33 | namespace Gwenview 34 | { 35 | namespace Sorting 36 | { 37 | /** 38 | * This enum represents the different sorting orders. 39 | */ 40 | enum Enum { 41 | Name, 42 | Size, 43 | Date, 44 | #ifndef GWENVIEW_SEMANTICINFO_BACKEND_NONE 45 | Rating, 46 | #endif 47 | }; 48 | 49 | } // namespace Sorting 50 | 51 | } // namespace Gwenview 52 | 53 | #endif /* SORTING_H */ 54 | -------------------------------------------------------------------------------- /lib/stylesheetutils.h: -------------------------------------------------------------------------------- 1 | /* 2 | Gwenview: an image viewer 3 | Copyright 2007 Aurélien Gâteau 4 | Copyright 2018 Huon Imberger 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; either version 2 9 | of the License, or (at your option) any later version. 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 | You should have received a copy of the GNU General Public License 17 | along with this program; if not, write to the Free Software 18 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 19 | 20 | */ 21 | #ifndef STYLESHEETUTILS_H 22 | #define STYLESHEETUTILS_H 23 | 24 | // Qt 25 | #include 26 | #include 27 | 28 | // KF 29 | 30 | // Local 31 | #include "orientation.h" 32 | #include 33 | 34 | namespace Gwenview 35 | { 36 | /** 37 | * A collection of convenience functions to generate CSS code 38 | */ 39 | namespace StyleSheetUtils 40 | { 41 | GWENVIEWLIB_EXPORT QString rgba(const QColor &color); 42 | 43 | GWENVIEWLIB_EXPORT QString gradient(Qt::Orientation orientation, const QColor &color, int value); 44 | 45 | } // namespace 46 | 47 | } // namespace 48 | 49 | #endif /* STYLESHEETUTILS_H */ 50 | -------------------------------------------------------------------------------- /lib/thumbnailactions.h: -------------------------------------------------------------------------------- 1 | // vim: set tabstop=4 shiftwidth=4 expandtab: 2 | /* 3 | Gwenview: an image viewer 4 | Copyright 2018 Huon Imberger 5 | 6 | This program is free software; you can redistribute it and/or modify it 7 | under the terms of the GNU General Public License as published by the 8 | Free Software Foundation; either version 2 of the License, or (at your 9 | option) any later version. 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 | You should have received a copy of the GNU General Public License along 17 | with this program; if not, write to the Free Software Foundation, Inc., 18 | 51 Franklin Street, Fifth Floor, Cambridge, MA 02110-1301, USA. 19 | 20 | */ 21 | #ifndef THUMBNAILACTIONS_H 22 | #define THUMBNAILACTIONS_H 23 | 24 | // Qt 25 | 26 | // KF 27 | 28 | // Local 29 | 30 | namespace Gwenview 31 | { 32 | namespace ThumbnailActions 33 | { 34 | /** 35 | * This enum represents the different thumbnail actions display modes. 36 | */ 37 | enum Enum { 38 | AllButtons, 39 | ShowSelectionButtonOnly, 40 | None, 41 | }; 42 | 43 | } // namespace ThumbnailActions 44 | 45 | } // namespace Gwenview 46 | 47 | #endif /* THUMBNAILACTIONS_H */ 48 | -------------------------------------------------------------------------------- /lib/thumbnailprovider/thumbnailwriter.h: -------------------------------------------------------------------------------- 1 | // vim: set tabstop=4 shiftwidth=4 expandtab: 2 | /* 3 | Gwenview: an image viewer 4 | Copyright 2012 Aurélien Gâteau 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; either version 2 9 | of the License, or (at your option) any later version. 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 | You should have received a copy of the GNU General Public License 17 | along with this program; if not, write to the Free Software 18 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Cambridge, MA 02110-1301, USA. 19 | 20 | */ 21 | #ifndef THUMBNAILWRITER_H 22 | #define THUMBNAILWRITER_H 23 | 24 | // Local 25 | 26 | // KF 27 | 28 | // Qt 29 | #include 30 | #include 31 | #include 32 | 33 | class QImage; 34 | 35 | namespace Gwenview 36 | { 37 | /** 38 | * Store thumbnails to disk when done generating them 39 | */ 40 | class ThumbnailWriter : public QThread 41 | { 42 | Q_OBJECT 43 | public: 44 | // Return thumbnail if it has still not been stored 45 | QImage value(const QString &) const; 46 | 47 | bool isEmpty() const; 48 | 49 | public Q_SLOTS: 50 | void queueThumbnail(const QString &, const QImage &); 51 | 52 | protected: 53 | void run() override; 54 | 55 | private: 56 | using Cache = QHash; 57 | Cache mCache; 58 | mutable QMutex mMutex; 59 | }; 60 | 61 | } // namespace 62 | 63 | #endif /* THUMBNAILWRITER_H */ 64 | -------------------------------------------------------------------------------- /lib/thumbnailview/abstractdocumentinfoprovider.cpp: -------------------------------------------------------------------------------- 1 | // vim: set tabstop=4 shiftwidth=4 expandtab: 2 | /* 3 | Gwenview: an image viewer 4 | Copyright 2010 Aurélien Gâteau 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; either version 2 9 | of the License, or (at your option) any later version. 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 | You should have received a copy of the GNU General Public License 17 | along with this program; if not, write to the Free Software 18 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Cambridge, MA 02110-1301, USA. 19 | 20 | */ 21 | // Self 22 | #include "abstractdocumentinfoprovider.h" 23 | 24 | // Qt 25 | 26 | // KF 27 | 28 | // Local 29 | 30 | namespace Gwenview 31 | { 32 | AbstractDocumentInfoProvider::AbstractDocumentInfoProvider(QObject *parent) 33 | : QObject(parent) 34 | { 35 | } 36 | 37 | } // namespace 38 | 39 | #include "moc_abstractdocumentinfoprovider.cpp" 40 | -------------------------------------------------------------------------------- /lib/thumbnailview/abstractthumbnailviewhelper.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Gwenview: an image viewer 3 | Copyright 2007 Aurélien Gâteau 4 | 5 | This program is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU General Public License 7 | as published by the Free Software Foundation; either version 2 8 | of the License, or (at your option) any later version. 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 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 18 | 19 | */ 20 | #include "abstractthumbnailviewhelper.h" 21 | 22 | namespace Gwenview 23 | { 24 | AbstractThumbnailViewHelper::AbstractThumbnailViewHelper(QObject *parent) 25 | : QObject(parent) 26 | { 27 | } 28 | 29 | AbstractThumbnailViewHelper::~AbstractThumbnailViewHelper() = default; 30 | 31 | } // namespace 32 | 33 | #include "moc_abstractthumbnailviewhelper.cpp" 34 | -------------------------------------------------------------------------------- /lib/thumbnailview/abstractthumbnailviewhelper.h: -------------------------------------------------------------------------------- 1 | /* 2 | Gwenview: an image viewer 3 | Copyright 2007 Aurélien Gâteau 4 | 5 | This program is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU General Public License 7 | as published by the Free Software Foundation; either version 2 8 | of the License, or (at your option) any later version. 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 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 18 | 19 | */ 20 | #ifndef ABSTRACTTHUMBNAILVIEWHELPER_H 21 | #define ABSTRACTTHUMBNAILVIEWHELPER_H 22 | 23 | #include 24 | 25 | // Qt 26 | #include 27 | #include 28 | 29 | // KF 30 | 31 | // Local 32 | 33 | namespace Gwenview 34 | { 35 | /** 36 | * This class is used by the ThumbnailView to request various things. 37 | */ 38 | class GWENVIEWLIB_EXPORT AbstractThumbnailViewHelper : public QObject 39 | { 40 | Q_OBJECT 41 | public: 42 | explicit AbstractThumbnailViewHelper(QObject *parent); 43 | ~AbstractThumbnailViewHelper() override; 44 | 45 | virtual void showContextMenu(QWidget *parent) = 0; 46 | 47 | virtual void showMenuForUrlDroppedOnViewport(QWidget *parent, const QList &) = 0; 48 | 49 | virtual void showMenuForUrlDroppedOnDir(QWidget *parent, const QList &, const QUrl &) = 0; 50 | }; 51 | 52 | } // namespace 53 | 54 | #endif /* ABSTRACTTHUMBNAILVIEWHELPER_H */ 55 | -------------------------------------------------------------------------------- /lib/thumbnailview/dragpixmapgenerator.h: -------------------------------------------------------------------------------- 1 | // vim: set tabstop=4 shiftwidth=4 expandtab: 2 | /* 3 | Gwenview: an image viewer 4 | Copyright 2012 Aurélien Gâteau 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; either version 2 9 | of the License, or (at your option) any later version. 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 | You should have received a copy of the GNU General Public License 17 | along with this program; if not, write to the Free Software 18 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Cambridge, MA 02110-1301, USA. 19 | 20 | */ 21 | #ifndef DRAGPIXMAPGENERATOR_H 22 | #define DRAGPIXMAPGENERATOR_H 23 | 24 | // Local 25 | 26 | // KF 27 | 28 | // Qt 29 | #include 30 | #include 31 | 32 | namespace Gwenview 33 | { 34 | /** 35 | * Generate a nice pixmap to represent dragged images 36 | */ 37 | namespace DragPixmapGenerator 38 | { 39 | enum { 40 | MaxCount = 6, 41 | }; 42 | 43 | struct DragPixmap { 44 | QPixmap pix; 45 | QPoint hotSpot; 46 | }; 47 | 48 | DragPixmap generate(const QList &pixmaps, int totalCount); 49 | 50 | } // DragPixmapGenerator namespace 51 | 52 | } // namespace 53 | 54 | #endif /* DRAGPIXMAPGENERATOR_H */ 55 | -------------------------------------------------------------------------------- /lib/thumbnailview/itemeditor.h: -------------------------------------------------------------------------------- 1 | // vim: set tabstop=4 shiftwidth=4 expandtab: 2 | /* 3 | Gwenview: an image viewer 4 | Copyright 2009 Aurélien Gâteau 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; either version 2 9 | of the License, or (at your option) any later version. 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 | You should have received a copy of the GNU General Public License 17 | along with this program; if not, write to the Free Software 18 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Cambridge, MA 02110-1301, USA. 19 | 20 | */ 21 | #ifndef ITEMEDITOR_H 22 | #define ITEMEDITOR_H 23 | 24 | // Qt 25 | 26 | // KF 27 | #include 28 | 29 | // Local 30 | 31 | namespace Gwenview 32 | { 33 | struct ItemEditorPrivate; 34 | class ItemEditor : public KLineEdit 35 | { 36 | Q_OBJECT 37 | public: 38 | explicit ItemEditor(QWidget *parent = nullptr); 39 | ~ItemEditor() override; 40 | 41 | protected: 42 | void showEvent(QShowEvent *) override; 43 | 44 | private Q_SLOTS: 45 | void resizeToContents(); 46 | 47 | private: 48 | ItemEditorPrivate *const d; 49 | }; 50 | 51 | } // namespace 52 | 53 | #endif /* ITEMEDITOR_H */ 54 | -------------------------------------------------------------------------------- /lib/thumbnailview/thumbnailslider.h: -------------------------------------------------------------------------------- 1 | // vim: set tabstop=4 shiftwidth=4 expandtab: 2 | /* 3 | Gwenview: an image viewer 4 | Copyright 2009 Aurélien Gâteau 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; either version 2 9 | of the License, or (at your option) any later version. 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 | You should have received a copy of the GNU General Public License 17 | along with this program; if not, write to the Free Software 18 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Cambridge, MA 02110-1301, USA. 19 | 20 | */ 21 | #ifndef THUMBNAILSLIDER_H 22 | #define THUMBNAILSLIDER_H 23 | 24 | #include 25 | 26 | // Qt 27 | 28 | // KF 29 | 30 | // Local 31 | #include 32 | 33 | namespace Gwenview 34 | { 35 | struct ThumbnailSliderPrivate; 36 | /** 37 | * A zoom slider which shows the thumbnail size as a tooltip when it is 38 | * adjusted 39 | */ 40 | class GWENVIEWLIB_EXPORT ThumbnailSlider : public ZoomSlider 41 | { 42 | Q_OBJECT 43 | public: 44 | explicit ThumbnailSlider(QWidget *parent = nullptr); 45 | ~ThumbnailSlider() override; 46 | 47 | void updateToolTip(); 48 | 49 | private Q_SLOTS: 50 | void slotActionTriggered(int actionTriggered); 51 | 52 | private: 53 | ThumbnailSliderPrivate *const d; 54 | }; 55 | 56 | } // namespace 57 | 58 | #endif /* THUMBNAILSLIDER_H */ 59 | -------------------------------------------------------------------------------- /lib/thumbnailview/tooltipwidget.h: -------------------------------------------------------------------------------- 1 | // vim: set tabstop=4 shiftwidth=4 expandtab: 2 | /* 3 | Gwenview: an image viewer 4 | Copyright 2009 Aurélien Gâteau 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; either version 2 9 | of the License, or (at your option) any later version. 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 | You should have received a copy of the GNU General Public License 17 | along with this program; if not, write to the Free Software 18 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Cambridge, MA 02110-1301, USA. 19 | 20 | */ 21 | #ifndef TOOLTIPWIDGET_H 22 | #define TOOLTIPWIDGET_H 23 | 24 | // Qt 25 | #include 26 | 27 | // KF 28 | 29 | // Local 30 | 31 | namespace Gwenview 32 | { 33 | struct ToolTipWidgetPrivate; 34 | 35 | /** 36 | * A label which uses tooltip colors and can be faded 37 | */ 38 | class ToolTipWidget : public QWidget 39 | { 40 | Q_OBJECT 41 | Q_PROPERTY(qreal opacity READ opacity WRITE setOpacity) 42 | public: 43 | explicit ToolTipWidget(QWidget *parent = nullptr); 44 | ~ToolTipWidget() override; 45 | 46 | qreal opacity() const; 47 | void setOpacity(qreal); 48 | 49 | QString text() const; 50 | void setText(const QString &text); 51 | 52 | QSize sizeHint() const override; 53 | 54 | protected: 55 | void paintEvent(QPaintEvent *) override; 56 | 57 | private: 58 | ToolTipWidgetPrivate *const d; 59 | }; 60 | 61 | } // namespace 62 | 63 | #endif /* TOOLTIPWIDGET_H */ 64 | -------------------------------------------------------------------------------- /lib/timeutils.h: -------------------------------------------------------------------------------- 1 | // vim: set tabstop=4 shiftwidth=4 expandtab: 2 | /* 3 | Gwenview: an image viewer 4 | Copyright 2008 Aurélien Gâteau 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; either version 2 9 | of the License, or (at your option) any later version. 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 | You should have received a copy of the GNU General Public License 17 | along with this program; if not, write to the Free Software 18 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Cambridge, MA 02110-1301, USA. 19 | 20 | */ 21 | #ifndef TIMEUTILS_H 22 | #define TIMEUTILS_H 23 | 24 | // Local 25 | #include 26 | 27 | class KFileItem; 28 | class QDateTime; 29 | 30 | namespace Gwenview 31 | { 32 | namespace TimeUtils 33 | { 34 | enum CachePolicy { 35 | SkipCache, 36 | UseCache, 37 | }; 38 | 39 | QDateTime GWENVIEWLIB_EXPORT dateTimeForFileItem(const KFileItem &fileItem, Gwenview::TimeUtils::CachePolicy cachePolicy = UseCache); 40 | 41 | } // namespace 42 | 43 | } // namespace 44 | #endif /* TIMEUTILS_H */ 45 | -------------------------------------------------------------------------------- /lib/touch/doubletap.h: -------------------------------------------------------------------------------- 1 | /* 2 | Gwenview: an image viewer 3 | Copyright 2019 Steffen Hartleib 4 | 5 | This program is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU General Public License 7 | as published by the Free Software Foundation; either version 2 8 | of the License, or (at your option) any later version. 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 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Cambridge, MA 02110-1301, USA. 18 | 19 | */ 20 | #ifndef DOUBLETAP_H 21 | #define DOUBLETAP_H 22 | 23 | #include 24 | // Qt 25 | #include 26 | #include 27 | 28 | // KF 29 | 30 | // Local 31 | 32 | namespace Gwenview 33 | { 34 | struct DoubleTapRecognizerPrivate; 35 | 36 | class GWENVIEWLIB_EXPORT DoubleTap : public QGesture 37 | { 38 | Q_PROPERTY(QPointF pos READ pos WRITE pos) 39 | public: 40 | explicit DoubleTap(QObject *parent = nullptr); 41 | 42 | private: 43 | QPointF pos; 44 | }; 45 | 46 | class GWENVIEWLIB_EXPORT DoubleTapRecognizer : public QGestureRecognizer 47 | { 48 | public: 49 | explicit DoubleTapRecognizer(); 50 | ~DoubleTapRecognizer() override; 51 | 52 | private: 53 | DoubleTapRecognizerPrivate *d; 54 | 55 | QGesture *create(QObject *) override; 56 | Result recognize(QGesture *, QObject *, QEvent *) override; 57 | }; 58 | 59 | } // namespace 60 | #endif /* DOUBLETAP_H */ 61 | -------------------------------------------------------------------------------- /lib/touch/twofingertap.h: -------------------------------------------------------------------------------- 1 | /* 2 | Gwenview: an image viewer 3 | Copyright 2019 Steffen Hartleib 4 | 5 | This program is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU General Public License 7 | as published by the Free Software Foundation; either version 2 8 | of the License, or (at your option) any later version. 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 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Cambridge, MA 02110-1301, USA. 18 | 19 | */ 20 | #ifndef TWOFINGERTAP_H 21 | #define TWOFINGERTAP_H 22 | 23 | #include 24 | // Qt 25 | #include 26 | #include 27 | 28 | // KF 29 | 30 | // Local 31 | 32 | namespace Gwenview 33 | { 34 | struct TwoFingerTapRecognizerPrivate; 35 | 36 | class GWENVIEWLIB_EXPORT TwoFingerTap : public QGesture 37 | { 38 | public: 39 | explicit TwoFingerTap(QObject *parent = nullptr); 40 | 41 | private: 42 | }; 43 | 44 | class GWENVIEWLIB_EXPORT TwoFingerTapRecognizer : public QGestureRecognizer 45 | { 46 | public: 47 | explicit TwoFingerTapRecognizer(); 48 | ~TwoFingerTapRecognizer() override; 49 | 50 | private: 51 | TwoFingerTapRecognizerPrivate *d; 52 | 53 | QGesture *create(QObject *) override; 54 | Result recognize(QGesture *, QObject *, QEvent *) override; 55 | }; 56 | 57 | } // namespace 58 | #endif /* TWOFINGERTAP_H */ 59 | -------------------------------------------------------------------------------- /lib/urlutils.h: -------------------------------------------------------------------------------- 1 | // vim: set tabstop=4 shiftwidth=4 expandtab: 2 | /* 3 | Gwenview: an image viewer 4 | Copyright 2008 Aurélien Gâteau 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; either version 2 9 | of the License, or (at your option) any later version. 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 | You should have received a copy of the GNU General Public License 17 | along with this program; if not, write to the Free Software 18 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Cambridge, MA 02110-1301, USA. 19 | 20 | */ 21 | #ifndef URLUTILS_H 22 | #define URLUTILS_H 23 | 24 | #include 25 | 26 | // Qt 27 | 28 | // KF 29 | 30 | // Local 31 | 32 | class QUrl; 33 | 34 | namespace Gwenview 35 | { 36 | namespace UrlUtils 37 | { 38 | /** 39 | * Returns whether the url is a local file, and it's not on a slow device like 40 | * an nfs export. 41 | */ 42 | GWENVIEWLIB_EXPORT bool urlIsFastLocalFile(const QUrl &url); 43 | 44 | /** 45 | * Returns whether the url is a directory. 46 | */ 47 | GWENVIEWLIB_EXPORT bool urlIsDirectory(const QUrl &url); 48 | 49 | /** 50 | * Returns a fixed version of a user entered url 51 | */ 52 | GWENVIEWLIB_EXPORT QUrl fixUserEnteredUrl(const QUrl &url); 53 | 54 | } // namespace 55 | 56 | } // namespace 57 | 58 | #endif /* URLUTILS_H */ 59 | -------------------------------------------------------------------------------- /lib/waylandgestures/waylandgestures.h: -------------------------------------------------------------------------------- 1 | /* 2 | Gwenview: an image viewer 3 | Copyright 2019 Steffen Hartleib 4 | Copyright 2022 Carl Schwan 5 | Copyright 2022 Bharadwaj Raju 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; either version 2 10 | of the License, or (at your option) any later version. 11 | 12 | This program is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU General Public License for more details. 16 | 17 | You should have received a copy of the GNU General Public License 18 | along with this program; if not, write to the Free Software 19 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Cambridge, MA 02110-1301, USA. 20 | 21 | */ 22 | #pragma once 23 | 24 | #include 25 | 26 | #include 27 | 28 | class PointerGestures; 29 | class PinchGesture; 30 | 31 | namespace Gwenview 32 | { 33 | class GWENVIEWLIB_EXPORT WaylandGestures : public QObject 34 | { 35 | Q_OBJECT 36 | public: 37 | WaylandGestures(QObject *parent = nullptr); 38 | ~WaylandGestures(); 39 | void init(); 40 | void setStartZoom(qreal); 41 | void setZoomModifier(qreal); 42 | void setRotationThreshold(qreal); 43 | 44 | Q_SIGNALS: 45 | void pinchGestureStarted(); 46 | void pinchZoomChanged(double); 47 | 48 | private: 49 | PointerGestures *m_pointerGestures; 50 | PinchGesture *m_pinchGesture; 51 | double m_startZoom; 52 | double m_zoomModifier; 53 | }; 54 | 55 | } // namespace 56 | -------------------------------------------------------------------------------- /lib/zoomcombobox/zoomcombobox_p.h: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: 2021 Noah Davis 2 | // SPDX-License-Identifier: LGPL-2.1-or-later 3 | 4 | #ifndef GWENVIEW_ZOOMCOMBOBOX_P_H 5 | #define GWENVIEW_ZOOMCOMBOBOX_P_H 6 | 7 | #include "zoomcombobox.h" 8 | 9 | namespace Gwenview 10 | { 11 | class ZoomValidator : public QValidator 12 | { 13 | Q_OBJECT 14 | Q_PROPERTY(qreal minimum READ minimum WRITE setMinimum NOTIFY changed) 15 | Q_PROPERTY(qreal maximum READ maximum WRITE setMaximum NOTIFY changed) 16 | public: 17 | explicit ZoomValidator(qreal minimum, qreal maximum, ZoomComboBox *q, ZoomComboBoxPrivate *d, QWidget *parent = nullptr); 18 | ~ZoomValidator() override; 19 | 20 | qreal minimum() const; 21 | void setMinimum(const qreal minimum); 22 | 23 | qreal maximum() const; 24 | void setMaximum(const qreal maximum); 25 | 26 | QValidator::State validate(QString &input, int &pos) const override; 27 | 28 | private: 29 | qreal m_minimum; 30 | qreal m_maximum; 31 | ZoomComboBox *m_zoomComboBox; 32 | ZoomComboBoxPrivate *m_zoomComboBoxPrivate; 33 | Q_DISABLE_COPY(ZoomValidator) 34 | }; 35 | 36 | class ZoomComboBoxPrivate 37 | { 38 | Q_DECLARE_PUBLIC(ZoomComboBox) 39 | 40 | public: 41 | ZoomComboBoxPrivate(ZoomComboBox *q); 42 | 43 | void setActions(QAction *zoomToFitAction, QAction *zoomToFillAction, QAction *actualSizeAction); 44 | 45 | public: 46 | ZoomComboBox *const q_ptr; 47 | 48 | QAction *mZoomToFitAction = nullptr; 49 | QAction *mZoomToFillAction = nullptr; 50 | QAction *mActualSizeAction = nullptr; 51 | 52 | qreal value = 1.0; 53 | ZoomValidator *validator = nullptr; 54 | int lastSelectedIndex = 0; 55 | qreal lastCustomZoomValue = 1.0; 56 | }; 57 | 58 | } 59 | 60 | #endif // GWENVIEW_ZOOMCOMBOBOX_P_H 61 | -------------------------------------------------------------------------------- /lib/zoommode.h: -------------------------------------------------------------------------------- 1 | // vim: set tabstop=4 shiftwidth=4 expandtab: 2 | /* 3 | Gwenview: an image viewer 4 | Copyright 2008 Aurélien Gâteau 5 | Copyright 2014 John Zaitseff 6 | 7 | This program is free software; you can redistribute it and/or modify it 8 | under the terms of the GNU General Public License as published by the 9 | Free Software Foundation; either version 2 of the License, or (at your 10 | option) any later version. 11 | 12 | This program is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU General Public License for more details. 16 | 17 | You should have received a copy of the GNU General Public License along 18 | with this program; if not, write to the Free Software Foundation, Inc., 19 | 51 Franklin Street, Fifth Floor, Cambridge, MA 02110-1301, USA. 20 | 21 | */ 22 | #ifndef ZOOMMODE_H 23 | #define ZOOMMODE_H 24 | 25 | // Qt 26 | 27 | // KF 28 | 29 | // Local 30 | 31 | namespace Gwenview 32 | { 33 | namespace ZoomMode 34 | { 35 | /** 36 | * This enum represents the different zoom modes. 37 | */ 38 | enum Enum { 39 | Autofit, 40 | KeepSame, 41 | Individual, 42 | }; 43 | 44 | } // namespace ZoomMode 45 | 46 | } // namespace Gwenview 47 | 48 | #endif /* ZOOMMODE_H */ 49 | -------------------------------------------------------------------------------- /logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/gwenview/b7d675da69765cde021ee05982ef8e4f904b712c/logo.png -------------------------------------------------------------------------------- /part/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_definitions(-DTRANSLATION_DOMAIN="gwenview") 2 | 3 | include_directories( 4 | ${CMAKE_CURRENT_SOURCE_DIR}/.. 5 | ) 6 | 7 | set(gvpart_SRCS 8 | gvbrowserextension.cpp 9 | gvpart.cpp 10 | gvbrowserextension.h 11 | gvpart.h 12 | gvpart.qrc 13 | ) 14 | 15 | add_library(gvpart MODULE ${gvpart_SRCS}) 16 | 17 | target_link_libraries(gvpart KF6::Parts gwenviewlib) 18 | 19 | if(QT_MAJOR_VERSION STREQUAL "6") 20 | JoinListAsString("${IMAGE_MIME_TYPES_LIST}" "\",\"" IMAGE_MIME_LIST) 21 | configure_file(gvpart.json.cmake ${CMAKE_CURRENT_BINARY_DIR}/gvpart.json) 22 | else() 23 | configure_file(gvpart.desktop.cmake ${CMAKE_CURRENT_BINARY_DIR}/gvpart.desktop) 24 | kcoreaddons_desktop_to_json(gvpart ${CMAKE_CURRENT_BINARY_DIR}/gvpart.desktop) 25 | install(FILES ${CMAKE_CURRENT_BINARY_DIR}/gvpart.desktop DESTINATION ${KDE_INSTALL_KSERVICESDIR}) 26 | endif() 27 | 28 | install(TARGETS gvpart DESTINATION ${KDE_INSTALL_PLUGINDIR}/kf6/parts) 29 | -------------------------------------------------------------------------------- /part/gvbrowserextension.h: -------------------------------------------------------------------------------- 1 | // vim: set tabstop=4 shiftwidth=4 expandtab: 2 | /* 3 | Gwenview: an image viewer 4 | Copyright 2008 Aurélien Gâteau 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; either version 2 9 | of the License, or (at your option) any later version. 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 | You should have received a copy of the GNU General Public License 17 | along with this program; if not, write to the Free Software 18 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Cambridge, MA 02110-1301, USA. 19 | 20 | */ 21 | #ifndef GVBROWSEREXTENSION_H 22 | #define GVBROWSEREXTENSION_H 23 | 24 | // Qt 25 | #include 26 | 27 | // KF 28 | #include 29 | 30 | // Local 31 | 32 | namespace Gwenview 33 | { 34 | struct GVBrowserExtensionPrivate; 35 | class GVBrowserExtension : public KParts::NavigationExtension 36 | { 37 | Q_OBJECT 38 | public: 39 | explicit GVBrowserExtension(KParts::ReadOnlyPart *); 40 | ~GVBrowserExtension() override; 41 | 42 | private Q_SLOTS: 43 | void print(); 44 | 45 | private: 46 | GVBrowserExtensionPrivate *const d; 47 | }; 48 | 49 | } // namespace 50 | 51 | #endif /* GVBROWSEREXTENSION_H */ 52 | -------------------------------------------------------------------------------- /part/gvpart.h: -------------------------------------------------------------------------------- 1 | /* 2 | Gwenview: an image viewer 3 | Copyright 2007 Aurélien Gâteau 4 | 5 | This program is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU General Public License 7 | as published by the Free Software Foundation; either version 2 8 | of the License, or (at your option) any later version. 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 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 18 | 19 | */ 20 | #ifndef GVPART_H 21 | #define GVPART_H 22 | 23 | // Qt 24 | 25 | // KF 26 | #include 27 | 28 | // Local 29 | #include 30 | 31 | class KPluginMetaData; 32 | 33 | namespace Gwenview 34 | { 35 | class DocumentView; 36 | 37 | class GVPart : public KParts::ReadOnlyPart 38 | { 39 | Q_OBJECT 40 | public: 41 | GVPart(QWidget *parentWidget, QObject *parent, const KPluginMetaData &metaData, const QVariantList &); 42 | 43 | protected: 44 | bool openUrl(const QUrl &url) override; 45 | 46 | private Q_SLOTS: 47 | void showContextMenu(); 48 | void showProperties(); 49 | void saveAs(); 50 | void showJobError(KJob *); 51 | 52 | private: 53 | DocumentView *mDocumentView = nullptr; 54 | }; 55 | 56 | } // namespace 57 | 58 | #endif /* GVPART_H */ 59 | -------------------------------------------------------------------------------- /part/gvpart.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | gvpart.rc 4 | 5 | 6 | -------------------------------------------------------------------------------- /part/gvpart.rc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | &File 6 | 7 | 8 | 9 | &View 10 | 11 | 12 | 13 | 14 | 15 | 16 | Main Toolbar 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /po/ca/docs/gwenview/browse_mode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/gwenview/b7d675da69765cde021ee05982ef8e4f904b712c/po/ca/docs/gwenview/browse_mode.png -------------------------------------------------------------------------------- /po/ca/docs/gwenview/modified-bar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/gwenview/b7d675da69765cde021ee05982ef8e4f904b712c/po/ca/docs/gwenview/modified-bar.png -------------------------------------------------------------------------------- /po/ca/docs/gwenview/start-page.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/gwenview/b7d675da69765cde021ee05982ef8e4f904b712c/po/ca/docs/gwenview/start-page.png -------------------------------------------------------------------------------- /po/ca/docs/gwenview/view_mode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/gwenview/b7d675da69765cde021ee05982ef8e4f904b712c/po/ca/docs/gwenview/view_mode.png -------------------------------------------------------------------------------- /po/de/docs/gwenview/browse_mode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/gwenview/b7d675da69765cde021ee05982ef8e4f904b712c/po/de/docs/gwenview/browse_mode.png -------------------------------------------------------------------------------- /po/de/docs/gwenview/fullscreen_mode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/gwenview/b7d675da69765cde021ee05982ef8e4f904b712c/po/de/docs/gwenview/fullscreen_mode.png -------------------------------------------------------------------------------- /po/de/docs/gwenview/view_mode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/gwenview/b7d675da69765cde021ee05982ef8e4f904b712c/po/de/docs/gwenview/view_mode.png -------------------------------------------------------------------------------- /po/it/docs/gwenview/browse_mode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/gwenview/b7d675da69765cde021ee05982ef8e4f904b712c/po/it/docs/gwenview/browse_mode.png -------------------------------------------------------------------------------- /po/it/docs/gwenview/fullscreen-browse.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/gwenview/b7d675da69765cde021ee05982ef8e4f904b712c/po/it/docs/gwenview/fullscreen-browse.png -------------------------------------------------------------------------------- /po/it/docs/gwenview/fullscreen-view.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/gwenview/b7d675da69765cde021ee05982ef8e4f904b712c/po/it/docs/gwenview/fullscreen-view.png -------------------------------------------------------------------------------- /po/it/docs/gwenview/importer-picking-root-folder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/gwenview/b7d675da69765cde021ee05982ef8e4f904b712c/po/it/docs/gwenview/importer-picking-root-folder.png -------------------------------------------------------------------------------- /po/it/docs/gwenview/importer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/gwenview/b7d675da69765cde021ee05982ef8e4f904b712c/po/it/docs/gwenview/importer.png -------------------------------------------------------------------------------- /po/it/docs/gwenview/modified-bar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/gwenview/b7d675da69765cde021ee05982ef8e4f904b712c/po/it/docs/gwenview/modified-bar.png -------------------------------------------------------------------------------- /po/it/docs/gwenview/start-page.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/gwenview/b7d675da69765cde021ee05982ef8e4f904b712c/po/it/docs/gwenview/start-page.png -------------------------------------------------------------------------------- /po/it/docs/gwenview/view_mode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/gwenview/b7d675da69765cde021ee05982ef8e4f904b712c/po/it/docs/gwenview/view_mode.png -------------------------------------------------------------------------------- /po/uk/docs/gwenview/browse_mode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/gwenview/b7d675da69765cde021ee05982ef8e4f904b712c/po/uk/docs/gwenview/browse_mode.png -------------------------------------------------------------------------------- /po/uk/docs/gwenview/fullscreen-browse.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/gwenview/b7d675da69765cde021ee05982ef8e4f904b712c/po/uk/docs/gwenview/fullscreen-browse.png -------------------------------------------------------------------------------- /po/uk/docs/gwenview/fullscreen-view.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/gwenview/b7d675da69765cde021ee05982ef8e4f904b712c/po/uk/docs/gwenview/fullscreen-view.png -------------------------------------------------------------------------------- /po/uk/docs/gwenview/importer-picking-root-folder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/gwenview/b7d675da69765cde021ee05982ef8e4f904b712c/po/uk/docs/gwenview/importer-picking-root-folder.png -------------------------------------------------------------------------------- /po/uk/docs/gwenview/importer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/gwenview/b7d675da69765cde021ee05982ef8e4f904b712c/po/uk/docs/gwenview/importer.png -------------------------------------------------------------------------------- /po/uk/docs/gwenview/modified-bar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/gwenview/b7d675da69765cde021ee05982ef8e4f904b712c/po/uk/docs/gwenview/modified-bar.png -------------------------------------------------------------------------------- /po/uk/docs/gwenview/start-page.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/gwenview/b7d675da69765cde021ee05982ef8e4f904b712c/po/uk/docs/gwenview/start-page.png -------------------------------------------------------------------------------- /po/uk/docs/gwenview/view_mode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/gwenview/b7d675da69765cde021ee05982ef8e4f904b712c/po/uk/docs/gwenview/view_mode.png -------------------------------------------------------------------------------- /tests/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | find_package(Qt6Test ${REQUIRED_QT_VERSION} CONFIG QUIET) 2 | 3 | if(NOT Qt6Test_FOUND) 4 | message(STATUS "Qt6Test not found, tests will not be built.") 5 | return() 6 | endif() 7 | 8 | add_custom_target(buildtests) 9 | 10 | add_subdirectory(auto) 11 | add_subdirectory(manual) 12 | 13 | add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND} --verbose) 14 | add_dependencies(check buildtests) 15 | -------------------------------------------------------------------------------- /tests/auto/README_REMOTE_TESTS: -------------------------------------------------------------------------------- 1 | Some of the unit tests in this dir can test code which access images on remote 2 | urls. 3 | 4 | To enable these tests, set the environment variable GV_REMOTE_TESTS_BASE_URL 5 | to something like "sftp://user@host/tmp". The tests will create a dir named 6 | "gwenview-remote-tests" in the supplied url. 7 | -------------------------------------------------------------------------------- /tests/auto/cmsprofiletest.h: -------------------------------------------------------------------------------- 1 | // vim: set tabstop=4 shiftwidth=4 expandtab: 2 | /* 3 | Gwenview: an image viewer 4 | Copyright 2012 Aurélien Gâteau 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; either version 2 9 | of the License, or (at your option) any later version. 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 | You should have received a copy of the GNU General Public License 17 | along with this program; if not, write to the Free Software 18 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Cambridge, MA 02110-1301, USA. 19 | 20 | */ 21 | #ifndef CMSPROFILETEST_H 22 | #define CMSPROFILETEST_H 23 | 24 | // Local 25 | 26 | // KF 27 | 28 | // Qt 29 | #include 30 | 31 | class CmsProfileTest : public QObject 32 | { 33 | Q_OBJECT 34 | 35 | private Q_SLOTS: 36 | void testLoadFromImageData(); 37 | void testLoadFromImageData_data(); 38 | #if 0 // Need some test data 39 | void testLoadFromExiv2Image(); 40 | void testLoadFromExiv2Image_data(); 41 | #endif 42 | }; 43 | 44 | #endif /* CMSPROFILETEST_H */ 45 | -------------------------------------------------------------------------------- /tests/auto/contextmanagertest.h: -------------------------------------------------------------------------------- 1 | // vim: set tabstop=4 shiftwidth=4 expandtab: 2 | /* 3 | Gwenview: an image viewer 4 | Copyright 2013 Aurélien Gâteau 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; either version 2 9 | of the License, or (at your option) any later version. 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 | You should have received a copy of the GNU General Public License 17 | along with this program; if not, write to the Free Software 18 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 19 | 20 | */ 21 | #ifndef CONTEXTMANAGERTEST_H 22 | #define CONTEXTMANAGERTEST_H 23 | 24 | // Local 25 | #include 26 | 27 | // Qt 28 | #include 29 | 30 | class ContextManagerTest : public QObject 31 | { 32 | Q_OBJECT 33 | private Q_SLOTS: 34 | void testRemove(); 35 | }; 36 | 37 | #endif /* CONTEXTMANAGERTEST_H */ 38 | -------------------------------------------------------------------------------- /tests/auto/historymodeltest.h: -------------------------------------------------------------------------------- 1 | /* 2 | Gwenview: an image viewer 3 | Copyright 2009 Aurélien Gâteau 4 | 5 | This program is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU General Public License 7 | as published by the Free Software Foundation; either version 2 8 | of the License, or (at your option) any later version. 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 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 18 | 19 | */ 20 | #ifndef HISTORYMODELTEST_H 21 | #define HISTORYMODELTEST_H 22 | 23 | // Qt 24 | #include 25 | 26 | class HistoryModelTest : public QObject 27 | { 28 | Q_OBJECT 29 | 30 | private Q_SLOTS: 31 | void testAddUrl(); 32 | void testGarbageCollect(); 33 | void testRemoveRows(); 34 | }; 35 | 36 | #endif /* HISTORYMODELTEST_H */ 37 | -------------------------------------------------------------------------------- /tests/auto/imagemetainfomodeltest.h: -------------------------------------------------------------------------------- 1 | /* 2 | Gwenview: an image viewer 3 | Copyright 2012 Aurélien Gâteau 4 | 5 | This program is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU General Public License 7 | as published by the Free Software Foundation; either version 2 8 | of the License, or (at your option) any later version. 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 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 18 | 19 | */ 20 | #ifndef IMAGEMETAINFOMODELTEST_H 21 | #define IMAGEMETAINFOMODELTEST_H 22 | 23 | // Qt 24 | #include 25 | 26 | // KF 27 | 28 | // Local 29 | 30 | class ImageMetaInfoModelTest : public QObject 31 | { 32 | Q_OBJECT 33 | 34 | private Q_SLOTS: 35 | void testCatchExiv2Errors(); 36 | }; 37 | 38 | #endif // IMAGEMETAINFOMODELTEST_H 39 | -------------------------------------------------------------------------------- /tests/auto/importertest.h: -------------------------------------------------------------------------------- 1 | /* 2 | Gwenview: an image viewer 3 | Copyright 2009 Aurélien Gâteau 4 | 5 | This program is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU General Public License 7 | as published by the Free Software Foundation; either version 2 8 | of the License, or (at your option) any later version. 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 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 18 | 19 | */ 20 | #ifndef IMPORTERTEST_H 21 | #define IMPORTERTEST_H 22 | 23 | // stdc++ 24 | #include 25 | 26 | // Qt 27 | #include 28 | #include 29 | #include 30 | 31 | // KF 32 | 33 | class ImporterTest : public QObject 34 | { 35 | Q_OBJECT 36 | 37 | private Q_SLOTS: 38 | void init(); 39 | void testContentsAreIdentical(); 40 | void testSuccessfulImport(); 41 | void testSuccessfulImportRemote(); 42 | void testAutoRenameFormat(); 43 | void testReadOnlyDestination(); 44 | void testFileNameFormater(); 45 | void testFileNameFormater_data(); 46 | void testSkippedUrlList(); 47 | void testRenamedCount(); 48 | 49 | private: 50 | std::unique_ptr mTempDir; 51 | QList mDocumentList; 52 | }; 53 | 54 | #endif /* IMPORTERTEST_H */ 55 | -------------------------------------------------------------------------------- /tests/auto/jpegcontenttest.h: -------------------------------------------------------------------------------- 1 | /* 2 | Gwenview: an image viewer 3 | Copyright 2007 Aurélien Gâteau 4 | 5 | This program is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU General Public License 7 | as published by the Free Software Foundation; either version 2 8 | of the License, or (at your option) any later version. 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 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 18 | 19 | */ 20 | #ifndef JPEGCONTENTTEST_H 21 | #define JPEGCONTENTTEST_H 22 | 23 | // Qt 24 | #include 25 | 26 | class JpegContentTest : public QObject 27 | { 28 | Q_OBJECT 29 | 30 | private Q_SLOTS: 31 | void initTestCase(); 32 | void cleanupTestCase(); 33 | void testReadInfo(); 34 | void testThumbnail(); 35 | void testResetOrientation(); 36 | void testTransform(); 37 | void testSetComment(); 38 | void testMultipleRotations(); 39 | void testLoadTruncated(); 40 | void testRawData(); 41 | void testSetImage(); 42 | }; 43 | 44 | #endif // JPEGCONTENTTEST_H 45 | -------------------------------------------------------------------------------- /tests/auto/placetreemodeltest.h: -------------------------------------------------------------------------------- 1 | /* 2 | Gwenview: an image viewer 3 | Copyright 2009 Aurélien Gâteau 4 | 5 | This program is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU General Public License 7 | as published by the Free Software Foundation; either version 2 8 | of the License, or (at your option) any later version. 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 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 18 | 19 | */ 20 | #ifndef PLACETREEMODELTEST_H 21 | #define PLACETREEMODELTEST_H 22 | 23 | // Qt 24 | #include 25 | #include 26 | #include 27 | #include 28 | 29 | // KF 30 | 31 | class PlaceTreeModelTest : public QObject 32 | { 33 | Q_OBJECT 34 | 35 | private Q_SLOTS: 36 | void init(); 37 | void initTestCase(); 38 | void testListPlaces(); 39 | void testListUrl1(); 40 | 41 | private: 42 | QUrl mUrl1, mUrl2; 43 | QStringList mUrl1Dirs; 44 | QTemporaryDir mTempDir; 45 | }; 46 | 47 | #endif /* PLACETREEMODELTEST_H */ 48 | -------------------------------------------------------------------------------- /tests/auto/recursivedirmodeltest.h: -------------------------------------------------------------------------------- 1 | // vim: set tabstop=4 shiftwidth=4 expandtab: 2 | /* 3 | Gwenview: an image viewer 4 | Copyright 2012 Aurélien Gâteau 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; either version 2 9 | of the License, or (at your option) any later version. 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 | You should have received a copy of the GNU General Public License 17 | along with this program; if not, write to the Free Software 18 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 19 | 20 | */ 21 | #ifndef RECURSIVEDIRMODELTEST_H 22 | #define RECURSIVEDIRMODELTEST_H 23 | 24 | // Local 25 | #include 26 | 27 | // Qt 28 | #include 29 | 30 | class RecursiveDirModelTest : public QObject 31 | { 32 | Q_OBJECT 33 | private Q_SLOTS: 34 | void testBasic_data(); 35 | void testBasic(); 36 | void testSetNewUrl(); 37 | }; 38 | 39 | #endif /* RECURSIVEDIRMODELTEST_H */ 40 | -------------------------------------------------------------------------------- /tests/auto/slidecontainerautotest.h: -------------------------------------------------------------------------------- 1 | // vim: set tabstop=4 shiftwidth=4 expandtab: 2 | /* 3 | Gwenview: an image viewer 4 | Copyright 2011 Aurélien Gâteau 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; either version 2 9 | of the License, or (at your option) any later version. 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 | You should have received a copy of the GNU General Public License 17 | along with this program; if not, write to the Free Software 18 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Cambridge, MA 02110-1301, USA. 19 | 20 | */ 21 | #ifndef SLIDECONTAINERAUTOTEST_H 22 | #define SLIDECONTAINERAUTOTEST_H 23 | 24 | // Local 25 | 26 | // KF 27 | 28 | // Qt 29 | #include 30 | 31 | class SlideContainerAutoTest : public QObject 32 | { 33 | Q_OBJECT 34 | private Q_SLOTS: 35 | void testInit(); 36 | void testSlideIn(); 37 | void testSlideOut(); 38 | void testSlideInDeleteSlideOut(); 39 | void testHiddenContentResize(); 40 | }; 41 | 42 | #endif /* SLIDECONTAINERAUTOTEST_H */ 43 | -------------------------------------------------------------------------------- /tests/auto/sorteddirmodeltest.h: -------------------------------------------------------------------------------- 1 | // vim: set tabstop=4 shiftwidth=4 expandtab: 2 | /* 3 | Gwenview: an image viewer 4 | Copyright 2011 Aurélien Gâteau 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; either version 2 9 | of the License, or (at your option) any later version. 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 | You should have received a copy of the GNU General Public License 17 | along with this program; if not, write to the Free Software 18 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 19 | 20 | */ 21 | #ifndef SORTEDDIRMODELTEST_H 22 | #define SORTEDDIRMODELTEST_H 23 | 24 | // Local 25 | #include 26 | 27 | // Qt 28 | #include 29 | 30 | // std c++ 31 | #include 32 | 33 | class SortedDirModelTest : public QObject 34 | { 35 | Q_OBJECT 36 | private Q_SLOTS: 37 | void initTestCase(); 38 | void testHasDocuments_data(); 39 | void testHasDocuments(); 40 | 41 | private: 42 | TestUtils::SandBoxDir mSandBoxDir; 43 | }; 44 | 45 | #endif /* SORTEDDIRMODELTEST_H */ 46 | -------------------------------------------------------------------------------- /tests/auto/thumbnailprovidertest.h: -------------------------------------------------------------------------------- 1 | /* 2 | Gwenview: an image viewer 3 | Copyright 2007 Aurélien Gâteau 4 | 5 | This program is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU General Public License 7 | as published by the Free Software Foundation; either version 2 8 | of the License, or (at your option) any later version. 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 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 18 | 19 | */ 20 | #ifndef THUMBNAILPROVIDERTEST_H 21 | #define THUMBNAILPROVIDERTEST_H 22 | 23 | // Qt 24 | #include 25 | #include 26 | #include 27 | #include 28 | 29 | class SandBox 30 | { 31 | public: 32 | SandBox(); 33 | void initDir(); 34 | void fill(); 35 | void createTestImage(const QString &name, int width, int height, const QColor &color); 36 | void copyTestImage(const QString &name, int width, int height); 37 | 38 | QHash mSizeHash; 39 | QString mPath; 40 | }; 41 | 42 | class ThumbnailProviderTest : public QObject 43 | { 44 | Q_OBJECT 45 | 46 | private Q_SLOTS: 47 | void init(); 48 | void initTestCase(); 49 | void testLoadLocal(); 50 | void testLoadRemote(); 51 | void testUseEmbeddedOrNot(); 52 | void testRemoveItemsWhileGenerating(); 53 | 54 | private: 55 | SandBox mSandBox; 56 | }; 57 | 58 | #endif // THUMBNAILPROVIDERTEST_H 59 | -------------------------------------------------------------------------------- /tests/auto/timeutilstest.h: -------------------------------------------------------------------------------- 1 | /* 2 | Gwenview: an image viewer 3 | Copyright 2008 Aurélien Gâteau 4 | 5 | This program is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU General Public License 7 | as published by the Free Software Foundation; either version 2 8 | of the License, or (at your option) any later version. 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 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 18 | 19 | */ 20 | #ifndef TIMEUTILSTEST_H 21 | #define TIMEUTILSTEST_H 22 | 23 | // Qt 24 | #include 25 | 26 | class TimeUtilsTest : public QObject 27 | { 28 | Q_OBJECT 29 | 30 | private Q_SLOTS: 31 | void testBasic(); 32 | void testBasic_data(); 33 | void testCache(); 34 | }; 35 | 36 | #endif /* TIMEUTILSTEST_H */ 37 | -------------------------------------------------------------------------------- /tests/auto/transformimageoperationtest.h: -------------------------------------------------------------------------------- 1 | /* 2 | Gwenview: an image viewer 3 | Copyright 2010 Aurélien Gâteau 4 | 5 | This program is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU General Public License 7 | as published by the Free Software Foundation; either version 2 8 | of the License, or (at your option) any later version. 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 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 18 | 19 | */ 20 | #ifndef TRANSFORMIMAGEOPERATIONTEST_H 21 | #define TRANSFORMIMAGEOPERATIONTEST_H 22 | 23 | // Qt 24 | #include 25 | 26 | // Local 27 | #include "../lib/document/document.h" 28 | 29 | class TransformImageOperationTest : public QObject 30 | { 31 | Q_OBJECT 32 | 33 | private Q_SLOTS: 34 | void testRotate90(); 35 | void initTestCase(); 36 | void init(); 37 | }; 38 | 39 | #endif // TRANSFORMIMAGEOPERATIONTEST_H 40 | -------------------------------------------------------------------------------- /tests/auto/urlutilstest.h: -------------------------------------------------------------------------------- 1 | /* 2 | Gwenview: an image viewer 3 | Copyright 2009 Aurélien Gâteau 4 | 5 | This program is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU General Public License 7 | as published by the Free Software Foundation; either version 2 8 | of the License, or (at your option) any later version. 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 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 18 | 19 | */ 20 | #ifndef URLUTILSTEST_H 21 | #define URLUTILSTEST_H 22 | 23 | // Qt 24 | #include 25 | 26 | class UrlUtilsTest : public QObject 27 | { 28 | Q_OBJECT 29 | 30 | private Q_SLOTS: 31 | void testFixUserEnteredUrl(); 32 | void testFixUserEnteredUrl_data(); 33 | }; 34 | 35 | #endif /* URLUTILSTEST_H */ 36 | -------------------------------------------------------------------------------- /tests/data/.gitignore: -------------------------------------------------------------------------------- 1 | # Skip raw data 2 | *.nef 3 | *.CR2 4 | -------------------------------------------------------------------------------- /tests/data/160382_corrupted.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/gwenview/b7d675da69765cde021ee05982ef8e4f904b712c/tests/data/160382_corrupted.jpeg -------------------------------------------------------------------------------- /tests/data/185523_1frame_with_graphic_control_extension.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/gwenview/b7d675da69765cde021ee05982ef8e4f904b712c/tests/data/185523_1frame_with_graphic_control_extension.gif -------------------------------------------------------------------------------- /tests/data/188191_does_not_load.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/gwenview/b7d675da69765cde021ee05982ef8e4f904b712c/tests/data/188191_does_not_load.tga -------------------------------------------------------------------------------- /tests/data/1frame.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/gwenview/b7d675da69765cde021ee05982ef8e4f904b712c/tests/data/1frame.gif -------------------------------------------------------------------------------- /tests/data/1x10k.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/gwenview/b7d675da69765cde021ee05982ef8e4f904b712c/tests/data/1x10k.jpg -------------------------------------------------------------------------------- /tests/data/1x10k.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/gwenview/b7d675da69765cde021ee05982ef8e4f904b712c/tests/data/1x10k.png -------------------------------------------------------------------------------- /tests/data/289819_does_not_load.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/gwenview/b7d675da69765cde021ee05982ef8e4f904b712c/tests/data/289819_does_not_load.png -------------------------------------------------------------------------------- /tests/data/302350_exiv_0.23_exception.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/gwenview/b7d675da69765cde021ee05982ef8e4f904b712c/tests/data/302350_exiv_0.23_exception.jpg -------------------------------------------------------------------------------- /tests/data/40frames.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/gwenview/b7d675da69765cde021ee05982ef8e4f904b712c/tests/data/40frames.gif -------------------------------------------------------------------------------- /tests/data/4frames.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/gwenview/b7d675da69765cde021ee05982ef8e4f904b712c/tests/data/4frames.gif -------------------------------------------------------------------------------- /tests/data/cms/Lower_Left.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/gwenview/b7d675da69765cde021ee05982ef8e4f904b712c/tests/data/cms/Lower_Left.jpg -------------------------------------------------------------------------------- /tests/data/cms/Lower_Right.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/gwenview/b7d675da69765cde021ee05982ef8e4f904b712c/tests/data/cms/Lower_Right.jpg -------------------------------------------------------------------------------- /tests/data/cms/Upper_Left.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/gwenview/b7d675da69765cde021ee05982ef8e4f904b712c/tests/data/cms/Upper_Left.jpg -------------------------------------------------------------------------------- /tests/data/cms/Upper_Right.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/gwenview/b7d675da69765cde021ee05982ef8e4f904b712c/tests/data/cms/Upper_Right.jpg -------------------------------------------------------------------------------- /tests/data/cms/colourTestFakeBRG.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/gwenview/b7d675da69765cde021ee05982ef8e4f904b712c/tests/data/cms/colourTestFakeBRG.png -------------------------------------------------------------------------------- /tests/data/cms/colourTestsRGB.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/gwenview/b7d675da69765cde021ee05982ef8e4f904b712c/tests/data/cms/colourTestsRGB.png -------------------------------------------------------------------------------- /tests/data/date/exif-datetime-only.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/gwenview/b7d675da69765cde021ee05982ef8e4f904b712c/tests/data/date/exif-datetime-only.jpg -------------------------------------------------------------------------------- /tests/data/date/exif-datetimeoriginal.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/gwenview/b7d675da69765cde021ee05982ef8e4f904b712c/tests/data/date/exif-datetimeoriginal.jpg -------------------------------------------------------------------------------- /tests/data/embedded-thumbnail.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/gwenview/b7d675da69765cde021ee05982ef8e4f904b712c/tests/data/embedded-thumbnail.jpg -------------------------------------------------------------------------------- /tests/data/empty.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/gwenview/b7d675da69765cde021ee05982ef8e4f904b712c/tests/data/empty.png -------------------------------------------------------------------------------- /tests/data/fetch_testing_raw.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # This script detects if there is one of wget/curl downloaders availabe and downloads 3 | # three raw files from the digikam's store. 4 | # If there is none of the two present in the system, the script suggests manual download. 5 | 6 | DOWNLOADER="" 7 | 8 | which wget &>/dev/null && DOWNLOADER="wget -O " 9 | [ "$DOWNLOADER" == "" ] && which curl &>/dev/null && DOWNLOADER="curl -o " 10 | 11 | if [ "$DOWNLOADER" != "" ] ; then 12 | echo "Fetching CANON-EOS350D-02.CR2 (1/3)" 13 | $DOWNLOADER CANON-EOS350D-02.CR2 http://digikam3rdparty.free.fr/TEST_IMAGES/RAW/HORIZONTAL/CANON-EOS350D-02.CR2 14 | echo "Fetching dsc_0093.nef (2/3)" 15 | $DOWNLOADER dsc_0093.nef http://digikam3rdparty.free.fr/TEST_IMAGES/RAW/HORIZONTAL/dsc_0093.nef 16 | echo "Fetching dsd_1838.nef (3/3)" 17 | $DOWNLOADER dsd_1838.nef http://digikam3rdparty.free.fr/TEST_IMAGES/RAW/VERTICAL/dsd_1838.nef 18 | else 19 | echo "Unable to detect downloader. Please install one of wget/curl and try again or" 20 | echo "fetch manually the following files:" 21 | echo " http://digikam3rdparty.free.fr/TEST_IMAGES/RAW/HORIZONTAL/CANON-EOS350D-02.CR2" 22 | echo " http://digikam3rdparty.free.fr/TEST_IMAGES/RAW/HORIZONTAL/dsc_0093.nef" 23 | echo " http://digikam3rdparty.free.fr/TEST_IMAGES/RAW/VERTICAL/dsd_1838.nef" 24 | echo "in the tests/data directory." 25 | exit 1 26 | fi 27 | -------------------------------------------------------------------------------- /tests/data/import/pict0001.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/gwenview/b7d675da69765cde021ee05982ef8e4f904b712c/tests/data/import/pict0001.jpg -------------------------------------------------------------------------------- /tests/data/import/pict0002.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/gwenview/b7d675da69765cde021ee05982ef8e4f904b712c/tests/data/import/pict0002.jpg -------------------------------------------------------------------------------- /tests/data/import/pict0003.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/gwenview/b7d675da69765cde021ee05982ef8e4f904b712c/tests/data/import/pict0003.jpg -------------------------------------------------------------------------------- /tests/data/jpg-with-gif-extension.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/gwenview/b7d675da69765cde021ee05982ef8e4f904b712c/tests/data/jpg-with-gif-extension.gif -------------------------------------------------------------------------------- /tests/data/orient1_vflip.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/gwenview/b7d675da69765cde021ee05982ef8e4f904b712c/tests/data/orient1_vflip.jpg -------------------------------------------------------------------------------- /tests/data/orient6-small.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/gwenview/b7d675da69765cde021ee05982ef8e4f904b712c/tests/data/orient6-small.jpg -------------------------------------------------------------------------------- /tests/data/orient6.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/gwenview/b7d675da69765cde021ee05982ef8e4f904b712c/tests/data/orient6.jpg -------------------------------------------------------------------------------- /tests/data/png-with-jpeg-extension.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/gwenview/b7d675da69765cde021ee05982ef8e4f904b712c/tests/data/png-with-jpeg-extension.jpg -------------------------------------------------------------------------------- /tests/data/test.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/gwenview/b7d675da69765cde021ee05982ef8e4f904b712c/tests/data/test.png -------------------------------------------------------------------------------- /tests/data/test.xcf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/gwenview/b7d675da69765cde021ee05982ef8e4f904b712c/tests/data/test.xcf -------------------------------------------------------------------------------- /tests/manual/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | include_directories( 2 | ${gwenview_SOURCE_DIR} 3 | ) 4 | 5 | # SlideContainer 6 | set(slidecontainertest_SRCS 7 | slidecontainertest.cpp 8 | ) 9 | 10 | add_executable(slidecontainertest ${slidecontainertest_SRCS}) 11 | add_dependencies(buildtests slidecontainertest) 12 | ecm_mark_as_test(slidecontainertest) 13 | 14 | target_link_libraries(slidecontainertest 15 | Qt::Test 16 | gwenviewlib) 17 | 18 | # imageloadbench 19 | set(imageloadbench_SRCS 20 | imageloadbench.cpp 21 | ) 22 | 23 | add_executable(imageloadbench ${imageloadbench_SRCS}) 24 | add_dependencies(buildtests imageloadbench) 25 | ecm_mark_as_test(imageloadbench) 26 | 27 | target_link_libraries(imageloadbench 28 | Qt::Test 29 | gwenviewlib) 30 | 31 | # thumbnailgen 32 | set(thumbnailgen_SRCS 33 | thumbnailgen.cpp 34 | ../auto/testutils.cpp # FIXME: Move testutils.cpp to test/ 35 | ) 36 | 37 | add_executable(thumbnailgen ${thumbnailgen_SRCS}) 38 | add_dependencies(buildtests thumbnailgen) 39 | ecm_mark_as_test(thumbnailgen) 40 | 41 | target_link_libraries(thumbnailgen 42 | Qt::Test 43 | gwenviewlib) 44 | -------------------------------------------------------------------------------- /tests/manual/browse.txt: -------------------------------------------------------------------------------- 1 | name: browse/startup_down_sampled 2 | description: 3 | 1. Start Gwenview in a folder with raster images large enough to make use of down-sampling 4 | => thumbnails show 5 | 2. Click one image 6 | => Gwenview switches to View mode and show the image, zoomed-to-fit 7 | 3. Ctrl + left click 8 | => Image zooms in 9 | 10 | name: browse/startup_svg 11 | description: 12 | 1. Start Gwenview in a folder with an svg 13 | => thumbnails show 14 | 2. Click the svg 15 | => Gwenview switches to View mode and show the image, zoomed-to-fit 16 | 3. Ctrl + left click 17 | => Image zooms in -------------------------------------------------------------------------------- /tests/manual/compare.txt: -------------------------------------------------------------------------------- 1 | name: compare/resize 2 | description: 3 | 1. Select two images => images are shown next to each others 4 | 2. Go to fullscreen => images resize to fit the new screen size 5 | 6 | name: compare/view-mode 7 | description: 8 | 1. Select one image in view mode 9 | 2. Show the thumbnail bar 10 | 3. Select another image => images are shown next to each others 11 | -------------------------------------------------------------------------------- /tests/manual/imageloadbench.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | const int ITERATIONS = 2; 10 | const QSize SCALED_SIZE(1280, 800); 11 | 12 | static void bench(QIODevice *device, const QString &outputName) 13 | { 14 | QElapsedTimer chrono; 15 | chrono.start(); 16 | for (int iteration = 0; iteration < ITERATIONS; ++iteration) { 17 | qDebug() << "Iteration:" << iteration; 18 | 19 | device->open(QIODevice::ReadOnly); 20 | QImageReader reader(device); 21 | QSize size = reader.size(); 22 | size.scale(SCALED_SIZE, Qt::KeepAspectRatio); 23 | reader.setScaledSize(size); 24 | QImage img = reader.read(); 25 | device->close(); 26 | 27 | if (iteration == ITERATIONS - 1) { 28 | qDebug() << "time:" << chrono.elapsed(); 29 | img.save(outputName, "png"); 30 | } 31 | } 32 | } 33 | 34 | int main(int argc, char **argv) 35 | { 36 | QCoreApplication app(argc, argv); 37 | if (argc != 2) { 38 | qDebug() << "Usage: imageloadbench "; 39 | return 1; 40 | } 41 | 42 | const QString fileName = QString::fromUtf8(argv[1]); 43 | 44 | QFile file(fileName); 45 | if (!file.open(QIODevice::ReadOnly)) { 46 | qDebug() << QStringLiteral("Could not open '%1'").arg(fileName); 47 | return 2; 48 | } 49 | QByteArray data = file.readAll(); 50 | QBuffer buffer(&data); 51 | 52 | qDebug() << "Using Qt loader"; 53 | bench(&buffer, "qt.png"); 54 | 55 | return 0; 56 | } 57 | --------------------------------------------------------------------------------