commit 6afd9d8dddbe9e450690e05d498a503c00333a5e Author: tpearson Date: Mon Feb 22 19:31:25 2010 +0000 Added KDE3 version of ksquirrel photo manager git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/ksquirrel@1094446 283d02a7-25f6-0310-bc7c-ecb5cbfe19da diff --git a/AUTHORS b/AUTHORS new file mode 100644 index 0000000..07f33c3 --- /dev/null +++ b/AUTHORS @@ -0,0 +1 @@ +Dmitry Baryshev aka Krasu \ No newline at end of file diff --git a/COPYING b/COPYING new file mode 100644 index 0000000..b31bbc9 --- /dev/null +++ b/COPYING @@ -0,0 +1,11 @@ +* KSuirrel is under GNU GENERAL PUBLIC LICENSE (see LICENSE) +* KSquirrel statically links against fmt_filters. See fmt_filters_README for more. +* some functions in SQ_GLWidget (see source code for more) are based on + original code by (C) Guillaume Chazarain in his great GLiv + project (under GPL). +* "broken" pixmap was taken from the "Nuvola" icon theme for KDE. +* SQ_CategoryMenuBrowser is based on PanelBrowserMenu by (C) Matthias Elter + from kde-3.2.3. See ksquirrel/sidebar/sq_categorybrowsermenu.h for more. +* documenation for KSquirrel is under GFDL, see LICENSE.GFDL +* some files in admin/ are under LGPL, see LICENSE.LGPL +* SQ_GLU namespace is under LGPL, see LICENSE.LGPL \ No newline at end of file diff --git a/ChangeLog b/ChangeLog new file mode 100644 index 0000000..6217287 --- /dev/null +++ b/ChangeLog @@ -0,0 +1,555 @@ +ksquirrel-0.8.0 and ksquirrel-libs-0.8.0 +**************************************** +* new runtime options: + --nodirectorybasket + --noimagebasket + --nocategories + --nomountview +* added Konqueror intergation module +* added printing feature in image window +* added codec manager, which will allow to + enable/disable image codecs (requires root password) +* fixed licensing issues in source code +* fixed MIME types in .desktop files +* time counting in image window is more fair + +ksquirrel-libs: +* added EPS, PSP +* bugfix in PNM decoder on P3 PNMs +* bugfix in CAMERA codec, when KSquirrel couldn't open raw fotos + +ksquirrel-0.7.5 +**************** +* more bugfixes in tabs +* more improvements in selection rectangle in image window +* selection rectangle is now drawn by OpenGL +* saving to clipboard now doesn't mix red and blue channels +* other small bugfixes +* added translations: Turkish, Polish, Italian, British, Ukranian, Czech + +ksquirrel-0.7.4 (bugfix release) +******************************** +* filtering and color balance in image window doesn't loose rotation angle +* saving in image window doesn't loose rotation angle (flipping is still lost) +* prevent autoresizing when tab count is 1 +* external tools for non-local URLs now work + (but not all programs accepts URLs, GQview for example) +* external tools in image window now don't depend on navigator +* navigator now has focus at startup +* slider is changed when switching between tabs + +ksquirrel-0.7.3 and ksquirrel-libs-0.7.3 +***************************************** +* command line arguments now work better +* improvements in preview window +* cusomizable double click in image window +* select a region in image window and press Y to crop image +* added tabs in image window (off by default) with Opera-like navigation +* 100% zoom now doesn't use linear interpolation + (image is displayed "as is") +* added service menu for Dolphin +* added German translation + +ksquirrel-libs: +* added DDS +* JPEG2000 decoder is much faster now + +ksquirrel-0.7.2 +**************** +* lazy thumbnail generation now can generate additional rows +* improvements in treeview +* F10 to repeat last operation with selected files (copy/move/link) +* it is highly recommended that you won't have FAM running, + see http://oss.sgi.com/bugzilla/show_bug.cgi?id=158 for more +* Added folder basket + +ksquirrel-libs: +* SVG codec now uses rsvg-convert +* fixed segfault in GIF codec (in rare cases) +* added DICOM (requires medcon) +* added APNG (see http://wiki.mozilla.org/APNG_Specification, http://en.wikipedia.org/wiki/APNG) + +ksquirrel-0.7.1try5 +********************* +* lazy thumbnail generation (like in DigiKam) +* single click to highlight file, double click + to open +* drag operation now can show number of dragged files + and first two thumbnails +* fixed problems with file naming in converter and image window + +ksquirrel-0.7.1try4 +********************* +* thumbnail loader now uses EXIF thumbnails if present +* thumbnail rotation using exif +* small fixes in thumbnail loader +* small fixes thumbnail cache master + +ksquirrel-0.7.1try3 +******************** +* context menu in folder tree +* folder tree now accepts drops +* previous directory now selected during navigating +* current page in sidebar is now saved +* "Show hidden files" is also saved +* Sorting order is also saved :) + +ksquirrel-0.7.1 and ksquirrel-libs-0.7.1 +****************************************** + +ksquirrel: +* context menu in file manager now have proper content (it worked in KDE 3.3, but in 3.5 it didn't) +* kio-slaves support (including smb:/, tar:/ etc.) +* archive extractor now uses kio-slaves (see previous). In general, it supports + zip, ar, tar.gz, tar.bz2, iso, rar, 7zip. To add support of rar and 7zip please install + kio_rar and kio_p7zip (search http://kde-apps.org) +* thumbnail creation on non-local filesystems (for ex. smb:/ or tar:/) +* statusbar improvements +* hotkeys in image window now don't depend on current keyboard layout +* history combobox now shows mime types +* bugfixes in slideshow +* new thumbnails' cache directory. Please remove old thumbnails from ~/.ksquirrel/thumbnails +* image rotation using EXIF in thumbnail loader and image viewer +* KIPI plugins now could be loaded on demand +* F2 to rename files +* thumbnail loader now corresponds thumbnail spec from freedesktop.org +* other small bugfixes + +ksquirrel-libs: +* added XFIG (transfig package is required) +* added Degas PI3 +* TTF codec is designed for freetype 2.2.1 (it should work at least in Debian Etch) +* CAMERA codec now uses dcraw v8.77 without modifications, which doesn't violate dcraw license +* bugfixes in scripts + +ksquirrel-0.7.0try5 +********************* +* navigator is now hidden when running with file argument + +ksquirrel-0.7.0try4 +********************* +* fixed file selection when passing filename through command line + +ksquirrel-0.7.0try3 +********************* +* animated widget in toolbar now can be disabled (Options->Main) +* splash screen security improvements + +ksquirrel-0.7.0try2 +********************* +* file path via command line parameter now works, e.g. + # ksquirrel /home/me/1.png +* new autoconf test for OpenGL +* small fix in image window toolbar (in 'Selection' popup menu) +* fixed toolbar height in image window + +ksquirrel-0.7.0 and ksquirrel-libs-0.7.0 +******************************************** + +ksquirrel: +* filtering using selection is now available in image window +* fixed flicker of thumbnail loading progressbar +* fixed segfault on directory execution with "Return" button +* RAR archives are now supported ("unrar" program is required) +* fixed -l option +* fixed crashing when no image plugins were found + +ksquirrel-0.7.0-pre2 and ksquirrel-libs-0.7.0-pre2 +******************************************** + +This is last preview release. + +ksquirrel: +* multiple directory view: Shift+click to recursively toggle current + item and all subitems; Ctrl+click to recursively set current + item and all subitems on; Alt+click to recursively set current + item and all subitems off +* GQView mode removed till better times +* added preview widget +* new slideshow +* bugfixes in slideshow mechanism +* bugfix in mouse clicking (in list view and icon view) +* current image now can be filtered (filetring using current selection will be available in 0.7.0) + +ksquirrel-libs: +* added IFF, MAC, PICT, PI1, XIM, UTAH, LEAF, NEO (via NetPBM package) +* small fix in configure.ac + +ksquirrel-0.7.0-pre1 and ksquirrel-libs-0.7.0-pre1 +******************************************** +ksquirrel: +* added KIPI support +* multiple directory view +* automatic image fit in image window +* some codecs now have options (DjVu, SVG, CAMERA...). Visit Plugins information dialog. +* edit tools removed. use KIPI instead :) Convertion tool is still available +* current image can be placed to clipboard +* current images can be "saved as..." +* bugfixes in "GQView" mode +* mount view now can mount/unmount +* thumbnail loading now ~15% faster +* improvements in interface switching +* sidebar: added image basket +* sidebar: removed file actions (use context menu in navigator) +* new DCOP parameters, see README +* bugfixes + +ksquirrel-libs: +* fixed segfault on GIF and some other libraries on some systems +* CAMERA codec now uses dcraw 8.61 +* added settings support to CAMERA, SVG +* added DjVu (just single page via settings). +* added AutoCAD DXF (+settings) +* added GIMP XCF (+settings) +* small fixes in configure script +* configure output now more informatible + +ksquirrel-0.6.3 and ksquirrel-libs-0.6.3 +******************************************** + +ksquirrel: +* interface improvements, now KSquirrel can look like GQview +* small fix in reloading libraries from disk +* added categories + +ksquirrel-0.6.2 and ksquirrel-libs-0.6.2 +******************************************** +ksquirrel and ksquirrel-libs now should correspond Debian policy. + +ksquirrel-libs: +* some changes in API + +ksquirrel: +* fixed segfault if the file format is not supported +* new option: "Don't show tooltips when the main window is inactive" +* "L" key ("Ignore, if the image is less than window") in image window now works +* added Russian handbook +* single-page images now eat less memory + +ksquirrel-0.6.1: bugfix release, minor changes +***************************************************** + +ksquirrel: +* updated .desktop files. MIME types inserted. +* "Nice" zoom now default zoom type +* "OpenGL information" moved to separate dialog +* "./configure.gnu --disable-ksmall" to disable ksquirrel-small in compile time +* small fix in rotate dialog, pixmap now erased correctly + +ksquirrel-libs: +* some codecs are disabled as buggy (use --enable-devel to enable them) +* ksquirrel-libs now installs development library and header files. Now ksquirel-libs + must be installed BEFORE KSquirrel. +* updated documentation + +ksquirrel-0.6.0-final and ksquirrel-libs-0.6.0-final +************************************************************ + +ksquirrel: +* small fix in animating mechanism +* fixed F1/F4 bug in image window (only in pre9) +* fixed small memory leak +* closing image window now stops slideshow (if running) +* fixed flicker in image window in fullscreen state with hidden toolbar +* help widget now saves current page +* fixes in help widget +* If the image is broken, "broken" image will appear (like in GQview) +* image window: right click = context menu, middle click = toggle fullscreen, + left click = start drag, left click+SHIFT = select zoom area +* small fix in maximum/minimum zoom +* improved Xinerama support (I hope) +* small improvements in file manager +* added new options: + - show images progressively + - hide toolbar in fullscreen + - ability to choose number of image pages to be loaded (in edit tools too) +* added sidebar with + - file/image actions + - file tree + - view of currently mounted partitions +* small memory optimizations in file manager +* changing thumbnails' size now a little bit faster +* fixed small bug in DCOP connection, which could cause strange behaviour of file manager +* menu layout changes +* small fix in version checker +* small fix in setting background image in image window +* new toolbar in image window +* fixes in external tools +* saving geometry now works properly +* CTRL+T to recreate selected thumbnails + bugfixes +* code cleanups, comments + +ksquirrel-libs: +* SVG: added ".svgz" extension +* MNG: small fix in data types +* KOALA: small fix in bitdepth (bitdepth was always '0') + +ksquirrel-0.6.0-pre9 and ksquirrel-libs 0.6.0-pre9 +************************************************************ + +ksquirrel: +* small fixes in manual pages +* library loader now doesn't check +x permissions +* --enable-final for configure now works +* ksquirrel-small: bugfixes +* filter tool: added red-eye removal +* filter tool: small fix in pixmap updating +* edit tools: improvements in preview image +* edit tools: small fix with alpha channel for preview image +* experimental "Nice zoom" ('N' to toggle) +* new toolbar in image window +* improvements in loading mechanism, now KSquirrel will store only ONE frame in video memory. Is doesn't depend on whether image is animated or not +* ksquirrel-small now doesn't share settings with KSquirrel, but some settings (like zoom limit, background color etc. are still shared (and read-only)) +* fixed small memory leak +* code cleanups + +ksquirrel-libs: +* XCUR: fixed segfault +* PNM: small fix (on pgm images) +* SGI: small improvements +* CAMERA: new file extensions added +* added font support (ttf, pfa, pfb...) +* added MNG, JNG (reading) +* added PXR (reading) +* added JBIG (slow, reading)) +* code cleanups +* no more static libraries. Now SVG, GIF, OPENEXR, WMF and JPEG2000 are optional. +[from 0.6.0-pre8 u1 + new ones] +* new options for configure script: + --disable-gif + --disable-camera + --disable-wmf + --disable-svg + --disable-openexr + --disable-jpeg2000 + --disable-mng + --disable-ttf + +ksquirrel-0.6.0-pre8 and ksquirrel-libs 0.6.0-pre7 +************************************************************ + +ksquirrel: +* edit tools: fixed bug in writing images +* edit tools: preview image now works +* edit tools: new writing options +* filter tool: added 20 filters +* resize tool: removed all previous resize methods, added new ones: Box, Triangle, Bell, B-Spline, Lanczos3, Mitchell +* some interface changes in filter tool +* code cleanups +* source code now hardly commented +* added man page +* added new binary: ksquirrel-small. It is "light" version of KSquirrel - without filemanager, External tools, Filters, + Edit tools etc. It takes only one command line argument - path to file. For example: + +[localhost@krasu]$ ksquirrel-small /mnt/c/images/cat.png + +ksquirrel-libs: +* internal changes + +ksquirrel-0.6.0-pre7 and ksquirrel-libs-0.6.0-pre6 +************************************************************ + +ksquirrel: +* fixed segfault when printing multipaged images +* fixed small bug in "Recreate selected thumbnails" action in thumbnail view +* fixed wrong header naming in "External tools" menu +* fixed small bug in print tool, in "Alignment" frame +* fixed bug with size() of version checker +* fixed compile problems on some Qt versions, which don't support STL (like Slackware's one) +* added filter tool (only "Negative" and "swap RGB" are currently supported, new filters coming soon) +* added slideshow and advanced slideshow (Ctrl+S, Ctrl+Alt+S) +* added mc-like file selection with '+' and '-' +* added "Select All" and "Deselect" actions in menu +* added some new options +* added unique application support (KSquirrel now can have only one running instance) +* print tool: "Custom fill" now works +* print tool: added transparency support +* now you needn't delete old config file - KSquirrel will do it for you +* edit tools now look like simple wizards (hope TiamaT will draw new squirrels soon...) +* libraries information was moved from Options to "Plugins information" dialog +* some menu layout changes +* code cleanups + +ksquirrel-libs: +* some changes in API +* added MTV Ray-Tracer (reading, writing) +* added AVS X (reading, writing) +* added PNM (writing) +* LIF: many bugfixes +* SVG: removed useless "-lfontconfig" dependency, which could create compile problems on some systems (like Slackware) +* PNG: fixed autoconf problems on some systems (like Slackware) + +ksquirrel-0.6.0-pre6 and ksquirrel-libs-0.6.0-pre5 +************************************************************ + +ksquirrel: +* resize tool now works (four resize methods: nearest, bilinear, tiles, hyper) +* colorize tool now works +* rotate tool now works (has some small bugs in algorithm) +* print tool now partially works (only "One image per one page") + +ksquirrel-libs: +* added JPEG2000 (reading) +* added OpenEXR (reading) +* added Quake2 WAL texture (reading) +* added HalfLife model (reading) +* added KOALA (reading) +* added HDR (reading) +* added LIF (reading) +* added SCT (reading) +* CUT decoder now not-alpha + +ksquirrel-0.6.0-pre5 +************************************************************ + +ksquirrel: +* added DCOP interface, which was removed in early 0.2.8 :) Check README for list of parameters +* new version checker (old one removed) + + +ksquirrel-0.6.0-pre4 +************************************************************ + +ksquirrel: +* new autoconf test for GL library. old one could fail on some systems. +* image window: some changes in toolbar and context menu. + + +ksquirrel-0.6.0-pre3 +************************************************************ + +ksquirrel: +* small fix in tootips for thumbnails +* small fix in toolbar in image window +* some changes in main toolbar +* resize, rotate, colorize and print tools are available in preview mode + (will read, but won't write images) +* added thumbnail cache manipulator + +ksquirrel-libs: +* some changes in API. pre2 and pre3 are not compatible. +* added SVG (reading, requires libxml2, freetype) +* TGA: small fix (in v0.7.1 flipping was ON by default, in v0.7.2 flipping is determined by image header) +* XPM: small fix in decoding mechanism +* new mime icons + + +ksquirrel-0.6.0-pre2 +************************************************************ + +* please, remove old config file ~/.kde/share/config/ksquirrelrc and old libraries before installation +* some changes in thumbnail view + +ksquirrel-libs: +* changed library path /usr/lib/squirrel =>/usr/lib/ksquirrel-libs +* fully migrated to C++ (stdc++) +* added WMF (reading) +* added SUN Icon (reading) +* added WBMP (reading) +* added TIFF (writing) +* added photos from different cameras (CRW, ...) +* added some examples (QT, QT+OpenGL) + + +ksquirrel-0.6.0-pre1 +************************************************************ + +* moved back to Right Click = mouse selection, Middle Click = context menu +* added file actions in Navigator - Copy, Paste, Cut, etc. +* added -t option: find all supported images and create thumbnails. For example + # ksquirrel -t /home/ckult/images/ +* "External Tools" now based on .desktop files +* fixed crashing when command line is not empty +* improved Drag'n'Drop support +* image converter now available (select files and press Ctrl+K), but not all libraries support write functions + +ksquirrel-libs: +* added interface for write functions +* added write features for PNG, JPEG, BMP +* PNG: fixed problems with interlaced images, fixed memory leak +* XPM: fixed problems with multiline comments +* ICO: added support of bit depth 24 and 32 +* PSD: fixed problems with RGB images, that have 3 channels instead of 4 +* GIF: added comments support (comment extensions) +* PNM: fixed problems with Windows-like line breaks (\r\n) + + +ksquirrel-0.5.0(final) +****************************************************************** + +* added nice tickmarks around the image (press K to toggle) +* Middle click (or 'M') for context menu +* F5 to recreate selected thumbnails + +* fixed little repainting problem +* fixed startup problem, if /usr/lib/squirrel doesn't exist. +* fixed problem with making image window built-in/separate +* fixed small problem with decoding corrupted files + +ksquirrel-libs: +* GIF decoder is much better now (fixed problems with transparency) +* added X cursors +* added PSD(RGB,CMYK,Grayscale,Indexed) +* added FLI Animation +* added thumbnail generator for FLI, GIF +* small fixes in PNM, BMP libraries + + +ksquirrel-0.5.0-preview4 +****************************************************************** + +critical/important: +* fixed crushing on item execution (SIGALRM signal, or "Alarm clock") +* fixed awful lines (http://ksquirrel.sf.net/IMG/errors.png) +* support of multipaged images (GIF, ICO, etc.) +* Now my e-mail is ksquirrel at tut.by +* moved back to PNG thumbnails. Please, rm -rf ~/.ksquirrel/thumbnails/ + +ksquirrel-libs: +* GIF (beta, including animated) +* interlaced PNG's +* fixed random crushing on some PNGs +* about 15 formats are done + +other: +* some interface improvements +* improvements in 'Image Properties' +* new 'fullscreen' method (KDE-related) +* "Quick Browser" now can be moved and resized +* other small fixes + +>>> Remember that ksquirrel-libs-0.5.0-pre3 and pre4 ARE NOT compatible! + + +ksquirrel-0.5.0-preview3 for KDE 3.2 and JPEG library for preview3 +****************************************************************** + +Please be patient - preview3 contains only one library, anyway, it's just a preview. + +>> critical or important: +* fixed wrong displaying of huge images (more than 2048x2048); now doesn't depend on GL_MAX_TEXTURE_SIZE =) +* fixed crashing on thumbnail view +* fixed awful memory leak, shame on myself !! =) +* moved to JPEG thumbnails (remove old ones from ~/.ksquirrel/thumbnails !) +* detecting images by content (like Trolltech's QImage) +* removed "Look like ..." - useless stuff +* please check README for new keyboard shortcuts. + +>> other: +* now "make -f Makefile.dist" to recreate configure and other scripts +* configure was generated with autoconf 2.59, Makefiles - with automake 1.8.5 +* fixed wrong url selection in treeview +* fixed wrong gridX value selection in SQ_FileThumbView +* fixed wrong filter selection on startup +* added library's filters support +* added pending thumbnails (sand-glass) +* added extended thumbnails +* added configurable zoom limit +* added tooltips with thumbnail info +* double click in Navigator opens current url in default browser +* image displaying is now faster +* determining archives by MIME, not by extension (._zip wasn't been handled :-(( ) +* some changes in 'Options' dialog +* removed GL_LINEAR filter due to new displaying alghoritm +* other small fixes. + diff --git a/Doxyfile b/Doxyfile new file mode 100644 index 0000000..c627edd --- /dev/null +++ b/Doxyfile @@ -0,0 +1,275 @@ +# Doxyfile 1.4.1-KDevelop + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- +PROJECT_NAME = ksquirrel.kdevelop +PROJECT_NUMBER = +OUTPUT_DIRECTORY = +CREATE_SUBDIRS = NO +OUTPUT_LANGUAGE = English +USE_WINDOWS_ENCODING = NO +BRIEF_MEMBER_DESC = YES +REPEAT_BRIEF = YES +ABBREVIATE_BRIEF = "The $name class" \ + "The $name widget" \ + "The $name file" \ + is \ + provides \ + specifies \ + contains \ + represents \ + a \ + an \ + the +ALWAYS_DETAILED_SEC = NO +INLINE_INHERITED_MEMB = NO +FULL_PATH_NAMES = YES +STRIP_FROM_PATH = /home/ckult/MyProjects/kdev3/debug/src/ +STRIP_FROM_INC_PATH = +SHORT_NAMES = NO +JAVADOC_AUTOBRIEF = NO +MULTILINE_CPP_IS_BRIEF = NO +DETAILS_AT_TOP = NO +INHERIT_DOCS = YES +DISTRIBUTE_GROUP_DOC = NO +TAB_SIZE = 8 +ALIASES = +OPTIMIZE_OUTPUT_FOR_C = NO +OPTIMIZE_OUTPUT_JAVA = NO +SUBGROUPING = YES +#--------------------------------------------------------------------------- +# Build related configuration options +#--------------------------------------------------------------------------- +EXTRACT_ALL = NO +EXTRACT_PRIVATE = NO +EXTRACT_STATIC = NO +EXTRACT_LOCAL_CLASSES = YES +EXTRACT_LOCAL_METHODS = NO +HIDE_UNDOC_MEMBERS = NO +HIDE_UNDOC_CLASSES = NO +HIDE_FRIEND_COMPOUNDS = NO +HIDE_IN_BODY_DOCS = NO +INTERNAL_DOCS = NO +CASE_SENSE_NAMES = YES +HIDE_SCOPE_NAMES = NO +SHOW_INCLUDE_FILES = YES +INLINE_INFO = YES +SORT_MEMBER_DOCS = YES +SORT_BRIEF_DOCS = NO +SORT_BY_SCOPE_NAME = NO +GENERATE_TODOLIST = YES +GENERATE_TESTLIST = YES +GENERATE_BUGLIST = YES +GENERATE_DEPRECATEDLIST= YES +ENABLED_SECTIONS = +MAX_INITIALIZER_LINES = 30 +SHOW_USED_FILES = YES +SHOW_DIRECTORIES = YES +FILE_VERSION_FILTER = +#--------------------------------------------------------------------------- +# configuration options related to warning and progress messages +#--------------------------------------------------------------------------- +QUIET = NO +WARNINGS = YES +WARN_IF_UNDOCUMENTED = YES +WARN_IF_DOC_ERROR = YES +WARN_NO_PARAMDOC = NO +WARN_FORMAT = "$file:$line: $text" +WARN_LOGFILE = +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- +INPUT = /home/krasu/MyProjects/ksquirrel +FILE_PATTERNS = *.c \ + *.cc \ + *.cxx \ + *.cpp \ + *.c++ \ + *.java \ + *.ii \ + *.ixx \ + *.ipp \ + *.i++ \ + *.inl \ + *.h \ + *.hh \ + *.hxx \ + *.hpp \ + *.h++ \ + *.idl \ + *.odl \ + *.cs \ + *.php \ + *.php3 \ + *.inc \ + *.m \ + *.mm \ + *.dox \ + *.C \ + *.CC \ + *.C++ \ + *.II \ + *.I++ \ + *.H \ + *.HH \ + *.H++ \ + *.CS \ + *.PHP \ + *.PHP3 \ + *.M \ + *.MM \ + *.C \ + *.H \ + *.tlh \ + *.diff \ + *.patch \ + *.moc \ + *.xpm \ + *.dox +RECURSIVE = yes +EXCLUDE = +EXCLUDE_SYMLINKS = NO +EXCLUDE_PATTERNS = +EXAMPLE_PATH = +EXAMPLE_PATTERNS = * +EXAMPLE_RECURSIVE = NO +IMAGE_PATH = +INPUT_FILTER = +FILTER_PATTERNS = +FILTER_SOURCE_FILES = NO +#--------------------------------------------------------------------------- +# configuration options related to source browsing +#--------------------------------------------------------------------------- +SOURCE_BROWSER = NO +INLINE_SOURCES = NO +STRIP_CODE_COMMENTS = YES +REFERENCED_BY_RELATION = YES +REFERENCES_RELATION = YES +VERBATIM_HEADERS = YES +#--------------------------------------------------------------------------- +# configuration options related to the alphabetical class index +#--------------------------------------------------------------------------- +ALPHABETICAL_INDEX = NO +COLS_IN_ALPHA_INDEX = 5 +IGNORE_PREFIX = +#--------------------------------------------------------------------------- +# configuration options related to the HTML output +#--------------------------------------------------------------------------- +GENERATE_HTML = YES +HTML_OUTPUT = html +HTML_FILE_EXTENSION = .html +HTML_HEADER = +HTML_FOOTER = +HTML_STYLESHEET = +HTML_ALIGN_MEMBERS = YES +GENERATE_HTMLHELP = NO +CHM_FILE = +HHC_LOCATION = +GENERATE_CHI = NO +BINARY_TOC = NO +TOC_EXPAND = NO +DISABLE_INDEX = NO +ENUM_VALUES_PER_LINE = 4 +GENERATE_TREEVIEW = NO +TREEVIEW_WIDTH = 250 +#--------------------------------------------------------------------------- +# configuration options related to the LaTeX output +#--------------------------------------------------------------------------- +GENERATE_LATEX = YES +LATEX_OUTPUT = latex +LATEX_CMD_NAME = latex +MAKEINDEX_CMD_NAME = makeindex +COMPACT_LATEX = NO +PAPER_TYPE = a4wide +EXTRA_PACKAGES = +LATEX_HEADER = +PDF_HYPERLINKS = NO +USE_PDFLATEX = NO +LATEX_BATCHMODE = NO +LATEX_HIDE_INDICES = NO +#--------------------------------------------------------------------------- +# configuration options related to the RTF output +#--------------------------------------------------------------------------- +GENERATE_RTF = NO +RTF_OUTPUT = rtf +COMPACT_RTF = NO +RTF_HYPERLINKS = NO +RTF_STYLESHEET_FILE = +RTF_EXTENSIONS_FILE = +#--------------------------------------------------------------------------- +# configuration options related to the man page output +#--------------------------------------------------------------------------- +GENERATE_MAN = NO +MAN_OUTPUT = man +MAN_EXTENSION = .3 +MAN_LINKS = NO +#--------------------------------------------------------------------------- +# configuration options related to the XML output +#--------------------------------------------------------------------------- +GENERATE_XML = yes +XML_OUTPUT = xml +XML_SCHEMA = +XML_DTD = +XML_PROGRAMLISTING = YES +#--------------------------------------------------------------------------- +# configuration options for the AutoGen Definitions output +#--------------------------------------------------------------------------- +GENERATE_AUTOGEN_DEF = NO +#--------------------------------------------------------------------------- +# configuration options related to the Perl module output +#--------------------------------------------------------------------------- +GENERATE_PERLMOD = NO +PERLMOD_LATEX = NO +PERLMOD_PRETTY = YES +PERLMOD_MAKEVAR_PREFIX = +#--------------------------------------------------------------------------- +# Configuration options related to the preprocessor +#--------------------------------------------------------------------------- +ENABLE_PREPROCESSING = YES +MACRO_EXPANSION = NO +EXPAND_ONLY_PREDEF = NO +SEARCH_INCLUDES = YES +INCLUDE_PATH = +INCLUDE_FILE_PATTERNS = +PREDEFINED = +EXPAND_AS_DEFINED = +SKIP_FUNCTION_MACROS = YES +#--------------------------------------------------------------------------- +# Configuration::additions related to external references +#--------------------------------------------------------------------------- +TAGFILES = +GENERATE_TAGFILE = ksquirrel.tag +ALLEXTERNALS = NO +EXTERNAL_GROUPS = YES +PERL_PATH = /usr/bin/perl +#--------------------------------------------------------------------------- +# Configuration options related to the dot tool +#--------------------------------------------------------------------------- +CLASS_DIAGRAMS = YES +HIDE_UNDOC_RELATIONS = YES +HAVE_DOT = NO +CLASS_GRAPH = YES +COLLABORATION_GRAPH = YES +GROUP_GRAPHS = YES +UML_LOOK = NO +TEMPLATE_RELATIONS = NO +INCLUDE_GRAPH = YES +INCLUDED_BY_GRAPH = YES +CALL_GRAPH = NO +GRAPHICAL_HIERARCHY = YES +DIRECTORY_GRAPH = YES +DOT_IMAGE_FORMAT = png +DOT_PATH = +DOTFILE_DIRS = +MAX_DOT_GRAPH_WIDTH = 1024 +MAX_DOT_GRAPH_HEIGHT = 1024 +MAX_DOT_GRAPH_DEPTH = 1000 +DOT_TRANSPARENT = NO +DOT_MULTI_TARGETS = NO +GENERATE_LEGEND = YES +DOT_CLEANUP = YES +#--------------------------------------------------------------------------- +# Configuration::additions related to the search engine +#--------------------------------------------------------------------------- +SEARCHENGINE = NO diff --git a/INSTALL b/INSTALL new file mode 100644 index 0000000..2f9fbc6 --- /dev/null +++ b/INSTALL @@ -0,0 +1,47 @@ +To compile KSquirrel from sources you need to install kde-devel package. +It will install all needed header files. In Mandriva or same systems +you should also install kdebase-devel package. + +In Debian do + +# apt-get install kde-devel + +Then follow the installation instructions: + +1. First install 'ksquirrel-libs' package: + + a) from sources + # tar jxfv ksquirrel-libs-0.8.0.tar.bz2 + # cd ksquirrel-libs-0.8.0/ + * # su -c './required-etch' + # ./configure.gnu + # make + # su -c 'make install' + + b) from binary packages +RPM # rpm -ihv ksquirrel-libs-0.8.0.rpm +TGZ # installpkg ksquirrel-libs-0.8.0.tgz +DEB # dpkg -i ksquirrel-libs-0.8.0.deb + +2. Now install KSquirrel: + + a) from sources + # tar jxfv ksquirrel-0.8.0.tar.bz2 + # cd ksquirrel-0.8.0/ + * # su -c './required-etch' + # ./configure.gnu + # make + # su -c 'make install' + +* For Debian Etch and Ubuntu Feisty only. + This will install all required packages with aptitude. + + b) from binary packages +RPM # rpm -ihv ksquirrel-0.8.0.rpm +TGZ # installpkg ksquirrel-0.8.0.tgz +DEB # dpkg -i ksquirrel-0.8.0.deb + +------------------------------------------------------------ + +Note: You can pass all regular 'configure' options to configure.gnu. +Note: You needn't specify --prefix, it's already done in configure.gnu. diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..c13faf0 --- /dev/null +++ b/LICENSE @@ -0,0 +1,340 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Library General +Public License instead of this License. diff --git a/LICENSE.GFDL b/LICENSE.GFDL new file mode 100644 index 0000000..4a0fe1c --- /dev/null +++ b/LICENSE.GFDL @@ -0,0 +1,397 @@ + GNU Free Documentation License + Version 1.2, November 2002 + + + Copyright (C) 2000,2001,2002 Free Software Foundation, Inc. + 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + +0. PREAMBLE + +The purpose of this License is to make a manual, textbook, or other +functional and useful document "free" in the sense of freedom: to +assure everyone the effective freedom to copy and redistribute it, +with or without modifying it, either commercially or noncommercially. +Secondarily, this License preserves for the author and publisher a way +to get credit for their work, while not being considered responsible +for modifications made by others. + +This License is a kind of "copyleft", which means that derivative +works of the document must themselves be free in the same sense. It +complements the GNU General Public License, which is a copyleft +license designed for free software. + +We have designed this License in order to use it for manuals for free +software, because free software needs free documentation: a free +program should come with manuals providing the same freedoms that the +software does. But this License is not limited to software manuals; +it can be used for any textual work, regardless of subject matter or +whether it is published as a printed book. We recommend this License +principally for works whose purpose is instruction or reference. + + +1. APPLICABILITY AND DEFINITIONS + +This License applies to any manual or other work, in any medium, that +contains a notice placed by the copyright holder saying it can be +distributed under the terms of this License. Such a notice grants a +world-wide, royalty-free license, unlimited in duration, to use that +work under the conditions stated herein. The "Document", below, +refers to any such manual or work. Any member of the public is a +licensee, and is addressed as "you". You accept the license if you +copy, modify or distribute the work in a way requiring permission +under copyright law. + +A "Modified Version" of the Document means any work containing the +Document or a portion of it, either copied verbatim, or with +modifications and/or translated into another language. + +A "Secondary Section" is a named appendix or a front-matter section of +the Document that deals exclusively with the relationship of the +publishers or authors of the Document to the Document's overall subject +(or to related matters) and contains nothing that could fall directly +within that overall subject. (Thus, if the Document is in part a +textbook of mathematics, a Secondary Section may not explain any +mathematics.) The relationship could be a matter of historical +connection with the subject or with related matters, or of legal, +commercial, philosophical, ethical or political position regarding +them. + +The "Invariant Sections" are certain Secondary Sections whose titles +are designated, as being those of Invariant Sections, in the notice +that says that the Document is released under this License. If a +section does not fit the above definition of Secondary then it is not +allowed to be designated as Invariant. The Document may contain zero +Invariant Sections. If the Document does not identify any Invariant +Sections then there are none. + +The "Cover Texts" are certain short passages of text that are listed, +as Front-Cover Texts or Back-Cover Texts, in the notice that says that +the Document is released under this License. A Front-Cover Text may +be at most 5 words, and a Back-Cover Text may be at most 25 words. + +A "Transparent" copy of the Document means a machine-readable copy, +represented in a format whose specification is available to the +general public, that is suitable for revising the document +straightforwardly with generic text editors or (for images composed of +pixels) generic paint programs or (for drawings) some widely available +drawing editor, and that is suitable for input to text formatters or +for automatic translation to a variety of formats suitable for input +to text formatters. A copy made in an otherwise Transparent file +format whose markup, or absence of markup, has been arranged to thwart +or discourage subsequent modification by readers is not Transparent. +An image format is not Transparent if used for any substantial amount +of text. A copy that is not "Transparent" is called "Opaque". + +Examples of suitable formats for Transparent copies include plain +ASCII without markup, Texinfo input format, LaTeX input format, SGML +or XML using a publicly available DTD, and standard-conforming simple +HTML, PostScript or PDF designed for human modification. Examples of +transparent image formats include PNG, XCF and JPG. Opaque formats +include proprietary formats that can be read and edited only by +proprietary word processors, SGML or XML for which the DTD and/or +processing tools are not generally available, and the +machine-generated HTML, PostScript or PDF produced by some word +processors for output purposes only. + +The "Title Page" means, for a printed book, the title page itself, +plus such following pages as are needed to hold, legibly, the material +this License requires to appear in the title page. For works in +formats which do not have any title page as such, "Title Page" means +the text near the most prominent appearance of the work's title, +preceding the beginning of the body of the text. + +A section "Entitled XYZ" means a named subunit of the Document whose +title either is precisely XYZ or contains XYZ in parentheses following +text that translates XYZ in another language. (Here XYZ stands for a +specific section name mentioned below, such as "Acknowledgements", +"Dedications", "Endorsements", or "History".) To "Preserve the Title" +of such a section when you modify the Document means that it remains a +section "Entitled XYZ" according to this definition. + +The Document may include Warranty Disclaimers next to the notice which +states that this License applies to the Document. These Warranty +Disclaimers are considered to be included by reference in this +License, but only as regards disclaiming warranties: any other +implication that these Warranty Disclaimers may have is void and has +no effect on the meaning of this License. + + +2. VERBATIM COPYING + +You may copy and distribute the Document in any medium, either +commercially or noncommercially, provided that this License, the +copyright notices, and the license notice saying this License applies +to the Document are reproduced in all copies, and that you add no other +conditions whatsoever to those of this License. You may not use +technical measures to obstruct or control the reading or further +copying of the copies you make or distribute. However, you may accept +compensation in exchange for copies. If you distribute a large enough +number of copies you must also follow the conditions in section 3. + +You may also lend copies, under the same conditions stated above, and +you may publicly display copies. + + +3. COPYING IN QUANTITY + +If you publish printed copies (or copies in media that commonly have +printed covers) of the Document, numbering more than 100, and the +Document's license notice requires Cover Texts, you must enclose the +copies in covers that carry, clearly and legibly, all these Cover +Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on +the back cover. Both covers must also clearly and legibly identify +you as the publisher of these copies. The front cover must present +the full title with all words of the title equally prominent and +visible. You may add other material on the covers in addition. +Copying with changes limited to the covers, as long as they preserve +the title of the Document and satisfy these conditions, can be treated +as verbatim copying in other respects. + +If the required texts for either cover are too voluminous to fit +legibly, you should put the first ones listed (as many as fit +reasonably) on the actual cover, and continue the rest onto adjacent +pages. + +If you publish or distribute Opaque copies of the Document numbering +more than 100, you must either include a machine-readable Transparent +copy along with each Opaque copy, or state in or with each Opaque copy +a computer-network location from which the general network-using +public has access to download using public-standard network protocols +a complete Transparent copy of the Document, free of added material. +If you use the latter option, you must take reasonably prudent steps, +when you begin distribution of Opaque copies in quantity, to ensure +that this Transparent copy will remain thus accessible at the stated +location until at least one year after the last time you distribute an +Opaque copy (directly or through your agents or retailers) of that +edition to the public. + +It is requested, but not required, that you contact the authors of the +Document well before redistributing any large number of copies, to give +them a chance to provide you with an updated version of the Document. + + +4. MODIFICATIONS + +You may copy and distribute a Modified Version of the Document under +the conditions of sections 2 and 3 above, provided that you release +the Modified Version under precisely this License, with the Modified +Version filling the role of the Document, thus licensing distribution +and modification of the Modified Version to whoever possesses a copy +of it. In addition, you must do these things in the Modified Version: + +A. Use in the Title Page (and on the covers, if any) a title distinct + from that of the Document, and from those of previous versions + (which should, if there were any, be listed in the History section + of the Document). You may use the same title as a previous version + if the original publisher of that version gives permission. +B. List on the Title Page, as authors, one or more persons or entities + responsible for authorship of the modifications in the Modified + Version, together with at least five of the principal authors of the + Document (all of its principal authors, if it has fewer than five), + unless they release you from this requirement. +C. State on the Title page the name of the publisher of the + Modified Version, as the publisher. +D. Preserve all the copyright notices of the Document. +E. Add an appropriate copyright notice for your modifications + adjacent to the other copyright notices. +F. Include, immediately after the copyright notices, a license notice + giving the public permission to use the Modified Version under the + terms of this License, in the form shown in the Addendum below. +G. Preserve in that license notice the full lists of Invariant Sections + and required Cover Texts given in the Document's license notice. +H. Include an unaltered copy of this License. +I. Preserve the section Entitled "History", Preserve its Title, and add + to it an item stating at least the title, year, new authors, and + publisher of the Modified Version as given on the Title Page. If + there is no section Entitled "History" in the Document, create one + stating the title, year, authors, and publisher of the Document as + given on its Title Page, then add an item describing the Modified + Version as stated in the previous sentence. +J. Preserve the network location, if any, given in the Document for + public access to a Transparent copy of the Document, and likewise + the network locations given in the Document for previous versions + it was based on. These may be placed in the "History" section. + You may omit a network location for a work that was published at + least four years before the Document itself, or if the original + publisher of the version it refers to gives permission. +K. For any section Entitled "Acknowledgements" or "Dedications", + Preserve the Title of the section, and preserve in the section all + the substance and tone of each of the contributor acknowledgements + and/or dedications given therein. +L. Preserve all the Invariant Sections of the Document, + unaltered in their text and in their titles. Section numbers + or the equivalent are not considered part of the section titles. +M. Delete any section Entitled "Endorsements". Such a section + may not be included in the Modified Version. +N. Do not retitle any existing section to be Entitled "Endorsements" + or to conflict in title with any Invariant Section. +O. Preserve any Warranty Disclaimers. + +If the Modified Version includes new front-matter sections or +appendices that qualify as Secondary Sections and contain no material +copied from the Document, you may at your option designate some or all +of these sections as invariant. To do this, add their titles to the +list of Invariant Sections in the Modified Version's license notice. +These titles must be distinct from any other section titles. + +You may add a section Entitled "Endorsements", provided it contains +nothing but endorsements of your Modified Version by various +parties--for example, statements of peer review or that the text has +been approved by an organization as the authoritative definition of a +standard. + +You may add a passage of up to five words as a Front-Cover Text, and a +passage of up to 25 words as a Back-Cover Text, to the end of the list +of Cover Texts in the Modified Version. Only one passage of +Front-Cover Text and one of Back-Cover Text may be added by (or +through arrangements made by) any one entity. If the Document already +includes a cover text for the same cover, previously added by you or +by arrangement made by the same entity you are acting on behalf of, +you may not add another; but you may replace the old one, on explicit +permission from the previous publisher that added the old one. + +The author(s) and publisher(s) of the Document do not by this License +give permission to use their names for publicity for or to assert or +imply endorsement of any Modified Version. + + +5. COMBINING DOCUMENTS + +You may combine the Document with other documents released under this +License, under the terms defined in section 4 above for modified +versions, provided that you include in the combination all of the +Invariant Sections of all of the original documents, unmodified, and +list them all as Invariant Sections of your combined work in its +license notice, and that you preserve all their Warranty Disclaimers. + +The combined work need only contain one copy of this License, and +multiple identical Invariant Sections may be replaced with a single +copy. If there are multiple Invariant Sections with the same name but +different contents, make the title of each such section unique by +adding at the end of it, in parentheses, the name of the original +author or publisher of that section if known, or else a unique number. +Make the same adjustment to the section titles in the list of +Invariant Sections in the license notice of the combined work. + +In the combination, you must combine any sections Entitled "History" +in the various original documents, forming one section Entitled +"History"; likewise combine any sections Entitled "Acknowledgements", +and any sections Entitled "Dedications". You must delete all sections +Entitled "Endorsements". + + +6. COLLECTIONS OF DOCUMENTS + +You may make a collection consisting of the Document and other documents +released under this License, and replace the individual copies of this +License in the various documents with a single copy that is included in +the collection, provided that you follow the rules of this License for +verbatim copying of each of the documents in all other respects. + +You may extract a single document from such a collection, and distribute +it individually under this License, provided you insert a copy of this +License into the extracted document, and follow this License in all +other respects regarding verbatim copying of that document. + + +7. AGGREGATION WITH INDEPENDENT WORKS + +A compilation of the Document or its derivatives with other separate +and independent documents or works, in or on a volume of a storage or +distribution medium, is called an "aggregate" if the copyright +resulting from the compilation is not used to limit the legal rights +of the compilation's users beyond what the individual works permit. +When the Document is included in an aggregate, this License does not +apply to the other works in the aggregate which are not themselves +derivative works of the Document. + +If the Cover Text requirement of section 3 is applicable to these +copies of the Document, then if the Document is less than one half of +the entire aggregate, the Document's Cover Texts may be placed on +covers that bracket the Document within the aggregate, or the +electronic equivalent of covers if the Document is in electronic form. +Otherwise they must appear on printed covers that bracket the whole +aggregate. + + +8. TRANSLATION + +Translation is considered a kind of modification, so you may +distribute translations of the Document under the terms of section 4. +Replacing Invariant Sections with translations requires special +permission from their copyright holders, but you may include +translations of some or all Invariant Sections in addition to the +original versions of these Invariant Sections. You may include a +translation of this License, and all the license notices in the +Document, and any Warranty Disclaimers, provided that you also include +the original English version of this License and the original versions +of those notices and disclaimers. In case of a disagreement between +the translation and the original version of this License or a notice +or disclaimer, the original version will prevail. + +If a section in the Document is Entitled "Acknowledgements", +"Dedications", or "History", the requirement (section 4) to Preserve +its Title (section 1) will typically require changing the actual +title. + + +9. TERMINATION + +You may not copy, modify, sublicense, or distribute the Document except +as expressly provided for under this License. Any other attempt to +copy, modify, sublicense or distribute the Document is void, and will +automatically terminate your rights under this License. However, +parties who have received copies, or rights, from you under this +License will not have their licenses terminated so long as such +parties remain in full compliance. + + +10. FUTURE REVISIONS OF THIS LICENSE + +The Free Software Foundation may publish new, revised versions +of the GNU Free Documentation License from time to time. Such new +versions will be similar in spirit to the present version, but may +differ in detail to address new problems or concerns. See +http://www.gnu.org/copyleft/. + +Each version of the License is given a distinguishing version number. +If the Document specifies that a particular numbered version of this +License "or any later version" applies to it, you have the option of +following the terms and conditions either of that specified version or +of any later version that has been published (not as a draft) by the +Free Software Foundation. If the Document does not specify a version +number of this License, you may choose any version ever published (not +as a draft) by the Free Software Foundation. + + +ADDENDUM: How to use this License for your documents + +To use this License in a document you have written, include a copy of +the License in the document and put the following copyright and +license notices just after the title page: + + Copyright (c) YEAR YOUR NAME. + Permission is granted to copy, distribute and/or modify this document + under the terms of the GNU Free Documentation License, Version 1.2 + or any later version published by the Free Software Foundation; + with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. + A copy of the license is included in the section entitled "GNU + Free Documentation License". + +If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts, +replace the "with...Texts." line with this: + + with the Invariant Sections being LIST THEIR TITLES, with the + Front-Cover Texts being LIST, and with the Back-Cover Texts being LIST. + +If you have Invariant Sections without Cover Texts, or some other +combination of the three, merge those two alternatives to suit the +situation. + +If your document contains nontrivial examples of program code, we +recommend releasing these examples in parallel under your choice of +free software license, such as the GNU General Public License, +to permit their use in free software. diff --git a/LICENSE.LGPL b/LICENSE.LGPL new file mode 100644 index 0000000..5797d01 --- /dev/null +++ b/LICENSE.LGPL @@ -0,0 +1,481 @@ + GNU LIBRARY GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1991 Free Software Foundation, Inc. + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + +[This is the first released version of the library GPL. It is + numbered 2 because it goes with version 2 of the ordinary GPL.] + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +Licenses are intended to guarantee your freedom to share and change +free software--to make sure the software is free for all its users. + + This license, the Library General Public License, applies to some +specially designated Free Software Foundation software, and to any +other libraries whose authors decide to use it. You can use it for +your libraries, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if +you distribute copies of the library, or if you modify it. + + For example, if you distribute copies of the library, whether gratis +or for a fee, you must give the recipients all the rights that we gave +you. You must make sure that they, too, receive or can get the source +code. If you link a program with the library, you must provide +complete object files to the recipients so that they can relink them +with the library, after making changes to the library and recompiling +it. And you must show them these terms so they know their rights. + + Our method of protecting your rights has two steps: (1) copyright +the library, and (2) offer you this license which gives you legal +permission to copy, distribute and/or modify the library. + + Also, for each distributor's protection, we want to make certain +that everyone understands that there is no warranty for this free +library. If the library is modified by someone else and passed on, we +want its recipients to know that what they have is not the original +version, so that any problems introduced by others will not reflect on +the original authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that companies distributing free +software will individually obtain patent licenses, thus in effect +transforming the program into proprietary software. To prevent this, +we have made it clear that any patent must be licensed for everyone's +free use or not licensed at all. + + Most GNU software, including some libraries, is covered by the ordinary +GNU General Public License, which was designed for utility programs. This +license, the GNU Library General Public License, applies to certain +designated libraries. This license is quite different from the ordinary +one; be sure to read it in full, and don't assume that anything in it is +the same as in the ordinary license. + + The reason we have a separate public license for some libraries is that +they blur the distinction we usually make between modifying or adding to a +program and simply using it. Linking a program with a library, without +changing the library, is in some sense simply using the library, and is +analogous to running a utility program or application program. However, in +a textual and legal sense, the linked executable is a combined work, a +derivative of the original library, and the ordinary General Public License +treats it as such. + + Because of this blurred distinction, using the ordinary General +Public License for libraries did not effectively promote software +sharing, because most developers did not use the libraries. We +concluded that weaker conditions might promote sharing better. + + However, unrestricted linking of non-free programs would deprive the +users of those programs of all benefit from the free status of the +libraries themselves. This Library General Public License is intended to +permit developers of non-free programs to use free libraries, while +preserving your freedom as a user of such programs to change the free +libraries that are incorporated in them. (We have not seen how to achieve +this as regards changes in header files, but we have achieved it as regards +changes in the actual functions of the Library.) The hope is that this +will lead to faster development of free libraries. + + The precise terms and conditions for copying, distribution and +modification follow. Pay close attention to the difference between a +"work based on the library" and a "work that uses the library". The +former contains code derived from the library, while the latter only +works together with the library. + + Note that it is possible for a library to be covered by the ordinary +General Public License rather than by this special one. + + GNU LIBRARY GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any software library which +contains a notice placed by the copyright holder or other authorized +party saying it may be distributed under the terms of this Library +General Public License (also called "this License"). Each licensee is +addressed as "you". + + A "library" means a collection of software functions and/or data +prepared so as to be conveniently linked with application programs +(which use some of those functions and data) to form executables. + + The "Library", below, refers to any such software library or work +which has been distributed under these terms. A "work based on the +Library" means either the Library or any derivative work under +copyright law: that is to say, a work containing the Library or a +portion of it, either verbatim or with modifications and/or translated +straightforwardly into another language. (Hereinafter, translation is +included without limitation in the term "modification".) + + "Source code" for a work means the preferred form of the work for +making modifications to it. For a library, complete source code means +all the source code for all modules it contains, plus any associated +interface definition files, plus the scripts used to control compilation +and installation of the library. + + Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running a program using the Library is not restricted, and output from +such a program is covered only if its contents constitute a work based +on the Library (independent of the use of the Library in a tool for +writing it). Whether that is true depends on what the Library does +and what the program that uses the Library does. + + 1. You may copy and distribute verbatim copies of the Library's +complete source code as you receive it, in any medium, provided that +you conspicuously and appropriately publish on each copy an +appropriate copyright notice and disclaimer of warranty; keep intact +all the notices that refer to this License and to the absence of any +warranty; and distribute a copy of this License along with the +Library. + + You may charge a fee for the physical act of transferring a copy, +and you may at your option offer warranty protection in exchange for a +fee. + + 2. You may modify your copy or copies of the Library or any portion +of it, thus forming a work based on the Library, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices + stating that you changed the files and the date of any change. + + c) You must cause the whole of the work to be licensed at no + charge to all third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function or a + table of data to be supplied by an application program that uses + the facility, other than as an argument passed when the facility + is invoked, then you must make a good faith effort to ensure that, + in the event an application does not supply such function or + table, the facility still operates, and performs whatever part of + its purpose remains meaningful. + + (For example, a function in a library to compute square roots has + a purpose that is entirely well-defined independent of the + application. Therefore, Subsection 2d requires that any + application-supplied function or table used by this function must + be optional: if the application does not supply it, the square + root function must still compute square roots.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Library, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Library, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote +it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Library. + +In addition, mere aggregation of another work not based on the Library +with the Library (or with a work based on the Library) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may opt to apply the terms of the ordinary GNU General Public +License instead of this License to a given copy of the Library. To do +this, you must alter all the notices that refer to this License, so +that they refer to the ordinary GNU General Public License, version 2, +instead of to this License. (If a newer version than version 2 of the +ordinary GNU General Public License has appeared, then you can specify +that version instead if you wish.) Do not make any other change in +these notices. + + Once this change is made in a given copy, it is irreversible for +that copy, so the ordinary GNU General Public License applies to all +subsequent copies and derivative works made from that copy. + + This option is useful when you wish to copy part of the code of +the Library into a program that is not a library. + + 4. You may copy and distribute the Library (or a portion or +derivative of it, under Section 2) in object code or executable form +under the terms of Sections 1 and 2 above provided that you accompany +it with the complete corresponding machine-readable source code, which +must be distributed under the terms of Sections 1 and 2 above on a +medium customarily used for software interchange. + + If distribution of object code is made by offering access to copy +from a designated place, then offering equivalent access to copy the +source code from the same place satisfies the requirement to +distribute the source code, even though third parties are not +compelled to copy the source along with the object code. + + 5. A program that contains no derivative of any portion of the +Library, but is designed to work with the Library by being compiled or +linked with it, is called a "work that uses the Library". Such a +work, in isolation, is not a derivative work of the Library, and +therefore falls outside the scope of this License. + + However, linking a "work that uses the Library" with the Library +creates an executable that is a derivative of the Library (because it +contains portions of the Library), rather than a "work that uses the +library". The executable is therefore covered by this License. +Section 6 states terms for distribution of such executables. + + When a "work that uses the Library" uses material from a header file +that is part of the Library, the object code for the work may be a +derivative work of the Library even though the source code is not. +Whether this is true is especially significant if the work can be +linked without the Library, or if the work is itself a library. The +threshold for this to be true is not precisely defined by law. + + If such an object file uses only numerical parameters, data +structure layouts and accessors, and small macros and small inline +functions (ten lines or less in length), then the use of the object +file is unrestricted, regardless of whether it is legally a derivative +work. (Executables containing this object code plus portions of the +Library will still fall under Section 6.) + + Otherwise, if the work is a derivative of the Library, you may +distribute the object code for the work under the terms of Section 6. +Any executables containing that work also fall under Section 6, +whether or not they are linked directly with the Library itself. + + 6. As an exception to the Sections above, you may also compile or +link a "work that uses the Library" with the Library to produce a +work containing portions of the Library, and distribute that work +under terms of your choice, provided that the terms permit +modification of the work for the customer's own use and reverse +engineering for debugging such modifications. + + You must give prominent notice with each copy of the work that the +Library is used in it and that the Library and its use are covered by +this License. You must supply a copy of this License. If the work +during execution displays copyright notices, you must include the +copyright notice for the Library among them, as well as a reference +directing the user to the copy of this License. Also, you must do one +of these things: + + a) Accompany the work with the complete corresponding + machine-readable source code for the Library including whatever + changes were used in the work (which must be distributed under + Sections 1 and 2 above); and, if the work is an executable linked + with the Library, with the complete machine-readable "work that + uses the Library", as object code and/or source code, so that the + user can modify the Library and then relink to produce a modified + executable containing the modified Library. (It is understood + that the user who changes the contents of definitions files in the + Library will not necessarily be able to recompile the application + to use the modified definitions.) + + b) Accompany the work with a written offer, valid for at + least three years, to give the same user the materials + specified in Subsection 6a, above, for a charge no more + than the cost of performing this distribution. + + c) If distribution of the work is made by offering access to copy + from a designated place, offer equivalent access to copy the above + specified materials from the same place. + + d) Verify that the user has already received a copy of these + materials or that you have already sent this user a copy. + + For an executable, the required form of the "work that uses the +Library" must include any data and utility programs needed for +reproducing the executable from it. However, as a special exception, +the source code distributed need not include anything that is normally +distributed (in either source or binary form) with the major +components (compiler, kernel, and so on) of the operating system on +which the executable runs, unless that component itself accompanies +the executable. + + It may happen that this requirement contradicts the license +restrictions of other proprietary libraries that do not normally +accompany the operating system. Such a contradiction means you cannot +use both them and the Library together in an executable that you +distribute. + + 7. You may place library facilities that are a work based on the +Library side-by-side in a single library together with other library +facilities not covered by this License, and distribute such a combined +library, provided that the separate distribution of the work based on +the Library and of the other library facilities is otherwise +permitted, and provided that you do these two things: + + a) Accompany the combined library with a copy of the same work + based on the Library, uncombined with any other library + facilities. This must be distributed under the terms of the + Sections above. + + b) Give prominent notice with the combined library of the fact + that part of it is a work based on the Library, and explaining + where to find the accompanying uncombined form of the same work. + + 8. You may not copy, modify, sublicense, link with, or distribute +the Library except as expressly provided under this License. Any +attempt otherwise to copy, modify, sublicense, link with, or +distribute the Library is void, and will automatically terminate your +rights under this License. However, parties who have received copies, +or rights, from you under this License will not have their licenses +terminated so long as such parties remain in full compliance. + + 9. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Library or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Library (or any work based on the +Library), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Library or works based on it. + + 10. Each time you redistribute the Library (or any work based on the +Library), the recipient automatically receives a license from the +original licensor to copy, distribute, link with or modify the Library +subject to these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 11. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Library at all. For example, if a patent +license would not permit royalty-free redistribution of the Library by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Library. + +If any portion of this section is held invalid or unenforceable under any +particular circumstance, the balance of the section is intended to apply, +and the section as a whole is intended to apply in other circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 12. If the distribution and/or use of the Library is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Library under this License may add +an explicit geographical distribution limitation excluding those countries, +so that distribution is permitted only in or among countries not thus +excluded. In such case, this License incorporates the limitation as if +written in the body of this License. + + 13. The Free Software Foundation may publish revised and/or new +versions of the Library General Public License from time to time. +Such new versions will be similar in spirit to the present version, +but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Library +specifies a version number of this License which applies to it and +"any later version", you have the option of following the terms and +conditions either of that version or of any later version published by +the Free Software Foundation. If the Library does not specify a +license version number, you may choose any version ever published by +the Free Software Foundation. + + 14. If you wish to incorporate parts of the Library into other free +programs whose distribution conditions are incompatible with these, +write to the author to ask for permission. For software which is +copyrighted by the Free Software Foundation, write to the Free +Software Foundation; we sometimes make exceptions for this. Our +decision will be guided by the two goals of preserving the free status +of all derivatives of our free software and of promoting the sharing +and reuse of software generally. + + NO WARRANTY + + 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO +WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. +EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR +OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY +KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE +LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME +THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN +WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY +AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU +FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR +CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE +LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING +RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A +FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF +SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Libraries + + If you develop a new library, and you want it to be of the greatest +possible use to the public, we recommend making it free software that +everyone can redistribute and change. You can do so by permitting +redistribution under these terms (or, alternatively, under the terms of the +ordinary General Public License). + + To apply these terms, attach the following notices to the library. It is +safest to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least the +"copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +Also add information on how to contact you by electronic and paper mail. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the library, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the + library `Frob' (a library for tweaking knobs) written by James Random Hacker. + + , 1 April 1990 + Ty Coon, President of Vice + +That's all there is to it! diff --git a/Makefile.am b/Makefile.am new file mode 100644 index 0000000..2defde4 --- /dev/null +++ b/Makefile.am @@ -0,0 +1,34 @@ +####### kdevelop will overwrite this part!!! (begin)########## + +SUBDIRS = ksquirrel po pics + +EXTRA_DIST = ksquirrel.kdevprj admin AUTHORS COPYING ChangeLog INSTALL README TODO ksquirrel.lsm + +####### kdevelop will overwrite this part!!! (end)############ + +SUBDIRS += doc + +EXTRA_DIST += fmt_filters_README required-etch LICENSE.GFDL LICENSE.LGPL + +# not a GNU package. You can remove this line, if +# have all needed files, that a GNU package needs +AUTOMAKE_OPTIONS = foreign + +$(top_srcdir)/configure.in: configure.in.in $(top_srcdir)/subdirs + cd $(top_srcdir) && $(MAKE) -f admin/Makefile.common configure.in ; + +$(top_srcdir)/subdirs: + cd $(top_srcdir) && $(MAKE) -f admin/Makefile.common subdirs + +$(top_srcdir)/acinclude.m4: $(top_srcdir)/admin/acinclude.m4.in $(top_srcdir)/admin/libtool.m4.in + @cd $(top_srcdir) && cat admin/acinclude.m4.in admin/libtool.m4.in > acinclude.m4 + +MAINTAINERCLEANFILES = subdirs configure.in acinclude.m4 configure.files + +package-messages: + $(MAKE) -f admin/Makefile.common package-messages + $(MAKE) -C po merge + +dist-hook: + cd $(top_distdir) && perl admin/am_edit -padmin + cd $(top_distdir) && $(MAKE) -f admin/Makefile.common subdirs diff --git a/Makefile.dist b/Makefile.dist new file mode 100644 index 0000000..be59a86 --- /dev/null +++ b/Makefile.dist @@ -0,0 +1,14 @@ +all: + @echo "This Makefile is only for the CVS repository" + @echo "This will be deleted before making the distribution" + @echo "" + @if test ! -d admin; then \ + echo "Please recheckout this module!" ;\ + echo "for cvs: use checkout once and after that update again" ;\ + echo "for cvsup: checkout kde-common from cvsup and" ;\ + echo " link kde-common/admin to ./admin" ;\ + exit 1 ;\ + fi + $(MAKE) -f admin/Makefile.common cvs + +.SILENT: diff --git a/README b/README new file mode 100644 index 0000000..a7635e0 --- /dev/null +++ b/README @@ -0,0 +1,157 @@ +KSquirrel is a new image viewer for KDE, simple and convenient in usage. + +While all others use another's decoders, in KSquirrel image decoding is based on own decoders +(ksquirrel-libs) which format is very simple. If support of certain format FMT is necessary +for you, you can write the decoder for KSquirrel, compile and copy it in /usr/lib/ksquirrel-libs. +At desire you can use ksquirrel-libs in other image viewer. Since 0.6.0 ksquireel-libs has +documentation and simple examples. + +Due to usage OpenGL show and a manipulation the image is characterized by extreme speed :). +Also in the program customized filters, external programs, tree, thumbnails, +extended thumbnails with the information on the image, flexible options, KIPI support, +archives support are available. + +Here is some history :) +In November 2003, testing long time other programs on my collection of images, +I've found an awful thing - any of programs could not show ALL images. +There was no support 32-bit BMP, TGA, animated GIF, PSD, etc. Any of them does not use the +most advanced libraries for decoding images, and use either imlib, or QImage::load(). +Having become dissapointed, I've decided to write the image viewer with the flexible +architecture. Birthday for KSquirrel - on December 10, 2003. + +KSquirrel is the first viewer for KDE widely supporting such a quantity of image formats, +including Photoshop PSD, X cursors, animated GIF, FLI Animation, WMF, SVG, TTF, APNG, MNG ... + +The detailed information, format of libraries with examples and screenshots you can find +visiting page http://ksquirrel.sourceforge.net/ + +*********************************************************************************** + +Notes +----- + +* OpenGL drivers are required to run KSquirrel successfully +* To let KSquirrel unpack RAR archives please install kio_rar +* To let KSquirrel unpack 7Z archives please install kio_p7zip + +*********************************************************************************** + +Copyrights +---------- + +see COPYING + +*********************************************************************************** + +Keyboard shortcuts +------------------ + +Image window understands many hotkeys. You can invoke help window with either pressing +"/" in image window, or selecting "Hotkeys" from context menu. + +*********************************************************************************** + +Slideshow +--------- + +Use the following keys in slideshow: + + * Return, Escape = stop slideshow + * Pause, Space = pause/unpause slideshow + * Page Up = previous image + * Page Down = next image + * M = enable/disable onscreen messages + +*********************************************************************************** + +DCOP interface +-------------- + +Since 0.6.0-pre5 you can use DCOP interface to manipulate KSquirrel. Just run + +# dcop ksquirrel ksquirrel control + +Here is a list of avaliable parameters: + +---------------------------------------------------------------------------- + +Parameter Action Comments +---------------------------------------------------------------------------- +image_animation_toggle toggle animation wrapper for A +image_delete delete image wrapper for Delete +image_first first image wrapper for Home +image_last last image wrapper for End +image_next next image wrapper for PageDown +image_previous previous image wrapper for PageUp +image_information image information wrapper for I +image_page_first first page wrapper for F1 +image_page_last last page wrapper for F4 +image_page_next next page wrapper for F3 +image_page_previous previous page wrapper for F2 +image_reset reset wrapper for R +image_window_close close image window wrapper for X +image_window_fullscreen toggle fullscreen mode wrapper for F +image_window_help help wrapper for / +image_window_quickbrowser toggle quickbrowser wrapper for Q +zoom_1 zoom 100% wrapper for 1 +zoom_2 zoom 200% wrapper for 2 +zoom_3 zoom 300% wrapper for 3 +zoom_4 zoom 400% wrapper for 4 +zoom_5 zoom 500% wrapper for 5 +zoom_6 zoom 600% wrapper for 6 +zoom_7 zoom 700% wrapper for 7 +zoom_8 zoom 800% wrapper for 8 +zoom_9 zoom 900% wrapper for 9 +zoom_10 zoom 1000% wrapper for 0 +zoom_minus zoom minus wrapper for - +zoom_plus zoom plus wrapper for + + +New parameters since 0.6.0-pre8: +-------------------------------- + +- load specified image/directory +# dcop ksquirrel ksquirrel load + +- activate window +# dcop ksquirrel ksquirrel activate + +---------------------------------------------------------------------------- + +New parameters since 0.7.0: +-------------------------------- + +- go to the next file in file manager +# dcop ksquirrel ksquirrel navigator next + +- go to the previous file in file manager +# dcop ksquirrel ksquirrel navigator previous + +- execute current file in file manager (as if user pressed Enter) +# dcop ksquirrel ksquirrel navigator execute + +- activate image window +# dcop ksquirrel ksquirrel activate_image_window + + +---------------------------------------------------------------------------- + +Examples +-------- + +* let's zoom currently loaded image: +[me@localhost /]$ dcop ksquirrel ksquirrel control zoom_plus + +* let's load next image in current directory: +[me@localhost /]$ dcop ksquirrel ksquirrel control image_next + +*********************************************************************************** + +Since 0.6.0-pre1 KSquirrel has edit tools: +- convert tool + +Since 0.6.0-pre7 KSquirrel has additional edit tools: +- filter tool with many filters + +*********************************************************************************** + +See ChangeLog for more diff --git a/TODO b/TODO new file mode 100644 index 0000000..e69de29 diff --git a/acinclude.m4 b/acinclude.m4 new file mode 100644 index 0000000..a1b3edf --- /dev/null +++ b/acinclude.m4 @@ -0,0 +1,11864 @@ +## -*- autoconf -*- + +dnl This file is part of the KDE libraries/packages +dnl Copyright (C) 1997 Janos Farkas (chexum@shadow.banki.hu) +dnl (C) 1997,98,99 Stephan Kulow (coolo@kde.org) + +dnl This file is free software; you can redistribute it and/or +dnl modify it under the terms of the GNU Library General Public +dnl License as published by the Free Software Foundation; either +dnl version 2 of the License, or (at your option) any later version. + +dnl This library is distributed in the hope that it will be useful, +dnl but WITHOUT ANY WARRANTY; without even the implied warranty of +dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +dnl Library General Public License for more details. + +dnl You should have received a copy of the GNU Library General Public License +dnl along with this library; see the file COPYING.LIB. If not, write to +dnl the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +dnl Boston, MA 02110-1301, USA. + +dnl IMPORTANT NOTE: +dnl Please do not modify this file unless you expect your modifications to be +dnl carried into every other module in the repository. +dnl +dnl Single-module modifications are best placed in configure.in for kdelibs +dnl and kdebase or configure.in.in if present. + +# KDE_PATH_X_DIRECT +dnl Internal subroutine of AC_PATH_X. +dnl Set ac_x_includes and/or ac_x_libraries. +AC_DEFUN([KDE_PATH_X_DIRECT], +[ +AC_REQUIRE([KDE_CHECK_LIB64]) + +if test "$ac_x_includes" = NO; then + # Guess where to find include files, by looking for this one X11 .h file. + test -z "$x_direct_test_include" && x_direct_test_include=X11/Intrinsic.h + + # First, try using that file with no special directory specified. +AC_TRY_CPP([#include <$x_direct_test_include>], +[# We can compile using X headers with no special include directory. +ac_x_includes=], +[# Look for the header file in a standard set of common directories. +# Check X11 before X11Rn because it is often a symlink to the current release. + for ac_dir in \ + /usr/X11/include \ + /usr/X11R6/include \ + /usr/X11R5/include \ + /usr/X11R4/include \ + \ + /usr/include/X11 \ + /usr/include/X11R6 \ + /usr/include/X11R5 \ + /usr/include/X11R4 \ + \ + /usr/local/X11/include \ + /usr/local/X11R6/include \ + /usr/local/X11R5/include \ + /usr/local/X11R4/include \ + \ + /usr/local/include/X11 \ + /usr/local/include/X11R6 \ + /usr/local/include/X11R5 \ + /usr/local/include/X11R4 \ + \ + /usr/X386/include \ + /usr/x386/include \ + /usr/XFree86/include/X11 \ + \ + /usr/include \ + /usr/local/include \ + /usr/unsupported/include \ + /usr/athena/include \ + /usr/local/x11r5/include \ + /usr/lpp/Xamples/include \ + \ + /usr/openwin/include \ + /usr/openwin/share/include \ + ; \ + do + if test -r "$ac_dir/$x_direct_test_include"; then + ac_x_includes=$ac_dir + break + fi + done]) +fi # $ac_x_includes = NO + +if test "$ac_x_libraries" = NO; then + # Check for the libraries. + + test -z "$x_direct_test_library" && x_direct_test_library=Xt + test -z "$x_direct_test_function" && x_direct_test_function=XtMalloc + + # See if we find them without any special options. + # Don't add to $LIBS permanently. + ac_save_LIBS="$LIBS" + LIBS="-l$x_direct_test_library $LIBS" +AC_TRY_LINK([#include ], [${x_direct_test_function}(1)], +[LIBS="$ac_save_LIBS" +# We can link X programs with no special library path. +ac_x_libraries=], +[LIBS="$ac_save_LIBS" +# First see if replacing the include by lib works. +# Check X11 before X11Rn because it is often a symlink to the current release. +for ac_dir in `echo "$ac_x_includes" | sed s/include/lib${kdelibsuff}/` \ + /usr/X11/lib${kdelibsuff} \ + /usr/X11R6/lib${kdelibsuff} \ + /usr/X11R5/lib${kdelibsuff} \ + /usr/X11R4/lib${kdelibsuff} \ + \ + /usr/lib${kdelibsuff}/X11 \ + /usr/lib${kdelibsuff}/X11R6 \ + /usr/lib${kdelibsuff}/X11R5 \ + /usr/lib${kdelibsuff}/X11R4 \ + \ + /usr/local/X11/lib${kdelibsuff} \ + /usr/local/X11R6/lib${kdelibsuff} \ + /usr/local/X11R5/lib${kdelibsuff} \ + /usr/local/X11R4/lib${kdelibsuff} \ + \ + /usr/local/lib${kdelibsuff}/X11 \ + /usr/local/lib${kdelibsuff}/X11R6 \ + /usr/local/lib${kdelibsuff}/X11R5 \ + /usr/local/lib${kdelibsuff}/X11R4 \ + \ + /usr/X386/lib${kdelibsuff} \ + /usr/x386/lib${kdelibsuff} \ + /usr/XFree86/lib${kdelibsuff}/X11 \ + \ + /usr/lib${kdelibsuff} \ + /usr/local/lib${kdelibsuff} \ + /usr/unsupported/lib${kdelibsuff} \ + /usr/athena/lib${kdelibsuff} \ + /usr/local/x11r5/lib${kdelibsuff} \ + /usr/lpp/Xamples/lib${kdelibsuff} \ + /lib/usr/lib${kdelibsuff}/X11 \ + \ + /usr/openwin/lib${kdelibsuff} \ + /usr/openwin/share/lib${kdelibsuff} \ + ; \ +do +dnl Don't even attempt the hair of trying to link an X program! + for ac_extension in a so sl; do + if test -r $ac_dir/lib${x_direct_test_library}.$ac_extension; then + ac_x_libraries=$ac_dir + break 2 + fi + done +done]) +fi # $ac_x_libraries = NO +]) + + +dnl ------------------------------------------------------------------------ +dnl Find a file (or one of more files in a list of dirs) +dnl ------------------------------------------------------------------------ +dnl +AC_DEFUN([AC_FIND_FILE], +[ +$3=NO +for i in $2; +do + for j in $1; + do + echo "configure: __oline__: $i/$j" >&AC_FD_CC + if test -r "$i/$j"; then + echo "taking that" >&AC_FD_CC + $3=$i + break 2 + fi + done +done +]) + +dnl KDE_FIND_PATH(program-name, variable-name, list-of-dirs, +dnl if-not-found, test-parameter, prepend-path) +dnl +dnl Look for program-name in list-of-dirs+$PATH. +dnl If prepend-path is set, look in $PATH+list-of-dirs instead. +dnl If found, $variable-name is set. If not, if-not-found is evaluated. +dnl test-parameter: if set, the program is executed with this arg, +dnl and only a successful exit code is required. +AC_DEFUN([KDE_FIND_PATH], +[ + AC_MSG_CHECKING([for $1]) + if test -n "$$2"; then + kde_cv_path="$$2"; + else + kde_cache=`echo $1 | sed 'y%./+-%__p_%'` + + AC_CACHE_VAL(kde_cv_path_$kde_cache, + [ + kde_cv_path="NONE" + kde_save_IFS=$IFS + IFS=':' + dirs="" + for dir in $PATH; do + dirs="$dirs $dir" + done + if test -z "$6"; then dnl Append dirs in PATH (default) + dirs="$3 $dirs" + else dnl Prepend dirs in PATH (if 6th arg is set) + dirs="$dirs $3" + fi + IFS=$kde_save_IFS + + for dir in $dirs; do + if test -x "$dir/$1"; then + if test -n "$5" + then + evalstr="$dir/$1 $5 2>&1 " + if eval $evalstr; then + kde_cv_path="$dir/$1" + break + fi + else + kde_cv_path="$dir/$1" + break + fi + fi + done + + eval "kde_cv_path_$kde_cache=$kde_cv_path" + + ]) + + eval "kde_cv_path=\"`echo '$kde_cv_path_'$kde_cache`\"" + + fi + + if test -z "$kde_cv_path" || test "$kde_cv_path" = NONE; then + AC_MSG_RESULT(not found) + $4 + else + AC_MSG_RESULT($kde_cv_path) + $2=$kde_cv_path + + fi +]) + +AC_DEFUN([KDE_MOC_ERROR_MESSAGE], +[ + AC_MSG_ERROR([No Qt meta object compiler (moc) found! +Please check whether you installed Qt correctly. +You need to have a running moc binary. +configure tried to run $ac_cv_path_moc and the test didn't +succeed. If configure shouldn't have tried this one, set +the environment variable MOC to the right one before running +configure. +]) +]) + +AC_DEFUN([KDE_UIC_ERROR_MESSAGE], +[ + AC_MSG_WARN([No Qt ui compiler (uic) found! +Please check whether you installed Qt correctly. +You need to have a running uic binary. +configure tried to run $ac_cv_path_uic and the test didn't +succeed. If configure shouldn't have tried this one, set +the environment variable UIC to the right one before running +configure. +]) +]) + + +AC_DEFUN([KDE_CHECK_UIC_FLAG], +[ + AC_MSG_CHECKING([whether uic supports -$1 ]) + kde_cache=`echo $1 | sed 'y% .=/+-%____p_%'` + AC_CACHE_VAL(kde_cv_prog_uic_$kde_cache, + [ + cat >conftest.ui < +EOT + ac_uic_testrun="$UIC_PATH -$1 $2 conftest.ui >/dev/null" + if AC_TRY_EVAL(ac_uic_testrun); then + eval "kde_cv_prog_uic_$kde_cache=yes" + else + eval "kde_cv_prog_uic_$kde_cache=no" + fi + rm -f conftest* + ]) + + if eval "test \"`echo '$kde_cv_prog_uic_'$kde_cache`\" = yes"; then + AC_MSG_RESULT([yes]) + : + $3 + else + AC_MSG_RESULT([no]) + : + $4 + fi +]) + + +dnl ------------------------------------------------------------------------ +dnl Find the meta object compiler and the ui compiler in the PATH, +dnl in $QTDIR/bin, and some more usual places +dnl ------------------------------------------------------------------------ +dnl +AC_DEFUN([AC_PATH_QT_MOC_UIC], +[ + AC_REQUIRE([KDE_CHECK_PERL]) + qt_bindirs="" + for dir in $kde_qt_dirs; do + qt_bindirs="$qt_bindirs $dir/bin $dir/src/moc" + done + qt_bindirs="$qt_bindirs /usr/bin /usr/X11R6/bin /usr/local/qt/bin" + if test ! "$ac_qt_bindir" = "NO"; then + qt_bindirs="$ac_qt_bindir $qt_bindirs" + fi + + KDE_FIND_PATH(moc, MOC, [$qt_bindirs], [KDE_MOC_ERROR_MESSAGE]) + if test -z "$UIC_NOT_NEEDED"; then + KDE_FIND_PATH(uic, UIC_PATH, [$qt_bindirs], [UIC_PATH=""]) + if test -z "$UIC_PATH" ; then + KDE_UIC_ERROR_MESSAGE + exit 1 + else + UIC=$UIC_PATH + + if test $kde_qtver = 3; then + KDE_CHECK_UIC_FLAG(L,[/nonexistent],ac_uic_supports_libpath=yes,ac_uic_supports_libpath=no) + KDE_CHECK_UIC_FLAG(nounload,,ac_uic_supports_nounload=yes,ac_uic_supports_nounload=no) + + if test x$ac_uic_supports_libpath = xyes; then + UIC="$UIC -L \$(kde_widgetdir)" + fi + if test x$ac_uic_supports_nounload = xyes; then + UIC="$UIC -nounload" + fi + fi + fi + else + UIC="echo uic not available: " + fi + + AC_SUBST(MOC) + AC_SUBST(UIC) + + UIC_TR="i18n" + if test $kde_qtver = 3; then + UIC_TR="tr2i18n" + fi + + AC_SUBST(UIC_TR) +]) + +AC_DEFUN([KDE_1_CHECK_PATHS], +[ + KDE_1_CHECK_PATH_HEADERS + + KDE_TEST_RPATH= + + if test -n "$USE_RPATH"; then + + if test -n "$kde_libraries"; then + KDE_TEST_RPATH="-R $kde_libraries" + fi + + if test -n "$qt_libraries"; then + KDE_TEST_RPATH="$KDE_TEST_RPATH -R $qt_libraries" + fi + + if test -n "$x_libraries"; then + KDE_TEST_RPATH="$KDE_TEST_RPATH -R $x_libraries" + fi + + KDE_TEST_RPATH="$KDE_TEST_RPATH $KDE_EXTRA_RPATH" + fi + +AC_MSG_CHECKING([for KDE libraries installed]) +ac_link='$LIBTOOL_SHELL --silent --mode=link ${CXX-g++} -o conftest $CXXFLAGS $all_includes $CPPFLAGS $LDFLAGS $all_libraries conftest.$ac_ext $LIBS -lkdecore $LIBQT $KDE_TEST_RPATH 1>&5' + +if AC_TRY_EVAL(ac_link) && test -s conftest; then + AC_MSG_RESULT(yes) +else + AC_MSG_ERROR([your system fails at linking a small KDE application! +Check, if your compiler is installed correctly and if you have used the +same compiler to compile Qt and kdelibs as you did use now. +For more details about this problem, look at the end of config.log.]) +fi + +if eval `KDEDIR= ./conftest 2>&5`; then + kde_result=done +else + kde_result=problems +fi + +KDEDIR= ./conftest 2> /dev/null >&5 # make an echo for config.log +kde_have_all_paths=yes + +KDE_SET_PATHS($kde_result) + +]) + +AC_DEFUN([KDE_SET_PATHS], +[ + kde_cv_all_paths="kde_have_all_paths=\"yes\" \ + kde_htmldir=\"$kde_htmldir\" \ + kde_appsdir=\"$kde_appsdir\" \ + kde_icondir=\"$kde_icondir\" \ + kde_sounddir=\"$kde_sounddir\" \ + kde_datadir=\"$kde_datadir\" \ + kde_locale=\"$kde_locale\" \ + kde_cgidir=\"$kde_cgidir\" \ + kde_confdir=\"$kde_confdir\" \ + kde_kcfgdir=\"$kde_kcfgdir\" \ + kde_mimedir=\"$kde_mimedir\" \ + kde_toolbardir=\"$kde_toolbardir\" \ + kde_wallpaperdir=\"$kde_wallpaperdir\" \ + kde_templatesdir=\"$kde_templatesdir\" \ + kde_bindir=\"$kde_bindir\" \ + kde_servicesdir=\"$kde_servicesdir\" \ + kde_servicetypesdir=\"$kde_servicetypesdir\" \ + kde_moduledir=\"$kde_moduledir\" \ + kde_styledir=\"$kde_styledir\" \ + kde_widgetdir=\"$kde_widgetdir\" \ + xdg_appsdir=\"$xdg_appsdir\" \ + xdg_menudir=\"$xdg_menudir\" \ + xdg_directorydir=\"$xdg_directorydir\" \ + kde_result=$1" +]) + +AC_DEFUN([KDE_SET_DEFAULT_PATHS], +[ +if test "$1" = "default"; then + + if test -z "$kde_htmldir"; then + kde_htmldir='\${datadir}/doc/HTML' + fi + if test -z "$kde_appsdir"; then + kde_appsdir='\${datadir}/applnk' + fi + if test -z "$kde_icondir"; then + kde_icondir='\${datadir}/icons' + fi + if test -z "$kde_sounddir"; then + kde_sounddir='\${datadir}/sounds' + fi + if test -z "$kde_datadir"; then + kde_datadir='\${datadir}/apps' + fi + if test -z "$kde_locale"; then + kde_locale='\${datadir}/locale' + fi + if test -z "$kde_cgidir"; then + kde_cgidir='\${exec_prefix}/cgi-bin' + fi + if test -z "$kde_confdir"; then + kde_confdir='\${datadir}/config' + fi + if test -z "$kde_kcfgdir"; then + kde_kcfgdir='\${datadir}/config.kcfg' + fi + if test -z "$kde_mimedir"; then + kde_mimedir='\${datadir}/mimelnk' + fi + if test -z "$kde_toolbardir"; then + kde_toolbardir='\${datadir}/toolbar' + fi + if test -z "$kde_wallpaperdir"; then + kde_wallpaperdir='\${datadir}/wallpapers' + fi + if test -z "$kde_templatesdir"; then + kde_templatesdir='\${datadir}/templates' + fi + if test -z "$kde_bindir"; then + kde_bindir='\${exec_prefix}/bin' + fi + if test -z "$kde_servicesdir"; then + kde_servicesdir='\${datadir}/services' + fi + if test -z "$kde_servicetypesdir"; then + kde_servicetypesdir='\${datadir}/servicetypes' + fi + if test -z "$kde_moduledir"; then + if test "$kde_qtver" = "2"; then + kde_moduledir='\${libdir}/kde2' + else + kde_moduledir='\${libdir}/kde3' + fi + fi + if test -z "$kde_styledir"; then + kde_styledir='\${libdir}/kde3/plugins/styles' + fi + if test -z "$kde_widgetdir"; then + kde_widgetdir='\${libdir}/kde3/plugins/designer' + fi + if test -z "$xdg_appsdir"; then + xdg_appsdir='\${datadir}/applications/kde' + fi + if test -z "$xdg_menudir"; then + xdg_menudir='\${sysconfdir}/xdg/menus' + fi + if test -z "$xdg_directorydir"; then + xdg_directorydir='\${datadir}/desktop-directories' + fi + + KDE_SET_PATHS(defaults) + +else + + if test $kde_qtver = 1; then + AC_MSG_RESULT([compiling]) + KDE_1_CHECK_PATHS + else + AC_MSG_ERROR([path checking not yet supported for KDE 2]) + fi + +fi +]) + +AC_DEFUN([KDE_CHECK_PATHS_FOR_COMPLETENESS], +[ if test -z "$kde_htmldir" || test -z "$kde_appsdir" || + test -z "$kde_icondir" || test -z "$kde_sounddir" || + test -z "$kde_datadir" || test -z "$kde_locale" || + test -z "$kde_cgidir" || test -z "$kde_confdir" || + test -z "$kde_kcfgdir" || + test -z "$kde_mimedir" || test -z "$kde_toolbardir" || + test -z "$kde_wallpaperdir" || test -z "$kde_templatesdir" || + test -z "$kde_bindir" || test -z "$kde_servicesdir" || + test -z "$kde_servicetypesdir" || test -z "$kde_moduledir" || + test -z "$kde_styledir" || test -z "kde_widgetdir" || + test -z "$xdg_appsdir" || test -z "$xdg_menudir" || test -z "$xdg_directorydir" || + test "x$kde_have_all_paths" != "xyes"; then + kde_have_all_paths=no + fi +]) + +AC_DEFUN([KDE_MISSING_PROG_ERROR], +[ + AC_MSG_ERROR([The important program $1 was not found! +Please check whether you installed KDE correctly. +]) +]) + +AC_DEFUN([KDE_MISSING_ARTS_ERROR], +[ + AC_MSG_ERROR([The important program $1 was not found! +Please check whether you installed aRts correctly or use +--without-arts to compile without aRts support (this will remove functionality). +]) +]) + +AC_DEFUN([KDE_SET_DEFAULT_BINDIRS], +[ + kde_default_bindirs="/usr/bin /usr/local/bin /opt/local/bin /usr/X11R6/bin /opt/kde/bin /opt/kde3/bin /usr/kde/bin /usr/local/kde/bin" + test -n "$KDEDIR" && kde_default_bindirs="$KDEDIR/bin $kde_default_bindirs" + if test -n "$KDEDIRS"; then + kde_save_IFS=$IFS + IFS=: + for dir in $KDEDIRS; do + kde_default_bindirs="$dir/bin $kde_default_bindirs " + done + IFS=$kde_save_IFS + fi +]) + +AC_DEFUN([KDE_SUBST_PROGRAMS], +[ + AC_ARG_WITH(arts, + AC_HELP_STRING([--without-arts],[build without aRts [default=no]]), + [build_arts=$withval], + [build_arts=yes] + ) + AM_CONDITIONAL(include_ARTS, test "$build_arts" '!=' "no") + if test "$build_arts" = "no"; then + AC_DEFINE(WITHOUT_ARTS, 1, [Defined if compiling without arts]) + fi + + KDE_SET_DEFAULT_BINDIRS + kde_default_bindirs="$exec_prefix/bin $prefix/bin $kde_libs_prefix/bin $kde_default_bindirs" + KDE_FIND_PATH(dcopidl, DCOPIDL, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(dcopidl)]) + KDE_FIND_PATH(dcopidl2cpp, DCOPIDL2CPP, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(dcopidl2cpp)]) + if test "$build_arts" '!=' "no"; then + KDE_FIND_PATH(mcopidl, MCOPIDL, [$kde_default_bindirs], [KDE_MISSING_ARTS_ERROR(mcopidl)]) + KDE_FIND_PATH(artsc-config, ARTSCCONFIG, [$kde_default_bindirs], [KDE_MISSING_ARTS_ERROR(artsc-config)]) + fi + KDE_FIND_PATH(meinproc, MEINPROC, [$kde_default_bindirs]) + + kde32ornewer=1 + kde33ornewer=1 + if test -n "$kde_qtver" && test "$kde_qtver" -lt 3; then + kde32ornewer= + kde33ornewer= + else + if test "$kde_qtver" = "3"; then + if test "$kde_qtsubver" -le 1; then + kde32ornewer= + fi + if test "$kde_qtsubver" -le 2; then + kde33ornewer= + fi + if test "$KDECONFIG" != "compiled"; then + if test `$KDECONFIG --version | grep KDE | sed 's/KDE: \(...\).*/\1/'` = 3.2; then + kde33ornewer= + fi + fi + fi + fi + + if test -n "$kde32ornewer"; then + KDE_FIND_PATH(kconfig_compiler, KCONFIG_COMPILER, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(kconfig_compiler)]) + KDE_FIND_PATH(dcopidlng, DCOPIDLNG, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(dcopidlng)]) + fi + if test -n "$kde33ornewer"; then + KDE_FIND_PATH(makekdewidgets, MAKEKDEWIDGETS, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(makekdewidgets)]) + AC_SUBST(MAKEKDEWIDGETS) + fi + KDE_FIND_PATH(xmllint, XMLLINT, [${prefix}/bin ${exec_prefix}/bin], [XMLLINT=""]) + + if test -n "$MEINPROC" -a "$MEINPROC" != "compiled"; then + kde_sharedirs="/usr/share/kde /usr/local/share /usr/share /opt/kde3/share /opt/kde/share $prefix/share" + test -n "$KDEDIR" && kde_sharedirs="$KDEDIR/share $kde_sharedirs" + AC_FIND_FILE(apps/ksgmltools2/customization/kde-chunk.xsl, $kde_sharedirs, KDE_XSL_STYLESHEET) + if test "$KDE_XSL_STYLESHEET" = "NO"; then + KDE_XSL_STYLESHEET="" + else + KDE_XSL_STYLESHEET="$KDE_XSL_STYLESHEET/apps/ksgmltools2/customization/kde-chunk.xsl" + fi + fi + + DCOP_DEPENDENCIES='$(DCOPIDL)' + if test -n "$kde32ornewer"; then + KCFG_DEPENDENCIES='$(KCONFIG_COMPILER)' + DCOP_DEPENDENCIES='$(DCOPIDL) $(DCOPIDLNG)' + AC_SUBST(KCONFIG_COMPILER) + AC_SUBST(KCFG_DEPENDENCIES) + AC_SUBST(DCOPIDLNG) + fi + AC_SUBST(DCOPIDL) + AC_SUBST(DCOPIDL2CPP) + AC_SUBST(DCOP_DEPENDENCIES) + AC_SUBST(MCOPIDL) + AC_SUBST(ARTSCCONFIG) + AC_SUBST(MEINPROC) + AC_SUBST(KDE_XSL_STYLESHEET) + AC_SUBST(XMLLINT) +])dnl + +AC_DEFUN([AC_CREATE_KFSSTND], +[ +AC_REQUIRE([AC_CHECK_RPATH]) + +AC_MSG_CHECKING([for KDE paths]) +kde_result="" +kde_cached_paths=yes +AC_CACHE_VAL(kde_cv_all_paths, +[ + KDE_SET_DEFAULT_PATHS($1) + kde_cached_paths=no +]) +eval "$kde_cv_all_paths" +KDE_CHECK_PATHS_FOR_COMPLETENESS +if test "$kde_have_all_paths" = "no" && test "$kde_cached_paths" = "yes"; then + # wrong values were cached, may be, we can set better ones + kde_result= + kde_htmldir= kde_appsdir= kde_icondir= kde_sounddir= + kde_datadir= kde_locale= kde_cgidir= kde_confdir= kde_kcfgdir= + kde_mimedir= kde_toolbardir= kde_wallpaperdir= kde_templatesdir= + kde_bindir= kde_servicesdir= kde_servicetypesdir= kde_moduledir= + kde_have_all_paths= + kde_styledir= + kde_widgetdir= + xdg_appsdir = xdg_menudir= xdg_directorydir= + KDE_SET_DEFAULT_PATHS($1) + eval "$kde_cv_all_paths" + KDE_CHECK_PATHS_FOR_COMPLETENESS + kde_result="$kde_result (cache overridden)" +fi +if test "$kde_have_all_paths" = "no"; then + AC_MSG_ERROR([configure could not run a little KDE program to test the environment. +Since it had compiled and linked before, it must be a strange problem on your system. +Look at config.log for details. If you are not able to fix this, look at +http://www.kde.org/faq/installation.html or any www.kde.org mirror. +(If you're using an egcs version on Linux, you may update binutils!) +]) +else + rm -f conftest* + AC_MSG_RESULT($kde_result) +fi + +bindir=$kde_bindir + +KDE_SUBST_PROGRAMS + +]) + +AC_DEFUN([AC_SUBST_KFSSTND], +[ +AC_SUBST(kde_htmldir) +AC_SUBST(kde_appsdir) +AC_SUBST(kde_icondir) +AC_SUBST(kde_sounddir) +AC_SUBST(kde_datadir) +AC_SUBST(kde_locale) +AC_SUBST(kde_confdir) +AC_SUBST(kde_kcfgdir) +AC_SUBST(kde_mimedir) +AC_SUBST(kde_wallpaperdir) +AC_SUBST(kde_bindir) +dnl X Desktop Group standards +AC_SUBST(xdg_appsdir) +AC_SUBST(xdg_menudir) +AC_SUBST(xdg_directorydir) +dnl for KDE 2 +AC_SUBST(kde_templatesdir) +AC_SUBST(kde_servicesdir) +AC_SUBST(kde_servicetypesdir) +AC_SUBST(kde_moduledir) +AC_SUBST(kdeinitdir, '$(kde_moduledir)') +AC_SUBST(kde_styledir) +AC_SUBST(kde_widgetdir) +if test "$kde_qtver" = 1; then + kde_minidir="$kde_icondir/mini" +else +# for KDE 1 - this breaks KDE2 apps using minidir, but +# that's the plan ;-/ + kde_minidir="/dev/null" +fi +dnl AC_SUBST(kde_minidir) +dnl AC_SUBST(kde_cgidir) +dnl AC_SUBST(kde_toolbardir) +]) + +AC_DEFUN([KDE_MISC_TESTS], +[ + dnl Checks for libraries. + AC_CHECK_LIB(util, main, [LIBUTIL="-lutil"]) dnl for *BSD + AC_SUBST(LIBUTIL) + AC_CHECK_LIB(compat, main, [LIBCOMPAT="-lcompat"]) dnl for *BSD + AC_SUBST(LIBCOMPAT) + kde_have_crypt= + AC_CHECK_LIB(crypt, crypt, [LIBCRYPT="-lcrypt"; kde_have_crypt=yes], + AC_CHECK_LIB(c, crypt, [kde_have_crypt=yes], [ + AC_MSG_WARN([you have no crypt in either libcrypt or libc. +You should install libcrypt from another source or configure with PAM +support]) + kde_have_crypt=no + ])) + AC_SUBST(LIBCRYPT) + if test $kde_have_crypt = yes; then + AC_DEFINE_UNQUOTED(HAVE_CRYPT, 1, [Defines if your system has the crypt function]) + fi + AC_CHECK_SOCKLEN_T + AC_CHECK_LIB(dnet, dnet_ntoa, [X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"]) + if test $ac_cv_lib_dnet_dnet_ntoa = no; then + AC_CHECK_LIB(dnet_stub, dnet_ntoa, + [X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"]) + fi + AC_CHECK_FUNC(inet_ntoa) + if test $ac_cv_func_inet_ntoa = no; then + AC_CHECK_LIB(nsl, inet_ntoa, X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl") + fi + AC_CHECK_FUNC(connect) + if test $ac_cv_func_connect = no; then + AC_CHECK_LIB(socket, connect, X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS", , + $X_EXTRA_LIBS) + fi + + AC_CHECK_FUNC(remove) + if test $ac_cv_func_remove = no; then + AC_CHECK_LIB(posix, remove, X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix") + fi + + # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay. + AC_CHECK_FUNC(shmat, , + AC_CHECK_LIB(ipc, shmat, X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc")) + + # more headers that need to be explicitly included on darwin + AC_CHECK_HEADERS(sys/types.h stdint.h) + + # sys/bitypes.h is needed for uint32_t and friends on Tru64 + AC_CHECK_HEADERS(sys/bitypes.h) + + # darwin requires a poll emulation library + AC_CHECK_LIB(poll, poll, LIB_POLL="-lpoll") + + # for some image handling on Mac OS X + AC_CHECK_HEADERS(Carbon/Carbon.h) + + # CoreAudio framework + AC_CHECK_HEADER(CoreAudio/CoreAudio.h, [ + AC_DEFINE(HAVE_COREAUDIO, 1, [Define if you have the CoreAudio API]) + FRAMEWORK_COREAUDIO="-Wl,-framework,CoreAudio" + ]) + + AC_CHECK_RES_INIT + AC_SUBST(LIB_POLL) + AC_SUBST(FRAMEWORK_COREAUDIO) + LIBSOCKET="$X_EXTRA_LIBS" + AC_SUBST(LIBSOCKET) + AC_SUBST(X_EXTRA_LIBS) + AC_CHECK_LIB(ucb, killpg, [LIBUCB="-lucb"]) dnl for Solaris2.4 + AC_SUBST(LIBUCB) + + case $host in dnl this *is* LynxOS specific + *-*-lynxos* ) + AC_MSG_CHECKING([LynxOS header file wrappers]) + [CFLAGS="$CFLAGS -D__NO_INCLUDE_WARN__"] + AC_MSG_RESULT(disabled) + AC_CHECK_LIB(bsd, gethostbyname, [LIBSOCKET="-lbsd"]) dnl for LynxOS + ;; + esac + + KDE_CHECK_TYPES + KDE_CHECK_LIBDL + KDE_CHECK_STRLCPY + KDE_CHECK_PIE_SUPPORT + +# darwin needs this to initialize the environment +AC_CHECK_HEADERS(crt_externs.h) +AC_CHECK_FUNC(_NSGetEnviron, [AC_DEFINE(HAVE_NSGETENVIRON, 1, [Define if your system needs _NSGetEnviron to set up the environment])]) + +AH_VERBATIM(_DARWIN_ENVIRON, +[ +#if defined(HAVE_NSGETENVIRON) && defined(HAVE_CRT_EXTERNS_H) +# include +# include +# define environ (*_NSGetEnviron()) +#endif +]) + +AH_VERBATIM(_AIX_STRINGS_H_BZERO, +[ +/* + * AIX defines FD_SET in terms of bzero, but fails to include + * that defines bzero. + */ + +#if defined(_AIX) +#include +#endif +]) + +AC_CHECK_FUNCS([vsnprintf snprintf]) + +AH_VERBATIM(_TRU64,[ +/* + * On HP-UX, the declaration of vsnprintf() is needed every time ! + */ + +#if !defined(HAVE_VSNPRINTF) || defined(hpux) +#if __STDC__ +#include +#include +#else +#include +#endif +#ifdef __cplusplus +extern "C" +#endif +int vsnprintf(char *str, size_t n, char const *fmt, va_list ap); +#ifdef __cplusplus +extern "C" +#endif +int snprintf(char *str, size_t n, char const *fmt, ...); +#endif +]) + +]) + +dnl ------------------------------------------------------------------------ +dnl Find the header files and libraries for X-Windows. Extended the +dnl macro AC_PATH_X +dnl ------------------------------------------------------------------------ +dnl +AC_DEFUN([K_PATH_X], +[ +AC_REQUIRE([KDE_MISC_TESTS])dnl +AC_REQUIRE([KDE_CHECK_LIB64]) + +AC_ARG_ENABLE( + embedded, + AC_HELP_STRING([--enable-embedded],[link to Qt-embedded, don't use X]), + kde_use_qt_emb=$enableval, + kde_use_qt_emb=no +) + +AC_ARG_ENABLE( + qtopia, + AC_HELP_STRING([--enable-qtopia],[link to Qt-embedded, link to the Qtopia Environment]), + kde_use_qt_emb_palm=$enableval, + kde_use_qt_emb_palm=no +) + +AC_ARG_ENABLE( + mac, + AC_HELP_STRING([--enable-mac],[link to Qt/Mac (don't use X)]), + kde_use_qt_mac=$enableval, + kde_use_qt_mac=no +) + +# used to disable x11-specific stuff on special platforms +AM_CONDITIONAL(include_x11, test "$kde_use_qt_emb" = "no" && test "$kde_use_qt_mac" = "no") + +if test "$kde_use_qt_emb" = "no" && test "$kde_use_qt_mac" = "no"; then + +AC_MSG_CHECKING(for X) + +AC_CACHE_VAL(kde_cv_have_x, +[# One or both of the vars are not set, and there is no cached value. +if test "{$x_includes+set}" = set || test "$x_includes" = NONE; then + kde_x_includes=NO +else + kde_x_includes=$x_includes +fi +if test "{$x_libraries+set}" = set || test "$x_libraries" = NONE; then + kde_x_libraries=NO +else + kde_x_libraries=$x_libraries +fi + +# below we use the standard autoconf calls +ac_x_libraries=$kde_x_libraries +ac_x_includes=$kde_x_includes + +KDE_PATH_X_DIRECT +dnl AC_PATH_X_XMKMF picks /usr/lib as the path for the X libraries. +dnl Unfortunately, if compiling with the N32 ABI, this is not the correct +dnl location. The correct location is /usr/lib32 or an undefined value +dnl (the linker is smart enough to pick the correct default library). +dnl Things work just fine if you use just AC_PATH_X_DIRECT. +dnl Solaris has a similar problem. AC_PATH_X_XMKMF forces x_includes to +dnl /usr/openwin/include, which doesn't work. /usr/include does work, so +dnl x_includes should be left alone. +case "$host" in +mips-sgi-irix6*) + ;; +*-*-solaris*) + ;; +*) + _AC_PATH_X_XMKMF + if test -z "$ac_x_includes"; then + ac_x_includes="." + fi + if test -z "$ac_x_libraries"; then + ac_x_libraries="/usr/lib${kdelibsuff}" + fi +esac +#from now on we use our own again + +# when the user already gave --x-includes, we ignore +# what the standard autoconf macros told us. +if test "$kde_x_includes" = NO; then + kde_x_includes=$ac_x_includes +fi + +# for --x-libraries too +if test "$kde_x_libraries" = NO; then + kde_x_libraries=$ac_x_libraries +fi + +if test "$kde_x_includes" = NO; then + AC_MSG_ERROR([Can't find X includes. Please check your installation and add the correct paths!]) +fi + +if test "$kde_x_libraries" = NO; then + AC_MSG_ERROR([Can't find X libraries. Please check your installation and add the correct paths!]) +fi + +# Record where we found X for the cache. +kde_cv_have_x="have_x=yes \ + kde_x_includes=$kde_x_includes kde_x_libraries=$kde_x_libraries" +])dnl + +eval "$kde_cv_have_x" + +if test "$have_x" != yes; then + AC_MSG_RESULT($have_x) + no_x=yes +else + AC_MSG_RESULT([libraries $kde_x_libraries, headers $kde_x_includes]) +fi + +if test -z "$kde_x_includes" || test "x$kde_x_includes" = xNONE; then + X_INCLUDES="" + x_includes="."; dnl better than nothing :- + else + x_includes=$kde_x_includes + X_INCLUDES="-I$x_includes" +fi + +if test -z "$kde_x_libraries" || test "x$kde_x_libraries" = xNONE || test "$kde_x_libraries" = "/usr/lib"; then + X_LDFLAGS="" + x_libraries="/usr/lib"; dnl better than nothing :- + else + x_libraries=$kde_x_libraries + X_LDFLAGS="-L$x_libraries" +fi +all_includes="$X_INCLUDES" +all_libraries="$X_LDFLAGS $LDFLAGS_AS_NEEDED $LDFLAGS_NEW_DTAGS" + +# Check for libraries that X11R6 Xt/Xaw programs need. +ac_save_LDFLAGS="$LDFLAGS" +LDFLAGS="$LDFLAGS $X_LDFLAGS" +# SM needs ICE to (dynamically) link under SunOS 4.x (so we have to +# check for ICE first), but we must link in the order -lSM -lICE or +# we get undefined symbols. So assume we have SM if we have ICE. +# These have to be linked with before -lX11, unlike the other +# libraries we check for below, so use a different variable. +# --interran@uluru.Stanford.EDU, kb@cs.umb.edu. +AC_CHECK_LIB(ICE, IceConnectionNumber, + [LIBSM="-lSM -lICE"], , $X_EXTRA_LIBS) +LDFLAGS="$ac_save_LDFLAGS" + +LIB_X11='-lX11 $(LIBSOCKET)' + +AC_MSG_CHECKING(for libXext) +AC_CACHE_VAL(kde_cv_have_libXext, +[ +kde_ldflags_safe="$LDFLAGS" +kde_libs_safe="$LIBS" + +LDFLAGS="$LDFLAGS $X_LDFLAGS $USER_LDFLAGS" +LIBS="-lXext -lX11 $LIBSOCKET" + +AC_TRY_LINK([ +#include +#ifdef STDC_HEADERS +# include +#endif +], +[ +printf("hello Xext\n"); +], +kde_cv_have_libXext=yes, +kde_cv_have_libXext=no +) + +LDFLAGS=$kde_ldflags_safe +LIBS=$kde_libs_safe +]) + +AC_MSG_RESULT($kde_cv_have_libXext) + +if test "$kde_cv_have_libXext" = "no"; then + AC_MSG_ERROR([We need a working libXext to proceed. Since configure +can't find it itself, we stop here assuming that make wouldn't find +them either.]) +fi + +LIB_XEXT="-lXext" +QTE_NORTTI="" + +elif test "$kde_use_qt_emb" = "yes"; then + dnl We're using QT Embedded + CPPFLAGS=-DQWS + CXXFLAGS="$CXXFLAGS -fno-rtti" + QTE_NORTTI="-fno-rtti -DQWS" + X_PRE_LIBS="" + LIB_X11="" + LIB_XEXT="" + LIB_XRENDER="" + LIBSM="" + X_INCLUDES="" + X_LDFLAGS="" + x_includes="" + x_libraries="" +elif test "$kde_use_qt_mac" = "yes"; then + dnl We're using QT/Mac (I use QT_MAC so that qglobal.h doesn't *have* to + dnl be included to get the information) --Sam + CXXFLAGS="$CXXFLAGS -DQT_MAC -no-cpp-precomp" + CFLAGS="$CFLAGS -DQT_MAC -no-cpp-precomp" + X_PRE_LIBS="" + LIB_X11="" + LIB_XEXT="" + LIB_XRENDER="" + LIBSM="" + X_INCLUDES="" + X_LDFLAGS="" + x_includes="" + x_libraries="" +fi +AC_SUBST(X_PRE_LIBS) +AC_SUBST(LIB_X11) +AC_SUBST(LIB_XRENDER) +AC_SUBST(LIBSM) +AC_SUBST(X_INCLUDES) +AC_SUBST(X_LDFLAGS) +AC_SUBST(x_includes) +AC_SUBST(x_libraries) +AC_SUBST(QTE_NORTTI) +AC_SUBST(LIB_XEXT) + +]) + +AC_DEFUN([KDE_PRINT_QT_PROGRAM], +[ +AC_REQUIRE([KDE_USE_QT]) +cat > conftest.$ac_ext < +#include +EOF +if test "$kde_qtver" = "2"; then +cat >> conftest.$ac_ext < +#include +#include +EOF + +if test $kde_qtsubver -gt 0; then +cat >> conftest.$ac_ext <> conftest.$ac_ext < +#include +#include +EOF +fi + +echo "#if ! ($kde_qt_verstring)" >> conftest.$ac_ext +cat >> conftest.$ac_ext <> conftest.$ac_ext <> conftest.$ac_ext <> conftest.$ac_ext <> conftest.$ac_ext <&AC_FD_CC + cat conftest.$ac_ext >&AC_FD_CC +fi + +rm -f conftest* +CXXFLAGS="$ac_cxxflags_safe" +LDFLAGS="$ac_ldflags_safe" +LIBS="$ac_libs_safe" + +LD_LIBRARY_PATH="$ac_LD_LIBRARY_PATH_safe" +export LD_LIBRARY_PATH +LIBRARY_PATH="$ac_LIBRARY_PATH" +export LIBRARY_PATH +AC_LANG_RESTORE +]) + +if test "$kde_cv_qt_direct" = "yes"; then + AC_MSG_RESULT(yes) + $1 +else + AC_MSG_RESULT(no) + $2 +fi +]) + +dnl ------------------------------------------------------------------------ +dnl Try to find the Qt headers and libraries. +dnl $(QT_LDFLAGS) will be -Lqtliblocation (if needed) +dnl and $(QT_INCLUDES) will be -Iqthdrlocation (if needed) +dnl ------------------------------------------------------------------------ +dnl +AC_DEFUN([AC_PATH_QT_1_3], +[ +AC_REQUIRE([K_PATH_X]) +AC_REQUIRE([KDE_USE_QT]) +AC_REQUIRE([KDE_CHECK_LIB64]) + +dnl ------------------------------------------------------------------------ +dnl Add configure flag to enable linking to MT version of Qt library. +dnl ------------------------------------------------------------------------ + +AC_ARG_ENABLE( + mt, + AC_HELP_STRING([--disable-mt],[link to non-threaded Qt (deprecated)]), + kde_use_qt_mt=$enableval, + [ + if test $kde_qtver = 3; then + kde_use_qt_mt=yes + else + kde_use_qt_mt=no + fi + ] +) + +USING_QT_MT="" + +dnl ------------------------------------------------------------------------ +dnl If we not get --disable-qt-mt then adjust some vars for the host. +dnl ------------------------------------------------------------------------ + +KDE_MT_LDFLAGS= +KDE_MT_LIBS= +if test "x$kde_use_qt_mt" = "xyes"; then + KDE_CHECK_THREADING + if test "x$kde_use_threading" = "xyes"; then + CPPFLAGS="$USE_THREADS -DQT_THREAD_SUPPORT $CPPFLAGS" + KDE_MT_LDFLAGS="$USE_THREADS" + KDE_MT_LIBS="$LIBPTHREAD" + else + kde_use_qt_mt=no + fi +fi +AC_SUBST(KDE_MT_LDFLAGS) +AC_SUBST(KDE_MT_LIBS) + +kde_qt_was_given=yes + +dnl ------------------------------------------------------------------------ +dnl If we haven't been told how to link to Qt, we work it out for ourselves. +dnl ------------------------------------------------------------------------ +if test -z "$LIBQT_GLOB"; then + if test "x$kde_use_qt_emb" = "xyes"; then + LIBQT_GLOB="libqte.*" + else + LIBQT_GLOB="libqt.*" + fi +fi + +dnl ------------------------------------------------------------ +dnl If we got --enable-embedded then adjust the Qt library name. +dnl ------------------------------------------------------------ +if test "x$kde_use_qt_emb" = "xyes"; then + qtlib="qte" +else + qtlib="qt" +fi + +kde_int_qt="-l$qtlib" + +if test -z "$LIBQPE"; then +dnl ------------------------------------------------------------ +dnl If we got --enable-palmtop then add -lqpe to the link line +dnl ------------------------------------------------------------ + if test "x$kde_use_qt_emb" = "xyes"; then + if test "x$kde_use_qt_emb_palm" = "xyes"; then + LIB_QPE="-lqpe" + else + LIB_QPE="" + fi + else + LIB_QPE="" + fi +fi + +dnl ------------------------------------------------------------------------ +dnl If we got --enable-qt-mt then adjust the Qt library name for the host. +dnl ------------------------------------------------------------------------ + +if test "x$kde_use_qt_mt" = "xyes"; then + LIBQT="-l$qtlib-mt" + kde_int_qt="-l$qtlib-mt" + LIBQT_GLOB="lib$qtlib-mt.*" + USING_QT_MT="using -mt" +else + LIBQT="-l$qtlib" +fi + +if test $kde_qtver != 1; then + + AC_REQUIRE([AC_FIND_PNG]) + AC_REQUIRE([AC_FIND_JPEG]) + LIBQT="$LIBQT $LIBPNG $LIBJPEG" +fi + +if test $kde_qtver = 3; then + AC_REQUIRE([KDE_CHECK_LIBDL]) + LIBQT="$LIBQT $LIBDL" +fi + +AC_MSG_CHECKING([for Qt]) + +if test "x$kde_use_qt_emb" != "xyes" && test "x$kde_use_qt_mac" != "xyes"; then +LIBQT="$LIBQT $X_PRE_LIBS -lXext -lX11 $LIBSM $LIBSOCKET" +fi +ac_qt_includes=NO ac_qt_libraries=NO ac_qt_bindir=NO +qt_libraries="" +qt_includes="" +AC_ARG_WITH(qt-dir, + AC_HELP_STRING([--with-qt-dir=DIR],[where the root of Qt is installed ]), + [ ac_qt_includes="$withval"/include + ac_qt_libraries="$withval"/lib${kdelibsuff} + ac_qt_bindir="$withval"/bin + ]) + +AC_ARG_WITH(qt-includes, + AC_HELP_STRING([--with-qt-includes=DIR],[where the Qt includes are. ]), + [ + ac_qt_includes="$withval" + ]) + +kde_qt_libs_given=no + +AC_ARG_WITH(qt-libraries, + AC_HELP_STRING([--with-qt-libraries=DIR],[where the Qt library is installed.]), + [ ac_qt_libraries="$withval" + kde_qt_libs_given=yes + ]) + +AC_CACHE_VAL(ac_cv_have_qt, +[#try to guess Qt locations + +qt_incdirs="" +for dir in $kde_qt_dirs; do + qt_incdirs="$qt_incdirs $dir/include $dir" +done +qt_incdirs="$QTINC $qt_incdirs /usr/local/qt/include /usr/include/qt /usr/include /usr/X11R6/include/X11/qt /usr/X11R6/include/qt /usr/X11R6/include/qt2 /usr/include/qt3 $x_includes" +if test ! "$ac_qt_includes" = "NO"; then + qt_incdirs="$ac_qt_includes $qt_incdirs" +fi + +if test "$kde_qtver" != "1"; then + kde_qt_header=qstyle.h +else + kde_qt_header=qglobal.h +fi + +AC_FIND_FILE($kde_qt_header, $qt_incdirs, qt_incdir) +ac_qt_includes="$qt_incdir" + +qt_libdirs="" +for dir in $kde_qt_dirs; do + qt_libdirs="$qt_libdirs $dir/lib${kdelibsuff} $dir" +done +qt_libdirs="$QTLIB $qt_libdirs /usr/X11R6/lib /usr/lib /usr/local/qt/lib $x_libraries" +if test ! "$ac_qt_libraries" = "NO"; then + qt_libdir=$ac_qt_libraries +else + qt_libdirs="$ac_qt_libraries $qt_libdirs" + # if the Qt was given, the chance is too big that libqt.* doesn't exist + qt_libdir=NONE + for dir in $qt_libdirs; do + try="ls -1 $dir/${LIBQT_GLOB}" + if test -n "`$try 2> /dev/null`"; then qt_libdir=$dir; break; else echo "tried $dir" >&AC_FD_CC ; fi + done +fi +for a in $qt_libdir/lib`echo ${kde_int_qt} | sed 's,^-l,,'`_incremental.*; do + if test -e "$a"; then + LIBQT="$LIBQT ${kde_int_qt}_incremental" + break + fi +done + +ac_qt_libraries="$qt_libdir" + +AC_LANG_SAVE +AC_LANG_CPLUSPLUS + +ac_cxxflags_safe="$CXXFLAGS" +ac_ldflags_safe="$LDFLAGS" +ac_libs_safe="$LIBS" + +CXXFLAGS="$CXXFLAGS -I$qt_incdir $all_includes" +LDFLAGS="$LDFLAGS -L$qt_libdir $all_libraries $USER_LDFLAGS $KDE_MT_LDFLAGS" +LIBS="$LIBS $LIBQT $KDE_MT_LIBS" + +KDE_PRINT_QT_PROGRAM + +if AC_TRY_EVAL(ac_link) && test -s conftest; then + rm -f conftest* +else + echo "configure: failed program was:" >&AC_FD_CC + cat conftest.$ac_ext >&AC_FD_CC + ac_qt_libraries="NO" +fi +rm -f conftest* +CXXFLAGS="$ac_cxxflags_safe" +LDFLAGS="$ac_ldflags_safe" +LIBS="$ac_libs_safe" + +AC_LANG_RESTORE +if test "$ac_qt_includes" = NO || test "$ac_qt_libraries" = NO; then + ac_cv_have_qt="have_qt=no" + ac_qt_notfound="" + missing_qt_mt="" + if test "$ac_qt_includes" = NO; then + if test "$ac_qt_libraries" = NO; then + ac_qt_notfound="(headers and libraries)"; + else + ac_qt_notfound="(headers)"; + fi + else + if test "x$kde_use_qt_mt" = "xyes"; then + missing_qt_mt=" +Make sure that you have compiled Qt with thread support!" + ac_qt_notfound="(library $qtlib-mt)"; + else + ac_qt_notfound="(library $qtlib)"; + fi + fi + + AC_MSG_ERROR([Qt ($kde_qt_minversion) $ac_qt_notfound not found. Please check your installation! +For more details about this problem, look at the end of config.log.$missing_qt_mt]) +else + have_qt="yes" +fi +]) + +eval "$ac_cv_have_qt" + +if test "$have_qt" != yes; then + AC_MSG_RESULT([$have_qt]); +else + ac_cv_have_qt="have_qt=yes \ + ac_qt_includes=$ac_qt_includes ac_qt_libraries=$ac_qt_libraries" + AC_MSG_RESULT([libraries $ac_qt_libraries, headers $ac_qt_includes $USING_QT_MT]) + + qt_libraries="$ac_qt_libraries" + qt_includes="$ac_qt_includes" +fi + +if test ! "$kde_qt_libs_given" = "yes" && test ! "$kde_qtver" = 3; then + KDE_CHECK_QT_DIRECT(qt_libraries= ,[]) +fi + +AC_SUBST(qt_libraries) +AC_SUBST(qt_includes) + +if test "$qt_includes" = "$x_includes" || test -z "$qt_includes"; then + QT_INCLUDES="" +else + QT_INCLUDES="-I$qt_includes" + all_includes="$QT_INCLUDES $all_includes" +fi + +if test "$qt_libraries" = "$x_libraries" || test -z "$qt_libraries"; then + QT_LDFLAGS="" +else + QT_LDFLAGS="-L$qt_libraries" + all_libraries="$QT_LDFLAGS $all_libraries" +fi +test -z "$KDE_MT_LDFLAGS" || all_libraries="$all_libraries $KDE_MT_LDFLAGS" + +AC_SUBST(QT_INCLUDES) +AC_SUBST(QT_LDFLAGS) +AC_PATH_QT_MOC_UIC + +KDE_CHECK_QT_JPEG + +if test "x$kde_use_qt_emb" != "xyes" && test "x$kde_use_qt_mac" != "xyes"; then +LIB_QT="$kde_int_qt $LIBJPEG_QT "'$(LIBZ) $(LIBPNG) -lXext $(LIB_X11) $(LIBSM)' +else +LIB_QT="$kde_int_qt $LIBJPEG_QT "'$(LIBZ) $(LIBPNG)' +fi +test -z "$KDE_MT_LIBS" || LIB_QT="$LIB_QT $KDE_MT_LIBS" +for a in $qt_libdir/lib`echo ${kde_int_qt} | sed 's,^-l,,'`_incremental.*; do + if test -e "$a"; then + LIB_QT="$LIB_QT ${kde_int_qt}_incremental" + break + fi +done + +AC_SUBST(LIB_QT) +AC_SUBST(LIB_QPE) + +AC_SUBST(kde_qtver) +]) + +AC_DEFUN([AC_PATH_QT], +[ +AC_PATH_QT_1_3 +]) + +AC_DEFUN([KDE_CHECK_UIC_PLUGINS], +[ +AC_REQUIRE([AC_PATH_QT_MOC_UIC]) + +if test x$ac_uic_supports_libpath = xyes; then + +AC_MSG_CHECKING([if UIC has KDE plugins available]) +AC_CACHE_VAL(kde_cv_uic_plugins, +[ +cat > actest.ui << EOF + +NewConnectionDialog + + + + testInput + + + + +EOF + + + +kde_cv_uic_plugins=no +kde_line="$UIC_PATH -L $kde_widgetdir" +if test x$ac_uic_supports_nounload = xyes; then + kde_line="$kde_line -nounload" +fi +kde_line="$kde_line -impl actest.h actest.ui > actest.cpp" +if AC_TRY_EVAL(kde_line); then + # if you're trying to debug this check and think it's incorrect, + # better check your installation. The check _is_ correct - your + # installation is not. + if test -f actest.cpp && grep klineedit actest.cpp > /dev/null; then + kde_cv_uic_plugins=yes + fi +fi +rm -f actest.ui actest.cpp +]) + +AC_MSG_RESULT([$kde_cv_uic_plugins]) +if test "$kde_cv_uic_plugins" != yes; then + AC_MSG_ERROR([ +you need to install kdelibs first. + +If you did install kdelibs, then the Qt version that is picked up by +this configure is not the same version you used to compile kdelibs. +The Qt Plugin installed by kdelibs is *ONLY* loadable if it is the +_same Qt version_, compiled with the _same compiler_ and the same Qt +configuration settings. +]) +fi +fi +]) + +AC_DEFUN([KDE_CHECK_FINAL], +[ + AC_ARG_ENABLE(final, + AC_HELP_STRING([--enable-final], + [build size optimized apps (experimental - needs lots of memory)]), + kde_use_final=$enableval, kde_use_final=no) + + if test "x$kde_use_final" = "xyes"; then + KDE_USE_FINAL_TRUE="" + KDE_USE_FINAL_FALSE="#" + else + KDE_USE_FINAL_TRUE="#" + KDE_USE_FINAL_FALSE="" + fi + AC_SUBST(KDE_USE_FINAL_TRUE) + AC_SUBST(KDE_USE_FINAL_FALSE) +]) + +AC_DEFUN([KDE_CHECK_CLOSURE], +[ + AC_ARG_ENABLE(closure, + AC_HELP_STRING([--enable-closure],[delay template instantiation]), + kde_use_closure=$enableval, kde_use_closure=no) + + KDE_NO_UNDEFINED="" + if test "x$kde_use_closure" = "xyes"; then + KDE_USE_CLOSURE_TRUE="" + KDE_USE_CLOSURE_FALSE="#" +# CXXFLAGS="$CXXFLAGS $REPO" + else + KDE_USE_CLOSURE_TRUE="#" + KDE_USE_CLOSURE_FALSE="" + KDE_NO_UNDEFINED="" + case $host in + *-*-linux-gnu) + KDE_CHECK_COMPILER_FLAG([Wl,--no-undefined], + [KDE_CHECK_COMPILER_FLAG([Wl,--allow-shlib-undefined], + [KDE_NO_UNDEFINED="-Wl,--no-undefined -Wl,--allow-shlib-undefined"], + [KDE_NO_UNDEFINED=""])], + [KDE_NO_UNDEFINED=""]) + ;; + esac + fi + AC_SUBST(KDE_USE_CLOSURE_TRUE) + AC_SUBST(KDE_USE_CLOSURE_FALSE) + AC_SUBST(KDE_NO_UNDEFINED) +]) + +dnl Check if the linker supports --enable-new-dtags and --as-needed +AC_DEFUN([KDE_CHECK_NEW_LDFLAGS], +[ + AC_ARG_ENABLE(new_ldflags, + AC_HELP_STRING([--enable-new-ldflags], + [enable the new linker flags]), + kde_use_new_ldflags=$enableval, + kde_use_new_ldflags=no) + + LDFLAGS_AS_NEEDED="" + LDFLAGS_NEW_DTAGS="" + if test "x$kde_use_new_ldflags" = "xyes"; then + LDFLAGS_NEW_DTAGS="" + KDE_CHECK_COMPILER_FLAG([Wl,--enable-new-dtags], + [LDFLAGS_NEW_DTAGS="-Wl,--enable-new-dtags"],) + + KDE_CHECK_COMPILER_FLAG([Wl,--as-needed], + [LDFLAGS_AS_NEEDED="-Wl,--as-needed"],) + fi + AC_SUBST(LDFLAGS_AS_NEEDED) + AC_SUBST(LDFLAGS_NEW_DTAGS) +]) + +AC_DEFUN([KDE_CHECK_NMCHECK], +[ + AC_ARG_ENABLE(nmcheck,AC_HELP_STRING([--enable-nmcheck],[enable automatic namespace cleanness check]), + kde_use_nmcheck=$enableval, kde_use_nmcheck=no) + + if test "$kde_use_nmcheck" = "yes"; then + KDE_USE_NMCHECK_TRUE="" + KDE_USE_NMCHECK_FALSE="#" + else + KDE_USE_NMCHECK_TRUE="#" + KDE_USE_NMCHECK_FALSE="" + fi + AC_SUBST(KDE_USE_NMCHECK_TRUE) + AC_SUBST(KDE_USE_NMCHECK_FALSE) +]) + +AC_DEFUN([KDE_EXPAND_MAKEVAR], [ +savex=$exec_prefix +test "x$exec_prefix" = xNONE && exec_prefix=$prefix +tmp=$$2 +while $1=`eval echo "$tmp"`; test "x$$1" != "x$tmp"; do tmp=$$1; done +exec_prefix=$savex +]) + +dnl ------------------------------------------------------------------------ +dnl Now, the same with KDE +dnl $(KDE_LDFLAGS) will be the kdeliblocation (if needed) +dnl and $(kde_includes) will be the kdehdrlocation (if needed) +dnl ------------------------------------------------------------------------ +dnl +AC_DEFUN([AC_BASE_PATH_KDE], +[ +AC_REQUIRE([KDE_CHECK_STL]) +AC_REQUIRE([AC_PATH_QT])dnl +AC_REQUIRE([KDE_CHECK_LIB64]) + +AC_CHECK_RPATH +AC_MSG_CHECKING([for KDE]) + +if test "${prefix}" != NONE; then + kde_includes=${includedir} + KDE_EXPAND_MAKEVAR(ac_kde_includes, includedir) + + kde_libraries=${libdir} + KDE_EXPAND_MAKEVAR(ac_kde_libraries, libdir) + +else + ac_kde_includes= + ac_kde_libraries= + kde_libraries="" + kde_includes="" +fi + +AC_CACHE_VAL(ac_cv_have_kde, +[#try to guess kde locations + +if test "$kde_qtver" = 1; then + kde_check_header="ksock.h" + kde_check_lib="libkdecore.la" +else + kde_check_header="ksharedptr.h" + kde_check_lib="libkio.la" +fi + +if test -z "$1"; then + +kde_incdirs="$kde_libs_prefix/include /usr/lib/kde/include /usr/local/kde/include /usr/local/include /usr/kde/include /usr/include/kde /usr/include /opt/kde3/include /opt/kde/include $x_includes $qt_includes" +test -n "$KDEDIR" && kde_incdirs="$KDEDIR/include $KDEDIR/include/kde $KDEDIR $kde_incdirs" +kde_incdirs="$ac_kde_includes $kde_incdirs" +AC_FIND_FILE($kde_check_header, $kde_incdirs, kde_incdir) +ac_kde_includes="$kde_incdir" + +if test -n "$ac_kde_includes" && test ! -r "$ac_kde_includes/$kde_check_header"; then + AC_MSG_ERROR([ +in the prefix, you've chosen, are no KDE headers installed. This will fail. +So, check this please and use another prefix!]) +fi + +kde_libdirs="$kde_libs_prefix/lib${kdelibsuff} /usr/lib/kde/lib${kdelibsuff} /usr/local/kde/lib${kdelibsuff} /usr/kde/lib${kdelibsuff} /usr/lib${kdelibsuff}/kde /usr/lib${kdelibsuff}/kde3 /usr/lib${kdelibsuff} /usr/X11R6/lib${kdelibsuff} /usr/local/lib${kdelibsuff} /opt/kde3/lib${kdelibsuff} /opt/kde/lib${kdelibsuff} /usr/X11R6/kde/lib${kdelibsuff}" +test -n "$KDEDIR" && kde_libdirs="$KDEDIR/lib${kdelibsuff} $KDEDIR $kde_libdirs" +kde_libdirs="$ac_kde_libraries $libdir $kde_libdirs" +AC_FIND_FILE($kde_check_lib, $kde_libdirs, kde_libdir) +ac_kde_libraries="$kde_libdir" + +kde_widgetdir=NO +dnl this might be somewhere else +AC_FIND_FILE("kde3/plugins/designer/kdewidgets.la", $kde_libdirs, kde_widgetdir) + +if test -n "$ac_kde_libraries" && test ! -r "$ac_kde_libraries/$kde_check_lib"; then +AC_MSG_ERROR([ +in the prefix, you've chosen, are no KDE libraries installed. This will fail. +So, check this please and use another prefix!]) +fi + +if test -n "$kde_widgetdir" && test ! -r "$kde_widgetdir/kde3/plugins/designer/kdewidgets.la"; then +AC_MSG_ERROR([ +I can't find the designer plugins. These are required and should have been installed +by kdelibs]) +fi + +if test -n "$kde_widgetdir"; then + kde_widgetdir="$kde_widgetdir/kde3/plugins/designer" +fi + + +if test "$ac_kde_includes" = NO || test "$ac_kde_libraries" = NO || test "$kde_widgetdir" = NO; then + ac_cv_have_kde="have_kde=no" +else + ac_cv_have_kde="have_kde=yes \ + ac_kde_includes=$ac_kde_includes ac_kde_libraries=$ac_kde_libraries" +fi + +else dnl test -z $1, e.g. from kdelibs + + ac_cv_have_kde="have_kde=no" + +fi +])dnl + +eval "$ac_cv_have_kde" + +if test "$have_kde" != "yes"; then + if test "${prefix}" = NONE; then + ac_kde_prefix="$ac_default_prefix" + else + ac_kde_prefix="$prefix" + fi + if test "$exec_prefix" = NONE; then + ac_kde_exec_prefix="$ac_kde_prefix" + AC_MSG_RESULT([will be installed in $ac_kde_prefix]) + else + ac_kde_exec_prefix="$exec_prefix" + AC_MSG_RESULT([will be installed in $ac_kde_prefix and $ac_kde_exec_prefix]) + fi + + kde_libraries="${libdir}" + kde_includes="${includedir}" + +else + ac_cv_have_kde="have_kde=yes \ + ac_kde_includes=$ac_kde_includes ac_kde_libraries=$ac_kde_libraries" + AC_MSG_RESULT([libraries $ac_kde_libraries, headers $ac_kde_includes]) + + kde_libraries="$ac_kde_libraries" + kde_includes="$ac_kde_includes" +fi +AC_SUBST(kde_libraries) +AC_SUBST(kde_includes) + +if test "$kde_includes" = "$x_includes" || test "$kde_includes" = "$qt_includes" || test "$kde_includes" = "/usr/include"; then + KDE_INCLUDES="" +else + KDE_INCLUDES="-I$kde_includes" + all_includes="$KDE_INCLUDES $all_includes" +fi + +KDE_DEFAULT_CXXFLAGS="-DQT_CLEAN_NAMESPACE -DQT_NO_ASCII_CAST -DQT_NO_STL -DQT_NO_COMPAT -DQT_NO_TRANSLATION" + +KDE_LDFLAGS="-L$kde_libraries" +if test ! "$kde_libraries" = "$x_libraries" && test ! "$kde_libraries" = "$qt_libraries" ; then + all_libraries="$KDE_LDFLAGS $all_libraries" +fi + +AC_SUBST(KDE_LDFLAGS) +AC_SUBST(KDE_INCLUDES) + +AC_REQUIRE([KDE_CHECK_EXTRA_LIBS]) + +all_libraries="$all_libraries $USER_LDFLAGS" +all_includes="$all_includes $USER_INCLUDES" +AC_SUBST(all_includes) +AC_SUBST(all_libraries) + +if test -z "$1"; then +KDE_CHECK_UIC_PLUGINS +fi + +ac_kde_libraries="$kde_libdir" + +AC_SUBST(AUTODIRS) + + +]) + +AC_DEFUN([KDE_CHECK_EXTRA_LIBS], +[ +AC_MSG_CHECKING(for extra includes) +AC_ARG_WITH(extra-includes,AC_HELP_STRING([--with-extra-includes=DIR],[adds non standard include paths]), + kde_use_extra_includes="$withval", + kde_use_extra_includes=NONE +) +kde_extra_includes= +if test -n "$kde_use_extra_includes" && \ + test "$kde_use_extra_includes" != "NONE"; then + + ac_save_ifs=$IFS + IFS=':' + for dir in $kde_use_extra_includes; do + kde_extra_includes="$kde_extra_includes $dir" + USER_INCLUDES="$USER_INCLUDES -I$dir" + done + IFS=$ac_save_ifs + kde_use_extra_includes="added" +else + kde_use_extra_includes="no" +fi +AC_SUBST(USER_INCLUDES) + +AC_MSG_RESULT($kde_use_extra_includes) + +kde_extra_libs= +AC_MSG_CHECKING(for extra libs) +AC_ARG_WITH(extra-libs,AC_HELP_STRING([--with-extra-libs=DIR],[adds non standard library paths]), + kde_use_extra_libs=$withval, + kde_use_extra_libs=NONE +) +if test -n "$kde_use_extra_libs" && \ + test "$kde_use_extra_libs" != "NONE"; then + + ac_save_ifs=$IFS + IFS=':' + for dir in $kde_use_extra_libs; do + kde_extra_libs="$kde_extra_libs $dir" + KDE_EXTRA_RPATH="$KDE_EXTRA_RPATH -R $dir" + USER_LDFLAGS="$USER_LDFLAGS -L$dir" + done + IFS=$ac_save_ifs + kde_use_extra_libs="added" +else + kde_use_extra_libs="no" +fi + +AC_SUBST(USER_LDFLAGS) + +AC_MSG_RESULT($kde_use_extra_libs) + +]) + +AC_DEFUN([KDE_1_CHECK_PATH_HEADERS], +[ + AC_MSG_CHECKING([for KDE headers installed]) + AC_LANG_SAVE + AC_LANG_CPLUSPLUS +cat > conftest.$ac_ext < +#endif +#include +#include "confdefs.h" +#include + +int main() { + printf("kde_htmldir=\\"%s\\"\n", KApplication::kde_htmldir().data()); + printf("kde_appsdir=\\"%s\\"\n", KApplication::kde_appsdir().data()); + printf("kde_icondir=\\"%s\\"\n", KApplication::kde_icondir().data()); + printf("kde_sounddir=\\"%s\\"\n", KApplication::kde_sounddir().data()); + printf("kde_datadir=\\"%s\\"\n", KApplication::kde_datadir().data()); + printf("kde_locale=\\"%s\\"\n", KApplication::kde_localedir().data()); + printf("kde_cgidir=\\"%s\\"\n", KApplication::kde_cgidir().data()); + printf("kde_confdir=\\"%s\\"\n", KApplication::kde_configdir().data()); + printf("kde_mimedir=\\"%s\\"\n", KApplication::kde_mimedir().data()); + printf("kde_toolbardir=\\"%s\\"\n", KApplication::kde_toolbardir().data()); + printf("kde_wallpaperdir=\\"%s\\"\n", + KApplication::kde_wallpaperdir().data()); + printf("kde_bindir=\\"%s\\"\n", KApplication::kde_bindir().data()); + printf("kde_partsdir=\\"%s\\"\n", KApplication::kde_partsdir().data()); + printf("kde_servicesdir=\\"/tmp/dummy\\"\n"); + printf("kde_servicetypesdir=\\"/tmp/dummy\\"\n"); + printf("kde_moduledir=\\"/tmp/dummy\\"\n"); + printf("kde_styledir=\\"/tmp/dummy\\"\n"); + printf("kde_widgetdir=\\"/tmp/dummy\\"\n"); + printf("xdg_appsdir=\\"/tmp/dummy\\"\n"); + printf("xdg_menudir=\\"/tmp/dummy\\"\n"); + printf("xdg_directorydir=\\"/tmp/dummy\\"\n"); + printf("kde_kcfgdir=\\"/tmp/dummy\\"\n"); + return 0; + } +EOF + + ac_save_CPPFLAGS=$CPPFLAGS + CPPFLAGS="$all_includes $CPPFLAGS" + if AC_TRY_EVAL(ac_compile); then + AC_MSG_RESULT(yes) + else + AC_MSG_ERROR([your system is not able to compile a small KDE application! +Check, if you installed the KDE header files correctly. +For more details about this problem, look at the end of config.log.]) + fi + CPPFLAGS=$ac_save_CPPFLAGS + + AC_LANG_RESTORE +]) + +AC_DEFUN([KDE_CHECK_KDEQTADDON], +[ +AC_MSG_CHECKING(for kde-qt-addon) +AC_CACHE_VAL(kde_cv_have_kdeqtaddon, +[ + kde_ldflags_safe="$LDFLAGS" + kde_libs_safe="$LIBS" + kde_cxxflags_safe="$CXXFLAGS" + + LIBS="-lkde-qt-addon $LIBQT $LIBS" + CXXFLAGS="$CXXFLAGS -I$prefix/include -I$prefix/include/kde $all_includes" + LDFLAGS="$LDFLAGS $all_libraries $USER_LDFLAGS" + + AC_TRY_LINK([ + #include + ], + [ + QDomDocument doc; + ], + kde_cv_have_kdeqtaddon=yes, + kde_cv_have_kdeqtaddon=no + ) + + LDFLAGS=$kde_ldflags_safe + LIBS=$kde_libs_safe + CXXFLAGS=$kde_cxxflags_safe +]) + +AC_MSG_RESULT($kde_cv_have_kdeqtaddon) + +if test "$kde_cv_have_kdeqtaddon" = "no"; then + AC_MSG_ERROR([Can't find libkde-qt-addon. You need to install it first. +It is a separate package (and CVS module) named kde-qt-addon.]) +fi +]) + +AC_DEFUN([KDE_CREATE_LIBS_ALIASES], +[ + AC_REQUIRE([KDE_MISC_TESTS]) + AC_REQUIRE([KDE_CHECK_LIBDL]) + AC_REQUIRE([K_PATH_X]) + +if test $kde_qtver = 3; then + case $host in + *cygwin*) lib_kded="-lkdeinit_kded" ;; + *) lib_kded="" ;; + esac + AC_SUBST(LIB_KDED, $lib_kded) + AC_SUBST(LIB_KDECORE, "-lkdecore") + AC_SUBST(LIB_KDEUI, "-lkdeui") + AC_SUBST(LIB_KIO, "-lkio") + AC_SUBST(LIB_KJS, "-lkjs") + AC_SUBST(LIB_SMB, "-lsmb") + AC_SUBST(LIB_KAB, "-lkab") + AC_SUBST(LIB_KABC, "-lkabc") + AC_SUBST(LIB_KHTML, "-lkhtml") + AC_SUBST(LIB_KSPELL, "-lkspell") + AC_SUBST(LIB_KPARTS, "-lkparts") + AC_SUBST(LIB_KDEPRINT, "-lkdeprint") + AC_SUBST(LIB_KUTILS, "-lkutils") + AC_SUBST(LIB_KDEPIM, "-lkdepim") + AC_SUBST(LIB_KIMPROXY, "-lkimproxy") + AC_SUBST(LIB_KNEWSTUFF, "-lknewstuff") + AC_SUBST(LIB_KDNSSD, "-lkdnssd") + AC_SUBST(LIB_KUNITTEST, "-lkunittest") +# these are for backward compatibility + AC_SUBST(LIB_KSYCOCA, "-lkio") + AC_SUBST(LIB_KFILE, "-lkio") +elif test $kde_qtver = 2; then + AC_SUBST(LIB_KDECORE, "-lkdecore") + AC_SUBST(LIB_KDEUI, "-lkdeui") + AC_SUBST(LIB_KIO, "-lkio") + AC_SUBST(LIB_KSYCOCA, "-lksycoca") + AC_SUBST(LIB_SMB, "-lsmb") + AC_SUBST(LIB_KFILE, "-lkfile") + AC_SUBST(LIB_KAB, "-lkab") + AC_SUBST(LIB_KHTML, "-lkhtml") + AC_SUBST(LIB_KSPELL, "-lkspell") + AC_SUBST(LIB_KPARTS, "-lkparts") + AC_SUBST(LIB_KDEPRINT, "-lkdeprint") +else + AC_SUBST(LIB_KDECORE, "-lkdecore -lXext $(LIB_QT)") + AC_SUBST(LIB_KDEUI, "-lkdeui $(LIB_KDECORE)") + AC_SUBST(LIB_KFM, "-lkfm $(LIB_KDECORE)") + AC_SUBST(LIB_KFILE, "-lkfile $(LIB_KFM) $(LIB_KDEUI)") + AC_SUBST(LIB_KAB, "-lkab $(LIB_KIMGIO) $(LIB_KDECORE)") +fi +]) + +AC_DEFUN([AC_PATH_KDE], +[ + AC_BASE_PATH_KDE + AC_ARG_ENABLE(path-check,AC_HELP_STRING([--disable-path-check],[don't try to find out, where to install]), + [ + if test "$enableval" = "no"; + then ac_use_path_checking="default" + else ac_use_path_checking="" + fi + ], + [ + if test "$kde_qtver" = 1; + then ac_use_path_checking="" + else ac_use_path_checking="default" + fi + ] + ) + + AC_CREATE_KFSSTND($ac_use_path_checking) + + AC_SUBST_KFSSTND + KDE_CREATE_LIBS_ALIASES +]) + +dnl KDE_CHECK_FUNC_EXT(, [headers], [sample-use], [C prototype], [autoheader define], [call if found]) +AC_DEFUN([KDE_CHECK_FUNC_EXT], +[ +AC_MSG_CHECKING(for $1) +AC_CACHE_VAL(kde_cv_func_$1, +[ +AC_LANG_SAVE +AC_LANG_CPLUSPLUS +save_CXXFLAGS="$CXXFLAGS" +kde_safe_LIBS="$LIBS" +LIBS="$LIBS $X_EXTRA_LIBS" +if test "$GXX" = "yes"; then +CXXFLAGS="$CXXFLAGS -pedantic-errors" +fi +AC_TRY_COMPILE([ +$2 +], +[ +$3 +], +kde_cv_func_$1=yes, +kde_cv_func_$1=no) +CXXFLAGS="$save_CXXFLAGS" +LIBS="$kde_safe_LIBS" +AC_LANG_RESTORE +]) + +AC_MSG_RESULT($kde_cv_func_$1) + +AC_MSG_CHECKING([if $1 needs custom prototype]) +AC_CACHE_VAL(kde_cv_proto_$1, +[ +if test "x$kde_cv_func_$1" = xyes; then + kde_cv_proto_$1=no +else + case "$1" in + setenv|unsetenv|usleep|random|srandom|seteuid|mkstemps|mkstemp|revoke|vsnprintf|strlcpy|strlcat) + kde_cv_proto_$1="yes - in libkdefakes" + ;; + *) + kde_cv_proto_$1=unknown + ;; + esac +fi + +if test "x$kde_cv_proto_$1" = xunknown; then + +AC_LANG_SAVE +AC_LANG_CPLUSPLUS + kde_safe_libs=$LIBS + LIBS="$LIBS $X_EXTRA_LIBS" + AC_TRY_LINK([ +$2 + +extern "C" $4; +], +[ +$3 +], +[ kde_cv_func_$1=yes + kde_cv_proto_$1=yes ], + [kde_cv_proto_$1="$1 unavailable"] +) +LIBS=$kde_safe_libs +AC_LANG_RESTORE +fi +]) +AC_MSG_RESULT($kde_cv_proto_$1) + +if test "x$kde_cv_func_$1" = xyes; then + AC_DEFINE(HAVE_$5, 1, [Define if you have $1]) + $6 +fi +if test "x$kde_cv_proto_$1" = xno; then + AC_DEFINE(HAVE_$5_PROTO, 1, + [Define if you have the $1 prototype]) +fi + +AH_VERBATIM([_HAVE_$5_PROTO], +[ +#if !defined(HAVE_$5_PROTO) +#ifdef __cplusplus +extern "C" { +#endif +$4; +#ifdef __cplusplus +} +#endif +#endif +]) +]) + +AC_DEFUN([AC_CHECK_SETENV], +[ + KDE_CHECK_FUNC_EXT(setenv, [ +#include +], + [setenv("VAR", "VALUE", 1);], + [int setenv (const char *, const char *, int)], + [SETENV]) +]) + +AC_DEFUN([AC_CHECK_UNSETENV], +[ + KDE_CHECK_FUNC_EXT(unsetenv, [ +#include +], + [unsetenv("VAR");], + [void unsetenv (const char *)], + [UNSETENV]) +]) + +AC_DEFUN([AC_CHECK_GETDOMAINNAME], +[ + KDE_CHECK_FUNC_EXT(getdomainname, [ +#include +#include +#include +], + [ +char buffer[200]; +getdomainname(buffer, 200); +], + [#include + int getdomainname (char *, size_t)], + [GETDOMAINNAME]) +]) + +AC_DEFUN([AC_CHECK_GETHOSTNAME], +[ + KDE_CHECK_FUNC_EXT(gethostname, [ +#include +#include +], + [ +char buffer[200]; +gethostname(buffer, 200); +], + [int gethostname (char *, unsigned int)], + [GETHOSTNAME]) +]) + +AC_DEFUN([AC_CHECK_USLEEP], +[ + KDE_CHECK_FUNC_EXT(usleep, [ +#include +], + [ +usleep(200); +], + [int usleep (unsigned int)], + [USLEEP]) +]) + + +AC_DEFUN([AC_CHECK_RANDOM], +[ + KDE_CHECK_FUNC_EXT(random, [ +#include +], + [ +random(); +], + [long int random(void)], + [RANDOM]) + + KDE_CHECK_FUNC_EXT(srandom, [ +#include +], + [ +srandom(27); +], + [void srandom(unsigned int)], + [SRANDOM]) + +]) + +AC_DEFUN([AC_CHECK_INITGROUPS], +[ + KDE_CHECK_FUNC_EXT(initgroups, [ +#include +#include +#include +], + [ +char buffer[200]; +initgroups(buffer, 27); +], + [int initgroups(const char *, gid_t)], + [INITGROUPS]) +]) + +AC_DEFUN([AC_CHECK_MKSTEMPS], +[ + KDE_CHECK_FUNC_EXT(mkstemps, [ +#include +#include +], + [ +mkstemps("/tmp/aaaXXXXXX", 6); +], + [int mkstemps(char *, int)], + [MKSTEMPS]) +]) + +AC_DEFUN([AC_CHECK_MKSTEMP], +[ + KDE_CHECK_FUNC_EXT(mkstemp, [ +#include +#include +], + [ +mkstemp("/tmp/aaaXXXXXX"); +], + [int mkstemp(char *)], + [MKSTEMP]) +]) + +AC_DEFUN([AC_CHECK_MKDTEMP], +[ + KDE_CHECK_FUNC_EXT(mkdtemp, [ +#include +#include +], + [ +mkdtemp("/tmp/aaaXXXXXX"); +], + [char *mkdtemp(char *)], + [MKDTEMP]) +]) + + +AC_DEFUN([AC_CHECK_RES_INIT], +[ + AC_MSG_CHECKING([if res_init needs -lresolv]) + kde_libs_safe="$LIBS" + LIBS="$LIBS $X_EXTRA_LIBS -lresolv" + AC_TRY_LINK( + [ +#include +#include +#include +#include + ], + [ + res_init(); + ], + [ + LIBRESOLV="-lresolv" + AC_MSG_RESULT(yes) + AC_DEFINE(HAVE_RES_INIT, 1, [Define if you have the res_init function]) + ], + [ AC_MSG_RESULT(no) ] + ) + LIBS=$kde_libs_safe + AC_SUBST(LIBRESOLV) + + KDE_CHECK_FUNC_EXT(res_init, + [ +#include +#include +#include +#include + ], + [res_init()], + [int res_init(void)], + [RES_INIT]) +]) + +AC_DEFUN([AC_CHECK_STRLCPY], +[ + KDE_CHECK_FUNC_EXT(strlcpy, [ +#include +], +[ char buf[20]; + strlcpy(buf, "KDE function test", sizeof(buf)); +], + [unsigned long strlcpy(char*, const char*, unsigned long)], + [STRLCPY]) +]) + +AC_DEFUN([AC_CHECK_STRLCAT], +[ + KDE_CHECK_FUNC_EXT(strlcat, [ +#include +], +[ char buf[20]; + buf[0]='\0'; + strlcat(buf, "KDE function test", sizeof(buf)); +], + [unsigned long strlcat(char*, const char*, unsigned long)], + [STRLCAT]) +]) + +AC_DEFUN([AC_CHECK_RES_QUERY], +[ + KDE_CHECK_FUNC_EXT(res_query, [ +#include +#include +#include +#include +#include +], +[ +res_query(NULL, 0, 0, NULL, 0); +], + [int res_query(const char *, int, int, unsigned char *, int)], + [RES_QUERY]) +]) + +AC_DEFUN([AC_CHECK_DN_SKIPNAME], +[ + KDE_CHECK_FUNC_EXT(dn_skipname, [ +#include +#include +#include +#include +], +[ +dn_skipname (NULL, NULL); +], + [int dn_skipname (unsigned char *, unsigned char *)], + [DN_SKIPNAME]) +]) + + +AC_DEFUN([AC_FIND_GIF], + [AC_MSG_CHECKING([for giflib]) +AC_CACHE_VAL(ac_cv_lib_gif, +[ac_save_LIBS="$LIBS" +if test "x$kde_use_qt_emb" != "xyes" && test "x$kde_use_qt_mac" != "xyes"; then +LIBS="$all_libraries -lgif -lX11 $LIBSOCKET" +else +LIBS="$all_libraries -lgif" +fi +AC_TRY_LINK(dnl +[ +#ifdef __cplusplus +extern "C" { +#endif +int GifLastError(void); +#ifdef __cplusplus +} +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +], + [return GifLastError();], + eval "ac_cv_lib_gif=yes", + eval "ac_cv_lib_gif=no") +LIBS="$ac_save_LIBS" +])dnl +if eval "test \"`echo $ac_cv_lib_gif`\" = yes"; then + AC_MSG_RESULT(yes) + AC_DEFINE_UNQUOTED(HAVE_LIBGIF, 1, [Define if you have libgif]) +else + AC_MSG_ERROR(You need giflib30. Please install the kdesupport package) +fi +]) + +AC_DEFUN([KDE_FIND_JPEG_HELPER], +[ +AC_MSG_CHECKING([for libjpeg$2]) +AC_CACHE_VAL(ac_cv_lib_jpeg_$1, +[ +ac_save_LIBS="$LIBS" +LIBS="$all_libraries $USER_LDFLAGS -ljpeg$2 -lm" +ac_save_CFLAGS="$CFLAGS" +CFLAGS="$CFLAGS $all_includes $USER_INCLUDES" +AC_TRY_LINK( +[ +#ifdef __cplusplus +extern "C" { +#endif +void jpeg_CreateDecompress(); +#ifdef __cplusplus +} +#endif +], +[jpeg_CreateDecompress();], + eval "ac_cv_lib_jpeg_$1=-ljpeg$2", + eval "ac_cv_lib_jpeg_$1=no") +LIBS="$ac_save_LIBS" +CFLAGS="$ac_save_CFLAGS" +]) + +if eval "test ! \"`echo $ac_cv_lib_jpeg_$1`\" = no"; then + LIBJPEG="$ac_cv_lib_jpeg_$1" + AC_MSG_RESULT($ac_cv_lib_jpeg_$1) +else + AC_MSG_RESULT(no) + $3 +fi + +]) + +AC_DEFUN([AC_FIND_JPEG], +[ +dnl first look for libraries +KDE_FIND_JPEG_HELPER(6b, 6b, + KDE_FIND_JPEG_HELPER(normal, [], + [ + LIBJPEG= + ] + ) +) + +dnl then search the headers (can't use simply AC_TRY_xxx, as jpeglib.h +dnl requires system dependent includes loaded before it) +jpeg_incdirs="$includedir /usr/include /usr/local/include $kde_extra_includes" +AC_FIND_FILE(jpeglib.h, $jpeg_incdirs, jpeg_incdir) +test "x$jpeg_incdir" = xNO && jpeg_incdir= + +dnl if headers _and_ libraries are missing, this is no error, and we +dnl continue with a warning (the user will get no jpeg support in khtml) +dnl if only one is missing, it means a configuration error, but we still +dnl only warn +if test -n "$jpeg_incdir" && test -n "$LIBJPEG" ; then + AC_DEFINE_UNQUOTED(HAVE_LIBJPEG, 1, [Define if you have libjpeg]) +else + if test -n "$jpeg_incdir" || test -n "$LIBJPEG" ; then + AC_MSG_WARN([ +There is an installation error in jpeg support. You seem to have only one +of either the headers _or_ the libraries installed. You may need to either +provide correct --with-extra-... options, or the development package of +libjpeg6b. You can get a source package of libjpeg from http://www.ijg.org/ +Disabling JPEG support. +]) + else + AC_MSG_WARN([libjpeg not found. disable JPEG support.]) + fi + jpeg_incdir= + LIBJPEG= +fi + +AC_SUBST(LIBJPEG) +AH_VERBATIM(_AC_CHECK_JPEG, +[/* + * jpeg.h needs HAVE_BOOLEAN, when the system uses boolean in system + * headers and I'm too lazy to write a configure test as long as only + * unixware is related + */ +#ifdef _UNIXWARE +#define HAVE_BOOLEAN +#endif +]) +]) + +AC_DEFUN([KDE_CHECK_QT_JPEG], +[ +if test -n "$LIBJPEG"; then +AC_MSG_CHECKING([if Qt needs $LIBJPEG]) +AC_CACHE_VAL(kde_cv_qt_jpeg, +[ +AC_LANG_SAVE +AC_LANG_CPLUSPLUS +ac_save_LIBS="$LIBS" +LIBS="$all_libraries $USER_LDFLAGS $LIBQT" +LIBS=`echo $LIBS | sed "s/$LIBJPEG//"` +ac_save_CXXFLAGS="$CXXFLAGS" +CXXFLAGS="$CXXFLAGS $all_includes $USER_INCLUDES" +AC_TRY_LINK( +[#include ], + [ + int argc; + char** argv; + QApplication app(argc, argv);], + eval "kde_cv_qt_jpeg=no", + eval "kde_cv_qt_jpeg=yes") +LIBS="$ac_save_LIBS" +CXXFLAGS="$ac_save_CXXFLAGS" +AC_LANG_RESTORE +fi +]) + +if eval "test ! \"`echo $kde_cv_qt_jpeg`\" = no"; then + AC_MSG_RESULT(yes) + LIBJPEG_QT='$(LIBJPEG)' +else + AC_MSG_RESULT(no) + LIBJPEG_QT= +fi + +]) + +AC_DEFUN([AC_FIND_ZLIB], +[ +AC_REQUIRE([KDE_CHECK_EXTRA_LIBS]) +AC_MSG_CHECKING([for libz]) +AC_CACHE_VAL(ac_cv_lib_z, +[ +kde_save_LIBS="$LIBS" +LIBS="$all_libraries $USER_LDFLAGS -lz $LIBSOCKET" +kde_save_CFLAGS="$CFLAGS" +CFLAGS="$CFLAGS $all_includes $USER_INCLUDES" +AC_TRY_LINK(dnl +[ +#include +#include +], +[ + char buf[42]; + gzFile f = (gzFile) 0; + /* this would segfault.. but we only link, don't run */ + (void) gzgets(f, buf, sizeof(buf)); + + return (strcmp(zlibVersion(), ZLIB_VERSION) == 0); +], + eval "ac_cv_lib_z='-lz'", + eval "ac_cv_lib_z=no") +LIBS="$kde_save_LIBS" +CFLAGS="$kde_save_CFLAGS" +])dnl +if test ! "$ac_cv_lib_z" = no; then + AC_DEFINE_UNQUOTED(HAVE_LIBZ, 1, [Define if you have libz]) + LIBZ="$ac_cv_lib_z" + AC_MSG_RESULT($ac_cv_lib_z) +else + AC_MSG_ERROR(not found. + Possibly configure picks up an outdated version + installed by XFree86. Remove it from your system. + + Check your installation and look into config.log) + LIBZ="" +fi +AC_SUBST(LIBZ) +]) + +AC_DEFUN([KDE_TRY_TIFFLIB], +[ +AC_MSG_CHECKING([for libtiff $1]) + +AC_CACHE_VAL(kde_cv_libtiff_$1, +[ +AC_LANG_SAVE +AC_LANG_CPLUSPLUS +kde_save_LIBS="$LIBS" +if test "x$kde_use_qt_emb" != "xyes" && test "x$kde_use_qt_mac" != "xyes"; then +LIBS="$all_libraries $USER_LDFLAGS -l$1 $LIBJPEG $LIBZ -lX11 $LIBSOCKET -lm" +else +LIBS="$all_libraries $USER_LDFLAGS -l$1 $LIBJPEG $LIBZ -lm" +fi +kde_save_CXXFLAGS="$CXXFLAGS" +CXXFLAGS="$CXXFLAGS $all_includes $USER_INCLUDES" + +AC_TRY_LINK(dnl +[ +#include +], + [return (TIFFOpen( "", "r") == 0); ], +[ + kde_cv_libtiff_$1="-l$1 $LIBJPEG $LIBZ" +], [ + kde_cv_libtiff_$1=no +]) + +LIBS="$kde_save_LIBS" +CXXFLAGS="$kde_save_CXXFLAGS" +AC_LANG_RESTORE +]) + +if test "$kde_cv_libtiff_$1" = "no"; then + AC_MSG_RESULT(no) + LIBTIFF="" + $3 +else + LIBTIFF="$kde_cv_libtiff_$1" + AC_MSG_RESULT(yes) + AC_DEFINE_UNQUOTED(HAVE_LIBTIFF, 1, [Define if you have libtiff]) + $2 +fi + +]) + +AC_DEFUN([AC_FIND_TIFF], +[ +AC_REQUIRE([K_PATH_X]) +AC_REQUIRE([AC_FIND_ZLIB]) +AC_REQUIRE([AC_FIND_JPEG]) +AC_REQUIRE([KDE_CHECK_EXTRA_LIBS]) + +KDE_TRY_TIFFLIB(tiff, [], + KDE_TRY_TIFFLIB(tiff34)) + +AC_SUBST(LIBTIFF) +]) + +AC_DEFUN([KDE_FIND_LIBEXR], +[ +AC_REQUIRE([KDE_CHECK_EXTRA_LIBS]) +AC_REQUIRE([AC_FIND_ZLIB]) +AC_CACHE_VAL(ac_cv_libexr, +[ + if test -z "$PKG_CONFIG"; then + AC_PATH_PROG(PKG_CONFIG, pkg-config, no) + fi + + AC_MSG_CHECKING([for OpenEXR libraries]) + + if test "$PKG_CONFIG" = "no" ; then + AC_MSG_RESULT(no) + echo "*** The pkg-config script could not be found. Make sure it is" + echo "*** in your path, or set the PKG_CONFIG environment variable" + echo "*** to the full path to pkg-config." + echo "*** Or see http://www.freedesktop.org/software/pkgconfig to get pkg-config." + else + if !(`$PKG_CONFIG --exists OpenEXR`) ; then + AC_MSG_RESULT(no) + EXRSTATUS=no + else + if !(`$PKG_CONFIG --atleast-version="1.1.1" OpenEXR`) ; then + AC_MSG_RESULT(no) + EXRSTATUS=old + else + kde_save_LIBS="$LIBS" + LIBS="$LIBS $all_libraries $USER_LDFLAGS `pkg-config --libs OpenEXR` $LIBZ" + AC_LANG_SAVE + AC_LANG_CPLUSPLUS + kde_save_CXXFLAGS="$CXXFLAGS" + EXR_FLAGS=`$PKG_CONFIG --cflags OpenEXR` + CXXFLAGS="$CXXFLAGS $all_includes $USER_INCLUDES $EXR_FLAGS" + + AC_TRY_LINK(dnl + [ + #include + ], + [ + using namespace Imf; + RgbaInputFile file ("dummy"); + return 0; + ], + eval "ac_cv_libexr='`pkg-config --libs OpenEXR`'", + eval "ac_cv_libexr=no" + ) + LIBS="$kde_save_LIBS" + CXXFLAGS="$kde_save_CXXFLAGS" + AC_LANG_RESTORE + ])dnl + if eval "test ! \"`echo $ac_cv_libexr`\" = no"; then + AC_DEFINE_UNQUOTED(HAVE_EXR, 1, [Define if you have OpenEXR]) + LIB_EXR="$ac_cv_libexr" + AC_MSG_RESULT($ac_cv_libexr) + else + AC_MSG_RESULT(no) + LIB_EXR="" + fi + fi + fi + fi + AC_SUBST(LIB_EXR) + AC_SUBST(EXR_FLAGS) +]) + + + +AC_DEFUN([AC_FIND_PNG], +[ +AC_REQUIRE([KDE_CHECK_EXTRA_LIBS]) +AC_REQUIRE([AC_FIND_ZLIB]) +AC_MSG_CHECKING([for libpng]) +AC_CACHE_VAL(ac_cv_lib_png, +[ +kde_save_LIBS="$LIBS" +if test "x$kde_use_qt_emb" != "xyes" && test "x$kde_use_qt_mac" != "xyes"; then +LIBS="$LIBS $all_libraries $USER_LDFLAGS -lpng $LIBZ -lm -lX11 $LIBSOCKET" +else +LIBS="$LIBS $all_libraries $USER_LDFLAGS -lpng $LIBZ -lm" +fi +kde_save_CFLAGS="$CFLAGS" +CFLAGS="$CFLAGS $all_includes $USER_INCLUDES" + +AC_TRY_LINK(dnl + [ + #include + ], + [ + png_structp png_ptr = png_create_read_struct( /* image ptr */ + PNG_LIBPNG_VER_STRING, 0, 0, 0 ); + return( png_ptr != 0 ); + ], + eval "ac_cv_lib_png='-lpng $LIBZ -lm'", + eval "ac_cv_lib_png=no" +) +LIBS="$kde_save_LIBS" +CFLAGS="$kde_save_CFLAGS" +])dnl +if eval "test ! \"`echo $ac_cv_lib_png`\" = no"; then + AC_DEFINE_UNQUOTED(HAVE_LIBPNG, 1, [Define if you have libpng]) + LIBPNG="$ac_cv_lib_png" + AC_SUBST(LIBPNG) + AC_MSG_RESULT($ac_cv_lib_png) +else + AC_MSG_RESULT(no) + LIBPNG="" + AC_SUBST(LIBPNG) +fi +]) + + +AC_DEFUN([AC_FIND_JASPER], +[ +AC_REQUIRE([KDE_CHECK_EXTRA_LIBS]) +AC_REQUIRE([AC_FIND_JPEG]) +AC_MSG_CHECKING([for jasper]) +AC_CACHE_VAL(ac_cv_jasper, +[ +kde_save_LIBS="$LIBS" +LIBS="$LIBS $all_libraries $USER_LDFLAGS -ljasper $LIBJPEG -lm" +kde_save_CFLAGS="$CFLAGS" +CFLAGS="$CFLAGS $all_includes $USER_INCLUDES" + +AC_TRY_LINK(dnl + [ + #include + ], + [ + return( jas_init() ); + ], + eval "ac_cv_jasper='-ljasper $LIBJPEG -lm'", + eval "ac_cv_jasper=no" +) +LIBS="$kde_save_LIBS" +CFLAGS="$kde_save_CFLAGS" +])dnl +if eval "test ! \"`echo $ac_cv_jasper`\" = no"; then + AC_DEFINE_UNQUOTED(HAVE_JASPER, 1, [Define if you have jasper]) + LIB_JASPER="$ac_cv_jasper" + AC_MSG_RESULT($ac_cv_jasper) +else + AC_MSG_RESULT(no) + LIB_JASPER="" +fi +AC_SUBST(LIB_JASPER) +]) + +AC_DEFUN([AC_CHECK_BOOL], +[ + AC_DEFINE_UNQUOTED(HAVE_BOOL, 1, [You _must_ have bool]) +]) + +AC_DEFUN([AC_CHECK_GNU_EXTENSIONS], +[ +AC_MSG_CHECKING(if you need GNU extensions) +AC_CACHE_VAL(ac_cv_gnu_extensions, +[ +cat > conftest.c << EOF +#include + +#ifdef __GNU_LIBRARY__ +yes +#endif +EOF + +if (eval "$ac_cpp conftest.c") 2>&5 | + egrep "yes" >/dev/null 2>&1; then + rm -rf conftest* + ac_cv_gnu_extensions=yes +else + ac_cv_gnu_extensions=no +fi +]) + +AC_MSG_RESULT($ac_cv_gnu_extensions) +if test "$ac_cv_gnu_extensions" = "yes"; then + AC_DEFINE_UNQUOTED(_GNU_SOURCE, 1, [Define if you need to use the GNU extensions]) +fi +]) + +AC_DEFUN([KDE_CHECK_COMPILER_FLAG], +[ +AC_MSG_CHECKING([whether $CXX supports -$1]) +kde_cache=`echo $1 | sed 'y% .=/+-,%____p__%'` +AC_CACHE_VAL(kde_cv_prog_cxx_$kde_cache, +[ + AC_LANG_SAVE + AC_LANG_CPLUSPLUS + save_CXXFLAGS="$CXXFLAGS" + CXXFLAGS="$CXXFLAGS -$1" + AC_TRY_LINK([],[ return 0; ], [eval "kde_cv_prog_cxx_$kde_cache=yes"], []) + CXXFLAGS="$save_CXXFLAGS" + AC_LANG_RESTORE +]) +if eval "test \"`echo '$kde_cv_prog_cxx_'$kde_cache`\" = yes"; then + AC_MSG_RESULT(yes) + : + $2 +else + AC_MSG_RESULT(no) + : + $3 +fi +]) + +AC_DEFUN([KDE_CHECK_C_COMPILER_FLAG], +[ +AC_MSG_CHECKING([whether $CC supports -$1]) +kde_cache=`echo $1 | sed 'y% .=/+-,%____p__%'` +AC_CACHE_VAL(kde_cv_prog_cc_$kde_cache, +[ + AC_LANG_SAVE + AC_LANG_C + save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -$1" + AC_TRY_LINK([],[ return 0; ], [eval "kde_cv_prog_cc_$kde_cache=yes"], []) + CFLAGS="$save_CFLAGS" + AC_LANG_RESTORE +]) +if eval "test \"`echo '$kde_cv_prog_cc_'$kde_cache`\" = yes"; then + AC_MSG_RESULT(yes) + : + $2 +else + AC_MSG_RESULT(no) + : + $3 +fi +]) + + +dnl AC_REMOVE_FORBIDDEN removes forbidden arguments from variables +dnl use: AC_REMOVE_FORBIDDEN(CC, [-forbid -bad-option whatever]) +dnl it's all white-space separated +AC_DEFUN([AC_REMOVE_FORBIDDEN], +[ __val=$$1 + __forbid=" $2 " + if test -n "$__val"; then + __new="" + ac_save_IFS=$IFS + IFS=" " + for i in $__val; do + case "$__forbid" in + *" $i "*) AC_MSG_WARN([found forbidden $i in $1, removing it]) ;; + *) # Careful to not add spaces, where there were none, because otherwise + # libtool gets confused, if we change e.g. CXX + if test -z "$__new" ; then __new=$i ; else __new="$__new $i" ; fi ;; + esac + done + IFS=$ac_save_IFS + $1=$__new + fi +]) + + +AC_DEFUN([KDE_CHECK_FOR_BAD_COMPILER], +[ + AC_MSG_CHECKING([whether $CC is blacklisted]) + + dnl In theory we have tu run this test against $CC and $CXX + dnl in C and in C++ mode, because its perfectly legal for + dnl the user to mix compiler versions, since C has a defined + dnl ABI. + dnl + dnl For now, we assume the user is not on crack. + + AC_TRY_COMPILE([ +#ifdef __GNUC__ +#if __GNUC__ == 4 && __GNUC_MINOR__ == 0 && __GNUC_PATCHLEVEL__ == 0 +choke me +#endif +#endif +], , + kde_bad_compiler=no, + kde_bad_compiler=yes +) + + AC_MSG_RESULT($kde_bad_compiler) + +if test "$kde_bad_compiler" = "yes"; then + AC_MSG_ERROR([ + +This particular compiler version is blacklisted because it +is known to miscompile KDE. Please use a newer version, or +if that is not yet available, choose an older version. + +Please do not report a bug or bother us reporting this +configure error. We know about it, and we introduced +it by intention to avoid untraceable bugs or crashes in KDE. + +]) +fi + +]) + + +AC_DEFUN([KDE_CHECK_FOR_OPT_NOINLINE_MATCH], +[ + AC_CACHE_CHECK([whether system headers can cope with -O2 -fno-inline], + kde_cv_opt_noinline_match, + [ + kde_cv_opt_noinline_match=irrelevant + dnl if we don't use both -O2 and -fno-inline, this check is moot + if echo "$CFLAGS" | grep -e -O2 >/dev/null 2>/dev/null \ + && echo "$CFLAGS" | grep -e -fno-inline >/dev/null 2>/dev/null ; then + + ac_cflags_save="$CFLAGS" + CFLAGS="$CFLAGS -D_USE_GNU" + + AC_TRY_LINK([ + #include +], [ const char *pt, *et; + et = __extension__ ({ char __a0, __a1, __a2; (__builtin_constant_p ( ";," ) && ((size_t)(const void *)(( ";," )+ 1) - (size_t)(const void *)( ";," ) == 1) ? ((__a0 =((__const char *) ( ";," ))[0], __a0 == '\0') ? ((void) ( pt ),((void *)0) ) : ((__a1 = ((__const char *) ( ";," ))[1], __a1== '\0') ? (__extension__ (__builtin_constant_p ( __a0 ) && ( __a0 ) == '\0' ? (char *) __rawmemchr ( pt , __a0) : strchr( pt , __a0 ))) : ((__a2 = ((__const char *) ( ";," ))[2], __a2 == '\0') ? __strpbrk_c2 ( pt , __a0, __a1) :(((__const char *) ( ";," ))[3] == '\0' ? __strpbrk_c3 ( pt ,__a0, __a1, __a2): strpbrk ( pt , ";," ))))) : strpbrk ( pt , ";," )); }) ; +], + kde_cv_opt_noinline_match=yes, + kde_cv_opt_noinline_match=no + ) + + CFLAGS="$ac_cflags_save" + fi + ]) +]) + + +dnl AC_VALIDIFY_CXXFLAGS checks for forbidden flags the user may have given +AC_DEFUN([AC_VALIDIFY_CXXFLAGS], +[dnl +if test "x$kde_use_qt_emb" != "xyes"; then + AC_REMOVE_FORBIDDEN(CXX, [-fno-rtti -rpath]) + AC_REMOVE_FORBIDDEN(CXXFLAGS, [-fno-rtti -rpath]) +else + AC_REMOVE_FORBIDDEN(CXX, [-rpath]) + AC_REMOVE_FORBIDDEN(CXXFLAGS, [-rpath]) +fi +]) + +AC_DEFUN([AC_CHECK_COMPILERS], +[ + AC_ARG_ENABLE(debug, + AC_HELP_STRING([--enable-debug=ARG],[enables debug symbols (yes|no|full) [default=no]]), + [ + case $enableval in + yes) + kde_use_debug_code="yes" + kde_use_debug_define=no + ;; + full) + kde_use_debug_code="full" + kde_use_debug_define=no + ;; + *) + kde_use_debug_code="no" + kde_use_debug_define=yes + ;; + esac + ], + [kde_use_debug_code="no" + kde_use_debug_define=no + ]) + + dnl Just for configure --help + AC_ARG_ENABLE(dummyoption, + AC_HELP_STRING([--disable-debug], + [disables debug output and debug symbols [default=no]]), + [],[]) + + AC_ARG_ENABLE(strict, + AC_HELP_STRING([--enable-strict], + [compiles with strict compiler options (may not work!)]), + [ + if test $enableval = "no"; then + kde_use_strict_options="no" + else + kde_use_strict_options="yes" + fi + ], [kde_use_strict_options="no"]) + + AC_ARG_ENABLE(warnings,AC_HELP_STRING([--disable-warnings],[disables compilation with -Wall and similar]), + [ + if test $enableval = "no"; then + kde_use_warnings="no" + else + kde_use_warnings="yes" + fi + ], [kde_use_warnings="yes"]) + + dnl enable warnings for debug build + if test "$kde_use_debug_code" != "no"; then + kde_use_warnings=yes + fi + + AC_ARG_ENABLE(profile,AC_HELP_STRING([--enable-profile],[creates profiling infos [default=no]]), + [kde_use_profiling=$enableval], + [kde_use_profiling="no"] + ) + + dnl this prevents stupid AC_PROG_CC to add "-g" to the default CFLAGS + CFLAGS=" $CFLAGS" + + AC_PROG_CC + + AC_PROG_CPP + + if test "$GCC" = "yes"; then + if test "$kde_use_debug_code" != "no"; then + if test $kde_use_debug_code = "full"; then + CFLAGS="-g3 -fno-inline $CFLAGS" + else + CFLAGS="-g -O2 -fno-schedule-insns -fno-inline $CFLAGS" + fi + else + CFLAGS="-O2 $CFLAGS" + fi + fi + + if test "$kde_use_debug_define" = "yes"; then + CFLAGS="-DNDEBUG $CFLAGS" + fi + + + case "$host" in + *-*-sysv4.2uw*) CFLAGS="-D_UNIXWARE $CFLAGS";; + *-*-sysv5uw7*) CFLAGS="-D_UNIXWARE7 $CFLAGS";; + esac + + if test -z "$LDFLAGS" && test "$kde_use_debug_code" = "no" && test "$GCC" = "yes"; then + LDFLAGS="" + fi + + CXXFLAGS=" $CXXFLAGS" + + AC_PROG_CXX + + KDE_CHECK_FOR_BAD_COMPILER + + if test "$GXX" = "yes" || test "$CXX" = "KCC"; then + if test "$kde_use_debug_code" != "no"; then + if test "$CXX" = "KCC"; then + CXXFLAGS="+K0 -Wall -pedantic -W -Wpointer-arith -Wwrite-strings $CXXFLAGS" + else + if test "$kde_use_debug_code" = "full"; then + CXXFLAGS="-g3 -fno-inline $CXXFLAGS" + else + CXXFLAGS="-g -O2 -fno-schedule-insns -fno-inline $CXXFLAGS" + fi + fi + KDE_CHECK_COMPILER_FLAG(fno-builtin,[CXXFLAGS="-fno-builtin $CXXFLAGS"]) + + dnl convenience compiler flags + KDE_CHECK_COMPILER_FLAG(Woverloaded-virtual, [WOVERLOADED_VIRTUAL="-Woverloaded-virtual"], [WOVERLOADED_VRITUAL=""]) + AC_SUBST(WOVERLOADED_VIRTUAL) + else + if test "$CXX" = "KCC"; then + CXXFLAGS="+K3 $CXXFLAGS" + else + CXXFLAGS="-O2 $CXXFLAGS" + fi + fi + fi + + if test "$kde_use_debug_define" = "yes"; then + CXXFLAGS="-DNDEBUG -DNO_DEBUG $CXXFLAGS" + fi + + if test "$kde_use_profiling" = "yes"; then + KDE_CHECK_COMPILER_FLAG(pg, + [ + CFLAGS="-pg $CFLAGS" + CXXFLAGS="-pg $CXXFLAGS" + ]) + fi + + if test "$kde_use_warnings" = "yes"; then + if test "$GCC" = "yes"; then + CXXFLAGS="-Wall -W -Wpointer-arith $CXXFLAGS" + case $host in + *-*-linux-gnu) + CFLAGS="-std=iso9899:1990 -W -Wall -Wchar-subscripts -Wshadow -Wpointer-arith -Wmissing-prototypes -Wwrite-strings -D_XOPEN_SOURCE=500 -D_BSD_SOURCE $CFLAGS" + CXXFLAGS="-ansi -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -Wcast-align -Wchar-subscripts $CXXFLAGS" + KDE_CHECK_COMPILER_FLAG(Wmissing-format-attribute, [CXXFLAGS="$CXXFLAGS -Wformat-security -Wmissing-format-attribute"]) + KDE_CHECK_C_COMPILER_FLAG(Wmissing-format-attribute, [CFLAGS="$CFLAGS -Wformat-security -Wmissing-format-attribute"]) + ;; + esac + KDE_CHECK_COMPILER_FLAG(Wundef,[CXXFLAGS="-Wundef $CXXFLAGS"]) + KDE_CHECK_COMPILER_FLAG(Wno-long-long,[CXXFLAGS="-Wno-long-long $CXXFLAGS"]) + dnl ### FIXME: revert for KDE 4 + KDE_CHECK_COMPILER_FLAG(Wno-non-virtual-dtor,[CXXFLAGS="$CXXFLAGS -Wno-non-virtual-dtor"]) + fi + fi + + if test "$GXX" = "yes" && test "$kde_use_strict_options" = "yes"; then + CXXFLAGS="-Wcast-qual -Wshadow -Wcast-align $CXXFLAGS" + fi + + AC_ARG_ENABLE(pch, + AC_HELP_STRING([--enable-pch], + [enables precompiled header support (currently only KCC or gcc >=3.4+unsermake) [default=no]]), + [ kde_use_pch=$enableval ],[ kde_use_pch=no ]) + + HAVE_GCC_VISIBILITY=0 + AC_SUBST([HAVE_GCC_VISIBILITY]) + + if test "$GXX" = "yes"; then + gcc_no_reorder_blocks=NO + KDE_CHECK_COMPILER_FLAG(fno-reorder-blocks,[gcc_no_reorder_blocks=YES]) + if test $kde_use_debug_code != "no" && \ + test $kde_use_debug_code != "full" && \ + test "YES" = "$gcc_no_reorder_blocks" ; then + CXXFLAGS="$CXXFLAGS -fno-reorder-blocks" + CFLAGS="$CFLAGS -fno-reorder-blocks" + fi + KDE_CHECK_COMPILER_FLAG(fno-exceptions,[CXXFLAGS="$CXXFLAGS -fno-exceptions"]) + KDE_CHECK_COMPILER_FLAG(fno-check-new, [CXXFLAGS="$CXXFLAGS -fno-check-new"]) + KDE_CHECK_COMPILER_FLAG(fno-common, [CXXFLAGS="$CXXFLAGS -fno-common"]) + KDE_CHECK_COMPILER_FLAG(fexceptions, [USE_EXCEPTIONS="-fexceptions"], USE_EXCEPTIONS= ) + ENABLE_PERMISSIVE_FLAG="-fpermissive" + + if test "$kde_use_pch" = "yes"; then + AC_MSG_CHECKING(whether gcc supports precompiling c header files) + echo >conftest.h + if $CC -x c-header conftest.h >/dev/null 2>/dev/null; then + kde_gcc_supports_pch=yes + AC_MSG_RESULT(yes) + else + kde_gcc_supports_pch=no + AC_MSG_RESULT(no) + fi + if test "$kde_gcc_supports_pch" = "yes"; then + AC_MSG_CHECKING(whether gcc supports precompiling c++ header files) + if $CXX -x c++-header conftest.h >/dev/null 2>/dev/null; then + kde_gcc_supports_pch=yes + AC_MSG_RESULT(yes) + else + kde_gcc_supports_pch=no + AC_MSG_RESULT(no) + fi + fi + rm -f conftest.h conftest.h.gch + fi + + KDE_CHECK_FOR_OPT_NOINLINE_MATCH + if test "x$kde_cv_opt_noinline_match" = "xno" ; then + CFLAGS="`echo "$CFLAGS" | sed "s/ -fno-inline//"`" + fi + fi + AM_CONDITIONAL(unsermake_enable_pch, test "$kde_use_pch" = "yes" && test "$kde_gcc_supports_pch" = "yes") + if test "$CXX" = "KCC"; then + dnl unfortunately we currently cannot disable exception support in KCC + dnl because doing so is binary incompatible and Qt by default links with exceptions :-( + dnl KDE_CHECK_COMPILER_FLAG(-no_exceptions,[CXXFLAGS="$CXXFLAGS --no_exceptions"]) + dnl KDE_CHECK_COMPILER_FLAG(-exceptions, [USE_EXCEPTIONS="--exceptions"], USE_EXCEPTIONS= ) + + if test "$kde_use_pch" = "yes"; then + dnl TODO: support --pch-dir! + KDE_CHECK_COMPILER_FLAG(-pch,[CXXFLAGS="$CXXFLAGS --pch"]) + dnl the below works (but the dir must exist), but it's + dnl useless for a whole package. + dnl The are precompiled headers for each source file, so when compiling + dnl from scratch, it doesn't make a difference, and they take up + dnl around ~5Mb _per_ sourcefile. + dnl KDE_CHECK_COMPILER_FLAG(-pch_dir /tmp, + dnl [CXXFLAGS="$CXXFLAGS --pch_dir `pwd`/pcheaders"]) + fi + dnl this flag controls inlining. by default KCC inlines in optimisation mode + dnl all implementations that are defined inside the class {} declaration. + dnl because of templates-compatibility with broken gcc compilers, this + dnl can cause excessive inlining. This flag limits it to a sane level + KDE_CHECK_COMPILER_FLAG(-inline_keyword_space_time=6,[CXXFLAGS="$CXXFLAGS --inline_keyword_space_time=6"]) + KDE_CHECK_COMPILER_FLAG(-inline_auto_space_time=2,[CXXFLAGS="$CXXFLAGS --inline_auto_space_time=2"]) + KDE_CHECK_COMPILER_FLAG(-inline_implicit_space_time=2.0,[CXXFLAGS="$CXXFLAGS --inline_implicit_space_time=2.0"]) + KDE_CHECK_COMPILER_FLAG(-inline_generated_space_time=2.0,[CXXFLAGS="$CXXFLAGS --inline_generated_space_time=2.0"]) + dnl Some source files are shared between multiple executables + dnl (or libraries) and some of those need template instantiations. + dnl In that case KCC needs to compile those sources with + dnl --one_instantiation_per_object. To make it easy for us we compile + dnl _all_ objects with that flag (--one_per is a shorthand). + KDE_CHECK_COMPILER_FLAG(-one_per, [CXXFLAGS="$CXXFLAGS --one_per"]) + fi + AC_SUBST(USE_EXCEPTIONS) + dnl obsolete macro - provided to keep things going + USE_RTTI= + AC_SUBST(USE_RTTI) + + case "$host" in + *-*-irix*) test "$GXX" = yes && CXXFLAGS="-D_LANGUAGE_C_PLUS_PLUS -D__LANGUAGE_C_PLUS_PLUS $CXXFLAGS" ;; + *-*-sysv4.2uw*) CXXFLAGS="-D_UNIXWARE $CXXFLAGS";; + *-*-sysv5uw7*) CXXFLAGS="-D_UNIXWARE7 $CXXFLAGS";; + *-*-solaris*) + if test "$GXX" = yes; then + libstdcpp=`$CXX -print-file-name=libstdc++.so` + if test ! -f $libstdcpp; then + AC_MSG_ERROR([You've compiled gcc without --enable-shared. This doesn't work with KDE. Please recompile gcc with --enable-shared to receive a libstdc++.so]) + fi + fi + ;; + esac + + AC_VALIDIFY_CXXFLAGS + + AC_PROG_CXXCPP + + if test "$GCC" = yes; then + NOOPT_CFLAGS=-O0 + fi + KDE_CHECK_COMPILER_FLAG(O0,[NOOPT_CXXFLAGS=-O0]) + + AC_ARG_ENABLE(coverage, + AC_HELP_STRING([--enable-coverage],[use gcc coverage testing]), [ + if test "$am_cv_CC_dependencies_compiler_type" = "gcc3"; then + ac_coverage_compiler="-fprofile-arcs -ftest-coverage" + ac_coverage_linker="-lgcc" + elif test "$am_cv_CC_dependencies_compiler_type" = "gcc"; then + ac_coverage_compiler="-fprofile-arcs -ftest-coverage" + ac_coverage_linker="" + else + AC_MSG_ERROR([coverage with your compiler is not supported]) + fi + CFLAGS="$CFLAGS $ac_coverage_compiler" + CXXFLAGS="$CXXFLAGS $ac_coverage_compiler" + LDFLAGS="$LDFLAGS $ac_coverage_linker" + ]) + + AC_SUBST(NOOPT_CXXFLAGS) + AC_SUBST(NOOPT_CFLAGS) + AC_SUBST(ENABLE_PERMISSIVE_FLAG) + + KDE_CHECK_NEW_LDFLAGS + KDE_CHECK_FINAL + KDE_CHECK_CLOSURE + KDE_CHECK_NMCHECK + + ifdef([AM_DEPENDENCIES], AC_REQUIRE([KDE_ADD_DEPENDENCIES]), []) +]) + +AC_DEFUN([KDE_CHECK_VISIBILITY_GCC_BUG], + [ + AC_CACHE_CHECK([for gcc -fvisibility-inlines-hidden bug], kde_cv_val_gcc_visibility_bug, + [ + AC_LANG_SAVE + AC_LANG_CPLUSPLUS + + safe_CXXFLAGS=$CXXFLAGS + safe_LDFLAGS=$LDFLAGS + CXXFLAGS="$CXXFLAGS -fPIC -fvisibility-inlines-hidden -O0" + LDFLAGS="$LDFLAGS -shared -fPIC" + + AC_TRY_LINK( + [ + /* http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19664 */ + #include + int some_function( void ) __attribute__ ((visibility("default"))); + int some_function( void ) + { + std::string s("blafasel"); + return 0; + } + ], [/* elvis is alive */], + kde_cv_val_gcc_visibility_bug=no, kde_cv_val_gcc_visibility_bug=yes) + + CXXFLAGS=$safe_CXXFLAGS + LDFLAGS=$safe_LDFLAGS + AC_LANG_RESTORE + ] + ) + + if test x$kde_cv_val_gcc_visibility_bug = xno; then + CXXFLAGS="$CXXFLAGS -fvisibility-inlines-hidden" + fi + ] +) + +AC_DEFUN([KDE_ENABLE_HIDDEN_VISIBILITY], +[ + AC_BEFORE([AC_PATH_QT_1_3], [KDE_ENABLE_HIDDEN_VISIBILITY]) + + AC_MSG_CHECKING([grepping for visibility push/pop in headers]) + + if test "x$GXX" = "xyes"; then + AC_LANG_SAVE + AC_LANG_CPLUSPLUS + AC_EGREP_CPP( + [GCC visibility push], + [ #include + ], + [ + AC_MSG_RESULT(yes) + kde_stdc_visibility_patched=yes ], + [ + AC_MSG_RESULT(no) + AC_MSG_WARN([Your libstdc++ doesn't appear to be patched for + visibility support. Disabling -fvisibility=hidden]) + + kde_stdc_visibility_patched=no ]) + + AC_LANG_RESTORE + + kde_have_gcc_visibility=no + KDE_CHECK_COMPILER_FLAG(fvisibility=hidden, + [ + kde_have_gcc_visibility=yes + dnl the whole toolchain is just a mess, gcc is just too buggy + dnl to handle STL with visibility enabled. Lets reconsider + dnl when gcc 4.2 is out or when things get fixed in the compiler. + dnl Contact mueller@kde.org for details. + AC_ARG_ENABLE(gcc-hidden-visibility, + AC_HELP_STRING([--enable-gcc-hidden-visibility],[toolchain hidden visibility [default=no]]), + [kde_have_gcc_visibility=$enableval], + [kde_have_gcc_visibility=no]) + + AC_CACHE_CHECK([if Qt is patched for -fvisibility], kde_cv_val_qt_gcc_visibility_patched, + [ + AC_LANG_SAVE + AC_LANG_CPLUSPLUS + + safe_CXXFLAGS=$CXXFLAGS + CXXFLAGS="$CXXFLAGS $all_includes" + + AC_TRY_COMPILE( + [ +#include +#if Q_EXPORT - 0 != 0 +/* if this compiles, then Q_EXPORT is undefined */ +/* if Q_EXPORT is nonempty, this will break compilation */ +#endif + ], [/* elvis is alive */], + kde_cv_val_qt_gcc_visibility_patched=no, kde_cv_val_qt_gcc_visibility_patched=yes) + + CXXFLAGS=$safe_CXXFLAGS + AC_LANG_RESTORE + ] + ) + + if test x$kde_have_gcc_visibility = "xyes" && test x$kde_stdc_visibility_patched = "xyes" && test x$kde_cv_val_qt_gcc_visibility_patched = "xyes"; then + CXXFLAGS="$CXXFLAGS -fvisibility=hidden" + KDE_CHECK_VISIBILITY_GCC_BUG + HAVE_GCC_VISIBILITY=1 + AC_DEFINE_UNQUOTED(__KDE_HAVE_GCC_VISIBILITY, "$HAVE_GCC_VISIBILITY", [define to 1 if -fvisibility is supported]) + fi + ]) + fi +]) + +AC_DEFUN([KDE_ADD_DEPENDENCIES], +[ + [A]M_DEPENDENCIES(CC) + [A]M_DEPENDENCIES(CXX) +]) + +dnl just a wrapper to clean up configure.in +AC_DEFUN([KDE_PROG_LIBTOOL], +[ +AC_REQUIRE([AC_CHECK_COMPILERS]) +AC_REQUIRE([AC_ENABLE_SHARED]) +AC_REQUIRE([AC_ENABLE_STATIC]) + +AC_REQUIRE([AC_LIBTOOL_DLOPEN]) +AC_REQUIRE([KDE_CHECK_LIB64]) + +AC_OBJEXT +AC_EXEEXT + +AM_PROG_LIBTOOL +AC_LIBTOOL_CXX + +LIBTOOL_SHELL="/bin/sh ./libtool" +# LIBTOOL="$LIBTOOL --silent" +KDE_PLUGIN="-avoid-version -module -no-undefined \$(KDE_NO_UNDEFINED) \$(KDE_RPATH) \$(KDE_MT_LDFLAGS)" +AC_SUBST(KDE_PLUGIN) + +# This hack ensures that libtool creates shared libs for kunittest plugins. By default check_LTLIBRARIES makes static libs. +KDE_CHECK_PLUGIN="\$(KDE_PLUGIN) -rpath \$(libdir)" +AC_SUBST(KDE_CHECK_PLUGIN) + +# we patch configure quite some so we better keep that consistent for incremental runs +AC_SUBST(AUTOCONF,'$(SHELL) $(top_srcdir)/admin/cvs.sh configure || touch configure') +]) + +AC_DEFUN([KDE_CHECK_LIB64], +[ + AC_ARG_ENABLE(libsuffix, + AC_HELP_STRING([--enable-libsuffix], + [/lib directory suffix (64,32,none,auto[=default])]), + kdelibsuff=$enableval, kdelibsuff="auto") + + if test "$kdelibsuff" = "auto"; then + +cat > conftest.c << EOF +#include +int main() { + return 0; +} +EOF + kdelibsuff=`$CC conftest.c -o conftest.out; ldd conftest.out |sed -ne '/libc.so/{ + s,.*/lib\([[^\/]]*\)/.*,\1, + p +}'` + rm -rf conftest.* + fi + + if test "$kdelibsuff" = "no" || test "$kdelibsuff" = "none"; then + kdelibsuff= + fi + if test -z "$kdelibsuff"; then + AC_MSG_RESULT([not using lib directory suffix]) + AC_DEFINE(KDELIBSUFF, [""], Suffix for lib directories) + else + if test "$libdir" = '${exec_prefix}/lib'; then + libdir="$libdir${kdelibsuff}" + AC_SUBST([libdir], ["$libdir"]) dnl ugly hack for lib64 platforms + fi + AC_DEFINE_UNQUOTED(KDELIBSUFF, ["${kdelibsuff}"], Suffix for lib directories) + AC_MSG_RESULT([using lib directory suffix $kdelibsuff]) + fi +]) + +AC_DEFUN([KDE_CHECK_TYPES], +[ AC_CHECK_SIZEOF(int, 4)dnl + AC_CHECK_SIZEOF(short)dnl + AC_CHECK_SIZEOF(long, 4)dnl + AC_CHECK_SIZEOF(char *, 4)dnl +])dnl + +dnl Not used - kept for compat only? +AC_DEFUN([KDE_DO_IT_ALL], +[ +AC_CANONICAL_SYSTEM +AC_ARG_PROGRAM +AM_INIT_AUTOMAKE($1, $2) +AM_DISABLE_LIBRARIES +AC_PREFIX_DEFAULT(${KDEDIR:-/usr/local/kde}) +AC_CHECK_COMPILERS +KDE_PROG_LIBTOOL +AM_KDE_WITH_NLS +AC_PATH_KDE +]) + +AC_DEFUN([AC_CHECK_RPATH], +[ +AC_MSG_CHECKING(for rpath) +AC_ARG_ENABLE(rpath, + AC_HELP_STRING([--disable-rpath],[do not use the rpath feature of ld]), + USE_RPATH=$enableval, USE_RPATH=yes) + +if test -z "$KDE_RPATH" && test "$USE_RPATH" = "yes"; then + + KDE_RPATH="-R \$(libdir)" + + if test "$kde_libraries" != "$libdir"; then + KDE_RPATH="$KDE_RPATH -R \$(kde_libraries)" + fi + + if test -n "$qt_libraries"; then + KDE_RPATH="$KDE_RPATH -R \$(qt_libraries)" + fi + dnl $x_libraries is set to /usr/lib in case + if test -n "$X_LDFLAGS"; then + X_RPATH="-R \$(x_libraries)" + KDE_RPATH="$KDE_RPATH $X_RPATH" + fi + if test -n "$KDE_EXTRA_RPATH"; then + KDE_RPATH="$KDE_RPATH \$(KDE_EXTRA_RPATH)" + fi +fi +AC_SUBST(KDE_EXTRA_RPATH) +AC_SUBST(KDE_RPATH) +AC_SUBST(X_RPATH) +AC_MSG_RESULT($USE_RPATH) +]) + +dnl Check for the type of the third argument of getsockname +AC_DEFUN([AC_CHECK_SOCKLEN_T], +[ + AC_MSG_CHECKING(for socklen_t) + AC_CACHE_VAL(kde_cv_socklen_t, + [ + AC_LANG_PUSH(C++) + kde_cv_socklen_t=no + AC_TRY_COMPILE([ + #include + #include + ], + [ + socklen_t len; + getpeername(0,0,&len); + ], + [ + kde_cv_socklen_t=yes + kde_cv_socklen_t_equiv=socklen_t + ]) + AC_LANG_POP(C++) + ]) + AC_MSG_RESULT($kde_cv_socklen_t) + if test $kde_cv_socklen_t = no; then + AC_MSG_CHECKING([for socklen_t equivalent for socket functions]) + AC_CACHE_VAL(kde_cv_socklen_t_equiv, + [ + kde_cv_socklen_t_equiv=int + AC_LANG_PUSH(C++) + for t in int size_t unsigned long "unsigned long"; do + AC_TRY_COMPILE([ + #include + #include + ], + [ + $t len; + getpeername(0,0,&len); + ], + [ + kde_cv_socklen_t_equiv="$t" + break + ]) + done + AC_LANG_POP(C++) + ]) + AC_MSG_RESULT($kde_cv_socklen_t_equiv) + fi + AC_DEFINE_UNQUOTED(kde_socklen_t, $kde_cv_socklen_t_equiv, + [type to use in place of socklen_t if not defined]) + AC_DEFINE_UNQUOTED(ksize_t, $kde_cv_socklen_t_equiv, + [type to use in place of socklen_t if not defined (deprecated, use kde_socklen_t)]) +]) + +dnl This is a merge of some macros out of the gettext aclocal.m4 +dnl since we don't need anything, I took the things we need +dnl the copyright for them is: +dnl > +dnl Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc. +dnl This Makefile.in is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl This program is distributed in the hope that it will be useful, +dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without +dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A +dnl PARTICULAR PURPOSE. +dnl > +dnl for this file it is relicensed under LGPL + +AC_DEFUN([AM_KDE_WITH_NLS], + [ + dnl If we use NLS figure out what method + + AM_PATH_PROG_WITH_TEST_KDE(MSGFMT, msgfmt, + [test -n "`$ac_dir/$ac_word --version 2>&1 | grep 'GNU gettext'`"], msgfmt) + AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT) + + if test -z "`$GMSGFMT --version 2>&1 | grep 'GNU gettext'`"; then + AC_MSG_RESULT([found msgfmt program is not GNU msgfmt; ignore it]) + GMSGFMT=":" + fi + MSGFMT=$GMSGFMT + AC_SUBST(GMSGFMT) + AC_SUBST(MSGFMT) + + AM_PATH_PROG_WITH_TEST_KDE(XGETTEXT, xgettext, + [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :) + + dnl Test whether we really found GNU xgettext. + if test "$XGETTEXT" != ":"; then + dnl If it is no GNU xgettext we define it as : so that the + dnl Makefiles still can work. + if $XGETTEXT --omit-header /dev/null 2> /dev/null; then + : ; + else + AC_MSG_RESULT( + [found xgettext programs is not GNU xgettext; ignore it]) + XGETTEXT=":" + fi + fi + AC_SUBST(XGETTEXT) + + ]) + +# Search path for a program which passes the given test. +# Ulrich Drepper , 1996. + +# serial 1 +# Stephan Kulow: I appended a _KDE against name conflicts + +dnl AM_PATH_PROG_WITH_TEST_KDE(VARIABLE, PROG-TO-CHECK-FOR, +dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]]) +AC_DEFUN([AM_PATH_PROG_WITH_TEST_KDE], +[# Extract the first word of "$2", so it can be a program name with args. +set dummy $2; ac_word=[$]2 +AC_MSG_CHECKING([for $ac_word]) +AC_CACHE_VAL(ac_cv_path_$1, +[case "[$]$1" in + /*) + ac_cv_path_$1="[$]$1" # Let the user override the test with a path. + ;; + *) + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" + for ac_dir in ifelse([$5], , $PATH, [$5]); do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + if [$3]; then + ac_cv_path_$1="$ac_dir/$ac_word" + break + fi + fi + done + IFS="$ac_save_ifs" +dnl If no 4th arg is given, leave the cache variable unset, +dnl so AC_PATH_PROGS will keep looking. +ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4" +])dnl + ;; +esac])dnl +$1="$ac_cv_path_$1" +if test -n "[$]$1"; then + AC_MSG_RESULT([$]$1) +else + AC_MSG_RESULT(no) +fi +AC_SUBST($1)dnl +]) + + +# Check whether LC_MESSAGES is available in . +# Ulrich Drepper , 1995. + +# serial 1 + +AC_DEFUN([AM_LC_MESSAGES], + [if test $ac_cv_header_locale_h = yes; then + AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES, + [AC_TRY_LINK([#include ], [return LC_MESSAGES], + am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)]) + if test $am_cv_val_LC_MESSAGES = yes; then + AC_DEFINE(HAVE_LC_MESSAGES, 1, [Define if your locale.h file contains LC_MESSAGES]) + fi + fi]) + +dnl From Jim Meyering. +dnl FIXME: migrate into libit. + +AC_DEFUN([AM_FUNC_OBSTACK], +[AC_CACHE_CHECK([for obstacks], am_cv_func_obstack, + [AC_TRY_LINK([#include "obstack.h"], + [struct obstack *mem;obstack_free(mem,(char *) 0)], + am_cv_func_obstack=yes, + am_cv_func_obstack=no)]) + if test $am_cv_func_obstack = yes; then + AC_DEFINE(HAVE_OBSTACK) + else + LIBOBJS="$LIBOBJS obstack.o" + fi +]) + +dnl From Jim Meyering. Use this if you use the GNU error.[ch]. +dnl FIXME: Migrate into libit + +AC_DEFUN([AM_FUNC_ERROR_AT_LINE], +[AC_CACHE_CHECK([for error_at_line], am_cv_lib_error_at_line, + [AC_TRY_LINK([],[error_at_line(0, 0, "", 0, "");], + am_cv_lib_error_at_line=yes, + am_cv_lib_error_at_line=no)]) + if test $am_cv_lib_error_at_line = no; then + LIBOBJS="$LIBOBJS error.o" + fi + AC_SUBST(LIBOBJS)dnl +]) + +# Macro to add for using GNU gettext. +# Ulrich Drepper , 1995. + +# serial 1 +# Stephan Kulow: I put a KDE in it to avoid name conflicts + +AC_DEFUN([AM_KDE_GNU_GETTEXT], + [AC_REQUIRE([AC_PROG_MAKE_SET])dnl + AC_REQUIRE([AC_PROG_RANLIB])dnl + AC_REQUIRE([AC_HEADER_STDC])dnl + AC_REQUIRE([AC_TYPE_OFF_T])dnl + AC_REQUIRE([AC_TYPE_SIZE_T])dnl + AC_REQUIRE([AC_FUNC_ALLOCA])dnl + AC_REQUIRE([AC_FUNC_MMAP])dnl + AC_REQUIRE([AM_KDE_WITH_NLS])dnl + AC_CHECK_HEADERS([limits.h locale.h nl_types.h string.h values.h alloca.h]) + AC_CHECK_FUNCS([getcwd munmap putenv setlocale strchr strcasecmp \ +__argz_count __argz_stringify __argz_next]) + + AC_MSG_CHECKING(for stpcpy) + AC_CACHE_VAL(kde_cv_func_stpcpy, + [ + kde_safe_cxxflags=$CXXFLAGS + CXXFLAGS="-Werror" + AC_LANG_SAVE + AC_LANG_CPLUSPLUS + AC_TRY_COMPILE([ + #include + ], + [ + char buffer[200]; + stpcpy(buffer, buffer); + ], + kde_cv_func_stpcpy=yes, + kde_cv_func_stpcpy=no) + AC_LANG_RESTORE + CXXFLAGS=$kde_safe_cxxflags + ]) + AC_MSG_RESULT($kde_cv_func_stpcpy) + if eval "test \"`echo $kde_cv_func_stpcpy`\" = yes"; then + AC_DEFINE(HAVE_STPCPY, 1, [Define if you have stpcpy]) + fi + + AM_LC_MESSAGES + + if test "x$CATOBJEXT" != "x"; then + if test "x$ALL_LINGUAS" = "x"; then + LINGUAS= + else + AC_MSG_CHECKING(for catalogs to be installed) + NEW_LINGUAS= + for lang in ${LINGUAS=$ALL_LINGUAS}; do + case "$ALL_LINGUAS" in + *$lang*) NEW_LINGUAS="$NEW_LINGUAS $lang" ;; + esac + done + LINGUAS=$NEW_LINGUAS + AC_MSG_RESULT($LINGUAS) + fi + + dnl Construct list of names of catalog files to be constructed. + if test -n "$LINGUAS"; then + for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done + fi + fi + + ]) + +AC_DEFUN([AC_HAVE_XPM], + [AC_REQUIRE_CPP()dnl + AC_REQUIRE([KDE_CHECK_EXTRA_LIBS]) + + test -z "$XPM_LDFLAGS" && XPM_LDFLAGS= + test -z "$XPM_INCLUDE" && XPM_INCLUDE= + + AC_ARG_WITH(xpm,AC_HELP_STRING([--without-xpm],[disable color pixmap XPM tests]), + xpm_test=$withval, xpm_test="yes") + if test "x$xpm_test" = xno; then + ac_cv_have_xpm=no + else + AC_MSG_CHECKING(for XPM) + AC_CACHE_VAL(ac_cv_have_xpm, + [ + ac_save_ldflags="$LDFLAGS" + ac_save_cflags="$CFLAGS" + if test "x$kde_use_qt_emb" != "xyes" && test "x$kde_use_qt_mac" != "xyes"; then + LDFLAGS="$LDFLAGS $X_LDFLAGS $USER_LDFLAGS $LDFLAGS $XPM_LDFLAGS $all_libraries -lXpm -lX11 -lXext $LIBZ $LIBSOCKET" + else + LDFLAGS="$LDFLAGS $X_LDFLAGS $USER_LDFLAGS $LDFLAGS $XPM_LDFLAGS $all_libraries -lXpm $LIBZ $LIBSOCKET" + fi + CFLAGS="$CFLAGS $X_INCLUDES $USER_INCLUDES" + test -n "$XPM_INCLUDE" && CFLAGS="-I$XPM_INCLUDE $CFLAGS" + AC_TRY_LINK([#include ],[], + ac_cv_have_xpm="yes",ac_cv_have_xpm="no") + LDFLAGS="$ac_save_ldflags" + CFLAGS="$ac_save_cflags" + ])dnl + + if test "$ac_cv_have_xpm" = no; then + AC_MSG_RESULT(no) + XPM_LDFLAGS="" + XPMINC="" + $2 + else + AC_DEFINE(HAVE_XPM, 1, [Define if you have XPM support]) + if test "$XPM_LDFLAGS" = ""; then + XPMLIB='-lXpm $(LIB_X11)' + else + XPMLIB="-L$XPM_LDFLAGS -lXpm "'$(LIB_X11)' + fi + if test "$XPM_INCLUDE" = ""; then + XPMINC="" + else + XPMINC="-I$XPM_INCLUDE" + fi + AC_MSG_RESULT(yes) + $1 + fi + fi + AC_SUBST(XPMINC) + AC_SUBST(XPMLIB) +]) + +AC_DEFUN([AC_HAVE_DPMS], + [AC_REQUIRE_CPP()dnl + AC_REQUIRE([KDE_CHECK_EXTRA_LIBS]) + + test -z "$DPMS_LDFLAGS" && DPMS_LDFLAGS= + test -z "$DPMS_INCLUDE" && DPMS_INCLUDE= + DPMS_LIB= + + AC_ARG_WITH(dpms,AC_HELP_STRING([--without-dpms],[disable DPMS power saving]), + dpms_test=$withval, dpms_test="yes") + if test "x$dpms_test" = xno; then + ac_cv_have_dpms=no + else + AC_MSG_CHECKING(for DPMS) + dnl Note: ac_cv_have_dpms can be no, yes, or -lXdpms. + dnl 'yes' means DPMS_LIB="", '-lXdpms' means DPMS_LIB="-lXdpms". + AC_CACHE_VAL(ac_cv_have_dpms, + [ + if test "x$kde_use_qt_emb" = "xyes" || test "x$kde_use_qt_mac" = "xyes"; then + AC_MSG_RESULT(no) + ac_cv_have_dpms="no" + else + ac_save_ldflags="$LDFLAGS" + ac_save_cflags="$CFLAGS" + ac_save_libs="$LIBS" + LDFLAGS="$LDFLAGS $DPMS_LDFLAGS $all_libraries" + LIBS="-lX11 -lXext $LIBSOCKET" + CFLAGS="$CFLAGS $X_INCLUDES" + test -n "$DPMS_INCLUDE" && CFLAGS="-I$DPMS_INCLUDE $CFLAGS" + AC_TRY_LINK([ + #include + #include + #include + #include + int foo_test_dpms() + { return DPMSSetTimeouts( 0, 0, 0, 0 ); }],[], + ac_cv_have_dpms="yes", [ + LIBS="-lXdpms $LIBS" + AC_TRY_LINK([ + #include + #include + #include + #include + int foo_test_dpms() + { return DPMSSetTimeouts( 0, 0, 0, 0 ); }],[], + [ + ac_cv_have_dpms="-lXdpms" + ],ac_cv_have_dpms="no") + ]) + LDFLAGS="$ac_save_ldflags" + CFLAGS="$ac_save_cflags" + LIBS="$ac_save_libs" + fi + ])dnl + + if test "$ac_cv_have_dpms" = no; then + AC_MSG_RESULT(no) + DPMS_LDFLAGS="" + DPMSINC="" + $2 + else + AC_DEFINE(HAVE_DPMS, 1, [Define if you have DPMS support]) + if test "$ac_cv_have_dpms" = "-lXdpms"; then + DPMS_LIB="-lXdpms" + fi + if test "$DPMS_LDFLAGS" = ""; then + DPMSLIB="$DPMS_LIB "'$(LIB_X11)' + else + DPMSLIB="$DPMS_LDFLAGS $DPMS_LIB "'$(LIB_X11)' + fi + if test "$DPMS_INCLUDE" = ""; then + DPMSINC="" + else + DPMSINC="-I$DPMS_INCLUDE" + fi + AC_MSG_RESULT(yes) + $1 + fi + fi + ac_save_cflags="$CFLAGS" + CFLAGS="$CFLAGS $X_INCLUDES" + test -n "$DPMS_INCLUDE" && CFLAGS="-I$DPMS_INCLUDE $CFLAGS" + AH_TEMPLATE(HAVE_DPMSCAPABLE_PROTO, + [Define if you have the DPMSCapable prototype in ]) + AC_CHECK_DECL(DPMSCapable, + AC_DEFINE(HAVE_DPMSCAPABLE_PROTO),, + [#include + #include ]) + AH_TEMPLATE(HAVE_DPMSINFO_PROTO, + [Define if you have the DPMSInfo prototype in ]) + AC_CHECK_DECL(DPMSInfo, + AC_DEFINE(HAVE_DPMSINFO_PROTO),, + [#include + #include ]) + CFLAGS="$ac_save_cflags" + AC_SUBST(DPMSINC) + AC_SUBST(DPMSLIB) +]) + +AC_DEFUN([AC_HAVE_GL], + [AC_REQUIRE_CPP()dnl + AC_REQUIRE([KDE_CHECK_EXTRA_LIBS]) + + test -z "$GL_LDFLAGS" && GL_LDFLAGS= + test -z "$GL_INCLUDE" && GL_INCLUDE= + + AC_ARG_WITH(gl,AC_HELP_STRING([--without-gl],[disable 3D GL modes]), + gl_test=$withval, gl_test="yes") + if test "x$kde_use_qt_emb" = "xyes"; then + # GL and Qt Embedded is a no-go for now. + ac_cv_have_gl=no + elif test "x$gl_test" = xno; then + ac_cv_have_gl=no + else + AC_MSG_CHECKING(for GL) + AC_CACHE_VAL(ac_cv_have_gl, + [ + AC_LANG_SAVE + AC_LANG_CPLUSPLUS + ac_save_ldflags=$LDFLAGS + ac_save_cxxflags=$CXXFLAGS + ac_save_libs=$LIBS + LDFLAGS="$LDFLAGS $GL_LDFLAGS $X_LDFLAGS $all_libraries" + LIBS="$LIBS -lGL -lGLU" + test "x$kde_use_qt_mac" != xyes && test "x$kde_use_qt_emb" != xyes && LIBS="$LIBS -lX11" + LIBS="$LIBS $LIB_XEXT -lm $LIBSOCKET" + CXXFLAGS="$CFLAGS $X_INCLUDES" + test -n "$GL_INCLUDE" && CFLAGS="-I$GL_INCLUDE $CFLAGS" + AC_TRY_LINK([#include +#include +], [], + ac_cv_have_gl="yes", ac_cv_have_gl="no") + AC_LANG_RESTORE + LDFLAGS=$ac_save_ldflags + CXXFLAGS=$ac_save_cxxflags + LIBS=$ac_save_libs + ])dnl + + if test "$ac_cv_have_gl" = "no"; then + AC_MSG_RESULT(no) + GL_LDFLAGS="" + GLINC="" + $2 + else + AC_DEFINE(HAVE_GL, 1, [Defines if you have GL (Mesa, OpenGL, ...)]) + if test "$GL_LDFLAGS" = ""; then + GLLIB='-lGLU -lGL $(LIB_X11)' + else + GLLIB="$GL_LDFLAGS -lGLU -lGL "'$(LIB_X11)' + fi + if test "$GL_INCLUDE" = ""; then + GLINC="" + else + GLINC="-I$GL_INCLUDE" + fi + AC_MSG_RESULT($ac_cv_have_gl) + $1 + fi + fi + AC_SUBST(GLINC) + AC_SUBST(GLLIB) +]) + + + dnl shadow password and PAM magic - maintained by ossi@kde.org + +AC_DEFUN([KDE_PAM], [ + AC_REQUIRE([KDE_CHECK_LIBDL]) + + want_pam= + AC_ARG_WITH(pam, + AC_HELP_STRING([--with-pam[=ARG]],[enable support for PAM: ARG=[yes|no|service name]]), + [ if test "x$withval" = "xyes"; then + want_pam=yes + pam_service=kde + elif test "x$withval" = "xno"; then + want_pam=no + else + want_pam=yes + pam_service=$withval + fi + ], [ pam_service=kde ]) + + use_pam= + PAMLIBS= + if test "x$want_pam" != xno; then + AC_CHECK_LIB(pam, pam_start, [ + AC_CHECK_HEADER(security/pam_appl.h, + [ pam_header=security/pam_appl.h ], + [ AC_CHECK_HEADER(pam/pam_appl.h, + [ pam_header=pam/pam_appl.h ], + [ + AC_MSG_WARN([PAM detected, but no headers found! +Make sure you have the necessary development packages installed.]) + ] + ) + ] + ) + ], , $LIBDL) + if test -z "$pam_header"; then + if test "x$want_pam" = xyes; then + AC_MSG_ERROR([--with-pam was specified, but cannot compile with PAM!]) + fi + else + AC_DEFINE(HAVE_PAM, 1, [Defines if you have PAM (Pluggable Authentication Modules)]) + PAMLIBS="$PAM_MISC_LIB -lpam $LIBDL" + use_pam=yes + + dnl darwin claims to be something special + if test "$pam_header" = "pam/pam_appl.h"; then + AC_DEFINE(HAVE_PAM_PAM_APPL_H, 1, [Define if your PAM headers are in pam/ instead of security/]) + fi + + dnl test whether struct pam_message is const (Linux) or not (Sun) + AC_MSG_CHECKING(for const pam_message) + AC_EGREP_HEADER([struct pam_message], $pam_header, + [ AC_EGREP_HEADER([const struct pam_message], $pam_header, + [AC_MSG_RESULT([const: Linux-type PAM])], + [AC_MSG_RESULT([nonconst: Sun-type PAM]) + AC_DEFINE(PAM_MESSAGE_NONCONST, 1, [Define if your PAM support takes non-const arguments (Solaris)])] + )], + [AC_MSG_RESULT([not found - assume const, Linux-type PAM])]) + fi + fi + + AC_SUBST(PAMLIBS) +]) + +dnl DEF_PAM_SERVICE(arg name, full name, define name) +AC_DEFUN([DEF_PAM_SERVICE], [ + AC_ARG_WITH($1-pam, + AC_HELP_STRING([--with-$1-pam=[val]],[override PAM service from --with-pam for $2]), + [ if test "x$use_pam" = xyes; then + $3_PAM_SERVICE=$withval + else + AC_MSG_ERROR([Cannot use use --with-$1-pam, as no PAM was detected. +You may want to enforce it by using --with-pam.]) + fi + ], + [ if test "x$use_pam" = xyes; then + $3_PAM_SERVICE="$pam_service" + fi + ]) + if test -n "$$3_PAM_SERVICE"; then + AC_MSG_RESULT([The PAM service used by $2 will be $$3_PAM_SERVICE]) + AC_DEFINE_UNQUOTED($3_PAM_SERVICE, "$$3_PAM_SERVICE", [The PAM service to be used by $2]) + fi + AC_SUBST($3_PAM_SERVICE) +]) + +AC_DEFUN([KDE_SHADOWPASSWD], [ + AC_REQUIRE([KDE_PAM]) + + AC_CHECK_LIB(shadow, getspent, + [ LIBSHADOW="-lshadow" + ac_use_shadow=yes + ], + [ dnl for UnixWare + AC_CHECK_LIB(gen, getspent, + [ LIBGEN="-lgen" + ac_use_shadow=yes + ], + [ AC_CHECK_FUNC(getspent, + [ ac_use_shadow=yes ], + [ ac_use_shadow=no ]) + ]) + ]) + AC_SUBST(LIBSHADOW) + AC_SUBST(LIBGEN) + + AC_MSG_CHECKING([for shadow passwords]) + + AC_ARG_WITH(shadow, + AC_HELP_STRING([--with-shadow],[If you want shadow password support]), + [ if test "x$withval" != "xno"; then + use_shadow=yes + else + use_shadow=no + fi + ], [ + use_shadow="$ac_use_shadow" + ]) + + if test "x$use_shadow" = xyes; then + AC_MSG_RESULT(yes) + AC_DEFINE(HAVE_SHADOW, 1, [Define if you use shadow passwords]) + else + AC_MSG_RESULT(no) + LIBSHADOW= + LIBGEN= + fi + + dnl finally make the relevant binaries setuid root, if we have shadow passwds. + dnl this still applies, if we could use it indirectly through pam. + if test "x$use_shadow" = xyes || + ( test "x$use_pam" = xyes && test "x$ac_use_shadow" = xyes ); then + case $host in + *-*-freebsd* | *-*-netbsd* | *-*-openbsd*) + SETUIDFLAGS="-m 4755 -o root";; + *) + SETUIDFLAGS="-m 4755";; + esac + fi + AC_SUBST(SETUIDFLAGS) + +]) + +AC_DEFUN([KDE_PASSWDLIBS], [ + AC_REQUIRE([KDE_MISC_TESTS]) dnl for LIBCRYPT + AC_REQUIRE([KDE_PAM]) + AC_REQUIRE([KDE_SHADOWPASSWD]) + + if test "x$use_pam" = "xyes"; then + PASSWDLIBS="$PAMLIBS" + else + PASSWDLIBS="$LIBCRYPT $LIBSHADOW $LIBGEN" + fi + + dnl FreeBSD uses a shadow-like setup, where /etc/passwd holds the users, but + dnl /etc/master.passwd holds the actual passwords. /etc/master.passwd requires + dnl root to read, so kcheckpass needs to be root (even when using pam, since pam + dnl may need to read /etc/master.passwd). + case $host in + *-*-freebsd*) + SETUIDFLAGS="-m 4755 -o root" + ;; + *) + ;; + esac + + AC_SUBST(PASSWDLIBS) +]) + +AC_DEFUN([KDE_CHECK_LIBDL], +[ +AC_CHECK_LIB(dl, dlopen, [ +LIBDL="-ldl" +ac_cv_have_dlfcn=yes +]) + +AC_CHECK_LIB(dld, shl_unload, [ +LIBDL="-ldld" +ac_cv_have_shload=yes +]) + +AC_SUBST(LIBDL) +]) + +AC_DEFUN([KDE_CHECK_DLOPEN], +[ +KDE_CHECK_LIBDL +AC_CHECK_HEADERS(dlfcn.h dl.h) +if test "$ac_cv_header_dlfcn_h" = "no"; then + ac_cv_have_dlfcn=no +fi + +if test "$ac_cv_header_dl_h" = "no"; then + ac_cv_have_shload=no +fi + +dnl XXX why change enable_dlopen? its already set by autoconf's AC_ARG_ENABLE +dnl (MM) +AC_ARG_ENABLE(dlopen, +AC_HELP_STRING([--disable-dlopen],[link statically [default=no]]), +enable_dlopen=$enableval, +enable_dlopen=yes) + +# override the user's opinion, if we know it better ;) +if test "$ac_cv_have_dlfcn" = "no" && test "$ac_cv_have_shload" = "no"; then + enable_dlopen=no +fi + +if test "$ac_cv_have_dlfcn" = "yes"; then + AC_DEFINE_UNQUOTED(HAVE_DLFCN, 1, [Define if you have dlfcn]) +fi + +if test "$ac_cv_have_shload" = "yes"; then + AC_DEFINE_UNQUOTED(HAVE_SHLOAD, 1, [Define if you have shload]) +fi + +if test "$enable_dlopen" = no ; then + test -n "$1" && eval $1 +else + test -n "$2" && eval $2 +fi + +]) + +AC_DEFUN([KDE_CHECK_DYNAMIC_LOADING], +[ +KDE_CHECK_DLOPEN(libtool_enable_shared=yes, libtool_enable_static=no) +KDE_PROG_LIBTOOL +AC_MSG_CHECKING([dynamic loading]) +eval "`egrep '^build_libtool_libs=' libtool`" +if test "$build_libtool_libs" = "yes" && test "$enable_dlopen" = "yes"; then + dynamic_loading=yes + AC_DEFINE_UNQUOTED(HAVE_DYNAMIC_LOADING) +else + dynamic_loading=no +fi +AC_MSG_RESULT($dynamic_loading) +if test "$dynamic_loading" = "yes"; then + $1 +else + $2 +fi +]) + +AC_DEFUN([KDE_ADD_INCLUDES], +[ +if test -z "$1"; then + test_include="Pix.h" +else + test_include="$1" +fi + +AC_MSG_CHECKING([for libg++ ($test_include)]) + +AC_CACHE_VAL(kde_cv_libgpp_includes, +[ +kde_cv_libgpp_includes=no + + for ac_dir in \ + \ + /usr/include/g++ \ + /usr/include \ + /usr/unsupported/include \ + /opt/include \ + $extra_include \ + ; \ + do + if test -r "$ac_dir/$test_include"; then + kde_cv_libgpp_includes=$ac_dir + break + fi + done +]) + +AC_MSG_RESULT($kde_cv_libgpp_includes) +if test "$kde_cv_libgpp_includes" != "no"; then + all_includes="-I$kde_cv_libgpp_includes $all_includes $USER_INCLUDES" +fi +]) +]) + +AC_DEFUN([KDE_CHECK_LIBPTHREAD], +[ + dnl This code is here specifically to handle the + dnl various flavors of threading library on FreeBSD + dnl 4-, 5-, and 6-, and the (weird) rules around it. + dnl There may be an environment PTHREAD_LIBS that + dnl specifies what to use; otherwise, search for it. + dnl -pthread is special cased and unsets LIBPTHREAD + dnl below if found. + LIBPTHREAD="" + + if test -n "$PTHREAD_LIBS"; then + if test "x$PTHREAD_LIBS" = "x-pthread" ; then + LIBPTHREAD="PTHREAD" + else + PTHREAD_LIBS_save="$PTHREAD_LIBS" + PTHREAD_LIBS=`echo "$PTHREAD_LIBS_save" | sed -e 's,^-l,,g'` + AC_MSG_CHECKING([for pthread_create in $PTHREAD_LIBS]) + KDE_CHECK_LIB($PTHREAD_LIBS, pthread_create, [ + LIBPTHREAD="$PTHREAD_LIBS_save"]) + PTHREAD_LIBS="$PTHREAD_LIBS_save" + fi + fi + + dnl Is this test really needed, in the face of the Tru64 test below? + if test -z "$LIBPTHREAD"; then + AC_CHECK_LIB(pthread, pthread_create, [LIBPTHREAD="-lpthread"]) + fi + + dnl This is a special Tru64 check, see BR 76171 issue #18. + if test -z "$LIBPTHREAD" ; then + AC_MSG_CHECKING([for pthread_create in -lpthread]) + kde_safe_libs=$LIBS + LIBS="$LIBS -lpthread" + AC_TRY_LINK([#include ],[(void)pthread_create(0,0,0,0);],[ + AC_MSG_RESULT(yes) + LIBPTHREAD="-lpthread"],[ + AC_MSG_RESULT(no)]) + LIBS=$kde_safe_libs + fi + + dnl Un-special-case for FreeBSD. + if test "x$LIBPTHREAD" = "xPTHREAD" ; then + LIBPTHREAD="" + fi + + AC_SUBST(LIBPTHREAD) +]) + +AC_DEFUN([KDE_CHECK_PTHREAD_OPTION], +[ + USE_THREADS="" + if test -z "$LIBPTHREAD"; then + KDE_CHECK_COMPILER_FLAG(pthread, [USE_THREADS="-D_THREAD_SAFE -pthread"]) + fi + + AH_VERBATIM(__svr_define, [ +#if defined(__SVR4) && !defined(__svr4__) +#define __svr4__ 1 +#endif +]) + case $host_os in + solaris*) + KDE_CHECK_COMPILER_FLAG(mt, [USE_THREADS="-mt"]) + CPPFLAGS="$CPPFLAGS -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -DUSE_SOLARIS -DSVR4" + ;; + freebsd*) + CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE $PTHREAD_CFLAGS" + ;; + aix*) + CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE" + LIBPTHREAD="$LIBPTHREAD -lc_r" + ;; + linux*) CPPFLAGS="$CPPFLAGS -D_REENTRANT" + if test "$CXX" = "KCC"; then + CXXFLAGS="$CXXFLAGS --thread_safe" + NOOPT_CXXFLAGS="$NOOPT_CXXFLAGS --thread_safe" + fi + ;; + *) + ;; + esac + AC_SUBST(USE_THREADS) + AC_SUBST(LIBPTHREAD) +]) + +AC_DEFUN([KDE_CHECK_THREADING], +[ + AC_REQUIRE([KDE_CHECK_LIBPTHREAD]) + AC_REQUIRE([KDE_CHECK_PTHREAD_OPTION]) + dnl default is yes if libpthread is found and no if no libpthread is available + if test -z "$LIBPTHREAD"; then + if test -z "$USE_THREADS"; then + kde_check_threading_default=no + else + kde_check_threading_default=yes + fi + else + kde_check_threading_default=yes + fi + AC_ARG_ENABLE(threading,AC_HELP_STRING([--disable-threading],[disables threading even if libpthread found]), + kde_use_threading=$enableval, kde_use_threading=$kde_check_threading_default) + if test "x$kde_use_threading" = "xyes"; then + AC_DEFINE(HAVE_LIBPTHREAD, 1, [Define if you have a working libpthread (will enable threaded code)]) + fi +]) + +AC_DEFUN([KDE_TRY_LINK_PYTHON], +[ +if test "$kde_python_link_found" = no; then + +if test "$1" = normal; then + AC_MSG_CHECKING(if a Python application links) +else + AC_MSG_CHECKING(if Python depends on $2) +fi + +AC_CACHE_VAL(kde_cv_try_link_python_$1, +[ +kde_save_cflags="$CFLAGS" +CFLAGS="$CFLAGS $PYTHONINC" +kde_save_libs="$LIBS" +LIBS="$LIBS $LIBPYTHON $2 $LIBDL $LIBSOCKET" +kde_save_ldflags="$LDFLAGS" +LDFLAGS="$LDFLAGS $PYTHONLIB" + +AC_TRY_LINK( +[ +#include +],[ + PySys_SetArgv(1, 0); +], + [kde_cv_try_link_python_$1=yes], + [kde_cv_try_link_python_$1=no] +) +CFLAGS="$kde_save_cflags" +LIBS="$kde_save_libs" +LDFLAGS="$kde_save_ldflags" +]) + +if test "$kde_cv_try_link_python_$1" = "yes"; then + AC_MSG_RESULT(yes) + kde_python_link_found=yes + if test ! "$1" = normal; then + LIBPYTHON="$LIBPYTHON $2" + fi + $3 +else + AC_MSG_RESULT(no) + $4 +fi + +fi + +]) + +AC_DEFUN([KDE_CHECK_PYTHON_DIR], +[ +AC_MSG_CHECKING([for Python directory]) + +AC_CACHE_VAL(kde_cv_pythondir, +[ + if test -z "$PYTHONDIR"; then + kde_cv_pythondir=/usr/local + else + kde_cv_pythondir="$PYTHONDIR" + fi +]) + +AC_ARG_WITH(pythondir, +AC_HELP_STRING([--with-pythondir=pythondir],[use python installed in pythondir]), +[ + ac_python_dir=$withval +], ac_python_dir=$kde_cv_pythondir +) + +AC_MSG_RESULT($ac_python_dir) +]) + +AC_DEFUN([KDE_CHECK_PYTHON_INTERN], +[ +AC_REQUIRE([KDE_CHECK_LIBDL]) +AC_REQUIRE([KDE_CHECK_LIBPTHREAD]) +AC_REQUIRE([KDE_CHECK_PYTHON_DIR]) + +if test -z "$1"; then + version="1.5" +else + version="$1" +fi + +AC_MSG_CHECKING([for Python$version]) + +python_incdirs="$ac_python_dir/include /usr/include /usr/local/include/ $kde_extra_includes" +AC_FIND_FILE(Python.h, $python_incdirs, python_incdir) +if test ! -r $python_incdir/Python.h; then + AC_FIND_FILE(python$version/Python.h, $python_incdirs, python_incdir) + python_incdir=$python_incdir/python$version + if test ! -r $python_incdir/Python.h; then + python_incdir=no + fi +fi + +PYTHONINC=-I$python_incdir + +python_libdirs="$ac_python_dir/lib$kdelibsuff /usr/lib$kdelibsuff /usr/local /usr/lib$kdelibsuff $kde_extra_libs" +AC_FIND_FILE(libpython$version.so, $python_libdirs, python_libdir) +if test ! -r $python_libdir/libpython$version.so; then + AC_FIND_FILE(libpython$version.a, $python_libdirs, python_libdir) + if test ! -r $python_libdir/libpython$version.a; then + AC_FIND_FILE(python$version/config/libpython$version.a, $python_libdirs, python_libdir) + python_libdir=$python_libdir/python$version/config + if test ! -r $python_libdir/libpython$version.a; then + python_libdir=no + fi + fi +fi + +PYTHONLIB=-L$python_libdir +kde_orig_LIBPYTHON=$LIBPYTHON +if test -z "$LIBPYTHON"; then + LIBPYTHON=-lpython$version +fi + +AC_FIND_FILE(python$version/copy.py, $python_libdirs, python_moddir) +python_moddir=$python_moddir/python$version +if test ! -r $python_moddir/copy.py; then + python_moddir=no +fi + +PYTHONMODDIR=$python_moddir + +AC_MSG_RESULT(header $python_incdir library $python_libdir modules $python_moddir) + +if test x$python_incdir = xno || test x$python_libdir = xno || test x$python_moddir = xno; then + LIBPYTHON=$kde_orig_LIBPYTHON + test "x$PYTHONLIB" = "x-Lno" && PYTHONLIB="" + test "x$PYTHONINC" = "x-Ino" && PYTHONINC="" + $2 +else + dnl Note: this test is very weak + kde_python_link_found=no + KDE_TRY_LINK_PYTHON(normal) + KDE_TRY_LINK_PYTHON(m, -lm) + KDE_TRY_LINK_PYTHON(pthread, $LIBPTHREAD) + KDE_TRY_LINK_PYTHON(tcl, -ltcl) + KDE_TRY_LINK_PYTHON(db2, -ldb2) + KDE_TRY_LINK_PYTHON(m_and_thread, [$LIBPTHREAD -lm]) + KDE_TRY_LINK_PYTHON(m_and_thread_and_util, [$LIBPTHREAD -lm -lutil]) + KDE_TRY_LINK_PYTHON(m_and_thread_and_db3, [$LIBPTHREAD -lm -ldb-3 -lutil]) + KDE_TRY_LINK_PYTHON(pthread_and_db3, [$LIBPTHREAD -ldb-3]) + KDE_TRY_LINK_PYTHON(m_and_thread_and_db, [$LIBPTHREAD -lm -ldb -ltermcap -lutil]) + KDE_TRY_LINK_PYTHON(pthread_and_dl, [$LIBPTHREAD $LIBDL -lutil -lreadline -lncurses -lm]) + KDE_TRY_LINK_PYTHON(pthread_and_panel_curses, [$LIBPTHREAD $LIBDL -lm -lpanel -lcurses]) + KDE_TRY_LINK_PYTHON(m_and_thread_and_db_special, [$LIBPTHREAD -lm -ldb -lutil], [], + [AC_MSG_WARN([it seems, Python depends on another library. + Please set LIBPYTHON to '-lpython$version -lotherlib' before calling configure to fix this + and contact the authors to let them know about this problem]) + ]) + + LIBPYTHON="$LIBPYTHON $LIBDL $LIBSOCKET" + AC_SUBST(PYTHONINC) + AC_SUBST(PYTHONLIB) + AC_SUBST(LIBPYTHON) + AC_SUBST(PYTHONMODDIR) + AC_DEFINE(HAVE_PYTHON, 1, [Define if you have the development files for python]) +fi + +]) + + +AC_DEFUN([KDE_CHECK_PYTHON], +[ + KDE_CHECK_PYTHON_INTERN("2.5", + [KDE_CHECK_PYTHON_INTERN("2.4", + [KDE_CHECK_PYTHON_INTERN("2.3", + [KDE_CHECK_PYTHON_INTERN("2.2", + [KDE_CHECK_PYTHON_INTERN("2.1", + [KDE_CHECK_PYTHON_INTERN("2.0", + [KDE_CHECK_PYTHON_INTERN($1, $2) ]) + ]) + ]) + ]) + ]) + ]) +]) + +AC_DEFUN([KDE_CHECK_STL], +[ + AC_LANG_SAVE + AC_LANG_CPLUSPLUS + ac_save_CXXFLAGS="$CXXFLAGS" + CXXFLAGS="`echo $CXXFLAGS | sed s/-fno-exceptions//`" + + AC_MSG_CHECKING([if C++ programs can be compiled]) + AC_CACHE_VAL(kde_cv_stl_works, + [ + AC_TRY_COMPILE([ +#include +using namespace std; +],[ + string astring="Hallo Welt."; + astring.erase(0, 6); // now astring is "Welt" + return 0; +], kde_cv_stl_works=yes, + kde_cv_stl_works=no) +]) + + AC_MSG_RESULT($kde_cv_stl_works) + + if test "$kde_cv_stl_works" = "yes"; then + # back compatible + AC_DEFINE_UNQUOTED(HAVE_SGI_STL, 1, [Define if you have a STL implementation by SGI]) + else + AC_MSG_ERROR([Your Installation isn't able to compile simple C++ programs. +Check config.log for details - if you're using a Linux distribution you might miss +a package named similar to libstdc++-dev.]) + fi + + CXXFLAGS="$ac_save_CXXFLAGS" + AC_LANG_RESTORE +]) + +AC_DEFUN([AC_FIND_QIMGIO], + [AC_REQUIRE([AC_FIND_JPEG]) +AC_REQUIRE([KDE_CHECK_EXTRA_LIBS]) +AC_MSG_CHECKING([for qimgio]) +AC_CACHE_VAL(ac_cv_lib_qimgio, +[ +AC_LANG_SAVE +AC_LANG_CPLUSPLUS +ac_save_LIBS="$LIBS" +ac_save_CXXFLAGS="$CXXFLAGS" +LIBS="$all_libraries -lqimgio -lpng -lz $LIBJPEG $LIBQT" +CXXFLAGS="$CXXFLAGS -I$qt_incdir $all_includes" +AC_TRY_RUN(dnl +[ +#include +#include +int main() { + QString t = "hallo"; + t.fill('t'); + qInitImageIO(); +} +], + ac_cv_lib_qimgio=yes, + ac_cv_lib_qimgio=no, + ac_cv_lib_qimgio=no) +LIBS="$ac_save_LIBS" +CXXFLAGS="$ac_save_CXXFLAGS" +AC_LANG_RESTORE +])dnl +if eval "test \"`echo $ac_cv_lib_qimgio`\" = yes"; then + LIBQIMGIO="-lqimgio -lpng -lz $LIBJPEG" + AC_MSG_RESULT(yes) + AC_DEFINE_UNQUOTED(HAVE_QIMGIO, 1, [Define if you have the Qt extension qimgio available]) + AC_SUBST(LIBQIMGIO) +else + AC_MSG_RESULT(not found) +fi +]) + +AC_DEFUN([AM_DISABLE_LIBRARIES], +[ + AC_PROVIDE([AM_ENABLE_STATIC]) + AC_PROVIDE([AM_ENABLE_SHARED]) + enable_static=no + enable_shared=yes +]) + + +AC_DEFUN([AC_CHECK_UTMP_FILE], +[ + AC_MSG_CHECKING([for utmp file]) + + AC_CACHE_VAL(kde_cv_utmp_file, + [ + kde_cv_utmp_file=no + + for ac_file in \ + \ + /var/run/utmp \ + /var/adm/utmp \ + /etc/utmp \ + ; \ + do + if test -r "$ac_file"; then + kde_cv_utmp_file=$ac_file + break + fi + done + ]) + + if test "$kde_cv_utmp_file" != "no"; then + AC_DEFINE_UNQUOTED(UTMP, "$kde_cv_utmp_file", [Define the file for utmp entries]) + $1 + AC_MSG_RESULT($kde_cv_utmp_file) + else + $2 + AC_MSG_RESULT([non found]) + fi +]) + + +AC_DEFUN([KDE_CREATE_SUBDIRSLIST], +[ + +DO_NOT_COMPILE="$DO_NOT_COMPILE CVS debian bsd-port admin" +TOPSUBDIRS="" + +if test ! -s $srcdir/subdirs; then + dnl Note: Makefile.common creates subdirs, so this is just a fallback + files=`cd $srcdir && ls -1` + dirs=`for i in $files; do if test -d $i; then echo $i; fi; done` + for i in $dirs; do + echo $i >> $srcdir/subdirs + done +fi + +ac_topsubdirs= +if test -s $srcdir/inst-apps; then + ac_topsubdirs="`cat $srcdir/inst-apps`" +elif test -s $srcdir/subdirs; then + ac_topsubdirs="`cat $srcdir/subdirs`" +fi + +for i in $ac_topsubdirs; do + AC_MSG_CHECKING([if $i should be compiled]) + if test -d $srcdir/$i; then + install_it="yes" + for j in $DO_NOT_COMPILE; do + if test $i = $j; then + install_it="no" + fi + done + else + install_it="no" + fi + AC_MSG_RESULT($install_it) + vari=`echo $i | sed -e 's,[[-+.@]],_,g'` + if test $install_it = "yes"; then + TOPSUBDIRS="$TOPSUBDIRS $i" + eval "$vari""_SUBDIR_included=yes" + else + eval "$vari""_SUBDIR_included=no" + fi +done + +AC_SUBST(TOPSUBDIRS) +]) + +AC_DEFUN([KDE_CHECK_NAMESPACES], +[ +AC_MSG_CHECKING(whether C++ compiler supports namespaces) +AC_LANG_SAVE +AC_LANG_CPLUSPLUS +AC_TRY_COMPILE([ +], +[ +namespace Foo { + extern int i; + namespace Bar { + extern int i; + } +} + +int Foo::i = 0; +int Foo::Bar::i = 1; +],[ + AC_MSG_RESULT(yes) + AC_DEFINE(HAVE_NAMESPACES) +], [ +AC_MSG_RESULT(no) +]) +AC_LANG_RESTORE +]) + +dnl ------------------------------------------------------------------------ +dnl Check for S_ISSOCK macro. Doesn't exist on Unix SCO. faure@kde.org +dnl ------------------------------------------------------------------------ +dnl +AC_DEFUN([AC_CHECK_S_ISSOCK], +[ +AC_MSG_CHECKING(for S_ISSOCK) +AC_CACHE_VAL(ac_cv_have_s_issock, +[ +AC_TRY_LINK( +[ +#include +], +[ +struct stat buff; +int b = S_ISSOCK( buff.st_mode ); +], +ac_cv_have_s_issock=yes, +ac_cv_have_s_issock=no) +]) +AC_MSG_RESULT($ac_cv_have_s_issock) +if test "$ac_cv_have_s_issock" = "yes"; then + AC_DEFINE_UNQUOTED(HAVE_S_ISSOCK, 1, [Define if sys/stat.h declares S_ISSOCK.]) +fi + +AH_VERBATIM(_ISSOCK, +[ +#ifndef HAVE_S_ISSOCK +#define HAVE_S_ISSOCK +#define S_ISSOCK(mode) (1==0) +#endif +]) + +]) + +dnl ------------------------------------------------------------------------ +dnl Check for MAXPATHLEN macro, defines KDEMAXPATHLEN. faure@kde.org +dnl ------------------------------------------------------------------------ +dnl +AC_DEFUN([AC_CHECK_KDEMAXPATHLEN], +[ +AC_MSG_CHECKING(for MAXPATHLEN) +AC_CACHE_VAL(ac_cv_maxpathlen, +[ +cat > conftest.$ac_ext < +#endif +#include +#include +#ifndef MAXPATHLEN +#define MAXPATHLEN 1024 +#endif + +KDE_HELLO MAXPATHLEN + +EOF + +ac_try="$ac_cpp conftest.$ac_ext 2>/dev/null | grep '^KDE_HELLO' >conftest.out" + +if AC_TRY_EVAL(ac_try) && test -s conftest.out; then + ac_cv_maxpathlen=`sed 's#KDE_HELLO ##' conftest.out` +else + ac_cv_maxpathlen=1024 +fi + +rm conftest.* + +]) +AC_MSG_RESULT($ac_cv_maxpathlen) +AC_DEFINE_UNQUOTED(KDEMAXPATHLEN,$ac_cv_maxpathlen, [Define a safe value for MAXPATHLEN] ) +]) + +AC_DEFUN([KDE_CHECK_HEADER], +[ + kde_safe_cppflags=$CPPFLAGS + CPPFLAGS="$CPPFLAGS $all_includes" + AC_LANG_SAVE + AC_LANG_CPLUSPLUS + AC_CHECK_HEADER([$1], [$2], [$3], [$4]) + AC_LANG_RESTORE + CPPFLAGS=$kde_safe_cppflags +]) + +AC_DEFUN([KDE_CHECK_HEADERS], +[ + AH_CHECK_HEADERS([$1]) + AC_LANG_SAVE + kde_safe_cppflags=$CPPFLAGS + CPPFLAGS="$CPPFLAGS $all_includes" + AC_LANG_CPLUSPLUS + AC_CHECK_HEADERS([$1], [$2], [$3], [$4]) + CPPFLAGS=$kde_safe_cppflags + AC_LANG_RESTORE +]) + +AC_DEFUN([KDE_FAST_CONFIGURE], +[ + dnl makes configure fast (needs perl) + AC_ARG_ENABLE(fast-perl, AC_HELP_STRING([--disable-fast-perl],[disable fast Makefile generation (needs perl)]), + with_fast_perl=$enableval, with_fast_perl=yes) +]) + +AC_DEFUN([KDE_CONF_FILES], +[ + val= + if test -f $srcdir/configure.files ; then + val=`sed -e 's%^%\$(top_srcdir)/%' $srcdir/configure.files` + fi + CONF_FILES= + if test -n "$val" ; then + for i in $val ; do + CONF_FILES="$CONF_FILES $i" + done + fi + AC_SUBST(CONF_FILES) +])dnl + +dnl This sets the prefix, for arts and kdelibs +dnl Do NOT use in any other module. +dnl It only looks at --prefix, KDEDIR and falls back to /usr/local/kde +AC_DEFUN([KDE_SET_PREFIX_CORE], +[ + unset CDPATH + dnl make $KDEDIR the default for the installation + AC_PREFIX_DEFAULT(${KDEDIR:-/usr/local/kde}) + + if test "x$prefix" = "xNONE"; then + prefix=$ac_default_prefix + ac_configure_args="$ac_configure_args --prefix=$prefix" + fi + # And delete superfluous '/' to make compares easier + prefix=`echo "$prefix" | sed 's,//*,/,g' | sed -e 's,/$,,'` + exec_prefix=`echo "$exec_prefix" | sed 's,//*,/,g' | sed -e 's,/$,,'` + + kde_libs_prefix='$(prefix)' + kde_libs_htmldir='$(kde_htmldir)' + AC_SUBST(kde_libs_prefix) + AC_SUBST(kde_libs_htmldir) + KDE_FAST_CONFIGURE + KDE_CONF_FILES +]) + + +AC_DEFUN([KDE_SET_PREFIX], +[ + unset CDPATH + dnl We can't give real code to that macro, only a value. + dnl It only matters for --help, since we set the prefix in this function anyway. + AC_PREFIX_DEFAULT(${KDEDIR:-the kde prefix}) + + KDE_SET_DEFAULT_BINDIRS + if test "x$prefix" = "xNONE"; then + dnl no prefix given: look for kde-config in the PATH and deduce the prefix from it + KDE_FIND_PATH(kde-config, KDECONFIG, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(kde-config)], [], prepend) + else + dnl prefix given: look for kde-config, preferrably in prefix, otherwise in PATH + kde_save_PATH="$PATH" + PATH="$exec_prefix/bin:$prefix/bin:$PATH" + KDE_FIND_PATH(kde-config, KDECONFIG, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(kde-config)], [], prepend) + PATH="$kde_save_PATH" + fi + + kde_libs_prefix=`$KDECONFIG --prefix` + if test -z "$kde_libs_prefix" || test ! -x "$kde_libs_prefix"; then + AC_MSG_ERROR([$KDECONFIG --prefix outputed the non existant prefix '$kde_libs_prefix' for kdelibs. + This means it has been moved since you installed it. + This won't work. Please recompile kdelibs for the new prefix. + ]) + fi + kde_libs_htmldir=`$KDECONFIG --install html --expandvars` + + AC_MSG_CHECKING([where to install]) + if test "x$prefix" = "xNONE"; then + prefix=$kde_libs_prefix + AC_MSG_RESULT([$prefix (as returned by kde-config)]) + else + dnl --prefix was given. Compare prefixes and warn (in configure.in.bot.end) if different + given_prefix=$prefix + AC_MSG_RESULT([$prefix (as requested)]) + fi + + # And delete superfluous '/' to make compares easier + prefix=`echo "$prefix" | sed 's,//*,/,g' | sed -e 's,/$,,'` + exec_prefix=`echo "$exec_prefix" | sed 's,//*,/,g' | sed -e 's,/$,,'` + given_prefix=`echo "$given_prefix" | sed 's,//*,/,g' | sed -e 's,/$,,'` + + AC_SUBST(KDECONFIG) + AC_SUBST(kde_libs_prefix) + AC_SUBST(kde_libs_htmldir) + + KDE_FAST_CONFIGURE + KDE_CONF_FILES +]) + +pushdef([AC_PROG_INSTALL], +[ + dnl our own version, testing for a -p flag + popdef([AC_PROG_INSTALL]) + dnl as AC_PROG_INSTALL works as it works we first have + dnl to save if the user didn't specify INSTALL, as the + dnl autoconf one overwrites INSTALL and we have no chance to find + dnl out afterwards + test -n "$INSTALL" && kde_save_INSTALL_given=$INSTALL + test -n "$INSTALL_PROGRAM" && kde_save_INSTALL_PROGRAM_given=$INSTALL_PROGRAM + test -n "$INSTALL_SCRIPT" && kde_save_INSTALL_SCRIPT_given=$INSTALL_SCRIPT + AC_PROG_INSTALL + + if test -z "$kde_save_INSTALL_given" ; then + # OK, user hasn't given any INSTALL, autoconf found one for us + # now we test, if it supports the -p flag + AC_MSG_CHECKING(for -p flag to install) + rm -f confinst.$$.* > /dev/null 2>&1 + echo "Testtest" > confinst.$$.orig + ac_res=no + if ${INSTALL} -p confinst.$$.orig confinst.$$.new > /dev/null 2>&1 ; then + if test -f confinst.$$.new ; then + # OK, -p seems to do no harm to install + INSTALL="${INSTALL} -p" + ac_res=yes + fi + fi + rm -f confinst.$$.* + AC_MSG_RESULT($ac_res) + fi + dnl the following tries to resolve some signs and wonders coming up + dnl with different autoconf/automake versions + dnl e.g.: + dnl *automake 1.4 install-strip sets A_M_INSTALL_PROGRAM_FLAGS to -s + dnl and has INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(A_M_INSTALL_PROGRAM_FLAGS) + dnl it header-vars.am, so there the actual INSTALL_PROGRAM gets the -s + dnl *automake 1.4a (and above) use INSTALL_STRIP_FLAG and only has + dnl INSTALL_PROGRAM = @INSTALL_PROGRAM@ there, but changes the + dnl install-@DIR@PROGRAMS targets to explicitly use that flag + dnl *autoconf 2.13 is dumb, and thinks it can use INSTALL_PROGRAM as + dnl INSTALL_SCRIPT, which breaks with automake <= 1.4 + dnl *autoconf >2.13 (since 10.Apr 1999) has not that failure + dnl *sometimes KDE does not use the install-@DIR@PROGRAM targets from + dnl automake (due to broken Makefile.am or whatever) to install programs, + dnl and so does not see the -s flag in automake > 1.4 + dnl to clean up that mess we: + dnl +set INSTALL_PROGRAM to use INSTALL_STRIP_FLAG + dnl which cleans KDE's program with automake > 1.4; + dnl +set INSTALL_SCRIPT to only use INSTALL, to clean up autoconf's problems + dnl with automake<=1.4 + dnl note that dues to this sometimes two '-s' flags are used (if KDE + dnl properly uses install-@DIR@PROGRAMS, but I don't care + dnl + dnl And to all this comes, that I even can't write in comments variable + dnl names used by automake, because it is so stupid to think I wanted to + dnl _use_ them, therefor I have written A_M_... instead of AM_ + dnl hmm, I wanted to say something ... ahh yes: Arghhh. + + if test -z "$kde_save_INSTALL_PROGRAM_given" ; then + INSTALL_PROGRAM='${INSTALL} $(INSTALL_STRIP_FLAG)' + fi + if test -z "$kde_save_INSTALL_SCRIPT_given" ; then + INSTALL_SCRIPT='${INSTALL}' + fi +])dnl + +AC_DEFUN([KDE_LANG_CPLUSPLUS], +[AC_LANG_CPLUSPLUS +ac_link='rm -rf SunWS_cache; ${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&AC_FD_CC' +pushdef([AC_LANG_CPLUSPLUS], [popdef([AC_LANG_CPLUSPLUS]) KDE_LANG_CPLUSPLUS]) +]) + +pushdef([AC_LANG_CPLUSPLUS], +[popdef([AC_LANG_CPLUSPLUS]) +KDE_LANG_CPLUSPLUS +]) + +AC_DEFUN([KDE_CHECK_LONG_LONG], +[ +AC_MSG_CHECKING(for long long) +AC_CACHE_VAL(kde_cv_c_long_long, +[ + AC_LANG_SAVE + AC_LANG_CPLUSPLUS + AC_TRY_LINK([], [ + long long foo = 0; + foo = foo+1; + ], + kde_cv_c_long_long=yes, kde_cv_c_long_long=no) + AC_LANG_RESTORE +]) +AC_MSG_RESULT($kde_cv_c_long_long) +if test "$kde_cv_c_long_long" = yes; then + AC_DEFINE(HAVE_LONG_LONG, 1, [Define if you have long long as datatype]) +fi +]) + +AC_DEFUN([KDE_CHECK_LIB], +[ + kde_save_LDFLAGS="$LDFLAGS" + dnl AC_CHECK_LIB modifies LIBS, so save it here + kde_save_LIBS="$LIBS" + LDFLAGS="$LDFLAGS $all_libraries" + case $host_os in + aix*) LDFLAGS="-brtl $LDFLAGS" + test "$GCC" = yes && LDFLAGS="-Wl,$LDFLAGS" + ;; + esac + AC_CHECK_LIB($1, $2, $3, $4, $5) + LDFLAGS="$kde_save_LDFLAGS" + LIBS="$kde_save_LIBS" +]) + +AC_DEFUN([KDE_JAVA_PREFIX], +[ + dir=`dirname "$1"` + base=`basename "$1"` + list=`ls -1 $dir 2> /dev/null` + for entry in $list; do + if test -d $dir/$entry/bin; then + case $entry in + $base) + javadirs="$javadirs $dir/$entry/bin" + ;; + esac + elif test -d $dir/$entry/jre/bin; then + case $entry in + $base) + javadirs="$javadirs $dir/$entry/jre/bin" + ;; + esac + fi + done +]) + +dnl KDE_CHEC_JAVA_DIR(onlyjre) +AC_DEFUN([KDE_CHECK_JAVA_DIR], +[ + +AC_ARG_WITH(java, +AC_HELP_STRING([--with-java=javadir],[use java installed in javadir, --without-java disables]), +[ ac_java_dir=$withval +], ac_java_dir="" +) + +AC_MSG_CHECKING([for Java]) + +dnl at this point ac_java_dir is either a dir, 'no' to disable, or '' to say look in $PATH +if test "x$ac_java_dir" = "xno"; then + kde_java_bindir=no + kde_java_includedir=no + kde_java_libjvmdir=no + kde_java_libgcjdir=no + kde_java_libhpidir=no +else + if test "x$ac_java_dir" = "x"; then + + + dnl No option set -> collect list of candidate paths + if test -n "$JAVA_HOME"; then + KDE_JAVA_PREFIX($JAVA_HOME) + fi + KDE_JAVA_PREFIX(/usr/j2se) + KDE_JAVA_PREFIX(/usr/lib/j2se) + KDE_JAVA_PREFIX(/usr/j*dk*) + KDE_JAVA_PREFIX(/usr/lib/j*dk*) + KDE_JAVA_PREFIX(/opt/j*sdk*) + KDE_JAVA_PREFIX(/usr/lib/java*) + KDE_JAVA_PREFIX(/usr/java*) + KDE_JAVA_PREFIX(/usr/java/j*dk*) + KDE_JAVA_PREFIX(/usr/java/j*re*) + KDE_JAVA_PREFIX(/usr/lib/SunJava2*) + KDE_JAVA_PREFIX(/usr/lib/SunJava*) + KDE_JAVA_PREFIX(/usr/lib/IBMJava2*) + KDE_JAVA_PREFIX(/usr/lib/IBMJava*) + KDE_JAVA_PREFIX(/opt/java*) + + kde_cv_path="NONE" + kde_save_IFS=$IFS + IFS=':' + for dir in $PATH; do + if test -d "$dir"; then + javadirs="$javadirs $dir" + fi + done + IFS=$kde_save_IFS + jredirs= + + dnl Now javadirs contains a list of paths that exist, all ending with bin/ + for dir in $javadirs; do + dnl Check for the java executable + if test -x "$dir/java"; then + sane_path=$(cd $dir; /bin/pwd) + dnl And also check for a libjvm.so somewhere under there + dnl Since we have to go to the parent dir, /usr/bin is excluded, /usr is too big. + if test "$sane_path" != "/usr/bin"; then + libjvmdir=`find $dir/.. -name libjvm.so | sed 's,libjvm.so,,'|head -n 1` + if test ! -f $libjvmdir/libjvm.so; then continue; fi + jredirs="$jredirs $dir" + fi + fi + done + + dnl Now jredirs contains a reduced list, of paths where both java and ../**/libjvm.so was found + JAVAC= + JAVA= + kde_java_bindir=no + for dir in $jredirs; do + JAVA="$dir/java" + kde_java_bindir=$dir + if test -x "$dir/javac"; then + JAVAC="$dir/javac" + break + fi + done + + if test -n "$JAVAC"; then + dnl this substitution might not work - well, we test for jni.h below + kde_java_includedir=`echo $JAVAC | sed -e 's,bin/javac$,include/,'` + else + kde_java_includedir=no + fi + else + dnl config option set + kde_java_bindir=$ac_java_dir/bin + if test -x $ac_java_dir/bin/java && test ! -x $ac_java_dir/bin/javac; then + kde_java_includedir=no + else + kde_java_includedir=$ac_java_dir/include + fi + fi +fi + +dnl At this point kde_java_bindir and kde_java_includedir are either set or "no" +if test "x$kde_java_bindir" != "xno"; then + + dnl Look for libjvm.so + kde_java_libjvmdir=`find $kde_java_bindir/.. -name libjvm.so | sed 's,libjvm.so,,'|head -n 1` + dnl Look for libgcj.so + kde_java_libgcjdir=`find $kde_java_bindir/.. -name libgcj.so | sed 's,libgcj.so,,'|head -n 1` + dnl Look for libhpi.so and avoid green threads + kde_java_libhpidir=`find $kde_java_bindir/.. -name libhpi.so | grep -v green | sed 's,libhpi.so,,' | head -n 1` + + dnl Now check everything's fine under there + dnl the include dir is our flag for having the JDK + if test -d "$kde_java_includedir"; then + if test ! -x "$kde_java_bindir/javac"; then + AC_MSG_ERROR([javac not found under $kde_java_bindir - it seems you passed a wrong --with-java.]) + fi + if test ! -x "$kde_java_bindir/javah"; then + AC_MSG_ERROR([javah not found under $kde_java_bindir. javac was found though! Use --with-java or --without-java.]) + fi + if test ! -x "$kde_java_bindir/jar"; then + AC_MSG_ERROR([jar not found under $kde_java_bindir. javac was found though! Use --with-java or --without-java.]) + fi + if test ! -r "$kde_java_includedir/jni.h"; then + AC_MSG_ERROR([jni.h not found under $kde_java_includedir. Use --with-java or --without-java.]) + fi + + jni_includes="-I$kde_java_includedir" + dnl Strange thing, jni.h requires jni_md.h which is under genunix here.. + dnl and under linux here.. + + dnl not needed for gcj + + if test "x$kde_java_libgcjdir" = "x"; then + test -d "$kde_java_includedir/linux" && jni_includes="$jni_includes -I$kde_java_includedir/linux" + test -d "$kde_java_includedir/solaris" && jni_includes="$jni_includes -I$kde_java_includedir/solaris" + test -d "$kde_java_includedir/genunix" && jni_includes="$jni_includes -I$kde_java_includedir/genunix" + fi + + else + JAVAC= + jni_includes= + fi + + if test "x$kde_java_libgcjdir" = "x"; then + if test ! -r "$kde_java_libjvmdir/libjvm.so"; then + AC_MSG_ERROR([libjvm.so not found under $kde_java_libjvmdir. Use --without-java.]) + fi + else + if test ! -r "$kde_java_libgcjdir/libgcj.so"; then + AC_MSG_ERROR([libgcj.so not found under $kde_java_libgcjdir. Use --without-java.]) + fi + fi + + if test ! -x "$kde_java_bindir/java"; then + AC_MSG_ERROR([java not found under $kde_java_bindir. javac was found though! Use --with-java or --without-java.]) + fi + + dnl not needed for gcj compile + + if test "x$kde_java_libgcjdir" = "x"; then + if test ! -r "$kde_java_libhpidir/libhpi.so"; then + AC_MSG_ERROR([libhpi.so not found under $kde_java_libhpidir. Use --without-java.]) + fi + fi + + if test -n "$jni_includes"; then + dnl Check for JNI version + AC_LANG_SAVE + AC_LANG_CPLUSPLUS + ac_cxxflags_safe="$CXXFLAGS" + CXXFLAGS="$CXXFLAGS $all_includes $jni_includes" + + AC_TRY_COMPILE([ + #include + ], + [ + #ifndef JNI_VERSION_1_2 + Syntax Error + #endif + ],[ kde_jni_works=yes ], + [ kde_jni_works=no ]) + + if test $kde_jni_works = no; then + AC_MSG_ERROR([Incorrect version of $kde_java_includedir/jni.h. + You need to have Java Development Kit (JDK) version 1.2. + + Use --with-java to specify another location. + Use --without-java to configure without java support. + Or download a newer JDK and try again. + See e.g. http://java.sun.com/products/jdk/1.2 ]) + fi + + CXXFLAGS="$ac_cxxflags_safe" + AC_LANG_RESTORE + + dnl All tests ok, inform and subst the variables + + JAVAC=$kde_java_bindir/javac + JAVAH=$kde_java_bindir/javah + JAR=$kde_java_bindir/jar + AC_DEFINE_UNQUOTED(PATH_JAVA, "$kde_java_bindir/java", [Define where your java executable is]) + if test "x$kde_java_libgcjdir" = "x"; then + JVMLIBS="-L$kde_java_libjvmdir -ljvm -L$kde_java_libhpidir -lhpi" + else + JVMLIBS="-L$kde_java_libgcjdir -lgcj" + fi + AC_MSG_RESULT([java JDK in $kde_java_bindir]) + + else + AC_DEFINE_UNQUOTED(PATH_JAVA, "$kde_java_bindir/java", [Define where your java executable is]) + AC_MSG_RESULT([java JRE in $kde_java_bindir]) + fi +elif test -d "/Library/Java/Home"; then + kde_java_bindir="/Library/Java/Home/bin" + jni_includes="-I/Library/Java/Home/include" + + JAVAC=$kde_java_bindir/javac + JAVAH=$kde_java_bindir/javah + JAR=$kde_java_bindir/jar + JVMLIBS="-Wl,-framework,JavaVM" + + AC_DEFINE_UNQUOTED(PATH_JAVA, "$kde_java_bindir/java", [Define where your java executable is]) + AC_MSG_RESULT([Apple Java Framework]) +else + AC_MSG_RESULT([none found]) +fi + +AC_SUBST(JAVAC) +AC_SUBST(JAVAH) +AC_SUBST(JAR) +AC_SUBST(JVMLIBS) +AC_SUBST(jni_includes) + +# for backward compat +kde_cv_java_includedir=$kde_java_includedir +kde_cv_java_bindir=$kde_java_bindir +]) + +dnl this is a redefinition of autoconf 2.5x's AC_FOREACH. +dnl When the argument list becomes big, as in KDE for AC_OUTPUT in +dnl big packages, m4_foreach is dog-slow. So use our own version of +dnl it. (matz@kde.org) +m4_define([mm_foreach], +[m4_pushdef([$1])_mm_foreach($@)m4_popdef([$1])]) +m4_define([mm_car], [[$1]]) +m4_define([mm_car2], [[$@]]) +m4_define([_mm_foreach], +[m4_if(m4_quote($2), [], [], + [m4_define([$1], mm_car($2))$3[]_mm_foreach([$1], + mm_car2(m4_shift($2)), + [$3])])]) +m4_define([AC_FOREACH], +[mm_foreach([$1], m4_split(m4_normalize([$2])), [$3])]) + +AC_DEFUN([KDE_NEED_FLEX], +[ +kde_libs_safe=$LIBS +LIBS="$LIBS $USER_LDFLAGS" +AM_PROG_LEX +LIBS=$kde_libs_safe +if test -z "$LEXLIB"; then + AC_MSG_ERROR([You need to have flex installed.]) +fi +AC_SUBST(LEXLIB) +]) + +AC_DEFUN([AC_PATH_QTOPIA], +[ + dnl TODO: use AC_CACHE_VAL + + if test -z "$1"; then + qtopia_minver_maj=1 + qtopia_minver_min=5 + qtopia_minver_pat=0 + else + qtopia_minver_maj=`echo "$1" | sed -e "s/^\(.*\)\..*\..*$/\1/"` + qtopia_minver_min=`echo "$1" | sed -e "s/^.*\.\(.*\)\..*$/\1/"` + qtopia_minver_pat=`echo "$1" | sed -e "s/^.*\..*\.\(.*\)$/\1/"` + fi + + qtopia_minver="$qtopia_minver_maj$qtopia_minver_min$qtopia_minver_pat" + qtopia_minverstr="$qtopia_minver_maj.$qtopia_minver_min.$qtopia_minver_pat" + + AC_REQUIRE([AC_PATH_QT]) + + AC_MSG_CHECKING([for Qtopia]) + + LIB_QTOPIA="-lqpe" + AC_SUBST(LIB_QTOPIA) + + kde_qtopia_dirs="$QPEDIR /opt/Qtopia" + + ac_qtopia_incdir=NO + + AC_ARG_WITH(qtopia-dir, + AC_HELP_STRING([--with-qtopia-dir=DIR],[where the root of Qtopia is installed]), + [ ac_qtopia_incdir="$withval"/include] ) + + qtopia_incdirs="" + for dir in $kde_qtopia_dirs; do + qtopia_incdirs="$qtopia_incdirs $dir/include" + done + + if test ! "$ac_qtopia_incdir" = "NO"; then + qtopia_incdirs="$ac_qtopia_incdir $qtopia_incdirs" + fi + + qtopia_incdir="" + AC_FIND_FILE(qpe/qpeapplication.h, $qtopia_incdirs, qtopia_incdir) + ac_qtopia_incdir="$qtopia_incdir" + + if test -z "$qtopia_incdir"; then + AC_MSG_ERROR([Cannot find Qtopia headers. Please check your installation.]) + fi + + qtopia_ver_maj=`cat $qtopia_incdir/qpe/version.h | sed -n -e 's,.*QPE_VERSION "\(.*\)\..*\..*".*,\1,p'`; + qtopia_ver_min=`cat $qtopia_incdir/qpe/version.h | sed -n -e 's,.*QPE_VERSION ".*\.\(.*\)\..*".*,\1,p'`; + qtopia_ver_pat=`cat $qtopia_incdir/qpe/version.h | sed -n -e 's,.*QPE_VERSION ".*\..*\.\(.*\)".*,\1,p'`; + + qtopia_ver="$qtopia_ver_maj$qtopia_ver_min$qtopia_ver_pat" + qtopia_verstr="$qtopia_ver_maj.$qtopia_ver_min.$qtopia_ver_pat" + if test "$qtopia_ver" -lt "$qtopia_minver"; then + AC_MSG_ERROR([found Qtopia version $qtopia_verstr but version $qtopia_minverstr +is required.]) + fi + + AC_LANG_SAVE + AC_LANG_CPLUSPLUS + + ac_cxxflags_safe="$CXXFLAGS" + ac_ldflags_safe="$LDFLAGS" + ac_libs_safe="$LIBS" + + CXXFLAGS="$CXXFLAGS -I$qtopia_incdir $all_includes" + LDFLAGS="$LDFLAGS $QT_LDFLAGS $all_libraries $USER_LDFLAGS $KDE_MT_LDFLAGS" + LIBS="$LIBS $LIB_QTOPIA $LIBQT" + + cat > conftest.$ac_ext < +#include + +int main( int argc, char **argv ) +{ + QPEApplication app( argc, argv ); + return 0; +} +EOF + + if AC_TRY_EVAL(ac_link) && test -s conftest; then + rm -f conftest* + else + rm -f conftest* + AC_MSG_ERROR([Cannot link small Qtopia Application. For more details look at +the end of config.log]) + fi + + CXXFLAGS="$ac_cxxflags_safe" + LDFLAGS="$ac_ldflags_safe" + LIBS="$ac_libs_safe" + + AC_LANG_RESTORE + + QTOPIA_INCLUDES="-I$qtopia_incdir" + AC_SUBST(QTOPIA_INCLUDES) + + AC_MSG_RESULT([found version $qtopia_verstr with headers at $qtopia_incdir]) +]) + + +AC_DEFUN([KDE_INIT_DOXYGEN], +[ +AC_MSG_CHECKING([for Qt docs]) +kde_qtdir= +if test "${with_qt_dir+set}" = set; then + kde_qtdir="$with_qt_dir" +fi + +AC_FIND_FILE(qsql.html, [ $kde_qtdir/doc/html $QTDIR/doc/html /usr/share/doc/packages/qt3/html /usr/lib/qt/doc /usr/lib/qt3/doc /usr/lib/qt3/doc/html /usr/doc/qt3/html /usr/doc/qt3 /usr/share/doc/qt3-doc /usr/share/qt3/doc/html /usr/X11R6/share/doc/qt/html ], QTDOCDIR) +AC_MSG_RESULT($QTDOCDIR) + +AC_SUBST(QTDOCDIR) + +KDE_FIND_PATH(dot, DOT, [], []) +if test -n "$DOT"; then + KDE_HAVE_DOT="YES" +else + KDE_HAVE_DOT="NO" +fi +AC_SUBST(KDE_HAVE_DOT) +KDE_FIND_PATH(doxygen, DOXYGEN, [], []) +AC_SUBST(DOXYGEN) + +DOXYGEN_PROJECT_NAME="$1" +DOXYGEN_PROJECT_NUMBER="$2" +AC_SUBST(DOXYGEN_PROJECT_NAME) +AC_SUBST(DOXYGEN_PROJECT_NUMBER) + +KDE_HAS_DOXYGEN=no +if test -n "$DOXYGEN" && test -x "$DOXYGEN" && test -f $QTDOCDIR/qsql.html; then + KDE_HAS_DOXYGEN=yes +fi +AC_SUBST(KDE_HAS_DOXYGEN) + +]) + + +AC_DEFUN([AC_FIND_BZIP2], +[ +AC_MSG_CHECKING([for bzDecompress in libbz2]) +AC_CACHE_VAL(ac_cv_lib_bzip2, +[ +AC_LANG_SAVE +AC_LANG_CPLUSPLUS +kde_save_LIBS="$LIBS" +LIBS="$all_libraries $USER_LDFLAGS -lbz2 $LIBSOCKET" +kde_save_CXXFLAGS="$CXXFLAGS" +CXXFLAGS="$CXXFLAGS $all_includes $USER_INCLUDES" +AC_TRY_LINK(dnl +[ +#define BZ_NO_STDIO +#include +], + [ bz_stream s; (void) bzDecompress(&s); ], + eval "ac_cv_lib_bzip2='-lbz2'", + eval "ac_cv_lib_bzip2=no") +LIBS="$kde_save_LIBS" +CXXFLAGS="$kde_save_CXXFLAGS" +AC_LANG_RESTORE +])dnl +AC_MSG_RESULT($ac_cv_lib_bzip2) + +if test ! "$ac_cv_lib_bzip2" = no; then + BZIP2DIR=bzip2 + + LIBBZ2="$ac_cv_lib_bzip2" + AC_SUBST(LIBBZ2) + +else + + cxx_shared_flag= + ld_shared_flag= + KDE_CHECK_COMPILER_FLAG(shared, [ + ld_shared_flag="-shared" + ]) + KDE_CHECK_COMPILER_FLAG(fPIC, [ + cxx_shared_flag="-fPIC" + ]) + + AC_MSG_CHECKING([for BZ2_bzDecompress in (shared) libbz2]) + AC_CACHE_VAL(ac_cv_lib_bzip2_prefix, + [ + AC_LANG_SAVE + AC_LANG_CPLUSPLUS + kde_save_LIBS="$LIBS" + LIBS="$all_libraries $USER_LDFLAGS $ld_shared_flag -lbz2 $LIBSOCKET" + kde_save_CXXFLAGS="$CXXFLAGS" + CXXFLAGS="$CFLAGS $cxx_shared_flag $all_includes $USER_INCLUDES" + + AC_TRY_LINK(dnl + [ + #define BZ_NO_STDIO + #include + ], + [ bz_stream s; (void) BZ2_bzDecompress(&s); ], + eval "ac_cv_lib_bzip2_prefix='-lbz2'", + eval "ac_cv_lib_bzip2_prefix=no") + LIBS="$kde_save_LIBS" + CXXFLAGS="$kde_save_CXXFLAGS" + AC_LANG_RESTORE + ])dnl + + AC_MSG_RESULT($ac_cv_lib_bzip2_prefix) + + if test ! "$ac_cv_lib_bzip2_prefix" = no; then + BZIP2DIR=bzip2 + + LIBBZ2="$ac_cv_lib_bzip2_prefix" + AC_SUBST(LIBBZ2) + + AC_DEFINE(NEED_BZ2_PREFIX, 1, [Define if the libbz2 functions need the BZ2_ prefix]) + dnl else, we just ignore this + fi + +fi +AM_CONDITIONAL(include_BZIP2, test -n "$BZIP2DIR") +]) + +dnl ------------------------------------------------------------------------ +dnl Try to find the SSL headers and libraries. +dnl $(SSL_LDFLAGS) will be -Lsslliblocation (if needed) +dnl and $(SSL_INCLUDES) will be -Isslhdrlocation (if needed) +dnl ------------------------------------------------------------------------ +dnl +AC_DEFUN([KDE_CHECK_SSL], +[ +LIBSSL="-lssl -lcrypto" +AC_REQUIRE([KDE_CHECK_LIB64]) + +ac_ssl_includes=NO ac_ssl_libraries=NO +ssl_libraries="" +ssl_includes="" +AC_ARG_WITH(ssl-dir, + AC_HELP_STRING([--with-ssl-dir=DIR],[where the root of OpenSSL is installed]), + [ ac_ssl_includes="$withval"/include + ac_ssl_libraries="$withval"/lib$kdelibsuff + ]) + +want_ssl=yes +AC_ARG_WITH(ssl, + AC_HELP_STRING([--without-ssl],[disable SSL checks]), + [want_ssl=$withval]) + +if test $want_ssl = yes; then + +AC_MSG_CHECKING(for OpenSSL) + +AC_CACHE_VAL(ac_cv_have_ssl, +[#try to guess OpenSSL locations + + ssl_incdirs="/usr/include /usr/local/include /usr/ssl/include /usr/local/ssl/include $prefix/include $kde_extra_includes" + ssl_incdirs="$ac_ssl_includes $ssl_incdirs" + AC_FIND_FILE(openssl/ssl.h, $ssl_incdirs, ssl_incdir) + ac_ssl_includes="$ssl_incdir" + + ssl_libdirs="/usr/lib$kdelibsuff /usr/local/lib$kdelibsuff /usr/ssl/lib$kdelibsuff /usr/local/ssl/lib$kdelibsuff $libdir $prefix/lib$kdelibsuff $exec_prefix/lib$kdelibsuff $kde_extra_libs" + if test ! "$ac_ssl_libraries" = "NO"; then + ssl_libdirs="$ac_ssl_libraries $ssl_libdirs" + fi + + test=NONE + ssl_libdir=NONE + for dir in $ssl_libdirs; do + try="ls -1 $dir/libssl*" + if test=`eval $try 2> /dev/null`; then ssl_libdir=$dir; break; else echo "tried $dir" >&AC_FD_CC ; fi + done + + ac_ssl_libraries="$ssl_libdir" + + ac_ldflags_safe="$LDFLAGS" + ac_libs_safe="$LIBS" + + LDFLAGS="$LDFLAGS -L$ssl_libdir $all_libraries" + LIBS="$LIBS $LIBSSL -lRSAglue -lrsaref" + + AC_TRY_LINK(,void RSAPrivateEncrypt(void);RSAPrivateEncrypt();, + ac_ssl_rsaref="yes" + , + ac_ssl_rsaref="no" + ) + + LDFLAGS="$ac_ldflags_safe" + LIBS="$ac_libs_safe" + + if test "$ac_ssl_includes" = NO || test "$ac_ssl_libraries" = NO; then + have_ssl=no + else + have_ssl=yes; + fi + + ]) + + eval "$ac_cv_have_ssl" + + AC_MSG_RESULT([libraries $ac_ssl_libraries, headers $ac_ssl_includes]) + + AC_MSG_CHECKING([whether OpenSSL uses rsaref]) + AC_MSG_RESULT($ac_ssl_rsaref) + + AC_MSG_CHECKING([for easter eggs]) + AC_MSG_RESULT([none found]) + +else + have_ssl=no +fi + +if test "$have_ssl" = yes; then + AC_MSG_CHECKING(for OpenSSL version) + dnl Check for SSL version + AC_CACHE_VAL(ac_cv_ssl_version, + [ + + cat >conftest.$ac_ext < +#include + int main() { + +#ifndef OPENSSL_VERSION_NUMBER + printf("ssl_version=\\"error\\"\n"); +#else + if (OPENSSL_VERSION_NUMBER < 0x00906000) + printf("ssl_version=\\"old\\"\n"); + else + printf("ssl_version=\\"ok\\"\n"); +#endif + return (0); + } +EOF + + ac_save_CPPFLAGS=$CPPFLAGS + if test "$ac_ssl_includes" != "/usr/include"; then + CPPFLAGS="$CPPFLAGS -I$ac_ssl_includes" + fi + + if AC_TRY_EVAL(ac_link); then + + if eval `./conftest 2>&5`; then + if test $ssl_version = error; then + AC_MSG_ERROR([$ssl_incdir/openssl/opensslv.h doesn't define OPENSSL_VERSION_NUMBER !]) + else + if test $ssl_version = old; then + AC_MSG_WARN([OpenSSL version too old. Upgrade to 0.9.6 at least, see http://www.openssl.org. SSL support disabled.]) + have_ssl=no + fi + fi + ac_cv_ssl_version="ssl_version=$ssl_version" + else + AC_MSG_ERROR([Your system couldn't run a small SSL test program. + Check config.log, and if you can't figure it out, send a mail to + David Faure , attaching your config.log]) + fi + + else + AC_MSG_ERROR([Your system couldn't link a small SSL test program. + Check config.log, and if you can't figure it out, send a mail to + David Faure , attaching your config.log]) + fi + CPPFLAGS=$ac_save_CPPFLAGS + + ]) + + eval "$ac_cv_ssl_version" + AC_MSG_RESULT($ssl_version) +fi + +if test "$have_ssl" != yes; then + LIBSSL=""; +else + AC_DEFINE(HAVE_SSL, 1, [If we are going to use OpenSSL]) + ac_cv_have_ssl="have_ssl=yes \ + ac_ssl_includes=$ac_ssl_includes ac_ssl_libraries=$ac_ssl_libraries ac_ssl_rsaref=$ac_ssl_rsaref" + + + ssl_libraries="$ac_ssl_libraries" + ssl_includes="$ac_ssl_includes" + + if test "$ac_ssl_rsaref" = yes; then + LIBSSL="-lssl -lcrypto -lRSAglue -lrsaref" + fi + + if test $ssl_version = "old"; then + AC_DEFINE(HAVE_OLD_SSL_API, 1, [Define if you have OpenSSL < 0.9.6]) + fi +fi + +SSL_INCLUDES= + +if test "$ssl_includes" = "/usr/include"; then + if test -f /usr/kerberos/include/krb5.h; then + SSL_INCLUDES="-I/usr/kerberos/include" + fi +elif test "$ssl_includes" != "/usr/local/include" && test -n "$ssl_includes"; then + SSL_INCLUDES="-I$ssl_includes" +fi + +if test "$ssl_libraries" = "/usr/lib" || test "$ssl_libraries" = "/usr/local/lib" || test -z "$ssl_libraries" || test "$ssl_libraries" = "NONE"; then + SSL_LDFLAGS="" +else + SSL_LDFLAGS="-L$ssl_libraries -R$ssl_libraries" +fi + +AC_SUBST(SSL_INCLUDES) +AC_SUBST(SSL_LDFLAGS) +AC_SUBST(LIBSSL) +]) + +AC_DEFUN([KDE_CHECK_STRLCPY], +[ + AC_REQUIRE([AC_CHECK_STRLCAT]) + AC_REQUIRE([AC_CHECK_STRLCPY]) + AC_CHECK_SIZEOF(size_t) + AC_CHECK_SIZEOF(unsigned long) + + AC_MSG_CHECKING([sizeof size_t == sizeof unsigned long]) + AC_TRY_COMPILE(,[ + #if SIZEOF_SIZE_T != SIZEOF_UNSIGNED_LONG + choke me + #endif + ],AC_MSG_RESULT([yes]),[ + AC_MSG_RESULT(no) + AC_MSG_ERROR([ + Apparently on your system our assumption sizeof size_t == sizeof unsigned long + does not apply. Please mail kde-devel@kde.org with a description of your system! + ]) + ]) +]) + +AC_DEFUN([KDE_CHECK_BINUTILS], +[ + AC_MSG_CHECKING([if ld supports unversioned version maps]) + + kde_save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS -Wl,--version-script=conftest.map" + echo "{ local: extern \"C++\" { foo }; };" > conftest.map + AC_TRY_LINK([int foo;], +[ +#ifdef __INTEL_COMPILER +icc apparently does not support libtools version-info and version-script +at the same time. Dunno where the bug is, but until somebody figured out, +better disable the optional version scripts. +#endif + + foo = 42; +], kde_supports_versionmaps=yes, kde_supports_versionmaps=no) + LDFLAGS="$kde_save_LDFLAGS" + rm -f conftest.map + AM_CONDITIONAL(include_VERSION_SCRIPT, + [test "$kde_supports_versionmaps" = "yes" && test "$kde_use_debug_code" = "no"]) + + AC_MSG_RESULT($kde_supports_versionmaps) +]) + +AC_DEFUN([AM_PROG_OBJC],[ +AC_CHECK_PROGS(OBJC, gcc, gcc) +test -z "$OBJC" && AC_MSG_ERROR([no acceptable objective-c gcc found in \$PATH]) +if test "x${OBJCFLAGS-unset}" = xunset; then + OBJCFLAGS="-g -O2" +fi +AC_SUBST(OBJCFLAGS) +_AM_IF_OPTION([no-dependencies],, [_AM_DEPENDENCIES(OBJC)]) +]) + +AC_DEFUN([KDE_CHECK_PERL], +[ + KDE_FIND_PATH(perl, PERL, [$bindir $exec_prefix/bin $prefix/bin], [ + AC_MSG_ERROR([No Perl found in your $PATH. +We need perl to generate some code.]) + ]) + AC_SUBST(PERL) +]) + +AC_DEFUN([KDE_CHECK_LARGEFILE], +[ +AC_SYS_LARGEFILE +if test "$ac_cv_sys_file_offset_bits" != no; then + CPPFLAGS="$CPPFLAGS -D_FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits" +fi + +if test "x$ac_cv_sys_large_files" != "xno"; then + CPPFLAGS="$CPPFLAGS -D_LARGE_FILES=1" +fi + +]) + +dnl A small extension to PKG_CHECK_MODULES (defined in pkg.m4.in) +dnl which allows to search for libs that get installed into the KDE prefix. +dnl +dnl Syntax: KDE_PKG_CHECK_MODULES(KSTUFF, libkexif >= 0.2 glib = 1.3.4, action-if, action-not) +dnl defines KSTUFF_LIBS, KSTUFF_CFLAGS, see pkg-config man page +dnl also defines KSTUFF_PKG_ERRORS on error +AC_DEFUN([KDE_PKG_CHECK_MODULES], [ + + PKG_CONFIG_PATH="$prefix/lib${kdelibsuff}/pkgconfig:$PKG_CONFIG_PATH" + if test "$prefix" != "$kde_libs_prefix"; then + PKG_CONFIG_PATH="$kde_libs_prefix/lib${kdelibsuff}/pkgconfig:$PKG_CONFIG_PATH" + fi + export PKG_CONFIG_PATH + PKG_CHECK_MODULES([$1],[$2],[$3],[$4]) +]) + + +dnl Check for PIE support in the compiler and linker +AC_DEFUN([KDE_CHECK_PIE_SUPPORT], +[ + AC_CACHE_CHECK([for PIE support], kde_cv_val_pie_support, + [ + AC_LANG_SAVE + AC_LANG_CPLUSPLUS + safe_CXXFLAGS=$CXXFLAGS + safe_LDFLAGS=$LDFLAGS + CXXFLAGS="$CXXFLAGS -fPIE" + LDFLAGS="$LDFLAGS -pie" + + AC_TRY_LINK([int foo;], [], [kde_cv_val_pie_support=yes], [kde_cv_val_pie_support=no]) + + CXXFLAGS=$safe_CXXFLAGS + LDFLAGS=$safe_LDFLAGS + AC_LANG_RESTORE + ]) + + AC_MSG_CHECKING(if enabling -pie/fPIE support) + + AC_ARG_ENABLE(pie, + AC_HELP_STRING([--enable-pie],[platform supports PIE linking [default=detect]]), + [kde_has_pie_support=$enableval], + [kde_has_pie_support=detect]) + + if test "$kde_has_pie_support" = "detect"; then + kde_has_pie_support=$kde_cv_val_pie_support + fi + + AC_MSG_RESULT([$kde_has_pie_support]) + + KDE_USE_FPIE="" + KDE_USE_PIE="" + + AC_SUBST([KDE_USE_FPIE]) + AC_SUBST([KDE_USE_PIE]) + + if test "$kde_has_pie_support" = "yes"; then + KDE_USE_FPIE="-fPIE" + KDE_USE_PIE="-pie" + fi +]) +# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- +## Copyright 1996, 1997, 1998, 1999, 2000, 2001 +## Free Software Foundation, Inc. +## Originally by Gordon Matzigkeit , 1996 +## +## This program is free software; you can redistribute it and/or modify +## it under the terms of the GNU General Public License as published by +## the Free Software Foundation; either version 2 of the License, or +## (at your option) any later version. +## +## This program is distributed in the hope that it will be useful, but +## WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +## General Public License for more details. +## +## You should have received a copy of the GNU General Public License +## along with this program; if not, write to the Free Software +## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +## +## As a special exception to the GNU General Public License, if you +## distribute this file as part of a program that contains a +## configuration script generated by Autoconf, you may include it under +## the same distribution terms that you use for the rest of that program. + +# serial 47 AC_PROG_LIBTOOL + + +# AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED) +# ----------------------------------------------------------- +# If this macro is not defined by Autoconf, define it here. +m4_ifdef([AC_PROVIDE_IFELSE], + [], + [m4_define([AC_PROVIDE_IFELSE], + [m4_ifdef([AC_PROVIDE_$1], + [$2], [$3])])]) + + +# AC_PROG_LIBTOOL +# --------------- +AC_DEFUN([AC_PROG_LIBTOOL], +[AC_REQUIRE([_AC_PROG_LIBTOOL])dnl +dnl If AC_PROG_CXX has already been expanded, run AC_LIBTOOL_CXX +dnl immediately, otherwise, hook it in at the end of AC_PROG_CXX. + AC_PROVIDE_IFELSE([AC_PROG_CXX], + [AC_LIBTOOL_CXX], + [define([AC_PROG_CXX], defn([AC_PROG_CXX])[AC_LIBTOOL_CXX + ])]) +dnl And a similar setup for Fortran 77 support + AC_PROVIDE_IFELSE([AC_PROG_F77], + [AC_LIBTOOL_F77], + [define([AC_PROG_F77], defn([AC_PROG_F77])[AC_LIBTOOL_F77 +])]) + +dnl Quote A][M_PROG_GCJ so that aclocal doesn't bring it in needlessly. +dnl If either AC_PROG_GCJ or A][M_PROG_GCJ have already been expanded, run +dnl AC_LIBTOOL_GCJ immediately, otherwise, hook it in at the end of both. + AC_PROVIDE_IFELSE([AC_PROG_GCJ], + [AC_LIBTOOL_GCJ], + [AC_PROVIDE_IFELSE([A][M_PROG_GCJ], + [AC_LIBTOOL_GCJ], + [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ], + [AC_LIBTOOL_GCJ], + [ifdef([AC_PROG_GCJ], + [define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[AC_LIBTOOL_GCJ])]) + ifdef([A][M_PROG_GCJ], + [define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[AC_LIBTOOL_GCJ])]) + ifdef([LT_AC_PROG_GCJ], + [define([LT_AC_PROG_GCJ], + defn([LT_AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])])]) +])])# AC_PROG_LIBTOOL + + +# _AC_PROG_LIBTOOL +# ---------------- +AC_DEFUN([_AC_PROG_LIBTOOL], +[AC_REQUIRE([AC_LIBTOOL_SETUP])dnl +AC_BEFORE([$0],[AC_LIBTOOL_CXX])dnl +AC_BEFORE([$0],[AC_LIBTOOL_F77])dnl +AC_BEFORE([$0],[AC_LIBTOOL_GCJ])dnl + +# This can be used to rebuild libtool when needed +LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh" + +# Always use our own libtool. +LIBTOOL='$(SHELL) $(top_builddir)/libtool --silent' +AC_SUBST(LIBTOOL)dnl + +# Prevent multiple expansion +define([AC_PROG_LIBTOOL], []) +])# _AC_PROG_LIBTOOL + + +# AC_LIBTOOL_SETUP +# ---------------- +AC_DEFUN([AC_LIBTOOL_SETUP], +[AC_PREREQ(2.50)dnl +AC_REQUIRE([AC_ENABLE_SHARED])dnl +AC_REQUIRE([AC_ENABLE_STATIC])dnl +AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl +AC_REQUIRE([AC_CANONICAL_HOST])dnl +AC_REQUIRE([AC_CANONICAL_BUILD])dnl +AC_REQUIRE([AC_PROG_CC])dnl +AC_REQUIRE([AC_PROG_LD])dnl +AC_REQUIRE([AC_PROG_LD_RELOAD_FLAG])dnl +AC_REQUIRE([AC_PROG_NM])dnl + +AC_REQUIRE([AC_PROG_LN_S])dnl +AC_REQUIRE([AC_DEPLIBS_CHECK_METHOD])dnl +# Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers! +AC_REQUIRE([AC_OBJEXT])dnl +AC_REQUIRE([AC_EXEEXT])dnl +dnl + +AC_LIBTOOL_SYS_MAX_CMD_LEN +AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE +AC_LIBTOOL_OBJDIR + +AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl +_LT_AC_PROG_ECHO_BACKSLASH + +case $host_os in +aix3*) + # AIX sometimes has problems with the GCC collect2 program. For some + # reason, if we set the COLLECT_NAMES environment variable, the problems + # vanish in a puff of smoke. + if test "X${COLLECT_NAMES+set}" != Xset; then + COLLECT_NAMES= + export COLLECT_NAMES + fi + ;; +esac + +# Sed substitution that helps us do robust quoting. It backslashifies +# metacharacters that are still active within double-quoted strings. +Xsed='sed -e s/^X//' +[sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g'] + +# Same as above, but do not quote variable references. +[double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g'] + +# Sed substitution to delay expansion of an escaped shell variable in a +# double_quote_subst'ed string. +delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' + +# Sed substitution to avoid accidental globbing in evaled expressions +no_glob_subst='s/\*/\\\*/g' + +# Constants: +rm="rm -f" + +# Global variables: +default_ofile=libtool +can_build_shared=yes + +# All known linkers require a `.a' archive for static linking (except M$VC, +# which needs '.lib'). +libext=a +ltmain="$ac_aux_dir/ltmain.sh" +ofile="$default_ofile" +with_gnu_ld="$lt_cv_prog_gnu_ld" + +AC_CHECK_TOOL(AR, ar, false) +AC_CHECK_TOOL(RANLIB, ranlib, :) +AC_CHECK_TOOL(STRIP, strip, :) + +old_CC="$CC" +old_CFLAGS="$CFLAGS" + +# Set sane defaults for various variables +test -z "$AR" && AR=ar +test -z "$AR_FLAGS" && AR_FLAGS=cru +test -z "$AS" && AS=as +test -z "$CC" && CC=cc +test -z "$LTCC" && LTCC=$CC +test -z "$DLLTOOL" && DLLTOOL=dlltool +test -z "$LD" && LD=ld +test -z "$LN_S" && LN_S="ln -s" +test -z "$MAGIC_CMD" && MAGIC_CMD=file +test -z "$NM" && NM=nm +test -z "$SED" && SED=sed +test -z "$OBJDUMP" && OBJDUMP=objdump +test -z "$RANLIB" && RANLIB=: +test -z "$STRIP" && STRIP=: +test -z "$ac_objext" && ac_objext=o + +# Determine commands to create old-style static archives. +old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs' +old_postinstall_cmds='chmod 644 $oldlib' +old_postuninstall_cmds= + +if test -n "$RANLIB"; then + case $host_os in + openbsd*) + old_postinstall_cmds="\$RANLIB -t \$oldlib~$old_postinstall_cmds" + ;; + *) + old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds" + ;; + esac + old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" +fi + +# Only perform the check for file, if the check method requires it +case $deplibs_check_method in +file_magic*) + if test "$file_magic_cmd" = '$MAGIC_CMD'; then + AC_PATH_MAGIC + fi + ;; +esac + +AC_PROVIDE_IFELSE([AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no) +AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL], +enable_win32_dll=yes, enable_win32_dll=no) + +AC_ARG_ENABLE([libtool-lock], + [AC_HELP_STRING([--disable-libtool-lock], + [avoid locking (might break parallel builds)])]) +test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes + +AC_ARG_WITH([pic], + [AC_HELP_STRING([--with-pic], + [try to use only PIC/non-PIC objects @<:@default=use both@:>@])], + [pic_mode="$withval"], + [pic_mode=default]) +test -z "$pic_mode" && pic_mode=default + +# Use C for the default configuration in the libtool script +tagname= +AC_LIBTOOL_LANG_C_CONFIG +_LT_AC_TAGCONFIG +])# AC_LIBTOOL_SETUP + + +# _LT_AC_SYS_COMPILER +# ------------------- +AC_DEFUN([_LT_AC_SYS_COMPILER], +[AC_REQUIRE([AC_PROG_CC])dnl + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# Allow CC to be a program name with arguments. +compiler=$CC +])# _LT_AC_SYS_COMPILER + + +# _LT_AC_SYS_LIBPATH_AIX +# ---------------------- +# Links a minimal program and checks the executable +# for the system default hardcoded library path. In most cases, +# this is /usr/lib:/lib, but when the MPI compilers are used +# the location of the communication and MPI libs are included too. +# If we don't find anything, use the default library path according +# to the aix ld manual. +AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX], +[AC_LINK_IFELSE(AC_LANG_PROGRAM,[ +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'` +# Check for a 64-bit object if we didn't find anything. +if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'`; fi],[]) +if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi +])# _LT_AC_SYS_LIBPATH_AIX + + +# _LT_AC_SHELL_INIT(ARG) +# ---------------------- +AC_DEFUN([_LT_AC_SHELL_INIT], +[ifdef([AC_DIVERSION_NOTICE], + [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)], + [AC_DIVERT_PUSH(NOTICE)]) +$1 +AC_DIVERT_POP +])# _LT_AC_SHELL_INIT + + +# _LT_AC_PROG_ECHO_BACKSLASH +# -------------------------- +# Add some code to the start of the generated configure script which +# will find an echo command which doesn't interpret backslashes. +AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH], +[_LT_AC_SHELL_INIT([ +# Check that we are running under the correct shell. +SHELL=${CONFIG_SHELL-/bin/sh} + +case X$ECHO in +X*--fallback-echo) + # Remove one level of quotation (which was required for Make). + ECHO=`echo "$ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','` + ;; +esac + +echo=${ECHO-echo} +if test "X[$]1" = X--no-reexec; then + # Discard the --no-reexec flag, and continue. + shift +elif test "X[$]1" = X--fallback-echo; then + # Avoid inline document here, it may be left over + : +elif test "X`($echo '\t') 2>/dev/null`" = 'X\t' ; then + # Yippee, $echo works! + : +else + # Restart under the correct shell. + exec $SHELL "[$]0" --no-reexec ${1+"[$]@"} +fi + +if test "X[$]1" = X--fallback-echo; then + # used as fallback echo + shift + cat </dev/null && + echo_test_string="`eval $cmd`" && + (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null + then + break + fi + done +fi + +if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && + echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + : +else + # The Solaris, AIX, and Digital Unix default echo programs unquote + # backslashes. This makes it impossible to quote backslashes using + # echo "$something" | sed 's/\\/\\\\/g' + # + # So, first we look for a working echo in the user's PATH. + + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for dir in $PATH /usr/ucb; do + IFS="$lt_save_ifs" + if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && + test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && + echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + echo="$dir/echo" + break + fi + done + IFS="$lt_save_ifs" + + if test "X$echo" = Xecho; then + # We didn't find a better echo, so look for alternatives. + if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' && + echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + # This shell has a builtin print -r that does the trick. + echo='print -r' + elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) && + test "X$CONFIG_SHELL" != X/bin/ksh; then + # If we have ksh, try running configure again with it. + ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} + export ORIGINAL_CONFIG_SHELL + CONFIG_SHELL=/bin/ksh + export CONFIG_SHELL + exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"} + else + # Try using printf. + echo='printf %s\n' + if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && + echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + # Cool, printf works + : + elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && + test "X$echo_testing_string" = 'X\t' && + echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL + export CONFIG_SHELL + SHELL="$CONFIG_SHELL" + export SHELL + echo="$CONFIG_SHELL [$]0 --fallback-echo" + elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && + test "X$echo_testing_string" = 'X\t' && + echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + echo="$CONFIG_SHELL [$]0 --fallback-echo" + else + # maybe with a smaller string... + prev=: + + for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do + if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null + then + break + fi + prev="$cmd" + done + + if test "$prev" != 'sed 50q "[$]0"'; then + echo_test_string=`eval $prev` + export echo_test_string + exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"} + else + # Oops. We lost completely, so just stick with echo. + echo=echo + fi + fi + fi + fi +fi +fi + +# Copy echo and quote the copy suitably for passing to libtool from +# the Makefile, instead of quoting the original, which is used later. +ECHO=$echo +if test "X$ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then + ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo" +fi + +AC_SUBST(ECHO) +])])# _LT_AC_PROG_ECHO_BACKSLASH + + +# _LT_AC_LOCK +# ----------- +AC_DEFUN([_LT_AC_LOCK], +[AC_ARG_ENABLE([libtool-lock], + [AC_HELP_STRING([--disable-libtool-lock], + [avoid locking (might break parallel builds)])]) +test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes + +# Some flags need to be propagated to the compiler or linker for good +# libtool support. +case $host in +ia64-*-hpux*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + case `/usr/bin/file conftest.$ac_objext` in + *ELF-32*) + HPUX_IA64_MODE="32" + ;; + *ELF-64*) + HPUX_IA64_MODE="64" + ;; + esac + fi + rm -rf conftest* + ;; +*-*-irix6*) + # Find out which ABI we are using. + echo '[#]line __oline__ "configure"' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + if test "$lt_cv_prog_gnu_ld" = yes; then + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -melf32bsmip" + ;; + *N32*) + LD="${LD-ld} -melf32bmipn32" + ;; + *64-bit*) + LD="${LD-ld} -melf64bmip" + ;; + esac + else + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -32" + ;; + *N32*) + LD="${LD-ld} -n32" + ;; + *64-bit*) + LD="${LD-ld} -64" + ;; + esac + fi + fi + rm -rf conftest* + ;; + +x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + case "`/usr/bin/file conftest.o`" in + *32-bit*) + LINUX_64_MODE="32" + case $host in + x86_64-*linux*) + LD="${LD-ld} -m elf_i386" + ;; + ppc64-*linux*) + LD="${LD-ld} -m elf32ppclinux" + ;; + s390x-*linux*) + LD="${LD-ld} -m elf_s390" + ;; + sparc64-*linux*) + LD="${LD-ld} -m elf32_sparc" + ;; + esac + ;; + *64-bit*) + LINUX_64_MODE="64" + case $host in + x86_64-*linux*) + LD="${LD-ld} -m elf_x86_64" + ;; + ppc*-*linux*|powerpc*-*linux*) + LD="${LD-ld} -m elf64ppc" + ;; + s390*-*linux*) + LD="${LD-ld} -m elf64_s390" + ;; + sparc*-*linux*) + LD="${LD-ld} -m elf64_sparc" + ;; + esac + ;; + esac + fi + rm -rf conftest* + ;; + +*-*-sco3.2v5*) + # On SCO OpenServer 5, we need -belf to get full-featured binaries. + SAVE_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -belf" + AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, + [AC_LANG_PUSH(C) + AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) + AC_LANG_POP]) + if test x"$lt_cv_cc_needs_belf" != x"yes"; then + # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf + CFLAGS="$SAVE_CFLAGS" + fi + ;; +AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL], +[*-*-cygwin* | *-*-mingw* | *-*-pw32*) + AC_CHECK_TOOL(DLLTOOL, dlltool, false) + AC_CHECK_TOOL(AS, as, false) + AC_CHECK_TOOL(OBJDUMP, objdump, false) + ;; + ]) +esac + +need_locks="$enable_libtool_lock" + +])# _LT_AC_LOCK + + +# AC_LIBTOOL_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, +# [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE]) +# ---------------------------------------------------------------- +# Check whether the given compiler option works +AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], +[AC_REQUIRE([LT_AC_PROG_SED]) +AC_CACHE_CHECK([$1], [$2], + [$2=no + ifelse([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="$3" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ + -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&AS_MESSAGE_LOG_FD + echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + if test ! -s conftest.err; then + $2=yes + fi + fi + $rm conftest* +]) + +if test x"[$]$2" = xyes; then + ifelse([$5], , :, [$5]) +else + ifelse([$6], , :, [$6]) +fi +])# AC_LIBTOOL_COMPILER_OPTION + + +# AC_LIBTOOL_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, +# [ACTION-SUCCESS], [ACTION-FAILURE]) +# ------------------------------------------------------------ +# Check whether the given compiler option works +AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], +[AC_CACHE_CHECK([$1], [$2], + [$2=no + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS $3" + printf "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + # Append any errors to the config.log. + cat conftest.err 1>&AS_MESSAGE_LOG_FD + else + $2=yes + fi + fi + $rm conftest* + LDFLAGS="$save_LDFLAGS" +]) + +if test x"[$]$2" = xyes; then + ifelse([$4], , :, [$4]) +else + ifelse([$5], , :, [$5]) +fi +])# AC_LIBTOOL_LINKER_OPTION + + +# AC_LIBTOOL_SYS_MAX_CMD_LEN +# -------------------------- +AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], +[# find the maximum length of command line arguments +AC_MSG_CHECKING([the maximum length of command line arguments]) +AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl + i=0 + testring="ABCD" + + case $build_os in + msdosdjgpp*) + # On DJGPP, this test can blow up pretty badly due to problems in libc + # (any single argument exceeding 2000 bytes causes a buffer overrun + # during glob expansion). Even if it were fixed, the result of this + # check would be larger than it should be. + lt_cv_sys_max_cmd_len=12288; # 12K is about right + ;; + + gnu*) + # Under GNU Hurd, this test is not required because there is + # no limit to the length of command line arguments. + # Libtool will interpret -1 as no limit whatsoever + lt_cv_sys_max_cmd_len=-1; + ;; + + cygwin* | mingw*) + # On Win9x/ME, this test blows up -- it succeeds, but takes + # about 5 minutes as the teststring grows exponentially. + # Worse, since 9x/ME are not pre-emptively multitasking, + # you end up with a "frozen" computer, even though with patience + # the test eventually succeeds (with a max line length of 256k). + # Instead, let's just punt: use the minimum linelength reported by + # all of the supported platforms: 8192 (on NT/2K/XP). + lt_cv_sys_max_cmd_len=8192; + ;; + + *) + # If test is not a shell built-in, we'll probably end up computing a + # maximum length that is only half of the actual maximum length, but + # we can't tell. + while (test "X"`$CONFIG_SHELL [$]0 --fallback-echo "X$testring" 2>/dev/null` \ + = "XX$testring") >/dev/null 2>&1 && + new_result=`expr "X$testring" : ".*" 2>&1` && + lt_cv_sys_max_cmd_len=$new_result && + test $i != 17 # 1/2 MB should be enough + do + i=`expr $i + 1` + testring=$testring$testring + done + testring= + # Add a significant safety factor because C++ compilers can tack on massive + # amounts of additional arguments before passing them to the linker. + # It appears as though 1/2 is a usable value. + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` + ;; + esac +]) +if test -n $lt_cv_sys_max_cmd_len ; then + AC_MSG_RESULT($lt_cv_sys_max_cmd_len) +else + AC_MSG_RESULT(none) +fi +])# AC_LIBTOOL_SYS_MAX_CMD_LEN + + +# _LT_AC_CHECK_DLFCN +# -------------------- +AC_DEFUN([_LT_AC_CHECK_DLFCN], +[AC_CHECK_HEADERS(dlfcn.h)dnl +])# _LT_AC_CHECK_DLFCN + + +# _LT_AC_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE, +# ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING) +# ------------------------------------------------------------------ +AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF], +[AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl +if test "$cross_compiling" = yes; then : + [$4] +else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext < +#endif + +#include + +#ifdef RTLD_GLOBAL +# define LT_DLGLOBAL RTLD_GLOBAL +#else +# ifdef DL_GLOBAL +# define LT_DLGLOBAL DL_GLOBAL +# else +# define LT_DLGLOBAL 0 +# endif +#endif + +/* We may have to define LT_DLLAZY_OR_NOW in the command line if we + find out it does not work in some platform. */ +#ifndef LT_DLLAZY_OR_NOW +# ifdef RTLD_LAZY +# define LT_DLLAZY_OR_NOW RTLD_LAZY +# else +# ifdef DL_LAZY +# define LT_DLLAZY_OR_NOW DL_LAZY +# else +# ifdef RTLD_NOW +# define LT_DLLAZY_OR_NOW RTLD_NOW +# else +# ifdef DL_NOW +# define LT_DLLAZY_OR_NOW DL_NOW +# else +# define LT_DLLAZY_OR_NOW 0 +# endif +# endif +# endif +# endif +#endif + +#ifdef __cplusplus +extern "C" void exit (int); +#endif + +void fnord() { int i=42;} +int main () +{ + void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); + int status = $lt_dlunknown; + + if (self) + { + if (dlsym (self,"fnord")) status = $lt_dlno_uscore; + else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + /* dlclose (self); */ + } + + exit (status); +}] +EOF + if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then + (./conftest; exit; ) 2>/dev/null + lt_status=$? + case x$lt_status in + x$lt_dlno_uscore) $1 ;; + x$lt_dlneed_uscore) $2 ;; + x$lt_unknown|x*) $3 ;; + esac + else : + # compilation failed + $3 + fi +fi +rm -fr conftest* +])# _LT_AC_TRY_DLOPEN_SELF + + +# AC_LIBTOOL_DLOPEN_SELF +# ------------------- +AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], +[AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl +if test "x$enable_dlopen" != xyes; then + enable_dlopen=unknown + enable_dlopen_self=unknown + enable_dlopen_self_static=unknown +else + lt_cv_dlopen=no + lt_cv_dlopen_libs= + + case $host_os in + beos*) + lt_cv_dlopen="load_add_on" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + ;; + + mingw* | pw32*) + lt_cv_dlopen="LoadLibrary" + lt_cv_dlopen_libs= + ;; + + cygwin*) + lt_cv_dlopen="dlopen" + lt_cv_dlopen_libs= + ;; + + darwin*) + # if libdl is installed we need to link against it + AC_CHECK_LIB([dl], [dlopen], + [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[ + lt_cv_dlopen="dyld" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + ]) + ;; + + *) + AC_CHECK_FUNC([shl_load], + [lt_cv_dlopen="shl_load"], + [AC_CHECK_LIB([dld], [shl_load], + [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"], + [AC_CHECK_FUNC([dlopen], + [lt_cv_dlopen="dlopen"], + [AC_CHECK_LIB([dl], [dlopen], + [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"], + [AC_CHECK_LIB([svld], [dlopen], + [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"], + [AC_CHECK_LIB([dld], [dld_link], + [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"]) + ]) + ]) + ]) + ]) + ]) + ;; + esac + + if test "x$lt_cv_dlopen" != xno; then + enable_dlopen=yes + else + enable_dlopen=no + fi + + case $lt_cv_dlopen in + dlopen) + save_CPPFLAGS="$CPPFLAGS" + test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" + + save_LDFLAGS="$LDFLAGS" + eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" + + save_LIBS="$LIBS" + LIBS="$lt_cv_dlopen_libs $LIBS" + + AC_CACHE_CHECK([whether a program can dlopen itself], + lt_cv_dlopen_self, [dnl + _LT_AC_TRY_DLOPEN_SELF( + lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes, + lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross) + ]) + + if test "x$lt_cv_dlopen_self" = xyes; then + LDFLAGS="$LDFLAGS $link_static_flag" + AC_CACHE_CHECK([whether a statically linked program can dlopen itself], + lt_cv_dlopen_self_static, [dnl + _LT_AC_TRY_DLOPEN_SELF( + lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes, + lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross) + ]) + fi + + CPPFLAGS="$save_CPPFLAGS" + LDFLAGS="$save_LDFLAGS" + LIBS="$save_LIBS" + ;; + esac + + case $lt_cv_dlopen_self in + yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; + *) enable_dlopen_self=unknown ;; + esac + + case $lt_cv_dlopen_self_static in + yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; + *) enable_dlopen_self_static=unknown ;; + esac +fi +])# AC_LIBTOOL_DLOPEN_SELF + + +# AC_LIBTOOL_PROG_CC_C_O([TAGNAME]) +# --------------------------------- +# Check to see if options -c and -o are simultaneously supported by compiler +AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O], +[AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl +AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], + [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)], + [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no + $rm -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + + # According to Tom Tromey, Ian Lance Taylor reported there are C compilers + # that will create temporary files in the current directory regardless of + # the output directory. Thus, making CWD read-only will cause this test + # to fail, enabling locking or at least warning the user not to do parallel + # builds. + chmod -w . + + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ + -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&AS_MESSAGE_LOG_FD + echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + if test ! -s out/conftest.err; then + _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes + fi + fi + chmod u+w . + $rm conftest* out/* + rmdir out + cd .. + rmdir conftest + $rm conftest* +]) +])# AC_LIBTOOL_PROG_CC_C_O + + +# AC_LIBTOOL_SYS_HARD_LINK_LOCKS([TAGNAME]) +# ----------------------------------------- +# Check to see if we can do hard links to lock some files if needed +AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], +[AC_REQUIRE([_LT_AC_LOCK])dnl + +hard_links="nottested" +if test "$_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then + # do not overwrite the value of need_locks provided by the user + AC_MSG_CHECKING([if we can lock with hard links]) + hard_links=yes + $rm conftest* + ln conftest.a conftest.b 2>/dev/null && hard_links=no + touch conftest.a + ln conftest.a conftest.b 2>&5 || hard_links=no + ln conftest.a conftest.b 2>/dev/null && hard_links=no + AC_MSG_RESULT([$hard_links]) + if test "$hard_links" = no; then + AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe]) + need_locks=warn + fi +else + need_locks=no +fi +])# AC_LIBTOOL_SYS_HARD_LINK_LOCKS + + +# AC_LIBTOOL_OBJDIR +# ----------------- +AC_DEFUN([AC_LIBTOOL_OBJDIR], +[AC_CACHE_CHECK([for objdir], [lt_cv_objdir], +[rm -f .libs 2>/dev/null +mkdir .libs 2>/dev/null +if test -d .libs; then + lt_cv_objdir=.libs +else + # MS-DOS does not allow filenames that begin with a dot. + lt_cv_objdir=_libs +fi +rmdir .libs 2>/dev/null]) +objdir=$lt_cv_objdir +])# AC_LIBTOOL_OBJDIR + + +# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH([TAGNAME]) +# ---------------------------------------------- +# Check hardcoding attributes. +AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], +[AC_MSG_CHECKING([how to hardcode library paths into programs]) +_LT_AC_TAGVAR(hardcode_action, $1)= +if test -n "$_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)" || \ + test -n "$_LT_AC_TAGVAR(runpath_var $1)" || \ + test "X$_LT_AC_TAGVAR(hardcode_automatic, $1)"="Xyes" ; then + + # We can hardcode non-existant directories. + if test "$_LT_AC_TAGVAR(hardcode_direct, $1)" != no && + # If the only mechanism to avoid hardcoding is shlibpath_var, we + # have to relink, otherwise we might link with an installed library + # when we should be linking with a yet-to-be-installed one + ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)" != no && + test "$_LT_AC_TAGVAR(hardcode_minus_L, $1)" != no; then + # Linking always hardcodes the temporary library directory. + _LT_AC_TAGVAR(hardcode_action, $1)=relink + else + # We can link without hardcoding, and we can hardcode nonexisting dirs. + _LT_AC_TAGVAR(hardcode_action, $1)=immediate + fi +else + # We cannot hardcode anything, or else we can only hardcode existing + # directories. + _LT_AC_TAGVAR(hardcode_action, $1)=unsupported +fi +AC_MSG_RESULT([$_LT_AC_TAGVAR(hardcode_action, $1)]) + +if test "$_LT_AC_TAGVAR(hardcode_action, $1)" = relink; then + # Fast installation is not supported + enable_fast_install=no +elif test "$shlibpath_overrides_runpath" = yes || + test "$enable_shared" = no; then + # Fast installation is not necessary + enable_fast_install=needless +fi +])# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH + + +# AC_LIBTOOL_SYS_LIB_STRIP +# ------------------------ +AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP], +[striplib= +old_striplib= +AC_MSG_CHECKING([whether stripping libraries is possible]) +if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then + test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" + test -z "$striplib" && striplib="$STRIP --strip-unneeded" + AC_MSG_RESULT([yes]) +else +# FIXME - insert some real tests, host_os isn't really good enough + case $host_os in + darwin*) + if test -n "$STRIP" ; then + striplib="$STRIP -x" + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) +fi + ;; + *) + AC_MSG_RESULT([no]) + ;; + esac +fi +])# AC_LIBTOOL_SYS_LIB_STRIP + + +# AC_LIBTOOL_SYS_DYNAMIC_LINKER +# ----------------------------- +# PORTME Fill in your ld.so characteristics +AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER], +[AC_MSG_CHECKING([dynamic linker characteristics]) +library_names_spec= +libname_spec='lib$name' +soname_spec= +shrext=".so" +postinstall_cmds= +postuninstall_cmds= +finish_cmds= +finish_eval= +shlibpath_var= +shlibpath_overrides_runpath=unknown +version_type=none +dynamic_linker="$host_os ld.so" +sys_lib_dlsearch_path_spec="/lib /usr/lib" +sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" +need_lib_prefix=unknown +hardcode_into_libs=no + +# when you set need_version to no, make sure it does not cause -set_version +# flags to be left without arguments +need_version=unknown + +case $host_os in +aix3*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' + shlibpath_var=LIBPATH + + # AIX 3 has no versioning support, so we append a major version to the name. + soname_spec='${libname}${release}${shared_ext}$major' + ;; + +aix4* | aix5*) + version_type=linux + need_lib_prefix=no + need_version=no + hardcode_into_libs=yes + if test "$host_cpu" = ia64; then + # AIX 5 supports IA64 + library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + else + # With GCC up to 2.95.x, collect2 would create an import file + # for dependence libraries. The import file would start with + # the line `#! .'. This would cause the generated library to + # depend on `.', always an invalid library. This was fixed in + # development snapshots of GCC prior to 3.0. + case $host_os in + aix4 | aix4.[[01]] | aix4.[[01]].*) + if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' + echo ' yes ' + echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then + : + else + can_build_shared=no + fi + ;; + esac + # AIX (on Power*) has no versioning support, so currently we can not hardcode correct + # soname into executable. Probably we can add versioning support to + # collect2, so additional links can be useful in future. + if test "$aix_use_runtimelinking" = yes; then + # If using run time linking (on AIX 4.2 or later) use lib.so + # instead of lib.a to let people know that these are not + # typical AIX shared libraries. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + else + # We preserve .a as extension for shared libraries through AIX4.2 + # and later when we are not doing run time linking. + library_names_spec='${libname}${release}.a $libname.a' + soname_spec='${libname}${release}${shared_ext}$major' + fi + shlibpath_var=LIBPATH + fi + ;; + +amigaos*) + library_names_spec='$libname.ixlibrary $libname.a' + # Create ${libname}_ixlibrary.a entries in /sys/libs. + finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "(cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a)"; (cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a) || exit 1; done' + ;; + +beos*) + library_names_spec='${libname}${shared_ext}' + dynamic_linker="$host_os ld.so" + shlibpath_var=LIBRARY_PATH + ;; + +bsdi4*) + version_type=linux + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" + sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" + # the default ld.so.conf also contains /usr/contrib/lib and + # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow + # libtool to hard-code these into programs + ;; + +cygwin* | mingw* | pw32*) + version_type=windows + shrext=".dll" + need_version=no + need_lib_prefix=no + + case $GCC,$host_os in + yes,cygwin* | yes,mingw* | yes,pw32*) + library_names_spec='$libname.dll.a' + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $rm \$dlpath' + shlibpath_overrides_runpath=yes + + case $host_os in + cygwin*) + # Cygwin DLLs use 'cyg' prefix rather than 'lib' + soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' + sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" + ;; + mingw*) + # MinGW DLLs use traditional 'lib' prefix + soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' + sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if echo "$sys_lib_search_path_spec" | [grep ';[c-zC-Z]:/' >/dev/null]; then + # It is most probably a Windows format PATH printed by + # mingw gcc, but we are running on Cygwin. Gcc prints its search + # path with ; separators, and with drive letters. We can handle the + # drive letters (cygwin fileutils understands them), so leave them, + # especially as we might pass files found there to a mingw objdump, + # which wouldn't understand a cygwinified path. Ahh. + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi + ;; + pw32*) + # pw32 DLLs use 'pw' prefix rather than 'lib' + library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + ;; + esac + ;; + + *) + library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib' + ;; + esac + dynamic_linker='Win32 ld.exe' + # FIXME: first we should search . and the directory the executable is in + shlibpath_var=PATH + ;; + +darwin* | rhapsody*) + dynamic_linker="$host_os dyld" + version_type=darwin + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext' + soname_spec='${libname}${release}${major}$shared_ext' + shlibpath_overrides_runpath=yes + shlibpath_var=DYLD_LIBRARY_PATH + shrext='$(test .$module = .yes && echo .so || echo .dylib)' + # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. + if test "$GCC" = yes; then + sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` + else + sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' + fi + sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' + ;; + +dgux*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +freebsd1*) + dynamic_linker=no + ;; + +kfreebsd*-gnu*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='GNU ld.so' + ;; + +freebsd*) + objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout` + version_type=freebsd-$objformat + case $version_type in + freebsd-elf*) + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + need_version=no + need_lib_prefix=no + ;; + freebsd-*) + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' + need_version=yes + ;; + esac + shlibpath_var=LD_LIBRARY_PATH + case $host_os in + freebsd2*) + shlibpath_overrides_runpath=yes + ;; + freebsd3.[01]* | freebsdelf3.[01]*) + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + *) # from 3.2 on + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + esac + ;; + +gnu*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + hardcode_into_libs=yes + ;; + +hpux9* | hpux10* | hpux11*) + # Give a soname corresponding to the major version so that dld.sl refuses to + # link against other versions. + version_type=sunos + need_lib_prefix=no + need_version=no + case "$host_cpu" in + ia64*) + shrext='.so' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.so" + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + if test "X$HPUX_IA64_MODE" = X32; then + sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" + else + sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" + fi + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + hppa*64*) + shrext='.sl' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.sl" + shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + *) + shrext='.sl' + dynamic_linker="$host_os dld.sl" + shlibpath_var=SHLIB_PATH + shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + ;; + esac + # HP-UX runs *really* slowly unless shared libraries are mode 555. + postinstall_cmds='chmod 555 $lib' + ;; + +irix5* | irix6* | nonstopux*) + case $host_os in + nonstopux*) version_type=nonstopux ;; + *) + if test "$lt_cv_prog_gnu_ld" = yes; then + version_type=linux + else + version_type=irix + fi ;; + esac + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' + case $host_os in + irix5* | nonstopux*) + libsuff= shlibsuff= + ;; + *) + case $LD in # libtool.m4 will add one of these switches to LD + *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") + libsuff= shlibsuff= libmagic=32-bit;; + *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") + libsuff=32 shlibsuff=N32 libmagic=N32;; + *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") + libsuff=64 shlibsuff=64 libmagic=64-bit;; + *) libsuff= shlibsuff= libmagic=never-match;; + esac + ;; + esac + shlibpath_var=LD_LIBRARY${shlibsuff}_PATH + shlibpath_overrides_runpath=no + sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" + sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" + hardcode_into_libs=yes + ;; + +# No shared lib support for Linux oldld, aout, or coff. +linux*oldld* | linux*aout* | linux*coff*) + dynamic_linker=no + ;; + +# This must be Linux ELF. +linux*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' + libsuff= + if test "x$LINUX_64_MODE" = x64; then + # Some platforms are per default 64-bit, so there's no /lib64 + if test -d /lib64 -a ! -h /lib64; then + libsuff=64 + fi + fi + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff}" + sys_lib_search_path_spec="/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}" + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + hardcode_into_libs=yes + + # We used to test for /lib/ld.so.1 and disable shared libraries on + # powerpc, because MkLinux only supported shared libraries with the + # GNU dynamic linker. Since this was broken with cross compilers, + # most powerpc-linux boxes support dynamic linking these days and + # people can always --disable-shared, the test was removed, and we + # assume the GNU/Linux dynamic linker is in use. + dynamic_linker='GNU/Linux ld.so' + ;; + +netbsd*) + version_type=sunos + need_lib_prefix=no + need_version=no + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + dynamic_linker='NetBSD (a.out) ld.so' + else + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='NetBSD ld.elf_so' + fi + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + +newsos6) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +nto-qnx*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +openbsd*) + version_type=sunos + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + shlibpath_var=LD_LIBRARY_PATH + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + case $host_os in + openbsd2.[[89]] | openbsd2.[[89]].*) + shlibpath_overrides_runpath=no + ;; + *) + shlibpath_overrides_runpath=yes + ;; + esac + else + shlibpath_overrides_runpath=yes + fi + ;; + +os2*) + libname_spec='$name' + shrext=".dll" + need_lib_prefix=no + library_names_spec='$libname${shared_ext} $libname.a' + dynamic_linker='OS/2 ld.exe' + shlibpath_var=LIBPATH + ;; + +osf3* | osf4* | osf5*) + version_type=osf + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" + sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" + ;; + +sco3.2v5*) + version_type=osf + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + ;; + +solaris*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + # ldd complains unless libraries are executable + postinstall_cmds='chmod +x $lib' + ;; + +sunos4*) + version_type=sunos + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + if test "$with_gnu_ld" = yes; then + need_lib_prefix=no + fi + need_version=yes + ;; + +sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + case $host_vendor in + sni) + shlibpath_overrides_runpath=no + need_lib_prefix=no + export_dynamic_flag_spec='${wl}-Blargedynsym' + runpath_var=LD_RUN_PATH + ;; + siemens) + need_lib_prefix=no + ;; + motorola) + need_lib_prefix=no + need_version=no + shlibpath_overrides_runpath=no + sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' + ;; + esac + ;; + +sysv4*MP*) + if test -d /usr/nec ;then + version_type=linux + library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' + soname_spec='$libname${shared_ext}.$major' + shlibpath_var=LD_LIBRARY_PATH + fi + ;; + +uts4*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +*) + dynamic_linker=no + ;; +esac +AC_MSG_RESULT([$dynamic_linker]) +test "$dynamic_linker" = no && can_build_shared=no +])# AC_LIBTOOL_SYS_DYNAMIC_LINKER + + +# _LT_AC_TAGCONFIG +# ---------------- +AC_DEFUN([_LT_AC_TAGCONFIG], +[AC_ARG_WITH([tags], + [AC_HELP_STRING([--with-tags@<:@=TAGS@:>@], + [include additional configurations @<:@automatic@:>@])], + [tagnames="$withval"]) + +if test -f "$ltmain" && test -n "$tagnames"; then + if test ! -f "${ofile}"; then + AC_MSG_WARN([output file `$ofile' does not exist]) + fi + + if test -z "$LTCC"; then + eval "`$SHELL ${ofile} --config | grep '^LTCC='`" + if test -z "$LTCC"; then + AC_MSG_WARN([output file `$ofile' does not look like a libtool script]) + else + AC_MSG_WARN([using `LTCC=$LTCC', extracted from `$ofile']) + fi + fi + + # Extract list of available tagged configurations in $ofile. + # Note that this assumes the entire list is on one line. + available_tags=`grep "^available_tags=" "${ofile}" | $SED -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'` + + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for tagname in $tagnames; do + IFS="$lt_save_ifs" + # Check whether tagname contains only valid characters + case `$echo "X$tagname" | $Xsed -e 's:[[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]]::g'` in + "") ;; + *) AC_MSG_ERROR([invalid tag name: $tagname]) + ;; + esac + + if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null + then + AC_MSG_ERROR([tag name \"$tagname\" already exists]) + fi + + # Update the list of available tags. + if test -n "$tagname"; then + echo appending configuration tag \"$tagname\" to $ofile + + case $tagname in + CXX) + if test -n "$CXX" && test "X$CXX" != "Xno"; then + AC_LIBTOOL_LANG_CXX_CONFIG + else + tagname="" + fi + ;; + + F77) + if test -n "$F77" && test "X$F77" != "Xno"; then + AC_LIBTOOL_LANG_F77_CONFIG + else + tagname="" + fi + ;; + + GCJ) + if test -n "$GCJ" && test "X$GCJ" != "Xno"; then + AC_LIBTOOL_LANG_GCJ_CONFIG + else + tagname="" + fi + ;; + + RC) + AC_LIBTOOL_LANG_RC_CONFIG + ;; + + *) + AC_MSG_ERROR([Unsupported tag name: $tagname]) + ;; + esac + + # Append the new tag name to the list of available tags. + if test -n "$tagname" ; then + available_tags="$available_tags $tagname" + fi + fi + done + IFS="$lt_save_ifs" + + # Now substitute the updated list of available tags. + if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then + mv "${ofile}T" "$ofile" + chmod +x "$ofile" + else + rm -f "${ofile}T" + AC_MSG_ERROR([unable to update list of available tagged configurations.]) + fi +fi +])# _LT_AC_TAGCONFIG + + +# AC_LIBTOOL_DLOPEN +# ----------------- +# enable checks for dlopen support +AC_DEFUN([AC_LIBTOOL_DLOPEN], + [AC_BEFORE([$0],[AC_LIBTOOL_SETUP]) +])# AC_LIBTOOL_DLOPEN + + +# AC_LIBTOOL_WIN32_DLL +# -------------------- +# declare package support for building win32 dll's +AC_DEFUN([AC_LIBTOOL_WIN32_DLL], +[AC_BEFORE([$0], [AC_LIBTOOL_SETUP]) +])# AC_LIBTOOL_WIN32_DLL + + +# AC_ENABLE_SHARED([DEFAULT]) +# --------------------------- +# implement the --enable-shared flag +# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. +AC_DEFUN([AC_ENABLE_SHARED], +[define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl +AC_ARG_ENABLE([shared], + [AC_HELP_STRING([--enable-shared@<:@=PKGS@:>@], + [build shared libraries @<:@default=]AC_ENABLE_SHARED_DEFAULT[@:>@])], + [p=${PACKAGE-default} + case $enableval in + yes) enable_shared=yes ;; + no) enable_shared=no ;; + *) + enable_shared=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_shared=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac], + [enable_shared=]AC_ENABLE_SHARED_DEFAULT) +])# AC_ENABLE_SHARED + + +# AC_DISABLE_SHARED +# ----------------- +#- set the default shared flag to --disable-shared +AC_DEFUN([AC_DISABLE_SHARED], +[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl +AC_ENABLE_SHARED(no) +])# AC_DISABLE_SHARED + + +# AC_ENABLE_STATIC([DEFAULT]) +# --------------------------- +# implement the --enable-static flag +# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. +AC_DEFUN([AC_ENABLE_STATIC], +[define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl +AC_ARG_ENABLE([static], + [AC_HELP_STRING([--enable-static@<:@=PKGS@:>@], + [build static libraries @<:@default=]AC_ENABLE_STATIC_DEFAULT[@:>@])], + [p=${PACKAGE-default} + case $enableval in + yes) enable_static=yes ;; + no) enable_static=no ;; + *) + enable_static=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_static=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac], + [enable_static=]AC_ENABLE_STATIC_DEFAULT) +])# AC_ENABLE_STATIC + + +# AC_DISABLE_STATIC +# ----------------- +# set the default static flag to --disable-static +AC_DEFUN([AC_DISABLE_STATIC], +[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl +AC_ENABLE_STATIC(no) +])# AC_DISABLE_STATIC + + +# AC_ENABLE_FAST_INSTALL([DEFAULT]) +# --------------------------------- +# implement the --enable-fast-install flag +# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. +AC_DEFUN([AC_ENABLE_FAST_INSTALL], +[define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl +AC_ARG_ENABLE([fast-install], + [AC_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@], + [optimize for fast installation @<:@default=]AC_ENABLE_FAST_INSTALL_DEFAULT[@:>@])], + [p=${PACKAGE-default} + case $enableval in + yes) enable_fast_install=yes ;; + no) enable_fast_install=no ;; + *) + enable_fast_install=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_fast_install=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac], + [enable_fast_install=]AC_ENABLE_FAST_INSTALL_DEFAULT) +])# AC_ENABLE_FAST_INSTALL + + +# AC_DISABLE_FAST_INSTALL +# ----------------------- +# set the default to --disable-fast-install +AC_DEFUN([AC_DISABLE_FAST_INSTALL], +[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl +AC_ENABLE_FAST_INSTALL(no) +])# AC_DISABLE_FAST_INSTALL + + +# AC_LIBTOOL_PICMODE([MODE]) +# -------------------------- +# implement the --with-pic flag +# MODE is either `yes' or `no'. If omitted, it defaults to `both'. +AC_DEFUN([AC_LIBTOOL_PICMODE], +[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl +pic_mode=ifelse($#,1,$1,default) +])# AC_LIBTOOL_PICMODE + + +# AC_PROG_EGREP +# ------------- +# This is predefined starting with Autoconf 2.54, so this conditional +# definition can be removed once we require Autoconf 2.54 or later. +m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP], +[AC_CACHE_CHECK([for egrep], [ac_cv_prog_egrep], + [if echo a | (grep -E '(a|b)') >/dev/null 2>&1 + then ac_cv_prog_egrep='grep -E' + else ac_cv_prog_egrep='egrep' + fi]) + EGREP=$ac_cv_prog_egrep + AC_SUBST([EGREP]) +])]) + + +# AC_PATH_TOOL_PREFIX +# ------------------- +# find a file program which can recognise shared library +AC_DEFUN([AC_PATH_TOOL_PREFIX], +[AC_REQUIRE([AC_PROG_EGREP])dnl +AC_MSG_CHECKING([for $1]) +AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, +[case $MAGIC_CMD in +[[\\/*] | ?:[\\/]*]) + lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. + ;; +*) + lt_save_MAGIC_CMD="$MAGIC_CMD" + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR +dnl $ac_dummy forces splitting on constant user-supplied paths. +dnl POSIX.2 word splitting is done only on the output of word expansions, +dnl not every word. This closes a longstanding sh security hole. + ac_dummy="ifelse([$2], , $PATH, [$2])" + for ac_dir in $ac_dummy; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$1; then + lt_cv_path_MAGIC_CMD="$ac_dir/$1" + if test -n "$file_magic_test_file"; then + case $deplibs_check_method in + "file_magic "*) + file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`" + MAGIC_CMD="$lt_cv_path_MAGIC_CMD" + if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | + $EGREP "$file_magic_regex" > /dev/null; then + : + else + cat <&2 + +*** Warning: the command libtool uses to detect shared libraries, +*** $file_magic_cmd, produces output that libtool cannot recognize. +*** The result is that libtool may fail to recognize shared libraries +*** as such. This will affect the creation of libtool libraries that +*** depend on shared libraries, but programs linked with such libtool +*** libraries will work regardless of this problem. Nevertheless, you +*** may want to report the problem to your system manager and/or to +*** bug-libtool@gnu.org + +EOF + fi ;; + esac + fi + break + fi + done + IFS="$lt_save_ifs" + MAGIC_CMD="$lt_save_MAGIC_CMD" + ;; +esac]) +MAGIC_CMD="$lt_cv_path_MAGIC_CMD" +if test -n "$MAGIC_CMD"; then + AC_MSG_RESULT($MAGIC_CMD) +else + AC_MSG_RESULT(no) +fi +])# AC_PATH_TOOL_PREFIX + + +# AC_PATH_MAGIC +# ------------- +# find a file program which can recognise a shared library +AC_DEFUN([AC_PATH_MAGIC], +[AC_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH) +if test -z "$lt_cv_path_MAGIC_CMD"; then + if test -n "$ac_tool_prefix"; then + AC_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH) + else + MAGIC_CMD=: + fi +fi +])# AC_PATH_MAGIC + + +# AC_PROG_LD +# ---------- +# find the pathname to the GNU or non-GNU linker +AC_DEFUN([AC_PROG_LD], +[AC_ARG_WITH([gnu-ld], + [AC_HELP_STRING([--with-gnu-ld], + [assume the C compiler uses GNU ld @<:@default=no@:>@])], + [test "$withval" = no || with_gnu_ld=yes], + [with_gnu_ld=no]) +AC_REQUIRE([LT_AC_PROG_SED])dnl +AC_REQUIRE([AC_PROG_CC])dnl +AC_REQUIRE([AC_CANONICAL_HOST])dnl +AC_REQUIRE([AC_CANONICAL_BUILD])dnl +ac_prog=ld +if test "$GCC" = yes; then + # Check if gcc -print-prog-name=ld gives a path. + AC_MSG_CHECKING([for ld used by $CC]) + case $host in + *-*-mingw*) + # gcc leaves a trailing carriage return which upsets mingw + ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; + *) + ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; + esac + case $ac_prog in + # Accept absolute paths. + [[\\/]]* | ?:[[\\/]]*) + re_direlt='/[[^/]][[^/]]*/\.\./' + # Canonicalize the pathname of ld + ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'` + while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do + ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"` + done + test -z "$LD" && LD="$ac_prog" + ;; + "") + # If it fails, then pretend we aren't using GCC. + ac_prog=ld + ;; + *) + # If it is relative, then search for the first ld in PATH. + with_gnu_ld=unknown + ;; + esac +elif test "$with_gnu_ld" = yes; then + AC_MSG_CHECKING([for GNU ld]) +else + AC_MSG_CHECKING([for non-GNU ld]) +fi +AC_CACHE_VAL(lt_cv_path_LD, +[if test -z "$LD"; then + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then + lt_cv_path_LD="$ac_dir/$ac_prog" + # Check to see if the program is GNU ld. I'd rather use --version, + # but apparently some GNU ld's only accept -v. + # Break only if it was the GNU/non-GNU ld that we prefer. + case `"$lt_cv_path_LD" -v 2>&1 &1 /dev/null; then + case $host_cpu in + i*86 ) + # Not sure whether the presence of OpenBSD here was a mistake. + # Let's accept both of them until this is cleared up. + lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD)/i[[3-9]]86 (compact )?demand paged shared library' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` + ;; + esac + else + lt_cv_deplibs_check_method=pass_all + fi + ;; + +gnu*) + lt_cv_deplibs_check_method=pass_all + ;; + +hpux10.20* | hpux11*) + lt_cv_file_magic_cmd=/usr/bin/file + case "$host_cpu" in + ia64*) + lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64' + lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so + ;; + hppa*64*) + [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]'] + lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl + ;; + *) + lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]].[[0-9]]) shared library' + lt_cv_file_magic_test_file=/usr/lib/libc.sl + ;; + esac + ;; + +irix5* | irix6* | nonstopux*) + case $host_os in + irix5* | nonstopux*) + # this will be overridden with pass_all, but let us keep it just in case + lt_cv_deplibs_check_method="file_magic ELF 32-bit MSB dynamic lib MIPS - version 1" + ;; + *) + case $LD in + *-32|*"-32 ") libmagic=32-bit;; + *-n32|*"-n32 ") libmagic=N32;; + *-64|*"-64 ") libmagic=64-bit;; + *) libmagic=never-match;; + esac + # this will be overridden with pass_all, but let us keep it just in case + lt_cv_deplibs_check_method="file_magic ELF ${libmagic} MSB mips-[[1234]] dynamic lib MIPS - version 1" + ;; + esac + lt_cv_file_magic_test_file=`echo /lib${libsuff}/libc.so*` + lt_cv_deplibs_check_method=pass_all + ;; + +# This must be Linux ELF. +linux*) + case $host_cpu in + alpha* | hppa* | i*86 | ia64* | m68* | mips* | powerpc* | sparc* | s390* | sh* | x86_64* ) + lt_cv_deplibs_check_method=pass_all ;; + # the debian people say, arm and glibc 2.3.1 works for them with pass_all + arm* ) + lt_cv_deplibs_check_method=pass_all ;; + *) + # glibc up to 2.1.1 does not perform some relocations on ARM + lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' ;; + esac + lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so` + ;; + +netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' + else + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$' + fi + ;; + +newos6*) + lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=/usr/lib/libnls.so + ;; + +nto-qnx*) + lt_cv_deplibs_check_method=unknown + ;; + +openbsd*) + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB shared object' + else + lt_cv_deplibs_check_method='file_magic OpenBSD.* shared library' + fi + ;; + +osf3* | osf4* | osf5*) + # this will be overridden with pass_all, but let us keep it just in case + lt_cv_deplibs_check_method='file_magic COFF format alpha shared library' + lt_cv_file_magic_test_file=/shlib/libc.so + lt_cv_deplibs_check_method=pass_all + ;; + +sco3.2v5*) + lt_cv_deplibs_check_method=pass_all + ;; + +solaris*) + lt_cv_deplibs_check_method=pass_all + lt_cv_file_magic_test_file=/lib/libc.so + ;; + +sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) + case $host_vendor in + motorola) + lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]' + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` + ;; + ncr) + lt_cv_deplibs_check_method=pass_all + ;; + sequent) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' + ;; + sni) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib" + lt_cv_file_magic_test_file=/lib/libc.so + ;; + siemens) + lt_cv_deplibs_check_method=pass_all + ;; + esac + ;; + +sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[[78]]* | unixware7* | sysv4*uw2*) + lt_cv_deplibs_check_method=pass_all + ;; +esac +]) +file_magic_cmd=$lt_cv_file_magic_cmd +deplibs_check_method=$lt_cv_deplibs_check_method +test -z "$deplibs_check_method" && deplibs_check_method=unknown +])# AC_DEPLIBS_CHECK_METHOD + + +# AC_PROG_NM +# ---------- +# find the pathname to a BSD-compatible name lister +AC_DEFUN([AC_PROG_NM], +[AC_CACHE_CHECK([for BSD-compatible nm], lt_cv_path_NM, +[if test -n "$NM"; then + # Let the user override the test. + lt_cv_path_NM="$NM" +else + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + tmp_nm="$ac_dir/${ac_tool_prefix}nm" + if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then + # Check to see if the nm accepts a BSD-compat flag. + # Adding the `sed 1q' prevents false positives on HP-UX, which says: + # nm: unknown option "B" ignored + # Tru64's nm complains that /dev/null is an invalid object file + case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in + */dev/null* | *'Invalid file or object type'*) + lt_cv_path_NM="$tmp_nm -B" + break + ;; + *) + case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in + */dev/null*) + lt_cv_path_NM="$tmp_nm -p" + break + ;; + *) + lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but + continue # so that we can try to find one that supports BSD flags + ;; + esac + esac + fi + done + IFS="$lt_save_ifs" + test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm +fi]) +NM="$lt_cv_path_NM" +])# AC_PROG_NM + + +# AC_CHECK_LIBM +# ------------- +# check for math library +AC_DEFUN([AC_CHECK_LIBM], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +LIBM= +case $host in +*-*-beos* | *-*-cygwin* | *-*-pw32* | *-*-darwin*) + # These system don't have libm, or don't need it + ;; +*-ncr-sysv4.3*) + AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw") + AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm") + ;; +*) + AC_CHECK_LIB(m, cos, LIBM="-lm") + ;; +esac +])# AC_CHECK_LIBM + + +# AC_LIBLTDL_CONVENIENCE([DIRECTORY]) +# ----------------------------------- +# sets LIBLTDL to the link flags for the libltdl convenience library and +# LTDLINCL to the include flags for the libltdl header and adds +# --enable-ltdl-convenience to the configure arguments. Note that LIBLTDL +# and LTDLINCL are not AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called. If +# DIRECTORY is not provided, it is assumed to be `libltdl'. LIBLTDL will +# be prefixed with '${top_builddir}/' and LTDLINCL will be prefixed with +# '${top_srcdir}/' (note the single quotes!). If your package is not +# flat and you're not using automake, define top_builddir and +# top_srcdir appropriately in the Makefiles. +AC_DEFUN([AC_LIBLTDL_CONVENIENCE], +[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl + case $enable_ltdl_convenience in + no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;; + "") enable_ltdl_convenience=yes + ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;; + esac + LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la + LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl']) + # For backwards non-gettext consistent compatibility... + INCLTDL="$LTDLINCL" +])# AC_LIBLTDL_CONVENIENCE + + +# AC_LIBLTDL_INSTALLABLE([DIRECTORY]) +# ----------------------------------- +# sets LIBLTDL to the link flags for the libltdl installable library and +# LTDLINCL to the include flags for the libltdl header and adds +# --enable-ltdl-install to the configure arguments. Note that LIBLTDL +# and LTDLINCL are not AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called. If +# DIRECTORY is not provided and an installed libltdl is not found, it is +# assumed to be `libltdl'. LIBLTDL will be prefixed with '${top_builddir}/' +# and LTDLINCL will be prefixed with '${top_srcdir}/' (note the single +# quotes!). If your package is not flat and you're not using automake, +# define top_builddir and top_srcdir appropriately in the Makefiles. +# In the future, this macro may have to be called after AC_PROG_LIBTOOL. +AC_DEFUN([AC_LIBLTDL_INSTALLABLE], +[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl + AC_CHECK_LIB(ltdl, lt_dlinit, + [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no], + [if test x"$enable_ltdl_install" = xno; then + AC_MSG_WARN([libltdl not installed, but installation disabled]) + else + enable_ltdl_install=yes + fi + ]) + if test x"$enable_ltdl_install" = x"yes"; then + ac_configure_args="$ac_configure_args --enable-ltdl-install" + LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la + LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl']) + else + ac_configure_args="$ac_configure_args --enable-ltdl-install=no" + LIBLTDL="-lltdl" + LTDLINCL= + fi + # For backwards non-gettext consistent compatibility... + INCLTDL="$LTDLINCL" +])# AC_LIBLTDL_INSTALLABLE + + +# AC_LIBTOOL_CXX +# -------------- +# enable support for C++ libraries +AC_DEFUN([AC_LIBTOOL_CXX], +[AC_REQUIRE([_LT_AC_LANG_CXX]) +])# AC_LIBTOOL_CXX + + +# _LT_AC_LANG_CXX +# --------------- +AC_DEFUN([_LT_AC_LANG_CXX], +[AC_REQUIRE([AC_PROG_CXX]) +AC_REQUIRE([AC_PROG_CXXCPP]) +_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}CXX]) +])# _LT_AC_LANG_CXX + + +# AC_LIBTOOL_F77 +# -------------- +# enable support for Fortran 77 libraries +AC_DEFUN([AC_LIBTOOL_F77], +[AC_REQUIRE([_LT_AC_LANG_F77]) +])# AC_LIBTOOL_F77 + + +# _LT_AC_LANG_F77 +# --------------- +AC_DEFUN([_LT_AC_LANG_F77], +[AC_REQUIRE([AC_PROG_F77]) +_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}F77]) +])# _LT_AC_LANG_F77 + + +# AC_LIBTOOL_GCJ +# -------------- +# enable support for GCJ libraries +AC_DEFUN([AC_LIBTOOL_GCJ], +[AC_REQUIRE([_LT_AC_LANG_GCJ]) +])# AC_LIBTOOL_GCJ + + +# _LT_AC_LANG_GCJ +# --------------- +AC_DEFUN([_LT_AC_LANG_GCJ], +[AC_PROVIDE_IFELSE([AC_PROG_GCJ],[], + [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],[], + [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],[], + [ifdef([AC_PROG_GCJ],[AC_REQUIRE([AC_PROG_GCJ])], + [ifdef([A][M_PROG_GCJ],[AC_REQUIRE([A][M_PROG_GCJ])], + [AC_REQUIRE([A][C_PROG_GCJ_OR_A][M_PROG_GCJ])])])])])]) +_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}GCJ]) +])# _LT_AC_LANG_GCJ + + +# AC_LIBTOOL_RC +# -------------- +# enable support for Windows resource files +AC_DEFUN([AC_LIBTOOL_RC], +[AC_REQUIRE([LT_AC_PROG_RC]) +_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}RC]) +])# AC_LIBTOOL_RC + + +# AC_LIBTOOL_LANG_C_CONFIG +# ------------------------ +# Ensure that the configuration vars for the C compiler are +# suitably defined. Those variables are subsequently used by +# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'. +AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG], [_LT_AC_LANG_C_CONFIG]) +AC_DEFUN([_LT_AC_LANG_C_CONFIG], +[lt_save_CC="$CC" +AC_LANG_PUSH(C) + +# Source file extension for C test sources. +ac_ext=c + +# Object file extension for compiled C test sources. +objext=o +_LT_AC_TAGVAR(objext, $1)=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code="int some_variable = 0;\n" + +# Code to be used in simple link tests +lt_simple_link_test_code='int main(){return(0);}\n' + +_LT_AC_SYS_COMPILER + +# +# Check for any special shared library compilation flags. +# +_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)= +if test "$GCC" = no; then + case $host_os in + sco3.2v5*) + _LT_AC_TAGVAR(lt_prog_cc_shlib, $1)='-belf' + ;; + esac +fi +if test -n "$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)"; then + AC_MSG_WARN([`$CC' requires `$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)' to build shared libraries]) + if echo "$old_CC $old_CFLAGS " | grep "[[ ]]$]_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)[[[ ]]" >/dev/null; then : + else + AC_MSG_WARN([add `$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)' to the CC or CFLAGS env variable and reconfigure]) + _LT_AC_TAGVAR(lt_cv_prog_cc_can_build_shared, $1)=no + fi +fi + + +# +# Check to make sure the static flag actually works. +# +AC_LIBTOOL_LINKER_OPTION([if $compiler static flag $_LT_AC_TAGVAR(lt_prog_compiler_static, $1) works], + _LT_AC_TAGVAR(lt_prog_compiler_static_works, $1), + $_LT_AC_TAGVAR(lt_prog_compiler_static, $1), + [], + [_LT_AC_TAGVAR(lt_prog_compiler_static, $1)=]) + + +## CAVEAT EMPTOR: +## There is no encapsulation within the following macros, do not change +## the running order or otherwise move them around unless you know exactly +## what you are doing... +AC_LIBTOOL_PROG_COMPILER_NO_RTTI($1) +AC_LIBTOOL_PROG_COMPILER_PIC($1) +AC_LIBTOOL_PROG_CC_C_O($1) +AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1) +AC_LIBTOOL_PROG_LD_SHLIBS($1) +AC_LIBTOOL_SYS_DYNAMIC_LINKER($1) +AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1) +AC_LIBTOOL_SYS_LIB_STRIP +AC_LIBTOOL_DLOPEN_SELF($1) + +# Report which librarie types wil actually be built +AC_MSG_CHECKING([if libtool supports shared libraries]) +AC_MSG_RESULT([$can_build_shared]) + +AC_MSG_CHECKING([whether to build shared libraries]) +test "$can_build_shared" = "no" && enable_shared=no + +# On AIX, shared libraries and static libraries use the same namespace, and +# are all built from PIC. +case "$host_os" in +aix3*) + test "$enable_shared" = yes && enable_static=no + if test -n "$RANLIB"; then + archive_cmds="$archive_cmds~\$RANLIB \$lib" + postinstall_cmds='$RANLIB $lib' + fi + ;; + +aix4*) + if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then + test "$enable_shared" = yes && enable_static=no + fi + ;; + darwin* | rhapsody*) + if test "$GCC" = yes; then + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no + case "$host_os" in + rhapsody* | darwin1.[[012]]) + _LT_AC_TAGVAR(allow_undefined_flag, $1)='-Wl,-undefined -Wl,suppress' + ;; + *) # Darwin 1.3 on + if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then + _LT_AC_TAGVAR(allow_undefined_flag, $1)='-Wl,-flat_namespace -Wl,-undefined -Wl,suppress' + else + case ${MACOSX_DEPLOYMENT_TARGET} in + 10.[012]) + _LT_AC_TAGVAR(allow_undefined_flag, $1)='-Wl,-flat_namespace -Wl,-undefined -Wl,suppress' + ;; + 10.*) + _LT_AC_TAGVAR(allow_undefined_flag, $1)='-Wl,-undefined -Wl,dynamic_lookup' + ;; + esac + fi + ;; + esac + output_verbose_link_cmd='echo' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib $allow_undefined_flag -o $lib $compiler_flags $libobjs $deplibs -install_name $rpath/$soname $verstring' + _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $compiler_flags $libobjs $deplibs' + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $compiler_flags $libobjs $deplibs -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $compiler_flags $libobjs $deplibs~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + _LT_AC_TAGVAR(hardcode_direct, $1)=no + _LT_AC_TAGVAR(hardcode_automatic, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-all_load $convenience' + _LT_AC_TAGVAR(link_all_deplibs, $1)=yes + else + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; +esac +AC_MSG_RESULT([$enable_shared]) + +AC_MSG_CHECKING([whether to build static libraries]) +# Make sure either enable_shared or enable_static is yes. +test "$enable_shared" = yes || enable_static=yes +AC_MSG_RESULT([$enable_static]) + +AC_LIBTOOL_CONFIG($1) + +AC_LANG_POP +CC="$lt_save_CC" +])# AC_LIBTOOL_LANG_C_CONFIG + + +# AC_LIBTOOL_LANG_CXX_CONFIG +# -------------------------- +# Ensure that the configuration vars for the C compiler are +# suitably defined. Those variables are subsequently used by +# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'. +AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG], [_LT_AC_LANG_CXX_CONFIG(CXX)]) +AC_DEFUN([_LT_AC_LANG_CXX_CONFIG], +[AC_LANG_PUSH(C++) +AC_REQUIRE([AC_PROG_CXX]) +AC_REQUIRE([AC_PROG_CXXCPP]) + +_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no +_LT_AC_TAGVAR(allow_undefined_flag, $1)= +_LT_AC_TAGVAR(always_export_symbols, $1)=no +_LT_AC_TAGVAR(archive_expsym_cmds, $1)= +_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)= +_LT_AC_TAGVAR(hardcode_direct, $1)=no +_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= +_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= +_LT_AC_TAGVAR(hardcode_libdir_separator, $1)= +_LT_AC_TAGVAR(hardcode_minus_L, $1)=no +_LT_AC_TAGVAR(hardcode_automatic, $1)=no +_LT_AC_TAGVAR(module_cmds, $1)= +_LT_AC_TAGVAR(module_expsym_cmds, $1)= +_LT_AC_TAGVAR(link_all_deplibs, $1)=unknown +_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +_LT_AC_TAGVAR(no_undefined_flag, $1)= +_LT_AC_TAGVAR(whole_archive_flag_spec, $1)= +_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no + +# Dependencies to place before and after the object being linked: +_LT_AC_TAGVAR(predep_objects, $1)= +_LT_AC_TAGVAR(postdep_objects, $1)= +_LT_AC_TAGVAR(predeps, $1)= +_LT_AC_TAGVAR(postdeps, $1)= +_LT_AC_TAGVAR(compiler_lib_search_path, $1)= + +# Source file extension for C++ test sources. +ac_ext=cc + +# Object file extension for compiled C++ test sources. +objext=o +_LT_AC_TAGVAR(objext, $1)=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code="int some_variable = 0;\n" + +# Code to be used in simple link tests +lt_simple_link_test_code='int main(int, char *[]) { return(0); }\n' + +# ltmain only uses $CC for tagged configurations so make sure $CC is set. +_LT_AC_SYS_COMPILER + +# Allow CC to be a program name with arguments. +lt_save_CC=$CC +lt_save_LD=$LD +lt_save_GCC=$GCC +GCC=$GXX +lt_save_with_gnu_ld=$with_gnu_ld +lt_save_path_LD=$lt_cv_path_LD +if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then + lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx +else + unset lt_cv_prog_gnu_ld +fi +if test -n "${lt_cv_path_LDCXX+set}"; then + lt_cv_path_LD=$lt_cv_path_LDCXX +else + unset lt_cv_path_LD +fi +test -z "${LDCXX+set}" || LD=$LDCXX +CC=${CXX-"c++"} +compiler=$CC +_LT_AC_TAGVAR(compiler, $1)=$CC +cc_basename=`$echo X"$compiler" | $Xsed -e 's%^.*/%%'` + +# We don't want -fno-exception wen compiling C++ code, so set the +# no_builtin_flag separately +if test "$GXX" = yes; then + _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' +else + _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= +fi + +if test "$GXX" = yes; then + # Set up default GNU C++ configuration + + AC_PROG_LD + + # Check if GNU C++ uses GNU ld as the underlying linker, since the + # archiving commands below assume that GNU ld is being used. + if test "$with_gnu_ld" = yes; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects ${wl}-soname $wl$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared -nostdlib $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + + # If archive_cmds runs LD, not CC, wlarc should be empty + # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to + # investigate it a little bit more. (MM) + wlarc='${wl}' + + # ancient GNU ld didn't support --whole-archive et. al. + if eval "`$CC -print-prog-name=ld` --help 2>&1" | \ + grep 'no-whole-archive' > /dev/null; then + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + else + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= + fi + else + with_gnu_ld=no + wlarc= + + # A generic and very simple default shared library creation + # command for GNU C++ for the case where it uses the native + # linker, instead of GNU ld. If possible, this setting should + # overridden to take advantage of the native linker features on + # the platform it is being used on. + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects -o $lib' + fi + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' + +else + GXX=no + with_gnu_ld=no + wlarc= +fi + +# PORTME: fill in a description of your system's C++ link characteristics +AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) +_LT_AC_TAGVAR(ld_shlibs, $1)=yes +case $host_os in + aix3*) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + aix4* | aix5*) + if test "$host_cpu" = ia64; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + exp_sym_flag='-Bexport' + no_entry_flag="" + else + # KDE requires run time linking. Make it the default. + aix_use_runtimelinking=yes + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi + + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + + _LT_AC_TAGVAR(archive_cmds, $1)='' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' + _LT_AC_TAGVAR(link_all_deplibs, $1)=yes + + if test "$GXX" = yes; then + case $host_os in aix4.[012]|aix4.[012].*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`${CC} -print-prog-name=collect2` + if test -f "$collect2name" && \ + strings "$collect2name" | grep resolve_lib_name >/dev/null + then + # We have reworked collect2 + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + else + # We have old collect2 + _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported + # It fails to find uninstalled libraries when the uninstalled + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= + fi + esac + shared_flag='-shared' + else + # not using gcc + if test "$host_cpu" = ia64; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test "$aix_use_runtimelinking" = yes; then + shared_flag='-qmkshrobj ${wl}-G' + else + shared_flag='-qmkshrobj' + fi + fi + fi + + # Let the compiler handle the export list. + _LT_AC_TAGVAR(always_export_symbols, $1)=no + if test "$aix_use_runtimelinking" = yes; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok' + # Determine the default libpath from the value encoded in an empty executable. + _LT_AC_SYS_LIBPATH_AIX + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" + + _LT_AC_TAGVAR(archive_cmds, $1)="\$CC"' -o $output_objdir/$soname $compiler_flags $libobjs $deplibs `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '" $shared_flag" + _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $compiler_flags $libobjs $deplibs `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + else + if test "$host_cpu" = ia64; then + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' + _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs" + _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $compiler_flags $libobjs $deplibs ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an empty executable. + _LT_AC_SYS_LIBPATH_AIX + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' + _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' + # -bexpall does not export symbols beginning with underscore (_) + _LT_AC_TAGVAR(always_export_symbols, $1)=yes + # Exported symbols can be pulled into shared objects from archives + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=' ' + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes + # This is similar to how AIX traditionally builds it's shared libraries. + _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $compiler_flags $libobjs $deplibs ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; + chorus*) + case $cc_basename in + *) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + + cygwin* | mingw* | pw32*) + # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, + # as there is no search path for DLLs. + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(allow_undefined_flag, $1)=no + _LT_AC_TAGVAR(always_export_symbols, $1)=no + _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + + if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared -nostdlib $output_objdir/$soname.def $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' + else + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + darwin* | rhapsody*) + if test "$GXX" = yes; then + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no + case "$host_os" in + rhapsody* | darwin1.[[012]]) + _LT_AC_TAGVAR(allow_undefined_flag, $1)='-Wl,-undefined -Wl,suppress' + ;; + *) # Darwin 1.3 on + if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then + _LT_AC_TAGVAR(allow_undefined_flag, $1)='-Wl,-flat_namespace -Wl,-undefined -Wl,suppress' + else + case ${MACOSX_DEPLOYMENT_TARGET} in + 10.[012]) + _LT_AC_TAGVAR(allow_undefined_flag, $1)='-Wl,-flat_namespace -Wl,-undefined -Wl,suppress' + ;; + 10.*) + _LT_AC_TAGVAR(allow_undefined_flag, $1)='-Wl,-undefined -Wl,dynamic_lookup' + ;; + esac + fi + ;; + esac + lt_int_apple_cc_single_mod=no + output_verbose_link_cmd='echo' + if $CC -dumpspecs 2>&1 | grep 'single_module' >/dev/null ; then + lt_int_apple_cc_single_mod=yes + fi + if test "X$lt_int_apple_cc_single_mod" = Xyes ; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $compiler_flags $libobjs $deplibs -install_name $rpath/$soname $verstring' + else + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $compiler_flags $deplibs -install_name $rpath/$soname $verstring' + fi + _LT_AC_TAGVAR(module_cmds, $1)='$CC ${wl}-bind_at_load $allow_undefined_flag -o $lib -bundle $compiler_flags $libobjs $deplibs' + + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's + if test "X$lt_int_apple_cc_single_mod" = Xyes ; then + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $compiler_flags $libobjs $deplibs -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + else + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $compiler_flags $deplibs -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + fi + _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $compiler_flags $libobjs $deplibs~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + _LT_AC_TAGVAR(hardcode_direct, $1)=no + _LT_AC_TAGVAR(hardcode_automatic, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-all_load $convenience' + _LT_AC_TAGVAR(link_all_deplibs, $1)=yes + else + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + dgux*) + case $cc_basename in + ec++) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + ghcx) + # Green Hills C++ Compiler + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + freebsd[12]*) + # C++ shared libraries reported to be fairly broken before switch to ELF + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + freebsd-elf*) + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no + ;; + freebsd* | kfreebsd*-gnu) + # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF + # conventions + _LT_AC_TAGVAR(ld_shlibs, $1)=yes + ;; + gnu*) + ;; + hpux9*) + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, + # but as the default + # location of the library. + + case $cc_basename in + CC) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + aCC) + _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | egrep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + ;; + *) + if test "$GXX" = yes; then + _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + else + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + hpux10*|hpux11*) + if test $with_gnu_ld = no; then + case "$host_cpu" in + hppa*64*) + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + ;; + ia64*) + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + ;; + *) + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + ;; + esac + fi + case "$host_cpu" in + hppa*64*) + _LT_AC_TAGVAR(hardcode_direct, $1)=no + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + ia64*) + _LT_AC_TAGVAR(hardcode_direct, $1)=no + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, + # but as the default + # location of the library. + ;; + *) + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, + # but as the default + # location of the library. + ;; + esac + + case $cc_basename in + CC) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + aCC) + case "$host_cpu" in + hppa*64*|ia64*) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs' + ;; + *) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects' + ;; + esac + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + ;; + *) + if test "$GXX" = yes; then + if test $with_gnu_ld = no; then + case "$host_cpu" in + ia64*|hppa*64*) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs' + ;; + *) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects' + ;; + esac + fi + else + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + irix5* | irix6*) + case $cc_basename in + CC) + # SGI C++ + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib' + + # Archives containing C++ object files must be created using + # "CC -ar", where "CC" is the IRIX C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs' + ;; + *) + if test "$GXX" = yes; then + if test "$with_gnu_ld" = no; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib' + else + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib' + fi + fi + _LT_AC_TAGVAR(link_all_deplibs, $1)=yes + ;; + esac + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + ;; + linux*) + case $cc_basename in + KCC) + # Kuck and Associates, Inc. (KAI) C++ Compiler + + # KCC will only create a shared library if the output file + # ends with ".so" (or ".sl" for HP-UX), so rename the library + # to its proper name (with version) after linking. + _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects --soname $soname -o \$templib; mv \$templib $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | grep "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath,$libdir' + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + + # Archives containing C++ object files must be created using + # "CC -Bstatic", where "CC" is the KAI C++ compiler. + _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' + ;; + icpc) + # Intel C++ + with_gnu_ld=yes + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects ${wl}-soname $wl$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' + ;; + cxx) + # Compaq C++ + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects ${wl}-soname $wl$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' + + runpath_var=LD_RUN_PATH + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + ;; + esac + ;; + lynxos*) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + m88k*) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + mvs*) + case $cc_basename in + cxx) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' + wlarc= + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + fi + # Workaround some broken pre-1.5 toolchains + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' + ;; + osf3*) + case $cc_basename in + KCC) + # Kuck and Associates, Inc. (KAI) C++ Compiler + + # KCC will only create a shared library if the output file + # ends with ".so" (or ".sl" for HP-UX), so rename the library + # to its proper name (with version) after linking. + _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects --soname $soname -o \$templib; mv \$templib $lib' + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + + # Archives containing C++ object files must be created using + # "CC -Bstatic", where "CC" is the KAI C++ compiler. + _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' + + ;; + RCC) + # Rational C++ 2.4.1 + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + cxx) + _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${objdir}/so_locations -o $lib' + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + ;; + *) + if test "$GXX" = yes && test "$with_gnu_ld" = no; then + _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib' + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' + + else + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + osf4* | osf5*) + case $cc_basename in + KCC) + # Kuck and Associates, Inc. (KAI) C++ Compiler + + # KCC will only create a shared library if the output file + # ends with ".so" (or ".sl" for HP-UX), so rename the library + # to its proper name (with version) after linking. + _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects --soname $soname -o \$templib; mv \$templib $lib' + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + + # Archives containing C++ object files must be created using + # the KAI C++ compiler. + _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' + ;; + RCC) + # Rational C++ 2.4.1 + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + cxx) + _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ + echo "-hidden">> $lib.exp~ + $CC -shared$allow_undefined_flag $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects -msym -soname $soname -Wl,-input -Wl,$lib.exp `test -n "$verstring" && echo -set_version $verstring` -update_registry $objdir/so_locations -o $lib~ + $rm $lib.exp' + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + ;; + *) + if test "$GXX" = yes && test "$with_gnu_ld" = no; then + _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib' + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' + + else + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + psos*) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + sco*) + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no + case $cc_basename in + CC) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + sunos4*) + case $cc_basename in + CC) + # Sun C++ 4.x + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + lcc) + # Lucid + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + solaris*) + case $cc_basename in + CC) + # Sun C++ 4.2, 5.x and Centerline C++ + _LT_AC_TAGVAR(no_undefined_flag, $1)=' -zdefs' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -nolib -h$soname -o $lib $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $CC -G${allow_undefined_flag} -nolib ${wl}-M ${wl}$lib.exp -h$soname -o $lib $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects~$rm $lib.exp' + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + case $host_os in + solaris2.[0-5] | solaris2.[0-5].*) ;; + *) + # The C++ compiler is used as linker so we must use $wl + # flag to pass the commands to the underlying system + # linker. + # Supported since Solaris 2.6 (maybe 2.5.1?) + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' + ;; + esac + _LT_AC_TAGVAR(link_all_deplibs, $1)=yes + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep "\-[[LR]]"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + + # Archives containing C++ object files must be created using + # "CC -xar", where "CC" is the Sun C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' + ;; + gcx) + # Green Hills C++ Compiler + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects ${wl}-h $wl$soname -o $lib' + + # The C++ compiler must be used to create the archive. + _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs' + ;; + *) + # GNU C++ compiler with Solaris linker + if test "$GXX" = yes && test "$with_gnu_ld" = no; then + _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs' + if $CC --version | grep -v '^2\.7' > /dev/null; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects ${wl}-h $wl$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects~$rm $lib.exp' + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" + else + # g++ 2.7 appears to require `-G' NOT `-shared' on this + # platform. + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects ${wl}-h $wl$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects~$rm $lib.exp' + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd="$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" + fi + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir' + fi + ;; + esac + ;; + sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[[78]]* | unixware7*) + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no + ;; + tandem*) + case $cc_basename in + NCC) + # NonStop-UX NCC 3.20 + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + vxworks*) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; +esac +AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)]) +test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no + +_LT_AC_TAGVAR(GCC, $1)="$GXX" +_LT_AC_TAGVAR(LD, $1)="$LD" + +## CAVEAT EMPTOR: +## There is no encapsulation within the following macros, do not change +## the running order or otherwise move them around unless you know exactly +## what you are doing... +AC_LIBTOOL_POSTDEP_PREDEP($1) +AC_LIBTOOL_PROG_COMPILER_PIC($1) +AC_LIBTOOL_PROG_CC_C_O($1) +AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1) +AC_LIBTOOL_PROG_LD_SHLIBS($1) +AC_LIBTOOL_SYS_DYNAMIC_LINKER($1) +AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1) +AC_LIBTOOL_SYS_LIB_STRIP +AC_LIBTOOL_DLOPEN_SELF($1) + +AC_LIBTOOL_CONFIG($1) + +AC_LANG_POP +CC=$lt_save_CC +LDCXX=$LD +LD=$lt_save_LD +GCC=$lt_save_GCC +with_gnu_ldcxx=$with_gnu_ld +with_gnu_ld=$lt_save_with_gnu_ld +lt_cv_path_LDCXX=$lt_cv_path_LD +lt_cv_path_LD=$lt_save_path_LD +lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld +lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld +])# AC_LIBTOOL_LANG_CXX_CONFIG + +# AC_LIBTOOL_POSTDEP_PREDEP([TAGNAME]) +# ------------------------ +# Figure out "hidden" library dependencies from verbose +# compiler output when linking a shared library. +# Parse the compiler output and extract the necessary +# objects, libraries and library flags. +AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP],[ +dnl we can't use the lt_simple_compile_test_code here, +dnl because it contains code intended for an executable, +dnl not a library. It's possible we should let each +dnl tag define a new lt_????_link_test_code variable, +dnl but it's only used here... +ifelse([$1],[],[cat > conftest.$ac_ext < conftest.$ac_ext < conftest.$ac_ext < conftest.$ac_ext <> "$cfgfile" +ifelse([$1], [], +[#! $SHELL + +# `$echo "$cfgfile" | sed 's%^.*/%%'` - Provide generalized library-building support services. +# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP) +# NOTE: Changes made to this file will be lost: look at ltmain.sh. +# +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001 +# Free Software Foundation, Inc. +# +# This file is part of GNU Libtool: +# Originally by Gordon Matzigkeit , 1996 +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# A sed program that does not truncate output. +SED=$lt_SED + +# Sed that helps us avoid accidentally triggering echo(1) options like -n. +Xsed="$SED -e s/^X//" + +# The HP-UX ksh and POSIX shell print the target directory to stdout +# if CDPATH is set. +if test "X\${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi + +# The names of the tagged configurations supported by this script. +available_tags= + +# ### BEGIN LIBTOOL CONFIG], +[# ### BEGIN LIBTOOL TAG CONFIG: $tagname]) + +# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: + +# Shell to use when invoking shell scripts. +SHELL=$lt_SHELL + +# Whether or not to build shared libraries. +build_libtool_libs=$enable_shared + +# Whether or not to build static libraries. +build_old_libs=$enable_static + +# Whether or not to add -lc for building shared libraries. +build_libtool_need_lc=$_LT_AC_TAGVAR(archive_cmds_need_lc, $1) + +# Whether or not to disallow shared libs when runtime libs are static +allow_libtool_libs_with_static_runtimes=$_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1) + +# Whether or not to optimize for fast installation. +fast_install=$enable_fast_install + +# The host system. +host_alias=$host_alias +host=$host + +# An echo program that does not interpret backslashes. +echo=$lt_echo + +# The archiver. +AR=$lt_AR +AR_FLAGS=$lt_AR_FLAGS + +# A C compiler. +LTCC=$lt_LTCC + +# A language-specific compiler. +CC=$lt_[]_LT_AC_TAGVAR(compiler, $1) + +# Is the compiler the GNU C compiler? +with_gcc=$_LT_AC_TAGVAR(GCC, $1) + +# An ERE matcher. +EGREP=$lt_EGREP + +# The linker used to build libraries. +LD=$lt_[]_LT_AC_TAGVAR(LD, $1) + +# Whether we need hard or soft links. +LN_S=$lt_LN_S + +# A BSD-compatible nm program. +NM=$lt_NM + +# A symbol stripping program +STRIP=$STRIP + +# Used to examine libraries when file_magic_cmd begins "file" +MAGIC_CMD=$MAGIC_CMD + +# Used on cygwin: DLL creation program. +DLLTOOL="$DLLTOOL" + +# Used on cygwin: object dumper. +OBJDUMP="$OBJDUMP" + +# Used on cygwin: assembler. +AS="$AS" + +# The name of the directory that contains temporary libtool files. +objdir=$objdir + +# How to create reloadable object files. +reload_flag=$lt_reload_flag +reload_cmds=$lt_reload_cmds + +# How to pass a linker flag through the compiler. +wl=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_wl, $1) + +# Object file suffix (normally "o"). +objext="$ac_objext" + +# Old archive suffix (normally "a"). +libext="$libext" + +# Shared library suffix (normally ".so"). +shrext='$shrext' + +# Executable file suffix (normally ""). +exeext="$exeext" + +# Additional compiler flags for building library objects. +pic_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) +pic_mode=$pic_mode + +# What is the maximum length of a command? +max_cmd_len=$lt_cv_sys_max_cmd_len + +# Does compiler simultaneously support -c and -o options? +compiler_c_o=$lt_[]_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1) + +# Must we lock files when doing compilation ? +need_locks=$lt_need_locks + +# Do we need the lib prefix for modules? +need_lib_prefix=$need_lib_prefix + +# Do we need a version for libraries? +need_version=$need_version + +# Whether dlopen is supported. +dlopen_support=$enable_dlopen + +# Whether dlopen of programs is supported. +dlopen_self=$enable_dlopen_self + +# Whether dlopen of statically linked programs is supported. +dlopen_self_static=$enable_dlopen_self_static + +# Compiler flag to prevent dynamic linking. +link_static_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_static, $1) + +# Compiler flag to turn off builtin functions. +no_builtin_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) + +# Compiler flag to allow reflexive dlopens. +export_dynamic_flag_spec=$lt_[]_LT_AC_TAGVAR(export_dynamic_flag_spec, $1) + +# Compiler flag to generate shared objects directly from archives. +whole_archive_flag_spec=$lt_[]_LT_AC_TAGVAR(whole_archive_flag_spec, $1) + +# Compiler flag to generate thread-safe objects. +thread_safe_flag_spec=$lt_[]_LT_AC_TAGVAR(thread_safe_flag_spec, $1) + +# Library versioning type. +version_type=$version_type + +# Format of library name prefix. +libname_spec=$lt_libname_spec + +# List of archive names. First name is the real one, the rest are links. +# The last name is the one that the linker finds with -lNAME. +library_names_spec=$lt_library_names_spec + +# The coded name of the library, if different from the real name. +soname_spec=$lt_soname_spec + +# Commands used to build and install an old-style archive. +RANLIB=$lt_RANLIB +old_archive_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_cmds, $1) +old_postinstall_cmds=$lt_old_postinstall_cmds +old_postuninstall_cmds=$lt_old_postuninstall_cmds + +# Create an old-style archive from a shared archive. +old_archive_from_new_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_new_cmds, $1) + +# Create a temporary old-style archive to link instead of a shared archive. +old_archive_from_expsyms_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) + +# Commands used to build and install a shared archive. +archive_cmds=$lt_[]_LT_AC_TAGVAR(archive_cmds, $1) +archive_expsym_cmds=$lt_[]_LT_AC_TAGVAR(archive_expsym_cmds, $1) +postinstall_cmds=$lt_postinstall_cmds +postuninstall_cmds=$lt_postuninstall_cmds + +# Commands used to build a loadable module (assumed same as above if empty) +module_cmds=$lt_[]_LT_AC_TAGVAR(module_cmds, $1) +module_expsym_cmds=$lt_[]_LT_AC_TAGVAR(module_expsym_cmds, $1) + +# Commands to strip libraries. +old_striplib=$lt_old_striplib +striplib=$lt_striplib + +# Dependencies to place before the objects being linked to create a +# shared library. +predep_objects=$lt_[]_LT_AC_TAGVAR(predep_objects, $1) + +# Dependencies to place after the objects being linked to create a +# shared library. +postdep_objects=$lt_[]_LT_AC_TAGVAR(postdep_objects, $1) + +# Dependencies to place before the objects being linked to create a +# shared library. +predeps=$lt_[]_LT_AC_TAGVAR(predeps, $1) + +# Dependencies to place after the objects being linked to create a +# shared library. +postdeps=$lt_[]_LT_AC_TAGVAR(postdeps, $1) + +# The library search path used internally by the compiler when linking +# a shared library. +compiler_lib_search_path=$lt_[]_LT_AC_TAGVAR(compiler_lib_search_path, $1) + +# Method to check whether dependent libraries are shared objects. +deplibs_check_method=$lt_deplibs_check_method + +# Command to use when deplibs_check_method == file_magic. +file_magic_cmd=$lt_file_magic_cmd + +# Flag that allows shared libraries with undefined symbols to be built. +allow_undefined_flag=$lt_[]_LT_AC_TAGVAR(allow_undefined_flag, $1) + +# Flag that forces no undefined symbols. +no_undefined_flag=$lt_[]_LT_AC_TAGVAR(no_undefined_flag, $1) + +# Commands used to finish a libtool library installation in a directory. +finish_cmds=$lt_finish_cmds + +# Same as above, but a single script fragment to be evaled but not shown. +finish_eval=$lt_finish_eval + +# Take the output of nm and produce a listing of raw symbols and C names. +global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe + +# Transform the output of nm in a proper C declaration +global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl + +# Transform the output of nm in a C name address pair +global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address + +# This is the shared library runtime path variable. +runpath_var=$runpath_var + +# This is the shared library path variable. +shlibpath_var=$shlibpath_var + +# Is shlibpath searched before the hard-coded library search path? +shlibpath_overrides_runpath=$shlibpath_overrides_runpath + +# How to hardcode a shared library path into an executable. +hardcode_action=$_LT_AC_TAGVAR(hardcode_action, $1) + +# Whether we should hardcode library paths into libraries. +hardcode_into_libs=$hardcode_into_libs + +# Flag to hardcode \$libdir into a binary during linking. +# This must work even if \$libdir does not exist. +hardcode_libdir_flag_spec=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) + +# If ld is used when linking, flag to hardcode \$libdir into +# a binary during linking. This must work even if \$libdir does +# not exist. +hardcode_libdir_flag_spec_ld=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1) + +# Whether we need a single -rpath flag with a separated argument. +hardcode_libdir_separator=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_separator, $1) + +# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the +# resulting binary. +hardcode_direct=$_LT_AC_TAGVAR(hardcode_direct, $1) + +# Set to yes if using the -LDIR flag during linking hardcodes DIR into the +# resulting binary. +hardcode_minus_L=$_LT_AC_TAGVAR(hardcode_minus_L, $1) + +# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into +# the resulting binary. +hardcode_shlibpath_var=$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1) + +# Set to yes if building a shared library automatically hardcodes DIR into the library +# and all subsequent libraries and executables linked against it. +hardcode_automatic=$_LT_AC_TAGVAR(hardcode_automatic, $1) + +# Variables whose values should be saved in libtool wrapper scripts and +# restored at relink time. +variables_saved_for_relink="$variables_saved_for_relink" + +# Whether libtool must link a program against all its dependency libraries. +link_all_deplibs=$_LT_AC_TAGVAR(link_all_deplibs, $1) + +# Compile-time system search path for libraries +sys_lib_search_path_spec=$lt_sys_lib_search_path_spec + +# Run-time system search path for libraries +sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec + +# Fix the shell variable \$srcfile for the compiler. +fix_srcfile_path="$_LT_AC_TAGVAR(fix_srcfile_path, $1)" + +# Set to yes if exported symbols are required. +always_export_symbols=$_LT_AC_TAGVAR(always_export_symbols, $1) + +# The commands to list exported symbols. +export_symbols_cmds=$lt_[]_LT_AC_TAGVAR(export_symbols_cmds, $1) + +# The commands to extract the exported symbol list from a shared archive. +extract_expsyms_cmds=$lt_extract_expsyms_cmds + +# Symbols that should not be listed in the preloaded symbols. +exclude_expsyms=$lt_[]_LT_AC_TAGVAR(exclude_expsyms, $1) + +# Symbols that must always be exported. +include_expsyms=$lt_[]_LT_AC_TAGVAR(include_expsyms, $1) + +ifelse([$1],[], +[# ### END LIBTOOL CONFIG], +[# ### END LIBTOOL TAG CONFIG: $tagname]) + +__EOF__ + +ifelse([$1],[], [ + case $host_os in + aix3*) + cat <<\EOF >> "$cfgfile" + +# AIX sometimes has problems with the GCC collect2 program. For some +# reason, if we set the COLLECT_NAMES environment variable, the problems +# vanish in a puff of smoke. +if test "X${COLLECT_NAMES+set}" != Xset; then + COLLECT_NAMES= + export COLLECT_NAMES +fi +EOF + ;; + esac + + # We use sed instead of cat because bash on DJGPP gets confused if + # if finds mixed CR/LF and LF-only lines. Since sed operates in + # text mode, it properly converts lines to CR/LF. This bash problem + # is reportedly fixed, but why not run on old versions too? + sed '$q' "$ltmain" >> "$cfgfile" || (rm -f "$cfgfile"; exit 1) + + mv -f "$cfgfile" "$ofile" || \ + (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") + chmod +x "$ofile" +]) +else + # If there is no Makefile yet, we rely on a make rule to execute + # `config.status --recheck' to rerun these tests and create the + # libtool script then. + test -f Makefile && make "$ltmain" +fi +])# AC_LIBTOOL_CONFIG + + +# AC_LIBTOOL_PROG_COMPILER_NO_RTTI([TAGNAME]) +# ------------------------------------------- +AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], +[AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl + +_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= + +if test "$GCC" = yes; then + _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' + + AC_LIBTOOL_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], + lt_cv_prog_compiler_rtti_exceptions, + [-fno-rtti -fno-exceptions], [], + [_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"]) +fi +])# AC_LIBTOOL_PROG_COMPILER_NO_RTTI + + +# AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE +# --------------------------------- +AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], +[AC_REQUIRE([AC_CANONICAL_HOST]) +AC_REQUIRE([AC_PROG_NM]) +AC_REQUIRE([AC_OBJEXT]) +# Check for command to grab the raw symbol name followed by C symbol from nm. +AC_MSG_CHECKING([command to parse $NM output from $compiler object]) +AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], +[ +# These are sane defaults that work on at least a few old systems. +# [They come from Ultrix. What could be older than Ultrix?!! ;)] + +# Character class describing NM global symbol codes. +symcode='[[BCDEGRST]]' + +# Regexp to match symbols that can be accessed directly from C. +sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)' + +# Transform the above into a raw symbol and a C symbol. +symxfrm='\1 \2\3 \3' + +# Transform an extracted symbol line into a proper C declaration +lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \1;/p'" + +# Transform an extracted symbol line into symbol name and symbol address +lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" + +# Define system-specific variables. +case $host_os in +aix*) + symcode='[[BCDT]]' + ;; +cygwin* | mingw* | pw32*) + symcode='[[ABCDGISTW]]' + ;; +hpux*) # Its linker distinguishes data from code symbols + if test "$host_cpu" = ia64; then + symcode='[[ABCDEGRST]]' + fi + lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" + lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" + ;; +irix* | nonstopux*) + symcode='[[BCDEGRST]]' + ;; +osf*) + symcode='[[BCDEGQRST]]' + ;; +solaris* | sysv5*) + symcode='[[BDT]]' + ;; +sysv4) + symcode='[[DFNSTU]]' + ;; +esac + +# Handle CRLF in mingw tool chain +opt_cr= +case $build_os in +mingw*) + opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp + ;; +esac + +# If we're using GNU nm, then use its standard symbol codes. +case `$NM -V 2>&1` in +*GNU* | *'with BFD'*) + symcode='[[ABCDGISTW]]' ;; +esac + +# Try without a prefix undercore, then with it. +for ac_symprfx in "" "_"; do + + # Write the raw and C identifiers. + lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*\($ac_symprfx\)$sympat$opt_cr$/$symxfrm/p'" + + # Check to see that the pipe works correctly. + pipe_works=no + + rm -f conftest* + cat > conftest.$ac_ext < $nlist) && test -s "$nlist"; then + # Try sorting and uniquifying the output. + if sort "$nlist" | uniq > "$nlist"T; then + mv -f "$nlist"T "$nlist" + else + rm -f "$nlist"T + fi + + # Make sure that we snagged all the symbols we need. + if grep ' nm_test_var$' "$nlist" >/dev/null; then + if grep ' nm_test_func$' "$nlist" >/dev/null; then + cat < conftest.$ac_ext +#ifdef __cplusplus +extern "C" { +#endif + +EOF + # Now generate the symbol file. + eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | grep -v main >> conftest.$ac_ext' + + cat <> conftest.$ac_ext +#if defined (__STDC__) && __STDC__ +# define lt_ptr_t void * +#else +# define lt_ptr_t char * +# define const +#endif + +/* The mapping between symbol names and symbols. */ +const struct { + const char *name; + lt_ptr_t address; +} +lt_preloaded_symbols[[]] = +{ +EOF + $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" | grep -v main >> conftest.$ac_ext + cat <<\EOF >> conftest.$ac_ext + {0, (lt_ptr_t) 0} +}; + +#ifdef __cplusplus +} +#endif +EOF + # Now try linking the two files. + mv conftest.$ac_objext conftstm.$ac_objext + lt_save_LIBS="$LIBS" + lt_save_CFLAGS="$CFLAGS" + LIBS="conftstm.$ac_objext" + CFLAGS="$CFLAGS$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)" + if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then + pipe_works=yes + fi + LIBS="$lt_save_LIBS" + CFLAGS="$lt_save_CFLAGS" + else + echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD + fi + else + echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD + fi + else + echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD + fi + else + echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD + cat conftest.$ac_ext >&5 + fi + rm -f conftest* conftst* + + # Do not use the global_symbol_pipe unless it works. + if test "$pipe_works" = yes; then + break + else + lt_cv_sys_global_symbol_pipe= + fi +done +]) +if test -z "$lt_cv_sys_global_symbol_pipe"; then + lt_cv_sys_global_symbol_to_cdecl= +fi +if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then + AC_MSG_RESULT(failed) +else + AC_MSG_RESULT(ok) +fi +]) # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE + + +# AC_LIBTOOL_PROG_COMPILER_PIC([TAGNAME]) +# --------------------------------------- +AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC], +[_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)= +_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= +_LT_AC_TAGVAR(lt_prog_compiler_static, $1)= + +AC_MSG_CHECKING([for $compiler option to produce PIC]) + ifelse([$1],[CXX],[ + # C++ specific cases for pic, static, wl, etc. + if test "$GXX" = yes; then + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + fi + ;; + amigaos*) + # FIXME: we need at least 68020 code to build shared libraries, but + # adding the `-m68020' flag to GCC prevents building anything better, + # like `-m68040'. + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' + ;; + beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + mingw* | os2* | pw32*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT' + ;; + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' + ;; + *djgpp*) + # DJGPP does not support shared libraries at all + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= + ;; + sysv4*MP*) + if test -d /usr/nec; then + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic + fi + ;; + hpux*) + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case "$host_cpu" in + hppa*64*|ia64*) + ;; + *) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + esac + ;; + *) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + esac + else + case $host_os in + aix4* | aix5*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + else + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' + fi + ;; + chorus*) + case $cc_basename in + cxch68) + # Green Hills C++ Compiler + # _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" + ;; + esac + ;; + dgux*) + case $cc_basename in + ec++) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + ;; + ghcx) + # Green Hills C++ Compiler + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + ;; + *) + ;; + esac + ;; + freebsd* | kfreebsd*-gnu) + # FreeBSD uses GNU C++ + ;; + hpux9* | hpux10* | hpux11*) + case $cc_basename in + CC) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive" + if test "$host_cpu" != ia64; then + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z' + fi + ;; + aCC) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive" + case "$host_cpu" in + hppa*64*|ia64*) + # +Z the default + ;; + *) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z' + ;; + esac + ;; + *) + ;; + esac + ;; + irix5* | irix6* | nonstopux*) + case $cc_basename in + CC) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + # CC pic flag -KPIC is the default. + ;; + *) + ;; + esac + ;; + linux*) + case $cc_basename in + KCC) + # KAI C++ Compiler + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + icpc) + # Intel C++ + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; + cxx) + # Compaq C++ + # Make sure the PIC flag is empty. It appears that all Alpha + # Linux and Compaq Tru64 Unix objects are PIC. + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + *) + ;; + esac + ;; + lynxos*) + ;; + m88k*) + ;; + mvs*) + case $cc_basename in + cxx) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall' + ;; + *) + ;; + esac + ;; + netbsd*) + ;; + osf3* | osf4* | osf5*) + case $cc_basename in + KCC) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' + ;; + RCC) + # Rational C++ 2.4.1 + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + ;; + cxx) + # Digital/Compaq C++ + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # Make sure the PIC flag is empty. It appears that all Alpha + # Linux and Compaq Tru64 Unix objects are PIC. + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + *) + ;; + esac + ;; + psos*) + ;; + sco*) + case $cc_basename in + CC) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + *) + ;; + esac + ;; + solaris*) + case $cc_basename in + CC) + # Sun C++ 4.2, 5.x and Centerline C++ + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' + ;; + gcx) + # Green Hills C++ Compiler + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' + ;; + *) + ;; + esac + ;; + sunos4*) + case $cc_basename in + CC) + # Sun C++ 4.x + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + lcc) + # Lucid + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + ;; + *) + ;; + esac + ;; + tandem*) + case $cc_basename in + NCC) + # NonStop-UX NCC 3.20 + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + ;; + *) + ;; + esac + ;; + unixware*) + ;; + vxworks*) + ;; + *) + _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no + ;; + esac + fi +], +[ + if test "$GCC" = yes; then + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + fi + ;; + + amigaos*) + # FIXME: we need at least 68020 code to build shared libraries, but + # adding the `-m68020' flag to GCC prevents building anything better, + # like `-m68040'. + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' + ;; + + beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + + mingw* | pw32* | os2*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT' + ;; + + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' + ;; + + msdosdjgpp*) + # Just because we use GCC doesn't mean we suddenly get shared libraries + # on systems that don't support them. + _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no + enable_shared=no + ;; + + sysv4*MP*) + if test -d /usr/nec; then + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic + fi + ;; + + hpux*) + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case "$host_cpu" in + hppa*64*|ia64*) + # +Z the default + ;; + *) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + esac + ;; + + *) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + esac + else + # PORTME Check for flag to pass linker flags through the system compiler. + case $host_os in + aix*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + else + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' + fi + ;; + + mingw* | pw32* | os2*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT' + ;; + + hpux9* | hpux10* | hpux11*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case "$host_cpu" in + hppa*64*|ia64*) + # +Z the default + ;; + *) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z' + ;; + esac + # Is there a better lt_prog_compiler_static that works with the bundled CC? + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' + ;; + + irix5* | irix6* | nonstopux*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # PIC (with -KPIC) is the default. + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + + newsos6) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + linux*) + case $CC in + icc* | ecc*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; + ccc*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # All Alpha code is PIC. + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + esac + ;; + + osf3* | osf4* | osf5*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # All OSF/1 code is PIC. + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + + sco3.2v5*) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-Kpic' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-dn' + ;; + + solaris*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + sunos4*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + sysv4*MP*) + if test -d /usr/nec ;then + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + fi + ;; + + uts4*) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + *) + _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no + ;; + esac + fi +]) +AC_MSG_RESULT([$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)]) + +# +# Check to make sure the PIC flag actually works. +# +if test -n "$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)"; then + AC_LIBTOOL_COMPILER_OPTION([if $compiler PIC flag $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) works], + _LT_AC_TAGVAR(lt_prog_compiler_pic_works, $1), + [$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])], [], + [case $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) in + "" | " "*) ;; + *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)" ;; + esac], + [_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= + _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no]) +fi +case "$host_os" in + # For platforms which do not support PIC, -DPIC is meaningless: + *djgpp*) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= + ;; + *) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])" + ;; +esac +]) + + +# AC_LIBTOOL_PROG_LD_SHLIBS([TAGNAME]) +# ------------------------------------ +# See if the linker supports building shared libraries. +AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS], +[AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) +ifelse([$1],[CXX],[ + _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + case $host_os in + aix4* | aix5*) + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to AIX nm, but means don't demangle with GNU nm + if $NM -V 2>&1 | grep 'GNU' > /dev/null; then + _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' + else + _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' + fi + ;; + pw32*) + _LT_AC_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds" + ;; + cygwin* | mingw*) + _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGS]] /s/.* \([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols' + ;; + *) + _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + ;; + esac +],[ + runpath_var= + _LT_AC_TAGVAR(allow_undefined_flag, $1)= + _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no + _LT_AC_TAGVAR(archive_cmds, $1)= + _LT_AC_TAGVAR(archive_expsym_cmds, $1)= + _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)= + _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1)= + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)= + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= + _LT_AC_TAGVAR(thread_safe_flag_spec, $1)= + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= + _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= + _LT_AC_TAGVAR(hardcode_direct, $1)=no + _LT_AC_TAGVAR(hardcode_minus_L, $1)=no + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported + _LT_AC_TAGVAR(link_all_deplibs, $1)=unknown + _LT_AC_TAGVAR(hardcode_automatic, $1)=no + _LT_AC_TAGVAR(module_cmds, $1)= + _LT_AC_TAGVAR(module_expsym_cmds, $1)= + _LT_AC_TAGVAR(always_export_symbols, $1)=no + _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + # include_expsyms should be a list of space-separated symbols to be *always* + # included in the symbol list + _LT_AC_TAGVAR(include_expsyms, $1)= + # exclude_expsyms can be an extended regexp of symbols to exclude + # it will be wrapped by ` (' and `)$', so one must not match beginning or + # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', + # as well as any symbol that contains `d'. + _LT_AC_TAGVAR(exclude_expsyms, $1)="_GLOBAL_OFFSET_TABLE_" + # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out + # platforms (ab)use it in PIC code, but their linkers get confused if + # the symbol is explicitly referenced. Since portable code cannot + # rely on this symbol name, it's probably fine to never include it in + # preloaded symbol tables. + extract_expsyms_cmds= + + case $host_os in + cygwin* | mingw* | pw32*) + # FIXME: the MSVC++ port hasn't been tested in a loooong time + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + if test "$GCC" != yes; then + with_gnu_ld=no + fi + ;; + openbsd*) + with_gnu_ld=no + ;; + esac + + _LT_AC_TAGVAR(ld_shlibs, $1)=yes + if test "$with_gnu_ld" = yes; then + # If archive_cmds runs LD, not CC, wlarc should be empty + wlarc='${wl}' + + # See if GNU ld supports shared libraries. + case $host_os in + aix3* | aix4* | aix5*) + # On AIX/PPC, the GNU linker is very broken + if test "$host_cpu" != ia64; then + _LT_AC_TAGVAR(ld_shlibs, $1)=no + cat <&2 + +*** Warning: the GNU linker, at least up to release 2.9.1, is reported +*** to be unable to reliably create shared libraries on AIX. +*** Therefore, libtool is disabling shared libraries support. If you +*** really care for shared libraries, you may want to modify your PATH +*** so that a non-GNU linker is found, and then restart. + +EOF + fi + ;; + + amigaos*) + _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + + # Samuel A. Falvo II reports + # that the semantics of dynamic libraries on AmigaOS, at least up + # to version 4, is to share data among multiple programs linked + # with the same dynamic library. Since this doesn't match the + # behavior of shared libraries on other platforms, we can't use + # them. + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + + beos*) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported + # Joseph Beckenbach says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -nostart $compiler_flags $libobjs $deplibs ${wl}-soname $wl$soname -o $lib' + else + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + cygwin* | mingw* | pw32*) + # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, + # as there is no search path for DLLs. + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(allow_undefined_flag, $1)=no + _LT_AC_TAGVAR(always_export_symbols, $1)=no + _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGS]] /s/.* \([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols' + + if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $compiler_flags $libobjs $deplibs -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared $output_objdir/$soname.def $compiler_flags $libobjs $deplibs -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' + else + ld_shlibs=no + fi + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' + wlarc= + else + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $compiler_flags $libobjs $deplibs ${wl}-soname $wl$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $compiler_flags $libobjs $deplibs ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + fi + ;; + + solaris* | sysv5*) + if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then + _LT_AC_TAGVAR(ld_shlibs, $1)=no + cat <&2 + +*** Warning: The releases 2.8.* of the GNU linker cannot reliably +*** create shared libraries on Solaris systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.9.1 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +EOF + elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $compiler_flags $libobjs $deplibs ${wl}-soname $wl$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $compiler_flags $libobjs $deplibs ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + sunos4*) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' + wlarc= + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + *) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $compiler_flags $libobjs $deplibs ${wl}-soname $wl$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $compiler_flags $libobjs $deplibs ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + + if test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = yes; then + runpath_var=LD_RUN_PATH + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + # ancient GNU ld didn't support --whole-archive et. al. + if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + else + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= + fi + fi + else + # PORTME fill in a description of your system's linker (not GNU ld) + case $host_os in + aix3*) + _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_AC_TAGVAR(always_export_symbols, $1)=yes + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' + # Note: this linker hardcodes the directories in LIBPATH if there + # are no directories specified by -L. + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + if test "$GCC" = yes && test -z "$link_static_flag"; then + # Neither direct hardcoding nor static linking is supported with a + # broken collect2. + _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported + fi + ;; + + aix4* | aix5*) + if test "$host_cpu" = ia64; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + exp_sym_flag='-Bexport' + no_entry_flag="" + else + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to AIX nm, but means don't demangle with GNU nm + if $NM -V 2>&1 | grep 'GNU' > /dev/null; then + _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' + else + _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' + fi + + # KDE requires run time linking. Make it the default. + aix_use_runtimelinking=yes + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi + + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + + _LT_AC_TAGVAR(archive_cmds, $1)='' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' + _LT_AC_TAGVAR(link_all_deplibs, $1)=yes + + if test "$GCC" = yes; then + case $host_os in aix4.[012]|aix4.[012].*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`${CC} -print-prog-name=collect2` + if test -f "$collect2name" && \ + strings "$collect2name" | grep resolve_lib_name >/dev/null + then + # We have reworked collect2 + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + else + # We have old collect2 + _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported + # It fails to find uninstalled libraries when the uninstalled + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= + fi + esac + shared_flag='-shared' + else + # not using gcc + if test "$host_cpu" = ia64; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test "$aix_use_runtimelinking" = yes; then + shared_flag='-qmkshrobj ${wl}-G' + else + shared_flag='-qmkshrobj' + fi + fi + fi + + # Let the compiler handle the export list. + _LT_AC_TAGVAR(always_export_symbols, $1)=no + if test "$aix_use_runtimelinking" = yes; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok' + # Determine the default libpath from the value encoded in an empty executable. + _LT_AC_SYS_LIBPATH_AIX + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" + _LT_AC_TAGVAR(archive_cmds, $1)="\$CC"' -o $output_objdir/$soname $compiler_flags $libobjs $deplibs `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '" $shared_flag" + _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $compiler_flags $libobjs $deplibs `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + else + if test "$host_cpu" = ia64; then + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' + _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs" + _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $compiler_flags $libobjs $deplibs ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an empty executable. + _LT_AC_SYS_LIBPATH_AIX + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' + _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' + # -bexpall does not export symbols beginning with underscore (_) + _LT_AC_TAGVAR(always_export_symbols, $1)=yes + # Exported symbols can be pulled into shared objects from archives + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=' ' + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes + # This is similar to how AIX traditionally builds it's shared libraries. + _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $compiler_flags $libobjs $deplibs ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; + + amigaos*) + _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + # see comment about different semantics on the GNU ld section + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + + bsdi4*) + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic + ;; + + cygwin* | mingw* | pw32*) + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' + _LT_AC_TAGVAR(allow_undefined_flag, $1)=no + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext=".dll" + # FIXME: Setting linknames here is a bad hack. + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -o $lib $compiler_flags $libobjs `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames=' + # The linker will automatically build a .lib file if we build a DLL. + _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='true' + # FIXME: Should let the user specify the lib program. + _LT_AC_TAGVAR(old_archive_cmds, $1)='lib /OUT:$oldlib$oldobjs$old_deplibs' + fix_srcfile_path='`cygpath -w "$srcfile"`' + _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + ;; + + darwin* | rhapsody*) + if test "$GXX" = yes ; then + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no + case "$host_os" in + rhapsody* | darwin1.[[012]]) + _LT_AC_TAGVAR(allow_undefined_flag, $1)='-Wl,-undefined -Wl,suppress' + ;; + *) # Darwin 1.3 on + if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then + _LT_AC_TAGVAR(allow_undefined_flag, $1)='-Wl,-flat_namespace -Wl,-undefined -Wl,suppress' + else + case ${MACOSX_DEPLOYMENT_TARGET} in + 10.[012]) + _LT_AC_TAGVAR(allow_undefined_flag, $1)='-Wl,-flat_namespace -Wl,-undefined -Wl,suppress' + ;; + 10.*) + _LT_AC_TAGVAR(allow_undefined_flag, $1)='-Wl,-undefined -Wl,dynamic_lookup' + ;; + esac + fi + ;; + esac + lt_int_apple_cc_single_mod=no + output_verbose_link_cmd='echo' + if $CC -dumpspecs 2>&1 | grep 'single_module' >/dev/null ; then + lt_int_apple_cc_single_mod=yes + fi + if test "X$lt_int_apple_cc_single_mod" = Xyes ; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $compiler_flags $libobjs $deplibs -install_name $rpath/$soname $verstring' + else + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $compiler_flags $deplibs -install_name $rpath/$soname $verstring' + fi + _LT_AC_TAGVAR(module_cmds, $1)='$CC ${wl}-bind_at_load $allow_undefined_flag -o $lib -bundle $compiler_flags $libobjs $deplibs' + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's + if test "X$lt_int_apple_cc_single_mod" = Xyes ; then + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $compiler_flags $libobjs $deplibs -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + else + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $compiler_flags $deplibs -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + fi + _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $compiler_flags $libobjs $deplibs~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + _LT_AC_TAGVAR(hardcode_direct, $1)=no + _LT_AC_TAGVAR(hardcode_automatic, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-all_load $convenience' + _LT_AC_TAGVAR(link_all_deplibs, $1)=yes + else + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + dgux*) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + freebsd1*) + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + + # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor + # support. Future versions do this automatically, but an explicit c++rt0.o + # does not break anything, and helps significantly (at the cost of a little + # extra space). + freebsd2.2*) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + # Unfortunately, older versions of FreeBSD 2 do not have this feature. + freebsd2*) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + # FreeBSD 3 and greater uses gcc -shared to do shared libraries. + freebsd* | kfreebsd*-gnu) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $compiler_flags $libobjs $deplibs' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + hpux9*) + if test "$GCC" = yes; then + _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $compiler_flags $libobjs $deplibs~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + else + _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + fi + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + ;; + + hpux10* | hpux11*) + if test "$GCC" = yes -a "$with_gnu_ld" = no; then + case "$host_cpu" in + hppa*64*|ia64*) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $compiler_flags $libobjs $deplibs' + ;; + *) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $compiler_flags $libobjs $deplibs' + ;; + esac + else + case "$host_cpu" in + hppa*64*|ia64*) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $libobjs $deplibs $linker_flags' + ;; + *) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' + ;; + esac + fi + if test "$with_gnu_ld" = no; then + case "$host_cpu" in + hppa*64*) + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_AC_TAGVAR(hardcode_direct, $1)=no + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + ia64*) + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(hardcode_direct, $1)=no + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + ;; + *) + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + ;; + esac + fi + ;; + + irix5* | irix6* | nonstopux*) + if test "$GCC" = yes; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $compiler_flags $libobjs $deplibs ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir' + fi + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_AC_TAGVAR(link_all_deplibs, $1)=yes + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out + else + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF + fi + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + newsos6) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + openbsd*) + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $compiler_flags $libobjs $deplibs' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + else + case $host_os in + openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + ;; + *) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $compiler_flags $libobjs $deplibs' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + ;; + esac + fi + ;; + + os2*) + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_AC_TAGVAR(archive_cmds, $1)='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $compiler_flags $libobjs $deplibs$output_objdir/$libname.def' + _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' + ;; + + osf3*) + if test "$GCC" = yes; then + _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $compiler_flags $libobjs $deplibs ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + fi + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + ;; + + osf4* | osf5*) # as osf3* with the addition of -msym flag + if test "$GCC" = yes; then + _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $compiler_flags $libobjs $deplibs ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + else + _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ + $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib~$rm $lib.exp' + + # Both c and cxx compiler support -rpath directly + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' + fi + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + ;; + + sco3.2v5*) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' + runpath_var=LD_RUN_PATH + hardcode_runpath_var=yes + ;; + + solaris*) + _LT_AC_TAGVAR(no_undefined_flag, $1)=' -z text' + if test "$GCC" = yes; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h ${wl}$soname -o $lib $compiler_flags $libobjs $deplibs' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $compiler_flags $libobjs $deplibs~$rm $lib.exp' + else + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' + fi + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + case $host_os in + solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; + *) # Supported since Solaris 2.6 (maybe 2.5.1?) + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;; + esac + _LT_AC_TAGVAR(link_all_deplibs, $1)=yes + ;; + + sunos4*) + if test "x$host_vendor" = xsequent; then + # Use $CC to link under sequent, because it throws in some extra .o + # files that make .init and .fini sections work. + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $compiler_flags $libobjs $deplibs' + else + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' + fi + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + sysv4) + case $host_vendor in + sni) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes # is this really true??? + ;; + siemens) + ## LD is ld it makes a PLAMLIB + ## CC just makes a GrossModule. + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs' + _LT_AC_TAGVAR(hardcode_direct, $1)=no + ;; + motorola) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie + ;; + esac + runpath_var='LD_RUN_PATH' + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + sysv4.3*) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + runpath_var=LD_RUN_PATH + hardcode_runpath_var=yes + _LT_AC_TAGVAR(ld_shlibs, $1)=yes + fi + ;; + + sysv4.2uw2*) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_minus_L, $1)=no + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + hardcode_runpath_var=yes + runpath_var=LD_RUN_PATH + ;; + + sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[[78]]* | unixware7*) + _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z ${wl}text' + if test "$GCC" = yes; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h ${wl}$soname -o $lib $compiler_flags $libobjs $deplibs' + else + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h ${wl}$soname -o $lib $compiler_flags $libobjs $deplibs' + fi + runpath_var='LD_RUN_PATH' + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + sysv5*) + _LT_AC_TAGVAR(no_undefined_flag, $1)=' -z text' + # $CC -shared without GNU ld will not create a library from C++ + # object files and a static libstdc++, better avoid it by now + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + runpath_var='LD_RUN_PATH' + ;; + + uts4*) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + *) + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + esac + fi +]) +AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)]) +test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no + +variables_saved_for_relink="PATH $shlibpath_var $runpath_var" +if test "$GCC" = yes; then + variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" +fi + +# +# Do we need to explicitly link libc? +# +case "x$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)" in +x|xyes) + # Assume -lc should be added + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes + + if test "$enable_shared" = yes && test "$GCC" = yes; then + case $_LT_AC_TAGVAR(archive_cmds, $1) in + *'~'*) + # FIXME: we may have to deal with multi-command sequences. + ;; + '$CC '*) + # Test whether the compiler implicitly links with -lc since on some + # systems, -lgcc has to come before -lc. If gcc already passes -lc + # to ld, don't add -lc before -lgcc. + AC_MSG_CHECKING([whether -lc should be explicitly linked in]) + $rm conftest* + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + + if AC_TRY_EVAL(ac_compile) 2>conftest.err; then + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext + deplibs= + wl=$_LT_AC_TAGVAR(lt_prog_compiler_wl, $1) + compiler_flags=-v + linker_flags=-v + verstring= + output_objdir=. + libname=conftest + lt_save_allow_undefined_flag=$_LT_AC_TAGVAR(allow_undefined_flag, $1) + _LT_AC_TAGVAR(allow_undefined_flag, $1)= + if AC_TRY_EVAL(_LT_AC_TAGVAR(archive_cmds, $1) 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) + then + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no + else + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes + fi + _LT_AC_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $rm conftest* + AC_MSG_RESULT([$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)]) + ;; + esac + fi + ;; +esac +])# AC_LIBTOOL_PROG_LD_SHLIBS + + +# _LT_AC_FILE_LTDLL_C +# ------------------- +# Be careful that the start marker always follows a newline. +AC_DEFUN([_LT_AC_FILE_LTDLL_C], [ +# /* ltdll.c starts here */ +# #define WIN32_LEAN_AND_MEAN +# #include +# #undef WIN32_LEAN_AND_MEAN +# #include +# +# #ifndef __CYGWIN__ +# # ifdef __CYGWIN32__ +# # define __CYGWIN__ __CYGWIN32__ +# # endif +# #endif +# +# #ifdef __cplusplus +# extern "C" { +# #endif +# BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved); +# #ifdef __cplusplus +# } +# #endif +# +# #ifdef __CYGWIN__ +# #include +# DECLARE_CYGWIN_DLL( DllMain ); +# #endif +# HINSTANCE __hDllInstance_base; +# +# BOOL APIENTRY +# DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved) +# { +# __hDllInstance_base = hInst; +# return TRUE; +# } +# /* ltdll.c ends here */ +])# _LT_AC_FILE_LTDLL_C + + +# _LT_AC_TAGVAR(VARNAME, [TAGNAME]) +# --------------------------------- +AC_DEFUN([_LT_AC_TAGVAR], [ifelse([$2], [], [$1], [$1_$2])]) + + +# old names +AC_DEFUN([AM_PROG_LIBTOOL], [AC_PROG_LIBTOOL]) +AC_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) +AC_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) +AC_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) +AC_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) +AC_DEFUN([AM_PROG_LD], [AC_PROG_LD]) +AC_DEFUN([AM_PROG_NM], [AC_PROG_NM]) + +# This is just to silence aclocal about the macro not being used +ifelse([AC_DISABLE_FAST_INSTALL]) + +AC_DEFUN([LT_AC_PROG_GCJ], +[AC_CHECK_TOOL(GCJ, gcj, no) + test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2" + AC_SUBST(GCJFLAGS) +]) + +AC_DEFUN([LT_AC_PROG_RC], +[AC_CHECK_TOOL(RC, windres, no) +]) + +############################################################ +# NOTE: This macro has been submitted for inclusion into # +# GNU Autoconf as AC_PROG_SED. When it is available in # +# a released version of Autoconf we should remove this # +# macro and use it instead. # +############################################################ +# LT_AC_PROG_SED +# -------------- +# Check for a fully-functional sed program, that truncates +# as few characters as possible. Prefer GNU sed if found. +AC_DEFUN([LT_AC_PROG_SED], +[AC_MSG_CHECKING([for a sed that does not truncate output]) +AC_CACHE_VAL(lt_cv_path_SED, +[# Loop through the user's path and test for sed and gsed. +# Then use that list of sed's as ones to test for truncation. +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for lt_ac_prog in sed gsed; do + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then + lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" + fi + done + done +done +lt_ac_max=0 +lt_ac_count=0 +# Add /usr/xpg4/bin/sed as it is typically found on Solaris +# along with /bin/sed that truncates output. +for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do + test ! -f $lt_ac_sed && break + cat /dev/null > conftest.in + lt_ac_count=0 + echo $ECHO_N "0123456789$ECHO_C" >conftest.in + # Check for GNU sed and select it if it is found. + if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then + lt_cv_path_SED=$lt_ac_sed + break + fi + while true; do + cat conftest.in conftest.in >conftest.tmp + mv conftest.tmp conftest.in + cp conftest.in conftest.nl + echo >>conftest.nl + $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break + cmp -s conftest.out conftest.nl || break + # 10000 chars as input seems more than enough + test $lt_ac_count -gt 10 && break + lt_ac_count=`expr $lt_ac_count + 1` + if test $lt_ac_count -gt $lt_ac_max; then + lt_ac_max=$lt_ac_count + lt_cv_path_SED=$lt_ac_sed + fi + done +done +]) +SED=$lt_cv_path_SED +AC_MSG_RESULT([$SED]) +]) diff --git a/aclocal.m4 b/aclocal.m4 new file mode 100644 index 0000000..4abf55a --- /dev/null +++ b/aclocal.m4 @@ -0,0 +1,1055 @@ +# generated automatically by aclocal 1.10 -*- Autoconf -*- + +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, +# 2005, 2006 Free Software Foundation, Inc. +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +m4_if(m4_PACKAGE_VERSION, [2.61],, +[m4_fatal([this file was generated for autoconf 2.61. +You have another version of autoconf. If you want to use that, +you should regenerate the build system entirely.], [63])]) + +# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- +# +# Copyright © 2004 Scott James Remnant . +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# PKG_PROG_PKG_CONFIG([MIN-VERSION]) +# ---------------------------------- +AC_DEFUN([PKG_PROG_PKG_CONFIG], +[m4_pattern_forbid([^_?PKG_[A-Z_]+$]) +m4_pattern_allow([^PKG_CONFIG(_PATH)?$]) +AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl +if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then + AC_PATH_TOOL([PKG_CONFIG], [pkg-config]) +fi +if test -n "$PKG_CONFIG"; then + _pkg_min_version=m4_default([$1], [0.9.0]) + AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version]) + if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + PKG_CONFIG="" + fi + +fi[]dnl +])# PKG_PROG_PKG_CONFIG + +# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) +# +# Check to see whether a particular set of modules exists. Similar +# to PKG_CHECK_MODULES(), but does not set variables or print errors. +# +# +# Similar to PKG_CHECK_MODULES, make sure that the first instance of +# this or PKG_CHECK_MODULES is called, or make sure to call +# PKG_CHECK_EXISTS manually +# -------------------------------------------------------------- +AC_DEFUN([PKG_CHECK_EXISTS], +[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl +if test -n "$PKG_CONFIG" && \ + AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then + m4_ifval([$2], [$2], [:]) +m4_ifvaln([$3], [else + $3])dnl +fi]) + + +# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) +# --------------------------------------------- +m4_define([_PKG_CONFIG], +[if test -n "$PKG_CONFIG"; then + if test -n "$$1"; then + pkg_cv_[]$1="$$1" + else + PKG_CHECK_EXISTS([$3], + [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`], + [pkg_failed=yes]) + fi +else + pkg_failed=untried +fi[]dnl +])# _PKG_CONFIG + +# _PKG_SHORT_ERRORS_SUPPORTED +# ----------------------------- +AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED], +[AC_REQUIRE([PKG_PROG_PKG_CONFIG]) +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi[]dnl +])# _PKG_SHORT_ERRORS_SUPPORTED + + +# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], +# [ACTION-IF-NOT-FOUND]) +# +# +# Note that if there is a possibility the first call to +# PKG_CHECK_MODULES might not happen, you should be sure to include an +# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac +# +# +# -------------------------------------------------------------- +AC_DEFUN([PKG_CHECK_MODULES], +[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl +AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl +AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl + +pkg_failed=no +AC_MSG_CHECKING([for $1]) + +_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2]) +_PKG_CONFIG([$1][_LIBS], [libs], [$2]) + +m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS +and $1[]_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details.]) + +if test $pkg_failed = yes; then + _PKG_SHORT_ERRORS_SUPPORTED + if test $_pkg_short_errors_supported = yes; then + $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "$2"` + else + $1[]_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"` + fi + # Put the nasty error message in config.log where it belongs + echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD + + ifelse([$4], , [AC_MSG_ERROR(dnl +[Package requirements ($2) were not met: + +$$1_PKG_ERRORS + +Consider adjusting the PKG_CONFIG_PATH environment variable if you +installed software in a non-standard prefix. + +_PKG_TEXT +])], + [AC_MSG_RESULT([no]) + $4]) +elif test $pkg_failed = untried; then + ifelse([$4], , [AC_MSG_FAILURE(dnl +[The pkg-config script could not be found or is too old. Make sure it +is in your PATH or set the PKG_CONFIG environment variable to the full +path to pkg-config. + +_PKG_TEXT + +To get pkg-config, see .])], + [$4]) +else + $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS + $1[]_LIBS=$pkg_cv_[]$1[]_LIBS + AC_MSG_RESULT([yes]) + ifelse([$3], , :, [$3]) +fi[]dnl +])# PKG_CHECK_MODULES + +# Copyright (C) 2002, 2003, 2005, 2006 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_AUTOMAKE_VERSION(VERSION) +# ---------------------------- +# Automake X.Y traces this macro to ensure aclocal.m4 has been +# generated from the m4 files accompanying Automake X.Y. +# (This private macro should not be called outside this file.) +AC_DEFUN([AM_AUTOMAKE_VERSION], +[am__api_version='1.10' +dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to +dnl require some minimum version. Point them to the right macro. +m4_if([$1], [1.10], [], + [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl +]) + +# _AM_AUTOCONF_VERSION(VERSION) +# ----------------------------- +# aclocal traces this macro to find the Autoconf version. +# This is a private macro too. Using m4_define simplifies +# the logic in aclocal, which can simply ignore this definition. +m4_define([_AM_AUTOCONF_VERSION], []) + +# AM_SET_CURRENT_AUTOMAKE_VERSION +# ------------------------------- +# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. +# This function is AC_REQUIREd by AC_INIT_AUTOMAKE. +AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], +[AM_AUTOMAKE_VERSION([1.10])dnl +_AM_AUTOCONF_VERSION(m4_PACKAGE_VERSION)]) + +# Figure out how to run the assembler. -*- Autoconf -*- + +# Copyright (C) 2001, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 5 + +# AM_PROG_AS +# ---------- +AC_DEFUN([AM_PROG_AS], +[# By default we simply use the C compiler to build assembly code. +AC_REQUIRE([AC_PROG_CC]) +test "${CCAS+set}" = set || CCAS=$CC +test "${CCASFLAGS+set}" = set || CCASFLAGS=$CFLAGS +AC_ARG_VAR([CCAS], [assembler compiler command (defaults to CC)]) +AC_ARG_VAR([CCASFLAGS], [assembler compiler flags (defaults to CFLAGS)]) +_AM_IF_OPTION([no-dependencies],, [_AM_DEPENDENCIES([CCAS])])dnl +]) + +# AM_AUX_DIR_EXPAND -*- Autoconf -*- + +# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets +# $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to +# `$srcdir', `$srcdir/..', or `$srcdir/../..'. +# +# Of course, Automake must honor this variable whenever it calls a +# tool from the auxiliary directory. The problem is that $srcdir (and +# therefore $ac_aux_dir as well) can be either absolute or relative, +# depending on how configure is run. This is pretty annoying, since +# it makes $ac_aux_dir quite unusable in subdirectories: in the top +# source directory, any form will work fine, but in subdirectories a +# relative path needs to be adjusted first. +# +# $ac_aux_dir/missing +# fails when called from a subdirectory if $ac_aux_dir is relative +# $top_srcdir/$ac_aux_dir/missing +# fails if $ac_aux_dir is absolute, +# fails when called from a subdirectory in a VPATH build with +# a relative $ac_aux_dir +# +# The reason of the latter failure is that $top_srcdir and $ac_aux_dir +# are both prefixed by $srcdir. In an in-source build this is usually +# harmless because $srcdir is `.', but things will broke when you +# start a VPATH build or use an absolute $srcdir. +# +# So we could use something similar to $top_srcdir/$ac_aux_dir/missing, +# iff we strip the leading $srcdir from $ac_aux_dir. That would be: +# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` +# and then we would define $MISSING as +# MISSING="\${SHELL} $am_aux_dir/missing" +# This will work as long as MISSING is not called from configure, because +# unfortunately $(top_srcdir) has no meaning in configure. +# However there are other variables, like CC, which are often used in +# configure, and could therefore not use this "fixed" $ac_aux_dir. +# +# Another solution, used here, is to always expand $ac_aux_dir to an +# absolute PATH. The drawback is that using absolute paths prevent a +# configured tree to be moved without reconfiguration. + +AC_DEFUN([AM_AUX_DIR_EXPAND], +[dnl Rely on autoconf to set up CDPATH properly. +AC_PREREQ([2.50])dnl +# expand $ac_aux_dir to an absolute path +am_aux_dir=`cd $ac_aux_dir && pwd` +]) + +# AM_CONDITIONAL -*- Autoconf -*- + +# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 8 + +# AM_CONDITIONAL(NAME, SHELL-CONDITION) +# ------------------------------------- +# Define a conditional. +AC_DEFUN([AM_CONDITIONAL], +[AC_PREREQ(2.52)dnl + ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], + [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl +AC_SUBST([$1_TRUE])dnl +AC_SUBST([$1_FALSE])dnl +_AM_SUBST_NOTMAKE([$1_TRUE])dnl +_AM_SUBST_NOTMAKE([$1_FALSE])dnl +if $2; then + $1_TRUE= + $1_FALSE='#' +else + $1_TRUE='#' + $1_FALSE= +fi +AC_CONFIG_COMMANDS_PRE( +[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then + AC_MSG_ERROR([[conditional "$1" was never defined. +Usually this means the macro was only invoked conditionally.]]) +fi])]) + +# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 9 + +# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be +# written in clear, in which case automake, when reading aclocal.m4, +# will think it sees a *use*, and therefore will trigger all it's +# C support machinery. Also note that it means that autoscan, seeing +# CC etc. in the Makefile, will ask for an AC_PROG_CC use... + + +# _AM_DEPENDENCIES(NAME) +# ---------------------- +# See how the compiler implements dependency checking. +# NAME is "CC", "CXX", "GCJ", or "OBJC". +# We try a few techniques and use that to set a single cache variable. +# +# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was +# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular +# dependency, and given that the user is not expected to run this macro, +# just rely on AC_PROG_CC. +AC_DEFUN([_AM_DEPENDENCIES], +[AC_REQUIRE([AM_SET_DEPDIR])dnl +AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl +AC_REQUIRE([AM_MAKE_INCLUDE])dnl +AC_REQUIRE([AM_DEP_TRACK])dnl + +ifelse([$1], CC, [depcc="$CC" am_compiler_list=], + [$1], CXX, [depcc="$CXX" am_compiler_list=], + [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'], + [$1], UPC, [depcc="$UPC" am_compiler_list=], + [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'], + [depcc="$$1" am_compiler_list=]) + +AC_CACHE_CHECK([dependency style of $depcc], + [am_cv_$1_dependencies_compiler_type], +[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named `D' -- because `-MD' means `put the output + # in D'. + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_$1_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` + fi + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with + # Solaris 8's {/usr,}/bin/sh. + touch sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + case $depmode in + nosideeffect) + # after this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + none) break ;; + esac + # We check with `-c' and `-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle `-M -o', and we need to detect this. + if depmode=$depmode \ + source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_$1_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_$1_dependencies_compiler_type=none +fi +]) +AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) +AM_CONDITIONAL([am__fastdep$1], [ + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) +]) + + +# AM_SET_DEPDIR +# ------------- +# Choose a directory name for dependency files. +# This macro is AC_REQUIREd in _AM_DEPENDENCIES +AC_DEFUN([AM_SET_DEPDIR], +[AC_REQUIRE([AM_SET_LEADING_DOT])dnl +AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl +]) + + +# AM_DEP_TRACK +# ------------ +AC_DEFUN([AM_DEP_TRACK], +[AC_ARG_ENABLE(dependency-tracking, +[ --disable-dependency-tracking speeds up one-time build + --enable-dependency-tracking do not reject slow dependency extractors]) +if test "x$enable_dependency_tracking" != xno; then + am_depcomp="$ac_aux_dir/depcomp" + AMDEPBACKSLASH='\' +fi +AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) +AC_SUBST([AMDEPBACKSLASH])dnl +_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl +]) + +# Generate code to set up dependency tracking. -*- Autoconf -*- + +# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +#serial 3 + +# _AM_OUTPUT_DEPENDENCY_COMMANDS +# ------------------------------ +AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], +[for mf in $CONFIG_FILES; do + # Strip MF so we end up with the name of the file. + mf=`echo "$mf" | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile or not. + # We used to match only the files named `Makefile.in', but + # some people rename them; so instead we look at the file content. + # Grep'ing the first line is not enough: some people post-process + # each Makefile.in and add a new line on top of each file to say so. + # Grep'ing the whole file is not good either: AIX grep has a line + # limit of 2048, but all sed's we know have understand at least 4000. + if sed 10q "$mf" | grep '^#.*generated by automake' > /dev/null 2>&1; then + dirpart=`AS_DIRNAME("$mf")` + else + continue + fi + # Extract the definition of DEPDIR, am__include, and am__quote + # from the Makefile without running `make'. + DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` + test -z "$DEPDIR" && continue + am__include=`sed -n 's/^am__include = //p' < "$mf"` + test -z "am__include" && continue + am__quote=`sed -n 's/^am__quote = //p' < "$mf"` + # When using ansi2knr, U may be empty or an underscore; expand it + U=`sed -n 's/^U = //p' < "$mf"` + # Find all dependency output files, they are included files with + # $(DEPDIR) in their names. We invoke sed twice because it is the + # simplest approach to changing $(DEPDIR) to its actual value in the + # expansion. + for file in `sed -n " + s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ + sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do + # Make sure the directory exists. + test -f "$dirpart/$file" && continue + fdir=`AS_DIRNAME(["$file"])` + AS_MKDIR_P([$dirpart/$fdir]) + # echo "creating $dirpart/$file" + echo '# dummy' > "$dirpart/$file" + done +done +])# _AM_OUTPUT_DEPENDENCY_COMMANDS + + +# AM_OUTPUT_DEPENDENCY_COMMANDS +# ----------------------------- +# This macro should only be invoked once -- use via AC_REQUIRE. +# +# This code is only required when automatic dependency tracking +# is enabled. FIXME. This creates each `.P' file that we will +# need in order to bootstrap the dependency handling code. +AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], +[AC_CONFIG_COMMANDS([depfiles], + [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], + [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) +]) + +# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 8 + +# AM_CONFIG_HEADER is obsolete. It has been replaced by AC_CONFIG_HEADERS. +AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)]) + +# Do all the work for Automake. -*- Autoconf -*- + +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, +# 2005, 2006 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 12 + +# This macro actually does too much. Some checks are only needed if +# your package does certain things. But this isn't really a big deal. + +# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) +# AM_INIT_AUTOMAKE([OPTIONS]) +# ----------------------------------------------- +# The call with PACKAGE and VERSION arguments is the old style +# call (pre autoconf-2.50), which is being phased out. PACKAGE +# and VERSION should now be passed to AC_INIT and removed from +# the call to AM_INIT_AUTOMAKE. +# We support both call styles for the transition. After +# the next Automake release, Autoconf can make the AC_INIT +# arguments mandatory, and then we can depend on a new Autoconf +# release and drop the old call support. +AC_DEFUN([AM_INIT_AUTOMAKE], +[AC_PREREQ([2.60])dnl +dnl Autoconf wants to disallow AM_ names. We explicitly allow +dnl the ones we care about. +m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl +AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl +AC_REQUIRE([AC_PROG_INSTALL])dnl +if test "`cd $srcdir && pwd`" != "`pwd`"; then + # Use -I$(srcdir) only when $(srcdir) != ., so that make's output + # is not polluted with repeated "-I." + AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl + # test to see if srcdir already configured + if test -f $srcdir/config.status; then + AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) + fi +fi + +# test whether we have cygpath +if test -z "$CYGPATH_W"; then + if (cygpath --version) >/dev/null 2>/dev/null; then + CYGPATH_W='cygpath -w' + else + CYGPATH_W=echo + fi +fi +AC_SUBST([CYGPATH_W]) + +# Define the identity of the package. +dnl Distinguish between old-style and new-style calls. +m4_ifval([$2], +[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl + AC_SUBST([PACKAGE], [$1])dnl + AC_SUBST([VERSION], [$2])], +[_AM_SET_OPTIONS([$1])dnl +dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. +m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,, + [m4_fatal([AC_INIT should be called with package and version arguments])])dnl + AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl + AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl + +_AM_IF_OPTION([no-define],, +[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) + AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl + +# Some tools Automake needs. +AC_REQUIRE([AM_SANITY_CHECK])dnl +AC_REQUIRE([AC_ARG_PROGRAM])dnl +AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}) +AM_MISSING_PROG(AUTOCONF, autoconf) +AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) +AM_MISSING_PROG(AUTOHEADER, autoheader) +AM_MISSING_PROG(MAKEINFO, makeinfo) +AM_PROG_INSTALL_SH +AM_PROG_INSTALL_STRIP +AC_REQUIRE([AM_PROG_MKDIR_P])dnl +# We need awk for the "check" target. The system "awk" is bad on +# some platforms. +AC_REQUIRE([AC_PROG_AWK])dnl +AC_REQUIRE([AC_PROG_MAKE_SET])dnl +AC_REQUIRE([AM_SET_LEADING_DOT])dnl +_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], + [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], + [_AM_PROG_TAR([v7])])]) +_AM_IF_OPTION([no-dependencies],, +[AC_PROVIDE_IFELSE([AC_PROG_CC], + [_AM_DEPENDENCIES(CC)], + [define([AC_PROG_CC], + defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl +AC_PROVIDE_IFELSE([AC_PROG_CXX], + [_AM_DEPENDENCIES(CXX)], + [define([AC_PROG_CXX], + defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl +AC_PROVIDE_IFELSE([AC_PROG_OBJC], + [_AM_DEPENDENCIES(OBJC)], + [define([AC_PROG_OBJC], + defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl +]) +]) + + +# When config.status generates a header, we must update the stamp-h file. +# This file resides in the same directory as the config header +# that is generated. The stamp files are numbered to have different names. + +# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the +# loop where config.status creates the headers, so we can generate +# our stamp files there. +AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], +[# Compute $1's index in $config_headers. +_am_stamp_count=1 +for _am_header in $config_headers :; do + case $_am_header in + $1 | $1:* ) + break ;; + * ) + _am_stamp_count=`expr $_am_stamp_count + 1` ;; + esac +done +echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count]) + +# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_PROG_INSTALL_SH +# ------------------ +# Define $install_sh. +AC_DEFUN([AM_PROG_INSTALL_SH], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +install_sh=${install_sh-"\$(SHELL) $am_aux_dir/install-sh"} +AC_SUBST(install_sh)]) + +# Copyright (C) 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 2 + +# Check whether the underlying file-system supports filenames +# with a leading dot. For instance MS-DOS doesn't. +AC_DEFUN([AM_SET_LEADING_DOT], +[rm -rf .tst 2>/dev/null +mkdir .tst 2>/dev/null +if test -d .tst; then + am__leading_dot=. +else + am__leading_dot=_ +fi +rmdir .tst 2>/dev/null +AC_SUBST([am__leading_dot])]) + +# Check to see how 'make' treats includes. -*- Autoconf -*- + +# Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 3 + +# AM_MAKE_INCLUDE() +# ----------------- +# Check to see how make treats includes. +AC_DEFUN([AM_MAKE_INCLUDE], +[am_make=${MAKE-make} +cat > confinc << 'END' +am__doit: + @echo done +.PHONY: am__doit +END +# If we don't find an include directive, just comment out the code. +AC_MSG_CHECKING([for style of include used by $am_make]) +am__include="#" +am__quote= +_am_result=none +# First try GNU make style include. +echo "include confinc" > confmf +# We grep out `Entering directory' and `Leaving directory' +# messages which can occur if `w' ends up in MAKEFLAGS. +# In particular we don't look at `^make:' because GNU make might +# be invoked under some other name (usually "gmake"), in which +# case it prints its new name instead of `make'. +if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then + am__include=include + am__quote= + _am_result=GNU +fi +# Now try BSD make style include. +if test "$am__include" = "#"; then + echo '.include "confinc"' > confmf + if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then + am__include=.include + am__quote="\"" + _am_result=BSD + fi +fi +AC_SUBST([am__include]) +AC_SUBST([am__quote]) +AC_MSG_RESULT([$_am_result]) +rm -f confinc confmf +]) + +# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- + +# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 5 + +# AM_MISSING_PROG(NAME, PROGRAM) +# ------------------------------ +AC_DEFUN([AM_MISSING_PROG], +[AC_REQUIRE([AM_MISSING_HAS_RUN]) +$1=${$1-"${am_missing_run}$2"} +AC_SUBST($1)]) + + +# AM_MISSING_HAS_RUN +# ------------------ +# Define MISSING if not defined so far and test if it supports --run. +# If it does, set am_missing_run to use it, otherwise, to nothing. +AC_DEFUN([AM_MISSING_HAS_RUN], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +AC_REQUIRE_AUX_FILE([missing])dnl +test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" +# Use eval to expand $SHELL +if eval "$MISSING --run true"; then + am_missing_run="$MISSING --run " +else + am_missing_run= + AC_MSG_WARN([`missing' script is too old or missing]) +fi +]) + +# Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_PROG_MKDIR_P +# --------------- +# Check for `mkdir -p'. +AC_DEFUN([AM_PROG_MKDIR_P], +[AC_PREREQ([2.60])dnl +AC_REQUIRE([AC_PROG_MKDIR_P])dnl +dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P, +dnl while keeping a definition of mkdir_p for backward compatibility. +dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile. +dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of +dnl Makefile.ins that do not define MKDIR_P, so we do our own +dnl adjustment using top_builddir (which is defined more often than +dnl MKDIR_P). +AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl +case $mkdir_p in + [[\\/$]]* | ?:[[\\/]]*) ;; + */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; +esac +]) + +# Helper functions for option handling. -*- Autoconf -*- + +# Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 3 + +# _AM_MANGLE_OPTION(NAME) +# ----------------------- +AC_DEFUN([_AM_MANGLE_OPTION], +[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) + +# _AM_SET_OPTION(NAME) +# ------------------------------ +# Set option NAME. Presently that only means defining a flag for this option. +AC_DEFUN([_AM_SET_OPTION], +[m4_define(_AM_MANGLE_OPTION([$1]), 1)]) + +# _AM_SET_OPTIONS(OPTIONS) +# ---------------------------------- +# OPTIONS is a space-separated list of Automake options. +AC_DEFUN([_AM_SET_OPTIONS], +[AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) + +# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) +# ------------------------------------------- +# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. +AC_DEFUN([_AM_IF_OPTION], +[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) + +# Check to make sure that the build environment is sane. -*- Autoconf -*- + +# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 4 + +# AM_SANITY_CHECK +# --------------- +AC_DEFUN([AM_SANITY_CHECK], +[AC_MSG_CHECKING([whether build environment is sane]) +# Just in case +sleep 1 +echo timestamp > conftest.file +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` + if test "$[*]" = "X"; then + # -L didn't work. + set X `ls -t $srcdir/configure conftest.file` + fi + rm -f conftest.file + if test "$[*]" != "X $srcdir/configure conftest.file" \ + && test "$[*]" != "X conftest.file $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken +alias in your environment]) + fi + + test "$[2]" = conftest.file + ) +then + # Ok. + : +else + AC_MSG_ERROR([newly created file is older than distributed files! +Check your system clock]) +fi +AC_MSG_RESULT(yes)]) + +# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_PROG_INSTALL_STRIP +# --------------------- +# One issue with vendor `install' (even GNU) is that you can't +# specify the program used to strip binaries. This is especially +# annoying in cross-compiling environments, where the build's strip +# is unlikely to handle the host's binaries. +# Fortunately install-sh will honor a STRIPPROG variable, so we +# always use install-sh in `make install-strip', and initialize +# STRIPPROG with the value of the STRIP variable (set by the user). +AC_DEFUN([AM_PROG_INSTALL_STRIP], +[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl +# Installed binaries are usually stripped using `strip' when the user +# run `make install-strip'. However `strip' might not be the right +# tool to use in cross-compilation environments, therefore Automake +# will honor the `STRIP' environment variable to overrule this program. +dnl Don't test for $cross_compiling = yes, because it might be `maybe'. +if test "$cross_compiling" != no; then + AC_CHECK_TOOL([STRIP], [strip], :) +fi +INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" +AC_SUBST([INSTALL_STRIP_PROGRAM])]) + +# Copyright (C) 2006 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# _AM_SUBST_NOTMAKE(VARIABLE) +# --------------------------- +# Prevent Automake from outputing VARIABLE = @VARIABLE@ in Makefile.in. +# This macro is traced by Automake. +AC_DEFUN([_AM_SUBST_NOTMAKE]) + +# Check how to create a tarball. -*- Autoconf -*- + +# Copyright (C) 2004, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 2 + +# _AM_PROG_TAR(FORMAT) +# -------------------- +# Check how to create a tarball in format FORMAT. +# FORMAT should be one of `v7', `ustar', or `pax'. +# +# Substitute a variable $(am__tar) that is a command +# writing to stdout a FORMAT-tarball containing the directory +# $tardir. +# tardir=directory && $(am__tar) > result.tar +# +# Substitute a variable $(am__untar) that extract such +# a tarball read from stdin. +# $(am__untar) < result.tar +AC_DEFUN([_AM_PROG_TAR], +[# Always define AMTAR for backward compatibility. +AM_MISSING_PROG([AMTAR], [tar]) +m4_if([$1], [v7], + [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'], + [m4_case([$1], [ustar],, [pax],, + [m4_fatal([Unknown tar format])]) +AC_MSG_CHECKING([how to create a $1 tar archive]) +# Loop over all known methods to create a tar archive until one works. +_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' +_am_tools=${am_cv_prog_tar_$1-$_am_tools} +# Do not fold the above two line into one, because Tru64 sh and +# Solaris sh will not grok spaces in the rhs of `-'. +for _am_tool in $_am_tools +do + case $_am_tool in + gnutar) + for _am_tar in tar gnutar gtar; + do + AM_RUN_LOG([$_am_tar --version]) && break + done + am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' + am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' + am__untar="$_am_tar -xf -" + ;; + plaintar) + # Must skip GNU tar: if it does not support --format= it doesn't create + # ustar tarball either. + (tar --version) >/dev/null 2>&1 && continue + am__tar='tar chf - "$$tardir"' + am__tar_='tar chf - "$tardir"' + am__untar='tar xf -' + ;; + pax) + am__tar='pax -L -x $1 -w "$$tardir"' + am__tar_='pax -L -x $1 -w "$tardir"' + am__untar='pax -r' + ;; + cpio) + am__tar='find "$$tardir" -print | cpio -o -H $1 -L' + am__tar_='find "$tardir" -print | cpio -o -H $1 -L' + am__untar='cpio -i -H $1 -d' + ;; + none) + am__tar=false + am__tar_=false + am__untar=false + ;; + esac + + # If the value was cached, stop now. We just wanted to have am__tar + # and am__untar set. + test -n "${am_cv_prog_tar_$1}" && break + + # tar/untar a dummy directory, and stop if the command works + rm -rf conftest.dir + mkdir conftest.dir + echo GrepMe > conftest.dir/file + AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) + rm -rf conftest.dir + if test -s conftest.tar; then + AM_RUN_LOG([$am__untar /dev/null 2>&1 && break + fi +done +rm -rf conftest.dir + +AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) +AC_MSG_RESULT([$am_cv_prog_tar_$1])]) +AC_SUBST([am__tar]) +AC_SUBST([am__untar]) +]) # _AM_PROG_TAR + +m4_include([acinclude.m4]) diff --git a/builddeb b/builddeb new file mode 100755 index 0000000..5633130 --- /dev/null +++ b/builddeb @@ -0,0 +1,13 @@ +#!/bin/sh + +vers=`cat B/DEBIAN/control | grep Version | sed s/'Version: '//` + +make install DESTDIR=`pwd`/B && +strip B/usr/bin/ksquirrel && +strip B/usr/bin/ksquirrel-libs-configurator-real && +strip B/usr/lib/kde3/libksquirrelpart.so && +dpkg-deb -b B ksquirrel_${vers}_i386.deb && +rm -rf B/usr && +echo +ls -l ksquirrel_${vers}_i386.deb +echo \ No newline at end of file diff --git a/config.guess b/config.guess new file mode 100755 index 0000000..da83314 --- /dev/null +++ b/config.guess @@ -0,0 +1,1561 @@ +#! /bin/sh +# Attempt to guess a canonical system name. +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, +# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 +# Free Software Foundation, Inc. + +timestamp='2009-04-27' + +# This file is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA +# 02110-1301, USA. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + + +# Originally written by Per Bothner . +# Please send patches to . Submit a context +# diff and a properly formatted ChangeLog entry. +# +# This script attempts to guess a canonical system name similar to +# config.sub. If it succeeds, it prints the system name on stdout, and +# exits with 0. Otherwise, it exits with 1. +# +# The plan is that this can be called by configure scripts if you +# don't specify an explicit build system type. + +me=`echo "$0" | sed -e 's,.*/,,'` + +usage="\ +Usage: $0 [OPTION] + +Output the configuration name of the system \`$me' is run on. + +Operation modes: + -h, --help print this help, then exit + -t, --time-stamp print date of last modification, then exit + -v, --version print version number, then exit + +Report bugs and patches to ." + +version="\ +GNU config.guess ($timestamp) + +Originally written by Per Bothner. +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, +2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. + +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." + +help=" +Try \`$me --help' for more information." + +# Parse command line +while test $# -gt 0 ; do + case $1 in + --time-stamp | --time* | -t ) + echo "$timestamp" ; exit ;; + --version | -v ) + echo "$version" ; exit ;; + --help | --h* | -h ) + echo "$usage"; exit ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. + break ;; + -* ) + echo "$me: invalid option $1$help" >&2 + exit 1 ;; + * ) + break ;; + esac +done + +if test $# != 0; then + echo "$me: too many arguments$help" >&2 + exit 1 +fi + +trap 'exit 1' 1 2 15 + +# CC_FOR_BUILD -- compiler used by this script. Note that the use of a +# compiler to aid in system detection is discouraged as it requires +# temporary files to be created and, as you can see below, it is a +# headache to deal with in a portable fashion. + +# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still +# use `HOST_CC' if defined, but it is deprecated. + +# Portable tmp directory creation inspired by the Autoconf team. + +set_cc_for_build=' +trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; +trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; +: ${TMPDIR=/tmp} ; + { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || + { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || + { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || + { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; +dummy=$tmp/dummy ; +tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; +case $CC_FOR_BUILD,$HOST_CC,$CC in + ,,) echo "int x;" > $dummy.c ; + for c in cc gcc c89 c99 ; do + if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then + CC_FOR_BUILD="$c"; break ; + fi ; + done ; + if test x"$CC_FOR_BUILD" = x ; then + CC_FOR_BUILD=no_compiler_found ; + fi + ;; + ,,*) CC_FOR_BUILD=$CC ;; + ,*,*) CC_FOR_BUILD=$HOST_CC ;; +esac ; set_cc_for_build= ;' + +# This is needed to find uname on a Pyramid OSx when run in the BSD universe. +# (ghazi@noc.rutgers.edu 1994-08-24) +if (test -f /.attbin/uname) >/dev/null 2>&1 ; then + PATH=$PATH:/.attbin ; export PATH +fi + +UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown +UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown +UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown +UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown + +# Note: order is significant - the case branches are not exclusive. + +case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in + *:NetBSD:*:*) + # NetBSD (nbsd) targets should (where applicable) match one or + # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, + # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently + # switched to ELF, *-*-netbsd* would select the old + # object file format. This provides both forward + # compatibility and a consistent mechanism for selecting the + # object file format. + # + # Note: NetBSD doesn't particularly care about the vendor + # portion of the name. We always set it to "unknown". + sysctl="sysctl -n hw.machine_arch" + UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ + /usr/sbin/$sysctl 2>/dev/null || echo unknown)` + case "${UNAME_MACHINE_ARCH}" in + armeb) machine=armeb-unknown ;; + arm*) machine=arm-unknown ;; + sh3el) machine=shl-unknown ;; + sh3eb) machine=sh-unknown ;; + sh5el) machine=sh5le-unknown ;; + *) machine=${UNAME_MACHINE_ARCH}-unknown ;; + esac + # The Operating System including object format, if it has switched + # to ELF recently, or will in the future. + case "${UNAME_MACHINE_ARCH}" in + arm*|i386|m68k|ns32k|sh3*|sparc|vax) + eval $set_cc_for_build + if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep __ELF__ >/dev/null + then + # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). + # Return netbsd for either. FIX? + os=netbsd + else + os=netbsdelf + fi + ;; + *) + os=netbsd + ;; + esac + # The OS release + # Debian GNU/NetBSD machines have a different userland, and + # thus, need a distinct triplet. However, they do not need + # kernel version information, so it can be replaced with a + # suitable tag, in the style of linux-gnu. + case "${UNAME_VERSION}" in + Debian*) + release='-gnu' + ;; + *) + release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` + ;; + esac + # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: + # contains redundant information, the shorter form: + # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. + echo "${machine}-${os}${release}" + exit ;; + *:OpenBSD:*:*) + UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` + echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} + exit ;; + *:ekkoBSD:*:*) + echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} + exit ;; + *:SolidBSD:*:*) + echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} + exit ;; + macppc:MirBSD:*:*) + echo powerpc-unknown-mirbsd${UNAME_RELEASE} + exit ;; + *:MirBSD:*:*) + echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} + exit ;; + alpha:OSF1:*:*) + case $UNAME_RELEASE in + *4.0) + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` + ;; + *5.*) + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` + ;; + esac + # According to Compaq, /usr/sbin/psrinfo has been available on + # OSF/1 and Tru64 systems produced since 1995. I hope that + # covers most systems running today. This code pipes the CPU + # types through head -n 1, so we only detect the type of CPU 0. + ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` + case "$ALPHA_CPU_TYPE" in + "EV4 (21064)") + UNAME_MACHINE="alpha" ;; + "EV4.5 (21064)") + UNAME_MACHINE="alpha" ;; + "LCA4 (21066/21068)") + UNAME_MACHINE="alpha" ;; + "EV5 (21164)") + UNAME_MACHINE="alphaev5" ;; + "EV5.6 (21164A)") + UNAME_MACHINE="alphaev56" ;; + "EV5.6 (21164PC)") + UNAME_MACHINE="alphapca56" ;; + "EV5.7 (21164PC)") + UNAME_MACHINE="alphapca57" ;; + "EV6 (21264)") + UNAME_MACHINE="alphaev6" ;; + "EV6.7 (21264A)") + UNAME_MACHINE="alphaev67" ;; + "EV6.8CB (21264C)") + UNAME_MACHINE="alphaev68" ;; + "EV6.8AL (21264B)") + UNAME_MACHINE="alphaev68" ;; + "EV6.8CX (21264D)") + UNAME_MACHINE="alphaev68" ;; + "EV6.9A (21264/EV69A)") + UNAME_MACHINE="alphaev69" ;; + "EV7 (21364)") + UNAME_MACHINE="alphaev7" ;; + "EV7.9 (21364A)") + UNAME_MACHINE="alphaev79" ;; + esac + # A Pn.n version is a patched version. + # A Vn.n version is a released version. + # A Tn.n version is a released field test version. + # A Xn.n version is an unreleased experimental baselevel. + # 1.2 uses "1.2" for uname -r. + echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + exit ;; + Alpha\ *:Windows_NT*:*) + # How do we know it's Interix rather than the generic POSIX subsystem? + # Should we change UNAME_MACHINE based on the output of uname instead + # of the specific Alpha model? + echo alpha-pc-interix + exit ;; + 21064:Windows_NT:50:3) + echo alpha-dec-winnt3.5 + exit ;; + Amiga*:UNIX_System_V:4.0:*) + echo m68k-unknown-sysv4 + exit ;; + *:[Aa]miga[Oo][Ss]:*:*) + echo ${UNAME_MACHINE}-unknown-amigaos + exit ;; + *:[Mm]orph[Oo][Ss]:*:*) + echo ${UNAME_MACHINE}-unknown-morphos + exit ;; + *:OS/390:*:*) + echo i370-ibm-openedition + exit ;; + *:z/VM:*:*) + echo s390-ibm-zvmoe + exit ;; + *:OS400:*:*) + echo powerpc-ibm-os400 + exit ;; + arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) + echo arm-acorn-riscix${UNAME_RELEASE} + exit ;; + arm:riscos:*:*|arm:RISCOS:*:*) + echo arm-unknown-riscos + exit ;; + SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) + echo hppa1.1-hitachi-hiuxmpp + exit ;; + Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) + # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. + if test "`(/bin/universe) 2>/dev/null`" = att ; then + echo pyramid-pyramid-sysv3 + else + echo pyramid-pyramid-bsd + fi + exit ;; + NILE*:*:*:dcosx) + echo pyramid-pyramid-svr4 + exit ;; + DRS?6000:unix:4.0:6*) + echo sparc-icl-nx6 + exit ;; + DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) + case `/usr/bin/uname -p` in + sparc) echo sparc-icl-nx7; exit ;; + esac ;; + s390x:SunOS:*:*) + echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + sun4H:SunOS:5.*:*) + echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) + echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) + eval $set_cc_for_build + SUN_ARCH="i386" + # If there is a compiler, see if it is configured for 64-bit objects. + # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. + # This test works for both compilers. + if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then + if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ + (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_64BIT_ARCH >/dev/null + then + SUN_ARCH="x86_64" + fi + fi + echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + sun4*:SunOS:6*:*) + # According to config.sub, this is the proper way to canonicalize + # SunOS6. Hard to guess exactly what SunOS6 will be like, but + # it's likely to be more like Solaris than SunOS4. + echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + sun4*:SunOS:*:*) + case "`/usr/bin/arch -k`" in + Series*|S4*) + UNAME_RELEASE=`uname -v` + ;; + esac + # Japanese Language versions have a version number like `4.1.3-JL'. + echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` + exit ;; + sun3*:SunOS:*:*) + echo m68k-sun-sunos${UNAME_RELEASE} + exit ;; + sun*:*:4.2BSD:*) + UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` + test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 + case "`/bin/arch`" in + sun3) + echo m68k-sun-sunos${UNAME_RELEASE} + ;; + sun4) + echo sparc-sun-sunos${UNAME_RELEASE} + ;; + esac + exit ;; + aushp:SunOS:*:*) + echo sparc-auspex-sunos${UNAME_RELEASE} + exit ;; + # The situation for MiNT is a little confusing. The machine name + # can be virtually everything (everything which is not + # "atarist" or "atariste" at least should have a processor + # > m68000). The system name ranges from "MiNT" over "FreeMiNT" + # to the lowercase version "mint" (or "freemint"). Finally + # the system name "TOS" denotes a system which is actually not + # MiNT. But MiNT is downward compatible to TOS, so this should + # be no problem. + atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit ;; + atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit ;; + *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit ;; + milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) + echo m68k-milan-mint${UNAME_RELEASE} + exit ;; + hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) + echo m68k-hades-mint${UNAME_RELEASE} + exit ;; + *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) + echo m68k-unknown-mint${UNAME_RELEASE} + exit ;; + m68k:machten:*:*) + echo m68k-apple-machten${UNAME_RELEASE} + exit ;; + powerpc:machten:*:*) + echo powerpc-apple-machten${UNAME_RELEASE} + exit ;; + RISC*:Mach:*:*) + echo mips-dec-mach_bsd4.3 + exit ;; + RISC*:ULTRIX:*:*) + echo mips-dec-ultrix${UNAME_RELEASE} + exit ;; + VAX*:ULTRIX*:*:*) + echo vax-dec-ultrix${UNAME_RELEASE} + exit ;; + 2020:CLIX:*:* | 2430:CLIX:*:*) + echo clipper-intergraph-clix${UNAME_RELEASE} + exit ;; + mips:*:*:UMIPS | mips:*:*:RISCos) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c +#ifdef __cplusplus +#include /* for printf() prototype */ + int main (int argc, char *argv[]) { +#else + int main (argc, argv) int argc; char *argv[]; { +#endif + #if defined (host_mips) && defined (MIPSEB) + #if defined (SYSTYPE_SYSV) + printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); + #endif + #if defined (SYSTYPE_SVR4) + printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); + #endif + #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) + printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); + #endif + #endif + exit (-1); + } +EOF + $CC_FOR_BUILD -o $dummy $dummy.c && + dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && + SYSTEM_NAME=`$dummy $dummyarg` && + { echo "$SYSTEM_NAME"; exit; } + echo mips-mips-riscos${UNAME_RELEASE} + exit ;; + Motorola:PowerMAX_OS:*:*) + echo powerpc-motorola-powermax + exit ;; + Motorola:*:4.3:PL8-*) + echo powerpc-harris-powermax + exit ;; + Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) + echo powerpc-harris-powermax + exit ;; + Night_Hawk:Power_UNIX:*:*) + echo powerpc-harris-powerunix + exit ;; + m88k:CX/UX:7*:*) + echo m88k-harris-cxux7 + exit ;; + m88k:*:4*:R4*) + echo m88k-motorola-sysv4 + exit ;; + m88k:*:3*:R3*) + echo m88k-motorola-sysv3 + exit ;; + AViiON:dgux:*:*) + # DG/UX returns AViiON for all architectures + UNAME_PROCESSOR=`/usr/bin/uname -p` + if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] + then + if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ + [ ${TARGET_BINARY_INTERFACE}x = x ] + then + echo m88k-dg-dgux${UNAME_RELEASE} + else + echo m88k-dg-dguxbcs${UNAME_RELEASE} + fi + else + echo i586-dg-dgux${UNAME_RELEASE} + fi + exit ;; + M88*:DolphinOS:*:*) # DolphinOS (SVR3) + echo m88k-dolphin-sysv3 + exit ;; + M88*:*:R3*:*) + # Delta 88k system running SVR3 + echo m88k-motorola-sysv3 + exit ;; + XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) + echo m88k-tektronix-sysv3 + exit ;; + Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) + echo m68k-tektronix-bsd + exit ;; + *:IRIX*:*:*) + echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` + exit ;; + ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. + echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id + exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' + i*86:AIX:*:*) + echo i386-ibm-aix + exit ;; + ia64:AIX:*:*) + if [ -x /usr/bin/oslevel ] ; then + IBM_REV=`/usr/bin/oslevel` + else + IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} + fi + echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} + exit ;; + *:AIX:2:3) + if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include + + main() + { + if (!__power_pc()) + exit(1); + puts("powerpc-ibm-aix3.2.5"); + exit(0); + } +EOF + if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` + then + echo "$SYSTEM_NAME" + else + echo rs6000-ibm-aix3.2.5 + fi + elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then + echo rs6000-ibm-aix3.2.4 + else + echo rs6000-ibm-aix3.2 + fi + exit ;; + *:AIX:*:[456]) + IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` + if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then + IBM_ARCH=rs6000 + else + IBM_ARCH=powerpc + fi + if [ -x /usr/bin/oslevel ] ; then + IBM_REV=`/usr/bin/oslevel` + else + IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} + fi + echo ${IBM_ARCH}-ibm-aix${IBM_REV} + exit ;; + *:AIX:*:*) + echo rs6000-ibm-aix + exit ;; + ibmrt:4.4BSD:*|romp-ibm:BSD:*) + echo romp-ibm-bsd4.4 + exit ;; + ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and + echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to + exit ;; # report: romp-ibm BSD 4.3 + *:BOSX:*:*) + echo rs6000-bull-bosx + exit ;; + DPX/2?00:B.O.S.:*:*) + echo m68k-bull-sysv3 + exit ;; + 9000/[34]??:4.3bsd:1.*:*) + echo m68k-hp-bsd + exit ;; + hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) + echo m68k-hp-bsd4.4 + exit ;; + 9000/[34678]??:HP-UX:*:*) + HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` + case "${UNAME_MACHINE}" in + 9000/31? ) HP_ARCH=m68000 ;; + 9000/[34]?? ) HP_ARCH=m68k ;; + 9000/[678][0-9][0-9]) + if [ -x /usr/bin/getconf ]; then + sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` + sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` + case "${sc_cpu_version}" in + 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 + 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 + 532) # CPU_PA_RISC2_0 + case "${sc_kernel_bits}" in + 32) HP_ARCH="hppa2.0n" ;; + 64) HP_ARCH="hppa2.0w" ;; + '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 + esac ;; + esac + fi + if [ "${HP_ARCH}" = "" ]; then + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + + #define _HPUX_SOURCE + #include + #include + + int main () + { + #if defined(_SC_KERNEL_BITS) + long bits = sysconf(_SC_KERNEL_BITS); + #endif + long cpu = sysconf (_SC_CPU_VERSION); + + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1"); break; + case CPU_PA_RISC2_0: + #if defined(_SC_KERNEL_BITS) + switch (bits) + { + case 64: puts ("hppa2.0w"); break; + case 32: puts ("hppa2.0n"); break; + default: puts ("hppa2.0"); break; + } break; + #else /* !defined(_SC_KERNEL_BITS) */ + puts ("hppa2.0"); break; + #endif + default: puts ("hppa1.0"); break; + } + exit (0); + } +EOF + (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` + test -z "$HP_ARCH" && HP_ARCH=hppa + fi ;; + esac + if [ ${HP_ARCH} = "hppa2.0w" ] + then + eval $set_cc_for_build + + # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating + # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler + # generating 64-bit code. GNU and HP use different nomenclature: + # + # $ CC_FOR_BUILD=cc ./config.guess + # => hppa2.0w-hp-hpux11.23 + # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess + # => hppa64-hp-hpux11.23 + + if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | + grep __LP64__ >/dev/null + then + HP_ARCH="hppa2.0w" + else + HP_ARCH="hppa64" + fi + fi + echo ${HP_ARCH}-hp-hpux${HPUX_REV} + exit ;; + ia64:HP-UX:*:*) + HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` + echo ia64-hp-hpux${HPUX_REV} + exit ;; + 3050*:HI-UX:*:*) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include + int + main () + { + long cpu = sysconf (_SC_CPU_VERSION); + /* The order matters, because CPU_IS_HP_MC68K erroneously returns + true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct + results, however. */ + if (CPU_IS_PA_RISC (cpu)) + { + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; + case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; + default: puts ("hppa-hitachi-hiuxwe2"); break; + } + } + else if (CPU_IS_HP_MC68K (cpu)) + puts ("m68k-hitachi-hiuxwe2"); + else puts ("unknown-hitachi-hiuxwe2"); + exit (0); + } +EOF + $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && + { echo "$SYSTEM_NAME"; exit; } + echo unknown-hitachi-hiuxwe2 + exit ;; + 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) + echo hppa1.1-hp-bsd + exit ;; + 9000/8??:4.3bsd:*:*) + echo hppa1.0-hp-bsd + exit ;; + *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) + echo hppa1.0-hp-mpeix + exit ;; + hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) + echo hppa1.1-hp-osf + exit ;; + hp8??:OSF1:*:*) + echo hppa1.0-hp-osf + exit ;; + i*86:OSF1:*:*) + if [ -x /usr/sbin/sysversion ] ; then + echo ${UNAME_MACHINE}-unknown-osf1mk + else + echo ${UNAME_MACHINE}-unknown-osf1 + fi + exit ;; + parisc*:Lites*:*:*) + echo hppa1.1-hp-lites + exit ;; + C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) + echo c1-convex-bsd + exit ;; + C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) + if getsysinfo -f scalar_acc + then echo c32-convex-bsd + else echo c2-convex-bsd + fi + exit ;; + C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) + echo c34-convex-bsd + exit ;; + C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) + echo c38-convex-bsd + exit ;; + C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) + echo c4-convex-bsd + exit ;; + CRAY*Y-MP:*:*:*) + echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*[A-Z]90:*:*:*) + echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ + | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ + -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ + -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*TS:*:*:*) + echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*T3E:*:*:*) + echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*SV1:*:*:*) + echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + *:UNICOS/mp:*:*) + echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) + FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` + FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` + echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + exit ;; + 5000:UNIX_System_V:4.*:*) + FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` + FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` + echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + exit ;; + i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) + echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} + exit ;; + sparc*:BSD/OS:*:*) + echo sparc-unknown-bsdi${UNAME_RELEASE} + exit ;; + *:BSD/OS:*:*) + echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} + exit ;; + *:FreeBSD:*:*) + case ${UNAME_MACHINE} in + pc98) + echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + amd64) + echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + *) + echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + esac + exit ;; + i*:CYGWIN*:*) + echo ${UNAME_MACHINE}-pc-cygwin + exit ;; + *:MINGW*:*) + echo ${UNAME_MACHINE}-pc-mingw32 + exit ;; + i*:windows32*:*) + # uname -m includes "-pc" on this system. + echo ${UNAME_MACHINE}-mingw32 + exit ;; + i*:PW*:*) + echo ${UNAME_MACHINE}-pc-pw32 + exit ;; + *:Interix*:[3456]*) + case ${UNAME_MACHINE} in + x86) + echo i586-pc-interix${UNAME_RELEASE} + exit ;; + EM64T | authenticamd | genuineintel) + echo x86_64-unknown-interix${UNAME_RELEASE} + exit ;; + IA64) + echo ia64-unknown-interix${UNAME_RELEASE} + exit ;; + esac ;; + [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) + echo i${UNAME_MACHINE}-pc-mks + exit ;; + i*:Windows_NT*:* | Pentium*:Windows_NT*:*) + # How do we know it's Interix rather than the generic POSIX subsystem? + # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we + # UNAME_MACHINE based on the output of uname instead of i386? + echo i586-pc-interix + exit ;; + i*:UWIN*:*) + echo ${UNAME_MACHINE}-pc-uwin + exit ;; + amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) + echo x86_64-unknown-cygwin + exit ;; + p*:CYGWIN*:*) + echo powerpcle-unknown-cygwin + exit ;; + prep*:SunOS:5.*:*) + echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + *:GNU:*:*) + # the GNU system + echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` + exit ;; + *:GNU/*:*:*) + # other systems with GNU libc and userland + echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu + exit ;; + i*86:Minix:*:*) + echo ${UNAME_MACHINE}-pc-minix + exit ;; + arm*:Linux:*:*) + eval $set_cc_for_build + if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ARM_EABI__ + then + echo ${UNAME_MACHINE}-unknown-linux-gnu + else + echo ${UNAME_MACHINE}-unknown-linux-gnueabi + fi + exit ;; + avr32*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + cris:Linux:*:*) + echo cris-axis-linux-gnu + exit ;; + crisv32:Linux:*:*) + echo crisv32-axis-linux-gnu + exit ;; + frv:Linux:*:*) + echo frv-unknown-linux-gnu + exit ;; + ia64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + m32r*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + m68*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + mips:Linux:*:*) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #undef CPU + #undef mips + #undef mipsel + #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) + CPU=mipsel + #else + #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) + CPU=mips + #else + CPU= + #endif + #endif +EOF + eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' + /^CPU/{ + s: ::g + p + }'`" + test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } + ;; + mips64:Linux:*:*) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #undef CPU + #undef mips64 + #undef mips64el + #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) + CPU=mips64el + #else + #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) + CPU=mips64 + #else + CPU= + #endif + #endif +EOF + eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' + /^CPU/{ + s: ::g + p + }'`" + test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } + ;; + or32:Linux:*:*) + echo or32-unknown-linux-gnu + exit ;; + ppc:Linux:*:*) + echo powerpc-unknown-linux-gnu + exit ;; + ppc64:Linux:*:*) + echo powerpc64-unknown-linux-gnu + exit ;; + alpha:Linux:*:*) + case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in + EV5) UNAME_MACHINE=alphaev5 ;; + EV56) UNAME_MACHINE=alphaev56 ;; + PCA56) UNAME_MACHINE=alphapca56 ;; + PCA57) UNAME_MACHINE=alphapca56 ;; + EV6) UNAME_MACHINE=alphaev6 ;; + EV67) UNAME_MACHINE=alphaev67 ;; + EV68*) UNAME_MACHINE=alphaev68 ;; + esac + objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null + if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi + echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} + exit ;; + padre:Linux:*:*) + echo sparc-unknown-linux-gnu + exit ;; + parisc:Linux:*:* | hppa:Linux:*:*) + # Look for CPU level + case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in + PA7*) echo hppa1.1-unknown-linux-gnu ;; + PA8*) echo hppa2.0-unknown-linux-gnu ;; + *) echo hppa-unknown-linux-gnu ;; + esac + exit ;; + parisc64:Linux:*:* | hppa64:Linux:*:*) + echo hppa64-unknown-linux-gnu + exit ;; + s390:Linux:*:* | s390x:Linux:*:*) + echo ${UNAME_MACHINE}-ibm-linux + exit ;; + sh64*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + sh*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + sparc:Linux:*:* | sparc64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + vax:Linux:*:*) + echo ${UNAME_MACHINE}-dec-linux-gnu + exit ;; + x86_64:Linux:*:*) + echo x86_64-unknown-linux-gnu + exit ;; + xtensa*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + i*86:Linux:*:*) + # The BFD linker knows what the default object file format is, so + # first see if it will tell us. cd to the root directory to prevent + # problems with other programs or directories called `ld' in the path. + # Set LC_ALL=C to ensure ld outputs messages in English. + ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \ + | sed -ne '/supported targets:/!d + s/[ ][ ]*/ /g + s/.*supported targets: *// + s/ .*// + p'` + case "$ld_supported_targets" in + elf32-i386) + TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu" + ;; + a.out-i386-linux) + echo "${UNAME_MACHINE}-pc-linux-gnuaout" + exit ;; + "") + # Either a pre-BFD a.out linker (linux-gnuoldld) or + # one that does not give us useful --help. + echo "${UNAME_MACHINE}-pc-linux-gnuoldld" + exit ;; + esac + # Determine whether the default compiler is a.out or elf + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include + #ifdef __ELF__ + # ifdef __GLIBC__ + # if __GLIBC__ >= 2 + LIBC=gnu + # else + LIBC=gnulibc1 + # endif + # else + LIBC=gnulibc1 + # endif + #else + #if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC) + LIBC=gnu + #else + LIBC=gnuaout + #endif + #endif + #ifdef __dietlibc__ + LIBC=dietlibc + #endif +EOF + eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' + /^LIBC/{ + s: ::g + p + }'`" + test x"${LIBC}" != x && { + echo "${UNAME_MACHINE}-pc-linux-${LIBC}" + exit + } + test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; } + ;; + i*86:DYNIX/ptx:4*:*) + # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. + # earlier versions are messed up and put the nodename in both + # sysname and nodename. + echo i386-sequent-sysv4 + exit ;; + i*86:UNIX_SV:4.2MP:2.*) + # Unixware is an offshoot of SVR4, but it has its own version + # number series starting with 2... + # I am not positive that other SVR4 systems won't match this, + # I just have to hope. -- rms. + # Use sysv4.2uw... so that sysv4* matches it. + echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} + exit ;; + i*86:OS/2:*:*) + # If we were able to find `uname', then EMX Unix compatibility + # is probably installed. + echo ${UNAME_MACHINE}-pc-os2-emx + exit ;; + i*86:XTS-300:*:STOP) + echo ${UNAME_MACHINE}-unknown-stop + exit ;; + i*86:atheos:*:*) + echo ${UNAME_MACHINE}-unknown-atheos + exit ;; + i*86:syllable:*:*) + echo ${UNAME_MACHINE}-pc-syllable + exit ;; + i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*) + echo i386-unknown-lynxos${UNAME_RELEASE} + exit ;; + i*86:*DOS:*:*) + echo ${UNAME_MACHINE}-pc-msdosdjgpp + exit ;; + i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) + UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` + if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then + echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} + else + echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} + fi + exit ;; + i*86:*:5:[678]*) + # UnixWare 7.x, OpenUNIX and OpenServer 6. + case `/bin/uname -X | grep "^Machine"` in + *486*) UNAME_MACHINE=i486 ;; + *Pentium) UNAME_MACHINE=i586 ;; + *Pent*|*Celeron) UNAME_MACHINE=i686 ;; + esac + echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} + exit ;; + i*86:*:3.2:*) + if test -f /usr/options/cb.name; then + UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then + UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` + (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 + (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ + && UNAME_MACHINE=i586 + (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ + && UNAME_MACHINE=i686 + (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ + && UNAME_MACHINE=i686 + echo ${UNAME_MACHINE}-pc-sco$UNAME_REL + else + echo ${UNAME_MACHINE}-pc-sysv32 + fi + exit ;; + pc:*:*:*) + # Left here for compatibility: + # uname -m prints for DJGPP always 'pc', but it prints nothing about + # the processor, so we play safe by assuming i586. + # Note: whatever this is, it MUST be the same as what config.sub + # prints for the "djgpp" host, or else GDB configury will decide that + # this is a cross-build. + echo i586-pc-msdosdjgpp + exit ;; + Intel:Mach:3*:*) + echo i386-pc-mach3 + exit ;; + paragon:*:*:*) + echo i860-intel-osf1 + exit ;; + i860:*:4.*:*) # i860-SVR4 + if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then + echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 + else # Add other i860-SVR4 vendors below as they are discovered. + echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 + fi + exit ;; + mini*:CTIX:SYS*5:*) + # "miniframe" + echo m68010-convergent-sysv + exit ;; + mc68k:UNIX:SYSTEM5:3.51m) + echo m68k-convergent-sysv + exit ;; + M680?0:D-NIX:5.3:*) + echo m68k-diab-dnix + exit ;; + M68*:*:R3V[5678]*:*) + test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; + 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) + OS_REL='' + test -r /etc/.relid \ + && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4.3${OS_REL}; exit; } + /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ + && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; + 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4; exit; } ;; + NCR*:*:4.2:* | MPRAS*:*:4.2:*) + OS_REL='.3' + test -r /etc/.relid \ + && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4.3${OS_REL}; exit; } + /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ + && { echo i586-ncr-sysv4.3${OS_REL}; exit; } + /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ + && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; + m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) + echo m68k-unknown-lynxos${UNAME_RELEASE} + exit ;; + mc68030:UNIX_System_V:4.*:*) + echo m68k-atari-sysv4 + exit ;; + TSUNAMI:LynxOS:2.*:*) + echo sparc-unknown-lynxos${UNAME_RELEASE} + exit ;; + rs6000:LynxOS:2.*:*) + echo rs6000-unknown-lynxos${UNAME_RELEASE} + exit ;; + PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*) + echo powerpc-unknown-lynxos${UNAME_RELEASE} + exit ;; + SM[BE]S:UNIX_SV:*:*) + echo mips-dde-sysv${UNAME_RELEASE} + exit ;; + RM*:ReliantUNIX-*:*:*) + echo mips-sni-sysv4 + exit ;; + RM*:SINIX-*:*:*) + echo mips-sni-sysv4 + exit ;; + *:SINIX-*:*:*) + if uname -p 2>/dev/null >/dev/null ; then + UNAME_MACHINE=`(uname -p) 2>/dev/null` + echo ${UNAME_MACHINE}-sni-sysv4 + else + echo ns32k-sni-sysv + fi + exit ;; + PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort + # says + echo i586-unisys-sysv4 + exit ;; + *:UNIX_System_V:4*:FTX*) + # From Gerald Hewes . + # How about differentiating between stratus architectures? -djm + echo hppa1.1-stratus-sysv4 + exit ;; + *:*:*:FTX*) + # From seanf@swdc.stratus.com. + echo i860-stratus-sysv4 + exit ;; + i*86:VOS:*:*) + # From Paul.Green@stratus.com. + echo ${UNAME_MACHINE}-stratus-vos + exit ;; + *:VOS:*:*) + # From Paul.Green@stratus.com. + echo hppa1.1-stratus-vos + exit ;; + mc68*:A/UX:*:*) + echo m68k-apple-aux${UNAME_RELEASE} + exit ;; + news*:NEWS-OS:6*:*) + echo mips-sony-newsos6 + exit ;; + R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) + if [ -d /usr/nec ]; then + echo mips-nec-sysv${UNAME_RELEASE} + else + echo mips-unknown-sysv${UNAME_RELEASE} + fi + exit ;; + BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. + echo powerpc-be-beos + exit ;; + BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. + echo powerpc-apple-beos + exit ;; + BePC:BeOS:*:*) # BeOS running on Intel PC compatible. + echo i586-pc-beos + exit ;; + BePC:Haiku:*:*) # Haiku running on Intel PC compatible. + echo i586-pc-haiku + exit ;; + SX-4:SUPER-UX:*:*) + echo sx4-nec-superux${UNAME_RELEASE} + exit ;; + SX-5:SUPER-UX:*:*) + echo sx5-nec-superux${UNAME_RELEASE} + exit ;; + SX-6:SUPER-UX:*:*) + echo sx6-nec-superux${UNAME_RELEASE} + exit ;; + SX-7:SUPER-UX:*:*) + echo sx7-nec-superux${UNAME_RELEASE} + exit ;; + SX-8:SUPER-UX:*:*) + echo sx8-nec-superux${UNAME_RELEASE} + exit ;; + SX-8R:SUPER-UX:*:*) + echo sx8r-nec-superux${UNAME_RELEASE} + exit ;; + Power*:Rhapsody:*:*) + echo powerpc-apple-rhapsody${UNAME_RELEASE} + exit ;; + *:Rhapsody:*:*) + echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} + exit ;; + *:Darwin:*:*) + UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown + case $UNAME_PROCESSOR in + unknown) UNAME_PROCESSOR=powerpc ;; + esac + echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} + exit ;; + *:procnto*:*:* | *:QNX:[0123456789]*:*) + UNAME_PROCESSOR=`uname -p` + if test "$UNAME_PROCESSOR" = "x86"; then + UNAME_PROCESSOR=i386 + UNAME_MACHINE=pc + fi + echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} + exit ;; + *:QNX:*:4*) + echo i386-pc-qnx + exit ;; + NSE-?:NONSTOP_KERNEL:*:*) + echo nse-tandem-nsk${UNAME_RELEASE} + exit ;; + NSR-?:NONSTOP_KERNEL:*:*) + echo nsr-tandem-nsk${UNAME_RELEASE} + exit ;; + *:NonStop-UX:*:*) + echo mips-compaq-nonstopux + exit ;; + BS2000:POSIX*:*:*) + echo bs2000-siemens-sysv + exit ;; + DS/*:UNIX_System_V:*:*) + echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} + exit ;; + *:Plan9:*:*) + # "uname -m" is not consistent, so use $cputype instead. 386 + # is converted to i386 for consistency with other x86 + # operating systems. + if test "$cputype" = "386"; then + UNAME_MACHINE=i386 + else + UNAME_MACHINE="$cputype" + fi + echo ${UNAME_MACHINE}-unknown-plan9 + exit ;; + *:TOPS-10:*:*) + echo pdp10-unknown-tops10 + exit ;; + *:TENEX:*:*) + echo pdp10-unknown-tenex + exit ;; + KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) + echo pdp10-dec-tops20 + exit ;; + XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) + echo pdp10-xkl-tops20 + exit ;; + *:TOPS-20:*:*) + echo pdp10-unknown-tops20 + exit ;; + *:ITS:*:*) + echo pdp10-unknown-its + exit ;; + SEI:*:*:SEIUX) + echo mips-sei-seiux${UNAME_RELEASE} + exit ;; + *:DragonFly:*:*) + echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` + exit ;; + *:*VMS:*:*) + UNAME_MACHINE=`(uname -p) 2>/dev/null` + case "${UNAME_MACHINE}" in + A*) echo alpha-dec-vms ; exit ;; + I*) echo ia64-dec-vms ; exit ;; + V*) echo vax-dec-vms ; exit ;; + esac ;; + *:XENIX:*:SysV) + echo i386-pc-xenix + exit ;; + i*86:skyos:*:*) + echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' + exit ;; + i*86:rdos:*:*) + echo ${UNAME_MACHINE}-pc-rdos + exit ;; + i*86:AROS:*:*) + echo ${UNAME_MACHINE}-pc-aros + exit ;; +esac + +#echo '(No uname command or uname output not recognized.)' 1>&2 +#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 + +eval $set_cc_for_build +cat >$dummy.c < +# include +#endif +main () +{ +#if defined (sony) +#if defined (MIPSEB) + /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, + I don't know.... */ + printf ("mips-sony-bsd\n"); exit (0); +#else +#include + printf ("m68k-sony-newsos%s\n", +#ifdef NEWSOS4 + "4" +#else + "" +#endif + ); exit (0); +#endif +#endif + +#if defined (__arm) && defined (__acorn) && defined (__unix) + printf ("arm-acorn-riscix\n"); exit (0); +#endif + +#if defined (hp300) && !defined (hpux) + printf ("m68k-hp-bsd\n"); exit (0); +#endif + +#if defined (NeXT) +#if !defined (__ARCHITECTURE__) +#define __ARCHITECTURE__ "m68k" +#endif + int version; + version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; + if (version < 4) + printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); + else + printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); + exit (0); +#endif + +#if defined (MULTIMAX) || defined (n16) +#if defined (UMAXV) + printf ("ns32k-encore-sysv\n"); exit (0); +#else +#if defined (CMU) + printf ("ns32k-encore-mach\n"); exit (0); +#else + printf ("ns32k-encore-bsd\n"); exit (0); +#endif +#endif +#endif + +#if defined (__386BSD__) + printf ("i386-pc-bsd\n"); exit (0); +#endif + +#if defined (sequent) +#if defined (i386) + printf ("i386-sequent-dynix\n"); exit (0); +#endif +#if defined (ns32000) + printf ("ns32k-sequent-dynix\n"); exit (0); +#endif +#endif + +#if defined (_SEQUENT_) + struct utsname un; + + uname(&un); + + if (strncmp(un.version, "V2", 2) == 0) { + printf ("i386-sequent-ptx2\n"); exit (0); + } + if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ + printf ("i386-sequent-ptx1\n"); exit (0); + } + printf ("i386-sequent-ptx\n"); exit (0); + +#endif + +#if defined (vax) +# if !defined (ultrix) +# include +# if defined (BSD) +# if BSD == 43 + printf ("vax-dec-bsd4.3\n"); exit (0); +# else +# if BSD == 199006 + printf ("vax-dec-bsd4.3reno\n"); exit (0); +# else + printf ("vax-dec-bsd\n"); exit (0); +# endif +# endif +# else + printf ("vax-dec-bsd\n"); exit (0); +# endif +# else + printf ("vax-dec-ultrix\n"); exit (0); +# endif +#endif + +#if defined (alliant) && defined (i860) + printf ("i860-alliant-bsd\n"); exit (0); +#endif + + exit (1); +} +EOF + +$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` && + { echo "$SYSTEM_NAME"; exit; } + +# Apollos put the system type in the environment. + +test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } + +# Convex versions that predate uname can use getsysinfo(1) + +if [ -x /usr/convex/getsysinfo ] +then + case `getsysinfo -f cpu_type` in + c1*) + echo c1-convex-bsd + exit ;; + c2*) + if getsysinfo -f scalar_acc + then echo c32-convex-bsd + else echo c2-convex-bsd + fi + exit ;; + c34*) + echo c34-convex-bsd + exit ;; + c38*) + echo c38-convex-bsd + exit ;; + c4*) + echo c4-convex-bsd + exit ;; + esac +fi + +cat >&2 < in order to provide the needed +information to handle your system. + +config.guess timestamp = $timestamp + +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null` + +hostinfo = `(hostinfo) 2>/dev/null` +/bin/universe = `(/bin/universe) 2>/dev/null` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` +/bin/arch = `(/bin/arch) 2>/dev/null` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` + +UNAME_MACHINE = ${UNAME_MACHINE} +UNAME_RELEASE = ${UNAME_RELEASE} +UNAME_SYSTEM = ${UNAME_SYSTEM} +UNAME_VERSION = ${UNAME_VERSION} +EOF + +exit 1 + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "timestamp='" +# time-stamp-format: "%:y-%02m-%02d" +# time-stamp-end: "'" +# End: diff --git a/config.h.in b/config.h.in new file mode 100644 index 0000000..3cfe66a --- /dev/null +++ b/config.h.in @@ -0,0 +1,267 @@ +/* config.h.in. Generated from configure.in by autoheader. */ + +/* Define to 1 if you have the header file. */ +#undef HAVE_CARBON_CARBON_H + +/* Define if you have the CoreAudio API */ +#undef HAVE_COREAUDIO + +/* Define to 1 if you have the header file. */ +#undef HAVE_CRT_EXTERNS_H + +/* Defines if your system has the crypt function */ +#undef HAVE_CRYPT + +/* Define to 1 if you have the header file. */ +#undef HAVE_DLFCN_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_INTTYPES_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_KSQUIRREL_LIBS_FILEIO_H + +/* Define if you have libjpeg */ +#undef HAVE_LIBJPEG + +/* Define if you have libpng */ +#undef HAVE_LIBPNG + +/* Define if you have a working libpthread (will enable threaded code) */ +#undef HAVE_LIBPTHREAD + +/* Define if you have libz */ +#undef HAVE_LIBZ + +/* Define to 1 if you have the header file. */ +#undef HAVE_MEMORY_H + +/* Define if your system needs _NSGetEnviron to set up the environment */ +#undef HAVE_NSGETENVIRON + +/* Define to 1 if the assembler supports AltiVec instructions. */ +#undef HAVE_PPC_ALTIVEC + +/* Define if you have res_init */ +#undef HAVE_RES_INIT + +/* Define if you have the res_init prototype */ +#undef HAVE_RES_INIT_PROTO + +/* Define if you have a STL implementation by SGI */ +#undef HAVE_SGI_STL + +/* Define to 1 if you have the `snprintf' function. */ +#undef HAVE_SNPRINTF + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDINT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDLIB_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STRINGS_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STRING_H + +/* Define if you have strlcat */ +#undef HAVE_STRLCAT + +/* Define if you have the strlcat prototype */ +#undef HAVE_STRLCAT_PROTO + +/* Define if you have strlcpy */ +#undef HAVE_STRLCPY + +/* Define if you have the strlcpy prototype */ +#undef HAVE_STRLCPY_PROTO + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_BITYPES_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_STAT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_TYPES_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_UNISTD_H + +/* utime.h support */ +#undef HAVE_UTIME_H + +/* Define to 1 if you have the `vsnprintf' function. */ +#undef HAVE_VSNPRINTF + +/* Define to 1 if the assembler supports 3DNOW instructions. */ +#undef HAVE_X86_3DNOW + +/* Define to 1 if the assembler supports MMX instructions. */ +#undef HAVE_X86_MMX + +/* Define to 1 if the assembler supports SSE instructions. */ +#undef HAVE_X86_SSE + +/* Define to 1 if the assembler supports SSE2 instructions. */ +#undef HAVE_X86_SSE2 + +/* Suffix for lib directories */ +#undef KDELIBSUFF + +/* Name of package */ +#undef PACKAGE + +/* Define to the address where bug reports for this package should be sent. */ +#undef PACKAGE_BUGREPORT + +/* Define to the full name of this package. */ +#undef PACKAGE_NAME + +/* Define to the full name and version of this package. */ +#undef PACKAGE_STRING + +/* Define to the one symbol short name of this package. */ +#undef PACKAGE_TARNAME + +/* Define to the version of this package. */ +#undef PACKAGE_VERSION + +/* The size of `char *', as computed by sizeof. */ +#undef SIZEOF_CHAR_P + +/* The size of `int', as computed by sizeof. */ +#undef SIZEOF_INT + +/* The size of `long', as computed by sizeof. */ +#undef SIZEOF_LONG + +/* The size of `short', as computed by sizeof. */ +#undef SIZEOF_SHORT + +/* The size of `size_t', as computed by sizeof. */ +#undef SIZEOF_SIZE_T + +/* The size of `unsigned long', as computed by sizeof. */ +#undef SIZEOF_UNSIGNED_LONG + +/* If we have libkexif installed */ +#undef SQ_HAVE_KEXIF + +/* If we have libkipi installed */ +#undef SQ_HAVE_KIPI + +/* kregexpeditorinterface.h support */ +#undef SQ_HAVE_KREGEXP + +/* Define to 1 if you have the ANSI C header files. */ +#undef STDC_HEADERS + +/* Version number of package */ +#undef VERSION + +/* Defined if compiling without arts */ +#undef WITHOUT_ARTS + +/* + * jpeg.h needs HAVE_BOOLEAN, when the system uses boolean in system + * headers and I'm too lazy to write a configure test as long as only + * unixware is related + */ +#ifdef _UNIXWARE +#define HAVE_BOOLEAN +#endif + + + +/* + * AIX defines FD_SET in terms of bzero, but fails to include + * that defines bzero. + */ + +#if defined(_AIX) +#include +#endif + + + +#if defined(HAVE_NSGETENVIRON) && defined(HAVE_CRT_EXTERNS_H) +# include +# include +# define environ (*_NSGetEnviron()) +#endif + + + +#if !defined(HAVE_RES_INIT_PROTO) +#ifdef __cplusplus +extern "C" { +#endif +int res_init(void); +#ifdef __cplusplus +} +#endif +#endif + + + +#if !defined(HAVE_STRLCAT_PROTO) +#ifdef __cplusplus +extern "C" { +#endif +unsigned long strlcat(char*, const char*, unsigned long); +#ifdef __cplusplus +} +#endif +#endif + + + +#if !defined(HAVE_STRLCPY_PROTO) +#ifdef __cplusplus +extern "C" { +#endif +unsigned long strlcpy(char*, const char*, unsigned long); +#ifdef __cplusplus +} +#endif +#endif + + + +/* + * On HP-UX, the declaration of vsnprintf() is needed every time ! + */ + +#if !defined(HAVE_VSNPRINTF) || defined(hpux) +#if __STDC__ +#include +#include +#else +#include +#endif +#ifdef __cplusplus +extern "C" +#endif +int vsnprintf(char *str, size_t n, char const *fmt, va_list ap); +#ifdef __cplusplus +extern "C" +#endif +int snprintf(char *str, size_t n, char const *fmt, ...); +#endif + + + +#if defined(__SVR4) && !defined(__svr4__) +#define __svr4__ 1 +#endif + + +/* type to use in place of socklen_t if not defined */ +#undef kde_socklen_t + +/* type to use in place of socklen_t if not defined (deprecated, use + kde_socklen_t) */ +#undef ksize_t diff --git a/config.log b/config.log new file mode 100644 index 0000000..99de2dc --- /dev/null +++ b/config.log @@ -0,0 +1,401 @@ +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. + +It was created by configure, which was +generated by GNU Autoconf 2.61. Invocation command line was + + $ ./configure --host=x86_64-linux-gnu --build=x86_64-linux-gnu --prefix=/opt/kde3 --mandir=${prefix}/share/man --infodir=${prefix}/share/info CFLAGS=-g -O2 LDFLAGS=-Wl,-z,defs --disable-rpath + +## --------- ## +## Platform. ## +## --------- ## + +hostname = argus4 +uname -m = x86_64 +uname -r = 2.6.31-16-generic +uname -s = Linux +uname -v = #53-Ubuntu SMP Tue Dec 8 04:02:15 UTC 2009 + +/usr/bin/uname -p = unknown +/bin/uname -X = unknown + +/bin/arch = unknown +/usr/bin/arch -k = unknown +/usr/convex/getsysinfo = unknown +/usr/bin/hostinfo = unknown +/bin/machine = unknown +/usr/bin/oslevel = unknown +/bin/universe = unknown + +PATH: /opt/kde3/bin +PATH: /opt/kde3/games +PATH: /opt/kde3/bin +PATH: /home/eldarion/bin +PATH: /usr/local/sbin +PATH: /usr/local/bin +PATH: /usr/sbin +PATH: /usr/bin +PATH: /sbin +PATH: /bin +PATH: /usr/games + + +## ----------- ## +## Core tests. ## +## ----------- ## + +configure:2189: checking build system type +configure:2207: result: x86_64-pc-linux-gnu +configure:2229: checking host system type +configure:2244: result: x86_64-pc-linux-gnu +configure:2266: checking target system type +configure:2281: result: x86_64-pc-linux-gnu +configure:2343: checking for a BSD-compatible install +configure:2399: result: /usr/bin/install -c +configure:2414: checking for -p flag to install +configure:2427: result: yes +configure:2438: checking whether build environment is sane + +## ---------------- ## +## Cache variables. ## +## ---------------- ## + +ac_cv_build=x86_64-pc-linux-gnu +ac_cv_env_CCASFLAGS_set= +ac_cv_env_CCASFLAGS_value= +ac_cv_env_CCAS_set= +ac_cv_env_CCAS_value= +ac_cv_env_CCC_set= +ac_cv_env_CCC_value= +ac_cv_env_CC_set= +ac_cv_env_CC_value= +ac_cv_env_CFLAGS_set=set +ac_cv_env_CFLAGS_value='-g -O2' +ac_cv_env_CPPFLAGS_set=set +ac_cv_env_CPPFLAGS_value= +ac_cv_env_CPP_set= +ac_cv_env_CPP_value= +ac_cv_env_CXXCPP_set= +ac_cv_env_CXXCPP_value= +ac_cv_env_CXXFLAGS_set=set +ac_cv_env_CXXFLAGS_value='-g -O2' +ac_cv_env_CXX_set= +ac_cv_env_CXX_value= +ac_cv_env_F77_set= +ac_cv_env_F77_value= +ac_cv_env_FFLAGS_set=set +ac_cv_env_FFLAGS_value='-g -O2' +ac_cv_env_LDFLAGS_set=set +ac_cv_env_LDFLAGS_value=-Wl,-z,defs +ac_cv_env_LIBS_set= +ac_cv_env_LIBS_value= +ac_cv_env_PKG_CONFIG_set= +ac_cv_env_PKG_CONFIG_value= +ac_cv_env_XMKMF_set= +ac_cv_env_XMKMF_value= +ac_cv_env_build_alias_set=set +ac_cv_env_build_alias_value=x86_64-linux-gnu +ac_cv_env_host_alias_set=set +ac_cv_env_host_alias_value=x86_64-linux-gnu +ac_cv_env_ksquirrellibs_CFLAGS_set= +ac_cv_env_ksquirrellibs_CFLAGS_value= +ac_cv_env_ksquirrellibs_LIBS_set= +ac_cv_env_ksquirrellibs_LIBS_value= +ac_cv_env_libkexif_CFLAGS_set= +ac_cv_env_libkexif_CFLAGS_value= +ac_cv_env_libkexif_LIBS_set= +ac_cv_env_libkexif_LIBS_value= +ac_cv_env_libkipi_CFLAGS_set= +ac_cv_env_libkipi_CFLAGS_value= +ac_cv_env_libkipi_LIBS_set= +ac_cv_env_libkipi_LIBS_value= +ac_cv_env_target_alias_set= +ac_cv_env_target_alias_value= +ac_cv_host=x86_64-pc-linux-gnu +ac_cv_path_install='/usr/bin/install -c' +ac_cv_target=x86_64-pc-linux-gnu + +## ----------------- ## +## Output variables. ## +## ----------------- ## + +ACLOCAL='' +AMDEPBACKSLASH='' +AMDEP_FALSE='' +AMDEP_TRUE='' +AMTAR='' +AR='' +ARTSCCONFIG='' +AUTOCONF='' +AUTODIRS='' +AUTOHEADER='' +AUTOMAKE='' +AWK='' +CC='' +CCAS='' +CCASDEPMODE='' +CCASFLAGS='' +CCDEPMODE='' +CFLAGS='-g -O2' +CONF_FILES='' +CPP='' +CPPFLAGS='' +CXX='' +CXXCPP='' +CXXDEPMODE='' +CXXFLAGS='-g -O2' +CYGPATH_W='' +DCOPIDL2CPP='' +DCOPIDL='' +DCOPIDLNG='' +DCOP_DEPENDENCIES='' +DEFS='' +DEPDIR='' +ECHO='echo' +ECHO_C='' +ECHO_N='-n' +ECHO_T='' +EGREP='' +ENABLE_PERMISSIVE_FLAG='' +EXEEXT='' +F77='' +FFLAGS='-g -O2' +FRAMEWORK_COREAUDIO='' +GMSGFMT='' +GREP='' +HAVE_GCC_VISIBILITY='' +INSTALL_DATA='${INSTALL} -m 644' +INSTALL_PROGRAM='${INSTALL} $(INSTALL_STRIP_FLAG)' +INSTALL_SCRIPT='${INSTALL}' +INSTALL_STRIP_PROGRAM='' +KCFG_DEPENDENCIES='' +KCONFIG_COMPILER='' +KDECONFIG='' +KDE_CHECK_PLUGIN='' +KDE_EXTRA_RPATH='' +KDE_INCLUDES='' +KDE_LDFLAGS='' +KDE_MT_LDFLAGS='' +KDE_MT_LIBS='' +KDE_NO_UNDEFINED='' +KDE_PLUGIN='' +KDE_RPATH='' +KDE_USE_CLOSURE_FALSE='' +KDE_USE_CLOSURE_TRUE='' +KDE_USE_FINAL_FALSE='' +KDE_USE_FINAL_TRUE='' +KDE_USE_FPIE='' +KDE_USE_NMCHECK_FALSE='' +KDE_USE_NMCHECK_TRUE='' +KDE_USE_PIE='' +KDE_XSL_STYLESHEET='' +KSQUIRREL_ASM_DEFS='' +LDFLAGS='-Wl,-z,defs' +LDFLAGS_AS_NEEDED='' +LDFLAGS_NEW_DTAGS='' +LIBCOMPAT='' +LIBCRYPT='' +LIBDL='' +LIBJPEG='' +LIBOBJS='' +LIBPNG='' +LIBPTHREAD='' +LIBRESOLV='' +LIBS='' +LIBSM='' +LIBSOCKET='' +LIBTOOL='' +LIBUCB='' +LIBUTIL='' +LIBZ='' +LIB_KAB='' +LIB_KABC='' +LIB_KDECORE='' +LIB_KDED='' +LIB_KDEPIM='' +LIB_KDEPRINT='' +LIB_KDEUI='' +LIB_KDNSSD='' +LIB_KFILE='' +LIB_KFM='' +LIB_KHTML='' +LIB_KIMPROXY='' +LIB_KIO='' +LIB_KJS='' +LIB_KNEWSTUFF='' +LIB_KPARTS='' +LIB_KSPELL='' +LIB_KSYCOCA='' +LIB_KUNITTEST='' +LIB_KUTILS='' +LIB_POLL='' +LIB_QPE='' +LIB_QT='' +LIB_SMB='' +LIB_X11='' +LIB_XEXT='' +LIB_XRENDER='' +LN_S='' +LTLIBOBJS='' +MAKEINFO='' +MAKEKDEWIDGETS='' +MCOPIDL='' +MEINPROC='' +MOC='' +MSGFMT='' +NOOPT_CFLAGS='' +NOOPT_CXXFLAGS='' +OBJEXT='' +PACKAGE='' +PACKAGE_BUGREPORT='' +PACKAGE_NAME='' +PACKAGE_STRING='' +PACKAGE_TARNAME='' +PACKAGE_VERSION='' +PATH_SEPARATOR=':' +PERL='' +PKG_CONFIG='' +QTE_NORTTI='' +QT_INCLUDES='' +QT_LDFLAGS='' +RANLIB='' +SET_MAKE='' +SHELL='/bin/bash' +SQ_HAVE_KEXIF_FALSE='' +SQ_HAVE_KEXIF_TRUE='' +SQ_HAVE_KIPI_FALSE='' +SQ_HAVE_KIPI_TRUE='' +SQ_HAVE_KLCONF_FALSE='' +SQ_HAVE_KLCONF_TRUE='' +SQ_HAVE_KPART_FALSE='' +SQ_HAVE_KPART_TRUE='' +STRIP='' +TOPSUBDIRS='' +UIC='' +UIC_TR='' +USER_INCLUDES='' +USER_LDFLAGS='' +USE_EXCEPTIONS='' +USE_RTTI='' +USE_THREADS='' +VERSION='' +WOVERLOADED_VIRTUAL='' +XGETTEXT='' +XMKMF='' +XMLLINT='' +X_EXTRA_LIBS='' +X_INCLUDES='' +X_LDFLAGS='' +X_PRE_LIBS='' +X_RPATH='' +ac_ct_CC='' +ac_ct_CXX='' +ac_ct_F77='' +all_includes='' +all_libraries='' +am__fastdepCCAS_FALSE='' +am__fastdepCCAS_TRUE='' +am__fastdepCC_FALSE='' +am__fastdepCC_TRUE='' +am__fastdepCXX_FALSE='' +am__fastdepCXX_TRUE='' +am__include='' +am__isrc='' +am__leading_dot='' +am__quote='' +am__tar='' +am__untar='' +bindir='${exec_prefix}/bin' +build='x86_64-pc-linux-gnu' +build_alias='x86_64-linux-gnu' +build_cpu='x86_64' +build_os='linux-gnu' +build_vendor='pc' +datadir='${datarootdir}' +datarootdir='${prefix}/share' +docdir='${datarootdir}/doc/${PACKAGE}' +dvidir='${docdir}' +exec_prefix='NONE' +host='x86_64-pc-linux-gnu' +host_alias='x86_64-linux-gnu' +host_cpu='x86_64' +host_os='linux-gnu' +host_vendor='pc' +htmldir='${docdir}' +include_ARTS_FALSE='' +include_ARTS_TRUE='' +include_x11_FALSE='' +include_x11_TRUE='' +includedir='${prefix}/include' +infodir='${prefix}/share/info' +install_sh='' +kde_appsdir='' +kde_bindir='' +kde_confdir='' +kde_datadir='' +kde_htmldir='' +kde_icondir='' +kde_includes='' +kde_kcfgdir='' +kde_libraries='' +kde_libs_htmldir='' +kde_libs_prefix='' +kde_locale='' +kde_mimedir='' +kde_moduledir='' +kde_qtver='' +kde_servicesdir='' +kde_servicetypesdir='' +kde_sounddir='' +kde_styledir='' +kde_templatesdir='' +kde_wallpaperdir='' +kde_widgetdir='' +kdeinitdir='' +ksquirrellibs_CFLAGS='' +ksquirrellibs_LIBS='' +libdir='${exec_prefix}/lib' +libexecdir='${exec_prefix}/libexec' +libkexif_CFLAGS='' +libkexif_LIBS='' +libkipi_CFLAGS='' +libkipi_LIBS='' +localedir='${datarootdir}/locale' +localstatedir='${prefix}/var' +mandir='${prefix}/share/man' +mkdir_p='' +oldincludedir='/usr/include' +pdfdir='${docdir}' +prefix='/opt/kde3' +program_transform_name='s,x,x,' +psdir='${docdir}' +qt_includes='' +qt_libraries='' +sbindir='${exec_prefix}/sbin' +sharedstatedir='${prefix}/com' +sysconfdir='${prefix}/etc' +target='x86_64-pc-linux-gnu' +target_alias='' +target_cpu='x86_64' +target_os='linux-gnu' +target_vendor='pc' +unsermake_enable_pch_FALSE='' +unsermake_enable_pch_TRUE='' +x_includes='NONE' +x_libraries='NONE' +xdg_appsdir='' +xdg_directorydir='' +xdg_menudir='' + +## ----------- ## +## confdefs.h. ## +## ----------- ## + +#define PACKAGE_NAME "" +#define PACKAGE_TARNAME "" +#define PACKAGE_VERSION "" +#define PACKAGE_STRING "" +#define PACKAGE_BUGREPORT "" + +configure: caught signal 2 +configure: exit 1 diff --git a/config.sub b/config.sub new file mode 100755 index 0000000..a39437d --- /dev/null +++ b/config.sub @@ -0,0 +1,1686 @@ +#! /bin/sh +# Configuration validation subroutine script. +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, +# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 +# Free Software Foundation, Inc. + +timestamp='2009-04-17' + +# This file is (in principle) common to ALL GNU software. +# The presence of a machine in this file suggests that SOME GNU software +# can handle that machine. It does not imply ALL GNU software can. +# +# This file is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA +# 02110-1301, USA. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + + +# Please send patches to . Submit a context +# diff and a properly formatted ChangeLog entry. +# +# Configuration subroutine to validate and canonicalize a configuration type. +# Supply the specified configuration type as an argument. +# If it is invalid, we print an error message on stderr and exit with code 1. +# Otherwise, we print the canonical config type on stdout and succeed. + +# This file is supposed to be the same for all GNU packages +# and recognize all the CPU types, system types and aliases +# that are meaningful with *any* GNU software. +# Each package is responsible for reporting which valid configurations +# it does not support. The user should be able to distinguish +# a failure to support a valid configuration from a meaningless +# configuration. + +# The goal of this file is to map all the various variations of a given +# machine specification into a single specification in the form: +# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM +# or in some cases, the newer four-part form: +# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM +# It is wrong to echo any other type of specification. + +me=`echo "$0" | sed -e 's,.*/,,'` + +usage="\ +Usage: $0 [OPTION] CPU-MFR-OPSYS + $0 [OPTION] ALIAS + +Canonicalize a configuration name. + +Operation modes: + -h, --help print this help, then exit + -t, --time-stamp print date of last modification, then exit + -v, --version print version number, then exit + +Report bugs and patches to ." + +version="\ +GNU config.sub ($timestamp) + +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, +2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. + +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." + +help=" +Try \`$me --help' for more information." + +# Parse command line +while test $# -gt 0 ; do + case $1 in + --time-stamp | --time* | -t ) + echo "$timestamp" ; exit ;; + --version | -v ) + echo "$version" ; exit ;; + --help | --h* | -h ) + echo "$usage"; exit ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. + break ;; + -* ) + echo "$me: invalid option $1$help" + exit 1 ;; + + *local*) + # First pass through any local machine types. + echo $1 + exit ;; + + * ) + break ;; + esac +done + +case $# in + 0) echo "$me: missing argument$help" >&2 + exit 1;; + 1) ;; + *) echo "$me: too many arguments$help" >&2 + exit 1;; +esac + +# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). +# Here we must recognize all the valid KERNEL-OS combinations. +maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` +case $maybe_os in + nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \ + uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \ + kopensolaris*-gnu* | \ + storm-chaos* | os2-emx* | rtmk-nova*) + os=-$maybe_os + basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` + ;; + *) + basic_machine=`echo $1 | sed 's/-[^-]*$//'` + if [ $basic_machine != $1 ] + then os=`echo $1 | sed 's/.*-/-/'` + else os=; fi + ;; +esac + +### Let's recognize common machines as not being operating systems so +### that things like config.sub decstation-3100 work. We also +### recognize some manufacturers as not being operating systems, so we +### can provide default operating systems below. +case $os in + -sun*os*) + # Prevent following clause from handling this invalid input. + ;; + -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ + -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ + -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ + -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ + -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ + -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ + -apple | -axis | -knuth | -cray) + os= + basic_machine=$1 + ;; + -sim | -cisco | -oki | -wec | -winbond) + os= + basic_machine=$1 + ;; + -scout) + ;; + -wrs) + os=-vxworks + basic_machine=$1 + ;; + -chorusos*) + os=-chorusos + basic_machine=$1 + ;; + -chorusrdb) + os=-chorusrdb + basic_machine=$1 + ;; + -hiux*) + os=-hiuxwe2 + ;; + -sco6) + os=-sco5v6 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco5) + os=-sco3.2v5 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco4) + os=-sco3.2v4 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco3.2.[4-9]*) + os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco3.2v[4-9]*) + # Don't forget version if it is 3.2v4 or newer. + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco5v6*) + # Don't forget version if it is 3.2v4 or newer. + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco*) + os=-sco3.2v2 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -udk*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -isc) + os=-isc2.2 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -clix*) + basic_machine=clipper-intergraph + ;; + -isc*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -lynx*) + os=-lynxos + ;; + -ptx*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` + ;; + -windowsnt*) + os=`echo $os | sed -e 's/windowsnt/winnt/'` + ;; + -psos*) + os=-psos + ;; + -mint | -mint[0-9]*) + basic_machine=m68k-atari + os=-mint + ;; +esac + +# Decode aliases for certain CPU-COMPANY combinations. +case $basic_machine in + # Recognize the basic CPU types without company name. + # Some are omitted here because they have special meanings below. + 1750a | 580 \ + | a29k \ + | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ + | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ + | am33_2.0 \ + | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \ + | bfin \ + | c4x | clipper \ + | d10v | d30v | dlx | dsp16xx \ + | fido | fr30 | frv \ + | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ + | i370 | i860 | i960 | ia64 \ + | ip2k | iq2000 \ + | lm32 \ + | m32c | m32r | m32rle | m68000 | m68k | m88k \ + | maxq | mb | microblaze | mcore | mep | metag \ + | mips | mipsbe | mipseb | mipsel | mipsle \ + | mips16 \ + | mips64 | mips64el \ + | mips64octeon | mips64octeonel \ + | mips64orion | mips64orionel \ + | mips64r5900 | mips64r5900el \ + | mips64vr | mips64vrel \ + | mips64vr4100 | mips64vr4100el \ + | mips64vr4300 | mips64vr4300el \ + | mips64vr5000 | mips64vr5000el \ + | mips64vr5900 | mips64vr5900el \ + | mipsisa32 | mipsisa32el \ + | mipsisa32r2 | mipsisa32r2el \ + | mipsisa64 | mipsisa64el \ + | mipsisa64r2 | mipsisa64r2el \ + | mipsisa64sb1 | mipsisa64sb1el \ + | mipsisa64sr71k | mipsisa64sr71kel \ + | mipstx39 | mipstx39el \ + | mn10200 | mn10300 \ + | moxie \ + | mt \ + | msp430 \ + | nios | nios2 \ + | ns16k | ns32k \ + | or32 \ + | pdp10 | pdp11 | pj | pjl \ + | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ + | pyramid \ + | score \ + | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ + | sh64 | sh64le \ + | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ + | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ + | spu | strongarm \ + | tahoe | thumb | tic4x | tic80 | tron \ + | v850 | v850e \ + | we32k \ + | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \ + | z8k | z80) + basic_machine=$basic_machine-unknown + ;; + m6811 | m68hc11 | m6812 | m68hc12) + # Motorola 68HC11/12. + basic_machine=$basic_machine-unknown + os=-none + ;; + m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) + ;; + ms1) + basic_machine=mt-unknown + ;; + + # We use `pc' rather than `unknown' + # because (1) that's what they normally are, and + # (2) the word "unknown" tends to confuse beginning users. + i*86 | x86_64) + basic_machine=$basic_machine-pc + ;; + # Object if more than one company name word. + *-*-*) + echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 + exit 1 + ;; + # Recognize the basic CPU types with company name. + 580-* \ + | a29k-* \ + | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ + | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ + | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ + | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ + | avr-* | avr32-* \ + | bfin-* | bs2000-* \ + | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \ + | clipper-* | craynv-* | cydra-* \ + | d10v-* | d30v-* | dlx-* \ + | elxsi-* \ + | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ + | h8300-* | h8500-* \ + | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ + | i*86-* | i860-* | i960-* | ia64-* \ + | ip2k-* | iq2000-* \ + | lm32-* \ + | m32c-* | m32r-* | m32rle-* \ + | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ + | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \ + | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ + | mips16-* \ + | mips64-* | mips64el-* \ + | mips64octeon-* | mips64octeonel-* \ + | mips64orion-* | mips64orionel-* \ + | mips64r5900-* | mips64r5900el-* \ + | mips64vr-* | mips64vrel-* \ + | mips64vr4100-* | mips64vr4100el-* \ + | mips64vr4300-* | mips64vr4300el-* \ + | mips64vr5000-* | mips64vr5000el-* \ + | mips64vr5900-* | mips64vr5900el-* \ + | mipsisa32-* | mipsisa32el-* \ + | mipsisa32r2-* | mipsisa32r2el-* \ + | mipsisa64-* | mipsisa64el-* \ + | mipsisa64r2-* | mipsisa64r2el-* \ + | mipsisa64sb1-* | mipsisa64sb1el-* \ + | mipsisa64sr71k-* | mipsisa64sr71kel-* \ + | mipstx39-* | mipstx39el-* \ + | mmix-* \ + | mt-* \ + | msp430-* \ + | nios-* | nios2-* \ + | none-* | np1-* | ns16k-* | ns32k-* \ + | orion-* \ + | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ + | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ + | pyramid-* \ + | romp-* | rs6000-* \ + | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ + | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ + | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ + | sparclite-* \ + | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \ + | tahoe-* | thumb-* \ + | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* | tile-* \ + | tron-* \ + | v850-* | v850e-* | vax-* \ + | we32k-* \ + | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \ + | xstormy16-* | xtensa*-* \ + | ymp-* \ + | z8k-* | z80-*) + ;; + # Recognize the basic CPU types without company name, with glob match. + xtensa*) + basic_machine=$basic_machine-unknown + ;; + # Recognize the various machine names and aliases which stand + # for a CPU type and a company and sometimes even an OS. + 386bsd) + basic_machine=i386-unknown + os=-bsd + ;; + 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) + basic_machine=m68000-att + ;; + 3b*) + basic_machine=we32k-att + ;; + a29khif) + basic_machine=a29k-amd + os=-udi + ;; + abacus) + basic_machine=abacus-unknown + ;; + adobe68k) + basic_machine=m68010-adobe + os=-scout + ;; + alliant | fx80) + basic_machine=fx80-alliant + ;; + altos | altos3068) + basic_machine=m68k-altos + ;; + am29k) + basic_machine=a29k-none + os=-bsd + ;; + amd64) + basic_machine=x86_64-pc + ;; + amd64-*) + basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + amdahl) + basic_machine=580-amdahl + os=-sysv + ;; + amiga | amiga-*) + basic_machine=m68k-unknown + ;; + amigaos | amigados) + basic_machine=m68k-unknown + os=-amigaos + ;; + amigaunix | amix) + basic_machine=m68k-unknown + os=-sysv4 + ;; + apollo68) + basic_machine=m68k-apollo + os=-sysv + ;; + apollo68bsd) + basic_machine=m68k-apollo + os=-bsd + ;; + aros) + basic_machine=i386-pc + os=-aros + ;; + aux) + basic_machine=m68k-apple + os=-aux + ;; + balance) + basic_machine=ns32k-sequent + os=-dynix + ;; + blackfin) + basic_machine=bfin-unknown + os=-linux + ;; + blackfin-*) + basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` + os=-linux + ;; + c90) + basic_machine=c90-cray + os=-unicos + ;; + cegcc) + basic_machine=arm-unknown + os=-cegcc + ;; + convex-c1) + basic_machine=c1-convex + os=-bsd + ;; + convex-c2) + basic_machine=c2-convex + os=-bsd + ;; + convex-c32) + basic_machine=c32-convex + os=-bsd + ;; + convex-c34) + basic_machine=c34-convex + os=-bsd + ;; + convex-c38) + basic_machine=c38-convex + os=-bsd + ;; + cray | j90) + basic_machine=j90-cray + os=-unicos + ;; + craynv) + basic_machine=craynv-cray + os=-unicosmp + ;; + cr16) + basic_machine=cr16-unknown + os=-elf + ;; + crds | unos) + basic_machine=m68k-crds + ;; + crisv32 | crisv32-* | etraxfs*) + basic_machine=crisv32-axis + ;; + cris | cris-* | etrax*) + basic_machine=cris-axis + ;; + crx) + basic_machine=crx-unknown + os=-elf + ;; + da30 | da30-*) + basic_machine=m68k-da30 + ;; + decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) + basic_machine=mips-dec + ;; + decsystem10* | dec10*) + basic_machine=pdp10-dec + os=-tops10 + ;; + decsystem20* | dec20*) + basic_machine=pdp10-dec + os=-tops20 + ;; + delta | 3300 | motorola-3300 | motorola-delta \ + | 3300-motorola | delta-motorola) + basic_machine=m68k-motorola + ;; + delta88) + basic_machine=m88k-motorola + os=-sysv3 + ;; + dicos) + basic_machine=i686-pc + os=-dicos + ;; + djgpp) + basic_machine=i586-pc + os=-msdosdjgpp + ;; + dpx20 | dpx20-*) + basic_machine=rs6000-bull + os=-bosx + ;; + dpx2* | dpx2*-bull) + basic_machine=m68k-bull + os=-sysv3 + ;; + ebmon29k) + basic_machine=a29k-amd + os=-ebmon + ;; + elxsi) + basic_machine=elxsi-elxsi + os=-bsd + ;; + encore | umax | mmax) + basic_machine=ns32k-encore + ;; + es1800 | OSE68k | ose68k | ose | OSE) + basic_machine=m68k-ericsson + os=-ose + ;; + fx2800) + basic_machine=i860-alliant + ;; + genix) + basic_machine=ns32k-ns + ;; + gmicro) + basic_machine=tron-gmicro + os=-sysv + ;; + go32) + basic_machine=i386-pc + os=-go32 + ;; + h3050r* | hiux*) + basic_machine=hppa1.1-hitachi + os=-hiuxwe2 + ;; + h8300hms) + basic_machine=h8300-hitachi + os=-hms + ;; + h8300xray) + basic_machine=h8300-hitachi + os=-xray + ;; + h8500hms) + basic_machine=h8500-hitachi + os=-hms + ;; + harris) + basic_machine=m88k-harris + os=-sysv3 + ;; + hp300-*) + basic_machine=m68k-hp + ;; + hp300bsd) + basic_machine=m68k-hp + os=-bsd + ;; + hp300hpux) + basic_machine=m68k-hp + os=-hpux + ;; + hp3k9[0-9][0-9] | hp9[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hp9k2[0-9][0-9] | hp9k31[0-9]) + basic_machine=m68000-hp + ;; + hp9k3[2-9][0-9]) + basic_machine=m68k-hp + ;; + hp9k6[0-9][0-9] | hp6[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hp9k7[0-79][0-9] | hp7[0-79][0-9]) + basic_machine=hppa1.1-hp + ;; + hp9k78[0-9] | hp78[0-9]) + # FIXME: really hppa2.0-hp + basic_machine=hppa1.1-hp + ;; + hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) + # FIXME: really hppa2.0-hp + basic_machine=hppa1.1-hp + ;; + hp9k8[0-9][13679] | hp8[0-9][13679]) + basic_machine=hppa1.1-hp + ;; + hp9k8[0-9][0-9] | hp8[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hppa-next) + os=-nextstep3 + ;; + hppaosf) + basic_machine=hppa1.1-hp + os=-osf + ;; + hppro) + basic_machine=hppa1.1-hp + os=-proelf + ;; + i370-ibm* | ibm*) + basic_machine=i370-ibm + ;; +# I'm not sure what "Sysv32" means. Should this be sysv3.2? + i*86v32) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv32 + ;; + i*86v4*) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv4 + ;; + i*86v) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv + ;; + i*86sol2) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-solaris2 + ;; + i386mach) + basic_machine=i386-mach + os=-mach + ;; + i386-vsta | vsta) + basic_machine=i386-unknown + os=-vsta + ;; + iris | iris4d) + basic_machine=mips-sgi + case $os in + -irix*) + ;; + *) + os=-irix4 + ;; + esac + ;; + isi68 | isi) + basic_machine=m68k-isi + os=-sysv + ;; + m68knommu) + basic_machine=m68k-unknown + os=-linux + ;; + m68knommu-*) + basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'` + os=-linux + ;; + m88k-omron*) + basic_machine=m88k-omron + ;; + magnum | m3230) + basic_machine=mips-mips + os=-sysv + ;; + merlin) + basic_machine=ns32k-utek + os=-sysv + ;; + mingw32) + basic_machine=i386-pc + os=-mingw32 + ;; + mingw32ce) + basic_machine=arm-unknown + os=-mingw32ce + ;; + miniframe) + basic_machine=m68000-convergent + ;; + *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) + basic_machine=m68k-atari + os=-mint + ;; + mips3*-*) + basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` + ;; + mips3*) + basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown + ;; + monitor) + basic_machine=m68k-rom68k + os=-coff + ;; + morphos) + basic_machine=powerpc-unknown + os=-morphos + ;; + msdos) + basic_machine=i386-pc + os=-msdos + ;; + ms1-*) + basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` + ;; + mvs) + basic_machine=i370-ibm + os=-mvs + ;; + ncr3000) + basic_machine=i486-ncr + os=-sysv4 + ;; + netbsd386) + basic_machine=i386-unknown + os=-netbsd + ;; + netwinder) + basic_machine=armv4l-rebel + os=-linux + ;; + news | news700 | news800 | news900) + basic_machine=m68k-sony + os=-newsos + ;; + news1000) + basic_machine=m68030-sony + os=-newsos + ;; + news-3600 | risc-news) + basic_machine=mips-sony + os=-newsos + ;; + necv70) + basic_machine=v70-nec + os=-sysv + ;; + next | m*-next ) + basic_machine=m68k-next + case $os in + -nextstep* ) + ;; + -ns2*) + os=-nextstep2 + ;; + *) + os=-nextstep3 + ;; + esac + ;; + nh3000) + basic_machine=m68k-harris + os=-cxux + ;; + nh[45]000) + basic_machine=m88k-harris + os=-cxux + ;; + nindy960) + basic_machine=i960-intel + os=-nindy + ;; + mon960) + basic_machine=i960-intel + os=-mon960 + ;; + nonstopux) + basic_machine=mips-compaq + os=-nonstopux + ;; + np1) + basic_machine=np1-gould + ;; + nsr-tandem) + basic_machine=nsr-tandem + ;; + op50n-* | op60c-*) + basic_machine=hppa1.1-oki + os=-proelf + ;; + openrisc | openrisc-*) + basic_machine=or32-unknown + ;; + os400) + basic_machine=powerpc-ibm + os=-os400 + ;; + OSE68000 | ose68000) + basic_machine=m68000-ericsson + os=-ose + ;; + os68k) + basic_machine=m68k-none + os=-os68k + ;; + pa-hitachi) + basic_machine=hppa1.1-hitachi + os=-hiuxwe2 + ;; + paragon) + basic_machine=i860-intel + os=-osf + ;; + parisc) + basic_machine=hppa-unknown + os=-linux + ;; + parisc-*) + basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'` + os=-linux + ;; + pbd) + basic_machine=sparc-tti + ;; + pbb) + basic_machine=m68k-tti + ;; + pc532 | pc532-*) + basic_machine=ns32k-pc532 + ;; + pc98) + basic_machine=i386-pc + ;; + pc98-*) + basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentium | p5 | k5 | k6 | nexgen | viac3) + basic_machine=i586-pc + ;; + pentiumpro | p6 | 6x86 | athlon | athlon_*) + basic_machine=i686-pc + ;; + pentiumii | pentium2 | pentiumiii | pentium3) + basic_machine=i686-pc + ;; + pentium4) + basic_machine=i786-pc + ;; + pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) + basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentiumpro-* | p6-* | 6x86-* | athlon-*) + basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) + basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentium4-*) + basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pn) + basic_machine=pn-gould + ;; + power) basic_machine=power-ibm + ;; + ppc) basic_machine=powerpc-unknown + ;; + ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppcle | powerpclittle | ppc-le | powerpc-little) + basic_machine=powerpcle-unknown + ;; + ppcle-* | powerpclittle-*) + basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppc64) basic_machine=powerpc64-unknown + ;; + ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppc64le | powerpc64little | ppc64-le | powerpc64-little) + basic_machine=powerpc64le-unknown + ;; + ppc64le-* | powerpc64little-*) + basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ps2) + basic_machine=i386-ibm + ;; + pw32) + basic_machine=i586-unknown + os=-pw32 + ;; + rdos) + basic_machine=i386-pc + os=-rdos + ;; + rom68k) + basic_machine=m68k-rom68k + os=-coff + ;; + rm[46]00) + basic_machine=mips-siemens + ;; + rtpc | rtpc-*) + basic_machine=romp-ibm + ;; + s390 | s390-*) + basic_machine=s390-ibm + ;; + s390x | s390x-*) + basic_machine=s390x-ibm + ;; + sa29200) + basic_machine=a29k-amd + os=-udi + ;; + sb1) + basic_machine=mipsisa64sb1-unknown + ;; + sb1el) + basic_machine=mipsisa64sb1el-unknown + ;; + sde) + basic_machine=mipsisa32-sde + os=-elf + ;; + sei) + basic_machine=mips-sei + os=-seiux + ;; + sequent) + basic_machine=i386-sequent + ;; + sh) + basic_machine=sh-hitachi + os=-hms + ;; + sh5el) + basic_machine=sh5le-unknown + ;; + sh64) + basic_machine=sh64-unknown + ;; + sparclite-wrs | simso-wrs) + basic_machine=sparclite-wrs + os=-vxworks + ;; + sps7) + basic_machine=m68k-bull + os=-sysv2 + ;; + spur) + basic_machine=spur-unknown + ;; + st2000) + basic_machine=m68k-tandem + ;; + stratus) + basic_machine=i860-stratus + os=-sysv4 + ;; + sun2) + basic_machine=m68000-sun + ;; + sun2os3) + basic_machine=m68000-sun + os=-sunos3 + ;; + sun2os4) + basic_machine=m68000-sun + os=-sunos4 + ;; + sun3os3) + basic_machine=m68k-sun + os=-sunos3 + ;; + sun3os4) + basic_machine=m68k-sun + os=-sunos4 + ;; + sun4os3) + basic_machine=sparc-sun + os=-sunos3 + ;; + sun4os4) + basic_machine=sparc-sun + os=-sunos4 + ;; + sun4sol2) + basic_machine=sparc-sun + os=-solaris2 + ;; + sun3 | sun3-*) + basic_machine=m68k-sun + ;; + sun4) + basic_machine=sparc-sun + ;; + sun386 | sun386i | roadrunner) + basic_machine=i386-sun + ;; + sv1) + basic_machine=sv1-cray + os=-unicos + ;; + symmetry) + basic_machine=i386-sequent + os=-dynix + ;; + t3e) + basic_machine=alphaev5-cray + os=-unicos + ;; + t90) + basic_machine=t90-cray + os=-unicos + ;; + tic54x | c54x*) + basic_machine=tic54x-unknown + os=-coff + ;; + tic55x | c55x*) + basic_machine=tic55x-unknown + os=-coff + ;; + tic6x | c6x*) + basic_machine=tic6x-unknown + os=-coff + ;; + tile*) + basic_machine=tile-unknown + os=-linux-gnu + ;; + tx39) + basic_machine=mipstx39-unknown + ;; + tx39el) + basic_machine=mipstx39el-unknown + ;; + toad1) + basic_machine=pdp10-xkl + os=-tops20 + ;; + tower | tower-32) + basic_machine=m68k-ncr + ;; + tpf) + basic_machine=s390x-ibm + os=-tpf + ;; + udi29k) + basic_machine=a29k-amd + os=-udi + ;; + ultra3) + basic_machine=a29k-nyu + os=-sym1 + ;; + v810 | necv810) + basic_machine=v810-nec + os=-none + ;; + vaxv) + basic_machine=vax-dec + os=-sysv + ;; + vms) + basic_machine=vax-dec + os=-vms + ;; + vpp*|vx|vx-*) + basic_machine=f301-fujitsu + ;; + vxworks960) + basic_machine=i960-wrs + os=-vxworks + ;; + vxworks68) + basic_machine=m68k-wrs + os=-vxworks + ;; + vxworks29k) + basic_machine=a29k-wrs + os=-vxworks + ;; + w65*) + basic_machine=w65-wdc + os=-none + ;; + w89k-*) + basic_machine=hppa1.1-winbond + os=-proelf + ;; + xbox) + basic_machine=i686-pc + os=-mingw32 + ;; + xps | xps100) + basic_machine=xps100-honeywell + ;; + ymp) + basic_machine=ymp-cray + os=-unicos + ;; + z8k-*-coff) + basic_machine=z8k-unknown + os=-sim + ;; + z80-*-coff) + basic_machine=z80-unknown + os=-sim + ;; + none) + basic_machine=none-none + os=-none + ;; + +# Here we handle the default manufacturer of certain CPU types. It is in +# some cases the only manufacturer, in others, it is the most popular. + w89k) + basic_machine=hppa1.1-winbond + ;; + op50n) + basic_machine=hppa1.1-oki + ;; + op60c) + basic_machine=hppa1.1-oki + ;; + romp) + basic_machine=romp-ibm + ;; + mmix) + basic_machine=mmix-knuth + ;; + rs6000) + basic_machine=rs6000-ibm + ;; + vax) + basic_machine=vax-dec + ;; + pdp10) + # there are many clones, so DEC is not a safe bet + basic_machine=pdp10-unknown + ;; + pdp11) + basic_machine=pdp11-dec + ;; + we32k) + basic_machine=we32k-att + ;; + sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele) + basic_machine=sh-unknown + ;; + sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) + basic_machine=sparc-sun + ;; + cydra) + basic_machine=cydra-cydrome + ;; + orion) + basic_machine=orion-highlevel + ;; + orion105) + basic_machine=clipper-highlevel + ;; + mac | mpw | mac-mpw) + basic_machine=m68k-apple + ;; + pmac | pmac-mpw) + basic_machine=powerpc-apple + ;; + *-unknown) + # Make sure to match an already-canonicalized machine name. + ;; + *) + echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 + exit 1 + ;; +esac + +# Here we canonicalize certain aliases for manufacturers. +case $basic_machine in + *-digital*) + basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` + ;; + *-commodore*) + basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` + ;; + *) + ;; +esac + +# Decode manufacturer-specific aliases for certain operating systems. + +if [ x"$os" != x"" ] +then +case $os in + # First match some system type aliases + # that might get confused with valid system types. + # -solaris* is a basic system type, with this one exception. + -solaris1 | -solaris1.*) + os=`echo $os | sed -e 's|solaris1|sunos4|'` + ;; + -solaris) + os=-solaris2 + ;; + -svr4*) + os=-sysv4 + ;; + -unixware*) + os=-sysv4.2uw + ;; + -gnu/linux*) + os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` + ;; + # First accept the basic system types. + # The portable systems comes first. + # Each alternative MUST END IN A *, to match a version number. + # -sysv* is not here because it comes later, after sysvr4. + -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ + | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\ + | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \ + | -kopensolaris* \ + | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ + | -aos* | -aros* \ + | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ + | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ + | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ + | -openbsd* | -solidbsd* \ + | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ + | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ + | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ + | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ + | -chorusos* | -chorusrdb* | -cegcc* \ + | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ + | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \ + | -uxpv* | -beos* | -mpeix* | -udk* \ + | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ + | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ + | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ + | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ + | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ + | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ + | -skyos* | -haiku* | -rdos* | -toppers* | -drops*) + # Remember, each alternative MUST END IN *, to match a version number. + ;; + -qnx*) + case $basic_machine in + x86-* | i*86-*) + ;; + *) + os=-nto$os + ;; + esac + ;; + -nto-qnx*) + ;; + -nto*) + os=`echo $os | sed -e 's|nto|nto-qnx|'` + ;; + -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ + | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ + | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) + ;; + -mac*) + os=`echo $os | sed -e 's|mac|macos|'` + ;; + -linux-dietlibc) + os=-linux-dietlibc + ;; + -linux*) + os=`echo $os | sed -e 's|linux|linux-gnu|'` + ;; + -sunos5*) + os=`echo $os | sed -e 's|sunos5|solaris2|'` + ;; + -sunos6*) + os=`echo $os | sed -e 's|sunos6|solaris3|'` + ;; + -opened*) + os=-openedition + ;; + -os400*) + os=-os400 + ;; + -wince*) + os=-wince + ;; + -osfrose*) + os=-osfrose + ;; + -osf*) + os=-osf + ;; + -utek*) + os=-bsd + ;; + -dynix*) + os=-bsd + ;; + -acis*) + os=-aos + ;; + -atheos*) + os=-atheos + ;; + -syllable*) + os=-syllable + ;; + -386bsd) + os=-bsd + ;; + -ctix* | -uts*) + os=-sysv + ;; + -nova*) + os=-rtmk-nova + ;; + -ns2 ) + os=-nextstep2 + ;; + -nsk*) + os=-nsk + ;; + # Preserve the version number of sinix5. + -sinix5.*) + os=`echo $os | sed -e 's|sinix|sysv|'` + ;; + -sinix*) + os=-sysv4 + ;; + -tpf*) + os=-tpf + ;; + -triton*) + os=-sysv3 + ;; + -oss*) + os=-sysv3 + ;; + -svr4) + os=-sysv4 + ;; + -svr3) + os=-sysv3 + ;; + -sysvr4) + os=-sysv4 + ;; + # This must come after -sysvr4. + -sysv*) + ;; + -ose*) + os=-ose + ;; + -es1800*) + os=-ose + ;; + -xenix) + os=-xenix + ;; + -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) + os=-mint + ;; + -aros*) + os=-aros + ;; + -kaos*) + os=-kaos + ;; + -zvmoe) + os=-zvmoe + ;; + -dicos*) + os=-dicos + ;; + -none) + ;; + *) + # Get rid of the `-' at the beginning of $os. + os=`echo $os | sed 's/[^-]*-//'` + echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 + exit 1 + ;; +esac +else + +# Here we handle the default operating systems that come with various machines. +# The value should be what the vendor currently ships out the door with their +# machine or put another way, the most popular os provided with the machine. + +# Note that if you're going to try to match "-MANUFACTURER" here (say, +# "-sun"), then you have to tell the case statement up towards the top +# that MANUFACTURER isn't an operating system. Otherwise, code above +# will signal an error saying that MANUFACTURER isn't an operating +# system, and we'll never get to this point. + +case $basic_machine in + score-*) + os=-elf + ;; + spu-*) + os=-elf + ;; + *-acorn) + os=-riscix1.2 + ;; + arm*-rebel) + os=-linux + ;; + arm*-semi) + os=-aout + ;; + c4x-* | tic4x-*) + os=-coff + ;; + # This must come before the *-dec entry. + pdp10-*) + os=-tops20 + ;; + pdp11-*) + os=-none + ;; + *-dec | vax-*) + os=-ultrix4.2 + ;; + m68*-apollo) + os=-domain + ;; + i386-sun) + os=-sunos4.0.2 + ;; + m68000-sun) + os=-sunos3 + # This also exists in the configure program, but was not the + # default. + # os=-sunos4 + ;; + m68*-cisco) + os=-aout + ;; + mep-*) + os=-elf + ;; + mips*-cisco) + os=-elf + ;; + mips*-*) + os=-elf + ;; + or32-*) + os=-coff + ;; + *-tti) # must be before sparc entry or we get the wrong os. + os=-sysv3 + ;; + sparc-* | *-sun) + os=-sunos4.1.1 + ;; + *-be) + os=-beos + ;; + *-haiku) + os=-haiku + ;; + *-ibm) + os=-aix + ;; + *-knuth) + os=-mmixware + ;; + *-wec) + os=-proelf + ;; + *-winbond) + os=-proelf + ;; + *-oki) + os=-proelf + ;; + *-hp) + os=-hpux + ;; + *-hitachi) + os=-hiux + ;; + i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) + os=-sysv + ;; + *-cbm) + os=-amigaos + ;; + *-dg) + os=-dgux + ;; + *-dolphin) + os=-sysv3 + ;; + m68k-ccur) + os=-rtu + ;; + m88k-omron*) + os=-luna + ;; + *-next ) + os=-nextstep + ;; + *-sequent) + os=-ptx + ;; + *-crds) + os=-unos + ;; + *-ns) + os=-genix + ;; + i370-*) + os=-mvs + ;; + *-next) + os=-nextstep3 + ;; + *-gould) + os=-sysv + ;; + *-highlevel) + os=-bsd + ;; + *-encore) + os=-bsd + ;; + *-sgi) + os=-irix + ;; + *-siemens) + os=-sysv4 + ;; + *-masscomp) + os=-rtu + ;; + f30[01]-fujitsu | f700-fujitsu) + os=-uxpv + ;; + *-rom68k) + os=-coff + ;; + *-*bug) + os=-coff + ;; + *-apple) + os=-macos + ;; + *-atari*) + os=-mint + ;; + *) + os=-none + ;; +esac +fi + +# Here we handle the case where we know the os, and the CPU type, but not the +# manufacturer. We pick the logical manufacturer. +vendor=unknown +case $basic_machine in + *-unknown) + case $os in + -riscix*) + vendor=acorn + ;; + -sunos*) + vendor=sun + ;; + -aix*) + vendor=ibm + ;; + -beos*) + vendor=be + ;; + -hpux*) + vendor=hp + ;; + -mpeix*) + vendor=hp + ;; + -hiux*) + vendor=hitachi + ;; + -unos*) + vendor=crds + ;; + -dgux*) + vendor=dg + ;; + -luna*) + vendor=omron + ;; + -genix*) + vendor=ns + ;; + -mvs* | -opened*) + vendor=ibm + ;; + -os400*) + vendor=ibm + ;; + -ptx*) + vendor=sequent + ;; + -tpf*) + vendor=ibm + ;; + -vxsim* | -vxworks* | -windiss*) + vendor=wrs + ;; + -aux*) + vendor=apple + ;; + -hms*) + vendor=hitachi + ;; + -mpw* | -macos*) + vendor=apple + ;; + -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) + vendor=atari + ;; + -vos*) + vendor=stratus + ;; + esac + basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` + ;; +esac + +echo $basic_machine$os +exit + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "timestamp='" +# time-stamp-format: "%:y-%02m-%02d" +# time-stamp-end: "'" +# End: diff --git a/configure.files b/configure.files new file mode 100644 index 0000000..97d9bce --- /dev/null +++ b/configure.files @@ -0,0 +1,3 @@ +./admin/configure.in.min +configure.in.in +configure.in.bot diff --git a/configure.gnu b/configure.gnu new file mode 100755 index 0000000..925dc44 --- /dev/null +++ b/configure.gnu @@ -0,0 +1,7 @@ +#!/bin/sh + +par="--without-arts" + +echo "*** Doing configure $* $par ..." + +./configure $* $par \ No newline at end of file diff --git a/configure.in b/configure.in new file mode 100644 index 0000000..7937ad6 --- /dev/null +++ b/configure.in @@ -0,0 +1,346 @@ +dnl ======================================================= +dnl FILE: ./admin/configure.in.min +dnl ======================================================= + +dnl This file is part of the KDE libraries/packages +dnl Copyright (C) 2001 Stephan Kulow (coolo@kde.org) + +dnl This file is free software; you can redistribute it and/or +dnl modify it under the terms of the GNU Library General Public +dnl License as published by the Free Software Foundation; either +dnl version 2 of the License, or (at your option) any later version. + +dnl This library is distributed in the hope that it will be useful, +dnl but WITHOUT ANY WARRANTY; without even the implied warranty of +dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +dnl Library General Public License for more details. + +dnl You should have received a copy of the GNU Library General Public License +dnl along with this library; see the file COPYING.LIB. If not, write to +dnl the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +dnl Boston, MA 02110-1301, USA. + +# Original Author was Kalle@kde.org +# I lifted it in some mater. (Stephan Kulow) +# I used much code from Janos Farkas + +dnl Process this file with autoconf to produce a configure script. + +AC_INIT(acinclude.m4) dnl a source file from your sub dir + +dnl This is so we can use kde-common +AC_CONFIG_AUX_DIR(admin) + +dnl This ksh/zsh feature conflicts with `cd blah ; pwd` +unset CDPATH + +dnl Checking host/target/build systems, for make, install etc. +AC_CANONICAL_SYSTEM +dnl Perform program name transformation +AC_ARG_PROGRAM + +dnl Automake doc recommends to do this only here. (Janos) +AM_INIT_AUTOMAKE(ksquirrel, 0.8.0) dnl searches for some needed programs + +KDE_SET_PREFIX + +dnl generate the config header +AM_CONFIG_HEADER(config.h) dnl at the distribution this done + +dnl Checks for programs. +AC_CHECK_COMPILERS +AC_ENABLE_SHARED(yes) +AC_ENABLE_STATIC(no) +KDE_PROG_LIBTOOL + +dnl for NLS support. Call them in this order! +dnl WITH_NLS is for the po files +AM_KDE_WITH_NLS + +KDE_USE_QT(3.3) +AC_PATH_KDE +dnl ======================================================= +dnl FILE: configure.in.in +dnl ======================================================= + +#MIN_CONFIG(3.3) + +dnl PACKAGE set before + +sq_kipi="yes" +AC_ARG_ENABLE(kipi, + [AS_HELP_STRING([--disable-kipi], [don't search for KIPI plugins [default=no]])], + [ case "${enableval}" in + yes) sq_kipi="yes" ;; + no) sq_kipi="no" ;; + *) AC_MSG_ERROR([bad value ${enableval} for this parameter]) ;; + esac] + ) + +sq_kexif="yes" +AC_ARG_ENABLE(kexif, + [AS_HELP_STRING([--disable-kexif], [don't search for KEXIF [default=no]])], + [ case "${enableval}" in + yes) sq_kexif="yes" ;; + no) sq_kexif="no" ;; + *) AC_MSG_ERROR([bad value ${enableval} for this parameter]) ;; + esac] + ) + +have_kpart="yes" +AC_ARG_ENABLE(kpart, + [AS_HELP_STRING([--disable-kpart], [don't compile Konqueror integration (KPart object) [default=no]])], + [ case "${enableval}" in + yes) ;; + no) have_kpart="no" ;; + *) AC_MSG_ERROR([bad value ${enableval} for this parameter]) ;; + esac] + ) + +AM_CONDITIONAL(SQ_HAVE_KPART, test x$have_kpart = xyes) + +have_klconf="yes" +AC_ARG_ENABLE(ksquirrel-libs-configurator, + [AS_HELP_STRING([--disable-ksquirrel-libs-configurator], [don't compile ksquirrel-libs configurator [default=no]])], + [ case "${enableval}" in + yes) ;; + no) have_klconf="no" ;; + *) AC_MSG_ERROR([bad value ${enableval} for this parameter]) ;; + esac] + ) + +AM_CONDITIONAL(SQ_HAVE_KLCONF, test x$have_klconf = xyes) + +# utime.h +AC_CHECK_HEADER([utime.h], AC_DEFINE([HAVE_UTIME_H], [], [utime.h support]), []) + +PKG_CHECK_MODULES([ksquirrellibs], ksquirrellibs, [ + + __cppflags=$CPPFLAGS + + CXXFLAGS="$ksquirrellibs_CFLAGS $CXXFLAGS" + CPPFLAGS="$ksquirrellibs_CFLAGS $CPPFLAGS" + + AC_SUBST(ksquirrellibs_LIBS) + + AC_LANG_SAVE + AC_LANG_CPLUSPLUS + + AC_CHECK_HEADERS([ksquirrel-libs/fileio.h], [], + [AC_MSG_ERROR([Ksquirrel-libs development files are not installed. Please install them first.])]) + + # restore language & CPPFLAGS + CPPFLAGS=${__cppflags} + AC_LANG_RESTORE + ], + [AC_MSG_ERROR([Ksquirrel-libs development file (.pc) is not installed. Please install ksquirrel-libs first.])] +) + +KDE_CHECK_HEADER(konq_operations.h, [], AC_MSG_ERROR("Header file konq_operations.h is missing. Please install libkonq-devel package.")) +KDE_CHECK_HEADER(kregexpeditorinterface.h, [AC_DEFINE([SQ_HAVE_KREGEXP], [], [kregexpeditorinterface.h support])], []) + +# Checks for OpenGL. +KDE_CHECK_HEADER([GL/gl.h], [], AC_MSG_ERROR("ksquirrel needs OpenGL (GL/gl.h, ...) and GLU (GL/glu.h) headers to be installed.")) + +AC_CHECK_LIB([GL], [glBegin], [LDFLAGS="-lGL $LDFLAGS"], [ogl="no"]) + +if test "x$ogl" = "xno"; then + AC_MSG_NOTICE([Maybe libGL requires libpthread...]) + unset ac_cv_lib_GL_glBegin + AC_CHECK_LIB([GL], [glBegin], [LDFLAGS="-lpthread -lGL $LDFLAGS"], AC_MSG_ERROR([Cannot use -lGL]), [-lpthread]) +fi + +AM_PROG_AS + +# MMX test duped from kdelibs/kdefx - it should be probably moved to admin/ +dnl ----------------------------------------------------- +dnl IA32 checks +dnl ----------------------------------------------------- + +ksquirrel_asm_defs= +case $host_cpu in + i*86 ) + AC_MSG_CHECKING(for assembler support for IA32 extensions) + + dnl MMX check + AC_TRY_COMPILE(, [ __asm__("pxor %mm0, %mm0") ], + [ + echo $ECHO_N "MMX yes$ECHO_C" + AC_DEFINE_UNQUOTED(HAVE_X86_MMX, 1, [Define to 1 if the assembler supports MMX instructions.]) + ksquirrel_asm_defs="$ksquirrel_asm_defs -DHAVE_X86_MMX" + ], [ echo $ECHO_N "MMX no$ECHO_C" ]) + + dnl SSE check + AC_TRY_COMPILE(,[ __asm__("xorps %xmm0, %xmm0") ], + [ + echo $ECHO_N ", SSE yes$ECHO_C" + AC_DEFINE_UNQUOTED(HAVE_X86_SSE, 1, [Define to 1 if the assembler supports SSE instructions.]) + ksquirrel_asm_defs="$ksquirrel_asm_defs -DHAVE_X86_SSE" + ], [ echo $ECHO_N ", SSE no$ECHO_C" ]) + + dnl SSE2 check + AC_TRY_COMPILE(, [ __asm__("xorpd %xmm0, %xmm0") ], + [ + echo $ECHO_N ", SSE2 yes$ECHO_C" + AC_DEFINE_UNQUOTED(HAVE_X86_SSE2, 1, [Define to 1 if the assembler supports SSE2 instructions.]) + ksquirrel_asm_defs="$ksquirrel_asm_defs -DHAVE_X86_SSE2" + ], [ echo $ECHO_N ", SSE2 no$ECHO_C" ]) + + dnl 3DNOW check + AC_TRY_COMPILE(, [ __asm__("femms") ], + [ + echo $ECHO_N ", 3DNOW yes$ECHO_C" + AC_DEFINE_UNQUOTED(HAVE_X86_3DNOW, 1, [Define to 1 if the assembler supports 3DNOW instructions.]) + ksquirrel_asm_defs="$ksquirrel_asm_defs -DHAVE_X86_3DNOW" + ], [ echo $ECHO_N ", 3DNOW no$ECHO_C" ]) + echo + ;; + powerpc ) + AC_MSG_CHECKING(for assembler support for AltiVec instructions) + dnl AltiVec check + AC_TRY_COMPILE(, [ __asm__("mtspr 256, %0\n\t" "vand %%v0, %%v0, %%v0" : : "r"(-1) ) ], + [ + echo $ECHO_N " yes$ECHO_C" + AC_DEFINE_UNQUOTED(HAVE_PPC_ALTIVEC, 1, [Define to 1 if the assembler supports AltiVec instructions.]) + ksquirrel_asm_defs="$ksquirrel_asm_defs -DHAVE_PPC_ALTIVEC" + ], [ echo $ECHO_N ", AltiVec no$ECHO_C" ]) + echo + ;; +esac + +KSQUIRREL_ASM_DEFS="$ksquirrel_asm_defs" +AC_SUBST(KSQUIRREL_ASM_DEFS) + +# +# KIPI +# +have_kipi=no +if test x$sq_kipi = xyes; then +PKG_CHECK_MODULES([libkipi], libkipi, [ + _cxxflags=$CXXFLAGS + _ldflags=$LDFLAGS + + CXXFLAGS="$libkipi_CFLAGS $CXXFLAGS" + LDFLAGS="$LDFLAGS $libkipi_LIBS" + + KDE_CHECK_HEADER(libkipi/interface.h, have_kipi=yes, have_kipi=no) + if test "$have_kipi" = "yes"; then + AC_DEFINE(SQ_HAVE_KIPI, [], [If we have libkipi installed]) + else + AC_WARN([Can't find KIPI headers, KSquirrel won't be compiled with KIPI support]) + fi + + CXXFLAGS=$_cxxflags + LDFLAGS=$_ldflags + ], + [AC_WARN([KIPI development file (.pc) was not found. KIPI support will be disabled.])] +) +fi + +# +# KEXIF +# +have_kexif=no +if test x$sq_kexif = xyes; then +PKG_CHECK_MODULES([libkexif], libkexif, [ + _cxxflags=$CXXFLAGS + _ldflags=$LDFLAGS + + CXXFLAGS="$libkexif_CFLAGS $CXXFLAGS" + LDFLAGS="$LDFLAGS $libkexif_LIBS" + + KDE_CHECK_HEADER(libkexif/kexifdata.h, have_kexif=yes, have_kexif=no) + if test "$have_kexif" = "yes"; then + AC_DEFINE(SQ_HAVE_KEXIF, [], [If we have libkexif installed]) + else + AC_WARN([Can't find KEXIF headers, KSquirrel won't be compiled with KEXIF support]) + fi + + CXXFLAGS=$_cxxflags + LDFLAGS=$_ldflags + ], + [AC_WARN([KEXIF development file (.pc) was not found. KEXIF support will be disabled.])] +) +fi + +AM_CONDITIONAL(SQ_HAVE_KIPI, test x$have_kipi = xyes) +AM_CONDITIONAL(SQ_HAVE_KEXIF, test x$have_kexif = xyes) +KDE_CREATE_SUBDIRSLIST +AC_CONFIG_FILES([ Makefile ]) +AC_CONFIG_FILES([ doc/Makefile ]) +AC_CONFIG_FILES([ doc/ru/Makefile ]) +AC_CONFIG_FILES([ ksquirrel/Makefile ]) +AC_CONFIG_FILES([ ksquirrel/imageedit/Makefile ]) +AC_CONFIG_FILES([ ksquirrel/ksquirrel-libs-configurator/Makefile ]) +AC_CONFIG_FILES([ ksquirrel/ksquirrelpart/Makefile ]) +AC_CONFIG_FILES([ ksquirrel/mime/Makefile ]) +AC_CONFIG_FILES([ ksquirrel/sidebar/Makefile ]) +AC_CONFIG_FILES([ pics/Makefile ]) +AC_CONFIG_FILES([ pics/imageedit/Makefile ]) +AC_CONFIG_FILES([ pics/menu/Makefile ]) +AC_CONFIG_FILES([ pics/toolbar/Makefile ]) +AC_CONFIG_FILES([ po/Makefile ]) +AC_OUTPUT +echo +echo "Results:" +echo "--------" +echo +echo "Version: ${VERSION}" +echo "KPart object: $have_kpart" +echo "ksquirrel-libs configurator: $have_klconf" +echo +echo "C compiler: ${CC}" +echo "C++ compiler: ${CXX}" +echo "CXXFLAGS: ${CXXFLAGS}" +echo +echo "Prefix: ${prefix}" +echo "KDE prefix: ${kde_libs_prefix}" +echo +echo "KIPI support: ${have_kipi}" +echo "KEXIF support: ${have_kexif}" +echo "ASM flags: ${KSQUIRREL_ASM_DEFS}" +# Check if KDE_SET_PREFIX was called, and --prefix was passed to configure +if test -n "$kde_libs_prefix" -a -n "$given_prefix"; then + # And if so, warn when they don't match + if test "$kde_libs_prefix" != "$given_prefix"; then + # And if kde doesn't know about the prefix yet + echo ":"`kde-config --path exe`":" | grep ":$given_prefix/bin/:" 2>&1 >/dev/null + if test $? -ne 0; then + echo "" + echo "Warning: you chose to install this package in $given_prefix," + echo "but KDE was found in $kde_libs_prefix." + echo "For this to work, you will need to tell KDE about the new prefix, by ensuring" + echo "that KDEDIRS contains it, e.g. export KDEDIRS=$given_prefix:$kde_libs_prefix" + echo "Then restart KDE." + echo "" + fi + fi +fi + +if test x$GXX = "xyes" -a x$kde_have_gcc_visibility = "xyes" -a x$kde_cv_val_qt_gcc_visibility_patched = "xno"; then + echo "" + echo "Your GCC supports symbol visibility, but the patch for Qt supporting visibility" + echo "was not included. Therefore, GCC symbol visibility support remains disabled." + echo "" + echo "For better performance, consider including the Qt visibility supporting patch" + echo "located at:" + echo "" + echo "http://bugs.kde.org/show_bug.cgi?id=109386" + echo "" + echo "and recompile all of Qt and KDE. Note, this is entirely optional and" + echo "everything will continue to work just fine without it." + echo "" +fi + +if test "$all_tests" = "bad"; then + if test ! "$cache_file" = "/dev/null"; then + echo "" + echo "Please remove the file $cache_file after changing your setup" + echo "so that configure will find the changes next time." + echo "" + fi +else + echo "" + echo "Good - your configure finished. Start make now" + echo "" +fi diff --git a/configure.in.bot b/configure.in.bot new file mode 100644 index 0000000..79003c3 --- /dev/null +++ b/configure.in.bot @@ -0,0 +1,18 @@ +echo +echo "Results:" +echo "--------" +echo +echo "Version: ${VERSION}" +echo "KPart object: $have_kpart" +echo "ksquirrel-libs configurator: $have_klconf" +echo +echo "C compiler: ${CC}" +echo "C++ compiler: ${CXX}" +echo "CXXFLAGS: ${CXXFLAGS}" +echo +echo "Prefix: ${prefix}" +echo "KDE prefix: ${kde_libs_prefix}" +echo +echo "KIPI support: ${have_kipi}" +echo "KEXIF support: ${have_kexif}" +echo "ASM flags: ${KSQUIRREL_ASM_DEFS}" diff --git a/configure.in.in b/configure.in.in new file mode 100644 index 0000000..68b04cf --- /dev/null +++ b/configure.in.in @@ -0,0 +1,202 @@ +#MIN_CONFIG(3.3) + +AM_INIT_AUTOMAKE(ksquirrel,0.8.0) + +sq_kipi="yes" +AC_ARG_ENABLE(kipi, + [AS_HELP_STRING([--disable-kipi], [don't search for KIPI plugins [default=no]])], + [ case "${enableval}" in + yes) sq_kipi="yes" ;; + no) sq_kipi="no" ;; + *) AC_MSG_ERROR([bad value ${enableval} for this parameter]) ;; + esac] + ) + +sq_kexif="yes" +AC_ARG_ENABLE(kexif, + [AS_HELP_STRING([--disable-kexif], [don't search for KEXIF [default=no]])], + [ case "${enableval}" in + yes) sq_kexif="yes" ;; + no) sq_kexif="no" ;; + *) AC_MSG_ERROR([bad value ${enableval} for this parameter]) ;; + esac] + ) + +have_kpart="yes" +AC_ARG_ENABLE(kpart, + [AS_HELP_STRING([--disable-kpart], [don't compile Konqueror integration (KPart object) [default=no]])], + [ case "${enableval}" in + yes) ;; + no) have_kpart="no" ;; + *) AC_MSG_ERROR([bad value ${enableval} for this parameter]) ;; + esac] + ) + +AM_CONDITIONAL(SQ_HAVE_KPART, test x$have_kpart = xyes) + +have_klconf="yes" +AC_ARG_ENABLE(ksquirrel-libs-configurator, + [AS_HELP_STRING([--disable-ksquirrel-libs-configurator], [don't compile ksquirrel-libs configurator [default=no]])], + [ case "${enableval}" in + yes) ;; + no) have_klconf="no" ;; + *) AC_MSG_ERROR([bad value ${enableval} for this parameter]) ;; + esac] + ) + +AM_CONDITIONAL(SQ_HAVE_KLCONF, test x$have_klconf = xyes) + +# utime.h +AC_CHECK_HEADER([utime.h], AC_DEFINE([HAVE_UTIME_H], [], [utime.h support]), []) + +PKG_CHECK_MODULES([ksquirrellibs], ksquirrellibs, [ + + __cppflags=$CPPFLAGS + + CXXFLAGS="$ksquirrellibs_CFLAGS $CXXFLAGS" + CPPFLAGS="$ksquirrellibs_CFLAGS $CPPFLAGS" + + AC_SUBST(ksquirrellibs_LIBS) + + AC_LANG_SAVE + AC_LANG_CPLUSPLUS + + AC_CHECK_HEADERS([ksquirrel-libs/fileio.h], [], + [AC_MSG_ERROR([Ksquirrel-libs development files are not installed. Please install them first.])]) + + # restore language & CPPFLAGS + CPPFLAGS=${__cppflags} + AC_LANG_RESTORE + ], + [AC_MSG_ERROR([Ksquirrel-libs development file (.pc) is not installed. Please install ksquirrel-libs first.])] +) + +KDE_CHECK_HEADER(konq_operations.h, [], AC_MSG_ERROR("Header file konq_operations.h is missing. Please install libkonq-devel package.")) +KDE_CHECK_HEADER(kregexpeditorinterface.h, [AC_DEFINE([SQ_HAVE_KREGEXP], [], [kregexpeditorinterface.h support])], []) + +# Checks for OpenGL. +KDE_CHECK_HEADER([GL/gl.h], [], AC_MSG_ERROR("ksquirrel needs OpenGL (GL/gl.h, ...) and GLU (GL/glu.h) headers to be installed.")) + +AC_CHECK_LIB([GL], [glBegin], [LDFLAGS="-lGL $LDFLAGS"], [ogl="no"]) + +if test "x$ogl" = "xno"; then + AC_MSG_NOTICE([Maybe libGL requires libpthread...]) + unset ac_cv_lib_GL_glBegin + AC_CHECK_LIB([GL], [glBegin], [LDFLAGS="-lpthread -lGL $LDFLAGS"], AC_MSG_ERROR([Cannot use -lGL]), [-lpthread]) +fi + +AM_PROG_AS + +# MMX test duped from kdelibs/kdefx - it should be probably moved to admin/ +dnl ----------------------------------------------------- +dnl IA32 checks +dnl ----------------------------------------------------- + +ksquirrel_asm_defs= +case $host_cpu in + i*86 ) + AC_MSG_CHECKING(for assembler support for IA32 extensions) + + dnl MMX check + AC_TRY_COMPILE(, [ __asm__("pxor %mm0, %mm0") ], + [ + echo $ECHO_N "MMX yes$ECHO_C" + AC_DEFINE_UNQUOTED(HAVE_X86_MMX, 1, [Define to 1 if the assembler supports MMX instructions.]) + ksquirrel_asm_defs="$ksquirrel_asm_defs -DHAVE_X86_MMX" + ], [ echo $ECHO_N "MMX no$ECHO_C" ]) + + dnl SSE check + AC_TRY_COMPILE(,[ __asm__("xorps %xmm0, %xmm0") ], + [ + echo $ECHO_N ", SSE yes$ECHO_C" + AC_DEFINE_UNQUOTED(HAVE_X86_SSE, 1, [Define to 1 if the assembler supports SSE instructions.]) + ksquirrel_asm_defs="$ksquirrel_asm_defs -DHAVE_X86_SSE" + ], [ echo $ECHO_N ", SSE no$ECHO_C" ]) + + dnl SSE2 check + AC_TRY_COMPILE(, [ __asm__("xorpd %xmm0, %xmm0") ], + [ + echo $ECHO_N ", SSE2 yes$ECHO_C" + AC_DEFINE_UNQUOTED(HAVE_X86_SSE2, 1, [Define to 1 if the assembler supports SSE2 instructions.]) + ksquirrel_asm_defs="$ksquirrel_asm_defs -DHAVE_X86_SSE2" + ], [ echo $ECHO_N ", SSE2 no$ECHO_C" ]) + + dnl 3DNOW check + AC_TRY_COMPILE(, [ __asm__("femms") ], + [ + echo $ECHO_N ", 3DNOW yes$ECHO_C" + AC_DEFINE_UNQUOTED(HAVE_X86_3DNOW, 1, [Define to 1 if the assembler supports 3DNOW instructions.]) + ksquirrel_asm_defs="$ksquirrel_asm_defs -DHAVE_X86_3DNOW" + ], [ echo $ECHO_N ", 3DNOW no$ECHO_C" ]) + echo + ;; + powerpc ) + AC_MSG_CHECKING(for assembler support for AltiVec instructions) + dnl AltiVec check + AC_TRY_COMPILE(, [ __asm__("mtspr 256, %0\n\t" "vand %%v0, %%v0, %%v0" : : "r"(-1) ) ], + [ + echo $ECHO_N " yes$ECHO_C" + AC_DEFINE_UNQUOTED(HAVE_PPC_ALTIVEC, 1, [Define to 1 if the assembler supports AltiVec instructions.]) + ksquirrel_asm_defs="$ksquirrel_asm_defs -DHAVE_PPC_ALTIVEC" + ], [ echo $ECHO_N ", AltiVec no$ECHO_C" ]) + echo + ;; +esac + +KSQUIRREL_ASM_DEFS="$ksquirrel_asm_defs" +AC_SUBST(KSQUIRREL_ASM_DEFS) + +# +# KIPI +# +have_kipi=no +if test x$sq_kipi = xyes; then +PKG_CHECK_MODULES([libkipi], libkipi, [ + _cxxflags=$CXXFLAGS + _ldflags=$LDFLAGS + + CXXFLAGS="$libkipi_CFLAGS $CXXFLAGS" + LDFLAGS="$LDFLAGS $libkipi_LIBS" + + KDE_CHECK_HEADER(libkipi/interface.h, have_kipi=yes, have_kipi=no) + if test "$have_kipi" = "yes"; then + AC_DEFINE(SQ_HAVE_KIPI, [], [If we have libkipi installed]) + else + AC_WARN([Can't find KIPI headers, KSquirrel won't be compiled with KIPI support]) + fi + + CXXFLAGS=$_cxxflags + LDFLAGS=$_ldflags + ], + [AC_WARN([KIPI development file (.pc) was not found. KIPI support will be disabled.])] +) +fi + +# +# KEXIF +# +have_kexif=no +if test x$sq_kexif = xyes; then +PKG_CHECK_MODULES([libkexif], libkexif, [ + _cxxflags=$CXXFLAGS + _ldflags=$LDFLAGS + + CXXFLAGS="$libkexif_CFLAGS $CXXFLAGS" + LDFLAGS="$LDFLAGS $libkexif_LIBS" + + KDE_CHECK_HEADER(libkexif/kexifdata.h, have_kexif=yes, have_kexif=no) + if test "$have_kexif" = "yes"; then + AC_DEFINE(SQ_HAVE_KEXIF, [], [If we have libkexif installed]) + else + AC_WARN([Can't find KEXIF headers, KSquirrel won't be compiled with KEXIF support]) + fi + + CXXFLAGS=$_cxxflags + LDFLAGS=$_ldflags + ], + [AC_WARN([KEXIF development file (.pc) was not found. KEXIF support will be disabled.])] +) +fi + +AM_CONDITIONAL(SQ_HAVE_KIPI, test x$have_kipi = xyes) +AM_CONDITIONAL(SQ_HAVE_KEXIF, test x$have_kexif = xyes) diff --git a/control b/control new file mode 100644 index 0000000..913c464 --- /dev/null +++ b/control @@ -0,0 +1,9 @@ +Package: ksquirrel-libs +Priority: extra +Section: checkinstall +Installed-Size: 3236 +Maintainer: ksquirrel@mail.ru +Architecture: i386 +Version: 0.7.3-1etch +Depends: liblcms1, libjpeg62, libopenexr2c2a, libmng1, libpng12-0, transfig, netpbm, djvulibre-bin, libfreetype6, libjasper-1.701-1, libtiff4, libungif4g, libwmf0.2-7, librsvg2-bin, medcon, zlib1g +Description: Set of image codecs for KSquirrel diff --git a/description-pak b/description-pak new file mode 100644 index 0000000..74f3dcd --- /dev/null +++ b/description-pak @@ -0,0 +1 @@ +KSquirrel image viewer for KDE diff --git a/doc/Makefile.am b/doc/Makefile.am new file mode 100644 index 0000000..b527d71 --- /dev/null +++ b/doc/Makefile.am @@ -0,0 +1,7 @@ +####### kdevelop will overwrite this part!!! (begin)########## + + +####### kdevelop will overwrite this part!!! (end)############ +SUBDIRS = ru + +man_MANS = ksquirrel.1 diff --git a/doc/ksquirrel.1 b/doc/ksquirrel.1 new file mode 100644 index 0000000..d8e3a60 --- /dev/null +++ b/doc/ksquirrel.1 @@ -0,0 +1,68 @@ +.TH KSQUIRREL 1 "September 2005" "K Desktop Environment" "Image viewer for KDE" +.SH NAME +KSquirrel \- An image viewer for KDE with dynamic format support +.SH SYNOPSIS +.B ksquirrel +[\fIoptions\fR] [\fIfile\fR] +.SH DESCRIPTION +KSquirrel is an image viewer for KDE with disk navigator, file tree, thumbnails, extended thumbnails, dynamic format support, DCOP interface and KIPI plugins support. +.PP +Image loading is based on external codecs \- ksquirrel\-libs. It supports dozens of various image formats, including SVG, WMF, JPEG2000, APNG and PSD. +.SH OPTIONS +.SS Arguments: +.TP +.B file +An initial image file or folder. +.SS KSquirrel options: +.TP +.B \-l +Show found image codecs and exit. +.TP +.B \-d +Print available DCOP parameters. +.TP +.B \--nodirectorybasket +Don't create directory basket +.TP +.B \--noimagebasket +Don't create image basket +.TP +.B \--nocategories +Don't create categories +.TP +.B \--nomountview +Don't create mount view + +.SS Generic options: +.TP +.B \-\-help +Show help about options. +.TP +.B \-\-help\-qt +Show Qt specific options. +.TP +.B \-\-help\-kde +Show KDE specific options. +.TP +.B \-\-help\-all +Show all options. +.TP +.B \-\-author +Show author information. +.TP +.B \-v\fR, \fB\-\-version +Show version information. +.TP +.B \-\-license +Show license information. +.TP +.B \-\- +End of options. +.SH "SEE ALSO" +The KSquirrel homepage can be found at \fIhttp://ksquirrel.sourceforge.net\fR. +.SH BUGS +To report a bug, please send a e\-mail to \fIksquirrel.iv@gmail.com\fR. +.SH AUTHOR +KSquirrel and ksquirrel-libs were written by Dmitry Baryshev . +.PP +This manual page was written by Dmitry Baryshev . diff --git a/doc/ru/Makefile.am b/doc/ru/Makefile.am new file mode 100644 index 0000000..33fec9f --- /dev/null +++ b/doc/ru/Makefile.am @@ -0,0 +1,2 @@ +KDE_LANG = ru +KDE_DOCS = ksquirrel diff --git a/doc/ru/credits.docbook b/doc/ru/credits.docbook new file mode 100644 index 0000000..4bfe1f8 --- /dev/null +++ b/doc/ru/credits.docbook @@ -0,0 +1,30 @@ + + + + +&Dmitry.Baryshev; + + + +2007-03-10 +0.3 + + +Лицензия, авторские права и благодарности + + +&kappname; и &klibname; разработаны и сопровождаются © 2003-2007 Барышевым Дмитрием Алексеевичем. Русская версия данного документа создана © 2006 Барышевым Дмитрием Алексеевичем. Вы можете связаться со мной по электронному адресу ksquirrel.iv@gmail.com. + + + +Лицензирование &kappname; +Лицензирование &klibname; +Лицензирование этого документа + +&underGPL; +GNU LIBRARY GENERAL PUBLIC LICENSE v.2 +&underFDL; + + + + diff --git a/doc/ru/imagewindow.docbook b/doc/ru/imagewindow.docbook new file mode 100644 index 0000000..8eff182 --- /dev/null +++ b/doc/ru/imagewindow.docbook @@ -0,0 +1,26 @@ + + + + +&Dmitry.Baryshev; + + + +2007-03-10 +0.3 + + +Окно просмотра изображения + + +Общее описание + +В окне просмотра изображения вы можете видеть открытую в данный момент картинку. Данное окно имеет панель инструментов с необходимыми Вам действиями для управления картинкой - масштабирование, поворот, сдвиг, и окном непосредственно - перейти в полноэкранный режим и др. Также в окне просмотра изображения имеется строка статуса, в которой отображается некоторая полезная информация, как то: размеры изображения, фактор масштабирования, имя файла и др. По правой кнопке мыши Вы можете вызвать контекстное меню. + + +В окне просмотра изображения действует множество сочетаний клавиш. Чтобы просмотреть, какие клавиши какие функции выполняют, достаточно выбрать Горячие клавиши из контекстного меню. Можно лишь упомянуть, что задействованы многие общепринятые сочетания, такие как PageUp, PageDown, +/-, Space, BackSpace. + + + + + diff --git a/doc/ru/imagewindow.html b/doc/ru/imagewindow.html new file mode 100644 index 0000000..42d8592 --- /dev/null +++ b/doc/ru/imagewindow.html @@ -0,0 +1,4 @@ +Глава 4. Окно просмотра изображения
Окно просмотра изображения

Глава 4. Окно просмотра изображения

Дмитрий Алексеевич Барышев

Издание 0.3 (2007-03-10)

Общее описание

В окне просмотра изображения вы можете видеть открытую в данный момент картинку. Данное окно имеет панель инструментов с необходимыми Вам действиями для управления картинкой - масштабирование, поворот, сдвиг, и окном непосредственно - перейти в полноэкранный режим и др. Также в окне просмотра изображения имеется строка статуса, в которой отображается некоторая полезная информация, как то: размеры изображения, фактор масштабирования, имя файла и др. По правой кнопке мыши Вы можете вызвать контекстное меню.

+В окне просмотра изображения действует множество сочетаний клавиш. Чтобы просмотреть, какие клавиши какие функции выполняют, достаточно выбрать «Горячие клавиши» из контекстного меню. Можно лишь упомянуть, что задействованы многие общепринятые сочетания, такие как PageUp, PageDown, +/-, Space, BackSpace. +



Would you like to make a comment or contribute an update to this page?
+ Send feedback to the KDE Docs Team

\ No newline at end of file diff --git a/doc/ru/index.docbook b/doc/ru/index.docbook new file mode 100644 index 0000000..b7810f0 --- /dev/null +++ b/doc/ru/index.docbook @@ -0,0 +1,138 @@ + + + + Дмитрий Алексеевич Барышев"> + ksquirrel.iv@gmail.com"> + + + + + + + + + +]> + + +&kappname; Руководство Пользователя + + + + +ДмитрийБарышевАлексеевич +
ksquirrel.iv@gmail.com
+
+
+ + + + +2003-2007 +&Dmitry.Baryshev; + + +&FDLNotice; + +2007-03-10 +0.3.0 + +&kappname; это просмотрщик изображений для KDE реализующий OpenGL и поддерживающий модули KIPI. + + +KDE +image +viewer +picture + +
+&intro; +&internals; +&interface; +&imagewindow; +&running; +&credits; + + +Инсталляция + + +Установка из исходников + + +&kappname; из исходников устанавливается как обычно, за исключением некоторых моментов. Для успешной компиляции &kappname; Вам необходимо установить пакет kde-devel, и в системах типа Mandriva дополнительно kdebase-devel. Рассмотрим все шаги инсталляции подробнее. + + + +Установка &klibname; + + +Сперва необходимо установить &klibname;. + + +tar jxfv ksquirrel-libs-0.7.0.tar.bz2 +./configure.gnu +make +su -c make install + + + + + +Пояснения. + + +configure.gnu это просто обёртка вокруг configure - это обычный shell-скрипт, который вызывает configure с установленным префиксом. +Вместо configure.gnu Вы можете спокойно использовать + +./configure --prefix=/usr + + + + + + + +Установка &kappname; + + +Теперь установим &kappname; + + +tar jxfv ksquirrel-0.7.0.tar.bz2 +./configure.gnu +make +su -c make install + + + + + +Пояснения. + + +configure.gnu это просто обёртка вокруг configure - это обычный shell-скрипт, который вызывает configure с установленным префиксом и отключённой поддержкой arts. +Вместо configure.gnu Вы можете спокойно использовать + +./configure --prefix="`kde-config --prefix`" --without-arts + + + + + + + + +Установка из бинарных пакетов + +Чтобы установить &kappname; и &klibname; из бинарных пакетов, вы должны сперва проверить, нет ли их на предложенных Вам дисках Вашего дистрибутива. Если они нашлись, установите их стандартными средствами Вашего дистрибутива (например, apt-get в Debian, или urpmi в Mandriva). Если на дисках их не оказалось, попробуйте поискать в онлайн репозитариях Вашего дистрибутива, а также в http://google.com и http://ksquirrel.sourceforge.net/download.php. + + + + + + + +
diff --git a/doc/ru/index.html b/doc/ru/index.html new file mode 100644 index 0000000..e8db2e3 --- /dev/null +++ b/doc/ru/index.html @@ -0,0 +1,6 @@ +KSquirrel Руководство Пользователя
KSquirrel Руководство Пользователя

KSquirrel Руководство Пользователя

Дмитрий Алексеевич Барышев

Издание 0.3.0 (2007-03-10)

Разрешается копировать, распространять и/или изменять этот +документ на условиях лицензии GNU для свободной документации, +версии 1.1 или более поздней, опубликованной Фондом Free Software +Foundation; без неизменямых разделов, без текста на первой странице, +без текста на последней странице. Копия лицензии находится здесь the section entitled "GNU Free Documentation License".

KSquirrel это просмотрщик изображений для KDE реализующий OpenGL и поддерживающий модули KIPI.




Would you like to make a comment or contribute an update to this page?
+ Send feedback to the KDE Docs Team

\ No newline at end of file diff --git a/doc/ru/install-binary.html b/doc/ru/install-binary.html new file mode 100644 index 0000000..fd29a8a --- /dev/null +++ b/doc/ru/install-binary.html @@ -0,0 +1,4 @@ +Установка из бинарных пакетов
Установка из бинарных пакетов

Установка из бинарных пакетов

+Чтобы установить KSquirrel и ksquirrel-libs из бинарных пакетов, вы должны сперва проверить, нет ли их на предложенных Вам дисках Вашего дистрибутива. Если они нашлись, установите их стандартными средствами Вашего дистрибутива (например, apt-get в Debian, или urpmi в Mandriva). Если на дисках их не оказалось, попробуйте поискать в онлайн репозитариях Вашего дистрибутива, а также в http://google.com и http://ksquirrel.sourceforge.net/download.php. +



Would you like to make a comment or contribute an update to this page?
+ Send feedback to the KDE Docs Team

\ No newline at end of file diff --git a/doc/ru/installation.html b/doc/ru/installation.html new file mode 100644 index 0000000..9943728 --- /dev/null +++ b/doc/ru/installation.html @@ -0,0 +1,32 @@ +Приложение A. Инсталляция
Инсталляция

Приложение A. Инсталляция

Установка из исходников

+KSquirrel из исходников устанавливается как обычно, за исключением некоторых моментов. Для успешной компиляции KSquirrel Вам необходимо установить пакет kde-devel, и в системах типа Mandriva дополнительно kdebase-devel. Рассмотрим все шаги инсталляции подробнее. +

Установка ksquirrel-libs

+Сперва необходимо установить ksquirrel-libs. + +

  1. tar jxfv ksquirrel-libs-0.7.0.tar.bz2

  2. ./configure.gnu

  3. make

  4. su -c «make install»

+ +

+Пояснения. +

  • +configure.gnu это просто обёртка вокруг configure - это обычный shell-скрипт, который вызывает configure с установленным префиксом. +Вместо configure.gnu Вы можете спокойно использовать + +./configure --prefix=/usr +

+ +

Установка KSquirrel

+Теперь установим KSquirrel + +

  1. tar jxfv ksquirrel-0.7.0.tar.bz2

  2. ./configure.gnu

  3. make

  4. su -c «make install»

+ +

+Пояснения. +

  • +configure.gnu это просто обёртка вокруг configure - это обычный shell-скрипт, который вызывает configure с установленным префиксом и отключённой поддержкой arts. +Вместо configure.gnu Вы можете спокойно использовать + +./configure --prefix="`kde-config --prefix`" --without-arts +

+ +



Would you like to make a comment or contribute an update to this page?
+ Send feedback to the KDE Docs Team

\ No newline at end of file diff --git a/doc/ru/interface-menu.html b/doc/ru/interface-menu.html new file mode 100644 index 0000000..8c37b27 --- /dev/null +++ b/doc/ru/interface-menu.html @@ -0,0 +1,4 @@ +Меню
Меню

Меню

+Как и почти во всех графических программах, в KSquirrel имеется меню команд. В нём доступны все действия, касающиеся KSquirrel: открытие файла, переход в режим просмотра слайдов, выход из программы, просмотр списка найденных кодеков и др. +



Would you like to make a comment or contribute an update to this page?
+ Send feedback to the KDE Docs Team

\ No newline at end of file diff --git a/doc/ru/interface-sidebar.html b/doc/ru/interface-sidebar.html new file mode 100644 index 0000000..80b6ac1 --- /dev/null +++ b/doc/ru/interface-sidebar.html @@ -0,0 +1,15 @@ +Боковая панель
Боковая панель

Боковая панель

+В KSquirrel имеется боковая панель наподобие той, что Вы видели в Konqueror. Листая страницы с помощью мыши Вы можете переключаться на файловое дерево, список подключённых дисковых разделов, панель категорий и корзину изображений. + +

  1. Файловое дерево позволяет просматривать каталоги на диске в виде иерархического дерева. Обычно файловое дерево используется для быстрой навигации по каталогам. Также имеется возможность просматривать количество файлов и подкаталогов в каждом каталоге, выбирать несколько каталогов для просмотра в навигаторе. Файловое дерево представлено на скриншоте. +


    Боковая панель
    +

  2. Вид подключённых дисковых разделов позволяет просмотреть подключенные на данный момент (смонтированные) дисковые разделы. При клике на значок устройства навигатор переходит на заданный раздел. Если устройство не смонтировано, как например CD-ROM, KSquirrel сначала попытается смонтировать данное устройство и затем перейти на него в навигаторе. +


    Боковая панель: точки монтирования
    +

  3. Панель категорий содержит ссылки на файлы, разбитые по категориям. Чтобы добавить новые ссылки в категории, используйте контекстное меню в навигаторе. +


    Боковая панель: категории
    +

  4. Корзина изображений содержит ссылки на изображения, хранящиеся на жёстком диске. Эти ссылки могут быть использованы в модулях KIPI для редактирования реальных изображений. +


    Боковая панель: корзина
    +

+ +



Would you like to make a comment or contribute an update to this page?
+ Send feedback to the KDE Docs Team

\ No newline at end of file diff --git a/doc/ru/interface.docbook b/doc/ru/interface.docbook new file mode 100644 index 0000000..335919a --- /dev/null +++ b/doc/ru/interface.docbook @@ -0,0 +1,109 @@ + + + + +&Dmitry.Baryshev; + + + +2007-03-10 +0.3 + + +Интерфейс + + +Навигатор + + +&kappname; имеет простой файловый менеджер, который позволяет просматривать каталоги и файлы на Вашем жёстком диске. +Этот файловый менеджер, который мы называем навигатором, может представлять файлы и каталоги несколькими способами: в виде списка, иконок, детального просмотра и просмотра эскизов. + + +Эскизы + + + + +Эскизы + + + +В навигаторе также имеется возможность просматривать содержимое архивов .tar.gz, .tar.bz2, .zip, .rar (если установлен kio_rar), .7z (если установлен kio_p7zip), ходить по сети с помощью smb://, ftp:// и других протоколов, поддерживаемых kio-slaves. + + + + + + +Боковая панель + + +В &kappname; имеется боковая панель наподобие той, что Вы видели в &konqueror;. Листая страницы с помощью мыши Вы можете переключаться на файловое дерево, список подключённых дисковых разделов, панель категорий и корзину изображений. + + + +Файловое дерево позволяет просматривать каталоги на диске в виде иерархического дерева. Обычно файловое дерево используется для быстрой навигации по каталогам. Также имеется возможность просматривать количество файлов и подкаталогов в каждом каталоге, выбирать несколько каталогов для просмотра в навигаторе. Файловое дерево представлено на скриншоте. + +Боковая панель + + + + +Боковая панель + + + + +Вид подключённых дисковых разделов позволяет просмотреть подключенные на данный момент (смонтированные) дисковые разделы. При клике на значок устройства навигатор переходит на заданный раздел. Если устройство не смонтировано, как например CD-ROM, KSquirrel сначала попытается смонтировать данное устройство и затем перейти на него в навигаторе. + +Боковая панель: точки монтирования + + + + +Боковая панель: точки монтирования + + + + +Панель категорий содержит ссылки на файлы, разбитые по категориям. Чтобы добавить новые ссылки в категории, используйте контекстное меню в навигаторе. + +Боковая панель: категории + + + + +Боковая панель: категории + + + + +Корзина изображений содержит ссылки на изображения, хранящиеся на жёстком диске. Эти ссылки могут быть использованы в модулях KIPI для редактирования реальных изображений. + +Боковая панель: корзина + + + + +Боковая панель: корзина + + + + + + + + + + + +Меню + + +Как и почти во всех графических программах, в &kappname; имеется меню команд. В нём доступны все действия, касающиеся &kappname;: открытие файла, переход в режим просмотра слайдов, выход из программы, просмотр списка найденных кодеков и др. + + + + + diff --git a/doc/ru/interface.html b/doc/ru/interface.html new file mode 100644 index 0000000..e5434fb --- /dev/null +++ b/doc/ru/interface.html @@ -0,0 +1,10 @@ +Глава 3. Интерфейс
Интерфейс

Глава 3. Интерфейс

Дмитрий Алексеевич Барышев

Издание 0.3 (2007-03-10)

Навигатор

+KSquirrel имеет простой файловый менеджер, который позволяет просматривать каталоги и файлы на Вашем жёстком диске. +Этот файловый менеджер, который мы называем «навигатором», может представлять файлы и каталоги несколькими способами: в виде списка, иконок, детального просмотра и просмотра эскизов. + +


Эскизы
+ +В навигаторе также имеется возможность просматривать содержимое архивов .tar.gz, .tar.bz2, .zip, .rar (если установлен kio_rar), .7z (если установлен kio_p7zip), ходить по сети с помощью smb://, ftp:// и других протоколов, поддерживаемых kio-slaves. + +



Would you like to make a comment or contribute an update to this page?
+ Send feedback to the KDE Docs Team

\ No newline at end of file diff --git a/doc/ru/internals-libs.html b/doc/ru/internals-libs.html new file mode 100644 index 0000000..651df43 --- /dev/null +++ b/doc/ru/internals-libs.html @@ -0,0 +1,12 @@ +Свои библиотеки
Свои библиотеки

Свои библиотеки

Почти во всех программах просмотра изображений для декодирования используются сторонние библиотеки. Примером могут служить такие библиотеки как imlib (Image Magic) и Qt. На первый взгляд, преимущества такого способа очевидны - это перекладывание головной боли по декодированию изображений на другие библиотеки, вообще абстрагируясь от низкого уровня работы с изображениями, альфа каналами, битовыми масками, RLE кодированием и прочего. Но у этого способа есть несколько очевидных недостатков. К ним причисляется, во-первых, частичное отсутствие расширяемости набора кодеков изображений. Во-вторых, это зависимость кодеков от больших (а иногда очень больших) библиотек, типа Qt. В-третьих, отсутствие поддержки анимаций, типа GIF, FLI или MNG. В-четвёртых, отсутствие возможности декодирования отдельных строк.

+Исходя из всех этих недостатков, было решено отказаться от помощи сторонних библиотек и разработать собственные библиотеки, которые могли бы не зависеть от других библиотек, кроме стандартных и требуемых самими кодеками (такие, как libsvg, libmng и др.), загружаться динамически, быть полностью расширяемыми, поддерживать декодирование строк и анимацию. Эти библиотеки получили название «ksquirrel-libs». +

+На момент написания данной документации ksquirrel-libs поддерживал 51 формат изображений, включая PNG, JPEG, Photoshop PSD, AutoCAD DXF, WMF, SVG, MNG и GIF. Имеются также кодеки для поддержки файлов шрифтов TTF, анимаций FLI и X-овых курсоров. +

+ksquirrel-libs поддерживает также текстовые поля (комментарии и др.), сохраняемые в некоторых типах изображений. Например, PNG и GIF кодеки способны читать комментарии из данных типов файлов. +

Работа KSquirrel с библиотеками

+Благодаря вышеуказанным свойствам библиотек ksquirrel-libs, KSquirrel приобретает следущие особенности: + +

  1. KSquirrel практически не знает, какой кодек будет использован для декодирования изображения - это определяется динамически.

  2. KSquirrel практически не знает, сколько страниц в декодируемом изображении и является ли оно анимацией - это определяется динамически.

  3. Благодаря поддержке декодирования отдельных строк, KSquirrel показывает изображения прогрессивно, т.е. по мере декодирования.

+

Когда KSquirrel загрузил все найденные библиотеки (используя Qt класс QLibrary), появляется возможность отображать любые поддерживанмые типы изображений (как статичных, так и анимированных). Когда пользователь выбирает изображение в навигаторе, KSquirrel по MIME типу либо расширению файла определяет, поддерживается ли данный формат изображения. Если данный формат поддерживается, то, используя найденную библиотеку, KSquirrel приступает к декодированию изображения и отображению его в окне просмотра.

Информацию о всех найденных кодеках можно просмотеть в диалоге «Информация о плагинах», как показано на скриншоте.


Информация по найденным кодекам

Подсказка: слева от имени кодека может отображаться значёк настроек, как показано на рисунке для кодека GIMP XCF. Это означает, что данный кодек может быть настроен для работы с различными параметрами. Например, для кодека GIMP XCF можно настроить цвет фона для прозрачных изображений.



Would you like to make a comment or contribute an update to this page?
+ Send feedback to the KDE Docs Team

\ No newline at end of file diff --git a/doc/ru/internals.docbook b/doc/ru/internals.docbook new file mode 100644 index 0000000..0e66b22 --- /dev/null +++ b/doc/ru/internals.docbook @@ -0,0 +1,71 @@ + + + + +&Dmitry.Baryshev; + + + +2007-03-10 +0.3 + + +Отличие &kappname; от других просмотрщиков. Свои библиотеки. + + +Использование OpenGL. +На данный момент имеется возможность использовать несколько различных способов отображения изображений. В качестве движков можно использовать OpenGL, MIT-SHM, Qt, gdk-pixbuf с MMX оптимизацией. Главное их отличие друг от друга - это скорость. Например, отображение изображений с помощью средств Qt будет работать очень медленно (даже в случае наличия собственной MMX оптимизации), или же gdk-pixbuf для GTK приложений будет работать приемлимо для среднего размера изображений. + +Использование OpenGL в качестве движка просмотра изображений имеет свои преимущества и недостатки. В качестве преимущества можно упомянуть большую скорость манипулирования изображением (увеличение, уменьшение, повороты, сдвиги...), недоступную другим способам отображения. В противовес этому, как недостаток можно упомянуть наоборот очень низкую скорость манипулирования изображением, которое полностью не помещается в видеопамять Вашей видеокарты. Например, с большой вероятностью изображение 9600x9600 не поместится в видеопамять видеокарты среднего класса, как моей GF MX440, и масштабирование в окне просмотра будет работать крайне медленно. Таким образом, &kappname; отлично подходит для просмотра домашних изображений - иллюстраций стандартных размеров, сканированных листов A4, фотографий с цифрового фотоаппарата и т.п., но будет работать с затруднениями с огромными изображениями. + + + +Свои библиотеки + +Почти во всех программах просмотра изображений для декодирования используются сторонние библиотеки. Примером могут служить такие библиотеки как imlib (Image Magic) и Qt. На первый взгляд, преимущества такого способа очевидны - это перекладывание головной боли по декодированию изображений на другие библиотеки, вообще абстрагируясь от низкого уровня работы с изображениями, альфа каналами, битовыми масками, RLE кодированием и прочего. Но у этого способа есть несколько очевидных недостатков. К ним причисляется, во-первых, частичное отсутствие расширяемости набора кодеков изображений. Во-вторых, это зависимость кодеков от больших (а иногда очень больших) библиотек, типа Qt. В-третьих, отсутствие поддержки анимаций, типа GIF, FLI или MNG. В-четвёртых, отсутствие возможности декодирования отдельных строк. + + +Исходя из всех этих недостатков, было решено отказаться от помощи сторонних библиотек и разработать собственные библиотеки, которые могли бы не зависеть от других библиотек, кроме стандартных и требуемых самими кодеками (такие, как libsvg, libmng и др.), загружаться динамически, быть полностью расширяемыми, поддерживать декодирование строк и анимацию. Эти библиотеки получили название &klibname;. + + + +На момент написания данной документации &klibname; поддерживал 51 формат изображений, включая PNG, JPEG, Photoshop PSD, AutoCAD DXF, WMF, SVG, MNG и GIF. Имеются также кодеки для поддержки файлов шрифтов TTF, анимаций FLI и X-овых курсоров. + + + +&klibname; поддерживает также текстовые поля (комментарии и др.), сохраняемые в некоторых типах изображений. Например, PNG и GIF кодеки способны читать комментарии из данных типов файлов. + + + +Работа &kappname; с библиотеками + + +Благодаря вышеуказанным свойствам библиотек &klibname;, &kappname; приобретает следущие особенности: + + +&kappname; практически не знает, какой кодек будет использован для декодирования изображения - это определяется динамически. +&kappname; практически не знает, сколько страниц в декодируемом изображении и является ли оно анимацией - это определяется динамически. +Благодаря поддержке декодирования отдельных строк, &kappname; показывает изображения прогрессивно, т.е. по мере декодирования. + + + +Когда &kappname; загрузил все найденные библиотеки (используя Qt класс QLibrary), появляется возможность отображать любые поддерживанмые типы изображений (как статичных, так и анимированных). Когда пользователь выбирает изображение в навигаторе, &kappname; по MIME типу либо расширению файла определяет, поддерживается ли данный формат изображения. Если данный формат поддерживается, то, используя найденную библиотеку, &kappname; приступает к декодированию изображения и отображению его в окне просмотра. + +Информацию о всех найденных кодеках можно просмотеть в диалоге Информация о плагинах, как показано на скриншоте. + + +Информация по найденным кодекам + + + + +Информация по найденным кодекам + + + +Подсказка: слева от имени кодека может отображаться значёк настроек, как показано на рисунке для кодека GIMP XCF. Это означает, что данный кодек может быть настроен для работы с различными параметрами. Например, для кодека GIMP XCF можно настроить цвет фона для прозрачных изображений. + + + + + diff --git a/doc/ru/internals.html b/doc/ru/internals.html new file mode 100644 index 0000000..1b56f27 --- /dev/null +++ b/doc/ru/internals.html @@ -0,0 +1,2 @@ +Глава 2. Отличие KSquirrel от других просмотрщиков. Свои библиотеки.
Отличие KSquirrel от других просмотрщиков. Свои библиотеки.

Глава 2. Отличие KSquirrel от других просмотрщиков. Свои библиотеки.

Дмитрий Алексеевич Барышев

Издание 0.3 (2007-03-10)

Использование OpenGL.

На данный момент имеется возможность использовать несколько различных способов отображения изображений. В качестве движков можно использовать OpenGL, MIT-SHM, Qt, gdk-pixbuf с MMX оптимизацией. Главное их отличие друг от друга - это скорость. Например, отображение изображений с помощью средств Qt будет работать очень медленно (даже в случае наличия собственной MMX оптимизации), или же gdk-pixbuf для GTK приложений будет работать приемлимо для среднего размера изображений.

Использование OpenGL в качестве движка просмотра изображений имеет свои преимущества и недостатки. В качестве преимущества можно упомянуть большую скорость манипулирования изображением (увеличение, уменьшение, повороты, сдвиги...), недоступную другим способам отображения. В противовес этому, как недостаток можно упомянуть наоборот очень низкую скорость манипулирования изображением, которое полностью не помещается в видеопамять Вашей видеокарты. Например, с большой вероятностью изображение 9600x9600 не поместится в видеопамять видеокарты среднего класса, как моей GF MX440, и масштабирование в окне просмотра будет работать крайне медленно. Таким образом, KSquirrel отлично подходит для просмотра «домашних» изображений - иллюстраций стандартных размеров, сканированных листов A4, фотографий с цифрового фотоаппарата и т.п., но будет работать с затруднениями с огромными изображениями.



Would you like to make a comment or contribute an update to this page?
+ Send feedback to the KDE Docs Team

\ No newline at end of file diff --git a/doc/ru/intro.docbook b/doc/ru/intro.docbook new file mode 100644 index 0000000..a2e9359 --- /dev/null +++ b/doc/ru/intro.docbook @@ -0,0 +1,39 @@ + + + + +&Dmitry.Baryshev; + + + +2007-03-10 +0.3 + + +Вступление + + +Что такое &kappname; + + +&kappname; это просмотрщик изображений для KDE реализующий OpenGL и динамическую поддержу форматов изображений. + + + +&kappname; имеет простой файловый менеджер, который позволяет просматривать каталоги и файлы на Вашем жёстком диске. + + + +Поддержка модулей KIPI обеспечивает дополнильную функциональность. + + + +Боковая панель с несколькими вкладками добавляет возможности навигации по диску и управления изображениями. + + +Загрузка изображений осуществляется набором собственных кодеков, которые мы называем &klibname;. +&kappname; сможет отобразить все изображения, которые поддерживаются данным набором кодеков. + + + + diff --git a/doc/ru/intro.html b/doc/ru/intro.html new file mode 100644 index 0000000..c2d83ea --- /dev/null +++ b/doc/ru/intro.html @@ -0,0 +1,11 @@ +Глава 1. Вступление
Вступление

Глава 1. Вступление

Дмитрий Алексеевич Барышев

Издание 0.3 (2007-03-10)

Что такое KSquirrel

+KSquirrel это просмотрщик изображений для KDE реализующий OpenGL и динамическую поддержу форматов изображений. +

+KSquirrel имеет простой файловый менеджер, который позволяет просматривать каталоги и файлы на Вашем жёстком диске. +

+Поддержка модулей KIPI обеспечивает дополнильную функциональность. +

+Боковая панель с несколькими вкладками добавляет возможности навигации по диску и управления изображениями. +

Загрузка изображений осуществляется набором собственных кодеков, которые мы называем «ksquirrel-libs». +KSquirrel сможет отобразить все изображения, которые поддерживаются данным набором кодеков.



Would you like to make a comment or contribute an update to this page?
+ Send feedback to the KDE Docs Team

\ No newline at end of file diff --git a/doc/ru/license.html b/doc/ru/license.html new file mode 100644 index 0000000..c0dae39 --- /dev/null +++ b/doc/ru/license.html @@ -0,0 +1,7 @@ +Глава 6. Лицензия, авторские права и благодарности
Лицензия, авторские права и благодарности

Глава 6. Лицензия, авторские права и благодарности

Дмитрий Алексеевич Барышев

Издание 0.3 (2007-03-10)

+KSquirrel и ksquirrel-libs разработаны и сопровождаются (c) 2003-2007 Барышевым Дмитрием Алексеевичем. Русская версия данного документа создана (c) 2006 Барышевым Дмитрием Алексеевичем. Вы можете связаться со мной по электронному адресу . +

Лицензирование KSquirrel:

Программа распространяется на условиях лицензии GNU General Public License.

+
Лицензирование ksquirrel-libs: GNU LIBRARY GENERAL PUBLIC LICENSE v.2
Лицензирование этого документа:

+Этот документ распространяется на условиях GNU Free Documentation +License.



Would you like to make a comment or contribute an update to this page?
+ Send feedback to the KDE Docs Team

\ No newline at end of file diff --git a/doc/ru/plugins_info.png b/doc/ru/plugins_info.png new file mode 100644 index 0000000..2b4a0af Binary files /dev/null and b/doc/ru/plugins_info.png differ diff --git a/doc/ru/running.docbook b/doc/ru/running.docbook new file mode 100644 index 0000000..b5aaef8 --- /dev/null +++ b/doc/ru/running.docbook @@ -0,0 +1,95 @@ + + + + +&Dmitry.Baryshev; + + + +2007-03-10 +0.3 + + +Запуск &kappname; из командной строки + + +Аргументы командной строки для &kappname; и &klibname; + + +Аргументы командной строки для &kappname; + + +Команда запуска &kappname; из командной строки выглядит так: + + + +ksquirrel + + + + + + +файл + + + +Параметр -d заставляет &kappname; отобразить в консоли доступные параметры DCOP. + + + +Параметр -l указывает &kappname; вывести на экран список найденных кодеков и выйти. Этот параметр чисто информационный. + + + +--nodirectorybasket не создавать корзину папок. + + + +--noimagebasket не создавать корзину изображений. + + + +--nocategories не создавать категории. + + + +--nomountview не создавать просмотр точек монтирования. + + + +Параметр файл заставляет &kappname; открыть указанный файл при запуске. + + + + + +Примеры + + + + +Открыть при запуске изображение /home/me/images/foto00054.jpg + + +$ ksquirrel /home/me/images/foto00054.jpg + + + + + +Отобразить при запуске доступные параметры DCOP + + +$ ksquirrel -d + + + + + + + + + + + diff --git a/doc/ru/running.html b/doc/ru/running.html new file mode 100644 index 0000000..3798aaa --- /dev/null +++ b/doc/ru/running.html @@ -0,0 +1,28 @@ +Глава 5. Запуск KSquirrel из командной строки
Запуск KSquirrel из командной строки

Глава 5. Запуск KSquirrel из командной строки

Дмитрий Алексеевич Барышев

Издание 0.3 (2007-03-10)

Аргументы командной строки для KSquirrel и ksquirrel-libs

Аргументы командной строки для KSquirrel

+Команда запуска KSquirrel из командной строки выглядит так: +

ksquirrel [-d] [-l] [--nodirectorybasket] [--noimagebasket] [--nocategories] [--nomountview] [файл]

+Параметр -d заставляет KSquirrel отобразить в консоли доступные параметры DCOP. +

+Параметр -l указывает KSquirrel вывести на экран список найденных кодеков и выйти. Этот параметр чисто информационный. +

+--nodirectorybasket не создавать корзину папок. +

+--noimagebasket не создавать корзину изображений. +

+--nocategories не создавать категории. +

+--nomountview не создавать просмотр точек монтирования. +

+Параметр файл заставляет KSquirrel открыть указанный файл при запуске. +

Примеры

  • +Открыть при запуске изображение /home/me/images/foto00054.jpg + +

    $ ksquirrel /home/me/images/foto00054.jpg

    + +

  • +Отобразить при запуске доступные параметры DCOP + +

    $ ksquirrel -d

    + +



Would you like to make a comment or contribute an update to this page?
+ Send feedback to the KDE Docs Team

\ No newline at end of file diff --git a/doc/ru/sidebar.png b/doc/ru/sidebar.png new file mode 100644 index 0000000..d34f26c Binary files /dev/null and b/doc/ru/sidebar.png differ diff --git a/doc/ru/sidebar_basket.png b/doc/ru/sidebar_basket.png new file mode 100644 index 0000000..d88409f Binary files /dev/null and b/doc/ru/sidebar_basket.png differ diff --git a/doc/ru/sidebar_categories.png b/doc/ru/sidebar_categories.png new file mode 100644 index 0000000..c018e61 Binary files /dev/null and b/doc/ru/sidebar_categories.png differ diff --git a/doc/ru/sidebar_mounts.png b/doc/ru/sidebar_mounts.png new file mode 100644 index 0000000..c847e00 Binary files /dev/null and b/doc/ru/sidebar_mounts.png differ diff --git a/doc/ru/view_thumbnails.png b/doc/ru/view_thumbnails.png new file mode 100644 index 0000000..34c738d Binary files /dev/null and b/doc/ru/view_thumbnails.png differ diff --git a/fmt_filters_README b/fmt_filters_README new file mode 100644 index 0000000..72f0e8a --- /dev/null +++ b/fmt_filters_README @@ -0,0 +1,168 @@ +* fmt_filters is a regular C++ namespace. +* it is a set of image filters, written on pure C++. +* it is intended to create platform-independed filters, which can be used anywhere - + in KDE, GNOME, ... apps. +* these source files are distributed with ksquirrel from http://ksquirrel.sf.net. +* you can find the latest version of fmt_filters at http://ksquirrel.sf.net/subprojects.php. +* fmt_filters work with 32-bit image data. +* to use it in your project, simply add fmt_filters sources to your project. +* fmt_filters is distributed under the terms of LGPL. See COPYING for details. + +* at this time fmt_filters supports the following filters: + - colorize + - brightness + - contrast + - gamma + - negative + - swap RGB values + - blend + - fade + - togray + - desaturate + - threshold + - solarize + - spread + - swirl + - noise + - flatten + - wave + - shade + - equalize + - blur + - despeckle + - implode + - edge + - emboss + - sharpen + - oil + - redeye + +------------------------------------------------------------------- + +Copyrights: + + +* redeye +-------- + +Red-eye removal was taken from "redeye" plugin for GIMP + +/* redeye.c: redeye remover plugin code + * + * Copyright (C) 2004 Robert Merkel (the "Author"). + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + * Except as contained in this notice, the name of the Author of the + * Software shall not be used in advertising or otherwise to promote the + * sale, use or other dealings in this Software without prior written + * authorization from the Author. +1;3B */ + + +* most image processing filters ported from KImageEffect (KDE project, http://kde.org) +-------------------------------------------------------------------------------------- + +/* This file is part of the KDE libraries + Copyright (C) 1998, 1999, 2001, 2002 Daniel M. Duley + (C) 1998, 1999 Christian Tibirna + (C) 1998, 1999 Dirk A. Mueller + (C) 1999 Geert Jansen + (C) 2000 Josef Weidendorfer + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +*/ + +// +// =================================================================== +// Effects originally ported from ImageMagick for PixiePlus, plus a few +// new ones. (mosfet 05/26/2003) +// =================================================================== +// +/* + Portions of this software are based on ImageMagick. Such portions are clearly +marked as being ported from ImageMagick. ImageMagick is copyrighted under the +following conditions: + +Copyright (C) 2003 ImageMagick Studio, a non-profit organization dedicated to +making software imaging solutions freely available. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files ("ImageMagick"), to deal +in ImageMagick without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of ImageMagick, and to permit persons to whom the ImageMagick is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of ImageMagick. + +The software is provided "as is", without warranty of any kind, express or +implied, including but not limited to the warranties of merchantability, +fitness for a particular purpose and noninfringement. In no event shall +ImageMagick Studio be liable for any claim, damages or other liability, +whether in an action of contract, tort or otherwise, arising from, out of or +in connection with ImageMagick or the use or other dealings in ImageMagick. + +Except as contained in this notice, the name of the ImageMagick Studio shall +not be used in advertising or otherwise to promote the sale, use or other +dealings in ImageMagick without prior written authorization from the +ImageMagick Studio. +*/ + +------------------------------------------------------------------- + +Qt example: +----------- + +QImage im; + +im.load("sample.png"); + +im = im.convertDepth(32); + +fmt_filters::image img(sample.bits(), sample.width(), sample.height()); + +fmt_filters::implode(img, 50, fmt_filters::white); + +QPixmap p; + +p.convertFromImage(im); + +pixmapLabel->setPixmap(p); diff --git a/ksquirrel.kdevprj b/ksquirrel.kdevprj new file mode 100644 index 0000000..87e2677 --- /dev/null +++ b/ksquirrel.kdevprj @@ -0,0 +1,1781 @@ +[AUTHORS] +dist=true +install=false +install_location= +type=DATA + +[COPYING] +dist=true +install=false +install_location= +type=DATA + +[ChangeLog] +dist=true +install=false +install_location= +type=DATA + +[Config for BinMakefileAm] +addcxxflags= +bin_program=ksquirrel +cflags= +cppflags= +cxxflags=\s-O2 -Wall +ldadd=$(KDE_LDFLAGS) $(QT_LDFLAGS) $(LIB_KDEPRINT) $(LIB_KUTILS) $(LIB_KIO) $(ksquirrellibs_LIBS) -lkonq -lqui $(LIB_KDEUI) $(LIB_KDECORE) $(LIB_QT) +ldflags=\s-s \s + +[General] +AMChanged=false +author=Baryshev Dmitry +configure_args=\s--build=i386-linux --host=i386-linux --target=i386-linux --prefix=/usr --without-arts +email=ksquirrel.iv@gmail.com +kdevprj_version=1.3 +lfv_open_groups=Headers,Sources,User Interface +make_options=\s-j2 +makefiles=Makefile.am,ksquirrel/Makefile.am,doc/Makefile.am,po/Makefile.am,pics/Makefile.am,pics/menu/Makefile.am,pics/imageedit/Makefile.am,ksquirrel/sidebar/Makefile.am,pics/toolbar/Makefile.am,ksquirrel/imageedit/Makefile.am,ksquirrel/mime/Makefile.am +modifyMakefiles=true +project_name=KSquirrel +project_type=mini_kde2 +short_info=KSquirrel - image viewer for KDE +sub_dir=ksquirrel/ +version=0.8.0 +version_control=CVS +workspace=1 + +[INSTALL] +dist=true +install=false +install_location= +type=DATA + +[KPP] +kpp_appgrp=Graphic +kpp_bldroot=/usr +kpp_icon=0 +kpp_license=5 +kpp_summary=Ksquirrel - image viewer for KDE +kpp_url=http://ksquirrel.sf.net +kpp_version=0.5.0 + +[LFV Groups] +GNU=AUTHORS,COPYING,ChangeLog,INSTALL,README,TODO,NEWS +Headers=*.h,*.hh,*.hxx,*.hpp,*.H +Others=* +Sources=*.cpp,*.c,*.cc,*.C,*.cxx,*.ec,*.ecpp,*.lxx,*.l++,*.ll,*.l,*.s,*.S +Translations=*.po +User Interface=*.kdevdlg,*.ui,*.rc,*.dlg +groups=Headers,Sources,User Interface,Translations,GNU,Others + +[Makefile.am] +files=ksquirrel.kdevprj,admin,AUTHORS,COPYING,ChangeLog,INSTALL,README,TODO,ksquirrel.lsm +sub_dirs=ksquirrel,po,pics +type=normal + +[README] +dist=true +install=false +install_location= +type=DATA + +[TODO] +dist=true +install=false +install_location= +type=DATA + +[admin] +dist=true +install=false +install_location= +type=DATA + +[doc/Makefile.am] +sub_dirs= +type=normal + +[ksquirrel.kdevprj] +dist=true +install=false +install_location= +type=DATA + +[ksquirrel.lsm] +dist=true +install=false +install_location= +type=DATA + +[ksquirrel/Makefile.am] +files=ksquirrel/main.cpp,ksquirrel/ksquirrel.cpp,ksquirrel/ksquirrel.h,ksquirrel/hi32-app-ksquirrel.png,ksquirrel/hi16-app-ksquirrel.png,ksquirrel/sq_archivehandler.cpp,ksquirrel/sq_archivehandler.h,ksquirrel/sq_bookmarkowner.cpp,ksquirrel/sq_bookmarkowner.h,ksquirrel/sq_config.cpp,ksquirrel/sq_config.h,ksquirrel/sq_diroperator.cpp,ksquirrel/sq_diroperator.h,ksquirrel/sq_externaltool.cpp,ksquirrel/sq_externaltool.h,ksquirrel/sq_externaltools.ui,ksquirrel/sq_filedetailview.cpp,ksquirrel/sq_filedetailview.h,ksquirrel/sq_fileiconview.cpp,ksquirrel/sq_fileiconview.h,ksquirrel/sq_filters.ui,ksquirrel/sq_glu.cpp,ksquirrel/sq_glu.h,ksquirrel/sq_hloptions.cpp,ksquirrel/sq_hloptions.h,ksquirrel/sq_imageproperties.ui,ksquirrel/sq_libraryhandler.cpp,ksquirrel/sq_libraryhandler.h,ksquirrel/sq_options.ui,ksquirrel/sq_widgetstack.cpp,ksquirrel/sq_widgetstack.h,ksquirrel/sq_iconlistitem.cpp,ksquirrel/sq_iconlistitem.h,ksquirrel/sq_iconlistbox.cpp,ksquirrel/sq_iconlistbox.h,ksquirrel/sq_dir.cpp,ksquirrel/sq_dir.h,ksquirrel/sq_filethumbview.cpp,ksquirrel/sq_filethumbview.h,ksquirrel/sq_pixmapcache.cpp,ksquirrel/sq_pixmapcache.h,ksquirrel/sq_thumbnailsize.cpp,ksquirrel/sq_thumbnailsize.h,ksquirrel/sq_progress.cpp,ksquirrel/sq_progress.h,ksquirrel/sq_thumbnailinfo.h,ksquirrel/sq_filethumbviewitem.cpp,ksquirrel/sq_filethumbviewitem.h,ksquirrel/sq_viewcache.ui,ksquirrel/sq_glview.cpp,ksquirrel/sq_glview.h,ksquirrel/sq_helpwidget.ui,ksquirrel/sq_fileiconviewbase.cpp,ksquirrel/sq_fileiconviewbase.h,ksquirrel/sq_navigatordropmenu.cpp,ksquirrel/sq_navigatordropmenu.h,ksquirrel/sq_errorstring.cpp,ksquirrel/sq_errorstring.h,ksquirrel/fmt_filters.h,ksquirrel/sq_thumbnailcachemaster.ui,ksquirrel/sq_glwidget_helpers.h,ksquirrel/sq_library.h,ksquirrel/sq_selectdeselectgroup.ui,ksquirrel/sq_iconloader.cpp,ksquirrel/sq_iconloader.h,ksquirrel/sq_pluginsinfo.ui,ksquirrel/sq_iconloader_pixmaps.h,ksquirrel/sq_imageloader.cpp,ksquirrel/sq_imageloader.h,ksquirrel/sq_glwidget_helpers.cpp,ksquirrel/file_broken.xpm,ksquirrel/sq_glinfo.ui,ksquirrel/sq_popupmenu.cpp,ksquirrel/sq_popupmenu.h,ksquirrel/sq_splashscreen.cpp,ksquirrel/sq_splashscreen.h,ksquirrel/sq_thumbnailloadjob.cpp,ksquirrel/sq_thumbnailloadjob.h,ksquirrel/sq_progressbox.cpp,ksquirrel/sq_progressbox.h,ksquirrel/sq_kipiinterface.cpp,ksquirrel/sq_kipiinterface.h,ksquirrel/sq_kipimanager.cpp,ksquirrel/sq_kipimanager.h,ksquirrel/sq_codecsettingsskeleton.ui,ksquirrel/sq_codecsettingsskeleton.ui.h,ksquirrel/sq_filedialog.cpp,ksquirrel/sq_filedialog.h,ksquirrel/sq_codecsettings.cpp,ksquirrel/sq_codecsettings.h,ksquirrel/sq_glparts.cpp,ksquirrel/sq_glparts.h,ksquirrel/sq_glwidget.cpp,ksquirrel/sq_glwidget.h,ksquirrel/sq_slideshowwidget.h,ksquirrel/sq_glselectionpainter.cpp,ksquirrel/sq_glselectionpainter.h,ksquirrel/sq_downloader.cpp,ksquirrel/sq_downloader.h,ksquirrel/sq_dirthumbs.cpp,ksquirrel/sq_dirthumbs.h,ksquirrel/sq_thumbnailsunused.cpp,ksquirrel/sq_thumbnailsunused.h,ksquirrel/sq_slideshowlisting.ui.h,ksquirrel/sq_utils.cpp,ksquirrel/sq_utils.h,ksquirrel/konqksquirrel-dir.desktop,ksquirrel/sq_utils_asm_scale.S,ksquirrel/sq_utils_scale.cpp,ksquirrel/sq_dragprovider.cpp,ksquirrel/sq_dragprovider.h,ksquirrel/sq_tabopendialog.ui,ksquirrel/sq_glwidget_stuff.cpp,ksquirrel/dolphksquirrel-dir.desktop,ksquirrel/fmt_filters.cpp,ksquirrel/sq_slideshowlisting.ui,ksquirrel/sq_slideshow.ui,ksquirrel/sq_slideshowwidget.cpp +sub_dirs=sidebar,imageedit,mime +type=prog_main + +[ksquirrel/dolphksquirrel-dir.desktop] +dist=true +install=true +install_location=$$(kde_datadir)/dolphin/servicemenus/dolphksquirrel-dir.desktop +type=DATA + +[ksquirrel/file_broken.xpm] +dist=true +install=false +install_location= +type=DATA + +[ksquirrel/fmt_filters.cpp] +dist=true +install=false +install_location= +type=SOURCE + +[ksquirrel/fmt_filters.h] +dist=true +install=false +install_location= +type=HEADER + +[ksquirrel/hi16-app-ksquirrel.png] +dist=true +install=true +install_location=$$(kde_icondir)/hicolor/16x16/apps/ksquirrel.png +type=DATA + +[ksquirrel/hi32-app-ksquirrel.png] +dist=true +install=true +install_location=$$(kde_icondir)/hicolor/32x32/apps/ksquirrel.png +type=DATA + +[ksquirrel/imageedit/Makefile.am] +files=ksquirrel/imageedit/sq_bcglabel.h,ksquirrel/imageedit/sq_converter.h,ksquirrel/imageedit/sq_imagebcg.ui.h,ksquirrel/imageedit/sq_imageconvert.ui.h,ksquirrel/imageedit/sq_imageedit.h,ksquirrel/imageedit/sq_imageeditoptions.ui.h,ksquirrel/imageedit/sq_imagefilter.ui.h,ksquirrel/imageedit/sq_label.h,ksquirrel/imageedit/sq_bcglabel.cpp,ksquirrel/imageedit/sq_converter.cpp,ksquirrel/imageedit/sq_imagebcg.ui,ksquirrel/imageedit/sq_imageconvert.ui,ksquirrel/imageedit/sq_imageeditoptions.ui,ksquirrel/imageedit/sq_imagefilter.ui,ksquirrel/imageedit/sq_label.cpp,ksquirrel/imageedit/sq_writeoption.ui +sharedlib_LDFLAGS=-version-info 0:0:0 +sharedlib_rootname=imageedit +sub_dirs= +type=static_library + +[ksquirrel/imageedit/sq_bcglabel.cpp] +dist=true +install=false +install_location= +type=SOURCE + +[ksquirrel/imageedit/sq_bcglabel.h] +dist=true +install=false +install_location= +type=HEADER + +[ksquirrel/imageedit/sq_converter.cpp] +dist=true +install=false +install_location= +type=SOURCE + +[ksquirrel/imageedit/sq_converter.h] +dist=true +install=false +install_location= +type=HEADER + +[ksquirrel/imageedit/sq_imagebcg.ui] +dist=true +install=false +install_location= +type=SOURCE + +[ksquirrel/imageedit/sq_imagebcg.ui.h] +dist=true +install=false +install_location= +type=HEADER + +[ksquirrel/imageedit/sq_imageconvert.ui] +dist=true +install=false +install_location= +type=SOURCE + +[ksquirrel/imageedit/sq_imageconvert.ui.h] +dist=true +install=false +install_location= +type=HEADER + +[ksquirrel/imageedit/sq_imageedit.h] +dist=true +install=false +install_location= +type=HEADER + +[ksquirrel/imageedit/sq_imageeditoptions.ui] +dist=true +install=false +install_location= +type=SOURCE + +[ksquirrel/imageedit/sq_imageeditoptions.ui.h] +dist=true +install=false +install_location= +type=HEADER + +[ksquirrel/imageedit/sq_imagefilter.ui] +dist=true +install=false +install_location= +type=SOURCE + +[ksquirrel/imageedit/sq_imagefilter.ui.h] +dist=true +install=false +install_location= +type=HEADER + +[ksquirrel/imageedit/sq_label.cpp] +dist=true +install=false +install_location= +type=SOURCE + +[ksquirrel/imageedit/sq_label.h] +dist=true +install=false +install_location= +type=HEADER + +[ksquirrel/imageedit/sq_writeoption.ui] +dist=true +install=false +install_location= +type=SOURCE + +[ksquirrel/konqksquirrel-dir.desktop] +dist=true +install=true +install_location=$$(kde_datadir)/konqueror/servicemenus/konqksquirrel-dir.desktop +type=DATA + +[ksquirrel/ksquirrel.cpp] +dist=true +install=false +install_location= +type=SOURCE + +[ksquirrel/ksquirrel.h] +dist=true +install=false +install_location= +type=HEADER + +[ksquirrel/main.cpp] +dist=true +install=false +install_location= +type=SOURCE + +[ksquirrel/mime/Makefile.am] +files=ksquirrel/mime/x-avs.desktop,ksquirrel/mime/x-cut.desktop,ksquirrel/mime/x-dxf.desktop,ksquirrel/mime/x-iff.desktop,ksquirrel/mime/x-jbig.desktop,ksquirrel/mime/x-koala.desktop,ksquirrel/mime/x-leaf.desktop,ksquirrel/mime/x-lif.desktop,ksquirrel/mime/x-mac.desktop,ksquirrel/mime/x-msp.desktop,ksquirrel/mime/x-mtv.desktop,ksquirrel/mime/x-neo.desktop,ksquirrel/mime/x-pi1.desktop,ksquirrel/mime/x-pict.desktop,ksquirrel/mime/x-pix.desktop,ksquirrel/mime/x-pxr.desktop,ksquirrel/mime/x-ras.desktop,ksquirrel/mime/x-ras.magic,ksquirrel/mime/x-rawrgb.desktop,ksquirrel/mime/x-sct.desktop,ksquirrel/mime/x-sun.desktop,ksquirrel/mime/x-sun.magic,ksquirrel/mime/x-utah.desktop,ksquirrel/mime/x-utah.magic,ksquirrel/mime/x-wal.desktop,ksquirrel/mime/x-wbmp.desktop,ksquirrel/mime/x-xim.desktop,ksquirrel/mime/x-xwd.desktop,ksquirrel/mime/x-pi3.desktop,ksquirrel/mime/ljpeg.desktop,ksquirrel/mime/x-dicom.desktop,ksquirrel/mime/x-mdl.desktop,ksquirrel/mime/x-psp.desktop +sub_dirs= +type=normal + +[ksquirrel/mime/ljpeg.desktop] +dist=true +install=true +install_location=$$(kde_mimedir)/image/ljpeg.desktop +type=DATA + +[ksquirrel/mime/x-avs.desktop] +dist=true +install=true +install_location=$$(kde_mimedir)/image/x-avs.desktop +type=DATA + +[ksquirrel/mime/x-cut.desktop] +dist=true +install=true +install_location=$$(kde_mimedir)/image/x-cut.desktop +type=DATA + +[ksquirrel/mime/x-dicom.desktop] +dist=true +install=true +install_location=$$(kde_mimedir)/image/x-dicom.desktop +type=DATA + +[ksquirrel/mime/x-dxf.desktop] +dist=true +install=true +install_location=$$(kde_mimedir)/image/x-dxf.desktop +type=DATA + +[ksquirrel/mime/x-iff.desktop] +dist=true +install=true +install_location=$$(kde_mimedir)/image/x-iff.desktop +type=DATA + +[ksquirrel/mime/x-jbig.desktop] +dist=true +install=true +install_location=$$(kde_mimedir)/image/x-jbig.desktop +type=DATA + +[ksquirrel/mime/x-koala.desktop] +dist=true +install=true +install_location=$$(kde_mimedir)/image/x-koala.desktop +type=DATA + +[ksquirrel/mime/x-leaf.desktop] +dist=true +install=true +install_location=$$(kde_mimedir)/image/x-leaf.desktop +type=DATA + +[ksquirrel/mime/x-lif.desktop] +dist=true +install=true +install_location=$$(kde_mimedir)/image/x-lif.desktop +type=DATA + +[ksquirrel/mime/x-mac.desktop] +dist=true +install=true +install_location=$$(kde_mimedir)/image/x-mac.desktop +type=DATA + +[ksquirrel/mime/x-mdl.desktop] +dist=true +install=true +install_location=$$(kde_mimedir)/image/x-mdl.desktop +type=DATA + +[ksquirrel/mime/x-msp.desktop] +dist=true +install=true +install_location=$$(kde_mimedir)/image/x-msp.desktop +type=DATA + +[ksquirrel/mime/x-mtv.desktop] +dist=true +install=true +install_location=$$(kde_mimedir)/image/x-mtv.desktop +type=DATA + +[ksquirrel/mime/x-neo.desktop] +dist=true +install=true +install_location=$$(kde_mimedir)/image/x-neo.desktop +type=DATA + +[ksquirrel/mime/x-pi1.desktop] +dist=true +install=true +install_location=$$(kde_mimedir)/image/x-pi1.desktop +type=DATA + +[ksquirrel/mime/x-pi3.desktop] +dist=true +install=true +install_location=$$(kde_mimedir)/image/x-pi3.desktop +type=DATA + +[ksquirrel/mime/x-pict.desktop] +dist=true +install=true +install_location=$$(kde_mimedir)/image/x-pict.desktop +type=DATA + +[ksquirrel/mime/x-pix.desktop] +dist=true +install=true +install_location=$$(kde_mimedir)/image/x-pix.desktop +type=DATA + +[ksquirrel/mime/x-psp.desktop] +dist=true +install=true +install_location=$$(kde_mimedir)/image/x-psp.desktop +type=DATA + +[ksquirrel/mime/x-pxr.desktop] +dist=true +install=true +install_location=$$(kde_mimedir)/image/x-pxr.desktop +type=DATA + +[ksquirrel/mime/x-ras.desktop] +dist=true +install=true +install_location=$$(kde_mimedir)/image/x-ras.desktop +type=DATA + +[ksquirrel/mime/x-ras.magic] +dist=true +install=true +install_location=$$(kde_confdir)/magic/x-ras.magic +type=DATA + +[ksquirrel/mime/x-rawrgb.desktop] +dist=true +install=true +install_location=$$(kde_mimedir)/image/x-rawrgb.desktop +type=DATA + +[ksquirrel/mime/x-sct.desktop] +dist=true +install=true +install_location=$$(kde_mimedir)/image/x-sct.desktop +type=DATA + +[ksquirrel/mime/x-sun.desktop] +dist=true +install=true +install_location=$$(kde_mimedir)/image/x-sun.desktop +type=DATA + +[ksquirrel/mime/x-sun.magic] +dist=true +install=true +install_location=$$(kde_confdir)/magic/x-sun.magic +type=DATA + +[ksquirrel/mime/x-utah.desktop] +dist=true +install=true +install_location=$$(kde_mimedir)/image/x-utah.desktop +type=DATA + +[ksquirrel/mime/x-utah.magic] +dist=true +install=true +install_location=$$(kde_confdir)/magic/x-utah.magic +type=DATA + +[ksquirrel/mime/x-wal.desktop] +dist=true +install=true +install_location=$$(kde_mimedir)/image/x-wal.desktop +type=DATA + +[ksquirrel/mime/x-wbmp.desktop] +dist=true +install=true +install_location=$$(kde_mimedir)/image/x-wbmp.desktop +type=DATA + +[ksquirrel/mime/x-xim.desktop] +dist=true +install=true +install_location=$$(kde_mimedir)/image/x-xim.desktop +type=DATA + +[ksquirrel/mime/x-xwd.desktop] +dist=true +install=true +install_location=$$(kde_mimedir)/image/x-xwd.desktop +type=DATA + +[ksquirrel/sidebar/Makefile.am] +files=ksquirrel/sidebar/sq_mountview.h,ksquirrel/sidebar/sq_multibar.cpp,ksquirrel/sidebar/sq_multibar.h,ksquirrel/sidebar/sq_treeview.cpp,ksquirrel/sidebar/sq_treeview.h,ksquirrel/sidebar/sq_categoriesview.h,ksquirrel/sidebar/sq_categorybrowsermenu.h,ksquirrel/sidebar/sq_threaddirlister.cpp,ksquirrel/sidebar/sq_threaddirlister.h,ksquirrel/sidebar/sq_treeviewitem.h,ksquirrel/sidebar/sq_treeviewitem.cpp,ksquirrel/sidebar/sq_mountviewitem.h,ksquirrel/sidebar/sq_imagebasket.h,ksquirrel/sidebar/sq_storagefile.h,ksquirrel/sidebar/sq_storagefile.cpp,ksquirrel/sidebar/sq_previewwidget.cpp,ksquirrel/sidebar/sq_previewwidget.h,ksquirrel/sidebar/sq_treeviewmenu.cpp,ksquirrel/sidebar/sq_treeviewmenu.h,ksquirrel/sidebar/sq_directorybasket.h,ksquirrel/sidebar/sq_categoriesview.cpp,ksquirrel/sidebar/sq_categorybrowsermenu.cpp,ksquirrel/sidebar/sq_directorybasket.cpp,ksquirrel/sidebar/sq_imagebasket.cpp,ksquirrel/sidebar/sq_mountview.cpp,ksquirrel/sidebar/sq_mountviewitem.cpp +sharedlib_LDFLAGS=-version-info 0:0:0 +sharedlib_rootname=sidebar +sub_dirs= +type=static_library + +[ksquirrel/sidebar/sq_categoriesview.cpp] +dist=true +install=false +install_location= +type=SOURCE + +[ksquirrel/sidebar/sq_categoriesview.h] +dist=true +install=false +install_location= +type=HEADER + +[ksquirrel/sidebar/sq_categorybrowsermenu.cpp] +dist=true +install=false +install_location= +type=SOURCE + +[ksquirrel/sidebar/sq_categorybrowsermenu.h] +dist=true +install=false +install_location= +type=HEADER + +[ksquirrel/sidebar/sq_directorybasket.cpp] +dist=true +install=false +install_location= +type=SOURCE + +[ksquirrel/sidebar/sq_directorybasket.h] +dist=true +install=false +install_location= +type=HEADER + +[ksquirrel/sidebar/sq_imagebasket.cpp] +dist=true +install=false +install_location= +type=SOURCE + +[ksquirrel/sidebar/sq_imagebasket.h] +dist=true +install=false +install_location= +type=HEADER + +[ksquirrel/sidebar/sq_mountview.cpp] +dist=true +install=false +install_location= +type=SOURCE + +[ksquirrel/sidebar/sq_mountview.h] +dist=true +install=false +install_location= +type=HEADER + +[ksquirrel/sidebar/sq_mountviewitem.cpp] +dist=true +install=false +install_location= +type=SOURCE + +[ksquirrel/sidebar/sq_mountviewitem.h] +dist=true +install=false +install_location= +type=HEADER + +[ksquirrel/sidebar/sq_multibar.cpp] +dist=true +install=false +install_location= +type=SOURCE + +[ksquirrel/sidebar/sq_multibar.h] +dist=true +install=false +install_location= +type=HEADER + +[ksquirrel/sidebar/sq_previewwidget.cpp] +dist=true +install=false +install_location= +type=SOURCE + +[ksquirrel/sidebar/sq_previewwidget.h] +dist=true +install=false +install_location= +type=HEADER + +[ksquirrel/sidebar/sq_storagefile.cpp] +dist=true +install=false +install_location= +type=SOURCE + +[ksquirrel/sidebar/sq_storagefile.h] +dist=true +install=false +install_location= +type=HEADER + +[ksquirrel/sidebar/sq_threaddirlister.cpp] +dist=true +install=false +install_location= +type=SOURCE + +[ksquirrel/sidebar/sq_threaddirlister.h] +dist=true +install=false +install_location= +type=HEADER + +[ksquirrel/sidebar/sq_treeview.cpp] +dist=true +install=false +install_location= +type=SOURCE + +[ksquirrel/sidebar/sq_treeview.h] +dist=true +install=false +install_location= +type=HEADER + +[ksquirrel/sidebar/sq_treeviewitem.cpp] +dist=true +install=false +install_location= +type=SOURCE + +[ksquirrel/sidebar/sq_treeviewitem.h] +dist=true +install=false +install_location= +type=HEADER + +[ksquirrel/sidebar/sq_treeviewmenu.cpp] +dist=true +install=false +install_location= +type=SOURCE + +[ksquirrel/sidebar/sq_treeviewmenu.h] +dist=true +install=false +install_location= +type=HEADER + +[ksquirrel/sq_archivehandler.cpp] +dist=true +install=false +install_location= +type=SOURCE + +[ksquirrel/sq_archivehandler.h] +dist=true +install=false +install_location= +type=HEADER + +[ksquirrel/sq_bookmarkowner.cpp] +dist=true +install=false +install_location= +type=SOURCE + +[ksquirrel/sq_bookmarkowner.h] +dist=true +install=false +install_location= +type=HEADER + +[ksquirrel/sq_codecsettings.cpp] +dist=true +install=false +install_location= +type=SOURCE + +[ksquirrel/sq_codecsettings.h] +dist=true +install=false +install_location= +type=HEADER + +[ksquirrel/sq_codecsettingsskeleton.ui] +dist=true +install=false +install_location= +type=SOURCE + +[ksquirrel/sq_codecsettingsskeleton.ui.h] +dist=true +install=false +install_location= +type=HEADER + +[ksquirrel/sq_config.cpp] +dist=true +install=false +install_location= +type=SOURCE + +[ksquirrel/sq_config.h] +dist=true +install=false +install_location= +type=HEADER + +[ksquirrel/sq_dir.cpp] +dist=true +install=false +install_location= +type=SOURCE + +[ksquirrel/sq_dir.h] +dist=true +install=false +install_location= +type=HEADER + +[ksquirrel/sq_diroperator.cpp] +dist=true +install=false +install_location= +type=SOURCE + +[ksquirrel/sq_diroperator.h] +dist=true +install=false +install_location= +type=HEADER + +[ksquirrel/sq_dirthumbs.cpp] +dist=true +install=false +install_location= +type=SOURCE + +[ksquirrel/sq_dirthumbs.h] +dist=true +install=false +install_location= +type=HEADER + +[ksquirrel/sq_downloader.cpp] +dist=true +install=false +install_location= +type=SOURCE + +[ksquirrel/sq_downloader.h] +dist=true +install=false +install_location= +type=HEADER + +[ksquirrel/sq_dragprovider.cpp] +dist=true +install=false +install_location= +type=SOURCE + +[ksquirrel/sq_dragprovider.h] +dist=true +install=false +install_location= +type=HEADER + +[ksquirrel/sq_errorstring.cpp] +dist=true +install=false +install_location= +type=SOURCE + +[ksquirrel/sq_errorstring.h] +dist=true +install=false +install_location= +type=HEADER + +[ksquirrel/sq_externaltool.cpp] +dist=true +install=false +install_location= +type=SOURCE + +[ksquirrel/sq_externaltool.h] +dist=true +install=false +install_location= +type=HEADER + +[ksquirrel/sq_externaltools.ui] +dist=true +install=false +install_location= +type=SOURCE + +[ksquirrel/sq_filedetailview.cpp] +dist=true +install=false +install_location= +type=SOURCE + +[ksquirrel/sq_filedetailview.h] +dist=true +install=false +install_location= +type=HEADER + +[ksquirrel/sq_filedialog.cpp] +dist=true +install=false +install_location= +type=SOURCE + +[ksquirrel/sq_filedialog.h] +dist=true +install=false +install_location= +type=HEADER + +[ksquirrel/sq_fileiconview.cpp] +dist=true +install=false +install_location= +type=SOURCE + +[ksquirrel/sq_fileiconview.h] +dist=true +install=false +install_location= +type=HEADER + +[ksquirrel/sq_fileiconviewbase.cpp] +dist=true +install=false +install_location= +type=SOURCE + +[ksquirrel/sq_fileiconviewbase.h] +dist=true +install=false +install_location= +type=HEADER + +[ksquirrel/sq_filethumbview.cpp] +dist=true +install=false +install_location= +type=SOURCE + +[ksquirrel/sq_filethumbview.h] +dist=true +install=false +install_location= +type=HEADER + +[ksquirrel/sq_filethumbviewitem.cpp] +dist=true +install=false +install_location= +type=SOURCE + +[ksquirrel/sq_filethumbviewitem.h] +dist=true +install=false +install_location= +type=HEADER + +[ksquirrel/sq_filters.ui] +dist=true +install=false +install_location= +type=SOURCE + +[ksquirrel/sq_glinfo.ui] +dist=true +install=false +install_location= +type=SOURCE + +[ksquirrel/sq_glparts.cpp] +dist=true +install=false +install_location= +type=SOURCE + +[ksquirrel/sq_glparts.h] +dist=true +install=false +install_location= +type=HEADER + +[ksquirrel/sq_glselectionpainter.cpp] +dist=true +install=false +install_location= +type=SOURCE + +[ksquirrel/sq_glselectionpainter.h] +dist=true +install=false +install_location= +type=HEADER + +[ksquirrel/sq_glu.cpp] +dist=true +install=false +install_location= +type=SOURCE + +[ksquirrel/sq_glu.h] +dist=true +install=false +install_location= +type=HEADER + +[ksquirrel/sq_glview.cpp] +dist=true +install=false +install_location= +type=SOURCE + +[ksquirrel/sq_glview.h] +dist=true +install=false +install_location= +type=HEADER + +[ksquirrel/sq_glwidget.cpp] +dist=true +install=false +install_location= +type=SOURCE + +[ksquirrel/sq_glwidget.h] +dist=true +install=false +install_location= +type=HEADER + +[ksquirrel/sq_glwidget_helpers.cpp] +dist=true +install=false +install_location= +type=SOURCE + +[ksquirrel/sq_glwidget_helpers.h] +dist=true +install=false +install_location= +type=HEADER + +[ksquirrel/sq_glwidget_stuff.cpp] +dist=true +install=false +install_location= +type=SOURCE + +[ksquirrel/sq_helpwidget.ui] +dist=true +install=false +install_location= +type=SOURCE + +[ksquirrel/sq_hloptions.cpp] +dist=true +install=false +install_location= +type=SOURCE + +[ksquirrel/sq_hloptions.h] +dist=true +install=false +install_location= +type=HEADER + +[ksquirrel/sq_iconlistbox.cpp] +dist=true +install=false +install_location= +type=SOURCE + +[ksquirrel/sq_iconlistbox.h] +dist=true +install=false +install_location= +type=HEADER + +[ksquirrel/sq_iconlistitem.cpp] +dist=true +install=false +install_location= +type=SOURCE + +[ksquirrel/sq_iconlistitem.h] +dist=true +install=false +install_location= +type=HEADER + +[ksquirrel/sq_iconloader.cpp] +dist=true +install=false +install_location= +type=SOURCE + +[ksquirrel/sq_iconloader.h] +dist=true +install=false +install_location= +type=HEADER + +[ksquirrel/sq_iconloader_pixmaps.h] +dist=true +install=false +install_location= +type=HEADER + +[ksquirrel/sq_imageloader.cpp] +dist=true +install=false +install_location= +type=SOURCE + +[ksquirrel/sq_imageloader.h] +dist=true +install=false +install_location= +type=HEADER + +[ksquirrel/sq_imageproperties.ui] +dist=true +install=false +install_location= +type=SOURCE + +[ksquirrel/sq_kipiinterface.cpp] +dist=true +install=false +install_location= +type=SOURCE + +[ksquirrel/sq_kipiinterface.h] +dist=true +install=false +install_location= +type=HEADER + +[ksquirrel/sq_kipimanager.cpp] +dist=true +install=false +install_location= +type=SOURCE + +[ksquirrel/sq_kipimanager.h] +dist=true +install=false +install_location= +type=HEADER + +[ksquirrel/sq_library.h] +dist=true +install=false +install_location= +type=HEADER + +[ksquirrel/sq_libraryhandler.cpp] +dist=true +install=false +install_location= +type=SOURCE + +[ksquirrel/sq_libraryhandler.h] +dist=true +install=false +install_location= +type=HEADER + +[ksquirrel/sq_navigatordropmenu.cpp] +dist=true +install=false +install_location= +type=SOURCE + +[ksquirrel/sq_navigatordropmenu.h] +dist=true +install=false +install_location= +type=HEADER + +[ksquirrel/sq_options.ui] +dist=true +install=false +install_location= +type=SOURCE + +[ksquirrel/sq_pixmapcache.cpp] +dist=true +install=false +install_location= +type=SOURCE + +[ksquirrel/sq_pixmapcache.h] +dist=true +install=false +install_location= +type=HEADER + +[ksquirrel/sq_pluginsinfo.ui] +dist=true +install=false +install_location= +type=SOURCE + +[ksquirrel/sq_popupmenu.cpp] +dist=true +install=false +install_location= +type=SOURCE + +[ksquirrel/sq_popupmenu.h] +dist=true +install=false +install_location= +type=HEADER + +[ksquirrel/sq_progress.cpp] +dist=true +install=false +install_location= +type=SOURCE + +[ksquirrel/sq_progress.h] +dist=true +install=false +install_location= +type=HEADER + +[ksquirrel/sq_progressbox.cpp] +dist=true +install=false +install_location= +type=SOURCE + +[ksquirrel/sq_progressbox.h] +dist=true +install=false +install_location= +type=HEADER + +[ksquirrel/sq_selectdeselectgroup.ui] +dist=true +install=false +install_location= +type=SOURCE + +[ksquirrel/sq_slideshow.ui] +dist=true +install=false +install_location= +type=SOURCE + +[ksquirrel/sq_slideshowlisting.ui] +dist=true +install=false +install_location= +type=SOURCE + +[ksquirrel/sq_slideshowlisting.ui.h] +dist=true +install=false +install_location= +type=HEADER + +[ksquirrel/sq_slideshowwidget.cpp] +dist=true +install=false +install_location= +type=SOURCE + +[ksquirrel/sq_slideshowwidget.h] +dist=true +install=false +install_location= +type=HEADER + +[ksquirrel/sq_splashscreen.cpp] +dist=true +install=false +install_location= +type=SOURCE + +[ksquirrel/sq_splashscreen.h] +dist=true +install=false +install_location= +type=HEADER + +[ksquirrel/sq_tabopendialog.ui] +dist=true +install=false +install_location= +type=SOURCE + +[ksquirrel/sq_thumbnailcachemaster.ui] +dist=true +install=false +install_location= +type=SOURCE + +[ksquirrel/sq_thumbnailinfo.h] +dist=true +install=false +install_location= +type=HEADER + +[ksquirrel/sq_thumbnailloadjob.cpp] +dist=true +install=false +install_location= +type=SOURCE + +[ksquirrel/sq_thumbnailloadjob.h] +dist=true +install=false +install_location= +type=HEADER + +[ksquirrel/sq_thumbnailsize.cpp] +dist=true +install=false +install_location= +type=SOURCE + +[ksquirrel/sq_thumbnailsize.h] +dist=true +install=false +install_location= +type=HEADER + +[ksquirrel/sq_thumbnailsunused.cpp] +dist=true +install=false +install_location= +type=SOURCE + +[ksquirrel/sq_thumbnailsunused.h] +dist=true +install=false +install_location= +type=HEADER + +[ksquirrel/sq_utils.cpp] +dist=true +install=false +install_location= +type=SOURCE + +[ksquirrel/sq_utils.h] +dist=true +install=false +install_location= +type=HEADER + +[ksquirrel/sq_utils_asm_scale.S] +dist=true +install=false +install_location= +type=DATA + +[ksquirrel/sq_utils_scale.cpp] +dist=true +install=false +install_location= +type=SOURCE + +[ksquirrel/sq_viewcache.ui] +dist=true +install=false +install_location= +type=SOURCE + +[ksquirrel/sq_widgetstack.cpp] +dist=true +install=false +install_location= +type=SOURCE + +[ksquirrel/sq_widgetstack.h] +dist=true +install=false +install_location= +type=HEADER + +[pics/Makefile.am] +files=pics/checker.png,pics/tray.png,pics/thumbs_huge.png,pics/thumbs_large.png,pics/thumbs_medium.png,pics/image_win.png,pics/anime.png,pics/mark_1.png,pics/mark_2.png,pics/mark_3.png,pics/mark_4.png,pics/splash.png +sub_dirs=menu,imageedit,toolbar +type=normal + +[pics/anime.png] +dist=true +install=true +install_location=$$(kde_datadir)/ksquirrel/images/anime.png +type=DATA + +[pics/checker.png] +dist=true +install=true +install_location=$$(kde_datadir)/ksquirrel/images/checker.png +type=DATA + +[pics/image_win.png] +dist=true +install=true +install_location=$$(kde_datadir)/ksquirrel/images/listbox/image_win.png +type=DATA + +[pics/imageedit/Makefile.am] +files=pics/imageedit/reset_value.png,pics/imageedit/resize_toolbutton.png,pics/imageedit/resize_toolbutton2.png +type=normal + +[pics/imageedit/reset_value.png] +dist=true +install=true +install_location=$$(kde_datadir)/ksquirrel/images/imageedit/reset_value.png +type=DATA + +[pics/imageedit/resize_toolbutton.png] +dist=true +install=true +install_location=$$(kde_datadir)/ksquirrel/images/imageedit/resize_toolbutton.png +type=DATA + +[pics/imageedit/resize_toolbutton2.png] +dist=true +install=true +install_location=$$(kde_datadir)/ksquirrel/images/imageedit/resize_toolbutton2.png +type=DATA + +[pics/mark_1.png] +dist=true +install=true +install_location=$$(kde_datadir)/ksquirrel/images/marks/mark_1.png +type=DATA + +[pics/mark_2.png] +dist=true +install=true +install_location=$$(kde_datadir)/ksquirrel/images/marks/mark_2.png +type=DATA + +[pics/mark_3.png] +dist=true +install=true +install_location=$$(kde_datadir)/ksquirrel/images/marks/mark_3.png +type=DATA + +[pics/mark_4.png] +dist=true +install=true +install_location=$$(kde_datadir)/ksquirrel/images/marks/mark_4.png +type=DATA + +[pics/menu/18016.png] +dist=true +install=true +install_location=$$(kde_datadir)/ksquirrel/images/menu/18016.png +type=DATA + +[pics/menu/Makefile.am] +files=pics/menu/18016.png,pics/menu/animate16.png,pics/menu/background16.png,pics/menu/close16.png,pics/menu/first16.png,pics/menu/flipH16.png,pics/menu/flipV16.png,pics/menu/fullscreen16.png,pics/menu/last16.png,pics/menu/moveDown16.png,pics/menu/moveLeft16.png,pics/menu/moveRight16.png,pics/menu/moveUp16.png,pics/menu/next16.png,pics/menu/page116.png,pics/menu/page216.png,pics/menu/page316.png,pics/menu/page416.png,pics/menu/prev16.png,pics/menu/prop16.png,pics/menu/reset16.png,pics/menu/rotateLeft16.png,pics/menu/rotateRight16.png,pics/menu/statusbar16.png,pics/menu/tickmarks16.png,pics/menu/toolbar16.png,pics/menu/window16.png,pics/menu/zoom-16.png,pics/menu/zoom+16.png,pics/menu/zoom16.png,pics/menu/zoom100016.png,pics/menu/zoom10016.png,pics/menu/zoom20016.png,pics/menu/zoom30016.png,pics/menu/zoom50016.png,pics/menu/zoom70016.png,pics/menu/zoom90016.png +sub_dirs= +type=normal + +[pics/menu/animate16.png] +dist=true +install=true +install_location=$$(kde_datadir)/ksquirrel/images/menu/animate16.png +type=DATA + +[pics/menu/background16.png] +dist=true +install=true +install_location=$$(kde_datadir)/ksquirrel/images/menu/background16.png +type=DATA + +[pics/menu/close16.png] +dist=true +install=true +install_location=$$(kde_datadir)/ksquirrel/images/menu/close16.png +type=DATA + +[pics/menu/first16.png] +dist=true +install=true +install_location=$$(kde_datadir)/ksquirrel/images/menu/first16.png +type=DATA + +[pics/menu/flipH16.png] +dist=true +install=true +install_location=$$(kde_datadir)/ksquirrel/images/menu/flipH16.png +type=DATA + +[pics/menu/flipV16.png] +dist=true +install=true +install_location=$$(kde_datadir)/ksquirrel/images/menu/flipV16.png +type=DATA + +[pics/menu/fullscreen16.png] +dist=true +install=true +install_location=$$(kde_datadir)/ksquirrel/images/menu/fullscreen16.png +type=DATA + +[pics/menu/last16.png] +dist=true +install=true +install_location=$$(kde_datadir)/ksquirrel/images/menu/last16.png +type=DATA + +[pics/menu/moveDown16.png] +dist=true +install=true +install_location=$$(kde_datadir)/ksquirrel/images/menu/moveDown16.png +type=DATA + +[pics/menu/moveLeft16.png] +dist=true +install=true +install_location=$$(kde_datadir)/ksquirrel/images/menu/moveLeft16.png +type=DATA + +[pics/menu/moveRight16.png] +dist=true +install=true +install_location=$$(kde_datadir)/ksquirrel/images/menu/moveRight16.png +type=DATA + +[pics/menu/moveUp16.png] +dist=true +install=true +install_location=$$(kde_datadir)/ksquirrel/images/menu/moveUp16.png +type=DATA + +[pics/menu/next16.png] +dist=true +install=true +install_location=$$(kde_datadir)/ksquirrel/images/menu/next16.png +type=DATA + +[pics/menu/page116.png] +dist=true +install=true +install_location=$$(kde_datadir)/ksquirrel/images/menu/page116.png +type=DATA + +[pics/menu/page216.png] +dist=true +install=true +install_location=$$(kde_datadir)/ksquirrel/images/menu/page216.png +type=DATA + +[pics/menu/page316.png] +dist=true +install=true +install_location=$$(kde_datadir)/ksquirrel/images/menu/page316.png +type=DATA + +[pics/menu/page416.png] +dist=true +install=true +install_location=$$(kde_datadir)/ksquirrel/images/menu/page416.png +type=DATA + +[pics/menu/prev16.png] +dist=true +install=true +install_location=$$(kde_datadir)/ksquirrel/images/menu/prev16.png +type=DATA + +[pics/menu/prop16.png] +dist=true +install=true +install_location=$$(kde_datadir)/ksquirrel/images/menu/prop16.png +type=DATA + +[pics/menu/reset16.png] +dist=true +install=true +install_location=$$(kde_datadir)/ksquirrel/images/menu/reset16.png +type=DATA + +[pics/menu/rotateLeft16.png] +dist=true +install=true +install_location=$$(kde_datadir)/ksquirrel/images/menu/rotateLeft16.png +type=DATA + +[pics/menu/rotateRight16.png] +dist=true +install=true +install_location=$$(kde_datadir)/ksquirrel/images/menu/rotateRight16.png +type=DATA + +[pics/menu/statusbar16.png] +dist=true +install=true +install_location=$$(kde_datadir)/ksquirrel/images/menu/statusbar16.png +type=DATA + +[pics/menu/tickmarks16.png] +dist=true +install=true +install_location=$$(kde_datadir)/ksquirrel/images/menu/tickmarks16.png +type=DATA + +[pics/menu/toolbar16.png] +dist=true +install=true +install_location=$$(kde_datadir)/ksquirrel/images/menu/toolbar16.png +type=DATA + +[pics/menu/window16.png] +dist=true +install=true +install_location=$$(kde_datadir)/ksquirrel/images/menu/window16.png +type=DATA + +[pics/menu/zoom+16.png] +dist=true +install=true +install_location=$$(kde_datadir)/ksquirrel/images/menu/zoom+16.png +type=DATA + +[pics/menu/zoom-16.png] +dist=true +install=true +install_location=$$(kde_datadir)/ksquirrel/images/menu/zoom-16.png +type=DATA + +[pics/menu/zoom100016.png] +dist=true +install=true +install_location=$$(kde_datadir)/ksquirrel/images/menu/zoom100016.png +type=DATA + +[pics/menu/zoom10016.png] +dist=true +install=true +install_location=$$(kde_datadir)/ksquirrel/images/menu/zoom10016.png +type=DATA + +[pics/menu/zoom16.png] +dist=true +install=true +install_location=$$(kde_datadir)/ksquirrel/images/menu/zoom16.png +type=DATA + +[pics/menu/zoom20016.png] +dist=true +install=true +install_location=$$(kde_datadir)/ksquirrel/images/menu/zoom20016.png +type=DATA + +[pics/menu/zoom30016.png] +dist=true +install=true +install_location=$$(kde_datadir)/ksquirrel/images/menu/zoom30016.png +type=DATA + +[pics/menu/zoom50016.png] +dist=true +install=true +install_location=$$(kde_datadir)/ksquirrel/images/menu/zoom50016.png +type=DATA + +[pics/menu/zoom70016.png] +dist=true +install=true +install_location=$$(kde_datadir)/ksquirrel/images/menu/zoom70016.png +type=DATA + +[pics/menu/zoom90016.png] +dist=true +install=true +install_location=$$(kde_datadir)/ksquirrel/images/menu/zoom90016.png +type=DATA + +[pics/splash.png] +dist=true +install=true +install_location=$$(kde_datadir)/ksquirrel/images/splash.png +type=DATA + +[pics/thumbs_huge.png] +dist=true +install=true +install_location=$$(kde_datadir)/ksquirrel/images/thumbs/thumbs_huge.png +type=DATA + +[pics/thumbs_large.png] +dist=true +install=true +install_location=$$(kde_datadir)/ksquirrel/images/thumbs/thumbs_large.png +type=DATA + +[pics/thumbs_medium.png] +dist=true +install=true +install_location=$$(kde_datadir)/ksquirrel/images/thumbs/thumbs_medium.png +type=DATA + +[pics/toolbar/Makefile.am] +files=pics/toolbar/file_first.png,pics/toolbar/file_last.png,pics/toolbar/file_next.png,pics/toolbar/file_prev.png,pics/toolbar/flipH.png,pics/toolbar/flipV.png,pics/toolbar/rotateL.png,pics/toolbar/rotateR.png,pics/toolbar/zoom-.png,pics/toolbar/zoom+.png,pics/toolbar/fullscreen.png,pics/toolbar/ifless.png,pics/toolbar/images.png,pics/toolbar/prop.png,pics/toolbar/reload.png,pics/toolbar/zoom100.png,pics/toolbar/zoomH.png,pics/toolbar/zoom_template.png,pics/toolbar/zoomWH.png,pics/toolbar/zoomW.png,pics/toolbar/glselection_ellipse.png,pics/toolbar/glselection_rect.png,pics/toolbar/glselection.png,pics/toolbar/shownav.png,pics/toolbar/configure.png,pics/toolbar/print.png +sub_dirs= +type=normal + +[pics/toolbar/configure.png] +dist=true +install=true +install_location=$$(kde_datadir)/ksquirrel/images/actions/configure.png +type=DATA + +[pics/toolbar/file_first.png] +dist=true +install=true +install_location=$$(kde_datadir)/ksquirrel/images/actions/file_first.png +type=DATA + +[pics/toolbar/file_last.png] +dist=true +install=true +install_location=$$(kde_datadir)/ksquirrel/images/actions/file_last.png +type=DATA + +[pics/toolbar/file_next.png] +dist=true +install=true +install_location=$$(kde_datadir)/ksquirrel/images/actions/file_next.png +type=DATA + +[pics/toolbar/file_prev.png] +dist=true +install=true +install_location=$$(kde_datadir)/ksquirrel/images/actions/file_prev.png +type=DATA + +[pics/toolbar/flipH.png] +dist=true +install=true +install_location=$$(kde_datadir)/ksquirrel/images/actions/flipH.png +type=DATA + +[pics/toolbar/flipV.png] +dist=true +install=true +install_location=$$(kde_datadir)/ksquirrel/images/actions/flipV.png +type=DATA + +[pics/toolbar/fullscreen.png] +dist=true +install=true +install_location=$$(kde_datadir)/ksquirrel/images/actions/fullscreen.png +type=DATA + +[pics/toolbar/glselection.png] +dist=true +install=true +install_location=$$(kde_datadir)/ksquirrel/images/actions/glselection.png +type=DATA + +[pics/toolbar/glselection_ellipse.png] +dist=true +install=true +install_location=$$(kde_datadir)/ksquirrel/images/actions/glselection_ellipse.png +type=DATA + +[pics/toolbar/glselection_rect.png] +dist=true +install=true +install_location=$$(kde_datadir)/ksquirrel/images/actions/glselection_rect.png +type=DATA + +[pics/toolbar/ifless.png] +dist=true +install=true +install_location=$$(kde_datadir)/ksquirrel/images/actions/ifless.png +type=DATA + +[pics/toolbar/images.png] +dist=true +install=true +install_location=$$(kde_datadir)/ksquirrel/images/actions/images.png +type=DATA + +[pics/toolbar/print.png] +dist=true +install=true +install_location=$$(kde_datadir)/ksquirrel/images/actions/print.png +type=DATA + +[pics/toolbar/prop.png] +dist=true +install=true +install_location=$$(kde_datadir)/ksquirrel/images/actions/prop.png +type=DATA + +[pics/toolbar/reload.png] +dist=true +install=true +install_location=$$(kde_datadir)/ksquirrel/images/actions/reload.png +type=DATA + +[pics/toolbar/rotateL.png] +dist=true +install=true +install_location=$$(kde_datadir)/ksquirrel/images/actions/rotateL.png +type=DATA + +[pics/toolbar/rotateR.png] +dist=true +install=true +install_location=$$(kde_datadir)/ksquirrel/images/actions/rotateR.png +type=DATA + +[pics/toolbar/shownav.png] +dist=true +install=true +install_location=$$(kde_datadir)/ksquirrel/images/actions/shownav.png +type=DATA + +[pics/toolbar/zoom+.png] +dist=true +install=true +install_location=$$(kde_datadir)/ksquirrel/images/actions/zoom+.png +type=DATA + +[pics/toolbar/zoom-.png] +dist=true +install=true +install_location=$$(kde_datadir)/ksquirrel/images/actions/zoom-.png +type=DATA + +[pics/toolbar/zoom100.png] +dist=true +install=true +install_location=$$(kde_datadir)/ksquirrel/images/actions/zoom100.png +type=DATA + +[pics/toolbar/zoomH.png] +dist=true +install=true +install_location=$$(kde_datadir)/ksquirrel/images/actions/zoomH.png +type=DATA + +[pics/toolbar/zoomW.png] +dist=true +install=true +install_location=$$(kde_datadir)/ksquirrel/images/actions/zoomW.png +type=DATA + +[pics/toolbar/zoomWH.png] +dist=true +install=true +install_location=$$(kde_datadir)/ksquirrel/images/actions/zoomWH.png +type=DATA + +[pics/toolbar/zoom_template.png] +dist=true +install=true +install_location=$$(kde_datadir)/ksquirrel/images/actions/zoom_template.png +type=DATA + +[pics/tray.png] +dist=true +install=true +install_location=$$(kde_datadir)/ksquirrel/images/tray.png +type=DATA + +[po/Makefile.am] +files= +sub_dirs= +type=po diff --git a/ksquirrel.kdevses b/ksquirrel.kdevses new file mode 100644 index 0000000..e912e40 --- /dev/null +++ b/ksquirrel.kdevses @@ -0,0 +1,17 @@ + + + + (Default) + + + + + + + + + + + + + diff --git a/ksquirrel.lsm b/ksquirrel.lsm new file mode 100644 index 0000000..f2ba788 --- /dev/null +++ b/ksquirrel.lsm @@ -0,0 +1,14 @@ +Begin4 +Title: KSquirrel +Version: 0.7.3 +Entered-date: Dec 10, 2003 +Description: Image viewer for KDE +Keywords: +Author: Baryshev Dmitry +Maintained-by: Baryshev Dmitry +Primary-site: +Home-page: http://ksquirrel.sf.net +Original-site: http://ksquirrel.sf.net +Platforms: Linux and other Unices +Copying-policy: GNU General Public License +End diff --git a/ksquirrel/Makefile.am b/ksquirrel/Makefile.am new file mode 100644 index 0000000..b36985c --- /dev/null +++ b/ksquirrel/Makefile.am @@ -0,0 +1,102 @@ +####### kdevelop will overwrite this part!!! (begin)########## +bin_PROGRAMS = ksquirrel + +## INCLUDES were found outside kdevelop specific part + +ksquirrel_SOURCES = sq_slideshowwidget.cpp sq_slideshow.ui sq_slideshowlisting.ui fmt_filters.cpp sq_glwidget_stuff.cpp sq_tabopendialog.ui sq_dragprovider.cpp sq_utils_scale.cpp sq_utils.cpp sq_thumbnailsunused.cpp sq_dirthumbs.cpp sq_downloader.cpp sq_glselectionpainter.cpp sq_glwidget.cpp sq_glparts.cpp sq_codecsettings.cpp sq_filedialog.cpp sq_codecsettingsskeleton.ui sq_kipimanager.cpp sq_kipiinterface.cpp sq_progressbox.cpp sq_thumbnailloadjob.cpp sq_splashscreen.cpp sq_popupmenu.cpp sq_glinfo.ui sq_glwidget_helpers.cpp sq_imageloader.cpp sq_pluginsinfo.ui sq_iconloader.cpp sq_selectdeselectgroup.ui sq_thumbnailcachemaster.ui sq_errorstring.cpp sq_navigatordropmenu.cpp sq_fileiconviewbase.cpp sq_helpwidget.ui sq_glview.cpp sq_viewcache.ui sq_filethumbviewitem.cpp sq_progress.cpp sq_thumbnailsize.cpp sq_pixmapcache.cpp sq_filethumbview.cpp sq_dir.cpp sq_iconlistbox.cpp sq_iconlistitem.cpp sq_widgetstack.cpp sq_options.ui sq_libraryhandler.cpp sq_imageproperties.ui sq_hloptions.cpp sq_glu.cpp sq_filters.ui sq_fileiconview.cpp sq_filedetailview.cpp sq_externaltools.ui sq_externaltool.cpp sq_diroperator.cpp sq_config.cpp sq_bookmarkowner.cpp sq_archivehandler.cpp ksquirrel.cpp main.cpp +ksquirrel_LDADD = ./sidebar/libsidebar.a ./imageedit/libimageedit.a $(KDE_LDFLAGS) $(QT_LDFLAGS) $(LIB_KDEPRINT) $(LIB_KUTILS) $(LIB_KIO) $(ksquirrellibs_LIBS) -lkonq -lqui $(LIB_KFILE) $(LIB_KDEUI) $(LIB_KDECORE) $(LIB_QT) $(LIBSOCKET) + +SUBDIRS = sidebar imageedit mime + +EXTRA_DIST = main.cpp ksquirrel.cpp ksquirrel.h hi32-app-ksquirrel.png hi16-app-ksquirrel.png sq_archivehandler.cpp sq_archivehandler.h sq_bookmarkowner.cpp sq_bookmarkowner.h sq_config.cpp sq_config.h sq_diroperator.cpp sq_diroperator.h sq_externaltool.cpp sq_externaltool.h sq_externaltools.ui sq_filedetailview.cpp sq_filedetailview.h sq_fileiconview.cpp sq_fileiconview.h sq_filters.ui sq_glu.cpp sq_glu.h sq_hloptions.cpp sq_hloptions.h sq_imageproperties.ui sq_libraryhandler.cpp sq_libraryhandler.h sq_options.ui sq_widgetstack.cpp sq_widgetstack.h sq_iconlistitem.cpp sq_iconlistitem.h sq_iconlistbox.cpp sq_iconlistbox.h sq_dir.cpp sq_dir.h sq_filethumbview.cpp sq_filethumbview.h sq_pixmapcache.cpp sq_pixmapcache.h sq_thumbnailsize.cpp sq_thumbnailsize.h sq_progress.cpp sq_progress.h sq_thumbnailinfo.h sq_filethumbviewitem.cpp sq_filethumbviewitem.h sq_viewcache.ui sq_glview.cpp sq_glview.h sq_helpwidget.ui sq_fileiconviewbase.cpp sq_fileiconviewbase.h sq_navigatordropmenu.cpp sq_navigatordropmenu.h sq_errorstring.cpp sq_errorstring.h fmt_filters.h sq_thumbnailcachemaster.ui sq_glwidget_helpers.h sq_library.h sq_selectdeselectgroup.ui sq_iconloader.cpp sq_iconloader.h sq_pluginsinfo.ui sq_iconloader_pixmaps.h sq_imageloader.cpp sq_imageloader.h sq_glwidget_helpers.cpp file_broken.xpm sq_glinfo.ui sq_popupmenu.cpp sq_popupmenu.h sq_splashscreen.cpp sq_splashscreen.h sq_thumbnailloadjob.cpp sq_thumbnailloadjob.h sq_progressbox.cpp sq_progressbox.h sq_kipiinterface.cpp sq_kipiinterface.h sq_kipimanager.cpp sq_kipimanager.h sq_codecsettingsskeleton.ui sq_codecsettingsskeleton.ui.h sq_filedialog.cpp sq_filedialog.h sq_codecsettings.cpp sq_codecsettings.h sq_glparts.cpp sq_glparts.h sq_glwidget.cpp sq_glwidget.h sq_slideshowwidget.h sq_glselectionpainter.cpp sq_glselectionpainter.h sq_downloader.cpp sq_downloader.h sq_dirthumbs.cpp sq_dirthumbs.h sq_thumbnailsunused.cpp sq_thumbnailsunused.h sq_slideshowlisting.ui.h sq_utils.cpp sq_utils.h konqksquirrel-dir.desktop sq_utils_asm_scale.S sq_utils_scale.cpp sq_dragprovider.cpp sq_dragprovider.h sq_tabopendialog.ui sq_glwidget_stuff.cpp dolphksquirrel-dir.desktop fmt_filters.cpp sq_slideshowlisting.ui sq_slideshow.ui sq_slideshowwidget.cpp + +install-data-local: + $(mkinstalldirs) $(kde_icondir)/hicolor/32x32/apps/ + $(INSTALL_DATA) $(srcdir)/hi32-app-ksquirrel.png $(kde_icondir)/hicolor/32x32/apps/ksquirrel.png + $(mkinstalldirs) $(kde_icondir)/hicolor/16x16/apps/ + $(INSTALL_DATA) $(srcdir)/hi16-app-ksquirrel.png $(kde_icondir)/hicolor/16x16/apps/ksquirrel.png + $(mkinstalldirs) $(kde_datadir)/konqueror/servicemenus/ + $(INSTALL_DATA) $(srcdir)/konqksquirrel-dir.desktop $(kde_datadir)/konqueror/servicemenus/konqksquirrel-dir.desktop + $(mkinstalldirs) $(kde_datadir)/dolphin/servicemenus/ + $(INSTALL_DATA) $(srcdir)/dolphksquirrel-dir.desktop $(kde_datadir)/dolphin/servicemenus/dolphksquirrel-dir.desktop + +uninstall-local: + -rm -f $(kde_icondir)/hicolor/32x32/apps/ksquirrel.png + -rm -f $(kde_icondir)/hicolor/16x16/apps/ksquirrel.png + -rm -f $(kde_datadir)/konqueror/servicemenus/konqksquirrel-dir.desktop + -rm -f $(kde_datadir)/dolphin/servicemenus/dolphksquirrel-dir.desktop + +####### kdevelop will overwrite this part!!! (end)############ + +xdg_apps_DATA = ksquirrel.desktop + +# do we have KPart enabled ? +if SQ_HAVE_KPART +SUBDIRS += ksquirrelpart +endif + +if SQ_HAVE_KLCONF +SUBDIRS += ksquirrel-libs-configurator +endif + +METASOURCES = AUTO + +ksquirrel_SOURCES += sq_utils_asm_scale.S + +AM_CCASFLAGS = -I$(srcdir) $(KSQUIRREL_ASM_DEFS) + +INCLUDES = $(all_includes) -I$(srcdir) -I$(top_srcdir)/ksquirrel/sidebar -I$(top_srcdir)/ksquirrel/imageedit +# ksquirrelpart + +# These paths are KDE specific. Use them: +# kde_appsdir Where your application's menu entry (.desktop) should go to. +# kde_icondir Where your icon should go to - better use KDE_ICON. +# kde_sounddir Where your sounds should go to. +# kde_htmldir Where your docs should go to. (contains lang subdirs) +# kde_datadir Where you install application data. (Use a subdir) +# kde_locale Where translation files should go to. (contains lang subdirs) +# kde_cgidir Where cgi-bin executables should go to. +# kde_confdir Where config files should go to (system-wide ones with default values). +# kde_mimedir Where mimetypes .desktop files should go to. +# kde_servicesdir Where services .desktop files should go to. +# kde_servicetypesdir Where servicetypes .desktop files should go to. +# kde_toolbardir Where general toolbar icons should go to (deprecated, use KDE_ICON). +# kde_wallpaperdir Where general wallpapers should go to. +# kde_templatesdir Where templates for the "New" menu (Konqueror/KDesktop) should go to. +# kde_bindir Where executables should go to. Use bin_PROGRAMS or bin_SCRIPTS. +# kde_libdir Where shared libraries should go to. Use lib_LTLIBRARIES. +# kde_moduledir Where modules (e.g. parts) should go to. Use kde_module_LTLIBRARIES. +# kde_styledir Where Qt/KDE widget styles should go to (new in KDE 3). +# kde_designerdir Where Qt Designer plugins should go to (new in KDE 3). + +AM_CXXFLAGS = +AM_LDFLAGS = + +if SQ_HAVE_KIPI +AM_CXXFLAGS += $(libkipi_CFLAGS) +AM_LDFLAGS += $(libkipi_LIBS) +endif + +if SQ_HAVE_KEXIF +AM_CXXFLAGS += $(libkexif_CFLAGS) +AM_LDFLAGS += $(libkexif_LIBS) +endif + +# Uncomment the following two lines if you add a ui.rc file for your application to make use of +# KDE?s XML GUI builing +#rcdir = $(kde_datadir)/ksquirrel +#rc_DATA = ksquirrelui.rc + +#WARNING: if you use a ui.rc file above, use: + +# messages: rc.cpp + +# instead of + +# messages: + +messages: + LIST=`find . -name \*.h -o -name \*.hh -o -name \*.H -o -name \*.hxx -o -name \*.hpp -o -name \*.cpp -o -name \*.cc -o -name \*.cxx -o -name \*.ecpp -o -name \*.C`; \ + if test -n "$$LIST"; then \ + $(XGETTEXT) $$LIST -o $(podir)/ksquirrel.pot; \ + fi diff --git a/ksquirrel/dolphksquirrel-dir.desktop b/ksquirrel/dolphksquirrel-dir.desktop new file mode 100644 index 0000000..5bed6f5 --- /dev/null +++ b/ksquirrel/dolphksquirrel-dir.desktop @@ -0,0 +1,14 @@ +[Desktop Entry] +ServiceTypes=inode/directory +Actions=KSquirrel; +Encoding=UTF-8 +Type=Application + +[Desktop Action KSquirrel] +Type=Application +Icon=ksquirrel +Exec=ksquirrel %u + +Name=Browse with KSquirrel +Name[ru]=Просмотреть в KSquirrel +Name[de]=Mit KSquirrel durchsehen \ No newline at end of file diff --git a/ksquirrel/file_broken.xpm b/ksquirrel/file_broken.xpm new file mode 100644 index 0000000..1040d96 --- /dev/null +++ b/ksquirrel/file_broken.xpm @@ -0,0 +1,831 @@ +/* XPM */ +static const char * file_broken_xpm[] = { +"64 64 764 2", +" c None", +". c #A5A9AA", +"+ c #A4A8A9", +"@ c #A3A7A8", +"# c #A2A6A7", +"$ c #A1A5A6", +"% c #A0A4A5", +"& c #9FA3A4", +"* c #9EA2A3", +"= c #9DA1A2", +"- c #9CA0A1", +"; c #9B9FA0", +"> c #9A9E9F", +", c #999D9E", +"' c #989C9D", +") c #979B9C", +"! c #969A9B", +"~ c #95999A", +"{ c #949899", +"] c #939798", +"^ c #929697", +"/ c #919596", +"( c #909495", +"_ c #8F9394", +": c #8E9293", +"< c #8D9192", +"[ c #8C9091", +"} c #8B8F90", +"| c #8A8E8F", +"1 c #898D8E", +"2 c #888C8D", +"3 c #878B8C", +"4 c #A6AAAB", +"5 c #ACB7BF", +"6 c #B3C4D4", +"7 c #B2C3D3", +"8 c #B1C2D2", +"9 c #B0C1D1", +"0 c #AFC0D0", +"a c #AEBFCF", +"b c #ADBECE", +"c c #ACBDCD", +"d c #ABBCCC", +"e c #AABBCB", +"f c #A9BACA", +"g c #A8B9C9", +"h c #A7B8C8", +"i c #A6B7C7", +"j c #A5B6C6", +"k c #A4B5C5", +"l c #95A0A8", +"m c #868A8B", +"n c #B0BECA", +"o c #C2E0FF", +"p c #D1E7FF", +"q c #D0E7FF", +"r c #CFE7FF", +"s c #CFE6FF", +"t c #9CAAB6", +"u c #828687", +"v c #C0DCF9", +"w c #E4F1FF", +"x c #FFFFFF", +"y c #FEFFFF", +"z c #FEFEFF", +"A c #FDFEFF", +"B c #FCFEFF", +"C c #FBFDFF", +"D c #FAFDFF", +"E c #FAFCFF", +"F c #F9FCFF", +"G c #F8FCFF", +"H c #F8FBFF", +"I c #F7FBFF", +"J c #F6FAFF", +"K c #F5FAFF", +"L c #DEEEFF", +"M c #BEDAF7", +"N c #85898A", +"O c #E8F3FF", +"P c #EFF7FF", +"Q c #F4FAFF", +"R c #E7F3FF", +"S c #F3F9FF", +"T c #E6F2FF", +"U c #F2F8FF", +"V c #E5F2FF", +"W c #F1F8FF", +"X c #FAEFEF", +"Y c #EAAFAF", +"Z c #EFCECF", +"` c #EECDCF", +" . c #CA3434", +".. c #C21616", +"+. c #E59F9F", +"@. c #BD1C1C", +"#. c #BC1C1C", +"$. c #EDCDCF", +"%. c #F0F8FF", +"&. c #FBEFEF", +"*. c #CB3434", +"=. c #DE3939", +"-. c #F64747", +";. c #C61A1A", +">. c #BE1C1C", +",. c #E83D3D", +"'. c #E73C3C", +"). c #BC1B1B", +"!. c #ECCDCF", +"~. c #F0F7FF", +"{. c #E3F1FF", +"]. c #CC3434", +"^. c #DF3939", +"/. c #FF6969", +"(. c #FF7A7A", +"_. c #F0CECF", +":. c #BF1C1C", +"<. c #FB6363", +"[. c #FB6161", +"}. c #E73737", +"|. c #BC1A1A", +"1. c #EBCCCF", +"2. c #CD3434", +"3. c #FFA3A3", +"4. c #FF8080", +"5. c #C01C1C", +"6. c #FB9E9E", +"7. c #FB9D9D", +"8. c #FB5E5E", +"9. c #E73333", +"0. c #BC1919", +"a. c #EBCBCF", +"b. c #E0EFFF", +"c. c #B5D9FF", +"d. c #CE3434", +"e. c #E03939", +"f. c #FF6868", +"g. c #FFA1A1", +"h. c #FE7F7F", +"i. c #F54747", +"j. c #E59E9F", +"k. c #C11C1C", +"l. c #E93D3D", +"m. c #FB6362", +"n. c #FB9C9C", +"o. c #FB9B9B", +"p. c #FB9A9A", +"q. c #FA9999", +"r. c #FA5A59", +"s. c #E62F2F", +"t. c #BC1819", +"u. c #EACBCF", +"v. c #EBF5FF", +"w. c #E5F1FF", +"x. c #99CCFF", +"y. c #CF3434", +"z. c #E13939", +"A. c #FE6665", +"B. c #FE9C9B", +"C. c #FE7C7A", +"D. c #DC7F7F", +"E. c #C21C1C", +"F. c #FC6160", +"G. c #FB9796", +"H. c #FB9695", +"I. c #FB9594", +"J. c #FB9493", +"K. c #FA9392", +"L. c #FA9291", +"M. c #F94242", +"N. c #E62B2B", +"O. c #BC1818", +"P. c #E9CBCF", +"Q. c #EDF6FF", +"R. c #E9F4FF", +"S. c #E2F0FF", +"T. c #D03434", +"U. c #E23939", +"V. c #FE6463", +"W. c #FE9794", +"X. c #FD7876", +"Y. c #F44646", +"Z. c #C82222", +"`. c #EA3D3D", +" + c #FC5F5D", +".+ c #FD928F", +"++ c #FD918E", +"@+ c #FD908D", +"#+ c #FC8F8C", +"$+ c #FC8E8B", +"%+ c #FC8D8A", +"&+ c #FB8683", +"*+ c #F93434", +"=+ c #F82C2C", +"-+ c #E52727", +";+ c #BC1717", +">+ c #E8CBCF", +",+ c #E1F0FF", +"'+ c #D13434", +")+ c #FE6260", +"!+ c #FE918D", +"~+ c #FD7370", +"{+ c #FC5D5B", +"]+ c #FD8D88", +"^+ c #FD8C87", +"/+ c #FD8A86", +"(+ c #FC8985", +"_+ c #FC8884", +":+ c #FC8783", +"<+ c #FC8682", +"[+ c #FA6462", +"}+ c #F82A2A", +"|+ c #F82727", +"1+ c #E52323", +"2+ c #BC1616", +"3+ c #E7CACF", +"4+ c #EFF6FF", +"5+ c #E6F3FF", +"6+ c #CEE6FF", +"7+ c #D23434", +"8+ c #E33939", +"9+ c #FE5C5A", +"0+ c #FE8C87", +"a+ c #FE8C86", +"b+ c #FD8B85", +"c+ c #FD8984", +"d+ c #FC7672", +"e+ c #FD8782", +"f+ c #FD8681", +"g+ c #FD8580", +"h+ c #FC847F", +"i+ c #FC837E", +"j+ c #FC827D", +"k+ c #FC817B", +"l+ c #FC807A", +"m+ c #F83636", +"n+ c #F72525", +"o+ c #F72323", +"p+ c #E41F1F", +"q+ c #BA1313", +"r+ c #EAD9DF", +"s+ c #EBF4FF", +"t+ c #CDE6FF", +"u+ c #DC5F5F", +"v+ c #D92C2C", +"w+ c #FC4B4A", +"x+ c #FE7B76", +"y+ c #FE8780", +"z+ c #FD8780", +"A+ c #FD8680", +"B+ c #FD857F", +"C+ c #FD847D", +"D+ c #FC837C", +"E+ c #FC827B", +"F+ c #FC817A", +"G+ c #FC8079", +"H+ c #FC7F78", +"I+ c #FC7E77", +"J+ c #FB7D76", +"K+ c #FB7C75", +"L+ c #FB7A74", +"M+ c #F95C58", +"N+ c #F62121", +"O+ c #D71919", +"P+ c #C13031", +"Q+ c #EBE7EF", +"R+ c #DFEFFF", +"S+ c #FC4A4A", +"T+ c #FE7770", +"U+ c #FD8179", +"V+ c #FD8078", +"W+ c #FD7F77", +"X+ c #FC7E76", +"Y+ c #FC7D75", +"Z+ c #FC7C74", +"`+ c #FC7A72", +" @ c #FC7971", +".@ c #FC7870", +"+@ c #FB776F", +"@@ c #FB766E", +"#@ c #FB756D", +"$@ c #FA6F68", +"%@ c #F82E2E", +"&@ c #C23031", +"*@ c #EAE7EF", +"=@ c #CCE5FF", +"-@ c #FC4A49", +";@ c #FD726B", +">@ c #FD7C73", +",@ c #FD7A71", +"'@ c #FD7970", +")@ c #FC786F", +"!@ c #FC776E", +"~@ c #FC766D", +"{@ c #FC756C", +"]@ c #FC746B", +"^@ c #FC736A", +"/@ c #FB7269", +"(@ c #FB7168", +"_@ c #FB7066", +":@ c #FB6E65", +"<@ c #F83F3C", +"[@ c #D81919", +"}@ c #C33031", +"|@ c #E8E6EF", +"1@ c #DDEEFF", +"2@ c #CBE5FF", +"3@ c #FB4A49", +"4@ c #FC6E65", +"5@ c #FC776C", +"6@ c #FC766C", +"7@ c #FC756B", +"8@ c #FC746A", +"9@ c #FC7369", +"0@ c #FC7267", +"a@ c #FC7166", +"b@ c #FC7065", +"c@ c #FB6F64", +"d@ c #FB6E63", +"e@ c #FB6D62", +"f@ c #FB6B61", +"g@ c #FB6A60", +"h@ c #FA695F", +"i@ c #F94944", +"j@ c #D91919", +"k@ c #C43031", +"l@ c #DCEDFF", +"m@ c #CBE4FF", +"n@ c #FA4949", +"o@ c #FC6960", +"p@ c #FC7064", +"q@ c #FC6F63", +"r@ c #FC6E62", +"s@ c #FC6D61", +"t@ c #FC6C60", +"u@ c #FC6A5F", +"v@ c #FB695D", +"w@ c #FB685C", +"x@ c #FB675B", +"y@ c #FB665A", +"z@ c #FB6559", +"A@ c #FA6458", +"B@ c #F94641", +"C@ c #C53031", +"D@ c #E7E5EF", +"E@ c #DBEDFF", +"F@ c #CAE4FF", +"G@ c #DB5F5F", +"H@ c #D82C2C", +"I@ c #FA4646", +"J@ c #FC6258", +"K@ c #FC685B", +"L@ c #FC675A", +"M@ c #FC6659", +"N@ c #FC6558", +"O@ c #FB6457", +"P@ c #FB6356", +"Q@ c #FB6255", +"R@ c #FB6154", +"S@ c #FB6053", +"T@ c #FA5B4F", +"U@ c #F83A36", +"V@ c #DA1919", +"W@ c #C52F31", +"X@ c #C9E4FF", +"Y@ c #F3CECF", +"Z@ c #CB0C0C", +"`@ c #F04242", +" # c #FB4F48", +".# c #FB6253", +"+# c #FB6152", +"@# c #FB6051", +"## c #FB5E50", +"$# c #FB5D4F", +"%# c #FA5C4E", +"&# c #FA5B4D", +"*# c #FA5A4C", +"=# c #F94B41", +"-# c #F11F1F", +";# c #C70C0C", +"># c #D5898F", +",# c #DAECFF", +"'# c #CF1C1C", +")# c #ED3D3D", +"!# c #FB4B45", +"~# c #FB5C4D", +"{# c #FB5B4C", +"]# c #FB5A4B", +"^# c #FB594A", +"/# c #FB5849", +"(# c #FA5748", +"_# c #FA5646", +":# c #F95244", +"<# c #F83834", +"[# c #F72A2A", +"}# c #F61F1F", +"|# c #F31D1D", +"1# c #E91A1A", +"2# c #C50909", +"3# c #D7989F", +"4# c #D9ECFF", +"5# c #C8E3FF", +"6# c #D01C1C", +"7# c #EE3D3D", +"8# c #FB4943", +"9# c #FB5948", +"0# c #FB5847", +"a# c #FB5746", +"b# c #FB5545", +"c# c #FA5444", +"d# c #FA5343", +"e# c #F95242", +"f# c #F8463B", +"g# c #F62E2D", +"h# c #F52A2A", +"i# c #F52727", +"j# c #F52525", +"k# c #F52323", +"l# c #F51F1F", +"m# c #F11D1D", +"n# c #EF1A1A", +"o# c #EF1818", +"p# c #E91616", +"q# c #C50707", +"r# c #D6979F", +"s# c #D8EBFF", +"t# c #F4CECF", +"u# c #D11C1C", +"v# c #FA5545", +"w# c #F95343", +"x# c #F85041", +"y# c #F53934", +"z# c #F32C2C", +"A# c #F12A2A", +"B# c #F12727", +"C# c #F12525", +"D# c #F12323", +"E# c #F22121", +"F# c #EE1D1D", +"G# c #EE1A1A", +"H# c #EE1616", +"I# c #ED1414", +"J# c #E71212", +"K# c #C50606", +"L# c #D5979F", +"M# c #D7EBFF", +"N# c #C7E3FF", +"O# c #D31C1C", +"P# c #EF3D3D", +"Q# c #F95444", +"R# c #F85343", +"S# c #F6493D", +"T# c #F2302F", +"U# c #F02C2C", +"V# c #EF2A2A", +"W# c #EE2727", +"X# c #EE2525", +"Y# c #ED2323", +"Z# c #EE2121", +"`# c #EB1F1F", +" $ c #E91D1D", +".$ c #EA1A1A", +"+$ c #EB1818", +"@$ c #EC1616", +"#$ c #ED1212", +"$$ c #ED0F0F", +"%$ c #E70D0D", +"&$ c #C50404", +"*$ c #D4969F", +"=$ c #D6EAFF", +"-$ c #C6E2FF", +";$ c #D41C1C", +">$ c #F4433A", +",$ c #F02E2E", +"'$ c #EE2C2C", +")$ c #EC2A2A", +"!$ c #EB2727", +"~$ c #EB2525", +"{$ c #EA2323", +"]$ c #E92121", +"^$ c #E51F1F", +"/$ c #E51D1D", +"($ c #E51A1A", +"_$ c #E71818", +":$ c #E71616", +"<$ c #E91414", +"[$ c #EA1212", +"}$ c #EC0F0F", +"|$ c #EC0D0D", +"1$ c #EB0B0B", +"2$ c #E50909", +"3$ c #C50202", +"4$ c #D3969F", +"5$ c #D5EAFF", +"6$ c #EEF6FF", +"7$ c #FAEEEF", +"8$ c #D31414", +"9$ c #EB3D3D", +"0$ c #FB4843", +"a$ c #F75343", +"b$ c #F23D37", +"c$ c #EF2E2E", +"d$ c #EC2C2C", +"e$ c #EA2A2A", +"f$ c #E92727", +"g$ c #E82525", +"h$ c #E62323", +"i$ c #E32121", +"j$ c #E11F1F", +"k$ c #E11D1D", +"l$ c #E11A1A", +"m$ c #E21818", +"n$ c #E31616", +"o$ c #E41414", +"p$ c #E61212", +"q$ c #E70F0F", +"r$ c #E90D0D", +"s$ c #EA0909", +"t$ c #EA0707", +"u$ c #E30404", +"v$ c #C00000", +"w$ c #D8C2CF", +"x$ c #C5E2FF", +"y$ c #EB9E9F", +"z$ c #D71818", +"A$ c #F53F3E", +"B$ c #FB5245", +"C$ c #EE2E2E", +"D$ c #EB2C2C", +"E$ c #E92A2A", +"F$ c #E72727", +"G$ c #E52525", +"H$ c #E22323", +"I$ c #DE2121", +"J$ c #DD1F1F", +"K$ c #DD1D1D", +"L$ c #DD1A1A", +"M$ c #DD1818", +"N$ c #DE1616", +"O$ c #DF1414", +"P$ c #E11212", +"Q$ c #E20F0F", +"R$ c #E40D0D", +"S$ c #E60B0B", +"T$ c #E80909", +"U$ c #E80404", +"V$ c #CE0202", +"W$ c #C9595F", +"X$ c #D4E9FF", +"Y$ c #C4E1FF", +"Z$ c #EA9E9F", +"`$ c #D71616", +" % c #F53B3A", +".% c #FA4F42", +"+% c #F3433A", +"@% c #E82A2A", +"#% c #E62727", +"$% c #E22525", +"%% c #DD2323", +"&% c #DB2121", +"*% c #CE1D1D", +"=% c #D71D1D", +"-% c #D81A1A", +";% c #D91818", +">% c #D91616", +",% c #DB1414", +"'% c #DC1212", +")% c #DE0F0F", +"!% c #DF0D0D", +"~% c #E20B0B", +"{% c #E40909", +"]% c #E60707", +"^% c #E70404", +"/% c #CF0202", +"(% c #CA595F", +"_% c #D3E9FF", +":% c #EDF5FF", +"<% c #EA9D9F", +"[% c #D71414", +"}% c #F33735", +"|% c #F84D40", +"1% c #F64E3F", +"2% c #E42727", +"3% c #DE2525", +"4% c #DB2323", +"5% c #D92121", +"6% c #CA1919", +"7% c #C91111", +"8% c #C61010", +"9% c #D31818", +"0% c #D51616", +"a% c #D61414", +"b% c #D71212", +"c% c #D90F0F", +"d% c #DB0D0D", +"e% c #DD0B0B", +"f% c #DF0909", +"g% c #E10707", +"h% c #E20404", +"i% c #CB595F", +"j% c #D2E8FF", +"k% c #C3E1FF", +"l% c #ECF5FF", +"m% c #E99D9F", +"n% c #D61313", +"o% c #EE3231", +"p% c #F13230", +"q% c #E62A2A", +"r% c #E22727", +"s% c #D82121", +"t% c #C91919", +"u% c #CF2F31", +"v% c #E7E4EF", +"w% c #D45B5F", +"x% c #C40E0E", +"y% c #D01414", +"z% c #D21212", +"A% c #D40F0F", +"B% c #D60D0D", +"C% c #D80B0B", +"D% c #DA0909", +"E% c #DC0707", +"F% c #DE0404", +"G% c #CC0202", +"H% c #CC595F", +"I% c #D1E8FF", +"J% c #C2E1FF", +"K% c #F7FAFF", +"L% c #E79C9F", +"M% c #D41111", +"N% c #E72C2C", +"O% c #E32727", +"P% c #DF2525", +"Q% c #D35B5F", +"R% c #C30B0B", +"S% c #CE0F0F", +"T% c #D10D0D", +"U% c #D30B0B", +"V% c #D50909", +"W% c #D80707", +"X% c #D90404", +"Y% c #CA0202", +"Z% c #CD595F", +"`% c #ADD6FF", +" & c #F4F9FF", +".& c #E49A9F", +"+& c #D20F0F", +"@& c #E12727", +"#& c #E12525", +"$& c #CB1919", +"%& c #D12F31", +"&& c #D25A5F", +"*& c #C20808", +"=& c #CD0B0B", +"-& c #D10909", +";& c #D30707", +">& c #D50404", +",& c #C80202", +"'& c #CE595F", +")& c #C1E0FF", +"!& c #DEEFFF", +"~& c #F2F9FF", +"{& c #E39A9F", +"]& c #D00E0E", +"^& c #CD1919", +"/& c #D22F31", +"(& c #C30505", +"_& c #CE0707", +":& c #D00404", +"<& c #C60202", +"[& c #C0DFFF", +"}& c #EEF7FF", +"|& c #E2999F", +"1& c #CF0C0C", +"2& c #CF1919", +"3& c #D32F31", +"4& c #D15A5F", +"5& c #C40303", +"6& c #CF595F", +"7& c #ECF6FF", +"8& c #E1999F", +"9& c #D52D2F", +"0& c #D1595F", +"a& c #D0595F", +"b& c #BFDFFF", +"c& c #EAF4FF", +"d& c #BFDEFF", +"e& c #BEDEFF", +"f& c #CAE5FF", +"g& c #BDDEFF", +"h& c #BCDDFF", +"i& c #BBDDFF", +"j& c #BADCFF", +"k& c #B9DCFF", +"l& c #C4E2FF", +"m& c #B8DBFF", +"n& c #889299", +"o& c #99C9F9", +"p& c #B0D7FF", +"q& c #97C7F7", +"r& c #A1B6CA", +"s& c #ACD5FF", +"t& c #ABD5FF", +"u& c #AAD5FF", +"v& c #AAD4FF", +"w& c #A9D4FF", +"x& c #A8D4FF", +"y& c #A8D3FF", +"z& c #A7D3FF", +"A& c #A6D2FF", +"B& c #A5D2FF", +"C& c #A4D2FF", +"D& c #A4D1FF", +"E& c #A3D1FF", +"F& c #8DA2B6", +"G& c #A2B2BF", +"H& c #9DBEDF", +"I& c #9BC3E9", +"J& c #9BC2E9", +"K& c #9BC2E8", +"L& c #9AC2E8", +"M& c #9AC1E8", +"N& c #9AC1E7", +"O& c #99C1E7", +"P& c #99C0E7", +"Q& c #99C0E6", +"R& c #98C0E6", +"S& c #98BFE6", +"T& c #98BFE5", +"U& c #97BFE5", +"V& c #97BEE5", +"W& c #97BEE4", +"X& c #96BEE4", +"Y& c #96BDE4", +"Z& c #96BDE3", +"`& c #95BDE3", +" * c #95BCE3", +".* c #95BCE2", +"+* c #94BCE2", +"@* c #90ABC5", +"#* c #8B9BA8", +"$* c #848889", +"%* c #999C9D", +"&* c #96999A", +"** c #959899", +"=* c #949798", +"-* c #939697", +";* c #929596", +">* c #909394", +",* c #8E9292", +"'* c #8D9091", +")* c #8B8E8F", +"!* c #888B8C", +"~* c #878A8B", +"{* c #868A8A", +"]* c #858889", +"^* c #848788", +"/* c #838787", +"(* c #818586", +"_* c #818485", +":* c #808485", +"<* c #7F8384", +"[* c #7F8383", +"}* c #787C7D", +" ", +" ", +" ", +" . + + @ # # $ % % & & * = = - ; ; > , , ' ) ) ! ! ~ { { ] ^ ^ / ( ( _ : : < < [ } } | 1 1 2 3 3 ", +" 4 5 6 6 7 7 7 8 8 8 9 9 9 0 0 0 a a a b b b c c c c d d d e e e f f f g g g h h h i i i j j j k l m ", +" 4 n o p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p q q q q q q q q r r s s s s s o t u ", +" 4 v w x x x x x x x x x x x x x x x x x x x x x x x x x x x y z z A A B C C D D E F G H I I I J K L M N ", +" 4 o I x x x x x x x x x x x x x x x x x x x x x x x x x x y z z A A B C C D D E F G H I I I J K K O o N ", +" 4 o P x x x x x x x x x x x x x x x x x x x x x x x x x y z z A A B C C D D E F G H I I I J K K Q R o N ", +" 4 o P x x x x x x x x x x x x x x x x x x x x x x x x y z z A A B C C D D E F G H I I I J K K Q Q R o N ", +" 4 o P x x x x x x x x x x x x x x x x x x x x x x x y z z A A B C C D D E F G H I I I J K K Q Q S T o N ", +" 4 o P x x x x x x x x x x x x x x x x x x x x x x y z z A A B C C D D E F G H I I I J K K Q Q S S T o N ", +" 4 o P x x x x x x x x x x x x x x x x x x x x x y z z A A B C C D D E F G H I I I J K K Q Q S S U T o N ", +" 4 o P x x x x x x x x x x x x x x x x x x x x y z z A A B C C D D E F G H I I I J K K Q Q S S U U V o N ", +" 4 o P x x x x x x x x x x x x x x x x x x x y z z A A B C C D D E F G H I I I J K K Q Q S S U U W V o N ", +" 4 o P x x x x x x x x x x X Y x x x x x x y z z A A Z ` C D D E F G H I I I J K K Q Q S S U U W W V o N ", +" 4 o P x x x x x x x x x X ...+.x x x x y z z A A Z @.#.$.D E F G H I I I J K K Q Q S S U U W W %.w o N ", +" 4 o P x x x x x x x x &.*.=.-.;.+.x x y z z A A Z >.,.'.).!.F G H I I I J K K Q Q S S U U W W %.~.{.o N ", +" 4 o P x x x x x x x &.].^./.(.-.;.+.y z z A A _.:.,.<.[.}.|.1.H I I I J K K Q Q S S U U W W %.~.P {.o N ", +" 4 o P x x x x x x &.2.^./.3.3.4.-.;.+.z A A _.5.,.<.6.7.8.9.0.a.I I J K K Q Q S S U U W W %.~.P P b.c.N ", +" 4 o P x x x x x &.d.e.f.g.g.g.g.h.i.;.j.A _.k.l.m.n.o.p.q.r.s.t.u.J K K Q Q S S U U W W %.P v.O w.q x.N ", +" 4 o P x x x x &.y.z.A.B.B.B.B.B.B.C.i.;.D.E.l.F.G.H.I.J.K.L.M.N.O.P.K Q Q S S U U W W Q.R.V w {.S.r x.N ", +" 4 o P x x x &.T.U.V.W.W.W.W.W.W.W.W.X.Y.Z.`. +.+++@+#+$+%+&+*+=+-+;+>+Q S S U U W Q.O T V w {.S.,+r x.N ", +" 4 o P x x &.'+U.)+!+!+!+!+!+!+!+!+!+!+~+M.{+]+^+/+(+_+:+<+[+=+}+|+1+2+3+S U U 4+O 5+T V w {.S.,+,+6+x.N ", +" 4 o P x &.7+8+9+0+0+0+0+0+0+0+0+0+a+b+c+d+e+f+g+h+i+j+k+l+m+}+|+n+o+p+q+r+~.s+R 5+T V w {.S.,+,+b.t+x.N ", +" 4 o P x x u+v+w+x+y+y+z+z+z+z+z+A+B+C+D+E+F+G+H+I+J+K+L+M+}+|+n+o+N+O+P+Q+R.R 5+T V w {.S.,+,+b.R+t+x.N ", +" 4 o P x x x u+v+S+T+U+U+U+U+U+U+V+W+X+Y+Z+`+ @.@+@@@#@$@%@|+n+o+N+O+&@*@O R 5+T V w {.S.,+,+b.R+L =@x.N ", +" 4 o P x x x x u+v+-@;@>@>@>@>@,@'@)@!@~@{@]@^@/@(@_@:@<@|+n+o+N+[@}@|@O R 5+T V w {.S.,+,+b.R+L 1@2@x.N ", +" 4 o P x x x x x u+v+3@4@5@6@7@8@9@0@a@b@c@d@e@f@g@h@i@|+n+o+N+j@k@|@O R 5+T V w {.S.,+,+b.R+L 1@l@m@x.N ", +" 4 o P x x x x y z u+v+n@o@p@q@r@s@t@u@v@w@x@y@z@A@B@|+n+o+N+j@C@D@O R 5+T V w {.S.,+,+b.R+L 1@l@E@F@x.N ", +" 4 o P x x x y z z A G@H@I@J@K@L@M@N@O@P@Q@R@S@T@U@|+n+o+N+V@W@D@O R 5+T V w {.S.,+,+b.R+L 1@l@E@E@X@x.N ", +" 4 o P x x y z z A A Y@Z@`@ #.#+#@###$#%#&#*#=#=+|+n+o+N+-#;#>#O R 5+T V w {.S.,+,+b.R+L 1@l@E@E@,#X@x.N ", +" 4 o P x y z z A A Y@'#)#!#~#{#]#^#/#(#_#:#<#[#|+n+o+N+}#|#1#2#3#5+T V w {.S.,+,+b.R+L 1@l@E@E@,#4#5#x.N ", +" 4 o P y z z A A Y@6#7#8#9#0#a#b#c#d#e#f#g#h#i#j#k#N+l#m#n#o#p#q#r#V w {.S.,+,+b.R+L 1@l@E@E@,#4#s#5#x.N ", +" 4 o P z z A A t#u#7#8#9#0#a#v#c#w#x#y#z#A#B#C#D#E#-#F#G#o#H#I#J#K#L#{.S.,+,+b.R+L 1@l@E@E@,#4#s#M#N#x.N ", +" 4 o 4+z A A t#O#P#8#9#0#a#v#Q#R#S#T#U#V#W#X#Y#Z#`# $.$+$@$I##$$$%$&$*$,+,+b.R+L 1@l@E@E@,#4#s#M#=$-$x.N ", +" 4 o 4+A A t#;$P#8#9#0#a#v#Q#R#>$,$'$)$!$~${$]$^$/$($_$:$<$[$}$|$1$2$3$4$b.R+L 1@l@E@E@,#4#s#M#=$5$-$x.N ", +" 4 o 6$A 7$8$9$0$9#0#a#v#Q#a$b$c$d$e$f$g$h$i$j$k$l$m$n$o$p$q$r$1$s$t$u$v$w$L 1@l@E@E@,#4#s#M#=$5$5$x$x.N ", +" 4 o 6$B C y$z$A$B$a#v#Q#a$b$C$D$E$F$G$H$I$J$K$L$M$N$O$P$Q$R$S$T$t$U$V$W$L 1@l@E@E@,#4#s#M#=$5$5$X$Y$x.N ", +" 4 o 6$C C D Z$`$ %.%Q#R#+%C$D$@%#%$%%%&%*%=%-%;%>%,%'%)%!%~%{%]%^%/%(%L 1@l@E@E@,#4#s#M#=$5$5$X$_%Y$x.N ", +" 4 o :%C D D E <%[%}%|%1%c$D$@%2%3%4%5%6%7%8%9%0%a%b%c%d%e%f%g%h%V$i%L 1@l@E@E@,#4#s#M#=$5$5$X$_%j%k%x.N ", +" 4 o l%D D E F G m%n%o%p%d$q%r%3%4%s%t%u%v%w%x%y%z%A%B%C%D%E%F%G%H%L 1@l@E@E@,#4#s#M#=$5$5$X$_%j%I%J%x.N ", +" 4 o l%D E F G H K%L%M%N%q%O%P%4%s%6%u%v%O R Q%R%S%T%U%V%W%X%Y%Z%L 1@l@E@E@,#4#s#M#=$5$5$X$_%j%I%q o x.N ", +" 4 `%V H I J &S U W .&+&@&#&%%5%$&%&v%O R 5+T &&*&=&-&;&>&,&'&L 1@l@E@E@,#4#s#M#=$5$5$X$_%j%I%q r )&x.N ", +" 4 x.!&K Q S ~&U W ~.P {&]&4%&%^&/&v%O R 5+T V w &&(&_&:&<&'&L 1@l@E@E@,#4#s#M#=$5$5$X$_%j%I%q r r [&x.N ", +" 4 x.L Q S ~&U W ~.P }&Q.|&1&2&3&v%O R 5+T V w {.S.4&5&3$6&L 1@l@E@E@,#4#s#M#=$5$5$X$_%j%I%q r r 6+[&x.N ", +" 4 x.1@S ~&U W ~.P }&Q.7&l%8&9&v%O R 5+T V w {.S.,+,+0&a&L 1@l@E@E@,#4#s#M#=$5$5$X$_%j%I%q r r 6+t+b&x.N ", +" 4 x.l@~&U W ~.P }&Q.7&l%v.c&R.O R 5+T V w {.S.,+,+b.R+L 1@l@E@E@,#4#s#M#=$5$5$X$_%j%I%q r r 6+t+=@d&x.N ", +" 4 x.l@U W ~.P }&Q.7&l%v.c&R.O R 5+T V w {.S.,+,+b.R+L 1@l@E@E@,#4#s#M#=$5$5$X$_%j%I%q r r 6+t+=@2@e&x.N ", +" 4 x.E@W ~.P }&Q.7&l%v.c&R.O R 5+T V w {.S.,+,+b.R+L 1@l@E@E@,#4#s#M#=$5$5$X$_%j%I%q r r 6+t+=@2@f&g&x.N ", +" 4 x.E@~.P }&Q.7&l%v.c&R.O R 5+T V w {.S.,+,+b.R+L 1@l@E@E@,#4#s#M#=$5$5$X$_%j%I%q r r 6+t+=@2@f&X@g&x.N ", +" 4 x.,#P }&Q.7&l%v.c&R.O R 5+T V w {.S.,+,+b.R+L 1@l@E@E@,#4#s#M#=$5$5$X$_%j%I%q r r 6+t+=@2@f&X@X@h&x.N ", +" 4 x.4#}&Q.7&l%v.c&R.O R 5+T V w {.S.,+,+b.R+L 1@l@E@E@,#4#s#M#=$5$5$X$_%j%I%q r r 6+t+=@2@f&X@X@5#i&x.N ", +" 4 x.4#Q.7&l%v.c&R.O R 5+T V w {.S.,+,+b.R+L 1@l@E@E@,#4#s#M#=$5$5$X$_%j%I%q r r 6+t+=@2@f&X@X@5#N#i&x.N ", +" 4 x.s#7&l%v.c&R.O R 5+T V w {.S.,+,+b.R+L 1@l@E@E@,#4#s#M#=$5$5$X$_%j%I%q r r 6+t+=@2@f&X@X@5#N#-$j&x.N ", +" 4 x.M#l%v.c&R.O R 5+T V w {.S.,+,+b.R+L 1@l@E@E@,#4#s#M#=$5$5$X$_%j%I%q r r 6+t+=@2@f&X@X@5#N#-$x$k&x.N ", +" 4 x.M#v.c&R.O R 5+T V w {.S.,+,+b.R+L 1@l@E@E@,#4#s#M#=$5$5$X$_%j%I%q r r 6+t+=@2@f&X@X@5#N#-$x$l&k&x.N ", +" 4 x.=$c&R.O R 5+T V w {.S.,+,+b.R+L 1@l@E@E@,#4#s#M#=$5$5$X$_%j%I%q r r 6+t+=@2@f&X@X@5#N#-$x$l&k%m&x.n& ", +" 4 o&-$R.O R 5+T V w {.S.,+,+b.R+L 1@l@E@E@,#4#s#M#=$5$5$X$_%j%I%q r r 6+t+=@2@f&X@X@5#N#-$x$l&k%J%p&q&N ", +" 4 r&x.`%s&s&s&s&t&t&t&t&t&u&v&v&v&v&w&w&w&w&x&y&y&y&y&z&z&z&z&z&A&A&A&A&B&B&B&B&B&C&D&D&D&D&E&E&E&x.F&u ", +" 4 G&H&I&J&J&J&K&L&L&M&M&M&N&N&O&P&P&P&Q&Q&R&S&S&S&S&T&U&U&V&V&V&W&X&X&Y&Y&Y&Z&Z&`& * * *.*.*+*@*#*$* ", +" . > , %*' ) ) ! &*~ **=*] -*^ ;*/ ( >*_ : ,*< '*[ } )*| 1 1 2 !*3 ~*{*N ]*$*^*/*u u (*_*:*<*[*}* ", +" ", +" "}; diff --git a/ksquirrel/fmt_filters.cpp b/ksquirrel/fmt_filters.cpp new file mode 100644 index 0000000..6496846 --- /dev/null +++ b/ksquirrel/fmt_filters.cpp @@ -0,0 +1,2288 @@ +/* + * Copyright (c) 2005 Dmitry Baryshev + */ + +/* This file is part of the KDE libraries + Copyright (C) 1998, 1999, 2001, 2002 Daniel M. Duley + (C) 1998, 1999 Christian Tibirna + (C) 1998, 1999 Dirk A. Mueller + (C) 1999 Geert Jansen + (C) 2000 Josef Weidendorfer + (C) 2004 Zack Rusin + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +*/ + +// +// =================================================================== +// Effects originally ported from ImageMagick for PixiePlus, plus a few +// new ones. (mosfet 05/26/2003) +// =================================================================== +// +/* + Portions of this software are based on ImageMagick. Such portions are clearly +marked as being ported from ImageMagick. ImageMagick is copyrighted under the +following conditions: + +Copyright (C) 2003 ImageMagick Studio, a non-profit organization dedicated to +making software imaging solutions freely available. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files ("ImageMagick"), to deal +in ImageMagick without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of ImageMagick, and to permit persons to whom the ImageMagick is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of ImageMagick. + +The software is provided "as is", without warranty of any kind, express or +implied, including but not limited to the warranties of merchantability, +fitness for a particular purpose and noninfringement. In no event shall +ImageMagick Studio be liable for any claim, damages or other liability, +whether in an action of contract, tort or otherwise, arising from, out of or +in connection with ImageMagick or the use or other dealings in ImageMagick. + +Except as contained in this notice, the name of the ImageMagick Studio shall +not be used in advertising or otherwise to promote the sale, use or other +dealings in ImageMagick without prior written authorization from the +ImageMagick Studio. +*/ + +#include "fmt_filters.h" + +#include +#include +#include +#include +#include + + +namespace fmt_filters +{ + +#define MaxRGB 255L +#define DegreesToRadians(x) ((x)*M_PI/180.0) +#define MagickSQ2PI 2.50662827463100024161235523934010416269302368164062 +#define MagickEpsilon 1.0e-12 +#define MagickPI 3.14159265358979323846264338327950288419716939937510 + +#define F_MAX(a, b) ((b) < (a) ? (a) : (b)) +#define F_MIN(a, b) ((a) < (b) ? (a) : (b)) + +static void rgb2hsv(const fmt_filters::rgb &rgb, s32 *h, s32 *s, s32 *v); +static void hsv2rgb(s32 h, s32 s, s32 v, fmt_filters::rgb *rgb); +static fmt_filters::rgba interpolateColor(const fmt_filters::image &image, double x_offset, double y_offset, const fmt_filters::rgba &background); +static u32 generateNoise(u32 pixel, fmt_filters::NoiseType noise_type); +static u32 intensityValue(s32 r, s32 g, s32 b); +static u32 intensityValue(const fmt_filters::rgba &rr); +static s32 getBlurKernel(s32 width, double sigma, double **kernel); +static void blurScanLine(double *kernel, s32 width, fmt_filters::rgba *src, fmt_filters::rgba *dest, s32 columns); +static void hull(const s32 x_offset, const s32 y_offset, const s32 polarity, const s32 columns, + const s32 rows, u8 *f, u8 *g); +static bool convolveImage(fmt_filters::image *image, fmt_filters::rgba **dest, const unsigned int order, const double *kernel); +static int getOptimalKernelWidth(double radius, double sigma); + +template +static void scaleDown(T &val, T min, T max); + +struct double_packet +{ + double red; + double green; + double blue; + double alpha; +}; + +struct short_packet +{ + unsigned short int red; + unsigned short int green; + unsigned short int blue; + unsigned short int alpha; +}; + +bool checkImage(const image &im) +{ + return (im.rw && im.rh && im.w && im.h && im.data); +} + +// colorize tool +void colorize(const image &im, s32 red, s32 green, s32 blue) +{ + // check if all parameters are good + if(!checkImage(im)) + return; + + if(!red && !green && !blue) + return; + + u8 *bits; + s32 val; + s32 V[3] = { red, green, blue }; + + // add to RED component 'red' value, and check if the result is out of bounds. + // do the same with GREEN and BLUE channels. + for(s32 y = 0;y < im.h;++y) + { + bits = im.data + im.rw * y * sizeof(rgba); + + for(s32 x = 0;x < im.w;x++) + { + for(s32 v = 0;v < 3;++v) + { + val = (s32)*(bits + v) + V[v]; + + if(val > 255) + *(bits + v) = 255; + else if(val < 0) + *(bits + v) = 0; + else + *(bits + v) = val; + } + + bits += 4; + } + } +} + +// brightness tool +void brightness(const image &im, s32 bn) +{ + // check if all parameters are good + if(!checkImage(im)) + return; + + u8 *bits; + s32 val; + + // add to all color components 'bn' value, and check if the result is out of bounds. + for(s32 y = 0;y < im.h;++y) + { + bits = im.data + im.rw * y * sizeof(rgba); + + for(s32 x = 0;x < im.w;x++) + { + for(s32 v = 0;v < 3;v++) + { + val = bn + *bits; + *bits = val < 0 ? 0 : (val > 255 ? 255 : val); + + bits++; + } + + bits++; + } + } +} + +// gamma tool +void gamma(const image &im, double L) +{ + // check if all parameters are good + if(!checkImage(im)) + return; + + if(L == 0 || L < 0) L = 0.01; + + rgba *_rgba; + u8 R, G, B; + u8 GT[256]; + + GT[0] = 0; + + // fill the array with gamma koefficients + for (s32 x = 1; x < 256; ++x) + GT[x] = (u8)round(255 * pow((double)x / 255.0, 1.0 / L)); + + // now change gamma + for(s32 y = 0;y < im.h;++y) + { + _rgba = (rgba *)im.data + im.rw * y; + + for(s32 x = 0;x < im.w;x++) + { + R = _rgba[x].r; + G = _rgba[x].g; + B = _rgba[x].b; + + _rgba[x].r = GT[R]; + _rgba[x].g = GT[G]; + _rgba[x].b = GT[B]; + } + } +} + +// contrast tool +void contrast(const image &im, s32 contrast) +{ + if(!checkImage(im) || !contrast) + return; + + if(contrast < -255) contrast = -255; + if(contrast > 255) contrast = 255; + + rgba *bits; + u8 Ravg, Gavg, Bavg; + s32 Ra = 0, Ga = 0, Ba = 0, Rn, Gn, Bn; + + // calculate the average values for RED, GREEN and BLUE + // color components + for(s32 y = 0;y < im.h;y++) + { + bits = (rgba *)im.data + im.rw * y; + + for(s32 x = 0;x < im.w;x++) + { + Ra += bits->r; + Ga += bits->g; + Ba += bits->b; + + bits++; + } + } + + s32 S = im.w * im.h; + + Ravg = Ra / S; + Gavg = Ga / S; + Bavg = Ba / S; + + // ok, now change contrast + // with the terms of alghoritm: + // + // if contrast > 0: I = (I - Avg) * 256 / (256 - contrast) + Avg + // if contrast < 0: I = (I - Avg) * (256 + contrast) / 256 + Avg + // + // where + // I - current color component value + // Avg - average value of this component (Ravg, Gavg or Bavg) + // + for(s32 y = 0;y < im.h;y++) + { + bits = (rgba *)im.data + im.rw * y; + + for(s32 x = 0;x < im.w;x++) + { + Rn = (contrast > 0) ? ((bits->r - Ravg) * 256 / (256 - contrast) + Ravg) : ((bits->r - Ravg) * (256 + contrast) / 256 + Ravg); + Gn = (contrast > 0) ? ((bits->g - Gavg) * 256 / (256 - contrast) + Gavg) : ((bits->g - Gavg) * (256 + contrast) / 256 + Gavg); + Bn = (contrast > 0) ? ((bits->b - Bavg) * 256 / (256 - contrast) + Bavg) : ((bits->b - Bavg) * (256 + contrast) / 256 + Bavg); + + bits->r = Rn < 0 ? 0 : (Rn > 255 ? 255 : Rn); + bits->g = Gn < 0 ? 0 : (Gn > 255 ? 255 : Gn); + bits->b = Bn < 0 ? 0 : (Bn > 255 ? 255 : Bn); + + bits++; + } + } +} + +// negative +void negative(const image &im) +{ + // check if all parameters are good + if(!checkImage(im)) + return; + + rgba *bits; + u8 R, G, B; + + for(s32 y = 0;y < im.h;y++) + { + bits = (rgba *)im.data + im.rw * y; + + for(s32 x = 0;x < im.w;x++) + { + R = bits->r; + G = bits->g; + B = bits->b; + + bits->r = 255 - R; + bits->g = 255 - G; + bits->b = 255 - B; + + bits++; + } + } +} + +// swap RGB values +void swapRGB(const image &im, s32 type) +{ + // check if all parameters are good + if(!checkImage(im) || (type != GBR && type != BRG)) + return; + + rgba *bits; + u8 R, G, B; + + for(s32 y = 0;y < im.h;y++) + { + bits = (rgba *)im.data + im.rw * y; + + for(s32 x = 0;x < im.w;x++) + { + R = bits->r; + G = bits->g; + B = bits->b; + + bits->r = (type == GBR) ? G : B; + bits->g = (type == GBR) ? B : R; + bits->b = (type == GBR) ? R : G; + + bits++; + } + } +} + +// blend +void blend(const image &im, const rgb &rgb, float opacity) +{ + // check parameters + if(!checkImage(im)) + return; + + scaleDown(opacity, 0.0f, 1.0f); + + rgba *bits; + s32 r = rgb.r, g = rgb.g, b = rgb.b; + + // blend! + for(s32 y = 0;y < im.h;++y) + { + bits = (rgba *)im.data + im.rw * y; + + for(s32 x = 0;x < im.w;x++) + { + bits->r = bits->r + (u8)((b - bits->r) * opacity); + bits->g = bits->g + (u8)((g - bits->g) * opacity); + bits->b = bits->b + (u8)((r - bits->b) * opacity); + + bits++; + } + } +} + +void flatten(const image &im, const rgb &ca, const rgb &cb) +{ + if(!checkImage(im)) + return; + + s32 r1 = ca.r; s32 r2 = cb.r; + s32 g1 = ca.g; s32 g2 = cb.g; + s32 b1 = ca.b; s32 b2 = cb.b; + s32 min = 0, max = 255; + s32 mean; + + rgba *bits; + rgb _rgb; + + for(s32 y = 0;y < im.h;++y) + { + bits = (rgba *)im.data + im.rw * y; + + for(s32 x = 0;x < im.w;++x) + { + mean = (bits->r + bits->g + bits->b) / 3; + min = F_MIN(min, mean); + max = F_MAX(max, mean); + bits++; + } + } + + // Conversion factors + float sr = ((float) r2 - r1) / (max - min); + float sg = ((float) g2 - g1) / (max - min); + float sb = ((float) b2 - b1) / (max - min); + + // Repaint the image + for(s32 y = 0;y < im.h;++y) + { + bits = (rgba *)im.data + im.w*y; + + for(s32 x = 0;x < im.w;++x) + { + mean = (bits->r + bits->g + bits->b) / 3; + + bits->r = (s32)(sr * (mean - min) + r1 + 0.5); + bits->g = (s32)(sg * (mean - min) + g1 + 0.5); + bits->b = (s32)(sb * (mean - min) + b1 + 0.5); + + bits++; + } + } +} + +void fade(const image &im, const rgb &rgb, float val) +{ + if(!checkImage(im)) + return; + + u8 tbl[256]; + + for (s32 i = 0;i < 256;i++) + tbl[i] = (s32)(val * i + 0.5); + + s32 r, g, b, cr, cg, cb; + + rgba *bits; + + for(s32 y = 0;y < im.h;y++) + { + bits = (rgba *)im.data + im.rw * y; + + for(s32 x = 0;x < im.w;x++) + { + cr = bits->r; + cg = bits->g; + cb = bits->b; + + r = (cr > rgb.r) ? (cr - tbl[cr - rgb.r]) : (cr + tbl[rgb.r - cr]); + g = (cg > rgb.g) ? (cg - tbl[cg - rgb.g]) : (cg + tbl[rgb.g - cg]); + b = (cb > rgb.b) ? (cb - tbl[cb - rgb.b]) : (cb + tbl[rgb.b - cb]); + + bits->r = r; + bits->g = g; + bits->b = b; + + bits++; + } + } +} + +void gray(const image &im) +{ + if(!checkImage(im)) + return; + + rgba *bits; + s32 g; + + for(s32 y = 0;y < im.h;y++) + { + bits = (rgba *)im.data + im.rw * y; + + for(s32 x = 0;x < im.w;x++) + { + g = (bits->r * 11 + bits->g * 16 + bits->b * 5)/32; + + bits->r = g; + bits->g = g; + bits->b = g; + + bits++; + } + } +} + +void desaturate(const image &im, float desat) +{ + if(!checkImage(im)) + return; + + scaleDown(desat, 0.0f, 1.0f); + + rgba *bits; + s32 h = 0, s = 0, v = 0; + + for(s32 y = 0;y < im.h;y++) + { + bits = (rgba *)im.data + im.rw * y; + + for(s32 x = 0;x < im.w;x++) + { + rgb _rgb(bits->r, bits->g, bits->b); + rgb2hsv(_rgb, &h, &s, &v); + hsv2rgb(h, (s32)(s * (1.0 - desat)), v, &_rgb); + + bits->r = _rgb.r; + bits->g = _rgb.g; + bits->b = _rgb.b; + + bits++; + } + } +} + +void threshold(const image &im, u32 trh) +{ + if(!checkImage(im)) + return; + + scaleDown(trh, (u32)0, (u32)255); + + rgba *bits; + + for(s32 y = 0;y < im.h;y++) + { + bits = (rgba *)im.data + im.rw * y; + + for(s32 x = 0;x < im.w;x++) + { + if(intensityValue(bits->r, bits->g, bits->b) < trh) + bits->r = bits->g = bits->b = 0; + else + bits->r = bits->g = bits->b = 255; + + bits++; + } + } +} + +void solarize(const image &im, double factor) +{ + if(!checkImage(im)) + return; + + s32 threshold; + rgba *bits; + + threshold = (s32)(factor * (MaxRGB+1)/100.0); + + for(s32 y = 0;y < im.h;y++) + { + bits = (rgba *)im.data + im.rw * y; + + for(s32 x = 0;x < im.w;x++) + { + bits->r = bits->r > threshold ? MaxRGB-bits->r : bits->r; + bits->g = bits->g > threshold ? MaxRGB-bits->g : bits->g; + bits->b = bits->b > threshold ? MaxRGB-bits->b : bits->b; + + bits++; + } + } +} + +void spread(const image &im, u32 amount) +{ + if(!checkImage(im) || im.w < 3 || im.h < 3) + return; + + rgba *n = new rgba [im.rw * im.rh]; + + if(!n) + return; + + s32 quantum; + s32 x_distance, y_distance; + rgba *bits = (rgba *)im.data, *q; + + memcpy(n, im.data, im.rw * im.rh * sizeof(rgba)); + + quantum = (amount+1) >> 1; + + for(s32 y = 0;y < im.h;y++) + { + q = n + im.rw*y; + + for(s32 x = 0;x < im.w;x++) + { + x_distance = x + ((rand() & (amount+1))-quantum); + y_distance = y + ((rand() & (amount+1))-quantum); + x_distance = F_MIN(x_distance, im.w-1); + y_distance = F_MIN(y_distance, im.h-1); + + if(x_distance < 0) x_distance = 0; + if(y_distance < 0) y_distance = 0; + + *q++ = *(bits + y_distance*im.rw + x_distance); + } + } + + memcpy(im.data, n, im.rw * im.rh * sizeof(rgba)); + + delete [] n; +} + +void swirl(const image &im, double degrees, const rgba &background) +{ + if(!checkImage(im)) + return; + + double cosine, distance, factor, radius, sine, x_center, x_distance, + x_scale, y_center, y_distance, y_scale; + s32 x, y; + + rgba *q, *p; + rgba *bits = (rgba *)im.data; + rgba *dest = new rgba [im.rw * im.rh]; + + if(!dest) + return; + + memcpy(dest, im.data, im.rw * im.rh * sizeof(rgba)); + + // compute scaling factor + x_center = im.w / 2.0; + y_center = im.h / 2.0; + + radius = F_MAX(x_center, y_center); + x_scale=1.0; + y_scale=1.0; + + if(im.w > im.h) + y_scale=(double)im.w / im.h; + else if(im.w < im.h) + x_scale=(double)im.h / im.w; + + degrees = DegreesToRadians(degrees); + + // swirl each row + + for(y = 0;y < im.h;y++) + { + p = bits + im.rw * y; + q = dest + im.rw * y; + y_distance = y_scale * (y-y_center); + + for(x = 0;x < im.w;x++) + { + // determine if the pixel is within an ellipse + *q = *p; + x_distance = x_scale*(x-x_center); + distance = x_distance*x_distance+y_distance*y_distance; + + if(distance < (radius*radius)) + { + // swirl + factor = 1.0 - sqrt(distance)/radius; + sine = sin(degrees*factor*factor); + cosine = cos(degrees*factor*factor); + + *q = interpolateColor(im, + (cosine*x_distance-sine*y_distance)/x_scale+x_center, + (sine*x_distance+cosine*y_distance)/y_scale+y_center, + background); + } + + p++; + q++; + } + } + + memcpy(im.data, dest, im.rw * im.rh * sizeof(rgba)); + + delete [] dest; +} + +void noise(const image &im, NoiseType noise_type) +{ + if(!checkImage(im)) + return; + + s32 x, y; + rgba *dest = new rgba [im.rw * im.rh]; + + if(!dest) + return; + + rgba *bits; + rgba *destData; + + for(y = 0;y < im.h;++y) + { + bits = (rgba *)im.data + im.rw * y; + destData = dest + im.rw * y; + + for(x = 0;x < im.w;++x) + { + destData[x].r = generateNoise(bits->r, noise_type); + destData[x].g = generateNoise(bits->g, noise_type); + destData[x].b = generateNoise(bits->b, noise_type); + destData[x].a = bits->a; + + bits++; + } + } + + memcpy(im.data, dest, im.rw * im.rh * sizeof(rgba)); + + delete [] dest; +} + +void implode(const image &im, double _factor, const rgba &background) +{ + if(!checkImage(im)) + return; + + double amount, distance, radius; + double x_center, x_distance, x_scale; + double y_center, y_distance, y_scale; + rgba *dest; + s32 x, y; + + rgba *n = new rgba [im.rw * im.rh]; + + if(!n) + return; + + rgba *bits; + + // compute scaling factor + x_scale = 1.0; + y_scale = 1.0; + x_center = (double)0.5*im.w; + y_center = (double)0.5*im.h; + radius=x_center; + + if(im.w > im.h) + y_scale = (double)im.w/im.h; + else if(im.w < im.h) + { + x_scale = (double)im.h/im.w; + radius = y_center; + } + + amount=_factor/10.0; + + if(amount >= 0) + amount/=10.0; + + double factor; + + for(y = 0;y < im.h;++y) + { + bits = (rgba *)im.data + im.rw * y; + dest = n + im.rw * y; + + y_distance = y_scale * (y-y_center); + + for(x = 0;x < im.w;++x) + { + x_distance = x_scale*(x-x_center); + distance= x_distance*x_distance+y_distance*y_distance; + + if(distance < (radius*radius)) + { + // Implode the pixel. + factor = 1.0; + + if(distance > 0.0) + factor = pow(sin(0.5000000000000001*M_PI*sqrt(distance)/radius),-amount); + + *dest = interpolateColor(im, factor*x_distance/x_scale+x_center, + factor*y_distance/y_scale+y_center, + background); + } + else + *dest = *bits; + + bits++; + dest++; + } + } + + memcpy(im.data, n, im.rw * im.rh * sizeof(rgba)); + + delete [] n; +} + +void despeckle(const image &im) +{ + if(!checkImage(im)) + return; + + s32 i, j, x, y; + u8 *blue_channel, *red_channel, *green_channel, *buffer, *alpha_channel; + s32 packets; + + static const s32 + X[4] = {0, 1, 1,-1}, + Y[4] = {1, 0, 1, 1}; + + rgba *n = new rgba [im.rw * im.rh]; + + if(!n) + return; + + packets = (im.w+2) * (im.h+2); + + red_channel = new u8 [packets]; + green_channel = new u8 [packets]; + blue_channel = new u8 [packets]; + alpha_channel = new u8 [packets]; + buffer = new u8 [packets]; + + if(!red_channel || ! green_channel || ! blue_channel || ! alpha_channel || !buffer) + { + if(red_channel) delete [] red_channel; + if(green_channel) delete [] green_channel; + if(blue_channel) delete [] blue_channel; + if(alpha_channel) delete [] alpha_channel; + if(buffer) delete [] buffer; + + delete [] n; + + return; + } + + // copy image pixels to color component buffers + j = im.w+2; + + rgba *bits; + + for(y = 0;y < im.h;++y) + { + bits = (rgba *)im.data + im.rw*y; + ++j; + + for(x = 0;x < im.w;++x) + { + red_channel[j] = bits->r; + green_channel[j] = bits->g; + blue_channel[j] = bits->b; + alpha_channel[j] = bits->a; + + bits++; + ++j; + } + + ++j; + } + + // reduce speckle in red channel + for(i = 0;i < 4;i++) + { + hull(X[i],Y[i],1,im.w,im.h,red_channel,buffer); + hull(-X[i],-Y[i],1,im.w,im.h,red_channel,buffer); + hull(-X[i],-Y[i],-1,im.w,im.h,red_channel,buffer); + hull(X[i],Y[i],-1,im.w,im.h,red_channel,buffer); + } + + // reduce speckle in green channel + for(i = 0;i < packets;i++) + buffer[i] = 0; + + for(i = 0;i < 4;i++) + { + hull(X[i],Y[i],1,im.w,im.h,green_channel,buffer); + hull(-X[i],-Y[i],1,im.w,im.h,green_channel,buffer); + hull(-X[i],-Y[i],-1,im.w,im.h,green_channel,buffer); + hull(X[i],Y[i],-1,im.w,im.h,green_channel,buffer); + } + + // reduce speckle in blue channel + for(i = 0;i < packets;i++) + buffer[i] = 0; + + for(i = 0;i < 4;i++) + { + hull(X[i],Y[i],1,im.w,im.h,blue_channel,buffer); + hull(-X[i],-Y[i],1,im.w,im.h,blue_channel,buffer); + hull(-X[i],-Y[i],-1,im.w,im.h,blue_channel,buffer); + hull(X[i],Y[i],-1,im.w,im.h,blue_channel,buffer); + } + + // copy color component buffers to despeckled image + j = im.w+2; + + for(y = 0;y < im.h;++y) + { + bits = n + im.rw*y; + ++j; + + for(x = 0;x < im.w;++x) + { + *bits = rgba(red_channel[j], green_channel[j], blue_channel[j], alpha_channel[j]); + + bits++; + ++j; + } + + ++j; + } + + delete [] buffer; + delete [] red_channel; + delete [] green_channel; + delete [] blue_channel; + delete [] alpha_channel; + + memcpy(im.data, n, im.rw * im.rh * sizeof(rgba)); + + delete [] n; +} + +void blur(const image &im, double radius, double sigma) +{ + if(!checkImage(im)) + return; + + double *kernel; + rgba *dest; + s32 width; + s32 x, y; + rgba *scanline, *temp; + rgba *p, *q; + + if(sigma == 0.0) + return; + + kernel = 0; + + if(radius > 0) + width = getBlurKernel((s32)(2*ceil(radius)+1), sigma, &kernel); + else + { + double *last_kernel = 0; + + width = getBlurKernel(3, sigma, &kernel); + + while((long)(MaxRGB * kernel[0]) > 0) + { + if(last_kernel) + delete [] last_kernel; + + last_kernel = kernel; + kernel = 0; + + width = getBlurKernel(width+2, sigma, &kernel); + } + + if(last_kernel) + { + delete [] kernel; + width -= 2; + kernel = last_kernel; + } + } + + if(width < 3) + { + delete [] kernel; + return; + } + + dest = new rgba [im.rw * im.rh]; + + if(!dest) + { + delete [] kernel; + return; + } + + scanline = new rgba [im.h]; + temp = new rgba [im.h]; + + if(!scanline || !temp) + { + if(scanline) delete [] scanline; + if(temp) delete [] temp; + + delete [] kernel; + return; + } + + rgba *bits = (rgba *)im.data; + + for(y = 0;y < im.h;++y) + { + p = bits + im.rw*y; + q = dest + im.rw*y; + + blurScanLine(kernel, width, p, q, im.w); + } + + for(x = 0;x < im.w;++x) + { + for(y = 0;y < im.h;++y) + scanline[y] = *(bits + im.rw*y + x); + + blurScanLine(kernel, width, scanline, temp, im.h); + + for(y = 0;y < im.h;++y) + *(dest + im.rw*y + x) = temp[y]; + + } + + delete [] scanline; + delete [] temp; + delete [] kernel; + + memcpy(im.data, dest, im.rw * im.rh * sizeof(rgba)); + + delete [] dest; +} + +void equalize(const image &im) +{ + if(!checkImage(im)) + return; + + double_packet high, low, intensity, *map, *histogram; + short_packet *equalize_map; + s32 x, y; + rgba *p, *q; + long i; + u8 r, g, b, a; + + histogram = new double_packet [256]; + map = new double_packet [256]; + equalize_map = new short_packet [256]; + + if(!histogram || !map || !equalize_map) + { + if(histogram) delete [] histogram; + if(map) delete [] map; + if(equalize_map) delete [] equalize_map; + + return; + } + + rgba *bits = (rgba *)im.data; + + /* + * Form histogram. + */ + memset(histogram, 0, 256 * sizeof(double_packet)); + + for(y = 0;y < im.h;++y) + { + p = bits + im.rw * y; + + for(x = 0;x < im.w;++x) + { + histogram[p->r].red++; + histogram[p->g].green++; + histogram[p->b].blue++; + histogram[p->a].alpha++; + + p++; + } + } + /* + Integrate the histogram to get the equalization map. + */ + memset(&intensity, 0 ,sizeof(double_packet)); + + for(i = 0;i < 256;++i) + { + intensity.red += histogram[i].red; + intensity.green += histogram[i].green; + intensity.blue += histogram[i].blue; + intensity.alpha += histogram[i].alpha; + + map[i] = intensity; + } + + low=map[0]; + high=map[255]; + memset(equalize_map, 0, 256 * sizeof(short_packet)); + + for(i = 0;i < 256;++i) + { + if(high.red != low.red) + equalize_map[i].red=(unsigned short) + ((65535*(map[i].red-low.red))/(high.red-low.red)); + if(high.green != low.green) + equalize_map[i].green=(unsigned short) + ((65535*(map[i].green-low.green))/(high.green-low.green)); + if(high.blue != low.blue) + equalize_map[i].blue=(unsigned short) + ((65535*(map[i].blue-low.blue))/(high.blue-low.blue)); + if(high.alpha != low.alpha) + equalize_map[i].alpha=(unsigned short) + ((65535*(map[i].alpha-low.alpha))/(high.alpha-low.alpha)); + } + + delete [] histogram; + delete [] map; + + /* + Stretch the histogram. + */ + for(y = 0;y < im.h;++y) + { + q = bits + im.rw*y; + + for(x = 0;x < im.w;++x) + { + if(low.red != high.red) + r = (equalize_map[(unsigned short)(q->r)].red/257); + else + r = q->r; + if(low.green != high.green) + g = (equalize_map[(unsigned short)(q->g)].green/257); + else + g = q->g; + if(low.blue != high.blue) + b = (equalize_map[(unsigned short)(q->b)].blue/257); + else + b = q->b; + if(low.alpha != high.alpha) + a = (equalize_map[(unsigned short)(q->a)].alpha/257); + else + a = q->a; + + *q = rgba(r, g, b, a); + + q++; + } + } + + delete [] equalize_map; +} + +struct PointInfo +{ + double x, y, z; +}; + +void shade(const image &im, bool color_shading, double azimuth, + double elevation) +{ + if(!checkImage(im)) + return; + + rgba *n = new rgba [im.rw * im.rh]; + + if(!n) + return; + + double distance, normal_distance, shade; + s32 x, y; + + struct PointInfo light, normal; + + rgba *bits; + rgba *q; + + azimuth = DegreesToRadians(azimuth); + elevation = DegreesToRadians(elevation); + light.x = MaxRGB*cos(azimuth)*cos(elevation); + light.y = MaxRGB*sin(azimuth)*cos(elevation); + light.z = MaxRGB*sin(elevation); + normal.z= 2*MaxRGB; // constant Z of surface normal + + rgba *s0, *s1, *s2; + + for(y = 0;y < im.h;++y) + { + bits = (rgba *)im.data + im.rw * (F_MIN(F_MAX(y-1,0),im.h-3)); + q = n + im.rw * y; + + // shade this row of pixels. + *q++ = (*(bits+im.rw)); + bits++; + + s0 = bits; + s1 = bits + im.rw; + s2 = bits + 2*im.rw; + + for(x = 1;x < im.w-1;++x) + { + // determine the surface normal and compute shading. + normal.x = intensityValue(*(s0-1))+intensityValue(*(s1-1))+intensityValue(*(s2-1))- + (double) intensityValue(*(s0+1))-(double) intensityValue(*(s1+1))- + (double) intensityValue(*(s2+1)); + + normal.y = intensityValue(*(s2-1))+intensityValue(*s2)+intensityValue(*(s2+1))- + (double) intensityValue(*(s0-1))-(double) intensityValue(*s0)- + (double) intensityValue(*(s0+1)); + + if(normal.x == 0 && normal.y == 0) + shade = light.z; + else + { + shade = 0.0; + distance = normal.x*light.x+normal.y*light.y+normal.z*light.z; + + if(distance > 0.0) + { + normal_distance = normal.x*normal.x+normal.y*normal.y+normal.z*normal.z; + + if(fabs(normal_distance) > 0.0000001) + shade=distance/sqrt(normal_distance); + } + } + + if(!color_shading) + { + *q = rgba((u8)(shade), + (u8)(shade), + (u8)(shade), + s1->a); + } + else + { + *q = rgba((u8)((shade * s1->r)/(MaxRGB+1)), + (u8)((shade * s1->g)/(MaxRGB+1)), + (u8)((shade * s1->b)/(MaxRGB+1)), + s1->a); + } + + ++s0; + ++s1; + ++s2; + q++; + } + + *q++ = (*s1); + } + + memcpy(im.data, n, im.rw * im.rh * sizeof(rgba)); + + delete [] n; +} + +void edge(image &im, double radius) +{ + if(!checkImage(im)) + return; + + double *kernel; + int width; + register long i; + rgba *dest = 0; + + width = getOptimalKernelWidth(radius, 0.5); + + const int W = width*width; + + if(im.w < width || im.h < width) + return; + + kernel = new double [W]; + + if(!kernel) + return; + + for(i = 0;i < W;i++) + kernel[i] = -1.0; + + kernel[i/2] = W-1.0; + + if(!convolveImage(&im, &dest, width, kernel)) + { + delete [] kernel; + + if(dest) + delete [] dest; + + return; + } + + delete [] kernel; + + memcpy(im.data, dest, im.rw * im.rh * sizeof(rgba)); + + delete [] dest; +} + +void emboss(image &im, double radius, double sigma) +{ + if(!checkImage(im)) + return; + + double alpha, *kernel; + int j, width; + register long i, u, v; + rgba *dest = 0; + + if(sigma == 0.0) + return; + + width = getOptimalKernelWidth(radius, sigma); + + if(im.w < width || im.h < width) + return; + + kernel = new double [width*width]; + + if(!kernel) + return; + + i = 0; + j = width/2; + + const double S = sigma * sigma; + + for(v = (-width/2);v <= (width/2);v++) + { + for(u=(-width/2); u <= (width/2); u++) + { + alpha = exp(-((double) u*u+v*v)/(2.0*S)); + + kernel[i] = ((u < 0) || (v < 0) ? -8.0 : 8.0)*alpha/(2.0*MagickPI*S); + + if (u == j) + kernel[i]=0.0; + + i++; + } + + j--; + } + + if(!convolveImage(&im, &dest, width, kernel)) + { + delete [] kernel; + return; + } + + delete [] kernel; + + fmt_filters::image mm((u8 *)dest, im.w, im.h, im.rw, im.rh); + + equalize(mm); + + memcpy(im.data, dest, im.rw * im.rh * sizeof(rgba)); + + delete [] dest; +} + +void sharpen(image &im, double radius, double sigma) +{ + if(!checkImage(im)) + return; + + double alpha, normalize, *kernel; + int width; + register long i, u, v; + rgba *dest = 0; + + if(sigma == 0.0) + sigma = 0.01; + + width = getOptimalKernelWidth(radius, sigma); + + if(im.w < width) + return; + + kernel = new double [width*width]; + + if(!kernel) + return; + + i = 0; + normalize = 0.0; + const double S = sigma * sigma; + const int w2 = width / 2; + + for(v = -w2; v <= w2; v++) + { + for(u = -w2; u <= w2; u++) + { + alpha = exp(-((double) u*u+v*v)/(2.0*S)); + kernel[i] = alpha/(2.0*MagickPI*S); + normalize += kernel[i]; + + i++; + } + } + + kernel[i/2] = (-2.0)*normalize; + + if(!convolveImage(&im, &dest, width, kernel)) + { + delete [] kernel; + + if(dest) + delete [] dest; + + return; + } + + delete [] kernel; + + memcpy(im.data, dest, im.rw * im.rh * sizeof(rgba)); + + delete [] dest; +} + +void oil(const image &im, double radius) +{ + if(!checkImage(im)) + return; + + unsigned long count; + unsigned long histogram[256]; + unsigned int k; + int width; + int x, y, mx, my, sx, sy; + int mcx, mcy; + rgba *s = 0, *q; + + scaleDown(radius, 1.0, 5.0); + + rgba *n = new rgba [im.rw * im.rh]; + + if(!n) + return; + + memcpy(n, im.data, im.rw * im.rh * sizeof(rgba)); + + width = getOptimalKernelWidth(radius, 0.5); + + if(im.w < width) + { + delete [] n; + return; + } + + rgba *bits = (rgba *)im.data; + + for(y = 0;y < im.h;++y) + { + sy = y-(width/2); + q = n + im.rw*y; + + for(x = 0;x < im.w;++x) + { + count = 0; + memset(histogram, 0, 256 * sizeof(unsigned long)); + sy = y-(width/2); + + for(mcy = 0;mcy < width;++mcy,++sy) + { + my = sy < 0 ? 0 : sy > im.h-1 ? im.h-1 : sy; + sx = x+(-width/2); + + for(mcx = 0; mcx < width;++mcx,++sx) + { + mx = sx < 0 ? 0 : sx > im.w-1 ? im.w-1 : sx; + + k = intensityValue(*(bits + my*im.rw + mx)); + + if(k > 255) k = 255; + + histogram[k]++; + + if(histogram[k] > count) + { + count = histogram[k]; + s = bits + my*im.rw + mx; + } + } + } + + *q++ = (*s); + } + } + + memcpy(im.data, n, im.rw * im.rh * sizeof(rgba)); + + delete [] n; +} +/* + * Red-eye removal was taken from "redeye" plugin for GIMP + */ + +/* redeye.c: redeye remover plugin code + * + * Copyright (C) 2004 Robert Merkel (the "Author"). + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + * Except as contained in this notice, the name of the Author of the + * Software shall not be used in advertising or otherwise to promote the + * sale, use or other dealings in this Software without prior written + * authorization from the Author. +1;3B */ + +void redeye(const image &im, const int w, const int h, const int x, const int y, int th) +{ + const double RED_FACTOR = 0.5133333; + const double GREEN_FACTOR = 1; + const double BLUE_FACTOR = 0.1933333; + + if(!checkImage(im)) + return; + + scaleDown(th, 0, 255); + + int y1, x1; + int adjusted_red, adjusted_green, adjusted_blue; + + rgba *src = (rgba *)im.data, *s; + + for(y1 = y;y1 < y+h;++y1) + { + s = src + im.w*y1 + x; + + for(x1 = x;x1 < x+w;x1++) + { + adjusted_red = int(s->r * RED_FACTOR); + adjusted_green = int(s->g * GREEN_FACTOR); + adjusted_blue = int(s->b * BLUE_FACTOR); + + if(adjusted_red >= adjusted_green - th && adjusted_red >= adjusted_blue - th) + s->r = (int)(((double)(adjusted_green + adjusted_blue)) / (2.0 * RED_FACTOR)); + + s++; + } + } +} + + +/*************************************************************************/ + +/* + * + * Helper functions + * + */ + +/*************************************************************************/ + +static bool convolveImage(image *image, rgba **dest, const unsigned int order, + const double *kernel) +{ + long width; + double red, green, blue; + u8 alpha; + double normalize, *normal_kernel; + register const double *k; + register rgba *q; + int x, y, mx, my, sx, sy; + long i; + int mcx, mcy; + + width = order; + + if((width % 2) == 0) + return false; + + const int W = width*width; + + normal_kernel = new double [W]; + + if(!normal_kernel) + return false; + + *dest = new rgba [image->rw * image->rh]; + + if(!*dest) + { + delete [] normal_kernel; + return false; + } + + normalize = 0.0; + + for(i = 0;i < W;i++) + normalize += kernel[i]; + + if(fabs(normalize) <= MagickEpsilon) + normalize = 1.0; + + normalize=1.0/normalize; + + for(i = 0;i < W;i++) + normal_kernel[i] = normalize*kernel[i]; + + rgba *bits = (rgba *)image->data; + + for(y = 0;y < image->h;++y) + { + sy = y-(width/2); + q = *dest + image->rw * y; + + for(x = 0;x < image->w;++x) + { + k = normal_kernel; + red = green = blue = alpha = 0; + sy = y-(width/2); + alpha = (bits + image->rw*y+x)->a; + + for(mcy=0; mcy < width; ++mcy, ++sy) + { + my = sy < 0 ? 0 : sy > image->h-1 ? image->h-1 : sy; + sx = x+(-width/2); + + for(mcx=0; mcx < width; ++mcx, ++sx) + { + mx = sx < 0 ? 0 : sx > image->w-1 ? image->w-1 : sx; + red += (*k) * ((bits + image->rw*my+mx)->r*257); + green += (*k) * ((bits + image->rw*my+mx)->g*257); + blue += (*k) * ((bits + image->rw*my+mx)->b*257); +// alpha += (*k) * ((bits + image->rw*my+mx)->a*257); + + ++k; + } + } + + red = red < 0 ? 0 : red > 65535 ? 65535 : red+0.5; + green = green < 0 ? 0 : green > 65535 ? 65535 : green+0.5; + blue = blue < 0 ? 0 : blue > 65535 ? 65535 : blue+0.5; +// alpha = alpha < 0 ? 0 : alpha > 65535 ? 65535 : alpha+0.5; + + *q++ = rgba((unsigned char)(red/257UL), + (unsigned char)(green/257UL), + (unsigned char)(blue/257UL), + alpha); + } + } + + delete [] normal_kernel; + + return true; +} + +static void rgb2hsv(const rgb &rgb, s32 *h, s32 *s, s32 *v) +{ + if(!h || !s || !v) + return; + + s32 r = rgb.r; + s32 g = rgb.g; + s32 b = rgb.b; + + u32 max = r; + s32 whatmax = 0; // r=>0, g=>1, b=>2 + + if((u32)g > max) + { + max = g; + whatmax = 1; + } + + if((u32)b > max) + { + max = b; + whatmax = 2; + } + + u32 min = r; // find minimum value + if((u32)g < min) min = g; + if((u32)b < min) min = b; + + s32 delta = max-min; + *v = max; // calc value + *s = max ? (510*delta+max)/(2*max) : 0; + + if(*s == 0) + { + *h = -1; // undefined hue + } + else + { + switch(whatmax) + { + case 0: // red is max component + if(g >= b) + *h = (120*(g-b)+delta)/(2*delta); + else + *h = (120*(g-b+delta)+delta)/(2*delta) + 300; + break; + + case 1: // green is max component + if(b > r) + *h = 120 + (120*(b-r)+delta)/(2*delta); + else + *h = 60 + (120*(b-r+delta)+delta)/(2*delta); + break; + + case 2: // blue is max component + if(r > g) + *h = 240 + (120*(r-g)+delta)/(2*delta); + else + *h = 180 + (120*(r-g+delta)+delta)/(2*delta); + break; + } + } +} + +static void hsv2rgb(s32 h, s32 s, s32 v, rgb *rgb) +{ + if(h < -1 || (u32)s > 255 || (u32)v > 255 || !rgb) + return; + + s32 r = v, g = v, b = v; + + if(s == 0 || h == -1) + { + // Ignore + } + else + { // chromatic case + if((u32)h >= 360) + h %= 360; + + u32 f = h%60; + h /= 60; + u32 p = (u32)(2*v*(255-s)+255)/510; + u32 q, t; + + if(h&1) + { + q = (u32)(2*v*(15300-s*f)+15300)/30600; + + switch(h) + { + case 1: r=(s32)q; g=(s32)v, b=(s32)p; break; + case 3: r=(s32)p; g=(s32)q, b=(s32)v; break; + case 5: r=(s32)v; g=(s32)p, b=(s32)q; break; + } + } + else + { + t = (u32)(2*v*(15300-(s*(60-f)))+15300)/30600; + + switch(h) + { + case 0: r=(s32)v; g=(s32)t, b=(s32)p; break; + case 2: r=(s32)p; g=(s32)v, b=(s32)t; break; + case 4: r=(s32)t; g=(s32)p, b=(s32)v; break; + } + } + } + + rgb->r = r; + rgb->g = g; + rgb->b = b; +} + +static rgba interpolateColor(const image &im, double x_offset, double y_offset, const rgba &background) +{ + double alpha, beta; + rgba p, q, r, s; + s32 x, y; + rgba *bits = (rgba *)im.data; + + if(!checkImage(im)) + return background; + + x = (s32)x_offset; + y = (s32)y_offset; + + if((x < -1) || (x >= im.w) || (y < -1) || (y >= im.h)) + return background; + + if((x >= 0) && (y >= 0) && (x < (im.w-1)) && (y < (im.h-1))) + { + rgba *t = bits + y * im.rw; + + p = t[x]; + q = t[x+1]; + r = t[x+im.rw]; + s = t[x+im.rw+1]; + } + else + { + rgba *t = bits + y * im.rw; + + p = background; + + if((x >= 0) && (y >= 0)) + p = t[x]; + + q = background; + + if(((x+1) < im.w) && (y >= 0)) + q = t[x+1]; + + r = background; + + if((x >= 0) && ((y+1) < im.h)) + { + t = bits + (y+1) * im.rw; + r = t[x+im.rw]; + } + + s = background; + + if(((x+1) < im.w) && ((y+1) < im.h)) + { + t = bits + (y+1) * im.rw; + s = t[x+im.rw+1]; + } + } + + x_offset -= floor(x_offset); + y_offset -= floor(y_offset); + alpha = 1.0-x_offset; + beta = 1.0-y_offset; + + rgba _r; + + _r.r = (u8)(beta * (alpha*p.r + x_offset*q.r) + y_offset * (alpha*r.r + x_offset*s.r)); + _r.g = (u8)(beta * (alpha*p.g + x_offset*q.g) + y_offset * (alpha*r.g + x_offset*s.g)); + _r.b = (u8)(beta * (alpha*p.b + x_offset*q.b) + y_offset * (alpha*r.b + x_offset*s.b)); + _r.a = (u8)(beta * (alpha*p.a + x_offset*q.a) + y_offset * (alpha*r.a + x_offset*s.a)); + + return _r; +} + +static u32 generateNoise(u32 pixel, NoiseType noise_type) +{ +#define NoiseEpsilon 1.0e-5 +#define NoiseMask 0x7fff +#define SigmaUniform 4.0 +#define SigmaGaussian 4.0 +#define SigmaImpulse 0.10 +#define SigmaLaplacian 10.0 +#define SigmaMultiplicativeGaussian 0.5 +#define SigmaPoisson 0.05 +#define TauGaussian 20.0 + + double alpha, beta, sigma, value; + alpha=(double) (rand() & NoiseMask)/NoiseMask; + if (alpha == 0.0) + alpha=1.0; + switch(noise_type){ + case UniformNoise: + default: + { + value=(double) pixel+SigmaUniform*(alpha-0.5); + break; + } + case GaussianNoise: + { + double tau; + + beta=(double) (rand() & NoiseMask)/NoiseMask; + sigma=sqrt(-2.0*log(alpha))*cos(2.0*M_PI*beta); + tau=sqrt(-2.0*log(alpha))*sin(2.0*M_PI*beta); + value=(double) pixel+ + (sqrt((double) pixel)*SigmaGaussian*sigma)+(TauGaussian*tau); + break; + } + case MultiplicativeGaussianNoise: + { + if (alpha <= NoiseEpsilon) + sigma=MaxRGB; + else + sigma=sqrt(-2.0*log(alpha)); + beta=(rand() & NoiseMask)/NoiseMask; + value=(double) pixel+ + pixel*SigmaMultiplicativeGaussian*sigma*cos(2.0*M_PI*beta); + break; + } + case ImpulseNoise: + { + if (alpha < (SigmaImpulse/2.0)) + value=0; + else + if (alpha >= (1.0-(SigmaImpulse/2.0))) + value=MaxRGB; + else + value=pixel; + break; + } + case LaplacianNoise: + { + if (alpha <= 0.5) + { + if (alpha <= NoiseEpsilon) + value=(double) pixel-MaxRGB; + else + value=(double) pixel+SigmaLaplacian*log(2.0*alpha); + break; + } + beta=1.0-alpha; + if (beta <= (0.5*NoiseEpsilon)) + value=(double) pixel+MaxRGB; + else + value=(double) pixel-SigmaLaplacian*log(2.0*beta); + break; + } + case PoissonNoise: + { + register s32 + i; + + for (i=0; alpha > exp(-SigmaPoisson*pixel); i++) + { + beta=(double) (rand() & NoiseMask)/NoiseMask; + alpha=alpha*beta; + } + value=i/SigmaPoisson; + break; + } + } + + if(value < 0.0) + return 0; + else if(value > MaxRGB) + return MaxRGB; + else + return ((u32) (value+0.5)); +} + +static inline u32 intensityValue(s32 r, s32 g, s32 b) +{ + return ((u32)((0.299*r + 0.587*g + 0.1140000000000001*b))); +} + +static inline u32 intensityValue(const rgba &rr) +{ + return ((u32)((0.299*rr.r + 0.587*rr.g + 0.1140000000000001*rr.b))); +} + +template +static inline void scaleDown(T &val, T min, T max) +{ + if(val < min) + val = min; + else if(val > max) + val = max; +} + +static void blurScanLine(double *kernel, s32 width, rgba *src, rgba *dest, s32 columns) +{ + register double *p; + rgba *q; + register s32 x; + register long i; + double red, green, blue, alpha; + double scale = 0.0; + + if(width > columns) + { + for(x = 0;x < columns;++x) + { + scale = 0.0; + red = blue = green = alpha = 0.0; + p = kernel; + q = src; + + for(i = 0;i < columns;++i) + { + if((i >= (x-width/2)) && (i <= (x+width/2))) + { + red += (*p)*(q->r * 257); + green += (*p)*(q->g*257); + blue += (*p)*(q->b*257); + alpha += (*p)*(q->a*257); + } + + if(((i+width/2-x) >= 0) && ((i+width/2-x) < width)) + scale += kernel[i+width/2-x]; + + p++; + q++; + } + + scale = 1.0/scale; + red = scale*(red+0.5); + green = scale*(green+0.5); + blue = scale*(blue+0.5); + alpha = scale*(alpha+0.5); + + red = red < 0 ? 0 : red > 65535 ? 65535 : red; + green = green < 0 ? 0 : green > 65535 ? 65535 : green; + blue = blue < 0 ? 0 : blue > 65535 ? 65535 : blue; + alpha = alpha < 0 ? 0 : alpha > 65535 ? 65535 : alpha; + + dest[x] = rgba((u8)(red/257UL), + (u8)(green/257UL), + (u8)(blue/257UL), + (u8)(alpha/257UL)); + } + + return; + } + + for(x = 0;x < width/2;++x) + { + scale = 0.0; + red = blue = green = alpha = 0.0; + p = kernel+width/2-x; + q = src; + + for(i = width/2-x;i < width;++i) + { + red += (*p)*(q->r*257); + green += (*p)*(q->g*257); + blue += (*p)*(q->b*257); + alpha += (*p)*(q->a*257); + scale += (*p); + p++; + q++; + } + + scale=1.0/scale; + + red = scale*(red+0.5); + green = scale*(green+0.5); + blue = scale*(blue+0.5); + alpha = scale*(alpha+0.5); + + red = red < 0 ? 0 : red > 65535 ? 65535 : red; + green = green < 0 ? 0 : green > 65535 ? 65535 : green; + blue = blue < 0 ? 0 : blue > 65535 ? 65535 : blue; + alpha = alpha < 0 ? 0 : alpha > 65535 ? 65535 : alpha; + + dest[x] = rgba((u8)(red/257UL), + (u8)(green/257UL), + (u8)(blue/257UL), + (u8)(alpha/257UL)); + } + + for(;x < columns-width/2;++x) + { + red = blue = green = alpha = 0.0; + p = kernel; + q = src+(x-width/2); + + for(i = 0;i < (long)width;++i) + { + red += (*p)*(q->r*257); + green += (*p)*(q->g*257); + blue += (*p)*(q->b*257); + alpha += (*p)*(q->a*257); + p++; + q++; + } + + red = scale*(red+0.5); + green = scale*(green+0.5); + blue = scale*(blue+0.5); + alpha = scale*(alpha+0.5); + + red = red < 0 ? 0 : red > 65535 ? 65535 : red; + green = green < 0 ? 0 : green > 65535 ? 65535 : green; + blue = blue < 0 ? 0 : blue > 65535 ? 65535 : blue; + alpha = alpha < 0 ? 0 : alpha > 65535 ? 65535 : alpha; + + dest[x] = rgba((u8)(red/257UL), + (u8)(green/257UL), + (u8)(blue/257UL), + (u8)(alpha/257UL)); + } + + for(;x < columns;++x) + { + red = blue = green = alpha = 0.0; + scale=0; + p = kernel; + q = src+(x-width/2); + + for(i = 0;i < columns-x+width/2;++i) + { + red += (*p)*(q->r*257); + green += (*p)*(q->g*257); + blue += (*p)*(q->b*257); + alpha += (*p)*(q->a*257); + scale += (*p); + p++; + q++; + } + + scale=1.0/scale; + red = scale*(red+0.5); + green = scale*(green+0.5); + blue = scale*(blue+0.5); + alpha = scale*(alpha+0.5); + + red = red < 0 ? 0 : red > 65535 ? 65535 : red; + green = green < 0 ? 0 : green > 65535 ? 65535 : green; + blue = blue < 0 ? 0 : blue > 65535 ? 65535 : blue; + alpha = alpha < 0 ? 0 : alpha > 65535 ? 65535 : alpha; + + dest[x] = rgba((u8)(red/257UL), + (u8)(green/257UL), + (u8)(blue/257UL), + (u8)(alpha/257UL)); + } +} + +static s32 getBlurKernel(s32 width, double sigma, double **kernel) +{ + +#define KernelRank 3 +#define KernelRankQ 18.0 + + double alpha, normalize; + register long i; + s32 bias; + + if(sigma == 0.0) + return 0; + + if(width == 0) + width = 3; + + *kernel = new double [width]; + + if(!*kernel) + return 0; + + memset(*kernel, 0, width * sizeof(double)); + bias = KernelRank * width/2; + + for(i = (-bias);i <= bias; i++) + { + alpha = exp(-((double) i*i)/(KernelRankQ*sigma*sigma)); + (*kernel)[(i+bias)/KernelRank] += alpha/(MagickSQ2PI*sigma); + } + + normalize = 0; + + for(i = 0;i < width;i++) + normalize += (*kernel)[i]; + + for(i = 0;i < width;i++) + (*kernel)[i] /= normalize; + + return width; + +#undef KernelRankQ +#undef KernelRank + +} + +static void hull(const s32 x_offset, const s32 y_offset, const s32 polarity, const s32 columns, + const s32 rows, u8 *f, u8 *g) +{ + s32 x, y; + + u8 *p, *q, *r, *s; + u32 v; + + if(f == 0 || g == 0) + return; + + p = f+(columns+2); + q = g+(columns+2); + r = p+(y_offset*(columns+2)+x_offset); + + for(y = 0;y < rows;y++) + { + p++; + q++; + r++; + if(polarity > 0) + for(x = 0;x < columns;x++) + { + v=(*p); + if (*r > v) + v++; + *q=v > 255 ? 255 : v; + p++; + q++; + r++; + } + else + for(x = 0;x < columns;x++) + { + v=(*p); + if (v > (u32) (*r+1)) + v--; + *q=v; + p++; + q++; + r++; + } + p++; + q++; + r++; + } + + p = f+(columns+2); + q = g+(columns+2); + r = q+(y_offset*(columns+2)+x_offset); + s = q-(y_offset*(columns+2)+x_offset); + + for(y = 0;y < rows;y++) + { + p++; + q++; + r++; + s++; + + if(polarity > 0) + for(x=0; x < (s32) columns; x++) + { + v=(*q); + if (((u32) (*s+1) > v) && (*r > v)) + v++; + *p=v > 255 ? 255 : v; + p++; + q++; + r++; + s++; + } + else + for (x=0; x < columns; x++) + { + v=(*q); + if (((u32) (*s+1) < v) && (*r < v)) + v--; + *p=v; + p++; + q++; + r++; + s++; + } + + p++; + q++; + r++; + s++; + } +} + +static int getOptimalKernelWidth(double radius, double sigma) +{ + double normalize, value; + long width; + register long u; + + if(sigma == 0.0) + sigma = 0.01; + + if(radius > 0.0) + return((int)(2.0*ceil(radius)+1.0)); + + const double S = sigma * sigma; + + for(width = 5;;) + { + normalize = 0.0; + + for(u = (-width/2);u <= (width/2);u++) + normalize+=exp(-((double) u*u)/(2.0*S))/(MagickSQ2PI*sigma); + + u = width/2; + value = exp(-((double) u*u)/(2.0*S))/(MagickSQ2PI*sigma)/normalize; + + if((long)(65535*value) <= 0) + break; + + width+=2; + } + + return ((int)width-2); +} + +} // namespace diff --git a/ksquirrel/fmt_filters.h b/ksquirrel/fmt_filters.h new file mode 100644 index 0000000..688d4cb --- /dev/null +++ b/ksquirrel/fmt_filters.h @@ -0,0 +1,302 @@ +/* + * Copyright (c) 2005 Dmitry Baryshev + */ + +/* + * All methods (except redeye) in this namespace are ported from KDE 3.2.3. + * All of them are copyrighted by their authors. See fmt_filters_README for more. + */ + +/* This file is part of the KDE libraries + Copyright (C) 1998, 1999, 2001, 2002 Daniel M. Duley + (C) 1998, 1999 Christian Tibirna + (C) 1998, 1999 Dirk A. Mueller + (C) 1999 Geert Jansen + (C) 2000 Josef Weidendorfer + (C) 2004 Zack Rusin + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +*/ + +// +// =================================================================== +// Effects originally ported from ImageMagick for PixiePlus, plus a few +// new ones. (mosfet 05/26/2003) +// =================================================================== +// +/* + Portions of this software are based on ImageMagick. Such portions are clearly +marked as being ported from ImageMagick. ImageMagick is copyrighted under the +following conditions: + +Copyright (C) 2003 ImageMagick Studio, a non-profit organization dedicated to +making software imaging solutions freely available. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files ("ImageMagick"), to deal +in ImageMagick without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of ImageMagick, and to permit persons to whom the ImageMagick is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of ImageMagick. + +The software is provided "as is", without warranty of any kind, express or +implied, including but not limited to the warranties of merchantability, +fitness for a particular purpose and noninfringement. In no event shall +ImageMagick Studio be liable for any claim, damages or other liability, +whether in an action of contract, tort or otherwise, arising from, out of or +in connection with ImageMagick or the use or other dealings in ImageMagick. + +Except as contained in this notice, the name of the ImageMagick Studio shall +not be used in advertising or otherwise to promote the sale, use or other +dealings in ImageMagick without prior written authorization from the +ImageMagick Studio. +*/ + +#ifndef FMT_FILTERS_H +#define FMT_FILTERS_H + +////////////////////////////////////////// +// // +// Pass the image through some filter // +// // +////////////////////////////////////////// + + +namespace fmt_filters +{ + typedef char s8; + typedef unsigned char u8; + + typedef short s16; + typedef unsigned short u16; + + typedef int s32; + typedef unsigned int u32; + + struct image + { + image() : data(0), w(0), h(0), rw(0), rh(0) + {} + + image(unsigned char *d, int _w, int _h) : data(d), w(_w), h(_h), rw(_w), rh(_h) + {} + + image(unsigned char *d, int _w, int _h, int _rw, int _rh) : data(d), w(_w), h(_h), rw(_rw), rh(_rh) + {} + + unsigned char *data; + int w; + int h; + int rw; + int rh; + }; + + struct rgb + { + rgb() : r(0), g(0), b(0) + {} + + rgb(int _r, int _g, int _b) : r(_r), g(_g), b(_b) + {} + + unsigned char r; + unsigned char g; + unsigned char b; + }; + + struct rgba + { + rgba(int r1, int g1, int b1, int a1) : r(r1), g(g1), b(b1), a(a1) + {} + + rgba() : r(0), g(0), b(0), a(0) + {} + + unsigned char r; + unsigned char g; + unsigned char b; + unsigned char a; + }; + + enum NoiseType + { + UniformNoise = 0, // Uniform distribution + GaussianNoise, // Gaussian distribution + MultiplicativeGaussianNoise, // Multiplicative Gaussian distribution + ImpulseNoise, // Impulse distribution + LaplacianNoise, // Laplacian distribution + PoissonNoise // Poisson distribution + }; + + + bool checkImage(const image &im); + + // colorize the image, which is w x h, left alpha channel unchanged. + // + // it just adds to each pixel in the image + // aproproriate value. + void colorize(const image &im, int red, int green, int blue); + + // change brightness of the image + void brightness(const image &im, int bn); + + // change gamma + // gamma should be 0.0 <= L <= 6.0 + // + // it is no problem to set L to 8.0 or 9.0, but the resulting + // image won't have much difference from 6.0 + void gamma(const image &im, double L); + + // change contrast with Photoshop-like method + // contrast should be -255 <= contrast <= 255 + void contrast(const image &im, int contrast); + + enum swapRGBtype { GBR = 0, BRG = 1 }; + + // negative + void negative(const image &im); + + // swap RGB values + void swapRGB(const image &im, int type); + + // + // All the following filters are ported from KDE's + // KImageEffect. See kdelibs/kdefx/kimageeffect.cpp + // for more. + // + + // blend + // opacity = [0.0; 1.0] + void blend(const image &im, const rgb &rgb, float opacity); + + // val = [0.0; 1.0] + void fade(const image &im, const rgb &rgb, float val); + + void gray(const image &im); + + // desat = [0.0; 1.0] + void desaturate(const image &im, float desat); + + // threshold = [0; 255] + void threshold(const image &im, unsigned int threshold); + + // factor = [0.0; 50.0] + void solarize(const image &im, double factor); + + // amount = [1; 10] + void spread(const image &im, unsigned int amount); + + // degrees = [-720.0; 720.0] + void swirl(const image &im, double degrees, const rgba &background); + + void noise(const image &im, NoiseType noise_type); + + void flatten(const image &im, const rgb &ca, const rgb &cb); + + // azimuth = [0.0; 90.0], elevation = [0.0; 90.0] + void shade(const image &im, bool color, double azimuth, double elevation); + + void equalize(const image &im); + + // radius = [0.01; 90.0], sigma = [0.01; 50.0] + void blur(const image &im, double radius, double sigma); + + void despeckle(const image &im); + + // factor = [0; 100] + void implode(const image &im, double factor, const rgba &background); + + // radius = [0.01; 30.0] + void edge(image &im, double radius); + + // radius = [0.01; 99.9], sigma = [0.01; 99.9] + void emboss(image &im, double radius, double sigma); + + // radius = [0.01; 99.9], sigma = [0.01; 30.0] + void sharpen(image &im, double radius, double sigma); + + // radius = [1.0; 5.0] + void oil(const image &im, double radius); + +/* + * Red-eye removal was taken from "redeye" plugin for GIMP + */ + +/* redeye.c: redeye remover plugin code + * + * Copyright (C) 2004 Robert Merkel (the "Author"). + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + * Except as contained in this notice, the name of the Author of the + * Software shall not be used in advertising or otherwise to promote the + * sale, use or other dealings in this Software without prior written + * authorization from the Author. +1;3B */ + + // red-eye removal. + // th = [0; 255] + void redeye(const image &im, const int w, const int h, + const int x, const int y, + int th); + + // Do we need some color definitions ? + static const rgba white = rgba(255, 255, 255, 255); + static const rgba black = rgba(0, 0, 0, 255); + static const rgba red = rgba(255, 0, 0, 255); + static const rgba green = rgba(0, 255, 0, 255); + static const rgba blue = rgba(0, 0, 255, 255); + static const rgba cyan = rgba(0, 255, 255, 255); + static const rgba magenta = rgba(255, 0, 255, 255); + static const rgba yellow = rgba(255, 255, 0, 255); + static const rgba mediumgray = rgba(128, 128, 128, 255); + static const rgba lightgray = rgba(160, 160, 164, 255); + static const rgba normalgray = rgba(192, 192, 192, 255); + static const rgba darkred = rgba(128, 0, 0, 255); + static const rgba darkgreen = rgba(0, 128, 0, 255); + static const rgba darkblue = rgba(0, 0, 128, 255); + static const rgba darkcyan = rgba(0, 128, 128, 255); + static const rgba darkmagenta = rgba(128, 0, 128, 255); + static const rgba darkyellow = rgba(128, 128, 0, 255); +} + +#endif diff --git a/ksquirrel/hi16-app-ksquirrel.png b/ksquirrel/hi16-app-ksquirrel.png new file mode 100644 index 0000000..a738d8d Binary files /dev/null and b/ksquirrel/hi16-app-ksquirrel.png differ diff --git a/ksquirrel/hi32-app-ksquirrel.png b/ksquirrel/hi32-app-ksquirrel.png new file mode 100644 index 0000000..fbac60a Binary files /dev/null and b/ksquirrel/hi32-app-ksquirrel.png differ diff --git a/ksquirrel/imageedit/Makefile.am b/ksquirrel/imageedit/Makefile.am new file mode 100644 index 0000000..db91cb5 --- /dev/null +++ b/ksquirrel/imageedit/Makefile.am @@ -0,0 +1,15 @@ +####### kdevelop will overwrite this part!!! (begin)########## +noinst_LIBRARIES = libimageedit.a + +## INCLUDES were found outside kdevelop specific part + +libimageedit_a_METASOURCES = AUTO + +libimageedit_a_SOURCES = sq_writeoption.ui sq_label.cpp sq_imagefilter.ui sq_imageeditoptions.ui sq_imageconvert.ui sq_imagebcg.ui sq_converter.cpp sq_bcglabel.cpp + + +EXTRA_DIST = sq_bcglabel.h sq_converter.h sq_imagebcg.ui.h sq_imageconvert.ui.h sq_imageedit.h sq_imageeditoptions.ui.h sq_imagefilter.ui.h sq_label.h sq_bcglabel.cpp sq_converter.cpp sq_imagebcg.ui sq_imageconvert.ui sq_imageeditoptions.ui sq_imagefilter.ui sq_label.cpp sq_writeoption.ui + +####### kdevelop will overwrite this part!!! (end)############ + +INCLUDES = $(all_includes) -I$(srcdir) -I$(top_srcdir)/ksquirrel diff --git a/ksquirrel/imageedit/sq_bcglabel.cpp b/ksquirrel/imageedit/sq_bcglabel.cpp new file mode 100644 index 0000000..d963976 --- /dev/null +++ b/ksquirrel/imageedit/sq_bcglabel.cpp @@ -0,0 +1,28 @@ +/*************************************************************************** + sq_bcglabel.cpp - description + ------------------- + begin : ??? May 4 2005 + copyright : (C) 2005 by Baryshev Dmitry + email : ksquirrel.iv@gmail.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#include "sq_bcglabel.h" + +SQ_BCGLabel::SQ_BCGLabel(QWidget *parent, const char *name, WFlags f) : QLabel(parent, name, f | Qt::WNoAutoErase) +{ + setScaledContents(false); + + setAlignment(Qt::AlignHCenter | Qt::AlignVCenter); +} + +SQ_BCGLabel::~SQ_BCGLabel() +{} diff --git a/ksquirrel/imageedit/sq_bcglabel.h b/ksquirrel/imageedit/sq_bcglabel.h new file mode 100644 index 0000000..dd86bc7 --- /dev/null +++ b/ksquirrel/imageedit/sq_bcglabel.h @@ -0,0 +1,34 @@ +/*************************************************************************** + sq_bcglabel.h - description + ------------------- + begin : ??? May 4 2005 + copyright : (C) 2005 by Baryshev Dmitry + email : ksquirrel.iv@gmail.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifndef SQ_BCGLABEL_H +#define SQ_BCGLABEL_H + +#include + +/** + *@author Baryshev Dmitry + */ + +class SQ_BCGLabel : public QLabel +{ + public: + SQ_BCGLabel(QWidget *parent, const char *name = 0, WFlags f = 0); + ~SQ_BCGLabel(); +}; + +#endif diff --git a/ksquirrel/imageedit/sq_converter.cpp b/ksquirrel/imageedit/sq_converter.cpp new file mode 100644 index 0000000..7132332 --- /dev/null +++ b/ksquirrel/imageedit/sq_converter.cpp @@ -0,0 +1,444 @@ +/*************************************************************************** + sq_converter.cpp - description + ------------------- + begin : ??? Mar 3 2005 + copyright : (C) 2005 by Baryshev Dmitry + email : ksquirrel.iv@gmail.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include +#include +#include + +#include +#include + +#include +#include +#include +#include +#include + +#include "ksquirrel.h" +#include "sq_converter.h" +#include "sq_widgetstack.h" +#include "sq_diroperator.h" +#include "sq_libraryhandler.h" +#include "sq_config.h" +#include "sq_errorstring.h" +#include "sq_imageloader.h" +#include "sq_imageconvert.h" + +SQ_Converter * SQ_Converter::m_sing = 0; + +SQ_Converter::SQ_Converter(QObject *parent) : QObject(parent) +{ + m_sing = this; + + err_internal = i18n("internal error") + '\n'; + err_failed = i18n("failed") + '\n'; + + special_action = i18n("Converting"); + + image = 0; +} + +SQ_Converter::~SQ_Converter() +{ + if(image) free(image); +} + +void SQ_Converter::slotStartEdit() +{ + files.clear(); + + KFileItemList *items = (KFileItemList *)SQ_WidgetStack::instance()->selectedItems(); + + if(!items || !items->count()) + { + KMessageBox::information(KSquirrel::app(), i18n("Select files to edit")); + return; + } + else if(!items->first()->url().isLocalFile()) + { + KMessageBox::information(KSquirrel::app(), i18n("Converter cannot work with remote files.\nSorry")); + return; + } + + KFileItem *i = items->first(); + + for(;i;i = items->next()) + { + if(i->isFile()) + files.append(i->url().path()); + } + + startEditPrivate(); +} + +QString SQ_Converter::adjustFileName(const QString &globalprefix, const QString &name1, int replace, QString putto, bool paged, int page) +{ + QFileInfo ff(name1); + QString name = ff.dirPath() + '/' + (replace == 0 ? globalprefix : (replace == 2 ? QString::null : globalprefix)) + ff.fileName(); + ff = QFileInfo(name); + + QString result, inner, filter = lw->filter; + QString ext = ff.extension(false); + QString prefix, suffix, name2 = name; + QString spage = QString::fromLatin1("page_%1.").arg((QString::fromLatin1("%1").arg(page)).rightJustify(3, '0')); + + if(!putto.isEmpty()) + { + if(QFile::exists(putto)) + name2 = putto + '/' + ff.fileName(); + } + + prefix = name2; + + prefix.truncate(name2.length() - ext.length()); + + suffix = (SQ_LibraryHandler::instance()->knownExtension(QString::fromLatin1("*.") + ext)) + ? QString(lw->codec->extension(32)) : ext; + + if(replace == 0 || replace == 2) + result = (!paged) ? (prefix + inner + suffix) : (prefix + spage + inner + suffix); + else + { + result = (!paged) ? (prefix + inner + suffix) : (prefix + spage + inner + suffix); + + if(QFile::exists(result)) + { + inner = QString::fromLatin1("1."); + result = (!paged) ? (prefix + inner + suffix) : (prefix + spage + inner + suffix); + } + } + + return result; +} + +void SQ_Converter::errorjmp(jmp_buf jmp, const int code) +{ + error_code = code; + longjmp(jmp, 1); +} + +void SQ_Converter::decodingCycle() +{ + int i, j; + QString name; + jmp_buf jmp; + RGBA *scan; + int errors, gerrors = 0, current; + QString putto; + int replace = imageopt.where_to_put; + bool brk; + + SQ_Config::instance()->setGroup("Edit tools"); + + int allpages = SQ_Config::instance()->readNumEntry("load_pages", 0); + int pages_num = SQ_Config::instance()->readNumEntry("load_pages_number", 1); + + if(pages_num < 1) pages_num = 1; + + altw = SQ_LibraryHandler::instance()->libraryByName(SQ_Config::instance()->readEntry("altlibrary", "Portable Network Graphics")); + multi = SQ_Config::instance()->readBoolEntry("multi", true); + + tempfile = new KTempFile; + tempfile->setAutoDelete(true); + + if(tempfile->status()) + { + KMessageBox::error(KSquirrel::app(), i18n("Temporary file creation failed")); + return; + } + + tempfile->close(); + + QStringList::iterator last_it = files.fromLast(); + QStringList::iterator itEnd = files.end(); + convert->startConvertion(files.count()); + + putto = imageopt.putto; + + for(QStringList::iterator it = files.begin();it != itEnd;++it) + { + currentFile = *it; + last = (it == last_it); + + QFileInfo ff(*it); + + emit convertText(special_action + ' ' + KStringHandler::rsqueeze(ff.fileName()) + "... ", false); + + if((lr = SQ_LibraryHandler::instance()->libraryForFile(*it))) + { + lw = SQ_LibraryHandler::instance()->libraryByName(convopt.libname); + + if(!lr || !lw) + { + gerrors++; + emit convertText(err_internal, true); + emit oneFileProcessed(); + continue; + } + + name = QFile::encodeName(*it); + + i = lr->codec->read_init(name.ascii()); + + if(setjmp(jmp)) + { + gerrors++; + + lr->codec->read_close(); + + emit convertText(SQ_ErrorString::instance()->stringSN(error_code), true); + emit oneFileProcessed(); + + continue; + } + + if(i != SQE_OK) + errorjmp(jmp, i); + + errors = 0; + current = 0; + + while(true) + { + brk = (allpages == 1 && current) || (allpages == 2 && current == pages_num); + + i = lr->codec->read_next(); + + im = lr->codec->image(current-1); + + if(i != SQE_OK || brk) + { + if(i == SQE_NOTOK || brk) + { + if(current == 1) + name = adjustFileName(prefix, *it, replace, putto); + else + name = adjustFileName(prefix, *it, replace, putto, true, current); + + lastFrame = last; + + i = manipAndWriteDecodedImage(tempfile->name(), im); + + emit convertText(errors ? (i18n("1 error", "%n errors", errors)+'\n') : SQ_ErrorString::instance()->stringSN(SQE_OK), true); + emit oneFileProcessed(); + + i = SQE_OK; + + if(replace == 2) + { + emit convertText(i18n("Removing") + KStringHandler::rsqueeze(ff.fileName()) + QString("... "), false); + + bool b = QFile::remove(*it); + + emit convertText(b ? SQ_ErrorString::instance()->stringSN(SQE_OK) : err_failed, true); + emit oneFileProcessed(); + } + + i = copyFile(tempfile->name(), name); + + break; + } + else + errorjmp(jmp, i); + } + + if(current) + { + name = adjustFileName(prefix, *it, replace, putto, true, current); + + lastFrame = false; + + manipAndWriteDecodedImage(tempfile->name(), im); + i = copyFile(tempfile->name(), name); + } + + im = lr->codec->image(current); + + image = (RGBA *)realloc(image, im->w * im->h * sizeof(RGBA)); + + if(!image) + { + i = SQE_R_NOMEMORY; + errorjmp(jmp, i); + } + + for(int pass = 0;pass < im->passes;pass++) + { + lr->codec->read_next_pass(); + + for(j = 0;j < im->h;j++) + { + scan = image + j * im->w; + i = lr->codec->read_scanline(scan); + errors += (int)(i != SQE_OK); + } + } + + if(im->needflip) + fmt_utils::flipv((char *)image, im->w * sizeof(RGBA), im->h); + + convert->fillWriteOptions(&opt, lw->opt); + + opt.alpha = im->hasalpha; + + current++; + } + + lr->codec->read_close(); + } + else + { + emit convertText(SQ_ErrorString::instance()->stringSN(SQE_R_NOTSUPPORTED), true); + emit oneFileProcessed(); + } + } + + if(image) + { + free(image); + image = 0; + } + + delete convert; + delete tempfile; + + if(imageopt.close && !gerrors) + emit done(true); + else + emit done(false); +} + +int SQ_Converter::manipAndWriteDecodedImage(const QString &name, fmt_image *im) +{ + int passes = opt.interlaced ? lw->opt.passes : 1; + int s, j, err; + RGBA *scan = 0; + + scan = new RGBA [im->w]; + + if(!scan) + return SQE_W_NOMEMORY; + + err = lw->codec->write_init(name, *im, opt); + + if(err != SQE_OK) + goto error_exit; + + err = lw->codec->write_next(); + + if(err != SQE_OK) + goto error_exit; + + for(s = 0;s < passes;s++) + { + err = lw->codec->write_next_pass(); + + if(err != SQE_OK) + goto error_exit; + + for(j = 0;j < im->h;j++) + { + if(lw->opt.needflip) + determineNextScan(*im, scan, im->h-j-1); + else + determineNextScan(*im, scan, j); + + err = lw->codec->write_scanline(scan); + + if(err != SQE_OK) + goto error_exit; + } + } + + err = SQE_OK; + + error_exit: + + lw->codec->write_close(); + + delete scan; + + return err; +} + +int SQ_Converter::copyFile(const QString &src, const QString &dst) const +{ + QFile f_src(src), f_dst(dst); + Q_LONG read; + char data[4096]; + + if(!f_src.open(IO_ReadOnly)) + return SQE_R_NOFILE; + + if(!f_dst.open(IO_WriteOnly)) + { + f_src.close(); + return SQE_W_NOFILE; + } + + while(!f_src.atEnd()) + { + read = f_src.readBlock(data, sizeof(data)); + + f_dst.writeBlock(data, read); + + if(f_dst.status() != IO_Ok || f_src.status() != IO_Ok) + { + f_src.close(); + f_dst.close(); + + return SQE_W_ERROR; + } + } + + f_src.close(); + f_dst.close(); + + return SQE_OK; +} + +void SQ_Converter::determineNextScan(const fmt_image &im, RGBA *scan, int y) +{ + memcpy(scan, image + y * im.w, im.w * sizeof(RGBA)); +} + +void SQ_Converter::startEditPrivate() +{ + convert = new SQ_ImageConvert(KSquirrel::app()); + convert->setCaption(i18n("Convert 1 file", "Convert %n files", files.count())); + + connect(convert, SIGNAL(convert(SQ_ImageOptions*, SQ_ImageConvertOptions*)), this, SLOT(slotStartConvert(SQ_ImageOptions*, SQ_ImageConvertOptions*))); + connect(this, SIGNAL(convertText(const QString &, bool)), convert, SLOT(slotDebugText(const QString &, bool))); + connect(this, SIGNAL(oneFileProcessed()), convert, SLOT(slotOneProcessed())); + connect(this, SIGNAL(done(bool)), convert, SLOT(slotDone(bool))); + + convert->exec(); +} + +void SQ_Converter::slotStartConvert(SQ_ImageOptions *o, SQ_ImageConvertOptions *copt) +{ + imageopt = *o; + convopt = *copt; + + decodingCycle(); +} + +#include "sq_converter.moc" diff --git a/ksquirrel/imageedit/sq_converter.h b/ksquirrel/imageedit/sq_converter.h new file mode 100644 index 0000000..4781619 --- /dev/null +++ b/ksquirrel/imageedit/sq_converter.h @@ -0,0 +1,119 @@ +/*************************************************************************** + sq_converter.h - description + ------------------- + begin : ??? Mar 3 2005 + copyright : (C) 2005 by Baryshev Dmitry + email : ksquirrel.iv@gmail.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifndef SQ_CONVERTER_H +#define SQ_CONVERTER_H + +#include +#include + +#include +#include + +#include +#include +#include + +#include "sq_imageedit.h" + +struct SQ_LIBRARY; + +class KTempFile; + +class SQ_ImageConvert; +class SQ_ImageConvertOptions; + +/* + * Base class for all edit tools. It contains all methods needed by + * converter, resizer, printer etc. It decodes an image, writes it back to + * disk. All specific actions (like colorizing, resizing etc.) are done by + * appropriate edit tool. + */ + +class SQ_Converter : public QObject +{ + Q_OBJECT + + public: + SQ_Converter(QObject *parent); + ~SQ_Converter(); + + public: + static SQ_Converter* instance() { return m_sing; } + + private: + /* + * Create edit tool-specific dialog, and wait for user + * input + */ + void startEditPrivate(); + + /* + * Do something with decoded image(manipDecodedImage()) and write it + * on disk. + */ + int manipAndWriteDecodedImage(const QString &name, fmt_image *im); + + /* + * Main decoding loop. + */ + void decodingCycle(); + + /* + * Determine file name. In this file SQ_Converter will save new image. + */ + QString adjustFileName(const QString &globalprefix, const QString &name, int replace, + QString putto, bool paged = false, int page = 0); + + void determineNextScan(const fmt_image &im, RGBA *scan, int y); + + /* + * Copy file :-) + */ + int copyFile(const QString &src, const QString &dst) const; + + void errorjmp(jmp_buf jmp, const int code); + + signals: + void convertText(const QString &, bool); + void oneFileProcessed(); + void done(bool allok); + + private slots: + void slotStartEdit(); + void slotStartConvert(SQ_ImageOptions*, SQ_ImageConvertOptions*); + + protected: + QStringList files; + QString err_internal, err_failed; + QString currentFile; + int error_code, current_page; + SQ_ImageOptions imageopt; + fmt_writeoptions opt; + SQ_LIBRARY *lr, *lw, *altw; + RGBA *image; + QString special_action, prefix; + bool multi, last, lastFrame; + KTempFile *tempfile; + fmt_image *im; + static SQ_Converter *m_sing; + + SQ_ImageConvert *convert; + SQ_ImageConvertOptions convopt; +}; + +#endif diff --git a/ksquirrel/imageedit/sq_imagebcg.ui b/ksquirrel/imageedit/sq_imagebcg.ui new file mode 100644 index 0000000..f2959b4 --- /dev/null +++ b/ksquirrel/imageedit/sq_imagebcg.ui @@ -0,0 +1,997 @@ + +SQ_ImageBCG + + + SQ_ImageBCG + + + + 0 + 0 + 564 + 391 + + + + Color balance + + + true + + + + unnamed + + + + widgetStackParams + + + GroupBoxPanel + + + + WStackPage + + + 0 + + + + unnamed + + + 4 + + + + spinB + + + 255 + + + -255 + + + + + pushResetG + + + + + + false + + + true + + + + + pushResetC + + + + + + false + + + true + + + + + spinG + + + + + spinC + + + 255 + + + -255 + + + + + pushResetB + + + + + + false + + + true + + + + + layout6 + + + + unnamed + + + + sQ_LabelB + + + + + sliderB + + + -255 + + + 255 + + + Vertical + + + Above + + + 25 + + + Brightness + + + + + + + layout5 + + + + unnamed + + + + sQ_LabelC + + + + + sliderC + + + -255 + + + 255 + + + Vertical + + + Above + + + 25 + + + Contrast + + + + + + + layout4 + + + + unnamed + + + + sQ_LabelG + + + + + sliderG + + + 0 + + + 600 + + + 100 + + + Vertical + + + Above + + + 22 + + + Gamma + + + + + + + + + WStackPage + + + 1 + + + + unnamed + + + 4 + + + + pushResetRed + + + + + + false + + + true + + + + + spinRed + + + 255 + + + -255 + + + + + spinGreen + + + 255 + + + -255 + + + + + pushResetGreen + + + + + + false + + + true + + + + + pushResetBlue + + + + + + false + + + true + + + + + spinBlue + + + 255 + + + -255 + + + + + layout1 + + + + unnamed + + + + sQ_LabelBlue + + + + + sliderBlue + + + -255 + + + 255 + + + Above + + + 25 + + + Blue + + + + + + + layout2 + + + + unnamed + + + + sQ_LabelGreen + + + + + sliderGreen + + + -255 + + + 255 + + + Above + + + 25 + + + Green + + + + + + + layout3 + + + + unnamed + + + + sQ_LabelRed + + + + + sliderRed + + + -255 + + + 255 + + + Above + + + 25 + + + Red + + + + + + + + + + groupBox3 + + + + 7 + 5 + 0 + 0 + + + + + + + + unnamed + + + 6 + + + 0 + + + + push2 + + + + + + false + + + true + + + + + push1 + + + + + + false + + + true + + + + + spacer26 + + + Horizontal + + + Expanding + + + + 1 + 16 + + + + + + spacer27 + + + Horizontal + + + Expanding + + + + 1 + 16 + + + + + + text + + + WordBreak|AlignCenter + + + + + + + spacer12_2 + + + Vertical + + + MinimumExpanding + + + + 16 + 16 + + + + + + layout8 + + + + unnamed + + + + spacer3 + + + Horizontal + + + Expanding + + + + 249 + 21 + + + + + + pushGO + + + Colorize + + + true + + + + + pushCancel + + + Close + + + false + + + + + + + line2 + + + HLine + + + Sunken + + + Horizontal + + + + + spacer11 + + + Vertical + + + MinimumExpanding + + + + 16 + 20 + + + + + + layout15 + + + + unnamed + + + + spacer13 + + + Horizontal + + + Expanding + + + + 1 + 16 + + + + + + textLabel3 + + + Original image: + + + + + spacer35 + + + Horizontal + + + Expanding + + + + 1 + 16 + + + + + + pixmap1 + + + + 0 + 0 + 0 + 0 + + + + + 160 + 160 + + + + + + textLabel4 + + + Image after colorizing: + + + + + spacer34 + + + Horizontal + + + Expanding + + + + 1 + 16 + + + + + + pixmap + + + + 0 + 0 + 0 + 0 + + + + + 160 + 160 + + + + + + + + + + SQ_BCGLabel +
sq_bcglabel.h
+ + -1 + -1 + + 0 + + 5 + 5 + 0 + 0 + + image0 +
+ + SQ_Label +
sq_label.h
+ + -1 + -1 + + 0 + + 5 + 5 + 0 + 0 + + image0 +
+
+ + + 89504e470d0a1a0a0000000d4948445200000016000000160806000000c4b46c3b000003b149444154388dad945f4c5b551cc73fe7dc4b7b4bcba0762d45c43114323599ee6192609c51d883892ce083f1718b3ebb185f8dc91e972cf39d2d2a2f1af664b6f1e0fe3863a0718969700eb0c52142da0242a1bd6d696f7bcff101585203ceb8fd9ece39f99dcff9fe7edf939f88c562ec465f5f9fe609442c161362173c3e3eae7b7a7ac8e7f36432196cdbfe4f907c3e4f2291201e8fe338cec3737357e9e8e828aded1e229d650e1f2d51754b082110124c13a4dc5ea341eb9dc284c0558a853f3ce8cb0677ef500fde7d39d2596679e326597b8e9abb85d7a770ab16ab6983ec5a05b487a70e36f0f4e10afe408d6a558310980108478dba4a1e8233990c5d474b64ed39aa3a8fe5f3317fbf81dbd70bccfeb205947632fd74f6589c1c6ea2f70d03a58ba0c1f2c9bdc1b66de3b8256a6e11cbe7e3ee1d181b590124fe2693aeee08d223c82c3a2c24b7b874bec8f26288774f7bd054504aef0dde6e99c0eb83f9fb266323cb80a27fb0958141836044605a2ee5523393371cc646fee2da37195aa35d0c0c5b4859ac03d7e91712dcaac5adab3650a3ff9d08ef7dd8404bb48869e5d958b5b87dadc4c9a1464e9f0d0326df7ebd86bd2e310cb1bf62d384d59441f2d70a070e1c60e09489929b988681bdd9cc97170bcc4c65595f71f8e0e3301337fc24a7732467831875a47f289652b0be5e4151e6d07316c1b0c0340d8ab92023e76d66a6b2840e36d2fb7a13fee632475e6edc367ea98a90fb98b7dd6310ca0328a44761582e1bab41befabcc0ec940d28bc5e93b68e064cab84e1d9beaeb48934eac1f53b01c1b000fca496aa54b61a99fcde61662a4b4b4b23d1680be9d426173e4df3602a48ea411989a4fd590f52a8fd156b05ed9d350e3defe3cfdf4b4c7ce770ea7d3fb9f520afbe1620daeee5c26735d20b9b9cfb6811a754a439e4e5c5639a4caa1e5caf586bfc0197b78702005cb9b4cae4cd3267ce8638fe964bd72b393e39d74928d242617303a756a37f284447770dcdbffc6384a05a85de1306e9a52057c7527c7131c3c42d3f475eb2303c82d4fc3276d6811db37efeb148723082d9b08f79f97c1e5729109a9a28307cc622d2d6cdf52b2b24efe548dedb00142009862cfa879ee1a71f6cec928353511472fbf4389148b0b0e0c108081412458dfe21c9f11351e67e7358595468246d1d1e5e38a6e9e851bc39d84ab502a669331dafec0d8ec7e3e8cb06e1a881d727d1ae40180a434a8c9db129a54126ad48a7358c2b4c5352c8c374bcccdab2bb37d8719cba79fab8211f9df218e0582c261e95f8bfc04f1a1e8bc5c4dfe0a190172af6a9690000000049454e44ae426082 + + + + + spinRed + valueChanged(int) + SQ_ImageBCG + slotRedChanged(int) + + + spinGreen + valueChanged(int) + SQ_ImageBCG + slotGreenChanged(int) + + + spinG + valueChanged(double) + SQ_ImageBCG + slotGSpinChanged(double) + + + spinC + valueChanged(int) + SQ_ImageBCG + slotCChanged(int) + + + spinBlue + valueChanged(int) + SQ_ImageBCG + slotBlueChanged(int) + + + spinB + valueChanged(int) + SQ_ImageBCG + slotBChanged(int) + + + sliderRed + valueChanged(int) + SQ_ImageBCG + slotRedChanged(int) + + + sliderGreen + valueChanged(int) + SQ_ImageBCG + slotGreenChanged(int) + + + sliderG + valueChanged(int) + SQ_ImageBCG + slotGChanged(int) + + + sliderC + valueChanged(int) + SQ_ImageBCG + slotCChanged(int) + + + sliderBlue + valueChanged(int) + SQ_ImageBCG + slotBlueChanged(int) + + + sliderB + valueChanged(int) + SQ_ImageBCG + slotBChanged(int) + + + pushResetRed + clicked() + SQ_ImageBCG + slotResetRed() + + + pushResetGreen + clicked() + SQ_ImageBCG + slotResetGreen() + + + pushResetG + clicked() + SQ_ImageBCG + slotResetG() + + + pushResetC + clicked() + SQ_ImageBCG + slotResetC() + + + pushResetBlue + clicked() + SQ_ImageBCG + slotResetBlue() + + + pushResetB + clicked() + SQ_ImageBCG + slotResetB() + + + pushGO + clicked() + SQ_ImageBCG + slotStartBCG() + + + push2 + clicked() + SQ_ImageBCG + slotPush() + + + push1 + clicked() + SQ_ImageBCG + slotPush() + + + pushCancel + clicked() + SQ_ImageBCG + reject() + + + + push1 + push2 + pushResetRed + pushResetGreen + pushResetBlue + sliderRed + sliderGreen + sliderBlue + spinRed + spinGreen + spinBlue + pushGO + pushCancel + pushResetB + pushResetC + pushResetG + sliderB + sliderC + sliderG + spinB + spinC + spinG + + + sq_imageedit.h + qimage.h + qstringlist.h + sq_iconloader.h + kstandarddirs.h + sq_config.h + fmt_filters.h + ksquirrel-libs/fmt_types.h + ksquirrel-libs/fmt_defs.h + sq_imagebcg.ui.h + + + int id; + QImage sample, sample_saved; + QStringList strings; + static SQ_ImageBCG *m_inst; + + + bcg(SQ_ImageBCGOptions*) + + + slotResetG() + slotResetC() + slotResetB() + slotResetRed() + slotResetGreen() + slotResetBlue() + slotStartBCG() + slotBChanged( int v ) + slotCChanged( int v ) + slotRedChanged( int v ) + slotGreenChanged( int v ) + slotBlueChanged( int v ) + slotGChanged( int v ) + slotGSpinChanged( double v ) + slotPush() + + + init() + RGB2Y( int r, int g, int b ) + assignNewImage( const QImage & im ) + changeImage( int b, int c, int g1, int red, int green, int blue ) + setPreviewImage( const QImage & im ) + instance() + + + + knuminput.h + sq_label.h + sq_label.h + sq_label.h + sq_label.h + sq_label.h + sq_label.h + sq_bcglabel.h + sq_bcglabel.h + +
diff --git a/ksquirrel/imageedit/sq_imagebcg.ui.h b/ksquirrel/imageedit/sq_imagebcg.ui.h new file mode 100644 index 0000000..7d80c6f --- /dev/null +++ b/ksquirrel/imageedit/sq_imagebcg.ui.h @@ -0,0 +1,241 @@ +/**************************************************************************** +** ui.h extension file, included from the uic-generated form implementation. +** +** If you wish to add, delete or rename functions or slots use +** Qt Designer which will update this file, preserving your code. Create an +** init() function in place of a constructor, and a destroy() function in +** place of a destructor. +*****************************************************************************/ + +SQ_ImageBCG * SQ_ImageBCG::m_inst = 0; + +void SQ_ImageBCG::init() +{ + m_inst = this; + + QPixmap p = QPixmap::fromMimeSource(locate("data", "images/imageedit/reset_value.png")); + + sQ_LabelB->setSingle(true); + sQ_LabelC->setSingle(true); + sQ_LabelG->setSingle(true); + sQ_LabelB->setText(tr2i18n("Brightness")); + sQ_LabelC->setText(tr2i18n("Contrast")); + sQ_LabelG->setText(tr2i18n("Gamma")); + sQ_LabelRed->setText(tr2i18n("Red"), tr2i18n("Cyan")); + sQ_LabelGreen->setText(tr2i18n("Green"), tr2i18n("Magenta")); + sQ_LabelBlue->setText(tr2i18n("Blue"), tr2i18n("Yellow")); + + pushResetB->setPixmap(p); + pushResetC->setPixmap(p); + pushResetG->setPixmap(p); + pushResetRed->setPixmap(p); + pushResetGreen->setPixmap(p); + pushResetBlue->setPixmap(p); + + strings.append(QString("") + tr2i18n("Brightness") + ", " + tr2i18n("Contrast") + ", " + tr2i18n("Gamma") + ""); + strings.append(QString("") + tr2i18n("Red") + ", " + tr2i18n("Green") + ", " + tr2i18n("Blue") + ""); + + id = 0; + widgetStackParams->raiseWidget(id); + text->setText(strings[id]); + + QPixmap tool1 = QPixmap::fromMimeSource(locate("data", "images/imageedit/resize_toolbutton.png")); + QPixmap tool2 = QPixmap::fromMimeSource(locate("data", "images/imageedit/resize_toolbutton2.png")); + push1->setPixmap(tool1); + push2->setPixmap(tool2); + + spinG->setRange(0, 6.0, 0.01, 2); + spinG->setValue(1.0); + connect(spinG, SIGNAL(valueChanged(int)), spinG, SLOT(slotValueChanged(int))); +} + +void SQ_ImageBCG::slotResetG() +{ + sliderG->setValue(100); +} + +void SQ_ImageBCG::slotResetC() +{ + sliderC->setValue(0); +} + +void SQ_ImageBCG::slotResetB() +{ + sliderB->setValue(0); +} + +void SQ_ImageBCG::slotResetRed() +{ + sliderRed->setValue(0); +} + +void SQ_ImageBCG::slotResetGreen() +{ + sliderGreen->setValue(0); +} + +void SQ_ImageBCG::slotResetBlue() +{ + sliderBlue->setValue(0); +} + +void SQ_ImageBCG::slotStartBCG() +{ + SQ_ImageBCGOptions opt; + opt.b = sliderB->value(); + opt.c = sliderC->value(); + opt.g = sliderG->value(); + opt.red = sliderRed->value(); + opt.green = sliderGreen->value(); + opt.blue = sliderBlue->value(); + + emit bcg(&opt); +} + +int SQ_ImageBCG::RGB2Y(int r, int g, int b) +{ + return (int)((double)r * 0.299 + (double)g * 0.587 + (double)b * 0.114); +} + +void SQ_ImageBCG::slotBChanged(int v) +{ + spinB->blockSignals(true); + sliderB->blockSignals(true); + spinB->setValue(v); + sliderB->setValue(v); + spinB->blockSignals(false); + sliderB->blockSignals(false); + + changeImage(v, sliderC->value(), sliderG->value(), sliderRed->value(), sliderGreen->value(), sliderBlue->value()); +} + +void SQ_ImageBCG::slotCChanged(int v) +{ + spinC->blockSignals(true); + sliderC->blockSignals(true); + spinC->setValue(v); + sliderC->setValue(v); + spinC->blockSignals(false); + sliderC->blockSignals(false); + + changeImage(sliderB->value(), v, sliderG->value(), sliderRed->value(), sliderGreen->value(), sliderBlue->value()); +} + +void SQ_ImageBCG::slotRedChanged(int v) +{ + spinRed->blockSignals(true); + sliderRed->blockSignals(true); + spinRed->setValue(v); + sliderRed->setValue(v); + spinRed->blockSignals(false); + sliderRed->blockSignals(false); + + changeImage(sliderB->value(), sliderC->value(), sliderG->value(), v, sliderGreen->value(), sliderBlue->value()); +} + +void SQ_ImageBCG::slotGreenChanged(int v) +{ + spinGreen->blockSignals(true); + sliderGreen->blockSignals(true); + spinGreen->setValue(v); + sliderGreen->setValue(v); + spinGreen->blockSignals(false); + sliderGreen->blockSignals(false); + + changeImage(sliderB->value(), sliderC->value(), sliderG->value(), sliderRed->value(), v, sliderBlue->value()); +} + +void SQ_ImageBCG::slotBlueChanged(int v) +{ + spinBlue->blockSignals(true); + sliderBlue->blockSignals(true); + spinBlue->setValue(v); + sliderBlue->setValue(v); + spinBlue->blockSignals(false); + sliderBlue->blockSignals(false); + + changeImage(sliderB->value(), sliderC->value(), sliderG->value(), sliderRed->value(), sliderGreen->value(), v); +} + +void SQ_ImageBCG::slotGChanged(int v) +{ + double g = (double)v / 100.0; + spinG->blockSignals(true); + spinG->setValue(g); + spinG->blockSignals(false); + + changeImage(sliderB->value(), sliderC->value(), v, sliderRed->value(), sliderGreen->value(), sliderBlue->value()); +} + +void SQ_ImageBCG::slotGSpinChanged(double v) +{ + int val = (int)(v * 100.0); + sliderG->blockSignals(true); + sliderG->setValue(val); + sliderG->blockSignals(false); + + changeImage(sliderB->value(), sliderC->value(), val, sliderRed->value(), sliderGreen->value(), sliderBlue->value()); +} + +void SQ_ImageBCG::assignNewImage(const QImage &im) +{ + QPixmap p; + p.convertFromImage(im); + pixmap1->setPixmap(p); +} + +void SQ_ImageBCG::changeImage(int b, int c, int g1, int red, int green, int blue) +{ + if(sample.isNull() || sample_saved.isNull()) + return; + + double g = (double)g1 / 100.0; + + sample = sample_saved.copy(); + + // change brightness + fmt_filters::brightness(fmt_filters::image(sample.bits(), sample.width(), sample.height()), b); + + //change contrast + if(c) + fmt_filters::contrast(fmt_filters::image(sample.bits(), sample.width(), sample.height()), c); + + // change gamma + if(g1 != 100) + fmt_filters::gamma(fmt_filters::image(sample.bits(), sample.width(), sample.height()), g); + + if(red || green || blue) + fmt_filters::colorize(fmt_filters::image(sample.bits(), sample.width(), sample.height()), blue, green, red); + + assignNewImage(sample); +} + +void SQ_ImageBCG::slotPush() +{ + if(!id) id = 1; + else id = 0; + + widgetStackParams->raiseWidget(id); + text->setText(strings[id]); +} + +void SQ_ImageBCG::setPreviewImage(const QImage &im) +{ + if(im.isNull()) return; + + sample = im.copy(); + sample_saved = sample.copy(); + + QPixmap p; + + p.convertFromImage(sample_saved); + pixmap->setPixmap(p); + pixmap1->setPixmap(p); + + changeImage(sliderB->value(), sliderC->value(), sliderG->value(), sliderRed->value(), sliderGreen->value(), sliderBlue->value()); +} + +SQ_ImageBCG* SQ_ImageBCG::instance() +{ + return m_inst; +} diff --git a/ksquirrel/imageedit/sq_imageconvert.ui b/ksquirrel/imageedit/sq_imageconvert.ui new file mode 100644 index 0000000..732b953 --- /dev/null +++ b/ksquirrel/imageedit/sq_imageconvert.ui @@ -0,0 +1,345 @@ + +SQ_ImageConvert + + + SQ_ImageConvert + + + + 0 + 0 + 436 + 324 + + + + SQ_ImageConvert + + + true + + + + unnamed + + + + layout1 + + + + unnamed + + + + spacer1 + + + Horizontal + + + Expanding + + + + 237 + 20 + + + + + + pushConvert + + + Convert + + + true + + + + + pushCancel + + + Close + + + false + + + + + + + line8 + + + HLine + + + Sunken + + + Horizontal + + + + + widgetStack + + + + WStackPage + + + 0 + + + + unnamed + + + 0 + + + + groupBoxActions + + + + 0 + 5 + 0 + 0 + + + + NoFrame + + + + + + + unnamed + + + 0 + + + + pushOptions + + + + + + true + + + + + spacer15 + + + Vertical + + + Expanding + + + + 26 + 155 + + + + + + pushWriteOptions + + + + + + true + + + true + + + Conversion options + + + + + + + + col1 + + + true + + + true + + + + + col2 + + + true + + + true + + + + tableLib + + + true + + + LastColumn + + + + + + + WStackPage + + + 1 + + + + unnamed + + + 0 + + + + textResult + + + NoWrap + + + true + + + false + + + + + progress + + + + + + + + + + + + pushCancel + clicked() + SQ_ImageConvert + slotReject() + + + pushOptions + clicked() + SQ_ImageConvert + slotOptions() + + + pushWriteOptions + toggled(bool) + SQ_ImageConvert + slotShowExtWrapper(bool) + + + pushConvert + clicked() + SQ_ImageConvert + slotStartConvert() + + + tableLib + currentChanged(QListViewItem*) + SQ_ImageConvert + slotCurrentLibraryChanged(QListViewItem*) + + + + tableLib + pushOptions + pushWriteOptions + pushConvert + pushCancel + textResult + + + ksquirrel-libs/fmt_types.h + ksquirrel-libs/fmt_defs.h + sq_imageedit.h + sq_libraryhandler.h + qfileinfo.h + qheader.h + sq_writeoption.h + sq_iconloader.h + qapplication.h + qcheckbox.h + sq_imageeditoptions.h + sq_config.h + kstandarddirs.h + sq_errorstring.h + knuminput.h + sq_imageconvert.ui.h + + + struct fmt_writeoptions; + struct fmt_writeoptionsabs; + + + SQ_ImageOptions imageopt; + int paragraph; + bool done; + + + convert(SQ_ImageOptions*, SQ_ImageConvertOptions*) + + + slotShowExtWrapper( bool show ) + createExtension() + slotDebugText( const QString & text, bool bold ) + slotStartConvert() + slotOneProcessed() + slotCurrentLibraryChanged( QListViewItem * i ) + slotOptions() + slotDone( bool close ) + slotReject() + + + init() + initLibs() + startConvertion( int count ) + fillWriteOptions( fmt_writeoptions * opt, const fmt_writeoptionsabs & opt2 ) + closeEvent( QCloseEvent * e ) + + + + kprogress.h + + diff --git a/ksquirrel/imageedit/sq_imageconvert.ui.h b/ksquirrel/imageedit/sq_imageconvert.ui.h new file mode 100644 index 0000000..7acaa20 --- /dev/null +++ b/ksquirrel/imageedit/sq_imageconvert.ui.h @@ -0,0 +1,214 @@ +/**************************************************************************** +** ui.h extension file, included from the uic-generated form implementation. +** +** If you wish to add, delete or rename functions or slots use +** Qt Designer which will update this file, preserving your code. Create an +** init() function in place of a constructor, and a destroy() function in +** place of a destructor. +*****************************************************************************/ + +void SQ_ImageConvert::init() +{ + tableLib->header()->hide(); + + createExtension(); + + initLibs(); + + pushWriteOptions->setPixmap(QPixmap(locate("data", "images/imageedit/resize_toolbutton2.png"))); + pushOptions->setPixmap(SQ_IconLoader::instance()->loadIcon("configure", KIcon::Desktop, KIcon::SizeSmall)); + + SQ_Config::instance()->setGroup("Image edit options"); + + imageopt.putto = SQ_Config::instance()->readEntry("convert_putto", QString::null); + imageopt.where_to_put = SQ_Config::instance()->readNumEntry("convert_where_to_put", 0); + imageopt.close = SQ_Config::instance()->readBoolEntry("convert_close", true); + + done = true; +} + +void SQ_ImageConvert::initLibs() +{ + QListViewItem *first; + + QValueVector::iterator itEnd = SQ_LibraryHandler::instance()->end(); + + for(QValueVector::iterator it = SQ_LibraryHandler::instance()->begin(); + it != itEnd;++it) + { + if((*it).writestatic) + { + QFileInfo libfileinfo((*it).libpath); + QListViewItem *item = new QListViewItem(tableLib, QString::null, QString((*it).quickinfo)); + + item->setPixmap(0, (*it).mime); + + tableLib->insertItem(item); + } + } + + first = tableLib->firstChild(); + + if(first) + { + tableLib->setSelected(first, true); + slotCurrentLibraryChanged(first); + } +} + +void SQ_ImageConvert::slotShowExtWrapper(bool show) +{ + showExtension(show); +} + +void SQ_ImageConvert::createExtension() +{ + SQ_WriteOption *c = new SQ_WriteOption(this); + c->slider->setRange(0, 255, 1, true); + setExtension(c); + setOrientation(Qt::Horizontal); +} + +void SQ_ImageConvert::slotDebugText(const QString &text, bool bold) +{ + textResult->setBold(bold); + textResult->insertAt(text, paragraph, textResult->paragraphLength(paragraph)); + textResult->setBold(false); +} + +void SQ_ImageConvert::slotStartConvert() +{ + pushConvert->setDefault(false); + pushConvert->setDisabled(true); + pushCancel->setDefault(true); + pushCancel->setFocus(); + widgetStack->raiseWidget(1); + showExtension(false); + + qApp->processEvents(); + + QListViewItem *i = tableLib->selectedItem(); + + if(!i) + return; + + SQ_ImageConvertOptions copt; + copt.libname = i->text(1); + + emit convert(&imageopt, &copt); +} + +void SQ_ImageConvert::startConvertion(int count) +{ + done = false; + paragraph = 0; + progress->setProgress(0); + progress->setTotalSteps(count); +} + +void SQ_ImageConvert::slotOneProcessed() +{ + progress->advance(1); + paragraph++; +} + +void SQ_ImageConvert::slotCurrentLibraryChanged( QListViewItem * i) +{ + if(!i) + return; + + QString name = i->text(1); + + SQ_LIBRARY *l = SQ_LibraryHandler::instance()->libraryByName(name); + + if(!l) + return; + + SQ_WriteOption *e = (SQ_WriteOption*)extension(); + + if(!e) + return; + + e->widgetStack->raiseWidget(0); + + bool bslider = (l->opt.compression_scheme == CompressionInternal && (l->opt.compression_min || l->opt.compression_max)); + + e->slider->setShown(bslider); + e->checkRLE->setShown(!bslider); + + if(bslider) + { + e->slider->setRange(l->opt.compression_min, l->opt.compression_max, 1, true); + e->slider->setValue(l->opt.compression_def); + } + + bool rle = true; + + if(!(l->opt.compression_scheme & CompressionRLE)) + { + e->checkRLE->hide(); + rle = false; + } + + bool binter = l->opt.interlaced; + + e->checkInterlaced->setShown(binter); + + if(!binter && !rle && !bslider) + e->widgetStack->raiseWidget(1); +} + +void SQ_ImageConvert::fillWriteOptions(fmt_writeoptions *opt, const fmt_writeoptionsabs &opt2) +{ + SQ_WriteOption *e = (SQ_WriteOption*)extension(); + + if(!e) + return; + + opt->interlaced = (opt2.interlaced) ? e->checkInterlaced->isChecked() : false; + + if(opt2.compression_scheme == CompressionInternal) + opt->compression_scheme = CompressionInternal; + else if(opt2.compression_scheme == CompressionRLE) + opt->compression_scheme = (e->checkRLE->isChecked()) ? CompressionRLE : CompressionNo; + else + opt->compression_scheme = CompressionNo; + + opt->compression_level = (opt->compression_scheme != CompressionNo) ? e->slider->value() : 0; +} + +void SQ_ImageConvert::slotOptions() +{ + SQ_ImageEditOptions o(this); + + // SQ_ImageEditOptions will write needed KConfig entries, if + // exec() will return QDialog::Accepted + o.setConfigPrefix("convert"); + + o.exec(&imageopt); +} + +void SQ_ImageConvert::slotDone(bool close) +{ + done = true; + + if(close) + reject(); +} + +void SQ_ImageConvert::slotReject() +{ + if(done) + reject(); +} + +void SQ_ImageConvert::closeEvent(QCloseEvent *e) +{ + if(done) + e->accept(); + else + { + e->ignore(); + QWhatsThis::display(SQ_ErrorString::instance()->string(SQE_NOTFINISHED)); + } +} diff --git a/ksquirrel/imageedit/sq_imageedit.h b/ksquirrel/imageedit/sq_imageedit.h new file mode 100644 index 0000000..acece00 --- /dev/null +++ b/ksquirrel/imageedit/sq_imageedit.h @@ -0,0 +1,84 @@ +/*************************************************************************** + sq_imageedit.h - description + ------------------- + begin : 29 2005 + copyright : (C) 2005 by Baryshev Dmitry + email : ksquirrel.iv@gmail.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifndef SQ_IMAGEEDIT_H +#define SQ_IMAGEEDIT_H + +#include +#include + +#include "fmt_filters.h" + +struct SQ_ImageOptions +{ + QString putto; + int where_to_put; + bool close; +}; + +struct SQ_ImageBCGOptions +{ + int b, c, g; + int red, green, blue; +}; + +struct SQ_ImageConvertOptions +{ + QString libname; +}; + +struct SQ_ImageFilterOptions +{ + int type; + + bool _bool; + fmt_filters::rgb rgb1, rgb2; + float _float; + unsigned int _uint; + double _double1, _double2; +}; + +namespace F +{ + enum ftype + { + fblend = 0, + fblur, + fdesaturate, + fdespeckle, + fedge, + femboss, + fequalize, + ffade, + fflatten, + fimplode, + fnegative, + fnoise, + foil, + fshade, + fsharpen, + fsolarize, + fspread, + fswapRGB, + fswirl, + fthreshold, + fgray, + fredeye + }; +} + +#endif diff --git a/ksquirrel/imageedit/sq_imageeditoptions.ui b/ksquirrel/imageedit/sq_imageeditoptions.ui new file mode 100644 index 0000000..25c7e58 --- /dev/null +++ b/ksquirrel/imageedit/sq_imageeditoptions.ui @@ -0,0 +1,228 @@ + +SQ_ImageEditOptions + + + SQ_ImageEditOptions + + + + 0 + 0 + 465 + 266 + + + + Edit options + + + true + + + + unnamed + + + + buttonGroup1 + + + New files + + + + unnamed + + + 9 + + + 2 + + + + radioPutHere + + + Place here + + + 3 + + + + + radioReplace + + + Replace original files + + + 2 + + + + + kurl + + + false + + + + + radioCurrentDir + + + Place files in current directory, renaming them if necessary + + + 1 + + + + + radioCurrentDir_2 + + + Place files in current directory, replacing existing files + + + 0 + + + + + + + checkClose + + + Close, when all operations succeeded + + + + + spacer3 + + + Vertical + + + Expanding + + + + 16 + 16 + + + + + + pushOK + + + OK + + + true + + + + + pushCancel + + + Cancel + + + + + spacer4 + + + Horizontal + + + Expanding + + + + 260 + 16 + + + + + + line1 + + + HLine + + + Sunken + + + Horizontal + + + + + + + + + pushOK + clicked() + SQ_ImageEditOptions + accept() + + + pushCancel + clicked() + SQ_ImageEditOptions + reject() + + + radioPutHere + toggled(bool) + kurl + setEnabled(bool) + + + + radioCurrentDir_2 + radioCurrentDir + radioReplace + radioPutHere + kurl + checkClose + pushOK + pushCancel + + + sq_imageedit.h + sq_config.h + sq_imageeditoptions.ui.h + + + class SQ_ImageOptions; + + + int index; + QString putto, prefix; + + + init() + exec( SQ_ImageOptions * o ) + setConfigPrefix( const QString & pr ) + + + + kurlrequester.h + klineedit.h + kpushbutton.h + + diff --git a/ksquirrel/imageedit/sq_imageeditoptions.ui.h b/ksquirrel/imageedit/sq_imageeditoptions.ui.h new file mode 100644 index 0000000..5d73d15 --- /dev/null +++ b/ksquirrel/imageedit/sq_imageeditoptions.ui.h @@ -0,0 +1,52 @@ +/**************************************************************************** +** ui.h extension file, included from the uic-generated form implementation. +** +** If you wish to add, delete or rename functions or slots use +** Qt Designer which will update this file, preserving your code. Create an +** init() function in place of a constructor, and a destroy() function in +** place of a destructor. +*****************************************************************************/ + +void SQ_ImageEditOptions::init() +{ + KFile::Mode mode = static_cast(KFile::Directory | KFile::ExistingOnly | KFile::LocalOnly); + kurl->setMode(mode); +} + +int SQ_ImageEditOptions::exec(SQ_ImageOptions *o) +{ + kurl->setURL(o->putto); + + QButton *b = buttonGroup1->find(o->where_to_put); + + if(b) + b->animateClick(); + else + { + qWarning("SQ_ImageEditOptions::exec: wrong button Id"); + radioCurrentDir->animateClick(); + } + + checkClose->setChecked(o->close); + + int result = QDialog::exec(); + + if(result == QDialog::Accepted) + { + o->putto = (kurl->isEnabled()) ? kurl->url() : QString::null; + o->where_to_put = buttonGroup1->selectedId(); + o->close = checkClose->isChecked(); + + SQ_Config::instance()->setGroup("Image edit options"); + SQ_Config::instance()->writeEntry(prefix + "_putto", o->putto); + SQ_Config::instance()->writeEntry(prefix + "_where_to_put", o->where_to_put); + SQ_Config::instance()->writeEntry(prefix + "_close", o->close); + } + + return result; +} + +void SQ_ImageEditOptions::setConfigPrefix( const QString &pr ) +{ + prefix = pr; +} diff --git a/ksquirrel/imageedit/sq_imagefilter.ui b/ksquirrel/imageedit/sq_imagefilter.ui new file mode 100644 index 0000000..57e169d --- /dev/null +++ b/ksquirrel/imageedit/sq_imagefilter.ui @@ -0,0 +1,1602 @@ + +SQ_ImageFilter + + + SQ_ImageFilter + + + + 0 + 0 + 537 + 421 + + + + Filter + + + true + + + + unnamed + + + + widgetStackFilters + + + + 3 + 5 + 0 + 0 + + + + GroupBoxPanel + + + + blendWidget + + + 0 + + + + unnamed + + + + textLabel1 + + + + 4 + 5 + 0 + 0 + + + + Color: + + + + + pushBlendColor + + + + + + + + spacer17 + + + Vertical + + + Expanding + + + + 16 + 40 + + + + + + blendOpacity + + + Opacity + + + + + + + WStackPage + + + 1 + + + + unnamed + + + + spacer9_2 + + + Vertical + + + Expanding + + + + 16 + 20 + + + + + + blurSigma + + + Sigma + + + + + blurRadius + + + Radius + + + + + + + WStackPage + + + 2 + + + + unnamed + + + + spacer10_2 + + + Vertical + + + Expanding + + + + 16 + 45 + + + + + + desaturateValue + + + Factor + + + + + + + WStackPage + + + 3 + + + + unnamed + + + + textLabel1_2 + + + GroupBoxPanel + + + 4 + + + There are no special options available for this filter. Just click "Filter". + + + WordBreak|AlignVCenter + + + + + spacer11 + + + Vertical + + + Expanding + + + + 11 + 26 + + + + + + + + WStackPage + + + 4 + + + + unnamed + + + + spacer12 + + + Vertical + + + Expanding + + + + 16 + 30 + + + + + + edgeRadius + + + Radius + + + + + + + WStackPage + + + 5 + + + + unnamed + + + + spacer13 + + + Vertical + + + Expanding + + + + 16 + 30 + + + + + + embossSigma + + + Sigma + + + + + embossRadius + + + Radius + + + + + + + WStackPage + + + 6 + + + + unnamed + + + + textLabel1_2_2 + + + GroupBoxPanel + + + 4 + + + There are no special options available for this filter. Just click "Filter". + + + WordBreak|AlignVCenter + + + + + spacer11_2 + + + Vertical + + + Expanding + + + + 11 + 14 + + + + + + + + WStackPage + + + 7 + + + + unnamed + + + + fadeColor + + + + + + + + spacer15 + + + Vertical + + + Expanding + + + + 16 + 10 + + + + + + textLabel1_4 + + + + 4 + 5 + 0 + 0 + + + + Color: + + + + + fadeValue + + + Value + + + + + + + WStackPage + + + 8 + + + + unnamed + + + + flattenColor1 + + + + + + + + spacer16 + + + Vertical + + + Expanding + + + + 10 + 11 + + + + + + flattenColor2 + + + + + + + + textLabel1_4_2 + + + + 4 + 5 + 0 + 0 + + + + Color 1: + + + + + textLabel1_4_3 + + + Color 2: + + + + + + + WStackPage + + + 9 + + + + unnamed + + + + spacer15_2 + + + Vertical + + + Expanding + + + + 16 + 25 + + + + + + implodeFactor + + + Factor + + + + + + + WStackPage + + + 10 + + + + unnamed + + + + spacer11_2_2 + + + Vertical + + + Expanding + + + + 11 + 14 + + + + + + textLabel1_2_2_2 + + + GroupBoxPanel + + + 4 + + + There are no special options available for this filter. Just click "Filter". + + + WordBreak|AlignVCenter + + + + + + + WStackPage + + + 11 + + + + unnamed + + + + buttonGroupNoise + + + Noise type + + + true + + + + unnamed + + + 9 + + + 2 + + + + radioButton1 + + + Uniform + + + + + radioButton1_4 + + + Impulse + + + 3 + + + + + radioButton1_3 + + + Multiplicative Gaussian + + + + + radioButton1_6 + + + Poisson + + + 5 + + + + + radioButton1_2 + + + Gaussian + + + 1 + + + + + radioButton1_5 + + + Laplacian + + + 4 + + + + + + + + + WStackPage + + + 12 + + + + unnamed + + + + spacer15_2_2 + + + Vertical + + + Expanding + + + + 16 + 35 + + + + + + oilRadius + + + Radius + + + + + + + WStackPage + + + 13 + + + + unnamed + + + + shadeColor + + + Color + + + + + spacer21 + + + Vertical + + + Expanding + + + + 21 + 10 + + + + + + shadeElev + + + Elevation + + + + + shadeAzim + + + Azimuth + + + + + + + WStackPage + + + 14 + + + + unnamed + + + + spacer13_2 + + + Vertical + + + Expanding + + + + 16 + 10 + + + + + + sharpenSigma + + + Sigma + + + + + sharpenRadius + + + Radius + + + + + + + WStackPage + + + 15 + + + + unnamed + + + + spacer13_2_2 + + + Vertical + + + Expanding + + + + 20 + 60 + + + + + + solarizeValue + + + Factor + + + + + + + WStackPage + + + 16 + + + + unnamed + + + + spacer24 + + + Vertical + + + Expanding + + + + 16 + 35 + + + + + + spreadValue + + + Amount + + + + + + + WStackPage + + + 17 + + + + unnamed + + + + buttonGroupSwapRGB + + + Type + + + + unnamed + + + 9 + + + 2 + + + + radioButton7 + + + GBR + + + + + radioButton8 + + + BRG + + + + + + + spacer25 + + + Vertical + + + Expanding + + + + 11 + 41 + + + + + + + + WStackPage + + + 18 + + + + unnamed + + + + spacer13_2_2_2 + + + Vertical + + + Expanding + + + + 16 + 25 + + + + + + swirlAngle + + + Degrees + + + + + + + WStackPage + + + 19 + + + + unnamed + + + + spacer24_2 + + + Vertical + + + Expanding + + + + 16 + 75 + + + + + + thresholdValue + + + Threshold + + + + + + + WStackPage + + + 20 + + + + unnamed + + + + textLabel1_2_2_2_2 + + + GroupBoxPanel + + + 4 + + + There are no special options available for this filter. Just click "Filter". + + + WordBreak|AlignVCenter + + + + + spacer11_2_2_2 + + + Vertical + + + Expanding + + + + 11 + 113 + + + + + + + + WStackPage + + + 21 + + + + unnamed + + + + thresholdRE + + + Threshold + + + + + spacer26_2 + + + Vertical + + + Expanding + + + + 16 + 71 + + + + + + + + + spacer27 + + + Vertical + + + Expanding + + + + 16 + 16 + + + + + + layout2 + + + + unnamed + + + + spacer14 + + + Horizontal + + + Expanding + + + + 285 + 16 + + + + + + pushFilter + + + Filter + + + true + + + + + pushCancel + + + Close + + + false + + + + + + + line7 + + + HLine + + + Sunken + + + Horizontal + + + + + + Blend + + + + + Blur + + + + + Desaturate + + + + + Despeckle + + + + + Edge + + + + + Emboss + + + + + Equalize + + + + + Fade + + + + + Flatten + + + + + Implode + + + + + Negative + + + + + Noise + + + + + Oil + + + + + Shade + + + + + Sharpen + + + + + Solarize + + + + + Spread + + + + + Swap colors + + + + + Swirl + + + + + Threshold + + + + + Grayscale + + + + + Redeye + + + + listMain + + + + 1 + 7 + 0 + 0 + + + + + 140 + 0 + + + + + + spacer26 + + + Vertical + + + Expanding + + + + 16 + 16 + + + + + + layout4 + + + + unnamed + + + + pixmap1 + + + + 0 + 0 + 0 + 0 + + + + + 160 + 160 + + + + + + textLabel1_3 + + + Original image: + + + + + spacer27_2 + + + Horizontal + + + Expanding + + + + 1 + 16 + + + + + + spacer28 + + + Horizontal + + + Expanding + + + + 1 + 16 + + + + + + pixmap + + + + 0 + 0 + 0 + 0 + + + + + 160 + 160 + + + + + + spacer27_3 + + + Horizontal + + + Expanding + + + + 1 + 16 + + + + + + textLabel2 + + + Image after filtering: + + + + + + + + + SQ_BCGLabel +
sq_bcglabel.h
+ + -1 + -1 + + 0 + + 5 + 5 + 0 + 0 + + image0 +
+
+ + + 89504e470d0a1a0a0000000d4948445200000016000000160806000000c4b46c3b000003b149444154388dad945f4c5b551cc73fe7dc4b7b4bcba0762d45c43114323599ee6192609c51d883892ce083f1718b3ebb185f8dc91e972cf39d2d2a2f1af664b6f1e0fe3863a0718969700eb0c52142da0242a1bd6d696f7bcff101585203ceb8fd9ece39f99dcff9fe7edf939f88c562ec465f5f9fe609442c161362173c3e3eae7b7a7ac8e7f36432196cdbfe4f907c3e4f2291201e8fe338cec3737357e9e8e828aded1e229d650e1f2d51754b082110124c13a4dc5ea341eb9dc284c0558a853f3ce8cb0677ef500fde7d39d2596679e326597b8e9abb85d7a770ab16ab6983ec5a05b487a70e36f0f4e10afe408d6a558310980108478dba4a1e8233990c5d474b64ed39aa3a8fe5f3317fbf81dbd70bccfeb205947632fd74f6589c1c6ea2f70d03a58ba0c1f2c9bdc1b66de3b8256a6e11cbe7e3ee1d181b590124fe2693aeee08d223c82c3a2c24b7b874bec8f26288774f7bd054504aef0dde6e99c0eb83f9fb266323cb80a27fb0958141836044605a2ee5523393371cc646fee2da37195aa35d0c0c5b4859ac03d7e91712dcaac5adab3650a3ff9d08ef7dd8404bb48869e5d958b5b87dadc4c9a1464e9f0d0326df7ebd86bd2e310cb1bf62d384d59441f2d70a070e1c60e09489929b988681bdd9cc97170bcc4c65595f71f8e0e3301337fc24a7732467831875a47f289652b0be5e4151e6d07316c1b0c0340d8ab92023e76d66a6b2840e36d2fb7a13fee632475e6edc367ea98a90fb98b7dd6310ca0328a44761582e1bab41befabcc0ec940d28bc5e93b68e064cab84e1d9beaeb48934eac1f53b01c1b000fca496aa54b61a99fcde61662a4b4b4b23d1680be9d426173e4df3602a48ea411989a4fd590f52a8fd156b05ed9d350e3defe3cfdf4b4c7ce770ea7d3fb9f520afbe1620daeee5c26735d20b9b9cfb6811a754a439e4e5c5639a4caa1e5caf586bfc0197b78702005cb9b4cae4cd3267ce8638fe964bd72b393e39d74928d242617303a756a37f284447770dcdbffc6384a05a85de1306e9a52057c7527c7131c3c42d3f475eb2303c82d4fc3276d6811db37efeb148723082d9b08f79f97c1e5729109a9a28307cc622d2d6cdf52b2b24efe548dedb00142009862cfa879ee1a71f6cec928353511472fbf4389148b0b0e0c108081412458dfe21c9f11351e67e7358595468246d1d1e5e38a6e9e851bc39d84ab502a669331dafec0d8ec7e3e8cb06e1a881d727d1ae40180a434a8c9db129a54126ad48a7358c2b4c5352c8c374bcccdab2bb37d8719cba79fab8211f9df218e0582c261e95f8bfc04f1a1e8bc5c4dfe0a190172af6a9690000000049454e44ae426082 + + + + + pushCancel + clicked() + SQ_ImageFilter + reject() + + + pushFilter + clicked() + SQ_ImageFilter + slotStartFiltering() + + + listMain + selectionChanged() + SQ_ImageFilter + slotShowPage() + + + + pushFilter + pushCancel + + + sq_imageedit.h + qimage.h + sq_iconloader.h + sq_config.h + fmt_filters.h + sq_imagefilter.ui.h + + + QImage sample, sample_saved; + static SQ_ImageFilter *m_inst; + + + filter(SQ_ImageFilterOptions*) + + + slotStartFiltering() + slotShowPage() + swapRGB() + blend() + fade() + desaturate() + threshold() + solarize() + spread() + swirl() + noise() + redeye() + flatten() + shade() + blur() + implode() + edge() + emboss() + sharpen() + oil() + + + init() + setPreviewImage( const QImage & im ) + assignNewImage( const QImage & im ) + negative() + togray() + equalize() + despeckle() + hackConnect() + instance() + + + + kcolorbutton.h + knuminput.h + knuminput.h + knuminput.h + knuminput.h + knuminput.h + knuminput.h + knuminput.h + knuminput.h + knuminput.h + knuminput.h + knuminput.h + knuminput.h + knuminput.h + knuminput.h + kcolorbutton.h + knuminput.h + knuminput.h + kcolorbutton.h + kcolorbutton.h + knuminput.h + knuminput.h + knuminput.h + knuminput.h + knuminput.h + knuminput.h + knuminput.h + knuminput.h + knuminput.h + knuminput.h + knuminput.h + knuminput.h + knuminput.h + knuminput.h + knuminput.h + knuminput.h + knuminput.h + knuminput.h + knuminput.h + knuminput.h + knuminput.h + knuminput.h + sq_bcglabel.h + sq_bcglabel.h + +
diff --git a/ksquirrel/imageedit/sq_imagefilter.ui.h b/ksquirrel/imageedit/sq_imagefilter.ui.h new file mode 100644 index 0000000..d39f35f --- /dev/null +++ b/ksquirrel/imageedit/sq_imagefilter.ui.h @@ -0,0 +1,610 @@ +/**************************************************************************** +** ui.h extension file, included from the uic-generated form implementation. +** +** If you wish to add, delete or rename functions or slots use +** Qt Designer which will update this file, preserving your code. Create an +** init() function in place of a constructor, and a destroy() function in +** place of a destructor. +*****************************************************************************/ + +SQ_ImageFilter * SQ_ImageFilter::m_inst = 0; + +void SQ_ImageFilter::init() +{ + m_inst = this; + + // restore NumInputs... + const double sigmaMax = 99.9, sigmaMin = 0.01; + const double radiusMax = 99.9, radiusMin = 0.01; + + blendOpacity->setRange(0.0f, 1.0f, 0.01, true); + fadeValue->setRange(0.0f, 1.0f, 0.01f, true); + desaturateValue->setRange(0.0f, 1.0f, 0.01, true); + thresholdValue->setRange(0, 255, 1, true); + thresholdRE->setRange(0, 255, 1, true); + solarizeValue->setRange(0.0f, 50.0f, 0.01f, true); + spreadValue->setRange(1, 10, 1, true); + swirlAngle->setRange(-720.0f, 720.0f, 0.1f, true); + shadeAzim->setRange(0.0f, 90.0f, 0.01f, true); + shadeElev->setRange(0.0f, 90.0f, 0.01f, true); + blurRadius->setRange(radiusMin, radiusMax, 0.01f, true); + blurSigma->setRange(sigmaMin, 50.0, 0.01f, true); + implodeFactor->setRange(0, 100, 1, true); + edgeRadius->setRange((int)radiusMin, 30, 1, true); + embossRadius->setRange(radiusMin, radiusMax, 0.01f, true); + embossSigma->setRange(sigmaMin, sigmaMax, 0.01f, true); + sharpenRadius->setRange(radiusMin, radiusMax, 0.01f, true); + sharpenSigma->setRange(sigmaMin, 30.0, 0.01f, true); + oilRadius->setRange(1, 5, 1, true); + + SQ_Config::instance()->setGroup("Image edit options"); + + buttonGroupSwapRGB->setButton(SQ_Config::instance()->readNumEntry("filter_swapRGB", 0)); + // blend + QColor c; + c.setNamedColor(SQ_Config::instance()->readEntry("filter_blend_color", "#00ff00")); + pushBlendColor->setColor(c); + blendOpacity->setValue(SQ_Config::instance()->readDoubleNumEntry("filter_blend_opacity", 0.5)); + + // fade + c.setNamedColor(SQ_Config::instance()->readEntry("filter_flend_color", "#00ff00")); + fadeColor->setColor(c); + fadeValue->setValue(SQ_Config::instance()->readDoubleNumEntry("filter_fade_value", 0.5)); + + // desaturate + desaturateValue->setValue(SQ_Config::instance()->readDoubleNumEntry("filter_desaturate_value", 0.5)); + + // threshold + thresholdValue->setValue(SQ_Config::instance()->readNumEntry("filter_threshold_value", 1)); + + // threshold for redeye + thresholdRE->setValue(SQ_Config::instance()->readNumEntry("filter_threshold_redeye", 10)); + + // solarize + solarizeValue->setValue(SQ_Config::instance()->readDoubleNumEntry("filter_solarize_value", 0.5)); + + // spread + spreadValue->setValue(SQ_Config::instance()->readNumEntry("filter_spread_value", 1)); + + // swirl + swirlAngle->setValue(SQ_Config::instance()->readDoubleNumEntry("filter_swirl_value", 0.0)); + + // noise + buttonGroupNoise->setButton(SQ_Config::instance()->readNumEntry("filter_noise", 0)); + + // flatten + c.setNamedColor(SQ_Config::instance()->readEntry("filter_flatten_color1", "#00ff00")); + flattenColor1->setColor(c); + c.setNamedColor(SQ_Config::instance()->readEntry("filter_flatten_color2", "#00ff00")); + flattenColor2->setColor(c); + + // shade + shadeAzim->setValue(SQ_Config::instance()->readDoubleNumEntry("filter_shade_azim", 0.1)); + shadeElev->setValue(SQ_Config::instance()->readDoubleNumEntry("filter_shade_elev", 0.1)); + + if(SQ_Config::instance()->readBoolEntry("filter_shade_color", false)) + shadeColor->toggle(); + + // blur + blurRadius->setValue(SQ_Config::instance()->readDoubleNumEntry("filter_blur_radius", 0.1)); + blurSigma->setValue(SQ_Config::instance()->readDoubleNumEntry("filter_blur_sigma", 0.1)); + + // implode + implodeFactor->setValue(SQ_Config::instance()->readNumEntry("filter_implode_factor", 1)); + + // edge + edgeRadius->setValue(SQ_Config::instance()->readNumEntry("filter_egde_radius", 1)); + + // emboss + embossRadius->setValue(SQ_Config::instance()->readDoubleNumEntry("filter_emboss_radius", 0.1)); + embossSigma->setValue(SQ_Config::instance()->readDoubleNumEntry("filter_emboss_sigma", 0.1)); + + // sharpen + sharpenRadius->setValue(SQ_Config::instance()->readDoubleNumEntry("filter_sharpen_radius", 0.1)); + sharpenSigma->setValue(SQ_Config::instance()->readDoubleNumEntry("filter_sharpen_sigma", 0.1)); + + // oil + oilRadius->setValue(SQ_Config::instance()->readNumEntry("filter_oil_radius", 1)); + + listMain->setCurrentItem(SQ_Config::instance()->readNumEntry("filter_filter", 0)); + + hackConnect(); +} + +void SQ_ImageFilter::slotStartFiltering() +{ + SQ_Config *kconf = SQ_Config::instance(); + + kconf->setGroup("Image edit options"); + kconf->writeEntry("filter_swapRGB", buttonGroupSwapRGB->selectedId()); + kconf->writeEntry("filter_blend_color", pushBlendColor->color().name()); + kconf->writeEntry("filter_blend_opacity", blendOpacity->value()); + kconf->writeEntry("filter_fade_color", fadeColor->color().name()); + kconf->writeEntry("filter_fade_value", fadeValue->value()); + kconf->writeEntry("filter_desaturate_value", desaturateValue->value()); + kconf->writeEntry("filter_threshold_value", thresholdValue->value()); + kconf->writeEntry("filter_threshold_redeye", thresholdRE->value()); + kconf->writeEntry("filter_solarize_value", solarizeValue->value()); + kconf->writeEntry("filter_spread_value", spreadValue->value()); + kconf->writeEntry("filter_swirl_value", swirlAngle->value()); + kconf->writeEntry("filter_noise", buttonGroupNoise->selectedId()); + kconf->writeEntry("filter_flatten_color1", flattenColor1->color().name()); + kconf->writeEntry("filter_flatten_color2", flattenColor2->color().name()); + kconf->writeEntry("filter_shade_azim", shadeAzim->value()); + kconf->writeEntry("filter_shade_elev", shadeElev->value()); + kconf->writeEntry("filter_shade_color", shadeColor->isChecked()); + kconf->writeEntry("filter_blur_radius", blurRadius->value()); + kconf->writeEntry("filter_blur_sigma", blurSigma->value()); + kconf->writeEntry("filter_implode_factor", implodeFactor->value()); + kconf->writeEntry("filter_egde_radius", edgeRadius->value()); + kconf->writeEntry("filter_emboss_radius", embossRadius->value()); + kconf->writeEntry("filter_emboss_sigma", embossSigma->value()); + kconf->writeEntry("filter_sharpen_radius", sharpenRadius->value()); + kconf->writeEntry("filter_sharpen_sigma", sharpenSigma->value()); + kconf->writeEntry("filter_oil_radius", oilRadius->value()); + kconf->writeEntry("filter_filter", listMain->currentItem()); + + SQ_ImageFilterOptions opt; + + opt.type = listMain->currentItem(); + + switch(opt.type) + { + case F::fblend: + { + QColor c = pushBlendColor->color(); + opt.rgb1 = fmt_filters::rgb(c.red(), c.green(), c.blue()); + opt._float = blendOpacity->value(); + } + break; + case F::fblur: opt._double1 = blurRadius->value(); opt._double2 = blurSigma->value(); break; + case F::fdesaturate: opt._float = (float)desaturateValue->value(); break; + case F::fdespeckle: break; + case F::fedge: opt._double1 = (double)edgeRadius->value(); break; + case F::femboss: opt._double1 = embossRadius->value(); opt._double2 = embossSigma->value(); break; + case F::fequalize: break; + case F::ffade: + { + QColor c = fadeColor->color(); + opt.rgb1 = fmt_filters::rgb(c.red(), c.green(), c.blue()); + opt._float = (float)fadeValue->value(); + } + break; + case F::fflatten: + { + QColor c = flattenColor1->color(); + opt.rgb1 = fmt_filters::rgb(c.red(), c.green(), c.blue()); + c = flattenColor2->color(); + opt.rgb2 = fmt_filters::rgb(c.red(), c.green(), c.blue()); + } + break; + case F::fimplode: opt._double1 = implodeFactor->value(); break; + case F::fnegative: break; + case F::fnoise: opt._uint = buttonGroupNoise->selectedId(); break; + case F::foil: opt._double1 = (double)oilRadius->value(); break; + case F::fshade: opt._bool = shadeColor->isChecked(); opt._double1 = shadeAzim->value(); opt._double2 = shadeElev->value(); break; + case F::fsharpen: opt._double1 = sharpenRadius->value(); opt._double2 = sharpenSigma->value();break; + case F::fsolarize: opt._double1 = solarizeValue->value(); break; + case F::fspread: opt._uint = spreadValue->value(); break; + case F::fswapRGB: opt._uint = buttonGroupSwapRGB->selectedId(); break; + case F::fswirl: opt._double1 = swirlAngle->value(); break; + case F::fthreshold: opt._uint = thresholdValue->value(); break; + case F::fgray: break; + case F::fredeye: opt._uint = thresholdRE->value(); break; + } + + emit filter(&opt); +} + +void SQ_ImageFilter::slotShowPage() +{ + int id = listMain->currentItem(); + + widgetStackFilters->raiseWidget(id); + + switch(id) + { + case F::fblend: blend(); break; + case F::fblur: blur(); break; + case F::fdesaturate: desaturate(); break; + case F::fdespeckle: despeckle(); break; + case F::fedge: edge(); break; + case F::femboss: emboss(); break; + case F::fequalize: equalize(); break; + case F::ffade: fade(); break; + case F::fflatten: flatten(); break; + case F::fimplode: implode(); break; + case F::fnegative: negative(); break; + case F::fnoise: noise(); break; + case F::foil: oil(); break; + case F::fshade: shade(); break; + case F::fsharpen: sharpen(); break; + case F::fsolarize: solarize(); break; + case F::fspread: spread(); break; + case F::fswapRGB: swapRGB(); break; + case F::fswirl: swirl(); break; + case F::fthreshold: threshold(); break; + case F::fgray: togray(); break; + case F::fredeye: redeye(); break; + } +} + +void SQ_ImageFilter::setPreviewImage(const QImage &im) +{ + if(im.isNull()) return; + + sample = im.copy(); + sample_saved = sample.copy(); + + QPixmap p; + + p.convertFromImage(sample_saved); + pixmap->setPixmap(p); + pixmap1->setPixmap(p); + + slotShowPage(); +} + +void SQ_ImageFilter::assignNewImage(const QImage &im) +{ + QPixmap p; + p.convertFromImage(im); + pixmap1->setPixmap(p); +} + +void SQ_ImageFilter::swapRGB() +{ + if(sample.isNull() || sample_saved.isNull()) + return; + + sample = sample_saved.copy(); + + int id = buttonGroupSwapRGB->selectedId(); + + if(id == -1) + return; + + fmt_filters::image im(sample.bits(), sample.width(), sample.height()); + + fmt_filters::swapRGB(im, (id ? fmt_filters::GBR : fmt_filters::BRG)); + + assignNewImage(sample); +} + +void SQ_ImageFilter::negative() +{ + if(sample.isNull() || sample_saved.isNull()) + return; + + sample = sample_saved.copy(); + + fmt_filters::image im(sample.bits(), sample.width(), sample.height()); + + fmt_filters::negative(im); + + assignNewImage(sample); +} + +void SQ_ImageFilter::blend() +{ + if(sample.isNull() || sample_saved.isNull()) + return; + + sample = sample_saved.copy(); + + fmt_filters::image im(sample.bits(), sample.width(), sample.height()); + + QColor c = pushBlendColor->color(); + + fmt_filters::rgb rgb(c.red(), c.green(), c.blue()); + + fmt_filters::blend(im, rgb, blendOpacity->value()); + + assignNewImage(sample); +} + +void SQ_ImageFilter::fade() +{ + if(sample.isNull() || sample_saved.isNull()) + return; + + sample = sample_saved.copy(); + + fmt_filters::image im(sample.bits(), sample.width(), sample.height()); + + QColor c = fadeColor->color(); + + fmt_filters::fade(im, fmt_filters::rgb(c.red(), c.green(), c.blue()), fadeValue->value()); + + assignNewImage(sample); +} + +void SQ_ImageFilter::togray() +{ + if(sample.isNull() || sample_saved.isNull()) + return; + + sample = sample_saved.copy(); + + fmt_filters::image im(sample.bits(), sample.width(), sample.height()); + + fmt_filters::gray(im); + + assignNewImage(sample); +} + +void SQ_ImageFilter::desaturate() +{ + if(sample.isNull() || sample_saved.isNull()) + return; + + sample = sample_saved.copy(); + + fmt_filters::image im(sample.bits(), sample.width(), sample.height()); + + fmt_filters::desaturate(im, desaturateValue->value()); + + assignNewImage(sample); +} + +void SQ_ImageFilter::threshold() +{ + if(sample.isNull() || sample_saved.isNull()) + return; + + sample = sample_saved.copy(); + + fmt_filters::image im(sample.bits(), sample.width(), sample.height()); + + fmt_filters::threshold(im, thresholdValue->value()); + + assignNewImage(sample); +} + +void SQ_ImageFilter::solarize() +{ + if(sample.isNull() || sample_saved.isNull()) + return; + + sample = sample_saved.copy(); + + fmt_filters::image im(sample.bits(), sample.width(), sample.height()); + + fmt_filters::solarize(im, solarizeValue->value()); + + assignNewImage(sample); +} + +void SQ_ImageFilter::spread() +{ + if(sample.isNull() || sample_saved.isNull()) + return; + + sample = sample_saved.copy(); + + fmt_filters::image im(sample.bits(), sample.width(), sample.height()); + + fmt_filters::spread(im, spreadValue->value()); + + assignNewImage(sample); +} + +void SQ_ImageFilter::swirl() +{ + if(sample.isNull() || sample_saved.isNull()) + return; + + sample = sample_saved.copy(); + + fmt_filters::image im(sample.bits(), sample.width(), sample.height()); + + fmt_filters::swirl(im, swirlAngle->value(), fmt_filters::rgba(255,255,255,255)); + + assignNewImage(sample); +} + +void SQ_ImageFilter::noise() +{ + if(sample.isNull() || sample_saved.isNull()) + return; + + sample = sample_saved.copy(); + + fmt_filters::image im(sample.bits(), sample.width(), sample.height()); + + fmt_filters::noise(im, (fmt_filters::NoiseType)buttonGroupNoise->selectedId()); + + assignNewImage(sample); +} + +void SQ_ImageFilter::redeye() +{ + if(sample.isNull() || sample_saved.isNull()) + return; + + sample = sample_saved.copy(); + + fmt_filters::image im(sample.bits(), sample.width(), sample.height()); + + fmt_filters::redeye(im, im.w, im.h, 0, 0, thresholdRE->value()); + + assignNewImage(sample); +} + +void SQ_ImageFilter::flatten() +{ + if(sample.isNull() || sample_saved.isNull()) + return; + + sample = sample_saved.copy(); + + fmt_filters::image im(sample.bits(), sample.width(), sample.height()); + + QColor c1 = flattenColor1->color(); + QColor c2 = flattenColor2->color(); + + fmt_filters::flatten(im, fmt_filters::rgb(c1.red(), c1.green(), c1.blue()), fmt_filters::rgb(c2.red(), c2.green(), c2.blue())); + + assignNewImage(sample); +} + +void SQ_ImageFilter::shade() +{ + if(sample.isNull() || sample_saved.isNull()) + return; + + sample = sample_saved.copy(); + + fmt_filters::image im(sample.bits(), sample.width(), sample.height()); + + fmt_filters::shade(im, shadeColor->isChecked(), shadeAzim->value(), shadeElev->value()); + + assignNewImage(sample); +} + +void SQ_ImageFilter::equalize() +{ + if(sample.isNull() || sample_saved.isNull()) + return; + + sample = sample_saved.copy(); + + fmt_filters::image im(sample.bits(), sample.width(), sample.height()); + + fmt_filters::equalize(im); + + assignNewImage(sample); +} + +void SQ_ImageFilter::blur() +{ + if(sample.isNull() || sample_saved.isNull()) + return; + + sample = sample_saved.copy(); + + fmt_filters::image im(sample.bits(), sample.width(), sample.height()); + + fmt_filters::blur(im, blurRadius->value(), blurSigma->value()); + + assignNewImage(sample); +} + +void SQ_ImageFilter::despeckle() +{ + if(sample.isNull() || sample_saved.isNull()) + return; + + sample = sample_saved.copy(); + + fmt_filters::image im(sample.bits(), sample.width(), sample.height()); + + fmt_filters::despeckle(im); + + assignNewImage(sample); +} + +void SQ_ImageFilter::implode() +{ + if(sample.isNull() || sample_saved.isNull()) + return; + + sample = sample_saved.copy(); + + fmt_filters::image im(sample.bits(), sample.width(), sample.height()); + + fmt_filters::implode(im, implodeFactor->value(), fmt_filters::white); + + assignNewImage(sample); +} + +void SQ_ImageFilter::edge() +{ + if(sample.isNull() || sample_saved.isNull()) + return; + + sample = sample_saved.copy(); + + fmt_filters::image im(sample.bits(), sample.width(), sample.height()); + + fmt_filters::edge(im, (double)edgeRadius->value()); + + assignNewImage(sample); +} + +void SQ_ImageFilter::emboss() +{ + if(sample.isNull() || sample_saved.isNull()) + return; + + sample = sample_saved.copy(); + + fmt_filters::image im(sample.bits(), sample.width(), sample.height()); + + fmt_filters::emboss(im, embossRadius->value(), embossSigma->value()); + + assignNewImage(sample); +} + +void SQ_ImageFilter::sharpen() +{ + if(sample.isNull() || sample_saved.isNull()) + return; + + sample = sample_saved.copy(); + + fmt_filters::image im(sample.bits(), sample.width(), sample.height()); + + fmt_filters::sharpen(im, sharpenRadius->value(), sharpenSigma->value()); + + assignNewImage(sample); +} + +void SQ_ImageFilter::oil() +{ + if(sample.isNull() || sample_saved.isNull()) + return; + + sample = sample_saved.copy(); + + fmt_filters::image im(sample.bits(), sample.width(), sample.height()); + + fmt_filters::oil(im, oilRadius->value()); + + assignNewImage(sample); +} + +void SQ_ImageFilter::hackConnect() +{ + connect( blendOpacity, SIGNAL( valueChanged(double) ), this, SLOT( blend() ) ); + connect( pushBlendColor, SIGNAL( changed(const QColor&) ), this, SLOT( blend() ) ); + connect( blurRadius, SIGNAL( valueChanged(double) ), this, SLOT( blur() ) ); + connect( blurSigma, SIGNAL( valueChanged(double) ), this, SLOT( blur() ) ); + connect( desaturateValue, SIGNAL( valueChanged(double) ), this, SLOT( desaturate() ) ); + connect( edgeRadius, SIGNAL( valueChanged(int) ), this, SLOT( edge() ) ); + connect( embossRadius, SIGNAL( valueChanged(double) ), this, SLOT( emboss() ) ); + connect( embossSigma, SIGNAL( valueChanged(double) ), this, SLOT( emboss() ) ); + connect( fadeColor, SIGNAL( changed(const QColor&) ), this, SLOT( fade() ) ); + connect( fadeValue, SIGNAL( valueChanged(double) ), this, SLOT( fade() ) ); + connect( flattenColor1, SIGNAL( changed(const QColor&) ), this, SLOT( flatten() ) ); + connect( flattenColor2, SIGNAL( changed(const QColor&) ), this, SLOT( flatten() ) ); + connect( implodeFactor, SIGNAL( valueChanged(double) ), this, SLOT( implode() ) ); + connect( buttonGroupNoise, SIGNAL( clicked(int) ), this, SLOT( noise() ) ); + connect( oilRadius, SIGNAL( valueChanged(int) ), this, SLOT( oil() ) ); + connect( shadeAzim, SIGNAL( valueChanged(double) ), this, SLOT( shade() ) ); + connect( shadeColor, SIGNAL( toggled(bool) ), this, SLOT( shade() ) ); + connect( shadeElev, SIGNAL( valueChanged(double) ), this, SLOT( shade() ) ); + connect( sharpenRadius, SIGNAL( valueChanged(double) ), this, SLOT( sharpen() ) ); + connect( sharpenSigma, SIGNAL( valueChanged(double) ), this, SLOT( sharpen() ) ); + connect( solarizeValue, SIGNAL( valueChanged(double) ), this, SLOT( solarize() ) ); + connect( spreadValue, SIGNAL( valueChanged(int) ), this, SLOT( spread() ) ); + connect( buttonGroupSwapRGB, SIGNAL( clicked(int) ), this, SLOT( swapRGB() ) ); + connect( swirlAngle, SIGNAL( valueChanged(double) ), this, SLOT( swirl() ) ); + connect( thresholdValue, SIGNAL( valueChanged(int) ), this, SLOT( threshold() ) ); + connect( thresholdRE, SIGNAL( valueChanged(int) ), this, SLOT( redeye() ) ); +} + +SQ_ImageFilter* SQ_ImageFilter::instance() +{ + return m_inst; +} diff --git a/ksquirrel/imageedit/sq_label.cpp b/ksquirrel/imageedit/sq_label.cpp new file mode 100644 index 0000000..4d9b14a --- /dev/null +++ b/ksquirrel/imageedit/sq_label.cpp @@ -0,0 +1,78 @@ +/*************************************************************************** + sq_label.cpp - description + ------------------- + begin : June 10 2005 + copyright : (C) 2005 by Baryshev Dmitry + email : ksquirrel.iv@gmail.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#include + +#include "sq_label.h" + +#define MARGIN 15 + +SQ_Label::SQ_Label(QWidget *parent, const char *name) : QWidget(parent, name), single(false) +{} + +SQ_Label::~SQ_Label() +{} + +void SQ_Label::paintEvent(QPaintEvent *) +{ + if((single && ltext.isEmpty() && rtext.isEmpty()) || (!single && ltext.isEmpty())) + return; + + QPainter paint(this); + + QFont font = paint.font(); + font.setBold(true); + font.setPointSize(10); + paint.setFont(font); + + if(!single) + { + paint.translate((width() + paint.fontMetrics().height()) / 2, height()); + paint.rotate(-90); + paint.drawText(MARGIN, 0, ltext); + + paint.translate(height() - paint.fontMetrics().width(rtext), 0); + paint.drawText(-MARGIN, 0, rtext); + } + else + { + paint.translate((width() + paint.fontMetrics().height()) / 2, + (height() + paint.fontMetrics().width(ltext)) / 2); + paint.rotate(-90); + paint.drawText(0, 0, ltext); + } +} + +void SQ_Label::setText(const QString <, const QString &rt) +{ + ltext = lt; + rtext = rt; + + update(); +} + +void SQ_Label::setText(const QString <) +{ + ltext = lt; + + update(); +} + +void SQ_Label::setSingle(bool s) +{ + single = s; +} diff --git a/ksquirrel/imageedit/sq_label.h b/ksquirrel/imageedit/sq_label.h new file mode 100644 index 0000000..7b54753 --- /dev/null +++ b/ksquirrel/imageedit/sq_label.h @@ -0,0 +1,41 @@ +/*************************************************************************** + sq_label.h - description + ------------------- + begin : June 10 2005 + copyright : (C) 2005 by Baryshev Dmitry + email : ksquirrel.iv@gmail.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifndef SQ_LABEL_H +#define SQ_LABEL_H + +#include + +class SQ_Label : public QWidget +{ + public: + SQ_Label(QWidget *parent = 0, const char *name = 0); + ~SQ_Label(); + + void setText(const QString <, const QString &rt); + void setText(const QString <); + void setSingle(bool s); + + protected: + void paintEvent(QPaintEvent *); + + private: + QString ltext, rtext; + bool single; +}; + +#endif diff --git a/ksquirrel/imageedit/sq_writeoption.ui b/ksquirrel/imageedit/sq_writeoption.ui new file mode 100644 index 0000000..38c8131 --- /dev/null +++ b/ksquirrel/imageedit/sq_writeoption.ui @@ -0,0 +1,169 @@ + +SQ_WriteOption + + + SQ_WriteOption + + + + 0 + 0 + 250 + 340 + + + + + 0 + 5 + 0 + 0 + + + + + 250 + 0 + + + + SQ_WriteOption + + + + unnamed + + + + widgetStack + + + + WStackPage + + + 0 + + + + unnamed + + + 0 + + + 0 + + + + groupBox1 + + + + + + + unnamed + + + + spacer1 + + + Vertical + + + Expanding + + + + 16 + 10 + + + + + + checkRLE + + + RLE compression + + + + + slider + + + Compression level + + + + + checkInterlaced + + + Interlaced + + + + + + + + + WStackPage + + + 1 + + + + unnamed + + + 0 + + + 0 + + + + groupBox2 + + + + + + + unnamed + + + + textLabel1 + + + <i>No special options available for this format</i> + + + WordBreak|AlignTop|AlignHCenter + + + 20 + + + + + + + + + + + + + + knuminput.h + knuminput.h + + diff --git a/ksquirrel/konqksquirrel-dir.desktop b/ksquirrel/konqksquirrel-dir.desktop new file mode 100644 index 0000000..5bed6f5 --- /dev/null +++ b/ksquirrel/konqksquirrel-dir.desktop @@ -0,0 +1,14 @@ +[Desktop Entry] +ServiceTypes=inode/directory +Actions=KSquirrel; +Encoding=UTF-8 +Type=Application + +[Desktop Action KSquirrel] +Type=Application +Icon=ksquirrel +Exec=ksquirrel %u + +Name=Browse with KSquirrel +Name[ru]=Просмотреть в KSquirrel +Name[de]=Mit KSquirrel durchsehen \ No newline at end of file diff --git a/ksquirrel/ksquirrel-libs-configurator/Makefile.am b/ksquirrel/ksquirrel-libs-configurator/Makefile.am new file mode 100644 index 0000000..8750aff --- /dev/null +++ b/ksquirrel/ksquirrel-libs-configurator/Makefile.am @@ -0,0 +1,15 @@ +INCLUDES = $(all_includes) -I$(srcdir) + +bin_PROGRAMS = ksquirrel-libs-configurator-real +bin_SCRIPTS = ksquirrel-libs-configurator + +ksquirrel_libs_configurator_real_SOURCES = main.cpp klc.ui +ksquirrel_libs_configurator_real_LDADD = $(KDE_LDFLAGS) $(QT_LDFLAGS) $(LIB_KIO) $(LIB_KDEUI) $(LIB_KDECORE) $(LIB_QT) + +AM_CXXFLAGS = $(ksquirrellibs_CFLAGS) + +messages: + LIST=`find . -name \*.h -o -name \*.hh -o -name \*.H -o -name \*.hxx -o -name \*.hpp -o -name \*.cpp -o -name \*.cc -o -name \*.cxx -o -name \*.ecpp -o -name \*.C`; \ + if test -n "$$LIST"; then \ + $(XGETTEXT) $$LIST -o $(podir)/ksquirrel.pot; \ + fi diff --git a/ksquirrel/ksquirrel-libs-configurator/klc.cpp b/ksquirrel/ksquirrel-libs-configurator/klc.cpp new file mode 100644 index 0000000..79fa63b --- /dev/null +++ b/ksquirrel/ksquirrel-libs-configurator/klc.cpp @@ -0,0 +1,115 @@ +#include +#include +/**************************************************************************** +** Form implementation generated from reading ui file './klc.ui' +** +** Created: Птн Дек 7 20:18:10 2007 +** by: The User Interface Compiler ($Id: qt/main.cpp 3.3.7 edited Aug 31 2005 $) +** +** WARNING! All changes made in this file will be lost! +****************************************************************************/ + +#include "klc.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "./klc.ui.h" + +/* + * Constructs a KLC as a child of 'parent', with the + * name 'name' and widget flags set to 'f'. + */ +KLC::KLC( QWidget* parent, const char* name, WFlags fl ) + : QWidget( parent, name, fl ) +{ + if ( !name ) + setName( "KLC" ); + KLCLayout = new QGridLayout( this, 1, 1, 11, 6, "KLCLayout"); + + layout1 = new QHBoxLayout( 0, 0, 6, "layout1"); + spacer1 = new QSpacerItem( 371, 26, QSizePolicy::Expanding, QSizePolicy::Minimum ); + layout1->addItem( spacer1 ); + + pushApply = new QPushButton( this, "pushApply" ); + layout1->addWidget( pushApply ); + + pushClose = new QPushButton( this, "pushClose" ); + layout1->addWidget( pushClose ); + + KLCLayout->addMultiCellLayout( layout1, 2, 2, 0, 1 ); + + listDisabled = new QListView( this, "listDisabled" ); + listDisabled->addColumn( tr2i18n( "..." ) ); + listDisabled->setEnabled( FALSE ); + listDisabled->setAllColumnsShowFocus( TRUE ); + listDisabled->setResizeMode( QListView::AllColumns ); + + KLCLayout->addWidget( listDisabled, 1, 1 ); + + textLabel1_2 = new QLabel( this, "textLabel1_2" ); + + KLCLayout->addWidget( textLabel1_2, 0, 1 ); + + textLabel1 = new QLabel( this, "textLabel1" ); + + KLCLayout->addWidget( textLabel1, 0, 0 ); + + listEnabled = new QListView( this, "listEnabled" ); + listEnabled->addColumn( tr2i18n( "..." ) ); + listEnabled->setEnabled( FALSE ); + listEnabled->setAllColumnsShowFocus( TRUE ); + listEnabled->setResizeMode( QListView::AllColumns ); + + KLCLayout->addWidget( listEnabled, 1, 0 ); + languageChange(); + resize( QSize(586, 425).expandedTo(minimumSizeHint()) ); + clearWState( WState_Polished ); + + // signals and slots connections + connect( pushApply, SIGNAL( clicked() ), this, SLOT( slotApply() ) ); + connect( pushClose, SIGNAL( clicked() ), this, SLOT( close() ) ); + + // tab order + setTabOrder( listEnabled, listDisabled ); + setTabOrder( listDisabled, pushApply ); + setTabOrder( pushApply, pushClose ); + init(); +} + +/* + * Destroys the object and frees any allocated resources + */ +KLC::~KLC() +{ + destroy(); + // no need to delete child widgets, Qt does it all for us +} + +/* + * Sets the strings of the subwidgets using the current + * language. + */ +void KLC::languageChange() +{ + setCaption( tr2i18n( "Codec manager" ) ); + pushApply->setText( tr2i18n( "Apply" ) ); + pushClose->setText( tr2i18n( "Close" ) ); + listDisabled->header()->setLabel( 0, tr2i18n( "..." ) ); + textLabel1_2->setText( tr2i18n( "Select codecs to enable:" ) ); + textLabel1->setText( tr2i18n( "Select codecs to disable:" ) ); + listEnabled->header()->setLabel( 0, tr2i18n( "..." ) ); +} + +#include "klc.moc" diff --git a/ksquirrel/ksquirrel-libs-configurator/klc.ui b/ksquirrel/ksquirrel-libs-configurator/klc.ui new file mode 100644 index 0000000..1182396 --- /dev/null +++ b/ksquirrel/ksquirrel-libs-configurator/klc.ui @@ -0,0 +1,190 @@ + +KLC + + + KLC + + + + 0 + 0 + 586 + 425 + + + + Codec manager + + + + unnamed + + + + layout1 + + + + unnamed + + + + spacer1 + + + Horizontal + + + Expanding + + + + 371 + 26 + + + + + + pushApply + + + Apply + + + + + pushClose + + + Close + + + + + + + + ... + + + true + + + true + + + + listDisabled + + + false + + + true + + + AllColumns + + + + + textLabel1_2 + + + <b>Select codecs to enable:</b> + + + + + textLabel1 + + + <b>Select codecs to disable:</b> + + + + + + ... + + + true + + + true + + + + listEnabled + + + false + + + true + + + AllColumns + + + + + + + pushApply + clicked() + KLC + slotApply() + + + pushClose + clicked() + KLC + close() + + + + listEnabled + listDisabled + pushApply + pushClose + + + kfileitem.h + kurl.h + kdirlister.h + kio/job.h + qheader.h + qtimer.h + kio/netaccess.h + kapplication.h + dcopclient.h + klc.ui.h + + + class KDirLister; + namespace KIO { class Job; } + + + KURL base, backup; + KDirLister *lister; + QString backupDir; + bool changed; + + + slotLoad() + slotApply() + slotCompleted( const KURL & u ) + slotNewItems( const KFileItemList & list ) + slotDeleteItem( KFileItem * fi ) + slotDelResult( KIO::Job * job ) + + + init() + destroy() + moveCodecs( bool e2d ) + closeEvent( QCloseEvent * ev ) + + + diff --git a/ksquirrel/ksquirrel-libs-configurator/klc.ui.h b/ksquirrel/ksquirrel-libs-configurator/klc.ui.h new file mode 100644 index 0000000..46b1bb3 --- /dev/null +++ b/ksquirrel/ksquirrel-libs-configurator/klc.ui.h @@ -0,0 +1,156 @@ +/**************************************************************************** +** ui.h extension file, included from the uic-generated form implementation. +** +** If you want to add, delete, or rename functions or slots, use +** Qt Designer to update this file, preserving your code. +** +** You should not define a constructor or destructor in this file. +** Instead, write your code in functions called init() and destroy(). +** These will automatically be called by the form's constructor and +** destructor. +*****************************************************************************/ + +void KLC::init() +{ + changed = false; + + listEnabled->setSorting(0); + listEnabled->header()->hide(); + + listDisabled->setSorting(0); + listDisabled->header()->hide(); + + lister = new KDirLister; + connect(lister, SIGNAL(completed(const KURL &)), this, SLOT(slotCompleted(const KURL &))); + connect(lister, SIGNAL(deleteItem(KFileItem *)), this, SLOT(slotDeleteItem(KFileItem *))); + connect(lister, SIGNAL(newItems(const KFileItemList &)), this, SLOT(slotNewItems(const KFileItemList &))); + + base = KURL::fromPathOrURL(SQ_KLIBS); + + backup = base; + backup.addPath("backup"); + + backupDir = backup.path(); + + KIO::NetAccess::mkdir(backup, this); + + QTimer::singleShot(0, this, SLOT(slotLoad())); +} + +void KLC::slotLoad() +{ + lister->openURL(base); + lister->openURL(backup, true); +} + +void KLC::destroy() +{ + delete lister; +} + +void KLC::slotApply() +{ + changed = true; + + moveCodecs(true); + moveCodecs(false); +} + +void KLC::moveCodecs(bool e2d) +{ + KURL::List list; + KURL codec; + + QListViewItemIterator it(e2d ? listEnabled : listDisabled); + QCheckListItem *li; + + while((li = static_cast(it.current()))) + { + if(li->isOn()) + { + codec = e2d ? base : backup; + codec.addPath(li->text()); + list.append(codec); + } + + ++it; + } + + KIO::Job *job = KIO::move(list, e2d ? backup : base); + + connect(job, SIGNAL(result(KIO::Job *)), this, SLOT(slotDelResult(KIO::Job *))); +} + +void KLC::slotCompleted(const KURL &u) +{ + if(u == base) + { + listEnabled->setEnabled(true); + listEnabled->setCurrentItem(listEnabled->firstChild()); + } + else + { + listDisabled->setEnabled(true); + listDisabled->setCurrentItem(listDisabled->firstChild()); + } +} + +void KLC::slotNewItems(const KFileItemList &list) +{ + KFileItemListIterator it(list); + KFileItem *fi; + QString soname = QString::fromLatin1(".so.%1").arg(SQ_KL_VER); + + while((fi = it.current())) + { + if(fi->isFile() && fi->name().endsWith(soname)) + new QCheckListItem(fi->url().directory().startsWith(backupDir) ? listDisabled:listEnabled, fi->name(), QCheckListItem::CheckBox); + + ++it; + } +} + +void KLC::slotDeleteItem(KFileItem *fi) +{ + QListView *l = fi->url().directory().startsWith(backupDir) ? listDisabled:listEnabled; + + QListViewItemIterator it(l); + QCheckListItem *li; + QListViewItem *li2; + + while((li = static_cast(it.current()))) + { + if(li->text() == fi->name()) + { + li2 = li->itemBelow(); + + if(!li2) + li2 = li->itemAbove(); + + delete li; + + l->setCurrentItem(li2); + l->setSelected(li2, true); + + return; + } + + ++it; + } +} + +void KLC::slotDelResult(KIO::Job *job) +{ + if(job && job->error()) + job->showErrorDialog(this); +} + +void KLC::closeEvent(QCloseEvent *ev) +{ + QString data; + + if(changed) + kapp->dcopClient()->send("ksquirrel", "ksquirrel", "reload_codecs()", data); + + ev->accept(); +} diff --git a/ksquirrel/ksquirrel-libs-configurator/ksquirrel-libs-configurator b/ksquirrel/ksquirrel-libs-configurator/ksquirrel-libs-configurator new file mode 100755 index 0000000..f514027 --- /dev/null +++ b/ksquirrel/ksquirrel-libs-configurator/ksquirrel-libs-configurator @@ -0,0 +1,3 @@ +#!/bin/sh + +kdesu --nonewdcop -c ksquirrel-libs-configurator-real \ No newline at end of file diff --git a/ksquirrel/ksquirrel-libs-configurator/main.cpp b/ksquirrel/ksquirrel-libs-configurator/main.cpp new file mode 100644 index 0000000..241ec3b --- /dev/null +++ b/ksquirrel/ksquirrel-libs-configurator/main.cpp @@ -0,0 +1,61 @@ +/*************************************************************************** + main.cpp - description + ------------------- + begin : Dec 03 2007 + copyright : (C) 2007 by Baryshev Dmitry + email : ksquirrel.iv@gmail.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#include +#include +#include +#include +#include + +#include "klc.h" + +static KCmdLineOptions options[] = +{ + KCmdLineLastOption +}; + +int main(int argc, char *argv[]) +{ + const QCString App = "ksquirrel-libs-configurator"; + + KAboutData aboutData( + "ksquirrel-libs-configurator", + "ksquirrel-libs-configurator", + "0.1", + I18N_NOOP("ksquirrel-libs-configurator"), + KAboutData::License_GPL, + "(c) 2007 Baryshev Dmitry", + QString::null, + "http://ksquirrel.sourceforge.net", + "ksquirrel.iv@gmail.com"); + + KCmdLineArgs::init(argc, argv, &aboutData); + KCmdLineArgs::addCmdLineOptions(options); + + KApplication app; + + KGlobal::locale()->insertCatalogue("ksquirrel"); + KGlobal::locale()->setActiveCatalogue("ksquirrel"); + + KLC *klc = new KLC(0, App); + + app.setMainWidget(klc); + + klc->show(); + + return app.exec(); +} diff --git a/ksquirrel/ksquirrel.cpp b/ksquirrel/ksquirrel.cpp new file mode 100644 index 0000000..216c02b --- /dev/null +++ b/ksquirrel/ksquirrel.cpp @@ -0,0 +1,2216 @@ +/*************************************************************************** + ksquirrel.cpp - description + ------------------- + begin : Dec 10 2003 + copyright : (C) 2003 by Baryshev Dmitry + email : ksquirrel.iv@gmail.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "ksquirrel.h" +#include "sq_iconloader.h" +#include "sq_widgetstack.h" +#include "sq_treeview.h" +#include "sq_options.h" +#include "sq_glview.h" +#include "sq_glwidget.h" +#include "sq_libraryhandler.h" +#include "sq_externaltool.h" +#include "sq_externaltools.h" +#include "sq_config.h" +#include "sq_filters.h" +#include "sq_bookmarkowner.h" +#include "sq_hloptions.h" +#include "sq_pixmapcache.h" +#include "sq_thumbnailsize.h" +#include "sq_pixmapcache.h" +#include "sq_archivehandler.h" +#include "sq_dir.h" +#include "sq_dirthumbs.h" +#include "sq_thumbnailloadjob.h" +#include "sq_navigatordropmenu.h" +#include "sq_errorstring.h" +#include "sq_thumbnailcachemaster.h" +#include "sq_glwidget_helpers.h" +#include "sq_pluginsinfo.h" +#include "sq_imageloader.h" +#include "sq_multibar.h" +#include "sq_glinfo.h" +#include "sq_splashscreen.h" +#include "sq_previewwidget.h" +#include "sq_progress.h" +#include "sq_thumbnailsunused.h" +#include "sq_downloader.h" +#include "sq_dragprovider.h" + +#include "sq_slideshow.h" +#include "sq_slideshowwidget.h" +#include "sq_slideshowlisting.h" +#include "sq_categoriesview.h" +#include "sq_mountview.h" +#include "sq_imagebasket.h" +#include "sq_directorybasket.h" +#include "sq_converter.h" + +#ifdef SQ_HAVE_KIPI +#include "sq_kipimanager.h" +#endif + +#include +#include + +static const int menuParam = 100000; + +KSquirrel * KSquirrel::m_instance = 0; + +KSquirrel::KSquirrel(QWidget *parent, const char *name) + : KMainWindow (parent, name), DCOPObject(name) +{ + // singleton setup + m_instance = this; + + kdDebug() << "+KSquirrel" << endl; + + slideShowStop = true; + slideShowPaused = false; + m_intray = false; + waitForShow = true; + m_demo = false; + + writeDefaultEntries(); + + // create KConfig instance. + // It will help us to read and write config entries + kconf = new SQ_Config(this); + + old_id = 0; + + kconf->setGroup("Thumbnails"); + + thumbSize = new SQ_ThumbnailSize(this, static_cast(kconf->readNumEntry("size", + SQ_ThumbnailSize::Large))); + thumbSize->setExtended(kconf->readBoolEntry("extended", false)); + + sqFiltersName = 0; + pCurrentURL = 0; + mainPage = 0; + + SQ_SplashScreen::advance(); + + fillMessages(); + + preCreate(); +} + +KSquirrel::~KSquirrel() +{ + kdDebug() << "-KSquirrel" << endl; + + delete sqFiltersExt; + delete sqFiltersName; + delete gl_view; + delete kconf; +} + +/* + * Restore saved position & size + */ +void KSquirrel::handlePositionSize() +{ + QPoint p_def(0,0); + QSize sz_def(800, 600); + + kconf->setGroup("Interface"); + + QPoint p = SQ_Config::instance()->readPointEntry("pos", &p_def); + QSize sz = SQ_Config::instance()->readSizeEntry("size", &sz_def); + + resize(sz); + move(p); +} + +/* + * Invoke 'Options' dialog. + */ +void KSquirrel::slotOptions() +{ + // create dialog + SQ_Options optd(this, "sq_options", true); + + kconf->setGroup("Fileview"); + old_disable = kconf->readBoolEntry("disable_dirs", false); + old_calc = kconf->readBoolEntry("calculate", true); + + kconf->setGroup("Thumbnails"); + + kconf->setGroup("GL view"); + old_marks = kconf->readBoolEntry("marks", true); + + // if user clicked "OK", apply new settings + if(optd.start() == QDialog::Accepted) + { + applyDefaultSettings(); + + if(SQ_HLOptions::instance()->have_mountview) + SQ_MountView::instance()->setupColumns(); + + SQ_TreeView::instance()->setupRecursion(); + SQ_PreviewWidget::instance()->rereadColor(); + SQ_PreviewWidget::instance()->update(); + emit resetToolTip(); + + // create or delete animated logo + configAnime(false); + } +} + +bool KSquirrel::eventFilter(QObject *o, QEvent *e) +{ + if(o == mainPage && e->type() == QEvent::Show) + { + // delayed init, hehe... + if(waitForShow) + { + kdDebug() << "Creating additional widgets..." << endl; + + kconf->setGroup("Thumbnails"); + SQ_PixmapCache::instance()->setCacheLimit(kconf->readNumEntry("cache", 1024*10)); + +#ifdef SQ_HAVE_KIPI + kconf->setGroup("Main"); + + // load KIPI plugins on demand ? + if(!kconf->readBoolEntry("kipi_ondemand", true)) + kipiManager->loadPlugins(); +#endif + + if(SQ_HLOptions::instance()->have_mountview) + { + sideBar->addWidget(new SQ_MountView, i18n("Mount points"), "blockdevice"); + connect(SQ_MountView::instance(), SIGNAL(path(const QString &)), pWidgetStack, SLOT(setURLForCurrent(const QString &))); + } + + if(SQ_HLOptions::instance()->have_categories) + sideBar->addWidget(new SQ_CategoriesBox, i18n("Categories"), "bookmark"); + + if(SQ_HLOptions::instance()->have_imagebasket) + sideBar->addWidget(new SQ_ImageBasket, i18n("Image basket"), "folder_image"); + + if(SQ_HLOptions::instance()->have_directorybasket) + sideBar->addWidget(new SQ_DirectoryBasket, i18n("Folder basket"), "folder"); + + kconf->setGroup("Interface"); + + // restore opened page in sidebar + int pg = kconf->readNumEntry("last page", -1); + + QPushButton *b = sideBar->multiBar()->tab(pg); + + if(pg >= 0 && !b) + { + pg = 0; + b = sideBar->multiBar()->tab(0); + kconf->writeEntry("last page", 0); + } + + if(pg >= 0 && b) + b->animateClick(); + + waitForShow = false; + } + } + + return false; +} + +/* + * Catches close events. + */ +void KSquirrel::closeEvent(QCloseEvent *ev) +{ + kconf->setGroup("Main"); + + if((m_demo && !m_intray) || kapp->sessionSaving()) + { + // finalActions() called by slotSaveYourself() + if(!kapp->sessionSaving()) + finalActions(); + + ev->accept(); + } + else + { + // Minimize to tray ? + if(kconf->readBoolEntry("minimize to tray", false) || m_intray) + { + // Yes, let's hide to tray + slotGotoTray(); + // ignore close event + ev->ignore(); + } + else // No, close app + { + // do final stuff + finalActions(); + // accept close event - exit + ev->accept(); + } + } +} + +// Show List view +void KSquirrel::slotRaiseListView() +{ + pWidgetStack->raiseWidget(SQ_DirOperator::TypeList); +} + +// Show icon view +void KSquirrel::slotRaiseIconView() +{ + pWidgetStack->raiseWidget(SQ_DirOperator::TypeIcons); +} + +// Show Detailed view +void KSquirrel::slotRaiseDetailView() +{ + pWidgetStack->raiseWidget(SQ_DirOperator::TypeDetailed); +} + +// Show Thumbnail view +void KSquirrel::slotRaiseThumbView() +{ + pWidgetStack->raiseWidget(SQ_DirOperator::TypeThumbs); +} + +// Create location toolbar +void KSquirrel::createLocationToolbar(KToolBar *pTLocation) +{ + // create new KHistoryCombo + pCurrentURL = new KHistoryCombo(true, pTLocation, "history combobox"); + + // some additional setup + pTLocation->setFullSize(); + pTLocation->insertButton("button_cancel", 0, SIGNAL(clicked()), pCurrentURL, SLOT(clearHistory()), true, i18n("Clear history")); + pTLocation->insertButton("locationbar_erase", 1, SIGNAL(clicked()), pCurrentURL, SLOT(clearEdit()), true, i18n("Clear address")); + pTLocation->insertWidget(2, 10, new QLabel("URL:", pTLocation, "kde toolbar widget")); + pTLocation->setItemAutoSized(2); + pTLocation->insertWidget(3, 10, pCurrentURL); + pTLocation->setItemAutoSized(3); + pTLocation->insertButton("goto", 4, SIGNAL(clicked()), this, SLOT(slotGo()), true, i18n("Go!")); + + kconf->setGroup("History"); + + // some additional setup + + pCurrentURL->setPixmapProvider(KonqPixmapProvider::self()); + pCurrentURL->setCompletionObject(new KURLCompletion(KURLCompletion::DirCompletion)); + pCurrentURL->setDuplicatesEnabled(false); + pCurrentURL->setSizeLimit(20); + pCurrentURL->setHistoryItems(kconf->readListEntry("items"), true); +} + +// Create menu with filters +void KSquirrel::initFilterMenu() +{ + QString ext, tmp; + unsigned int i = menuParam; + + QString last; + + kconf->setGroup("Filters"); + + // create QStringLists with names and extensions + // of custom filters + if(!sqFiltersName) + { + sqFiltersName = new QStringList(kconf->readListEntry("items")); + sqFiltersExt = new QStringList(kconf->readListEntry("extensions")); + + // last used filter + last = kconf->readEntry("last", "*"); + + // allow user to check/uncheck menuitems + actionFilterMenu->setCheckable(true); + } + else // if QStringLists already exist + last = pWidgetStack->nameFilter(); + + actionFilterMenu->clear(); + int id, Id = old_id; + bool both = kconf->readBoolEntry("menuitem both", true); + QStringList quickInfo; + + // Get extensions and names of libraries' filters + libhandler->allFilters(libFilters, quickInfo); + + actionFilterMenu->insertTitle(i18n("Libraries' filters")); + + // insert libraries' filters to menu + for(QValueList::iterator it = libFilters.begin(), it1 = quickInfo.begin(); + it != libFilters.end();++it, ++it1) + { + // show both name and extension ? + if(both) + id = actionFilterMenu->insertItem(*it1 + " (" + *it + ')'); + else + id = actionFilterMenu->insertItem(*it1); + + actionFilterMenu->setItemParameter(id, i++); + + if(last == *it && !last.isEmpty()) + Id = id; + } + + // all filters' extension in one string + QString allF = libhandler->allFiltersString(); + + libFilters.append(allF); + + id = actionFilterMenu->insertItem(i18n("All supported formats")); + actionFilterMenu->setItemParameter(id, i++); + + if(last == allF && !last.isEmpty()) + Id = id; + + QValueList::iterator nEND = sqFiltersName->end(); + QValueList::iterator it_name = sqFiltersName->begin(); + QValueList::iterator it_ext = sqFiltersExt->begin(); + + actionFilterMenu->insertTitle(i18n("User's filters")); + i = 0; +// actionFilterMenu->setItemParameter(id, i++); + + // add custom filters + for(;it_name != nEND;it_name++,it_ext++) + { + if(both) + id = actionFilterMenu->insertItem(*it_name + " (" + *it_ext + ')'); + else + id = actionFilterMenu->insertItem(*it_name); + + if(last == *it_ext && !last.isEmpty()) + Id = id; + + actionFilterMenu->setItemParameter(id, i++); + } + + disconnect(actionFilterMenu, SIGNAL(activated(int)), 0, 0); + connect(actionFilterMenu, SIGNAL(activated(int)), this, SLOT(slotSetFilter(int))); + + // finally, set current filter + setFilter(last, Id); +} + +// "Go" clicked in url box +void KSquirrel::slotGo() +{ + pWidgetStack->setURLForCurrent(pCurrentURL->currentText()); +} + +// Set filter for a filemanager and check appropriate +// menuitem (by 'id') +void KSquirrel::setFilter(const QString &f, const int id) +{ + if(pWidgetStack->nameFilter() != f) + pWidgetStack->setNameFilter(f); + +// actionFilterMenu->setItemChecked(old_id, false); + actionFilterMenu->setItemChecked(id, true); + old_id = id; +} + +// User seleced some filter from menu +void KSquirrel::slotSetFilter(int id) +{ + // uncheck old item being checked + actionFilterMenu->setItemChecked(old_id, false); + + // new item's index + int index = actionFilterMenu->itemParameter(id); + + QString filt; + + // Is it libraries' filter or custom ? + if(index >= menuParam) + filt = libFilters[index - menuParam]; + else + filt = (*sqFiltersExt)[index]; + + // If new filter differences from current - + // let's apply it + if(pWidgetStack->nameFilter() != filt) + pWidgetStack->setNameFilter(filt); + + // finally, check new item + actionFilterMenu->setItemChecked(id, true); + old_id = id; +} + +// Create all widgets (toolbar, menubar, image window ...) +void KSquirrel::createWidgets(int createFirst) +{ + // check if location toolbar should be separated + m_urlbox = kconf->readBoolEntry("has_url", false); + + // main QVBox + mainPage = new QVBox(this, QString::fromLatin1("SQ_BROWSER_VBOX")); + mainPage->resize(size()); + + SQ_SplashScreen::advance(); + + mainPage->installEventFilter(this); + + // menubar & toolbar + menubar = new KMenuBar(mainPage); + tools = new KToolBar(mainPage); + + // location toolbar + pTLocation = new KToolBar(mainPage, QString::fromLatin1("Location toolbar")); + pTLocation->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Minimum); + + // main splitter + mainView = new QSplitter(QSplitter::Horizontal, mainPage); Q_ASSERT(mainView); + + KStatusBar *s = new KStatusBar(mainPage); + + createLocationToolbar(pTLocation); + createStatusBar(s); + + new SQ_NavigatorDropMenu(this); + + sideBar = new SQ_MultiBar(mainView); + + SQ_SplashScreen::advance(); + + // create widgetstack containing views + pWidgetStack = new SQ_WidgetStack(mainView, createFirst); + + kconf->setGroup("Interface"); + QValueList sz = SQ_Config::instance()->readIntListEntry("splitter"); + + if(sz.count() != 2) + { + sz.clear(); + sz.append(1500); + sz.append(3500); + } + + mainView->setSizes(sz); + + SQ_SplashScreen::advance(); + + ptree = new SQ_TreeView; + + SQ_SplashScreen::advance(); + + sideBar->addWidget(ptree, i18n("Folder tree"), "view_tree"); + sideBar->updateLayout(); + + connect(ptree, SIGNAL(urlAdded(const KURL &)), pWidgetStack->diroperator(), SLOT(urlAdded(const KURL &))); + connect(ptree, SIGNAL(urlRemoved(const KURL &)), pWidgetStack->diroperator(), SLOT(urlRemoved(const KURL &))); + connect(pWidgetStack->diroperator(), SIGNAL(urlEntered(const KURL &)), ptree, SLOT(slotClearChecked())); + connect(pWidgetStack, SIGNAL(newLastURL(const QString &)), pWidgetStack->action("dirop_repeat"), SLOT(setText(const QString &))); + connect(SQ_PreviewWidget::instance(), SIGNAL(first()), pWidgetStack, SLOT(slotSelectFirstFile())); + connect(SQ_PreviewWidget::instance(), SIGNAL(last()), pWidgetStack, SLOT(slotSelectLastFile())); + connect(SQ_PreviewWidget::instance(), SIGNAL(next()), this, SLOT(slotPreviewWidgetNext())); + connect(SQ_PreviewWidget::instance(), SIGNAL(previous()), this, SLOT(slotPreviewWidgetPrevious())); + connect(SQ_PreviewWidget::instance(), SIGNAL(execute()), this, SLOT(slotPreviewWidgetExecute())); + + pWidgetStack->init(); + + pTLocation->setShown(m_urlbox); + pAURL->setChecked(m_urlbox); + mainPage->setStretchFactor(mainView, 1); + + // connect signals from location toolbar + connect(pCurrentURL, SIGNAL(returnPressed(const QString&)), pWidgetStack, SLOT(setURLForCurrent(const QString&))); + connect(pCurrentURL, SIGNAL(activated(const QString&)), pWidgetStack, SLOT(setURLForCurrent(const QString&))); + + gl_view = new SQ_GLView; + + SQ_SplashScreen::advance(); + +// KIPI support +#ifdef SQ_HAVE_KIPI + kipiManager = new SQ_KIPIManager(this); +#endif + + // insert actions in toolbar and menu + createToolbar(tools); + createMenu(menubar); + + switch(createFirst) + { + case 1: pARaiseIconView->setChecked(true); break; + case 2: pARaiseDetailView->setChecked(true); break; + case 3: pARaiseThumbView->setChecked(true); break; + + default: + pARaiseListView->setChecked(true); + } + + // connect signals from widgets + connect(pAURL, SIGNAL(toggled(bool)), pTLocation, SLOT(setShown(bool))); + connect(pASelectGroup, SIGNAL(activated()), pWidgetStack, SLOT(slotSelectGroup())); + connect(pADeselectGroup, SIGNAL(activated()), pWidgetStack, SLOT(slotDeselectGroup())); + connect(pASelectAll, SIGNAL(activated()), pWidgetStack, SLOT(slotSelectAll())); + connect(pADeselectAll, SIGNAL(activated()), pWidgetStack, SLOT(slotDeselectAll())); + + SQ_SplashScreen::advance(); + +#if 0 + KWin::setState(gl_view->winId(), NET::SkipTaskbar | NET::SkipPager); +#endif +} + +// Create statusbar and all needed QLabels +void KSquirrel::createStatusBar(KStatusBar *bar) +{ + sbar = bar; + sbar->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); + sbar->setSizeGripEnabled(true); + sbar->show(); + + // directory information (for example "3 dirs, 12 files") + dirInfo = new QLabel(QString::null, sbar, "dirInfo"); + + QHBox *vb = new QHBox(sbar); + + // mime icon of current file + fileIcon = new QLabel(QString::null, vb, "fileIcon"); + fileIcon->setScaledContents(false); + + // name of current file + fileName = new KSqueezedTextLabel(QString::fromLatin1("----"), vb, "fileName"); + fileName->setTextFormat(Qt::RichText); + fileName->setAlignment(Qt::AlignAuto | Qt::AlignVCenter | Qt::ExpandTabs); + + diskSpace = new QLabel(QString::null, sbar, "diskSpace"); + + // insert pointers to map, now it is possible + // to call KSquirrel::sbarWidget(name) + sbarwidgets["dirInfo"] = dirInfo; + sbarwidgets["fileIcon"] = fileIcon; + sbarwidgets["fileName"] = fileName; + sbarwidgets["diskSpace"] = diskSpace; + + // finally, add QLabels to statusbar + sbar->addWidget(dirInfo, 0, true); + sbar->addWidget(vb, 1, true); + + QToolButton *fireDisk = new QToolButton(sbar, "reload disk size"); + fireDisk->setIconSet(SQ_IconLoader::instance()->loadIcon("reload", KIcon::Desktop, KIcon::SizeSmall)); + fireDisk->setTextLabel(i18n("Reload")); + fireDisk->setUsesTextLabel(false); + connect(fireDisk, SIGNAL(clicked()), this, SLOT(slotFireDisk())); + + diskProg = new SQ_Progress(sbar, "SQ_Progress [disk space]"); + diskProg->setFixedWidth(150); + + sbar->addWidget(fireDisk, 0, true); + sbar->addWidget(diskSpace, 0, true); + sbar->addWidget(diskProg, 0, true); +} + +void KSquirrel::slotFireDisk() +{ + pWidgetStack->diroperator()->fireDiskSize(pWidgetStack->diroperator()->url()); +} + +// Create menu +void KSquirrel::createMenu(KMenuBar *menubar) +{ + pop_file = new KPopupMenu(menubar); + pop_view = new KPopupMenu(menubar); + pop_action = new KPopupMenu(menubar); + pop_nav = new KPopupMenu(menubar); + + // create bookmarks and filters + initBookmarks(); + initFilterMenu(); + + // inset new submenus + menubar->insertItem(i18n("&File"), pop_file); + menubar->insertItem(i18n("&View"), pop_view); + menubar->insertItem(i18n("&Navigator"), pop_nav); + menubar->insertItem(i18n("&Action"), pop_action); + +#ifdef SQ_HAVE_KIPI + menubar->insertItem(i18n("&KIPI Plugins"), kipiManager->popup()); +#endif + + bookmarks->plug(menubar); + menubar->insertItem(i18n("&Help"), helpMenu()); + + // plug actions to menus + pAOpen->plug(pop_file); + pAOpenAndSet->plug(pop_file); + pop_file->insertSeparator(); + pARename->plug(pop_file); + pWidgetStack->action("properties")->plug(pop_file); + pWidgetStack->action("delete")->plug(pop_file); + pop_file->insertSeparator(); + pAExit->plug(pop_file); + + pWidgetStack->action("home")->plug(pop_nav); + pWidgetStack->action("up")->plug(pop_nav); + pWidgetStack->action("back")->plug(pop_nav); + pWidgetStack->action("forward")->plug(pop_nav); + pWidgetStack->action("mkdir")->plug(pop_nav); + pop_nav->insertSeparator(); + pWidgetStack->action("show hidden")->plug(pop_nav); + pop_nav->insertSeparator(); + pASelectAll->plug(pop_nav); + pADeselectAll->plug(pop_nav); + pASelectGroup->plug(pop_nav); + pADeselectGroup->plug(pop_nav); + pop_nav->insertSeparator(); + pop_nav->insertItem(i18n("Fi<er"), actionFilterMenu); + + pAGotoTray->plug(pop_view); + pop_view->insertSeparator(); + pARaiseListView->plug(pop_view); + pARaiseIconView->plug(pop_view); + pARaiseDetailView->plug(pop_view); + pARaiseThumbView->plug(pop_view); + pop_view->insertSeparator(); + pAURL->plug(pop_view); + + pASlideShow->plug(pop_action); + pASlideShowDialog->plug(pop_action); + pop_action->insertSeparator(); + + pATCMaster->plug(pop_action); + pARescan->plug(pop_action); + pAExtTools->plug(pop_action); + pAFilters->plug(pop_action); + pAPluginsInfo->plug(pop_action); + pAPluginsDel->plug(pop_action); + pAGLInfo->plug(pop_action); + pop_action->insertSeparator(); + pAConfigure->plug(pop_action); +} + +// Create toolbar +void KSquirrel::createToolbar(KToolBar *tools) +{ + pWidgetStack->action("back")->plug(tools); + pWidgetStack->action("forward")->plug(tools); + pWidgetStack->action("up")->plug(tools); + pWidgetStack->action("home")->plug(tools); + pWidgetStack->action("dirop_repeat")->plug(tools); + + pASlideShow->plug(tools); + + tools->insertLineSeparator(); + pARaiseListView->plug(tools); + pARaiseIconView->plug(tools); + pARaiseDetailView->plug(tools); + pARaiseThumbView->plug(tools); + pAThumbs->plug(tools); + + tools->insertLineSeparator(); + pAGLView->plug(tools); + pAExtTools->plug(tools); + pAFilters->plug(tools); + + tools->insertLineSeparator(); + pAURL->plug(tools); + pAConfigure->plug(tools); + pAExit->plug(tools); + + // insert animated widget + configAnime(); +} + +// Create all KActions +void KSquirrel::createActions() +{ + pAThumbs = new KActionMenu(i18n("Thumbnail size"), "thumbnail"); + pAExit = KStdAction::quit(this, SLOT(slotClose()), actionCollection(), "SQ close"); + pAConfigure = KStdAction::preferences(this, SLOT(slotOptions()), actionCollection(), "SQ Configure"); + pAGLView = new KAction(i18n("Image window"), "raise", CTRL+Qt::Key_I, this, SLOT(raiseGLWidget()), actionCollection(), "SQ gl view widget"); + pARescan = KStdAction::redisplay(this, SLOT(slotRescan()), actionCollection(), "SQ rescan libraries"); + pARescan->setText(i18n("Reload codecs from disk")); + pAExtTools = new KAction(i18n("Configure external tools..."), "launch", 0, this, SLOT(slotExtTools()), actionCollection(), "SQ external tools"); + pAFilters = new KAction(i18n("Configure filters..."), "filefind", 0, this, SLOT(slotFilters()), actionCollection(), "SQ filters"); + pAGotoTray = new KAction(i18n("Go to tray"), "background", CTRL+Qt::Key_T, this, SLOT(slotGotoTray()), actionCollection(), "SQ goto tray"); + pAOpenAndSet = new KAction(i18n("Open file and change directory"), "fileopen", CTRL+ALT+Qt::Key_O, this, SLOT(slotOpenFileAndSet()), actionCollection(), "SQ open and set"); + pAOpen = new KAction(i18n("Open file"), "fileopen", CTRL+Qt::Key_O, this, SLOT(slotOpenFile()), actionCollection(), "SQ open file"); + pATCMaster = new KAction(i18n("Thumbnail cache manager..."), "cache", 0, this, SLOT(slotTCMaster()), actionCollection(), "SQ TC Master"); + pASelectAll = KStdAction::selectAll(0, 0, actionCollection(), "SQ Select All"); + pADeselectAll = KStdAction::deselect(0, 0, actionCollection(), "SQ Deselect All"); + + pARaiseListView = new KRadioAction(i18n("List"), "view_multicolumn", 0, this, SLOT(slotRaiseListView()), actionCollection(), "SQ raise list view"); + pARaiseIconView = new KRadioAction(i18n("Icons"), "view_icon", 0, this, SLOT(slotRaiseIconView()), actionCollection(), "SQ raise icon view"); + pARaiseDetailView = new KRadioAction(i18n("Details"), "view_detailed", 0, this, SLOT(slotRaiseDetailView()), actionCollection(), "SQ raise detailed view"); + pARaiseThumbView = new KRadioAction(i18n("Thumbnails"), "view_icon", 0, this, SLOT(slotRaiseThumbView()), actionCollection(), "SQ raise thumbs view"); + + pAURL = new KToggleAction(i18n("Show URL box"), "history", CTRL+Qt::Key_U, 0, 0, actionCollection(), "SQ toggle url box"); + + pASlideShow = new KAction(i18n("Slideshow"), "folder_video", CTRL+Qt::Key_S, this, SLOT(slotSlideShowStart()), actionCollection(), "SQ Slideshow"); + pASlideShowDialog = new KAction(i18n("Slideshow advanced"), 0, CTRL+ALT+Qt::Key_S, this, SLOT(slotSlideShowDialog()), actionCollection(), "SQ SlideShow Dialog"); + pARename = new KAction(i18n("Rename"), "file_move", Qt::Key_F2, this, SLOT(slotRename()), actionCollection(), "SQ Rename"); + pAPluginsInfo = new KAction(i18n("Codec information..."), "info", 0, this, SLOT(slotPluginsInfo()), actionCollection(), "SQ Plugins Info"); + pAPluginsDel = new KAction(i18n("Codec manager..."), 0, 0, this, SLOT(slotPluginsDel()), actionCollection(), "SQ Plugins Deleter"); + pAGLInfo = new KAction(i18n("OpenGL information..."), 0, 0, this, SLOT(slotGLInfo()), actionCollection(), "SQ OpenGL Info"); + + pAThumb1 = new KRadioAction(i18n("Medium thumbnails"), locate("data", "images/thumbs/thumbs_medium.png"), 0, this, SLOT(slotThumbsMedium()), actionCollection(), "SQ thumbs1"); + pAThumb2 = new KRadioAction(i18n("Large thumbnails"), locate("data", "images/thumbs/thumbs_large.png"), 0, this, SLOT(slotThumbsLarge()), actionCollection(), "SQ thumbs2"); + pAThumb3 = new KRadioAction(i18n("Huge thumbnails"), locate("data", "images/thumbs/thumbs_huge.png"), 0, this, SLOT(slotThumbsHuge()), actionCollection(), "SQ thumbs3"); + + pASelectGroup = new KAction(i18n("Select group"), "viewmag+", CTRL+Qt::Key_Plus, 0, 0, actionCollection(), "SQ Select Group"); + pADeselectGroup = new KAction(i18n("Deselect group"), "viewmag-", CTRL+Qt::Key_Minus, 0, 0, actionCollection(), "SQ Deselect Group"); + + const QString thumbs_size__ = QString::fromLatin1("thumbs_size__"); + pAThumb1->setExclusiveGroup(thumbs_size__); + pAThumb2->setExclusiveGroup(thumbs_size__); + pAThumb3->setExclusiveGroup(thumbs_size__); + + switch(thumbSize->value()) + { + case SQ_ThumbnailSize::Medium: pAThumb1->setChecked(true); break; + case SQ_ThumbnailSize::Large: pAThumb2->setChecked(true); break; + + default: pAThumb3->setChecked(true); + } + + pAThumbs->insert(pAThumb1); + pAThumbs->insert(pAThumb2); + pAThumbs->insert(pAThumb3); + pAThumbs->insert(new KActionSeparator(actionCollection())); + + pAThumbsE = new KToggleAction(i18n("Extended thumbnails"), "", CTRL+Qt::Key_E, 0, 0, actionCollection(), "SQ Extended thumbs"); + kconf->setGroup("Thumbnails"); + pAThumbsE->setChecked(kconf->readBoolEntry("extended", false)); + connect(pAThumbsE, SIGNAL(toggled(bool)), this, SLOT(slotExtendedToggled(bool))); + pAThumbs->insert(pAThumbsE); + + pAThumbs->setDelayed(false); + + QString raise_some_widget_from_stack = QString::fromLatin1("raise_some_widget_from_stack"); + pARaiseListView->setExclusiveGroup(raise_some_widget_from_stack); + pARaiseIconView->setExclusiveGroup(raise_some_widget_from_stack); + pARaiseDetailView->setExclusiveGroup(raise_some_widget_from_stack); + pARaiseThumbView->setExclusiveGroup(raise_some_widget_from_stack); +} + +// Goto tray +void KSquirrel::slotGotoTray() +{ + // show tray icon + tray->show(); + + // hide image window + gl_view->hide(); + + m_intray = true; + + // hide main window + hide(); +} + +// create external tools +void KSquirrel::initExternalTools() +{ + // create SQ_ExternalTool and create new + // popup menu with tools + extool = new SQ_ExternalTool(this); + extool->newPopupMenu(); +} + +// Edit custom filters +void KSquirrel::slotFilters() +{ + SQ_Filters f(this); + + if(f.start() != QDialog::Accepted) return; + + // Recreate menu with filters + initFilterMenu(); +} + +// Edit external tools +void KSquirrel::slotExtTools() +{ + SQ_ExternalTools etd(this, "sq_exttools", true); + + // If user clicked "OK", recreate menu with + // tools + if(etd.start() == QDialog::Accepted) + extool->newPopupMenu(); +} + +// Show image window +void KSquirrel::raiseGLWidget() +{ + // if image window is separate, just show and raise it + gl_view->show(); + gl_view->raise(); + KWin::forceActiveWindow(gl_view->winId()); + + if(SQ_GLWidget::window()->fullscreen()) + { + gl_view->statusbar()->setShown(false); + gl_view->boxBar()->setShown(false); + } +} + +// Hide image window +void KSquirrel::closeGLWidget() +{ + gl_view->hide(); + + if(m_demo) + { + finalActions(); + qApp->quit(); + } + else + { + kconf->setGroup("GL view"); + + if(kconf->readBoolEntry("closeall", false)) + SQ_GLWidget::window()->closeAllTabsFull(); + } +} + +// create bookmarks +void KSquirrel::initBookmarks() +{ + // locate bookmarks file + QString file = locate("data", "kfile/bookmarks.xml"); + + if(file.isEmpty()) + file = locateLocal("data", "kfile/bookmarks.xml"); + + KBookmarkManager *bmanager = KBookmarkManager::managerForFile(file, false); + bmanager->setUpdate(true); + bmanager->setShowNSBookmarks(false); + + SQ_BookmarkOwner *bookmarkOwner = new SQ_BookmarkOwner(this); + + // setup menu + bookmarks = new KActionMenu(i18n("&Bookmarks"), "bookmark", actionCollection(), "bookmarks"); + bookmarkMenu = new KBookmarkMenu(bmanager, bookmarkOwner, bookmarks->popupMenu(), actionCollection(), true); + + connect(bookmarkOwner, SIGNAL(openURL(const KURL&)), pWidgetStack, SLOT(setURLForCurrent(const KURL&))); + + bookmarkOwner->setURL(pWidgetStack->diroperator()->url()); +} + +// Create new config file in +// local directory (~/.kde/share/config) +void KSquirrel::writeDefaultEntries() +{ + KConfig conf("ksquirrelrc"); + + if(!conf.hasGroup("External tools")) + { + conf.setGroup("External tools"); + conf.writeEntry("names", "Run within KDE,View in hexadecimal mode,Print file,Set as wallpaper on desktop,Set as tiled wallpaper on desktop,Open with GIMP,Open with GQview,Open with ShowImg,Open with KuickShow,Open with KView,Open with Opera,Open with Konqueror,Open with KWrite"); + conf.writeEntry("commands", "kfmclient exec %f,khexedit %f,kprinter %f,dcop kdesktop KBackgroundIface setWallpaper %f 6,dcop kdesktop KBackgroundIface setWallpaper %f 2,gimp %F,gqview %F,showimg %F,kuickshow %F,kview %F,opera %F,konqueror %F,kwrite %F"); + conf.writeEntry("icons", "kfm,khexedit,kdeprintfax,mac,mac,gimp,gqview,showimg,kuickshow,kview,opera,konqueror,kwrite"); + } + + if(!conf.hasGroup("Filters")) + { + conf.setGroup("Filters"); + conf.writeEntry("extensions", "*,*.mpg *.mpeg *.avi *.asf *.divx,*.mp3 *.ogg *.wma *.wav *.it"); + conf.writeEntry("items", "All files,Video tapes,Audio files"); + conf.writeEntry("last", "*"); + conf.writeEntry("menuitem both", "false"); + } + + if(!conf.hasGroup("Navigator Icons")) + { + conf.setGroup("Navigator Icons"); + conf.writeEntry("ShowPreviews", "false"); + conf.writeEntry("ViewMode", "LargeRows"); + } + + if(!conf.hasGroup("Navigator List")) + { + conf.setGroup("Navigator List"); + conf.writeEntry("ShowPreviews", "false"); + conf.writeEntry("ViewMode", "SmallColumns"); + } + + conf.setGroup("Main"); + conf.writeEntry("version", VERSION); + + conf.sync(); +} + +// Apply settings +void KSquirrel::applyDefaultSettings() +{ + bool updateDirs; + + kconf->setGroup("GL view"); + + // set background color, zoom & move factors + SQ_GLWidget::window()->setClearColor(); + SQ_GLWidget::window()->updateFactors(); + + // Show/hide tickmarks if needed + if(old_marks != kconf->readBoolEntry("marks", true)) + SQ_GLWidget::window()->updateGLA(); + + gl_view->setupTabbar(); + + kconf->setGroup("Fileview"); + + // switching from 'off' to 'on' requires recalculating size + if(!old_calc && kconf->readBoolEntry("calculate", true)) + pWidgetStack->diroperator()->calcTotalSize(); + + updateDirs = (old_disable != kconf->readBoolEntry("disable_dirs", false)); + + updateDirs &= (bool)pWidgetStack->diroperator()->numDirs(); + + kconf->setGroup("Thumbnails"); + bool lazy = kconf->readBoolEntry("lazy", true); + int lazyDelay = kconf->readNumEntry("lazy_delay", 500); + int lazyRows = kconf->readNumEntry("rows", 2); + + pWidgetStack->updateGrid(updateDirs); + + // set cache limit for pixmap cache + SQ_PixmapCache::instance()->setCacheLimit(kconf->readNumEntry("cache", 1024*10)); + + kconf->setGroup("Main"); + + if(kconf->readBoolEntry("sync", false)) + kconf->sync(); + + pWidgetStack->diroperator()->setLazy(lazy, lazyDelay, lazyRows); + + // reload directory + if(updateDirs) + pWidgetStack->updateView(); +} + +void KSquirrel::slotExtendedToggled(bool e) +{ + thumbSize->setExtended(e); + pWidgetStack->diroperator()->slotSetThumbSize(SQ_ThumbnailSize::instance()->pixelSizeString()); +} + +// Toggle fullscreen state for image window +void KSquirrel::slotFullScreen(bool full) +{ + WId id = gl_view->winId(); + + kconf->setGroup("GL view"); + + // avoid automatic image resizing + gl_view->statusbar()->setShown(!full); + gl_view->boxBar()->setShown(!full); + + // goto fullscreen + if(full) + { + gl_view->saveGeometry(); + KWin::setState(id, NET::FullScreen); + } + else // leave fullscreen + KWin::clearState(id, NET::FullScreen); +} + +// Save parameters to config file +void KSquirrel::saveValues() +{ + extool->writeEntries(); + + kconf->setGroup("Filters"); + kconf->writeEntry("items", *sqFiltersName); + kconf->writeEntry("extensions", *sqFiltersExt); + kconf->writeEntry("last", pWidgetStack->nameFilter()); + + kconf->setGroup("Fileview"); + pWidgetStack->saveState(); + + if(SQ_HLOptions::instance()->have_imagebasket) + if(!waitForShow) + SQ_ImageBasket::instance()->saveConfig(); + + if(kconf->readBoolEntry("history", true) && pCurrentURL) + { + kconf->setGroup("History"); + kconf->writeEntry("items", pCurrentURL->historyItems()); + } + + kconf->setGroup("GL view"); + + if(!SQ_GLWidget::window()->fullscreen()) + gl_view->saveGeometry(); + + kconf->writeEntry("ignore", dynamic_cast(SQ_GLWidget::window()->actionCollection()->action("if less"))->isChecked()); + kconf->writeEntry("zoom type", SQ_GLWidget::window()->zoomType()); + + kconf->setGroup("Interface"); + kconf->writeEntry("last view", pWidgetStack->diroperator()->viewType()); + if(!waitForShow) kconf->writeEntry("last page", sideBar->currentPage()); + kconf->writeEntry("pos", pos()); + kconf->writeEntry("size", size()); + kconf->writeEntry("has_url", pTLocation->isShown()); + + // splitter sizes are saved automatically + // only when all sidebar pages are closed + if(sideBar->currentPage() != -1 && !waitForShow) + saveLayout(); + + kconf->setGroup("Thumbnails"); + kconf->writeEntry("size", thumbSize->value()); + kconf->writeEntry("extended", thumbSize->extended()); +} + +// Reload libraries from disk +void KSquirrel::slotRescan() +{ + libhandler->reload(); +} + +// Create a final splash screen, if needed (if pixmap cache is not empty) +void KSquirrel::createPostSplash() +{ + QColor cc(255,255,255); + QHBox *hbox = new QHBox(0, 0, Qt::WStyle_StaysOnTop | Qt::WStyle_Customize | Qt::WStyle_NoBorder | Qt::WX11BypassWM); + hbox->setFrameShape(QFrame::Box); + + QLabel *pp = new QLabel(hbox); + pp->setPalette(QPalette(cc, cc)); + pp->setAlignment(Qt::AlignCenter); + + QPixmap todo = QPixmap::fromMimeSource(locate("data", "images/tray.png")); + + if(todo.isNull()) + todo = SQ_IconLoader::instance()->loadIcon("ksquirrel", KIcon::Desktop, 16); + + pp->setPixmap(todo); + pp->setFixedWidth(18); + + QLabel *l = new QLabel(i18n(" writing settings and thumbnails... "), hbox); + l->setPalette(QPalette(cc, cc)); + l->setAlignment(Qt::AlignLeft | Qt::AlignVCenter); + + hbox->setStretchFactor(pp, 0); + hbox->setStretchFactor(l, 1); + + QRect rc = KGlobalSettings::splashScreenDesktopGeometry(); + + int w = 200, h = 20; + hbox->setGeometry(rc.center().x() - w/2, rc.center().y() - h/2, w, h); + + hbox->show(); +} + +void KSquirrel::slotThumbsMedium() +{ + emit thumbSizeChanged("medium"); +} + +void KSquirrel::slotThumbsLarge() +{ + emit thumbSizeChanged("large"); +} + +void KSquirrel::slotThumbsHuge() +{ + emit thumbSizeChanged("huge"); +} + +// Final actions before exiting +void KSquirrel::finalActions() +{ + gl_view->hide(); + + // save parameters to config file + saveValues(); + + hide(); + + diskProg->flush(); + + kconf->setGroup("Thumbnails"); + + bool create_splash = !waitForShow && !kconf->readBoolEntry("dont write", false) && !SQ_PixmapCache::instance()->empty(); + + // create post splash + if(create_splash) + { + createPostSplash(); + KApplication::eventLoop()->processEvents(QEventLoop::ExcludeUserInput | QEventLoop::ExcludeSocketNotifiers); + } + + // write config file to disk (it is currently in memory cache) + kconf->sync(); + + // Save thumbnails from memory cache to disk + if(create_splash) + SQ_PixmapCache::instance()->sync(); +} + +/* + * Enable/disable popup menu with thumnail sizes. Called + * from SQ_WidgetStack, when user changed current view + * type (for example Thumbnail view -> Icon view). + */ +void KSquirrel::enableThumbsMenu(bool enable) +{ + pAThumbsE->setEnabled(enable); // extended thumbnails + pAThumbs->setEnabled(enable); +} + +/* + * Create all needed objects + */ +void KSquirrel::preCreate() +{ + new SQ_IconLoader(this); + new SQ_PixmapCache(this); + new SQ_ArchiveHandler(this); + new SQ_ImageLoader(this); + new SQ_DragProvider(this); + + libhandler = new SQ_LibraryHandler(this); + + initExternalTools(); + + new SQ_ErrorString(this); + new SQ_ThumbnailsUnused(this); + new SQ_Converter(this); + + listingDialog = new SQ_SlideShowListing(this, "SlideShow Listing", true, Qt::WStyle_Customize | Qt::WStyle_NoBorder); + connect(listingDialog, SIGNAL(kill()), this, SLOT(slotSlideShowListingKill())); + + slideShowItems.setAutoDelete(true); + + down = new SQ_Downloader(this); + + connect(down, SIGNAL(result(const KURL &)), this, SLOT(slotDownloaderResult(const KURL &))); + + SQ_SlideShowWidget *sls = new SQ_SlideShowWidget(0, "ksquirrel-slideshow"); + + connect(sls, SIGNAL(stopSlideShow()), this, SLOT(slotStopSlideShow())); + connect(sls, SIGNAL(pause()), this, SLOT(slotPauseSlideShow())); + connect(sls, SIGNAL(next()), this, SLOT(slotNextSlideShow())); + connect(sls, SIGNAL(previous()), this, SLOT(slotPreviousSlideShow())); + + // timer for slideshow + slideShowTimer = new QTimer(this); + timerShowListing = new QTimer(this); + connect(timerShowListing, SIGNAL(timeout()), listingDialog, SLOT(show())); + + SQ_SplashScreen::advance(); + + // create main actions + createActions(); + + SQ_SplashScreen::advance(); + + actionFilterMenu = new KPopupMenu; + + actionViews = new KPopupMenu; + + pARaiseListView->plug(actionViews); + pARaiseIconView->plug(actionViews); + pARaiseDetailView->plug(actionViews); + pARaiseThumbView->plug(actionViews); + + SQ_SplashScreen::advance(); + + // if -l option specified, exit + if(SQ_HLOptions::instance()->showLibsAndExit) + exit(0); + + if(!SQ_HLOptions::instance()->param.isEmpty()) + { + // at first try to stat as local url + KURL url; + + if(QDir::isRelativePath(SQ_HLOptions::instance()->param)) + { + url = KURL::fromPathOrURL(QDir::currentDirPath()); + url.addPath(SQ_HLOptions::instance()->param); + } + else + url.setPath(SQ_HLOptions::instance()->param); + + statStage = false; + KIO::StatJob *job = KIO::stat(url, false); + job->setSide(true); + job->setDetails(0); + connect(job, SIGNAL(result(KIO::Job *)), this, SLOT(slotStatResult(KIO::Job *))); + } + else + continueLoading(); +} + +void KSquirrel::slotStatResult(KIO::Job *_job) +{ + if(_job) + { + KIO::StatJob *job = static_cast(_job); + + if(job->error()) + { + // both local and remote urls are failed + if(statStage) + { + job->showErrorDialog(this); + continueLoading(); + return; + } + } + + // found local/remote URL + KIO::UDSEntry udsEntry = job->statResult(); + KIO::UDSEntry::ConstIterator itEnd = udsEntry.end(); + + for(KIO::UDSEntry::ConstIterator it = udsEntry.begin(); it != itEnd;++it) + { + // we need just file type... + if((*it).m_uds == KIO::UDS_FILE_TYPE) + { + if(S_ISDIR((mode_t)((*it).m_long))) + { + SQ_HLOptions::instance()->dir = job->url(); + } + else + { + SQ_HLOptions::instance()->file = job->url(); + SQ_HLOptions::instance()->dir = job->url(); + SQ_HLOptions::instance()->dir.cd(".."); + } + + m_demo = !SQ_HLOptions::instance()->file.isEmpty(); + + // Ok, it's existing URL + continueLoading(); + return; + } + } + + // this should not occur, but for safety reasons... + if(statStage) + { + continueLoading(); + return; + } + + // local url is not found. construct remote url and stat() it again + KURL url = KURL::fromPathOrURL(SQ_HLOptions::instance()->param); + statStage = true; + KIO::StatJob *job2 = KIO::stat(url, false); + job2->setSide(true); + job2->setDetails(0); + connect(job2, SIGNAL(result(KIO::Job *)), this, SLOT(slotStatResult(KIO::Job *))); + } + else + continueLoading(); +} + +void KSquirrel::resizeEvent(QResizeEvent *e) +{ + if(mainPage) + mainPage->resize(e->size()); +} + +void KSquirrel::continueLoading() +{ + kconf->setGroup("Interface"); + int createFirst = kconf->readNumEntry("last view", 0); + + // create toolbar, menubar, tree, filemanager ... + createWidgets(createFirst); + + // set position & size + handlePositionSize(); + + if(m_demo) + raiseGLWidget(); + + // don't show navigator when running with file argument + if(!m_demo && !kapp->isRestored()) + show(); + + // in demo mode may be invisible + if(mainPage->isVisible()) + { + QEvent e(QEvent::Show); + eventFilter(mainPage, &e); + } + + tray = new KSystemTray(this); + tray->setPixmap(QPixmap(locate("data", "images/tray.png"))); + + connect(tray, SIGNAL(quitSelected()), this, SLOT(slotTrayQuit())); + + SQ_SplashScreen::advance(); + SQ_SplashScreen::finish(); + + // Check if we need to load a file at startup + // (if one was specified in command line) + if(!SQ_HLOptions::instance()->file.isEmpty()) + { + raiseGLWidget(); + + if(libhandler->maybeSupported(SQ_HLOptions::instance()->file) != SQ_LibraryHandler::No) + { + pWidgetStack->diroperator()->setPendingFile(SQ_HLOptions::instance()->file.fileName(false)); + KFileItem fi(KFileItem::Unknown, KFileItem::Unknown, SQ_HLOptions::instance()->file); + pWidgetStack->diroperator()->execute(&fi); + } + } + + pWidgetStack->diroperator()->setFocus(); + + // show tray icon when restored + if(kapp->isRestored()) + slotGotoTray(); + + connect(kapp, SIGNAL(saveYourself()), this, SLOT(slotSaveYourself())); +} + +// Set caption to main window or to image window +void KSquirrel::setCaption(const QString &cap) +{ +#if 0 + KMainWindow::setCaption(cap); +#endif + + gl_view->setCaption(cap.isEmpty() ? "ksquirrel" : kapp->makeStdCaption(cap)); +} + +// User selected "Open file" or "Open file #2" from menu. +// Let's load file and set new URL for filemanager (if parseURL == true) +void KSquirrel::openFile(bool parseURL) +{ + KURL url = KFileDialog::getOpenURL(); + + if(url.isEmpty()) + return; + + // if it is known file type + if(libhandler->maybeSupported(url) != SQ_LibraryHandler::No) + { + if(parseURL) + { + KURL d = url; + d.cd(".."); + pWidgetStack->diroperator()->setPendingFile(url.fileName()); + pWidgetStack->setURLForCurrent(d); + } + + KFileItem fi(KFileItem::Unknown, KFileItem::Unknown, url); + pWidgetStack->diroperator()->execute(&fi); + } + else + { + kconf->setGroup("Fileview"); + + if(kconf->readBoolEntry("run unknown", false)) + new KRun(url); + } +} + +// "Open file" in menu +void KSquirrel::slotOpenFile() +{ + openFile(); +} + +// "Open file #2" in menu +void KSquirrel::slotOpenFileAndSet() +{ + openFile(true); +} + +// User clicked animated widget in toolbar, +// let's goto KSquirrel's homepage +void KSquirrel::slotAnimatedClicked() +{ + // invoke default browser + kapp->invokeBrowser(QString::fromLatin1("http://ksquirrel.sourceforge.net/")); +} + +// Create SQ_ThumbnailCacheMaster, which can do something with thumbnails +// and thumbnail cache +void KSquirrel::slotTCMaster() +{ + SQ_ThumbnailCacheMaster m(this); + + m.exec(); +} + +// Return a pointer to widget in statusbar by name +QLabel* KSquirrel::sbarWidget(const QString &name) +{ + return sbarwidgets[name]; +} + +// Convert QByteArray to QString +QString KSquirrel::getArg(const QByteArray &data) +{ + QDataStream args(data, IO_ReadOnly); + + QString arg; + + args >> arg; + + return arg; +} + +// Process incoming DCOP messages +bool KSquirrel::process(const QCString &fun, const QByteArray &data, QCString& replyType, QByteArray &replyData) +{ + if(fun == "control(QString)") + { + // Yes, user wants to call our "control" method + control(getArg(data)); + + replyType = "void"; + + return true; + } + else if(fun == "navigator(QString)") + { + navigatorSend(getArg(data)); + + replyType = "void"; + + return true; + } + else if(fun == "activate()") + { + activate(); + + replyType = "void"; + + return true; + } + else if(fun == "activate_image_window()") + { + raiseGLWidget(); + + replyType = "void"; + + return true; + } + else if(fun == "reload_codecs()") + { + slotRescan(); + + replyType = "void"; + + return true; + } + // load specified image + else if(fun == "load(QString)") + { + QString arg = getArg(data); + + KURL url = KURL::fromPathOrURL(arg); + + KIO::StatJob *job = KIO::stat(url, false); + job->setSide(true); + job->setDetails(0); + connect(job, SIGNAL(result(KIO::Job *)), this, SLOT(slotDCOPStatResult(KIO::Job *))); + + replyType = "void"; + + return true; + } + + // we have to call it + return DCOPObject::process(fun, data, replyType, replyData); +} + +void KSquirrel::slotDCOPStatResult(KIO::Job *_job) +{ + if(_job) + { + KIO::StatJob *job = static_cast(_job); + + if(job->error()) + { + job->showErrorDialog(this); + return; + } + + KURL url = job->url(); + bool isdir = false, setc = true; + KURL dir = url; + + KIO::UDSEntry udsEntry = job->statResult(); + KIO::UDSEntry::ConstIterator itEnd = udsEntry.end(); + + for(KIO::UDSEntry::ConstIterator it = udsEntry.begin(); it != itEnd;++it) + { + // we need just file type... + if((*it).m_uds == KIO::UDS_FILE_TYPE) + { + isdir = S_ISDIR((mode_t)((*it).m_long)); + break; + } + } + + if(!isdir) dir.cd(".."); + + if(!pWidgetStack->diroperator()->url().equals(dir, true)) + { + // don't set current item + setc = false; + pWidgetStack->diroperator()->setPendingFile(url.fileName(false)); + pWidgetStack->diroperator()->setURL(dir, true); + } + + // activate this window + if(isdir) + activate(); + else + { + raiseGLWidget(); + + if(setc) + { + KFileView *v = pWidgetStack->diroperator()->view(); + + if(v) + { + v->clearSelection(); + v->setCurrentItem(url.fileName(false)); + pWidgetStack->diroperator()->setCurrentItem(v->currentFileItem()); + } + } + + KFileItem fi(KFileItem::Unknown, KFileItem::Unknown, url); + + if(libhandler->maybeSupported(fi.url()) != SQ_LibraryHandler::No) + { + // stop slideshow if running + slotStopSlideShow(); + + // load + pWidgetStack->diroperator()->execute(&fi); + } + } + } +} + +// Returnes all available DCOP methods. +// Used by DCOP infrastructure +QCStringList KSquirrel::functions() +{ + QCStringList result = DCOPObject::functions(); + + result << "void control(QString)"; + result << "void navigator(QString)"; + result << "void load(QString)"; + result << "void activate()"; + result << "void activate_image_window()"; + result << "void reload_codecs()"; + + return result; +} + +// Activate this instance +void KSquirrel::activate() +{ + m_demo = false; + + // just in case + show(); + + // force activation + KWin::forceActiveWindow(winId()); +} + +void KSquirrel::printDCOP() +{ + navigatorSend("duuummmmyyyyy"); + control("duuummmmyyyyy"); + + std::cerr << "Other:" << std::endl; + std::cerr << "*****************************" << std::endl; + std::cerr << "activate" << std::endl; + std::cerr << "activate_image_window" << std::endl; + std::cerr << "load " << std::endl; + std::cerr << "******************************" << std::endl; +} + +void KSquirrel::navigatorSend(const QString &command) +{ + if(command == "next") + pWidgetStack->moveTo(SQ_WidgetStack::Next, 0, false); + else if(command == "previous") + pWidgetStack->moveTo(SQ_WidgetStack::Previous, 0, false); + else if(command == "execute") + { + KFileItem *fi = pWidgetStack->diroperator()->view()->currentFileItem(); + + if(fi) + { + if(fi->isFile()) + pWidgetStack->diroperator()->execute(fi); + else + pWidgetStack->diroperator()->setURL(fi->url(), true); + } + } + else // unknown parameter ! + { + std::cerr << "List of available DCOP parameters for navigator() method:" << std::endl; + std::cerr << "*****************************" << std::endl; + std::cerr << "next" << std::endl; + std::cerr << "previous" << std::endl; + std::cerr << "execute" << std::endl; + std::cerr << "******************************" << std::endl; + } +} + +// User sent us some message through DCOP, let's determine +// what he wants to do. +// +// The main idea is that SQ_GLWidget already has all needed actions, +// located in keyPressEvent() handler. Let's construct QKeyEvent and send +// it to SQ_GLWidget - SQ_GLWidget will catch this event and will do what +// user wants. +// +void KSquirrel::control(const QString &command) +{ + QMap::iterator it = messages.find(command); + + // known action + if(it != messages.end()) + { + int id = it.data(); + + KAction *a = SQ_GLWidget::window()->actionCollection()->action(QString::fromLatin1("action_%1").arg(id)); + + if(a) a->activate(); + } + else // unknown parameter ! + { + std::cerr << "List of available DCOP parameters for control() method:" << std::endl; + std::cerr << "*****************************" << std::endl; + + for(QMap::iterator it = messages.begin();it != messages.end();++it) + { + std::cerr << it.key() << std::endl; + } + + std::cerr << "******************************" << std::endl; + } +} + +void KSquirrel::fillMessages() +{ + messages.insert("image_next", Qt::Key_PageDown); + messages.insert("image_previous", Qt::Key_PageUp); + messages.insert("image_first", Qt::Key_Home); + messages.insert("image_last", Qt::Key_End); + messages.insert("image_reset", Qt::Key_R); + messages.insert("image_information", Qt::Key_I); + messages.insert("image_delete", Qt::Key_Delete); + + messages.insert("image_animation_toggle", Qt::Key_A); + + messages.insert("image_page_first", Qt::Key_F1); + messages.insert("image_page_last", Qt::Key_F4); + messages.insert("image_page_next", Qt::Key_F3); + messages.insert("image_page_previous", Qt::Key_F2); + + messages.insert("image_window_fullscreen", Qt::Key_F); + messages.insert("image_window_quickbrowser", Qt::Key_Q); + messages.insert("image_window_close", Qt::Key_X); + messages.insert("image_window_help", Qt::Key_Slash); + + messages.insert("zoom_plus", Qt::Key_Plus); + messages.insert("zoom_minus", Qt::Key_Minus); + messages.insert("zoom_1", Qt::Key_1); + messages.insert("zoom_2", Qt::Key_2); + messages.insert("zoom_3", Qt::Key_3); + messages.insert("zoom_4", Qt::Key_4); + messages.insert("zoom_5", Qt::Key_5); + messages.insert("zoom_6", Qt::Key_6); + messages.insert("zoom_7", Qt::Key_7); + messages.insert("zoom_8", Qt::Key_8); + messages.insert("zoom_9", Qt::Key_9); + messages.insert("zoom_10", Qt::Key_0); +} + +// Start/stop slideshow +void KSquirrel::slotSlideShowStart() +{ + if(slideShowDir.isEmpty()) + slideShowDir = SQ_WidgetStack::instance()->url().prettyURL(); + + kconf->setGroup("Slideshow"); + + // recursion ? + bool recurs = kconf->readBoolEntry("recurs", false); + + listing = recurs ? KIO::listRecursive(slideShowDir, false, false) + : KIO::listDir(slideShowDir, false, false); + + connect(listing, SIGNAL(entries(KIO::Job *, const KIO::UDSEntryList &)), + this, SLOT(slotSlideShowEntries(KIO::Job *, const KIO::UDSEntryList &))); + + connect(listing, SIGNAL(result(KIO::Job *)), this, SLOT(slotSlideShowJobResult(KIO::Job *))); + + timerShowListing->start(1000, true); +} + +void KSquirrel::slotSlideShowListingKill() +{ + if(listing) listing->kill(); + + slideShowItems.clear(); + listingDialog->setFile(0, QString::null); + listingDialog->hide(); +} + +void KSquirrel::slotSlideShowEntries(KIO::Job *, const KIO::UDSEntryList &list) +{ + KIO::UDSEntryListConstIterator itEnd = list.end(); + + KURL url = KURL::fromPathOrURL(slideShowDir); + QString sfile; + + // go through list of KIO::UDSEntrys + for(KIO::UDSEntryListConstIterator it = list.begin(); it != itEnd; ++it) + { + KFileItem *file = new KFileItem(*it, url, true, true); + + if(file && file->isFile()) + { + slideShowItems.append(file); + + if(sfile.isEmpty()) sfile = file->name(); + } + else + delete file; + } + + if(!sfile.isEmpty()) + listingDialog->setFile(slideShowItems.count(), sfile); +} + +void KSquirrel::slotSlideShowJobResult(KIO::Job *job) +{ + listingDialog->setFile(0, QString::null); + listingDialog->hide(); + timerShowListing->stop(); + + if(!job->error()) + slideShowPrivate(); + + listing = 0; +} + +// Invoke dialog for advanced slideshow +void KSquirrel::slotSlideShowDialog() +{ + SQ_SlideShow s(this); + + if(s.exec(slideShowDir) == QDialog::Accepted) + slotSlideShowStart(); +} + +// Start new slidehsow! +void KSquirrel::slideShowPrivate() +{ + // stop timer, if active + slideShowTimer->stop(); + slideShowStop = false; + slideShowInit = true; + slideShowDirection = KSquirrel::Default; + + disconnect(slideShowTimer, SIGNAL(timeout()), 0, 0); + connect(slideShowTimer, SIGNAL(timeout()), this, SLOT(slotSlideShowNextImage())); + + kconf->setGroup("Slideshow"); + + // determine delay + slideShowDelay = kconf->readNumEntry("delay", 1000); + slideShowRepeat = kconf->readNumEntry("repeat", 0); + + if(slideShowDelay < 0) slideShowDelay = 1000; + if(slideShowRepeat < 0) slideShowRepeat = 0; + if(slideShowRepeat > 1000) slideShowRepeat = 1000; + + slideShowTotal = slideShowItems.count(); + + // No files to show ? + if(!slideShowTotal) + { + slotStopSlideShow(); + return; + } + + // initial setup + slideShowIndex = -1; + + // start! + SQ_SlideShowWidget::instance()->beginSlideShow(slideShowTotal); + + QTimer::singleShot(1, this, SLOT(slideShowDetermine())); +} + +void KSquirrel::slotDownloaderResult(const KURL &u) +{ + if(u.isEmpty()) // error occured + slideShowDetermine(); + else + { + KURL u2 = u; + slideShowName = u2; + int delay = slideShowInit ? 0 : slideShowDelay; + + if(libhandler->libraryForFile(slideShowName.path())) + { + slideShowInit = false; + slideShowTimer->start(delay, true); + } + else + slideShowDetermine(); + } +} + +void KSquirrel::slideShowDetermine() +{ + do + { + // goto next file + if(slideShowDirection == KSquirrel::Default) + { + slideShowIndex++; + + // all files loaded ? + if(slideShowIndex == slideShowTotal) + { + // slideshow done + if(!slideShowRepeat) + { + // nice hack to make final delay + disconnect(slideShowTimer, SIGNAL(timeout()), 0, 0); + connect(slideShowTimer, SIGNAL(timeout()), this, SLOT(slotStopSlideShow())); + slideShowTimer->start(slideShowDelay, true); + return; + } + // we should repeat slideshow + else + { + slideShowRepeat--; + slideShowIndex = 0; + } + } + } + else // KSquirrel::MBack + { + slideShowIndex--; + + if(slideShowIndex < 0) + { + slideShowDirection = KSquirrel::Default; + slideShowIndex = -1; + continue; + } + } + + // construct new file name + slideShowFile = slideShowItems.at(slideShowIndex); + slideShowName = slideShowFile->url(); + } + while(libhandler->maybeSupported(slideShowName) == SQ_LibraryHandler::No); + + slideShowDirection = KSquirrel::Default; + + if(slideShowName.isLocalFile()) + slotDownloaderResult(slideShowName); + else + down->start(slideShowFile); +} + +// Load the next image +void KSquirrel::slotSlideShowNextImage() +{ + // stopped ? + if(slideShowStop) + return; + + SQ_SlideShowWidget::instance()->loadImage(slideShowName.path(), slideShowIndex); + + slideShowDetermine(); +} + +void KSquirrel::slotNextSlideShow() +{ + slideShowTimer->stop(); + slideShowTimer->start(0, true); +} + +void KSquirrel::slotPreviousSlideShow() +{ + slideShowTimer->stop(); + slideShowDirection = KSquirrel::MBack; + int ssi = slideShowIndex; + KURL ssn; + + do + { + // goto next file + ssi--; + + if(ssi < 0) + { + slideShowDirection = KSquirrel::Default; + slideShowTimer->start(0, true); + return; + } + + // construct new file name + ssn = slideShowItems.at(ssi)->url(); + } + while(libhandler->maybeSupported(ssn) == SQ_LibraryHandler::No); + + slideShowIndex = ssi; + slideShowName = ssn; + + slideShowInit = true; + slideShowDetermine(); +} + +// Stop slideshow, if running +void KSquirrel::slotStopSlideShow() +{ + if(!slideShowRunning()) + return; + + // reset values + slideShowStop = true; + slideShowTimer->stop(); + slideShowDir = QString::null; + slideShowPaused = false; + slideShowItems.clear(); + slideShowDirection = KSquirrel::Default; + + kconf->setGroup("Slideshow"); + + SQ_SlideShowWidget::instance()->endSlideShow(); +} + +// Show information on libraries +void KSquirrel::slotPluginsInfo() +{ + SQ_PluginsInfo pi(this); + + pi.exec(); +} + +void KSquirrel::slotPluginsDel() +{ + KShellProcess proc; + + proc << "ksquirrel-libs-configurator"; + + proc.start(KProcess::DontCare); +} + +void KSquirrel::slotPauseSlideShow() +{ + if(!slideShowRunning()) + return; + + if(slideShowPaused) + { + slideShowTimer->start(slideShowDelay, true); + slideShowPaused = false; + } + else + { + slideShowTimer->stop(); + slideShowPaused = true; + } +} + +// show imformation on OpenGL +void KSquirrel::slotGLInfo() +{ + SQ_GLInfo gi(this); + + gi.exec(); +} + +void KSquirrel::saveLayout() +{ + if(!waitForShow) + { + kconf->setGroup("Interface"); + kconf->writeEntry("splitter", mainView->sizes()); + } +} + +void KSquirrel::configAnime(bool init) +{ + KAnimWidget *anim = tools->animatedWidget(1000); // get animated widget, if exist + + kconf->setGroup("Main"); + + // show animated logo in toolbar if needed + if(!kconf->readBoolEntry("anime_dont", false) && (init || (!init && !anim))) + { + tools->insertAnimatedWidget(1000, this, SLOT(slotAnimatedClicked()), locate("data", "images/anime.png")); + tools->alignItemRight(1000); + tools->animatedWidget(1000)->start(); + } + else if(!init && kconf->readBoolEntry("anime_dont", false) && anim) + delete anim; +} + +void KSquirrel::slotTrayQuit() +{ + m_demo = true; + m_intray = false; +} + +void KSquirrel::slotClose() +{ + m_demo = true; + m_intray = false; + + close(); +} + +void KSquirrel::slotRename() +{ + bool ok; + + KFileItemList *items = const_cast(pWidgetStack->diroperator()->view()->selectedItems()); + + if(!items || !items->count()) + return; + + renameSrcURL = items->first()->url(); + + QString filename = QStyleSheet::escape(renameSrcURL.filename()); + + QString mNewFilename = KInputDialog::getText(i18n("Renaming File"), + i18n("

Rename file %1 to:

").arg(filename), + renameSrcURL.filename(), &ok, this); + + if(!ok) return; + + renameDestURL = renameSrcURL; + renameDestURL.setFileName(mNewFilename); + + KIO::Job *job = KIO::move(renameSrcURL, renameDestURL); + connect(job, SIGNAL(result(KIO::Job*)), this, SLOT(slotRenameResult(KIO::Job*))); +} + +void KSquirrel::slotRenameResult(KIO::Job *job) +{ + if(job->error()) + { + job->showErrorDialog(this); + return; + } + + SQ_PixmapCache::instance()->removeEntryFull(renameSrcURL); +} + +void KSquirrel::slotRepeat() +{ + pWidgetStack->repeat(); +} + +void KSquirrel::slotSaveYourself() +{ + finalActions(); +} + +void KSquirrel::slotPreviewWidgetNext() +{ + pWidgetStack->moveTo(SQ_WidgetStack::Next); +} + +void KSquirrel::slotPreviewWidgetPrevious() +{ + pWidgetStack->moveTo(SQ_WidgetStack::Previous); +} + +void KSquirrel::slotPreviewWidgetExecute() +{ + KURL u = SQ_PreviewWidget::instance()->url(); + + if(!u.isEmpty()) + { + KFileItem fi(KFileItem::Unknown, KFileItem::Unknown, u); + pWidgetStack->diroperator()->execute(&fi); + } +} + +#include "ksquirrel.moc" diff --git a/ksquirrel/ksquirrel.desktop b/ksquirrel/ksquirrel.desktop new file mode 100644 index 0000000..fd0c4e7 --- /dev/null +++ b/ksquirrel/ksquirrel.desktop @@ -0,0 +1,18 @@ +# KDE Config File +[Desktop Entry] +Type=Application +Exec=ksquirrel %i %u +Icon=ksquirrel +DocPath=ksquirrel/index.html +Terminal=false +Name=KSquirrel +MimeType=image/x-vnd.adobe.photoshop;image/x-hdr;image/x-exr;image/x-eps;image/x-psp;image/x-dds;image/x-mdl;image/ljpeg;image/x-dicom;image/x-xfig;image/svg+xml;image/gif;image/x-xpm;image/x-xbm;image/jpeg;image/x-bmp;image/png;image/tiff;image/x-portable-bitmap;image/x-portable-pixmap;image/x-portable-anymap;image/x-portable-greymap;image/jp2;image/x-jng;image/x-wmf;video/x-mng;video/x-flic;image/x-targa;image/x-pcx;image/x-photo-cd;image/x-rgb;image/x-xcursor;image/x-ico;image/psd;image/x-djvu;image/x-xcf-gimp;image/x-avs;image/x-cut;image/x-dxf;image/x-iff;image/x-jbig;image/x-koala;image/x-leaf;image/x-lif;image/x-mac;image/x-msp;image/x-mtv;image/x-neo;image/x-pi1;image/x-pi3;image/x-pict;image/x-pix;image/x-pxr;image/x-ras;image/x-raw;image/x-rawrgb;image/x-sct;image/x-sun;image/x-utah;image/x-wal;image/x-wbmp;image/x-xim;image/x-xwd;application/x-font-ttf;application/x-font-ttc;application/x-font-otf;application/x-font-type1 +Categories=Qt;KDE;Application;Graphics;Viewer; + +Comment=Image Viewer +Comment[ru]=Просмотр изображений +Comment[de]=Bildbetrachter + +GenericName=Image Viewer +GenericName[ru]=Просмотр изображений +GenericName[de]=Bildbetrachter \ No newline at end of file diff --git a/ksquirrel/ksquirrel.h b/ksquirrel/ksquirrel.h new file mode 100644 index 0000000..58c542b --- /dev/null +++ b/ksquirrel/ksquirrel.h @@ -0,0 +1,800 @@ +/*************************************************************************** + ksquirrel.h - description + ------------------- + begin : Dec 10 2003 + copyright : (C) 2003 by Baryshev Dmitry + email : ksquirrel.iv@gmail.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifndef KSQUIRREL_H +#define KSQUIRREL_H + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include + +#include +#include +#include +#include + +// forward declarations + +template class QValueVector; +class QLabel; +class QWidgetStack; +class QHBox; +class QVBox; +class QTimer; +class QSplitter; + +namespace KIO { class Job; } + +class KMenuBar; +class KToolBar; +class KStatusBar; +class KSystemTray; +class KAction; +class KRadioAction; +class KActionMenu; +class KHistoryCombo; +class KToggleAction; +class KBookmarkMenu; + +class SQ_SplashScreen; +class SQ_WidgetStack; +class SQ_LibraryHandler; +class SQ_Config; +class SQ_ExternalTool; +class SQ_TreeView; +class SQ_ThumbnailSize; +class SQ_PixmapCache; +class SQ_GLView; +class SQ_GLWidget; +class SQ_ArchiveHandler; +class SQ_MultiBar; +class SQ_KIPIManager; +class SQ_Progress; +class SQ_Dir; +class SQ_Downloader; +class SQ_SlideShowListing; + +/* + * Main widget, which can accept DCOP messages + */ + +class KSquirrel : public KMainWindow, public DCOPObject +{ + Q_OBJECT + + public: + /* + * Constructor & destructor + */ + KSquirrel(QWidget *parent, const char *name); + ~KSquirrel(); + + SQ_Progress* diskProgress(); + + void printDCOP(); + + /* + * "history combo" + */ + KHistoryCombo* historyCombo(); + + bool demo() const; + + /* + * Activate main window. + */ + void activate(); + + /* + * Close (hide) SQ_GLWidget. + */ + void closeGLWidget(); + + /* + * Do some actions before exit - show final splash (if needed), + * save parameters to config file, + * write config file to disk, write cached thumbnails, etc. + */ + void finalActions(); + + /* + * Enable/disable popup menu with thumnail sizes. Called + * from SQ_WidgetStack, when user changed current view + * type (for example Thumbnail view -> Icon view). + */ + void enableThumbsMenu(bool); + + /* + * Set caption. When SQ_GLView is separated, the caption + * will be set to it, and to KSquirrel's main window + * otherwise. Called from SQ_GLWidget. + */ + void setCaption(const QString &cap); + + void saveLayout(); + + /* + * Check if slideshow is running. + */ + bool slideShowRunning() const; + + /* + * Return popup menu with filters for filemanager. + */ + KPopupMenu* menuFilters(); + + /* + * Return popup menu with view types - + * Icon view, Detail view ... + */ + KPopupMenu* menuViews(); + + /* + * Get pointer to a widget, located in status bar. + * All pointers to statusbar widgets are saved in + * 'sbarwidgets' object (QMap). + */ + QLabel* sbarWidget(const QString &name); + + /* + * DCOP methods + */ + + /* + * Return a list of available functions + */ + QCStringList functions(); + + /* + * Process incoming DCOP message + */ + bool process(const QCString &fun, const QByteArray &data, QCString& replyType, QByteArray &replyData); + + bool separateImageWindow() const; + + /* + * Names and extensions of name filters for + * file manager. + */ + QStringList* filtersNames() const; + QStringList* filtersExtensions() const; + + static KSquirrel* app() { return m_instance; } + + protected: + /* + * Catch some events and do specific actions. + */ + virtual bool eventFilter(QObject *o, QEvent *e); + virtual void closeEvent(QCloseEvent *e); + virtual void resizeEvent(QResizeEvent *e); + + /* + * Internal methods + */ + private: + + // create or delete animated logo + void configAnime(bool init = true); + + void continueLoading(); + + /* + * Create a final splash. It will be shown only if SQ_PixmapCache + * is not empty. + */ + void createPostSplash(); + + /* + * Create location toolbar and store a pointer to + * it in passed argument. + */ + void createLocationToolbar(KToolBar *); + + /* + * Create statusbar. + */ + void createStatusBar(KStatusBar*); + + /* + * Create main toolbar. + */ + void createToolbar(KToolBar *); + + /* + * Create main menu. + */ + void createMenu(KMenuBar *); + + /* + * Create all KActions + */ + void createActions(); + + /* + * Create all needed objects + */ + void preCreate(); + + /* + * Create QStrinLists, containing filters and filters' names (if needed) + * and fill popup menu with new filters. + */ + void initFilterMenu(); + + /* + * Do the same for external tools. + */ + void initExternalTools(); + + /* + * Init bookmarks and create popup menu for them. + */ + void initBookmarks(); + + /* + * Create all widgets (filemanager, file tree, toolbar, etc.) + */ + void createWidgets(int); + + /* + * Restore saved position & size + */ + void handlePositionSize(); + + /* + * If user-depended config file doesn't exist (~/.kde/share/config/ksquirrelrc), + * create it and write default entries. Called before SQ_Config object is being + * created + */ + void writeDefaultEntries(); + + /* + * Fill all parameters with its default values (form config + * file). Affects to clicking policy in SQ_WidgetStack, + * cache limit in SQ_PixmapCache etc. + */ + void applyDefaultSettings(); + + /* + * Save all parameters to config file before exit. + */ + void saveValues(); + + /* + * Open image and/or change current directory + * to its URL. Called when user clicks "Open file" and + * "Open file #2" in main menu. + */ + void openFile(bool parseURL = false); + + /* + * Run slideshow + */ + void slideShowPrivate(); + + /* + * Set filter for a filemanager to 'f' and check + * appropriate menu item + */ + void setFilter(const QString &f, const int id); + + /* + * Fill 'messages' map with values. 'messages' map is used + * to determine which key sequence should KSquirrel pass to SQ_GLWidget + * to perform an action, needed by DCOP client. + */ + void fillMessages(); + + /* + * DCOP helper methods + */ + + /* + * Determine the incoming DCOP message, create appropriate + * key sequence and send this sequence to SQ_GLWidget. + * + * The main idea is that KSquirrel will find needed key sequence + * by its name (in 'messages' map), costruct QKeyEvent and send to + * SQ_GLWidget. SQ_GLWidget already has keyEvent() handler, so it will + * do what DCOP client wants. + * + * For example, + * + * $ dcop ksquirrel ksquirrel control image_next + * + * will call KSquirrel::control("image_next"), which will + * construct QKeyEvent(QEvent::KeyPress, Qt::Key_PageDown, + * Qt::Key_PageDown, Qt::NoButton) + * and send it to SQ_GLWidget. SQ_GLWidget will catch keypress event, + * and load next image in the current directory. + */ + void control(const QString &command); + + /* + * Send a message to navigator from incoming DCOP message + */ + void navigatorSend(const QString &command); + + /* + * Get QString argument from incoming QByteArray. + */ + QString getArg(const QByteArray &data); + + signals: + + /* + * emitted, when user chages thumbails' size (from menu). + */ + void thumbSizeChanged(const QString&); + + void resetToolTip(); + + public slots: + + /* + * Show SQ_GLWidget. + */ + void raiseGLWidget(); + + /* + * Switch fullscreen state of SQ_GLView. + */ + void slotFullScreen(bool full); + + /* + * Stop slideshow, if running. + */ + void slotStopSlideShow(); + + /* + * Pause or unpause slideshow, if running. + */ + void slotPauseSlideShow(); + + /* + * Load next or previuos file in slideshow sequence + * without waiting. (coming from SQ_SlideshowWidget's toolbar) + */ + void slotNextSlideShow(); + void slotPreviousSlideShow(); + + private slots: + + void slotStatResult(KIO::Job *job); + void slotDCOPStatResult(KIO::Job *job); + + void slotPreviewWidgetNext(); + void slotPreviewWidgetPrevious(); + void slotPreviewWidgetExecute(); + + void slotSaveYourself(); + void slotRename(); + void slotRenameResult(KIO::Job *); + void slotExtendedToggled(bool); + void slotTrayQuit(); + void slotClose(); + + void slotRepeat(); + + /* + * Reload disk usage information + */ + void slotFireDisk(); + + /* + * Deetrmine next supported image in slideshow + */ + void slideShowDetermine(); + + /* + * Non-local file downloaded (for slideshow) + */ + void slotDownloaderResult(const KURL &); + + /* + * Got new urls while listing directory for slideshow + */ + void slotSlideShowEntries(KIO::Job *, const KIO::UDSEntryList &); + + /* + * Directory listed for slideshow + */ + void slotSlideShowJobResult(KIO::Job *); + + void slotSlideShowListingKill(); + + /* + * Invoke 'Options' dialog. + */ + void slotOptions(); + + /* + * Invoke 'Filters' dialog. + */ + void slotFilters(); + + /* + * Invoke 'External tools' dialog. + */ + void slotExtTools(); + + /* + * Raise list view in filemanager. + */ + void slotRaiseListView(); + + /* + * Raise icon view in filemanager. + */ + void slotRaiseIconView(); + + /* + * Raise detail view in filemanager. + */ + void slotRaiseDetailView(); + + /* + * Raise thumbnail view in filemanager. + */ + void slotRaiseThumbView(); + + /* + * Invoked, when user clicked "Go" button in location toolbar. + */ + void slotGo(); + + /* + * Invoked, when user selected to filter for filemanager. + */ + void slotSetFilter(int); + + /* + * Invoked, when user clicked "Go to tray". + */ + void slotGotoTray(); + + /* + * Next four slots will be called, when user selected + * subitem in 'Thumbnail size' menu. + */ + void slotThumbsMedium(); + void slotThumbsLarge(); + void slotThumbsHuge(); + + /* + * Invoked, when user clicked "Open file" button. + */ + void slotOpenFile(); + + /* + * Invoked, when user clicked "Open file #2" button. + * This slot will decode selected image, and change + * current directory. + */ + void slotOpenFileAndSet(); + + /* + * Invoked, when user clicked an animated logo in toolbar. + * This slot will open KSquirrel's homepage with default browser. + */ + void slotAnimatedClicked(); + + /* + * Invokes a dialog with specific thumbnails actions: + * delete thumbnails on disk, show thumbnails on disk, ... + */ + void slotTCMaster(); + + /* + * Invoked, when user clicked "Slideshow through dialog". + * Creates SQ_SlideShow dialog. + */ + void slotSlideShowDialog(); + + /* + * Determine the next image, which should be shown in slideshow. + */ + void slotSlideShowNextImage(); + + /* + * Invoked, when user presses slideshow button. + * Will stop or run slideshow. + */ + void slotSlideShowStart(); + + /* + * Invoked, when user clicked "Plugins information" button. + * Creates a dialog with information on all found libraries + */ + void slotPluginsInfo(); + void slotPluginsDel(); + + /* + * Invoked, when user clicked "OpenGL information" button. + */ + void slotGLInfo(); + + /* + * Convinience slot. + * Reload libraries from disk. + */ + void slotRescan(); + + private: + static KSquirrel *m_instance; + + bool m_demo; + + KToggleAction *pAThumbsE; + + // main toolbar + KToolBar *tools; + + //main menu + KMenuBar *menubar; + + // different views (Icon view, List view ...) + KRadioAction *pARaiseListView, *pARaiseIconView, *pARaiseDetailView, *pARaiseThumbView; + + // popup menu with thumbnail sizes + KActionMenu *pAThumbs; + + // thumbnail sizes (small, normal, ...) + KRadioAction *pAThumb0, *pAThumb1, *pAThumb2, *pAThumb3; + + // show/hide url box + KToggleAction *pAURL; + + // popup menus: "File", "View" ... + KPopupMenu *pop_file, *pop_view, *pop_action, *pop_nav; + + // filters and views + KPopupMenu *actionFilterMenu, *actionViews; + + // menus with bookmarks + KActionMenu *bookmarks; + KBookmarkMenu *bookmarkMenu; + + // "Open file", "open file #2" + KAction *pAOpen, *pAOpenAndSet, + + *pARename, + + // Open "SQ_ThumbnailCacheMaster" + *pATCMaster, + + // Show image window + *pAGLView, + + // Exit + *pAExit, + + // Reload libraries from disk (from /usr/lib/ksquirrel-libs) + *pARescan, + + // External tool and filters + *pAExtTools, *pAFilters, + + // Goto tray + *pAGotoTray, + + // Dialog for advanced slideshow + *pASlideShowDialog, + + // OpenGL information + *pAGLInfo, + + // Plugins information + *pAPluginsInfo, + *pAPluginsDel; + + // Main statusbar + KStatusBar *sbar; + + // contains paths of found libraries + QStringList strlibFound; + + // sizes for mainSplitter + QValueList mainSizes; + + // libraries' filters + QStringList libFilters; + + // QMap, which contains pointers to statusbar widgets. + // I can get a pointer by widget's name. + // + // For example: + // + // KSquirrel::app()->sbarWidget("fileName")->setText("Filename.txt"); + // + QMap sbarwidgets; + + // QLabels for statusbar + QLabel *dirInfo, *fileIcon, *fileName, *diskSpace; + + // QMap, which contains available DCOP + // parameters (such as "image_next", "image_prev") + // and its appropriate key sequences. + // + // For example, "image_next" is mapped to Qt::Key_PageDown + // "image_prev" - to "Qt::Key_PageUp" + QMap messages; + + // combobox with history urls + KHistoryCombo *pCurrentURL; + + // filters' names and extensions + QStringList *sqFiltersName, *sqFiltersExt; + + // "Configure KSquirrel" + KAction *pAConfigure, + + // "Select group", "Deselect group", "Select all", "Deselect" + // actions for filemanager + *pASelectGroup, *pADeselectGroup, *pASelectAll, *pADeselectAll; + + // "Slideshow" + KAction *pASlideShow; + + /* + * Slideshow-specififc members. + * + * Is slideshow paused by user (with 'Pause') ? + */ + bool slideShowPaused; + + KIO::Job *listing; + + SQ_SlideShowListing *listingDialog; + + // Directory for slideshow. + // KSquirrel will use it to load file names. + QString slideShowDir; + + bool slideShowInit; + + KFileItem *slideShowFile; + + // Contains found files + KFileItemList slideShowItems; + + // Delay, total files in selected directory and + // current file index + int slideShowIndex, slideShowDelay, slideShowTotal, slideShowRepeat; + + // current file name + KURL slideShowName; + + // timers for slideshow + QTimer *slideShowTimer, *timerShowListing; + + // is slideshow stopped ? + bool slideShowStop; + + // url box + KToolBar *pTLocation; + + // our config file + SQ_Config *kconf; + + // widget stack containing different views (Icon view, List view ...) + SQ_WidgetStack *pWidgetStack; + + // our library handler + SQ_LibraryHandler *libhandler; + + // ou tray instance + KSystemTray *tray; + + // external tools + SQ_ExternalTool *extool; + + QSplitter *mainView; + + // file tree + SQ_TreeView *ptree; + + // widget containing SQ_GLWidget and statusbar + SQ_GLView *gl_view; + + // archive handler, can unpack different archives + SQ_ArchiveHandler *ar; + + // object containing different useful information + // on thumbnails (size, margin ...) + SQ_ThumbnailSize *thumbSize; + + // thumbnails' memory cache + SQ_PixmapCache *cache; + + // sidebar + SQ_MultiBar *sideBar; + + SQ_SplashScreen *splash_to_delete; + + SQ_Progress *diskProg; + + // KIPI plugins loader +#ifdef SQ_HAVE_KIPI + SQ_KIPIManager *kipiManager; +#endif + + enum SSD { MBack, Default } slideShowDirection; + + // not interesting ;) + KURL renameSrcURL, renameDestURL; + int old_id; + bool old_disable, m_urlbox, old_marks, old_calc, m_intray, waitForShow; + SQ_Downloader *down; + QVBox *mainPage; + bool statStage; +}; + +// Is slideshow running ? +inline +bool KSquirrel::slideShowRunning() const +{ + return !slideShowStop; +} + +inline +KHistoryCombo* KSquirrel::historyCombo() +{ + return pCurrentURL; +} + +inline +QStringList* KSquirrel::filtersNames() const +{ + return sqFiltersName; +} + +inline +QStringList* KSquirrel::filtersExtensions() const +{ + return sqFiltersExt; +} + +inline +KPopupMenu* KSquirrel::menuFilters() +{ + return actionFilterMenu; +} + +inline +KPopupMenu* KSquirrel::menuViews() +{ + return actionViews; +} + +inline +SQ_Progress* KSquirrel::diskProgress() +{ + return diskProg; +} + +inline +bool KSquirrel::demo() const +{ + return m_demo; +} + +#endif diff --git a/ksquirrel/ksquirrelpart/Makefile.am b/ksquirrel/ksquirrelpart/Makefile.am new file mode 100644 index 0000000..d7a600b --- /dev/null +++ b/ksquirrel/ksquirrelpart/Makefile.am @@ -0,0 +1,28 @@ +INCLUDES = $(all_includes) -I$(srcdir) + +# These are not really libraries, but modules dynamically opened. +# So they should be installed in kde_module_dir, which is usually $kde_prefix/lib/kde3 +kde_module_LTLIBRARIES = libksquirrelpart.la + +AM_CXXFLAGS = -DKSQUIRREL_PART + +if SQ_HAVE_KEXIF +AM_CXXFLAGS += $(libkexif_CFLAGS) +endif + +AM_CCASFLAGS = -I$(srcdir) $(KSQUIRREL_ASM_DEFS) + +libksquirrelpart_la_SOURCES = ksquirrelpart.cpp sq_glparts.cpp sq_glu.cpp sq_glwidget.cpp sq_glwidget_stuff.cpp sq_libraryhandler.cpp sq_downloader.cpp sq_iconloader.cpp fmt_filters.cpp sq_externaltool.cpp sq_config.cpp sq_filedialog.cpp sq_imagefilter.ui sq_imagebcg.ui sq_glselectionpainter.cpp sq_glwidget_helpers.cpp sq_label.cpp sq_bcglabel.cpp sq_popupmenu.cpp sq_codecsettingsskeleton.ui sq_codecsettings.cpp sq_imageproperties.ui sq_utils.cpp sq_helpwidget.ui sq_utils_asm_scale.S sq_utils_scale.cpp sq_diroperator.cpp sq_glview.cpp sq_errorstring.cpp +libksquirrelpart_la_LIBADD = $(LIB_KPARTS) +libksquirrelpart_la_LDFLAGS = $(all_libraries) $(KDE_PLUGIN) $(ksquirrellibs_LIBS) $(LIB_KDEPRINT) -lqui -lkonq + +if SQ_HAVE_KEXIF +libksquirrelpart_la_LDFLAGS += $(libkexif_LIBS) +endif + +METASOURCES = AUTO + +ksquirreldir = $(kde_datadir)/ksquirrelpart +ksquirrel_DATA = ksquirrelpart.rc + +kde_services_DATA = ksquirrelpart.desktop diff --git a/ksquirrel/ksquirrelpart/file_broken.xpm b/ksquirrel/ksquirrelpart/file_broken.xpm new file mode 100644 index 0000000..1040d96 --- /dev/null +++ b/ksquirrel/ksquirrelpart/file_broken.xpm @@ -0,0 +1,831 @@ +/* XPM */ +static const char * file_broken_xpm[] = { +"64 64 764 2", +" c None", +". c #A5A9AA", +"+ c #A4A8A9", +"@ c #A3A7A8", +"# c #A2A6A7", +"$ c #A1A5A6", +"% c #A0A4A5", +"& c #9FA3A4", +"* c #9EA2A3", +"= c #9DA1A2", +"- c #9CA0A1", +"; c #9B9FA0", +"> c #9A9E9F", +", c #999D9E", +"' c #989C9D", +") c #979B9C", +"! c #969A9B", +"~ c #95999A", +"{ c #949899", +"] c #939798", +"^ c #929697", +"/ c #919596", +"( c #909495", +"_ c #8F9394", +": c #8E9293", +"< c #8D9192", +"[ c #8C9091", +"} c #8B8F90", +"| c #8A8E8F", +"1 c #898D8E", +"2 c #888C8D", +"3 c #878B8C", +"4 c #A6AAAB", +"5 c #ACB7BF", +"6 c #B3C4D4", +"7 c #B2C3D3", +"8 c #B1C2D2", +"9 c #B0C1D1", +"0 c #AFC0D0", +"a c #AEBFCF", +"b c #ADBECE", +"c c #ACBDCD", +"d c #ABBCCC", +"e c #AABBCB", +"f c #A9BACA", +"g c #A8B9C9", +"h c #A7B8C8", +"i c #A6B7C7", +"j c #A5B6C6", +"k c #A4B5C5", +"l c #95A0A8", +"m c #868A8B", +"n c #B0BECA", +"o c #C2E0FF", +"p c #D1E7FF", +"q c #D0E7FF", +"r c #CFE7FF", +"s c #CFE6FF", +"t c #9CAAB6", +"u c #828687", +"v c #C0DCF9", +"w c #E4F1FF", +"x c #FFFFFF", +"y c #FEFFFF", +"z c #FEFEFF", +"A c #FDFEFF", +"B c #FCFEFF", +"C c #FBFDFF", +"D c #FAFDFF", +"E c #FAFCFF", +"F c #F9FCFF", +"G c #F8FCFF", +"H c #F8FBFF", +"I c #F7FBFF", +"J c #F6FAFF", +"K c #F5FAFF", +"L c #DEEEFF", +"M c #BEDAF7", +"N c #85898A", +"O c #E8F3FF", +"P c #EFF7FF", +"Q c #F4FAFF", +"R c #E7F3FF", +"S c #F3F9FF", +"T c #E6F2FF", +"U c #F2F8FF", +"V c #E5F2FF", +"W c #F1F8FF", +"X c #FAEFEF", +"Y c #EAAFAF", +"Z c #EFCECF", +"` c #EECDCF", +" . c #CA3434", +".. c #C21616", +"+. c #E59F9F", +"@. c #BD1C1C", +"#. c #BC1C1C", +"$. c #EDCDCF", +"%. c #F0F8FF", +"&. c #FBEFEF", +"*. c #CB3434", +"=. c #DE3939", +"-. c #F64747", +";. c #C61A1A", +">. c #BE1C1C", +",. c #E83D3D", +"'. c #E73C3C", +"). c #BC1B1B", +"!. c #ECCDCF", +"~. c #F0F7FF", +"{. c #E3F1FF", +"]. c #CC3434", +"^. c #DF3939", +"/. c #FF6969", +"(. c #FF7A7A", +"_. c #F0CECF", +":. c #BF1C1C", +"<. c #FB6363", +"[. c #FB6161", +"}. c #E73737", +"|. c #BC1A1A", +"1. c #EBCCCF", +"2. c #CD3434", +"3. c #FFA3A3", +"4. c #FF8080", +"5. c #C01C1C", +"6. c #FB9E9E", +"7. c #FB9D9D", +"8. c #FB5E5E", +"9. c #E73333", +"0. c #BC1919", +"a. c #EBCBCF", +"b. c #E0EFFF", +"c. c #B5D9FF", +"d. c #CE3434", +"e. c #E03939", +"f. c #FF6868", +"g. c #FFA1A1", +"h. c #FE7F7F", +"i. c #F54747", +"j. c #E59E9F", +"k. c #C11C1C", +"l. c #E93D3D", +"m. c #FB6362", +"n. c #FB9C9C", +"o. c #FB9B9B", +"p. c #FB9A9A", +"q. c #FA9999", +"r. c #FA5A59", +"s. c #E62F2F", +"t. c #BC1819", +"u. c #EACBCF", +"v. c #EBF5FF", +"w. c #E5F1FF", +"x. c #99CCFF", +"y. c #CF3434", +"z. c #E13939", +"A. c #FE6665", +"B. c #FE9C9B", +"C. c #FE7C7A", +"D. c #DC7F7F", +"E. c #C21C1C", +"F. c #FC6160", +"G. c #FB9796", +"H. c #FB9695", +"I. c #FB9594", +"J. c #FB9493", +"K. c #FA9392", +"L. c #FA9291", +"M. c #F94242", +"N. c #E62B2B", +"O. c #BC1818", +"P. c #E9CBCF", +"Q. c #EDF6FF", +"R. c #E9F4FF", +"S. c #E2F0FF", +"T. c #D03434", +"U. c #E23939", +"V. c #FE6463", +"W. c #FE9794", +"X. c #FD7876", +"Y. c #F44646", +"Z. c #C82222", +"`. c #EA3D3D", +" + c #FC5F5D", +".+ c #FD928F", +"++ c #FD918E", +"@+ c #FD908D", +"#+ c #FC8F8C", +"$+ c #FC8E8B", +"%+ c #FC8D8A", +"&+ c #FB8683", +"*+ c #F93434", +"=+ c #F82C2C", +"-+ c #E52727", +";+ c #BC1717", +">+ c #E8CBCF", +",+ c #E1F0FF", +"'+ c #D13434", +")+ c #FE6260", +"!+ c #FE918D", +"~+ c #FD7370", +"{+ c #FC5D5B", +"]+ c #FD8D88", +"^+ c #FD8C87", +"/+ c #FD8A86", +"(+ c #FC8985", +"_+ c #FC8884", +":+ c #FC8783", +"<+ c #FC8682", +"[+ c #FA6462", +"}+ c #F82A2A", +"|+ c #F82727", +"1+ c #E52323", +"2+ c #BC1616", +"3+ c #E7CACF", +"4+ c #EFF6FF", +"5+ c #E6F3FF", +"6+ c #CEE6FF", +"7+ c #D23434", +"8+ c #E33939", +"9+ c #FE5C5A", +"0+ c #FE8C87", +"a+ c #FE8C86", +"b+ c #FD8B85", +"c+ c #FD8984", +"d+ c #FC7672", +"e+ c #FD8782", +"f+ c #FD8681", +"g+ c #FD8580", +"h+ c #FC847F", +"i+ c #FC837E", +"j+ c #FC827D", +"k+ c #FC817B", +"l+ c #FC807A", +"m+ c #F83636", +"n+ c #F72525", +"o+ c #F72323", +"p+ c #E41F1F", +"q+ c #BA1313", +"r+ c #EAD9DF", +"s+ c #EBF4FF", +"t+ c #CDE6FF", +"u+ c #DC5F5F", +"v+ c #D92C2C", +"w+ c #FC4B4A", +"x+ c #FE7B76", +"y+ c #FE8780", +"z+ c #FD8780", +"A+ c #FD8680", +"B+ c #FD857F", +"C+ c #FD847D", +"D+ c #FC837C", +"E+ c #FC827B", +"F+ c #FC817A", +"G+ c #FC8079", +"H+ c #FC7F78", +"I+ c #FC7E77", +"J+ c #FB7D76", +"K+ c #FB7C75", +"L+ c #FB7A74", +"M+ c #F95C58", +"N+ c #F62121", +"O+ c #D71919", +"P+ c #C13031", +"Q+ c #EBE7EF", +"R+ c #DFEFFF", +"S+ c #FC4A4A", +"T+ c #FE7770", +"U+ c #FD8179", +"V+ c #FD8078", +"W+ c #FD7F77", +"X+ c #FC7E76", +"Y+ c #FC7D75", +"Z+ c #FC7C74", +"`+ c #FC7A72", +" @ c #FC7971", +".@ c #FC7870", +"+@ c #FB776F", +"@@ c #FB766E", +"#@ c #FB756D", +"$@ c #FA6F68", +"%@ c #F82E2E", +"&@ c #C23031", +"*@ c #EAE7EF", +"=@ c #CCE5FF", +"-@ c #FC4A49", +";@ c #FD726B", +">@ c #FD7C73", +",@ c #FD7A71", +"'@ c #FD7970", +")@ c #FC786F", +"!@ c #FC776E", +"~@ c #FC766D", +"{@ c #FC756C", +"]@ c #FC746B", +"^@ c #FC736A", +"/@ c #FB7269", +"(@ c #FB7168", +"_@ c #FB7066", +":@ c #FB6E65", +"<@ c #F83F3C", +"[@ c #D81919", +"}@ c #C33031", +"|@ c #E8E6EF", +"1@ c #DDEEFF", +"2@ c #CBE5FF", +"3@ c #FB4A49", +"4@ c #FC6E65", +"5@ c #FC776C", +"6@ c #FC766C", +"7@ c #FC756B", +"8@ c #FC746A", +"9@ c #FC7369", +"0@ c #FC7267", +"a@ c #FC7166", +"b@ c #FC7065", +"c@ c #FB6F64", +"d@ c #FB6E63", +"e@ c #FB6D62", +"f@ c #FB6B61", +"g@ c #FB6A60", +"h@ c #FA695F", +"i@ c #F94944", +"j@ c #D91919", +"k@ c #C43031", +"l@ c #DCEDFF", +"m@ c #CBE4FF", +"n@ c #FA4949", +"o@ c #FC6960", +"p@ c #FC7064", +"q@ c #FC6F63", +"r@ c #FC6E62", +"s@ c #FC6D61", +"t@ c #FC6C60", +"u@ c #FC6A5F", +"v@ c #FB695D", +"w@ c #FB685C", +"x@ c #FB675B", +"y@ c #FB665A", +"z@ c #FB6559", +"A@ c #FA6458", +"B@ c #F94641", +"C@ c #C53031", +"D@ c #E7E5EF", +"E@ c #DBEDFF", +"F@ c #CAE4FF", +"G@ c #DB5F5F", +"H@ c #D82C2C", +"I@ c #FA4646", +"J@ c #FC6258", +"K@ c #FC685B", +"L@ c #FC675A", +"M@ c #FC6659", +"N@ c #FC6558", +"O@ c #FB6457", +"P@ c #FB6356", +"Q@ c #FB6255", +"R@ c #FB6154", +"S@ c #FB6053", +"T@ c #FA5B4F", +"U@ c #F83A36", +"V@ c #DA1919", +"W@ c #C52F31", +"X@ c #C9E4FF", +"Y@ c #F3CECF", +"Z@ c #CB0C0C", +"`@ c #F04242", +" # c #FB4F48", +".# c #FB6253", +"+# c #FB6152", +"@# c #FB6051", +"## c #FB5E50", +"$# c #FB5D4F", +"%# c #FA5C4E", +"&# c #FA5B4D", +"*# c #FA5A4C", +"=# c #F94B41", +"-# c #F11F1F", +";# c #C70C0C", +"># c #D5898F", +",# c #DAECFF", +"'# c #CF1C1C", +")# c #ED3D3D", +"!# c #FB4B45", +"~# c #FB5C4D", +"{# c #FB5B4C", +"]# c #FB5A4B", +"^# c #FB594A", +"/# c #FB5849", +"(# c #FA5748", +"_# c #FA5646", +":# c #F95244", +"<# c #F83834", +"[# c #F72A2A", +"}# c #F61F1F", +"|# c #F31D1D", +"1# c #E91A1A", +"2# c #C50909", +"3# c #D7989F", +"4# c #D9ECFF", +"5# c #C8E3FF", +"6# c #D01C1C", +"7# c #EE3D3D", +"8# c #FB4943", +"9# c #FB5948", +"0# c #FB5847", +"a# c #FB5746", +"b# c #FB5545", +"c# c #FA5444", +"d# c #FA5343", +"e# c #F95242", +"f# c #F8463B", +"g# c #F62E2D", +"h# c #F52A2A", +"i# c #F52727", +"j# c #F52525", +"k# c #F52323", +"l# c #F51F1F", +"m# c #F11D1D", +"n# c #EF1A1A", +"o# c #EF1818", +"p# c #E91616", +"q# c #C50707", +"r# c #D6979F", +"s# c #D8EBFF", +"t# c #F4CECF", +"u# c #D11C1C", +"v# c #FA5545", +"w# c #F95343", +"x# c #F85041", +"y# c #F53934", +"z# c #F32C2C", +"A# c #F12A2A", +"B# c #F12727", +"C# c #F12525", +"D# c #F12323", +"E# c #F22121", +"F# c #EE1D1D", +"G# c #EE1A1A", +"H# c #EE1616", +"I# c #ED1414", +"J# c #E71212", +"K# c #C50606", +"L# c #D5979F", +"M# c #D7EBFF", +"N# c #C7E3FF", +"O# c #D31C1C", +"P# c #EF3D3D", +"Q# c #F95444", +"R# c #F85343", +"S# c #F6493D", +"T# c #F2302F", +"U# c #F02C2C", +"V# c #EF2A2A", +"W# c #EE2727", +"X# c #EE2525", +"Y# c #ED2323", +"Z# c #EE2121", +"`# c #EB1F1F", +" $ c #E91D1D", +".$ c #EA1A1A", +"+$ c #EB1818", +"@$ c #EC1616", +"#$ c #ED1212", +"$$ c #ED0F0F", +"%$ c #E70D0D", +"&$ c #C50404", +"*$ c #D4969F", +"=$ c #D6EAFF", +"-$ c #C6E2FF", +";$ c #D41C1C", +">$ c #F4433A", +",$ c #F02E2E", +"'$ c #EE2C2C", +")$ c #EC2A2A", +"!$ c #EB2727", +"~$ c #EB2525", +"{$ c #EA2323", +"]$ c #E92121", +"^$ c #E51F1F", +"/$ c #E51D1D", +"($ c #E51A1A", +"_$ c #E71818", +":$ c #E71616", +"<$ c #E91414", +"[$ c #EA1212", +"}$ c #EC0F0F", +"|$ c #EC0D0D", +"1$ c #EB0B0B", +"2$ c #E50909", +"3$ c #C50202", +"4$ c #D3969F", +"5$ c #D5EAFF", +"6$ c #EEF6FF", +"7$ c #FAEEEF", +"8$ c #D31414", +"9$ c #EB3D3D", +"0$ c #FB4843", +"a$ c #F75343", +"b$ c #F23D37", +"c$ c #EF2E2E", +"d$ c #EC2C2C", +"e$ c #EA2A2A", +"f$ c #E92727", +"g$ c #E82525", +"h$ c #E62323", +"i$ c #E32121", +"j$ c #E11F1F", +"k$ c #E11D1D", +"l$ c #E11A1A", +"m$ c #E21818", +"n$ c #E31616", +"o$ c #E41414", +"p$ c #E61212", +"q$ c #E70F0F", +"r$ c #E90D0D", +"s$ c #EA0909", +"t$ c #EA0707", +"u$ c #E30404", +"v$ c #C00000", +"w$ c #D8C2CF", +"x$ c #C5E2FF", +"y$ c #EB9E9F", +"z$ c #D71818", +"A$ c #F53F3E", +"B$ c #FB5245", +"C$ c #EE2E2E", +"D$ c #EB2C2C", +"E$ c #E92A2A", +"F$ c #E72727", +"G$ c #E52525", +"H$ c #E22323", +"I$ c #DE2121", +"J$ c #DD1F1F", +"K$ c #DD1D1D", +"L$ c #DD1A1A", +"M$ c #DD1818", +"N$ c #DE1616", +"O$ c #DF1414", +"P$ c #E11212", +"Q$ c #E20F0F", +"R$ c #E40D0D", +"S$ c #E60B0B", +"T$ c #E80909", +"U$ c #E80404", +"V$ c #CE0202", +"W$ c #C9595F", +"X$ c #D4E9FF", +"Y$ c #C4E1FF", +"Z$ c #EA9E9F", +"`$ c #D71616", +" % c #F53B3A", +".% c #FA4F42", +"+% c #F3433A", +"@% c #E82A2A", +"#% c #E62727", +"$% c #E22525", +"%% c #DD2323", +"&% c #DB2121", +"*% c #CE1D1D", +"=% c #D71D1D", +"-% c #D81A1A", +";% c #D91818", +">% c #D91616", +",% c #DB1414", +"'% c #DC1212", +")% c #DE0F0F", +"!% c #DF0D0D", +"~% c #E20B0B", +"{% c #E40909", +"]% c #E60707", +"^% c #E70404", +"/% c #CF0202", +"(% c #CA595F", +"_% c #D3E9FF", +":% c #EDF5FF", +"<% c #EA9D9F", +"[% c #D71414", +"}% c #F33735", +"|% c #F84D40", +"1% c #F64E3F", +"2% c #E42727", +"3% c #DE2525", +"4% c #DB2323", +"5% c #D92121", +"6% c #CA1919", +"7% c #C91111", +"8% c #C61010", +"9% c #D31818", +"0% c #D51616", +"a% c #D61414", +"b% c #D71212", +"c% c #D90F0F", +"d% c #DB0D0D", +"e% c #DD0B0B", +"f% c #DF0909", +"g% c #E10707", +"h% c #E20404", +"i% c #CB595F", +"j% c #D2E8FF", +"k% c #C3E1FF", +"l% c #ECF5FF", +"m% c #E99D9F", +"n% c #D61313", +"o% c #EE3231", +"p% c #F13230", +"q% c #E62A2A", +"r% c #E22727", +"s% c #D82121", +"t% c #C91919", +"u% c #CF2F31", +"v% c #E7E4EF", +"w% c #D45B5F", +"x% c #C40E0E", +"y% c #D01414", +"z% c #D21212", +"A% c #D40F0F", +"B% c #D60D0D", +"C% c #D80B0B", +"D% c #DA0909", +"E% c #DC0707", +"F% c #DE0404", +"G% c #CC0202", +"H% c #CC595F", +"I% c #D1E8FF", +"J% c #C2E1FF", +"K% c #F7FAFF", +"L% c #E79C9F", +"M% c #D41111", +"N% c #E72C2C", +"O% c #E32727", +"P% c #DF2525", +"Q% c #D35B5F", +"R% c #C30B0B", +"S% c #CE0F0F", +"T% c #D10D0D", +"U% c #D30B0B", +"V% c #D50909", +"W% c #D80707", +"X% c #D90404", +"Y% c #CA0202", +"Z% c #CD595F", +"`% c #ADD6FF", +" & c #F4F9FF", +".& c #E49A9F", +"+& c #D20F0F", +"@& c #E12727", +"#& c #E12525", +"$& c #CB1919", +"%& c #D12F31", +"&& c #D25A5F", +"*& c #C20808", +"=& c #CD0B0B", +"-& c #D10909", +";& c #D30707", +">& c #D50404", +",& c #C80202", +"'& c #CE595F", +")& c #C1E0FF", +"!& c #DEEFFF", +"~& c #F2F9FF", +"{& c #E39A9F", +"]& c #D00E0E", +"^& c #CD1919", +"/& c #D22F31", +"(& c #C30505", +"_& c #CE0707", +":& c #D00404", +"<& c #C60202", +"[& c #C0DFFF", +"}& c #EEF7FF", +"|& c #E2999F", +"1& c #CF0C0C", +"2& c #CF1919", +"3& c #D32F31", +"4& c #D15A5F", +"5& c #C40303", +"6& c #CF595F", +"7& c #ECF6FF", +"8& c #E1999F", +"9& c #D52D2F", +"0& c #D1595F", +"a& c #D0595F", +"b& c #BFDFFF", +"c& c #EAF4FF", +"d& c #BFDEFF", +"e& c #BEDEFF", +"f& c #CAE5FF", +"g& c #BDDEFF", +"h& c #BCDDFF", +"i& c #BBDDFF", +"j& c #BADCFF", +"k& c #B9DCFF", +"l& c #C4E2FF", +"m& c #B8DBFF", +"n& c #889299", +"o& c #99C9F9", +"p& c #B0D7FF", +"q& c #97C7F7", +"r& c #A1B6CA", +"s& c #ACD5FF", +"t& c #ABD5FF", +"u& c #AAD5FF", +"v& c #AAD4FF", +"w& c #A9D4FF", +"x& c #A8D4FF", +"y& c #A8D3FF", +"z& c #A7D3FF", +"A& c #A6D2FF", +"B& c #A5D2FF", +"C& c #A4D2FF", +"D& c #A4D1FF", +"E& c #A3D1FF", +"F& c #8DA2B6", +"G& c #A2B2BF", +"H& c #9DBEDF", +"I& c #9BC3E9", +"J& c #9BC2E9", +"K& c #9BC2E8", +"L& c #9AC2E8", +"M& c #9AC1E8", +"N& c #9AC1E7", +"O& c #99C1E7", +"P& c #99C0E7", +"Q& c #99C0E6", +"R& c #98C0E6", +"S& c #98BFE6", +"T& c #98BFE5", +"U& c #97BFE5", +"V& c #97BEE5", +"W& c #97BEE4", +"X& c #96BEE4", +"Y& c #96BDE4", +"Z& c #96BDE3", +"`& c #95BDE3", +" * c #95BCE3", +".* c #95BCE2", +"+* c #94BCE2", +"@* c #90ABC5", +"#* c #8B9BA8", +"$* c #848889", +"%* c #999C9D", +"&* c #96999A", +"** c #959899", +"=* c #949798", +"-* c #939697", +";* c #929596", +">* c #909394", +",* c #8E9292", +"'* c #8D9091", +")* c #8B8E8F", +"!* c #888B8C", +"~* c #878A8B", +"{* c #868A8A", +"]* c #858889", +"^* c #848788", +"/* c #838787", +"(* c #818586", +"_* c #818485", +":* c #808485", +"<* c #7F8384", +"[* c #7F8383", +"}* c #787C7D", +" ", +" ", +" ", +" . + + @ # # $ % % & & * = = - ; ; > , , ' ) ) ! ! ~ { { ] ^ ^ / ( ( _ : : < < [ } } | 1 1 2 3 3 ", +" 4 5 6 6 7 7 7 8 8 8 9 9 9 0 0 0 a a a b b b c c c c d d d e e e f f f g g g h h h i i i j j j k l m ", +" 4 n o p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p q q q q q q q q r r s s s s s o t u ", +" 4 v w x x x x x x x x x x x x x x x x x x x x x x x x x x x y z z A A B C C D D E F G H I I I J K L M N ", +" 4 o I x x x x x x x x x x x x x x x x x x x x x x x x x x y z z A A B C C D D E F G H I I I J K K O o N ", +" 4 o P x x x x x x x x x x x x x x x x x x x x x x x x x y z z A A B C C D D E F G H I I I J K K Q R o N ", +" 4 o P x x x x x x x x x x x x x x x x x x x x x x x x y z z A A B C C D D E F G H I I I J K K Q Q R o N ", +" 4 o P x x x x x x x x x x x x x x x x x x x x x x x y z z A A B C C D D E F G H I I I J K K Q Q S T o N ", +" 4 o P x x x x x x x x x x x x x x x x x x x x x x y z z A A B C C D D E F G H I I I J K K Q Q S S T o N ", +" 4 o P x x x x x x x x x x x x x x x x x x x x x y z z A A B C C D D E F G H I I I J K K Q Q S S U T o N ", +" 4 o P x x x x x x x x x x x x x x x x x x x x y z z A A B C C D D E F G H I I I J K K Q Q S S U U V o N ", +" 4 o P x x x x x x x x x x x x x x x x x x x y z z A A B C C D D E F G H I I I J K K Q Q S S U U W V o N ", +" 4 o P x x x x x x x x x x X Y x x x x x x y z z A A Z ` C D D E F G H I I I J K K Q Q S S U U W W V o N ", +" 4 o P x x x x x x x x x X ...+.x x x x y z z A A Z @.#.$.D E F G H I I I J K K Q Q S S U U W W %.w o N ", +" 4 o P x x x x x x x x &.*.=.-.;.+.x x y z z A A Z >.,.'.).!.F G H I I I J K K Q Q S S U U W W %.~.{.o N ", +" 4 o P x x x x x x x &.].^./.(.-.;.+.y z z A A _.:.,.<.[.}.|.1.H I I I J K K Q Q S S U U W W %.~.P {.o N ", +" 4 o P x x x x x x &.2.^./.3.3.4.-.;.+.z A A _.5.,.<.6.7.8.9.0.a.I I J K K Q Q S S U U W W %.~.P P b.c.N ", +" 4 o P x x x x x &.d.e.f.g.g.g.g.h.i.;.j.A _.k.l.m.n.o.p.q.r.s.t.u.J K K Q Q S S U U W W %.P v.O w.q x.N ", +" 4 o P x x x x &.y.z.A.B.B.B.B.B.B.C.i.;.D.E.l.F.G.H.I.J.K.L.M.N.O.P.K Q Q S S U U W W Q.R.V w {.S.r x.N ", +" 4 o P x x x &.T.U.V.W.W.W.W.W.W.W.W.X.Y.Z.`. +.+++@+#+$+%+&+*+=+-+;+>+Q S S U U W Q.O T V w {.S.,+r x.N ", +" 4 o P x x &.'+U.)+!+!+!+!+!+!+!+!+!+!+~+M.{+]+^+/+(+_+:+<+[+=+}+|+1+2+3+S U U 4+O 5+T V w {.S.,+,+6+x.N ", +" 4 o P x &.7+8+9+0+0+0+0+0+0+0+0+0+a+b+c+d+e+f+g+h+i+j+k+l+m+}+|+n+o+p+q+r+~.s+R 5+T V w {.S.,+,+b.t+x.N ", +" 4 o P x x u+v+w+x+y+y+z+z+z+z+z+A+B+C+D+E+F+G+H+I+J+K+L+M+}+|+n+o+N+O+P+Q+R.R 5+T V w {.S.,+,+b.R+t+x.N ", +" 4 o P x x x u+v+S+T+U+U+U+U+U+U+V+W+X+Y+Z+`+ @.@+@@@#@$@%@|+n+o+N+O+&@*@O R 5+T V w {.S.,+,+b.R+L =@x.N ", +" 4 o P x x x x u+v+-@;@>@>@>@>@,@'@)@!@~@{@]@^@/@(@_@:@<@|+n+o+N+[@}@|@O R 5+T V w {.S.,+,+b.R+L 1@2@x.N ", +" 4 o P x x x x x u+v+3@4@5@6@7@8@9@0@a@b@c@d@e@f@g@h@i@|+n+o+N+j@k@|@O R 5+T V w {.S.,+,+b.R+L 1@l@m@x.N ", +" 4 o P x x x x y z u+v+n@o@p@q@r@s@t@u@v@w@x@y@z@A@B@|+n+o+N+j@C@D@O R 5+T V w {.S.,+,+b.R+L 1@l@E@F@x.N ", +" 4 o P x x x y z z A G@H@I@J@K@L@M@N@O@P@Q@R@S@T@U@|+n+o+N+V@W@D@O R 5+T V w {.S.,+,+b.R+L 1@l@E@E@X@x.N ", +" 4 o P x x y z z A A Y@Z@`@ #.#+#@###$#%#&#*#=#=+|+n+o+N+-#;#>#O R 5+T V w {.S.,+,+b.R+L 1@l@E@E@,#X@x.N ", +" 4 o P x y z z A A Y@'#)#!#~#{#]#^#/#(#_#:#<#[#|+n+o+N+}#|#1#2#3#5+T V w {.S.,+,+b.R+L 1@l@E@E@,#4#5#x.N ", +" 4 o P y z z A A Y@6#7#8#9#0#a#b#c#d#e#f#g#h#i#j#k#N+l#m#n#o#p#q#r#V w {.S.,+,+b.R+L 1@l@E@E@,#4#s#5#x.N ", +" 4 o P z z A A t#u#7#8#9#0#a#v#c#w#x#y#z#A#B#C#D#E#-#F#G#o#H#I#J#K#L#{.S.,+,+b.R+L 1@l@E@E@,#4#s#M#N#x.N ", +" 4 o 4+z A A t#O#P#8#9#0#a#v#Q#R#S#T#U#V#W#X#Y#Z#`# $.$+$@$I##$$$%$&$*$,+,+b.R+L 1@l@E@E@,#4#s#M#=$-$x.N ", +" 4 o 4+A A t#;$P#8#9#0#a#v#Q#R#>$,$'$)$!$~${$]$^$/$($_$:$<$[$}$|$1$2$3$4$b.R+L 1@l@E@E@,#4#s#M#=$5$-$x.N ", +" 4 o 6$A 7$8$9$0$9#0#a#v#Q#a$b$c$d$e$f$g$h$i$j$k$l$m$n$o$p$q$r$1$s$t$u$v$w$L 1@l@E@E@,#4#s#M#=$5$5$x$x.N ", +" 4 o 6$B C y$z$A$B$a#v#Q#a$b$C$D$E$F$G$H$I$J$K$L$M$N$O$P$Q$R$S$T$t$U$V$W$L 1@l@E@E@,#4#s#M#=$5$5$X$Y$x.N ", +" 4 o 6$C C D Z$`$ %.%Q#R#+%C$D$@%#%$%%%&%*%=%-%;%>%,%'%)%!%~%{%]%^%/%(%L 1@l@E@E@,#4#s#M#=$5$5$X$_%Y$x.N ", +" 4 o :%C D D E <%[%}%|%1%c$D$@%2%3%4%5%6%7%8%9%0%a%b%c%d%e%f%g%h%V$i%L 1@l@E@E@,#4#s#M#=$5$5$X$_%j%k%x.N ", +" 4 o l%D D E F G m%n%o%p%d$q%r%3%4%s%t%u%v%w%x%y%z%A%B%C%D%E%F%G%H%L 1@l@E@E@,#4#s#M#=$5$5$X$_%j%I%J%x.N ", +" 4 o l%D E F G H K%L%M%N%q%O%P%4%s%6%u%v%O R Q%R%S%T%U%V%W%X%Y%Z%L 1@l@E@E@,#4#s#M#=$5$5$X$_%j%I%q o x.N ", +" 4 `%V H I J &S U W .&+&@&#&%%5%$&%&v%O R 5+T &&*&=&-&;&>&,&'&L 1@l@E@E@,#4#s#M#=$5$5$X$_%j%I%q r )&x.N ", +" 4 x.!&K Q S ~&U W ~.P {&]&4%&%^&/&v%O R 5+T V w &&(&_&:&<&'&L 1@l@E@E@,#4#s#M#=$5$5$X$_%j%I%q r r [&x.N ", +" 4 x.L Q S ~&U W ~.P }&Q.|&1&2&3&v%O R 5+T V w {.S.4&5&3$6&L 1@l@E@E@,#4#s#M#=$5$5$X$_%j%I%q r r 6+[&x.N ", +" 4 x.1@S ~&U W ~.P }&Q.7&l%8&9&v%O R 5+T V w {.S.,+,+0&a&L 1@l@E@E@,#4#s#M#=$5$5$X$_%j%I%q r r 6+t+b&x.N ", +" 4 x.l@~&U W ~.P }&Q.7&l%v.c&R.O R 5+T V w {.S.,+,+b.R+L 1@l@E@E@,#4#s#M#=$5$5$X$_%j%I%q r r 6+t+=@d&x.N ", +" 4 x.l@U W ~.P }&Q.7&l%v.c&R.O R 5+T V w {.S.,+,+b.R+L 1@l@E@E@,#4#s#M#=$5$5$X$_%j%I%q r r 6+t+=@2@e&x.N ", +" 4 x.E@W ~.P }&Q.7&l%v.c&R.O R 5+T V w {.S.,+,+b.R+L 1@l@E@E@,#4#s#M#=$5$5$X$_%j%I%q r r 6+t+=@2@f&g&x.N ", +" 4 x.E@~.P }&Q.7&l%v.c&R.O R 5+T V w {.S.,+,+b.R+L 1@l@E@E@,#4#s#M#=$5$5$X$_%j%I%q r r 6+t+=@2@f&X@g&x.N ", +" 4 x.,#P }&Q.7&l%v.c&R.O R 5+T V w {.S.,+,+b.R+L 1@l@E@E@,#4#s#M#=$5$5$X$_%j%I%q r r 6+t+=@2@f&X@X@h&x.N ", +" 4 x.4#}&Q.7&l%v.c&R.O R 5+T V w {.S.,+,+b.R+L 1@l@E@E@,#4#s#M#=$5$5$X$_%j%I%q r r 6+t+=@2@f&X@X@5#i&x.N ", +" 4 x.4#Q.7&l%v.c&R.O R 5+T V w {.S.,+,+b.R+L 1@l@E@E@,#4#s#M#=$5$5$X$_%j%I%q r r 6+t+=@2@f&X@X@5#N#i&x.N ", +" 4 x.s#7&l%v.c&R.O R 5+T V w {.S.,+,+b.R+L 1@l@E@E@,#4#s#M#=$5$5$X$_%j%I%q r r 6+t+=@2@f&X@X@5#N#-$j&x.N ", +" 4 x.M#l%v.c&R.O R 5+T V w {.S.,+,+b.R+L 1@l@E@E@,#4#s#M#=$5$5$X$_%j%I%q r r 6+t+=@2@f&X@X@5#N#-$x$k&x.N ", +" 4 x.M#v.c&R.O R 5+T V w {.S.,+,+b.R+L 1@l@E@E@,#4#s#M#=$5$5$X$_%j%I%q r r 6+t+=@2@f&X@X@5#N#-$x$l&k&x.N ", +" 4 x.=$c&R.O R 5+T V w {.S.,+,+b.R+L 1@l@E@E@,#4#s#M#=$5$5$X$_%j%I%q r r 6+t+=@2@f&X@X@5#N#-$x$l&k%m&x.n& ", +" 4 o&-$R.O R 5+T V w {.S.,+,+b.R+L 1@l@E@E@,#4#s#M#=$5$5$X$_%j%I%q r r 6+t+=@2@f&X@X@5#N#-$x$l&k%J%p&q&N ", +" 4 r&x.`%s&s&s&s&t&t&t&t&t&u&v&v&v&v&w&w&w&w&x&y&y&y&y&z&z&z&z&z&A&A&A&A&B&B&B&B&B&C&D&D&D&D&E&E&E&x.F&u ", +" 4 G&H&I&J&J&J&K&L&L&M&M&M&N&N&O&P&P&P&Q&Q&R&S&S&S&S&T&U&U&V&V&V&W&X&X&Y&Y&Y&Z&Z&`& * * *.*.*+*@*#*$* ", +" . > , %*' ) ) ! &*~ **=*] -*^ ;*/ ( >*_ : ,*< '*[ } )*| 1 1 2 !*3 ~*{*N ]*$*^*/*u u (*_*:*<*[*}* ", +" ", +" "}; diff --git a/ksquirrel/ksquirrelpart/fmt_filters.cpp b/ksquirrel/ksquirrelpart/fmt_filters.cpp new file mode 100644 index 0000000..60e5278 --- /dev/null +++ b/ksquirrel/ksquirrelpart/fmt_filters.cpp @@ -0,0 +1,2287 @@ +/* + * Copyright (c) 2005 Dmitry Baryshev + */ + +/* This file is part of the KDE libraries + Copyright (C) 1998, 1999, 2001, 2002 Daniel M. Duley + (C) 1998, 1999 Christian Tibirna + (C) 1998, 1999 Dirk A. Mueller + (C) 1999 Geert Jansen + (C) 2000 Josef Weidendorfer + (C) 2004 Zack Rusin + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +*/ + +// +// =================================================================== +// Effects originally ported from ImageMagick for PixiePlus, plus a few +// new ones. (mosfet 05/26/2003) +// =================================================================== +// +/* + Portions of this software are based on ImageMagick. Such portions are clearly +marked as being ported from ImageMagick. ImageMagick is copyrighted under the +following conditions: + +Copyright (C) 2003 ImageMagick Studio, a non-profit organization dedicated to +making software imaging solutions freely available. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files ("ImageMagick"), to deal +in ImageMagick without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of ImageMagick, and to permit persons to whom the ImageMagick is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of ImageMagick. + +The software is provided "as is", without warranty of any kind, express or +implied, including but not limited to the warranties of merchantability, +fitness for a particular purpose and noninfringement. In no event shall +ImageMagick Studio be liable for any claim, damages or other liability, +whether in an action of contract, tort or otherwise, arising from, out of or +in connection with ImageMagick or the use or other dealings in ImageMagick. + +Except as contained in this notice, the name of the ImageMagick Studio shall +not be used in advertising or otherwise to promote the sale, use or other +dealings in ImageMagick without prior written authorization from the +ImageMagick Studio. +*/ + +#include "fmt_filters.h" + +#include +#include +#include +#include +#include + +namespace fmt_filters +{ + +#define MaxRGB 255L +#define DegreesToRadians(x) ((x)*M_PI/180.0) +#define MagickSQ2PI 2.50662827463100024161235523934010416269302368164062 +#define MagickEpsilon 1.0e-12 +#define MagickPI 3.14159265358979323846264338327950288419716939937510 + +#define F_MAX(a, b) ((b) < (a) ? (a) : (b)) +#define F_MIN(a, b) ((a) < (b) ? (a) : (b)) + +static void rgb2hsv(const fmt_filters::rgb &rgb, s32 *h, s32 *s, s32 *v); +static void hsv2rgb(s32 h, s32 s, s32 v, fmt_filters::rgb *rgb); +static fmt_filters::rgba interpolateColor(const fmt_filters::image &image, double x_offset, double y_offset, const fmt_filters::rgba &background); +static u32 generateNoise(u32 pixel, fmt_filters::NoiseType noise_type); +static u32 intensityValue(s32 r, s32 g, s32 b); +static u32 intensityValue(const fmt_filters::rgba &rr); +static s32 getBlurKernel(s32 width, double sigma, double **kernel); +static void blurScanLine(double *kernel, s32 width, fmt_filters::rgba *src, fmt_filters::rgba *dest, s32 columns); +static void hull(const s32 x_offset, const s32 y_offset, const s32 polarity, const s32 columns, + const s32 rows, u8 *f, u8 *g); +static bool convolveImage(fmt_filters::image *image, fmt_filters::rgba **dest, const unsigned int order, const double *kernel); +static int getOptimalKernelWidth(double radius, double sigma); + +template +static void scaleDown(T &val, T min, T max); + +struct double_packet +{ + double red; + double green; + double blue; + double alpha; +}; + +struct short_packet +{ + unsigned short int red; + unsigned short int green; + unsigned short int blue; + unsigned short int alpha; +}; + +bool checkImage(const image &im) +{ + return (im.rw && im.rh && im.w && im.h && im.data); +} + +// colorize tool +void colorize(const image &im, s32 red, s32 green, s32 blue) +{ + // check if all parameters are good + if(!checkImage(im)) + return; + + if(!red && !green && !blue) + return; + + u8 *bits; + s32 val; + s32 V[3] = { red, green, blue }; + + // add to RED component 'red' value, and check if the result is out of bounds. + // do the same with GREEN and BLUE channels. + for(s32 y = 0;y < im.h;++y) + { + bits = im.data + im.rw * y * sizeof(rgba); + + for(s32 x = 0;x < im.w;x++) + { + for(s32 v = 0;v < 3;++v) + { + val = (s32)*(bits + v) + V[v]; + + if(val > 255) + *(bits + v) = 255; + else if(val < 0) + *(bits + v) = 0; + else + *(bits + v) = val; + } + + bits += 4; + } + } +} + +// brightness tool +void brightness(const image &im, s32 bn) +{ + // check if all parameters are good + if(!checkImage(im)) + return; + + u8 *bits; + s32 val; + + // add to all color components 'bn' value, and check if the result is out of bounds. + for(s32 y = 0;y < im.h;++y) + { + bits = im.data + im.rw * y * sizeof(rgba); + + for(s32 x = 0;x < im.w;x++) + { + for(s32 v = 0;v < 3;v++) + { + val = bn + *bits; + *bits = val < 0 ? 0 : (val > 255 ? 255 : val); + + bits++; + } + + bits++; + } + } +} + +// gamma tool +void gamma(const image &im, double L) +{ + // check if all parameters are good + if(!checkImage(im)) + return; + + if(L == 0 || L < 0) L = 0.01; + + rgba *_rgba; + u8 R, G, B; + u8 GT[256]; + + GT[0] = 0; + + // fill the array with gamma koefficients + for (s32 x = 1; x < 256; ++x) + GT[x] = (u8)round(255 * pow((double)x / 255.0, 1.0 / L)); + + // now change gamma + for(s32 y = 0;y < im.h;++y) + { + _rgba = (rgba *)im.data + im.rw * y; + + for(s32 x = 0;x < im.w;x++) + { + R = _rgba[x].r; + G = _rgba[x].g; + B = _rgba[x].b; + + _rgba[x].r = GT[R]; + _rgba[x].g = GT[G]; + _rgba[x].b = GT[B]; + } + } +} + +// contrast tool +void contrast(const image &im, s32 contrast) +{ + if(!checkImage(im) || !contrast) + return; + + if(contrast < -255) contrast = -255; + if(contrast > 255) contrast = 255; + + rgba *bits; + u8 Ravg, Gavg, Bavg; + s32 Ra = 0, Ga = 0, Ba = 0, Rn, Gn, Bn; + + // calculate the average values for RED, GREEN and BLUE + // color components + for(s32 y = 0;y < im.h;y++) + { + bits = (rgba *)im.data + im.rw * y; + + for(s32 x = 0;x < im.w;x++) + { + Ra += bits->r; + Ga += bits->g; + Ba += bits->b; + + bits++; + } + } + + s32 S = im.w * im.h; + + Ravg = Ra / S; + Gavg = Ga / S; + Bavg = Ba / S; + + // ok, now change contrast + // with the terms of alghoritm: + // + // if contrast > 0: I = (I - Avg) * 256 / (256 - contrast) + Avg + // if contrast < 0: I = (I - Avg) * (256 + contrast) / 256 + Avg + // + // where + // I - current color component value + // Avg - average value of this component (Ravg, Gavg or Bavg) + // + for(s32 y = 0;y < im.h;y++) + { + bits = (rgba *)im.data + im.rw * y; + + for(s32 x = 0;x < im.w;x++) + { + Rn = (contrast > 0) ? ((bits->r - Ravg) * 256 / (256 - contrast) + Ravg) : ((bits->r - Ravg) * (256 + contrast) / 256 + Ravg); + Gn = (contrast > 0) ? ((bits->g - Gavg) * 256 / (256 - contrast) + Gavg) : ((bits->g - Gavg) * (256 + contrast) / 256 + Gavg); + Bn = (contrast > 0) ? ((bits->b - Bavg) * 256 / (256 - contrast) + Bavg) : ((bits->b - Bavg) * (256 + contrast) / 256 + Bavg); + + bits->r = Rn < 0 ? 0 : (Rn > 255 ? 255 : Rn); + bits->g = Gn < 0 ? 0 : (Gn > 255 ? 255 : Gn); + bits->b = Bn < 0 ? 0 : (Bn > 255 ? 255 : Bn); + + bits++; + } + } +} + +// negative +void negative(const image &im) +{ + // check if all parameters are good + if(!checkImage(im)) + return; + + rgba *bits; + u8 R, G, B; + + for(s32 y = 0;y < im.h;y++) + { + bits = (rgba *)im.data + im.rw * y; + + for(s32 x = 0;x < im.w;x++) + { + R = bits->r; + G = bits->g; + B = bits->b; + + bits->r = 255 - R; + bits->g = 255 - G; + bits->b = 255 - B; + + bits++; + } + } +} + +// swap RGB values +void swapRGB(const image &im, s32 type) +{ + // check if all parameters are good + if(!checkImage(im) || (type != GBR && type != BRG)) + return; + + rgba *bits; + u8 R, G, B; + + for(s32 y = 0;y < im.h;y++) + { + bits = (rgba *)im.data + im.rw * y; + + for(s32 x = 0;x < im.w;x++) + { + R = bits->r; + G = bits->g; + B = bits->b; + + bits->r = (type == GBR) ? G : B; + bits->g = (type == GBR) ? B : R; + bits->b = (type == GBR) ? R : G; + + bits++; + } + } +} + +// blend +void blend(const image &im, const rgb &rgb, float opacity) +{ + // check parameters + if(!checkImage(im)) + return; + + scaleDown(opacity, 0.0f, 1.0f); + + rgba *bits; + s32 r = rgb.r, g = rgb.g, b = rgb.b; + + // blend! + for(s32 y = 0;y < im.h;++y) + { + bits = (rgba *)im.data + im.rw * y; + + for(s32 x = 0;x < im.w;x++) + { + bits->r = bits->r + (u8)((b - bits->r) * opacity); + bits->g = bits->g + (u8)((g - bits->g) * opacity); + bits->b = bits->b + (u8)((r - bits->b) * opacity); + + bits++; + } + } +} + +void flatten(const image &im, const rgb &ca, const rgb &cb) +{ + if(!checkImage(im)) + return; + + s32 r1 = ca.r; s32 r2 = cb.r; + s32 g1 = ca.g; s32 g2 = cb.g; + s32 b1 = ca.b; s32 b2 = cb.b; + s32 min = 0, max = 255; + s32 mean; + + rgba *bits; + rgb _rgb; + + for(s32 y = 0;y < im.h;++y) + { + bits = (rgba *)im.data + im.rw * y; + + for(s32 x = 0;x < im.w;++x) + { + mean = (bits->r + bits->g + bits->b) / 3; + min = F_MIN(min, mean); + max = F_MAX(max, mean); + bits++; + } + } + + // Conversion factors + float sr = ((float) r2 - r1) / (max - min); + float sg = ((float) g2 - g1) / (max - min); + float sb = ((float) b2 - b1) / (max - min); + + // Repaint the image + for(s32 y = 0;y < im.h;++y) + { + bits = (rgba *)im.data + im.w*y; + + for(s32 x = 0;x < im.w;++x) + { + mean = (bits->r + bits->g + bits->b) / 3; + + bits->r = (s32)(sr * (mean - min) + r1 + 0.5); + bits->g = (s32)(sg * (mean - min) + g1 + 0.5); + bits->b = (s32)(sb * (mean - min) + b1 + 0.5); + + bits++; + } + } +} + +void fade(const image &im, const rgb &rgb, float val) +{ + if(!checkImage(im)) + return; + + u8 tbl[256]; + + for (s32 i = 0;i < 256;i++) + tbl[i] = (s32)(val * i + 0.5); + + s32 r, g, b, cr, cg, cb; + + rgba *bits; + + for(s32 y = 0;y < im.h;y++) + { + bits = (rgba *)im.data + im.rw * y; + + for(s32 x = 0;x < im.w;x++) + { + cr = bits->r; + cg = bits->g; + cb = bits->b; + + r = (cr > rgb.r) ? (cr - tbl[cr - rgb.r]) : (cr + tbl[rgb.r - cr]); + g = (cg > rgb.g) ? (cg - tbl[cg - rgb.g]) : (cg + tbl[rgb.g - cg]); + b = (cb > rgb.b) ? (cb - tbl[cb - rgb.b]) : (cb + tbl[rgb.b - cb]); + + bits->r = r; + bits->g = g; + bits->b = b; + + bits++; + } + } +} + +void gray(const image &im) +{ + if(!checkImage(im)) + return; + + rgba *bits; + s32 g; + + for(s32 y = 0;y < im.h;y++) + { + bits = (rgba *)im.data + im.rw * y; + + for(s32 x = 0;x < im.w;x++) + { + g = (bits->r * 11 + bits->g * 16 + bits->b * 5)/32; + + bits->r = g; + bits->g = g; + bits->b = g; + + bits++; + } + } +} + +void desaturate(const image &im, float desat) +{ + if(!checkImage(im)) + return; + + scaleDown(desat, 0.0f, 1.0f); + + rgba *bits; + s32 h = 0, s = 0, v = 0; + + for(s32 y = 0;y < im.h;y++) + { + bits = (rgba *)im.data + im.rw * y; + + for(s32 x = 0;x < im.w;x++) + { + rgb _rgb(bits->r, bits->g, bits->b); + rgb2hsv(_rgb, &h, &s, &v); + hsv2rgb(h, (s32)(s * (1.0 - desat)), v, &_rgb); + + bits->r = _rgb.r; + bits->g = _rgb.g; + bits->b = _rgb.b; + + bits++; + } + } +} + +void threshold(const image &im, u32 trh) +{ + if(!checkImage(im)) + return; + + scaleDown(trh, (u32)0, (u32)255); + + rgba *bits; + + for(s32 y = 0;y < im.h;y++) + { + bits = (rgba *)im.data + im.rw * y; + + for(s32 x = 0;x < im.w;x++) + { + if(intensityValue(bits->r, bits->g, bits->b) < trh) + bits->r = bits->g = bits->b = 0; + else + bits->r = bits->g = bits->b = 255; + + bits++; + } + } +} + +void solarize(const image &im, double factor) +{ + if(!checkImage(im)) + return; + + s32 threshold; + rgba *bits; + + threshold = (s32)(factor * (MaxRGB+1)/100.0); + + for(s32 y = 0;y < im.h;y++) + { + bits = (rgba *)im.data + im.rw * y; + + for(s32 x = 0;x < im.w;x++) + { + bits->r = bits->r > threshold ? MaxRGB-bits->r : bits->r; + bits->g = bits->g > threshold ? MaxRGB-bits->g : bits->g; + bits->b = bits->b > threshold ? MaxRGB-bits->b : bits->b; + + bits++; + } + } +} + +void spread(const image &im, u32 amount) +{ + if(!checkImage(im) || im.w < 3 || im.h < 3) + return; + + rgba *n = new rgba [im.rw * im.rh]; + + if(!n) + return; + + s32 quantum; + s32 x_distance, y_distance; + rgba *bits = (rgba *)im.data, *q; + + memcpy(n, im.data, im.rw * im.rh * sizeof(rgba)); + + quantum = (amount+1) >> 1; + + for(s32 y = 0;y < im.h;y++) + { + q = n + im.rw*y; + + for(s32 x = 0;x < im.w;x++) + { + x_distance = x + ((rand() & (amount+1))-quantum); + y_distance = y + ((rand() & (amount+1))-quantum); + x_distance = F_MIN(x_distance, im.w-1); + y_distance = F_MIN(y_distance, im.h-1); + + if(x_distance < 0) x_distance = 0; + if(y_distance < 0) y_distance = 0; + + *q++ = *(bits + y_distance*im.rw + x_distance); + } + } + + memcpy(im.data, n, im.rw * im.rh * sizeof(rgba)); + + delete [] n; +} + +void swirl(const image &im, double degrees, const rgba &background) +{ + if(!checkImage(im)) + return; + + double cosine, distance, factor, radius, sine, x_center, x_distance, + x_scale, y_center, y_distance, y_scale; + s32 x, y; + + rgba *q, *p; + rgba *bits = (rgba *)im.data; + rgba *dest = new rgba [im.rw * im.rh]; + + if(!dest) + return; + + memcpy(dest, im.data, im.rw * im.rh * sizeof(rgba)); + + // compute scaling factor + x_center = im.w / 2.0; + y_center = im.h / 2.0; + + radius = F_MAX(x_center, y_center); + x_scale=1.0; + y_scale=1.0; + + if(im.w > im.h) + y_scale=(double)im.w / im.h; + else if(im.w < im.h) + x_scale=(double)im.h / im.w; + + degrees = DegreesToRadians(degrees); + + // swirl each row + + for(y = 0;y < im.h;y++) + { + p = bits + im.rw * y; + q = dest + im.rw * y; + y_distance = y_scale * (y-y_center); + + for(x = 0;x < im.w;x++) + { + // determine if the pixel is within an ellipse + *q = *p; + x_distance = x_scale*(x-x_center); + distance = x_distance*x_distance+y_distance*y_distance; + + if(distance < (radius*radius)) + { + // swirl + factor = 1.0 - sqrt(distance)/radius; + sine = sin(degrees*factor*factor); + cosine = cos(degrees*factor*factor); + + *q = interpolateColor(im, + (cosine*x_distance-sine*y_distance)/x_scale+x_center, + (sine*x_distance+cosine*y_distance)/y_scale+y_center, + background); + } + + p++; + q++; + } + } + + memcpy(im.data, dest, im.rw * im.rh * sizeof(rgba)); + + delete [] dest; +} + +void noise(const image &im, NoiseType noise_type) +{ + if(!checkImage(im)) + return; + + s32 x, y; + rgba *dest = new rgba [im.rw * im.rh]; + + if(!dest) + return; + + rgba *bits; + rgba *destData; + + for(y = 0;y < im.h;++y) + { + bits = (rgba *)im.data + im.rw * y; + destData = dest + im.rw * y; + + for(x = 0;x < im.w;++x) + { + destData[x].r = generateNoise(bits->r, noise_type); + destData[x].g = generateNoise(bits->g, noise_type); + destData[x].b = generateNoise(bits->b, noise_type); + destData[x].a = bits->a; + + bits++; + } + } + + memcpy(im.data, dest, im.rw * im.rh * sizeof(rgba)); + + delete [] dest; +} + +void implode(const image &im, double _factor, const rgba &background) +{ + if(!checkImage(im)) + return; + + double amount, distance, radius; + double x_center, x_distance, x_scale; + double y_center, y_distance, y_scale; + rgba *dest; + s32 x, y; + + rgba *n = new rgba [im.rw * im.rh]; + + if(!n) + return; + + rgba *bits; + + // compute scaling factor + x_scale = 1.0; + y_scale = 1.0; + x_center = (double)0.5*im.w; + y_center = (double)0.5*im.h; + radius=x_center; + + if(im.w > im.h) + y_scale = (double)im.w/im.h; + else if(im.w < im.h) + { + x_scale = (double)im.h/im.w; + radius = y_center; + } + + amount=_factor/10.0; + + if(amount >= 0) + amount/=10.0; + + double factor; + + for(y = 0;y < im.h;++y) + { + bits = (rgba *)im.data + im.rw * y; + dest = n + im.rw * y; + + y_distance = y_scale * (y-y_center); + + for(x = 0;x < im.w;++x) + { + x_distance = x_scale*(x-x_center); + distance= x_distance*x_distance+y_distance*y_distance; + + if(distance < (radius*radius)) + { + // Implode the pixel. + factor = 1.0; + + if(distance > 0.0) + factor = pow(sin(0.5000000000000001*M_PI*sqrt(distance)/radius),-amount); + + *dest = interpolateColor(im, factor*x_distance/x_scale+x_center, + factor*y_distance/y_scale+y_center, + background); + } + else + *dest = *bits; + + bits++; + dest++; + } + } + + memcpy(im.data, n, im.rw * im.rh * sizeof(rgba)); + + delete [] n; +} + +void despeckle(const image &im) +{ + if(!checkImage(im)) + return; + + s32 i, j, x, y; + u8 *blue_channel, *red_channel, *green_channel, *buffer, *alpha_channel; + s32 packets; + + static const s32 + X[4] = {0, 1, 1,-1}, + Y[4] = {1, 0, 1, 1}; + + rgba *n = new rgba [im.rw * im.rh]; + + if(!n) + return; + + packets = (im.w+2) * (im.h+2); + + red_channel = new u8 [packets]; + green_channel = new u8 [packets]; + blue_channel = new u8 [packets]; + alpha_channel = new u8 [packets]; + buffer = new u8 [packets]; + + if(!red_channel || ! green_channel || ! blue_channel || ! alpha_channel || !buffer) + { + if(red_channel) delete [] red_channel; + if(green_channel) delete [] green_channel; + if(blue_channel) delete [] blue_channel; + if(alpha_channel) delete [] alpha_channel; + if(buffer) delete [] buffer; + + delete [] n; + + return; + } + + // copy image pixels to color component buffers + j = im.w+2; + + rgba *bits; + + for(y = 0;y < im.h;++y) + { + bits = (rgba *)im.data + im.rw*y; + ++j; + + for(x = 0;x < im.w;++x) + { + red_channel[j] = bits->r; + green_channel[j] = bits->g; + blue_channel[j] = bits->b; + alpha_channel[j] = bits->a; + + bits++; + ++j; + } + + ++j; + } + + // reduce speckle in red channel + for(i = 0;i < 4;i++) + { + hull(X[i],Y[i],1,im.w,im.h,red_channel,buffer); + hull(-X[i],-Y[i],1,im.w,im.h,red_channel,buffer); + hull(-X[i],-Y[i],-1,im.w,im.h,red_channel,buffer); + hull(X[i],Y[i],-1,im.w,im.h,red_channel,buffer); + } + + // reduce speckle in green channel + for(i = 0;i < packets;i++) + buffer[i] = 0; + + for(i = 0;i < 4;i++) + { + hull(X[i],Y[i],1,im.w,im.h,green_channel,buffer); + hull(-X[i],-Y[i],1,im.w,im.h,green_channel,buffer); + hull(-X[i],-Y[i],-1,im.w,im.h,green_channel,buffer); + hull(X[i],Y[i],-1,im.w,im.h,green_channel,buffer); + } + + // reduce speckle in blue channel + for(i = 0;i < packets;i++) + buffer[i] = 0; + + for(i = 0;i < 4;i++) + { + hull(X[i],Y[i],1,im.w,im.h,blue_channel,buffer); + hull(-X[i],-Y[i],1,im.w,im.h,blue_channel,buffer); + hull(-X[i],-Y[i],-1,im.w,im.h,blue_channel,buffer); + hull(X[i],Y[i],-1,im.w,im.h,blue_channel,buffer); + } + + // copy color component buffers to despeckled image + j = im.w+2; + + for(y = 0;y < im.h;++y) + { + bits = n + im.rw*y; + ++j; + + for(x = 0;x < im.w;++x) + { + *bits = rgba(red_channel[j], green_channel[j], blue_channel[j], alpha_channel[j]); + + bits++; + ++j; + } + + ++j; + } + + delete [] buffer; + delete [] red_channel; + delete [] green_channel; + delete [] blue_channel; + delete [] alpha_channel; + + memcpy(im.data, n, im.rw * im.rh * sizeof(rgba)); + + delete [] n; +} + +void blur(const image &im, double radius, double sigma) +{ + if(!checkImage(im)) + return; + + double *kernel; + rgba *dest; + s32 width; + s32 x, y; + rgba *scanline, *temp; + rgba *p, *q; + + if(sigma == 0.0) + return; + + kernel = 0; + + if(radius > 0) + width = getBlurKernel((s32)(2*ceil(radius)+1), sigma, &kernel); + else + { + double *last_kernel = 0; + + width = getBlurKernel(3, sigma, &kernel); + + while((long)(MaxRGB * kernel[0]) > 0) + { + if(last_kernel) + delete [] last_kernel; + + last_kernel = kernel; + kernel = 0; + + width = getBlurKernel(width+2, sigma, &kernel); + } + + if(last_kernel) + { + delete [] kernel; + width -= 2; + kernel = last_kernel; + } + } + + if(width < 3) + { + delete [] kernel; + return; + } + + dest = new rgba [im.rw * im.rh]; + + if(!dest) + { + delete [] kernel; + return; + } + + scanline = new rgba [im.h]; + temp = new rgba [im.h]; + + if(!scanline || !temp) + { + if(scanline) delete [] scanline; + if(temp) delete [] temp; + + delete [] kernel; + return; + } + + rgba *bits = (rgba *)im.data; + + for(y = 0;y < im.h;++y) + { + p = bits + im.rw*y; + q = dest + im.rw*y; + + blurScanLine(kernel, width, p, q, im.w); + } + + for(x = 0;x < im.w;++x) + { + for(y = 0;y < im.h;++y) + scanline[y] = *(bits + im.rw*y + x); + + blurScanLine(kernel, width, scanline, temp, im.h); + + for(y = 0;y < im.h;++y) + *(dest + im.rw*y + x) = temp[y]; + + } + + delete [] scanline; + delete [] temp; + delete [] kernel; + + memcpy(im.data, dest, im.rw * im.rh * sizeof(rgba)); + + delete [] dest; +} + +void equalize(const image &im) +{ + if(!checkImage(im)) + return; + + double_packet high, low, intensity, *map, *histogram; + short_packet *equalize_map; + s32 x, y; + rgba *p, *q; + long i; + u8 r, g, b, a; + + histogram = new double_packet [256]; + map = new double_packet [256]; + equalize_map = new short_packet [256]; + + if(!histogram || !map || !equalize_map) + { + if(histogram) delete [] histogram; + if(map) delete [] map; + if(equalize_map) delete [] equalize_map; + + return; + } + + rgba *bits = (rgba *)im.data; + + /* + * Form histogram. + */ + memset(histogram, 0, 256 * sizeof(double_packet)); + + for(y = 0;y < im.h;++y) + { + p = bits + im.rw * y; + + for(x = 0;x < im.w;++x) + { + histogram[p->r].red++; + histogram[p->g].green++; + histogram[p->b].blue++; + histogram[p->a].alpha++; + + p++; + } + } + /* + Integrate the histogram to get the equalization map. + */ + memset(&intensity, 0 ,sizeof(double_packet)); + + for(i = 0;i < 256;++i) + { + intensity.red += histogram[i].red; + intensity.green += histogram[i].green; + intensity.blue += histogram[i].blue; + intensity.alpha += histogram[i].alpha; + + map[i] = intensity; + } + + low=map[0]; + high=map[255]; + memset(equalize_map, 0, 256 * sizeof(short_packet)); + + for(i = 0;i < 256;++i) + { + if(high.red != low.red) + equalize_map[i].red=(unsigned short) + ((65535*(map[i].red-low.red))/(high.red-low.red)); + if(high.green != low.green) + equalize_map[i].green=(unsigned short) + ((65535*(map[i].green-low.green))/(high.green-low.green)); + if(high.blue != low.blue) + equalize_map[i].blue=(unsigned short) + ((65535*(map[i].blue-low.blue))/(high.blue-low.blue)); + if(high.alpha != low.alpha) + equalize_map[i].alpha=(unsigned short) + ((65535*(map[i].alpha-low.alpha))/(high.alpha-low.alpha)); + } + + delete [] histogram; + delete [] map; + + /* + Stretch the histogram. + */ + for(y = 0;y < im.h;++y) + { + q = bits + im.rw*y; + + for(x = 0;x < im.w;++x) + { + if(low.red != high.red) + r = (equalize_map[(unsigned short)(q->r)].red/257); + else + r = q->r; + if(low.green != high.green) + g = (equalize_map[(unsigned short)(q->g)].green/257); + else + g = q->g; + if(low.blue != high.blue) + b = (equalize_map[(unsigned short)(q->b)].blue/257); + else + b = q->b; + if(low.alpha != high.alpha) + a = (equalize_map[(unsigned short)(q->a)].alpha/257); + else + a = q->a; + + *q = rgba(r, g, b, a); + + q++; + } + } + + delete [] equalize_map; +} + +struct PointInfo +{ + double x, y, z; +}; + +void shade(const image &im, bool color_shading, double azimuth, + double elevation) +{ + if(!checkImage(im)) + return; + + rgba *n = new rgba [im.rw * im.rh]; + + if(!n) + return; + + double distance, normal_distance, shade; + s32 x, y; + + struct PointInfo light, normal; + + rgba *bits; + rgba *q; + + azimuth = DegreesToRadians(azimuth); + elevation = DegreesToRadians(elevation); + light.x = MaxRGB*cos(azimuth)*cos(elevation); + light.y = MaxRGB*sin(azimuth)*cos(elevation); + light.z = MaxRGB*sin(elevation); + normal.z= 2*MaxRGB; // constant Z of surface normal + + rgba *s0, *s1, *s2; + + for(y = 0;y < im.h;++y) + { + bits = (rgba *)im.data + im.rw * (F_MIN(F_MAX(y-1,0),im.h-3)); + q = n + im.rw * y; + + // shade this row of pixels. + *q++ = (*(bits+im.rw)); + bits++; + + s0 = bits; + s1 = bits + im.rw; + s2 = bits + 2*im.rw; + + for(x = 1;x < im.w-1;++x) + { + // determine the surface normal and compute shading. + normal.x = intensityValue(*(s0-1))+intensityValue(*(s1-1))+intensityValue(*(s2-1))- + (double) intensityValue(*(s0+1))-(double) intensityValue(*(s1+1))- + (double) intensityValue(*(s2+1)); + + normal.y = intensityValue(*(s2-1))+intensityValue(*s2)+intensityValue(*(s2+1))- + (double) intensityValue(*(s0-1))-(double) intensityValue(*s0)- + (double) intensityValue(*(s0+1)); + + if(normal.x == 0 && normal.y == 0) + shade = light.z; + else + { + shade = 0.0; + distance = normal.x*light.x+normal.y*light.y+normal.z*light.z; + + if(distance > 0.0) + { + normal_distance = normal.x*normal.x+normal.y*normal.y+normal.z*normal.z; + + if(fabs(normal_distance) > 0.0000001) + shade=distance/sqrt(normal_distance); + } + } + + if(!color_shading) + { + *q = rgba((u8)(shade), + (u8)(shade), + (u8)(shade), + s1->a); + } + else + { + *q = rgba((u8)((shade * s1->r)/(MaxRGB+1)), + (u8)((shade * s1->g)/(MaxRGB+1)), + (u8)((shade * s1->b)/(MaxRGB+1)), + s1->a); + } + + ++s0; + ++s1; + ++s2; + q++; + } + + *q++ = (*s1); + } + + memcpy(im.data, n, im.rw * im.rh * sizeof(rgba)); + + delete [] n; +} + +void edge(image &im, double radius) +{ + if(!checkImage(im)) + return; + + double *kernel; + int width; + register long i; + rgba *dest = 0; + + width = getOptimalKernelWidth(radius, 0.5); + + const int W = width*width; + + if(im.w < width || im.h < width) + return; + + kernel = new double [W]; + + if(!kernel) + return; + + for(i = 0;i < W;i++) + kernel[i] = -1.0; + + kernel[i/2] = W-1.0; + + if(!convolveImage(&im, &dest, width, kernel)) + { + delete [] kernel; + + if(dest) + delete [] dest; + + return; + } + + delete [] kernel; + + memcpy(im.data, dest, im.rw * im.rh * sizeof(rgba)); + + delete [] dest; +} + +void emboss(image &im, double radius, double sigma) +{ + if(!checkImage(im)) + return; + + double alpha, *kernel; + int j, width; + register long i, u, v; + rgba *dest = 0; + + if(sigma == 0.0) + return; + + width = getOptimalKernelWidth(radius, sigma); + + if(im.w < width || im.h < width) + return; + + kernel = new double [width*width]; + + if(!kernel) + return; + + i = 0; + j = width/2; + + const double S = sigma * sigma; + + for(v = (-width/2);v <= (width/2);v++) + { + for(u=(-width/2); u <= (width/2); u++) + { + alpha = exp(-((double) u*u+v*v)/(2.0*S)); + + kernel[i] = ((u < 0) || (v < 0) ? -8.0 : 8.0)*alpha/(2.0*MagickPI*S); + + if (u == j) + kernel[i]=0.0; + + i++; + } + + j--; + } + + if(!convolveImage(&im, &dest, width, kernel)) + { + delete [] kernel; + return; + } + + delete [] kernel; + + fmt_filters::image mm((u8 *)dest, im.w, im.h, im.rw, im.rh); + + equalize(mm); + + memcpy(im.data, dest, im.rw * im.rh * sizeof(rgba)); + + delete [] dest; +} + +void sharpen(image &im, double radius, double sigma) +{ + if(!checkImage(im)) + return; + + double alpha, normalize, *kernel; + int width; + register long i, u, v; + rgba *dest = 0; + + if(sigma == 0.0) + sigma = 0.01; + + width = getOptimalKernelWidth(radius, sigma); + + if(im.w < width) + return; + + kernel = new double [width*width]; + + if(!kernel) + return; + + i = 0; + normalize = 0.0; + const double S = sigma * sigma; + const int w2 = width / 2; + + for(v = -w2; v <= w2; v++) + { + for(u = -w2; u <= w2; u++) + { + alpha = exp(-((double) u*u+v*v)/(2.0*S)); + kernel[i] = alpha/(2.0*MagickPI*S); + normalize += kernel[i]; + + i++; + } + } + + kernel[i/2] = (-2.0)*normalize; + + if(!convolveImage(&im, &dest, width, kernel)) + { + delete [] kernel; + + if(dest) + delete [] dest; + + return; + } + + delete [] kernel; + + memcpy(im.data, dest, im.rw * im.rh * sizeof(rgba)); + + delete [] dest; +} + +void oil(const image &im, double radius) +{ + if(!checkImage(im)) + return; + + unsigned long count; + unsigned long histogram[256]; + unsigned int k; + int width; + int x, y, mx, my, sx, sy; + int mcx, mcy; + rgba *s = 0, *q; + + scaleDown(radius, 1.0, 5.0); + + rgba *n = new rgba [im.rw * im.rh]; + + if(!n) + return; + + memcpy(n, im.data, im.rw * im.rh * sizeof(rgba)); + + width = getOptimalKernelWidth(radius, 0.5); + + if(im.w < width) + { + delete [] n; + return; + } + + rgba *bits = (rgba *)im.data; + + for(y = 0;y < im.h;++y) + { + sy = y-(width/2); + q = n + im.rw*y; + + for(x = 0;x < im.w;++x) + { + count = 0; + memset(histogram, 0, 256 * sizeof(unsigned long)); + sy = y-(width/2); + + for(mcy = 0;mcy < width;++mcy,++sy) + { + my = sy < 0 ? 0 : sy > im.h-1 ? im.h-1 : sy; + sx = x+(-width/2); + + for(mcx = 0; mcx < width;++mcx,++sx) + { + mx = sx < 0 ? 0 : sx > im.w-1 ? im.w-1 : sx; + + k = intensityValue(*(bits + my*im.rw + mx)); + + if(k > 255) k = 255; + + histogram[k]++; + + if(histogram[k] > count) + { + count = histogram[k]; + s = bits + my*im.rw + mx; + } + } + } + + *q++ = (*s); + } + } + + memcpy(im.data, n, im.rw * im.rh * sizeof(rgba)); + + delete [] n; +} +/* + * Red-eye removal was taken from "redeye" plugin for GIMP + */ + +/* redeye.c: redeye remover plugin code + * + * Copyright (C) 2004 Robert Merkel (the "Author"). + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + * Except as contained in this notice, the name of the Author of the + * Software shall not be used in advertising or otherwise to promote the + * sale, use or other dealings in this Software without prior written + * authorization from the Author. +1;3B */ + +void redeye(const image &im, const int w, const int h, const int x, const int y, int th) +{ + const double RED_FACTOR = 0.5133333; + const double GREEN_FACTOR = 1; + const double BLUE_FACTOR = 0.1933333; + + if(!checkImage(im)) + return; + + scaleDown(th, 0, 255); + + int y1, x1; + int adjusted_red, adjusted_green, adjusted_blue; + + rgba *src = (rgba *)im.data, *s; + + for(y1 = y;y1 < y+h;++y1) + { + s = src + im.w*y1 + x; + + for(x1 = x;x1 < x+w;x1++) + { + adjusted_red = int(s->r * RED_FACTOR); + adjusted_green = int(s->g * GREEN_FACTOR); + adjusted_blue = int(s->b * BLUE_FACTOR); + + if(adjusted_red >= adjusted_green - th && adjusted_red >= adjusted_blue - th) + s->r = (int)(((double)(adjusted_green + adjusted_blue)) / (2.0 * RED_FACTOR)); + + s++; + } + } +} + + +/*************************************************************************/ + +/* + * + * Helper functions + * + */ + +/*************************************************************************/ + +static bool convolveImage(image *image, rgba **dest, const unsigned int order, + const double *kernel) +{ + long width; + double red, green, blue; + u8 alpha; + double normalize, *normal_kernel; + register const double *k; + register rgba *q; + int x, y, mx, my, sx, sy; + long i; + int mcx, mcy; + + width = order; + + if((width % 2) == 0) + return false; + + const int W = width*width; + + normal_kernel = new double [W]; + + if(!normal_kernel) + return false; + + *dest = new rgba [image->rw * image->rh]; + + if(!*dest) + { + delete [] normal_kernel; + return false; + } + + normalize = 0.0; + + for(i = 0;i < W;i++) + normalize += kernel[i]; + + if(fabs(normalize) <= MagickEpsilon) + normalize = 1.0; + + normalize=1.0/normalize; + + for(i = 0;i < W;i++) + normal_kernel[i] = normalize*kernel[i]; + + rgba *bits = (rgba *)image->data; + + for(y = 0;y < image->h;++y) + { + sy = y-(width/2); + q = *dest + image->rw * y; + + for(x = 0;x < image->w;++x) + { + k = normal_kernel; + red = green = blue = alpha = 0; + sy = y-(width/2); + alpha = (bits + image->rw*y+x)->a; + + for(mcy=0; mcy < width; ++mcy, ++sy) + { + my = sy < 0 ? 0 : sy > image->h-1 ? image->h-1 : sy; + sx = x+(-width/2); + + for(mcx=0; mcx < width; ++mcx, ++sx) + { + mx = sx < 0 ? 0 : sx > image->w-1 ? image->w-1 : sx; + red += (*k) * ((bits + image->rw*my+mx)->r*257); + green += (*k) * ((bits + image->rw*my+mx)->g*257); + blue += (*k) * ((bits + image->rw*my+mx)->b*257); +// alpha += (*k) * ((bits + image->rw*my+mx)->a*257); + + ++k; + } + } + + red = red < 0 ? 0 : red > 65535 ? 65535 : red+0.5; + green = green < 0 ? 0 : green > 65535 ? 65535 : green+0.5; + blue = blue < 0 ? 0 : blue > 65535 ? 65535 : blue+0.5; +// alpha = alpha < 0 ? 0 : alpha > 65535 ? 65535 : alpha+0.5; + + *q++ = rgba((unsigned char)(red/257UL), + (unsigned char)(green/257UL), + (unsigned char)(blue/257UL), + alpha); + } + } + + delete [] normal_kernel; + + return true; +} + +static void rgb2hsv(const rgb &rgb, s32 *h, s32 *s, s32 *v) +{ + if(!h || !s || !v) + return; + + s32 r = rgb.r; + s32 g = rgb.g; + s32 b = rgb.b; + + u32 max = r; + s32 whatmax = 0; // r=>0, g=>1, b=>2 + + if((u32)g > max) + { + max = g; + whatmax = 1; + } + + if((u32)b > max) + { + max = b; + whatmax = 2; + } + + u32 min = r; // find minimum value + if((u32)g < min) min = g; + if((u32)b < min) min = b; + + s32 delta = max-min; + *v = max; // calc value + *s = max ? (510*delta+max)/(2*max) : 0; + + if(*s == 0) + { + *h = -1; // undefined hue + } + else + { + switch(whatmax) + { + case 0: // red is max component + if(g >= b) + *h = (120*(g-b)+delta)/(2*delta); + else + *h = (120*(g-b+delta)+delta)/(2*delta) + 300; + break; + + case 1: // green is max component + if(b > r) + *h = 120 + (120*(b-r)+delta)/(2*delta); + else + *h = 60 + (120*(b-r+delta)+delta)/(2*delta); + break; + + case 2: // blue is max component + if(r > g) + *h = 240 + (120*(r-g)+delta)/(2*delta); + else + *h = 180 + (120*(r-g+delta)+delta)/(2*delta); + break; + } + } +} + +static void hsv2rgb(s32 h, s32 s, s32 v, rgb *rgb) +{ + if(h < -1 || (u32)s > 255 || (u32)v > 255 || !rgb) + return; + + s32 r = v, g = v, b = v; + + if(s == 0 || h == -1) + { + // Ignore + } + else + { // chromatic case + if((u32)h >= 360) + h %= 360; + + u32 f = h%60; + h /= 60; + u32 p = (u32)(2*v*(255-s)+255)/510; + u32 q, t; + + if(h&1) + { + q = (u32)(2*v*(15300-s*f)+15300)/30600; + + switch(h) + { + case 1: r=(s32)q; g=(s32)v, b=(s32)p; break; + case 3: r=(s32)p; g=(s32)q, b=(s32)v; break; + case 5: r=(s32)v; g=(s32)p, b=(s32)q; break; + } + } + else + { + t = (u32)(2*v*(15300-(s*(60-f)))+15300)/30600; + + switch(h) + { + case 0: r=(s32)v; g=(s32)t, b=(s32)p; break; + case 2: r=(s32)p; g=(s32)v, b=(s32)t; break; + case 4: r=(s32)t; g=(s32)p, b=(s32)v; break; + } + } + } + + rgb->r = r; + rgb->g = g; + rgb->b = b; +} + +static rgba interpolateColor(const image &im, double x_offset, double y_offset, const rgba &background) +{ + double alpha, beta; + rgba p, q, r, s; + s32 x, y; + rgba *bits = (rgba *)im.data; + + if(!checkImage(im)) + return background; + + x = (s32)x_offset; + y = (s32)y_offset; + + if((x < -1) || (x >= im.w) || (y < -1) || (y >= im.h)) + return background; + + if((x >= 0) && (y >= 0) && (x < (im.w-1)) && (y < (im.h-1))) + { + rgba *t = bits + y * im.rw; + + p = t[x]; + q = t[x+1]; + r = t[x+im.rw]; + s = t[x+im.rw+1]; + } + else + { + rgba *t = bits + y * im.rw; + + p = background; + + if((x >= 0) && (y >= 0)) + p = t[x]; + + q = background; + + if(((x+1) < im.w) && (y >= 0)) + q = t[x+1]; + + r = background; + + if((x >= 0) && ((y+1) < im.h)) + { + t = bits + (y+1) * im.rw; + r = t[x+im.rw]; + } + + s = background; + + if(((x+1) < im.w) && ((y+1) < im.h)) + { + t = bits + (y+1) * im.rw; + s = t[x+im.rw+1]; + } + } + + x_offset -= floor(x_offset); + y_offset -= floor(y_offset); + alpha = 1.0-x_offset; + beta = 1.0-y_offset; + + rgba _r; + + _r.r = (u8)(beta * (alpha*p.r + x_offset*q.r) + y_offset * (alpha*r.r + x_offset*s.r)); + _r.g = (u8)(beta * (alpha*p.g + x_offset*q.g) + y_offset * (alpha*r.g + x_offset*s.g)); + _r.b = (u8)(beta * (alpha*p.b + x_offset*q.b) + y_offset * (alpha*r.b + x_offset*s.b)); + _r.a = (u8)(beta * (alpha*p.a + x_offset*q.a) + y_offset * (alpha*r.a + x_offset*s.a)); + + return _r; +} + +static u32 generateNoise(u32 pixel, NoiseType noise_type) +{ +#define NoiseEpsilon 1.0e-5 +#define NoiseMask 0x7fff +#define SigmaUniform 4.0 +#define SigmaGaussian 4.0 +#define SigmaImpulse 0.10 +#define SigmaLaplacian 10.0 +#define SigmaMultiplicativeGaussian 0.5 +#define SigmaPoisson 0.05 +#define TauGaussian 20.0 + + double alpha, beta, sigma, value; + alpha=(double) (rand() & NoiseMask)/NoiseMask; + if (alpha == 0.0) + alpha=1.0; + switch(noise_type){ + case UniformNoise: + default: + { + value=(double) pixel+SigmaUniform*(alpha-0.5); + break; + } + case GaussianNoise: + { + double tau; + + beta=(double) (rand() & NoiseMask)/NoiseMask; + sigma=sqrt(-2.0*log(alpha))*cos(2.0*M_PI*beta); + tau=sqrt(-2.0*log(alpha))*sin(2.0*M_PI*beta); + value=(double) pixel+ + (sqrt((double) pixel)*SigmaGaussian*sigma)+(TauGaussian*tau); + break; + } + case MultiplicativeGaussianNoise: + { + if (alpha <= NoiseEpsilon) + sigma=MaxRGB; + else + sigma=sqrt(-2.0*log(alpha)); + beta=(rand() & NoiseMask)/NoiseMask; + value=(double) pixel+ + pixel*SigmaMultiplicativeGaussian*sigma*cos(2.0*M_PI*beta); + break; + } + case ImpulseNoise: + { + if (alpha < (SigmaImpulse/2.0)) + value=0; + else + if (alpha >= (1.0-(SigmaImpulse/2.0))) + value=MaxRGB; + else + value=pixel; + break; + } + case LaplacianNoise: + { + if (alpha <= 0.5) + { + if (alpha <= NoiseEpsilon) + value=(double) pixel-MaxRGB; + else + value=(double) pixel+SigmaLaplacian*log(2.0*alpha); + break; + } + beta=1.0-alpha; + if (beta <= (0.5*NoiseEpsilon)) + value=(double) pixel+MaxRGB; + else + value=(double) pixel-SigmaLaplacian*log(2.0*beta); + break; + } + case PoissonNoise: + { + register s32 + i; + + for (i=0; alpha > exp(-SigmaPoisson*pixel); i++) + { + beta=(double) (rand() & NoiseMask)/NoiseMask; + alpha=alpha*beta; + } + value=i/SigmaPoisson; + break; + } + } + + if(value < 0.0) + return 0; + else if(value > MaxRGB) + return MaxRGB; + else + return ((u32) (value+0.5)); +} + +static inline u32 intensityValue(s32 r, s32 g, s32 b) +{ + return ((u32)((0.299*r + 0.587*g + 0.1140000000000001*b))); +} + +static inline u32 intensityValue(const rgba &rr) +{ + return ((u32)((0.299*rr.r + 0.587*rr.g + 0.1140000000000001*rr.b))); +} + +template +static inline void scaleDown(T &val, T min, T max) +{ + if(val < min) + val = min; + else if(val > max) + val = max; +} + +static void blurScanLine(double *kernel, s32 width, rgba *src, rgba *dest, s32 columns) +{ + register double *p; + rgba *q; + register s32 x; + register long i; + double red, green, blue, alpha; + double scale = 0.0; + + if(width > columns) + { + for(x = 0;x < columns;++x) + { + scale = 0.0; + red = blue = green = alpha = 0.0; + p = kernel; + q = src; + + for(i = 0;i < columns;++i) + { + if((i >= (x-width/2)) && (i <= (x+width/2))) + { + red += (*p)*(q->r * 257); + green += (*p)*(q->g*257); + blue += (*p)*(q->b*257); + alpha += (*p)*(q->a*257); + } + + if(((i+width/2-x) >= 0) && ((i+width/2-x) < width)) + scale += kernel[i+width/2-x]; + + p++; + q++; + } + + scale = 1.0/scale; + red = scale*(red+0.5); + green = scale*(green+0.5); + blue = scale*(blue+0.5); + alpha = scale*(alpha+0.5); + + red = red < 0 ? 0 : red > 65535 ? 65535 : red; + green = green < 0 ? 0 : green > 65535 ? 65535 : green; + blue = blue < 0 ? 0 : blue > 65535 ? 65535 : blue; + alpha = alpha < 0 ? 0 : alpha > 65535 ? 65535 : alpha; + + dest[x] = rgba((u8)(red/257UL), + (u8)(green/257UL), + (u8)(blue/257UL), + (u8)(alpha/257UL)); + } + + return; + } + + for(x = 0;x < width/2;++x) + { + scale = 0.0; + red = blue = green = alpha = 0.0; + p = kernel+width/2-x; + q = src; + + for(i = width/2-x;i < width;++i) + { + red += (*p)*(q->r*257); + green += (*p)*(q->g*257); + blue += (*p)*(q->b*257); + alpha += (*p)*(q->a*257); + scale += (*p); + p++; + q++; + } + + scale=1.0/scale; + + red = scale*(red+0.5); + green = scale*(green+0.5); + blue = scale*(blue+0.5); + alpha = scale*(alpha+0.5); + + red = red < 0 ? 0 : red > 65535 ? 65535 : red; + green = green < 0 ? 0 : green > 65535 ? 65535 : green; + blue = blue < 0 ? 0 : blue > 65535 ? 65535 : blue; + alpha = alpha < 0 ? 0 : alpha > 65535 ? 65535 : alpha; + + dest[x] = rgba((u8)(red/257UL), + (u8)(green/257UL), + (u8)(blue/257UL), + (u8)(alpha/257UL)); + } + + for(;x < columns-width/2;++x) + { + red = blue = green = alpha = 0.0; + p = kernel; + q = src+(x-width/2); + + for(i = 0;i < (long)width;++i) + { + red += (*p)*(q->r*257); + green += (*p)*(q->g*257); + blue += (*p)*(q->b*257); + alpha += (*p)*(q->a*257); + p++; + q++; + } + + red = scale*(red+0.5); + green = scale*(green+0.5); + blue = scale*(blue+0.5); + alpha = scale*(alpha+0.5); + + red = red < 0 ? 0 : red > 65535 ? 65535 : red; + green = green < 0 ? 0 : green > 65535 ? 65535 : green; + blue = blue < 0 ? 0 : blue > 65535 ? 65535 : blue; + alpha = alpha < 0 ? 0 : alpha > 65535 ? 65535 : alpha; + + dest[x] = rgba((u8)(red/257UL), + (u8)(green/257UL), + (u8)(blue/257UL), + (u8)(alpha/257UL)); + } + + for(;x < columns;++x) + { + red = blue = green = alpha = 0.0; + scale=0; + p = kernel; + q = src+(x-width/2); + + for(i = 0;i < columns-x+width/2;++i) + { + red += (*p)*(q->r*257); + green += (*p)*(q->g*257); + blue += (*p)*(q->b*257); + alpha += (*p)*(q->a*257); + scale += (*p); + p++; + q++; + } + + scale=1.0/scale; + red = scale*(red+0.5); + green = scale*(green+0.5); + blue = scale*(blue+0.5); + alpha = scale*(alpha+0.5); + + red = red < 0 ? 0 : red > 65535 ? 65535 : red; + green = green < 0 ? 0 : green > 65535 ? 65535 : green; + blue = blue < 0 ? 0 : blue > 65535 ? 65535 : blue; + alpha = alpha < 0 ? 0 : alpha > 65535 ? 65535 : alpha; + + dest[x] = rgba((u8)(red/257UL), + (u8)(green/257UL), + (u8)(blue/257UL), + (u8)(alpha/257UL)); + } +} + +static s32 getBlurKernel(s32 width, double sigma, double **kernel) +{ + +#define KernelRank 3 +#define KernelRankQ 18.0 + + double alpha, normalize; + register long i; + s32 bias; + + if(sigma == 0.0) + return 0; + + if(width == 0) + width = 3; + + *kernel = new double [width]; + + if(!*kernel) + return 0; + + memset(*kernel, 0, width * sizeof(double)); + bias = KernelRank * width/2; + + for(i = (-bias);i <= bias; i++) + { + alpha = exp(-((double) i*i)/(KernelRankQ*sigma*sigma)); + (*kernel)[(i+bias)/KernelRank] += alpha/(MagickSQ2PI*sigma); + } + + normalize = 0; + + for(i = 0;i < width;i++) + normalize += (*kernel)[i]; + + for(i = 0;i < width;i++) + (*kernel)[i] /= normalize; + + return width; + +#undef KernelRankQ +#undef KernelRank + +} + +static void hull(const s32 x_offset, const s32 y_offset, const s32 polarity, const s32 columns, + const s32 rows, u8 *f, u8 *g) +{ + s32 x, y; + + u8 *p, *q, *r, *s; + u32 v; + + if(f == 0 || g == 0) + return; + + p = f+(columns+2); + q = g+(columns+2); + r = p+(y_offset*(columns+2)+x_offset); + + for(y = 0;y < rows;y++) + { + p++; + q++; + r++; + if(polarity > 0) + for(x = 0;x < columns;x++) + { + v=(*p); + if (*r > v) + v++; + *q=v > 255 ? 255 : v; + p++; + q++; + r++; + } + else + for(x = 0;x < columns;x++) + { + v=(*p); + if (v > (u32) (*r+1)) + v--; + *q=v; + p++; + q++; + r++; + } + p++; + q++; + r++; + } + + p = f+(columns+2); + q = g+(columns+2); + r = q+(y_offset*(columns+2)+x_offset); + s = q-(y_offset*(columns+2)+x_offset); + + for(y = 0;y < rows;y++) + { + p++; + q++; + r++; + s++; + + if(polarity > 0) + for(x=0; x < (s32) columns; x++) + { + v=(*q); + if (((u32) (*s+1) > v) && (*r > v)) + v++; + *p=v > 255 ? 255 : v; + p++; + q++; + r++; + s++; + } + else + for (x=0; x < columns; x++) + { + v=(*q); + if (((u32) (*s+1) < v) && (*r < v)) + v--; + *p=v; + p++; + q++; + r++; + s++; + } + + p++; + q++; + r++; + s++; + } +} + +static int getOptimalKernelWidth(double radius, double sigma) +{ + double normalize, value; + long width; + register long u; + + if(sigma == 0.0) + sigma = 0.01; + + if(radius > 0.0) + return((int)(2.0*ceil(radius)+1.0)); + + const double S = sigma * sigma; + + for(width = 5;;) + { + normalize = 0.0; + + for(u = (-width/2);u <= (width/2);u++) + normalize+=exp(-((double) u*u)/(2.0*S))/(MagickSQ2PI*sigma); + + u = width/2; + value = exp(-((double) u*u)/(2.0*S))/(MagickSQ2PI*sigma)/normalize; + + if((long)(65535*value) <= 0) + break; + + width+=2; + } + + return ((int)width-2); +} + +} // namespace diff --git a/ksquirrel/ksquirrelpart/fmt_filters.h b/ksquirrel/ksquirrelpart/fmt_filters.h new file mode 100644 index 0000000..688d4cb --- /dev/null +++ b/ksquirrel/ksquirrelpart/fmt_filters.h @@ -0,0 +1,302 @@ +/* + * Copyright (c) 2005 Dmitry Baryshev + */ + +/* + * All methods (except redeye) in this namespace are ported from KDE 3.2.3. + * All of them are copyrighted by their authors. See fmt_filters_README for more. + */ + +/* This file is part of the KDE libraries + Copyright (C) 1998, 1999, 2001, 2002 Daniel M. Duley + (C) 1998, 1999 Christian Tibirna + (C) 1998, 1999 Dirk A. Mueller + (C) 1999 Geert Jansen + (C) 2000 Josef Weidendorfer + (C) 2004 Zack Rusin + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +*/ + +// +// =================================================================== +// Effects originally ported from ImageMagick for PixiePlus, plus a few +// new ones. (mosfet 05/26/2003) +// =================================================================== +// +/* + Portions of this software are based on ImageMagick. Such portions are clearly +marked as being ported from ImageMagick. ImageMagick is copyrighted under the +following conditions: + +Copyright (C) 2003 ImageMagick Studio, a non-profit organization dedicated to +making software imaging solutions freely available. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files ("ImageMagick"), to deal +in ImageMagick without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of ImageMagick, and to permit persons to whom the ImageMagick is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of ImageMagick. + +The software is provided "as is", without warranty of any kind, express or +implied, including but not limited to the warranties of merchantability, +fitness for a particular purpose and noninfringement. In no event shall +ImageMagick Studio be liable for any claim, damages or other liability, +whether in an action of contract, tort or otherwise, arising from, out of or +in connection with ImageMagick or the use or other dealings in ImageMagick. + +Except as contained in this notice, the name of the ImageMagick Studio shall +not be used in advertising or otherwise to promote the sale, use or other +dealings in ImageMagick without prior written authorization from the +ImageMagick Studio. +*/ + +#ifndef FMT_FILTERS_H +#define FMT_FILTERS_H + +////////////////////////////////////////// +// // +// Pass the image through some filter // +// // +////////////////////////////////////////// + + +namespace fmt_filters +{ + typedef char s8; + typedef unsigned char u8; + + typedef short s16; + typedef unsigned short u16; + + typedef int s32; + typedef unsigned int u32; + + struct image + { + image() : data(0), w(0), h(0), rw(0), rh(0) + {} + + image(unsigned char *d, int _w, int _h) : data(d), w(_w), h(_h), rw(_w), rh(_h) + {} + + image(unsigned char *d, int _w, int _h, int _rw, int _rh) : data(d), w(_w), h(_h), rw(_rw), rh(_rh) + {} + + unsigned char *data; + int w; + int h; + int rw; + int rh; + }; + + struct rgb + { + rgb() : r(0), g(0), b(0) + {} + + rgb(int _r, int _g, int _b) : r(_r), g(_g), b(_b) + {} + + unsigned char r; + unsigned char g; + unsigned char b; + }; + + struct rgba + { + rgba(int r1, int g1, int b1, int a1) : r(r1), g(g1), b(b1), a(a1) + {} + + rgba() : r(0), g(0), b(0), a(0) + {} + + unsigned char r; + unsigned char g; + unsigned char b; + unsigned char a; + }; + + enum NoiseType + { + UniformNoise = 0, // Uniform distribution + GaussianNoise, // Gaussian distribution + MultiplicativeGaussianNoise, // Multiplicative Gaussian distribution + ImpulseNoise, // Impulse distribution + LaplacianNoise, // Laplacian distribution + PoissonNoise // Poisson distribution + }; + + + bool checkImage(const image &im); + + // colorize the image, which is w x h, left alpha channel unchanged. + // + // it just adds to each pixel in the image + // aproproriate value. + void colorize(const image &im, int red, int green, int blue); + + // change brightness of the image + void brightness(const image &im, int bn); + + // change gamma + // gamma should be 0.0 <= L <= 6.0 + // + // it is no problem to set L to 8.0 or 9.0, but the resulting + // image won't have much difference from 6.0 + void gamma(const image &im, double L); + + // change contrast with Photoshop-like method + // contrast should be -255 <= contrast <= 255 + void contrast(const image &im, int contrast); + + enum swapRGBtype { GBR = 0, BRG = 1 }; + + // negative + void negative(const image &im); + + // swap RGB values + void swapRGB(const image &im, int type); + + // + // All the following filters are ported from KDE's + // KImageEffect. See kdelibs/kdefx/kimageeffect.cpp + // for more. + // + + // blend + // opacity = [0.0; 1.0] + void blend(const image &im, const rgb &rgb, float opacity); + + // val = [0.0; 1.0] + void fade(const image &im, const rgb &rgb, float val); + + void gray(const image &im); + + // desat = [0.0; 1.0] + void desaturate(const image &im, float desat); + + // threshold = [0; 255] + void threshold(const image &im, unsigned int threshold); + + // factor = [0.0; 50.0] + void solarize(const image &im, double factor); + + // amount = [1; 10] + void spread(const image &im, unsigned int amount); + + // degrees = [-720.0; 720.0] + void swirl(const image &im, double degrees, const rgba &background); + + void noise(const image &im, NoiseType noise_type); + + void flatten(const image &im, const rgb &ca, const rgb &cb); + + // azimuth = [0.0; 90.0], elevation = [0.0; 90.0] + void shade(const image &im, bool color, double azimuth, double elevation); + + void equalize(const image &im); + + // radius = [0.01; 90.0], sigma = [0.01; 50.0] + void blur(const image &im, double radius, double sigma); + + void despeckle(const image &im); + + // factor = [0; 100] + void implode(const image &im, double factor, const rgba &background); + + // radius = [0.01; 30.0] + void edge(image &im, double radius); + + // radius = [0.01; 99.9], sigma = [0.01; 99.9] + void emboss(image &im, double radius, double sigma); + + // radius = [0.01; 99.9], sigma = [0.01; 30.0] + void sharpen(image &im, double radius, double sigma); + + // radius = [1.0; 5.0] + void oil(const image &im, double radius); + +/* + * Red-eye removal was taken from "redeye" plugin for GIMP + */ + +/* redeye.c: redeye remover plugin code + * + * Copyright (C) 2004 Robert Merkel (the "Author"). + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + * Except as contained in this notice, the name of the Author of the + * Software shall not be used in advertising or otherwise to promote the + * sale, use or other dealings in this Software without prior written + * authorization from the Author. +1;3B */ + + // red-eye removal. + // th = [0; 255] + void redeye(const image &im, const int w, const int h, + const int x, const int y, + int th); + + // Do we need some color definitions ? + static const rgba white = rgba(255, 255, 255, 255); + static const rgba black = rgba(0, 0, 0, 255); + static const rgba red = rgba(255, 0, 0, 255); + static const rgba green = rgba(0, 255, 0, 255); + static const rgba blue = rgba(0, 0, 255, 255); + static const rgba cyan = rgba(0, 255, 255, 255); + static const rgba magenta = rgba(255, 0, 255, 255); + static const rgba yellow = rgba(255, 255, 0, 255); + static const rgba mediumgray = rgba(128, 128, 128, 255); + static const rgba lightgray = rgba(160, 160, 164, 255); + static const rgba normalgray = rgba(192, 192, 192, 255); + static const rgba darkred = rgba(128, 0, 0, 255); + static const rgba darkgreen = rgba(0, 128, 0, 255); + static const rgba darkblue = rgba(0, 0, 128, 255); + static const rgba darkcyan = rgba(0, 128, 128, 255); + static const rgba darkmagenta = rgba(128, 0, 128, 255); + static const rgba darkyellow = rgba(128, 128, 0, 255); +} + +#endif diff --git a/ksquirrel/ksquirrelpart/ksquirrelpart.cpp b/ksquirrel/ksquirrelpart/ksquirrelpart.cpp new file mode 100644 index 0000000..ba39715 --- /dev/null +++ b/ksquirrel/ksquirrelpart/ksquirrelpart.cpp @@ -0,0 +1,271 @@ +/*************************************************************************** + sq_ksquirrelpart.cpp - description + ------------------- + begin : Thu Nov 29 2007 + copyright : (C) 2007 by Baryshev Dmitry + email : ksquirrel.iv@gmail.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "ksquirrelpart.h" +#include "sq_glwidget.h" + +#include "sq_glview.h" +#include "sq_config.h" +#include "sq_diroperator.h" +#include "sq_libraryhandler.h" +#include "sq_iconloader.h" +#include "sq_externaltool.h" +#include "sq_errorstring.h" + +typedef KParts::GenericFactory KSquirrelFactory; +K_EXPORT_COMPONENT_FACTORY(libksquirrelpart, KSquirrelFactory) + +KSquirrelPart::KSquirrelPart(QWidget *parentWidget, const char *, + QObject* parent, const char *name, + const QStringList &) : KParts::ReadOnlyPart(parent, name) +{ + kdDebug() << "+KSquirrelPart" << endl; + + setInstance(KSquirrelFactory::instance()); + + ext = new KSquirrelPartBrowserExtension(this); + + KGlobal::dirs()->addResourceType("data", KStandardDirs::kde_default("data") + QString::fromLatin1("ksquirrel")); + KGlobal::locale()->setActiveCatalogue(KSquirrelFactory::instance()->instanceName()); + + if(!SQ_ErrorString::instance()) + new SQ_ErrorString(parentWidget); + + if(!SQ_Config::instance()) + new SQ_Config; + + if(!SQ_IconLoader::instance()) + new SQ_IconLoader; + + if(!SQ_ExternalTool::instance()) + new SQ_ExternalTool; + + SQ_ExternalTool::instance()->newPopupMenu(); + + // This will allow global object of SQ_LibraryHandler, which + // will exist until Konqueror will be closed + if(!SQ_LibraryHandler::instance()) + new SQ_LibraryHandler; + + new SQ_DirOperator; + + gl = new SQ_GLWidget(parentWidget, "ksquirrelpart-opengl-widget"); + gl->glInitA(); + + connect(gl, SIGNAL(message(const QString &)), this, SIGNAL(setStatusBarText(const QString&))); + setWidget(gl); + + KAction *a; + + a = gl->actionCollection()->action(QString("action_%1").arg(Qt::Key_Plus)); + new KAction(i18n("Zoom +"), "viewmag+", 0, a, SLOT(activate()), actionCollection(), "ksquirrelpart zoom in"); + + a = gl->actionCollection()->action(QString("action_%1").arg(Qt::Key_Minus)); + new KAction(i18n("Zoom -"), "viewmag-", 0, a, SLOT(activate()), actionCollection(), "ksquirrelpart zoom out"); + + a = gl->actionCollection()->action(QString("action_%1").arg(Qt::Key_P)); + new KAction(i18n("Properties"), "image", 0, a, SLOT(activate()), actionCollection(), "ksquirrelpart properties"); + + a = gl->actionCollection()->action(QString("action_%1").arg(Qt::Key_R)); + new KAction(i18n("Normalize"), "rebuild", 0, a, SLOT(activate()), actionCollection(), "ksquirrelpart normalize"); + + // colorize & filters + a = gl->actionCollection()->action(QString("action_%1").arg(Qt::Key_D)); + new KAction(i18n("Color balance..."), "colorize", 0, a, SLOT(activate()), actionCollection(), "ksquirrelpart colorbalance"); + + a = gl->actionCollection()->action(QString("action_%1").arg(Qt::Key_U)); + new KAction(i18n("Apply filter..."), "effect", 0, a, SLOT(activate()), actionCollection(), "ksquirrelpart filter"); + + // rotate + a = gl->actionCollection()->action(QString("action_%1").arg(Qt::Key_Left+CTRL)); + new KAction(i18n("Rotate left"), "rotate_ccw", 0, a, SLOT(activate()), actionCollection(), "ksquirrelpart rotateleft"); + + a = gl->actionCollection()->action(QString("action_%1").arg(Qt::Key_Right+CTRL)); + new KAction(i18n("Rotate right"), "rotate_cw", 0, a, SLOT(activate()), actionCollection(), "ksquirrelpart rotateright"); + + // copy/move + a = gl->actionCollection()->action(QString("action_%1").arg(Qt::Key_F5)); + new KAction(i18n("Copy to..."), "editcopy", 0, a, SLOT(activate()), actionCollection(), "ksquirrelpart copyto"); + + a = gl->actionCollection()->action(QString("action_%1").arg(Qt::Key_F7)); + new KAction(i18n("Move to..."), "editcut", 0, a, SLOT(activate()), actionCollection(), "ksquirrelpart moveto"); + + a = gl->actionCollection()->action(QString("action_%1").arg(Qt::Key_F6)); + new KAction(i18n("Copy to last folder"), "", 0, a, SLOT(activate()), actionCollection(), "ksquirrelpart copy"); + + a = gl->actionCollection()->action(QString("action_%1").arg(Qt::Key_F8)); + new KAction(i18n("Move to last folder"), "", 0, a, SLOT(activate()), actionCollection(), "ksquirrelpart move"); + + a = gl->actionCollection()->action(QString("action_%1").arg(Qt::Key_S)); + new KAction(i18n("Save As..."), "filesaveas", 0, a, SLOT(activate()), actionCollection(), "ksquirrelpart saveas"); + + sa = new KSelectAction(i18n("Zoom"), 0, actionCollection(), "ksquirrelpart zoom"); + sa->setEditable(true); + + QStringList zooms; + zooms << QString::number(10) + '%'; + zooms << QString::number(25) + '%'; + zooms << QString::number(33) + '%'; + zooms << QString::number(50) + '%'; + zooms << QString::number(75) + '%'; + zooms << QString::number(100) + '%'; + zooms << QString::number(150) + '%'; + zooms << QString::number(200) + '%'; + zooms << QString::number(250) + '%'; + zooms << QString::number(300) + '%'; + zooms << QString::number(350) + '%'; + zooms << QString::number(400) + '%'; + zooms << QString::number(450) + '%'; + zooms << QString::number(500) + '%'; + zooms << QString::number(600) + '%'; + zooms << QString::number(700) + '%'; + zooms << QString::number(800) + '%'; + zooms << QString::number(900) + '%'; + zooms << QString::number(1000) + '%'; + + sa->setItems(zooms); + sa->setCurrentItem(5); + connect(sa, SIGNAL(activated(int)), this, SLOT(slotZoom())); + + QString group = "selection_group"; + + ar = new KToggleAction(i18n("Rectangle"), "rectangle", KShortcut(Qt::Key_R+CTRL), 0, 0, actionCollection(), "ksquirrelpart rectangle"); + ar->setExclusiveGroup(group); + connect(ar, SIGNAL(toggled(bool)), this, SLOT(slotSelectionRect(bool))); + + ae = new KToggleAction(i18n("Ellipse"), "circle", KShortcut(Qt::Key_E+CTRL), 0, 0, actionCollection(), "ksquirrelpart ellipse"); + ae->setExclusiveGroup(group); + connect(ae, SIGNAL(toggled(bool)), this, SLOT(slotSelectionEllipse(bool))); + + setXMLFile("ksquirrelpart/ksquirrelpart.rc"); +} + +KSquirrelPart::~KSquirrelPart() +{ + kdDebug() << "-KSquirrelPart" << endl; +} + +void KSquirrelPart::slotZoom() +{ + bool ok; + + int z = sa->currentText().replace(QChar('%'), "").toInt(&ok); + + if(ok) + gl->zoom((float)z / 100.0f); +} + +void KSquirrelPart::slotSelectionRect(bool b) +{ + if(b) + gl->slotSelectionRect(); + else if(!ae->isChecked()) + gl->slotSelectionClear(); +} + +void KSquirrelPart::slotSelectionEllipse(bool b) +{ + if(b) + gl->slotSelectionEllipse(); + else if(!ar->isChecked()) + gl->slotSelectionClear(); +} + +void KSquirrelPart::print() +{ + gl->slotPrint(); +} + +KAboutData* KSquirrelPart::createAboutData() +{ + KAboutData *kAboutData = new KAboutData( + "ksquirrel", + I18N_NOOP("KSquirrelPart"), + "0.1.2", + I18N_NOOP("Image Viewer"), + KAboutData::License_GPL, + "(c) 2007, Dmitry Baryshev "); + + return kAboutData; +} + +bool KSquirrelPart::openFile() +{ + emit started(0); + + KFileItem fi(KFileItem::Unknown, KFileItem::Unknown, m_url); + SQ_DirOperator::instance()->execute(&fi); + + emit setWindowCaption(m_url.prettyURL()); + + emit completed(0); + + return true; +} + +void KSquirrelPart::setKonquerorWindowCaption(const KURL &, const QString &filename) +{ + QString caption = QString("%1").arg(filename); + emit setWindowCaption(caption); +} + +void KSquirrelPart::partActivateEvent(KParts::PartActivateEvent *e) +{ + if(e->activated()) + { + if(!gl->manualBlocked()) + gl->startAnimation(); + } + else + { + // stop animation when KPart becomes inactive + gl->stopAnimation(); + + SQ_LibraryHandler::instance()->sync(); + SQ_Config::instance()->sync(); + } + + KParts::ReadOnlyPart::partActivateEvent(e); +} + +/***************************************************************/ + +KSquirrelPartBrowserExtension::KSquirrelPartBrowserExtension(KSquirrelPart *viewPart, const char *name) + :KParts::BrowserExtension(viewPart, name) +{ + mPart = viewPart; + emit enableAction("print", true); +} + +KSquirrelPartBrowserExtension::~KSquirrelPartBrowserExtension() +{} + +void KSquirrelPartBrowserExtension::print() +{ + mPart->print(); +} + +#include "ksquirrelpart.moc" diff --git a/ksquirrel/ksquirrelpart/ksquirrelpart.desktop b/ksquirrel/ksquirrelpart/ksquirrelpart.desktop new file mode 100644 index 0000000..a860ed6 --- /dev/null +++ b/ksquirrel/ksquirrelpart/ksquirrelpart.desktop @@ -0,0 +1,11 @@ +[Desktop Entry] +Type=Service +MimeType=image/x-vnd.adobe.photoshop;image/x-hdr;image/x-exr;image/x-eps;image/x-psp;image/x-dds;image/x-mdl;image/ljpeg;image/x-dicom;image/x-xfig;image/svg+xml;image/gif;image/x-xpm;image/x-xbm;image/jpeg;image/x-bmp;image/png;image/tiff;image/x-portable-bitmap;image/x-portable-pixmap;image/x-portable-anymap;image/x-portable-greymap;image/jp2;image/x-jng;image/x-wmf;video/x-mng;video/x-flic;image/x-targa;image/x-pcx;image/x-photo-cd;image/x-rgb;image/x-xcursor;image/x-ico;image/psd;image/x-djvu;image/x-xcf-gimp;image/x-avs;image/x-cut;image/x-dxf;image/x-iff;image/x-jbig;image/x-koala;image/x-leaf;image/x-lif;image/x-mac;image/x-msp;image/x-mtv;image/x-neo;image/x-pi1;image/x-pi3;image/x-pict;image/x-pix;image/x-pxr;image/x-ras;image/x-raw;image/x-rawrgb;image/x-sct;image/x-sun;image/x-utah;image/x-wal;image/x-wbmp;image/x-xim;image/x-xwd;application/x-font-ttf;application/x-font-ttc;application/x-font-otf;application/x-font-type1 +ServiceTypes=KParts/ReadOnlyPart +X-KDE-Library=libksquirrelpart +InitialPreference=5 +Icon=ksquirrel + +Name=KSquirrel Image Viewer +Name[ru]=KSquirrel Просмотр изображений +Name[de]=KSquirrel Bildbetrachter \ No newline at end of file diff --git a/ksquirrel/ksquirrelpart/ksquirrelpart.h b/ksquirrel/ksquirrelpart/ksquirrelpart.h new file mode 100644 index 0000000..27f74c8 --- /dev/null +++ b/ksquirrel/ksquirrelpart/ksquirrelpart.h @@ -0,0 +1,87 @@ +/*************************************************************************** + sq_ksquirrelpart.h - description + ------------------- + begin : Thu Nov 29 2007 + copyright : (C) 2007 by Baryshev Dmitry + email : ksquirrel.iv@gmail.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifndef KSQUIRRELPART_H +#define KSQUIRRELPART_H + +#include + +class KAboutData; +class KToggleAction; +class KSelectAction; + +class SQ_GLWidget; + +class KSquirrelPart; + +class KSquirrelPartBrowserExtension: public KParts::BrowserExtension +{ + Q_OBJECT + + public: + KSquirrelPartBrowserExtension(KSquirrelPart* viewPart, const char *name = 0); + ~KSquirrelPartBrowserExtension(); + + public slots: + void print(); + + private: + KSquirrelPart *mPart; +}; + +/***********************************************************/ + +class KSquirrelPart : public KParts::ReadOnlyPart +{ + Q_OBJECT + + public: + KSquirrelPart(QWidget*, const char*, QObject*, const char*, const QStringList &); + virtual ~KSquirrelPart(); + + static KAboutData* createAboutData(); + + QString filePath(); + + void print(); + + protected: + void partActivateEvent(KParts::PartActivateEvent *); + + protected slots: + virtual bool openFile(); + virtual void setKonquerorWindowCaption(const KURL &url, const QString &filename); + + private slots: + void slotSelectionRect(bool); + void slotSelectionEllipse(bool); + void slotZoom(); + + private: + SQ_GLWidget *gl; + KToggleAction *ar, *ae; + KSelectAction *sa; + KSquirrelPartBrowserExtension *ext; +}; + +inline +QString KSquirrelPart::filePath() +{ + return m_file; +} + +#endif diff --git a/ksquirrel/ksquirrelpart/ksquirrelpart.rc b/ksquirrel/ksquirrelpart/ksquirrelpart.rc new file mode 100644 index 0000000..10aa894 --- /dev/null +++ b/ksquirrel/ksquirrelpart/ksquirrelpart.rc @@ -0,0 +1,20 @@ + + +Main Toolbar + + + + + + + + + + + + + + + + + diff --git a/ksquirrel/ksquirrelpart/sq_bcglabel.cpp b/ksquirrel/ksquirrelpart/sq_bcglabel.cpp new file mode 100644 index 0000000..d963976 --- /dev/null +++ b/ksquirrel/ksquirrelpart/sq_bcglabel.cpp @@ -0,0 +1,28 @@ +/*************************************************************************** + sq_bcglabel.cpp - description + ------------------- + begin : ??? May 4 2005 + copyright : (C) 2005 by Baryshev Dmitry + email : ksquirrel.iv@gmail.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#include "sq_bcglabel.h" + +SQ_BCGLabel::SQ_BCGLabel(QWidget *parent, const char *name, WFlags f) : QLabel(parent, name, f | Qt::WNoAutoErase) +{ + setScaledContents(false); + + setAlignment(Qt::AlignHCenter | Qt::AlignVCenter); +} + +SQ_BCGLabel::~SQ_BCGLabel() +{} diff --git a/ksquirrel/ksquirrelpart/sq_bcglabel.h b/ksquirrel/ksquirrelpart/sq_bcglabel.h new file mode 100644 index 0000000..dd86bc7 --- /dev/null +++ b/ksquirrel/ksquirrelpart/sq_bcglabel.h @@ -0,0 +1,34 @@ +/*************************************************************************** + sq_bcglabel.h - description + ------------------- + begin : ??? May 4 2005 + copyright : (C) 2005 by Baryshev Dmitry + email : ksquirrel.iv@gmail.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifndef SQ_BCGLABEL_H +#define SQ_BCGLABEL_H + +#include + +/** + *@author Baryshev Dmitry + */ + +class SQ_BCGLabel : public QLabel +{ + public: + SQ_BCGLabel(QWidget *parent, const char *name = 0, WFlags f = 0); + ~SQ_BCGLabel(); +}; + +#endif diff --git a/ksquirrel/ksquirrelpart/sq_codecsettings.cpp b/ksquirrel/ksquirrelpart/sq_codecsettings.cpp new file mode 100644 index 0000000..47b3609 --- /dev/null +++ b/ksquirrel/ksquirrelpart/sq_codecsettings.cpp @@ -0,0 +1,42 @@ +/*************************************************************************** + sq_codecsettings.cpp - description + ------------------- + begin : Mon Mar 5 2007 + copyright : (C) 2007 by Baryshev Dmitry + email : ksquirrel.iv@gmail.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#include + +#include "sq_codecsettings.h" +#include "sq_library.h" +#include "sq_config.h" + +void SQ_CodecSettings::applySettings(SQ_LIBRARY *lib, SQ_CodecSettings::settings fromwhere) +{ + SQ_Config::instance()->setGroup("Main"); + + int set = SQ_Config::instance()->readNumEntry("applyto", SQ_CodecSettings::Both); + + // thumbnail loader and image viewer will use default settings + if((fromwhere == SQ_CodecSettings::ThumbnailLoader && (set == SQ_CodecSettings::ThumbnailLoader || set == SQ_CodecSettings::Both)) + || (fromwhere == SQ_CodecSettings::ImageViewer && (set == SQ_CodecSettings::ImageViewer || set == SQ_CodecSettings::Both))) + { + lib->codec->set_settings(lib->settings); + lib->codec_il->set_settings(lib->settings); + } + else + { + lib->codec->fill_default_settings(); + lib->codec_il->fill_default_settings(); + } +} diff --git a/ksquirrel/ksquirrelpart/sq_codecsettings.h b/ksquirrel/ksquirrelpart/sq_codecsettings.h new file mode 100644 index 0000000..f789e9f --- /dev/null +++ b/ksquirrel/ksquirrelpart/sq_codecsettings.h @@ -0,0 +1,34 @@ +/*************************************************************************** + sq_codecsettings.h - description + ------------------- + begin : Mon Mar 5 2007 + copyright : (C) 2007 by Baryshev Dmitry + email : ksquirrel.iv@gmail.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifndef SQ_CODECSETTINGS_H +#define SQ_CODECSETTINGS_H + +/** + *@author Baryshev Dmitry + */ + +struct SQ_LIBRARY; + +struct SQ_CodecSettings +{ + enum settings { ThumbnailLoader = 0, ImageViewer, Both, RunTume, None }; + + static void applySettings(SQ_LIBRARY *l, SQ_CodecSettings::settings fromwhere); +}; + +#endif diff --git a/ksquirrel/ksquirrelpart/sq_codecsettingsskeleton.ui b/ksquirrel/ksquirrelpart/sq_codecsettingsskeleton.ui new file mode 100644 index 0000000..5ef812c --- /dev/null +++ b/ksquirrel/ksquirrelpart/sq_codecsettingsskeleton.ui @@ -0,0 +1,217 @@ + +SQ_CodecSettingsSkeleton + + + SQ_CodecSettingsSkeleton + + + + 0 + 0 + 283 + 335 + + + + Codec settings + + + true + + + + unnamed + + + + codecIcon + + + + 0 + 0 + 0 + 0 + + + + + 16 + 16 + + + + NoFrame + + + Plain + + + + + + + + line2 + + + HLine + + + Sunken + + + Horizontal + + + + + codecName + + + + 1 + + + + + + + + + groupBox + + + + + + + + line1 + + + HLine + + + Sunken + + + Horizontal + + + + + layout2 + + + + unnamed + + + + spacer2 + + + Horizontal + + + Expanding + + + + 16 + 16 + + + + + + pushApply + + + Apply + + + + + pushOK + + + OK + + + true + + + + + pushCancel + + + Cancel + + + + + + + + + pushOK + clicked() + SQ_CodecSettingsSkeleton + accept() + + + pushCancel + clicked() + SQ_CodecSettingsSkeleton + reject() + + + pushApply + clicked() + SQ_CodecSettingsSkeleton + slotApply() + + + + pushOK + pushApply + pushCancel + + + ksquirrel-libs/settings.h + qcheckbox.h + qmessagebox.h + qobjectlist.h + qbuttongroup.h + qslider.h + kurlrequester.h + knuminput.h + qwidgetfactory.h + qspinbox.h + qtextedit.h + kurl.h + kcolorbutton.h + sq_codecsettingsskeleton.ui.h + + + QWidget *w; + fmt_settings *sett; + + + apply(); + + + slotApply() + + + init() + addSettingsWidget( const QString & path ) + recursivelyReadWrite( fmt_settings & settings, bool r ) + exec( fmt_settings & settings ) + setCodecInfo( const QPixmap & pixmap, const QString & text ) + + + diff --git a/ksquirrel/ksquirrelpart/sq_codecsettingsskeleton.ui.h b/ksquirrel/ksquirrelpart/sq_codecsettingsskeleton.ui.h new file mode 100644 index 0000000..1ea9d6b --- /dev/null +++ b/ksquirrel/ksquirrelpart/sq_codecsettingsskeleton.ui.h @@ -0,0 +1,171 @@ +/**************************************************************************** +** ui.h extension file, included from the uic-generated form implementation. +** +** If you wish to add, delete or rename functions or slots use +** Qt Designer which will update this file, preserving your code. Create an +** init() function in place of a constructor, and a destroy() function in +** place of a destructor. +*****************************************************************************/ + +void SQ_CodecSettingsSkeleton::init() +{ + w = 0; + sett = 0; +} + +void SQ_CodecSettingsSkeleton::addSettingsWidget(const QString &path) +{ + w = QWidgetFactory::create(path, 0, this, "skeleton_settings"); + QWidget *fake; + + if(w) + fake = w; + else + { + pushApply->setEnabled(false); + pushOK->setEnabled(false); + + QTextEdit *t = new QTextEdit(i18n("Error loading widget from %1. Please check your installation or contact ksquirrel.iv@gmail.com").arg(path), QString::null, groupBox); + t->setReadOnly(true); + fake = t; + } + + fake->reparent(groupBox, QPoint(0,0), true); + + QGridLayout *grid = new QGridLayout(groupBox, 1, 1, 11, 6); + grid->addMultiCellWidget(fake, 1, 1, 0, 3); + + QSpacerItem *spacer = new QSpacerItem(15, 1, QSizePolicy::Minimum, QSizePolicy::Expanding); + grid->addItem(spacer, 2, 1); +} + +void SQ_CodecSettingsSkeleton::recursivelyReadWrite(fmt_settings &settings, bool r) +{ + if(!w) + return; + + QObjectList *ch = const_cast(w->children()); + fmt_settings::iterator t; + + for(QObjectList::iterator it = ch->begin();it != ch->end();++it) + { + t = settings.find((*it)->name()); + + if((*it)->inherits("QCheckBox")) + { + QCheckBox *c = dynamic_cast(*it); + + if(c && t != settings.end()) + { + if(r) + c->setChecked((*t).second.bVal); + else + (*t).second.bVal = c->isChecked(); + } + } + else if((*it)->inherits("QButtonGroup")) + { + QButtonGroup *c = dynamic_cast(*it); + + if(c && t != settings.end()) + { + if(r) + c->setButton((*t).second.iVal); + else + (*t).second.iVal = c->selectedId(); + } + } + else if((*it)->inherits("QSlider")) + { + QSlider *c = dynamic_cast(*it); + + if(c && t != settings.end()) + { + if(r) + c->setValue((*t).second.iVal); + else + (*t).second.iVal = c->value(); + } + } + else if((*it)->inherits("KURLRequester")) + { + KURLRequester *u = dynamic_cast(*it); + + if(u && t != settings.end()) + { + if(r) + u->setURL((*t).second.sVal); + else + { + KURL url = u->url(); // get rid of "file://" if present + (*t).second.sVal = url.isEmpty() ? "" : url.path().ascii(); + } + } + } + else if((*it)->inherits("KDoubleSpinBox")) + { + KDoubleSpinBox *d = dynamic_cast(*it); + + if(d && t != settings.end()) + { + if(r) + d->setValue((*t).second.dVal); + else + (*t).second.dVal = d->value(); + } + } + // QSpinBox should be checked after KDoubleSpinBox ! + else if((*it)->inherits("QSpinBox")) + { + QSpinBox *c = dynamic_cast(*it); + + if(c && t != settings.end()) + { + if(r) + c->setValue((*t).second.iVal); + else + (*t).second.iVal = c->value(); + } + } + else if((*it)->inherits("KColorButton")) + { + KColorButton *c = dynamic_cast(*it); + + if(c && t != settings.end()) + { + if(r) + c->setColor(QColor((*t).second.sVal)); + else + (*t).second.sVal = c->color().name().ascii(); + } + } + } +} + +int SQ_CodecSettingsSkeleton::exec(fmt_settings &settings) +{ + // read settings + recursivelyReadWrite(settings, true); + + sett = &settings; + + int result = QDialog::exec(); + + // save settings + if(result == QDialog::Accepted) + recursivelyReadWrite(settings, false); + + return result; +} + +void SQ_CodecSettingsSkeleton::setCodecInfo( const QPixmap &pixmap, const QString &text ) +{ + codecIcon->setPixmap(pixmap); + codecName->setText(text); +} + +void SQ_CodecSettingsSkeleton::slotApply() +{ + recursivelyReadWrite(*sett, false); + emit apply(); +} diff --git a/ksquirrel/ksquirrelpart/sq_config.cpp b/ksquirrel/ksquirrelpart/sq_config.cpp new file mode 100644 index 0000000..960c1af --- /dev/null +++ b/ksquirrel/ksquirrelpart/sq_config.cpp @@ -0,0 +1,36 @@ +/*************************************************************************** + sq_config.cpp - description + ------------------- + begin : ??? ??? 14 2004 + copyright : (C) 2004 by Baryshev Dmitry + email : ksquirrel.iv@gmail.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include "sq_config.h" + +SQ_Config * SQ_Config::m_instance = 0; + +SQ_Config::SQ_Config(QObject *parent) : QObject(parent) +{ + m_instance = this; + + kconf = new KConfig("ksquirrelrc"); +} + +SQ_Config::~SQ_Config() +{ + delete kconf; +} diff --git a/ksquirrel/ksquirrelpart/sq_config.h b/ksquirrel/ksquirrelpart/sq_config.h new file mode 100644 index 0000000..6f2a662 --- /dev/null +++ b/ksquirrel/ksquirrelpart/sq_config.h @@ -0,0 +1,136 @@ +/*************************************************************************** + sq_config.h - description + ------------------- + begin : ??? ??? 14 2004 + copyright : (C) 2004 by Baryshev Dmitry + email : ksquirrel.iv@gmail.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifndef SQ_CONFIG_H +#define SQ_CONFIG_H + +#include +#include + +class KConfig; + +/* + * Class for reading/writing config file + */ + +class SQ_Config : public QObject +{ + public: + SQ_Config(QObject *parent = 0); + ~SQ_Config(); + + static SQ_Config* instance() { return m_instance; } + + void sync(); + + void setGroup(const QString &group); + bool hasGroup(const QString &group) const; + bool deleteGroup( const QString& group, bool bDeep = true, bool bGlobal = false ); + QString readEntry(const QString& pKey, const QString& aDefault = QString::null ) const; + QStringList readListEntry( const QString& pKey, char sep = ',' ) const; + int readNumEntry( const QString& pKey, int nDefault = 0 ) const; + bool readBoolEntry( const QString& pKey, bool bDefault = false ) const; + QRect readRectEntry( const QString& pKey, const QRect* pDefault = 0L ) const; + QPoint readPointEntry( const QString& pKey, const QPoint* pDefault = 0L ) const; + QSize readSizeEntry( const QString& pKey, const QSize* pDefault = 0L ) const; + double readDoubleNumEntry( const QString& pKey, double nDefault = 0.0 ) const; + QValueList readIntListEntry( const QString& pKey ) const; + + void writeEntry( const QString& pKey, const QString& pValue, bool bPersistent = true, bool bGlobal = false, bool bNLS = false ); + void writeEntry( const QString& pKey, const QStringList &rValue, char sep = ',', bool bPersistent = true, bool bGlobal = false, bool bNLS = false ); + void writeEntry( const QString& pKey, int nValue, bool bPersistent = true, bool bGlobal = false, bool bNLS = false ); + void writeEntry( const QString& pKey, bool bValue, bool bPersistent = true, bool bGlobal = false, bool bNLS = false ); + void writeEntry( const QString& pKey, const QRect& rValue, bool bPersistent = true, bool bGlobal = false, bool bNLS = false ); + void writeEntry( const QString& pKey, const QPoint& rValue, bool bPersistent = true, bool bGlobal = false, bool bNLS = false ); + void writeEntry( const QString& pKey, const QSize& rValue, bool bPersistent = true, bool bGlobal = false, bool bNLS = false ); + void writeEntry( const QString& pKey, double nValue, bool bPersistent = true, bool bGlobal = false, char format = 'g', int precision = 6, bool bNLS = false ); + void writeEntry( const QString& pKey, const QValueList& rValue, bool bPersistent = true, bool bGlobal = false, bool bNLS = false ); + + private: + KConfig *kconf; + static SQ_Config *m_instance; +}; + +inline +void SQ_Config::sync() { kconf->sync(); } + +inline +void SQ_Config::setGroup(const QString &group) { kconf->setGroup(group) ; } + +inline +bool SQ_Config::hasGroup(const QString &group) const { return kconf->hasGroup(group) ; } + +inline +bool SQ_Config::deleteGroup(const QString& group, bool bDeep, bool bGlobal) { return kconf->deleteGroup(group, bDeep, bGlobal) ; } + +inline +QString SQ_Config::readEntry(const QString& pKey, const QString& aDefault) const { return kconf->readEntry(pKey, aDefault) ; } + +inline +QStringList SQ_Config::readListEntry(const QString& pKey, char sep) const { return kconf->readListEntry(pKey, sep) ; } + +inline +int SQ_Config::readNumEntry(const QString& pKey, int nDefault) const { return kconf->readNumEntry(pKey, nDefault) ; } + +inline +bool SQ_Config::readBoolEntry(const QString& pKey, bool bDefault) const { return kconf->readBoolEntry(pKey, bDefault ) ; } + +inline +QRect SQ_Config::readRectEntry(const QString& pKey, const QRect* pDefault) const { return kconf->readRectEntry(pKey, pDefault) ; } + +inline +QPoint SQ_Config::readPointEntry(const QString& pKey, const QPoint* pDefault) const { return kconf->readPointEntry(pKey, pDefault) ; } + +inline +QSize SQ_Config::readSizeEntry(const QString& pKey, const QSize* pDefault) const { return kconf->readSizeEntry(pKey, pDefault) ; } + +inline +double SQ_Config::readDoubleNumEntry(const QString& pKey, double nDefault) const { return kconf->readDoubleNumEntry(pKey, nDefault); } + +inline +QValueList SQ_Config::readIntListEntry( const QString& pKey ) const { return kconf->readIntListEntry(pKey); } + +/**********************************************/ + +inline +void SQ_Config::writeEntry(const QString& pKey, const QString& pValue, bool bPersistent, bool bGlobal, bool bNLS) { kconf->writeEntry( pKey, pValue, bPersistent, bGlobal, bNLS ) ; } + +inline +void SQ_Config::writeEntry(const QString& pKey, const QStringList &rValue, char sep, bool bPersistent, bool bGlobal, bool bNLS ) { kconf->writeEntry(pKey, rValue, sep, bPersistent, bGlobal, bNLS ) ; } + +inline +void SQ_Config::writeEntry(const QString& pKey, int nValue, bool bPersistent, bool bGlobal, bool bNLS ) { kconf->writeEntry(pKey, nValue, bPersistent, bGlobal, bNLS ) ; } + +inline +void SQ_Config::writeEntry(const QString& pKey, bool bValue, bool bPersistent, bool bGlobal, bool bNLS ) { kconf->writeEntry(pKey, bValue, bPersistent, bGlobal, bNLS ) ; } + +inline +void SQ_Config::writeEntry(const QString& pKey, const QRect& rValue, bool bPersistent, bool bGlobal, bool bNLS ) { kconf->writeEntry(pKey, rValue, bPersistent, bGlobal, bNLS ) ; } + +inline +void SQ_Config::writeEntry(const QString& pKey, const QPoint& rValue, bool bPersistent, bool bGlobal, bool bNLS ) { kconf->writeEntry(pKey, rValue, bPersistent, bGlobal, bNLS ) ; } + +inline +void SQ_Config::writeEntry(const QString& pKey, const QSize& rValue, bool bPersistent, bool bGlobal, bool bNLS ) { kconf->writeEntry(pKey,rValue, bPersistent, bGlobal, bNLS ) ; } + +inline +void SQ_Config::writeEntry( const QString& pKey, double nValue, bool bPersistent, bool bGlobal, char format, int precision, bool bNLS) { kconf->writeEntry(pKey, nValue, bPersistent, bGlobal, format, precision, bNLS); } + +inline +void SQ_Config::writeEntry( const QString& pKey, const QValueList& rValue, bool bPersistent, bool bGlobal, bool bNLS) { kconf->writeEntry(pKey, rValue, bPersistent, bGlobal, bNLS); } + +#endif diff --git a/ksquirrel/ksquirrelpart/sq_diroperator.cpp b/ksquirrel/ksquirrelpart/sq_diroperator.cpp new file mode 100644 index 0000000..bfaec38 --- /dev/null +++ b/ksquirrel/ksquirrelpart/sq_diroperator.cpp @@ -0,0 +1,86 @@ +/*************************************************************************** + sq_diroperator.cpp - description + ------------------- + begin : Thu Nov 29 2007 + copyright : (C) 2007 by Baryshev Dmitry + email : ksquirrel.iv@gmail.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#include +#include + +#include "sq_diroperator.h" +#include "sq_libraryhandler.h" +#include "sq_downloader.h" +#include "sq_glwidget.h" + +SQ_DirOperator * SQ_DirOperator::m_inst = 0; + +SQ_DirOperator::SQ_DirOperator(QObject *parent) : QObject(parent) +{ + m_inst = this; + + down = new SQ_Downloader(this, "SQ_Downloader [dirop]"); + + connect(down, SIGNAL(result(const KURL &)), this, SLOT(slotDownloaderResult(const KURL &))); + connect(down, SIGNAL(percents(int)), this, SLOT(slotDownloadPercents(int))); +} + +SQ_DirOperator::~SQ_DirOperator() +{} + +void SQ_DirOperator::execute(KFileItem *fi) +{ + down->kill(); + + SQ_GLWidget::window()->setOriginalURL(fi->url()); + + if(fi->url().isLocalFile()) + executePrivate(fi); + else if(SQ_LibraryHandler::instance()->maybeSupported(fi->url(), fi->mimetype()) != SQ_LibraryHandler::No) + down->start(fi); +} + +void SQ_DirOperator::slotDownloaderResult(const KURL &url) +{ + SQ_GLWidget::window()->setDownloadPercents(-1); + + if(url.isEmpty()) + return; + + KFileItem fi(KFileItem::Unknown, KFileItem::Unknown, url); + + executePrivate(&fi); +} + +void SQ_DirOperator::executePrivate(KFileItem *fi) +{ + QString fullpath = fi->url().path(); + + if(SQ_LibraryHandler::instance()->libraryForFile(fullpath)) + SQ_GLWidget::window()->startDecoding(fullpath); +} + +void SQ_DirOperator::slotDownloadPercents(int p) +{ + SQ_GLWidget::window()->setDownloadPercents(p); +} + +void SQ_DirOperator::del(const KURL &u, QWidget *parent) +{ + KURL::List list; + list.append(u); + + KonqOperations::del(parent, KonqOperations::DEL, list); +} + +#include "sq_diroperator.moc" diff --git a/ksquirrel/ksquirrelpart/sq_diroperator.h b/ksquirrel/ksquirrelpart/sq_diroperator.h new file mode 100644 index 0000000..0e1aa57 --- /dev/null +++ b/ksquirrel/ksquirrelpart/sq_diroperator.h @@ -0,0 +1,57 @@ +/*************************************************************************** + sq_diroperator.h - description + ------------------- + begin : Thu Nov 29 2007 + copyright : (C) 2007 by Baryshev Dmitry + email : ksquirrel.iv@gmail.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifndef SQ_DIROPERATOR_H +#define SQ_DIROPERATOR_H + +#include + +#include + +class SQ_Downloader; + +class KURL; + +class SQ_DirOperator : public QObject +{ + Q_OBJECT + + public: + SQ_DirOperator(QObject *parent = 0); + ~SQ_DirOperator(); + + static SQ_DirOperator* instance() { return m_inst; } + + void execute(KFileItem *item); + + void del(const KURL &u, QWidget *parent = 0); + + private: + void executePrivate(KFileItem *); + + private slots: + + void slotDownloadPercents(int); + void slotDownloaderResult(const KURL &); + + private: + SQ_Downloader *down; + + static SQ_DirOperator *m_inst; +}; + +#endif diff --git a/ksquirrel/ksquirrelpart/sq_downloader.cpp b/ksquirrel/ksquirrelpart/sq_downloader.cpp new file mode 100644 index 0000000..290a1d8 --- /dev/null +++ b/ksquirrel/ksquirrelpart/sq_downloader.cpp @@ -0,0 +1,143 @@ +/*************************************************************************** + sq_downloader.cpp - description + ------------------- + begin : Fri Jun 07 2007 + copyright : (C) 2007 by Baryshev Dmitry + email : ksquirrel.iv@gmail.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#include + +#include +#include +#include + +#include "sq_libraryhandler.h" +#include "sq_downloader.h" + +#ifndef KSQUIRREL_PART +#include "sq_archivehandler.h" +#endif + +#define SQ_PREDOWNLOAD_SIZE 50 + +SQ_Downloader::SQ_Downloader(QObject *parent, const char *name) : QObject(parent, name), job(0), m_error(false) +{ + tmp = new KTempFile; + tmp->setAutoDelete(true); + tmp->close(); +} + +SQ_Downloader::~SQ_Downloader() +{ + clean(); + + delete tmp; +} + +void SQ_Downloader::start(KFileItem *fi) +{ + m_error = false; + mURL = fi->url(); + + emitPercents = false; + startTime = QTime::currentTime(); + size = 0; + totalSize = fi->size(); + +#ifndef KSQUIRREL_PART + nomime = SQ_ArchiveHandler::instance()->findProtocolByMime(fi->mimetype()).isEmpty(); +#else + nomime = true; +#endif + + job = KIO::get(mURL, false, false); + + clean(); + + continueDownload = false; + + connect(job, SIGNAL(data(KIO::Job *, const QByteArray &)), this, SLOT(slotData(KIO::Job *, const QByteArray &))); + connect(job, SIGNAL(result(KIO::Job *)), this, SLOT(slotDataResult(KIO::Job *))); +} + +void SQ_Downloader::slotData(KIO::Job *job, const QByteArray &ba) +{ + size += ba.size(); + + QFile f(tmp->name()); + + if(f.open(IO_WriteOnly | IO_Append)) + { + f.writeBlock(ba); + f.close(); + } + + if(emitPercents || startTime.msecsTo(QTime::currentTime()) > 1000) + { + emit percents(size); + emitPercents = true; + } + + // 50 bytes are enough to determine file type + if(size >= SQ_PREDOWNLOAD_SIZE && !continueDownload && totalSize != size) + { + // cancel download (file type is not supported) + SQ_LIBRARY *lib = SQ_LibraryHandler::instance()->libraryForFile(tmp->name()); + + if(nomime && !lib) + { + job->kill(false); // kill job & emit result + } + else + { + // nice, we can open this image/archive - continue download + continueDownload = true; + } + } +} + +void SQ_Downloader::slotDataResult(KIO::Job *cpjob) +{ + job = 0; + + // job error + if(cpjob->error() && cpjob->error() != KIO::ERR_USER_CANCELED) + { + m_error = true; + emit result(mEmptyURL); + } + else if(cpjob->error() == KIO::ERR_USER_CANCELED) // not supported image/archive type - + // emit empty url without errors + { + emit result(mEmptyURL); + } + else // supported image type/archive type (no errors or job killed) + { + emit result(KURL::fromPathOrURL(tmp->name())); + } +} + +void SQ_Downloader::clean() +{ + QFile f(tmp->name()); + + if(f.open(IO_WriteOnly)) + f.close(); +} + +void SQ_Downloader::kill() +{ + if(job) job->kill(); +} + +#include "sq_downloader.moc" diff --git a/ksquirrel/ksquirrelpart/sq_downloader.h b/ksquirrel/ksquirrelpart/sq_downloader.h new file mode 100644 index 0000000..a51649f --- /dev/null +++ b/ksquirrel/ksquirrelpart/sq_downloader.h @@ -0,0 +1,73 @@ +/*************************************************************************** + sq_downloader.h - description + ------------------- + begin : Fri Jun 07 2007 + copyright : (C) 2007 by Baryshev Dmitry + email : ksquirrel.iv@gmail.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifndef SQ_DOWNLOADER_H +#define SQ_DOWNLOADER_H + +#include +#include + +#include + +class KFileItem; +class KTempFile; + +namespace KIO { class Job; } + +class SQ_Downloader : public QObject +{ + Q_OBJECT + + public: + SQ_Downloader(QObject *parent = 0, const char *name = 0); + ~SQ_Downloader(); + + void start(KFileItem *fi); + + bool error() const; + + void clean(); + + void kill(); + + signals: + void result(const KURL &); + void percents(int); + + private slots: + void slotData(KIO::Job *job, const QByteArray &data); + void slotDataResult(KIO::Job *); + + private: + KIO::Job *job; + KURL mEmptyURL, mURL; + KTempFile *tmp; + KIO::filesize_t totalSize, size; + bool continueDownload; + bool nomime; + bool m_error, m_lightmode; + QTime startTime; + bool emitPercents; +}; + +inline +bool SQ_Downloader::error() const +{ + return m_error; +} + +#endif diff --git a/ksquirrel/ksquirrelpart/sq_errorstring.cpp b/ksquirrel/ksquirrelpart/sq_errorstring.cpp new file mode 100644 index 0000000..daa6b20 --- /dev/null +++ b/ksquirrel/ksquirrelpart/sq_errorstring.cpp @@ -0,0 +1,58 @@ +/*************************************************************************** + sq_errorstring.cpp - description + ------------------- + begin : ??? ??? 26 2005 + copyright : (C) 2005 by Baryshev Dmitry + email : ksquirrel.iv@gmail.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include "sq_errorstring.h" + +#include + +SQ_ErrorString * SQ_ErrorString::m_instance = 0; + +SQ_ErrorString::SQ_ErrorString(QObject *parent) : QObject(parent) +{ + m_instance = this; + + // fill map with translated messages + messages.insert(SQE_OK, QString::fromLatin1("OK")); + messages.insert(SQE_R_NOFILE, i18n("cannot open file for reading")); + messages.insert(SQE_R_BADFILE, i18n("file corrupted")); + messages.insert(SQE_R_NOMEMORY, i18n("no memory")); + messages.insert(SQE_R_NOTSUPPORTED, i18n("file type not supported")); + messages.insert(SQE_R_WRONGDIM, i18n("wrong image dimensions")); + messages.insert(SQE_W_NOFILE, i18n("cannot open file for writing")); + messages.insert(SQE_W_NOTSUPPORTED, i18n("write feature is not supported")); + messages.insert(SQE_W_ERROR, i18n("write error (check free space)")); + messages.insert(SQE_W_WRONGPARAMS, i18n("wrong parameters")); + messages.insert(SQE_NOTFINISHED, i18n("Editing process is not finished yet")); +} + +SQ_ErrorString::~SQ_ErrorString() +{} + +// Get string by error code. +QString SQ_ErrorString::string(const int code) +{ + return messages[code]; +} + +QString SQ_ErrorString::stringSN(const int code) +{ + return messages[code] + '\n'; +} diff --git a/ksquirrel/ksquirrelpart/sq_errorstring.h b/ksquirrel/ksquirrelpart/sq_errorstring.h new file mode 100644 index 0000000..b1c4838 --- /dev/null +++ b/ksquirrel/ksquirrelpart/sq_errorstring.h @@ -0,0 +1,56 @@ +/*************************************************************************** + sq_errorstring.h - description + ------------------- + begin : ??? ??? 26 2005 + copyright : (C) 2005 by Baryshev Dmitry + email : ksquirrel.iv@gmail.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifndef SQ_ERRORSTRING_H +#define SQ_ERRORSTRING_H + +#include +#include + +#include + +#define SQE_NOTFINISHED 10000 + +/* + * Class SQ_ErrorString will return translated string representation of + * error code. + */ + +class SQ_ErrorString : public QObject +{ + public: + SQ_ErrorString(QObject *parent = 0); + ~SQ_ErrorString(); + + /* + * Get string representation of error. + */ + QString string(const int code); + + /* + * string() + "\n" + */ + QString stringSN(const int code); + + static SQ_ErrorString* instance() { return m_instance; } + + private: + QMap messages; + static SQ_ErrorString *m_instance; +}; + +#endif diff --git a/ksquirrel/ksquirrelpart/sq_externaltool.cpp b/ksquirrel/ksquirrelpart/sq_externaltool.cpp new file mode 100644 index 0000000..aa349ed --- /dev/null +++ b/ksquirrel/ksquirrelpart/sq_externaltool.cpp @@ -0,0 +1,245 @@ +/*************************************************************************** + sq_externaltool.cpp - description + ------------------- + begin : ??? ??? 12 2004 + copyright : (C) 2004 by Baryshev Dmitry + email : ksquirrel.iv@gmail.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include + +#include +#include +#include +#include +#include +#include + +#include "sq_iconloader.h" +#include "sq_externaltool.h" +#include "sq_popupmenu.h" +#include "sq_config.h" + +SQ_ExternalTool * SQ_ExternalTool::m_instance = 0; + +Tool::Tool() +{} + +Tool::Tool(const QString &pix, const QString &nam, const QString &com) +{ + icon = pix; + name = nam; + command = com; +} + +SQ_ExternalTool::SQ_ExternalTool(QObject *parent) : QObject(parent), QValueVector() +{ + m_instance = this; + menu = new SQ_PopupMenu(0, "External tools"); + + connect(menu, SIGNAL(aboutToShow()), this, SLOT(slotAboutToShowMenu())); + connect(menu, SIGNAL(activated(int)), this, SLOT(slotActivateTool(int))); + + QString str, tmp; + + SQ_Config::instance()->setGroup("External tools"); + + QStringList names = SQ_Config::instance()->readListEntry("names"); + QStringList commands = SQ_Config::instance()->readListEntry("commands"); + QStringList icons = SQ_Config::instance()->readListEntry("icons"); + + for(QStringList::iterator it_n = names.begin(),it_c = commands.begin(),it_i = icons.begin(); + it_n != names.end() || it_c != commands.end() || it_i != icons.end(); + ++it_n, ++it_c, ++it_i) + { + append(Tool(*it_i, *it_n, *it_c)); + } +} + +SQ_ExternalTool::~SQ_ExternalTool() +{ + delete menu; +} + +QString SQ_ExternalTool::toolPixmap(const int i) +{ + return (*this)[i].icon; +} + +QString SQ_ExternalTool::toolName(const int i) +{ + return (*this)[i].name; +} + +QString SQ_ExternalTool::toolCommand(const int i) +{ + return (*this)[i].command; +} + +/* + * Recreate current popop menu. + */ +SQ_PopupMenu* SQ_ExternalTool::newPopupMenu() +{ + int id; + + // clear menu + menu->clear(); + + menu->insertTitle(i18n("No file selected")); + + // construct new menu + for(unsigned int i = 0;i < count();i++) + { + id = menu->insertItem(SQ_IconLoader::instance()->loadIcon(toolPixmap(i), KIcon::Desktop, KIcon::SizeSmall), toolName(i)); + menu->setItemParameter(id, i); + } + + return menu; +} + +/* + * Get current popup menu. + */ +SQ_PopupMenu* SQ_ExternalTool::constPopupMenu() const +{ + return menu; +} + +/* + * Write tools to config file + */ +void SQ_ExternalTool::writeEntries() +{ + // no tools ? + if(!count()) return; + + QString num; + + // delete old group with old items + SQ_Config::instance()->deleteGroup("External tools"); + SQ_Config::instance()->setGroup("External tools"); + QStringList names, icons, commands; + + // write items in config file + for(QValueVector::iterator it = begin();it != end();++it) + { + names.append((*it).name); + icons.append((*it).icon); + commands.append((*it).command); + } + + SQ_Config::instance()->writeEntry("names", names); + SQ_Config::instance()->writeEntry("commands", commands); + SQ_Config::instance()->writeEntry("icons", icons); +} + +/* + * Invoked, when user executed popup menu with external tools. + * This slot will do some useful stuff. + */ +void SQ_ExternalTool::slotAboutToShowMenu() +{ + if(!items.count()) + { + menu->changeTitle(i18n("No file selected")); + return; + } + + KFileItem *item = items.first(); + + if(!item) + { + menu->changeTitle(i18n("No file selected")); + return; + } + + // make title shorter + QString file = KStringHandler::rsqueeze(item->name(), 30); + + // finally, change title + QString final = (items.count() == 1 || items.count() == 0) ? file : (file + QString::fromLatin1(" (+%1)").arg(items.count()-1)); + menu->changeTitle(final); +} + +void SQ_ExternalTool::slotActivateTool(int id) +{ + KURL::List list; + + if(items.isEmpty()) return; + + int index = menu->itemParameter(id); + + KFileItem *f = items.first(); + + while(f) + { + list.append(f->url()); + f = items.next(); + } + + items.clear(); + + if(list.empty()) return; + + KShellProcess proc; + + // get appropriate tool + Tool *tool = &at(index); + QString comm = tool->command; + + int per_f = comm.contains("%f"); + int per_F = comm.contains("%F"); + + // %f = single file + // %F = multiple files + if(per_f && per_F) + { + KMessageBox::error(0, i18n("Command cannot contain both \"%f\" and \"%F\""), i18n("Error processing command")); + return; + } + else if(!per_f && !per_F) + { + KMessageBox::error(0, i18n("Command should contain \"%f\" or \"%F\""), i18n("Error processing command")); + return; + } + else if(per_f) + { + KURL u = list.first(); + comm.replace("%f", KShellProcess::quote(u.isLocalFile() ? u.path() : u.prettyURL())); + proc << comm; + } + else + { + QString files; + + KURL::List::iterator itEnd = list.end(); + + for(KURL::List::iterator it = list.begin();it != itEnd;++it) + { + files.append(KShellProcess::quote((*it).isLocalFile() ? (*it).path() : (*it).prettyURL())); + files.append(" "); + } + + comm.replace("%F", files); + proc << comm; + } + + // start process + proc.start(KProcess::DontCare); +} + +#include "sq_externaltool.moc" diff --git a/ksquirrel/ksquirrelpart/sq_externaltool.h b/ksquirrel/ksquirrelpart/sq_externaltool.h new file mode 100644 index 0000000..3b1bc0a --- /dev/null +++ b/ksquirrel/ksquirrelpart/sq_externaltool.h @@ -0,0 +1,103 @@ +/*************************************************************************** + sq_externaltool.h - description + ------------------- + begin : ??? ??? 12 2004 + copyright : (C) 2004 by Baryshev Dmitry + email : ksquirrel.iv@gmail.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifndef SQ_EXTERNALTOOL_H +#define SQ_EXTERNALTOOL_H + +#include +#include +#include + +#include + +class SQ_PopupMenu; + +struct Tool +{ + Tool(); + Tool(const QString &, const QString &, const QString &); + + QString name, command; + QString icon; +}; + +/* + * Class which manages external tools. It store all available external tools + * in memory, and create popup menu where external tools been inserted. + */ + +class SQ_ExternalTool : public QObject, public QValueVector +{ + Q_OBJECT + + public: + SQ_ExternalTool(QObject *parent = 0); + ~SQ_ExternalTool(); + + /* + * Get pixmap, name or command of external tool. + */ + QString toolPixmap(const int i); + QString toolName(const int i); + QString toolCommand(const int i); + + void setItems(const KFileItemList &); + + /* + * Recreate current popop menu. + */ + SQ_PopupMenu* newPopupMenu(); + + /* + * Get current popup menu. + */ + SQ_PopupMenu* constPopupMenu() const; + + /* + * Write tools to config file as QStringLists + */ + void writeEntries(); + + static SQ_ExternalTool* instance() { return m_instance; } + + private slots: + + /* + * Invoked, when user executed popup menu with external tools. + * This slot will do some useful stuff. + */ + void slotAboutToShowMenu(); + void slotActivateTool(int); + + private: + /* + * Popup menu with all tools. + */ + SQ_PopupMenu *menu; + + KFileItemList items; + + static SQ_ExternalTool *m_instance; +}; + +inline +void SQ_ExternalTool::setItems(const KFileItemList &itms) +{ + items = itms; +} + +#endif diff --git a/ksquirrel/ksquirrelpart/sq_filedialog.cpp b/ksquirrel/ksquirrelpart/sq_filedialog.cpp new file mode 100644 index 0000000..ce0eb47 --- /dev/null +++ b/ksquirrel/ksquirrelpart/sq_filedialog.cpp @@ -0,0 +1,44 @@ +/*************************************************************************** + sq_filedialog.cpp - description + ------------------- + begin : Mon Mar 5 2007 + copyright : (C) 2007 by Baryshev Dmitry + email : ksquirrel.iv@gmail.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#include + +#include "sq_filedialog.h" + +SQ_FileDialog::SQ_FileDialog(const QString &path, QWidget *parent) + : KFileDialog(path, QString::null, parent, "select_a_file", true) +{} + +SQ_FileDialog::~SQ_FileDialog() +{} + +void SQ_FileDialog::updateCombo(bool enable) +{ + filterWidget->setEditable(enable); + + slotFilterChanged(); +} + +QString SQ_FileDialog::nameFilter() const +{ + return filterWidget->currentText(); +} + +void SQ_FileDialog::setCurrentFilter(const QString &f) +{ + filterWidget->setCurrentFilter(f); +} diff --git a/ksquirrel/ksquirrelpart/sq_filedialog.h b/ksquirrel/ksquirrelpart/sq_filedialog.h new file mode 100644 index 0000000..205b200 --- /dev/null +++ b/ksquirrel/ksquirrelpart/sq_filedialog.h @@ -0,0 +1,39 @@ +/*************************************************************************** + sq_filedialog.h - description + ------------------- + begin : Mon Mar 5 2007 + copyright : (C) 2007 by Baryshev Dmitry + email : ksquirrel.iv@gmail.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifndef SQ_FILEDIALOG_H +#define SQ_FILEDIALOG_H + +#include + +/** + *@author Baryshev Dmitry + */ + +class SQ_FileDialog : public KFileDialog +{ + public: + SQ_FileDialog(const QString &path, QWidget *parent); + ~SQ_FileDialog(); + + QString nameFilter() const; + void updateCombo(bool enable); + + void setCurrentFilter(const QString &); +}; + +#endif diff --git a/ksquirrel/ksquirrelpart/sq_glparts.cpp b/ksquirrel/ksquirrelpart/sq_glparts.cpp new file mode 100644 index 0000000..34a523d --- /dev/null +++ b/ksquirrel/ksquirrelpart/sq_glparts.cpp @@ -0,0 +1,219 @@ +/*************************************************************************** + sq_glparts.cpp - description + ------------------- + begin : ??? ??? 13 2007 + copyright : (C) 2007 by Baryshev Dmitry + email : ksquirrel.iv@gmail.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#include "sq_glparts.h" +#include "sq_library.h" + +#include + +/* ***************************************************************************************** */ + +Parts::Parts() : w(0), h(0), realw(0), realh(0), m_parts(0), buffer(0) +{} + +Part::Part() : x1(0), y1(0), x2(0), y2(0), tex(0), list(0) +{} + +/* ***************************************************************************************** */ + +memoryPart::memoryPart(const int sz) : m_size(sz), m_data(0) +{} + +memoryPart::~memoryPart() +{ + del(); +} + +void memoryPart::create() +{ + m_data = new RGBA [m_size]; + +// if(m_data) +// memset(m_data, 0, m_size * sizeof(RGBA)); +} + +// Delete textures and display lists. +void Parts::removeParts() +{ + if(!m_parts.empty()) + { + int toy = tilesy.size(); + int toxy = tilesx.size() * toy; + + for(int z = 0;z < toxy;z++) + glDeleteTextures(1, &m_parts[z].tex); + + glDeleteLists(m_parts[0].list, toy); + + m_parts.clear(); + } +} + +// Create parts: generate textures and display lists. +bool Parts::makeParts() +{ + int z; + int toy = tilesy.size(); + + GLuint base = glGenLists(toy); + + if(!base) + return false; + + Part pt; + int tox = tilesx.size(); + int toxy = tox * toy; + + for(z = 0;z < toxy;z++) + { + glGenTextures(1, &pt.tex); + m_parts.push_back(pt); + } + + // calculate display list's id + for(z = 0;z < toy;z++) + m_parts[z * tox].list = base + z; + + return true; +} + +// Calculate coordinates for textures +void Parts::computeCoords() +{ + Part *p; + int index = 0; + float X, Y; + + Y = (float)h / 2.0; + + int tlsy = tilesy.size(); + int tlsx = tilesx.size(); + + for(int y = 0;y < tlsy;y++) + { + X = -(float)w / 2.0; + + for(int x = 0;x < tlsx;x++) + { + p = &m_parts[index]; + + p->x1 = X; + p->y1 = Y; + p->x2 = X + tilesx[x]; + p->y2 = Y - tilesy[y]; + + p->tx1 = 0.0; + p->tx2 = 1.0; + p->ty1 = 0.0; + p->ty2 = 1.0; + + index++; + X += tilesx[x]; + } + + Y -= tilesy[y]; + } +} + +/* ***************************************************************************************** */ + +Tab::Tab() +{ + empty(); +} + +Tab::~Tab() +{} + +void Tab::clearParts() +{ + if(broken) return; + + std::vector::iterator itEnd = parts.end(); + + for(std::vector::iterator it = parts.begin();it != itEnd;++it) + { + // delete textures and memory buffers + (*it).removeParts(); + (*it).deleteBuffer(); + } + + parts.clear(); + + finfo.image.clear(); + finfo.meta.clear(); +} + +void Tab::removeParts() +{ + if(broken) return; + + std::vector::iterator itEnd = parts.end(); + + for(std::vector::iterator it = parts.begin();it != itEnd;++it) + (*it).removeParts(); +} + +void Tab::remakeParts() +{ + if(broken) return; + + std::vector::iterator itEnd = parts.end(); + + for(std::vector::iterator it = parts.begin();it != itEnd;++it) + { + (*it).makeParts(); + (*it).computeCoords(); + } +} + +void Tab::empty() +{ + nullMatrix(); + + orient = -1; + rotate = 0; + fmt_size = 0; + lib = 0; + codeK = 0; + current = 0; + curangle = 0; + total = 0; + sx = sy = sw = sh = 0; + elapsed = 0; + + wm = QWMatrix(); + + glselection = -1; + srect = QRect(); + + manualBlocked = false; + isflippedV = isflippedH = false; + broken = false; + + m_original = KURL(); + File = QString::null; + m_File = QString::null; + quickImageInfo = QString::null; + fmt_ext = QString::null; +} + +void Tab::nullMatrix() +{ + for(int i = 0;i < 12;i++) + matrix[i] = (GLfloat)(i % 5 == 0); +} diff --git a/ksquirrel/ksquirrelpart/sq_glparts.h b/ksquirrel/ksquirrelpart/sq_glparts.h new file mode 100644 index 0000000..3405f33 --- /dev/null +++ b/ksquirrel/ksquirrelpart/sq_glparts.h @@ -0,0 +1,152 @@ +/*************************************************************************** + sq_glparts.h - description + ------------------- + begin : ??? Mar 13 2007 + copyright : (C) 2007 by Baryshev Dmitry + email : ksquirrel.iv@gmail.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifndef SQ_GLPARTS_H +#define SQ_GLPARTS_H + +#include + +#include +#include + +#include + +#include + +#include + +struct SQ_LIBRARY; +class fmt_codec_base; + +class memoryPart +{ + public: + memoryPart(const int sz); + ~memoryPart(); + + // create/delete memory buffer + void create(); + void del(); + + bool valid() const; + RGBA *data(); + + private: + int m_size; + RGBA *m_data; +}; + +inline +RGBA* memoryPart::data() +{ + return m_data; +} + +inline +void memoryPart::del() +{ + delete [] m_data; + m_data = 0; +} + +inline +bool memoryPart::valid() const +{ + return m_data != 0; +} + +/* *************************************************************** */ + +struct Part +{ + Part(); + + float x1, y1, x2, y2, tx1, tx2, ty1, ty2; + unsigned int tex; + GLuint list; +}; + +/* *************************************************************** */ + +// one image page. All pages are stored in SQ_GLWidget::parts +struct Parts +{ + Parts(); + + int w, h, realw, realh; + + std::vector m_parts; + std::vector tilesx, tilesy; + memoryPart *buffer; + + bool makeParts(); + void removeParts(); + void computeCoords(); + void deleteBuffer(); +}; + +inline +void Parts::deleteBuffer() +{ + delete buffer; + buffer = 0; +} + +/* *************************************************************** */ + +struct Tab +{ + Tab(); + ~Tab(); + + void nullMatrix(); + void empty(); + void clearParts(); + void removeParts(); + void remakeParts(); + + GLfloat matrix[12]; + GLfloat curangle; + + KURL m_original; + QString File, m_File, quickImageInfo; + QString fmt_ext; + + QWMatrix wm; + QRect srect; + + int orient; + int current; + int fmt_size; + int total; + int glselection; + int sx, sy, sw, sh; + int elapsed; + + bool rotate; + bool manualBlocked; + bool isflippedV, isflippedH; + bool broken; + + std::vector parts; + fmt_info finfo; + + SQ_LIBRARY *lib; + fmt_codec_base *codeK; +}; + +#endif diff --git a/ksquirrel/ksquirrelpart/sq_glselectionpainter.cpp b/ksquirrel/ksquirrelpart/sq_glselectionpainter.cpp new file mode 100644 index 0000000..3d60389 --- /dev/null +++ b/ksquirrel/ksquirrelpart/sq_glselectionpainter.cpp @@ -0,0 +1,145 @@ +/*************************************************************************** + sq_glselectionpainter.cpp - description + ------------------- + begin : Apr 4 2007 + copyright : (C) 2007 by Baryshev Dmitry + email : ksquirrel.iv@gmail.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#include +#include + +#include + +#include "sq_glwidget.h" +#include "sq_glselectionpainter.h" + +static const int len = 4; +static const int len2 = 10; +static const int lenc = 2; +static const int lenc2 = lenc / 2; +static const double rad_const = 3.14159265358979323846 / 180.0; + +/* ******************************************************************* */ + +SQ_GLSelectionPainter::SQ_GLSelectionPainter(SQ_GLWidget *widget) + : w(widget), sourcew(1), sourceh(1), sw(0), sh(0), sx(0), sy(0), + angle(0), m_valid(false), m_shown(false) +{} + +SQ_GLSelectionPainter::~SQ_GLSelectionPainter() +{} + +void SQ_GLSelectionPainter::begin(Type tp, int x, int y, bool U) +{ + // end previous drawing if any + end(); + + m_type = tp; + + hackXY(x, y); + + sx = xmoveold = x; + sy = ymoveold = y; + sw = 0; + sh = 0; + + m_valid = true; + m_shown = true; + + if(U) w->updateGLA(); +} + +void SQ_GLSelectionPainter::move(int x, int y) +{ + hackXY(x, y); + + int X = QMAX(x, xmoveold); + int Y = QMIN(y, ymoveold); + int Xmin = QMIN(x, xmoveold); + int Ymin = QMAX(y, ymoveold); + + sx = Xmin; + sy = Ymin; + sw = X - Xmin; + sh = Ymin - Y; + + angle += 3; + + if(angle > 360) + angle = 0; + + // SQ_GLWidget::paintGL() will call draw() + w->updateGLA(); +} + +void SQ_GLSelectionPainter::end() +{ + m_valid = false; + m_shown = false; + + w->updateGLA(); +} + +void SQ_GLSelectionPainter::drawEllipse(float xradius, float yradius) +{ + w->makeCurrent(); + + double degInRad; + + glBegin(GL_LINE_LOOP); + glColor4f(1,0,1,1); + + for(int i = 0; i < 360; i++) + { + degInRad = rad_const * i; + glVertex2f(cos(degInRad) * xradius, sin(degInRad) * yradius); + } + + glColor4f(1,1,1,1); + glEnd(); +} + +void SQ_GLSelectionPainter::drawRect() +{ + w->makeCurrent(); + + glBegin(GL_LINE_LOOP); + glColor4f(1,0,1,1); + + glVertex2f(-sw/2, sh/2); + glVertex2f(sw/2, sh/2); + glVertex2f(sw/2, -sh/2); + glVertex2f(-sw/2, -sh/2); + + glColor4f(1,1,1,1); + glEnd(); +} + +void SQ_GLSelectionPainter::draw() +{ + if(!sw || !sh) + return; + + if(m_type == Ellipse) + drawEllipse(sw/2, sh/2); + else + drawRect(); + + // center rectangle + if(sw > lenc && sh > lenc) + { + glColor4f(1,0,1,1); + glRectf(-lenc2, lenc2, lenc2, -lenc2); + glColor4f(1,1,1,1); + } +} diff --git a/ksquirrel/ksquirrelpart/sq_glselectionpainter.h b/ksquirrel/ksquirrelpart/sq_glselectionpainter.h new file mode 100644 index 0000000..59a6ce2 --- /dev/null +++ b/ksquirrel/ksquirrelpart/sq_glselectionpainter.h @@ -0,0 +1,151 @@ +/*************************************************************************** + sq_glselectionpainter.h - description + ------------------- + begin : Apr 4 2007 + copyright : (C) 2007 by Baryshev Dmitry + email : ksquirrel.iv@gmail.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifndef SQ_GLSELECTIONPAINTER_H +#define SQ_GLSELECTIONPAINTER_H + +#include +#include + +class SQ_GLWidget; + +/* + * This is a selection painter for SQ_GLWidget. + * + * Selection can be shown as rectangle and ellipse. + * + * Ellipsis selection mainly used in redeye filter. + */ + +class SQ_GLSelectionPainter +{ + public: + enum Type { Rectangle, Ellipse }; + + SQ_GLSelectionPainter(SQ_GLWidget *widget); + ~SQ_GLSelectionPainter(); + + void setSourceSize(int, int); + + QPoint center() const; + + void draw(); + + /* + * Set selection type - rectangle or ellipse + */ + int type() const; + + /* + * when selection is drawn and visible, it's valid. + * After end() it becomes invalid. + */ + bool valid() const; + + void setVisible(bool vis); + + void begin(Type tp, int x, int y, bool U = true); + void move(int x, int y); + void setGeometry(const QRect &rc); + void end(); + + /* + * Selected rectangle geometry + */ + QPoint pos() const; + QSize size() const; + + private: + void drawEllipse(float xradius, float yradius); + void drawRect(); + void hackXY(int &x, int &y); + + private: + SQ_GLWidget *w; + int sourcew, sourceh; + int sw, sh, sx, sy; + + int angle; + int xmoveold, ymoveold; + bool m_valid, m_shown; + Type m_type; +}; + +inline +QPoint SQ_GLSelectionPainter::pos() const +{ + return valid() ? QPoint(sourcew/2 + sx, sourceh/2 - sy) : QPoint(); +} + +inline +QSize SQ_GLSelectionPainter::size() const +{ + return valid() ? QSize(sw, sh) : QSize(); +} + +inline +int SQ_GLSelectionPainter::type() const +{ + return m_type; +} + +inline +void SQ_GLSelectionPainter::setGeometry(const QRect &rc) +{ + int X = rc.x(), Y = rc.y(); + + hackXY(X, Y); + + sx = X; + sy = Y; + sw = rc.width(); + sh = rc.height(); +} + +inline +void SQ_GLSelectionPainter::setSourceSize(int w, int h) +{ + sourcew = w; + sourceh = h; +} + +inline +void SQ_GLSelectionPainter::setVisible(bool vis) +{ + if(m_valid) m_shown = vis; +} + +inline +bool SQ_GLSelectionPainter::valid() const +{ + return m_valid && m_shown; +} + +inline +QPoint SQ_GLSelectionPainter::center() const +{ + return QPoint(sx + sw/2, sy - sh/2); +} + +inline +void SQ_GLSelectionPainter::hackXY(int &x, int &y) +{ + x -= sourcew / 2; + y = sourceh / 2 - y; +} + +#endif diff --git a/ksquirrel/ksquirrelpart/sq_glu.cpp b/ksquirrel/ksquirrelpart/sq_glu.cpp new file mode 100644 index 0000000..8e17e31 --- /dev/null +++ b/ksquirrel/ksquirrelpart/sq_glu.cpp @@ -0,0 +1,110 @@ +/*************************************************************************** + sq_glu.cpp - description + ------------------- + begin : ??? ??? 29 2004 + copyright : (C) 2004 by Baryshev Dmitry + email : ksquirrel.iv@gmail.com + ***************************************************************************/ + +/* + * Mesa 3-D graphics library + * Version: 3.5 + * Copyright (C) 1995-2001 Brian Paul + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include "sq_glu.h" + +#include + +/* + * Replacement for gluLookAt(). + */ +void SQ_GLU::gluLookAt(GLdouble eyex, GLdouble eyey, GLdouble eyez, GLdouble centerx, GLdouble centery, GLdouble centerz, GLdouble upx, GLdouble upy, GLdouble upz) +{ + GLdouble m[16]; + GLdouble x[3], y[3], z[3]; + GLdouble mag; + + z[0] = eyex - centerx; + z[1] = eyey - centery; + z[2] = eyez - centerz; + + mag = sqrt(z[0] * z[0] + z[1] * z[1] + z[2] * z[2]); + + if(mag) + { + z[0] /= mag; + z[1] /= mag; + z[2] /= mag; + } + + y[0] = upx; + y[1] = upy; + y[2] = upz; + + x[0] = y[1] * z[2] - y[2] * z[1]; + x[1] = -y[0] * z[2] + y[2] * z[0]; + x[2] = y[0] * z[1] - y[1] * z[0]; + + y[0] = z[1] * x[2] - z[2] * x[1]; + y[1] = -z[0] * x[2] + z[2] * x[0]; + y[2] = z[0] * x[1] - z[1] * x[0]; + + mag = sqrt(x[0] * x[0] + x[1] * x[1] + x[2] * x[2]); + + if(mag) + { + x[0] /= mag; + x[1] /= mag; + x[2] /= mag; + } + + mag = sqrt(y[0] * y[0] + y[1] * y[1] + y[2] * y[2]); + + if(mag) + { + y[0] /= mag; + y[1] /= mag; + y[2] /= mag; + } + +#define M(row,col) m[col*4+row] + M(0, 0) = x[0]; + M(0, 1) = x[1]; + M(0, 2) = x[2]; + M(0, 3) = 0.0; + M(1, 0) = y[0]; + M(1, 1) = y[1]; + M(1, 2) = y[2]; + M(1, 3) = 0.0; + M(2, 0) = z[0]; + M(2, 1) = z[1]; + M(2, 2) = z[2]; + M(2, 3) = 0.0; + M(3, 0) = 0.0; + M(3, 1) = 0.0; + M(3, 2) = 0.0; + M(3, 3) = 1.0; +#undef M + + glMultMatrixd(m); + glTranslated(-eyex, -eyey, -eyez); +} diff --git a/ksquirrel/ksquirrelpart/sq_glu.h b/ksquirrel/ksquirrelpart/sq_glu.h new file mode 100644 index 0000000..9128d12 --- /dev/null +++ b/ksquirrel/ksquirrelpart/sq_glu.h @@ -0,0 +1,50 @@ +/*************************************************************************** + sq_glu.h - description + ------------------- + begin : ??? ??? 29 2004 + copyright : (C) 2004 by Baryshev Dmitry + email : ksquirrel.iv@gmail.com + ***************************************************************************/ +/* + * Mesa 3-D graphics library + * Version: 3.5 + * Copyright (C) 1995-2001 Brian Paul + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#ifndef SQ_GLU_H +#define SQ_GLU_H + +#include + +/* + * SQ_GLU is a replacement for libGLU. SQ_GLWidget uses only one method + * in original GLU library - gluLookAt(). It would be better to place it + * in standalone namespace, and remove -lGLU dependency at all. + * + * Note: Now KSquirrel doesn't use GLU, but Qt's QGLWidget still + * depends on + */ + +namespace SQ_GLU +{ + /* + * Replacement for gluLookAt(). + */ + void gluLookAt(GLdouble,GLdouble,GLdouble,GLdouble,GLdouble,GLdouble,GLdouble,GLdouble,GLdouble); +}; + +#endif diff --git a/ksquirrel/ksquirrelpart/sq_glview.cpp b/ksquirrel/ksquirrelpart/sq_glview.cpp new file mode 100644 index 0000000..7d8fbe1 --- /dev/null +++ b/ksquirrel/ksquirrelpart/sq_glview.cpp @@ -0,0 +1,114 @@ +/*************************************************************************** + sq_glview.cpp - description + ------------------- + begin : Thu Nov 29 2007 + copyright : (C) 2007 by Baryshev Dmitry + email : ksquirrel.iv@gmail.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#include + +#include "sq_glview.h" + +SQ_GLView * SQ_GLView::m_inst = 0; + +/***************************************/ + +SQ_TextSetter::SQ_TextSetter(QObject *parent) : QObject(parent) +{ + dest = "---"; +} + +SQ_TextSetter::~SQ_TextSetter() +{} + +void SQ_TextSetter::setText(const QString &s) +{ + dest = s; + + emit changed(); +} + +/***************************************/ + +SQ_GLView::SQ_GLView() : QObject() +{ + m_inst = this; + + map.insert("SBDecoded", new SQ_TextSetter(this)); + map.insert("SBFrame", new SQ_TextSetter(this)); + map.insert("SBLoaded", new SQ_TextSetter(this)); + map.insert("SBGLZoom", new SQ_TextSetter(this)); + map.insert("SBGLAngle", new SQ_TextSetter(this)); + map.insert("SBFile", new SQ_TextSetter(this)); + + tmp = new SQ_TextSetter(this); + + SQ_Setters::iterator itEnd = map.end(); + + for(SQ_Setters::iterator it = map.begin();it != itEnd;++it) + connect(it.data(), SIGNAL(changed()), this, SLOT(slotChanged())); +} + +SQ_GLView::~SQ_GLView() +{} + +SQ_TextSetter* SQ_GLView::sbarWidget(const QString &name) +{ + SQ_Setters::iterator it = map.find(name); + + return (it == map.end() ? tmp : it.data()); +} + +void SQ_GLView::resetStatusBar() +{ + SQ_Setters::iterator itEnd = map.end(); + + for(SQ_Setters::iterator it = map.begin();it != itEnd;++it) + { + it.data()->blockSignals(true); + it.data()->setText("---"); + it.data()->blockSignals(false); + } + + slotChanged(); +} + +void SQ_GLView::slotChanged() +{ + QString result; + + static const QString &line = KGlobal::staticQString(" | "); + + result.append(map["SBDecoded"]->text()); + result.append(line); + + result.append(map["SBFrame"]->text()); + result.append(line); + + result.append(map["SBLoaded"]->text()); + result.append(line); + + result.append(map["SBGLZoom"]->text()); + result.append(line); + + result.append(map["SBGLAngle"]->text()); + result.append(line); + + result.append(""); + result.append(map["SBFile"]->text()); + result.append(""); + + emit message(result); +} + +#include "sq_glview.moc" diff --git a/ksquirrel/ksquirrelpart/sq_glview.h b/ksquirrel/ksquirrelpart/sq_glview.h new file mode 100644 index 0000000..578b6af --- /dev/null +++ b/ksquirrel/ksquirrelpart/sq_glview.h @@ -0,0 +1,81 @@ +/*************************************************************************** + sq_glview.h - description + ------------------- + begin : Thu Nov 29 2007 + copyright : (C) 2007 by Baryshev Dmitry + email : ksquirrel.iv@gmail.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifndef SQ_GLVIEW_H +#define SQ_GLVIEW_H + +#include +#include +#include + +class SQ_TextSetter : public QObject +{ + Q_OBJECT + + public: + SQ_TextSetter(QObject *parent = 0); + ~SQ_TextSetter(); + + void setText(const QString &); + + QString text() const; + + signals: + void changed(); + + private: + QString dest; +}; + +inline +QString SQ_TextSetter::text() const +{ + return dest; +} + +/***********************************************/ + +class SQ_GLView : public QObject +{ + Q_OBJECT + + public: + SQ_GLView(); + ~SQ_GLView(); + + SQ_TextSetter* sbarWidget(const QString &); + + void resetStatusBar(); + + static SQ_GLView* window() { return m_inst; } + + signals: + void message(const QString &); + + private slots: + void slotChanged(); + + private: + static SQ_GLView *m_inst; + + typedef QMap SQ_Setters; + + SQ_Setters map; + SQ_TextSetter *tmp; +}; + +#endif diff --git a/ksquirrel/ksquirrelpart/sq_glwidget.cpp b/ksquirrel/ksquirrelpart/sq_glwidget.cpp new file mode 100644 index 0000000..79e5108 --- /dev/null +++ b/ksquirrel/ksquirrelpart/sq_glwidget.cpp @@ -0,0 +1,2006 @@ +/*************************************************************************** + sq_glwidget.cpp - description + ------------------- + begin : Mon Mar 15 2004 + copyright : (C) 2004 by Baryshev Dmitry + email : ksquirrel.iv@gmail.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#ifndef KSQUIRREL_PART +#include "ksquirrel.h" +#include "sq_widgetstack.h" +#include "sq_glview.h" +#include "sq_fileiconview.h" +#include "sq_diroperator.h" +#include "sq_hloptions.h" +#include "sq_previewwidget.h" +#include "sq_tabopendialog.h" +#endif + +#include "sq_popupmenu.h" +#include "sq_libraryhandler.h" +#include "sq_config.h" +#include "sq_glwidget_helpers.h" +#include "sq_glwidget.h" +#include "sq_glu.h" +#include "sq_codecsettings.h" +#include "sq_glselectionpainter.h" +#include "sq_utils.h" +#include "sq_errorstring.h" +#include "fmt_filters.h" + +#include +#include +#include +#include + +#ifdef SQ_HAVE_KEXIF +#include +#endif + +// is it enough ? +#define SQ_FLOAT_SIGMA 1e-5 + +#define ISFLOAT(a,b) (fabs(a - b) < SQ_FLOAT_SIGMA) +#define ISFLOAT1(a) ISFLOAT(a, 1.0) +#define ISFLOAT0(a) ISFLOAT(a, 0.0) + +#define SQ_TAB_TEXT_LENGTH 30 + +/* ***************************************************************************************** */ + +SQ_GLWidget * SQ_GLWidget::m_instance = 0; + +static const int timer_delay_file = 5; +static const double rad_const = 3.14159265358979323846 / 180.0; + +static const float SQ_WINDOW_BACKGROUND_POS = -1000.0; +static const float SQ_IMAGE_CHECKER_POS = -999.0; +static const float SQ_FIRST_FRAME_POS = -998.0; +static const float SQ_MARKS_POS = -997.0; +static const float SQ_FIRST_TILE_LAYER = -995.0; +static const float SQ_ONSCREEN_LAYER = 10000.0; + +/* ***************************************************************************************** */ + +SQ_GLWidget::SQ_GLWidget(QWidget *parent, const char *name) : QGLWidget(parent, name) +{ + kdDebug() << "+SQ_GLWidget" << endl; + + // init all variables... + m_instance = this; + +#ifdef KSQUIRREL_PART + connect(&t_glv, SIGNAL(message(const QString &)), this, SIGNAL(message(const QString &))); +#endif + + zoomMenu = 0; + selectionMenu = 0; + images = 0; + parts_broken = 0; + + ac = new KActionCollection(this, this, "GLWidget actionCollection"); + changed = blocked = decoded = reset_mode = false; + movetype = -1; + buffer = new RGBA [512 * 512]; + zoomFactor = 1.0; + old_id = -1; + menu = new QPopupMenu(this); + hackResizeGL = false; + lastCopy = KURL::fromPathOrURL("/"); + oldZoom = -1; + + percentsLabel = new QLabel(this); + percentsLabel->move(4, 4); + percentsLabel->hide(); + + tabold = tab = &taborig; + + tmp = new KTempFile; + tmp->setAutoDelete(true); + tmp->close(); + + SQ_Config::instance()->setGroup("GL view"); + zoom_type = SQ_Config::instance()->readNumEntry("zoom type", 2); + linear = SQ_Config::instance()->readBoolEntry("zoom_nice", true); + + // load background for transparent image + BGquads = QImage(locate("data", "images/checker.png")); + + if(BGquads.isNull()) + { + BGquads = QImage(32, 32, 32); + BGquads.setAlphaBuffer(true); + BGquads.fill(0); + } + + bindChecker = true; + + zoomfactor = SQ_Config::instance()->readNumEntry("zoom", 25); + movefactor = SQ_Config::instance()->readNumEntry("move", 5); + rotatefactor = SQ_Config::instance()->readNumEntry("angle", 90); + + // load cursors + setCursor(KCursor::arrowCursor()); + + setFocusPolicy(QWidget::WheelFocus); + setAcceptDrops(true); + + // popup menu with image pages + images = new KPopupMenu; + images->setCheckable(true); + + // create actions + createActions(); + + // create toolbars + createToolbar(); + + // create tickmarks + createMarks(); + + initAccelsAndMenu(); + + enableActions(false); + + KCursor::setAutoHideCursor(this, true); + KCursor::setHideCursorDelay(2500); + +#ifndef KSQUIRREL_PART + timer_prev = new QTimer(this); + timer_next = new QTimer(this); + + Q_CHECK_PTR(timer_prev); + Q_CHECK_PTR(timer_next); + + connect(timer_prev, SIGNAL(timeout()), SQ_WidgetStack::instance(), SLOT(emitPreviousSelected())); + connect(timer_next, SIGNAL(timeout()), SQ_WidgetStack::instance(), SLOT(emitNextSelected())); +#endif + + timer_anim = new QTimer(this); + + Q_CHECK_PTR(timer_anim); + + connect(timer_anim, SIGNAL(timeout()), this, SLOT(slotAnimateNext())); + + connect(images, SIGNAL(activated(int)), this, SLOT(slotSetCurrentImage(int))); + connect(images, SIGNAL(aboutToHide()), this, SLOT(slotImagesHidden())); + connect(images, SIGNAL(aboutToShow()), this, SLOT(slotImagesShown())); + + gls = new SQ_GLSelectionPainter(this); +} + +SQ_GLWidget::~SQ_GLWidget() +{ + kdDebug() << "-SQ_GLWidget" << endl; + + delete gls; + + delete parts_broken; + + removeCurrentTabs(); + + delete selectionMenu; + delete zoomMenu; + delete images; + delete [] buffer; + delete tmp; +} + +// Initialize OpenGL context. Used internally by QGLWidget. +void SQ_GLWidget::initializeGL() +{ + setClearColor(); + glClearDepth(1.0); + glEnable(GL_DEPTH_TEST); + glEnable(GL_ALPHA_TEST); + glEnable(GL_BLEND); + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + glShadeModel(GL_FLAT); + + glMatrixMode(GL_PROJECTION); + glLoadIdentity(); + glMatrixMode(GL_MODELVIEW); + + // finally, clear + glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); + + // create "broken" image + initBrokenImage(); + + initMarks(); +} + +// Resize OpenGL context. Used internally by QGLWidget. +void SQ_GLWidget::resizeGL(int width, int height) +{ + gls->setSourceSize(width, height); + + // set new viewport + glViewport(0, 0, width, height); + + glMatrixMode(GL_PROJECTION); + glLoadIdentity(); + + // O(0,0) will be in the center of the window + glOrtho(-width/2, width/2, -height/2, height/2, 0.1f, 10000.0); + + // camera setup + SQ_GLU::gluLookAt(0,0,1, 0,0,0, 0,1,0); + glMatrixMode(GL_MODELVIEW); + + if(decoded && !hackResizeGL) + slotZoomIfLess(); + + hackResizeGL = false; +} + +/* + * Fill a w x h region with texture. Generate texture if needed. + */ +void SQ_GLWidget::draw_background(void *bits, unsigned int *tex, int dim, GLfloat w, GLfloat h, bool &bind, bool deleteOld) +{ + float half_w, half_h; + + half_w = w / 2.0; + half_h = h / 2.0; + + // bind texture ? + if(bind) + { + // delete old texture before binding ? + if(deleteOld) + glDeleteTextures(1, tex); + + // generate and bind texture + glGenTextures(1, tex); + glBindTexture(GL_TEXTURE_2D, *tex); + + // setup parameters + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT); + + // assign image to texture + glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, dim, dim, 0, GL_RGBA, GL_UNSIGNED_BYTE, bits); + + bind = false; + } + else + glBindTexture(GL_TEXTURE_2D, *tex); + + // draw + glBegin(GL_QUADS); + glTexCoord2f(0.0, 0.0); glVertex2f(-half_w, half_h); + glTexCoord2f(w/(GLfloat)dim, 0.0); glVertex2f(half_w, half_h); + glTexCoord2f(w/(GLfloat)dim, h/(GLfloat)dim); glVertex2f(half_w, -half_h); + glTexCoord2f(0.0, h/(GLfloat)dim); glVertex2f(-half_w, -half_h); + glEnd(); +} + +// Redraw OpenGL context. Used internally by QGLWidget. +void SQ_GLWidget::paintGL() +{ + int z; + + // clear + glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); + + if(gls->valid()) + { + matrix_push(); + matrix_pure_reset(); + QPoint p = gls->center(); + + // move to selection center + MATRIX_X = p.x(); + MATRIX_Y = p.y(); + write_gl_matrix(); + + gls->draw(); + + matrix_pop(); + write_gl_matrix(); + } + + glEnable(GL_TEXTURE_2D); + + // draw window background ? + SQ_Config::instance()->setGroup("GL view"); + if(SQ_Config::instance()->readNumEntry("GL view background type", 1) == 2) + { + static bool del = false; + matrix_push(); + matrix_pure_reset(); + matrix_move_z(SQ_WINDOW_BACKGROUND_POS); + draw_background(BGpixmap.bits(), &texPixmap, BGpixmap.width(), width(), height(), changed, del); + del = true; + matrix_pop(); + write_gl_matrix(); + } + + // draw image + if(!reset_mode && decoded) + { + SQ_Config::instance()->setGroup("GL view"); + + fmt_image *im = &tab->finfo.image[tab->current]; + + // if the image is transparent, and we should draw background for image + if(im->hasalpha && SQ_Config::instance()->readBoolEntry("alpha_bkgr", true)) + { + GLfloat w = (float)im->w / 2.0, h = (float)im->h / 2.0; + + static const GLdouble eq[4][4] = + { + {0.0, 1.0, 0.0, 0.0}, + {1.0, 0.0, 0.0, 0.0}, + {0.0, -1.0, 0.0, 0.0}, + {-1.0, 0.0, 0.0, 0.0} + }; + + // we will draw background for transparent image (quads) within + // entire window, and cut off useless regions with clip planes + glPushMatrix(); + glTranslatef(-w, -h, 0.0); + glClipPlane(GL_CLIP_PLANE0, eq[0]); + glClipPlane(GL_CLIP_PLANE1, eq[1]); + glEnable(GL_CLIP_PLANE0); + glEnable(GL_CLIP_PLANE1); + glPopMatrix(); + glPushMatrix(); + glTranslatef(w, h, 0.0); + glClipPlane(GL_CLIP_PLANE2, eq[2]); + glClipPlane(GL_CLIP_PLANE3, eq[3]); + glEnable(GL_CLIP_PLANE2); + glEnable(GL_CLIP_PLANE3); + glPopMatrix(); + + // draw background + matrix_push(); + matrix_pure_reset(); + matrix_move_z(SQ_IMAGE_CHECKER_POS); + draw_background(BGquads.bits(), &texQuads, 32, width(), height(), bindChecker, !bindChecker); + matrix_pop(); + write_gl_matrix(); + + // don't need planes any more... + glDisable(GL_CLIP_PLANE3); + glDisable(GL_CLIP_PLANE2); + glDisable(GL_CLIP_PLANE1); + glDisable(GL_CLIP_PLANE0); + } + + matrix_move_z(SQ_FIRST_FRAME_POS); + + Parts *pt = tab->broken ? parts_broken : &tab->parts[tab->current]; + + // draw current image + int toy = pt->tilesy.size(); + int tox = pt->tilesx.size(); + for(z = 0;z < toy;z++) + if(glIsList(pt->m_parts[z * tox].list)) + glCallList(pt->m_parts[z * tox].list); + + // draw tickmarks ("broken" image won't have tickmarks) + if(!tab->broken && marks && SQ_Config::instance()->readBoolEntry("marks", true)) + { + GLfloat zum = getZoom(); + GLfloat x = fabsf(pt->m_parts[0].x1) * zum, y = pt->m_parts[0].y1 * zum; + GLfloat X = MATRIX_X, Y = MATRIX_Y; + + if(x < 0.0) + x = -x; + + const GLfloat ly = y+16, ry = -y-16; + const GLfloat lx = x+16, rx = -x-16; + + matrix_push(); + matrix_pure_reset(); + MATRIX_X = X; + MATRIX_Y = Y; + matrix_rotate2(tab->curangle); + matrix_move_z(SQ_MARKS_POS); + + GLfloat coords[4][8] = + { + {rx, ly, -x, ly, -x, y, rx, y}, + {x, ly, lx, ly, lx, y, x, y}, + {x, -y, lx, -y, lx, ry, x, ry}, + {rx, -y, -x, -y, -x, ry, rx, ry} + }; + + for(z = 0;z < 4;z++) + { + glBindTexture(GL_TEXTURE_2D, mark[z]); + + glBegin(GL_QUADS); + glTexCoord2f(0.0, 0.0); glVertex2f(coords[z][0], coords[z][1]); + glTexCoord2f(1.0, 0.0); glVertex2f(coords[z][2], coords[z][3]); + glTexCoord2f(1.0, 1.0); glVertex2f(coords[z][4], coords[z][5]); + glTexCoord2f(0.0, 1.0); glVertex2f(coords[z][6], coords[z][7]); + glEnd(); + } + + matrix_pop(); + write_gl_matrix(); + } + } + + glDisable(GL_TEXTURE_2D); + + matrixChanged(); + + if(!tab->broken && tab->total > 1) + frameChanged(); +} + +/* + * Change statusbar info according with + * current matrix (it shows current zoom & angle values). + */ +void SQ_GLWidget::matrixChanged() +{ + QString str; + + float m = getZoom(); + float fzoom = m * 100.0; + float z = (m < 1.0) ? 1.0/m : m; + + // construct zoom + str = QString::fromLatin1("%1% [%2:%3]") + .arg(fzoom, 0, 'f', 1) + .arg((m < 1.0)?1.0:z, 0, 'f', 1) + .arg((m > 1.0)?1.0:z, 0, 'f', 1); + +#ifndef KSQUIRREL_PART + SQ_GLView::window()->sbarWidget("SBGLZoom")->setText(str); +#else + t_glv.sbarWidget("SBGLZoom")->setText(str); +#endif + + // construct rotation angle + str = QString::fromLatin1("%1%2 %3 deg") + .arg((tab->isflippedV)?"V":"") + .arg((tab->isflippedH)?"H":"") + .arg(tab->curangle, 0, 'f', 1); + +#ifndef KSQUIRREL_PART + SQ_GLView::window()->sbarWidget("SBGLAngle")->setText(str); +#else + t_glv.sbarWidget("SBGLAngle")->setText(str); +#endif +} + +/* + * Mouse wheel event. Let's load next/previous image, or + * zoom in/zoom out (depends on settings). + */ +void SQ_GLWidget::wheelEvent(QWheelEvent *e) +{ + if(e->delta() < 0 && e->state() == Qt::NoButton) + { +#ifndef KSQUIRREL_PART + SQ_Config::instance()->setGroup("GL view"); + + // load next file in current directory + if(SQ_Config::instance()->readNumEntry("scroll", 0)) + slotNext(); + else +#endif + + slotZoomPlus(); + } + else if(e->delta() > 0 && e->state() == Qt::NoButton) + { +#ifndef KSQUIRREL_PART + SQ_Config::instance()->setGroup("GL view"); + + if(SQ_Config::instance()->readNumEntry("scroll", 0)) + slotPrev(); + else +#endif + + slotZoomMinus(); + } + // some special bindings: + // if CTRL key is pressed, zoom 2x or 0.5x + else if(e->delta() < 0 && e->state() == Qt::ControlButton) + matrix_zoom(2.0); + else if(e->delta() > 0 && e->state() == Qt::ControlButton) + matrix_zoom(0.5f); + else if(e->delta() < 0 && e->state() == Qt::ShiftButton) + slotZoomPlus(); + else if(e->delta() > 0 && e->state() == Qt::ShiftButton) + slotZoomMinus(); +} + +// User pressed mouse button down. +void SQ_GLWidget::mousePressEvent(QMouseEvent *e) +{ + setFocus(); + + // left button, update cursor + if(e->button() == Qt::LeftButton && e->state() == Qt::NoButton && tab->glselection == -1) + { +#ifndef KSQUIRREL_PART + QTime t = QTime::currentTime(); + + SQ_Config::instance()->setGroup("GL view"); + int dc = SQ_Config::instance()->readNumEntry("double_click", 0); + + if(dc && clickTime.isValid() && clickTime.msecsTo(t) <= KApplication::doubleClickInterval()) + { + if(dc == 1) + KSquirrel::app()->closeGLWidget(); + else + toggleFullScreen(); + + return; + } + else + clickTime = t; + +#endif + setCursor(KCursor::sizeAllCursor()); + + xmoveold = e->x(); + ymoveold = e->y(); + + movetype = 1; + } + // left button + SHIFT, let's start drawing zoom frame + else if(e->button() == Qt::LeftButton && (e->state() == Qt::ShiftButton || tab->glselection != -1)) + { + // stop animation! + stopAnimation(); + + // update cursor to crosshair + setCursor(KCursor::crossCursor()); + + if(tab->glselection == SQ_GLSelectionPainter::Rectangle || tab->glselection == SQ_GLSelectionPainter::Ellipse) + gls->begin(static_cast(tab->glselection), e->x(), e->y()); + else + gls->begin(SQ_GLSelectionPainter::Rectangle, e->x(), e->y()); + + movetype = 2; + } + // right button - show context menu + else if(e->button() == Qt::RightButton) + menu->popup(QCursor::pos()); + // middle button - toggle fullscreen state + else if(e->button() == Qt::MidButton) + toggleFullScreen(); +} + +// User moved mouse. +void SQ_GLWidget::mouseMoveEvent(QMouseEvent *e) +{ + // user didn't press any mouse button before ? + if(movetype == -1 && fullscreen()) + { +#if 0 +// bool tvis = SQ_GLView::window()->toolbar()->isShown(); +// bool svis = SQ_GLView::window()->statusbar()->isShown(); + + int h = SQ_GLView::window()->toolbar()->height() + + SQ_GLView::window()->tabbar()->height(); + +#warning FIXME +#ifndef KSQUIRREL_PART + hackResizeGL = true; + SQ_GLView::window()->boxBar()->setShown((/*tvis ? false:*/(e->y() < h))); + SQ_GLView::window()->statusbar()->setShown((/*svis ? false:*/(e->y() > + height()-SQ_GLView::window()->statusbar()->height()))); +#endif +#endif + return; + } + + // left mouse button, lets move image (or matrix :-) ) + if(movetype == 1) + { + xmove = e->x(); + ymove = e->y(); + + matrix_move(xmove-xmoveold, -ymove+ymoveold); + + xmoveold = e->x(); + ymoveold = e->y(); + } + // left + SHIFT + else if(movetype == 2) + gls->move(e->x(), e->y()); +} + +// User released some mouse button. +void SQ_GLWidget::mouseReleaseEvent(QMouseEvent *) +{ + if(movetype == -1) + return; + + // left button - restore cursor + if(movetype == 1 || (movetype == 2 && tab->glselection != -1)) // permanent selection + setCursor(KCursor::arrowCursor()); + // left button + SHIFT - zoom to selected rectangle (if needed) + else if(movetype == 2 && tab->glselection == -1) + { + setCursor(KCursor::arrowCursor()); + + QSize sz = gls->size(); + QPoint pt = gls->pos(); + QRect lastRect(pt.x(), pt.y(), sz.width(), sz.height()); + + gls->end(); + + QPoint lastC = lastRect.center(); + QPoint O(width() / 2, height() / 2); + + if(lastRect.width() > 2 && lastRect.height() > 2) + { + bool lastReset = reset_mode; + reset_mode = true; + float X = MATRIX_X, Y = MATRIX_Y; + matrix_move(O.x() - lastC.x(), lastC.y() - O.y()); + reset_mode = lastReset; + + // try to zoom + bool zoomed = tab->broken ? false : zoomRect(lastRect); + + // not zoomed ? (zoom > maximum zoom) + if(!zoomed) + { + MATRIX_X = X; + MATRIX_Y = Y; + write_gl_matrix(); + } + } + + updateGL(); + + // start animation, if needed + if(!manualBlocked()) + startAnimation(); + } + + movetype = -1; +} + +/* + * Zoom to 'r'. Will be called after somebody used right mouse button + * to select zoom region. + */ +bool SQ_GLWidget::zoomRect(const QRect &r) +{ + // calculate zoom factor + float factor = 1.0; + float w = (float)width(), h = (float)height(); + float factorw = w / (float)r.width(); + float factorh = h / (float)r.height(); + float t = w / h; + + if(t > (float)r.width() / (float)r.height()) + factor = factorh; + else + factor = factorw; + + // try to zoom + return matrix_zoom(factor); +} + +// Fit width. +void SQ_GLWidget::slotZoomW() +{ + zoom_type = 0; + pAZoomW->setChecked(true); + + // no image decoded + if(tab->broken || tab->finfo.image.empty()) return; + + // calculate zoom factor + float factor = (float)width() / (tab->rotate ? (float)tab->finfo.image[tab->current].h : (float)tab->finfo.image[tab->current].w); + + // "Ignore, if the image is less than window" - restore zoom factor to 1.0 + if(pAIfLess->isChecked() && (tab->finfo.image[tab->current].w < width() && tab->finfo.image[tab->current].h < height())) + factor = 1.0; + + // zoom... + internalZoom(factor); +} + +// Fit height. +void SQ_GLWidget::slotZoomH() +{ + zoom_type = 1; + pAZoomH->setChecked(true); + + if(tab->broken || tab->finfo.image.empty()) return; + + float factor = (float)height() / (tab->rotate ? (float)tab->finfo.image[tab->current].w : (float)tab->finfo.image[tab->current].h); + + if(pAIfLess->isChecked() && (tab->finfo.image[tab->current].w < width() && tab->finfo.image[tab->current].h < height())) + factor = 1.0; + + internalZoom(factor); +} + +// Fit image (e.g. width and height). +void SQ_GLWidget::slotZoomWH() +{ + zoom_type = 2; + pAZoomWH->setChecked(true); + + if(tab->broken || tab->finfo.image.empty()) return; + + float factor = 1.0; + float w = (float)width(), h = (float)height(); + float factorw = w / (tab->rotate ? (float)tab->finfo.image[tab->current].h : (float)tab->finfo.image[tab->current].w); + float factorh = h / (tab->rotate ? (float)tab->finfo.image[tab->current].w : (float)tab->finfo.image[tab->current].h); + float t = w / h; + float F = tab->rotate ? ((float)tab->finfo.image[tab->current].h / (float)tab->finfo.image[tab->current].w) : ((float)tab->finfo.image[tab->current].w / (float)tab->finfo.image[tab->current].h); + + if(t > F) + factor = factorh; + else + factor = factorw; + + if(pAIfLess->isChecked() && (tab->finfo.image[tab->current].w < width() && tab->finfo.image[tab->current].h < height())) + factor = 1.0; + + internalZoom(factor); +} + +// Previous zoom. +void SQ_GLWidget::slotZoomLast() +{ + zoom_type = 4; + pAZoomLast->setChecked(true); + + if(tab->broken || tab->finfo.image.empty()) return; + + internalZoom(zoomFactor); +} + +// Zoom 100%. +void SQ_GLWidget::slotZoom100() +{ + zoom_type = 3; + pAZoom100->setChecked(true); + + if(tab->broken || tab->finfo.image.empty()) return; + + internalZoom(1.0); +} + +// "Ignore, if the image is less than window" +void SQ_GLWidget::slotZoomIfLess() +{ + if(tab->broken || tab->finfo.image.empty()) return; + + switch(zoom_type) + { + case 0: slotZoomW(); break; + case 1: slotZoomH(); break; + case 2: slotZoomWH(); break; + case 3: break; + + default: + slotZoomLast(); + } +} + +// Zoom+ +void SQ_GLWidget::slotZoomPlus() +{ + matrix_zoom(1.0+zoomfactor/100.0); +} + +// Zoom- +void SQ_GLWidget::slotZoomMinus() +{ + matrix_zoom(1.0/(1.0+zoomfactor/100.0)); +} + +// Rotate left. +void SQ_GLWidget::slotRotateLeft() +{ + matrix_rotate(-rotatefactor); +} + +// Rotate right. +void SQ_GLWidget::slotRotateRight() +{ + matrix_rotate(rotatefactor); +} + +/* + operations with matrices are taken from GLiv =) + + thanks to Guillaume Chazarian. +*/ +void SQ_GLWidget::flip(int id, bool U) +{ + GLfloat x = MATRIX_X, y = MATRIX_Y; + MATRIX_X = 0; + MATRIX_Y = 0; + + tab->matrix[id] *= -1.0; + tab->matrix[id + 1] *= -1.0; + tab->matrix[id + 3] *= -1.0; + + MATRIX_X = x; + MATRIX_Y = y; + + write_gl_matrix(); + + if(!reset_mode && U) + updateGL(); +} + +void SQ_GLWidget::slotFlipH() +{ + if(!tab->broken) + { + tab->isflippedH = !tab->isflippedH; + flip(0); + } +} + +void SQ_GLWidget::slotFlipV() +{ + if(!tab->broken) + { + tab->isflippedV = !tab->isflippedV; + flip(4); + } +} + +void SQ_GLWidget::slotMatrixReset() +{ + if(!tab->broken) + { + oldZoom = getZoom(); + matrix_reset(false); + matrix_zoom(1.0); + } +} + +void SQ_GLWidget::write_gl_matrix() +{ + GLfloat transposed[16] = + { + 1.0, 0.0, 0.0, 0.0, + 0.0, 1.0, 0.0, 0.0, + 0.0, 0.0, 1.0, 0.0, + 0.0, 0.0, 0.0, 1.0 + }; + + transposed[0] = MATRIX_C1; + transposed[5] = MATRIX_C2; + transposed[4] = MATRIX_S1; + transposed[1] = MATRIX_S2; + transposed[12] = MATRIX_X; + transposed[13] = MATRIX_Y; + transposed[14] = MATRIX_Z; + + glLoadMatrixf(transposed); +} + +void SQ_GLWidget::matrix_move(GLfloat x, GLfloat y) +{ + if(tab->broken) return; + + MATRIX_X += x; + MATRIX_Y += y; + + write_gl_matrix(); + + if(!reset_mode) + updateGL(); +} + +void SQ_GLWidget::matrix_move_z(GLfloat z) +{ + MATRIX_Z = z; + + write_gl_matrix(); +} + +void SQ_GLWidget::matrix_push() +{ + memcpy(saved, tab->matrix, sizeof(tab->matrix)); +} + +void SQ_GLWidget::matrix_pop() +{ + memcpy(tab->matrix, saved, sizeof(tab->matrix)); +} + +void SQ_GLWidget::matrix_reset(bool U) +{ + tab->nullMatrix(); + + tab->curangle = 0.0; + tab->isflippedH = tab->isflippedV = false; + + if(decoded) + exifRotate(U); +} + +void SQ_GLWidget::matrix_pure_reset() +{ + tab->nullMatrix(); + write_gl_matrix(); +} + +bool SQ_GLWidget::matrix_zoom(GLfloat ratio) +{ + if(tab->broken) return false; + + SQ_Config::instance()->setGroup("GL view"); + + int zoom_lim = SQ_Config::instance()->readNumEntry("zoom limit", 1); + GLfloat zoom_min, zoom_max, zoom_tobe; + + zoom_tobe = hypot(MATRIX_C1 * ratio, MATRIX_S1 * ratio) * 100.0; + + switch(zoom_lim) + { + case 2: + zoom_min = (float)SQ_Config::instance()->readNumEntry("zoom_min", 1); + zoom_max = (float)SQ_Config::instance()->readNumEntry("zoom_max", 10000); + break; + + default: // "case 1:" too + zoom_min = 1.0; + zoom_max = 10000.0; + } + + if(zoom_lim) + { + float z = getZoomPercents(); + + // zoom limit exceeded - do nothing + if((z >= zoom_max && ratio > 1.0) || (z <= zoom_min && ratio < 1.0)) + return false; + + // if the new zoom will be greater (smaller) than maximum + // (minimum) zoom - scale it. + if(ratio < 1.0 && zoom_min >= zoom_tobe) + ratio = ratio * zoom_min / zoom_tobe; + else if(ratio > 1.0 && zoom_max <= zoom_tobe) + ratio = ratio * zoom_max / zoom_tobe; + } + + GLfloat oldz = (oldZoom == -1 ? getZoom() : oldZoom); + + MATRIX_C1 *= ratio; + MATRIX_S1 *= ratio; + MATRIX_X *= ratio; + MATRIX_S2 *= ratio; + MATRIX_C2 *= ratio; + MATRIX_Y *= ratio; + + hackMatrix(); + + GLfloat z = getZoom(); + int filter = -1; + + if(ISFLOAT1(oldz) && !ISFLOAT1(z)) + filter = linear ? GL_LINEAR : GL_NEAREST; + else if(ISFLOAT1(z)) + filter = GL_NEAREST; + + // update all textures + if(filter != -1) + { + for(int i = 0;i < tab->total;i++) + { + int toxy = tab->parts[i].m_parts.size(); + + for(int j = 0;j < toxy;j++) + { + glBindTexture(GL_TEXTURE_2D, tab->parts[i].m_parts[j].tex); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, filter); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, filter); + } + } + } + + oldZoom = -1; + write_gl_matrix(); + + changeSlider(z); + + if(!reset_mode) + updateGL(); + + return true; +} + +/* + * Floating point operations are not 100% exact. + * We should correct matrix values. + */ +void SQ_GLWidget::hackMatrix() +{ + if(ISFLOAT1(MATRIX_C1)) MATRIX_C1 = MATRIX_C1 < 0 ? -1.0 : 1.0; + else if(ISFLOAT0(MATRIX_C1)) MATRIX_C1 = 0.0; + + if(ISFLOAT1(MATRIX_C2)) MATRIX_C2 = MATRIX_C2 < 0 ? -1.0 : 1.0; + else if(ISFLOAT0(MATRIX_C2)) MATRIX_C2 = 0.0; + + if(ISFLOAT1(MATRIX_S1)) MATRIX_S1 = MATRIX_S1 < 0 ? -1.0 : 1.0; + else if(ISFLOAT0(MATRIX_S1)) MATRIX_S1 = 0.0; + + if(ISFLOAT1(MATRIX_S2)) MATRIX_S2 = MATRIX_S2 < 0 ? -1.0 : 1.0; + else if(ISFLOAT0(MATRIX_S2)) MATRIX_S2 = 0.0; + + if(ISFLOAT0(MATRIX_X)) MATRIX_X = 0.0; + if(ISFLOAT0(MATRIX_Y)) MATRIX_Y = 0.0; +} + +GLfloat SQ_GLWidget::getZoom() const +{ + return hypot(MATRIX_C1, MATRIX_S1); +} + +GLfloat SQ_GLWidget::getZoomPercents() const +{ + return getZoom() * 100.0; +} + +void SQ_GLWidget::matrix_rotate(GLfloat angle, bool U) +{ + if(tab->broken) return; + + GLfloat c1 = MATRIX_C1, c2 = MATRIX_C2, s1 = MATRIX_S1, s2 = MATRIX_S2; + + double rad = angle * rad_const; + double cosine = cos(rad); + double sine = sin(rad); + + MATRIX_C1 = c1 * cosine + s2 * sine; + MATRIX_S1 = s1 * cosine + c2 * sine; + MATRIX_S2 = -c1 * sine + s2 * cosine; + MATRIX_C2 = -s1 * sine + c2 * cosine; + + hackMatrix(); + + tab->curangle += angle; + + if(tab->curangle == 360.0 || tab->curangle == -360.0) + tab->curangle = 0.0; + else if(tab->curangle > 360.0) + tab->curangle -= 360.0; + else if(tab->curangle < -360.0) + tab->curangle += 360.0; + + write_gl_matrix(); + + if(U) + updateGL(); +} + +void SQ_GLWidget::matrix_rotate2(GLfloat angle) +{ + GLfloat c1 = MATRIX_C1, c2 = MATRIX_C2, s1 = MATRIX_S1, s2 = MATRIX_S2; + + double rad = angle * rad_const; + double cosine = cos(rad); + double sine = sin(rad); + + MATRIX_C1 = c1 * cosine + s2 * sine; + MATRIX_S1 = s1 * cosine + c2 * sine; + MATRIX_S2 = -c1 * sine + s2 * cosine; + MATRIX_C2 = -s1 * sine + c2 * cosine; + + write_gl_matrix(); +} + +/* + * Bind textures, draw them and create GL lists. + * Also show textures by executing GL lists, if 'swap' = true. + */ +bool SQ_GLWidget::showFrames(int i, Parts *p, bool swap) +{ + int z, k = 0; + const int a = p->tilesx.size() * i, b = a + p->tilesx.size(); + int filter = linear ? GL_LINEAR : GL_NEAREST; + + // for safety... + makeCurrent(); + + glEnable(GL_TEXTURE_2D); + + float zm = getZoom(); + + for(z = a;z < b;z++) + { + glBindTexture(GL_TEXTURE_2D, p->m_parts[z].tex); + + // setup texture parameters + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, ISFLOAT1(zm) ? GL_NEAREST : filter); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, ISFLOAT1(zm) ? GL_NEAREST : filter); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); + + setupBits(p, buffer, i, k); + + glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, p->tilesx[k], p->tilesy[i], 0, GL_RGBA, GL_UNSIGNED_BYTE, buffer); + + k++; + } + + // create new display list + glNewList(p->m_parts[a].list, swap ? GL_COMPILE_AND_EXECUTE : GL_COMPILE); + + // bind & draw textures (if needed) + for(z = a;z < b;z++) + { + glBindTexture(GL_TEXTURE_2D, p->m_parts[z].tex); + + glBegin(GL_QUADS); + glTexCoord2f(p->m_parts[z].tx1, p->m_parts[z].ty1); glVertex2f(p->m_parts[z].x1, p->m_parts[z].y1); + glTexCoord2f(p->m_parts[z].tx2, p->m_parts[z].ty1); glVertex2f(p->m_parts[z].x2, p->m_parts[z].y1); + glTexCoord2f(p->m_parts[z].tx2, p->m_parts[z].ty2); glVertex2f(p->m_parts[z].x2, p->m_parts[z].y2); + glTexCoord2f(p->m_parts[z].tx1, p->m_parts[z].ty2); glVertex2f(p->m_parts[z].x1, p->m_parts[z].y2); + glEnd(); + } + + glEndList(); + + glDisable(GL_TEXTURE_2D); + + // swap buffers... + if(swap) + swapBuffers(); + + return GL_TRUE; +} + +void SQ_GLWidget::setupBits(Parts *p, RGBA *_buffer, int y, int x) +{ + QPair pair = SQ_GLWidget::calcRealDimensions(*p, y, x); + + int offs = p->realw * pair.second + pair.first; + RGBA *orig = p->buffer->data() + offs; + + int toy = p->tilesy[y]; + int tox = p->tilesx[x]; + + for(int j = 0;j < toy;j++) + memcpy(_buffer + tox*j, orig + p->realw*j, tox*sizeof(RGBA)); +} + +/* + * Start decoding given image. We can call it from anywhere. + */ +void SQ_GLWidget::startDecoding(const QString &file) +{ +#ifndef KSQUIRREL_PART + if(SQ_PreviewWidget::instance()->cancel()) + SQ_WidgetStack::instance()->diroperator()->stopPreview(); +#endif + + if(reset_mode) + return; + + started.start(); + + tabold = tab; + tmptab.empty(); + tab = &tmptab; + reset_mode = true; + + timer_anim->stop(); + images->clear(); + + tab->m_File = file; // original name + tab->File = QFile::encodeName(tab->m_File); // translated name + tab->m_original = m_original; + + QFileInfo fm(file); + tab->fmt_ext = fm.extension(false); + tab->fmt_size = fm.size(); + +#ifndef KSQUIRREL_PART + // show window with image + KSquirrel::app()->raiseGLWidget(); +#endif + + if(m_expected.isEmpty()) + KApplication::eventLoop()->processEvents(QEventLoop::ExcludeUserInput | QEventLoop::ExcludeSocketNotifiers); + + decode(); +} + +/* + * Prepare decoding. It will find proper library for decoding, + * clear old memory buffers, etc. + */ +bool SQ_GLWidget::prepare() +{ + QString status; + + tab = &tmptab; + + // get library from cache + SQ_LIBRARY *m_lib = SQ_LibraryHandler::instance()->libraryForFile(tab->m_File); + + if(!m_lib) + { + KMessageBox::error(this, i18n("Codec for %1 format not found").arg(tab->fmt_ext)); + reset_mode = false; + tab = tabold; + return false; + } + else + tmptab.lib = m_lib; + + enableActions(true); + + int already = -1, result = -1, i = 0; + SQ_Config::instance()->setGroup("GL view"); + +#ifndef KSQUIRREL_PART + bool use_tabs = SQ_GLView::window()->tabs(); +#endif + + bool useCurrent = false; + +#ifndef KSQUIRREL_PART + if(!use_tabs) + { + removeCurrentTabs(); + + SQ_GLView::window()->removeTabs(); + } + else + { + if(m_expected != m_original) + { + std::vector::iterator it = tabs.begin(); + std::vector::iterator itEnd = tabs.end(); + for(;it != itEnd;++it, ++i) + { + if((*it).m_original == m_original) + { + already = i; + useCurrent = true; + break; + } + } + } + + // 0 - new page + // 1 - replace current tab + // 2 - close all and open in a new tab + // -1 - ignore 'result' at all + if(already == -1 + && decoded + && m_expected != m_original + && !useCurrent + && SQ_Config::instance()->readBoolEntry("tabs_ask", false)) + { + SQ_TabOpenDialog tbo(this); + tbo.exec(); + result = tbo.result(); + } + } +#else + removeCurrentTabs(); +#endif + +#ifndef KSQUIRREL_PART + int curtab = SQ_GLView::window()->tabbar()->indexOf(SQ_GLView::window()->tabbar()->currentTab()); +#else + int curtab = -1; +#endif + + int curindex = (already == -1) ? curtab : already; + + if(curindex != -1 && (m_expected == m_original || result == 1 || useCurrent)) + { + if(curtab != curindex) + tabs[curtab].removeParts(); + + tabs[curindex].clearParts(); + tabs[curindex] = tmptab; + tab = &tabs[curindex]; + +#ifndef KSQUIRREL_PART + SQ_GLView::window()->tabbar()->blockSignals(true); + SQ_GLView::window()->tabbar()->setCurrentTab(SQ_GLView::window()->tabbar()->tabAt(curindex)); + SQ_GLView::window()->tabbar()->tabAt(curindex)->setText(KStringHandler::csqueeze(tab->m_original.fileName(), SQ_TAB_TEXT_LENGTH)); + SQ_GLView::window()->tabbar()->blockSignals(false); +#endif + } + else + { + if(curindex != -1) + { + if(result == 2) + closeAllTabs(); + else + tabs[curindex].removeParts(); + } + + tabs.push_back(tmptab); + int lastId = tabs.size() - 1; + tab = &tabs[lastId]; + +#ifndef KSQUIRREL_PART + SQ_GLView::window()->tabbar()->blockSignals(true); + SQ_GLView::window()->addPage(KStringHandler::csqueeze(tab->m_original.fileName(), SQ_TAB_TEXT_LENGTH)); + SQ_GLView::window()->tabbar()->setCurrentTab(SQ_GLView::window()->tabbar()->tabAt(lastId)); + + // QTabBar::show will emit selected(int), + // we don't want it + emit tabCountChanged(); + SQ_GLView::window()->tabbar()->blockSignals(false); +#endif + } + + gls->setVisible(false); + + SQ_CodecSettings::applySettings(tab->lib, SQ_CodecSettings::ImageViewer); + + // determine codec + tab->codeK = tab->lib->codec; + + // start decoding! + i = tab->codeK->read_init(tab->File); + + // oops, error... + if(i != SQE_OK) + { + decodeFailedOn0(i); + m_expected = KURL(); + return false; + } + + return true; +} + +void SQ_GLWidget::decode() +{ + // prepare decoding... + if(!prepare()) + return; + +#ifndef KSQUIRREL_PART + KSquirrel::app()->setCaption(originalURL()); +#endif + + zoomFactor = getZoom(); + matrix_pure_reset(); + matrixChanged(); + +#ifdef SQ_HAVE_KEXIF + KExifData d; + d.readFromFile(tab->m_File); + tab->orient = d.getImageOrientation(); + tab->wm = SQ_Utils::exifGetMatrix(QString::null, tab->orient); + + tab->rotate = (tab->orient == KExifData::ROT_90_HFLIP || tab->orient == KExifData::ROT_90 + || tab->orient == KExifData::ROT_90_VFLIP || tab->orient == KExifData::ROT_270); +#else + tab->orient = -1; + tab->rotate = false; +#endif + + errors = 0; + +/* *********************************************************** */ + + int i, j, id; + int line, res, first_id = 0; + fmt_image *im; + memoryPart *pt; + bool progr; + + SQ_Config::instance()->setGroup("GL view"); + + // in fullscreen mode progressive loading is disabled anyway + if(fullscreen()) + progr = false; + else + progr = SQ_Config::instance()->readBoolEntry("progressiv", true); + + int allpages = SQ_Config::instance()->readNumEntry("load_pages", 0); + int pages_num = SQ_Config::instance()->readNumEntry("load_pages_number", 1); + + if(pages_num < 1) pages_num = 1; + +#ifndef KSQUIRREL_PART + SQ_GLView::window()->sbarWidget("SBFile")->setText(tab->m_original.fileName()); +#else + t_glv.sbarWidget("SBFile")->setText(tab->m_original.fileName()); +#endif + + tab->current = 0; + + bool notexpected = m_expected.isEmpty(); + m_expected = KURL(); + + // start time counting + while(true) + { + if((allpages == 1 && tab->current) || (allpages == 2 && tab->current == pages_num)) + break; + + // absolute evil, but should do... + if(notexpected) + KApplication::eventLoop()->processEvents(QEventLoop::ExcludeUserInput | QEventLoop::ExcludeSocketNotifiers); + + i = tab->codeK->read_next(); + + // something went wrong. SQE_NOTOK is a special type of error. It means + // that we decoded all pages. + if(i != SQE_OK) + { + if(i == SQE_NOTOK || tab->current) + break; + else + { + decodeFailedOn0(i); + return; + } + } + + im = tab->codeK->image(tab->current); + + Parts pp; + + // find tile size + SQ_GLWidget::findCloserTiles(im->w, im->h, pp.tilesx, pp.tilesy); + QPair pair = SQ_GLWidget::calcRealDimensions(pp); + pp.realw = pair.first; + pp.realh = pair.second; + + // setup current Part + pp.w = im->w; + pp.h = im->h; + + // create textures and display lists + if(!pp.makeParts()) + { + if(tab->current) + break; + else + { + KMessageBox::error(this, + i18n("Memory allocation failed for %1 of memory") + .arg(KIO::convertSize(pp.realw * pp.realh * sizeof(RGBA)))); + + decodeFailedOn0(SQE_R_NOMEMORY); + return; + } + } + + pt = new memoryPart(pp.realw * pp.realh); + pt->create(); + + if(!pt->valid()) + { + pp.removeParts(); + + if(tab->current) + break; + else + { + KMessageBox::error(this, i18n("Memory allocation failed")); + decodeFailedOn0(SQE_R_NOMEMORY); + return; + } + } + + line = 0; + + pp.computeCoords(); + pp.buffer = pt; + + tab->finfo = tab->codeK->information(); + + if(!tab->current) + { + tab->isflippedH = tab->isflippedV = false; + slotZoomIfLess(); + matrixChanged(); + updateCurrentFileInfo(); + } + + matrix_move_z(SQ_FIRST_TILE_LAYER+tab->current); + + for(int pass = 0;pass < im->passes;pass++) + { + if(tab->codeK->read_next_pass() != SQE_OK) + break; + + bool flip = tab->finfo.image[tab->current].needflip; + line = 0; + int tlsy = pp.tilesy.size(); + int tlsyval, offs = 0, O, iA; + + for(i = 0;i < tlsy;i++) + { + iA = flip ? (tlsy-i-1) : i; + tlsyval = pp.tilesy[iA]; + + for(j = 0;j < tlsyval;j++) + { + O = flip ? (pp.realw*(im->h - offs - j-1)) : (offs + j)*pp.realw; + res = tab->codeK->read_scanline(pp.buffer->data() + O); + errors += (int)(res != SQE_OK); + + if(++line == im->h) + break; + } + + offs += tlsyval; + + // last pass + if(pass == im->passes-1) + { +// if(!tab->current) + { + bool b = showFrames(iA, &pp, progr); + + if(!b) + kdWarning() << "Showframes failed for image " << tab->current << ", tiley " << i << endl; + } + } + + } + } + + id = images->insertItem(QString::fromLatin1("#%1 [%2x%3@%4]").arg(tab->current+1).arg(im->w).arg(im->h).arg(im->bpp)); + + images->setItemParameter(id, tab->current); + + if(!tab->current) + { +#ifndef KSQUIRREL_PART + SQ_GLView::window()->sbarWidget("SBDecodedI")->setPixmap(tab->lib->mime); +#endif + old_id = first_id = id; + } + + tab->parts.push_back(pp); + + calcFrameLabelWidth(); + frameChanged(); + tab->current++; + } + + tab->finfo = tab->codeK->information(); + tab->codeK->read_close(); + tab->total = tab->finfo.image.size(); + tab->current = 0; + frameChanged(); + + enableSettingsButton(!tab->lib->config.isEmpty()); + + decoded = true; + reset_mode = false; + updateGL(); + + tab->quickImageInfo = tab->lib->quickinfo; + tab->elapsed = started.elapsed(); + +#ifndef KSQUIRREL_PART + SQ_GLView::window()->sbarWidget("SBLoaded")->setText(KGlobal::locale()->formatLong(tab->elapsed) + i18n(" ms.")); +#else + t_glv.sbarWidget("SBLoaded")->setText(KGlobal::locale()->formatLong(tab->elapsed) + i18n(" ms.")); +#endif + + images->setItemChecked(first_id, true); + + if(tab->finfo.animated) + QTimer::singleShot(tab->finfo.image[tab->current].delay, this, SLOT(slotAnimateNext())); +} + +/* + * Palette changed. Let's update tickmarks and background color. + */ +void SQ_GLWidget::paletteChange(const QPalette &oldPalette) +{ + QGLWidget::paletteChange(oldPalette); + + SQ_Config::instance()->setGroup("GL view"); + + if(SQ_Config::instance()->readNumEntry("GL view background type", 1) == 0) + { + QColor color = colorGroup().color(QColorGroup::Base); + qglClearColor(color); + updateGL(); + } +} + +void SQ_GLWidget::slotFirst() +{ +#ifndef KSQUIRREL_PART + if(!reset_mode) + SQ_WidgetStack::instance()->firstFile(); +#endif +} + +void SQ_GLWidget::slotLast() +{ +#ifndef KSQUIRREL_PART + if(!reset_mode) + SQ_WidgetStack::instance()->lastFile(); +#endif +} + +void SQ_GLWidget::slotNext() +{ +#ifndef KSQUIRREL_PART + timer_next->stop(); + timer_prev->stop(); + + timer_next->start(timer_delay_file, true); +#endif +} + +void SQ_GLWidget::slotPrev() +{ +#ifndef KSQUIRREL_PART + timer_prev->stop(); + timer_next->stop(); + + timer_prev->start(timer_delay_file, true); +#endif +} + +void SQ_GLWidget::slotZoomMenu() +{ + zoomMenu->exec(QCursor::pos()); +} + +void SQ_GLWidget::slotAnimateNext() +{ + // Some time ago we started to decode new image, but it is + // not guaranteed that animation stopped! + // + // We should return now to avoid segfaults... + if(reset_mode) + return; + +// tab->parts[tab->current].removeParts(); + + tab->current++; + + if(tab->current >= (int)tab->finfo.image.size()) + tab->current = 0; + + updateCurrentFileInfo(); + updateGL(); + + int delay = tab->finfo.image[tab->current].delay; + + timer_anim->start(delay, true); +} + +void SQ_GLWidget::startAnimation() +{ + if(!tab->finfo.animated) return; + + timer_anim->start(tab->finfo.image[tab->current].delay, true); +} + +void SQ_GLWidget::stopAnimation() +{ + timer_anim->stop(); +} + +void SQ_GLWidget::slotToggleAnimate() +{ + if(!tab->finfo.animated || gls->valid()) return; + + if(!timer_anim->isActive()) + { + tab->manualBlocked = false; + startAnimation(); + } + else + { + tab->manualBlocked = true; + stopAnimation(); + } +} + +/* + * Next image in animated sequence. Called by user (with F3). + */ +void SQ_GLWidget::nextImage() +{ + // if the image has only one page - do nothing + if(tab->total == 1) + return; + + tab->current++; + + if(tab->current >= tab->total) + tab->current = 0; + + updateGL(); + updateCurrentFileInfo(); +} + +/* + * Previous image in animated sequence. Called by user (with F2). + */ +void SQ_GLWidget::prevImage() +{ + if(tab->total == 1) + return; + + tab->current--; + + if(tab->current < 0) + tab->current = tab->total - 1; + + updateGL(); + updateCurrentFileInfo(); +} + +/* + * Jump to first/last image page. + */ +void SQ_GLWidget::jumpToImage(bool last) +{ + // if the image has only one page - do nothing + if(tab->total == 1) + return; + + tab->current = (last) ? tab->finfo.image.size() - 1 : 0; + + updateGL(); + updateCurrentFileInfo(); +} + +void SQ_GLWidget::initMarks() +{ + for(int i = 0;i < 4;i++) + { + glGenTextures(1, &mark[i]); + + glBindTexture(GL_TEXTURE_2D, mark[i]); + + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP); + + glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 16, 16, 0, GL_RGBA, GL_UNSIGNED_BYTE, mm[i].bits()); + } +} + +void SQ_GLWidget::internalZoom(const GLfloat &zF) +{ + tab->curangle = 0.0; + + oldZoom = getZoom(); + matrix_pure_reset(); + + exifRotate(false); + + matrix_zoom(zF); +} + +void SQ_GLWidget::updateFilter(bool nice) +{ + if(nice == linear) + return; + + // store + linear = nice; + + int filter = nice ? GL_LINEAR : GL_NEAREST; + Parts *pt; + + // update all textures + for(int i = 0;i < tab->total;i++) + { + pt = tab->broken ? parts_broken : &tab->parts[i]; + int toxy = pt->m_parts.size(); + + for(int j = 0;j < toxy;j++) + { + glBindTexture(GL_TEXTURE_2D, pt->m_parts[j].tex); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, filter); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, filter); + } + } + + updateGL(); +} + +/* + * Cleanup method. + */ +void SQ_GLWidget::decodeFailedOn0(const int err_code) +{ + tab->codeK->read_close(); + tab->finfo.image.clear(); + tab->finfo.meta.clear(); + tab->total = 0; + decoded = (bool)tabs.size(); + reset_mode = false; + tab->broken = true; + tab->lib = 0; + + useBrokenImage(err_code); +} + +/* + * Force using broken image + update context. + * Show appropriate error message in statusbar. + */ +void SQ_GLWidget::useBrokenImage(const int err_index) +{ + enableSettingsButton(false); + enableActions(false); + + // save "broken" image information in 'tab->finfo' + tab->finfo.image.push_back(image_broken); + + // reset statusbar widgets + SQ_GLView::window()->resetStatusBar(); + +#ifndef KSQUIRREL_PART + // show error message instead of file name + SQ_GLView::window()->sbarWidget("SBFile")->setText(SQ_ErrorString::instance()->string(err_index)); + KSquirrel::app()->setCaption(QString::null); +#else + t_glv.sbarWidget("SBFile")->setText(SQ_ErrorString::instance()->string(err_index)); +#endif + + matrix_pure_reset(); + tab->curangle = 0; + tab->isflippedH = tab->isflippedV = false; + + changeSlider(1.0); + + // update context and show "broken" image + updateGL(); +} + +/* + * Are we in fullscreen state ? + */ +bool SQ_GLWidget::fullscreen() const +{ +#ifndef KSQUIRREL_PART + KWin::WindowInfo wi = KWin::windowInfo(SQ_GLView::window()->winId()); + + if(wi.valid()) + pAFull->setChecked((wi.state() & NET::FullScreen)); + + return pAFull->isChecked(); +#else + return false; +#endif +} + +/* + * Toggle fullscreen state. + */ +void SQ_GLWidget::toggleFullScreen() +{ +#ifndef KSQUIRREL_PART + bool fs = !fullscreen(); + + pAFull->setChecked(fs); + pAToolFull->setOn(fs); + + KSquirrel::app()->slotFullScreen(fs); +#endif +} + +void SQ_GLWidget::slotSetZoomPercents(int perc) +{ + if(tab->broken || tab->finfo.image.empty()) return; + + GLfloat z = (perc <= 20) ? (GLfloat)perc / 20 : ((GLfloat)perc - 20)/2 + 1.0; + + internalZoom(z); +} + +void SQ_GLWidget::updateFactors() +{ + zoomfactor = SQ_Config::instance()->readNumEntry("zoom", 25); + movefactor = SQ_Config::instance()->readNumEntry("move", 5); + rotatefactor = SQ_Config::instance()->readNumEntry("angle", 90); +} + +void SQ_GLWidget::slotSelectionRect() +{ + stopAnimation(); + tab->glselection = SQ_GLSelectionPainter::Rectangle; + gls->end(); +} + +void SQ_GLWidget::slotSelectionEllipse() +{ + stopAnimation(); + tab->glselection = SQ_GLSelectionPainter::Ellipse; + gls->end(); +} + +void SQ_GLWidget::slotSelectionClear() +{ + tab->glselection = -1; + gls->end(); + + pASelectionEllipse->setChecked(false); + pASelectionRect->setChecked(false); + + if(!manualBlocked()) + startAnimation(); +} + +bool SQ_GLWidget::manualBlocked() +{ + // selection is also blocks animation + return tab->manualBlocked || gls->valid(); +} + +void SQ_GLWidget::setDownloadPercents(int p) +{ + if(p < 0) + percentsLabel->hide(); + else + { + percentsLabel->setText(i18n("Downloading...") + ' ' + KIO::convertSize(p)); + percentsLabel->adjustSize(); + percentsLabel->show(); + } +} + +#include "sq_glwidget.moc" diff --git a/ksquirrel/ksquirrelpart/sq_glwidget.h b/ksquirrel/ksquirrelpart/sq_glwidget.h new file mode 100644 index 0000000..550a1a5 --- /dev/null +++ b/ksquirrel/ksquirrelpart/sq_glwidget.h @@ -0,0 +1,619 @@ +/*************************************************************************** + sq_glwidget.h - description + ------------------- + begin : Mon Mar 15 2004 + copyright : (C) 2004 by Baryshev Dmitry + email : ksquirrel.iv@gmail.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + + +#ifndef SQ_GLWIDGET_H +#define SQ_GLWIDGET_H + +#include +#include +#include +#include + +#include + +#include + +#include "sq_glparts.h" + +#ifdef KSQUIRREL_PART +#include "sq_glview.h" +#endif + +class SQ_GLSelectionPainter; +struct SQ_ImageFilterOptions; +struct SQ_ImageBCGOptions; +struct RGBA; + +// parameters in GL matrix +#define MATRIX_C1 tab->matrix[0] +#define MATRIX_S1 tab->matrix[1] +#define MATRIX_X tab->matrix[3] +#define MATRIX_S2 tab->matrix[4] +#define MATRIX_C2 tab->matrix[5] +#define MATRIX_Y tab->matrix[7] +#define MATRIX_Z tab->matrix[11] + +class KAction; +class KActionCollection; +class KToggleAction; +class KPopupMenu; +class KRadioAction; +class KTempFile; + +namespace KIO { class Job; } + +class QTimer; +class QPopupMenu; +class QSlider; +class QLabel; + +class SQ_ToolButtonPopup; +class SQ_ToolButton; +class SQ_ToolBar; + +/* *************************************************************** */ + +/* + * SQ_GLWidget represents a widget, which loads, shows and manipulates + * an image. + * + * It contains complex decoding method. Since OpenGL can show textures + * only with dimensions of power of 2 (32x62, 512, 256 etc.), we should divide + * decoded image into quads and only then generate textures. + * It means, that the image you see consists of several parts: + * + * |---------------------------------- + * | | | + * | tex N1 | tex N2 | + * | | | + * ----------------------------------- <= Entire image + * | | | + * | tex N3 | tex N4 | + * | | | + * ----------------------------------- + * + * + * The main class member is 'parts'. It's an array of decoded images + * and appropriate memory buffers and textures. Here comes an explanation: + * [ use monotype fonts :) ] + * + * textures & coordinates Part + * +-----------------------------------+ ##################### ################## + * | parts[2] | # # #===> # # + * | +-------------------------------------+ # # # # texture id # + * | | parts[1] | |======> ##################### # texture coords # + * | | +-------------------------------------+ | # # # # ... # + * | | | m_parts parts[0] | | # # # ################## + * | | | ##### | | ##################### + * | | | # # | | + * | | | # #===============================| + * | | | # # | + * | | | ##### | + * | | | | memory buffers + * | | | m32 | ############################### + * | | | ##### | #RGBA.#.....#.....#.....#.....# + * | | | # # | #RGBA.#.....#.....#.....#.....# + * | | | # #==================================> ############################### + * +-| | # # | #RGBA.#.....#.....#.....#.....# + * +-| ##### | #RGBA.#.....#.....#.....#.....# + * +-------------------------------------+ ############################### + * \ / + * \ / + * parts + * + * + ****************************************************************************** + * + */ + +class SQ_GLWidget : public QGLWidget +{ + Q_OBJECT + + public: + SQ_GLWidget(QWidget *parent = 0, const char *name = 0); + ~SQ_GLWidget(); + + void setDownloadPercents(int); + + void removeNonCurrentTabs(int); + + void setExpectedURL(const KURL &u); + + QString originalURL() const; + + /* + * Start decoding given image. We can call it from anywhere. + */ + void startDecoding(const QString &file); + void startDecoding(const KURL &url); + + void zoom(GLfloat); + + /* + * Set zoom, move and rotate factors from config. + */ + void updateFactors(); + + /* + * Set clear color for context. + */ + void setClearColor(); + + void setOriginalURL(const KURL &); + + /* + * Get zoom value, e.g. 1.5, 2.2 ... + */ + GLfloat getZoom() const; + + /* + * Get zoom value in percents, e.g. 150, 220 ... + */ + GLfloat getZoomPercents() const; + + KActionCollection* actionCollection() const; + + /* + * Are we in fullscreen state ? + */ + bool fullscreen() const; + + /* + * Toggle fullscreen state. + */ + void toggleFullScreen(); + + /* + * Direct call to updateGL(). + */ + void updateGLA() { updateGL(); } + + /* + * Type of zoom: fit width, fit height... + */ + int zoomType(); + + /* + * Filter is GL_LINEAR ? + */ + bool isnice(); + + /* + * Direct call to glInit(); + */ + void glInitA() { QGLWidget::glInit(); } + + /* + * Start animation, if loaded image is animated. + */ + void startAnimation(); + + /* + * Stop animation, if loaded image is animated. + */ + void stopAnimation(); + + /* + * Is animation stopped by user ? + */ + bool manualBlocked(); + + /* + * Change statusbar info according with + * current matrix (it shows current zoom & angle values). + */ + void matrixChanged(); + + /* + * Check or uncheck 'Slideshow' button in toolbar. + */ + void updateSlideShowButton(bool toggled); + + void closeAllTabsFull(); + + static SQ_GLWidget* window() { return m_instance; } + + protected: + + /* + * Next three methods should be reimplemented in + * every QGLWidget's subclass. + */ + void initializeGL(); + void paintGL(); + void resizeGL(int,int); + + /* + * Mouse wheel event. Let's load next/previous image, or + * zoom in/zoom out (depends on settings). + */ + void wheelEvent(QWheelEvent *); + + /* + * Palette changed. Let's update tickmarks and background color. + */ + void paletteChange(const QPalette &oldPalette); + + /* + * Accept drag-and-drop events. We can drop some images + * on this widget, SQ_GLWidget will try to decode first file. + * + * TODO: find first supported image and decode it ? + */ + void dragEnterEvent(QDragEnterEvent *); + void dropEvent(QDropEvent *); + + /* + * Mouse events. + */ + void mousePressEvent(QMouseEvent *); + void mouseReleaseEvent(QMouseEvent *); + void mouseMoveEvent(QMouseEvent *); + + private: + void copyURL(); + + QImage generatePreview(); + + bool calcSelection(); + + void changeSlider(GLfloat z = -1.0); + + void hackMatrix(); + + void enableActions(bool U); + + void initAccelsAndMenu(); + + void crop(); + void bcg(); + void filter(); + void editUpdate(); + + /* + * Save current image page to clipboard + */ + void toClipboard(); + + /* + * Save current image page to file + */ + void saveAs(); + + void enableSettingsButton(bool enab); + + /* + * Remove currently loaded textures and memory buffers. + */ + void removeCurrentParts(); + void removeCurrentTabs(); + + void closeAllTabs(); + + /* + * Since 0.6.0-final KSquirrel doesn't show error messages, + * if the image is broken or not supported. It uses "broken" image + * instead. This method does all needed init. + */ + void initBrokenImage(); + + /* + * Force using broken image + update context. + * Show appropriate error message in statusbar. + */ + void useBrokenImage(const int err_index); + + /* + * Update filter. If 'nice' is true, use GL_LINEAR + * and GL_NEAREST otherwise. + */ + void updateFilter(bool nice); + + /* + * Cleanup method. + */ + void decodeFailedOn0(const int err_code); + + /* + * Create KActions. + */ + void createActions(); + + /* + * Create toolbars. + */ + void createToolbar(); + + /* + * Fill a w x h region with texture. Generate texture if needed. + */ + void draw_background(void *bits, unsigned int *tex, int dim, GLfloat w, GLfloat h, bool &bind, bool deleteOld); + + void setupBits(Parts *p, RGBA *buffer, int y, int x); + + /* + * Jump to first or last image in animated sequence. + */ + void jumpToImage(bool); + + /* + * Next image in animated sequence. Called by user (with F3). + */ + void nextImage(); + + /* + * Previous image in animated sequence. Called by user (with F2). + */ + void prevImage(); + + /* + * Draw (or not) image's background. + */ + void toggleDrawingBackground(); + + /* + * Show popup menu with external tools. + */ + void showExternalTools(); + + /* + * Generate textures for tickmarks and bind them. + */ + void initMarks(); + + /* + * Load and check tickmarks from disk. + */ + void createMarks(); + + /* + * Wrapper for 'delete' key. Called from keyPressEvent(). + */ + void deleteWrapper(); + + /* + * Show current image's width, height and bpp in statusbar. + */ + void updateCurrentFileInfo(); + + /* + * Show/hide tickmarks. + */ + void toogleTickmarks(); + + /* + * Show current page number in multipaged images. + * + * For example: "3/11" means that current page is the third in current image, + * which has 11 pages. + */ + void frameChanged(); + void calcFrameLabelWidth(); + + /* + * Set current zoom to 'z'. + */ + void internalZoom(const GLfloat &z); + + /* + * Find best tile's width and height for given width and height. + */ + static void findCloserTiles(int w, int h, std::vector &x, std::vector &y); + static QPair calcRealDimensions(Parts &, int y = -1, int x = -1); + + /* + * Prepare decoding. It will find proper library for decoding, + * clear old memory buffers, etc. + */ + bool prepare(); + + /* + * Zoom to 'r'. Will be called after somebody used mouse button + * to select zoom region. Return true, if zoomed. + */ + bool zoomRect(const QRect &r); + + /* + * Bind textures, draw them and create GL lists. + * If 'swap' it true, swap buffers. + */ + bool showFrames(int y, Parts *, bool swap); + + /* + * OpenGL-related methods, not interesting :-) + * + * Move, zoom, reset, flip and rotate current matrix. + */ + void matrix_move(GLfloat x, GLfloat y); + void matrix_move_z(GLfloat z); + bool matrix_zoom(GLfloat ratio); + void matrix_reset(bool = true); + void matrix_pure_reset(); + void matrix_push(); + void matrix_pop(); + void write_gl_matrix(); + void matrix_rotate(GLfloat angle, bool = true); + void matrix_rotate2(GLfloat angle); + void flip(int, bool = true); + void flip_h(); + void flip_v(); + void exifRotate(bool); + + signals: + void tabCountChanged(); + void message(const QString &); + + public slots: + void slotPrint(); + + void slotSelectionEllipse(); + void slotSelectionRect(); + void slotSelectionClear(); + + private slots: + void decode(); + + void slotAccelActivated(); + + void slotChangeTab(int); + void slotCloseRequest(int); + + void slotCopyJobResult(KIO::Job *job); + + /* + * Slots for toolbar's actions: + * fit width, fit height, zoom+, zoom-, rotate, flip, + * first file, last file, reset... + */ + void slotShowNav(); + void slotSetZoomPercents(int); + void slotZoomW(); + void slotZoomH(); + void slotZoomWH(); + void slotZoomPlus(); + void slotZoom100(); + void slotZoomLast(); + void slotZoomMinus(); + void slotZoomIfLess(); + void slotRotateLeft(); + void slotRotateRight(); + void slotFlipV(); + void slotFlipH(); + void slotMatrixReset(); + void slotProperties(); // show image properties + void slotFirst(); + void slotLast(); + void slotNext(); + void slotPrev(); + void slotZoomMenu(); + void slotAnimateNext(); + void slotToggleAnimate(); // start/stop animation + void slotSetCurrentImage(int); + void slotShowImages(); + void slotImagesHidden(); + void slotImagesShown(); + void slotShowHelp(); + void slotShowCodecSettings(); + void slotApplyCodecSettings(); + + void slotBCG(SQ_ImageBCGOptions *); + void slotFilter(SQ_ImageFilterOptions *fltopt); + + void slotCopyResult(KIO::Job *); + + private: + KAction *pASelectionClear; + KToggleAction *pAFull, *pAIfLess, *pAZoomW, + *pAZoomH, *pAZoomWH, *pAZoom100, + *pAZoomLast, + *pASelectionEllipse, *pASelectionRect; + + SQ_ToolButton *pAToolQuick, *pAToolFull, *pAToolProp, *pAToolPrint; + SQ_ToolButtonPopup *pAToolZoom, *pAToolImages; + + KActionCollection *ac, *acMain; + QPopupMenu *menu, *menuFile, *menuImage; + int id_saveas, id_settings, + id_f5, id_f6, id_f7, id_f8, id_del, + id_prop; + + // popup menu with zoom types (fit width, fit height, zoom 100%...) + KPopupMenu *zoomMenu, *selectionMenu, + + // popup menu with image pages + *images; + + QImage BGpixmap, BGquads; + + QTimer *timer_prev, *timer_next; + QTimer *timer_anim; + + QImage mm[4]; + + fmt_image image_broken; + SQ_GLSelectionPainter *gls; + + Parts *parts_broken; + + GLfloat saved[12], zoomfactor, movefactor, rotatefactor; + + unsigned int texQuads, texPixmap, mark[4]; + int xmoveold, ymoveold, xmove, ymove, + zoom_type, old_id, total, errors, movetype; + bool reset_mode, decoded, blocked, + changed, marks, linear; + float zoomFactor, oldZoom; + RGBA *buffer; + QSlider *slider_zoom; + + KTempFile *tmp; + KURL lastCopy, m_expected, m_original; + QTime clickTime, started; + + std::vector tabs; + Tab *tab, *tabold; + Tab tmptab, taborig; + bool hackResizeGL, bindChecker; + + QLabel *percentsLabel; + +#ifdef KSQUIRREL_PART + SQ_GLView t_glv; +#endif + + static SQ_GLWidget *m_instance; +}; + +inline +int SQ_GLWidget::zoomType() +{ + return zoom_type; +} + +inline +bool SQ_GLWidget::isnice() +{ + return linear; +} + +inline +KActionCollection* SQ_GLWidget::actionCollection() const +{ + return ac; +} + +inline +void SQ_GLWidget::setOriginalURL(const KURL &u) +{ + m_original = u; +} + +inline +QString SQ_GLWidget::originalURL() const +{ + return tab->m_original.isLocalFile() ? tab->m_original.path() : tab->m_original.prettyURL(); +} + +inline +void SQ_GLWidget::setExpectedURL(const KURL &u) +{ + m_expected = u; +} + +#endif diff --git a/ksquirrel/ksquirrelpart/sq_glwidget_helpers.cpp b/ksquirrel/ksquirrelpart/sq_glwidget_helpers.cpp new file mode 100644 index 0000000..bad2d89 --- /dev/null +++ b/ksquirrel/ksquirrelpart/sq_glwidget_helpers.cpp @@ -0,0 +1,263 @@ +/*************************************************************************** + sq_glwidget_helpers.cpp - description + ------------------- + begin : 7 2005 + copyright : (C) 2005 by Baryshev Dmitry + email : ksquirrel.iv@gmail.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include +#include +#include +#include + +#include + +#include + +#include + +#ifdef SQ_HAVE_KEXIF +#include +#endif + +#include "sq_glwidget_helpers.h" + +SQ_ToolButtonPopup::SQ_ToolButtonPopup(const QPixmap &pix, const QString &textLabel, KToolBar *parent) + : KToolBarButton(pix, -1, parent, 0, textLabel) +{ + setFixedWidth(SQ_ToolButton::fixedWidth()); +} + +SQ_ToolButtonPopup::~SQ_ToolButtonPopup() +{} + +SQ_ToolButton::SQ_ToolButton(const QIconSet &iconSet, const QString &textLabel, + QObject *receiver, const char *slot, KToolBar *parent, const char *name) + : QToolButton(iconSet, textLabel, QString::null, receiver, slot, parent, name) +{ + setFixedWidth(SQ_ToolButton::fixedWidth()); +} + +SQ_ToolButton::~SQ_ToolButton() +{} + +int SQ_GLHelpers::roundAngle(int curangle) +{ + int sign = (curangle < 0 ? -1 : 1); + curangle = std::abs(curangle); + + if((curangle > 0 && curangle < 45) || (curangle >= 315 && curangle < 360)) + curangle = 0; + else if(curangle >= 45 && curangle < 135) + curangle = 90; + else if(curangle >= 135 && curangle < 225) + curangle = 180; + else if(curangle >= 225 && curangle < 315) + curangle = 270; + + curangle *= sign; + + return curangle; +} + +void SQ_GLHelpers::subRotation(QWMatrix &wm, int curangle, int orient) +{ + curangle = SQ_GLHelpers::roundAngle(curangle); + +#ifdef SQ_HAVE_KEXIF + switch(orient) + { + case KExifData::ROT_180: curangle -= 180; break; + case KExifData::ROT_90_HFLIP: + case KExifData::ROT_90: + case KExifData::ROT_90_VFLIP: curangle -= 90; break; + case KExifData::ROT_270: curangle -= 270; break; + + default: ; + } +#endif + + switch(curangle) + { + case -180: + case 180: wm.rotate(180); break; + + case -270: + case 90: wm.rotate(90); break; + + case -90: + case 270: wm.rotate(270); break; + + default: ; + } +} + +bool SQ_GLHelpers::normalizeSelection(int &sx, int &sy, int &sw, int &sh, int w, int h, const QWMatrix &matr, int curangle, int orient) +{ + QWMatrix wm = matr; + + SQ_GLHelpers::subRotation(wm, curangle, orient); + + if(!wm.isIdentity()) + { + int ax = -w/2 + sx; + int ay = h/2 - sy; + + QPointArray pa(4), pb; + + pa.setPoint(0, ax, ay-sh); + pa.setPoint(1, ax+sw, ay-sh); + pa.setPoint(2, ax+sw, ay); + pa.setPoint(3, ax, ay); + + pb = wm.map(pa); + + int fx, fy, fx2, fy2; + fx = std::min(std::min(pb.point(0).x(), pb.point(1).x()), std::min(pb.point(2).x(), pb.point(3).x())); + fy = std::max(std::max(pb.point(0).y(), pb.point(1).y()), std::max(pb.point(2).y(), pb.point(3).y())); + + fx2 = std::max(std::max(pb.point(0).x(), pb.point(1).x()), std::max(pb.point(2).x(), pb.point(3).x())); + fy2 = std::min(std::min(pb.point(0).y(), pb.point(1).y()), std::min(pb.point(2).y(), pb.point(3).y())); + + sx = fx; + sy = fy; + sw = fx2 - fx; + sh = fy - fy2; + + sx += w/2; + sy = h/2-sy; + } + + if(sx > w || sy > h || sx + sw < 0 || sy + sh < 0) + return false; + + if(sx < 0) { sw = sw+sx; sx = 0; } + if(sy < 0) { sh = sh+sy; sy = 0; } + + if(sx + sw > w) sw = w - sx; + if(sy + sh > h) sh = h - sy; + + return (sw && sh); +} + +void SQ_GLHelpers::scanLine0(RGBA *data, RGBA *scan, int rw, int w, int h, int y, int flip) +{ + if(flip == 1) + { + data = data + rw*y + w-1; + + for(int i = 0;i < w;i++) + { + *scan = *data; + + scan++; + data--; + } + } + else if(flip == 2) + { + data = data + rw*(h-1-y); + + for(int i = 0;i < w;i++) + { + *scan = *data; + + scan++; + data++; + } + } + else + memcpy(scan, data + rw*y, w * sizeof(RGBA)); +} + +void SQ_GLHelpers::scanLine90(RGBA *data, RGBA *scan, int rw, int w, int h, int y, int flip) +{ + if(flip == 2) + { + data = data + y; + + for(int i = 0;i < h;i++) + { + *scan = *data; + + scan++; + data += rw; + } + } + else + { + data = flip == 1 ? (data + rw*(h-1) + w-y-1) : (data + rw*(h-1) + y); + + for(int i = 0;i < h;i++) + { + *scan = *data; + + scan++; + data -= rw; + } + } +} + +void SQ_GLHelpers::scanLine180(RGBA *data, RGBA *scan, int rw, int w, int h, int y, int flip) +{ + if(flip == 1) + { + data = data + rw*(h-1-y); + + memcpy(scan, data, w * sizeof(RGBA)); + } + else + { + data = flip == 2 ? (data + rw*y + w-1) : (data + rw*(h-1-y) + w-1); + + for(int i = 0;i < w;i++) + { + *scan = *data; + + scan++; + data--; + } + } +} + +void SQ_GLHelpers::scanLine270(RGBA *data, RGBA *scan, int rw, int w, int h, int y, int flip) +{ + if(flip == 2) + { + data = data + rw*(h-1) + w-y-1; + + for(int i = 0;i < h;i++) + { + *scan = *data; + + scan++; + data -= rw; + } + } + else + { + data = flip == 1 ? (data + y) : (data + w-y-1); + + for(int i = 0;i < h;i++) + { + *scan = *data; + + scan++; + data += rw; + } + } +} diff --git a/ksquirrel/ksquirrelpart/sq_glwidget_helpers.h b/ksquirrel/ksquirrelpart/sq_glwidget_helpers.h new file mode 100644 index 0000000..a9a224a --- /dev/null +++ b/ksquirrel/ksquirrelpart/sq_glwidget_helpers.h @@ -0,0 +1,74 @@ +/*************************************************************************** + sq_glwidget_helpers.h - description + ------------------- + begin : May 31 2005 + copyright : (C) 2005 by Baryshev Dmitry + email : ksquirrel.iv@gmail.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifndef SQ_GLWIDGET_HELPERS +#define SQ_GLWIDGET_HELPERS + +#include + +class QWMatrix; + +class KToolBar; + +struct RGBA; + +class SQ_ToolButtonPopup : public KToolBarButton +{ + public: + SQ_ToolButtonPopup(const QPixmap &pix, const QString &textLabel, KToolBar *parent); + ~SQ_ToolButtonPopup(); +}; + +class SQ_ToolButton : public QToolButton +{ + public: + SQ_ToolButton(const QIconSet &iconSet, const QString &textLabel, QObject *receiver, + const char *slot, KToolBar *parent, const char *name = 0); + ~SQ_ToolButton(); + + static int fixedWidth(); +}; + +inline +int SQ_ToolButton::fixedWidth() +{ + return 26; +} + +namespace SQ_GLHelpers +{ + // 0, 1, 2 + typedef void (* scanLineGetter)(RGBA *data, RGBA *, int rw, int w, int h, int y, int flip); + + void scanLine0(RGBA *, RGBA *, int, int, int, int, int); + void scanLine90(RGBA *, RGBA *, int, int, int, int, int); + void scanLine180(RGBA *, RGBA *, int, int, int, int, int); + void scanLine270(RGBA *, RGBA *, int, int, int, int, int); + + int roundAngle(int ang); + + void subRotation(QWMatrix &wm, int curangle, int orient); + + /* + * normalize selection rectangle + * sx,sy are X and Y coordinates + * sw x sh is a selection geometry + */ + bool normalizeSelection(int &sx, int &sy, int &sw, int &sh, int w, int h, const QWMatrix&, int curangle, int orient); +} + +#endif diff --git a/ksquirrel/ksquirrelpart/sq_glwidget_stuff.cpp b/ksquirrel/ksquirrelpart/sq_glwidget_stuff.cpp new file mode 100644 index 0000000..3926166 --- /dev/null +++ b/ksquirrel/ksquirrelpart/sq_glwidget_stuff.cpp @@ -0,0 +1,1778 @@ +/*************************************************************************** + sq_glwidget_stuff.cpp - description + ------------------- + begin : Wed Oct 31 2007 + copyright : (C) 2007 by Baryshev Dmitry + email : ksquirrel.iv@gmail.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#ifndef KSQUIRREL_PART +#include "ksquirrel.h" +#include "sq_widgetstack.h" +#endif + +#include "sq_config.h" +#include "sq_libraryhandler.h" +#include "sq_glview.h" +#include "sq_glwidget.h" +#include "sq_glwidget_helpers.h" +#include "sq_imageproperties.h" +#include "sq_helpwidget.h" +#include "sq_filedialog.h" +#include "sq_iconloader.h" +#include "sq_codecsettingsskeleton.h" +#include "sq_externaltool.h" +#include "sq_diroperator.h" +#include "sq_popupmenu.h" +#include "sq_glselectionpainter.h" +#include "sq_utils.h" +#include "sq_imagefilter.h" +#include "sq_imagebcg.h" +#include "fmt_filters.h" + +#ifdef SQ_HAVE_KEXIF +#include +#include +#endif + +#include +#include + +#include "file_broken.xpm" + +// Create actions +void SQ_GLWidget::createActions() +{ + pASelectionRect = new KToggleAction(i18n("Rectangle"), QPixmap(locate("data", "images/actions/glselection_rect.png")), 0, this, SLOT(slotSelectionRect()), ac, "SQ Selection Rect"); + pASelectionEllipse = new KToggleAction(i18n("Ellipse"), QPixmap(locate("data", "images/actions/glselection_ellipse.png")), 0, this, SLOT(slotSelectionEllipse()), ac, "SQ Selection Ellipse"); + pASelectionClear = new KAction(i18n("Clear"), 0, 0, this, SLOT(slotSelectionClear()), ac, "SQ Selection Clear"); + + pAZoomW = new KToggleAction(i18n("Fit width"), QPixmap(locate("data", "images/actions/zoomW.png")), 0, this, SLOT(slotZoomW()), ac, "SQ ZoomW"); + pAZoomH = new KToggleAction(i18n("Fit height"), QPixmap(locate("data", "images/actions/zoomH.png")), 0, this, SLOT(slotZoomH()), ac, "SQ ZoomH"); + pAZoomWH = new KToggleAction(i18n("Fit image"), QPixmap(locate("data", "images/actions/zoomWH.png")), 0, this, SLOT(slotZoomWH()), ac, "SQ ZoomWH"); + pAZoom100 = new KToggleAction(i18n("Zoom 100%"), QPixmap(locate("data", "images/actions/zoom100.png")), 0, this, SLOT(slotZoom100()), ac, "SQ Zoom100"); + pAZoomLast = new KToggleAction(i18n("Leave previous zoom"), QPixmap(locate("data", "images/actions/zoomlast.png")), 0, this, SLOT(slotZoomLast()), ac, "SQ ZoomLast"); + pAIfLess = new KToggleAction(i18n("Ignore, if image is smaller than window"), QPixmap(locate("data", "images/actions/ifless.png")), 0, 0, 0, ac, "if less"); + + pAFull = new KToggleAction(QString::null, 0, 0, 0, ac, "SQ GL Full"); + + QString squirrel_zoom_actions = QString::fromLatin1("squirrel_zoom_actions"); + pAZoomW->setExclusiveGroup(squirrel_zoom_actions); + pAZoomH->setExclusiveGroup(squirrel_zoom_actions); + pAZoomWH->setExclusiveGroup(squirrel_zoom_actions); + pAZoom100->setExclusiveGroup(squirrel_zoom_actions); + pAZoomLast->setExclusiveGroup(squirrel_zoom_actions); + + QString squirrel_selection_type = QString::fromLatin1("squirrel_selection_type"); + pASelectionEllipse->setExclusiveGroup(squirrel_selection_type); + pASelectionRect->setExclusiveGroup(squirrel_selection_type); + + connect(pAIfLess, SIGNAL(toggled(bool)), this, SLOT(slotZoomIfLess())); + +#ifndef KSQUIRREL_PART + connect(pAFull, SIGNAL(toggled(bool)), KSquirrel::app(), SLOT(slotFullScreen(bool))); +#endif + + SQ_Config::instance()->setGroup("GL view"); + + pAIfLess->setChecked(SQ_Config::instance()->readBoolEntry("ignore", true)); +} + +void SQ_GLWidget::createToolbar() +{ + zoomMenu = new KPopupMenu; + +#ifndef KSQUIRREL_PART + selectionMenu = new KPopupMenu; + + SQ_ToolButton *pATool; + + SQ_ToolBar *toolbar = SQ_GLView::window()->toolbar(); + + pASelectionRect->plug(selectionMenu); + pASelectionEllipse->plug(selectionMenu); + selectionMenu->insertSeparator(); + pASelectionClear->plug(selectionMenu); + + // hack to show accels + selectionMenu->changeItem(pASelectionRect->itemId(0), pASelectionRect->text() + "\tCtrl+R"); + selectionMenu->changeItem(pASelectionEllipse->itemId(0), pASelectionEllipse->text() + "\tCtrl+E"); + selectionMenu->changeItem(pASelectionClear->itemId(0), pASelectionClear->text() + "\tCtrl+C"); + + pAZoom100->plug(zoomMenu); + pAZoomLast->plug(zoomMenu); + zoomMenu->insertSeparator(); + pAZoomW->plug(zoomMenu); + pAZoomH->plug(zoomMenu); + pAZoomWH->plug(zoomMenu); + zoomMenu->insertSeparator(); + pAIfLess->plug(zoomMenu); + + switch(zoom_type) + { + case 0: pAZoomW->setChecked(true); break; + case 1: pAZoomH->setChecked(true); break; + case 3: pAZoom100->setChecked(true); break; + case 4: pAZoomLast->setChecked(true); break; + + // "case 2" too + default: pAZoomWH->setChecked(true); + } + +/* + * We will create QToolButtons and put them in toolbar. + * Of course, we can just KAction::plug(), BUT plugged KActions + * will produce buttons, which cann't be clicked twise! I think + * plugged KActions will treat our attempt as double-click, not two single-clicks. + * On the other hand, we can click QToolButton as frequently as we want. + * + * Plugged KActions also don't know about autorepeat :( + */ + new SQ_ToolButton(QPixmap(locate("data", "images/actions/file_first.png")), i18n("Go to first image"), this, SLOT(slotFirst()), toolbar); + pATool = new SQ_ToolButton(QPixmap(locate("data", "images/actions/file_prev.png")), i18n("Previous image"), this, SLOT(slotPrev()), toolbar); + pATool->setAutoRepeat(true); + pATool = new SQ_ToolButton(QPixmap(locate("data", "images/actions/file_next.png")), i18n("Next image"), this, SLOT(slotNext()), toolbar); + pATool->setAutoRepeat(true); + new SQ_ToolButton(QPixmap(locate("data", "images/actions/file_last.png")), i18n("Go to last image"), this, SLOT(slotLast()), toolbar); + + // some toolbuttons need autorepeat... + pATool = new SQ_ToolButton(QPixmap(locate("data", "images/actions/zoom+.png")), i18n("Zoom +"), this, SLOT(slotZoomPlus()), toolbar); + pATool->setAutoRepeat(true); + pATool = new SQ_ToolButton(QPixmap(locate("data", "images/actions/zoom-.png")), i18n("Zoom -"), this, SLOT(slotZoomMinus()), toolbar); + pATool->setAutoRepeat(true); + pAToolZoom = new SQ_ToolButtonPopup(QPixmap(locate("data", "images/actions/zoom_template.png")), i18n("Zoom"), toolbar); + pAToolZoom->setPopup(zoomMenu); + pATool = new SQ_ToolButton(QPixmap(locate("data", "images/actions/rotateL.png")), i18n("Rotate left"), this, SLOT(slotRotateLeft()), toolbar); + pATool->setAutoRepeat(true); + pATool = new SQ_ToolButton(QPixmap(locate("data", "images/actions/rotateR.png")), i18n("Rotate right"), this, SLOT(slotRotateRight()), toolbar); + pATool->setAutoRepeat(true); + pATool = new SQ_ToolButton(QPixmap(locate("data", "images/actions/flipV.png")), i18n("Flip vertically"), this, SLOT(slotFlipV()), toolbar); + pATool->setAutoRepeat(true); + pATool = new SQ_ToolButton(QPixmap(locate("data", "images/actions/flipH.png")), i18n("Flip horizontally"), this, SLOT(slotFlipH()), toolbar); + pATool->setAutoRepeat(true); + new SQ_ToolButton(QPixmap(locate("data", "images/actions/reload.png")), i18n("Normalize"), this, SLOT(slotMatrixReset()), toolbar); + + pAToolFull = new SQ_ToolButton(QPixmap(locate("data", "images/actions/fullscreen.png")), i18n("Fullscreen"), pAFull, SLOT(activate()), toolbar); + pAToolFull->setToggleButton(true); + pAToolImages = new SQ_ToolButtonPopup(QPixmap(locate("data", "images/actions/images.png")), i18n("Select image"), toolbar); + pAToolImages->setPopup(images); + SQ_ToolButtonPopup *pAToolSel = new SQ_ToolButtonPopup(QPixmap(locate("data", "images/actions/glselection.png")), i18n("Selection"), toolbar); + pAToolSel->setPopup(selectionMenu); + pAToolQuick = new SQ_ToolButton(QPixmap(locate("data", "images/actions/configure.png")), i18n("Codec settings"), this, SLOT(slotShowCodecSettings()), toolbar); + pAToolQuick->setEnabled(false); + pAToolProp = new SQ_ToolButton(QPixmap(locate("data", "images/actions/prop.png")), i18n("Image Properties"), this, SLOT(slotProperties()), toolbar); + pAToolPrint = new SQ_ToolButton(QPixmap(locate("data", "images/actions/print.png")), i18n("Print"), this, SLOT(slotPrint()), toolbar); + new SQ_ToolButton(QPixmap(locate("data", "images/actions/shownav.png")), i18n("Show navigator"), this, SLOT(slotShowNav()), toolbar); + + slider_zoom = new QSlider(1, 38, 2, 19, Qt::Horizontal, toolbar); + slider_zoom->setTickmarks(QSlider::Below); + slider_zoom->setTickInterval(19); + connect(slider_zoom, SIGNAL(valueChanged(int)), this, SLOT(slotSetZoomPercents(int))); + toolbar->insertWidget(1000, 0, slider_zoom); + toolbar->setItemAutoSized(1000); + toolbar->alignItemRight(1000); + + changeSlider(1.0); +#endif +} + +// Show image properties. +void SQ_GLWidget::slotProperties() +{ + if(tab->broken || tab->finfo.image.empty()) return; + + // Stop animation... + stopAnimation(); + + const int real_size = tab->finfo.image[tab->current].w * tab->finfo.image[tab->current].h * sizeof(RGBA); + QString sz = KIO::convertSize(real_size); + QStringList list; + + QValueVector > meta; + + if(!tab->finfo.meta.empty()) + { + for(std::vector::iterator it = tab->finfo.meta.begin();it != tab->finfo.meta.end();++it) + { + meta.append(QPair((*it).group, (*it).data)); + } + } + + // save tab->current image parameters and some additioanl information + // in list + list << tab->quickImageInfo + << QString::fromLatin1("%1x%2").arg(tab->finfo.image[tab->current].w).arg(tab->finfo.image[tab->current].h) + << QString::fromLatin1("%1").arg(tab->finfo.image[tab->current].bpp) + << tab->finfo.image[tab->current].colorspace + << tab->finfo.image[tab->current].compression + << sz + << QString::fromLatin1("%1").arg((double)real_size / tab->fmt_size, 0, 'f', 2) + << ((tab->finfo.image[tab->current].interlaced) ? i18n("yes") : i18n("no")) + << QString::fromLatin1("%1").arg(errors) + << QString::fromLatin1("%1").arg(tab->finfo.image.size()) + << QString::fromLatin1("#%1").arg(tab->current+1) + << QString::fromLatin1("%1").arg(tab->finfo.image[tab->current].delay); + + // create dialog and setup it + SQ_ImageProperties prop(this); + prop.setFile(tab->m_File); + prop.setURL(tab->m_original); + prop.setParams(list); + prop.setMetaInfo(meta); + + // show! + prop.exec(); + + // restore animation + if(!manualBlocked()) + startAnimation(); +} + +void SQ_GLWidget::findCloserTiles(int w, int h, std::vector &x, std::vector &y) +{ + static int s = 9; + static int dims[10] = { 2, 4, 8, 16, 32, 64, 128, 256, 512 }; + + int *dd[2] = { &w, &h }; + std::vector *dv[2] = { &x, &y }; + int del; + + for(int ff = 0;ff < 2;ff++) + { + if(*dd[ff] == 1) *dd[ff]=2; + else if((*dd[ff])%2) (*dd[ff])++; + + while((*dd[ff]) >= 512) + { + (*dv[ff]).push_back(512); + (*dd[ff]) -= 512; + } + + for(int i = 0;i < s-1;i++) + if((*dd[ff]) >= dims[i] && (*dd[ff]) < dims[i+1]) + { + del = dims[i] + (dims[i]>>1); + + if((*dd[ff]) <= del) + { + (*dv[ff]).push_back(dims[i]); + (*dd[ff]) -= dims[i]; + } + else + { + (*dv[ff]).push_back(dims[i+1]); + (*dd[ff]) -= dims[i+1]; + } + + i = -1; + } + } +} + +QPair SQ_GLWidget::calcRealDimensions(Parts &p, int y, int x) +{ + int rw = 0, rh = 0; + int toy = y == -1 ? p.tilesy.size() : y; + int tox = x == -1 ? p.tilesx.size() : x; + + std::vector::iterator itEnd = p.tilesx.end(); + + for(std::vector::iterator it = p.tilesx.begin();it != itEnd && tox--;++it) + rw += (*it); + + itEnd = p.tilesy.end(); + + for(std::vector::iterator it = p.tilesy.begin();it != itEnd && toy--;++it) + rh += (*it); + + return QPair(rw, rh); +} + +void SQ_GLWidget::slotShowCodecSettings() +{ + tab->lib = SQ_LibraryHandler::instance()->libraryForFile(tab->m_File); + + if(!tab->lib || tab->lib->config.isEmpty()) // oops ? + { + enableSettingsButton(false); + return; + } + + SQ_CodecSettingsSkeleton skel(this); + + connect(&skel, SIGNAL(apply()), this, SLOT(slotApplyCodecSettings())); + + skel.addSettingsWidget(tab->lib->config); + skel.setCodecInfo(tab->lib->mime, tab->lib->quickinfo); + skel.adjustSize(); + + if(skel.exec(tab->lib->settings) == QDialog::Accepted) + tab->lib->codec->set_settings(tab->lib->settings); +} + +void SQ_GLWidget::slotApplyCodecSettings() +{ + if(tab->lib) + { + // new settings are already set by SQ_CodecSettingsSkeleton + tab->lib->codec->set_settings(tab->lib->settings); + m_original = tab->m_original; + startDecoding(QString(tab->m_File)); + } +} + +void SQ_GLWidget::slotSetCurrentImage(int id) +{ + if(tab->total == 1) + return; + + images->setItemChecked(old_id, false); + tab->current = images->itemParameter(id); + + images->setItemChecked(id, true); + old_id = id; + + updateCurrentFileInfo(); + updateGL(); +} + +void SQ_GLWidget::slotImagesShown() +{ + if(tab->finfo.animated) + { + if(!timer_anim->isActive()) + blocked = false; + else + { + stopAnimation(); + blocked = true; + } + } + + images->setItemChecked(old_id, false); + int id = images->idAt(tab->current); + images->setItemChecked(id, true); + old_id = id; +} + +void SQ_GLWidget::slotShowImages() +{ + images->exec(QCursor::pos()); +} + +void SQ_GLWidget::slotImagesHidden() +{ + if(blocked && tab->finfo.animated) + startAnimation(); +} + +void SQ_GLWidget::slotShowHelp() +{ + SQ_HelpWidget help_w(this); + + help_w.exec(); +} + +void SQ_GLWidget::showExternalTools() +{ + bool v_ogorogde_buzina_a_v_kieve_dzyadka = SQ_ExternalTool::instance()->constPopupMenu()->isEnabled(); + SQ_ExternalTool::instance()->constPopupMenu()->setEnabled(true); + + KFileItemList items; + KFileItem fi(KFileItem::Unknown, KFileItem::Unknown, tab->m_original); + + if(!tab->m_original.isEmpty()) + { + items.append(&fi); + SQ_ExternalTool::instance()->setItems(items); + } + + SQ_ExternalTool::instance()->constPopupMenu()->exec(QCursor::pos()); + SQ_ExternalTool::instance()->constPopupMenu()->setEnabled(v_ogorogde_buzina_a_v_kieve_dzyadka); +} + +// Delete current image (user pressed 'Delete' key). +void SQ_GLWidget::deleteWrapper() +{ + if(tab->m_original.isEmpty()) + return; + +#ifndef KSQUIRREL_PART + KFileItemList list; + KFileItem fi(KFileItem::Unknown, KFileItem::Unknown, tab->m_original); + list.append(&fi); + SQ_WidgetStack::instance()->diroperator()->del(list, this); +#else + SQ_DirOperator::instance()->del(tab->m_original, this); +#endif +} + +void SQ_GLWidget::enableSettingsButton(bool enab) +{ +#ifndef KSQUIRREL_PART + pAToolQuick->setEnabled(enab); +#endif + + menuImage->setItemEnabled(id_settings, enab); +} + +void SQ_GLWidget::saveAs() +{ + if(!tab->lib || tab->finfo.image.empty()) // nothing to save + return; + + SQ_Config::instance()->setGroup("GL view"); + QString lastPath = SQ_Config::instance()->readEntry("saveasPath"); + QString lastFilt = SQ_Config::instance()->readEntry("saveasFilter"); + + if(lastPath.isEmpty()) + { + KURL u = tab->m_original; + u.cd(".."); + lastPath = u.prettyURL(); + } + + SQ_FileDialog d(lastPath, this); + + // set filter: writable codecs without *.* + d.setFilter(SQ_LibraryHandler::instance()->allFiltersFileDialogString(false, false)); + d.setOperationMode(KFileDialog::Saving); + d.setSelection(tab->m_original.fileName()); + d.setCurrentFilter(lastFilt); + d.updateCombo(false); + + if(d.exec() == QDialog::Rejected || d.selectedURL().isEmpty()) + return; + + KURL url = d.selectedURL(); + + // cut off file name + KURL u = url; + u.cd(".."); + SQ_Config::instance()->writeEntry("saveasPath", u.prettyURL()); + SQ_Config::instance()->writeEntry("saveasFilter", d.nameFilter()); + + QString path = url.isLocalFile() ? url.path() : tmp->name(); + + SQ_LIBRARY *wlib = SQ_LibraryHandler::instance()->libraryByName(d.nameFilter()); + + if(!wlib || !wlib->writestatic) + { + KMessageBox::error(this, i18n("Sorry, could not perform write operation\nfor codec \"%1\"").arg(d.nameFilter())); + return; + } + + SQ_GLHelpers::scanLineGetter scgetter; + int flp = 0; + int curangle = SQ_GLHelpers::roundAngle((int)tab->curangle); + + fmt_image im = tab->finfo.image[tab->current]; + +/* + * The easiest way to rotate image is to use QImage + QImage::xForm(), + * but this method is VERY memory inefficient. We will use our own tranformation + * routins... Yes, they will be a little bit slower, but they require only + * one scaline in stack. + */ + + int w = im.w, h = im.h; + int rw = tab->parts[tab->current].realw; + +#ifdef SQ_HAVE_KEXIF + switch(tab->orient) + { + case KExifData::HFLIP: + case KExifData::ROT_90_HFLIP: + flp = 1; + break; + + case KExifData::VFLIP: + case KExifData::ROT_90_VFLIP: + flp = 2; + break; + + default: ; + } +#endif + + switch(curangle) + { + case -270: + case 90: scgetter = SQ_GLHelpers::scanLine90; std::swap(w, h); break; + + case -180: + case 180: scgetter = SQ_GLHelpers::scanLine180; break; + + case -90: + case 270: scgetter = SQ_GLHelpers::scanLine270; std::swap(w, h); break; + + default: scgetter = SQ_GLHelpers::scanLine0; + } + + RGBA scan[w]; + RGBA *data = tab->parts[tab->current].buffer->data(); + + fmt_image im2 = im; + im2.w = w; + im2.h = h; + + fmt_writeoptions opt; + opt.interlaced = false; + opt.alpha = im.hasalpha; + opt.bitdepth = im.bpp; + opt.compression_scheme = (wlib->opt.compression_scheme & CompressionNo) ? CompressionNo : CompressionInternal; + opt.compression_level = wlib->opt.compression_def; + + int err = wlib->codec->write_init(QString(QFile::encodeName(path)), im2, opt); + + if(err != SQE_OK) + { + KMessageBox::error(this, i18n("Error writing image")); + return; + } + + err = wlib->codec->write_next(); + + if(err != SQE_OK) + { + KMessageBox::error(this, i18n("Error writing image")); + return; + } + + wlib->codec->write_next_pass(); + + int H = im2.h; + int Y0 = wlib->opt.needflip ? (-H+1):0; + int Y = wlib->opt.needflip ? 1:H; + int f; + + for(int j = Y0;j < Y;j++) + { + f = (j < 0) ? -j : j; + + scgetter(data, scan, rw, im.w, im.h, f, flp); + + err = wlib->codec->write_scanline(scan); + + if(err != SQE_OK) + { + wlib->codec->write_close(); + KMessageBox::error(this, i18n("Error writing image")); + return; + } + } + + wlib->codec->write_close(); + + // copy to non-local directory + if(!url.isLocalFile()) + { + // src dst perm overwrite resume progress + KIO::Job *j = KIO::file_copy(path, url, -1, true, false, false); + + connect(j, SIGNAL(result(KIO::Job *)), this, SLOT(slotCopyResult(KIO::Job *))); + } +} + +void SQ_GLWidget::slotCopyResult(KIO::Job *job) +{ + if(job->error()) + { + if(KMessageBox::questionYesNoCancel(this, job->errorString() + '\n' + i18n("Try another location?")) == KMessageBox::Yes) + { + SQ_FileDialog d(QString::null, this); + + // set filter: writable codecs without *.* + d.setFilter(SQ_LibraryHandler::instance()->allFiltersFileDialogString(false, false)); + d.setOperationMode(KFileDialog::Saving); + d.updateCombo(false); + + int result = d.exec(); + + if(result == QDialog::Rejected || d.selectedURL().isEmpty()) + return; + + KIO::Job *j = KIO::file_copy(tmp->name(), d.selectedURL(), -1, true, false, false); + connect(j, SIGNAL(result(KIO::Job *)), this, SLOT(slotCopyResult(KIO::Job *))); + } + } +} + +void SQ_GLWidget::toClipboard() +{ + if(!decoded || tab->broken) + return; + + QImage im((uchar *)tab->parts[tab->current].buffer->data(), tab->parts[tab->current].realw, tab->parts[tab->current].realh, 32, 0, 0, QImage::LittleEndian); + + im = im.swapRGB(); + + // image doesn't have extra regions + if(tab->parts[tab->current].realw == tab->parts[tab->current].w && tab->parts[tab->current].realh == tab->parts[tab->current].h) + KApplication::clipboard()->setImage(im, QClipboard::Clipboard); + else + KApplication::clipboard()->setImage(im.copy(0, 0, tab->parts[tab->current].w, tab->parts[tab->current].h), QClipboard::Clipboard); +} + +void SQ_GLWidget::bcg() +{ + if(tab->broken || tab->finfo.image.empty()) return; + + SQ_ImageBCG _bcg(this); + + stopAnimation(); + + _bcg.setPreviewImage(generatePreview()); + + connect(&_bcg, SIGNAL(bcg(SQ_ImageBCGOptions *)), this, SLOT(slotBCG(SQ_ImageBCGOptions *))); + + _bcg.exec(); + + if(!manualBlocked()) + startAnimation(); +} + +void SQ_GLWidget::filter() +{ + if(tab->broken || tab->finfo.image.empty()) return; + + SQ_ImageFilter flt(this); + + stopAnimation(); + + flt.setPreviewImage(generatePreview()); + + connect(&flt, SIGNAL(filter(SQ_ImageFilterOptions *)), this, SLOT(slotFilter(SQ_ImageFilterOptions *))); + + flt.exec(); + + if(!manualBlocked()) + startAnimation(); +} + +void SQ_GLWidget::slotFilter(SQ_ImageFilterOptions *filtopt) +{ + QImage im((uchar *)tab->parts[tab->current].buffer->data(), tab->parts[tab->current].realw, tab->parts[tab->current].realh, 32, 0, 0, QImage::LittleEndian); + QImage img = gls->valid() ? im.copy(tab->sx, tab->sy, tab->sw, tab->sh) : im; + + fmt_filters::image image = + gls->valid() ? fmt_filters::image((unsigned char *)img.bits(), img.width(), img.height()) + : fmt_filters::image((unsigned char *)img.bits(), tab->parts[tab->current].w, tab->parts[tab->current].h, img.width(), img.height()); + + fmt_filters::rgba c = fmt_filters::white; + + switch(filtopt->type) + { + case F::fblend: fmt_filters::blend(image, filtopt->rgb1, filtopt->_float); break; + case F::fblur: fmt_filters::blur(image, filtopt->_double1, filtopt->_double2);break; + case F::fdesaturate: fmt_filters::desaturate(image, filtopt->_float); break; + case F::fdespeckle: fmt_filters::despeckle(image); break; + case F::fedge: fmt_filters::edge(image, filtopt->_double1); break; + case F::femboss: fmt_filters::emboss(image, filtopt->_double1, filtopt->_double2); break; + case F::fequalize: fmt_filters::equalize(image); break; + case F::ffade: fmt_filters::fade(image, filtopt->rgb1, filtopt->_float); break; + case F::fflatten: fmt_filters::flatten(image, filtopt->rgb1, filtopt->rgb2); break; + case F::fimplode: fmt_filters::implode(image, filtopt->_double1, c); break; + case F::fnegative: fmt_filters::negative(image); break; + case F::fnoise: fmt_filters::noise(image, (fmt_filters::NoiseType)filtopt->_uint); break; + case F::foil: fmt_filters::oil(image, filtopt->_double1); break; + case F::fshade: fmt_filters::shade(image, filtopt->_bool, filtopt->_double1, filtopt->_double2); break; + case F::fsharpen: fmt_filters::sharpen(image, filtopt->_double1, filtopt->_double2); break; + case F::fsolarize: fmt_filters::solarize(image, filtopt->_double1); break; + case F::fspread: fmt_filters::spread(image, filtopt->_uint); break; + case F::fswapRGB: fmt_filters::swapRGB(image, filtopt->_uint); break; + case F::fswirl: fmt_filters::swirl(image, filtopt->_double1, c); break; + case F::fthreshold: fmt_filters::threshold(image, filtopt->_uint); break; + case F::fgray: fmt_filters::gray(image); break; + case F::fredeye: fmt_filters::redeye(image, image.w, image.h, 0, 0, filtopt->_uint); break; + } + + if(gls->valid()) bitBlt(&im, tab->sx, tab->sy, &img, 0, 0, img.width(), img.height()); + + editUpdate(); + + SQ_ImageFilter::instance()->setPreviewImage(generatePreview()); +} + +void SQ_GLWidget::slotBCG(SQ_ImageBCGOptions *bcgopt) +{ + QImage im((uchar *)tab->parts[tab->current].buffer->data(), tab->parts[tab->current].realw, tab->parts[tab->current].realh, 32, 0, 0, QImage::LittleEndian); + QImage img = gls->valid() ? im.copy(tab->sx, tab->sy, tab->sw, tab->sh) : im; + + fmt_filters::image image = + gls->valid() ? fmt_filters::image((unsigned char *)img.bits(), img.width(), img.height()) + : fmt_filters::image((unsigned char *)img.bits(), tab->parts[tab->current].w, tab->parts[tab->current].h, img.width(), img.height()); + if(bcgopt->b) + fmt_filters::brightness(image, bcgopt->b); + + if(bcgopt->c) + fmt_filters::contrast(image, bcgopt->c); + + if(bcgopt->g != 100) + fmt_filters::gamma(image, (double)bcgopt->g / 100.0); + + if(bcgopt->red || bcgopt->green || bcgopt->blue) + fmt_filters::colorize(image, bcgopt->red, bcgopt->green, bcgopt->blue); + + if(gls->valid()) bitBlt(&im, tab->sx, tab->sy, &img, 0, 0, img.width(), img.height()); + + editUpdate(); + + SQ_ImageBCG::instance()->setPreviewImage(generatePreview()); +} + +bool SQ_GLWidget::calcSelection() +{ + QSize sz = gls->size(); + QPoint pt = gls->pos(); + + float z = getZoom(); + float x = pt.x(), y = pt.y(), w = sz.width(), h = sz.height(); + x = x - (float)width()/2 - MATRIX_X + (float)tab->parts[tab->current].w/2 * z; + y = y - (float)height()/2 + MATRIX_Y + (float)tab->parts[tab->current].h/2 * z; + + int sx = (int)(x/z + 0.5); + int sy = (int)(y/z + 0.5); + int sw = (int)(w/z + 0.5); + int sh = (int)(h/z + 0.5); + + if(!sw || !sh) + { + gls->end(); + return false; + } + else + { + if(SQ_GLHelpers::normalizeSelection(sx, + sy, + sw, + sh, + tab->parts[tab->current].w, + tab->parts[tab->current].h, + tab->wm, + (int)tab->curangle, + tab->orient)) + { + tab->srect = QRect(pt, sz); + tab->sx = sx; + tab->sy = sy; + tab->sw = sw; + tab->sh = sh; + } + else + return false; + } + + return true; +} + +QImage SQ_GLWidget::generatePreview() +{ + QImage im((uchar *)tab->parts[tab->current].buffer->data(), tab->parts[tab->current].realw, tab->parts[tab->current].realh, 32, 0, 0, QImage::LittleEndian); + QImage img, ret; + + if(gls->valid() && calcSelection()) + img = im.copy(tab->sx, tab->sy, tab->sw, tab->sh); + else + { + if(tab->parts[tab->current].realw == tab->parts[tab->current].w && tab->parts[tab->current].realh == tab->parts[tab->current].h) + img = im; + else + img = im.copy(0, 0, tab->parts[tab->current].w, tab->parts[tab->current].h); + } + + ret = SQ_Utils::scaleImage((unsigned char *)img.bits(), img.width(), img.height(), 160).swapRGB(); + + SQ_Utils::exifRotate(QString::null, ret, tab->orient); + + return ret; +} + +void SQ_GLWidget::editUpdate() +{ + int tlsy = tab->parts[tab->current].tilesy.size(); + + glDeleteLists(tab->parts[tab->current].m_parts[0].list, tlsy); + + for(int i = 0;i < tlsy;i++) + showFrames(i, &tab->parts[tab->current], false); + + updateGL(); +} + +void SQ_GLWidget::slotShowNav() +{ +#ifndef KSQUIRREL_PART + KSquirrel::app()->activate(); +#endif +} + +void SQ_GLWidget::initAccelsAndMenu() +{ + QPopupMenu *menuRotate = new QPopupMenu(menu); + QPopupMenu *menuZoom = new QPopupMenu(menu); + QPopupMenu *menuMove = new QPopupMenu(menu); + +#ifndef KSQUIRREL_PART + QPopupMenu *menuWindow = new QPopupMenu(menu); +#endif + + menuImage = new QPopupMenu(menu); + menuFile = new QPopupMenu(menu); + + menu->insertItem(SQ_IconLoader::instance()->loadIcon("icons", KIcon::Desktop, KIcon::SizeSmall), i18n("File"), menuFile); + menu->insertItem(SQ_IconLoader::instance()->loadIcon("view_orientation", KIcon::Desktop, KIcon::SizeSmall), i18n("Rotate"), menuRotate); + menu->insertItem(SQ_IconLoader::instance()->loadIcon("viewmag", KIcon::Desktop, KIcon::SizeSmall), i18n("Zoom"), menuZoom); + menu->insertItem(i18n("Move"), menuMove); + +#ifndef KSQUIRREL_PART + menu->insertItem(i18n("Window"), menuWindow); +#endif + + menu->insertItem(i18n("Image"), menuImage); + +#define SQ_ADD_KACTION(b) \ + (new KAction(QString::null, b, this, SLOT(slotAccelActivated()), ac, QString::fromLatin1("action_%1").arg(b))) + + id_saveas = menuFile->insertItem(SQ_IconLoader::instance()->loadIcon("filesaveas", KIcon::Desktop, KIcon::SizeSmall), i18n("Save As...") + "\tS", SQ_ADD_KACTION(Qt::Key_S), SLOT(activate())); + +#ifndef KSQUIRREL_PART + menuFile->insertSeparator(); + menuFile->insertItem(QPixmap(locate("data", "images/menu/next16.png")), i18n("Next") + "\tPageDown", SQ_ADD_KACTION(Qt::Key_PageDown), SLOT(activate())); + menuFile->insertItem(QPixmap(locate("data", "images/menu/prev16.png")), i18n("Previous") + "\tPageUp", SQ_ADD_KACTION(Qt::Key_PageUp), SLOT(activate())); + menuFile->insertItem(QPixmap(locate("data", "images/menu/first16.png")), i18n("First") + "\tHome", SQ_ADD_KACTION(Qt::Key_Home), SLOT(activate())); + menuFile->insertItem(QPixmap(locate("data", "images/menu/last16.png")), i18n("Last") + "\tEnd", SQ_ADD_KACTION(Qt::Key_End), SLOT(activate())); +#endif + + menuFile->insertSeparator(); + id_f5 = menuFile->insertItem(i18n("Copy to...") + "\tF5", SQ_ADD_KACTION(Qt::Key_F5), SLOT(activate())); + id_f6 = menuFile->insertItem(i18n("Move to...") + "\tF6", SQ_ADD_KACTION(Qt::Key_F7), SLOT(activate())); + id_f7 = menuFile->insertItem(i18n("Copy to last folder") + "\tF7", SQ_ADD_KACTION(Qt::Key_F6), SLOT(activate())); + id_f8 = menuFile->insertItem(i18n("Move to last folder") + "\tF8", SQ_ADD_KACTION(Qt::Key_F8), SLOT(activate())); + menuFile->insertSeparator(); + id_del = menuFile->insertItem(i18n("Delete") + "\tDelete", SQ_ADD_KACTION(Qt::Key_Delete), SLOT(activate())); + + menuRotate->insertItem(QPixmap(locate("data", "images/menu/rotateLeft16.png")), i18n("Rotate left") + "\tCtrl+Left", SQ_ADD_KACTION(Qt::Key_Left+CTRL), SLOT(activate())); + menuRotate->insertItem(QPixmap(locate("data", "images/menu/rotateRight16.png")), i18n("Rotate right") + "\tCtrl+Right", SQ_ADD_KACTION(Qt::Key_Right+CTRL), SLOT(activate())); + menuRotate->insertSeparator(); + menuRotate->insertItem(QPixmap(locate("data", "images/menu/18016.png")), i18n("Rotate 180'") + "\tCtrl+Up", SQ_ADD_KACTION(Qt::Key_Up+CTRL), SLOT(activate())); + menuRotate->insertSeparator(); + menuRotate->insertItem(i18n("Rotate 1' left") + "\tAlt+Left", SQ_ADD_KACTION(Qt::Key_Left+ALT), SLOT(activate())); + menuRotate->insertItem(i18n("Rotate 1' right") + "\tAlt+Right", SQ_ADD_KACTION(Qt::Key_Right+ALT), SLOT(activate())); + + menuZoom->insertItem(QPixmap(locate("data", "images/menu/zoom+16.png")), i18n("Zoom +") + "\t+", SQ_ADD_KACTION(Qt::Key_Plus), SLOT(activate())); + menuZoom->insertItem(QPixmap(locate("data", "images/menu/zoom-16.png")), i18n("Zoom -") + "\t-", SQ_ADD_KACTION(Qt::Key_Minus), SLOT(activate())); + menuZoom->insertItem(i18n("Zoom 2x") + "\tCtrl++", SQ_ADD_KACTION(Qt::Key_Plus+CTRL), SLOT(activate())); + menuZoom->insertItem(i18n("Zoom 1/2x") + "\tCtrl+-", SQ_ADD_KACTION(Qt::Key_Minus+CTRL), SLOT(activate())); + menuZoom->insertSeparator(); + menuZoom->insertItem(QPixmap(locate("data", "images/menu/zoom10016.png")), QString::fromLatin1("100%") + "\t1", SQ_ADD_KACTION(Qt::Key_1), SLOT(activate())); + menuZoom->insertItem(QPixmap(locate("data", "images/menu/zoom20016.png")), QString::fromLatin1("200%") + "\t2", SQ_ADD_KACTION(Qt::Key_2), SLOT(activate())); + menuZoom->insertItem(QPixmap(locate("data", "images/menu/zoom30016.png")), QString::fromLatin1("300%") + "\t3", SQ_ADD_KACTION(Qt::Key_3), SLOT(activate())); + menuZoom->insertItem(QPixmap(locate("data", "images/menu/zoom50016.png")), QString::fromLatin1("500%") + "\t5", SQ_ADD_KACTION(Qt::Key_5), SLOT(activate())); + menuZoom->insertItem(QPixmap(locate("data", "images/menu/zoom70016.png")), QString::fromLatin1("700%") + "\t7", SQ_ADD_KACTION(Qt::Key_7), SLOT(activate())); + menuZoom->insertItem(QPixmap(locate("data", "images/menu/zoom90016.png")), QString::fromLatin1("900%") + "\t9", SQ_ADD_KACTION(Qt::Key_9), SLOT(activate())); + menuZoom->insertItem(QPixmap(locate("data", "images/menu/zoom100016.png")), QString::fromLatin1("1000%") + "\t0", SQ_ADD_KACTION(Qt::Key_0), SLOT(activate())); + + menuMove->insertItem(QPixmap(locate("data", "images/menu/moveLeft16.png")), i18n("Move left") + "\tRight", SQ_ADD_KACTION(Qt::Key_Right), SLOT(activate())); + menuMove->insertItem(QPixmap(locate("data", "images/menu/moveRight16.png")), i18n("Move right") + "\tLeft", SQ_ADD_KACTION(Qt::Key_Left), SLOT(activate())); + menuMove->insertItem(QPixmap(locate("data", "images/menu/moveUp16.png")), i18n("Move up") + "\tDown", SQ_ADD_KACTION(Qt::Key_Down), SLOT(activate())); + menuMove->insertItem(QPixmap(locate("data", "images/menu/moveDown16.png")), i18n("Move down") + "\tUp", SQ_ADD_KACTION(Qt::Key_Up), SLOT(activate())); + + menuImage->insertItem(QPixmap(locate("data", "images/menu/animate16.png")), i18n("Start/stop animation") + "\tA", SQ_ADD_KACTION(Qt::Key_A), SLOT(activate())); + menuImage->insertItem(QPixmap(locate("data", "images/menu/background16.png")), i18n("Hide/show background") + "\tB", SQ_ADD_KACTION(Qt::Key_B), SLOT(activate())); + menuImage->insertItem(QPixmap(locate("data", "images/menu/tickmarks16.png")), i18n("Hide/show tickmarks") + "\tK", SQ_ADD_KACTION(Qt::Key_K), SLOT(activate())); + menuImage->insertSeparator(); + menuImage->insertItem(QPixmap(locate("data", "images/menu/flipV16.png")), i18n("Flip vertically") + "\tV", SQ_ADD_KACTION(Qt::Key_V), SLOT(activate())); + menuImage->insertItem(QPixmap(locate("data", "images/menu/flipH16.png")), i18n("Flip horizontally") + "\tH", SQ_ADD_KACTION(Qt::Key_H), SLOT(activate())); + menuImage->insertSeparator(); + menuImage->insertItem(QPixmap(locate("data", "images/menu/page116.png")), i18n("First page") + "\tF1", SQ_ADD_KACTION(Qt::Key_F1), SLOT(activate())); + menuImage->insertItem(QPixmap(locate("data", "images/menu/page216.png")), i18n("Previous page") + "\tF2", SQ_ADD_KACTION(Qt::Key_F2), SLOT(activate())); + menuImage->insertItem(QPixmap(locate("data", "images/menu/page316.png")), i18n("Next page") + "\tF3", SQ_ADD_KACTION(Qt::Key_F3), SLOT(activate())); + menuImage->insertItem(QPixmap(locate("data", "images/menu/page416.png")), i18n("Last page") + "\tF4", SQ_ADD_KACTION(Qt::Key_F4), SLOT(activate())); + menuImage->insertSeparator(); + menuImage->insertItem(i18n("Copy file url") + "\tF9", SQ_ADD_KACTION(Qt::Key_F9), SLOT(activate())); + menuImage->insertItem(i18n("To clipboard") + "\tQ", SQ_ADD_KACTION(Qt::Key_Q), SLOT(activate())); + menuImage->insertItem(i18n("Print") + "\tCtrl+P", SQ_ADD_KACTION(Qt::Key_P+CTRL), SLOT(activate())); + menuImage->insertSeparator(); + id_settings = menuImage->insertItem(SQ_IconLoader::instance()->loadIcon("configure", KIcon::Desktop, KIcon::SizeSmall), i18n("Codec settings") + "\tC", SQ_ADD_KACTION(Qt::Key_C), SLOT(activate())); + menuImage->setItemEnabled(id_settings, false); + menuImage->insertSeparator(); + menuImage->insertItem(i18n("Color balance...") + "\tD", SQ_ADD_KACTION(Qt::Key_D), SLOT(activate())); + menuImage->insertItem(i18n("Apply filter...") + "\tU", SQ_ADD_KACTION(Qt::Key_U), SLOT(activate())); + + menuImage->insertItem(i18n("Crop") + "\tY", SQ_ADD_KACTION(Qt::Key_Y), SLOT(activate())); + +#ifndef KSQUIRREL_PART + menuWindow->insertItem(QPixmap(locate("data", "images/menu/fullscreen16.png")), i18n("Fullscreen") + "\tF", SQ_ADD_KACTION(Qt::Key_F), SLOT(activate())); + menuWindow->insertSeparator(); + menuWindow->insertItem(i18n("Previous tab") + "\tShift+Left", SQ_ADD_KACTION(Qt::Key_Left+SHIFT), SLOT(activate())); + menuWindow->insertItem(i18n("Next tab") + "\tShift+Right", SQ_ADD_KACTION(Qt::Key_Right+SHIFT), SLOT(activate())); + menuWindow->insertSeparator(); + menuWindow->insertItem(i18n("Close tab") + "\tW", SQ_ADD_KACTION(Qt::Key_W), SLOT(activate())); + + menuWindow->insertItem(i18n("Close all tabs") + "\tCtrl+W", SQ_ADD_KACTION(Qt::Key_W+CTRL), SLOT(activate())); +#endif + + menu->insertSeparator(); + menu->insertItem(QPixmap(locate("data", "images/menu/reset16.png")), i18n("Reset") + "\tR", SQ_ADD_KACTION(Qt::Key_R), SLOT(activate())); + id_prop = menu->insertItem(QPixmap(locate("data", "images/menu/prop16.png")), i18n("Properties") + "\tP", SQ_ADD_KACTION(Qt::Key_P), SLOT(activate())); + menu->insertSeparator(); + menu->insertItem(i18n("Hotkeys") + "\t/", SQ_ADD_KACTION(Qt::Key_Slash), SLOT(activate())); + +#ifndef KSQUIRREL_PART + menu->insertSeparator(); + menu->insertItem(QPixmap(locate("data", "images/menu/close16.png")), i18n("Close") + "\tX", SQ_ADD_KACTION(Qt::Key_X), SLOT(activate())); +#endif + + SQ_ADD_KACTION(Qt::Key_Down+CTRL); + SQ_ADD_KACTION(Qt::Key_Equal); + SQ_ADD_KACTION(Qt::Key_Equal+CTRL); + SQ_ADD_KACTION(Qt::Key_N); + SQ_ADD_KACTION(Qt::Key_Space); + SQ_ADD_KACTION(Qt::Key_BackSpace); + SQ_ADD_KACTION(Qt::Key_Escape); + SQ_ADD_KACTION(Qt::Key_Return); + SQ_ADD_KACTION(Qt::Key_Enter); + SQ_ADD_KACTION(Qt::Key_Z); + SQ_ADD_KACTION(Qt::Key_I); + SQ_ADD_KACTION(Qt::Key_E); + +#ifndef KSQUIRREL_PART + SQ_ADD_KACTION(Qt::Key_R+CTRL); + SQ_ADD_KACTION(Qt::Key_E+CTRL); + SQ_ADD_KACTION(Qt::Key_C+CTRL); +#endif + + SQ_ADD_KACTION(Qt::Key_Menu); + SQ_ADD_KACTION(Qt::Key_M); + SQ_ADD_KACTION(Qt::Key_4); + SQ_ADD_KACTION(Qt::Key_6); + SQ_ADD_KACTION(Qt::Key_8); + SQ_ADD_KACTION(Qt::Key_Comma); + SQ_ADD_KACTION(Qt::Key_Period); + SQ_ADD_KACTION(Qt::Key_Asterisk); + SQ_ADD_KACTION(Qt::Key_L); +} + + +void SQ_GLWidget::slotAccelActivated() +{ + KAction *accel = static_cast(const_cast(sender())); + + KShortcut ks = accel->shortcut(); + + if(!ks.compare(Qt::Key_Left)) matrix_move(movefactor, 0); + else if(!ks.compare(Qt::Key_Right)) matrix_move(-movefactor, 0); + else if(!ks.compare(Qt::Key_Up)) matrix_move(0, -movefactor); + else if(!ks.compare(Qt::Key_Down)) matrix_move(0, movefactor); + else if(!ks.compare(Qt::Key_Equal) || + !ks.compare(Qt::Key_Plus)) slotZoomPlus(); + else if(!ks.compare(Qt::Key_Minus)) slotZoomMinus(); + else if(!ks.compare(Qt::Key_Equal+CTRL) || + !ks.compare(Qt::Key_Plus+CTRL)) matrix_zoom(2.0f); + else if(!ks.compare(Qt::Key_Minus+CTRL)) matrix_zoom(0.5f); + else if(!ks.compare(Qt::Key_Q)) toClipboard(); + else if(!ks.compare(Qt::Key_V)) slotFlipV(); + else if(!ks.compare(Qt::Key_H)) slotFlipH(); + else if(!ks.compare(Qt::Key_Left+CTRL)) slotRotateLeft(); + else if(!ks.compare(Qt::Key_Right+CTRL)) slotRotateRight(); + else if(!ks.compare(Qt::Key_R)) slotMatrixReset(); + else if(!ks.compare(Qt::Key_Up+CTRL)) matrix_rotate(180.0f); + else if(!ks.compare(Qt::Key_Down+CTRL)) matrix_rotate(-180.0f); + else if(!ks.compare(Qt::Key_Left+ALT)) matrix_rotate(-1.0f); + else if(!ks.compare(Qt::Key_Right+ALT)) matrix_rotate(1.0f); + +#ifndef KSQUIRREL_PART + else if(!ks.compare(Qt::Key_Left+SHIFT)) SQ_GLView::window()->leftTab(); + else if(!ks.compare(Qt::Key_Right+SHIFT)) SQ_GLView::window()->rightTab(); + else if(!ks.compare(Qt::Key_W)) slotCloseRequest(SQ_GLView::window()->tabbar()->indexOf(SQ_GLView::window()->tabbar()->currentTab())); + else if(!ks.compare(Qt::Key_W+CTRL)) closeAllTabsFull(); +#else + else if(!ks.compare(Qt::Key_W)) closeAllTabsFull(); +#endif + + else if(!ks.compare(Qt::Key_N)) updateFilter(!linear); + else if(!ks.compare(Qt::Key_P)) slotProperties(); + else if(!ks.compare(Qt::Key_C)) slotShowCodecSettings(); + +#ifndef KSQUIRREL_PART + else if(!ks.compare(Qt::Key_PageDown) || + !ks.compare(Qt::Key_Space)) slotNext(); + else if(!ks.compare(Qt::Key_PageUp) || + !ks.compare(Qt::Key_BackSpace)) slotPrev(); + else if(!ks.compare(Qt::Key_X) || + !ks.compare(Qt::Key_Escape) || + !ks.compare(Qt::Key_Return) || + !ks.compare(Qt::Key_Enter)) KSquirrel::app()->closeGLWidget(); + else if(!ks.compare(Qt::Key_Home)) slotFirst(); + else if(!ks.compare(Qt::Key_End)) slotLast(); + else if(!ks.compare(Qt::Key_F)) toggleFullScreen(); +#endif + + else if(!ks.compare(Qt::Key_Z)) slotZoomMenu(); + else if(!ks.compare(Qt::Key_S)) saveAs(); + else if(!ks.compare(Qt::Key_A)) slotToggleAnimate(); + else if(!ks.compare(Qt::Key_I)) slotShowImages(); + else if(!ks.compare(Qt::Key_F1)) jumpToImage(false); + else if(!ks.compare(Qt::Key_F2)) prevImage(); + else if(!ks.compare(Qt::Key_F3)) nextImage(); + else if(!ks.compare(Qt::Key_F4)) jumpToImage(true); + else if(!ks.compare(Qt::Key_F5) || !ks.compare(Qt::Key_F6)) + { + // select a directory + KURL url = KFileDialog::getExistingURL(lastCopy.prettyURL(), this); + + if(url.isEmpty()) + return; + + lastCopy = url; + KIO::Job *job; + + if(!ks.compare(Qt::Key_F5)) + job = KIO::copy(tab->m_original, url); + else + job = KIO::move(tab->m_original, url); + + job->setWindow(this); + connect(job, SIGNAL(result(KIO::Job *)), this, SLOT(slotCopyJobResult(KIO::Job *))); + } + else if(!ks.compare(Qt::Key_F7) || !ks.compare(Qt::Key_F8)) + { + KIO::Job *job; + + if(!ks.compare(Qt::Key_F6)) + job = KIO::copy(tab->m_original, lastCopy); + else + job = KIO::move(tab->m_original, lastCopy); + + job->setWindow(this); + connect(job, SIGNAL(result(KIO::Job *)), this, SLOT(slotCopyJobResult(KIO::Job *))); + } + else if(!ks.compare(Qt::Key_F9)) copyURL(); + else if(!ks.compare(Qt::Key_Slash)) slotShowHelp(); + else if(!ks.compare(Qt::Key_B)) toggleDrawingBackground(); + else if(!ks.compare(Qt::Key_K)) toogleTickmarks(); + else if(!ks.compare(Qt::Key_E)) showExternalTools(); + else if(!ks.compare(Qt::Key_Delete)) deleteWrapper(); + else if(!ks.compare(Qt::Key_D)) bcg(); + else if(!ks.compare(Qt::Key_U)) filter(); + else if(!ks.compare(Qt::Key_Y)) crop(); + +#ifndef KSQUIRREL_PART + else if(!ks.compare(Qt::Key_R+CTRL)) slotSelectionRect(); + else if(!ks.compare(Qt::Key_E+CTRL)) slotSelectionEllipse(); + else if(!ks.compare(Qt::Key_C+CTRL)) slotSelectionClear(); +#endif + + else if(!ks.compare(Qt::Key_P+CTRL)) slotPrint(); + else if(!ks.compare(Qt::Key_Menu) || + !ks.compare(Qt::Key_M)) menu->exec(QCursor::pos()); + else if(!ks.compare(Qt::Key_Comma)) slotZoomW(); + else if(!ks.compare(Qt::Key_Period)) slotZoomH(); + else if(!ks.compare(Qt::Key_Asterisk)) slotZoomWH(); + else if(!ks.compare(Qt::Key_L)) + { + bool b = pAIfLess->isChecked(); + pAIfLess->setChecked(!b); + slotZoomIfLess(); + } + else + { + int val = -1; + + if(!ks.compare(Qt::Key_1)) val = 1; + else if(!ks.compare(Qt::Key_2)) val = 2; + else if(!ks.compare(Qt::Key_3)) val = 3; + else if(!ks.compare(Qt::Key_4)) val = 4; + else if(!ks.compare(Qt::Key_5)) val = 5; + else if(!ks.compare(Qt::Key_6)) val = 6; + else if(!ks.compare(Qt::Key_7)) val = 7; + else if(!ks.compare(Qt::Key_8)) val = 8; + else if(!ks.compare(Qt::Key_9)) val = 9; + else if(!ks.compare(Qt::Key_0)) val = 10; + + if(val != -1) + { + if(tab->broken || tab->finfo.image.empty()) + return; + + zoom(val); + } + } +} + +void SQ_GLWidget::zoom(GLfloat val) +{ + oldZoom = getZoom(); + matrix_reset(false); + matrix_zoom(val); +} + +void SQ_GLWidget::slotCopyJobResult(KIO::Job *job) +{ + if(job->error()) + job->showErrorDialog(this); +} + +void SQ_GLWidget::exifRotate(bool U) +{ +#ifdef SQ_HAVE_KEXIF + switch(tab->orient) + { + // flipping + case KExifData::HFLIP: tab->isflippedH = !tab->isflippedH; flip(0, U); break; + case KExifData::VFLIP: tab->isflippedV = !tab->isflippedV; flip(4, U); break; + + // rotating + case KExifData::ROT_90: matrix_rotate(90, U); break; + case KExifData::ROT_180: matrix_rotate(180, U); break; + case KExifData::ROT_270: matrix_rotate(270, U); break; + + // flipping & rotating + case KExifData::ROT_90_HFLIP: tab->isflippedH = !tab->isflippedH; flip(0, false); matrix_rotate(90, U); break; + case KExifData::ROT_90_VFLIP: tab->isflippedV = !tab->isflippedV; flip(4, false); matrix_rotate(90, U); break; + + // normal rotation or unspecified + default: if(U) updateGL(); + } +#else + if(U) + updateGL(); +#endif +} + +void SQ_GLWidget::enableActions(bool U) +{ +#ifndef KSQUIRREL_PART + pASelectionRect->setEnabled(U); + pASelectionEllipse->setEnabled(U); + pASelectionClear->setEnabled(U); + pAToolProp->setEnabled(U); + pAToolPrint->setEnabled(U); +#endif + + menuFile->setItemEnabled(id_f5, U); + menuFile->setItemEnabled(id_f6, U); + menuFile->setItemEnabled(id_f7, U); + menuFile->setItemEnabled(id_f8, U); + menuFile->setItemEnabled(id_del, U); + menuFile->setItemEnabled(id_saveas, U); + + menu->setItemEnabled(id_prop, U); + + menuImage->setEnabled(U); +} + +void SQ_GLWidget::crop() +{ + if(tab->broken + || tab->finfo.image.empty() + || !gls->valid() + || !calcSelection() + || (tab->sw == tab->parts[tab->current].w && tab->sh == tab->parts[tab->current].h)) + return; + + const int RW = tab->parts[tab->current].realw; + RGBA *img = tab->parts[tab->current].buffer->data() + tab->sy * RW + tab->sx; + + Parts pp; + memoryPart *pt; + + SQ_GLWidget::findCloserTiles(tab->sw, tab->sh, pp.tilesx, pp.tilesy); + QPair pair = SQ_GLWidget::calcRealDimensions(pp); + pp.realw = pair.first; + pp.realh = pair.second; + pp.w = tab->sw; + pp.h = tab->sh; + + if(!pp.makeParts()) + { + KMessageBox::error(this, + i18n("Memory allocation failed for %1 of memory") + .arg(KIO::convertSize(pp.realw * pp.realh * sizeof(RGBA)))); + return; + } + + pt = new memoryPart(pp.realw * pp.realh); + pt->create(); + + if(!pt->valid()) + { + pp.removeParts(); + return; + } + + memset(pt->data(), 0, pp.realw * pp.realh * sizeof(RGBA)); + + for(int i = 0;i < tab->sh;i++) + memcpy(pt->data()+i*pp.realw, img + i*RW, tab->sw * sizeof(RGBA)); + + pp.computeCoords(); + pp.buffer = pt; + + tab->parts[tab->current].removeParts(); + tab->parts[tab->current].deleteBuffer(); + tab->finfo.image[tab->current].w = tab->sw; + tab->finfo.image[tab->current].h = tab->sh; + + int tlsy = pp.tilesy.size(); + for(int i = 0;i < tlsy;i++) + showFrames(i, &pp, false); + + tab->parts[tab->current] = pp; + + slotSelectionClear(); + updateCurrentFileInfo(); + tab->isflippedH = tab->isflippedV = false; + slotZoomIfLess(); + matrixChanged(); +} + +void SQ_GLWidget::slotChangeTab(int id) +{ +#ifndef KSQUIRREL_PART + id = SQ_GLView::window()->tabbar()->indexOf(id); + + Tab *newtab = (id == -1) ? &taborig : &tabs[id]; + + if(tab == newtab) + return; + + if(tab) + { + tab->removeParts(); + gls->setVisible(false); + } + + tab = newtab; + + images->clear(); + old_id = -1; + stopAnimation(); + + enableSettingsButton(id != -1 && tab->lib && !tab->lib->config.isEmpty()); + enableActions(!tab->broken && id != -1); + + if(id == -1) + { + SQ_GLView::window()->resetStatusBar(); + KSquirrel::app()->setCaption(QString::null); + decoded = false; + changeSlider(1.0); + } + else + { + changeSlider(); + KSquirrel::app()->setCaption(originalURL()); + enableActions(!tab->broken); + + if(!tab->broken) + { + SQ_GLView::window()->sbarWidget("SBDecodedI")->setPixmap(tab->lib->mime); + + // fill menu + std::vector::iterator itEnd = tab->finfo.image.end(); + std::vector::iterator it = tab->finfo.image.begin(); + int mid, i = 0, first_id = 0; + + for(;it != itEnd;++it, ++i) + { + mid = images->insertItem(QString::fromLatin1("#%1 [%2x%3@%4]").arg(i+1).arg((*it).w).arg((*it).h).arg((*it).bpp)); + images->setItemParameter(mid, i); + + if(i == tab->current) + old_id = first_id = mid; + } + + images->setItemChecked(first_id, true); + updateCurrentFileInfo(); + frameChanged(); + +#ifndef KSQUIRREL_PART + SQ_GLView::window()->sbarWidget("SBFile")->setText(tab->m_original.fileName(false)); + SQ_GLView::window()->sbarWidget("SBLoaded")->setText(KGlobal::locale()->formatLong(tab->elapsed) + i18n(" ms.")); +#else + t_glv.sbarWidget("SBFile")->setText(tab->m_original.fileName(false)); + t_glv.sbarWidget("SBLoaded")->setText(KGlobal::locale()->formatLong(tab->elapsed) + i18n(" ms.")); +#endif + } + else + SQ_GLView::window()->resetStatusBar(); + + std::vector::iterator itp = tab->parts.begin(); + std::vector::iterator itpEnd = tab->parts.end(); + int tlsy; + + tab->remakeParts(); + + if(tab->glselection != -1) + { + if(!gls->valid()) + gls->begin(static_cast(tab->glselection), 0, 0, false); + + gls->setGeometry(tab->srect); + } + else + gls->end(); + + gls->setVisible(tab->glselection != -1); + + for(;itp != itpEnd;++itp) + { + tlsy = (*itp).tilesy.size(); + + for(int i = 0;i < tlsy;i++) + showFrames(i, &(*itp), false); + } + + if(!manualBlocked()) + startAnimation(); + } + + matrixChanged(); + updateGL(); +#endif +} + +void SQ_GLWidget::slotCloseRequest(int index) +{ +#ifndef KSQUIRREL_PART + if(index < 0) + return; + + SQ_GLView::window()->tabbar()->blockSignals(true); + + // prevent matrix from changing. When tab count == 1, + // SQ_GLView will hide tabbar and SQ_GLWIdget will be resized. + // We don't want it. + if(SQ_GLView::window()->tabbar()->count() == 2) + hackResizeGL = true; + + SQ_GLView::window()->removePage(index); + emit tabCountChanged(); + SQ_GLView::window()->tabbar()->blockSignals(false); + + // workaround bug in KTabBar + QMouseEvent ev(QEvent::MouseMove, + QCursor::pos(), + SQ_GLView::window()->tabbar()->mapFromGlobal(QCursor::pos()), + Qt::NoButton, + Qt::NoButton); + + KApplication::sendEvent(SQ_GLView::window()->tabbar(), &ev); + + std::vector::iterator itEnd = tabs.end(); + std::vector::iterator it = tabs.begin(); + int i = 0; + + for(;(it != itEnd && i != index);++it, ++i) + ; + + (*it).clearParts(); + tabs.erase(it); + tab = 0; + + gls->setVisible(false); + + slotChangeTab(SQ_GLView::window()->tabbar()->currentTab()); +#endif +} + +void SQ_GLWidget::initBrokenImage() +{ + memoryPart *pt; + QImage broken = QPixmap(file_broken_xpm).convertToImage().swapRGB(); + broken.setAlphaBuffer(true); + + parts_broken = new Parts; + + // setup parts_broken. It will have only one 64x64 tile + parts_broken->tilesx.push_back(broken.width()); + parts_broken->tilesy.push_back(broken.height()); + parts_broken->realw = broken.width(); + parts_broken->realh = broken.height(); + parts_broken->w = broken.width(); + parts_broken->h = broken.height(); + parts_broken->makeParts(); + parts_broken->computeCoords(); + + pt = new memoryPart(broken.width() * broken.width()); + pt->create(); + + memcpy(pt->data(), broken.bits(), broken.numBytes()); + + parts_broken->buffer = pt; + + showFrames(0, parts_broken, false); + + image_broken.w = parts_broken->w; + image_broken.h = parts_broken->h; + image_broken.bpp = broken.depth(); + image_broken.compression = "-"; + image_broken.colorspace = "RGBA"; + image_broken.hasalpha = false; + + // we don't need memory buffer any more... + parts_broken->deleteBuffer(); +} + +// Accept drop events. +void SQ_GLWidget::dropEvent(QDropEvent *e) +{ + QStringList files; + + if(QUriDrag::decodeLocalFiles(e, files)) + { + // go through array and find first supported image format + for(QStringList::iterator it = files.begin();it != files.end();++it) + { + if(SQ_LibraryHandler::instance()->libraryForFile(*it)) + { + KURL u = KURL::fromPathOrURL(*it); + m_expected = u; + m_original = u; + startDecoding(u); + break; + } + } + } +} + +// Accept drag events. +void SQ_GLWidget::dragEnterEvent(QDragEnterEvent *e) +{ + e->accept(QUriDrag::canDecode(e)); +} + +/* + * Set clear color for context. + */ +void SQ_GLWidget::setClearColor() +{ + QColor color; + QString path; + + SQ_Config::instance()->setGroup("GL view"); + + switch(SQ_Config::instance()->readNumEntry("GL view background type", 1)) + { + // system color + case 0: + color = colorGroup().color(QColorGroup::Base); + break; + + // custom color + case 1: + color.setNamedColor(SQ_Config::instance()->readEntry("GL view background", "#4e4e4e")); + break; + + // repeated texture + case 2: + path = SQ_Config::instance()->readEntry("GL view custom texture", ""); + BGpixmap.load(path); + + if(BGpixmap.isNull()) + { + SQ_Config::instance()->writeEntry("GL view background type", 0); + setClearColor(); + return; + } + + BGpixmap.convertDepth(32); + BGpixmap = BGpixmap.swapRGB(); + + changed = true; + break; + + default: ; + } + + // update clear color + qglClearColor(color); + + if(decoded) + updateGL(); +} + +void SQ_GLWidget::removeCurrentParts() +{ + // if tab->broken, 'tab->parts' has no members + if(decoded && !tab->broken) + { + std::vector::iterator itEnd = tab->parts.end(); + + for(std::vector::iterator it = tab->parts.begin();it != itEnd;++it) + { + // delete textures and memory buffers + (*it).removeParts(); + (*it).deleteBuffer(); + } + + tab->parts.clear(); + } +} + +void SQ_GLWidget::removeCurrentTabs() +{ + std::vector::iterator itEnd = tabs.end(); + + for(std::vector::iterator it = tabs.begin();it != itEnd;++it) + (*it).clearParts(); + + tabs.clear(); + tab = &taborig; +} + +void SQ_GLWidget::removeNonCurrentTabs(int index) +{ + std::vector::iterator itEnd = tabs.end(); + Tab tm; + int i = 0; + + for(std::vector::iterator it = tabs.begin();it != itEnd;++it, ++i) + { + if(i == index) + { + tm = *it; + continue; + } + + (*it).clearParts(); + } + + tabs.clear(); + tabs.push_back(tm); + tab = &tabs[0]; +} + +void SQ_GLWidget::startDecoding(const KURL &url) +{ + startDecoding(url.path()); +} + +// Show/hide background for transparent image. +void SQ_GLWidget::toggleDrawingBackground() +{ + SQ_Config::instance()->setGroup("GL view"); + + bool b = SQ_Config::instance()->readBoolEntry("alpha_bkgr", true); + + b = !b; + + SQ_Config::instance()->writeEntry("alpha_bkgr", b); + + updateGL(); +} + +void SQ_GLWidget::createMarks() +{ + mm[0] = QImage(locate("data", "images/marks/mark_1.png")); + mm[1] = QImage(locate("data", "images/marks/mark_2.png")); + mm[2] = QImage(locate("data", "images/marks/mark_3.png")); + mm[3] = QImage(locate("data", "images/marks/mark_4.png")); + + marks = (mm[0].isNull() || mm[1].isNull() || mm[2].isNull() || mm[3].isNull()) ? false : true; + + if(!marks) + return; + + for(int i = 0;i < 4;i++) + { + mm[i] = mm[i].convertDepth(32); + mm[i].setAlphaBuffer(true); + } +} + +/* + * Show current image's width, height and bpp in statusbar. + */ +void SQ_GLWidget::updateCurrentFileInfo() +{ + QString status = QString::fromLatin1("%1x%2@%3") + .arg(tab->finfo.image[tab->current].w) + .arg(tab->finfo.image[tab->current].h) + .arg(tab->finfo.image[tab->current].bpp); + +#ifndef KSQUIRREL_PART + SQ_GLView::window()->sbarWidget("SBDecoded")->setText(status); +#else + t_glv.sbarWidget("SBDecoded")->setText(status); +#endif +} + +// Show/hide tickmarks around the image. +void SQ_GLWidget::toogleTickmarks() +{ + SQ_Config::instance()->setGroup("GL view"); + + bool b = SQ_Config::instance()->readBoolEntry("marks", true); + + b = !b; + + SQ_Config::instance()->writeEntry("marks", b); + + updateGL(); +} + +void SQ_GLWidget::changeSlider(GLfloat z1) +{ +#ifndef KSQUIRREL_PART + GLfloat z = z1 < 0 ? getZoom() : z1; + + int i_zoom = (int)(z * 100); + + slider_zoom->blockSignals(true); + slider_zoom->setValue((i_zoom <= 100) ? i_zoom/5 : (19+i_zoom/50)); + slider_zoom->blockSignals(false); +#endif +} + +void SQ_GLWidget::calcFrameLabelWidth() +{ +#ifndef KSQUIRREL_PART + SQ_GLView::window()->sbarWidget("SBFrame")->setFixedWidth( + SQ_GLView::window()->sbarWidget("SBFrame")->fontMetrics() + .boundingRect(QString::fromLatin1("0%1/0%2").arg(tab->total).arg(tab->total)).width()); +#endif +} + +/* + * Show current page number in multipaged images. + * + * For example: "3/11" means that current page is the third in current image, + * which has 11 pages. + */ +void SQ_GLWidget::frameChanged() +{ +#ifndef KSQUIRREL_PART + SQ_GLView::window()->sbarWidget("SBFrame")->setText(QString::fromLatin1("%1/%2").arg(tab->current+1).arg(tab->total)); +#else + t_glv.sbarWidget("SBFrame")->setText(QString::fromLatin1("%1/%2").arg(tab->current+1).arg(tab->total)); +#endif +} + +void SQ_GLWidget::closeAllTabs() +{ + removeCurrentTabs(); + +#ifndef KSQUIRREL_PART + SQ_GLView::window()->removeTabs(); +#endif +} + +void SQ_GLWidget::closeAllTabsFull() +{ + stopAnimation(); + + closeAllTabs(); + +#ifndef KSQUIRREL_PART + SQ_GLView::window()->resetStatusBar(); + SQ_GLView::window()->tabbar()->hide(); + + KSquirrel::app()->setCaption(QString::null); +#endif + + decoded = false; + m_original = KURL(); + m_expected = KURL(); + + images->clear(); + old_id = -1; + + enableSettingsButton(false); + enableActions(false); + changeSlider(1.0); + + updateGL(); +} + +void SQ_GLWidget::slotPrint() +{ + if(!decoded || tab->broken) + return; + + QImage im((uchar *)tab->parts[tab->current].buffer->data(), tab->parts[tab->current].realw, tab->parts[tab->current].realh, 32, 0, 0, QImage::LittleEndian); + QImage img; + + if(gls->valid() && calcSelection()) + img = im.copy(tab->sx, tab->sy, tab->sw, tab->sh).swapRGB(); + else + { + if(tab->parts[tab->current].realw == tab->parts[tab->current].w && tab->parts[tab->current].realh == tab->parts[tab->current].h) + img = im.swapRGB(); + else + img = im.copy(0, 0, tab->parts[tab->current].w, tab->parts[tab->current].h).swapRGB(); + } + + img.setAlphaBuffer(true); + + KPrinter printer; + + printer.setCreator("KSquirrel"); + + if(printer.setup(this)) + { + QPainter p(&printer); + + QPaintDeviceMetrics mt(&printer); + + QSize sz(img.width(), img.height()); + + if(img.width() > mt.width() || img.height() > mt.height()) + sz.scale(mt.width(), mt.height(), QSize::ScaleMin); + + int cp = printer.numCopies(); + + for(int i = 0;i < cp;i++) + { + p.drawImage(QRect((mt.width()-sz.width())/2, (mt.height()-sz.height())/2, sz.width(), sz.height()), img); + + if(i < cp-1) + printer.newPage(); + } + } +} + +void SQ_GLWidget::copyURL() +{ + if(!decoded || tab->broken) + return; + + QApplication::clipboard()->setText(tab->m_original.prettyURL()); +} diff --git a/ksquirrel/ksquirrelpart/sq_helpwidget.ui b/ksquirrel/ksquirrelpart/sq_helpwidget.ui new file mode 100644 index 0000000..8f92708 --- /dev/null +++ b/ksquirrel/ksquirrelpart/sq_helpwidget.ui @@ -0,0 +1,334 @@ + +SQ_HelpWidget + + + SQ_HelpWidget + + + + 0 + 0 + 512 + 430 + + + + + 3 + 3 + 0 + 0 + + + + Hotkeys + + + false + + + + unnamed + + + 0 + + + + widgetStack1 + + + + WStackPage + + + 0 + + + + unnamed + + + + textLabel2 + + + <p align=center><table><tr><td><b><p align=right>Esc,X,Return</p></b></td><td>close</td></tr><tr><td><b><p align=right>Middle click, F</p></b></td><td>fullscreen</td></tr><tr><td><b><p align=right>Z</p></b></td><td>show 'Zoom' menu</td></tr><tr><td><b><p align=right>/</p></b></td><td>show this help</td></tr><tr><td><b><p align=right>Right click, M, ContextMenu</p></b></td><td>show context menu</td></tr><tr><td><b><p align=right>N</p></b></td><td>toggle filter</td></tr><tr><td><b><p align=right>Shift + Left button</p></b></td><td>select a region</td></tr><tr><td><b><p align=right>Shift + Left</p></b></td><td>previous tab</td></tr><tr><td><b><p align=right>Shift + Right</p></b></td><td>next tab</td></tr><tr><td><b><p align=right>W</p></b></td><td>close tab</td></tr></table></p> + + + WordBreak|AlignTop + + + + + + + WStackPage + + + 1 + + + + unnamed + + + + textLabel3 + + + <p align=center><table><tr><td><b><p align=right>Space, Page Down</p></b></td><td>next image</td></tr><tr><td><b><p align=right>Backspace, Page Up</p></b></td><td>previous image</td></tr><tr><td><b><p align=right>Home</p></b></td><td>first image</td></tr><tr><td><b><p align=right>End</p></b></td><td>last image</td></tr></table></p> + + + WordBreak|AlignTop + + + + + + + WStackPage + + + 2 + + + + unnamed + + + + textLabel4 + + + <p align=center><table><tr><td><b><p align=right>Left, Right, Up, Down</p></b></td><td>move the image</td></tr><tr><td><b><p align=right>Ctrl + Left</p></b></td><td>rotate left</td></tr><tr><td><b><p align=right>Ctrl + Right</p></b></td><td>rotate right</td></tr><tr><td><b><p align=right>Ctrl + Up/Down</p></b></td><td>rotate for 180 degrees up/down</td></tr><tr><td><b><p align=right>Alt + Left/Right</p></b></td><td>rotate for 1 degree left/right</td></tr></table</p> + + + WordBreak|AlignTop + + + + + + + WStackPage + + + 3 + + + + unnamed + + + + textLabel6 + + + <p align=center><table><tr><td><b><p align=right>+/-</p></b></td><td>zoom Nx</td></tr><tr><td><b><p align=right>Ctrl + +/-</p></b></td><td>zoom 2x/0.5x</td></tr><tr><td><b><p align=right>Scroll</p></b></td><td>load next/prev file OR zoom+/zoom-</td></tr><tr><td><b><p align=right>Shift + Scroll</p></b></td><td>zoom+/zoom-</td></tr><tr><td><b><p align=right>Ctrl + Scroll</p></b></td><td>zoom+ 2x/zoom- 2x</td></tr><tr><td><b><p align=right>1..9</p></b></td><td>zoom 1..9x</td></tr><tr><td><b><p align=right>0</p></b></td><td>zoom 10x</td></tr><tr><td><b><p align=right>comma</p></b></td><td>fit width</td></tr><tr><td><b><p align=right>period</p></b></td><td>fit height</td></tr><tr><td><b><p align=right>*</p></b></td><td>fit image</td></tr></table</p> + + + WordBreak|AlignTop + + + + + + + WStackPage + + + 4 + + + + unnamed + + + 0 + + + + textLabel5 + + + <p align=center><table><tr><td><p align=right><b>S</b></p></td><td>save as</td></tr><tr><td><p align=right><b>V</b></p></td><td>flip vertically</td></tr><tr><td><p align=right><b>H</b></p></td><td>flip horizontally</td></tr><tr><td><p align=right><b>R</b></p></td><td>reset</td></tr><tr><td><p align=right><b>P</b></p></td><td>image properties</td></tr><tr><td><p align=right><b>C</b></p></td><td>codec settings</td></tr><tr><td><p align=right><b>L</b></p></td><td>ignore zoom if image is smaller than window</td></tr><tr><td><p align=right><b>I</b></p></td><td>menu with images</td></tr><tr><td><p align=right><b>A</b></p></td><td>stop/start animation</td></tr><tr><td><p align=right><b>B</b></p></td><td>toggle drawing background for transparent images</td></tr><tr><td><p align=right><b>K</b></p></td><td>toggle drawing tickmarks</td></tr><tr><td><p align=right><b>E</b></p></td><td>show menu with external tools</td></tr><tr><td><p align=right><b>Y</b></p></td><td>crop</td></tr><tr><td><p align=right><b>F1</b></p></td><td>first image in multi-paged image</td></tr><tr><td><p align=right><b>F2</b></p></td><td>previous</td></tr><tr><td><p align=right><b>F3</b></p></td><td>next</td></tr><tr><td><p align=right><b>F4</b></p></td><td>last</td></tr></table></p> + + + WordBreak|AlignTop + + + + + + + + buttonGroup + + + + + + true + + + + unnamed + + + 0 + + + 0 + + + + pushButton3 + + + NoFocus + + + General + + + true + + + true + + + true + + + 0 + + + + + pushButton3_2 + + + NoFocus + + + Filing + + + true + + + true + + + 1 + + + + + pushButton3_3 + + + NoFocus + + + Moving + + + true + + + true + + + 2 + + + + + pushButton3_5 + + + NoFocus + + + Current image + + + true + + + true + + + 4 + + + + + pushButton3_4 + + + NoFocus + + + Zoom + + + true + + + true + + + 3 + + + + + + + spacer1 + + + Vertical + + + Expanding + + + + 16 + 16 + + + + + + + + buttonGroup + clicked(int) + widgetStack1 + raiseWidget(int) + + + + pushButton3 + pushButton3_2 + pushButton3_3 + pushButton3_5 + pushButton3_4 + + + qtooltip.h + sq_config.h + sq_helpwidget.ui.h + + + init() + destroy() + event( QEvent * e ) + + + diff --git a/ksquirrel/ksquirrelpart/sq_helpwidget.ui.h b/ksquirrel/ksquirrelpart/sq_helpwidget.ui.h new file mode 100644 index 0000000..844f327 --- /dev/null +++ b/ksquirrel/ksquirrelpart/sq_helpwidget.ui.h @@ -0,0 +1,45 @@ +/**************************************************************************** +** ui.h extension file, included from the uic-generated form implementation. +** +** If you want to add, delete, or rename functions or slots, use +** Qt Designer to update this file, preserving your code. +** +** You should not define a constructor or destructor in this file. +** Instead, write your code in functions called init() and destroy(). +** These will automatically be called by the form's constructor and +** destructor. +*****************************************************************************/ + +/* + * SQ_HelpWidget is a helper widget. It shows hotkeys, which + * are accepted by SQ_GLWidget. Called from SQ_GLWidget. + */ + +void SQ_HelpWidget::init() +{ + setPalette(QToolTip::palette()); + SQ_Config::instance()->setGroup("GL view"); + + int pg = SQ_Config::instance()->readNumEntry("help_id", 0); + + buttonGroup->setButton(pg); + widgetStack1->raiseWidget(pg); +} + +void SQ_HelpWidget::destroy() +{ + SQ_Config::instance()->setGroup("GL view"); + SQ_Config::instance()->writeEntry("help_id", buttonGroup->selectedId()); +} + +bool SQ_HelpWidget::event(QEvent *e) +{ + if(e->type() == QEvent::WindowDeactivate + || e->type() == QEvent::MouseButtonPress + || e->type() == QEvent::KeyPress) + { + reject(); + } + + return QDialog::event(e); +} diff --git a/ksquirrel/ksquirrelpart/sq_iconloader.cpp b/ksquirrel/ksquirrelpart/sq_iconloader.cpp new file mode 100644 index 0000000..698160f --- /dev/null +++ b/ksquirrel/ksquirrelpart/sq_iconloader.cpp @@ -0,0 +1,82 @@ +/*************************************************************************** + sq_iconloader.cpp - description + ------------------- + begin : ??? Aug 20 2005 + copyright : (C) 2005 by Baryshev Dmitry + email : ksquirrel.iv@gmail.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include +#include + +#include "sq_iconloader.h" +#include "sq_iconloader_pixmaps.h" + +SQ_IconLoader * SQ_IconLoader::m_instance = 0; + +SQ_IconLoader::SQ_IconLoader(QObject *parent) : QObject(parent) +{ + m_instance = this; + + fillPixmaps(); +} + +SQ_IconLoader::~SQ_IconLoader() +{} + +QPixmap SQ_IconLoader::loadIcon(const QString& name, KIcon::Group group, int size) const +{ + // try to load from installed icon theme + QPixmap p = KGlobal::iconLoader()->loadIcon(name, group, size, KIcon::DefaultState, 0, true); + + // requested pixmap not found, let's + // try to find it in our pixmaps + if(p.isNull()) + { + if(name == "move_task_up") + p = pixmap_up; + else if(name == "move_task_down") + p = pixmap_down; + else if(name == "display" && size == 32) + p = pixmap_display; + else if(name == "folder" && size == 32) + p = pixmap_folder; + else if(name == "images" && size == 32) + p = pixmap_images; + else if(name == "binary" && size == 32) + p = pixmap_binary; + else if(name == "edit" && size == 32) + p = pixmap_edit; + else + p = KGlobal::iconLoader()->loadIcon("unknown", group, size); + } + + return p; +} + +/* + * Internal. Load all pixmaps. + */ +void SQ_IconLoader::fillPixmaps() +{ + pixmap_up = QPixmap(xpm_up); + pixmap_down = QPixmap(xpm_down); + pixmap_display = QPixmap(xpm_display); + pixmap_folder = QPixmap(xpm_folder); + pixmap_images = QPixmap(xpm_images); + pixmap_binary = QPixmap(xpm_binary); + pixmap_edit = QPixmap(xpm_edit); +} diff --git a/ksquirrel/ksquirrelpart/sq_iconloader.h b/ksquirrel/ksquirrelpart/sq_iconloader.h new file mode 100644 index 0000000..164d918 --- /dev/null +++ b/ksquirrel/ksquirrelpart/sq_iconloader.h @@ -0,0 +1,58 @@ +/*************************************************************************** + sq_iconloader.h - description + ------------------- + begin : ??? Aug 20 2005 + copyright : (C) 2005 by Baryshev Dmitry + email : ksquirrel.iv@gmail.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifndef SQ_ICONLOADER_H +#define SQ_ICONLOADER_H + +#include +#include + +#include + +/* + * SQ_IconLoader represents an icon loader. It tries to load pixmap from + * installed icon theme. If icon was not found, it uses internal pixmaps + * instead. + */ + +class SQ_IconLoader : public QObject +{ + public: + SQ_IconLoader(QObject *parent = 0); + ~SQ_IconLoader(); + + QPixmap loadIcon(const QString &name, KIcon::Group group = KIcon::Desktop, int size = 16) const; + + private: + static SQ_IconLoader *m_instance; + + /* + * Internal. Load all pixmaps. + */ + void fillPixmaps(); + + public: + static SQ_IconLoader* instance() { return m_instance; } + + private: + QPixmap pixmap_up, pixmap_down, + pixmap_display, pixmap_folder, + pixmap_images, pixmap_binary, + pixmap_edit; +}; + +#endif diff --git a/ksquirrel/ksquirrelpart/sq_iconloader_pixmaps.h b/ksquirrel/ksquirrelpart/sq_iconloader_pixmaps.h new file mode 100644 index 0000000..0bc6183 --- /dev/null +++ b/ksquirrel/ksquirrelpart/sq_iconloader_pixmaps.h @@ -0,0 +1,2557 @@ +/*************************************************************************** + sq_iconloader_pixmaps.h - description + ------------------- + begin : 3 2005 + copyright : (C) 2005 by Baryshev Dmitry + email : ksquirrel.iv@gmail.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifndef SQ_ICONLOADER_PIXMAPS +#define SQ_ICONLOADER_PIXMAPS + +static const char * xpm_up[] = { +"22 22 139 2", +" c None", +". c #AE5300", +"+ c #AD5204", +"@ c #B35E10", +"# c #EBD4BF", +"$ c #C78851", +"% c #AD5203", +"& c #F0DDBF", +"* c #FFED80", +"= c #FAEDBF", +"- c #BD7331", +"; c #FFE330", +"> c #FFD900", +", c #FFD710", +"' c #FAECBF", +") c #F0D99F", +"! c #FFE420", +"~ c #FFDC00", +"{ c #FFD700", +"] c #FFD300", +"^ c #FFD210", +"/ c #FAEBBF", +"( c #BD7330", +"_ c #F0DA9F", +": c #FFE410", +"< c #FFDE00", +"[ c #FFDA00", +"} c #FFD600", +"| c #FFD100", +"1 c #FFCD00", +"2 c #FFCC10", +"3 c #FAE9BF", +"4 c #BD7332", +"5 c #FAF0BF", +"6 c #FFE710", +"7 c #FFE100", +"8 c #FFDD00", +"9 c #FFD800", +"0 c #FFD400", +"a c #FFD000", +"b c #FFCB00", +"c c #FFC700", +"d c #FFC710", +"e c #FAE8BF", +"f c #B25D12", +"g c #AE5302", +"h c #FFE910", +"i c #FFE400", +"j c #FFDF00", +"k c #FFDB00", +"l c #FFD200", +"m c #FFCE00", +"n c #FFCA00", +"o c #FFC500", +"p c #FFC100", +"q c #FFC110", +"r c #F0D29F", +"s c #AD5202", +"t c #FAEE8F", +"u c #FFEC10", +"v c #FFE600", +"w c #FFE200", +"x c #FFD500", +"y c #FFCC00", +"z c #FFC800", +"A c #FFC400", +"B c #FFBF00", +"C c #FFBB00", +"D c #FFBB10", +"E c #F0D19F", +"F c #FAEF8F", +"G c #FFED00", +"H c #FFE900", +"I c #FFE500", +"J c #FFE000", +"K c #FFCF00", +"L c #FFC600", +"M c #FFC200", +"N c #FFBE00", +"O c #FFB900", +"P c #FFB500", +"Q c #FFB610", +"R c #F0CF9F", +"S c #B25C15", +"T c #F5E78E", +"U c #FBE802", +"V c #FBE402", +"W c #FBDF02", +"X c #FBDB02", +"Y c #FDDB01", +"Z c #FFC900", +"` c #FFC000", +" . c #F6B104", +".. c #F6AD04", +"+. c #F6A904", +"@. c #F6A504", +"#. c #F5A514", +"$. c #D9A36E", +"%. c #B46107", +"&. c #BC7008", +"*. c #BC6F08", +"=. c #BC6E08", +"-. c #DEA404", +";. c #FFC300", +">. c #D58508", +",. c #BD6506", +"'. c #BD6406", +"). c #BD6306", +"!. c #B95E06", +"~. c #AE5301", +"{. c #D79700", +"]. c #FFBD00", +"^. c #CD7A08", +"/. c #D79600", +"(. c #FFBC00", +"_. c #D79500", +":. c #FFBA00", +"<. c #CD7908", +"[. c #D79400", +"}. c #FFB800", +"|. c #CD7808", +"1. c #D79300", +"2. c #FFB700", +"3. c #CD7708", +"4. c #D79200", +"5. c #FFB300", +"6. c #CD7608", +"7. c #D79100", +"8. c #FFB600", +"9. c #F9AB03", +"0. c #C07008", +"a. c #EDB008", +"b. c #EDAD08", +"c. c #EDA908", +"d. c #EDA608", +"e. c #EDA208", +"f. c #ED9F08", +"g. c #ED9B08", +"h. c #C16807", +" . . + ", +" . @ # $ % ", +" . @ & * = - % ", +" . @ & ; > , ' - % ", +" . @ ) ! ~ { ] ^ / - % ", +" . ( _ : < [ } | 1 2 3 4 + ", +" . ( 5 6 7 8 9 0 a b c d e f g ", +" . ( 5 h i j k { l m n o p q r f s ", +" . ( t u v w < > x | y z A B C D E f s ", +". ( F G H I J ~ 9 ] K b L M N O P Q R S g ", +"g T U V W X Y [ } l 1 Z o ` ...+.@.#.$.+ ", +"% %.&.*.*.=.-.> 0 a y c ;.B >.,.,.'.).!.~. ", +" . . . . . {.{ ] m n L p ].^.. . . . . ", +" . /.x | 1 z A ` (.^.. ", +" . _.0 K b c ;.N :.<.. ", +" . [.l m Z o p ].}.|.. ", +" . 1.a y z A B C 2.|.. ", +" . 1.K n L M N O P 3.. ", +" . 4.1 Z o ` (.}.5.6.. ", +" . 7.y c ;.B :.8.9.6.. ", +" ~.0.a.b.c.d.e.f.g.h.. ", +" ~.g g g g g g g ~. "}; + +static const char * xpm_down[] = { +"22 22 138 2", +" c None", +". c #AE5300", +"+ c #C78950", +"@ c #FFFABF", +"# c #FFF9BF", +"$ c #FFF8BF", +"% c #FFF7BF", +"& c #FFF6BF", +"* c #FFF4BF", +"= c #FFF3BF", +"- c #D7A000", +"; c #FFEA00", +"> c #FFE600", +", c #FFE100", +"' c #FFDD00", +") c #FFD800", +"! c #FFD400", +"~ c #FFCF00", +"{ c #D79000", +"] c #D79F00", +"^ c #FFE800", +"/ c #FFE400", +"( c #FFDF00", +"_ c #FFDB00", +": c #FFD700", +"< c #FFD200", +"[ c #FFCE00", +"} c #D78F00", +"| c #FFE700", +"1 c #FFE200", +"2 c #FFDE00", +"3 c #FFD900", +"4 c #FFD500", +"5 c #FFD000", +"6 c #FFCC00", +"7 c #D78E00", +"8 c #D79E00", +"9 c #FFE500", +"0 c #FFDC00", +"a c #FFD300", +"b c #FFCA00", +"c c #D78D00", +"d c #D79D00", +"e c #FFE300", +"f c #FFDA00", +"g c #FFD600", +"h c #FFCD00", +"i c #FFC900", +"j c #D78C00", +"k c #D79C00", +"l c #FFCB00", +"m c #FFC700", +"n c #D78B00", +"o c #D79B00", +"p c #FFE000", +"q c #FFC500", +"r c #D78A00", +"s c #D79A00", +"t c #FFD100", +"u c #FFC800", +"v c #FFC300", +"w c #BB6F2A", +"x c #C27E40", +"y c #E1AD10", +"z c #FFC600", +"A c #FFC200", +"B c #E19A10", +"C c #B86920", +"D c #D9AF6C", +"E c #F8E843", +"F c #FFF140", +"G c #FFEE40", +"H c #FFEA40", +"I c #FFE110", +"J c #FFC000", +"K c #FFC010", +"L c #FFC940", +"M c #FFC640", +"N c #FFC240", +"O c #FCBB41", +"P c #EAC7A3", +"Q c #B25B01", +"R c #E1B707", +"S c #FBE302", +"T c #FFBE00", +"U c #FFBA00", +"V c #FFB500", +"W c #FFB100", +"X c #FCA902", +"Y c #EA9207", +"Z c #BA5F02", +"` c #E2B506", +" . c #FCDF02", +".. c #FFC100", +"+. c #FFBD00", +"@. c #FFB800", +"#. c #FFB400", +"$. c #FCAC02", +"%. c #EA9407", +"&. c #B25A01", +"*. c #E2B106", +"=. c #FCD902", +"-. c #FFC400", +";. c #FFBF00", +">. c #FFBB00", +",. c #FFB700", +"'. c #FCAE02", +"). c #EA9707", +"!. c #BA6002", +"~. c #EABA07", +"{. c #FCD302", +"]. c #FFB900", +"^. c #FCB102", +"/. c #EA9907", +"(. c #BA6702", +"_. c #EAB607", +":. c #FCCD02", +"<. c #FFBC00", +"[. c #FCB302", +"}. c #E29206", +"|. c #BA6102", +"1. c #BA6602", +"2. c #EAB107", +"3. c #FECA01", +"4. c #FBB502", +"5. c #E29306", +"6. c #B25801", +"7. c #BA6502", +"8. c #ECB006", +"9. c #FEC401", +"0. c #F8B403", +"a. c #E19407", +"b. c #BA6402", +"c. c #ECAB06", +"d. c #F5B305", +"e. c #E19507", +"f. c #C26E03", +"g. c #DD9206", +" . . . . . . . . . ", +" . + @ # $ % & * = + . ", +" . - ; > , ' ) ! ~ { . ", +" . ] ^ / ( _ : < [ } . ", +" . ] | 1 2 3 4 5 6 7 . ", +" . 8 9 , 0 ) a ~ b c . ", +" . d e ( f g < h i j . ", +" . k 1 ' 3 ! 5 l m n . ", +" . o p _ : a [ b q r . ", +" . . . . . s 2 f 4 t 6 u v r . . . . . ", +". w x x x x y ' ) ! ~ l z A B x x x x C . ", +". D E F G H I _ g < h i q J K L M N O P . ", +". Q R S > 1 2 3 4 5 6 m v T U V W X Y Z . ", +" . Q ` .p 0 : a [ b z ..+.@.#.$.%.Z . ", +" . &.*.=.f g t h u -.;.>.,.'.).!.. ", +" . &.~.{.! 5 l m A T ].^./.!.. ", +" . (._.:.[ i q ..<.[.}.|.. ", +" . 1.2.3.u v ;.4.5.6.. ", +" . 7.8.9.A 0.a.6.. ", +" . b.c.d.e.6.. ", +" . f.g.6.. ", +" . . . "}; + +static const char * xpm_binary[] = { +"32 32 246 2", +" c None", +". c #6E6E6E", +"+ c #8E8F8F", +"@ c #898A8B", +"# c #88898B", +"$ c #88898A", +"% c #87888A", +"& c #86878A", +"* c #868789", +"= c #878889", +"- c #878789", +"; c #868788", +"> c #858688", +", c #858687", +"' c #848687", +") c #848587", +"! c #858586", +"~ c #6A6A6A", +"{ c #706F6F", +"] c #F6FAFF", +"^ c #E7EFFF", +"/ c #F0F5FF", +"( c #E9F0FE", +"_ c #E8F0FE", +": c #E3ECFD", +"< c #E4EDFD", +"[ c #DFEAFB", +"} c #E8F0FD", +"| c #E6EFFC", +"1 c #E2ECFB", +"2 c #E1EBFB", +"3 c #D5E3F8", +"4 c #D3E1F8", +"5 c #D1E1F7", +"6 c #D0DFF6", +"7 c #CEDFF6", +"8 c #CDDEF5", +"9 c #CBDDF5", +"0 c #CADCF5", +"a c #C9DBF4", +"b c #C7DAF3", +"c c #C6D9F3", +"d c #C4D8F2", +"e c #C2D7F2", +"f c #C1D6F2", +"g c #E7EEF6", +"h c #696968", +"i c #6F6F6F", +"j c #F3F7FF", +"k c #A0BDF9", +"l c #E1EAFC", +"m c #C8D9F9", +"n c #BBD1F6", +"o c #D7E4FA", +"p c #B6CDF4", +"q c #D0DFF8", +"r c #AEC7F1", +"s c #CBDBF6", +"t c #BAD0F3", +"u c #A7C3EF", +"v c #9ABBEC", +"w c #4E87DC", +"x c #4F86DC", +"y c #4983D9", +"z c #437FD6", +"A c #3D7CD5", +"B c #3878D2", +"C c #3374D1", +"D c #2E72D0", +"E c #296ECE", +"F c #236ACC", +"G c #1C67C9", +"H c #1762C6", +"I c #105EC4", +"J c #0A5AC5", +"K c #E3EAF4", +"L c #F4F8FF", +"M c #9DBCF8", +"N c #C2D4F9", +"O c #ACC6F5", +"P c #A3C0F3", +"Q c #A4C0F1", +"R c #9FBDF0", +"S c #97B9EE", +"T c #99B9ED", +"U c #8FB3EB", +"V c #7EA7E7", +"W c #709EE3", +"X c #578DDE", +"Y c #548BDD", +"Z c #4E87DA", +"` c #4983D7", +" . c #4380D6", +".. c #3E7CD3", +"+. c #3978D2", +"@. c #3476D1", +"#. c #2D72CF", +"$. c #296ECD", +"%. c #236BCB", +"&. c #1E67C9", +"*. c #1763C6", +"=. c #1160C7", +"-. c #E4EBF5", +";. c #6F6F6E", +">. c #FEFFFF", +",. c #E7EFFE", +"'. c #E2EAFC", +"). c #E1EBFC", +"!. c #DEE9FA", +"~. c #DDE8FA", +"{. c #DBE6F9", +"]. c #DEE9FC", +"^. c #DAE6FA", +"/. c #D8E4F8", +"(. c #D8E5F7", +"_. c #D6E3F7", +":. c #D6E2F5", +"<. c #D3E0F3", +"[. c #D1DFF2", +"}. c #D0DEF1", +"|. c #CDDBF0", +"1. c #CCDBEF", +"2. c #CBDAEE", +"3. c #C8D8ED", +"4. c #C7D7ED", +"5. c #C7D8ED", +"6. c #C4D4EB", +"7. c #C0D1E9", +"8. c #C1D3EC", +"9. c #F4F6F8", +"0. c #686868", +"a. c #FFFFFF", +"b. c #FEFEFE", +"c. c #EDECE9", +"d. c #F5F5F3", +"e. c #FEFDFB", +"f. c #FFFEFC", +"g. c #FFFFFC", +"h. c #FFFFFB", +"i. c #FFFEFB", +"j. c #FFFDFA", +"k. c #FFFDF9", +"l. c #FEFCF8", +"m. c #FFFCF8", +"n. c #FCFAF6", +"o. c #EBE8E5", +"p. c #FBF8F4", +"q. c #FCF9F5", +"r. c #FEFAF6", +"s. c #F9F9F8", +"t. c #E1E1E1", +"u. c #BDBDBD", +"v. c #C1C1C1", +"w. c #FAFAFA", +"x. c #F6F6F6", +"y. c #B4B4B4", +"z. c #F2F2F2", +"A. c #FCFCFC", +"B. c #F9F9F9", +"C. c #F7F7F7", +"D. c #F8F8F8", +"E. c #CFCFCF", +"F. c #B6B6B6", +"G. c #D2D2D2", +"H. c #F5F5F5", +"I. c #CACACA", +"J. c #E2E2E2", +"K. c #BEBEBE", +"L. c #EFEFEF", +"M. c #FBFBFB", +"N. c #ECECEC", +"O. c #BCBCBC", +"P. c #D3D3D3", +"Q. c #C2C2C2", +"R. c #F4F4F4", +"S. c #B1B1B1", +"T. c #DEDEDE", +"U. c #BABABA", +"V. c #E3E3E3", +"W. c #F1F1F1", +"X. c #EEEEEE", +"Y. c #FDFDFD", +"Z. c #F0F0F0", +"`. c #F3F3F3", +" + c #EDEDED", +".+ c #E7E7E7", +"++ c #E6E6E6", +"@+ c #C0C0C0", +"#+ c #D8D8D8", +"$+ c #DADADA", +"%+ c #D1D1D1", +"&+ c #E0E0E0", +"*+ c #DFDFDF", +"=+ c #C6C6C6", +"-+ c #A6A6A6", +";+ c #E8E8E8", +">+ c #B5B5B5", +",+ c #EAEAEA", +"'+ c #D4D4D4", +")+ c #DCDCDC", +"!+ c #D5D5D5", +"~+ c #B2B2B2", +"{+ c #CDCDCD", +"]+ c #C3C3C3", +"^+ c #DDDDDD", +"/+ c #D0D0D0", +"(+ c #EBEBEB", +"_+ c #B3B3B3", +":+ c #A7A7A7", +"<+ c #A4A4A4", +"[+ c #D9D9D9", +"}+ c #C7C7C7", +"|+ c #BFBFBF", +"1+ c #DBDBDB", +"2+ c #979797", +"3+ c #909090", +"4+ c #6D6D6D", +"5+ c #ACACAC", +"6+ c #939393", +"7+ c #A9A9A9", +"8+ c #949494", +"9+ c #E4E4E4", +"0+ c #929292", +"a+ c #8E8E8E", +"b+ c #8D8D8D", +"c+ c #8F8F8F", +"d+ c #8C8C8C", +"e+ c #676767", +"f+ c #A2A2A2", +"g+ c #D6D6D6", +"h+ c #9C9C9C", +"i+ c #BBBBBB", +"j+ c #C5C5C5", +"k+ c #717171", +"l+ c #E9E9E9", +"m+ c #CBCBCB", +"n+ c #AFAFAF", +"o+ c #ABABAB", +"p+ c #CECECE", +"q+ c #707070", +"r+ c #B9B9B9", +"s+ c #B0B0B0", +"t+ c #E5E5E5", +"u+ c #6C6C6C", +"v+ c #959595", +"w+ c #8A8A8A", +" . + @ # # # $ $ % % & * * * = - * * ; ; ; > > , , ' ) > ! ~ ", +" { ] ^ / ( _ _ : < [ } | 1 2 3 4 5 6 7 8 9 0 a b c d e f g h ", +" i j k l m n o p q r s t u v w x y z A B C D E F G H I J K h ", +" i L M N O P P Q R S T U V W X Y Z ` ...+.@.#.$.%.&.*.=.-.h ", +" ;.>.,.'.).2 !.~.{.].^./.(._.(.:.<.[.}.|.1.2.3.4.5.6.7.8.9.0. ", +" . a.a.a.a.a.a.a.b.c.d.a.a.a.e.f.g.h.i.j.k.l.m.n.o.p.q.r.s.0. ", +" . a.a.a.a.a.a.a.t.u.v.w.a.x.y.z.A.B.B.C.C.x.D.E.F.G.H.z.D.0. ", +" . a.a.a.a.a.a.a.I.J.K.L.a.M.y.N.A.B.D.C.C.x.D.O.P.Q.R.L.D.0. ", +" . a.a.a.a.a.a.a.R.u.G.a.b.H.S.T.b.D.D.D.x.x.C.J.U.V.W.X.D.0. ", +" . a.a.a.Y.b.a.a.a.a.a.Y.A.A.R.B.w.D.B.Z.B.x.R.x.`.`. +Z.B.0. ", +" . a.a.a.U..+a.a.a.b.b.Y.b.++@+#+w.w.$+u.%+R.C.&+U.Z. +W.B.0. ", +" . a.a.a.O.*+a.a.b.Y.Y.A.a.=+P.@+H.w.v.#+-+Z.C.;+>+,+X.W.B.0. ", +" . a.a.a.Q.'+a.b.b.Y.A.A.b.V.O.P.B.B.)+O.!+R.x.V.~+J.Z.z.B.0. ", +" . a.a.a.B.M.a.b.Y.Y.A.M.w.Y.C.B.D.x.B.`.C.R.z.L.L.L.L.`.B.0. ", +" . a.a.H.Q.{+A.b.Y.A.M.M.M.R.]+W.D.D.++Q.`.`.Z.Z.W.W.Z.R.B.0. ", +" . a.a.^+/+v.(+a.Y.M.M.M.w.C.~+N.D.D.;+_+z.z.W.W.W.W.W.H.B.0. ", +" . a.a.`.Q.I.w.Y.A.A.M.B.w.`.:+$+w.D.V.<+[+x.z.z.`.z.z.x.B.0. ", +" . a.B.Y.C.w.b.Y.Y.b.w.B.B.x.X.Z.H.`.z.,+Z.`.z.R.x.z.z.x.B.0. ", +" . a.R.`.x.D.D.w.z.}+`.D.D.L.|+X.R.H.^+_+1+H.C.&+U.R.H.D.B.0. ", +" . a.x.H.R.R.R.H.Z.>+ +x.x.L.2+;+D.C.~+{+3+Z.w.t.<+H.x.B.B.0. ", +" 4+a.x.H.H.H.H.x.Z.5+/+D.C.W.6+'+M.D.=+7+F.`.B.&+8+9+D.B.B.0. ", +" 4+a.C.x.M.D.x.x.H.z.L.x.C.z.)+(+D.C.R.$+C.D.C.`.N.R.B.A.w.0. ", +" 4+a.C.D.@+9+B.C.Z.Q.W.C.x.C.M.D.x.x.D.M.0+a+a+a+b+b+b+c+d+e+ ", +" 4+a.w.A.f+g+Y.w.z.f+X.w.D.D.D.D.D.D.D.B.c+(+D.x.H.H.M.H.i ", +" 4+a.w.M.h+i+Y.w.Z.0+j+A.D.D.D.D.D.D.D.B.c+L.A.A.b.a.M.k+ ", +" 4+a.w.B.++l+w.w.x.J.l+w.B.w.b.M.B.B.B.w.c+,+H.H.M.B.k+ ", +" 4+a.A.D.m+[+A.A.R.K.g+Y.M.B.g+L.A.w.w.M.c+++L.R.`.k+ ", +" 4+a.a.!+i+n+.+a.|+{+o+(+a.p+7+i+w.M.w.M.a+V.L. +q+ ", +" 4+a.a.*+~+n+X.a.I.r+o+W.a.r+@+s+C.A.M.A.a+9+.+q+ ", +" 4+a.a.a.)+.+a.a.Y.E.t+a.a.x.@+t+a.a.a.a.3+&+i ", +" u+v+6+0+8+6+0+0+6+8+8+0+0+6+v+6+0+0+0+6+w+. ", +" "}; +static const char * xpm_display[] = { +"32 32 488 2", +" c None", +". c #868686", +"+ c #9E9E9E", +"@ c #9D9D9D", +"# c #9C9C9C", +"$ c #9B9B9B", +"% c #9A9A9A", +"& c #666666", +"* c #949494", +"= c #FDFDFD", +"- c #FFFFFF", +"; c #F1F1F1", +"> c #717171", +", c #EAEAEA", +"' c #FFFFFD", +") c #FFFFFC", +"! c #FFFFFA", +"~ c #FFFEFA", +"{ c #FFFEF9", +"] c #FFFDF9", +"^ c #FFFCF9", +"/ c #FFFCF8", +"( c #FEFEFE", +"_ c #C8C8C8", +": c #F5F5F5", +"< c #D7D8DB", +"[ c #7087AE", +"} c #7D98BE", +"| c #8AA7CA", +"1 c #8CA9CB", +"2 c #8FACCD", +"3 c #92B0D0", +"4 c #95B3D2", +"5 c #98B6D4", +"6 c #9BB9D6", +"7 c #9EBCD7", +"8 c #A0BED8", +"9 c #A0BFD8", +"0 c #9BB9D4", +"a c #98B6D3", +"b c #95B3D1", +"c c #92AFCF", +"d c #8EACCD", +"e c #8BA8CA", +"f c #87A5C9", +"g c #85A2C7", +"h c #758FB7", +"i c #899CC0", +"j c #F8F9FA", +"k c #D3D3D3", +"l c #F4F4F4", +"m c #C6C9D0", +"n c #083FA5", +"o c #2A6ECA", +"p c #3B80D5", +"q c #4287D9", +"r c #488EDD", +"s c #4F95E2", +"t c #579DE6", +"u c #5EA4EB", +"v c #64ABEF", +"w c #6AB1F3", +"x c #6EB5F5", +"y c #6EB6F6", +"z c #6DB4F5", +"A c #69B1F2", +"B c #63AAEF", +"C c #5DA3EA", +"D c #559CE6", +"E c #4F94E1", +"F c #478DDC", +"G c #4084D7", +"H c #397ED3", +"I c #3478D0", +"J c #1A5DBF", +"K c #2C5CB7", +"L c #F3F5F8", +"M c #D2D2D2", +"N c #F6F6F6", +"O c #C8CCD3", +"P c #225DB7", +"Q c #397BD1", +"R c #4081D3", +"S c #4788D8", +"T c #4D8FDB", +"U c #5395DF", +"V c #599BE3", +"W c #5EA2E7", +"X c #64A7EA", +"Y c #68ABED", +"Z c #6AAEEF", +"` c #6BAFEF", +" . c #6AAEEE", +".. c #63A7EA", +"+. c #5FA1E6", +"@. c #5294DF", +"#. c #4B8DDB", +"$. c #4586D6", +"%. c #3F80D2", +"&. c #3879CE", +"*. c #2C6EC8", +"=. c #3F73C5", +"-. c #F0F2F6", +";. c #FFFEFD", +">. c #CDD0D7", +",. c #2B66BC", +"'. c #3576CE", +"). c #3D7DD1", +"!. c #4384D5", +"~. c #498AD8", +"{. c #4E90DC", +"]. c #5395E0", +"^. c #5D9FE5", +"/. c #60A3E8", +"(. c #62A5E9", +"_. c #62A4E9", +":. c #60A3E7", +"<. c #5C9FE6", +"[. c #589AE2", +"}. c #4E8FDC", +"|. c #4182D3", +"1. c #3B7CD0", +"2. c #3575CC", +"3. c #296BC7", +"4. c #467AC9", +"5. c #EAEBEF", +"6. c #F1F0EF", +"7. c #CECECE", +"8. c #F8F8F8", +"9. c #CED1D8", +"0. c #2560B9", +"a. c #3072CB", +"b. c #3F7FD2", +"c. c #488AD8", +"d. c #4D8FDC", +"e. c #5294DE", +"f. c #5597E0", +"g. c #589BE2", +"h. c #5A9CE3", +"i. c #599CE3", +"j. c #5597E1", +"k. c #5193DE", +"l. c #4D8EDB", +"m. c #4889D8", +"n. c #4283D4", +"o. c #3C7CD1", +"p. c #3777CD", +"q. c #3271C9", +"r. c #2667C4", +"s. c #4276C6", +"t. c #E1E3E7", +"u. c #E4E3E1", +"v. c #CACACA", +"w. c #F9F9F9", +"x. c #CED2D9", +"y. c #1550AF", +"z. c #2C6CC7", +"A. c #3474CB", +"B. c #3979CE", +"C. c #3D7ED1", +"D. c #4282D4", +"E. c #4788D7", +"F. c #4B8CDA", +"G. c #5092DD", +"H. c #4A8BD9", +"I. c #4687D7", +"J. c #4182D4", +"K. c #3C7DD1", +"L. c #3272CA", +"M. c #2E6DC7", +"N. c #1F5FBF", +"O. c #3467BE", +"P. c #E1E3E6", +"Q. c #E3E2E1", +"R. c #CCCCCC", +"S. c #FBFBFB", +"T. c #D2D6DC", +"U. c #0740A5", +"V. c #1656B9", +"W. c #2F6FC8", +"X. c #3373CB", +"Y. c #3F80D3", +"Z. c #4889D7", +"`. c #4587D6", +" + c #4283D5", +".+ c #3B7BD0", +"++ c #3676CD", +"@+ c #3171C9", +"#+ c #2968C3", +"$+ c #0949B1", +"%+ c #2C5EB7", +"&+ c #E1E0DF", +"*+ c #FCFCFC", +"=+ c #D4D7DE", +"-+ c #0841A5", +";+ c #003BA8", +">+ c #1654B7", +",+ c #2B6BC5", +"'+ c #3171CA", +")+ c #3878CE", +"!+ c #3E7FD1", +"~+ c #3A7BD0", +"{+ c #3878CD", +"]+ c #3070C9", +"^+ c #2C6BC6", +"/+ c #2362C0", +"(+ c #0F4DB2", +"_+ c #0037A6", +":+ c #2D60B9", +"<+ c #E0E2E5", +"[+ c #DFDEDC", +"}+ c #D6D9E0", +"|+ c #0942A6", +"1+ c #003CA9", +"2+ c #0341AB", +"3+ c #0F4DB4", +"4+ c #1E5DBD", +"5+ c #2A69C5", +"6+ c #3374CB", +"7+ c #3676CC", +"8+ c #3778CD", +"9+ c #3576CC", +"0+ c #2C6CC6", +"a+ c #2463C0", +"b+ c #1552B7", +"c+ c #0642AD", +"d+ c #003CA8", +"e+ c #0038A6", +"f+ c #DFE1E4", +"g+ c #DCDBDA", +"h+ c #D7DBE2", +"i+ c #0B44A9", +"j+ c #0443AE", +"k+ c #0C4AB1", +"l+ c #0F4DB3", +"m+ c #1250B5", +"n+ c #1857B9", +"o+ c #205FBE", +"p+ c #2766C2", +"q+ c #2A6AC5", +"r+ c #2E6EC7", +"s+ c #2E6EC8", +"t+ c #2D6DC7", +"u+ c #2767C3", +"v+ c #2161BF", +"w+ c #1A59BA", +"x+ c #114FB4", +"y+ c #0A48B0", +"z+ c #0744AD", +"A+ c #0441AB", +"B+ c #0038A7", +"C+ c #DEDFE2", +"D+ c #D9D8D7", +"E+ c #D9DDE4", +"F+ c #114BAD", +"G+ c #0B4AB2", +"H+ c #1452B6", +"I+ c #1B5ABB", +"J+ c #1F5EBD", +"K+ c #2261C0", +"L+ c #2464C1", +"M+ c #2767C2", +"N+ c #2968C4", +"O+ c #2969C4", +"P+ c #2665C1", +"Q+ c #2262C0", +"R+ c #1756B8", +"S+ c #1351B5", +"T+ c #0A47B0", +"U+ c #003BA9", +"V+ c #DBDDE0", +"W+ c #D6D5D4", +"X+ c #DCE0E6", +"Y+ c #1852B2", +"Z+ c #1250B6", +"`+ c #1B59BB", +" @ c #205EBD", +".@ c #2766C3", +"+@ c #2B6AC6", +"@@ c #2D6EC7", +"#@ c #3070C8", +"$@ c #3272C9", +"%@ c #2867C3", +"&@ c #1A58BA", +"*@ c #1653B7", +"=@ c #114EB4", +"-@ c #0242AE", +";@ c #3063BB", +">@ c #DADCDF", +",@ c #D4D3D2", +"'@ c #DDE1E8", +")@ c #1E58B6", +"!@ c #1857BA", +"~@ c #2160BF", +"{@ c #2665C2", +"]@ c #2F6EC8", +"^@ c #3372CA", +"/@ c #3A7BCF", +"(@ c #3B7BCF", +"_@ c #3677CD", +":@ c #2B6BC6", +"<@ c #215FBE", +"[@ c #1C5ABB", +"}@ c #1654B8", +"|@ c #0848B2", +"1@ c #3567BF", +"2@ c #D9DBDE", +"3@ c #D1D1CF", +"4@ c #DEE2E8", +"5@ c #235DB9", +"6@ c #1D5EBF", +"7@ c #3E7FD2", +"8@ c #4284D4", +"9@ c #4484D5", +"0@ c #0E4EB5", +"a@ c #396CC1", +"b@ c #D8D9DC", +"c@ c #CFCECD", +"d@ c #CDCDCD", +"e@ c #DEE1E7", +"f@ c #2763BC", +"g@ c #2364C2", +"h@ c #3372CB", +"i@ c #4B8DDA", +"j@ c #4C8EDB", +"k@ c #4C8EDA", +"l@ c #498BD9", +"m@ c #3D7ED2", +"n@ c #3373CA", +"o@ c #1353B8", +"p@ c #3C70C3", +"q@ c #D6D8DB", +"r@ c #CDCCCA", +"s@ c #DBDFE5", +"t@ c #1F5EBC", +"u@ c #1C60C2", +"v@ c #266AC7", +"w@ c #2D71CB", +"x@ c #3377CF", +"y@ c #397DD3", +"z@ c #3E83D7", +"A@ c #4389DA", +"B@ c #478DDD", +"C@ c #4A90DE", +"D@ c #4C92DF", +"E@ c #4489DB", +"F@ c #3F85D7", +"G@ c #3A7FD4", +"H@ c #3379D0", +"I@ c #2D71CC", +"J@ c #2063C3", +"K@ c #195CBF", +"L@ c #0A4FB7", +"M@ c #356CC3", +"N@ c #D5D7DA", +"O@ c #CAC9C8", +"P@ c #E9ECEF", +"Q@ c #88AADC", +"R@ c #86ABDF", +"S@ c #8CB1E2", +"T@ c #90B5E4", +"U@ c #93B8E6", +"V@ c #96BBE8", +"W@ c #99BFEA", +"X@ c #9DC2EB", +"Y@ c #9FC4EE", +"Z@ c #A0C6EE", +"`@ c #A1C6EF", +" # c #A0C5EE", +".# c #9EC4ED", +"+# c #9CC2EC", +"@# c #92B7E5", +"## c #8EB3E3", +"$# c #8AAFE0", +"%# c #87ABDD", +"&# c #83A7DC", +"*# c #7BA0D7", +"=# c #92AFDD", +"-# c #D6D7D9", +";# c #C6C6C5", +"># c #CBCBCB", +",# c #FDFDFC", +"'# c #F4F6F8", +")# c #F6F7F8", +"!# c #F4F3F3", +"~# c #F1F2F2", +"{# c #F0F0F0", +"]# c #EFEEEF", +"^# c #EDEDEC", +"/# c #EBEBEB", +"(# c #E9EAEA", +"_# c #E8E8E8", +":# c #E6E6E6", +"<# c #E3E3E3", +"[# c #E2E2E2", +"}# c #E1E1E1", +"|# c #DFDFDF", +"1# c #DCDCDC", +"2# c #DBDBDB", +"3# c #D9D9D9", +"4# c #D7D8D7", +"5# c #D5D6D6", +"6# c #D4D3D3", +"7# c #D0D0D1", +"8# c #CFCFCF", +"9# c #C4C4C4", +"0# c #FBFAFA", +"a# c #F9F7F7", +"b# c #F6F6F4", +"c# c #F4F4F3", +"d# c #ECEBEA", +"e# c #E9E9E8", +"f# c #E8E7E7", +"g# c #E6E5E5", +"h# c #E4E2E3", +"i# c #E2E1E0", +"j# c #E0DFDD", +"k# c #DEDDDC", +"l# c #DBDBDA", +"m# c #D8D9D8", +"n# c #D6D6D5", +"o# c #D4D4D3", +"p# c #D2D2D1", +"q# c #D0CFCF", +"r# c #CECCCC", +"s# c #CBCAC9", +"t# c #A5A5A5", +"u# c #ACACAC", +"v# c #C9C9C9", +"w# c #C7C7C7", +"x# c #D5D5D5", +"y# c #D1D1D1", +"z# c #C1C1C1", +"A# c #B4B4B4", +"B# c #B9B9B9", +"C# c #BBBBBB", +"D# c #BABABA", +"E# c #B8B8B8", +"F# c #BCBCBC", +"G# c #595959", +"H# c #D0D0D0", +"I# c #C3C3C3", +"J# c #C2C2C2", +"K# c #BFBFBF", +"L# c #BEBEBE", +"M# c #878787", +"N# c #3A3A3A", +"O# c #8B8B8B", +"P# c #C6C6C6", +"Q# c #E7E7E7", +"R# c #F3F3F3", +"S# c #5E5E5E", +"T# c #FAFAFA", +"U# c #F2F2F2", +"V# c #DADADA", +"W# c #A8A8A8", +"X# c #787878", +"Y# c #ECECEC", +"Z# c #DDDDDD", +"`# c #E5E5E5", +" $ c #E4E4E4", +".$ c #DEDEDE", +"+$ c #4C4C4C", +"@$ c #F7F7F7", +"#$ c #EDEDED", +"$$ c #D8D8D8", +"%$ c #D7D7D7", +"&$ c #393939", +"*$ c #808080", +"=$ c #EFEFEF", +"-$ c #EEEEEE", +";$ c #D6D6D6", +">$ c #686868", +",$ c #414141", +"'$ c #898989", +")$ c #D4D4D4", +"!$ c #B5B5B5", +"~$ c #757575", +"{$ c #2D2D2D", +"]$ c #454545", +"^$ c #848484", +"/$ c #A4A4A4", +"($ c #A6A6A6", +"_$ c #A3A3A3", +":$ c #979797", +"<$ c #7E7E7E", +"[$ c #606060", +"}$ c #3C3C3C", +" . + @ @ @ @ @ @ @ @ @ # # # # # # # # # $ $ $ % % % $ & ", +" * = - - - - - - - - - - - - - - - - - - - - - - - - - - ; > ", +" , - - ' ) ! ! ! ~ { ] ] ^ / / / ] ] ] ] { { { { { ! ) ( - _ ", +" : - < [ } | 1 2 3 4 5 6 7 8 9 8 7 0 a b c d e f g h i j - k ", +" l - m n o p q r s t u v w x y z A B C D E F G H I J K L - M ", +" N - O P Q R S T U V W X Y Z ` .Y ..+.V @.#.$.%.&.*.=.-.;.M ", +" N - >.,.'.).!.~.{.].V ^./.(.(._.:.<.[.U }.S |.1.2.3.4.5.6.7. ", +" 8.- 9.0.a.&.b.!.c.d.e.f.g.h.h.i.[.j.k.l.m.n.o.p.q.r.s.t.u.v. ", +" w.- x.y.z.A.B.C.D.E.F.d.G.k.k.k.G.T H.I.J.K.p.L.M.N.O.P.Q.R. ", +" S.- T.U.V.W.X.p.1.Y.!.$.S ~.~.~.Z.`. +%..+++@+M.#+$+%+P.&+R. ", +" *+- =+-+;+>+,+'+2.)+1.!+%.R R R %.C.~+{+A.]+^+/+(+_+:+<+[+R. ", +" *+- }+|+1+2+3+4+5+]+6+7+8+)+)+{+p.9+X.]+0+a+b+c+d+e+:+f+g+R. ", +" = - h+i+j+k+l+m+n+o+p+q+M.r+s+s+t+,+u+v+w+x+y+z+A+B+:+C+D+R. ", +" ( - E+F+G+H+n+I+J+K+L+M+N+O+O+N+u+P+Q+J+I+R+S+l+T+U+:+V+W+R. ", +" - - X+Y+Z+`+ @/+.@+@@@#@@+$@$@@+#@M.,+%@a+J+&@*@=@-@;@>@,@R. ", +" - - '@)@!@~@{@q+]@^@7+B./@(@(@/@B._@X.W.:@{@<@[@}@|@1@2@3@R. ", +" - - 4@5@6@u+t+@+++/@7@R 8@9@9@8@J.7@.+p.'+0+.@v+[@0@a@b@c@d@ ", +" - - e@f@g@z.h@{+).n.I.c.i@j@k@F.l@I.n.m@&.n@0+.@~@o@p@q@r@R. ", +" - - s@t@u@v@w@x@y@z@A@B@C@D@D@C@r E@F@G@H@I@v@J@K@L@M@N@O@R. ", +" - - P@Q@R@S@T@U@V@W@X@Y@Z@`@`@ #.#+#W@V@@###$#%#&#*#=#-#;#># ", +" - ,#'#)#N !#~#{#]#^#/#(#_#:#<#[#}#|#1#2#3#4#5#6#M 7#8#_ 9#R. ", +" 7.- ( ,#0#a#b#c#6.d#e#f#g#h#i#j#k#l#m#n#W+W+o#p#q#r#s#_ 2#t# ", +" u#M d@R.>#v#9#w#x#k M y#8#7.d@R.>#v.v.z#A#B#C#D#B#E#F#* ", +" G#w#H#>#v#w#9#I#J#K#L#L#M#N# ", +" O#P#/#H#:#/#_#_#_#Q#Q#_#/#x#:#R#A#S# ", +" y#- - - ; 2#/#: w.w.T#8.U#V#k w.- - - W# ", +" X#- = S.w.N Y#Z#|#`#:# $1#7.v#R..$*+S.- - +$ ", +" S#@$@$U#U#; #$, <#1#2#$$%$2#|#Q#; U#U#T#Y#&$ ", +" *$[#=$=$Y#, , , , , , , /#Y#Y##$=$-$;$>$ ", +" ,$'$C#%$[#<#<# $ $ $ $<#<#[#)$!$~${$ ", +" ]$& ^$% /$($($_$:$<$[$}$ ", +" "}; +static const char * xpm_edit[] = { +"32 32 281 2", +" c None", +". c #C4D0E5", +"+ c #9DAAC1", +"@ c #FBFFFF", +"# c #FFFFFF", +"$ c #FEFFFF", +"% c #F5FAFF", +"& c #EDF3FE", +"* c #E4EBF9", +"= c #D8E1F2", +"- c #C2D0E9", +"; c #A7B2C4", +"> c #FCFFFF", +", c #F8FDFF", +"' c #F2F7FF", +") c #EAF1FD", +"! c #E1E9F7", +"~ c #D5DFF0", +"{ c #DBAC55", +"] c #F2C584", +"^ c #E6AE84", +"/ c #DD9A6F", +"( c #EDF4FE", +"_ c #E6EDFA", +": c #DBD6D4", +"< c #F5BC00", +"[ c #FEE43E", +"} c #FEE8C3", +"| c #FEECD3", +"1 c #EEC5A3", +"2 c #F8FCFF", +"3 c #F1F7FF", +"4 c #E9EFFC", +"5 c #E6B76B", +"6 c #FEE600", +"7 c #FECA00", +"8 c #FEB610", +"9 c #FEC451", +"0 c #FECB93", +"a c #C15B1D", +"b c #FAFEFF", +"c c #F3F9FF", +"d c #EBEAED", +"e c #F5C40F", +"f c #FEB600", +"g c #FEAF00", +"h c #FE9610", +"i c #F98219", +"j c #AF725E", +"k c #F5F9FF", +"l c #EDC07F", +"m c #FDDE00", +"n c #FED201", +"o c #FEB001", +"p c #FEAC01", +"q c #FE871C", +"r c #E1701E", +"s c #CED1E2", +"t c #9EABC1", +"u c #F7FBFF", +"v c #F5C120", +"w c #FEBB07", +"x c #FEB306", +"y c #FE9C0E", +"z c #AF684C", +"A c #98A9C5", +"B c #FDFFFF", +"C c #F3CF9F", +"D c #FDE005", +"E c #FEDB06", +"F c #FEB70D", +"G c #FEB30C", +"H c #FE8C1C", +"I c #E06510", +"J c #B5B1C1", +"K c #B4C3DC", +"L c #AEBEDB", +"M c #8495B1", +"N c #F5B824", +"O c #FEE80D", +"P c #FEC613", +"Q c #FEB913", +"R c #FEA918", +"S c #FE8E23", +"T c #C7805B", +"U c #BBC9E0", +"V c #B9C6DF", +"W c #B5C5E0", +"X c #FBE1BF", +"Y c #FCDC15", +"Z c #FEE117", +"` c #FEBE1C", +" . c #FEBD19", +".. c #FE9929", +"+. c #E9781D", +"@. c #BFA9AC", +"#. c #C2CFE5", +"$. c #C1CDE4", +"%. c #BDCBE5", +"&. c #F8C449", +"*. c #FEEB22", +"=. c #FED123", +"-. c #FEC023", +";. c #FEB128", +">. c #FE9A34", +",. c #CD7947", +"'. c #C9D4E9", +"). c #C7D2E7", +"!. c #C6D2E6", +"~. c #C3D0E8", +"{. c #FDEACF", +"]. c #F9D121", +"^. c #FEE72C", +"/. c #FEC42E", +"(. c #FEC32A", +"_. c #FEA938", +":. c #F59031", +"<. c #C5A5A3", +"[. c #CED9EC", +"}. c #CCD7EA", +"|. c #CBD7EA", +"1. c #C8D5EC", +"2. c #F8CE6C", +"3. c #FEED39", +"4. c #FED837", +"5. c #FEC835", +"6. c #FEBE37", +"7. c #FEA645", +"8. c #D06F31", +"9. c #D2DCEF", +"0. c #D0DBED", +"a. c #CEDAF0", +"b. c #FEF1DF", +"c. c #F9C828", +"d. c #FEEC44", +"e. c #FECE3F", +"f. c #FECA3C", +"g. c #FEB649", +"h. c #F9A247", +"i. c #C9A098", +"j. c #D9E2F3", +"k. c #D7E1F2", +"l. c #D4DEF0", +"m. c #D4DDEF", +"n. c #D2DEF2", +"o. c #F3CD87", +"p. c #FEF054", +"q. c #FEE04D", +"r. c #FECE48", +"s. c #FECA47", +"t. c #FEB258", +"u. c #D87833", +"v. c #DEE6F5", +"w. c #DDE5F4", +"x. c #DBE4F3", +"y. c #D8E1F1", +"z. c #D5E0F4", +"A. c #F2F1EF", +"B. c #FAD148", +"C. c #FEF15F", +"D. c #FED654", +"E. c #FED150", +"F. c #FEC35B", +"G. c #F9AF58", +"H. c #CC947F", +"I. c #E1E9F8", +"J. c #DDE6F4", +"K. c #DCE5F4", +"L. c #DAE4F3", +"M. c #D9E3F6", +"N. c #F6FBFF", +"O. c #F5D193", +"P. c #FDEC66", +"Q. c #FEE766", +"R. c #FED55C", +"S. c #FED259", +"T. c #FEBF6B", +"U. c #E2914A", +"V. c #E0DFE9", +"W. c #E4EBF8", +"X. c #E2EAF8", +"Y. c #DFE7F7", +"Z. c #7C8CA8", +"`. c #F9FEFF", +" + c #F8C74E", +".+ c #FEF37A", +"++ c #FEDC69", +"@+ c #FED864", +"#+ c #FECF6B", +"$+ c #FEC573", +"%+ c #CD8968", +"&+ c #E7EEFB", +"*+ c #E5ECF9", +"=+ c #E3EBF9", +"-+ c #DBE3F1", +";+ c #D2D9E9", +">+ c #CBD2E3", +",+ c #C6CFE3", +"'+ c #7786A3", +")+ c #F9FDFF", +"!+ c #F5B651", +"~+ c #FEEE86", +"{+ c #FEDC70", +"]+ c #FEDA6E", +"^+ c #FECE7D", +"/+ c #E4964E", +"(+ c #E2D8DC", +"_+ c #E3E9F6", +":+ c #D8DEED", +"<+ c #CFD7E5", +"[+ c #CCD2E2", +"}+ c #CAD1E2", +"|+ c #CAD1E1", +"1+ c #C8D1E5", +"2+ c #EEAB59", +"3+ c #FEEBCE", +"4+ c #FEE4A4", +"5+ c #FEDD8D", +"6+ c #FBD08B", +"7+ c #CB9373", +"8+ c #D7DCEA", +"9+ c #D2D8E6", +"0+ c #CFD6E5", +"a+ c #CED5E4", +"b+ c #CDD4E4", +"c+ c #C9D0E2", +"d+ c #C9D2E5", +"e+ c #E7A259", +"f+ c #F8E7D0", +"g+ c #C0856A", +"h+ c #D0D0DA", +"i+ c #D4DAE7", +"j+ c #D0D7E5", +"k+ c #CDD4E3", +"l+ c #CCD3E3", +"m+ c #F7FDFF", +"n+ c #C6966D", +"o+ c #F5DBC0", +"p+ c #B67252", +"q+ c #D3D2DB", +"r+ c #D8DDE9", +"s+ c #D5DAE8", +"t+ c #D1D8E6", +"u+ c #CBD2E2", +"v+ c #CAD2E5", +"w+ c #936D5C", +"x+ c #978585", +"y+ c #B88571", +"z+ c #D9DFE9", +"A+ c #D8DEE9", +"B+ c #D7DCE9", +"C+ c #D5DAE7", +"D+ c #CDD3E4", +"E+ c #CCD4E7", +"F+ c #8D6050", +"G+ c #AA7A69", +"H+ c #DBE0E9", +"I+ c #D3D9E7", +"J+ c #CFD5E4", +"K+ c #D4DBEA", +"L+ c #DFE9FA", +"M+ c #F4F9FC", +"N+ c #BF968A", +"O+ c #E2E6EE", +"P+ c #DADFE9", +"Q+ c #D6DBE8", +"R+ c #D9DFEC", +"S+ c #DFE6F3", +"T+ c #E3EBF8", +"U+ c #E0E9FB", +"V+ c #F7FCFF", +"W+ c #F4F9FF", +"X+ c #F2F8FF", +"Y+ c #F0F6FF", +"Z+ c #EBF1FC", +"`+ c #E7EEFA", +" @ c #E4ECF9", +".@ c #E1E8F7", +"+@ c #E0EAFC", +"@@ c #E9F0FC", +"#@ c #F4FDFF", +". . . . . . . . . . . . . . . + ", +". @ # # # # # # # # $ % & * = - ; ", +". > # # # # # # # # , ' ) ! ~ { ] ^ / ", +". > # # # # # # # # @ % ( _ : < [ } | 1 ", +". > # # # # # # # # $ 2 3 4 5 6 7 8 9 0 a ", +". > # # # # # # # # # b c d e 6 f g h i j ", +". > # # # # # # # # # > k l m n o p q r s t ", +". > # # # # # # # # # > u v 6 w x y q z A A A ", +". > # # # # # # # # # B C D E F G H I J K L M ", +". > # # # # # # # # # # N O P Q R S T U V W M ", +". > # # # # # # # # # X Y Z ` ...+.@.#.$.%.M ", +". > # # # # # # # # # &.*.=.-.;.>.,.'.).!.~.M ", +". > # # # # # # # # {.].^./.(._.:.<.[.}.|.1.M ", +". > # # # # # # # # 2.3.4.5.6.7.8.~ 9.0.0.a.M ", +". > # # # # # # # b.c.d.e.f.g.h.i.j.k.l.m.n.M ", +". > # # # # # # B o.p.q.r.s.t.u.v.w.x.= y.z.M ", +". > # # # # # > A.B.C.D.E.F.G.H.I.v.J.K.L.M.M ", +". > # # # # # N.O.P.Q.R.S.T.U.V.W.X.Y.v.J.l.Z. ", +". > # # # # `., +.+++@+#+$+%+&+*+=+-+;+>+,+'+ ", +". > # # # # )+, !+~+{+]+^+/+(+_+:+<+[+}+|+1+'+ ", +". > # # # > `.`.2+3+4+5+6+7+8+9+0+a+b+}+c+d+'+ ", +". > # # # > `., e+| | f+g+h+i+9+j+0+k+l+>+d+'+ ", +". > # # # @ `.m+n+| o+p+q+r+s+9+t+0+a+u+l+v+'+ ", +". > # # $ b `., w+x+y+z+A+B+C+9+j+0+D+u+l+E+Z. ", +". > # # $ b `., F+G+H+z+A+r+i+I+j+0+J+K+-+L+M ", +". > # # > b , M+N+O+P+z+A+Q+i+9+R+S+T+X.! U+M ", +". > # # `.`., V+W+W+X+3 Y+Z+W.`+_ @X.X..@+@M ", +". > # # `.`., V+W+W+X+3 Y+& ) @@_ @X.X..@+@M ", +". #@# # `.`., V+W+W+X+3 Y+& ) @@_ @X.X..@+@M ", +". M M M M M M M M M M M M M M M M M M M M M M ", +" ", +" "}; +static const char * xpm_folder[] = { +"32 32 465 2", +" c None", +". c #2F69EF", +"+ c #1650E9", +"@ c #3D76F2", +"# c #5E91FD", +"$ c #104AEB", +"% c #3F7AF4", +"& c #5E93FD", +"* c #0043FF", +"= c #0541F5", +"- c #1243E3", +"; c #3776F5", +"> c #95B9FE", +", c #0047FF", +"' c #003BFF", +") c #0D3DE5", +"! c #B0B0D3", +"~ c #D6D6E9", +"{ c #C6C6E0", +"] c #AEAED1", +"^ c #2C6FF7", +"/ c #85AFFC", +"( c #0651FF", +"_ c #0046FF", +": c #0042FF", +"< c #0039FF", +"[ c #0434F3", +"} c #0D38DB", +"| c #CECEE4", +"1 c #FEFEFF", +"2 c #F9F9FC", +"3 c #E0E0EE", +"4 c #CBCBE3", +"5 c #A7AED8", +"6 c #2E74F9", +"7 c #8EB5FA", +"8 c #135FFF", +"9 c #054FFF", +"0 c #0041FF", +"a c #002DFF", +"b c #082FE3", +"c c #B8B8D8", +"d c #F0F6FF", +"e c #4687FB", +"f c #B9D3FD", +"g c #6797F2", +"h c #4E80EE", +"i c #2E68F0", +"j c #1255F7", +"k c #0040FF", +"l c #0037FF", +"m c #002BFF", +"n c #0020FB", +"o c #082BD6", +"p c #D8D8EA", +"q c #488CFD", +"r c #91BBFD", +"s c #91BCFF", +"t c #7AABFF", +"u c #6CA0FF", +"v c #5C90FB", +"w c #4C7FF3", +"x c #4172EE", +"y c #2B5AEF", +"z c #1740F5", +"A c #001CFF", +"B c #021EEB", +"C c #0524CE", +"D c #BFBFDC", +"E c #629FFF", +"F c #95BFFE", +"G c #9FC8FF", +"H c #88B6FF", +"I c #78A9FF", +"J c #6A9FFF", +"K c #6196FF", +"L c #5E92FF", +"M c #5E8EFF", +"N c #5A84FC", +"O c #5070F5", +"P c #445BEE", +"Q c #1B34F3", +"R c #031FD6", +"S c #B6B6D6", +"T c #E2E2EF", +"U c #498EFE", +"V c #C0DDFF", +"W c #97C2FF", +"X c #85B3FF", +"Y c #76A7FF", +"Z c #699CFF", +"` c #6095FF", +" . c #5E91FF", +".. c #5E8DFF", +"+. c #5E86FF", +"@. c #5E7FFF", +"#. c #4A60F1", +"$. c #0822FA", +"%. c #0018F9", +"&. c #0119CB", +"*. c #C5C5DF", +"=. c #FBFBFD", +"-. c #5495FD", +";. c #B9D8FE", +">. c #92BEFE", +",. c #82B1FE", +"'. c #73A4FE", +"). c #669AFE", +"!. c #5E92FE", +"~. c #5D90FE", +"{. c #5D8BFE", +"]. c #5E85FF", +"^. c #5A78FC", +"/. c #3249EC", +"(. c #0017FE", +"_. c #0017FF", +":. c #0017EE", +"<. c #0013C4", +"[. c #ECECF5", +"}. c #F8F8FB", +"|. c #4689FC", +"1. c #B6D6FD", +"2. c #8FBCFD", +"3. c #7FAEFD", +"4. c #6FA2FD", +"5. c #6498FD", +"6. c #5C91FD", +"7. c #5C8EFD", +"8. c #5C89FD", +"9. c #5E84FF", +"0. c #4B67F2", +"a. c #1129EF", +"b. c #0016FA", +"c. c #0014DF", +"d. c #0011C0", +"e. c #CFCFE5", +"f. c #FDFDFE", +"g. c #F6F6FA", +"h. c #E7EDFA", +"i. c #4587FB", +"j. c #B3D3FD", +"k. c #8CB8FD", +"l. c #7BABFD", +"m. c #6D9FFD", +"n. c #6196FD", +"o. c #5B90FD", +"p. c #5B8DFD", +"q. c #5A80FC", +"r. c #304FEB", +"s. c #0017E3", +"t. c #0017F1", +"u. c #0019FF", +"v. c #4157DE", +"w. c #BBBBD9", +"x. c #F3F3F9", +"y. c #E4EBF9", +"z. c #98BFFC", +"A. c #9AC4FC", +"B. c #88B6FC", +"C. c #78A8FC", +"D. c #6A9CFC", +"E. c #5F93FC", +"F. c #5A8EFC", +"G. c #5A8CFC", +"H. c #5E89FF", +"I. c #4F72F5", +"J. c #1E46F4", +"K. c #1139F9", +"L. c #0828F1", +"M. c #0017E7", +"N. c #0019EF", +"O. c #A6B8FE", +"P. c #4A5DD8", +"Q. c #F1F1F7", +"R. c #E2E8F7", +"S. c #468BFD", +"T. c #97C0FD", +"U. c #AED2FB", +"V. c #96C0FB", +"W. c #85B2FB", +"X. c #75A6FB", +"Y. c #679AFB", +"Z. c #5D91FB", +"`. c #598DFB", +" + c #5C8CFD", +".+ c #5C87FD", +"++ c #395FEE", +"@+ c #153FF8", +"#+ c #1640FF", +"$+ c #133DFF", +"%+ c #0B39FD", +"&+ c #8EA6FA", +"*+ c #FCFCFE", +"=+ c #1F34CC", +"-+ c #C2C2DD", +";+ c #F0F0F7", +">+ c #EEEEF6", +",+ c #E0E6F6", +"'+ c #478CFD", +")+ c #9BC4FD", +"!+ c #BDDEFB", +"~+ c #A6CCFB", +"{+ c #92BDFB", +"]+ c #81AFFB", +"^+ c #72A2FB", +"/+ c #6598FB", +"(+ c #5B8FFB", +"_+ c #588CFB", +":+ c #5D8DFE", +"<+ c #5078F5", +"[+ c #2551F3", +"}+ c #1541FB", +"|+ c #113FFF", +"1+ c #0B3CFF", +"2+ c #557CFE", +"3+ c #FCFCFD", +"4+ c #E8EBFA", +"5+ c #1328C8", +"6+ c #EBEBF4", +"7+ c #468CFD", +"8+ c #A1C8FE", +"9+ c #D1ECFB", +"0+ c #B5D8FA", +"a+ c #A1C9FA", +"b+ c #8FB9FA", +"c+ c #7DABFA", +"d+ c #6EA0FA", +"e+ c #6295FA", +"f+ c #588DFA", +"g+ c #5A8DFC", +"h+ c #5B8BFE", +"i+ c #3964F0", +"j+ c #1146F9", +"k+ c #0D40FE", +"l+ c #0B3DFF", +"m+ c #F9F9FD", +"n+ c #CFD0F1", +"o+ c #091CC2", +"p+ c #C8C8E1", +"q+ c #E9E9F3", +"r+ c #E8E8F3", +"s+ c #3D87FF", +"t+ c #EDF9FD", +"u+ c #D5EBFB", +"v+ c #BDD8FB", +"w+ c #A3C6FB", +"x+ c #8EB6FB", +"y+ c #7BA7FB", +"z+ c #6999FB", +"A+ c #5A8DFB", +"B+ c #4E83FB", +"C+ c #4980FE", +"D+ c #396DFA", +"E+ c #1C53F7", +"F+ c #0F46FD", +"G+ c #0C3FFF", +"H+ c #4872FE", +"I+ c #F8F8FC", +"J+ c #F8F8FD", +"K+ c #D8DBF5", +"L+ c #1528C6", +"M+ c #F7F7FB", +"N+ c #E7E7F2", +"O+ c #E6E6F1", +"P+ c #73A6F9", +"Q+ c #A1C6FD", +"R+ c #D1E7FB", +"S+ c #B8D5FB", +"T+ c #A1C3FB", +"U+ c #8CB2FB", +"V+ c #78A3FB", +"W+ c #6695FB", +"X+ c #5688FB", +"Y+ c #4B81FD", +"Z+ c #477CFF", +"`+ c #2F63F5", +" @ c #134DFA", +".@ c #1046FF", +"+@ c #2E5DFE", +"@@ c #E4E9FB", +"#@ c #F6F6FB", +"$@ c #F7F7FC", +"%@ c #E8E8F7", +"&@ c #283ACB", +"*@ c #EDEDF5", +"=@ c #E3E3F0", +"-@ c #D5DCF1", +";@ c #4586FB", +">@ c #CEE2FC", +",@ c #B3D1FB", +"'@ c #9EC0FB", +")@ c #88B0FB", +"!@ c #75A1FB", +"~@ c #6392FB", +"{@ c #5386FB", +"]@ c #4C82FE", +"^@ c #3F75FB", +"/@ c #225BF7", +"(@ c #134DFC", +"_@ c #3163FE", +":@ c #E3E7FB", +"<@ c #F5F5FB", +"[@ c #F3F3FB", +"}@ c #394BD0", +"|@ c #C3C3DE", +"1@ c #C0C0DC", +"2@ c #D7D7E9", +"3@ c #7DA9F7", +"4@ c #82ACFA", +"5@ c #B5D1FA", +"6@ c #99BDFA", +"7@ c #84ACFA", +"8@ c #729EFA", +"9@ c #6090FA", +"0@ c #5286FB", +"a@ c #4C82FF", +"b@ c #366AF6", +"c@ c #1954F9", +"d@ c #1D57FE", +"e@ c #E1E6FA", +"f@ c #F2F2F9", +"g@ c #F2F2FA", +"h@ c #F3F3FA", +"i@ c #3F52D3", +"j@ c #3572E7", +"k@ c #B3BFE6", +"l@ c #C3C5E2", +"m@ c #D2D2E7", +"n@ c #417CF5", +"o@ c #B9D2FB", +"p@ c #98BDFB", +"q@ c #81AAFA", +"r@ c #6D9BFA", +"s@ c #5D8EFA", +"t@ c #5387FD", +"u@ c #457AFB", +"v@ c #2862F7", +"w@ c #225DFB", +"x@ c #BFCFF9", +"y@ c #F0F0F9", +"z@ c #F1F1F9", +"A@ c #7884E0", +"B@ c #2470FA", +"C@ c #CADBF8", +"D@ c #D0DBF3", +"E@ c #BCCBED", +"F@ c #B5C3E9", +"G@ c #B5BEE3", +"H@ c #C8CAE3", +"I@ c #A0B3E9", +"J@ c #4A7FF3", +"K@ c #B1CFFF", +"L@ c #86B0FF", +"M@ c #709FFD", +"N@ c #5F90FD", +"O@ c #5388FF", +"P@ c #3C72F7", +"Q@ c #2864F9", +"R@ c #BFCEF8", +"S@ c #EDEDF7", +"T@ c #EDEDF8", +"U@ c #EEEEF8", +"V@ c #818DE3", +"W@ c #2776FF", +"X@ c #A2C6FE", +"Y@ c #F0F7FF", +"Z@ c #E2EEFF", +"`@ c #D5E7FF", +" # c #C0D7F9", +".# c #AEC8F4", +"+# c #9CBBF0", +"@# c #9AB5E9", +"## c #4A7BEB", +"$# c #80A4F5", +"%# c #81A9F9", +"&# c #6B9AFB", +"*# c #6092FF", +"=# c #4E83FC", +"-# c #2E68F7", +";# c #A2BBF7", +"># c #E9E9F7", +",# c #EBEBF7", +"'# c #ECECF7", +")# c #959FE7", +"!# c #327FFE", +"~# c #86B3FD", +"{# c #E1EDFE", +"]# c #C9E0FF", +"^# c #BCD8FF", +"/# c #AFD1FF", +"(# c #9FC5FB", +"_# c #85B0F6", +":# c #275EEB", +"<# c #90B0F7", +"[# c #5387F8", +"}# c #497DF6", +"|# c #4377F6", +"1# c #99B5F6", +"2# c #E7E7F5", +"3# c #E8E8F6", +"4# c #B9BFEF", +"5# c #081CC3", +"6# c #2D70F7", +"7# c #7AA6F9", +"8# c #CADEFE", +"9# c #A2CAFF", +"0# c #96C2FF", +"a# c #72A4FA", +"b# c #2F5EE7", +"c# c #76A2FB", +"d# c #3875FB", +"e# c #8DACF7", +"f# c #E3E3F4", +"g# c #E4E4F4", +"h# c #E4E4F5", +"i# c #E6E6F5", +"j# c #BEC4F1", +"k# c #081CC4", +"l# c #2763EF", +"m# c #6D99F5", +"n# c #B3D1FD", +"o# c #89BBFF", +"p# c #5286F3", +"q# c #345FE5", +"r# c #8CB0FB", +"s# c #E1E1F3", +"t# c #E2E2F3", +"u# c #E2E4F7", +"v# c #081DC4", +"w# c #2156E8", +"x# c #618CF1", +"y# c #9CC3FD", +"z# c #7FB3FF", +"A# c #3567EB", +"B# c #5675E5", +"C# c #DEDEF2", +"D# c #E0E0F2", +"E# c #E3E6F8", +"F# c #1E34CC", +"G# c #1B49E1", +"H# c #5580EE", +"I# c #87B5FC", +"J# c #73ACFF", +"K# c #2958E5", +"L# c #7D93E9", +"M# c #DEDEF1", +"N# c #E4E7F9", +"O# c #1F35CD", +"P# c #163CDA", +"Q# c #4973E9", +"R# c #73A8FC", +"S# c #6CA7FF", +"T# c #143AD9", +"U# c #8C9CE9", +"V# c #3C52D6", +"W# c #0012C0", +"X# c #1130D2", +"Y# c #4067E5", +"Z# c #6095F8", +"`# c #1032D4", +" $ c #2F48D5", +".$ c #0014C2", +"+$ c #0C25CA", +"@$ c #0D2CD0", +"#$ c #0117C5", +" . + ", +" @ # $ ", +" % & * = - ", +" ; > , * ' ) ", +" ! ~ { ] ^ / ( _ : < [ } ", +" | 1 1 2 3 4 5 6 7 8 9 _ 0 < a b ", +" c 2 1 1 1 1 d e f g h i j k l m n o ", +" p 1 1 1 1 d q r s t u v w x y z A B C ", +" D 2 1 1 1 1 E F G H I J K L M N O P Q R ", +" S T 1 1 1 1 1 U V W X Y Z ` ...+.@.#.$.%.&. ", +" *.1 =.=.=.=.=.-.;.>.,.'.).!.~.{.].^./.(._.:.<. ", +" c [.=.}.}.}.}.}.|.1.2.3.4.5.6.7.8.9.0.a.b._._.c.d. ", +" e.f.g.g.g.g.g.h.i.j.k.l.m.n.o.p.8.q.r.s.t._._.u.v.d. ", +" w.g.g.x.x.x.x.y.i.z.A.B.C.D.E.F.G.H.I.J.K.L.M.N.O.f.P. ", +" p =.Q.Q.Q.Q.R.S.T.U.V.W.X.Y.Z.`. +.+++@+#+$+%+&+*+f.f.=+ ", +" -+=.;+>+>+>+,+'+)+!+~+{+]+^+/+(+_+:+<+[+}+|+1+2+=.3+3+3+4+5+", +" T g.6+6+6+6+7+8+9+0+a+b+c+d+e+f+g+h+i+j+k+l+2+m+m+=.=.=.n+o+", +" p+f.q+r+r+r+r+s+t+u+v+w+x+y+z+A+B+C+D+E+F+G+H+I+I+J+J+m+K+L+ ", +"-+6+M+N+O+O+O+O+P+Q+R+S+T+U+V+W+X+Y+Z+`+ @.@+@@@#@M+$@$@%@&@ ", +"{ ;+1 1 g.*@O+=@-@;@>@,@'@)@!@~@{@]@^@/@(@_@:@<@<@<@#@[@}@d. ", +" |@1@2@6+=.1 2 ;+3@4@5@6@7@8@9@0@a@b@c@d@e@f@g@g@h@g@i@d. ", +" j@k@l@m@T g.1 n@o@p@q@r@s@t@u@v@w@x@y@y@z@z@z@A@d. ", +" B@C@D@E@F@G@H@I@J@K@L@M@N@O@P@Q@R@S@T@T@U@f@V@d. ", +" W@X@Y@Z@`@ #.#+#@###$#%#&#*#=#-#;#>#,#,#'#U@)#d. ", +" !#~#{#Z@`@]#^#/#(#_#:#<#[#}#|#1#2#2#3#3#'#4#5# ", +" 6#7#8#]#^#/#9#0#a#b#c#d#e#f#g#h#i#>#j#k# ", +" l#m#n#/#9#0#o#p#q#r#s#s#t#t#g#u#v# ", +" w#x#y#0#o#z#A#B#t#C#D#t#E#F# ", +" G#H#I#z#J#K#L#M#C#N#O# ", +" P#Q#R#S#T#U#z@V#W# ", +" X#Y#Z#`# $.$ ", +" +$@$#$ "}; + +static const char * xpm_images[] = { +"32 32 557 2", +" c None", +". c #C4D0E5", +"+ c #9DAAC1", +"@ c #FBFFFF", +"# c #FFFFFF", +"$ c #FEFFFF", +"% c #F5FAFF", +"& c #EDF3FE", +"* c #E4EBF9", +"= c #D8E1F2", +"- c #C2D0E9", +"; c #ACB7CA", +"> c #FCFFFF", +", c #F8FDFF", +"' c #F2F7FF", +") c #EAF1FD", +"! c #E1E9F7", +"~ c #D5DFF0", +"{ c #BFCCE3", +"] c #EBF4FF", +"^ c #A6B2C6", +"/ c #EDF4FE", +"( c #E6EDFA", +"_ c #D9E2F2", +": c #C2CEE5", +"< c #F0F6FF", +"[ c #DCE7F9", +"} c #A6B2C8", +"| c #F8FCFF", +"1 c #F1F7FF", +"2 c #E9EFFC", +"3 c #DCE5F4", +"4 c #C4D0E6", +"5 c #E8EEFB", +"6 c #DBE5F9", +"7 c #A7B3C9", +"8 c #FAFEFF", +"9 c #F3F9FF", +"0 c #EBF1FD", +"a c #DFE7F6", +"b c #C6D1E5", +"c c #FDFFFF", +"d c #ECF2FD", +"e c #DEE9FB", +"f c #A9B5CA", +"g c #C3C4CD", +"h c #F3EADD", +"i c #EFD9C2", +"j c #E4C09A", +"k c #E4C29E", +"l c #E5C6A4", +"m c #F0DECC", +"n c #F5EADF", +"o c #F7EFE7", +"p c #FBF7F3", +"q c #F5F9FF", +"r c #E3EBF9", +"s c #BECBE1", +"t c #F3F5FB", +"u c #ECF2F9", +"v c #E4EBF7", +"w c #D8E1F0", +"x c #D0DCF1", +"y c #A1AEC5", +"z c #BF6300", +"A c #C1721B", +"B c #C26F14", +"C c #BD6F19", +"D c #B76B1A", +"E c #BD701D", +"F c #C0731F", +"G c #BB6E18", +"H c #B6660F", +"I c #BC7529", +"J c #D1A273", +"K c #EDDBC9", +"L c #F6F3ED", +"M c #F7FBFF", +"N c #E8EFFC", +"O c #C8D4E7", +"P c #98A9C5", +"Q c #C16601", +"R c #C6751D", +"S c #CF8C41", +"T c #D9AB7A", +"U c #CAB8A7", +"V c #B6B8C3", +"W c #B2B7CB", +"X c #C4C2CD", +"Y c #EEE6DE", +"Z c #F2E0C8", +"` c #E1C19B", +" . c #CB9355", +".. c #BC772E", +"+. c #AE600C", +"@. c #C38D57", +"#. c #E4D4C3", +"$. c #EFF3FA", +"%. c #EBF1FE", +"&. c #E5EDFA", +"*. c #D7E0F1", +"=. c #C1CEE4", +"-. c #B6C4DD", +";. c #B4C3DC", +">. c #AEBEDB", +",. c #8495B1", +"'. c #C16400", +"). c #C77416", +"!. c #D69C59", +"~. c #EFD9BB", +"{. c #E2F2FF", +"]. c #81AFEB", +"^. c #97BFF1", +"/. c #BDD8FA", +"(. c #8CABE2", +"_. c #A3B2DE", +":. c #F3F6FD", +"<. c #ECEBDB", +"[. c #D2AC7A", +"}. c #B8732C", +"|. c #A25200", +"1. c #CFB191", +"2. c #E9EDF4", +"3. c #CCD6EA", +"4. c #BECAE2", +"5. c #BBC9E0", +"6. c #B9C6DF", +"7. c #B5C5E0", +"8. c #C26400", +"9. c #CF8A37", +"0. c #ECD1A7", +"a. c #FFFFFC", +"b. c #FCFAEB", +"c. c #AFC8E2", +"d. c #57A0EE", +"e. c #8DCDFF", +"f. c #80C4FF", +"g. c #70C4FF", +"h. c #4877C8", +"i. c #C0BBD1", +"j. c #EFF3E2", +"k. c #CCDDC3", +"l. c #B7D3B6", +"m. c #C5E6D6", +"n. c #D5CDAE", +"o. c #C28A4B", +"p. c #9E5103", +"q. c #C5A280", +"r. c #E6ECF8", +"s. c #D5DFEF", +"t. c #C7D3E8", +"u. c #C5D1E6", +"v. c #C2CFE5", +"w. c #C1CDE4", +"x. c #BDCBE5", +"y. c #D18C3A", +"z. c #EED3A5", +"A. c #F3E2C1", +"B. c #F1DBB3", +"C. c #FBF1D0", +"D. c #F9F7DF", +"E. c #8EB2D8", +"F. c #137DF3", +"G. c #2296FF", +"H. c #178EFF", +"I. c #0089FF", +"J. c #0A5BCC", +"K. c #BCB5C4", +"L. c #A5C889", +"M. c #80BE7F", +"N. c #ABD9AD", +"O. c #9ACE9C", +"P. c #8CC38E", +"Q. c #EAEBD3", +"R. c #C38D51", +"S. c #9A4F01", +"T. c #C1A996", +"U. c #D0DAED", +"V. c #CCD7EA", +"W. c #C9D4E9", +"X. c #C7D2E7", +"Y. c #C6D2E6", +"Z. c #C3D0E8", +"`. c #CB7F25", +" + c #E0B373", +".+ c #D08E40", +"++ c #BE6807", +"@+ c #C17117", +"#+ c #D49C55", +"$+ c #F6E3AC", +"%+ c #C2C9CD", +"&+ c #0F58CD", +"*+ c #007AFC", +"=+ c #0C8DFF", +"-+ c #0061E8", +";+ c #4C67B4", +">+ c #C7B6A1", +",+ c #75C765", +"'+ c #6CDC70", +")+ c #7DE47D", +"!+ c #75E574", +"~+ c #34B638", +"{+ c #B6CC94", +"]+ c #FFEAC5", +"^+ c #B57329", +"/+ c #954E07", +"(+ c #CBCCD2", +"_+ c #D0DBED", +":+ c #CED9EC", +"<+ c #CBD7EA", +"[+ c #C8D5EC", +"}+ c #C06500", +"|+ c #C16907", +"1+ c #EBCA8C", +"2+ c #BE6809", +"3+ c #D49648", +"4+ c #F4EFCA", +"5+ c #9A9EAE", +"6+ c #4F7CC4", +"7+ c #467DCC", +"8+ c #4D61A6", +"9+ c #C7B0A7", +"0+ c #F5D9A6", +"a+ c #4DBC3D", +"b+ c #15CB18", +"c+ c #17CD17", +"d+ c #06CC05", +"e+ c #009F00", +"f+ c #9DB66A", +"g+ c #FEE3B4", +"h+ c #EABE7D", +"i+ c #974E03", +"j+ c #AD8763", +"k+ c #D2DCEF", +"l+ c #CEDAF0", +"m+ c #BF6401", +"n+ c #CF8C34", +"o+ c #FFF6BF", +"p+ c #C77C22", +"q+ c #B15C04", +"r+ c #DBA75B", +"s+ c #FFF7B9", +"t+ c #FFE7A6", +"u+ c #D9BB94", +"v+ c #BA9987", +"w+ c #E4C294", +"x+ c #FFE7A3", +"y+ c #FEDEA1", +"z+ c #609B38", +"A+ c #00A502", +"B+ c #07CC10", +"C+ c #00C009", +"D+ c #118A0C", +"E+ c #CBBF75", +"F+ c #FDD493", +"G+ c #FFDF9B", +"H+ c #B06714", +"I+ c #93500E", +"J+ c #D8E0F0", +"K+ c #D7E1F2", +"L+ c #D4DEF0", +"M+ c #D4DDEF", +"N+ c #D2DEF2", +"O+ c #BD6402", +"P+ c #E6BC6F", +"Q+ c #FFF4B0", +"R+ c #F2D48A", +"S+ c #D9A14C", +"T+ c #CD8A33", +"U+ c #CF903A", +"V+ c #E1B160", +"W+ c #FBDA8F", +"X+ c #FFE197", +"Y+ c #FFDF92", +"Z+ c #FFE391", +"`+ c #FFE58F", +" @ c #FFDE8B", +".@ c #FFD687", +"+@ c #FFD98B", +"@@ c #D7BC6E", +"#@ c #87A946", +"$@ c #5AAC38", +"%@ c #64A938", +"&@ c #A9AD4E", +"*@ c #FED078", +"=@ c #FFCE78", +"-@ c #FFCD7C", +";@ c #D28B30", +">@ c #8B4500", +",@ c #CFCBCC", +"'@ c #DBE4F3", +")@ c #D8E1F1", +"!@ c #D5E0F4", +"~@ c #BA6202", +"{@ c #E4B763", +"]@ c #FFF4A4", +"^@ c #FFED9C", +"/@ c #FFEC9C", +"(@ c #FAD983", +"_@ c #FEDC86", +":@ c #FFE791", +"<@ c #FFDB83", +"[@ c #FFD67C", +"}@ c #FFD47A", +"|@ c #FFD277", +"1@ c #FFD074", +"2@ c #FFCE70", +"3@ c #FFCB6D", +"4@ c #FFC869", +"5@ c #FFCC6D", +"6@ c #FFC367", +"7@ c #DDB654", +"8@ c #E89F49", +"9@ c #F99056", +"0@ c #EA8752", +"a@ c #F29E4A", +"b@ c #FFBF58", +"c@ c #E49832", +"d@ c #894300", +"e@ c #C7BBB4", +"f@ c #DDE6F4", +"g@ c #DAE4F3", +"h@ c #D9E3F6", +"i@ c #B76001", +"j@ c #C37A1D", +"k@ c #F3D27A", +"l@ c #FFF197", +"m@ c #FFE68A", +"n@ c #FFDF82", +"o@ c #FFDA7B", +"p@ c #FFD473", +"q@ c #FFD16E", +"r@ c #FFCF69", +"s@ c #FFCB64", +"t@ c #FFC860", +"u@ c #FFC55B", +"v@ c #FFC356", +"w@ c #FFC052", +"x@ c #FFBD4E", +"y@ c #FFBA4A", +"z@ c #FFBD49", +"A@ c #FE9D39", +"B@ c #F6916A", +"C@ c #F3A19A", +"D@ c #EFA6A2", +"E@ c #EB9C88", +"F@ c #F59B3D", +"G@ c #E58F1E", +"H@ c #864300", +"I@ c #CBC0BA", +"J@ c #DFE7F7", +"K@ c #DEE6F5", +"L@ c #DBE5F7", +"M@ c #B15B00", +"N@ c #C0771B", +"O@ c #D1953A", +"P@ c #E7B559", +"Q@ c #FFD979", +"R@ c #FFDC79", +"S@ c #FFCF6A", +"T@ c #FFCC64", +"U@ c #FFC95F", +"V@ c #FFC559", +"W@ c #FFC253", +"X@ c #FFBF4E", +"Y@ c #FFBD48", +"Z@ c #FFB942", +"`@ c #FFB53E", +" # c #FFB238", +".# c #FFB832", +"+# c #EE6924", +"@# c #F77471", +"## c #FF9498", +"$# c #FF9698", +"%# c #F96971", +"&# c #D7471C", +"*# c #E1820A", +"=# c #844100", +"-# c #C9BDB6", +";# c #E2EAF8", +"># c #E0E7F6", +",# c #DCE6F8", +"'# c #AB5600", +")# c #B4670F", +"!# c #C47E25", +"~# c #E5AC4C", +"{# c #FFD76D", +"]# c #FFCA60", +"^# c #FFBF4D", +"/# c #FFBC48", +"(# c #FFB842", +"_# c #FFB43C", +":# c #FFB036", +"<# c #FFAD30", +"[# c #FFB72B", +"}# c #E9541C", +"|# c #FB2725", +"1# c #FE2526", +"2# c #F91B1B", +"3# c #FF0D0D", +"4# c #C41803", +"5# c #C86C01", +"6# c #823F00", +"7# c #D7D6D9", +"8# c #E2E9F7", +"9# c #E0E8F7", +"0# c #E0E8F6", +"a# c #DEE8FA", +"b# c #A35100", +"c# c #AC5F0A", +"d# c #CF8C2D", +"e# c #FFC959", +"f# c #FFC252", +"g# c #FFBD4B", +"h# c #FFBA45", +"i# c #FFB740", +"j# c #FFB43A", +"k# c #FFB034", +"l# c #FFAC2F", +"m# c #FFA929", +"n# c #FFB125", +"o# c #E05F11", +"p# c #E50C0B", +"q# c #FF0E14", +"r# c #FF1014", +"s# c #E4000A", +"t# c #D14301", +"u# c #A45600", +"v# c #8C531C", +"w# c #E3EBF7", +"x# c #DFE9FA", +"y# c #A25403", +"z# c #D58F2C", +"A# c #FFC650", +"B# c #FFB844", +"C# c #FFB63E", +"D# c #FFB339", +"E# c #FFB033", +"F# c #FFAB2D", +"G# c #FFA828", +"H# c #FFA522", +"I# c #FFA31C", +"J# c #F89A15", +"K# c #D84A08", +"L# c #D22814", +"M# c #D02518", +"N# c #C02D06", +"O# c #E77A01", +"P# c #874400", +"Q# c #A47B55", +"R# c #E3EBF8", +"S# c #E1E9F8", +"T# c #AA5F0A", +"U# c #E69F32", +"V# c #FFBC41", +"W# c #FFB237", +"X# c #FFAE32", +"Y# c #FFAA2C", +"Z# c #FFA726", +"`# c #FFA421", +" $ c #FFA11B", +".$ c #FF9D15", +"+$ c #FF9D0F", +"@$ c #F88E07", +"#$ c #F48105", +"$$ c #F38005", +"%$ c #F68A02", +"&$ c #B96400", +"*$ c #D2C9C6", +"=$ c #E4ECF9", +"-$ c #E0E9FB", +";$ c #954A00", +">$ c #BA6E13", +",$ c #FEB036", +"'$ c #FFAF31", +")$ c #FFAA2B", +"!$ c #FFA625", +"~$ c #FFA31F", +"{$ c #FFA01A", +"]$ c #FF9D14", +"^$ c #FF990E", +"/$ c #FF9607", +"($ c #FF9404", +"_$ c #FF9402", +":$ c #FF9802", +"<$ c #EA8501", +"[$ c #8C4600", +"}$ c #A0744C", +"|$ c #E6ECF7", +"1$ c #E3EAF9", +"2$ c #9A5309", +"3$ c #D1821A", +"4$ c #FFB22C", +"5$ c #FFA723", +"6$ c #FFA21D", +"7$ c #FF9F17", +"8$ c #FF9C12", +"9$ c #FF980C", +"0$ c #FF9506", +"a$ c #FF9202", +"b$ c #FF9602", +"c$ c #ED8701", +"d$ c #934B00", +"e$ c #884C12", +"f$ c #DCD9DA", +"g$ c #E7EEFA", +"h$ c #E3EAF8", +"i$ c #AD9480", +"j$ c #974F03", +"k$ c #C67610", +"l$ c #FDA01A", +"m$ c #FFA316", +"n$ c #FF9D10", +"o$ c #FF990A", +"p$ c #FF9505", +"q$ c #FF9302", +"r$ c #FF9502", +"s$ c #FF9601", +"t$ c #D77901", +"u$ c #904900", +"v$ c #803F00", +"w$ c #C9B9AD", +"x$ c #E8EFFA", +"y$ c #C2CADB", +"z$ c #C6A583", +"A$ c #8D4803", +"B$ c #924B02", +"C$ c #B06005", +"D$ c #CA7205", +"E$ c #DE7E02", +"F$ c #E78301", +"G$ c #E38001", +"H$ c #CB7000", +"I$ c #994F00", +"J$ c #854100", +"K$ c #8E551E", +"L$ c #D9D2CF", +"M$ c #E9EFFA", +"N$ c #E9F0FC", +"O$ c #E1E8F7", +"P$ c #E0EAFC", +"Q$ c #FBFDFC", +"R$ c #F0E6DD", +"S$ c #C3A07E", +"T$ c #A2703E", +"U$ c #8A490B", +"V$ c #834000", +"W$ c #834100", +"X$ c #945F2C", +"Y$ c #C9B5A3", +"Z$ c #EBEDF3", +"`$ c #EDF2FD", +" % c #F4FDFF", +".% c #F9FEFF", +"+% c #F7FCFF", +"@% c #F4F9FF", +"#% c #F2F8FF", +" ", +" . . . . . . . . . . . . . . . + ", +" . @ # # # # # # # # $ % & * = - ; ", +" . > # # # # # # # # , ' ) ! ~ { ] ^ ", +" . > # # # # # # # # @ % / ( _ : < [ } ", +" . > # # # # # # # # $ | 1 2 3 4 # 5 6 7 ", +" . > # # # # # # # # # 8 9 0 a b # c d e f ", +" g h i j k l m n o p # > q & r s t u v w x y ", +" z A B C D E F G H I J K L M < N O P P P P P P P ", +" Q R S T U V W X Y Z ` ...+.@.#.$.%.&.! *.=.-.;.>.,.", +" '.).!.~.# {.].^./.(._.:.# # <.[.}.|.1.2.&.a 3.4.5.6.7.,.", +" 8.9.0.# a.b.c.d.e.f.g.h.i.j.k.l.m.n.o.p.q.r.s.t.u.v.w.x.,.", +" '.y.z.A.B.C.D.E.F.G.H.I.J.K.L.M.N.O.P.Q.R.S.T.U.V.W.X.Y.Z.,.", +" Q `. +.+++@+#+$+%+&+*+=+-+;+>+,+'+)+!+~+{+]+^+/+(+_+:+V.<+[+,.", +"}+|+1+2+ 3+4+5+6+7+8+9+0+a+b+c+d+e+f+g+h+i+j+~ k+_+_+l+,.", +"m+n+o+p+ q+r+s+t+u+v+w+x+y+z+A+B+C+D+E+F+G+H+I+J+K+L+M+N+,.", +"O+P+Q+R+S+T+U+V+W+X+Y+Z+`+ @.@+@@@#@$@%@&@*@=@-@;@>@,@'@= )@!@,.", +"~@{@]@^@/@(@_@:@<@[@}@|@1@2@3@4@5@6@7@8@9@0@a@b@c@d@e@f@3 g@h@,.", +"i@j@k@l@m@n@o@p@q@r@s@t@u@v@w@x@y@z@A@B@C@D@E@F@G@H@I@J@K@f@L@,.", +" M@N@O@P@Q@R@S@T@U@V@W@X@Y@Z@`@ #.#+#@###$#%#&#*#=#-#;#>#a ,#,.", +" '#)#!#~#{#]#V@W@^#/#(#_#:#<#[#}#|#1#2#3#4#5#6#7#8#9#0#a#,.", +" b#c#d#e#f#g#h#i#j#k#l#m#n#o#p#q#r#s#t#u#v#w#r 9#J@x#,.", +" y#z#A#B#C#D#E#F#G#H#I#J#K#L#M#N#O#P#Q#( R#;#S#x#,.", +" T#U#V#W#X#Y#Z#`# $.$+$@$#$$$%$&$6#*$( =$! ;#-$,.", +" ;$>$,$'$)$!$~${$]$^$/$($_$:$<$[$}$|$( 1$! ;#-$,.", +" 2$3$4$5$6$7$8$9$0$a$a$b$c$d$e$f$g$( h$;#;#x#,.", +" i$j$k$l$m$n$o$p$q$r$s$t$u$v$w$x$g$( R#;#! -$,.", +" y$z$A$B$C$D$E$F$G$H$I$J$K$L$M$N$( =$;#;#O$P$,.", +" . Q$R$S$T$U$V$W$V$V$X$Y$Z$`$) N$( =$;#;#O$P$,.", +" . %# # .%.%, +%@%@%#%1 < & ) N$( =$;#;#O$P$,.", +" . ,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.", +" "}; + +#endif diff --git a/ksquirrel/ksquirrelpart/sq_imagebcg.ui b/ksquirrel/ksquirrelpart/sq_imagebcg.ui new file mode 100644 index 0000000..f2959b4 --- /dev/null +++ b/ksquirrel/ksquirrelpart/sq_imagebcg.ui @@ -0,0 +1,997 @@ + +SQ_ImageBCG + + + SQ_ImageBCG + + + + 0 + 0 + 564 + 391 + + + + Color balance + + + true + + + + unnamed + + + + widgetStackParams + + + GroupBoxPanel + + + + WStackPage + + + 0 + + + + unnamed + + + 4 + + + + spinB + + + 255 + + + -255 + + + + + pushResetG + + + + + + false + + + true + + + + + pushResetC + + + + + + false + + + true + + + + + spinG + + + + + spinC + + + 255 + + + -255 + + + + + pushResetB + + + + + + false + + + true + + + + + layout6 + + + + unnamed + + + + sQ_LabelB + + + + + sliderB + + + -255 + + + 255 + + + Vertical + + + Above + + + 25 + + + Brightness + + + + + + + layout5 + + + + unnamed + + + + sQ_LabelC + + + + + sliderC + + + -255 + + + 255 + + + Vertical + + + Above + + + 25 + + + Contrast + + + + + + + layout4 + + + + unnamed + + + + sQ_LabelG + + + + + sliderG + + + 0 + + + 600 + + + 100 + + + Vertical + + + Above + + + 22 + + + Gamma + + + + + + + + + WStackPage + + + 1 + + + + unnamed + + + 4 + + + + pushResetRed + + + + + + false + + + true + + + + + spinRed + + + 255 + + + -255 + + + + + spinGreen + + + 255 + + + -255 + + + + + pushResetGreen + + + + + + false + + + true + + + + + pushResetBlue + + + + + + false + + + true + + + + + spinBlue + + + 255 + + + -255 + + + + + layout1 + + + + unnamed + + + + sQ_LabelBlue + + + + + sliderBlue + + + -255 + + + 255 + + + Above + + + 25 + + + Blue + + + + + + + layout2 + + + + unnamed + + + + sQ_LabelGreen + + + + + sliderGreen + + + -255 + + + 255 + + + Above + + + 25 + + + Green + + + + + + + layout3 + + + + unnamed + + + + sQ_LabelRed + + + + + sliderRed + + + -255 + + + 255 + + + Above + + + 25 + + + Red + + + + + + + + + + groupBox3 + + + + 7 + 5 + 0 + 0 + + + + + + + + unnamed + + + 6 + + + 0 + + + + push2 + + + + + + false + + + true + + + + + push1 + + + + + + false + + + true + + + + + spacer26 + + + Horizontal + + + Expanding + + + + 1 + 16 + + + + + + spacer27 + + + Horizontal + + + Expanding + + + + 1 + 16 + + + + + + text + + + WordBreak|AlignCenter + + + + + + + spacer12_2 + + + Vertical + + + MinimumExpanding + + + + 16 + 16 + + + + + + layout8 + + + + unnamed + + + + spacer3 + + + Horizontal + + + Expanding + + + + 249 + 21 + + + + + + pushGO + + + Colorize + + + true + + + + + pushCancel + + + Close + + + false + + + + + + + line2 + + + HLine + + + Sunken + + + Horizontal + + + + + spacer11 + + + Vertical + + + MinimumExpanding + + + + 16 + 20 + + + + + + layout15 + + + + unnamed + + + + spacer13 + + + Horizontal + + + Expanding + + + + 1 + 16 + + + + + + textLabel3 + + + Original image: + + + + + spacer35 + + + Horizontal + + + Expanding + + + + 1 + 16 + + + + + + pixmap1 + + + + 0 + 0 + 0 + 0 + + + + + 160 + 160 + + + + + + textLabel4 + + + Image after colorizing: + + + + + spacer34 + + + Horizontal + + + Expanding + + + + 1 + 16 + + + + + + pixmap + + + + 0 + 0 + 0 + 0 + + + + + 160 + 160 + + + + + + + + + + SQ_BCGLabel +
sq_bcglabel.h
+ + -1 + -1 + + 0 + + 5 + 5 + 0 + 0 + + image0 +
+ + SQ_Label +
sq_label.h
+ + -1 + -1 + + 0 + + 5 + 5 + 0 + 0 + + image0 +
+
+ + + 89504e470d0a1a0a0000000d4948445200000016000000160806000000c4b46c3b000003b149444154388dad945f4c5b551cc73fe7dc4b7b4bcba0762d45c43114323599ee6192609c51d883892ce083f1718b3ebb185f8dc91e972cf39d2d2a2f1af664b6f1e0fe3863a0718969700eb0c52142da0242a1bd6d696f7bcff101585203ceb8fd9ece39f99dcff9fe7edf939f88c562ec465f5f9fe609442c161362173c3e3eae7b7a7ac8e7f36432196cdbfe4f907c3e4f2291201e8fe338cec3737357e9e8e828aded1e229d650e1f2d51754b082110124c13a4dc5ea341eb9dc284c0558a853f3ce8cb0677ef500fde7d39d2596679e326597b8e9abb85d7a770ab16ab6983ec5a05b487a70e36f0f4e10afe408d6a558310980108478dba4a1e8233990c5d474b64ed39aa3a8fe5f3317fbf81dbd70bccfeb205947632fd74f6589c1c6ea2f70d03a58ba0c1f2c9bdc1b66de3b8256a6e11cbe7e3ee1d181b590124fe2693aeee08d223c82c3a2c24b7b874bec8f26288774f7bd054504aef0dde6e99c0eb83f9fb266323cb80a27fb0958141836044605a2ee5523393371cc646fee2da37195aa35d0c0c5b4859ac03d7e91712dcaac5adab3650a3ff9d08ef7dd8404bb48869e5d958b5b87dadc4c9a1464e9f0d0326df7ebd86bd2e310cb1bf62d384d59441f2d70a070e1c60e09489929b988681bdd9cc97170bcc4c65595f71f8e0e3301337fc24a7732467831875a47f289652b0be5e4151e6d07316c1b0c0340d8ab92023e76d66a6b2840e36d2fb7a13fee632475e6edc367ea98a90fb98b7dd6310ca0328a44761582e1bab41befabcc0ec940d28bc5e93b68e064cab84e1d9beaeb48934eac1f53b01c1b000fca496aa54b61a99fcde61662a4b4b4b23d1680be9d426173e4df3602a48ea411989a4fd590f52a8fd156b05ed9d350e3defe3cfdf4b4c7ce770ea7d3fb9f520afbe1620daeee5c26735d20b9b9cfb6811a754a439e4e5c5639a4caa1e5caf586bfc0197b78702005cb9b4cae4cd3267ce8638fe964bd72b393e39d74928d242617303a756a37f284447770dcdbffc6384a05a85de1306e9a52057c7527c7131c3c42d3f475eb2303c82d4fc3276d6811db37efeb148723082d9b08f79f97c1e5729109a9a28307cc622d2d6cdf52b2b24efe548dedb00142009862cfa879ee1a71f6cec928353511472fbf4389148b0b0e0c108081412458dfe21c9f11351e67e7358595468246d1d1e5e38a6e9e851bc39d84ab502a669331dafec0d8ec7e3e8cb06e1a881d727d1ae40180a434a8c9db129a54126ad48a7358c2b4c5352c8c374bcccdab2bb37d8719cba79fab8211f9df218e0582c261e95f8bfc04f1a1e8bc5c4dfe0a190172af6a9690000000049454e44ae426082 + + + + + spinRed + valueChanged(int) + SQ_ImageBCG + slotRedChanged(int) + + + spinGreen + valueChanged(int) + SQ_ImageBCG + slotGreenChanged(int) + + + spinG + valueChanged(double) + SQ_ImageBCG + slotGSpinChanged(double) + + + spinC + valueChanged(int) + SQ_ImageBCG + slotCChanged(int) + + + spinBlue + valueChanged(int) + SQ_ImageBCG + slotBlueChanged(int) + + + spinB + valueChanged(int) + SQ_ImageBCG + slotBChanged(int) + + + sliderRed + valueChanged(int) + SQ_ImageBCG + slotRedChanged(int) + + + sliderGreen + valueChanged(int) + SQ_ImageBCG + slotGreenChanged(int) + + + sliderG + valueChanged(int) + SQ_ImageBCG + slotGChanged(int) + + + sliderC + valueChanged(int) + SQ_ImageBCG + slotCChanged(int) + + + sliderBlue + valueChanged(int) + SQ_ImageBCG + slotBlueChanged(int) + + + sliderB + valueChanged(int) + SQ_ImageBCG + slotBChanged(int) + + + pushResetRed + clicked() + SQ_ImageBCG + slotResetRed() + + + pushResetGreen + clicked() + SQ_ImageBCG + slotResetGreen() + + + pushResetG + clicked() + SQ_ImageBCG + slotResetG() + + + pushResetC + clicked() + SQ_ImageBCG + slotResetC() + + + pushResetBlue + clicked() + SQ_ImageBCG + slotResetBlue() + + + pushResetB + clicked() + SQ_ImageBCG + slotResetB() + + + pushGO + clicked() + SQ_ImageBCG + slotStartBCG() + + + push2 + clicked() + SQ_ImageBCG + slotPush() + + + push1 + clicked() + SQ_ImageBCG + slotPush() + + + pushCancel + clicked() + SQ_ImageBCG + reject() + + + + push1 + push2 + pushResetRed + pushResetGreen + pushResetBlue + sliderRed + sliderGreen + sliderBlue + spinRed + spinGreen + spinBlue + pushGO + pushCancel + pushResetB + pushResetC + pushResetG + sliderB + sliderC + sliderG + spinB + spinC + spinG + + + sq_imageedit.h + qimage.h + qstringlist.h + sq_iconloader.h + kstandarddirs.h + sq_config.h + fmt_filters.h + ksquirrel-libs/fmt_types.h + ksquirrel-libs/fmt_defs.h + sq_imagebcg.ui.h + + + int id; + QImage sample, sample_saved; + QStringList strings; + static SQ_ImageBCG *m_inst; + + + bcg(SQ_ImageBCGOptions*) + + + slotResetG() + slotResetC() + slotResetB() + slotResetRed() + slotResetGreen() + slotResetBlue() + slotStartBCG() + slotBChanged( int v ) + slotCChanged( int v ) + slotRedChanged( int v ) + slotGreenChanged( int v ) + slotBlueChanged( int v ) + slotGChanged( int v ) + slotGSpinChanged( double v ) + slotPush() + + + init() + RGB2Y( int r, int g, int b ) + assignNewImage( const QImage & im ) + changeImage( int b, int c, int g1, int red, int green, int blue ) + setPreviewImage( const QImage & im ) + instance() + + + + knuminput.h + sq_label.h + sq_label.h + sq_label.h + sq_label.h + sq_label.h + sq_label.h + sq_bcglabel.h + sq_bcglabel.h + +
diff --git a/ksquirrel/ksquirrelpart/sq_imagebcg.ui.h b/ksquirrel/ksquirrelpart/sq_imagebcg.ui.h new file mode 100644 index 0000000..7d80c6f --- /dev/null +++ b/ksquirrel/ksquirrelpart/sq_imagebcg.ui.h @@ -0,0 +1,241 @@ +/**************************************************************************** +** ui.h extension file, included from the uic-generated form implementation. +** +** If you wish to add, delete or rename functions or slots use +** Qt Designer which will update this file, preserving your code. Create an +** init() function in place of a constructor, and a destroy() function in +** place of a destructor. +*****************************************************************************/ + +SQ_ImageBCG * SQ_ImageBCG::m_inst = 0; + +void SQ_ImageBCG::init() +{ + m_inst = this; + + QPixmap p = QPixmap::fromMimeSource(locate("data", "images/imageedit/reset_value.png")); + + sQ_LabelB->setSingle(true); + sQ_LabelC->setSingle(true); + sQ_LabelG->setSingle(true); + sQ_LabelB->setText(tr2i18n("Brightness")); + sQ_LabelC->setText(tr2i18n("Contrast")); + sQ_LabelG->setText(tr2i18n("Gamma")); + sQ_LabelRed->setText(tr2i18n("Red"), tr2i18n("Cyan")); + sQ_LabelGreen->setText(tr2i18n("Green"), tr2i18n("Magenta")); + sQ_LabelBlue->setText(tr2i18n("Blue"), tr2i18n("Yellow")); + + pushResetB->setPixmap(p); + pushResetC->setPixmap(p); + pushResetG->setPixmap(p); + pushResetRed->setPixmap(p); + pushResetGreen->setPixmap(p); + pushResetBlue->setPixmap(p); + + strings.append(QString("") + tr2i18n("Brightness") + ", " + tr2i18n("Contrast") + ", " + tr2i18n("Gamma") + ""); + strings.append(QString("") + tr2i18n("Red") + ", " + tr2i18n("Green") + ", " + tr2i18n("Blue") + ""); + + id = 0; + widgetStackParams->raiseWidget(id); + text->setText(strings[id]); + + QPixmap tool1 = QPixmap::fromMimeSource(locate("data", "images/imageedit/resize_toolbutton.png")); + QPixmap tool2 = QPixmap::fromMimeSource(locate("data", "images/imageedit/resize_toolbutton2.png")); + push1->setPixmap(tool1); + push2->setPixmap(tool2); + + spinG->setRange(0, 6.0, 0.01, 2); + spinG->setValue(1.0); + connect(spinG, SIGNAL(valueChanged(int)), spinG, SLOT(slotValueChanged(int))); +} + +void SQ_ImageBCG::slotResetG() +{ + sliderG->setValue(100); +} + +void SQ_ImageBCG::slotResetC() +{ + sliderC->setValue(0); +} + +void SQ_ImageBCG::slotResetB() +{ + sliderB->setValue(0); +} + +void SQ_ImageBCG::slotResetRed() +{ + sliderRed->setValue(0); +} + +void SQ_ImageBCG::slotResetGreen() +{ + sliderGreen->setValue(0); +} + +void SQ_ImageBCG::slotResetBlue() +{ + sliderBlue->setValue(0); +} + +void SQ_ImageBCG::slotStartBCG() +{ + SQ_ImageBCGOptions opt; + opt.b = sliderB->value(); + opt.c = sliderC->value(); + opt.g = sliderG->value(); + opt.red = sliderRed->value(); + opt.green = sliderGreen->value(); + opt.blue = sliderBlue->value(); + + emit bcg(&opt); +} + +int SQ_ImageBCG::RGB2Y(int r, int g, int b) +{ + return (int)((double)r * 0.299 + (double)g * 0.587 + (double)b * 0.114); +} + +void SQ_ImageBCG::slotBChanged(int v) +{ + spinB->blockSignals(true); + sliderB->blockSignals(true); + spinB->setValue(v); + sliderB->setValue(v); + spinB->blockSignals(false); + sliderB->blockSignals(false); + + changeImage(v, sliderC->value(), sliderG->value(), sliderRed->value(), sliderGreen->value(), sliderBlue->value()); +} + +void SQ_ImageBCG::slotCChanged(int v) +{ + spinC->blockSignals(true); + sliderC->blockSignals(true); + spinC->setValue(v); + sliderC->setValue(v); + spinC->blockSignals(false); + sliderC->blockSignals(false); + + changeImage(sliderB->value(), v, sliderG->value(), sliderRed->value(), sliderGreen->value(), sliderBlue->value()); +} + +void SQ_ImageBCG::slotRedChanged(int v) +{ + spinRed->blockSignals(true); + sliderRed->blockSignals(true); + spinRed->setValue(v); + sliderRed->setValue(v); + spinRed->blockSignals(false); + sliderRed->blockSignals(false); + + changeImage(sliderB->value(), sliderC->value(), sliderG->value(), v, sliderGreen->value(), sliderBlue->value()); +} + +void SQ_ImageBCG::slotGreenChanged(int v) +{ + spinGreen->blockSignals(true); + sliderGreen->blockSignals(true); + spinGreen->setValue(v); + sliderGreen->setValue(v); + spinGreen->blockSignals(false); + sliderGreen->blockSignals(false); + + changeImage(sliderB->value(), sliderC->value(), sliderG->value(), sliderRed->value(), v, sliderBlue->value()); +} + +void SQ_ImageBCG::slotBlueChanged(int v) +{ + spinBlue->blockSignals(true); + sliderBlue->blockSignals(true); + spinBlue->setValue(v); + sliderBlue->setValue(v); + spinBlue->blockSignals(false); + sliderBlue->blockSignals(false); + + changeImage(sliderB->value(), sliderC->value(), sliderG->value(), sliderRed->value(), sliderGreen->value(), v); +} + +void SQ_ImageBCG::slotGChanged(int v) +{ + double g = (double)v / 100.0; + spinG->blockSignals(true); + spinG->setValue(g); + spinG->blockSignals(false); + + changeImage(sliderB->value(), sliderC->value(), v, sliderRed->value(), sliderGreen->value(), sliderBlue->value()); +} + +void SQ_ImageBCG::slotGSpinChanged(double v) +{ + int val = (int)(v * 100.0); + sliderG->blockSignals(true); + sliderG->setValue(val); + sliderG->blockSignals(false); + + changeImage(sliderB->value(), sliderC->value(), val, sliderRed->value(), sliderGreen->value(), sliderBlue->value()); +} + +void SQ_ImageBCG::assignNewImage(const QImage &im) +{ + QPixmap p; + p.convertFromImage(im); + pixmap1->setPixmap(p); +} + +void SQ_ImageBCG::changeImage(int b, int c, int g1, int red, int green, int blue) +{ + if(sample.isNull() || sample_saved.isNull()) + return; + + double g = (double)g1 / 100.0; + + sample = sample_saved.copy(); + + // change brightness + fmt_filters::brightness(fmt_filters::image(sample.bits(), sample.width(), sample.height()), b); + + //change contrast + if(c) + fmt_filters::contrast(fmt_filters::image(sample.bits(), sample.width(), sample.height()), c); + + // change gamma + if(g1 != 100) + fmt_filters::gamma(fmt_filters::image(sample.bits(), sample.width(), sample.height()), g); + + if(red || green || blue) + fmt_filters::colorize(fmt_filters::image(sample.bits(), sample.width(), sample.height()), blue, green, red); + + assignNewImage(sample); +} + +void SQ_ImageBCG::slotPush() +{ + if(!id) id = 1; + else id = 0; + + widgetStackParams->raiseWidget(id); + text->setText(strings[id]); +} + +void SQ_ImageBCG::setPreviewImage(const QImage &im) +{ + if(im.isNull()) return; + + sample = im.copy(); + sample_saved = sample.copy(); + + QPixmap p; + + p.convertFromImage(sample_saved); + pixmap->setPixmap(p); + pixmap1->setPixmap(p); + + changeImage(sliderB->value(), sliderC->value(), sliderG->value(), sliderRed->value(), sliderGreen->value(), sliderBlue->value()); +} + +SQ_ImageBCG* SQ_ImageBCG::instance() +{ + return m_inst; +} diff --git a/ksquirrel/ksquirrelpart/sq_imageedit.h b/ksquirrel/ksquirrelpart/sq_imageedit.h new file mode 100644 index 0000000..acece00 --- /dev/null +++ b/ksquirrel/ksquirrelpart/sq_imageedit.h @@ -0,0 +1,84 @@ +/*************************************************************************** + sq_imageedit.h - description + ------------------- + begin : 29 2005 + copyright : (C) 2005 by Baryshev Dmitry + email : ksquirrel.iv@gmail.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifndef SQ_IMAGEEDIT_H +#define SQ_IMAGEEDIT_H + +#include +#include + +#include "fmt_filters.h" + +struct SQ_ImageOptions +{ + QString putto; + int where_to_put; + bool close; +}; + +struct SQ_ImageBCGOptions +{ + int b, c, g; + int red, green, blue; +}; + +struct SQ_ImageConvertOptions +{ + QString libname; +}; + +struct SQ_ImageFilterOptions +{ + int type; + + bool _bool; + fmt_filters::rgb rgb1, rgb2; + float _float; + unsigned int _uint; + double _double1, _double2; +}; + +namespace F +{ + enum ftype + { + fblend = 0, + fblur, + fdesaturate, + fdespeckle, + fedge, + femboss, + fequalize, + ffade, + fflatten, + fimplode, + fnegative, + fnoise, + foil, + fshade, + fsharpen, + fsolarize, + fspread, + fswapRGB, + fswirl, + fthreshold, + fgray, + fredeye + }; +} + +#endif diff --git a/ksquirrel/ksquirrelpart/sq_imagefilter.ui b/ksquirrel/ksquirrelpart/sq_imagefilter.ui new file mode 100644 index 0000000..57e169d --- /dev/null +++ b/ksquirrel/ksquirrelpart/sq_imagefilter.ui @@ -0,0 +1,1602 @@ + +SQ_ImageFilter + + + SQ_ImageFilter + + + + 0 + 0 + 537 + 421 + + + + Filter + + + true + + + + unnamed + + + + widgetStackFilters + + + + 3 + 5 + 0 + 0 + + + + GroupBoxPanel + + + + blendWidget + + + 0 + + + + unnamed + + + + textLabel1 + + + + 4 + 5 + 0 + 0 + + + + Color: + + + + + pushBlendColor + + + + + + + + spacer17 + + + Vertical + + + Expanding + + + + 16 + 40 + + + + + + blendOpacity + + + Opacity + + + + + + + WStackPage + + + 1 + + + + unnamed + + + + spacer9_2 + + + Vertical + + + Expanding + + + + 16 + 20 + + + + + + blurSigma + + + Sigma + + + + + blurRadius + + + Radius + + + + + + + WStackPage + + + 2 + + + + unnamed + + + + spacer10_2 + + + Vertical + + + Expanding + + + + 16 + 45 + + + + + + desaturateValue + + + Factor + + + + + + + WStackPage + + + 3 + + + + unnamed + + + + textLabel1_2 + + + GroupBoxPanel + + + 4 + + + There are no special options available for this filter. Just click "Filter". + + + WordBreak|AlignVCenter + + + + + spacer11 + + + Vertical + + + Expanding + + + + 11 + 26 + + + + + + + + WStackPage + + + 4 + + + + unnamed + + + + spacer12 + + + Vertical + + + Expanding + + + + 16 + 30 + + + + + + edgeRadius + + + Radius + + + + + + + WStackPage + + + 5 + + + + unnamed + + + + spacer13 + + + Vertical + + + Expanding + + + + 16 + 30 + + + + + + embossSigma + + + Sigma + + + + + embossRadius + + + Radius + + + + + + + WStackPage + + + 6 + + + + unnamed + + + + textLabel1_2_2 + + + GroupBoxPanel + + + 4 + + + There are no special options available for this filter. Just click "Filter". + + + WordBreak|AlignVCenter + + + + + spacer11_2 + + + Vertical + + + Expanding + + + + 11 + 14 + + + + + + + + WStackPage + + + 7 + + + + unnamed + + + + fadeColor + + + + + + + + spacer15 + + + Vertical + + + Expanding + + + + 16 + 10 + + + + + + textLabel1_4 + + + + 4 + 5 + 0 + 0 + + + + Color: + + + + + fadeValue + + + Value + + + + + + + WStackPage + + + 8 + + + + unnamed + + + + flattenColor1 + + + + + + + + spacer16 + + + Vertical + + + Expanding + + + + 10 + 11 + + + + + + flattenColor2 + + + + + + + + textLabel1_4_2 + + + + 4 + 5 + 0 + 0 + + + + Color 1: + + + + + textLabel1_4_3 + + + Color 2: + + + + + + + WStackPage + + + 9 + + + + unnamed + + + + spacer15_2 + + + Vertical + + + Expanding + + + + 16 + 25 + + + + + + implodeFactor + + + Factor + + + + + + + WStackPage + + + 10 + + + + unnamed + + + + spacer11_2_2 + + + Vertical + + + Expanding + + + + 11 + 14 + + + + + + textLabel1_2_2_2 + + + GroupBoxPanel + + + 4 + + + There are no special options available for this filter. Just click "Filter". + + + WordBreak|AlignVCenter + + + + + + + WStackPage + + + 11 + + + + unnamed + + + + buttonGroupNoise + + + Noise type + + + true + + + + unnamed + + + 9 + + + 2 + + + + radioButton1 + + + Uniform + + + + + radioButton1_4 + + + Impulse + + + 3 + + + + + radioButton1_3 + + + Multiplicative Gaussian + + + + + radioButton1_6 + + + Poisson + + + 5 + + + + + radioButton1_2 + + + Gaussian + + + 1 + + + + + radioButton1_5 + + + Laplacian + + + 4 + + + + + + + + + WStackPage + + + 12 + + + + unnamed + + + + spacer15_2_2 + + + Vertical + + + Expanding + + + + 16 + 35 + + + + + + oilRadius + + + Radius + + + + + + + WStackPage + + + 13 + + + + unnamed + + + + shadeColor + + + Color + + + + + spacer21 + + + Vertical + + + Expanding + + + + 21 + 10 + + + + + + shadeElev + + + Elevation + + + + + shadeAzim + + + Azimuth + + + + + + + WStackPage + + + 14 + + + + unnamed + + + + spacer13_2 + + + Vertical + + + Expanding + + + + 16 + 10 + + + + + + sharpenSigma + + + Sigma + + + + + sharpenRadius + + + Radius + + + + + + + WStackPage + + + 15 + + + + unnamed + + + + spacer13_2_2 + + + Vertical + + + Expanding + + + + 20 + 60 + + + + + + solarizeValue + + + Factor + + + + + + + WStackPage + + + 16 + + + + unnamed + + + + spacer24 + + + Vertical + + + Expanding + + + + 16 + 35 + + + + + + spreadValue + + + Amount + + + + + + + WStackPage + + + 17 + + + + unnamed + + + + buttonGroupSwapRGB + + + Type + + + + unnamed + + + 9 + + + 2 + + + + radioButton7 + + + GBR + + + + + radioButton8 + + + BRG + + + + + + + spacer25 + + + Vertical + + + Expanding + + + + 11 + 41 + + + + + + + + WStackPage + + + 18 + + + + unnamed + + + + spacer13_2_2_2 + + + Vertical + + + Expanding + + + + 16 + 25 + + + + + + swirlAngle + + + Degrees + + + + + + + WStackPage + + + 19 + + + + unnamed + + + + spacer24_2 + + + Vertical + + + Expanding + + + + 16 + 75 + + + + + + thresholdValue + + + Threshold + + + + + + + WStackPage + + + 20 + + + + unnamed + + + + textLabel1_2_2_2_2 + + + GroupBoxPanel + + + 4 + + + There are no special options available for this filter. Just click "Filter". + + + WordBreak|AlignVCenter + + + + + spacer11_2_2_2 + + + Vertical + + + Expanding + + + + 11 + 113 + + + + + + + + WStackPage + + + 21 + + + + unnamed + + + + thresholdRE + + + Threshold + + + + + spacer26_2 + + + Vertical + + + Expanding + + + + 16 + 71 + + + + + + + + + spacer27 + + + Vertical + + + Expanding + + + + 16 + 16 + + + + + + layout2 + + + + unnamed + + + + spacer14 + + + Horizontal + + + Expanding + + + + 285 + 16 + + + + + + pushFilter + + + Filter + + + true + + + + + pushCancel + + + Close + + + false + + + + + + + line7 + + + HLine + + + Sunken + + + Horizontal + + + + + + Blend + + + + + Blur + + + + + Desaturate + + + + + Despeckle + + + + + Edge + + + + + Emboss + + + + + Equalize + + + + + Fade + + + + + Flatten + + + + + Implode + + + + + Negative + + + + + Noise + + + + + Oil + + + + + Shade + + + + + Sharpen + + + + + Solarize + + + + + Spread + + + + + Swap colors + + + + + Swirl + + + + + Threshold + + + + + Grayscale + + + + + Redeye + + + + listMain + + + + 1 + 7 + 0 + 0 + + + + + 140 + 0 + + + + + + spacer26 + + + Vertical + + + Expanding + + + + 16 + 16 + + + + + + layout4 + + + + unnamed + + + + pixmap1 + + + + 0 + 0 + 0 + 0 + + + + + 160 + 160 + + + + + + textLabel1_3 + + + Original image: + + + + + spacer27_2 + + + Horizontal + + + Expanding + + + + 1 + 16 + + + + + + spacer28 + + + Horizontal + + + Expanding + + + + 1 + 16 + + + + + + pixmap + + + + 0 + 0 + 0 + 0 + + + + + 160 + 160 + + + + + + spacer27_3 + + + Horizontal + + + Expanding + + + + 1 + 16 + + + + + + textLabel2 + + + Image after filtering: + + + + + + + + + SQ_BCGLabel +
sq_bcglabel.h
+ + -1 + -1 + + 0 + + 5 + 5 + 0 + 0 + + image0 +
+
+ + + 89504e470d0a1a0a0000000d4948445200000016000000160806000000c4b46c3b000003b149444154388dad945f4c5b551cc73fe7dc4b7b4bcba0762d45c43114323599ee6192609c51d883892ce083f1718b3ebb185f8dc91e972cf39d2d2a2f1af664b6f1e0fe3863a0718969700eb0c52142da0242a1bd6d696f7bcff101585203ceb8fd9ece39f99dcff9fe7edf939f88c562ec465f5f9fe609442c161362173c3e3eae7b7a7ac8e7f36432196cdbfe4f907c3e4f2291201e8fe338cec3737357e9e8e828aded1e229d650e1f2d51754b082110124c13a4dc5ea341eb9dc284c0558a853f3ce8cb0677ef500fde7d39d2596679e326597b8e9abb85d7a770ab16ab6983ec5a05b487a70e36f0f4e10afe408d6a558310980108478dba4a1e8233990c5d474b64ed39aa3a8fe5f3317fbf81dbd70bccfeb205947632fd74f6589c1c6ea2f70d03a58ba0c1f2c9bdc1b66de3b8256a6e11cbe7e3ee1d181b590124fe2693aeee08d223c82c3a2c24b7b874bec8f26288774f7bd054504aef0dde6e99c0eb83f9fb266323cb80a27fb0958141836044605a2ee5523393371cc646fee2da37195aa35d0c0c5b4859ac03d7e91712dcaac5adab3650a3ff9d08ef7dd8404bb48869e5d958b5b87dadc4c9a1464e9f0d0326df7ebd86bd2e310cb1bf62d384d59441f2d70a070e1c60e09489929b988681bdd9cc97170bcc4c65595f71f8e0e3301337fc24a7732467831875a47f289652b0be5e4151e6d07316c1b0c0340d8ab92023e76d66a6b2840e36d2fb7a13fee632475e6edc367ea98a90fb98b7dd6310ca0328a44761582e1bab41befabcc0ec940d28bc5e93b68e064cab84e1d9beaeb48934eac1f53b01c1b000fca496aa54b61a99fcde61662a4b4b4b23d1680be9d426173e4df3602a48ea411989a4fd590f52a8fd156b05ed9d350e3defe3cfdf4b4c7ce770ea7d3fb9f520afbe1620daeee5c26735d20b9b9cfb6811a754a439e4e5c5639a4caa1e5caf586bfc0197b78702005cb9b4cae4cd3267ce8638fe964bd72b393e39d74928d242617303a756a37f284447770dcdbffc6384a05a85de1306e9a52057c7527c7131c3c42d3f475eb2303c82d4fc3276d6811db37efeb148723082d9b08f79f97c1e5729109a9a28307cc622d2d6cdf52b2b24efe548dedb00142009862cfa879ee1a71f6cec928353511472fbf4389148b0b0e0c108081412458dfe21c9f11351e67e7358595468246d1d1e5e38a6e9e851bc39d84ab502a669331dafec0d8ec7e3e8cb06e1a881d727d1ae40180a434a8c9db129a54126ad48a7358c2b4c5352c8c374bcccdab2bb37d8719cba79fab8211f9df218e0582c261e95f8bfc04f1a1e8bc5c4dfe0a190172af6a9690000000049454e44ae426082 + + + + + pushCancel + clicked() + SQ_ImageFilter + reject() + + + pushFilter + clicked() + SQ_ImageFilter + slotStartFiltering() + + + listMain + selectionChanged() + SQ_ImageFilter + slotShowPage() + + + + pushFilter + pushCancel + + + sq_imageedit.h + qimage.h + sq_iconloader.h + sq_config.h + fmt_filters.h + sq_imagefilter.ui.h + + + QImage sample, sample_saved; + static SQ_ImageFilter *m_inst; + + + filter(SQ_ImageFilterOptions*) + + + slotStartFiltering() + slotShowPage() + swapRGB() + blend() + fade() + desaturate() + threshold() + solarize() + spread() + swirl() + noise() + redeye() + flatten() + shade() + blur() + implode() + edge() + emboss() + sharpen() + oil() + + + init() + setPreviewImage( const QImage & im ) + assignNewImage( const QImage & im ) + negative() + togray() + equalize() + despeckle() + hackConnect() + instance() + + + + kcolorbutton.h + knuminput.h + knuminput.h + knuminput.h + knuminput.h + knuminput.h + knuminput.h + knuminput.h + knuminput.h + knuminput.h + knuminput.h + knuminput.h + knuminput.h + knuminput.h + knuminput.h + kcolorbutton.h + knuminput.h + knuminput.h + kcolorbutton.h + kcolorbutton.h + knuminput.h + knuminput.h + knuminput.h + knuminput.h + knuminput.h + knuminput.h + knuminput.h + knuminput.h + knuminput.h + knuminput.h + knuminput.h + knuminput.h + knuminput.h + knuminput.h + knuminput.h + knuminput.h + knuminput.h + knuminput.h + knuminput.h + knuminput.h + knuminput.h + knuminput.h + sq_bcglabel.h + sq_bcglabel.h + +
diff --git a/ksquirrel/ksquirrelpart/sq_imagefilter.ui.h b/ksquirrel/ksquirrelpart/sq_imagefilter.ui.h new file mode 100644 index 0000000..d39f35f --- /dev/null +++ b/ksquirrel/ksquirrelpart/sq_imagefilter.ui.h @@ -0,0 +1,610 @@ +/**************************************************************************** +** ui.h extension file, included from the uic-generated form implementation. +** +** If you wish to add, delete or rename functions or slots use +** Qt Designer which will update this file, preserving your code. Create an +** init() function in place of a constructor, and a destroy() function in +** place of a destructor. +*****************************************************************************/ + +SQ_ImageFilter * SQ_ImageFilter::m_inst = 0; + +void SQ_ImageFilter::init() +{ + m_inst = this; + + // restore NumInputs... + const double sigmaMax = 99.9, sigmaMin = 0.01; + const double radiusMax = 99.9, radiusMin = 0.01; + + blendOpacity->setRange(0.0f, 1.0f, 0.01, true); + fadeValue->setRange(0.0f, 1.0f, 0.01f, true); + desaturateValue->setRange(0.0f, 1.0f, 0.01, true); + thresholdValue->setRange(0, 255, 1, true); + thresholdRE->setRange(0, 255, 1, true); + solarizeValue->setRange(0.0f, 50.0f, 0.01f, true); + spreadValue->setRange(1, 10, 1, true); + swirlAngle->setRange(-720.0f, 720.0f, 0.1f, true); + shadeAzim->setRange(0.0f, 90.0f, 0.01f, true); + shadeElev->setRange(0.0f, 90.0f, 0.01f, true); + blurRadius->setRange(radiusMin, radiusMax, 0.01f, true); + blurSigma->setRange(sigmaMin, 50.0, 0.01f, true); + implodeFactor->setRange(0, 100, 1, true); + edgeRadius->setRange((int)radiusMin, 30, 1, true); + embossRadius->setRange(radiusMin, radiusMax, 0.01f, true); + embossSigma->setRange(sigmaMin, sigmaMax, 0.01f, true); + sharpenRadius->setRange(radiusMin, radiusMax, 0.01f, true); + sharpenSigma->setRange(sigmaMin, 30.0, 0.01f, true); + oilRadius->setRange(1, 5, 1, true); + + SQ_Config::instance()->setGroup("Image edit options"); + + buttonGroupSwapRGB->setButton(SQ_Config::instance()->readNumEntry("filter_swapRGB", 0)); + // blend + QColor c; + c.setNamedColor(SQ_Config::instance()->readEntry("filter_blend_color", "#00ff00")); + pushBlendColor->setColor(c); + blendOpacity->setValue(SQ_Config::instance()->readDoubleNumEntry("filter_blend_opacity", 0.5)); + + // fade + c.setNamedColor(SQ_Config::instance()->readEntry("filter_flend_color", "#00ff00")); + fadeColor->setColor(c); + fadeValue->setValue(SQ_Config::instance()->readDoubleNumEntry("filter_fade_value", 0.5)); + + // desaturate + desaturateValue->setValue(SQ_Config::instance()->readDoubleNumEntry("filter_desaturate_value", 0.5)); + + // threshold + thresholdValue->setValue(SQ_Config::instance()->readNumEntry("filter_threshold_value", 1)); + + // threshold for redeye + thresholdRE->setValue(SQ_Config::instance()->readNumEntry("filter_threshold_redeye", 10)); + + // solarize + solarizeValue->setValue(SQ_Config::instance()->readDoubleNumEntry("filter_solarize_value", 0.5)); + + // spread + spreadValue->setValue(SQ_Config::instance()->readNumEntry("filter_spread_value", 1)); + + // swirl + swirlAngle->setValue(SQ_Config::instance()->readDoubleNumEntry("filter_swirl_value", 0.0)); + + // noise + buttonGroupNoise->setButton(SQ_Config::instance()->readNumEntry("filter_noise", 0)); + + // flatten + c.setNamedColor(SQ_Config::instance()->readEntry("filter_flatten_color1", "#00ff00")); + flattenColor1->setColor(c); + c.setNamedColor(SQ_Config::instance()->readEntry("filter_flatten_color2", "#00ff00")); + flattenColor2->setColor(c); + + // shade + shadeAzim->setValue(SQ_Config::instance()->readDoubleNumEntry("filter_shade_azim", 0.1)); + shadeElev->setValue(SQ_Config::instance()->readDoubleNumEntry("filter_shade_elev", 0.1)); + + if(SQ_Config::instance()->readBoolEntry("filter_shade_color", false)) + shadeColor->toggle(); + + // blur + blurRadius->setValue(SQ_Config::instance()->readDoubleNumEntry("filter_blur_radius", 0.1)); + blurSigma->setValue(SQ_Config::instance()->readDoubleNumEntry("filter_blur_sigma", 0.1)); + + // implode + implodeFactor->setValue(SQ_Config::instance()->readNumEntry("filter_implode_factor", 1)); + + // edge + edgeRadius->setValue(SQ_Config::instance()->readNumEntry("filter_egde_radius", 1)); + + // emboss + embossRadius->setValue(SQ_Config::instance()->readDoubleNumEntry("filter_emboss_radius", 0.1)); + embossSigma->setValue(SQ_Config::instance()->readDoubleNumEntry("filter_emboss_sigma", 0.1)); + + // sharpen + sharpenRadius->setValue(SQ_Config::instance()->readDoubleNumEntry("filter_sharpen_radius", 0.1)); + sharpenSigma->setValue(SQ_Config::instance()->readDoubleNumEntry("filter_sharpen_sigma", 0.1)); + + // oil + oilRadius->setValue(SQ_Config::instance()->readNumEntry("filter_oil_radius", 1)); + + listMain->setCurrentItem(SQ_Config::instance()->readNumEntry("filter_filter", 0)); + + hackConnect(); +} + +void SQ_ImageFilter::slotStartFiltering() +{ + SQ_Config *kconf = SQ_Config::instance(); + + kconf->setGroup("Image edit options"); + kconf->writeEntry("filter_swapRGB", buttonGroupSwapRGB->selectedId()); + kconf->writeEntry("filter_blend_color", pushBlendColor->color().name()); + kconf->writeEntry("filter_blend_opacity", blendOpacity->value()); + kconf->writeEntry("filter_fade_color", fadeColor->color().name()); + kconf->writeEntry("filter_fade_value", fadeValue->value()); + kconf->writeEntry("filter_desaturate_value", desaturateValue->value()); + kconf->writeEntry("filter_threshold_value", thresholdValue->value()); + kconf->writeEntry("filter_threshold_redeye", thresholdRE->value()); + kconf->writeEntry("filter_solarize_value", solarizeValue->value()); + kconf->writeEntry("filter_spread_value", spreadValue->value()); + kconf->writeEntry("filter_swirl_value", swirlAngle->value()); + kconf->writeEntry("filter_noise", buttonGroupNoise->selectedId()); + kconf->writeEntry("filter_flatten_color1", flattenColor1->color().name()); + kconf->writeEntry("filter_flatten_color2", flattenColor2->color().name()); + kconf->writeEntry("filter_shade_azim", shadeAzim->value()); + kconf->writeEntry("filter_shade_elev", shadeElev->value()); + kconf->writeEntry("filter_shade_color", shadeColor->isChecked()); + kconf->writeEntry("filter_blur_radius", blurRadius->value()); + kconf->writeEntry("filter_blur_sigma", blurSigma->value()); + kconf->writeEntry("filter_implode_factor", implodeFactor->value()); + kconf->writeEntry("filter_egde_radius", edgeRadius->value()); + kconf->writeEntry("filter_emboss_radius", embossRadius->value()); + kconf->writeEntry("filter_emboss_sigma", embossSigma->value()); + kconf->writeEntry("filter_sharpen_radius", sharpenRadius->value()); + kconf->writeEntry("filter_sharpen_sigma", sharpenSigma->value()); + kconf->writeEntry("filter_oil_radius", oilRadius->value()); + kconf->writeEntry("filter_filter", listMain->currentItem()); + + SQ_ImageFilterOptions opt; + + opt.type = listMain->currentItem(); + + switch(opt.type) + { + case F::fblend: + { + QColor c = pushBlendColor->color(); + opt.rgb1 = fmt_filters::rgb(c.red(), c.green(), c.blue()); + opt._float = blendOpacity->value(); + } + break; + case F::fblur: opt._double1 = blurRadius->value(); opt._double2 = blurSigma->value(); break; + case F::fdesaturate: opt._float = (float)desaturateValue->value(); break; + case F::fdespeckle: break; + case F::fedge: opt._double1 = (double)edgeRadius->value(); break; + case F::femboss: opt._double1 = embossRadius->value(); opt._double2 = embossSigma->value(); break; + case F::fequalize: break; + case F::ffade: + { + QColor c = fadeColor->color(); + opt.rgb1 = fmt_filters::rgb(c.red(), c.green(), c.blue()); + opt._float = (float)fadeValue->value(); + } + break; + case F::fflatten: + { + QColor c = flattenColor1->color(); + opt.rgb1 = fmt_filters::rgb(c.red(), c.green(), c.blue()); + c = flattenColor2->color(); + opt.rgb2 = fmt_filters::rgb(c.red(), c.green(), c.blue()); + } + break; + case F::fimplode: opt._double1 = implodeFactor->value(); break; + case F::fnegative: break; + case F::fnoise: opt._uint = buttonGroupNoise->selectedId(); break; + case F::foil: opt._double1 = (double)oilRadius->value(); break; + case F::fshade: opt._bool = shadeColor->isChecked(); opt._double1 = shadeAzim->value(); opt._double2 = shadeElev->value(); break; + case F::fsharpen: opt._double1 = sharpenRadius->value(); opt._double2 = sharpenSigma->value();break; + case F::fsolarize: opt._double1 = solarizeValue->value(); break; + case F::fspread: opt._uint = spreadValue->value(); break; + case F::fswapRGB: opt._uint = buttonGroupSwapRGB->selectedId(); break; + case F::fswirl: opt._double1 = swirlAngle->value(); break; + case F::fthreshold: opt._uint = thresholdValue->value(); break; + case F::fgray: break; + case F::fredeye: opt._uint = thresholdRE->value(); break; + } + + emit filter(&opt); +} + +void SQ_ImageFilter::slotShowPage() +{ + int id = listMain->currentItem(); + + widgetStackFilters->raiseWidget(id); + + switch(id) + { + case F::fblend: blend(); break; + case F::fblur: blur(); break; + case F::fdesaturate: desaturate(); break; + case F::fdespeckle: despeckle(); break; + case F::fedge: edge(); break; + case F::femboss: emboss(); break; + case F::fequalize: equalize(); break; + case F::ffade: fade(); break; + case F::fflatten: flatten(); break; + case F::fimplode: implode(); break; + case F::fnegative: negative(); break; + case F::fnoise: noise(); break; + case F::foil: oil(); break; + case F::fshade: shade(); break; + case F::fsharpen: sharpen(); break; + case F::fsolarize: solarize(); break; + case F::fspread: spread(); break; + case F::fswapRGB: swapRGB(); break; + case F::fswirl: swirl(); break; + case F::fthreshold: threshold(); break; + case F::fgray: togray(); break; + case F::fredeye: redeye(); break; + } +} + +void SQ_ImageFilter::setPreviewImage(const QImage &im) +{ + if(im.isNull()) return; + + sample = im.copy(); + sample_saved = sample.copy(); + + QPixmap p; + + p.convertFromImage(sample_saved); + pixmap->setPixmap(p); + pixmap1->setPixmap(p); + + slotShowPage(); +} + +void SQ_ImageFilter::assignNewImage(const QImage &im) +{ + QPixmap p; + p.convertFromImage(im); + pixmap1->setPixmap(p); +} + +void SQ_ImageFilter::swapRGB() +{ + if(sample.isNull() || sample_saved.isNull()) + return; + + sample = sample_saved.copy(); + + int id = buttonGroupSwapRGB->selectedId(); + + if(id == -1) + return; + + fmt_filters::image im(sample.bits(), sample.width(), sample.height()); + + fmt_filters::swapRGB(im, (id ? fmt_filters::GBR : fmt_filters::BRG)); + + assignNewImage(sample); +} + +void SQ_ImageFilter::negative() +{ + if(sample.isNull() || sample_saved.isNull()) + return; + + sample = sample_saved.copy(); + + fmt_filters::image im(sample.bits(), sample.width(), sample.height()); + + fmt_filters::negative(im); + + assignNewImage(sample); +} + +void SQ_ImageFilter::blend() +{ + if(sample.isNull() || sample_saved.isNull()) + return; + + sample = sample_saved.copy(); + + fmt_filters::image im(sample.bits(), sample.width(), sample.height()); + + QColor c = pushBlendColor->color(); + + fmt_filters::rgb rgb(c.red(), c.green(), c.blue()); + + fmt_filters::blend(im, rgb, blendOpacity->value()); + + assignNewImage(sample); +} + +void SQ_ImageFilter::fade() +{ + if(sample.isNull() || sample_saved.isNull()) + return; + + sample = sample_saved.copy(); + + fmt_filters::image im(sample.bits(), sample.width(), sample.height()); + + QColor c = fadeColor->color(); + + fmt_filters::fade(im, fmt_filters::rgb(c.red(), c.green(), c.blue()), fadeValue->value()); + + assignNewImage(sample); +} + +void SQ_ImageFilter::togray() +{ + if(sample.isNull() || sample_saved.isNull()) + return; + + sample = sample_saved.copy(); + + fmt_filters::image im(sample.bits(), sample.width(), sample.height()); + + fmt_filters::gray(im); + + assignNewImage(sample); +} + +void SQ_ImageFilter::desaturate() +{ + if(sample.isNull() || sample_saved.isNull()) + return; + + sample = sample_saved.copy(); + + fmt_filters::image im(sample.bits(), sample.width(), sample.height()); + + fmt_filters::desaturate(im, desaturateValue->value()); + + assignNewImage(sample); +} + +void SQ_ImageFilter::threshold() +{ + if(sample.isNull() || sample_saved.isNull()) + return; + + sample = sample_saved.copy(); + + fmt_filters::image im(sample.bits(), sample.width(), sample.height()); + + fmt_filters::threshold(im, thresholdValue->value()); + + assignNewImage(sample); +} + +void SQ_ImageFilter::solarize() +{ + if(sample.isNull() || sample_saved.isNull()) + return; + + sample = sample_saved.copy(); + + fmt_filters::image im(sample.bits(), sample.width(), sample.height()); + + fmt_filters::solarize(im, solarizeValue->value()); + + assignNewImage(sample); +} + +void SQ_ImageFilter::spread() +{ + if(sample.isNull() || sample_saved.isNull()) + return; + + sample = sample_saved.copy(); + + fmt_filters::image im(sample.bits(), sample.width(), sample.height()); + + fmt_filters::spread(im, spreadValue->value()); + + assignNewImage(sample); +} + +void SQ_ImageFilter::swirl() +{ + if(sample.isNull() || sample_saved.isNull()) + return; + + sample = sample_saved.copy(); + + fmt_filters::image im(sample.bits(), sample.width(), sample.height()); + + fmt_filters::swirl(im, swirlAngle->value(), fmt_filters::rgba(255,255,255,255)); + + assignNewImage(sample); +} + +void SQ_ImageFilter::noise() +{ + if(sample.isNull() || sample_saved.isNull()) + return; + + sample = sample_saved.copy(); + + fmt_filters::image im(sample.bits(), sample.width(), sample.height()); + + fmt_filters::noise(im, (fmt_filters::NoiseType)buttonGroupNoise->selectedId()); + + assignNewImage(sample); +} + +void SQ_ImageFilter::redeye() +{ + if(sample.isNull() || sample_saved.isNull()) + return; + + sample = sample_saved.copy(); + + fmt_filters::image im(sample.bits(), sample.width(), sample.height()); + + fmt_filters::redeye(im, im.w, im.h, 0, 0, thresholdRE->value()); + + assignNewImage(sample); +} + +void SQ_ImageFilter::flatten() +{ + if(sample.isNull() || sample_saved.isNull()) + return; + + sample = sample_saved.copy(); + + fmt_filters::image im(sample.bits(), sample.width(), sample.height()); + + QColor c1 = flattenColor1->color(); + QColor c2 = flattenColor2->color(); + + fmt_filters::flatten(im, fmt_filters::rgb(c1.red(), c1.green(), c1.blue()), fmt_filters::rgb(c2.red(), c2.green(), c2.blue())); + + assignNewImage(sample); +} + +void SQ_ImageFilter::shade() +{ + if(sample.isNull() || sample_saved.isNull()) + return; + + sample = sample_saved.copy(); + + fmt_filters::image im(sample.bits(), sample.width(), sample.height()); + + fmt_filters::shade(im, shadeColor->isChecked(), shadeAzim->value(), shadeElev->value()); + + assignNewImage(sample); +} + +void SQ_ImageFilter::equalize() +{ + if(sample.isNull() || sample_saved.isNull()) + return; + + sample = sample_saved.copy(); + + fmt_filters::image im(sample.bits(), sample.width(), sample.height()); + + fmt_filters::equalize(im); + + assignNewImage(sample); +} + +void SQ_ImageFilter::blur() +{ + if(sample.isNull() || sample_saved.isNull()) + return; + + sample = sample_saved.copy(); + + fmt_filters::image im(sample.bits(), sample.width(), sample.height()); + + fmt_filters::blur(im, blurRadius->value(), blurSigma->value()); + + assignNewImage(sample); +} + +void SQ_ImageFilter::despeckle() +{ + if(sample.isNull() || sample_saved.isNull()) + return; + + sample = sample_saved.copy(); + + fmt_filters::image im(sample.bits(), sample.width(), sample.height()); + + fmt_filters::despeckle(im); + + assignNewImage(sample); +} + +void SQ_ImageFilter::implode() +{ + if(sample.isNull() || sample_saved.isNull()) + return; + + sample = sample_saved.copy(); + + fmt_filters::image im(sample.bits(), sample.width(), sample.height()); + + fmt_filters::implode(im, implodeFactor->value(), fmt_filters::white); + + assignNewImage(sample); +} + +void SQ_ImageFilter::edge() +{ + if(sample.isNull() || sample_saved.isNull()) + return; + + sample = sample_saved.copy(); + + fmt_filters::image im(sample.bits(), sample.width(), sample.height()); + + fmt_filters::edge(im, (double)edgeRadius->value()); + + assignNewImage(sample); +} + +void SQ_ImageFilter::emboss() +{ + if(sample.isNull() || sample_saved.isNull()) + return; + + sample = sample_saved.copy(); + + fmt_filters::image im(sample.bits(), sample.width(), sample.height()); + + fmt_filters::emboss(im, embossRadius->value(), embossSigma->value()); + + assignNewImage(sample); +} + +void SQ_ImageFilter::sharpen() +{ + if(sample.isNull() || sample_saved.isNull()) + return; + + sample = sample_saved.copy(); + + fmt_filters::image im(sample.bits(), sample.width(), sample.height()); + + fmt_filters::sharpen(im, sharpenRadius->value(), sharpenSigma->value()); + + assignNewImage(sample); +} + +void SQ_ImageFilter::oil() +{ + if(sample.isNull() || sample_saved.isNull()) + return; + + sample = sample_saved.copy(); + + fmt_filters::image im(sample.bits(), sample.width(), sample.height()); + + fmt_filters::oil(im, oilRadius->value()); + + assignNewImage(sample); +} + +void SQ_ImageFilter::hackConnect() +{ + connect( blendOpacity, SIGNAL( valueChanged(double) ), this, SLOT( blend() ) ); + connect( pushBlendColor, SIGNAL( changed(const QColor&) ), this, SLOT( blend() ) ); + connect( blurRadius, SIGNAL( valueChanged(double) ), this, SLOT( blur() ) ); + connect( blurSigma, SIGNAL( valueChanged(double) ), this, SLOT( blur() ) ); + connect( desaturateValue, SIGNAL( valueChanged(double) ), this, SLOT( desaturate() ) ); + connect( edgeRadius, SIGNAL( valueChanged(int) ), this, SLOT( edge() ) ); + connect( embossRadius, SIGNAL( valueChanged(double) ), this, SLOT( emboss() ) ); + connect( embossSigma, SIGNAL( valueChanged(double) ), this, SLOT( emboss() ) ); + connect( fadeColor, SIGNAL( changed(const QColor&) ), this, SLOT( fade() ) ); + connect( fadeValue, SIGNAL( valueChanged(double) ), this, SLOT( fade() ) ); + connect( flattenColor1, SIGNAL( changed(const QColor&) ), this, SLOT( flatten() ) ); + connect( flattenColor2, SIGNAL( changed(const QColor&) ), this, SLOT( flatten() ) ); + connect( implodeFactor, SIGNAL( valueChanged(double) ), this, SLOT( implode() ) ); + connect( buttonGroupNoise, SIGNAL( clicked(int) ), this, SLOT( noise() ) ); + connect( oilRadius, SIGNAL( valueChanged(int) ), this, SLOT( oil() ) ); + connect( shadeAzim, SIGNAL( valueChanged(double) ), this, SLOT( shade() ) ); + connect( shadeColor, SIGNAL( toggled(bool) ), this, SLOT( shade() ) ); + connect( shadeElev, SIGNAL( valueChanged(double) ), this, SLOT( shade() ) ); + connect( sharpenRadius, SIGNAL( valueChanged(double) ), this, SLOT( sharpen() ) ); + connect( sharpenSigma, SIGNAL( valueChanged(double) ), this, SLOT( sharpen() ) ); + connect( solarizeValue, SIGNAL( valueChanged(double) ), this, SLOT( solarize() ) ); + connect( spreadValue, SIGNAL( valueChanged(int) ), this, SLOT( spread() ) ); + connect( buttonGroupSwapRGB, SIGNAL( clicked(int) ), this, SLOT( swapRGB() ) ); + connect( swirlAngle, SIGNAL( valueChanged(double) ), this, SLOT( swirl() ) ); + connect( thresholdValue, SIGNAL( valueChanged(int) ), this, SLOT( threshold() ) ); + connect( thresholdRE, SIGNAL( valueChanged(int) ), this, SLOT( redeye() ) ); +} + +SQ_ImageFilter* SQ_ImageFilter::instance() +{ + return m_inst; +} diff --git a/ksquirrel/ksquirrelpart/sq_imageproperties.ui b/ksquirrel/ksquirrelpart/sq_imageproperties.ui new file mode 100644 index 0000000..80e92fd --- /dev/null +++ b/ksquirrel/ksquirrelpart/sq_imageproperties.ui @@ -0,0 +1,969 @@ + +SQ_ImageProperties + + + SQ_ImageProperties + + + + 0 + 0 + 495 + 384 + + + + Image properties + + + true + + + + unnamed + + + + pushButton1 + + + Close + + + false + + + true + + + false + + + + + spacer1 + + + Horizontal + + + Expanding + + + + 470 + 20 + + + + + + tabWidget + + + + tab + + + File + + + + unnamed + + + + spacer12 + + + Vertical + + + Expanding + + + + 20 + 10 + + + + + + groupBox1 + + + Attributes + + + true + + + + unnamed + + + + textLabel4_2 + + + + 3 + 0 + 0 + 0 + + + + Owner: + + + + + textLabel5_2 + + + + 3 + 0 + 0 + 0 + + + + Group: + + + + + textOwner + + + + + + + + textLabel27_2 + + + + 3 + 0 + 0 + 0 + + + + Permissions: + + + AlignVCenter + + + + + textPermissions + + + + 7 + 5 + 0 + 0 + + + + + + + + + textGroup + + + + + + + + + + groupBox2 + + + Time + + + true + + + false + + + + unnamed + + + + textLabel1_2_2 + + + + 3 + 0 + 0 + 0 + + + + Created: + + + WordBreak|AlignTop + + + + + textLabel2_2_2 + + + + 3 + 0 + 0 + 0 + + + + Last read: + + + WordBreak|AlignTop + + + + + textLabel3_2_2 + + + + 3 + 0 + 0 + 0 + + + + Last modified: + + + WordBreak|AlignTop + + + + + textCreated + + + + 7 + 5 + 0 + 0 + + + + + + + + + textLastRead + + + + 7 + 5 + 0 + 0 + + + + + + + + + textLastMod + + + + 7 + 5 + 0 + 0 + + + + + + + + + + + groupBox3 + + + General + + + true + + + + unnamed + + + + textLabel2_3 + + + + 5 + 0 + 0 + 0 + + + + File: + + + + + textSize + + + + 7 + 5 + 0 + 0 + + + + + + + + + textLabel1_4 + + + + 5 + 0 + 0 + 0 + + + + Directory: + + + + + textLabel3_3 + + + + 5 + 0 + 0 + 0 + + + + Size: + + + + + lineDirectory + + + true + + + + + lineFile + + + true + + + + + + + + + tab + + + Image + + + + unnamed + + + + layout5 + + + + unnamed + + + + layout3 + + + + unnamed + + + + textLabel6_2_2_2 + + + Type: + + + AlignTop|AlignRight + + + + + textLabel11_2_2_2 + + + Number of frames: + + + AlignTop|AlignRight + + + + + textLabel23_2_2_2_2_3 + + + + 3 + 5 + 0 + 0 + + + + Current frame + + + AlignTop|AlignRight + + + + + textLabel23_2_2_2_2_4 + + + + 3 + 5 + 0 + 0 + + + + Delay: + + + AlignTop|AlignRight + + + + + textLabel7_2_2_2 + + + Dimensions: + + + AlignTop|AlignRight + + + + + textLabel8_2_2_2 + + + Bits per pixel: + + + AlignTop|AlignRight + + + + + textLabel9_2_2_2 + + + Color space: + + + AlignTop|AlignRight + + + + + textLabel10_2_2_2 + + + Compression: + + + AlignTop|AlignRight + + + + + textLabel21_2_2_2 + + + Uncompressed size: + + + AlignTop|AlignRight + + + + + textLabel23_2_2_2 + + + + 3 + 5 + 0 + 0 + + + + Compression ratio: + + + AlignTop|AlignRight + + + + + textLabel23_2_2_2_2 + + + + 3 + 5 + 0 + 0 + + + + Interlaced: + + + AlignTop|AlignRight + + + + + textLabel23_2_2_2_2_2 + + + + 3 + 5 + 0 + 0 + + + + Status: + + + AlignTop|AlignRight + + + + + spacer10 + + + Vertical + + + Expanding + + + + 210 + 16 + + + + + + + + layout4 + + + + unnamed + + + + textType + + + + 7 + 5 + 0 + 0 + + + + + + + + + textFrames + + + + 7 + 5 + 0 + 0 + + + + + + + + + textFrame + + + + + + + + textDelay + + + + + + + + textDimensions + + + + 7 + 5 + 0 + 0 + + + + + + + + + textBpp + + + + 7 + 5 + 0 + 0 + + + + + + + + + textColorModel + + + + 7 + 5 + 0 + 0 + + + + + + + + + textCompression + + + + 7 + 5 + 0 + 0 + + + + + + + + + textUncompressed + + + + 7 + 5 + 0 + 0 + + + + + + + + + textRatio + + + + 7 + 5 + 0 + 0 + + + + + + + + + textInterlaced + + + + + + + + layout1 + + + + unnamed + + + + textStatusIcon + + + + 0 + 5 + 0 + 0 + + + + + + + + + textStatus + + + + + + + + + + spacer11 + + + Vertical + + + Expanding + + + + 205 + 16 + + + + + + + + + + + + TabPage + + + Metadata + + + + unnamed + + + + + Group + + + true + + + true + + + + + Value + + + true + + + true + + + + listMeta + + + true + + + + + + + + + + pushButton1 + clicked() + SQ_ImageProperties + close() + + + listMeta + contextMenuRequested(QListViewItem*,const QPoint&,int) + SQ_ImageProperties + slotContextMenu(QListViewItem*,const QPoint&,int) + + + + tabWidget + lineDirectory + lineFile + listMeta + pushButton1 + + + qvaluevector.h + qvariant.h + qpair.h + qpixmap.h + kurl.h + kio/job.h + kfileitem.h + qstringlist.h + qfileinfo.h + kio/global.h + kpopupmenu.h + kstdaction.h + kaction.h + qapplication.h + qclipboard.h + qdir.h + sq_iconloader.h + qbuttongroup.h + klocale.h + sq_imageproperties.ui.h + + + class KPopupMenu; + class KAction; + namespace KIO { class Job; } + + + KURL url; + QWidget *kew; + QPixmap ok, error; + KPopupMenu *menu; + QListViewItem *data; + int z, exifMode; + KAction *copy, *copyentry, *copyall; + QString file; + + + slotContextMenu( QListViewItem * item, const QPoint & p, int z1 ) + slotCopyString() + slotCopyAll() + slotCopyEntry() + slotModeClicked( int id ) + slotStatResult( KIO::Job * job ) + + + init() + destroy() + setParams( QStringList & l ) + setURL( const KURL & _url ) + setFileParams() + setMetaInfo( QValueVector<QPair<QString, QString> > meta ) + setFile( const QString & _file ) + + + diff --git a/ksquirrel/ksquirrelpart/sq_imageproperties.ui.h b/ksquirrel/ksquirrelpart/sq_imageproperties.ui.h new file mode 100644 index 0000000..b597b84 --- /dev/null +++ b/ksquirrel/ksquirrelpart/sq_imageproperties.ui.h @@ -0,0 +1,264 @@ +/**************************************************************************** +** ui.h extension file, included from the uic-generated form implementation. +** +** If you wish to add, delete or rename functions or slots use +** Qt Designer which will update this file, preserving your code. Create an +** init() function in place of a constructor, and a destroy() function in +** place of a destructor. +*****************************************************************************/ + +/* + * SQ_ImageProperties shows image properties. + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#ifdef SQ_HAVE_KEXIF +#include +#include +#include +#include "sq_config.h" +#endif + +void SQ_ImageProperties::init() +{ + menu = new KPopupMenu; + copy = KStdAction::copy(this, SLOT(slotCopyString()), 0); + copyentry = new KAction(i18n("Copy entry"), 0, this, SLOT(slotCopyEntry()), 0); + copyall = new KAction(i18n("Copy all entries"), 0, this, SLOT(slotCopyAll()), 0); + + copyentry->setIcon(copy->icon()); + copyall->setIcon(copy->icon()); + + copy->plug(menu); + copyentry->plug(menu); + copyall->plug(menu); + + ok = SQ_IconLoader::instance()->loadIcon("ok", KIcon::Desktop, 16); + error = SQ_IconLoader::instance()->loadIcon("error", KIcon::Desktop, 16); +} + +void SQ_ImageProperties::destroy() +{ +#ifdef SQ_HAVE_KEXIF + SQ_Config::instance()->setGroup("GL view"); + SQ_Config::instance()->writeEntry("exifmode", exifMode); +#endif + + delete copyall; + delete copyentry; + delete copy; + delete menu; +} + +void SQ_ImageProperties::setParams(QStringList &l) +{ + setFileParams(); + + QStringList::Iterator it = l.begin(); + textType->setText(*it); ++it; + textDimensions->setText(*it); ++it; + textBpp->setText(*it); ++it; + textColorModel->setText(*it); ++it; + textCompression->setText(*it); ++it; + textUncompressed->setText(*it); ++it; + textRatio->setText(*it); ++it; + textInterlaced->setText(*it); ++it; + int errors = (*it).toInt(); ++it; + textFrames->setText(*it); ++it; + textFrame->setText(*it); ++it; + QString s = QString::fromLatin1("%1").arg(i18n("1 error", "%n errors", errors)); + textStatus->setText((errors)?s:QString::null); + textStatusIcon->setPixmap((errors)?error:ok); + + s = QString::fromLatin1("%1%2").arg(*it).arg(i18n(" ms.")); + textDelay->setText(s); +} + +void SQ_ImageProperties::setURL(const KURL &_url) +{ + url = _url; +} + +void SQ_ImageProperties::setFileParams() +{ + KIO::Job *stjob = KIO::stat(url, false); + connect(stjob, SIGNAL(result(KIO::Job *)), this, SLOT(slotStatResult(KIO::Job *))); + +#ifdef SQ_HAVE_KEXIF + SQ_Config::instance()->setGroup("GL view"); + exifMode = SQ_Config::instance()->readNumEntry("exifmode", 0); + + QWidget *tabWidgetEXIF = new QWidget(tabWidget, "tabWidgetEXIF"); + tabWidget->addTab(tabWidgetEXIF, i18n("EXIF")); + QGridLayout *pageLayout6 = new QGridLayout(tabWidgetEXIF, 2, 1, 11, 6, "tabWidgetEXIFLayout"); + + QButtonGroup *gr = new QButtonGroup(tabWidgetEXIF, "EXIF mode"); + gr->setFrameShape(QFrame::NoFrame); + gr->setExclusive(true); + connect(gr, SIGNAL(clicked(int)), this, SLOT(slotModeClicked(int))); + + QGridLayout *pageLayoutGR = new QGridLayout(gr, 1, 3, 0, -1, "tabWidgetEXIFGRLayout"); + + QPushButton *mode1 = new QPushButton(i18n("Simple"), gr, "mode1"); + mode1->setToggleButton(true); + + QPushButton *mode2 = new QPushButton(i18n("Full"), gr, "mode2"); + mode2->setToggleButton(true); + + QSpacerItem *spacer = new QSpacerItem(15, 1, QSizePolicy::Expanding, QSizePolicy::Minimum); + + // create KEXIF widget and load metadata from file + KExifWidget *kew1 = new KExifWidget(tabWidgetEXIF); + kew1->loadFile(file); + + // hack to workaround poor libkexif API + QObjectList *ch = const_cast(kew1->children()); + for(QObjectList::iterator it = ch->begin();it != ch->end();++it) + { + if((*it)->inherits("QListView")) + { + QListView *l = dynamic_cast(*it); + QWidget *w = tabWidget->page(3); + + if(l && w && !l->childCount()) + tabWidget->changeTab(w, i18n("EXIF (no)")); + + break; + } + } + + // set proper button on + if(exifMode) + { + mode2->setOn(true); + kew1->setMode(KExifWidget::FULL); + } + else + { + mode1->setOn(true); + kew1->setMode(KExifWidget::SIMPLE); + } + + // finally, add all widgets to layouts + pageLayoutGR->addWidget(mode1, 0, 0); + pageLayoutGR->addWidget(mode2, 0, 1); + pageLayoutGR->addItem(spacer, 0, 2); + + pageLayout6->addWidget(gr, 0, 0); + pageLayout6->addWidget(kew1, 1, 0); + kew = kew1; +#endif +} + +void SQ_ImageProperties::setMetaInfo(QValueVector > meta ) +{ + QListViewItem *after = 0, *item; + + QValueVector >::iterator itEnd = meta.end(); + + for(QValueVector >::iterator it = meta.begin();it != itEnd;++it) + { + if(after) + item = new QListViewItem(listMeta, after, (*it).first+QString::fromLatin1(" "), (*it).second.replace(QChar('\n'), QChar(' '))); + else + after = item = new QListViewItem(listMeta, (*it).first+QString::fromLatin1(" "), (*it).second.replace(QChar('\n'), QChar(' '))); + + listMeta->insertItem(item); + } + + if(!listMeta->childCount()) + { + listMeta->header()->hide(); + + QWidget *w = tabWidget->page(2); + + if(w) + tabWidget->changeTab(w, i18n("Metadata (no)")); + } +} + +void SQ_ImageProperties::slotContextMenu( QListViewItem *item, const QPoint &p, int z1 ) +{ + if(item) + { + data = item; + z = z1; + menu->exec(p); + } +} + +void SQ_ImageProperties::slotCopyString() +{ + QApplication::clipboard()->setText(data->text(z), QClipboard::Clipboard); +} + +void SQ_ImageProperties::slotCopyAll() +{ + if(!data) + return; + + QString app; + QListViewItem *item = listMeta->firstChild(); + + for(;item;item = item->itemBelow()) + { + app.append(item->text(0) + "\n" + item->text(1) + "\n"); + } + + QApplication::clipboard()->setText(app, QClipboard::Clipboard); +} + +void SQ_ImageProperties::slotCopyEntry() +{ + if(!data) + return; + + QString app = data->text(0) + "\n" + data->text(1) + "\n"; + + QApplication::clipboard()->setText(app, QClipboard::Clipboard); +} + +void SQ_ImageProperties::slotModeClicked(int id) +{ +// change mode: simple or full +#ifdef SQ_HAVE_KEXIF + exifMode = id; + static_cast(kew)->setMode(id ? KExifWidget::FULL : KExifWidget::SIMPLE); +#endif +} + +void SQ_ImageProperties::slotStatResult(KIO::Job *job) +{ + if(!job->error()) + { + KIO::UDSEntry entry = static_cast(job)->statResult(); + KFileItem fi(entry, url); + + KURL t = url; + t.cd(".."); + lineDirectory->setText(t.isLocalFile() ? t.path() : t.prettyURL()); + lineFile->setText(fi.name()); + + textSize->setText(KIO::convertSize(fi.size())); + textOwner->setText(QString("%1").arg(fi.user())); + textGroup->setText(QString("%1").arg(fi.group())); + textPermissions->setText(fi.permissionsString()); + + QDateTime abs; + abs.setTime_t(fi.time(KIO::UDS_CREATION_TIME)); + textCreated->setText(abs.toString("dd/MM/yyyy hh:mm:ss")); + abs.setTime_t(fi.time(KIO::UDS_ACCESS_TIME)); + textLastRead->setText(abs.toString("dd/MM/yyyy hh:mm:ss")); + abs.setTime_t(fi.time(KIO::UDS_MODIFICATION_TIME)); + textLastMod->setText(abs.toString("dd/MM/yyyy hh:mm:ss")); + } +} + +// set local file for KEXIF +void SQ_ImageProperties::setFile(const QString &_file) +{ + file = _file; +} diff --git a/ksquirrel/ksquirrelpart/sq_label.cpp b/ksquirrel/ksquirrelpart/sq_label.cpp new file mode 100644 index 0000000..4d9b14a --- /dev/null +++ b/ksquirrel/ksquirrelpart/sq_label.cpp @@ -0,0 +1,78 @@ +/*************************************************************************** + sq_label.cpp - description + ------------------- + begin : June 10 2005 + copyright : (C) 2005 by Baryshev Dmitry + email : ksquirrel.iv@gmail.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#include + +#include "sq_label.h" + +#define MARGIN 15 + +SQ_Label::SQ_Label(QWidget *parent, const char *name) : QWidget(parent, name), single(false) +{} + +SQ_Label::~SQ_Label() +{} + +void SQ_Label::paintEvent(QPaintEvent *) +{ + if((single && ltext.isEmpty() && rtext.isEmpty()) || (!single && ltext.isEmpty())) + return; + + QPainter paint(this); + + QFont font = paint.font(); + font.setBold(true); + font.setPointSize(10); + paint.setFont(font); + + if(!single) + { + paint.translate((width() + paint.fontMetrics().height()) / 2, height()); + paint.rotate(-90); + paint.drawText(MARGIN, 0, ltext); + + paint.translate(height() - paint.fontMetrics().width(rtext), 0); + paint.drawText(-MARGIN, 0, rtext); + } + else + { + paint.translate((width() + paint.fontMetrics().height()) / 2, + (height() + paint.fontMetrics().width(ltext)) / 2); + paint.rotate(-90); + paint.drawText(0, 0, ltext); + } +} + +void SQ_Label::setText(const QString <, const QString &rt) +{ + ltext = lt; + rtext = rt; + + update(); +} + +void SQ_Label::setText(const QString <) +{ + ltext = lt; + + update(); +} + +void SQ_Label::setSingle(bool s) +{ + single = s; +} diff --git a/ksquirrel/ksquirrelpart/sq_label.h b/ksquirrel/ksquirrelpart/sq_label.h new file mode 100644 index 0000000..7b54753 --- /dev/null +++ b/ksquirrel/ksquirrelpart/sq_label.h @@ -0,0 +1,41 @@ +/*************************************************************************** + sq_label.h - description + ------------------- + begin : June 10 2005 + copyright : (C) 2005 by Baryshev Dmitry + email : ksquirrel.iv@gmail.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifndef SQ_LABEL_H +#define SQ_LABEL_H + +#include + +class SQ_Label : public QWidget +{ + public: + SQ_Label(QWidget *parent = 0, const char *name = 0); + ~SQ_Label(); + + void setText(const QString <, const QString &rt); + void setText(const QString <); + void setSingle(bool s); + + protected: + void paintEvent(QPaintEvent *); + + private: + QString ltext, rtext; + bool single; +}; + +#endif diff --git a/ksquirrel/ksquirrelpart/sq_library.h b/ksquirrel/ksquirrelpart/sq_library.h new file mode 100644 index 0000000..ac1dff3 --- /dev/null +++ b/ksquirrel/ksquirrelpart/sq_library.h @@ -0,0 +1,97 @@ +/*************************************************************************** + sq_library.h - description + ------------------- + begin : 27 2005 + copyright : (C) 2005 by Baryshev Dmitry + email : ksquirrel.iv@gmail.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifndef SQ_LIBRARY_H +#define SQ_LIBRARY_H + +#include +#include +#include + +#include +#include + +class QLibrary; + +class KTempFile; + +class fmt_codec_base; + +/* + * SQ_LIBRARY represents a library. It contains all information + * needed by other classes, e.g. pointer to codec, mime image, + * version string, filter string, etc. + * + * Used by SQ_LibraryHandler. + */ + +struct SQ_LIBRARY +{ + SQ_LIBRARY() : lib(0), codec(0), codec_il(0), tmp(0), tmp_il(0) + {} + + // pointer to library + QLibrary *lib; + + // path to a library on disk + QString libpath; + + // converted regular expression + QRegExp regexp; + + // filter for a filemanager + QString filter; + + // path to config file (.ui) + QString config; + + fmt_settings settings; + + // regular expression as string + QString regexp_str; + + QString mimetype; + + bool mime_multi; + + // information on codec + QString quickinfo; + + // codec's version + QString version; + + // pointer to a codec + fmt_codec_base *codec, *codec_il; + + // 'create' and 'destroy' functions. + // should exist in library! + fmt_codec_base* (*codec_create)(); + void (*codec_destroy)(fmt_codec_base*); + + QPixmap mime; + + // options for writers. + fmt_writeoptionsabs opt; + + bool writestatic, writeanimated; + bool readable; + bool canbemultiple, needtempfile; + + KTempFile *tmp, *tmp_il; +}; + +#endif diff --git a/ksquirrel/ksquirrelpart/sq_libraryhandler.cpp b/ksquirrel/ksquirrelpart/sq_libraryhandler.cpp new file mode 100644 index 0000000..0e10424 --- /dev/null +++ b/ksquirrel/ksquirrelpart/sq_libraryhandler.cpp @@ -0,0 +1,577 @@ +/*************************************************************************** + sq_libraryhandler.cpp - description + ------------------- + begin : Mar 5 2004 + copyright : (C) 2004 by Baryshev Dmitry + email : ksquirrel.iv@gmail.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include "sq_libraryhandler.h" +#include "sq_config.h" + +#include + +#include +#include + +static const int buffer_size = 10; + +SQ_LibraryHandler * SQ_LibraryHandler::m_instance = 0; + +// SQ_LibraryHandler +SQ_LibraryHandler::SQ_LibraryHandler(QObject *parent) + : QObject(parent), QValueVector() +{ + m_instance = this; + + kdDebug() << "+SQ_LibraryHandler" << endl; + + kconf = new KConfig("ksquirrel-codec-settings"); + + load(); +} + +SQ_LibraryHandler::~SQ_LibraryHandler() +{ + clear(); + + delete kconf; + + kdDebug() << "-SQ_LibraryHandler" << endl; +} + +/* + * Find appropriate SQ_LIBRARY by filename. If + * not found, return NULL. + */ +SQ_LIBRARY* SQ_LibraryHandler::libraryForFile(const KURL &url) +{ + KMimeType::Ptr mime = KMimeType::findByURL(url); + + iterator itEnd = end(); + + SQ_LIBRARY *l = 0; + + // go through array and compare names + for(iterator it = begin();it != itEnd;++it) + { + if((*it).mime_multi) + { + if((*it).mimetype.find(mime->name()) != -1) + { + l = &(*it); + break; + } + } + else if((*it).mimetype == mime->name()) + { + l = &(*it); + break; + } + } + +#if 0 + if(l) + kdDebug() << KStringHandler::lsqueeze(url.prettyURL()) + << "\" => " + << l->quickinfo + << endl; +#endif + + return l; +} + +SQ_LIBRARY* SQ_LibraryHandler::libraryForFile(const QString &path) +{ + KURL u; + u.setPath(path); + + return libraryForFile(u); +} + +/* + * Get all filters as one string. + */ +QString SQ_LibraryHandler::allFiltersString() const +{ + QString ret; + + const_iterator itEnd = end(); + + // construct string + for(const_iterator it = begin();it != itEnd;++it) + { + if(!(*it).filter.isEmpty()) + ret = ret + (*it).filter + ' '; + } + + return ret; +} + +QString SQ_LibraryHandler::allFiltersFileDialogString(bool r, bool allfiles) const +{ + QString ret; + + const_iterator itEnd = end(); + + // construct string + for(const_iterator it = begin();it != itEnd;++it) + { + if(!r) + if((*it).writestatic) + ret = ret + (*it).filter + '|' + (*it).quickinfo + '\n'; + else; + else if((*it).readable) + ret = ret + (*it).filter + '|' + (*it).quickinfo + '\n'; + } + + return allfiles ? (ret + "*.*|" + i18n("All files")) : ret.left(ret.length() - 1); +} + +/* + * Fill 'filters' with all found filters, and + * 'quick' with appropriate information. + */ +void SQ_LibraryHandler::allFilters(QStringList &filters, QStringList &quick) const +{ + // clear rubbish + filters.clear(); + quick.clear(); + + // no found libraries ? + if(empty()) + return; + + const_iterator itEnd = end(); + + // go through array and fill QStringLists + for(const_iterator it = begin();it != itEnd;++it) + if(!(*it).filter.isEmpty()) + { + filters.append((*it).filter); + quick.append((*it).quickinfo); + } +} + +void SQ_LibraryHandler::allWritableFilters(QStringList &filters, QStringList &quick) const +{ + // clear rubbish + filters.clear(); + quick.clear(); + + // no libraries ? + if(empty()) + return; + + const_iterator itEnd = end(); + + // go through array and fill QStringLists + for(const_iterator it = begin();it != itEnd;++it) + if((*it).writestatic && !(*it).filter.isEmpty()) + { + filters.append((*it).filter); + quick.append((*it).quickinfo); + } +} + +/* + * Remove and unload all libraries. + */ +void SQ_LibraryHandler::clear() +{ + kdDebug() << "SQ_LibraryHandler::clear()" << endl; + + iterator itEnd = end(); + + // unload libraries on clear() + for(iterator it = begin();it != itEnd;++it) + { + writeSettings(&(*it)); + + // delete temp file + if((*it).needtempfile) + { + delete (*it).tmp_il; + delete (*it).tmp; + } + + (*it).codec_destroy((*it).codec_il); + (*it).codec_destroy((*it).codec); + delete (*it).lib; + (*it).lib = 0; + } + + QValueVector::clear(); +} + +/* + * Add new libraries. + */ +void SQ_LibraryHandler::add(QStringList &foundLibraries) +{ + codec_options o; + + QStringList::iterator itEnd = foundLibraries.end(); + + for(QStringList::iterator it = foundLibraries.begin();it != itEnd;++it) + { + QFileInfo ff(*it); + + SQ_LIBRARY libtmp; + + // create QLibrary object + libtmp.lib = new QLibrary(*it); + libtmp.libpath = *it; + libtmp.lib->load(); + + // resolve create() and destroy() functions + libtmp.codec_create = (fmt_codec_base*(*)())(libtmp.lib)->resolve(QString::fromLatin1("codec_create")); + libtmp.codec_destroy = (void (*)(fmt_codec_base*))(libtmp.lib)->resolve(QString::fromLatin1("codec_destroy")); + + // couldn't resolve - corrupted library ? + if(!libtmp.codec_create || !libtmp.codec_destroy) + { + libtmp.lib->unload(); + delete libtmp.lib; + } + else + { + // create codec ! + fmt_codec_base *codeK = libtmp.codec_create(); + + // read options + codeK->options(&o); + + QString q = o.name; + + // Yet unknown library ? + if(!alreadyInMap(q)) + { + libtmp.mime = QPixmap(reinterpret_cast(o.pixmap)); + libtmp.mimetype = o.mimetype; + libtmp.mime_multi = libtmp.mimetype.find(';') != -1; + libtmp.quickinfo = q; + libtmp.filter = o.filter; + libtmp.version = o.version; + libtmp.regexp_str = o.mime; + libtmp.config = o.config; + libtmp.regexp.setPattern(libtmp.regexp_str); + libtmp.regexp.setCaseSensitive(true); + libtmp.writestatic = o.writestatic; + libtmp.writeanimated = o.writeanimated; + libtmp.readable = o.readable; + libtmp.canbemultiple = o.canbemultiple; + libtmp.needtempfile = o.needtempfile; + libtmp.tmp = 0; + + libtmp.codec_il = libtmp.codec_create(); + + if(libtmp.needtempfile) + { + libtmp.tmp = new KTempFile; + libtmp.tmp->setAutoDelete(true); + libtmp.tmp->close(); + codeK->settempfile(libtmp.tmp->name()); + + libtmp.tmp_il = new KTempFile; + libtmp.tmp_il->setAutoDelete(true); + libtmp.tmp_il->close(); + libtmp.codec_il->settempfile(libtmp.tmp_il->name()); + } + + if(libtmp.writestatic) + codeK->getwriteoptions(&libtmp.opt); + + libtmp.codec = codeK; + + readSettings(&libtmp); + + append(libtmp); + } + else // already known library + { + // destroy codec + libtmp.codec_destroy(codeK); + + // unload library + libtmp.lib->unload(); + + delete libtmp.lib; + } + } + } + + // print some information + dump(); +} + +/* + * Is library named 'quick' already been handled ? + */ +bool SQ_LibraryHandler::alreadyInMap(const QString &quick) const +{ + const_iterator itEnd = end(); + + // go through array and find 'quick' + for(const_iterator it = begin();it != itEnd;++it) + if((*it).quickinfo == quick) + return true; + + return false; +} + +/* + * Print some information on found libraries. + */ +void SQ_LibraryHandler::dump() const +{ + std::cerr << "SQ_LibraryHandler: memory dump (total " << count() << ")" << endl; + + const_iterator itEnd = end(); + + std::cerr.setf(ios::left); + + for(const_iterator it = begin();it != itEnd;++it) + { + std::cerr << std::setw(30) + << KStringHandler::csqueeze(QFileInfo((*it).libpath).fileName(), 30) + << std::setw(0) + << " [" + << KStringHandler::rsqueeze((*it).quickinfo, 45) + << "]" + << endl; + } +} + +/* + * Does any of found libraries handle given extension ? + */ +bool SQ_LibraryHandler::knownExtension(const QString &ext) +{ + iterator itEnd = end(); + + // go through array and compare extensions + for(iterator it = begin();it != itEnd;++it) + { + if((*it).filter.contains(ext, false)) + return true; + } + + return false; +} + +/* + * Find appropriate SQ_LIBRARY by its name. If + * not found, return NULL. + * + * Name is a string, returned by fmt_quickinfo() + */ +SQ_LIBRARY* SQ_LibraryHandler::libraryByName(const QString &name) +{ + SQ_LIBRARY *l; + + iterator itEnd = end(); + + // go through array and compare names + for(iterator it = begin();it != itEnd;++it) + { + l = &(*it); + + if(l->quickinfo == name) + return l; + } + + return 0; +} + +void SQ_LibraryHandler::writeSettings(SQ_LIBRARY *lib) +{ + // no config - no settings + if(lib->config.isEmpty()) + return; + + kconf->setGroup(lib->quickinfo); + + fmt_settings::iterator itEnd = lib->settings.end(); + + QString k; + + for(fmt_settings::iterator it = lib->settings.begin();it != itEnd;++it) + { + k = (*it).first; + + if((*it).second.type == settings_value::v_bool) // boolean + { + k.prepend("b"); + kconf->writeEntry(k, (*it).second.bVal); + } + else if((*it).second.type == settings_value::v_int) // integer + { + k.prepend("i"); + kconf->writeEntry(k, (*it).second.iVal); + } + else if((*it).second.type == settings_value::v_double) // double + { + k.prepend("d"); + kconf->writeEntry(k, (*it).second.dVal); + } + else // string + { + k.prepend("s"); + kconf->writeEntry(k, (*it).second.sVal); + } + } +} + +void SQ_LibraryHandler::readSettings(SQ_LIBRARY *lib) +{ + // no config - no settings + if(lib->config.isEmpty()) + return; + + QMap map = kconf->entryMap(lib->quickinfo); + + if(!map.size()) + { + lib->codec->fill_default_settings(); + lib->settings = lib->codec->settings(); + return; + } + + QMap::iterator mapEnd = map.end(); + fmt_settings &sett = lib->settings; + QString d, k; + settings_value val; + + for(QMap::iterator mapIt = map.begin();mapIt != mapEnd;++mapIt) + { + k = mapIt.key(); + d = mapIt.data(); + + if(k.startsWith(QChar('i'))) + { + val.type = settings_value::v_int; + val.iVal = d.toInt(); + } + else if(k.startsWith(QChar('d'))) + { + val.type = settings_value::v_double; + val.dVal = d.toDouble(); + } + else if(k.startsWith(QChar('b'))) + { + val.type = settings_value::v_bool; + val.bVal = (d == "true"); + } + else // all other values are treated as strings + { + val.type = settings_value::v_string; + val.sVal = d.ascii(); + } + + k = k.right(k.length() - 1); + sett[k.ascii()] = val; + } + + lib->codec->set_settings(sett); +} + +void SQ_LibraryHandler::reload() +{ + clear(); + load(); +} + +void SQ_LibraryHandler::load() +{ + QStringList libs; + + QDir dir(SQ_KLIBS, QString::null, QDir::Unsorted, QDir::Files); + + const QFileInfoList *list = dir.entryInfoList(); + + if(list) + { + QFileInfoListIterator it(*list); + QFileInfo *fi; + + while((fi = it.current()) != 0) + { + libs.append(fi->absFilePath()); + ++it; + } + } + + // just show dump, if no libs were found + add(libs); +} + +SQ_LibraryHandler::Support SQ_LibraryHandler::maybeSupported(const KURL &u, const QString &mime) const +{ + const_iterator itEnd = constEnd(); + + SQ_Config::instance()->setGroup("Main"); + bool treat = SQ_Config::instance()->readBoolEntry("treat", true); + + // we can determine mimetype by hand or use "mime" + QString mimeDet = mime.isEmpty() ? KMimeType::findByURL(u)->name() : mime; + + // mimetype by magic is not determined automatically + // for non-local urls - we may support this file type or may not + // (we don't know exactly at this moment) + if(!u.isLocalFile() && mimeDet == KMimeType::defaultMimeType()) + return (treat ? SQ_LibraryHandler::No : SQ_LibraryHandler::Maybe); + + // go through array and compare mimetype names + for(const_iterator it = constBegin();it != itEnd;++it) + { + if((*it).mime_multi) + { + if((*it).mimetype.find(mimeDet, 0, false) != -1) + return SQ_LibraryHandler::Yes; + } + else if((*it).mimetype == mimeDet) // don't waste CPU time with find() + return SQ_LibraryHandler::Yes; + } + + // we don't know about given mimetype + return SQ_LibraryHandler::No; +} + +void SQ_LibraryHandler::sync() +{ + iterator itEnd = end(); + + // unload libraries on clear() + for(iterator it = begin();it != itEnd;++it) + writeSettings(&(*it)); + + kconf->sync(); +} diff --git a/ksquirrel/ksquirrelpart/sq_libraryhandler.h b/ksquirrel/ksquirrelpart/sq_libraryhandler.h new file mode 100644 index 0000000..a3f34bf --- /dev/null +++ b/ksquirrel/ksquirrelpart/sq_libraryhandler.h @@ -0,0 +1,128 @@ +/*************************************************************************** + sq_libraryhandler.h - description + ------------------- + begin : Mar 5 2004 + copyright : (C) 2004 by Baryshev Dmitry + email : ksquirrel.iv@gmail.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifndef SQ_LIBRARY_HANDLER_H +#define SQ_LIBRARY_HANDLER_H + +#include +#include +#include + +#include "sq_library.h" + +class QStringList; + +class KConfig; +class KURL; + +/* + * SQ_LibraryHandler is a library manager. It's the main class + * in library loading mechanizm. + */ + +class SQ_LibraryHandler : public QObject, public QValueVector +{ + public: + SQ_LibraryHandler(QObject *parent = 0); + ~SQ_LibraryHandler(); + + enum Support { Maybe = 0, Yes, No }; + + /* + * Reload libraries from disk + */ + void reload(); + + void sync(); + + Support maybeSupported(const KURL &, const QString& = QString::null) const; + + /* + * Find appropriate SQ_LIBRARY by filename. If + * not found, return NULL. + */ + SQ_LIBRARY* libraryForFile(const KURL &); + SQ_LIBRARY* libraryForFile(const QString &); + + /* + * Find appropriate SQ_LIBRARY by its name. If + * not found, return NULL. + * + * Name is a string, returned by fmt_quickinfo() + */ + SQ_LIBRARY* libraryByName(const QString &name); + + /* + * Does any of found libraries handle given extension ? + */ + bool knownExtension(const QString &ext); + + /* + * Fill 'filters' with all found filters, and + * 'quick' with appropriate information. + */ + void allFilters(QStringList &filters, QStringList &quick) const; + + void allWritableFilters(QStringList &filters, QStringList &quick) const; + + /* + * Get all filters as one string. + */ + QString allFiltersString() const; + + /* + * Filters as one string suitable for KFileDialogs. + * If r == true, return readable codecs + * If allfiles == true, append *.* to result + */ + QString allFiltersFileDialogString(bool r, bool allfiles = true) const; + + /* + * Remove and unload all libraries. + */ + void clear(); + + /* + * Print some information on found libraries. + */ + void dump() const; + + static SQ_LibraryHandler* instance() { return m_instance; } + + private: + + void add(QStringList &foundLibraries); + + /* + * Load libraries from disk. + */ + void load(); + /* + * Is library with name 'quick' already been handled ? + */ + bool alreadyInMap(const QString &quick) const; + + void writeSettings(SQ_LIBRARY *lib); + void readSettings(SQ_LIBRARY *lib); + + private: + KConfig *kconf; + + static SQ_LibraryHandler *m_instance; +}; + +#endif diff --git a/ksquirrel/ksquirrelpart/sq_popupmenu.cpp b/ksquirrel/ksquirrelpart/sq_popupmenu.cpp new file mode 100644 index 0000000..2bb037e --- /dev/null +++ b/ksquirrel/ksquirrelpart/sq_popupmenu.cpp @@ -0,0 +1,39 @@ +/*************************************************************************** + sq_popupmenu.cpp - description + ------------------- + begin : ??? June 3 2006 + copyright : (C) 2006 by Baryshev Dmitry + email : ksquirrel.iv@gmail.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include "sq_popupmenu.h" + +SQ_PopupMenu::SQ_PopupMenu(QWidget *parent, const char *name) + : KPopupMenu(parent, name), title(0) +{} + +SQ_PopupMenu::~SQ_PopupMenu() +{} + +void SQ_PopupMenu::insertTitle(const QString &t) +{ + title = KPopupMenu::insertTitle(t); +} + +void SQ_PopupMenu::changeTitle(const QString &t) +{ + KPopupMenu::changeTitle(title, t); +} diff --git a/ksquirrel/ksquirrelpart/sq_popupmenu.h b/ksquirrel/ksquirrelpart/sq_popupmenu.h new file mode 100644 index 0000000..c6aaaad --- /dev/null +++ b/ksquirrel/ksquirrelpart/sq_popupmenu.h @@ -0,0 +1,40 @@ +/*************************************************************************** + sq_popupmenu.h - description + ------------------- + begin : ??? June 3 2006 + copyright : (C) 2006 by Baryshev Dmitry + email : ksquirrel.iv@gmail.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifndef SQ_POPUPMENU_H +#define SQ_POPUPMENU_H + +#include + +/** + *@author Baryshev Dmitry + */ + +class SQ_PopupMenu : public KPopupMenu +{ + public: + SQ_PopupMenu(QWidget *parent = 0, const char *name = 0); + ~SQ_PopupMenu(); + + void insertTitle(const QString &t); + void changeTitle(const QString &t); + + private: + int title; +}; + +#endif diff --git a/ksquirrel/ksquirrelpart/sq_utils.cpp b/ksquirrel/ksquirrelpart/sq_utils.cpp new file mode 100644 index 0000000..dc224c6 --- /dev/null +++ b/ksquirrel/ksquirrelpart/sq_utils.cpp @@ -0,0 +1,188 @@ +/*************************************************************************** + sq_utils.cpp - description + ------------------- + begin : Thu Aug 2 2007 + copyright : (C) 2007 by Baryshev Dmitry + email : ksquirrel.iv@gmail.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include + +#include + +#include "sq_libraryhandler.h" +#include "sq_utils.h" + +#ifndef KSQUIRREL_PART +#include +#include "sq_imageloader.h" +#include "sq_thumbnailinfo.h" +#include "sq_thumbnailsize.h" +#endif + +#ifdef SQ_HAVE_KEXIF +#include +#endif + +void SQ_Utils::exifRotate(const QString &file, QImage &im, int o) +{ +#ifdef SQ_HAVE_KEXIF + im = im.xForm(SQ_Utils::exifGetMatrix(file, o)); +#endif +} + +QWMatrix SQ_Utils::exifGetMatrix(const QString &file, int o) +{ + QWMatrix matrix; + +#ifdef SQ_HAVE_KEXIF + int O; + + if(o == -1) + { + KExifData data; + data.readFromFile(file); + O = data.getImageOrientation(); + } + else + O = o; + + switch(O) + { + case KExifData::HFLIP: matrix.scale(-1,1); break; + case KExifData::ROT_180: matrix.rotate(180); break; + case KExifData::VFLIP: matrix.scale(1,-1); break; + case KExifData::ROT_90_HFLIP: matrix.scale(-1,1); matrix.rotate(90); break; + case KExifData::ROT_90: matrix.rotate(90); break; + case KExifData::ROT_90_VFLIP: matrix.scale(1,-1); matrix.rotate(90); break; + case KExifData::ROT_270: matrix.rotate(270); break; + + // normal rotation or unspecified + default: ; + } + +#endif + + return matrix; +} + +QImage SQ_Utils::scaleImage(unsigned char *im, int w, int h, int fitwithin) +{ + if(w <= fitwithin && h <= fitwithin) + { + QImage scaled(im, w, h, 32, 0, 0, QImage::LittleEndian); + scaled.setAlphaBuffer(true); + return scaled.copy(); + } + + QImage orig(im, w, h, 32, 0, 0, QImage::LittleEndian); + orig.setAlphaBuffer(true); + + // return scaled image + return SQ_Utils::scale(orig, fitwithin, fitwithin, SQ_Utils::SMOOTH_FAST, QImage::ScaleMin); +} + +#ifndef KSQUIRREL_PART +bool SQ_Utils::loadThumbnail(const KURL &pixPath, SQ_Thumbnail &t) +{ + SQ_LIBRARY *lib = 0; + +#ifdef SQ_HAVE_KEXIF + lib = SQ_LibraryHandler::instance()->libraryForFile(pixPath.path()); + bool th = false; + + if(lib) + { + KExifData data; + data.readFromFile(pixPath.path()); + QImage im = data.getThumbnail(); + + if(!im.isNull()) + { + SQ_Utils::exifRotate(QString::null, im, data.getImageOrientation()); + + th = true; + t.w = 0; + t.h = 0; + t.mime = lib->mime; + + QString w, h; + w = im.text("Thumb::Image::Width"); + h = im.text("Thumb::Image::Height"); + t.w = w.toInt(); + t.h = h.toInt(); + + if(!t.w || !t.h) + SQ_ImageLoader::instance()->tasteImage(pixPath.path(), &t.w, &t.h, lib); + + t.thumbnail = SQ_Utils::scaleImage((unsigned char *)im.bits(), im.width(), + im.height(), SQ_ThumbnailSize::biggest()); + t.thumbnail = t.thumbnail.swapRGB(); + } + } + else + return false; + + // thumbnail loaded - nothing to do, + // or load thumbnail by hands otherwise. + if(th) + return true; +#endif + + fmt_info *finfo; + + RGBA *all; + + bool b = SQ_ImageLoader::instance()->loadImage(pixPath.path(), SQ_CodecSettings::ThumbnailLoader); + + finfo = SQ_ImageLoader::instance()->info(); + all = SQ_ImageLoader::instance()->bits(); + + // memory allocation failed in SQ_ImageLoader::loadImage() + if(!all) + return false; + + // another error occured... + if(!b) + { + // if our image is partially corrupted - show it. The image + // is partially corrupted, if number of errors < number of scanlines + // and at least one page was loaded. + if(!finfo->image.size() + || (SQ_ImageLoader::instance()->errors() == finfo->image[0].h && finfo->image.size() == 1)) + { + SQ_ImageLoader::instance()->cleanup(); + return false; + } + } + + if(!lib) lib = SQ_LibraryHandler::instance()->libraryForFile(pixPath.path()); + + t.w = finfo->image[0].w; + t.h = finfo->image[0].h; + t.mime = lib->mime; + + t.thumbnail = SQ_Utils::scaleImage((unsigned char *)all, finfo->image[0].w, + finfo->image[0].h, SQ_ThumbnailSize::biggest()); + + SQ_ImageLoader::instance()->cleanup(); + + // finally, rotate thumbnail using EXIF + SQ_Utils::exifRotate(pixPath.path(), t.thumbnail); + + return true; +} +#endif diff --git a/ksquirrel/ksquirrelpart/sq_utils.h b/ksquirrel/ksquirrelpart/sq_utils.h new file mode 100644 index 0000000..6bffac9 --- /dev/null +++ b/ksquirrel/ksquirrelpart/sq_utils.h @@ -0,0 +1,63 @@ +/*************************************************************************** + sq_utils.h - description + ------------------- + begin : Thu Aug 2 2007 + copyright : (C) 2007 by Baryshev Dmitry + email : ksquirrel.iv@gmail.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifndef SQ_UTILS_H +#define SQ_UTILS_H + +#include +#include + +class KURL; + +class QString; + +class SQ_Thumbnail; + +/* + * Helper class for SQ_GLWidget and SQ_ThumbnailLoadJob: + * + * thumbnail loader, rotater, mmx scaler + */ + +namespace SQ_Utils +{ + enum SmoothAlgorithm { SMOOTH_NONE, SMOOTH_FAST, SMOOTH_NORMAL, SMOOTH_BEST }; + + QImage scale(const QImage& image, int width, int height, + SmoothAlgorithm alg, QImage::ScaleMode mode = QImage::ScaleFree, double blur = 1.0); + + /* + * Scale given image to fit it within 'fitwithin' + */ + QImage scaleImage(unsigned char *im, int w, int h, int fitwithin); + +#ifndef KSQUIRREL_PART + /* + * Create and save thumbnail for 'pixPath' + */ + bool loadThumbnail(const KURL &pixPath, SQ_Thumbnail&); +#endif + + /* + * determine EXIF rotation and rotate image if needed + */ + void exifRotate(const QString &file, QImage &i, int o = -1); + + QWMatrix exifGetMatrix(const QString &file, int o = -1); +}; + +#endif diff --git a/ksquirrel/ksquirrelpart/sq_utils_asm_scale.S b/ksquirrel/ksquirrelpart/sq_utils_asm_scale.S new file mode 100644 index 0000000..08b43da --- /dev/null +++ b/ksquirrel/ksquirrelpart/sq_utils_asm_scale.S @@ -0,0 +1,810 @@ +#ifdef HAVE_X86_MMX + +#ifdef __EMX__ +/* Due to strange behaviour of as.exe we use this macros */ +/* For all OS/2 coders - please use PGCC to compile this code */ +#define PR_(foo) ___##foo +#define PT_(foo,func) ___##foo,func +#define SIZE(sym) \ + .___end_##sym:; \ + .size ___##sym,.___end_##sym-___##sym; \ + .align 8; +#else +#define PR_(foo) __##foo +#define PT_(foo,func) __##foo,func +#define SIZE(sym) \ + .__end_##sym:; \ + .size __##sym,.__end_##sym-__##sym; \ + .align 8; +#endif + +/*\ +|*| MMX assembly scaling routine for Imlib2 +|*| Written by Willem Monsuwe +\*/ + +.text + .align 8 +.globl PR_(mimageScale_mmx_AARGBA) +/* .type PT_(mimageScale_mmx_AARGBA,@function) */ + + +/*\ Prototype: __mimageScale_mmx_AARGBA(ImlibScaleInfo *isi, DATA32 *dest, +|*| int dxx, int dyy, int dx, int dy, int dw, int dh, int dow, int sow) +\*/ + +#define isi 8(%ebp) +#define dest 12(%ebp) +#define dxx 16(%ebp) +#define dyy 20(%ebp) +#define dx 24(%ebp) +#define dy 28(%ebp) +#define dw 32(%ebp) +#define dh 36(%ebp) +#define dow 40(%ebp) +#define sow 44(%ebp) + +/*\ Local variables that didn't fit in registers \*/ +#define y -4(%ebp) +#define yp -8(%ebp) +#define yap -12(%ebp) +#define xp -16(%ebp) +#define xap -20(%ebp) +#define Cx -24(%ebp) +#define Mx -28(%ebp) +#define Cy -32(%ebp) +#define My -36(%ebp) +#define sow_4 -40(%ebp) + +/*\ When %edx points to ImlibScaleInfo, these are the members \*/ +#define xpoints (%edx) +#define ypoints 4(%edx) +#define xapoints 8(%edx) +#define yapoints 12(%edx) +#define xup_yup 16(%edx) + +PR_(mimageScale_mmx_AARGBA): + pushl %ebp + movl %esp, %ebp + subl $40, %esp + pushl %ebx + pushl %ecx + pushl %edx + pushl %edi + pushl %esi + movl isi, %edx + + /*\ Check (dw > 0) && (dh > 0) \*/ + cmpl $0, dw + jle .scale_leave + cmpl $0, dh + jle .scale_leave + + /*\ X-based array pointers point to the end; we're looping up to 0 \*/ + /*\ %edi = dest + dow * dy + dx + dw \*/ + movl dow, %eax + imull dy, %eax + addl dx, %eax + addl dw, %eax + movl dest, %edi + leal (%edi, %eax, 4), %edi + /*\ xp = xpoints + dxx + dw \*/ + movl dxx, %ebx + addl dw, %ebx + movl xpoints, %eax + leal (%eax, %ebx, 4), %eax + movl %eax, xp + /*\ xap = xapoints + dxx + dw \*/ + movl xapoints, %eax + leal (%eax, %ebx, 4), %eax + movl %eax, xap + /*\ y = dh \*/ + movl dh, %eax + movl %eax, y + /*\ yp = ypoints + dyy \*/ + movl dyy, %ebx + movl ypoints, %eax + leal (%eax, %ebx, 4), %eax + movl %eax, yp + /*\ yap = yapoints + dyy \*/ + movl yapoints, %eax + leal (%eax, %ebx, 4), %eax + movl %eax, yap + + pxor %mm7, %mm7 + + /*\ Test xup bit \*/ + movl xup_yup, %eax + sarl $1, %eax + jnc .scale_x_down + +.scale_x_up: + /*\ Test yup bit \*/ + sarl $1, %eax + jnc .scale_x_up_y_down + + +/*\ Scaling up both ways \*/ + +.scale_x_up_y_up: + movl sow, %ebx + +.up_up_loop_y: + + /*\ x = -dw \*/ + movl dw, %ecx + negl %ecx + + /*\ %eax = *yap << 4 \*/ + movl yap, %eax + movl (%eax), %eax + sall $4, %eax + jz .up_up_yap_0 + movd %eax, %mm1 + punpcklwd %mm1, %mm1 + punpckldq %mm1, %mm1 + +.up_up_loop1_x: + /*\ %esi = *yp + xp[x] \*/ + movl yp, %eax + movl (%eax), %esi + movl xp, %eax + movl (%eax, %ecx, 4), %eax + leal (%esi, %eax, 4), %esi + + /*\ %eax = xap[x] << 4 \*/ + movl xap, %eax + movl (%eax, %ecx, 4), %eax + sall $4, %eax + jz .up_up_xap_0 + + /*\ %mm0 = xap[x] << 4 \*/ + movd %eax, %mm0 + punpcklwd %mm0, %mm0 + punpckldq %mm0, %mm0 + + /*\ Load and unpack four pixels in parralel + |*| %mm2 = ptr[0], %mm3 = ptr[1] + |*| %mm4 = ptr[sow], %mm5 = ptr[sow + 1] + \*/ + movq (%esi), %mm2 + movq (%esi, %ebx, 4), %mm4 + movq %mm2, %mm3 + movq %mm4, %mm5 + punpcklbw %mm7, %mm2 + punpcklbw %mm7, %mm4 + punpckhbw %mm7, %mm3 + punpckhbw %mm7, %mm5 + + /*\ X interpolation: r = l + (r - l) * xap \*/ + psubw %mm2, %mm3 + psubw %mm4, %mm5 + psllw $4, %mm3 + psllw $4, %mm5 + pmulhw %mm0, %mm3 + pmulhw %mm0, %mm5 + paddw %mm2, %mm3 + paddw %mm4, %mm5 + /*\ Now %mm3 = I(ptr[0], ptr[1]), %mm5 = I(ptr[sow], ptr[sow + 1]) \*/ + jmp .up_up_common +.up_up_xap_0: + /*\ Load and unpack two pixels + |*| %mm3 = ptr[0], %mm5 = ptr[sow] + \*/ + movd (%esi), %mm3 + movd (%esi, %ebx, 4), %mm5 + punpcklbw %mm7, %mm3 + punpcklbw %mm7, %mm5 +.up_up_common: + /*\ Y interpolation: d = u + (d - u) * yap \*/ + psubw %mm3, %mm5 + psllw $4, %mm5 + pmulhw %mm1, %mm5 + paddw %mm3, %mm5 + packuswb %mm5, %mm5 + movd %mm5, (%edi, %ecx, 4) + + /*\ while (++x) \*/ + incl %ecx + jnz .up_up_loop1_x + jmp .up_up_yap_end +.up_up_yap_0: + +.up_up_loop2_x: + /*\ %esi = *yp + xp[x] \*/ + movl yp, %eax + movl (%eax), %esi + movl xp, %eax + movl (%eax, %ecx, 4), %eax + leal (%esi, %eax, 4), %esi + + /*\ %eax = xap[x] << 4 \*/ + movl xap, %eax + movl (%eax, %ecx, 4), %eax + sall $4, %eax + jz .up_up_0 + + /*\ %mm0 = xap[x] << 4 \*/ + movd %eax, %mm0 + punpcklwd %mm0, %mm0 + punpckldq %mm0, %mm0 + + /*\ Load and unpack two pixels in parralel + |*| %mm2 = ptr[0], %mm3 = ptr[1] + \*/ + movq (%esi), %mm2 + movq %mm2, %mm3 + punpcklbw %mm7, %mm2 + punpckhbw %mm7, %mm3 + + /*\ X interpolation: r = l + (r - l) * xap \*/ + psubw %mm2, %mm3 + psllw $4, %mm3 + pmulhw %mm0, %mm3 + paddw %mm2, %mm3 + packuswb %mm3, %mm3 + movd %mm3, (%edi, %ecx, 4) + jmp .up_up_1 +.up_up_0: + /*\ dptr[x] = *sptr \*/ + movl (%esi), %eax + movl %eax, (%edi, %ecx, 4) +.up_up_1: + incl %ecx + jnz .up_up_loop2_x + +.up_up_yap_end: + /*\ dptr += dow \*/ + movl dow, %eax + leal (%edi, %eax, 4), %edi + /*\ yap++; yp++ \*/ + addl $4, yap + addl $4, yp + /*\ while (y--) \*/ + decl y + jnz .up_up_loop_y + + jmp .scale_leave + + +/*\ Scaling down vertically \*/ + +.scale_x_up_y_down: + /*\ sow_4 = sow * 4 \*/ + movl sow, %eax + sall $2, %eax + movl %eax, sow_4 + +.up_down_loop_y: + + /*\ Setup My and Cy \*/ + movl yap, %eax + movzwl (%eax), %ebx + movl %ebx, My + movzwl 2(%eax), %eax + movl %eax, Cy + + /*\ mm4 = Cy \*/ + movd %eax, %mm4 + punpcklwd %mm4, %mm4 + punpckldq %mm4, %mm4 + /*\ mm5 = My \*/ + movd %ebx, %mm5 + punpcklwd %mm5, %mm5 + punpckldq %mm5, %mm5 + + /*\ x = -dw \*/ + movl dw, %ecx + negl %ecx +.up_down_loop_x: + /*\ %esi = *yp + xp[x] \*/ + movl yp, %eax + movl (%eax), %esi + movl xp, %eax + movl (%eax, %ecx, 4), %eax + leal (%esi, %eax, 4), %esi + + movl %esi, %eax + /*\ v = (*p * My) >> 10 \*/ + movd (%eax), %mm0 + punpcklbw %mm7, %mm0 + psllw $6, %mm0 + pmulhw %mm5, %mm0 + + /*\ i = 0x4000 - My \*/ + movl $0x4000, %ebx + subl My, %ebx + jbe 5f + jmp 2f +1: + /*\ p += sow; v += (*p * Cy) >> 10 \*/ + addl sow_4, %eax + movd (%eax), %mm1 + punpcklbw %mm7, %mm1 + psllw $6, %mm1 + pmulhw %mm4, %mm1 + paddw %mm1, %mm0 + + /*\ i -= Cy; while (i > Cy) \*/ + subl Cy, %ebx +2: + cmpl Cy, %ebx + jg 1b + + /*\ mm6 = i \*/ + movd %ebx, %mm6 + punpcklwd %mm6, %mm6 + punpckldq %mm6, %mm6 + + /*\ p += sow; v += (*p * i) >> 10 \*/ + addl sow_4, %eax + movd (%eax), %mm1 + punpcklbw %mm7, %mm1 + psllw $6, %mm1 + pmulhw %mm6, %mm1 + paddw %mm1, %mm0 +5: + /*\ %eax = xap[x] << 5 \*/ + movl xap, %eax + movl (%eax, %ecx, 4), %eax + sall $5, %eax + jz 6f + /*\ mm3 = xap[x] << 5 \*/ + movd %eax, %mm3 + punpcklwd %mm3, %mm3 + punpckldq %mm3, %mm3 + + /*\ p + 1 \*/ + movl %esi, %eax + addl $4, %eax + /*\ vv = (*p * My) >> 10 \*/ + movd (%eax), %mm2 + punpcklbw %mm7, %mm2 + psllw $6, %mm2 + pmulhw %mm5, %mm2 + + /*\ i = 0x4000 - My \*/ + movl $0x4000, %ebx + subl My, %ebx + jbe 5f + jmp 2f +1: + /*\ p += sow; vv += (*p * Cy) >> 10 \*/ + addl sow_4, %eax + movd (%eax), %mm1 + punpcklbw %mm7, %mm1 + psllw $6, %mm1 + pmulhw %mm4, %mm1 + paddw %mm1, %mm2 + + /*\ i -= Cy; while (i > Cy) \*/ + subl Cy, %ebx +2: + cmpl Cy, %ebx + jg 1b + + /*\ p += sow; v += (*p * i) >> 10 \*/ + addl sow_4, %eax + movd (%eax), %mm1 + punpcklbw %mm7, %mm1 + psllw $6, %mm1 + pmulhw %mm6, %mm1 + paddw %mm1, %mm2 +5: + /*\ v = v + (vv - v) * xap \*/ + psubw %mm0, %mm2 + psllw $3, %mm2 + pmulhw %mm3, %mm2 + paddw %mm2, %mm0 +6: + /*\ dest[x] = v >> 4 \*/ + psrlw $4, %mm0 + packuswb %mm0, %mm0 + movd %mm0, (%edi, %ecx, 4) + + /*\ while (++x) \*/ + incl %ecx + jnz .up_down_loop_x + + /*\ dptr += dow \*/ + movl dow, %eax + leal (%edi, %eax, 4), %edi + /*\ yap++; yp++ \*/ + addl $4, yap + addl $4, yp + /*\ while (y--) \*/ + decl y + jnz .up_down_loop_y + + jmp .scale_leave + +.scale_x_down: + /*\ Test yup bit \*/ + sarl $1, %eax + jnc .scale_x_down_y_down + + +/*\ Scaling down horizontally \*/ + +.scale_x_down_y_up: + /*\ sow_4 = sow * 4 \*/ + movl sow, %eax + sall $2, %eax + movl %eax, sow_4 + +.down_up_loop_y: + + /*\ %eax = *yap << 5 \*/ + movl yap, %eax + movl (%eax), %eax + sall $5, %eax + /*\ mm3 = *yap << 5 \*/ + movd %eax, %mm3 + punpcklwd %mm3, %mm3 + punpckldq %mm3, %mm3 + + /*\ x = -dw \*/ + movl dw, %ecx + negl %ecx +.down_up_loop_x: + /*\ %esi = *yp + xp[x] \*/ + movl yp, %eax + movl (%eax), %esi + movl xp, %eax + movl (%eax, %ecx, 4), %eax + leal (%esi, %eax, 4), %esi + + /*\ Setup Mx and Cx \*/ + movl xap, %eax + movzwl (%eax, %ecx, 4), %ebx + movl %ebx, Mx + movzwl 2(%eax, %ecx, 4), %eax + movl %eax, Cx + + /*\ mm4 = Cx \*/ + movd %eax, %mm4 + punpcklwd %mm4, %mm4 + punpckldq %mm4, %mm4 + /*\ mm5 = Mx \*/ + movd %ebx, %mm5 + punpcklwd %mm5, %mm5 + punpckldq %mm5, %mm5 + + movl %esi, %eax + /*\ v = (*p * Mx) >> 10 \*/ + movd (%eax), %mm0 + punpcklbw %mm7, %mm0 + psllw $6, %mm0 + pmulhw %mm5, %mm0 + + /*\ i = 0x4000 - Mx \*/ + movl $0x4000, %ebx + subl Mx, %ebx + jbe 5f + jmp 2f +1: + /*\ p += sow; v += (*p * Cx) >> 10 \*/ + addl $4, %eax + movd (%eax), %mm1 + punpcklbw %mm7, %mm1 + psllw $6, %mm1 + pmulhw %mm4, %mm1 + paddw %mm1, %mm0 + + /*\ i -= Cx; while (i > Cx) \*/ + subl Cx, %ebx +2: + cmpl Cx, %ebx + jg 1b + + /*\ mm6 = i \*/ + movd %ebx, %mm6 + punpcklwd %mm6, %mm6 + punpckldq %mm6, %mm6 + + /*\ p += sow; v += (*p * i) >> 10 \*/ + addl $4, %eax + movd (%eax), %mm1 + punpcklbw %mm7, %mm1 + psllw $6, %mm1 + pmulhw %mm6, %mm1 + paddw %mm1, %mm0 +5: + movd %mm3, %eax + testl %eax, %eax + jz 6f + /*\ p + sow \*/ + movl %esi, %eax + addl sow_4, %eax + /*\ vv = (*p * Mx) >> 10 \*/ + movd (%eax), %mm2 + punpcklbw %mm7, %mm2 + psllw $6, %mm2 + pmulhw %mm5, %mm2 + + /*\ i = 0x4000 - Mx \*/ + movl $0x4000, %ebx + subl Mx, %ebx + jbe 5f + jmp 2f +1: + /*\ p += sow; vv += (*p * Cx) >> 10 \*/ + addl $4, %eax + movd (%eax), %mm1 + punpcklbw %mm7, %mm1 + psllw $6, %mm1 + pmulhw %mm4, %mm1 + paddw %mm1, %mm2 + + /*\ i -= Cx; while (i > Cx) \*/ + subl Cx, %ebx +2: + cmpl Cx, %ebx + jg 1b + + /*\ p += sow; v += (*p * i) >> 10 \*/ + addl $4, %eax + movd (%eax), %mm1 + punpcklbw %mm7, %mm1 + psllw $6, %mm1 + pmulhw %mm6, %mm1 + paddw %mm1, %mm2 +5: + /*\ v = v + (vv - v) * yap \*/ + psubw %mm0, %mm2 + psllw $3, %mm2 + pmulhw %mm3, %mm2 + paddw %mm2, %mm0 +6: + /*\ dest[x] = v >> 4 \*/ + psrlw $4, %mm0 + packuswb %mm0, %mm0 + movd %mm0, (%edi, %ecx, 4) + + /*\ while (++x) \*/ + incl %ecx + jnz .down_up_loop_x + + /*\ dptr += dow \*/ + movl dow, %eax + leal (%edi, %eax, 4), %edi + /*\ yap++; yp++ \*/ + addl $4, yap + addl $4, yp + /*\ while (y--) \*/ + decl y + jnz .down_up_loop_y + + jmp .scale_leave + + +/*\ Scaling down both ways \*/ + +.scale_x_down_y_down: + /*\ sow_4 = sow * 4 \*/ + movl sow, %eax + sall $2, %eax + movl %eax, sow_4 + +.down_down_loop_y: + + /*\ Setup My and Cy \*/ + movl yap, %eax + movzwl (%eax), %ebx + movl %ebx, My + movzwl 2(%eax), %eax + movl %eax, Cy + + /*\ x = -dw \*/ + movl dw, %ecx + negl %ecx +.down_down_loop_x: + /*\ %esi = *yp + xp[x] \*/ + movl yp, %eax + movl (%eax), %esi + movl xp, %eax + movl (%eax, %ecx, 4), %eax + leal (%esi, %eax, 4), %esi + + /*\ Setup Mx and Cx \*/ + movl xap, %eax + movzwl (%eax, %ecx, 4), %ebx + movl %ebx, Mx + movzwl 2(%eax, %ecx, 4), %eax + movl %eax, Cx + + /*\ mm3 = Cx \*/ + movd %eax, %mm3 + punpcklwd %mm3, %mm3 + punpckldq %mm3, %mm3 + /*\ mm5 = Mx \*/ + movd %ebx, %mm5 + punpcklwd %mm5, %mm5 + punpckldq %mm5, %mm5 + + /*\ p = sptr; v = (*p * Mx) >> 9 \*/ + movl %esi, %eax + movd (%eax), %mm0 + punpcklbw %mm7, %mm0 + psllw $7, %mm0 + pmulhw %mm5, %mm0 + + /*\ i = 0x4000 - Mx \*/ + movl $0x4000, %ebx + subl Mx, %ebx + jbe 5f + jmp 2f +1: + /*\ v += (*++p * Cx) >> 9 \*/ + addl $4, %eax + movd (%eax), %mm1 + punpcklbw %mm7, %mm1 + psllw $7, %mm1 + pmulhw %mm3, %mm1 + paddw %mm1, %mm0 + + /*\ i -= Cx; while (i > Cx) \*/ + subl Cx, %ebx +2: + cmpl Cx, %ebx + jg 1b + + /*\ mm6 = i \*/ + movd %ebx, %mm6 + punpcklwd %mm6, %mm6 + punpckldq %mm6, %mm6 + + /*\ v += (*++p * i) >> 9 \*/ + addl $4, %eax + movd (%eax), %mm1 + punpcklbw %mm7, %mm1 + psllw $7, %mm1 + pmulhw %mm6, %mm1 + paddw %mm1, %mm0 +5: + /*\ v *= My \*/ + movd My, %mm4 + punpcklwd %mm4, %mm4 + punpckldq %mm4, %mm4 + psllw $2, %mm0 + pmulhw %mm4, %mm0 + + /*\ j = 0x4000 - My \*/ + movl $0x4000, %edx + subl My, %edx + jbe 6f + jmp 4f +3: + /*\ sptr += sow; p = sptr \*/ + addl sow_4, %esi + movl %esi, %eax + /*\ vx = (*p * Mx) >> 9 \*/ + movd (%eax), %mm1 + punpcklbw %mm7, %mm1 + psllw $7, %mm1 + pmulhw %mm5, %mm1 + + /*\ i = 0x4000 - Mx \*/ + movl $0x4000, %ebx + subl Mx, %ebx + jbe 5f + jmp 2f +1: + /*\ vx += (*++p * Cx) >> 9 \*/ + addl $4, %eax + movd (%eax), %mm2 + punpcklbw %mm7, %mm2 + psllw $7, %mm2 + pmulhw %mm3, %mm2 + paddw %mm2, %mm1 + + /*\ i -= Cx; while (i > Cx) \*/ + subl Cx, %ebx +2: + cmpl Cx, %ebx + jg 1b + + /*\ vx += (*++p * i) >> 9 \*/ + addl $4, %eax + movd (%eax), %mm2 + punpcklbw %mm7, %mm2 + psllw $7, %mm2 + pmulhw %mm6, %mm2 + paddw %mm2, %mm1 +5: + /*\ v += (vx * Cy) >> 14 \*/ + movd Cy, %mm4 + punpcklwd %mm4, %mm4 + punpckldq %mm4, %mm4 + psllw $2, %mm1 + pmulhw %mm4, %mm1 + paddw %mm1, %mm0 + + /*\ j -= Cy; while (j > Cy) \*/ + subl Cy, %edx +4: + cmpl Cy, %edx + jg 3b + + /*\ sptr += sow; p = sptr \*/ + addl sow_4, %esi + movl %esi, %eax + /*\ vx = (*p * Mx) >> 9 \*/ + movd (%eax), %mm1 + punpcklbw %mm7, %mm1 + psllw $7, %mm1 + pmulhw %mm5, %mm1 + + /*\ i = 0x4000 - Mx \*/ + movl $0x4000, %ebx + subl Mx, %ebx + jbe 5f + jmp 2f +1: + /*\ vx += (*++p * Cx) >> 9 \*/ + addl $4, %eax + movd (%eax), %mm2 + punpcklbw %mm7, %mm2 + psllw $7, %mm2 + pmulhw %mm3, %mm2 + paddw %mm2, %mm1 + + /*\ i -= Cx; while (i > Cx) \*/ + subl Cx, %ebx +2: + cmpl Cx, %ebx + jg 1b + + /*\ vx += (*++p * i) >> 9 \*/ + addl $4, %eax + movd (%eax), %mm2 + punpcklbw %mm7, %mm2 + psllw $7, %mm2 + pmulhw %mm6, %mm2 + paddw %mm2, %mm1 +5: + /*\ v += (vx * j) >> 14 \*/ + movd %edx, %mm4 + punpcklwd %mm4, %mm4 + punpckldq %mm4, %mm4 + psllw $2, %mm1 + pmulhw %mm4, %mm1 + paddw %mm1, %mm0 +6: + /*\ dptr[x] = mm0 >> 5 \*/ + psrlw $5, %mm0 + packuswb %mm0, %mm0 + movd %mm0, (%edi, %ecx, 4) + + /*\ while (++x) \*/ + incl %ecx + jnz .down_down_loop_x + + /*\ dptr += dow \*/ + movl dow, %eax + leal (%edi, %eax, 4), %edi + /*\ yap++; yp++ \*/ + addl $4, yap + addl $4, yp + /*\ while (y--) \*/ + decl y + jnz .down_down_loop_y + + jmp .scale_leave + +.scale_leave: + emms + popl %esi + popl %edi + popl %edx + popl %ecx + popl %ebx + movl %ebp, %esp + popl %ebp + ret + +SIZE(mimageScale_mmx_AARGBA) + +#endif + +.section .note.GNU-stack,"",%progbits diff --git a/ksquirrel/ksquirrelpart/sq_utils_scale.cpp b/ksquirrel/ksquirrelpart/sq_utils_scale.cpp new file mode 100644 index 0000000..d2742d1 --- /dev/null +++ b/ksquirrel/ksquirrelpart/sq_utils_scale.cpp @@ -0,0 +1,1933 @@ +// This file includes code for scaling images, in two versions. +// One ported from ImageMagick (slower, but can achieve better quality), +// and from Imlib2 ported by Mosfet (very fast). + + +// ImageMagick code begin +// ---------------------- + +// This code is ImageMagick's resize code, adapted for QImage, with +// fastfloat class added as an optimization. +// The original license text follows. + +/* +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % +% % +% RRRR EEEEE SSSSS IIIII ZZZZZ EEEEE % +% R R E SS I ZZ E % +% RRRR EEE SSS I ZZZ EEE % +% R R E SS I ZZ E % +% R R EEEEE SSSSS IIIII ZZZZZ EEEEE % +% % +% ImageMagick Image Resize Methods % +% % +% % +% Software Design % +% John Cristy % +% July 1992 % +% % +% % +% Copyright (C) 2003 ImageMagick Studio, a non-profit organization dedicated % +% to making software imaging solutions freely available. % +% % +% Permission is hereby granted, free of charge, to any person obtaining a % +% copy of this software and associated documentation files ("ImageMagick"), % +% to deal in ImageMagick without restriction, including without limitation % +% the rights to use, copy, modify, merge, publish, distribute, sublicense, % +% and/or sell copies of ImageMagick, and to permit persons to whom the % +% ImageMagick is furnished to do so, subject to the following conditions: % +% % +% The above copyright notice and this permission notice shall be included in % +% all copies or substantial portions of ImageMagick. % +% % +% The software is provided "as is", without warranty of any kind, express or % +% implied, including but not limited to the warranties of merchantability, % +% fitness for a particular purpose and noninfringement. In no event shall % +% ImageMagick Studio be liable for any claim, damages or other liability, % +% whether in an action of contract, tort or otherwise, arising from, out of % +% or in connection with ImageMagick or the use or other dealings in % +% ImageMagick. % +% % +% Except as contained in this notice, the name of the ImageMagick Studio % +% shall not be used in advertising or otherwise to promote the sale, use or % +% other dealings in ImageMagick without prior written authorization from the % +% ImageMagick Studio. % +% % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% +*/ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +// System +#ifdef HAVE_ENDIAN_H +#include +#else +#ifdef HAVE_SYS_ENDIAN_H +#include +#endif +#endif + +#include +#include + +#include +#include + +#include +#include + +#include "sq_utils.h" + +// everything in namespace +namespace SQ_Utils { + +#define Max QMAX +#define Min QMIN + +// mustn't be less than used precision (i.e. 1/fastfloat::RATIO) +#define MagickEpsilon 0.0002 + +// fastfloat begin +// this class stores floating point numbers as integers, with BITS shift, +// i.e. value XYZ is stored as XYZ * RATIO +struct fastfloat + { + private: + enum { BITS = 12, RATIO = 4096 }; + public: + fastfloat() {} + fastfloat( long v ) : value( v << BITS ) {} + fastfloat( int v ) : value( v << BITS ) {} + fastfloat( double v ) : value( static_cast< long >( v * RATIO + 0.5 )) {} + double toDouble() const { return static_cast< double >( value ) / RATIO; } + long toLong() const { return value >> BITS; } + fastfloat& operator += ( fastfloat r ) { value += r.value; return *this; } + fastfloat& operator -= ( fastfloat r ) { value -= r.value; return *this; } + fastfloat& operator *= ( fastfloat r ) { value = static_cast< long long >( value ) * r.value >> BITS; return *this; } + fastfloat& operator /= ( fastfloat r ) { value = ( static_cast< long long >( value ) << BITS ) / r.value; return *this; } + bool operator< ( fastfloat r ) const { return value < r.value; } + bool operator<= ( fastfloat r ) const { return value <= r.value; } + bool operator> ( fastfloat r ) const { return value > r.value; } + bool operator>= ( fastfloat r ) const { return value >= r.value; } + bool operator== ( fastfloat r ) const { return value == r.value; } + bool operator!= ( fastfloat r ) const { return value != r.value; } + fastfloat operator-() const { return fastfloat( -value, false ); } + private: + fastfloat( long v, bool ) : value( v ) {} // for operator-() + long value; + }; + +inline fastfloat operator+ ( fastfloat l, fastfloat r ) { return fastfloat( l ) += r; } +inline fastfloat operator- ( fastfloat l, fastfloat r ) { return fastfloat( l ) -= r; } +inline fastfloat operator* ( fastfloat l, fastfloat r ) { return fastfloat( l ) *= r; } +inline fastfloat operator/ ( fastfloat l, fastfloat r ) { return fastfloat( l ) /= r; } + +inline bool operator< ( fastfloat l, double r ) { return l < fastfloat( r ); } +inline bool operator<= ( fastfloat l, double r ) { return l <= fastfloat( r ); } +inline bool operator> ( fastfloat l, double r ) { return l > fastfloat( r ); } +inline bool operator>= ( fastfloat l, double r ) { return l >= fastfloat( r ); } +inline bool operator== ( fastfloat l, double r ) { return l == fastfloat( r ); } +inline bool operator!= ( fastfloat l, double r ) { return l != fastfloat( r ); } + +inline bool operator< ( double l, fastfloat r ) { return fastfloat( l ) < r ; } +inline bool operator<= ( double l, fastfloat r ) { return fastfloat( l ) <= r ; } +inline bool operator> ( double l, fastfloat r ) { return fastfloat( l ) > r ; } +inline bool operator>= ( double l, fastfloat r ) { return fastfloat( l ) >= r ; } +inline bool operator== ( double l, fastfloat r ) { return fastfloat( l ) == r ; } +inline bool operator!= ( double l, fastfloat r ) { return fastfloat( l ) != r ; } + +inline double fasttodouble( fastfloat v ) { return v.toDouble(); } +inline long fasttolong( fastfloat v ) { return v.toLong(); } + +#if 1 // change to 0 to turn fastfloat usage off +#else +#define fastfloat double +#define fasttodouble( v ) double( v ) +#define fasttolong( v ) long( v ) +#endif + +//fastfloat end + + +typedef fastfloat (*Filter)(const fastfloat, const fastfloat); + +typedef struct _ContributionInfo +{ + fastfloat + weight; + + long + pixel; +} ContributionInfo; + + +/* +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % +% % +% % +% R e s i z e I m a g e % +% % +% % +% % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% ResizeImage() scales an image to the desired dimensions with one of these +% filters: +% +% Bessel Blackman Box +% Catrom Cubic Gaussian +% Hanning Hermite Lanczos +% Mitchell Point Quandratic +% Sinc Triangle +% +% Most of the filters are FIR (finite impulse response), however, Bessel, +% Gaussian, and Sinc are IIR (infinite impulse response). Bessel and Sinc +% are windowed (brought down to zero) with the Blackman filter. +% +% ResizeImage() was inspired by Paul Heckbert's zoom program. +% +% The format of the ResizeImage method is: +% +% Image *ResizeImage(Image *image,const unsigned long columns, +% const unsigned long rows,const FilterTypes filter,const double blur, +% ExceptionInfo *exception) +% +% A description of each parameter follows: +% +% o image: The image. +% +% o columns: The number of columns in the scaled image. +% +% o rows: The number of rows in the scaled image. +% +% o filter: Image filter to use. +% +% o blur: The blur factor where > 1 is blurry, < 1 is sharp. +% +% o exception: Return any errors or warnings in this structure. +% +% +*/ + +#if 0 +static fastfloat Bessel(const fastfloat x,const fastfloat) +{ + if (x == 0.0) + return(MagickPI/4.0); + return(BesselOrderOne(MagickPI*x)/(2.0*x)); +} + +static fastfloat Sinc(const fastfloat x,const fastfloat) +{ + if (x == 0.0) + return(1.0); + return(sin(MagickPI*x)/(MagickPI*x)); +} + +static fastfloat Blackman(const fastfloat x,const fastfloat) +{ + return(0.42+0.5*cos(MagickPI*x)+0.08*cos(2*MagickPI*x)); +} + +static fastfloat BlackmanBessel(const fastfloat x,const fastfloat) +{ + return(Blackman(x/support,support)*Bessel(x,support)); +} + +static fastfloat BlackmanSinc(const fastfloat x,const fastfloat) +{ + return(Blackman(x/support,support)*Sinc(x,support)); +} +#endif + +static fastfloat Box(const fastfloat x,const fastfloat) +{ + if (x < -0.5) + return(0.0); + if (x < 0.5) + return(1.0); + return(0.0); +} + +#if 0 +static fastfloat Catrom(const fastfloat x,const fastfloat) +{ + if (x < -2.0) + return(0.0); + if (x < -1.0) + return(0.5*(4.0+x*(8.0+x*(5.0+x)))); + if (x < 0.0) + return(0.5*(2.0+x*x*(-5.0-3.0*x))); + if (x < 1.0) + return(0.5*(2.0+x*x*(-5.0+3.0*x))); + if (x < 2.0) + return(0.5*(4.0+x*(-8.0+x*(5.0-x)))); + return(0.0); +} + +static fastfloat Cubic(const fastfloat x,const fastfloat) +{ + if (x < -2.0) + return(0.0); + if (x < -1.0) + return((2.0+x)*(2.0+x)*(2.0+x)/6.0); + if (x < 0.0) + return((4.0+x*x*(-6.0-3.0*x))/6.0); + if (x < 1.0) + return((4.0+x*x*(-6.0+3.0*x))/6.0); + if (x < 2.0) + return((2.0-x)*(2.0-x)*(2.0-x)/6.0); + return(0.0); +} + +static fastfloat Gaussian(const fastfloat x,const fastfloat) +{ + return(exp(-2.0*x*x)*sqrt(2.0/MagickPI)); +} + +static fastfloat Hanning(const fastfloat x,const fastfloat) +{ + return(0.5+0.5*cos(MagickPI*x)); +} + +static fastfloat Hamming(const fastfloat x,const fastfloat) +{ + return(0.54+0.46*cos(MagickPI*x)); +} + +static fastfloat Hermite(const fastfloat x,const fastfloat) +{ + if (x < -1.0) + return(0.0); + if (x < 0.0) + return((2.0*(-x)-3.0)*(-x)*(-x)+1.0); + if (x < 1.0) + return((2.0*x-3.0)*x*x+1.0); + return(0.0); +} + +static fastfloat Lanczos(const fastfloat x,const fastfloat support) +{ + if (x < -3.0) + return(0.0); + if (x < 0.0) + return(Sinc(-x,support)*Sinc(-x/3.0,support)); + if (x < 3.0) + return(Sinc(x,support)*Sinc(x/3.0,support)); + return(0.0); +} + +static fastfloat Mitchell(const fastfloat x,const fastfloat) +{ +#define B (1.0/3.0) +#define C (1.0/3.0) +#define P0 (( 6.0- 2.0*B )/6.0) +#define P2 ((-18.0+12.0*B+ 6.0*C)/6.0) +#define P3 (( 12.0- 9.0*B- 6.0*C)/6.0) +#define Q0 (( 8.0*B+24.0*C)/6.0) +#define Q1 (( -12.0*B-48.0*C)/6.0) +#define Q2 (( 6.0*B+30.0*C)/6.0) +#define Q3 (( - 1.0*B- 6.0*C)/6.0) + + if (x < -2.0) + return(0.0); + if (x < -1.0) + return(Q0-x*(Q1-x*(Q2-x*Q3))); + if (x < 0.0) + return(P0+x*x*(P2-x*P3)); + if (x < 1.0) + return(P0+x*x*(P2+x*P3)); + if (x < 2.0) + return(Q0+x*(Q1+x*(Q2+x*Q3))); + return(0.0); + +#undef B +#undef C +#undef P0 +#undef P2 +#undef P3 +#undef Q0 +#undef Q1 +#undef Q2 +#undef Q3 +} +#endif + +// this is the same like Mitchell, but it has different values +// for B and C, resulting in sharper images +// http://sourceforge.net/mailarchive/forum.php?thread_id=7445822&forum_id=1210 +static fastfloat Bicubic(const fastfloat x,const fastfloat) +{ +#define B (0.0/3.0) +#define C (2.0/3.0) +#define P0 (( 6.0- 2.0*B )/6.0) +#define P2 ((-18.0+12.0*B+ 6.0*C)/6.0) +#define P3 (( 12.0- 9.0*B- 6.0*C)/6.0) +#define Q0 (( 8.0*B+24.0*C)/6.0) +#define Q1 (( -12.0*B-48.0*C)/6.0) +#define Q2 (( 6.0*B+30.0*C)/6.0) +#define Q3 (( - 1.0*B- 6.0*C)/6.0) + + if (x < -2.0) + return(0.0); + if (x < -1.0) + return(Q0-x*(Q1-x*(Q2-x*Q3))); + if (x < 0.0) + return(P0+x*x*(P2-x*P3)); + if (x < 1.0) + return(P0+x*x*(P2+x*P3)); + if (x < 2.0) + return(Q0+x*(Q1+x*(Q2+x*Q3))); + return(0.0); + +#undef B +#undef C +#undef P0 +#undef P2 +#undef P3 +#undef Q0 +#undef Q1 +#undef Q2 +#undef Q3 +} + +#if 0 +static fastfloat Quadratic(const fastfloat x,const fastfloat) +{ + if (x < -1.5) + return(0.0); + if (x < -0.5) + return(0.5*(x+1.5)*(x+1.5)); + if (x < 0.5) + return(0.75-x*x); + if (x < 1.5) + return(0.5*(x-1.5)*(x-1.5)); + return(0.0); +} +#endif + +static fastfloat Triangle(const fastfloat x,const fastfloat) +{ + if (x < -1.0) + return(0.0); + if (x < 0.0) + return(1.0+x); + if (x < 1.0) + return(1.0-x); + return(0.0); +} + +static void HorizontalFilter(const QImage& source,QImage& destination, + const fastfloat x_factor,const fastfloat blur, + ContributionInfo *contribution, Filter filter, fastfloat filtersupport) +{ + fastfloat + center, + density, + scale, + support; + + long + n, + start, + stop, + y; + + register long + i, + x; + + /* + Apply filter to resize horizontally from source to destination. + */ + scale=blur*Max(1.0/x_factor,1.0); + support=scale* filtersupport; + if (support <= 0.5) + { + /* + Reduce to point sampling. + */ + support=0.5+MagickEpsilon; + scale=1.0; + } + scale=1.0/scale; + for (x=0; x < (long) destination.width(); x++) + { + center=(fastfloat) (x+0.5)/x_factor; + start= fasttolong(Max(center-support+0.5,0)); + stop= fasttolong(Min(center+support+0.5,source.width())); + density=0.0; + for (n=0; n < (stop-start); n++) + { + contribution[n].pixel=start+n; + contribution[n].weight= + filter (scale*(start+n-center+0.5), filtersupport ); + density+=contribution[n].weight; + } + if ((density != 0.0) && (density != 1.0)) + { + /* + Normalize. + */ + density=1.0/density; + for (i=0; i < n; i++) + contribution[i].weight*=density; + } +// p=AcquireImagePixels(source,contribution[0].pixel,0,contribution[n-1].pixel- +// contribution[0].pixel+1,source->rows,exception); +// q=SetImagePixels(destination,x,0,1,destination->rows); + for (y=0; y < (long) destination.height(); y++) + { + fastfloat red = 0; + fastfloat green = 0; + fastfloat blue = 0; + fastfloat alpha = 0; + for (i=0; i < n; i++) + { + int px = contribution[i].pixel; + int py = y; + QRgb p = reinterpret_cast< QRgb* >( source.jumpTable()[ py ])[ px ]; + red+=contribution[i].weight*qRed(p); + green+=contribution[i].weight*qGreen(p); + blue+=contribution[i].weight*qBlue(p); + alpha+=contribution[i].weight*qAlpha(p); + } + QRgb pix = qRgba( + fasttolong( red < 0 ? 0 : red > 255 ? 255 : red + 0.5 ), + fasttolong( green < 0 ? 0 : green > 255 ? 255 : green + 0.5 ), + fasttolong( blue < 0 ? 0 : blue > 255 ? 255 : blue + 0.5 ), + fasttolong( alpha < 0 ? 0 : alpha > 255 ? 255 : alpha + 0.5 )); + reinterpret_cast< QRgb* >( destination.jumpTable()[ y ])[ x ] = pix; + } + } +} + +static void VerticalFilter(const QImage& source,QImage& destination, + const fastfloat y_factor,const fastfloat blur, + ContributionInfo *contribution, Filter filter, fastfloat filtersupport ) +{ + fastfloat + center, + density, + scale, + support; + + long + n, + start, + stop, + x; + + register long + i, + y; + + /* + Apply filter to resize vertically from source to destination. + */ + scale=blur*Max(1.0/y_factor,1.0); + support=scale* filtersupport; + if (support <= 0.5) + { + /* + Reduce to point sampling. + */ + support=0.5+MagickEpsilon; + scale=1.0; + } + scale=1.0/scale; + for (y=0; y < (long) destination.height(); y++) + { + center=(fastfloat) (y+0.5)/y_factor; + start= fasttolong(Max(center-support+0.5,0)); + stop= fasttolong(Min(center+support+0.5,source.height())); + density=0.0; + for (n=0; n < (stop-start); n++) + { + contribution[n].pixel=start+n; + contribution[n].weight= + filter (scale*(start+n-center+0.5), filtersupport); + density+=contribution[n].weight; + } + if ((density != 0.0) && (density != 1.0)) + { + /* + Normalize. + */ + density=1.0/density; + for (i=0; i < n; i++) + contribution[i].weight*=density; + } +// p=AcquireImagePixels(source,0,contribution[0].pixel,source->columns, +// contribution[n-1].pixel-contribution[0].pixel+1,exception); +// q=SetImagePixels(destination,0,y,destination->columns,1); + for (x=0; x < (long) destination.width(); x++) + { + fastfloat red = 0; + fastfloat green = 0; + fastfloat blue = 0; + fastfloat alpha = 0; + for (i=0; i < n; i++) + { + int px = x; + int py = contribution[i].pixel; + QRgb p = reinterpret_cast< QRgb* >( source.jumpTable()[ py ])[ px ]; + red+=contribution[i].weight*qRed(p); + green+=contribution[i].weight*qGreen(p); + blue+=contribution[i].weight*qBlue(p); + alpha+=contribution[i].weight*qAlpha(p); + } + QRgb pix = qRgba( + fasttolong( red < 0 ? 0 : red > 255 ? 255 : red + 0.5 ), + fasttolong( green < 0 ? 0 : green > 255 ? 255 : green + 0.5 ), + fasttolong( blue < 0 ? 0 : blue > 255 ? 255 : blue + 0.5 ), + fasttolong( alpha < 0 ? 0 : alpha > 255 ? 255 : alpha + 0.5 )); + reinterpret_cast< QRgb* >( destination.jumpTable()[ y ])[ x ] = pix; + } + } +} + +static QImage ResizeImage(const QImage& image,const int columns, + const int rows, Filter filter, fastfloat filtersupport, double blur) +{ + ContributionInfo + *contribution; + + fastfloat + support, + x_factor, + x_support, + y_factor, + y_support; + + /* + Initialize resize image attributes. + */ + if ((columns == image.width()) && (rows == image.height()) && (blur == 1.0)) + return image.copy(); + QImage resize_image( columns, rows, 32 ); + resize_image.setAlphaBuffer( image.hasAlphaBuffer()); + /* + Allocate filter contribution info. + */ + x_factor=(fastfloat) resize_image.width()/image.width(); + y_factor=(fastfloat) resize_image.height()/image.height(); +// i=(long) LanczosFilter; +// if (image->filter != UndefinedFilter) +// i=(long) image->filter; +// else +// if ((image->storage_class == PseudoClass) || image->matte || +// ((x_factor*y_factor) > 1.0)) +// i=(long) MitchellFilter; + x_support=blur*Max(1.0/x_factor,1.0)*filtersupport; + y_support=blur*Max(1.0/y_factor,1.0)*filtersupport; + support=Max(x_support,y_support); + if (support < filtersupport) + support=filtersupport; + contribution=new ContributionInfo[ fasttolong( 2.0*Max(support,0.5)+3 ) ]; + Q_CHECK_PTR( contribution ); + /* + Resize image. + */ + if (((fastfloat) columns*(image.height()+rows)) > + ((fastfloat) rows*(image.width()+columns))) + { + QImage source_image( columns, image.height(), 32 ); + source_image.setAlphaBuffer( image.hasAlphaBuffer()); + HorizontalFilter(image,source_image,x_factor,blur, + contribution,filter,filtersupport); + VerticalFilter(source_image,resize_image,y_factor, + blur,contribution,filter,filtersupport); + } + else + { + QImage source_image( image.width(), rows, 32 ); + source_image.setAlphaBuffer( image.hasAlphaBuffer()); + VerticalFilter(image,source_image,y_factor,blur, + contribution,filter,filtersupport); + HorizontalFilter(source_image,resize_image,x_factor, + blur,contribution,filter,filtersupport); + } + /* + Free allocated memory. + */ + delete[] contribution; + return(resize_image); +} + + +#undef Max +#undef Min +#undef MagickEpsilon + + +// filters and their matching support values +#if 0 + static const FilterInfo + filters[SincFilter+1] = + { + { Box, 0.0 }, + { Box, 0.0 }, + { Box, 0.5 }, + { Triangle, 1.0 }, + { Hermite, 1.0 }, + { Hanning, 1.0 }, + { Hamming, 1.0 }, + { Blackman, 1.0 }, + { Gaussian, 1.25 }, + { Quadratic, 1.5 }, + { Cubic, 2.0 }, + { Catrom, 2.0 }, + { Mitchell, 2.0 }, + { Lanczos, 3.0 }, + { BlackmanBessel, 3.2383 }, + { BlackmanSinc, 4.0 } + }; +#endif + + +/* +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % +% % +% % +% S a m p l e I m a g e % +% % +% % +% % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% SampleImage() scales an image to the desired dimensions with pixel +% sampling. Unlike other scaling methods, this method does not introduce +% any additional color into the scaled image. +% +% The format of the SampleImage method is: +% +% Image *SampleImage(const Image *image,const unsigned long columns, +% const unsigned long rows,ExceptionInfo *exception) +% +% A description of each parameter follows: +% +% o image: The image. +% +% o columns: The number of columns in the sampled image. +% +% o rows: The number of rows in the sampled image. +% +% o exception: Return any errors or warnings in this structure. +% +% +*/ +QImage SampleImage(const QImage& image,const int columns, + const int rows) +{ + int + *x_offset, + *y_offset; + + long + j, + y; + + uchar + *pixels; + + register const uchar + *p; + + register long + x; + + register uchar + *q; + + /* + Initialize sampled image attributes. + */ + if ((columns == image.width()) && (rows == image.height())) + return image; + // This function is modified to handle any image depth, not only + // 32bit like the ImageMagick original. This avoids the relatively + // expensive conversion. + const int d = image.depth() / 8; + QImage sample_image( columns, rows, image.depth()); + sample_image.setAlphaBuffer( image.hasAlphaBuffer()); + /* + Allocate scan line buffer and column offset buffers. + */ + pixels= new uchar[ image.width() * d ]; + x_offset= new int[ sample_image.width() ]; + y_offset= new int[ sample_image.height() ]; + /* + Initialize pixel offsets. + */ +// In the following several code 0.5 needs to be added, otherwise the image +// would be moved by half a pixel to bottom-right, just like +// with Qt's QImage::scale() + for (x=0; x < (long) sample_image.width(); x++) + { + x_offset[x]=int((x+0.5)*image.width()/sample_image.width()); + } + for (y=0; y < (long) sample_image.height(); y++) + { + y_offset[y]=int((y+0.5)*image.height()/sample_image.height()); + } + /* + Sample each row. + */ + j=(-1); + for (y=0; y < (long) sample_image.height(); y++) + { + q= sample_image.scanLine( y ); + if (j != y_offset[y] ) + { + /* + Read a scan line. + */ + j= y_offset[y]; + p= image.scanLine( j ); + (void) memcpy(pixels,p,image.width()*d); + } + /* + Sample each column. + */ + switch( d ) + { + case 1: // 8bit + for (x=0; x < (long) sample_image.width(); x++) + { + *q++=pixels[ x_offset[x] ]; + } + break; + case 4: // 32bit + for (x=0; x < (long) sample_image.width(); x++) + { + *(QRgb*)q=((QRgb*)pixels)[ x_offset[x] ]; + q += d; + } + break; + default: + for (x=0; x < (long) sample_image.width(); x++) + { + memcpy( q, pixels + x_offset[x] * d, d ); + q += d; + } + break; + } + } + if( d != 4 ) // != 32bit + { + sample_image.setNumColors( image.numColors()); + for( int i = 0; i < image.numColors(); ++i ) + sample_image.setColor( i, image.color( i )); + } + delete[] y_offset; + delete[] x_offset; + delete[] pixels; + return sample_image; +} + + +// ImageMagick code end + + +// Imlib2/Mosfet code begin +// ------------------------ + +// This code is Imlib2 code, additionally modified by Mosfet, and with few small +// modifications for Gwenview. The MMX scaling code also belongs to it. + +// The original license texts follow. + +/** + * This is the normal smoothscale method, based on Imlib2's smoothscale. + * + * Originally I took the algorithm used in NetPBM and Qt and added MMX/3dnow + * optimizations. It ran in about 1/2 the time as Qt. Then I ported Imlib's + * C algorithm and it ran at about the same speed as my MMX optimized one... + * Finally I ported Imlib's MMX version and it ran in less than half the + * time as my MMX algorithm, (taking only a quarter of the time Qt does). + * + * Changes include formatting, namespaces and other C++'ings, removal of old + * #ifdef'ed code, and removal of unneeded border calculation code. + * + * Imlib2 is (C) Carsten Haitzler and various contributors. The MMX code + * is by Willem Monsuwe . All other modifications are + * (C) Daniel M. Duley. + */ + +/* + Copyright (C) 2004 Daniel M. Duley + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +*/ + +/* +Copyright (C) 2000 Carsten Haitzler and various contributors (see AUTHORS) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to +deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies of the Software and its Copyright notices. In addition publicly +documented acknowledgment must be given that this software has been used if no +source code of this software is made available publicly. This includes +acknowledgments in either Copyright notices, Manuals, Publicity and Marketing +documents or any documentation provided with any product containing this +software. This License does not apply to any software that links to the +libraries provided by this software (statically or dynamically), but only to +the software provided. + +Please see the COPYING.PLAIN for a plain-english explanation of this notice +and it's intent. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +namespace MImageScale{ + typedef struct __mimage_scale_info + { + int *xpoints; + unsigned int **ypoints; + int *xapoints, *yapoints; + int xup_yup; + } MImageScaleInfo; + + unsigned int** mimageCalcYPoints(unsigned int *src, int sow, int sh, + int dh); + int* mimageCalcXPoints(int sw, int dw); + int* mimageCalcApoints(int s, int d, int up); + MImageScaleInfo* mimageFreeScaleInfo(MImageScaleInfo *isi); + MImageScaleInfo *mimageCalcScaleInfo(QImage &img, int sw, int sh, + int dw, int dh, char aa, int sow); + void mimageSampleRGBA(MImageScaleInfo *isi, unsigned int *dest, int dxx, + int dyy, int dx, int dy, int dw, int dh, int dow); + void mimageScaleAARGBA(MImageScaleInfo *isi, unsigned int *dest, int dxx, + int dyy, int dx, int dy, int dw, int dh, int dow, + int sow); + void mimageScaleAARGB(MImageScaleInfo *isi, unsigned int *dest, int dxx, + int dyy, int dx, int dy, int dw, int dh, int dow, int + sow); + QImage smoothScale(const QImage& img, int dw, int dh); +} + +#ifdef HAVE_X86_MMX +extern "C" { + void __mimageScale_mmx_AARGBA(MImageScale::MImageScaleInfo *isi, + unsigned int *dest, int dxx, int dyy, + int dx, int dy, int dw, int dh, + int dow, int sow); +} +#endif + +using namespace MImageScale; + +QImage MImageScale::smoothScale(const QImage& image, int dw, int dh) +{ + QImage img = image.depth() < 32 ? image.convertDepth( 32 ) : image; + int w = img.width(); + int h = img.height(); + + int sow = img.bytesPerLine(); + // handle CroppedQImage + if( img.height() > 1 && sow != img.scanLine( 1 ) - img.scanLine( 0 )) + sow = img.scanLine( 1 ) - img.scanLine( 0 ); + sow = sow / ( img.depth() / 8 ); + + MImageScaleInfo *scaleinfo = + mimageCalcScaleInfo(img, w, h, dw, dh, true, sow); + if(!scaleinfo) + return QImage(); + + QImage buffer(dw, dh, 32); + buffer.setAlphaBuffer(img.hasAlphaBuffer()); + +#ifdef HAVE_X86_MMX +//#warning Using MMX Smoothscale + bool haveMMX = KCPUInfo::haveExtension( KCPUInfo::IntelMMX ); + if(haveMMX){ + __mimageScale_mmx_AARGBA(scaleinfo, (unsigned int *)buffer.scanLine(0), + 0, 0, 0, 0, dw, dh, dw, sow); + } + else +#endif + { + if(img.hasAlphaBuffer()) + mimageScaleAARGBA(scaleinfo, (unsigned int *)buffer.scanLine(0), 0, 0, + 0, 0, dw, dh, dw, sow); + else + mimageScaleAARGB(scaleinfo, (unsigned int *)buffer.scanLine(0), 0, 0, + 0, 0, dw, dh, dw, sow); + } + mimageFreeScaleInfo(scaleinfo); + return(buffer); +} + +// +// Code ported from Imlib... +// + +// FIXME: replace with mRed, etc... These work on pointers to pixels, not +// pixel values +#if BYTE_ORDER == BIG_ENDIAN +#define A_VAL(p) ((unsigned char *)(p))[0] +#define R_VAL(p) ((unsigned char *)(p))[1] +#define G_VAL(p) ((unsigned char *)(p))[2] +#define B_VAL(p) ((unsigned char *)(p))[3] +#elif BYTE_ORDER == LITTLE_ENDIAN +#define A_VAL(p) ((unsigned char *)(p))[3] +#define R_VAL(p) ((unsigned char *)(p))[2] +#define G_VAL(p) ((unsigned char *)(p))[1] +#define B_VAL(p) ((unsigned char *)(p))[0] +#else +#error "BYTE_ORDER is not defined" +#endif + +#define INV_XAP (256 - xapoints[x]) +#define XAP (xapoints[x]) +#define INV_YAP (256 - yapoints[dyy + y]) +#define YAP (yapoints[dyy + y]) + +unsigned int** MImageScale::mimageCalcYPoints(unsigned int *src, + int sow, int sh, int dh) +{ + unsigned int **p; + int i, j = 0; + int val, inc, rv = 0; + + if(dh < 0){ + dh = -dh; + rv = 1; + } + p = new unsigned int* [dh+1]; + + val = 0; + inc = (sh << 16) / dh; + for(i = 0; i < dh; i++){ + p[j++] = src + ((val >> 16) * sow); + val += inc; + } + if(rv){ + for(i = dh / 2; --i >= 0; ){ + unsigned int *tmp = p[i]; + p[i] = p[dh - i - 1]; + p[dh - i - 1] = tmp; + } + } + return(p); +} + +int* MImageScale::mimageCalcXPoints(int sw, int dw) +{ + int *p, i, j = 0; + int val, inc, rv = 0; + + if(dw < 0){ + dw = -dw; + rv = 1; + } + p = new int[dw+1]; + + val = 0; + inc = (sw << 16) / dw; + for(i = 0; i < dw; i++){ + p[j++] = (val >> 16); + val += inc; + } + + if(rv){ + for(i = dw / 2; --i >= 0; ){ + int tmp = p[i]; + p[i] = p[dw - i - 1]; + p[dw - i - 1] = tmp; + } + } + return(p); +} + +int* MImageScale::mimageCalcApoints(int s, int d, int up) +{ + int *p, i, j = 0, rv = 0; + + if(d < 0){ + rv = 1; + d = -d; + } + p = new int[d]; + + /* scaling up */ + if(up){ + int val, inc; + + val = 0; + inc = (s << 16) / d; + for(i = 0; i < d; i++){ + p[j++] = (val >> 8) - ((val >> 8) & 0xffffff00); + if((val >> 16) >= (s - 1)) + p[j - 1] = 0; + val += inc; + } + } + /* scaling down */ + else{ + int val, inc, ap, Cp; + val = 0; + inc = (s << 16) / d; + Cp = ((d << 14) / s) + 1; + for(i = 0; i < d; i++){ + ap = ((0x100 - ((val >> 8) & 0xff)) * Cp) >> 8; + p[j] = ap | (Cp << 16); + j++; + val += inc; + } + } + if(rv){ + int tmp; + for(i = d / 2; --i >= 0; ){ + tmp = p[i]; + p[i] = p[d - i - 1]; + p[d - i - 1] = tmp; + } + } + return(p); +} + +MImageScaleInfo* MImageScale::mimageFreeScaleInfo(MImageScaleInfo *isi) +{ + if(isi){ + delete[] isi->xpoints; + delete[] isi->ypoints; + delete[] isi->xapoints; + delete[] isi->yapoints; + delete isi; + } + return(NULL); +} + +MImageScaleInfo* MImageScale::mimageCalcScaleInfo(QImage &img, int sw, int sh, + int dw, int dh, char aa, int sow) +{ + MImageScaleInfo *isi; + int scw, sch; + + scw = dw * img.width() / sw; + sch = dh * img.height() / sh; + + isi = new MImageScaleInfo; + if(!isi) + return(NULL); + memset(isi, 0, sizeof(MImageScaleInfo)); + + isi->xup_yup = (abs(dw) >= sw) + ((abs(dh) >= sh) << 1); + + isi->xpoints = mimageCalcXPoints(img.width(), scw); + if(!isi->xpoints) + return(mimageFreeScaleInfo(isi)); + isi->ypoints = mimageCalcYPoints((unsigned int *)img.scanLine(0), + sow, img.height(), sch ); + if (!isi->ypoints) + return(mimageFreeScaleInfo(isi)); + if(aa){ + isi->xapoints = mimageCalcApoints(img.width(), scw, isi->xup_yup & 1); + if(!isi->xapoints) + return(mimageFreeScaleInfo(isi)); + isi->yapoints = mimageCalcApoints(img.height(), sch, isi->xup_yup & 2); + if(!isi->yapoints) + return(mimageFreeScaleInfo(isi)); + } + return(isi); +} + +/* scale by pixel sampling only */ +void MImageScale::mimageSampleRGBA(MImageScaleInfo *isi, unsigned int *dest, + int dxx, int dyy, int dx, int dy, int dw, + int dh, int dow) +{ + unsigned int *sptr, *dptr; + int x, y, end; + unsigned int **ypoints = isi->ypoints; + int *xpoints = isi->xpoints; + + /* whats the last pixel ont he line so we stop there */ + end = dxx + dw; + /* go through every scanline in the output buffer */ + for(y = 0; y < dh; y++){ + /* get the pointer to the start of the destination scanline */ + dptr = dest + dx + ((y + dy) * dow); + /* calculate the source line we'll scan from */ + sptr = ypoints[dyy + y]; + /* go thru the scanline and copy across */ + for(x = dxx; x < end; x++) + *dptr++ = sptr[xpoints[x]]; + } +} + +/* FIXME: NEED to optimise ScaleAARGBA - currently its "ok" but needs work*/ + +/* scale by area sampling */ +void MImageScale::mimageScaleAARGBA(MImageScaleInfo *isi, unsigned int *dest, + int dxx, int dyy, int dx, int dy, int dw, + int dh, int dow, int sow) +{ + unsigned int *sptr, *dptr; + int x, y, end; + unsigned int **ypoints = isi->ypoints; + int *xpoints = isi->xpoints; + int *xapoints = isi->xapoints; + int *yapoints = isi->yapoints; + + end = dxx + dw; + /* scaling up both ways */ + if(isi->xup_yup == 3){ + /* go through every scanline in the output buffer */ + for(y = 0; y < dh; y++){ + /* calculate the source line we'll scan from */ + dptr = dest + dx + ((y + dy) * dow); + sptr = ypoints[dyy + y]; + if(YAP > 0){ + for(x = dxx; x < end; x++){ + int r, g, b, a; + int rr, gg, bb, aa; + unsigned int *pix; + + if(XAP > 0){ + pix = ypoints[dyy + y] + xpoints[x]; + r = R_VAL(pix) * INV_XAP; + g = G_VAL(pix) * INV_XAP; + b = B_VAL(pix) * INV_XAP; + a = A_VAL(pix) * INV_XAP; + pix++; + r += R_VAL(pix) * XAP; + g += G_VAL(pix) * XAP; + b += B_VAL(pix) * XAP; + a += A_VAL(pix) * XAP; + pix += sow; + rr = R_VAL(pix) * XAP; + gg = G_VAL(pix) * XAP; + bb = B_VAL(pix) * XAP; + aa = A_VAL(pix) * XAP; + pix--; + rr += R_VAL(pix) * INV_XAP; + gg += G_VAL(pix) * INV_XAP; + bb += B_VAL(pix) * INV_XAP; + aa += A_VAL(pix) * INV_XAP; + r = ((rr * YAP) + (r * INV_YAP)) >> 16; + g = ((gg * YAP) + (g * INV_YAP)) >> 16; + b = ((bb * YAP) + (b * INV_YAP)) >> 16; + a = ((aa * YAP) + (a * INV_YAP)) >> 16; + *dptr++ = qRgba(r, g, b, a); + } + else{ + pix = ypoints[dyy + y] + xpoints[x]; + r = R_VAL(pix) * INV_YAP; + g = G_VAL(pix) * INV_YAP; + b = B_VAL(pix) * INV_YAP; + a = A_VAL(pix) * INV_YAP; + pix += sow; + r += R_VAL(pix) * YAP; + g += G_VAL(pix) * YAP; + b += B_VAL(pix) * YAP; + a += A_VAL(pix) * YAP; + r >>= 8; + g >>= 8; + b >>= 8; + a >>= 8; + *dptr++ = qRgba(r, g, b, a); + } + } + } + else{ + for(x = dxx; x < end; x++){ + int r, g, b, a; + unsigned int *pix; + + if(XAP > 0){ + pix = ypoints[dyy + y] + xpoints[x]; + r = R_VAL(pix) * INV_XAP; + g = G_VAL(pix) * INV_XAP; + b = B_VAL(pix) * INV_XAP; + a = A_VAL(pix) * INV_XAP; + pix++; + r += R_VAL(pix) * XAP; + g += G_VAL(pix) * XAP; + b += B_VAL(pix) * XAP; + a += A_VAL(pix) * XAP; + r >>= 8; + g >>= 8; + b >>= 8; + a >>= 8; + *dptr++ = qRgba(r, g, b, a); + } + else + *dptr++ = sptr[xpoints[x] ]; + } + } + } + } + /* if we're scaling down vertically */ + else if(isi->xup_yup == 1){ + /*\ 'Correct' version, with math units prepared for MMXification \*/ + int Cy, j; + unsigned int *pix; + int r, g, b, a, rr, gg, bb, aa; + int yap; + + /* go through every scanline in the output buffer */ + for(y = 0; y < dh; y++){ + Cy = YAP >> 16; + yap = YAP & 0xffff; + + dptr = dest + dx + ((y + dy) * dow); + for(x = dxx; x < end; x++){ + pix = ypoints[dyy + y] + xpoints[x]; + r = (R_VAL(pix) * yap) >> 10; + g = (G_VAL(pix) * yap) >> 10; + b = (B_VAL(pix) * yap) >> 10; + a = (A_VAL(pix) * yap) >> 10; + for(j = (1 << 14) - yap; j > Cy; j -= Cy){ + pix += sow; + r += (R_VAL(pix) * Cy) >> 10; + g += (G_VAL(pix) * Cy) >> 10; + b += (B_VAL(pix) * Cy) >> 10; + a += (A_VAL(pix) * Cy) >> 10; + } + if(j > 0){ + pix += sow; + r += (R_VAL(pix) * j) >> 10; + g += (G_VAL(pix) * j) >> 10; + b += (B_VAL(pix) * j) >> 10; + a += (A_VAL(pix) * j) >> 10; + } + if(XAP > 0){ + pix = ypoints[dyy + y] + xpoints[x] + 1; + rr = (R_VAL(pix) * yap) >> 10; + gg = (G_VAL(pix) * yap) >> 10; + bb = (B_VAL(pix) * yap) >> 10; + aa = (A_VAL(pix) * yap) >> 10; + for(j = (1 << 14) - yap; j > Cy; j -= Cy){ + pix += sow; + rr += (R_VAL(pix) * Cy) >> 10; + gg += (G_VAL(pix) * Cy) >> 10; + bb += (B_VAL(pix) * Cy) >> 10; + aa += (A_VAL(pix) * Cy) >> 10; + } + if(j > 0){ + pix += sow; + rr += (R_VAL(pix) * j) >> 10; + gg += (G_VAL(pix) * j) >> 10; + bb += (B_VAL(pix) * j) >> 10; + aa += (A_VAL(pix) * j) >> 10; + } + r = r * INV_XAP; + g = g * INV_XAP; + b = b * INV_XAP; + a = a * INV_XAP; + r = (r + ((rr * XAP))) >> 12; + g = (g + ((gg * XAP))) >> 12; + b = (b + ((bb * XAP))) >> 12; + a = (a + ((aa * XAP))) >> 12; + } + else{ + r >>= 4; + g >>= 4; + b >>= 4; + a >>= 4; + } + *dptr = qRgba(r, g, b, a); + dptr++; + } + } + } + /* if we're scaling down horizontally */ + else if(isi->xup_yup == 2){ + /*\ 'Correct' version, with math units prepared for MMXification \*/ + int Cx, j; + unsigned int *pix; + int r, g, b, a, rr, gg, bb, aa; + int xap; + + /* go through every scanline in the output buffer */ + for(y = 0; y < dh; y++){ + dptr = dest + dx + ((y + dy) * dow); + for(x = dxx; x < end; x++){ + Cx = XAP >> 16; + xap = XAP & 0xffff; + + pix = ypoints[dyy + y] + xpoints[x]; + r = (R_VAL(pix) * xap) >> 10; + g = (G_VAL(pix) * xap) >> 10; + b = (B_VAL(pix) * xap) >> 10; + a = (A_VAL(pix) * xap) >> 10; + for(j = (1 << 14) - xap; j > Cx; j -= Cx){ + pix++; + r += (R_VAL(pix) * Cx) >> 10; + g += (G_VAL(pix) * Cx) >> 10; + b += (B_VAL(pix) * Cx) >> 10; + a += (A_VAL(pix) * Cx) >> 10; + } + if(j > 0){ + pix++; + r += (R_VAL(pix) * j) >> 10; + g += (G_VAL(pix) * j) >> 10; + b += (B_VAL(pix) * j) >> 10; + a += (A_VAL(pix) * j) >> 10; + } + if(YAP > 0){ + pix = ypoints[dyy + y] + xpoints[x] + sow; + rr = (R_VAL(pix) * xap) >> 10; + gg = (G_VAL(pix) * xap) >> 10; + bb = (B_VAL(pix) * xap) >> 10; + aa = (A_VAL(pix) * xap) >> 10; + for(j = (1 << 14) - xap; j > Cx; j -= Cx){ + pix++; + rr += (R_VAL(pix) * Cx) >> 10; + gg += (G_VAL(pix) * Cx) >> 10; + bb += (B_VAL(pix) * Cx) >> 10; + aa += (A_VAL(pix) * Cx) >> 10; + } + if(j > 0){ + pix++; + rr += (R_VAL(pix) * j) >> 10; + gg += (G_VAL(pix) * j) >> 10; + bb += (B_VAL(pix) * j) >> 10; + aa += (A_VAL(pix) * j) >> 10; + } + r = r * INV_YAP; + g = g * INV_YAP; + b = b * INV_YAP; + a = a * INV_YAP; + r = (r + ((rr * YAP))) >> 12; + g = (g + ((gg * YAP))) >> 12; + b = (b + ((bb * YAP))) >> 12; + a = (a + ((aa * YAP))) >> 12; + } + else{ + r >>= 4; + g >>= 4; + b >>= 4; + a >>= 4; + } + *dptr = qRgba(r, g, b, a); + dptr++; + } + } + } + /* if we're scaling down horizontally & vertically */ + else{ + /*\ 'Correct' version, with math units prepared for MMXification: + |*| The operation 'b = (b * c) >> 16' translates to pmulhw, + |*| so the operation 'b = (b * c) >> d' would translate to + |*| psllw (16 - d), %mmb; pmulh %mmc, %mmb + \*/ + int Cx, Cy, i, j; + unsigned int *pix; + int a, r, g, b, ax, rx, gx, bx; + int xap, yap; + + for(y = 0; y < dh; y++){ + Cy = YAP >> 16; + yap = YAP & 0xffff; + + dptr = dest + dx + ((y + dy) * dow); + for(x = dxx; x < end; x++){ + Cx = XAP >> 16; + xap = XAP & 0xffff; + + sptr = ypoints[dyy + y] + xpoints[x]; + pix = sptr; + sptr += sow; + rx = (R_VAL(pix) * xap) >> 9; + gx = (G_VAL(pix) * xap) >> 9; + bx = (B_VAL(pix) * xap) >> 9; + ax = (A_VAL(pix) * xap) >> 9; + pix++; + for(i = (1 << 14) - xap; i > Cx; i -= Cx){ + rx += (R_VAL(pix) * Cx) >> 9; + gx += (G_VAL(pix) * Cx) >> 9; + bx += (B_VAL(pix) * Cx) >> 9; + ax += (A_VAL(pix) * Cx) >> 9; + pix++; + } + if(i > 0){ + rx += (R_VAL(pix) * i) >> 9; + gx += (G_VAL(pix) * i) >> 9; + bx += (B_VAL(pix) * i) >> 9; + ax += (A_VAL(pix) * i) >> 9; + } + + r = (rx * yap) >> 14; + g = (gx * yap) >> 14; + b = (bx * yap) >> 14; + a = (ax * yap) >> 14; + + for(j = (1 << 14) - yap; j > Cy; j -= Cy){ + pix = sptr; + sptr += sow; + rx = (R_VAL(pix) * xap) >> 9; + gx = (G_VAL(pix) * xap) >> 9; + bx = (B_VAL(pix) * xap) >> 9; + ax = (A_VAL(pix) * xap) >> 9; + pix++; + for(i = (1 << 14) - xap; i > Cx; i -= Cx){ + rx += (R_VAL(pix) * Cx) >> 9; + gx += (G_VAL(pix) * Cx) >> 9; + bx += (B_VAL(pix) * Cx) >> 9; + ax += (A_VAL(pix) * Cx) >> 9; + pix++; + } + if(i > 0){ + rx += (R_VAL(pix) * i) >> 9; + gx += (G_VAL(pix) * i) >> 9; + bx += (B_VAL(pix) * i) >> 9; + ax += (A_VAL(pix) * i) >> 9; + } + + r += (rx * Cy) >> 14; + g += (gx * Cy) >> 14; + b += (bx * Cy) >> 14; + a += (ax * Cy) >> 14; + } + if(j > 0){ + pix = sptr; + sptr += sow; + rx = (R_VAL(pix) * xap) >> 9; + gx = (G_VAL(pix) * xap) >> 9; + bx = (B_VAL(pix) * xap) >> 9; + ax = (A_VAL(pix) * xap) >> 9; + pix++; + for(i = (1 << 14) - xap; i > Cx; i -= Cx){ + rx += (R_VAL(pix) * Cx) >> 9; + gx += (G_VAL(pix) * Cx) >> 9; + bx += (B_VAL(pix) * Cx) >> 9; + ax += (A_VAL(pix) * Cx) >> 9; + pix++; + } + if(i > 0){ + rx += (R_VAL(pix) * i) >> 9; + gx += (G_VAL(pix) * i) >> 9; + bx += (B_VAL(pix) * i) >> 9; + ax += (A_VAL(pix) * i) >> 9; + } + + r += (rx * j) >> 14; + g += (gx * j) >> 14; + b += (bx * j) >> 14; + a += (ax * j) >> 14; + } + + R_VAL(dptr) = r >> 5; + G_VAL(dptr) = g >> 5; + B_VAL(dptr) = b >> 5; + A_VAL(dptr) = a >> 5; + dptr++; + } + } + } +} + +/* scale by area sampling - IGNORE the ALPHA byte*/ +void MImageScale::mimageScaleAARGB(MImageScaleInfo *isi, unsigned int *dest, + int dxx, int dyy, int dx, int dy, int dw, + int dh, int dow, int sow) +{ + unsigned int *sptr, *dptr; + int x, y, end; + unsigned int **ypoints = isi->ypoints; + int *xpoints = isi->xpoints; + int *xapoints = isi->xapoints; + int *yapoints = isi->yapoints; + + end = dxx + dw; + /* scaling up both ways */ + if(isi->xup_yup == 3){ + /* go through every scanline in the output buffer */ + for(y = 0; y < dh; y++){ + /* calculate the source line we'll scan from */ + dptr = dest + dx + ((y + dy) * dow); + sptr = ypoints[dyy + y]; + if(YAP > 0){ + for(x = dxx; x < end; x++){ + int r = 0, g = 0, b = 0; + int rr = 0, gg = 0, bb = 0; + unsigned int *pix; + + if(XAP > 0){ + pix = ypoints[dyy + y] + xpoints[x]; + r = R_VAL(pix) * INV_XAP; + g = G_VAL(pix) * INV_XAP; + b = B_VAL(pix) * INV_XAP; + pix++; + r += R_VAL(pix) * XAP; + g += G_VAL(pix) * XAP; + b += B_VAL(pix) * XAP; + pix += sow; + rr = R_VAL(pix) * XAP; + gg = G_VAL(pix) * XAP; + bb = B_VAL(pix) * XAP; + pix --; + rr += R_VAL(pix) * INV_XAP; + gg += G_VAL(pix) * INV_XAP; + bb += B_VAL(pix) * INV_XAP; + r = ((rr * YAP) + (r * INV_YAP)) >> 16; + g = ((gg * YAP) + (g * INV_YAP)) >> 16; + b = ((bb * YAP) + (b * INV_YAP)) >> 16; + *dptr++ = qRgba(r, g, b, 0xff); + } + else{ + pix = ypoints[dyy + y] + xpoints[x]; + r = R_VAL(pix) * INV_YAP; + g = G_VAL(pix) * INV_YAP; + b = B_VAL(pix) * INV_YAP; + pix += sow; + r += R_VAL(pix) * YAP; + g += G_VAL(pix) * YAP; + b += B_VAL(pix) * YAP; + r >>= 8; + g >>= 8; + b >>= 8; + *dptr++ = qRgba(r, g, b, 0xff); + } + } + } + else{ + for(x = dxx; x < end; x++){ + int r = 0, g = 0, b = 0; + unsigned int *pix; + + if(XAP > 0){ + pix = ypoints[dyy + y] + xpoints[x]; + r = R_VAL(pix) * INV_XAP; + g = G_VAL(pix) * INV_XAP; + b = B_VAL(pix) * INV_XAP; + pix++; + r += R_VAL(pix) * XAP; + g += G_VAL(pix) * XAP; + b += B_VAL(pix) * XAP; + r >>= 8; + g >>= 8; + b >>= 8; + *dptr++ = qRgba(r, g, b, 0xff); + } + else + *dptr++ = sptr[xpoints[x] ]; + } + } + } + } + /* if we're scaling down vertically */ + else if(isi->xup_yup == 1){ + /*\ 'Correct' version, with math units prepared for MMXification \*/ + int Cy, j; + unsigned int *pix; + int r, g, b, rr, gg, bb; + int yap; + + /* go through every scanline in the output buffer */ + for(y = 0; y < dh; y++){ + Cy = YAP >> 16; + yap = YAP & 0xffff; + + dptr = dest + dx + ((y + dy) * dow); + for(x = dxx; x < end; x++){ + pix = ypoints[dyy + y] + xpoints[x]; + r = (R_VAL(pix) * yap) >> 10; + g = (G_VAL(pix) * yap) >> 10; + b = (B_VAL(pix) * yap) >> 10; + pix += sow; + for(j = (1 << 14) - yap; j > Cy; j -= Cy){ + r += (R_VAL(pix) * Cy) >> 10; + g += (G_VAL(pix) * Cy) >> 10; + b += (B_VAL(pix) * Cy) >> 10; + pix += sow; + } + if(j > 0){ + r += (R_VAL(pix) * j) >> 10; + g += (G_VAL(pix) * j) >> 10; + b += (B_VAL(pix) * j) >> 10; + } + if(XAP > 0){ + pix = ypoints[dyy + y] + xpoints[x] + 1; + rr = (R_VAL(pix) * yap) >> 10; + gg = (G_VAL(pix) * yap) >> 10; + bb = (B_VAL(pix) * yap) >> 10; + pix += sow; + for(j = (1 << 14) - yap; j > Cy; j -= Cy){ + rr += (R_VAL(pix) * Cy) >> 10; + gg += (G_VAL(pix) * Cy) >> 10; + bb += (B_VAL(pix) * Cy) >> 10; + pix += sow; + } + if(j > 0){ + rr += (R_VAL(pix) * j) >> 10; + gg += (G_VAL(pix) * j) >> 10; + bb += (B_VAL(pix) * j) >> 10; + } + r = r * INV_XAP; + g = g * INV_XAP; + b = b * INV_XAP; + r = (r + ((rr * XAP))) >> 12; + g = (g + ((gg * XAP))) >> 12; + b = (b + ((bb * XAP))) >> 12; + } + else{ + r >>= 4; + g >>= 4; + b >>= 4; + } + *dptr = qRgba(r, g, b, 0xff); + dptr++; + } + } + } + /* if we're scaling down horizontally */ + else if(isi->xup_yup == 2){ + /*\ 'Correct' version, with math units prepared for MMXification \*/ + int Cx, j; + unsigned int *pix; + int r, g, b, rr, gg, bb; + int xap; + + /* go through every scanline in the output buffer */ + for(y = 0; y < dh; y++){ + dptr = dest + dx + ((y + dy) * dow); + for(x = dxx; x < end; x++){ + Cx = XAP >> 16; + xap = XAP & 0xffff; + + pix = ypoints[dyy + y] + xpoints[x]; + r = (R_VAL(pix) * xap) >> 10; + g = (G_VAL(pix) * xap) >> 10; + b = (B_VAL(pix) * xap) >> 10; + pix++; + for(j = (1 << 14) - xap; j > Cx; j -= Cx){ + r += (R_VAL(pix) * Cx) >> 10; + g += (G_VAL(pix) * Cx) >> 10; + b += (B_VAL(pix) * Cx) >> 10; + pix++; + } + if(j > 0){ + r += (R_VAL(pix) * j) >> 10; + g += (G_VAL(pix) * j) >> 10; + b += (B_VAL(pix) * j) >> 10; + } + if(YAP > 0){ + pix = ypoints[dyy + y] + xpoints[x] + sow; + rr = (R_VAL(pix) * xap) >> 10; + gg = (G_VAL(pix) * xap) >> 10; + bb = (B_VAL(pix) * xap) >> 10; + pix++; + for(j = (1 << 14) - xap; j > Cx; j -= Cx){ + rr += (R_VAL(pix) * Cx) >> 10; + gg += (G_VAL(pix) * Cx) >> 10; + bb += (B_VAL(pix) * Cx) >> 10; + pix++; + } + if(j > 0){ + rr += (R_VAL(pix) * j) >> 10; + gg += (G_VAL(pix) * j) >> 10; + bb += (B_VAL(pix) * j) >> 10; + } + r = r * INV_YAP; + g = g * INV_YAP; + b = b * INV_YAP; + r = (r + ((rr * YAP))) >> 12; + g = (g + ((gg * YAP))) >> 12; + b = (b + ((bb * YAP))) >> 12; + } + else{ + r >>= 4; + g >>= 4; + b >>= 4; + } + *dptr = qRgba(r, g, b, 0xff); + dptr++; + } + } + } + /* fully optimized (i think) - onyl change of algorithm can help */ + /* if we're scaling down horizontally & vertically */ + else{ + /*\ 'Correct' version, with math units prepared for MMXification \*/ + int Cx, Cy, i, j; + unsigned int *pix; + int r, g, b, rx, gx, bx; + int xap, yap; + + for(y = 0; y < dh; y++){ + Cy = YAP >> 16; + yap = YAP & 0xffff; + + dptr = dest + dx + ((y + dy) * dow); + for(x = dxx; x < end; x++){ + Cx = XAP >> 16; + xap = XAP & 0xffff; + + sptr = ypoints[dyy + y] + xpoints[x]; + pix = sptr; + sptr += sow; + rx = (R_VAL(pix) * xap) >> 9; + gx = (G_VAL(pix) * xap) >> 9; + bx = (B_VAL(pix) * xap) >> 9; + pix++; + for(i = (1 << 14) - xap; i > Cx; i -= Cx){ + rx += (R_VAL(pix) * Cx) >> 9; + gx += (G_VAL(pix) * Cx) >> 9; + bx += (B_VAL(pix) * Cx) >> 9; + pix++; + } + if(i > 0){ + rx += (R_VAL(pix) * i) >> 9; + gx += (G_VAL(pix) * i) >> 9; + bx += (B_VAL(pix) * i) >> 9; + } + + r = (rx * yap) >> 14; + g = (gx * yap) >> 14; + b = (bx * yap) >> 14; + + for(j = (1 << 14) - yap; j > Cy; j -= Cy){ + pix = sptr; + sptr += sow; + rx = (R_VAL(pix) * xap) >> 9; + gx = (G_VAL(pix) * xap) >> 9; + bx = (B_VAL(pix) * xap) >> 9; + pix++; + for(i = (1 << 14) - xap; i > Cx; i -= Cx){ + rx += (R_VAL(pix) * Cx) >> 9; + gx += (G_VAL(pix) * Cx) >> 9; + bx += (B_VAL(pix) * Cx) >> 9; + pix++; + } + if(i > 0){ + rx += (R_VAL(pix) * i) >> 9; + gx += (G_VAL(pix) * i) >> 9; + bx += (B_VAL(pix) * i) >> 9; + } + + r += (rx * Cy) >> 14; + g += (gx * Cy) >> 14; + b += (bx * Cy) >> 14; + } + if(j > 0){ + pix = sptr; + sptr += sow; + rx = (R_VAL(pix) * xap) >> 9; + gx = (G_VAL(pix) * xap) >> 9; + bx = (B_VAL(pix) * xap) >> 9; + pix++; + for(i = (1 << 14) - xap; i > Cx; i -= Cx){ + rx += (R_VAL(pix) * Cx) >> 9; + gx += (G_VAL(pix) * Cx) >> 9; + bx += (B_VAL(pix) * Cx) >> 9; + pix++; + } + if(i > 0){ + rx += (R_VAL(pix) * i) >> 9; + gx += (G_VAL(pix) * i) >> 9; + bx += (B_VAL(pix) * i) >> 9; + } + + r += (rx * j) >> 14; + g += (gx * j) >> 14; + b += (bx * j) >> 14; + } + + R_VAL(dptr) = r >> 5; + G_VAL(dptr) = g >> 5; + B_VAL(dptr) = b >> 5; + dptr++; + } + } + } +} + +// Imlib2/Mosfet code end + +QImage scale(const QImage& image, int width, int height, + SmoothAlgorithm alg, QImage::ScaleMode mode, double blur ) +{ + if( image.isNull()) return image.copy(); + + QSize newSize( image.size() ); + newSize.scale( QSize( width, height ), (QSize::ScaleMode)mode ); // ### remove cast in Qt 4.0 + newSize = newSize.expandedTo( QSize( 1, 1 )); // make sure it doesn't become null + + if ( newSize == image.size() ) return image.copy(); + + width = newSize.width(); + height = newSize.height(); + Filter filter = NULL; + fastfloat filtersupport; + + switch( alg ) { + case SMOOTH_NONE: + filter = NULL; + filtersupport = 0.0; + break; + case SMOOTH_FAST: + filter = Box; + filtersupport = 0.5; + break; + case SMOOTH_NORMAL: + default: + filter = Triangle; + filtersupport = 1.0; + break; + case SMOOTH_BEST: +// filter = Mitchell; + filter = Bicubic; + filtersupport = 2.0; + break; + } + + if( filter == Box && blur == 1.0 ) + return MImageScale::smoothScale( image, width, height ); + + if( filter == Box && width > image.width() && height > image.height() && blur == 1.0 ) { + filter = NULL; // Box doesn't really smooth when enlarging + } + + if( filter == NULL ) { + return SampleImage( image, width, height ); // doesn't need 32bit + } + + return ResizeImage( image.convertDepth( 32 ), width, height, filter, filtersupport, blur ); + // unlike Qt's smoothScale() this function introduces new colors to grayscale images ... oh well +} + + +} // namespace diff --git a/ksquirrel/main.cpp b/ksquirrel/main.cpp new file mode 100644 index 0000000..b3ca621 --- /dev/null +++ b/ksquirrel/main.cpp @@ -0,0 +1,186 @@ +/*************************************************************************** + main.cpp - description + ------------------- + begin : Dec 10 2003 + copyright : (C) 2004 by Baryshev Dmitry + email : ksquirrel.iv@gmail.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include "ksquirrel.h" +#include "sq_splashscreen.h" +#include "sq_hloptions.h" + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +/* ****************************************************************** */ + +// Our command line options +static KCmdLineOptions options[] = +{ + {"+[file to open]", I18N_NOOP("File to be opened at startup."), 0}, + {"l", I18N_NOOP("Print found libraries and exit."), 0}, + {"d", 0, 0}, + {"print-dcop", I18N_NOOP("Print available DCOP parameters"), 0}, + {"nodirectorybasket", I18N_NOOP("Folder basket"), 0}, + {"noimagebasket", I18N_NOOP("Image basket"), 0}, + {"nocategories", I18N_NOOP("Categories"), 0}, + {"nomountview", I18N_NOOP("Mount view"), 0}, + + KCmdLineLastOption +}; + +int main(int argc, char *argv[]) +{ + KSquirrel *SQ; + SQ_HLOptions *high; + const QCString App = "ksquirrel"; + + KAboutData aboutData( + "ksquirrel", + "KSquirrel", + VERSION, + I18N_NOOP("KSquirrel - image viewer for KDE"), + KAboutData::License_GPL, + "(c) 2003-2007 Baryshev Dmitry", + QString::null, + "http://ksquirrel.sourceforge.net", + "ksquirrel.iv@gmail.com"); + + // setup 'About' dialog + aboutData.addAuthor("Dmitry Baryshev aka Krasu", "Author", "ksquirrel.iv@gmail.com", QString::null); + aboutData.addCredit("Andrey Rahmatullin aka wrar", I18N_NOOP("Bug reports, patches"), "wrar@altlinux.ru", QString::null); + aboutData.addCredit("SeaJey", I18N_NOOP("Testing"), "seajey.serg@gmail.com", QString::null); + aboutData.addCredit("JaguarWan", I18N_NOOP("Bug reports"), "jaguarwan@gmail.com", QString::null); + aboutData.addCredit("NightGoblin", I18N_NOOP("Translation help"), 0, "http://nightgoblin.info"); + aboutData.addCredit(I18N_NOOP("TiamaT"), I18N_NOOP("Initial artwork for edit tools"), "plasticfantasy@tut.by", "http://www.livejournal.com/users/tiamatik/"); + aboutData.addCredit(I18N_NOOP("Fera"), I18N_NOOP("Great artwork for edit tools"), "morrigan171@mail.ru", QString::null); + aboutData.addCredit(I18N_NOOP("OpenGL forum at"), 0, 0, "http://opengl.org"); + aboutData.addCredit(I18N_NOOP("GameDev forum at"), 0, 0, "http://gamedev.ru"); + + // parse command line + KCmdLineArgs::init(argc, argv, &aboutData); + KCmdLineArgs::addCmdLineOptions(options); + KCmdLineArgs *sq_args = KCmdLineArgs::parsedArgs(); + + //create high level options + high = new SQ_HLOptions; + + if(sq_args->count()) + high->param = QFile::decodeName(sq_args->arg(0)); + + high->showLibsAndExit = sq_args->isSet("l"); + bool printDCOP = sq_args->isSet("d"); + + high->have_directorybasket = sq_args->isSet("directorybasket"); + high->have_imagebasket = sq_args->isSet("imagebasket"); + high->have_categories = sq_args->isSet("categories"); + high->have_mountview = sq_args->isSet("mountview"); + + KApplication a; + + if(!QGLFormat::hasOpenGL()) + { + qWarning("KSquirrel: this system has no OpenGL support. Exiting." ); + exit(1); + } + + // don't even try to connect to DCOP if -l specified - + // anyway we will exit later + if(!high->showLibsAndExit) + { + bool reg = a.dcopClient()->isApplicationRegistered(App); + + // Check if KSquirrel already registered. + // If registered, send an url to it. + if(reg && !high->param.isEmpty()) + { + // Yes, it is registered. Let's send a message to it. + QCString replyType; + QByteArray data, replyData; + QDataStream dataStream(data, IO_WriteOnly); + + dataStream << high->param; + + if(!a.dcopClient()->call(App, App, "load(QString)", data, replyType, replyData)) + qDebug("\nUnable to send data to old instance of KSquirrel: exiting.\n"); + + sq_args->clear(); + delete high; + + exit(0); + } + // If registered, but no url was specified in command line + else if(reg) + { + QString data; + + if(!a.dcopClient()->send(App, App, "activate()", data)) + qDebug("\nUnable to send data to old instance of KSquirrel: exiting.\n"); + + sq_args->clear(); + delete high; + + exit(0); + } + } + + KGlobal::dirs()->addResourceType("data", KStandardDirs::kde_default("data") + QString::fromLatin1("ksquirrel")); + + SQ_SplashScreen *splash = 0; + + // should we show a splash screen ? + KConfig *config = new KConfig("ksquirrelrc"); + config->setGroup("Main"); + + if(config->readBoolEntry("splash", true)) + { + splash = new SQ_SplashScreen(0, "ksquirrel-splash-screen"); + if(!high->showLibsAndExit) splash->show(); // don't show splash when -l + KApplication::flush(); + } + + delete config; + + // connect to DCOP server and register KSquirrel. Now we can + // send messages to KSquirrel (see README for parameters) + if(a.dcopClient()->attach()) + a.dcopClient()->registerAs(App, false); + + // create an instance + SQ = new KSquirrel(0, App); + + if(printDCOP) + SQ->printDCOP(); + + a.setMainWidget(SQ); + + sq_args->clear(); + + return a.exec(); +} diff --git a/ksquirrel/mime/Makefile.am b/ksquirrel/mime/Makefile.am new file mode 100644 index 0000000..50baa80 --- /dev/null +++ b/ksquirrel/mime/Makefile.am @@ -0,0 +1,109 @@ +####### kdevelop will overwrite this part!!! (begin)########## + + +EXTRA_DIST = x-avs.desktop x-cut.desktop x-dxf.desktop x-iff.desktop x-jbig.desktop x-koala.desktop x-leaf.desktop x-lif.desktop x-mac.desktop x-msp.desktop x-mtv.desktop x-neo.desktop x-pi1.desktop x-pict.desktop x-pix.desktop x-pxr.desktop x-ras.desktop x-ras.magic x-rawrgb.desktop x-sct.desktop x-sun.desktop x-sun.magic x-utah.desktop x-utah.magic x-wal.desktop x-wbmp.desktop x-xim.desktop x-xwd.desktop x-pi3.desktop ljpeg.desktop x-dicom.desktop x-mdl.desktop x-psp.desktop + +install-data-local: + $(mkinstalldirs) $(kde_mimedir)/image/ + $(INSTALL_DATA) $(srcdir)/x-avs.desktop $(kde_mimedir)/image/x-avs.desktop + $(mkinstalldirs) $(kde_mimedir)/image/ + $(INSTALL_DATA) $(srcdir)/x-cut.desktop $(kde_mimedir)/image/x-cut.desktop + $(mkinstalldirs) $(kde_mimedir)/image/ + $(INSTALL_DATA) $(srcdir)/x-dxf.desktop $(kde_mimedir)/image/x-dxf.desktop + $(mkinstalldirs) $(kde_mimedir)/image/ + $(INSTALL_DATA) $(srcdir)/x-iff.desktop $(kde_mimedir)/image/x-iff.desktop + $(mkinstalldirs) $(kde_mimedir)/image/ + $(INSTALL_DATA) $(srcdir)/x-jbig.desktop $(kde_mimedir)/image/x-jbig.desktop + $(mkinstalldirs) $(kde_mimedir)/image/ + $(INSTALL_DATA) $(srcdir)/x-koala.desktop $(kde_mimedir)/image/x-koala.desktop + $(mkinstalldirs) $(kde_mimedir)/image/ + $(INSTALL_DATA) $(srcdir)/x-leaf.desktop $(kde_mimedir)/image/x-leaf.desktop + $(mkinstalldirs) $(kde_mimedir)/image/ + $(INSTALL_DATA) $(srcdir)/x-lif.desktop $(kde_mimedir)/image/x-lif.desktop + $(mkinstalldirs) $(kde_mimedir)/image/ + $(INSTALL_DATA) $(srcdir)/x-mac.desktop $(kde_mimedir)/image/x-mac.desktop + $(mkinstalldirs) $(kde_mimedir)/image/ + $(INSTALL_DATA) $(srcdir)/x-msp.desktop $(kde_mimedir)/image/x-msp.desktop + $(mkinstalldirs) $(kde_mimedir)/image/ + $(INSTALL_DATA) $(srcdir)/x-mtv.desktop $(kde_mimedir)/image/x-mtv.desktop + $(mkinstalldirs) $(kde_mimedir)/image/ + $(INSTALL_DATA) $(srcdir)/x-neo.desktop $(kde_mimedir)/image/x-neo.desktop + $(mkinstalldirs) $(kde_mimedir)/image/ + $(INSTALL_DATA) $(srcdir)/x-pi1.desktop $(kde_mimedir)/image/x-pi1.desktop + $(mkinstalldirs) $(kde_mimedir)/image/ + $(INSTALL_DATA) $(srcdir)/x-pict.desktop $(kde_mimedir)/image/x-pict.desktop + $(mkinstalldirs) $(kde_mimedir)/image/ + $(INSTALL_DATA) $(srcdir)/x-pix.desktop $(kde_mimedir)/image/x-pix.desktop + $(mkinstalldirs) $(kde_mimedir)/image/ + $(INSTALL_DATA) $(srcdir)/x-pxr.desktop $(kde_mimedir)/image/x-pxr.desktop + $(mkinstalldirs) $(kde_mimedir)/image/ + $(INSTALL_DATA) $(srcdir)/x-ras.desktop $(kde_mimedir)/image/x-ras.desktop + $(mkinstalldirs) $(kde_confdir)/magic/ + $(INSTALL_DATA) $(srcdir)/x-ras.magic $(kde_confdir)/magic/x-ras.magic + $(mkinstalldirs) $(kde_mimedir)/image/ + $(INSTALL_DATA) $(srcdir)/x-rawrgb.desktop $(kde_mimedir)/image/x-rawrgb.desktop + $(mkinstalldirs) $(kde_mimedir)/image/ + $(INSTALL_DATA) $(srcdir)/x-sct.desktop $(kde_mimedir)/image/x-sct.desktop + $(mkinstalldirs) $(kde_mimedir)/image/ + $(INSTALL_DATA) $(srcdir)/x-sun.desktop $(kde_mimedir)/image/x-sun.desktop + $(mkinstalldirs) $(kde_confdir)/magic/ + $(INSTALL_DATA) $(srcdir)/x-sun.magic $(kde_confdir)/magic/x-sun.magic + $(mkinstalldirs) $(kde_mimedir)/image/ + $(INSTALL_DATA) $(srcdir)/x-utah.desktop $(kde_mimedir)/image/x-utah.desktop + $(mkinstalldirs) $(kde_confdir)/magic/ + $(INSTALL_DATA) $(srcdir)/x-utah.magic $(kde_confdir)/magic/x-utah.magic + $(mkinstalldirs) $(kde_mimedir)/image/ + $(INSTALL_DATA) $(srcdir)/x-wal.desktop $(kde_mimedir)/image/x-wal.desktop + $(mkinstalldirs) $(kde_mimedir)/image/ + $(INSTALL_DATA) $(srcdir)/x-wbmp.desktop $(kde_mimedir)/image/x-wbmp.desktop + $(mkinstalldirs) $(kde_mimedir)/image/ + $(INSTALL_DATA) $(srcdir)/x-xim.desktop $(kde_mimedir)/image/x-xim.desktop + $(mkinstalldirs) $(kde_mimedir)/image/ + $(INSTALL_DATA) $(srcdir)/x-xwd.desktop $(kde_mimedir)/image/x-xwd.desktop + $(mkinstalldirs) $(kde_mimedir)/image/ + $(INSTALL_DATA) $(srcdir)/x-pi3.desktop $(kde_mimedir)/image/x-pi3.desktop + $(mkinstalldirs) $(kde_mimedir)/image/ + $(INSTALL_DATA) $(srcdir)/ljpeg.desktop $(kde_mimedir)/image/ljpeg.desktop + $(mkinstalldirs) $(kde_mimedir)/image/ + $(INSTALL_DATA) $(srcdir)/x-dicom.desktop $(kde_mimedir)/image/x-dicom.desktop + $(mkinstalldirs) $(kde_mimedir)/image/ + $(INSTALL_DATA) $(srcdir)/x-mdl.desktop $(kde_mimedir)/image/x-mdl.desktop + $(mkinstalldirs) $(kde_mimedir)/image/ + $(INSTALL_DATA) $(srcdir)/x-psp.desktop $(kde_mimedir)/image/x-psp.desktop + +uninstall-local: + -rm -f $(kde_mimedir)/image/x-avs.desktop + -rm -f $(kde_mimedir)/image/x-cut.desktop + -rm -f $(kde_mimedir)/image/x-dxf.desktop + -rm -f $(kde_mimedir)/image/x-iff.desktop + -rm -f $(kde_mimedir)/image/x-jbig.desktop + -rm -f $(kde_mimedir)/image/x-koala.desktop + -rm -f $(kde_mimedir)/image/x-leaf.desktop + -rm -f $(kde_mimedir)/image/x-lif.desktop + -rm -f $(kde_mimedir)/image/x-mac.desktop + -rm -f $(kde_mimedir)/image/x-msp.desktop + -rm -f $(kde_mimedir)/image/x-mtv.desktop + -rm -f $(kde_mimedir)/image/x-neo.desktop + -rm -f $(kde_mimedir)/image/x-pi1.desktop + -rm -f $(kde_mimedir)/image/x-pict.desktop + -rm -f $(kde_mimedir)/image/x-pix.desktop + -rm -f $(kde_mimedir)/image/x-pxr.desktop + -rm -f $(kde_mimedir)/image/x-ras.desktop + -rm -f $(kde_confdir)/magic/x-ras.magic + -rm -f $(kde_mimedir)/image/x-rawrgb.desktop + -rm -f $(kde_mimedir)/image/x-sct.desktop + -rm -f $(kde_mimedir)/image/x-sun.desktop + -rm -f $(kde_confdir)/magic/x-sun.magic + -rm -f $(kde_mimedir)/image/x-utah.desktop + -rm -f $(kde_confdir)/magic/x-utah.magic + -rm -f $(kde_mimedir)/image/x-wal.desktop + -rm -f $(kde_mimedir)/image/x-wbmp.desktop + -rm -f $(kde_mimedir)/image/x-xim.desktop + -rm -f $(kde_mimedir)/image/x-xwd.desktop + -rm -f $(kde_mimedir)/image/x-pi3.desktop + -rm -f $(kde_mimedir)/image/ljpeg.desktop + -rm -f $(kde_mimedir)/image/x-dicom.desktop + -rm -f $(kde_mimedir)/image/x-mdl.desktop + -rm -f $(kde_mimedir)/image/x-psp.desktop + +####### kdevelop will overwrite this part!!! (end)############ diff --git a/ksquirrel/mime/ljpeg.desktop b/ksquirrel/mime/ljpeg.desktop new file mode 100644 index 0000000..671d4c2 --- /dev/null +++ b/ksquirrel/mime/ljpeg.desktop @@ -0,0 +1,7 @@ +[Desktop Entry] +Encoding=UTF-8 +Type=MimeType +MimeType=image/ljpeg +Icon=image +Patterns=*.ljpg;*.LJPG;*.ljpeg;*.LJPEG; +Comment=Lossless JPEG diff --git a/ksquirrel/mime/x-avs.desktop b/ksquirrel/mime/x-avs.desktop new file mode 100644 index 0000000..99a6b11 --- /dev/null +++ b/ksquirrel/mime/x-avs.desktop @@ -0,0 +1,7 @@ +[Desktop Entry] +Encoding=UTF-8 +Type=MimeType +MimeType=image/x-avs +Icon=image +Patterns=*.x;*.X; +Comment=AVS X image diff --git a/ksquirrel/mime/x-cut.desktop b/ksquirrel/mime/x-cut.desktop new file mode 100644 index 0000000..dde89bf --- /dev/null +++ b/ksquirrel/mime/x-cut.desktop @@ -0,0 +1,7 @@ +[Desktop Entry] +Encoding=UTF-8 +Type=MimeType +MimeType=image/x-cut +Icon=image +Patterns=*.cut;*.CUT; +Comment=Dr. Halo CUT \ No newline at end of file diff --git a/ksquirrel/mime/x-dicom.desktop b/ksquirrel/mime/x-dicom.desktop new file mode 100644 index 0000000..3323df0 --- /dev/null +++ b/ksquirrel/mime/x-dicom.desktop @@ -0,0 +1,7 @@ +[Desktop Entry] +Encoding=UTF-8 +Type=MimeType +MimeType=image/x-dicom +Icon=image +Patterns=*.dcm;*.DCM;*.dicom;*.DICOM +Comment=DICOM diff --git a/ksquirrel/mime/x-dxf.desktop b/ksquirrel/mime/x-dxf.desktop new file mode 100644 index 0000000..1e44d9c --- /dev/null +++ b/ksquirrel/mime/x-dxf.desktop @@ -0,0 +1,7 @@ +[Desktop Entry] +Encoding=UTF-8 +Type=MimeType +MimeType=image/x-dxf +Icon=image +Patterns=*.dxf;*.DXF; +Comment=AutoCAD/QCAD Drawing \ No newline at end of file diff --git a/ksquirrel/mime/x-iff.desktop b/ksquirrel/mime/x-iff.desktop new file mode 100644 index 0000000..5bbec57 --- /dev/null +++ b/ksquirrel/mime/x-iff.desktop @@ -0,0 +1,7 @@ +[Desktop Entry] +Encoding=UTF-8 +Type=MimeType +MimeType=image/x-iff +Icon=image +Patterns=*.iff;*.IFF;*.ilbm;*.ILBM;*.lbm;*.LBM; +Comment=Interchange File Format \ No newline at end of file diff --git a/ksquirrel/mime/x-jbig.desktop b/ksquirrel/mime/x-jbig.desktop new file mode 100644 index 0000000..17a8912 --- /dev/null +++ b/ksquirrel/mime/x-jbig.desktop @@ -0,0 +1,7 @@ +[Desktop Entry] +Encoding=UTF-8 +Type=MimeType +MimeType=image/x-jbig +Icon=image +Patterns=*.jbg;*.JBG;*.jbig;*.JBIG; +Comment=JBIG \ No newline at end of file diff --git a/ksquirrel/mime/x-koala.desktop b/ksquirrel/mime/x-koala.desktop new file mode 100644 index 0000000..c1b313b --- /dev/null +++ b/ksquirrel/mime/x-koala.desktop @@ -0,0 +1,7 @@ +[Desktop Entry] +Encoding=UTF-8 +Type=MimeType +MimeType=image/x-koala +Icon=image +Patterns=*.koa;*.KOA;*.kla;*.KLA +Comment=Commodore 64 Koala \ No newline at end of file diff --git a/ksquirrel/mime/x-leaf.desktop b/ksquirrel/mime/x-leaf.desktop new file mode 100644 index 0000000..9d68b66 --- /dev/null +++ b/ksquirrel/mime/x-leaf.desktop @@ -0,0 +1,7 @@ +[Desktop Entry] +Encoding=UTF-8 +Type=MimeType +MimeType=image/x-leaf +Icon=image +Patterns=*.leaf;*.LEAF; +Comment=ILEAF Image diff --git a/ksquirrel/mime/x-lif.desktop b/ksquirrel/mime/x-lif.desktop new file mode 100644 index 0000000..705a8cc --- /dev/null +++ b/ksquirrel/mime/x-lif.desktop @@ -0,0 +1,7 @@ +[Desktop Entry] +Encoding=UTF-8 +Type=MimeType +MimeType=image/x-lif +Icon=image +Patterns=*.lif;*.LIF; +Comment=Homeworld LIF diff --git a/ksquirrel/mime/x-mac.desktop b/ksquirrel/mime/x-mac.desktop new file mode 100644 index 0000000..52fc8c0 --- /dev/null +++ b/ksquirrel/mime/x-mac.desktop @@ -0,0 +1,7 @@ +[Desktop Entry] +Encoding=UTF-8 +Type=MimeType +MimeType=image/x-mac +Icon=image +Patterns=*.mac;*.MAC; +Comment=Macintosh Paint diff --git a/ksquirrel/mime/x-mdl.desktop b/ksquirrel/mime/x-mdl.desktop new file mode 100644 index 0000000..876b873 --- /dev/null +++ b/ksquirrel/mime/x-mdl.desktop @@ -0,0 +1,7 @@ +[Desktop Entry] +Encoding=UTF-8 +Type=MimeType +MimeType=image/x-mdl +Icon=image +Patterns=*.mdl;*.MDL; +Comment=HalfLife Model diff --git a/ksquirrel/mime/x-msp.desktop b/ksquirrel/mime/x-msp.desktop new file mode 100644 index 0000000..c7e5bd6 --- /dev/null +++ b/ksquirrel/mime/x-msp.desktop @@ -0,0 +1,7 @@ +[Desktop Entry] +Encoding=UTF-8 +Type=MimeType +MimeType=image/x-msp +Icon=image +Patterns=*.msp;*.MSP; +Comment=Microsoft Paint diff --git a/ksquirrel/mime/x-mtv.desktop b/ksquirrel/mime/x-mtv.desktop new file mode 100644 index 0000000..85de528 --- /dev/null +++ b/ksquirrel/mime/x-mtv.desktop @@ -0,0 +1,7 @@ +[Desktop Entry] +Encoding=UTF-8 +Type=MimeType +MimeType=image/x-mtv +Icon=image +Patterns=*.mtv;*.MTV; +Comment=MTV Ray Tracer diff --git a/ksquirrel/mime/x-neo.desktop b/ksquirrel/mime/x-neo.desktop new file mode 100644 index 0000000..457e1d5 --- /dev/null +++ b/ksquirrel/mime/x-neo.desktop @@ -0,0 +1,7 @@ +[Desktop Entry] +Encoding=UTF-8 +Type=MimeType +MimeType=image/x-neo +Icon=image +Patterns=*.neo;*.NEO; +Comment=Neochrome NEO diff --git a/ksquirrel/mime/x-pi1.desktop b/ksquirrel/mime/x-pi1.desktop new file mode 100644 index 0000000..812a22b --- /dev/null +++ b/ksquirrel/mime/x-pi1.desktop @@ -0,0 +1,7 @@ +[Desktop Entry] +Encoding=UTF-8 +Type=MimeType +MimeType=image/x-pi1 +Icon=image +Patterns=*.pi1;*.PI1; +Comment=Degas PI1 diff --git a/ksquirrel/mime/x-pi3.desktop b/ksquirrel/mime/x-pi3.desktop new file mode 100644 index 0000000..20edd11 --- /dev/null +++ b/ksquirrel/mime/x-pi3.desktop @@ -0,0 +1,7 @@ +[Desktop Entry] +Encoding=UTF-8 +Type=MimeType +MimeType=image/x-pi3 +Icon=image +Patterns=*.pi3;*.PI3; +Comment=Degas PI3 diff --git a/ksquirrel/mime/x-pict.desktop b/ksquirrel/mime/x-pict.desktop new file mode 100644 index 0000000..0d49384 --- /dev/null +++ b/ksquirrel/mime/x-pict.desktop @@ -0,0 +1,7 @@ +[Desktop Entry] +Encoding=UTF-8 +Type=MimeType +MimeType=image/x-pict +Icon=image +Patterns=*.pict;*.PICT; +Comment=Macintosh PICT diff --git a/ksquirrel/mime/x-pix.desktop b/ksquirrel/mime/x-pix.desktop new file mode 100644 index 0000000..704c241 --- /dev/null +++ b/ksquirrel/mime/x-pix.desktop @@ -0,0 +1,7 @@ +[Desktop Entry] +Encoding=UTF-8 +Type=MimeType +MimeType=image/x-pix +Icon=image +Patterns=*.pix;*.PIX; +Comment=Irix PIX Image diff --git a/ksquirrel/mime/x-psp.desktop b/ksquirrel/mime/x-psp.desktop new file mode 100644 index 0000000..c2fc926 --- /dev/null +++ b/ksquirrel/mime/x-psp.desktop @@ -0,0 +1,8 @@ +[Desktop Entry] +Encoding=UTF-8 +Comment=PaintShop Pro +Hidden=false +Icon= +MimeType=image/x-psp +Patterns=*.psp;*.PSP +Type=MimeType diff --git a/ksquirrel/mime/x-pxr.desktop b/ksquirrel/mime/x-pxr.desktop new file mode 100644 index 0000000..3d99c1f --- /dev/null +++ b/ksquirrel/mime/x-pxr.desktop @@ -0,0 +1,7 @@ +[Desktop Entry] +Encoding=UTF-8 +Type=MimeType +MimeType=image/x-pxr +Icon=image +Patterns=*.pxr;*.PXR; +Comment=Pxrar format diff --git a/ksquirrel/mime/x-ras.desktop b/ksquirrel/mime/x-ras.desktop new file mode 100644 index 0000000..d6eb85e --- /dev/null +++ b/ksquirrel/mime/x-ras.desktop @@ -0,0 +1,7 @@ +[Desktop Entry] +Encoding=UTF-8 +Type=MimeType +MimeType=image/x-ras +Icon=image +Patterns=*.ras;*.RAS; +Comment=SUN Raster diff --git a/ksquirrel/mime/x-ras.magic b/ksquirrel/mime/x-ras.magic new file mode 100644 index 0000000..d043906 --- /dev/null +++ b/ksquirrel/mime/x-ras.magic @@ -0,0 +1 @@ +0 string \x59\xA6\x6A\x95 image/x-ras diff --git a/ksquirrel/mime/x-rawrgb.desktop b/ksquirrel/mime/x-rawrgb.desktop new file mode 100644 index 0000000..e26eb32 --- /dev/null +++ b/ksquirrel/mime/x-rawrgb.desktop @@ -0,0 +1,7 @@ +[Desktop Entry] +Encoding=UTF-8 +Type=MimeType +MimeType=image/x-rawrgb +Icon=image +Patterns=*.rawrgb;*.RAWRGB; +Comment=KSquirrel RAWRGB diff --git a/ksquirrel/mime/x-sct.desktop b/ksquirrel/mime/x-sct.desktop new file mode 100644 index 0000000..e6ab95e --- /dev/null +++ b/ksquirrel/mime/x-sct.desktop @@ -0,0 +1,7 @@ +[Desktop Entry] +Encoding=UTF-8 +Type=MimeType +MimeType=image/x-sct +Icon=image +Patterns=*.sct;*.SCT;*.ct;*.CT; +Comment=Scitex CT diff --git a/ksquirrel/mime/x-sun.desktop b/ksquirrel/mime/x-sun.desktop new file mode 100644 index 0000000..5ca782b --- /dev/null +++ b/ksquirrel/mime/x-sun.desktop @@ -0,0 +1,7 @@ +[Desktop Entry] +Encoding=UTF-8 +Type=MimeType +MimeType=image/x-sun +Icon=image +Patterns=*.sun;*.SUN; +Comment=SUN Icon diff --git a/ksquirrel/mime/x-sun.magic b/ksquirrel/mime/x-sun.magic new file mode 100644 index 0000000..f747352 --- /dev/null +++ b/ksquirrel/mime/x-sun.magic @@ -0,0 +1 @@ +0 string /\\* Format_ image/x-sun diff --git a/ksquirrel/mime/x-utah.desktop b/ksquirrel/mime/x-utah.desktop new file mode 100644 index 0000000..360aade --- /dev/null +++ b/ksquirrel/mime/x-utah.desktop @@ -0,0 +1,7 @@ +[Desktop Entry] +Encoding=UTF-8 +Type=MimeType +MimeType=image/x-utah +Icon=image +Patterns=*.rle;*.RLE; +Comment=UTAH RLE diff --git a/ksquirrel/mime/x-utah.magic b/ksquirrel/mime/x-utah.magic new file mode 100644 index 0000000..1099635 --- /dev/null +++ b/ksquirrel/mime/x-utah.magic @@ -0,0 +1 @@ +0 string \x52\xCC image/x-utah diff --git a/ksquirrel/mime/x-wal.desktop b/ksquirrel/mime/x-wal.desktop new file mode 100644 index 0000000..52691e4 --- /dev/null +++ b/ksquirrel/mime/x-wal.desktop @@ -0,0 +1,7 @@ +[Desktop Entry] +Encoding=UTF-8 +Type=MimeType +MimeType=image/x-wal +Icon=image +Patterns=*.wal;*.WAL; +Comment=Quake2 texture diff --git a/ksquirrel/mime/x-wbmp.desktop b/ksquirrel/mime/x-wbmp.desktop new file mode 100644 index 0000000..73fdff8 --- /dev/null +++ b/ksquirrel/mime/x-wbmp.desktop @@ -0,0 +1,7 @@ +[Desktop Entry] +Encoding=UTF-8 +Type=MimeType +MimeType=image/x-wbmp +Icon=image +Patterns=*.wbmp;*.WBMP; +Comment=Wireless Application Protocol Bitmap diff --git a/ksquirrel/mime/x-xim.desktop b/ksquirrel/mime/x-xim.desktop new file mode 100644 index 0000000..bd05917 --- /dev/null +++ b/ksquirrel/mime/x-xim.desktop @@ -0,0 +1,7 @@ +[Desktop Entry] +Encoding=UTF-8 +Type=MimeType +MimeType=image/x-xim +Icon=image +Patterns=*.xim;*.XIM; +Comment=X Image diff --git a/ksquirrel/mime/x-xwd.desktop b/ksquirrel/mime/x-xwd.desktop new file mode 100644 index 0000000..617ce8c --- /dev/null +++ b/ksquirrel/mime/x-xwd.desktop @@ -0,0 +1,7 @@ +[Desktop Entry] +Encoding=UTF-8 +Type=MimeType +MimeType=image/x-xwd +Icon=image +Patterns=*.xwd;*.XWD; +Comment=X Window Dump diff --git a/ksquirrel/sidebar/Makefile.am b/ksquirrel/sidebar/Makefile.am new file mode 100644 index 0000000..c28df1b --- /dev/null +++ b/ksquirrel/sidebar/Makefile.am @@ -0,0 +1,15 @@ +####### kdevelop will overwrite this part!!! (begin)########## +noinst_LIBRARIES = libsidebar.a + +## INCLUDES were found outside kdevelop specific part + +libsidebar_a_METASOURCES = AUTO + +libsidebar_a_SOURCES = sq_mountviewitem.cpp sq_mountview.cpp sq_imagebasket.cpp sq_directorybasket.cpp sq_categorybrowsermenu.cpp sq_categoriesview.cpp sq_treeviewmenu.cpp sq_previewwidget.cpp sq_storagefile.cpp sq_treeviewitem.cpp sq_threaddirlister.cpp sq_treeview.cpp sq_multibar.cpp + + +EXTRA_DIST = sq_mountview.h sq_multibar.cpp sq_multibar.h sq_treeview.cpp sq_treeview.h sq_categoriesview.h sq_categorybrowsermenu.h sq_threaddirlister.cpp sq_threaddirlister.h sq_treeviewitem.h sq_treeviewitem.cpp sq_mountviewitem.h sq_imagebasket.h sq_storagefile.h sq_storagefile.cpp sq_previewwidget.cpp sq_previewwidget.h sq_treeviewmenu.cpp sq_treeviewmenu.h sq_directorybasket.h sq_categoriesview.cpp sq_categorybrowsermenu.cpp sq_directorybasket.cpp sq_imagebasket.cpp sq_mountview.cpp sq_mountviewitem.cpp + +####### kdevelop will overwrite this part!!! (end)############ + +INCLUDES = $(all_includes) -I$(srcdir) -I$(top_srcdir)/ksquirrel diff --git a/ksquirrel/sidebar/sq_categoriesview.cpp b/ksquirrel/sidebar/sq_categoriesview.cpp new file mode 100644 index 0000000..042e696 --- /dev/null +++ b/ksquirrel/sidebar/sq_categoriesview.cpp @@ -0,0 +1,318 @@ +/*************************************************************************** + sq_categoriesview.cpp - description + ------------------- + begin : ??? June 3 2006 + copyright : (C) 2006 by Baryshev Dmitry + email : ksquirrel.iv@gmail.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "ksquirrel.h" +#include "sq_dir.h" +#include "sq_iconloader.h" +#include "sq_categoriesview.h" +#include "sq_libraryhandler.h" +#include "sq_externaltool.h" +#include "sq_widgetstack.h" +#include "sq_categorybrowsermenu.h" +#include "sq_storagefile.h" +#include "sq_widgetstack.h" +#include "sq_diroperator.h" +#include "sq_treeviewmenu.h" + +SQ_CategoriesBox * SQ_CategoriesBox::sing = 0; + +/* *************************************************************************************** */ + +SQ_CategoriesViewBranch::SQ_CategoriesViewBranch(KFileTreeView *parent, const KURL &url, const QString &name, const QPixmap &pix) + : KFileTreeBranch(parent, url, name, pix) +{} + +SQ_CategoriesViewBranch::~SQ_CategoriesViewBranch() +{} + +KFileTreeViewItem* SQ_CategoriesViewBranch::createTreeViewItem(KFileTreeViewItem *parent, KFileItem *fileItem) +{ + KFileTreeViewItem *i = KFileTreeBranch::createTreeViewItem(parent, fileItem); + + /* + * In storage there are files with MD5 sum appended to their names. + * We should cut off MD5. + */ + if(i) + { + QString n = i->fileItem()->name(); + int ind = n.findRev('.'); + + // OOPS + if(ind != -1) + n.truncate(ind); + + i->setText(0, n); + } + + return i; +} + +/* *************************************************************************************** */ + +SQ_CategoriesView::SQ_CategoriesView(QWidget *parent, const char *name) : KFileTreeView(parent, name) +{ + setAcceptDrops(true); + + m_dir = new SQ_Dir(SQ_Dir::Categories); + + // create custom branch + root = new SQ_CategoriesViewBranch(this, m_dir->root(), i18n("Categories"), + SQ_IconLoader::instance()->loadIcon("bookmark", KIcon::Desktop, KIcon::SizeSmall)); + + addBranch(root); + + header()->hide(); + addColumn(i18n("File")); + setDirOnlyMode(root, false); + setRootIsDecorated(true); + setCurrentItem(root->root()); + root->setChildRecurse(true); + root->setOpen(true); + + menu = new SQ_TreeViewMenu(this); + + connect(this, SIGNAL(spacePressed(QListViewItem*)), this, SIGNAL(executed(QListViewItem*))); + connect(this, SIGNAL(returnPressed(QListViewItem*)), this, SIGNAL(executed(QListViewItem*))); + connect(this, SIGNAL(executed(QListViewItem*)), this, SLOT(slotItemExecuted(QListViewItem*))); + connect(this, SIGNAL(contextMenu(KListView*, QListViewItem*, const QPoint&)), this, SLOT(slotContextMenu(KListView*, QListViewItem*, const QPoint&))); +} + +SQ_CategoriesView::~SQ_CategoriesView() +{ + delete m_dir; +} + +void SQ_CategoriesView::slotContextMenu(KListView *, QListViewItem *item, const QPoint &p) +{ + if(item) + { + KFileTreeViewItem *kfi = static_cast(item); + menu->updateDirActions(kfi->isDir(), (item == root->root())); + menu->setURL(kfi->url()); + menu->exec(p); + } +} + +void SQ_CategoriesView::slotItemExecuted(QListViewItem *item) +{ + if(!item) return; + + if(item == root->root()) + { + root->setOpen(true); + return; + } + + KFileTreeViewItem *cur = static_cast(item); + + // file item + if(cur && !cur->isDir()) + { + KURL inpath = SQ_StorageFile::readStorageFile(cur->path()); + + KFileItem fi(KFileItem::Unknown, KFileItem::Unknown, inpath); + SQ_WidgetStack::instance()->diroperator()->execute(&fi); + } +} + +/* ************************************************************** */ + +SQ_CategoriesBox::SQ_CategoriesBox(QWidget *parent, const char *name) : QVBox(parent, name) +{ + sing = this; + + lastdir = i18n("New Category"); + + view = new SQ_CategoriesView(this); + toolbar = new KToolBar(this); + + connect(view, SIGNAL(dropped(QDropEvent*, QListViewItem*, QListViewItem*)), this, SLOT(slotDropped(QDropEvent*, QListViewItem*, QListViewItem*))); + + menu = new SQ_CategoryBrowserMenu(view->dir()->root(), 0, "Categories menu"); + + toolbar->setIconSize(KIcon::SizeSmall); + + toolbar->insertButton("folder_new", 0, SIGNAL(clicked()), this, SLOT(slotNewCategory()), true, i18n("New category")); + toolbar->insertButton("edittrash", 0, SIGNAL(clicked()), this, SLOT(slotDeleteItem()), true, i18n("Delete")); + toolbar->insertButton("info", 0, SIGNAL(clicked()), this, SLOT(slotItemProperties()), true, i18n("Properties")); + toolbar->insertButton("bookmark_add", 0, SIGNAL(clicked()), this, SLOT(slotDefaultCategories()), true, i18n("Create default categories")); + + view->popupMenu()->reconnect(SQ_TreeViewMenu::New, this, SLOT(slotNewCategory())); + view->popupMenu()->reconnect(SQ_TreeViewMenu::Delete, this, SLOT(slotDeleteItem())); + view->popupMenu()->reconnect(SQ_TreeViewMenu::Properties, this, SLOT(slotItemProperties())); +} + +SQ_CategoriesBox::~SQ_CategoriesBox() +{} + +void SQ_CategoriesBox::addToCategory(const QString &path) +{ + KFileItemList *selected = const_cast(SQ_WidgetStack::instance()->selectedItems()); + + if(!selected) return; + + KFileItem *item; + + item = selected->first(); + + while(item) + { + if(item->isFile()) + SQ_StorageFile::writeStorageFile(path + QDir::separator() + item->name(), item->url().path()); + + item = selected->next(); + } +} + +void SQ_CategoriesBox::slotDefaultCategories() +{ + if(KMessageBox::questionYesNo(KSquirrel::app(), + i18n("This will create default categories: Concerts, Pets, Home, Friends, Free time, Travelling and Nature. Continue?"), + i18n("Create default categories")) == KMessageBox::Yes) + { + QStringList list; + + list << "Concerts" << "Pets" << "Home" << "Friends" << "Free time" << "Traveling" << "Nature"; + + for(QStringList::iterator it = list.begin();it != list.end();++it) + view->dir()->mkdir(*it); + } +} + +void SQ_CategoriesBox::slotNewCategory() +{ + bool ok; + + KFileTreeViewItem *cur = view->currentKFileTreeViewItem(); + + if(!cur) return; + + if(!cur->isDir()) + cur = static_cast(cur->parent()); + + if(!cur) return; + + QString tmp = KInputDialog::getText(i18n("New Category"), i18n("Create new category:"), + lastdir, &ok, this); + if(ok) + { + lastdir = tmp; + KIO::mkdir(cur->path() + QDir::separator() + lastdir); + } +} + +void SQ_CategoriesBox::slotDropped(QDropEvent *e, QListViewItem *parent, QListViewItem *item) +{ + if(!item) item = parent; + + KFileTreeViewItem *cur = static_cast(item); + + if(!cur) return; + + KURL::List list; + KURLDrag::decode(e, list); + QString path = cur->path(); + + if(list.first().path().startsWith(view->dir()->root())) + KIO::move(list, cur->url()); + else + { + KURL::List::iterator itEnd = list.end(); + QString mimeDet; + + for(KURL::List::iterator it = list.begin(); it != itEnd;++it) + { + mimeDet = KMimeType::findByURL(*it)->name(); + + if(mimeDet != "inode/directory") + SQ_StorageFile::writeStorageFile(path + QDir::separator() + (*it).fileName(), (*it)); + } + } +} + +void SQ_CategoriesBox::slotDeleteItem() +{ + KFileTreeViewItem *cur = view->currentKFileTreeViewItem(); + + if(!cur) return; + + KURL root; + root.setPath(view->dir()->root()); + + if(cur->url().equals(root, true)) + return; + + QListViewItem *next = cur->itemBelow(); + if(!next) next = cur->itemAbove(); + + if(next) + { + view->setCurrentItem(next); + view->setSelected(next, true); + } + + QString tmp = cur->path(); + + // remove this item manually + delete cur; + cur = 0; + + // physically remove file from storage + KIO::del(tmp, false, false); +} + +void SQ_CategoriesBox::slotItemProperties() +{ + KFileTreeViewItem *cur = view->currentKFileTreeViewItem(); + + if(!cur) return; + + // directory - just show its properties + if(cur->isDir()) + (void)new KPropertiesDialog(cur->url(), KSquirrel::app()); + + // link to real file + else + { + KURL inpath = SQ_StorageFile::readStorageFile(cur->path()); + + if(!inpath.isEmpty()) + (void)new KPropertiesDialog(inpath, KSquirrel::app()); + } +} + +#include "sq_categoriesview.moc" diff --git a/ksquirrel/sidebar/sq_categoriesview.h b/ksquirrel/sidebar/sq_categoriesview.h new file mode 100644 index 0000000..b803dbb --- /dev/null +++ b/ksquirrel/sidebar/sq_categoriesview.h @@ -0,0 +1,129 @@ +/*************************************************************************** + sq_categoriesview.h - description + ------------------- + begin : ??? June 3 2006 + copyright : (C) 2006 by Baryshev Dmitry + email : ksquirrel.iv@gmail.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifndef SQ_CATEGORIESVIEW_H +#define SQ_CATEGORIESVIEW_H + +#include + +#include +#include + +class KToolBar; + +class SQ_CategoryBrowserMenu; +class SQ_TreeViewMenu; +class SQ_Dir; + +/** + *@author Baryshev Dmitry + */ + +/* *************************************************** */ + +class SQ_CategoriesViewBranch : public KFileTreeBranch +{ + public: + SQ_CategoriesViewBranch(KFileTreeView*, const KURL &url, const QString &name, const QPixmap &pix); + ~SQ_CategoriesViewBranch(); + + protected: + virtual KFileTreeViewItem *createTreeViewItem(KFileTreeViewItem *parent, KFileItem *fileItem); +}; + +/* *************************************************** */ + +class SQ_CategoriesView : public KFileTreeView +{ + Q_OBJECT + + public: + SQ_CategoriesView(QWidget *parent = 0, const char *name = 0); + ~SQ_CategoriesView(); + + SQ_TreeViewMenu *popupMenu() const; + + SQ_Dir* dir(); + + private slots: + void slotItemExecuted(QListViewItem *item); + void slotContextMenu(KListView *, QListViewItem *i, const QPoint &p); + + private: + KFileTreeBranch *root; + SQ_TreeViewMenu *menu; + + SQ_Dir *m_dir; +}; + +inline +SQ_TreeViewMenu* SQ_CategoriesView::popupMenu() const +{ + return menu; +} + +inline +SQ_Dir* SQ_CategoriesView::dir() +{ + return m_dir; +} + +/* *************************************************** */ + +class SQ_CategoriesBox : public QVBox +{ + Q_OBJECT + + public: + SQ_CategoriesBox(QWidget *parent = 0, const char *name = 0); + ~SQ_CategoriesBox(); + + /* + * Get current popup menu. + */ + SQ_CategoryBrowserMenu* popupMenu() const; + + /* + * Add selected files to some category + */ + void addToCategory(const QString &); + + static SQ_CategoriesBox* instance() { return sing; }; + + private slots: + void slotNewCategory(); + void slotDefaultCategories(); + void slotDeleteItem(); + void slotItemProperties(); + void slotDropped(QDropEvent *, QListViewItem *, QListViewItem *); + + private: + SQ_CategoriesView *view; + KToolBar *toolbar; + QString lastdir, copypath; + SQ_CategoryBrowserMenu *menu; + + static SQ_CategoriesBox *sing; +}; + +inline +SQ_CategoryBrowserMenu* SQ_CategoriesBox::popupMenu() const +{ + return menu; +} + +#endif diff --git a/ksquirrel/sidebar/sq_categorybrowsermenu.cpp b/ksquirrel/sidebar/sq_categorybrowsermenu.cpp new file mode 100644 index 0000000..da384dd --- /dev/null +++ b/ksquirrel/sidebar/sq_categorybrowsermenu.cpp @@ -0,0 +1,523 @@ +/* + * Copyright (C) 2006 Baryshev Dmitry, KSquirrel project + * + * Originally based on browser_mnu.cpp by (C) Matthias Elter + * from kde-3.2.3 + */ + +/***************************************************************** + +Copyright (c) 2001 Matthias Elter + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +******************************************************************/ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "sq_dir.h" +#include "sq_categoriesview.h" +#include "sq_categorybrowsermenu.h" + +#define CICON(a) (*_icons)[a] + +QMap *SQ_CategoryBrowserMenu::_icons = 0; + +SQ_CategoryBrowserMenu::SQ_CategoryBrowserMenu(QString path, QWidget *parent, const char *name, int startid) + : KPanelMenu(path, parent, name) + , _mimecheckTimer(0) + , _startid(startid) + , _dirty(false) +{ + _subMenus.setAutoDelete(true); + _lastpress = QPoint(-1, -1); + setAcceptDrops(true); // Should depend on permissions of path. + + // we are not interested for dirty events on files inside the + // directory (see slotClearIfNeeded) + connect( &_dirWatch, SIGNAL(dirty(const QString&)), + this, SLOT(slotClearIfNeeded(const QString&)) ); + connect( &_dirWatch, SIGNAL(created(const QString&)), + this, SLOT(slotClear()) ); + connect( &_dirWatch, SIGNAL(deleted(const QString&)), + this, SLOT(slotClear()) ); +} + +SQ_CategoryBrowserMenu::~SQ_CategoryBrowserMenu() +{} + +void SQ_CategoryBrowserMenu::slotClearIfNeeded(const QString& p) +{ + if (p == path()) + slotClear(); +} + + +void SQ_CategoryBrowserMenu::initialize() +{ + _lastpress = QPoint(-1, -1); + + // don't change menu if already visible + if (isVisible()) + return; + + if (_dirty) { + // directory content changed while menu was visible + slotClear(); + setInitialized(false); + _dirty = false; + } + + if (initialized()) return; + setInitialized(true); + + // start watching if not already done + if (!_dirWatch.contains(path())) + _dirWatch.addDir( path() ); + + // setup icon map + initIconMap(); + + // read configuration + KConfig *c = KGlobal::config(); + c->setGroup("menus"); + _showhidden = c->readBoolEntry("ShowHiddenFiles", false); + _maxentries = c->readNumEntry("MaxEntries2", 30); + + // clear maps + _filemap.clear(); + _mimemap.clear(); + + int filter = QDir::Dirs | QDir::Files; + if(_showhidden) + filter |= QDir::Hidden; + + QDir dir(path(), QString::null, QDir::DirsFirst | QDir::Name | QDir::IgnoreCase, filter); + + // does the directory exist? + if (!dir.exists()) { + insertItem(i18n("Failed to Read Folder")); + return; + } + + // get entry list + const QFileInfoList *list = dir.entryInfoList(); + + // no list -> read error + if (!list) { + insertItem(i18n("Failed to Read Folder")); + return; + } + + KURL url; + url.setPath(path()); + if (!kapp->authorizeURLAction("list", KURL(), url)) + { + insertItem(i18n("Not Authorized to Read Folder")); + return; + } + + // insert file manager and terminal entries + // only the first part menu got them + if(_startid == 0) + { + SQ_Dir dir(SQ_Dir::Categories); + + if(dir.root() != path()) + { + insertTitle(path().right(path().length() - dir.root().length())); + insertItem(CICON("bookmark_add"), i18n("Add here"), this, SLOT(slotAddToCategory())); + } + } + + bool first_entry = true; + bool dirfile_separator = false; + int item_count = 0; + int run_id = _startid; + + // get list iterator + QFileInfoListIterator it(*list); + + // jump to startid + it += _startid; + + // iterate over entry list + for (; it.current(); ++it) + { + // bump id + run_id++; + + QFileInfo *fi = it.current(); + // handle directories + if (fi->isDir()) + { + QString name = fi->fileName(); + + // ignore . and .. entries + if (name == "." || name == "..") continue; + + QPixmap icon; + QString path = fi->absFilePath(); + + // parse .directory if it does exist + if (QFile::exists(path + "/.directory")) { + + KSimpleConfig c(path + "/.directory", true); + c.setDesktopGroup(); + icon = KGlobal::iconLoader()->loadIcon(c.readEntry("Icon"), + KIcon::Small, KIcon::SizeSmall, + KIcon::DefaultState, 0, true); + if(icon.isNull()) + icon = CICON("folder"); + name = c.readEntry("Name", name); + } + + // use cached folder icon for directories without special icon + if (icon.isNull()) + icon = CICON("folder"); + + // insert separator if we are the first menu entry + if(first_entry) { + if (_startid == 0) + insertSeparator(); + first_entry = false; + } + + // append menu entry + append(icon, KStringHandler::cEmSqueeze( name, fontMetrics(), 20 ), + new SQ_CategoryBrowserMenu(path, this)); + + // bump item count + item_count++; + + dirfile_separator = true; + } +/* + // handle files + else if(fi->isFile()) + { + QString name = fi->fileName(); + QString title = KIO::decodeFileName(name); + + // ignore .directory and .order files + if (name == ".directory" || name == ".order") continue; + + QPixmap icon; + QString path = fi->absFilePath(); + + bool mimecheck = false; + + // .desktop files + if(KDesktopFile::isDesktopFile(path)) + { + KSimpleConfig c(path, true); + c.setDesktopGroup(); + title = c.readEntry("Name", title); + + QString s = c.readEntry("Icon"); + if(!_icons->contains(s)) { + icon = KGlobal::iconLoader()->loadIcon(s, KIcon::Small, KIcon::SizeSmall, + KIcon::DefaultState, 0, true); + + if(icon.isNull()) { + QString type = c.readEntry("Type", "Application"); + if (type == "Directory") + icon = CICON("folder"); + else if (type == "Mimetype") + icon = CICON("txt"); + else if (type == "FSDevice") + icon = CICON("chardevice"); + else + icon = CICON("exec"); + } + else + _icons->insert(s, icon); + } + else + icon = CICON(s); + } + else { + // set unknown icon + icon = CICON("unknown"); + + // mark for delayed mimetime check + mimecheck = true; + } + + // insert separator if we are the first menu entry + if(first_entry) { + if(_startid == 0) + insertSeparator(); + first_entry = false; + } + + // insert separator if we we first file after at least one directory + if (dirfile_separator) { + insertSeparator(); + dirfile_separator = false; + } + + // append file entry + append(icon, title, name, mimecheck); + + // bump item count + item_count++; + } +*/ + if(item_count == _maxentries) { + // Only insert a "More..." item if there are actually more items. + ++it; + if( it.current() ) { + insertSeparator(); + append(CICON("folder_open"), i18n("More..."), new SQ_CategoryBrowserMenu(path(), this, 0, run_id)); + } + break; + } + } + +#if 0 + // WABA: tear off handles don't work together with dynamically updated + // menus. We can't update the menu while torn off, and we don't know + // when it is torn off. + if(KGlobalSettings::insertTearOffHandle() && item_count > 0) + insertTearOffHandle(); +#endif + + adjustSize(); + + QString dirname = path(); + + int maxlen = contentsRect().width() - 40; + if(item_count == 0) + maxlen = fontMetrics().width(dirname); + + if (fontMetrics().width(dirname) > maxlen) { + while ((!dirname.isEmpty()) && (fontMetrics().width(dirname) > (maxlen - fontMetrics().width("...")))) + dirname = dirname.remove(0, 1); + dirname.prepend("..."); + } + setCaption(dirname); + + // setup and start delayed mimetype check timer + if(_mimemap.count() > 0) { + + if(!_mimecheckTimer) + _mimecheckTimer = new QTimer(this); + + connect(_mimecheckTimer, SIGNAL(timeout()), SLOT(slotMimeCheck())); + _mimecheckTimer->start(0); + } +} + +void SQ_CategoryBrowserMenu::append(const QPixmap &pixmap, const QString &title, const QString &file, bool mimecheck) +{ + // avoid &'s being converted to accelerators + QString newTitle = title; + newTitle.replace("&", "&&"); + newTitle = KStringHandler::cEmSqueeze( newTitle, fontMetrics(), 20 ); + + // insert menu item + int id = insertItem(pixmap, newTitle); + + // insert into file map + _filemap.insert(id, file); + + // insert into mimetype check map + if(mimecheck) + _mimemap.insert(id, true); +} + +void SQ_CategoryBrowserMenu::append(const QPixmap &pixmap, const QString &title, SQ_CategoryBrowserMenu *subMenu) +{ + // avoid &'s being converted to accelerators + QString newTitle = title; + newTitle.replace("&", "&&"); + newTitle = KStringHandler::cEmSqueeze( newTitle, fontMetrics(), 20 ); + + // insert submenu + insertItem(pixmap, newTitle, subMenu); + // remember submenu for later deletion + _subMenus.append(subMenu); +} + +void SQ_CategoryBrowserMenu::mousePressEvent(QMouseEvent *e) +{ + QPopupMenu::mousePressEvent(e); + _lastpress = e->pos(); +} + +void SQ_CategoryBrowserMenu::mouseMoveEvent(QMouseEvent *e) +{ + QPopupMenu::mouseMoveEvent(e); + + if (!(e->state() & LeftButton)) return; + if(_lastpress == QPoint(-1, -1)) return; + + // DND delay + if((_lastpress - e->pos()).manhattanLength() < 12) return; + + // get id + int id = idAt(_lastpress); + if(!_filemap.contains(id)) return; + + // reset _lastpress + _lastpress = QPoint(-1, -1); + + // start drag + KURL url; + url.setPath(path() + '/' + _filemap[id]); + KURL::List files(url); + KURLDrag *d = new KURLDrag(files, this); + d->setPixmap(iconSet(id)->pixmap()); + d->drag(); +} + +void SQ_CategoryBrowserMenu::dragEnterEvent( QDragEnterEvent *ev ) +{ + if (KURLDrag::canDecode(ev)) + ev->accept(rect()); + KPanelMenu::dragEnterEvent(ev); +} + +void SQ_CategoryBrowserMenu::dropEvent( QDropEvent *ev ) +{ + KFileItem item( path(), QString::fromLatin1( "inode/directory" ), KFileItem::Unknown ); + KonqOperations::doDrop( &item, path(), ev, this ); + KPanelMenu::dropEvent(ev); + // ### TODO: Update list +} + +void SQ_CategoryBrowserMenu::slotExec(int id) +{ + kapp->propagateSessionManager(); + + if(!_filemap.contains(id)) return; + + KURL url; + url.setPath(path() + '/' + _filemap[id]); + new KRun(url, 0, true); // will delete itself + _lastpress = QPoint(-1, -1); +} + +void SQ_CategoryBrowserMenu::slotAddToCategory() +{ + SQ_CategoriesBox::instance()->addToCategory(path()); +} + +void SQ_CategoryBrowserMenu::slotMimeCheck() +{ + // get the first map entry + QMap::Iterator it = _mimemap.begin(); + + // no mime types left to check -> stop timer + if(it == _mimemap.end()) { + _mimecheckTimer->stop(); + return; + } + + int id = it.key(); + QString file = _filemap[id]; + + _mimemap.remove(it); + + KURL url; + url.setPath( path() + '/' + file ); + +// KMimeType::Ptr mt = KMimeType::findByURL(url, 0, true, false); +// QString icon(mt->icon(url, true)); + QString icon = KMimeType::iconForURL( url ); +// kdDebug() << url.url() << ": " << icon << endl; + + file = KStringHandler::cEmSqueeze( file, fontMetrics(), 20 ); + + file.replace("&", "&&"); + if(!_icons->contains(icon)) { + QPixmap pm = SmallIcon(icon); +#if ( QT_VERSION >= 0x030200 ) + if( pm.height() > 16 ) + { + QPixmap cropped( 16, 16 ); + copyBlt( &cropped, 0, 0, &pm, 0, 0, 16, 16 ); + pm = cropped; + } +#endif + _icons->insert(icon, pm); + changeItem(id, pm, file); + } + else + changeItem(id, CICON(icon), file); +} + +void SQ_CategoryBrowserMenu::slotClear() +{ + // no need to watch any further + if (_dirWatch.contains(path())) + _dirWatch.removeDir( path() ); + + // don't change menu if already visible + if (isVisible()) { + _dirty = true; + return; + } + KPanelMenu::slotClear(); + _subMenus.clear(); // deletes submenus +} + +void SQ_CategoryBrowserMenu::initIconMap() +{ + if(_icons) return; + +// kdDebug() << "SQ_CategoryBrowserMenu::initIconMap" << endl; + + _icons = new QMap; + + _icons->insert("folder", SmallIcon("folder")); + _icons->insert("unknown", SmallIcon("mime_empty")); + _icons->insert("folder_open", SmallIcon("folder_open")); + _icons->insert("kdisknav", SmallIcon("kdisknav")); + _icons->insert("kfm", SmallIcon("kfm")); + _icons->insert("terminal", SmallIcon("terminal")); + _icons->insert("txt", SmallIcon("txt")); + _icons->insert("exec", SmallIcon("exec")); + _icons->insert("chardevice", SmallIcon("chardevice")); +} + +#include "sq_categorybrowsermenu.moc" diff --git a/ksquirrel/sidebar/sq_categorybrowsermenu.h b/ksquirrel/sidebar/sq_categorybrowsermenu.h new file mode 100644 index 0000000..d639053 --- /dev/null +++ b/ksquirrel/sidebar/sq_categorybrowsermenu.h @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2006 Baryshev Dmitry, KSquirrel project + * + * Originally based on browser_mnu.h by (C) Matthias Elter + * from kde-3.2.3 + */ + +/***************************************************************** + +Copyright (c) 2001 Matthias Elter + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +******************************************************************/ + +#ifndef __browser_mnu_h__ +#define __browser_mnu_h__ + +#include +#include +#include +#include + +class SQ_CategoryBrowserMenu : public KPanelMenu +{ + Q_OBJECT + + public: + SQ_CategoryBrowserMenu(QString path, QWidget *parent = 0, const char *name = 0, int startid = 0); + ~SQ_CategoryBrowserMenu(); + + void append(const QPixmap &pixmap, const QString &title, const QString &filename, bool mimecheck); + void append(const QPixmap &pixmap, const QString &title, SQ_CategoryBrowserMenu *subMenu); + + public slots: + void initialize(); + + protected slots: + void slotExec(int id); + void slotAddToCategory(); + void slotMimeCheck(); + void slotClearIfNeeded(const QString&); + void slotClear(); + + protected: + void mousePressEvent(QMouseEvent *); + void mouseMoveEvent(QMouseEvent *); + void dropEvent(QDropEvent *ev); + void dragEnterEvent(QDragEnterEvent *ev); + void initIconMap(); + + QPoint _lastpress; + QMap _filemap; + QMap _mimemap; + QTimer *_mimecheckTimer; + KDirWatch _dirWatch; + QPtrList _subMenus; + + int _startid; + bool _showhidden; + int _maxentries; + bool _dirty; + + static QMap *_icons; +}; + +#endif diff --git a/ksquirrel/sidebar/sq_directorybasket.cpp b/ksquirrel/sidebar/sq_directorybasket.cpp new file mode 100644 index 0000000..0a3c2b2 --- /dev/null +++ b/ksquirrel/sidebar/sq_directorybasket.cpp @@ -0,0 +1,520 @@ +/*************************************************************************** + sq_directorybasket.cpp - description + ------------------- + begin : ??? Sep 29 2007 + copyright : (C) 2007 by Baryshev Dmitry + email : ksquirrel.iv@gmail.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "ksquirrel.h" +#include "sq_directorybasket.h" +#include "sq_storagefile.h" +#include "sq_iconloader.h" +#include "sq_treeviewmenu.h" +#include "sq_widgetstack.h" +#include "sq_diroperator.h" +#include "sq_navigatordropmenu.h" +#include "sq_dir.h" + +SQ_DirectoryBasket * SQ_DirectoryBasket::m_inst = 0; + +/* ******************************************************************************* */ + +SQ_DBMenu::SQ_DBMenu(QWidget *parent, const char *name) : SQ_TreeViewMenu(parent, name), item(0) +{ + insertSeparator(); + id_icon = insertItem(i18n("Change icon"), this, SLOT(slotChangeIcon())); +} + +SQ_DBMenu::~SQ_DBMenu() +{} + +void SQ_DBMenu::slotChangeIcon() +{ + KIconDialog dialog(KGlobal::iconLoader()); + dialog.setup(KIcon::Desktop, KIcon::MimeType, true, KIcon::SizeSmall); + QString result = dialog.openDialog(); + + if(!result.isEmpty() && item) + { + item->setIcon(result); + item->setPixmap(0, SQ_IconLoader::instance()->loadIcon(result, KIcon::Desktop, KIcon::SizeSmall)); + } +} + +void SQ_DBMenu::updateDirActions(bool, bool isroot) +{ + setItemEnabled(id_new, isroot); + setItemEnabled(id_clear, isroot); + setItemEnabled(id_prop, !isroot); + + setItemEnabled(id_delete, !isroot); + setItemEnabled(id_rename, !isroot); + setItemEnabled(id_icon, !isroot); +} + +void SQ_DBMenu::slotDirectoryRename() +{ + if(item) + { + QString renameSrc = item->text(0); + bool ok; + + QString mNewFilename = KInputDialog::getText(i18n("Rename Folder"), + i18n("

Rename item %1 to:

").arg(renameSrc), + renameSrc, &ok, KSquirrel::app()); + + if(ok) + { + item->setName(mNewFilename); + item->setText(0, mNewFilename); + } + } +} + +void SQ_DBMenu::slotDirectoryResult(KIO::Job *job) +{ + if(job && job->error()) + job->showErrorDialog(KSquirrel::app()); +} + +void SQ_DBMenu::slotDirectoryDelete() +{ + if(item) + { + KIO::Job *job = KIO::del(item->KFileTreeViewItem::url()); + + connect(job, SIGNAL(result(KIO::Job*)), this, SLOT(slotDirectoryResult(KIO::Job *))); + } +} + +/* ******************************************************************************* */ + +SQ_DirectoryItem::SQ_DirectoryItem(KFileTreeViewItem *parentItem, KFileItem *fileItem, KFileTreeBranch *parentBranch) + : KFileTreeViewItem(parentItem, fileItem, parentBranch), m_index(0) +{} + +SQ_DirectoryItem::SQ_DirectoryItem(KFileTreeView *parent, KFileItem *fileItem, KFileTreeBranch *parentBranch) + : KFileTreeViewItem(parent, fileItem, parentBranch), m_index(0) +{} + +SQ_DirectoryItem::~SQ_DirectoryItem() +{} + +/* ******************************************************************************* */ + +SQ_DirectoryBasketBranch::SQ_DirectoryBasketBranch(KFileTreeView *parent, const KURL &url, const QString &name, const QPixmap &pix) + : KFileTreeBranch(parent, url, name, pix) +{} + +SQ_DirectoryBasketBranch::~SQ_DirectoryBasketBranch() +{} + +KFileTreeViewItem* SQ_DirectoryBasketBranch::createTreeViewItem(KFileTreeViewItem *parent, KFileItem *fileItem) +{ + if(!parent || !fileItem) + return 0; + + // hehe... + fileItem->setMimeType("inode/directory"); + + SQ_DirectoryItem *i = new SQ_DirectoryItem(parent, fileItem, this); + + if(i) + { + // inpath = "" + QStringList list = QStringList::split(QChar('\n'), SQ_StorageFile::readStorageFileAsString(i->path()), true); + + if(list.count() < 4) + return i; + + QStringList::iterator it = list.begin(); + + bool ok; + QString name, icon; + + // get url + KURL inpath = KURL::fromPathOrURL(*it); + ++it; + + // get name + name = *it; + ++it; + + // get icon + icon = *it; + ++it; + + // get index + int index = (*it).toInt(&ok); + + i->setURL(inpath); + + if(name.isEmpty()) + i->setText(0, inpath.isLocalFile() ? inpath.path() : inpath.prettyURL()); + else + { + i->setText(0, name); + i->setName(name); + } + + if(!icon.isEmpty()) + { + i->setIcon(icon); + i->setPixmap(0, SQ_IconLoader::instance()->loadIcon(icon, KIcon::Desktop, KIcon::SizeSmall)); + } + + if(ok) i->setIndex(index); + } + + return i; +} + +/* ******************************************************************************* */ + +SQ_DirectoryBasket::SQ_DirectoryBasket(QWidget *parent, const char *name) : KFileTreeView(parent, name) +{ + m_inst = this; + + progressAdd = new KProgress(0, "progress add", Qt::WStyle_StaysOnTop | Qt::WStyle_Customize | Qt::WStyle_NoBorder | Qt::WX11BypassWM); + + menu = new SQ_DBMenu(this); + + timer = new QTimer(this); + connect(timer, SIGNAL(timeout()), this, SLOT(slotSortReal())); + + timerAdd = new QTimer(this); + connect(timerAdd, SIGNAL(timeout()), this, SLOT(slotDelayedShowAdd())); + + setSorting(-1); + setAcceptDrops(true); + + dir = new SQ_Dir(SQ_Dir::DirectoryBasket); + + // create custom branch + root = new SQ_DirectoryBasketBranch(this, dir->root(), QString::null, + SQ_IconLoader::instance()->loadIcon("folder", KIcon::Desktop, KIcon::SizeSmall)); + + // some hacks to create our SQ_TreeViewItem as root item + SQ_DirectoryItem *ritem = new SQ_DirectoryItem(this, + new KFileItem(dir->root(), + "inode/directory", S_IFDIR), + root); + + ritem->setText(0, i18n("Folders")); + ritem->setExpandable(true); + ritem->setURL(dir->root()); + delete root->root(); + root->setRoot(ritem); + + addBranch(root); + + disconnect(root, SIGNAL(refreshItems(const KFileItemList &)), 0, 0); + + header()->hide(); + addColumn(i18n("File")); + setDirOnlyMode(root, false); + setCurrentItem(root->root()); + root->setOpen(true); + setRootIsDecorated(false); + + menu->reconnect(SQ_TreeViewMenu::New, this, SLOT(slotNewDirectory())); + + connect(this, SIGNAL(spacePressed(QListViewItem*)), this, SIGNAL(executed(QListViewItem*))); + connect(this, SIGNAL(returnPressed(QListViewItem*)), this, SIGNAL(executed(QListViewItem*))); + connect(this, SIGNAL(executed(QListViewItem*)), this, SLOT(slotItemExecuted(QListViewItem*))); + connect(this, SIGNAL(contextMenu(KListView*, QListViewItem*, const QPoint&)), this, SLOT(slotContextMenu(KListView*, QListViewItem*, const QPoint&))); + connect(this, SIGNAL(dropped(QDropEvent*, QListViewItem*, QListViewItem*)), this, SLOT(slotDropped(QDropEvent*, QListViewItem*, QListViewItem*))); + connect(this, SIGNAL(itemRenamed(QListViewItem *, int, const QString &)), this, SLOT(slotItemRenamedMy(QListViewItem *, int, const QString &))); + connect(this, SIGNAL(itemAdded(QListViewItem *)), this, SLOT(slotSort())); + connect(this, SIGNAL(moved()), this, SLOT(slotReindex())); +} + +SQ_DirectoryBasket::~SQ_DirectoryBasket() +{ + SQ_DirectoryItem *item = static_cast(root->root()->firstChild()); + + static const QString &nl = KGlobal::staticQString("\n"); + + if(item) + { + QString url; + int index = 0; + + do + { + url = item->url().prettyURL() + nl + item->name() + nl + item->icon() + nl + QString::number(index); + + SQ_StorageFile::writeStorageFileAsString( + dir->root() + QDir::separator() + item->url().fileName(), + item->url(), url); + + ++index; + } + while((item = static_cast(item->nextSibling()))); + } + + delete dir; + delete progressAdd; +} + +void SQ_DirectoryBasket::slotNewDirectory() +{ + static const QString &nl = KGlobal::staticQString("\n"); + + KURL url = KFileDialog::getExistingURL(QString::null, KSquirrel::app()); + + if(url.isEmpty()) + return; + + SQ_StorageFile::writeStorageFileAsString( + dir->root() + QDir::separator() + url.fileName(), + url, + (url.prettyURL() + nl + nl + nl + QString::number(root->root()->childCount()))); +} + +void SQ_DirectoryBasket::slotDropped(QDropEvent *e, QListViewItem *_parent, QListViewItem *_item) +{ + if(!_parent) return; + if(!_item) _item = _parent; + + SQ_DirectoryItem *item = static_cast(_item); + SQ_DirectoryItem *parent = static_cast(_parent); + + KURL::List list; + KURLDrag::decode(e, list); + + // drag'n'drop inside basket + if(e->source() == this) + { + SQ_DirectoryItem *tomove = static_cast(root->findTVIByURL(list.first())); + + if(!tomove || tomove == root->root()) return; + + SQ_DirectoryItem *it; + + if(item->index() < tomove->index() && item != root->root()) + it = static_cast(item->itemAbove()); + else + it = static_cast(item); + + if(it) + { + if(it != root->root()) + moveItem(tomove, parent, it); + else + moveItem(tomove, parent, 0); + + emit moved(); + + setCurrentItem(tomove); + setSelected(tomove, true); + } + } + else if(item == root->root()) // some files were dropped from another source + { + KURL::List::iterator itEnd = list.end(); + KFileItemList flist; + KIO::UDSEntry entry; + + progressAdd->setTotalSteps(list.count()); + timerAdd->start(1000, true); + + for(KURL::List::iterator it = list.begin();it != itEnd;++it) + { + if(KIO::NetAccess::stat(*it, entry, KSquirrel::app())) + flist.append(new KFileItem(entry, *it)); + + progressAdd->advance(1); + } + + timerAdd->stop(); + progressAdd->hide(); + + add(flist); + flist.setAutoDelete(true); + } + else + { + SQ_NavigatorDropMenu::instance()->setupFiles(list, item->url()); + SQ_NavigatorDropMenu::instance()->exec(QCursor::pos(), true); + } +} + +void SQ_DirectoryBasket::slotItemExecuted(QListViewItem *item) +{ + if(!item) return; + + if(item == root->root()) + { + root->setOpen(true); + return; + } + + KFileTreeViewItem *cur = static_cast(item); + + if(cur && !cur->isDir()) + { + KURL inpath = SQ_StorageFile::readStorageFile(cur->path()); + SQ_WidgetStack::instance()->diroperator()->setURL(inpath, true); + } +} + +void SQ_DirectoryBasket::slotContextMenu(KListView *, QListViewItem *item, const QPoint &p) +{ + if(item) + { + SQ_DirectoryItem *kfi = static_cast(item); + + if(kfi) + { + menu->updateDirActions(true, item == root->root()); + menu->setURL(kfi->url()); + menu->setItem(kfi); + menu->exec(p); + } + } +} + +void SQ_DirectoryBasket::add(const KFileItemList &list) +{ + static const QString &nl = KGlobal::staticQString("\n"); + + KFileItemListIterator it(list); + KFileItem *fi; + QString url; + + while((fi = it.current())) + { + if(fi->isDir()) + { + url = fi->url().prettyURL() + nl + nl + nl + QString::number(root->root()->childCount()); + + SQ_StorageFile::writeStorageFileAsString( + dir->root() + QDir::separator() + fi->url().fileName(), + fi->url(), + url); + } + + ++it; + } +} + +void SQ_DirectoryBasket::slotSort() +{ + timer->start(100, true); +} + +void SQ_DirectoryBasket::slotSortReal() +{ + sort(); +} + +struct SortableItem +{ + SortableItem(QListViewItem *i, int ind) : item(i), index(ind) + {} + + SortableItem() : item(0), index(0) + {} + + bool operator< (const SortableItem &i) + { + return index > i.index; + } + + QListViewItem *item; + int index; +}; + +void SQ_DirectoryBasket::sort() +{ + QListViewItemIterator it(this); + SQ_DirectoryItem *item; + + QValueVector items; + int i = 0; + ++it; + + while((item = static_cast(it.current()))) + { + items.append(SortableItem(item, item->index())); + ++it; + } + + const int nChildren = items.count(); + + for(i = 0;i < nChildren;i++) + root->root()->takeItem(items[i].item); + + qHeapSort(items); + + blockSignals(true); + for(i = 0;i < nChildren;i++) + root->root()->insertItem(items[i].item); + blockSignals(false); +} + +void SQ_DirectoryBasket::slotReindex() +{ + SQ_DirectoryItem *item = static_cast(root->root()->firstChild()); + + if(item) + { + int index = 0; + + do + { + item->setIndex(index++); + } + while((item = static_cast(item->nextSibling()))); + } +} + +void SQ_DirectoryBasket::slotItemRenamedMy(QListViewItem *_item, int, const QString &name) +{ + SQ_DirectoryItem *item = static_cast(_item); + + if(item) + item->setName(name); +} + +void SQ_DirectoryBasket::slotDelayedShowAdd() +{ + int w = 200, h = 32; + + QRect rc = KGlobalSettings::splashScreenDesktopGeometry(); + + progressAdd->setGeometry(rc.center().x() - w/2, rc.center().y() - h/2, w, h); + progressAdd->show(); +} + +#include "sq_directorybasket.moc" diff --git a/ksquirrel/sidebar/sq_directorybasket.h b/ksquirrel/sidebar/sq_directorybasket.h new file mode 100644 index 0000000..eaf2fce --- /dev/null +++ b/ksquirrel/sidebar/sq_directorybasket.h @@ -0,0 +1,193 @@ +/*************************************************************************** + sq_directorybasket.h - description + ------------------- + begin : ??? Sep 29 2007 + copyright : (C) 2007 by Baryshev Dmitry + email : ksquirrel.iv@gmail.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifndef SQ_DIRECTORYBASKET_H +#define SQ_DIRECTORYBASKET_H + +#include +#include + +#include "sq_treeviewmenu.h" + +class QTimer; + +class KProgress; + +namespace KIO { class Job; } + +class SQ_DirectoryItem; +class SQ_Dir; + +class SQ_DBMenu : public SQ_TreeViewMenu +{ + Q_OBJECT + + public: + SQ_DBMenu(QWidget *parent = 0, const char *name = 0); + ~SQ_DBMenu(); + + virtual void updateDirActions(bool, bool isroot = false); + + void setItem(SQ_DirectoryItem *); + + private slots: + void slotChangeIcon(); + void slotDirectoryRename(); + void slotDirectoryDelete(); + void slotDirectoryResult(KIO::Job *job); + + private: + SQ_DirectoryItem *item; + int id_icon; +}; + +inline +void SQ_DBMenu::setItem(SQ_DirectoryItem *i) +{ + item = i; +} + +class SQ_DirectoryItem : public KFileTreeViewItem +{ + public: + SQ_DirectoryItem(KFileTreeViewItem *parentItem, KFileItem *fileItem, KFileTreeBranch *parentBranch); + SQ_DirectoryItem(KFileTreeView *parent, KFileItem *fileItem, KFileTreeBranch *parentBranch); + ~SQ_DirectoryItem(); + + int index() const; + void setIndex(int ind); + + KURL url() const; + void setURL(const KURL &u); + + QString name() const; + void setName(const QString &n); + + QString icon() const; + void setIcon(const QString &n); + + bool hasName() const; + + private: + int m_index; + QString m_name, m_icon; + KURL m_url; +}; + +inline +KURL SQ_DirectoryItem::url() const +{ + return m_url; +} + +inline +void SQ_DirectoryItem::setURL(const KURL &u) +{ + m_url = u; +} + +inline +int SQ_DirectoryItem::index() const +{ + return m_index; +} + +inline +void SQ_DirectoryItem::setIndex(int ind) +{ + m_index = ind; +} + +inline +QString SQ_DirectoryItem::name() const +{ + return m_name; +} + +inline +void SQ_DirectoryItem::setName(const QString &n) +{ + m_name = n; +} + +inline +QString SQ_DirectoryItem::icon() const +{ + return m_icon; +} + +inline +void SQ_DirectoryItem::setIcon(const QString &n) +{ + m_icon = n; +} + +inline +bool SQ_DirectoryItem::hasName() const +{ + return !m_name.isEmpty(); +} + +/* ****************************************************************** */ + +class SQ_DirectoryBasketBranch : public KFileTreeBranch +{ + public: + SQ_DirectoryBasketBranch(KFileTreeView*, const KURL &url, const QString &name, const QPixmap &pix); + ~SQ_DirectoryBasketBranch(); + + protected: + virtual KFileTreeViewItem *createTreeViewItem(KFileTreeViewItem *parent, KFileItem *fileItem); +}; + +class SQ_DirectoryBasket : public KFileTreeView +{ + Q_OBJECT + + public: + SQ_DirectoryBasket(QWidget *parent = 0, const char *name = 0); + ~SQ_DirectoryBasket(); + + void add(const KFileItemList &list); + + static SQ_DirectoryBasket* instance() { return m_inst; } + + private: + void sort(); + + private slots: + void slotDropped(QDropEvent *, QListViewItem *, QListViewItem *); + void slotItemExecuted(QListViewItem *item); + void slotContextMenu(KListView *, QListViewItem *item, const QPoint &p); + void slotNewDirectory(); + void slotSortReal(); + void slotSort(); + void slotReindex(); + void slotItemRenamedMy(QListViewItem *, int, const QString &); + void slotDelayedShowAdd(); + + private: + KFileTreeBranch *root; + SQ_Dir *dir; + QTimer *timer, *timerAdd; + SQ_DBMenu *menu; + KProgress *progressAdd; + + static SQ_DirectoryBasket *m_inst; +}; + +#endif diff --git a/ksquirrel/sidebar/sq_imagebasket.cpp b/ksquirrel/sidebar/sq_imagebasket.cpp new file mode 100644 index 0000000..9d4e6de --- /dev/null +++ b/ksquirrel/sidebar/sq_imagebasket.cpp @@ -0,0 +1,291 @@ +/*************************************************************************** + sq_imagebasket.cpp - description + ------------------- + begin : ??? Feb 24 2007 + copyright : (C) 2004 by Baryshev Dmitry + email : ksquirrel.iv@gmail.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "ksquirrel.h" +#include "sq_config.h" +#include "sq_imagebasket.h" +#include "sq_storagefile.h" +#include "sq_dir.h" +#include "sq_widgetstack.h" +#include "sq_diroperator.h" + +SQ_ImageBasket * SQ_ImageBasket::m_inst; + +SQ_ImageBasket::SQ_ImageBasket(QWidget *parent, const char *name) : KDirOperator((dir = new SQ_Dir(SQ_Dir::Basket))->root(), parent, name) +{ + m_inst = this; + + connect(this, SIGNAL(dropped(const KFileItem *, QDropEvent*, const KURL::List&)), + this, SLOT(slotDropped(const KFileItem *, QDropEvent*, const KURL::List&))); + + disconnect(dirLister(), SIGNAL(refreshItems(const KFileItemList &)), 0, 0); + + // redirect "Properties" dialog + disconnect(actionCollection()->action("properties"), 0, 0, 0); + connect(actionCollection()->action("properties"), SIGNAL(activated()), this, SLOT(slotBasketProperties())); + + disconnect(dirLister(), SIGNAL(newItems(const KFileItemList &)), 0, 0); + connect(dirLister(), SIGNAL(newItems(const KFileItemList &)), this, SLOT(insertNewFiles(const KFileItemList &))); + + connect(this, SIGNAL(viewChanged(KFileView *)), this, SLOT(slotViewChanged(KFileView *))); + connect(this, SIGNAL(fileSelected(const KFileItem *)), this, SLOT(slotExecuted(const KFileItem *))); + + setView(KFile::Simple); + setMode(KFile::Files); + + setAcceptDrops(true); + + SQ_Config::instance()->setGroup("Fileview"); + int sorting = 0; + + if(SQ_Config::instance()->readBoolEntry("basket_sorting_name", true)) sorting |= QDir::Name; + if(SQ_Config::instance()->readBoolEntry("basket_sorting_time", false)) sorting |= QDir::Time; + if(SQ_Config::instance()->readBoolEntry("basket_sorting_size", false)) sorting |= QDir::Size; + if(SQ_Config::instance()->readBoolEntry("basket_sorting_dirs", true)) sorting |= QDir::DirsFirst; + if(SQ_Config::instance()->readBoolEntry("basket_sorting_reverse", false)) sorting |= QDir::Reversed; + if(SQ_Config::instance()->readBoolEntry("basket_sorting_ignore", false)) sorting |= QDir::IgnoreCase; + + setSorting(static_cast(sorting)); +} + +SQ_ImageBasket::~SQ_ImageBasket() +{ + delete dir; +} + +void SQ_ImageBasket::insertNewFiles(const KFileItemList &list) +{ + QString n; + int ind; + KFileItemListIterator it(list); + KFileItem *tmp; + + for(; (tmp = it.current()); ++it) + { + n = tmp->name(); + ind = n.findRev('.'); + + // OOPS + if(ind != -1) + n.truncate(ind); + + // force determining mimetype + (void)tmp->mimetype(); + tmp->setName(n); + + QStringList list = QStringList::split(QChar('\n'), SQ_StorageFile::readStorageFileAsString(tmp->url().path()), true); + QStringList::iterator it = list.begin(); + + if(list.count() > 1) + { + ++it; // skip url + tmp->setMimeType(*it); + } + else + { + KURL url = KURL::fromPathOrURL(*it); + QString mime = KMimeType::findByURL(url)->name(); + tmp->setMimeType(mime); + + static const QString &nl = KGlobal::staticQString("\n"); + + QString inurl = url.prettyURL() + nl + mime; + + SQ_StorageFile::writeStorageFileAsString( + dir->root() + QDir::separator() + url.fileName(), + url, inurl); + } + } + + view()->addItemList(list); +} + +void SQ_ImageBasket::add(const KFileItemList &list) +{ + KFileItem *tmp; + static const QString &nl = KGlobal::staticQString("\n"); + + for(KFileItemListIterator it(list); (tmp = it.current()); ++it) + { + if(tmp->isFile()) + { + QString inurl = tmp->url().prettyURL() + nl + tmp->mimetype(); + + SQ_StorageFile::writeStorageFileAsString( + dir->root() + QDir::separator() + tmp->name(), + tmp->url(), inurl); + } + } +} + +void SQ_ImageBasket::slotDropped(const KFileItem *, QDropEvent*, const KURL::List &list) +{ + QString name; + KURL::List::const_iterator itEnd = list.end(); + static const QString &nl = KGlobal::staticQString("\n"); + + for(KURL::List::const_iterator it = list.begin();it != itEnd;++it) + { + QString inurl = (*it).prettyURL() + nl + KMimeType::findByURL(*it)->name(); + + SQ_StorageFile::writeStorageFileAsString( + dir->root() + QDir::separator() + (*it).fileName(), + *it, inurl); + } +} + +void SQ_ImageBasket::slotBasketProperties() +{ + KFileView *fileView = view(); + + if(fileView) + { + KFileItemList newlist; + KFileItem *item = 0; + + newlist.setAutoDelete(true); + + for((item = fileView->firstFileItem()); item; item = fileView->nextItem(item)) + { + if(fileView->isSelected(item)) + { + KFileItem *realFile = new KFileItem(KFileItem::Unknown, KFileItem::Unknown, + SQ_StorageFile::readStorageFile(item->url().path())); + + newlist.append(realFile); + } + } + + if (!newlist.isEmpty()) + (void)new KPropertiesDialog(newlist, KSquirrel::app(), "props dlg", true); + } +} + +KFileItemList SQ_ImageBasket::realItems() const +{ + KFileView *fileView = view(); + KFileItemList newlist; + + newlist.setAutoDelete(true); + + if(fileView) + { + KFileItem *item = 0; + + for((item = fileView->firstFileItem()); item; item = fileView->nextItem(item)) + { + KFileItem *realFile = new KFileItem(KFileItem::Unknown, KFileItem::Unknown, + SQ_StorageFile::readStorageFile(item->url().path())); + + newlist.append(realFile); + } + } + + return newlist; +} + +void SQ_ImageBasket::slotSync() +{ + KFileView *fileView = view(); + + if(fileView) + { + KFileItem *item = 0; + KURL path; + KIO::UDSEntry entry; + + for((item = fileView->firstFileItem()); item; item = fileView->nextItem(item)) + { + path = SQ_StorageFile::readStorageFile(item->url().path()); + + if(!KIO::NetAccess::stat(path, entry, KSquirrel::app())) + QFile::remove(item->url().path()); + } + } +} + +void SQ_ImageBasket::slotViewChanged(KFileView *v) +{ + KFileIconView *iv = dynamic_cast(v); + + if(iv) + { + KAction *a; + + a = iv->actionCollection()->action("zoomIn"); + if(a) a->setShortcut(0); + + a = iv->actionCollection()->action("zoomOut"); + if(a) a->setShortcut(0); + + a = iv->actionCollection()->action("show previews"); + if(a) a->setShortcut(0); + } +} + +void SQ_ImageBasket::slotExecuted(const KFileItem *fi) +{ + if(!fi) + return; + + KURL inpath = SQ_StorageFile::readStorageFile(fi->url().path()); + + KFileItem f(KFileItem::Unknown, KFileItem::Unknown, inpath); + + SQ_WidgetStack::instance()->diroperator()->execute(&f); +} + +void SQ_ImageBasket::activatedMenu(const KFileItem *, const QPoint &pos) +{ + setupMenu(KDirOperator::AllActions ^ KDirOperator::NavActions ^ KDirOperator::ViewActions); + updateSelectionDependentActions(); + + KActionMenu *pADirOperatorMenu = dynamic_cast(actionCollection()->action("popupMenu")); + pADirOperatorMenu->popupMenu()->insertItem(i18n("Synchronize"), this, SLOT(slotSync()), 0, -1, 0); + pADirOperatorMenu->popupMenu()->insertSeparator(1); + + pADirOperatorMenu->popup(pos); +} + +void SQ_ImageBasket::saveConfig() +{ + QDir::SortSpec sort = sorting(); + + SQ_Config::instance()->writeEntry("basket_sorting_name", KFile::isSortByName(sort)); + SQ_Config::instance()->writeEntry("basket_sorting_time", KFile::isSortByDate(sort)); + SQ_Config::instance()->writeEntry("basket_sorting_size", KFile::isSortBySize(sort)); + SQ_Config::instance()->writeEntry("basket_sorting_dirs", KFile::isSortDirsFirst(sort)); + SQ_Config::instance()->writeEntry("basket_sorting_reverse", (sort & QDir::Reversed) == QDir::Reversed); + SQ_Config::instance()->writeEntry("basket_sorting_ignore", KFile::isSortCaseInsensitive(sort)); + + SQ_Config::instance()->writeEntry("show hidden", showHiddenFiles()); +} + +#include "sq_imagebasket.moc" diff --git a/ksquirrel/sidebar/sq_imagebasket.h b/ksquirrel/sidebar/sq_imagebasket.h new file mode 100644 index 0000000..885c711 --- /dev/null +++ b/ksquirrel/sidebar/sq_imagebasket.h @@ -0,0 +1,61 @@ +/*************************************************************************** + sq_imagebasket.h - description + ------------------- + begin : ??? Feb 24 2007 + copyright : (C) 2007 by Baryshev Dmitry + email : ksquirrel.iv@gmail.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifndef SQ_IMAGEBASKET_H +#define SQ_IMAGEBASKET_H + +#include + +class SQ_Dir; + +/** + *@author Baryshev Dmitry + */ + +class SQ_ImageBasket : public KDirOperator +{ + Q_OBJECT + + public: + SQ_ImageBasket(QWidget *parent = 0, const char *name = 0); + ~SQ_ImageBasket(); + + void add(const KFileItemList &); + + KFileItemList realItems() const; + + void saveConfig(); + + static SQ_ImageBasket* instance() { return m_inst; } + + private slots: + // coming from KDirOperator + void insertNewFiles(const KFileItemList &); + void slotDropped(const KFileItem *, QDropEvent*, const KURL::List&); + void slotBasketProperties(); + void slotSync(); + void slotViewChanged(KFileView *); + void slotExecuted(const KFileItem *fi); + + void activatedMenu(const KFileItem *, const QPoint &pos); + + private: + SQ_Dir *dir; + static SQ_ImageBasket *m_inst; +}; + +#endif diff --git a/ksquirrel/sidebar/sq_mountview.cpp b/ksquirrel/sidebar/sq_mountview.cpp new file mode 100644 index 0000000..be04839 --- /dev/null +++ b/ksquirrel/sidebar/sq_mountview.cpp @@ -0,0 +1,247 @@ +/*************************************************************************** + sq_mountview.cpp - description + ------------------- + begin : ??? Nov 29 2005 + copyright : (C) 2005 by Baryshev Dmitry + email : ksquirrel.iv@gmail.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include +#include +#include +#include +#include +#include + +#include "ksquirrel.h" +#include "sq_mountview.h" +#include "sq_mountviewitem.h" +#include "sq_iconloader.h" +#include "sq_config.h" + +SQ_MountView * SQ_MountView::m_inst = 0; + +SQ_MountView::SQ_MountView(QWidget *parent, const char *name) : KListView(parent, name), m_columns(-1) +{ + m_inst = this; + + popup = new KPopupMenu; + id_mount = popup->insertItem(SQ_IconLoader::instance()->loadIcon("hdd_mount", KIcon::Desktop, KIcon::SizeSmall), + i18n("Mount"), this, SLOT(slotMount())); + id_unmount = popup->insertItem(SQ_IconLoader::instance()->loadIcon("hdd_unmount", KIcon::Desktop, KIcon::SizeSmall), + i18n("Unmount"), this, SLOT(slotUnmount())); + popup->insertItem(SQ_IconLoader::instance()->loadIcon("reload", KIcon::Desktop, KIcon::SizeSmall), + i18n("Refresh"), this, SLOT(slotRefresh())); + popup->insertSeparator(); + popup->insertItem(i18n("Cancel")); + + connect(this, SIGNAL(contextMenu(KListView *, QListViewItem *, const QPoint &)), + this, SLOT(slotContextMenu(KListView *, QListViewItem *, const QPoint &))); + setAcceptDrops(false); + + connect(this, SIGNAL(returnPressed(QListViewItem*)), this, SLOT(slotExecuted(QListViewItem *))); + connect(this, SIGNAL(clicked(QListViewItem*)), this, SLOT(slotExecuted(QListViewItem *))); + + setShowSortIndicator(true); + setAllColumnsShowFocus(true); + setSelectionMode(QListView::Single); + setItemsMovable(false); + + // "Name" column will always exist + addColumn(i18n("Name")); + + setupColumns(); +} + +SQ_MountView::~SQ_MountView() +{} + +void SQ_MountView::slotExecuted(QListViewItem *i) +{ + SQ_MountViewItem *mvi = static_cast(i); + + if(!mvi) + return; + + if(mvi->mounted()) + emit path(mvi->text(0)); + else + { + mountItem = mvi; + KAutoMount *mounter = new KAutoMount(false, QString::null, mvi->device(), QString::null, QString::null, false); + connect(mounter, SIGNAL(finished()), this, SLOT(slotMountFinished())); + } +} + +void SQ_MountView::slotMountFinished() +{ + mountItem->setMounted(true); + emit path(mountItem->text(0)); +} + +void SQ_MountView::slotMountError() +{ + mountItem->setMounted(false); +} + +void SQ_MountView::reload(bool current) +{ + // get currently mounted filesystems + KMountPoint::List mt = current ? + KMountPoint::currentMountPoints(KMountPoint::NeedMountOptions | KMountPoint::NeedRealDeviceName) + : KMountPoint::possibleMountPoints(KMountPoint::NeedMountOptions | KMountPoint::NeedRealDeviceName); + + SQ_MountViewItem *fi; + int colum; + + for(KMountPoint::List::iterator it = mt.begin();it != mt.end();++it) + { + colum = 1; + + if(mounted.find((*it)->mountPoint()) == mounted.end()) + { + mounted.append((*it)->mountPoint()); + + // filter out /proc, swap etc. + if(!(*it)->mountedFrom().startsWith(QChar('/')) || !(*it)->mountPoint().startsWith(QChar('/'))) + continue; + + fi = new SQ_MountViewItem(this, (*it)->mountPoint()); + fi->setMounted(current); + fi->setDevice((*it)->realDeviceName()); + + if(m_columns & OPT_COL_DEVICE) + fi->setText(colum++, (*it)->realDeviceName()); + + if(m_columns & OPT_COL_FSTYPE) + fi->setText(colum++, (*it)->mountType()); + + if(m_columns & OPT_COL_OPTIONS) + fi->setText(colum, (*it)->mountOptions().join(QString::fromLatin1(", "))); + } + } +} + +bool SQ_MountView::exists(const QString &name) +{ + QListViewItemIterator it(this); + + while(it.current()) + { + SQ_MountViewItem *mvi = static_cast(it.current()); + + if(mvi && mvi->text(0) == name) + return true; + + ++it; + } + + return false; +} + +void SQ_MountView::setColumns(int cols) +{ + if(m_columns == cols) + return; + + m_columns = cols; + + int cur = columns() - 1; + + // remove old columns, 0 is always "Name" + for(int i = 0;i < cur;i++) + removeColumn(1); + + // add new + if(m_columns & OPT_COL_DEVICE) + addColumn(i18n("Device")); + + if(m_columns & OPT_COL_FSTYPE) + addColumn(i18n("FS Type")); + + if(m_columns & OPT_COL_OPTIONS) + addColumn(i18n("Options")); + + slotRefresh(); +} + +void SQ_MountView::setupColumns() +{ + SQ_Config::instance()->setGroup("Sidebar"); + int p = 0; + + if(SQ_Config::instance()->readBoolEntry("mount_options", false)) + p |= SQ_MountView::OPT_COL_OPTIONS; + + if(SQ_Config::instance()->readBoolEntry("mount_fstype", true)) + p |= SQ_MountView::OPT_COL_FSTYPE; + + if(SQ_Config::instance()->readBoolEntry("mount_device", false)) + p |= SQ_MountView::OPT_COL_DEVICE; + + setColumns(p); +} + +void SQ_MountView::slotContextMenu(KListView *, QListViewItem *i, const QPoint &p) +{ + SQ_MountViewItem *mvi = static_cast(i); + + citem = mvi; + + popup->setItemEnabled(id_mount, !!mvi); + popup->setItemEnabled(id_unmount, !!mvi); + + popup->exec(p); +} + +void SQ_MountView::slotUnmount() +{ + if(citem) + { + KAutoUnmount *mounter = new KAutoUnmount(citem->text(0), QString::null); + connect(mounter, SIGNAL(finished()), this, SLOT(slotUnmountFinished())); + } +} + +void SQ_MountView::slotMount() +{ + if(citem) + { + KAutoMount *mounter = new KAutoMount(false, QString::null, citem->device(), QString::null, QString::null, false); + connect(mounter, SIGNAL(finished()), this, SLOT(slotMountFinished2())); +// connect(mounter, SIGNAL(error()), this, SLOT(slotMountError())); + } +} + +void SQ_MountView::slotUnmountFinished() +{ + citem->setMounted(false); +} + +void SQ_MountView::slotMountFinished2() +{ + citem->setMounted(true); +} + +void SQ_MountView::slotRefresh() +{ + clear(); + mounted.clear(); + reload(); + reload(false); +} + +#include "sq_mountview.moc" diff --git a/ksquirrel/sidebar/sq_mountview.h b/ksquirrel/sidebar/sq_mountview.h new file mode 100644 index 0000000..689ac7d --- /dev/null +++ b/ksquirrel/sidebar/sq_mountview.h @@ -0,0 +1,83 @@ +/*************************************************************************** + sq_mountview.h - description + ------------------- + begin : ??? Nov 29 2005 + copyright : (C) 2005 by Baryshev Dmitry + email : ksquirrel.iv@gmail.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifndef SQ_MOUNTVIEW_H +#define SQ_MOUNTVIEW_H + +#include + +#include + +class KPopupMenu; + +class SQ_MountViewItem; + +/* + * SQ_MountView is an detailed view representing mount points. + */ + +class SQ_MountView : public KListView +{ + Q_OBJECT + + public: + SQ_MountView(QWidget *parent = 0, const char *name = 0); + ~SQ_MountView(); + + enum { OPT_COL_MOUNTPOINT = 1, OPT_COL_DEVICE = 2, OPT_COL_FSTYPE = 4, OPT_COL_OPTIONS = 8 }; + + static SQ_MountView* instance() { return m_inst; } + + void setupColumns(); + + void reload(bool current = true); + + private: + void setColumns(int cols); + bool exists(const QString &); + + private slots: + + void slotContextMenu(KListView *, QListViewItem *i, const QPoint &p); + /* + * Item executed. We should emit path() signal. + */ + void slotExecuted(QListViewItem *i); + + // for context menu + void slotRefresh(); + void slotMount(); + void slotUnmount(); + void slotUnmountFinished(); + void slotMountFinished(); + void slotMountFinished2(); + void slotMountError(); + + signals: + void path(const QString &); + + private: + int m_columns; + SQ_MountViewItem *mountItem, *citem; + QStringList mounted; + KPopupMenu *popup; + int id_mount, id_unmount; + + static SQ_MountView *m_inst; +}; + +#endif diff --git a/ksquirrel/sidebar/sq_mountviewitem.cpp b/ksquirrel/sidebar/sq_mountviewitem.cpp new file mode 100644 index 0000000..30b501d --- /dev/null +++ b/ksquirrel/sidebar/sq_mountviewitem.cpp @@ -0,0 +1,44 @@ +/*************************************************************************** + sq_mountviewitem.cpp - description + ------------------- + begin : ??? Feb 24 2007 + copyright : (C) 2007 by Baryshev Dmitry + email : ksquirrel.iv@gmail.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include + +#include "sq_mountviewitem.h" +#include "sq_iconloader.h" + +SQ_MountViewItem::SQ_MountViewItem(KListView *parent, const QString &mpoint) + : KListViewItem(parent, mpoint), m_mounted(false) +{} + +SQ_MountViewItem::~SQ_MountViewItem() +{} + +void SQ_MountViewItem::setMounted(bool b) +{ + m_mounted = b; + QFileInfo inf(text(0)); + + if(m_mounted) + setPixmap(0, inf.isReadable() ? SQ_IconLoader::instance()->loadIcon("folder", KIcon::Desktop, KIcon::SizeMedium) + : SQ_IconLoader::instance()->loadIcon("folder_locked", KIcon::Desktop, KIcon::SizeMedium)); + else + setPixmap(0, SQ_IconLoader::instance()->loadIcon("folder_red", KIcon::Desktop, KIcon::SizeMedium)); +} diff --git a/ksquirrel/sidebar/sq_mountviewitem.h b/ksquirrel/sidebar/sq_mountviewitem.h new file mode 100644 index 0000000..10b625f --- /dev/null +++ b/ksquirrel/sidebar/sq_mountviewitem.h @@ -0,0 +1,58 @@ +/*************************************************************************** + sq_mountviewitem.h - description + ------------------- + begin : ??? Feb 24 2007 + copyright : (C) 2007 by Baryshev Dmitry + email : ksquirrel.iv@gmail.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifndef SQ_MOUNTVIEWITEM_H +#define SQ_MOUNTVIEWITEM_H + +#include + +class SQ_MountViewItem : public KListViewItem +{ + public: + SQ_MountViewItem(KListView *parent, const QString &mpoint); + ~SQ_MountViewItem(); + + bool mounted() const; + void setMounted(bool b); + + QString device() const; + void setDevice(const QString &dev); + + private: + bool m_mounted; + QString m_device; +}; + +inline +bool SQ_MountViewItem::mounted() const +{ + return m_mounted; +} + +inline +QString SQ_MountViewItem::device() const +{ + return m_device; +} + +inline +void SQ_MountViewItem::setDevice(const QString &dev) +{ + m_device = dev; +} + +#endif diff --git a/ksquirrel/sidebar/sq_multibar.cpp b/ksquirrel/sidebar/sq_multibar.cpp new file mode 100644 index 0000000..2074399 --- /dev/null +++ b/ksquirrel/sidebar/sq_multibar.cpp @@ -0,0 +1,133 @@ +/*************************************************************************** + sq_multibar.cpp - description + ------------------- + begin : ??? Nov 28 2005 + copyright : (C) 2005 by Baryshev Dmitry + email : ksquirrel.iv@gmail.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include +#include +#include + +#include +#include +#include + +#include "ksquirrel.h" +#include "sq_previewwidget.h" +#include "sq_multibar.h" +#include "sq_config.h" + +SQ_MultiBar * SQ_MultiBar::m_inst = 0; + +SQ_MultiBar::SQ_MultiBar(QWidget *parent, const char *name) : QHBox(parent, name) +{ + m_inst = this; + m_id = 0; + m_selected = -1; + + SQ_Config::instance()->setGroup("Interface"); + m_width = SQ_Config::instance()->readNumEntry("splitter", 220); + + mapper = new QSignalMapper(this); + + connect(mapper, SIGNAL(mapped(int)), this, SLOT(raiseWidget(int))); + + mt = new KMultiTabBar(KMultiTabBar::Vertical, this); + + // setup multibar: style = VSNET, show text labels on the left side + mt->setStyle(KMultiTabBar::VSNET); + mt->setPosition(KMultiTabBar::Left); + mt->showActiveTabTexts(true); + + setSpacing(0); + + QSplitter *ts = new QSplitter(Qt::Vertical, this); + ts->setOpaqueResize(false); + + // QWigdetStack will contain all widgets + stack = new QWidgetStack(ts); + + new SQ_PreviewWidget(ts); + + QValueList sz; + sz.append(5500); + sz.append(4500); + ts->setSizes(sz); +} + +SQ_MultiBar::~SQ_MultiBar() +{} + +void SQ_MultiBar::addWidget(QWidget *new_w, const QString &text, const QString &icon) +{ + // add widget to stack + stack->addWidget(new_w, m_id); + + // add button + mt->appendTab(KGlobal::iconLoader()->loadIcon(icon, KIcon::Desktop, 22), m_id, text); + + // since we cann't determine which tab was clicked, + // we should use QSignalMapper to determine it. + mapper->setMapping(mt->tab(m_id), m_id); + + connect(mt->tab(m_id), SIGNAL(clicked()), mapper, SLOT(map())); + + m_id++; +} + +void SQ_MultiBar::raiseWidget(int id) +{ + if(m_selected != -1) + mt->setTab(m_selected, false); + + if(mt->isTabRaised(id)) + { + if(m_selected != -1) + m_width = stack->width(); + + m_selected = id; + + setMinimumSize(QSize(0, 0)); + setMaximumSize(QSize(10000, 10000)); + stack->raiseWidget(id); + stack->resize(m_width, stack->height()); + stack->show(); + + SQ_PreviewWidget::instance()->ignore(false); + SQ_PreviewWidget::instance()->loadPending(); + } + else + { + SQ_PreviewWidget::instance()->ignore(true); + + KSquirrel::app()->saveLayout(); + + m_selected = -1; + m_width = stack->width(); + stack->hide(); + setFixedWidth(mt->width()); + } +} + +void SQ_MultiBar::updateLayout() +{ + setFixedWidth(mt->sizeHint().width()); + stack->hide(); +} + +#include "sq_multibar.moc" diff --git a/ksquirrel/sidebar/sq_multibar.h b/ksquirrel/sidebar/sq_multibar.h new file mode 100644 index 0000000..a93c8fa --- /dev/null +++ b/ksquirrel/sidebar/sq_multibar.h @@ -0,0 +1,110 @@ +/*************************************************************************** + sq_multibar.h - description + ------------------- + begin : ??? Nov 28 2005 + copyright : (C) 2005 by Baryshev Dmitry + email : ksquirrel.iv@gmail.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifndef SQ_MULTIBAR_H +#define SQ_MULTIBAR_H + +#include + +class KMultiTabBar; + +class QWidgetStack; +class QSignalMapper; + +/* + * Konqueror-like sidebar. + * + * +----------------------------------> KMultiTabBar, only contains buttons + * | +-----------------+ + * | | | + * | | | + * +------------------------+ | + * | 1 | | +----> QWidgetStack, contains all widgets + * |---| | + * | 2 | | + * |---| | + * | 3 | | + * |---| | + * | | visible page | + * | | | + * | 4 | N4 | + * | | | + * | | | + * |---| | + * | | | + * | | | + * | | | + * | | | + * +------------------------+ + * + */ + +class SQ_MultiBar : public QHBox +{ + Q_OBJECT + + public: + SQ_MultiBar(QWidget *parent = 0, const char *name = 0); + ~SQ_MultiBar(); + + /* + * Add new widget with text label 'text' and icon 'icon'. SQ_MultiBar + * will use SQ_IconLoader to load given icon. + */ + void addWidget(QWidget *new_w, const QString &text, const QString &icon); + + /* + * Current page index. 0 means first page. + */ + int currentPage(); + + void updateLayout(); + + KMultiTabBar* multiBar() const; + + static SQ_MultiBar* instance() { return m_inst; } + + public slots: + + /* + * Hide current widget and show a widget with + * id 'id'. + */ + void raiseWidget(int id); + + private: + KMultiTabBar *mt; + QWidgetStack *stack; + int m_id, m_selected, m_width; + QSignalMapper *mapper; + + static SQ_MultiBar *m_inst; +}; + +inline +int SQ_MultiBar::currentPage() +{ + return m_selected; +} + +inline +KMultiTabBar* SQ_MultiBar::multiBar() const +{ + return mt; +} + +#endif diff --git a/ksquirrel/sidebar/sq_previewwidget.cpp b/ksquirrel/sidebar/sq_previewwidget.cpp new file mode 100644 index 0000000..8168fce --- /dev/null +++ b/ksquirrel/sidebar/sq_previewwidget.cpp @@ -0,0 +1,364 @@ +/*************************************************************************** + sq_previewwidget.cpp - description + ------------------- + begin : ??? Mar 13 2007 + copyright : (C) 2007 by Baryshev Dmitry + email : ksquirrel.iv@gmail.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include +#include +#include + +#include +#include +#include +#include +#include + +#include + +#include "ksquirrel.h" +#include "sq_previewwidget.h" +#include "sq_iconloader.h" +#include "sq_imageloader.h" +#include "sq_libraryhandler.h" +#include "sq_config.h" +#include "sq_downloader.h" +#include "sq_utils.h" + +#ifdef SQ_HAVE_KEXIF +#include +#include +#include "sq_utils.h" +#endif + +SQ_PreviewWidget * SQ_PreviewWidget::m_inst = 0; + +SQ_PreviewWidget::SQ_PreviewWidget(QWidget *parent, const char *name) + : QWidget(parent, name, Qt::WNoAutoErase), all(0), small(0), m_ignore(true) +{ + m_inst = this; + + rereadColor(); + + down = new SQ_Downloader(this); + connect(down, SIGNAL(result(const KURL &)), this, SLOT(slotDownloadResult(const KURL &))); + connect(down, SIGNAL(percents(int)), this, SLOT(slotDownloadPercents(int))); + + popup = new KPopupMenu; + popup->insertItem(i18n("Background color..."), this, SLOT(slotBackground())); + popup->insertItem(i18n("Text color..."), this, SLOT(slotText())); + popup->insertSeparator(); + popup->insertItem(i18n("Go to first image")+"\tHome", this, SIGNAL(first())); + popup->insertItem(i18n("Next image")+"\tSpace", this, SIGNAL(next())); + popup->insertItem(i18n("Previous image")+"\tBackSpace", this, SIGNAL(previous())); + popup->insertItem(i18n("Go to last image")+"\tEnd", this, SIGNAL(last())); + popup->insertSeparator(); + popup->insertItem(i18n("Execute")+"\tEnter", this, SIGNAL(execute())); + + multi_pix = SQ_IconLoader::instance()->loadIcon("kmultiple", KIcon::Desktop, KIcon::SizeSmall); + + setMinimumHeight(20); + setFocusPolicy(QWidget::WheelFocus); +} + +SQ_PreviewWidget::~SQ_PreviewWidget() +{ + delete popup; + delete small; + delete all; +} + +void SQ_PreviewWidget::load(const KURL &_url) +{ + if(SQ_LibraryHandler::instance()->maybeSupported(_url) == SQ_LibraryHandler::No) + return; + + if(!percentString.isEmpty()) + { + percentString = QString::null; + update(); + } + + down->kill(); + + if(m_forceignore || m_ignore) + { + pending = m_url = _url; + return; + } + else + pending = KURL(); + + m_url = _url; + + if(m_url.isLocalFile()) + slotDownloadResult(m_url); + else + { + KFileItem fi(KFileItem::Unknown, KFileItem::Unknown, m_url); + down->start(&fi); + } +} + +void SQ_PreviewWidget::fitAndConvert() +{ + if(!m_ignore && fit()) + pixmap.convertFromImage(small?*small:*all); +} + +void SQ_PreviewWidget::resizeEvent(QResizeEvent *) +{ + fitAndConvert(); +} + +void SQ_PreviewWidget::paintEvent(QPaintEvent *) +{ + QPainter p(this); + + p.fillRect(rect(), color); + + int x = 4; + + if(!percentString.isEmpty()) + { + QFont fnt = p.font(); + fnt.setBold(true); + p.setFont(fnt); + p.setPen(colorText); + p.drawText(x, 4, width(), height(), Qt::AlignLeft, percentString); + } + + if(!m_ignore && !pixmap.isNull()) + { + p.drawPixmap((width() - pixmap.width()) / 2, (height() - pixmap.height()) / 2, pixmap); + + if(multi) + { + x = x + multi_pix.width() + 4; + p.drawPixmap(4, 4, multi_pix); + } + + if(dim) + { + QFont fnt = p.font(); + fnt.setBold(true); + p.setFont(fnt); + p.setPen(colorText); + p.drawText(x, 4, width(), height(), Qt::AlignLeft, dimstring); + } + } +} + +bool SQ_PreviewWidget::fit() +{ + if(!all) + return false; + + // image is bigger than preview widget - + // scale it down + if(width() < 2 || height() < 2) + return false; + + delete small; + small = 0; + + if(all->width() > width() || all->height() > height()) + { + small = new QImage(); + + *small = SQ_Utils::scale(*all, width(), height(), SQ_Utils::SMOOTH_FAST, QImage::ScaleMin); + } + + return true; +} + +void SQ_PreviewWidget::saveValues() +{ + SQ_Config::instance()->setGroup("Sidebar"); + SQ_Config::instance()->writeEntry("preview_background", color.name()); + SQ_Config::instance()->writeEntry("preview_text", colorText.name()); +} + +void SQ_PreviewWidget::rereadColor() +{ + SQ_Config::instance()->setGroup("Sidebar"); + bool b = SQ_Config::instance()->readBoolEntry("preview", true); + m_forceignore = !b; + setShown(b); + color.setNamedColor(SQ_Config::instance()->readEntry("preview_background", "#4e4e4e")); + dim = SQ_Config::instance()->readBoolEntry("preview_text_enable", true); + colorText.setNamedColor(SQ_Config::instance()->readEntry("preview_text", "#ffffff")); + m_delay = SQ_Config::instance()->readNumEntry("preview_delay", 400); + m_cancel = SQ_Config::instance()->readBoolEntry("preview_dont", true); + + if(m_delay < 50 || m_delay > 2000) + m_delay = 400; +} + + +void SQ_PreviewWidget::slotBackground() +{ + KColorDialog dlg(KSquirrel::app(), 0, true); + + dlg.setColor(color); + + if(dlg.exec() == QDialog::Accepted) + { + color = dlg.color(); + saveValues(); + update(); + } +} + +void SQ_PreviewWidget::slotText() +{ + KColorDialog dlg(KSquirrel::app(), 0, true); + + dlg.setColor(colorText); + + if(dlg.exec() == QDialog::Accepted) + { + colorText = dlg.color(); + saveValues(); + update(); + } +} + +void SQ_PreviewWidget::mousePressEvent(QMouseEvent *e) +{ + e->accept(); + + if(e->button() == Qt::RightButton) + popup->exec(e->globalPos()); +} + +void SQ_PreviewWidget::loadPending() +{ + if(pending.isValid()) + { + KURL tmp = pending; + load(tmp); + } +} + +void SQ_PreviewWidget::slotDownloadResult(const KURL &url) +{ + percentString = QString::null; + QString path = url.path(); + fmt_info *finfo; + RGBA *bits; + + // load first page + bool b = SQ_ImageLoader::instance()->loadImage(path, SQ_CodecSettings::ImageViewer, true, 2); + + finfo = SQ_ImageLoader::instance()->info(); + bits = SQ_ImageLoader::instance()->bits(); + + // memory allocation failed in SQ_ImageLoader::loadImage() + if(!b || !bits || !finfo->image.size()) + return; + + delete small; + delete all; + all = small = 0; + pixmap = QPixmap(); + + int w = finfo->image[0].w; + int h = finfo->image[0].h; + dimstring = QString::fromLatin1("%1x%2").arg(w).arg(h); + + const int wh = w * h; + unsigned char t; + + for(int i = 0;i < wh;i++) + { + t = (bits+i)->r; + (bits+i)->r = (bits+i)->b; + (bits+i)->b = t; + } + + all = new QImage((uchar *)bits, w, h, 32, 0, 0, QImage::LittleEndian); + all->setAlphaBuffer(true); + +#ifdef SQ_HAVE_KEXIF + KExifData data; + data.readFromFile(path); + int O = data.getImageOrientation(); + + if(O != KExifData::UNSPECIFIED && O != KExifData::NORMAL) + { + // copy original image + QImage img = *all; + + // rotate image + SQ_Utils::exifRotate(QString::null, img, O); + + // transfer back + *all = img; + } + else +#endif + *all = all->copy(); + + multi = finfo->image.size() > 1; + + SQ_ImageLoader::instance()->cleanup(); + + fitAndConvert(); + update(); +} + +void SQ_PreviewWidget::keyPressEvent(QKeyEvent *e) +{ + e->accept(); + + int key = e->key(); + + if(key == Qt::Key_PageDown || key == Qt::Key_Space) + emit next(); + else if(key == Qt::Key_PageUp || key == Qt::Key_BackSpace) + emit previous(); + else if(key == Qt::Key_Return || key == Qt::Key_Enter) + emit execute(); + else if(key == Qt::Key_Home) + emit first(); + else if(key == Qt::Key_End) + emit last(); +} + +void SQ_PreviewWidget::wheelEvent(QWheelEvent *e) +{ + if(e->delta() < 0) + emit next(); + else + emit previous(); +} + +void SQ_PreviewWidget::mouseDoubleClickEvent(QMouseEvent *e) +{ + e->accept(); + emit execute(); +} + +void SQ_PreviewWidget::slotDownloadPercents(int p) +{ + percentString = i18n("Downloading...") + ' ' + KIO::convertSize(p); + update(); +} + +#include "sq_previewwidget.moc" diff --git a/ksquirrel/sidebar/sq_previewwidget.h b/ksquirrel/sidebar/sq_previewwidget.h new file mode 100644 index 0000000..432ae9d --- /dev/null +++ b/ksquirrel/sidebar/sq_previewwidget.h @@ -0,0 +1,131 @@ +/*************************************************************************** + sq_previewwidget.h - description + ------------------- + begin : ??? Mar 13 2007 + copyright : (C) 2007 by Baryshev Dmitry + email : ksquirrel.iv@gmail.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifndef SQ_PREVIEWWIDGET_H +#define SQ_PREVIEWWIDGET_H + +#include +#include +#include +#include +#include + +#include + +class KPopupMenu; + +class SQ_Downloader; + +/** + *@author Baryshev Dmitry + */ + +class SQ_PreviewWidget : public QWidget +{ + Q_OBJECT + + public: + SQ_PreviewWidget(QWidget *parent = 0, const char *name = 0); + ~SQ_PreviewWidget(); + + void rereadColor(); + + void load(const KURL &url); + + void ignore(bool ign); + + void loadPending(); + + static SQ_PreviewWidget* instance() { return m_inst; } + + int delay() const; + + bool cancel() const; + + KURL url() const; + + private: + void saveValues(); + + signals: + void next(); + void previous(); + void execute(); + void first(); + void last(); + + private slots: + void slotBackground(); + void slotText(); + void slotDownloadResult(const KURL &); + void slotDownloadPercents(int); + + protected: + virtual void resizeEvent(QResizeEvent *); + virtual void paintEvent(QPaintEvent *); + virtual void mousePressEvent(QMouseEvent *e); + virtual void keyPressEvent(QKeyEvent *e); + virtual void wheelEvent(QWheelEvent *e); + virtual void mouseDoubleClickEvent(QMouseEvent *e); + + private: + bool fit(); + void fitAndConvert(); + + private: + QImage *all, *small; + QPixmap pixmap; + bool m_ignore, m_forceignore, m_cancel; + QColor color, colorText; + KPopupMenu *popup; + KURL pending, m_url; + int m_delay; + QWMatrix matrix; + SQ_Downloader *down; + bool multi; + QPixmap multi_pix; + QString dimstring, percentString; + bool dim; + + static SQ_PreviewWidget *m_inst; +}; + +inline +void SQ_PreviewWidget::ignore(bool ign) +{ + m_ignore = ign; +} + +inline +int SQ_PreviewWidget::delay() const +{ + return m_delay; +} + +inline +bool SQ_PreviewWidget::cancel() const +{ + return m_cancel; +} + +inline +KURL SQ_PreviewWidget::url() const +{ + return m_url; +} + +#endif diff --git a/ksquirrel/sidebar/sq_storagefile.cpp b/ksquirrel/sidebar/sq_storagefile.cpp new file mode 100644 index 0000000..9fb921f --- /dev/null +++ b/ksquirrel/sidebar/sq_storagefile.cpp @@ -0,0 +1,79 @@ +/*************************************************************************** + sq_storagefile.cpp - description + ------------------- + begin : Sat Mar 3 2007 + copyright : (C) 2007 by Baryshev Dmitry + email : ksquirrel.iv@gmail.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#include +#include +#include + +#include + +#include "sq_storagefile.h" + +void SQ_StorageFile::writeStorageFile(const QString &path, const KURL &inpath, KURL w) +{ + SQ_StorageFile::writeStorageFileAsString(path, inpath, w.prettyURL()); +} + +void SQ_StorageFile::writeStorageFileAsString(const QString &path, const KURL &inpath, QString content) +{ + if(content.isEmpty()) + content = inpath.prettyURL(); + + KMD5 md5(QFile::encodeName(inpath.prettyURL())); + QFile file(path + QString::fromLatin1(".") + QString(md5.hexDigest())); + + if(file.open(IO_WriteOnly)) + { + QString k = content.utf8(); + file.writeBlock(k, k.length()); + file.close(); + } +} + +KURL SQ_StorageFile::readStorageFile(const QString &path) +{ + QString n = SQ_StorageFile::readStorageFileAsString(path); + + int ind = n.find('\n'); + + if(ind != -1) + n.truncate(ind); + + return KURL::fromPathOrURL(n); +} + +QString SQ_StorageFile::readStorageFileAsString(const QString &path) +{ + QFile file(path); + QString str; + + if(file.open(IO_ReadOnly)) + { + QByteArray ba = file.readAll(); + + if(file.status() == IO_Ok) + { + QString k; + str.append(ba); + str = QString::fromUtf8(str); + } + } + + file.close(); + + return str; +} diff --git a/ksquirrel/sidebar/sq_storagefile.h b/ksquirrel/sidebar/sq_storagefile.h new file mode 100644 index 0000000..e72abd9 --- /dev/null +++ b/ksquirrel/sidebar/sq_storagefile.h @@ -0,0 +1,34 @@ +/*************************************************************************** + sq_storagefile.h - description + ------------------- + begin : Sat Mar 3 2007 + copyright : (C) 2007 by Baryshev Dmitry + email : ksquirrel.iv@gmail.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifndef SQ_STORAGEFILE_H +#define SQ_STORAGEFILE_H + +#include + +#include + +namespace SQ_StorageFile +{ + void writeStorageFile(const QString &path, const KURL &inpath, KURL w = KURL()); + void writeStorageFileAsString(const QString &path, const KURL &inpath, QString content = QString::null); + + KURL readStorageFile(const QString &path); + QString readStorageFileAsString(const QString &path); +}; + +#endif diff --git a/ksquirrel/sidebar/sq_threaddirlister.cpp b/ksquirrel/sidebar/sq_threaddirlister.cpp new file mode 100644 index 0000000..5b825e2 --- /dev/null +++ b/ksquirrel/sidebar/sq_threaddirlister.cpp @@ -0,0 +1,145 @@ +/*************************************************************************** + sq_threaddirlister.cpp - description + ------------------- + begin : Feb 10 2007 + copyright : (C) 2007 by Baryshev Dmitry + email : ksquirrel.iv@gmail.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include +#include +#include +#include +#include +#include + +#include +#include + +#include "sq_threaddirlister.h" + +SQ_ThreadDirLister::SQ_ThreadDirLister(QObject *o) + : QThread(), obj(o) +{ + cache = new KConfig("ksquirrel-tree-cache"); + dir = 0; +} + +SQ_ThreadDirLister::~SQ_ThreadDirLister() +{ + // sync() & delete + delete cache; +} + +void SQ_ThreadDirLister::run() +{ + KURL url; + QString path, name, filepath; + dirent *file; + int count_files, count_dirs; + QDateTime dt, dt_def; + QFileInfo fi; + bool b_read; + + static const QString &dot = KGlobal::staticQString("."); + static const QString &dotdot = KGlobal::staticQString(".."); + + while(true) + { + waitMutex(); + count_files = todo.count(); + unlock(); + + if(!count_files) break; + + waitMutex(); + url = todo.first(); + unlock(); + + path = url.path(); + count_files = count_dirs = 0; + b_read = true; + fi.setFile(path); + + if(cache->hasGroup(path)) + { + cache->setGroup(path); + dt = cache->readDateTimeEntry("modified", &dt_def); + + // compare cached time and real time + if(dt.isValid() && fi.lastModified() == dt) + { + count_files = cache->readNumEntry("count_files", 0); + count_dirs = cache->readNumEntry("count_dirs", 0); + b_read = false; + } + } + + if(b_read) + { + dir = opendir(QFile::encodeName(path)); + dt = fi.lastModified(); // save directory last modified time + + if(dir) + { + while((file = readdir(dir))) + { + name = QFile::decodeName(file->d_name); + + if(name != dot && name != dotdot) + { + filepath = path + QDir::separator() + name; + + fi.setFile(filepath); + + if(fi.isDir()) + count_dirs++; + else + count_files++; + } + } + + closeDir(); + } + else // opendir() failed, this value won't be cached + b_read = false; + } + + waitMutex(); + todo.pop_front(); + unlock(); + + // cache only new values + if(b_read) + { + cache->setGroup(path); + cache->writeEntry("modified", dt); + cache->writeEntry("count_files", count_files); + cache->writeEntry("count_dirs", count_dirs); + } + + QApplication::postEvent(obj, new SQ_ItemsEvent(url, count_files, count_dirs)); + }// while +} + +void SQ_ThreadDirLister::closeDir() +{ + if(dir) + { + closedir(dir); + dir = 0; + } +} diff --git a/ksquirrel/sidebar/sq_threaddirlister.h b/ksquirrel/sidebar/sq_threaddirlister.h new file mode 100644 index 0000000..036129d --- /dev/null +++ b/ksquirrel/sidebar/sq_threaddirlister.h @@ -0,0 +1,153 @@ +/*************************************************************************** + sq_threaddirlister.h - description + ------------------- + begin : Feb 10 2007 + copyright : (C) 2007 by Baryshev Dmitry + email : ksquirrel.iv@gmail.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + + +#ifndef SQ_THREADDIRLISTER_H +#define SQ_THREADDIRLISTER_H + +#include +#include +#include + +#include + +#include +#include + +class QObject; + +class KConfig; + +/********************************************************/ + +#define SQ_ItemsEventId (QEvent::User + 1) + +class SQ_ItemsEvent : public QCustomEvent +{ + public: + SQ_ItemsEvent(const KURL &parent, int c1, int c2) + : QCustomEvent(SQ_ItemsEventId), m_files(c1), m_dirs(c2), m_url(parent) + {} + + int files() const; + int dirs() const; + + KURL url() const; + + private: + int m_files, m_dirs; + KURL m_url; +}; + +inline +KURL SQ_ItemsEvent::url() const +{ + return m_url; +} + +inline +int SQ_ItemsEvent::files() const +{ + return m_files; +} + +inline +int SQ_ItemsEvent::dirs() const +{ + return m_dirs; +} + +/********************************************************/ + +/* + * This thread will read directory and determine + * number of files in it. Finally + * it will post an event to main thread with + * calculated count. This function is threaded + * due to perfomance reason. + */ +class SQ_ThreadDirLister : public QThread +{ + public: + SQ_ThreadDirLister(QObject *o); + ~SQ_ThreadDirLister(); + + void appendURL(const KURL &url); + + bool hasURL(const KURL &url); + bool isCurrent(const KURL &url); + + void lock(); + void unlock(); + + void closeDir(); + + protected: + virtual void run(); + + private: + void waitMutex(); + + private: + // urls to read + KURL::List todo; + + // this object will recieve our events + QObject *obj; + QMutex mutex; + KConfig *cache; + DIR *dir; +}; + +inline +void SQ_ThreadDirLister::appendURL(const KURL &url) +{ + todo.append(url); +} + +inline +bool SQ_ThreadDirLister::hasURL(const KURL &url) +{ + return todo.find(url) != todo.end(); +} + +inline +bool SQ_ThreadDirLister::isCurrent(const KURL &url) +{ + return todo.first().equals(url, true); +} + +inline +void SQ_ThreadDirLister::lock() +{ + mutex.lock(); +} + +inline +void SQ_ThreadDirLister::unlock() +{ + mutex.unlock(); +} + +inline +void SQ_ThreadDirLister::waitMutex() +{ + while(!mutex.tryLock()) + QThread::msleep(1); +} + +#endif diff --git a/ksquirrel/sidebar/sq_treeview.cpp b/ksquirrel/sidebar/sq_treeview.cpp new file mode 100644 index 0000000..f622384 --- /dev/null +++ b/ksquirrel/sidebar/sq_treeview.cpp @@ -0,0 +1,678 @@ +/*************************************************************************** + sq_treeview.cpp - description + ------------------- + begin : Mon Mar 15 2004 + copyright : (C) 2004 by Baryshev Dmitry + email : ksquirrel.iv@gmail.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include +#include +#include +#include + +#include +#include +#include +#include + +#include "ksquirrel.h" +#include "sq_iconloader.h" +#include "sq_widgetstack.h" +#include "sq_filethumbview.h" +#include "sq_config.h" +#include "sq_treeview.h" +#include "sq_treeviewitem.h" +#include "sq_threaddirlister.h" +#include "sq_navigatordropmenu.h" +#include "sq_treeviewmenu.h" +#include "sq_hloptions.h" + +#include "sq_directorybasket.h" + +SQ_TreeView * SQ_TreeView::m_instance = 0; + +SQ_FileTreeViewBranch::SQ_FileTreeViewBranch(KFileTreeView *parent, const KURL &url, + const QString &name, const QPixmap &pix) : KFileTreeBranch(parent, url, name, pix) +{} + +SQ_FileTreeViewBranch::~SQ_FileTreeViewBranch() +{} + +KFileTreeViewItem* SQ_FileTreeViewBranch::createTreeViewItem(KFileTreeViewItem *parent, KFileItem *fileItem) +{ + KFileTreeViewItem *tvi = 0; + + if(parent && fileItem) + tvi = new SQ_TreeViewItem(parent, fileItem, this); + + return tvi; +} + +/******************************************************************************************************/ + +SQ_TreeView::SQ_TreeView(QWidget *parent, const char *name) : KFileTreeView(parent, name) +{ + m_instance = this; + + itemToBeOpened = 0; + m_animTimer = new QTimer(this); + scanTimer = new QTimer(this); + m_ignoreClick = false; + + connect(m_animTimer, SIGNAL(timeout()), this, SLOT(slotAnimation())); + connect(scanTimer, SIGNAL(timeout()), this, SLOT(slotDelayedScan())); + + dw = 0; + m_recurs = No; + lister = new SQ_ThreadDirLister(this); + setupRecursion(); + + setFrameShape(QFrame::NoFrame); + addColumn("Name"); + addColumn("Check"); + + header()->hide(); + header()->moveSection(1, 0); + setColumnWidthMode(1, QListView::Manual); + setColumnWidth(1, 18); + + root = new SQ_FileTreeViewBranch(this, QDir::rootDirPath(), QString::null, + SQ_IconLoader::instance()->loadIcon("folder_red", KIcon::Desktop, KIcon::SizeSmall)); + + // some hacks to create our SQ_TreeViewItem as root item + SQ_TreeViewItem *ritem = new SQ_TreeViewItem(this, + new KFileItem(QDir::rootDirPath(), + "inode/directory", S_IFDIR), + root); + + ritem->setText(0, i18n("root")); + ritem->setExpandable(true); + + // oops :) + delete root->root(); + + // set new root + root->setRoot(ritem); + + addBranch(root); + + // don't show files + setDirOnlyMode(root, true); + + // show '+' + setRootIsDecorated(true); + + // connect signals + + // Space and Return will open item + connect(this, SIGNAL(spacePressed(QListViewItem*)), this, SIGNAL(executed(QListViewItem*))); + connect(this, SIGNAL(returnPressed(QListViewItem*)), this, SIGNAL(executed(QListViewItem*))); + connect(this, SIGNAL(currentChanged(QListViewItem *)), this, SLOT(slotCurrentChanged(QListViewItem*))); + + connect(this, SIGNAL(executed(QListViewItem*)), this, SLOT(slotItemExecuted(QListViewItem*))); + connect(this, SIGNAL(newURL(const KURL&)), this, SLOT(slotNewURL(const KURL&))); + connect(root, SIGNAL(populateFinished(KFileTreeViewItem *)), this, SLOT(slotOpened(KFileTreeViewItem *))); + connect(root, SIGNAL(deleteItem(KFileItem *)), this, SLOT(slotDeleteItemMy(KFileItem *))); + + setCurrentItem(root->root()); + root->setChildRecurse(false); + + SQ_Config::instance()->setGroup("Fileview"); + int sync_type = SQ_Config::instance()->readNumEntry("sync type", 0); + + // load url, if needed + if(sync_type != 1) + emitNewURL(SQ_WidgetStack::instance()->url()); + + setAcceptDrops(true); + + connect(this, SIGNAL(dropped(QDropEvent *, QListViewItem *, QListViewItem *)), + this, SLOT(slotDropped(QDropEvent *, QListViewItem *, QListViewItem *))); + + connect(this, SIGNAL(contextMenu(KListView *, QListViewItem *, const QPoint &)), + this, SLOT(slotContextMenu(KListView *, QListViewItem *, const QPoint &))); + + menu = new SQ_TreeViewMenu(this); + + if(SQ_HLOptions::instance()->have_directorybasket) + { + menu->insertSeparator(); + menu->insertItem(i18n("Add to Folder Basket"), this, SLOT(slotAddToFolderBasket())); + } +} + +SQ_TreeView::~SQ_TreeView() +{ + lister->terminate(); + lister->wait(); + + delete lister; +} + +void SQ_TreeView::slotCurrentChanged(QListViewItem *item) +{ + SQ_TreeViewItem *tvi = static_cast(item); + + if(tvi) cURL = tvi->url(); +} + +void SQ_TreeView::setRecursion(int b) +{ + // avoid duplicate calls + if(m_recurs == b) + return; + + QListViewItemIterator it(this); + SQ_TreeViewItem *tvi; + + // ignore root item + ++it; + + // turn recursion on + if(m_recurs == No && b) + { + dw = new KDirWatch(this); + connect(dw, SIGNAL(dirty(const QString &)), this, SLOT(slotDirty(const QString &))); + + dw->blockSignals(true); + lister->lock(); + while(it.current()) + { + tvi = static_cast(it.current()); + + if(tvi) + { + tvi->setParams((m_recurs == Files || m_recurs == FilesDirs), + (m_recurs == Dirs || m_recurs == FilesDirs)); + + lister->appendURL(tvi->url()); + dw->addDir(tvi->path()); + } + + ++it; + } + lister->unlock(); + dw->blockSignals(false); + + m_recurs = b; + + if(!lister->running()) + scanTimer->start(1, true); + } + // turn recursion off + else + { + delete dw; + dw = 0; + + m_recurs = b; + while(it.current()) + { + tvi = static_cast(it.current()); + + // reset item names + if(tvi) + { + tvi->setParams((m_recurs == Files || m_recurs == FilesDirs), + (m_recurs == Dirs || m_recurs == FilesDirs)); + tvi->setCount(tvi->files(), tvi->dirs()); + } + + ++it; + } + } +} + +void SQ_TreeView::slotClearChecked() +{ + QListViewItemIterator it(this); + SQ_TreeViewItem *tvi; + + while(it.current()) + { + tvi = static_cast(it.current()); + + if(tvi && tvi->checked()) + tvi->setChecked(false); + + ++it; + } +} + +/* + * Item executed. Let's pass its url to SQ_WidgetStack (if needed). + */ +void SQ_TreeView::slotItemExecuted(QListViewItem *item) +{ + if(!item) return; + + item->setOpen(true); + + SQ_Config::instance()->setGroup("Fileview"); + int sync_type = SQ_Config::instance()->readNumEntry("sync type", 0); + + // current sychronization type doesn't require + // passing url to SQ_WidgetStack - return + if(sync_type == 1) + return; + + KFileTreeViewItem *cur = static_cast(item); + KURL Curl = cur->url(); + + // pass url to SQ_WidgetStack + SQ_WidgetStack::instance()->setURLForCurrent(Curl, false); +} + +void SQ_TreeView::emitNewURL(const KURL &url) +{ + // already selected? + if(!url.isLocalFile() || url.equals(currentURL(), true) || url.equals(cURL, true)) + return; + + cURL = url; + + // tree is invisible. + // save url for future use + if(!isVisible()) + { + pendingURL = url; + pendingURL.adjustPath(1); + return; + } + else + pendingURL = KURL(); + + emit newURL(url); +} + +/* + * Set given item visible, current, and populate it. + */ +void SQ_TreeView::populateItem(KFileTreeViewItem *item) +{ + if(item->url().equals(cURL, true)) + { + setSelected(item, true); + setCurrentItem(item); + + // 1/5 of height give above items + // 4/5 of height give below items + setContentsPos(contentsX(), itemPos(item)-visibleHeight()/5); + } + + itemToBeOpened = item; + item->setOpen(true); +} + +/* + * Load url. + */ +void SQ_TreeView::slotNewURL(const KURL &url) +{ + KURL k(url); + k.adjustPath(1); + + KURL last = k; + + QString s; + + // divide url to paths. + // for example, "/home/krasu/1/2" will be divided to + // + // "/home/krasu/1/2" + // "/home/krasu/1" + // "/home/krasu" + // "/home" + // "/" + // + while(true) + { + s = k.path(); // remove "/" + s.remove(0, 1); + + paths.prepend(s); + k = k.upURL(); + + if(k.equals(last, true)) + break; + + last = k; + } + + while(doSearch()) + {} +} + +/* + * New item is opened. Try to continue loading url. + */ +void SQ_TreeView::slotOpened(KFileTreeViewItem *item) +{ + if(!item) return; + + // continue searhing... + if(item == itemToBeOpened) + doSearch(); +} + +/* + * Search first available url in variable 'paths'. Open found item. + * If item was found return true. + */ +bool SQ_TreeView::doSearch() +{ + // all items are opened + if(paths.empty()) + { + itemToBeOpened = 0; + return false; + } + + QStringList::iterator it = paths.begin(); + + KFileTreeViewItem *found = findItem(root, *it); + + // item not found. It means that + // + // * we loaded all subpaths - nothing to do + // * item we needed is not loaded yet. populateItem() _now_ is trying to open + // new subpath, and we will continue searching in slotOpened(). + // + if(!found) + return false; + + // ok, item is found + // + // remove first entry from 'paths' + // and try to open item + paths.erase(it); + populateItem(found); + + // done, but subpaths are pending... + return true; +} + +/* + * On show event load saved url, if any. See emitNewURL(). + */ +void SQ_TreeView::showEvent(QShowEvent *) +{ + // if pending url is valid + if(!pendingURL.isEmpty()) + { + // set pending url to current url + KURL url = pendingURL; + + // reset pending url + pendingURL = KURL(); + + // finally, load url + emit newURL(url); + } +} + +void SQ_TreeView::slotNewTreeViewItems(KFileTreeBranch *, const KFileTreeViewItemList &list) +{ + if(m_recurs == No) + return; + +// uuuuuuuggggggghhhhhhh :) + KFileTreeViewItemListIterator it(list); + KFileTreeViewItem *item; + + lister->lock(); + while((item = it.current())) + { + lister->appendURL(item->url()); + dw->addDir(item->path()); + ++it; + } + lister->unlock(); + + if(!lister->running()) + scanTimer->start(1, true); +} + +void SQ_TreeView::slotDelayedScan() +{ + if(!lister->running()) + lister->start(); +} + +void SQ_TreeView::customEvent(QCustomEvent *e) +{ + if(!e || e->type() != SQ_ItemsEventId) + return; + + SQ_ItemsEvent *ie = static_cast(e); + + SQ_TreeViewItem *tvi = static_cast(root->findTVIByURL(ie->url())); + + if(tvi) + { + tvi->setParams((m_recurs == Files || m_recurs == FilesDirs), + (m_recurs == Dirs || m_recurs == FilesDirs)); + tvi->setCount(ie->files(), ie->dirs()); + } +} + +void SQ_TreeView::slotAnimation() +{ + KFileTreeViewItem *it = m_mapFolders.first(); + + for(;it;it = m_mapFolders.next()) + it->setPixmap(0, SmallIcon("clock")); +} + +void SQ_TreeView::startAnimation(KFileTreeViewItem *item, const char *, uint) +{ + if(!item) + return; + + m_mapFolders.append(item); + + if(!m_animTimer->isActive()) + m_animTimer->start(50, true); +} + +void SQ_TreeView::stopAnimation(KFileTreeViewItem *item) +{ + if(!item) + return; + + int f = m_mapFolders.find(item); + + if(f != -1) + { + item->setPixmap(0, itemIcon(item)); + m_mapFolders.remove(item); + } + + m_animTimer->stop(); +} + +void SQ_TreeView::viewportResizeEvent(QResizeEvent *) +{ + setColumnWidth(0, viewport()->width() - columnWidth(1)); + triggerUpdate(); +} + +void SQ_TreeView::clearSelection() +{ + if(!m_ignoreClick) KFileTreeView::clearSelection(); +} + +void SQ_TreeView::setSelected(QListViewItem *item, bool selected) +{ + if(!m_ignoreClick) KFileTreeView::setSelected(item, selected); +} + +void SQ_TreeView::setCurrentItem(QListViewItem *item) +{ + if(!m_ignoreClick) KFileTreeView::setCurrentItem(item); +} + +void SQ_TreeView::setOpen(QListViewItem *item, bool open) +{ + if(!m_ignoreClick) KFileTreeView::setOpen(item, open); +} + +void SQ_TreeView::contentsMousePressEvent(QMouseEvent *e) +{ + QListViewItem *item; + + QPoint point = e->pos(); + point.setY(point.y() - contentsY()); + + if(header()->sectionAt(point.x()) && (item = itemAt(point))) + { + SQ_TreeViewItem *m = static_cast(item); + + if(m) + { + int state = e->state(); + + if(!state) + toggle(m, true); + else + { + QListViewItemIterator it(this); + + // toggle parent item + if(state == Qt::ShiftButton) toggle(m, true); + else if(state == Qt::ControlButton) toggle(m, false, true); + else if(state == Qt::AltButton) toggle(m, false, false); + + SQ_TreeViewItem *tvi = static_cast(m->firstChild()); + + // toggle all child items + while(tvi) + { + if(state == Qt::ShiftButton) toggle(tvi, false, m->checked()); + else if(state == Qt::ControlButton) toggle(tvi, false, true); + else if(state == Qt::AltButton) toggle(tvi, false, false); + + tvi = static_cast(tvi->nextSibling()); + } + } + } + + m_ignoreClick = true; + } + + KFileTreeView::contentsMousePressEvent(e); + + m_ignoreClick = false; +} + +void SQ_TreeView::contentsMouseDoubleClickEvent(QMouseEvent *e) +{ + if(header()->sectionAt(e->x())) + m_ignoreClick = true; + + KFileTreeView::contentsMouseDoubleClickEvent(e); + + m_ignoreClick = false; +} + +void SQ_TreeView::setupRecursion() +{ + SQ_Config::instance()->setGroup("Sidebar"); + + setRecursion(SQ_Config::instance()->readNumEntry("recursion_type", No)); +} + +void SQ_TreeView::toggle(SQ_TreeViewItem *item, bool togg, bool set) +{ + if(togg) + item->setChecked(!item->checked()); + else + item->setChecked(set); + + if(item->checked()) + emit urlAdded(item->url()); + else + emit urlRemoved(item->url()); +} + +void SQ_TreeView::slotDropped(QDropEvent *e, QListViewItem *parent, QListViewItem *item) +{ + if(!item) item = parent; + + KFileTreeViewItem *cur = static_cast(item); + + if(!cur) return; + + KURL::List list; + KURLDrag::decode(e, list); + + SQ_NavigatorDropMenu::instance()->setupFiles(list, cur->url()); + SQ_NavigatorDropMenu::instance()->exec(QCursor::pos(), true); +} + +void SQ_TreeView::slotContextMenu(KListView *, QListViewItem *item, const QPoint &point) +{ + if(item) + { + KFileTreeViewItem *kfi = static_cast(item); + menu->updateDirActions(kfi->isDir()); + menu->setURL(kfi->url()); + menu->exec(point); + } +} + +void SQ_TreeView::slotDirty(const QString &path) +{ + KURL url; + url.setPath(path); + + lister->lock(); + + // we don't need update urls that are not yet updated + // by threaded lister + if(!lister->hasURL(url)) + lister->appendURL(url); + else if(lister->isCurrent(url)) + { + lister->terminate(); + lister->wait(); + lister->closeDir(); + } + + lister->unlock(); + + if(!lister->running()) + scanTimer->start(1000, true); +} + +void SQ_TreeView::slotDeleteItemMy(KFileItem *fi) +{ + if(m_recurs != No && fi) + dw->removeDir(fi->url().path()); +} + +void SQ_TreeView::slotAddToFolderBasket() +{ + KFileItem fi(KFileItem::Unknown, KFileItem::Unknown, menu->url()); + + KFileItemList list; + list.append(&fi); + + SQ_DirectoryBasket::instance()->add(list); +} + +#include "sq_treeview.moc" diff --git a/ksquirrel/sidebar/sq_treeview.h b/ksquirrel/sidebar/sq_treeview.h new file mode 100644 index 0000000..92043dc --- /dev/null +++ b/ksquirrel/sidebar/sq_treeview.h @@ -0,0 +1,173 @@ +/*************************************************************************** + sq_treeview.h - description + ------------------- + begin : Mon Mar 15 2004 + copyright : (C) 2004 by Baryshev Dmitry + email : ksquirrel.iv@gmail.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifndef SQ_TREEVIEW_H +#define SQ_TREEVIEW_H + +#include + +#include +#include + +class KDirWatch; + +class SQ_TreeViewItem; +class SQ_ThreadDirLister; +class SQ_TreeViewMenu; + +/* + * We should subclass KFileTreeBranch to let us create + * our own items. See SQ_TreeViewitem. + */ +class SQ_FileTreeViewBranch : public KFileTreeBranch +{ + public: + SQ_FileTreeViewBranch(KFileTreeView*, const KURL &url, const QString &name, const QPixmap &pix); + ~SQ_FileTreeViewBranch(); + + protected: + virtual KFileTreeViewItem *createTreeViewItem(KFileTreeViewItem *parent, KFileItem *fileItem); +}; + +/* + * SQ_TreeView represents a file tree. + */ + +class SQ_TreeView : public KFileTreeView +{ + Q_OBJECT + + public: + SQ_TreeView(QWidget *parent = 0, const char *name = 0); + ~SQ_TreeView(); + + enum Recursion { No = 0, Files, Dirs, FilesDirs }; + + /* + * Recursion settings. If recursion > 0, treeview will + * show a number of files/directories in the given directory. + * It will look like that: + * + * + mypictures [8] + * | + wallpapers [231] + * | + nature [12] + * | + pets [43] + * | + cats [22] + * | + dogs [32] + * + * This operation is threaded. + */ + void setupRecursion(); + + /* + * Load new url, if tree is visible. Save url and do nothing + * otherwise. + */ + void emitNewURL(const KURL &url); + + virtual void clearSelection(); + virtual void setSelected(QListViewItem *item, bool selected); + virtual void setCurrentItem(QListViewItem *item); + virtual void setOpen(QListViewItem *item, bool open); + + static SQ_TreeView* instance() { return m_instance; } + + protected: + virtual void customEvent(QCustomEvent *e); + virtual void startAnimation(KFileTreeViewItem* item, const char*, uint); + virtual void stopAnimation(KFileTreeViewItem* item); + virtual void viewportResizeEvent(QResizeEvent *); + virtual void contentsMousePressEvent(QMouseEvent *e); + virtual void contentsMouseDoubleClickEvent(QMouseEvent *e); + + /* + * On show event load saved url, if any. See emitNewURL(). + */ + virtual void showEvent(QShowEvent *); + + private: + void toggle(SQ_TreeViewItem *, bool, bool = false); + void setRecursion(int); + + /* + * Set given item visible, current, and populate it. + */ + void populateItem(KFileTreeViewItem *); + + /* + * Search first available url in variable 'paths'. Open found item. + * If item was found return true. + */ + bool doSearch(); + + private slots: + /* + * Load url. + */ + void slotNewURL(const KURL &url); + + void slotCurrentChanged(QListViewItem *); + void slotAddToFolderBasket(); + void slotClearChecked(); + void slotDirty(const QString &); + void slotDeleteItemMy(KFileItem *); + + /* + * Item executed. Let's pass its url to SQ_WidgetStack (if needed). + */ + void slotItemExecuted(QListViewItem*); + + /* + * New item is opened. Try to continue loading url. + */ + void slotOpened(KFileTreeViewItem *); + + void slotNewTreeViewItems(KFileTreeBranch*, const KFileTreeViewItemList &); + void slotDelayedScan(); + void slotAnimation(); + + void slotDropped(QDropEvent *, QListViewItem *, QListViewItem *); + void slotContextMenu(KListView *, QListViewItem *, const QPoint &); + + signals: + void newURL(const KURL &url); + + /* + * Since 0.7.0 our file manager supports multiple directories. + * These signals tell SQ_DirOperator to add or remove some + * urls. + */ + void urlAdded(const KURL &); + void urlRemoved(const KURL &); + + private: + SQ_FileTreeViewBranch *root; + QStringList paths; + KURL pendingURL, cURL; + SQ_ThreadDirLister *lister; + KFileTreeViewItemList m_mapFolders; + QTimer *m_animTimer, *scanTimer; + bool m_ignoreClick; + int m_recurs; + SQ_TreeViewMenu *menu; + KDirWatch *dw; + KFileTreeViewItem *itemToBeOpened; + + static SQ_TreeView *m_instance; +}; + +#endif diff --git a/ksquirrel/sidebar/sq_treeviewitem.cpp b/ksquirrel/sidebar/sq_treeviewitem.cpp new file mode 100644 index 0000000..9f6508c --- /dev/null +++ b/ksquirrel/sidebar/sq_treeviewitem.cpp @@ -0,0 +1,107 @@ +/*************************************************************************** + sq_treeviewitem.cpp - description + ------------------- + begin : Feb 22 2007 + copyright : (C) 2007 by Baryshev Dmitry + email : ksquirrel.iv@gmail.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include + +#include "sq_treeviewitem.h" + +SQ_TreeViewItem::SQ_TreeViewItem(KFileTreeViewItem *parentItem, KFileItem *fileItem, KFileTreeBranch *parentBranch) + : KFileTreeViewItem(parentItem, fileItem, parentBranch), + m_checked(false), count_files(0), count_dirs(0), use_c1(false), use_c2(false) +{} + +SQ_TreeViewItem::SQ_TreeViewItem(KFileTreeView *parent, KFileItem *fileItem, KFileTreeBranch *parentBranch) + : KFileTreeViewItem(parent, fileItem, parentBranch), + m_checked(false), count_files(0), count_dirs(0), use_c1(false), use_c2(false) +{} + +SQ_TreeViewItem::~SQ_TreeViewItem() +{} + +void SQ_TreeViewItem::paintFocus(QPainter *, const QColorGroup &, const QRect &) +{} + +void SQ_TreeViewItem::paintCell(QPainter *p, const QColorGroup &cg, int column, int width, int alignment) +{ + KListView *klv = static_cast(listView()); + + // mark item + if(column) + { + int h = height(); + int w = klv->columnWidth(1); + const int m = 6; + const int marg = 2; + + p->fillRect(0,0,w,h,cg.base()); + + p->setPen(black); + p->setBrush(cg.base()); + p->drawRect(marg, marg, w-marg*2, h-marg*2); + + if(m_checked) + p->fillRect((w-m)/2, (h-m)/2, m, m, cg.highlight()); + } + else // file name and pixmap + { + QColorGroup cc = cg; + + if(m_checked) + { + if(klv->viewport()->backgroundMode() == Qt::FixedColor) + cc.setColor(QColorGroup::Background, cg.highlight()); + else + cc.setColor(QColorGroup::Base, cg.highlight()); + } + else if(isAlternate()) + { + if(klv->viewport()->backgroundMode() == Qt::FixedColor) + cc.setColor(QColorGroup::Background, klv->alternateBackground()); + else + cc.setColor(QColorGroup::Base, klv->alternateBackground()); + } + + QListViewItem::paintCell(p, cc, column, width, alignment); + } +} + +void SQ_TreeViewItem::setCount(int c1, int c2) +{ + count_files = c1 < 0 ? 0 : c1; + count_dirs = c2 < 0 ? 0 : c2; + + setText(0, fileItem()->name()); +} + +void SQ_TreeViewItem::setText(int column, const QString &text) +{ + QString s; + + if(use_c1 && use_c2) // files + dirs: show these two values anyway + s = QString::fromLatin1(" [%1/%2]").arg(count_dirs).arg(count_files); + else if(use_c1 && count_files) // files, file count is > 0 + s = QString::fromLatin1(" [%1]").arg(count_files); + else if(use_c2 && count_dirs) // dirs, dir count is > 0 + s = QString::fromLatin1(" [%1]").arg(count_dirs); + + KFileTreeViewItem::setText(column, text + s); +} + diff --git a/ksquirrel/sidebar/sq_treeviewitem.h b/ksquirrel/sidebar/sq_treeviewitem.h new file mode 100644 index 0000000..7f9494f --- /dev/null +++ b/ksquirrel/sidebar/sq_treeviewitem.h @@ -0,0 +1,85 @@ +/*************************************************************************** + sq_treeviewitem.h - description + ------------------- + begin : Feb 22 2007 + copyright : (C) 2007 by Baryshev Dmitry + email : ksquirrel.iv@gmail.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifndef SQ_TREEVIEWITEM_H +#define SQ_TREEVIEWITEM_H + +#include + +class KFileTreeBranch; + +class SQ_TreeViewItem : public KFileTreeViewItem +{ + public: + SQ_TreeViewItem(KFileTreeViewItem *parentItem, KFileItem *fileItem, KFileTreeBranch *parentBranch); + SQ_TreeViewItem(KFileTreeView *parent, KFileItem *fileItem, KFileTreeBranch *parentBranch); + ~SQ_TreeViewItem(); + + bool checked() const; + void setChecked(bool c); + + int files() const; + int dirs() const; + + void setCount(int c1, int c2); + void setParams(bool _use_c1, bool _use_c2); + + virtual void paintFocus(QPainter *, const QColorGroup &, const QRect &); + virtual void setText(int column, const QString &text); + + protected: + virtual void paintCell(QPainter *p, const QColorGroup &cg, int column, int width, int alignment); + + private: + bool m_checked; + int count_files, count_dirs; + bool use_c1, use_c2; +}; + +inline +void SQ_TreeViewItem::setParams(bool _use_c1, bool _use_c2) +{ + use_c1 = _use_c1; + use_c2 = _use_c2; +} + +inline +bool SQ_TreeViewItem::checked() const +{ + return m_checked; +} + +inline +void SQ_TreeViewItem::setChecked(bool c) +{ + m_checked = c; + repaint(); +} + +inline +int SQ_TreeViewItem::files() const +{ + return count_files; +} + +inline +int SQ_TreeViewItem::dirs() const +{ + return count_dirs; +} + +#endif diff --git a/ksquirrel/sidebar/sq_treeviewmenu.cpp b/ksquirrel/sidebar/sq_treeviewmenu.cpp new file mode 100644 index 0000000..120a0b3 --- /dev/null +++ b/ksquirrel/sidebar/sq_treeviewmenu.cpp @@ -0,0 +1,196 @@ +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#include "sq_treeviewmenu.h" +#include "ksquirrel.h" +#include "sq_iconloader.h" + +SQ_TreeViewMenu::SQ_TreeViewMenu(QWidget *parent, const char *name) : KPopupMenu(parent, name) +{ + id_new = insertItem(SQ_IconLoader::instance()->loadIcon("folder_new", KIcon::Desktop, KIcon::SizeSmall), i18n("New folder..."), this, SLOT(slotDirectoryNew())); + insertSeparator(); + id_rename = insertItem(i18n("Rename"), this, SLOT(slotDirectoryRename())); + id_clear = insertItem(i18n("Clear contents"), this, SLOT(slotDirectoryClear())); + id_delete = insertItem(SQ_IconLoader::instance()->loadIcon("editdelete", KIcon::Desktop, KIcon::SizeSmall), i18n("Delete"), this, SLOT(slotDirectoryDelete())); + insertSeparator(); + id_prop = insertItem(i18n("Properties"), this, SLOT(slotDirectoryProperties())); +} + +SQ_TreeViewMenu::~SQ_TreeViewMenu() +{} + +void SQ_TreeViewMenu::reconnect(Element elem, QObject *receiver, const char *member) +{ + int id; + + if(elem == SQ_TreeViewMenu::New) + id = id_new; + else if(elem == SQ_TreeViewMenu::Delete) + id = id_delete; + else if(elem == SQ_TreeViewMenu::Rename) + id = id_rename; + else if(elem == SQ_TreeViewMenu::Clear) + id = id_clear; + else + id = id_prop; + + disconnectItem(id, 0, 0); + connectItem(id, receiver, member); +} + +void SQ_TreeViewMenu::updateDirActions(bool isdir, bool isroot) +{ + setItemEnabled(id_new, isdir); + setItemEnabled(id_clear, isdir); + + setItemEnabled(id_delete, !isroot); + setItemEnabled(id_rename, isdir && !isroot); +} + +void SQ_TreeViewMenu::slotDirectoryNew() +{ + if(!m_url.isEmpty()) + { + bool ok; + + QString mNewFilename = KInputDialog::getText(i18n("Create Subfolder"), + i18n("

Create new folder in %1:

").arg(QStyleSheet::escape(m_url.filename())), + QString::null, &ok, KSquirrel::app()); + + if(ok) + { + KURL dstURL = m_url; + dstURL.addPath(mNewFilename); + KIO::Job *job = KIO::mkdir(dstURL); + + connect(job, SIGNAL(result(KIO::Job*)), this, SLOT(slotDirectoryResult(KIO::Job *))); + } + } +} + +void SQ_TreeViewMenu::slotDirectoryRename() +{ + if(!m_url.isEmpty()) + { + KURL renameSrcURL = m_url; + bool ok; + + QString filename = QStyleSheet::escape(renameSrcURL.filename()); + + QString mNewFilename = KInputDialog::getText(i18n("Rename Folder"), + i18n("

Rename folder %1 to:

").arg(filename), + renameSrcURL.filename(), &ok, KSquirrel::app()); + + if(ok) + { + KURL renameDstURL = renameSrcURL; + renameDstURL.setFileName(mNewFilename); + + KIO::Job *job = KIO::rename(renameSrcURL, renameDstURL, true); + + connect(job, SIGNAL(result(KIO::Job*)), this, SLOT(slotDirectoryResult(KIO::Job *))); + } + } +} + +void SQ_TreeViewMenu::slotDirectoryDelete() +{ + if(!m_url.isEmpty()) + { + QString dir = QStyleSheet::escape(m_url.path()); + + if(KMessageBox::questionYesNo(KSquirrel::app(), + "" + i18n("Are you sure you want to delete %1?").arg(dir) + "") == KMessageBox::No) + return; + + KIO::Job *job = KIO::del(m_url); + + connect(job, SIGNAL(result(KIO::Job*)), this, SLOT(slotDirectoryResult(KIO::Job *))); + } +} + +void SQ_TreeViewMenu::slotDirectoryClear() +{ + if(!m_url.isEmpty()) + { + urlstodel.clear(); + + if(KMessageBox::questionYesNo(KSquirrel::app(), + "" + i18n("Are you sure you want to delete contents of %1?").arg(m_url.path()) + "") == KMessageBox::No) + return; + + KIO::Job *job = KIO::listDir(m_url, false, true); + + connect(job, SIGNAL(entries(KIO::Job *, const KIO::UDSEntryList &)), this, SLOT(slotEntries(KIO::Job *, const KIO::UDSEntryList &))); + connect(job, SIGNAL(result(KIO::Job *)), this, SLOT(slotListResult(KIO::Job *))); + } +} + +void SQ_TreeViewMenu::slotEntries(KIO::Job *, const KIO::UDSEntryList &list) +{ + KIO::UDSEntryListConstIterator itEnd = list.end(); + QString suff; + KURL u; + + static const QString &dot = KGlobal::staticQString("."); + static const QString &dotdot = KGlobal::staticQString(".."); + + // go through list of KIO::UDSEntrys + for(KIO::UDSEntryListConstIterator it = list.begin(); it != itEnd; ++it) + { + KIO::UDSEntry entry = *it; + KIO::UDSEntry::ConstIterator itEnd = entry.end(); + + for(KIO::UDSEntry::ConstIterator it = entry.begin(); it != itEnd; ++it) + { + if((*it).m_uds == KIO::UDS_NAME) + { + suff = (*it).m_str; + + if(suff != dot && suff != dotdot) + { + u = m_url; + u.addPath(suff); + urlstodel.append(u); + } + + break; + } + } + } +} + +void SQ_TreeViewMenu::slotListResult(KIO::Job *job) +{ + if(!job) return; + + if(job->error()) + job->showErrorDialog(KSquirrel::app()); + else if(!urlstodel.isEmpty()) + { + KIO::Job *job = KIO::del(urlstodel); + connect(job, SIGNAL(result(KIO::Job *)), this, SLOT(slotDirectoryResult(KIO::Job *))); + } +} + +void SQ_TreeViewMenu::slotDirectoryResult(KIO::Job *job) +{ + if(job && job->error()) + job->showErrorDialog(KSquirrel::app()); +} + +void SQ_TreeViewMenu::slotDirectoryProperties() +{ + if(!m_url.isEmpty()) + (void)new KPropertiesDialog(m_url, KSquirrel::app()); +} + +#include "sq_treeviewmenu.moc" diff --git a/ksquirrel/sidebar/sq_treeviewmenu.h b/ksquirrel/sidebar/sq_treeviewmenu.h new file mode 100644 index 0000000..943d5dc --- /dev/null +++ b/ksquirrel/sidebar/sq_treeviewmenu.h @@ -0,0 +1,58 @@ +#ifndef SQ_TREEVIEWMENU_H +#define SQ_TREEVIEWMENU_H + +#include +#include + +class QPoint; + +namespace KIO { class Job; } + +class SQ_TreeViewMenu : public KPopupMenu +{ + Q_OBJECT + + public: + SQ_TreeViewMenu(QWidget *parent = 0, const char *name = 0); + virtual ~SQ_TreeViewMenu(); + + enum Element { New, Rename, Delete, Properties, Clear }; + + void setURL(const KURL &_url); + KURL url() const; + + void reconnect(Element, QObject *receiver, const char *member); + virtual void updateDirActions(bool isdir, bool isroot = false); + + protected slots: + virtual void slotDirectoryNew(); + virtual void slotDirectoryRename(); + virtual void slotDirectoryDelete(); + virtual void slotDirectoryProperties(); + virtual void slotDirectoryResult(KIO::Job *job); + + void slotDirectoryClear(); + void slotEntries(KIO::Job *, const KIO::UDSEntryList &); + void slotListResult(KIO::Job *); + + protected: + int id_new, id_rename, id_delete, id_prop, id_clear; + + private: + KURL m_url; + KURL::List urlstodel; +}; + +inline +void SQ_TreeViewMenu::setURL(const KURL &_url) +{ + m_url = _url; +} + +inline +KURL SQ_TreeViewMenu::url() const +{ + return m_url; +} + +#endif diff --git a/ksquirrel/sq_archivehandler.cpp b/ksquirrel/sq_archivehandler.cpp new file mode 100644 index 0000000..3c0fdfd --- /dev/null +++ b/ksquirrel/sq_archivehandler.cpp @@ -0,0 +1,115 @@ +/*************************************************************************** + sq_archivehandler.cpp - description + ------------------- + begin : ??? ??? 26 2004 + copyright : (C) 2004 by Baryshev Dmitry + email : ksquirrel.iv@gmail.com + ***************************************************************************/ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include +#include +#include +#include +#include +#include + +#include "sq_archivehandler.h" + +SQ_ArchiveHandler * SQ_ArchiveHandler::m_instance = 0; + +SQ_ArchiveHandler::SQ_ArchiveHandler(QObject * parent, const char *name) + : QObject(parent, name), QMap() +{ + m_instance = this; + + fillProtocols(); +} + +SQ_ArchiveHandler::~SQ_ArchiveHandler() +{} + +void SQ_ArchiveHandler::fillProtocols() +{ + // search for tar protocol + if(!KGlobal::dirs()->findResource("services", "tar.protocol").isEmpty()) + { + insert("application/x-tgz", "tar"); + insert("application/x-tar", "tar"); + insert("application/x-tarz", "tar"); + insert("application/x-tbz", "tar"); + insert("application/x-tzo", "tar"); + } + + // search for rar protocol (kio_rar from + // http://kde-apps.org/content/show.php/kio_rar?content=17527) + if(!KGlobal::dirs()->findResource("services", "rar.protocol").isEmpty()) + { + insert("application/x-rar", "rar"); + insert("application/x-rar-compressed", "rar"); + } + + // search for ar protocol + if(!KGlobal::dirs()->findResource("services", "ar.protocol").isEmpty()) + insert("application/x-archive", "ar"); + + // search for iso protocol + if(!KGlobal::dirs()->findResource("services", "iso.protocol").isEmpty()) + insert("application/x-iso", "iso"); + + // search for zip protocol + if(!KGlobal::dirs()->findResource("services", "zip.protocol").isEmpty()) + insert("application/x-zip", "zip"); + + // search for 7zip protocol (kio_p7zip + // from http://kde-apps.org/content/show.php/kio_p7zip?content=17829) + if(!KGlobal::dirs()->findResource("services", "p7zip.protocol").isEmpty()) + insert("application/x-7z", "p7zip"); +} + +/* + * Find protocol name by mimetype name. + * + * For example findProtocolByMime(""application/x-tgz"") will + * return "tar". + */ +QString SQ_ArchiveHandler::findProtocolByMime(const QString &mime) +{ + // find protocol + QMap::iterator it = find(mime); + + // return protocol number, if found, and -1 otherwise + return (it == end() ? QString::null : it.data()); +} + +/* + * Find protocol name by KFileItem's mimetype. + */ +QString SQ_ArchiveHandler::findProtocolByFile(KFileItem *item) +{ + return item ? findProtocolByMime(item->mimetype()) : QString::null; +} + +void SQ_ArchiveHandler::tryUnpack(KFileItem *item) +{ + if(item) tryUnpack(item->url(), item->mimetype()); +} + +void SQ_ArchiveHandler::tryUnpack(const KURL &url, const QString &mime) +{ + QString prot = findProtocolByMime(mime); + + if(!prot.isEmpty()) + { + // just change protocol, KIO::get() will do all for us + KURL _url = url; + _url.setProtocol(prot); + + emit unpack(_url); + } +} + +#include "sq_archivehandler.moc" diff --git a/ksquirrel/sq_archivehandler.h b/ksquirrel/sq_archivehandler.h new file mode 100644 index 0000000..8b2d3c5 --- /dev/null +++ b/ksquirrel/sq_archivehandler.h @@ -0,0 +1,66 @@ +/*************************************************************************** + sq_archivehandler.h - description + ------------------- + begin : ??? ??? 26 2004 + copyright : (C) 2004 by Baryshev Dmitry + email : ksquirrel.iv@gmail.com + ***************************************************************************/ + +#ifndef SQ_ARCHIVEHANDLER_H +#define SQ_ARCHIVEHANDLER_H + +#include +#include +#include + +// forward declarations +class KFileItem; +class KURL; + +#define SQ_AH SQ_ArchiveHandler + +/* + * Helper class for archive extracting via kio-slaves (since 0.7.1). + */ + +class SQ_ArchiveHandler : public QObject, QMap +{ + Q_OBJECT + + public: + SQ_ArchiveHandler(QObject *parent = 0, const char *name = 0); + ~SQ_ArchiveHandler(); + + /* + * Find protocol name by mimetype name. + * + * For example findProtocolByMime(""application/x-tgz"") will + * return "tar". + */ + QString findProtocolByMime(const QString &mime); + + /* + * Find protocol name by KFileItem's mimetype. + */ + QString findProtocolByFile(KFileItem *item); + + /* + * Determine mimetype and emit unpack() signal + */ + void tryUnpack(KFileItem *); + + void tryUnpack(const KURL &, const QString &mime); + + static SQ_ArchiveHandler* instance() { return m_instance; } + + private: + void fillProtocols(); + + signals: + void unpack(const KURL &); + + private: + static SQ_ArchiveHandler *m_instance; +}; + +#endif diff --git a/ksquirrel/sq_bookmarkowner.cpp b/ksquirrel/sq_bookmarkowner.cpp new file mode 100644 index 0000000..f7b7316 --- /dev/null +++ b/ksquirrel/sq_bookmarkowner.cpp @@ -0,0 +1,62 @@ +/*************************************************************************** + sq_bookmarkowner.cpp - description + ------------------- + begin : ??? ??? 27 2004 + copyright : (C) 2004 by Baryshev Dmitry + email : ksquirrel.iv@gmail.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include "sq_bookmarkowner.h" + +SQ_BookmarkOwner * SQ_BookmarkOwner::m_instance = 0; + +SQ_BookmarkOwner::SQ_BookmarkOwner(QWidget *parent) : QObject(parent) +{ + m_instance = this; +} + +SQ_BookmarkOwner::~SQ_BookmarkOwner() +{} + +/* + * User selected some bookmark. It will emit 'openURL' signal, + * and SQ_WidgetStack will catch it. + */ +void SQ_BookmarkOwner::openBookmarkURL(const QString &url) +{ + KURL u = KURL::fromPathOrURL(url); + + emit openURL(u); +} + +/* + * Current url. If user selected "Add bookmark", this + * url will be added to bookmarks. See also KBookmarkOwner::setURL() + */ +QString SQ_BookmarkOwner::currentURL() const +{ + return URL.prettyURL(); +} + +/* + * Set current url + */ +void SQ_BookmarkOwner::setURL(const KURL &new_url) +{ + URL = new_url; +} + +#include "sq_bookmarkowner.moc" diff --git a/ksquirrel/sq_bookmarkowner.h b/ksquirrel/sq_bookmarkowner.h new file mode 100644 index 0000000..4e5ab96 --- /dev/null +++ b/ksquirrel/sq_bookmarkowner.h @@ -0,0 +1,74 @@ +/*************************************************************************** + sq_bookmarkowner.h - description + ------------------- + begin : ??? ??? 27 2004 + copyright : (C) 2004 by Baryshev Dmitry + email : ksquirrel.iv@gmail.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifndef SQ_BOOKMARKOWNER_H +#define SQ_BOOKMARKOWNER_H + +#include +#include + +#include +#include + +/* + * Class for managing bookmarks. It used in main class (KSquirrel::initBookmarks()) + * and in SQ_WidgetStack to store and manage bookmarks. + */ + +class SQ_BookmarkOwner : public QObject, public KBookmarkOwner +{ + Q_OBJECT + + public: + SQ_BookmarkOwner(QWidget *parent = 0); + virtual ~SQ_BookmarkOwner(); + + /* + * User selected some bookmark. It will emit 'openURL' signal, + * and SQ_WidgetStack will catch it. + */ + virtual void openBookmarkURL(const QString &); + + /* + * Current url. If user selected "Add bookmark", this + * url will be added to bookmarks. See also SQ_BookmarkOwner::setURL() + */ + virtual QString currentURL() const; + + static SQ_BookmarkOwner* instance() { return m_instance; } + + /* + * Set current url + */ + public slots: + void setURL(const KURL &); + + /* + * Signal to open some url. SQ_WidgetStack will catch it + * and change current directory. + */ + signals: + void openURL(const KURL &); + + private: + KURL URL; + + // singleton + static SQ_BookmarkOwner *m_instance; +}; + +#endif diff --git a/ksquirrel/sq_codecsettings.cpp b/ksquirrel/sq_codecsettings.cpp new file mode 100644 index 0000000..47b3609 --- /dev/null +++ b/ksquirrel/sq_codecsettings.cpp @@ -0,0 +1,42 @@ +/*************************************************************************** + sq_codecsettings.cpp - description + ------------------- + begin : Mon Mar 5 2007 + copyright : (C) 2007 by Baryshev Dmitry + email : ksquirrel.iv@gmail.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#include + +#include "sq_codecsettings.h" +#include "sq_library.h" +#include "sq_config.h" + +void SQ_CodecSettings::applySettings(SQ_LIBRARY *lib, SQ_CodecSettings::settings fromwhere) +{ + SQ_Config::instance()->setGroup("Main"); + + int set = SQ_Config::instance()->readNumEntry("applyto", SQ_CodecSettings::Both); + + // thumbnail loader and image viewer will use default settings + if((fromwhere == SQ_CodecSettings::ThumbnailLoader && (set == SQ_CodecSettings::ThumbnailLoader || set == SQ_CodecSettings::Both)) + || (fromwhere == SQ_CodecSettings::ImageViewer && (set == SQ_CodecSettings::ImageViewer || set == SQ_CodecSettings::Both))) + { + lib->codec->set_settings(lib->settings); + lib->codec_il->set_settings(lib->settings); + } + else + { + lib->codec->fill_default_settings(); + lib->codec_il->fill_default_settings(); + } +} diff --git a/ksquirrel/sq_codecsettings.h b/ksquirrel/sq_codecsettings.h new file mode 100644 index 0000000..f789e9f --- /dev/null +++ b/ksquirrel/sq_codecsettings.h @@ -0,0 +1,34 @@ +/*************************************************************************** + sq_codecsettings.h - description + ------------------- + begin : Mon Mar 5 2007 + copyright : (C) 2007 by Baryshev Dmitry + email : ksquirrel.iv@gmail.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifndef SQ_CODECSETTINGS_H +#define SQ_CODECSETTINGS_H + +/** + *@author Baryshev Dmitry + */ + +struct SQ_LIBRARY; + +struct SQ_CodecSettings +{ + enum settings { ThumbnailLoader = 0, ImageViewer, Both, RunTume, None }; + + static void applySettings(SQ_LIBRARY *l, SQ_CodecSettings::settings fromwhere); +}; + +#endif diff --git a/ksquirrel/sq_codecsettingsskeleton.ui b/ksquirrel/sq_codecsettingsskeleton.ui new file mode 100644 index 0000000..5ef812c --- /dev/null +++ b/ksquirrel/sq_codecsettingsskeleton.ui @@ -0,0 +1,217 @@ + +SQ_CodecSettingsSkeleton + + + SQ_CodecSettingsSkeleton + + + + 0 + 0 + 283 + 335 + + + + Codec settings + + + true + + + + unnamed + + + + codecIcon + + + + 0 + 0 + 0 + 0 + + + + + 16 + 16 + + + + NoFrame + + + Plain + + + + + + + + line2 + + + HLine + + + Sunken + + + Horizontal + + + + + codecName + + + + 1 + + + + + + + + + groupBox + + + + + + + + line1 + + + HLine + + + Sunken + + + Horizontal + + + + + layout2 + + + + unnamed + + + + spacer2 + + + Horizontal + + + Expanding + + + + 16 + 16 + + + + + + pushApply + + + Apply + + + + + pushOK + + + OK + + + true + + + + + pushCancel + + + Cancel + + + + + + + + + pushOK + clicked() + SQ_CodecSettingsSkeleton + accept() + + + pushCancel + clicked() + SQ_CodecSettingsSkeleton + reject() + + + pushApply + clicked() + SQ_CodecSettingsSkeleton + slotApply() + + + + pushOK + pushApply + pushCancel + + + ksquirrel-libs/settings.h + qcheckbox.h + qmessagebox.h + qobjectlist.h + qbuttongroup.h + qslider.h + kurlrequester.h + knuminput.h + qwidgetfactory.h + qspinbox.h + qtextedit.h + kurl.h + kcolorbutton.h + sq_codecsettingsskeleton.ui.h + + + QWidget *w; + fmt_settings *sett; + + + apply(); + + + slotApply() + + + init() + addSettingsWidget( const QString & path ) + recursivelyReadWrite( fmt_settings & settings, bool r ) + exec( fmt_settings & settings ) + setCodecInfo( const QPixmap & pixmap, const QString & text ) + + + diff --git a/ksquirrel/sq_codecsettingsskeleton.ui.h b/ksquirrel/sq_codecsettingsskeleton.ui.h new file mode 100644 index 0000000..1ea9d6b --- /dev/null +++ b/ksquirrel/sq_codecsettingsskeleton.ui.h @@ -0,0 +1,171 @@ +/**************************************************************************** +** ui.h extension file, included from the uic-generated form implementation. +** +** If you wish to add, delete or rename functions or slots use +** Qt Designer which will update this file, preserving your code. Create an +** init() function in place of a constructor, and a destroy() function in +** place of a destructor. +*****************************************************************************/ + +void SQ_CodecSettingsSkeleton::init() +{ + w = 0; + sett = 0; +} + +void SQ_CodecSettingsSkeleton::addSettingsWidget(const QString &path) +{ + w = QWidgetFactory::create(path, 0, this, "skeleton_settings"); + QWidget *fake; + + if(w) + fake = w; + else + { + pushApply->setEnabled(false); + pushOK->setEnabled(false); + + QTextEdit *t = new QTextEdit(i18n("Error loading widget from %1. Please check your installation or contact ksquirrel.iv@gmail.com").arg(path), QString::null, groupBox); + t->setReadOnly(true); + fake = t; + } + + fake->reparent(groupBox, QPoint(0,0), true); + + QGridLayout *grid = new QGridLayout(groupBox, 1, 1, 11, 6); + grid->addMultiCellWidget(fake, 1, 1, 0, 3); + + QSpacerItem *spacer = new QSpacerItem(15, 1, QSizePolicy::Minimum, QSizePolicy::Expanding); + grid->addItem(spacer, 2, 1); +} + +void SQ_CodecSettingsSkeleton::recursivelyReadWrite(fmt_settings &settings, bool r) +{ + if(!w) + return; + + QObjectList *ch = const_cast(w->children()); + fmt_settings::iterator t; + + for(QObjectList::iterator it = ch->begin();it != ch->end();++it) + { + t = settings.find((*it)->name()); + + if((*it)->inherits("QCheckBox")) + { + QCheckBox *c = dynamic_cast(*it); + + if(c && t != settings.end()) + { + if(r) + c->setChecked((*t).second.bVal); + else + (*t).second.bVal = c->isChecked(); + } + } + else if((*it)->inherits("QButtonGroup")) + { + QButtonGroup *c = dynamic_cast(*it); + + if(c && t != settings.end()) + { + if(r) + c->setButton((*t).second.iVal); + else + (*t).second.iVal = c->selectedId(); + } + } + else if((*it)->inherits("QSlider")) + { + QSlider *c = dynamic_cast(*it); + + if(c && t != settings.end()) + { + if(r) + c->setValue((*t).second.iVal); + else + (*t).second.iVal = c->value(); + } + } + else if((*it)->inherits("KURLRequester")) + { + KURLRequester *u = dynamic_cast(*it); + + if(u && t != settings.end()) + { + if(r) + u->setURL((*t).second.sVal); + else + { + KURL url = u->url(); // get rid of "file://" if present + (*t).second.sVal = url.isEmpty() ? "" : url.path().ascii(); + } + } + } + else if((*it)->inherits("KDoubleSpinBox")) + { + KDoubleSpinBox *d = dynamic_cast(*it); + + if(d && t != settings.end()) + { + if(r) + d->setValue((*t).second.dVal); + else + (*t).second.dVal = d->value(); + } + } + // QSpinBox should be checked after KDoubleSpinBox ! + else if((*it)->inherits("QSpinBox")) + { + QSpinBox *c = dynamic_cast(*it); + + if(c && t != settings.end()) + { + if(r) + c->setValue((*t).second.iVal); + else + (*t).second.iVal = c->value(); + } + } + else if((*it)->inherits("KColorButton")) + { + KColorButton *c = dynamic_cast(*it); + + if(c && t != settings.end()) + { + if(r) + c->setColor(QColor((*t).second.sVal)); + else + (*t).second.sVal = c->color().name().ascii(); + } + } + } +} + +int SQ_CodecSettingsSkeleton::exec(fmt_settings &settings) +{ + // read settings + recursivelyReadWrite(settings, true); + + sett = &settings; + + int result = QDialog::exec(); + + // save settings + if(result == QDialog::Accepted) + recursivelyReadWrite(settings, false); + + return result; +} + +void SQ_CodecSettingsSkeleton::setCodecInfo( const QPixmap &pixmap, const QString &text ) +{ + codecIcon->setPixmap(pixmap); + codecName->setText(text); +} + +void SQ_CodecSettingsSkeleton::slotApply() +{ + recursivelyReadWrite(*sett, false); + emit apply(); +} diff --git a/ksquirrel/sq_config.cpp b/ksquirrel/sq_config.cpp new file mode 100644 index 0000000..960c1af --- /dev/null +++ b/ksquirrel/sq_config.cpp @@ -0,0 +1,36 @@ +/*************************************************************************** + sq_config.cpp - description + ------------------- + begin : ??? ??? 14 2004 + copyright : (C) 2004 by Baryshev Dmitry + email : ksquirrel.iv@gmail.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include "sq_config.h" + +SQ_Config * SQ_Config::m_instance = 0; + +SQ_Config::SQ_Config(QObject *parent) : QObject(parent) +{ + m_instance = this; + + kconf = new KConfig("ksquirrelrc"); +} + +SQ_Config::~SQ_Config() +{ + delete kconf; +} diff --git a/ksquirrel/sq_config.h b/ksquirrel/sq_config.h new file mode 100644 index 0000000..6f2a662 --- /dev/null +++ b/ksquirrel/sq_config.h @@ -0,0 +1,136 @@ +/*************************************************************************** + sq_config.h - description + ------------------- + begin : ??? ??? 14 2004 + copyright : (C) 2004 by Baryshev Dmitry + email : ksquirrel.iv@gmail.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifndef SQ_CONFIG_H +#define SQ_CONFIG_H + +#include +#include + +class KConfig; + +/* + * Class for reading/writing config file + */ + +class SQ_Config : public QObject +{ + public: + SQ_Config(QObject *parent = 0); + ~SQ_Config(); + + static SQ_Config* instance() { return m_instance; } + + void sync(); + + void setGroup(const QString &group); + bool hasGroup(const QString &group) const; + bool deleteGroup( const QString& group, bool bDeep = true, bool bGlobal = false ); + QString readEntry(const QString& pKey, const QString& aDefault = QString::null ) const; + QStringList readListEntry( const QString& pKey, char sep = ',' ) const; + int readNumEntry( const QString& pKey, int nDefault = 0 ) const; + bool readBoolEntry( const QString& pKey, bool bDefault = false ) const; + QRect readRectEntry( const QString& pKey, const QRect* pDefault = 0L ) const; + QPoint readPointEntry( const QString& pKey, const QPoint* pDefault = 0L ) const; + QSize readSizeEntry( const QString& pKey, const QSize* pDefault = 0L ) const; + double readDoubleNumEntry( const QString& pKey, double nDefault = 0.0 ) const; + QValueList readIntListEntry( const QString& pKey ) const; + + void writeEntry( const QString& pKey, const QString& pValue, bool bPersistent = true, bool bGlobal = false, bool bNLS = false ); + void writeEntry( const QString& pKey, const QStringList &rValue, char sep = ',', bool bPersistent = true, bool bGlobal = false, bool bNLS = false ); + void writeEntry( const QString& pKey, int nValue, bool bPersistent = true, bool bGlobal = false, bool bNLS = false ); + void writeEntry( const QString& pKey, bool bValue, bool bPersistent = true, bool bGlobal = false, bool bNLS = false ); + void writeEntry( const QString& pKey, const QRect& rValue, bool bPersistent = true, bool bGlobal = false, bool bNLS = false ); + void writeEntry( const QString& pKey, const QPoint& rValue, bool bPersistent = true, bool bGlobal = false, bool bNLS = false ); + void writeEntry( const QString& pKey, const QSize& rValue, bool bPersistent = true, bool bGlobal = false, bool bNLS = false ); + void writeEntry( const QString& pKey, double nValue, bool bPersistent = true, bool bGlobal = false, char format = 'g', int precision = 6, bool bNLS = false ); + void writeEntry( const QString& pKey, const QValueList& rValue, bool bPersistent = true, bool bGlobal = false, bool bNLS = false ); + + private: + KConfig *kconf; + static SQ_Config *m_instance; +}; + +inline +void SQ_Config::sync() { kconf->sync(); } + +inline +void SQ_Config::setGroup(const QString &group) { kconf->setGroup(group) ; } + +inline +bool SQ_Config::hasGroup(const QString &group) const { return kconf->hasGroup(group) ; } + +inline +bool SQ_Config::deleteGroup(const QString& group, bool bDeep, bool bGlobal) { return kconf->deleteGroup(group, bDeep, bGlobal) ; } + +inline +QString SQ_Config::readEntry(const QString& pKey, const QString& aDefault) const { return kconf->readEntry(pKey, aDefault) ; } + +inline +QStringList SQ_Config::readListEntry(const QString& pKey, char sep) const { return kconf->readListEntry(pKey, sep) ; } + +inline +int SQ_Config::readNumEntry(const QString& pKey, int nDefault) const { return kconf->readNumEntry(pKey, nDefault) ; } + +inline +bool SQ_Config::readBoolEntry(const QString& pKey, bool bDefault) const { return kconf->readBoolEntry(pKey, bDefault ) ; } + +inline +QRect SQ_Config::readRectEntry(const QString& pKey, const QRect* pDefault) const { return kconf->readRectEntry(pKey, pDefault) ; } + +inline +QPoint SQ_Config::readPointEntry(const QString& pKey, const QPoint* pDefault) const { return kconf->readPointEntry(pKey, pDefault) ; } + +inline +QSize SQ_Config::readSizeEntry(const QString& pKey, const QSize* pDefault) const { return kconf->readSizeEntry(pKey, pDefault) ; } + +inline +double SQ_Config::readDoubleNumEntry(const QString& pKey, double nDefault) const { return kconf->readDoubleNumEntry(pKey, nDefault); } + +inline +QValueList SQ_Config::readIntListEntry( const QString& pKey ) const { return kconf->readIntListEntry(pKey); } + +/**********************************************/ + +inline +void SQ_Config::writeEntry(const QString& pKey, const QString& pValue, bool bPersistent, bool bGlobal, bool bNLS) { kconf->writeEntry( pKey, pValue, bPersistent, bGlobal, bNLS ) ; } + +inline +void SQ_Config::writeEntry(const QString& pKey, const QStringList &rValue, char sep, bool bPersistent, bool bGlobal, bool bNLS ) { kconf->writeEntry(pKey, rValue, sep, bPersistent, bGlobal, bNLS ) ; } + +inline +void SQ_Config::writeEntry(const QString& pKey, int nValue, bool bPersistent, bool bGlobal, bool bNLS ) { kconf->writeEntry(pKey, nValue, bPersistent, bGlobal, bNLS ) ; } + +inline +void SQ_Config::writeEntry(const QString& pKey, bool bValue, bool bPersistent, bool bGlobal, bool bNLS ) { kconf->writeEntry(pKey, bValue, bPersistent, bGlobal, bNLS ) ; } + +inline +void SQ_Config::writeEntry(const QString& pKey, const QRect& rValue, bool bPersistent, bool bGlobal, bool bNLS ) { kconf->writeEntry(pKey, rValue, bPersistent, bGlobal, bNLS ) ; } + +inline +void SQ_Config::writeEntry(const QString& pKey, const QPoint& rValue, bool bPersistent, bool bGlobal, bool bNLS ) { kconf->writeEntry(pKey, rValue, bPersistent, bGlobal, bNLS ) ; } + +inline +void SQ_Config::writeEntry(const QString& pKey, const QSize& rValue, bool bPersistent, bool bGlobal, bool bNLS ) { kconf->writeEntry(pKey,rValue, bPersistent, bGlobal, bNLS ) ; } + +inline +void SQ_Config::writeEntry( const QString& pKey, double nValue, bool bPersistent, bool bGlobal, char format, int precision, bool bNLS) { kconf->writeEntry(pKey, nValue, bPersistent, bGlobal, format, precision, bNLS); } + +inline +void SQ_Config::writeEntry( const QString& pKey, const QValueList& rValue, bool bPersistent, bool bGlobal, bool bNLS) { kconf->writeEntry(pKey, rValue, bPersistent, bGlobal, bNLS); } + +#endif diff --git a/ksquirrel/sq_dir.cpp b/ksquirrel/sq_dir.cpp new file mode 100644 index 0000000..4f0064a --- /dev/null +++ b/ksquirrel/sq_dir.cpp @@ -0,0 +1,92 @@ +/*************************************************************************** + sq_dir.cpp - description + ------------------- + begin : ??? ??? 20 2004 + copyright : (C) 2004 by Baryshev Dmitry + email : ksquirrel.iv@gmail.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include +#include +#include +#include + +#include + +#include "sq_dir.h" +#include "sq_thumbnailinfo.h" + +SQ_Dir::SQ_Dir() : QDir() +{} + +SQ_Dir::SQ_Dir(Prefix p) : QDir() +{ + switch(p) + { + case SQ_Dir::DirectoryBasket: + setRoot("directorybasket"); + break; + case SQ_Dir::Basket: + setRoot("basket"); + break; + case SQ_Dir::Categories: + setRoot("categories"); + break; + } +} + +SQ_Dir::~SQ_Dir() +{} + +/* + * Create relative directory in storage. + * + * For example, if prefix == Thumbnails, + * mkdir("/mnt/win_c") will create + * ~/.ksquirrel/thumbnails/mnt/win_c. + */ +bool SQ_Dir::mkdir(const QString &relpath) +{ + QStringList paths = QStringList::split('/', QDir::cleanDirPath(relpath)); + + cd(m_root); + + // recursively create directories + for(QStringList::iterator it = paths.begin();it != paths.end();++it) + { + if(!exists(*it, false)) + if(!QDir::mkdir(*it)) + return false; + + cd(*it); + } + + return true; +} + +void SQ_Dir::setRoot(const QString &name) +{ + m_root = QDir::cleanDirPath(homeDirPath() + QDir::separator() + QString::fromLatin1(".ksquirrel")); + QDir::mkdir(m_root); + + m_root = QDir::cleanDirPath(m_root + QDir::separator() + name); + QDir::mkdir(m_root); +} + +QString SQ_Dir::absPath(const KURL &relurl) +{ + return m_root + QDir::separator() + relurl.path(); +} diff --git a/ksquirrel/sq_dir.h b/ksquirrel/sq_dir.h new file mode 100644 index 0000000..20ca543 --- /dev/null +++ b/ksquirrel/sq_dir.h @@ -0,0 +1,104 @@ +/*************************************************************************** + sq_dir.h - description + ------------------- + begin : ??? ??? 20 2004 + copyright : (C) 2004 by Baryshev Dmitry + email : ksquirrel.iv@gmail.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifndef SQ_DIR_H +#define SQ_DIR_H + +#include + +#include + +class KURL; + +/* + * Class for managing application-specific data. It takes care + * of storing thumbnails, unpacked archives. + * + * All data stored in ~/.ksquirrel (called 'storage'). + * + * Objects of this class are used by SQ_Archivehandler, SQ_PixmapCache, + * SQ_ThumbnailJob etc. + */ + +class SQ_Dir : public QDir +{ + public: + enum Prefix { + + DirectoryBasket, + + // image basket cache + Basket, + + // image categories (~/.ksquirrel/categories). + Categories}; + + /* + * don't create root directory + */ + SQ_Dir(); + + /* + * create root directory according to Prefix + */ + SQ_Dir(Prefix); + ~SQ_Dir(); + + /* + * Create relative directory in storage. + * + * For example, if prefix == Thumbnails, + * mkdir("/mnt/win_c") will create + * ~/.ksquirrel/thumbnails/mnt/win_c. + * + * Return true, if operation succeded. + */ + bool mkdir(const QString &relpath); + + /* + * Get current root directory. + * + * For example, if prefix == Basket, it will + * return "/home/krasu/.ksquirrel/basket". + */ + virtual QString root() const; + + /* + * Get absolute path for relative path 'relpath'. + * + * Reimplemented in SQ_DirThumbs to handle MD5-encoded + * urls. + */ + virtual QString absPath(const KURL &relurl); + + private: + /* + * Internal, used by mkdir(). + */ + virtual void setRoot(const QString &name); + + protected: + QString m_root; +}; + +inline +QString SQ_Dir::root() const +{ + return m_root; +} + +#endif diff --git a/ksquirrel/sq_diroperator.cpp b/ksquirrel/sq_diroperator.cpp new file mode 100644 index 0000000..95efef0 --- /dev/null +++ b/ksquirrel/sq_diroperator.cpp @@ -0,0 +1,1074 @@ +/*************************************************************************** + sq_diroperator.cpp - description + ------------------- + begin : Mon Mar 15 2004 + copyright : (C) 2004 by Baryshev Dmitry + email : ksquirrel.iv@gmail.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "ksquirrel.h" +#include "sq_archivehandler.h" +#include "sq_diroperator.h" +#include "sq_fileiconview.h" +#include "sq_filethumbview.h" +#include "sq_filethumbviewitem.h" +#include "sq_filedetailview.h" +#include "sq_widgetstack.h" +#include "sq_config.h" +#include "sq_glview.h" +#include "sq_glwidget.h" +#include "sq_thumbnailsize.h" +#include "sq_pixmapcache.h" +#include "sq_libraryhandler.h" +#include "sq_externaltool.h" +#include "sq_popupmenu.h" +#include "sq_navigatordropmenu.h" +#include "sq_previewwidget.h" +#include "sq_treeview.h" +#include "sq_progress.h" +#include "sq_downloader.h" +#include "sq_hloptions.h" + +#include "sq_categoriesview.h" +#include "sq_categorybrowsermenu.h" +#include "sq_imagebasket.h" +#include "sq_converter.h" +#include "sq_directorybasket.h" + +static const int SQ_MAX_WORD_LENGTH = 50; + +SQ_DirOperator::SQ_DirOperator(const KURL &url, ViewT type_, QWidget *parent, const char *name) + : KDirOperator(url, parent, name), type(type_) +{ + usenew = false; + + totalSize = static_cast(0); + + // create and insert new actions in context menu + setupActionsMy(); + + connect(this, SIGNAL(finishedLoading()), this, SLOT(slotFinishedLoading())); + connect(this, SIGNAL(updateInformation(int,int)), this, SLOT(slotUpdateInformation(int,int))); + connect(this, SIGNAL(urlEntered(const KURL&)), this, SLOT(slotUrlEntered(const KURL&))); + connect(this, SIGNAL(dropped(const KFileItem *, QDropEvent*, const KURL::List&)), + this, SLOT(slotDropped(const KFileItem *, QDropEvent*, const KURL::List&))); + connect(this, SIGNAL(fileSelected(const KFileItem *)), this, SLOT(slotExecutedConst(const KFileItem *))); + + connect(dirLister(), SIGNAL(deleteItem(KFileItem *)), this, SLOT(slotItemDeleted(KFileItem *))); + connect(dirLister(), SIGNAL(newItems(const KFileItemList &)), this, SLOT(slotNewItems(const KFileItemList &))); + connect(dirLister(), SIGNAL(refreshItems(const KFileItemList &)), this, SLOT(slotRefreshItems(const KFileItemList &))); + + timer_preview = new QTimer(this); + connect(timer_preview, SIGNAL(timeout()), this, SLOT(slotPreview())); + + setAcceptDrops(true); + + fileview = 0; + oldCurrentItem = 0; + + fireDiskSize(url); + + down = new SQ_Downloader(this, "SQ_Downloader [dirop]"); + connect(down, SIGNAL(result(const KURL &)), this, SLOT(slotDownloaderResult(const KURL &))); + connect(down, SIGNAL(percents(int)), this, SLOT(slotDownloadPercents(int))); + + connect(SQ_ArchiveHandler::instance(), SIGNAL(unpack(const KURL &)), this, SLOT(slotSetURL(const KURL &))); + + // read sorting settings + SQ_Config::instance()->setGroup("Fileview"); + int sorting = 0; + + if(SQ_Config::instance()->readBoolEntry("sorting_name", true)) sorting |= QDir::Name; + if(SQ_Config::instance()->readBoolEntry("sorting_time", false)) sorting |= QDir::Time; + if(SQ_Config::instance()->readBoolEntry("sorting_size", false)) sorting |= QDir::Size; + if(SQ_Config::instance()->readBoolEntry("sorting_dirs", true)) sorting |= QDir::DirsFirst; + if(SQ_Config::instance()->readBoolEntry("sorting_reverse", false)) sorting |= QDir::Reversed; + if(SQ_Config::instance()->readBoolEntry("sorting_ignore", false)) sorting |= QDir::IgnoreCase; + + actionHidden = dynamic_cast(actionCollection()->action("show hidden")); + + if(SQ_Config::instance()->readBoolEntry("show hidden", false) && actionHidden) + { + actionHidden->setChecked(false); + actionHidden->activate(); + } + + setSorting(static_cast(sorting)); + setEnableDirHighlighting(true); +} + +SQ_DirOperator::~SQ_DirOperator() +{} + +void SQ_DirOperator::slotUrlEntered(const KURL &url) +{ + usenew = false; + + totalSize = static_cast(0); + + clearListers(); + + SQ_WidgetStack::instance()->setURLForCurrent(url); + + fireDiskSize(url); +} + +void SQ_DirOperator::fireDiskSize(const KURL &url) +{ + if(url.isLocalFile()) + { + KDiskFreeSp *sp = KDiskFreeSp::findUsageInfo(url.path()); + + connect(sp, SIGNAL(foundMountPoint(const unsigned long&, + const unsigned long&, + const unsigned long&, + const QString&)), + this, SLOT(slotFoundMountPoint(const unsigned long&, + const unsigned long&, + const unsigned long&, + const QString&))); + } + else + { + KSquirrel::app()->diskProgress()->flush(); + KSquirrel::app()->diskProgress()->setTotalSteps(1); + KSquirrel::app()->diskProgress()->setIndicator(0); + KSquirrel::app()->diskProgress()->update(); + KSquirrel::app()->sbarWidget("diskSpace")->setText(i18n("remote filesystem")); + QToolTip::remove(KSquirrel::app()->sbarWidget("diskSpace")); + } +} + +void SQ_DirOperator::slotFoundMountPoint(const unsigned long &kbSize, + const unsigned long &kbUsed, + const unsigned long &kbAvail, + const QString &mount) +{ + // clear any previous drawing + KSquirrel::app()->diskProgress()->flush(); + + KSquirrel::app()->diskProgress()->setTotalSteps(kbSize); + KSquirrel::app()->diskProgress()->setIndicator(kbSize-kbAvail); // kbSize != kbAvail+kbUsed + KSquirrel::app()->sbarWidget("diskSpace")->setText(QString::fromLatin1("%1: %2/%3") + .arg(mount) + .arg(KIO::convertSizeFromKB(kbAvail)) + .arg(KIO::convertSizeFromKB(kbSize))); + + QToolTip::add(KSquirrel::app()->sbarWidget("diskSpace"), i18n("
Mount point:%1
Total size:%2
Used:%3
Available:%4
") + .arg(mount) + .arg(KIO::convertSizeFromKB(kbSize)) + .arg(KIO::convertSizeFromKB(kbUsed)) + .arg(KIO::convertSizeFromKB(kbAvail)) + ); +} + +void SQ_DirOperator::slotExecutedConst(const KFileItem *fi) +{ + execute(const_cast(fi)); +} + +void SQ_DirOperator::execute(KFileItem *fi) +{ + down->kill(); + + SQ_GLWidget::window()->setOriginalURL(fi->url()); + + if(fi->url().isLocalFile()) + executePrivate(fi); + else if(SQ_LibraryHandler::instance()->maybeSupported(fi->url(), fi->mimetype()) != SQ_LibraryHandler::No) + down->start(fi); +} + +void SQ_DirOperator::slotDownloaderResult(const KURL &url) +{ + SQ_GLWidget::window()->setDownloadPercents(-1); + + if(url.isEmpty()) + return; + + KFileItem fi(KFileItem::Unknown, KFileItem::Unknown, url); + + executePrivate(&fi); +} + +void SQ_DirOperator::prepareView(ViewT t) +{ + type = t; + + if(fileview) + { + oldSelected = *fileview->selectedItems(); + oldCurrentItem = fileview->currentFileItem(); + } + + switch(type) + { + case SQ_DirOperator::TypeDetailed: + { + SQ_FileDetailView *dv; + fileview = dv = new SQ_FileDetailView(this, "detail view"); + + connect(dv, SIGNAL(currentChanged(QListViewItem *)), this, SLOT(slotCurrentChanged(QListViewItem *))); + connect(dv, SIGNAL(selectionChanged()), this, SLOT(slotSelectionChanged())); + connect(dv, SIGNAL(invokeBrowser()), this, SLOT(slotInvokeBrowser())); + connect(KSquirrel::app(), SIGNAL(resetToolTip()), dv, SLOT(slotResetToolTip())); + } + break; + + case SQ_DirOperator::TypeList: + case SQ_DirOperator::TypeIcons: + { + SQ_FileIconView *iv; + fileview = iv = new SQ_FileIconView(this, (type == SQ_DirOperator::TypeIcons) ? "icon view":"list view"); + + connect(iv, SIGNAL(currentChanged(QIconViewItem *)), this, SLOT(slotCurrentChanged(QIconViewItem *))); + connect(iv, SIGNAL(selectionChanged()), this, SLOT(slotSelectionChanged())); + connect(iv, SIGNAL(invokeBrowser()), this, SLOT(slotInvokeBrowser())); + connect(KSquirrel::app(), SIGNAL(resetToolTip()), iv, SLOT(slotResetToolTip())); + + disableSpecificActions(iv); + } + break; + + case SQ_DirOperator::TypeThumbs: + { + SQ_FileThumbView *tv; + fileview = tv = new SQ_FileThumbView(this, "thumb view"); + + connect(tv, SIGNAL(currentChanged(QIconViewItem *)), this, SLOT(slotCurrentChanged(QIconViewItem *))); + connect(tv, SIGNAL(selectionChanged()), this, SLOT(slotSelectionChanged())); + connect(tv, SIGNAL(invokeBrowser()), this, SLOT(slotInvokeBrowser())); + connect(dirLister(), SIGNAL(canceled()), tv, SLOT(stopThumbnailUpdate())); + connect(KSquirrel::app(), SIGNAL(resetToolTip()), tv, SLOT(slotResetToolTip())); + + disableSpecificActions(tv); + } + break; + } +} + +void SQ_DirOperator::slotCurrentChanged(QListViewItem *) +{ + timer_preview->start(SQ_PreviewWidget::instance()->delay(), true); +} + +void SQ_DirOperator::slotCurrentChanged(QIconViewItem *) +{ + timer_preview->start(SQ_PreviewWidget::instance()->delay(), true); +} + +void SQ_DirOperator::slotSelectionChanged() +{ + QString str = i18n("no files selected"); + QPixmap px; + KIO::filesize_t sz = static_cast(0); + int add = 0; + KFileItem *fi = 0; + + // which items are selected ? + for(KFileItem *it = fileview->firstFileItem();it;it = fileview->nextItem(it)) + { + if(fileview->isSelected(it)) + { + // _current_ fileitem and currently _selected_ fileitem + // may differ, so lets count only first _selected_ item + if(!fi) + fi = it; + + add++; + + // count only files + if(it->isFile()) + sz += it->size(); + } + } + + if(fi) + { + // determine pixmap + px = fi->pixmap(KIcon::SizeSmall); + + // costruct name and size + str = QString("%1 %2 %3") + .arg(KStringHandler::csqueeze(fi->name(), SQ_MAX_WORD_LENGTH)) + .arg(KIO::convertSize(fi->size())) + .arg(add > 1 ? QString("[%1/%2]").arg(KIO::convertSize(sz)).arg(add):""); + } + + // update statusbar + KSquirrel::app()->sbarWidget("fileIcon")->setPixmap(px); + KSquirrel::app()->sbarWidget("fileName")->setText(str); +} + +void SQ_DirOperator::setPreparedView() +{ + setView(fileview); + + fileview->setOnlyDoubleClickSelectsFiles(true); +} + +void SQ_DirOperator::slotDropped(const KFileItem *i, QDropEvent*, const KURL::List &urls) +{ + KURL u = i ? i->url() : url(); + + // setup and show popup menu with actions + SQ_NavigatorDropMenu::instance()->setupFiles(urls, u); + SQ_NavigatorDropMenu::instance()->exec(QCursor::pos()); +} + +// Insert new actions in context menu. +void SQ_DirOperator::setupActionsMy() +{ + new KAction(i18n("Edit file type"), 0, 0, this, SLOT(slotEditMime()), actionCollection(), "dirop_edit_mime"); + + if(SQ_HLOptions::instance()->have_imagebasket) + new KAction(i18n("Add to Basket"), "folder_image", CTRL+Qt::Key_B, this, SLOT(slotAddToBasket()), actionCollection(), "dirop_tobasket"); + + if(SQ_HLOptions::instance()->have_directorybasket) + new KAction(i18n("Add to Folder Basket"), "folder_image", CTRL+Qt::Key_D, this, SLOT(slotAddToDirectoryBasket()), actionCollection(), "dirop_todirbasket"); + + KActionMenu *file = new KActionMenu(i18n("File actions"), actionCollection(), "dirop_file_menu"); + KAction *prop = actionCollection()->action("properties"); + + KAction *reload = actionCollection()->action("mkdir"); + if(reload && reload->shortcut().isNull()) reload->setShortcut(KShortcut(CTRL+Qt::Key_N)); + reload = actionCollection()->action("reload"); + + connect(prop, SIGNAL(enabled(bool)), this, SLOT(slotEnableFileActions(bool))); + + KAction *sep = actionCollection()->action("separator"); + + file->insert(new KAction(i18n("Copy"), "editcopy", KStdAccel::copy(), SQ_WidgetStack::instance(), SLOT(slotFileCopy()), actionCollection(), "dirop_copy")); + file->insert(new KAction(i18n("Cut"), "editcut", KStdAccel::cut(), SQ_WidgetStack::instance(), SLOT(slotFileCut()), actionCollection(), "dirop_cut")); + file->insert(new KAction(i18n("Paste"), "editpaste", KStdAccel::paste(), SQ_WidgetStack::instance(), SLOT(slotFilePaste()), actionCollection(), "dirop_paste")); + file->insert(sep); + file->insert(new KAction(i18n("Copy to..."), 0, Qt::Key_F5, SQ_WidgetStack::instance(), SLOT(slotFileCopyTo()), actionCollection(), "dirop_copyto")); + file->insert(new KAction(i18n("Move to..."), 0, Qt::Key_F6, SQ_WidgetStack::instance(), SLOT(slotFileMoveTo()),actionCollection(), "dirop_cutto")); + file->insert(new KAction(i18n("Link to..."), 0, Qt::Key_F7, SQ_WidgetStack::instance(), SLOT(slotFileLinkTo()), actionCollection(), "dirop_linkto")); + file->insert(sep); + file->insert(new KAction(i18n("Run"), "launch", CTRL+Key_J, SQ_WidgetStack::instance(), SLOT(slotRunSeparately()), actionCollection(), "dirop_runsepar")); + file->insert(new KAction(i18n("Repeat (nothing to repeat)"), "down", Qt::Key_F10, KSquirrel::app(), SLOT(slotRepeat()), actionCollection(), "dirop_repeat")); + file->insert(new KAction(i18n("Convert..."), 0, CTRL+Qt::Key_K, SQ_Converter::instance(), SLOT(slotStartEdit()), actionCollection(), "dirop_convert")); + + file->insert(sep); + file->insert(new KAction(i18n("Recreate selected thumbnails"), "reload", CTRL+Qt::Key_R, SQ_WidgetStack::instance(), + SLOT(slotRecreateThumbnail()), actionCollection(), "dirop_recreate_thumbnails")); + file->insert(sep); + file->insert(new KAction(i18n("Copy file path"), 0, Qt::Key_F8, this, SLOT(slotCopyPath()), actionCollection(), "dirop_copypath")); + file->insert(new KAction(i18n("Copy file url"), 0, Qt::Key_F9, this, SLOT(slotCopyURL()), actionCollection(), "dirop_copyurl")); + + if(reload) reload->setShortcut(CTRL+Qt::Key_F5); +} + +void SQ_DirOperator::slotEnableFileActions(bool e) +{ + actionCollection()->action("dirop_tobasket")->setEnabled(e); + actionCollection()->action("dirop_todirbasket")->setEnabled(e); + + actionCollection()->action("dirop_copy")->setEnabled(e); + actionCollection()->action("dirop_cut")->setEnabled(e); + actionCollection()->action("dirop_copyto")->setEnabled(e); + actionCollection()->action("dirop_cutto")->setEnabled(e); + actionCollection()->action("dirop_linkto")->setEnabled(e); + + actionCollection()->action("dirop_runsepar")->setEnabled(e); + actionCollection()->action("dirop_convert")->setEnabled(e); + + actionCollection()->action("dirop_copypath")->setEnabled(e); + actionCollection()->action("dirop_copyurl")->setEnabled(e); + + actionCollection()->action("dirop_recreate_thumbnails")->setEnabled(type == SQ_DirOperator::TypeThumbs && e); + SQ_ExternalTool::instance()->constPopupMenu()->setEnabled(e); + + if(SQ_HLOptions::instance()->have_categories) + SQ_CategoriesBox::instance()->popupMenu()->setEnabled(e); +} + +void SQ_DirOperator::slotCopyPath() +{ + KFileItem *f = fileview->currentFileItem(); + + if(f) + QApplication::clipboard()->setText(f->url().path()); +} + +void SQ_DirOperator::slotCopyURL() +{ + KFileItem *f = fileview->currentFileItem(); + + if(f) + QApplication::clipboard()->setText(f->url().prettyURL()); +} + +void SQ_DirOperator::slotEditMime() +{ + KFileItem *f = fileview->currentFileItem(); + + if(f) + KonqOperations::editMimeType(f->mimetype()); +} + +void SQ_DirOperator::slotAddToBasket() +{ + SQ_ImageBasket::instance()->add(*selectedItems()); +} + +void SQ_DirOperator::slotAddToDirectoryBasket() +{ + SQ_DirectoryBasket::instance()->add(*selectedItems()); +} + +void SQ_DirOperator::slotFinishedLoading() +{ + // force sort if invisible + if(!isVisible()) + { + // derived from KFileDetailView + if(type == SQ_DirOperator::TypeDetailed) + { + KFileDetailView *dv = dynamic_cast(fileview); + if(dv) dv->sort(); + } + // derived from KFileIconView + else + { + KFileIconView *tv = dynamic_cast(fileview); + if(tv) tv->sort(!tv->isReversed()); + } + } + + int dirs = numDirs(), files = numFiles(); + int total = dirs+files; + + slotUpdateInformation(files, dirs); + + if(lasturl.equals(url(), true)) + return; + else + { + lasturl = url(); + usenew = true; + } + + // clear QLabels in statusbar, if current directory has + // no files/directories + if(!total) + { + lasturl = KURL(); + usenew = false; + m_pending = QString::null; + KSquirrel::app()->sbarWidget("fileIcon")->clear(); + KSquirrel::app()->sbarWidget("fileName")->clear(); + return; + } + + // setting current file directly doesn't work. let + // events to be processed and only then set current file + QTimer::singleShot(0, this, SLOT(slotDelayedFinishedLoading())); +} + +void SQ_DirOperator::slotDelayedFinishedLoading() +{ + // select pending file if any + if(!m_pending.isEmpty()) + { + if(fileview) + { + fileview->clearSelection(); + fileview->setCurrentItem(m_pending); + setCurrentItem(fileview->currentFileItem()); + } + + m_pending = QString::null; + startOrNotThumbnailUpdate(); + + return; + } + + KURL up_url = url().upURL(); + + KFileItem *first = fileview->firstFileItem(); + + if(!first) return; + + // ignore ".." item + if(up_url.equals(first->url(), true)) + first = fileview->nextItem(first); + + // hell! + if(!first) return; + + SQ_Config::instance()->setGroup("Fileview"); + + bool goto_first = false; + + // SQ_WidgetStack will select first supported image for us + if(SQ_Config::instance()->readBoolEntry("tofirst", true)) + goto_first = SQ_WidgetStack::instance()->moveTo(SQ_WidgetStack::Next, first) == SQ_WidgetStack::moveFailed; + else + goto_first = true; + + if(goto_first) + { + KFileItem *fi = fileview->currentFileItem(); + + if(fi && !up_url.equals(fi->url(), true)) + setCurrentItem(fileview->currentFileItem()); + else + setCurrentItem(first); + } + + startOrNotThumbnailUpdate(); +} + +void SQ_DirOperator::slotUpdateInformation(int files, int dirs) +{ + int total = dirs + files; + + SQ_Config::instance()->setGroup("Fileview"); + + QString str = i18n("Total %1 in %2 (%3, %4)") + .arg(KIO::convertSize(totalSize)) + .arg(i18n("1 item", "%n items", total)) + .arg(i18n("1 folder", "%n folders", dirs)) + .arg(i18n("1 file", "%n files", files)); + + KSquirrel::app()->sbarWidget("dirInfo")->setText(str); +} + +/* + * Deselect all items, set current item, select this item, + * and ensure it visible. + */ +void SQ_DirOperator::setCurrentItem(KFileItem *item) +{ + // for safety... + if(!item) + return; + + // clear selection + fileview->clearSelection(); + + // set current item and select it + fileview->setCurrentItem(item); + fileview->setSelected(item, true); + + // make this item visible + fileview->ensureItemVisible(item); +} + +/* + * Change thumbnail size. KSquirrel will emit thumbSizeChanged() signal, and + * diroperator will catch it. Only diroperator, which manages SQ_FileThumbView + * won't ignore this signal. See also SQ_WidgetStack::raiseWidget(). + */ +void SQ_DirOperator::slotSetThumbSize(const QString &size) +{ + // for safety... + if(type != SQ_DirOperator::TypeThumbs) + return; + + SQ_FileThumbView *tv = dynamic_cast(fileview); + + SQ_ThumbnailSize::instance()->setPixelSize(size); + + tv->rebuildCachedPixmaps(); + + // reinsert files + removeCdUpItem(); + smartUpdate(); + + // finally, update thumbnails + startOrNotThumbnailUpdate(); +} + +/* + * Smart update. Store all file items, reset view, + * and transfer all items back. + * + * Taken from kdelibs-3.2.3/kio/kfile/kdiroperator.cpp + */ +void SQ_DirOperator::smartUpdate() +{ + // store old file items + KFileItemList items = *fileview->items(); + oldSelected = *fileview->selectedItems(); + oldCurrentItem = fileview->currentFileItem(); + + // heh, 'items' now contains "..", we should remove it! + removeCdUpItem(); + + // clear view and add items (see SQ_FileThumbView::insertItem() for more) + fileview->clear(); + + if(type == SQ_DirOperator::TypeThumbs) + { + SQ_Config::instance()->setGroup("Thumbnails"); + + int newgrid = SQ_ThumbnailSize::instance()->extended() ? + SQ_ThumbnailSize::instance()->extendedSize().width() + : SQ_ThumbnailSize::instance()->pixelSize(); + + newgrid += (SQ_Config::instance()->readNumEntry("margin", 2) + 2); + + SQ_FileThumbView *tv = dynamic_cast(fileview); + + tv->setGridX(newgrid); + tv->arrangeItemsInGrid(); + } + + fileview->addItemList(items); + + selectOld(); +} + +void SQ_DirOperator::selectOld() +{ + // set current item... + fileview->setCurrentItem(oldCurrentItem); + + // restore selection + KFileItemListIterator it(oldSelected); + + fileview->ensureItemVisible(it.current()); + + for(; it.current();++it) + fileview->setSelected(it.current(), true); + + oldSelected.clear(); + + stopPreview(); +} + +/* + * Remove ".." from currently listed items + */ +void SQ_DirOperator::removeCdUpItem() +{ + // for safety... + if(!fileview) + return; + + KFileItemList m_items = *fileview->items(); + KFileItemListIterator it_s(m_items); + KURL up_url = url().upURL(); + + for(; it_s.current();++it_s) + { + if(it_s.current()->url() == up_url) + { + fileview->removeItem(it_s.current()); + break; + } + } +} + +void SQ_DirOperator::startOrNotThumbnailUpdate() +{ + // start delayed thumbnail update, if needed + if(type == SQ_DirOperator::TypeThumbs) + { + SQ_FileThumbView *tv = dynamic_cast(fileview); + + // start thumbnail update only when this + // diroperator is visible + if(tv) + { + if(tv->isVisible()) + tv->startThumbnailUpdate(); + else + tv->waitForShowEvent(); + } + } +} + +void SQ_DirOperator::clearListers() +{ + SQ_Listers::iterator itEnd = listers.end(); + + // delete all listers + for(SQ_Listers::iterator it = listers.begin();it != itEnd;++it) + delete it.data(); + + listers.clear(); +} + +void SQ_DirOperator::urlAdded(const KURL &_url) +{ + // avoid duplications + if(listers.contains(_url) || _url.equals(url(), true)) + return; + + KDirLister *lister = new KDirLister(true); + + lister->setMainWindow(dirLister()->mainWindow()); + + // redirect all signals to dirLister() - nice hack + connect(lister, SIGNAL(refreshItems(const KFileItemList &)), dirLister(), SIGNAL(refreshItems(const KFileItemList &))); + connect(lister, SIGNAL(deleteItem(KFileItem *)), dirLister(), SIGNAL(deleteItem(KFileItem *))); + connect(lister, SIGNAL(newItems(const KFileItemList &)), dirLister(), SIGNAL(newItems(const KFileItemList &))); + + connect(lister, SIGNAL(started(const KURL &)), dirLister(), SIGNAL(started(const KURL &))); + connect(lister, SIGNAL(completed()), dirLister(), SIGNAL(completed())); + connect(lister, SIGNAL(canceled()), dirLister(), SIGNAL(canceled())); + + // save this lister for us + listers[_url] = lister; + + lister->openURL(_url); +} + +void SQ_DirOperator::urlRemoved(const KURL &url) +{ + // for safety + SQ_Listers::iterator it = listers.find(url); + + if(it == listers.end()) + return; + + KDirLister *lister = it.data(); + + KFileItemList list = lister->items(); + + // start delayed thumbnail update, if needed + if(type == SQ_DirOperator::TypeThumbs) + { + SQ_FileThumbView *tv = dynamic_cast(fileview); + + if(tv && tv->updateRunning()) + tv->itemsRemoved(list); + } + + SQ_Config::instance()->setGroup("Fileview"); + bool c = SQ_Config::instance()->readBoolEntry("calculate", true); + + for(KFileItem *itit_tvoyu_mats = list.first();itit_tvoyu_mats;itit_tvoyu_mats = list.next()) + { + itemDeleted(itit_tvoyu_mats); + + if(c) totalSize -= itit_tvoyu_mats->size(); + } + + slotUpdateInformation(numFiles(), numDirs()); + + // remove this lister from map + listers.remove(url); + + delete lister; + + // update view + KFileIconView *vi = dynamic_cast(fileview); + + if(vi) + vi->arrangeItemsInGrid(); +} + +void SQ_DirOperator::executePrivate(KFileItem *fi) +{ + KURL url = fi->url(); + QString fullpath = url.path(); + QFileInfo fm(fullpath); + + // Ok, this file is image file. Let's try to load it + if(SQ_LibraryHandler::instance()->libraryForFile(fullpath)) + SQ_GLWidget::window()->startDecoding(fullpath); + else + { + SQ_Config::instance()->setGroup("Fileview"); + + // archive ? + if(!SQ_ArchiveHandler::instance()->findProtocolByFile(fi).isEmpty()) + if(SQ_Config::instance()->readBoolEntry("archives", true)) + SQ_ArchiveHandler::instance()->tryUnpack(fi); + else; + // not image, not archive. Read settings and run this file separately + // with default application (if needed). + else if(SQ_Config::instance()->readBoolEntry("run unknown", false)) + emit runSeparately(fi); + } +} + +void SQ_DirOperator::disableSpecificActions(KFileIconView *v) +{ + KAction *a; + + a = v->actionCollection()->action("zoomIn"); + if(a) a->setEnabled(false); + + a = v->actionCollection()->action("zoomOut"); + if(a) a->setEnabled(false); + + a = v->actionCollection()->action("show previews"); + if(a) a->setEnabled(false); +} + +void SQ_DirOperator::slotPreview() +{ + KFileItem *fi = fileview ? fileview->currentFileItem() : 0; + + if(fi) SQ_PreviewWidget::instance()->load(fi->url()); +} + +void SQ_DirOperator::slotNewItems(const KFileItemList &list) +{ + SQ_Config::instance()->setGroup("Fileview"); + + if(SQ_Config::instance()->readBoolEntry("calculate", true)) + { + KFileItemListIterator it(list); + KFileItem *fi; + + while((fi = it.current()) != 0) + { + ++it; + if(fi->isFile()) totalSize += fi->size(); + } + } + + // start delayed thumbnail update, if needed + if(type == SQ_DirOperator::TypeThumbs && usenew) + { + SQ_FileThumbView *tv = dynamic_cast(fileview); + + if(tv) + tv->addItemsToJob(list); + } +} + +void SQ_DirOperator::slotRefreshItems(const KFileItemList &list) +{ + KFileItemListIterator it(list); + KFileItem *fci = fileview ? fileview->currentFileItem() : 0; + KFileItem *fi; + + // refresh image been previewed + while((fi = it.current())) + { + if(fi == fci) + { + timer_preview->start(SQ_PreviewWidget::instance()->delay(), true); + break; + } + + ++it; + } + + // start delayed thumbnail update, if needed + if(type == SQ_DirOperator::TypeThumbs) + { + SQ_FileThumbView *tv = dynamic_cast(fileview); + + if(tv) + { + KFileItemListIterator it(list); + SQ_FileThumbViewItem *tfi; + + if(tv->updateRunning()) + tv->itemsRemoved(list); + + while((fi = it.current())) + { + // force thumbnail to be updated by setting listed = false + tfi = reinterpret_cast(fi->extraData(tv)); + + if(tfi) + tfi->setListed(false); + + // remove thumbnail from pixmap cache and from disk + SQ_PixmapCache::instance()->removeEntryFull(fi->url().path()); + ++it; + } + + tv->addItemsToJob(list, false); + } + } +} + +/* + * Invoked, when some item has been deleted. We should + * remove appropriate thumbnail from pixmap cache. + */ +void SQ_DirOperator::slotItemDeleted(KFileItem *item) +{ + if(!item) return; + + itemKill(item); + + // remove thumbnail from cache, + SQ_PixmapCache::instance()->removeEntryFull(item->url()); +} + +void SQ_DirOperator::itemKill(KFileItem *item) +{ + if(!item) return; + + SQ_Config::instance()->setGroup("Fileview"); + if(SQ_Config::instance()->readBoolEntry("calculate", true)) + totalSize -= item->size(); + + slotUpdateInformation(numFiles(), numDirs()); + + // start delayed thumbnail update, if needed + if(type == SQ_DirOperator::TypeThumbs) + { + SQ_FileThumbView *tv = dynamic_cast(fileview); + + if(tv && tv->updateRunning()) + tv->itemRemoved(item); + } +} + +void SQ_DirOperator::stopPreview() +{ + timer_preview->stop(); +} + +void SQ_DirOperator::activatedMenu(const KFileItem *, const QPoint &pos) +{ + // remove "View" submenu, since we will insert our's one. + setupMenu(KDirOperator::AllActions ^ KDirOperator::ViewActions); + updateSelectionDependentActions(); + + KActionMenu *pADirOperatorMenu = dynamic_cast(actionCollection()->action("popupMenu")); + + pADirOperatorMenu->insert(actionCollection()->action("dirop_edit_mime")); + pADirOperatorMenu->insert(actionCollection()->action("separator")); + + if(SQ_HLOptions::instance()->have_categories) + pADirOperatorMenu->popupMenu()->insertItem(i18n("Add to &Category"), SQ_CategoriesBox::instance()->popupMenu()); + + if(SQ_HLOptions::instance()->have_imagebasket) + pADirOperatorMenu->insert(actionCollection()->action("dirop_tobasket")); + + if(SQ_HLOptions::instance()->have_directorybasket) + pADirOperatorMenu->insert(actionCollection()->action("dirop_todirbasket")); + + pADirOperatorMenu->popupMenu()->insertItem(i18n("File actions"), dynamic_cast(actionCollection()->action("dirop_file_menu"))->popupMenu(), -1, 0); + pADirOperatorMenu->popupMenu()->insertItem(i18n("&External tools"), SQ_ExternalTool::instance()->constPopupMenu(), -1, 1); + pADirOperatorMenu->popupMenu()->insertSeparator(2); + + KFileItemList *items = const_cast(selectedItems()); + + if(items) + SQ_ExternalTool::instance()->setItems(*items); + + pADirOperatorMenu->popup(pos); +} + +void SQ_DirOperator::slotSetURL(const KURL &url) +{ + setURL(url, true); +} + +void SQ_DirOperator::calcTotalSize() +{ + totalSize = static_cast(0); + + KFileItemList *list = const_cast(fileview->items()); + + if(!list) return; + + KFileItemListIterator it(*list); + KFileItem *fi; + + while((fi = it.current()) != 0) + { + ++it; + + if(fi->isFile()) + totalSize += fi->size(); + } + + slotUpdateInformation(numFiles(), numDirs()); +} + +void SQ_DirOperator::saveConfig() +{ + QDir::SortSpec sort = sorting(); + + SQ_Config::instance()->writeEntry("sorting_name", KFile::isSortByName(sort)); + SQ_Config::instance()->writeEntry("sorting_time", KFile::isSortByDate(sort)); + SQ_Config::instance()->writeEntry("sorting_size", KFile::isSortBySize(sort)); + SQ_Config::instance()->writeEntry("sorting_dirs", KFile::isSortDirsFirst(sort)); + SQ_Config::instance()->writeEntry("sorting_reverse", (sort & QDir::Reversed) == QDir::Reversed); + SQ_Config::instance()->writeEntry("sorting_ignore", KFile::isSortCaseInsensitive(sort)); + + SQ_Config::instance()->writeEntry("show hidden", showHiddenFiles()); +} + +void SQ_DirOperator::setLazy(bool l, int delay, int rows) +{ + if(type == SQ_DirOperator::TypeThumbs) + { + SQ_FileThumbView *tv = dynamic_cast(fileview); + + if(tv) + { + if(tv->lazy() != l) + tv->setLazy(l, delay); + + tv->setAddRows(rows); + + if(tv->updateRunning()) + tv->startThumbnailUpdate(); + } + } +} + +void SQ_DirOperator::slotInvokeBrowser() +{ + kapp->invokeBrowser(url().prettyURL()); +} + +void SQ_DirOperator::enableThumbnailActions(bool enable) +{ + actionCollection()->action("dirop_recreate_thumbnails")->setEnabled(enable); +} + +void SQ_DirOperator::stopThumbnailUpdate() +{ + if(type == SQ_DirOperator::TypeThumbs) + { + SQ_FileThumbView *tv = dynamic_cast(fileview); + + if(tv && tv->updateRunning()) + tv->stopThumbnailUpdate(); + } +} + +void SQ_DirOperator::slotDownloadPercents(int p) +{ + SQ_GLWidget::window()->setDownloadPercents(p); +} + +#include "sq_diroperator.moc" diff --git a/ksquirrel/sq_diroperator.h b/ksquirrel/sq_diroperator.h new file mode 100644 index 0000000..e466caa --- /dev/null +++ b/ksquirrel/sq_diroperator.h @@ -0,0 +1,291 @@ +/*************************************************************************** + sq_diroperator.h - description + ------------------- + begin : Mon Mar 15 2004 + copyright : (C) 2004 by Baryshev Dmitry + email : ksquirrel.iv@gmail.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifndef SQ_DIROPERATOR_H +#define SQ_DIROPERATOR_H + +#include + +#include + +class QTimer; +class QListViewItem; +class QIconViewItem; + +class KDirLister; +class KFileIconView; +class KFileItem; + +class SQ_Downloader; + +class SQ_DirOperator : public KDirOperator +{ + Q_OBJECT + + public: + /* + * View type. + * + * - list view with small icons + * - icon view with large icons + * - detailed view with file details + * - thumbnail view with image thumbnails + */ + enum ViewT {TypeList = 0, TypeIcons, TypeDetailed, TypeThumbs }; + + /* + * Constructor. Creates diroperator with specified view type. SQ_DirOperatorBase + * reimplements createView() to create different custom views. + * View type is determined by 'type_'. + */ + SQ_DirOperator(const KURL &url = KURL(), ViewT type_ = SQ_DirOperator::TypeList, + QWidget *parent = 0, const char *name = 0); + + ~SQ_DirOperator(); + + void stopThumbnailUpdate(); + + void enableThumbnailActions(bool enable); + + void fireDiskSize(const KURL &url); + + void setLazy(bool l, int delay, int rows); + + /* + * Deselect all items, set current item, select this item, + * and ensure it visible. + */ + void setCurrentItem(KFileItem *item); + + void calcTotalSize(); + + /* + * Save new view type for future use. It means that SQ_WidgetStack + * wants to change view type (for example "list view" => "thumbnail view"), + * and will activate an SQ_DirOperator's action, which will change view type. + * + * See SQ_WidgetStack::raiseWidget() for more. + */ + void prepareView(ViewT); + + KFileView* preparedView(); + + void setPreparedView(); + + void startOrNotThumbnailUpdate(); + + /* + * Is current diropertor manages thumbnail view ? + */ + bool isThumbView() const; + + int viewType() const; + + /* + * Smart update. Store all file items, reset view, + * and transfer all items back. + */ + void smartUpdate(); + + /* + * Remove ".." item from current view + */ + void removeCdUpItem(); + + void stopPreview(); + + void setPendingFile(const QString &p); + + void execute(KFileItem *item); + + void saveConfig(); + + void selectOld(); + + protected: + /* + * Reimplement createView() to create custom views. + */ + virtual KFileView* createView(QWidget *parent, KFile::FileView view); + + private: + void itemKill(KFileItem *); + + void executePrivate(KFileItem *); + + void disableSpecificActions(KFileIconView *); + + /* + * SQ_DirOperator has context menu, derived from KDirOperator. + * This method will change this menu, insert new actions. + */ + void setupActionsMy(); + + void clearListers(); + + signals: + /* + * If user clicked on item, and it is archive file, + * emit this signal. Normally SQ_WidgetStack will catch it. + */ + void tryUnpack(KFileItem *item); + + /* + * Run selected file separately (with default application) + */ + void runSeparately(KFileItem *item); + + public slots: + void urlAdded(const KURL &); + void urlRemoved(const KURL &); + + /* + * Invoked, when current directory has been loaded. + */ + void slotFinishedLoading(); + + /* + * Change thumbnail size. + */ + void slotSetThumbSize(const QString&); + + private slots: + + void slotDownloadPercents(int); + + void slotCopyPath(); + void slotCopyURL(); + + void slotEnableFileActions(bool); + + void slotInvokeBrowser(); + /* + * Since KDE 3.4 (or 3.5 ?) it is neccessary to reimplement this slot + * to insert our own actions in context menu. + */ + void activatedMenu(const KFileItem *, const QPoint &pos); + + void slotDownloaderResult(const KURL &); + + void slotSetURL(const KURL &); + + /* + * Connected to dirLister() + */ + void slotNewItems(const KFileItemList &); + void slotRefreshItems(const KFileItemList &); + + void slotDelayedFinishedLoading(); + + void slotFoundMountPoint(const unsigned long&, + const unsigned long&, + const unsigned long&, + const QString&); + + /* + * Edit current item's mimetype (Konqueror-related action). + */ + void slotEditMime(); + + void slotPreview(); + + void slotDropped(const KFileItem *, QDropEvent*, const KURL::List&); + void slotAddToBasket(); + void slotAddToDirectoryBasket(); + + /* + * Execute item. If current clicking policy is "Single click", + * single click will execute item, and double click otherwise. + */ + void slotExecutedConst(const KFileItem *item); + + /* + * URL entered. + */ + void slotUrlEntered(const KURL&); + + /* + * Invoked, when some item has been deleted. We should + * remove appropriate thumbnail from pixmap cache. + */ + void slotItemDeleted(KFileItem *); + + void slotUpdateInformation(int,int); + + void slotSelectionChanged(); + + void slotCurrentChanged(QListViewItem *); + void slotCurrentChanged(QIconViewItem *); + + private: + typedef QMap SQ_Listers; + SQ_Listers listers; + + /* + * Pointer to current view. All view types (such as icon view, list view ...) + * are derived from KFileView. + */ + KFileView *fileview; + + /* + * Some additional menus. + */ + KActionMenu *pADirOperatorMenu, *pAFileActions, *pAImageActions; + KToggleAction *actionHidden; + + ViewT type; + QTimer *timer_preview; + KURL lasturl; + bool usenew; + QString m_pending; + KIO::filesize_t totalSize; + KFileItemList oldSelected; + KFileItem *oldCurrentItem; + SQ_Downloader *down; +}; + +inline +int SQ_DirOperator::viewType() const +{ + return static_cast(type); +} + +inline +bool SQ_DirOperator::isThumbView() const +{ + return (type == SQ_DirOperator::TypeThumbs); +} + +inline +KFileView* SQ_DirOperator::preparedView() +{ + return fileview; +} + +inline +KFileView* SQ_DirOperator::createView(QWidget *, KFile::FileView) +{ + return fileview; +} + +inline +void SQ_DirOperator::setPendingFile(const QString &p) +{ + m_pending = p; +} + +#endif diff --git a/ksquirrel/sq_dirthumbs.cpp b/ksquirrel/sq_dirthumbs.cpp new file mode 100644 index 0000000..ddeed59 --- /dev/null +++ b/ksquirrel/sq_dirthumbs.cpp @@ -0,0 +1,104 @@ +/*************************************************************************** + sq_dirthumbs.cpp - description + ------------------- + begin : ??? Jul 18 2007 + copyright : (C) 2007 by Baryshev Dmitry + email : ksquirrel.iv@gmail.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#ifdef HAVE_UTIME_H +#include +#include +#endif + +#include +#include +#include + +#include +#include + +#include "sq_dirthumbs.h" +#include "sq_thumbnailinfo.h" + +SQ_DirThumbs::SQ_DirThumbs() : SQ_Dir() +{ + setRoot(); +} + +SQ_DirThumbs::~SQ_DirThumbs() +{} + +/* + * Save thumbnail to storage. + */ +void SQ_DirThumbs::saveThumbnail(const KURL &url, SQ_Thumbnail &thumb) +{ + QString ab = absPath(url); + + if(!thumb.thumbnail.isNull() && needUpdate(ab, thumb.originalTime)) + { + // thumbnail standard tags + thumb.thumbnail.setText("Thumb::Image::Width", 0, QString::number(thumb.w)); + thumb.thumbnail.setText("Thumb::Image::Height", 0, QString::number(thumb.h)); + thumb.thumbnail.setText("Thumb::URI", 0, url.prettyURL()); + thumb.thumbnail.setText("Thumb::MTime", 0, QString::number(thumb.originalTime)); + thumb.thumbnail.setText("Software", 0, "KSquirrel"); + + thumb.thumbnail.save(ab, sqdirThumbFormat, sqdirThumbQuality); + +#ifdef HAVE_UTIME_H + struct utimbuf ut; + ut.actime = thumb.originalTime; + ut.modtime = thumb.originalTime; + utime((const char *)ab, &ut); +#endif + } +} + +QString SQ_DirThumbs::absPath(const KURL &relurl) +{ + KMD5 md5(QFile::encodeName(relurl.prettyURL())); + + QString ext = QString::fromLatin1(".%1").arg(sqdirThumbFormat); + + return m_orig + QDir::separator() + QString(md5.hexDigest()) + ext.lower(); +} + +void SQ_DirThumbs::setRoot() +{ + m_orig = QDir::cleanDirPath(homeDirPath() + QDir::separator() + QString::fromLatin1(".thumbnails")); + QDir::mkdir(m_orig); + + m_orig = QDir::cleanDirPath(m_orig + QDir::separator() + QString::fromLatin1("normal")); + QDir::mkdir(m_orig); +} + +void SQ_DirThumbs::removeFile(const KURL &url) +{ + // determine absolute path and remove file + QFile::remove(absPath(url)); +} + +bool SQ_DirThumbs::needUpdate(const QString &turl, time_t tm) +{ + QFileInfo fthumbpath(turl); + + QDateTime dt_orig; + dt_orig.setTime_t(tm); + + return (dt_orig > fthumbpath.lastModified()); +} diff --git a/ksquirrel/sq_dirthumbs.h b/ksquirrel/sq_dirthumbs.h new file mode 100644 index 0000000..3967310 --- /dev/null +++ b/ksquirrel/sq_dirthumbs.h @@ -0,0 +1,70 @@ +/*************************************************************************** + sq_dirthumbs.h - description + ------------------- + begin : ??? Jul 18 2007 + copyright : (C) 2007 by Baryshev Dmitry + email : ksquirrel.iv@gmail.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifndef SQ_DIR_THUMBS_H +#define SQ_DIR_THUMBS_H + +#include "sq_dir.h" + +struct SQ_Thumbnail; + +class SQ_DirThumbs : public SQ_Dir +{ + public: + SQ_DirThumbs(); + ~SQ_DirThumbs(); + + virtual QString absPath(const KURL &relurl); + + /* + * Save thumbnail to storage. + */ + void saveThumbnail(const KURL &url, SQ_Thumbnail &thumb); + + /* + * Remove file from storage + */ + void removeFile(const KURL &url); + + /* + * Compare 'last modified' time of 'url' + * and thumbnail time. + */ + bool needUpdate(const QString &turl, time_t tm); + + virtual QString root() const; + + private: + /* + * Thumbnail cache will have ~/.thumbnails/normal path + */ + void setRoot(); + + private: + /* + * m_orig to save thumbnails + */ + QString m_orig; +}; + +inline +QString SQ_DirThumbs::root() const +{ + return m_orig; +} + +#endif diff --git a/ksquirrel/sq_downloader.cpp b/ksquirrel/sq_downloader.cpp new file mode 100644 index 0000000..290a1d8 --- /dev/null +++ b/ksquirrel/sq_downloader.cpp @@ -0,0 +1,143 @@ +/*************************************************************************** + sq_downloader.cpp - description + ------------------- + begin : Fri Jun 07 2007 + copyright : (C) 2007 by Baryshev Dmitry + email : ksquirrel.iv@gmail.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#include + +#include +#include +#include + +#include "sq_libraryhandler.h" +#include "sq_downloader.h" + +#ifndef KSQUIRREL_PART +#include "sq_archivehandler.h" +#endif + +#define SQ_PREDOWNLOAD_SIZE 50 + +SQ_Downloader::SQ_Downloader(QObject *parent, const char *name) : QObject(parent, name), job(0), m_error(false) +{ + tmp = new KTempFile; + tmp->setAutoDelete(true); + tmp->close(); +} + +SQ_Downloader::~SQ_Downloader() +{ + clean(); + + delete tmp; +} + +void SQ_Downloader::start(KFileItem *fi) +{ + m_error = false; + mURL = fi->url(); + + emitPercents = false; + startTime = QTime::currentTime(); + size = 0; + totalSize = fi->size(); + +#ifndef KSQUIRREL_PART + nomime = SQ_ArchiveHandler::instance()->findProtocolByMime(fi->mimetype()).isEmpty(); +#else + nomime = true; +#endif + + job = KIO::get(mURL, false, false); + + clean(); + + continueDownload = false; + + connect(job, SIGNAL(data(KIO::Job *, const QByteArray &)), this, SLOT(slotData(KIO::Job *, const QByteArray &))); + connect(job, SIGNAL(result(KIO::Job *)), this, SLOT(slotDataResult(KIO::Job *))); +} + +void SQ_Downloader::slotData(KIO::Job *job, const QByteArray &ba) +{ + size += ba.size(); + + QFile f(tmp->name()); + + if(f.open(IO_WriteOnly | IO_Append)) + { + f.writeBlock(ba); + f.close(); + } + + if(emitPercents || startTime.msecsTo(QTime::currentTime()) > 1000) + { + emit percents(size); + emitPercents = true; + } + + // 50 bytes are enough to determine file type + if(size >= SQ_PREDOWNLOAD_SIZE && !continueDownload && totalSize != size) + { + // cancel download (file type is not supported) + SQ_LIBRARY *lib = SQ_LibraryHandler::instance()->libraryForFile(tmp->name()); + + if(nomime && !lib) + { + job->kill(false); // kill job & emit result + } + else + { + // nice, we can open this image/archive - continue download + continueDownload = true; + } + } +} + +void SQ_Downloader::slotDataResult(KIO::Job *cpjob) +{ + job = 0; + + // job error + if(cpjob->error() && cpjob->error() != KIO::ERR_USER_CANCELED) + { + m_error = true; + emit result(mEmptyURL); + } + else if(cpjob->error() == KIO::ERR_USER_CANCELED) // not supported image/archive type - + // emit empty url without errors + { + emit result(mEmptyURL); + } + else // supported image type/archive type (no errors or job killed) + { + emit result(KURL::fromPathOrURL(tmp->name())); + } +} + +void SQ_Downloader::clean() +{ + QFile f(tmp->name()); + + if(f.open(IO_WriteOnly)) + f.close(); +} + +void SQ_Downloader::kill() +{ + if(job) job->kill(); +} + +#include "sq_downloader.moc" diff --git a/ksquirrel/sq_downloader.h b/ksquirrel/sq_downloader.h new file mode 100644 index 0000000..a51649f --- /dev/null +++ b/ksquirrel/sq_downloader.h @@ -0,0 +1,73 @@ +/*************************************************************************** + sq_downloader.h - description + ------------------- + begin : Fri Jun 07 2007 + copyright : (C) 2007 by Baryshev Dmitry + email : ksquirrel.iv@gmail.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifndef SQ_DOWNLOADER_H +#define SQ_DOWNLOADER_H + +#include +#include + +#include + +class KFileItem; +class KTempFile; + +namespace KIO { class Job; } + +class SQ_Downloader : public QObject +{ + Q_OBJECT + + public: + SQ_Downloader(QObject *parent = 0, const char *name = 0); + ~SQ_Downloader(); + + void start(KFileItem *fi); + + bool error() const; + + void clean(); + + void kill(); + + signals: + void result(const KURL &); + void percents(int); + + private slots: + void slotData(KIO::Job *job, const QByteArray &data); + void slotDataResult(KIO::Job *); + + private: + KIO::Job *job; + KURL mEmptyURL, mURL; + KTempFile *tmp; + KIO::filesize_t totalSize, size; + bool continueDownload; + bool nomime; + bool m_error, m_lightmode; + QTime startTime; + bool emitPercents; +}; + +inline +bool SQ_Downloader::error() const +{ + return m_error; +} + +#endif diff --git a/ksquirrel/sq_dragprovider.cpp b/ksquirrel/sq_dragprovider.cpp new file mode 100644 index 0000000..84ed1e2 --- /dev/null +++ b/ksquirrel/sq_dragprovider.cpp @@ -0,0 +1,183 @@ +/*************************************************************************** + sq_dragprovider.cpp - description + ------------------- + begin : ??? Sep 17 2007 + copyright : (C) 2007 by Baryshev Dmitry + email : ksquirrel.iv@gmail.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include + +#include "sq_dragprovider.h" +#include "sq_iconloader.h" +#include "sq_filethumbviewitem.h" +#include "sq_thumbnailsize.h" + +#define SQ_THUMB_SIZE 96 + +SQ_DragProvider * SQ_DragProvider::m_inst = 0; + +SQ_DragProvider::SQ_DragProvider(QObject *parent) : QObject(parent), source(0) +{ + m_inst = this; +} + +SQ_DragProvider::~SQ_DragProvider() +{} + +void SQ_DragProvider::setParams(QWidget *_source, const KFileItemList &_files, SourceType tp) +{ + source = _source; + files = _files; + type = tp; +} + +void SQ_DragProvider::start() +{ + if(!source) + return; + + int count = files.count(); + + if(!count) + return; + + KURL::List urls; + KFileItem *fi; + SQ_FileThumbViewItem *kfi; + QStringList names; + int capas = type == Thumbnails ? 2 : 10; // 2 thumbnails or 10 file names + int _capas = capas; + QValueVector pixmaps; + QPixmap *pix; + int pixw = 0, pixh = 0; + const int margin = 2; + + KFileItem *first = files.first(); + + KFileItemListIterator it(files); + + while((fi = it.current())) + { + urls.append(fi->url()); + + if(_capas) + { + if(type == Thumbnails) + { + kfi = reinterpret_cast(fi->extraData(source)); + + if(kfi && (pix = kfi->pixmap())) + { + pixmaps.append(*pix); + + if(!pixw || !pixh) + { + pixw = pix->width(); + pixh = pix->height(); + + if(pixw > SQ_THUMB_SIZE) + { + QSize sz(pixw, pixh); + sz.scale(SQ_THUMB_SIZE, SQ_THUMB_SIZE, QSize::ScaleMin); + pixw = sz.width(); + pixh = sz.height(); + } + } + } + } + else + names.append(KStringHandler::csqueeze(fi->name())); + + --_capas; + } + + ++it; + } + + QDragObject *drag = new KURLDrag(urls, source); + QPixmap dragIcon; + + if(urls.count() > 1) + dragIcon = SQ_IconLoader::instance()->loadIcon("kmultiple", KIcon::Desktop, KIcon::SizeSmall); + else + dragIcon = first->pixmap(KIcon::SizeSmall); + + const int flags = Qt::AlignAuto|Qt::AlignVCenter|Qt::ShowPrefix; + QPixmap dragPixmap; + QString text; + + // construct text + if(type == Icons) + { + QStringList::iterator sEnd = names.end(); + for(QStringList::iterator sit = names.begin();sit != sEnd;++sit) + text = text + *sit + '\n'; + } + + text += QString::fromLatin1("%1 %2").arg(i18n("Total")).arg(i18n("1 file", "%n files", count)); + + QFontMetrics ms(source->font()); + QRect r = ms.boundingRect(0, 0, 1, 1, flags, text); + + // resize pixmap + if(type == Icons) + dragPixmap.resize(r.width(), r.height()); + else + dragPixmap.resize(std::max(r.width(), pixw)+margin*2, r.height()+margin+(pixh+margin)*pixmaps.count()); + + QPalette pal = QToolTip::palette(); + QPainter p; + p.begin(&dragPixmap); + + // draw frame + p.setPen(QPen(pal.color(QPalette::Active, QColorGroup::Text))); + p.setBrush(QBrush(pal.color(QPalette::Active, QColorGroup::Background))); + p.drawRect(dragPixmap.rect()); + + // draw file names + if(type == Icons) + p.drawText(dragPixmap.rect(), flags, text); + else // or thumbnails + { + int y = margin; + QValueVector::iterator itEnd = pixmaps.end(); + + for(QValueVector::iterator it = pixmaps.begin();it != itEnd;++it) + { + p.drawPixmap(QRect((dragPixmap.width()-pixw)/2, y, pixw, pixh), *it); + y = y + pixh + margin; + } + + p.drawText(0, y, dragPixmap.width(), dragPixmap.height()-y, flags, text); + } + + p.end(); + + // finally, setup drag object + drag->setPixmap(dragPixmap, QPoint(16, -16)); + drag->dragCopy(); +} diff --git a/ksquirrel/sq_dragprovider.h b/ksquirrel/sq_dragprovider.h new file mode 100644 index 0000000..425e967 --- /dev/null +++ b/ksquirrel/sq_dragprovider.h @@ -0,0 +1,62 @@ +/*************************************************************************** + sq_dragprovider.h - description + ------------------- + begin : ??? Sep 17 2007 + copyright : (C) 2007 by Baryshev Dmitry + email : ksquirrel.iv@gmail.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifndef SQ_DRAGPROVIDER_H +#define SQ_DRAGPROVIDER_H + +#include + +#include + +class QWidget; + +/* + * Class for making drag operations easier. + * + * All fileview types (Details, Thumbnails...) use an instance of + * this class in startDrag() method. + */ + +class SQ_DragProvider : public QObject +{ + public: + enum SourceType { Icons, Thumbnails }; + + SQ_DragProvider(QObject *parent); + ~SQ_DragProvider(); + + /* + * Set drag source (fileview), file list and fileview type. + */ + void setParams(QWidget *_source, const KFileItemList &_files, SourceType tp); + + /* + * Start drag operation. + */ + void start(); + + static SQ_DragProvider* instance() { return m_inst; } + + private: + QWidget *source; + KFileItemList files; + SourceType type; + + static SQ_DragProvider *m_inst; +}; + +#endif diff --git a/ksquirrel/sq_errorstring.cpp b/ksquirrel/sq_errorstring.cpp new file mode 100644 index 0000000..daa6b20 --- /dev/null +++ b/ksquirrel/sq_errorstring.cpp @@ -0,0 +1,58 @@ +/*************************************************************************** + sq_errorstring.cpp - description + ------------------- + begin : ??? ??? 26 2005 + copyright : (C) 2005 by Baryshev Dmitry + email : ksquirrel.iv@gmail.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include "sq_errorstring.h" + +#include + +SQ_ErrorString * SQ_ErrorString::m_instance = 0; + +SQ_ErrorString::SQ_ErrorString(QObject *parent) : QObject(parent) +{ + m_instance = this; + + // fill map with translated messages + messages.insert(SQE_OK, QString::fromLatin1("OK")); + messages.insert(SQE_R_NOFILE, i18n("cannot open file for reading")); + messages.insert(SQE_R_BADFILE, i18n("file corrupted")); + messages.insert(SQE_R_NOMEMORY, i18n("no memory")); + messages.insert(SQE_R_NOTSUPPORTED, i18n("file type not supported")); + messages.insert(SQE_R_WRONGDIM, i18n("wrong image dimensions")); + messages.insert(SQE_W_NOFILE, i18n("cannot open file for writing")); + messages.insert(SQE_W_NOTSUPPORTED, i18n("write feature is not supported")); + messages.insert(SQE_W_ERROR, i18n("write error (check free space)")); + messages.insert(SQE_W_WRONGPARAMS, i18n("wrong parameters")); + messages.insert(SQE_NOTFINISHED, i18n("Editing process is not finished yet")); +} + +SQ_ErrorString::~SQ_ErrorString() +{} + +// Get string by error code. +QString SQ_ErrorString::string(const int code) +{ + return messages[code]; +} + +QString SQ_ErrorString::stringSN(const int code) +{ + return messages[code] + '\n'; +} diff --git a/ksquirrel/sq_errorstring.h b/ksquirrel/sq_errorstring.h new file mode 100644 index 0000000..b1c4838 --- /dev/null +++ b/ksquirrel/sq_errorstring.h @@ -0,0 +1,56 @@ +/*************************************************************************** + sq_errorstring.h - description + ------------------- + begin : ??? ??? 26 2005 + copyright : (C) 2005 by Baryshev Dmitry + email : ksquirrel.iv@gmail.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifndef SQ_ERRORSTRING_H +#define SQ_ERRORSTRING_H + +#include +#include + +#include + +#define SQE_NOTFINISHED 10000 + +/* + * Class SQ_ErrorString will return translated string representation of + * error code. + */ + +class SQ_ErrorString : public QObject +{ + public: + SQ_ErrorString(QObject *parent = 0); + ~SQ_ErrorString(); + + /* + * Get string representation of error. + */ + QString string(const int code); + + /* + * string() + "\n" + */ + QString stringSN(const int code); + + static SQ_ErrorString* instance() { return m_instance; } + + private: + QMap messages; + static SQ_ErrorString *m_instance; +}; + +#endif diff --git a/ksquirrel/sq_externaltool.cpp b/ksquirrel/sq_externaltool.cpp new file mode 100644 index 0000000..aa349ed --- /dev/null +++ b/ksquirrel/sq_externaltool.cpp @@ -0,0 +1,245 @@ +/*************************************************************************** + sq_externaltool.cpp - description + ------------------- + begin : ??? ??? 12 2004 + copyright : (C) 2004 by Baryshev Dmitry + email : ksquirrel.iv@gmail.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include + +#include +#include +#include +#include +#include +#include + +#include "sq_iconloader.h" +#include "sq_externaltool.h" +#include "sq_popupmenu.h" +#include "sq_config.h" + +SQ_ExternalTool * SQ_ExternalTool::m_instance = 0; + +Tool::Tool() +{} + +Tool::Tool(const QString &pix, const QString &nam, const QString &com) +{ + icon = pix; + name = nam; + command = com; +} + +SQ_ExternalTool::SQ_ExternalTool(QObject *parent) : QObject(parent), QValueVector() +{ + m_instance = this; + menu = new SQ_PopupMenu(0, "External tools"); + + connect(menu, SIGNAL(aboutToShow()), this, SLOT(slotAboutToShowMenu())); + connect(menu, SIGNAL(activated(int)), this, SLOT(slotActivateTool(int))); + + QString str, tmp; + + SQ_Config::instance()->setGroup("External tools"); + + QStringList names = SQ_Config::instance()->readListEntry("names"); + QStringList commands = SQ_Config::instance()->readListEntry("commands"); + QStringList icons = SQ_Config::instance()->readListEntry("icons"); + + for(QStringList::iterator it_n = names.begin(),it_c = commands.begin(),it_i = icons.begin(); + it_n != names.end() || it_c != commands.end() || it_i != icons.end(); + ++it_n, ++it_c, ++it_i) + { + append(Tool(*it_i, *it_n, *it_c)); + } +} + +SQ_ExternalTool::~SQ_ExternalTool() +{ + delete menu; +} + +QString SQ_ExternalTool::toolPixmap(const int i) +{ + return (*this)[i].icon; +} + +QString SQ_ExternalTool::toolName(const int i) +{ + return (*this)[i].name; +} + +QString SQ_ExternalTool::toolCommand(const int i) +{ + return (*this)[i].command; +} + +/* + * Recreate current popop menu. + */ +SQ_PopupMenu* SQ_ExternalTool::newPopupMenu() +{ + int id; + + // clear menu + menu->clear(); + + menu->insertTitle(i18n("No file selected")); + + // construct new menu + for(unsigned int i = 0;i < count();i++) + { + id = menu->insertItem(SQ_IconLoader::instance()->loadIcon(toolPixmap(i), KIcon::Desktop, KIcon::SizeSmall), toolName(i)); + menu->setItemParameter(id, i); + } + + return menu; +} + +/* + * Get current popup menu. + */ +SQ_PopupMenu* SQ_ExternalTool::constPopupMenu() const +{ + return menu; +} + +/* + * Write tools to config file + */ +void SQ_ExternalTool::writeEntries() +{ + // no tools ? + if(!count()) return; + + QString num; + + // delete old group with old items + SQ_Config::instance()->deleteGroup("External tools"); + SQ_Config::instance()->setGroup("External tools"); + QStringList names, icons, commands; + + // write items in config file + for(QValueVector::iterator it = begin();it != end();++it) + { + names.append((*it).name); + icons.append((*it).icon); + commands.append((*it).command); + } + + SQ_Config::instance()->writeEntry("names", names); + SQ_Config::instance()->writeEntry("commands", commands); + SQ_Config::instance()->writeEntry("icons", icons); +} + +/* + * Invoked, when user executed popup menu with external tools. + * This slot will do some useful stuff. + */ +void SQ_ExternalTool::slotAboutToShowMenu() +{ + if(!items.count()) + { + menu->changeTitle(i18n("No file selected")); + return; + } + + KFileItem *item = items.first(); + + if(!item) + { + menu->changeTitle(i18n("No file selected")); + return; + } + + // make title shorter + QString file = KStringHandler::rsqueeze(item->name(), 30); + + // finally, change title + QString final = (items.count() == 1 || items.count() == 0) ? file : (file + QString::fromLatin1(" (+%1)").arg(items.count()-1)); + menu->changeTitle(final); +} + +void SQ_ExternalTool::slotActivateTool(int id) +{ + KURL::List list; + + if(items.isEmpty()) return; + + int index = menu->itemParameter(id); + + KFileItem *f = items.first(); + + while(f) + { + list.append(f->url()); + f = items.next(); + } + + items.clear(); + + if(list.empty()) return; + + KShellProcess proc; + + // get appropriate tool + Tool *tool = &at(index); + QString comm = tool->command; + + int per_f = comm.contains("%f"); + int per_F = comm.contains("%F"); + + // %f = single file + // %F = multiple files + if(per_f && per_F) + { + KMessageBox::error(0, i18n("Command cannot contain both \"%f\" and \"%F\""), i18n("Error processing command")); + return; + } + else if(!per_f && !per_F) + { + KMessageBox::error(0, i18n("Command should contain \"%f\" or \"%F\""), i18n("Error processing command")); + return; + } + else if(per_f) + { + KURL u = list.first(); + comm.replace("%f", KShellProcess::quote(u.isLocalFile() ? u.path() : u.prettyURL())); + proc << comm; + } + else + { + QString files; + + KURL::List::iterator itEnd = list.end(); + + for(KURL::List::iterator it = list.begin();it != itEnd;++it) + { + files.append(KShellProcess::quote((*it).isLocalFile() ? (*it).path() : (*it).prettyURL())); + files.append(" "); + } + + comm.replace("%F", files); + proc << comm; + } + + // start process + proc.start(KProcess::DontCare); +} + +#include "sq_externaltool.moc" diff --git a/ksquirrel/sq_externaltool.h b/ksquirrel/sq_externaltool.h new file mode 100644 index 0000000..3b1bc0a --- /dev/null +++ b/ksquirrel/sq_externaltool.h @@ -0,0 +1,103 @@ +/*************************************************************************** + sq_externaltool.h - description + ------------------- + begin : ??? ??? 12 2004 + copyright : (C) 2004 by Baryshev Dmitry + email : ksquirrel.iv@gmail.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifndef SQ_EXTERNALTOOL_H +#define SQ_EXTERNALTOOL_H + +#include +#include +#include + +#include + +class SQ_PopupMenu; + +struct Tool +{ + Tool(); + Tool(const QString &, const QString &, const QString &); + + QString name, command; + QString icon; +}; + +/* + * Class which manages external tools. It store all available external tools + * in memory, and create popup menu where external tools been inserted. + */ + +class SQ_ExternalTool : public QObject, public QValueVector +{ + Q_OBJECT + + public: + SQ_ExternalTool(QObject *parent = 0); + ~SQ_ExternalTool(); + + /* + * Get pixmap, name or command of external tool. + */ + QString toolPixmap(const int i); + QString toolName(const int i); + QString toolCommand(const int i); + + void setItems(const KFileItemList &); + + /* + * Recreate current popop menu. + */ + SQ_PopupMenu* newPopupMenu(); + + /* + * Get current popup menu. + */ + SQ_PopupMenu* constPopupMenu() const; + + /* + * Write tools to config file as QStringLists + */ + void writeEntries(); + + static SQ_ExternalTool* instance() { return m_instance; } + + private slots: + + /* + * Invoked, when user executed popup menu with external tools. + * This slot will do some useful stuff. + */ + void slotAboutToShowMenu(); + void slotActivateTool(int); + + private: + /* + * Popup menu with all tools. + */ + SQ_PopupMenu *menu; + + KFileItemList items; + + static SQ_ExternalTool *m_instance; +}; + +inline +void SQ_ExternalTool::setItems(const KFileItemList &itms) +{ + items = itms; +} + +#endif diff --git a/ksquirrel/sq_externaltools.ui b/ksquirrel/sq_externaltools.ui new file mode 100644 index 0000000..66881b9 --- /dev/null +++ b/ksquirrel/sq_externaltools.ui @@ -0,0 +1,463 @@ + +SQ_ExternalTools + + + SQ_ExternalTools + + + + 0 + 0 + 562 + 419 + + + + Adjust external tools + + + true + + + + unnamed + + + + spacer5 + + + Horizontal + + + Expanding + + + + 65 + 20 + + + + + + pushCancel + + + + 1 + 0 + 0 + 0 + + + + Cancel + + + + + pushOK + + + + 1 + 0 + 0 + 0 + + + + OK + + + true + + + + + line1 + + + HLine + + + Sunken + + + Horizontal + + + + + + Pixmap + + + true + + + true + + + + + Name + + + true + + + true + + + + + Command + + + true + + + true + + + + listTools + + + + 7 + 7 + 0 + 0 + + + + Manual + + + Single + + + true + + + LastColumn + + + Reject + + + <b>Command</b> can contain <ul><li>%f: one file<li>%F: multiple files</ul> + + + + + spacer7 + + + Vertical + + + Expanding + + + + 20 + 130 + + + + + + layout4 + + + + unnamed + + + + groupBox3 + + + + + + + unnamed + + + 5 + + + + pushNew + + + + + + true + + + New tool + + + + + pushDelete + + + + + + true + + + true + + + Delete + + + + + pushClearAll + + + + + + true + + + Clear All + + + + + + + groupBox4 + + + + + + + unnamed + + + 5 + + + + pushToolUp + + + true + + + + 0 + 0 + 0 + 0 + + + + + 22 + 22 + + + + + + + true + + + true + + + Move tool up + + + + + pushToolDown + + + true + + + + 0 + 0 + 0 + 0 + + + + + 22 + 22 + + + + + + + true + + + true + + + Move tool down + + + + + + + groupBox3_2 + + + + + + + unnamed + + + 5 + + + + pushHelp + + + true + + + + 0 + 0 + 0 + 0 + + + + + 22 + 22 + + + + + + + true + + + + + + + + + + + pushOK + clicked() + SQ_ExternalTools + accept() + + + pushCancel + clicked() + SQ_ExternalTools + reject() + + + listTools + rightButtonClicked(QListViewItem*,const QPoint&,int) + SQ_ExternalTools + slotToolRenameRequest(QListViewItem*,const QPoint&,int) + + + pushToolUp + clicked() + SQ_ExternalTools + slotToolUp() + + + pushToolDown + clicked() + SQ_ExternalTools + slotToolDown() + + + pushNew + clicked() + SQ_ExternalTools + slotNewTool() + + + pushClearAll + clicked() + listTools + clear() + + + pushDelete + clicked() + SQ_ExternalTools + slotToolClear() + + + pushHelp + clicked() + SQ_ExternalTools + slotHelp() + + + + listTools + pushNew + pushDelete + pushClearAll + pushToolUp + pushToolDown + pushHelp + pushOK + pushCancel + + + sq_externaltool.h + sq_config.h + kicondialog.h + sq_iconloader.h + qwhatsthis.h + kglobal.h + kiconloader.h + sq_externaltools.ui.h + + + slotNewTool() + slotToolClear() + slotToolUp() + slotToolDown() + start() + slotToolRenameRequest( QListViewItem * item, const QPoint &, int pos ) + slotHelp() + + + init() + + + diff --git a/ksquirrel/sq_externaltools.ui.h b/ksquirrel/sq_externaltools.ui.h new file mode 100644 index 0000000..b20a875 --- /dev/null +++ b/ksquirrel/sq_externaltools.ui.h @@ -0,0 +1,145 @@ +/**************************************************************************** +** ui.h extension file, included from the uic-generated form implementation. +** +** If you wish to add, delete or rename functions or slots use +** Qt Designer which will update this file, preserving your code. Create an +** init() function in place of a constructor, and a destroy() function in +** place of a destructor. +*****************************************************************************/ + +void SQ_ExternalTools::init() +{ + listTools->setSorting(-1); + + QListViewItem *itemafter = 0L, *item; + + for(QValueVector::iterator it = SQ_ExternalTool::instance()->begin();it != SQ_ExternalTool::instance()->end();++it) + { + if(itemafter) + item = new QListViewItem(listTools, itemafter, QString::null, (*it).name, (*it).command, (*it).icon); + else + item = new QListViewItem(listTools, QString::null, (*it).name, (*it).command, (*it).icon); + + item->setPixmap(0, SQ_IconLoader::instance()->loadIcon(item->text(3), KIcon::Desktop, 16)); + itemafter = item; + + item->setRenameEnabled(1, true); + item->setRenameEnabled(2, true); + item->setMultiLinesEnabled(false); + + listTools->insertItem(item); + } + + pushToolUp->setPixmap(SQ_IconLoader::instance()->loadIcon("move_task_up", KIcon::Desktop, KIcon::SizeSmall)); + pushToolDown->setPixmap(SQ_IconLoader::instance()->loadIcon("move_task_down", KIcon::Desktop, KIcon::SizeSmall)); + pushNew->setPixmap(SQ_IconLoader::instance()->loadIcon("filenew", KIcon::Desktop, KIcon::SizeSmall)); + pushDelete->setPixmap(SQ_IconLoader::instance()->loadIcon("editdelete", KIcon::Desktop, KIcon::SizeSmall)); + pushClearAll->setPixmap(SQ_IconLoader::instance()->loadIcon("edittrash", KIcon::Desktop, KIcon::SizeSmall)); + pushHelp->setPixmap(SQ_IconLoader::instance()->loadIcon("help", KIcon::Desktop, KIcon::SizeSmall)); + + listTools->setCurrentItem(listTools->firstChild()); + listTools->clearSelection(); + listTools->setSelected(listTools->currentItem(), true); +} + +void SQ_ExternalTools::slotNewTool() +{ + QListViewItem *itemafter = listTools->lastItem(), *item; + + if(itemafter) + item = new QListViewItem(listTools, itemafter, "", "Tool name", "tool_executable %f", ""); + else + item = new QListViewItem(listTools, "", "Tool name", "tool_executable %f", ""); + + item->setRenameEnabled(1, true); + item->setRenameEnabled(2, true); + item->setMultiLinesEnabled(false); + listTools->insertItem(item); + item->startRename(1); +} + +void SQ_ExternalTools::slotToolClear() +{ + QListViewItem *item = listTools->currentItem(); + + if(!item) return; + + listTools->takeItem(item); + + item = listTools->currentItem(); + + if(item) + listTools->setSelected(item, true); +} + +void SQ_ExternalTools::slotToolUp() +{ + QListViewItem *item = listTools->currentItem(); + + if(!item) return; + + QListViewItem *itemafter = item->itemAbove(); + + if(!itemafter) return; + + itemafter->moveItem(item); +} + +void SQ_ExternalTools::slotToolDown() +{ + QListViewItem *item = listTools->currentItem(); + + if(!item) return; + + QListViewItem *itemafter = item->itemBelow(); + + if(!itemafter) return; + + item->moveItem(itemafter); + +} + +int SQ_ExternalTools::start() +{ + int result = exec(); + + if(result == QDialog::Accepted) + { + QListViewItem *cur = listTools->firstChild(); + + SQ_ExternalTool::instance()->clear(); + + for(;cur;cur = cur->itemBelow()) + { + SQ_ExternalTool::instance()->append(Tool(cur->text(3), cur->text(1), cur->text(2))); + } + } + + return result; +} + +void SQ_ExternalTools::slotToolRenameRequest( QListViewItem *item, const QPoint &, int pos ) +{ + if(!item || pos == -1) + return; + + if(pos > 0) + item->startRename(pos); + else + { + KIconDialog dialog(KGlobal::iconLoader()); + dialog.setup(KIcon::Desktop, KIcon::Application, true, 16); + QString result = dialog.openDialog(); + + if(!result.isEmpty()) + { + item->setPixmap(0, SQ_IconLoader::instance()->loadIcon(result, KIcon::Desktop, 16)); + item->setText(3, result); + } + } +} + +void SQ_ExternalTools::slotHelp() +{ + QWhatsThis::display(tr2i18n("Command can contain
  • %f: one file
  • %F: multiple files
")); +} diff --git a/ksquirrel/sq_filedetailview.cpp b/ksquirrel/sq_filedetailview.cpp new file mode 100644 index 0000000..37644bb --- /dev/null +++ b/ksquirrel/sq_filedetailview.cpp @@ -0,0 +1,228 @@ +/*************************************************************************** + sq_filedetailview.cpp - description + ------------------- + begin : Mon Mar 15 2004 + copyright : (C) 2004 by Baryshev Dmitry + email : ksquirrel.iv@gmail.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include +#include + +#include +#include +#include +#include + +#include "ksquirrel.h" +#include "sq_config.h" +#include "sq_iconloader.h" +#include "sq_filedetailview.h" +#include "sq_widgetstack.h" +#include "sq_diroperator.h" +#include "sq_dragprovider.h" + +SQ_FileListViewItem::SQ_FileListViewItem(QListView *parent, KFileItem *fi) : KFileListViewItem(parent, fi) +{} + +SQ_FileListViewItem::SQ_FileListViewItem(QListView *parent, const QString &text, const QPixmap &icon, KFileItem *fi) + : KFileListViewItem(parent, text, icon, fi) +{} + +SQ_FileListViewItem::~SQ_FileListViewItem() +{} + +SQ_FileDetailView::SQ_FileDetailView(QWidget* parent, const char* name) + : KFileDetailView(parent, name) +{ + // pixmap for directory item + dirPix = SQ_IconLoader::instance()->loadIcon("folder", KIcon::Desktop, KIcon::SizeSmall); + + toolTip = new KonqFileTip(this); + slotResetToolTip(); + + disconnect(this, SIGNAL(onViewport()), this, 0); + disconnect(this, SIGNAL(onItem(QListViewItem *)), this, 0); + connect(this, SIGNAL(onViewport()), this, SLOT(slotRemoveToolTip())); + connect(this, SIGNAL(onItem(QListViewItem *)), this, SLOT(slotShowToolTip(QListViewItem *))); +} + +SQ_FileDetailView::~SQ_FileDetailView() +{ + slotRemoveToolTip(); +} + +void SQ_FileDetailView::slotResetToolTip() +{ + SQ_Config::instance()->setGroup("Fileview"); + + toolTip->setOptions(true, + SQ_Config::instance()->readBoolEntry("tooltips_preview", false), + SQ_Config::instance()->readNumEntry("tooltips_lines", 6)); +} + +// Show extended tooltip for item under mouse cursor +void SQ_FileDetailView::slotShowToolTip(QListViewItem *item) +{ + SQ_Config::instance()->setGroup("Fileview"); + + if(!SQ_Config::instance()->readBoolEntry("tooltips", false) || + (!KSquirrel::app()->isActiveWindow() && SQ_Config::instance()->readBoolEntry("tooltips_inactive", true))) + return; + + // remove previous tootip and stop timer + slotRemoveToolTip(); + + KFileListViewItem *fitem = dynamic_cast(item); + + if(!fitem) return; + + KFileItem *f = fitem->fileInfo(); + + if(f) toolTip->setItem(f, fitem->rect(), fitem->pixmap(0)); +} + +bool SQ_FileDetailView::eventFilter(QObject *o, QEvent *e) +{ + if(o == viewport() || o == this) + { + int type = e->type(); + + if(type == QEvent::Leave || type == QEvent::FocusOut || type == QEvent::Hide) + slotRemoveToolTip(); + } + + return KFileDetailView::eventFilter(o, e); +} + +/* + * Remove tootip. + */ +void SQ_FileDetailView::slotRemoveToolTip() +{ + toolTip->setItem(0); +} + +/* + * Reimplement insertItem() to enable/disable inserting + * directories (depends on current settings). + */ +void SQ_FileDetailView::insertItem(KFileItem *i) +{ + SQ_Config::instance()->setGroup("Fileview"); + + // directores disabled ? + if(i->isDir() && SQ_Config::instance()->readBoolEntry("disable_dirs", false)) + return; + + // add new item + setUpdatesEnabled(false); + SQ_FileListViewItem *item = new SQ_FileListViewItem(this, i); + + initItem(item, i); + setUpdatesEnabled(true); + + i->setExtraData(this, item); +} + +/* + * Internal. Set item's sorting key. + */ +void SQ_FileDetailView::initItem(SQ_FileListViewItem *item, const KFileItem *i) +{ + // determine current sorting type + QDir::SortSpec spec = KFileView::sorting(); + + if(spec & QDir::Time) + item->setKey(sortingKey(i->time(KIO::UDS_MODIFICATION_TIME), i->isDir(), spec)); + else if(spec & QDir::Size) + item->setKey(sortingKey(i->size(), i->isDir(), spec)); + else + item->setKey(sortingKey(i->text(), i->isDir(), spec)); +} + +/* + * On double click execute item or + * invoke default browser in current url. + */ +void SQ_FileDetailView::contentsMouseDoubleClickEvent(QMouseEvent *e) +{ + QPoint vp = contentsToViewport(e->pos()); + + QListViewItem *item = itemAt(vp); + + emit QListView::doubleClicked(item); + + int col = item ? header()->mapToLogical(header()->cellAt(vp.x())) : -1; + + // double click on item + if(item) + emit doubleClicked(item, e->globalPos(), col); + + // double click was in viewport, let's invoke browser + else + emit invokeBrowser(); +} + +// Accept dragging +void SQ_FileDetailView::dragEnterEvent(QDragEnterEvent *e) +{ + e->accept(true); +} + +/* + * Insert ".." item. + */ +void SQ_FileDetailView::insertCdUpItem(const KURL &base) +{ + static const QString &dirup = KGlobal::staticQString(".."); + + KFileItem *fi = new KFileItem(base.upURL(), "inode/directory", S_IFDIR); + + SQ_FileListViewItem *item = new SQ_FileListViewItem(this, dirup, dirPix, fi); + + item->setSelectable(false); + item->setKey(sortingKey("..", true, QDir::Name|QDir::DirsFirst)); + + fi->setExtraData(this, item); +} + +/* + * Clear current view and insert "..". + */ +void SQ_FileDetailView::clearView() +{ + // call default clearing method + KFileDetailView::clearView(); + + // insert ".." + insertCdUpItem(SQ_WidgetStack::instance()->url()); +} + +void SQ_FileDetailView::startDrag() +{ + SQ_Config::instance()->setGroup("Fileview"); + + if(SQ_Config::instance()->readBoolEntry("drag", true)) + { + SQ_DragProvider::instance()->setParams(this, *KFileView::selectedItems(), SQ_DragProvider::Icons); + SQ_DragProvider::instance()->start(); + } + else + KFileDetailView::startDrag(); +} + +#include "sq_filedetailview.moc" diff --git a/ksquirrel/sq_filedetailview.h b/ksquirrel/sq_filedetailview.h new file mode 100644 index 0000000..fbdd869 --- /dev/null +++ b/ksquirrel/sq_filedetailview.h @@ -0,0 +1,118 @@ +/*************************************************************************** + sq_filedetailview.h - description + ------------------- + begin : Mon Mar 15 2004 + copyright : (C) 2004 by Baryshev Dmitry + email : ksquirrel.iv@gmail.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifndef SQ_FILEDETAILVIEW_H +#define SQ_FILEDETAILVIEW_H + +#include + +class KonqFileTip; + +/* + * SQ_FileDetailView represents detailed view in filemanager. + */ + +/* + * SQ_FileListViewItem represents one item in detaild view. + */ +class SQ_FileListViewItem : public KFileListViewItem +{ + public: + SQ_FileListViewItem(QListView *parent, KFileItem *fi); + SQ_FileListViewItem(QListView *parent, const QString &text, const QPixmap &icon, KFileItem *fi); + ~SQ_FileListViewItem(); + + protected: + /* + * Reimplement paintFocus() to ignore painting focus. + */ + virtual void paintFocus(QPainter *, const QColorGroup &, const QRect &) + {} +}; + +class SQ_FileDetailView : public KFileDetailView +{ + Q_OBJECT + + public: + SQ_FileDetailView(QWidget* parent, const char* name); + ~SQ_FileDetailView(); + + /* + * Reimplement insertItem() to enable/disable inserting + * directories (depends on current settings). + */ + virtual void insertItem(KFileItem *i); + + /* + * Clear current view and insert "..". + */ + virtual void clearView(); + + /* + * Insert ".." item. + */ + void insertCdUpItem(const KURL &baseurl); + + protected: + /* + * Internal. Set item's sorting key. + */ + void initItem(SQ_FileListViewItem *item, const KFileItem *i); + + virtual void startDrag(); + + virtual bool eventFilter(QObject *o, QEvent *e); + + /* + * On double click execute item or + * invoke default browser in current url. + */ + virtual void contentsMouseDoubleClickEvent(QMouseEvent *e); + + /* + * Accept dragging. + */ + virtual void dragEnterEvent(QDragEnterEvent *); + + signals: + void invokeBrowser(); + + public slots: + void slotResetToolTip(); + + private slots: + /* + * Show extended tooltip for 'item'. + */ + void slotShowToolTip(QListViewItem *item); + + /* + * Remove tootip and stop timer. + */ + void slotRemoveToolTip(); + + private: + QPixmap dirPix; + + /* + * Tooltip for file item. + */ + KonqFileTip *toolTip; +}; + +#endif diff --git a/ksquirrel/sq_filedialog.cpp b/ksquirrel/sq_filedialog.cpp new file mode 100644 index 0000000..ce0eb47 --- /dev/null +++ b/ksquirrel/sq_filedialog.cpp @@ -0,0 +1,44 @@ +/*************************************************************************** + sq_filedialog.cpp - description + ------------------- + begin : Mon Mar 5 2007 + copyright : (C) 2007 by Baryshev Dmitry + email : ksquirrel.iv@gmail.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#include + +#include "sq_filedialog.h" + +SQ_FileDialog::SQ_FileDialog(const QString &path, QWidget *parent) + : KFileDialog(path, QString::null, parent, "select_a_file", true) +{} + +SQ_FileDialog::~SQ_FileDialog() +{} + +void SQ_FileDialog::updateCombo(bool enable) +{ + filterWidget->setEditable(enable); + + slotFilterChanged(); +} + +QString SQ_FileDialog::nameFilter() const +{ + return filterWidget->currentText(); +} + +void SQ_FileDialog::setCurrentFilter(const QString &f) +{ + filterWidget->setCurrentFilter(f); +} diff --git a/ksquirrel/sq_filedialog.h b/ksquirrel/sq_filedialog.h new file mode 100644 index 0000000..205b200 --- /dev/null +++ b/ksquirrel/sq_filedialog.h @@ -0,0 +1,39 @@ +/*************************************************************************** + sq_filedialog.h - description + ------------------- + begin : Mon Mar 5 2007 + copyright : (C) 2007 by Baryshev Dmitry + email : ksquirrel.iv@gmail.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifndef SQ_FILEDIALOG_H +#define SQ_FILEDIALOG_H + +#include + +/** + *@author Baryshev Dmitry + */ + +class SQ_FileDialog : public KFileDialog +{ + public: + SQ_FileDialog(const QString &path, QWidget *parent); + ~SQ_FileDialog(); + + QString nameFilter() const; + void updateCombo(bool enable); + + void setCurrentFilter(const QString &); +}; + +#endif diff --git a/ksquirrel/sq_fileiconview.cpp b/ksquirrel/sq_fileiconview.cpp new file mode 100644 index 0000000..f816dea --- /dev/null +++ b/ksquirrel/sq_fileiconview.cpp @@ -0,0 +1,143 @@ +/*************************************************************************** + sq_fileiconview.cpp - description + ------------------- + begin : Mon Mar 15 2004 + copyright : (C) 2004 by Baryshev Dmitry + email : ksquirrel.iv@gmail.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include +#include +#include +#include + +#include "sq_config.h" +#include "sq_iconloader.h" +#include "sq_fileiconview.h" +#include "sq_widgetstack.h" +#include "sq_diroperator.h" +#include "sq_dragprovider.h" + +SQ_FileIconViewItem::SQ_FileIconViewItem(QIconView *parent, const QString &text, + const QPixmap &pixmap, KFileItem *fi) + : KFileIconViewItem(parent, text, pixmap, fi) +{} + +SQ_FileIconViewItem::~SQ_FileIconViewItem() +{} + +SQ_FileIconView::SQ_FileIconView(QWidget *parent, const char *name) : SQ_FileIconViewBase(parent, name) +{ + QString n = name; + + setSorting(QDir::IgnoreCase); + + dirPix = SQ_IconLoader::instance()->loadIcon("folder", KIcon::Desktop, (n == "icon view") + ? KIcon::SizeMedium : KIcon::SizeSmall); +} + +SQ_FileIconView::~SQ_FileIconView() +{} + +void SQ_FileIconView::updateView(bool b) +{ + if(!b) + return; + + SQ_FileIconViewItem *item = static_cast(QIconView::firstItem()); + + if(item) + { + do + { + item->setPixmap((item->fileInfo())->pixmap(iconSize())); + item = static_cast(item->nextItem()); + }while(item); + } +} + +/* + * Reimplement insertItem() to enable/disable inserting + * directories (depends on current settings). + */ +void SQ_FileIconView::insertItem(KFileItem *i) +{ + SQ_Config::instance()->setGroup("Fileview"); + + // directores disabled ? + if(i->isDir() && SQ_Config::instance()->readBoolEntry("disable_dirs", false)) + return; + + SQ_FileIconViewItem *item; + + // add new item + setUpdatesEnabled(false); + item = new SQ_FileIconViewItem((QIconView*)this, i->text(), i->pixmap(iconSize()), i); + + initItemMy(item, i); + setUpdatesEnabled(true); + + i->setExtraData(this, item); +} + +/* + * Insert ".." item. + */ +void SQ_FileIconView::insertCdUpItem(const KURL &base) +{ + static const QString &dirup = KGlobal::staticQString(".."); + + KFileItem *fi = new KFileItem(base.upURL(), "inode/directory", S_IFDIR); + + // create ".." item + SQ_FileIconViewItem *item = new SQ_FileIconViewItem(this, dirup, dirPix, fi); + + item->setSelectable(false); + + fi->setExtraData(this, item); +} + +/* + * Clear current view and insert "..". + */ +void SQ_FileIconView::clearView() +{ + // call default clearing method + KFileIconView::clearView(); + + // insert ".." + insertCdUpItem(SQ_WidgetStack::instance()->url()); +} + +void SQ_FileIconView::listingCompleted() +{ + arrangeItemsInGrid(); +} + +void SQ_FileIconView::startDrag() +{ + SQ_Config::instance()->setGroup("Fileview"); + + if(SQ_Config::instance()->readBoolEntry("drag", true)) + { + SQ_DragProvider::instance()->setParams(this, *KFileView::selectedItems(), SQ_DragProvider::Icons); + SQ_DragProvider::instance()->start(); + } + else + KFileIconView::startDrag(); +} + +#include "sq_fileiconview.moc" diff --git a/ksquirrel/sq_fileiconview.h b/ksquirrel/sq_fileiconview.h new file mode 100644 index 0000000..06dd757 --- /dev/null +++ b/ksquirrel/sq_fileiconview.h @@ -0,0 +1,89 @@ +/*************************************************************************** + sq_fileiconview.h - description + ------------------- + begin : Mon Mar 15 2004 + copyright : (C) 2004 by Baryshev Dmitry + email : ksquirrel.iv@gmail.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifndef SQ_FILEICONVIEW_H +#define SQ_FILEICONVIEW_H + +#include "sq_fileiconviewbase.h" + +#include + +class QPoint; + +/* + * SQ_FileIconView represents icon view and list view in filemanager. + */ + +/* + * SQ_FileIconViewItem represents one item in icon/list view. + */ +class SQ_FileIconViewItem : public KFileIconViewItem +{ + public: + SQ_FileIconViewItem(QIconView *parent, const QString &text, const QPixmap &pixmap, KFileItem *fi); + ~SQ_FileIconViewItem(); + + protected: + /* + * Reimplement paintFocus() to ignore painting focus. + */ + virtual void paintFocus(QPainter *, const QColorGroup &) + {} +}; + +class SQ_FileIconView : public SQ_FileIconViewBase +{ + Q_OBJECT + + public: + SQ_FileIconView(QWidget *parent = 0, const char *name = ""); + ~SQ_FileIconView(); + + /* + * Internal. + */ + virtual void updateView(bool b); + + /* + * Reimplement insertItem() to enable/disable inserting + * directories (depends on current settings). + */ + virtual void insertItem(KFileItem *i); + + /* + * Clear current view and insert "..". + */ + virtual void clearView(); + + /* + * All files are listed. Do something important. + */ + virtual void listingCompleted(); + + /* + * Insert ".." item. + */ + virtual void insertCdUpItem(const KURL &baseurl); + + protected: + virtual void startDrag(); + + private: + QPixmap dirPix; +}; + +#endif diff --git a/ksquirrel/sq_fileiconviewbase.cpp b/ksquirrel/sq_fileiconviewbase.cpp new file mode 100644 index 0000000..d8d93be --- /dev/null +++ b/ksquirrel/sq_fileiconviewbase.cpp @@ -0,0 +1,156 @@ +/*************************************************************************** + sq_fileiconviewbase.cpp - description + ------------------- + begin : ??? Feb 22 2005 + copyright : (C) 2005 by Baryshev Dmitry + email : ksquirrel.iv@gmail.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include +#include + +#include +#include +#include +#include +#include + +#include "ksquirrel.h" +#include "sq_fileiconviewbase.h" +#include "sq_config.h" + +SQ_FileIconViewBase::SQ_FileIconViewBase(QWidget *parent, const char *name) + : KFileIconView(parent, name) +{ + toolTip = new KonqFileTip(this); + slotResetToolTip(); + + disconnect(this, SIGNAL(onViewport()), this, 0); + disconnect(this, SIGNAL(onItem(QIconViewItem *)), this, 0); + connect(this, SIGNAL(onViewport()), this, SLOT(slotRemoveToolTip())); + connect(this, SIGNAL(onItem(QIconViewItem *)), this, SLOT(slotShowToolTip(QIconViewItem *))); +} + +SQ_FileIconViewBase::~SQ_FileIconViewBase() +{ + slotRemoveToolTip(); +} + +void SQ_FileIconViewBase::slotResetToolTip() +{ + SQ_Config::instance()->setGroup("Fileview"); + + toolTip->setOptions(true, + SQ_Config::instance()->readBoolEntry("tooltips_preview", false), + SQ_Config::instance()->readNumEntry("tooltips_lines", 6)); +} + +// Show extended tooltip for item under mouse cursor +void SQ_FileIconViewBase::slotShowToolTip(QIconViewItem *item) +{ + SQ_Config::instance()->setGroup("Fileview"); + + if(!SQ_Config::instance()->readBoolEntry("tooltips", false) || + (!KSquirrel::app()->isActiveWindow() && SQ_Config::instance()->readBoolEntry("tooltips_inactive", true))) + return; + + // remove previous tootip and stop timer + slotRemoveToolTip(); + + KFileIconViewItem *fitem = dynamic_cast(item); + + if(!fitem) return; + + KFileItem *f = fitem->fileInfo(); + + if(f) toolTip->setItem(f, fitem->rect(), fitem->pixmap()); +} + +bool SQ_FileIconViewBase::eventFilter(QObject *o, QEvent *e) +{ + if(o == viewport() || o == this) + { + int type = e->type(); + + if(type == QEvent::Leave || type == QEvent::FocusOut || type == QEvent::Hide) + slotRemoveToolTip(); + } + + return KFileIconView::eventFilter(o, e); +} + +/* + * Remove tootip. + */ +void SQ_FileIconViewBase::slotRemoveToolTip() +{ + toolTip->setItem(0); +} + +// Accept drag +void SQ_FileIconViewBase::dragEnterEvent(QDragEnterEvent *e) +{ + e->accept(true); +} + +/* + * Handle double clicks. + */ +void SQ_FileIconViewBase::contentsMouseDoubleClickEvent(QMouseEvent *e) +{ + QIconView::contentsMouseDoubleClickEvent(e); + + QIconViewItem *item = findItem(e->pos()); + + // double click on item + if(item) + emit doubleClicked(item, e->globalPos()); + + // double click in viewport, lets invoke browser + else + emit invokeBrowser(); +} + +void SQ_FileIconViewBase::updateView(const KFileItem *i) +{ + KFileIconViewItem *item = viewItem(i); + + if(item) + initItemMy(item, i, true); +} + +KFileIconViewItem* SQ_FileIconViewBase::viewItem(const KFileItem *item) +{ + return item ? reinterpret_cast((void *)item->extraData(this)) : 0; +} + +void SQ_FileIconViewBase::initItemMy(KFileIconViewItem *item, const KFileItem *i, bool upd) +{ + if(upd) + item->setText(i->text(), true, true); + + // determine current sorting type + QDir::SortSpec spec = KFileView::sorting(); + + if(spec & QDir::Time) + item->setKey(sortingKey((unsigned long)i->time(KIO::UDS_MODIFICATION_TIME), i->isDir(), spec)); + else if(spec & QDir::Size) + item->setKey(sortingKey(i->size(), i->isDir(), spec)); + else + item->setKey(sortingKey(i->text(), i->isDir(), spec)); +} + +#include "sq_fileiconviewbase.moc" diff --git a/ksquirrel/sq_fileiconviewbase.h b/ksquirrel/sq_fileiconviewbase.h new file mode 100644 index 0000000..d8dbc5d --- /dev/null +++ b/ksquirrel/sq_fileiconviewbase.h @@ -0,0 +1,87 @@ +/*************************************************************************** + sq_fileiconviewbase.h - description + ------------------- + begin : ??? Feb 22 2005 + copyright : (C) 2005 by Baryshev Dmitry + email : ksquirrel.iv@gmail.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifndef SQ_FILEICONVIEWBASE_H +#define SQ_FILEICONVIEWBASE_H + +#include + +class KonqFileTip; + +/* + * SQ_FileIconViewBase is a base class for icon view, list view and + * thumbnail view with drag-and-drop support. + */ + +class SQ_FileIconViewBase : public KFileIconView +{ + Q_OBJECT + + public: + SQ_FileIconViewBase(QWidget *parent = 0, const char *name = 0); + virtual ~SQ_FileIconViewBase(); + + virtual void insertCdUpItem(const KURL &base) = 0; + virtual void updateView(const KFileItem *i); + + protected: + + /* + * Get KFileIconViewItem by KFileItem. All KFileItems store + * a pointer to appropriate KFileIconViewItem as extra data. + * See also KFileItem::setExtraData() and insertItem(). + */ + KFileIconViewItem* viewItem(const KFileItem *item); + /* + * Accept dragging. + */ + virtual void dragEnterEvent(QDragEnterEvent *); + + /* + * Handle double clicks. + */ + virtual void contentsMouseDoubleClickEvent(QMouseEvent *e); + + virtual bool eventFilter(QObject *o, QEvent *e); + + void initItemMy(KFileIconViewItem *item, const KFileItem *i, bool upd = false); + + signals: + void invokeBrowser(); + + public slots: + void slotResetToolTip(); + + protected slots: + /* + * Show extended tooltip for 'item'. + */ + void slotShowToolTip(QIconViewItem *item); + + /* + * Remove tootip and stop timer. + */ + void slotRemoveToolTip(); + + private: + /* + * Tooltip for file item. + */ + KonqFileTip *toolTip; +}; + +#endif diff --git a/ksquirrel/sq_filethumbview.cpp b/ksquirrel/sq_filethumbview.cpp new file mode 100644 index 0000000..7d3423e --- /dev/null +++ b/ksquirrel/sq_filethumbview.cpp @@ -0,0 +1,549 @@ +/*************************************************************************** + sq_fileiconview.cpp - description + ------------------- + begin : Mon Mar 15 2004 + copyright : (C) 2004 by Baryshev Dmitry + email : ksquirrel.iv@gmail.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#include "ksquirrel.h" +#include "sq_iconloader.h" +#include "sq_config.h" +#include "sq_dir.h" +#include "sq_filethumbview.h" +#include "sq_libraryhandler.h" +#include "sq_thumbnailloadjob.h" +#include "sq_thumbnailsize.h" +#include "sq_widgetstack.h" +#include "sq_diroperator.h" +#include "sq_progress.h" +#include "sq_progressbox.h" +#include "sq_filethumbviewitem.h" +#include "sq_dragprovider.h" + +SQ_FileThumbView::SQ_FileThumbView(QWidget *parent, const char *name) : SQ_FileIconViewBase(parent, name), isPending(false) +{ + // create progress bar + m_progressBox = new SQ_ProgressBox(this); + + timerScroll = new QTimer(this); + connect(timerScroll, SIGNAL(timeout()), this, SLOT(slotDelayedContentsMoving())); + + timerAdd = new QTimer(this); + connect(timerAdd, SIGNAL(timeout()), this, SLOT(slotDelayedAddItems())); + + // setup cache limit + SQ_Config::instance()->setGroup("Thumbnails"); + m_lazy = SQ_Config::instance()->readBoolEntry("lazy", true); + lazyDelay = SQ_Config::instance()->readNumEntry("lazy_delay", 500); + if(lazyDelay <= 0) lazyDelay = 500; + m_rows = SQ_Config::instance()->readNumEntry("rows", 2); + if(m_rows <= 0 || m_rows > 5) m_rows = 2; + + setResizeMode(QIconView::Adjust); + + // load "pending" pixmaps + pending = SQ_IconLoader::instance()->loadIcon("clock", KIcon::Desktop, 32); + + connect(this, SIGNAL(contentsMoving(int, int)), this, SLOT(slotContentsMoving(int, int))); + + rebuildCachedPixmaps(); +} + +SQ_FileThumbView::~SQ_FileThumbView() +{} + +/* + * Reimplement insertItem() to enable/disable inserting + * directories (depends on current settings) and inserting thumbnails. + */ +void SQ_FileThumbView::insertItem(KFileItem *i) +{ + SQ_Config::instance()->setGroup("Fileview"); + + // directores disabled ? + if(i->isDir() && SQ_Config::instance()->readBoolEntry("disable_dirs", false)) + return; + + SQ_Config::instance()->setGroup("Thumbnails"); + + SQ_FileThumbViewItem *item; + + setUpdatesEnabled(false); + if(SQ_Config::instance()->readBoolEntry("mark", false) && SQ_LibraryHandler::instance()->libraryForFile(i->url().path())) + { + item = new SQ_FileThumbViewItem(this, i->text(), pendingCache, i); + } + else + { + QPixmap mimeall = i->pixmap(SQ_ThumbnailSize::smallest()); + QPixmap thumbnail(pixelSize.width(), pixelSize.height()); + QPainter painter(&thumbnail); + painter.setBrush(colorGroup().base()); + painter.setPen(colorGroup().highlight()); + painter.drawRect(0, 0, pixelSize.width(), pixelSize.height()); + painter.drawPixmap((pixelSize.width()-mimeall.width())/2, (pixelSize.height()-mimeall.height())/2, mimeall); + item = new SQ_FileThumbViewItem(this, i->text(), thumbnail, i); + } + + initItemMy(item, i); + + i->setExtraData(this, item); + setUpdatesEnabled(true); +} + +/* + * One thumbnail is loaded. Let's update KFileItem's pixmap. + */ +void SQ_FileThumbView::setThumbnailPixmap(const KFileItem* fileItem, const SQ_Thumbnail &t) +{ + KFileIconViewItem *iconItem = viewItem(fileItem); + + if(!iconItem) return; + + SQ_FileThumbViewItem *item = static_cast(iconItem); + + if(!item) return; + + QPixmap newpix; + + // Extended thumbnail also have mime icon and dimensions + if(SQ_ThumbnailSize::instance()->extended()) + { + QSize sz = pixelSize;//SQ_ThumbnailSize::instance()->extendedSize(); + int W = sz.width(), H = sz.height(); + + // erase original pixmap + newpix.resize(W, H); + + QPainter painter; + painter.begin(&newpix); + + painter.setPen(colorGroup().highlight()); + painter.setBrush(colorGroup().base()); + + // draw bounding rect + painter.drawRect(0, 0, W, H); + + painter.drawImage((W - t.thumbnail.width())/2, (W - t.thumbnail.height())/2, t.thumbnail); + painter.drawPixmap(W-t.mime.width()-5, H-t.mime.height()-4, t.mime); + painter.drawLine(3, W-1, W-4, W-1); + + QFont f = painter.font(); + f.setPixelSize(10); + painter.setFont(f); + + int rest = H-W-2; + + painter.setPen(colorGroup().text()); + + if(t.w && t.h) painter.drawText(4, W+rest/2-12, 100, 12, 0, QString::fromLatin1("%1x%2").arg(t.w).arg(t.h)); + + painter.drawText(4, W+rest/2+1, 100, 12, 0, KIO::convertSize(fileItem->size())); + painter.end(); + } + else + { + newpix.resize(pixelSize.width(), pixelSize.height()); + + QPainter painter; + painter.begin(&newpix); + + painter.setPen(colorGroup().highlight()); + painter.setBrush(colorGroup().base()); + + // draw bounding rect + painter.drawRect(0, 0, pixelSize.width(), pixelSize.height()); + + // draw pixmap + painter.drawImage((pixelSize.width() - t.thumbnail.width())/2, (pixelSize.height() - t.thumbnail.height())/2, t.thumbnail); + painter.end(); + } + + item->setPixmap(newpix); + item->setListed(true); + + // update item + item->repaint(); +} + +void SQ_FileThumbView::startThumbnailUpdate() +{ + stopThumbnailUpdate(); + doStartThumbnailUpdate(itemsToUpdate()); +} + +KFileItemList SQ_FileThumbView::itemsToUpdate(bool fromAll) +{ + // non-lazy mode - simply return all items + if(!m_lazy) + return *items(); + + // hehe, lazy mode + KFileItemList list; + + QRect rect(contentsX(), contentsY(), viewport()->width(), viewport()->height()); + QIconViewItem *first = fromAll ? firstItem() : findFirstVisibleItem(rect); + QIconViewItem *last = fromAll ? lastItem() : findLastVisibleItem(rect); + + if(first && last) + { + SQ_FileThumbViewItem *tfi; + + QIconViewItem *f = first; + int yy; + + if(m_rows) + { + // one row more up and down + for(int i = 0;i < m_rows;++i) + { + if(!last) break; + + last = last->nextItem(); + + if(last) + { + yy = last->y(); + + while((last = last->nextItem()) && last->y() == yy) + {} + } + } + + for(int i = 0;i < m_rows;++i) + { + f = first->prevItem(); + + if(f) + { + yy = f->y(); + + while((f = first->prevItem()) && f->y() == yy) + first = f; + } + } + } + else + last = last->nextItem(); + + for(QIconViewItem *item = first;(item && item != last);item = item->nextItem()) + { + tfi = dynamic_cast(item); + + if(tfi && !tfi->listed()) + list.append(tfi->fileInfo()); + } + } + + return list; +} + +void SQ_FileThumbView::slotContentsMoving(int, int) +{ + if(isVisible()) + timerScroll->start(lazyDelay, true); + else + waitForShowEvent(); +} + +void SQ_FileThumbView::slotDelayedContentsMoving() +{ + // restart generator in lazy mode + if(m_lazy) + { + stopThumbnailUpdate(); + doStartThumbnailUpdate(itemsToUpdate()); + } + // make visible items first items in the job + else + { + // force itemsToUpdate() return only visible items + // that need update + m_lazy = true; + KFileItemList visibleItems = itemsToUpdate(); + + if(updateRunning()) + thumbJob->pop(visibleItems); + + // restore lazy mode + m_lazy = false; + } +} + +/* + * Create job, connect signals and start updating + */ +void SQ_FileThumbView::doStartThumbnailUpdate(const KFileItemList &list) +{ + if(list.isEmpty()) + return; + + // update progress bar + SQ_WidgetStack::instance()->thumbnailUpdateStart(list.count()); + + // create new job + thumbJob = new SQ_ThumbnailLoadJob(list, this); + + connect(thumbJob, SIGNAL(thumbnailLoaded(const KFileItem*, const SQ_Thumbnail &)), + this, SLOT(setThumbnailPixmap(const KFileItem*, const SQ_Thumbnail&))); + + connect(thumbJob, SIGNAL(done()), SQ_WidgetStack::instance(), SLOT(thumbnailsUpdateEnded())); + + // start! + thumbJob->start(); +} + +// Stop thumbnail update: delete job, reset progress bar +void SQ_FileThumbView::stopThumbnailUpdate() +{ + timerScroll->stop(); + timerAdd->stop(); + newItems.clear(); + + if(!thumbJob.isNull()) + { + thumbJob->kill(); + SQ_WidgetStack::instance()->thumbnailsUpdateEnded(); + } +} + +// Start/stop thumbnail job +void SQ_FileThumbView::slotThumbnailUpdateToggle() +{ + if(!thumbJob.isNull()) + stopThumbnailUpdate(); + else + startThumbnailUpdate(); +} + +/* + * Append new items to thumbnail generating job. + */ +void SQ_FileThumbView::addItemsToJob(const KFileItemList &items, bool append) +{ + newItemsAppend = append; + + KFileItemListIterator it(items); + KFileItem *fi; + + while((fi = it.current())) + { + newItems.append(fi); + ++it; + } + + // don't confuse user with multiple updates + timerAdd->start(500, true); +} + +void SQ_FileThumbView::slotDelayedAddItems() +{ + KFileItemList _newItems = newItems; + newItems.clear(); + + if(m_lazy) + { + KFileItemList visItems = itemsToUpdate(); + KFileItemListIterator it(_newItems); + KFileItem *fi; + + while((fi = it.current())) + { + if(visItems.findRef(fi) == -1) + _newItems.removeRef(fi); // also does ++it + else + ++it; + } + } + + // job is not running + if(thumbJob.isNull()) + doStartThumbnailUpdate(_newItems); + // add new items to running job + else + { + m_progressBox->addSteps(_newItems.count()); + + if(newItemsAppend) + thumbJob->appendItems(_newItems); + else + thumbJob->prependItems(_newItems); + } +} + +/* + * Clear current view and insert "..". + */ +void SQ_FileThumbView::clearView() +{ + // stop job + stopThumbnailUpdate(); + slotRemoveToolTip(); + + pixelSize = SQ_ThumbnailSize::instance()->extended() ? + SQ_ThumbnailSize::instance()->extendedSize() : QSize(SQ_ThumbnailSize::instance()->pixelSize()+2,SQ_ThumbnailSize::instance()->pixelSize()+2); + + // clear + KFileIconView::clearView(); + + // insert ".." + insertCdUpItem(SQ_WidgetStack::instance()->url()); +} + +/* + * Is thumbnail job running ? + */ +bool SQ_FileThumbView::updateRunning() const +{ + return !thumbJob.isNull(); +} + +/* + * Insert ".." item. + */ +void SQ_FileThumbView::insertCdUpItem(const KURL &base) +{ + static const QString &dirup = KGlobal::staticQString(".."); + + KFileItem *fi = new KFileItem(base.upURL(), "inode/directory", S_IFDIR); + + // insert new item + SQ_FileThumbViewItem *item = new SQ_FileThumbViewItem(this, dirup, directoryCache, fi); + + // item ".." won't be selectable + item->setSelectable(false); + + fi->setExtraData(this, item); +} + +/* + * All files are listed. Do something important. + */ +void SQ_FileThumbView::listingCompleted() +{ + arrangeItemsInGrid(); +} + +void SQ_FileThumbView::rebuildPendingPixmap(bool dir) +{ + QPixmap pixmapDir; + + if(dir) + pixmapDir = SQ_IconLoader::instance()->loadIcon("folder", KIcon::Desktop, 48); + + QPixmap *p = dir ? &directoryCache : &pendingCache; + QPixmap *w = dir ? &pixmapDir : &pending; + + p->resize(pixelSize.width(), pixelSize.height()); + + QPainter painter(p); + painter.setBrush(colorGroup().base()); + painter.setPen(colorGroup().highlight()); + painter.drawRect(0, 0, pixelSize.width(), pixelSize.height()); + painter.drawPixmap((pixelSize.width() - w->width())/2, (pixelSize.height() - w->height())/2, *w); +} + +void SQ_FileThumbView::rebuildCachedPixmaps() +{ + pixelSize = SQ_ThumbnailSize::instance()->extended() ? + SQ_ThumbnailSize::instance()->extendedSize() : QSize(SQ_ThumbnailSize::instance()->pixelSize()+2,SQ_ThumbnailSize::instance()->pixelSize()+2); + + // rebuild "pending" thumbnail + rebuildPendingPixmap(); + + // rebuild directory pixmap + rebuildPendingPixmap(true); +} + +void SQ_FileThumbView::itemRemoved(KFileItem *i) +{ + thumbJob->itemRemoved(i); +} + +void SQ_FileThumbView::itemsRemoved(const KFileItemList &l) +{ + thumbJob->itemsRemoved(l); +} + +void SQ_FileThumbView::showEvent(QShowEvent *e) +{ + KFileIconView::showEvent(e); + + if(isPending) + { + isPending = false; + startThumbnailUpdate(); + } +} + +void SQ_FileThumbView::startDrag() +{ + SQ_Config::instance()->setGroup("Fileview"); + + if(SQ_Config::instance()->readBoolEntry("drag", true)) + { + SQ_DragProvider::instance()->setParams(this, *KFileView::selectedItems(), SQ_DragProvider::Thumbnails); + SQ_DragProvider::instance()->start(); + } + else + KFileIconView::startDrag(); +} + +void SQ_FileThumbView::setLazy(bool l, int delay) +{ + m_lazy = l; + lazyDelay = delay <= 0 ? 500 : delay; + + // non-lazy mode requires to update all thumbnails + if(!m_lazy) + { + m_lazy = true; + + stopThumbnailUpdate(); + doStartThumbnailUpdate(itemsToUpdate(true)); + + // restore lazy mode + m_lazy = false; + } +} + +void SQ_FileThumbView::resizeEvent(QResizeEvent *e) +{ + KFileIconView::resizeEvent(e); + + if(isVisible()) + timerScroll->start(lazyDelay, true); + else + waitForShowEvent(); +} + +#include "sq_filethumbview.moc" diff --git a/ksquirrel/sq_filethumbview.h b/ksquirrel/sq_filethumbview.h new file mode 100644 index 0000000..25fe274 --- /dev/null +++ b/ksquirrel/sq_filethumbview.h @@ -0,0 +1,214 @@ +/*************************************************************************** + sq_fileiconview.h - description + ------------------- + begin : Mon Mar 15 2004 + copyright : (C) 2004 by Baryshev Dmitry + email : ksquirrel.iv@gmail.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifndef SQ_FILETHUMBVIEW_H +#define SQ_FILETHUMBVIEW_H + +#include +#include + +#include "sq_fileiconviewbase.h" +#include "sq_thumbnailinfo.h" + +class QHBox; +class QToolButton; +class QTimer; + +class SQ_ProgressBox; +class SQ_ThumbnailLoadJob; +class SQ_FileThumbViewItem; + +/* + * SQ_FileThumbView represents thumbnail view. Can also update thumbnails (with the help of + * SQ_ThumbnailLoadJob) and show extended tooltips. + */ + +class SQ_FileThumbView : public SQ_FileIconViewBase +{ + Q_OBJECT + + public: + SQ_FileThumbView(QWidget *parent = 0, const char *name = ""); + ~SQ_FileThumbView(); + + bool lazy() const; + + void setLazy(bool l, int delay); + + void setAddRows(int rows); + + void rebuildCachedPixmaps(); + + /* + * Reimplement insertItem() to enable/disable inserting + * directories (depends on current settings) and inserting thumbnails. + */ + virtual void insertItem(KFileItem *i); + + /* + * Append new items to thumbnail generating job. + */ + void addItemsToJob(const KFileItemList &items, bool append = true); + + /* + * Delete item from thumbnail generating job. + */ + void itemRemoved(KFileItem *i); + void itemsRemoved(const KFileItemList &); + + /* + * Internal. + */ + virtual void updateView(bool) + {} + + /* + * Clear current view and insert "..". + */ + virtual void clearView(); + + /* + * All files are listed. Do something important. + */ + virtual void listingCompleted(); + + /* + * Create job, connect signals and start updating + */ + void doStartThumbnailUpdate(const KFileItemList &list); + + /* + * Is thumbnail job running ? + */ + bool updateRunning() const; + + /* + * Insert ".." item. + */ + virtual void insertCdUpItem(const KURL &base); + + /* + * Don't start thumbnail job until thumbnail view is hidden. + */ + void waitForShowEvent(); + + SQ_ProgressBox* progressBox() const; + + protected: + virtual void resizeEvent(QResizeEvent *); + virtual void startDrag(); + + /* + * Show event. Let's start thumbnail job, if needed. + */ + virtual void showEvent(QShowEvent *); + + private: + + /* + * rebuild "pending" thumbnail for supported items + */ + void rebuildPendingPixmap(bool dir = false); + + KFileItemList itemsToUpdate(bool fromAll = false); + + public slots: + /* + * Start and stop thumbnail update job. + */ + void startThumbnailUpdate(); + void stopThumbnailUpdate(); + + /* + * One thumbnail is loaded. Let's update KFileItem's pixmap. + */ + void setThumbnailPixmap(const KFileItem* fileItem, const SQ_Thumbnail&); + + protected slots: + /* + * Start or stop thumbnail update. + */ + void slotThumbnailUpdateToggle(); + + private slots: + + void slotContentsMoving(int, int); + void slotDelayedContentsMoving(); + void slotDelayedAddItems(); + + public: + /* + * Layout box with progress bar and "stop" button. + */ + SQ_ProgressBox *m_progressBox; + + /* + * "Stop" button. + */ + QToolButton *buttonStop; + + private: + QGuardedPtr thumbJob; + + /* + * "Pending" thumbnail. + */ + QPixmap pending; + + QTimer *timerScroll, *timerAdd; + + QPixmap directoryCache, pendingCache; + QSize pixelSize; + + KFileItemList newItems; + bool newItemsAppend; + + /* + * Thumbnail job won't start until isPending + * is false. It means, that thumbnail view currently is hidden. + */ + bool isPending; + bool m_lazy; + int lazyDelay; + int m_rows; +}; + +inline +void SQ_FileThumbView::waitForShowEvent() +{ + isPending = true; +} + +inline +SQ_ProgressBox* SQ_FileThumbView::progressBox() const +{ + return m_progressBox; +} + +inline +bool SQ_FileThumbView::lazy() const +{ + return m_lazy; +} + +inline +void SQ_FileThumbView::setAddRows(int rows) +{ + m_rows = rows; +} + +#endif diff --git a/ksquirrel/sq_filethumbviewitem.cpp b/ksquirrel/sq_filethumbviewitem.cpp new file mode 100644 index 0000000..5e31638 --- /dev/null +++ b/ksquirrel/sq_filethumbviewitem.cpp @@ -0,0 +1,67 @@ +/*************************************************************************** + sq_filethumbviewitem.cpp - description + ------------------- + begin : ??? ??? 12 2004 + copyright : (C) 2004 by Baryshev Dmitry + email : ksquirrel.iv@gmail.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include +#include + +#include + +#include "sq_filethumbviewitem.h" + +SQ_FileThumbViewItem::SQ_FileThumbViewItem(QIconView *parent, const QString &text, const QPixmap &pixmap, KFileItem *fi): + KFileIconViewItem(parent, text, pixmap, fi), m_listed(false) +{} + +SQ_FileThumbViewItem::~SQ_FileThumbViewItem() +{} + +void SQ_FileThumbViewItem::paintItem(QPainter *p, const QColorGroup &cg) +{ + KIconViewItem::paintPixmap(p, cg); + paintText(p, cg); +} + +void SQ_FileThumbViewItem::paintText(QPainter *p, const QColorGroup &cg) +{ + QRect rectText = textRect(false); + QRect rc = pixmapRect(false); + + rectText.setX(rc.x()); + rectText.setWidth(rc.width()-2); + + if(isSelected()) + { + p->fillRect(rectText, cg.highlight()); + p->setPen(QPen(cg.highlightedText())); + } + else + { + if(iconView()->itemTextBackground() != NoBrush) + p->fillRect(rectText, iconView()->itemTextBackground()); + + p->setPen(cg.text()); + } + + wordWrap()->drawText(p, textRect(false).x(), textRect(false).y(), AlignCenter); +} + +void SQ_FileThumbViewItem::paintFocus(QPainter *, const QColorGroup &) +{} diff --git a/ksquirrel/sq_filethumbviewitem.h b/ksquirrel/sq_filethumbviewitem.h new file mode 100644 index 0000000..e5e4108 --- /dev/null +++ b/ksquirrel/sq_filethumbviewitem.h @@ -0,0 +1,64 @@ +/*************************************************************************** + sq_filethumbviewitem.h - description + ------------------- + begin : ??? ??? 12 2004 + copyright : (C) 2004 by Baryshev Dmitry + email : ksquirrel.iv@gmail.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifndef SQ_FILETHUMBVIEWITEM_H +#define SQ_FILETHUMBVIEWITEM_H + +#include + +#include + +/* + * SQ_FileThumbViewItem represents a thumbnail item in SQ_FileThumbView. + * Additianally it stores some useful info. + */ + +class SQ_FileThumbViewItem : public KFileIconViewItem +{ + public: + SQ_FileThumbViewItem(QIconView *parent, const QString &text, const QPixmap &pixmap, KFileItem *fi); + ~SQ_FileThumbViewItem(); + + bool listed() const; + + void setListed(bool l); + + protected: + /* + * Painting routines. + */ + virtual void paintItem(QPainter *p, const QColorGroup &cg); + virtual void paintFocus(QPainter *p, const QColorGroup &cg); + void paintText(QPainter *p, const QColorGroup &c); + + private: + bool m_listed; +}; + +inline +bool SQ_FileThumbViewItem::listed() const +{ + return m_listed; +} + +inline +void SQ_FileThumbViewItem::setListed(bool l) +{ + m_listed = l; +} + +#endif diff --git a/ksquirrel/sq_filters.ui b/ksquirrel/sq_filters.ui new file mode 100644 index 0000000..af8ce08 --- /dev/null +++ b/ksquirrel/sq_filters.ui @@ -0,0 +1,413 @@ + +SQ_Filters + + + SQ_Filters + + + + 0 + 0 + 562 + 417 + + + + Adjust filters + + + true + + + + unnamed + + + + pushOK + + + + 1 + 0 + 0 + 0 + + + + OK + + + true + + + + + pushCancel + + + + 1 + 0 + 0 + 0 + + + + Cancel + + + + + spacer5 + + + Horizontal + + + Expanding + + + + 411 + 20 + + + + + + line2 + + + HLine + + + Sunken + + + Horizontal + + + + + layout7 + + + + unnamed + + + + groupBox2 + + + + + + + unnamed + + + 5 + + + + pushNew + + + + + + true + + + New filter + + + + + pushDelete + + + + + + true + + + true + + + Delete + + + + + pushClearAll + + + + + + true + + + Clear All + + + + + + + groupBox1 + + + + + + + unnamed + + + 5 + + + + pushFilterUp + + + true + + + + 0 + 0 + 0 + 0 + + + + + 22 + 22 + + + + + + + true + + + true + + + Move filter up + + + + + pushFilterDown + + + true + + + + 0 + 0 + 0 + 0 + + + + + 22 + 22 + + + + + + + true + + + true + + + Move filter down + + + + + + + + + spacer12 + + + Vertical + + + Expanding + + + + 20 + 145 + + + + + + layout7 + + + + unnamed + + + + + Name + + + true + + + true + + + + + Extensions + + + true + + + true + + + + listFilters + + + true + + + Manual + + + Single + + + true + + + false + + + 1 + + + AllColumns + + + Reject + + + + + checkBoth + + + Menu item contains both name and extension + + + + + + + + + pushFilterUp + clicked() + SQ_Filters + slotFilterUp() + + + pushFilterDown + clicked() + SQ_Filters + slotFilterDown() + + + listFilters + rightButtonClicked(QListViewItem*,const QPoint&,int) + SQ_Filters + slotFilterRenameRequest(QListViewItem*,const QPoint&,int) + + + pushOK + clicked() + SQ_Filters + accept() + + + pushCancel + clicked() + SQ_Filters + reject() + + + pushNew + clicked() + SQ_Filters + slotNewFilter() + + + pushClearAll + clicked() + listFilters + clear() + + + pushDelete + clicked() + SQ_Filters + slotFilterClear() + + + + listFilters + checkBoth + pushNew + pushDelete + pushClearAll + pushFilterUp + pushFilterDown + pushOK + pushCancel + + + sq_config.h + sq_iconloader.h + ksquirrel.h + sq_filters.ui.h + + + slotNewFilter() + slotFilterClear() + slotFilterUp() + slotFilterDown() + start() + slotFilterRenameRequest( QListViewItem * item, const QPoint &, int pos ) + + + init() + + + diff --git a/ksquirrel/sq_filters.ui.h b/ksquirrel/sq_filters.ui.h new file mode 100644 index 0000000..286fecc --- /dev/null +++ b/ksquirrel/sq_filters.ui.h @@ -0,0 +1,138 @@ +/**************************************************************************** +** ui.h extension file, included from the uic-generated form implementation. +** +** If you wish to add, delete or rename functions or slots use +** Qt Designer which will update this file, preserving your code. Create an +** init() function in place of a constructor, and a destroy() function in +** place of a destructor. +*****************************************************************************/ + +void SQ_Filters::init() +{ + listFilters->setSorting(-1); + + QListViewItem *itemafter = 0L, *item; + + QValueList::iterator nEND = KSquirrel::app()->filtersNames()->end(); + QValueList::iterator it_name = KSquirrel::app()->filtersNames()->begin(); + QValueList::iterator it_ext = KSquirrel::app()->filtersExtensions()->begin(); + + for(;it_name != nEND;++it_name,++it_ext) + { + if(itemafter) + item = new QListViewItem(listFilters, itemafter, *it_name, *it_ext); + else + item = new QListViewItem(listFilters, *it_name, *it_ext); + + itemafter = item; + + item->setRenameEnabled(0, true); + item->setRenameEnabled(1, true); + item->setMultiLinesEnabled(false); + + listFilters->insertItem(item); + } + + pushFilterUp->setPixmap(SQ_IconLoader::instance()->loadIcon("move_task_up", KIcon::Desktop, KIcon::SizeSmall)); + pushFilterDown->setPixmap(SQ_IconLoader::instance()->loadIcon("move_task_down", KIcon::Desktop, KIcon::SizeSmall)); + pushNew->setPixmap(SQ_IconLoader::instance()->loadIcon("filenew", KIcon::Desktop, KIcon::SizeSmall)); + pushDelete->setPixmap(SQ_IconLoader::instance()->loadIcon("editdelete", KIcon::Desktop, KIcon::SizeSmall)); + pushClearAll->setPixmap(SQ_IconLoader::instance()->loadIcon("edittrash", KIcon::Desktop, KIcon::SizeSmall)); + + listFilters->setCurrentItem(listFilters->firstChild()); + listFilters->clearSelection(); + listFilters->setSelected(listFilters->currentItem(), true); + + SQ_Config::instance()->setGroup("Filters"); + + checkBoth->setChecked(SQ_Config::instance()->readBoolEntry("menuitem both", true)); +} + +void SQ_Filters::slotNewFilter() +{ + QListViewItem *itemafter = listFilters->lastItem(), *item; + + if(itemafter) + item = new QListViewItem(listFilters, itemafter, i18n("Name"), "*."); + else + item = new QListViewItem(listFilters, i18n("Name"), "*."); + + item->setRenameEnabled(0, true); + item->setRenameEnabled(1, true); + item->setMultiLinesEnabled(false); + listFilters->insertItem(item); + item->startRename(0); + +} + +void SQ_Filters::slotFilterClear() +{ + QListViewItem *item = listFilters->currentItem(); + + if(!item) return; + + listFilters->takeItem(item); + + item = listFilters->currentItem(); + + if(item) + listFilters->setSelected(item, true); +} + +void SQ_Filters::slotFilterUp() +{ + QListViewItem *item = listFilters->currentItem(); + + if(!item) return; + + QListViewItem *itemafter = item->itemAbove(); + + if(!itemafter) return; + + itemafter->moveItem(item); +} + +void SQ_Filters::slotFilterDown() +{ + QListViewItem *item = listFilters->currentItem(); + + if(!item) return; + + QListViewItem *itemafter = item->itemBelow(); + + if(!itemafter) return; + + item->moveItem(itemafter); + +} + +int SQ_Filters::start() +{ + int result = exec(); + + if(result == QDialog::Accepted) + { + QListViewItem *cur = listFilters->firstChild(); + + KSquirrel::app()->filtersNames()->clear(); + KSquirrel::app()->filtersExtensions()->clear(); + + for(;cur;cur = cur->itemBelow()) + { + KSquirrel::app()->filtersNames()->append(cur->text(0)); + KSquirrel::app()->filtersExtensions()->append(cur->text(1)); + } + + SQ_Config::instance()->setGroup("Filters"); + SQ_Config::instance()->writeEntry("menuitem both", checkBoth->isChecked()); + } + + return result; +} + + +void SQ_Filters::slotFilterRenameRequest( QListViewItem *item, const QPoint &, int pos ) +{ + if(item) + item->startRename(((pos>=0)?pos:0)); +} diff --git a/ksquirrel/sq_glinfo.ui b/ksquirrel/sq_glinfo.ui new file mode 100644 index 0000000..5cc7261 --- /dev/null +++ b/ksquirrel/sq_glinfo.ui @@ -0,0 +1,165 @@ + +SQ_GLInfo + + + SQ_GLInfo + + + + 0 + 0 + 542 + 233 + + + + OpenGL information + + + true + + + + unnamed + + + + + Parameter + + + true + + + true + + + + + Value + + + true + + + true + + + + + GL_VENDOR + + + + + + + + + + + + + + GL_RENDERER + + + + + + + + + + + + + + GL_VERSION + + + + + + + + + + + + + listGL + + + true + + + 2 + + + LastColumn + + + + + line8 + + + HLine + + + Sunken + + + Horizontal + + + + + pushClose + + + Close + + + + + spacer15 + + + Horizontal + + + Expanding + + + + 431 + 21 + + + + + + + + pushClose + clicked() + SQ_GLInfo + reject() + + + + pushClose + listGL + + + GL/gl.h + qmap.h + sq_glinfo.ui.h + + + init() + + + diff --git a/ksquirrel/sq_glinfo.ui.h b/ksquirrel/sq_glinfo.ui.h new file mode 100644 index 0000000..52b92f5 --- /dev/null +++ b/ksquirrel/sq_glinfo.ui.h @@ -0,0 +1,38 @@ +/**************************************************************************** +** ui.h extension file, included from the uic-generated form implementation. +** +** If you want to add, delete, or rename functions or slots, use +** Qt Designer to update this file, preserving your code. +** +** You should not define a constructor or destructor in this file. +** Instead, write your code in functions called init() and destroy(). +** These will automatically be called by the form's constructor and +** destructor. +*****************************************************************************/ + +void SQ_GLInfo::init() +{ + listGL->setSorting(-1); + + QListViewItem *item; + QMap v; + + v.insert("GL_VENDOR", GL_VENDOR); + v.insert("GL_RENDERER", GL_RENDERER); + v.insert("GL_VERSION", GL_VERSION); + + for(QMap::ConstIterator it = v.constBegin(); it != v.constEnd(); ++it) + { + item = listGL->findItem(it.key().latin1(), 0); + + if(item) + { + const GLubyte *b = glGetString(it.data()); + + if(b) + { + item->setText(1, (const char*)b); + } + } + } +} diff --git a/ksquirrel/sq_glparts.cpp b/ksquirrel/sq_glparts.cpp new file mode 100644 index 0000000..34a523d --- /dev/null +++ b/ksquirrel/sq_glparts.cpp @@ -0,0 +1,219 @@ +/*************************************************************************** + sq_glparts.cpp - description + ------------------- + begin : ??? ??? 13 2007 + copyright : (C) 2007 by Baryshev Dmitry + email : ksquirrel.iv@gmail.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#include "sq_glparts.h" +#include "sq_library.h" + +#include + +/* ***************************************************************************************** */ + +Parts::Parts() : w(0), h(0), realw(0), realh(0), m_parts(0), buffer(0) +{} + +Part::Part() : x1(0), y1(0), x2(0), y2(0), tex(0), list(0) +{} + +/* ***************************************************************************************** */ + +memoryPart::memoryPart(const int sz) : m_size(sz), m_data(0) +{} + +memoryPart::~memoryPart() +{ + del(); +} + +void memoryPart::create() +{ + m_data = new RGBA [m_size]; + +// if(m_data) +// memset(m_data, 0, m_size * sizeof(RGBA)); +} + +// Delete textures and display lists. +void Parts::removeParts() +{ + if(!m_parts.empty()) + { + int toy = tilesy.size(); + int toxy = tilesx.size() * toy; + + for(int z = 0;z < toxy;z++) + glDeleteTextures(1, &m_parts[z].tex); + + glDeleteLists(m_parts[0].list, toy); + + m_parts.clear(); + } +} + +// Create parts: generate textures and display lists. +bool Parts::makeParts() +{ + int z; + int toy = tilesy.size(); + + GLuint base = glGenLists(toy); + + if(!base) + return false; + + Part pt; + int tox = tilesx.size(); + int toxy = tox * toy; + + for(z = 0;z < toxy;z++) + { + glGenTextures(1, &pt.tex); + m_parts.push_back(pt); + } + + // calculate display list's id + for(z = 0;z < toy;z++) + m_parts[z * tox].list = base + z; + + return true; +} + +// Calculate coordinates for textures +void Parts::computeCoords() +{ + Part *p; + int index = 0; + float X, Y; + + Y = (float)h / 2.0; + + int tlsy = tilesy.size(); + int tlsx = tilesx.size(); + + for(int y = 0;y < tlsy;y++) + { + X = -(float)w / 2.0; + + for(int x = 0;x < tlsx;x++) + { + p = &m_parts[index]; + + p->x1 = X; + p->y1 = Y; + p->x2 = X + tilesx[x]; + p->y2 = Y - tilesy[y]; + + p->tx1 = 0.0; + p->tx2 = 1.0; + p->ty1 = 0.0; + p->ty2 = 1.0; + + index++; + X += tilesx[x]; + } + + Y -= tilesy[y]; + } +} + +/* ***************************************************************************************** */ + +Tab::Tab() +{ + empty(); +} + +Tab::~Tab() +{} + +void Tab::clearParts() +{ + if(broken) return; + + std::vector::iterator itEnd = parts.end(); + + for(std::vector::iterator it = parts.begin();it != itEnd;++it) + { + // delete textures and memory buffers + (*it).removeParts(); + (*it).deleteBuffer(); + } + + parts.clear(); + + finfo.image.clear(); + finfo.meta.clear(); +} + +void Tab::removeParts() +{ + if(broken) return; + + std::vector::iterator itEnd = parts.end(); + + for(std::vector::iterator it = parts.begin();it != itEnd;++it) + (*it).removeParts(); +} + +void Tab::remakeParts() +{ + if(broken) return; + + std::vector::iterator itEnd = parts.end(); + + for(std::vector::iterator it = parts.begin();it != itEnd;++it) + { + (*it).makeParts(); + (*it).computeCoords(); + } +} + +void Tab::empty() +{ + nullMatrix(); + + orient = -1; + rotate = 0; + fmt_size = 0; + lib = 0; + codeK = 0; + current = 0; + curangle = 0; + total = 0; + sx = sy = sw = sh = 0; + elapsed = 0; + + wm = QWMatrix(); + + glselection = -1; + srect = QRect(); + + manualBlocked = false; + isflippedV = isflippedH = false; + broken = false; + + m_original = KURL(); + File = QString::null; + m_File = QString::null; + quickImageInfo = QString::null; + fmt_ext = QString::null; +} + +void Tab::nullMatrix() +{ + for(int i = 0;i < 12;i++) + matrix[i] = (GLfloat)(i % 5 == 0); +} diff --git a/ksquirrel/sq_glparts.h b/ksquirrel/sq_glparts.h new file mode 100644 index 0000000..3405f33 --- /dev/null +++ b/ksquirrel/sq_glparts.h @@ -0,0 +1,152 @@ +/*************************************************************************** + sq_glparts.h - description + ------------------- + begin : ??? Mar 13 2007 + copyright : (C) 2007 by Baryshev Dmitry + email : ksquirrel.iv@gmail.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifndef SQ_GLPARTS_H +#define SQ_GLPARTS_H + +#include + +#include +#include + +#include + +#include + +#include + +struct SQ_LIBRARY; +class fmt_codec_base; + +class memoryPart +{ + public: + memoryPart(const int sz); + ~memoryPart(); + + // create/delete memory buffer + void create(); + void del(); + + bool valid() const; + RGBA *data(); + + private: + int m_size; + RGBA *m_data; +}; + +inline +RGBA* memoryPart::data() +{ + return m_data; +} + +inline +void memoryPart::del() +{ + delete [] m_data; + m_data = 0; +} + +inline +bool memoryPart::valid() const +{ + return m_data != 0; +} + +/* *************************************************************** */ + +struct Part +{ + Part(); + + float x1, y1, x2, y2, tx1, tx2, ty1, ty2; + unsigned int tex; + GLuint list; +}; + +/* *************************************************************** */ + +// one image page. All pages are stored in SQ_GLWidget::parts +struct Parts +{ + Parts(); + + int w, h, realw, realh; + + std::vector m_parts; + std::vector tilesx, tilesy; + memoryPart *buffer; + + bool makeParts(); + void removeParts(); + void computeCoords(); + void deleteBuffer(); +}; + +inline +void Parts::deleteBuffer() +{ + delete buffer; + buffer = 0; +} + +/* *************************************************************** */ + +struct Tab +{ + Tab(); + ~Tab(); + + void nullMatrix(); + void empty(); + void clearParts(); + void removeParts(); + void remakeParts(); + + GLfloat matrix[12]; + GLfloat curangle; + + KURL m_original; + QString File, m_File, quickImageInfo; + QString fmt_ext; + + QWMatrix wm; + QRect srect; + + int orient; + int current; + int fmt_size; + int total; + int glselection; + int sx, sy, sw, sh; + int elapsed; + + bool rotate; + bool manualBlocked; + bool isflippedV, isflippedH; + bool broken; + + std::vector parts; + fmt_info finfo; + + SQ_LIBRARY *lib; + fmt_codec_base *codeK; +}; + +#endif diff --git a/ksquirrel/sq_glselectionpainter.cpp b/ksquirrel/sq_glselectionpainter.cpp new file mode 100644 index 0000000..3d60389 --- /dev/null +++ b/ksquirrel/sq_glselectionpainter.cpp @@ -0,0 +1,145 @@ +/*************************************************************************** + sq_glselectionpainter.cpp - description + ------------------- + begin : Apr 4 2007 + copyright : (C) 2007 by Baryshev Dmitry + email : ksquirrel.iv@gmail.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#include +#include + +#include + +#include "sq_glwidget.h" +#include "sq_glselectionpainter.h" + +static const int len = 4; +static const int len2 = 10; +static const int lenc = 2; +static const int lenc2 = lenc / 2; +static const double rad_const = 3.14159265358979323846 / 180.0; + +/* ******************************************************************* */ + +SQ_GLSelectionPainter::SQ_GLSelectionPainter(SQ_GLWidget *widget) + : w(widget), sourcew(1), sourceh(1), sw(0), sh(0), sx(0), sy(0), + angle(0), m_valid(false), m_shown(false) +{} + +SQ_GLSelectionPainter::~SQ_GLSelectionPainter() +{} + +void SQ_GLSelectionPainter::begin(Type tp, int x, int y, bool U) +{ + // end previous drawing if any + end(); + + m_type = tp; + + hackXY(x, y); + + sx = xmoveold = x; + sy = ymoveold = y; + sw = 0; + sh = 0; + + m_valid = true; + m_shown = true; + + if(U) w->updateGLA(); +} + +void SQ_GLSelectionPainter::move(int x, int y) +{ + hackXY(x, y); + + int X = QMAX(x, xmoveold); + int Y = QMIN(y, ymoveold); + int Xmin = QMIN(x, xmoveold); + int Ymin = QMAX(y, ymoveold); + + sx = Xmin; + sy = Ymin; + sw = X - Xmin; + sh = Ymin - Y; + + angle += 3; + + if(angle > 360) + angle = 0; + + // SQ_GLWidget::paintGL() will call draw() + w->updateGLA(); +} + +void SQ_GLSelectionPainter::end() +{ + m_valid = false; + m_shown = false; + + w->updateGLA(); +} + +void SQ_GLSelectionPainter::drawEllipse(float xradius, float yradius) +{ + w->makeCurrent(); + + double degInRad; + + glBegin(GL_LINE_LOOP); + glColor4f(1,0,1,1); + + for(int i = 0; i < 360; i++) + { + degInRad = rad_const * i; + glVertex2f(cos(degInRad) * xradius, sin(degInRad) * yradius); + } + + glColor4f(1,1,1,1); + glEnd(); +} + +void SQ_GLSelectionPainter::drawRect() +{ + w->makeCurrent(); + + glBegin(GL_LINE_LOOP); + glColor4f(1,0,1,1); + + glVertex2f(-sw/2, sh/2); + glVertex2f(sw/2, sh/2); + glVertex2f(sw/2, -sh/2); + glVertex2f(-sw/2, -sh/2); + + glColor4f(1,1,1,1); + glEnd(); +} + +void SQ_GLSelectionPainter::draw() +{ + if(!sw || !sh) + return; + + if(m_type == Ellipse) + drawEllipse(sw/2, sh/2); + else + drawRect(); + + // center rectangle + if(sw > lenc && sh > lenc) + { + glColor4f(1,0,1,1); + glRectf(-lenc2, lenc2, lenc2, -lenc2); + glColor4f(1,1,1,1); + } +} diff --git a/ksquirrel/sq_glselectionpainter.h b/ksquirrel/sq_glselectionpainter.h new file mode 100644 index 0000000..59a6ce2 --- /dev/null +++ b/ksquirrel/sq_glselectionpainter.h @@ -0,0 +1,151 @@ +/*************************************************************************** + sq_glselectionpainter.h - description + ------------------- + begin : Apr 4 2007 + copyright : (C) 2007 by Baryshev Dmitry + email : ksquirrel.iv@gmail.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifndef SQ_GLSELECTIONPAINTER_H +#define SQ_GLSELECTIONPAINTER_H + +#include +#include + +class SQ_GLWidget; + +/* + * This is a selection painter for SQ_GLWidget. + * + * Selection can be shown as rectangle and ellipse. + * + * Ellipsis selection mainly used in redeye filter. + */ + +class SQ_GLSelectionPainter +{ + public: + enum Type { Rectangle, Ellipse }; + + SQ_GLSelectionPainter(SQ_GLWidget *widget); + ~SQ_GLSelectionPainter(); + + void setSourceSize(int, int); + + QPoint center() const; + + void draw(); + + /* + * Set selection type - rectangle or ellipse + */ + int type() const; + + /* + * when selection is drawn and visible, it's valid. + * After end() it becomes invalid. + */ + bool valid() const; + + void setVisible(bool vis); + + void begin(Type tp, int x, int y, bool U = true); + void move(int x, int y); + void setGeometry(const QRect &rc); + void end(); + + /* + * Selected rectangle geometry + */ + QPoint pos() const; + QSize size() const; + + private: + void drawEllipse(float xradius, float yradius); + void drawRect(); + void hackXY(int &x, int &y); + + private: + SQ_GLWidget *w; + int sourcew, sourceh; + int sw, sh, sx, sy; + + int angle; + int xmoveold, ymoveold; + bool m_valid, m_shown; + Type m_type; +}; + +inline +QPoint SQ_GLSelectionPainter::pos() const +{ + return valid() ? QPoint(sourcew/2 + sx, sourceh/2 - sy) : QPoint(); +} + +inline +QSize SQ_GLSelectionPainter::size() const +{ + return valid() ? QSize(sw, sh) : QSize(); +} + +inline +int SQ_GLSelectionPainter::type() const +{ + return m_type; +} + +inline +void SQ_GLSelectionPainter::setGeometry(const QRect &rc) +{ + int X = rc.x(), Y = rc.y(); + + hackXY(X, Y); + + sx = X; + sy = Y; + sw = rc.width(); + sh = rc.height(); +} + +inline +void SQ_GLSelectionPainter::setSourceSize(int w, int h) +{ + sourcew = w; + sourceh = h; +} + +inline +void SQ_GLSelectionPainter::setVisible(bool vis) +{ + if(m_valid) m_shown = vis; +} + +inline +bool SQ_GLSelectionPainter::valid() const +{ + return m_valid && m_shown; +} + +inline +QPoint SQ_GLSelectionPainter::center() const +{ + return QPoint(sx + sw/2, sy - sh/2); +} + +inline +void SQ_GLSelectionPainter::hackXY(int &x, int &y) +{ + x -= sourcew / 2; + y = sourceh / 2 - y; +} + +#endif diff --git a/ksquirrel/sq_glu.cpp b/ksquirrel/sq_glu.cpp new file mode 100644 index 0000000..8e17e31 --- /dev/null +++ b/ksquirrel/sq_glu.cpp @@ -0,0 +1,110 @@ +/*************************************************************************** + sq_glu.cpp - description + ------------------- + begin : ??? ??? 29 2004 + copyright : (C) 2004 by Baryshev Dmitry + email : ksquirrel.iv@gmail.com + ***************************************************************************/ + +/* + * Mesa 3-D graphics library + * Version: 3.5 + * Copyright (C) 1995-2001 Brian Paul + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include "sq_glu.h" + +#include + +/* + * Replacement for gluLookAt(). + */ +void SQ_GLU::gluLookAt(GLdouble eyex, GLdouble eyey, GLdouble eyez, GLdouble centerx, GLdouble centery, GLdouble centerz, GLdouble upx, GLdouble upy, GLdouble upz) +{ + GLdouble m[16]; + GLdouble x[3], y[3], z[3]; + GLdouble mag; + + z[0] = eyex - centerx; + z[1] = eyey - centery; + z[2] = eyez - centerz; + + mag = sqrt(z[0] * z[0] + z[1] * z[1] + z[2] * z[2]); + + if(mag) + { + z[0] /= mag; + z[1] /= mag; + z[2] /= mag; + } + + y[0] = upx; + y[1] = upy; + y[2] = upz; + + x[0] = y[1] * z[2] - y[2] * z[1]; + x[1] = -y[0] * z[2] + y[2] * z[0]; + x[2] = y[0] * z[1] - y[1] * z[0]; + + y[0] = z[1] * x[2] - z[2] * x[1]; + y[1] = -z[0] * x[2] + z[2] * x[0]; + y[2] = z[0] * x[1] - z[1] * x[0]; + + mag = sqrt(x[0] * x[0] + x[1] * x[1] + x[2] * x[2]); + + if(mag) + { + x[0] /= mag; + x[1] /= mag; + x[2] /= mag; + } + + mag = sqrt(y[0] * y[0] + y[1] * y[1] + y[2] * y[2]); + + if(mag) + { + y[0] /= mag; + y[1] /= mag; + y[2] /= mag; + } + +#define M(row,col) m[col*4+row] + M(0, 0) = x[0]; + M(0, 1) = x[1]; + M(0, 2) = x[2]; + M(0, 3) = 0.0; + M(1, 0) = y[0]; + M(1, 1) = y[1]; + M(1, 2) = y[2]; + M(1, 3) = 0.0; + M(2, 0) = z[0]; + M(2, 1) = z[1]; + M(2, 2) = z[2]; + M(2, 3) = 0.0; + M(3, 0) = 0.0; + M(3, 1) = 0.0; + M(3, 2) = 0.0; + M(3, 3) = 1.0; +#undef M + + glMultMatrixd(m); + glTranslated(-eyex, -eyey, -eyez); +} diff --git a/ksquirrel/sq_glu.h b/ksquirrel/sq_glu.h new file mode 100644 index 0000000..9128d12 --- /dev/null +++ b/ksquirrel/sq_glu.h @@ -0,0 +1,50 @@ +/*************************************************************************** + sq_glu.h - description + ------------------- + begin : ??? ??? 29 2004 + copyright : (C) 2004 by Baryshev Dmitry + email : ksquirrel.iv@gmail.com + ***************************************************************************/ +/* + * Mesa 3-D graphics library + * Version: 3.5 + * Copyright (C) 1995-2001 Brian Paul + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#ifndef SQ_GLU_H +#define SQ_GLU_H + +#include + +/* + * SQ_GLU is a replacement for libGLU. SQ_GLWidget uses only one method + * in original GLU library - gluLookAt(). It would be better to place it + * in standalone namespace, and remove -lGLU dependency at all. + * + * Note: Now KSquirrel doesn't use GLU, but Qt's QGLWidget still + * depends on + */ + +namespace SQ_GLU +{ + /* + * Replacement for gluLookAt(). + */ + void gluLookAt(GLdouble,GLdouble,GLdouble,GLdouble,GLdouble,GLdouble,GLdouble,GLdouble,GLdouble); +}; + +#endif diff --git a/ksquirrel/sq_glview.cpp b/ksquirrel/sq_glview.cpp new file mode 100644 index 0000000..56f9645 --- /dev/null +++ b/ksquirrel/sq_glview.cpp @@ -0,0 +1,360 @@ +/*************************************************************************** + sq_glview.cpp - description + ------------------- + begin : ??? ??? 5 2004 + copyright : (C) 2004 by Baryshev Dmitry + email : ksquirrel.iv@gmail.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "sq_glview.h" +#include "sq_glwidget.h" +#include "sq_glwidget_helpers.h" +#include "sq_config.h" +#include "sq_iconloader.h" + +#include "ksquirrel.h" +#include "sq_widgetstack.h" + +SQ_GLView * SQ_GLView::m_instance = 0; + +SQ_GLView::SQ_GLView(QWidget *parent) : QVBox(parent, "ksquirrel-image-window") +{ + m_instance = this; + + createContent(); + + installEventFilter(this); +} + +SQ_GLView::~SQ_GLView() +{} + +void SQ_GLView::createContent() +{ + box = new QVBox(this); + + m_toolbar = new SQ_ToolBar(box); + m_toolbar->setMouseTracking(true); + + SQ_Config::instance()->setGroup("GL view"); + + // read settings + m_tabs = SQ_Config::instance()->readBoolEntry("tabs", false); + m_tabsclose = SQ_Config::instance()->readBoolEntry("tabs_close", true); + + m_tabbar = new KTabBar(box); + m_tabbar->setHoverCloseButton(m_tabsclose); + m_tabbar->setHoverCloseButtonDelayed(false); + m_tabbar->setMouseTracking(true); + m_tabbar->setFocusPolicy(QWidget::NoFocus); + + box->setStretchFactor(m_toolbar, 1); + + m_tabbar->setShown(false); + + gl = new SQ_GLWidget(this, "ksquirrel-opengl-widget"); + gl->glInitA(); + gl->setFocus(); + + connect(m_tabbar, SIGNAL(selected(int)), gl, SLOT(slotChangeTab(int))); + connect(m_tabbar, SIGNAL(closeRequest(int)), gl, SLOT(slotCloseRequest(int))); + connect(m_tabbar, SIGNAL(mouseMiddleClick(int)), gl, SLOT(slotCloseRequest(int))); + connect(gl, SIGNAL(tabCountChanged()), this, SLOT(slotTabCountChanged())); + + setStretchFactor(gl, 1); + + sbar = new KStatusBar(this); + sbar->setMouseTracking(true); + + // create QLabels, fill 'names' with pointers + QHBox *sqSBDecodedBox = new QHBox; + sqSBDecodedBox->setSpacing(2); + QLabel *sqSBDecodedI = new QLabel(QString::null, sqSBDecodedBox, "SBDecodedI"); + names.insert("SBDecodedI", sqSBDecodedI); + QLabel *sqSBDecoded = new QLabel(QString::null, sqSBDecodedBox, "SBDecoded"); + names.insert("SBDecoded", sqSBDecoded); + + QLabel *sqSBGLZoom = new QLabel(QString::null, 0, "SBGLZoom"); + names.insert("SBGLZoom", sqSBGLZoom); + QLabel *sqSBGLAngle = new QLabel(QString::null, 0, "SBGLAngle"); + names.insert("SBGLAngle", sqSBGLAngle); + QLabel *sqSBLoaded = new QLabel(QString::null, 0, "SBLoaded"); + QToolTip::add(sqSBLoaded, i18n("Loading time")); + names.insert("SBLoaded", sqSBLoaded); + QLabel *sqSBFrame = new QLabel(QString::null, 0, "SBFrame"); + names.insert("SBFrame", sqSBFrame); + QLabel *sqSBFile = new KSqueezedTextLabel(QString::null, 0, "SBFile"); + names.insert("SBFile", sqSBFile); + + sqSBFrame->setAlignment(Qt::AlignHCenter | Qt::AlignVCenter | Qt::ExpandTabs); + sqSBFile->setAlignment(Qt::AlignRight | Qt::AlignTop); + QFont font = sqSBFile->font(); + font.setBold(true); + sqSBFile->setFont(font); + + // fill statusbar + sbar->addWidget(sqSBDecodedBox, 0, true); + sbar->addWidget(sqSBFrame, 0, true); + sbar->addWidget(sqSBLoaded, 0, true); + sbar->addWidget(sqSBGLZoom, 0, true); + sbar->addWidget(sqSBGLAngle, 0, true); + sbar->addWidget(sqSBFile, 1, true); + + resetStatusBar(); + + sbar->setShown(SQ_Config::instance()->readBoolEntry("statusbar", true)); + + // restore geometry from config file + restoreGeometry(); + + gl->matrixChanged(); +} + +void SQ_GLView::closeEvent(QCloseEvent *e) +{ + // ignore event + e->ignore(); + + // let KSquirrel close SQ_GLView, since it can be built-in + KSquirrel::app()->closeGLWidget(); +} + +bool SQ_GLView::eventFilter(QObject *watched, QEvent *e) +{ + if(watched == this) + { + // stop animation, if SQ_GLView is hidden (animation becomes useless) + if(/*e->type() == QEvent::WindowDeactivate || */e->type() == QEvent::Hide) + { + gl->stopAnimation(); + return true; + } + // resume animation, if needed + else if(/*e->type() == QEvent::WindowActivate || */e->type() == QEvent::Show) + { + if(!gl->manualBlocked()) + gl->startAnimation(); + + return true; + } + else // call to default eventFilter() + return QVBox::eventFilter(watched, e); + } + else + return QVBox::eventFilter(watched, e); +} + +void SQ_GLView::saveGeometry() +{ + SQ_Config::instance()->writeEntry("pos", pos()); + SQ_Config::instance()->writeEntry("size", size()); +} + +void SQ_GLView::restoreGeometry() +{ + QPoint p_def(0,0); + QSize sz_def(660, 480); + + SQ_Config::instance()->setGroup("GL view"); + + QPoint p = SQ_Config::instance()->readPointEntry("pos", &p_def); + QSize sz = SQ_Config::instance()->readSizeEntry("size", &sz_def); + + move(p); + resize(sz); +} + +/* + * Reset all statusbar's labels to default values. + */ +void SQ_GLView::resetStatusBar() +{ + QString fl = QString::fromLatin1("----"); + + names["SBGLZoom"]->setText(fl); + names["SBGLAngle"]->setText(fl); + names["SBLoaded"]->setText(fl); + names["SBDecodedI"]->setText(QString::fromLatin1("--")); + names["SBFile"]->setText(QString::fromLatin1("--------")); + names["SBDecoded"]->setText(fl); + names["SBFrame"]->setText(QString::fromLatin1("0/0")); +} + +SQ_ToolBar::SQ_ToolBar(QWidget *parent) : KToolBar(parent) +{ + setFixedHeight(SQ_ToolButton::fixedWidth() + 5); + boxLayout()->setSpacing(0); + boxLayout()->setMargin(0); +} + +SQ_ToolBar::~SQ_ToolBar() +{} + +void SQ_ToolBar::mouseReleaseEvent(QMouseEvent *e) +{ + e->accept(); +} + +void SQ_GLView::addPage(const QString &label) +{ + QTab *tab = new QTab(label); + + m_tabbar->addTab(tab); + + SQ_Config::instance()->setGroup("GL view"); + + if(m_tabsclose) + tab->setIconSet(SmallIcon("fileclose")); +} + +void SQ_GLView::removePage(int index) +{ + m_tabbar->removeTab(m_tabbar->tabAt(index)); + m_tabbar->setHidden(m_tabbar->count() <= 1); +} + +void SQ_GLView::removeTabs() +{ + blockSignals(true); + int cnt = m_tabbar->count(); + + while(cnt--) + m_tabbar->removeTab(m_tabbar->tabAt(0)); + + blockSignals(false); +} + +void SQ_GLView::setupTabbar() +{ + SQ_Config::instance()->setGroup("GL view"); + + int cnt; + + if(m_tabsclose != SQ_Config::instance()->readBoolEntry("tabs_close", true)) + { + m_tabsclose = SQ_Config::instance()->readBoolEntry("tabs_close", true); + + // change iconset + cnt = m_tabbar->count(); + + for(int i = 0;i < cnt;i++) + m_tabbar->tabAt(i)->setIconSet(m_tabsclose ? SmallIcon("fileclose") : QPixmap()); + + m_tabbar->setHoverCloseButton(m_tabsclose); + m_tabbar->layoutTabs(); + } + + if(m_tabs == SQ_Config::instance()->readBoolEntry("tabs", false)) + return; + + blockSignals(true); + + m_tabs = SQ_Config::instance()->readBoolEntry("tabs", false); + + m_tabbar->setHoverCloseButton(m_tabsclose); + m_tabbar->setShown(m_tabs); + + int id = m_tabbar->currentTab(); + + if(id == -1) + { + if(m_tabs) m_tabbar->setHidden(m_tabbar->count() <= 1); + blockSignals(false); + return; + } + + int index = m_tabbar->indexOf(id); + + // remove other tabs if needed + if(!m_tabs) + { + int ind = 0; + cnt = m_tabbar->count(); + cnt--; + + while(cnt--) + { + if(m_tabbar->tabAt(ind)->identifier() == id) + { + ind++; + continue; + } + + m_tabbar->removeTab(m_tabbar->tabAt(ind)); + } + } + else + m_tabbar->setHidden(m_tabbar->count() <= 1); + + blockSignals(false); + + if(!m_tabs) + gl->removeNonCurrentTabs(index); +} + +void SQ_GLView::slotTabCountChanged() +{ + if(m_tabs) + m_tabbar->setHidden(m_tabbar->count() <= 1); +} + +void SQ_GLView::leftTab() +{ + int index = m_tabbar->indexOf(m_tabbar->currentTab()); + + // smth went wrong + if(index < 0) return; + + index--; + if(index < 0) + index = m_tabbar->count() - 1; + + if(index < 0) return; + + m_tabbar->setCurrentTab(m_tabbar->tabAt(index)); +} + +void SQ_GLView::rightTab() +{ + int index = m_tabbar->indexOf(m_tabbar->currentTab()); + + // smth went wrong + if(index < 0) return; + + index++; + if(index >= m_tabbar->count()) + index = 0; + + m_tabbar->setCurrentTab(m_tabbar->tabAt(index)); +} + +#include "sq_glview.moc" diff --git a/ksquirrel/sq_glview.h b/ksquirrel/sq_glview.h new file mode 100644 index 0000000..a19fe7c --- /dev/null +++ b/ksquirrel/sq_glview.h @@ -0,0 +1,201 @@ +/*************************************************************************** + sq_glview.h - description + ------------------- + begin : ??? ??? 5 2004 + copyright : (C) 2004 by Baryshev Dmitry + email : ksquirrel.iv@gmail.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifndef SQ_GLVIEW_H +#define SQ_GLVIEW_H + +#include +#include + +#include + +class SQ_GLWidget; +class SQ_LibraryListener; +class SQ_LibraryHandler; +class SQ_Config; + +class KStatusBar; +class KTabBar; + +class QLabel; + +class SQ_ToolBar : public KToolBar +{ + public: + SQ_ToolBar(QWidget *parent); + ~SQ_ToolBar(); + + protected: + void mouseReleaseEvent(QMouseEvent *); +}; + +/* + * SQ_GLView represents a widget containing SQ_GLWidget, toolbar and statusbar. + * + * + * + -------------------------------------------------+ + * | | | | | | | | | | | | | | | | | | | <= toolbar with actions (SQ_ToolBar) + * |--------------------------------------------------| + * | | + * | | + * | | + * | | + * | | + * | | <= OpenGL widget (SQ_GLWidget) + * | | + * | | + * | | + * | | + * | | + * | | + * | | + * |--------------------------------------------------| <= statusbar (KStatusBar) + * +--------------------------------------------------+ + * + * + */ + +class SQ_GLView : public QVBox +{ + Q_OBJECT + + public: + SQ_GLView(QWidget *parent = 0); + ~SQ_GLView(); + + void leftTab(); + void rightTab(); + + void addPage(const QString &label); + + void removePage(int); + void removeTabs(); + void setupTabbar(); + + bool tabs() const; + bool tabsClose() const; + + + /* + * Save current position and size to config + */ + void saveGeometry(); + void restoreGeometry(); + + /* + * Reset all statusbar's labels to default values. + */ + void resetStatusBar(); + + /* + * Get a pointer to statusbar. + */ + KStatusBar* statusbar(); + + + KTabBar* tabbar(); + + /* + * Get a poniter to toolbar with actions (next file, zoom, rotate...) + */ + SQ_ToolBar* toolbar(); + + QWidget* boxBar(); + + /* + * Get a pointer to a widget in statusbar by name. + */ + QLabel* sbarWidget(const QString &name) const; + + static SQ_GLView* window() { return m_instance; } + + private slots: + void slotTabCountChanged(); + + protected: + + /* + * We want to eat close events. If current version is not 'small', + * ignore close event. If current version is 'small', save all important + * parameters to config file and accept close event (exit). + */ + void closeEvent(QCloseEvent *e); + + private: + + /* + * Internal. + */ + void createContent(); + + virtual bool eventFilter(QObject *watched, QEvent *e); + + private: + SQ_GLWidget *gl; + KStatusBar *sbar; + QMap names; + SQ_ToolBar *m_toolbar; + KTabBar *m_tabbar; + bool m_tabs, m_tabsclose; + QVBox *box; + + static SQ_GLView *m_instance; +}; + +inline +SQ_ToolBar* SQ_GLView::toolbar() +{ + return m_toolbar; +} + +inline +KTabBar* SQ_GLView::tabbar() +{ + return m_tabbar; +} + +inline +KStatusBar* SQ_GLView::statusbar() +{ + return sbar; +} + +inline +QLabel* SQ_GLView::sbarWidget(const QString &name) const +{ + return names[name]; +} + +inline +bool SQ_GLView::tabs() const +{ + return m_tabs; +} + +inline +bool SQ_GLView::tabsClose() const +{ + return m_tabsclose; +} + +inline +QWidget* SQ_GLView::boxBar() +{ + return box; +} + +#endif diff --git a/ksquirrel/sq_glwidget.cpp b/ksquirrel/sq_glwidget.cpp new file mode 100644 index 0000000..79e5108 --- /dev/null +++ b/ksquirrel/sq_glwidget.cpp @@ -0,0 +1,2006 @@ +/*************************************************************************** + sq_glwidget.cpp - description + ------------------- + begin : Mon Mar 15 2004 + copyright : (C) 2004 by Baryshev Dmitry + email : ksquirrel.iv@gmail.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#ifndef KSQUIRREL_PART +#include "ksquirrel.h" +#include "sq_widgetstack.h" +#include "sq_glview.h" +#include "sq_fileiconview.h" +#include "sq_diroperator.h" +#include "sq_hloptions.h" +#include "sq_previewwidget.h" +#include "sq_tabopendialog.h" +#endif + +#include "sq_popupmenu.h" +#include "sq_libraryhandler.h" +#include "sq_config.h" +#include "sq_glwidget_helpers.h" +#include "sq_glwidget.h" +#include "sq_glu.h" +#include "sq_codecsettings.h" +#include "sq_glselectionpainter.h" +#include "sq_utils.h" +#include "sq_errorstring.h" +#include "fmt_filters.h" + +#include +#include +#include +#include + +#ifdef SQ_HAVE_KEXIF +#include +#endif + +// is it enough ? +#define SQ_FLOAT_SIGMA 1e-5 + +#define ISFLOAT(a,b) (fabs(a - b) < SQ_FLOAT_SIGMA) +#define ISFLOAT1(a) ISFLOAT(a, 1.0) +#define ISFLOAT0(a) ISFLOAT(a, 0.0) + +#define SQ_TAB_TEXT_LENGTH 30 + +/* ***************************************************************************************** */ + +SQ_GLWidget * SQ_GLWidget::m_instance = 0; + +static const int timer_delay_file = 5; +static const double rad_const = 3.14159265358979323846 / 180.0; + +static const float SQ_WINDOW_BACKGROUND_POS = -1000.0; +static const float SQ_IMAGE_CHECKER_POS = -999.0; +static const float SQ_FIRST_FRAME_POS = -998.0; +static const float SQ_MARKS_POS = -997.0; +static const float SQ_FIRST_TILE_LAYER = -995.0; +static const float SQ_ONSCREEN_LAYER = 10000.0; + +/* ***************************************************************************************** */ + +SQ_GLWidget::SQ_GLWidget(QWidget *parent, const char *name) : QGLWidget(parent, name) +{ + kdDebug() << "+SQ_GLWidget" << endl; + + // init all variables... + m_instance = this; + +#ifdef KSQUIRREL_PART + connect(&t_glv, SIGNAL(message(const QString &)), this, SIGNAL(message(const QString &))); +#endif + + zoomMenu = 0; + selectionMenu = 0; + images = 0; + parts_broken = 0; + + ac = new KActionCollection(this, this, "GLWidget actionCollection"); + changed = blocked = decoded = reset_mode = false; + movetype = -1; + buffer = new RGBA [512 * 512]; + zoomFactor = 1.0; + old_id = -1; + menu = new QPopupMenu(this); + hackResizeGL = false; + lastCopy = KURL::fromPathOrURL("/"); + oldZoom = -1; + + percentsLabel = new QLabel(this); + percentsLabel->move(4, 4); + percentsLabel->hide(); + + tabold = tab = &taborig; + + tmp = new KTempFile; + tmp->setAutoDelete(true); + tmp->close(); + + SQ_Config::instance()->setGroup("GL view"); + zoom_type = SQ_Config::instance()->readNumEntry("zoom type", 2); + linear = SQ_Config::instance()->readBoolEntry("zoom_nice", true); + + // load background for transparent image + BGquads = QImage(locate("data", "images/checker.png")); + + if(BGquads.isNull()) + { + BGquads = QImage(32, 32, 32); + BGquads.setAlphaBuffer(true); + BGquads.fill(0); + } + + bindChecker = true; + + zoomfactor = SQ_Config::instance()->readNumEntry("zoom", 25); + movefactor = SQ_Config::instance()->readNumEntry("move", 5); + rotatefactor = SQ_Config::instance()->readNumEntry("angle", 90); + + // load cursors + setCursor(KCursor::arrowCursor()); + + setFocusPolicy(QWidget::WheelFocus); + setAcceptDrops(true); + + // popup menu with image pages + images = new KPopupMenu; + images->setCheckable(true); + + // create actions + createActions(); + + // create toolbars + createToolbar(); + + // create tickmarks + createMarks(); + + initAccelsAndMenu(); + + enableActions(false); + + KCursor::setAutoHideCursor(this, true); + KCursor::setHideCursorDelay(2500); + +#ifndef KSQUIRREL_PART + timer_prev = new QTimer(this); + timer_next = new QTimer(this); + + Q_CHECK_PTR(timer_prev); + Q_CHECK_PTR(timer_next); + + connect(timer_prev, SIGNAL(timeout()), SQ_WidgetStack::instance(), SLOT(emitPreviousSelected())); + connect(timer_next, SIGNAL(timeout()), SQ_WidgetStack::instance(), SLOT(emitNextSelected())); +#endif + + timer_anim = new QTimer(this); + + Q_CHECK_PTR(timer_anim); + + connect(timer_anim, SIGNAL(timeout()), this, SLOT(slotAnimateNext())); + + connect(images, SIGNAL(activated(int)), this, SLOT(slotSetCurrentImage(int))); + connect(images, SIGNAL(aboutToHide()), this, SLOT(slotImagesHidden())); + connect(images, SIGNAL(aboutToShow()), this, SLOT(slotImagesShown())); + + gls = new SQ_GLSelectionPainter(this); +} + +SQ_GLWidget::~SQ_GLWidget() +{ + kdDebug() << "-SQ_GLWidget" << endl; + + delete gls; + + delete parts_broken; + + removeCurrentTabs(); + + delete selectionMenu; + delete zoomMenu; + delete images; + delete [] buffer; + delete tmp; +} + +// Initialize OpenGL context. Used internally by QGLWidget. +void SQ_GLWidget::initializeGL() +{ + setClearColor(); + glClearDepth(1.0); + glEnable(GL_DEPTH_TEST); + glEnable(GL_ALPHA_TEST); + glEnable(GL_BLEND); + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + glShadeModel(GL_FLAT); + + glMatrixMode(GL_PROJECTION); + glLoadIdentity(); + glMatrixMode(GL_MODELVIEW); + + // finally, clear + glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); + + // create "broken" image + initBrokenImage(); + + initMarks(); +} + +// Resize OpenGL context. Used internally by QGLWidget. +void SQ_GLWidget::resizeGL(int width, int height) +{ + gls->setSourceSize(width, height); + + // set new viewport + glViewport(0, 0, width, height); + + glMatrixMode(GL_PROJECTION); + glLoadIdentity(); + + // O(0,0) will be in the center of the window + glOrtho(-width/2, width/2, -height/2, height/2, 0.1f, 10000.0); + + // camera setup + SQ_GLU::gluLookAt(0,0,1, 0,0,0, 0,1,0); + glMatrixMode(GL_MODELVIEW); + + if(decoded && !hackResizeGL) + slotZoomIfLess(); + + hackResizeGL = false; +} + +/* + * Fill a w x h region with texture. Generate texture if needed. + */ +void SQ_GLWidget::draw_background(void *bits, unsigned int *tex, int dim, GLfloat w, GLfloat h, bool &bind, bool deleteOld) +{ + float half_w, half_h; + + half_w = w / 2.0; + half_h = h / 2.0; + + // bind texture ? + if(bind) + { + // delete old texture before binding ? + if(deleteOld) + glDeleteTextures(1, tex); + + // generate and bind texture + glGenTextures(1, tex); + glBindTexture(GL_TEXTURE_2D, *tex); + + // setup parameters + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT); + + // assign image to texture + glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, dim, dim, 0, GL_RGBA, GL_UNSIGNED_BYTE, bits); + + bind = false; + } + else + glBindTexture(GL_TEXTURE_2D, *tex); + + // draw + glBegin(GL_QUADS); + glTexCoord2f(0.0, 0.0); glVertex2f(-half_w, half_h); + glTexCoord2f(w/(GLfloat)dim, 0.0); glVertex2f(half_w, half_h); + glTexCoord2f(w/(GLfloat)dim, h/(GLfloat)dim); glVertex2f(half_w, -half_h); + glTexCoord2f(0.0, h/(GLfloat)dim); glVertex2f(-half_w, -half_h); + glEnd(); +} + +// Redraw OpenGL context. Used internally by QGLWidget. +void SQ_GLWidget::paintGL() +{ + int z; + + // clear + glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); + + if(gls->valid()) + { + matrix_push(); + matrix_pure_reset(); + QPoint p = gls->center(); + + // move to selection center + MATRIX_X = p.x(); + MATRIX_Y = p.y(); + write_gl_matrix(); + + gls->draw(); + + matrix_pop(); + write_gl_matrix(); + } + + glEnable(GL_TEXTURE_2D); + + // draw window background ? + SQ_Config::instance()->setGroup("GL view"); + if(SQ_Config::instance()->readNumEntry("GL view background type", 1) == 2) + { + static bool del = false; + matrix_push(); + matrix_pure_reset(); + matrix_move_z(SQ_WINDOW_BACKGROUND_POS); + draw_background(BGpixmap.bits(), &texPixmap, BGpixmap.width(), width(), height(), changed, del); + del = true; + matrix_pop(); + write_gl_matrix(); + } + + // draw image + if(!reset_mode && decoded) + { + SQ_Config::instance()->setGroup("GL view"); + + fmt_image *im = &tab->finfo.image[tab->current]; + + // if the image is transparent, and we should draw background for image + if(im->hasalpha && SQ_Config::instance()->readBoolEntry("alpha_bkgr", true)) + { + GLfloat w = (float)im->w / 2.0, h = (float)im->h / 2.0; + + static const GLdouble eq[4][4] = + { + {0.0, 1.0, 0.0, 0.0}, + {1.0, 0.0, 0.0, 0.0}, + {0.0, -1.0, 0.0, 0.0}, + {-1.0, 0.0, 0.0, 0.0} + }; + + // we will draw background for transparent image (quads) within + // entire window, and cut off useless regions with clip planes + glPushMatrix(); + glTranslatef(-w, -h, 0.0); + glClipPlane(GL_CLIP_PLANE0, eq[0]); + glClipPlane(GL_CLIP_PLANE1, eq[1]); + glEnable(GL_CLIP_PLANE0); + glEnable(GL_CLIP_PLANE1); + glPopMatrix(); + glPushMatrix(); + glTranslatef(w, h, 0.0); + glClipPlane(GL_CLIP_PLANE2, eq[2]); + glClipPlane(GL_CLIP_PLANE3, eq[3]); + glEnable(GL_CLIP_PLANE2); + glEnable(GL_CLIP_PLANE3); + glPopMatrix(); + + // draw background + matrix_push(); + matrix_pure_reset(); + matrix_move_z(SQ_IMAGE_CHECKER_POS); + draw_background(BGquads.bits(), &texQuads, 32, width(), height(), bindChecker, !bindChecker); + matrix_pop(); + write_gl_matrix(); + + // don't need planes any more... + glDisable(GL_CLIP_PLANE3); + glDisable(GL_CLIP_PLANE2); + glDisable(GL_CLIP_PLANE1); + glDisable(GL_CLIP_PLANE0); + } + + matrix_move_z(SQ_FIRST_FRAME_POS); + + Parts *pt = tab->broken ? parts_broken : &tab->parts[tab->current]; + + // draw current image + int toy = pt->tilesy.size(); + int tox = pt->tilesx.size(); + for(z = 0;z < toy;z++) + if(glIsList(pt->m_parts[z * tox].list)) + glCallList(pt->m_parts[z * tox].list); + + // draw tickmarks ("broken" image won't have tickmarks) + if(!tab->broken && marks && SQ_Config::instance()->readBoolEntry("marks", true)) + { + GLfloat zum = getZoom(); + GLfloat x = fabsf(pt->m_parts[0].x1) * zum, y = pt->m_parts[0].y1 * zum; + GLfloat X = MATRIX_X, Y = MATRIX_Y; + + if(x < 0.0) + x = -x; + + const GLfloat ly = y+16, ry = -y-16; + const GLfloat lx = x+16, rx = -x-16; + + matrix_push(); + matrix_pure_reset(); + MATRIX_X = X; + MATRIX_Y = Y; + matrix_rotate2(tab->curangle); + matrix_move_z(SQ_MARKS_POS); + + GLfloat coords[4][8] = + { + {rx, ly, -x, ly, -x, y, rx, y}, + {x, ly, lx, ly, lx, y, x, y}, + {x, -y, lx, -y, lx, ry, x, ry}, + {rx, -y, -x, -y, -x, ry, rx, ry} + }; + + for(z = 0;z < 4;z++) + { + glBindTexture(GL_TEXTURE_2D, mark[z]); + + glBegin(GL_QUADS); + glTexCoord2f(0.0, 0.0); glVertex2f(coords[z][0], coords[z][1]); + glTexCoord2f(1.0, 0.0); glVertex2f(coords[z][2], coords[z][3]); + glTexCoord2f(1.0, 1.0); glVertex2f(coords[z][4], coords[z][5]); + glTexCoord2f(0.0, 1.0); glVertex2f(coords[z][6], coords[z][7]); + glEnd(); + } + + matrix_pop(); + write_gl_matrix(); + } + } + + glDisable(GL_TEXTURE_2D); + + matrixChanged(); + + if(!tab->broken && tab->total > 1) + frameChanged(); +} + +/* + * Change statusbar info according with + * current matrix (it shows current zoom & angle values). + */ +void SQ_GLWidget::matrixChanged() +{ + QString str; + + float m = getZoom(); + float fzoom = m * 100.0; + float z = (m < 1.0) ? 1.0/m : m; + + // construct zoom + str = QString::fromLatin1("%1% [%2:%3]") + .arg(fzoom, 0, 'f', 1) + .arg((m < 1.0)?1.0:z, 0, 'f', 1) + .arg((m > 1.0)?1.0:z, 0, 'f', 1); + +#ifndef KSQUIRREL_PART + SQ_GLView::window()->sbarWidget("SBGLZoom")->setText(str); +#else + t_glv.sbarWidget("SBGLZoom")->setText(str); +#endif + + // construct rotation angle + str = QString::fromLatin1("%1%2 %3 deg") + .arg((tab->isflippedV)?"V":"") + .arg((tab->isflippedH)?"H":"") + .arg(tab->curangle, 0, 'f', 1); + +#ifndef KSQUIRREL_PART + SQ_GLView::window()->sbarWidget("SBGLAngle")->setText(str); +#else + t_glv.sbarWidget("SBGLAngle")->setText(str); +#endif +} + +/* + * Mouse wheel event. Let's load next/previous image, or + * zoom in/zoom out (depends on settings). + */ +void SQ_GLWidget::wheelEvent(QWheelEvent *e) +{ + if(e->delta() < 0 && e->state() == Qt::NoButton) + { +#ifndef KSQUIRREL_PART + SQ_Config::instance()->setGroup("GL view"); + + // load next file in current directory + if(SQ_Config::instance()->readNumEntry("scroll", 0)) + slotNext(); + else +#endif + + slotZoomPlus(); + } + else if(e->delta() > 0 && e->state() == Qt::NoButton) + { +#ifndef KSQUIRREL_PART + SQ_Config::instance()->setGroup("GL view"); + + if(SQ_Config::instance()->readNumEntry("scroll", 0)) + slotPrev(); + else +#endif + + slotZoomMinus(); + } + // some special bindings: + // if CTRL key is pressed, zoom 2x or 0.5x + else if(e->delta() < 0 && e->state() == Qt::ControlButton) + matrix_zoom(2.0); + else if(e->delta() > 0 && e->state() == Qt::ControlButton) + matrix_zoom(0.5f); + else if(e->delta() < 0 && e->state() == Qt::ShiftButton) + slotZoomPlus(); + else if(e->delta() > 0 && e->state() == Qt::ShiftButton) + slotZoomMinus(); +} + +// User pressed mouse button down. +void SQ_GLWidget::mousePressEvent(QMouseEvent *e) +{ + setFocus(); + + // left button, update cursor + if(e->button() == Qt::LeftButton && e->state() == Qt::NoButton && tab->glselection == -1) + { +#ifndef KSQUIRREL_PART + QTime t = QTime::currentTime(); + + SQ_Config::instance()->setGroup("GL view"); + int dc = SQ_Config::instance()->readNumEntry("double_click", 0); + + if(dc && clickTime.isValid() && clickTime.msecsTo(t) <= KApplication::doubleClickInterval()) + { + if(dc == 1) + KSquirrel::app()->closeGLWidget(); + else + toggleFullScreen(); + + return; + } + else + clickTime = t; + +#endif + setCursor(KCursor::sizeAllCursor()); + + xmoveold = e->x(); + ymoveold = e->y(); + + movetype = 1; + } + // left button + SHIFT, let's start drawing zoom frame + else if(e->button() == Qt::LeftButton && (e->state() == Qt::ShiftButton || tab->glselection != -1)) + { + // stop animation! + stopAnimation(); + + // update cursor to crosshair + setCursor(KCursor::crossCursor()); + + if(tab->glselection == SQ_GLSelectionPainter::Rectangle || tab->glselection == SQ_GLSelectionPainter::Ellipse) + gls->begin(static_cast(tab->glselection), e->x(), e->y()); + else + gls->begin(SQ_GLSelectionPainter::Rectangle, e->x(), e->y()); + + movetype = 2; + } + // right button - show context menu + else if(e->button() == Qt::RightButton) + menu->popup(QCursor::pos()); + // middle button - toggle fullscreen state + else if(e->button() == Qt::MidButton) + toggleFullScreen(); +} + +// User moved mouse. +void SQ_GLWidget::mouseMoveEvent(QMouseEvent *e) +{ + // user didn't press any mouse button before ? + if(movetype == -1 && fullscreen()) + { +#if 0 +// bool tvis = SQ_GLView::window()->toolbar()->isShown(); +// bool svis = SQ_GLView::window()->statusbar()->isShown(); + + int h = SQ_GLView::window()->toolbar()->height() + + SQ_GLView::window()->tabbar()->height(); + +#warning FIXME +#ifndef KSQUIRREL_PART + hackResizeGL = true; + SQ_GLView::window()->boxBar()->setShown((/*tvis ? false:*/(e->y() < h))); + SQ_GLView::window()->statusbar()->setShown((/*svis ? false:*/(e->y() > + height()-SQ_GLView::window()->statusbar()->height()))); +#endif +#endif + return; + } + + // left mouse button, lets move image (or matrix :-) ) + if(movetype == 1) + { + xmove = e->x(); + ymove = e->y(); + + matrix_move(xmove-xmoveold, -ymove+ymoveold); + + xmoveold = e->x(); + ymoveold = e->y(); + } + // left + SHIFT + else if(movetype == 2) + gls->move(e->x(), e->y()); +} + +// User released some mouse button. +void SQ_GLWidget::mouseReleaseEvent(QMouseEvent *) +{ + if(movetype == -1) + return; + + // left button - restore cursor + if(movetype == 1 || (movetype == 2 && tab->glselection != -1)) // permanent selection + setCursor(KCursor::arrowCursor()); + // left button + SHIFT - zoom to selected rectangle (if needed) + else if(movetype == 2 && tab->glselection == -1) + { + setCursor(KCursor::arrowCursor()); + + QSize sz = gls->size(); + QPoint pt = gls->pos(); + QRect lastRect(pt.x(), pt.y(), sz.width(), sz.height()); + + gls->end(); + + QPoint lastC = lastRect.center(); + QPoint O(width() / 2, height() / 2); + + if(lastRect.width() > 2 && lastRect.height() > 2) + { + bool lastReset = reset_mode; + reset_mode = true; + float X = MATRIX_X, Y = MATRIX_Y; + matrix_move(O.x() - lastC.x(), lastC.y() - O.y()); + reset_mode = lastReset; + + // try to zoom + bool zoomed = tab->broken ? false : zoomRect(lastRect); + + // not zoomed ? (zoom > maximum zoom) + if(!zoomed) + { + MATRIX_X = X; + MATRIX_Y = Y; + write_gl_matrix(); + } + } + + updateGL(); + + // start animation, if needed + if(!manualBlocked()) + startAnimation(); + } + + movetype = -1; +} + +/* + * Zoom to 'r'. Will be called after somebody used right mouse button + * to select zoom region. + */ +bool SQ_GLWidget::zoomRect(const QRect &r) +{ + // calculate zoom factor + float factor = 1.0; + float w = (float)width(), h = (float)height(); + float factorw = w / (float)r.width(); + float factorh = h / (float)r.height(); + float t = w / h; + + if(t > (float)r.width() / (float)r.height()) + factor = factorh; + else + factor = factorw; + + // try to zoom + return matrix_zoom(factor); +} + +// Fit width. +void SQ_GLWidget::slotZoomW() +{ + zoom_type = 0; + pAZoomW->setChecked(true); + + // no image decoded + if(tab->broken || tab->finfo.image.empty()) return; + + // calculate zoom factor + float factor = (float)width() / (tab->rotate ? (float)tab->finfo.image[tab->current].h : (float)tab->finfo.image[tab->current].w); + + // "Ignore, if the image is less than window" - restore zoom factor to 1.0 + if(pAIfLess->isChecked() && (tab->finfo.image[tab->current].w < width() && tab->finfo.image[tab->current].h < height())) + factor = 1.0; + + // zoom... + internalZoom(factor); +} + +// Fit height. +void SQ_GLWidget::slotZoomH() +{ + zoom_type = 1; + pAZoomH->setChecked(true); + + if(tab->broken || tab->finfo.image.empty()) return; + + float factor = (float)height() / (tab->rotate ? (float)tab->finfo.image[tab->current].w : (float)tab->finfo.image[tab->current].h); + + if(pAIfLess->isChecked() && (tab->finfo.image[tab->current].w < width() && tab->finfo.image[tab->current].h < height())) + factor = 1.0; + + internalZoom(factor); +} + +// Fit image (e.g. width and height). +void SQ_GLWidget::slotZoomWH() +{ + zoom_type = 2; + pAZoomWH->setChecked(true); + + if(tab->broken || tab->finfo.image.empty()) return; + + float factor = 1.0; + float w = (float)width(), h = (float)height(); + float factorw = w / (tab->rotate ? (float)tab->finfo.image[tab->current].h : (float)tab->finfo.image[tab->current].w); + float factorh = h / (tab->rotate ? (float)tab->finfo.image[tab->current].w : (float)tab->finfo.image[tab->current].h); + float t = w / h; + float F = tab->rotate ? ((float)tab->finfo.image[tab->current].h / (float)tab->finfo.image[tab->current].w) : ((float)tab->finfo.image[tab->current].w / (float)tab->finfo.image[tab->current].h); + + if(t > F) + factor = factorh; + else + factor = factorw; + + if(pAIfLess->isChecked() && (tab->finfo.image[tab->current].w < width() && tab->finfo.image[tab->current].h < height())) + factor = 1.0; + + internalZoom(factor); +} + +// Previous zoom. +void SQ_GLWidget::slotZoomLast() +{ + zoom_type = 4; + pAZoomLast->setChecked(true); + + if(tab->broken || tab->finfo.image.empty()) return; + + internalZoom(zoomFactor); +} + +// Zoom 100%. +void SQ_GLWidget::slotZoom100() +{ + zoom_type = 3; + pAZoom100->setChecked(true); + + if(tab->broken || tab->finfo.image.empty()) return; + + internalZoom(1.0); +} + +// "Ignore, if the image is less than window" +void SQ_GLWidget::slotZoomIfLess() +{ + if(tab->broken || tab->finfo.image.empty()) return; + + switch(zoom_type) + { + case 0: slotZoomW(); break; + case 1: slotZoomH(); break; + case 2: slotZoomWH(); break; + case 3: break; + + default: + slotZoomLast(); + } +} + +// Zoom+ +void SQ_GLWidget::slotZoomPlus() +{ + matrix_zoom(1.0+zoomfactor/100.0); +} + +// Zoom- +void SQ_GLWidget::slotZoomMinus() +{ + matrix_zoom(1.0/(1.0+zoomfactor/100.0)); +} + +// Rotate left. +void SQ_GLWidget::slotRotateLeft() +{ + matrix_rotate(-rotatefactor); +} + +// Rotate right. +void SQ_GLWidget::slotRotateRight() +{ + matrix_rotate(rotatefactor); +} + +/* + operations with matrices are taken from GLiv =) + + thanks to Guillaume Chazarian. +*/ +void SQ_GLWidget::flip(int id, bool U) +{ + GLfloat x = MATRIX_X, y = MATRIX_Y; + MATRIX_X = 0; + MATRIX_Y = 0; + + tab->matrix[id] *= -1.0; + tab->matrix[id + 1] *= -1.0; + tab->matrix[id + 3] *= -1.0; + + MATRIX_X = x; + MATRIX_Y = y; + + write_gl_matrix(); + + if(!reset_mode && U) + updateGL(); +} + +void SQ_GLWidget::slotFlipH() +{ + if(!tab->broken) + { + tab->isflippedH = !tab->isflippedH; + flip(0); + } +} + +void SQ_GLWidget::slotFlipV() +{ + if(!tab->broken) + { + tab->isflippedV = !tab->isflippedV; + flip(4); + } +} + +void SQ_GLWidget::slotMatrixReset() +{ + if(!tab->broken) + { + oldZoom = getZoom(); + matrix_reset(false); + matrix_zoom(1.0); + } +} + +void SQ_GLWidget::write_gl_matrix() +{ + GLfloat transposed[16] = + { + 1.0, 0.0, 0.0, 0.0, + 0.0, 1.0, 0.0, 0.0, + 0.0, 0.0, 1.0, 0.0, + 0.0, 0.0, 0.0, 1.0 + }; + + transposed[0] = MATRIX_C1; + transposed[5] = MATRIX_C2; + transposed[4] = MATRIX_S1; + transposed[1] = MATRIX_S2; + transposed[12] = MATRIX_X; + transposed[13] = MATRIX_Y; + transposed[14] = MATRIX_Z; + + glLoadMatrixf(transposed); +} + +void SQ_GLWidget::matrix_move(GLfloat x, GLfloat y) +{ + if(tab->broken) return; + + MATRIX_X += x; + MATRIX_Y += y; + + write_gl_matrix(); + + if(!reset_mode) + updateGL(); +} + +void SQ_GLWidget::matrix_move_z(GLfloat z) +{ + MATRIX_Z = z; + + write_gl_matrix(); +} + +void SQ_GLWidget::matrix_push() +{ + memcpy(saved, tab->matrix, sizeof(tab->matrix)); +} + +void SQ_GLWidget::matrix_pop() +{ + memcpy(tab->matrix, saved, sizeof(tab->matrix)); +} + +void SQ_GLWidget::matrix_reset(bool U) +{ + tab->nullMatrix(); + + tab->curangle = 0.0; + tab->isflippedH = tab->isflippedV = false; + + if(decoded) + exifRotate(U); +} + +void SQ_GLWidget::matrix_pure_reset() +{ + tab->nullMatrix(); + write_gl_matrix(); +} + +bool SQ_GLWidget::matrix_zoom(GLfloat ratio) +{ + if(tab->broken) return false; + + SQ_Config::instance()->setGroup("GL view"); + + int zoom_lim = SQ_Config::instance()->readNumEntry("zoom limit", 1); + GLfloat zoom_min, zoom_max, zoom_tobe; + + zoom_tobe = hypot(MATRIX_C1 * ratio, MATRIX_S1 * ratio) * 100.0; + + switch(zoom_lim) + { + case 2: + zoom_min = (float)SQ_Config::instance()->readNumEntry("zoom_min", 1); + zoom_max = (float)SQ_Config::instance()->readNumEntry("zoom_max", 10000); + break; + + default: // "case 1:" too + zoom_min = 1.0; + zoom_max = 10000.0; + } + + if(zoom_lim) + { + float z = getZoomPercents(); + + // zoom limit exceeded - do nothing + if((z >= zoom_max && ratio > 1.0) || (z <= zoom_min && ratio < 1.0)) + return false; + + // if the new zoom will be greater (smaller) than maximum + // (minimum) zoom - scale it. + if(ratio < 1.0 && zoom_min >= zoom_tobe) + ratio = ratio * zoom_min / zoom_tobe; + else if(ratio > 1.0 && zoom_max <= zoom_tobe) + ratio = ratio * zoom_max / zoom_tobe; + } + + GLfloat oldz = (oldZoom == -1 ? getZoom() : oldZoom); + + MATRIX_C1 *= ratio; + MATRIX_S1 *= ratio; + MATRIX_X *= ratio; + MATRIX_S2 *= ratio; + MATRIX_C2 *= ratio; + MATRIX_Y *= ratio; + + hackMatrix(); + + GLfloat z = getZoom(); + int filter = -1; + + if(ISFLOAT1(oldz) && !ISFLOAT1(z)) + filter = linear ? GL_LINEAR : GL_NEAREST; + else if(ISFLOAT1(z)) + filter = GL_NEAREST; + + // update all textures + if(filter != -1) + { + for(int i = 0;i < tab->total;i++) + { + int toxy = tab->parts[i].m_parts.size(); + + for(int j = 0;j < toxy;j++) + { + glBindTexture(GL_TEXTURE_2D, tab->parts[i].m_parts[j].tex); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, filter); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, filter); + } + } + } + + oldZoom = -1; + write_gl_matrix(); + + changeSlider(z); + + if(!reset_mode) + updateGL(); + + return true; +} + +/* + * Floating point operations are not 100% exact. + * We should correct matrix values. + */ +void SQ_GLWidget::hackMatrix() +{ + if(ISFLOAT1(MATRIX_C1)) MATRIX_C1 = MATRIX_C1 < 0 ? -1.0 : 1.0; + else if(ISFLOAT0(MATRIX_C1)) MATRIX_C1 = 0.0; + + if(ISFLOAT1(MATRIX_C2)) MATRIX_C2 = MATRIX_C2 < 0 ? -1.0 : 1.0; + else if(ISFLOAT0(MATRIX_C2)) MATRIX_C2 = 0.0; + + if(ISFLOAT1(MATRIX_S1)) MATRIX_S1 = MATRIX_S1 < 0 ? -1.0 : 1.0; + else if(ISFLOAT0(MATRIX_S1)) MATRIX_S1 = 0.0; + + if(ISFLOAT1(MATRIX_S2)) MATRIX_S2 = MATRIX_S2 < 0 ? -1.0 : 1.0; + else if(ISFLOAT0(MATRIX_S2)) MATRIX_S2 = 0.0; + + if(ISFLOAT0(MATRIX_X)) MATRIX_X = 0.0; + if(ISFLOAT0(MATRIX_Y)) MATRIX_Y = 0.0; +} + +GLfloat SQ_GLWidget::getZoom() const +{ + return hypot(MATRIX_C1, MATRIX_S1); +} + +GLfloat SQ_GLWidget::getZoomPercents() const +{ + return getZoom() * 100.0; +} + +void SQ_GLWidget::matrix_rotate(GLfloat angle, bool U) +{ + if(tab->broken) return; + + GLfloat c1 = MATRIX_C1, c2 = MATRIX_C2, s1 = MATRIX_S1, s2 = MATRIX_S2; + + double rad = angle * rad_const; + double cosine = cos(rad); + double sine = sin(rad); + + MATRIX_C1 = c1 * cosine + s2 * sine; + MATRIX_S1 = s1 * cosine + c2 * sine; + MATRIX_S2 = -c1 * sine + s2 * cosine; + MATRIX_C2 = -s1 * sine + c2 * cosine; + + hackMatrix(); + + tab->curangle += angle; + + if(tab->curangle == 360.0 || tab->curangle == -360.0) + tab->curangle = 0.0; + else if(tab->curangle > 360.0) + tab->curangle -= 360.0; + else if(tab->curangle < -360.0) + tab->curangle += 360.0; + + write_gl_matrix(); + + if(U) + updateGL(); +} + +void SQ_GLWidget::matrix_rotate2(GLfloat angle) +{ + GLfloat c1 = MATRIX_C1, c2 = MATRIX_C2, s1 = MATRIX_S1, s2 = MATRIX_S2; + + double rad = angle * rad_const; + double cosine = cos(rad); + double sine = sin(rad); + + MATRIX_C1 = c1 * cosine + s2 * sine; + MATRIX_S1 = s1 * cosine + c2 * sine; + MATRIX_S2 = -c1 * sine + s2 * cosine; + MATRIX_C2 = -s1 * sine + c2 * cosine; + + write_gl_matrix(); +} + +/* + * Bind textures, draw them and create GL lists. + * Also show textures by executing GL lists, if 'swap' = true. + */ +bool SQ_GLWidget::showFrames(int i, Parts *p, bool swap) +{ + int z, k = 0; + const int a = p->tilesx.size() * i, b = a + p->tilesx.size(); + int filter = linear ? GL_LINEAR : GL_NEAREST; + + // for safety... + makeCurrent(); + + glEnable(GL_TEXTURE_2D); + + float zm = getZoom(); + + for(z = a;z < b;z++) + { + glBindTexture(GL_TEXTURE_2D, p->m_parts[z].tex); + + // setup texture parameters + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, ISFLOAT1(zm) ? GL_NEAREST : filter); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, ISFLOAT1(zm) ? GL_NEAREST : filter); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); + + setupBits(p, buffer, i, k); + + glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, p->tilesx[k], p->tilesy[i], 0, GL_RGBA, GL_UNSIGNED_BYTE, buffer); + + k++; + } + + // create new display list + glNewList(p->m_parts[a].list, swap ? GL_COMPILE_AND_EXECUTE : GL_COMPILE); + + // bind & draw textures (if needed) + for(z = a;z < b;z++) + { + glBindTexture(GL_TEXTURE_2D, p->m_parts[z].tex); + + glBegin(GL_QUADS); + glTexCoord2f(p->m_parts[z].tx1, p->m_parts[z].ty1); glVertex2f(p->m_parts[z].x1, p->m_parts[z].y1); + glTexCoord2f(p->m_parts[z].tx2, p->m_parts[z].ty1); glVertex2f(p->m_parts[z].x2, p->m_parts[z].y1); + glTexCoord2f(p->m_parts[z].tx2, p->m_parts[z].ty2); glVertex2f(p->m_parts[z].x2, p->m_parts[z].y2); + glTexCoord2f(p->m_parts[z].tx1, p->m_parts[z].ty2); glVertex2f(p->m_parts[z].x1, p->m_parts[z].y2); + glEnd(); + } + + glEndList(); + + glDisable(GL_TEXTURE_2D); + + // swap buffers... + if(swap) + swapBuffers(); + + return GL_TRUE; +} + +void SQ_GLWidget::setupBits(Parts *p, RGBA *_buffer, int y, int x) +{ + QPair pair = SQ_GLWidget::calcRealDimensions(*p, y, x); + + int offs = p->realw * pair.second + pair.first; + RGBA *orig = p->buffer->data() + offs; + + int toy = p->tilesy[y]; + int tox = p->tilesx[x]; + + for(int j = 0;j < toy;j++) + memcpy(_buffer + tox*j, orig + p->realw*j, tox*sizeof(RGBA)); +} + +/* + * Start decoding given image. We can call it from anywhere. + */ +void SQ_GLWidget::startDecoding(const QString &file) +{ +#ifndef KSQUIRREL_PART + if(SQ_PreviewWidget::instance()->cancel()) + SQ_WidgetStack::instance()->diroperator()->stopPreview(); +#endif + + if(reset_mode) + return; + + started.start(); + + tabold = tab; + tmptab.empty(); + tab = &tmptab; + reset_mode = true; + + timer_anim->stop(); + images->clear(); + + tab->m_File = file; // original name + tab->File = QFile::encodeName(tab->m_File); // translated name + tab->m_original = m_original; + + QFileInfo fm(file); + tab->fmt_ext = fm.extension(false); + tab->fmt_size = fm.size(); + +#ifndef KSQUIRREL_PART + // show window with image + KSquirrel::app()->raiseGLWidget(); +#endif + + if(m_expected.isEmpty()) + KApplication::eventLoop()->processEvents(QEventLoop::ExcludeUserInput | QEventLoop::ExcludeSocketNotifiers); + + decode(); +} + +/* + * Prepare decoding. It will find proper library for decoding, + * clear old memory buffers, etc. + */ +bool SQ_GLWidget::prepare() +{ + QString status; + + tab = &tmptab; + + // get library from cache + SQ_LIBRARY *m_lib = SQ_LibraryHandler::instance()->libraryForFile(tab->m_File); + + if(!m_lib) + { + KMessageBox::error(this, i18n("Codec for %1 format not found").arg(tab->fmt_ext)); + reset_mode = false; + tab = tabold; + return false; + } + else + tmptab.lib = m_lib; + + enableActions(true); + + int already = -1, result = -1, i = 0; + SQ_Config::instance()->setGroup("GL view"); + +#ifndef KSQUIRREL_PART + bool use_tabs = SQ_GLView::window()->tabs(); +#endif + + bool useCurrent = false; + +#ifndef KSQUIRREL_PART + if(!use_tabs) + { + removeCurrentTabs(); + + SQ_GLView::window()->removeTabs(); + } + else + { + if(m_expected != m_original) + { + std::vector::iterator it = tabs.begin(); + std::vector::iterator itEnd = tabs.end(); + for(;it != itEnd;++it, ++i) + { + if((*it).m_original == m_original) + { + already = i; + useCurrent = true; + break; + } + } + } + + // 0 - new page + // 1 - replace current tab + // 2 - close all and open in a new tab + // -1 - ignore 'result' at all + if(already == -1 + && decoded + && m_expected != m_original + && !useCurrent + && SQ_Config::instance()->readBoolEntry("tabs_ask", false)) + { + SQ_TabOpenDialog tbo(this); + tbo.exec(); + result = tbo.result(); + } + } +#else + removeCurrentTabs(); +#endif + +#ifndef KSQUIRREL_PART + int curtab = SQ_GLView::window()->tabbar()->indexOf(SQ_GLView::window()->tabbar()->currentTab()); +#else + int curtab = -1; +#endif + + int curindex = (already == -1) ? curtab : already; + + if(curindex != -1 && (m_expected == m_original || result == 1 || useCurrent)) + { + if(curtab != curindex) + tabs[curtab].removeParts(); + + tabs[curindex].clearParts(); + tabs[curindex] = tmptab; + tab = &tabs[curindex]; + +#ifndef KSQUIRREL_PART + SQ_GLView::window()->tabbar()->blockSignals(true); + SQ_GLView::window()->tabbar()->setCurrentTab(SQ_GLView::window()->tabbar()->tabAt(curindex)); + SQ_GLView::window()->tabbar()->tabAt(curindex)->setText(KStringHandler::csqueeze(tab->m_original.fileName(), SQ_TAB_TEXT_LENGTH)); + SQ_GLView::window()->tabbar()->blockSignals(false); +#endif + } + else + { + if(curindex != -1) + { + if(result == 2) + closeAllTabs(); + else + tabs[curindex].removeParts(); + } + + tabs.push_back(tmptab); + int lastId = tabs.size() - 1; + tab = &tabs[lastId]; + +#ifndef KSQUIRREL_PART + SQ_GLView::window()->tabbar()->blockSignals(true); + SQ_GLView::window()->addPage(KStringHandler::csqueeze(tab->m_original.fileName(), SQ_TAB_TEXT_LENGTH)); + SQ_GLView::window()->tabbar()->setCurrentTab(SQ_GLView::window()->tabbar()->tabAt(lastId)); + + // QTabBar::show will emit selected(int), + // we don't want it + emit tabCountChanged(); + SQ_GLView::window()->tabbar()->blockSignals(false); +#endif + } + + gls->setVisible(false); + + SQ_CodecSettings::applySettings(tab->lib, SQ_CodecSettings::ImageViewer); + + // determine codec + tab->codeK = tab->lib->codec; + + // start decoding! + i = tab->codeK->read_init(tab->File); + + // oops, error... + if(i != SQE_OK) + { + decodeFailedOn0(i); + m_expected = KURL(); + return false; + } + + return true; +} + +void SQ_GLWidget::decode() +{ + // prepare decoding... + if(!prepare()) + return; + +#ifndef KSQUIRREL_PART + KSquirrel::app()->setCaption(originalURL()); +#endif + + zoomFactor = getZoom(); + matrix_pure_reset(); + matrixChanged(); + +#ifdef SQ_HAVE_KEXIF + KExifData d; + d.readFromFile(tab->m_File); + tab->orient = d.getImageOrientation(); + tab->wm = SQ_Utils::exifGetMatrix(QString::null, tab->orient); + + tab->rotate = (tab->orient == KExifData::ROT_90_HFLIP || tab->orient == KExifData::ROT_90 + || tab->orient == KExifData::ROT_90_VFLIP || tab->orient == KExifData::ROT_270); +#else + tab->orient = -1; + tab->rotate = false; +#endif + + errors = 0; + +/* *********************************************************** */ + + int i, j, id; + int line, res, first_id = 0; + fmt_image *im; + memoryPart *pt; + bool progr; + + SQ_Config::instance()->setGroup("GL view"); + + // in fullscreen mode progressive loading is disabled anyway + if(fullscreen()) + progr = false; + else + progr = SQ_Config::instance()->readBoolEntry("progressiv", true); + + int allpages = SQ_Config::instance()->readNumEntry("load_pages", 0); + int pages_num = SQ_Config::instance()->readNumEntry("load_pages_number", 1); + + if(pages_num < 1) pages_num = 1; + +#ifndef KSQUIRREL_PART + SQ_GLView::window()->sbarWidget("SBFile")->setText(tab->m_original.fileName()); +#else + t_glv.sbarWidget("SBFile")->setText(tab->m_original.fileName()); +#endif + + tab->current = 0; + + bool notexpected = m_expected.isEmpty(); + m_expected = KURL(); + + // start time counting + while(true) + { + if((allpages == 1 && tab->current) || (allpages == 2 && tab->current == pages_num)) + break; + + // absolute evil, but should do... + if(notexpected) + KApplication::eventLoop()->processEvents(QEventLoop::ExcludeUserInput | QEventLoop::ExcludeSocketNotifiers); + + i = tab->codeK->read_next(); + + // something went wrong. SQE_NOTOK is a special type of error. It means + // that we decoded all pages. + if(i != SQE_OK) + { + if(i == SQE_NOTOK || tab->current) + break; + else + { + decodeFailedOn0(i); + return; + } + } + + im = tab->codeK->image(tab->current); + + Parts pp; + + // find tile size + SQ_GLWidget::findCloserTiles(im->w, im->h, pp.tilesx, pp.tilesy); + QPair pair = SQ_GLWidget::calcRealDimensions(pp); + pp.realw = pair.first; + pp.realh = pair.second; + + // setup current Part + pp.w = im->w; + pp.h = im->h; + + // create textures and display lists + if(!pp.makeParts()) + { + if(tab->current) + break; + else + { + KMessageBox::error(this, + i18n("Memory allocation failed for %1 of memory") + .arg(KIO::convertSize(pp.realw * pp.realh * sizeof(RGBA)))); + + decodeFailedOn0(SQE_R_NOMEMORY); + return; + } + } + + pt = new memoryPart(pp.realw * pp.realh); + pt->create(); + + if(!pt->valid()) + { + pp.removeParts(); + + if(tab->current) + break; + else + { + KMessageBox::error(this, i18n("Memory allocation failed")); + decodeFailedOn0(SQE_R_NOMEMORY); + return; + } + } + + line = 0; + + pp.computeCoords(); + pp.buffer = pt; + + tab->finfo = tab->codeK->information(); + + if(!tab->current) + { + tab->isflippedH = tab->isflippedV = false; + slotZoomIfLess(); + matrixChanged(); + updateCurrentFileInfo(); + } + + matrix_move_z(SQ_FIRST_TILE_LAYER+tab->current); + + for(int pass = 0;pass < im->passes;pass++) + { + if(tab->codeK->read_next_pass() != SQE_OK) + break; + + bool flip = tab->finfo.image[tab->current].needflip; + line = 0; + int tlsy = pp.tilesy.size(); + int tlsyval, offs = 0, O, iA; + + for(i = 0;i < tlsy;i++) + { + iA = flip ? (tlsy-i-1) : i; + tlsyval = pp.tilesy[iA]; + + for(j = 0;j < tlsyval;j++) + { + O = flip ? (pp.realw*(im->h - offs - j-1)) : (offs + j)*pp.realw; + res = tab->codeK->read_scanline(pp.buffer->data() + O); + errors += (int)(res != SQE_OK); + + if(++line == im->h) + break; + } + + offs += tlsyval; + + // last pass + if(pass == im->passes-1) + { +// if(!tab->current) + { + bool b = showFrames(iA, &pp, progr); + + if(!b) + kdWarning() << "Showframes failed for image " << tab->current << ", tiley " << i << endl; + } + } + + } + } + + id = images->insertItem(QString::fromLatin1("#%1 [%2x%3@%4]").arg(tab->current+1).arg(im->w).arg(im->h).arg(im->bpp)); + + images->setItemParameter(id, tab->current); + + if(!tab->current) + { +#ifndef KSQUIRREL_PART + SQ_GLView::window()->sbarWidget("SBDecodedI")->setPixmap(tab->lib->mime); +#endif + old_id = first_id = id; + } + + tab->parts.push_back(pp); + + calcFrameLabelWidth(); + frameChanged(); + tab->current++; + } + + tab->finfo = tab->codeK->information(); + tab->codeK->read_close(); + tab->total = tab->finfo.image.size(); + tab->current = 0; + frameChanged(); + + enableSettingsButton(!tab->lib->config.isEmpty()); + + decoded = true; + reset_mode = false; + updateGL(); + + tab->quickImageInfo = tab->lib->quickinfo; + tab->elapsed = started.elapsed(); + +#ifndef KSQUIRREL_PART + SQ_GLView::window()->sbarWidget("SBLoaded")->setText(KGlobal::locale()->formatLong(tab->elapsed) + i18n(" ms.")); +#else + t_glv.sbarWidget("SBLoaded")->setText(KGlobal::locale()->formatLong(tab->elapsed) + i18n(" ms.")); +#endif + + images->setItemChecked(first_id, true); + + if(tab->finfo.animated) + QTimer::singleShot(tab->finfo.image[tab->current].delay, this, SLOT(slotAnimateNext())); +} + +/* + * Palette changed. Let's update tickmarks and background color. + */ +void SQ_GLWidget::paletteChange(const QPalette &oldPalette) +{ + QGLWidget::paletteChange(oldPalette); + + SQ_Config::instance()->setGroup("GL view"); + + if(SQ_Config::instance()->readNumEntry("GL view background type", 1) == 0) + { + QColor color = colorGroup().color(QColorGroup::Base); + qglClearColor(color); + updateGL(); + } +} + +void SQ_GLWidget::slotFirst() +{ +#ifndef KSQUIRREL_PART + if(!reset_mode) + SQ_WidgetStack::instance()->firstFile(); +#endif +} + +void SQ_GLWidget::slotLast() +{ +#ifndef KSQUIRREL_PART + if(!reset_mode) + SQ_WidgetStack::instance()->lastFile(); +#endif +} + +void SQ_GLWidget::slotNext() +{ +#ifndef KSQUIRREL_PART + timer_next->stop(); + timer_prev->stop(); + + timer_next->start(timer_delay_file, true); +#endif +} + +void SQ_GLWidget::slotPrev() +{ +#ifndef KSQUIRREL_PART + timer_prev->stop(); + timer_next->stop(); + + timer_prev->start(timer_delay_file, true); +#endif +} + +void SQ_GLWidget::slotZoomMenu() +{ + zoomMenu->exec(QCursor::pos()); +} + +void SQ_GLWidget::slotAnimateNext() +{ + // Some time ago we started to decode new image, but it is + // not guaranteed that animation stopped! + // + // We should return now to avoid segfaults... + if(reset_mode) + return; + +// tab->parts[tab->current].removeParts(); + + tab->current++; + + if(tab->current >= (int)tab->finfo.image.size()) + tab->current = 0; + + updateCurrentFileInfo(); + updateGL(); + + int delay = tab->finfo.image[tab->current].delay; + + timer_anim->start(delay, true); +} + +void SQ_GLWidget::startAnimation() +{ + if(!tab->finfo.animated) return; + + timer_anim->start(tab->finfo.image[tab->current].delay, true); +} + +void SQ_GLWidget::stopAnimation() +{ + timer_anim->stop(); +} + +void SQ_GLWidget::slotToggleAnimate() +{ + if(!tab->finfo.animated || gls->valid()) return; + + if(!timer_anim->isActive()) + { + tab->manualBlocked = false; + startAnimation(); + } + else + { + tab->manualBlocked = true; + stopAnimation(); + } +} + +/* + * Next image in animated sequence. Called by user (with F3). + */ +void SQ_GLWidget::nextImage() +{ + // if the image has only one page - do nothing + if(tab->total == 1) + return; + + tab->current++; + + if(tab->current >= tab->total) + tab->current = 0; + + updateGL(); + updateCurrentFileInfo(); +} + +/* + * Previous image in animated sequence. Called by user (with F2). + */ +void SQ_GLWidget::prevImage() +{ + if(tab->total == 1) + return; + + tab->current--; + + if(tab->current < 0) + tab->current = tab->total - 1; + + updateGL(); + updateCurrentFileInfo(); +} + +/* + * Jump to first/last image page. + */ +void SQ_GLWidget::jumpToImage(bool last) +{ + // if the image has only one page - do nothing + if(tab->total == 1) + return; + + tab->current = (last) ? tab->finfo.image.size() - 1 : 0; + + updateGL(); + updateCurrentFileInfo(); +} + +void SQ_GLWidget::initMarks() +{ + for(int i = 0;i < 4;i++) + { + glGenTextures(1, &mark[i]); + + glBindTexture(GL_TEXTURE_2D, mark[i]); + + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP); + + glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 16, 16, 0, GL_RGBA, GL_UNSIGNED_BYTE, mm[i].bits()); + } +} + +void SQ_GLWidget::internalZoom(const GLfloat &zF) +{ + tab->curangle = 0.0; + + oldZoom = getZoom(); + matrix_pure_reset(); + + exifRotate(false); + + matrix_zoom(zF); +} + +void SQ_GLWidget::updateFilter(bool nice) +{ + if(nice == linear) + return; + + // store + linear = nice; + + int filter = nice ? GL_LINEAR : GL_NEAREST; + Parts *pt; + + // update all textures + for(int i = 0;i < tab->total;i++) + { + pt = tab->broken ? parts_broken : &tab->parts[i]; + int toxy = pt->m_parts.size(); + + for(int j = 0;j < toxy;j++) + { + glBindTexture(GL_TEXTURE_2D, pt->m_parts[j].tex); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, filter); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, filter); + } + } + + updateGL(); +} + +/* + * Cleanup method. + */ +void SQ_GLWidget::decodeFailedOn0(const int err_code) +{ + tab->codeK->read_close(); + tab->finfo.image.clear(); + tab->finfo.meta.clear(); + tab->total = 0; + decoded = (bool)tabs.size(); + reset_mode = false; + tab->broken = true; + tab->lib = 0; + + useBrokenImage(err_code); +} + +/* + * Force using broken image + update context. + * Show appropriate error message in statusbar. + */ +void SQ_GLWidget::useBrokenImage(const int err_index) +{ + enableSettingsButton(false); + enableActions(false); + + // save "broken" image information in 'tab->finfo' + tab->finfo.image.push_back(image_broken); + + // reset statusbar widgets + SQ_GLView::window()->resetStatusBar(); + +#ifndef KSQUIRREL_PART + // show error message instead of file name + SQ_GLView::window()->sbarWidget("SBFile")->setText(SQ_ErrorString::instance()->string(err_index)); + KSquirrel::app()->setCaption(QString::null); +#else + t_glv.sbarWidget("SBFile")->setText(SQ_ErrorString::instance()->string(err_index)); +#endif + + matrix_pure_reset(); + tab->curangle = 0; + tab->isflippedH = tab->isflippedV = false; + + changeSlider(1.0); + + // update context and show "broken" image + updateGL(); +} + +/* + * Are we in fullscreen state ? + */ +bool SQ_GLWidget::fullscreen() const +{ +#ifndef KSQUIRREL_PART + KWin::WindowInfo wi = KWin::windowInfo(SQ_GLView::window()->winId()); + + if(wi.valid()) + pAFull->setChecked((wi.state() & NET::FullScreen)); + + return pAFull->isChecked(); +#else + return false; +#endif +} + +/* + * Toggle fullscreen state. + */ +void SQ_GLWidget::toggleFullScreen() +{ +#ifndef KSQUIRREL_PART + bool fs = !fullscreen(); + + pAFull->setChecked(fs); + pAToolFull->setOn(fs); + + KSquirrel::app()->slotFullScreen(fs); +#endif +} + +void SQ_GLWidget::slotSetZoomPercents(int perc) +{ + if(tab->broken || tab->finfo.image.empty()) return; + + GLfloat z = (perc <= 20) ? (GLfloat)perc / 20 : ((GLfloat)perc - 20)/2 + 1.0; + + internalZoom(z); +} + +void SQ_GLWidget::updateFactors() +{ + zoomfactor = SQ_Config::instance()->readNumEntry("zoom", 25); + movefactor = SQ_Config::instance()->readNumEntry("move", 5); + rotatefactor = SQ_Config::instance()->readNumEntry("angle", 90); +} + +void SQ_GLWidget::slotSelectionRect() +{ + stopAnimation(); + tab->glselection = SQ_GLSelectionPainter::Rectangle; + gls->end(); +} + +void SQ_GLWidget::slotSelectionEllipse() +{ + stopAnimation(); + tab->glselection = SQ_GLSelectionPainter::Ellipse; + gls->end(); +} + +void SQ_GLWidget::slotSelectionClear() +{ + tab->glselection = -1; + gls->end(); + + pASelectionEllipse->setChecked(false); + pASelectionRect->setChecked(false); + + if(!manualBlocked()) + startAnimation(); +} + +bool SQ_GLWidget::manualBlocked() +{ + // selection is also blocks animation + return tab->manualBlocked || gls->valid(); +} + +void SQ_GLWidget::setDownloadPercents(int p) +{ + if(p < 0) + percentsLabel->hide(); + else + { + percentsLabel->setText(i18n("Downloading...") + ' ' + KIO::convertSize(p)); + percentsLabel->adjustSize(); + percentsLabel->show(); + } +} + +#include "sq_glwidget.moc" diff --git a/ksquirrel/sq_glwidget.h b/ksquirrel/sq_glwidget.h new file mode 100644 index 0000000..550a1a5 --- /dev/null +++ b/ksquirrel/sq_glwidget.h @@ -0,0 +1,619 @@ +/*************************************************************************** + sq_glwidget.h - description + ------------------- + begin : Mon Mar 15 2004 + copyright : (C) 2004 by Baryshev Dmitry + email : ksquirrel.iv@gmail.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + + +#ifndef SQ_GLWIDGET_H +#define SQ_GLWIDGET_H + +#include +#include +#include +#include + +#include + +#include + +#include "sq_glparts.h" + +#ifdef KSQUIRREL_PART +#include "sq_glview.h" +#endif + +class SQ_GLSelectionPainter; +struct SQ_ImageFilterOptions; +struct SQ_ImageBCGOptions; +struct RGBA; + +// parameters in GL matrix +#define MATRIX_C1 tab->matrix[0] +#define MATRIX_S1 tab->matrix[1] +#define MATRIX_X tab->matrix[3] +#define MATRIX_S2 tab->matrix[4] +#define MATRIX_C2 tab->matrix[5] +#define MATRIX_Y tab->matrix[7] +#define MATRIX_Z tab->matrix[11] + +class KAction; +class KActionCollection; +class KToggleAction; +class KPopupMenu; +class KRadioAction; +class KTempFile; + +namespace KIO { class Job; } + +class QTimer; +class QPopupMenu; +class QSlider; +class QLabel; + +class SQ_ToolButtonPopup; +class SQ_ToolButton; +class SQ_ToolBar; + +/* *************************************************************** */ + +/* + * SQ_GLWidget represents a widget, which loads, shows and manipulates + * an image. + * + * It contains complex decoding method. Since OpenGL can show textures + * only with dimensions of power of 2 (32x62, 512, 256 etc.), we should divide + * decoded image into quads and only then generate textures. + * It means, that the image you see consists of several parts: + * + * |---------------------------------- + * | | | + * | tex N1 | tex N2 | + * | | | + * ----------------------------------- <= Entire image + * | | | + * | tex N3 | tex N4 | + * | | | + * ----------------------------------- + * + * + * The main class member is 'parts'. It's an array of decoded images + * and appropriate memory buffers and textures. Here comes an explanation: + * [ use monotype fonts :) ] + * + * textures & coordinates Part + * +-----------------------------------+ ##################### ################## + * | parts[2] | # # #===> # # + * | +-------------------------------------+ # # # # texture id # + * | | parts[1] | |======> ##################### # texture coords # + * | | +-------------------------------------+ | # # # # ... # + * | | | m_parts parts[0] | | # # # ################## + * | | | ##### | | ##################### + * | | | # # | | + * | | | # #===============================| + * | | | # # | + * | | | ##### | + * | | | | memory buffers + * | | | m32 | ############################### + * | | | ##### | #RGBA.#.....#.....#.....#.....# + * | | | # # | #RGBA.#.....#.....#.....#.....# + * | | | # #==================================> ############################### + * +-| | # # | #RGBA.#.....#.....#.....#.....# + * +-| ##### | #RGBA.#.....#.....#.....#.....# + * +-------------------------------------+ ############################### + * \ / + * \ / + * parts + * + * + ****************************************************************************** + * + */ + +class SQ_GLWidget : public QGLWidget +{ + Q_OBJECT + + public: + SQ_GLWidget(QWidget *parent = 0, const char *name = 0); + ~SQ_GLWidget(); + + void setDownloadPercents(int); + + void removeNonCurrentTabs(int); + + void setExpectedURL(const KURL &u); + + QString originalURL() const; + + /* + * Start decoding given image. We can call it from anywhere. + */ + void startDecoding(const QString &file); + void startDecoding(const KURL &url); + + void zoom(GLfloat); + + /* + * Set zoom, move and rotate factors from config. + */ + void updateFactors(); + + /* + * Set clear color for context. + */ + void setClearColor(); + + void setOriginalURL(const KURL &); + + /* + * Get zoom value, e.g. 1.5, 2.2 ... + */ + GLfloat getZoom() const; + + /* + * Get zoom value in percents, e.g. 150, 220 ... + */ + GLfloat getZoomPercents() const; + + KActionCollection* actionCollection() const; + + /* + * Are we in fullscreen state ? + */ + bool fullscreen() const; + + /* + * Toggle fullscreen state. + */ + void toggleFullScreen(); + + /* + * Direct call to updateGL(). + */ + void updateGLA() { updateGL(); } + + /* + * Type of zoom: fit width, fit height... + */ + int zoomType(); + + /* + * Filter is GL_LINEAR ? + */ + bool isnice(); + + /* + * Direct call to glInit(); + */ + void glInitA() { QGLWidget::glInit(); } + + /* + * Start animation, if loaded image is animated. + */ + void startAnimation(); + + /* + * Stop animation, if loaded image is animated. + */ + void stopAnimation(); + + /* + * Is animation stopped by user ? + */ + bool manualBlocked(); + + /* + * Change statusbar info according with + * current matrix (it shows current zoom & angle values). + */ + void matrixChanged(); + + /* + * Check or uncheck 'Slideshow' button in toolbar. + */ + void updateSlideShowButton(bool toggled); + + void closeAllTabsFull(); + + static SQ_GLWidget* window() { return m_instance; } + + protected: + + /* + * Next three methods should be reimplemented in + * every QGLWidget's subclass. + */ + void initializeGL(); + void paintGL(); + void resizeGL(int,int); + + /* + * Mouse wheel event. Let's load next/previous image, or + * zoom in/zoom out (depends on settings). + */ + void wheelEvent(QWheelEvent *); + + /* + * Palette changed. Let's update tickmarks and background color. + */ + void paletteChange(const QPalette &oldPalette); + + /* + * Accept drag-and-drop events. We can drop some images + * on this widget, SQ_GLWidget will try to decode first file. + * + * TODO: find first supported image and decode it ? + */ + void dragEnterEvent(QDragEnterEvent *); + void dropEvent(QDropEvent *); + + /* + * Mouse events. + */ + void mousePressEvent(QMouseEvent *); + void mouseReleaseEvent(QMouseEvent *); + void mouseMoveEvent(QMouseEvent *); + + private: + void copyURL(); + + QImage generatePreview(); + + bool calcSelection(); + + void changeSlider(GLfloat z = -1.0); + + void hackMatrix(); + + void enableActions(bool U); + + void initAccelsAndMenu(); + + void crop(); + void bcg(); + void filter(); + void editUpdate(); + + /* + * Save current image page to clipboard + */ + void toClipboard(); + + /* + * Save current image page to file + */ + void saveAs(); + + void enableSettingsButton(bool enab); + + /* + * Remove currently loaded textures and memory buffers. + */ + void removeCurrentParts(); + void removeCurrentTabs(); + + void closeAllTabs(); + + /* + * Since 0.6.0-final KSquirrel doesn't show error messages, + * if the image is broken or not supported. It uses "broken" image + * instead. This method does all needed init. + */ + void initBrokenImage(); + + /* + * Force using broken image + update context. + * Show appropriate error message in statusbar. + */ + void useBrokenImage(const int err_index); + + /* + * Update filter. If 'nice' is true, use GL_LINEAR + * and GL_NEAREST otherwise. + */ + void updateFilter(bool nice); + + /* + * Cleanup method. + */ + void decodeFailedOn0(const int err_code); + + /* + * Create KActions. + */ + void createActions(); + + /* + * Create toolbars. + */ + void createToolbar(); + + /* + * Fill a w x h region with texture. Generate texture if needed. + */ + void draw_background(void *bits, unsigned int *tex, int dim, GLfloat w, GLfloat h, bool &bind, bool deleteOld); + + void setupBits(Parts *p, RGBA *buffer, int y, int x); + + /* + * Jump to first or last image in animated sequence. + */ + void jumpToImage(bool); + + /* + * Next image in animated sequence. Called by user (with F3). + */ + void nextImage(); + + /* + * Previous image in animated sequence. Called by user (with F2). + */ + void prevImage(); + + /* + * Draw (or not) image's background. + */ + void toggleDrawingBackground(); + + /* + * Show popup menu with external tools. + */ + void showExternalTools(); + + /* + * Generate textures for tickmarks and bind them. + */ + void initMarks(); + + /* + * Load and check tickmarks from disk. + */ + void createMarks(); + + /* + * Wrapper for 'delete' key. Called from keyPressEvent(). + */ + void deleteWrapper(); + + /* + * Show current image's width, height and bpp in statusbar. + */ + void updateCurrentFileInfo(); + + /* + * Show/hide tickmarks. + */ + void toogleTickmarks(); + + /* + * Show current page number in multipaged images. + * + * For example: "3/11" means that current page is the third in current image, + * which has 11 pages. + */ + void frameChanged(); + void calcFrameLabelWidth(); + + /* + * Set current zoom to 'z'. + */ + void internalZoom(const GLfloat &z); + + /* + * Find best tile's width and height for given width and height. + */ + static void findCloserTiles(int w, int h, std::vector &x, std::vector &y); + static QPair calcRealDimensions(Parts &, int y = -1, int x = -1); + + /* + * Prepare decoding. It will find proper library for decoding, + * clear old memory buffers, etc. + */ + bool prepare(); + + /* + * Zoom to 'r'. Will be called after somebody used mouse button + * to select zoom region. Return true, if zoomed. + */ + bool zoomRect(const QRect &r); + + /* + * Bind textures, draw them and create GL lists. + * If 'swap' it true, swap buffers. + */ + bool showFrames(int y, Parts *, bool swap); + + /* + * OpenGL-related methods, not interesting :-) + * + * Move, zoom, reset, flip and rotate current matrix. + */ + void matrix_move(GLfloat x, GLfloat y); + void matrix_move_z(GLfloat z); + bool matrix_zoom(GLfloat ratio); + void matrix_reset(bool = true); + void matrix_pure_reset(); + void matrix_push(); + void matrix_pop(); + void write_gl_matrix(); + void matrix_rotate(GLfloat angle, bool = true); + void matrix_rotate2(GLfloat angle); + void flip(int, bool = true); + void flip_h(); + void flip_v(); + void exifRotate(bool); + + signals: + void tabCountChanged(); + void message(const QString &); + + public slots: + void slotPrint(); + + void slotSelectionEllipse(); + void slotSelectionRect(); + void slotSelectionClear(); + + private slots: + void decode(); + + void slotAccelActivated(); + + void slotChangeTab(int); + void slotCloseRequest(int); + + void slotCopyJobResult(KIO::Job *job); + + /* + * Slots for toolbar's actions: + * fit width, fit height, zoom+, zoom-, rotate, flip, + * first file, last file, reset... + */ + void slotShowNav(); + void slotSetZoomPercents(int); + void slotZoomW(); + void slotZoomH(); + void slotZoomWH(); + void slotZoomPlus(); + void slotZoom100(); + void slotZoomLast(); + void slotZoomMinus(); + void slotZoomIfLess(); + void slotRotateLeft(); + void slotRotateRight(); + void slotFlipV(); + void slotFlipH(); + void slotMatrixReset(); + void slotProperties(); // show image properties + void slotFirst(); + void slotLast(); + void slotNext(); + void slotPrev(); + void slotZoomMenu(); + void slotAnimateNext(); + void slotToggleAnimate(); // start/stop animation + void slotSetCurrentImage(int); + void slotShowImages(); + void slotImagesHidden(); + void slotImagesShown(); + void slotShowHelp(); + void slotShowCodecSettings(); + void slotApplyCodecSettings(); + + void slotBCG(SQ_ImageBCGOptions *); + void slotFilter(SQ_ImageFilterOptions *fltopt); + + void slotCopyResult(KIO::Job *); + + private: + KAction *pASelectionClear; + KToggleAction *pAFull, *pAIfLess, *pAZoomW, + *pAZoomH, *pAZoomWH, *pAZoom100, + *pAZoomLast, + *pASelectionEllipse, *pASelectionRect; + + SQ_ToolButton *pAToolQuick, *pAToolFull, *pAToolProp, *pAToolPrint; + SQ_ToolButtonPopup *pAToolZoom, *pAToolImages; + + KActionCollection *ac, *acMain; + QPopupMenu *menu, *menuFile, *menuImage; + int id_saveas, id_settings, + id_f5, id_f6, id_f7, id_f8, id_del, + id_prop; + + // popup menu with zoom types (fit width, fit height, zoom 100%...) + KPopupMenu *zoomMenu, *selectionMenu, + + // popup menu with image pages + *images; + + QImage BGpixmap, BGquads; + + QTimer *timer_prev, *timer_next; + QTimer *timer_anim; + + QImage mm[4]; + + fmt_image image_broken; + SQ_GLSelectionPainter *gls; + + Parts *parts_broken; + + GLfloat saved[12], zoomfactor, movefactor, rotatefactor; + + unsigned int texQuads, texPixmap, mark[4]; + int xmoveold, ymoveold, xmove, ymove, + zoom_type, old_id, total, errors, movetype; + bool reset_mode, decoded, blocked, + changed, marks, linear; + float zoomFactor, oldZoom; + RGBA *buffer; + QSlider *slider_zoom; + + KTempFile *tmp; + KURL lastCopy, m_expected, m_original; + QTime clickTime, started; + + std::vector tabs; + Tab *tab, *tabold; + Tab tmptab, taborig; + bool hackResizeGL, bindChecker; + + QLabel *percentsLabel; + +#ifdef KSQUIRREL_PART + SQ_GLView t_glv; +#endif + + static SQ_GLWidget *m_instance; +}; + +inline +int SQ_GLWidget::zoomType() +{ + return zoom_type; +} + +inline +bool SQ_GLWidget::isnice() +{ + return linear; +} + +inline +KActionCollection* SQ_GLWidget::actionCollection() const +{ + return ac; +} + +inline +void SQ_GLWidget::setOriginalURL(const KURL &u) +{ + m_original = u; +} + +inline +QString SQ_GLWidget::originalURL() const +{ + return tab->m_original.isLocalFile() ? tab->m_original.path() : tab->m_original.prettyURL(); +} + +inline +void SQ_GLWidget::setExpectedURL(const KURL &u) +{ + m_expected = u; +} + +#endif diff --git a/ksquirrel/sq_glwidget_helpers.cpp b/ksquirrel/sq_glwidget_helpers.cpp new file mode 100644 index 0000000..bad2d89 --- /dev/null +++ b/ksquirrel/sq_glwidget_helpers.cpp @@ -0,0 +1,263 @@ +/*************************************************************************** + sq_glwidget_helpers.cpp - description + ------------------- + begin : 7 2005 + copyright : (C) 2005 by Baryshev Dmitry + email : ksquirrel.iv@gmail.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include +#include +#include +#include + +#include + +#include + +#include + +#ifdef SQ_HAVE_KEXIF +#include +#endif + +#include "sq_glwidget_helpers.h" + +SQ_ToolButtonPopup::SQ_ToolButtonPopup(const QPixmap &pix, const QString &textLabel, KToolBar *parent) + : KToolBarButton(pix, -1, parent, 0, textLabel) +{ + setFixedWidth(SQ_ToolButton::fixedWidth()); +} + +SQ_ToolButtonPopup::~SQ_ToolButtonPopup() +{} + +SQ_ToolButton::SQ_ToolButton(const QIconSet &iconSet, const QString &textLabel, + QObject *receiver, const char *slot, KToolBar *parent, const char *name) + : QToolButton(iconSet, textLabel, QString::null, receiver, slot, parent, name) +{ + setFixedWidth(SQ_ToolButton::fixedWidth()); +} + +SQ_ToolButton::~SQ_ToolButton() +{} + +int SQ_GLHelpers::roundAngle(int curangle) +{ + int sign = (curangle < 0 ? -1 : 1); + curangle = std::abs(curangle); + + if((curangle > 0 && curangle < 45) || (curangle >= 315 && curangle < 360)) + curangle = 0; + else if(curangle >= 45 && curangle < 135) + curangle = 90; + else if(curangle >= 135 && curangle < 225) + curangle = 180; + else if(curangle >= 225 && curangle < 315) + curangle = 270; + + curangle *= sign; + + return curangle; +} + +void SQ_GLHelpers::subRotation(QWMatrix &wm, int curangle, int orient) +{ + curangle = SQ_GLHelpers::roundAngle(curangle); + +#ifdef SQ_HAVE_KEXIF + switch(orient) + { + case KExifData::ROT_180: curangle -= 180; break; + case KExifData::ROT_90_HFLIP: + case KExifData::ROT_90: + case KExifData::ROT_90_VFLIP: curangle -= 90; break; + case KExifData::ROT_270: curangle -= 270; break; + + default: ; + } +#endif + + switch(curangle) + { + case -180: + case 180: wm.rotate(180); break; + + case -270: + case 90: wm.rotate(90); break; + + case -90: + case 270: wm.rotate(270); break; + + default: ; + } +} + +bool SQ_GLHelpers::normalizeSelection(int &sx, int &sy, int &sw, int &sh, int w, int h, const QWMatrix &matr, int curangle, int orient) +{ + QWMatrix wm = matr; + + SQ_GLHelpers::subRotation(wm, curangle, orient); + + if(!wm.isIdentity()) + { + int ax = -w/2 + sx; + int ay = h/2 - sy; + + QPointArray pa(4), pb; + + pa.setPoint(0, ax, ay-sh); + pa.setPoint(1, ax+sw, ay-sh); + pa.setPoint(2, ax+sw, ay); + pa.setPoint(3, ax, ay); + + pb = wm.map(pa); + + int fx, fy, fx2, fy2; + fx = std::min(std::min(pb.point(0).x(), pb.point(1).x()), std::min(pb.point(2).x(), pb.point(3).x())); + fy = std::max(std::max(pb.point(0).y(), pb.point(1).y()), std::max(pb.point(2).y(), pb.point(3).y())); + + fx2 = std::max(std::max(pb.point(0).x(), pb.point(1).x()), std::max(pb.point(2).x(), pb.point(3).x())); + fy2 = std::min(std::min(pb.point(0).y(), pb.point(1).y()), std::min(pb.point(2).y(), pb.point(3).y())); + + sx = fx; + sy = fy; + sw = fx2 - fx; + sh = fy - fy2; + + sx += w/2; + sy = h/2-sy; + } + + if(sx > w || sy > h || sx + sw < 0 || sy + sh < 0) + return false; + + if(sx < 0) { sw = sw+sx; sx = 0; } + if(sy < 0) { sh = sh+sy; sy = 0; } + + if(sx + sw > w) sw = w - sx; + if(sy + sh > h) sh = h - sy; + + return (sw && sh); +} + +void SQ_GLHelpers::scanLine0(RGBA *data, RGBA *scan, int rw, int w, int h, int y, int flip) +{ + if(flip == 1) + { + data = data + rw*y + w-1; + + for(int i = 0;i < w;i++) + { + *scan = *data; + + scan++; + data--; + } + } + else if(flip == 2) + { + data = data + rw*(h-1-y); + + for(int i = 0;i < w;i++) + { + *scan = *data; + + scan++; + data++; + } + } + else + memcpy(scan, data + rw*y, w * sizeof(RGBA)); +} + +void SQ_GLHelpers::scanLine90(RGBA *data, RGBA *scan, int rw, int w, int h, int y, int flip) +{ + if(flip == 2) + { + data = data + y; + + for(int i = 0;i < h;i++) + { + *scan = *data; + + scan++; + data += rw; + } + } + else + { + data = flip == 1 ? (data + rw*(h-1) + w-y-1) : (data + rw*(h-1) + y); + + for(int i = 0;i < h;i++) + { + *scan = *data; + + scan++; + data -= rw; + } + } +} + +void SQ_GLHelpers::scanLine180(RGBA *data, RGBA *scan, int rw, int w, int h, int y, int flip) +{ + if(flip == 1) + { + data = data + rw*(h-1-y); + + memcpy(scan, data, w * sizeof(RGBA)); + } + else + { + data = flip == 2 ? (data + rw*y + w-1) : (data + rw*(h-1-y) + w-1); + + for(int i = 0;i < w;i++) + { + *scan = *data; + + scan++; + data--; + } + } +} + +void SQ_GLHelpers::scanLine270(RGBA *data, RGBA *scan, int rw, int w, int h, int y, int flip) +{ + if(flip == 2) + { + data = data + rw*(h-1) + w-y-1; + + for(int i = 0;i < h;i++) + { + *scan = *data; + + scan++; + data -= rw; + } + } + else + { + data = flip == 1 ? (data + y) : (data + w-y-1); + + for(int i = 0;i < h;i++) + { + *scan = *data; + + scan++; + data += rw; + } + } +} diff --git a/ksquirrel/sq_glwidget_helpers.h b/ksquirrel/sq_glwidget_helpers.h new file mode 100644 index 0000000..a9a224a --- /dev/null +++ b/ksquirrel/sq_glwidget_helpers.h @@ -0,0 +1,74 @@ +/*************************************************************************** + sq_glwidget_helpers.h - description + ------------------- + begin : May 31 2005 + copyright : (C) 2005 by Baryshev Dmitry + email : ksquirrel.iv@gmail.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifndef SQ_GLWIDGET_HELPERS +#define SQ_GLWIDGET_HELPERS + +#include + +class QWMatrix; + +class KToolBar; + +struct RGBA; + +class SQ_ToolButtonPopup : public KToolBarButton +{ + public: + SQ_ToolButtonPopup(const QPixmap &pix, const QString &textLabel, KToolBar *parent); + ~SQ_ToolButtonPopup(); +}; + +class SQ_ToolButton : public QToolButton +{ + public: + SQ_ToolButton(const QIconSet &iconSet, const QString &textLabel, QObject *receiver, + const char *slot, KToolBar *parent, const char *name = 0); + ~SQ_ToolButton(); + + static int fixedWidth(); +}; + +inline +int SQ_ToolButton::fixedWidth() +{ + return 26; +} + +namespace SQ_GLHelpers +{ + // 0, 1, 2 + typedef void (* scanLineGetter)(RGBA *data, RGBA *, int rw, int w, int h, int y, int flip); + + void scanLine0(RGBA *, RGBA *, int, int, int, int, int); + void scanLine90(RGBA *, RGBA *, int, int, int, int, int); + void scanLine180(RGBA *, RGBA *, int, int, int, int, int); + void scanLine270(RGBA *, RGBA *, int, int, int, int, int); + + int roundAngle(int ang); + + void subRotation(QWMatrix &wm, int curangle, int orient); + + /* + * normalize selection rectangle + * sx,sy are X and Y coordinates + * sw x sh is a selection geometry + */ + bool normalizeSelection(int &sx, int &sy, int &sw, int &sh, int w, int h, const QWMatrix&, int curangle, int orient); +} + +#endif diff --git a/ksquirrel/sq_glwidget_stuff.cpp b/ksquirrel/sq_glwidget_stuff.cpp new file mode 100644 index 0000000..3926166 --- /dev/null +++ b/ksquirrel/sq_glwidget_stuff.cpp @@ -0,0 +1,1778 @@ +/*************************************************************************** + sq_glwidget_stuff.cpp - description + ------------------- + begin : Wed Oct 31 2007 + copyright : (C) 2007 by Baryshev Dmitry + email : ksquirrel.iv@gmail.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#ifndef KSQUIRREL_PART +#include "ksquirrel.h" +#include "sq_widgetstack.h" +#endif + +#include "sq_config.h" +#include "sq_libraryhandler.h" +#include "sq_glview.h" +#include "sq_glwidget.h" +#include "sq_glwidget_helpers.h" +#include "sq_imageproperties.h" +#include "sq_helpwidget.h" +#include "sq_filedialog.h" +#include "sq_iconloader.h" +#include "sq_codecsettingsskeleton.h" +#include "sq_externaltool.h" +#include "sq_diroperator.h" +#include "sq_popupmenu.h" +#include "sq_glselectionpainter.h" +#include "sq_utils.h" +#include "sq_imagefilter.h" +#include "sq_imagebcg.h" +#include "fmt_filters.h" + +#ifdef SQ_HAVE_KEXIF +#include +#include +#endif + +#include +#include + +#include "file_broken.xpm" + +// Create actions +void SQ_GLWidget::createActions() +{ + pASelectionRect = new KToggleAction(i18n("Rectangle"), QPixmap(locate("data", "images/actions/glselection_rect.png")), 0, this, SLOT(slotSelectionRect()), ac, "SQ Selection Rect"); + pASelectionEllipse = new KToggleAction(i18n("Ellipse"), QPixmap(locate("data", "images/actions/glselection_ellipse.png")), 0, this, SLOT(slotSelectionEllipse()), ac, "SQ Selection Ellipse"); + pASelectionClear = new KAction(i18n("Clear"), 0, 0, this, SLOT(slotSelectionClear()), ac, "SQ Selection Clear"); + + pAZoomW = new KToggleAction(i18n("Fit width"), QPixmap(locate("data", "images/actions/zoomW.png")), 0, this, SLOT(slotZoomW()), ac, "SQ ZoomW"); + pAZoomH = new KToggleAction(i18n("Fit height"), QPixmap(locate("data", "images/actions/zoomH.png")), 0, this, SLOT(slotZoomH()), ac, "SQ ZoomH"); + pAZoomWH = new KToggleAction(i18n("Fit image"), QPixmap(locate("data", "images/actions/zoomWH.png")), 0, this, SLOT(slotZoomWH()), ac, "SQ ZoomWH"); + pAZoom100 = new KToggleAction(i18n("Zoom 100%"), QPixmap(locate("data", "images/actions/zoom100.png")), 0, this, SLOT(slotZoom100()), ac, "SQ Zoom100"); + pAZoomLast = new KToggleAction(i18n("Leave previous zoom"), QPixmap(locate("data", "images/actions/zoomlast.png")), 0, this, SLOT(slotZoomLast()), ac, "SQ ZoomLast"); + pAIfLess = new KToggleAction(i18n("Ignore, if image is smaller than window"), QPixmap(locate("data", "images/actions/ifless.png")), 0, 0, 0, ac, "if less"); + + pAFull = new KToggleAction(QString::null, 0, 0, 0, ac, "SQ GL Full"); + + QString squirrel_zoom_actions = QString::fromLatin1("squirrel_zoom_actions"); + pAZoomW->setExclusiveGroup(squirrel_zoom_actions); + pAZoomH->setExclusiveGroup(squirrel_zoom_actions); + pAZoomWH->setExclusiveGroup(squirrel_zoom_actions); + pAZoom100->setExclusiveGroup(squirrel_zoom_actions); + pAZoomLast->setExclusiveGroup(squirrel_zoom_actions); + + QString squirrel_selection_type = QString::fromLatin1("squirrel_selection_type"); + pASelectionEllipse->setExclusiveGroup(squirrel_selection_type); + pASelectionRect->setExclusiveGroup(squirrel_selection_type); + + connect(pAIfLess, SIGNAL(toggled(bool)), this, SLOT(slotZoomIfLess())); + +#ifndef KSQUIRREL_PART + connect(pAFull, SIGNAL(toggled(bool)), KSquirrel::app(), SLOT(slotFullScreen(bool))); +#endif + + SQ_Config::instance()->setGroup("GL view"); + + pAIfLess->setChecked(SQ_Config::instance()->readBoolEntry("ignore", true)); +} + +void SQ_GLWidget::createToolbar() +{ + zoomMenu = new KPopupMenu; + +#ifndef KSQUIRREL_PART + selectionMenu = new KPopupMenu; + + SQ_ToolButton *pATool; + + SQ_ToolBar *toolbar = SQ_GLView::window()->toolbar(); + + pASelectionRect->plug(selectionMenu); + pASelectionEllipse->plug(selectionMenu); + selectionMenu->insertSeparator(); + pASelectionClear->plug(selectionMenu); + + // hack to show accels + selectionMenu->changeItem(pASelectionRect->itemId(0), pASelectionRect->text() + "\tCtrl+R"); + selectionMenu->changeItem(pASelectionEllipse->itemId(0), pASelectionEllipse->text() + "\tCtrl+E"); + selectionMenu->changeItem(pASelectionClear->itemId(0), pASelectionClear->text() + "\tCtrl+C"); + + pAZoom100->plug(zoomMenu); + pAZoomLast->plug(zoomMenu); + zoomMenu->insertSeparator(); + pAZoomW->plug(zoomMenu); + pAZoomH->plug(zoomMenu); + pAZoomWH->plug(zoomMenu); + zoomMenu->insertSeparator(); + pAIfLess->plug(zoomMenu); + + switch(zoom_type) + { + case 0: pAZoomW->setChecked(true); break; + case 1: pAZoomH->setChecked(true); break; + case 3: pAZoom100->setChecked(true); break; + case 4: pAZoomLast->setChecked(true); break; + + // "case 2" too + default: pAZoomWH->setChecked(true); + } + +/* + * We will create QToolButtons and put them in toolbar. + * Of course, we can just KAction::plug(), BUT plugged KActions + * will produce buttons, which cann't be clicked twise! I think + * plugged KActions will treat our attempt as double-click, not two single-clicks. + * On the other hand, we can click QToolButton as frequently as we want. + * + * Plugged KActions also don't know about autorepeat :( + */ + new SQ_ToolButton(QPixmap(locate("data", "images/actions/file_first.png")), i18n("Go to first image"), this, SLOT(slotFirst()), toolbar); + pATool = new SQ_ToolButton(QPixmap(locate("data", "images/actions/file_prev.png")), i18n("Previous image"), this, SLOT(slotPrev()), toolbar); + pATool->setAutoRepeat(true); + pATool = new SQ_ToolButton(QPixmap(locate("data", "images/actions/file_next.png")), i18n("Next image"), this, SLOT(slotNext()), toolbar); + pATool->setAutoRepeat(true); + new SQ_ToolButton(QPixmap(locate("data", "images/actions/file_last.png")), i18n("Go to last image"), this, SLOT(slotLast()), toolbar); + + // some toolbuttons need autorepeat... + pATool = new SQ_ToolButton(QPixmap(locate("data", "images/actions/zoom+.png")), i18n("Zoom +"), this, SLOT(slotZoomPlus()), toolbar); + pATool->setAutoRepeat(true); + pATool = new SQ_ToolButton(QPixmap(locate("data", "images/actions/zoom-.png")), i18n("Zoom -"), this, SLOT(slotZoomMinus()), toolbar); + pATool->setAutoRepeat(true); + pAToolZoom = new SQ_ToolButtonPopup(QPixmap(locate("data", "images/actions/zoom_template.png")), i18n("Zoom"), toolbar); + pAToolZoom->setPopup(zoomMenu); + pATool = new SQ_ToolButton(QPixmap(locate("data", "images/actions/rotateL.png")), i18n("Rotate left"), this, SLOT(slotRotateLeft()), toolbar); + pATool->setAutoRepeat(true); + pATool = new SQ_ToolButton(QPixmap(locate("data", "images/actions/rotateR.png")), i18n("Rotate right"), this, SLOT(slotRotateRight()), toolbar); + pATool->setAutoRepeat(true); + pATool = new SQ_ToolButton(QPixmap(locate("data", "images/actions/flipV.png")), i18n("Flip vertically"), this, SLOT(slotFlipV()), toolbar); + pATool->setAutoRepeat(true); + pATool = new SQ_ToolButton(QPixmap(locate("data", "images/actions/flipH.png")), i18n("Flip horizontally"), this, SLOT(slotFlipH()), toolbar); + pATool->setAutoRepeat(true); + new SQ_ToolButton(QPixmap(locate("data", "images/actions/reload.png")), i18n("Normalize"), this, SLOT(slotMatrixReset()), toolbar); + + pAToolFull = new SQ_ToolButton(QPixmap(locate("data", "images/actions/fullscreen.png")), i18n("Fullscreen"), pAFull, SLOT(activate()), toolbar); + pAToolFull->setToggleButton(true); + pAToolImages = new SQ_ToolButtonPopup(QPixmap(locate("data", "images/actions/images.png")), i18n("Select image"), toolbar); + pAToolImages->setPopup(images); + SQ_ToolButtonPopup *pAToolSel = new SQ_ToolButtonPopup(QPixmap(locate("data", "images/actions/glselection.png")), i18n("Selection"), toolbar); + pAToolSel->setPopup(selectionMenu); + pAToolQuick = new SQ_ToolButton(QPixmap(locate("data", "images/actions/configure.png")), i18n("Codec settings"), this, SLOT(slotShowCodecSettings()), toolbar); + pAToolQuick->setEnabled(false); + pAToolProp = new SQ_ToolButton(QPixmap(locate("data", "images/actions/prop.png")), i18n("Image Properties"), this, SLOT(slotProperties()), toolbar); + pAToolPrint = new SQ_ToolButton(QPixmap(locate("data", "images/actions/print.png")), i18n("Print"), this, SLOT(slotPrint()), toolbar); + new SQ_ToolButton(QPixmap(locate("data", "images/actions/shownav.png")), i18n("Show navigator"), this, SLOT(slotShowNav()), toolbar); + + slider_zoom = new QSlider(1, 38, 2, 19, Qt::Horizontal, toolbar); + slider_zoom->setTickmarks(QSlider::Below); + slider_zoom->setTickInterval(19); + connect(slider_zoom, SIGNAL(valueChanged(int)), this, SLOT(slotSetZoomPercents(int))); + toolbar->insertWidget(1000, 0, slider_zoom); + toolbar->setItemAutoSized(1000); + toolbar->alignItemRight(1000); + + changeSlider(1.0); +#endif +} + +// Show image properties. +void SQ_GLWidget::slotProperties() +{ + if(tab->broken || tab->finfo.image.empty()) return; + + // Stop animation... + stopAnimation(); + + const int real_size = tab->finfo.image[tab->current].w * tab->finfo.image[tab->current].h * sizeof(RGBA); + QString sz = KIO::convertSize(real_size); + QStringList list; + + QValueVector > meta; + + if(!tab->finfo.meta.empty()) + { + for(std::vector::iterator it = tab->finfo.meta.begin();it != tab->finfo.meta.end();++it) + { + meta.append(QPair((*it).group, (*it).data)); + } + } + + // save tab->current image parameters and some additioanl information + // in list + list << tab->quickImageInfo + << QString::fromLatin1("%1x%2").arg(tab->finfo.image[tab->current].w).arg(tab->finfo.image[tab->current].h) + << QString::fromLatin1("%1").arg(tab->finfo.image[tab->current].bpp) + << tab->finfo.image[tab->current].colorspace + << tab->finfo.image[tab->current].compression + << sz + << QString::fromLatin1("%1").arg((double)real_size / tab->fmt_size, 0, 'f', 2) + << ((tab->finfo.image[tab->current].interlaced) ? i18n("yes") : i18n("no")) + << QString::fromLatin1("%1").arg(errors) + << QString::fromLatin1("%1").arg(tab->finfo.image.size()) + << QString::fromLatin1("#%1").arg(tab->current+1) + << QString::fromLatin1("%1").arg(tab->finfo.image[tab->current].delay); + + // create dialog and setup it + SQ_ImageProperties prop(this); + prop.setFile(tab->m_File); + prop.setURL(tab->m_original); + prop.setParams(list); + prop.setMetaInfo(meta); + + // show! + prop.exec(); + + // restore animation + if(!manualBlocked()) + startAnimation(); +} + +void SQ_GLWidget::findCloserTiles(int w, int h, std::vector &x, std::vector &y) +{ + static int s = 9; + static int dims[10] = { 2, 4, 8, 16, 32, 64, 128, 256, 512 }; + + int *dd[2] = { &w, &h }; + std::vector *dv[2] = { &x, &y }; + int del; + + for(int ff = 0;ff < 2;ff++) + { + if(*dd[ff] == 1) *dd[ff]=2; + else if((*dd[ff])%2) (*dd[ff])++; + + while((*dd[ff]) >= 512) + { + (*dv[ff]).push_back(512); + (*dd[ff]) -= 512; + } + + for(int i = 0;i < s-1;i++) + if((*dd[ff]) >= dims[i] && (*dd[ff]) < dims[i+1]) + { + del = dims[i] + (dims[i]>>1); + + if((*dd[ff]) <= del) + { + (*dv[ff]).push_back(dims[i]); + (*dd[ff]) -= dims[i]; + } + else + { + (*dv[ff]).push_back(dims[i+1]); + (*dd[ff]) -= dims[i+1]; + } + + i = -1; + } + } +} + +QPair SQ_GLWidget::calcRealDimensions(Parts &p, int y, int x) +{ + int rw = 0, rh = 0; + int toy = y == -1 ? p.tilesy.size() : y; + int tox = x == -1 ? p.tilesx.size() : x; + + std::vector::iterator itEnd = p.tilesx.end(); + + for(std::vector::iterator it = p.tilesx.begin();it != itEnd && tox--;++it) + rw += (*it); + + itEnd = p.tilesy.end(); + + for(std::vector::iterator it = p.tilesy.begin();it != itEnd && toy--;++it) + rh += (*it); + + return QPair(rw, rh); +} + +void SQ_GLWidget::slotShowCodecSettings() +{ + tab->lib = SQ_LibraryHandler::instance()->libraryForFile(tab->m_File); + + if(!tab->lib || tab->lib->config.isEmpty()) // oops ? + { + enableSettingsButton(false); + return; + } + + SQ_CodecSettingsSkeleton skel(this); + + connect(&skel, SIGNAL(apply()), this, SLOT(slotApplyCodecSettings())); + + skel.addSettingsWidget(tab->lib->config); + skel.setCodecInfo(tab->lib->mime, tab->lib->quickinfo); + skel.adjustSize(); + + if(skel.exec(tab->lib->settings) == QDialog::Accepted) + tab->lib->codec->set_settings(tab->lib->settings); +} + +void SQ_GLWidget::slotApplyCodecSettings() +{ + if(tab->lib) + { + // new settings are already set by SQ_CodecSettingsSkeleton + tab->lib->codec->set_settings(tab->lib->settings); + m_original = tab->m_original; + startDecoding(QString(tab->m_File)); + } +} + +void SQ_GLWidget::slotSetCurrentImage(int id) +{ + if(tab->total == 1) + return; + + images->setItemChecked(old_id, false); + tab->current = images->itemParameter(id); + + images->setItemChecked(id, true); + old_id = id; + + updateCurrentFileInfo(); + updateGL(); +} + +void SQ_GLWidget::slotImagesShown() +{ + if(tab->finfo.animated) + { + if(!timer_anim->isActive()) + blocked = false; + else + { + stopAnimation(); + blocked = true; + } + } + + images->setItemChecked(old_id, false); + int id = images->idAt(tab->current); + images->setItemChecked(id, true); + old_id = id; +} + +void SQ_GLWidget::slotShowImages() +{ + images->exec(QCursor::pos()); +} + +void SQ_GLWidget::slotImagesHidden() +{ + if(blocked && tab->finfo.animated) + startAnimation(); +} + +void SQ_GLWidget::slotShowHelp() +{ + SQ_HelpWidget help_w(this); + + help_w.exec(); +} + +void SQ_GLWidget::showExternalTools() +{ + bool v_ogorogde_buzina_a_v_kieve_dzyadka = SQ_ExternalTool::instance()->constPopupMenu()->isEnabled(); + SQ_ExternalTool::instance()->constPopupMenu()->setEnabled(true); + + KFileItemList items; + KFileItem fi(KFileItem::Unknown, KFileItem::Unknown, tab->m_original); + + if(!tab->m_original.isEmpty()) + { + items.append(&fi); + SQ_ExternalTool::instance()->setItems(items); + } + + SQ_ExternalTool::instance()->constPopupMenu()->exec(QCursor::pos()); + SQ_ExternalTool::instance()->constPopupMenu()->setEnabled(v_ogorogde_buzina_a_v_kieve_dzyadka); +} + +// Delete current image (user pressed 'Delete' key). +void SQ_GLWidget::deleteWrapper() +{ + if(tab->m_original.isEmpty()) + return; + +#ifndef KSQUIRREL_PART + KFileItemList list; + KFileItem fi(KFileItem::Unknown, KFileItem::Unknown, tab->m_original); + list.append(&fi); + SQ_WidgetStack::instance()->diroperator()->del(list, this); +#else + SQ_DirOperator::instance()->del(tab->m_original, this); +#endif +} + +void SQ_GLWidget::enableSettingsButton(bool enab) +{ +#ifndef KSQUIRREL_PART + pAToolQuick->setEnabled(enab); +#endif + + menuImage->setItemEnabled(id_settings, enab); +} + +void SQ_GLWidget::saveAs() +{ + if(!tab->lib || tab->finfo.image.empty()) // nothing to save + return; + + SQ_Config::instance()->setGroup("GL view"); + QString lastPath = SQ_Config::instance()->readEntry("saveasPath"); + QString lastFilt = SQ_Config::instance()->readEntry("saveasFilter"); + + if(lastPath.isEmpty()) + { + KURL u = tab->m_original; + u.cd(".."); + lastPath = u.prettyURL(); + } + + SQ_FileDialog d(lastPath, this); + + // set filter: writable codecs without *.* + d.setFilter(SQ_LibraryHandler::instance()->allFiltersFileDialogString(false, false)); + d.setOperationMode(KFileDialog::Saving); + d.setSelection(tab->m_original.fileName()); + d.setCurrentFilter(lastFilt); + d.updateCombo(false); + + if(d.exec() == QDialog::Rejected || d.selectedURL().isEmpty()) + return; + + KURL url = d.selectedURL(); + + // cut off file name + KURL u = url; + u.cd(".."); + SQ_Config::instance()->writeEntry("saveasPath", u.prettyURL()); + SQ_Config::instance()->writeEntry("saveasFilter", d.nameFilter()); + + QString path = url.isLocalFile() ? url.path() : tmp->name(); + + SQ_LIBRARY *wlib = SQ_LibraryHandler::instance()->libraryByName(d.nameFilter()); + + if(!wlib || !wlib->writestatic) + { + KMessageBox::error(this, i18n("Sorry, could not perform write operation\nfor codec \"%1\"").arg(d.nameFilter())); + return; + } + + SQ_GLHelpers::scanLineGetter scgetter; + int flp = 0; + int curangle = SQ_GLHelpers::roundAngle((int)tab->curangle); + + fmt_image im = tab->finfo.image[tab->current]; + +/* + * The easiest way to rotate image is to use QImage + QImage::xForm(), + * but this method is VERY memory inefficient. We will use our own tranformation + * routins... Yes, they will be a little bit slower, but they require only + * one scaline in stack. + */ + + int w = im.w, h = im.h; + int rw = tab->parts[tab->current].realw; + +#ifdef SQ_HAVE_KEXIF + switch(tab->orient) + { + case KExifData::HFLIP: + case KExifData::ROT_90_HFLIP: + flp = 1; + break; + + case KExifData::VFLIP: + case KExifData::ROT_90_VFLIP: + flp = 2; + break; + + default: ; + } +#endif + + switch(curangle) + { + case -270: + case 90: scgetter = SQ_GLHelpers::scanLine90; std::swap(w, h); break; + + case -180: + case 180: scgetter = SQ_GLHelpers::scanLine180; break; + + case -90: + case 270: scgetter = SQ_GLHelpers::scanLine270; std::swap(w, h); break; + + default: scgetter = SQ_GLHelpers::scanLine0; + } + + RGBA scan[w]; + RGBA *data = tab->parts[tab->current].buffer->data(); + + fmt_image im2 = im; + im2.w = w; + im2.h = h; + + fmt_writeoptions opt; + opt.interlaced = false; + opt.alpha = im.hasalpha; + opt.bitdepth = im.bpp; + opt.compression_scheme = (wlib->opt.compression_scheme & CompressionNo) ? CompressionNo : CompressionInternal; + opt.compression_level = wlib->opt.compression_def; + + int err = wlib->codec->write_init(QString(QFile::encodeName(path)), im2, opt); + + if(err != SQE_OK) + { + KMessageBox::error(this, i18n("Error writing image")); + return; + } + + err = wlib->codec->write_next(); + + if(err != SQE_OK) + { + KMessageBox::error(this, i18n("Error writing image")); + return; + } + + wlib->codec->write_next_pass(); + + int H = im2.h; + int Y0 = wlib->opt.needflip ? (-H+1):0; + int Y = wlib->opt.needflip ? 1:H; + int f; + + for(int j = Y0;j < Y;j++) + { + f = (j < 0) ? -j : j; + + scgetter(data, scan, rw, im.w, im.h, f, flp); + + err = wlib->codec->write_scanline(scan); + + if(err != SQE_OK) + { + wlib->codec->write_close(); + KMessageBox::error(this, i18n("Error writing image")); + return; + } + } + + wlib->codec->write_close(); + + // copy to non-local directory + if(!url.isLocalFile()) + { + // src dst perm overwrite resume progress + KIO::Job *j = KIO::file_copy(path, url, -1, true, false, false); + + connect(j, SIGNAL(result(KIO::Job *)), this, SLOT(slotCopyResult(KIO::Job *))); + } +} + +void SQ_GLWidget::slotCopyResult(KIO::Job *job) +{ + if(job->error()) + { + if(KMessageBox::questionYesNoCancel(this, job->errorString() + '\n' + i18n("Try another location?")) == KMessageBox::Yes) + { + SQ_FileDialog d(QString::null, this); + + // set filter: writable codecs without *.* + d.setFilter(SQ_LibraryHandler::instance()->allFiltersFileDialogString(false, false)); + d.setOperationMode(KFileDialog::Saving); + d.updateCombo(false); + + int result = d.exec(); + + if(result == QDialog::Rejected || d.selectedURL().isEmpty()) + return; + + KIO::Job *j = KIO::file_copy(tmp->name(), d.selectedURL(), -1, true, false, false); + connect(j, SIGNAL(result(KIO::Job *)), this, SLOT(slotCopyResult(KIO::Job *))); + } + } +} + +void SQ_GLWidget::toClipboard() +{ + if(!decoded || tab->broken) + return; + + QImage im((uchar *)tab->parts[tab->current].buffer->data(), tab->parts[tab->current].realw, tab->parts[tab->current].realh, 32, 0, 0, QImage::LittleEndian); + + im = im.swapRGB(); + + // image doesn't have extra regions + if(tab->parts[tab->current].realw == tab->parts[tab->current].w && tab->parts[tab->current].realh == tab->parts[tab->current].h) + KApplication::clipboard()->setImage(im, QClipboard::Clipboard); + else + KApplication::clipboard()->setImage(im.copy(0, 0, tab->parts[tab->current].w, tab->parts[tab->current].h), QClipboard::Clipboard); +} + +void SQ_GLWidget::bcg() +{ + if(tab->broken || tab->finfo.image.empty()) return; + + SQ_ImageBCG _bcg(this); + + stopAnimation(); + + _bcg.setPreviewImage(generatePreview()); + + connect(&_bcg, SIGNAL(bcg(SQ_ImageBCGOptions *)), this, SLOT(slotBCG(SQ_ImageBCGOptions *))); + + _bcg.exec(); + + if(!manualBlocked()) + startAnimation(); +} + +void SQ_GLWidget::filter() +{ + if(tab->broken || tab->finfo.image.empty()) return; + + SQ_ImageFilter flt(this); + + stopAnimation(); + + flt.setPreviewImage(generatePreview()); + + connect(&flt, SIGNAL(filter(SQ_ImageFilterOptions *)), this, SLOT(slotFilter(SQ_ImageFilterOptions *))); + + flt.exec(); + + if(!manualBlocked()) + startAnimation(); +} + +void SQ_GLWidget::slotFilter(SQ_ImageFilterOptions *filtopt) +{ + QImage im((uchar *)tab->parts[tab->current].buffer->data(), tab->parts[tab->current].realw, tab->parts[tab->current].realh, 32, 0, 0, QImage::LittleEndian); + QImage img = gls->valid() ? im.copy(tab->sx, tab->sy, tab->sw, tab->sh) : im; + + fmt_filters::image image = + gls->valid() ? fmt_filters::image((unsigned char *)img.bits(), img.width(), img.height()) + : fmt_filters::image((unsigned char *)img.bits(), tab->parts[tab->current].w, tab->parts[tab->current].h, img.width(), img.height()); + + fmt_filters::rgba c = fmt_filters::white; + + switch(filtopt->type) + { + case F::fblend: fmt_filters::blend(image, filtopt->rgb1, filtopt->_float); break; + case F::fblur: fmt_filters::blur(image, filtopt->_double1, filtopt->_double2);break; + case F::fdesaturate: fmt_filters::desaturate(image, filtopt->_float); break; + case F::fdespeckle: fmt_filters::despeckle(image); break; + case F::fedge: fmt_filters::edge(image, filtopt->_double1); break; + case F::femboss: fmt_filters::emboss(image, filtopt->_double1, filtopt->_double2); break; + case F::fequalize: fmt_filters::equalize(image); break; + case F::ffade: fmt_filters::fade(image, filtopt->rgb1, filtopt->_float); break; + case F::fflatten: fmt_filters::flatten(image, filtopt->rgb1, filtopt->rgb2); break; + case F::fimplode: fmt_filters::implode(image, filtopt->_double1, c); break; + case F::fnegative: fmt_filters::negative(image); break; + case F::fnoise: fmt_filters::noise(image, (fmt_filters::NoiseType)filtopt->_uint); break; + case F::foil: fmt_filters::oil(image, filtopt->_double1); break; + case F::fshade: fmt_filters::shade(image, filtopt->_bool, filtopt->_double1, filtopt->_double2); break; + case F::fsharpen: fmt_filters::sharpen(image, filtopt->_double1, filtopt->_double2); break; + case F::fsolarize: fmt_filters::solarize(image, filtopt->_double1); break; + case F::fspread: fmt_filters::spread(image, filtopt->_uint); break; + case F::fswapRGB: fmt_filters::swapRGB(image, filtopt->_uint); break; + case F::fswirl: fmt_filters::swirl(image, filtopt->_double1, c); break; + case F::fthreshold: fmt_filters::threshold(image, filtopt->_uint); break; + case F::fgray: fmt_filters::gray(image); break; + case F::fredeye: fmt_filters::redeye(image, image.w, image.h, 0, 0, filtopt->_uint); break; + } + + if(gls->valid()) bitBlt(&im, tab->sx, tab->sy, &img, 0, 0, img.width(), img.height()); + + editUpdate(); + + SQ_ImageFilter::instance()->setPreviewImage(generatePreview()); +} + +void SQ_GLWidget::slotBCG(SQ_ImageBCGOptions *bcgopt) +{ + QImage im((uchar *)tab->parts[tab->current].buffer->data(), tab->parts[tab->current].realw, tab->parts[tab->current].realh, 32, 0, 0, QImage::LittleEndian); + QImage img = gls->valid() ? im.copy(tab->sx, tab->sy, tab->sw, tab->sh) : im; + + fmt_filters::image image = + gls->valid() ? fmt_filters::image((unsigned char *)img.bits(), img.width(), img.height()) + : fmt_filters::image((unsigned char *)img.bits(), tab->parts[tab->current].w, tab->parts[tab->current].h, img.width(), img.height()); + if(bcgopt->b) + fmt_filters::brightness(image, bcgopt->b); + + if(bcgopt->c) + fmt_filters::contrast(image, bcgopt->c); + + if(bcgopt->g != 100) + fmt_filters::gamma(image, (double)bcgopt->g / 100.0); + + if(bcgopt->red || bcgopt->green || bcgopt->blue) + fmt_filters::colorize(image, bcgopt->red, bcgopt->green, bcgopt->blue); + + if(gls->valid()) bitBlt(&im, tab->sx, tab->sy, &img, 0, 0, img.width(), img.height()); + + editUpdate(); + + SQ_ImageBCG::instance()->setPreviewImage(generatePreview()); +} + +bool SQ_GLWidget::calcSelection() +{ + QSize sz = gls->size(); + QPoint pt = gls->pos(); + + float z = getZoom(); + float x = pt.x(), y = pt.y(), w = sz.width(), h = sz.height(); + x = x - (float)width()/2 - MATRIX_X + (float)tab->parts[tab->current].w/2 * z; + y = y - (float)height()/2 + MATRIX_Y + (float)tab->parts[tab->current].h/2 * z; + + int sx = (int)(x/z + 0.5); + int sy = (int)(y/z + 0.5); + int sw = (int)(w/z + 0.5); + int sh = (int)(h/z + 0.5); + + if(!sw || !sh) + { + gls->end(); + return false; + } + else + { + if(SQ_GLHelpers::normalizeSelection(sx, + sy, + sw, + sh, + tab->parts[tab->current].w, + tab->parts[tab->current].h, + tab->wm, + (int)tab->curangle, + tab->orient)) + { + tab->srect = QRect(pt, sz); + tab->sx = sx; + tab->sy = sy; + tab->sw = sw; + tab->sh = sh; + } + else + return false; + } + + return true; +} + +QImage SQ_GLWidget::generatePreview() +{ + QImage im((uchar *)tab->parts[tab->current].buffer->data(), tab->parts[tab->current].realw, tab->parts[tab->current].realh, 32, 0, 0, QImage::LittleEndian); + QImage img, ret; + + if(gls->valid() && calcSelection()) + img = im.copy(tab->sx, tab->sy, tab->sw, tab->sh); + else + { + if(tab->parts[tab->current].realw == tab->parts[tab->current].w && tab->parts[tab->current].realh == tab->parts[tab->current].h) + img = im; + else + img = im.copy(0, 0, tab->parts[tab->current].w, tab->parts[tab->current].h); + } + + ret = SQ_Utils::scaleImage((unsigned char *)img.bits(), img.width(), img.height(), 160).swapRGB(); + + SQ_Utils::exifRotate(QString::null, ret, tab->orient); + + return ret; +} + +void SQ_GLWidget::editUpdate() +{ + int tlsy = tab->parts[tab->current].tilesy.size(); + + glDeleteLists(tab->parts[tab->current].m_parts[0].list, tlsy); + + for(int i = 0;i < tlsy;i++) + showFrames(i, &tab->parts[tab->current], false); + + updateGL(); +} + +void SQ_GLWidget::slotShowNav() +{ +#ifndef KSQUIRREL_PART + KSquirrel::app()->activate(); +#endif +} + +void SQ_GLWidget::initAccelsAndMenu() +{ + QPopupMenu *menuRotate = new QPopupMenu(menu); + QPopupMenu *menuZoom = new QPopupMenu(menu); + QPopupMenu *menuMove = new QPopupMenu(menu); + +#ifndef KSQUIRREL_PART + QPopupMenu *menuWindow = new QPopupMenu(menu); +#endif + + menuImage = new QPopupMenu(menu); + menuFile = new QPopupMenu(menu); + + menu->insertItem(SQ_IconLoader::instance()->loadIcon("icons", KIcon::Desktop, KIcon::SizeSmall), i18n("File"), menuFile); + menu->insertItem(SQ_IconLoader::instance()->loadIcon("view_orientation", KIcon::Desktop, KIcon::SizeSmall), i18n("Rotate"), menuRotate); + menu->insertItem(SQ_IconLoader::instance()->loadIcon("viewmag", KIcon::Desktop, KIcon::SizeSmall), i18n("Zoom"), menuZoom); + menu->insertItem(i18n("Move"), menuMove); + +#ifndef KSQUIRREL_PART + menu->insertItem(i18n("Window"), menuWindow); +#endif + + menu->insertItem(i18n("Image"), menuImage); + +#define SQ_ADD_KACTION(b) \ + (new KAction(QString::null, b, this, SLOT(slotAccelActivated()), ac, QString::fromLatin1("action_%1").arg(b))) + + id_saveas = menuFile->insertItem(SQ_IconLoader::instance()->loadIcon("filesaveas", KIcon::Desktop, KIcon::SizeSmall), i18n("Save As...") + "\tS", SQ_ADD_KACTION(Qt::Key_S), SLOT(activate())); + +#ifndef KSQUIRREL_PART + menuFile->insertSeparator(); + menuFile->insertItem(QPixmap(locate("data", "images/menu/next16.png")), i18n("Next") + "\tPageDown", SQ_ADD_KACTION(Qt::Key_PageDown), SLOT(activate())); + menuFile->insertItem(QPixmap(locate("data", "images/menu/prev16.png")), i18n("Previous") + "\tPageUp", SQ_ADD_KACTION(Qt::Key_PageUp), SLOT(activate())); + menuFile->insertItem(QPixmap(locate("data", "images/menu/first16.png")), i18n("First") + "\tHome", SQ_ADD_KACTION(Qt::Key_Home), SLOT(activate())); + menuFile->insertItem(QPixmap(locate("data", "images/menu/last16.png")), i18n("Last") + "\tEnd", SQ_ADD_KACTION(Qt::Key_End), SLOT(activate())); +#endif + + menuFile->insertSeparator(); + id_f5 = menuFile->insertItem(i18n("Copy to...") + "\tF5", SQ_ADD_KACTION(Qt::Key_F5), SLOT(activate())); + id_f6 = menuFile->insertItem(i18n("Move to...") + "\tF6", SQ_ADD_KACTION(Qt::Key_F7), SLOT(activate())); + id_f7 = menuFile->insertItem(i18n("Copy to last folder") + "\tF7", SQ_ADD_KACTION(Qt::Key_F6), SLOT(activate())); + id_f8 = menuFile->insertItem(i18n("Move to last folder") + "\tF8", SQ_ADD_KACTION(Qt::Key_F8), SLOT(activate())); + menuFile->insertSeparator(); + id_del = menuFile->insertItem(i18n("Delete") + "\tDelete", SQ_ADD_KACTION(Qt::Key_Delete), SLOT(activate())); + + menuRotate->insertItem(QPixmap(locate("data", "images/menu/rotateLeft16.png")), i18n("Rotate left") + "\tCtrl+Left", SQ_ADD_KACTION(Qt::Key_Left+CTRL), SLOT(activate())); + menuRotate->insertItem(QPixmap(locate("data", "images/menu/rotateRight16.png")), i18n("Rotate right") + "\tCtrl+Right", SQ_ADD_KACTION(Qt::Key_Right+CTRL), SLOT(activate())); + menuRotate->insertSeparator(); + menuRotate->insertItem(QPixmap(locate("data", "images/menu/18016.png")), i18n("Rotate 180'") + "\tCtrl+Up", SQ_ADD_KACTION(Qt::Key_Up+CTRL), SLOT(activate())); + menuRotate->insertSeparator(); + menuRotate->insertItem(i18n("Rotate 1' left") + "\tAlt+Left", SQ_ADD_KACTION(Qt::Key_Left+ALT), SLOT(activate())); + menuRotate->insertItem(i18n("Rotate 1' right") + "\tAlt+Right", SQ_ADD_KACTION(Qt::Key_Right+ALT), SLOT(activate())); + + menuZoom->insertItem(QPixmap(locate("data", "images/menu/zoom+16.png")), i18n("Zoom +") + "\t+", SQ_ADD_KACTION(Qt::Key_Plus), SLOT(activate())); + menuZoom->insertItem(QPixmap(locate("data", "images/menu/zoom-16.png")), i18n("Zoom -") + "\t-", SQ_ADD_KACTION(Qt::Key_Minus), SLOT(activate())); + menuZoom->insertItem(i18n("Zoom 2x") + "\tCtrl++", SQ_ADD_KACTION(Qt::Key_Plus+CTRL), SLOT(activate())); + menuZoom->insertItem(i18n("Zoom 1/2x") + "\tCtrl+-", SQ_ADD_KACTION(Qt::Key_Minus+CTRL), SLOT(activate())); + menuZoom->insertSeparator(); + menuZoom->insertItem(QPixmap(locate("data", "images/menu/zoom10016.png")), QString::fromLatin1("100%") + "\t1", SQ_ADD_KACTION(Qt::Key_1), SLOT(activate())); + menuZoom->insertItem(QPixmap(locate("data", "images/menu/zoom20016.png")), QString::fromLatin1("200%") + "\t2", SQ_ADD_KACTION(Qt::Key_2), SLOT(activate())); + menuZoom->insertItem(QPixmap(locate("data", "images/menu/zoom30016.png")), QString::fromLatin1("300%") + "\t3", SQ_ADD_KACTION(Qt::Key_3), SLOT(activate())); + menuZoom->insertItem(QPixmap(locate("data", "images/menu/zoom50016.png")), QString::fromLatin1("500%") + "\t5", SQ_ADD_KACTION(Qt::Key_5), SLOT(activate())); + menuZoom->insertItem(QPixmap(locate("data", "images/menu/zoom70016.png")), QString::fromLatin1("700%") + "\t7", SQ_ADD_KACTION(Qt::Key_7), SLOT(activate())); + menuZoom->insertItem(QPixmap(locate("data", "images/menu/zoom90016.png")), QString::fromLatin1("900%") + "\t9", SQ_ADD_KACTION(Qt::Key_9), SLOT(activate())); + menuZoom->insertItem(QPixmap(locate("data", "images/menu/zoom100016.png")), QString::fromLatin1("1000%") + "\t0", SQ_ADD_KACTION(Qt::Key_0), SLOT(activate())); + + menuMove->insertItem(QPixmap(locate("data", "images/menu/moveLeft16.png")), i18n("Move left") + "\tRight", SQ_ADD_KACTION(Qt::Key_Right), SLOT(activate())); + menuMove->insertItem(QPixmap(locate("data", "images/menu/moveRight16.png")), i18n("Move right") + "\tLeft", SQ_ADD_KACTION(Qt::Key_Left), SLOT(activate())); + menuMove->insertItem(QPixmap(locate("data", "images/menu/moveUp16.png")), i18n("Move up") + "\tDown", SQ_ADD_KACTION(Qt::Key_Down), SLOT(activate())); + menuMove->insertItem(QPixmap(locate("data", "images/menu/moveDown16.png")), i18n("Move down") + "\tUp", SQ_ADD_KACTION(Qt::Key_Up), SLOT(activate())); + + menuImage->insertItem(QPixmap(locate("data", "images/menu/animate16.png")), i18n("Start/stop animation") + "\tA", SQ_ADD_KACTION(Qt::Key_A), SLOT(activate())); + menuImage->insertItem(QPixmap(locate("data", "images/menu/background16.png")), i18n("Hide/show background") + "\tB", SQ_ADD_KACTION(Qt::Key_B), SLOT(activate())); + menuImage->insertItem(QPixmap(locate("data", "images/menu/tickmarks16.png")), i18n("Hide/show tickmarks") + "\tK", SQ_ADD_KACTION(Qt::Key_K), SLOT(activate())); + menuImage->insertSeparator(); + menuImage->insertItem(QPixmap(locate("data", "images/menu/flipV16.png")), i18n("Flip vertically") + "\tV", SQ_ADD_KACTION(Qt::Key_V), SLOT(activate())); + menuImage->insertItem(QPixmap(locate("data", "images/menu/flipH16.png")), i18n("Flip horizontally") + "\tH", SQ_ADD_KACTION(Qt::Key_H), SLOT(activate())); + menuImage->insertSeparator(); + menuImage->insertItem(QPixmap(locate("data", "images/menu/page116.png")), i18n("First page") + "\tF1", SQ_ADD_KACTION(Qt::Key_F1), SLOT(activate())); + menuImage->insertItem(QPixmap(locate("data", "images/menu/page216.png")), i18n("Previous page") + "\tF2", SQ_ADD_KACTION(Qt::Key_F2), SLOT(activate())); + menuImage->insertItem(QPixmap(locate("data", "images/menu/page316.png")), i18n("Next page") + "\tF3", SQ_ADD_KACTION(Qt::Key_F3), SLOT(activate())); + menuImage->insertItem(QPixmap(locate("data", "images/menu/page416.png")), i18n("Last page") + "\tF4", SQ_ADD_KACTION(Qt::Key_F4), SLOT(activate())); + menuImage->insertSeparator(); + menuImage->insertItem(i18n("Copy file url") + "\tF9", SQ_ADD_KACTION(Qt::Key_F9), SLOT(activate())); + menuImage->insertItem(i18n("To clipboard") + "\tQ", SQ_ADD_KACTION(Qt::Key_Q), SLOT(activate())); + menuImage->insertItem(i18n("Print") + "\tCtrl+P", SQ_ADD_KACTION(Qt::Key_P+CTRL), SLOT(activate())); + menuImage->insertSeparator(); + id_settings = menuImage->insertItem(SQ_IconLoader::instance()->loadIcon("configure", KIcon::Desktop, KIcon::SizeSmall), i18n("Codec settings") + "\tC", SQ_ADD_KACTION(Qt::Key_C), SLOT(activate())); + menuImage->setItemEnabled(id_settings, false); + menuImage->insertSeparator(); + menuImage->insertItem(i18n("Color balance...") + "\tD", SQ_ADD_KACTION(Qt::Key_D), SLOT(activate())); + menuImage->insertItem(i18n("Apply filter...") + "\tU", SQ_ADD_KACTION(Qt::Key_U), SLOT(activate())); + + menuImage->insertItem(i18n("Crop") + "\tY", SQ_ADD_KACTION(Qt::Key_Y), SLOT(activate())); + +#ifndef KSQUIRREL_PART + menuWindow->insertItem(QPixmap(locate("data", "images/menu/fullscreen16.png")), i18n("Fullscreen") + "\tF", SQ_ADD_KACTION(Qt::Key_F), SLOT(activate())); + menuWindow->insertSeparator(); + menuWindow->insertItem(i18n("Previous tab") + "\tShift+Left", SQ_ADD_KACTION(Qt::Key_Left+SHIFT), SLOT(activate())); + menuWindow->insertItem(i18n("Next tab") + "\tShift+Right", SQ_ADD_KACTION(Qt::Key_Right+SHIFT), SLOT(activate())); + menuWindow->insertSeparator(); + menuWindow->insertItem(i18n("Close tab") + "\tW", SQ_ADD_KACTION(Qt::Key_W), SLOT(activate())); + + menuWindow->insertItem(i18n("Close all tabs") + "\tCtrl+W", SQ_ADD_KACTION(Qt::Key_W+CTRL), SLOT(activate())); +#endif + + menu->insertSeparator(); + menu->insertItem(QPixmap(locate("data", "images/menu/reset16.png")), i18n("Reset") + "\tR", SQ_ADD_KACTION(Qt::Key_R), SLOT(activate())); + id_prop = menu->insertItem(QPixmap(locate("data", "images/menu/prop16.png")), i18n("Properties") + "\tP", SQ_ADD_KACTION(Qt::Key_P), SLOT(activate())); + menu->insertSeparator(); + menu->insertItem(i18n("Hotkeys") + "\t/", SQ_ADD_KACTION(Qt::Key_Slash), SLOT(activate())); + +#ifndef KSQUIRREL_PART + menu->insertSeparator(); + menu->insertItem(QPixmap(locate("data", "images/menu/close16.png")), i18n("Close") + "\tX", SQ_ADD_KACTION(Qt::Key_X), SLOT(activate())); +#endif + + SQ_ADD_KACTION(Qt::Key_Down+CTRL); + SQ_ADD_KACTION(Qt::Key_Equal); + SQ_ADD_KACTION(Qt::Key_Equal+CTRL); + SQ_ADD_KACTION(Qt::Key_N); + SQ_ADD_KACTION(Qt::Key_Space); + SQ_ADD_KACTION(Qt::Key_BackSpace); + SQ_ADD_KACTION(Qt::Key_Escape); + SQ_ADD_KACTION(Qt::Key_Return); + SQ_ADD_KACTION(Qt::Key_Enter); + SQ_ADD_KACTION(Qt::Key_Z); + SQ_ADD_KACTION(Qt::Key_I); + SQ_ADD_KACTION(Qt::Key_E); + +#ifndef KSQUIRREL_PART + SQ_ADD_KACTION(Qt::Key_R+CTRL); + SQ_ADD_KACTION(Qt::Key_E+CTRL); + SQ_ADD_KACTION(Qt::Key_C+CTRL); +#endif + + SQ_ADD_KACTION(Qt::Key_Menu); + SQ_ADD_KACTION(Qt::Key_M); + SQ_ADD_KACTION(Qt::Key_4); + SQ_ADD_KACTION(Qt::Key_6); + SQ_ADD_KACTION(Qt::Key_8); + SQ_ADD_KACTION(Qt::Key_Comma); + SQ_ADD_KACTION(Qt::Key_Period); + SQ_ADD_KACTION(Qt::Key_Asterisk); + SQ_ADD_KACTION(Qt::Key_L); +} + + +void SQ_GLWidget::slotAccelActivated() +{ + KAction *accel = static_cast(const_cast(sender())); + + KShortcut ks = accel->shortcut(); + + if(!ks.compare(Qt::Key_Left)) matrix_move(movefactor, 0); + else if(!ks.compare(Qt::Key_Right)) matrix_move(-movefactor, 0); + else if(!ks.compare(Qt::Key_Up)) matrix_move(0, -movefactor); + else if(!ks.compare(Qt::Key_Down)) matrix_move(0, movefactor); + else if(!ks.compare(Qt::Key_Equal) || + !ks.compare(Qt::Key_Plus)) slotZoomPlus(); + else if(!ks.compare(Qt::Key_Minus)) slotZoomMinus(); + else if(!ks.compare(Qt::Key_Equal+CTRL) || + !ks.compare(Qt::Key_Plus+CTRL)) matrix_zoom(2.0f); + else if(!ks.compare(Qt::Key_Minus+CTRL)) matrix_zoom(0.5f); + else if(!ks.compare(Qt::Key_Q)) toClipboard(); + else if(!ks.compare(Qt::Key_V)) slotFlipV(); + else if(!ks.compare(Qt::Key_H)) slotFlipH(); + else if(!ks.compare(Qt::Key_Left+CTRL)) slotRotateLeft(); + else if(!ks.compare(Qt::Key_Right+CTRL)) slotRotateRight(); + else if(!ks.compare(Qt::Key_R)) slotMatrixReset(); + else if(!ks.compare(Qt::Key_Up+CTRL)) matrix_rotate(180.0f); + else if(!ks.compare(Qt::Key_Down+CTRL)) matrix_rotate(-180.0f); + else if(!ks.compare(Qt::Key_Left+ALT)) matrix_rotate(-1.0f); + else if(!ks.compare(Qt::Key_Right+ALT)) matrix_rotate(1.0f); + +#ifndef KSQUIRREL_PART + else if(!ks.compare(Qt::Key_Left+SHIFT)) SQ_GLView::window()->leftTab(); + else if(!ks.compare(Qt::Key_Right+SHIFT)) SQ_GLView::window()->rightTab(); + else if(!ks.compare(Qt::Key_W)) slotCloseRequest(SQ_GLView::window()->tabbar()->indexOf(SQ_GLView::window()->tabbar()->currentTab())); + else if(!ks.compare(Qt::Key_W+CTRL)) closeAllTabsFull(); +#else + else if(!ks.compare(Qt::Key_W)) closeAllTabsFull(); +#endif + + else if(!ks.compare(Qt::Key_N)) updateFilter(!linear); + else if(!ks.compare(Qt::Key_P)) slotProperties(); + else if(!ks.compare(Qt::Key_C)) slotShowCodecSettings(); + +#ifndef KSQUIRREL_PART + else if(!ks.compare(Qt::Key_PageDown) || + !ks.compare(Qt::Key_Space)) slotNext(); + else if(!ks.compare(Qt::Key_PageUp) || + !ks.compare(Qt::Key_BackSpace)) slotPrev(); + else if(!ks.compare(Qt::Key_X) || + !ks.compare(Qt::Key_Escape) || + !ks.compare(Qt::Key_Return) || + !ks.compare(Qt::Key_Enter)) KSquirrel::app()->closeGLWidget(); + else if(!ks.compare(Qt::Key_Home)) slotFirst(); + else if(!ks.compare(Qt::Key_End)) slotLast(); + else if(!ks.compare(Qt::Key_F)) toggleFullScreen(); +#endif + + else if(!ks.compare(Qt::Key_Z)) slotZoomMenu(); + else if(!ks.compare(Qt::Key_S)) saveAs(); + else if(!ks.compare(Qt::Key_A)) slotToggleAnimate(); + else if(!ks.compare(Qt::Key_I)) slotShowImages(); + else if(!ks.compare(Qt::Key_F1)) jumpToImage(false); + else if(!ks.compare(Qt::Key_F2)) prevImage(); + else if(!ks.compare(Qt::Key_F3)) nextImage(); + else if(!ks.compare(Qt::Key_F4)) jumpToImage(true); + else if(!ks.compare(Qt::Key_F5) || !ks.compare(Qt::Key_F6)) + { + // select a directory + KURL url = KFileDialog::getExistingURL(lastCopy.prettyURL(), this); + + if(url.isEmpty()) + return; + + lastCopy = url; + KIO::Job *job; + + if(!ks.compare(Qt::Key_F5)) + job = KIO::copy(tab->m_original, url); + else + job = KIO::move(tab->m_original, url); + + job->setWindow(this); + connect(job, SIGNAL(result(KIO::Job *)), this, SLOT(slotCopyJobResult(KIO::Job *))); + } + else if(!ks.compare(Qt::Key_F7) || !ks.compare(Qt::Key_F8)) + { + KIO::Job *job; + + if(!ks.compare(Qt::Key_F6)) + job = KIO::copy(tab->m_original, lastCopy); + else + job = KIO::move(tab->m_original, lastCopy); + + job->setWindow(this); + connect(job, SIGNAL(result(KIO::Job *)), this, SLOT(slotCopyJobResult(KIO::Job *))); + } + else if(!ks.compare(Qt::Key_F9)) copyURL(); + else if(!ks.compare(Qt::Key_Slash)) slotShowHelp(); + else if(!ks.compare(Qt::Key_B)) toggleDrawingBackground(); + else if(!ks.compare(Qt::Key_K)) toogleTickmarks(); + else if(!ks.compare(Qt::Key_E)) showExternalTools(); + else if(!ks.compare(Qt::Key_Delete)) deleteWrapper(); + else if(!ks.compare(Qt::Key_D)) bcg(); + else if(!ks.compare(Qt::Key_U)) filter(); + else if(!ks.compare(Qt::Key_Y)) crop(); + +#ifndef KSQUIRREL_PART + else if(!ks.compare(Qt::Key_R+CTRL)) slotSelectionRect(); + else if(!ks.compare(Qt::Key_E+CTRL)) slotSelectionEllipse(); + else if(!ks.compare(Qt::Key_C+CTRL)) slotSelectionClear(); +#endif + + else if(!ks.compare(Qt::Key_P+CTRL)) slotPrint(); + else if(!ks.compare(Qt::Key_Menu) || + !ks.compare(Qt::Key_M)) menu->exec(QCursor::pos()); + else if(!ks.compare(Qt::Key_Comma)) slotZoomW(); + else if(!ks.compare(Qt::Key_Period)) slotZoomH(); + else if(!ks.compare(Qt::Key_Asterisk)) slotZoomWH(); + else if(!ks.compare(Qt::Key_L)) + { + bool b = pAIfLess->isChecked(); + pAIfLess->setChecked(!b); + slotZoomIfLess(); + } + else + { + int val = -1; + + if(!ks.compare(Qt::Key_1)) val = 1; + else if(!ks.compare(Qt::Key_2)) val = 2; + else if(!ks.compare(Qt::Key_3)) val = 3; + else if(!ks.compare(Qt::Key_4)) val = 4; + else if(!ks.compare(Qt::Key_5)) val = 5; + else if(!ks.compare(Qt::Key_6)) val = 6; + else if(!ks.compare(Qt::Key_7)) val = 7; + else if(!ks.compare(Qt::Key_8)) val = 8; + else if(!ks.compare(Qt::Key_9)) val = 9; + else if(!ks.compare(Qt::Key_0)) val = 10; + + if(val != -1) + { + if(tab->broken || tab->finfo.image.empty()) + return; + + zoom(val); + } + } +} + +void SQ_GLWidget::zoom(GLfloat val) +{ + oldZoom = getZoom(); + matrix_reset(false); + matrix_zoom(val); +} + +void SQ_GLWidget::slotCopyJobResult(KIO::Job *job) +{ + if(job->error()) + job->showErrorDialog(this); +} + +void SQ_GLWidget::exifRotate(bool U) +{ +#ifdef SQ_HAVE_KEXIF + switch(tab->orient) + { + // flipping + case KExifData::HFLIP: tab->isflippedH = !tab->isflippedH; flip(0, U); break; + case KExifData::VFLIP: tab->isflippedV = !tab->isflippedV; flip(4, U); break; + + // rotating + case KExifData::ROT_90: matrix_rotate(90, U); break; + case KExifData::ROT_180: matrix_rotate(180, U); break; + case KExifData::ROT_270: matrix_rotate(270, U); break; + + // flipping & rotating + case KExifData::ROT_90_HFLIP: tab->isflippedH = !tab->isflippedH; flip(0, false); matrix_rotate(90, U); break; + case KExifData::ROT_90_VFLIP: tab->isflippedV = !tab->isflippedV; flip(4, false); matrix_rotate(90, U); break; + + // normal rotation or unspecified + default: if(U) updateGL(); + } +#else + if(U) + updateGL(); +#endif +} + +void SQ_GLWidget::enableActions(bool U) +{ +#ifndef KSQUIRREL_PART + pASelectionRect->setEnabled(U); + pASelectionEllipse->setEnabled(U); + pASelectionClear->setEnabled(U); + pAToolProp->setEnabled(U); + pAToolPrint->setEnabled(U); +#endif + + menuFile->setItemEnabled(id_f5, U); + menuFile->setItemEnabled(id_f6, U); + menuFile->setItemEnabled(id_f7, U); + menuFile->setItemEnabled(id_f8, U); + menuFile->setItemEnabled(id_del, U); + menuFile->setItemEnabled(id_saveas, U); + + menu->setItemEnabled(id_prop, U); + + menuImage->setEnabled(U); +} + +void SQ_GLWidget::crop() +{ + if(tab->broken + || tab->finfo.image.empty() + || !gls->valid() + || !calcSelection() + || (tab->sw == tab->parts[tab->current].w && tab->sh == tab->parts[tab->current].h)) + return; + + const int RW = tab->parts[tab->current].realw; + RGBA *img = tab->parts[tab->current].buffer->data() + tab->sy * RW + tab->sx; + + Parts pp; + memoryPart *pt; + + SQ_GLWidget::findCloserTiles(tab->sw, tab->sh, pp.tilesx, pp.tilesy); + QPair pair = SQ_GLWidget::calcRealDimensions(pp); + pp.realw = pair.first; + pp.realh = pair.second; + pp.w = tab->sw; + pp.h = tab->sh; + + if(!pp.makeParts()) + { + KMessageBox::error(this, + i18n("Memory allocation failed for %1 of memory") + .arg(KIO::convertSize(pp.realw * pp.realh * sizeof(RGBA)))); + return; + } + + pt = new memoryPart(pp.realw * pp.realh); + pt->create(); + + if(!pt->valid()) + { + pp.removeParts(); + return; + } + + memset(pt->data(), 0, pp.realw * pp.realh * sizeof(RGBA)); + + for(int i = 0;i < tab->sh;i++) + memcpy(pt->data()+i*pp.realw, img + i*RW, tab->sw * sizeof(RGBA)); + + pp.computeCoords(); + pp.buffer = pt; + + tab->parts[tab->current].removeParts(); + tab->parts[tab->current].deleteBuffer(); + tab->finfo.image[tab->current].w = tab->sw; + tab->finfo.image[tab->current].h = tab->sh; + + int tlsy = pp.tilesy.size(); + for(int i = 0;i < tlsy;i++) + showFrames(i, &pp, false); + + tab->parts[tab->current] = pp; + + slotSelectionClear(); + updateCurrentFileInfo(); + tab->isflippedH = tab->isflippedV = false; + slotZoomIfLess(); + matrixChanged(); +} + +void SQ_GLWidget::slotChangeTab(int id) +{ +#ifndef KSQUIRREL_PART + id = SQ_GLView::window()->tabbar()->indexOf(id); + + Tab *newtab = (id == -1) ? &taborig : &tabs[id]; + + if(tab == newtab) + return; + + if(tab) + { + tab->removeParts(); + gls->setVisible(false); + } + + tab = newtab; + + images->clear(); + old_id = -1; + stopAnimation(); + + enableSettingsButton(id != -1 && tab->lib && !tab->lib->config.isEmpty()); + enableActions(!tab->broken && id != -1); + + if(id == -1) + { + SQ_GLView::window()->resetStatusBar(); + KSquirrel::app()->setCaption(QString::null); + decoded = false; + changeSlider(1.0); + } + else + { + changeSlider(); + KSquirrel::app()->setCaption(originalURL()); + enableActions(!tab->broken); + + if(!tab->broken) + { + SQ_GLView::window()->sbarWidget("SBDecodedI")->setPixmap(tab->lib->mime); + + // fill menu + std::vector::iterator itEnd = tab->finfo.image.end(); + std::vector::iterator it = tab->finfo.image.begin(); + int mid, i = 0, first_id = 0; + + for(;it != itEnd;++it, ++i) + { + mid = images->insertItem(QString::fromLatin1("#%1 [%2x%3@%4]").arg(i+1).arg((*it).w).arg((*it).h).arg((*it).bpp)); + images->setItemParameter(mid, i); + + if(i == tab->current) + old_id = first_id = mid; + } + + images->setItemChecked(first_id, true); + updateCurrentFileInfo(); + frameChanged(); + +#ifndef KSQUIRREL_PART + SQ_GLView::window()->sbarWidget("SBFile")->setText(tab->m_original.fileName(false)); + SQ_GLView::window()->sbarWidget("SBLoaded")->setText(KGlobal::locale()->formatLong(tab->elapsed) + i18n(" ms.")); +#else + t_glv.sbarWidget("SBFile")->setText(tab->m_original.fileName(false)); + t_glv.sbarWidget("SBLoaded")->setText(KGlobal::locale()->formatLong(tab->elapsed) + i18n(" ms.")); +#endif + } + else + SQ_GLView::window()->resetStatusBar(); + + std::vector::iterator itp = tab->parts.begin(); + std::vector::iterator itpEnd = tab->parts.end(); + int tlsy; + + tab->remakeParts(); + + if(tab->glselection != -1) + { + if(!gls->valid()) + gls->begin(static_cast(tab->glselection), 0, 0, false); + + gls->setGeometry(tab->srect); + } + else + gls->end(); + + gls->setVisible(tab->glselection != -1); + + for(;itp != itpEnd;++itp) + { + tlsy = (*itp).tilesy.size(); + + for(int i = 0;i < tlsy;i++) + showFrames(i, &(*itp), false); + } + + if(!manualBlocked()) + startAnimation(); + } + + matrixChanged(); + updateGL(); +#endif +} + +void SQ_GLWidget::slotCloseRequest(int index) +{ +#ifndef KSQUIRREL_PART + if(index < 0) + return; + + SQ_GLView::window()->tabbar()->blockSignals(true); + + // prevent matrix from changing. When tab count == 1, + // SQ_GLView will hide tabbar and SQ_GLWIdget will be resized. + // We don't want it. + if(SQ_GLView::window()->tabbar()->count() == 2) + hackResizeGL = true; + + SQ_GLView::window()->removePage(index); + emit tabCountChanged(); + SQ_GLView::window()->tabbar()->blockSignals(false); + + // workaround bug in KTabBar + QMouseEvent ev(QEvent::MouseMove, + QCursor::pos(), + SQ_GLView::window()->tabbar()->mapFromGlobal(QCursor::pos()), + Qt::NoButton, + Qt::NoButton); + + KApplication::sendEvent(SQ_GLView::window()->tabbar(), &ev); + + std::vector::iterator itEnd = tabs.end(); + std::vector::iterator it = tabs.begin(); + int i = 0; + + for(;(it != itEnd && i != index);++it, ++i) + ; + + (*it).clearParts(); + tabs.erase(it); + tab = 0; + + gls->setVisible(false); + + slotChangeTab(SQ_GLView::window()->tabbar()->currentTab()); +#endif +} + +void SQ_GLWidget::initBrokenImage() +{ + memoryPart *pt; + QImage broken = QPixmap(file_broken_xpm).convertToImage().swapRGB(); + broken.setAlphaBuffer(true); + + parts_broken = new Parts; + + // setup parts_broken. It will have only one 64x64 tile + parts_broken->tilesx.push_back(broken.width()); + parts_broken->tilesy.push_back(broken.height()); + parts_broken->realw = broken.width(); + parts_broken->realh = broken.height(); + parts_broken->w = broken.width(); + parts_broken->h = broken.height(); + parts_broken->makeParts(); + parts_broken->computeCoords(); + + pt = new memoryPart(broken.width() * broken.width()); + pt->create(); + + memcpy(pt->data(), broken.bits(), broken.numBytes()); + + parts_broken->buffer = pt; + + showFrames(0, parts_broken, false); + + image_broken.w = parts_broken->w; + image_broken.h = parts_broken->h; + image_broken.bpp = broken.depth(); + image_broken.compression = "-"; + image_broken.colorspace = "RGBA"; + image_broken.hasalpha = false; + + // we don't need memory buffer any more... + parts_broken->deleteBuffer(); +} + +// Accept drop events. +void SQ_GLWidget::dropEvent(QDropEvent *e) +{ + QStringList files; + + if(QUriDrag::decodeLocalFiles(e, files)) + { + // go through array and find first supported image format + for(QStringList::iterator it = files.begin();it != files.end();++it) + { + if(SQ_LibraryHandler::instance()->libraryForFile(*it)) + { + KURL u = KURL::fromPathOrURL(*it); + m_expected = u; + m_original = u; + startDecoding(u); + break; + } + } + } +} + +// Accept drag events. +void SQ_GLWidget::dragEnterEvent(QDragEnterEvent *e) +{ + e->accept(QUriDrag::canDecode(e)); +} + +/* + * Set clear color for context. + */ +void SQ_GLWidget::setClearColor() +{ + QColor color; + QString path; + + SQ_Config::instance()->setGroup("GL view"); + + switch(SQ_Config::instance()->readNumEntry("GL view background type", 1)) + { + // system color + case 0: + color = colorGroup().color(QColorGroup::Base); + break; + + // custom color + case 1: + color.setNamedColor(SQ_Config::instance()->readEntry("GL view background", "#4e4e4e")); + break; + + // repeated texture + case 2: + path = SQ_Config::instance()->readEntry("GL view custom texture", ""); + BGpixmap.load(path); + + if(BGpixmap.isNull()) + { + SQ_Config::instance()->writeEntry("GL view background type", 0); + setClearColor(); + return; + } + + BGpixmap.convertDepth(32); + BGpixmap = BGpixmap.swapRGB(); + + changed = true; + break; + + default: ; + } + + // update clear color + qglClearColor(color); + + if(decoded) + updateGL(); +} + +void SQ_GLWidget::removeCurrentParts() +{ + // if tab->broken, 'tab->parts' has no members + if(decoded && !tab->broken) + { + std::vector::iterator itEnd = tab->parts.end(); + + for(std::vector::iterator it = tab->parts.begin();it != itEnd;++it) + { + // delete textures and memory buffers + (*it).removeParts(); + (*it).deleteBuffer(); + } + + tab->parts.clear(); + } +} + +void SQ_GLWidget::removeCurrentTabs() +{ + std::vector::iterator itEnd = tabs.end(); + + for(std::vector::iterator it = tabs.begin();it != itEnd;++it) + (*it).clearParts(); + + tabs.clear(); + tab = &taborig; +} + +void SQ_GLWidget::removeNonCurrentTabs(int index) +{ + std::vector::iterator itEnd = tabs.end(); + Tab tm; + int i = 0; + + for(std::vector::iterator it = tabs.begin();it != itEnd;++it, ++i) + { + if(i == index) + { + tm = *it; + continue; + } + + (*it).clearParts(); + } + + tabs.clear(); + tabs.push_back(tm); + tab = &tabs[0]; +} + +void SQ_GLWidget::startDecoding(const KURL &url) +{ + startDecoding(url.path()); +} + +// Show/hide background for transparent image. +void SQ_GLWidget::toggleDrawingBackground() +{ + SQ_Config::instance()->setGroup("GL view"); + + bool b = SQ_Config::instance()->readBoolEntry("alpha_bkgr", true); + + b = !b; + + SQ_Config::instance()->writeEntry("alpha_bkgr", b); + + updateGL(); +} + +void SQ_GLWidget::createMarks() +{ + mm[0] = QImage(locate("data", "images/marks/mark_1.png")); + mm[1] = QImage(locate("data", "images/marks/mark_2.png")); + mm[2] = QImage(locate("data", "images/marks/mark_3.png")); + mm[3] = QImage(locate("data", "images/marks/mark_4.png")); + + marks = (mm[0].isNull() || mm[1].isNull() || mm[2].isNull() || mm[3].isNull()) ? false : true; + + if(!marks) + return; + + for(int i = 0;i < 4;i++) + { + mm[i] = mm[i].convertDepth(32); + mm[i].setAlphaBuffer(true); + } +} + +/* + * Show current image's width, height and bpp in statusbar. + */ +void SQ_GLWidget::updateCurrentFileInfo() +{ + QString status = QString::fromLatin1("%1x%2@%3") + .arg(tab->finfo.image[tab->current].w) + .arg(tab->finfo.image[tab->current].h) + .arg(tab->finfo.image[tab->current].bpp); + +#ifndef KSQUIRREL_PART + SQ_GLView::window()->sbarWidget("SBDecoded")->setText(status); +#else + t_glv.sbarWidget("SBDecoded")->setText(status); +#endif +} + +// Show/hide tickmarks around the image. +void SQ_GLWidget::toogleTickmarks() +{ + SQ_Config::instance()->setGroup("GL view"); + + bool b = SQ_Config::instance()->readBoolEntry("marks", true); + + b = !b; + + SQ_Config::instance()->writeEntry("marks", b); + + updateGL(); +} + +void SQ_GLWidget::changeSlider(GLfloat z1) +{ +#ifndef KSQUIRREL_PART + GLfloat z = z1 < 0 ? getZoom() : z1; + + int i_zoom = (int)(z * 100); + + slider_zoom->blockSignals(true); + slider_zoom->setValue((i_zoom <= 100) ? i_zoom/5 : (19+i_zoom/50)); + slider_zoom->blockSignals(false); +#endif +} + +void SQ_GLWidget::calcFrameLabelWidth() +{ +#ifndef KSQUIRREL_PART + SQ_GLView::window()->sbarWidget("SBFrame")->setFixedWidth( + SQ_GLView::window()->sbarWidget("SBFrame")->fontMetrics() + .boundingRect(QString::fromLatin1("0%1/0%2").arg(tab->total).arg(tab->total)).width()); +#endif +} + +/* + * Show current page number in multipaged images. + * + * For example: "3/11" means that current page is the third in current image, + * which has 11 pages. + */ +void SQ_GLWidget::frameChanged() +{ +#ifndef KSQUIRREL_PART + SQ_GLView::window()->sbarWidget("SBFrame")->setText(QString::fromLatin1("%1/%2").arg(tab->current+1).arg(tab->total)); +#else + t_glv.sbarWidget("SBFrame")->setText(QString::fromLatin1("%1/%2").arg(tab->current+1).arg(tab->total)); +#endif +} + +void SQ_GLWidget::closeAllTabs() +{ + removeCurrentTabs(); + +#ifndef KSQUIRREL_PART + SQ_GLView::window()->removeTabs(); +#endif +} + +void SQ_GLWidget::closeAllTabsFull() +{ + stopAnimation(); + + closeAllTabs(); + +#ifndef KSQUIRREL_PART + SQ_GLView::window()->resetStatusBar(); + SQ_GLView::window()->tabbar()->hide(); + + KSquirrel::app()->setCaption(QString::null); +#endif + + decoded = false; + m_original = KURL(); + m_expected = KURL(); + + images->clear(); + old_id = -1; + + enableSettingsButton(false); + enableActions(false); + changeSlider(1.0); + + updateGL(); +} + +void SQ_GLWidget::slotPrint() +{ + if(!decoded || tab->broken) + return; + + QImage im((uchar *)tab->parts[tab->current].buffer->data(), tab->parts[tab->current].realw, tab->parts[tab->current].realh, 32, 0, 0, QImage::LittleEndian); + QImage img; + + if(gls->valid() && calcSelection()) + img = im.copy(tab->sx, tab->sy, tab->sw, tab->sh).swapRGB(); + else + { + if(tab->parts[tab->current].realw == tab->parts[tab->current].w && tab->parts[tab->current].realh == tab->parts[tab->current].h) + img = im.swapRGB(); + else + img = im.copy(0, 0, tab->parts[tab->current].w, tab->parts[tab->current].h).swapRGB(); + } + + img.setAlphaBuffer(true); + + KPrinter printer; + + printer.setCreator("KSquirrel"); + + if(printer.setup(this)) + { + QPainter p(&printer); + + QPaintDeviceMetrics mt(&printer); + + QSize sz(img.width(), img.height()); + + if(img.width() > mt.width() || img.height() > mt.height()) + sz.scale(mt.width(), mt.height(), QSize::ScaleMin); + + int cp = printer.numCopies(); + + for(int i = 0;i < cp;i++) + { + p.drawImage(QRect((mt.width()-sz.width())/2, (mt.height()-sz.height())/2, sz.width(), sz.height()), img); + + if(i < cp-1) + printer.newPage(); + } + } +} + +void SQ_GLWidget::copyURL() +{ + if(!decoded || tab->broken) + return; + + QApplication::clipboard()->setText(tab->m_original.prettyURL()); +} diff --git a/ksquirrel/sq_helpwidget.ui b/ksquirrel/sq_helpwidget.ui new file mode 100644 index 0000000..8f92708 --- /dev/null +++ b/ksquirrel/sq_helpwidget.ui @@ -0,0 +1,334 @@ + +SQ_HelpWidget + + + SQ_HelpWidget + + + + 0 + 0 + 512 + 430 + + + + + 3 + 3 + 0 + 0 + + + + Hotkeys + + + false + + + + unnamed + + + 0 + + + + widgetStack1 + + + + WStackPage + + + 0 + + + + unnamed + + + + textLabel2 + + + <p align=center><table><tr><td><b><p align=right>Esc,X,Return</p></b></td><td>close</td></tr><tr><td><b><p align=right>Middle click, F</p></b></td><td>fullscreen</td></tr><tr><td><b><p align=right>Z</p></b></td><td>show 'Zoom' menu</td></tr><tr><td><b><p align=right>/</p></b></td><td>show this help</td></tr><tr><td><b><p align=right>Right click, M, ContextMenu</p></b></td><td>show context menu</td></tr><tr><td><b><p align=right>N</p></b></td><td>toggle filter</td></tr><tr><td><b><p align=right>Shift + Left button</p></b></td><td>select a region</td></tr><tr><td><b><p align=right>Shift + Left</p></b></td><td>previous tab</td></tr><tr><td><b><p align=right>Shift + Right</p></b></td><td>next tab</td></tr><tr><td><b><p align=right>W</p></b></td><td>close tab</td></tr></table></p> + + + WordBreak|AlignTop + + + + + + + WStackPage + + + 1 + + + + unnamed + + + + textLabel3 + + + <p align=center><table><tr><td><b><p align=right>Space, Page Down</p></b></td><td>next image</td></tr><tr><td><b><p align=right>Backspace, Page Up</p></b></td><td>previous image</td></tr><tr><td><b><p align=right>Home</p></b></td><td>first image</td></tr><tr><td><b><p align=right>End</p></b></td><td>last image</td></tr></table></p> + + + WordBreak|AlignTop + + + + + + + WStackPage + + + 2 + + + + unnamed + + + + textLabel4 + + + <p align=center><table><tr><td><b><p align=right>Left, Right, Up, Down</p></b></td><td>move the image</td></tr><tr><td><b><p align=right>Ctrl + Left</p></b></td><td>rotate left</td></tr><tr><td><b><p align=right>Ctrl + Right</p></b></td><td>rotate right</td></tr><tr><td><b><p align=right>Ctrl + Up/Down</p></b></td><td>rotate for 180 degrees up/down</td></tr><tr><td><b><p align=right>Alt + Left/Right</p></b></td><td>rotate for 1 degree left/right</td></tr></table</p> + + + WordBreak|AlignTop + + + + + + + WStackPage + + + 3 + + + + unnamed + + + + textLabel6 + + + <p align=center><table><tr><td><b><p align=right>+/-</p></b></td><td>zoom Nx</td></tr><tr><td><b><p align=right>Ctrl + +/-</p></b></td><td>zoom 2x/0.5x</td></tr><tr><td><b><p align=right>Scroll</p></b></td><td>load next/prev file OR zoom+/zoom-</td></tr><tr><td><b><p align=right>Shift + Scroll</p></b></td><td>zoom+/zoom-</td></tr><tr><td><b><p align=right>Ctrl + Scroll</p></b></td><td>zoom+ 2x/zoom- 2x</td></tr><tr><td><b><p align=right>1..9</p></b></td><td>zoom 1..9x</td></tr><tr><td><b><p align=right>0</p></b></td><td>zoom 10x</td></tr><tr><td><b><p align=right>comma</p></b></td><td>fit width</td></tr><tr><td><b><p align=right>period</p></b></td><td>fit height</td></tr><tr><td><b><p align=right>*</p></b></td><td>fit image</td></tr></table</p> + + + WordBreak|AlignTop + + + + + + + WStackPage + + + 4 + + + + unnamed + + + 0 + + + + textLabel5 + + + <p align=center><table><tr><td><p align=right><b>S</b></p></td><td>save as</td></tr><tr><td><p align=right><b>V</b></p></td><td>flip vertically</td></tr><tr><td><p align=right><b>H</b></p></td><td>flip horizontally</td></tr><tr><td><p align=right><b>R</b></p></td><td>reset</td></tr><tr><td><p align=right><b>P</b></p></td><td>image properties</td></tr><tr><td><p align=right><b>C</b></p></td><td>codec settings</td></tr><tr><td><p align=right><b>L</b></p></td><td>ignore zoom if image is smaller than window</td></tr><tr><td><p align=right><b>I</b></p></td><td>menu with images</td></tr><tr><td><p align=right><b>A</b></p></td><td>stop/start animation</td></tr><tr><td><p align=right><b>B</b></p></td><td>toggle drawing background for transparent images</td></tr><tr><td><p align=right><b>K</b></p></td><td>toggle drawing tickmarks</td></tr><tr><td><p align=right><b>E</b></p></td><td>show menu with external tools</td></tr><tr><td><p align=right><b>Y</b></p></td><td>crop</td></tr><tr><td><p align=right><b>F1</b></p></td><td>first image in multi-paged image</td></tr><tr><td><p align=right><b>F2</b></p></td><td>previous</td></tr><tr><td><p align=right><b>F3</b></p></td><td>next</td></tr><tr><td><p align=right><b>F4</b></p></td><td>last</td></tr></table></p> + + + WordBreak|AlignTop + + + + + + + + buttonGroup + + + + + + true + + + + unnamed + + + 0 + + + 0 + + + + pushButton3 + + + NoFocus + + + General + + + true + + + true + + + true + + + 0 + + + + + pushButton3_2 + + + NoFocus + + + Filing + + + true + + + true + + + 1 + + + + + pushButton3_3 + + + NoFocus + + + Moving + + + true + + + true + + + 2 + + + + + pushButton3_5 + + + NoFocus + + + Current image + + + true + + + true + + + 4 + + + + + pushButton3_4 + + + NoFocus + + + Zoom + + + true + + + true + + + 3 + + + + + + + spacer1 + + + Vertical + + + Expanding + + + + 16 + 16 + + + + + + + + buttonGroup + clicked(int) + widgetStack1 + raiseWidget(int) + + + + pushButton3 + pushButton3_2 + pushButton3_3 + pushButton3_5 + pushButton3_4 + + + qtooltip.h + sq_config.h + sq_helpwidget.ui.h + + + init() + destroy() + event( QEvent * e ) + + + diff --git a/ksquirrel/sq_helpwidget.ui.h b/ksquirrel/sq_helpwidget.ui.h new file mode 100644 index 0000000..844f327 --- /dev/null +++ b/ksquirrel/sq_helpwidget.ui.h @@ -0,0 +1,45 @@ +/**************************************************************************** +** ui.h extension file, included from the uic-generated form implementation. +** +** If you want to add, delete, or rename functions or slots, use +** Qt Designer to update this file, preserving your code. +** +** You should not define a constructor or destructor in this file. +** Instead, write your code in functions called init() and destroy(). +** These will automatically be called by the form's constructor and +** destructor. +*****************************************************************************/ + +/* + * SQ_HelpWidget is a helper widget. It shows hotkeys, which + * are accepted by SQ_GLWidget. Called from SQ_GLWidget. + */ + +void SQ_HelpWidget::init() +{ + setPalette(QToolTip::palette()); + SQ_Config::instance()->setGroup("GL view"); + + int pg = SQ_Config::instance()->readNumEntry("help_id", 0); + + buttonGroup->setButton(pg); + widgetStack1->raiseWidget(pg); +} + +void SQ_HelpWidget::destroy() +{ + SQ_Config::instance()->setGroup("GL view"); + SQ_Config::instance()->writeEntry("help_id", buttonGroup->selectedId()); +} + +bool SQ_HelpWidget::event(QEvent *e) +{ + if(e->type() == QEvent::WindowDeactivate + || e->type() == QEvent::MouseButtonPress + || e->type() == QEvent::KeyPress) + { + reject(); + } + + return QDialog::event(e); +} diff --git a/ksquirrel/sq_hloptions.cpp b/ksquirrel/sq_hloptions.cpp new file mode 100644 index 0000000..d7d8fe2 --- /dev/null +++ b/ksquirrel/sq_hloptions.cpp @@ -0,0 +1,37 @@ +/*************************************************************************** + sq_hloptions.cpp - description + ------------------- + begin : ??? ??? 30 2004 + copyright : (C) 2004 by Baryshev Dmitry + email : ksquirrel.iv@gmail.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include "sq_hloptions.h" + +SQ_HLOptions * SQ_HLOptions::m_instance = 0; + +SQ_HLOptions::SQ_HLOptions() + : showLibsAndExit(false), + have_directorybasket(true), + have_categories(true), + have_imagebasket(true), + have_mountview(true) +{ + m_instance = this; +} + +SQ_HLOptions::~SQ_HLOptions() +{} diff --git a/ksquirrel/sq_hloptions.h b/ksquirrel/sq_hloptions.h new file mode 100644 index 0000000..8b4308c --- /dev/null +++ b/ksquirrel/sq_hloptions.h @@ -0,0 +1,47 @@ +/*************************************************************************** + sq_hloptions.h - description + ------------------- + begin : ??? ??? 30 2004 + copyright : (C) 2004 by Baryshev Dmitry + email : ksquirrel.iv@gmail.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifndef SQ_HLOPTIONS_H +#define SQ_HLOPTIONS_H + +#include + +/* + * SQ_HLOptions stores command line options. + */ + +struct SQ_HLOptions +{ + SQ_HLOptions(); + ~SQ_HLOptions(); + + static SQ_HLOptions* instance() { return m_instance; } + + QString param; + KURL file, dir; + + /* + * Just show found libraries and exit ? + */ + bool showLibsAndExit; + + bool have_directorybasket, have_categories, have_imagebasket, have_mountview; + + static SQ_HLOptions *m_instance; +}; + +#endif diff --git a/ksquirrel/sq_iconlistbox.cpp b/ksquirrel/sq_iconlistbox.cpp new file mode 100644 index 0000000..5c67eac --- /dev/null +++ b/ksquirrel/sq_iconlistbox.cpp @@ -0,0 +1,77 @@ +/*************************************************************************** + sq_iconlistbox.cpp - description + ------------------- + begin : ??? ??? 19 2004 + copyright : (C) 2004 by Baryshev Dmitry + email : ksquirrel.iv@gmail.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include "sq_iconlistbox.h" +#include "sq_iconlistitem.h" + +SQ_IconListBox::SQ_IconListBox(QWidget *parent, const char *name, WFlags f) : KListBox(parent, name, f), + mHeightValid(false), mWidthValid(false) +{ + setHScrollBarMode(QScrollView::AlwaysOff); +} + +void SQ_IconListBox::updateWidth() +{ + if(!mWidthValid) + { + int maxWidth = 10, w; + + for(QListBoxItem *i = item(0); i != 0; i = i->next()) + { + w = ((SQ_IconListItem *)i)->width(this); + maxWidth = QMAX(w, maxWidth); + } + + for(QListBoxItem *i = item(0); i != 0; i = i->next()) + ((SQ_IconListItem *)i)->expandMinimumWidth(maxWidth + 30); + + if(verticalScrollBar()->isVisible()) + maxWidth += verticalScrollBar()->sizeHint().width(); + + setFixedWidth(maxWidth + frameWidth()*2 + 30); + mWidthValid = true; + } +} + +void SQ_IconListBox::invalidateHeight() +{ + mHeightValid = false; +} + +void SQ_IconListBox::invalidateWidth() +{ + mWidthValid = false; +} + +void SQ_IconListBox::updateAndInstall(QObject *o) +{ + invalidateHeight(); + invalidateWidth(); + updateWidth(); + + QFont listFont(font()); + + listFont.setBold(true); + setFont(listFont); + verticalScrollBar()->installEventFilter(o); + setCurrentItem(0); + setSelected(0, true); +} diff --git a/ksquirrel/sq_iconlistbox.h b/ksquirrel/sq_iconlistbox.h new file mode 100644 index 0000000..be66c6c --- /dev/null +++ b/ksquirrel/sq_iconlistbox.h @@ -0,0 +1,46 @@ +/*************************************************************************** + sq_iconlistbox.h - description + ------------------- + begin : ??? ??? 19 2004 + copyright : (C) 2004 by Baryshev Dmitry + email : ksquirrel.iv@gmail.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifndef SQ_ICONLISTBOX_H +#define SQ_ICONLISTBOX_H + +#include + +/* + * SQ_IconListBox represents a listbox with fixed width. + * + * SQ_IconListBox and SQ_IconListItem are used in SQ_Options. + */ + +class SQ_IconListBox : public KListBox +{ + public: + SQ_IconListBox(QWidget * = 0, const char * = 0, WFlags = 0); + + void updateAndInstall(QObject *); + + private: + void updateWidth(); + void invalidateHeight(); + void invalidateWidth(); + + private: + bool mHeightValid; + bool mWidthValid; +}; + +#endif diff --git a/ksquirrel/sq_iconlistitem.cpp b/ksquirrel/sq_iconlistitem.cpp new file mode 100644 index 0000000..a0e9fd3 --- /dev/null +++ b/ksquirrel/sq_iconlistitem.cpp @@ -0,0 +1,105 @@ +/*************************************************************************** + sq_iconlistitem.cpp - description + ------------------- + begin : ??? ??? 19 2004 + copyright : (C) 2004 by Baryshev Dmitry + email : ksquirrel.iv@gmail.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include +#include +#include +#include + +#include "sq_iconlistitem.h" + +SQ_IconListItem::SQ_IconListItem(QListBox *listbox, const QPixmap &pixmap, const QString &text) + : QListBoxItem(listbox) +{ + mPixmap = pixmap; + + if(mPixmap.isNull()) + mPixmap = defaultPixmap(); + + setText(text); + mMinimumWidth = 0; +} + +int SQ_IconListItem::expandMinimumWidth( int width ) +{ + mMinimumWidth = QMAX(mMinimumWidth, width); + + return mMinimumWidth; +} + +const QPixmap& SQ_IconListItem::defaultPixmap() +{ + static QPixmap *pix=0; + + if(pix == 0) + { + pix = new QPixmap( 32, 32 ); + QPainter p(pix); + p.eraseRect(0, 0, pix->width(), pix->height()); + p.setPen(Qt::red); + p.drawRect(0, 0, pix->width(), pix->height()); + p.end(); + + QBitmap mask(pix->width(), pix->height(), true); + mask.fill(Qt::black); + p.begin(&mask); + p.setPen(Qt::white); + p.drawRect(0, 0, pix->width(), pix->height()); + p.end(); + + pix->setMask(mask); + } + + return *pix; +} + +void SQ_IconListItem::paint(QPainter *painter) +{ + QFontMetrics fm = painter->fontMetrics(); + int ht = fm.boundingRect(0, 0, 0, 0, Qt::AlignCenter, text()).height(); + int wp = mPixmap.width(); + int hp = mPixmap.height(); + + painter->drawPixmap((mMinimumWidth-wp)/2, 5, mPixmap); + + if(text().isEmpty() == false) + painter->drawText(0, hp+7, mMinimumWidth, ht, Qt::AlignCenter, text()); +} + +int SQ_IconListItem::height( const QListBox *lb ) const +{ + if(text().isEmpty() == true) + return mPixmap.height(); + else + { + int ht = lb->fontMetrics().boundingRect(0, 0, 0, 0, Qt::AlignCenter, text()).height(); + return (mPixmap.height() + ht + 10); + } +} + +int SQ_IconListItem::width( const QListBox *lb ) const +{ + int wt = lb->fontMetrics().boundingRect(0, 0, 0, 0, Qt::AlignCenter, text()).width() + 10; + int wp = mPixmap.width() + 10; + int w = QMAX(wt, wp); + + return QMAX(w, mMinimumWidth); +} diff --git a/ksquirrel/sq_iconlistitem.h b/ksquirrel/sq_iconlistitem.h new file mode 100644 index 0000000..4a9f580 --- /dev/null +++ b/ksquirrel/sq_iconlistitem.h @@ -0,0 +1,53 @@ +/*************************************************************************** + sq_iconlistitem.h - description + ------------------- + begin : ??? ??? 19 2004 + copyright : (C) 2004 by Baryshev Dmitry + email : ksquirrel.iv@gmail.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifndef SQ_ICONLISTITEM_H +#define SQ_ICONLISTITEM_H + +#include + +class QListBox; +class QPainter; +class QPixmap; + +/* + * SQ_IconListItem represents a listbox item. + * + * With SQ_IconListBox it is used in SQ_Options. + * + * Taken from kdelibs. + */ + +class SQ_IconListItem : public QListBoxItem +{ + public: + SQ_IconListItem(QListBox *listbox, const QPixmap &pixmap, const QString &text); + + virtual int height(const QListBox *lb) const; + virtual int width(const QListBox *lb) const; + int expandMinimumWidth(int width); + + protected: + const QPixmap& defaultPixmap(); + void paint(QPainter *painter); + + private: + QPixmap mPixmap; + int mMinimumWidth; +}; + +#endif diff --git a/ksquirrel/sq_iconloader.cpp b/ksquirrel/sq_iconloader.cpp new file mode 100644 index 0000000..698160f --- /dev/null +++ b/ksquirrel/sq_iconloader.cpp @@ -0,0 +1,82 @@ +/*************************************************************************** + sq_iconloader.cpp - description + ------------------- + begin : ??? Aug 20 2005 + copyright : (C) 2005 by Baryshev Dmitry + email : ksquirrel.iv@gmail.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include +#include + +#include "sq_iconloader.h" +#include "sq_iconloader_pixmaps.h" + +SQ_IconLoader * SQ_IconLoader::m_instance = 0; + +SQ_IconLoader::SQ_IconLoader(QObject *parent) : QObject(parent) +{ + m_instance = this; + + fillPixmaps(); +} + +SQ_IconLoader::~SQ_IconLoader() +{} + +QPixmap SQ_IconLoader::loadIcon(const QString& name, KIcon::Group group, int size) const +{ + // try to load from installed icon theme + QPixmap p = KGlobal::iconLoader()->loadIcon(name, group, size, KIcon::DefaultState, 0, true); + + // requested pixmap not found, let's + // try to find it in our pixmaps + if(p.isNull()) + { + if(name == "move_task_up") + p = pixmap_up; + else if(name == "move_task_down") + p = pixmap_down; + else if(name == "display" && size == 32) + p = pixmap_display; + else if(name == "folder" && size == 32) + p = pixmap_folder; + else if(name == "images" && size == 32) + p = pixmap_images; + else if(name == "binary" && size == 32) + p = pixmap_binary; + else if(name == "edit" && size == 32) + p = pixmap_edit; + else + p = KGlobal::iconLoader()->loadIcon("unknown", group, size); + } + + return p; +} + +/* + * Internal. Load all pixmaps. + */ +void SQ_IconLoader::fillPixmaps() +{ + pixmap_up = QPixmap(xpm_up); + pixmap_down = QPixmap(xpm_down); + pixmap_display = QPixmap(xpm_display); + pixmap_folder = QPixmap(xpm_folder); + pixmap_images = QPixmap(xpm_images); + pixmap_binary = QPixmap(xpm_binary); + pixmap_edit = QPixmap(xpm_edit); +} diff --git a/ksquirrel/sq_iconloader.h b/ksquirrel/sq_iconloader.h new file mode 100644 index 0000000..164d918 --- /dev/null +++ b/ksquirrel/sq_iconloader.h @@ -0,0 +1,58 @@ +/*************************************************************************** + sq_iconloader.h - description + ------------------- + begin : ??? Aug 20 2005 + copyright : (C) 2005 by Baryshev Dmitry + email : ksquirrel.iv@gmail.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifndef SQ_ICONLOADER_H +#define SQ_ICONLOADER_H + +#include +#include + +#include + +/* + * SQ_IconLoader represents an icon loader. It tries to load pixmap from + * installed icon theme. If icon was not found, it uses internal pixmaps + * instead. + */ + +class SQ_IconLoader : public QObject +{ + public: + SQ_IconLoader(QObject *parent = 0); + ~SQ_IconLoader(); + + QPixmap loadIcon(const QString &name, KIcon::Group group = KIcon::Desktop, int size = 16) const; + + private: + static SQ_IconLoader *m_instance; + + /* + * Internal. Load all pixmaps. + */ + void fillPixmaps(); + + public: + static SQ_IconLoader* instance() { return m_instance; } + + private: + QPixmap pixmap_up, pixmap_down, + pixmap_display, pixmap_folder, + pixmap_images, pixmap_binary, + pixmap_edit; +}; + +#endif diff --git a/ksquirrel/sq_iconloader_pixmaps.h b/ksquirrel/sq_iconloader_pixmaps.h new file mode 100644 index 0000000..0bc6183 --- /dev/null +++ b/ksquirrel/sq_iconloader_pixmaps.h @@ -0,0 +1,2557 @@ +/*************************************************************************** + sq_iconloader_pixmaps.h - description + ------------------- + begin : 3 2005 + copyright : (C) 2005 by Baryshev Dmitry + email : ksquirrel.iv@gmail.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifndef SQ_ICONLOADER_PIXMAPS +#define SQ_ICONLOADER_PIXMAPS + +static const char * xpm_up[] = { +"22 22 139 2", +" c None", +". c #AE5300", +"+ c #AD5204", +"@ c #B35E10", +"# c #EBD4BF", +"$ c #C78851", +"% c #AD5203", +"& c #F0DDBF", +"* c #FFED80", +"= c #FAEDBF", +"- c #BD7331", +"; c #FFE330", +"> c #FFD900", +", c #FFD710", +"' c #FAECBF", +") c #F0D99F", +"! c #FFE420", +"~ c #FFDC00", +"{ c #FFD700", +"] c #FFD300", +"^ c #FFD210", +"/ c #FAEBBF", +"( c #BD7330", +"_ c #F0DA9F", +": c #FFE410", +"< c #FFDE00", +"[ c #FFDA00", +"} c #FFD600", +"| c #FFD100", +"1 c #FFCD00", +"2 c #FFCC10", +"3 c #FAE9BF", +"4 c #BD7332", +"5 c #FAF0BF", +"6 c #FFE710", +"7 c #FFE100", +"8 c #FFDD00", +"9 c #FFD800", +"0 c #FFD400", +"a c #FFD000", +"b c #FFCB00", +"c c #FFC700", +"d c #FFC710", +"e c #FAE8BF", +"f c #B25D12", +"g c #AE5302", +"h c #FFE910", +"i c #FFE400", +"j c #FFDF00", +"k c #FFDB00", +"l c #FFD200", +"m c #FFCE00", +"n c #FFCA00", +"o c #FFC500", +"p c #FFC100", +"q c #FFC110", +"r c #F0D29F", +"s c #AD5202", +"t c #FAEE8F", +"u c #FFEC10", +"v c #FFE600", +"w c #FFE200", +"x c #FFD500", +"y c #FFCC00", +"z c #FFC800", +"A c #FFC400", +"B c #FFBF00", +"C c #FFBB00", +"D c #FFBB10", +"E c #F0D19F", +"F c #FAEF8F", +"G c #FFED00", +"H c #FFE900", +"I c #FFE500", +"J c #FFE000", +"K c #FFCF00", +"L c #FFC600", +"M c #FFC200", +"N c #FFBE00", +"O c #FFB900", +"P c #FFB500", +"Q c #FFB610", +"R c #F0CF9F", +"S c #B25C15", +"T c #F5E78E", +"U c #FBE802", +"V c #FBE402", +"W c #FBDF02", +"X c #FBDB02", +"Y c #FDDB01", +"Z c #FFC900", +"` c #FFC000", +" . c #F6B104", +".. c #F6AD04", +"+. c #F6A904", +"@. c #F6A504", +"#. c #F5A514", +"$. c #D9A36E", +"%. c #B46107", +"&. c #BC7008", +"*. c #BC6F08", +"=. c #BC6E08", +"-. c #DEA404", +";. c #FFC300", +">. c #D58508", +",. c #BD6506", +"'. c #BD6406", +"). c #BD6306", +"!. c #B95E06", +"~. c #AE5301", +"{. c #D79700", +"]. c #FFBD00", +"^. c #CD7A08", +"/. c #D79600", +"(. c #FFBC00", +"_. c #D79500", +":. c #FFBA00", +"<. c #CD7908", +"[. c #D79400", +"}. c #FFB800", +"|. c #CD7808", +"1. c #D79300", +"2. c #FFB700", +"3. c #CD7708", +"4. c #D79200", +"5. c #FFB300", +"6. c #CD7608", +"7. c #D79100", +"8. c #FFB600", +"9. c #F9AB03", +"0. c #C07008", +"a. c #EDB008", +"b. c #EDAD08", +"c. c #EDA908", +"d. c #EDA608", +"e. c #EDA208", +"f. c #ED9F08", +"g. c #ED9B08", +"h. c #C16807", +" . . + ", +" . @ # $ % ", +" . @ & * = - % ", +" . @ & ; > , ' - % ", +" . @ ) ! ~ { ] ^ / - % ", +" . ( _ : < [ } | 1 2 3 4 + ", +" . ( 5 6 7 8 9 0 a b c d e f g ", +" . ( 5 h i j k { l m n o p q r f s ", +" . ( t u v w < > x | y z A B C D E f s ", +". ( F G H I J ~ 9 ] K b L M N O P Q R S g ", +"g T U V W X Y [ } l 1 Z o ` ...+.@.#.$.+ ", +"% %.&.*.*.=.-.> 0 a y c ;.B >.,.,.'.).!.~. ", +" . . . . . {.{ ] m n L p ].^.. . . . . ", +" . /.x | 1 z A ` (.^.. ", +" . _.0 K b c ;.N :.<.. ", +" . [.l m Z o p ].}.|.. ", +" . 1.a y z A B C 2.|.. ", +" . 1.K n L M N O P 3.. ", +" . 4.1 Z o ` (.}.5.6.. ", +" . 7.y c ;.B :.8.9.6.. ", +" ~.0.a.b.c.d.e.f.g.h.. ", +" ~.g g g g g g g ~. "}; + +static const char * xpm_down[] = { +"22 22 138 2", +" c None", +". c #AE5300", +"+ c #C78950", +"@ c #FFFABF", +"# c #FFF9BF", +"$ c #FFF8BF", +"% c #FFF7BF", +"& c #FFF6BF", +"* c #FFF4BF", +"= c #FFF3BF", +"- c #D7A000", +"; c #FFEA00", +"> c #FFE600", +", c #FFE100", +"' c #FFDD00", +") c #FFD800", +"! c #FFD400", +"~ c #FFCF00", +"{ c #D79000", +"] c #D79F00", +"^ c #FFE800", +"/ c #FFE400", +"( c #FFDF00", +"_ c #FFDB00", +": c #FFD700", +"< c #FFD200", +"[ c #FFCE00", +"} c #D78F00", +"| c #FFE700", +"1 c #FFE200", +"2 c #FFDE00", +"3 c #FFD900", +"4 c #FFD500", +"5 c #FFD000", +"6 c #FFCC00", +"7 c #D78E00", +"8 c #D79E00", +"9 c #FFE500", +"0 c #FFDC00", +"a c #FFD300", +"b c #FFCA00", +"c c #D78D00", +"d c #D79D00", +"e c #FFE300", +"f c #FFDA00", +"g c #FFD600", +"h c #FFCD00", +"i c #FFC900", +"j c #D78C00", +"k c #D79C00", +"l c #FFCB00", +"m c #FFC700", +"n c #D78B00", +"o c #D79B00", +"p c #FFE000", +"q c #FFC500", +"r c #D78A00", +"s c #D79A00", +"t c #FFD100", +"u c #FFC800", +"v c #FFC300", +"w c #BB6F2A", +"x c #C27E40", +"y c #E1AD10", +"z c #FFC600", +"A c #FFC200", +"B c #E19A10", +"C c #B86920", +"D c #D9AF6C", +"E c #F8E843", +"F c #FFF140", +"G c #FFEE40", +"H c #FFEA40", +"I c #FFE110", +"J c #FFC000", +"K c #FFC010", +"L c #FFC940", +"M c #FFC640", +"N c #FFC240", +"O c #FCBB41", +"P c #EAC7A3", +"Q c #B25B01", +"R c #E1B707", +"S c #FBE302", +"T c #FFBE00", +"U c #FFBA00", +"V c #FFB500", +"W c #FFB100", +"X c #FCA902", +"Y c #EA9207", +"Z c #BA5F02", +"` c #E2B506", +" . c #FCDF02", +".. c #FFC100", +"+. c #FFBD00", +"@. c #FFB800", +"#. c #FFB400", +"$. c #FCAC02", +"%. c #EA9407", +"&. c #B25A01", +"*. c #E2B106", +"=. c #FCD902", +"-. c #FFC400", +";. c #FFBF00", +">. c #FFBB00", +",. c #FFB700", +"'. c #FCAE02", +"). c #EA9707", +"!. c #BA6002", +"~. c #EABA07", +"{. c #FCD302", +"]. c #FFB900", +"^. c #FCB102", +"/. c #EA9907", +"(. c #BA6702", +"_. c #EAB607", +":. c #FCCD02", +"<. c #FFBC00", +"[. c #FCB302", +"}. c #E29206", +"|. c #BA6102", +"1. c #BA6602", +"2. c #EAB107", +"3. c #FECA01", +"4. c #FBB502", +"5. c #E29306", +"6. c #B25801", +"7. c #BA6502", +"8. c #ECB006", +"9. c #FEC401", +"0. c #F8B403", +"a. c #E19407", +"b. c #BA6402", +"c. c #ECAB06", +"d. c #F5B305", +"e. c #E19507", +"f. c #C26E03", +"g. c #DD9206", +" . . . . . . . . . ", +" . + @ # $ % & * = + . ", +" . - ; > , ' ) ! ~ { . ", +" . ] ^ / ( _ : < [ } . ", +" . ] | 1 2 3 4 5 6 7 . ", +" . 8 9 , 0 ) a ~ b c . ", +" . d e ( f g < h i j . ", +" . k 1 ' 3 ! 5 l m n . ", +" . o p _ : a [ b q r . ", +" . . . . . s 2 f 4 t 6 u v r . . . . . ", +". w x x x x y ' ) ! ~ l z A B x x x x C . ", +". D E F G H I _ g < h i q J K L M N O P . ", +". Q R S > 1 2 3 4 5 6 m v T U V W X Y Z . ", +" . Q ` .p 0 : a [ b z ..+.@.#.$.%.Z . ", +" . &.*.=.f g t h u -.;.>.,.'.).!.. ", +" . &.~.{.! 5 l m A T ].^./.!.. ", +" . (._.:.[ i q ..<.[.}.|.. ", +" . 1.2.3.u v ;.4.5.6.. ", +" . 7.8.9.A 0.a.6.. ", +" . b.c.d.e.6.. ", +" . f.g.6.. ", +" . . . "}; + +static const char * xpm_binary[] = { +"32 32 246 2", +" c None", +". c #6E6E6E", +"+ c #8E8F8F", +"@ c #898A8B", +"# c #88898B", +"$ c #88898A", +"% c #87888A", +"& c #86878A", +"* c #868789", +"= c #878889", +"- c #878789", +"; c #868788", +"> c #858688", +", c #858687", +"' c #848687", +") c #848587", +"! c #858586", +"~ c #6A6A6A", +"{ c #706F6F", +"] c #F6FAFF", +"^ c #E7EFFF", +"/ c #F0F5FF", +"( c #E9F0FE", +"_ c #E8F0FE", +": c #E3ECFD", +"< c #E4EDFD", +"[ c #DFEAFB", +"} c #E8F0FD", +"| c #E6EFFC", +"1 c #E2ECFB", +"2 c #E1EBFB", +"3 c #D5E3F8", +"4 c #D3E1F8", +"5 c #D1E1F7", +"6 c #D0DFF6", +"7 c #CEDFF6", +"8 c #CDDEF5", +"9 c #CBDDF5", +"0 c #CADCF5", +"a c #C9DBF4", +"b c #C7DAF3", +"c c #C6D9F3", +"d c #C4D8F2", +"e c #C2D7F2", +"f c #C1D6F2", +"g c #E7EEF6", +"h c #696968", +"i c #6F6F6F", +"j c #F3F7FF", +"k c #A0BDF9", +"l c #E1EAFC", +"m c #C8D9F9", +"n c #BBD1F6", +"o c #D7E4FA", +"p c #B6CDF4", +"q c #D0DFF8", +"r c #AEC7F1", +"s c #CBDBF6", +"t c #BAD0F3", +"u c #A7C3EF", +"v c #9ABBEC", +"w c #4E87DC", +"x c #4F86DC", +"y c #4983D9", +"z c #437FD6", +"A c #3D7CD5", +"B c #3878D2", +"C c #3374D1", +"D c #2E72D0", +"E c #296ECE", +"F c #236ACC", +"G c #1C67C9", +"H c #1762C6", +"I c #105EC4", +"J c #0A5AC5", +"K c #E3EAF4", +"L c #F4F8FF", +"M c #9DBCF8", +"N c #C2D4F9", +"O c #ACC6F5", +"P c #A3C0F3", +"Q c #A4C0F1", +"R c #9FBDF0", +"S c #97B9EE", +"T c #99B9ED", +"U c #8FB3EB", +"V c #7EA7E7", +"W c #709EE3", +"X c #578DDE", +"Y c #548BDD", +"Z c #4E87DA", +"` c #4983D7", +" . c #4380D6", +".. c #3E7CD3", +"+. c #3978D2", +"@. c #3476D1", +"#. c #2D72CF", +"$. c #296ECD", +"%. c #236BCB", +"&. c #1E67C9", +"*. c #1763C6", +"=. c #1160C7", +"-. c #E4EBF5", +";. c #6F6F6E", +">. c #FEFFFF", +",. c #E7EFFE", +"'. c #E2EAFC", +"). c #E1EBFC", +"!. c #DEE9FA", +"~. c #DDE8FA", +"{. c #DBE6F9", +"]. c #DEE9FC", +"^. c #DAE6FA", +"/. c #D8E4F8", +"(. c #D8E5F7", +"_. c #D6E3F7", +":. c #D6E2F5", +"<. c #D3E0F3", +"[. c #D1DFF2", +"}. c #D0DEF1", +"|. c #CDDBF0", +"1. c #CCDBEF", +"2. c #CBDAEE", +"3. c #C8D8ED", +"4. c #C7D7ED", +"5. c #C7D8ED", +"6. c #C4D4EB", +"7. c #C0D1E9", +"8. c #C1D3EC", +"9. c #F4F6F8", +"0. c #686868", +"a. c #FFFFFF", +"b. c #FEFEFE", +"c. c #EDECE9", +"d. c #F5F5F3", +"e. c #FEFDFB", +"f. c #FFFEFC", +"g. c #FFFFFC", +"h. c #FFFFFB", +"i. c #FFFEFB", +"j. c #FFFDFA", +"k. c #FFFDF9", +"l. c #FEFCF8", +"m. c #FFFCF8", +"n. c #FCFAF6", +"o. c #EBE8E5", +"p. c #FBF8F4", +"q. c #FCF9F5", +"r. c #FEFAF6", +"s. c #F9F9F8", +"t. c #E1E1E1", +"u. c #BDBDBD", +"v. c #C1C1C1", +"w. c #FAFAFA", +"x. c #F6F6F6", +"y. c #B4B4B4", +"z. c #F2F2F2", +"A. c #FCFCFC", +"B. c #F9F9F9", +"C. c #F7F7F7", +"D. c #F8F8F8", +"E. c #CFCFCF", +"F. c #B6B6B6", +"G. c #D2D2D2", +"H. c #F5F5F5", +"I. c #CACACA", +"J. c #E2E2E2", +"K. c #BEBEBE", +"L. c #EFEFEF", +"M. c #FBFBFB", +"N. c #ECECEC", +"O. c #BCBCBC", +"P. c #D3D3D3", +"Q. c #C2C2C2", +"R. c #F4F4F4", +"S. c #B1B1B1", +"T. c #DEDEDE", +"U. c #BABABA", +"V. c #E3E3E3", +"W. c #F1F1F1", +"X. c #EEEEEE", +"Y. c #FDFDFD", +"Z. c #F0F0F0", +"`. c #F3F3F3", +" + c #EDEDED", +".+ c #E7E7E7", +"++ c #E6E6E6", +"@+ c #C0C0C0", +"#+ c #D8D8D8", +"$+ c #DADADA", +"%+ c #D1D1D1", +"&+ c #E0E0E0", +"*+ c #DFDFDF", +"=+ c #C6C6C6", +"-+ c #A6A6A6", +";+ c #E8E8E8", +">+ c #B5B5B5", +",+ c #EAEAEA", +"'+ c #D4D4D4", +")+ c #DCDCDC", +"!+ c #D5D5D5", +"~+ c #B2B2B2", +"{+ c #CDCDCD", +"]+ c #C3C3C3", +"^+ c #DDDDDD", +"/+ c #D0D0D0", +"(+ c #EBEBEB", +"_+ c #B3B3B3", +":+ c #A7A7A7", +"<+ c #A4A4A4", +"[+ c #D9D9D9", +"}+ c #C7C7C7", +"|+ c #BFBFBF", +"1+ c #DBDBDB", +"2+ c #979797", +"3+ c #909090", +"4+ c #6D6D6D", +"5+ c #ACACAC", +"6+ c #939393", +"7+ c #A9A9A9", +"8+ c #949494", +"9+ c #E4E4E4", +"0+ c #929292", +"a+ c #8E8E8E", +"b+ c #8D8D8D", +"c+ c #8F8F8F", +"d+ c #8C8C8C", +"e+ c #676767", +"f+ c #A2A2A2", +"g+ c #D6D6D6", +"h+ c #9C9C9C", +"i+ c #BBBBBB", +"j+ c #C5C5C5", +"k+ c #717171", +"l+ c #E9E9E9", +"m+ c #CBCBCB", +"n+ c #AFAFAF", +"o+ c #ABABAB", +"p+ c #CECECE", +"q+ c #707070", +"r+ c #B9B9B9", +"s+ c #B0B0B0", +"t+ c #E5E5E5", +"u+ c #6C6C6C", +"v+ c #959595", +"w+ c #8A8A8A", +" . + @ # # # $ $ % % & * * * = - * * ; ; ; > > , , ' ) > ! ~ ", +" { ] ^ / ( _ _ : < [ } | 1 2 3 4 5 6 7 8 9 0 a b c d e f g h ", +" i j k l m n o p q r s t u v w x y z A B C D E F G H I J K h ", +" i L M N O P P Q R S T U V W X Y Z ` ...+.@.#.$.%.&.*.=.-.h ", +" ;.>.,.'.).2 !.~.{.].^./.(._.(.:.<.[.}.|.1.2.3.4.5.6.7.8.9.0. ", +" . a.a.a.a.a.a.a.b.c.d.a.a.a.e.f.g.h.i.j.k.l.m.n.o.p.q.r.s.0. ", +" . a.a.a.a.a.a.a.t.u.v.w.a.x.y.z.A.B.B.C.C.x.D.E.F.G.H.z.D.0. ", +" . a.a.a.a.a.a.a.I.J.K.L.a.M.y.N.A.B.D.C.C.x.D.O.P.Q.R.L.D.0. ", +" . a.a.a.a.a.a.a.R.u.G.a.b.H.S.T.b.D.D.D.x.x.C.J.U.V.W.X.D.0. ", +" . a.a.a.Y.b.a.a.a.a.a.Y.A.A.R.B.w.D.B.Z.B.x.R.x.`.`. +Z.B.0. ", +" . a.a.a.U..+a.a.a.b.b.Y.b.++@+#+w.w.$+u.%+R.C.&+U.Z. +W.B.0. ", +" . a.a.a.O.*+a.a.b.Y.Y.A.a.=+P.@+H.w.v.#+-+Z.C.;+>+,+X.W.B.0. ", +" . a.a.a.Q.'+a.b.b.Y.A.A.b.V.O.P.B.B.)+O.!+R.x.V.~+J.Z.z.B.0. ", +" . a.a.a.B.M.a.b.Y.Y.A.M.w.Y.C.B.D.x.B.`.C.R.z.L.L.L.L.`.B.0. ", +" . a.a.H.Q.{+A.b.Y.A.M.M.M.R.]+W.D.D.++Q.`.`.Z.Z.W.W.Z.R.B.0. ", +" . a.a.^+/+v.(+a.Y.M.M.M.w.C.~+N.D.D.;+_+z.z.W.W.W.W.W.H.B.0. ", +" . a.a.`.Q.I.w.Y.A.A.M.B.w.`.:+$+w.D.V.<+[+x.z.z.`.z.z.x.B.0. ", +" . a.B.Y.C.w.b.Y.Y.b.w.B.B.x.X.Z.H.`.z.,+Z.`.z.R.x.z.z.x.B.0. ", +" . a.R.`.x.D.D.w.z.}+`.D.D.L.|+X.R.H.^+_+1+H.C.&+U.R.H.D.B.0. ", +" . a.x.H.R.R.R.H.Z.>+ +x.x.L.2+;+D.C.~+{+3+Z.w.t.<+H.x.B.B.0. ", +" 4+a.x.H.H.H.H.x.Z.5+/+D.C.W.6+'+M.D.=+7+F.`.B.&+8+9+D.B.B.0. ", +" 4+a.C.x.M.D.x.x.H.z.L.x.C.z.)+(+D.C.R.$+C.D.C.`.N.R.B.A.w.0. ", +" 4+a.C.D.@+9+B.C.Z.Q.W.C.x.C.M.D.x.x.D.M.0+a+a+a+b+b+b+c+d+e+ ", +" 4+a.w.A.f+g+Y.w.z.f+X.w.D.D.D.D.D.D.D.B.c+(+D.x.H.H.M.H.i ", +" 4+a.w.M.h+i+Y.w.Z.0+j+A.D.D.D.D.D.D.D.B.c+L.A.A.b.a.M.k+ ", +" 4+a.w.B.++l+w.w.x.J.l+w.B.w.b.M.B.B.B.w.c+,+H.H.M.B.k+ ", +" 4+a.A.D.m+[+A.A.R.K.g+Y.M.B.g+L.A.w.w.M.c+++L.R.`.k+ ", +" 4+a.a.!+i+n+.+a.|+{+o+(+a.p+7+i+w.M.w.M.a+V.L. +q+ ", +" 4+a.a.*+~+n+X.a.I.r+o+W.a.r+@+s+C.A.M.A.a+9+.+q+ ", +" 4+a.a.a.)+.+a.a.Y.E.t+a.a.x.@+t+a.a.a.a.3+&+i ", +" u+v+6+0+8+6+0+0+6+8+8+0+0+6+v+6+0+0+0+6+w+. ", +" "}; +static const char * xpm_display[] = { +"32 32 488 2", +" c None", +". c #868686", +"+ c #9E9E9E", +"@ c #9D9D9D", +"# c #9C9C9C", +"$ c #9B9B9B", +"% c #9A9A9A", +"& c #666666", +"* c #949494", +"= c #FDFDFD", +"- c #FFFFFF", +"; c #F1F1F1", +"> c #717171", +", c #EAEAEA", +"' c #FFFFFD", +") c #FFFFFC", +"! c #FFFFFA", +"~ c #FFFEFA", +"{ c #FFFEF9", +"] c #FFFDF9", +"^ c #FFFCF9", +"/ c #FFFCF8", +"( c #FEFEFE", +"_ c #C8C8C8", +": c #F5F5F5", +"< c #D7D8DB", +"[ c #7087AE", +"} c #7D98BE", +"| c #8AA7CA", +"1 c #8CA9CB", +"2 c #8FACCD", +"3 c #92B0D0", +"4 c #95B3D2", +"5 c #98B6D4", +"6 c #9BB9D6", +"7 c #9EBCD7", +"8 c #A0BED8", +"9 c #A0BFD8", +"0 c #9BB9D4", +"a c #98B6D3", +"b c #95B3D1", +"c c #92AFCF", +"d c #8EACCD", +"e c #8BA8CA", +"f c #87A5C9", +"g c #85A2C7", +"h c #758FB7", +"i c #899CC0", +"j c #F8F9FA", +"k c #D3D3D3", +"l c #F4F4F4", +"m c #C6C9D0", +"n c #083FA5", +"o c #2A6ECA", +"p c #3B80D5", +"q c #4287D9", +"r c #488EDD", +"s c #4F95E2", +"t c #579DE6", +"u c #5EA4EB", +"v c #64ABEF", +"w c #6AB1F3", +"x c #6EB5F5", +"y c #6EB6F6", +"z c #6DB4F5", +"A c #69B1F2", +"B c #63AAEF", +"C c #5DA3EA", +"D c #559CE6", +"E c #4F94E1", +"F c #478DDC", +"G c #4084D7", +"H c #397ED3", +"I c #3478D0", +"J c #1A5DBF", +"K c #2C5CB7", +"L c #F3F5F8", +"M c #D2D2D2", +"N c #F6F6F6", +"O c #C8CCD3", +"P c #225DB7", +"Q c #397BD1", +"R c #4081D3", +"S c #4788D8", +"T c #4D8FDB", +"U c #5395DF", +"V c #599BE3", +"W c #5EA2E7", +"X c #64A7EA", +"Y c #68ABED", +"Z c #6AAEEF", +"` c #6BAFEF", +" . c #6AAEEE", +".. c #63A7EA", +"+. c #5FA1E6", +"@. c #5294DF", +"#. c #4B8DDB", +"$. c #4586D6", +"%. c #3F80D2", +"&. c #3879CE", +"*. c #2C6EC8", +"=. c #3F73C5", +"-. c #F0F2F6", +";. c #FFFEFD", +">. c #CDD0D7", +",. c #2B66BC", +"'. c #3576CE", +"). c #3D7DD1", +"!. c #4384D5", +"~. c #498AD8", +"{. c #4E90DC", +"]. c #5395E0", +"^. c #5D9FE5", +"/. c #60A3E8", +"(. c #62A5E9", +"_. c #62A4E9", +":. c #60A3E7", +"<. c #5C9FE6", +"[. c #589AE2", +"}. c #4E8FDC", +"|. c #4182D3", +"1. c #3B7CD0", +"2. c #3575CC", +"3. c #296BC7", +"4. c #467AC9", +"5. c #EAEBEF", +"6. c #F1F0EF", +"7. c #CECECE", +"8. c #F8F8F8", +"9. c #CED1D8", +"0. c #2560B9", +"a. c #3072CB", +"b. c #3F7FD2", +"c. c #488AD8", +"d. c #4D8FDC", +"e. c #5294DE", +"f. c #5597E0", +"g. c #589BE2", +"h. c #5A9CE3", +"i. c #599CE3", +"j. c #5597E1", +"k. c #5193DE", +"l. c #4D8EDB", +"m. c #4889D8", +"n. c #4283D4", +"o. c #3C7CD1", +"p. c #3777CD", +"q. c #3271C9", +"r. c #2667C4", +"s. c #4276C6", +"t. c #E1E3E7", +"u. c #E4E3E1", +"v. c #CACACA", +"w. c #F9F9F9", +"x. c #CED2D9", +"y. c #1550AF", +"z. c #2C6CC7", +"A. c #3474CB", +"B. c #3979CE", +"C. c #3D7ED1", +"D. c #4282D4", +"E. c #4788D7", +"F. c #4B8CDA", +"G. c #5092DD", +"H. c #4A8BD9", +"I. c #4687D7", +"J. c #4182D4", +"K. c #3C7DD1", +"L. c #3272CA", +"M. c #2E6DC7", +"N. c #1F5FBF", +"O. c #3467BE", +"P. c #E1E3E6", +"Q. c #E3E2E1", +"R. c #CCCCCC", +"S. c #FBFBFB", +"T. c #D2D6DC", +"U. c #0740A5", +"V. c #1656B9", +"W. c #2F6FC8", +"X. c #3373CB", +"Y. c #3F80D3", +"Z. c #4889D7", +"`. c #4587D6", +" + c #4283D5", +".+ c #3B7BD0", +"++ c #3676CD", +"@+ c #3171C9", +"#+ c #2968C3", +"$+ c #0949B1", +"%+ c #2C5EB7", +"&+ c #E1E0DF", +"*+ c #FCFCFC", +"=+ c #D4D7DE", +"-+ c #0841A5", +";+ c #003BA8", +">+ c #1654B7", +",+ c #2B6BC5", +"'+ c #3171CA", +")+ c #3878CE", +"!+ c #3E7FD1", +"~+ c #3A7BD0", +"{+ c #3878CD", +"]+ c #3070C9", +"^+ c #2C6BC6", +"/+ c #2362C0", +"(+ c #0F4DB2", +"_+ c #0037A6", +":+ c #2D60B9", +"<+ c #E0E2E5", +"[+ c #DFDEDC", +"}+ c #D6D9E0", +"|+ c #0942A6", +"1+ c #003CA9", +"2+ c #0341AB", +"3+ c #0F4DB4", +"4+ c #1E5DBD", +"5+ c #2A69C5", +"6+ c #3374CB", +"7+ c #3676CC", +"8+ c #3778CD", +"9+ c #3576CC", +"0+ c #2C6CC6", +"a+ c #2463C0", +"b+ c #1552B7", +"c+ c #0642AD", +"d+ c #003CA8", +"e+ c #0038A6", +"f+ c #DFE1E4", +"g+ c #DCDBDA", +"h+ c #D7DBE2", +"i+ c #0B44A9", +"j+ c #0443AE", +"k+ c #0C4AB1", +"l+ c #0F4DB3", +"m+ c #1250B5", +"n+ c #1857B9", +"o+ c #205FBE", +"p+ c #2766C2", +"q+ c #2A6AC5", +"r+ c #2E6EC7", +"s+ c #2E6EC8", +"t+ c #2D6DC7", +"u+ c #2767C3", +"v+ c #2161BF", +"w+ c #1A59BA", +"x+ c #114FB4", +"y+ c #0A48B0", +"z+ c #0744AD", +"A+ c #0441AB", +"B+ c #0038A7", +"C+ c #DEDFE2", +"D+ c #D9D8D7", +"E+ c #D9DDE4", +"F+ c #114BAD", +"G+ c #0B4AB2", +"H+ c #1452B6", +"I+ c #1B5ABB", +"J+ c #1F5EBD", +"K+ c #2261C0", +"L+ c #2464C1", +"M+ c #2767C2", +"N+ c #2968C4", +"O+ c #2969C4", +"P+ c #2665C1", +"Q+ c #2262C0", +"R+ c #1756B8", +"S+ c #1351B5", +"T+ c #0A47B0", +"U+ c #003BA9", +"V+ c #DBDDE0", +"W+ c #D6D5D4", +"X+ c #DCE0E6", +"Y+ c #1852B2", +"Z+ c #1250B6", +"`+ c #1B59BB", +" @ c #205EBD", +".@ c #2766C3", +"+@ c #2B6AC6", +"@@ c #2D6EC7", +"#@ c #3070C8", +"$@ c #3272C9", +"%@ c #2867C3", +"&@ c #1A58BA", +"*@ c #1653B7", +"=@ c #114EB4", +"-@ c #0242AE", +";@ c #3063BB", +">@ c #DADCDF", +",@ c #D4D3D2", +"'@ c #DDE1E8", +")@ c #1E58B6", +"!@ c #1857BA", +"~@ c #2160BF", +"{@ c #2665C2", +"]@ c #2F6EC8", +"^@ c #3372CA", +"/@ c #3A7BCF", +"(@ c #3B7BCF", +"_@ c #3677CD", +":@ c #2B6BC6", +"<@ c #215FBE", +"[@ c #1C5ABB", +"}@ c #1654B8", +"|@ c #0848B2", +"1@ c #3567BF", +"2@ c #D9DBDE", +"3@ c #D1D1CF", +"4@ c #DEE2E8", +"5@ c #235DB9", +"6@ c #1D5EBF", +"7@ c #3E7FD2", +"8@ c #4284D4", +"9@ c #4484D5", +"0@ c #0E4EB5", +"a@ c #396CC1", +"b@ c #D8D9DC", +"c@ c #CFCECD", +"d@ c #CDCDCD", +"e@ c #DEE1E7", +"f@ c #2763BC", +"g@ c #2364C2", +"h@ c #3372CB", +"i@ c #4B8DDA", +"j@ c #4C8EDB", +"k@ c #4C8EDA", +"l@ c #498BD9", +"m@ c #3D7ED2", +"n@ c #3373CA", +"o@ c #1353B8", +"p@ c #3C70C3", +"q@ c #D6D8DB", +"r@ c #CDCCCA", +"s@ c #DBDFE5", +"t@ c #1F5EBC", +"u@ c #1C60C2", +"v@ c #266AC7", +"w@ c #2D71CB", +"x@ c #3377CF", +"y@ c #397DD3", +"z@ c #3E83D7", +"A@ c #4389DA", +"B@ c #478DDD", +"C@ c #4A90DE", +"D@ c #4C92DF", +"E@ c #4489DB", +"F@ c #3F85D7", +"G@ c #3A7FD4", +"H@ c #3379D0", +"I@ c #2D71CC", +"J@ c #2063C3", +"K@ c #195CBF", +"L@ c #0A4FB7", +"M@ c #356CC3", +"N@ c #D5D7DA", +"O@ c #CAC9C8", +"P@ c #E9ECEF", +"Q@ c #88AADC", +"R@ c #86ABDF", +"S@ c #8CB1E2", +"T@ c #90B5E4", +"U@ c #93B8E6", +"V@ c #96BBE8", +"W@ c #99BFEA", +"X@ c #9DC2EB", +"Y@ c #9FC4EE", +"Z@ c #A0C6EE", +"`@ c #A1C6EF", +" # c #A0C5EE", +".# c #9EC4ED", +"+# c #9CC2EC", +"@# c #92B7E5", +"## c #8EB3E3", +"$# c #8AAFE0", +"%# c #87ABDD", +"&# c #83A7DC", +"*# c #7BA0D7", +"=# c #92AFDD", +"-# c #D6D7D9", +";# c #C6C6C5", +"># c #CBCBCB", +",# c #FDFDFC", +"'# c #F4F6F8", +")# c #F6F7F8", +"!# c #F4F3F3", +"~# c #F1F2F2", +"{# c #F0F0F0", +"]# c #EFEEEF", +"^# c #EDEDEC", +"/# c #EBEBEB", +"(# c #E9EAEA", +"_# c #E8E8E8", +":# c #E6E6E6", +"<# c #E3E3E3", +"[# c #E2E2E2", +"}# c #E1E1E1", +"|# c #DFDFDF", +"1# c #DCDCDC", +"2# c #DBDBDB", +"3# c #D9D9D9", +"4# c #D7D8D7", +"5# c #D5D6D6", +"6# c #D4D3D3", +"7# c #D0D0D1", +"8# c #CFCFCF", +"9# c #C4C4C4", +"0# c #FBFAFA", +"a# c #F9F7F7", +"b# c #F6F6F4", +"c# c #F4F4F3", +"d# c #ECEBEA", +"e# c #E9E9E8", +"f# c #E8E7E7", +"g# c #E6E5E5", +"h# c #E4E2E3", +"i# c #E2E1E0", +"j# c #E0DFDD", +"k# c #DEDDDC", +"l# c #DBDBDA", +"m# c #D8D9D8", +"n# c #D6D6D5", +"o# c #D4D4D3", +"p# c #D2D2D1", +"q# c #D0CFCF", +"r# c #CECCCC", +"s# c #CBCAC9", +"t# c #A5A5A5", +"u# c #ACACAC", +"v# c #C9C9C9", +"w# c #C7C7C7", +"x# c #D5D5D5", +"y# c #D1D1D1", +"z# c #C1C1C1", +"A# c #B4B4B4", +"B# c #B9B9B9", +"C# c #BBBBBB", +"D# c #BABABA", +"E# c #B8B8B8", +"F# c #BCBCBC", +"G# c #595959", +"H# c #D0D0D0", +"I# c #C3C3C3", +"J# c #C2C2C2", +"K# c #BFBFBF", +"L# c #BEBEBE", +"M# c #878787", +"N# c #3A3A3A", +"O# c #8B8B8B", +"P# c #C6C6C6", +"Q# c #E7E7E7", +"R# c #F3F3F3", +"S# c #5E5E5E", +"T# c #FAFAFA", +"U# c #F2F2F2", +"V# c #DADADA", +"W# c #A8A8A8", +"X# c #787878", +"Y# c #ECECEC", +"Z# c #DDDDDD", +"`# c #E5E5E5", +" $ c #E4E4E4", +".$ c #DEDEDE", +"+$ c #4C4C4C", +"@$ c #F7F7F7", +"#$ c #EDEDED", +"$$ c #D8D8D8", +"%$ c #D7D7D7", +"&$ c #393939", +"*$ c #808080", +"=$ c #EFEFEF", +"-$ c #EEEEEE", +";$ c #D6D6D6", +">$ c #686868", +",$ c #414141", +"'$ c #898989", +")$ c #D4D4D4", +"!$ c #B5B5B5", +"~$ c #757575", +"{$ c #2D2D2D", +"]$ c #454545", +"^$ c #848484", +"/$ c #A4A4A4", +"($ c #A6A6A6", +"_$ c #A3A3A3", +":$ c #979797", +"<$ c #7E7E7E", +"[$ c #606060", +"}$ c #3C3C3C", +" . + @ @ @ @ @ @ @ @ @ # # # # # # # # # $ $ $ % % % $ & ", +" * = - - - - - - - - - - - - - - - - - - - - - - - - - - ; > ", +" , - - ' ) ! ! ! ~ { ] ] ^ / / / ] ] ] ] { { { { { ! ) ( - _ ", +" : - < [ } | 1 2 3 4 5 6 7 8 9 8 7 0 a b c d e f g h i j - k ", +" l - m n o p q r s t u v w x y z A B C D E F G H I J K L - M ", +" N - O P Q R S T U V W X Y Z ` .Y ..+.V @.#.$.%.&.*.=.-.;.M ", +" N - >.,.'.).!.~.{.].V ^./.(.(._.:.<.[.U }.S |.1.2.3.4.5.6.7. ", +" 8.- 9.0.a.&.b.!.c.d.e.f.g.h.h.i.[.j.k.l.m.n.o.p.q.r.s.t.u.v. ", +" w.- x.y.z.A.B.C.D.E.F.d.G.k.k.k.G.T H.I.J.K.p.L.M.N.O.P.Q.R. ", +" S.- T.U.V.W.X.p.1.Y.!.$.S ~.~.~.Z.`. +%..+++@+M.#+$+%+P.&+R. ", +" *+- =+-+;+>+,+'+2.)+1.!+%.R R R %.C.~+{+A.]+^+/+(+_+:+<+[+R. ", +" *+- }+|+1+2+3+4+5+]+6+7+8+)+)+{+p.9+X.]+0+a+b+c+d+e+:+f+g+R. ", +" = - h+i+j+k+l+m+n+o+p+q+M.r+s+s+t+,+u+v+w+x+y+z+A+B+:+C+D+R. ", +" ( - E+F+G+H+n+I+J+K+L+M+N+O+O+N+u+P+Q+J+I+R+S+l+T+U+:+V+W+R. ", +" - - X+Y+Z+`+ @/+.@+@@@#@@+$@$@@+#@M.,+%@a+J+&@*@=@-@;@>@,@R. ", +" - - '@)@!@~@{@q+]@^@7+B./@(@(@/@B._@X.W.:@{@<@[@}@|@1@2@3@R. ", +" - - 4@5@6@u+t+@+++/@7@R 8@9@9@8@J.7@.+p.'+0+.@v+[@0@a@b@c@d@ ", +" - - e@f@g@z.h@{+).n.I.c.i@j@k@F.l@I.n.m@&.n@0+.@~@o@p@q@r@R. ", +" - - s@t@u@v@w@x@y@z@A@B@C@D@D@C@r E@F@G@H@I@v@J@K@L@M@N@O@R. ", +" - - P@Q@R@S@T@U@V@W@X@Y@Z@`@`@ #.#+#W@V@@###$#%#&#*#=#-#;#># ", +" - ,#'#)#N !#~#{#]#^#/#(#_#:#<#[#}#|#1#2#3#4#5#6#M 7#8#_ 9#R. ", +" 7.- ( ,#0#a#b#c#6.d#e#f#g#h#i#j#k#l#m#n#W+W+o#p#q#r#s#_ 2#t# ", +" u#M d@R.>#v#9#w#x#k M y#8#7.d@R.>#v.v.z#A#B#C#D#B#E#F#* ", +" G#w#H#>#v#w#9#I#J#K#L#L#M#N# ", +" O#P#/#H#:#/#_#_#_#Q#Q#_#/#x#:#R#A#S# ", +" y#- - - ; 2#/#: w.w.T#8.U#V#k w.- - - W# ", +" X#- = S.w.N Y#Z#|#`#:# $1#7.v#R..$*+S.- - +$ ", +" S#@$@$U#U#; #$, <#1#2#$$%$2#|#Q#; U#U#T#Y#&$ ", +" *$[#=$=$Y#, , , , , , , /#Y#Y##$=$-$;$>$ ", +" ,$'$C#%$[#<#<# $ $ $ $<#<#[#)$!$~${$ ", +" ]$& ^$% /$($($_$:$<$[$}$ ", +" "}; +static const char * xpm_edit[] = { +"32 32 281 2", +" c None", +". c #C4D0E5", +"+ c #9DAAC1", +"@ c #FBFFFF", +"# c #FFFFFF", +"$ c #FEFFFF", +"% c #F5FAFF", +"& c #EDF3FE", +"* c #E4EBF9", +"= c #D8E1F2", +"- c #C2D0E9", +"; c #A7B2C4", +"> c #FCFFFF", +", c #F8FDFF", +"' c #F2F7FF", +") c #EAF1FD", +"! c #E1E9F7", +"~ c #D5DFF0", +"{ c #DBAC55", +"] c #F2C584", +"^ c #E6AE84", +"/ c #DD9A6F", +"( c #EDF4FE", +"_ c #E6EDFA", +": c #DBD6D4", +"< c #F5BC00", +"[ c #FEE43E", +"} c #FEE8C3", +"| c #FEECD3", +"1 c #EEC5A3", +"2 c #F8FCFF", +"3 c #F1F7FF", +"4 c #E9EFFC", +"5 c #E6B76B", +"6 c #FEE600", +"7 c #FECA00", +"8 c #FEB610", +"9 c #FEC451", +"0 c #FECB93", +"a c #C15B1D", +"b c #FAFEFF", +"c c #F3F9FF", +"d c #EBEAED", +"e c #F5C40F", +"f c #FEB600", +"g c #FEAF00", +"h c #FE9610", +"i c #F98219", +"j c #AF725E", +"k c #F5F9FF", +"l c #EDC07F", +"m c #FDDE00", +"n c #FED201", +"o c #FEB001", +"p c #FEAC01", +"q c #FE871C", +"r c #E1701E", +"s c #CED1E2", +"t c #9EABC1", +"u c #F7FBFF", +"v c #F5C120", +"w c #FEBB07", +"x c #FEB306", +"y c #FE9C0E", +"z c #AF684C", +"A c #98A9C5", +"B c #FDFFFF", +"C c #F3CF9F", +"D c #FDE005", +"E c #FEDB06", +"F c #FEB70D", +"G c #FEB30C", +"H c #FE8C1C", +"I c #E06510", +"J c #B5B1C1", +"K c #B4C3DC", +"L c #AEBEDB", +"M c #8495B1", +"N c #F5B824", +"O c #FEE80D", +"P c #FEC613", +"Q c #FEB913", +"R c #FEA918", +"S c #FE8E23", +"T c #C7805B", +"U c #BBC9E0", +"V c #B9C6DF", +"W c #B5C5E0", +"X c #FBE1BF", +"Y c #FCDC15", +"Z c #FEE117", +"` c #FEBE1C", +" . c #FEBD19", +".. c #FE9929", +"+. c #E9781D", +"@. c #BFA9AC", +"#. c #C2CFE5", +"$. c #C1CDE4", +"%. c #BDCBE5", +"&. c #F8C449", +"*. c #FEEB22", +"=. c #FED123", +"-. c #FEC023", +";. c #FEB128", +">. c #FE9A34", +",. c #CD7947", +"'. c #C9D4E9", +"). c #C7D2E7", +"!. c #C6D2E6", +"~. c #C3D0E8", +"{. c #FDEACF", +"]. c #F9D121", +"^. c #FEE72C", +"/. c #FEC42E", +"(. c #FEC32A", +"_. c #FEA938", +":. c #F59031", +"<. c #C5A5A3", +"[. c #CED9EC", +"}. c #CCD7EA", +"|. c #CBD7EA", +"1. c #C8D5EC", +"2. c #F8CE6C", +"3. c #FEED39", +"4. c #FED837", +"5. c #FEC835", +"6. c #FEBE37", +"7. c #FEA645", +"8. c #D06F31", +"9. c #D2DCEF", +"0. c #D0DBED", +"a. c #CEDAF0", +"b. c #FEF1DF", +"c. c #F9C828", +"d. c #FEEC44", +"e. c #FECE3F", +"f. c #FECA3C", +"g. c #FEB649", +"h. c #F9A247", +"i. c #C9A098", +"j. c #D9E2F3", +"k. c #D7E1F2", +"l. c #D4DEF0", +"m. c #D4DDEF", +"n. c #D2DEF2", +"o. c #F3CD87", +"p. c #FEF054", +"q. c #FEE04D", +"r. c #FECE48", +"s. c #FECA47", +"t. c #FEB258", +"u. c #D87833", +"v. c #DEE6F5", +"w. c #DDE5F4", +"x. c #DBE4F3", +"y. c #D8E1F1", +"z. c #D5E0F4", +"A. c #F2F1EF", +"B. c #FAD148", +"C. c #FEF15F", +"D. c #FED654", +"E. c #FED150", +"F. c #FEC35B", +"G. c #F9AF58", +"H. c #CC947F", +"I. c #E1E9F8", +"J. c #DDE6F4", +"K. c #DCE5F4", +"L. c #DAE4F3", +"M. c #D9E3F6", +"N. c #F6FBFF", +"O. c #F5D193", +"P. c #FDEC66", +"Q. c #FEE766", +"R. c #FED55C", +"S. c #FED259", +"T. c #FEBF6B", +"U. c #E2914A", +"V. c #E0DFE9", +"W. c #E4EBF8", +"X. c #E2EAF8", +"Y. c #DFE7F7", +"Z. c #7C8CA8", +"`. c #F9FEFF", +" + c #F8C74E", +".+ c #FEF37A", +"++ c #FEDC69", +"@+ c #FED864", +"#+ c #FECF6B", +"$+ c #FEC573", +"%+ c #CD8968", +"&+ c #E7EEFB", +"*+ c #E5ECF9", +"=+ c #E3EBF9", +"-+ c #DBE3F1", +";+ c #D2D9E9", +">+ c #CBD2E3", +",+ c #C6CFE3", +"'+ c #7786A3", +")+ c #F9FDFF", +"!+ c #F5B651", +"~+ c #FEEE86", +"{+ c #FEDC70", +"]+ c #FEDA6E", +"^+ c #FECE7D", +"/+ c #E4964E", +"(+ c #E2D8DC", +"_+ c #E3E9F6", +":+ c #D8DEED", +"<+ c #CFD7E5", +"[+ c #CCD2E2", +"}+ c #CAD1E2", +"|+ c #CAD1E1", +"1+ c #C8D1E5", +"2+ c #EEAB59", +"3+ c #FEEBCE", +"4+ c #FEE4A4", +"5+ c #FEDD8D", +"6+ c #FBD08B", +"7+ c #CB9373", +"8+ c #D7DCEA", +"9+ c #D2D8E6", +"0+ c #CFD6E5", +"a+ c #CED5E4", +"b+ c #CDD4E4", +"c+ c #C9D0E2", +"d+ c #C9D2E5", +"e+ c #E7A259", +"f+ c #F8E7D0", +"g+ c #C0856A", +"h+ c #D0D0DA", +"i+ c #D4DAE7", +"j+ c #D0D7E5", +"k+ c #CDD4E3", +"l+ c #CCD3E3", +"m+ c #F7FDFF", +"n+ c #C6966D", +"o+ c #F5DBC0", +"p+ c #B67252", +"q+ c #D3D2DB", +"r+ c #D8DDE9", +"s+ c #D5DAE8", +"t+ c #D1D8E6", +"u+ c #CBD2E2", +"v+ c #CAD2E5", +"w+ c #936D5C", +"x+ c #978585", +"y+ c #B88571", +"z+ c #D9DFE9", +"A+ c #D8DEE9", +"B+ c #D7DCE9", +"C+ c #D5DAE7", +"D+ c #CDD3E4", +"E+ c #CCD4E7", +"F+ c #8D6050", +"G+ c #AA7A69", +"H+ c #DBE0E9", +"I+ c #D3D9E7", +"J+ c #CFD5E4", +"K+ c #D4DBEA", +"L+ c #DFE9FA", +"M+ c #F4F9FC", +"N+ c #BF968A", +"O+ c #E2E6EE", +"P+ c #DADFE9", +"Q+ c #D6DBE8", +"R+ c #D9DFEC", +"S+ c #DFE6F3", +"T+ c #E3EBF8", +"U+ c #E0E9FB", +"V+ c #F7FCFF", +"W+ c #F4F9FF", +"X+ c #F2F8FF", +"Y+ c #F0F6FF", +"Z+ c #EBF1FC", +"`+ c #E7EEFA", +" @ c #E4ECF9", +".@ c #E1E8F7", +"+@ c #E0EAFC", +"@@ c #E9F0FC", +"#@ c #F4FDFF", +". . . . . . . . . . . . . . . + ", +". @ # # # # # # # # $ % & * = - ; ", +". > # # # # # # # # , ' ) ! ~ { ] ^ / ", +". > # # # # # # # # @ % ( _ : < [ } | 1 ", +". > # # # # # # # # $ 2 3 4 5 6 7 8 9 0 a ", +". > # # # # # # # # # b c d e 6 f g h i j ", +". > # # # # # # # # # > k l m n o p q r s t ", +". > # # # # # # # # # > u v 6 w x y q z A A A ", +". > # # # # # # # # # B C D E F G H I J K L M ", +". > # # # # # # # # # # N O P Q R S T U V W M ", +". > # # # # # # # # # X Y Z ` ...+.@.#.$.%.M ", +". > # # # # # # # # # &.*.=.-.;.>.,.'.).!.~.M ", +". > # # # # # # # # {.].^./.(._.:.<.[.}.|.1.M ", +". > # # # # # # # # 2.3.4.5.6.7.8.~ 9.0.0.a.M ", +". > # # # # # # # b.c.d.e.f.g.h.i.j.k.l.m.n.M ", +". > # # # # # # B o.p.q.r.s.t.u.v.w.x.= y.z.M ", +". > # # # # # > A.B.C.D.E.F.G.H.I.v.J.K.L.M.M ", +". > # # # # # N.O.P.Q.R.S.T.U.V.W.X.Y.v.J.l.Z. ", +". > # # # # `., +.+++@+#+$+%+&+*+=+-+;+>+,+'+ ", +". > # # # # )+, !+~+{+]+^+/+(+_+:+<+[+}+|+1+'+ ", +". > # # # > `.`.2+3+4+5+6+7+8+9+0+a+b+}+c+d+'+ ", +". > # # # > `., e+| | f+g+h+i+9+j+0+k+l+>+d+'+ ", +". > # # # @ `.m+n+| o+p+q+r+s+9+t+0+a+u+l+v+'+ ", +". > # # $ b `., w+x+y+z+A+B+C+9+j+0+D+u+l+E+Z. ", +". > # # $ b `., F+G+H+z+A+r+i+I+j+0+J+K+-+L+M ", +". > # # > b , M+N+O+P+z+A+Q+i+9+R+S+T+X.! U+M ", +". > # # `.`., V+W+W+X+3 Y+Z+W.`+_ @X.X..@+@M ", +". > # # `.`., V+W+W+X+3 Y+& ) @@_ @X.X..@+@M ", +". #@# # `.`., V+W+W+X+3 Y+& ) @@_ @X.X..@+@M ", +". M M M M M M M M M M M M M M M M M M M M M M ", +" ", +" "}; +static const char * xpm_folder[] = { +"32 32 465 2", +" c None", +". c #2F69EF", +"+ c #1650E9", +"@ c #3D76F2", +"# c #5E91FD", +"$ c #104AEB", +"% c #3F7AF4", +"& c #5E93FD", +"* c #0043FF", +"= c #0541F5", +"- c #1243E3", +"; c #3776F5", +"> c #95B9FE", +", c #0047FF", +"' c #003BFF", +") c #0D3DE5", +"! c #B0B0D3", +"~ c #D6D6E9", +"{ c #C6C6E0", +"] c #AEAED1", +"^ c #2C6FF7", +"/ c #85AFFC", +"( c #0651FF", +"_ c #0046FF", +": c #0042FF", +"< c #0039FF", +"[ c #0434F3", +"} c #0D38DB", +"| c #CECEE4", +"1 c #FEFEFF", +"2 c #F9F9FC", +"3 c #E0E0EE", +"4 c #CBCBE3", +"5 c #A7AED8", +"6 c #2E74F9", +"7 c #8EB5FA", +"8 c #135FFF", +"9 c #054FFF", +"0 c #0041FF", +"a c #002DFF", +"b c #082FE3", +"c c #B8B8D8", +"d c #F0F6FF", +"e c #4687FB", +"f c #B9D3FD", +"g c #6797F2", +"h c #4E80EE", +"i c #2E68F0", +"j c #1255F7", +"k c #0040FF", +"l c #0037FF", +"m c #002BFF", +"n c #0020FB", +"o c #082BD6", +"p c #D8D8EA", +"q c #488CFD", +"r c #91BBFD", +"s c #91BCFF", +"t c #7AABFF", +"u c #6CA0FF", +"v c #5C90FB", +"w c #4C7FF3", +"x c #4172EE", +"y c #2B5AEF", +"z c #1740F5", +"A c #001CFF", +"B c #021EEB", +"C c #0524CE", +"D c #BFBFDC", +"E c #629FFF", +"F c #95BFFE", +"G c #9FC8FF", +"H c #88B6FF", +"I c #78A9FF", +"J c #6A9FFF", +"K c #6196FF", +"L c #5E92FF", +"M c #5E8EFF", +"N c #5A84FC", +"O c #5070F5", +"P c #445BEE", +"Q c #1B34F3", +"R c #031FD6", +"S c #B6B6D6", +"T c #E2E2EF", +"U c #498EFE", +"V c #C0DDFF", +"W c #97C2FF", +"X c #85B3FF", +"Y c #76A7FF", +"Z c #699CFF", +"` c #6095FF", +" . c #5E91FF", +".. c #5E8DFF", +"+. c #5E86FF", +"@. c #5E7FFF", +"#. c #4A60F1", +"$. c #0822FA", +"%. c #0018F9", +"&. c #0119CB", +"*. c #C5C5DF", +"=. c #FBFBFD", +"-. c #5495FD", +";. c #B9D8FE", +">. c #92BEFE", +",. c #82B1FE", +"'. c #73A4FE", +"). c #669AFE", +"!. c #5E92FE", +"~. c #5D90FE", +"{. c #5D8BFE", +"]. c #5E85FF", +"^. c #5A78FC", +"/. c #3249EC", +"(. c #0017FE", +"_. c #0017FF", +":. c #0017EE", +"<. c #0013C4", +"[. c #ECECF5", +"}. c #F8F8FB", +"|. c #4689FC", +"1. c #B6D6FD", +"2. c #8FBCFD", +"3. c #7FAEFD", +"4. c #6FA2FD", +"5. c #6498FD", +"6. c #5C91FD", +"7. c #5C8EFD", +"8. c #5C89FD", +"9. c #5E84FF", +"0. c #4B67F2", +"a. c #1129EF", +"b. c #0016FA", +"c. c #0014DF", +"d. c #0011C0", +"e. c #CFCFE5", +"f. c #FDFDFE", +"g. c #F6F6FA", +"h. c #E7EDFA", +"i. c #4587FB", +"j. c #B3D3FD", +"k. c #8CB8FD", +"l. c #7BABFD", +"m. c #6D9FFD", +"n. c #6196FD", +"o. c #5B90FD", +"p. c #5B8DFD", +"q. c #5A80FC", +"r. c #304FEB", +"s. c #0017E3", +"t. c #0017F1", +"u. c #0019FF", +"v. c #4157DE", +"w. c #BBBBD9", +"x. c #F3F3F9", +"y. c #E4EBF9", +"z. c #98BFFC", +"A. c #9AC4FC", +"B. c #88B6FC", +"C. c #78A8FC", +"D. c #6A9CFC", +"E. c #5F93FC", +"F. c #5A8EFC", +"G. c #5A8CFC", +"H. c #5E89FF", +"I. c #4F72F5", +"J. c #1E46F4", +"K. c #1139F9", +"L. c #0828F1", +"M. c #0017E7", +"N. c #0019EF", +"O. c #A6B8FE", +"P. c #4A5DD8", +"Q. c #F1F1F7", +"R. c #E2E8F7", +"S. c #468BFD", +"T. c #97C0FD", +"U. c #AED2FB", +"V. c #96C0FB", +"W. c #85B2FB", +"X. c #75A6FB", +"Y. c #679AFB", +"Z. c #5D91FB", +"`. c #598DFB", +" + c #5C8CFD", +".+ c #5C87FD", +"++ c #395FEE", +"@+ c #153FF8", +"#+ c #1640FF", +"$+ c #133DFF", +"%+ c #0B39FD", +"&+ c #8EA6FA", +"*+ c #FCFCFE", +"=+ c #1F34CC", +"-+ c #C2C2DD", +";+ c #F0F0F7", +">+ c #EEEEF6", +",+ c #E0E6F6", +"'+ c #478CFD", +")+ c #9BC4FD", +"!+ c #BDDEFB", +"~+ c #A6CCFB", +"{+ c #92BDFB", +"]+ c #81AFFB", +"^+ c #72A2FB", +"/+ c #6598FB", +"(+ c #5B8FFB", +"_+ c #588CFB", +":+ c #5D8DFE", +"<+ c #5078F5", +"[+ c #2551F3", +"}+ c #1541FB", +"|+ c #113FFF", +"1+ c #0B3CFF", +"2+ c #557CFE", +"3+ c #FCFCFD", +"4+ c #E8EBFA", +"5+ c #1328C8", +"6+ c #EBEBF4", +"7+ c #468CFD", +"8+ c #A1C8FE", +"9+ c #D1ECFB", +"0+ c #B5D8FA", +"a+ c #A1C9FA", +"b+ c #8FB9FA", +"c+ c #7DABFA", +"d+ c #6EA0FA", +"e+ c #6295FA", +"f+ c #588DFA", +"g+ c #5A8DFC", +"h+ c #5B8BFE", +"i+ c #3964F0", +"j+ c #1146F9", +"k+ c #0D40FE", +"l+ c #0B3DFF", +"m+ c #F9F9FD", +"n+ c #CFD0F1", +"o+ c #091CC2", +"p+ c #C8C8E1", +"q+ c #E9E9F3", +"r+ c #E8E8F3", +"s+ c #3D87FF", +"t+ c #EDF9FD", +"u+ c #D5EBFB", +"v+ c #BDD8FB", +"w+ c #A3C6FB", +"x+ c #8EB6FB", +"y+ c #7BA7FB", +"z+ c #6999FB", +"A+ c #5A8DFB", +"B+ c #4E83FB", +"C+ c #4980FE", +"D+ c #396DFA", +"E+ c #1C53F7", +"F+ c #0F46FD", +"G+ c #0C3FFF", +"H+ c #4872FE", +"I+ c #F8F8FC", +"J+ c #F8F8FD", +"K+ c #D8DBF5", +"L+ c #1528C6", +"M+ c #F7F7FB", +"N+ c #E7E7F2", +"O+ c #E6E6F1", +"P+ c #73A6F9", +"Q+ c #A1C6FD", +"R+ c #D1E7FB", +"S+ c #B8D5FB", +"T+ c #A1C3FB", +"U+ c #8CB2FB", +"V+ c #78A3FB", +"W+ c #6695FB", +"X+ c #5688FB", +"Y+ c #4B81FD", +"Z+ c #477CFF", +"`+ c #2F63F5", +" @ c #134DFA", +".@ c #1046FF", +"+@ c #2E5DFE", +"@@ c #E4E9FB", +"#@ c #F6F6FB", +"$@ c #F7F7FC", +"%@ c #E8E8F7", +"&@ c #283ACB", +"*@ c #EDEDF5", +"=@ c #E3E3F0", +"-@ c #D5DCF1", +";@ c #4586FB", +">@ c #CEE2FC", +",@ c #B3D1FB", +"'@ c #9EC0FB", +")@ c #88B0FB", +"!@ c #75A1FB", +"~@ c #6392FB", +"{@ c #5386FB", +"]@ c #4C82FE", +"^@ c #3F75FB", +"/@ c #225BF7", +"(@ c #134DFC", +"_@ c #3163FE", +":@ c #E3E7FB", +"<@ c #F5F5FB", +"[@ c #F3F3FB", +"}@ c #394BD0", +"|@ c #C3C3DE", +"1@ c #C0C0DC", +"2@ c #D7D7E9", +"3@ c #7DA9F7", +"4@ c #82ACFA", +"5@ c #B5D1FA", +"6@ c #99BDFA", +"7@ c #84ACFA", +"8@ c #729EFA", +"9@ c #6090FA", +"0@ c #5286FB", +"a@ c #4C82FF", +"b@ c #366AF6", +"c@ c #1954F9", +"d@ c #1D57FE", +"e@ c #E1E6FA", +"f@ c #F2F2F9", +"g@ c #F2F2FA", +"h@ c #F3F3FA", +"i@ c #3F52D3", +"j@ c #3572E7", +"k@ c #B3BFE6", +"l@ c #C3C5E2", +"m@ c #D2D2E7", +"n@ c #417CF5", +"o@ c #B9D2FB", +"p@ c #98BDFB", +"q@ c #81AAFA", +"r@ c #6D9BFA", +"s@ c #5D8EFA", +"t@ c #5387FD", +"u@ c #457AFB", +"v@ c #2862F7", +"w@ c #225DFB", +"x@ c #BFCFF9", +"y@ c #F0F0F9", +"z@ c #F1F1F9", +"A@ c #7884E0", +"B@ c #2470FA", +"C@ c #CADBF8", +"D@ c #D0DBF3", +"E@ c #BCCBED", +"F@ c #B5C3E9", +"G@ c #B5BEE3", +"H@ c #C8CAE3", +"I@ c #A0B3E9", +"J@ c #4A7FF3", +"K@ c #B1CFFF", +"L@ c #86B0FF", +"M@ c #709FFD", +"N@ c #5F90FD", +"O@ c #5388FF", +"P@ c #3C72F7", +"Q@ c #2864F9", +"R@ c #BFCEF8", +"S@ c #EDEDF7", +"T@ c #EDEDF8", +"U@ c #EEEEF8", +"V@ c #818DE3", +"W@ c #2776FF", +"X@ c #A2C6FE", +"Y@ c #F0F7FF", +"Z@ c #E2EEFF", +"`@ c #D5E7FF", +" # c #C0D7F9", +".# c #AEC8F4", +"+# c #9CBBF0", +"@# c #9AB5E9", +"## c #4A7BEB", +"$# c #80A4F5", +"%# c #81A9F9", +"&# c #6B9AFB", +"*# c #6092FF", +"=# c #4E83FC", +"-# c #2E68F7", +";# c #A2BBF7", +"># c #E9E9F7", +",# c #EBEBF7", +"'# c #ECECF7", +")# c #959FE7", +"!# c #327FFE", +"~# c #86B3FD", +"{# c #E1EDFE", +"]# c #C9E0FF", +"^# c #BCD8FF", +"/# c #AFD1FF", +"(# c #9FC5FB", +"_# c #85B0F6", +":# c #275EEB", +"<# c #90B0F7", +"[# c #5387F8", +"}# c #497DF6", +"|# c #4377F6", +"1# c #99B5F6", +"2# c #E7E7F5", +"3# c #E8E8F6", +"4# c #B9BFEF", +"5# c #081CC3", +"6# c #2D70F7", +"7# c #7AA6F9", +"8# c #CADEFE", +"9# c #A2CAFF", +"0# c #96C2FF", +"a# c #72A4FA", +"b# c #2F5EE7", +"c# c #76A2FB", +"d# c #3875FB", +"e# c #8DACF7", +"f# c #E3E3F4", +"g# c #E4E4F4", +"h# c #E4E4F5", +"i# c #E6E6F5", +"j# c #BEC4F1", +"k# c #081CC4", +"l# c #2763EF", +"m# c #6D99F5", +"n# c #B3D1FD", +"o# c #89BBFF", +"p# c #5286F3", +"q# c #345FE5", +"r# c #8CB0FB", +"s# c #E1E1F3", +"t# c #E2E2F3", +"u# c #E2E4F7", +"v# c #081DC4", +"w# c #2156E8", +"x# c #618CF1", +"y# c #9CC3FD", +"z# c #7FB3FF", +"A# c #3567EB", +"B# c #5675E5", +"C# c #DEDEF2", +"D# c #E0E0F2", +"E# c #E3E6F8", +"F# c #1E34CC", +"G# c #1B49E1", +"H# c #5580EE", +"I# c #87B5FC", +"J# c #73ACFF", +"K# c #2958E5", +"L# c #7D93E9", +"M# c #DEDEF1", +"N# c #E4E7F9", +"O# c #1F35CD", +"P# c #163CDA", +"Q# c #4973E9", +"R# c #73A8FC", +"S# c #6CA7FF", +"T# c #143AD9", +"U# c #8C9CE9", +"V# c #3C52D6", +"W# c #0012C0", +"X# c #1130D2", +"Y# c #4067E5", +"Z# c #6095F8", +"`# c #1032D4", +" $ c #2F48D5", +".$ c #0014C2", +"+$ c #0C25CA", +"@$ c #0D2CD0", +"#$ c #0117C5", +" . + ", +" @ # $ ", +" % & * = - ", +" ; > , * ' ) ", +" ! ~ { ] ^ / ( _ : < [ } ", +" | 1 1 2 3 4 5 6 7 8 9 _ 0 < a b ", +" c 2 1 1 1 1 d e f g h i j k l m n o ", +" p 1 1 1 1 d q r s t u v w x y z A B C ", +" D 2 1 1 1 1 E F G H I J K L M N O P Q R ", +" S T 1 1 1 1 1 U V W X Y Z ` ...+.@.#.$.%.&. ", +" *.1 =.=.=.=.=.-.;.>.,.'.).!.~.{.].^./.(._.:.<. ", +" c [.=.}.}.}.}.}.|.1.2.3.4.5.6.7.8.9.0.a.b._._.c.d. ", +" e.f.g.g.g.g.g.h.i.j.k.l.m.n.o.p.8.q.r.s.t._._.u.v.d. ", +" w.g.g.x.x.x.x.y.i.z.A.B.C.D.E.F.G.H.I.J.K.L.M.N.O.f.P. ", +" p =.Q.Q.Q.Q.R.S.T.U.V.W.X.Y.Z.`. +.+++@+#+$+%+&+*+f.f.=+ ", +" -+=.;+>+>+>+,+'+)+!+~+{+]+^+/+(+_+:+<+[+}+|+1+2+=.3+3+3+4+5+", +" T g.6+6+6+6+7+8+9+0+a+b+c+d+e+f+g+h+i+j+k+l+2+m+m+=.=.=.n+o+", +" p+f.q+r+r+r+r+s+t+u+v+w+x+y+z+A+B+C+D+E+F+G+H+I+I+J+J+m+K+L+ ", +"-+6+M+N+O+O+O+O+P+Q+R+S+T+U+V+W+X+Y+Z+`+ @.@+@@@#@M+$@$@%@&@ ", +"{ ;+1 1 g.*@O+=@-@;@>@,@'@)@!@~@{@]@^@/@(@_@:@<@<@<@#@[@}@d. ", +" |@1@2@6+=.1 2 ;+3@4@5@6@7@8@9@0@a@b@c@d@e@f@g@g@h@g@i@d. ", +" j@k@l@m@T g.1 n@o@p@q@r@s@t@u@v@w@x@y@y@z@z@z@A@d. ", +" B@C@D@E@F@G@H@I@J@K@L@M@N@O@P@Q@R@S@T@T@U@f@V@d. ", +" W@X@Y@Z@`@ #.#+#@###$#%#&#*#=#-#;#>#,#,#'#U@)#d. ", +" !#~#{#Z@`@]#^#/#(#_#:#<#[#}#|#1#2#2#3#3#'#4#5# ", +" 6#7#8#]#^#/#9#0#a#b#c#d#e#f#g#h#i#>#j#k# ", +" l#m#n#/#9#0#o#p#q#r#s#s#t#t#g#u#v# ", +" w#x#y#0#o#z#A#B#t#C#D#t#E#F# ", +" G#H#I#z#J#K#L#M#C#N#O# ", +" P#Q#R#S#T#U#z@V#W# ", +" X#Y#Z#`# $.$ ", +" +$@$#$ "}; + +static const char * xpm_images[] = { +"32 32 557 2", +" c None", +". c #C4D0E5", +"+ c #9DAAC1", +"@ c #FBFFFF", +"# c #FFFFFF", +"$ c #FEFFFF", +"% c #F5FAFF", +"& c #EDF3FE", +"* c #E4EBF9", +"= c #D8E1F2", +"- c #C2D0E9", +"; c #ACB7CA", +"> c #FCFFFF", +", c #F8FDFF", +"' c #F2F7FF", +") c #EAF1FD", +"! c #E1E9F7", +"~ c #D5DFF0", +"{ c #BFCCE3", +"] c #EBF4FF", +"^ c #A6B2C6", +"/ c #EDF4FE", +"( c #E6EDFA", +"_ c #D9E2F2", +": c #C2CEE5", +"< c #F0F6FF", +"[ c #DCE7F9", +"} c #A6B2C8", +"| c #F8FCFF", +"1 c #F1F7FF", +"2 c #E9EFFC", +"3 c #DCE5F4", +"4 c #C4D0E6", +"5 c #E8EEFB", +"6 c #DBE5F9", +"7 c #A7B3C9", +"8 c #FAFEFF", +"9 c #F3F9FF", +"0 c #EBF1FD", +"a c #DFE7F6", +"b c #C6D1E5", +"c c #FDFFFF", +"d c #ECF2FD", +"e c #DEE9FB", +"f c #A9B5CA", +"g c #C3C4CD", +"h c #F3EADD", +"i c #EFD9C2", +"j c #E4C09A", +"k c #E4C29E", +"l c #E5C6A4", +"m c #F0DECC", +"n c #F5EADF", +"o c #F7EFE7", +"p c #FBF7F3", +"q c #F5F9FF", +"r c #E3EBF9", +"s c #BECBE1", +"t c #F3F5FB", +"u c #ECF2F9", +"v c #E4EBF7", +"w c #D8E1F0", +"x c #D0DCF1", +"y c #A1AEC5", +"z c #BF6300", +"A c #C1721B", +"B c #C26F14", +"C c #BD6F19", +"D c #B76B1A", +"E c #BD701D", +"F c #C0731F", +"G c #BB6E18", +"H c #B6660F", +"I c #BC7529", +"J c #D1A273", +"K c #EDDBC9", +"L c #F6F3ED", +"M c #F7FBFF", +"N c #E8EFFC", +"O c #C8D4E7", +"P c #98A9C5", +"Q c #C16601", +"R c #C6751D", +"S c #CF8C41", +"T c #D9AB7A", +"U c #CAB8A7", +"V c #B6B8C3", +"W c #B2B7CB", +"X c #C4C2CD", +"Y c #EEE6DE", +"Z c #F2E0C8", +"` c #E1C19B", +" . c #CB9355", +".. c #BC772E", +"+. c #AE600C", +"@. c #C38D57", +"#. c #E4D4C3", +"$. c #EFF3FA", +"%. c #EBF1FE", +"&. c #E5EDFA", +"*. c #D7E0F1", +"=. c #C1CEE4", +"-. c #B6C4DD", +";. c #B4C3DC", +">. c #AEBEDB", +",. c #8495B1", +"'. c #C16400", +"). c #C77416", +"!. c #D69C59", +"~. c #EFD9BB", +"{. c #E2F2FF", +"]. c #81AFEB", +"^. c #97BFF1", +"/. c #BDD8FA", +"(. c #8CABE2", +"_. c #A3B2DE", +":. c #F3F6FD", +"<. c #ECEBDB", +"[. c #D2AC7A", +"}. c #B8732C", +"|. c #A25200", +"1. c #CFB191", +"2. c #E9EDF4", +"3. c #CCD6EA", +"4. c #BECAE2", +"5. c #BBC9E0", +"6. c #B9C6DF", +"7. c #B5C5E0", +"8. c #C26400", +"9. c #CF8A37", +"0. c #ECD1A7", +"a. c #FFFFFC", +"b. c #FCFAEB", +"c. c #AFC8E2", +"d. c #57A0EE", +"e. c #8DCDFF", +"f. c #80C4FF", +"g. c #70C4FF", +"h. c #4877C8", +"i. c #C0BBD1", +"j. c #EFF3E2", +"k. c #CCDDC3", +"l. c #B7D3B6", +"m. c #C5E6D6", +"n. c #D5CDAE", +"o. c #C28A4B", +"p. c #9E5103", +"q. c #C5A280", +"r. c #E6ECF8", +"s. c #D5DFEF", +"t. c #C7D3E8", +"u. c #C5D1E6", +"v. c #C2CFE5", +"w. c #C1CDE4", +"x. c #BDCBE5", +"y. c #D18C3A", +"z. c #EED3A5", +"A. c #F3E2C1", +"B. c #F1DBB3", +"C. c #FBF1D0", +"D. c #F9F7DF", +"E. c #8EB2D8", +"F. c #137DF3", +"G. c #2296FF", +"H. c #178EFF", +"I. c #0089FF", +"J. c #0A5BCC", +"K. c #BCB5C4", +"L. c #A5C889", +"M. c #80BE7F", +"N. c #ABD9AD", +"O. c #9ACE9C", +"P. c #8CC38E", +"Q. c #EAEBD3", +"R. c #C38D51", +"S. c #9A4F01", +"T. c #C1A996", +"U. c #D0DAED", +"V. c #CCD7EA", +"W. c #C9D4E9", +"X. c #C7D2E7", +"Y. c #C6D2E6", +"Z. c #C3D0E8", +"`. c #CB7F25", +" + c #E0B373", +".+ c #D08E40", +"++ c #BE6807", +"@+ c #C17117", +"#+ c #D49C55", +"$+ c #F6E3AC", +"%+ c #C2C9CD", +"&+ c #0F58CD", +"*+ c #007AFC", +"=+ c #0C8DFF", +"-+ c #0061E8", +";+ c #4C67B4", +">+ c #C7B6A1", +",+ c #75C765", +"'+ c #6CDC70", +")+ c #7DE47D", +"!+ c #75E574", +"~+ c #34B638", +"{+ c #B6CC94", +"]+ c #FFEAC5", +"^+ c #B57329", +"/+ c #954E07", +"(+ c #CBCCD2", +"_+ c #D0DBED", +":+ c #CED9EC", +"<+ c #CBD7EA", +"[+ c #C8D5EC", +"}+ c #C06500", +"|+ c #C16907", +"1+ c #EBCA8C", +"2+ c #BE6809", +"3+ c #D49648", +"4+ c #F4EFCA", +"5+ c #9A9EAE", +"6+ c #4F7CC4", +"7+ c #467DCC", +"8+ c #4D61A6", +"9+ c #C7B0A7", +"0+ c #F5D9A6", +"a+ c #4DBC3D", +"b+ c #15CB18", +"c+ c #17CD17", +"d+ c #06CC05", +"e+ c #009F00", +"f+ c #9DB66A", +"g+ c #FEE3B4", +"h+ c #EABE7D", +"i+ c #974E03", +"j+ c #AD8763", +"k+ c #D2DCEF", +"l+ c #CEDAF0", +"m+ c #BF6401", +"n+ c #CF8C34", +"o+ c #FFF6BF", +"p+ c #C77C22", +"q+ c #B15C04", +"r+ c #DBA75B", +"s+ c #FFF7B9", +"t+ c #FFE7A6", +"u+ c #D9BB94", +"v+ c #BA9987", +"w+ c #E4C294", +"x+ c #FFE7A3", +"y+ c #FEDEA1", +"z+ c #609B38", +"A+ c #00A502", +"B+ c #07CC10", +"C+ c #00C009", +"D+ c #118A0C", +"E+ c #CBBF75", +"F+ c #FDD493", +"G+ c #FFDF9B", +"H+ c #B06714", +"I+ c #93500E", +"J+ c #D8E0F0", +"K+ c #D7E1F2", +"L+ c #D4DEF0", +"M+ c #D4DDEF", +"N+ c #D2DEF2", +"O+ c #BD6402", +"P+ c #E6BC6F", +"Q+ c #FFF4B0", +"R+ c #F2D48A", +"S+ c #D9A14C", +"T+ c #CD8A33", +"U+ c #CF903A", +"V+ c #E1B160", +"W+ c #FBDA8F", +"X+ c #FFE197", +"Y+ c #FFDF92", +"Z+ c #FFE391", +"`+ c #FFE58F", +" @ c #FFDE8B", +".@ c #FFD687", +"+@ c #FFD98B", +"@@ c #D7BC6E", +"#@ c #87A946", +"$@ c #5AAC38", +"%@ c #64A938", +"&@ c #A9AD4E", +"*@ c #FED078", +"=@ c #FFCE78", +"-@ c #FFCD7C", +";@ c #D28B30", +">@ c #8B4500", +",@ c #CFCBCC", +"'@ c #DBE4F3", +")@ c #D8E1F1", +"!@ c #D5E0F4", +"~@ c #BA6202", +"{@ c #E4B763", +"]@ c #FFF4A4", +"^@ c #FFED9C", +"/@ c #FFEC9C", +"(@ c #FAD983", +"_@ c #FEDC86", +":@ c #FFE791", +"<@ c #FFDB83", +"[@ c #FFD67C", +"}@ c #FFD47A", +"|@ c #FFD277", +"1@ c #FFD074", +"2@ c #FFCE70", +"3@ c #FFCB6D", +"4@ c #FFC869", +"5@ c #FFCC6D", +"6@ c #FFC367", +"7@ c #DDB654", +"8@ c #E89F49", +"9@ c #F99056", +"0@ c #EA8752", +"a@ c #F29E4A", +"b@ c #FFBF58", +"c@ c #E49832", +"d@ c #894300", +"e@ c #C7BBB4", +"f@ c #DDE6F4", +"g@ c #DAE4F3", +"h@ c #D9E3F6", +"i@ c #B76001", +"j@ c #C37A1D", +"k@ c #F3D27A", +"l@ c #FFF197", +"m@ c #FFE68A", +"n@ c #FFDF82", +"o@ c #FFDA7B", +"p@ c #FFD473", +"q@ c #FFD16E", +"r@ c #FFCF69", +"s@ c #FFCB64", +"t@ c #FFC860", +"u@ c #FFC55B", +"v@ c #FFC356", +"w@ c #FFC052", +"x@ c #FFBD4E", +"y@ c #FFBA4A", +"z@ c #FFBD49", +"A@ c #FE9D39", +"B@ c #F6916A", +"C@ c #F3A19A", +"D@ c #EFA6A2", +"E@ c #EB9C88", +"F@ c #F59B3D", +"G@ c #E58F1E", +"H@ c #864300", +"I@ c #CBC0BA", +"J@ c #DFE7F7", +"K@ c #DEE6F5", +"L@ c #DBE5F7", +"M@ c #B15B00", +"N@ c #C0771B", +"O@ c #D1953A", +"P@ c #E7B559", +"Q@ c #FFD979", +"R@ c #FFDC79", +"S@ c #FFCF6A", +"T@ c #FFCC64", +"U@ c #FFC95F", +"V@ c #FFC559", +"W@ c #FFC253", +"X@ c #FFBF4E", +"Y@ c #FFBD48", +"Z@ c #FFB942", +"`@ c #FFB53E", +" # c #FFB238", +".# c #FFB832", +"+# c #EE6924", +"@# c #F77471", +"## c #FF9498", +"$# c #FF9698", +"%# c #F96971", +"&# c #D7471C", +"*# c #E1820A", +"=# c #844100", +"-# c #C9BDB6", +";# c #E2EAF8", +"># c #E0E7F6", +",# c #DCE6F8", +"'# c #AB5600", +")# c #B4670F", +"!# c #C47E25", +"~# c #E5AC4C", +"{# c #FFD76D", +"]# c #FFCA60", +"^# c #FFBF4D", +"/# c #FFBC48", +"(# c #FFB842", +"_# c #FFB43C", +":# c #FFB036", +"<# c #FFAD30", +"[# c #FFB72B", +"}# c #E9541C", +"|# c #FB2725", +"1# c #FE2526", +"2# c #F91B1B", +"3# c #FF0D0D", +"4# c #C41803", +"5# c #C86C01", +"6# c #823F00", +"7# c #D7D6D9", +"8# c #E2E9F7", +"9# c #E0E8F7", +"0# c #E0E8F6", +"a# c #DEE8FA", +"b# c #A35100", +"c# c #AC5F0A", +"d# c #CF8C2D", +"e# c #FFC959", +"f# c #FFC252", +"g# c #FFBD4B", +"h# c #FFBA45", +"i# c #FFB740", +"j# c #FFB43A", +"k# c #FFB034", +"l# c #FFAC2F", +"m# c #FFA929", +"n# c #FFB125", +"o# c #E05F11", +"p# c #E50C0B", +"q# c #FF0E14", +"r# c #FF1014", +"s# c #E4000A", +"t# c #D14301", +"u# c #A45600", +"v# c #8C531C", +"w# c #E3EBF7", +"x# c #DFE9FA", +"y# c #A25403", +"z# c #D58F2C", +"A# c #FFC650", +"B# c #FFB844", +"C# c #FFB63E", +"D# c #FFB339", +"E# c #FFB033", +"F# c #FFAB2D", +"G# c #FFA828", +"H# c #FFA522", +"I# c #FFA31C", +"J# c #F89A15", +"K# c #D84A08", +"L# c #D22814", +"M# c #D02518", +"N# c #C02D06", +"O# c #E77A01", +"P# c #874400", +"Q# c #A47B55", +"R# c #E3EBF8", +"S# c #E1E9F8", +"T# c #AA5F0A", +"U# c #E69F32", +"V# c #FFBC41", +"W# c #FFB237", +"X# c #FFAE32", +"Y# c #FFAA2C", +"Z# c #FFA726", +"`# c #FFA421", +" $ c #FFA11B", +".$ c #FF9D15", +"+$ c #FF9D0F", +"@$ c #F88E07", +"#$ c #F48105", +"$$ c #F38005", +"%$ c #F68A02", +"&$ c #B96400", +"*$ c #D2C9C6", +"=$ c #E4ECF9", +"-$ c #E0E9FB", +";$ c #954A00", +">$ c #BA6E13", +",$ c #FEB036", +"'$ c #FFAF31", +")$ c #FFAA2B", +"!$ c #FFA625", +"~$ c #FFA31F", +"{$ c #FFA01A", +"]$ c #FF9D14", +"^$ c #FF990E", +"/$ c #FF9607", +"($ c #FF9404", +"_$ c #FF9402", +":$ c #FF9802", +"<$ c #EA8501", +"[$ c #8C4600", +"}$ c #A0744C", +"|$ c #E6ECF7", +"1$ c #E3EAF9", +"2$ c #9A5309", +"3$ c #D1821A", +"4$ c #FFB22C", +"5$ c #FFA723", +"6$ c #FFA21D", +"7$ c #FF9F17", +"8$ c #FF9C12", +"9$ c #FF980C", +"0$ c #FF9506", +"a$ c #FF9202", +"b$ c #FF9602", +"c$ c #ED8701", +"d$ c #934B00", +"e$ c #884C12", +"f$ c #DCD9DA", +"g$ c #E7EEFA", +"h$ c #E3EAF8", +"i$ c #AD9480", +"j$ c #974F03", +"k$ c #C67610", +"l$ c #FDA01A", +"m$ c #FFA316", +"n$ c #FF9D10", +"o$ c #FF990A", +"p$ c #FF9505", +"q$ c #FF9302", +"r$ c #FF9502", +"s$ c #FF9601", +"t$ c #D77901", +"u$ c #904900", +"v$ c #803F00", +"w$ c #C9B9AD", +"x$ c #E8EFFA", +"y$ c #C2CADB", +"z$ c #C6A583", +"A$ c #8D4803", +"B$ c #924B02", +"C$ c #B06005", +"D$ c #CA7205", +"E$ c #DE7E02", +"F$ c #E78301", +"G$ c #E38001", +"H$ c #CB7000", +"I$ c #994F00", +"J$ c #854100", +"K$ c #8E551E", +"L$ c #D9D2CF", +"M$ c #E9EFFA", +"N$ c #E9F0FC", +"O$ c #E1E8F7", +"P$ c #E0EAFC", +"Q$ c #FBFDFC", +"R$ c #F0E6DD", +"S$ c #C3A07E", +"T$ c #A2703E", +"U$ c #8A490B", +"V$ c #834000", +"W$ c #834100", +"X$ c #945F2C", +"Y$ c #C9B5A3", +"Z$ c #EBEDF3", +"`$ c #EDF2FD", +" % c #F4FDFF", +".% c #F9FEFF", +"+% c #F7FCFF", +"@% c #F4F9FF", +"#% c #F2F8FF", +" ", +" . . . . . . . . . . . . . . . + ", +" . @ # # # # # # # # $ % & * = - ; ", +" . > # # # # # # # # , ' ) ! ~ { ] ^ ", +" . > # # # # # # # # @ % / ( _ : < [ } ", +" . > # # # # # # # # $ | 1 2 3 4 # 5 6 7 ", +" . > # # # # # # # # # 8 9 0 a b # c d e f ", +" g h i j k l m n o p # > q & r s t u v w x y ", +" z A B C D E F G H I J K L M < N O P P P P P P P ", +" Q R S T U V W X Y Z ` ...+.@.#.$.%.&.! *.=.-.;.>.,.", +" '.).!.~.# {.].^./.(._.:.# # <.[.}.|.1.2.&.a 3.4.5.6.7.,.", +" 8.9.0.# a.b.c.d.e.f.g.h.i.j.k.l.m.n.o.p.q.r.s.t.u.v.w.x.,.", +" '.y.z.A.B.C.D.E.F.G.H.I.J.K.L.M.N.O.P.Q.R.S.T.U.V.W.X.Y.Z.,.", +" Q `. +.+++@+#+$+%+&+*+=+-+;+>+,+'+)+!+~+{+]+^+/+(+_+:+V.<+[+,.", +"}+|+1+2+ 3+4+5+6+7+8+9+0+a+b+c+d+e+f+g+h+i+j+~ k+_+_+l+,.", +"m+n+o+p+ q+r+s+t+u+v+w+x+y+z+A+B+C+D+E+F+G+H+I+J+K+L+M+N+,.", +"O+P+Q+R+S+T+U+V+W+X+Y+Z+`+ @.@+@@@#@$@%@&@*@=@-@;@>@,@'@= )@!@,.", +"~@{@]@^@/@(@_@:@<@[@}@|@1@2@3@4@5@6@7@8@9@0@a@b@c@d@e@f@3 g@h@,.", +"i@j@k@l@m@n@o@p@q@r@s@t@u@v@w@x@y@z@A@B@C@D@E@F@G@H@I@J@K@f@L@,.", +" M@N@O@P@Q@R@S@T@U@V@W@X@Y@Z@`@ #.#+#@###$#%#&#*#=#-#;#>#a ,#,.", +" '#)#!#~#{#]#V@W@^#/#(#_#:#<#[#}#|#1#2#3#4#5#6#7#8#9#0#a#,.", +" b#c#d#e#f#g#h#i#j#k#l#m#n#o#p#q#r#s#t#u#v#w#r 9#J@x#,.", +" y#z#A#B#C#D#E#F#G#H#I#J#K#L#M#N#O#P#Q#( R#;#S#x#,.", +" T#U#V#W#X#Y#Z#`# $.$+$@$#$$$%$&$6#*$( =$! ;#-$,.", +" ;$>$,$'$)$!$~${$]$^$/$($_$:$<$[$}$|$( 1$! ;#-$,.", +" 2$3$4$5$6$7$8$9$0$a$a$b$c$d$e$f$g$( h$;#;#x#,.", +" i$j$k$l$m$n$o$p$q$r$s$t$u$v$w$x$g$( R#;#! -$,.", +" y$z$A$B$C$D$E$F$G$H$I$J$K$L$M$N$( =$;#;#O$P$,.", +" . Q$R$S$T$U$V$W$V$V$X$Y$Z$`$) N$( =$;#;#O$P$,.", +" . %# # .%.%, +%@%@%#%1 < & ) N$( =$;#;#O$P$,.", +" . ,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.", +" "}; + +#endif diff --git a/ksquirrel/sq_imageloader.cpp b/ksquirrel/sq_imageloader.cpp new file mode 100644 index 0000000..642c4c2 --- /dev/null +++ b/ksquirrel/sq_imageloader.cpp @@ -0,0 +1,261 @@ +/*************************************************************************** + sq_imageloader.cpp - description + ------------------- + begin : Tue Sep 20 2005 + copyright : (C) 2005 by Baryshev Dmitry + email : ksquirrel.iv@gmail.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include +#include +#include +#include + +#include "sq_imageloader.h" +#include "sq_libraryhandler.h" + +#include +#include +#include +#include + +SQ_ImageLoader * SQ_ImageLoader::m_instance = 0; + +SQ_ImageLoader::SQ_ImageLoader(QObject *parent) : QObject(parent), m_errors(0) +{ + m_instance = this; + + m_image = 0; + dumbscan = 0; + finfo = new fmt_info; +} + +SQ_ImageLoader::~SQ_ImageLoader() +{ + delete finfo; + + if(dumbscan) free(dumbscan); + if(m_image) free(m_image); +} + +/* + * Try to determine image dimensions. + */ +bool SQ_ImageLoader::tasteImage(const QString &path, int *w, int *h, SQ_LIBRARY *_lib) +{ + SQ_LIBRARY *lib; + int res; + fmt_codec_base *codeK; + + // determine library for file + lib = _lib ? _lib : SQ_LibraryHandler::instance()->libraryForFile(path); + + if(!lib) + return false; + + // determine codec + codeK = lib->codec_il; + + if(!codeK) + return false; + + // init... + res = codeK->read_init(QString(QFile::encodeName(path))); + + // error in init()! + if(res != SQE_OK) + { + codeK->read_close(); + return false; + } + + // advance to next page + res = codeK->read_next(); + + if(res != SQE_OK) + { + codeK->read_close(); + return false; + } + else + { + fmt_image *image; + + image = codeK->image(0); + *w = image->w; + *h = image->h; + codeK->read_close(); + + return true; + } +} + +/* + * Try to load image and store a pointer to decoded image data in m_image. Aslo + * store information about the image in finfo. + */ +bool SQ_ImageLoader::loadImage(const QString &pixPath, const SQ_CodecSettings::settings &sett, bool multi, int nomorethan) +{ + SQ_LIBRARY *lib; + int res, current = 0, i, j; + RGBA *scan; + fmt_codec_base *codeK; + fmt_image *image; + + finfo->image.clear(); + finfo->meta.clear(); + +#define SQ_SAVE_INF \ + *finfo = codeK->information(); \ + codeK->read_close(); + + // reset error count + m_errors = 0; + + // determine library for file + lib = SQ_LibraryHandler::instance()->libraryForFile(pixPath); + + if(!lib) + return false; + + // determine codec + codeK = lib->codec_il; + + if(!codeK) + return false; + + if(sett != SQ_CodecSettings::None) + SQ_CodecSettings::applySettings(lib, sett); + + // init... + res = codeK->read_init(QString(QFile::encodeName(pixPath))); + + // error in init()! + if(res != SQE_OK) + { + codeK->read_close(); + return false; + } + + // read all pages in image... + while(true) + { + if(m_errors || (!multi && current) || (multi && current == nomorethan)) + break; + + // advance to next page + i = codeK->read_next(); + + // error occured while decoding first page + if(i != SQE_OK && i != SQE_NOTOK && !current) + { + codeK->read_close(); + return false; + } + else if((i != SQE_OK && i != SQE_NOTOK && current) || (i == SQE_NOTOK && current)) + break; + + image = codeK->image(current); + + // realloc memory + if(!current) + { + const int S = image->w * image->h * sizeof(RGBA); + + m_image = (RGBA *)realloc(m_image, S); + + if(!m_image) + { + codeK->read_close(); + return false; + } + + memset(m_image, 255, S); + } + else + { + dumbscan = (RGBA *)realloc(dumbscan, image->w * image->h * sizeof(RGBA)); + + if(!dumbscan) + { + SQ_SAVE_INF + return false; + } + } + + // read all passes + for(int pass = 0;pass < image->passes;pass++) + { + codeK->read_next_pass(); + + if(!current) + { + for(j = 0;j < image->h;j++) + { + scan = m_image + j * image->w; + i = codeK->read_scanline(scan); + m_errors += (i != SQE_OK); + } + } + else + { + for(j = 0;j < image->h;j++) + { + i = codeK->read_scanline(dumbscan); + + SQ_SAVE_INF + + return (i == SQE_OK); + } + } + } + + // flip decoded image, if needed + if(image->needflip && !current) + fmt_utils::flipv((char *)m_image, image->w * sizeof(RGBA), image->h); + + current++; + } + + SQ_SAVE_INF + + // all done! + return true; +} + +// Delete buffers... +void SQ_ImageLoader::cleanup(bool del) +{ + if(dumbscan) free(dumbscan); + if(del && m_image) free(m_image); + + dumbscan = 0; + m_image = 0; +} + +/* + * Return decoded image as QImage. + */ +QImage SQ_ImageLoader::image() const +{ + QImage image((unsigned char*)bits(), finfo->image[0].w, finfo->image[0].h, 32, 0, 0, QImage::LittleEndian); + + // if the image has alpha channel, let QImage know it + if(finfo->image[0].hasalpha) + image.setAlphaBuffer(true); + + return image.swapRGB(); +} diff --git a/ksquirrel/sq_imageloader.h b/ksquirrel/sq_imageloader.h new file mode 100644 index 0000000..135c4a0 --- /dev/null +++ b/ksquirrel/sq_imageloader.h @@ -0,0 +1,108 @@ +/*************************************************************************** + sq_imageloader.h - description + ------------------- + begin : Tue Sep 20 2005 + copyright : (C) 2005 by Baryshev Dmitry + email : ksquirrel.iv@gmail.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifndef SQ_IMAGELOADER_H +#define SQ_IMAGELOADER_H + +#include +#include +#include + +#include "sq_codecsettings.h" + +struct fmt_info; +struct RGBA; + +struct SQ_LIBRARY; + +/* + * SQ_ImageLoader namespace represents functions to decode images. Uses + * SQ_LibraryHandler. Used by SQ_EditBase (preview image) and SQ_ThumbnailLoadJob + * (for generating thumbnails). + */ + +class SQ_ImageLoader : public QObject +{ + public: + SQ_ImageLoader(QObject *parent); + ~SQ_ImageLoader(); + + /* + * Try to load image and store a pointer to decoded image data in m_image. Aslo + * store information about the image in finfo. + * + * If 'multi' is true, read all image pages from file. + */ + bool loadImage(const QString &path, const SQ_CodecSettings::settings &sett, bool multi = false, int nomorethan = -1); + + /* + * Try to determine image dimensions. + */ + bool tasteImage(const QString &path, int *w, int *h, SQ_LIBRARY *_lib = 0); + + /* + * Remove any previously saved data. + */ + void cleanup(bool del = true); + + /* + * Direct access to image bits... + */ + RGBA* bits() const; + + /* + * Return decoded image as QImage. + */ + QImage image() const; + + /* + * Get a pointer to structure with information + * on decoded image (number of pages, width, height...) + */ + fmt_info* info() const; + + int errors() const; + + static SQ_ImageLoader* instance() { return m_instance; } + + private: + RGBA *m_image, *dumbscan; + fmt_info *finfo; + int m_errors; + + static SQ_ImageLoader *m_instance; +}; + +inline +RGBA* SQ_ImageLoader::bits() const +{ + return m_image; +} + +inline +fmt_info* SQ_ImageLoader::info() const +{ + return finfo; +} + +inline +int SQ_ImageLoader::errors() const +{ + return m_errors; +} + +#endif diff --git a/ksquirrel/sq_imageproperties.ui b/ksquirrel/sq_imageproperties.ui new file mode 100644 index 0000000..80e92fd --- /dev/null +++ b/ksquirrel/sq_imageproperties.ui @@ -0,0 +1,969 @@ + +SQ_ImageProperties + + + SQ_ImageProperties + + + + 0 + 0 + 495 + 384 + + + + Image properties + + + true + + + + unnamed + + + + pushButton1 + + + Close + + + false + + + true + + + false + + + + + spacer1 + + + Horizontal + + + Expanding + + + + 470 + 20 + + + + + + tabWidget + + + + tab + + + File + + + + unnamed + + + + spacer12 + + + Vertical + + + Expanding + + + + 20 + 10 + + + + + + groupBox1 + + + Attributes + + + true + + + + unnamed + + + + textLabel4_2 + + + + 3 + 0 + 0 + 0 + + + + Owner: + + + + + textLabel5_2 + + + + 3 + 0 + 0 + 0 + + + + Group: + + + + + textOwner + + + + + + + + textLabel27_2 + + + + 3 + 0 + 0 + 0 + + + + Permissions: + + + AlignVCenter + + + + + textPermissions + + + + 7 + 5 + 0 + 0 + + + + + + + + + textGroup + + + + + + + + + + groupBox2 + + + Time + + + true + + + false + + + + unnamed + + + + textLabel1_2_2 + + + + 3 + 0 + 0 + 0 + + + + Created: + + + WordBreak|AlignTop + + + + + textLabel2_2_2 + + + + 3 + 0 + 0 + 0 + + + + Last read: + + + WordBreak|AlignTop + + + + + textLabel3_2_2 + + + + 3 + 0 + 0 + 0 + + + + Last modified: + + + WordBreak|AlignTop + + + + + textCreated + + + + 7 + 5 + 0 + 0 + + + + + + + + + textLastRead + + + + 7 + 5 + 0 + 0 + + + + + + + + + textLastMod + + + + 7 + 5 + 0 + 0 + + + + + + + + + + + groupBox3 + + + General + + + true + + + + unnamed + + + + textLabel2_3 + + + + 5 + 0 + 0 + 0 + + + + File: + + + + + textSize + + + + 7 + 5 + 0 + 0 + + + + + + + + + textLabel1_4 + + + + 5 + 0 + 0 + 0 + + + + Directory: + + + + + textLabel3_3 + + + + 5 + 0 + 0 + 0 + + + + Size: + + + + + lineDirectory + + + true + + + + + lineFile + + + true + + + + + + + + + tab + + + Image + + + + unnamed + + + + layout5 + + + + unnamed + + + + layout3 + + + + unnamed + + + + textLabel6_2_2_2 + + + Type: + + + AlignTop|AlignRight + + + + + textLabel11_2_2_2 + + + Number of frames: + + + AlignTop|AlignRight + + + + + textLabel23_2_2_2_2_3 + + + + 3 + 5 + 0 + 0 + + + + Current frame + + + AlignTop|AlignRight + + + + + textLabel23_2_2_2_2_4 + + + + 3 + 5 + 0 + 0 + + + + Delay: + + + AlignTop|AlignRight + + + + + textLabel7_2_2_2 + + + Dimensions: + + + AlignTop|AlignRight + + + + + textLabel8_2_2_2 + + + Bits per pixel: + + + AlignTop|AlignRight + + + + + textLabel9_2_2_2 + + + Color space: + + + AlignTop|AlignRight + + + + + textLabel10_2_2_2 + + + Compression: + + + AlignTop|AlignRight + + + + + textLabel21_2_2_2 + + + Uncompressed size: + + + AlignTop|AlignRight + + + + + textLabel23_2_2_2 + + + + 3 + 5 + 0 + 0 + + + + Compression ratio: + + + AlignTop|AlignRight + + + + + textLabel23_2_2_2_2 + + + + 3 + 5 + 0 + 0 + + + + Interlaced: + + + AlignTop|AlignRight + + + + + textLabel23_2_2_2_2_2 + + + + 3 + 5 + 0 + 0 + + + + Status: + + + AlignTop|AlignRight + + + + + spacer10 + + + Vertical + + + Expanding + + + + 210 + 16 + + + + + + + + layout4 + + + + unnamed + + + + textType + + + + 7 + 5 + 0 + 0 + + + + + + + + + textFrames + + + + 7 + 5 + 0 + 0 + + + + + + + + + textFrame + + + + + + + + textDelay + + + + + + + + textDimensions + + + + 7 + 5 + 0 + 0 + + + + + + + + + textBpp + + + + 7 + 5 + 0 + 0 + + + + + + + + + textColorModel + + + + 7 + 5 + 0 + 0 + + + + + + + + + textCompression + + + + 7 + 5 + 0 + 0 + + + + + + + + + textUncompressed + + + + 7 + 5 + 0 + 0 + + + + + + + + + textRatio + + + + 7 + 5 + 0 + 0 + + + + + + + + + textInterlaced + + + + + + + + layout1 + + + + unnamed + + + + textStatusIcon + + + + 0 + 5 + 0 + 0 + + + + + + + + + textStatus + + + + + + + + + + spacer11 + + + Vertical + + + Expanding + + + + 205 + 16 + + + + + + + + + + + + TabPage + + + Metadata + + + + unnamed + + + + + Group + + + true + + + true + + + + + Value + + + true + + + true + + + + listMeta + + + true + + + + + + + + + + pushButton1 + clicked() + SQ_ImageProperties + close() + + + listMeta + contextMenuRequested(QListViewItem*,const QPoint&,int) + SQ_ImageProperties + slotContextMenu(QListViewItem*,const QPoint&,int) + + + + tabWidget + lineDirectory + lineFile + listMeta + pushButton1 + + + qvaluevector.h + qvariant.h + qpair.h + qpixmap.h + kurl.h + kio/job.h + kfileitem.h + qstringlist.h + qfileinfo.h + kio/global.h + kpopupmenu.h + kstdaction.h + kaction.h + qapplication.h + qclipboard.h + qdir.h + sq_iconloader.h + qbuttongroup.h + klocale.h + sq_imageproperties.ui.h + + + class KPopupMenu; + class KAction; + namespace KIO { class Job; } + + + KURL url; + QWidget *kew; + QPixmap ok, error; + KPopupMenu *menu; + QListViewItem *data; + int z, exifMode; + KAction *copy, *copyentry, *copyall; + QString file; + + + slotContextMenu( QListViewItem * item, const QPoint & p, int z1 ) + slotCopyString() + slotCopyAll() + slotCopyEntry() + slotModeClicked( int id ) + slotStatResult( KIO::Job * job ) + + + init() + destroy() + setParams( QStringList & l ) + setURL( const KURL & _url ) + setFileParams() + setMetaInfo( QValueVector<QPair<QString, QString> > meta ) + setFile( const QString & _file ) + + + diff --git a/ksquirrel/sq_imageproperties.ui.h b/ksquirrel/sq_imageproperties.ui.h new file mode 100644 index 0000000..b597b84 --- /dev/null +++ b/ksquirrel/sq_imageproperties.ui.h @@ -0,0 +1,264 @@ +/**************************************************************************** +** ui.h extension file, included from the uic-generated form implementation. +** +** If you wish to add, delete or rename functions or slots use +** Qt Designer which will update this file, preserving your code. Create an +** init() function in place of a constructor, and a destroy() function in +** place of a destructor. +*****************************************************************************/ + +/* + * SQ_ImageProperties shows image properties. + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#ifdef SQ_HAVE_KEXIF +#include +#include +#include +#include "sq_config.h" +#endif + +void SQ_ImageProperties::init() +{ + menu = new KPopupMenu; + copy = KStdAction::copy(this, SLOT(slotCopyString()), 0); + copyentry = new KAction(i18n("Copy entry"), 0, this, SLOT(slotCopyEntry()), 0); + copyall = new KAction(i18n("Copy all entries"), 0, this, SLOT(slotCopyAll()), 0); + + copyentry->setIcon(copy->icon()); + copyall->setIcon(copy->icon()); + + copy->plug(menu); + copyentry->plug(menu); + copyall->plug(menu); + + ok = SQ_IconLoader::instance()->loadIcon("ok", KIcon::Desktop, 16); + error = SQ_IconLoader::instance()->loadIcon("error", KIcon::Desktop, 16); +} + +void SQ_ImageProperties::destroy() +{ +#ifdef SQ_HAVE_KEXIF + SQ_Config::instance()->setGroup("GL view"); + SQ_Config::instance()->writeEntry("exifmode", exifMode); +#endif + + delete copyall; + delete copyentry; + delete copy; + delete menu; +} + +void SQ_ImageProperties::setParams(QStringList &l) +{ + setFileParams(); + + QStringList::Iterator it = l.begin(); + textType->setText(*it); ++it; + textDimensions->setText(*it); ++it; + textBpp->setText(*it); ++it; + textColorModel->setText(*it); ++it; + textCompression->setText(*it); ++it; + textUncompressed->setText(*it); ++it; + textRatio->setText(*it); ++it; + textInterlaced->setText(*it); ++it; + int errors = (*it).toInt(); ++it; + textFrames->setText(*it); ++it; + textFrame->setText(*it); ++it; + QString s = QString::fromLatin1("%1").arg(i18n("1 error", "%n errors", errors)); + textStatus->setText((errors)?s:QString::null); + textStatusIcon->setPixmap((errors)?error:ok); + + s = QString::fromLatin1("%1%2").arg(*it).arg(i18n(" ms.")); + textDelay->setText(s); +} + +void SQ_ImageProperties::setURL(const KURL &_url) +{ + url = _url; +} + +void SQ_ImageProperties::setFileParams() +{ + KIO::Job *stjob = KIO::stat(url, false); + connect(stjob, SIGNAL(result(KIO::Job *)), this, SLOT(slotStatResult(KIO::Job *))); + +#ifdef SQ_HAVE_KEXIF + SQ_Config::instance()->setGroup("GL view"); + exifMode = SQ_Config::instance()->readNumEntry("exifmode", 0); + + QWidget *tabWidgetEXIF = new QWidget(tabWidget, "tabWidgetEXIF"); + tabWidget->addTab(tabWidgetEXIF, i18n("EXIF")); + QGridLayout *pageLayout6 = new QGridLayout(tabWidgetEXIF, 2, 1, 11, 6, "tabWidgetEXIFLayout"); + + QButtonGroup *gr = new QButtonGroup(tabWidgetEXIF, "EXIF mode"); + gr->setFrameShape(QFrame::NoFrame); + gr->setExclusive(true); + connect(gr, SIGNAL(clicked(int)), this, SLOT(slotModeClicked(int))); + + QGridLayout *pageLayoutGR = new QGridLayout(gr, 1, 3, 0, -1, "tabWidgetEXIFGRLayout"); + + QPushButton *mode1 = new QPushButton(i18n("Simple"), gr, "mode1"); + mode1->setToggleButton(true); + + QPushButton *mode2 = new QPushButton(i18n("Full"), gr, "mode2"); + mode2->setToggleButton(true); + + QSpacerItem *spacer = new QSpacerItem(15, 1, QSizePolicy::Expanding, QSizePolicy::Minimum); + + // create KEXIF widget and load metadata from file + KExifWidget *kew1 = new KExifWidget(tabWidgetEXIF); + kew1->loadFile(file); + + // hack to workaround poor libkexif API + QObjectList *ch = const_cast(kew1->children()); + for(QObjectList::iterator it = ch->begin();it != ch->end();++it) + { + if((*it)->inherits("QListView")) + { + QListView *l = dynamic_cast(*it); + QWidget *w = tabWidget->page(3); + + if(l && w && !l->childCount()) + tabWidget->changeTab(w, i18n("EXIF (no)")); + + break; + } + } + + // set proper button on + if(exifMode) + { + mode2->setOn(true); + kew1->setMode(KExifWidget::FULL); + } + else + { + mode1->setOn(true); + kew1->setMode(KExifWidget::SIMPLE); + } + + // finally, add all widgets to layouts + pageLayoutGR->addWidget(mode1, 0, 0); + pageLayoutGR->addWidget(mode2, 0, 1); + pageLayoutGR->addItem(spacer, 0, 2); + + pageLayout6->addWidget(gr, 0, 0); + pageLayout6->addWidget(kew1, 1, 0); + kew = kew1; +#endif +} + +void SQ_ImageProperties::setMetaInfo(QValueVector > meta ) +{ + QListViewItem *after = 0, *item; + + QValueVector >::iterator itEnd = meta.end(); + + for(QValueVector >::iterator it = meta.begin();it != itEnd;++it) + { + if(after) + item = new QListViewItem(listMeta, after, (*it).first+QString::fromLatin1(" "), (*it).second.replace(QChar('\n'), QChar(' '))); + else + after = item = new QListViewItem(listMeta, (*it).first+QString::fromLatin1(" "), (*it).second.replace(QChar('\n'), QChar(' '))); + + listMeta->insertItem(item); + } + + if(!listMeta->childCount()) + { + listMeta->header()->hide(); + + QWidget *w = tabWidget->page(2); + + if(w) + tabWidget->changeTab(w, i18n("Metadata (no)")); + } +} + +void SQ_ImageProperties::slotContextMenu( QListViewItem *item, const QPoint &p, int z1 ) +{ + if(item) + { + data = item; + z = z1; + menu->exec(p); + } +} + +void SQ_ImageProperties::slotCopyString() +{ + QApplication::clipboard()->setText(data->text(z), QClipboard::Clipboard); +} + +void SQ_ImageProperties::slotCopyAll() +{ + if(!data) + return; + + QString app; + QListViewItem *item = listMeta->firstChild(); + + for(;item;item = item->itemBelow()) + { + app.append(item->text(0) + "\n" + item->text(1) + "\n"); + } + + QApplication::clipboard()->setText(app, QClipboard::Clipboard); +} + +void SQ_ImageProperties::slotCopyEntry() +{ + if(!data) + return; + + QString app = data->text(0) + "\n" + data->text(1) + "\n"; + + QApplication::clipboard()->setText(app, QClipboard::Clipboard); +} + +void SQ_ImageProperties::slotModeClicked(int id) +{ +// change mode: simple or full +#ifdef SQ_HAVE_KEXIF + exifMode = id; + static_cast(kew)->setMode(id ? KExifWidget::FULL : KExifWidget::SIMPLE); +#endif +} + +void SQ_ImageProperties::slotStatResult(KIO::Job *job) +{ + if(!job->error()) + { + KIO::UDSEntry entry = static_cast(job)->statResult(); + KFileItem fi(entry, url); + + KURL t = url; + t.cd(".."); + lineDirectory->setText(t.isLocalFile() ? t.path() : t.prettyURL()); + lineFile->setText(fi.name()); + + textSize->setText(KIO::convertSize(fi.size())); + textOwner->setText(QString("%1").arg(fi.user())); + textGroup->setText(QString("%1").arg(fi.group())); + textPermissions->setText(fi.permissionsString()); + + QDateTime abs; + abs.setTime_t(fi.time(KIO::UDS_CREATION_TIME)); + textCreated->setText(abs.toString("dd/MM/yyyy hh:mm:ss")); + abs.setTime_t(fi.time(KIO::UDS_ACCESS_TIME)); + textLastRead->setText(abs.toString("dd/MM/yyyy hh:mm:ss")); + abs.setTime_t(fi.time(KIO::UDS_MODIFICATION_TIME)); + textLastMod->setText(abs.toString("dd/MM/yyyy hh:mm:ss")); + } +} + +// set local file for KEXIF +void SQ_ImageProperties::setFile(const QString &_file) +{ + file = _file; +} diff --git a/ksquirrel/sq_kipiinterface.cpp b/ksquirrel/sq_kipiinterface.cpp new file mode 100644 index 0000000..a1a47ff --- /dev/null +++ b/ksquirrel/sq_kipiinterface.cpp @@ -0,0 +1,209 @@ +/*************************************************************************** + sq_kipiinterface.cpp - description + ------------------- + begin : Feb 5 2007 + copyright : (C) 2007 by Baryshev Dmitry + email : ksquirrel.iv@gmail.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#include "sq_kipiinterface.h" + +#ifdef SQ_HAVE_KIPI + +#include +#include +#include +#include +#include +#include + +#include +#include + +#include "sq_widgetstack.h" +#include "sq_diroperator.h" +#include "sq_imagebasket.h" +#include "sq_hloptions.h" + +class SQ_KIPIImageCollection : public KIPI::ImageCollectionShared +{ + public: + SQ_KIPIImageCollection(const QString& name, const KURL::List& images) + : KIPI::ImageCollectionShared(), mName(name), mImages(images) + {} + + QString name() + { + return mName; + } + + QString comment() + { + return QString::null; + } + + KURL::List images() + { + return mImages; + } + + // FIXME: Return current URL instead + KURL uploadPath() + { + KURL url; + url.setPath("/"); + return url; + } + + QString uploadRootName() + { + return i18n("Root directory"); + } + + private: + QString mName; + KURL::List mImages; +}; + +/***************************************************************/ + +class SQ_KIPIImageInfo : public KIPI::ImageInfoShared +{ + public: + SQ_KIPIImageInfo(KIPI::Interface *interface, const KURL &url) + : KIPI::ImageInfoShared(interface, url) + {} + + QString title() + { + return _url.fileName(); + } + + QString description() + { + return QString::null; + } + + void setDescription(const QString&) + {} + + QMap attributes() + { + return QMap(); + } + + void clearAttributes() + {} + + void addAttributes(const QMap&) + {} +}; + + +/***************************************************************/ + +SQ_KIPIInterface::SQ_KIPIInterface(QWidget *parent) + : KIPI::Interface(parent, "KSquirrel KIPI Interface") +{ + connect(SQ_WidgetStack::instance()->diroperator(), SIGNAL(fileHighlighted(const KFileItem *)), + this, SLOT(slotSelectionChanged())); + + connect(SQ_WidgetStack::instance()->diroperator()->dirLister(), SIGNAL(completed(const KURL&)), + this, SLOT(slotDirectoryChanged())); +} + +SQ_KIPIInterface::~SQ_KIPIInterface() +{} + +KIPI::ImageCollection SQ_KIPIInterface::currentAlbum() +{ + KURL::List list; + + const KFileItemList *l = SQ_WidgetStack::instance()->diroperator()->view()->items(); + + if(l) + { + KFileItemListIterator it(*l); + + for( ; it.current(); ++it) + list.append(it.current()->url()); + } + + return KIPI::ImageCollection(new SQ_KIPIImageCollection(i18n("Folder content"), list)); +} + +KIPI::ImageCollection SQ_KIPIInterface::currentSelection() +{ + KURL::List list; + + const KFileItemList *l = SQ_WidgetStack::instance()->diroperator()->selectedItems(); + + if(l) + { + KFileItemListIterator it(*l); + + for( ; it.current(); ++it) + list.append(it.current()->url()); + } + + return KIPI::ImageCollection(new SQ_KIPIImageCollection(i18n("Selected images"), list)); +} + +KIPI::ImageCollection SQ_KIPIInterface::currentBasket() +{ + KURL::List list; + + KFileItemList l = SQ_ImageBasket::instance()->realItems(); + + KFileItemListIterator it(l); + + for( ; it.current(); ++it) + list.append(it.current()->url()); + + return KIPI::ImageCollection(new SQ_KIPIImageCollection(i18n("Image basket"), list)); +} + +QValueList SQ_KIPIInterface::allAlbums() +{ + QValueList list; + + list << currentAlbum() << currentSelection(); + + if(SQ_HLOptions::instance()->have_imagebasket) + list << currentBasket(); + + return list; +} + +KIPI::ImageInfo SQ_KIPIInterface::info(const KURL& url) +{ + return KIPI::ImageInfo(new SQ_KIPIImageInfo(this, url)); +} + +int SQ_KIPIInterface::features() const +{ + return KIPI::AcceptNewImages; +} + +void SQ_KIPIInterface::slotSelectionChanged() +{ + emit selectionChanged(SQ_WidgetStack::instance()->diroperator()->selectedItems()->count() > 0); +} + +void SQ_KIPIInterface::slotDirectoryChanged() +{ + emit currentAlbumChanged(SQ_WidgetStack::instance()->diroperator()->numFiles() > 0); +} + +#include "sq_kipiinterface.moc" + +#endif diff --git a/ksquirrel/sq_kipiinterface.h b/ksquirrel/sq_kipiinterface.h new file mode 100644 index 0000000..dd61067 --- /dev/null +++ b/ksquirrel/sq_kipiinterface.h @@ -0,0 +1,61 @@ +/*************************************************************************** + sq_kipiinterface.h - description + ------------------- + begin : Feb 5 2007 + copyright : (C) 2007 by Baryshev Dmitry + email : ksquirrel.iv@gmail.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifndef SQ_KIPIINTERFACE_H +#define SQ_KIPIINTERFACE_H + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#ifdef SQ_HAVE_KIPI + +#include + +class SQ_KIPIInterfacePrivate; + +class SQ_KIPIInterface : public KIPI::Interface +{ + Q_OBJECT + + public: + SQ_KIPIInterface(QWidget *parent); + ~SQ_KIPIInterface(); + + KIPI::ImageCollection currentAlbum(); + KIPI::ImageCollection currentSelection(); + KIPI::ImageCollection currentBasket(); + + QValueList allAlbums(); + KIPI::ImageInfo info(const KURL &); + int features() const; + bool addImage(const KURL &, QString &); + + private slots: + void slotSelectionChanged(); + void slotDirectoryChanged(); +}; + +inline +bool SQ_KIPIInterface::addImage(const KURL &, QString &) +{ + return true; +} + +#endif + +#endif diff --git a/ksquirrel/sq_kipimanager.cpp b/ksquirrel/sq_kipimanager.cpp new file mode 100644 index 0000000..eba5da5 --- /dev/null +++ b/ksquirrel/sq_kipimanager.cpp @@ -0,0 +1,189 @@ +/*************************************************************************** + sq_kipimanager.cpp - description + ------------------- + begin : Feb 5 2007 + copyright : (C) 2007 by Baryshev Dmitry + email : ksquirrel.iv@gmail.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#include "sq_kipimanager.h" + +#ifdef SQ_HAVE_KIPI + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include + +#include +#include +#include +#include + +#include +#include + +#include "sq_kipiinterface.h" + +SQ_ActionMenu::SQ_ActionMenu(const QString &text, QObject *parent, const char *name) + : KActionMenu(text, parent, name) +{} + +SQ_ActionMenu::SQ_ActionMenu(const QString &text, const QString &icon, QObject *parent, const char *name) + : KActionMenu(text, icon, parent, name) +{} + +SQ_ActionMenu::~SQ_ActionMenu() +{ + QValueVector::iterator itEnd = plugged.end(); + + for(QValueVector::iterator it = plugged.begin();it != itEnd;++it) + remove(*it); +} + +void SQ_ActionMenu::insert(KAction *ka, int index) +{ + KActionMenu::insert(ka, index); + + plugged.append(ka); +} + +/***********************************************************************/ + +SQ_KIPIManager::SQ_KIPIManager(QWidget *_parent, const char *name) : QObject(_parent, name), parent(_parent) +{ + kdDebug() << "+SQ_KIPIManager" << endl; + + // Create a dummy "no plugin" action + noPlugin = new KAction(i18n("No Plugins"), 0, 0, 0, (KActionCollection *)0/*actionCollection()*/, "no_plugin"); + noPlugin->setShortcutConfigurable(false); + noPlugin->setEnabled(false); + + loaded = false; + p = new KPopupMenu; + + connect(p, SIGNAL(aboutToShow()), this, SLOT(slotAboutToShow())); + + SQ_KIPIInterface *interface = new SQ_KIPIInterface(_parent); + mPluginLoader = new KIPI::PluginLoader(QStringList(), interface); + connect(mPluginLoader, SIGNAL(replug()), this, SLOT(slotReplug())); +} + +SQ_KIPIManager::~SQ_KIPIManager() +{ + kdDebug() << "-SQ_KIPIManager" << endl; + + delete mPluginLoader; + + //unplug all & delete popup menu + clearMap(); + delete p; + + delete noPlugin; +} + +void SQ_KIPIManager::loadPlugins() +{ + kdDebug() << "Loading KIPI plugins..." << endl; + + loaded = true; + mPluginLoader->loadPlugins(); + + kdDebug() << "Done" << endl; +} + +void SQ_KIPIManager::clearMap() +{ + // delete menus + for(CategoryMap::iterator it = cmenus.begin();it != cmenus.end();++it) + delete it.data(); // destructor will do all things for us + + cmenus.clear(); +} + +void SQ_KIPIManager::slotReplug() +{ + // Fill the mActions + KIPI::PluginLoader::PluginList pluginList = mPluginLoader->pluginList(); + KIPI::PluginLoader::PluginList::ConstIterator it(pluginList.begin()); + KIPI::PluginLoader::PluginList::ConstIterator itEnd(pluginList.end()); + KIPI::Plugin *plugin; + CategoryMap::iterator fnd; + + clearMap(); + + SQ_ActionMenu *menuImages = new SQ_ActionMenu(i18n("Image actions")); + SQ_ActionMenu *menuEffects = new SQ_ActionMenu(i18n("Effects")); + SQ_ActionMenu *menuTools = new SQ_ActionMenu(i18n("Tools")); + SQ_ActionMenu *menuImport = new SQ_ActionMenu(i18n("Import")); + SQ_ActionMenu *menuExport = new SQ_ActionMenu(i18n("Export")); + SQ_ActionMenu *menuBatch = new SQ_ActionMenu(i18n("Batch processing")); + SQ_ActionMenu *menuColl = new SQ_ActionMenu(i18n("Collections")); + + cmenus[KIPI::IMAGESPLUGIN] = menuImages; + cmenus[KIPI::EFFECTSPLUGIN] = menuEffects; + cmenus[KIPI::TOOLSPLUGIN] = menuTools; + cmenus[KIPI::IMPORTPLUGIN] = menuImport; + cmenus[KIPI::EXPORTPLUGIN] = menuExport; + cmenus[KIPI::BATCHPLUGIN] = menuBatch; + cmenus[KIPI::COLLECTIONSPLUGIN] = menuColl; + + for( ;it != itEnd;++it) + { + if(!(*it)->shouldLoad()) + continue; + + plugin = (*it)->plugin(); + + if (!plugin) continue; + + plugin->setup(parent); + + KActionPtrList actions = plugin->actions(); + KActionPtrList::ConstIterator actionIt = actions.begin(), end = actions.end(); + KIPI::Category category; + + for ( ;actionIt != end;++actionIt) + { + category = plugin->category(*actionIt); + + fnd = cmenus.find(category); + + if(fnd == cmenus.end()) + continue; + + fnd.data()->insert(*actionIt); + } + + plugin->actionCollection()->readShortcutSettings(); + } + + // plug + for(CategoryMap::iterator it = cmenus.begin();it != cmenus.end();++it) + { + if(!it.data()->count()) + it.data()->insert(noPlugin); + + it.data()->plug(p); + } +} + +void SQ_KIPIManager::slotAboutToShow() +{ + // load KIPI plugins on demand + if(!loaded) loadPlugins(); +} + +#include "sq_kipimanager.moc" + +#endif diff --git a/ksquirrel/sq_kipimanager.h b/ksquirrel/sq_kipimanager.h new file mode 100644 index 0000000..1ac80ab --- /dev/null +++ b/ksquirrel/sq_kipimanager.h @@ -0,0 +1,116 @@ +/*************************************************************************** + sq_kipimanager.h - description + ------------------- + begin : Feb 5 2007 + copyright : (C) 2007 by Baryshev Dmitry + email : ksquirrel.iv@gmail.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + + +#ifndef SQ_KIPIMANAGER_H +#define SQ_KIPIMANAGER_H + +#ifdef HAVE_CONFIG_H +#include +#endif + +#ifdef SQ_HAVE_KIPI + +#include +#include + +#include + +#include + +namespace KIPI { class PluginLoader; } + +class QWidget; + +class KPopupMenu; + +/* + * This subclass of KActionMenu should know which KActions + * are currently plugged in it. + */ +class SQ_ActionMenu : public KActionMenu +{ + public: + SQ_ActionMenu(const QString &text, QObject *parent = 0, const char *name = 0); + SQ_ActionMenu(const QString &text, const QString &icon, QObject *parent = 0, const char *name = 0); + + /* + * remove() all KActions currently plugged. + */ + ~SQ_ActionMenu(); + + /* + * Reimplement insert() to let us remember "ka" + */ + void insert(KAction *ka, int index = -1); + + int count() const; + + private: + // Currently plugged KActions + QValueVector plugged; +}; + +inline +int SQ_ActionMenu::count() const +{ + return plugged.count(); +} + +/* + * KIPI plugins manager. It loads KIPI plugins and creates popup + * menu with all available actions. + */ +class SQ_KIPIManager : public QObject +{ + Q_OBJECT + + public: + SQ_KIPIManager(QWidget *_parent, const char *name = 0); + ~SQ_KIPIManager(); + + KPopupMenu* popup() const; + + void loadPlugins(); + + private: + void clearMap(); + + private slots: + void slotReplug(); + void slotAboutToShow(); + + private: + typedef QMap CategoryMap; + + KIPI::PluginLoader *mPluginLoader; + CategoryMap cmenus; + KAction *noPlugin; + QWidget *parent; + KPopupMenu *p; + bool loaded; +}; + +inline +KPopupMenu* SQ_KIPIManager::popup() const +{ + return p; +} + +#endif + +#endif diff --git a/ksquirrel/sq_library.h b/ksquirrel/sq_library.h new file mode 100644 index 0000000..ac1dff3 --- /dev/null +++ b/ksquirrel/sq_library.h @@ -0,0 +1,97 @@ +/*************************************************************************** + sq_library.h - description + ------------------- + begin : 27 2005 + copyright : (C) 2005 by Baryshev Dmitry + email : ksquirrel.iv@gmail.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifndef SQ_LIBRARY_H +#define SQ_LIBRARY_H + +#include +#include +#include + +#include +#include + +class QLibrary; + +class KTempFile; + +class fmt_codec_base; + +/* + * SQ_LIBRARY represents a library. It contains all information + * needed by other classes, e.g. pointer to codec, mime image, + * version string, filter string, etc. + * + * Used by SQ_LibraryHandler. + */ + +struct SQ_LIBRARY +{ + SQ_LIBRARY() : lib(0), codec(0), codec_il(0), tmp(0), tmp_il(0) + {} + + // pointer to library + QLibrary *lib; + + // path to a library on disk + QString libpath; + + // converted regular expression + QRegExp regexp; + + // filter for a filemanager + QString filter; + + // path to config file (.ui) + QString config; + + fmt_settings settings; + + // regular expression as string + QString regexp_str; + + QString mimetype; + + bool mime_multi; + + // information on codec + QString quickinfo; + + // codec's version + QString version; + + // pointer to a codec + fmt_codec_base *codec, *codec_il; + + // 'create' and 'destroy' functions. + // should exist in library! + fmt_codec_base* (*codec_create)(); + void (*codec_destroy)(fmt_codec_base*); + + QPixmap mime; + + // options for writers. + fmt_writeoptionsabs opt; + + bool writestatic, writeanimated; + bool readable; + bool canbemultiple, needtempfile; + + KTempFile *tmp, *tmp_il; +}; + +#endif diff --git a/ksquirrel/sq_libraryhandler.cpp b/ksquirrel/sq_libraryhandler.cpp new file mode 100644 index 0000000..0e10424 --- /dev/null +++ b/ksquirrel/sq_libraryhandler.cpp @@ -0,0 +1,577 @@ +/*************************************************************************** + sq_libraryhandler.cpp - description + ------------------- + begin : Mar 5 2004 + copyright : (C) 2004 by Baryshev Dmitry + email : ksquirrel.iv@gmail.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include "sq_libraryhandler.h" +#include "sq_config.h" + +#include + +#include +#include + +static const int buffer_size = 10; + +SQ_LibraryHandler * SQ_LibraryHandler::m_instance = 0; + +// SQ_LibraryHandler +SQ_LibraryHandler::SQ_LibraryHandler(QObject *parent) + : QObject(parent), QValueVector() +{ + m_instance = this; + + kdDebug() << "+SQ_LibraryHandler" << endl; + + kconf = new KConfig("ksquirrel-codec-settings"); + + load(); +} + +SQ_LibraryHandler::~SQ_LibraryHandler() +{ + clear(); + + delete kconf; + + kdDebug() << "-SQ_LibraryHandler" << endl; +} + +/* + * Find appropriate SQ_LIBRARY by filename. If + * not found, return NULL. + */ +SQ_LIBRARY* SQ_LibraryHandler::libraryForFile(const KURL &url) +{ + KMimeType::Ptr mime = KMimeType::findByURL(url); + + iterator itEnd = end(); + + SQ_LIBRARY *l = 0; + + // go through array and compare names + for(iterator it = begin();it != itEnd;++it) + { + if((*it).mime_multi) + { + if((*it).mimetype.find(mime->name()) != -1) + { + l = &(*it); + break; + } + } + else if((*it).mimetype == mime->name()) + { + l = &(*it); + break; + } + } + +#if 0 + if(l) + kdDebug() << KStringHandler::lsqueeze(url.prettyURL()) + << "\" => " + << l->quickinfo + << endl; +#endif + + return l; +} + +SQ_LIBRARY* SQ_LibraryHandler::libraryForFile(const QString &path) +{ + KURL u; + u.setPath(path); + + return libraryForFile(u); +} + +/* + * Get all filters as one string. + */ +QString SQ_LibraryHandler::allFiltersString() const +{ + QString ret; + + const_iterator itEnd = end(); + + // construct string + for(const_iterator it = begin();it != itEnd;++it) + { + if(!(*it).filter.isEmpty()) + ret = ret + (*it).filter + ' '; + } + + return ret; +} + +QString SQ_LibraryHandler::allFiltersFileDialogString(bool r, bool allfiles) const +{ + QString ret; + + const_iterator itEnd = end(); + + // construct string + for(const_iterator it = begin();it != itEnd;++it) + { + if(!r) + if((*it).writestatic) + ret = ret + (*it).filter + '|' + (*it).quickinfo + '\n'; + else; + else if((*it).readable) + ret = ret + (*it).filter + '|' + (*it).quickinfo + '\n'; + } + + return allfiles ? (ret + "*.*|" + i18n("All files")) : ret.left(ret.length() - 1); +} + +/* + * Fill 'filters' with all found filters, and + * 'quick' with appropriate information. + */ +void SQ_LibraryHandler::allFilters(QStringList &filters, QStringList &quick) const +{ + // clear rubbish + filters.clear(); + quick.clear(); + + // no found libraries ? + if(empty()) + return; + + const_iterator itEnd = end(); + + // go through array and fill QStringLists + for(const_iterator it = begin();it != itEnd;++it) + if(!(*it).filter.isEmpty()) + { + filters.append((*it).filter); + quick.append((*it).quickinfo); + } +} + +void SQ_LibraryHandler::allWritableFilters(QStringList &filters, QStringList &quick) const +{ + // clear rubbish + filters.clear(); + quick.clear(); + + // no libraries ? + if(empty()) + return; + + const_iterator itEnd = end(); + + // go through array and fill QStringLists + for(const_iterator it = begin();it != itEnd;++it) + if((*it).writestatic && !(*it).filter.isEmpty()) + { + filters.append((*it).filter); + quick.append((*it).quickinfo); + } +} + +/* + * Remove and unload all libraries. + */ +void SQ_LibraryHandler::clear() +{ + kdDebug() << "SQ_LibraryHandler::clear()" << endl; + + iterator itEnd = end(); + + // unload libraries on clear() + for(iterator it = begin();it != itEnd;++it) + { + writeSettings(&(*it)); + + // delete temp file + if((*it).needtempfile) + { + delete (*it).tmp_il; + delete (*it).tmp; + } + + (*it).codec_destroy((*it).codec_il); + (*it).codec_destroy((*it).codec); + delete (*it).lib; + (*it).lib = 0; + } + + QValueVector::clear(); +} + +/* + * Add new libraries. + */ +void SQ_LibraryHandler::add(QStringList &foundLibraries) +{ + codec_options o; + + QStringList::iterator itEnd = foundLibraries.end(); + + for(QStringList::iterator it = foundLibraries.begin();it != itEnd;++it) + { + QFileInfo ff(*it); + + SQ_LIBRARY libtmp; + + // create QLibrary object + libtmp.lib = new QLibrary(*it); + libtmp.libpath = *it; + libtmp.lib->load(); + + // resolve create() and destroy() functions + libtmp.codec_create = (fmt_codec_base*(*)())(libtmp.lib)->resolve(QString::fromLatin1("codec_create")); + libtmp.codec_destroy = (void (*)(fmt_codec_base*))(libtmp.lib)->resolve(QString::fromLatin1("codec_destroy")); + + // couldn't resolve - corrupted library ? + if(!libtmp.codec_create || !libtmp.codec_destroy) + { + libtmp.lib->unload(); + delete libtmp.lib; + } + else + { + // create codec ! + fmt_codec_base *codeK = libtmp.codec_create(); + + // read options + codeK->options(&o); + + QString q = o.name; + + // Yet unknown library ? + if(!alreadyInMap(q)) + { + libtmp.mime = QPixmap(reinterpret_cast(o.pixmap)); + libtmp.mimetype = o.mimetype; + libtmp.mime_multi = libtmp.mimetype.find(';') != -1; + libtmp.quickinfo = q; + libtmp.filter = o.filter; + libtmp.version = o.version; + libtmp.regexp_str = o.mime; + libtmp.config = o.config; + libtmp.regexp.setPattern(libtmp.regexp_str); + libtmp.regexp.setCaseSensitive(true); + libtmp.writestatic = o.writestatic; + libtmp.writeanimated = o.writeanimated; + libtmp.readable = o.readable; + libtmp.canbemultiple = o.canbemultiple; + libtmp.needtempfile = o.needtempfile; + libtmp.tmp = 0; + + libtmp.codec_il = libtmp.codec_create(); + + if(libtmp.needtempfile) + { + libtmp.tmp = new KTempFile; + libtmp.tmp->setAutoDelete(true); + libtmp.tmp->close(); + codeK->settempfile(libtmp.tmp->name()); + + libtmp.tmp_il = new KTempFile; + libtmp.tmp_il->setAutoDelete(true); + libtmp.tmp_il->close(); + libtmp.codec_il->settempfile(libtmp.tmp_il->name()); + } + + if(libtmp.writestatic) + codeK->getwriteoptions(&libtmp.opt); + + libtmp.codec = codeK; + + readSettings(&libtmp); + + append(libtmp); + } + else // already known library + { + // destroy codec + libtmp.codec_destroy(codeK); + + // unload library + libtmp.lib->unload(); + + delete libtmp.lib; + } + } + } + + // print some information + dump(); +} + +/* + * Is library named 'quick' already been handled ? + */ +bool SQ_LibraryHandler::alreadyInMap(const QString &quick) const +{ + const_iterator itEnd = end(); + + // go through array and find 'quick' + for(const_iterator it = begin();it != itEnd;++it) + if((*it).quickinfo == quick) + return true; + + return false; +} + +/* + * Print some information on found libraries. + */ +void SQ_LibraryHandler::dump() const +{ + std::cerr << "SQ_LibraryHandler: memory dump (total " << count() << ")" << endl; + + const_iterator itEnd = end(); + + std::cerr.setf(ios::left); + + for(const_iterator it = begin();it != itEnd;++it) + { + std::cerr << std::setw(30) + << KStringHandler::csqueeze(QFileInfo((*it).libpath).fileName(), 30) + << std::setw(0) + << " [" + << KStringHandler::rsqueeze((*it).quickinfo, 45) + << "]" + << endl; + } +} + +/* + * Does any of found libraries handle given extension ? + */ +bool SQ_LibraryHandler::knownExtension(const QString &ext) +{ + iterator itEnd = end(); + + // go through array and compare extensions + for(iterator it = begin();it != itEnd;++it) + { + if((*it).filter.contains(ext, false)) + return true; + } + + return false; +} + +/* + * Find appropriate SQ_LIBRARY by its name. If + * not found, return NULL. + * + * Name is a string, returned by fmt_quickinfo() + */ +SQ_LIBRARY* SQ_LibraryHandler::libraryByName(const QString &name) +{ + SQ_LIBRARY *l; + + iterator itEnd = end(); + + // go through array and compare names + for(iterator it = begin();it != itEnd;++it) + { + l = &(*it); + + if(l->quickinfo == name) + return l; + } + + return 0; +} + +void SQ_LibraryHandler::writeSettings(SQ_LIBRARY *lib) +{ + // no config - no settings + if(lib->config.isEmpty()) + return; + + kconf->setGroup(lib->quickinfo); + + fmt_settings::iterator itEnd = lib->settings.end(); + + QString k; + + for(fmt_settings::iterator it = lib->settings.begin();it != itEnd;++it) + { + k = (*it).first; + + if((*it).second.type == settings_value::v_bool) // boolean + { + k.prepend("b"); + kconf->writeEntry(k, (*it).second.bVal); + } + else if((*it).second.type == settings_value::v_int) // integer + { + k.prepend("i"); + kconf->writeEntry(k, (*it).second.iVal); + } + else if((*it).second.type == settings_value::v_double) // double + { + k.prepend("d"); + kconf->writeEntry(k, (*it).second.dVal); + } + else // string + { + k.prepend("s"); + kconf->writeEntry(k, (*it).second.sVal); + } + } +} + +void SQ_LibraryHandler::readSettings(SQ_LIBRARY *lib) +{ + // no config - no settings + if(lib->config.isEmpty()) + return; + + QMap map = kconf->entryMap(lib->quickinfo); + + if(!map.size()) + { + lib->codec->fill_default_settings(); + lib->settings = lib->codec->settings(); + return; + } + + QMap::iterator mapEnd = map.end(); + fmt_settings &sett = lib->settings; + QString d, k; + settings_value val; + + for(QMap::iterator mapIt = map.begin();mapIt != mapEnd;++mapIt) + { + k = mapIt.key(); + d = mapIt.data(); + + if(k.startsWith(QChar('i'))) + { + val.type = settings_value::v_int; + val.iVal = d.toInt(); + } + else if(k.startsWith(QChar('d'))) + { + val.type = settings_value::v_double; + val.dVal = d.toDouble(); + } + else if(k.startsWith(QChar('b'))) + { + val.type = settings_value::v_bool; + val.bVal = (d == "true"); + } + else // all other values are treated as strings + { + val.type = settings_value::v_string; + val.sVal = d.ascii(); + } + + k = k.right(k.length() - 1); + sett[k.ascii()] = val; + } + + lib->codec->set_settings(sett); +} + +void SQ_LibraryHandler::reload() +{ + clear(); + load(); +} + +void SQ_LibraryHandler::load() +{ + QStringList libs; + + QDir dir(SQ_KLIBS, QString::null, QDir::Unsorted, QDir::Files); + + const QFileInfoList *list = dir.entryInfoList(); + + if(list) + { + QFileInfoListIterator it(*list); + QFileInfo *fi; + + while((fi = it.current()) != 0) + { + libs.append(fi->absFilePath()); + ++it; + } + } + + // just show dump, if no libs were found + add(libs); +} + +SQ_LibraryHandler::Support SQ_LibraryHandler::maybeSupported(const KURL &u, const QString &mime) const +{ + const_iterator itEnd = constEnd(); + + SQ_Config::instance()->setGroup("Main"); + bool treat = SQ_Config::instance()->readBoolEntry("treat", true); + + // we can determine mimetype by hand or use "mime" + QString mimeDet = mime.isEmpty() ? KMimeType::findByURL(u)->name() : mime; + + // mimetype by magic is not determined automatically + // for non-local urls - we may support this file type or may not + // (we don't know exactly at this moment) + if(!u.isLocalFile() && mimeDet == KMimeType::defaultMimeType()) + return (treat ? SQ_LibraryHandler::No : SQ_LibraryHandler::Maybe); + + // go through array and compare mimetype names + for(const_iterator it = constBegin();it != itEnd;++it) + { + if((*it).mime_multi) + { + if((*it).mimetype.find(mimeDet, 0, false) != -1) + return SQ_LibraryHandler::Yes; + } + else if((*it).mimetype == mimeDet) // don't waste CPU time with find() + return SQ_LibraryHandler::Yes; + } + + // we don't know about given mimetype + return SQ_LibraryHandler::No; +} + +void SQ_LibraryHandler::sync() +{ + iterator itEnd = end(); + + // unload libraries on clear() + for(iterator it = begin();it != itEnd;++it) + writeSettings(&(*it)); + + kconf->sync(); +} diff --git a/ksquirrel/sq_libraryhandler.h b/ksquirrel/sq_libraryhandler.h new file mode 100644 index 0000000..a3f34bf --- /dev/null +++ b/ksquirrel/sq_libraryhandler.h @@ -0,0 +1,128 @@ +/*************************************************************************** + sq_libraryhandler.h - description + ------------------- + begin : Mar 5 2004 + copyright : (C) 2004 by Baryshev Dmitry + email : ksquirrel.iv@gmail.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifndef SQ_LIBRARY_HANDLER_H +#define SQ_LIBRARY_HANDLER_H + +#include +#include +#include + +#include "sq_library.h" + +class QStringList; + +class KConfig; +class KURL; + +/* + * SQ_LibraryHandler is a library manager. It's the main class + * in library loading mechanizm. + */ + +class SQ_LibraryHandler : public QObject, public QValueVector +{ + public: + SQ_LibraryHandler(QObject *parent = 0); + ~SQ_LibraryHandler(); + + enum Support { Maybe = 0, Yes, No }; + + /* + * Reload libraries from disk + */ + void reload(); + + void sync(); + + Support maybeSupported(const KURL &, const QString& = QString::null) const; + + /* + * Find appropriate SQ_LIBRARY by filename. If + * not found, return NULL. + */ + SQ_LIBRARY* libraryForFile(const KURL &); + SQ_LIBRARY* libraryForFile(const QString &); + + /* + * Find appropriate SQ_LIBRARY by its name. If + * not found, return NULL. + * + * Name is a string, returned by fmt_quickinfo() + */ + SQ_LIBRARY* libraryByName(const QString &name); + + /* + * Does any of found libraries handle given extension ? + */ + bool knownExtension(const QString &ext); + + /* + * Fill 'filters' with all found filters, and + * 'quick' with appropriate information. + */ + void allFilters(QStringList &filters, QStringList &quick) const; + + void allWritableFilters(QStringList &filters, QStringList &quick) const; + + /* + * Get all filters as one string. + */ + QString allFiltersString() const; + + /* + * Filters as one string suitable for KFileDialogs. + * If r == true, return readable codecs + * If allfiles == true, append *.* to result + */ + QString allFiltersFileDialogString(bool r, bool allfiles = true) const; + + /* + * Remove and unload all libraries. + */ + void clear(); + + /* + * Print some information on found libraries. + */ + void dump() const; + + static SQ_LibraryHandler* instance() { return m_instance; } + + private: + + void add(QStringList &foundLibraries); + + /* + * Load libraries from disk. + */ + void load(); + /* + * Is library with name 'quick' already been handled ? + */ + bool alreadyInMap(const QString &quick) const; + + void writeSettings(SQ_LIBRARY *lib); + void readSettings(SQ_LIBRARY *lib); + + private: + KConfig *kconf; + + static SQ_LibraryHandler *m_instance; +}; + +#endif diff --git a/ksquirrel/sq_navigatordropmenu.cpp b/ksquirrel/sq_navigatordropmenu.cpp new file mode 100644 index 0000000..35f1900 --- /dev/null +++ b/ksquirrel/sq_navigatordropmenu.cpp @@ -0,0 +1,117 @@ +/*************************************************************************** + sq_navigatordropmenu.cpp - description + ------------------- + begin : ??? Feb 23 2005 + copyright : (C) 2005 by Baryshev Dmitry + email : ksquirrel.iv@gmail.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include +#include +#include +#include + +#include "ksquirrel.h" +#include "sq_popupmenu.h" +#include "sq_navigatordropmenu.h" + +SQ_NavigatorDropMenu * SQ_NavigatorDropMenu::m_instance= 0; + +SQ_NavigatorDropMenu::SQ_NavigatorDropMenu(QObject *parent) : QObject(parent) +{ + m_instance = this; + + KActionCollection *ac = new KActionCollection(0, this, "Actions for drop menu"); + + dropmenu = new SQ_PopupMenu(0); + + // "copy" action + KAction *pACopy = new KAction(i18n("Copy here"), "editpaste", 0, this, SLOT(slotCopy()), ac, "sq_copy"); + + // "move" action + KAction *pAMove = new KAction(i18n("Move here"), 0, 0, this, SLOT(slotMove()), ac, "sq_move"); + + // "link" action + KAction *pALink = new KAction(i18n("Link here"), "www", 0, this, SLOT(slotLink()), ac, "sq_link"); + + // "cancel" action, this action will do nothing - just close popup menu + KAction *pACancel = new KAction(i18n("Cancel"), 0, 0, 0, 0, ac, "sq_cancel"); + + // plug all actions to popup menu + dropmenu->insertTitle(QString::null); + pACopy->plug(dropmenu); + pAMove->plug(dropmenu); + pALink->plug(dropmenu); + dropmenu->insertSeparator(); + pACancel->plug(dropmenu); +} + +SQ_NavigatorDropMenu::~SQ_NavigatorDropMenu() +{ + delete dropmenu; +} + +void SQ_NavigatorDropMenu::slotCopy() +{ + if(also) emit done(url, SQ_NavigatorDropMenu::Copy); + + KIO::Job *job = KIO::copy(list, url); + connect(job, SIGNAL(result(KIO::Job *)), this, SLOT(slotJobResult(KIO::Job *))); +} + +void SQ_NavigatorDropMenu::slotMove() +{ + if(also) emit done(url, SQ_NavigatorDropMenu::Move); + + KIO::Job *job = KIO::move(list, url); + connect(job, SIGNAL(result(KIO::Job *)), this, SLOT(slotJobResult(KIO::Job *))); +} + +void SQ_NavigatorDropMenu::slotLink() +{ + if(also) emit done(url, SQ_NavigatorDropMenu::Link); + + KIO::Job *job = KIO::link(list, url); + connect(job, SIGNAL(result(KIO::Job *)), this, SLOT(slotJobResult(KIO::Job *))); +} + +void SQ_NavigatorDropMenu::slotJobResult(KIO::Job *job) +{ + if(job && job->error()) + job->showErrorDialog(KSquirrel::app()); +} + +/* + * Save destination url and urls of dropped files. + */ +void SQ_NavigatorDropMenu::setupFiles(const KURL::List &l, const KURL &u) +{ + list = l; + url = u; + + dropmenu->changeTitle(KStringHandler::lsqueeze(u.isLocalFile() ? u.path() : u.prettyURL(), 20)); +} + +/* + * Show popup menu with available actions. + */ +void SQ_NavigatorDropMenu::exec(const QPoint &pos, bool _also) +{ + also = _also; + dropmenu->exec(pos); +} + +#include "sq_navigatordropmenu.moc" diff --git a/ksquirrel/sq_navigatordropmenu.h b/ksquirrel/sq_navigatordropmenu.h new file mode 100644 index 0000000..6662301 --- /dev/null +++ b/ksquirrel/sq_navigatordropmenu.h @@ -0,0 +1,90 @@ +/*************************************************************************** + sq_navigatordropmenu.h - description + ------------------- + begin : ??? Feb 23 2005 + copyright : (C) 2005 by Baryshev Dmitry + email : ksquirrel.iv@gmail.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifndef SQ_NAVIGATORDROPMENU_H +#define SQ_NAVIGATORDROPMENU_H + +#include +#include + +#include + +namespace KIO { class Job; } + +class SQ_PopupMenu; + +/* + * SQ_NavigatorDropMenu will help in drag-and-drop + * things. It creates popup menu with available actions + * (copy, move, ...), which will be executed by SQ_FileIconViewBase, + * when user dropped some files: + * + * void SQ_FileIconViewBase::slotDropped(QDropEvent *, const KURL::List &urls, const KURL &_url) + * { + * KURL url = (_url.isEmpty()) ? SQ_WidgetStack::instance()->url() : _url; + * + * SQ_NavigatorDropMenu::instance()->setupFiles(urls, url); + * SQ_NavigatorDropMenu::instance()->exec(QCursor::pos()); + * } + * + */ + +class SQ_NavigatorDropMenu : public QObject +{ + Q_OBJECT + + public: + SQ_NavigatorDropMenu(QObject *parent = 0); + ~SQ_NavigatorDropMenu(); + + static SQ_NavigatorDropMenu* instance() { return m_instance; } + + enum FileAction { Copy = 0, Move, Link }; + + /* + * Save destination url and urls of dropped files. + */ + void setupFiles(const KURL::List &l, const KURL &u); + + /* + * Show popup menu with available actions. + */ + void exec(const QPoint &pos, bool = false); + + private slots: + /* + * These slots will use KIO to + * copy, move or link files. + */ + void slotCopy(); + void slotMove(); + void slotLink(); + void slotJobResult(KIO::Job *); + + signals: + void done(const KURL &, int); + + private: + SQ_PopupMenu *dropmenu; + KURL::List list; + KURL url; + bool also; + + static SQ_NavigatorDropMenu *m_instance; +}; + +#endif diff --git a/ksquirrel/sq_options.ui b/ksquirrel/sq_options.ui new file mode 100644 index 0000000..853b82f --- /dev/null +++ b/ksquirrel/sq_options.ui @@ -0,0 +1,2139 @@ + +SQ_Options +Krasu + + + SQ_Options + + + + 0 + 0 + 437 + 468 + + + + + 5 + 5 + 0 + 0 + + + + + 0 + 0 + + + + + 10000 + 10000 + + + + Options + + + true + + + + + + + unnamed + + + + listMain + + + + 0 + 5 + 0 + 0 + + + + + + layout5 + + + + unnamed + + + + spacer1 + + + Horizontal + + + Expanding + + + + 400 + 20 + + + + + + buttonOk + + + OK + + + true + + + true + + + + + buttonCancel + + + + 0 + 0 + 0 + 0 + + + + &Cancel + + + + + + true + + + false + + + + + + + widgetStack + + + + 7 + 7 + 0 + 0 + + + + 0 + + + + pageMain + + + 0 + + + + unnamed + + + 0 + + + + spacer10 + + + Vertical + + + Expanding + + + + 20 + 20 + + + + + + textLabel1_2_4 + + + <b>The main options</b> + + + + + groupBox5 + + + NoFrame + + + Plain + + + + + + + unnamed + + + + checkSync + + + Write configuration file to disk, when I press "OK" + + + + + checkMinimize + + + Minimize to tray after closing + + + + + checkSplash + + + Show splash screen at startup + + + + + checkAnime + + + Don't show animated logo in toolbar + + + + + buttonGroupCS + + + Apply codec settings to + + + + unnamed + + + 9 + + + 1 + + + + radioButton22 + + + Thumbnail loader + + + + + radioButton23 + + + Image viewer (also preview window) + + + + + radioButton24_2 + + + Both + + + + + radioButton25_2 + + + RunTime + + + + + + + checkTreat + + + Treat unknown mime types as unsupported + + + + + checkKIPIDemand + + + false + + + Load KIPI plugins on demand (for slow machines) + + + + + + + + + pageFileview + + + 1 + + + + unnamed + + + 0 + + + + textLabel1_2_4_3 + + + <b>Disk navigator</b> + + + + + tabNav + + + + tab + + + Main + + + + unnamed + + + + buttonGroupSetPath + + + + 5 + 0 + 0 + 0 + + + + GroupBoxPanel + + + On starting open... + + + + + + + unnamed + + + 9 + + + 1 + + + + radioSetThis + + + Custom directory: + + + 2 + + + + + radioSetLast + + + Last visited directory + + + 0 + + + + + radioSetCurrent + + + Current directory, where KSquirrel starts + + + 1 + + + + + kURLReqOpenCustom + + + false + + + + + + + checkRunUnknown + + + Run unknown file formats separately (with default application) + + + + + + + + checkSaveHistory + + + Save history + + + + + checkSupportAr + + + Jump into archives + + + + + checkJumpFirst + + + Jump to first image + + + + + checkCalc + + + Calculate directory size + + + + + spacer16 + + + Vertical + + + Expanding + + + + 20 + 10 + + + + + + + + TabPage + + + Interface + + + + unnamed + + + + spacer14 + + + Vertical + + + Expanding + + + + 26 + 10 + + + + + + checkTooltips + + + Show tooltips with file information + + + + + checkDisableDirs + + + Don't show directories + + + + + checkDrag + + + Visualize drag operation + + + + + groupTooltip + + + false + + + + + + + unnamed + + + + checkInactive + + + Don't show tooltips when the main window is inactive + + + + + checkTooltipPreview + + + Show file preview + + + + + spinLines + + + Number of text lines + + + + + + + + + tab + + + Clicking + + + + unnamed + + + + spacer18 + + + Vertical + + + Expanding + + + + 20 + 40 + + + + + + buttonGroupSync + + + + 5 + 0 + 0 + 0 + + + + 0 + + + Synchronization + + + + unnamed + + + 9 + + + 1 + + + + radioSyncBoth + + + Both + + + + + radioSyncWStackTree + + + Tree <- Navigator + + + + + radioSyncTreeWStack + + + Tree -> Navigator + + + + + + + + + + + + pageThumbnails + + + 2 + + + + unnamed + + + 0 + + + + textLabel1_2_4_qqqq4 + + + <b>Thumbnails</b> + + + + + spacer17_3 + + + Vertical + + + Expanding + + + + 20 + 10 + + + + + + groupBox4 + + + NoFrame + + + Plain + + + + + + + unnamed + + + + checkNoWriteThumbs + + + Do not write thumbnails on disk + + + + + checkMark + + + Mark supported image formats with clock icon (slow) + + + + + spinLazy + + + false + + + Delay + + + ms. + + + + + spinMargin + + + Margin between thumbnails + + + pixels + + + + + checkLazy + + + Lazy thumbnail generation + + + + + spinCacheSize + + + Maximum cache size (in memory) + + + Kb + + + No cache + + + + + spinRows + + + Number of additionally generated rows + + + No + + + + + + + + + pageGL + + + 3 + + + + unnamed + + + 0 + + + + tabGL + + + + tab + + + Window + + + + unnamed + + + + buttonGroupScrolling + + + + 5 + 0 + 0 + 0 + + + + On scroll event + + + + unnamed + + + 9 + + + 1 + + + + radioSCRZoom_2 + + + Zoom the scene + + + + + radioSRCNext_2 + + + Load next/previous file + + + + + + + checkProgress + + + Show images progressively + + + + + layout8 + + + + unnamed + + + + buttonGroupColor + + + + 5 + 7 + 0 + 0 + + + + Background + + + + unnamed + + + 9 + + + 1 + + + + radioColorCustomTexture + + + Custom texture + + + 2 + + + + + radioColorCustom + + + Custom color + + + 1 + + + + + radioColorSystem + + + System color + + + 0 + + + + + + + widgetStack4 + + + + WStackPage + + + 0 + + + + unnamed + + + + kColorSystem + + + + + + + + + + WStackPage + + + 1 + + + + unnamed + + + + kColorGLbackground + + + false + + + + 95 + 25 + + + + + + + false + + + + + + + WStackPage + + + 2 + + + + unnamed + + + + kURLReqCustomTexture + + + false + + + + 5 + 0 + 0 + 0 + + + + + + groupBox3 + + + false + + + NoFrame + + + + + + + unnamed + + + 0 + + + 5 + + + + pushCustomValidate + + + Validate + + + + + textCustomValidate + + + + + + WordBreak|AlignVCenter + + + + + + + spacer16_5 + + + Vertical + + + Expanding + + + + 16 + 2 + + + + + + + + + + + buttonGroupDC + + + Double click + + + + unnamed + + + 9 + + + 1 + + + + radioButton27_2 + + + Fullscreen + + + 2 + + + + + radioButton28_2 + + + Do nothing + + + 0 + + + + + radioButton26_3 + + + Close window + + + 1 + + + + + + + spacer16_2 + + + Vertical + + + Expanding + + + + 20 + 2 + + + + + + checkCloseAll + + + Close all opened images when closing window + + + + + + + TabPage + + + Loader + + + + unnamed + + + + buttonGroupPages + + + Image pages + + + + unnamed + + + 9 + + + 1 + + + + radioButton18_2 + + + Load all pages + + + + + radioButton19 + + + Load only first page + + + + + radioButtonPagesNoMore + + + Load no more than + + + + + pagesNumber + + + false + + + pages + + + + + + + spacer13 + + + Vertical + + + Expanding + + + + 16 + 50 + + + + + + + + tab + + + Image + + + + unnamed + + + + spacer16_4 + + + Vertical + + + Expanding + + + + 20 + 20 + + + + + + checkMarks + + + Draw tickmarks around the image + + + + + checkDrawQuads + + + Draw background for transparent images + + + + + sliderAngle + + + Rotating + + + degrees + + + + + sliderMove + + + Moving + + + pixels + + + + + + + TabPage + + + Zoom + + + + unnamed + + + + buttonGroupZoomLimit + + + Zoom limit + + + + unnamed + + + 9 + + + 1 + + + + radioButton27 + + + Minimum: 1%, maximum: 10,000% + + + 1 + + + + + radioButton28 + + + Custom + + + + + groupBox1 + + + false + + + NoFrame + + + + + + + unnamed + + + 0 + + + 0 + + + + textLabel1_3 + + + minimum + + + + + spinZoomMin + + + % + + + 100 + + + 1 + + + + + textLabel2_2 + + + maximum + + + + + spinZoomMax + + + % + + + 100000 + + + 101 + + + + + + + radioButton26 + + + No limit + + + 0 + + + + + + + spinZoomFactor + + + Zoom coefficient + + + % + + + None + + + + + spacer19 + + + Vertical + + + Expanding + + + + 20 + 40 + + + + + + + + TabPage + + + Tabs + + + + unnamed + + + + checkTabs + + + Enable tabs + + + + + spacer15_2 + + + Vertical + + + Expanding + + + + 16 + 46 + + + + + + groupTabs + + + false + + + + + + + unnamed + + + + checkTabAsk + + + Ask what to do when opening new image + + + + + checkTabClose + + + Show close buttons + + + + + + + + + + textLabel1_2_4_4 + + + <b>Customize OpenGL widget</b> + + + + + + + WStackPage + + + 4 + + + + unnamed + + + 0 + + + + tabSidebar + + + + tab + + + Treeview + + + + unnamed + + + + buttonGroupRecurs + + + Recursion + + + + unnamed + + + 9 + + + 1 + + + + radioButton24 + + + No recursion + + + + + radioButton25 + + + Show number of files + + + + + radioButton26_2 + + + Show number of subfolders and files + + + 3 + + + + + radioButton26_2_2 + + + Show number of subfolders + + + 2 + + + + + + + spacer14_2 + + + Vertical + + + Expanding + + + + 21 + 135 + + + + + + + + TabPage + + + Mount view + + + + unnamed + + + + checkDevice + + + Show device path + + + + + spacer16_6 + + + Vertical + + + Expanding + + + + 21 + 90 + + + + + + checkMountOptions + + + Show mount options + + + + + checkMountFS + + + Show filesystem type + + + + + + + TabPage + + + Image preview + + + + unnamed + + + + preview + + + Enable preview window + + + + + spacer15 + + + Vertical + + + Expanding + + + + 21 + 10 + + + + + + groupBoxPreview + + + false + + + + + + + unnamed + + + + previewDelay + + + Delay before image loading + + + ms + + + + + textLabel1 + + + Background color for preview widget: + + + + + previewColor + + + + + + + + previewDont + + + Don't load preview image on file execution + + + Disables loading preview image when user launches image with mouse + + + + + previewTextColor + + + false + + + + + + + + textPreviewText + + + false + + + Text color: + + + + + checkPreviewText + + + Show image dimensions + + + + + + + + + + textLabel1_2_4_5_2 + + + <b>Sidebar settings</b> + + + + + + + WStackPage + + + 5 + + + + textLabelKIPI + + + + 5 + 5 + 406 + 20 + + + + <b>KIPI Configuration</b> + + + + + + + line10 + + + HLine + + + Sunken + + + Horizontal + + + + + + + SQ_IconListBox +
sq_iconlistbox.h
+ + -1 + -1 + + 0 + + 5 + 5 + 0 + 0 + + image0 +
+
+ + + 89504e470d0a1a0a0000000d4948445200000016000000160806000000c4b46c3b000003b149444154388dad945f4c5b551cc73fe7dc4b7b4bcba0762d45c43114323599ee6192609c51d883892ce083f1718b3ebb185f8dc91e972cf39d2d2a2f1af664b6f1e0fe3863a0718969700eb0c52142da0242a1bd6d696f7bcff101585203ceb8fd9ece39f99dcff9fe7edf939f88c562ec465f5f9fe609442c161362173c3e3eae7b7a7ac8e7f36432196cdbfe4f907c3e4f2291201e8fe338cec3737357e9e8e828aded1e229d650e1f2d51754b082110124c13a4dc5ea341eb9dc284c0558a853f3ce8cb0677ef500fde7d39d2596679e326597b8e9abb85d7a770ab16ab6983ec5a05b487a70e36f0f4e10afe408d6a558310980108478dba4a1e8233990c5d474b64ed39aa3a8fe5f3317fbf81dbd70bccfeb205947632fd74f6589c1c6ea2f70d03a58ba0c1f2c9bdc1b66de3b8256a6e11cbe7e3ee1d181b590124fe2693aeee08d223c82c3a2c24b7b874bec8f26288774f7bd054504aef0dde6e99c0eb83f9fb266323cb80a27fb0958141836044605a2ee5523393371cc646fee2da37195aa35d0c0c5b4859ac03d7e91712dcaac5adab3650a3ff9d08ef7dd8404bb48869e5d958b5b87dadc4c9a1464e9f0d0326df7ebd86bd2e310cb1bf62d384d59441f2d70a070e1c60e09489929b988681bdd9cc97170bcc4c65595f71f8e0e3301337fc24a7732467831875a47f289652b0be5e4151e6d07316c1b0c0340d8ab92023e76d66a6b2840e36d2fb7a13fee632475e6edc367ea98a90fb98b7dd6310ca0328a44761582e1bab41befabcc0ec940d28bc5e93b68e064cab84e1d9beaeb48934eac1f53b01c1b000fca496aa54b61a99fcde61662a4b4b4b23d1680be9d426173e4df3602a48ea411989a4fd590f52a8fd156b05ed9d350e3defe3cfdf4b4c7ce770ea7d3fb9f520afbe1620daeee5c26735d20b9b9cfb6811a754a439e4e5c5639a4caa1e5caf586bfc0197b78702005cb9b4cae4cd3267ce8638fe964bd72b393e39d74928d242617303a756a37f284447770dcdbffc6384a05a85de1306e9a52057c7527c7131c3c42d3f475eb2303c82d4fc3276d6811db37efeb148723082d9b08f79f97c1e5729109a9a28307cc622d2d6cdf52b2b24efe548dedb00142009862cfa879ee1a71f6cec928353511472fbf4389148b0b0e0c108081412458dfe21c9f11351e67e7358595468246d1d1e5e38a6e9e851bc39d84ab502a669331dafec0d8ec7e3e8cb06e1a881d727d1ae40180a434a8c9db129a54126ad48a7358c2b4c5352c8c374bcccdab2bb37d8719cba79fab8211f9df218e0582c261e95f8bfc04f1a1e8bc5c4dfe0a190172af6a9690000000049454e44ae426082 + + + + + buttonCancel + clicked() + SQ_Options + reject() + + + kURLReqCustomTexture + urlSelected(const QString&) + SQ_Options + slotNewCustomTexture(const QString&) + + + radioButton28 + toggled(bool) + groupBox1 + setEnabled(bool) + + + radioColorCustom + toggled(bool) + kColorGLbackground + setEnabled(bool) + + + radioColorCustomTexture + toggled(bool) + SQ_Options + slotCustomTextureToggled(bool) + + + radioSetThis + toggled(bool) + kURLReqOpenCustom + setEnabled(bool) + + + pushCustomValidate + clicked() + SQ_Options + slotValidateCustomTexture() + + + kURLReqCustomTexture + returnPressed(const QString&) + SQ_Options + slotNewCustomTexture(const QString&) + + + buttonGroupColor + clicked(int) + widgetStack4 + raiseWidget(int) + + + kColorSystem + changed(const QColor&) + SQ_Options + slotSetSystemBack(const QColor&) + + + radioButtonPagesNoMore + toggled(bool) + pagesNumber + setEnabled(bool) + + + buttonOk + clicked() + SQ_Options + accept() + + + preview + toggled(bool) + groupBoxPreview + setEnabled(bool) + + + checkLazy + toggled(bool) + spinLazy + setEnabled(bool) + + + checkTooltips + toggled(bool) + groupTooltip + setEnabled(bool) + + + checkPreviewText + toggled(bool) + textPreviewText + setEnabled(bool) + + + checkPreviewText + toggled(bool) + previewTextColor + setEnabled(bool) + + + checkTabs + toggled(bool) + groupTabs + setEnabled(bool) + + + + checkMinimize + checkSync + tabNav + radioSetLast + radioSetCurrent + radioSetThis + kURLReqOpenCustom + checkRunUnknown + checkSaveHistory + checkSupportAr + checkJumpFirst + radioSyncBoth + radioSyncTreeWStack + radioSyncWStackTree + checkNoWriteThumbs + tabGL + radioSCRZoom_2 + radioSRCNext_2 + radioColorSystem + radioColorCustom + radioColorCustomTexture + kURLReqCustomTexture + pushCustomValidate + checkDrawQuads + checkMarks + radioButton26 + radioButton27 + radioButton28 + spinZoomMin + spinZoomMax + buttonCancel + kColorSystem + kColorGLbackground + + + qpixmap.h + kstandarddirs.h + qfileinfo.h + sq_config.h + sq_libraryhandler.h + qimage.h + qmessagebox.h + qdir.h + sq_iconlistitem.h + sq_viewcache.h + sq_pixmapcache.h + sq_iconloader.h + sq_codecsettings.h + sq_hloptions.h + sq_options.ui.h + + + QString custpixmap; + bool showlinks; + QString favpixmap; + QWidget *kipi; + + + slotNewCustomTexture( const QString & path ) + slotShowPage() + slotCustomTextureToggled( bool en ) + slotValidateCustomTexture() + paletteChange( const QPalette & oldPalette ) + slotSetSystemBack( const QColor & ) + + + init() + start() + validPixmap( QPixmap pix ) + isPowerOf2( int tested ) + + + + sq_iconlistbox.h + kpushbutton.h + kurlrequester.h + klineedit.h + kpushbutton.h + knuminput.h + knuminput.h + knuminput.h + knuminput.h + knuminput.h + knuminput.h + knuminput.h + knuminput.h + knuminput.h + knuminput.h + kcolorbutton.h + kcolorbutton.h + kurlrequester.h + klineedit.h + kpushbutton.h + knuminput.h + knuminput.h + knuminput.h + knuminput.h + knuminput.h + knuminput.h + knuminput.h + knuminput.h + knuminput.h + knuminput.h + kcolorbutton.h + kcolorbutton.h + +
diff --git a/ksquirrel/sq_options.ui.h b/ksquirrel/sq_options.ui.h new file mode 100644 index 0000000..7e33537 --- /dev/null +++ b/ksquirrel/sq_options.ui.h @@ -0,0 +1,333 @@ +/**************************************************************************** +** ui.h extension file, included from the uic-generated form implementation. +** +** If you wish to add, delete or rename functions or slots use +** Qt Designer which will update this file, preserving your code. Create an +** init() function in place of a constructor, and a destroy() function in +** place of a destructor. +*****************************************************************************/ + +/* + * SQ_Options is a configuration dialog for KSquirrel. + */ + +// for KIPI defs +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#ifdef SQ_HAVE_KIPI +#include +#endif + +void SQ_Options::init() +{ + buttonOk->setIconSet(SQ_IconLoader::instance()->loadIcon("ok", KIcon::Desktop, KIcon::SizeSmall)); + int tp; + SQ_Config *kconf = SQ_Config::instance(); + QColor color; + + pagesNumber->setRange(1, 1000, 1, true); + + kconf->setGroup("Main"); + + checkKIPIDemand->setChecked(kconf->readBoolEntry("kipi_ondemand", true)); + tp = kconf->readNumEntry("applyto", SQ_CodecSettings::Both); + buttonGroupCS->setButton(tp); + checkMinimize->setChecked(kconf->readBoolEntry("minimize to tray", false)); + checkSync->setChecked(kconf->readBoolEntry("sync", false)); + checkSplash->setChecked(kconf->readBoolEntry("splash", true)); + checkAnime->setChecked(kconf->readBoolEntry("anime_dont", false)); + checkTreat->setChecked(kconf->readBoolEntry("treat", true)); + + KFile::Mode mode = static_cast(KFile::Directory | KFile::ExistingOnly | KFile::LocalOnly); + + kconf->setGroup("Fileview"); + + tp = kconf->readNumEntry("sync type", 0); + buttonGroupSync->setButton(tp); + tp = kconf->readNumEntry("set path", 0); + buttonGroupSetPath->setButton(tp); + kURLReqOpenCustom->setURL(kconf->readEntry("custom directory", "/")); + + spinLines->setRange(1, 20, 1, true); + spinLines->setValue(kconf->readNumEntry("tooltips_lines", 6)); + checkTooltipPreview->setChecked(kconf->readBoolEntry("tooltips_preview", false)); + checkTooltips->setChecked(kconf->readBoolEntry("tooltips", false)); + checkInactive->setChecked(kconf->readBoolEntry("tooltips_inactive", true)); + checkSaveHistory->setChecked(kconf->readBoolEntry("history", true)); + checkRunUnknown->setChecked(kconf->readBoolEntry("run unknown", false)); + checkSupportAr->setChecked(kconf->readBoolEntry("archives", true)); + checkJumpFirst->setChecked(kconf->readBoolEntry("tofirst", true)); + checkDisableDirs->setChecked(kconf->readBoolEntry("disable_dirs", false)); + checkCalc->setChecked(kconf->readBoolEntry("calculate", true)); + checkDrag->setChecked(kconf->readBoolEntry("drag", true)); + +// Init GLView page + kconf->setGroup("GL view"); + + QPixmap p1; + checkProgress->setChecked(kconf->readBoolEntry("progressiv", true)); + checkDrawQuads->setChecked(kconf->readBoolEntry("alpha_bkgr", true)); + checkMarks->setChecked(kconf->readBoolEntry("marks", true)); + + // tabs + checkTabs->setChecked(kconf->readBoolEntry("tabs", false)); + checkTabAsk->setChecked(kconf->readBoolEntry("tabs_ask", false)); + checkTabClose->setChecked(kconf->readBoolEntry("tabs_close", true)); + checkCloseAll->setChecked(kconf->readBoolEntry("closeall", false)); + + tp = kconf->readNumEntry("double_click", 0); + buttonGroupDC->setButton(tp); + tp = kconf->readNumEntry("load_pages", 0); + buttonGroupPages->setButton(tp); + pagesNumber->setEnabled(tp == 2); + tp = kconf->readNumEntry("load_pages_number", 1); + pagesNumber->setValue(tp); + + tp = kconf->readNumEntry("GL view background type", 1); + buttonGroupColor->setButton(tp); + widgetStack4->raiseWidget(tp); + + kColorSystem->setColor(colorGroup().color(QColorGroup::Base)); + + tp = kconf->readNumEntry("zoom limit", 1); + buttonGroupZoomLimit->setButton(tp); + spinZoomMin->setValue(kconf->readNumEntry("zoom_min", 1)); + spinZoomMax->setValue(kconf->readNumEntry("zoom_max", 10000)); + + custpixmap = kconf->readEntry("GL view custom texture", ""); + kURLReqCustomTexture->setURL(custpixmap); + + if(!custpixmap.isEmpty()) + slotValidateCustomTexture(); + + tp = kconf->readNumEntry("scroll", 0); + buttonGroupScrolling->setButton(tp); + sliderAngle->setRange(0, 180, 1, true); + sliderAngle->setValue(kconf->readNumEntry("angle", 90)); + spinZoomFactor->setRange(0, 300, 1, true); + spinZoomFactor->setValue(kconf->readNumEntry("zoom", 25)); + sliderMove->setRange(1, 50, 1, true); + sliderMove->setValue(kconf->readNumEntry("move", 5)); + + color.setNamedColor(kconf->readEntry("GL view background", "#4e4e4e")); + kColorGLbackground->setColor(color); + + kconf->setGroup("Sidebar"); + + tp = kconf->readNumEntry("recursion_type", 0); + buttonGroupRecurs->setButton(tp); + checkDevice->setChecked(kconf->readBoolEntry("mount_device", false)); + checkMountOptions->setChecked(kconf->readBoolEntry("mount_options", false)); + checkMountFS->setChecked(kconf->readBoolEntry("mount_fstype", true)); + color.setNamedColor(kconf->readEntry("preview_background", "#4e4e4e")); + previewColor->setColor(color); + color.setNamedColor(kconf->readEntry("preview_text", "#ffffff")); + previewTextColor->setColor(color); + preview->setChecked(kconf->readBoolEntry("preview", true)); + checkPreviewText->setChecked(kconf->readBoolEntry("preview_text_enable", true)); + previewDont->setChecked(kconf->readBoolEntry("preview_dont", true)); + previewDelay->setRange(50, 2000, 50, true); + previewDelay->setValue(kconf->readNumEntry("preview_delay", 400)); + + kconf->setGroup("Thumbnails"); + + spinCacheSize->setRange(0, 104857, 10, true); + spinMargin->setRange(0, 20, 1, true); + spinMargin->setValue(kconf->readNumEntry("margin", 2)); + spinCacheSize->setValue(kconf->readNumEntry("cache", 1024*5)); + checkNoWriteThumbs->setChecked(kconf->readBoolEntry("dont write", false)); + checkMark->setChecked(kconf->readBoolEntry("mark", false)); + checkLazy->setChecked(kconf->readBoolEntry("lazy", true)); + spinLazy->setRange(10, 5000, 100, true); + spinLazy->setValue(kconf->readNumEntry("lazy_delay", 500)); + spinRows->setRange(0, 5, 1, true); + spinRows->setValue(kconf->readNumEntry("rows", 2)); + + new SQ_IconListItem(listMain, SQ_IconLoader::instance()->loadIcon("display", KIcon::Desktop, KIcon::SizeMedium), i18n("General")); + new SQ_IconListItem(listMain, SQ_IconLoader::instance()->loadIcon("folder", KIcon::Desktop, KIcon::SizeMedium), i18n("Filing")); + new SQ_IconListItem(listMain, SQ_IconLoader::instance()->loadIcon("images", KIcon::Desktop, KIcon::SizeMedium), i18n("Thumbnails")); + new SQ_IconListItem(listMain, QPixmap::fromMimeSource(locate("data", "images/listbox/image_win.png")), i18n("Image window")); + new SQ_IconListItem(listMain, SQ_IconLoader::instance()->loadIcon("penguin", KIcon::Desktop, KIcon::SizeMedium), i18n("Sidebar")); + +#ifdef SQ_HAVE_KIPI + new SQ_IconListItem(listMain, SQ_IconLoader::instance()->loadIcon("kipi", KIcon::Desktop, KIcon::SizeMedium), i18n("KIPI")); + + QWidget *pg6 = widgetStack->widget(5); + QGridLayout *pageLayout6 = new QGridLayout(pg6, 2, 1, 0, -1, "pageLayout_6"); + kipi = new KIPI::ConfigWidget(pg6); + pageLayout6->addWidget(textLabelKIPI, 0, 0); + pageLayout6->addWidget(kipi, 1, 0); + checkKIPIDemand->setEnabled(true); +#endif + + listMain->updateAndInstall(this); + + connect(listMain, SIGNAL(selectionChanged()), SLOT(slotShowPage())); + + kURLReqOpenCustom->setMode(mode); + + // restore selection page + kconf->setGroup("Main"); + listMain->setCurrentItem(kconf->readNumEntry("options_last", 0)); + tabNav->setCurrentPage(kconf->readNumEntry("options_last_tabNav", 0)); + tabGL->setCurrentPage(kconf->readNumEntry("options_last_tabGL", 0)); + tabSidebar->setCurrentPage(kconf->readNumEntry("options_last_tabSidebar", 0)); + + if(!SQ_HLOptions::instance()->have_mountview) + tabSidebar->setTabEnabled(tabSidebar->page(1), false); +} + +int SQ_Options::start() +{ + int result = QDialog::exec(); + + if(result == QDialog::Accepted) + { +#ifdef SQ_HAVE_KIPI + static_cast(kipi)->apply(); +#endif + + SQ_Config *kconf = SQ_Config::instance(); + + kconf->setGroup("Fileview"); + kconf->writeEntry("set path", buttonGroupSetPath->selectedId()); + kconf->writeEntry("custom directory", kURLReqOpenCustom->url()); + kconf->writeEntry("sync type", buttonGroupSync->selectedId()); + kconf->writeEntry("history", checkSaveHistory->isChecked()); + kconf->writeEntry("run unknown", checkRunUnknown->isChecked()); + kconf->writeEntry("archives", checkSupportAr->isChecked()); + kconf->writeEntry("tofirst", checkJumpFirst->isChecked()); + kconf->writeEntry("disable_dirs", checkDisableDirs->isChecked()); + kconf->writeEntry("calculate", checkCalc->isChecked()); + kconf->writeEntry("drag", checkDrag->isChecked()); + kconf->writeEntry("tooltips", checkTooltips->isChecked()); + kconf->writeEntry("tooltips_inactive", checkInactive->isChecked()); + kconf->writeEntry("tooltips_lines", spinLines->value()); + kconf->writeEntry("tooltips_preview", checkTooltipPreview->isChecked()); + + kconf->setGroup("Main"); + kconf->writeEntry("applyto", buttonGroupCS->selectedId()); + kconf->writeEntry("minimize to tray", checkMinimize->isChecked()); + kconf->writeEntry("sync", checkSync->isChecked()); + kconf->writeEntry("splash", checkSplash->isChecked()); + kconf->writeEntry("anime_dont", checkAnime->isChecked()); + kconf->writeEntry("kipi_ondemand", checkKIPIDemand->isChecked()); + kconf->writeEntry("treat", checkTreat->isChecked()); + kconf->writeEntry("options_last", listMain->currentItem()); + kconf->writeEntry("options_last_tabGL", tabGL->currentPageIndex()); + kconf->writeEntry("options_last_tabNav", tabNav->currentPageIndex()); + kconf->writeEntry("options_last_tabSidebar", tabSidebar->currentPageIndex()); + + kconf->setGroup("Thumbnails"); + kconf->writeEntry("margin", spinMargin->value()); + kconf->writeEntry("cache", spinCacheSize->value()); + kconf->writeEntry("dont write", checkNoWriteThumbs->isChecked()); + kconf->writeEntry("mark", checkMark->isChecked()); + kconf->writeEntry("lazy", checkLazy->isChecked()); + kconf->writeEntry("lazy_delay", spinLazy->value()); + kconf->writeEntry("rows", spinRows->value()); + + kconf->setGroup("GL view"); + kconf->writeEntry("double_click", buttonGroupDC->selectedId()); + kconf->writeEntry("load_pages", buttonGroupPages->selectedId()); + kconf->writeEntry("load_pages_number", pagesNumber->value()); + kconf->writeEntry("GL view background", kColorGLbackground->color().name()); + kconf->writeEntry("GL view custom texture", custpixmap); + kconf->writeEntry("GL view background type", buttonGroupColor->selectedId()); + kconf->writeEntry("zoom limit", buttonGroupZoomLimit->selectedId()); + kconf->writeEntry("alpha_bkgr", checkDrawQuads->isChecked()); + kconf->writeEntry("marks", checkMarks->isChecked()); + kconf->writeEntry("progressiv", checkProgress->isChecked()); + kconf->writeEntry("scroll", buttonGroupScrolling->selectedId()); + kconf->writeEntry("angle", sliderAngle->value()); + kconf->writeEntry("zoom", spinZoomFactor->value()); + kconf->writeEntry("zoom_min", spinZoomMin->value()); + kconf->writeEntry("zoom_max", spinZoomMax->value()); + kconf->writeEntry("move", sliderMove->value()); + kconf->writeEntry("tabs", checkTabs->isChecked()); + kconf->writeEntry("tabs_ask", checkTabAsk->isChecked()); + kconf->writeEntry("tabs_close", checkTabClose->isChecked()); + kconf->writeEntry("closeall", checkCloseAll->isChecked()); + + kconf->setGroup("Sidebar"); + kconf->writeEntry("recursion_type", buttonGroupRecurs->selectedId()); + kconf->writeEntry("mount_device", checkDevice->isChecked()); + kconf->writeEntry("mount_options", checkMountOptions->isChecked()); + kconf->writeEntry("mount_fstype", checkMountFS->isChecked()); + kconf->writeEntry("preview_background", previewColor->color().name()); + kconf->writeEntry("preview_text", previewTextColor->color().name()); + kconf->writeEntry("preview_text_enable", checkPreviewText->isChecked()); + kconf->writeEntry("preview_delay", previewDelay->value()); + kconf->writeEntry("preview_dont", previewDont->isChecked()); + kconf->writeEntry("preview", preview->isChecked()); + } + + return result; +} + +bool SQ_Options::validPixmap(QPixmap pix) +{ + return (isPowerOf2(pix.width()) && isPowerOf2(pix.height()) && pix.width() <= 256 && pix.width() == pix.height() && !pix.isNull()); +} + +bool SQ_Options::isPowerOf2( int tested ) +{ + int i = 1; + + if(tested == 1) + return true; + + for(;tested > i;i <<= 1) + ; + + return i == tested; +} + +void SQ_Options::slotNewCustomTexture( const QString & path) +{ + QPixmap p1(path); + + if(validPixmap(p1)) + { + custpixmap = path; + textCustomValidate->setText(QString::fromLatin1("%1x%2: OK") + .arg(p1.width()) + .arg(p1.height())); + } + else + textCustomValidate->setText(i18n("Wrong dimensions: %1x%2.") + .arg(p1.width()) + .arg(p1.height())); +} + +void SQ_Options::slotShowPage() +{ + int id = listMain->currentItem(); + + widgetStack->raiseWidget(id); +} + +void SQ_Options::slotCustomTextureToggled( bool en) +{ + kURLReqCustomTexture->setEnabled(en); + groupBox3->setEnabled(en); +} + +void SQ_Options::slotValidateCustomTexture() +{ + slotNewCustomTexture(kURLReqCustomTexture->url()); +} + +void SQ_Options::paletteChange( const QPalette &oldPalette ) +{ + QDialog::paletteChange(oldPalette); + + kColorSystem->setColor(colorGroup().color(QColorGroup::Base)); +} + +void SQ_Options::slotSetSystemBack( const QColor & ) +{ + kColorSystem->setColor(colorGroup().color(QColorGroup::Base)); +} diff --git a/ksquirrel/sq_pixmapcache.cpp b/ksquirrel/sq_pixmapcache.cpp new file mode 100644 index 0000000..7fe2217 --- /dev/null +++ b/ksquirrel/sq_pixmapcache.cpp @@ -0,0 +1,167 @@ +/*************************************************************************** + sq_pixmapcache.cpp - description + ------------------- + begin : Sep 28 2004 + copyright : (C) 2004 by Baryshev Dmitry + email : ksquirrel.iv@gmail.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include "sq_pixmapcache.h" +#include "sq_thumbnailsize.h" +#include "sq_dirthumbs.h" + +SQ_PixmapCache * SQ_PixmapCache::m_instance = 0; + +SQ_PixmapCache::SQ_PixmapCache(QObject *parent, int limit) + : QObject(parent), QMap() +{ + m_instance = this; + cache_limit = limit << 10; + + dir = new SQ_DirThumbs; + + valid_full = false; +} + +SQ_PixmapCache::~SQ_PixmapCache() +{ + delete dir; +} + +/* + * Write all entries to disk and clear cache. + */ +void SQ_PixmapCache::sync() +{ + // nothing to sync + if(empty()) + return; + + iterator itEnd = end(); + + // go through array and sync each entry + for(iterator it = begin();it != itEnd;++it) + syncEntry(it.key(), it.data()); + + // remove all entries from cache + clear(); +} + +/* + * Write one entry to disk and remove it from cache. + */ +void SQ_PixmapCache::syncEntry(const KURL &key, SQ_Thumbnail &thumb) +{ + // let SQ_DirThumbs save thumbnail + dir->saveThumbnail(key, thumb); +} + +/* + * Insert new entry to cache + */ +void SQ_PixmapCache::insert(const KURL &key, const SQ_Thumbnail &thumb) +{ + // thumbnail is null ? + if(thumb.thumbnail.isNull()) + return; + + // calc new cache size + last_full += entrySize(thumb); + + // add new entry + QMap::insert(key, thumb); +} + +/* + * Remove entry from cache. + */ +void SQ_PixmapCache::removeEntry(const KURL &key) +{ + iterator it = find(key); + + // no item to remove ? + if(it == end()) + return; + + last_full -= entrySize(it.data()); + + QMap::remove(key); +} + +/* + * Remove entry from cache and from disk. + */ +void SQ_PixmapCache::removeEntryFull(const KURL &key) +{ + // remove from memory + removeEntry(key); + + // remove from disk + dir->removeFile(key); +} + +/* + * Check if pixmap, represented by 'key', is already in cache. + */ +bool SQ_PixmapCache::contains2(const KURL &key, SQ_Thumbnail &th) +{ + iterator it = find(key); + + // item found + if(it != end()) + { + th = it.data(); + return true; + } + + // not found + return false; +} + +/* + * Calculate total size used by cache (not exact!) + */ +int SQ_PixmapCache::totalSize() +{ + if(valid_full) + return last_full; + + int total = 0; + + iterator itEnd = end(); + + for(iterator it = begin();it != itEnd;++it) + { + total += entrySize(it.data()); + } + + last_full = total; + valid_full = true; + + return total; +} + +void SQ_PixmapCache::clear() +{ + valid_full = false; + + QMap::clear(); +} + +int SQ_PixmapCache::entrySize(const SQ_Thumbnail &th) const +{ + return th.thumbnail.width() * th.thumbnail.height() * 4; +} diff --git a/ksquirrel/sq_pixmapcache.h b/ksquirrel/sq_pixmapcache.h new file mode 100644 index 0000000..e5f9936 --- /dev/null +++ b/ksquirrel/sq_pixmapcache.h @@ -0,0 +1,133 @@ +/*************************************************************************** + sq_pixmapcache.h - description + ------------------- + begin : Sep 28 2004 + copyright : (C) 2004 by Baryshev Dmitry + email : ksquirrel.iv@gmail.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifndef SQ_PIXMAPCACHE_H +#define SQ_PIXMAPCACHE_H + +#include +#include + +#include + +#include "sq_thumbnailinfo.h" + +class SQ_DirThumbs; + +/* + * SQ_PixmapCache represents a simple memory cache, which + * stores pixmaps. It doesn't use neither QPixmapCache nor QCache. + * + * Uses SQ_Dir(Thumbnails) to store thumbnails on disk. + */ + +class SQ_PixmapCache : public QObject, public QMap +{ + public: + SQ_PixmapCache(QObject *parent, int limit = 20*1024); + ~SQ_PixmapCache(); + + /* + * Get maximum cache limit. + */ + int cacheLimit(); + + /* + * Set cache limit, in kilobytes. + * + * 200 means ~200 Kb, 1024 - 1Mb + */ + void setCacheLimit(int); + + /* + * Write all entries to disk and clear cache. + */ + void sync(); + + /* + * Write one entry to disk and remove it from cache. + */ + void syncEntry(const KURL &key, SQ_Thumbnail &thumb); + + /* + * Insert new entry to cache + */ + void insert(const KURL &key, const SQ_Thumbnail &thumb); + + /* + * Check if pixmap, represented by 'key', is already in cache. + */ + bool contains2(const KURL &key, SQ_Thumbnail &th); + + /* + * Calculate total size used by cache (not exact!) + */ + int totalSize(); + + /* + * Is cache full ? + */ + bool full(); + + /* + * Clear cache. + */ + void clear(); + + /* + * Remove entry from cache. + */ + void removeEntry(const KURL &key); + + /* + * Remove entry from cache and from disk. + */ + void removeEntryFull(const KURL &key); + + static SQ_PixmapCache* instance() { return m_instance; } + + private: + int entrySize(const SQ_Thumbnail &th) const; + + private: + int cache_limit; + int last_full; + bool valid_full; + SQ_DirThumbs *dir; + + static SQ_PixmapCache *m_instance; +}; + +inline +int SQ_PixmapCache::cacheLimit() +{ + return cache_limit; +} + +inline +void SQ_PixmapCache::setCacheLimit(int n) +{ + cache_limit = n << 10; +} + +inline +bool SQ_PixmapCache::full() +{ + // when 'cache_limit' is 0, pixmap cache is always full + return cache_limit ? (cache_limit <= totalSize()) : true; +} + +#endif diff --git a/ksquirrel/sq_pluginsinfo.ui b/ksquirrel/sq_pluginsinfo.ui new file mode 100644 index 0000000..46d6682 --- /dev/null +++ b/ksquirrel/sq_pluginsinfo.ui @@ -0,0 +1,275 @@ + +SQ_PluginsInfo + + + SQ_PluginsInfo + + + + 0 + 0 + 604 + 474 + + + + Codec information and settings + + + true + + + + unnamed + + + + line1 + + + HLine + + + Sunken + + + Horizontal + + + + + + ... + + + true + + + true + + + + + Icon + + + true + + + true + + + + + Library + + + true + + + true + + + + + Version + + + true + + + true + + + + + MIME + + + true + + + true + + + + + + + + true + + + true + + + + + + + + true + + + true + + + + tableLib + + + true + + + LastColumn + + + + + layout1 + + + + unnamed + + + + textCount + + + + 1 + + + + + + + + + textLibs1 + + + Directory: + + + + + spacer2 + + + Horizontal + + + Expanding + + + + 70 + 16 + + + + + + textLabel2 + + + Total found: + + + + + textLibs + + + + 1 + + + + + + + + + + + layout6 + + + + unnamed + + + + spacer1 + + + Horizontal + + + Expanding + + + + 445 + 16 + + + + + + pushClose + + + Close + + + + + + + + + + + + pushClose + clicked() + SQ_PluginsInfo + reject() + + + tableLib + doubleClicked(QListViewItem*) + SQ_PluginsInfo + slotDoubleClicked(QListViewItem*) + + + tableLib + mouseButtonClicked(int,QListViewItem*,const QPoint&,int) + SQ_PluginsInfo + slotMouseButtonClicked(int,QListViewItem*,const QPoint&,int) + + + + sq_libraryhandler.h + kstandarddirs.h + sq_iconloader.h + sq_codecsettingsskeleton.h + ksquirrel-libs/fileio.h + ksquirrel-libs/fmt_codec_base.h + kstringhandler.h + sq_pluginsinfo.ui.h + + + slotDoubleClicked( QListViewItem * i ) + slotMouseButtonClicked( int button, QListViewItem * i, const QPoint &, int c ) + + + init() + showLibs() + + + diff --git a/ksquirrel/sq_pluginsinfo.ui.h b/ksquirrel/sq_pluginsinfo.ui.h new file mode 100644 index 0000000..cda52a7 --- /dev/null +++ b/ksquirrel/sq_pluginsinfo.ui.h @@ -0,0 +1,83 @@ +/**************************************************************************** +** ui.h extension file, included from the uic-generated form implementation. +** +** If you wish to add, delete or rename functions or slots use +** Qt Designer which will update this file, preserving your code. Create an +** init() function in place of a constructor, and a destroy() function in +** place of a destructor. +*****************************************************************************/ + +/* + * SQ_PluginsInfo shows all found by SQ_LibraryListener libraries. + */ + +void SQ_PluginsInfo::init() +{ + tableLib->setColumnText (5, SQ_IconLoader::instance()->loadIcon("fileopen", KIcon::Desktop, KIcon::SizeSmall), ""); + tableLib->setColumnText (6, SQ_IconLoader::instance()->loadIcon("filesave", KIcon::Desktop, KIcon::SizeSmall), ""); + + showLibs(); +} + +void SQ_PluginsInfo::showLibs() +{ + int cnt = SQ_LibraryHandler::instance()->count(); + + textLibs->setText(SQ_KLIBS); + textCount->setNum(cnt); + + if(!cnt) return; + + QPixmap ok = SQ_IconLoader::instance()->loadIcon("ok", KIcon::Desktop, KIcon::SizeSmall); + QPixmap configure = SQ_IconLoader::instance()->loadIcon("configure", KIcon::Desktop, KIcon::SizeSmall); + + SQ_LibraryHandler::iterator itEnd = SQ_LibraryHandler::instance()->end(); + QListViewItem *item; + + for(SQ_LibraryHandler::iterator it = SQ_LibraryHandler::instance()->begin();it != itEnd;++it) + { + item = new QListViewItem(tableLib, QString::null, QString::null, + (*it).quickinfo, (*it).version, + KStringHandler::rsqueeze((*it).mimetype, 20)); + + if(!(*it).config.isEmpty()) + item->setPixmap(0, configure); + + if((*it).readable) + item->setPixmap(5, ok); + + if((*it).writestatic) + item->setPixmap(6, ok); + + item->setPixmap(1, (*it).mime); + + tableLib->insertItem(item); + } + + item = tableLib->firstChild(); + tableLib->setCurrentItem(item); + tableLib->setSelected(item, true); +} + +void SQ_PluginsInfo::slotDoubleClicked(QListViewItem *i) +{ + if(!i) + return; + + SQ_LIBRARY *lib = SQ_LibraryHandler::instance()->libraryByName(i->text(2)); + + if(!lib || lib->config.isEmpty()) + return; + + SQ_CodecSettingsSkeleton skel(this); + skel.addSettingsWidget(lib->config); + skel.setCodecInfo(*i->pixmap(1), i->text(2)); + skel.adjustSize(); + skel.exec(lib->settings); +} + +void SQ_PluginsInfo::slotMouseButtonClicked(int button, QListViewItem *i, const QPoint &, int c) +{ + if(button == Qt::LeftButton && i && !c) + slotDoubleClicked(i); +} diff --git a/ksquirrel/sq_popupmenu.cpp b/ksquirrel/sq_popupmenu.cpp new file mode 100644 index 0000000..2bb037e --- /dev/null +++ b/ksquirrel/sq_popupmenu.cpp @@ -0,0 +1,39 @@ +/*************************************************************************** + sq_popupmenu.cpp - description + ------------------- + begin : ??? June 3 2006 + copyright : (C) 2006 by Baryshev Dmitry + email : ksquirrel.iv@gmail.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include "sq_popupmenu.h" + +SQ_PopupMenu::SQ_PopupMenu(QWidget *parent, const char *name) + : KPopupMenu(parent, name), title(0) +{} + +SQ_PopupMenu::~SQ_PopupMenu() +{} + +void SQ_PopupMenu::insertTitle(const QString &t) +{ + title = KPopupMenu::insertTitle(t); +} + +void SQ_PopupMenu::changeTitle(const QString &t) +{ + KPopupMenu::changeTitle(title, t); +} diff --git a/ksquirrel/sq_popupmenu.h b/ksquirrel/sq_popupmenu.h new file mode 100644 index 0000000..c6aaaad --- /dev/null +++ b/ksquirrel/sq_popupmenu.h @@ -0,0 +1,40 @@ +/*************************************************************************** + sq_popupmenu.h - description + ------------------- + begin : ??? June 3 2006 + copyright : (C) 2006 by Baryshev Dmitry + email : ksquirrel.iv@gmail.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifndef SQ_POPUPMENU_H +#define SQ_POPUPMENU_H + +#include + +/** + *@author Baryshev Dmitry + */ + +class SQ_PopupMenu : public KPopupMenu +{ + public: + SQ_PopupMenu(QWidget *parent = 0, const char *name = 0); + ~SQ_PopupMenu(); + + void insertTitle(const QString &t); + void changeTitle(const QString &t); + + private: + int title; +}; + +#endif diff --git a/ksquirrel/sq_progress.cpp b/ksquirrel/sq_progress.cpp new file mode 100644 index 0000000..8686270 --- /dev/null +++ b/ksquirrel/sq_progress.cpp @@ -0,0 +1,137 @@ +/*************************************************************************** + sq_progress.cpp - description + ------------------- + begin : ??? ??? 29 2004 + copyright : (C) 2004 by Baryshev Dmitry + email : ksquirrel.iv@gmail.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include + +#include +#include +#include + +#include + +#include "sq_progress.h" + +SQ_Progress::SQ_Progress(QWidget *parent, const char *name) + : QLabel(parent, name, Qt::WNoAutoErase), m_text(true), painter(0) +{} + +SQ_Progress::~SQ_Progress() +{ + delete painter; +} + +void SQ_Progress::setTotalSteps(int totalSteps) +{ + total_steps = totalSteps; + step = 0; + percentage = 0; + + if(!color.isValid()) + color = KGlobalSettings::highlightColor(); + + painter = new QPainter(this); + painter->setBrush(color); + painter->setPen(color); + + QFont f = font(); + f.setBold(true); + painter->setFont(f); + + painter->setPen(color); + painter->setBrush(KGlobalSettings::baseColor()); + painter->drawRect(rect()); +} + +/* + * Internal. Set current progress to 'progress'. + */ +void SQ_Progress::setIndicator(int progress) +{ + int totalSteps = total_steps; + + // scale down... + if(totalSteps > INT_MAX/1000) + { + progress /= 1000; + totalSteps /= 1000; + } + + int np = progress * 100 / totalSteps; + + // draw progress if needed + if(np != percentage) + { + percentage = np; + drawProgress(); + } + + step = progress; +} + +/* + * Add 'step_new' to current step. + */ +void SQ_Progress::advance(int step_new) +{ + setIndicator(step + step_new); +} + +/* + * Clear drawing. + */ +void SQ_Progress::flush() +{ + delete painter; + painter = 0; +} + +void SQ_Progress::paintEvent(QPaintEvent *) +{ + if(painter) + { + drawProgress(); + } +} + +void SQ_Progress::drawProgress() +{ + int np = width() * percentage / 100; + + // reset clip rectangle + painter->setClipRect(0, 0, width(), height()); + painter->setPen(color); + painter->setBrush(KGlobalSettings::baseColor()); + painter->drawRect(rect()); + + // draw rectangle + painter->fillRect(2, 2, np-4, height()-4, color); + + if(m_text) + { + // draw percentage value + painter->setPen(KGlobalSettings::highlightedTextColor()); + painter->setClipRect(0, 0, np, height()); + painter->drawText(rect(), Qt::AlignCenter | Qt::SingleLine, QString::number(percentage) + '%'); + painter->setPen(KGlobalSettings::textColor()); + painter->setClipRect(np, 0, width()-np, height()); + painter->drawText(rect(), Qt::AlignCenter | Qt::SingleLine, QString::number(percentage) + '%'); + } +} diff --git a/ksquirrel/sq_progress.h b/ksquirrel/sq_progress.h new file mode 100644 index 0000000..5644b53 --- /dev/null +++ b/ksquirrel/sq_progress.h @@ -0,0 +1,99 @@ +/*************************************************************************** + sq_progress.h - description + ------------------- + begin : ??? ??? 29 2004 + copyright : (C) 2004 by Baryshev Dmitry + email : ksquirrel.iv@gmail.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifndef SQ_PROGRESS_H +#define SQ_PROGRESS_H + +#include +#include + +class QPainter; + +/* + * SQ_Progress is a simple replacement for QProgressBar + */ + +class SQ_Progress : public QLabel +{ + public: + SQ_Progress(QWidget *parent = 0, const char *name = 0); + ~SQ_Progress(); + + void setTotalSteps(int totalSteps); + void addSteps(int steps); + + void setColor(const QColor &c); // alternative progress color + + /* + * Set current progress to 'progress'. + */ + void setIndicator(int progress); + + /* + * Add 'step_new' to current step. + */ + void advance(int step_new = 1); + + /* + * Clear drawing. + */ + void flush(); + + bool showText() const; + + void setShowText(bool sh); + + protected: + virtual void paintEvent(QPaintEvent *); + + private: + void drawProgress(); + + private: + int percentage, total_steps, step; + bool m_text; + QColor color; + + QPainter *painter; +}; + +inline +bool SQ_Progress::showText() const +{ + return m_text; +} + +inline +void SQ_Progress::setShowText(bool sh) +{ + m_text = sh; +} + +inline +void SQ_Progress::setColor(const QColor &c) +{ + color = c; +} + +inline +void SQ_Progress::addSteps(int steps) +{ + total_steps += steps; + setIndicator(step); +} + +#endif diff --git a/ksquirrel/sq_progressbox.cpp b/ksquirrel/sq_progressbox.cpp new file mode 100644 index 0000000..8100029 --- /dev/null +++ b/ksquirrel/sq_progressbox.cpp @@ -0,0 +1,59 @@ +/*************************************************************************** + sq_progressbox.cpp - description + ------------------- + begin : ??? Jan 21 2007 + copyright : (C) 2007 by Baryshev Dmitry + email : ksquirrel.iv@gmail.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include + +#include "sq_iconloader.h" +#include "sq_progressbox.h" + +SQ_ProgressBox::SQ_ProgressBox(QWidget *parent, const char *name) : QHBox(parent, name) +{ +// QToolBar *progressBoxBar = new QToolBar(QString::null, NULL, this); + buttonStop = new QPushButton(this); + buttonStop->setFlat(true); + buttonStop->setPixmap(SQ_IconLoader::instance()->loadIcon("player_stop", KIcon::Desktop, KIcon::SizeSmall)); + connect(buttonStop, SIGNAL(clicked()), parent, SLOT(slotThumbnailUpdateToggle())); + + // create progress bar + p = new SQ_Progress(this); + + // setup progress bar + setFrameShape(QFrame::NoFrame); + setSpacing(0); + setMargin(0); + setStretchFactor(p, 1); + setGeometry(5, 5, 160, 22); + + hide(); +} + +SQ_ProgressBox::~SQ_ProgressBox() +{} + +void SQ_ProgressBox::startButtonPixmap() +{ + buttonStop->setPixmap(SQ_IconLoader::instance()->loadIcon("player_play", KIcon::Desktop, KIcon::SizeSmall)); +} + +void SQ_ProgressBox::stopButtonPixmap() +{ + buttonStop->setPixmap(SQ_IconLoader::instance()->loadIcon("player_stop", KIcon::Desktop, KIcon::SizeSmall)); +} diff --git a/ksquirrel/sq_progressbox.h b/ksquirrel/sq_progressbox.h new file mode 100644 index 0000000..888c9f3 --- /dev/null +++ b/ksquirrel/sq_progressbox.h @@ -0,0 +1,87 @@ +/*************************************************************************** + sq_progressbox.h - description + ------------------- + begin : ??? Jan 21 2007 + copyright : (C) 2007 by Baryshev Dmitry + email : ksquirrel.iv@gmail.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifndef SQ_PROGRESSBOX_H +#define SQ_PROGRESSBOX_H + +#include + +#include "sq_progress.h" + +class QPushButton; + +class SQ_ProgressBox : public QHBox +{ + public: + SQ_ProgressBox(QWidget * parent = 0, const char * name = 0); + ~SQ_ProgressBox(); + + SQ_Progress* progressBar() const; + + QPushButton* button() const; + + void stopButtonPixmap(); + void startButtonPixmap(); + + // redirect to SQ_Progress + void flush(); + void advance(int step = 1); + void setTotalSteps(int steps); + void addSteps(int steps); + + private: + SQ_Progress *p; + QPushButton *buttonStop; +}; + +inline +QPushButton* SQ_ProgressBox::button() const +{ + return buttonStop; +} + +inline +SQ_Progress* SQ_ProgressBox::progressBar() const +{ + return p; +} + +inline +void SQ_ProgressBox::flush() +{ + p->flush(); +} + +inline +void SQ_ProgressBox::advance(int step) +{ + p->advance(step); +} + +inline +void SQ_ProgressBox::setTotalSteps(int steps) +{ + p->setTotalSteps(steps); +} + +inline +void SQ_ProgressBox::addSteps(int steps) +{ + p->addSteps(steps); +} + +#endif diff --git a/ksquirrel/sq_selectdeselectgroup.ui b/ksquirrel/sq_selectdeselectgroup.ui new file mode 100644 index 0000000..2a0bea2 --- /dev/null +++ b/ksquirrel/sq_selectdeselectgroup.ui @@ -0,0 +1,106 @@ + +SQ_SelectDeselectGroup + + + SQ_SelectDeselectGroup + + + + 0 + 0 + 470 + 47 + + + + SQ_SelectDeselectGroup + + + true + + + + unnamed + + + + textLabel1 + + + Filename or mask: + + + + + comboMask + + + + 3 + 0 + 0 + 0 + + + + true + + + AtTop + + + true + + + false + + + + + pushMask + + + + + + + + pushEdit + + + Edit + + + + + + + pushMask + clicked() + SQ_SelectDeselectGroup + accept() + + + pushEdit + clicked() + SQ_SelectDeselectGroup + slotEdit() + + + + comboMask + pushMask + + + sq_config.h + sq_selectdeselectgroup.ui.h + + + slotEdit() + + + init() + exec( QString & mask ) + + + diff --git a/ksquirrel/sq_selectdeselectgroup.ui.h b/ksquirrel/sq_selectdeselectgroup.ui.h new file mode 100644 index 0000000..ff51234 --- /dev/null +++ b/ksquirrel/sq_selectdeselectgroup.ui.h @@ -0,0 +1,76 @@ +/**************************************************************************** +** ui.h extension file, included from the uic-generated form implementation. +** +** If you wish to add, delete or rename functions or slots use +** Qt Designer which will update this file, preserving your code. Create an +** init() function in place of a constructor, and a destroy() function in +** place of a destructor. +*****************************************************************************/ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#ifdef SQ_HAVE_KREGEXP +#include +#include +#include +#endif + +void SQ_SelectDeselectGroup::init() +{ + SQ_Config::instance()->setGroup("Fileview"); + comboMask->insertStringList(SQ_Config::instance()->readListEntry("selectdeselecthistory")); + +#ifdef SQ_HAVE_KREGEXP + // not installed + if(KTrader::self()->query("KRegExpEditor/KRegExpEditor").isEmpty()) + pushEdit->setEnabled(false); +#else + pushEdit->setEnabled(false); +#endif +} + +int SQ_SelectDeselectGroup::exec(QString &mask) +{ + int result = QDialog::exec(); + + if(result == QDialog::Accepted) + { + QStringList list; + int cc = comboMask->count(); + + for(int i = 0;i < cc;i++) + list.append(comboMask->text(i)); + + // save history + SQ_Config::instance()->setGroup("Fileview"); + SQ_Config::instance()->writeEntry("selectdeselecthistory", list); + + // save mask + mask = comboMask->currentText(); + } + + return mask.isEmpty() ? QDialog::Rejected : result; +} + +void SQ_SelectDeselectGroup::slotEdit() +{ +#ifdef SQ_HAVE_KREGEXP + QDialog *editorDialog = KParts::ComponentFactory::createInstanceFromQuery("KRegExpEditor/KRegExpEditor"); + + if(editorDialog) + { + KRegExpEditorInterface *editor = static_cast(editorDialog->qt_cast("KRegExpEditorInterface")); + + Q_ASSERT(editor); + editor->setRegExp(comboMask->currentText()); + + if(editorDialog->exec()) + { + comboMask->insertItem(editor->regExp()); + comboMask->setCurrentText(editor->regExp()); + } + } +#endif +} diff --git a/ksquirrel/sq_slideshow.ui b/ksquirrel/sq_slideshow.ui new file mode 100644 index 0000000..ded1e44 --- /dev/null +++ b/ksquirrel/sq_slideshow.ui @@ -0,0 +1,454 @@ + +SQ_SlideShow + + + SQ_SlideShow + + + + 0 + 0 + 425 + 350 + + + + Slideshow options + + + true + + + + unnamed + + + + layout2 + + + + unnamed + + + + spacer1 + + + Horizontal + + + Expanding + + + + 220 + 26 + + + + + + pushStart + + + Start + + + true + + + + + pushClose + + + Close + + + + + + + groupBox1 + + + + + + + unnamed + + + + textLabel1_2 + + + Directory: + + + AlignVCenter|AlignRight + + + + + spacer2 + + + Horizontal + + + Expanding + + + + 175 + 16 + + + + + + spinCycle + + + No + + + 1000 + + + + + spinDelay + + + ms + + + 100000 + + + 500 + + + 100 + + + + + textLabel1 + + + Delay: + + + AlignVCenter|AlignRight + + + + + textLabel1_4 + + + Repeats: + + + AlignVCenter|AlignRight + + + + + textLabel1_6 + + + Recursively + + + AlignVCenter|AlignRight + + + + + checkRecurs + + + + + + + + textSize + + + false + + + Show file size + + + AlignVCenter|AlignRight + + + + + textPos + + + false + + + Show current index + + + AlignVCenter|AlignRight + + + + + checkSize + + + false + + + + + + + + textName + + + false + + + Show file name + + + AlignVCenter|AlignRight + + + + + checkPos + + + false + + + + + + + + checkName + + + false + + + + + + + + textLabel1_3 + + + Background color: + + + AlignVCenter|AlignRight + + + + + bcolor + + + + + + + + spacer3_2 + + + Horizontal + + + Expanding + + + + 186 + 16 + + + + + + textLabel1_5 + + + Onscreen messages + + + AlignVCenter|AlignRight + + + + + checkMessages + + + + + + + + spacer3_2_2 + + + Horizontal + + + Expanding + + + + 145 + 16 + + + + + + tcolor + + + false + + + + + + + + textColor + + + false + + + Message text color: + + + AlignVCenter|AlignRight + + + + + layout3 + + + + unnamed + + + + kurl + + + + + pushCurrent + + + + + + + + pushHistory + + + + + + + + + + + + + + + + pushClose + clicked() + SQ_SlideShow + reject() + + + pushStart + clicked() + SQ_SlideShow + accept() + + + kurl + urlSelected(const QString&) + SQ_SlideShow + slotDirectory(const QString&) + + + checkMessages + toggled(bool) + SQ_SlideShow + slotMessages(bool) + + + + kurl + spinDelay + spinCycle + pushStart + pushClose + + + qstringlist.h + sq_config.h + sq_iconloader.h + qpopupmenu.h + sq_widgetstack.h + sq_slideshow.ui.h + + + QStringList items; + + + slotDirectory( const QString & dir ) + slotActivated( int id ) + slotCurrent() + slotMessages( bool b ) + + + init() + exec( QString & path ) + setPath( const QString & path ) + appendPath( const QString & path ) + + + + knuminput.h + knuminput.h + kcolorbutton.h + kcolorbutton.h + kurlrequester.h + klineedit.h + kpushbutton.h + + diff --git a/ksquirrel/sq_slideshow.ui.h b/ksquirrel/sq_slideshow.ui.h new file mode 100644 index 0000000..9a9119b --- /dev/null +++ b/ksquirrel/sq_slideshow.ui.h @@ -0,0 +1,127 @@ +/**************************************************************************** +** ui.h extension file, included from the uic-generated form implementation. +** +** If you wish to add, delete or rename functions or slots use +** Qt Designer which will update this file, preserving your code. Create an +** init() function in place of a constructor, and a destroy() function in +** place of a destructor. +*****************************************************************************/ + +#define SQ_HIST_NUMBER 25 + +void SQ_SlideShow::init() +{ + KFile::Mode mode = static_cast(KFile::Directory | KFile::ExistingOnly); + kurl->setMode(mode); + + SQ_Config::instance()->setGroup("Slideshow"); + + checkRecurs->setChecked(SQ_Config::instance()->readBoolEntry("recurs", false)); + spinDelay->setValue(SQ_Config::instance()->readNumEntry("delay", 1000)); + spinCycle->setValue(SQ_Config::instance()->readNumEntry("repeat", 0)); + pushCurrent->setPixmap(SQ_IconLoader::instance()->loadIcon("folder_green", KIcon::Desktop, 16)); + pushHistory->setPixmap(SQ_IconLoader::instance()->loadIcon("history", KIcon::Desktop, 16)); + checkMessages->setChecked(SQ_Config::instance()->readBoolEntry("messages", true)); + checkName->setChecked(SQ_Config::instance()->readBoolEntry("messages_name", true)); + checkSize->setChecked(SQ_Config::instance()->readBoolEntry("messages_size", false)); + checkPos->setChecked(SQ_Config::instance()->readBoolEntry("messages_pos", true)); + + QColor col; + col.setNamedColor(SQ_Config::instance()->readEntry("background", "#4e4e4e")); + bcolor->setColor(col); + col.setNamedColor(SQ_Config::instance()->readEntry("message_text", "#ffffff")); + tcolor->setColor(col); + + QPopupMenu *hist = new QPopupMenu; + items = SQ_Config::instance()->readListEntry("history"); + int i = 0; + + setPath(items.last()); + + for(QStringList::iterator it = items.begin();it != items.end();++it) + { + if(i++ < SQ_HIST_NUMBER) + hist->insertItem(*it); + else + break; + } + + connect(hist, SIGNAL(activated(int)), this, SLOT(slotActivated(int))); + + pushHistory->setPopup(hist); +} + +int SQ_SlideShow::exec(QString &path) +{ + int result = QDialog::exec(); + + if(result == QDialog::Accepted) + { + // save parameters + SQ_Config::instance()->setGroup("Slideshow"); + SQ_Config::instance()->writeEntry("delay", spinDelay->value()); + SQ_Config::instance()->writeEntry("repeat", spinCycle->value()); + SQ_Config::instance()->writeEntry("background", bcolor->color().name()); + SQ_Config::instance()->writeEntry("message_text", tcolor->color().name()); + SQ_Config::instance()->writeEntry("messages", checkMessages->isChecked()); + SQ_Config::instance()->writeEntry("messages_name", checkName->isChecked()); + SQ_Config::instance()->writeEntry("messages_size", checkSize->isChecked()); + SQ_Config::instance()->writeEntry("messages_pos", checkPos->isChecked()); + SQ_Config::instance()->writeEntry("history", items); + SQ_Config::instance()->writeEntry("recurs", checkRecurs->isChecked()); + path = kurl->url(); + } + + return result; +} + +void SQ_SlideShow::slotDirectory(const QString &dir) +{ + if(!dir.isEmpty()) + appendPath(dir); +} + +void SQ_SlideShow::setPath(const QString &path) +{ + kurl->setURL(path); +} + +void SQ_SlideShow::slotActivated(int id) +{ + QString dir = pushHistory->popup()->text(id); + + if(!dir.isEmpty()) + setPath(dir); +} + +void SQ_SlideShow::appendPath(const QString &path) +{ + if(items.findIndex(path) == -1) + { + items.append(path); + pushHistory->popup()->insertItem(path); + + if(items.count() > SQ_HIST_NUMBER) + items.pop_front(); + } +} + +void SQ_SlideShow::slotCurrent() +{ + QString path = SQ_WidgetStack::instance()->url().prettyURL(); + + setPath(path); + appendPath(path); +} + +void SQ_SlideShow::slotMessages( bool b) +{ + checkName->setEnabled(b); + checkPos->setEnabled(b); + checkSize->setEnabled(b); + textName->setEnabled(b); + textSize->setEnabled(b); + textPos->setEnabled(b); + textColor->setEnabled(b); + tcolor->setEnabled(b); +} diff --git a/ksquirrel/sq_slideshowlisting.ui b/ksquirrel/sq_slideshowlisting.ui new file mode 100644 index 0000000..f0b6a58 --- /dev/null +++ b/ksquirrel/sq_slideshowlisting.ui @@ -0,0 +1,113 @@ + +SQ_SlideShowListing + + + SQ_SlideShowListing + + + + 0 + 0 + 490 + 31 + + + + Form1 + + + + unnamed + + + 0 + + + + frame3 + + + StyledPanel + + + Raised + + + + unnamed + + + 2 + + + + textLabel1 + + + + 1 + 5 + 0 + 0 + + + + Listing + + + + + pushCancel + + + Cancel + + + + + textFile + + + + + + RichText + + + AlignVCenter + + + + + textCount + + + + 1 + + + + + + + + + + + + + + sq_slideshowlisting.ui.h + + + kill(); + + + init() + setFile( int count, const QString & f ) + + + + ksqueezedtextlabel.h + + diff --git a/ksquirrel/sq_slideshowlisting.ui.h b/ksquirrel/sq_slideshowlisting.ui.h new file mode 100644 index 0000000..4608f8b --- /dev/null +++ b/ksquirrel/sq_slideshowlisting.ui.h @@ -0,0 +1,22 @@ +/**************************************************************************** +** ui.h extension file, included from the uic-generated form implementation. +** +** If you want to add, delete, or rename functions or slots, use +** Qt Designer to update this file, preserving your code. +** +** You should not define a constructor or destructor in this file. +** Instead, write your code in functions called init() and destroy(). +** These will automatically be called by the form's constructor and +** destructor. +*****************************************************************************/ + +void SQ_SlideShowListing::init() +{ + connect(pushCancel, SIGNAL(clicked()), this, SIGNAL(kill())); +} + +void SQ_SlideShowListing::setFile(int count, const QString &f) +{ + textCount->setText(QString::fromLatin1("[%1]").arg(count)); + textFile->setText(f); +} diff --git a/ksquirrel/sq_slideshowwidget.cpp b/ksquirrel/sq_slideshowwidget.cpp new file mode 100644 index 0000000..d650602 --- /dev/null +++ b/ksquirrel/sq_slideshowwidget.cpp @@ -0,0 +1,366 @@ +/*************************************************************************** + sq_slideshowwidget.cpp - description + ------------------- + begin : ??? Mar 30 2007 + copyright : (C) 2007 by Baryshev Dmitry + email : ksquirrel.iv@gmail.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include + +#include "ksquirrel.h" +#include "sq_slideshowwidget.h" +#include "sq_imageloader.h" +#include "sq_iconloader.h" +#include "sq_config.h" +#include "sq_utils.h" + +#ifdef SQ_HAVE_KEXIF +#include +#include +#endif + +SQ_SlideShowWidget * SQ_SlideShowWidget::m_inst = 0; + +SQ_SlideShowWidget::SQ_SlideShowWidget(QWidget *parent, const char *name) + : QWidget(parent,name, Qt::WStyle_Customize | Qt::WStyle_NoBorder | Qt::WStyle_StaysOnTop | Qt::WNoAutoErase) +{ + m_inst = this; + + timerHide = new QTimer(this); + + message = new QLabel(this); + + QFont f = message->font(); + f.setPointSize(12); + f.setBold(true); + message->setFont(f); + message->setMargin(4); + message->setFrameShape(QFrame::NoFrame); + + connect(timerHide, SIGNAL(timeout()), this, SLOT(slotHide())); + + options = new QHBox(this, "kde toolbar widget"); + options->setSpacing(0); + options->setMargin(1); + options->move(0, 0); + options->hide(); + message->hide(); + + int is = KIcon::SizeMedium; + + QToolButton *b = new QToolButton(options); + b->setIconSet(SQ_IconLoader::instance()->loadIcon("previous", KIcon::Desktop, is)); + connect(b, SIGNAL(clicked()), this, SIGNAL(previous())); + connect(b, SIGNAL(clicked()), this, SLOT(slotResetPause())); + + b = new QToolButton(options); + b->setIconSet(SQ_IconLoader::instance()->loadIcon("next", KIcon::Desktop, is)); + connect(b, SIGNAL(clicked()), this, SIGNAL(next())); + connect(b, SIGNAL(clicked()), this, SLOT(slotResetPause())); + + buttonPause = new QToolButton(options); + buttonPause->setToggleButton(true); + buttonPause->setIconSet(SQ_IconLoader::instance()->loadIcon("player_pause", KIcon::Desktop, is)); + connect(buttonPause, SIGNAL(clicked()), this, SIGNAL(pause())); + + b = new QToolButton(options); + b->setIconSet(SQ_IconLoader::instance()->loadIcon("help", KIcon::Desktop, is)); + connect(b, SIGNAL(clicked()), this, SLOT(slotShowHelp())); + + b = new QToolButton(options); + b->setIconSet(SQ_IconLoader::instance()->loadIcon("cancel", KIcon::Desktop, is)); + connect(b, SIGNAL(clicked()), this, SIGNAL(stopSlideShow())); + + options->adjustSize(); + message->setFixedHeight(options->height()); + + options->installEventFilter(this); + + KCursor::setAutoHideCursor(this, true); + KCursor::setHideCursorDelay(2500); +} + +SQ_SlideShowWidget::~SQ_SlideShowWidget() +{} + +void SQ_SlideShowWidget::beginSlideShow(int totl) +{ + total = totl; + + SQ_Config::instance()->setGroup("Slideshow"); + + bgcolor.setNamedColor(SQ_Config::instance()->readEntry("background", "#4e4e4e")); + + messages = SQ_Config::instance()->readBoolEntry("messages", true); + mes_pos = SQ_Config::instance()->readBoolEntry("messages_pos", true); + mes_name = SQ_Config::instance()->readBoolEntry("messages_name", true); + mes_size = SQ_Config::instance()->readBoolEntry("messages_size", false); + tcolor.setNamedColor(SQ_Config::instance()->readEntry("message_text", "#ffffff")); + + // fake transparency + message->setPaletteForegroundColor(tcolor); + message->setPaletteBackgroundColor(bgcolor); + + show(); + setGeometry(KGlobalSettings::desktopGeometry(KSquirrel::app())); + + message->hide(); + options->hide(); + + if(messages) + { + message->move(0, 0); + message->show(); + } + + path = ""; + current = 0; + buttonPause->setOn(false); + + setFocus(); +} + +void SQ_SlideShowWidget::endSlideShow() +{ + options->hide(); + message->hide(); + hide(); + + pixmap = QPixmap(); +} + +void SQ_SlideShowWidget::loadImage(const QString &_path, int _current) +{ + fmt_info *finfo; + RGBA *bits; + + // load first page + bool b = SQ_ImageLoader::instance()->loadImage(_path, SQ_CodecSettings::ImageViewer); + + finfo = SQ_ImageLoader::instance()->info(); + bits = SQ_ImageLoader::instance()->bits(); + + // memory allocation failed in SQ_ImageLoader::loadImage() + if(!b || !bits || !finfo->image.size()) + return; + + path = _path; + current = _current; + + constructMessage(); + + pixmap = QPixmap(); + + int w = finfo->image[0].w; + int h = finfo->image[0].h; + QImage *all = 0, *small = 0; + + all = new QImage((uchar *)bits, w, h, 32, 0, 0, QImage::LittleEndian); + all->setAlphaBuffer(true); + + // scale down to fit into window + if(w > width() || h > height()) + { + small = new QImage(); + *small = SQ_Utils::scale(*all, width(), height(), SQ_Utils::SMOOTH_FAST, QImage::ScaleMin); + + delete all; + all = 0; + + if(small->isNull()) + { + SQ_ImageLoader::instance()->cleanup(); + return; + } + } + else + small = all; + + const int wh = small->width() * small->height(); + unsigned char t; + RGBA *sk = reinterpret_cast(small->bits()); + + // swap R and B components - QPixmap need it + for(int i = 0;i < wh;i++) + { + t = (sk+i)->r; + (sk+i)->r = (sk+i)->b; + (sk+i)->b = t; + } + +#ifdef SQ_HAVE_KEXIF + KExifData data; + data.readFromFile(_path); + int O = data.getImageOrientation(); + + if(O != KExifData::UNSPECIFIED && O != KExifData::NORMAL) + { + // copy original image + QImage img = *small; + + // rotate image + SQ_Utils::exifRotate(QString::null, img, O); + + // transfer back + *small = img; + } +#endif + + pixmap.convertFromImage(*small); + + // finally clean all memory buffers + SQ_ImageLoader::instance()->cleanup(); + + delete small; + + // show loaded image + update(); +} + +void SQ_SlideShowWidget::paintEvent(QPaintEvent *e) +{ + QPainter p(this); + + p.setClipRect(e->rect()); + p.fillRect(e->rect(), bgcolor); + + if(!pixmap.isNull()) + p.drawPixmap((width() - pixmap.width()) / 2, (height() - pixmap.height()) / 2, pixmap); +} + +void SQ_SlideShowWidget::closeEvent(QCloseEvent *e) +{ + emit stopSlideShow(); + + e->ignore(); +} + +void SQ_SlideShowWidget::keyPressEvent(QKeyEvent *e) +{ + if(e->key() == Qt::Key_Enter || e->key() == Qt::Key_Escape || e->key() == Qt::Key_Return) + close(); + else if(e->key() == Qt::Key_Pause || e->key() == Qt::Key_Space) + { + buttonPause->toggle(); + emit pause(); + } + else if(e->key() == Qt::Key_PageUp) + emit previous(); + else if(e->key() == Qt::Key_PageDown) + emit next(); + else if(e->key() == Qt::Key_M) + { + SQ_Config::instance()->setGroup("Slideshow"); + + messages = SQ_Config::instance()->readBoolEntry("messages", true); + messages = !messages; + SQ_Config::instance()->writeEntry("messages", messages); + + if(options->isVisible() && messages) + message->move(options->width()+1, 0); + + constructMessage(); + + message->setShown(messages); + } + + e->accept(); +} + +void SQ_SlideShowWidget::mouseMoveEvent(QMouseEvent *) +{ + if(!options->isVisible()) + { + options->show(); + if(messages) message->move(options->width()+1, 0); + } + + timerHide->start(1500, true); +} + +void SQ_SlideShowWidget::slotHide() +{ + options->hide(); + + if(messages) message->move(0, 0); +} + +bool SQ_SlideShowWidget::eventFilter(QObject *, QEvent *e) +{ + if(e->type() == QEvent::Enter) + { + timerHide->stop(); + return true; + } + + return false; +} + +void SQ_SlideShowWidget::slotShowHelp() +{ + QWhatsThis::display(i18n( + "" + "" + "" + "" + "" + "" + "
Enter, Escape, Returnstop slideshow
Pause, Spacepause/unpause slideshow
Page Upprevious image
Page Downnext image
Mshow/hide onscreen messages
" + )); +} + +void SQ_SlideShowWidget::constructMessage() +{ + // construct onscreen message + if(messages) + { + QFileInfo fm(path); + QString s_message; + + if(mes_pos) s_message = QString::fromLatin1("[%1/%2] ").arg(current+1).arg(total); + + if(mes_name) s_message += fm.fileName(); + + if(mes_size) + s_message = (mes_name || mes_pos) ? (s_message + " (" + KIO::convertSize(fm.size()) + ')') : KIO::convertSize(fm.size()); + + message->setText(s_message); + message->adjustSize(); + } +} + +void SQ_SlideShowWidget::slotResetPause() +{ + buttonPause->setOn(false); +} + +#include "sq_slideshowwidget.moc" diff --git a/ksquirrel/sq_slideshowwidget.h b/ksquirrel/sq_slideshowwidget.h new file mode 100644 index 0000000..5d14a68 --- /dev/null +++ b/ksquirrel/sq_slideshowwidget.h @@ -0,0 +1,107 @@ +/*************************************************************************** + sq_slideshowwidget.h - description + ------------------- + begin : ??? Mar 30 2007 + copyright : (C) 2007 by Baryshev Dmitry + email : ksquirrel.iv@gmail.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifndef SQ_SLIDESHOWWIDGET_H +#define SQ_SLIDESHOWWIDGET_H + +#include +#include + +class QTimer; +class QHBox; +class QLabel; +class QToolButton; + +/** + *@author Baryshev Dmitry + * + * A widget to show slideshow. It contains toolbar + * with some useful actions like "pause", "close", "next image" etc. + * It also can show onscreen message, which format is configured through + * "Action -> Slideshow advanced". + */ + +class SQ_SlideShowWidget : public QWidget +{ + Q_OBJECT + + public: + SQ_SlideShowWidget(QWidget *parent = 0, const char *name = 0); + ~SQ_SlideShowWidget(); + + void beginSlideShow(int totl); + void endSlideShow(); + void loadImage(const QString &path, int); + + virtual bool eventFilter(QObject * watched, QEvent *e); + + static SQ_SlideShowWidget* instance() { return m_inst; } + + protected: + /* + * Draw decoded image + */ + virtual void paintEvent(QPaintEvent *); + + /* + * Ignore close event and tell KSquirrel to stop slideshow + */ + virtual void closeEvent(QCloseEvent *); + + /* + * Return, Escape = stop slideshow + * Pause, Space = pause/unpause slideshow + * Page Up = previous image + * Page Down = next image + */ + virtual void keyPressEvent(QKeyEvent *); + + /* + * show toolbar with actions + */ + virtual void mouseMoveEvent(QMouseEvent *); + + private: + void constructMessage(); + + signals: + void stopSlideShow(); + void pause(); + void next(); + void previous(); + + private slots: + void slotHide(); + void slotShowHelp(); + void slotResetPause(); + + private: + QString path; + int current; + QPixmap pixmap; + QColor bgcolor, tcolor; + QTimer *timerHide; + QLabel *message; + QHBox *options; + bool messages, mes_name, mes_size, mes_pos; + int total; + QToolButton *buttonPause; + + static SQ_SlideShowWidget *m_inst; +}; + +#endif diff --git a/ksquirrel/sq_splashscreen.cpp b/ksquirrel/sq_splashscreen.cpp new file mode 100644 index 0000000..3d0e66f --- /dev/null +++ b/ksquirrel/sq_splashscreen.cpp @@ -0,0 +1,107 @@ +/* + * (C) 2006 Baryshev Dmitry, KSquirrel project. + * Originally based on kstartuplogo.cpp from KDEvelop project + */ + +/*************************************************************************** + kstartuplogo.cpp - description + ------------------- + artwork : KDevelop Project / Ralf Nolden + begin : Mon Oct 1 2001 + copyright : (C) 2001 by Kai Heitkamp + email : koncd@kai-heitkamp.de + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 * + * USA. * + * * + * For license exceptions see LICENSE.EXC file, attached with the source * + * code. * + * * + ***************************************************************************/ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include +#include +#include +#include + +#include "sq_splashscreen.h" +#include "sq_progress.h" + +SQ_SplashScreen * SQ_SplashScreen::m_inst = 0; + +SQ_SplashScreen::SQ_SplashScreen(QWidget * parent, const char *name) + : QWidget(parent, name, + Qt::WStyle_Customize | + Qt::WStyle_NoBorder | + Qt::WStyle_StaysOnTop | + Qt::WDestructiveClose | + Qt::WX11BypassWM) +{ + kdDebug() << "+SQ_SplashScreen" << endl; + + m_inst = this; + + QPixmap pix = QPixmap(locate("data", "images/splash.png")); + + setPaletteBackgroundPixmap(pix); + + QRect rc = KGlobalSettings::splashScreenDesktopGeometry(); + + move(rc.center().x() - pix.width()/2, rc.center().y() - pix.height()/2); + setFixedWidth(pix.width()); + setFixedHeight(pix.height()); + + pr = new SQ_Progress(this); + pr->setGeometry(201, 255, 162, 14); + pr->setShowText(false); + pr->setColor(QColor(170,100,110)); + pr->setTotalSteps(10); +} + +SQ_SplashScreen::~SQ_SplashScreen() +{ + kdDebug() << "-SQ_SplashScreen" << endl; + + m_inst = 0; +} + +void SQ_SplashScreen::finish() +{ + if(SQ_SplashScreen::instance()) + { + SQ_SplashScreen::instance()->progress()->flush(); + SQ_SplashScreen::instance()->close(); + } +} + +void SQ_SplashScreen::mousePressEvent(QMouseEvent *e) +{ + e->accept(); + + hide(); +} + +void SQ_SplashScreen::advance() +{ + if(SQ_SplashScreen::instance()) + SQ_SplashScreen::instance()->progress()->advance(); +} diff --git a/ksquirrel/sq_splashscreen.h b/ksquirrel/sq_splashscreen.h new file mode 100644 index 0000000..3ca0505 --- /dev/null +++ b/ksquirrel/sq_splashscreen.h @@ -0,0 +1,72 @@ +/* + * (C) Baryshev Dmitry, KSquirrel project. + * Originally based on kstartuplogo.h from KDevelop project + */ + +/*************************************************************************** + kstartuplogo.h - description + ------------------- + artwork : KDevelop Project / Ralf Nolden + begin : Mon Oct 1 2001 + copyright : (C) 2001 by Kai Heitkamp + email : koncd@kai-heitkamp.de + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 * + * USA. * + * * + * For license exceptions see LICENSE.EXC file, attached with the source * + * code. * + * * + ***************************************************************************/ + +#ifndef KSTARTUPLOGO_H +#define KSTARTUPLOGO_H + +#include + +class SQ_Progress; + +class SQ_SplashScreen : public QWidget +{ + public: + SQ_SplashScreen(QWidget *parent = 0, const char *name = 0); + ~SQ_SplashScreen(); + + static void advance(); + static void finish(); + + SQ_Progress *progress(); + + static SQ_SplashScreen* instance() { return m_inst; } + + protected: + virtual void mousePressEvent(QMouseEvent *); + + private: + SQ_Progress *pr; + + static SQ_SplashScreen *m_inst; +}; + +inline +SQ_Progress* SQ_SplashScreen::progress() +{ + return pr; +} + +#endif diff --git a/ksquirrel/sq_tabopendialog.ui b/ksquirrel/sq_tabopendialog.ui new file mode 100644 index 0000000..7928c39 --- /dev/null +++ b/ksquirrel/sq_tabopendialog.ui @@ -0,0 +1,104 @@ + +SQ_TabOpenDialog + + + SQ_TabOpenDialog + + + + 0 + 0 + 341 + 85 + + + + Opening... + + + true + + + + unnamed + + + + pushButton1 + + + Open in a new tab + + + + + pushButton2 + + + Replace current tab + + + + + pushButton3 + + + Close all and open in a new tab + + + + + spacer2 + + + Vertical + + + Expanding + + + + 10 + 31 + + + + + + + + pushButton1 + clicked() + SQ_TabOpenDialog + slotPush1() + + + pushButton2 + clicked() + SQ_TabOpenDialog + slotPush2() + + + pushButton3 + clicked() + SQ_TabOpenDialog + slotPush3() + + + + sq_tabopendialog.ui.h + + + int res; + + + slotPush1() + slotPush2() + slotPush3() + + + init() + result() + + + diff --git a/ksquirrel/sq_tabopendialog.ui.h b/ksquirrel/sq_tabopendialog.ui.h new file mode 100644 index 0000000..7e21e52 --- /dev/null +++ b/ksquirrel/sq_tabopendialog.ui.h @@ -0,0 +1,40 @@ +/**************************************************************************** +** ui.h extension file, included from the uic-generated form implementation. +** +** If you want to add, delete, or rename functions or slots, use +** Qt Designer to update this file, preserving your code. +** +** You should not define a constructor or destructor in this file. +** Instead, write your code in functions called init() and destroy(). +** These will automatically be called by the form's constructor and +** destructor. +*****************************************************************************/ + +void SQ_TabOpenDialog::init() +{ + res = -1; +} + +void SQ_TabOpenDialog::slotPush1() +{ + res = 0; + accept(); +} + + +void SQ_TabOpenDialog::slotPush2() +{ + res = 1; + accept(); +} + +void SQ_TabOpenDialog::slotPush3() +{ + res = 2; + accept(); +} + +int SQ_TabOpenDialog::result() +{ + return res; +} diff --git a/ksquirrel/sq_thumbnailcachemaster.ui b/ksquirrel/sq_thumbnailcachemaster.ui new file mode 100644 index 0000000..1dace2b --- /dev/null +++ b/ksquirrel/sq_thumbnailcachemaster.ui @@ -0,0 +1,264 @@ + +SQ_ThumbnailCacheMaster + + + SQ_ThumbnailCacheMaster + + + + 0 + 0 + 331 + 244 + + + + Thumbnail cache + + + true + + + + unnamed + + + + pushCache + + + Calculate cache size on disk + + + false + + + + + textThumbSize + + + StyledPanel + + + 1 + + + + + + AlignCenter + + + + + pushClearCache + + + Clear cache on disk + + + false + + + + + pushShowCache + + + View memory cache + + + false + + + + + pushClearCacheMemory + + + Clear cache in memory + + + false + + + + + textCacheMemSize + + + StyledPanel + + + 1 + + + + + + AlignCenter + + + + + pushSyncCache + + + Sync cache to disk + + + false + + + + + pushCacheMemory + + + Calculate cache size in memory + + + false + + + + + line1 + + + HLine + + + Sunken + + + Horizontal + + + + + layout1 + + + + unnamed + + + + spacer1 + + + Horizontal + + + Expanding + + + + 195 + 21 + + + + + + pushClose + + + Close + + + + + + + + + + + pushSyncCache + clicked() + SQ_ThumbnailCacheMaster + slotSyncCache() + + + pushShowCache + clicked() + SQ_ThumbnailCacheMaster + slotShowDiskCache() + + + pushClearCacheMemory + clicked() + SQ_ThumbnailCacheMaster + slotClearMemoryCache() + + + pushClearCache + clicked() + SQ_ThumbnailCacheMaster + slotClearCache() + + + pushCacheMemory + clicked() + SQ_ThumbnailCacheMaster + slotCalcCacheMemory() + + + pushCache + clicked() + SQ_ThumbnailCacheMaster + slotCalcCache() + + + pushClose + clicked() + SQ_ThumbnailCacheMaster + reject() + + + + pushCache + pushClearCache + pushCacheMemory + pushShowCache + pushClearCacheMemory + pushSyncCache + pushClose + + + kio/job.h + qapplication.h + kdirsize.h + sq_viewcache.h + sq_pixmapcache.h + sq_dirthumbs.h + sq_iconloader.h + kio/global.h + kio/job.h + sq_thumbnailcachemaster.ui.h + + + slotCalcCache() + slotClearCache() + slotClearFinished( KIO::Job * ) + slotClearMemoryCache() + slotCalcCacheMemory() + slotShowDiskCache() + slotSyncCache() + + + init() + + + + kpushbutton.h + kpushbutton.h + kpushbutton.h + kpushbutton.h + kpushbutton.h + kpushbutton.h + + diff --git a/ksquirrel/sq_thumbnailcachemaster.ui.h b/ksquirrel/sq_thumbnailcachemaster.ui.h new file mode 100644 index 0000000..9c45919 --- /dev/null +++ b/ksquirrel/sq_thumbnailcachemaster.ui.h @@ -0,0 +1,89 @@ +/**************************************************************************** +** ui.h extension file, included from the uic-generated form implementation. +** +** If you wish to add, delete or rename functions or slots use +** Qt Designer which will update this file, preserving your code. Create an +** init() function in place of a constructor, and a destroy() function in +** place of a destructor. +*****************************************************************************/ + +/* + * SQ_ThumbnailCacheMaster manipulates thumbnail cache + * in memory and on disk. It can show current cache size, + * delete cache on disk, clear cache etc. + */ + +void SQ_ThumbnailCacheMaster::init() +{ + pushCache->setIconSet(SQ_IconLoader::instance()->loadIcon("kcalc", KIcon::Desktop, KIcon::SizeSmall)); + pushCacheMemory->setIconSet(SQ_IconLoader::instance()->loadIcon("kcalc", KIcon::Desktop, KIcon::SizeSmall)); + pushShowCache->setIconSet(SQ_IconLoader::instance()->loadIcon("memory", KIcon::Desktop, KIcon::SizeSmall)); + + slotCalcCacheMemory(); +} + +void SQ_ThumbnailCacheMaster::slotCalcCache() +{ + SQ_DirThumbs tmp; + + KURL url = tmp.root(); + + int size = KDirSize::dirSize(url); + + QString s = KIO::convertSize(size); + + textThumbSize->setText(s); +} + +void SQ_ThumbnailCacheMaster::slotClearCache() +{ + QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); + + SQ_DirThumbs tmp; + + KURL url = tmp.root(); + + KIO::DeleteJob *job = KIO::del(url); + connect(job, SIGNAL(result(KIO::Job*)), this, SLOT(slotClearFinished(KIO::Job*))); +} + +void SQ_ThumbnailCacheMaster::slotClearFinished( KIO::Job * ) +{ + QApplication::restoreOverrideCursor(); + slotCalcCache(); +} + +void SQ_ThumbnailCacheMaster::slotClearMemoryCache() +{ + QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); + + SQ_PixmapCache::instance()->clear(); + slotCalcCacheMemory(); + + QApplication::restoreOverrideCursor(); +} + +void SQ_ThumbnailCacheMaster::slotCalcCacheMemory() +{ + textCacheMemSize->setText(QString::fromLatin1("%1/%2") + .arg(KIO::convertSize(SQ_PixmapCache::instance()->totalSize())) + .arg(KIO::convertSize(SQ_PixmapCache::instance()->cacheLimit()))); +} + +void SQ_ThumbnailCacheMaster::slotShowDiskCache() +{ + SQ_ViewCache m_view(this); + m_view.exec(); +} + +void SQ_ThumbnailCacheMaster::slotSyncCache() +{ + QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); + + SQ_PixmapCache::instance()->sync(); + + slotCalcCacheMemory(); + slotCalcCache(); + + QApplication::restoreOverrideCursor(); +} diff --git a/ksquirrel/sq_thumbnailinfo.h b/ksquirrel/sq_thumbnailinfo.h new file mode 100644 index 0000000..f9f9448 --- /dev/null +++ b/ksquirrel/sq_thumbnailinfo.h @@ -0,0 +1,52 @@ +/*************************************************************************** + sq_thumbnailinfo.h - description + ------------------- + begin : 11 2004 + copyright : (C) 2004 by Baryshev Dmitry + email : ksquirrel.iv@gmail.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifndef SQ_THUMBNAILINFO_H +#define SQ_THUMBNAILINFO_H + +#include +#include +#include + +#include + +// default thumbnail format +#define sqdirThumbFormat "PNG" + +// default quality +#define sqdirThumbQuality 85 + +#define sqdirMimeFormat "XPM" + +/* + * Represents thumbnail. + */ +struct SQ_Thumbnail +{ + // mime icon from image codec + QPixmap mime; + + // 'last modifiled' time of original file. + // we should store it for non-local urls + time_t originalTime; + + int w, h; + + QImage thumbnail; +}; + +#endif diff --git a/ksquirrel/sq_thumbnailloadjob.cpp b/ksquirrel/sq_thumbnailloadjob.cpp new file mode 100644 index 0000000..3ca98c9 --- /dev/null +++ b/ksquirrel/sq_thumbnailloadjob.cpp @@ -0,0 +1,480 @@ +/* + copyright : (C) 2004 by Baryshev Dmitry + KSquirrel - image viewer for KDE +*/ + +/* This file is part of the KDE project + Copyright (C) 2000 David Faure + 2000 Carsten Pfeiffer + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +*/ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#include "sq_config.h" +#include "sq_widgetstack.h" +#include "sq_pixmapcache.h" +#include "sq_dirthumbs.h" +#include "sq_thumbnailloadjob.h" +#include "sq_libraryhandler.h" +#include "sq_thumbnailsize.h" +#include "sq_thumbnailsunused.h" +#include "sq_utils.h" +#include "sq_filethumbview.h" +#include "sq_filethumbviewitem.h" +#include "sq_imageloader.h" + +#include + +#include + +#define SQ_PREDOWNLOAD_SIZE 20 + +SQ_ThumbnailLoadJob::SQ_ThumbnailLoadJob(const KFileItemList &items, SQ_FileThumbView *parnt) + : KIO::Job(false), parent(parnt) +{ + mBrokenThumbnail.thumbnail = KGlobal::iconLoader()->loadIcon("file_broken", KIcon::Desktop, SQ_ThumbnailSize::smallest()); + mItems = items; + + donothing = false; + + dir = new SQ_DirThumbs; +} + +SQ_ThumbnailLoadJob::~SQ_ThumbnailLoadJob() +{ + delete dir; +} + +void SQ_ThumbnailLoadJob::start() +{ + if(mItems.isEmpty()) + { + emit done(); + delete this; + return; + } + + determineNextIcon(); +} + +void SQ_ThumbnailLoadJob::appendItem(const KFileItem* item) +{ + mItems.append(item); +} + +void SQ_ThumbnailLoadJob::itemRemoved(const KFileItem* item) +{ + mItems.removeRef(item); + + nextFile(item == mCurrentItem); +} + +void SQ_ThumbnailLoadJob::itemsRemoved(const KFileItemList &items) +{ + KFileItem *item; + bool next = false; + KFileItemList *m_items = const_cast(&items); + + if(!mItems.isEmpty() && !items.isEmpty()) + { + for(item = m_items->first();item;item = m_items->next()) + { + mItems.removeRef(item); + + if(item == mCurrentItem) + next = true; + } + } + + nextFile(next); +} + +void SQ_ThumbnailLoadJob::pop(const KFileItemList &items) +{ + KFileItem *item; + bool next = false; + KFileItemList *m_items = const_cast(&items); + + if(!mItems.isEmpty() && !items.isEmpty()) + { + for(item = m_items->first();item;item = m_items->next()) + { + mItems.removeRef(item); + + if(item == mCurrentItem) + next = true; + } + + for(item = m_items->last();item;item = m_items->prev()) + mItems.prepend(item); + } + + nextFile(next); +} + +void SQ_ThumbnailLoadJob::nextFile(bool b) +{ + if(b) + { + KIO::Job *j = subjobs.first(); + + if(j) + { + j->kill(); + subjobs.removeFirst(); + } + + determineNextIcon(); + } +} + +void SQ_ThumbnailLoadJob::determineNextIcon() +{ + if(donothing) + return; + + KFileItem *item = 0; + SQ_FileThumbViewItem *tfi; + + while(true) + { + item = mItems.first(); + + if(!item) + { + emit done(); + delete this; + return; + } + + SQ_WidgetStack::instance()->thumbnailProcess(); + + tfi = reinterpret_cast(item->extraData(parent)); + + // 1) local urls that are 100% supported, or + // 2) remote urls that are 100% supported or _maybe_ supported (application/octet-stream) + if(item->isReadable() && SQ_LibraryHandler::instance()->maybeSupported(item->url(), item->mimetype()) != SQ_LibraryHandler::No) + break; + else + { + mItems.removeFirst(); + tfi->setListed(true); + } + } + + if(mItems.isEmpty() || !item) + { + emit done(); + delete this; + return; + } + else + { + mState = STATE_STATORIG; + mCurrentItem = mItems.first(); + mCurrentURL = mCurrentItem->url(); + mItems.removeFirst(); + + KIO::StatJob *job = KIO::stat(mCurrentURL, false); + job->setSide(true); + job->setDetails(0); + addSubjob(job); + } +} + +void SQ_ThumbnailLoadJob::slotResult(KIO::Job *job) +{ + subjobs.remove(job); +// Q_ASSERT(subjobs.isEmpty()); + + switch(mState) + { + case STATE_STATORIG: + { + KIO::UDSEntry entry = mCurrentItem->entry(); + KIO::UDSEntry::ConstIterator it = entry.begin(); + mOriginalTime = 0; + size = totalSize = 0; + QString suff; + + for(; it != entry.end(); ++it) + { + if((*it).m_uds == KIO::UDS_MODIFICATION_TIME) + { + mOriginalTime = (time_t)((*it).m_long); + } + else if((*it).m_uds == KIO::UDS_SIZE) + { + totalSize = (KIO::filesize_t)((*it).m_long); + } + else if((*it).m_uds == KIO::UDS_NAME) + { + suff = (*it).m_str; + } + } + + mThumbURL.setPath(dir->absPath(mCurrentURL)); + + if(mCurrentURL.isLocalFile()) + { + if(!statResultThumbnail()) + createThumbnail(mCurrentURL); + + determineNextIcon(); + } + else if(statResultThumbnail()) + determineNextIcon(); + else if(SQ_ThumbnailsUnused::instance()->needUpdate(mCurrentURL, mOriginalTime)) + { + mState = STATE_PREDOWNLOAD; + continueDownload = false; + + tmp = new KTempFile(QString::null, QString::fromLatin1(".%1").arg(suff), 0600); + tmp->setAutoDelete(true); + tmp->close(); + + mTempURL.setPath(tmp->name()); + + KIO::Job *cpjob = KIO::get(mCurrentURL, false, false); + + connect(cpjob, SIGNAL(data(KIO::Job *, const QByteArray &)), + this, SLOT(slotData(KIO::Job *, const QByteArray &))); + + addSubjob(cpjob); + } + else + determineNextIcon(); + } + break; + + case STATE_PREDOWNLOAD: + { + // error + if(job->error() && job->error() != KIO::ERR_USER_CANCELED) + emitThumbnailLoadingFailed(); + + // no errors, or canceled + delete tmp; + determineNextIcon(); + } + break; + + case STATE_DOWNLOAD: + { + if(job->error()) + emitThumbnailLoadingFailed(); + else if(SQ_LibraryHandler::instance()->libraryForFile(mTempURL.path())) + createThumbnail(mTempURL); + else + SQ_ThumbnailsUnused::instance()->insert(mCurrentURL, mOriginalTime); + + delete tmp; + determineNextIcon(); + } + break; + } +} + +void SQ_ThumbnailLoadJob::slotData(KIO::Job *job, const QByteArray &data) +{ + if(!data.size()) + return; + + size += data.size(); + + QFile f(mTempURL.path()); + + if(f.open(IO_WriteOnly | IO_Append)) + { + f.writeBlock(data); + f.close(); + } + + // 20 bytes are enough to determine file type + if(size >= SQ_PREDOWNLOAD_SIZE && !continueDownload) + { + // cancel download (file type is not supported) + if(totalSize != size + && !SQ_LibraryHandler::instance()->libraryForFile(mTempURL.path())) + { + SQ_ThumbnailsUnused::instance()->insert(mCurrentURL, mOriginalTime); + job->kill(false); // kill job & emit result + } + else if(!statResultThumbnail()) + { + // nice, we can open this image - + // go to 'STATE_DOWNLOAD' stage and continue download + continueDownload = true; + mState = STATE_DOWNLOAD; + } + else if(size != totalSize) + { + job->kill(true); // kill job + subjobs.remove(job); + determineNextIcon(); + } + } +} + +bool SQ_ThumbnailLoadJob::statResultThumbnail() +{ + SQ_Thumbnail th; + + if(SQ_PixmapCache::instance()->contains2(mCurrentURL, th)) + { + emitThumbnailLoaded(th); + return true; + } + + if(dir->needUpdate(mThumbURL.path(), mOriginalTime)) + { +// kdDebug() << "STAT **** thumbnailTime < mOriginalTime ****" << endl; + return false; + } + + if(!th.thumbnail.load(mThumbURL.path(), sqdirThumbFormat)) + return false; + + SQ_LIBRARY *lib = SQ_LibraryHandler::instance()->libraryForFile(mCurrentURL); + + th.w = th.thumbnail.text("Thumb::Image::Width").toInt(); + th.h = th.thumbnail.text("Thumb::Image::Height").toInt(); + + if((!th.w || !th.h) && mCurrentURL.isLocalFile()) + SQ_ImageLoader::instance()->tasteImage(mCurrentURL.path(), &th.w, &th.h, lib); + + th.mime = lib->mime; + th.originalTime = mOriginalTime; + th.mime.load(dir->absPath(mCurrentURL), sqdirMimeFormat); + + insertOrSync(mCurrentURL, th); + + emitThumbnailLoaded(th); + + return true; +} + +void SQ_ThumbnailLoadJob::createThumbnail(const KURL &pixPath) +{ + SQ_Thumbnail th; + bool loaded = false; + + if(SQ_PixmapCache::instance()->contains2(pixPath, th)) + { + emitThumbnailLoaded(th); +// kdDebug() << "CREATE found in cache \"" << pixPath << "\"" << endl; + return; + } + + loaded = SQ_Utils::loadThumbnail(pixPath, th); + + if(loaded) + { + th.originalTime = mOriginalTime; + th.thumbnail = th.thumbnail.swapRGB(); + insertOrSync(mCurrentURL, th); + emitThumbnailLoaded(th); + } + else + emitThumbnailLoadingFailed(); +} + +void SQ_ThumbnailLoadJob::insertOrSync(const KURL &url, SQ_Thumbnail &th) +{ + if(!SQ_PixmapCache::instance()->full()) + { + SQ_PixmapCache::instance()->insert(url, th); +// kdDebug() << "IOSYNC inserting \"" << url.url() << "\"" << endl; + } + else + { +// kdDebug() << "IOSYNC SQ_PixmapCache is full! Cache is ignored!" << endl; + SQ_PixmapCache::instance()->syncEntry(url, th); + } +} + +void SQ_ThumbnailLoadJob::emitThumbnailLoaded(SQ_Thumbnail &t) +{ + int biggestDimension = QMAX(t.thumbnail.width(), t.thumbnail.height()); + int thumbPixelSize = SQ_ThumbnailSize::instance()->pixelSize(); + + if(biggestDimension <= thumbPixelSize) + { + emit thumbnailLoaded(mCurrentItem, t); + return; + } + + t.thumbnail = SQ_Utils::scaleImage( + t.thumbnail.bits(), + t.thumbnail.width(), + t.thumbnail.height(), + thumbPixelSize); + + emit thumbnailLoaded(mCurrentItem, t); +} + +void SQ_ThumbnailLoadJob::emitThumbnailLoadingFailed() +{ + emit thumbnailLoaded(mCurrentItem, mBrokenThumbnail); +} + +void SQ_ThumbnailLoadJob::appendItems(const KFileItemList &items) +{ + KFileItem *item; + KFileItemList *m_items = const_cast(&items); + + if(!mItems.isEmpty() && !items.isEmpty()) + { + for(item = m_items->first();item;item = m_items->next()) + mItems.append(item); + } +} + +void SQ_ThumbnailLoadJob::prependItems(const KFileItemList &items) +{ + KFileItem *item; + KFileItemList *m_items = const_cast(&items); + + if(!mItems.isEmpty() && !items.isEmpty()) + { + for(item = m_items->last();item;item = m_items->prev()) + mItems.prepend(item); + } +} + +void SQ_ThumbnailLoadJob::kill(bool q) +{ + donothing = true; + + KIO::Job::kill(q); +} + +#include "sq_thumbnailloadjob.moc" diff --git a/ksquirrel/sq_thumbnailloadjob.h b/ksquirrel/sq_thumbnailloadjob.h new file mode 100644 index 0000000..4182014 --- /dev/null +++ b/ksquirrel/sq_thumbnailloadjob.h @@ -0,0 +1,101 @@ +/* + copyright : (C) 2004 by Baryshev Dmitry + KSquirrel - image viewer for KDE +*/ + +/* This file is part of the KDE project + Copyright (C) 2000 David Faure + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +*/ + +#ifndef SQ_THUMBNAILLOADJOB_H +#define SQ_THUMBNAILLOADJOB_H + +#include + +#include + +#include "sq_thumbnailinfo.h" + +class KFileItem; +class KTempFile; + +class SQ_DirThumbs; +class SQ_FileThumbView; + +typedef QPtrList KFileItemList; + +/* + * SQ_ThumbnailLoadJob is a job for loading thumbnails + * in given directory. + */ + +class SQ_ThumbnailLoadJob : public KIO::Job +{ + Q_OBJECT + + public: + SQ_ThumbnailLoadJob(const KFileItemList &itemList, SQ_FileThumbView *parnt); + ~SQ_ThumbnailLoadJob(); + + virtual void kill(bool q = true); + + void start(); + void itemRemoved(const KFileItem* item); + void itemsRemoved(const KFileItemList &list); + void appendItem(const KFileItem* item); + void appendItems(const KFileItemList &items); + void prependItems(const KFileItemList &items); + + void pop(const KFileItemList &items); + + private: + void determineNextIcon(); + bool statResultThumbnail(); + void createThumbnail(const KURL &); + void emitThumbnailLoaded(SQ_Thumbnail &); + void emitThumbnailLoadingFailed(); + void insertOrSync(const KURL &, SQ_Thumbnail &th); + void nextFile(bool b); + + signals: + void thumbnailLoaded(const KFileItem* item, const SQ_Thumbnail &t); + void done(); + + private slots: + void slotResult(KIO::Job *job); + void slotData(KIO::Job *job, const QByteArray &data); + + private: + enum { STATE_STATORIG, STATE_PREDOWNLOAD, STATE_DOWNLOAD } mState; + + KFileItemList mItems; + KFileItem *mCurrentItem; + KURL mCurrentURL; + KURL mThumbURL; + KURL mTempURL; + KIO::filesize_t totalSize, size; + KTempFile *tmp; + time_t mOriginalTime; + QString mime; + bool continueDownload, donothing; + + SQ_DirThumbs *dir; + SQ_Thumbnail mBrokenThumbnail; + SQ_FileThumbView *parent; +}; + +#endif diff --git a/ksquirrel/sq_thumbnailsize.cpp b/ksquirrel/sq_thumbnailsize.cpp new file mode 100644 index 0000000..a7708aa --- /dev/null +++ b/ksquirrel/sq_thumbnailsize.cpp @@ -0,0 +1,70 @@ +/* + copyright : (C) 2004 by Baryshev Dmitry + KSquirrel - image viewer for KDE +*/ + +/* +Gwenview - A simple image viewer for KDE +Copyright 2000-2003 Aur?lien G?teau + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +as published by the Free Software Foundation; either version 2 +of the License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + +*/ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include "sq_thumbnailsize.h" + +SQ_ThumbnailSize * SQ_ThumbnailSize::m_instance = 0; + +SQ_ThumbnailSize::SQ_ThumbnailSize(QObject *parent, Size value) + : QObject(parent), mValue(value), m_extended(false), m_margin(16) +{ + m_instance = this; +} + +SQ_ThumbnailSize::SQ_ThumbnailSize(QObject *parent, const QString& str) + : QObject(parent), m_extended(false), m_margin(16) +{ + QString low = str.lower(); + + if(low == "medium") + mValue = Medium; + else if(low == "large") + mValue = Large; + else + mValue = Huge; +} + +void SQ_ThumbnailSize::setPixelSize(const QString &size) +{ + QString low = size.lower(); + + if(low == "medium") + mValue = Medium; + else if(low == "large") + mValue = Large; + else + mValue = Huge; +} + +QString SQ_ThumbnailSize::stringValue() const +{ + static QString sizeStr[3] = {"64","96","128"}; + + return sizeStr[int(mValue)]; +} diff --git a/ksquirrel/sq_thumbnailsize.h b/ksquirrel/sq_thumbnailsize.h new file mode 100644 index 0000000..4411abd --- /dev/null +++ b/ksquirrel/sq_thumbnailsize.h @@ -0,0 +1,145 @@ +/* + copyright : (C) 2004 by Baryshev Dmitry + KSquirrel - image viewer for KDE +*/ + +/* +Gwenview - A simple image viewer for KDE +Copyright (c) 2000-2003 Aur?lien G?teau + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +as published by the Free Software Foundation; either version 2 +of the License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + +*/ +#ifndef SQ_THUMBNAILSIZE_H +#define SQ_THUMBNAILSIZE_H + +#include +#include +#include + +/** + * This is an "enum-like" class : an enum with cast operators to convert + * from/to string and a few other methods + */ +class SQ_ThumbnailSize : public QObject +{ + public: + enum Size { Medium, Large, Huge }; + + SQ_ThumbnailSize(QObject *parent, Size value); + SQ_ThumbnailSize(QObject *parent, const QString& str); + + void setExtended(bool); + bool extended() const; + + void setMargin(int); + int margin() const; + + void setPixelSize(const QString &size); + + QString pixelSizeString() const; + int pixelSize() const; + + QSize extendedSize() const; + + int value() const; + QString stringValue() const; + + static int biggest() { return 128; } + static int smallest() { return 48; } + + static SQ_ThumbnailSize* instance() { return m_instance; } + + private: + Size mValue; + bool m_extended; + int m_margin; + + static SQ_ThumbnailSize *m_instance; +}; + +inline +int SQ_ThumbnailSize::value() const +{ + return (int)mValue; +} + +inline +void SQ_ThumbnailSize::setExtended(bool ex) +{ + m_extended = ex; +} + +inline +bool SQ_ThumbnailSize::extended() const +{ + return m_extended; +} + +inline +void SQ_ThumbnailSize::setMargin(int m) +{ + m_margin = m; +} + +inline +int SQ_ThumbnailSize::margin() const +{ + return m_margin; +} + +inline +int SQ_ThumbnailSize::pixelSize() const +{ + switch (mValue) + { + case Medium: + return 64; + case Large: + return 96; + default: + return 128; + } +} + +inline +QSize SQ_ThumbnailSize::extendedSize() const +{ + switch (mValue) + { + case Medium: + return QSize(76, 108); + case Large: + return QSize(108, 139); + default: + return QSize(140, 170); + } +} + +inline +QString SQ_ThumbnailSize::pixelSizeString() const +{ + switch (mValue) + { + case Medium: + return "medium"; + case Large: + return "large"; + default: + return "huge"; + } +} + +#endif diff --git a/ksquirrel/sq_thumbnailsunused.cpp b/ksquirrel/sq_thumbnailsunused.cpp new file mode 100644 index 0000000..7f00f19 --- /dev/null +++ b/ksquirrel/sq_thumbnailsunused.cpp @@ -0,0 +1,97 @@ +/*************************************************************************** + sq_thumbnailsunused.cpp - description + ------------------- + begin : Fri Jul 20 2007 + copyright : (C) 2007 by Baryshev Dmitry + email : ksquirrel.iv@gmail.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#include + +#include "sq_thumbnailsunused.h" + +SQ_ThumbnailsUnused * SQ_ThumbnailsUnused::m_instance = 0; + +SQ_ThumbnailsUnused::SQ_ThumbnailsUnused(QObject *parent) : QObject(parent), QMap() +{ + m_instance = this; + + cache = new KConfig("ksquirrel-unused-cache"); + + load(); +} + +SQ_ThumbnailsUnused::~SQ_ThumbnailsUnused() +{ + save(); + delete cache; +} + +bool SQ_ThumbnailsUnused::needUpdate(const KURL &u, time_t t) +{ + iterator it = find(u); + + if(it == end()) + return true; + + return it.data() != t; +} + +void SQ_ThumbnailsUnused::load() +{ + cache->setGroup("General"); + int count = cache->readNumEntry("count"); + + if(count <= 0) + return; + + QString is, s; + time_t t; + + for(int i = 0;i < count;i++) + { + cache->setGroup("URL"); + + is = QString::number(i); + s = cache->readEntry(is); + + cache->setGroup("Time"); + t = cache->readNumEntry(is); + + insert(KURL::fromPathOrURL(s), t); + } +} + +void SQ_ThumbnailsUnused::save() +{ + cache->deleteGroup("URL"); + cache->deleteGroup("Time"); + + cache->setGroup("General"); + cache->writeEntry("count", size()); + + iterator itEnd = end(); + QString is; + int i = 0; + + for(iterator it = begin();it != itEnd;++it) + { + is = QString::number(i); + cache->setGroup("URL"); + cache->writeEntry(is, it.key().prettyURL()); + + cache->setGroup("Time"); + cache->writeEntry(is, it.data()); + + i++; + } +} diff --git a/ksquirrel/sq_thumbnailsunused.h b/ksquirrel/sq_thumbnailsunused.h new file mode 100644 index 0000000..4dcadb3 --- /dev/null +++ b/ksquirrel/sq_thumbnailsunused.h @@ -0,0 +1,56 @@ +/*************************************************************************** + sq_thumbnailsunused.h - description + ------------------- + begin : Fri Jul 20 2007 + copyright : (C) 2007 by Baryshev Dmitry + email : ksquirrel.iv@gmail.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifndef SQ_THUMBNAILSUNUSED_H +#define SQ_THUMBNAILSUNUSED_H + +#include +#include + +#include + +#include + +class KConfig; + +/* + * This is small helper class for thumbnail loader. It is used only on + * non-local filesystems to cache information on unsupported file + * types to avoid downloading them from [possibly] slow kio-slave + * (for example, smb:/ on slow network). + */ + +class SQ_ThumbnailsUnused : public QObject, public QMap +{ + public: + SQ_ThumbnailsUnused(QObject *parent = 0); + ~SQ_ThumbnailsUnused(); + + bool needUpdate(const KURL &u, time_t t); + + static SQ_ThumbnailsUnused* instance() { return m_instance; }; + + private: + void load(); + void save(); + + private: + static SQ_ThumbnailsUnused *m_instance; + KConfig *cache; +}; + +#endif diff --git a/ksquirrel/sq_utils.cpp b/ksquirrel/sq_utils.cpp new file mode 100644 index 0000000..dc224c6 --- /dev/null +++ b/ksquirrel/sq_utils.cpp @@ -0,0 +1,188 @@ +/*************************************************************************** + sq_utils.cpp - description + ------------------- + begin : Thu Aug 2 2007 + copyright : (C) 2007 by Baryshev Dmitry + email : ksquirrel.iv@gmail.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include + +#include + +#include "sq_libraryhandler.h" +#include "sq_utils.h" + +#ifndef KSQUIRREL_PART +#include +#include "sq_imageloader.h" +#include "sq_thumbnailinfo.h" +#include "sq_thumbnailsize.h" +#endif + +#ifdef SQ_HAVE_KEXIF +#include +#endif + +void SQ_Utils::exifRotate(const QString &file, QImage &im, int o) +{ +#ifdef SQ_HAVE_KEXIF + im = im.xForm(SQ_Utils::exifGetMatrix(file, o)); +#endif +} + +QWMatrix SQ_Utils::exifGetMatrix(const QString &file, int o) +{ + QWMatrix matrix; + +#ifdef SQ_HAVE_KEXIF + int O; + + if(o == -1) + { + KExifData data; + data.readFromFile(file); + O = data.getImageOrientation(); + } + else + O = o; + + switch(O) + { + case KExifData::HFLIP: matrix.scale(-1,1); break; + case KExifData::ROT_180: matrix.rotate(180); break; + case KExifData::VFLIP: matrix.scale(1,-1); break; + case KExifData::ROT_90_HFLIP: matrix.scale(-1,1); matrix.rotate(90); break; + case KExifData::ROT_90: matrix.rotate(90); break; + case KExifData::ROT_90_VFLIP: matrix.scale(1,-1); matrix.rotate(90); break; + case KExifData::ROT_270: matrix.rotate(270); break; + + // normal rotation or unspecified + default: ; + } + +#endif + + return matrix; +} + +QImage SQ_Utils::scaleImage(unsigned char *im, int w, int h, int fitwithin) +{ + if(w <= fitwithin && h <= fitwithin) + { + QImage scaled(im, w, h, 32, 0, 0, QImage::LittleEndian); + scaled.setAlphaBuffer(true); + return scaled.copy(); + } + + QImage orig(im, w, h, 32, 0, 0, QImage::LittleEndian); + orig.setAlphaBuffer(true); + + // return scaled image + return SQ_Utils::scale(orig, fitwithin, fitwithin, SQ_Utils::SMOOTH_FAST, QImage::ScaleMin); +} + +#ifndef KSQUIRREL_PART +bool SQ_Utils::loadThumbnail(const KURL &pixPath, SQ_Thumbnail &t) +{ + SQ_LIBRARY *lib = 0; + +#ifdef SQ_HAVE_KEXIF + lib = SQ_LibraryHandler::instance()->libraryForFile(pixPath.path()); + bool th = false; + + if(lib) + { + KExifData data; + data.readFromFile(pixPath.path()); + QImage im = data.getThumbnail(); + + if(!im.isNull()) + { + SQ_Utils::exifRotate(QString::null, im, data.getImageOrientation()); + + th = true; + t.w = 0; + t.h = 0; + t.mime = lib->mime; + + QString w, h; + w = im.text("Thumb::Image::Width"); + h = im.text("Thumb::Image::Height"); + t.w = w.toInt(); + t.h = h.toInt(); + + if(!t.w || !t.h) + SQ_ImageLoader::instance()->tasteImage(pixPath.path(), &t.w, &t.h, lib); + + t.thumbnail = SQ_Utils::scaleImage((unsigned char *)im.bits(), im.width(), + im.height(), SQ_ThumbnailSize::biggest()); + t.thumbnail = t.thumbnail.swapRGB(); + } + } + else + return false; + + // thumbnail loaded - nothing to do, + // or load thumbnail by hands otherwise. + if(th) + return true; +#endif + + fmt_info *finfo; + + RGBA *all; + + bool b = SQ_ImageLoader::instance()->loadImage(pixPath.path(), SQ_CodecSettings::ThumbnailLoader); + + finfo = SQ_ImageLoader::instance()->info(); + all = SQ_ImageLoader::instance()->bits(); + + // memory allocation failed in SQ_ImageLoader::loadImage() + if(!all) + return false; + + // another error occured... + if(!b) + { + // if our image is partially corrupted - show it. The image + // is partially corrupted, if number of errors < number of scanlines + // and at least one page was loaded. + if(!finfo->image.size() + || (SQ_ImageLoader::instance()->errors() == finfo->image[0].h && finfo->image.size() == 1)) + { + SQ_ImageLoader::instance()->cleanup(); + return false; + } + } + + if(!lib) lib = SQ_LibraryHandler::instance()->libraryForFile(pixPath.path()); + + t.w = finfo->image[0].w; + t.h = finfo->image[0].h; + t.mime = lib->mime; + + t.thumbnail = SQ_Utils::scaleImage((unsigned char *)all, finfo->image[0].w, + finfo->image[0].h, SQ_ThumbnailSize::biggest()); + + SQ_ImageLoader::instance()->cleanup(); + + // finally, rotate thumbnail using EXIF + SQ_Utils::exifRotate(pixPath.path(), t.thumbnail); + + return true; +} +#endif diff --git a/ksquirrel/sq_utils.h b/ksquirrel/sq_utils.h new file mode 100644 index 0000000..6bffac9 --- /dev/null +++ b/ksquirrel/sq_utils.h @@ -0,0 +1,63 @@ +/*************************************************************************** + sq_utils.h - description + ------------------- + begin : Thu Aug 2 2007 + copyright : (C) 2007 by Baryshev Dmitry + email : ksquirrel.iv@gmail.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifndef SQ_UTILS_H +#define SQ_UTILS_H + +#include +#include + +class KURL; + +class QString; + +class SQ_Thumbnail; + +/* + * Helper class for SQ_GLWidget and SQ_ThumbnailLoadJob: + * + * thumbnail loader, rotater, mmx scaler + */ + +namespace SQ_Utils +{ + enum SmoothAlgorithm { SMOOTH_NONE, SMOOTH_FAST, SMOOTH_NORMAL, SMOOTH_BEST }; + + QImage scale(const QImage& image, int width, int height, + SmoothAlgorithm alg, QImage::ScaleMode mode = QImage::ScaleFree, double blur = 1.0); + + /* + * Scale given image to fit it within 'fitwithin' + */ + QImage scaleImage(unsigned char *im, int w, int h, int fitwithin); + +#ifndef KSQUIRREL_PART + /* + * Create and save thumbnail for 'pixPath' + */ + bool loadThumbnail(const KURL &pixPath, SQ_Thumbnail&); +#endif + + /* + * determine EXIF rotation and rotate image if needed + */ + void exifRotate(const QString &file, QImage &i, int o = -1); + + QWMatrix exifGetMatrix(const QString &file, int o = -1); +}; + +#endif diff --git a/ksquirrel/sq_utils_asm_scale.S b/ksquirrel/sq_utils_asm_scale.S new file mode 100644 index 0000000..08b43da --- /dev/null +++ b/ksquirrel/sq_utils_asm_scale.S @@ -0,0 +1,810 @@ +#ifdef HAVE_X86_MMX + +#ifdef __EMX__ +/* Due to strange behaviour of as.exe we use this macros */ +/* For all OS/2 coders - please use PGCC to compile this code */ +#define PR_(foo) ___##foo +#define PT_(foo,func) ___##foo,func +#define SIZE(sym) \ + .___end_##sym:; \ + .size ___##sym,.___end_##sym-___##sym; \ + .align 8; +#else +#define PR_(foo) __##foo +#define PT_(foo,func) __##foo,func +#define SIZE(sym) \ + .__end_##sym:; \ + .size __##sym,.__end_##sym-__##sym; \ + .align 8; +#endif + +/*\ +|*| MMX assembly scaling routine for Imlib2 +|*| Written by Willem Monsuwe +\*/ + +.text + .align 8 +.globl PR_(mimageScale_mmx_AARGBA) +/* .type PT_(mimageScale_mmx_AARGBA,@function) */ + + +/*\ Prototype: __mimageScale_mmx_AARGBA(ImlibScaleInfo *isi, DATA32 *dest, +|*| int dxx, int dyy, int dx, int dy, int dw, int dh, int dow, int sow) +\*/ + +#define isi 8(%ebp) +#define dest 12(%ebp) +#define dxx 16(%ebp) +#define dyy 20(%ebp) +#define dx 24(%ebp) +#define dy 28(%ebp) +#define dw 32(%ebp) +#define dh 36(%ebp) +#define dow 40(%ebp) +#define sow 44(%ebp) + +/*\ Local variables that didn't fit in registers \*/ +#define y -4(%ebp) +#define yp -8(%ebp) +#define yap -12(%ebp) +#define xp -16(%ebp) +#define xap -20(%ebp) +#define Cx -24(%ebp) +#define Mx -28(%ebp) +#define Cy -32(%ebp) +#define My -36(%ebp) +#define sow_4 -40(%ebp) + +/*\ When %edx points to ImlibScaleInfo, these are the members \*/ +#define xpoints (%edx) +#define ypoints 4(%edx) +#define xapoints 8(%edx) +#define yapoints 12(%edx) +#define xup_yup 16(%edx) + +PR_(mimageScale_mmx_AARGBA): + pushl %ebp + movl %esp, %ebp + subl $40, %esp + pushl %ebx + pushl %ecx + pushl %edx + pushl %edi + pushl %esi + movl isi, %edx + + /*\ Check (dw > 0) && (dh > 0) \*/ + cmpl $0, dw + jle .scale_leave + cmpl $0, dh + jle .scale_leave + + /*\ X-based array pointers point to the end; we're looping up to 0 \*/ + /*\ %edi = dest + dow * dy + dx + dw \*/ + movl dow, %eax + imull dy, %eax + addl dx, %eax + addl dw, %eax + movl dest, %edi + leal (%edi, %eax, 4), %edi + /*\ xp = xpoints + dxx + dw \*/ + movl dxx, %ebx + addl dw, %ebx + movl xpoints, %eax + leal (%eax, %ebx, 4), %eax + movl %eax, xp + /*\ xap = xapoints + dxx + dw \*/ + movl xapoints, %eax + leal (%eax, %ebx, 4), %eax + movl %eax, xap + /*\ y = dh \*/ + movl dh, %eax + movl %eax, y + /*\ yp = ypoints + dyy \*/ + movl dyy, %ebx + movl ypoints, %eax + leal (%eax, %ebx, 4), %eax + movl %eax, yp + /*\ yap = yapoints + dyy \*/ + movl yapoints, %eax + leal (%eax, %ebx, 4), %eax + movl %eax, yap + + pxor %mm7, %mm7 + + /*\ Test xup bit \*/ + movl xup_yup, %eax + sarl $1, %eax + jnc .scale_x_down + +.scale_x_up: + /*\ Test yup bit \*/ + sarl $1, %eax + jnc .scale_x_up_y_down + + +/*\ Scaling up both ways \*/ + +.scale_x_up_y_up: + movl sow, %ebx + +.up_up_loop_y: + + /*\ x = -dw \*/ + movl dw, %ecx + negl %ecx + + /*\ %eax = *yap << 4 \*/ + movl yap, %eax + movl (%eax), %eax + sall $4, %eax + jz .up_up_yap_0 + movd %eax, %mm1 + punpcklwd %mm1, %mm1 + punpckldq %mm1, %mm1 + +.up_up_loop1_x: + /*\ %esi = *yp + xp[x] \*/ + movl yp, %eax + movl (%eax), %esi + movl xp, %eax + movl (%eax, %ecx, 4), %eax + leal (%esi, %eax, 4), %esi + + /*\ %eax = xap[x] << 4 \*/ + movl xap, %eax + movl (%eax, %ecx, 4), %eax + sall $4, %eax + jz .up_up_xap_0 + + /*\ %mm0 = xap[x] << 4 \*/ + movd %eax, %mm0 + punpcklwd %mm0, %mm0 + punpckldq %mm0, %mm0 + + /*\ Load and unpack four pixels in parralel + |*| %mm2 = ptr[0], %mm3 = ptr[1] + |*| %mm4 = ptr[sow], %mm5 = ptr[sow + 1] + \*/ + movq (%esi), %mm2 + movq (%esi, %ebx, 4), %mm4 + movq %mm2, %mm3 + movq %mm4, %mm5 + punpcklbw %mm7, %mm2 + punpcklbw %mm7, %mm4 + punpckhbw %mm7, %mm3 + punpckhbw %mm7, %mm5 + + /*\ X interpolation: r = l + (r - l) * xap \*/ + psubw %mm2, %mm3 + psubw %mm4, %mm5 + psllw $4, %mm3 + psllw $4, %mm5 + pmulhw %mm0, %mm3 + pmulhw %mm0, %mm5 + paddw %mm2, %mm3 + paddw %mm4, %mm5 + /*\ Now %mm3 = I(ptr[0], ptr[1]), %mm5 = I(ptr[sow], ptr[sow + 1]) \*/ + jmp .up_up_common +.up_up_xap_0: + /*\ Load and unpack two pixels + |*| %mm3 = ptr[0], %mm5 = ptr[sow] + \*/ + movd (%esi), %mm3 + movd (%esi, %ebx, 4), %mm5 + punpcklbw %mm7, %mm3 + punpcklbw %mm7, %mm5 +.up_up_common: + /*\ Y interpolation: d = u + (d - u) * yap \*/ + psubw %mm3, %mm5 + psllw $4, %mm5 + pmulhw %mm1, %mm5 + paddw %mm3, %mm5 + packuswb %mm5, %mm5 + movd %mm5, (%edi, %ecx, 4) + + /*\ while (++x) \*/ + incl %ecx + jnz .up_up_loop1_x + jmp .up_up_yap_end +.up_up_yap_0: + +.up_up_loop2_x: + /*\ %esi = *yp + xp[x] \*/ + movl yp, %eax + movl (%eax), %esi + movl xp, %eax + movl (%eax, %ecx, 4), %eax + leal (%esi, %eax, 4), %esi + + /*\ %eax = xap[x] << 4 \*/ + movl xap, %eax + movl (%eax, %ecx, 4), %eax + sall $4, %eax + jz .up_up_0 + + /*\ %mm0 = xap[x] << 4 \*/ + movd %eax, %mm0 + punpcklwd %mm0, %mm0 + punpckldq %mm0, %mm0 + + /*\ Load and unpack two pixels in parralel + |*| %mm2 = ptr[0], %mm3 = ptr[1] + \*/ + movq (%esi), %mm2 + movq %mm2, %mm3 + punpcklbw %mm7, %mm2 + punpckhbw %mm7, %mm3 + + /*\ X interpolation: r = l + (r - l) * xap \*/ + psubw %mm2, %mm3 + psllw $4, %mm3 + pmulhw %mm0, %mm3 + paddw %mm2, %mm3 + packuswb %mm3, %mm3 + movd %mm3, (%edi, %ecx, 4) + jmp .up_up_1 +.up_up_0: + /*\ dptr[x] = *sptr \*/ + movl (%esi), %eax + movl %eax, (%edi, %ecx, 4) +.up_up_1: + incl %ecx + jnz .up_up_loop2_x + +.up_up_yap_end: + /*\ dptr += dow \*/ + movl dow, %eax + leal (%edi, %eax, 4), %edi + /*\ yap++; yp++ \*/ + addl $4, yap + addl $4, yp + /*\ while (y--) \*/ + decl y + jnz .up_up_loop_y + + jmp .scale_leave + + +/*\ Scaling down vertically \*/ + +.scale_x_up_y_down: + /*\ sow_4 = sow * 4 \*/ + movl sow, %eax + sall $2, %eax + movl %eax, sow_4 + +.up_down_loop_y: + + /*\ Setup My and Cy \*/ + movl yap, %eax + movzwl (%eax), %ebx + movl %ebx, My + movzwl 2(%eax), %eax + movl %eax, Cy + + /*\ mm4 = Cy \*/ + movd %eax, %mm4 + punpcklwd %mm4, %mm4 + punpckldq %mm4, %mm4 + /*\ mm5 = My \*/ + movd %ebx, %mm5 + punpcklwd %mm5, %mm5 + punpckldq %mm5, %mm5 + + /*\ x = -dw \*/ + movl dw, %ecx + negl %ecx +.up_down_loop_x: + /*\ %esi = *yp + xp[x] \*/ + movl yp, %eax + movl (%eax), %esi + movl xp, %eax + movl (%eax, %ecx, 4), %eax + leal (%esi, %eax, 4), %esi + + movl %esi, %eax + /*\ v = (*p * My) >> 10 \*/ + movd (%eax), %mm0 + punpcklbw %mm7, %mm0 + psllw $6, %mm0 + pmulhw %mm5, %mm0 + + /*\ i = 0x4000 - My \*/ + movl $0x4000, %ebx + subl My, %ebx + jbe 5f + jmp 2f +1: + /*\ p += sow; v += (*p * Cy) >> 10 \*/ + addl sow_4, %eax + movd (%eax), %mm1 + punpcklbw %mm7, %mm1 + psllw $6, %mm1 + pmulhw %mm4, %mm1 + paddw %mm1, %mm0 + + /*\ i -= Cy; while (i > Cy) \*/ + subl Cy, %ebx +2: + cmpl Cy, %ebx + jg 1b + + /*\ mm6 = i \*/ + movd %ebx, %mm6 + punpcklwd %mm6, %mm6 + punpckldq %mm6, %mm6 + + /*\ p += sow; v += (*p * i) >> 10 \*/ + addl sow_4, %eax + movd (%eax), %mm1 + punpcklbw %mm7, %mm1 + psllw $6, %mm1 + pmulhw %mm6, %mm1 + paddw %mm1, %mm0 +5: + /*\ %eax = xap[x] << 5 \*/ + movl xap, %eax + movl (%eax, %ecx, 4), %eax + sall $5, %eax + jz 6f + /*\ mm3 = xap[x] << 5 \*/ + movd %eax, %mm3 + punpcklwd %mm3, %mm3 + punpckldq %mm3, %mm3 + + /*\ p + 1 \*/ + movl %esi, %eax + addl $4, %eax + /*\ vv = (*p * My) >> 10 \*/ + movd (%eax), %mm2 + punpcklbw %mm7, %mm2 + psllw $6, %mm2 + pmulhw %mm5, %mm2 + + /*\ i = 0x4000 - My \*/ + movl $0x4000, %ebx + subl My, %ebx + jbe 5f + jmp 2f +1: + /*\ p += sow; vv += (*p * Cy) >> 10 \*/ + addl sow_4, %eax + movd (%eax), %mm1 + punpcklbw %mm7, %mm1 + psllw $6, %mm1 + pmulhw %mm4, %mm1 + paddw %mm1, %mm2 + + /*\ i -= Cy; while (i > Cy) \*/ + subl Cy, %ebx +2: + cmpl Cy, %ebx + jg 1b + + /*\ p += sow; v += (*p * i) >> 10 \*/ + addl sow_4, %eax + movd (%eax), %mm1 + punpcklbw %mm7, %mm1 + psllw $6, %mm1 + pmulhw %mm6, %mm1 + paddw %mm1, %mm2 +5: + /*\ v = v + (vv - v) * xap \*/ + psubw %mm0, %mm2 + psllw $3, %mm2 + pmulhw %mm3, %mm2 + paddw %mm2, %mm0 +6: + /*\ dest[x] = v >> 4 \*/ + psrlw $4, %mm0 + packuswb %mm0, %mm0 + movd %mm0, (%edi, %ecx, 4) + + /*\ while (++x) \*/ + incl %ecx + jnz .up_down_loop_x + + /*\ dptr += dow \*/ + movl dow, %eax + leal (%edi, %eax, 4), %edi + /*\ yap++; yp++ \*/ + addl $4, yap + addl $4, yp + /*\ while (y--) \*/ + decl y + jnz .up_down_loop_y + + jmp .scale_leave + +.scale_x_down: + /*\ Test yup bit \*/ + sarl $1, %eax + jnc .scale_x_down_y_down + + +/*\ Scaling down horizontally \*/ + +.scale_x_down_y_up: + /*\ sow_4 = sow * 4 \*/ + movl sow, %eax + sall $2, %eax + movl %eax, sow_4 + +.down_up_loop_y: + + /*\ %eax = *yap << 5 \*/ + movl yap, %eax + movl (%eax), %eax + sall $5, %eax + /*\ mm3 = *yap << 5 \*/ + movd %eax, %mm3 + punpcklwd %mm3, %mm3 + punpckldq %mm3, %mm3 + + /*\ x = -dw \*/ + movl dw, %ecx + negl %ecx +.down_up_loop_x: + /*\ %esi = *yp + xp[x] \*/ + movl yp, %eax + movl (%eax), %esi + movl xp, %eax + movl (%eax, %ecx, 4), %eax + leal (%esi, %eax, 4), %esi + + /*\ Setup Mx and Cx \*/ + movl xap, %eax + movzwl (%eax, %ecx, 4), %ebx + movl %ebx, Mx + movzwl 2(%eax, %ecx, 4), %eax + movl %eax, Cx + + /*\ mm4 = Cx \*/ + movd %eax, %mm4 + punpcklwd %mm4, %mm4 + punpckldq %mm4, %mm4 + /*\ mm5 = Mx \*/ + movd %ebx, %mm5 + punpcklwd %mm5, %mm5 + punpckldq %mm5, %mm5 + + movl %esi, %eax + /*\ v = (*p * Mx) >> 10 \*/ + movd (%eax), %mm0 + punpcklbw %mm7, %mm0 + psllw $6, %mm0 + pmulhw %mm5, %mm0 + + /*\ i = 0x4000 - Mx \*/ + movl $0x4000, %ebx + subl Mx, %ebx + jbe 5f + jmp 2f +1: + /*\ p += sow; v += (*p * Cx) >> 10 \*/ + addl $4, %eax + movd (%eax), %mm1 + punpcklbw %mm7, %mm1 + psllw $6, %mm1 + pmulhw %mm4, %mm1 + paddw %mm1, %mm0 + + /*\ i -= Cx; while (i > Cx) \*/ + subl Cx, %ebx +2: + cmpl Cx, %ebx + jg 1b + + /*\ mm6 = i \*/ + movd %ebx, %mm6 + punpcklwd %mm6, %mm6 + punpckldq %mm6, %mm6 + + /*\ p += sow; v += (*p * i) >> 10 \*/ + addl $4, %eax + movd (%eax), %mm1 + punpcklbw %mm7, %mm1 + psllw $6, %mm1 + pmulhw %mm6, %mm1 + paddw %mm1, %mm0 +5: + movd %mm3, %eax + testl %eax, %eax + jz 6f + /*\ p + sow \*/ + movl %esi, %eax + addl sow_4, %eax + /*\ vv = (*p * Mx) >> 10 \*/ + movd (%eax), %mm2 + punpcklbw %mm7, %mm2 + psllw $6, %mm2 + pmulhw %mm5, %mm2 + + /*\ i = 0x4000 - Mx \*/ + movl $0x4000, %ebx + subl Mx, %ebx + jbe 5f + jmp 2f +1: + /*\ p += sow; vv += (*p * Cx) >> 10 \*/ + addl $4, %eax + movd (%eax), %mm1 + punpcklbw %mm7, %mm1 + psllw $6, %mm1 + pmulhw %mm4, %mm1 + paddw %mm1, %mm2 + + /*\ i -= Cx; while (i > Cx) \*/ + subl Cx, %ebx +2: + cmpl Cx, %ebx + jg 1b + + /*\ p += sow; v += (*p * i) >> 10 \*/ + addl $4, %eax + movd (%eax), %mm1 + punpcklbw %mm7, %mm1 + psllw $6, %mm1 + pmulhw %mm6, %mm1 + paddw %mm1, %mm2 +5: + /*\ v = v + (vv - v) * yap \*/ + psubw %mm0, %mm2 + psllw $3, %mm2 + pmulhw %mm3, %mm2 + paddw %mm2, %mm0 +6: + /*\ dest[x] = v >> 4 \*/ + psrlw $4, %mm0 + packuswb %mm0, %mm0 + movd %mm0, (%edi, %ecx, 4) + + /*\ while (++x) \*/ + incl %ecx + jnz .down_up_loop_x + + /*\ dptr += dow \*/ + movl dow, %eax + leal (%edi, %eax, 4), %edi + /*\ yap++; yp++ \*/ + addl $4, yap + addl $4, yp + /*\ while (y--) \*/ + decl y + jnz .down_up_loop_y + + jmp .scale_leave + + +/*\ Scaling down both ways \*/ + +.scale_x_down_y_down: + /*\ sow_4 = sow * 4 \*/ + movl sow, %eax + sall $2, %eax + movl %eax, sow_4 + +.down_down_loop_y: + + /*\ Setup My and Cy \*/ + movl yap, %eax + movzwl (%eax), %ebx + movl %ebx, My + movzwl 2(%eax), %eax + movl %eax, Cy + + /*\ x = -dw \*/ + movl dw, %ecx + negl %ecx +.down_down_loop_x: + /*\ %esi = *yp + xp[x] \*/ + movl yp, %eax + movl (%eax), %esi + movl xp, %eax + movl (%eax, %ecx, 4), %eax + leal (%esi, %eax, 4), %esi + + /*\ Setup Mx and Cx \*/ + movl xap, %eax + movzwl (%eax, %ecx, 4), %ebx + movl %ebx, Mx + movzwl 2(%eax, %ecx, 4), %eax + movl %eax, Cx + + /*\ mm3 = Cx \*/ + movd %eax, %mm3 + punpcklwd %mm3, %mm3 + punpckldq %mm3, %mm3 + /*\ mm5 = Mx \*/ + movd %ebx, %mm5 + punpcklwd %mm5, %mm5 + punpckldq %mm5, %mm5 + + /*\ p = sptr; v = (*p * Mx) >> 9 \*/ + movl %esi, %eax + movd (%eax), %mm0 + punpcklbw %mm7, %mm0 + psllw $7, %mm0 + pmulhw %mm5, %mm0 + + /*\ i = 0x4000 - Mx \*/ + movl $0x4000, %ebx + subl Mx, %ebx + jbe 5f + jmp 2f +1: + /*\ v += (*++p * Cx) >> 9 \*/ + addl $4, %eax + movd (%eax), %mm1 + punpcklbw %mm7, %mm1 + psllw $7, %mm1 + pmulhw %mm3, %mm1 + paddw %mm1, %mm0 + + /*\ i -= Cx; while (i > Cx) \*/ + subl Cx, %ebx +2: + cmpl Cx, %ebx + jg 1b + + /*\ mm6 = i \*/ + movd %ebx, %mm6 + punpcklwd %mm6, %mm6 + punpckldq %mm6, %mm6 + + /*\ v += (*++p * i) >> 9 \*/ + addl $4, %eax + movd (%eax), %mm1 + punpcklbw %mm7, %mm1 + psllw $7, %mm1 + pmulhw %mm6, %mm1 + paddw %mm1, %mm0 +5: + /*\ v *= My \*/ + movd My, %mm4 + punpcklwd %mm4, %mm4 + punpckldq %mm4, %mm4 + psllw $2, %mm0 + pmulhw %mm4, %mm0 + + /*\ j = 0x4000 - My \*/ + movl $0x4000, %edx + subl My, %edx + jbe 6f + jmp 4f +3: + /*\ sptr += sow; p = sptr \*/ + addl sow_4, %esi + movl %esi, %eax + /*\ vx = (*p * Mx) >> 9 \*/ + movd (%eax), %mm1 + punpcklbw %mm7, %mm1 + psllw $7, %mm1 + pmulhw %mm5, %mm1 + + /*\ i = 0x4000 - Mx \*/ + movl $0x4000, %ebx + subl Mx, %ebx + jbe 5f + jmp 2f +1: + /*\ vx += (*++p * Cx) >> 9 \*/ + addl $4, %eax + movd (%eax), %mm2 + punpcklbw %mm7, %mm2 + psllw $7, %mm2 + pmulhw %mm3, %mm2 + paddw %mm2, %mm1 + + /*\ i -= Cx; while (i > Cx) \*/ + subl Cx, %ebx +2: + cmpl Cx, %ebx + jg 1b + + /*\ vx += (*++p * i) >> 9 \*/ + addl $4, %eax + movd (%eax), %mm2 + punpcklbw %mm7, %mm2 + psllw $7, %mm2 + pmulhw %mm6, %mm2 + paddw %mm2, %mm1 +5: + /*\ v += (vx * Cy) >> 14 \*/ + movd Cy, %mm4 + punpcklwd %mm4, %mm4 + punpckldq %mm4, %mm4 + psllw $2, %mm1 + pmulhw %mm4, %mm1 + paddw %mm1, %mm0 + + /*\ j -= Cy; while (j > Cy) \*/ + subl Cy, %edx +4: + cmpl Cy, %edx + jg 3b + + /*\ sptr += sow; p = sptr \*/ + addl sow_4, %esi + movl %esi, %eax + /*\ vx = (*p * Mx) >> 9 \*/ + movd (%eax), %mm1 + punpcklbw %mm7, %mm1 + psllw $7, %mm1 + pmulhw %mm5, %mm1 + + /*\ i = 0x4000 - Mx \*/ + movl $0x4000, %ebx + subl Mx, %ebx + jbe 5f + jmp 2f +1: + /*\ vx += (*++p * Cx) >> 9 \*/ + addl $4, %eax + movd (%eax), %mm2 + punpcklbw %mm7, %mm2 + psllw $7, %mm2 + pmulhw %mm3, %mm2 + paddw %mm2, %mm1 + + /*\ i -= Cx; while (i > Cx) \*/ + subl Cx, %ebx +2: + cmpl Cx, %ebx + jg 1b + + /*\ vx += (*++p * i) >> 9 \*/ + addl $4, %eax + movd (%eax), %mm2 + punpcklbw %mm7, %mm2 + psllw $7, %mm2 + pmulhw %mm6, %mm2 + paddw %mm2, %mm1 +5: + /*\ v += (vx * j) >> 14 \*/ + movd %edx, %mm4 + punpcklwd %mm4, %mm4 + punpckldq %mm4, %mm4 + psllw $2, %mm1 + pmulhw %mm4, %mm1 + paddw %mm1, %mm0 +6: + /*\ dptr[x] = mm0 >> 5 \*/ + psrlw $5, %mm0 + packuswb %mm0, %mm0 + movd %mm0, (%edi, %ecx, 4) + + /*\ while (++x) \*/ + incl %ecx + jnz .down_down_loop_x + + /*\ dptr += dow \*/ + movl dow, %eax + leal (%edi, %eax, 4), %edi + /*\ yap++; yp++ \*/ + addl $4, yap + addl $4, yp + /*\ while (y--) \*/ + decl y + jnz .down_down_loop_y + + jmp .scale_leave + +.scale_leave: + emms + popl %esi + popl %edi + popl %edx + popl %ecx + popl %ebx + movl %ebp, %esp + popl %ebp + ret + +SIZE(mimageScale_mmx_AARGBA) + +#endif + +.section .note.GNU-stack,"",%progbits diff --git a/ksquirrel/sq_utils_scale.cpp b/ksquirrel/sq_utils_scale.cpp new file mode 100644 index 0000000..d2742d1 --- /dev/null +++ b/ksquirrel/sq_utils_scale.cpp @@ -0,0 +1,1933 @@ +// This file includes code for scaling images, in two versions. +// One ported from ImageMagick (slower, but can achieve better quality), +// and from Imlib2 ported by Mosfet (very fast). + + +// ImageMagick code begin +// ---------------------- + +// This code is ImageMagick's resize code, adapted for QImage, with +// fastfloat class added as an optimization. +// The original license text follows. + +/* +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % +% % +% RRRR EEEEE SSSSS IIIII ZZZZZ EEEEE % +% R R E SS I ZZ E % +% RRRR EEE SSS I ZZZ EEE % +% R R E SS I ZZ E % +% R R EEEEE SSSSS IIIII ZZZZZ EEEEE % +% % +% ImageMagick Image Resize Methods % +% % +% % +% Software Design % +% John Cristy % +% July 1992 % +% % +% % +% Copyright (C) 2003 ImageMagick Studio, a non-profit organization dedicated % +% to making software imaging solutions freely available. % +% % +% Permission is hereby granted, free of charge, to any person obtaining a % +% copy of this software and associated documentation files ("ImageMagick"), % +% to deal in ImageMagick without restriction, including without limitation % +% the rights to use, copy, modify, merge, publish, distribute, sublicense, % +% and/or sell copies of ImageMagick, and to permit persons to whom the % +% ImageMagick is furnished to do so, subject to the following conditions: % +% % +% The above copyright notice and this permission notice shall be included in % +% all copies or substantial portions of ImageMagick. % +% % +% The software is provided "as is", without warranty of any kind, express or % +% implied, including but not limited to the warranties of merchantability, % +% fitness for a particular purpose and noninfringement. In no event shall % +% ImageMagick Studio be liable for any claim, damages or other liability, % +% whether in an action of contract, tort or otherwise, arising from, out of % +% or in connection with ImageMagick or the use or other dealings in % +% ImageMagick. % +% % +% Except as contained in this notice, the name of the ImageMagick Studio % +% shall not be used in advertising or otherwise to promote the sale, use or % +% other dealings in ImageMagick without prior written authorization from the % +% ImageMagick Studio. % +% % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% +*/ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +// System +#ifdef HAVE_ENDIAN_H +#include +#else +#ifdef HAVE_SYS_ENDIAN_H +#include +#endif +#endif + +#include +#include + +#include +#include + +#include +#include + +#include "sq_utils.h" + +// everything in namespace +namespace SQ_Utils { + +#define Max QMAX +#define Min QMIN + +// mustn't be less than used precision (i.e. 1/fastfloat::RATIO) +#define MagickEpsilon 0.0002 + +// fastfloat begin +// this class stores floating point numbers as integers, with BITS shift, +// i.e. value XYZ is stored as XYZ * RATIO +struct fastfloat + { + private: + enum { BITS = 12, RATIO = 4096 }; + public: + fastfloat() {} + fastfloat( long v ) : value( v << BITS ) {} + fastfloat( int v ) : value( v << BITS ) {} + fastfloat( double v ) : value( static_cast< long >( v * RATIO + 0.5 )) {} + double toDouble() const { return static_cast< double >( value ) / RATIO; } + long toLong() const { return value >> BITS; } + fastfloat& operator += ( fastfloat r ) { value += r.value; return *this; } + fastfloat& operator -= ( fastfloat r ) { value -= r.value; return *this; } + fastfloat& operator *= ( fastfloat r ) { value = static_cast< long long >( value ) * r.value >> BITS; return *this; } + fastfloat& operator /= ( fastfloat r ) { value = ( static_cast< long long >( value ) << BITS ) / r.value; return *this; } + bool operator< ( fastfloat r ) const { return value < r.value; } + bool operator<= ( fastfloat r ) const { return value <= r.value; } + bool operator> ( fastfloat r ) const { return value > r.value; } + bool operator>= ( fastfloat r ) const { return value >= r.value; } + bool operator== ( fastfloat r ) const { return value == r.value; } + bool operator!= ( fastfloat r ) const { return value != r.value; } + fastfloat operator-() const { return fastfloat( -value, false ); } + private: + fastfloat( long v, bool ) : value( v ) {} // for operator-() + long value; + }; + +inline fastfloat operator+ ( fastfloat l, fastfloat r ) { return fastfloat( l ) += r; } +inline fastfloat operator- ( fastfloat l, fastfloat r ) { return fastfloat( l ) -= r; } +inline fastfloat operator* ( fastfloat l, fastfloat r ) { return fastfloat( l ) *= r; } +inline fastfloat operator/ ( fastfloat l, fastfloat r ) { return fastfloat( l ) /= r; } + +inline bool operator< ( fastfloat l, double r ) { return l < fastfloat( r ); } +inline bool operator<= ( fastfloat l, double r ) { return l <= fastfloat( r ); } +inline bool operator> ( fastfloat l, double r ) { return l > fastfloat( r ); } +inline bool operator>= ( fastfloat l, double r ) { return l >= fastfloat( r ); } +inline bool operator== ( fastfloat l, double r ) { return l == fastfloat( r ); } +inline bool operator!= ( fastfloat l, double r ) { return l != fastfloat( r ); } + +inline bool operator< ( double l, fastfloat r ) { return fastfloat( l ) < r ; } +inline bool operator<= ( double l, fastfloat r ) { return fastfloat( l ) <= r ; } +inline bool operator> ( double l, fastfloat r ) { return fastfloat( l ) > r ; } +inline bool operator>= ( double l, fastfloat r ) { return fastfloat( l ) >= r ; } +inline bool operator== ( double l, fastfloat r ) { return fastfloat( l ) == r ; } +inline bool operator!= ( double l, fastfloat r ) { return fastfloat( l ) != r ; } + +inline double fasttodouble( fastfloat v ) { return v.toDouble(); } +inline long fasttolong( fastfloat v ) { return v.toLong(); } + +#if 1 // change to 0 to turn fastfloat usage off +#else +#define fastfloat double +#define fasttodouble( v ) double( v ) +#define fasttolong( v ) long( v ) +#endif + +//fastfloat end + + +typedef fastfloat (*Filter)(const fastfloat, const fastfloat); + +typedef struct _ContributionInfo +{ + fastfloat + weight; + + long + pixel; +} ContributionInfo; + + +/* +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % +% % +% % +% R e s i z e I m a g e % +% % +% % +% % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% ResizeImage() scales an image to the desired dimensions with one of these +% filters: +% +% Bessel Blackman Box +% Catrom Cubic Gaussian +% Hanning Hermite Lanczos +% Mitchell Point Quandratic +% Sinc Triangle +% +% Most of the filters are FIR (finite impulse response), however, Bessel, +% Gaussian, and Sinc are IIR (infinite impulse response). Bessel and Sinc +% are windowed (brought down to zero) with the Blackman filter. +% +% ResizeImage() was inspired by Paul Heckbert's zoom program. +% +% The format of the ResizeImage method is: +% +% Image *ResizeImage(Image *image,const unsigned long columns, +% const unsigned long rows,const FilterTypes filter,const double blur, +% ExceptionInfo *exception) +% +% A description of each parameter follows: +% +% o image: The image. +% +% o columns: The number of columns in the scaled image. +% +% o rows: The number of rows in the scaled image. +% +% o filter: Image filter to use. +% +% o blur: The blur factor where > 1 is blurry, < 1 is sharp. +% +% o exception: Return any errors or warnings in this structure. +% +% +*/ + +#if 0 +static fastfloat Bessel(const fastfloat x,const fastfloat) +{ + if (x == 0.0) + return(MagickPI/4.0); + return(BesselOrderOne(MagickPI*x)/(2.0*x)); +} + +static fastfloat Sinc(const fastfloat x,const fastfloat) +{ + if (x == 0.0) + return(1.0); + return(sin(MagickPI*x)/(MagickPI*x)); +} + +static fastfloat Blackman(const fastfloat x,const fastfloat) +{ + return(0.42+0.5*cos(MagickPI*x)+0.08*cos(2*MagickPI*x)); +} + +static fastfloat BlackmanBessel(const fastfloat x,const fastfloat) +{ + return(Blackman(x/support,support)*Bessel(x,support)); +} + +static fastfloat BlackmanSinc(const fastfloat x,const fastfloat) +{ + return(Blackman(x/support,support)*Sinc(x,support)); +} +#endif + +static fastfloat Box(const fastfloat x,const fastfloat) +{ + if (x < -0.5) + return(0.0); + if (x < 0.5) + return(1.0); + return(0.0); +} + +#if 0 +static fastfloat Catrom(const fastfloat x,const fastfloat) +{ + if (x < -2.0) + return(0.0); + if (x < -1.0) + return(0.5*(4.0+x*(8.0+x*(5.0+x)))); + if (x < 0.0) + return(0.5*(2.0+x*x*(-5.0-3.0*x))); + if (x < 1.0) + return(0.5*(2.0+x*x*(-5.0+3.0*x))); + if (x < 2.0) + return(0.5*(4.0+x*(-8.0+x*(5.0-x)))); + return(0.0); +} + +static fastfloat Cubic(const fastfloat x,const fastfloat) +{ + if (x < -2.0) + return(0.0); + if (x < -1.0) + return((2.0+x)*(2.0+x)*(2.0+x)/6.0); + if (x < 0.0) + return((4.0+x*x*(-6.0-3.0*x))/6.0); + if (x < 1.0) + return((4.0+x*x*(-6.0+3.0*x))/6.0); + if (x < 2.0) + return((2.0-x)*(2.0-x)*(2.0-x)/6.0); + return(0.0); +} + +static fastfloat Gaussian(const fastfloat x,const fastfloat) +{ + return(exp(-2.0*x*x)*sqrt(2.0/MagickPI)); +} + +static fastfloat Hanning(const fastfloat x,const fastfloat) +{ + return(0.5+0.5*cos(MagickPI*x)); +} + +static fastfloat Hamming(const fastfloat x,const fastfloat) +{ + return(0.54+0.46*cos(MagickPI*x)); +} + +static fastfloat Hermite(const fastfloat x,const fastfloat) +{ + if (x < -1.0) + return(0.0); + if (x < 0.0) + return((2.0*(-x)-3.0)*(-x)*(-x)+1.0); + if (x < 1.0) + return((2.0*x-3.0)*x*x+1.0); + return(0.0); +} + +static fastfloat Lanczos(const fastfloat x,const fastfloat support) +{ + if (x < -3.0) + return(0.0); + if (x < 0.0) + return(Sinc(-x,support)*Sinc(-x/3.0,support)); + if (x < 3.0) + return(Sinc(x,support)*Sinc(x/3.0,support)); + return(0.0); +} + +static fastfloat Mitchell(const fastfloat x,const fastfloat) +{ +#define B (1.0/3.0) +#define C (1.0/3.0) +#define P0 (( 6.0- 2.0*B )/6.0) +#define P2 ((-18.0+12.0*B+ 6.0*C)/6.0) +#define P3 (( 12.0- 9.0*B- 6.0*C)/6.0) +#define Q0 (( 8.0*B+24.0*C)/6.0) +#define Q1 (( -12.0*B-48.0*C)/6.0) +#define Q2 (( 6.0*B+30.0*C)/6.0) +#define Q3 (( - 1.0*B- 6.0*C)/6.0) + + if (x < -2.0) + return(0.0); + if (x < -1.0) + return(Q0-x*(Q1-x*(Q2-x*Q3))); + if (x < 0.0) + return(P0+x*x*(P2-x*P3)); + if (x < 1.0) + return(P0+x*x*(P2+x*P3)); + if (x < 2.0) + return(Q0+x*(Q1+x*(Q2+x*Q3))); + return(0.0); + +#undef B +#undef C +#undef P0 +#undef P2 +#undef P3 +#undef Q0 +#undef Q1 +#undef Q2 +#undef Q3 +} +#endif + +// this is the same like Mitchell, but it has different values +// for B and C, resulting in sharper images +// http://sourceforge.net/mailarchive/forum.php?thread_id=7445822&forum_id=1210 +static fastfloat Bicubic(const fastfloat x,const fastfloat) +{ +#define B (0.0/3.0) +#define C (2.0/3.0) +#define P0 (( 6.0- 2.0*B )/6.0) +#define P2 ((-18.0+12.0*B+ 6.0*C)/6.0) +#define P3 (( 12.0- 9.0*B- 6.0*C)/6.0) +#define Q0 (( 8.0*B+24.0*C)/6.0) +#define Q1 (( -12.0*B-48.0*C)/6.0) +#define Q2 (( 6.0*B+30.0*C)/6.0) +#define Q3 (( - 1.0*B- 6.0*C)/6.0) + + if (x < -2.0) + return(0.0); + if (x < -1.0) + return(Q0-x*(Q1-x*(Q2-x*Q3))); + if (x < 0.0) + return(P0+x*x*(P2-x*P3)); + if (x < 1.0) + return(P0+x*x*(P2+x*P3)); + if (x < 2.0) + return(Q0+x*(Q1+x*(Q2+x*Q3))); + return(0.0); + +#undef B +#undef C +#undef P0 +#undef P2 +#undef P3 +#undef Q0 +#undef Q1 +#undef Q2 +#undef Q3 +} + +#if 0 +static fastfloat Quadratic(const fastfloat x,const fastfloat) +{ + if (x < -1.5) + return(0.0); + if (x < -0.5) + return(0.5*(x+1.5)*(x+1.5)); + if (x < 0.5) + return(0.75-x*x); + if (x < 1.5) + return(0.5*(x-1.5)*(x-1.5)); + return(0.0); +} +#endif + +static fastfloat Triangle(const fastfloat x,const fastfloat) +{ + if (x < -1.0) + return(0.0); + if (x < 0.0) + return(1.0+x); + if (x < 1.0) + return(1.0-x); + return(0.0); +} + +static void HorizontalFilter(const QImage& source,QImage& destination, + const fastfloat x_factor,const fastfloat blur, + ContributionInfo *contribution, Filter filter, fastfloat filtersupport) +{ + fastfloat + center, + density, + scale, + support; + + long + n, + start, + stop, + y; + + register long + i, + x; + + /* + Apply filter to resize horizontally from source to destination. + */ + scale=blur*Max(1.0/x_factor,1.0); + support=scale* filtersupport; + if (support <= 0.5) + { + /* + Reduce to point sampling. + */ + support=0.5+MagickEpsilon; + scale=1.0; + } + scale=1.0/scale; + for (x=0; x < (long) destination.width(); x++) + { + center=(fastfloat) (x+0.5)/x_factor; + start= fasttolong(Max(center-support+0.5,0)); + stop= fasttolong(Min(center+support+0.5,source.width())); + density=0.0; + for (n=0; n < (stop-start); n++) + { + contribution[n].pixel=start+n; + contribution[n].weight= + filter (scale*(start+n-center+0.5), filtersupport ); + density+=contribution[n].weight; + } + if ((density != 0.0) && (density != 1.0)) + { + /* + Normalize. + */ + density=1.0/density; + for (i=0; i < n; i++) + contribution[i].weight*=density; + } +// p=AcquireImagePixels(source,contribution[0].pixel,0,contribution[n-1].pixel- +// contribution[0].pixel+1,source->rows,exception); +// q=SetImagePixels(destination,x,0,1,destination->rows); + for (y=0; y < (long) destination.height(); y++) + { + fastfloat red = 0; + fastfloat green = 0; + fastfloat blue = 0; + fastfloat alpha = 0; + for (i=0; i < n; i++) + { + int px = contribution[i].pixel; + int py = y; + QRgb p = reinterpret_cast< QRgb* >( source.jumpTable()[ py ])[ px ]; + red+=contribution[i].weight*qRed(p); + green+=contribution[i].weight*qGreen(p); + blue+=contribution[i].weight*qBlue(p); + alpha+=contribution[i].weight*qAlpha(p); + } + QRgb pix = qRgba( + fasttolong( red < 0 ? 0 : red > 255 ? 255 : red + 0.5 ), + fasttolong( green < 0 ? 0 : green > 255 ? 255 : green + 0.5 ), + fasttolong( blue < 0 ? 0 : blue > 255 ? 255 : blue + 0.5 ), + fasttolong( alpha < 0 ? 0 : alpha > 255 ? 255 : alpha + 0.5 )); + reinterpret_cast< QRgb* >( destination.jumpTable()[ y ])[ x ] = pix; + } + } +} + +static void VerticalFilter(const QImage& source,QImage& destination, + const fastfloat y_factor,const fastfloat blur, + ContributionInfo *contribution, Filter filter, fastfloat filtersupport ) +{ + fastfloat + center, + density, + scale, + support; + + long + n, + start, + stop, + x; + + register long + i, + y; + + /* + Apply filter to resize vertically from source to destination. + */ + scale=blur*Max(1.0/y_factor,1.0); + support=scale* filtersupport; + if (support <= 0.5) + { + /* + Reduce to point sampling. + */ + support=0.5+MagickEpsilon; + scale=1.0; + } + scale=1.0/scale; + for (y=0; y < (long) destination.height(); y++) + { + center=(fastfloat) (y+0.5)/y_factor; + start= fasttolong(Max(center-support+0.5,0)); + stop= fasttolong(Min(center+support+0.5,source.height())); + density=0.0; + for (n=0; n < (stop-start); n++) + { + contribution[n].pixel=start+n; + contribution[n].weight= + filter (scale*(start+n-center+0.5), filtersupport); + density+=contribution[n].weight; + } + if ((density != 0.0) && (density != 1.0)) + { + /* + Normalize. + */ + density=1.0/density; + for (i=0; i < n; i++) + contribution[i].weight*=density; + } +// p=AcquireImagePixels(source,0,contribution[0].pixel,source->columns, +// contribution[n-1].pixel-contribution[0].pixel+1,exception); +// q=SetImagePixels(destination,0,y,destination->columns,1); + for (x=0; x < (long) destination.width(); x++) + { + fastfloat red = 0; + fastfloat green = 0; + fastfloat blue = 0; + fastfloat alpha = 0; + for (i=0; i < n; i++) + { + int px = x; + int py = contribution[i].pixel; + QRgb p = reinterpret_cast< QRgb* >( source.jumpTable()[ py ])[ px ]; + red+=contribution[i].weight*qRed(p); + green+=contribution[i].weight*qGreen(p); + blue+=contribution[i].weight*qBlue(p); + alpha+=contribution[i].weight*qAlpha(p); + } + QRgb pix = qRgba( + fasttolong( red < 0 ? 0 : red > 255 ? 255 : red + 0.5 ), + fasttolong( green < 0 ? 0 : green > 255 ? 255 : green + 0.5 ), + fasttolong( blue < 0 ? 0 : blue > 255 ? 255 : blue + 0.5 ), + fasttolong( alpha < 0 ? 0 : alpha > 255 ? 255 : alpha + 0.5 )); + reinterpret_cast< QRgb* >( destination.jumpTable()[ y ])[ x ] = pix; + } + } +} + +static QImage ResizeImage(const QImage& image,const int columns, + const int rows, Filter filter, fastfloat filtersupport, double blur) +{ + ContributionInfo + *contribution; + + fastfloat + support, + x_factor, + x_support, + y_factor, + y_support; + + /* + Initialize resize image attributes. + */ + if ((columns == image.width()) && (rows == image.height()) && (blur == 1.0)) + return image.copy(); + QImage resize_image( columns, rows, 32 ); + resize_image.setAlphaBuffer( image.hasAlphaBuffer()); + /* + Allocate filter contribution info. + */ + x_factor=(fastfloat) resize_image.width()/image.width(); + y_factor=(fastfloat) resize_image.height()/image.height(); +// i=(long) LanczosFilter; +// if (image->filter != UndefinedFilter) +// i=(long) image->filter; +// else +// if ((image->storage_class == PseudoClass) || image->matte || +// ((x_factor*y_factor) > 1.0)) +// i=(long) MitchellFilter; + x_support=blur*Max(1.0/x_factor,1.0)*filtersupport; + y_support=blur*Max(1.0/y_factor,1.0)*filtersupport; + support=Max(x_support,y_support); + if (support < filtersupport) + support=filtersupport; + contribution=new ContributionInfo[ fasttolong( 2.0*Max(support,0.5)+3 ) ]; + Q_CHECK_PTR( contribution ); + /* + Resize image. + */ + if (((fastfloat) columns*(image.height()+rows)) > + ((fastfloat) rows*(image.width()+columns))) + { + QImage source_image( columns, image.height(), 32 ); + source_image.setAlphaBuffer( image.hasAlphaBuffer()); + HorizontalFilter(image,source_image,x_factor,blur, + contribution,filter,filtersupport); + VerticalFilter(source_image,resize_image,y_factor, + blur,contribution,filter,filtersupport); + } + else + { + QImage source_image( image.width(), rows, 32 ); + source_image.setAlphaBuffer( image.hasAlphaBuffer()); + VerticalFilter(image,source_image,y_factor,blur, + contribution,filter,filtersupport); + HorizontalFilter(source_image,resize_image,x_factor, + blur,contribution,filter,filtersupport); + } + /* + Free allocated memory. + */ + delete[] contribution; + return(resize_image); +} + + +#undef Max +#undef Min +#undef MagickEpsilon + + +// filters and their matching support values +#if 0 + static const FilterInfo + filters[SincFilter+1] = + { + { Box, 0.0 }, + { Box, 0.0 }, + { Box, 0.5 }, + { Triangle, 1.0 }, + { Hermite, 1.0 }, + { Hanning, 1.0 }, + { Hamming, 1.0 }, + { Blackman, 1.0 }, + { Gaussian, 1.25 }, + { Quadratic, 1.5 }, + { Cubic, 2.0 }, + { Catrom, 2.0 }, + { Mitchell, 2.0 }, + { Lanczos, 3.0 }, + { BlackmanBessel, 3.2383 }, + { BlackmanSinc, 4.0 } + }; +#endif + + +/* +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % +% % +% % +% S a m p l e I m a g e % +% % +% % +% % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% SampleImage() scales an image to the desired dimensions with pixel +% sampling. Unlike other scaling methods, this method does not introduce +% any additional color into the scaled image. +% +% The format of the SampleImage method is: +% +% Image *SampleImage(const Image *image,const unsigned long columns, +% const unsigned long rows,ExceptionInfo *exception) +% +% A description of each parameter follows: +% +% o image: The image. +% +% o columns: The number of columns in the sampled image. +% +% o rows: The number of rows in the sampled image. +% +% o exception: Return any errors or warnings in this structure. +% +% +*/ +QImage SampleImage(const QImage& image,const int columns, + const int rows) +{ + int + *x_offset, + *y_offset; + + long + j, + y; + + uchar + *pixels; + + register const uchar + *p; + + register long + x; + + register uchar + *q; + + /* + Initialize sampled image attributes. + */ + if ((columns == image.width()) && (rows == image.height())) + return image; + // This function is modified to handle any image depth, not only + // 32bit like the ImageMagick original. This avoids the relatively + // expensive conversion. + const int d = image.depth() / 8; + QImage sample_image( columns, rows, image.depth()); + sample_image.setAlphaBuffer( image.hasAlphaBuffer()); + /* + Allocate scan line buffer and column offset buffers. + */ + pixels= new uchar[ image.width() * d ]; + x_offset= new int[ sample_image.width() ]; + y_offset= new int[ sample_image.height() ]; + /* + Initialize pixel offsets. + */ +// In the following several code 0.5 needs to be added, otherwise the image +// would be moved by half a pixel to bottom-right, just like +// with Qt's QImage::scale() + for (x=0; x < (long) sample_image.width(); x++) + { + x_offset[x]=int((x+0.5)*image.width()/sample_image.width()); + } + for (y=0; y < (long) sample_image.height(); y++) + { + y_offset[y]=int((y+0.5)*image.height()/sample_image.height()); + } + /* + Sample each row. + */ + j=(-1); + for (y=0; y < (long) sample_image.height(); y++) + { + q= sample_image.scanLine( y ); + if (j != y_offset[y] ) + { + /* + Read a scan line. + */ + j= y_offset[y]; + p= image.scanLine( j ); + (void) memcpy(pixels,p,image.width()*d); + } + /* + Sample each column. + */ + switch( d ) + { + case 1: // 8bit + for (x=0; x < (long) sample_image.width(); x++) + { + *q++=pixels[ x_offset[x] ]; + } + break; + case 4: // 32bit + for (x=0; x < (long) sample_image.width(); x++) + { + *(QRgb*)q=((QRgb*)pixels)[ x_offset[x] ]; + q += d; + } + break; + default: + for (x=0; x < (long) sample_image.width(); x++) + { + memcpy( q, pixels + x_offset[x] * d, d ); + q += d; + } + break; + } + } + if( d != 4 ) // != 32bit + { + sample_image.setNumColors( image.numColors()); + for( int i = 0; i < image.numColors(); ++i ) + sample_image.setColor( i, image.color( i )); + } + delete[] y_offset; + delete[] x_offset; + delete[] pixels; + return sample_image; +} + + +// ImageMagick code end + + +// Imlib2/Mosfet code begin +// ------------------------ + +// This code is Imlib2 code, additionally modified by Mosfet, and with few small +// modifications for Gwenview. The MMX scaling code also belongs to it. + +// The original license texts follow. + +/** + * This is the normal smoothscale method, based on Imlib2's smoothscale. + * + * Originally I took the algorithm used in NetPBM and Qt and added MMX/3dnow + * optimizations. It ran in about 1/2 the time as Qt. Then I ported Imlib's + * C algorithm and it ran at about the same speed as my MMX optimized one... + * Finally I ported Imlib's MMX version and it ran in less than half the + * time as my MMX algorithm, (taking only a quarter of the time Qt does). + * + * Changes include formatting, namespaces and other C++'ings, removal of old + * #ifdef'ed code, and removal of unneeded border calculation code. + * + * Imlib2 is (C) Carsten Haitzler and various contributors. The MMX code + * is by Willem Monsuwe . All other modifications are + * (C) Daniel M. Duley. + */ + +/* + Copyright (C) 2004 Daniel M. Duley + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +*/ + +/* +Copyright (C) 2000 Carsten Haitzler and various contributors (see AUTHORS) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to +deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies of the Software and its Copyright notices. In addition publicly +documented acknowledgment must be given that this software has been used if no +source code of this software is made available publicly. This includes +acknowledgments in either Copyright notices, Manuals, Publicity and Marketing +documents or any documentation provided with any product containing this +software. This License does not apply to any software that links to the +libraries provided by this software (statically or dynamically), but only to +the software provided. + +Please see the COPYING.PLAIN for a plain-english explanation of this notice +and it's intent. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +namespace MImageScale{ + typedef struct __mimage_scale_info + { + int *xpoints; + unsigned int **ypoints; + int *xapoints, *yapoints; + int xup_yup; + } MImageScaleInfo; + + unsigned int** mimageCalcYPoints(unsigned int *src, int sow, int sh, + int dh); + int* mimageCalcXPoints(int sw, int dw); + int* mimageCalcApoints(int s, int d, int up); + MImageScaleInfo* mimageFreeScaleInfo(MImageScaleInfo *isi); + MImageScaleInfo *mimageCalcScaleInfo(QImage &img, int sw, int sh, + int dw, int dh, char aa, int sow); + void mimageSampleRGBA(MImageScaleInfo *isi, unsigned int *dest, int dxx, + int dyy, int dx, int dy, int dw, int dh, int dow); + void mimageScaleAARGBA(MImageScaleInfo *isi, unsigned int *dest, int dxx, + int dyy, int dx, int dy, int dw, int dh, int dow, + int sow); + void mimageScaleAARGB(MImageScaleInfo *isi, unsigned int *dest, int dxx, + int dyy, int dx, int dy, int dw, int dh, int dow, int + sow); + QImage smoothScale(const QImage& img, int dw, int dh); +} + +#ifdef HAVE_X86_MMX +extern "C" { + void __mimageScale_mmx_AARGBA(MImageScale::MImageScaleInfo *isi, + unsigned int *dest, int dxx, int dyy, + int dx, int dy, int dw, int dh, + int dow, int sow); +} +#endif + +using namespace MImageScale; + +QImage MImageScale::smoothScale(const QImage& image, int dw, int dh) +{ + QImage img = image.depth() < 32 ? image.convertDepth( 32 ) : image; + int w = img.width(); + int h = img.height(); + + int sow = img.bytesPerLine(); + // handle CroppedQImage + if( img.height() > 1 && sow != img.scanLine( 1 ) - img.scanLine( 0 )) + sow = img.scanLine( 1 ) - img.scanLine( 0 ); + sow = sow / ( img.depth() / 8 ); + + MImageScaleInfo *scaleinfo = + mimageCalcScaleInfo(img, w, h, dw, dh, true, sow); + if(!scaleinfo) + return QImage(); + + QImage buffer(dw, dh, 32); + buffer.setAlphaBuffer(img.hasAlphaBuffer()); + +#ifdef HAVE_X86_MMX +//#warning Using MMX Smoothscale + bool haveMMX = KCPUInfo::haveExtension( KCPUInfo::IntelMMX ); + if(haveMMX){ + __mimageScale_mmx_AARGBA(scaleinfo, (unsigned int *)buffer.scanLine(0), + 0, 0, 0, 0, dw, dh, dw, sow); + } + else +#endif + { + if(img.hasAlphaBuffer()) + mimageScaleAARGBA(scaleinfo, (unsigned int *)buffer.scanLine(0), 0, 0, + 0, 0, dw, dh, dw, sow); + else + mimageScaleAARGB(scaleinfo, (unsigned int *)buffer.scanLine(0), 0, 0, + 0, 0, dw, dh, dw, sow); + } + mimageFreeScaleInfo(scaleinfo); + return(buffer); +} + +// +// Code ported from Imlib... +// + +// FIXME: replace with mRed, etc... These work on pointers to pixels, not +// pixel values +#if BYTE_ORDER == BIG_ENDIAN +#define A_VAL(p) ((unsigned char *)(p))[0] +#define R_VAL(p) ((unsigned char *)(p))[1] +#define G_VAL(p) ((unsigned char *)(p))[2] +#define B_VAL(p) ((unsigned char *)(p))[3] +#elif BYTE_ORDER == LITTLE_ENDIAN +#define A_VAL(p) ((unsigned char *)(p))[3] +#define R_VAL(p) ((unsigned char *)(p))[2] +#define G_VAL(p) ((unsigned char *)(p))[1] +#define B_VAL(p) ((unsigned char *)(p))[0] +#else +#error "BYTE_ORDER is not defined" +#endif + +#define INV_XAP (256 - xapoints[x]) +#define XAP (xapoints[x]) +#define INV_YAP (256 - yapoints[dyy + y]) +#define YAP (yapoints[dyy + y]) + +unsigned int** MImageScale::mimageCalcYPoints(unsigned int *src, + int sow, int sh, int dh) +{ + unsigned int **p; + int i, j = 0; + int val, inc, rv = 0; + + if(dh < 0){ + dh = -dh; + rv = 1; + } + p = new unsigned int* [dh+1]; + + val = 0; + inc = (sh << 16) / dh; + for(i = 0; i < dh; i++){ + p[j++] = src + ((val >> 16) * sow); + val += inc; + } + if(rv){ + for(i = dh / 2; --i >= 0; ){ + unsigned int *tmp = p[i]; + p[i] = p[dh - i - 1]; + p[dh - i - 1] = tmp; + } + } + return(p); +} + +int* MImageScale::mimageCalcXPoints(int sw, int dw) +{ + int *p, i, j = 0; + int val, inc, rv = 0; + + if(dw < 0){ + dw = -dw; + rv = 1; + } + p = new int[dw+1]; + + val = 0; + inc = (sw << 16) / dw; + for(i = 0; i < dw; i++){ + p[j++] = (val >> 16); + val += inc; + } + + if(rv){ + for(i = dw / 2; --i >= 0; ){ + int tmp = p[i]; + p[i] = p[dw - i - 1]; + p[dw - i - 1] = tmp; + } + } + return(p); +} + +int* MImageScale::mimageCalcApoints(int s, int d, int up) +{ + int *p, i, j = 0, rv = 0; + + if(d < 0){ + rv = 1; + d = -d; + } + p = new int[d]; + + /* scaling up */ + if(up){ + int val, inc; + + val = 0; + inc = (s << 16) / d; + for(i = 0; i < d; i++){ + p[j++] = (val >> 8) - ((val >> 8) & 0xffffff00); + if((val >> 16) >= (s - 1)) + p[j - 1] = 0; + val += inc; + } + } + /* scaling down */ + else{ + int val, inc, ap, Cp; + val = 0; + inc = (s << 16) / d; + Cp = ((d << 14) / s) + 1; + for(i = 0; i < d; i++){ + ap = ((0x100 - ((val >> 8) & 0xff)) * Cp) >> 8; + p[j] = ap | (Cp << 16); + j++; + val += inc; + } + } + if(rv){ + int tmp; + for(i = d / 2; --i >= 0; ){ + tmp = p[i]; + p[i] = p[d - i - 1]; + p[d - i - 1] = tmp; + } + } + return(p); +} + +MImageScaleInfo* MImageScale::mimageFreeScaleInfo(MImageScaleInfo *isi) +{ + if(isi){ + delete[] isi->xpoints; + delete[] isi->ypoints; + delete[] isi->xapoints; + delete[] isi->yapoints; + delete isi; + } + return(NULL); +} + +MImageScaleInfo* MImageScale::mimageCalcScaleInfo(QImage &img, int sw, int sh, + int dw, int dh, char aa, int sow) +{ + MImageScaleInfo *isi; + int scw, sch; + + scw = dw * img.width() / sw; + sch = dh * img.height() / sh; + + isi = new MImageScaleInfo; + if(!isi) + return(NULL); + memset(isi, 0, sizeof(MImageScaleInfo)); + + isi->xup_yup = (abs(dw) >= sw) + ((abs(dh) >= sh) << 1); + + isi->xpoints = mimageCalcXPoints(img.width(), scw); + if(!isi->xpoints) + return(mimageFreeScaleInfo(isi)); + isi->ypoints = mimageCalcYPoints((unsigned int *)img.scanLine(0), + sow, img.height(), sch ); + if (!isi->ypoints) + return(mimageFreeScaleInfo(isi)); + if(aa){ + isi->xapoints = mimageCalcApoints(img.width(), scw, isi->xup_yup & 1); + if(!isi->xapoints) + return(mimageFreeScaleInfo(isi)); + isi->yapoints = mimageCalcApoints(img.height(), sch, isi->xup_yup & 2); + if(!isi->yapoints) + return(mimageFreeScaleInfo(isi)); + } + return(isi); +} + +/* scale by pixel sampling only */ +void MImageScale::mimageSampleRGBA(MImageScaleInfo *isi, unsigned int *dest, + int dxx, int dyy, int dx, int dy, int dw, + int dh, int dow) +{ + unsigned int *sptr, *dptr; + int x, y, end; + unsigned int **ypoints = isi->ypoints; + int *xpoints = isi->xpoints; + + /* whats the last pixel ont he line so we stop there */ + end = dxx + dw; + /* go through every scanline in the output buffer */ + for(y = 0; y < dh; y++){ + /* get the pointer to the start of the destination scanline */ + dptr = dest + dx + ((y + dy) * dow); + /* calculate the source line we'll scan from */ + sptr = ypoints[dyy + y]; + /* go thru the scanline and copy across */ + for(x = dxx; x < end; x++) + *dptr++ = sptr[xpoints[x]]; + } +} + +/* FIXME: NEED to optimise ScaleAARGBA - currently its "ok" but needs work*/ + +/* scale by area sampling */ +void MImageScale::mimageScaleAARGBA(MImageScaleInfo *isi, unsigned int *dest, + int dxx, int dyy, int dx, int dy, int dw, + int dh, int dow, int sow) +{ + unsigned int *sptr, *dptr; + int x, y, end; + unsigned int **ypoints = isi->ypoints; + int *xpoints = isi->xpoints; + int *xapoints = isi->xapoints; + int *yapoints = isi->yapoints; + + end = dxx + dw; + /* scaling up both ways */ + if(isi->xup_yup == 3){ + /* go through every scanline in the output buffer */ + for(y = 0; y < dh; y++){ + /* calculate the source line we'll scan from */ + dptr = dest + dx + ((y + dy) * dow); + sptr = ypoints[dyy + y]; + if(YAP > 0){ + for(x = dxx; x < end; x++){ + int r, g, b, a; + int rr, gg, bb, aa; + unsigned int *pix; + + if(XAP > 0){ + pix = ypoints[dyy + y] + xpoints[x]; + r = R_VAL(pix) * INV_XAP; + g = G_VAL(pix) * INV_XAP; + b = B_VAL(pix) * INV_XAP; + a = A_VAL(pix) * INV_XAP; + pix++; + r += R_VAL(pix) * XAP; + g += G_VAL(pix) * XAP; + b += B_VAL(pix) * XAP; + a += A_VAL(pix) * XAP; + pix += sow; + rr = R_VAL(pix) * XAP; + gg = G_VAL(pix) * XAP; + bb = B_VAL(pix) * XAP; + aa = A_VAL(pix) * XAP; + pix--; + rr += R_VAL(pix) * INV_XAP; + gg += G_VAL(pix) * INV_XAP; + bb += B_VAL(pix) * INV_XAP; + aa += A_VAL(pix) * INV_XAP; + r = ((rr * YAP) + (r * INV_YAP)) >> 16; + g = ((gg * YAP) + (g * INV_YAP)) >> 16; + b = ((bb * YAP) + (b * INV_YAP)) >> 16; + a = ((aa * YAP) + (a * INV_YAP)) >> 16; + *dptr++ = qRgba(r, g, b, a); + } + else{ + pix = ypoints[dyy + y] + xpoints[x]; + r = R_VAL(pix) * INV_YAP; + g = G_VAL(pix) * INV_YAP; + b = B_VAL(pix) * INV_YAP; + a = A_VAL(pix) * INV_YAP; + pix += sow; + r += R_VAL(pix) * YAP; + g += G_VAL(pix) * YAP; + b += B_VAL(pix) * YAP; + a += A_VAL(pix) * YAP; + r >>= 8; + g >>= 8; + b >>= 8; + a >>= 8; + *dptr++ = qRgba(r, g, b, a); + } + } + } + else{ + for(x = dxx; x < end; x++){ + int r, g, b, a; + unsigned int *pix; + + if(XAP > 0){ + pix = ypoints[dyy + y] + xpoints[x]; + r = R_VAL(pix) * INV_XAP; + g = G_VAL(pix) * INV_XAP; + b = B_VAL(pix) * INV_XAP; + a = A_VAL(pix) * INV_XAP; + pix++; + r += R_VAL(pix) * XAP; + g += G_VAL(pix) * XAP; + b += B_VAL(pix) * XAP; + a += A_VAL(pix) * XAP; + r >>= 8; + g >>= 8; + b >>= 8; + a >>= 8; + *dptr++ = qRgba(r, g, b, a); + } + else + *dptr++ = sptr[xpoints[x] ]; + } + } + } + } + /* if we're scaling down vertically */ + else if(isi->xup_yup == 1){ + /*\ 'Correct' version, with math units prepared for MMXification \*/ + int Cy, j; + unsigned int *pix; + int r, g, b, a, rr, gg, bb, aa; + int yap; + + /* go through every scanline in the output buffer */ + for(y = 0; y < dh; y++){ + Cy = YAP >> 16; + yap = YAP & 0xffff; + + dptr = dest + dx + ((y + dy) * dow); + for(x = dxx; x < end; x++){ + pix = ypoints[dyy + y] + xpoints[x]; + r = (R_VAL(pix) * yap) >> 10; + g = (G_VAL(pix) * yap) >> 10; + b = (B_VAL(pix) * yap) >> 10; + a = (A_VAL(pix) * yap) >> 10; + for(j = (1 << 14) - yap; j > Cy; j -= Cy){ + pix += sow; + r += (R_VAL(pix) * Cy) >> 10; + g += (G_VAL(pix) * Cy) >> 10; + b += (B_VAL(pix) * Cy) >> 10; + a += (A_VAL(pix) * Cy) >> 10; + } + if(j > 0){ + pix += sow; + r += (R_VAL(pix) * j) >> 10; + g += (G_VAL(pix) * j) >> 10; + b += (B_VAL(pix) * j) >> 10; + a += (A_VAL(pix) * j) >> 10; + } + if(XAP > 0){ + pix = ypoints[dyy + y] + xpoints[x] + 1; + rr = (R_VAL(pix) * yap) >> 10; + gg = (G_VAL(pix) * yap) >> 10; + bb = (B_VAL(pix) * yap) >> 10; + aa = (A_VAL(pix) * yap) >> 10; + for(j = (1 << 14) - yap; j > Cy; j -= Cy){ + pix += sow; + rr += (R_VAL(pix) * Cy) >> 10; + gg += (G_VAL(pix) * Cy) >> 10; + bb += (B_VAL(pix) * Cy) >> 10; + aa += (A_VAL(pix) * Cy) >> 10; + } + if(j > 0){ + pix += sow; + rr += (R_VAL(pix) * j) >> 10; + gg += (G_VAL(pix) * j) >> 10; + bb += (B_VAL(pix) * j) >> 10; + aa += (A_VAL(pix) * j) >> 10; + } + r = r * INV_XAP; + g = g * INV_XAP; + b = b * INV_XAP; + a = a * INV_XAP; + r = (r + ((rr * XAP))) >> 12; + g = (g + ((gg * XAP))) >> 12; + b = (b + ((bb * XAP))) >> 12; + a = (a + ((aa * XAP))) >> 12; + } + else{ + r >>= 4; + g >>= 4; + b >>= 4; + a >>= 4; + } + *dptr = qRgba(r, g, b, a); + dptr++; + } + } + } + /* if we're scaling down horizontally */ + else if(isi->xup_yup == 2){ + /*\ 'Correct' version, with math units prepared for MMXification \*/ + int Cx, j; + unsigned int *pix; + int r, g, b, a, rr, gg, bb, aa; + int xap; + + /* go through every scanline in the output buffer */ + for(y = 0; y < dh; y++){ + dptr = dest + dx + ((y + dy) * dow); + for(x = dxx; x < end; x++){ + Cx = XAP >> 16; + xap = XAP & 0xffff; + + pix = ypoints[dyy + y] + xpoints[x]; + r = (R_VAL(pix) * xap) >> 10; + g = (G_VAL(pix) * xap) >> 10; + b = (B_VAL(pix) * xap) >> 10; + a = (A_VAL(pix) * xap) >> 10; + for(j = (1 << 14) - xap; j > Cx; j -= Cx){ + pix++; + r += (R_VAL(pix) * Cx) >> 10; + g += (G_VAL(pix) * Cx) >> 10; + b += (B_VAL(pix) * Cx) >> 10; + a += (A_VAL(pix) * Cx) >> 10; + } + if(j > 0){ + pix++; + r += (R_VAL(pix) * j) >> 10; + g += (G_VAL(pix) * j) >> 10; + b += (B_VAL(pix) * j) >> 10; + a += (A_VAL(pix) * j) >> 10; + } + if(YAP > 0){ + pix = ypoints[dyy + y] + xpoints[x] + sow; + rr = (R_VAL(pix) * xap) >> 10; + gg = (G_VAL(pix) * xap) >> 10; + bb = (B_VAL(pix) * xap) >> 10; + aa = (A_VAL(pix) * xap) >> 10; + for(j = (1 << 14) - xap; j > Cx; j -= Cx){ + pix++; + rr += (R_VAL(pix) * Cx) >> 10; + gg += (G_VAL(pix) * Cx) >> 10; + bb += (B_VAL(pix) * Cx) >> 10; + aa += (A_VAL(pix) * Cx) >> 10; + } + if(j > 0){ + pix++; + rr += (R_VAL(pix) * j) >> 10; + gg += (G_VAL(pix) * j) >> 10; + bb += (B_VAL(pix) * j) >> 10; + aa += (A_VAL(pix) * j) >> 10; + } + r = r * INV_YAP; + g = g * INV_YAP; + b = b * INV_YAP; + a = a * INV_YAP; + r = (r + ((rr * YAP))) >> 12; + g = (g + ((gg * YAP))) >> 12; + b = (b + ((bb * YAP))) >> 12; + a = (a + ((aa * YAP))) >> 12; + } + else{ + r >>= 4; + g >>= 4; + b >>= 4; + a >>= 4; + } + *dptr = qRgba(r, g, b, a); + dptr++; + } + } + } + /* if we're scaling down horizontally & vertically */ + else{ + /*\ 'Correct' version, with math units prepared for MMXification: + |*| The operation 'b = (b * c) >> 16' translates to pmulhw, + |*| so the operation 'b = (b * c) >> d' would translate to + |*| psllw (16 - d), %mmb; pmulh %mmc, %mmb + \*/ + int Cx, Cy, i, j; + unsigned int *pix; + int a, r, g, b, ax, rx, gx, bx; + int xap, yap; + + for(y = 0; y < dh; y++){ + Cy = YAP >> 16; + yap = YAP & 0xffff; + + dptr = dest + dx + ((y + dy) * dow); + for(x = dxx; x < end; x++){ + Cx = XAP >> 16; + xap = XAP & 0xffff; + + sptr = ypoints[dyy + y] + xpoints[x]; + pix = sptr; + sptr += sow; + rx = (R_VAL(pix) * xap) >> 9; + gx = (G_VAL(pix) * xap) >> 9; + bx = (B_VAL(pix) * xap) >> 9; + ax = (A_VAL(pix) * xap) >> 9; + pix++; + for(i = (1 << 14) - xap; i > Cx; i -= Cx){ + rx += (R_VAL(pix) * Cx) >> 9; + gx += (G_VAL(pix) * Cx) >> 9; + bx += (B_VAL(pix) * Cx) >> 9; + ax += (A_VAL(pix) * Cx) >> 9; + pix++; + } + if(i > 0){ + rx += (R_VAL(pix) * i) >> 9; + gx += (G_VAL(pix) * i) >> 9; + bx += (B_VAL(pix) * i) >> 9; + ax += (A_VAL(pix) * i) >> 9; + } + + r = (rx * yap) >> 14; + g = (gx * yap) >> 14; + b = (bx * yap) >> 14; + a = (ax * yap) >> 14; + + for(j = (1 << 14) - yap; j > Cy; j -= Cy){ + pix = sptr; + sptr += sow; + rx = (R_VAL(pix) * xap) >> 9; + gx = (G_VAL(pix) * xap) >> 9; + bx = (B_VAL(pix) * xap) >> 9; + ax = (A_VAL(pix) * xap) >> 9; + pix++; + for(i = (1 << 14) - xap; i > Cx; i -= Cx){ + rx += (R_VAL(pix) * Cx) >> 9; + gx += (G_VAL(pix) * Cx) >> 9; + bx += (B_VAL(pix) * Cx) >> 9; + ax += (A_VAL(pix) * Cx) >> 9; + pix++; + } + if(i > 0){ + rx += (R_VAL(pix) * i) >> 9; + gx += (G_VAL(pix) * i) >> 9; + bx += (B_VAL(pix) * i) >> 9; + ax += (A_VAL(pix) * i) >> 9; + } + + r += (rx * Cy) >> 14; + g += (gx * Cy) >> 14; + b += (bx * Cy) >> 14; + a += (ax * Cy) >> 14; + } + if(j > 0){ + pix = sptr; + sptr += sow; + rx = (R_VAL(pix) * xap) >> 9; + gx = (G_VAL(pix) * xap) >> 9; + bx = (B_VAL(pix) * xap) >> 9; + ax = (A_VAL(pix) * xap) >> 9; + pix++; + for(i = (1 << 14) - xap; i > Cx; i -= Cx){ + rx += (R_VAL(pix) * Cx) >> 9; + gx += (G_VAL(pix) * Cx) >> 9; + bx += (B_VAL(pix) * Cx) >> 9; + ax += (A_VAL(pix) * Cx) >> 9; + pix++; + } + if(i > 0){ + rx += (R_VAL(pix) * i) >> 9; + gx += (G_VAL(pix) * i) >> 9; + bx += (B_VAL(pix) * i) >> 9; + ax += (A_VAL(pix) * i) >> 9; + } + + r += (rx * j) >> 14; + g += (gx * j) >> 14; + b += (bx * j) >> 14; + a += (ax * j) >> 14; + } + + R_VAL(dptr) = r >> 5; + G_VAL(dptr) = g >> 5; + B_VAL(dptr) = b >> 5; + A_VAL(dptr) = a >> 5; + dptr++; + } + } + } +} + +/* scale by area sampling - IGNORE the ALPHA byte*/ +void MImageScale::mimageScaleAARGB(MImageScaleInfo *isi, unsigned int *dest, + int dxx, int dyy, int dx, int dy, int dw, + int dh, int dow, int sow) +{ + unsigned int *sptr, *dptr; + int x, y, end; + unsigned int **ypoints = isi->ypoints; + int *xpoints = isi->xpoints; + int *xapoints = isi->xapoints; + int *yapoints = isi->yapoints; + + end = dxx + dw; + /* scaling up both ways */ + if(isi->xup_yup == 3){ + /* go through every scanline in the output buffer */ + for(y = 0; y < dh; y++){ + /* calculate the source line we'll scan from */ + dptr = dest + dx + ((y + dy) * dow); + sptr = ypoints[dyy + y]; + if(YAP > 0){ + for(x = dxx; x < end; x++){ + int r = 0, g = 0, b = 0; + int rr = 0, gg = 0, bb = 0; + unsigned int *pix; + + if(XAP > 0){ + pix = ypoints[dyy + y] + xpoints[x]; + r = R_VAL(pix) * INV_XAP; + g = G_VAL(pix) * INV_XAP; + b = B_VAL(pix) * INV_XAP; + pix++; + r += R_VAL(pix) * XAP; + g += G_VAL(pix) * XAP; + b += B_VAL(pix) * XAP; + pix += sow; + rr = R_VAL(pix) * XAP; + gg = G_VAL(pix) * XAP; + bb = B_VAL(pix) * XAP; + pix --; + rr += R_VAL(pix) * INV_XAP; + gg += G_VAL(pix) * INV_XAP; + bb += B_VAL(pix) * INV_XAP; + r = ((rr * YAP) + (r * INV_YAP)) >> 16; + g = ((gg * YAP) + (g * INV_YAP)) >> 16; + b = ((bb * YAP) + (b * INV_YAP)) >> 16; + *dptr++ = qRgba(r, g, b, 0xff); + } + else{ + pix = ypoints[dyy + y] + xpoints[x]; + r = R_VAL(pix) * INV_YAP; + g = G_VAL(pix) * INV_YAP; + b = B_VAL(pix) * INV_YAP; + pix += sow; + r += R_VAL(pix) * YAP; + g += G_VAL(pix) * YAP; + b += B_VAL(pix) * YAP; + r >>= 8; + g >>= 8; + b >>= 8; + *dptr++ = qRgba(r, g, b, 0xff); + } + } + } + else{ + for(x = dxx; x < end; x++){ + int r = 0, g = 0, b = 0; + unsigned int *pix; + + if(XAP > 0){ + pix = ypoints[dyy + y] + xpoints[x]; + r = R_VAL(pix) * INV_XAP; + g = G_VAL(pix) * INV_XAP; + b = B_VAL(pix) * INV_XAP; + pix++; + r += R_VAL(pix) * XAP; + g += G_VAL(pix) * XAP; + b += B_VAL(pix) * XAP; + r >>= 8; + g >>= 8; + b >>= 8; + *dptr++ = qRgba(r, g, b, 0xff); + } + else + *dptr++ = sptr[xpoints[x] ]; + } + } + } + } + /* if we're scaling down vertically */ + else if(isi->xup_yup == 1){ + /*\ 'Correct' version, with math units prepared for MMXification \*/ + int Cy, j; + unsigned int *pix; + int r, g, b, rr, gg, bb; + int yap; + + /* go through every scanline in the output buffer */ + for(y = 0; y < dh; y++){ + Cy = YAP >> 16; + yap = YAP & 0xffff; + + dptr = dest + dx + ((y + dy) * dow); + for(x = dxx; x < end; x++){ + pix = ypoints[dyy + y] + xpoints[x]; + r = (R_VAL(pix) * yap) >> 10; + g = (G_VAL(pix) * yap) >> 10; + b = (B_VAL(pix) * yap) >> 10; + pix += sow; + for(j = (1 << 14) - yap; j > Cy; j -= Cy){ + r += (R_VAL(pix) * Cy) >> 10; + g += (G_VAL(pix) * Cy) >> 10; + b += (B_VAL(pix) * Cy) >> 10; + pix += sow; + } + if(j > 0){ + r += (R_VAL(pix) * j) >> 10; + g += (G_VAL(pix) * j) >> 10; + b += (B_VAL(pix) * j) >> 10; + } + if(XAP > 0){ + pix = ypoints[dyy + y] + xpoints[x] + 1; + rr = (R_VAL(pix) * yap) >> 10; + gg = (G_VAL(pix) * yap) >> 10; + bb = (B_VAL(pix) * yap) >> 10; + pix += sow; + for(j = (1 << 14) - yap; j > Cy; j -= Cy){ + rr += (R_VAL(pix) * Cy) >> 10; + gg += (G_VAL(pix) * Cy) >> 10; + bb += (B_VAL(pix) * Cy) >> 10; + pix += sow; + } + if(j > 0){ + rr += (R_VAL(pix) * j) >> 10; + gg += (G_VAL(pix) * j) >> 10; + bb += (B_VAL(pix) * j) >> 10; + } + r = r * INV_XAP; + g = g * INV_XAP; + b = b * INV_XAP; + r = (r + ((rr * XAP))) >> 12; + g = (g + ((gg * XAP))) >> 12; + b = (b + ((bb * XAP))) >> 12; + } + else{ + r >>= 4; + g >>= 4; + b >>= 4; + } + *dptr = qRgba(r, g, b, 0xff); + dptr++; + } + } + } + /* if we're scaling down horizontally */ + else if(isi->xup_yup == 2){ + /*\ 'Correct' version, with math units prepared for MMXification \*/ + int Cx, j; + unsigned int *pix; + int r, g, b, rr, gg, bb; + int xap; + + /* go through every scanline in the output buffer */ + for(y = 0; y < dh; y++){ + dptr = dest + dx + ((y + dy) * dow); + for(x = dxx; x < end; x++){ + Cx = XAP >> 16; + xap = XAP & 0xffff; + + pix = ypoints[dyy + y] + xpoints[x]; + r = (R_VAL(pix) * xap) >> 10; + g = (G_VAL(pix) * xap) >> 10; + b = (B_VAL(pix) * xap) >> 10; + pix++; + for(j = (1 << 14) - xap; j > Cx; j -= Cx){ + r += (R_VAL(pix) * Cx) >> 10; + g += (G_VAL(pix) * Cx) >> 10; + b += (B_VAL(pix) * Cx) >> 10; + pix++; + } + if(j > 0){ + r += (R_VAL(pix) * j) >> 10; + g += (G_VAL(pix) * j) >> 10; + b += (B_VAL(pix) * j) >> 10; + } + if(YAP > 0){ + pix = ypoints[dyy + y] + xpoints[x] + sow; + rr = (R_VAL(pix) * xap) >> 10; + gg = (G_VAL(pix) * xap) >> 10; + bb = (B_VAL(pix) * xap) >> 10; + pix++; + for(j = (1 << 14) - xap; j > Cx; j -= Cx){ + rr += (R_VAL(pix) * Cx) >> 10; + gg += (G_VAL(pix) * Cx) >> 10; + bb += (B_VAL(pix) * Cx) >> 10; + pix++; + } + if(j > 0){ + rr += (R_VAL(pix) * j) >> 10; + gg += (G_VAL(pix) * j) >> 10; + bb += (B_VAL(pix) * j) >> 10; + } + r = r * INV_YAP; + g = g * INV_YAP; + b = b * INV_YAP; + r = (r + ((rr * YAP))) >> 12; + g = (g + ((gg * YAP))) >> 12; + b = (b + ((bb * YAP))) >> 12; + } + else{ + r >>= 4; + g >>= 4; + b >>= 4; + } + *dptr = qRgba(r, g, b, 0xff); + dptr++; + } + } + } + /* fully optimized (i think) - onyl change of algorithm can help */ + /* if we're scaling down horizontally & vertically */ + else{ + /*\ 'Correct' version, with math units prepared for MMXification \*/ + int Cx, Cy, i, j; + unsigned int *pix; + int r, g, b, rx, gx, bx; + int xap, yap; + + for(y = 0; y < dh; y++){ + Cy = YAP >> 16; + yap = YAP & 0xffff; + + dptr = dest + dx + ((y + dy) * dow); + for(x = dxx; x < end; x++){ + Cx = XAP >> 16; + xap = XAP & 0xffff; + + sptr = ypoints[dyy + y] + xpoints[x]; + pix = sptr; + sptr += sow; + rx = (R_VAL(pix) * xap) >> 9; + gx = (G_VAL(pix) * xap) >> 9; + bx = (B_VAL(pix) * xap) >> 9; + pix++; + for(i = (1 << 14) - xap; i > Cx; i -= Cx){ + rx += (R_VAL(pix) * Cx) >> 9; + gx += (G_VAL(pix) * Cx) >> 9; + bx += (B_VAL(pix) * Cx) >> 9; + pix++; + } + if(i > 0){ + rx += (R_VAL(pix) * i) >> 9; + gx += (G_VAL(pix) * i) >> 9; + bx += (B_VAL(pix) * i) >> 9; + } + + r = (rx * yap) >> 14; + g = (gx * yap) >> 14; + b = (bx * yap) >> 14; + + for(j = (1 << 14) - yap; j > Cy; j -= Cy){ + pix = sptr; + sptr += sow; + rx = (R_VAL(pix) * xap) >> 9; + gx = (G_VAL(pix) * xap) >> 9; + bx = (B_VAL(pix) * xap) >> 9; + pix++; + for(i = (1 << 14) - xap; i > Cx; i -= Cx){ + rx += (R_VAL(pix) * Cx) >> 9; + gx += (G_VAL(pix) * Cx) >> 9; + bx += (B_VAL(pix) * Cx) >> 9; + pix++; + } + if(i > 0){ + rx += (R_VAL(pix) * i) >> 9; + gx += (G_VAL(pix) * i) >> 9; + bx += (B_VAL(pix) * i) >> 9; + } + + r += (rx * Cy) >> 14; + g += (gx * Cy) >> 14; + b += (bx * Cy) >> 14; + } + if(j > 0){ + pix = sptr; + sptr += sow; + rx = (R_VAL(pix) * xap) >> 9; + gx = (G_VAL(pix) * xap) >> 9; + bx = (B_VAL(pix) * xap) >> 9; + pix++; + for(i = (1 << 14) - xap; i > Cx; i -= Cx){ + rx += (R_VAL(pix) * Cx) >> 9; + gx += (G_VAL(pix) * Cx) >> 9; + bx += (B_VAL(pix) * Cx) >> 9; + pix++; + } + if(i > 0){ + rx += (R_VAL(pix) * i) >> 9; + gx += (G_VAL(pix) * i) >> 9; + bx += (B_VAL(pix) * i) >> 9; + } + + r += (rx * j) >> 14; + g += (gx * j) >> 14; + b += (bx * j) >> 14; + } + + R_VAL(dptr) = r >> 5; + G_VAL(dptr) = g >> 5; + B_VAL(dptr) = b >> 5; + dptr++; + } + } + } +} + +// Imlib2/Mosfet code end + +QImage scale(const QImage& image, int width, int height, + SmoothAlgorithm alg, QImage::ScaleMode mode, double blur ) +{ + if( image.isNull()) return image.copy(); + + QSize newSize( image.size() ); + newSize.scale( QSize( width, height ), (QSize::ScaleMode)mode ); // ### remove cast in Qt 4.0 + newSize = newSize.expandedTo( QSize( 1, 1 )); // make sure it doesn't become null + + if ( newSize == image.size() ) return image.copy(); + + width = newSize.width(); + height = newSize.height(); + Filter filter = NULL; + fastfloat filtersupport; + + switch( alg ) { + case SMOOTH_NONE: + filter = NULL; + filtersupport = 0.0; + break; + case SMOOTH_FAST: + filter = Box; + filtersupport = 0.5; + break; + case SMOOTH_NORMAL: + default: + filter = Triangle; + filtersupport = 1.0; + break; + case SMOOTH_BEST: +// filter = Mitchell; + filter = Bicubic; + filtersupport = 2.0; + break; + } + + if( filter == Box && blur == 1.0 ) + return MImageScale::smoothScale( image, width, height ); + + if( filter == Box && width > image.width() && height > image.height() && blur == 1.0 ) { + filter = NULL; // Box doesn't really smooth when enlarging + } + + if( filter == NULL ) { + return SampleImage( image, width, height ); // doesn't need 32bit + } + + return ResizeImage( image.convertDepth( 32 ), width, height, filter, filtersupport, blur ); + // unlike Qt's smoothScale() this function introduces new colors to grayscale images ... oh well +} + + +} // namespace diff --git a/ksquirrel/sq_version b/ksquirrel/sq_version new file mode 100644 index 0000000..c3670dc --- /dev/null +++ b/ksquirrel/sq_version @@ -0,0 +1 @@ +15521 diff --git a/ksquirrel/sq_viewcache.ui b/ksquirrel/sq_viewcache.ui new file mode 100644 index 0000000..f8b9aa7 --- /dev/null +++ b/ksquirrel/sq_viewcache.ui @@ -0,0 +1,168 @@ + +SQ_ViewCache + + + SQ_ViewCache + + + + 0 + 0 + 523 + 410 + + + + Memory cache + + + true + + + true + + + + unnamed + + + + pushButton1 + + + Close + + + + + + Name + + + true + + + true + + + + + MIME + + + true + + + true + + + + + Parameters + + + true + + + true + + + + listCache + + + AutoOneFit + + + true + + + NoColumn + + + + + line1 + + + HLine + + + Sunken + + + Horizontal + + + + + layout2 + + + + unnamed + + + + textLabel1 + + + <b>Total:</b> + + + AlignVCenter + + + + + textTotal + + + RichText + + + AlignCenter + + + + + spacer2 + + + Horizontal + + + Expanding + + + + 16 + 20 + + + + + + + + + + pushButton1 + clicked() + SQ_ViewCache + accept() + + + + listCache + pushButton1 + + + sq_pixmapcache.h + sq_viewcache.ui.h + + + init() + + + diff --git a/ksquirrel/sq_viewcache.ui.h b/ksquirrel/sq_viewcache.ui.h new file mode 100644 index 0000000..fa7dc8a --- /dev/null +++ b/ksquirrel/sq_viewcache.ui.h @@ -0,0 +1,45 @@ +/**************************************************************************** +** ui.h extension file, included from the uic-generated form implementation. +** +** If you wish to add, delete or rename functions or slots use +** Qt Designer which will update this file, preserving your code. Create an +** init() function in place of a constructor, and a destroy() function in +** place of a destructor. +*****************************************************************************/ + +void SQ_ViewCache::init() +{ + textTotal->setText(QString("%1").arg((int)SQ_PixmapCache::instance()->count())); + + if(SQ_PixmapCache::instance()->isEmpty()) + return; + + listCache->setSorting(-1); + + QListViewItem *itemafter = 0, *item; + + SQ_PixmapCache::iterator itEnd = SQ_PixmapCache::instance()->end(); + SQ_Thumbnail th; + KURL url; + QString s; + + for(SQ_PixmapCache::iterator it = SQ_PixmapCache::instance()->begin();it != itEnd;++it) + { + th = it.data(); + url = it.key(); + s = url.isLocalFile() ? url.path() : url.prettyURL(); + + if(itemafter) + item = new QListViewItem(listCache, itemafter, s, + QString::null, QString::fromLatin1("%1x%2").arg(th.w).arg(th.h)); + else + item = new QListViewItem(listCache, s, + QString::null, QString::fromLatin1("%1x%2").arg(th.w).arg(th.h)); + + item->setPixmap(1, it.data().mime); + + itemafter = item; + + listCache->insertItem(item); + } +} diff --git a/ksquirrel/sq_widgetstack.cpp b/ksquirrel/sq_widgetstack.cpp new file mode 100644 index 0000000..6f21e2f --- /dev/null +++ b/ksquirrel/sq_widgetstack.cpp @@ -0,0 +1,781 @@ +/*************************************************************************** + sq_widgetstack.cpp - description + ------------------- + begin : Mon Mar 15 2004 + copyright : (C) 2004 by Baryshev Dmitry + email : ksquirrel.iv@gmail.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "ksquirrel.h" +#include "sq_config.h" +#include "sq_fileiconview.h" +#include "sq_filethumbview.h" +#include "sq_filedetailview.h" +#include "sq_widgetstack.h" +#include "sq_externaltool.h" +#include "sq_treeview.h" +#include "sq_hloptions.h" +#include "sq_archivehandler.h" +#include "sq_glview.h" +#include "sq_glwidget.h" +#include "sq_libraryhandler.h" +#include "sq_diroperator.h" +#include "sq_bookmarkowner.h" +#include "sq_thumbnailsize.h" +#include "sq_progressbox.h" +#include "sq_thumbnailloadjob.h" +#include "sq_pixmapcache.h" +#include "sq_selectdeselectgroup.h" +#include "sq_navigatordropmenu.h" + +SQ_WidgetStack * SQ_WidgetStack::m_instance = 0; + +SQ_WidgetStack::SQ_WidgetStack(QWidget *parent, const int id) : QObject(parent) +{ + m_instance = this; + + SQ_DirOperator::ViewT m_type = static_cast(id); + + KURL url; + + // Check Options for path + SQ_Config::instance()->setGroup("Fileview"); + + if(SQ_HLOptions::instance()->dir.isEmpty()) + { + switch(SQ_Config::instance()->readNumEntry("set path", 0)) + { + case 0: url = KURL::fromPathOrURL(SQ_Config::instance()->readEntry("last visited", "/")); break; + case 1: url = KURL::fromPathOrURL(QDir::current().path()); break; + case 2: url = KURL::fromPathOrURL(SQ_Config::instance()->readEntry("custom directory", "/")); break; + + default: url = KURL::fromPathOrURL("/"); + } + } + else // path from command line + url = SQ_HLOptions::instance()->dir; + + dirop = new SQ_DirOperator(url, static_cast(id), parent); + + raiseWidget(m_type, false); + + connect(KSquirrel::app(), SIGNAL(thumbSizeChanged(const QString&)), dirop, SLOT(slotSetThumbSize(const QString&))); + connect(dirop, SIGNAL(runSeparately(KFileItem *)), this, SLOT(slotRunSeparately())); + + KSquirrel::app()->historyCombo()->setEditText(url.isLocalFile() ? url.path() : url.prettyURL()); + + timerShowProgress = new QTimer(this); + connect(timerShowProgress, SIGNAL(timeout()), this, SLOT(slotDelayedShowProgress())); +} + +SQ_WidgetStack::~SQ_WidgetStack() +{} + +/* + * Get current url of visible diroperator. + */ +KURL SQ_WidgetStack::url() const +{ + return dirop->url(); +} + +void SQ_WidgetStack::init() +{ + SQ_Config::instance()->setGroup("Fileview"); + + fileaction = static_cast(SQ_Config::instance()->readNumEntry("last_action", SQ_WidgetStack::Unknown)); + KURL uu = KURL::fromPathOrURL(SQ_Config::instance()->readEntry("last_url")); + + connect(SQ_NavigatorDropMenu::instance(), SIGNAL(done(const KURL &, int)), + this, SLOT(slotTreeMenuDone(const KURL &, int))); + + emitNewLastURL(uu); +} + +void SQ_WidgetStack::slotTreeMenuDone(const KURL &url, int a) +{ + if(a == SQ_NavigatorDropMenu::Copy) + fileaction = SQ_WidgetStack::Copy; + else if(a == SQ_NavigatorDropMenu::Move) + fileaction = SQ_WidgetStack::Cut; + else if(a == SQ_NavigatorDropMenu::Link) + fileaction = SQ_WidgetStack::Link; + + lastURL = url; + + emitNewLastURL(lastURL); +} + +void SQ_WidgetStack::setURL(const KURL &newurl, bool parseTree) +{ + KURL url = newurl; + url.adjustPath(+1); + + // update bookmarks' url + if(SQ_BookmarkOwner::instance()) + SQ_BookmarkOwner::instance()->setURL(url); + + // update history combobox + KSquirrel::app()->historyCombo()->setEditText(url.isLocalFile() ? url.path() : url.prettyURL()); + KSquirrel::app()->historyCombo()->addToHistory(url.isLocalFile() ? url.path() : url.prettyURL()); + + // set url for file tree + if(SQ_TreeView::instance() && parseTree) + { + SQ_Config::instance()->setGroup("Fileview"); + int sync_type = SQ_Config::instance()->readNumEntry("sync type", 0); + + if(sync_type != 2) + SQ_TreeView::instance()->emitNewURL(url); + } +} + +/* + * Select next/prevous supported image in filemanager. + * Do nothing, if no more supported images found in given + * direction. + */ +int SQ_WidgetStack::moveTo(Direction direction, KFileItem *it, bool useSupported) +{ + KFileView *local; + KFileItem *item; + + // current fileview + local = dirop->view(); + + if(it) + item = it; + else + item = (direction == SQ_WidgetStack::Next)? + local->nextItem(local->currentFileItem()): + local->prevItem(local->currentFileItem()); + + if(!item) + return moveFailed; + + if(useSupported) + { + while(true) + { + if(item->isFile()) + // supported image type ? +// if(SQ_LibraryHandler::instance()->libraryForFile(item->url().path())) + if(SQ_LibraryHandler::instance()->maybeSupported(item->url()) != SQ_LibraryHandler::No) + break; + + item = (direction == SQ_WidgetStack::Next)? + (local->nextItem(item)): + (local->prevItem(item)); + + if(!item) + return moveFailed; + } + } + + // set current file, select it + dirop->setCurrentItem(item); + + return moveSuccess; +} + +/* + * Set filter. + */ +void SQ_WidgetStack::setNameFilter(const QString &f) +{ + dirop->setNameFilter(f); + dirop->actionCollection()->action("reload")->activate(); +} + +/* + * Get current filter. + */ +QString SQ_WidgetStack::nameFilter() const +{ + return dirop->nameFilter(); +} + +/* + * Change view type. See SQ_DirOperator::ViewT for more. + */ +void SQ_WidgetStack::raiseWidget(SQ_DirOperator::ViewT id, bool doUpdate) +{ + if(doUpdate) dirop->stopThumbnailUpdate(); + + dirop->removeCdUpItem(); + dirop->prepareView(id); + + switch(id) + { + case SQ_DirOperator::TypeList: + case SQ_DirOperator::TypeIcons: + { + SQ_FileIconView *iv = dynamic_cast(dirop->preparedView()); + + dirop->setPreparedView(); + iv->setSelectionMode(KFile::Extended); + action("short view")->activate(); + + if(id == SQ_DirOperator::TypeList) + iv->actionCollection()->action("small columns")->activate(); + else + iv->actionCollection()->action("large rows")->activate(); + } + break; + + case SQ_DirOperator::TypeDetailed: + { + SQ_FileDetailView *dv = dynamic_cast(dirop->preparedView()); + + dirop->setPreparedView(); + dv->setSelectionMode(KFile::Extended); + } + break; + + case SQ_DirOperator::TypeThumbs: + { + SQ_FileThumbView *tv = dynamic_cast(dirop->preparedView()); + tv->actionCollection()->action("large rows")->activate(); + dirop->setPreparedView(); + action("short view")->activate(); + tv->setSelectionMode(KFile::Extended); + updateGrid(true); + if(doUpdate) dirop->startOrNotThumbnailUpdate(); + } + break; + } + + // enable/disable menu with thumbnail sizes + KSquirrel::app()->enableThumbsMenu(id == SQ_DirOperator::TypeThumbs); + dirop->enableThumbnailActions(id == SQ_DirOperator::TypeThumbs); + dirop->selectOld(); +} + +/* + * Selected items in currently visible diroperator. + */ +const KFileItemList* SQ_WidgetStack::selectedItems() const +{ + return dirop->view()->selectedItems(); +} + +/* + * All items in currently visible diroperator. + */ +const KFileItemList* SQ_WidgetStack::items() const +{ + return dirop->view()->items(); +} + +void SQ_WidgetStack::emitNextSelected() +{ + if(moveTo(SQ_WidgetStack::Next) == SQ_WidgetStack::moveSuccess) + { + KFileItem *fi = dirop->view()->currentFileItem(); + SQ_GLWidget::window()->setExpectedURL(fi->url()); + dirop->execute(fi); + } +} + +void SQ_WidgetStack::emitPreviousSelected() +{ + if(moveTo(SQ_WidgetStack::Previous) == SQ_WidgetStack::moveSuccess) + { + KFileItem *fi = dirop->view()->currentFileItem(); + SQ_GLWidget::window()->setExpectedURL(fi->url()); + dirop->execute(fi); + } +} + +void SQ_WidgetStack::slotSelectFirstFile() +{ + moveToFirstLast(SQ_WidgetStack::Next, false); +} + +void SQ_WidgetStack::slotSelectLastFile() +{ + moveToFirstLast(SQ_WidgetStack::Previous, false); +} + +// Go to first file +void SQ_WidgetStack::firstFile() +{ + moveToFirstLast(SQ_WidgetStack::Next); +} + +// Go to last file +void SQ_WidgetStack::lastFile() +{ + moveToFirstLast(SQ_WidgetStack::Previous); +} + +void SQ_WidgetStack::moveToFirstLast(Direction direct, bool exec) +{ + KFileView *local_view = dirop->view(); + KFileItemList *list = const_cast(local_view->items()); + + if(list) + { + KFileItem *item = (direct == SQ_WidgetStack::Next) ? list->first() : list->last(); + + if(!item || moveTo(direct, item) == moveFailed) + return; + + item = local_view->currentFileItem(); + + if(item) + { + dirop->setCurrentItem(item); + SQ_GLWidget::window()->setExpectedURL(item->url()); + if(exec) dirop->execute(item); + } + } +} + +/* + * Update grid for thumbnail view. New grid is calcalated from item + * margins (from Options). + */ +void SQ_WidgetStack::updateGrid(bool arrange) +{ + if(dirop->viewType() != SQ_DirOperator::TypeThumbs) + return; + + SQ_Config::instance()->setGroup("Thumbnails"); + int newgrid = SQ_ThumbnailSize::instance()->extended() ? + SQ_ThumbnailSize::instance()->extendedSize().width() + : SQ_ThumbnailSize::instance()->pixelSize(); + + newgrid += (SQ_Config::instance()->readNumEntry("margin", 2) + 2); + + SQ_FileThumbView *tv = dynamic_cast(dirop->view()); + + // different grid ? + if(tv->gridX() != newgrid) + { + tv->setGridX(newgrid); + + if(arrange) + tv->arrangeItemsInGrid(); + } +} + +void SQ_WidgetStack::thumbnailsUpdateEnded() +{ + if(dirop->viewType() != SQ_DirOperator::TypeThumbs) + return; + + SQ_FileThumbView *tv = dynamic_cast(dirop->view()); + + if(!tv) return; + + timerShowProgress->stop(); + tv->progressBox()->hide(); + tv->progressBox()->flush(); + tv->progressBox()->startButtonPixmap(); +} + +void SQ_WidgetStack::thumbnailUpdateStart(int count) +{ + SQ_FileThumbView *tv = dynamic_cast(dirop->view()); + + if(!tv) return; + + tv->progressBox()->setTotalSteps(count); + tv->progressBox()->stopButtonPixmap(); + + timerShowProgress->start(1000, true); +} + +void SQ_WidgetStack::slotDelayedShowProgress() +{ + SQ_FileThumbView *tv = dynamic_cast(dirop->view()); + + if(tv) + tv->progressBox()->show(); +} + +void SQ_WidgetStack::thumbnailProcess() +{ + SQ_FileThumbView *tv = dynamic_cast(dirop->view()); + + if(tv) + tv->progressBox()->advance(); +} + +void SQ_WidgetStack::setURLForCurrent(const QString &path, bool parseTree) +{ + KURL url = KURL::fromPathOrURL(path); + + setURLForCurrent(url, parseTree); +} + +void SQ_WidgetStack::setURLForCurrent(const KURL &url, bool parseTree) +{ + setURL(url, parseTree); + dirop->setURL(url, true); +} + +void SQ_WidgetStack::updateView() +{ + dirop->actionCollection()->action("reload")->activate(); +} + +void SQ_WidgetStack::slotRunSeparately() +{ + const KFileItemList *selected = selectedItems(); + KFileItemListIterator it(*selected); + + KFileItem *item; + + while((item = it.current())) + { + if(item) + item->run(); + + ++it; + } +} + +// recreate selected thumbnails +void SQ_WidgetStack::slotRecreateThumbnail() +{ + // oops, not a thumbnail view + if(dirop->viewType() != SQ_DirOperator::TypeThumbs) + return; + + SQ_FileThumbView *tv = dynamic_cast(dirop->view()); + + if(tv->updateRunning()) + return; + + tv->progressBox()->show(); + + QTimer::singleShot(1, this, SLOT(slotDelayedRecreateThumbnail())); +} + +void SQ_WidgetStack::slotDelayedRecreateThumbnail() +{ + SQ_Thumbnail thumb; + + KFileItemList *list = const_cast(selectedItems()); + SQ_FileThumbView *tv = dynamic_cast(dirop->view()); + + if(!list || !tv) + return; + + KFileItemListIterator it(*list); + KFileItem *item; + + while((item = it.current())) + { + SQ_PixmapCache::instance()->removeEntryFull(item->url()); + ++it; + } + + tv->doStartThumbnailUpdate(*list); +} + +/* + * Save currently selected items' paths, if any. + * + * Return true, if at least one url was saved. + */ +bool SQ_WidgetStack::prepare() +{ + // clear old files + files.clear(); + + KFileItemList *items = const_cast(selectedItems()); + KFileItem *i; + + if(!items || items->isEmpty()) + { + KMessageBox::information(dirop, i18n("No files to copy or move")); + return false; + } + + i = items->first(); + + while(i) + { + files.append(i->url()); + i = items->next(); + } + + return true; +} + +/* + * Slots for file actions: copy, move, cut... + */ +void SQ_WidgetStack::slotFileCopy() +{ + fileaction = (prepare()) ? SQ_WidgetStack::Copy : SQ_WidgetStack::Unknown; +} + +void SQ_WidgetStack::slotFileCut() +{ + fileaction = (prepare()) ? SQ_WidgetStack::Cut : SQ_WidgetStack::Unknown; +} + +// Paste files +void SQ_WidgetStack::slotFilePaste() +{ + // No files to copy ? + if(files.isEmpty() || fileaction == SQ_WidgetStack::Unknown) + { + KMessageBox::information(dirop, i18n("No files to copy or move")); + return; + } + + // get current url + KURL _url = url(); + emitNewLastURL(_url); + KIO::Job *job; + + // now copy or move files to current url + job = (fileaction == SQ_WidgetStack::Copy) ? KIO::copy(files, _url) : KIO::move(files, _url); + connect(job, SIGNAL(result(KIO::Job *)), this, SLOT(slotJobResult(KIO::Job *))); +} + +void SQ_WidgetStack::slotJobResult(KIO::Job *job) +{ + if(job && job->error()) + job->showErrorDialog(KSquirrel::app()); +} + +void SQ_WidgetStack::emitNewLastURL(const KURL &u) +{ + lastURL = u; + QString text; + + QString targ = KStringHandler::csqueeze(u.isLocalFile() ? u.path() : u.prettyURL(), 25); + + if(fileaction == SQ_WidgetStack::Copy) + text = i18n("Repeat (copy to %1)").arg(targ); + else if(fileaction == SQ_WidgetStack::Cut) + text = i18n("Repeat (move to %1)").arg(targ); + else if(fileaction == SQ_WidgetStack::Link) + text = i18n("Repeat (link to %1)").arg(targ); + + if(!text.isEmpty()) + emit newLastURL(text); +} + +void SQ_WidgetStack::repeat() +{ + if(fileaction == SQ_WidgetStack::Copy || fileaction == SQ_WidgetStack::Cut) + prepare(); + else + return; + + // No files to copy ? + if(lastURL.isEmpty() || files.isEmpty()) + return; + + KIO::Job *job = (fileaction == SQ_WidgetStack::Copy) ? KIO::copy(files, lastURL) : KIO::move(files, lastURL); + connect(job, SIGNAL(result(KIO::Job *)), this, SLOT(slotJobResult(KIO::Job *))); +} + +// Create links +void SQ_WidgetStack::slotFileLinkTo() +{ + if(!prepare()) + return; + + // select a directory + KURL url = KFileDialog::getExistingURL(lastURL.url(), dirop); + + if(url.isEmpty()) + return; + + fileaction = SQ_WidgetStack::Link; + emitNewLastURL(url); + + // create symlinks + KIO::link(files, url); +} + +// Copy to... +void SQ_WidgetStack::slotFileCopyTo() +{ + if(!prepare()) + return; + + // select a directory + KURL url = KFileDialog::getExistingURL(lastURL.url(), dirop); + + if(url.isEmpty()) + return; + + fileaction = SQ_WidgetStack::Copy; + emitNewLastURL(url); + + // copy files to selected directory + KIO::copy(files, url); +} + +// Move to... +void SQ_WidgetStack::slotFileMoveTo() +{ + if(!prepare()) + return; + + // select a directory + KURL url = KFileDialog::getExistingURL(lastURL.url(), dirop); + + if(url.isEmpty()) + return; + + fileaction = SQ_WidgetStack::Cut; + emitNewLastURL(url); + + // move files to selected directory + KIO::move(files, url); +} + +/* + * User wants to select to deselect some files. + */ +void SQ_WidgetStack::slotSelectGroup() +{ + selectDeselectGroup(true); +} + +void SQ_WidgetStack::slotDeselectGroup() +{ + selectDeselectGroup(false); +} + +/* + * Execute SQ_SelectDeselectGroup dialog, and select or + * deselect files after it has been closed. + */ +void SQ_WidgetStack::selectDeselectGroup(bool select) +{ + QString mask; + + KFileView *local = dirop->view(); + + SQ_SelectDeselectGroup sd(KSquirrel::app()); + + sd.setCaption(select ? i18n("Select a group of files") : i18n("Deselect a group of files")); + sd.pushMask->setText(select ? i18n("Select !") : i18n("Deselect !")); + + if(sd.exec(mask) == QDialog::Accepted) + { + if(select) + local->clearSelection(); + + KFileItemList *sd_files = const_cast(items()); + KFileItem *i; + QRegExp exp(mask); + exp.setWildcard(true); + + if(!sd_files) + return; + + i = sd_files->first(); + + // go through all files + while(i) + { + // name matched + if(exp.exactMatch(i->name())) + local->setSelected(i, select); + + // next file + i = sd_files->next(); + } + } +} + +/* + * Deselect all files. + */ +void SQ_WidgetStack::slotDeselectAll() +{ + dirop->view()->clearSelection(); +} + +/* + * Select all files. + */ +void SQ_WidgetStack::slotSelectAll() +{ + KFileItemList *sd_files = const_cast(items()); + KFileView *local = dirop->view(); + KFileItem *i; + + if(!sd_files) + return; + + i = sd_files->first(); + + // go through files and select them all + while(i) + { + local->setSelected(i, true); + i = sd_files->next(); + } +} + +KAction* SQ_WidgetStack::action(const QString &name) +{ + return dirop->actionCollection()->action(name); +} + +bool SQ_WidgetStack::updateRunning() const +{ + if(dirop->viewType() != SQ_DirOperator::TypeThumbs) + return false; + + SQ_FileThumbView *tv = dynamic_cast(dirop->view()); + + if(!tv) + return false; + + return tv->updateRunning(); +} + +void SQ_WidgetStack::saveState() +{ + SQ_Config::instance()->writeEntry("last visited", dirop->url().prettyURL()); + SQ_Config::instance()->writeEntry("last_action", static_cast(fileaction)); + SQ_Config::instance()->writeEntry("last_url", lastURL.prettyURL()); + + dirop->saveConfig(); +} + +#include "sq_widgetstack.moc" diff --git a/ksquirrel/sq_widgetstack.h b/ksquirrel/sq_widgetstack.h new file mode 100644 index 0000000..98847d3 --- /dev/null +++ b/ksquirrel/sq_widgetstack.h @@ -0,0 +1,250 @@ +/*************************************************************************** + sq_widgetstack.h - description + ------------------- + begin : Mon Mar 15 2004 + copyright : (C) 2004 by Baryshev Dmitry + email : ksquirrel.iv@gmail.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifndef SQ_WIDGETSTACK_H +#define SQ_WIDGETSTACK_H + +#include +#include + +#include +#include + +#include "sq_diroperator.h" + +namespace KIO { class Job; } + +class QTimer; + +class KAction; +class KToggleAction; +class KFileView; + +/* + * SQ_WidgetStack is a simple wrapper for file manager (navigator). + * + * It serves all file actions (Copy, Move, Link to...), thumbnail + * updates, selecting/deselecting files with +/- etc. + */ + +class SQ_WidgetStack : public QObject +{ + Q_OBJECT + + public: + /* + * Create navigator. + * id ::= + * 0 = List view + * 1 = Icon view + * 2 = Detail view + * 3 = Thumbnail view + */ + SQ_WidgetStack(QWidget *parent, const int id); + + ~SQ_WidgetStack(); + + /* + * Direction for moveTo(). + */ + enum Direction { Next = 0, Previous }; + + enum FileAction { Copy = 0, Cut, Link, Unknown }; + + enum moveToError { moveSuccess = 0, moveFailed } ; + + SQ_DirOperator* diroperator() const; + + bool updateRunning() const; + + void repeat(); + + void init(); + + void saveState(); + + /* + * Get current url. Just calls SQ_DirOperator::url(). + */ + KURL url() const; + + /* + * Selected items in currently visible diroperator. + */ + const KFileItemList* selectedItems() const; + + /* + * All items in currently visible diroperator. + */ + const KFileItemList* items() const; + + /* + * Update grid for thumbnail view. New grid is calcalated from item + * margins (from Options). + */ + void updateGrid(bool arrange); + + /* + * Reread current directory. + */ + void updateView(); + + /* + * Quick access to SQ_DirOperator::actionCollection::action() + */ + KAction *action(const QString &name); + + /* + * Select first supported image in current directory. + * Used by SQ_GLWidget. + */ + void firstFile(); + + /* + * Select last supported image in current directory. + * Used by SQ_GLWidget. + */ + void lastFile(); + + static SQ_WidgetStack* instance() { return m_instance; } + + private: + + void emitNewLastURL(const KURL &u); + + void moveToFirstLast(Direction d, bool exec = true); + /* + * Save currently selected items' paths, if any. + * + * Return true, if at least one url was saved. + */ + bool prepare(); + + /* + * Execute SQ_SelectDeselectGroup dialog, and select or + * deselect files after it has been closed. + */ + void selectDeselectGroup(bool select); + + /* + * Set current url for all _other_ widgets and objects (bookmarks, + * tree, SQ_QuickOperator etc.) + */ + void setURL(const KURL &, bool = true); + + signals: + void newLastURL(const QString &); + + public slots: + /* + * Change view type. See SQ_DirOperator::ViewT for more. + */ + void raiseWidget(SQ_DirOperator::ViewT, bool doUpdate = true); + + void slotSelectFirstFile(); + void slotSelectLastFile(); + + void emitNextSelected(); + void emitPreviousSelected(); + + /* + * Set filter. + */ + void setNameFilter(const QString&); + + /* + * Used by SQ_FileThumbView to manipulate thumbnail progress. + */ + void thumbnailsUpdateEnded(); + void thumbnailUpdateStart(int); + void thumbnailProcess(); + void slotDelayedShowProgress(); + + /* + * Set url + */ + void setURLForCurrent(const QString &, bool parseTree = true); + void setURLForCurrent(const KURL &, bool parseTree = true); + void slotRunSeparately(); + + /* + * Select next/prevous supported image in filemanager. + * Do nothing, if no more supported images found in given + * direction. + */ + int moveTo(Direction direction, KFileItem *it = 0, bool useSupported = true); + + /* + * Get current filter. + */ + QString nameFilter() const; + + /* + * Slots for file actions: copy, move, cut... + */ + void slotFileCopy(); + void slotFileCut(); + void slotFilePaste(); + void slotFileCopyTo(); + void slotFileMoveTo(); + void slotFileLinkTo(); + + private slots: + void slotRecreateThumbnail(); + void slotDelayedRecreateThumbnail(); + + void slotTreeMenuDone(const KURL &, int); + + void slotJobResult(KIO::Job *job); + + /* + * User wants to select to deselect some files. + */ + void slotSelectGroup(); + void slotDeselectGroup(); + + /* + * Deselect all files. + */ + void slotDeselectAll(); + + /* + * Select all files. + */ + void slotSelectAll(); + + private: + /* + * File manager itself + */ + SQ_DirOperator *dirop; + + QTimer *timerShowProgress; + KURL::List files; // files to copy, move or link + KURL lastURL; + FileAction fileaction; + + static SQ_WidgetStack *m_instance; +}; + +inline +SQ_DirOperator* SQ_WidgetStack::diroperator() const +{ + return dirop; +} + +#endif diff --git a/pics/Makefile.am b/pics/Makefile.am new file mode 100644 index 0000000..68d097a --- /dev/null +++ b/pics/Makefile.am @@ -0,0 +1,47 @@ +####### kdevelop will overwrite this part!!! (begin)########## + +SUBDIRS = menu imageedit toolbar + +EXTRA_DIST = checker.png tray.png thumbs_huge.png thumbs_large.png thumbs_medium.png image_win.png anime.png mark_1.png mark_2.png mark_3.png mark_4.png splash.png + +install-data-local: + $(mkinstalldirs) $(kde_datadir)/ksquirrel/images/ + $(INSTALL_DATA) $(srcdir)/checker.png $(kde_datadir)/ksquirrel/images/checker.png + $(mkinstalldirs) $(kde_datadir)/ksquirrel/images/ + $(INSTALL_DATA) $(srcdir)/tray.png $(kde_datadir)/ksquirrel/images/tray.png + $(mkinstalldirs) $(kde_datadir)/ksquirrel/images/thumbs/ + $(INSTALL_DATA) $(srcdir)/thumbs_huge.png $(kde_datadir)/ksquirrel/images/thumbs/thumbs_huge.png + $(mkinstalldirs) $(kde_datadir)/ksquirrel/images/thumbs/ + $(INSTALL_DATA) $(srcdir)/thumbs_large.png $(kde_datadir)/ksquirrel/images/thumbs/thumbs_large.png + $(mkinstalldirs) $(kde_datadir)/ksquirrel/images/thumbs/ + $(INSTALL_DATA) $(srcdir)/thumbs_medium.png $(kde_datadir)/ksquirrel/images/thumbs/thumbs_medium.png + $(mkinstalldirs) $(kde_datadir)/ksquirrel/images/listbox/ + $(INSTALL_DATA) $(srcdir)/image_win.png $(kde_datadir)/ksquirrel/images/listbox/image_win.png + $(mkinstalldirs) $(kde_datadir)/ksquirrel/images/ + $(INSTALL_DATA) $(srcdir)/anime.png $(kde_datadir)/ksquirrel/images/anime.png + $(mkinstalldirs) $(kde_datadir)/ksquirrel/images/marks/ + $(INSTALL_DATA) $(srcdir)/mark_1.png $(kde_datadir)/ksquirrel/images/marks/mark_1.png + $(mkinstalldirs) $(kde_datadir)/ksquirrel/images/marks/ + $(INSTALL_DATA) $(srcdir)/mark_2.png $(kde_datadir)/ksquirrel/images/marks/mark_2.png + $(mkinstalldirs) $(kde_datadir)/ksquirrel/images/marks/ + $(INSTALL_DATA) $(srcdir)/mark_3.png $(kde_datadir)/ksquirrel/images/marks/mark_3.png + $(mkinstalldirs) $(kde_datadir)/ksquirrel/images/marks/ + $(INSTALL_DATA) $(srcdir)/mark_4.png $(kde_datadir)/ksquirrel/images/marks/mark_4.png + $(mkinstalldirs) $(kde_datadir)/ksquirrel/images/ + $(INSTALL_DATA) $(srcdir)/splash.png $(kde_datadir)/ksquirrel/images/splash.png + +uninstall-local: + -rm -f $(kde_datadir)/ksquirrel/images/checker.png + -rm -f $(kde_datadir)/ksquirrel/images/tray.png + -rm -f $(kde_datadir)/ksquirrel/images/thumbs/thumbs_huge.png + -rm -f $(kde_datadir)/ksquirrel/images/thumbs/thumbs_large.png + -rm -f $(kde_datadir)/ksquirrel/images/thumbs/thumbs_medium.png + -rm -f $(kde_datadir)/ksquirrel/images/listbox/image_win.png + -rm -f $(kde_datadir)/ksquirrel/images/anime.png + -rm -f $(kde_datadir)/ksquirrel/images/marks/mark_1.png + -rm -f $(kde_datadir)/ksquirrel/images/marks/mark_2.png + -rm -f $(kde_datadir)/ksquirrel/images/marks/mark_3.png + -rm -f $(kde_datadir)/ksquirrel/images/marks/mark_4.png + -rm -f $(kde_datadir)/ksquirrel/images/splash.png + +####### kdevelop will overwrite this part!!! (end)############ diff --git a/pics/anime.png b/pics/anime.png new file mode 100644 index 0000000..7fb937c Binary files /dev/null and b/pics/anime.png differ diff --git a/pics/checker.png b/pics/checker.png new file mode 100644 index 0000000..1b24a7a Binary files /dev/null and b/pics/checker.png differ diff --git a/pics/image_win.png b/pics/image_win.png new file mode 100644 index 0000000..aaec698 Binary files /dev/null and b/pics/image_win.png differ diff --git a/pics/imageedit/Makefile.am b/pics/imageedit/Makefile.am new file mode 100644 index 0000000..006aabc --- /dev/null +++ b/pics/imageedit/Makefile.am @@ -0,0 +1,19 @@ +####### kdevelop will overwrite this part!!! (begin)########## + + +EXTRA_DIST = reset_value.png resize_toolbutton.png resize_toolbutton2.png + +install-data-local: + $(mkinstalldirs) $(kde_datadir)/ksquirrel/images/imageedit/ + $(INSTALL_DATA) $(srcdir)/reset_value.png $(kde_datadir)/ksquirrel/images/imageedit/reset_value.png + $(mkinstalldirs) $(kde_datadir)/ksquirrel/images/imageedit/ + $(INSTALL_DATA) $(srcdir)/resize_toolbutton.png $(kde_datadir)/ksquirrel/images/imageedit/resize_toolbutton.png + $(mkinstalldirs) $(kde_datadir)/ksquirrel/images/imageedit/ + $(INSTALL_DATA) $(srcdir)/resize_toolbutton2.png $(kde_datadir)/ksquirrel/images/imageedit/resize_toolbutton2.png + +uninstall-local: + -rm -f $(kde_datadir)/ksquirrel/images/imageedit/reset_value.png + -rm -f $(kde_datadir)/ksquirrel/images/imageedit/resize_toolbutton.png + -rm -f $(kde_datadir)/ksquirrel/images/imageedit/resize_toolbutton2.png + +####### kdevelop will overwrite this part!!! (end)############ diff --git a/pics/imageedit/reset_value.png b/pics/imageedit/reset_value.png new file mode 100644 index 0000000..cdca1e9 Binary files /dev/null and b/pics/imageedit/reset_value.png differ diff --git a/pics/imageedit/resize_toolbutton.png b/pics/imageedit/resize_toolbutton.png new file mode 100644 index 0000000..506085c Binary files /dev/null and b/pics/imageedit/resize_toolbutton.png differ diff --git a/pics/imageedit/resize_toolbutton2.png b/pics/imageedit/resize_toolbutton2.png new file mode 100644 index 0000000..19fc8bc Binary files /dev/null and b/pics/imageedit/resize_toolbutton2.png differ diff --git a/pics/imageedit/resize_toolbutton_e.png b/pics/imageedit/resize_toolbutton_e.png new file mode 100644 index 0000000..08799ad Binary files /dev/null and b/pics/imageedit/resize_toolbutton_e.png differ diff --git a/pics/mark_1.png b/pics/mark_1.png new file mode 100644 index 0000000..3ee905f Binary files /dev/null and b/pics/mark_1.png differ diff --git a/pics/mark_2.png b/pics/mark_2.png new file mode 100644 index 0000000..54f3153 Binary files /dev/null and b/pics/mark_2.png differ diff --git a/pics/mark_3.png b/pics/mark_3.png new file mode 100644 index 0000000..b82f698 Binary files /dev/null and b/pics/mark_3.png differ diff --git a/pics/mark_4.png b/pics/mark_4.png new file mode 100644 index 0000000..ed71d74 Binary files /dev/null and b/pics/mark_4.png differ diff --git a/pics/menu/18016.png b/pics/menu/18016.png new file mode 100644 index 0000000..825a623 Binary files /dev/null and b/pics/menu/18016.png differ diff --git a/pics/menu/Makefile.am b/pics/menu/Makefile.am new file mode 100644 index 0000000..0dcadf2 --- /dev/null +++ b/pics/menu/Makefile.am @@ -0,0 +1,121 @@ +####### kdevelop will overwrite this part!!! (begin)########## + + +EXTRA_DIST = 18016.png animate16.png background16.png close16.png first16.png flipH16.png flipV16.png fullscreen16.png last16.png moveDown16.png moveLeft16.png moveRight16.png moveUp16.png next16.png page116.png page216.png page316.png page416.png prev16.png prop16.png reset16.png rotateLeft16.png rotateRight16.png statusbar16.png tickmarks16.png toolbar16.png window16.png zoom-16.png zoom+16.png zoom16.png zoom100016.png zoom10016.png zoom20016.png zoom30016.png zoom50016.png zoom70016.png zoom90016.png + +install-data-local: + $(mkinstalldirs) $(kde_datadir)/ksquirrel/images/menu/ + $(INSTALL_DATA) $(srcdir)/18016.png $(kde_datadir)/ksquirrel/images/menu/18016.png + $(mkinstalldirs) $(kde_datadir)/ksquirrel/images/menu/ + $(INSTALL_DATA) $(srcdir)/animate16.png $(kde_datadir)/ksquirrel/images/menu/animate16.png + $(mkinstalldirs) $(kde_datadir)/ksquirrel/images/menu/ + $(INSTALL_DATA) $(srcdir)/background16.png $(kde_datadir)/ksquirrel/images/menu/background16.png + $(mkinstalldirs) $(kde_datadir)/ksquirrel/images/menu/ + $(INSTALL_DATA) $(srcdir)/close16.png $(kde_datadir)/ksquirrel/images/menu/close16.png + $(mkinstalldirs) $(kde_datadir)/ksquirrel/images/menu/ + $(INSTALL_DATA) $(srcdir)/first16.png $(kde_datadir)/ksquirrel/images/menu/first16.png + $(mkinstalldirs) $(kde_datadir)/ksquirrel/images/menu/ + $(INSTALL_DATA) $(srcdir)/flipH16.png $(kde_datadir)/ksquirrel/images/menu/flipH16.png + $(mkinstalldirs) $(kde_datadir)/ksquirrel/images/menu/ + $(INSTALL_DATA) $(srcdir)/flipV16.png $(kde_datadir)/ksquirrel/images/menu/flipV16.png + $(mkinstalldirs) $(kde_datadir)/ksquirrel/images/menu/ + $(INSTALL_DATA) $(srcdir)/fullscreen16.png $(kde_datadir)/ksquirrel/images/menu/fullscreen16.png + $(mkinstalldirs) $(kde_datadir)/ksquirrel/images/menu/ + $(INSTALL_DATA) $(srcdir)/last16.png $(kde_datadir)/ksquirrel/images/menu/last16.png + $(mkinstalldirs) $(kde_datadir)/ksquirrel/images/menu/ + $(INSTALL_DATA) $(srcdir)/moveDown16.png $(kde_datadir)/ksquirrel/images/menu/moveDown16.png + $(mkinstalldirs) $(kde_datadir)/ksquirrel/images/menu/ + $(INSTALL_DATA) $(srcdir)/moveLeft16.png $(kde_datadir)/ksquirrel/images/menu/moveLeft16.png + $(mkinstalldirs) $(kde_datadir)/ksquirrel/images/menu/ + $(INSTALL_DATA) $(srcdir)/moveRight16.png $(kde_datadir)/ksquirrel/images/menu/moveRight16.png + $(mkinstalldirs) $(kde_datadir)/ksquirrel/images/menu/ + $(INSTALL_DATA) $(srcdir)/moveUp16.png $(kde_datadir)/ksquirrel/images/menu/moveUp16.png + $(mkinstalldirs) $(kde_datadir)/ksquirrel/images/menu/ + $(INSTALL_DATA) $(srcdir)/next16.png $(kde_datadir)/ksquirrel/images/menu/next16.png + $(mkinstalldirs) $(kde_datadir)/ksquirrel/images/menu/ + $(INSTALL_DATA) $(srcdir)/page116.png $(kde_datadir)/ksquirrel/images/menu/page116.png + $(mkinstalldirs) $(kde_datadir)/ksquirrel/images/menu/ + $(INSTALL_DATA) $(srcdir)/page216.png $(kde_datadir)/ksquirrel/images/menu/page216.png + $(mkinstalldirs) $(kde_datadir)/ksquirrel/images/menu/ + $(INSTALL_DATA) $(srcdir)/page316.png $(kde_datadir)/ksquirrel/images/menu/page316.png + $(mkinstalldirs) $(kde_datadir)/ksquirrel/images/menu/ + $(INSTALL_DATA) $(srcdir)/page416.png $(kde_datadir)/ksquirrel/images/menu/page416.png + $(mkinstalldirs) $(kde_datadir)/ksquirrel/images/menu/ + $(INSTALL_DATA) $(srcdir)/prev16.png $(kde_datadir)/ksquirrel/images/menu/prev16.png + $(mkinstalldirs) $(kde_datadir)/ksquirrel/images/menu/ + $(INSTALL_DATA) $(srcdir)/prop16.png $(kde_datadir)/ksquirrel/images/menu/prop16.png + $(mkinstalldirs) $(kde_datadir)/ksquirrel/images/menu/ + $(INSTALL_DATA) $(srcdir)/reset16.png $(kde_datadir)/ksquirrel/images/menu/reset16.png + $(mkinstalldirs) $(kde_datadir)/ksquirrel/images/menu/ + $(INSTALL_DATA) $(srcdir)/rotateLeft16.png $(kde_datadir)/ksquirrel/images/menu/rotateLeft16.png + $(mkinstalldirs) $(kde_datadir)/ksquirrel/images/menu/ + $(INSTALL_DATA) $(srcdir)/rotateRight16.png $(kde_datadir)/ksquirrel/images/menu/rotateRight16.png + $(mkinstalldirs) $(kde_datadir)/ksquirrel/images/menu/ + $(INSTALL_DATA) $(srcdir)/statusbar16.png $(kde_datadir)/ksquirrel/images/menu/statusbar16.png + $(mkinstalldirs) $(kde_datadir)/ksquirrel/images/menu/ + $(INSTALL_DATA) $(srcdir)/tickmarks16.png $(kde_datadir)/ksquirrel/images/menu/tickmarks16.png + $(mkinstalldirs) $(kde_datadir)/ksquirrel/images/menu/ + $(INSTALL_DATA) $(srcdir)/toolbar16.png $(kde_datadir)/ksquirrel/images/menu/toolbar16.png + $(mkinstalldirs) $(kde_datadir)/ksquirrel/images/menu/ + $(INSTALL_DATA) $(srcdir)/window16.png $(kde_datadir)/ksquirrel/images/menu/window16.png + $(mkinstalldirs) $(kde_datadir)/ksquirrel/images/menu/ + $(INSTALL_DATA) $(srcdir)/zoom-16.png $(kde_datadir)/ksquirrel/images/menu/zoom-16.png + $(mkinstalldirs) $(kde_datadir)/ksquirrel/images/menu/ + $(INSTALL_DATA) $(srcdir)/zoom+16.png $(kde_datadir)/ksquirrel/images/menu/zoom+16.png + $(mkinstalldirs) $(kde_datadir)/ksquirrel/images/menu/ + $(INSTALL_DATA) $(srcdir)/zoom16.png $(kde_datadir)/ksquirrel/images/menu/zoom16.png + $(mkinstalldirs) $(kde_datadir)/ksquirrel/images/menu/ + $(INSTALL_DATA) $(srcdir)/zoom100016.png $(kde_datadir)/ksquirrel/images/menu/zoom100016.png + $(mkinstalldirs) $(kde_datadir)/ksquirrel/images/menu/ + $(INSTALL_DATA) $(srcdir)/zoom10016.png $(kde_datadir)/ksquirrel/images/menu/zoom10016.png + $(mkinstalldirs) $(kde_datadir)/ksquirrel/images/menu/ + $(INSTALL_DATA) $(srcdir)/zoom20016.png $(kde_datadir)/ksquirrel/images/menu/zoom20016.png + $(mkinstalldirs) $(kde_datadir)/ksquirrel/images/menu/ + $(INSTALL_DATA) $(srcdir)/zoom30016.png $(kde_datadir)/ksquirrel/images/menu/zoom30016.png + $(mkinstalldirs) $(kde_datadir)/ksquirrel/images/menu/ + $(INSTALL_DATA) $(srcdir)/zoom50016.png $(kde_datadir)/ksquirrel/images/menu/zoom50016.png + $(mkinstalldirs) $(kde_datadir)/ksquirrel/images/menu/ + $(INSTALL_DATA) $(srcdir)/zoom70016.png $(kde_datadir)/ksquirrel/images/menu/zoom70016.png + $(mkinstalldirs) $(kde_datadir)/ksquirrel/images/menu/ + $(INSTALL_DATA) $(srcdir)/zoom90016.png $(kde_datadir)/ksquirrel/images/menu/zoom90016.png + +uninstall-local: + -rm -f $(kde_datadir)/ksquirrel/images/menu/18016.png + -rm -f $(kde_datadir)/ksquirrel/images/menu/animate16.png + -rm -f $(kde_datadir)/ksquirrel/images/menu/background16.png + -rm -f $(kde_datadir)/ksquirrel/images/menu/close16.png + -rm -f $(kde_datadir)/ksquirrel/images/menu/first16.png + -rm -f $(kde_datadir)/ksquirrel/images/menu/flipH16.png + -rm -f $(kde_datadir)/ksquirrel/images/menu/flipV16.png + -rm -f $(kde_datadir)/ksquirrel/images/menu/fullscreen16.png + -rm -f $(kde_datadir)/ksquirrel/images/menu/last16.png + -rm -f $(kde_datadir)/ksquirrel/images/menu/moveDown16.png + -rm -f $(kde_datadir)/ksquirrel/images/menu/moveLeft16.png + -rm -f $(kde_datadir)/ksquirrel/images/menu/moveRight16.png + -rm -f $(kde_datadir)/ksquirrel/images/menu/moveUp16.png + -rm -f $(kde_datadir)/ksquirrel/images/menu/next16.png + -rm -f $(kde_datadir)/ksquirrel/images/menu/page116.png + -rm -f $(kde_datadir)/ksquirrel/images/menu/page216.png + -rm -f $(kde_datadir)/ksquirrel/images/menu/page316.png + -rm -f $(kde_datadir)/ksquirrel/images/menu/page416.png + -rm -f $(kde_datadir)/ksquirrel/images/menu/prev16.png + -rm -f $(kde_datadir)/ksquirrel/images/menu/prop16.png + -rm -f $(kde_datadir)/ksquirrel/images/menu/reset16.png + -rm -f $(kde_datadir)/ksquirrel/images/menu/rotateLeft16.png + -rm -f $(kde_datadir)/ksquirrel/images/menu/rotateRight16.png + -rm -f $(kde_datadir)/ksquirrel/images/menu/statusbar16.png + -rm -f $(kde_datadir)/ksquirrel/images/menu/tickmarks16.png + -rm -f $(kde_datadir)/ksquirrel/images/menu/toolbar16.png + -rm -f $(kde_datadir)/ksquirrel/images/menu/window16.png + -rm -f $(kde_datadir)/ksquirrel/images/menu/zoom-16.png + -rm -f $(kde_datadir)/ksquirrel/images/menu/zoom+16.png + -rm -f $(kde_datadir)/ksquirrel/images/menu/zoom16.png + -rm -f $(kde_datadir)/ksquirrel/images/menu/zoom100016.png + -rm -f $(kde_datadir)/ksquirrel/images/menu/zoom10016.png + -rm -f $(kde_datadir)/ksquirrel/images/menu/zoom20016.png + -rm -f $(kde_datadir)/ksquirrel/images/menu/zoom30016.png + -rm -f $(kde_datadir)/ksquirrel/images/menu/zoom50016.png + -rm -f $(kde_datadir)/ksquirrel/images/menu/zoom70016.png + -rm -f $(kde_datadir)/ksquirrel/images/menu/zoom90016.png + +####### kdevelop will overwrite this part!!! (end)############ diff --git a/pics/menu/animate16.png b/pics/menu/animate16.png new file mode 100644 index 0000000..fb03058 Binary files /dev/null and b/pics/menu/animate16.png differ diff --git a/pics/menu/background16.png b/pics/menu/background16.png new file mode 100644 index 0000000..ad1a793 Binary files /dev/null and b/pics/menu/background16.png differ diff --git a/pics/menu/close16.png b/pics/menu/close16.png new file mode 100644 index 0000000..9616c00 Binary files /dev/null and b/pics/menu/close16.png differ diff --git a/pics/menu/first16.png b/pics/menu/first16.png new file mode 100644 index 0000000..ec3aa16 Binary files /dev/null and b/pics/menu/first16.png differ diff --git a/pics/menu/flipH16.png b/pics/menu/flipH16.png new file mode 100644 index 0000000..a0e0bca Binary files /dev/null and b/pics/menu/flipH16.png differ diff --git a/pics/menu/flipV16.png b/pics/menu/flipV16.png new file mode 100644 index 0000000..5ce51d1 Binary files /dev/null and b/pics/menu/flipV16.png differ diff --git a/pics/menu/fullscreen16.png b/pics/menu/fullscreen16.png new file mode 100644 index 0000000..b89eb1a Binary files /dev/null and b/pics/menu/fullscreen16.png differ diff --git a/pics/menu/last16.png b/pics/menu/last16.png new file mode 100644 index 0000000..13e84dc Binary files /dev/null and b/pics/menu/last16.png differ diff --git a/pics/menu/moveDown16.png b/pics/menu/moveDown16.png new file mode 100644 index 0000000..e023d9b Binary files /dev/null and b/pics/menu/moveDown16.png differ diff --git a/pics/menu/moveLeft16.png b/pics/menu/moveLeft16.png new file mode 100644 index 0000000..7b70804 Binary files /dev/null and b/pics/menu/moveLeft16.png differ diff --git a/pics/menu/moveRight16.png b/pics/menu/moveRight16.png new file mode 100644 index 0000000..ff00cdc Binary files /dev/null and b/pics/menu/moveRight16.png differ diff --git a/pics/menu/moveUp16.png b/pics/menu/moveUp16.png new file mode 100644 index 0000000..f95ed43 Binary files /dev/null and b/pics/menu/moveUp16.png differ diff --git a/pics/menu/next16.png b/pics/menu/next16.png new file mode 100644 index 0000000..22e5f7f Binary files /dev/null and b/pics/menu/next16.png differ diff --git a/pics/menu/page116.png b/pics/menu/page116.png new file mode 100644 index 0000000..fa0af6d Binary files /dev/null and b/pics/menu/page116.png differ diff --git a/pics/menu/page216.png b/pics/menu/page216.png new file mode 100644 index 0000000..ce8af23 Binary files /dev/null and b/pics/menu/page216.png differ diff --git a/pics/menu/page316.png b/pics/menu/page316.png new file mode 100644 index 0000000..97d4db7 Binary files /dev/null and b/pics/menu/page316.png differ diff --git a/pics/menu/page416.png b/pics/menu/page416.png new file mode 100644 index 0000000..66a8703 Binary files /dev/null and b/pics/menu/page416.png differ diff --git a/pics/menu/prev16.png b/pics/menu/prev16.png new file mode 100644 index 0000000..9eac023 Binary files /dev/null and b/pics/menu/prev16.png differ diff --git a/pics/menu/prop16.png b/pics/menu/prop16.png new file mode 100644 index 0000000..1cbbfe4 Binary files /dev/null and b/pics/menu/prop16.png differ diff --git a/pics/menu/reset16.png b/pics/menu/reset16.png new file mode 100644 index 0000000..148d1db Binary files /dev/null and b/pics/menu/reset16.png differ diff --git a/pics/menu/rotateLeft16.png b/pics/menu/rotateLeft16.png new file mode 100644 index 0000000..c8439e2 Binary files /dev/null and b/pics/menu/rotateLeft16.png differ diff --git a/pics/menu/rotateRight16.png b/pics/menu/rotateRight16.png new file mode 100644 index 0000000..82e5c28 Binary files /dev/null and b/pics/menu/rotateRight16.png differ diff --git a/pics/menu/statusbar16.png b/pics/menu/statusbar16.png new file mode 100644 index 0000000..729d4d9 Binary files /dev/null and b/pics/menu/statusbar16.png differ diff --git a/pics/menu/tickmarks16.png b/pics/menu/tickmarks16.png new file mode 100644 index 0000000..3a4ea32 Binary files /dev/null and b/pics/menu/tickmarks16.png differ diff --git a/pics/menu/toolbar16.png b/pics/menu/toolbar16.png new file mode 100644 index 0000000..723590e Binary files /dev/null and b/pics/menu/toolbar16.png differ diff --git a/pics/menu/window16.png b/pics/menu/window16.png new file mode 100644 index 0000000..6f72547 Binary files /dev/null and b/pics/menu/window16.png differ diff --git a/pics/menu/zoom+16.png b/pics/menu/zoom+16.png new file mode 100644 index 0000000..827d5b7 Binary files /dev/null and b/pics/menu/zoom+16.png differ diff --git a/pics/menu/zoom-16.png b/pics/menu/zoom-16.png new file mode 100644 index 0000000..93aef6a Binary files /dev/null and b/pics/menu/zoom-16.png differ diff --git a/pics/menu/zoom100016.png b/pics/menu/zoom100016.png new file mode 100644 index 0000000..028ba4a Binary files /dev/null and b/pics/menu/zoom100016.png differ diff --git a/pics/menu/zoom10016.png b/pics/menu/zoom10016.png new file mode 100644 index 0000000..35e68ce Binary files /dev/null and b/pics/menu/zoom10016.png differ diff --git a/pics/menu/zoom16.png b/pics/menu/zoom16.png new file mode 100644 index 0000000..2cabd18 Binary files /dev/null and b/pics/menu/zoom16.png differ diff --git a/pics/menu/zoom20016.png b/pics/menu/zoom20016.png new file mode 100644 index 0000000..c0b69b7 Binary files /dev/null and b/pics/menu/zoom20016.png differ diff --git a/pics/menu/zoom30016.png b/pics/menu/zoom30016.png new file mode 100644 index 0000000..c3a5e00 Binary files /dev/null and b/pics/menu/zoom30016.png differ diff --git a/pics/menu/zoom50016.png b/pics/menu/zoom50016.png new file mode 100644 index 0000000..a9a9c3d Binary files /dev/null and b/pics/menu/zoom50016.png differ diff --git a/pics/menu/zoom70016.png b/pics/menu/zoom70016.png new file mode 100644 index 0000000..f4b9758 Binary files /dev/null and b/pics/menu/zoom70016.png differ diff --git a/pics/menu/zoom90016.png b/pics/menu/zoom90016.png new file mode 100644 index 0000000..70c21f2 Binary files /dev/null and b/pics/menu/zoom90016.png differ diff --git a/pics/splash.png b/pics/splash.png new file mode 100644 index 0000000..c2d0dc2 Binary files /dev/null and b/pics/splash.png differ diff --git a/pics/thumbs_huge.png b/pics/thumbs_huge.png new file mode 100644 index 0000000..5f2b4ca Binary files /dev/null and b/pics/thumbs_huge.png differ diff --git a/pics/thumbs_large.png b/pics/thumbs_large.png new file mode 100644 index 0000000..3646c5e Binary files /dev/null and b/pics/thumbs_large.png differ diff --git a/pics/thumbs_medium.png b/pics/thumbs_medium.png new file mode 100644 index 0000000..ec645c2 Binary files /dev/null and b/pics/thumbs_medium.png differ diff --git a/pics/toolbar/Makefile.am b/pics/toolbar/Makefile.am new file mode 100644 index 0000000..e664038 --- /dev/null +++ b/pics/toolbar/Makefile.am @@ -0,0 +1,88 @@ +####### kdevelop will overwrite this part!!! (begin)########## + + +EXTRA_DIST = file_first.png file_last.png file_next.png file_prev.png flipH.png flipV.png rotateL.png rotateR.png zoom-.png zoom+.png fullscreen.png ifless.png images.png prop.png reload.png zoom100.png zoomH.png zoom_template.png zoomWH.png zoomW.png glselection_ellipse.png glselection_rect.png glselection.png shownav.png configure.png print.png + +install-data-local: + $(mkinstalldirs) $(kde_datadir)/ksquirrel/images/actions/ + $(INSTALL_DATA) $(srcdir)/file_first.png $(kde_datadir)/ksquirrel/images/actions/file_first.png + $(mkinstalldirs) $(kde_datadir)/ksquirrel/images/actions/ + $(INSTALL_DATA) $(srcdir)/file_last.png $(kde_datadir)/ksquirrel/images/actions/file_last.png + $(mkinstalldirs) $(kde_datadir)/ksquirrel/images/actions/ + $(INSTALL_DATA) $(srcdir)/file_next.png $(kde_datadir)/ksquirrel/images/actions/file_next.png + $(mkinstalldirs) $(kde_datadir)/ksquirrel/images/actions/ + $(INSTALL_DATA) $(srcdir)/file_prev.png $(kde_datadir)/ksquirrel/images/actions/file_prev.png + $(mkinstalldirs) $(kde_datadir)/ksquirrel/images/actions/ + $(INSTALL_DATA) $(srcdir)/flipH.png $(kde_datadir)/ksquirrel/images/actions/flipH.png + $(mkinstalldirs) $(kde_datadir)/ksquirrel/images/actions/ + $(INSTALL_DATA) $(srcdir)/flipV.png $(kde_datadir)/ksquirrel/images/actions/flipV.png + $(mkinstalldirs) $(kde_datadir)/ksquirrel/images/actions/ + $(INSTALL_DATA) $(srcdir)/rotateL.png $(kde_datadir)/ksquirrel/images/actions/rotateL.png + $(mkinstalldirs) $(kde_datadir)/ksquirrel/images/actions/ + $(INSTALL_DATA) $(srcdir)/rotateR.png $(kde_datadir)/ksquirrel/images/actions/rotateR.png + $(mkinstalldirs) $(kde_datadir)/ksquirrel/images/actions/ + $(INSTALL_DATA) $(srcdir)/zoom-.png $(kde_datadir)/ksquirrel/images/actions/zoom-.png + $(mkinstalldirs) $(kde_datadir)/ksquirrel/images/actions/ + $(INSTALL_DATA) $(srcdir)/zoom+.png $(kde_datadir)/ksquirrel/images/actions/zoom+.png + $(mkinstalldirs) $(kde_datadir)/ksquirrel/images/actions/ + $(INSTALL_DATA) $(srcdir)/fullscreen.png $(kde_datadir)/ksquirrel/images/actions/fullscreen.png + $(mkinstalldirs) $(kde_datadir)/ksquirrel/images/actions/ + $(INSTALL_DATA) $(srcdir)/ifless.png $(kde_datadir)/ksquirrel/images/actions/ifless.png + $(mkinstalldirs) $(kde_datadir)/ksquirrel/images/actions/ + $(INSTALL_DATA) $(srcdir)/images.png $(kde_datadir)/ksquirrel/images/actions/images.png + $(mkinstalldirs) $(kde_datadir)/ksquirrel/images/actions/ + $(INSTALL_DATA) $(srcdir)/prop.png $(kde_datadir)/ksquirrel/images/actions/prop.png + $(mkinstalldirs) $(kde_datadir)/ksquirrel/images/actions/ + $(INSTALL_DATA) $(srcdir)/reload.png $(kde_datadir)/ksquirrel/images/actions/reload.png + $(mkinstalldirs) $(kde_datadir)/ksquirrel/images/actions/ + $(INSTALL_DATA) $(srcdir)/zoom100.png $(kde_datadir)/ksquirrel/images/actions/zoom100.png + $(mkinstalldirs) $(kde_datadir)/ksquirrel/images/actions/ + $(INSTALL_DATA) $(srcdir)/zoomH.png $(kde_datadir)/ksquirrel/images/actions/zoomH.png + $(mkinstalldirs) $(kde_datadir)/ksquirrel/images/actions/ + $(INSTALL_DATA) $(srcdir)/zoom_template.png $(kde_datadir)/ksquirrel/images/actions/zoom_template.png + $(mkinstalldirs) $(kde_datadir)/ksquirrel/images/actions/ + $(INSTALL_DATA) $(srcdir)/zoomWH.png $(kde_datadir)/ksquirrel/images/actions/zoomWH.png + $(mkinstalldirs) $(kde_datadir)/ksquirrel/images/actions/ + $(INSTALL_DATA) $(srcdir)/zoomW.png $(kde_datadir)/ksquirrel/images/actions/zoomW.png + $(mkinstalldirs) $(kde_datadir)/ksquirrel/images/actions/ + $(INSTALL_DATA) $(srcdir)/glselection_ellipse.png $(kde_datadir)/ksquirrel/images/actions/glselection_ellipse.png + $(mkinstalldirs) $(kde_datadir)/ksquirrel/images/actions/ + $(INSTALL_DATA) $(srcdir)/glselection_rect.png $(kde_datadir)/ksquirrel/images/actions/glselection_rect.png + $(mkinstalldirs) $(kde_datadir)/ksquirrel/images/actions/ + $(INSTALL_DATA) $(srcdir)/glselection.png $(kde_datadir)/ksquirrel/images/actions/glselection.png + $(mkinstalldirs) $(kde_datadir)/ksquirrel/images/actions/ + $(INSTALL_DATA) $(srcdir)/shownav.png $(kde_datadir)/ksquirrel/images/actions/shownav.png + $(mkinstalldirs) $(kde_datadir)/ksquirrel/images/actions/ + $(INSTALL_DATA) $(srcdir)/configure.png $(kde_datadir)/ksquirrel/images/actions/configure.png + $(mkinstalldirs) $(kde_datadir)/ksquirrel/images/actions/ + $(INSTALL_DATA) $(srcdir)/print.png $(kde_datadir)/ksquirrel/images/actions/print.png + +uninstall-local: + -rm -f $(kde_datadir)/ksquirrel/images/actions/file_first.png + -rm -f $(kde_datadir)/ksquirrel/images/actions/file_last.png + -rm -f $(kde_datadir)/ksquirrel/images/actions/file_next.png + -rm -f $(kde_datadir)/ksquirrel/images/actions/file_prev.png + -rm -f $(kde_datadir)/ksquirrel/images/actions/flipH.png + -rm -f $(kde_datadir)/ksquirrel/images/actions/flipV.png + -rm -f $(kde_datadir)/ksquirrel/images/actions/rotateL.png + -rm -f $(kde_datadir)/ksquirrel/images/actions/rotateR.png + -rm -f $(kde_datadir)/ksquirrel/images/actions/zoom-.png + -rm -f $(kde_datadir)/ksquirrel/images/actions/zoom+.png + -rm -f $(kde_datadir)/ksquirrel/images/actions/fullscreen.png + -rm -f $(kde_datadir)/ksquirrel/images/actions/ifless.png + -rm -f $(kde_datadir)/ksquirrel/images/actions/images.png + -rm -f $(kde_datadir)/ksquirrel/images/actions/prop.png + -rm -f $(kde_datadir)/ksquirrel/images/actions/reload.png + -rm -f $(kde_datadir)/ksquirrel/images/actions/zoom100.png + -rm -f $(kde_datadir)/ksquirrel/images/actions/zoomH.png + -rm -f $(kde_datadir)/ksquirrel/images/actions/zoom_template.png + -rm -f $(kde_datadir)/ksquirrel/images/actions/zoomWH.png + -rm -f $(kde_datadir)/ksquirrel/images/actions/zoomW.png + -rm -f $(kde_datadir)/ksquirrel/images/actions/glselection_ellipse.png + -rm -f $(kde_datadir)/ksquirrel/images/actions/glselection_rect.png + -rm -f $(kde_datadir)/ksquirrel/images/actions/glselection.png + -rm -f $(kde_datadir)/ksquirrel/images/actions/shownav.png + -rm -f $(kde_datadir)/ksquirrel/images/actions/configure.png + -rm -f $(kde_datadir)/ksquirrel/images/actions/print.png + +####### kdevelop will overwrite this part!!! (end)############ diff --git a/pics/toolbar/configure.png b/pics/toolbar/configure.png new file mode 100644 index 0000000..d062de6 Binary files /dev/null and b/pics/toolbar/configure.png differ diff --git a/pics/toolbar/file_first.png b/pics/toolbar/file_first.png new file mode 100644 index 0000000..ac099c4 Binary files /dev/null and b/pics/toolbar/file_first.png differ diff --git a/pics/toolbar/file_last.png b/pics/toolbar/file_last.png new file mode 100644 index 0000000..2b98e5a Binary files /dev/null and b/pics/toolbar/file_last.png differ diff --git a/pics/toolbar/file_next.png b/pics/toolbar/file_next.png new file mode 100644 index 0000000..282913d Binary files /dev/null and b/pics/toolbar/file_next.png differ diff --git a/pics/toolbar/file_prev.png b/pics/toolbar/file_prev.png new file mode 100644 index 0000000..f21fc5b Binary files /dev/null and b/pics/toolbar/file_prev.png differ diff --git a/pics/toolbar/flipH.png b/pics/toolbar/flipH.png new file mode 100644 index 0000000..1aa7267 Binary files /dev/null and b/pics/toolbar/flipH.png differ diff --git a/pics/toolbar/flipV.png b/pics/toolbar/flipV.png new file mode 100644 index 0000000..1ffc9f3 Binary files /dev/null and b/pics/toolbar/flipV.png differ diff --git a/pics/toolbar/fullscreen.png b/pics/toolbar/fullscreen.png new file mode 100644 index 0000000..d1405c5 Binary files /dev/null and b/pics/toolbar/fullscreen.png differ diff --git a/pics/toolbar/glselection.png b/pics/toolbar/glselection.png new file mode 100644 index 0000000..26283b0 Binary files /dev/null and b/pics/toolbar/glselection.png differ diff --git a/pics/toolbar/glselection_ellipse.png b/pics/toolbar/glselection_ellipse.png new file mode 100644 index 0000000..3dbc28b Binary files /dev/null and b/pics/toolbar/glselection_ellipse.png differ diff --git a/pics/toolbar/glselection_rect.png b/pics/toolbar/glselection_rect.png new file mode 100644 index 0000000..859cc47 Binary files /dev/null and b/pics/toolbar/glselection_rect.png differ diff --git a/pics/toolbar/ifless.png b/pics/toolbar/ifless.png new file mode 100644 index 0000000..bb8b908 Binary files /dev/null and b/pics/toolbar/ifless.png differ diff --git a/pics/toolbar/images.png b/pics/toolbar/images.png new file mode 100644 index 0000000..54fabc6 Binary files /dev/null and b/pics/toolbar/images.png differ diff --git a/pics/toolbar/print.png b/pics/toolbar/print.png new file mode 100644 index 0000000..00673ec Binary files /dev/null and b/pics/toolbar/print.png differ diff --git a/pics/toolbar/prop.png b/pics/toolbar/prop.png new file mode 100644 index 0000000..f43a0d5 Binary files /dev/null and b/pics/toolbar/prop.png differ diff --git a/pics/toolbar/reload.png b/pics/toolbar/reload.png new file mode 100644 index 0000000..5628000 Binary files /dev/null and b/pics/toolbar/reload.png differ diff --git a/pics/toolbar/rotateL.png b/pics/toolbar/rotateL.png new file mode 100644 index 0000000..37e9455 Binary files /dev/null and b/pics/toolbar/rotateL.png differ diff --git a/pics/toolbar/rotateR.png b/pics/toolbar/rotateR.png new file mode 100644 index 0000000..0f75c3d Binary files /dev/null and b/pics/toolbar/rotateR.png differ diff --git a/pics/toolbar/shownav.png b/pics/toolbar/shownav.png new file mode 100644 index 0000000..022d655 Binary files /dev/null and b/pics/toolbar/shownav.png differ diff --git a/pics/toolbar/zoom+.png b/pics/toolbar/zoom+.png new file mode 100644 index 0000000..8428998 Binary files /dev/null and b/pics/toolbar/zoom+.png differ diff --git a/pics/toolbar/zoom-.png b/pics/toolbar/zoom-.png new file mode 100644 index 0000000..4f85263 Binary files /dev/null and b/pics/toolbar/zoom-.png differ diff --git a/pics/toolbar/zoom100.png b/pics/toolbar/zoom100.png new file mode 100644 index 0000000..0bbf9af Binary files /dev/null and b/pics/toolbar/zoom100.png differ diff --git a/pics/toolbar/zoomH.png b/pics/toolbar/zoomH.png new file mode 100644 index 0000000..8849967 Binary files /dev/null and b/pics/toolbar/zoomH.png differ diff --git a/pics/toolbar/zoomW.png b/pics/toolbar/zoomW.png new file mode 100644 index 0000000..00d92b4 Binary files /dev/null and b/pics/toolbar/zoomW.png differ diff --git a/pics/toolbar/zoomWH.png b/pics/toolbar/zoomWH.png new file mode 100644 index 0000000..c106de7 Binary files /dev/null and b/pics/toolbar/zoomWH.png differ diff --git a/pics/toolbar/zoom_template.png b/pics/toolbar/zoom_template.png new file mode 100644 index 0000000..5100c01 Binary files /dev/null and b/pics/toolbar/zoom_template.png differ diff --git a/pics/tray.png b/pics/tray.png new file mode 100644 index 0000000..a738d8d Binary files /dev/null and b/pics/tray.png differ diff --git a/po/Makefile.am b/po/Makefile.am new file mode 100644 index 0000000..50aeed8 --- /dev/null +++ b/po/Makefile.am @@ -0,0 +1,6 @@ +####### kdevelop will overwrite this part!!! (begin)########## + + +####### kdevelop will overwrite this part!!! (end)############ +POFILES = AUTO + diff --git a/po/cs.po b/po/cs.po new file mode 100644 index 0000000..25207ee --- /dev/null +++ b/po/cs.po @@ -0,0 +1,2159 @@ +# translation of cs.po to +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# +# Karel Volný , 2007. +msgid "" +msgstr "" +"Project-Id-Version: cs\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2007-08-07 09:34+0300\n" +"PO-Revision-Date: 2007-11-16 17:47+0100\n" +"Last-Translator: Karel Volný \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: KBabel 1.11.4\n" +"Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;\n" + +#: sq_filters.ui.h:56 sq_filters.ui.h:58 sq_externaltools.cpp:67 +#: sq_externaltools.cpp:194 sidebar/sq_mountview.cpp:64 sq_viewcache.cpp:47 +#: sq_viewcache.cpp:105 sq_filters.cpp:123 sq_filters.cpp:196 +msgid "Name" +msgstr "Název" + +#: sq_externaltool.cpp:102 sq_externaltool.cpp:162 sq_externaltool.cpp:170 +msgid "No file selected" +msgstr "Není vybrán žádný soubor" + +#: sq_kipimanager.cpp:68 +msgid "No Plugins" +msgstr "Žádné zásuvné moduly" + +#: sq_kipimanager.cpp:125 +msgid "Image actions" +msgstr "Činnosti s obrázkem" + +#: sq_kipimanager.cpp:126 +msgid "Effects" +msgstr "Efekty" + +#: sq_kipimanager.cpp:127 +msgid "Tools" +msgstr "Nástroje" + +#: sq_kipimanager.cpp:130 +msgid "Batch processing" +msgstr "Dávkové zpracování" + +#: sq_kipimanager.cpp:131 +msgid "Collections" +msgstr "Kolekce" + +#: sq_libraryhandler.cpp:148 +msgid "All files" +msgstr "Všechny soubory" + +#: sq_navigatordropmenu.cpp:40 +msgid "Copy here" +msgstr "Kopírovat sem" + +#: sq_navigatordropmenu.cpp:43 +msgid "Move here" +msgstr "Přesunout sem" + +#: sq_navigatordropmenu.cpp:46 +msgid "Link here" +msgstr "Vytvořit zde odkaz" + +#: sq_glinfo.cpp:45 sq_glinfo.cpp:92 +msgid "Parameter" +msgstr "Parametr" + +#: sq_glinfo.cpp:46 sq_glinfo.cpp:93 sq_imageproperties.cpp:321 +#: sq_imageproperties.cpp:408 imageedit/sq_imagefilter.cpp:487 +msgid "Value" +msgstr "Hodnota" + +#: sq_glinfo.cpp:91 +msgid "OpenGL information" +msgstr "Informace o OpenGL" + +#: sq_externaltools.cpp:66 sq_externaltools.cpp:193 +msgid "Pixmap" +msgstr "Rastr" + +#: sq_externaltools.cpp:68 sq_externaltools.cpp:195 +msgid "Command" +msgstr "Příkaz" + +#: sq_externaltools.cpp:190 +msgid "Adjust external tools" +msgstr "Upravit externí nástroje" + +#: sq_externaltools.cpp:192 sq_filters.cpp:182 +msgid " OK " +msgstr " OK " + +#: sq_externaltools.cpp:196 sq_externaltools.ui.h:146 +#, c-format +msgid "Command can contain
  • %f: one file
  • %F: multiple files
" +msgstr "Příkaz může obsahovat
  • %f: jeden soubor
  • %F: více souborů
" + +#: sq_externaltools.cpp:199 +msgid "New tool" +msgstr "Nový nástroj" + +#: sq_externaltools.cpp:206 +msgid "Move tool up" +msgstr "Přesunout nástroj nahoru" + +#: sq_externaltools.cpp:208 +msgid "Move tool down" +msgstr "Přesunout nástroj dolů" + +#: sq_kipiinterface.cpp:72 +msgid "Root directory" +msgstr "Kořenový adresář" + +#: sq_kipiinterface.cpp:144 +msgid "Folder content" +msgstr "Obsah adresáře" + +#: sq_kipiinterface.cpp:161 +msgid "Selected images" +msgstr "Vybrané obrázky" + +#: sq_kipiinterface.cpp:175 ksquirrel.cpp:513 +msgid "Image basket" +msgstr "Košík na obrázky" + +#: main.cpp:40 +msgid "File to be opened at startup." +msgstr "Soubor jež má být otevřen při startu." + +#: main.cpp:41 +msgid "Print found libraries and exit." +msgstr "Vypsat nalezené knihovny a skončit." + +#: main.cpp:57 +msgid "KSquirrel - image viewer for KDE" +msgstr "KSquirrel – prohlížeč obrázků pro KDE" + +#: main.cpp:66 +msgid "Bug reports, patches" +msgstr "Hlášení chyb, patche" + +#: main.cpp:67 +msgid "Bug reports" +msgstr "Hlášení chyb" + +#: main.cpp:68 +msgid "Translation help" +msgstr "Pomoc s překladem" + +#: main.cpp:69 +msgid "TiamaT" +msgstr "TiamaT" + +#: main.cpp:69 +msgid "Initial artwork for edit tools" +msgstr "Původní grafika editačních nástrojů" + +#: main.cpp:70 +msgid "Fera" +msgstr "Fera" + +#: main.cpp:70 +msgid "Great artwork for edit tools" +msgstr "Výtečná grafika editačních nástrojů" + +#: main.cpp:71 +msgid "OpenGL forum at" +msgstr "OpenGL fórum" + +#: main.cpp:72 +msgid "GameDev forum at" +msgstr "Fórum GameDev" + +#: sq_imageproperties.cpp:320 sq_imageproperties.cpp:407 +msgid "Group" +msgstr "Skupina" + +#: sq_imageproperties.cpp:359 sq_glwidget.cpp:350 +msgid "Image properties" +msgstr "Vlastnosti obrázku" + +#: sq_imageproperties.cpp:361 +msgid "Attributes" +msgstr "Atributy" + +#: sq_imageproperties.cpp:362 +msgid "Owner:" +msgstr "Vlastník:" + +#: sq_imageproperties.cpp:363 +msgid "Group:" +msgstr "Skupina:" + +#: sq_imageproperties.cpp:365 +msgid "Permissions:" +msgstr "Oprávnění:" + +#: sq_imageproperties.cpp:368 +msgid "Time" +msgstr "Čas" + +#: sq_imageproperties.cpp:369 +msgid "Created:" +msgstr "Vytvořeno:" + +#: sq_imageproperties.cpp:370 +msgid "Last read:" +msgstr "Poslední přístup:" + +#: sq_imageproperties.cpp:371 +msgid "Last modified:" +msgstr "Poslední změna:" + +#: sq_imageproperties.cpp:375 sq_helpwidget.cpp:181 sq_options.ui.h:134 +msgid "General" +msgstr "Obecné" + +#: sq_imageproperties.cpp:376 +msgid "File:" +msgstr "Soubor:" + +#: sq_imageproperties.cpp:378 sq_pluginsinfo.cpp:137 sq_slideshow.cpp:211 +msgid "Directory:" +msgstr "Adresář:" + +#: sq_imageproperties.cpp:379 +msgid "Size:" +msgstr "Velikost:" + +#: sq_imageproperties.cpp:381 +msgid "Type:" +msgstr "Typ:" + +#: sq_imageproperties.cpp:382 +msgid "Number of frames:" +msgstr "Počet snímků:" + +#: sq_imageproperties.cpp:383 +msgid "Current frame" +msgstr "Aktuální snímek" + +#: sq_imageproperties.cpp:384 sq_slideshow.cpp:219 +msgid "Delay:" +msgstr "Prodleva:" + +#: sq_imageproperties.cpp:385 +msgid "Dimensions:" +msgstr "Rozměry:" + +#: sq_imageproperties.cpp:386 +msgid "Bits per pixel:" +msgstr "Bitů na pixel:" + +#: sq_imageproperties.cpp:387 +msgid "Color space:" +msgstr "Barevný prostor:" + +#: sq_imageproperties.cpp:388 +msgid "Compression:" +msgstr "Komprese:" + +#: sq_imageproperties.cpp:389 +msgid "Uncompressed size:" +msgstr "Nekomprimovaná velikost:" + +#: sq_imageproperties.cpp:390 +msgid "Compression ratio:" +msgstr "Kompresní poměr:" + +#: sq_imageproperties.cpp:391 +msgid "Interlaced:" +msgstr "Prokládané:" + +#: sq_imageproperties.cpp:392 +msgid "Status:" +msgstr "Stav:" + +#: sq_imageproperties.cpp:406 sq_glwidget.cpp:2662 sq_options.cpp:816 +msgid "Image" +msgstr "Obrázek" + +#: sq_imageproperties.cpp:409 +msgid "Metadata" +msgstr "Metadata" + +#: sq_pluginsinfo.cpp:55 sq_pluginsinfo.cpp:129 +msgid "..." +msgstr "…" + +#: sq_pluginsinfo.cpp:56 sq_pluginsinfo.cpp:130 +msgid "Icon" +msgstr "Ikona" + +#: sq_pluginsinfo.cpp:57 sq_pluginsinfo.cpp:131 +msgid "Library" +msgstr "Knihovna" + +#: sq_pluginsinfo.cpp:58 sq_pluginsinfo.cpp:132 +msgid "Version" +msgstr "Verze" + +#: sq_pluginsinfo.cpp:59 sq_pluginsinfo.cpp:133 sq_viewcache.cpp:48 +#: sq_viewcache.cpp:106 +msgid "MIME" +msgstr "MIME" + +#: sq_pluginsinfo.cpp:128 +msgid "Codec information and settings" +msgstr "Kodeky – informace a nastavení" + +#: sq_pluginsinfo.cpp:138 +msgid "Total found:" +msgstr "Celkem nalezeno:" + +#: sq_errorstring.cpp:34 +msgid "cannot open file for reading" +msgstr "soubor nelze otevřít pro čtení" + +#: sq_errorstring.cpp:35 +msgid "file corrupted" +msgstr "soubor je poškozen" + +#: sq_errorstring.cpp:36 +msgid "no memory" +msgstr "není paměť" + +#: sq_errorstring.cpp:37 +msgid "file type not supported" +msgstr "souborový typ není podporován" + +#: sq_errorstring.cpp:38 +msgid "wrong image dimensions" +msgstr "špatné rozměry obrázku" + +#: sq_errorstring.cpp:39 +msgid "cannot open file for writing" +msgstr "soubor nelze otevřít pro zápis" + +#: sq_errorstring.cpp:40 +msgid "write feature is not supported" +msgstr "zápis není podporován" + +#: sq_errorstring.cpp:41 +msgid "write error (check free space)" +msgstr "chyba při zápisu (zkontrolujte dostupný prostor)" + +#: sq_errorstring.cpp:42 +msgid "wrong parameters" +msgstr "chybné parametry" + +#: sq_errorstring.cpp:43 +msgid "Editing process is not finished yet" +msgstr "Proces editace není dosud dokončen" + +#: sq_selectdeselectgroup.cpp:83 +msgid "Filename or mask:" +msgstr "Jméno souboru nebo maska:" + +#: sidebar/sq_treeview.cpp:89 +msgid "root" +msgstr "kořen" + +#: sidebar/sq_categoriesview.cpp:95 ksquirrel.cpp:512 +msgid "Categories" +msgstr "Kategorie" + +#: sidebar/sq_categoriesview.cpp:115 sidebar/sq_categoriesview.cpp:166 +msgid "New category" +msgstr "Nová kategorie" + +#: sidebar/sq_categoriesview.cpp:153 sidebar/sq_categoriesview.cpp:218 +msgid "New Category" +msgstr "Nová kategorie" + +#: sidebar/sq_categoriesview.cpp:169 sidebar/sq_categoriesview.cpp:198 +msgid "Create default categories" +msgstr "Vytvořit výchozí kategorie" + +#: sidebar/sq_categoriesview.cpp:197 +msgid "" +"This will create default categories: Concerts, Pets, Home, Friends, Free time, " +"Travelling and Nature. Continue?" +msgstr "Budou vytvořeny výchozí kategorie: Koncerty, Zvířata, Domov, Přátelé, Volný čas, Cestování a Příroda. Pokračovat?" + +#: sidebar/sq_categoriesview.cpp:218 +msgid "Create new category:" +msgstr "Vytvořit novou kategorii:" + +#: sidebar/sq_mountview.cpp:43 +msgid "Mount" +msgstr "Připojit" + +#: sidebar/sq_mountview.cpp:45 +msgid "Unmount" +msgstr "Odpojit" + +#: sidebar/sq_mountview.cpp:47 +msgid "Refresh" +msgstr "Obnovit" + +#: sidebar/sq_mountview.cpp:170 +msgid "Device" +msgstr "Zařízení" + +#: sidebar/sq_mountview.cpp:173 +msgid "FS Type" +msgstr "Souborový systém" + +#: sidebar/sq_imagebasket.cpp:244 +msgid "Synchronize" +msgstr "Synchronisovat" + +#: sidebar/sq_previewwidget.cpp:60 +msgid "Background color..." +msgstr "Barva pozadí …" + +#: sidebar/sq_categorybrowsermenu.cpp:137 +#: sidebar/sq_categorybrowsermenu.cpp:146 +msgid "Failed to Read Folder" +msgstr "Čtení adresáře selhalo" + +#: sidebar/sq_categorybrowsermenu.cpp:154 +msgid "Not Authorized to Read Folder" +msgstr "Není oprávnění ke čtení adresáře" + +#: sidebar/sq_categorybrowsermenu.cpp:167 +msgid "Add here" +msgstr "Přidat sem" + +#: sidebar/sq_categorybrowsermenu.cpp:310 +msgid "More..." +msgstr "Více …" + +#: sq_thumbnailcachemaster.cpp:143 +msgid "Thumbnail cache" +msgstr "Keš náhledů" + +#: sq_thumbnailcachemaster.cpp:144 +msgid "Calculate cache size on disk" +msgstr "Spočítat velikost diskové keše" + +#: sq_thumbnailcachemaster.cpp:146 +msgid "Clear cache on disk" +msgstr "Vyprázdnit diskovou keš" + +#: sq_thumbnailcachemaster.cpp:147 +msgid "View memory cache" +msgstr "Zobrazit paměťovou keš" + +#: sq_thumbnailcachemaster.cpp:148 +msgid "Clear cache in memory" +msgstr "Vyprázdnit paměťovou keš" + +#: sq_thumbnailcachemaster.cpp:150 +msgid "Sync cache to disk" +msgstr "Synchronizovat keš s diskem" + +#: sq_thumbnailcachemaster.cpp:151 +msgid "Calculate cache size in memory" +msgstr "Spočítat velikost paměťové keše" + +#: sq_diroperator.cpp:138 +msgid "remote filesystem" +msgstr "vzdálený souborový systém" + +#: sq_diroperator.cpp:158 +msgid "" +"
Mount point:%1
Total size:%" +"2
Used:%3
Available:%4
" +msgstr "" +"
Přípojný bod:%1
Celková velikost:%" +"2
Obsazeno:%3
Available:%4
" + +#: sq_diroperator.cpp:245 +msgid "no files selected" +msgstr "nejsou vybrány žádné soubory" + +#: sq_diroperator.cpp:306 +msgid "Edit file type" +msgstr "Upravit typ souboru" + +#: sq_diroperator.cpp:307 +msgid "Add to Basket" +msgstr "Přidat do Košíku" + +#: sq_diroperator.cpp:309 sq_diroperator.cpp:889 +msgid "File actions" +msgstr "Činnosti se souborem" + +#: sq_diroperator.cpp:327 +msgid "Copy to..." +msgstr "Kopírovat do …" + +#: sq_diroperator.cpp:328 +msgid "Move to..." +msgstr "Přesunout do …" + +#: sq_diroperator.cpp:329 +msgid "Link to..." +msgstr "Vytvořit odkaz v …" + +#: sq_diroperator.cpp:331 +msgid "Run" +msgstr "Spustit" + +#: sq_diroperator.cpp:333 +msgid "Recreate selected thumbnails" +msgstr "Znovu vytvořit vybrané náhledy" + +#: sq_diroperator.cpp:336 +msgid "Convert..." +msgstr "Zkonvertovat …" + +#: sq_diroperator.cpp:439 +msgid "Total %1 in %2 (%3, %4)" +msgstr "Celkem %1 v %2 (%3, %4)" + +#: sq_diroperator.cpp:441 +msgid "1 item" +msgstr "1 položka" + +#: sq_diroperator.cpp:442 +msgid "1 folder" +msgstr "1 adresář" + +#: sq_diroperator.cpp:443 +msgid "1 file" +msgstr "1 soubor" + +#: sq_diroperator.cpp:627 +#, c-format +msgid "Command cannot contain both \"%f\" and \"%F\"" +msgstr "Příkaz nemůže obsahovat zároveň „%f“ a „%F“" + +#: sq_diroperator.cpp:627 sq_diroperator.cpp:632 +msgid "Error processing command" +msgstr "Chyba při zpracování příkazu" + +#: sq_diroperator.cpp:632 +#, c-format +msgid "Command should contain \"%f\" or \"%F\"" +msgstr "Příkaz by měl obsahovat „%f“ nebo „%F“" + +#: sq_diroperator.cpp:741 +msgid "Unsupported format \"%1\"" +msgstr "Nepodporovaný formát „%1“" + +#: sq_diroperator.cpp:886 +msgid "Add to &Category" +msgstr "Přidat do &kategorie" + +#: sq_diroperator.cpp:890 +msgid "&External tools" +msgstr "&Externí nástroje" + +#: sq_slideshowwidget.cpp:345 +msgid "" +"
Enter, Escape, Returnstop " +"slideshow
Pause, Spacepause/unpause " +"slideshow
Page Upprevious image
Page Downnext image
Mshow/hide onscreen messages
" +msgstr "" +"
Enter, Escapezastavit slideshow
Pause, mezerníkpozastavit/pokračovat ve " +"slideshow
Page Uppředchozí obrázek
Page Downnásledující obrázek
Mzobrazit/skrýt zprávy na obrazovce
" + +#: sq_codecsettingsskeleton.ui.h:28 +msgid "" +"Error loading widget from %1. Please check your installation or " +"contact ksquirrel.iv@gmail.com" +msgstr "Chyba při nahrávání widgetu z %1. Prosím zkontrolujte instalaci programu, případně kontaktujte ksquirrel.iv@gmail.com" + +#: sq_widgetstack.cpp:473 sq_widgetstack.cpp:507 +msgid "No files to copy or move" +msgstr "Žádné soubory ke kopírování nebo přesunu" + +#: sq_widgetstack.cpp:607 +msgid "Select a group of files" +msgstr "Vyberte skupinu souborů" + +#: sq_widgetstack.cpp:607 +msgid "Deselect a group of files" +msgstr "Zrušte výběr skupiny souborů" + +#: sq_widgetstack.cpp:608 +msgid "Select!" +msgstr "Vybrat!" + +#: sq_widgetstack.cpp:608 +msgid "Deselect!" +msgstr "Zrušit výběr!" + +#: sq_filethumbview.cpp:370 +msgid "" +"%3%4" +msgstr "" +"
File:%1
Size:%2
%3%4" + +#: sq_filethumbview.cpp:373 +msgid "" +msgstr "" + +#: imageedit/sq_writeoption.cpp:108 +msgid "RLE compression" +msgstr "Komprese RLE" + +#: imageedit/sq_writeoption.cpp:109 +msgid "Compression level" +msgstr "Úroveň komprese" + +#: imageedit/sq_writeoption.cpp:110 +msgid "Interlaced" +msgstr "Prokládaný" + +#: imageedit/sq_writeoption.cpp:112 +msgid "No special options available for this format" +msgstr "Pro tento formát nejsou dostupné žádné specifické možnosti" + +#: imageedit/sq_converter.cpp:47 +msgid "internal error" +msgstr "vnitřní chyba" + +#: imageedit/sq_converter.cpp:48 +msgid "failed" +msgstr "selhalo" + +#: imageedit/sq_converter.cpp:50 +msgid "Converting" +msgstr "Konvertuje se" + +#: imageedit/sq_converter.cpp:68 +msgid "Select files to edit" +msgstr "Vyberte soubory pro úpravy" + +#: imageedit/sq_converter.cpp:73 +msgid "" +"Converter cannot work with remote files.\n" +"Sorry" +msgstr "" +"Konvertor nemůže pracovat se vzdálenými soubory.\n" +"Promiňte." + +#: imageedit/sq_converter.cpp:160 +msgid "Temporary file creation failed" +msgstr "Selhalo vytváření dočasného souboru" + +#: imageedit/sq_converter.cpp:243 sq_imageproperties.ui.h:72 +msgid "1 error" +msgstr "1 chyba" + +#: imageedit/sq_converter.cpp:250 +msgid "Removing" +msgstr "Odstraňuje se" + +#: imageedit/sq_converter.cpp:436 +msgid "Convert 1 file" +msgstr "Konvertovat 1 soubor" + +#: imageedit/sq_imageeditoptions.cpp:134 +msgid "Edit options" +msgstr "Upravit nastavení" + +#: imageedit/sq_imageeditoptions.cpp:135 +msgid "New files" +msgstr "Nové soubory" + +#: imageedit/sq_imageeditoptions.cpp:136 +msgid "Place here" +msgstr "Umístit sem" + +#: imageedit/sq_imageeditoptions.cpp:137 +msgid "Replace original files" +msgstr "Přepsat původní soubory" + +#: imageedit/sq_imageeditoptions.cpp:138 +msgid "Place files in current directory, renaming them if necessary" +msgstr "Umístit soubory do aktuálního adresáře, v případě potřeby je přejmenovat" + +#: imageedit/sq_imageeditoptions.cpp:139 +msgid "Place files in current directory, replacing existing files" +msgstr "Umístit soubory do aktuálního adresáře, přepsat stávající soubory" + +#: imageedit/sq_imageeditoptions.cpp:140 +msgid "Close, when all operations succeeded" +msgstr "Zavřít, pokud byly všechny operace úspěšné" + +#: imageedit/sq_imagebcg.ui.h:17 imageedit/sq_imagebcg.ui.h:31 +#: imageedit/sq_imagebcg.cpp:382 +msgid "Brightness" +msgstr "Jas" + +#: imageedit/sq_imagebcg.ui.h:18 imageedit/sq_imagebcg.ui.h:31 +#: imageedit/sq_imagebcg.cpp:383 +msgid "Contrast" +msgstr "Kontrast" + +#: imageedit/sq_imagebcg.ui.h:19 imageedit/sq_imagebcg.ui.h:31 +#: imageedit/sq_imagebcg.cpp:384 +msgid "Gamma" +msgstr "Gama" + +#: imageedit/sq_imagebcg.ui.h:20 imageedit/sq_imagebcg.ui.h:32 +#: imageedit/sq_imagebcg.cpp:390 +msgid "Red" +msgstr "Červená" + +#: imageedit/sq_imagebcg.ui.h:20 +msgid "Cyan" +msgstr "Azurová" + +#: imageedit/sq_imagebcg.ui.h:21 imageedit/sq_imagebcg.ui.h:32 +#: imageedit/sq_imagebcg.cpp:389 +msgid "Green" +msgstr "Zelená" + +#: imageedit/sq_imagebcg.ui.h:21 +msgid "Magenta" +msgstr "Fialová" + +#: imageedit/sq_imagebcg.ui.h:22 imageedit/sq_imagebcg.ui.h:32 +#: imageedit/sq_imagebcg.cpp:388 +msgid "Blue" +msgstr "Modrá" + +#: imageedit/sq_imagebcg.ui.h:22 +msgid "Yellow" +msgstr "Žlutá" + +#: imageedit/sq_imagefilter.cpp:473 imageedit/sq_imagefilter.cpp:539 +msgid "Filter" +msgstr "Filtr" + +#: imageedit/sq_imagefilter.cpp:474 imageedit/sq_imagefilter.cpp:486 +msgid "Color:" +msgstr "Barva:" + +#: imageedit/sq_imagefilter.cpp:476 +msgid "Opacity" +msgstr "Krytí" + +#: imageedit/sq_imagefilter.cpp:477 imageedit/sq_imagefilter.cpp:482 +#: imageedit/sq_imagefilter.cpp:505 +msgid "Sigma" +msgstr "Sigma" + +#: imageedit/sq_imagefilter.cpp:478 imageedit/sq_imagefilter.cpp:481 +#: imageedit/sq_imagefilter.cpp:483 imageedit/sq_imagefilter.cpp:501 +#: imageedit/sq_imagefilter.cpp:506 +msgid "Radius" +msgstr "Poloměr" + +#: imageedit/sq_imagefilter.cpp:479 imageedit/sq_imagefilter.cpp:492 +#: imageedit/sq_imagefilter.cpp:507 +msgid "Factor" +msgstr "Faktor" + +#: imageedit/sq_imagefilter.cpp:480 imageedit/sq_imagefilter.cpp:484 +#: imageedit/sq_imagefilter.cpp:493 imageedit/sq_imagefilter.cpp:514 +msgid "" +"There are no special options available for this filter. Just click \"Filter" +"\"." +msgstr "Pro tento filtr nejsou k disposici žádná zvláštní nastavení. Prostě klikněte na „Filtr“." + +#: imageedit/sq_imagefilter.cpp:490 +msgid "Color 1:" +msgstr "Barva 1:" + +#: imageedit/sq_imagefilter.cpp:491 +msgid "Color 2:" +msgstr "Barva 2:" + +#: imageedit/sq_imagefilter.cpp:494 +msgid "Noise type" +msgstr "Druh šumu" + +#: imageedit/sq_imagefilter.cpp:495 +msgid "Uniform" +msgstr "Jednotný" + +#: imageedit/sq_imagefilter.cpp:496 +msgid "Impulse" +msgstr "Impulsní" + +#: imageedit/sq_imagefilter.cpp:497 +msgid "Multiplicative Gaussian" +msgstr "Multiplikativní Gausovský" + +#: imageedit/sq_imagefilter.cpp:498 +msgid "Poisson" +msgstr "Poissonův" + +#: imageedit/sq_imagefilter.cpp:499 +msgid "Gaussian" +msgstr "Gausovský" + +#: imageedit/sq_imagefilter.cpp:500 +msgid "Laplacian" +msgstr "Laplaceův" + +#: imageedit/sq_imagefilter.cpp:502 +msgid "Color" +msgstr "Barva" + +#: imageedit/sq_imagefilter.cpp:503 +msgid "Elevation" +msgstr "Výška" + +#: imageedit/sq_imagefilter.cpp:504 +msgid "Azimuth" +msgstr "Azimut" + +#: imageedit/sq_imagefilter.cpp:508 +msgid "Amount" +msgstr "Míra" + +#: imageedit/sq_imagefilter.cpp:509 +msgid "Type" +msgstr "Typ" + +#: imageedit/sq_imagefilter.cpp:510 +msgid "GBR" +msgstr "GBR" + +#: imageedit/sq_imagefilter.cpp:511 +msgid "BRG" +msgstr "BRG" + +#: imageedit/sq_imagefilter.cpp:512 +msgid "Degrees" +msgstr "Stupně" + +#: imageedit/sq_imagefilter.cpp:513 imageedit/sq_imagefilter.cpp:515 +#: imageedit/sq_imagefilter.cpp:536 +msgid "Threshold" +msgstr "Práh" + +#: imageedit/sq_imagefilter.cpp:517 +msgid "Blend" +msgstr "Mísení" + +#: imageedit/sq_imagefilter.cpp:518 +msgid "Blur" +msgstr "Rozostření" + +#: imageedit/sq_imagefilter.cpp:519 +msgid "Desaturate" +msgstr "Odbarvit" + +#: imageedit/sq_imagefilter.cpp:520 +msgid "Despeckle" +msgstr "Odšumit" + +#: imageedit/sq_imagefilter.cpp:521 +msgid "Edge" +msgstr "Hrana" + +#: imageedit/sq_imagefilter.cpp:522 +msgid "Emboss" +msgstr "Reliéf" + +#: imageedit/sq_imagefilter.cpp:523 +msgid "Equalize" +msgstr "Ekvalizovat" + +#: imageedit/sq_imagefilter.cpp:524 +msgid "Fade" +msgstr "Zeslabit" + +#: imageedit/sq_imagefilter.cpp:525 +msgid "Flatten" +msgstr "Zploštit" + +#: imageedit/sq_imagefilter.cpp:526 +msgid "Implode" +msgstr "Implodovat" + +#: imageedit/sq_imagefilter.cpp:527 +msgid "Negative" +msgstr "Negativ" + +#: imageedit/sq_imagefilter.cpp:528 +msgid "Noise" +msgstr "Šum" + +#: imageedit/sq_imagefilter.cpp:529 +msgid "Oil" +msgstr "Olej" + +#: imageedit/sq_imagefilter.cpp:530 +msgid "Shade" +msgstr "Stínovat" + +#: imageedit/sq_imagefilter.cpp:531 +msgid "Sharpen" +msgstr "Zaostřit" + +#: imageedit/sq_imagefilter.cpp:532 +msgid "Solarize" +msgstr "Proslunit" + +#: imageedit/sq_imagefilter.cpp:533 +msgid "Spread" +msgstr "Rozestřít" + +#: imageedit/sq_imagefilter.cpp:534 +msgid "Swap colors" +msgstr "Prohodit barvy" + +#: imageedit/sq_imagefilter.cpp:535 +msgid "Swirl" +msgstr "Rozvířit" + +#: imageedit/sq_imagefilter.cpp:537 +msgid "Grayscale" +msgstr "Odstíny šedi" + +#: imageedit/sq_imagefilter.cpp:538 +msgid "Redeye" +msgstr "Červené oči" + +#: imageedit/sq_imagefilter.cpp:541 +msgid "Image after filtering:" +msgstr "Obrázek po aplikaci filtru:" + +#: imageedit/sq_imagefilter.cpp:542 imageedit/sq_imagebcg.cpp:397 +msgid "Original image:" +msgstr "Původní obrázek:" + +#: imageedit/sq_imagebcg.cpp:378 +msgid "Color balance" +msgstr "Vyvážení barev" + +#: imageedit/sq_imagebcg.cpp:394 +msgid "Colorize" +msgstr "Obarvit" + +#: imageedit/sq_imagebcg.cpp:396 +msgid "Image after colorizing:" +msgstr "Obrázek po obarvení:" + +#: imageedit/sq_imageconvert.cpp:167 +msgid "Convert" +msgstr "Konvertovat" + +#: imageedit/sq_imageconvert.cpp:172 +msgid "Conversion options" +msgstr "Možnosti konverze" + +#: sq_viewcache.cpp:49 sq_viewcache.cpp:107 +msgid "Parameters" +msgstr "Parametry" + +#: sq_viewcache.cpp:103 +msgid "Memory cache" +msgstr "Paměťová keš" + +#: sq_viewcache.cpp:108 +msgid "Total:" +msgstr "Celkem:" + +#: sq_imageproperties.ui.h:29 +msgid "Copy entry" +msgstr "Kopírovat položku" + +#: sq_imageproperties.ui.h:30 +msgid "Copy all entries" +msgstr "Kopírovat všechny položky" + +#: sq_imageproperties.ui.h:95 +msgid "EXIF" +msgstr "EXIF" + +#: sq_imageproperties.ui.h:105 +msgid "Simple" +msgstr "Prostý" + +#: sq_imageproperties.ui.h:108 +msgid "Full" +msgstr "Plný" + +#: sq_imageproperties.ui.h:127 +msgid "EXIF (no)" +msgstr "EXIF (není)" + +#: sq_imageproperties.ui.h:177 +msgid "Metadata (no)" +msgstr "Metadata (nejsou)" + +#: _translatorinfo.cpp:1 +msgid "" +"_: NAME OF TRANSLATORS\n" +"Your names" +msgstr "Karel Volný" + +#: _translatorinfo.cpp:3 +msgid "" +"_: EMAIL OF TRANSLATORS\n" +"Your emails" +msgstr "kavol@seznam.cz" + +#: sq_glwidget.cpp:233 +msgid "Rectangle" +msgstr "Obdélník" + +#: sq_glwidget.cpp:234 +msgid "Ellipse" +msgstr "Elipsa" + +#: sq_glwidget.cpp:239 +msgid "Fit width" +msgstr "Přizpůsobit šířku" + +#: sq_glwidget.cpp:240 +msgid "Fit height" +msgstr "Přizpůsobit výšku" + +#: sq_glwidget.cpp:241 +msgid "Fit image" +msgstr "Přizpůsobit obrázek" + +#: sq_glwidget.cpp:242 +msgid "Zoom 100%" +msgstr "Přiblížení 100%" + +#: sq_glwidget.cpp:243 +msgid "Leave previous zoom" +msgstr "Ponechat předchozí přiblížení" + +#: sq_glwidget.cpp:244 +msgid "Ignore, if image is smaller than window" +msgstr "Ignorovat, jestliže obrázek je menší než okno" + +#: sq_glwidget.cpp:318 +msgid "Go to first image" +msgstr "Jít na první obrázek" + +#: sq_glwidget.cpp:319 +msgid "Previous image" +msgstr "Předchozí obrázek" + +#: sq_glwidget.cpp:321 +msgid "Next image" +msgstr "Následující obrázek" + +#: sq_glwidget.cpp:323 +msgid "Go to last image" +msgstr "Jít na poslední obrázek" + +#: sq_glwidget.cpp:326 sq_glwidget.cpp:2685 +msgid "Zoom +" +msgstr "Přiblížit" + +#: sq_glwidget.cpp:328 sq_glwidget.cpp:2686 +msgid "Zoom -" +msgstr "Oddálit" + +#: sq_glwidget.cpp:332 sq_glwidget.cpp:2677 +msgid "Rotate left" +msgstr "Rotovat vlevo" + +#: sq_glwidget.cpp:334 sq_glwidget.cpp:2678 +msgid "Rotate right" +msgstr "Rotovat vpravo" + +#: sq_glwidget.cpp:336 sq_glwidget.cpp:2707 +msgid "Flip vertically" +msgstr "Překlopit svisle" + +#: sq_glwidget.cpp:338 sq_glwidget.cpp:2708 +msgid "Flip horizontally" +msgstr "Překlopit vodorovně" + +#: sq_glwidget.cpp:340 +msgid "Normalize" +msgstr "Normalizovat" + +#: sq_glwidget.cpp:342 sq_glwidget.cpp:2723 +msgid "Fullscreen" +msgstr "Přes celou obrazovku" + +#: sq_glwidget.cpp:344 +msgid "Select image" +msgstr "Veberte obrázek" + +#: sq_glwidget.cpp:346 +msgid "Selection" +msgstr "Výběr" + +#: sq_glwidget.cpp:348 sq_glwidget.cpp:2717 sq_codecsettingsskeleton.cpp:128 +msgid "Codec settings" +msgstr "Nastavení kodeku" + +#: sq_glwidget.cpp:351 +msgid "Show navigator" +msgstr "Zobrazit navigátor" + +#: sq_glwidget.cpp:1024 +msgid "yes" +msgstr "ano" + +#: sq_glwidget.cpp:1024 +msgid "no" +msgstr "ne" + +#: sq_glwidget.cpp:1485 +msgid "Codec for %1 format not found" +msgstr "Nebyl nalezen kodek pro formát %1" + +#: sq_glwidget.cpp:1729 +msgid "Memory allocation failed for %1 of memory" +msgstr "Selhala alokace %1 paměti" + +#: sq_glwidget.cpp:1741 +msgid "Memory allocation failed" +msgstr "Selhala alokace paměti" + +#: sq_glwidget.cpp:1747 +msgid "Decoding failed" +msgstr "Selhalo dekódování" + +#: sq_glwidget.cpp:1849 +msgid " ms." +msgstr " ms." + +#: sq_glwidget.cpp:2363 +msgid "" +"Sorry, could not perform write operation\n" +"for codec \"%1\"" +msgstr "" +"Bohužel nelze provést operaci zápisu\n" +"pro kodek „%1“" + +#: sq_glwidget.cpp:2382 sq_glwidget.cpp:2390 sq_glwidget.cpp:2412 +msgid "Error writing image" +msgstr "Chyba při zápisu obrázku" + +#: sq_glwidget.cpp:2433 +msgid "Try another location?" +msgstr "Zkusit jiné umístění?" + +#: sq_glwidget.cpp:2658 +msgid "Rotate" +msgstr "Rotovat" + +#: sq_glwidget.cpp:2661 sq_options.cpp:803 +msgid "Window" +msgstr "Okno" + +#: sq_glwidget.cpp:2670 +msgid "Next" +msgstr "Následující" + +#: sq_glwidget.cpp:2671 +msgid "Previous" +msgstr "Předcházející" + +#: sq_glwidget.cpp:2672 +msgid "First" +msgstr "První" + +#: sq_glwidget.cpp:2673 +msgid "Last" +msgstr "Poslední" + +#: sq_glwidget.cpp:2680 +msgid "Rotate 180'" +msgstr "Rotovat o 180°" + +#: sq_glwidget.cpp:2682 +msgid "Rotate 1' left" +msgstr "Rotovat o 1° vlevo" + +#: sq_glwidget.cpp:2683 +msgid "Rotate 1' right" +msgstr "Rotovat o 1° vpravo" + +#: sq_glwidget.cpp:2687 +msgid "Zoom 2x" +msgstr "Přiblížit 2×" + +#: sq_glwidget.cpp:2688 +msgid "Zoom 1/2x" +msgstr "Přiblížit ½×" + +#: sq_glwidget.cpp:2698 +msgid "Move left" +msgstr "Posunout vlevo" + +#: sq_glwidget.cpp:2699 +msgid "Move right" +msgstr "Posunout vpravo" + +#: sq_glwidget.cpp:2700 +msgid "Move up" +msgstr "Posunout nahoru" + +#: sq_glwidget.cpp:2701 +msgid "Move down" +msgstr "Posunout dolů" + +#: sq_glwidget.cpp:2703 +msgid "Start/stop animation" +msgstr "Spustit/zastavit animaci" + +#: sq_glwidget.cpp:2704 +msgid "Hide/show background" +msgstr "Skrýt/zobrazit pozadí" + +#: sq_glwidget.cpp:2705 +msgid "Hide/show tickmarks" +msgstr "Skrýt/zobrazit značky" + +#: sq_glwidget.cpp:2710 +msgid "First page" +msgstr "První stránka" + +#: sq_glwidget.cpp:2711 +msgid "Previous page" +msgstr "Předcházející stránka" + +#: sq_glwidget.cpp:2712 +msgid "Next page" +msgstr "Následující stránka" + +#: sq_glwidget.cpp:2713 +msgid "Last page" +msgstr "Poslední stránka" + +#: sq_glwidget.cpp:2715 +msgid "To clipboard" +msgstr "Do schránky" + +#: sq_glwidget.cpp:2720 +msgid "Color balance..." +msgstr "Vyvážení barev …" + +#: sq_glwidget.cpp:2721 +msgid "Apply filter..." +msgstr "Aplikovat filtr …" + +#: sq_glwidget.cpp:2724 +msgid "Hide/show toolbar" +msgstr "Skrýt/zobrazit nástrojovou lištu" + +#: sq_glwidget.cpp:2725 +msgid "Hide/show statusbar" +msgstr "Skrýt/zobrazit stavový řádek" + +#: sq_glwidget.cpp:2728 +msgid "Reset" +msgstr "Resetovat" + +#: sq_glwidget.cpp:2731 sq_helpwidget.cpp:174 +msgid "Hotkeys" +msgstr "Klávesové zkratky" + +#: sq_glview.cpp:84 +msgid "Loading time" +msgstr "Čas načítání" + +#: sq_options.cpp:746 +msgid "The main options" +msgstr "Základní nastavení" + +#: sq_options.cpp:748 +msgid "Write configuration file to disk, when I press \"OK\"" +msgstr "Zapsat konfigurační soubor na disk po stisku \"OK\"" + +#: sq_options.cpp:749 +msgid "Minimize to tray after closing" +msgstr "Po uzavření minimalizovat do traye" + +#: sq_options.cpp:750 +msgid "Show splash screen at startup" +msgstr "Zobrazovat při startu úvodní obrazovku" + +#: sq_options.cpp:751 +msgid "Don't show animated logo in toolbar" +msgstr "Nezobrazovat v nástrojové liště animované logo" + +#: sq_options.cpp:752 +msgid "Apply codec settings to" +msgstr "Aplikovat nastavení kodeku na" + +#: sq_options.cpp:753 +msgid "Thumbnail loader" +msgstr "Načítač náhledů" + +#: sq_options.cpp:754 +msgid "Image viewer (also preview window)" +msgstr "Prohlížeč obrázků (také okno s náhledem)" + +#: sq_options.cpp:755 sq_options.cpp:773 +msgid "Both" +msgstr "Oba" + +#: sq_options.cpp:756 +msgid "RunTime" +msgstr "Čas běhu" + +#: sq_options.cpp:757 +msgid "Treat unknown mime types as unsupported" +msgstr "Považovat neznámé MIME typy za nepodporované" + +#: sq_options.cpp:758 +msgid "Load KIPI plugins on demand (for slow machines)" +msgstr "Nahrávat zásuvné moduly KIPI na vyžádání (pro pomalé počítače)" + +#: sq_options.cpp:759 +msgid "Disk navigator" +msgstr "Navigátor" + +#: sq_options.cpp:760 +msgid "On starting open..." +msgstr "Při startu otevřít..." + +#: sq_options.cpp:762 +msgid "Custom directory:" +msgstr "Uživatelský adresář:" + +#: sq_options.cpp:763 +msgid "Last visited directory" +msgstr "Poslední navštívený adresář" + +#: sq_options.cpp:764 +msgid "Current directory, where KSquirrel starts" +msgstr "Aktuální adresář, ze kterého byl KSquirrel spuštěn" + +#: sq_options.cpp:765 +msgid "Run unknown file formats separately (with default application)" +msgstr "Spouštět soubory v neznámých formátech odděleně (ve výchozí aplikaci)" + +#: sq_options.cpp:767 +msgid "Save history" +msgstr "Uložit historii" + +#: sq_options.cpp:768 +msgid "Jump into archives" +msgstr "Přejít do archivů" + +#: sq_options.cpp:769 +msgid "Jump to first image" +msgstr "Přejít na první obrázek" + +#: sq_options.cpp:770 +msgid "Don't show directories" +msgstr "Nezobrazovat adresáře" + +#: sq_options.cpp:771 +msgid "Main" +msgstr "Hlavní" + +#: sq_options.cpp:772 +msgid "Synchronization" +msgstr "Synchronisace" + +#: sq_options.cpp:774 +msgid "Tree -> Navigator" +msgstr "Strom -> Navigátor" + +#: sq_options.cpp:775 +msgid "Tree <- Navigator" +msgstr "Navigátor <- Strom" + +#: sq_options.cpp:776 +msgid "Clicking" +msgstr "Klikání" + +#: sq_options.cpp:777 +msgid "Thumbnails" +msgstr "Náhledy" + +#: sq_options.cpp:779 +msgid "Do not write thumbnails on disk" +msgstr "Nezapisovat náhledy na disk" + +#: sq_options.cpp:780 +msgid "Show tooltips with file information" +msgstr "Zobrazovat tooltipy s informacemi o souborech" + +#: sq_options.cpp:781 +msgid "Margin between thumbnails" +msgstr "Vzdálenost mezi náhledy" + +#: sq_options.cpp:782 sq_options.cpp:815 +msgid " pixels" +msgstr " pixelů" + +#: sq_options.cpp:783 +msgid "Don't show tooltips when the main window is inactive" +msgstr "Nezobrazovat tooltipy jestliže je hlavní okno neaktivní" + +#: sq_options.cpp:784 +msgid "Mark supported image formats with clock icon (slow)" +msgstr "Označit podporované formáty obrázků ikonou hodin (pomalé)" + +#: sq_options.cpp:785 +msgid "Maximum cache size (in memory)" +msgstr "Maximální velikost paměťové cache" + +#: sq_options.cpp:786 +msgid " Kb" +msgstr " KiB" + +#: sq_options.cpp:787 +msgid "No cache" +msgstr "Žádná cache" + +#: sq_options.cpp:788 +msgid "On scroll event" +msgstr "Při posunu" + +#: sq_options.cpp:789 +msgid "Zoom the scene" +msgstr "Přiblížit obraz" + +#: sq_options.cpp:790 +msgid "Load next/previous file" +msgstr "Načíst následující/předcházející soubor" + +#: sq_options.cpp:791 +msgid "Background" +msgstr "Pozadí" + +#: sq_options.cpp:792 +msgid "Custom texture" +msgstr "Uživatelská textura" + +#: sq_options.cpp:793 +msgid "Custom color" +msgstr "Uživatelská barva" + +#: sq_options.cpp:794 +msgid "System color" +msgstr "Systémová barva" + +#: sq_options.cpp:798 +msgid "Validate" +msgstr "Ověřit" + +#: sq_options.cpp:802 +msgid "Show images progressively" +msgstr "Zobrazovat obrázky progresivně" + +#: sq_options.cpp:804 +msgid "Image pages" +msgstr "Stránky obrázků" + +#: sq_options.cpp:805 +msgid "Load all pages" +msgstr "Načíst všechny stránky" + +#: sq_options.cpp:806 +msgid "Load only first page" +msgstr "Načíst jen první stránku " + +#: sq_options.cpp:807 +msgid "Load no more than" +msgstr "Nenačítat více než" + +#: sq_options.cpp:808 +msgid " pages" +msgstr " stran" + +#: sq_options.cpp:809 +msgid "Loader" +msgstr "Zavaděč" + +#: sq_options.cpp:810 +msgid "Draw tickmarks around the image" +msgstr "Kreslit značky okolo obrázku" + +#: sq_options.cpp:811 +msgid "Draw background for transparent images" +msgstr "Kreslit pozadí u průhledných obrázků" + +#: sq_options.cpp:812 +msgid "Rotating" +msgstr "Otočit o" + +#: sq_options.cpp:813 +msgid " degrees" +msgstr " stupňů" + +#: sq_options.cpp:814 sq_helpwidget.cpp:183 +msgid "Moving" +msgstr "Přesunuje se" + +#: sq_options.cpp:817 +msgid "Zoom limit" +msgstr "Omezení přiblížení" + +#: sq_options.cpp:818 +msgid "Minimum: 1%, maximum: 10,000%" +msgstr "Minimum: 1 %, maximum 10 000 %" + +#: sq_options.cpp:819 +msgid "Custom" +msgstr "Uživatelský" + +#: sq_options.cpp:821 +msgid "minimum" +msgstr "minimum" + +#: sq_options.cpp:822 sq_options.cpp:824 +msgid " %" +msgstr " %" + +#: sq_options.cpp:823 +msgid "maximum" +msgstr "maximum" + +#: sq_options.cpp:825 +msgid "No limit" +msgstr "Bez omezení" + +#: sq_options.cpp:826 +msgid "Zoom coefficient" +msgstr "Přiblížení" + +#: sq_options.cpp:827 +msgid "%" +msgstr "%" + +#: sq_options.cpp:828 +msgid "None" +msgstr "Žádný" + +#: sq_options.cpp:830 +msgid "Customize OpenGL widget" +msgstr "Přizpůsobit OpenGL widget" + +#: sq_options.cpp:831 +msgid "Recursion" +msgstr "Rekurse" + +#: sq_options.cpp:832 +msgid "No recursion" +msgstr "Bez rekurse" + +#: sq_options.cpp:833 +msgid "Show number of files" +msgstr "Zobrazit počet souborů" + +#: sq_options.cpp:834 +msgid "Show number of subfolders and files" +msgstr "Zobrazit počet podadresářů a souborů" + +#: sq_options.cpp:835 +msgid "Show number of subfolders" +msgstr "Zobrazit počet podadresářů" + +#: sq_options.cpp:836 +msgid "Treeview" +msgstr "Zobrazení stromu" + +#: sq_options.cpp:837 +msgid "Show device path" +msgstr "Zobrazit cestu k zařízení" + +#: sq_options.cpp:838 +msgid "Show mount options" +msgstr "Zobrazit možnosti připojení" + +#: sq_options.cpp:839 +msgid "Show filesystem type" +msgstr "Zobrazit typ souborového systému" + +#: sq_options.cpp:840 +msgid "Mount view" +msgstr "Zobrazení připojení" + +#: sq_options.cpp:841 +msgid "Enable preview window" +msgstr "Povolit okno s náhledem" + +#: sq_options.cpp:843 +msgid "Delay before image loading" +msgstr "Prodleva před načtením obrázku" + +#: sq_options.cpp:844 sq_slideshow.cpp:218 +msgid " ms" +msgstr " ms" + +#: sq_options.cpp:845 +msgid "Background color for preview widget:" +msgstr "Barva pozadí widgetu pro náhled:" + +#: sq_options.cpp:847 +msgid "Don't load preview image on file execution" +msgstr "Nenačítat náhled při spuštění souboru" + +#: sq_options.cpp:848 +msgid "Disables loading preview image when user launches image with mouse" +msgstr "Zakáže načtení náhledu, když uživatel otevře obrázek pomocí myši" + +#: sq_options.cpp:849 +msgid "Image preview" +msgstr "Náhled obrázku" + +#: sq_options.cpp:850 +msgid "Sidebar settings" +msgstr "Nastavení boční lišty" + +#: sq_options.cpp:851 +msgid "KIPI Configuration" +msgstr "Nastavení KIPI" + +#: sq_slideshow.cpp:205 +msgid "Slideshow options" +msgstr "Možnosti slideshow" + +#: sq_slideshow.cpp:206 +msgid "Start" +msgstr "Spustit" + +#: sq_slideshow.cpp:209 +msgid "Set directory to current" +msgstr "Nastavit adresář na aktuální" + +#: sq_slideshow.cpp:210 +msgid "Last visited directories" +msgstr "Naposledy navštívené adresáře" + +#: sq_slideshow.cpp:220 +msgid "Repeats:" +msgstr "Opakování:" + +#: sq_slideshow.cpp:221 +msgid "Background color:" +msgstr "Barva pozadí:" + +#: sq_slideshow.cpp:222 +msgid "Onscreen messages" +msgstr "Zprávy na obrazovce" + +#: sq_slideshow.cpp:223 +msgid "Show current index" +msgstr "Zobrazit aktuální index" + +#: sq_slideshow.cpp:224 +msgid "Show file name" +msgstr "Zobrazit jméno souboru" + +#: sq_slideshow.cpp:225 +msgid "Show file size" +msgstr "Zobrazit velikost souboru" + +#: sq_slideshow.cpp:226 +msgid "Recursively" +msgstr "Rekursivně" + +#: ksquirrel.cpp:288 +msgid "Clear history" +msgstr "Vyčistit historii" + +#: ksquirrel.cpp:289 +msgid "Clear address" +msgstr "Vyčistit adresu" + +#: ksquirrel.cpp:294 +msgid "Go!" +msgstr "Start!" + +#: ksquirrel.cpp:341 +msgid "Libraries' filters" +msgstr "Filtry knihoven" + +#: ksquirrel.cpp:364 +msgid "All supported formats" +msgstr "Všechny podporované formáty" + +#: ksquirrel.cpp:374 +msgid "User's filters" +msgstr "Uživatelské filtry" + +#: ksquirrel.cpp:510 +msgid "Folder tree" +msgstr "Strom adresářů" + +#: ksquirrel.cpp:511 +msgid "Mount points" +msgstr "Přípojné body" + +#: ksquirrel.cpp:628 +msgid "&Navigator" +msgstr "&Navigátor" + +#: ksquirrel.cpp:630 +msgid "&Action" +msgstr "&Akce" + +#: ksquirrel.cpp:633 +msgid "&KIPI Plugins" +msgstr "Zásuvné moduly &KIPI" + +#: ksquirrel.cpp:661 +msgid "Fi<er" +msgstr "&Filtr" + +#: ksquirrel.cpp:720 +msgid "Thumbnail size" +msgstr "Velikost náhledu" + +#: ksquirrel.cpp:723 sq_options.ui.h:137 +msgid "Image window" +msgstr "Okno obrázku" + +#: ksquirrel.cpp:725 +msgid "Reload codecs from disk" +msgstr "Znovu načíst kodeky z disku" + +#: ksquirrel.cpp:726 +msgid "Configure external tools..." +msgstr "Nastavit externí nástroje..." + +#: ksquirrel.cpp:727 +msgid "Configure filters..." +msgstr "Nastavit filtry..." + +#: ksquirrel.cpp:728 +msgid "Go to tray" +msgstr "Do traye" + +#: ksquirrel.cpp:729 +msgid "Open file and change directory" +msgstr "Otevřít soubor a změnit adresář" + +#: ksquirrel.cpp:730 +msgid "Open file" +msgstr "Otevřít soubor" + +#: ksquirrel.cpp:731 +msgid "Thumbnail cache manager..." +msgstr "Manažer keše náhledů..." + +#: ksquirrel.cpp:735 +msgid "List" +msgstr "Seznam" + +#: ksquirrel.cpp:736 +msgid "Icons" +msgstr "Ikony" + +#: ksquirrel.cpp:737 +msgid "Details" +msgstr "Podrobnosti" + +#: ksquirrel.cpp:738 sq_options.ui.h:136 +msgid "Thumbnails" +msgstr "Náhledy" + +#: ksquirrel.cpp:740 +msgid "Show URL box" +msgstr "Zobrazit pole s URL" + +#: ksquirrel.cpp:742 +msgid "Built-in image window" +msgstr "Vestavěné okno obrázku" + +#: ksquirrel.cpp:745 +msgid "Slideshow" +msgstr "Slideshow" + +#: ksquirrel.cpp:746 +msgid "Slideshow advanced" +msgstr "Slideshow – pokročilé" + +#: ksquirrel.cpp:748 +msgid "Codec information..." +msgstr "Informace o kodecích..." + +#: ksquirrel.cpp:749 +msgid "OpenGL information..." +msgstr "Informace o OpenGL..." + +#: ksquirrel.cpp:751 +msgid "Medium thumbnails" +msgstr "Střední náhledy" + +#: ksquirrel.cpp:752 +msgid "Large thumbnails" +msgstr "Velké náhledy" + +#: ksquirrel.cpp:753 +msgid "Huge thumbnails" +msgstr "Obrovské náhledy" + +#: ksquirrel.cpp:755 +msgid "Select group" +msgstr "Vybrat skupinu" + +#: ksquirrel.cpp:756 +msgid "Deselect group" +msgstr "Zrušit výběr skupiny" + +#: ksquirrel.cpp:776 +msgid "Extended thumbnails" +msgstr "Rozšířené náhledy" + +#: ksquirrel.cpp:1085 +msgid " writing settings and thumbnails... " +msgstr " zapisuje se nastavení a náhledy... " + +#: sq_filters.cpp:124 sq_filters.cpp:197 +msgid "Extensions" +msgstr "Rozšíření" + +#: sq_filters.cpp:181 +msgid "Adjust filters" +msgstr "Upravit filtry" + +#: sq_filters.cpp:186 +msgid "New filter" +msgstr "Nový filtr" + +#: sq_filters.cpp:193 +msgid "Move filter up" +msgstr "Posunout filtr nahoru" + +#: sq_filters.cpp:195 +msgid "Move filter down" +msgstr "Posunou filtr dolů" + +#: sq_filters.cpp:198 +msgid "Menu item contains both name and extension" +msgstr "Položka menu obsahuje zároveň jméno i příponu" + +#: sq_helpwidget.cpp:175 +msgid "" +"

Soubor:%1
Velikost:%2
Link destination:%1
Cíl odkazu:%1
" +"" +"" +"" +"" +"" +"

Esc,X,Return

close

Middle click, F

fullscreen

Z

show 'Zoom' menu

/

show this help

Right click, M, " +"ContextMenu

show context menu

N

toggle filter

Shift + Left button

select a region

Shift + Left

previous tab

Shift + Right

next tab

W

close tab

" +msgstr "" +"

" +"" +"" +"" +"" +"" +"

Esc, X, Enter

zavřít

střední tlačítko myši, F

na celou obrazovku

Z

zobrazit nabídku přiblížení

/

zobrazit tuto nápovědu

pravé tlačítko myši, M, " +"Kontextová nabídka

zobrazit kontextovou nabídku

N

přepnout filtr

Shift + levé tlačítko myši

vybrat oblast

Shift + šipka vlevo

předchozí karta

Shift + šipka vpravo

následující karta

W

zavřít kartu

" + +#: sq_helpwidget.cpp:176 +msgid "" +"

Space, Page Down

next image

Backspace, Page Up

previous image

Home

first image

End

last image

" +msgstr "" +"

Mezerník, PageDown

následující obrázek

Backspace, PageUp

předcházející obrázek

Home

první obrázek

End

poslední obrázek

" + +#: sq_helpwidget.cpp:177 +msgid "" +"

" +msgstr "" +"

Left, Right," +" Up, Down

move the image

Ctrl + Left

rotate left

Ctrl + Right

rotate " +"right

Ctrl + Up/Down

rotate for 180 degrees up/down

Alt + Left/Right

rotate for 1 degree " +"left/right

Vlevo, Vpravo," +" Nahoru, Dolů

posunout obrázek

Ctrl + Vlevo

otočit doleva

Ctrl + Vpravo

otočit doprava

Ctrl + Nahoru/Dolů

otočit o 180 stupňů

Alt + Vlevo/Vpravo

otočit o jeden stupeň doleva/doprava

" + +#: sq_helpwidget.cpp:178 +msgid "" +"

" +msgstr "" +"

+/-

zoom " +"Nx

Ctrl + +/-

zoom " +"2x/0.5x

Scroll

load next/" +"prev file OR zoom+/zoom-

Shift + Scroll

zoom+/zoom-

Ctrl + Scroll

zoom+ 2x/zoom- 2x

1..9

zoom 1..9x

0

zoom 10x

comma

fit " +"width

period

fit height

*

fit image

" + +#: sq_helpwidget.cpp:179 +msgid "" +"

+/-

přiblížení N×

Ctrl + +/-

přiblížení" +"2×/0,5×

kolečko

nahrát následující/předcházející soubor nebo přiblížit/oddálit

Shift + kolečko

přiblížit/oddálit

Ctrl + kolečko

přiblížit 2×/oddálit 2×

1 až 9

přiblížení 1× až 9×

0

přiblížení 10×

čárka

přizpůsobit šířku

tečka

přizpůsobit výšku

*

přizpůsobit obrázek
" +"

S

save as

V

flip vertically

H

flip horizontally

R

reset

P

image properties

C

codec settings

L

ignore zoom if image is smaller than " +"window

I

menu with " +"images

A

stop/start " +"animation

B

toggle " +"drawing background for transparent images

K

toggle drawing tickmarks

E

show menu with external " +"tools

Y

crop

F1

first image in " +"multi-paged image

F2

previous

F3

next

F4

last
" +msgstr "" +"

S

uložit jako

V

překlopit svisle

H

překlopit vodorovně

R

obnovit

P

vlastnosti obrázku

C

nastavení kodeku

L

ignorovat přiblížení, jestliže obrázek je menší než okno

I

nabídka s obrázky

A

zastavit/spustit " +"animaci

B

přepnout pozadí pro průhledné obrázky

K

přepnout kreslicí značky

E

zobrazit nabídku s externími nástroji

Y

crop

F1

první obrázek vícestránkového obrázku

F2

předcházející

F3

následující

F4

poslední
" + +#: sq_helpwidget.cpp:182 sq_options.ui.h:135 +msgid "Filing" +msgstr "Výplň" + +#: sq_helpwidget.cpp:184 +msgid "Current image" +msgstr "Aktuální obrázek" + +#: sq_options.ui.h:138 +msgid "Sidebar" +msgstr "Boční lišta" + +#: sq_options.ui.h:141 +msgid "KIPI" +msgstr "KIPI" + +#: sq_options.ui.h:260 +msgid "Wrong dimensions: %1x%2." +msgstr "Špatné rozměry: %1×%2." + +#: sq_slideshowlisting.cpp:87 +msgid "Listing" +msgstr "Výpis" + +#: ksquirrel.cpp:751 +msgid "Rename" +msgstr "Přejmenovat" + +#: ksquirrel.cpp:1951 +msgid "Renaming File" +msgstr "Přejmenování souboru" + +#: ksquirrel.cpp:1952 +msgid "

Rename file %1 to:

" +msgstr "

Přejmenovat soubor %1 na:

" + +msgid "Calculate directory size" +msgstr "Spočítat velikost adresáře" + +msgid "New folder..." +msgstr "Nový adresář..." + +msgid "Create Subfolder" +msgstr "Vytvořit podadresář" + +msgid "

Create new folder in %1:

" +msgstr "

Vytvořit nový adresář v %1:

" + +msgid "Rename Folder" +msgstr "Přejmenovat adresář" + +msgid "

Rename folder %1 to:

" +msgstr "

Přejmenovat adresář %1 na:

" + +msgid "Are you sure you want to delete %1?" +msgstr "Jste si jisti, že chcete smazat %1?" + +msgid "Copy to last folder" +msgstr "Zkopírovat do posledního adresáře" + +msgid "Move to last folder" +msgstr "Přesunou do posledního adresáře" + +msgid "Message text color:" +msgstr "Barva textu zprávy:" + +msgid "Total" +msgstr "Celkem" + +msgid "Visualize drag operation" +msgstr "Znázornit operaci tažení" + +msgid "Testing" +msgstr "Testuje se" + +msgid "Lazy thumbnail generation" +msgstr "Pomalé vytváření náhledů" + +msgid "Delay" +msgstr "Prodleva" + +msgid "Interface" +msgstr "Rozhraní" + +msgid "Number of text lines" +msgstr "Počet řádků textu" + +msgid "Show file preview" +msgstr "Zobrazit náhled souboru" + +msgid "Number of additionally generated rows" +msgstr "Počet dodatečně vygenerovaných řádků" + +msgid "Repeat (copy to %1)" +msgstr "Opakovat (kopírovat do %1)" + +msgid "Repeat (move to %1)" +msgstr "Opakovat (přesunout do %1)" + +msgid "Repeat (link to %1)" +msgstr "Opakovat (vytvořit odkaz v %1)" + +msgid "Repeat (nothing to repeat)" +msgstr "Opakovat (není co opakovat)" + +msgid "Clear contents" +msgstr "Vymazat obsah" + +msgid "Are you sure you want to delete contents of %1?" +msgstr "Jste si jisti, že chcete vymazat obsah %1?" + +msgid "Add to Folder Basket" +msgstr "Přidat do Košíku na adresáře" + +msgid "Folder basket" +msgstr "Košík na adresáře" + +msgid "Change icon" +msgstr "Změnit ikonu" + +msgid "

Rename item %1 to:

" +msgstr "

Přejmenovat položku %1 na:

" + +msgid "Copy file path" +msgstr "Zkopírovat cestu k souboru" + +msgid "Copy file url" +msgstr "Zkopírovat URL souboru" + +msgid "Text color:" +msgstr "Barva textu:" + +msgid "Show image dimensions" +msgstr "Zobrazit rozměry obrázku" + +msgid "Text color..." +msgstr "Barva textu..." + +msgid "Double click" +msgstr "Dvojité kliknutí" + +msgid "Close window" +msgstr "Zavřít okno" + +msgid "Crop" +msgstr "Oříznout" + +msgid "Tabs" +msgstr "Karty" + +msgid "Enable tabs" +msgstr "Povolit karty" + +msgid "Ask what to do when opening new image" +msgstr "Zeptat se co dělat při otvírání nového obrázku" + +msgid "Show close buttons" +msgstr "Zobrazit tlačítka pro zavření" + +msgid "Open in a new tab" +msgstr "Otevřít v nové kartě" + +msgid "Replace current tab" +msgstr "Nahradit aktuální kartu" + +msgid "Close all and open in a new tab" +msgstr "Zvřít vše a otevřít v nové kartě" + +msgid "Opening..." +msgstr "Otevírá se..." + +msgid "Previous tab" +msgstr "Předcházející karta" + +msgid "Next tab" +msgstr "Následující karta" + +msgid "Close tab" +msgstr "Zavřít kartu" + +msgid "Do nothing" +msgstr "Nedělat nic" + +msgid "Close all opened images when closing window" +msgstr "" + +msgid "Codec manager..." +msgstr "" + +msgid "Select codecs to disable:" +msgstr "" + +msgid "Select codecs to enable:" +msgstr "" diff --git a/po/de.po b/po/de.po new file mode 100644 index 0000000..878493d --- /dev/null +++ b/po/de.po @@ -0,0 +1,2147 @@ +# translation of de2.po to german +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# +# Oliver Dörr , 2007. +# Frederik Schwarzer , 2007. +msgid "" +msgstr "" +"Project-Id-Version: de2\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2007-08-07 09:34+0300\n" +"PO-Revision-Date: 2007-11-03 20:25+0100\n" +"Last-Translator: Oliver Dörr \n" +"Language-Team: german \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: KBabel 1.11.4\n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" + +#: sq_filters.ui.h:56 sq_filters.ui.h:58 sq_externaltools.cpp:67 +#: sq_externaltools.cpp:194 sidebar/sq_mountview.cpp:64 sq_viewcache.cpp:47 +#: sq_viewcache.cpp:105 sq_filters.cpp:123 sq_filters.cpp:196 +msgid "Name" +msgstr "Name" + +#: sq_externaltool.cpp:102 sq_externaltool.cpp:162 sq_externaltool.cpp:170 +msgid "No file selected" +msgstr "Keine Datei ausgewählt" + +#: sq_kipimanager.cpp:68 +msgid "No Plugins" +msgstr "Keine Module" + +#: sq_kipimanager.cpp:125 +msgid "Image actions" +msgstr "Bildaktionen" + +#: sq_kipimanager.cpp:126 +msgid "Effects" +msgstr "Effekte" + +#: sq_kipimanager.cpp:127 +msgid "Tools" +msgstr "Extras" + +#: sq_kipimanager.cpp:130 +msgid "Batch processing" +msgstr "Stapelverarbeitung" + +#: sq_kipimanager.cpp:131 +msgid "Collections" +msgstr "Sammlungen" + +#: sq_libraryhandler.cpp:148 +msgid "All files" +msgstr "Alle Dateien" + +#: sq_navigatordropmenu.cpp:40 +msgid "Copy here" +msgstr "Hierher kopieren" + +#: sq_navigatordropmenu.cpp:43 +msgid "Move here" +msgstr "Hierher verschieben" + +#: sq_navigatordropmenu.cpp:46 +msgid "Link here" +msgstr "Hierher verknüpfen" + +#: sq_glinfo.cpp:45 sq_glinfo.cpp:92 +msgid "Parameter" +msgstr "Parameter" + +#: sq_glinfo.cpp:46 sq_glinfo.cpp:93 sq_imageproperties.cpp:321 +#: sq_imageproperties.cpp:408 imageedit/sq_imagefilter.cpp:487 +msgid "Value" +msgstr "Wert" + +#: sq_glinfo.cpp:91 +msgid "OpenGL information" +msgstr "Informationen zu OpenGL" + +#: sq_externaltools.cpp:66 sq_externaltools.cpp:193 +msgid "Pixmap" +msgstr "Pixmap" + +#: sq_externaltools.cpp:68 sq_externaltools.cpp:195 +msgid "Command" +msgstr "Befehl" + +#: sq_externaltools.cpp:190 +msgid "Adjust external tools" +msgstr "Externe Werkzeuge justieren" + +#: sq_externaltools.cpp:192 sq_filters.cpp:182 +msgid "OK" +msgstr "OK" + +#: sq_externaltools.cpp:196 sq_externaltools.ui.h:146 +#, c-format +msgid "Command can contain
  • %f: one file
  • %F: multiple files
" +msgstr "" +"Befehl kann enthalten:
  • %f: eine Datei
  • %F: mehrere Dateien" + +#: sq_externaltools.cpp:199 +msgid "New tool" +msgstr "Neues Werkzeug" + +#: sq_externaltools.cpp:206 +msgid "Move tool up" +msgstr "Werkzeug nach oben verschieben" + +#: sq_externaltools.cpp:208 +msgid "Move tool down" +msgstr "Werkzeug nach unten verschieben" + +#: sq_kipiinterface.cpp:72 +msgid "Root directory" +msgstr "Basisordner" + +#: sq_kipiinterface.cpp:144 +msgid "Folder content" +msgstr "Ordnerinhalt" + +#: sq_kipiinterface.cpp:161 +msgid "Selected images" +msgstr "Ausgewählte Bilder" + +#: sq_kipiinterface.cpp:175 ksquirrel.cpp:513 +msgid "Image basket" +msgstr "Bildkorb" + +#: main.cpp:40 +msgid "File to be opened at startup." +msgstr "Datei die während des Starts geöffnet werden soll." + +#: main.cpp:41 +msgid "Print found libraries and exit." +msgstr "Gefunden Bibliotheken anzeigen und beenden." + +#: main.cpp:57 +msgid "KSquirrel - image viewer for KDE" +msgstr "KSquirrel - Bildbetrachter für KDE" + +#: main.cpp:66 +msgid "Bug reports, patches" +msgstr "Fehlerberichte, -bereinigungen" + +#: main.cpp:67 +msgid "Bug reports" +msgstr "Fehlerberichte" + +#: main.cpp:68 +msgid "Translation help" +msgstr "Übersetzungshilfe" + +#: main.cpp:69 +msgid "TiamaT" +msgstr "TiamaT" + +#: main.cpp:69 +msgid "Initial artwork for edit tools" +msgstr "Erste Grafiken für die Bearbeitungswerkzeuge" + +#: main.cpp:70 +msgid "Fera" +msgstr "Fera" + +#: main.cpp:70 +msgid "Great artwork for edit tools" +msgstr "Großartige Grafiken für die Bearbeitungswerkzeuge" + +#: main.cpp:71 +msgid "OpenGL forum at" +msgstr "OpenGL-Forum unter" + +#: main.cpp:72 +msgid "GameDev forum at" +msgstr "GameDev-Forum unter" + +#: sq_imageproperties.cpp:320 sq_imageproperties.cpp:407 +msgid "Group" +msgstr "Gruppe" + +#: sq_imageproperties.cpp:359 sq_glwidget.cpp:350 +msgid "Image properties" +msgstr "Bildeigenschaften" + +#: sq_imageproperties.cpp:361 +msgid "Attributes" +msgstr "Attribute" + +#: sq_imageproperties.cpp:362 +msgid "Owner:" +msgstr "Eigentümer:" + +#: sq_imageproperties.cpp:363 +msgid "Group:" +msgstr "Gruppe:" + +#: sq_imageproperties.cpp:365 +msgid "Permissions:" +msgstr "Berechtigungen:" + +#: sq_imageproperties.cpp:368 +msgid "Time" +msgstr "Zeit" + +#: sq_imageproperties.cpp:369 +msgid "Created:" +msgstr "Erstellt:" + +#: sq_imageproperties.cpp:370 +msgid "Last read:" +msgstr "Zuletzt gelesen:" + +#: sq_imageproperties.cpp:371 +msgid "Last modified:" +msgstr "Zuletzt geändert:" + +#: sq_imageproperties.cpp:375 sq_helpwidget.cpp:181 sq_options.ui.h:134 +msgid "General" +msgstr "Allgemein" + +#: sq_imageproperties.cpp:376 +msgid "File:" +msgstr "Datei:" + +#: sq_imageproperties.cpp:378 sq_pluginsinfo.cpp:137 sq_slideshow.cpp:211 +msgid "Directory:" +msgstr "Ordner:" + +#: sq_imageproperties.cpp:379 +msgid "Size:" +msgstr "Größe:" + +#: sq_imageproperties.cpp:381 +msgid "Type:" +msgstr "Typ:" + +#: sq_imageproperties.cpp:382 +msgid "Number of frames:" +msgstr "Anzahl der Einzelbilder:" + +#: sq_imageproperties.cpp:383 +msgid "Current frame" +msgstr "Aktuelles Einzelbild" + +#: sq_imageproperties.cpp:384 sq_slideshow.cpp:219 +msgid "Delay:" +msgstr "Verzögerung:" + +#: sq_imageproperties.cpp:385 +msgid "Dimensions:" +msgstr "Größe:" + +#: sq_imageproperties.cpp:386 +msgid "Bits per pixel:" +msgstr "Bits pro Pixel:" + +#: sq_imageproperties.cpp:387 +msgid "Color space:" +msgstr "Farbraum:" + +#: sq_imageproperties.cpp:388 +msgid "Compression:" +msgstr "Kompression:" + +#: sq_imageproperties.cpp:389 +msgid "Uncompressed size:" +msgstr "Unkomprimierte Größe:" + +#: sq_imageproperties.cpp:390 +msgid "Compression ratio:" +msgstr "Kompressionsrate:" + +#: sq_imageproperties.cpp:391 +msgid "Interlaced:" +msgstr "Interlaced:" + +#: sq_imageproperties.cpp:392 +msgid "Status:" +msgstr "Status:" + +#: sq_imageproperties.cpp:406 sq_glwidget.cpp:2662 sq_options.cpp:816 +msgid "Image" +msgstr "Bild" + +#: sq_imageproperties.cpp:409 +msgid "Metadata" +msgstr "Metadaten" + +#: sq_pluginsinfo.cpp:55 sq_pluginsinfo.cpp:129 +msgid "..." +msgstr "..." + +#: sq_pluginsinfo.cpp:56 sq_pluginsinfo.cpp:130 +msgid "Icon" +msgstr "Symbol" + +#: sq_pluginsinfo.cpp:57 sq_pluginsinfo.cpp:131 +msgid "Library" +msgstr "Bibliothek" + +#: sq_pluginsinfo.cpp:58 sq_pluginsinfo.cpp:132 +msgid "Version" +msgstr "Version" + +#: sq_pluginsinfo.cpp:59 sq_pluginsinfo.cpp:133 sq_viewcache.cpp:48 +#: sq_viewcache.cpp:106 +msgid "MIME" +msgstr "Dateizuordnungen" + +#: sq_pluginsinfo.cpp:128 +msgid "Codec information and settings" +msgstr "Codecs-Information und Einstellungen" + +#: sq_pluginsinfo.cpp:138 +msgid "Total found:" +msgstr "Insgesamt gefunden:" + +#: sq_errorstring.cpp:34 +msgid "cannot open file for reading" +msgstr "Die Datei kann nicht zum Lesen geöffnet werden" + +#: sq_errorstring.cpp:35 +msgid "file corrupted" +msgstr "Die Datei ist defekt" + +#: sq_errorstring.cpp:36 +msgid "no memory" +msgstr "Kein Speicher" + +#: sq_errorstring.cpp:37 +msgid "file type not supported" +msgstr "Die Dateizuordnung wird nicht unterstützt" + +#: sq_errorstring.cpp:38 +msgid "wrong image dimensions" +msgstr "Falsche Bildgröße" + +#: sq_errorstring.cpp:39 +msgid "cannot open file for writing" +msgstr "Die Datei kann nicht zum Schreiben geöffnet werden" + +#: sq_errorstring.cpp:40 +msgid "write feature is not supported" +msgstr "Schreiben ist nicht unterstützt" + +#: sq_errorstring.cpp:41 +msgid "write error (check free space)" +msgstr "Schreibfehler, bitte überprüfen Sie den freien Platz" + +#: sq_errorstring.cpp:42 +msgid "wrong parameters" +msgstr "Falsche Parameter" + +#: sq_errorstring.cpp:43 +msgid "Editing process is not finished yet" +msgstr "Der Bearbeitungsprozess ist noch nicht beendet" + +#: sq_selectdeselectgroup.cpp:83 +msgid "Filename or mask:" +msgstr "Dateiname oder -maske:" + +#: sidebar/sq_treeview.cpp:89 +msgid "root" +msgstr "Basisordner" + +#: sidebar/sq_categoriesview.cpp:95 ksquirrel.cpp:512 +msgid "Categories" +msgstr "Kategorien" + +#: sidebar/sq_categoriesview.cpp:115 sidebar/sq_categoriesview.cpp:166 +msgid "New category" +msgstr "Neue Kategorie" + +#: sidebar/sq_categoriesview.cpp:153 sidebar/sq_categoriesview.cpp:218 +msgid "New Category" +msgstr "Neue Kategorie" + +#: sidebar/sq_categoriesview.cpp:169 sidebar/sq_categoriesview.cpp:198 +msgid "Create default categories" +msgstr "Standardkategorien erstellen" + +#: sidebar/sq_categoriesview.cpp:197 +msgid "" +"This will create default categories: Concerts, Pets, Home, Friends, Free time, " +"Travelling and Nature. Continue?" +msgstr "" +"Dies wird die Standardkategorien erstellen: Konzerte, Haustiere, Zuhause, " +"Freunde, Freizeit, Reisen, Natur. Fortfahren?" + +#: sidebar/sq_categoriesview.cpp:218 +msgid "Create new category:" +msgstr "Neue Kategorie erstellen:" + +#: sidebar/sq_mountview.cpp:43 +msgid "Mount" +msgstr "Laufwerk einbinden" + +#: sidebar/sq_mountview.cpp:45 +msgid "Unmount" +msgstr "Laufwerkeinbindung lösen" + +#: sidebar/sq_mountview.cpp:47 +msgid "Refresh" +msgstr "Aktualisieren" + +#: sidebar/sq_mountview.cpp:170 +msgid "Device" +msgstr "Gerät" + +#: sidebar/sq_mountview.cpp:173 +msgid "FS Type" +msgstr "Dateisystemtyp" + +#: sidebar/sq_imagebasket.cpp:244 +msgid "Synchronize" +msgstr "Synchronisieren" + +#: sidebar/sq_previewwidget.cpp:60 +msgid "Background color..." +msgstr "Hintergrundfarbe ..." + +#: sidebar/sq_categorybrowsermenu.cpp:137 +#: sidebar/sq_categorybrowsermenu.cpp:146 +msgid "Failed to Read Folder" +msgstr "Lesen des Ordners nicht möglich" + +#: sidebar/sq_categorybrowsermenu.cpp:154 +msgid "Not Authorized to Read Folder" +msgstr "Unzureichende Zugriffsrechte zum Öffnen des Ordners" + +#: sidebar/sq_categorybrowsermenu.cpp:167 +msgid "Add here" +msgstr "Hier hinzufügen" + +#: sidebar/sq_categorybrowsermenu.cpp:310 +msgid "More..." +msgstr "Mehr ..." + +#: sq_thumbnailcachemaster.cpp:143 +msgid "Thumbnail cache" +msgstr "Bildvorschauzwischenspeicher" + +#: sq_thumbnailcachemaster.cpp:144 +msgid "Calculate cache size on disk" +msgstr "Zwischenspeichergröße auf der Platte berechnen" + +#: sq_thumbnailcachemaster.cpp:146 +msgid "Clear cache on disk" +msgstr "Zwischenspeicher auf der Platte säubern" + +#: sq_thumbnailcachemaster.cpp:147 +msgid "View memory cache" +msgstr "Zwischenspeicher im Hauptspeicher ansehen" + +#: sq_thumbnailcachemaster.cpp:148 +msgid "Clear cache in memory" +msgstr "Zwischenspeicher im Hauptspeicher säubern" + +#: sq_thumbnailcachemaster.cpp:150 +msgid "Sync cache to disk" +msgstr "Zwischenspeicher auf Platte synchronisieren" + +#: sq_thumbnailcachemaster.cpp:151 +msgid "Calculate cache size in memory" +msgstr "Zwischenspeichergröße im Hauptspeicher berechnen" + +#: sq_diroperator.cpp:138 +msgid "remote filesystem" +msgstr "Nicht lokales Dateisystem" + +#: sq_diroperator.cpp:158 +msgid "" +"
    Mount point:%1
    Total size:%" +"2
    Used:%3
    Available:%4
    " +msgstr "" +"
    Einhängepunkt:%1
    Gesamtgröße:%2
    Benutzt:%3
    Verfügbar:%4
    " + +#: sq_diroperator.cpp:245 +msgid "no files selected" +msgstr "Keine Dateien ausgewählt" + +#: sq_diroperator.cpp:306 +msgid "Edit file type" +msgstr "Dateityp bearbeiten" + +#: sq_diroperator.cpp:307 +msgid "Add to Basket" +msgstr "Zum Korb hinzufügen" + +#: sq_diroperator.cpp:309 sq_diroperator.cpp:889 +msgid "File actions" +msgstr "Dateiaktionen" + +#: sq_diroperator.cpp:327 +msgid "Copy to..." +msgstr "Kopieren nach ..." + +#: sq_diroperator.cpp:328 +msgid "Move to..." +msgstr "Verschieben nach ..." + +#: sq_diroperator.cpp:329 +msgid "Link to..." +msgstr "Verknüpfen mit ..." + +#: sq_diroperator.cpp:331 +msgid "Run" +msgstr "Ausführen" + +#: sq_diroperator.cpp:333 +msgid "Recreate selected thumbnails" +msgstr "Die ausgewählten Vorschaubilder werden neu erstellt" + +#: sq_diroperator.cpp:336 +msgid "Convert..." +msgstr "Konvertieren ..." + +#: sq_diroperator.cpp:439 +msgid "Total %1 in %2 (%3, %4)" +msgstr "Total %1 in %2 (%3, %4)" + +#: sq_diroperator.cpp:441 +msgid "1 item" +msgstr "1 Eintrag" + +#: sq_diroperator.cpp:442 +msgid "1 folder" +msgstr "1 Ordner" + +#: sq_diroperator.cpp:443 +msgid "1 file" +msgstr "1 Datei" + +#: sq_diroperator.cpp:627 +#, c-format +msgid "Command cannot contain both \"%f\" and \"%F\"" +msgstr "Der Befehl kann nicht zugleich \"%f\" und \"%F\" enthalten" + +#: sq_diroperator.cpp:627 sq_diroperator.cpp:632 +msgid "Error processing command" +msgstr "Fehler bei der Verarbeitung des Befehls" + +#: sq_diroperator.cpp:632 +#, c-format +msgid "Command should contain \"%f\" or \"%F\"" +msgstr "Der Befehl sollte \"%f\" oder \"%F\" enthalten" + +#: sq_diroperator.cpp:741 +msgid "Unsupported format \"%1\"" +msgstr "Nicht unterstütztes Format \"%1\"" + +#: sq_diroperator.cpp:886 +msgid "Add to &Category" +msgstr "Zur &Kategorie hinzufügen" + +#: sq_diroperator.cpp:890 +msgid "&External tools" +msgstr "&Externe Werkzeuge" + +#: sq_slideshowwidget.cpp:345 +msgid "" +"
    Enter, Escape, Returnstop " +"slideshow
    Pause, Spacepause/unpause " +"slideshow
    Page Upprevious image
    Page Downnext image
    Mshow/hide onscreen messages
    " +msgstr "" +"
    Eingabe, Escapebeendet die " +"Diaschau
    Pause, Leertastepausiert oder " +"beendet die Pause der Diaschau
    Bild aufvorheriges Bild
    Bild abnächstes " +"Bild
    MBildschirmmeldungen anzeigen/" +"ausblenden
    " + +#: sq_codecsettingsskeleton.ui.h:28 +msgid "" +"Error loading widget from %1. Please check your installation or " +"contact ksquirrel.iv@gmail.com" +msgstr "" +"Fehler beim Laden des Bildschirmelementes von %1. Bitte überprüfen " +"Sie Ihre Installaton oder kontaktieren Sie ksquirrel.iv@gmail.com." + +#: sq_widgetstack.cpp:473 sq_widgetstack.cpp:507 +msgid "No files to copy or move" +msgstr "Keine Dateien zum Kopieren oder Verschieben" + +#: sq_widgetstack.cpp:607 +msgid "Select a group of files" +msgstr "Gruppe von Dateien auswählen" + +#: sq_widgetstack.cpp:607 +msgid "Deselect a group of files" +msgstr "Auswahl einer Gruppe von Dateien aufheben" + +#: sq_widgetstack.cpp:608 +msgid "Select!" +msgstr "Auswählen" + +#: sq_widgetstack.cpp:608 +msgid "Deselect!" +msgstr "Auswahl aufheben" + +#: sq_filethumbview.cpp:370 +msgid "" +"%3%4" +msgstr "" +"
    File:%1
    Size:%2
    %3%" +"4
    Datei:%1
    Größe:%2
    " + +#: sq_filethumbview.cpp:373 +msgid "Link destination:%1" +msgstr "Ziel der Verknüpfung:%1" + +#: imageedit/sq_writeoption.cpp:108 +msgid "RLE compression" +msgstr "RLE-Kompression" + +#: imageedit/sq_writeoption.cpp:109 +msgid "Compression level" +msgstr "Kompressionsstärke:" + +#: imageedit/sq_writeoption.cpp:110 +msgid "Interlaced" +msgstr "Interlaced" + +#: imageedit/sq_writeoption.cpp:112 +msgid "No special options available for this format" +msgstr "Für dieses Format sind keine speziellen Optionen verfügbar" + +#: imageedit/sq_converter.cpp:47 +msgid "internal error" +msgstr "Interner Fehler" + +#: imageedit/sq_converter.cpp:48 +msgid "failed" +msgstr "Fehlgeschlagen" + +#: imageedit/sq_converter.cpp:50 +msgid "Converting" +msgstr "Konvertiere" + +#: imageedit/sq_converter.cpp:68 +msgid "Select files to edit" +msgstr "Wählen Sie die Dateien zur Bearbeitung aus" + +#: imageedit/sq_converter.cpp:73 +msgid "" +"Converter cannot work with remote files.\n" +"Sorry" +msgstr "" +"Der Konverter kann nicht mit entfernten Dateien arbeiten.\n" +"Entschuldigen Sie dies bitte." + +#: imageedit/sq_converter.cpp:160 +msgid "Temporary file creation failed" +msgstr "Die Erstellung einer temporären Datei ist fehlgeschlagen" + +#: imageedit/sq_converter.cpp:243 sq_imageproperties.ui.h:72 +msgid "1 error" +msgstr "1 Fehler" + +#: imageedit/sq_converter.cpp:250 +msgid "Removing" +msgstr "Entferne" + +#: imageedit/sq_converter.cpp:436 +msgid "Convert 1 file" +msgstr "1 Datei konvertieren" + +#: imageedit/sq_imageeditoptions.cpp:134 +msgid "Edit options" +msgstr "Bearbeitungsoptionen" + +#: imageedit/sq_imageeditoptions.cpp:135 +msgid "New files" +msgstr "Neue Dateien" + +#: imageedit/sq_imageeditoptions.cpp:136 +msgid "Place here" +msgstr "Hier abspeichern" + +#: imageedit/sq_imageeditoptions.cpp:137 +msgid "Replace original files" +msgstr "Originaldateien ersetzen" + +#: imageedit/sq_imageeditoptions.cpp:138 +msgid "Place files in current directory, renaming them if necessary" +msgstr "Im aktuellen Ordner abspeichern; umbenennen falls nötig." + +#: imageedit/sq_imageeditoptions.cpp:139 +msgid "Place files in current directory, replacing existing files" +msgstr "Im aktuellen Ordner abspeichern; existierende Dateien ersetzen." + +#: imageedit/sq_imageeditoptions.cpp:140 +msgid "Close, when all operations succeeded" +msgstr "Schließen, wenn alle Operationen erfolgreich durchgeführt wurden." + +#: imageedit/sq_imagebcg.ui.h:17 imageedit/sq_imagebcg.ui.h:31 +#: imageedit/sq_imagebcg.cpp:382 +msgid "Brightness" +msgstr "Helligkeit" + +#: imageedit/sq_imagebcg.ui.h:18 imageedit/sq_imagebcg.ui.h:31 +#: imageedit/sq_imagebcg.cpp:383 +msgid "Contrast" +msgstr "Kontrast" + +#: imageedit/sq_imagebcg.ui.h:19 imageedit/sq_imagebcg.ui.h:31 +#: imageedit/sq_imagebcg.cpp:384 +msgid "Gamma" +msgstr "Gamma" + +#: imageedit/sq_imagebcg.ui.h:20 imageedit/sq_imagebcg.ui.h:32 +#: imageedit/sq_imagebcg.cpp:390 +msgid "Red" +msgstr "Rot" + +#: imageedit/sq_imagebcg.ui.h:20 +msgid "Cyan" +msgstr "Cyan" + +#: imageedit/sq_imagebcg.ui.h:21 imageedit/sq_imagebcg.ui.h:32 +#: imageedit/sq_imagebcg.cpp:389 +msgid "Green" +msgstr "Grün" + +#: imageedit/sq_imagebcg.ui.h:21 +msgid "Magenta" +msgstr "Magenta" + +#: imageedit/sq_imagebcg.ui.h:22 imageedit/sq_imagebcg.ui.h:32 +#: imageedit/sq_imagebcg.cpp:388 +msgid "Blue" +msgstr "Blau" + +#: imageedit/sq_imagebcg.ui.h:22 +msgid "Yellow" +msgstr "Gelb" + +#: imageedit/sq_imagefilter.cpp:473 imageedit/sq_imagefilter.cpp:539 +msgid "Filter" +msgstr "Filter" + +#: imageedit/sq_imagefilter.cpp:474 imageedit/sq_imagefilter.cpp:486 +msgid "Color:" +msgstr "Farbe:" + +#: imageedit/sq_imagefilter.cpp:476 +msgid "Opacity" +msgstr "Deckkraft" + +#: imageedit/sq_imagefilter.cpp:477 imageedit/sq_imagefilter.cpp:482 +#: imageedit/sq_imagefilter.cpp:505 +msgid "Sigma" +msgstr "Sigma" + +#: imageedit/sq_imagefilter.cpp:478 imageedit/sq_imagefilter.cpp:481 +#: imageedit/sq_imagefilter.cpp:483 imageedit/sq_imagefilter.cpp:501 +#: imageedit/sq_imagefilter.cpp:506 +msgid "Radius" +msgstr "Radius" + +#: imageedit/sq_imagefilter.cpp:479 imageedit/sq_imagefilter.cpp:492 +#: imageedit/sq_imagefilter.cpp:507 +msgid "Factor" +msgstr "Faktor" + +#: imageedit/sq_imagefilter.cpp:480 imageedit/sq_imagefilter.cpp:484 +#: imageedit/sq_imagefilter.cpp:493 imageedit/sq_imagefilter.cpp:514 +msgid "" +"There are no special options available for this filter. Just click \"Filter" +"\"." +msgstr "" +"Für diesen Filter gibt es keine speziellen Optionen. Benutzen Sie einfach " +"\"Filter\"." + +#: imageedit/sq_imagefilter.cpp:490 +msgid "Color 1:" +msgstr "Farbe 1:" + +#: imageedit/sq_imagefilter.cpp:491 +msgid "Color 2:" +msgstr "Farbe 2:" + +#: imageedit/sq_imagefilter.cpp:494 +msgid "Noise type" +msgstr "Rauschtyp" + +#: imageedit/sq_imagefilter.cpp:495 +msgid "Uniform" +msgstr "Gleichförmig" + +#: imageedit/sq_imagefilter.cpp:496 +msgid "Impulse" +msgstr "Impuls" + +#: imageedit/sq_imagefilter.cpp:497 +msgid "Multiplicative Gaussian" +msgstr "Multiplikativ gaußsch" + +#: imageedit/sq_imagefilter.cpp:498 +msgid "Poisson" +msgstr "Poisson" + +#: imageedit/sq_imagefilter.cpp:499 +msgid "Gaussian" +msgstr "Gaußsch" + +#: imageedit/sq_imagefilter.cpp:500 +msgid "Laplacian" +msgstr "Laplace" + +#: imageedit/sq_imagefilter.cpp:502 +msgid "Color" +msgstr "Farbe" + +#: imageedit/sq_imagefilter.cpp:503 +msgid "Elevation" +msgstr "Erhöhung" + +#: imageedit/sq_imagefilter.cpp:504 +msgid "Azimuth" +msgstr "Azimut" + +#: imageedit/sq_imagefilter.cpp:508 +msgid "Amount" +msgstr "Menge" + +#: imageedit/sq_imagefilter.cpp:509 +msgid "Type" +msgstr "Typ" + +#: imageedit/sq_imagefilter.cpp:510 +msgid "GBR" +msgstr "GBR" + +#: imageedit/sq_imagefilter.cpp:511 +msgid "BRG" +msgstr "BRG" + +#: imageedit/sq_imagefilter.cpp:512 +msgid "Degrees" +msgstr "Grad" + +#: imageedit/sq_imagefilter.cpp:513 imageedit/sq_imagefilter.cpp:515 +#: imageedit/sq_imagefilter.cpp:536 +msgid "Threshold" +msgstr "Schwellwert" + +#: imageedit/sq_imagefilter.cpp:517 +msgid "Blend" +msgstr "Einblenden" + +#: imageedit/sq_imagefilter.cpp:518 +msgid "Blur" +msgstr "Weichzeichnen" + +#: imageedit/sq_imagefilter.cpp:519 +msgid "Desaturate" +msgstr "Sättigung vermindern" + +#: imageedit/sq_imagefilter.cpp:520 +msgid "Despeckle" +msgstr "Flecken entfernen" + +#: imageedit/sq_imagefilter.cpp:521 +msgid "Edge" +msgstr "Kanten" + +#: imageedit/sq_imagefilter.cpp:522 +msgid "Emboss" +msgstr "Relief" + +#: imageedit/sq_imagefilter.cpp:523 +msgid "Equalize" +msgstr "Farben ausgleichen" + +#: imageedit/sq_imagefilter.cpp:524 +msgid "Fade" +msgstr "Verblassen" + +#: imageedit/sq_imagefilter.cpp:525 +msgid "Flatten" +msgstr "Abflachung" + +#: imageedit/sq_imagefilter.cpp:526 +msgid "Implode" +msgstr "Implosion" + +#: imageedit/sq_imagefilter.cpp:527 +msgid "Negative" +msgstr "Negativ" + +#: imageedit/sq_imagefilter.cpp:528 +msgid "Noise" +msgstr "Rauschen" + +#: imageedit/sq_imagefilter.cpp:529 +msgid "Oil" +msgstr "Öl" + +#: imageedit/sq_imagefilter.cpp:530 +msgid "Shade" +msgstr "Schattieren" + +#: imageedit/sq_imagefilter.cpp:531 +msgid "Sharpen" +msgstr "Schärfen" + +#: imageedit/sq_imagefilter.cpp:532 +msgid "Solarize" +msgstr "Solarisieren" + +#: imageedit/sq_imagefilter.cpp:533 +msgid "Spread" +msgstr "Ausdehnen" + +#: imageedit/sq_imagefilter.cpp:534 +msgid "Swap colors" +msgstr "Farben tauschen" + +#: imageedit/sq_imagefilter.cpp:535 +msgid "Swirl" +msgstr "Wirbel" + +#: imageedit/sq_imagefilter.cpp:537 +msgid "Grayscale" +msgstr "Graustufen" + +#: imageedit/sq_imagefilter.cpp:538 +msgid "Redeye" +msgstr "Rote Augen" + +#: imageedit/sq_imagefilter.cpp:541 +msgid "Image after filtering:" +msgstr "Bild nach der Filterung:" + +#: imageedit/sq_imagefilter.cpp:542 imageedit/sq_imagebcg.cpp:397 +msgid "Original image:" +msgstr "Original-Bild:" + +#: imageedit/sq_imagebcg.cpp:378 +msgid "Color balance" +msgstr "Farbbalance" + +#: imageedit/sq_imagebcg.cpp:394 +msgid "Colorize" +msgstr "Einfärben" + +#: imageedit/sq_imagebcg.cpp:396 +msgid "Image after colorizing:" +msgstr "Bild nach der Einfärbung:" + +#: imageedit/sq_imageconvert.cpp:167 +msgid "Convert" +msgstr "Umwandeln" + +#: imageedit/sq_imageconvert.cpp:172 +msgid "Conversion options" +msgstr "Umwandlungsoptionen" + +#: sq_viewcache.cpp:49 sq_viewcache.cpp:107 +msgid "Parameters" +msgstr "Parameter" + +#: sq_viewcache.cpp:103 +msgid "Memory cache" +msgstr "Hauptspeicher-Zwischenspeicher" + +#: sq_viewcache.cpp:108 +msgid "Total:" +msgstr "Gesamt:" + +#: sq_imageproperties.ui.h:29 +msgid "Copy entry" +msgstr "Eintrag kopieren" + +#: sq_imageproperties.ui.h:30 +msgid "Copy all entries" +msgstr "Alle Einträge kopieren" + +#: sq_imageproperties.ui.h:95 +msgid "EXIF" +msgstr "Exif" + +#: sq_imageproperties.ui.h:105 +msgid "Simple" +msgstr "Einfach" + +#: sq_imageproperties.ui.h:108 +msgid "Full" +msgstr "Vollständig" + +#: sq_imageproperties.ui.h:127 +msgid "EXIF (no)" +msgstr "Exif (Nein)" + +#: sq_imageproperties.ui.h:177 +msgid "Metadata (no)" +msgstr "Metadaten (Nein)" + +#: _translatorinfo.cpp:1 +msgid "" +"_: NAME OF TRANSLATORS\n" +"Your names" +msgstr "Oliver Dörr" + +#: _translatorinfo.cpp:3 +msgid "" +"_: EMAIL OF TRANSLATORS\n" +"Your emails" +msgstr "kde@doerr-privat.de" + +#: sq_glwidget.cpp:233 +msgid "Rectangle" +msgstr "Rechteck" + +#: sq_glwidget.cpp:234 +msgid "Ellipse" +msgstr "Ellipse" + +#: sq_glwidget.cpp:239 +msgid "Fit width" +msgstr "An die Breite anpassen" + +#: sq_glwidget.cpp:240 +msgid "Fit height" +msgstr "An die Höhe anpassen" + +#: sq_glwidget.cpp:241 +msgid "Fit image" +msgstr "Das Bild anpassen" + +#: sq_glwidget.cpp:242 +msgid "Zoom 100%" +msgstr "Zoom 100%" + +#: sq_glwidget.cpp:243 +msgid "Leave previous zoom" +msgstr "Vorherigen Zoom beibehalten" + +#: sq_glwidget.cpp:244 +msgid "Ignore, if image is smaller than window" +msgstr "Ignorieren, falls das Bild kleiner ist als das Fenster" + +#: sq_glwidget.cpp:318 +msgid "Go to first image" +msgstr "Zum ersten Bild gehen" + +#: sq_glwidget.cpp:319 +msgid "Previous image" +msgstr "Vorheriges Bild" + +#: sq_glwidget.cpp:321 +msgid "Next image" +msgstr "Nächstes Bild" + +#: sq_glwidget.cpp:323 +msgid "Go to last image" +msgstr "Zum letzten Bild gehen" + +#: sq_glwidget.cpp:326 sq_glwidget.cpp:2685 +msgid "Zoom +" +msgstr "Zoom +" + +#: sq_glwidget.cpp:328 sq_glwidget.cpp:2686 +msgid "Zoom -" +msgstr "Zoom -" + +#: sq_glwidget.cpp:332 sq_glwidget.cpp:2677 +msgid "Rotate left" +msgstr "Nach links drehen" + +#: sq_glwidget.cpp:334 sq_glwidget.cpp:2678 +msgid "Rotate right" +msgstr "Nach rechts drehen" + +#: sq_glwidget.cpp:336 sq_glwidget.cpp:2707 +msgid "Flip vertically" +msgstr "Vertikal spiegeln" + +#: sq_glwidget.cpp:338 sq_glwidget.cpp:2708 +msgid "Flip horizontally" +msgstr "Horizontal spiegeln" + +#: sq_glwidget.cpp:340 +msgid "Normalize" +msgstr "Normalisieren" + +#: sq_glwidget.cpp:342 sq_glwidget.cpp:2723 +msgid "Fullscreen" +msgstr "Vollbild" + +#: sq_glwidget.cpp:344 +msgid "Select image" +msgstr "Bild auswählen" + +#: sq_glwidget.cpp:346 +msgid "Selection" +msgstr "Auswahl" + +#: sq_glwidget.cpp:348 sq_glwidget.cpp:2717 sq_codecsettingsskeleton.cpp:128 +msgid "Codec settings" +msgstr "Codec-Einstellungen" + +#: sq_glwidget.cpp:351 +msgid "Show navigator" +msgstr "Navigator anzeigen" + +#: sq_glwidget.cpp:1024 +msgid "yes" +msgstr "Ja" + +#: sq_glwidget.cpp:1024 +msgid "no" +msgstr "Nein" + +#: sq_glwidget.cpp:1485 +msgid "Codec for %1 format not found" +msgstr "Codec für %1-Format wurde nicht gefunden" + +#: sq_glwidget.cpp:1729 +msgid "Memory allocation failed for %1 of memory" +msgstr "Hauptspeicherreservierung fehlgeschlagen für %1 vom Hauptspeicher" + +#: sq_glwidget.cpp:1741 +msgid "Memory allocation failed" +msgstr "Hauptspeicherreservierung fehlgeschlagen" + +#: sq_glwidget.cpp:1747 +msgid "Decoding failed" +msgstr "Dekodierung fehlgeschlagen" + +#: sq_glwidget.cpp:1849 +msgid " ms." +msgstr " ms." + +#: sq_glwidget.cpp:2363 +msgid "" +"Sorry, could not perform write operation\n" +"for codec \"%1\"" +msgstr "" +"Die Schreiboperation konnte nicht durchgeführt werden\n" +"für den Codec \"%1\"" + +#: sq_glwidget.cpp:2382 sq_glwidget.cpp:2390 sq_glwidget.cpp:2412 +msgid "Error writing image" +msgstr "Fehler beim Speichern des Bildes" + +#: sq_glwidget.cpp:2433 +msgid "Try another location?" +msgstr "Möchten Sie einen anderen Ort angeben?" + +#: sq_glwidget.cpp:2658 +msgid "Rotate" +msgstr "Drehen" + +#: sq_glwidget.cpp:2661 sq_options.cpp:803 +msgid "Window" +msgstr "Fenster" + +#: sq_glwidget.cpp:2670 +msgid "Next" +msgstr "Nächstes" + +#: sq_glwidget.cpp:2671 +msgid "Previous" +msgstr "Vorheriges" + +#: sq_glwidget.cpp:2672 +msgid "First" +msgstr "Erstes" + +#: sq_glwidget.cpp:2673 +msgid "Last" +msgstr "Letztes" + +#: sq_glwidget.cpp:2680 +msgid "Rotate 180'" +msgstr "180 Grad drehen" + +#: sq_glwidget.cpp:2682 +msgid "Rotate 1' left" +msgstr "1 Grad nach links" + +#: sq_glwidget.cpp:2683 +msgid "Rotate 1' right" +msgstr "1 Grad nach rechts" + +#: sq_glwidget.cpp:2687 +msgid "Zoom 2x" +msgstr "Zoom 2x" + +#: sq_glwidget.cpp:2688 +msgid "Zoom 1/2x" +msgstr "Zoom 1/2x" + +#: sq_glwidget.cpp:2698 +msgid "Move left" +msgstr "Nach links verschieben" + +#: sq_glwidget.cpp:2699 +msgid "Move right" +msgstr "Nach rechts verschieben" + +#: sq_glwidget.cpp:2700 +msgid "Move up" +msgstr "Nach oben verschieben" + +#: sq_glwidget.cpp:2701 +msgid "Move down" +msgstr "Nach unten verschieben" + +#: sq_glwidget.cpp:2703 +msgid "Start/stop animation" +msgstr "Animation starten/stoppen" + +#: sq_glwidget.cpp:2704 +msgid "Hide/show background" +msgstr "Hintergrund ein-/ausblenden" + +#: sq_glwidget.cpp:2705 +msgid "Hide/show tickmarks" +msgstr "Kästchen ein-/ausblenden" + +#: sq_glwidget.cpp:2710 +msgid "First page" +msgstr "Erste Seite" + +#: sq_glwidget.cpp:2711 +msgid "Previous page" +msgstr "Vorherige Seite" + +#: sq_glwidget.cpp:2712 +msgid "Next page" +msgstr "Nächste Seite" + +#: sq_glwidget.cpp:2713 +msgid "Last page" +msgstr "Letzte Seite" + +#: sq_glwidget.cpp:2715 +msgid "To clipboard" +msgstr "In die Zwischenablage" + +#: sq_glwidget.cpp:2720 +msgid "Color balance..." +msgstr "Farbbalance ..." + +#: sq_glwidget.cpp:2721 +msgid "Apply filter..." +msgstr "Filter anwenden ..." + +#: sq_glwidget.cpp:2724 +msgid "Hide/show toolbar" +msgstr "Werkzeugleiste anzeigen/ausblenden" + +#: sq_glwidget.cpp:2725 +msgid "Hide/show statusbar" +msgstr "Statusleiste anzeigen/ausblenden" + +#: sq_glwidget.cpp:2728 +msgid "Reset" +msgstr "Zurücksetzen" + +#: sq_glwidget.cpp:2731 sq_helpwidget.cpp:174 +msgid "Hotkeys" +msgstr "Tastaturkürzel" + +#: sq_glview.cpp:84 +msgid "Loading time" +msgstr "Ladezeit" + +#: sq_options.cpp:746 +msgid "The main options" +msgstr "Allgemeine Optionen" + +#: sq_options.cpp:748 +msgid "Write configuration file to disk, when I press \"OK\"" +msgstr "Konfigurationsdatei auf die Platte schreiben wenn \"Ok\" gedrückt wird" + +#: sq_options.cpp:749 +msgid "Minimize to tray after closing" +msgstr "Nach dem Schliessen in der Kontrollleiste anzeigen" + +#: sq_options.cpp:750 +msgid "Show splash screen at startup" +msgstr "Startbildschirm anzeigen" + +#: sq_options.cpp:751 +msgid "Don't show animated logo in toolbar" +msgstr "Animiertes Logo in der Werkzeugleiste nicht anzeigen" + +#: sq_options.cpp:752 +msgid "Apply codec settings to" +msgstr "Einstellungen des Codecs anwenden auf" + +#: sq_options.cpp:753 +msgid "Thumbnail loader" +msgstr "Bildvorschau" + +#: sq_options.cpp:754 +msgid "Image viewer (also preview window)" +msgstr "Bildbetrachter (auch das Vorschaufenster)" + +#: sq_options.cpp:755 sq_options.cpp:773 +msgid "Both" +msgstr "Beide" + +#: sq_options.cpp:756 +msgid "RunTime" +msgstr "Laufzeit" + +#: sq_options.cpp:757 +msgid "Treat unknown mime types as unsupported" +msgstr "Unbekannte Dateizuordnung als nicht unterstützt behandeln" + +#: sq_options.cpp:758 +msgid "Load KIPI plugins on demand (for slow machines)" +msgstr "KIPI-Module laden wenn sie benötigt werden (für langsame Rechner)" + +#: sq_options.cpp:759 +msgid "Disk navigator" +msgstr "Plattennavigation" + +#: sq_options.cpp:760 +msgid "On starting open..." +msgstr "Beim Start öffnen ..." + +#: sq_options.cpp:762 +msgid "Custom directory:" +msgstr "ausgewählten Ordner:" + +#: sq_options.cpp:763 +msgid "Last visited directory" +msgstr "zuletzt besuchten Ordner" + +#: sq_options.cpp:764 +msgid "Current directory, where KSquirrel starts" +msgstr "aktuellen Ordner in dem KSquirrel gestartet ist" + +#: sq_options.cpp:765 +msgid "Run unknown file formats separately (with default application)" +msgstr "Unbekannte Dateiformate mit der KDE-Standardanwendung starten" + +#: sq_options.cpp:767 +msgid "Save history" +msgstr "Verlauf speichern" + +#: sq_options.cpp:768 +msgid "Jump into archives" +msgstr "In Archiven springen" + +#: sq_options.cpp:769 +msgid "Jump to first image" +msgstr "Zum ersten Bild springen" + +#: sq_options.cpp:770 +msgid "Don't show directories" +msgstr "Ordner nicht anzeigen" + +#: sq_options.cpp:771 +msgid "Main" +msgstr "Haupt" + +#: sq_options.cpp:772 +msgid "Synchronization" +msgstr "Synchronisation" + +#: sq_options.cpp:774 +msgid "Tree -> Navigator" +msgstr "Baum -> Navigator" + +#: sq_options.cpp:775 +msgid "Tree <- Navigator" +msgstr "Baum <- Navigator" + +#: sq_options.cpp:776 +msgid "Clicking" +msgstr "Klicke" + +#: sq_options.cpp:777 +msgid "Thumbnails" +msgstr "Vorschaubilder" + +#: sq_options.cpp:779 +msgid "Do not write thumbnails on disk" +msgstr "Die Vorschaubilder nicht auf der Platte speichern" + +#: sq_options.cpp:780 +msgid "Show tooltips with file information" +msgstr "Kurzinfos mit Dateiinformationen anzeigen" + +#: sq_options.cpp:781 +msgid "Margin between thumbnails" +msgstr "Freiräume zwischen den Vorschaubildern" + +#: sq_options.cpp:782 sq_options.cpp:815 +msgid " pixels" +msgstr " Pixel" + +#: sq_options.cpp:783 +msgid "Don't show tooltips when the main window is inactive" +msgstr "Kurzinfos nicht anzeigen, wenn das Hauptfenster inaktiv ist" + +#: sq_options.cpp:784 +msgid "Mark supported image formats with clock icon (slow)" +msgstr "Unterstützte Bildformate mit einem Uhrensymbol markieren (Langsam)" + +#: sq_options.cpp:785 +msgid "Maximum cache size (in memory)" +msgstr "Maximale Zwischenspeichergröße im Hauptspeicher" + +#: sq_options.cpp:786 +msgid " Kb" +msgstr " Kb" + +#: sq_options.cpp:787 +msgid "No cache" +msgstr "Kein Zwischenspeicher" + +#: sq_options.cpp:788 +msgid "On scroll event" +msgstr "Aktion des Mausrades" + +#: sq_options.cpp:789 +msgid "Zoom the scene" +msgstr "In die Szene zoomen" + +#: sq_options.cpp:790 +msgid "Load next/previous file" +msgstr "Nächste/Vorherige Datei laden" + +#: sq_options.cpp:791 +msgid "Background" +msgstr "Hintergrund" + +#: sq_options.cpp:792 +msgid "Custom texture" +msgstr "Eigene Textur" + +#: sq_options.cpp:793 +msgid "Custom color" +msgstr "Eigene Farbe" + +#: sq_options.cpp:794 +msgid "System color" +msgstr "Systemfarbe" + +#: sq_options.cpp:798 +msgid "Validate" +msgstr "Überprüfen" + +#: sq_options.cpp:802 +msgid "Show images progressively" +msgstr "Bilder stufenweise anzeigen" + +#: sq_options.cpp:804 +msgid "Image pages" +msgstr "Bildseiten" + +#: sq_options.cpp:805 +msgid "Load all pages" +msgstr "Alle Seiten laden" + +#: sq_options.cpp:806 +msgid "Load only first page" +msgstr "Nur die erste Seite laden" + +#: sq_options.cpp:807 +msgid "Load no more than" +msgstr "Nicht mehr laden als" + +#: sq_options.cpp:808 +msgid " pages" +msgstr " Seiten" + +#: sq_options.cpp:809 +msgid "Loader" +msgstr "Lader" + +#: sq_options.cpp:810 +msgid "Draw tickmarks around the image" +msgstr "Kästchen um das Bild anzeigen" + +#: sq_options.cpp:811 +msgid "Draw background for transparent images" +msgstr "Hintergrund für durchsichtige Bilder anzeigen" + +#: sq_options.cpp:812 +msgid "Rotating" +msgstr "Drehe" + +#: sq_options.cpp:813 +msgid " degrees" +msgstr " Grad" + +#: sq_options.cpp:814 sq_helpwidget.cpp:183 +msgid "Moving" +msgstr "Verschiebe" + +#: sq_options.cpp:817 +msgid "Zoom limit" +msgstr "Zoomgrenze" + +#: sq_options.cpp:818 +msgid "Minimum: 1%, maximum: 10,000%" +msgstr "Minimum: 1%, Maximum: 10,000%" + +#: sq_options.cpp:819 +msgid "Custom" +msgstr "Benutzerdefiniert" + +#: sq_options.cpp:821 +msgid "minimum" +msgstr "Minimum" + +#: sq_options.cpp:822 sq_options.cpp:824 +msgid " %" +msgstr " %" + +#: sq_options.cpp:823 +msgid "maximum" +msgstr "Maximum" + +#: sq_options.cpp:825 +msgid "No limit" +msgstr "Keine Begrenzung" + +#: sq_options.cpp:826 +msgid "Zoom coefficient" +msgstr "Zoomfaktor" + +#: sq_options.cpp:827 +msgid "%" +msgstr "%" + +#: sq_options.cpp:828 +msgid "None" +msgstr "Keine" + +#: sq_options.cpp:830 +msgid "Customize OpenGL widget" +msgstr "OpenGL-Element anpassen" + +#: sq_options.cpp:831 +msgid "Recursion" +msgstr "Rekursion" + +#: sq_options.cpp:832 +msgid "No recursion" +msgstr "Keine Rekursion" + +#: sq_options.cpp:833 +msgid "Show number of files" +msgstr "Anzahl der Dateien anzeigen" + +#: sq_options.cpp:834 +msgid "Show number of subfolders and files" +msgstr "Anzahl der Unterordner und Dateien anzeigen" + +#: sq_options.cpp:835 +msgid "Show number of subfolders" +msgstr "Anzahl der Unterordner anzeigen" + +#: sq_options.cpp:836 +msgid "Treeview" +msgstr "Baumansicht" + +#: sq_options.cpp:837 +msgid "Show device path" +msgstr "Gerätepfad anzeigen" + +#: sq_options.cpp:838 +msgid "Show mount options" +msgstr "Einbindungsoptionen anzeigen" + +#: sq_options.cpp:839 +msgid "Show filesystem type" +msgstr "Dateisystemtyp anzeigen" + +#: sq_options.cpp:840 +msgid "Mount view" +msgstr "Einbindungsansicht" + +#: sq_options.cpp:841 +msgid "Enable preview window" +msgstr "Vorschaufenster einschalten" + +#: sq_options.cpp:843 +msgid "Delay before image loading" +msgstr "Verzögerung vor dem Laden des Bildes" + +#: sq_options.cpp:844 sq_slideshow.cpp:218 +msgid " ms" +msgstr " ms" + +#: sq_options.cpp:845 +msgid "Background color for preview widget:" +msgstr "Hintergrundfarbe für das Vorschauelement:" + +#: sq_options.cpp:847 +msgid "Don't load preview image on file execution" +msgstr "Vorschaubild bei der Dateiausführung nicht laden" + +#: sq_options.cpp:848 +msgid "Disables loading preview image when user launches image with mouse" +msgstr "Schaltet das Laden des Vorschaubildes ab, wenn der Benutzer das Bild mit der Maus startet" + +#: sq_options.cpp:849 +msgid "Image preview" +msgstr "Bildvorschau" + +#: sq_options.cpp:850 +msgid "Sidebar settings" +msgstr "Einstellungen der Seitenleiste" + +#: sq_options.cpp:851 +msgid "KIPI Configuration" +msgstr "KIPI-Konfiguration" + +#: sq_slideshow.cpp:205 +msgid "Slideshow options" +msgstr "Optionen für die Diaschau" + +#: sq_slideshow.cpp:206 +msgid "Start" +msgstr "Start" + +#: sq_slideshow.cpp:209 +msgid "Set directory to current" +msgstr "Den Ordner auf den aktuellen setzen" + +#: sq_slideshow.cpp:210 +msgid "Last visited directories" +msgstr "Zuletzt besuchte Ordner" + +#: sq_slideshow.cpp:220 +msgid "Repeats:" +msgstr "Wiederholungen:" + +#: sq_slideshow.cpp:221 +msgid "Background color:" +msgstr "Hintergrundfarbe:" + +#: sq_slideshow.cpp:222 +msgid "Onscreen messages" +msgstr "Bildschirmmeldungen" + +#: sq_slideshow.cpp:223 +msgid "Show current index" +msgstr "Aktuellen Index anzeigen" + +#: sq_slideshow.cpp:224 +msgid "Show file name" +msgstr "Dateinamen anzeigen" + +#: sq_slideshow.cpp:225 +msgid "Show file size" +msgstr "Dateigröße anzeigen" + +#: sq_slideshow.cpp:226 +msgid "Recursively" +msgstr "Rekursiv" + +#: ksquirrel.cpp:288 +msgid "Clear history" +msgstr "Verlauf löschen" + +#: ksquirrel.cpp:289 +msgid "Clear address" +msgstr "Adresse löschen" + +#: ksquirrel.cpp:294 +msgid "Go!" +msgstr "Starten" + +#: ksquirrel.cpp:341 +msgid "Libraries' filters" +msgstr "Bibliotheksfilter" + +#: ksquirrel.cpp:364 +msgid "All supported formats" +msgstr "Alle unterstützen Formate" + +#: ksquirrel.cpp:374 +msgid "User's filters" +msgstr "Filter des Benutzers" + +#: ksquirrel.cpp:510 +msgid "Folder tree" +msgstr "Ordnerbaum" + +#: ksquirrel.cpp:511 +msgid "Mount points" +msgstr "Einhängepunkte" + +#: ksquirrel.cpp:628 +msgid "&Navigator" +msgstr "&Navigator" + +#: ksquirrel.cpp:630 +msgid "&Action" +msgstr "&Aktion" + +#: ksquirrel.cpp:633 +msgid "&KIPI Plugins" +msgstr "&KIPI-Module" + +#: ksquirrel.cpp:661 +msgid "Fi<er" +msgstr "&Filter" + +#: ksquirrel.cpp:720 +msgid "Thumbnail size" +msgstr "Größe der Vorschaubilder" + +#: ksquirrel.cpp:723 sq_options.ui.h:137 +msgid "Image window" +msgstr "Bildfenster" + +#: ksquirrel.cpp:725 +msgid "Reload codecs from disk" +msgstr "Codecs neu von der Platte laden" + +#: ksquirrel.cpp:726 +msgid "Configure external tools..." +msgstr "Externe Werkzeuge konfigurieren ..." + +#: ksquirrel.cpp:727 +msgid "Configure filters..." +msgstr "Filter konfigurieren ..." + +#: ksquirrel.cpp:728 +msgid "Go to tray" +msgstr "In die Kontrollleiste minimieren" + +#: ksquirrel.cpp:729 +msgid "Open file and change directory" +msgstr "Datei öffnen und Ordner wechseln" + +#: ksquirrel.cpp:730 +msgid "Open file" +msgstr "Datei öffnen" + +#: ksquirrel.cpp:731 +msgid "Thumbnail cache manager..." +msgstr "Verwaltung des Zwischenspeichers für die Bildvorschauen ..." + +#: ksquirrel.cpp:735 +msgid "List" +msgstr "Liste" + +#: ksquirrel.cpp:736 +msgid "Icons" +msgstr "Symbole" + +#: ksquirrel.cpp:737 +msgid "Details" +msgstr "Details" + +#: ksquirrel.cpp:738 sq_options.ui.h:136 +msgid "Thumbnails" +msgstr "Vorschaubilder" + +#: ksquirrel.cpp:740 +msgid "Show URL box" +msgstr "Adress-Leiste anzeigen" + +#: ksquirrel.cpp:742 +msgid "Built-in image window" +msgstr "Eingebauter Bildbetrachter" + +#: ksquirrel.cpp:745 +msgid "Slideshow" +msgstr "Diaschau" + +#: ksquirrel.cpp:746 +msgid "Slideshow advanced" +msgstr "Erweiterte Diaschau" + +#: ksquirrel.cpp:748 +msgid "Codec information..." +msgstr "Codecs-Information ..." + +#: ksquirrel.cpp:749 +msgid "OpenGL information..." +msgstr "OpenGL-Information ..." + +#: ksquirrel.cpp:751 +msgid "Medium thumbnails" +msgstr "Mittlere Vorschaubilder" + +#: ksquirrel.cpp:752 +msgid "Large thumbnails" +msgstr "Große Vorschaubilder" + +#: ksquirrel.cpp:753 +msgid "Huge thumbnails" +msgstr "Riesige Vorschaubilder" + +#: ksquirrel.cpp:755 +msgid "Select group" +msgstr "Gruppe auswählen" + +#: ksquirrel.cpp:756 +msgid "Deselect group" +msgstr "Gruppenauswahl aufheben" + +#: ksquirrel.cpp:776 +msgid "Extended thumbnails" +msgstr "Erweiterte Vorschaubilder" + +#: ksquirrel.cpp:1085 +msgid " writing settings and thumbnails... " +msgstr " speichere Einstellungen und Vorschaubilder ... " + +#: sq_filters.cpp:124 sq_filters.cpp:197 +msgid "Extensions" +msgstr "Erweiterungen" + +#: sq_filters.cpp:181 +msgid "Adjust filters" +msgstr "Filter justieren" + +#: sq_filters.cpp:186 +msgid "New filter" +msgstr "Neuer Filter" + +#: sq_filters.cpp:193 +msgid "Move filter up" +msgstr "Filter nach oben verschieben" + +#: sq_filters.cpp:195 +msgid "Move filter down" +msgstr "Filter nach unten verschieben" + +#: sq_filters.cpp:198 +msgid "Menu item contains both name and extension" +msgstr "Der Menüeintrag enthält sowohl Name, als auch Erweiterung" + +#: sq_helpwidget.cpp:175 +msgid "" +"

    Esc,X,Return

    close

    Middle click, F

    fullscreen

    Z

    show " +"'Zoom' menu

    /

    show this " +"help

    Right click, M, ContextMenu

    show context menu

    N

    toggle filter

    Shift + Left button

    select a region

    Shift + " +"Left

    previous tab

    Shift + " +"Right

    next tab

    W

    close tab

    " +msgstr "" +"

    Esc, X, Eingabe

    Schliessen

    Mittlere Maustaste, F

    Vollbild

    Z

    Zoom-Menü anzeigen

    /

    Diese Hilfe zeigen

    Rechte Maustaste, M, Kontextmenü

    Kontextmenü anzeigen

    N

    Filter umschalten

    Umschalt + Linke Maustaste

    Bereich auswählen

    Umschalt + Links

    Vorheriges Unterfenster

    Umschalt + " +"Rechts

    Nächstes Unterfenster

    W

    Unterfenster schließen

    " + +#: sq_helpwidget.cpp:176 +msgid "" +"

    Space, Page Down

    next image

    Backspace, Page Up

    previous image

    Home

    first image

    End

    last image

    " +msgstr "" +"

    Leertaste, Bild unten

    Nächstes Bild

    Rücktaste, Bild hoch

    Vorheriges Bild

    Pos1

    Erstes Bild

    Ende

    Letztes Bild

    " + +#: sq_helpwidget.cpp:177 +msgid "" +"

    " +msgstr "

    Left, Right, Up, Down

    move the image

    Ctrl + Left

    rotate left

    Ctrl + Right

    rotate right

    Ctrl + Up/" +"Down

    rotate for 180 degrees up/down

    Alt + Left/Right

    rotate for 1 degree left/right
    " + +#: sq_helpwidget.cpp:178 +msgid "" +"

    Links, Rechts, Oben, Unten

    Das Bild verschieben

    Strg + Links

    Nach links drehen

    Strg + Rechts

    Nach rechts drehen

    Strg + Oben/Unten

    Um 180 Grad nach oben/unten drehen

    Alt + Links/Rechts

    Um 1 Grad nach links/rechts drehen
    " +msgstr "" +"

    +/-

    zoom " +"Nx

    Ctrl + +/-

    zoom " +"2x/0.5x

    Scroll

    load next/" +"prev file OR zoom+/zoom-

    Shift + Scroll

    zoom+/zoom-

    Ctrl + Scroll

    zoom+ 2x/zoom- 2x

    1..9

    zoom 1..9x

    0

    zoom 10x

    comma

    fit " +"width

    period

    fit height

    *

    fit image
    " + +#: sq_helpwidget.cpp:179 +msgid "" +"

    +/-

    Zoom Nx

    Strg + +/-

    Zoom 2x/0.5x

    Rollen

    Nächste/vorherige Datei laden ODER Zoom + /Zoom -

    Unschalt + Rollen

    Zoom + / Zoom -

    Strg + Rollen

    Zoom + 2x / Zoom - 2x

    1 ... 9

    Zoom 1 ... 9x

    0

    Zoom 10x

    Komma

    Auf Breite anpassen

    Punkt

    Auf Höhe anpassen

    *

    Bild anpassen
    " +"

    S

    save as

    V

    flip vertically

    H

    flip horizontally

    R

    reset

    P

    image properties

    C

    codec settings

    L

    ignore zoom if image is smaller than " +"window

    I

    menu with " +"images

    A

    stop/start " +"animation

    B

    toggle " +"drawing background for transparent images

    K

    toggle drawing tickmarks

    E

    show menu with external " +"tools

    Y

    crop

    F1

    first image in " +"multi-paged image

    F2

    previous

    F3

    next

    F4

    last
    " +msgstr "" +"

    S

    Speichern unter

    V

    Vertikal spiegeln

    H

    Horizontal spiegeln

    R

    Zurücksetzen

    P

    Bildeigenschaften

    C

    Codec-Einstellungen

    L

    Zoom ignorieren, falls das Bild kleiner ist als das Fenster

    I

    Menü mit Bildern

    A

    Animation starten/stoppen

    B

    Hintergrund für durchsichtige Bilder umschalten

    K

    Häkchen anzeigen umschalten

    E

    Menü mit externen Werkzeugen anzeigen

    Y

    crop

    F1

    Erstes Bild in mehrseitigen Bildern

    F2

    Vorheriges

    F3

    Nächstes

    F4

    Letztes

    " + +#: sq_helpwidget.cpp:182 sq_options.ui.h:135 +msgid "Filing" +msgstr "Dateien" + +#: sq_helpwidget.cpp:184 +msgid "Current image" +msgstr "Aktuelles Bild" + +#: sq_options.ui.h:138 +msgid "Sidebar" +msgstr "Seitenleiste" + +#: sq_options.ui.h:141 +msgid "KIPI" +msgstr "KIPI" + +#: sq_options.ui.h:260 +msgid "Wrong dimensions: %1x%2." +msgstr "Falsche Größe: %1x%2." + +#: sq_slideshowlisting.cpp:87 +msgid "Listing" +msgstr "Aufzählung" + +#: ksquirrel.cpp:751 +msgid "Rename" +msgstr "Umbenennen" + +#: ksquirrel.cpp:1951 +msgid "Renaming File" +msgstr "Daitei umbenennen" + +#: ksquirrel.cpp:1952 +msgid "

    Rename file %1 to:

    " +msgstr "

    Neuer Name für %1:

    " + +msgid "Calculate directory size" +msgstr "Ordnergröße wird berechnet" + +msgid "New folder..." +msgstr "Neuer Ordner ..." + +msgid "Create Subfolder" +msgstr "Unterordner erstellen" + +msgid "

    Create new folder in %1:

    " +msgstr "

    Neuen Ordner erstellen in %1:

    " + +msgid "Rename Folder" +msgstr "Ordner umbenennen" + +msgid "

    Rename folder %1 to:

    " +msgstr "

    Ordner %1 umbenennen in:

    " + +msgid "Are you sure you want to delete %1?" +msgstr "Sind Sie sicher, dass Sie %1 löschen möchten?" + +msgid "Copy to last folder" +msgstr "Zum letzten Ordner kopieren" + +msgid "Move to last folder" +msgstr "Zum letzten Ordner verschieben" + +msgid "Message text color:" +msgstr "Farbe des Meldungstextes:" + +msgid "Total" +msgstr "Gesamt" + +msgid "Visualize drag operation" +msgstr "Ziehen und ablegen visualisieren" + +msgid "Testing" +msgstr "Testen" + +msgid "Lazy thumbnail generation" +msgstr "Verzögerte Generierung der Vorschaubilder" + +msgid "Delay" +msgstr "Verzögerung" + +msgid "Interface" +msgstr "Schnittstelle" + +msgid "Number of text lines" +msgstr "Anzahl der Textzeilen" + +msgid "Show file preview" +msgstr "Dateivorschau anzeigen" + +msgid "Number of additionally generated rows" +msgstr "Anzahl der zusätzlich generierten Reihen" + +msgid "Repeat (copy to %1)" +msgstr "Wiederholen (Kopieren nach %1)" + +msgid "Repeat (move to %1)" +msgstr "Wiederholen (Verschieben nach %1)" + +msgid "Repeat (link to %1)" +msgstr "Wiederholen (Verknüpfen mit %1)" + +msgid "Repeat (nothing to repeat)" +msgstr "Wiederholen (Nichts zu wiederholen)" + +msgid "Clear contents" +msgstr "Inhalte löschen" + +msgid "Are you sure you want to delete contents of %1?" +msgstr "Sind Sie sicher, dass Sie den Inhalt von %1 löschen möchten?" + +msgid "Add to Folder Basket" +msgstr "Zum Ordnerkorb hinzufügen" + +msgid "Folder basket" +msgstr "Ordnerkorb" + +msgid "Change icon" +msgstr "Symbol ändern" + +msgid "

    Rename item %1 to:

    " +msgstr "

    Eintrag %1 umbenennen in:

    " + +msgid "Copy file path" +msgstr "Dateipfad kopieren" + +msgid "Copy file url" +msgstr "Datei-Adresse kopieren" + +msgid "Text color:" +msgstr "Textfarbe:" + +msgid "Show image dimensions" +msgstr "Bildabmessungen anzeigen" + +msgid "Text color..." +msgstr "Textfarbe ..." + +msgid "Double click" +msgstr "Doppelklick" + +msgid "Close window" +msgstr "Fenster schließen" + +msgid "Crop" +msgstr "Zuschneiden" + +msgid "Tabs" +msgstr "Unterfenster" + +msgid "Enable tabs" +msgstr "Unterfenster einschalten" + +msgid "Ask what to do when opening new image" +msgstr "Beim Öffnen eines neuen Bildes nachfragen" + +msgid "Show close buttons" +msgstr "Knöpfe zum Schließen anzeigen" + +msgid "Open in a new tab" +msgstr "In einem neuen Unterfenster öffnen" + +msgid "Replace current tab" +msgstr "Aktuelles Unterfenster ersetzen" + +msgid "Close all and open in a new tab" +msgstr "Alle schließen und in einem neuen Unterfenster öffnen" + +msgid "Opening..." +msgstr "Öffne ..." + +msgid "Previous tab" +msgstr "Vorheriges Unterfenster" + +msgid "Next tab" +msgstr "Nächstes Unterfenster" + +msgid "Close tab" +msgstr "Unterfenster schließen" + +msgid "Do nothing" +msgstr "Nichts machen" + +msgid "Print available DCOP parameters" +msgstr "" + +msgid "Downloading..." +msgstr "" + +msgid "Close all tabs" +msgstr "" + +msgid "Close all opened images when closing window" +msgstr "" + +msgid "Codec manager..." +msgstr "" + +msgid "Select codecs to disable:" +msgstr "" + +msgid "Select codecs to enable:" +msgstr "" diff --git a/po/en_GB.po b/po/en_GB.po new file mode 100644 index 0000000..a4790af --- /dev/null +++ b/po/en_GB.po @@ -0,0 +1,2174 @@ +# translation of ksquirrel.po to British English +# Copyright (C) 2007 +# This file is distributed under the same license as the ksquirrel package. +# Malcolm Hunter , 2007. +# +msgid "" +msgstr "" +"Project-Id-Version: ksquirrel\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2007-08-07 09:34+0300\n" +"PO-Revision-Date: 2007-11-14 23:11+0000\n" +"Last-Translator: Malcolm Hunter\n" +"Language-Team: British English \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: KBabel 1.11.4\n" + +#: sq_filters.ui.h:56 sq_filters.ui.h:58 sq_externaltools.cpp:67 +#: sq_externaltools.cpp:194 sidebar/sq_mountview.cpp:64 sq_viewcache.cpp:47 +#: sq_viewcache.cpp:105 sq_filters.cpp:123 sq_filters.cpp:196 +msgid "Name" +msgstr "Name" + +#: sq_externaltool.cpp:102 sq_externaltool.cpp:162 sq_externaltool.cpp:170 +msgid "No file selected" +msgstr "No file selected" + +#: sq_kipimanager.cpp:68 +msgid "No Plugins" +msgstr "No Plugins" + +#: sq_kipimanager.cpp:125 +msgid "Image actions" +msgstr "Image actions" + +#: sq_kipimanager.cpp:126 +msgid "Effects" +msgstr "Effects" + +#: sq_kipimanager.cpp:127 +msgid "Tools" +msgstr "Tools" + +#: sq_kipimanager.cpp:130 +msgid "Batch processing" +msgstr "Batch processing" + +#: sq_kipimanager.cpp:131 +msgid "Collections" +msgstr "Collections" + +#: sq_libraryhandler.cpp:148 +msgid "All files" +msgstr "All files" + +#: sq_navigatordropmenu.cpp:40 +msgid "Copy here" +msgstr "Copy here" + +#: sq_navigatordropmenu.cpp:43 +msgid "Move here" +msgstr "Move here" + +#: sq_navigatordropmenu.cpp:46 +msgid "Link here" +msgstr "Link here" + +#: sq_glinfo.cpp:45 sq_glinfo.cpp:92 +msgid "Parameter" +msgstr "Parameter" + +#: sq_glinfo.cpp:46 sq_glinfo.cpp:93 sq_imageproperties.cpp:321 +#: sq_imageproperties.cpp:408 imageedit/sq_imagefilter.cpp:487 +msgid "Value" +msgstr "Value" + +#: sq_glinfo.cpp:91 +msgid "OpenGL information" +msgstr "OpenGL information" + +#: sq_externaltools.cpp:66 sq_externaltools.cpp:193 +msgid "Pixmap" +msgstr "Pixmap" + +#: sq_externaltools.cpp:68 sq_externaltools.cpp:195 +msgid "Command" +msgstr "Command" + +#: sq_externaltools.cpp:190 +msgid "Adjust external tools" +msgstr "Adjust external tools" + +#: sq_externaltools.cpp:192 sq_filters.cpp:182 +msgid "OK" +msgstr "OK" + +#: sq_externaltools.cpp:196 sq_externaltools.ui.h:146 +#, c-format +msgid "Command can contain
    • %f: one file
    • %F: multiple files
    " +msgstr "Command can contain
    • %f: one file
    • %F: multiple files
    " + +#: sq_externaltools.cpp:199 +msgid "New tool" +msgstr "New tool" + +#: sq_externaltools.cpp:206 +msgid "Move tool up" +msgstr "Move tool up" + +#: sq_externaltools.cpp:208 +msgid "Move tool down" +msgstr "Move tool down" + +#: sq_kipiinterface.cpp:72 +msgid "Root directory" +msgstr "Root directory" + +#: sq_kipiinterface.cpp:144 +msgid "Folder content" +msgstr "Folder content" + +#: sq_kipiinterface.cpp:161 +msgid "Selected images" +msgstr "Selected images" + +#: sq_kipiinterface.cpp:175 ksquirrel.cpp:513 +msgid "Image basket" +msgstr "Image basket" + +#: main.cpp:40 +msgid "File to be opened at startup." +msgstr "File to be opened at startup." + +#: main.cpp:41 +msgid "Print found libraries and exit." +msgstr "Print found libraries and exit." + +#: main.cpp:57 +msgid "KSquirrel - image viewer for KDE" +msgstr "KSquirrel - image viewer for KDE" + +#: main.cpp:66 +msgid "Bug reports, patches" +msgstr "Bug reports, patches" + +#: main.cpp:67 +msgid "Bug reports" +msgstr "Bug reports" + +#: main.cpp:68 +msgid "Translation help" +msgstr "Translation help" + +#: main.cpp:69 +msgid "TiamaT" +msgstr "TiamaT" + +#: main.cpp:69 +msgid "Initial artwork for edit tools" +msgstr "Initial artwork for edit tools" + +#: main.cpp:70 +msgid "Fera" +msgstr "Fera" + +#: main.cpp:70 +msgid "Great artwork for edit tools" +msgstr "Great artwork for edit tools" + +#: main.cpp:71 +msgid "OpenGL forum at" +msgstr "OpenGL forum at" + +#: main.cpp:72 +msgid "GameDev forum at" +msgstr "GameDev forum at" + +#: sq_imageproperties.cpp:320 sq_imageproperties.cpp:407 +msgid "Group" +msgstr "Group" + +#: sq_imageproperties.cpp:359 sq_glwidget.cpp:350 +msgid "Image properties" +msgstr "Image properties" + +#: sq_imageproperties.cpp:361 +msgid "Attributes" +msgstr "Attributes" + +#: sq_imageproperties.cpp:362 +msgid "Owner:" +msgstr "Owner:" + +#: sq_imageproperties.cpp:363 +msgid "Group:" +msgstr "Group:" + +#: sq_imageproperties.cpp:365 +msgid "Permissions:" +msgstr "Permissions:" + +#: sq_imageproperties.cpp:368 +msgid "Time" +msgstr "Time" + +#: sq_imageproperties.cpp:369 +msgid "Created:" +msgstr "Created:" + +#: sq_imageproperties.cpp:370 +msgid "Last read:" +msgstr "Last read:" + +#: sq_imageproperties.cpp:371 +msgid "Last modified:" +msgstr "Last modified:" + +#: sq_imageproperties.cpp:375 sq_helpwidget.cpp:181 sq_options.ui.h:134 +msgid "General" +msgstr "General" + +#: sq_imageproperties.cpp:376 +msgid "File:" +msgstr "File:" + +#: sq_imageproperties.cpp:378 sq_pluginsinfo.cpp:137 sq_slideshow.cpp:211 +msgid "Directory:" +msgstr "Directory:" + +#: sq_imageproperties.cpp:379 +msgid "Size:" +msgstr "Size:" + +#: sq_imageproperties.cpp:381 +msgid "Type:" +msgstr "Type:" + +#: sq_imageproperties.cpp:382 +msgid "Number of frames:" +msgstr "Number of frames:" + +#: sq_imageproperties.cpp:383 +msgid "Current frame" +msgstr "Current frame" + +#: sq_imageproperties.cpp:384 sq_slideshow.cpp:219 +msgid "Delay:" +msgstr "Delay:" + +#: sq_imageproperties.cpp:385 +msgid "Dimensions:" +msgstr "Dimensions:" + +#: sq_imageproperties.cpp:386 +msgid "Bits per pixel:" +msgstr "Bits per pixel:" + +#: sq_imageproperties.cpp:387 +msgid "Color space:" +msgstr "Colour space:" + +#: sq_imageproperties.cpp:388 +msgid "Compression:" +msgstr "Compression:" + +#: sq_imageproperties.cpp:389 +msgid "Uncompressed size:" +msgstr "Uncompressed size:" + +#: sq_imageproperties.cpp:390 +msgid "Compression ratio:" +msgstr "Compression ratio:" + +#: sq_imageproperties.cpp:391 +msgid "Interlaced:" +msgstr "Interlaced:" + +#: sq_imageproperties.cpp:392 +msgid "Status:" +msgstr "Status:" + +#: sq_imageproperties.cpp:406 sq_glwidget.cpp:2662 sq_options.cpp:816 +msgid "Image" +msgstr "Image" + +#: sq_imageproperties.cpp:409 +msgid "Metadata" +msgstr "Metadata" + +#: sq_pluginsinfo.cpp:55 sq_pluginsinfo.cpp:129 +msgid "..." +msgstr "..." + +#: sq_pluginsinfo.cpp:56 sq_pluginsinfo.cpp:130 +msgid "Icon" +msgstr "Icon" + +#: sq_pluginsinfo.cpp:57 sq_pluginsinfo.cpp:131 +msgid "Library" +msgstr "Library" + +#: sq_pluginsinfo.cpp:58 sq_pluginsinfo.cpp:132 +msgid "Version" +msgstr "Version" + +#: sq_pluginsinfo.cpp:59 sq_pluginsinfo.cpp:133 sq_viewcache.cpp:48 +#: sq_viewcache.cpp:106 +msgid "MIME" +msgstr "MIME" + +#: sq_pluginsinfo.cpp:128 +msgid "Codec information and settings" +msgstr "Codec information and settings" + +#: sq_pluginsinfo.cpp:138 +msgid "Total found:" +msgstr "Total found:" + +#: sq_errorstring.cpp:34 +msgid "cannot open file for reading" +msgstr "cannot open file for reading" + +#: sq_errorstring.cpp:35 +msgid "file corrupted" +msgstr "file corrupted" + +#: sq_errorstring.cpp:36 +msgid "no memory" +msgstr "no memory" + +#: sq_errorstring.cpp:37 +msgid "file type not supported" +msgstr "file type not supported" + +#: sq_errorstring.cpp:38 +msgid "wrong image dimensions" +msgstr "wrong image dimensions" + +#: sq_errorstring.cpp:39 +msgid "cannot open file for writing" +msgstr "cannot open file for writing" + +#: sq_errorstring.cpp:40 +msgid "write feature is not supported" +msgstr "write feature is not supported" + +#: sq_errorstring.cpp:41 +msgid "write error (check free space)" +msgstr "write error (check free space)" + +#: sq_errorstring.cpp:42 +msgid "wrong parameters" +msgstr "wrong parameters" + +#: sq_errorstring.cpp:43 +msgid "Editing process is not finished yet" +msgstr "Editing process is not finished yet" + +#: sq_selectdeselectgroup.cpp:83 +msgid "Filename or mask:" +msgstr "Filename or mask:" + +#: sidebar/sq_treeview.cpp:89 +msgid "root" +msgstr "root" + +#: sidebar/sq_categoriesview.cpp:95 ksquirrel.cpp:512 +msgid "Categories" +msgstr "Categories" + +#: sidebar/sq_categoriesview.cpp:115 sidebar/sq_categoriesview.cpp:166 +msgid "New category" +msgstr "New category" + +#: sidebar/sq_categoriesview.cpp:153 sidebar/sq_categoriesview.cpp:218 +msgid "New Category" +msgstr "New Category" + +#: sidebar/sq_categoriesview.cpp:169 sidebar/sq_categoriesview.cpp:198 +msgid "Create default categories" +msgstr "Create default categories" + +#: sidebar/sq_categoriesview.cpp:197 +msgid "" +"This will create default categories: Concerts, Pets, Home, Friends, Free " +"time, Travelling and Nature. Continue?" +msgstr "" +"This will create default categories: Concerts, Pets, Home, Friends, Free " +"time, Travelling and Nature. Continue?" + +#: sidebar/sq_categoriesview.cpp:218 +msgid "Create new category:" +msgstr "Create new category:" + +#: sidebar/sq_mountview.cpp:43 +msgid "Mount" +msgstr "Mount" + +#: sidebar/sq_mountview.cpp:45 +msgid "Unmount" +msgstr "Unmount" + +#: sidebar/sq_mountview.cpp:47 +msgid "Refresh" +msgstr "Refresh" + +#: sidebar/sq_mountview.cpp:170 +msgid "Device" +msgstr "Device" + +#: sidebar/sq_mountview.cpp:173 +msgid "FS Type" +msgstr "FS Type" + +#: sidebar/sq_imagebasket.cpp:244 +msgid "Synchronize" +msgstr "Synchronise" + +#: sidebar/sq_previewwidget.cpp:60 +msgid "Background color..." +msgstr "Background colour..." + +#: sidebar/sq_categorybrowsermenu.cpp:137 +#: sidebar/sq_categorybrowsermenu.cpp:146 +msgid "Failed to Read Folder" +msgstr "Failed to Read Folder" + +#: sidebar/sq_categorybrowsermenu.cpp:154 +msgid "Not Authorized to Read Folder" +msgstr "Not Authorised to Read Folder" + +#: sidebar/sq_categorybrowsermenu.cpp:167 +msgid "Add here" +msgstr "Add here" + +#: sidebar/sq_categorybrowsermenu.cpp:310 +msgid "More..." +msgstr "More..." + +#: sq_thumbnailcachemaster.cpp:143 +msgid "Thumbnail cache" +msgstr "Thumbnail cache" + +#: sq_thumbnailcachemaster.cpp:144 +msgid "Calculate cache size on disk" +msgstr "Calculate cache size on disk" + +#: sq_thumbnailcachemaster.cpp:146 +msgid "Clear cache on disk" +msgstr "Clear cache on disk" + +#: sq_thumbnailcachemaster.cpp:147 +msgid "View memory cache" +msgstr "View memory cache" + +#: sq_thumbnailcachemaster.cpp:148 +msgid "Clear cache in memory" +msgstr "Clear cache in memory" + +#: sq_thumbnailcachemaster.cpp:150 +msgid "Sync cache to disk" +msgstr "Sync cache to disk" + +#: sq_thumbnailcachemaster.cpp:151 +msgid "Calculate cache size in memory" +msgstr "Calculate cache size in memory" + +#: sq_diroperator.cpp:138 +msgid "remote filesystem" +msgstr "remote filesystem" + +#: sq_diroperator.cpp:158 +msgid "" +"
    Mount point:%1
    Total size:%" +"2
    Used:%3
    Available:%4
    " +msgstr "" +"
    Mount point:%1
    Total size:%" +"2
    Used:%3
    Available:%4
    " + +#: sq_diroperator.cpp:245 +msgid "no files selected" +msgstr "no files selected" + +#: sq_diroperator.cpp:306 +msgid "Edit file type" +msgstr "Edit file type" + +#: sq_diroperator.cpp:307 +msgid "Add to Basket" +msgstr "Add to Basket" + +#: sq_diroperator.cpp:309 sq_diroperator.cpp:889 +msgid "File actions" +msgstr "File actions" + +#: sq_diroperator.cpp:327 +msgid "Copy to..." +msgstr "Copy to..." + +#: sq_diroperator.cpp:328 +msgid "Move to..." +msgstr "Move to..." + +#: sq_diroperator.cpp:329 +msgid "Link to..." +msgstr "Link to..." + +#: sq_diroperator.cpp:331 +msgid "Run" +msgstr "Run" + +#: sq_diroperator.cpp:333 +msgid "Recreate selected thumbnails" +msgstr "Recreate selected thumbnails" + +#: sq_diroperator.cpp:336 +msgid "Convert..." +msgstr "Convert..." + +#: sq_diroperator.cpp:439 +msgid "Total %1 in %2 (%3, %4)" +msgstr "Total %1 in %2 (%3, %4)" + +#: sq_diroperator.cpp:441 +msgid "1 item" +msgstr "1 item" + +#: sq_diroperator.cpp:442 +msgid "1 folder" +msgstr "1 folder" + +#: sq_diroperator.cpp:443 +msgid "1 file" +msgstr "1 file" + +#: sq_diroperator.cpp:627 +#, c-format +msgid "Command cannot contain both \"%f\" and \"%F\"" +msgstr "Command cannot contain both \"%f\" and \"%F\"" + +#: sq_diroperator.cpp:627 sq_diroperator.cpp:632 +msgid "Error processing command" +msgstr "Error processing command" + +#: sq_diroperator.cpp:632 +#, c-format +msgid "Command should contain \"%f\" or \"%F\"" +msgstr "Command should contain \"%f\" or \"%F\"" + +#: sq_diroperator.cpp:741 +msgid "Unsupported format \"%1\"" +msgstr "Unsupported format \"%1\"" + +#: sq_diroperator.cpp:886 +msgid "Add to &Category" +msgstr "Add to &Category" + +#: sq_diroperator.cpp:890 +msgid "&External tools" +msgstr "&External tools" + +#: sq_slideshowwidget.cpp:345 +msgid "" +"
    Enter, Escape, Returnstop " +"slideshow
    Pause, Spacepause/unpause " +"slideshow
    Page Upprevious image
    Page Downnext image
    Mshow/hide onscreen messages
    " +msgstr "" +"
    Enter, Escape, Returnstop " +"slideshow
    Pause, Spacepause/unpause " +"slideshow
    Page Upprevious image
    Page Downnext image
    Mshow/hide onscreen messages
    " + +#: sq_codecsettingsskeleton.ui.h:28 +msgid "" +"Error loading widget from %1. Please check your installation or " +"contact ksquirrel.iv@gmail.com" +msgstr "" +"Error loading widget from %1. Please check your installation or " +"contact ksquirrel.iv@gmail.com" + +#: sq_widgetstack.cpp:473 sq_widgetstack.cpp:507 +msgid "No files to copy or move" +msgstr "No files to copy or move" + +#: sq_widgetstack.cpp:607 +msgid "Select a group of files" +msgstr "Select a group of files" + +#: sq_widgetstack.cpp:607 +msgid "Deselect a group of files" +msgstr "Deselect a group of files" + +#: sq_widgetstack.cpp:608 +msgid "Select!" +msgstr "Select!" + +#: sq_widgetstack.cpp:608 +msgid "Deselect!" +msgstr "Deselect!" + +#: sq_filethumbview.cpp:370 +msgid "" +"%3%4" +msgstr "" +"
    File:%1
    Size:%2
    %3%4" + +#: sq_filethumbview.cpp:373 +msgid "" +msgstr "" + +#: imageedit/sq_writeoption.cpp:108 +msgid "RLE compression" +msgstr "RLE compression" + +#: imageedit/sq_writeoption.cpp:109 +msgid "Compression level" +msgstr "Compression level" + +#: imageedit/sq_writeoption.cpp:110 +msgid "Interlaced" +msgstr "Interlaced" + +#: imageedit/sq_writeoption.cpp:112 +msgid "No special options available for this format" +msgstr "No special options available for this format" + +#: imageedit/sq_converter.cpp:47 +msgid "internal error" +msgstr "internal error" + +#: imageedit/sq_converter.cpp:48 +msgid "failed" +msgstr "failed" + +#: imageedit/sq_converter.cpp:50 +msgid "Converting" +msgstr "Converting" + +#: imageedit/sq_converter.cpp:68 +msgid "Select files to edit" +msgstr "Select files to edit" + +#: imageedit/sq_converter.cpp:73 +msgid "" +"Converter cannot work with remote files.\n" +"Sorry" +msgstr "" +"Converter cannot work with remote files.\n" +"Sorry" + +#: imageedit/sq_converter.cpp:160 +msgid "Temporary file creation failed" +msgstr "Temporary file creation failed" + +#: imageedit/sq_converter.cpp:243 sq_imageproperties.ui.h:72 +msgid "1 error" +msgstr "1 error" + +#: imageedit/sq_converter.cpp:250 +msgid "Removing" +msgstr "Removing" + +#: imageedit/sq_converter.cpp:436 +msgid "Convert 1 file" +msgstr "Convert 1 file" + +#: imageedit/sq_imageeditoptions.cpp:134 +msgid "Edit options" +msgstr "Edit options" + +#: imageedit/sq_imageeditoptions.cpp:135 +msgid "New files" +msgstr "New files" + +#: imageedit/sq_imageeditoptions.cpp:136 +msgid "Place here" +msgstr "Place here" + +#: imageedit/sq_imageeditoptions.cpp:137 +msgid "Replace original files" +msgstr "Replace original files" + +#: imageedit/sq_imageeditoptions.cpp:138 +msgid "Place files in current directory, renaming them if necessary" +msgstr "Place files in current directory, renaming them if necessary" + +#: imageedit/sq_imageeditoptions.cpp:139 +msgid "Place files in current directory, replacing existing files" +msgstr "Place files in current directory, replacing existing files" + +#: imageedit/sq_imageeditoptions.cpp:140 +msgid "Close, when all operations succeeded" +msgstr "Close, when all operations succeeded" + +#: imageedit/sq_imagebcg.ui.h:17 imageedit/sq_imagebcg.ui.h:31 +#: imageedit/sq_imagebcg.cpp:382 +msgid "Brightness" +msgstr "Brightness" + +#: imageedit/sq_imagebcg.ui.h:18 imageedit/sq_imagebcg.ui.h:31 +#: imageedit/sq_imagebcg.cpp:383 +msgid "Contrast" +msgstr "Contrast" + +#: imageedit/sq_imagebcg.ui.h:19 imageedit/sq_imagebcg.ui.h:31 +#: imageedit/sq_imagebcg.cpp:384 +msgid "Gamma" +msgstr "Gamma" + +#: imageedit/sq_imagebcg.ui.h:20 imageedit/sq_imagebcg.ui.h:32 +#: imageedit/sq_imagebcg.cpp:390 +msgid "Red" +msgstr "Red" + +#: imageedit/sq_imagebcg.ui.h:20 +msgid "Cyan" +msgstr "Cyan" + +#: imageedit/sq_imagebcg.ui.h:21 imageedit/sq_imagebcg.ui.h:32 +#: imageedit/sq_imagebcg.cpp:389 +msgid "Green" +msgstr "Green" + +#: imageedit/sq_imagebcg.ui.h:21 +msgid "Magenta" +msgstr "Magenta" + +#: imageedit/sq_imagebcg.ui.h:22 imageedit/sq_imagebcg.ui.h:32 +#: imageedit/sq_imagebcg.cpp:388 +msgid "Blue" +msgstr "Blue" + +#: imageedit/sq_imagebcg.ui.h:22 +msgid "Yellow" +msgstr "Yellow" + +#: imageedit/sq_imagefilter.cpp:473 imageedit/sq_imagefilter.cpp:539 +msgid "Filter" +msgstr "Filter" + +#: imageedit/sq_imagefilter.cpp:474 imageedit/sq_imagefilter.cpp:486 +msgid "Color:" +msgstr "Colour:" + +#: imageedit/sq_imagefilter.cpp:476 +msgid "Opacity" +msgstr "Opacity" + +#: imageedit/sq_imagefilter.cpp:477 imageedit/sq_imagefilter.cpp:482 +#: imageedit/sq_imagefilter.cpp:505 +msgid "Sigma" +msgstr "Sigma" + +#: imageedit/sq_imagefilter.cpp:478 imageedit/sq_imagefilter.cpp:481 +#: imageedit/sq_imagefilter.cpp:483 imageedit/sq_imagefilter.cpp:501 +#: imageedit/sq_imagefilter.cpp:506 +msgid "Radius" +msgstr "Radius" + +#: imageedit/sq_imagefilter.cpp:479 imageedit/sq_imagefilter.cpp:492 +#: imageedit/sq_imagefilter.cpp:507 +msgid "Factor" +msgstr "Factor" + +#: imageedit/sq_imagefilter.cpp:480 imageedit/sq_imagefilter.cpp:484 +#: imageedit/sq_imagefilter.cpp:493 imageedit/sq_imagefilter.cpp:514 +msgid "" +"There are no special options available for this filter. Just click \"Filter" +"\"." +msgstr "" +"There are no special options available for this filter. Just click \"Filter" +"\"." + +#: imageedit/sq_imagefilter.cpp:490 +msgid "Color 1:" +msgstr "Colour 1:" + +#: imageedit/sq_imagefilter.cpp:491 +msgid "Color 2:" +msgstr "Colour 2:" + +#: imageedit/sq_imagefilter.cpp:494 +msgid "Noise type" +msgstr "Noise type" + +#: imageedit/sq_imagefilter.cpp:495 +msgid "Uniform" +msgstr "Uniform" + +#: imageedit/sq_imagefilter.cpp:496 +msgid "Impulse" +msgstr "Impulse" + +#: imageedit/sq_imagefilter.cpp:497 +msgid "Multiplicative Gaussian" +msgstr "Multiplicative Gaussian" + +#: imageedit/sq_imagefilter.cpp:498 +msgid "Poisson" +msgstr "Poisson" + +#: imageedit/sq_imagefilter.cpp:499 +msgid "Gaussian" +msgstr "Gaussian" + +#: imageedit/sq_imagefilter.cpp:500 +msgid "Laplacian" +msgstr "Laplacian" + +#: imageedit/sq_imagefilter.cpp:502 +msgid "Color" +msgstr "Colour" + +#: imageedit/sq_imagefilter.cpp:503 +msgid "Elevation" +msgstr "Elevation" + +#: imageedit/sq_imagefilter.cpp:504 +msgid "Azimuth" +msgstr "Azimuth" + +#: imageedit/sq_imagefilter.cpp:508 +msgid "Amount" +msgstr "Amount" + +#: imageedit/sq_imagefilter.cpp:509 +msgid "Type" +msgstr "Type" + +#: imageedit/sq_imagefilter.cpp:510 +msgid "GBR" +msgstr "GBR" + +#: imageedit/sq_imagefilter.cpp:511 +msgid "BRG" +msgstr "BRG" + +#: imageedit/sq_imagefilter.cpp:512 +msgid "Degrees" +msgstr "Degrees" + +#: imageedit/sq_imagefilter.cpp:513 imageedit/sq_imagefilter.cpp:515 +#: imageedit/sq_imagefilter.cpp:536 +msgid "Threshold" +msgstr "Threshold" + +#: imageedit/sq_imagefilter.cpp:517 +msgid "Blend" +msgstr "Blend" + +#: imageedit/sq_imagefilter.cpp:518 +msgid "Blur" +msgstr "Blur" + +#: imageedit/sq_imagefilter.cpp:519 +msgid "Desaturate" +msgstr "Desaturate" + +#: imageedit/sq_imagefilter.cpp:520 +msgid "Despeckle" +msgstr "Despeckle" + +#: imageedit/sq_imagefilter.cpp:521 +msgid "Edge" +msgstr "Edge" + +#: imageedit/sq_imagefilter.cpp:522 +msgid "Emboss" +msgstr "Emboss" + +#: imageedit/sq_imagefilter.cpp:523 +msgid "Equalize" +msgstr "Equalise" + +#: imageedit/sq_imagefilter.cpp:524 +msgid "Fade" +msgstr "Fade" + +#: imageedit/sq_imagefilter.cpp:525 +msgid "Flatten" +msgstr "Flatten" + +#: imageedit/sq_imagefilter.cpp:526 +msgid "Implode" +msgstr "Implode" + +#: imageedit/sq_imagefilter.cpp:527 +msgid "Negative" +msgstr "Negative" + +#: imageedit/sq_imagefilter.cpp:528 +msgid "Noise" +msgstr "Noise" + +#: imageedit/sq_imagefilter.cpp:529 +msgid "Oil" +msgstr "Oil" + +#: imageedit/sq_imagefilter.cpp:530 +msgid "Shade" +msgstr "Shade" + +#: imageedit/sq_imagefilter.cpp:531 +msgid "Sharpen" +msgstr "Sharpen" + +#: imageedit/sq_imagefilter.cpp:532 +msgid "Solarize" +msgstr "Solarise" + +#: imageedit/sq_imagefilter.cpp:533 +msgid "Spread" +msgstr "Spread" + +#: imageedit/sq_imagefilter.cpp:534 +msgid "Swap colors" +msgstr "Swap colours" + +#: imageedit/sq_imagefilter.cpp:535 +msgid "Swirl" +msgstr "Swirl" + +#: imageedit/sq_imagefilter.cpp:537 +msgid "Grayscale" +msgstr "Greyscale" + +#: imageedit/sq_imagefilter.cpp:538 +msgid "Redeye" +msgstr "Redeye" + +#: imageedit/sq_imagefilter.cpp:541 +msgid "Image after filtering:" +msgstr "Image after filtering:" + +#: imageedit/sq_imagefilter.cpp:542 imageedit/sq_imagebcg.cpp:397 +msgid "Original image:" +msgstr "Original image:" + +#: imageedit/sq_imagebcg.cpp:378 +msgid "Color balance" +msgstr "Colour balance" + +#: imageedit/sq_imagebcg.cpp:394 +msgid "Colorize" +msgstr "Colourise" + +#: imageedit/sq_imagebcg.cpp:396 +msgid "Image after colorizing:" +msgstr "Image after colourising:" + +#: imageedit/sq_imageconvert.cpp:167 +msgid "Convert" +msgstr "Convert" + +#: imageedit/sq_imageconvert.cpp:172 +msgid "Conversion options" +msgstr "Conversion options" + +#: sq_viewcache.cpp:49 sq_viewcache.cpp:107 +msgid "Parameters" +msgstr "Parameters" + +#: sq_viewcache.cpp:103 +msgid "Memory cache" +msgstr "Memory cache" + +#: sq_viewcache.cpp:108 +msgid "Total:" +msgstr "Total:" + +#: sq_imageproperties.ui.h:29 +msgid "Copy entry" +msgstr "Copy entry" + +#: sq_imageproperties.ui.h:30 +msgid "Copy all entries" +msgstr "Copy all entries" + +#: sq_imageproperties.ui.h:95 +msgid "EXIF" +msgstr "EXIF" + +#: sq_imageproperties.ui.h:105 +msgid "Simple" +msgstr "Simple" + +#: sq_imageproperties.ui.h:108 +msgid "Full" +msgstr "Full" + +#: sq_imageproperties.ui.h:127 +msgid "EXIF (no)" +msgstr "EXIF (no)" + +#: sq_imageproperties.ui.h:177 +msgid "Metadata (no)" +msgstr "Metadata (no)" + +#: _translatorinfo.cpp:1 +msgid "" +"_: NAME OF TRANSLATORS\n" +"Your names" +msgstr "Malcolm Hunter" + +#: _translatorinfo.cpp:3 +msgid "" +"_: EMAIL OF TRANSLATORS\n" +"Your emails" +msgstr "malcolm.hunter@gmx.co.uk" + +#: sq_glwidget.cpp:233 +msgid "Rectangle" +msgstr "Rectangle" + +#: sq_glwidget.cpp:234 +msgid "Ellipse" +msgstr "Ellipse" + +#: sq_glwidget.cpp:239 +msgid "Fit width" +msgstr "Fit width" + +#: sq_glwidget.cpp:240 +msgid "Fit height" +msgstr "Fit height" + +#: sq_glwidget.cpp:241 +msgid "Fit image" +msgstr "Fit image" + +#: sq_glwidget.cpp:242 +msgid "Zoom 100%" +msgstr "Zoom 100%" + +#: sq_glwidget.cpp:243 +msgid "Leave previous zoom" +msgstr "Leave previous zoom" + +#: sq_glwidget.cpp:244 +msgid "Ignore, if image is smaller than window" +msgstr "Ignore, if image is smaller than window" + +#: sq_glwidget.cpp:318 +msgid "Go to first image" +msgstr "Go to first image" + +#: sq_glwidget.cpp:319 +msgid "Previous image" +msgstr "Previous image" + +#: sq_glwidget.cpp:321 +msgid "Next image" +msgstr "Next image" + +#: sq_glwidget.cpp:323 +msgid "Go to last image" +msgstr "Go to last image" + +#: sq_glwidget.cpp:326 sq_glwidget.cpp:2685 +msgid "Zoom +" +msgstr "Zoom +" + +#: sq_glwidget.cpp:328 sq_glwidget.cpp:2686 +msgid "Zoom -" +msgstr "Zoom -" + +#: sq_glwidget.cpp:332 sq_glwidget.cpp:2677 +msgid "Rotate left" +msgstr "Rotate left" + +#: sq_glwidget.cpp:334 sq_glwidget.cpp:2678 +msgid "Rotate right" +msgstr "Rotate right" + +#: sq_glwidget.cpp:336 sq_glwidget.cpp:2707 +msgid "Flip vertically" +msgstr "Flip vertically" + +#: sq_glwidget.cpp:338 sq_glwidget.cpp:2708 +msgid "Flip horizontally" +msgstr "Flip horizontally" + +#: sq_glwidget.cpp:340 +msgid "Normalize" +msgstr "Normalise" + +#: sq_glwidget.cpp:342 sq_glwidget.cpp:2723 +msgid "Fullscreen" +msgstr "Fullscreen" + +#: sq_glwidget.cpp:344 +msgid "Select image" +msgstr "Select image" + +#: sq_glwidget.cpp:346 +msgid "Selection" +msgstr "Selection" + +#: sq_glwidget.cpp:348 sq_glwidget.cpp:2717 sq_codecsettingsskeleton.cpp:128 +msgid "Codec settings" +msgstr "Codec settings" + +#: sq_glwidget.cpp:351 +msgid "Show navigator" +msgstr "Show navigator" + +#: sq_glwidget.cpp:1024 +msgid "yes" +msgstr "yes" + +#: sq_glwidget.cpp:1024 +msgid "no" +msgstr "no" + +#: sq_glwidget.cpp:1485 +msgid "Codec for %1 format not found" +msgstr "Codec for %1 format not found" + +#: sq_glwidget.cpp:1729 +msgid "Memory allocation failed for %1 of memory" +msgstr "Memory allocation failed for %1 of memory" + +#: sq_glwidget.cpp:1741 +msgid "Memory allocation failed" +msgstr "Memory allocation failed" + +#: sq_glwidget.cpp:1747 +msgid "Decoding failed" +msgstr "Decoding failed" + +#: sq_glwidget.cpp:1849 +msgid " ms." +msgstr " ms." + +#: sq_glwidget.cpp:2363 +msgid "" +"Sorry, could not perform write operation\n" +"for codec \"%1\"" +msgstr "" +"Sorry, could not perform write operation\n" +"for codec \"%1\"" + +#: sq_glwidget.cpp:2382 sq_glwidget.cpp:2390 sq_glwidget.cpp:2412 +msgid "Error writing image" +msgstr "Error writing image" + +#: sq_glwidget.cpp:2433 +msgid "Try another location?" +msgstr "Try another location?" + +#: sq_glwidget.cpp:2658 +msgid "Rotate" +msgstr "Rotate" + +#: sq_glwidget.cpp:2661 sq_options.cpp:803 +msgid "Window" +msgstr "Window" + +#: sq_glwidget.cpp:2670 +msgid "Next" +msgstr "Next" + +#: sq_glwidget.cpp:2671 +msgid "Previous" +msgstr "Previous" + +#: sq_glwidget.cpp:2672 +msgid "First" +msgstr "First" + +#: sq_glwidget.cpp:2673 +msgid "Last" +msgstr "Last" + +#: sq_glwidget.cpp:2680 +msgid "Rotate 180'" +msgstr "Rotate 180°" + +#: sq_glwidget.cpp:2682 +msgid "Rotate 1' left" +msgstr "Rotate 1° left" + +#: sq_glwidget.cpp:2683 +msgid "Rotate 1' right" +msgstr "Rotate 1° right" + +#: sq_glwidget.cpp:2687 +msgid "Zoom 2x" +msgstr "Zoom 2x" + +#: sq_glwidget.cpp:2688 +msgid "Zoom 1/2x" +msgstr "Zoom 1/2x" + +#: sq_glwidget.cpp:2698 +msgid "Move left" +msgstr "Move left" + +#: sq_glwidget.cpp:2699 +msgid "Move right" +msgstr "Move right" + +#: sq_glwidget.cpp:2700 +msgid "Move up" +msgstr "Move up" + +#: sq_glwidget.cpp:2701 +msgid "Move down" +msgstr "Move down" + +#: sq_glwidget.cpp:2703 +msgid "Start/stop animation" +msgstr "Start/stop animation" + +#: sq_glwidget.cpp:2704 +msgid "Hide/show background" +msgstr "Hide/show background" + +#: sq_glwidget.cpp:2705 +msgid "Hide/show tickmarks" +msgstr "Hide/show tickmarks" + +#: sq_glwidget.cpp:2710 +msgid "First page" +msgstr "First page" + +#: sq_glwidget.cpp:2711 +msgid "Previous page" +msgstr "Previous page" + +#: sq_glwidget.cpp:2712 +msgid "Next page" +msgstr "Next page" + +#: sq_glwidget.cpp:2713 +msgid "Last page" +msgstr "Last page" + +#: sq_glwidget.cpp:2715 +msgid "To clipboard" +msgstr "To clipboard" + +#: sq_glwidget.cpp:2720 +msgid "Color balance..." +msgstr "Colour balance..." + +#: sq_glwidget.cpp:2721 +msgid "Apply filter..." +msgstr "Apply filter..." + +#: sq_glwidget.cpp:2724 +msgid "Hide/show toolbar" +msgstr "Hide/show toolbar" + +#: sq_glwidget.cpp:2725 +msgid "Hide/show statusbar" +msgstr "Hide/show statusbar" + +#: sq_glwidget.cpp:2728 +msgid "Reset" +msgstr "Reset" + +#: sq_glwidget.cpp:2731 sq_helpwidget.cpp:174 +msgid "Hotkeys" +msgstr "Hotkeys" + +#: sq_glview.cpp:84 +msgid "Loading time" +msgstr "Loading time" + +#: sq_options.cpp:746 +msgid "The main options" +msgstr "The main options" + +#: sq_options.cpp:748 +msgid "Write configuration file to disk, when I press \"OK\"" +msgstr "Write configuration file to disk, when I press \"OK\"" + +#: sq_options.cpp:749 +msgid "Minimize to tray after closing" +msgstr "Minimise to tray after closing" + +#: sq_options.cpp:750 +msgid "Show splash screen at startup" +msgstr "Show splash screen at startup" + +#: sq_options.cpp:751 +msgid "Don't show animated logo in toolbar" +msgstr "Don't show animated logo in toolbar" + +#: sq_options.cpp:752 +msgid "Apply codec settings to" +msgstr "Apply codec settings to" + +#: sq_options.cpp:753 +msgid "Thumbnail loader" +msgstr "Thumbnail loader" + +#: sq_options.cpp:754 +msgid "Image viewer (also preview window)" +msgstr "Image viewer (also preview window)" + +#: sq_options.cpp:755 sq_options.cpp:773 +msgid "Both" +msgstr "Both" + +#: sq_options.cpp:756 +msgid "RunTime" +msgstr "RunTime" + +#: sq_options.cpp:757 +msgid "Treat unknown mime types as unsupported" +msgstr "Treat unknown mime types as unsupported" + +#: sq_options.cpp:758 +msgid "Load KIPI plugins on demand (for slow machines)" +msgstr "Load KIPI plugins on demand (for slow machines)" + +#: sq_options.cpp:759 +msgid "Disk navigator" +msgstr "Disk navigator" + +#: sq_options.cpp:760 +msgid "On starting open..." +msgstr "On starting open..." + +#: sq_options.cpp:762 +msgid "Custom directory:" +msgstr "Custom directory:" + +#: sq_options.cpp:763 +msgid "Last visited directory" +msgstr "Last visited directory" + +#: sq_options.cpp:764 +msgid "Current directory, where KSquirrel starts" +msgstr "Current directory, where KSquirrel starts" + +#: sq_options.cpp:765 +msgid "Run unknown file formats separately (with default application)" +msgstr "Run unknown file formats separately (with default application)" + +#: sq_options.cpp:767 +msgid "Save history" +msgstr "Save history" + +#: sq_options.cpp:768 +msgid "Jump into archives" +msgstr "Jump into archives" + +#: sq_options.cpp:769 +msgid "Jump to first image" +msgstr "Jump to first image" + +#: sq_options.cpp:770 +msgid "Don't show directories" +msgstr "Don't show directories" + +#: sq_options.cpp:771 +msgid "Main" +msgstr "Main" + +#: sq_options.cpp:772 +msgid "Synchronization" +msgstr "Synchronisation" + +#: sq_options.cpp:774 +msgid "Tree -> Navigator" +msgstr "Tree -> Navigator" + +#: sq_options.cpp:775 +msgid "Tree <- Navigator" +msgstr "Tree <- Navigator" + +#: sq_options.cpp:776 +msgid "Clicking" +msgstr "Clicking" + +#: sq_options.cpp:777 +msgid "Thumbnails" +msgstr "Thumbnails" + +#: sq_options.cpp:779 +msgid "Do not write thumbnails on disk" +msgstr "Do not write thumbnails on disk" + +#: sq_options.cpp:780 +msgid "Show tooltips with file information" +msgstr "Show tooltips with file information" + +#: sq_options.cpp:781 +msgid "Margin between thumbnails" +msgstr "Margin between thumbnails" + +#: sq_options.cpp:782 sq_options.cpp:815 +msgid " pixels" +msgstr " pixels" + +#: sq_options.cpp:783 +msgid "Don't show tooltips when the main window is inactive" +msgstr "Don't show tooltips when the main window is inactive" + +#: sq_options.cpp:784 +msgid "Mark supported image formats with clock icon (slow)" +msgstr "Mark supported image formats with clock icon (slow)" + +#: sq_options.cpp:785 +msgid "Maximum cache size (in memory)" +msgstr "Maximum cache size (in memory)" + +#: sq_options.cpp:786 +msgid " Kb" +msgstr " Kb" + +#: sq_options.cpp:787 +msgid "No cache" +msgstr "No cache" + +#: sq_options.cpp:788 +msgid "On scroll event" +msgstr "On scroll event" + +#: sq_options.cpp:789 +msgid "Zoom the scene" +msgstr "Zoom the scene" + +#: sq_options.cpp:790 +msgid "Load next/previous file" +msgstr "Load next/previous file" + +#: sq_options.cpp:791 +msgid "Background" +msgstr "Background" + +#: sq_options.cpp:792 +msgid "Custom texture" +msgstr "Custom texture" + +#: sq_options.cpp:793 +msgid "Custom color" +msgstr "Custom colour" + +#: sq_options.cpp:794 +msgid "System color" +msgstr "System colour" + +#: sq_options.cpp:798 +msgid "Validate" +msgstr "Validate" + +#: sq_options.cpp:802 +msgid "Show images progressively" +msgstr "Show images progressively" + +#: sq_options.cpp:804 +msgid "Image pages" +msgstr "Image pages" + +#: sq_options.cpp:805 +msgid "Load all pages" +msgstr "Load all pages" + +#: sq_options.cpp:806 +msgid "Load only first page" +msgstr "Load only first page" + +#: sq_options.cpp:807 +msgid "Load no more than" +msgstr "Load no more than" + +#: sq_options.cpp:808 +msgid " pages" +msgstr " pages" + +#: sq_options.cpp:809 +msgid "Loader" +msgstr "Loader" + +#: sq_options.cpp:810 +msgid "Draw tickmarks around the image" +msgstr "Draw tickmarks around the image" + +#: sq_options.cpp:811 +msgid "Draw background for transparent images" +msgstr "Draw background for transparent images" + +#: sq_options.cpp:812 +msgid "Rotating" +msgstr "Rotating" + +#: sq_options.cpp:813 +msgid " degrees" +msgstr " degrees" + +#: sq_options.cpp:814 sq_helpwidget.cpp:183 +msgid "Moving" +msgstr "Moving" + +#: sq_options.cpp:817 +msgid "Zoom limit" +msgstr "Zoom limit" + +#: sq_options.cpp:818 +msgid "Minimum: 1%, maximum: 10,000%" +msgstr "Minimum: 1%, maximum: 10,000%" + +#: sq_options.cpp:819 +msgid "Custom" +msgstr "Custom" + +#: sq_options.cpp:821 +msgid "minimum" +msgstr "minimum" + +#: sq_options.cpp:822 sq_options.cpp:824 +msgid " %" +msgstr " %" + +#: sq_options.cpp:823 +msgid "maximum" +msgstr "maximum" + +#: sq_options.cpp:825 +msgid "No limit" +msgstr "No limit" + +#: sq_options.cpp:826 +msgid "Zoom coefficient" +msgstr "Zoom coefficient" + +#: sq_options.cpp:827 +msgid "%" +msgstr "%" + +#: sq_options.cpp:828 +msgid "None" +msgstr "None" + +#: sq_options.cpp:830 +msgid "Customize OpenGL widget" +msgstr "Customise OpenGL widget" + +#: sq_options.cpp:831 +msgid "Recursion" +msgstr "Recursion" + +#: sq_options.cpp:832 +msgid "No recursion" +msgstr "No recursion" + +#: sq_options.cpp:833 +msgid "Show number of files" +msgstr "Show number of files" + +#: sq_options.cpp:834 +msgid "Show number of subfolders and files" +msgstr "Show number of subfolders and files" + +#: sq_options.cpp:835 +msgid "Show number of subfolders" +msgstr "Show number of subfolders" + +#: sq_options.cpp:836 +msgid "Treeview" +msgstr "Treeview" + +#: sq_options.cpp:837 +msgid "Show device path" +msgstr "Show device path" + +#: sq_options.cpp:838 +msgid "Show mount options" +msgstr "Show mount options" + +#: sq_options.cpp:839 +msgid "Show filesystem type" +msgstr "Show filesystem type" + +#: sq_options.cpp:840 +msgid "Mount view" +msgstr "Mount view" + +#: sq_options.cpp:841 +msgid "Enable preview window" +msgstr "Enable preview window" + +#: sq_options.cpp:843 +msgid "Delay before image loading" +msgstr "Delay before image loading" + +#: sq_options.cpp:844 sq_slideshow.cpp:218 +msgid " ms" +msgstr " ms" + +#: sq_options.cpp:845 +msgid "Background color for preview widget:" +msgstr "Background colour for preview widget:" + +#: sq_options.cpp:847 +msgid "Don't load preview image on file execution" +msgstr "Don't load preview image on file execution" + +#: sq_options.cpp:848 +msgid "Disables loading preview image when user launches image with mouse" +msgstr "Disables loading preview image when user launches image with mouse" + +#: sq_options.cpp:849 +msgid "Image preview" +msgstr "Image preview" + +#: sq_options.cpp:850 +msgid "Sidebar settings" +msgstr "Sidebar settings" + +#: sq_options.cpp:851 +msgid "KIPI Configuration" +msgstr "KIPI Configuration" + +#: sq_slideshow.cpp:205 +msgid "Slideshow options" +msgstr "Slideshow options" + +#: sq_slideshow.cpp:206 +msgid "Start" +msgstr "Start" + +#: sq_slideshow.cpp:209 +msgid "Set directory to current" +msgstr "Set directory to current" + +#: sq_slideshow.cpp:210 +msgid "Last visited directories" +msgstr "Last visited directories" + +#: sq_slideshow.cpp:220 +msgid "Repeats:" +msgstr "Repeats:" + +#: sq_slideshow.cpp:221 +msgid "Background color:" +msgstr "Background colour:" + +#: sq_slideshow.cpp:222 +msgid "Onscreen messages" +msgstr "Onscreen messages" + +#: sq_slideshow.cpp:223 +msgid "Show current index" +msgstr "Show current index" + +#: sq_slideshow.cpp:224 +msgid "Show file name" +msgstr "Show file name" + +#: sq_slideshow.cpp:225 +msgid "Show file size" +msgstr "Show file size" + +#: sq_slideshow.cpp:226 +msgid "Recursively" +msgstr "Recursively" + +#: ksquirrel.cpp:288 +msgid "Clear history" +msgstr "Clear history" + +#: ksquirrel.cpp:289 +msgid "Clear address" +msgstr "Clear address" + +#: ksquirrel.cpp:294 +msgid "Go!" +msgstr "Go!" + +#: ksquirrel.cpp:341 +msgid "Libraries' filters" +msgstr "Libraries' filters" + +#: ksquirrel.cpp:364 +msgid "All supported formats" +msgstr "All supported formats" + +#: ksquirrel.cpp:374 +msgid "User's filters" +msgstr "User's filters" + +#: ksquirrel.cpp:510 +msgid "Folder tree" +msgstr "Folder tree" + +#: ksquirrel.cpp:511 +msgid "Mount points" +msgstr "Mount points" + +#: ksquirrel.cpp:628 +msgid "&Navigator" +msgstr "&Navigator" + +#: ksquirrel.cpp:630 +msgid "&Action" +msgstr "&Action" + +#: ksquirrel.cpp:633 +msgid "&KIPI Plugins" +msgstr "&KIPI Plugins" + +#: ksquirrel.cpp:661 +msgid "Fi<er" +msgstr "Fi<er" + +#: ksquirrel.cpp:720 +msgid "Thumbnail size" +msgstr "Thumbnail size" + +#: ksquirrel.cpp:723 sq_options.ui.h:137 +msgid "Image window" +msgstr "Image window" + +#: ksquirrel.cpp:725 +msgid "Reload codecs from disk" +msgstr "Reload codecs from disk" + +#: ksquirrel.cpp:726 +msgid "Configure external tools..." +msgstr "Configure external tools..." + +#: ksquirrel.cpp:727 +msgid "Configure filters..." +msgstr "Configure filters..." + +#: ksquirrel.cpp:728 +msgid "Go to tray" +msgstr "Go to tray" + +#: ksquirrel.cpp:729 +msgid "Open file and change directory" +msgstr "Open file and change directory" + +#: ksquirrel.cpp:730 +msgid "Open file" +msgstr "Open file" + +#: ksquirrel.cpp:731 +msgid "Thumbnail cache manager..." +msgstr "Thumbnail cache manager..." + +#: ksquirrel.cpp:735 +msgid "List" +msgstr "List" + +#: ksquirrel.cpp:736 +msgid "Icons" +msgstr "Icons" + +#: ksquirrel.cpp:737 +msgid "Details" +msgstr "Details" + +#: ksquirrel.cpp:738 sq_options.ui.h:136 +msgid "Thumbnails" +msgstr "Thumbnails" + +#: ksquirrel.cpp:740 +msgid "Show URL box" +msgstr "Show URL box" + +#: ksquirrel.cpp:742 +msgid "Built-in image window" +msgstr "Built-in image window" + +#: ksquirrel.cpp:745 +msgid "Slideshow" +msgstr "Slideshow" + +#: ksquirrel.cpp:746 +msgid "Slideshow advanced" +msgstr "Slideshow advanced" + +#: ksquirrel.cpp:748 +msgid "Codec information..." +msgstr "Codec information..." + +#: ksquirrel.cpp:749 +msgid "OpenGL information..." +msgstr "OpenGL information..." + +#: ksquirrel.cpp:751 +msgid "Medium thumbnails" +msgstr "Medium thumbnails" + +#: ksquirrel.cpp:752 +msgid "Large thumbnails" +msgstr "Large thumbnails" + +#: ksquirrel.cpp:753 +msgid "Huge thumbnails" +msgstr "Huge thumbnails" + +#: ksquirrel.cpp:755 +msgid "Select group" +msgstr "Select group" + +#: ksquirrel.cpp:756 +msgid "Deselect group" +msgstr "Deselect group" + +#: ksquirrel.cpp:776 +msgid "Extended thumbnails" +msgstr "Extended thumbnails" + +#: ksquirrel.cpp:1085 +msgid " writing settings and thumbnails... " +msgstr " writing settings and thumbnails... " + +#: sq_filters.cpp:124 sq_filters.cpp:197 +msgid "Extensions" +msgstr "Extensions" + +#: sq_filters.cpp:181 +msgid "Adjust filters" +msgstr "Adjust filters" + +#: sq_filters.cpp:186 +msgid "New filter" +msgstr "New filter" + +#: sq_filters.cpp:193 +msgid "Move filter up" +msgstr "Move filter up" + +#: sq_filters.cpp:195 +msgid "Move filter down" +msgstr "Move filter down" + +#: sq_filters.cpp:198 +msgid "Menu item contains both name and extension" +msgstr "Menu item contains both name and extension" + +#: sq_helpwidget.cpp:175 +msgid "" +"

    File:%1
    Size:%2
    Link destination:%1
    Link destination:%1

    Esc,X,Return

    close

    Middle click, F

    fullscreen

    Z

    show " +"'Zoom' menu

    /

    show this " +"help

    Right click, M, ContextMenu

    show context menu

    N

    toggle filter

    Shift + Left button

    select a region

    Shift + " +"Left

    previous tab

    Shift + " +"Right

    next tab

    W

    close tab

    " +msgstr "" +"

    Esc,X,Return

    close

    Middle click, F

    fullscreen

    Z

    show " +"'Zoom' menu

    /

    show this " +"help

    Right click, M, ContextMenu

    show context menu

    N

    toggle filter

    Shift + Left button

    select a region

    Shift + " +"Left

    previous tab

    Shift + " +"Right

    next tab

    W

    close tab

    " + +#: sq_helpwidget.cpp:176 +msgid "" +"

    Space, Page Down

    next image

    Backspace, Page Up

    previous image

    Home

    first image

    End

    last image

    " +msgstr "" +"

    Space, Page Down

    next image

    Backspace, Page Up

    previous image

    Home

    first image

    End

    last image

    " + +#: sq_helpwidget.cpp:177 +msgid "" +"

    " +msgstr "" +"

    Left, Right, Up, Down

    move the image

    Ctrl + Left

    rotate left

    Ctrl + Right

    rotate right

    Ctrl + Up/" +"Down

    rotate for 180 degrees up/down

    Alt + Left/Right

    rotate for 1 degree left/right
    " + +#: sq_helpwidget.cpp:178 +msgid "" +"

    Left, Right, Up, Down

    move the image

    Ctrl + Left

    rotate left

    Ctrl + Right

    rotate right

    Ctrl + Up/" +"Down

    rotate for 180 degrees up/down

    Alt + Left/Right

    rotate for 1 degree left/right
    " +msgstr "" +"

    +/-

    zoom " +"Nx

    Ctrl + +/-

    zoom " +"2x/0.5x

    Scroll

    load next/" +"prev file OR zoom+/zoom-

    Shift + Scroll

    zoom+/zoom-

    Ctrl + Scroll

    zoom+ 2x/zoom- 2x

    1..9

    zoom 1..9x

    0

    zoom 10x

    comma

    fit " +"width

    period

    fit height

    *

    fit image
    " + +#: sq_helpwidget.cpp:179 +msgid "" +"

    +/-

    zoom " +"Nx

    Ctrl + +/-

    zoom " +"2x/0.5x

    Scroll

    load next/" +"prev file OR zoom+/zoom-

    Shift + Scroll

    zoom+/zoom-

    Ctrl + Scroll

    zoom+ 2x/zoom- 2x

    1..9

    zoom 1..9x

    0

    zoom 10x

    comma

    fit " +"width

    period

    fit height

    *

    fit image
    " +"

    S

    save as

    V

    flip vertically

    H

    flip horizontally

    R

    reset

    P

    image properties

    C

    codec settings

    L

    ignore zoom if image is smaller than " +"window

    I

    menu with " +"images

    A

    stop/start " +"animation

    B

    toggle " +"drawing background for transparent images

    K

    toggle drawing tickmarks

    E

    show menu with external " +"tools

    Y

    crop

    F1

    first image in " +"multi-paged image

    F2

    previous

    F3

    next

    F4

    last
    " +msgstr "" +"

    " +"

    S

    save as

    V

    flip vertically

    H

    flip horizontally

    R

    reset

    P

    image properties

    C

    codec settings

    L

    ignore zoom if image is smaller than " +"window

    I

    menu with " +"images

    A

    stop/start " +"animation

    B

    toggle " +"drawing background for transparent images

    K

    toggle drawing tickmarks

    E

    show menu with external " +"tools

    Y

    crop

    F1

    first image in " +"multi-paged image

    F2

    previous

    F3

    next

    F4

    last
    " + +#: sq_helpwidget.cpp:182 sq_options.ui.h:135 +msgid "Filing" +msgstr "Filing" + +#: sq_helpwidget.cpp:184 +msgid "Current image" +msgstr "Current image" + +#: sq_options.ui.h:138 +msgid "Sidebar" +msgstr "Sidebar" + +#: sq_options.ui.h:141 +msgid "KIPI" +msgstr "KIPI" + +#: sq_options.ui.h:260 +msgid "Wrong dimensions: %1x%2." +msgstr "Wrong dimensions: %1x%2." + +#: sq_slideshowlisting.cpp:87 +msgid "Listing" +msgstr "Listing" + +#: ksquirrel.cpp:751 +msgid "Rename" +msgstr "Rename" + +#: ksquirrel.cpp:1951 +msgid "Renaming File" +msgstr "Renaming File" + +#: ksquirrel.cpp:1952 +msgid "

    Rename file %1 to:

    " +msgstr "

    Rename file %1 to:

    " + +msgid "Calculate directory size" +msgstr "Calculate directory size" + +msgid "New folder..." +msgstr "New folder..." + +msgid "Create Subfolder" +msgstr "Create Subfolder" + +msgid "

    Create new folder in %1:

    " +msgstr "

    Create new folder in %1:

    " + +msgid "Rename Folder" +msgstr "Rename Folder" + +msgid "

    Rename folder %1 to:

    " +msgstr "

    Rename folder %1 to:

    " + +msgid "Are you sure you want to delete %1?" +msgstr "Are you sure you want to delete %1?" + +msgid "Copy to last folder" +msgstr "Copy to last folder" + +msgid "Move to last folder" +msgstr "Move to last folder" + +msgid "Message text color:" +msgstr "Message text colour:" + +msgid "Total" +msgstr "Total" + +msgid "Visualize drag operation" +msgstr "Visualise drag operation" + +msgid "Testing" +msgstr "Testing" + +msgid "Lazy thumbnail generation" +msgstr "Lazy thumbnail generation" + +msgid "Delay" +msgstr "Delay" + +msgid "Interface" +msgstr "Interface" + +msgid "Number of text lines" +msgstr "Number of text lines" + +msgid "Show file preview" +msgstr "Show file preview" + +msgid "Number of additionally generated rows" +msgstr "Number of additionally generated rows" + +msgid "Repeat (copy to %1)" +msgstr "Repeat (copy to %1)" + +msgid "Repeat (move to %1)" +msgstr "Repeat (move to %1)" + +msgid "Repeat (link to %1)" +msgstr "Repeat (link to %1)" + +msgid "Repeat (nothing to repeat)" +msgstr "Repeat (nothing to repeat)" + +msgid "Clear contents" +msgstr "Clear contents" + +msgid "Are you sure you want to delete contents of %1?" +msgstr "Are you sure you want to delete contents of %1?" + +msgid "Add to Folder Basket" +msgstr "Add to Folder Basket" + +msgid "Folder basket" +msgstr "Folder basket" + +msgid "Change icon" +msgstr "Change icon" + +msgid "

    Rename item %1 to:

    " +msgstr "

    Rename item %1 to:

    " + +msgid "Copy file path" +msgstr "Copy file path" + +msgid "Copy file url" +msgstr "Copy file url" + +msgid "Text color:" +msgstr "Text colour:" + +msgid "Show image dimensions" +msgstr "Show image dimensions" + +msgid "Text color..." +msgstr "Text colour..." + +msgid "Double click" +msgstr "Double click" + +msgid "Close window" +msgstr "Close window" + +msgid "Crop" +msgstr "Crop" + +msgid "Tabs" +msgstr "Tabs" + +msgid "Enable tabs" +msgstr "Enable tabs" + +msgid "Ask what to do when opening new image" +msgstr "Ask what to do when opening new image" + +msgid "Show close buttons" +msgstr "Show close buttons" + +msgid "Open in a new tab" +msgstr "Open in a new tab" + +msgid "Replace current tab" +msgstr "Replace current tab" + +msgid "Close all and open in a new tab" +msgstr "Close all and open in a new tab" + +msgid "Opening..." +msgstr "Opening..." + +msgid "Previous tab" +msgstr "Previous tab" + +msgid "Next tab" +msgstr "Next tab" + +msgid "Close tab" +msgstr "Close tab" + +msgid "Do nothing" +msgstr "Do nothing" + +msgid "Print available DCOP parameters" +msgstr "Print available DCOP parameters" + +msgid "Close all opened images when closing window" +msgstr "Close all opened images when closing window" + +msgid "Select codecs to delete:" +msgstr "Select codecs to delete:" + +msgid "Codec manager..." +msgstr "Codec manager..." + +msgid "Select codecs to disable:" +msgstr "Select codecs to disable:" + +msgid "Select codecs to enable:" +msgstr "Select codecs to enable:" diff --git a/po/it.po b/po/it.po new file mode 100644 index 0000000..537d7ed --- /dev/null +++ b/po/it.po @@ -0,0 +1,2137 @@ +# translation of ksquirrel.po to English +# translation of ksquirrel.po from English to Italian +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# +# Martino Barbon , 2007. +msgid "" +msgstr "" +"Project-Id-Version: ksquirrel\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2007-08-07 09:34+0300\n" +"PO-Revision-Date: 2007-11-09 10:47+0000\n" +"Last-Translator: Martino Barbon \n" +"Language-Team: English \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: KBabel 1.11.4\n" + +#: sq_filters.ui.h:56 sq_filters.ui.h:58 sq_externaltools.cpp:67 +#: sq_externaltools.cpp:194 sidebar/sq_mountview.cpp:64 sq_viewcache.cpp:47 +#: sq_viewcache.cpp:105 sq_filters.cpp:123 sq_filters.cpp:196 +msgid "Name" +msgstr "Nome" + +#: sq_externaltool.cpp:102 sq_externaltool.cpp:162 sq_externaltool.cpp:170 +msgid "No file selected" +msgstr "Nessun file selezionato" + +#: sq_kipimanager.cpp:68 +msgid "No Plugins" +msgstr "Nessun Plugin" + +#: sq_kipimanager.cpp:125 +msgid "Image actions" +msgstr "Azioni immagine" + +#: sq_kipimanager.cpp:126 +msgid "Effects" +msgstr "Effetti" + +#: sq_kipimanager.cpp:127 +msgid "Tools" +msgstr "Strumenti" + +#: sq_kipimanager.cpp:130 +msgid "Batch processing" +msgstr "Elaborazione non interattiva" + +#: sq_kipimanager.cpp:131 +msgid "Collections" +msgstr "Collezioni" + +#: sq_libraryhandler.cpp:148 +msgid "All files" +msgstr "Tutti i file" + +#: sq_navigatordropmenu.cpp:40 +msgid "Copy here" +msgstr "Copia qui" + +#: sq_navigatordropmenu.cpp:43 +msgid "Move here" +msgstr "Sposta qui" + +#: sq_navigatordropmenu.cpp:46 +msgid "Link here" +msgstr "Collega qui" + +#: sq_glinfo.cpp:45 sq_glinfo.cpp:92 +msgid "Parameter" +msgstr "Parametro" + +#: sq_glinfo.cpp:46 sq_glinfo.cpp:93 sq_imageproperties.cpp:321 +#: sq_imageproperties.cpp:408 imageedit/sq_imagefilter.cpp:487 +msgid "Value" +msgstr "Valore" + +#: sq_glinfo.cpp:91 +msgid "OpenGL information" +msgstr "Informazione OpenGL" + +#: sq_externaltools.cpp:66 sq_externaltools.cpp:193 +msgid "Pixmap" +msgstr "Pixmap" + +#: sq_externaltools.cpp:68 sq_externaltools.cpp:195 +msgid "Command" +msgstr "Comando" + +#: sq_externaltools.cpp:190 +msgid "Adjust external tools" +msgstr "Regola strumenti esterni" + +#: sq_externaltools.cpp:192 sq_filters.cpp:182 +msgid " OK " +msgstr " OK " + +#: sq_externaltools.cpp:196 sq_externaltools.ui.h:146 +#, c-format +msgid "Command can contain
    • %f: one file
    • %F: multiple files
    " +msgstr "Il comando può contenere
    • %f: un file
    • %F: molti file
    " + +#: sq_externaltools.cpp:199 +msgid "New tool" +msgstr "Nuovo strumento" + +#: sq_externaltools.cpp:206 +msgid "Move tool up" +msgstr "Alza strumento" + +#: sq_externaltools.cpp:208 +msgid "Move tool down" +msgstr "Abbassa strumento" + +#: sq_kipiinterface.cpp:72 +msgid "Root directory" +msgstr "Cartella root" + +#: sq_kipiinterface.cpp:144 +msgid "Folder content" +msgstr "Contenuto della cartella" + +#: sq_kipiinterface.cpp:161 +msgid "Selected images" +msgstr "Immagini selezionate" + +#: sq_kipiinterface.cpp:175 ksquirrel.cpp:513 +msgid "Image basket" +msgstr "Cestino immagini" + +#: main.cpp:40 +msgid "File to be opened at startup." +msgstr "File da aprire all'avvio" + +#: main.cpp:41 +msgid "Print found libraries and exit." +msgstr "Stampa le librerie trovate ed esci." + +#: main.cpp:57 +msgid "KSquirrel - image viewer for KDE" +msgstr "KSquirrel - Visualizzatore di immagini per KDE" + +#: main.cpp:66 +msgid "Bug reports, patches" +msgstr "Segnalazione bug, aggiornamenti" + +#: main.cpp:67 +msgid "Bug reports" +msgstr "Segnalazione bug" + +#: main.cpp:68 +msgid "Translation help" +msgstr "Aiuto traduzione" + +#: main.cpp:69 +msgid "TiamaT" +msgstr "TiamaT" + +#: main.cpp:69 +msgid "Initial artwork for edit tools" +msgstr "Immagine iniziale per gli strumenti di modifica" + +#: main.cpp:70 +msgid "Fera" +msgstr "Fera" + +#: main.cpp:70 +msgid "Great artwork for edit tools" +msgstr "Favolosa immagine per gli strumenti di modifica" + +#: main.cpp:71 +msgid "OpenGL forum at" +msgstr "Forum OpenGL a" + +#: main.cpp:72 +msgid "GameDev forum at" +msgstr "Forum GameDev a" + +#: sq_imageproperties.cpp:320 sq_imageproperties.cpp:407 +msgid "Group" +msgstr "Gruppo" + +#: sq_imageproperties.cpp:359 sq_glwidget.cpp:350 +msgid "Image properties" +msgstr "Proprietà dell'immagine" + +#: sq_imageproperties.cpp:361 +msgid "Attributes" +msgstr "Attributi" + +#: sq_imageproperties.cpp:362 +msgid "Owner:" +msgstr "Proprietario:" + +#: sq_imageproperties.cpp:363 +msgid "Group:" +msgstr "Gruppo:" + +#: sq_imageproperties.cpp:365 +msgid "Permissions:" +msgstr "Permessi:" + +#: sq_imageproperties.cpp:368 +msgid "Time" +msgstr "Ora" + +#: sq_imageproperties.cpp:369 +msgid "Created:" +msgstr "Creato:" + +#: sq_imageproperties.cpp:370 +msgid "Last read:" +msgstr "Ultima lettura:" + +#: sq_imageproperties.cpp:371 +msgid "Last modified:" +msgstr "Ultima modifica:" + +#: sq_imageproperties.cpp:375 sq_helpwidget.cpp:181 sq_options.ui.h:134 +msgid "General" +msgstr "Generale" + +#: sq_imageproperties.cpp:376 +msgid "File:" +msgstr "File:" + +#: sq_imageproperties.cpp:378 sq_pluginsinfo.cpp:137 sq_slideshow.cpp:211 +msgid "Directory:" +msgstr "Cartella:" + +#: sq_imageproperties.cpp:379 +msgid "Size:" +msgstr "Dimensioni:" + +#: sq_imageproperties.cpp:381 +msgid "Type:" +msgstr "Tipo:" + +#: sq_imageproperties.cpp:382 +msgid "Number of frames:" +msgstr "Numero di fotogrammi:" + +#: sq_imageproperties.cpp:383 +msgid "Current frame" +msgstr "Fotogramma corrente:" + +#: sq_imageproperties.cpp:384 sq_slideshow.cpp:219 +msgid "Delay:" +msgstr "Ritardo:" + +#: sq_imageproperties.cpp:385 +msgid "Dimensions:" +msgstr "Dimensioni:" + +#: sq_imageproperties.cpp:386 +msgid "Bits per pixel:" +msgstr "Bit per pixel:" + +#: sq_imageproperties.cpp:387 +msgid "Color space:" +msgstr "Spazio colore:" + +#: sq_imageproperties.cpp:388 +msgid "Compression:" +msgstr "Compressione:" + +#: sq_imageproperties.cpp:389 +msgid "Uncompressed size:" +msgstr "Dimensioni non compresso:" + +#: sq_imageproperties.cpp:390 +msgid "Compression ratio:" +msgstr "Rapporto di compressione:" + +#: sq_imageproperties.cpp:391 +msgid "Interlaced:" +msgstr "Interlacciato:" + +#: sq_imageproperties.cpp:392 +msgid "Status:" +msgstr "Stato:" + +#: sq_imageproperties.cpp:406 sq_glwidget.cpp:2662 sq_options.cpp:816 +msgid "Image" +msgstr "Immagine:" + +#: sq_imageproperties.cpp:409 +msgid "Metadata" +msgstr "Metadati:" + +#: sq_pluginsinfo.cpp:55 sq_pluginsinfo.cpp:129 +msgid "..." +msgstr "..." + +#: sq_pluginsinfo.cpp:56 sq_pluginsinfo.cpp:130 +msgid "Icon" +msgstr "Icona:" + +#: sq_pluginsinfo.cpp:57 sq_pluginsinfo.cpp:131 +msgid "Library" +msgstr "Libreria:" + +#: sq_pluginsinfo.cpp:58 sq_pluginsinfo.cpp:132 +msgid "Version" +msgstr "Versione" + +#: sq_pluginsinfo.cpp:59 sq_pluginsinfo.cpp:133 sq_viewcache.cpp:48 +#: sq_viewcache.cpp:106 +msgid "MIME" +msgstr "MIME" + +#: sq_pluginsinfo.cpp:128 +msgid "Codec information and settings" +msgstr "Informazioni e impostazioni dei codec" + +#: sq_pluginsinfo.cpp:138 +msgid "Total found:" +msgstr "Totale trovati:" + +#: sq_errorstring.cpp:34 +msgid "cannot open file for reading" +msgstr "impossbile aprire il file per la lettura" + +#: sq_errorstring.cpp:35 +msgid "file corrupted" +msgstr "file danneggiato" + +#: sq_errorstring.cpp:36 +msgid "no memory" +msgstr "niente memoria" + +#: sq_errorstring.cpp:37 +msgid "file type not supported" +msgstr "tipo di file non supportato" + +#: sq_errorstring.cpp:38 +msgid "wrong image dimensions" +msgstr "dimensioni errate dell'immagine" + +#: sq_errorstring.cpp:39 +msgid "cannot open file for writing" +msgstr "impossibile aprire il file per la scrittura" + +#: sq_errorstring.cpp:40 +msgid "write feature is not supported" +msgstr "la scrittura non è supportata" + +#: sq_errorstring.cpp:41 +msgid "write error (check free space)" +msgstr "errore in scrittura (controlla lo spazio libero)" + +#: sq_errorstring.cpp:42 +msgid "wrong parameters" +msgstr "parametri errati" + +#: sq_errorstring.cpp:43 +msgid "Editing process is not finished yet" +msgstr "Il processo di modifica non è ancora terminato" + +#: sq_selectdeselectgroup.cpp:83 +msgid "Filename or mask:" +msgstr "Nome del file o maschera:" + +#: sidebar/sq_treeview.cpp:89 +msgid "root" +msgstr "root" + +#: sidebar/sq_categoriesview.cpp:95 ksquirrel.cpp:512 +msgid "Categories" +msgstr "Categorie" + +#: sidebar/sq_categoriesview.cpp:115 sidebar/sq_categoriesview.cpp:166 +msgid "New category" +msgstr "Nuova categoria" + +#: sidebar/sq_categoriesview.cpp:153 sidebar/sq_categoriesview.cpp:218 +msgid "New Category" +msgstr "Nuova Categoria" + +#: sidebar/sq_categoriesview.cpp:169 sidebar/sq_categoriesview.cpp:198 +msgid "Create default categories" +msgstr "Crea categorie predefinite" + +#: sidebar/sq_categoriesview.cpp:197 +msgid "" +"This will create default categories: Concerts, Pets, Home, Friends, Free time, " +"Travelling and Nature. Continue?" +msgstr "Verranno create le categorie predefinite: Concerti, Animali, Casa, Amici, Tempo libero, Viaggi, Natura. Continuare?" + +#: sidebar/sq_categoriesview.cpp:218 +msgid "Create new category:" +msgstr "Crea nuova categoria:" + +#: sidebar/sq_mountview.cpp:43 +msgid "Mount" +msgstr "Monta" + +#: sidebar/sq_mountview.cpp:45 +msgid "Unmount" +msgstr "Smonta" + +#: sidebar/sq_mountview.cpp:47 +msgid "Refresh" +msgstr "Ricarica" + +#: sidebar/sq_mountview.cpp:170 +msgid "Device" +msgstr "Dispositivo" + +#: sidebar/sq_mountview.cpp:173 +msgid "FS Type" +msgstr "Tipo FS" + +#: sidebar/sq_imagebasket.cpp:244 +msgid "Synchronize" +msgstr "Sincronizza" + +#: sidebar/sq_previewwidget.cpp:60 +msgid "Background color..." +msgstr "Colore di sfondo" + +#: sidebar/sq_categorybrowsermenu.cpp:137 +#: sidebar/sq_categorybrowsermenu.cpp:146 +msgid "Failed to Read Folder" +msgstr "Impossibile leggere la cartella" + +#: sidebar/sq_categorybrowsermenu.cpp:154 +msgid "Not Authorized to Read Folder" +msgstr "Lettura della cartella non permessa" + +#: sidebar/sq_categorybrowsermenu.cpp:167 +msgid "Add here" +msgstr "Aggiungi qui" + +#: sidebar/sq_categorybrowsermenu.cpp:310 +msgid "More..." +msgstr "Più..." + +#: sq_thumbnailcachemaster.cpp:143 +msgid "Thumbnail cache" +msgstr "cache anteprime" + +#: sq_thumbnailcachemaster.cpp:144 +msgid "Calculate cache size on disk" +msgstr "calcola dimensioni della cache sul disco" + +#: sq_thumbnailcachemaster.cpp:146 +msgid "Clear cache on disk" +msgstr "Pulisci cache sul disco" + +#: sq_thumbnailcachemaster.cpp:147 +msgid "View memory cache" +msgstr "Vedi cache in memoria" + +#: sq_thumbnailcachemaster.cpp:148 +msgid "Clear cache in memory" +msgstr "Pulisci cache in memoria" + +#: sq_thumbnailcachemaster.cpp:150 +msgid "Sync cache to disk" +msgstr "Sinc cache al disco" + +#: sq_thumbnailcachemaster.cpp:151 +msgid "Calculate cache size in memory" +msgstr "Calcola dimensioni della cache in memoria" + +#: sq_diroperator.cpp:138 +msgid "remote filesystem" +msgstr "filesystem non locale" + +#: sq_diroperator.cpp:158 +msgid "" +"
    Mount point:%1
    Total size:%" +"2
    Used:%3
    Available:%4
    " +msgstr "" +"
    Punto di montaggio:%1
    Dimensioni totali:%" +"2
    Usati:%3
    Disponibili:%4
    " + +#: sq_diroperator.cpp:245 +msgid "no files selected" +msgstr "nessun file selezionato" + +#: sq_diroperator.cpp:306 +msgid "Edit file type" +msgstr "Modifica tipo di file" + +#: sq_diroperator.cpp:307 +msgid "Add to Basket" +msgstr "Aggiungi al Cestino" + +#: sq_diroperator.cpp:309 sq_diroperator.cpp:889 +msgid "File actions" +msgstr "Azioni sul file" + +#: sq_diroperator.cpp:327 +msgid "Copy to..." +msgstr "Copia a..." + +#: sq_diroperator.cpp:328 +msgid "Move to..." +msgstr "Sposta a..." + +#: sq_diroperator.cpp:329 +msgid "Link to..." +msgstr "Collega a..." + +#: sq_diroperator.cpp:331 +msgid "Run" +msgstr "Avvia" + +#: sq_diroperator.cpp:333 +msgid "Recreate selected thumbnails" +msgstr "Ricrea miniature selezionate" + +#: sq_diroperator.cpp:336 +msgid "Convert..." +msgstr "Converti..." + +#: sq_diroperator.cpp:439 +msgid "Total %1 in %2 (%3, %4)" +msgstr "%1 totale in %2 (%3, %4)" + +#: sq_diroperator.cpp:441 +msgid "1 item" +msgstr "1 elemento" + +#: sq_diroperator.cpp:442 +msgid "1 folder" +msgstr "1 cartella" + +#: sq_diroperator.cpp:443 +msgid "1 file" +msgstr "1 file" + +#: sq_diroperator.cpp:627 +#, c-format +msgid "Command cannot contain both \"%f\" and \"%F\"" +msgstr "Il comando non può contenere sia \"%f\" che \"%F\"" + +#: sq_diroperator.cpp:627 sq_diroperator.cpp:632 +msgid "Error processing command" +msgstr "Errore nell'elaborazione del comando" + +#: sq_diroperator.cpp:632 +#, c-format +msgid "Command should contain \"%f\" or \"%F\"" +msgstr "Il comando deve contenere \"%f\" oppure \"%F\"" + +#: sq_diroperator.cpp:741 +msgid "Unsupported format \"%1\"" +msgstr "Formato non supportato \"%1\"" + +#: sq_diroperator.cpp:886 +msgid "Add to &Category" +msgstr "Aggiungi a &Categoria" + +#: sq_diroperator.cpp:890 +msgid "&External tools" +msgstr "Strumenti &Esterni" + +#: sq_slideshowwidget.cpp:345 +msgid "" +"
    Enter, Escape, Returnstop " +"slideshow
    Pause, Spacepause/unpause " +"slideshow
    Page Upprevious image
    Page Downnext image
    Mshow/hide onscreen messages
    " +msgstr "" +"
    Invio, Escinterrompi presentazione
    Pausa, Spazioin pausa/riprendi presentazione
    Pagina Suimmagine precedente
    Pagina Giùimmagine successiva
    Mmostra/nascondi i messaggi a schermo
    " + +#: sq_codecsettingsskeleton.ui.h:28 +msgid "" +"Error loading widget from %1. Please check your installation or " +"contact ksquirrel.iv@gmail.com" +msgstr "Errore nel caricamento dell'elemento da %1. Si prega di controllare l'installazione o contattare ksquirrel.iv@gmail.com ." + +#: sq_widgetstack.cpp:473 sq_widgetstack.cpp:507 +msgid "No files to copy or move" +msgstr "Nessun file da copiare o spostare" + +#: sq_widgetstack.cpp:607 +msgid "Select a group of files" +msgstr "Seleziona un gruppo di file" + +#: sq_widgetstack.cpp:607 +msgid "Deselect a group of files" +msgstr "Deseleziona un gruppo di file" + +#: sq_widgetstack.cpp:608 +msgid "Select!" +msgstr "Seleziona!" + +#: sq_widgetstack.cpp:608 +msgid "Deselect!" +msgstr "Deseleziona!" + +#: sq_filethumbview.cpp:370 +msgid "" +"%3%4" +msgstr "
    File:%1
    Size:%2
    %3%4
    File:%1
    Dimensioni:%2
    " + +#: sq_filethumbview.cpp:373 +msgid "Link destination:%1" +msgstr "Collega destinazione:%1" + +#: imageedit/sq_writeoption.cpp:108 +msgid "RLE compression" +msgstr "Compressione RLE" + +#: imageedit/sq_writeoption.cpp:109 +msgid "Compression level" +msgstr "Livello di compressione" + +#: imageedit/sq_writeoption.cpp:110 +msgid "Interlaced" +msgstr "Interlacciato" + +#: imageedit/sq_writeoption.cpp:112 +msgid "No special options available for this format" +msgstr "Nessuna opzione speciale disponibile per questo fermato" + +#: imageedit/sq_converter.cpp:47 +msgid "internal error" +msgstr "errore interno" + +#: imageedit/sq_converter.cpp:48 +msgid "failed" +msgstr "non riuscito" + +#: imageedit/sq_converter.cpp:50 +msgid "Converting" +msgstr "Conversione" + +#: imageedit/sq_converter.cpp:68 +msgid "Select files to edit" +msgstr "Seleziona i file da modificare" + +#: imageedit/sq_converter.cpp:73 +msgid "" +"Converter cannot work with remote files.\n" +"Sorry" +msgstr "" +"Il convertitore non può funzionare con file non locali.\n" +"Spiacente" + +#: imageedit/sq_converter.cpp:160 +msgid "Temporary file creation failed" +msgstr "Creazione del file temporaneo non riuscita" + +#: imageedit/sq_converter.cpp:243 sq_imageproperties.ui.h:72 +msgid "1 error" +msgstr "1 errore" + +#: imageedit/sq_converter.cpp:250 +msgid "Removing" +msgstr "Rimozione" + +#: imageedit/sq_converter.cpp:436 +msgid "Convert 1 file" +msgstr "Converti 1 file" + +#: imageedit/sq_imageeditoptions.cpp:134 +msgid "Edit options" +msgstr "Opzioni di modifica" + +#: imageedit/sq_imageeditoptions.cpp:135 +msgid "New files" +msgstr "Nuovi file" + +#: imageedit/sq_imageeditoptions.cpp:136 +msgid "Place here" +msgstr "Metti qui" + +#: imageedit/sq_imageeditoptions.cpp:137 +msgid "Replace original files" +msgstr "Sostituisci file originali" + +#: imageedit/sq_imageeditoptions.cpp:138 +msgid "Place files in current directory, renaming them if necessary" +msgstr "Metti i file nella cartella attuale, rinominandoli se necessario" + +#: imageedit/sq_imageeditoptions.cpp:139 +msgid "Place files in current directory, replacing existing files" +msgstr "Metti i file nella cartella attuale, sostituendo i file esistenti" + +#: imageedit/sq_imageeditoptions.cpp:140 +msgid "Close, when all operations succeeded" +msgstr "Chiudi, quando tutte le operazioni sono riuscite" + +#: imageedit/sq_imagebcg.ui.h:17 imageedit/sq_imagebcg.ui.h:31 +#: imageedit/sq_imagebcg.cpp:382 +msgid "Brightness" +msgstr "Luminosità" + +#: imageedit/sq_imagebcg.ui.h:18 imageedit/sq_imagebcg.ui.h:31 +#: imageedit/sq_imagebcg.cpp:383 +msgid "Contrast" +msgstr "Contrasto" + +#: imageedit/sq_imagebcg.ui.h:19 imageedit/sq_imagebcg.ui.h:31 +#: imageedit/sq_imagebcg.cpp:384 +msgid "Gamma" +msgstr "Gamma" + +#: imageedit/sq_imagebcg.ui.h:20 imageedit/sq_imagebcg.ui.h:32 +#: imageedit/sq_imagebcg.cpp:390 +msgid "Red" +msgstr "Rosso" + +#: imageedit/sq_imagebcg.ui.h:20 +msgid "Cyan" +msgstr "Ciano" + +#: imageedit/sq_imagebcg.ui.h:21 imageedit/sq_imagebcg.ui.h:32 +#: imageedit/sq_imagebcg.cpp:389 +msgid "Green" +msgstr "Verde" + +#: imageedit/sq_imagebcg.ui.h:21 +msgid "Magenta" +msgstr "Magenta" + +#: imageedit/sq_imagebcg.ui.h:22 imageedit/sq_imagebcg.ui.h:32 +#: imageedit/sq_imagebcg.cpp:388 +msgid "Blue" +msgstr "Blu" + +#: imageedit/sq_imagebcg.ui.h:22 +msgid "Yellow" +msgstr "Giallo" + +#: imageedit/sq_imagefilter.cpp:473 imageedit/sq_imagefilter.cpp:539 +msgid "Filter" +msgstr "Filtro" + +#: imageedit/sq_imagefilter.cpp:474 imageedit/sq_imagefilter.cpp:486 +msgid "Color:" +msgstr "Colore:" + +#: imageedit/sq_imagefilter.cpp:476 +msgid "Opacity" +msgstr "Opacità" + +#: imageedit/sq_imagefilter.cpp:477 imageedit/sq_imagefilter.cpp:482 +#: imageedit/sq_imagefilter.cpp:505 +msgid "Sigma" +msgstr "Sigma" + +#: imageedit/sq_imagefilter.cpp:478 imageedit/sq_imagefilter.cpp:481 +#: imageedit/sq_imagefilter.cpp:483 imageedit/sq_imagefilter.cpp:501 +#: imageedit/sq_imagefilter.cpp:506 +msgid "Radius" +msgstr "Raggio" + +#: imageedit/sq_imagefilter.cpp:479 imageedit/sq_imagefilter.cpp:492 +#: imageedit/sq_imagefilter.cpp:507 +msgid "Factor" +msgstr "Fattore" + +#: imageedit/sq_imagefilter.cpp:480 imageedit/sq_imagefilter.cpp:484 +#: imageedit/sq_imagefilter.cpp:493 imageedit/sq_imagefilter.cpp:514 +msgid "" +"There are no special options available for this filter. Just click \"Filter" +"\"." +msgstr "Non ci sono opzioni speciali disponibili per questo filtro. Fai solo clic su \"Filtro\"." + +#: imageedit/sq_imagefilter.cpp:490 +msgid "Color 1:" +msgstr "Colore 1:" + +#: imageedit/sq_imagefilter.cpp:491 +msgid "Color 2:" +msgstr "Colore 2:" + +#: imageedit/sq_imagefilter.cpp:494 +msgid "Noise type" +msgstr "Tipo di rumore" + +#: imageedit/sq_imagefilter.cpp:495 +msgid "Uniform" +msgstr "Uniforme" + +#: imageedit/sq_imagefilter.cpp:496 +msgid "Impulse" +msgstr "Impulso" + +#: imageedit/sq_imagefilter.cpp:497 +msgid "Multiplicative Gaussian" +msgstr "Gaussiano Moltiplicativo" + +#: imageedit/sq_imagefilter.cpp:498 +msgid "Poisson" +msgstr "Poisson" + +#: imageedit/sq_imagefilter.cpp:499 +msgid "Gaussian" +msgstr "Gaussiano" + +#: imageedit/sq_imagefilter.cpp:500 +msgid "Laplacian" +msgstr "Laplaciano" + +#: imageedit/sq_imagefilter.cpp:502 +msgid "Color" +msgstr "Colore" + +#: imageedit/sq_imagefilter.cpp:503 +msgid "Elevation" +msgstr "Elevazione" + +#: imageedit/sq_imagefilter.cpp:504 +msgid "Azimuth" +msgstr "Azimut" + +#: imageedit/sq_imagefilter.cpp:508 +msgid "Amount" +msgstr "Quantità" + +#: imageedit/sq_imagefilter.cpp:509 +msgid "Type" +msgstr "Tipo" + +#: imageedit/sq_imagefilter.cpp:510 +msgid "GBR" +msgstr "VBR" + +#: imageedit/sq_imagefilter.cpp:511 +msgid "BRG" +msgstr "BRV" + +#: imageedit/sq_imagefilter.cpp:512 +msgid "Degrees" +msgstr "Gradi" + +#: imageedit/sq_imagefilter.cpp:513 imageedit/sq_imagefilter.cpp:515 +#: imageedit/sq_imagefilter.cpp:536 +msgid "Threshold" +msgstr "Soglia" + +#: imageedit/sq_imagefilter.cpp:517 +msgid "Blend" +msgstr "Miscela" + +#: imageedit/sq_imagefilter.cpp:518 +msgid "Blur" +msgstr "Sfocatura" + +#: imageedit/sq_imagefilter.cpp:519 +msgid "Desaturate" +msgstr "Desatura" + +#: imageedit/sq_imagefilter.cpp:520 +msgid "Despeckle" +msgstr "Despecula" + +#: imageedit/sq_imagefilter.cpp:521 +msgid "Edge" +msgstr "Bordo" + +#: imageedit/sq_imagefilter.cpp:522 +msgid "Emboss" +msgstr "Rilievo" + +#: imageedit/sq_imagefilter.cpp:523 +msgid "Equalize" +msgstr "Equalizza" + +#: imageedit/sq_imagefilter.cpp:524 +msgid "Fade" +msgstr "Dissolvi" + +#: imageedit/sq_imagefilter.cpp:525 +msgid "Flatten" +msgstr "Appiattisci" + +#: imageedit/sq_imagefilter.cpp:526 +msgid "Implode" +msgstr "Implodi" + +#: imageedit/sq_imagefilter.cpp:527 +msgid "Negative" +msgstr "Negativo" + +#: imageedit/sq_imagefilter.cpp:528 +msgid "Noise" +msgstr "Rumore" + +#: imageedit/sq_imagefilter.cpp:529 +msgid "Oil" +msgstr "Olio" + +#: imageedit/sq_imagefilter.cpp:530 +msgid "Shade" +msgstr "Ombra" + +#: imageedit/sq_imagefilter.cpp:531 +msgid "Sharpen" +msgstr "Nitidezza" + +#: imageedit/sq_imagefilter.cpp:532 +msgid "Solarize" +msgstr "Solarizza" + +#: imageedit/sq_imagefilter.cpp:533 +msgid "Spread" +msgstr "Diffondi" + +#: imageedit/sq_imagefilter.cpp:534 +msgid "Swap colors" +msgstr "Inverti colori" + +#: imageedit/sq_imagefilter.cpp:535 +msgid "Swirl" +msgstr "Vortice" + +#: imageedit/sq_imagefilter.cpp:537 +msgid "Grayscale" +msgstr "Scala di grigi" + +#: imageedit/sq_imagefilter.cpp:538 +msgid "Redeye" +msgstr "Occhi rossi" + +#: imageedit/sq_imagefilter.cpp:541 +msgid "Image after filtering:" +msgstr "Immagine dopo il filtraggio:" + +#: imageedit/sq_imagefilter.cpp:542 imageedit/sq_imagebcg.cpp:397 +msgid "Original image:" +msgstr "Immagine originale:" + +#: imageedit/sq_imagebcg.cpp:378 +msgid "Color balance" +msgstr "Bilanciamento colori" + +#: imageedit/sq_imagebcg.cpp:394 +msgid "Colorize" +msgstr "Colorizza" + +#: imageedit/sq_imagebcg.cpp:396 +msgid "Image after colorizing:" +msgstr "Immagine dopo la colorizzazione:" + +#: imageedit/sq_imageconvert.cpp:167 +msgid "Convert" +msgstr "Converti" + +#: imageedit/sq_imageconvert.cpp:172 +msgid "Conversion options" +msgstr "Opzioni di conversione" + +#: sq_viewcache.cpp:49 sq_viewcache.cpp:107 +msgid "Parameters" +msgstr "Parametri" + +#: sq_viewcache.cpp:103 +msgid "Memory cache" +msgstr "Cache in memoria" + +#: sq_viewcache.cpp:108 +msgid "Total:" +msgstr "Totale:" + +#: sq_imageproperties.ui.h:29 +msgid "Copy entry" +msgstr "Copia voce" + +#: sq_imageproperties.ui.h:30 +msgid "Copy all entries" +msgstr "Copia tutte le voci" + +#: sq_imageproperties.ui.h:95 +msgid "EXIF" +msgstr "EXIF" + +#: sq_imageproperties.ui.h:105 +msgid "Simple" +msgstr "Semplice" + +#: sq_imageproperties.ui.h:108 +msgid "Full" +msgstr "Completa" + +#: sq_imageproperties.ui.h:127 +msgid "EXIF (no)" +msgstr "EXIF (no)" + +#: sq_imageproperties.ui.h:177 +msgid "Metadata (no)" +msgstr "Metadati (no)" + +#: _translatorinfo.cpp:1 +msgid "" +"_: NAME OF TRANSLATORS\n" +"Your names" +msgstr "" +"_: NOMI DEI TRADUTTORI\n" +"I vostri nomi" + +#: _translatorinfo.cpp:3 +msgid "" +"_: EMAIL OF TRANSLATORS\n" +"Your emails" +msgstr "" +"_: EMAIL DEI TRADUTTORI\n" +"Le vostre email" + +#: sq_glwidget.cpp:233 +msgid "Rectangle" +msgstr "Rettangolo" + +#: sq_glwidget.cpp:234 +msgid "Ellipse" +msgstr "Ellisse" + +#: sq_glwidget.cpp:239 +msgid "Fit width" +msgstr "Adatta larghezza" + +#: sq_glwidget.cpp:240 +msgid "Fit height" +msgstr "Adatta altezza" + +#: sq_glwidget.cpp:241 +msgid "Fit image" +msgstr "Adatta immagine" + +#: sq_glwidget.cpp:242 +msgid "Zoom 100%" +msgstr "Zoom 100%" + +#: sq_glwidget.cpp:243 +msgid "Leave previous zoom" +msgstr "Lascia lo zoom precedente" + +#: sq_glwidget.cpp:244 +msgid "Ignore, if image is smaller than window" +msgstr "Ignora, se l'immagine è più piccola della finestra" + +#: sq_glwidget.cpp:318 +msgid "Go to first image" +msgstr "Vai alla prima immagine" + +#: sq_glwidget.cpp:319 +msgid "Previous image" +msgstr "Immagine precedente" + +#: sq_glwidget.cpp:321 +msgid "Next image" +msgstr "Immagine successiva" + +#: sq_glwidget.cpp:323 +msgid "Go to last image" +msgstr "Vai all'ultima immagine" + +#: sq_glwidget.cpp:326 sq_glwidget.cpp:2685 +msgid "Zoom +" +msgstr "Zoom +" + +#: sq_glwidget.cpp:328 sq_glwidget.cpp:2686 +msgid "Zoom -" +msgstr "Zoom -" + +#: sq_glwidget.cpp:332 sq_glwidget.cpp:2677 +msgid "Rotate left" +msgstr "Ruota a sinistra" + +#: sq_glwidget.cpp:334 sq_glwidget.cpp:2678 +msgid "Rotate right" +msgstr "Ruota a destra" + +#: sq_glwidget.cpp:336 sq_glwidget.cpp:2707 +msgid "Flip vertically" +msgstr "Ribalta verticalmente" + +#: sq_glwidget.cpp:338 sq_glwidget.cpp:2708 +msgid "Flip horizontally" +msgstr "Ribalta orizzontalmente" + +#: sq_glwidget.cpp:340 +msgid "Normalize" +msgstr "Normalizza" + +#: sq_glwidget.cpp:342 sq_glwidget.cpp:2723 +msgid "Fullscreen" +msgstr "A schermo pieno" + +#: sq_glwidget.cpp:344 +msgid "Select image" +msgstr "Seleziona immagine" + +#: sq_glwidget.cpp:346 +msgid "Selection" +msgstr "Selezione" + +#: sq_glwidget.cpp:348 sq_glwidget.cpp:2717 sq_codecsettingsskeleton.cpp:128 +msgid "Codec settings" +msgstr "Impostazioni del codec" + +#: sq_glwidget.cpp:351 +msgid "Show navigator" +msgstr "Mostra navigatore" + +#: sq_glwidget.cpp:1024 +msgid "yes" +msgstr "sì" + +#: sq_glwidget.cpp:1024 +msgid "no" +msgstr "no" + +#: sq_glwidget.cpp:1485 +msgid "Codec for %1 format not found" +msgstr "Codec per il formato %1 non trovato" + +#: sq_glwidget.cpp:1729 +msgid "Memory allocation failed for %1 of memory" +msgstr "Allocazione della memoria fallita per il %1 della memoria" + +#: sq_glwidget.cpp:1741 +msgid "Memory allocation failed" +msgstr "Allocazione della memoria fallita" + +#: sq_glwidget.cpp:1747 +msgid "Decoding failed" +msgstr "Decodifica fallita" + +#: sq_glwidget.cpp:1849 +msgid " ms." +msgstr " ms." + +#: sq_glwidget.cpp:2363 +msgid "" +"Sorry, could not perform write operation\n" +"for codec \"%1\"" +msgstr "" +"Spiacente, impossibile compiere l'operazione di scrittura\n" +"per il codec \"%1\"" + +#: sq_glwidget.cpp:2382 sq_glwidget.cpp:2390 sq_glwidget.cpp:2412 +msgid "Error writing image" +msgstr "Errore nella scrittura dell'immagine" + +#: sq_glwidget.cpp:2433 +msgid "Try another location?" +msgstr "Provare un'altra posizione?" + +#: sq_glwidget.cpp:2658 +msgid "Rotate" +msgstr "Ruota" + +#: sq_glwidget.cpp:2661 sq_options.cpp:803 +msgid "Window" +msgstr "Finestra" + +#: sq_glwidget.cpp:2670 +msgid "Next" +msgstr "Prossima" + +#: sq_glwidget.cpp:2671 +msgid "Previous" +msgstr "Precedente" + +#: sq_glwidget.cpp:2672 +msgid "First" +msgstr "Prima" + +#: sq_glwidget.cpp:2673 +msgid "Last" +msgstr "Ultima" + +#: sq_glwidget.cpp:2680 +msgid "Rotate 180'" +msgstr "Ruota di 180°" + +#: sq_glwidget.cpp:2682 +msgid "Rotate 1' left" +msgstr "Ruota di 1° a sinistra" + +#: sq_glwidget.cpp:2683 +msgid "Rotate 1' right" +msgstr "Ruota di 1° a destra" + +#: sq_glwidget.cpp:2687 +msgid "Zoom 2x" +msgstr "Zoom 2x" + +#: sq_glwidget.cpp:2688 +msgid "Zoom 1/2x" +msgstr "Zoom 1/2x" + +#: sq_glwidget.cpp:2698 +msgid "Move left" +msgstr "Sposta a sinistra" + +#: sq_glwidget.cpp:2699 +msgid "Move right" +msgstr "Sposta a destra" + +#: sq_glwidget.cpp:2700 +msgid "Move up" +msgstr "Sposta su" + +#: sq_glwidget.cpp:2701 +msgid "Move down" +msgstr "Sposta giù" + +#: sq_glwidget.cpp:2703 +msgid "Start/stop animation" +msgstr "Inizia/ferma animazione" + +#: sq_glwidget.cpp:2704 +msgid "Hide/show background" +msgstr "Mostra/nascondi sfondo" + +#: sq_glwidget.cpp:2705 +msgid "Hide/show tickmarks" +msgstr "Mostra/nascondi tacche" + +#: sq_glwidget.cpp:2710 +msgid "First page" +msgstr "Prima pagina" + +#: sq_glwidget.cpp:2711 +msgid "Previous page" +msgstr "Pagina precedente" + +#: sq_glwidget.cpp:2712 +msgid "Next page" +msgstr "Pagina successiva" + +#: sq_glwidget.cpp:2713 +msgid "Last page" +msgstr "Ultima pagina" + +#: sq_glwidget.cpp:2715 +msgid "To clipboard" +msgstr "Agli appunti" + +#: sq_glwidget.cpp:2720 +msgid "Color balance..." +msgstr "Bilanciamento del colore..." + +#: sq_glwidget.cpp:2721 +msgid "Apply filter..." +msgstr "Applica filtro..." + +#: sq_glwidget.cpp:2724 +msgid "Hide/show toolbar" +msgstr "Mostra/nascondi la barra" + +#: sq_glwidget.cpp:2725 +msgid "Hide/show statusbar" +msgstr "Mostra/nascondi la barra di stato" + +#: sq_glwidget.cpp:2728 +msgid "Reset" +msgstr "Azzera" + +#: sq_glwidget.cpp:2731 sq_helpwidget.cpp:174 +msgid "Hotkeys" +msgstr "Scorciatoie" + +#: sq_glview.cpp:84 +msgid "Loading time" +msgstr "Tempo di caricamento" + +#: sq_options.cpp:746 +msgid "The main options" +msgstr "Le impostazioni principali" + +#: sq_options.cpp:748 +msgid "Write configuration file to disk, when I press \"OK\"" +msgstr "Scrivi il file di configurazione sul disco, quando premo \"OK\"" + +#: sq_options.cpp:749 +msgid "Minimize to tray after closing" +msgstr "Minimizza a icona dopo la chiusura" + +#: sq_options.cpp:750 +msgid "Show splash screen at startup" +msgstr "Mostra la schermata iniziale all'avvio" + +#: sq_options.cpp:751 +msgid "Don't show animated logo in toolbar" +msgstr "Non mostrare il logo animato" + +#: sq_options.cpp:752 +msgid "Apply codec settings to" +msgstr "Applica le impostazioni del codec a" + +#: sq_options.cpp:753 +msgid "Thumbnail loader" +msgstr "Caricatore miniature" + +#: sq_options.cpp:754 +msgid "Image viewer (also preview window)" +msgstr "Visualizzatore immagini (anche finestra di anteprima)" + +#: sq_options.cpp:755 sq_options.cpp:773 +msgid "Both" +msgstr "Entrambi" + +#: sq_options.cpp:756 +msgid "RunTime" +msgstr "Esecuzione" + +#: sq_options.cpp:757 +msgid "Treat unknown mime types as unsupported" +msgstr "Considera i tipi MIME sconosciuti come non supportati" + +#: sq_options.cpp:758 +msgid "Load KIPI plugins on demand (for slow machines)" +msgstr "Carica i plugin KIPI su richiesta (per macchine lente)" + +#: sq_options.cpp:759 +msgid "Disk navigator" +msgstr "Navigatore disco" + +#: sq_options.cpp:760 +msgid "On starting open..." +msgstr "All'avvio apri..." + +#: sq_options.cpp:762 +msgid "Custom directory:" +msgstr "Cartella personalizzata" + +#: sq_options.cpp:763 +msgid "Last visited directory" +msgstr "Ultima cartella visitata" + +#: sq_options.cpp:764 +msgid "Current directory, where KSquirrel starts" +msgstr "Cartella attuale, all'avvio di KSquirrel" + +#: sq_options.cpp:765 +msgid "Run unknown file formats separately (with default application)" +msgstr "Esegui i formati di file sconosciuti separatamente (con l'applicazione predefinita)" + +#: sq_options.cpp:767 +msgid "Save history" +msgstr "Salva cronologia" + +#: sq_options.cpp:768 +msgid "Jump into archives" +msgstr "Salta negli archivi" + +#: sq_options.cpp:769 +msgid "Jump to first image" +msgstr "Salta alla prima immagine" + +#: sq_options.cpp:770 +msgid "Don't show directories" +msgstr "Non mostrare le cartelle" + +#: sq_options.cpp:771 +msgid "Main" +msgstr "Principale" + +#: sq_options.cpp:772 +msgid "Synchronization" +msgstr "Sincronizzazione" + +#: sq_options.cpp:774 +msgid "Tree -> Navigator" +msgstr "Albero -> Navigatore" + +#: sq_options.cpp:775 +msgid "Tree <- Navigator" +msgstr "Albero <- Navigatore" + +#: sq_options.cpp:776 +msgid "Clicking" +msgstr "Fare clic" + +#: sq_options.cpp:777 +msgid "Thumbnails" +msgstr "Miniature" + +#: sq_options.cpp:779 +msgid "Do not write thumbnails on disk" +msgstr "Non scrivere le miniature sul disco" + +#: sq_options.cpp:780 +msgid "Show tooltips with file information" +msgstr "Mostra suggerimenti con le informazioni sul file" + +#: sq_options.cpp:781 +msgid "Margin between thumbnails" +msgstr "Margine tra le miniature" + +#: sq_options.cpp:782 sq_options.cpp:815 +msgid " pixels" +msgstr " pixel" + +#: sq_options.cpp:783 +msgid "Don't show tooltips when the main window is inactive" +msgstr "Non mostrare suggerimenti quando la finestra principale è inattiva" + +#: sq_options.cpp:784 +msgid "Mark supported image formats with clock icon (slow)" +msgstr "Segna i formati di immagine supportati con l'icona orologio" + +#: sq_options.cpp:785 +msgid "Maximum cache size (in memory)" +msgstr "Massima dimensione della cache (in memoria)" + +#: sq_options.cpp:786 +msgid " Kb" +msgstr " Kb" + +#: sq_options.cpp:787 +msgid "No cache" +msgstr "Nessuna cache" + +#: sq_options.cpp:788 +msgid "On scroll event" +msgstr "Evento allo scorrimento" + +#: sq_options.cpp:789 +msgid "Zoom the scene" +msgstr "Ingrandisci la scena" + +#: sq_options.cpp:790 +msgid "Load next/previos file" +msgstr "Carica il file successivo/precedente" + +#: sq_options.cpp:791 +msgid "Background" +msgstr "Sfondo" + +#: sq_options.cpp:792 +msgid "Custom texture" +msgstr "Immagine personalizzata" + +#: sq_options.cpp:793 +msgid "Custom color" +msgstr "Colore personalizzato" + +#: sq_options.cpp:794 +msgid "System color" +msgstr "Colore di sistema" + +#: sq_options.cpp:798 +msgid "Validate" +msgstr "Convalida" + +#: sq_options.cpp:802 +msgid "Show images progressively" +msgstr "Mostra le immagini progressivamente" + +#: sq_options.cpp:804 +msgid "Image pages" +msgstr "Pagine delle immagini" + +#: sq_options.cpp:805 +msgid "Load all pages" +msgstr "Carica tutte le pagine" + +#: sq_options.cpp:806 +msgid "Load only first page" +msgstr "Carica solo la prima pagina" + +#: sq_options.cpp:807 +msgid "Load no more than" +msgstr "Carica non più di" + +#: sq_options.cpp:808 +msgid " pages" +msgstr " pagine" + +#: sq_options.cpp:809 +msgid "Loader" +msgstr "Caricatore" + +#: sq_options.cpp:810 +msgid "Draw tickmarks around the image" +msgstr "Disegna tacche attorno all'immagine" + +#: sq_options.cpp:811 +msgid "Draw background for transparent images" +msgstr "Disegna sfondo per le immagini trasparenti" + +#: sq_options.cpp:812 +msgid "Rotating" +msgstr "Rotazione" + +#: sq_options.cpp:813 +msgid " degrees" +msgstr " gradi" + +#: sq_options.cpp:814 sq_helpwidget.cpp:183 +msgid "Moving" +msgstr "Spostare" + +#: sq_options.cpp:817 +msgid "Zoom limit" +msgstr "Limite di ingrandimento" + +#: sq_options.cpp:818 +msgid "Minimum: 1%, maximum: 10,000%" +msgstr "Minimo: 1%, massimo: 10000%" + +#: sq_options.cpp:819 +msgid "Custom" +msgstr "Personalizza" + +#: sq_options.cpp:821 +msgid "mimimum" +msgstr "minimo" + +#: sq_options.cpp:822 sq_options.cpp:824 +msgid " %" +msgstr " %" + +#: sq_options.cpp:823 +msgid "maximum" +msgstr "massimo" + +#: sq_options.cpp:825 +msgid "No limit" +msgstr "Nessun limite" + +#: sq_options.cpp:826 +msgid "Zoom coefficient" +msgstr "Coefficiente d'ingrandimento" + +#: sq_options.cpp:827 +msgid "%" +msgstr "%" + +#: sq_options.cpp:828 +msgid "None" +msgstr "Nessuno" + +#: sq_options.cpp:830 +msgid "Customize OpenGL widget" +msgstr "Personalizza elemento OpenGL" + +#: sq_options.cpp:831 +msgid "Recursion" +msgstr "Ricorsivo" + +#: sq_options.cpp:832 +msgid "No recursion" +msgstr "Non Ricorsivo" + +#: sq_options.cpp:833 +msgid "Show number of files" +msgstr "Mostra numero di file" + +#: sq_options.cpp:834 +msgid "Show number of subfolders and files" +msgstr "Mostra numero di sottocartelle e file" + +#: sq_options.cpp:835 +msgid "Show number of subfolders" +msgstr "Mostra numero di sottocartelle" + +#: sq_options.cpp:836 +msgid "Treeview" +msgstr "Vista ad albero" + +#: sq_options.cpp:837 +msgid "Show device path" +msgstr "Mostra percorso del dispositivo" + +#: sq_options.cpp:838 +msgid "Show mount options" +msgstr "Mostra opzioni di montaggio" + +#: sq_options.cpp:839 +msgid "Show filesystem type" +msgstr "Mostra tipo di file system" + +#: sq_options.cpp:840 +msgid "Mount view" +msgstr "Carica vista" + +#: sq_options.cpp:841 +msgid "Enable preview window" +msgstr "Abilita finestra anteprima" + +#: sq_options.cpp:843 +msgid "Delay before image loading" +msgstr "Ritardo prima del caricamento dell'immagine" + +#: sq_options.cpp:844 sq_slideshow.cpp:218 +msgid " ms" +msgstr " ms" + +#: sq_options.cpp:845 +msgid "Background color for preview widget:" +msgstr "Colore di sfondo per l'elemento anteprima" + +#: sq_options.cpp:847 +msgid "Don't load preview image on file execution" +msgstr "Non caricare l'anteprima dell'immagine durante l'esecuzione del file" + +#: sq_options.cpp:848 +msgid "Disables loading preview image when user launches image with mouse" +msgstr "Disabilita il caricamento dell'anteprima se l'utente apre l'immagine con il mouse" + +#: sq_options.cpp:849 +msgid "Image preview" +msgstr "Anteprima immagine" + +#: sq_options.cpp:850 +msgid "Sidebar settings" +msgstr "Impostazioni della barra laterale" + +#: sq_options.cpp:851 +msgid "KIPI Configuration" +msgstr "Configurazione KIPI" + +#: sq_slideshow.cpp:205 +msgid "Slideshow options" +msgstr "Opzioni presentazione" + +#: sq_slideshow.cpp:206 +msgid "Start" +msgstr "Inizia" + +#: sq_slideshow.cpp:209 +msgid "Set directory to current" +msgstr "Imposta alla cartella corrente" + +#: sq_slideshow.cpp:210 +msgid "Last visited directories" +msgstr "Ultime cartelle visitate" + +#: sq_slideshow.cpp:220 +msgid "Repeats:" +msgstr "Ripetizioni:" + +#: sq_slideshow.cpp:221 +msgid "Background color:" +msgstr "Colore di sfondo:" + +#: sq_slideshow.cpp:222 +msgid "Onscreen messages" +msgstr "Messaggi a schermo" + +#: sq_slideshow.cpp:223 +msgid "Show current index" +msgstr "Mostra indice corrente:" + +#: sq_slideshow.cpp:224 +msgid "Show file name" +msgstr "Mostra nome del file" + +#: sq_slideshow.cpp:225 +msgid "Show file size" +msgstr "Mostra dimensioni del file" + +#: sq_slideshow.cpp:226 +msgid "Recursively" +msgstr "Ricorsivamente" + +#: ksquirrel.cpp:288 +msgid "Clear history" +msgstr "Cancella cronologia" + +#: ksquirrel.cpp:289 +msgid "Clear address" +msgstr "Cancella indirizzo" + +#: ksquirrel.cpp:294 +msgid "Go!" +msgstr "Vai!" + +#: ksquirrel.cpp:341 +msgid "Libraries' filters" +msgstr "Filtri delle librerie" + +#: ksquirrel.cpp:364 +msgid "All supported formats" +msgstr "Tutti i formati supportati" + +#: ksquirrel.cpp:374 +msgid "User's filters" +msgstr "Filtri dell'utente" + +#: ksquirrel.cpp:510 +msgid "Folder tree" +msgstr "Albero delle cartelle" + +#: ksquirrel.cpp:511 +msgid "Mount points" +msgstr "Punti di montaggio" + +#: ksquirrel.cpp:628 +msgid "&Navigator" +msgstr "&Navigatore" + +#: ksquirrel.cpp:630 +msgid "&Action" +msgstr "&Azione" + +#: ksquirrel.cpp:633 +msgid "&KIPI Plugins" +msgstr "Plugin &KIPI" + +#: ksquirrel.cpp:661 +msgid "Fi<er" +msgstr "Fi<ro" + +#: ksquirrel.cpp:720 +msgid "Thumbnail size" +msgstr "Dimensioni miniature" + +#: ksquirrel.cpp:723 sq_options.ui.h:137 +msgid "Image window" +msgstr "Finestra immagine" + +#: ksquirrel.cpp:725 +msgid "Reload codecs from disk" +msgstr "Ricarica i codec dal disco" + +#: ksquirrel.cpp:726 +msgid "Configure external tools..." +msgstr "Configura strumenti esterni..." + +#: ksquirrel.cpp:727 +msgid "Configure filters..." +msgstr "Configura filtri..." + +#: ksquirrel.cpp:728 +msgid "Go to tray" +msgstr "Vai al vassoio" + +#: ksquirrel.cpp:729 +msgid "Open file and change directory" +msgstr "Apri file e cambia cartella" + +#: ksquirrel.cpp:730 +msgid "Open file" +msgstr "Apri file" + +#: ksquirrel.cpp:731 +msgid "Thumbnail cache manager..." +msgstr "Gestore cache miniature..." + +#: ksquirrel.cpp:735 +msgid "List" +msgstr "Elenco" + +#: ksquirrel.cpp:736 +msgid "Icons" +msgstr "Icone" + +#: ksquirrel.cpp:737 +msgid "Details" +msgstr "Dettagli" + +#: ksquirrel.cpp:738 sq_options.ui.h:136 +msgid "Thumbnails" +msgstr "Miniature" + +#: ksquirrel.cpp:740 +msgid "Show URL box" +msgstr "Mostra casella URL" + +#: ksquirrel.cpp:742 +msgid "Built-in image window" +msgstr "Finestra immagine integrata" + +#: ksquirrel.cpp:745 +msgid "Slideshow" +msgstr "Presentazione" + +#: ksquirrel.cpp:746 +msgid "Slideshow advanced" +msgstr "Presentazione avanzata" + +#: ksquirrel.cpp:748 +msgid "Codec information..." +msgstr "Informazioni codec..." + +#: ksquirrel.cpp:749 +msgid "OpenGL information..." +msgstr "Informazioni OpenGL..." + +#: ksquirrel.cpp:751 +msgid "Medium thumbnails" +msgstr "Miniature medie" + +#: ksquirrel.cpp:752 +msgid "Large thumbnails" +msgstr "Miniature grandi" + +#: ksquirrel.cpp:753 +msgid "Huge thumbnails" +msgstr "Miniature enormi" + +#: ksquirrel.cpp:755 +msgid "Select group" +msgstr "Seleziona gruppo" + +#: ksquirrel.cpp:756 +msgid "Deselect group" +msgstr "Deseleziona gruppo" + +#: ksquirrel.cpp:776 +msgid "Extended thumbnails" +msgstr "Miniature estese" + +#: ksquirrel.cpp:1085 +msgid " writing settings and thumbnails... " +msgstr " scrivo impostazioni e miniature... " + +#: sq_filters.cpp:124 sq_filters.cpp:197 +msgid "Extensions" +msgstr "Estensioni" + +#: sq_filters.cpp:181 +msgid "Adjust filters" +msgstr "Regola filtri" + +#: sq_filters.cpp:186 +msgid "New filter" +msgstr "Nuovo filtro" + +#: sq_filters.cpp:193 +msgid "Move filter up" +msgstr "Sposta filtro su" + +#: sq_filters.cpp:195 +msgid "Move filter down" +msgstr "Sposta filtro giù" + +#: sq_filters.cpp:198 +msgid "Menu item contains both name and extension" +msgstr "Voce di menu contiene sia nome che estensione" + +#: sq_helpwidget.cpp:175 +msgid "" +"

    " +"" +"" +"" +"" +"" +"

    Esc,X,Return

    close

    Middle click, F

    fullscreen

    Z

    show 'Zoom' menu

    /

    show this help

    Right click, M, " +"ContextMenu

    show context menu

    N

    toggle filter

    Shift + Left button

    select a region

    Shift + Left

    previous tab

    Shift + Right

    next tab

    W

    close tab

    " +msgstr "" +"

    " +"

    Esc,X,Invio

    chiudi

    Middle click, F

    schermo intero

    Z

    mostra il menu 'Zoom'

    /

    mostra questo aiuto

    Right click, M, " +"MenuContestuale

    mostra menu contestuale

    N

    commuta filtro

    Maiusc + pulsante Sinistro

    seleziona una zona

    Maiusc + Sinistra

    scheda precedente

    Maiusc + Destra

    scheda successiva

    W

    chiudi scheda

    " + +#: sq_helpwidget.cpp:176 +msgid "" +"

    Space, Page Down

    next image

    Backspace, Page Up

    previous image

    Home

    first image

    End

    last image

    " +msgstr "

    Spazio, Pagina Giù

    immagine successiva

    Bksp, Pagina Su

    immagine precedente

    Inizio

    prima immagine

    Fine

    ultima immagine

    " + +#: sq_helpwidget.cpp:177 +msgid "" +"

    " +msgstr "" +"

    Left, Right," +" Up, Down

    move the image

    Ctrl + Left

    rotate left

    Ctrl + Right

    rotate " +"right

    Ctrl + Up/Down

    rotate for 180 degrees up/down

    Alt + Left/Right

    rotate for 1 degree " +"left/right
    " + +#: sq_helpwidget.cpp:178 +msgid "" +"

    Sinistra, Destra, Su, Giù

    muove l'immagine

    Ctrl + Sinistra

    ruota a sinistra

    Ctrl + Destra

    ruota a destra

    Ctrl + Su/Giù

    ruota di 180 gradi in su/giù

    Alt + Sinistra/Destra

    ruota di 1 grado a sinistra/destra
    " +msgstr "" +"

    +/-

    zoom " +"Nx

    Ctrl + +/-

    zoom " +"2x/0.5x

    Scroll

    load next/" +"prev file OR zoom+/zoom-

    Shift + Scroll

    zoom+/zoom-

    Ctrl + Scroll

    zoom+ 2x/zoom- 2x

    1..9

    zoom 1..9x

    0

    zoom 10x

    comma

    fit " +"width

    period

    fit height

    *

    fit image

    +/-

    zoom " +"Nx

    Ctrl + +/-

    zoom " +"2x/0.5x

    Scorri

    carica file succ/prec OPPURE zoom+/zoom-

    Maiusc + Scorri

    zoom+/zoom-

    Ctrl + Scorri

    zoom+ 2x/zoom- 2x

    1...9

    zoom 1...9x

    0

    zoom 10x

    virgola

    adatta larghezza

    punto

    adatta altezza

    *

    adatta immagine

    " + +#: sq_helpwidget.cpp:179 +msgid "" +"

    " +"

    S

    save as

    V

    flip vertically

    H

    flip horizontally

    R

    reset

    P

    image properties

    C

    codec settings

    L

    ignore zoom if image is smaller than " +"window

    I

    menu with " +"images

    A

    stop/start " +"animation

    B

    toggle " +"drawing background for transparent images

    K

    toggle drawing tickmarks

    E

    show menu with external " +"tools

    Y

    crop

    F1

    first image in " +"multi-paged image

    F2

    previous

    F3

    next

    F4

    last
    " +msgstr "" +"

    S

    salva con nome

    V

    ribalta verticalmente

    H

    ribalta orizzontalmente

    R

    reimposta

    P

    proprietà dell'immagine

    C

    impostazioni codec

    L

    ignora zoom se l'immagine è minore della finestra

    I

    menu con immagini

    A

    ferma/riprendi animazione

    B

    commuta il disegno dello sfondo per le immagini trasparenti

    K

    commuta il disegno delle tacche

    E

    mostra il menu con gli strumenti esterni

    Y

    crop

    F1

    prima immagine in immagine multipagina

    F2

    precedente

    F3

    successiva

    F4

    ultima
    " + +#: sq_helpwidget.cpp:182 sq_options.ui.h:135 +msgid "Filing" +msgstr "Salvataggio" + +#: sq_helpwidget.cpp:184 +msgid "Current image" +msgstr "Immagine attuale" + +#: sq_options.ui.h:138 +msgid "Sidebar" +msgstr "Barra laterale" + +#: sq_options.ui.h:141 +msgid "KIPI" +msgstr "KIPI" + +#: sq_options.ui.h:260 +msgid "Wrong dimensions: %1x%2." +msgstr "Dimensioni errate: %1x%2." + +#: sq_slideshowlisting.cpp:87 +msgid "Listing" +msgstr "Elencare" + +#: ksquirrel.cpp:751 +msgid "Rename" +msgstr "Rinomina" + +#: ksquirrel.cpp:1951 +msgid "Renaming File" +msgstr "Rinomina File" + +#: ksquirrel.cpp:1952 +msgid "

    Rename file %1 to:

    " +msgstr "

    Rinomina file %1 come:

    " + +msgid "Calculate directory size" +msgstr "Calcola dimensioni della cartella" + +msgid "New folder..." +msgstr "Nuova cartella..." + +msgid "Create Subfolder" +msgstr "Crea Sottocartella" + +msgid "

    Create new folder in %1:

    " +msgstr "

    Crea nuova cartella in %1:

    " + +msgid "Rename Folder" +msgstr "Rinomina cartella" + +msgid "

    Rename folder %1 to:

    " +msgstr "

    Rinomina la cartella %1 come:

    " + +msgid "Are you sure you want to delete %1?" +msgstr "Sei sicuro di voler eliminare %1?" + +msgid "Copy to last folder" +msgstr "Copia nell'ultima cartella" + +msgid "Move to last folder" +msgstr "Sposta nell'ultima cartella" + +msgid "Message text color:" +msgstr "Colore dei messaggi di testo:" + +msgid "Total" +msgstr "Totale" + +msgid "Visualize drag operation" +msgstr "Visualizza operazione di trascinamento" + +msgid "Testing" +msgstr "Prova" + +msgid "Lazy thumbnail generation" +msgstr "Generazione lenta delle miniature" + +msgid "Delay" +msgstr "Ritardo" + +msgid "Interface" +msgstr "Interfaccia" + +msgid "Number of text lines" +msgstr "Numero di linee di testo" + +msgid "Show file preview" +msgstr "Mostra anteprima del file" + +msgid "Number of additionally generated rows" +msgstr "Numero di righe generate addizionalmente" + +msgid "Repeat (copy to %1)" +msgstr "Ripeti (copia a %1)" + +msgid "Repeat (move to %1)" +msgstr "Ripeti (sposta a %1)" + +msgid "Repeat (link to %1)" +msgstr "Ripeti (collega a %1)" + +msgid "Repeat (nothing to repeat)" +msgstr "Ripeti (niente da ripetere)" + +msgid "Clear contents" +msgstr "Cancella contenuti" + +msgid "Are you sure you want to delete contents of %1?" +msgstr "Sei sicuro di voler eliminare i contenuti di %1?" + +msgid "Add to Folder Basket" +msgstr "Aggiungi al Cestino della Cartella" + +msgid "Folder basket" +msgstr "Cestino della cartella" + +msgid "Change icon" +msgstr "Cambia icona" + +msgid "

    Rename item %1 to:

    " +msgstr "

    Rinomina oggetto %1 come:

    " + +msgid "Copy file path" +msgstr "Copia percorso del file" + +msgid "Copy file url" +msgstr "Copia url del file" + +msgid "Text color:" +msgstr "Colore del testo:" + +msgid "Show image dimensions" +msgstr "Mostra dimensioni dell'immagine" + +msgid "Text color..." +msgstr "Colore del testo..." + +msgid "Double click" +msgstr "Doppio clic" + +msgid "Close window" +msgstr "Chiudi finestra" + +msgid "Crop" +msgstr "Ritaglia" + +msgid "Tabs" +msgstr "Schede" + +msgid "Enable tabs" +msgstr "Abilita schede" + +msgid "Ask what to do when opening new image" +msgstr "Chiedi cosa fare aprendo una nuova imagine" + +msgid "Show close buttons" +msgstr "Mostra pulsanti di chiusura" + +msgid "Open in a new tab" +msgstr "Apri in una nuova scheda" + +msgid "Replace current tab" +msgstr "Sostituisci scheda attuale" + +msgid "Close all and open in a new tab" +msgstr "Chiudi tutte e apri in una nuova scheda" + +msgid "Opening..." +msgstr "Apro..." + +msgid "Previous tab" +msgstr "Scheda precedente" + +msgid "Next tab" +msgstr "Scheda successiva" + +msgid "Close tab" +msgstr "Chiudi scheda" + +msgid "Do nothing" +msgstr "Non fare nulla" + +msgid "Print available DCOP parameters" +msgstr "" + +msgid "Downloading..." +msgstr "" + +msgid "Close all tabs" +msgstr "" + +msgid "Close all opened images when closing window" +msgstr "" + +msgid "Codec manager..." +msgstr "" + +msgid "Select codecs to disable:" +msgstr "" + +msgid "Select codecs to enable:" +msgstr "" diff --git a/po/ksquirrel.pot b/po/ksquirrel.pot new file mode 100644 index 0000000..a52a153 --- /dev/null +++ b/po/ksquirrel.pot @@ -0,0 +1,2108 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2007-08-07 09:34+0300\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=CHARSET\n" +"Content-Transfer-Encoding: 8bit\n" + +#: sq_filters.ui.h:56 sq_filters.ui.h:58 sq_externaltools.cpp:67 +#: sq_externaltools.cpp:194 sidebar/sq_mountview.cpp:64 sq_viewcache.cpp:47 +#: sq_viewcache.cpp:105 sq_filters.cpp:123 sq_filters.cpp:196 +msgid "Name" +msgstr "" + +#: sq_externaltool.cpp:102 sq_externaltool.cpp:162 sq_externaltool.cpp:170 +msgid "No file selected" +msgstr "" + +#: sq_kipimanager.cpp:68 +msgid "No Plugins" +msgstr "" + +#: sq_kipimanager.cpp:125 +msgid "Image actions" +msgstr "" + +#: sq_kipimanager.cpp:126 +msgid "Effects" +msgstr "" + +#: sq_kipimanager.cpp:127 +msgid "Tools" +msgstr "" + +#: sq_kipimanager.cpp:130 +msgid "Batch processing" +msgstr "" + +#: sq_kipimanager.cpp:131 +msgid "Collections" +msgstr "" + +#: sq_libraryhandler.cpp:148 +msgid "All files" +msgstr "" + +#: sq_navigatordropmenu.cpp:40 +msgid "Copy here" +msgstr "" + +#: sq_navigatordropmenu.cpp:43 +msgid "Move here" +msgstr "" + +#: sq_navigatordropmenu.cpp:46 +msgid "Link here" +msgstr "" + +#: sq_glinfo.cpp:45 sq_glinfo.cpp:92 +msgid "Parameter" +msgstr "" + +#: sq_glinfo.cpp:46 sq_glinfo.cpp:93 sq_imageproperties.cpp:321 +#: sq_imageproperties.cpp:408 imageedit/sq_imagefilter.cpp:487 +msgid "Value" +msgstr "" + +#: sq_glinfo.cpp:91 +msgid "OpenGL information" +msgstr "" + +#: sq_externaltools.cpp:66 sq_externaltools.cpp:193 +msgid "Pixmap" +msgstr "" + +#: sq_externaltools.cpp:68 sq_externaltools.cpp:195 +msgid "Command" +msgstr "" + +#: sq_externaltools.cpp:190 +msgid "Adjust external tools" +msgstr "" + +#: sq_externaltools.cpp:192 sq_filters.cpp:182 +msgid "OK" +msgstr "" + +#: sq_externaltools.cpp:196 sq_externaltools.ui.h:146 +#, c-format +msgid "" +"Command can contain
    • %f: one file
    • %F: multiple files
    " +msgstr "" + +#: sq_externaltools.cpp:199 +msgid "New tool" +msgstr "" + +#: sq_externaltools.cpp:206 +msgid "Move tool up" +msgstr "" + +#: sq_externaltools.cpp:208 +msgid "Move tool down" +msgstr "" + +#: sq_kipiinterface.cpp:72 +msgid "Root directory" +msgstr "" + +#: sq_kipiinterface.cpp:144 +msgid "Folder content" +msgstr "" + +#: sq_kipiinterface.cpp:161 +msgid "Selected images" +msgstr "" + +#: sq_kipiinterface.cpp:175 ksquirrel.cpp:513 +msgid "Image basket" +msgstr "" + +#: main.cpp:40 +msgid "File to be opened at startup." +msgstr "" + +#: main.cpp:41 +msgid "Print found libraries and exit." +msgstr "" + +#: main.cpp:57 +msgid "KSquirrel - image viewer for KDE" +msgstr "" + +#: main.cpp:66 +msgid "Bug reports, patches" +msgstr "" + +#: main.cpp:67 +msgid "Bug reports" +msgstr "" + +#: main.cpp:68 +msgid "Translation help" +msgstr "" + +#: main.cpp:69 +msgid "TiamaT" +msgstr "" + +#: main.cpp:69 +msgid "Initial artwork for edit tools" +msgstr "" + +#: main.cpp:70 +msgid "Fera" +msgstr "" + +#: main.cpp:70 +msgid "Great artwork for edit tools" +msgstr "" + +#: main.cpp:71 +msgid "OpenGL forum at" +msgstr "" + +#: main.cpp:72 +msgid "GameDev forum at" +msgstr "" + +#: sq_imageproperties.cpp:320 sq_imageproperties.cpp:407 +msgid "Group" +msgstr "" + +#: sq_imageproperties.cpp:359 sq_glwidget.cpp:350 +msgid "Image properties" +msgstr "" + +#: sq_imageproperties.cpp:361 +msgid "Attributes" +msgstr "" + +#: sq_imageproperties.cpp:362 +msgid "Owner:" +msgstr "" + +#: sq_imageproperties.cpp:363 +msgid "Group:" +msgstr "" + +#: sq_imageproperties.cpp:365 +msgid "Permissions:" +msgstr "" + +#: sq_imageproperties.cpp:368 +msgid "Time" +msgstr "" + +#: sq_imageproperties.cpp:369 +msgid "Created:" +msgstr "" + +#: sq_imageproperties.cpp:370 +msgid "Last read:" +msgstr "" + +#: sq_imageproperties.cpp:371 +msgid "Last modified:" +msgstr "" + +#: sq_imageproperties.cpp:375 sq_helpwidget.cpp:181 sq_options.ui.h:134 +msgid "General" +msgstr "" + +#: sq_imageproperties.cpp:376 +msgid "File:" +msgstr "" + +#: sq_imageproperties.cpp:378 sq_pluginsinfo.cpp:137 sq_slideshow.cpp:211 +msgid "Directory:" +msgstr "" + +#: sq_imageproperties.cpp:379 +msgid "Size:" +msgstr "" + +#: sq_imageproperties.cpp:381 +msgid "Type:" +msgstr "" + +#: sq_imageproperties.cpp:382 +msgid "Number of frames:" +msgstr "" + +#: sq_imageproperties.cpp:383 +msgid "Current frame" +msgstr "" + +#: sq_imageproperties.cpp:384 sq_slideshow.cpp:219 +msgid "Delay:" +msgstr "" + +#: sq_imageproperties.cpp:385 +msgid "Dimensions:" +msgstr "" + +#: sq_imageproperties.cpp:386 +msgid "Bits per pixel:" +msgstr "" + +#: sq_imageproperties.cpp:387 +msgid "Color space:" +msgstr "" + +#: sq_imageproperties.cpp:388 +msgid "Compression:" +msgstr "" + +#: sq_imageproperties.cpp:389 +msgid "Uncompressed size:" +msgstr "" + +#: sq_imageproperties.cpp:390 +msgid "Compression ratio:" +msgstr "" + +#: sq_imageproperties.cpp:391 +msgid "Interlaced:" +msgstr "" + +#: sq_imageproperties.cpp:392 +msgid "Status:" +msgstr "" + +#: sq_imageproperties.cpp:406 sq_glwidget.cpp:2662 sq_options.cpp:816 +msgid "Image" +msgstr "" + +#: sq_imageproperties.cpp:409 +msgid "Metadata" +msgstr "" + +#: sq_pluginsinfo.cpp:55 sq_pluginsinfo.cpp:129 +msgid "..." +msgstr "" + +#: sq_pluginsinfo.cpp:56 sq_pluginsinfo.cpp:130 +msgid "Icon" +msgstr "" + +#: sq_pluginsinfo.cpp:57 sq_pluginsinfo.cpp:131 +msgid "Library" +msgstr "" + +#: sq_pluginsinfo.cpp:58 sq_pluginsinfo.cpp:132 +msgid "Version" +msgstr "" + +#: sq_pluginsinfo.cpp:59 sq_pluginsinfo.cpp:133 sq_viewcache.cpp:48 +#: sq_viewcache.cpp:106 +msgid "MIME" +msgstr "" + +#: sq_pluginsinfo.cpp:128 +msgid "Codec information and settings" +msgstr "" + +#: sq_pluginsinfo.cpp:138 +msgid "Total found:" +msgstr "" + +#: sq_errorstring.cpp:34 +msgid "cannot open file for reading" +msgstr "" + +#: sq_errorstring.cpp:35 +msgid "file corrupted" +msgstr "" + +#: sq_errorstring.cpp:36 +msgid "no memory" +msgstr "" + +#: sq_errorstring.cpp:37 +msgid "file type not supported" +msgstr "" + +#: sq_errorstring.cpp:38 +msgid "wrong image dimensions" +msgstr "" + +#: sq_errorstring.cpp:39 +msgid "cannot open file for writing" +msgstr "" + +#: sq_errorstring.cpp:40 +msgid "write feature is not supported" +msgstr "" + +#: sq_errorstring.cpp:41 +msgid "write error (check free space)" +msgstr "" + +#: sq_errorstring.cpp:42 +msgid "wrong parameters" +msgstr "" + +#: sq_errorstring.cpp:43 +msgid "Editing process is not finished yet" +msgstr "" + +#: sq_selectdeselectgroup.cpp:83 +msgid "Filename or mask:" +msgstr "" + +#: sidebar/sq_treeview.cpp:89 +msgid "root" +msgstr "" + +#: sidebar/sq_categoriesview.cpp:95 ksquirrel.cpp:512 +msgid "Categories" +msgstr "" + +#: sidebar/sq_categoriesview.cpp:115 sidebar/sq_categoriesview.cpp:166 +msgid "New category" +msgstr "" + +#: sidebar/sq_categoriesview.cpp:153 sidebar/sq_categoriesview.cpp:218 +msgid "New Category" +msgstr "" + +#: sidebar/sq_categoriesview.cpp:169 sidebar/sq_categoriesview.cpp:198 +msgid "Create default categories" +msgstr "" + +#: sidebar/sq_categoriesview.cpp:197 +msgid "" +"This will create default categories: Concerts, Pets, Home, Friends, Free time, " +"Travelling and Nature. Continue?" +msgstr "" + +#: sidebar/sq_categoriesview.cpp:218 +msgid "Create new category:" +msgstr "" + +#: sidebar/sq_mountview.cpp:43 +msgid "Mount" +msgstr "" + +#: sidebar/sq_mountview.cpp:45 +msgid "Unmount" +msgstr "" + +#: sidebar/sq_mountview.cpp:47 +msgid "Refresh" +msgstr "" + +#: sidebar/sq_mountview.cpp:170 +msgid "Device" +msgstr "" + +#: sidebar/sq_mountview.cpp:173 +msgid "FS Type" +msgstr "" + +#: sidebar/sq_imagebasket.cpp:244 +msgid "Synchronize" +msgstr "" + +#: sidebar/sq_previewwidget.cpp:60 +msgid "Background color..." +msgstr "" + +#: sidebar/sq_categorybrowsermenu.cpp:137 +#: sidebar/sq_categorybrowsermenu.cpp:146 +msgid "Failed to Read Folder" +msgstr "" + +#: sidebar/sq_categorybrowsermenu.cpp:154 +msgid "Not Authorized to Read Folder" +msgstr "" + +#: sidebar/sq_categorybrowsermenu.cpp:167 +msgid "Add here" +msgstr "" + +#: sidebar/sq_categorybrowsermenu.cpp:310 +msgid "More..." +msgstr "" + +#: sq_thumbnailcachemaster.cpp:143 +msgid "Thumbnail cache" +msgstr "" + +#: sq_thumbnailcachemaster.cpp:144 +msgid "Calculate cache size on disk" +msgstr "" + +#: sq_thumbnailcachemaster.cpp:146 +msgid "Clear cache on disk" +msgstr "" + +#: sq_thumbnailcachemaster.cpp:147 +msgid "View memory cache" +msgstr "" + +#: sq_thumbnailcachemaster.cpp:148 +msgid "Clear cache in memory" +msgstr "" + +#: sq_thumbnailcachemaster.cpp:150 +msgid "Sync cache to disk" +msgstr "" + +#: sq_thumbnailcachemaster.cpp:151 +msgid "Calculate cache size in memory" +msgstr "" + +#: sq_diroperator.cpp:138 +msgid "remote filesystem" +msgstr "" + +#: sq_diroperator.cpp:158 +msgid "" +"
    Mount point:%1
    Total size:%" +"2
    Used:%3
    Available:%4
    " +msgstr "" + +#: sq_diroperator.cpp:245 +msgid "no files selected" +msgstr "" + +#: sq_diroperator.cpp:306 +msgid "Edit file type" +msgstr "" + +#: sq_diroperator.cpp:307 +msgid "Add to Basket" +msgstr "" + +#: sq_diroperator.cpp:309 sq_diroperator.cpp:889 +msgid "File actions" +msgstr "" + +#: sq_diroperator.cpp:327 +msgid "Copy to..." +msgstr "" + +#: sq_diroperator.cpp:328 +msgid "Move to..." +msgstr "" + +#: sq_diroperator.cpp:329 +msgid "Link to..." +msgstr "" + +#: sq_diroperator.cpp:331 +msgid "Run" +msgstr "" + +#: sq_diroperator.cpp:333 +msgid "Recreate selected thumbnails" +msgstr "" + +#: sq_diroperator.cpp:336 +msgid "Convert..." +msgstr "" + +#: sq_diroperator.cpp:439 +msgid "Total %1 in %2 (%3, %4)" +msgstr "" + +#: sq_diroperator.cpp:441 +msgid "1 item" +msgstr "" + +#: sq_diroperator.cpp:442 +msgid "1 folder" +msgstr "" + +#: sq_diroperator.cpp:443 +msgid "1 file" +msgstr "" + +#: sq_diroperator.cpp:627 +#, c-format +msgid "Command cannot contain both \"%f\" and \"%F\"" +msgstr "" + +#: sq_diroperator.cpp:627 sq_diroperator.cpp:632 +msgid "Error processing command" +msgstr "" + +#: sq_diroperator.cpp:632 +#, c-format +msgid "Command should contain \"%f\" or \"%F\"" +msgstr "" + +#: sq_diroperator.cpp:741 +msgid "Unsupported format \"%1\"" +msgstr "" + +#: sq_diroperator.cpp:886 +msgid "Add to &Category" +msgstr "" + +#: sq_diroperator.cpp:890 +msgid "&External tools" +msgstr "" + +#: sq_slideshowwidget.cpp:345 +msgid "" +"
    Enter, Escape, Returnstop " +"slideshow
    Pause, Spacepause/unpause " +"slideshow
    Page Upprevious image
    Page Downnext image
    Mshow/hide onscreen messages
    " +msgstr "" + +#: sq_codecsettingsskeleton.ui.h:28 +msgid "" +"Error loading widget from %1. Please check your installation or " +"contact ksquirrel.iv@gmail.com" +msgstr "" + +#: sq_widgetstack.cpp:473 sq_widgetstack.cpp:507 +msgid "No files to copy or move" +msgstr "" + +#: sq_widgetstack.cpp:607 +msgid "Select a group of files" +msgstr "" + +#: sq_widgetstack.cpp:607 +msgid "Deselect a group of files" +msgstr "" + +#: sq_widgetstack.cpp:608 +msgid "Select!" +msgstr "" + +#: sq_widgetstack.cpp:608 +msgid "Deselect!" +msgstr "" + +#: sq_filethumbview.cpp:370 +msgid "" +"%3%4" +msgstr "" + +#: sq_filethumbview.cpp:373 +msgid "" +msgstr "" + +#: imageedit/sq_writeoption.cpp:108 +msgid "RLE compression" +msgstr "" + +#: imageedit/sq_writeoption.cpp:109 +msgid "Compression level" +msgstr "" + +#: imageedit/sq_writeoption.cpp:110 +msgid "Interlaced" +msgstr "" + +#: imageedit/sq_writeoption.cpp:112 +msgid "No special options available for this format" +msgstr "" + +#: imageedit/sq_converter.cpp:47 +msgid "internal error" +msgstr "" + +#: imageedit/sq_converter.cpp:48 +msgid "failed" +msgstr "" + +#: imageedit/sq_converter.cpp:50 +msgid "Converting" +msgstr "" + +#: imageedit/sq_converter.cpp:68 +msgid "Select files to edit" +msgstr "" + +#: imageedit/sq_converter.cpp:73 +msgid "" +"Converter cannot work with remote files.\n" +"Sorry" +msgstr "" + +#: imageedit/sq_converter.cpp:160 +msgid "Temporary file creation failed" +msgstr "" + +#: imageedit/sq_converter.cpp:243 sq_imageproperties.ui.h:72 +msgid "1 error" +msgstr "" + +#: imageedit/sq_converter.cpp:250 +msgid "Removing" +msgstr "" + +#: imageedit/sq_converter.cpp:436 +msgid "Convert 1 file" +msgstr "" + +#: imageedit/sq_imageeditoptions.cpp:134 +msgid "Edit options" +msgstr "" + +#: imageedit/sq_imageeditoptions.cpp:135 +msgid "New files" +msgstr "" + +#: imageedit/sq_imageeditoptions.cpp:136 +msgid "Place here" +msgstr "" + +#: imageedit/sq_imageeditoptions.cpp:137 +msgid "Replace original files" +msgstr "" + +#: imageedit/sq_imageeditoptions.cpp:138 +msgid "Place files in current directory, renaming them if necessary" +msgstr "" + +#: imageedit/sq_imageeditoptions.cpp:139 +msgid "Place files in current directory, replacing existing files" +msgstr "" + +#: imageedit/sq_imageeditoptions.cpp:140 +msgid "Close, when all operations succeeded" +msgstr "" + +#: imageedit/sq_imagebcg.ui.h:17 imageedit/sq_imagebcg.ui.h:31 +#: imageedit/sq_imagebcg.cpp:382 +msgid "Brightness" +msgstr "" + +#: imageedit/sq_imagebcg.ui.h:18 imageedit/sq_imagebcg.ui.h:31 +#: imageedit/sq_imagebcg.cpp:383 +msgid "Contrast" +msgstr "" + +#: imageedit/sq_imagebcg.ui.h:19 imageedit/sq_imagebcg.ui.h:31 +#: imageedit/sq_imagebcg.cpp:384 +msgid "Gamma" +msgstr "" + +#: imageedit/sq_imagebcg.ui.h:20 imageedit/sq_imagebcg.ui.h:32 +#: imageedit/sq_imagebcg.cpp:390 +msgid "Red" +msgstr "" + +#: imageedit/sq_imagebcg.ui.h:20 +msgid "Cyan" +msgstr "" + +#: imageedit/sq_imagebcg.ui.h:21 imageedit/sq_imagebcg.ui.h:32 +#: imageedit/sq_imagebcg.cpp:389 +msgid "Green" +msgstr "" + +#: imageedit/sq_imagebcg.ui.h:21 +msgid "Magenta" +msgstr "" + +#: imageedit/sq_imagebcg.ui.h:22 imageedit/sq_imagebcg.ui.h:32 +#: imageedit/sq_imagebcg.cpp:388 +msgid "Blue" +msgstr "" + +#: imageedit/sq_imagebcg.ui.h:22 +msgid "Yellow" +msgstr "" + +#: imageedit/sq_imagefilter.cpp:473 imageedit/sq_imagefilter.cpp:539 +msgid "Filter" +msgstr "" + +#: imageedit/sq_imagefilter.cpp:474 imageedit/sq_imagefilter.cpp:486 +msgid "Color:" +msgstr "" + +#: imageedit/sq_imagefilter.cpp:476 +msgid "Opacity" +msgstr "" + +#: imageedit/sq_imagefilter.cpp:477 imageedit/sq_imagefilter.cpp:482 +#: imageedit/sq_imagefilter.cpp:505 +msgid "Sigma" +msgstr "" + +#: imageedit/sq_imagefilter.cpp:478 imageedit/sq_imagefilter.cpp:481 +#: imageedit/sq_imagefilter.cpp:483 imageedit/sq_imagefilter.cpp:501 +#: imageedit/sq_imagefilter.cpp:506 +msgid "Radius" +msgstr "" + +#: imageedit/sq_imagefilter.cpp:479 imageedit/sq_imagefilter.cpp:492 +#: imageedit/sq_imagefilter.cpp:507 +msgid "Factor" +msgstr "" + +#: imageedit/sq_imagefilter.cpp:480 imageedit/sq_imagefilter.cpp:484 +#: imageedit/sq_imagefilter.cpp:493 imageedit/sq_imagefilter.cpp:514 +msgid "" +"There are no special options available for this filter. Just click \"Filter" +"\"." +msgstr "" + +#: imageedit/sq_imagefilter.cpp:490 +msgid "Color 1:" +msgstr "" + +#: imageedit/sq_imagefilter.cpp:491 +msgid "Color 2:" +msgstr "" + +#: imageedit/sq_imagefilter.cpp:494 +msgid "Noise type" +msgstr "" + +#: imageedit/sq_imagefilter.cpp:495 +msgid "Uniform" +msgstr "" + +#: imageedit/sq_imagefilter.cpp:496 +msgid "Impulse" +msgstr "" + +#: imageedit/sq_imagefilter.cpp:497 +msgid "Multiplicative Gaussian" +msgstr "" + +#: imageedit/sq_imagefilter.cpp:498 +msgid "Poisson" +msgstr "" + +#: imageedit/sq_imagefilter.cpp:499 +msgid "Gaussian" +msgstr "" + +#: imageedit/sq_imagefilter.cpp:500 +msgid "Laplacian" +msgstr "" + +#: imageedit/sq_imagefilter.cpp:502 +msgid "Color" +msgstr "" + +#: imageedit/sq_imagefilter.cpp:503 +msgid "Elevation" +msgstr "" + +#: imageedit/sq_imagefilter.cpp:504 +msgid "Azimuth" +msgstr "" + +#: imageedit/sq_imagefilter.cpp:508 +msgid "Amount" +msgstr "" + +#: imageedit/sq_imagefilter.cpp:509 +msgid "Type" +msgstr "" + +#: imageedit/sq_imagefilter.cpp:510 +msgid "GBR" +msgstr "" + +#: imageedit/sq_imagefilter.cpp:511 +msgid "BRG" +msgstr "" + +#: imageedit/sq_imagefilter.cpp:512 +msgid "Degrees" +msgstr "" + +#: imageedit/sq_imagefilter.cpp:513 imageedit/sq_imagefilter.cpp:515 +#: imageedit/sq_imagefilter.cpp:536 +msgid "Threshold" +msgstr "" + +#: imageedit/sq_imagefilter.cpp:517 +msgid "Blend" +msgstr "" + +#: imageedit/sq_imagefilter.cpp:518 +msgid "Blur" +msgstr "" + +#: imageedit/sq_imagefilter.cpp:519 +msgid "Desaturate" +msgstr "" + +#: imageedit/sq_imagefilter.cpp:520 +msgid "Despeckle" +msgstr "" + +#: imageedit/sq_imagefilter.cpp:521 +msgid "Edge" +msgstr "" + +#: imageedit/sq_imagefilter.cpp:522 +msgid "Emboss" +msgstr "" + +#: imageedit/sq_imagefilter.cpp:523 +msgid "Equalize" +msgstr "" + +#: imageedit/sq_imagefilter.cpp:524 +msgid "Fade" +msgstr "" + +#: imageedit/sq_imagefilter.cpp:525 +msgid "Flatten" +msgstr "" + +#: imageedit/sq_imagefilter.cpp:526 +msgid "Implode" +msgstr "" + +#: imageedit/sq_imagefilter.cpp:527 +msgid "Negative" +msgstr "" + +#: imageedit/sq_imagefilter.cpp:528 +msgid "Noise" +msgstr "" + +#: imageedit/sq_imagefilter.cpp:529 +msgid "Oil" +msgstr "" + +#: imageedit/sq_imagefilter.cpp:530 +msgid "Shade" +msgstr "" + +#: imageedit/sq_imagefilter.cpp:531 +msgid "Sharpen" +msgstr "" + +#: imageedit/sq_imagefilter.cpp:532 +msgid "Solarize" +msgstr "" + +#: imageedit/sq_imagefilter.cpp:533 +msgid "Spread" +msgstr "" + +#: imageedit/sq_imagefilter.cpp:534 +msgid "Swap colors" +msgstr "" + +#: imageedit/sq_imagefilter.cpp:535 +msgid "Swirl" +msgstr "" + +#: imageedit/sq_imagefilter.cpp:537 +msgid "Grayscale" +msgstr "" + +#: imageedit/sq_imagefilter.cpp:538 +msgid "Redeye" +msgstr "" + +#: imageedit/sq_imagefilter.cpp:541 +msgid "Image after filtering:" +msgstr "" + +#: imageedit/sq_imagefilter.cpp:542 imageedit/sq_imagebcg.cpp:397 +msgid "Original image:" +msgstr "" + +#: imageedit/sq_imagebcg.cpp:378 +msgid "Color balance" +msgstr "" + +#: imageedit/sq_imagebcg.cpp:394 +msgid "Colorize" +msgstr "" + +#: imageedit/sq_imagebcg.cpp:396 +msgid "Image after colorizing:" +msgstr "" + +#: imageedit/sq_imageconvert.cpp:167 +msgid "Convert" +msgstr "" + +#: imageedit/sq_imageconvert.cpp:172 +msgid "Conversion options" +msgstr "" + +#: sq_viewcache.cpp:49 sq_viewcache.cpp:107 +msgid "Parameters" +msgstr "" + +#: sq_viewcache.cpp:103 +msgid "Memory cache" +msgstr "" + +#: sq_viewcache.cpp:108 +msgid "Total:" +msgstr "" + +#: sq_imageproperties.ui.h:29 +msgid "Copy entry" +msgstr "" + +#: sq_imageproperties.ui.h:30 +msgid "Copy all entries" +msgstr "" + +#: sq_imageproperties.ui.h:95 +msgid "EXIF" +msgstr "" + +#: sq_imageproperties.ui.h:105 +msgid "Simple" +msgstr "" + +#: sq_imageproperties.ui.h:108 +msgid "Full" +msgstr "" + +#: sq_imageproperties.ui.h:127 +msgid "EXIF (no)" +msgstr "" + +#: sq_imageproperties.ui.h:177 +msgid "Metadata (no)" +msgstr "" + +#: _translatorinfo.cpp:1 +msgid "" +"_: NAME OF TRANSLATORS\n" +"Your names" +msgstr "" + +#: _translatorinfo.cpp:3 +msgid "" +"_: EMAIL OF TRANSLATORS\n" +"Your emails" +msgstr "" + +#: sq_glwidget.cpp:233 +msgid "Rectangle" +msgstr "" + +#: sq_glwidget.cpp:234 +msgid "Ellipse" +msgstr "" + +#: sq_glwidget.cpp:239 +msgid "Fit width" +msgstr "" + +#: sq_glwidget.cpp:240 +msgid "Fit height" +msgstr "" + +#: sq_glwidget.cpp:241 +msgid "Fit image" +msgstr "" + +#: sq_glwidget.cpp:242 +msgid "Zoom 100%" +msgstr "" + +#: sq_glwidget.cpp:243 +msgid "Leave previous zoom" +msgstr "" + +#: sq_glwidget.cpp:244 +msgid "Ignore, if image is smaller than window" +msgstr "" + +#: sq_glwidget.cpp:318 +msgid "Go to first image" +msgstr "" + +#: sq_glwidget.cpp:319 +msgid "Previous image" +msgstr "" + +#: sq_glwidget.cpp:321 +msgid "Next image" +msgstr "" + +#: sq_glwidget.cpp:323 +msgid "Go to last image" +msgstr "" + +#: sq_glwidget.cpp:326 sq_glwidget.cpp:2685 +msgid "Zoom +" +msgstr "" + +#: sq_glwidget.cpp:328 sq_glwidget.cpp:2686 +msgid "Zoom -" +msgstr "" + +#: sq_glwidget.cpp:332 sq_glwidget.cpp:2677 +msgid "Rotate left" +msgstr "" + +#: sq_glwidget.cpp:334 sq_glwidget.cpp:2678 +msgid "Rotate right" +msgstr "" + +#: sq_glwidget.cpp:336 sq_glwidget.cpp:2707 +msgid "Flip vertically" +msgstr "" + +#: sq_glwidget.cpp:338 sq_glwidget.cpp:2708 +msgid "Flip horizontally" +msgstr "" + +#: sq_glwidget.cpp:340 +msgid "Normalize" +msgstr "" + +#: sq_glwidget.cpp:342 sq_glwidget.cpp:2723 +msgid "Fullscreen" +msgstr "" + +#: sq_glwidget.cpp:344 +msgid "Select image" +msgstr "" + +#: sq_glwidget.cpp:346 +msgid "Selection" +msgstr "" + +#: sq_glwidget.cpp:348 sq_glwidget.cpp:2717 sq_codecsettingsskeleton.cpp:128 +msgid "Codec settings" +msgstr "" + +#: sq_glwidget.cpp:351 +msgid "Show navigator" +msgstr "" + +#: sq_glwidget.cpp:1024 +msgid "yes" +msgstr "" + +#: sq_glwidget.cpp:1024 +msgid "no" +msgstr "" + +#: sq_glwidget.cpp:1485 +msgid "Codec for %1 format not found" +msgstr "" + +#: sq_glwidget.cpp:1729 +msgid "Memory allocation failed for %1 of memory" +msgstr "" + +#: sq_glwidget.cpp:1741 +msgid "Memory allocation failed" +msgstr "" + +#: sq_glwidget.cpp:1747 +msgid "Decoding failed" +msgstr "" + +#: sq_glwidget.cpp:1849 +msgid " ms." +msgstr "" + +#: sq_glwidget.cpp:2363 +msgid "" +"Sorry, could not perform write operation\n" +"for codec \"%1\"" +msgstr "" + +#: sq_glwidget.cpp:2382 sq_glwidget.cpp:2390 sq_glwidget.cpp:2412 +msgid "Error writing image" +msgstr "" + +#: sq_glwidget.cpp:2433 +msgid "Try another location?" +msgstr "" + +#: sq_glwidget.cpp:2658 +msgid "Rotate" +msgstr "" + +#: sq_glwidget.cpp:2661 sq_options.cpp:803 +msgid "Window" +msgstr "" + +#: sq_glwidget.cpp:2670 +msgid "Next" +msgstr "" + +#: sq_glwidget.cpp:2671 +msgid "Previous" +msgstr "" + +#: sq_glwidget.cpp:2672 +msgid "First" +msgstr "" + +#: sq_glwidget.cpp:2673 +msgid "Last" +msgstr "" + +#: sq_glwidget.cpp:2680 +msgid "Rotate 180'" +msgstr "" + +#: sq_glwidget.cpp:2682 +msgid "Rotate 1' left" +msgstr "" + +#: sq_glwidget.cpp:2683 +msgid "Rotate 1' right" +msgstr "" + +#: sq_glwidget.cpp:2687 +msgid "Zoom 2x" +msgstr "" + +#: sq_glwidget.cpp:2688 +msgid "Zoom 1/2x" +msgstr "" + +#: sq_glwidget.cpp:2698 +msgid "Move left" +msgstr "" + +#: sq_glwidget.cpp:2699 +msgid "Move right" +msgstr "" + +#: sq_glwidget.cpp:2700 +msgid "Move up" +msgstr "" + +#: sq_glwidget.cpp:2701 +msgid "Move down" +msgstr "" + +#: sq_glwidget.cpp:2703 +msgid "Start/stop animation" +msgstr "" + +#: sq_glwidget.cpp:2704 +msgid "Hide/show background" +msgstr "" + +#: sq_glwidget.cpp:2705 +msgid "Hide/show tickmarks" +msgstr "" + +#: sq_glwidget.cpp:2710 +msgid "First page" +msgstr "" + +#: sq_glwidget.cpp:2711 +msgid "Previous page" +msgstr "" + +#: sq_glwidget.cpp:2712 +msgid "Next page" +msgstr "" + +#: sq_glwidget.cpp:2713 +msgid "Last page" +msgstr "" + +#: sq_glwidget.cpp:2715 +msgid "To clipboard" +msgstr "" + +#: sq_glwidget.cpp:2720 +msgid "Color balance..." +msgstr "" + +#: sq_glwidget.cpp:2721 +msgid "Apply filter..." +msgstr "" + +#: sq_glwidget.cpp:2724 +msgid "Hide/show toolbar" +msgstr "" + +#: sq_glwidget.cpp:2725 +msgid "Hide/show statusbar" +msgstr "" + +#: sq_glwidget.cpp:2728 +msgid "Reset" +msgstr "" + +#: sq_glwidget.cpp:2731 sq_helpwidget.cpp:174 +msgid "Hotkeys" +msgstr "" + +#: sq_glview.cpp:84 +msgid "Loading time" +msgstr "" + +#: sq_options.cpp:746 +msgid "The main options" +msgstr "" + +#: sq_options.cpp:748 +msgid "Write configuration file to disk, when I press \"OK\"" +msgstr "" + +#: sq_options.cpp:749 +msgid "Minimize to tray after closing" +msgstr "" + +#: sq_options.cpp:750 +msgid "Show splash screen at startup" +msgstr "" + +#: sq_options.cpp:751 +msgid "Don't show animated logo in toolbar" +msgstr "" + +#: sq_options.cpp:752 +msgid "Apply codec settings to" +msgstr "" + +#: sq_options.cpp:753 +msgid "Thumbnail loader" +msgstr "" + +#: sq_options.cpp:754 +msgid "Image viewer (also preview window)" +msgstr "" + +#: sq_options.cpp:755 sq_options.cpp:773 +msgid "Both" +msgstr "" + +#: sq_options.cpp:756 +msgid "RunTime" +msgstr "" + +#: sq_options.cpp:757 +msgid "Treat unknown mime types as unsupported" +msgstr "" + +#: sq_options.cpp:758 +msgid "Load KIPI plugins on demand (for slow machines)" +msgstr "" + +#: sq_options.cpp:759 +msgid "Disk navigator" +msgstr "" + +#: sq_options.cpp:760 +msgid "On starting open..." +msgstr "" + +#: sq_options.cpp:762 +msgid "Custom directory:" +msgstr "" + +#: sq_options.cpp:763 +msgid "Last visited directory" +msgstr "" + +#: sq_options.cpp:764 +msgid "Current directory, where KSquirrel starts" +msgstr "" + +#: sq_options.cpp:765 +msgid "Run unknown file formats separately (with default application)" +msgstr "" + +#: sq_options.cpp:767 +msgid "Save history" +msgstr "" + +#: sq_options.cpp:768 +msgid "Jump into archives" +msgstr "" + +#: sq_options.cpp:769 +msgid "Jump to first image" +msgstr "" + +#: sq_options.cpp:770 +msgid "Don't show directories" +msgstr "" + +#: sq_options.cpp:771 +msgid "Main" +msgstr "" + +#: sq_options.cpp:772 +msgid "Synchronization" +msgstr "" + +#: sq_options.cpp:774 +msgid "Tree -> Navigator" +msgstr "" + +#: sq_options.cpp:775 +msgid "Tree <- Navigator" +msgstr "" + +#: sq_options.cpp:776 +msgid "Clicking" +msgstr "" + +#: sq_options.cpp:777 +msgid "Thumbnails" +msgstr "" + +#: sq_options.cpp:779 +msgid "Do not write thumbnails on disk" +msgstr "" + +#: sq_options.cpp:780 +msgid "Show tooltips with file information" +msgstr "" + +#: sq_options.cpp:781 +msgid "Margin between thumbnails" +msgstr "" + +#: sq_options.cpp:782 sq_options.cpp:815 +msgid " pixels" +msgstr "" + +#: sq_options.cpp:783 +msgid "Don't show tooltips when the main window is inactive" +msgstr "" + +#: sq_options.cpp:784 +msgid "Mark supported image formats with clock icon (slow)" +msgstr "" + +#: sq_options.cpp:785 +msgid "Maximum cache size (in memory)" +msgstr "" + +#: sq_options.cpp:786 +msgid " Kb" +msgstr "" + +#: sq_options.cpp:787 +msgid "No cache" +msgstr "" + +#: sq_options.cpp:788 +msgid "On scroll event" +msgstr "" + +#: sq_options.cpp:789 +msgid "Zoom the scene" +msgstr "" + +#: sq_options.cpp:790 +msgid "Load next/previous file" +msgstr "" + +#: sq_options.cpp:791 +msgid "Background" +msgstr "" + +#: sq_options.cpp:792 +msgid "Custom texture" +msgstr "" + +#: sq_options.cpp:793 +msgid "Custom color" +msgstr "" + +#: sq_options.cpp:794 +msgid "System color" +msgstr "" + +#: sq_options.cpp:798 +msgid "Validate" +msgstr "" + +#: sq_options.cpp:802 +msgid "Show images progressively" +msgstr "" + +#: sq_options.cpp:804 +msgid "Image pages" +msgstr "" + +#: sq_options.cpp:805 +msgid "Load all pages" +msgstr "" + +#: sq_options.cpp:806 +msgid "Load only first page" +msgstr "" + +#: sq_options.cpp:807 +msgid "Load no more than" +msgstr "" + +#: sq_options.cpp:808 +msgid " pages" +msgstr "" + +#: sq_options.cpp:809 +msgid "Loader" +msgstr "" + +#: sq_options.cpp:810 +msgid "Draw tickmarks around the image" +msgstr "" + +#: sq_options.cpp:811 +msgid "Draw background for transparent images" +msgstr "" + +#: sq_options.cpp:812 +msgid "Rotating" +msgstr "" + +#: sq_options.cpp:813 +msgid " degrees" +msgstr "" + +#: sq_options.cpp:814 sq_helpwidget.cpp:183 +msgid "Moving" +msgstr "" + +#: sq_options.cpp:817 +msgid "Zoom limit" +msgstr "" + +#: sq_options.cpp:818 +msgid "Minimum: 1%, maximum: 10,000%" +msgstr "" + +#: sq_options.cpp:819 +msgid "Custom" +msgstr "" + +#: sq_options.cpp:821 +msgid "minimum" +msgstr "" + +#: sq_options.cpp:822 sq_options.cpp:824 +msgid " %" +msgstr "" + +#: sq_options.cpp:823 +msgid "maximum" +msgstr "" + +#: sq_options.cpp:825 +msgid "No limit" +msgstr "" + +#: sq_options.cpp:826 +msgid "Zoom coefficient" +msgstr "" + +#: sq_options.cpp:827 +msgid "%" +msgstr "" + +#: sq_options.cpp:828 +msgid "None" +msgstr "" + +#: sq_options.cpp:830 +msgid "Customize OpenGL widget" +msgstr "" + +#: sq_options.cpp:831 +msgid "Recursion" +msgstr "" + +#: sq_options.cpp:832 +msgid "No recursion" +msgstr "" + +#: sq_options.cpp:833 +msgid "Show number of files" +msgstr "" + +#: sq_options.cpp:834 +msgid "Show number of subfolders and files" +msgstr "" + +#: sq_options.cpp:835 +msgid "Show number of subfolders" +msgstr "" + +#: sq_options.cpp:836 +msgid "Treeview" +msgstr "" + +#: sq_options.cpp:837 +msgid "Show device path" +msgstr "" + +#: sq_options.cpp:838 +msgid "Show mount options" +msgstr "" + +#: sq_options.cpp:839 +msgid "Show filesystem type" +msgstr "" + +#: sq_options.cpp:840 +msgid "Mount view" +msgstr "" + +#: sq_options.cpp:841 +msgid "Enable preview window" +msgstr "" + +#: sq_options.cpp:843 +msgid "Delay before image loading" +msgstr "" + +#: sq_options.cpp:844 sq_slideshow.cpp:218 +msgid " ms" +msgstr "" + +#: sq_options.cpp:845 +msgid "Background color for preview widget:" +msgstr "" + +#: sq_options.cpp:847 +msgid "Don't load preview image on file execution" +msgstr "" + +#: sq_options.cpp:848 +msgid "Disables loading preview image when user launches image with mouse" +msgstr "" + +#: sq_options.cpp:849 +msgid "Image preview" +msgstr "" + +#: sq_options.cpp:850 +msgid "Sidebar settings" +msgstr "" + +#: sq_options.cpp:851 +msgid "KIPI Configuration" +msgstr "" + +#: sq_slideshow.cpp:205 +msgid "Slideshow options" +msgstr "" + +#: sq_slideshow.cpp:206 +msgid "Start" +msgstr "" + +#: sq_slideshow.cpp:209 +msgid "Set directory to current" +msgstr "" + +#: sq_slideshow.cpp:210 +msgid "Last visited directories" +msgstr "" + +#: sq_slideshow.cpp:220 +msgid "Repeats:" +msgstr "" + +#: sq_slideshow.cpp:221 +msgid "Background color:" +msgstr "" + +#: sq_slideshow.cpp:222 +msgid "Onscreen messages" +msgstr "" + +#: sq_slideshow.cpp:223 +msgid "Show current index" +msgstr "" + +#: sq_slideshow.cpp:224 +msgid "Show file name" +msgstr "" + +#: sq_slideshow.cpp:225 +msgid "Show file size" +msgstr "" + +#: sq_slideshow.cpp:226 +msgid "Recursively" +msgstr "" + +#: ksquirrel.cpp:288 +msgid "Clear history" +msgstr "" + +#: ksquirrel.cpp:289 +msgid "Clear address" +msgstr "" + +#: ksquirrel.cpp:294 +msgid "Go!" +msgstr "" + +#: ksquirrel.cpp:341 +msgid "Libraries' filters" +msgstr "" + +#: ksquirrel.cpp:364 +msgid "All supported formats" +msgstr "" + +#: ksquirrel.cpp:374 +msgid "User's filters" +msgstr "" + +#: ksquirrel.cpp:510 +msgid "Folder tree" +msgstr "" + +#: ksquirrel.cpp:511 +msgid "Mount points" +msgstr "" + +#: ksquirrel.cpp:628 +msgid "&Navigator" +msgstr "" + +#: ksquirrel.cpp:630 +msgid "&Action" +msgstr "" + +#: ksquirrel.cpp:633 +msgid "&KIPI Plugins" +msgstr "" + +#: ksquirrel.cpp:661 +msgid "Fi<er" +msgstr "" + +#: ksquirrel.cpp:720 +msgid "Thumbnail size" +msgstr "" + +#: ksquirrel.cpp:723 sq_options.ui.h:137 +msgid "Image window" +msgstr "" + +#: ksquirrel.cpp:725 +msgid "Reload codecs from disk" +msgstr "" + +#: ksquirrel.cpp:726 +msgid "Configure external tools..." +msgstr "" + +#: ksquirrel.cpp:727 +msgid "Configure filters..." +msgstr "" + +#: ksquirrel.cpp:728 +msgid "Go to tray" +msgstr "" + +#: ksquirrel.cpp:729 +msgid "Open file and change directory" +msgstr "" + +#: ksquirrel.cpp:730 +msgid "Open file" +msgstr "" + +#: ksquirrel.cpp:731 +msgid "Thumbnail cache manager..." +msgstr "" + +#: ksquirrel.cpp:735 +msgid "List" +msgstr "" + +#: ksquirrel.cpp:736 +msgid "Icons" +msgstr "" + +#: ksquirrel.cpp:737 +msgid "Details" +msgstr "" + +#: ksquirrel.cpp:738 sq_options.ui.h:136 +msgid "Thumbnails" +msgstr "" + +#: ksquirrel.cpp:740 +msgid "Show URL box" +msgstr "" + +#: ksquirrel.cpp:742 +msgid "Built-in image window" +msgstr "" + +#: ksquirrel.cpp:745 +msgid "Slideshow" +msgstr "" + +#: ksquirrel.cpp:746 +msgid "Slideshow advanced" +msgstr "" + +#: ksquirrel.cpp:748 +msgid "Codec information..." +msgstr "" + +#: ksquirrel.cpp:749 +msgid "OpenGL information..." +msgstr "" + +#: ksquirrel.cpp:751 +msgid "Medium thumbnails" +msgstr "" + +#: ksquirrel.cpp:752 +msgid "Large thumbnails" +msgstr "" + +#: ksquirrel.cpp:753 +msgid "Huge thumbnails" +msgstr "" + +#: ksquirrel.cpp:755 +msgid "Select group" +msgstr "" + +#: ksquirrel.cpp:756 +msgid "Deselect group" +msgstr "" + +#: ksquirrel.cpp:776 +msgid "Extended thumbnails" +msgstr "" + +#: ksquirrel.cpp:1085 +msgid " writing settings and thumbnails... " +msgstr "" + +#: sq_filters.cpp:124 sq_filters.cpp:197 +msgid "Extensions" +msgstr "" + +#: sq_filters.cpp:181 +msgid "Adjust filters" +msgstr "" + +#: sq_filters.cpp:186 +msgid "New filter" +msgstr "" + +#: sq_filters.cpp:193 +msgid "Move filter up" +msgstr "" + +#: sq_filters.cpp:195 +msgid "Move filter down" +msgstr "" + +#: sq_filters.cpp:198 +msgid "Menu item contains both name and extension" +msgstr "" + +#: sq_helpwidget.cpp:175 +msgid "" +"

    File:%1
    Size:%2
    Link destination:%1
    " +"" +"" +"" +"" +"" +"

    Esc,X,Return

    close

    Middle click, F

    fullscreen

    Z

    show 'Zoom' menu

    /

    show this help

    Right click, M, " +"ContextMenu

    show context menu

    N

    toggle filter

    Shift + Left button

    select a region

    Shift + Left

    previous tab

    Shift + Right

    next tab

    W

    close tab

    " +msgstr "" + +#: sq_helpwidget.cpp:176 +msgid "" +"

    Space, Page Down

    next image

    Backspace, Page Up

    previous image

    Home

    first image

    End

    last image

    " +msgstr "" + +#: sq_helpwidget.cpp:177 +msgid "" +"

    " +msgstr "" + +#: sq_helpwidget.cpp:178 +msgid "" +"

    Left, Right," +" Up, Down

    move the image

    Ctrl + Left

    rotate left

    Ctrl + Right

    rotate " +"right

    Ctrl + Up/Down

    rotate for 180 degrees up/down

    Alt + Left/Right

    rotate for 1 degree " +"left/right
    " +msgstr "" + +#: sq_helpwidget.cpp:179 +msgid "" +"

    +/-

    zoom " +"Nx

    Ctrl + +/-

    zoom " +"2x/0.5x

    Scroll

    load next/" +"prev file OR zoom+/zoom-

    Shift + Scroll

    zoom+/zoom-

    Ctrl + Scroll

    zoom+ 2x/zoom- 2x

    1..9

    zoom 1..9x

    0

    zoom 10x

    comma

    fit " +"width

    period

    fit height

    *

    fit image
    " +"

    S

    save as

    V

    flip vertically

    H

    flip horizontally

    R

    reset

    P

    image properties

    C

    codec settings

    L

    ignore zoom if image is smaller than " +"window

    I

    menu with " +"images

    A

    stop/start " +"animation

    B

    toggle " +"drawing background for transparent images

    K

    toggle drawing tickmarks

    E

    show menu with external " +"tools

    Y

    crop

    F1

    first image in " +"multi-paged image

    F2

    previous

    F3

    next

    F4

    last
    " +msgstr "" + +#: sq_helpwidget.cpp:182 sq_options.ui.h:135 +msgid "Filing" +msgstr "" + +#: sq_helpwidget.cpp:184 +msgid "Current image" +msgstr "" + +#: sq_options.ui.h:138 +msgid "Sidebar" +msgstr "" + +#: sq_options.ui.h:141 +msgid "KIPI" +msgstr "" + +#: sq_options.ui.h:260 +msgid "Wrong dimensions: %1x%2." +msgstr "" + +#: sq_slideshowlisting.cpp:87 +msgid "Listing" +msgstr "" + +#: ksquirrel.cpp:751 +msgid "Rename" +msgstr "" + +#: ksquirrel.cpp:1951 +msgid "Renaming File" +msgstr "" + +#: ksquirrel.cpp:1952 +msgid "

    Rename file %1 to:

    " +msgstr "" + +msgid "Calculate directory size" +msgstr "" + +msgid "New folder..." +msgstr "" + +msgid "Create Subfolder" +msgstr "" + +msgid "

    Create new folder in %1:

    " +msgstr "" + +msgid "Rename Folder" +msgstr "" + +msgid "

    Rename folder %1 to:

    " +msgstr "" + +msgid "Are you sure you want to delete %1?" +msgstr "" + +msgid "Copy to last folder" +msgstr "" + +msgid "Move to last folder" +msgstr "" + +msgid "Message text color:" +msgstr "" + +msgid "Total" +msgstr "" + +msgid "Visualize drag operation" +msgstr "" + +msgid "Testing" +msgstr "" + +msgid "Lazy thumbnail generation" +msgstr "" + +msgid "Delay" +msgstr "" + +msgid "Interface" +msgstr "" + +msgid "Number of text lines" +msgstr "" + +msgid "Show file preview" +msgstr "" + +msgid "Number of additionally generated rows" +msgstr "" + +msgid "Repeat (copy to %1)" +msgstr "" + +msgid "Repeat (move to %1)" +msgstr "" + +msgid "Repeat (link to %1)" +msgstr "" + +msgid "Repeat (nothing to repeat)" +msgstr "" + +msgid "Clear contents" +msgstr "" + +msgid "Are you sure you want to delete contents of %1?" +msgstr "" + +msgid "Add to Folder Basket" +msgstr "" + +msgid "Folder basket" +msgstr "" + +msgid "Change icon" +msgstr "" + +msgid "

    Rename item %1 to:

    " +msgstr "" + +msgid "Copy file path" +msgstr "" + +msgid "Copy file url" +msgstr "" + +msgid "Text color:" +msgstr "" + +msgid "Show image dimensions" +msgstr "" + +msgid "Text color..." +msgstr "" + +msgid "Double click" +msgstr "" + +msgid "Close window" +msgstr "" + +msgid "Crop" +msgstr "" + +msgid "Tabs" +msgstr "" + +msgid "Enable tabs" +msgstr "" + +msgid "Ask what to do when opening new image" +msgstr "" + +msgid "Show close buttons" +msgstr "" + +msgid "Open in a new tab" +msgstr "" + +msgid "Replace current tab" +msgstr "" + +msgid "Close all and open in a new tab" +msgstr "" + +msgid "Opening..." +msgstr "" + +msgid "Previous tab" +msgstr "" + +msgid "Next tab" +msgstr "" + +msgid "Close tab" +msgstr "" + +msgid "Do nothing" +msgstr "" + +msgid "Print available DCOP parameters" +msgstr "" + +msgid "Downloading..." +msgstr "" + +msgid "Close all tabs" +msgstr "" + +msgid "Close all opened images when closing window" +msgstr "" + +msgid "Select codecs to disable:" +msgstr "" + +msgid "Select codecs to enable:" +msgstr "" + +msgid "Codec manager..." +msgstr "" diff --git a/po/pl.po b/po/pl.po new file mode 100644 index 0000000..c1f9872 --- /dev/null +++ b/po/pl.po @@ -0,0 +1,2174 @@ +# translation of pl.po to Polish +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# +# Grzegorz Gibas , 2007. +msgid "" +msgstr "" +"Project-Id-Version: pl\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2007-08-07 09:34+0300\n" +"PO-Revision-Date: 2007-11-05 00:32+0100\n" +"Last-Translator: Grzegorz Gibas \n" +"Language-Team: Polish \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: KBabel 1.11.4\n" + +#: sq_filters.ui.h:56 sq_filters.ui.h:58 sq_externaltools.cpp:67 +#: sq_externaltools.cpp:194 sidebar/sq_mountview.cpp:64 sq_viewcache.cpp:47 +#: sq_viewcache.cpp:105 sq_filters.cpp:123 sq_filters.cpp:196 +msgid "Name" +msgstr "Nazwa" + +#: sq_externaltool.cpp:102 sq_externaltool.cpp:162 sq_externaltool.cpp:170 +msgid "No file selected" +msgstr "Nie wybrano pliku" + +#: sq_kipimanager.cpp:68 +msgid "No Plugins" +msgstr "Brak wtyczek" + +#: sq_kipimanager.cpp:125 +msgid "Image actions" +msgstr "Operacje na obrazie" + +#: sq_kipimanager.cpp:126 +msgid "Effects" +msgstr "Efekty" + +#: sq_kipimanager.cpp:127 +msgid "Tools" +msgstr "Narzędzia" + +#: sq_kipimanager.cpp:130 +msgid "Batch processing" +msgstr "" + +#: sq_kipimanager.cpp:131 +msgid "Collections" +msgstr "Kolekcje" + +#: sq_libraryhandler.cpp:148 +msgid "All files" +msgstr "Wszystkie pliki" + +#: sq_navigatordropmenu.cpp:40 +msgid "Copy here" +msgstr "Kopiuj tutaj" + +#: sq_navigatordropmenu.cpp:43 +msgid "Move here" +msgstr "Przenieś tutaj" + +#: sq_navigatordropmenu.cpp:46 +msgid "Link here" +msgstr "Dowiąż tutaj" + +#: sq_glinfo.cpp:45 sq_glinfo.cpp:92 +msgid "Parameter" +msgstr "Parametr" + +#: sq_glinfo.cpp:46 sq_glinfo.cpp:93 sq_imageproperties.cpp:321 +#: sq_imageproperties.cpp:408 imageedit/sq_imagefilter.cpp:487 +msgid "Value" +msgstr "Wartość" + +#: sq_glinfo.cpp:91 +msgid "OpenGL information" +msgstr "Informacje OpenGL" + +#: sq_externaltools.cpp:66 sq_externaltools.cpp:193 +msgid "Pixmap" +msgstr "Mapa pikselowa" + +#: sq_externaltools.cpp:68 sq_externaltools.cpp:195 +msgid "Command" +msgstr "Komenda" + +#: sq_externaltools.cpp:190 +msgid "Adjust external tools" +msgstr "Dostosuj zewnętrzne narzędzia" + +#: sq_externaltools.cpp:192 sq_filters.cpp:182 +msgid "OK" +msgstr "OK" + +#: sq_externaltools.cpp:196 sq_externaltools.ui.h:146 +#, c-format +msgid "Command can contain
    • %f: one file
    • %F: multiple files
    " +msgstr "Komenda może zawierać
    • %f: jeden plik
    • %F: wiele plików
    " + +#: sq_externaltools.cpp:199 +msgid "New tool" +msgstr "Nowe narzędzie" + +#: sq_externaltools.cpp:206 +msgid "Move tool up" +msgstr "Przesuń narzędzie w górę" + +#: sq_externaltools.cpp:208 +msgid "Move tool down" +msgstr "Przesuń narzędzie w dół" + +#: sq_kipiinterface.cpp:72 +msgid "Root directory" +msgstr "" + +#: sq_kipiinterface.cpp:144 +msgid "Folder content" +msgstr "Zawartość folderu" + +#: sq_kipiinterface.cpp:161 +msgid "Selected images" +msgstr "Wybrane obrazy" + +#: sq_kipiinterface.cpp:175 ksquirrel.cpp:513 +msgid "Image basket" +msgstr "Koszyk obrazów" + +#: main.cpp:40 +msgid "File to be opened at startup." +msgstr "Plik, który ma zostać otwarty przy uruchomieniu" + +#: main.cpp:41 +msgid "Print found libraries and exit." +msgstr "Wypisz znalezione biblioteki i wyjdź." + +#: main.cpp:57 +msgid "KSquirrel - image viewer for KDE" +msgstr "KSquirrel - przeglądarka obrazów dla KDE" + +#: main.cpp:66 +msgid "Bug reports, patches" +msgstr "Raporto o błędach, poprawki" + +#: main.cpp:67 +msgid "Bug reports" +msgstr "Raporty o błędach" + +#: main.cpp:68 +msgid "Translation help" +msgstr "Pomoc w tłumaczeniu" + +#: main.cpp:69 +msgid "TiamaT" +msgstr "TiamaT" + +#: main.cpp:69 +msgid "Initial artwork for edit tools" +msgstr "" + +#: main.cpp:70 +msgid "Fera" +msgstr "Fera" + +#: main.cpp:70 +msgid "Great artwork for edit tools" +msgstr "" + +#: main.cpp:71 +msgid "OpenGL forum at" +msgstr "OpenGL forum na" + +#: main.cpp:72 +msgid "GameDev forum at" +msgstr "Forum GameDev na" + +#: sq_imageproperties.cpp:320 sq_imageproperties.cpp:407 +msgid "Group" +msgstr "Grupa" + +#: sq_imageproperties.cpp:359 sq_glwidget.cpp:350 +msgid "Image properties" +msgstr "Właściwości obrazka" + +#: sq_imageproperties.cpp:361 +msgid "Attributes" +msgstr "Atrybuty" + +#: sq_imageproperties.cpp:362 +msgid "Owner:" +msgstr "Właściciel:" + +#: sq_imageproperties.cpp:363 +msgid "Group:" +msgstr "Grupa:" + +#: sq_imageproperties.cpp:365 +msgid "Permissions:" +msgstr "Uprawnienia:" + +#: sq_imageproperties.cpp:368 +msgid "Time" +msgstr "Czas" + +#: sq_imageproperties.cpp:369 +msgid "Created:" +msgstr "Utworzony:" + +#: sq_imageproperties.cpp:370 +msgid "Last read:" +msgstr "Ostatnio czytany:" + +#: sq_imageproperties.cpp:371 +msgid "Last modified:" +msgstr "Ostatnia modyfikacja:" + +#: sq_imageproperties.cpp:375 sq_helpwidget.cpp:181 sq_options.ui.h:134 +msgid "General" +msgstr "Główne" + +#: sq_imageproperties.cpp:376 +msgid "File:" +msgstr "Plik:" + +#: sq_imageproperties.cpp:378 sq_pluginsinfo.cpp:137 sq_slideshow.cpp:211 +msgid "Directory:" +msgstr "Katalog:" + +#: sq_imageproperties.cpp:379 +msgid "Size:" +msgstr "Rozmiar:" + +#: sq_imageproperties.cpp:381 +msgid "Type:" +msgstr "Typ:" + +#: sq_imageproperties.cpp:382 +msgid "Number of frames:" +msgstr "Ilość klatek:" + +#: sq_imageproperties.cpp:383 +msgid "Current frame" +msgstr "Obecna klatka" + +#: sq_imageproperties.cpp:384 sq_slideshow.cpp:219 +msgid "Delay:" +msgstr "Opóźnienie:" + +#: sq_imageproperties.cpp:385 +msgid "Dimensions:" +msgstr "Wymiary: " + +#: sq_imageproperties.cpp:386 +msgid "Bits per pixel:" +msgstr "Bitów na piksel:" + +#: sq_imageproperties.cpp:387 +msgid "Color space:" +msgstr "" + +#: sq_imageproperties.cpp:388 +msgid "Compression:" +msgstr "Kompresja:" + +#: sq_imageproperties.cpp:389 +msgid "Uncompressed size:" +msgstr "Rozmiar po dekompresji:" + +#: sq_imageproperties.cpp:390 +msgid "Compression ratio:" +msgstr "Współczynnik kompresji:" + +#: sq_imageproperties.cpp:391 +msgid "Interlaced:" +msgstr "Przeplot:" + +#: sq_imageproperties.cpp:392 +msgid "Status:" +msgstr "Status:" + +#: sq_imageproperties.cpp:406 sq_glwidget.cpp:2662 sq_options.cpp:816 +msgid "Image" +msgstr "Obraz" + +#: sq_imageproperties.cpp:409 +msgid "Metadata" +msgstr "Metadane" + +#: sq_pluginsinfo.cpp:55 sq_pluginsinfo.cpp:129 +msgid "..." +msgstr "..." + +#: sq_pluginsinfo.cpp:56 sq_pluginsinfo.cpp:130 +msgid "Icon" +msgstr "Ikona" + +#: sq_pluginsinfo.cpp:57 sq_pluginsinfo.cpp:131 +msgid "Library" +msgstr "Biblioteka" + +#: sq_pluginsinfo.cpp:58 sq_pluginsinfo.cpp:132 +msgid "Version" +msgstr "Wersja" + +#: sq_pluginsinfo.cpp:59 sq_pluginsinfo.cpp:133 sq_viewcache.cpp:48 +#: sq_viewcache.cpp:106 +msgid "MIME" +msgstr "MIME" + +#: sq_pluginsinfo.cpp:128 +msgid "Codec information and settings" +msgstr "Informacje o formacie i ustawienia" + +#: sq_pluginsinfo.cpp:138 +msgid "Total found:" +msgstr "Ogólnie znaleziono:" + +#: sq_errorstring.cpp:34 +msgid "cannot open file for reading" +msgstr "nie mogę odczytać pliku" + +#: sq_errorstring.cpp:35 +msgid "file corrupted" +msgstr "plik uszkodzony" + +#: sq_errorstring.cpp:36 +msgid "no memory" +msgstr "brak pamięci" + +#: sq_errorstring.cpp:37 +msgid "file type not supported" +msgstr "format obrazu nie obsługiwany" + +#: sq_errorstring.cpp:38 +msgid "wrong image dimensions" +msgstr "nieprawidłowe rozmiary obrazu" + +#: sq_errorstring.cpp:39 +msgid "cannot open file for writing" +msgstr "nie mogę zapisać obrazu" + +#: sq_errorstring.cpp:40 +msgid "write feature is not supported" +msgstr "opcja zapisu nie obsługiwana" + +#: sq_errorstring.cpp:41 +msgid "write error (check free space)" +msgstr "błąd zapisu (sprawdź miejsce na dysku)" + +#: sq_errorstring.cpp:42 +msgid "wrong parameters" +msgstr "niewłaściwe parametry" + +#: sq_errorstring.cpp:43 +msgid "Editing process is not finished yet" +msgstr "Procesy edycyjne jeszcze nie zakończone" + +#: sq_selectdeselectgroup.cpp:83 +msgid "Filename or mask:" +msgstr "Nazwa pliku lub maska: " + +#: sidebar/sq_treeview.cpp:89 +msgid "root" +msgstr "root" + +#: sidebar/sq_categoriesview.cpp:95 ksquirrel.cpp:512 +msgid "Categories" +msgstr "Kategorie" + +#: sidebar/sq_categoriesview.cpp:115 sidebar/sq_categoriesview.cpp:166 +msgid "New category" +msgstr "Nowa kategoria" + +#: sidebar/sq_categoriesview.cpp:153 sidebar/sq_categoriesview.cpp:218 +msgid "New Category" +msgstr "Nowa Kategoria" + +#: sidebar/sq_categoriesview.cpp:169 sidebar/sq_categoriesview.cpp:198 +msgid "Create default categories" +msgstr "Utwórz domyślne kategorie" + +#: sidebar/sq_categoriesview.cpp:197 +msgid "" +"This will create default categories: Concerts, Pets, Home, Friends, Free time, " +"Travelling and Nature. Continue?" +msgstr "Zostaną utowrzone domyślne kategorie: Koncerty. Zwierzeta, Dom, Przyjaciele, Wolny czas, Podroze, Natura. Kontynuować?" + +#: sidebar/sq_categoriesview.cpp:218 +msgid "Create new category:" +msgstr "Stwórz nową kategorię" + +#: sidebar/sq_mountview.cpp:43 +msgid "Mount" +msgstr "Montuj" + +#: sidebar/sq_mountview.cpp:45 +msgid "Unmount" +msgstr "Odmontuj" + +#: sidebar/sq_mountview.cpp:47 +msgid "Refresh" +msgstr "Odśwież" + +#: sidebar/sq_mountview.cpp:170 +msgid "Device" +msgstr "Urządzenie" + +#: sidebar/sq_mountview.cpp:173 +msgid "FS Type" +msgstr "Typ FS" + +#: sidebar/sq_imagebasket.cpp:244 +msgid "Synchronize" +msgstr "Synchronizuj" + +#: sidebar/sq_previewwidget.cpp:60 +msgid "Background color..." +msgstr "Kolor tła...." + +#: sidebar/sq_categorybrowsermenu.cpp:137 +#: sidebar/sq_categorybrowsermenu.cpp:146 +msgid "Failed to Read Folder" +msgstr "Nie Powiódł się Odczyt Katalogu" + +#: sidebar/sq_categorybrowsermenu.cpp:154 +msgid "Not Authorized to Read Folder" +msgstr "Brak autoryzacji do odczytu" + +#: sidebar/sq_categorybrowsermenu.cpp:167 +msgid "Add here" +msgstr "Dodaj tutaj" + +#: sidebar/sq_categorybrowsermenu.cpp:310 +msgid "More..." +msgstr "Więcej..." + +#: sq_thumbnailcachemaster.cpp:143 +msgid "Thumbnail cache" +msgstr "Bufor miniaturek" + +#: sq_thumbnailcachemaster.cpp:144 +msgid "Calculate cache size on disk" +msgstr "Oblicz wielkość buforu na dysku" + +#: sq_thumbnailcachemaster.cpp:146 +msgid "Clear cache on disk" +msgstr "Wyczyść bufor na dysku" + +#: sq_thumbnailcachemaster.cpp:147 +msgid "View memory cache" +msgstr "Pokaż bufor pamięci" + +#: sq_thumbnailcachemaster.cpp:148 +msgid "Clear cache in memory" +msgstr "Wyczyść bufor w pamięci" + +#: sq_thumbnailcachemaster.cpp:150 +msgid "Sync cache to disk" +msgstr "Sync bufor dla dysku" + +#: sq_thumbnailcachemaster.cpp:151 +msgid "Calculate cache size in memory" +msgstr "Oblicz wielkość bufora w pamięci" + +#: sq_diroperator.cpp:138 +msgid "remote filesystem" +msgstr "zdalny system plików" + +#: sq_diroperator.cpp:158 +msgid "" +"
    Mount point:%1
    Total size:%" +"2
    Used:%3
    Available:%4
    " +msgstr "" +"
    Punkt montowania:%1
    Całkowity rozmiar:%" +"2
    Użyte:%3
    Dostępne:%4
    " + +#: sq_diroperator.cpp:245 +msgid "no files selected" +msgstr "nie wybrano plików" + +#: sq_diroperator.cpp:306 +msgid "Edit file type" +msgstr "Edytuj typ pliku" + +#: sq_diroperator.cpp:307 +msgid "Add to Basket" +msgstr "Dodaj do Koszyka " + +#: sq_diroperator.cpp:309 sq_diroperator.cpp:889 +msgid "File actions" +msgstr "Akcje Pliku" + +#: sq_diroperator.cpp:327 +msgid "Copy to..." +msgstr "Kopiuj do..." + +#: sq_diroperator.cpp:328 +msgid "Move to..." +msgstr "Przenieś do..." + +#: sq_diroperator.cpp:329 +msgid "Link to..." +msgstr "Dowiąż do..." + +#: sq_diroperator.cpp:331 +msgid "Run" +msgstr "Uruchom" + +#: sq_diroperator.cpp:333 +msgid "Recreate selected thumbnails" +msgstr "Odtwórz zaznaczone miniatury" + +#: sq_diroperator.cpp:336 +msgid "Convert..." +msgstr "Konwertuj..." + +#: sq_diroperator.cpp:439 +msgid "Total %1 in %2 (%3, %4)" +msgstr "Ogólem %1 w %2 (%3, %4)" + +#: sq_diroperator.cpp:441 +msgid "1 item" +msgstr "1 pozycja" + +#: sq_diroperator.cpp:442 +msgid "1 folder" +msgstr "1 folder" + +#: sq_diroperator.cpp:443 +msgid "1 file" +msgstr "1 plik" + +#: sq_diroperator.cpp:627 +#, c-format +msgid "Command cannot contain both \"%f\" and \"%F\"" +msgstr "Polecenie nie może zawierać obu \"%f\" i \"%F\"" + +#: sq_diroperator.cpp:627 sq_diroperator.cpp:632 +msgid "Error processing command" +msgstr "Błąd w przetwarzaniu polecenia" + +#: sq_diroperator.cpp:632 +#, c-format +msgid "Command should contain \"%f\" or \"%F\"" +msgstr "Komenda powinna zawierać \"%f\" lub \"%F\"" + +#: sq_diroperator.cpp:741 +msgid "Unsupported format \"%1\"" +msgstr "Nieobsługiwany format \"%1\"" + +#: sq_diroperator.cpp:886 +msgid "Add to &Category" +msgstr "Dodaj do &Kategorii" + +#: sq_diroperator.cpp:890 +msgid "&External tools" +msgstr "Zewnętrzne narzędzia" + +#: sq_slideshowwidget.cpp:345 +msgid "" +"
    Enter, Escape, Returnstop " +"slideshow
    Pause, Spacepause/unpause " +"slideshow
    Page Upprevious image
    Page Downnext image
    Mshow/hide onscreen messages
    " +msgstr "" +"
    Enter, Escape, Return przerwij pokaz slajdów
    Pause, Spacezatrzymaj/wznów " +"pokaz slajdów
    Page Uppoprzedni obrazek
    Page Downnastępny obrazek
    Mpokaż/ukryj komunikaty na ekranie
    " + +#: sq_codecsettingsskeleton.ui.h:28 +msgid "" +"Error loading widget from %1. Please check your installation or " +"contact ksquirrel.iv@gmail.com" +msgstr "" +"Błąd ładowania widżetu z %1. Sprawdź instalację programu lub " +"skontaktuj ksquirrel.iv@gmail.com" + +#: sq_widgetstack.cpp:473 sq_widgetstack.cpp:507 +msgid "No files to copy or move" +msgstr "Brak plików do skopiowania czy przeniesienia" + +#: sq_widgetstack.cpp:607 +msgid "Select a group of files" +msgstr "Zaznacz grupę plików" + +#: sq_widgetstack.cpp:607 +msgid "Deselect a group of files" +msgstr "Odznacz grupę plików" + +#: sq_widgetstack.cpp:608 +msgid "Select!" +msgstr "Zaznacz!" + +#: sq_widgetstack.cpp:608 +msgid "Deselect!" +msgstr "Odznacz!" + +#: sq_filethumbview.cpp:370 +msgid "" +"%3%4" +msgstr "" +"
    File:%1
    Size:%2
    %3%4" + +#: sq_filethumbview.cpp:373 +msgid "" +msgstr "" + +#: imageedit/sq_writeoption.cpp:108 +msgid "RLE compression" +msgstr "Kompresja RLE" + +#: imageedit/sq_writeoption.cpp:109 +msgid "Compression level" +msgstr "Stopień kompresji" + +#: imageedit/sq_writeoption.cpp:110 +msgid "Interlaced" +msgstr "Przeplot" + +#: imageedit/sq_writeoption.cpp:112 +msgid "No special options available for this format" +msgstr "Nie ma specjalnych opcji dla tego formatu" + +#: imageedit/sq_converter.cpp:47 +msgid "internal error" +msgstr "Wewnętrzny błąd" + +#: imageedit/sq_converter.cpp:48 +msgid "failed" +msgstr "nie powiodło się" + +#: imageedit/sq_converter.cpp:50 +msgid "Converting" +msgstr "Konwertowanie" + +#: imageedit/sq_converter.cpp:68 +msgid "Select files to edit" +msgstr "Wybierz pliki do edycji" + +#: imageedit/sq_converter.cpp:73 +msgid "" +"Converter cannot work with remote files.\n" +"Sorry" +msgstr "" +"Konwerter nie może pracować na nie lokalnym pliku.\n" +"Sorki" + +#: imageedit/sq_converter.cpp:160 +msgid "Temporary file creation failed" +msgstr "Utworzenie tymczasowego pliku nie powiodło się" + +#: imageedit/sq_converter.cpp:243 sq_imageproperties.ui.h:72 +msgid "1 error" +msgstr "1 błąd" + +#: imageedit/sq_converter.cpp:250 +msgid "Removing" +msgstr "Usuwanie" + +#: imageedit/sq_converter.cpp:436 +msgid "Convert 1 file" +msgstr "Konwertuj 1 plik" + +#: imageedit/sq_imageeditoptions.cpp:134 +msgid "Edit options" +msgstr "Opcje edycyjne" + +#: imageedit/sq_imageeditoptions.cpp:135 +msgid "New files" +msgstr "Nowe pliki" + +#: imageedit/sq_imageeditoptions.cpp:136 +msgid "Place here" +msgstr "Włóż tutaj" + +#: imageedit/sq_imageeditoptions.cpp:137 +msgid "Replace original files" +msgstr "Nadpisz oryginalne pliki" + +#: imageedit/sq_imageeditoptions.cpp:138 +msgid "Place files in current directory, renaming them if necessary" +msgstr "Wsadź pliki do bieżącego katalogu, zmieni ich nazwę jeśli potrzeba" + +#: imageedit/sq_imageeditoptions.cpp:139 +msgid "Place files in current directory, replacing existing files" +msgstr "Wsadź pliki do bieżącego katalogu, podmieni istniejące pliki" + +#: imageedit/sq_imageeditoptions.cpp:140 +msgid "Close, when all operations succeeded" +msgstr "Zamknij kiedy wszystkie operacje zakończą się sukcesem" + +#: imageedit/sq_imagebcg.ui.h:17 imageedit/sq_imagebcg.ui.h:31 +#: imageedit/sq_imagebcg.cpp:382 +msgid "Brightness" +msgstr "Jasność" + +#: imageedit/sq_imagebcg.ui.h:18 imageedit/sq_imagebcg.ui.h:31 +#: imageedit/sq_imagebcg.cpp:383 +msgid "Contrast" +msgstr "Kontrast" + +#: imageedit/sq_imagebcg.ui.h:19 imageedit/sq_imagebcg.ui.h:31 +#: imageedit/sq_imagebcg.cpp:384 +msgid "Gamma" +msgstr "Gamma" + +#: imageedit/sq_imagebcg.ui.h:20 imageedit/sq_imagebcg.ui.h:32 +#: imageedit/sq_imagebcg.cpp:390 +msgid "Red" +msgstr "Czerwony" + +#: imageedit/sq_imagebcg.ui.h:20 +msgid "Cyan" +msgstr "Cyjankowy" + +#: imageedit/sq_imagebcg.ui.h:21 imageedit/sq_imagebcg.ui.h:32 +#: imageedit/sq_imagebcg.cpp:389 +msgid "Green" +msgstr "Zielony" + +#: imageedit/sq_imagebcg.ui.h:21 +msgid "Magenta" +msgstr "Purpura" + +#: imageedit/sq_imagebcg.ui.h:22 imageedit/sq_imagebcg.ui.h:32 +#: imageedit/sq_imagebcg.cpp:388 +msgid "Blue" +msgstr "Niebieski" + +#: imageedit/sq_imagebcg.ui.h:22 +msgid "Yellow" +msgstr "Żółty" + +#: imageedit/sq_imagefilter.cpp:473 imageedit/sq_imagefilter.cpp:539 +msgid "Filter" +msgstr "Filtr" + +#: imageedit/sq_imagefilter.cpp:474 imageedit/sq_imagefilter.cpp:486 +msgid "Color:" +msgstr "Kolor:" + +#: imageedit/sq_imagefilter.cpp:476 +msgid "Opacity" +msgstr "Nieprzeźroczystość" + +#: imageedit/sq_imagefilter.cpp:477 imageedit/sq_imagefilter.cpp:482 +#: imageedit/sq_imagefilter.cpp:505 +msgid "Sigma" +msgstr "Sigma" + +#: imageedit/sq_imagefilter.cpp:478 imageedit/sq_imagefilter.cpp:481 +#: imageedit/sq_imagefilter.cpp:483 imageedit/sq_imagefilter.cpp:501 +#: imageedit/sq_imagefilter.cpp:506 +msgid "Radius" +msgstr "Promień" + +#: imageedit/sq_imagefilter.cpp:479 imageedit/sq_imagefilter.cpp:492 +#: imageedit/sq_imagefilter.cpp:507 +msgid "Factor" +msgstr "Współczynnik" + +#: imageedit/sq_imagefilter.cpp:480 imageedit/sq_imagefilter.cpp:484 +#: imageedit/sq_imagefilter.cpp:493 imageedit/sq_imagefilter.cpp:514 +msgid "" +"There are no special options available for this filter. Just click \"Filter" +"\"." +msgstr "Nie ma specjalnych opcji dla tego filtru. Po prostu kliknij \"Filtr \"." + +#: imageedit/sq_imagefilter.cpp:490 +msgid "Color 1:" +msgstr "Kolor 1:" + +#: imageedit/sq_imagefilter.cpp:491 +msgid "Color 2:" +msgstr "Kolor 2:" + +#: imageedit/sq_imagefilter.cpp:494 +msgid "Noise type" +msgstr "Typ szumu" + +#: imageedit/sq_imagefilter.cpp:495 +msgid "Uniform" +msgstr "Jednolity" + +#: imageedit/sq_imagefilter.cpp:496 +msgid "Impulse" +msgstr "Impuls" + +#: imageedit/sq_imagefilter.cpp:497 +msgid "Multiplicative Gaussian" +msgstr "Multiplicative Gaussian" + +#: imageedit/sq_imagefilter.cpp:498 +msgid "Poisson" +msgstr "Poisson" + +#: imageedit/sq_imagefilter.cpp:499 +msgid "Gaussian" +msgstr "Rozmycie Gaussowskie" + +#: imageedit/sq_imagefilter.cpp:500 +msgid "Laplacian" +msgstr "Laplacian" + +#: imageedit/sq_imagefilter.cpp:502 +msgid "Color" +msgstr "Kolor" + +#: imageedit/sq_imagefilter.cpp:503 +msgid "Elevation" +msgstr "Wyniesienie" + +#: imageedit/sq_imagefilter.cpp:504 +msgid "Azimuth" +msgstr "Azymut" + +#: imageedit/sq_imagefilter.cpp:508 +msgid "Amount" +msgstr "Ilość" + +#: imageedit/sq_imagefilter.cpp:509 +msgid "Type" +msgstr "Typ" + +#: imageedit/sq_imagefilter.cpp:510 +msgid "GBR" +msgstr "GBR" + +#: imageedit/sq_imagefilter.cpp:511 +msgid "BRG" +msgstr "BRG" + +#: imageedit/sq_imagefilter.cpp:512 +msgid "Degrees" +msgstr "Stopnie" + +#: imageedit/sq_imagefilter.cpp:513 imageedit/sq_imagefilter.cpp:515 +#: imageedit/sq_imagefilter.cpp:536 +msgid "Threshold" +msgstr "Próg" + +#: imageedit/sq_imagefilter.cpp:517 +msgid "Blend" +msgstr "Wtapianie" + +#: imageedit/sq_imagefilter.cpp:518 +msgid "Blur" +msgstr "Rozmywanie" + +#: imageedit/sq_imagefilter.cpp:519 +msgid "Desaturate" +msgstr "Usuń Kolor" + +#: imageedit/sq_imagefilter.cpp:520 +msgid "Despeckle" +msgstr "Usuń kurz i rysy" + +#: imageedit/sq_imagefilter.cpp:521 +msgid "Edge" +msgstr "Krawędź" + +#: imageedit/sq_imagefilter.cpp:522 +msgid "Emboss" +msgstr "Płaskorzeźba" + +#: imageedit/sq_imagefilter.cpp:523 +msgid "Equalize" +msgstr "Wyrównaj" + +#: imageedit/sq_imagefilter.cpp:524 +msgid "Fade" +msgstr "Zanik" + +#: imageedit/sq_imagefilter.cpp:525 +msgid "Flatten" +msgstr "Spłaszcz" + +#: imageedit/sq_imagefilter.cpp:526 +msgid "Implode" +msgstr "Implozja" + +#: imageedit/sq_imagefilter.cpp:527 +msgid "Negative" +msgstr "Negatyw" + +#: imageedit/sq_imagefilter.cpp:528 +msgid "Noise" +msgstr "Szum" + +#: imageedit/sq_imagefilter.cpp:529 +msgid "Oil" +msgstr "Olej" + +#: imageedit/sq_imagefilter.cpp:530 +msgid "Shade" +msgstr "Odcień" + +#: imageedit/sq_imagefilter.cpp:531 +msgid "Sharpen" +msgstr "Wyostrz" + +#: imageedit/sq_imagefilter.cpp:532 +msgid "Solarize" +msgstr "Solaryzacja" + +#: imageedit/sq_imagefilter.cpp:533 +msgid "Spread" +msgstr "Rozproszenie" + +#: imageedit/sq_imagefilter.cpp:534 +msgid "Swap colors" +msgstr "Wymień kolory" + +#: imageedit/sq_imagefilter.cpp:535 +msgid "Swirl" +msgstr "Wirowanie" + +#: imageedit/sq_imagefilter.cpp:537 +msgid "Grayscale" +msgstr "Skala szarości" + +#: imageedit/sq_imagefilter.cpp:538 +msgid "Redeye" +msgstr "Czerwone oczy" + +#: imageedit/sq_imagefilter.cpp:541 +msgid "Image after filtering:" +msgstr "Obrazek po użyciu filtra:" + +#: imageedit/sq_imagefilter.cpp:542 imageedit/sq_imagebcg.cpp:397 +msgid "Original image:" +msgstr "Oryginalny obraz:" + +#: imageedit/sq_imagebcg.cpp:378 +msgid "Color balance" +msgstr "Balans kolor" + +#: imageedit/sq_imagebcg.cpp:394 +msgid "Colorize" +msgstr "Koloryzuj" + +#: imageedit/sq_imagebcg.cpp:396 +msgid "Image after colorizing:" +msgstr "Obraz po koloryzowaniu:" + +#: imageedit/sq_imageconvert.cpp:167 +msgid "Convert" +msgstr "Konwertuj" + +#: imageedit/sq_imageconvert.cpp:172 +msgid "Conversion options" +msgstr "Opcje konwersji" + +#: sq_viewcache.cpp:49 sq_viewcache.cpp:107 +msgid "Parameters" +msgstr "Parametry" + +#: sq_viewcache.cpp:103 +msgid "Memory cache" +msgstr "Pamięć podręczna" + +#: sq_viewcache.cpp:108 +msgid "Total:" +msgstr "Ogółem:" + +#: sq_imageproperties.ui.h:29 +msgid "Copy entry" +msgstr "Kopiuj wejście" + +#: sq_imageproperties.ui.h:30 +msgid "Copy all entries" +msgstr "Kopiuj wszystkie wejścia " + +#: sq_imageproperties.ui.h:95 +msgid "EXIF" +msgstr "EXIF" + +#: sq_imageproperties.ui.h:105 +msgid "Simple" +msgstr "Proste" + +#: sq_imageproperties.ui.h:108 +msgid "Full" +msgstr "Pełne" + +#: sq_imageproperties.ui.h:127 +msgid "EXIF (no)" +msgstr "EXIF (brak)" + +#: sq_imageproperties.ui.h:177 +msgid "Metadata (no)" +msgstr "Metadane (brak)" + +#: _translatorinfo.cpp:1 +msgid "" +"_: NAME OF TRANSLATORS\n" +"Your names" +msgstr "Grzegorz Gibas aka amigib" + +#: _translatorinfo.cpp:3 +msgid "" +"_: EMAIL OF TRANSLATORS\n" +"Your emails" +msgstr "amigib@gmail.com" + +#: sq_glwidget.cpp:233 +msgid "Rectangle" +msgstr "Prostokąt" + +#: sq_glwidget.cpp:234 +msgid "Ellipse" +msgstr "Elipsa" + +#: sq_glwidget.cpp:239 +msgid "Fit width" +msgstr "Dopasuj szerokość" + +#: sq_glwidget.cpp:240 +msgid "Fit height" +msgstr "Dopasuj wysokość" + +#: sq_glwidget.cpp:241 +msgid "Fit image" +msgstr "Dopasuj obrazek" + +#: sq_glwidget.cpp:242 +msgid "Zoom 100%" +msgstr "Powiększenie 100%" + +#: sq_glwidget.cpp:243 +msgid "Leave previous zoom" +msgstr "Zostaw poprzednie zbliżenie" + +#: sq_glwidget.cpp:244 +msgid "Ignore, if image is smaller than window" +msgstr "Ignoruj, jeśli obraz jest mniejszy niż okno" + +#: sq_glwidget.cpp:318 +msgid "Go to first image" +msgstr "Idź do pierwszego obrazu" + +#: sq_glwidget.cpp:319 +msgid "Previous image" +msgstr "Poprzedni obraz" + +#: sq_glwidget.cpp:321 +msgid "Next image" +msgstr "Następny obraz" + +#: sq_glwidget.cpp:323 +msgid "Go to last image" +msgstr "Idź do ostatniego obrazu" + +#: sq_glwidget.cpp:326 sq_glwidget.cpp:2685 +msgid "Zoom +" +msgstr "Powiększenie +" + +#: sq_glwidget.cpp:328 sq_glwidget.cpp:2686 +msgid "Zoom -" +msgstr "Powiększenie -" + +#: sq_glwidget.cpp:332 sq_glwidget.cpp:2677 +msgid "Rotate left" +msgstr "Obróć w lewo" + +#: sq_glwidget.cpp:334 sq_glwidget.cpp:2678 +msgid "Rotate right" +msgstr "Obróć w prawo" + +#: sq_glwidget.cpp:336 sq_glwidget.cpp:2707 +msgid "Flip vertically" +msgstr "Odbij w pionie" + +#: sq_glwidget.cpp:338 sq_glwidget.cpp:2708 +msgid "Flip horizontally" +msgstr "Odbij w poziomie" + +#: sq_glwidget.cpp:340 +msgid "Normalize" +msgstr "Normalizuj" + +#: sq_glwidget.cpp:342 sq_glwidget.cpp:2723 +msgid "Fullscreen" +msgstr "Pełny ekran" + +#: sq_glwidget.cpp:344 +msgid "Select image" +msgstr "Wybierz obraz" + +#: sq_glwidget.cpp:346 +msgid "Selection" +msgstr "Zaznaczenie" + +#: sq_glwidget.cpp:348 sq_glwidget.cpp:2717 sq_codecsettingsskeleton.cpp:128 +msgid "Codec settings" +msgstr "Ustawienia kodeka" + +#: sq_glwidget.cpp:351 +msgid "Show navigator" +msgstr "Pokaż nawigatora" + +#: sq_glwidget.cpp:1024 +msgid "yes" +msgstr "tak" + +#: sq_glwidget.cpp:1024 +msgid "no" +msgstr "nie" + +#: sq_glwidget.cpp:1485 +msgid "Codec for %1 format not found" +msgstr "Kodek dla formatu %1 nie został znaleziony" + +#: sq_glwidget.cpp:1729 +msgid "Memory allocation failed for %1 of memory" +msgstr "Alokacja pamięci dla %1 pamięci nie powiodła się" + +#: sq_glwidget.cpp:1741 +msgid "Memory allocation failed" +msgstr "Nie powiodła się alokacja pamięci" + +#: sq_glwidget.cpp:1747 +msgid "Decoding failed" +msgstr "Dekodowanie nie powiodło się" + +#: sq_glwidget.cpp:1849 +msgid " ms." +msgstr " ms." + +#: sq_glwidget.cpp:2363 +msgid "" +"Sorry, could not perform write operation\n" +"for codec \"%1\"" +msgstr "" +"Niestety, ale nie można wykonać operacji zapisu\n" +"dla kodeka \"%1\"" + +#: sq_glwidget.cpp:2382 sq_glwidget.cpp:2390 sq_glwidget.cpp:2412 +msgid "Error writing image" +msgstr "Błąd zapisu obrazu" + +#: sq_glwidget.cpp:2433 +msgid "Try another location?" +msgstr "Spróbować inną lokację?" + +#: sq_glwidget.cpp:2658 +msgid "Rotate" +msgstr "Obrót" + +#: sq_glwidget.cpp:2661 sq_options.cpp:803 +msgid "Window" +msgstr "Okno" + +#: sq_glwidget.cpp:2670 +msgid "Next" +msgstr "Następny" + +#: sq_glwidget.cpp:2671 +msgid "Previous" +msgstr "Poprzedni" + +#: sq_glwidget.cpp:2672 +msgid "First" +msgstr "Pierwszy" + +#: sq_glwidget.cpp:2673 +msgid "Last" +msgstr "Ostatni" + +#: sq_glwidget.cpp:2680 +msgid "Rotate 180'" +msgstr "Obróć 180" + +#: sq_glwidget.cpp:2682 +msgid "Rotate 1' left" +msgstr "Obróć 1 w lewo" + +#: sq_glwidget.cpp:2683 +msgid "Rotate 1' right" +msgstr "Obróć 1 w prawo" + +#: sq_glwidget.cpp:2687 +msgid "Zoom 2x" +msgstr "Powiększenie 2x" + +#: sq_glwidget.cpp:2688 +msgid "Zoom 1/2x" +msgstr "Powiększenie 1/2x" + +#: sq_glwidget.cpp:2698 +msgid "Move left" +msgstr "Przesuń w lewo" + +#: sq_glwidget.cpp:2699 +msgid "Move right" +msgstr "Przesuń w prawo" + +#: sq_glwidget.cpp:2700 +msgid "Move up" +msgstr "Przesuń w górę" + +#: sq_glwidget.cpp:2701 +msgid "Move down" +msgstr "Przesuń w dół" + +#: sq_glwidget.cpp:2703 +msgid "Start/stop animation" +msgstr "Odtwarzaj/zatrzymaj animację" + +#: sq_glwidget.cpp:2704 +msgid "Hide/show background" +msgstr "Ukryj/pokaż tło" + +#: sq_glwidget.cpp:2705 +msgid "Hide/show tickmarks" +msgstr "Ukryj/pokaż tickmarki" + +#: sq_glwidget.cpp:2710 +msgid "First page" +msgstr "Pierwsza strona" + +#: sq_glwidget.cpp:2711 +msgid "Previous page" +msgstr "Poprzednia strona" + +#: sq_glwidget.cpp:2712 +msgid "Next page" +msgstr "Następna strona" + +#: sq_glwidget.cpp:2713 +msgid "Last page" +msgstr "Ostatnia strona" + +#: sq_glwidget.cpp:2715 +msgid "To clipboard" +msgstr "Do schowka" + +#: sq_glwidget.cpp:2720 +msgid "Color balance..." +msgstr "Balans kolorów" + +#: sq_glwidget.cpp:2721 +msgid "Apply filter..." +msgstr "Zatwierdź filtr..." + +#: sq_glwidget.cpp:2724 +msgid "Hide/show toolbar" +msgstr "Pokaż/ukryj pasek narzędziowy" + +#: sq_glwidget.cpp:2725 +msgid "Hide/show statusbar" +msgstr "Pokaż/ukryj pasek statusu" + +#: sq_glwidget.cpp:2728 +msgid "Reset" +msgstr "Resetuj" + +#: sq_glwidget.cpp:2731 sq_helpwidget.cpp:174 +msgid "Hotkeys" +msgstr "Klawisze skrótów" + +#: sq_glview.cpp:84 +msgid "Loading time" +msgstr "Czas ładowania" + +#: sq_options.cpp:746 +msgid "The main options" +msgstr "Główne opcje" + +#: sq_options.cpp:748 +msgid "Write configuration file to disk, when I press \"OK\"" +msgstr "Zapisz plik konfiguracyjny na dysk, kiedy przycisnę \"OK\"" + +#: sq_options.cpp:749 +msgid "Minimize to tray after closing" +msgstr "Minimalizuj do tray'a przy zamknięciu" + +#: sq_options.cpp:750 +msgid "Show splash screen at startup" +msgstr "Pokaż ekran startowy przy otwarciu" + +#: sq_options.cpp:751 +msgid "Don't show animated logo in toolbar" +msgstr "Nie pokazuj animowanego logo w toolbar'ze" + +#: sq_options.cpp:752 +msgid "Apply codec settings to" +msgstr "Zatwierdź ustawienia kodeka dla" + +#: sq_options.cpp:753 +msgid "Thumbnail loader" +msgstr "Program ładujący miniaturki" + +#: sq_options.cpp:754 +msgid "Image viewer (also preview window)" +msgstr "Przeglądarka obrazów (także okno podglądu)" + +#: sq_options.cpp:755 sq_options.cpp:773 +msgid "Both" +msgstr "Oba" + +#: sq_options.cpp:756 +msgid "RunTime" +msgstr "" + +#: sq_options.cpp:757 +msgid "Treat unknown mime types as unsupported" +msgstr "Traktuj nieznane typy jako nieobsługiwane" + +#: sq_options.cpp:758 +msgid "Load KIPI plugins on demand (for slow machines)" +msgstr "Ładuj wtyczki KIPI na żądanie (dla wolnych maszyn)" + +#: sq_options.cpp:759 +msgid "Disk navigator" +msgstr "" + +#: sq_options.cpp:760 +msgid "On starting open..." +msgstr "Przy starcie otwórz..." + +#: sq_options.cpp:762 +msgid "Custom directory:" +msgstr "Wybrany katalog:" + +#: sq_options.cpp:763 +msgid "Last visited directory" +msgstr "Ostatni otwarty katalog" + +#: sq_options.cpp:764 +msgid "Current directory, where KSquirrel starts" +msgstr "Bieżący katalog, przy starcie KSquirrel" + +#: sq_options.cpp:765 +msgid "Run unknown file formats separately (with default application)" +msgstr "Uruchom nieznane formaty oddzielnie (z domyślną zewnętrzną aplikacją)" + +#: sq_options.cpp:767 +msgid "Save history" +msgstr "Zapisz historię" + +#: sq_options.cpp:768 +msgid "Jump into archives" +msgstr "Skocz do archiwum" + +#: sq_options.cpp:769 +msgid "Jump to first image" +msgstr "Skocz do pierwszego obrazu" + +#: sq_options.cpp:770 +msgid "Don't show directories" +msgstr "Nie pokazuj katalogów" + +#: sq_options.cpp:771 +msgid "Main" +msgstr "Główne" + +#: sq_options.cpp:772 +msgid "Synchronization" +msgstr "Synchronizacja" + +#: sq_options.cpp:774 +msgid "Tree -> Navigator" +msgstr "Drzewo -> Nawigator" + +#: sq_options.cpp:775 +msgid "Tree <- Navigator" +msgstr "Drzewo <- Nawigator" + +#: sq_options.cpp:776 +msgid "Clicking" +msgstr "Klikanie" + +#: sq_options.cpp:777 +msgid "Thumbnails" +msgstr "Miniaturki" + +#: sq_options.cpp:779 +msgid "Do not write thumbnails on disk" +msgstr "Nie zapisuj miniaturek na dysk" + +#: sq_options.cpp:780 +msgid "Show tooltips with file information" +msgstr "Pokazuj podpowiedzi razem z informacjami o pliku" + +#: sq_options.cpp:781 +msgid "Margin between thumbnails" +msgstr "Margines pomiędzy miniaturkami" + +#: sq_options.cpp:782 sq_options.cpp:815 +msgid " pixels" +msgstr "pikseli" + +#: sq_options.cpp:783 +msgid "Don't show tooltips when the main window is inactive" +msgstr "Nie pokazuj podpowiedzi kiedy główne okno jest nieaktywne" + +#: sq_options.cpp:784 +msgid "Mark supported image formats with clock icon (slow)" +msgstr "Oznacz obsługiwane formaty obrazów ikonką zegara (wolne)" + +#: sq_options.cpp:785 +msgid "Maximum cache size (in memory)" +msgstr "Maksymalny rozmiar buforu (w pamięci)" + +#: sq_options.cpp:786 +msgid " Kb" +msgstr " Kb" + +#: sq_options.cpp:787 +msgid "No cache" +msgstr "Brak buforu" + +#: sq_options.cpp:788 +msgid "On scroll event" +msgstr "Kółko myszki" + +#: sq_options.cpp:789 +msgid "Zoom the scene" +msgstr "Przybliż scenę" + +#: sq_options.cpp:790 +msgid "Load next/previous file" +msgstr "Ładuj następny/poprzedni plik" + +#: sq_options.cpp:791 +msgid "Background" +msgstr "Tło" + +#: sq_options.cpp:792 +msgid "Custom texture" +msgstr "Wybrana tekstura" + +#: sq_options.cpp:793 +msgid "Custom color" +msgstr "Wybrany kolor" + +#: sq_options.cpp:794 +msgid "System color" +msgstr "Systemowy kolor" + +#: sq_options.cpp:798 +msgid "Validate" +msgstr "Walidacja" + +#: sq_options.cpp:802 +msgid "Show images progressively" +msgstr "Pokaż obrazki progresywnie" + +#: sq_options.cpp:804 +msgid "Image pages" +msgstr "Strony obrazu" + +#: sq_options.cpp:805 +msgid "Load all pages" +msgstr "Ładuj wszystkie strony" + +#: sq_options.cpp:806 +msgid "Load only first page" +msgstr "Ładuj tylko pierwszą stronę" + +#: sq_options.cpp:807 +msgid "Load no more than" +msgstr "Ładuj nie więcej niż" + +#: sq_options.cpp:808 +msgid " pages" +msgstr " strony" + +#: sq_options.cpp:809 +msgid "Loader" +msgstr "Program ładujący" + +#: sq_options.cpp:810 +msgid "Draw tickmarks around the image" +msgstr "Rysuj tickmarki dookoła obrazu" + +#: sq_options.cpp:811 +msgid "Draw background for transparent images" +msgstr "Rysuj tło dla przeźroczystych obrazów" + +#: sq_options.cpp:812 +msgid "Rotating" +msgstr "Obracanie" + +#: sq_options.cpp:813 +msgid " degrees" +msgstr " stopnie" + +#: sq_options.cpp:814 sq_helpwidget.cpp:183 +msgid "Moving" +msgstr "Przenoszenie" + +#: sq_options.cpp:817 +msgid "Zoom limit" +msgstr "Limit powiększenia" + +#: sq_options.cpp:818 +msgid "Minimum: 1%, maximum: 10,000%" +msgstr "Minimum: 1%, maksimum: 10,000%" + +#: sq_options.cpp:819 +msgid "Custom" +msgstr "" + +#: sq_options.cpp:821 +msgid "minimum" +msgstr "minimum" + +#: sq_options.cpp:822 sq_options.cpp:824 +msgid " %" +msgstr " %" + +#: sq_options.cpp:823 +msgid "maximum" +msgstr "maksimum" + +#: sq_options.cpp:825 +msgid "No limit" +msgstr "Brak limitu" + +#: sq_options.cpp:826 +msgid "Zoom coefficient" +msgstr "Mnożnik powiększenia" + +#: sq_options.cpp:827 +msgid "%" +msgstr "%" + +#: sq_options.cpp:828 +msgid "None" +msgstr "Brak" + +#: sq_options.cpp:830 +msgid "Customize OpenGL widget" +msgstr "Dostosuj widżet OpenGL" + +#: sq_options.cpp:831 +msgid "Recursion" +msgstr "Powtarzanie" + +#: sq_options.cpp:832 +msgid "No recursion" +msgstr "Bez powtarzania" + +#: sq_options.cpp:833 +msgid "Show number of files" +msgstr "Pokaż liczbę plików" + +#: sq_options.cpp:834 +msgid "Show number of subfolders and files" +msgstr "Pokaż liczbę podkatalogów i plików" + +#: sq_options.cpp:835 +msgid "Show number of subfolders" +msgstr "Pokaż liczbę podkatalogów" + +#: sq_options.cpp:836 +msgid "Treeview" +msgstr "Widok drzewa" + +#: sq_options.cpp:837 +msgid "Show device path" +msgstr "Pokaż ścieżkę urządzenia" + +#: sq_options.cpp:838 +msgid "Show mount options" +msgstr "Pokaż opcje montowania" + +#: sq_options.cpp:839 +msgid "Show filesystem type" +msgstr "Pokaż typ systemu plików" + +#: sq_options.cpp:840 +msgid "Mount view" +msgstr "" + +#: sq_options.cpp:841 +msgid "Enable preview window" +msgstr "Włącz okno podglądu" + +#: sq_options.cpp:843 +msgid "Delay before image loading" +msgstr "Opóźnienie przed załadowaniem obrazu" + +#: sq_options.cpp:844 sq_slideshow.cpp:218 +msgid " ms" +msgstr "ms" + +#: sq_options.cpp:845 +msgid "Background color for preview widget:" +msgstr "Kolor tła dla widżetu podglądu:" + +#: sq_options.cpp:847 +msgid "Don't load preview image on file execution" +msgstr "" + +#: sq_options.cpp:848 +msgid "Disables loading preview image when user launches image with mouse" +msgstr "Nie włączaj podglądu kiedy użytkownik uruchamia obraz myszką" + +#: sq_options.cpp:849 +msgid "Image preview" +msgstr "Podgląd obrazu" + +#: sq_options.cpp:850 +msgid "Sidebar settings" +msgstr "Ustawienia panelu bocznego" + +#: sq_options.cpp:851 +msgid "KIPI Configuration" +msgstr "Konfiguracja KIPI" + +#: sq_slideshow.cpp:205 +msgid "Slideshow options" +msgstr "Opcje pokazu slajdów" + +#: sq_slideshow.cpp:206 +msgid "Start" +msgstr "Uruchom" + +#: sq_slideshow.cpp:209 +msgid "Set directory to current" +msgstr "Ustaw katalog na bieżący" + +#: sq_slideshow.cpp:210 +msgid "Last visited directories" +msgstr "Ostatnio otwierane katalogi" + +#: sq_slideshow.cpp:220 +msgid "Repeats:" +msgstr "Powtórzenia:" + +#: sq_slideshow.cpp:221 +msgid "Background color:" +msgstr "Kolor tła:" + +#: sq_slideshow.cpp:222 +msgid "Onscreen messages" +msgstr "Komunikaty na ekranie" + +#: sq_slideshow.cpp:223 +msgid "Show current index" +msgstr "Pokaż bieżący indeks" + +#: sq_slideshow.cpp:224 +msgid "Show file name" +msgstr "Pokaż nazwę pliku" + +#: sq_slideshow.cpp:225 +msgid "Show file size" +msgstr "Pokaż rozmiar pliku" + +#: sq_slideshow.cpp:226 +msgid "Recursively" +msgstr "Rekursywnie" + +#: ksquirrel.cpp:288 +msgid "Clear history" +msgstr "Wyczyść historię" + +#: ksquirrel.cpp:289 +msgid "Clear address" +msgstr "Wyczyść adres" + +#: ksquirrel.cpp:294 +msgid "Go!" +msgstr "Idź!" + +#: ksquirrel.cpp:341 +msgid "Libraries' filters" +msgstr "Biblioteki filtrów" + +#: ksquirrel.cpp:364 +msgid "All supported formats" +msgstr "Wszystkie obsługiwane formaty" + +#: ksquirrel.cpp:374 +msgid "User's filters" +msgstr "Filtry użytkownika" + +#: ksquirrel.cpp:510 +msgid "Folder tree" +msgstr "Drzewo katalogów" + +#: ksquirrel.cpp:511 +msgid "Mount points" +msgstr "Punkty montowania" + +#: ksquirrel.cpp:628 +msgid "&Navigator" +msgstr "&Nawigator" + +#: ksquirrel.cpp:630 +msgid "&Action" +msgstr "&Akcje" + +#: ksquirrel.cpp:633 +msgid "&KIPI Plugins" +msgstr "Wtyczki &KIPI" + +#: ksquirrel.cpp:661 +msgid "Fi<er" +msgstr "Fi<ry" + +#: ksquirrel.cpp:720 +msgid "Thumbnail size" +msgstr "Rozmiar miniaturek" + +#: ksquirrel.cpp:723 sq_options.ui.h:137 +msgid "Image window" +msgstr "Okno obrazu" + +#: ksquirrel.cpp:725 +msgid "Reload codecs from disk" +msgstr "Przeładuj kodeki z twardego dysku" + +#: ksquirrel.cpp:726 +msgid "Configure external tools..." +msgstr "Konfiguruj zewnętrzne narzędzia..." + +#: ksquirrel.cpp:727 +msgid "Configure filters..." +msgstr "Konfiguruj filtry..." + +#: ksquirrel.cpp:728 +msgid "Go to tray" +msgstr "Do tacki systemowej" + +#: ksquirrel.cpp:729 +msgid "Open file and change directory" +msgstr "Otwórz plik i zmień katalog" + +#: ksquirrel.cpp:730 +msgid "Open file" +msgstr "Otwórz plik" + +#: ksquirrel.cpp:731 +msgid "Thumbnail cache manager..." +msgstr "Menedżer bufora miniaturek..." + +#: ksquirrel.cpp:735 +msgid "List" +msgstr "Lista" + +#: ksquirrel.cpp:736 +msgid "Icons" +msgstr "Ikony" + +#: ksquirrel.cpp:737 +msgid "Details" +msgstr "Detale" + +#: ksquirrel.cpp:738 sq_options.ui.h:136 +msgid "Thumbnails" +msgstr "Miniaturki" + +#: ksquirrel.cpp:740 +msgid "Show URL box" +msgstr "Pokaż URL" + +#: ksquirrel.cpp:742 +msgid "Built-in image window" +msgstr "Wbudowane okno obrazu" + +#: ksquirrel.cpp:745 +msgid "Slideshow" +msgstr "Pokaz slajdów" + +#: ksquirrel.cpp:746 +msgid "Slideshow advanced" +msgstr "Zaawansowany pokaz slajdów" + +#: ksquirrel.cpp:748 +msgid "Codec information..." +msgstr "Informacje kodeków..." + +#: ksquirrel.cpp:749 +msgid "OpenGL information..." +msgstr "Informacje OpenGL..." + +#: ksquirrel.cpp:751 +msgid "Medium thumbnails" +msgstr "Średnie miniaturki" + +#: ksquirrel.cpp:752 +msgid "Large thumbnails" +msgstr "Duże miniaturki" + +#: ksquirrel.cpp:753 +msgid "Huge thumbnails" +msgstr "Olbrzymie miniaturki" + +#: ksquirrel.cpp:755 +msgid "Select group" +msgstr "Zaznacz grupę" + +#: ksquirrel.cpp:756 +msgid "Deselect group" +msgstr "Odznacz grupę" + +#: ksquirrel.cpp:776 +msgid "Extended thumbnails" +msgstr "Rozszerzone miniaturki" + +#: ksquirrel.cpp:1085 +msgid " writing settings and thumbnails... " +msgstr " zapisywanie ustawień i miniaturek... " + +#: sq_filters.cpp:124 sq_filters.cpp:197 +msgid "Extensions" +msgstr "Rozszerzenia" + +#: sq_filters.cpp:181 +msgid "Adjust filters" +msgstr "Dostosuj filtry" + +#: sq_filters.cpp:186 +msgid "New filter" +msgstr "Nowy filtr" + +#: sq_filters.cpp:193 +msgid "Move filter up" +msgstr "Przesuń filtr w górę" + +#: sq_filters.cpp:195 +msgid "Move filter down" +msgstr "Przesuń filtr w dół" + +#: sq_filters.cpp:198 +msgid "Menu item contains both name and extension" +msgstr "MenuItem zawiera i nazwę i rozszerzenie" + +#: sq_helpwidget.cpp:175 +msgid "" +"

    Plik:%1
    Size:%2
    Link destination:%1
    Cel dowiązania:%1
    " +"" +"" +"" +"" +"" +"

    Esc,X,Return

    close

    Middle click, F

    fullscreen

    Z

    show 'Zoom' menu

    /

    show this help

    Right click, M, " +"ContextMenu

    show context menu

    N

    toggle filter

    Shift + Left button

    select a region

    Shift + Left

    previous tab

    Shift + Right

    next tab

    W

    close tab

    " +msgstr "" +"

    " +"" +"" +"" +"" +"" +"

    Esc,X,Enter

    zamknij

    Środkowy przycisk, F

    pełny ekran

    Z

    pokaż menu 'Powiększenie'

    /

    pokaż tę pomoc

    Prawy przycisk, M, " +"Menu kontekstowe

    pokaż menu kontekstowe

    N

    przełącz filtr

    Shift + Lewy przycisk

    zaznacz obszar

    Shift + Lewo

    poprzednia zakładka

    Shift + Prawo

    następna zakładka

    W

    zamknij zakładkę

    " + +#: sq_helpwidget.cpp:176 +msgid "" +"

    Space, Page Down

    next image

    Backspace, Page Up

    previous image

    Home

    first image

    End

    last image

    " +msgstr "" +"

    Spacja, Page Down

    następny obraz

    Backspace, Page Up

    poprzedni obraz

    Home

    pierwszy obraz

    End

    ostatni obraz

    " + +#: sq_helpwidget.cpp:177 +msgid "" +"

    " +msgstr "" +"

    Left, Right," +" Up, Down

    move the image

    Ctrl + Left

    rotate left

    Ctrl + Right

    rotate " +"right

    Ctrl + Up/Down

    rotate for 180 degrees up/down

    Alt + Left/Right

    rotate for 1 degree " +"left/right
    " + +#: sq_helpwidget.cpp:178 +msgid "" +"

    Lewo, Prawo," +" Góra, Dół

    przesuń obraz

    Ctrl + Lewo

    obróć w lewo

    Ctrl + Prawo

    obróć w prawo

    Ctrl + Góra/Dół

    obróć o 180 stopni góra/dół

    Alt + Lewo/Prawo

    obróć o 1 stopień " +"lewo/prawo
    " +msgstr "" +"

    +/-

    zoom " +"Nx

    Ctrl + +/-

    zoom " +"2x/0.5x

    Scroll

    load next/" +"prev file OR zoom+/zoom-

    Shift + Scroll

    zoom+/zoom-

    Ctrl + Scroll

    zoom+ 2x/zoom- 2x

    1..9

    zoom 1..9x

    0

    zoom 10x

    comma

    fit " +"width

    period

    fit height

    *

    fit image
    " + +#: sq_helpwidget.cpp:179 +msgid "" +"

    +/-

    powiększenie " +"Nx

    Ctrl + +/-

    powiększenie " +"2x/0.5x

    Kółko myszki

    ładuj następny/" +"poprzedni plik LUB powiększenie+/powiększenie-

    Shift + Scroll

    powiększenie+/powiększenie-

    Ctrl + Scroll

    powiększenie+ 2x/powiększenie- 2x

    1..9

    powiększenie 1..9x

    0

    powiększenie 10x

    comma

    dopasuj szerokość

    okres

    dostosuj wysokość

    *

    dopasuj obraz
    " +"

    S

    save as

    V

    flip vertically

    H

    flip horizontally

    R

    reset

    P

    image properties

    C

    codec settings

    L

    ignore zoom if image is smaller than " +"window

    I

    menu with " +"images

    A

    stop/start " +"animation

    B

    toggle " +"drawing background for transparent images

    K

    toggle drawing tickmarks

    E

    show menu with external " +"tools

    Y

    crop

    F1

    first image in " +"multi-paged image

    F2

    previous

    F3

    next

    F4

    last
    " +msgstr "" +"

    S

    zapisz jako

    V

    odwróć w pionie

    H

    odwróć w poziomie

    R

    resetuj

    P

    właściwości obrazu

    C

    ustawienia kodeka

    L

    ignoruj powiększenie jeśłi obraz jest mniejszy niż okno

    I

    menu z obrazkami

    A

    zatrzymaj/uruchom " +"animację

    B

    przełącz " +"rysowanie tła dla przeźroczystych obrazów

    K

    przełącz rysowanie tickmarków

    E

    pokaż menu z zewnętrznymi narzędziami

    Y

    crop

    F1

    pierwszy obraz w " +"wielostronicowym obrazie

    F2

    poprzedni

    F3

    następny

    F4

    ostatni
    " + +#: sq_helpwidget.cpp:182 sq_options.ui.h:135 +msgid "Filing" +msgstr "Wypełnianie" + +#: sq_helpwidget.cpp:184 +msgid "Current image" +msgstr "Bieżacy obraz" + +#: sq_options.ui.h:138 +msgid "Sidebar" +msgstr "" + +#: sq_options.ui.h:141 +msgid "KIPI" +msgstr "KIPI" + +#: sq_options.ui.h:260 +msgid "Wrong dimensions: %1x%2." +msgstr "Złe wymiary: %1x%2." + +#: sq_slideshowlisting.cpp:87 +msgid "Listing" +msgstr "" + +#: ksquirrel.cpp:751 +msgid "Rename" +msgstr "Zmień nazwę" + +#: ksquirrel.cpp:1951 +msgid "Renaming File" +msgstr "Zmienianie nazwy pliku" + +#: ksquirrel.cpp:1952 +msgid "

    Rename file %1 to:

    " +msgstr "

    Zmień nazwę pliku %1 na:

    " + +msgid "Calculate directory size" +msgstr "Oblicz wielkość katalogu" + +msgid "New folder..." +msgstr "Nowy katalog..." + +msgid "Create Subfolder" +msgstr "Utwórz Podkatalog" + +msgid "

    Create new folder in %1:

    " +msgstr "

    Utwórz nowy katalog w %1:

    " + +msgid "Rename Folder" +msgstr "Zmień nazwę katalogu" + +msgid "

    Rename folder %1 to:

    " +msgstr "

    Zmień nazwę katalogu %1 na:

    " + +msgid "Are you sure you want to delete %1?" +msgstr "Czy napewno chcesz usunąć %1?" + +msgid "Copy to last folder" +msgstr "Kopiuj ostatni katalog" + +msgid "Move to last folder" +msgstr "Przenieś do ostatniego katalogu" + +msgid "Message text color:" +msgstr "Kolor tekstu wiadomości:" + +msgid "Total" +msgstr "Ogółem" + +msgid "Visualize drag operation" +msgstr "Wizualizuj operację przeciągania" + +msgid "Testing" +msgstr "Testowanie" + +msgid "Lazy thumbnail generation" +msgstr "Powolne generowanie miniatur" + +msgid "Delay" +msgstr "Opóźnienie" + +msgid "Interface" +msgstr "Interfejs" + +msgid "Number of text lines" +msgstr "Ilość linii tekstu" + +msgid "Show file preview" +msgstr "Pokaż podgląd pliku" + +msgid "Number of additionally generated rows" +msgstr "Ilość dodatkowo generowanych wierszy" + +msgid "Repeat (copy to %1)" +msgstr "Powtórz (kopiuj do %1)" + +msgid "Repeat (move to %1)" +msgstr "Powtórz (przenieś do %1)" + +msgid "Repeat (link to %1)" +msgstr "Powtórz (dowiąż do %1)" + +msgid "Repeat (nothing to repeat)" +msgstr "Powtórz (nic do powtarzania)" + +msgid "Clear contents" +msgstr "Wyczyść zawartość" + +msgid "Are you sure you want to delete contents of %1?" +msgstr "Czy jesteś pewien, że chcesz usunąć zawartość %1?" + +msgid "Add to Folder Basket" +msgstr "Dodaj do koszyka katalogów" + +msgid "Folder basket" +msgstr "Koszyk folderów" + +msgid "Change icon" +msgstr "Zmień ikonę" + +msgid "

    Rename item %1 to:

    " +msgstr "

    Zmień nazwę pozycji %1 na:

    " + +msgid "Copy file path" +msgstr "Kopiuj ścieżkę do pliku" + +msgid "Copy file url" +msgstr "" + +msgid "Text color:" +msgstr "Kolor tekstu:" + +msgid "Show image dimensions" +msgstr "Pokaż wymiary obrazy" + +msgid "Text color..." +msgstr "Kolor tekstu..." + +msgid "Double click" +msgstr "Podwójny klik" + +msgid "Close window" +msgstr "Zamknij okno" + +msgid "Crop" +msgstr "Kadruj" + +msgid "Tabs" +msgstr "Zakładki" + +msgid "Enable tabs" +msgstr "Aktywuj zakładki" + +msgid "Ask what to do when opening new image" +msgstr "Zapytaj co robić przy otwarciu nowego obrazu" + +msgid "Show close buttons" +msgstr "Pokaż przyciski zamykania" + +msgid "Open in a new tab" +msgstr "Otwórz w nowej zakładce" + +msgid "Replace current tab" +msgstr "Zastąp bieżącą zakładkę" + +msgid "Close all and open in a new tab" +msgstr "Zamknij wszystko i otwórz w nowej zakładce" + +msgid "Opening..." +msgstr "Otwieranie..." + +msgid "Previous tab" +msgstr "Poprzednia zakładka" + +msgid "Next tab" +msgstr "Następna zakładka" + +msgid "Close tab" +msgstr "Zamknij zakładkę" + +msgid "Do nothing" +msgstr "Nie rób nic" + +msgid "Print available DCOP parameters" +msgstr "" + +msgid "Downloading..." +msgstr "" + +msgid "Close all tabs" +msgstr "" + +msgid "Close all opened images when closing window" +msgstr "" + +msgid "Codec manager..." +msgstr "" + +msgid "Select codecs to disable:" +msgstr "" + +msgid "Select codecs to enable:" +msgstr "" diff --git a/po/ru.po b/po/ru.po new file mode 100644 index 0000000..4771442 --- /dev/null +++ b/po/ru.po @@ -0,0 +1,2209 @@ +# translation of ru.po to +# Baryshev Dmitry , 2007. +# krasu , 2007. +msgid "" +msgstr "" +"Project-Id-Version: ru\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2007-08-07 09:45+0200\n" +"PO-Revision-Date: 2007-08-07 12:26+0300\n" +"Last-Translator: krasu \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: KBabel 1.11.4\n" +"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n" +"10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n" +"10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n" +"10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n" +"10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n" + +#: sq_filters.ui.h:56 sq_filters.ui.h:58 sq_externaltools.cpp:67 +#: sq_externaltools.cpp:194 sidebar/sq_mountview.cpp:64 sq_viewcache.cpp:47 +#: sq_viewcache.cpp:105 sq_filters.cpp:123 sq_filters.cpp:196 +msgid "Name" +msgstr "Имя" + +#: sq_externaltool.cpp:102 sq_externaltool.cpp:162 sq_externaltool.cpp:170 +msgid "No file selected" +msgstr "Не выбрано файлов" + +#: sq_kipimanager.cpp:68 +msgid "No Plugins" +msgstr "Нет модулей" + +#: sq_kipimanager.cpp:125 +msgid "Image actions" +msgstr "Изображения" + +#: sq_kipimanager.cpp:126 +msgid "Effects" +msgstr "Эффекты" + +#: sq_kipimanager.cpp:127 +msgid "Tools" +msgstr "Утилиты" + +#: sq_kipimanager.cpp:130 +msgid "Batch processing" +msgstr "Пакетная обработка" + +#: sq_kipimanager.cpp:131 +msgid "Collections" +msgstr "Коллекции" + +#: sq_libraryhandler.cpp:148 +msgid "All files" +msgstr "Все файлы" + +#: sq_navigatordropmenu.cpp:40 +msgid "Copy here" +msgstr "Копировать сюда" + +#: sq_navigatordropmenu.cpp:43 +msgid "Move here" +msgstr "Переместить сюда" + +#: sq_navigatordropmenu.cpp:46 +msgid "Link here" +msgstr "Создать ссылку сюда" + +#: sq_glinfo.cpp:45 sq_glinfo.cpp:92 +msgid "Parameter" +msgstr "Параметр" + +#: sq_glinfo.cpp:46 sq_glinfo.cpp:93 sq_imageproperties.cpp:321 +#: sq_imageproperties.cpp:408 imageedit/sq_imagefilter.cpp:487 +msgid "Value" +msgstr "Значение" + +#: sq_glinfo.cpp:91 +msgid "OpenGL information" +msgstr "Информация об OpenGL" + +#: sq_externaltools.cpp:66 sq_externaltools.cpp:193 +msgid "Pixmap" +msgstr "Иконка" + +#: sq_externaltools.cpp:68 sq_externaltools.cpp:195 +msgid "Command" +msgstr "Команда" + +#: sq_externaltools.cpp:190 +msgid "Adjust external tools" +msgstr "Настроить внешние утилиты" + +#: sq_externaltools.cpp:192 sq_filters.cpp:182 +msgid "OK" +msgstr "OK" + +#: sq_externaltools.cpp:196 sq_externaltools.ui.h:146 +#, c-format +msgid "Command can contain
    • %f: one file
    • %F: multiple files
    " +msgstr "Команда может содержать
    • %f: один файл
    • %F: несколько файлов
    " + +#: sq_externaltools.cpp:199 +msgid "New tool" +msgstr "Новая утилита" + +#: sq_externaltools.cpp:206 +msgid "Move tool up" +msgstr "Переместить утилиту вверх" + +#: sq_externaltools.cpp:208 +msgid "Move tool down" +msgstr "Переместить утилиту вниз" + +#: sq_kipiinterface.cpp:72 +msgid "Root directory" +msgstr "Корневая папка" + +#: sq_kipiinterface.cpp:144 +msgid "Folder content" +msgstr "Содержимое папки" + +#: sq_kipiinterface.cpp:161 +msgid "Selected images" +msgstr "Выбранные изображения" + +#: sq_kipiinterface.cpp:175 ksquirrel.cpp:513 +msgid "Image basket" +msgstr "Корзина изображений" + +#: main.cpp:40 +msgid "File to be opened at startup." +msgstr "Файл для открытия во время старта." + +#: main.cpp:41 +msgid "Print found libraries and exit." +msgstr "Отобразить найденные библиотеки и выйти" + +#: main.cpp:57 +msgid "KSquirrel - image viewer for KDE" +msgstr "KSquirrel - просмотрщик изображений для KDE" + +#: main.cpp:66 +msgid "Bug reports, patches" +msgstr "Отчёты об ошибках, заплатки" + +#: main.cpp:67 +msgid "Bug reports" +msgstr "Отчёты об ошибках" + +#: main.cpp:68 +msgid "Translation help" +msgstr "Помощь в переводе" + +#: main.cpp:69 +msgid "TiamaT" +msgstr "TiamaT" + +#: main.cpp:69 +msgid "Initial artwork for edit tools" +msgstr "Начальная графическая работа для утилит редактирования" + +#: main.cpp:70 +msgid "Fera" +msgstr "Fera" + +#: main.cpp:70 +msgid "Great artwork for edit tools" +msgstr "Отличная графическая работа для утилит редактирования" + +#: main.cpp:71 +msgid "OpenGL forum at" +msgstr "OpenGL форум на" + +#: main.cpp:72 +msgid "GameDev forum at" +msgstr "GameDev форум на" + +#: sq_imageproperties.cpp:320 sq_imageproperties.cpp:407 +msgid "Group" +msgstr "Группа" + +#: sq_imageproperties.cpp:359 sq_glwidget.cpp:350 +msgid "Image properties" +msgstr "Свойства изображения" + +#: sq_imageproperties.cpp:361 +msgid "Attributes" +msgstr "Аттрибуты" + +#: sq_imageproperties.cpp:362 +msgid "Owner:" +msgstr "Владелец:" + +#: sq_imageproperties.cpp:363 +msgid "Group:" +msgstr "Группа:" + +#: sq_imageproperties.cpp:365 +msgid "Permissions:" +msgstr "Права:" + +#: sq_imageproperties.cpp:368 +msgid "Time" +msgstr "Время" + +#: sq_imageproperties.cpp:369 +msgid "Created:" +msgstr "Создан:" + +#: sq_imageproperties.cpp:370 +msgid "Last read:" +msgstr "Последнее чтение:" + +#: sq_imageproperties.cpp:371 +msgid "Last modified:" +msgstr "Модификация:" + +#: sq_imageproperties.cpp:375 sq_helpwidget.cpp:181 sq_options.ui.h:134 +msgid "General" +msgstr "Общие" + +#: sq_imageproperties.cpp:376 +msgid "File:" +msgstr "Файл:" + +#: sq_imageproperties.cpp:378 sq_pluginsinfo.cpp:137 sq_slideshow.cpp:211 +msgid "Directory:" +msgstr "Каталог:" + +#: sq_imageproperties.cpp:379 +msgid "Size:" +msgstr "Размер:" + +#: sq_imageproperties.cpp:381 +msgid "Type:" +msgstr "Тип:" + +#: sq_imageproperties.cpp:382 +msgid "Number of frames:" +msgstr "Количество страниц:" + +#: sq_imageproperties.cpp:383 +msgid "Current frame" +msgstr "Текущая страница" + +#: sq_imageproperties.cpp:384 sq_slideshow.cpp:219 +msgid "Delay:" +msgstr "Задержка:" + +#: sq_imageproperties.cpp:385 +msgid "Dimensions:" +msgstr "Размеры:" + +#: sq_imageproperties.cpp:386 +msgid "Bits per pixel:" +msgstr "Бит на пиксель:" + +#: sq_imageproperties.cpp:387 +msgid "Color space:" +msgstr "Цветовое пространство:" + +#: sq_imageproperties.cpp:388 +msgid "Compression:" +msgstr "Сжатие:" + +#: sq_imageproperties.cpp:389 +msgid "Uncompressed size:" +msgstr "Распакованный размер:" + +#: sq_imageproperties.cpp:390 +msgid "Compression ratio:" +msgstr "Степень сжатия:" + +#: sq_imageproperties.cpp:391 +msgid "Interlaced:" +msgstr "Черезстрочное:" + +#: sq_imageproperties.cpp:392 +msgid "Status:" +msgstr "Состояние:" + +#: sq_imageproperties.cpp:406 sq_glwidget.cpp:2662 sq_options.cpp:816 +msgid "Image" +msgstr "Изображение" + +#: sq_imageproperties.cpp:409 +msgid "Metadata" +msgstr "Метаданные" + +#: sq_pluginsinfo.cpp:55 sq_pluginsinfo.cpp:129 +msgid "..." +msgstr "..." + +#: sq_pluginsinfo.cpp:56 sq_pluginsinfo.cpp:130 +msgid "Icon" +msgstr "Иконка" + +#: sq_pluginsinfo.cpp:57 sq_pluginsinfo.cpp:131 +msgid "Library" +msgstr "Библиотека" + +#: sq_pluginsinfo.cpp:58 sq_pluginsinfo.cpp:132 +msgid "Version" +msgstr "Версия" + +#: sq_pluginsinfo.cpp:59 sq_pluginsinfo.cpp:133 sq_viewcache.cpp:48 +#: sq_viewcache.cpp:106 +msgid "MIME" +msgstr "MIME" + +#: sq_pluginsinfo.cpp:128 +msgid "Codec information and settings" +msgstr "Информация и настройки кодеков" + +#: sq_pluginsinfo.cpp:138 +msgid "Total found:" +msgstr "Всего найдено:" + +#: sq_errorstring.cpp:34 +msgid "cannot open file for reading" +msgstr "не могу открыть файл на чтение" + +#: sq_errorstring.cpp:35 +msgid "file corrupted" +msgstr "файл повреждён" + +#: sq_errorstring.cpp:36 +msgid "no memory" +msgstr "недостаточно памяти" + +#: sq_errorstring.cpp:37 +msgid "file type not supported" +msgstr "тип файла не поддерживается" + +#: sq_errorstring.cpp:38 +msgid "wrong image dimensions" +msgstr "неправильные размеры изображения" + +#: sq_errorstring.cpp:39 +msgid "cannot open file for writing" +msgstr "не могу открыть файл на запись" + +#: sq_errorstring.cpp:40 +msgid "write feature is not supported" +msgstr "запись не поддерживается" + +#: sq_errorstring.cpp:41 +msgid "write error (check free space)" +msgstr "ошибка записи (проверьте свободное место)" + +#: sq_errorstring.cpp:42 +msgid "wrong parameters" +msgstr "неправильные параметры" + +#: sq_errorstring.cpp:43 +msgid "Editing process is not finished yet" +msgstr "Процесс редактирования ещё не завершён" + +#: sq_selectdeselectgroup.cpp:83 +msgid "Filename or mask:" +msgstr "Имя файла или маска:" + +#: sidebar/sq_treeview.cpp:89 +msgid "root" +msgstr "корень" + +#: sidebar/sq_categoriesview.cpp:95 ksquirrel.cpp:512 +msgid "Categories" +msgstr "Категории" + +#: sidebar/sq_categoriesview.cpp:115 sidebar/sq_categoriesview.cpp:166 +msgid "New category" +msgstr "Новая категория" + +#: sidebar/sq_categoriesview.cpp:153 sidebar/sq_categoriesview.cpp:218 +msgid "New Category" +msgstr "Новая Категория" + +#: sidebar/sq_categoriesview.cpp:169 sidebar/sq_categoriesview.cpp:198 +msgid "Create default categories" +msgstr "Создать категории по умолчанию" + +#: sidebar/sq_categoriesview.cpp:197 +msgid "" +"This will create default categories: Concerts, Pets, Home, Friends, Free time, " +"Travelling and Nature. Continue?" +msgstr "" +"Данное действие создаст категории по умолчанию: Concerts, Pets, Home, Friends, Free time, " +"Travelling and Nature. Продолжить?" + +#: sidebar/sq_categoriesview.cpp:218 +msgid "Create new category:" +msgstr "Создать новую категорию:" + +#: sidebar/sq_mountview.cpp:43 +msgid "Mount" +msgstr "Смонтировать" + +#: sidebar/sq_mountview.cpp:45 +msgid "Unmount" +msgstr "Отмонтировать" + +#: sidebar/sq_mountview.cpp:47 +msgid "Refresh" +msgstr "Обновить" + +#: sidebar/sq_mountview.cpp:170 +msgid "Device" +msgstr "Устройство" + +#: sidebar/sq_mountview.cpp:173 +msgid "FS Type" +msgstr "Тип ФС" + +#: sidebar/sq_imagebasket.cpp:244 +msgid "Synchronize" +msgstr "Синхронизировать" + +#: sidebar/sq_previewwidget.cpp:60 +msgid "Background color..." +msgstr "Цвет фона..." + +#: sidebar/sq_categorybrowsermenu.cpp:137 +#: sidebar/sq_categorybrowsermenu.cpp:146 +msgid "Failed to Read Folder" +msgstr "Ошибка Чтения Папки" + +#: sidebar/sq_categorybrowsermenu.cpp:154 +msgid "Not Authorized to Read Folder" +msgstr "Нет Прав на Чтение" + +#: sidebar/sq_categorybrowsermenu.cpp:167 +msgid "Add here" +msgstr "Добавить сюда" + +#: sidebar/sq_categorybrowsermenu.cpp:310 +msgid "More..." +msgstr "Больше..." + +#: sq_thumbnailcachemaster.cpp:143 +msgid "Thumbnail cache" +msgstr "Кэш эскизов" + +#: sq_thumbnailcachemaster.cpp:144 +msgid "Calculate cache size on disk" +msgstr "Подсчитать размер кэша на диске" + +#: sq_thumbnailcachemaster.cpp:146 +msgid "Clear cache on disk" +msgstr "Очистить кэш на диске" + +#: sq_thumbnailcachemaster.cpp:147 +msgid "View memory cache" +msgstr "Просмотреть кэш в памяти" + +#: sq_thumbnailcachemaster.cpp:148 +msgid "Clear cache in memory" +msgstr "Очистить кэш в памяти" + +#: sq_thumbnailcachemaster.cpp:150 +msgid "Sync cache to disk" +msgstr "Синхронизировать кэш на диск" + +#: sq_thumbnailcachemaster.cpp:151 +msgid "Calculate cache size in memory" +msgstr "Подсчитать размер кэша в памяти" + +#: sq_diroperator.cpp:138 +msgid "remote filesystem" +msgstr "нелокальная ф.система" + +#: sq_diroperator.cpp:158 +msgid "" +"
    Mount point:%1
    Total size:%" +"2
    Used:%3
    Available:%4
    " +msgstr "" +"
    Точка монтирования:%1
    Общий размер:%" +"2
    Использовано:%3
    Доступно:%4
    " + +#: sq_diroperator.cpp:245 +msgid "no files selected" +msgstr "не выбрано файлов" + +#: sq_diroperator.cpp:306 +msgid "Edit file type" +msgstr "Редактировать тип файла" + +#: sq_diroperator.cpp:307 +msgid "Add to Basket" +msgstr "Добавить в Корзину" + +#: sq_diroperator.cpp:309 sq_diroperator.cpp:889 +msgid "File actions" +msgstr "Действия над файлами" + +#: sq_diroperator.cpp:327 +msgid "Copy to..." +msgstr "Копировать в..." + +#: sq_diroperator.cpp:328 +msgid "Move to..." +msgstr "Переместить в..." + +#: sq_diroperator.cpp:329 +msgid "Link to..." +msgstr "Создать ссылку в..." + +#: sq_diroperator.cpp:331 +msgid "Run" +msgstr "Запустить" + +#: sq_diroperator.cpp:333 +msgid "Recreate selected thumbnails" +msgstr "Пересоздать выбранные эскизы" + +#: sq_diroperator.cpp:336 +msgid "Convert..." +msgstr "Преобразовать..." + +#: sq_diroperator.cpp:439 +msgid "Total %1 in %2 (%3, %4)" +msgstr "Всего %1 в %2 (%3, %4)" + +#: sq_diroperator.cpp:441 +msgid "1 item" +msgstr "1 элемент" + +#: sq_diroperator.cpp:442 +msgid "1 folder" +msgstr "1 папка" + +#: sq_diroperator.cpp:443 +msgid "1 file" +msgstr "1 файл" + +#: sq_diroperator.cpp:627 +#, c-format +msgid "Command cannot contain both \"%f\" and \"%F\"" +msgstr "Команда не может содержать и \"%f\" и \"%F\"" + +#: sq_diroperator.cpp:627 sq_diroperator.cpp:632 +msgid "Error processing command" +msgstr "Ошибка обработки команды" + +#: sq_diroperator.cpp:632 +#, c-format +msgid "Command should contain \"%f\" or \"%F\"" +msgstr "Команда должна содержать \"%f\" или \"%F\"" + +#: sq_diroperator.cpp:741 +msgid "Unsupported format \"%1\"" +msgstr "неподдерживаемый формат \"%1\"" + +#: sq_diroperator.cpp:886 +msgid "Add to &Category" +msgstr "Добавить в &Категорию" + +#: sq_diroperator.cpp:890 +msgid "&External tools" +msgstr "&Внешние утилиты" + +#: sq_slideshowwidget.cpp:345 +msgid "" +"
    Enter, Escape, Returnstop " +"slideshow
    Pause, Spacepause/unpause " +"slideshow
    Page Upprevious image
    Page Downnext image
    Mshow/hide onscreen messages
    " +msgstr "" +"
    Enter, Escape, Returnостановить показ слайдов
    Pause, Spaceприостановить/возобновить показ слайдов
    Page Upпредыдущее изображение
    Page Downследующее изображение
    Mпоказать/спрятать экранные сообщение
    " + +#: sq_codecsettingsskeleton.ui.h:28 +msgid "" +"Error loading widget from %1. Please check your installation or " +"contact ksquirrel.iv@gmail.com" +msgstr "Ошибка загрузки компонента из %1. Пожалуйста, проверьте правильность установки или сообщите на ksquirrel.iv@gmail.com" + +#: sq_widgetstack.cpp:473 sq_widgetstack.cpp:507 +msgid "No files to copy or move" +msgstr "Нет файлов для копирования или перемещения" + +#: sq_widgetstack.cpp:607 +msgid "Select a group of files" +msgstr "Отметить группу файлов" + +#: sq_widgetstack.cpp:607 +msgid "Deselect a group of files" +msgstr "Снять отметку с группы файлов" + +#: sq_widgetstack.cpp:608 +msgid "Select!" +msgstr "Отметить!" + +#: sq_widgetstack.cpp:608 +msgid "Deselect!" +msgstr "Снять отметку!" + +#: sq_filethumbview.cpp:370 +msgid "" +"%3%4" +msgstr "" +"
    File:%1
    Size:%2
    %3%4" + +#: sq_filethumbview.cpp:373 +msgid "" +msgstr "" + +#: imageedit/sq_writeoption.cpp:108 +msgid "RLE compression" +msgstr "RLE сжатие" + +#: imageedit/sq_writeoption.cpp:109 +msgid "Compression level" +msgstr "Степень сжатия" + +#: imageedit/sq_writeoption.cpp:110 +msgid "Interlaced" +msgstr "Черезстрочно" + +#: imageedit/sq_writeoption.cpp:112 +msgid "No special options available for this format" +msgstr "Нет специальных настроек для данного формата" + +#: imageedit/sq_converter.cpp:47 +msgid "internal error" +msgstr "внутренняя ошибка" + +#: imageedit/sq_converter.cpp:48 +msgid "failed" +msgstr "ошибка" + +#: imageedit/sq_converter.cpp:50 +msgid "Converting" +msgstr "Преобразование" + +#: imageedit/sq_converter.cpp:68 +msgid "Select files to edit" +msgstr "Выберете файлы для редактирования" + +#: imageedit/sq_converter.cpp:73 +msgid "" +"Converter cannot work with remote files.\n" +"Sorry" +msgstr "Конвертер не может работать с нелокальными файлами.\nИзвините" + +#: imageedit/sq_converter.cpp:160 +msgid "Temporary file creation failed" +msgstr "Ошибка создания временного файла" + +#: imageedit/sq_converter.cpp:243 sq_imageproperties.ui.h:72 +msgid "1 error" +msgstr "1 ошибка" + +#: imageedit/sq_converter.cpp:250 +msgid "Removing" +msgstr "Удаление" + +#: imageedit/sq_converter.cpp:436 +msgid "Convert 1 file" +msgstr "Преобразовать 1 файл" + +#: imageedit/sq_imageeditoptions.cpp:134 +msgid "Edit options" +msgstr "Редактировать настройки" + +#: imageedit/sq_imageeditoptions.cpp:135 +msgid "New files" +msgstr "Новые файлы" + +#: imageedit/sq_imageeditoptions.cpp:136 +msgid "Place here" +msgstr "Поместить сюда" + +#: imageedit/sq_imageeditoptions.cpp:137 +msgid "Replace original files" +msgstr "Заменить оригинальные файлы" + +#: imageedit/sq_imageeditoptions.cpp:138 +msgid "Place files in current directory, renaming them if necessary" +msgstr "Поместить файлы в текущую папку, переименовывая их по необходимости" + +#: imageedit/sq_imageeditoptions.cpp:139 +msgid "Place files in current directory, replacing existing files" +msgstr "Поместить файлы в текущую папку, заменяя существующие файлы" + +#: imageedit/sq_imageeditoptions.cpp:140 +msgid "Close, when all operations succeeded" +msgstr "Закрыть, когда все операции завершились успешно" + +#: imageedit/sq_imagebcg.ui.h:17 imageedit/sq_imagebcg.ui.h:31 +#: imageedit/sq_imagebcg.cpp:382 +msgid "Brightness" +msgstr "Яркость" + +#: imageedit/sq_imagebcg.ui.h:18 imageedit/sq_imagebcg.ui.h:31 +#: imageedit/sq_imagebcg.cpp:383 +msgid "Contrast" +msgstr "Контраст" + +#: imageedit/sq_imagebcg.ui.h:19 imageedit/sq_imagebcg.ui.h:31 +#: imageedit/sq_imagebcg.cpp:384 +msgid "Gamma" +msgstr "Гамма" + +#: imageedit/sq_imagebcg.ui.h:20 imageedit/sq_imagebcg.ui.h:32 +#: imageedit/sq_imagebcg.cpp:390 +msgid "Red" +msgstr "Красный" + +#: imageedit/sq_imagebcg.ui.h:20 +msgid "Cyan" +msgstr "Циан" + +#: imageedit/sq_imagebcg.ui.h:21 imageedit/sq_imagebcg.ui.h:32 +#: imageedit/sq_imagebcg.cpp:389 +msgid "Green" +msgstr "Зелёный" + +#: imageedit/sq_imagebcg.ui.h:21 +msgid "Magenta" +msgstr "Магента" + +#: imageedit/sq_imagebcg.ui.h:22 imageedit/sq_imagebcg.ui.h:32 +#: imageedit/sq_imagebcg.cpp:388 +msgid "Blue" +msgstr "Синий" + +#: imageedit/sq_imagebcg.ui.h:22 +msgid "Yellow" +msgstr "Жёлтый" + +#: imageedit/sq_imagefilter.cpp:473 imageedit/sq_imagefilter.cpp:539 +msgid "Filter" +msgstr "Фильтр" + +#: imageedit/sq_imagefilter.cpp:474 imageedit/sq_imagefilter.cpp:486 +msgid "Color:" +msgstr "Цвет:" + +#: imageedit/sq_imagefilter.cpp:476 +msgid "Opacity" +msgstr "Непрозрачность" + +#: imageedit/sq_imagefilter.cpp:477 imageedit/sq_imagefilter.cpp:482 +#: imageedit/sq_imagefilter.cpp:505 +msgid "Sigma" +msgstr "Сигма" + +#: imageedit/sq_imagefilter.cpp:478 imageedit/sq_imagefilter.cpp:481 +#: imageedit/sq_imagefilter.cpp:483 imageedit/sq_imagefilter.cpp:501 +#: imageedit/sq_imagefilter.cpp:506 +msgid "Radius" +msgstr "Радиус" + +#: imageedit/sq_imagefilter.cpp:479 imageedit/sq_imagefilter.cpp:492 +#: imageedit/sq_imagefilter.cpp:507 +msgid "Factor" +msgstr "Фактор" + +#: imageedit/sq_imagefilter.cpp:480 imageedit/sq_imagefilter.cpp:484 +#: imageedit/sq_imagefilter.cpp:493 imageedit/sq_imagefilter.cpp:514 +msgid "" +"There are no special options available for this filter. Just click \"Filter" +"\"." +msgstr "Нет специальных параметров для этого фильтра. Просто нажмите \"Фильтр\"." + +#: imageedit/sq_imagefilter.cpp:490 +msgid "Color 1:" +msgstr "Цвет 1:" + +#: imageedit/sq_imagefilter.cpp:491 +msgid "Color 2:" +msgstr "Цвет 2:" + +#: imageedit/sq_imagefilter.cpp:494 +msgid "Noise type" +msgstr "Тип шума" + +#: imageedit/sq_imagefilter.cpp:495 +msgid "Uniform" +msgstr "Uniform" + +#: imageedit/sq_imagefilter.cpp:496 +msgid "Impulse" +msgstr "Impulse" + +#: imageedit/sq_imagefilter.cpp:497 +msgid "Multiplicative Gaussian" +msgstr "Multiplicative Gaussian" + +#: imageedit/sq_imagefilter.cpp:498 +msgid "Poisson" +msgstr "Poisson" + +#: imageedit/sq_imagefilter.cpp:499 +msgid "Gaussian" +msgstr "Gaussian" + +#: imageedit/sq_imagefilter.cpp:500 +msgid "Laplacian" +msgstr "Laplacian" + +#: imageedit/sq_imagefilter.cpp:502 +msgid "Color" +msgstr "Цвет" + +#: imageedit/sq_imagefilter.cpp:503 +msgid "Elevation" +msgstr "Возвышение" + +#: imageedit/sq_imagefilter.cpp:504 +msgid "Azimuth" +msgstr "Азимут" + +#: imageedit/sq_imagefilter.cpp:508 +msgid "Amount" +msgstr "Величина" + +#: imageedit/sq_imagefilter.cpp:509 +msgid "Type" +msgstr "Тип" + +#: imageedit/sq_imagefilter.cpp:510 +msgid "GBR" +msgstr "GBR" + +#: imageedit/sq_imagefilter.cpp:511 +msgid "BRG" +msgstr "BRG" + +#: imageedit/sq_imagefilter.cpp:512 +msgid "Degrees" +msgstr "Градусы" + +#: imageedit/sq_imagefilter.cpp:513 imageedit/sq_imagefilter.cpp:515 +#: imageedit/sq_imagefilter.cpp:536 +msgid "Threshold" +msgstr "Порог" + +#: imageedit/sq_imagefilter.cpp:517 +msgid "Blend" +msgstr "Смешение" + +#: imageedit/sq_imagefilter.cpp:518 +msgid "Blur" +msgstr "Размытие" + +#: imageedit/sq_imagefilter.cpp:519 +msgid "Desaturate" +msgstr "Ненасыщенность" + +#: imageedit/sq_imagefilter.cpp:520 +msgid "Despeckle" +msgstr "Удаление пятен" + +#: imageedit/sq_imagefilter.cpp:521 +msgid "Edge" +msgstr "Край" + +#: imageedit/sq_imagefilter.cpp:522 +msgid "Emboss" +msgstr "Барельеф" + +#: imageedit/sq_imagefilter.cpp:523 +msgid "Equalize" +msgstr "Эквализация" + +#: imageedit/sq_imagefilter.cpp:524 +msgid "Fade" +msgstr "Угасание" + +#: imageedit/sq_imagefilter.cpp:525 +msgid "Flatten" +msgstr "Сведение" + +#: imageedit/sq_imagefilter.cpp:526 +msgid "Implode" +msgstr "Внедрение" + +#: imageedit/sq_imagefilter.cpp:527 +msgid "Negative" +msgstr "Негатив" + +#: imageedit/sq_imagefilter.cpp:528 +msgid "Noise" +msgstr "Шум" + +#: imageedit/sq_imagefilter.cpp:529 +msgid "Oil" +msgstr "Масло" + +#: imageedit/sq_imagefilter.cpp:530 +msgid "Shade" +msgstr "Затенить" + +#: imageedit/sq_imagefilter.cpp:531 +msgid "Sharpen" +msgstr "Резкость" + +#: imageedit/sq_imagefilter.cpp:532 +msgid "Solarize" +msgstr "Солярис" + +#: imageedit/sq_imagefilter.cpp:533 +msgid "Spread" +msgstr "Таянье" + +#: imageedit/sq_imagefilter.cpp:534 +msgid "Swap colors" +msgstr "Поменять цвета" + +#: imageedit/sq_imagefilter.cpp:535 +msgid "Swirl" +msgstr "Закрутка" + +#: imageedit/sq_imagefilter.cpp:537 +msgid "Grayscale" +msgstr "Серое" + +#: imageedit/sq_imagefilter.cpp:538 +msgid "Redeye" +msgstr "Красные глаза" + +#: imageedit/sq_imagefilter.cpp:541 +msgid "Image after filtering:" +msgstr "Изображение после фильтрации:" + +#: imageedit/sq_imagefilter.cpp:542 imageedit/sq_imagebcg.cpp:397 +msgid "Original image:" +msgstr "Оригинальное изображение:" + +#: imageedit/sq_imagebcg.cpp:378 +msgid "Color balance" +msgstr "Баланс цвета" + +#: imageedit/sq_imagebcg.cpp:394 +msgid "Colorize" +msgstr "Цветность" + +#: imageedit/sq_imagebcg.cpp:396 +msgid "Image after colorizing:" +msgstr "Изображение после оцветовки:" + +#: imageedit/sq_imageconvert.cpp:167 +msgid "Convert" +msgstr "Преобразовать" + +#: imageedit/sq_imageconvert.cpp:172 +msgid "Conversion options" +msgstr "Опции преобразования" + +#: sq_viewcache.cpp:49 sq_viewcache.cpp:107 +msgid "Parameters" +msgstr "Параметры" + +#: sq_viewcache.cpp:103 +msgid "Memory cache" +msgstr "Кэш в памяти" + +#: sq_viewcache.cpp:108 +msgid "Total:" +msgstr "Всего:" + +#: sq_imageproperties.ui.h:29 +msgid "Copy entry" +msgstr "Копировать запись" + +#: sq_imageproperties.ui.h:30 +msgid "Copy all entries" +msgstr "Копировать все записи" + +#: sq_imageproperties.ui.h:95 +msgid "EXIF" +msgstr "EXIF" + +#: sq_imageproperties.ui.h:105 +msgid "Simple" +msgstr "Простой" + +#: sq_imageproperties.ui.h:108 +msgid "Full" +msgstr "Расширенный" + +#: sq_imageproperties.ui.h:127 +msgid "EXIF (no)" +msgstr "EXIF (нет)" + +#: sq_imageproperties.ui.h:177 +msgid "Metadata (no)" +msgstr "Метаданные (нет)" + +#: _translatorinfo.cpp:1 +msgid "" +"_: NAME OF TRANSLATORS\n" +"Your names" +msgstr "Барышев Дмитрий" + +#: _translatorinfo.cpp:3 +msgid "" +"_: EMAIL OF TRANSLATORS\n" +"Your emails" +msgstr "ksquirrel.iv@gmail.com" + +#: sq_glwidget.cpp:233 +msgid "Rectangle" +msgstr "Прямоугольник" + +#: sq_glwidget.cpp:234 +msgid "Ellipse" +msgstr "Эллипс" + +#: sq_glwidget.cpp:239 +msgid "Fit width" +msgstr "Заполнить ширину" + +#: sq_glwidget.cpp:240 +msgid "Fit height" +msgstr "Заполнить высоту" + +#: sq_glwidget.cpp:241 +msgid "Fit image" +msgstr "Заполнить изображение" + +#: sq_glwidget.cpp:242 +msgid "Zoom 100%" +msgstr "Увеличение 100%" + +#: sq_glwidget.cpp:243 +msgid "Leave previous zoom" +msgstr "Оставить предыдущее увеличение" + +#: sq_glwidget.cpp:244 +msgid "Ignore, if image is smaller than window" +msgstr "Игнорировать, если изображение меньше окна" + +#: sq_glwidget.cpp:318 +msgid "Go to first image" +msgstr "Перейти к первому изображению" + +#: sq_glwidget.cpp:319 +msgid "Previous image" +msgstr "Предыдущее изображение" + +#: sq_glwidget.cpp:321 +msgid "Next image" +msgstr "Следующее изображение" + +#: sq_glwidget.cpp:323 +msgid "Go to last image" +msgstr "Перейти к последнему изображению" + +#: sq_glwidget.cpp:326 sq_glwidget.cpp:2685 +msgid "Zoom +" +msgstr "Увеличить" + +#: sq_glwidget.cpp:328 sq_glwidget.cpp:2686 +msgid "Zoom -" +msgstr "Уменьшить" + +#: sq_glwidget.cpp:332 sq_glwidget.cpp:2677 +msgid "Rotate left" +msgstr "Повернуть влево" + +#: sq_glwidget.cpp:334 sq_glwidget.cpp:2678 +msgid "Rotate right" +msgstr "Повернуть вправо" + +#: sq_glwidget.cpp:336 sq_glwidget.cpp:2707 +msgid "Flip vertically" +msgstr "Отразить вертикально" + +#: sq_glwidget.cpp:338 sq_glwidget.cpp:2708 +msgid "Flip horizontally" +msgstr "Отразить горизонтально" + +#: sq_glwidget.cpp:340 +msgid "Normalize" +msgstr "Нормализация" + +#: sq_glwidget.cpp:342 sq_glwidget.cpp:2723 +msgid "Fullscreen" +msgstr "Полный экран" + +#: sq_glwidget.cpp:344 +msgid "Select image" +msgstr "Выбрать изображение" + +#: sq_glwidget.cpp:346 +msgid "Selection" +msgstr "Выделение" + +#: sq_glwidget.cpp:348 sq_glwidget.cpp:2717 sq_codecsettingsskeleton.cpp:128 +msgid "Codec settings" +msgstr "Настройки кодека" + +#: sq_glwidget.cpp:351 +msgid "Show navigator" +msgstr "Показать навигатор" + +#: sq_glwidget.cpp:1024 +msgid "yes" +msgstr "да" + +#: sq_glwidget.cpp:1024 +msgid "no" +msgstr "нет" + +#: sq_glwidget.cpp:1485 +msgid "Codec for %1 format not found" +msgstr "Кодек для формата %1 не найден" + +#: sq_glwidget.cpp:1729 +msgid "Memory allocation failed for %1 of memory" +msgstr "Ошибка выделения памяти для %1 памяти" + +#: sq_glwidget.cpp:1741 +msgid "Memory allocation failed" +msgstr "Ошибка выделения памяти" + +#: sq_glwidget.cpp:1747 +msgid "Decoding failed" +msgstr "Ошибка декодирования" + +#: sq_glwidget.cpp:1849 +msgid " ms." +msgstr " мс." + +#: sq_glwidget.cpp:2363 +msgid "" +"Sorry, could not perform write operation\n" +"for codec \"%1\"" +msgstr "" +"Извините, не могу начать операцию записи\n" +"для кодека \"%1\"" + +#: sq_glwidget.cpp:2382 sq_glwidget.cpp:2390 sq_glwidget.cpp:2412 +msgid "Error writing image" +msgstr "Ошибка записи изображения" + +#: sq_glwidget.cpp:2433 +msgid "Try another location?" +msgstr "Попробовать другой путь?" + +#: sq_glwidget.cpp:2658 +msgid "Rotate" +msgstr "Поворот" + +#: sq_glwidget.cpp:2661 sq_options.cpp:803 +msgid "Window" +msgstr "Окно" + +#: sq_glwidget.cpp:2670 +msgid "Next" +msgstr "Следующий" + +#: sq_glwidget.cpp:2671 +msgid "Previous" +msgstr "Предыдущий" + +#: sq_glwidget.cpp:2672 +msgid "First" +msgstr "Первый" + +#: sq_glwidget.cpp:2673 +msgid "Last" +msgstr "Последний" + +#: sq_glwidget.cpp:2680 +msgid "Rotate 180'" +msgstr "Повернуть на 180'" + +#: sq_glwidget.cpp:2682 +msgid "Rotate 1' left" +msgstr "Повернуть влево на 1'" + +#: sq_glwidget.cpp:2683 +msgid "Rotate 1' right" +msgstr "Повернуть вправо на 1'" + +#: sq_glwidget.cpp:2687 +msgid "Zoom 2x" +msgstr "Увеличить 2х" + +#: sq_glwidget.cpp:2688 +msgid "Zoom 1/2x" +msgstr "Увеличить 1/2х" + +#: sq_glwidget.cpp:2698 +msgid "Move left" +msgstr "Сдвинуть влево" + +#: sq_glwidget.cpp:2699 +msgid "Move right" +msgstr "Сдвинуть вправо" + +#: sq_glwidget.cpp:2700 +msgid "Move up" +msgstr "Сдвинуть верх" + +#: sq_glwidget.cpp:2701 +msgid "Move down" +msgstr "Сдвинуть вниз" + +#: sq_glwidget.cpp:2703 +msgid "Start/stop animation" +msgstr "Начать/остановить анимацию" + +#: sq_glwidget.cpp:2704 +msgid "Hide/show background" +msgstr "Показать/скрыть фон" + +#: sq_glwidget.cpp:2705 +msgid "Hide/show tickmarks" +msgstr "Показать/скрыть метки" + +#: sq_glwidget.cpp:2710 +msgid "First page" +msgstr "Первая страница" + +#: sq_glwidget.cpp:2711 +msgid "Previous page" +msgstr "Предыдущая страница" + +#: sq_glwidget.cpp:2712 +msgid "Next page" +msgstr "Следующая страница" + +#: sq_glwidget.cpp:2713 +msgid "Last page" +msgstr "Последняя страница" + +#: sq_glwidget.cpp:2715 +msgid "To clipboard" +msgstr "В буфер обмена" + +#: sq_glwidget.cpp:2720 +msgid "Color balance..." +msgstr "Баланс цвета..." + +#: sq_glwidget.cpp:2721 +msgid "Apply filter..." +msgstr "Применить фильтр..." + +#: sq_glwidget.cpp:2724 +msgid "Hide/show toolbar" +msgstr "Показать/скрыть панель инструментов" + +#: sq_glwidget.cpp:2725 +msgid "Hide/show statusbar" +msgstr "Показать/скрыть строку статуса" + +#: sq_glwidget.cpp:2728 +msgid "Reset" +msgstr "Нормализовать" + +#: sq_glwidget.cpp:2731 sq_helpwidget.cpp:174 +msgid "Hotkeys" +msgstr "Горячие клавиши" + +#: sq_glview.cpp:84 +msgid "Loading time" +msgstr "Время загрузки" + +#: sq_options.cpp:746 +msgid "The main options" +msgstr "Главные настройки" + +#: sq_options.cpp:748 +msgid "Write configuration file to disk, when I press \"OK\"" +msgstr "Записать конфигурационный файл на диск, когда я нажму \"OK\"" + +#: sq_options.cpp:749 +msgid "Minimize to tray after closing" +msgstr "Спрятаться в трей после закрытия" + +#: sq_options.cpp:750 +msgid "Show splash screen at startup" +msgstr "Показать заставку при запуске" + +#: sq_options.cpp:751 +msgid "Don't show animated logo in toolbar" +msgstr "Не показывать анимированное лого на панели инструментов" + +#: sq_options.cpp:752 +msgid "Apply codec settings to" +msgstr "Применить настройки кодеков в" + +#: sq_options.cpp:753 +msgid "Thumbnail loader" +msgstr "Загрузчике эскизов" + +#: sq_options.cpp:754 +msgid "Image viewer (also preview window)" +msgstr "Просмотрщике изображений (также окне предпросмотра)" + +#: sq_options.cpp:755 sq_options.cpp:773 +msgid "Both" +msgstr "И там и там" + +#: sq_options.cpp:756 +msgid "RunTime" +msgstr "Во время выполнения" + +#: sq_options.cpp:757 +msgid "Treat unknown mime types as unsupported" +msgstr "Считать неизвестные типы файлов неподдерживаемыми" + +#: sq_options.cpp:758 +msgid "Load KIPI plugins on demand (for slow machines)" +msgstr "Загружать KIPI плагины по требованию (для слабых машин)" + +#: sq_options.cpp:759 +msgid "Disk navigator" +msgstr "Навигатор по диску" + +#: sq_options.cpp:760 +msgid "On starting open..." +msgstr "При запуске открыть..." + +#: sq_options.cpp:762 +msgid "Custom directory:" +msgstr "Мою папку:" + +#: sq_options.cpp:763 +msgid "Last visited directory" +msgstr "Последнюю папку" + +#: sq_options.cpp:764 +msgid "Current directory, where KSquirrel starts" +msgstr "Текущую папку, где запускается KSquirrel" + +#: sq_options.cpp:765 +msgid "Run unknown file formats separately (with default application)" +msgstr "Открывать неизвестные типы форматов отдельно (приложением по умолчанию)" + +#: sq_options.cpp:767 +msgid "Save history" +msgstr "Сохранить историю" + +#: sq_options.cpp:768 +msgid "Jump into archives" +msgstr "Заходить в архивы" + +#: sq_options.cpp:769 +msgid "Jump to first image" +msgstr "Перейти к первому изображению" + +#: sq_options.cpp:770 +msgid "Don't show directories" +msgstr "Не показывать папки" + +#: sq_options.cpp:771 +msgid "Main" +msgstr "Главные" + +#: sq_options.cpp:772 +msgid "Synchronization" +msgstr "Синхронизация" + +#: sq_options.cpp:774 +msgid "Tree -> Navigator" +msgstr "Дерево -> Навигатор" + +#: sq_options.cpp:775 +msgid "Tree <- Navigator" +msgstr "Дерево <- Навигатор" + +#: sq_options.cpp:776 +msgid "Clicking" +msgstr "Клики" + +#: sq_options.cpp:777 +msgid "Thumbnails" +msgstr "Эскизы" + +#: sq_options.cpp:779 +msgid "Do not write thumbnails on disk" +msgstr "Не записывать эскизы на диск" + +#: sq_options.cpp:780 +msgid "Show tooltips with file information" +msgstr "Показывать подсказки с информацией о файле" + +#: sq_options.cpp:781 +msgid "Margin between thumbnails" +msgstr "Расстояние между эскизами" + +#: sq_options.cpp:782 sq_options.cpp:815 +msgid " pixels" +msgstr " точек" + +#: sq_options.cpp:783 +msgid "Don't show tooltips when the main window is inactive" +msgstr "Не показывать подсказки, когда главное окно неактивно" + +#: sq_options.cpp:784 +msgid "Mark supported image formats with clock icon (slow)" +msgstr "Помечать поддерживаемые форматы изображений иконкой часов (медленно)" + +#: sq_options.cpp:785 +msgid "Maximum cache size (in memory)" +msgstr "Максимальный размер кэша (в памяти)" + +#: sq_options.cpp:786 +msgid " Kb" +msgstr " Kб" + +#: sq_options.cpp:787 +msgid "No cache" +msgstr "Нет кэша" + +#: sq_options.cpp:788 +msgid "On scroll event" +msgstr "По событию скролла" + +#: sq_options.cpp:789 +msgid "Zoom the scene" +msgstr "Масштабировать сцену" + +#: sq_options.cpp:790 +msgid "Load next/previous file" +msgstr "Загрузить следующий/предыдущий файл" + +#: sq_options.cpp:791 +msgid "Background" +msgstr "Фон" + +#: sq_options.cpp:792 +msgid "Custom texture" +msgstr "Моя текстура" + +#: sq_options.cpp:793 +msgid "Custom color" +msgstr "Мой цвет" + +#: sq_options.cpp:794 +msgid "System color" +msgstr "Системный цвет" + +#: sq_options.cpp:798 +msgid "Validate" +msgstr "Проверить" + +#: sq_options.cpp:802 +msgid "Show images progressively" +msgstr "Показывать изображения прогрессивно" + +#: sq_options.cpp:804 +msgid "Image pages" +msgstr "Страницы изображения" + +#: sq_options.cpp:805 +msgid "Load all pages" +msgstr "Загрузить все страницы" + +#: sq_options.cpp:806 +msgid "Load only first page" +msgstr "Загрузить только первую страницу" + +#: sq_options.cpp:807 +msgid "Load no more than" +msgstr "Загрузить не более чем" + +#: sq_options.cpp:808 +msgid " pages" +msgstr " страниц" + +#: sq_options.cpp:809 +msgid "Loader" +msgstr "Загрузчик" + +#: sq_options.cpp:810 +msgid "Draw tickmarks around the image" +msgstr "Рисовать пометки вокруг изображения" + +#: sq_options.cpp:811 +msgid "Draw background for transparent images" +msgstr "Рисовать фон для прозрачных изображений" + +#: sq_options.cpp:812 +msgid "Rotating" +msgstr "Поворот" + +#: sq_options.cpp:813 +msgid " degrees" +msgstr " градусов" + +#: sq_options.cpp:814 sq_helpwidget.cpp:183 +msgid "Moving" +msgstr "Сдвиг" + +#: sq_options.cpp:817 +msgid "Zoom limit" +msgstr "Предел масштабирования" + +#: sq_options.cpp:818 +msgid "Minimum: 1%, maximum: 10,000%" +msgstr "Минимум: 1%, максимум: 10,000%" + +#: sq_options.cpp:819 +msgid "Custom" +msgstr "Мой" + +#: sq_options.cpp:821 +msgid "minimum" +msgstr "минимум" + +#: sq_options.cpp:822 sq_options.cpp:824 +msgid " %" +msgstr " %" + +#: sq_options.cpp:823 +msgid "maximum" +msgstr "максимум" + +#: sq_options.cpp:825 +msgid "No limit" +msgstr "Нет предела" + +#: sq_options.cpp:826 +msgid "Zoom coefficient" +msgstr "Коэффициент масштабирования" + +#: sq_options.cpp:827 +msgid "%" +msgstr "%" + +#: sq_options.cpp:828 +msgid "None" +msgstr "Нет" + +#: sq_options.cpp:830 +msgid "Customize OpenGL widget" +msgstr "Настроить окно OpenGL" + +#: sq_options.cpp:831 +msgid "Recursion" +msgstr "Рекурсия" + +#: sq_options.cpp:832 +msgid "No recursion" +msgstr "Нет рекурсии" + +#: sq_options.cpp:833 +msgid "Show number of files" +msgstr "Показывать количество файлов" + +#: sq_options.cpp:834 +msgid "Show number of subfolders and files" +msgstr "Показывать количество подпапок и файлов" + +#: sq_options.cpp:835 +msgid "Show number of subfolders" +msgstr "Показывать количество подпапок" + +#: sq_options.cpp:836 +msgid "Treeview" +msgstr "Дерево" + +#: sq_options.cpp:837 +msgid "Show device path" +msgstr "Показывать путь к устройству" + +#: sq_options.cpp:838 +msgid "Show mount options" +msgstr "Показывать опции монтирования" + +#: sq_options.cpp:839 +msgid "Show filesystem type" +msgstr "Показывать тип файловой системы" + +#: sq_options.cpp:840 +msgid "Mount view" +msgstr "Просмотр точек монтирования" + +#: sq_options.cpp:841 +msgid "Enable preview window" +msgstr "Разрешить окно предпросмотра" + +#: sq_options.cpp:843 +msgid "Delay before image loading" +msgstr "Задержка перед загрузкой изображения" + +#: sq_options.cpp:844 sq_slideshow.cpp:218 +msgid " ms" +msgstr " мс" + +#: sq_options.cpp:845 +msgid "Background color for preview widget:" +msgstr "Цвет фона для окна предпросмотра" + +#: sq_options.cpp:847 +msgid "Don't load preview image on file execution" +msgstr "Не загружать изображения предпросмотра при выполнении файла" + +#: sq_options.cpp:848 +msgid "Disables loading preview image when user launches image with mouse" +msgstr "Запрещает загружать изображения предпросмотра при выполнении файла с помощью мыши" + +#: sq_options.cpp:849 +msgid "Image preview" +msgstr "Изображение предпросмотра" + +#: sq_options.cpp:850 +msgid "Sidebar settings" +msgstr "Настройки боковой панели" + +#: sq_options.cpp:851 +msgid "KIPI Configuration" +msgstr "Конфигурация KIPI" + +#: sq_slideshow.cpp:205 +msgid "Slideshow options" +msgstr "Настройки слайдов" + +#: sq_slideshow.cpp:206 +msgid "Start" +msgstr "Старт" + +#: sq_slideshow.cpp:209 +msgid "Set directory to current" +msgstr "Установить папку в текущую" + +#: sq_slideshow.cpp:210 +msgid "Last visited directories" +msgstr "Последние посещённые папки" + +#: sq_slideshow.cpp:220 +msgid "Repeats:" +msgstr "Повторы:" + +#: sq_slideshow.cpp:221 +msgid "Background color:" +msgstr "Цвет фона:" + +#: sq_slideshow.cpp:222 +msgid "Onscreen messages" +msgstr "Экранные сообщения" + +#: sq_slideshow.cpp:223 +msgid "Show current index" +msgstr "Показать текущий индекс" + +#: sq_slideshow.cpp:224 +msgid "Show file name" +msgstr "Показать имя файла" + +#: sq_slideshow.cpp:225 +msgid "Show file size" +msgstr "Показать размер файла" + +#: sq_slideshow.cpp:226 +msgid "Recursively" +msgstr "Рекурсивно" + +#: ksquirrel.cpp:288 +msgid "Clear history" +msgstr "Очистить историю" + +#: ksquirrel.cpp:289 +msgid "Clear address" +msgstr "Очистить адрес" + +#: ksquirrel.cpp:294 +msgid "Go!" +msgstr "Понеслась!" + +#: ksquirrel.cpp:341 +msgid "Libraries' filters" +msgstr "Библиотечные фильтры" + +#: ksquirrel.cpp:364 +msgid "All supported formats" +msgstr "Все поддерживаемые форматы" + +#: ksquirrel.cpp:374 +msgid "User's filters" +msgstr "Пользовательские фильтры" + +#: ksquirrel.cpp:510 +msgid "Folder tree" +msgstr "Дерево каталогов" + +#: ksquirrel.cpp:511 +msgid "Mount points" +msgstr "Точки монтирования" + +#: ksquirrel.cpp:628 +msgid "&Navigator" +msgstr "&Навигатор" + +#: ksquirrel.cpp:630 +msgid "&Action" +msgstr "&Действие" + +#: ksquirrel.cpp:633 +msgid "&KIPI Plugins" +msgstr "&KIPI Плагины" + +#: ksquirrel.cpp:661 +msgid "Fi<er" +msgstr "Фи&льтр" + +#: ksquirrel.cpp:720 +msgid "Thumbnail size" +msgstr "Размер эскизов" + +#: ksquirrel.cpp:723 sq_options.ui.h:137 +msgid "Image window" +msgstr "Окно изображения" + +#: ksquirrel.cpp:725 +msgid "Reload codecs from disk" +msgstr "Перезагрузить кодеки с диска" + +#: ksquirrel.cpp:726 +msgid "Configure external tools..." +msgstr "Настроить внешние утилиты..." + +#: ksquirrel.cpp:727 +msgid "Configure filters..." +msgstr "Настроить фильтры..." + +#: ksquirrel.cpp:728 +msgid "Go to tray" +msgstr "Спрятаться в трей" + +#: ksquirrel.cpp:729 +msgid "Open file and change directory" +msgstr "Открыть файл и сменить каталог" + +#: ksquirrel.cpp:730 +msgid "Open file" +msgstr "Открыть файл" + +#: ksquirrel.cpp:731 +msgid "Thumbnail cache manager..." +msgstr "Управление кэшем эскизов" + +#: ksquirrel.cpp:735 +msgid "List" +msgstr "Список" + +#: ksquirrel.cpp:736 +msgid "Icons" +msgstr "Иконки" + +#: ksquirrel.cpp:737 +msgid "Details" +msgstr "Детально" + +#: ksquirrel.cpp:738 sq_options.ui.h:136 +msgid "Thumbnails" +msgstr "Эскизы" + +#: ksquirrel.cpp:740 +msgid "Show URL box" +msgstr "Показать строку адреса" + +#: ksquirrel.cpp:742 +msgid "Built-in image window" +msgstr "Встроенное окно просмотра изображения" + +#: ksquirrel.cpp:745 +msgid "Slideshow" +msgstr "Слайды" + +#: ksquirrel.cpp:746 +msgid "Slideshow advanced" +msgstr "Слайды продвинуто" + +#: ksquirrel.cpp:748 +msgid "Codec information..." +msgstr "Информация о кодеках" + +#: ksquirrel.cpp:749 +msgid "OpenGL information..." +msgstr "Информация об OpenGL" + +#: ksquirrel.cpp:751 +msgid "Medium thumbnails" +msgstr "Средние эскизы" + +#: ksquirrel.cpp:752 +msgid "Large thumbnails" +msgstr "Большие эскизы" + +#: ksquirrel.cpp:753 +msgid "Huge thumbnails" +msgstr "Огромные эскизы" + +#: ksquirrel.cpp:755 +msgid "Select group" +msgstr "Отметить группу" + +#: ksquirrel.cpp:756 +msgid "Deselect group" +msgstr "Снять отметку с группы" + +#: ksquirrel.cpp:776 +msgid "Extended thumbnails" +msgstr "Расширенные эскизы" + +#: ksquirrel.cpp:1085 +msgid " writing settings and thumbnails... " +msgstr "запись настроек и эскизов..." + +#: sq_filters.cpp:124 sq_filters.cpp:197 +msgid "Extensions" +msgstr "Расширения" + +#: sq_filters.cpp:181 +msgid "Adjust filters" +msgstr "Настроить фильтры" + +#: sq_filters.cpp:186 +msgid "New filter" +msgstr "Новый фильтр" + +#: sq_filters.cpp:193 +msgid "Move filter up" +msgstr "Переместить фильтр вверх" + +#: sq_filters.cpp:195 +msgid "Move filter down" +msgstr "Переместить фильтр вниз" + +#: sq_filters.cpp:198 +msgid "Menu item contains both name and extension" +msgstr "Элемент меню содержит и имя и расширение" + +#: sq_helpwidget.cpp:175 +msgid "" +"

    Файл:%1
    Размер:%2
    Link destination:%1
    Назначение ссылки:%1
    " +"" +"" +"" +"" +"" +"

    Esc,X,Return

    close

    Middle click, F

    fullscreen

    Z

    show 'Zoom' menu

    /

    show this help

    Right click, M, " +"ContextMenu

    show context menu

    N

    toggle filter

    Shift + Left button

    select a region

    Shift + Left

    previous tab

    Shift + Right

    next tab

    W

    close tab

    " +msgstr "" +"

    " +"" +"" +"" +"" +"

    Esc,X,Ввод

    закрыть

    Средний клик, F

    полный экран

    Z

    показать меню масштибирования

    /

    показать эту помощь

    Правый клик, M, " +"ContextMenu

    показать контекстное меню

    N

    сменить фильтр

    Shift + Левая кнопка

    выбрать регион

    Shift + Влево

    предыдущая вкладка

    Shift + Вправо

    следующая вкладка

    W

    закрыть вкладку

    " + +#: sq_helpwidget.cpp:176 +msgid "" +"

    Space, Page Down

    next image

    Backspace, Page Up

    previous image

    Home

    first image

    End

    last image

    " +msgstr "" +"

    Пробел, Page Down

    следующее изображение

    Backspace, Page Up

    предыдущее изображение

    Home

    первое изображение

    End

    последнее изображение

    " + +#: sq_helpwidget.cpp:177 +msgid "" +"

    " +msgstr "" +"

    Left, Right," +" Up, Down

    move the image

    Ctrl + Left

    rotate left

    Ctrl + Right

    rotate " +"right

    Ctrl + Up/Down

    rotate for 180 degrees up/down

    Alt + Left/Right

    rotate for 1 degree " +"left/right
    " + +#: sq_helpwidget.cpp:178 +msgid "" +"

    Вверх, Вниз, Влево, Вправо

    сдвинуть изображение

    Ctrl + Влево

    повернуть влево

    Ctrl + Вправо

    повернуть вправо

    Ctrl + Вверх/Вниз

    повернуть на 180' вверх/вниз

    Alt + Влево/Вправо

    повернуть на 1' влево/вправо
    " +msgstr "" +"

    +/-

    zoom " +"Nx

    Ctrl + +/-

    zoom " +"2x/0.5x

    Scroll

    load next/" +"prev file OR zoom+/zoom-

    Shift + Scroll

    zoom+/zoom-

    Ctrl + Scroll

    zoom+ 2x/zoom- 2x

    1..9

    zoom 1..9x

    0

    zoom 10x

    comma

    fit " +"width

    period

    fit height

    *

    fit image
    " + +#: sq_helpwidget.cpp:179 +msgid "" +"

    +/-

    масштабировать " +"Nx

    Ctrl + +/-

    масштабировать " +"2x/0.5x

    Scroll

    загрузить след./предыдущ. файл ИЛИ увеличить/уменьшить

    Shift + Scroll

    увеличить/уменьшить

    Ctrl + Scroll

    увеличить 2x/уменшить 2x

    1..9

    увеличить 1..9x

    0

    увеличить 10x

    запятая

    заполнить ширину

    точка

    заполнить высоту

    *

    заполнить изображение
    " +"

    S

    save as

    V

    flip vertically

    H

    flip horizontally

    R

    reset

    P

    image properties

    C

    codec settings

    L

    ignore zoom if image is smaller than " +"window

    I

    menu with " +"images

    A

    stop/start " +"animation

    B

    toggle " +"drawing background for transparent images

    K

    toggle drawing tickmarks

    E

    show menu with external " +"tools

    Y

    crop

    F1

    first image in " +"multi-paged image

    F2

    previous

    F3

    next

    F4

    last
    " +msgstr "" +"

    " +"" +"

    S

    сохранить как

    V

    отразить вертикально

    H

    отразить горизонтально

    R

    нормализовать

    P

    свойства изображения

    C

    настройки кодека

    L

    игнорировать масштаб, если изображение меньше окна

    I

    меню с изображениями

    A

    старт/стоп анимации

    B

    переключить рисование фона для прозрачных изображений

    K

    переключить рисование пометок

    E

    показать меню с внешними утилитами

    Y

    обрезать

    F1

    первое изображение в последовательности

    F2

    предыдущее

    F3

    следующее

    F4

    последнее
    " + +#: sq_helpwidget.cpp:182 sq_options.ui.h:135 +msgid "Filing" +msgstr "Файлы" + +#: sq_helpwidget.cpp:184 +msgid "Current image" +msgstr "Текущее изображение" + +#: sq_options.ui.h:138 +msgid "Sidebar" +msgstr "Боковая панель" + +#: sq_options.ui.h:141 +msgid "KIPI" +msgstr "KIPI" + +#: sq_options.ui.h:260 +msgid "Wrong dimensions: %1x%2." +msgstr "Неправильные размеры: %1x%2." + +#: sq_slideshowlisting.cpp:87 +msgid "Listing" +msgstr "Просмотр" + +msgid "" +"_n: 1 item\n" +"%n items" +msgstr "" +"%n элементе\n" +"%n элементах\n" +"%n элементах" + +msgid "" +"_n: 1 folder\n" +"%n folders" +msgstr "" +"%n каталог\n" +"%n каталога\n" +"%n каталогов" + +msgid "" +"_n: 1 file\n" +"%n files" +msgstr "" +"%n файл\n" +"%n файла\n" +"%n файлов" + +msgid "" +"_n: Convert 1 file\n" +"Convert %n files" +msgstr "" +"Преобразовать %n файл\n" +"Преобразовать %n файла\n" +"Преобразовать %n файлов" + +#: ksquirrel.cpp:751 +msgid "Rename" +msgstr "Переименовать" + +#: ksquirrel.cpp:1951 +msgid "Renaming File" +msgstr "Переименовать Файл" + +#: ksquirrel.cpp:1952 +msgid "

    Rename file %1 to:

    " +msgstr "

    Переименовать Файл %1 в:

    " + +msgid "" +"_n: 1 error\n" +"%n errors" +msgstr "" +"%n ошибка\n" +"%n ошибки\n" +"%n ошибок" + +msgid "Calculate directory size" +msgstr "Подсчитать размер папки" + +msgid "New folder..." +msgstr "Новая папка..." + +msgid "Create Subfolder" +msgstr "Создать Подпапку" + +msgid "

    Create new folder in %1:

    " +msgstr "

    Создать новую папку в %1:

    " + +msgid "Rename Folder" +msgstr "Переименовать Папку" + +msgid "

    Rename folder %1 to:

    " +msgstr "

    Переименовать папку %1 в:

    " + +msgid "Are you sure you want to delete %1?" +msgstr "Вы точно хотите удалить %1?" + +msgid "Copy to last folder" +msgstr "Копировать в последнюю папку" + +msgid "Move to last folder" +msgstr "Переместить в последнюю папку" + +msgid "Message text color:" +msgstr "Цвет текста сообщений:" + +msgid "Total" +msgstr "Всего" + +msgid "Visualize drag operation" +msgstr "Визуализировать операцию перетаскивания" + +msgid "Testing" +msgstr "Тестирование" + +msgid "Lazy thumbnail generation" +msgstr "Ленивая генерация эскизов" + +msgid "Delay" +msgstr "Задержка" + +msgid "Interface" +msgstr "Внешний вид" + +msgid "Number of text lines" +msgstr "Количество строк текста" + +msgid "Show file preview" +msgstr "Показывать предпросмотр файла" + +msgid "Number of additionally generated rows" +msgstr "Количество дополнительно генерируемых рядов" + +msgid "Repeat (copy to %1)" +msgstr "Повторить (копировать в %1)" + +msgid "Repeat (move to %1)" +msgstr "Повторить (переместить в %1)" + +msgid "Repeat (link to %1)" +msgstr "Повторить (ссылку в %1)" + +msgid "Repeat (nothing to repeat)" +msgstr "Повторить (нечего повторять)" + +msgid "Clear contents" +msgstr "Очистить содержимое" + +msgid "Are you sure you want to delete contents of %1?" +msgstr "Вы точно хотите удалить содержимое %1?" + +msgid "Add to Folder Basket" +msgstr "Добавить в Корзину Папок" + +msgid "Folder basket" +msgstr "Корзина папок" + +msgid "Change icon" +msgstr "Сменить иконку" + +msgid "

    Rename item %1 to:

    " +msgstr "

    Переименовать элемент %1 в:

    " + +msgid "Copy file path" +msgstr "Копировать путь файла" + +msgid "Copy file url" +msgstr "Копировать адрес файла" + +msgid "Text color:" +msgstr "Цвет текста:" + +msgid "Show image dimensions" +msgstr "Показать размеры изображения" + +msgid "Text color..." +msgstr "Цвет текста..." + +msgid "Double click" +msgstr "Двойной клик" + +msgid "Close window" +msgstr "Закрыть окно" + +msgid "Crop" +msgstr "Обрезать" + +msgid "Tabs" +msgstr "Вкладки" + +msgid "Enable tabs" +msgstr "Разрешить вкладки" + +msgid "Ask what to do when opening new image" +msgstr "Спрашивать что делать, когда открывается новый файл" + +msgid "Show close buttons" +msgstr "Показывать кнопки закрытия" + +msgid "Open in a new tab" +msgstr "Открыть в новой вкладке" + +msgid "Replace current tab" +msgstr "Заменить текущую вкладку" + +msgid "Close all and open in a new tab" +msgstr "Закрыть всё и открыть в новой вкладке" + +msgid "Opening..." +msgstr "Открытие..." + +msgid "Previous tab" +msgstr "Предыдущая вкладка" + +msgid "Next tab" +msgstr "Следующая вкладка" + +msgid "Close tab" +msgstr "Закрыть вкладку" + +msgid "Do nothing" +msgstr "Не делать ничего" + +msgid "Print available DCOP parameters" +msgstr "Напечатать доступные параметры DCOP" + +msgid "Downloading..." +msgstr "Загрузка..." + +msgid "Close all tabs" +msgstr "Закрыть все вкладки" + +msgid "Close all opened images when closing window" +msgstr "Закрывать все открытые изображения, когда закрывается окно" + +msgid "Codec manager..." +msgstr "Менеджер кодеков..." + +msgid "Select codecs to disable:" +msgstr "Выберите кодеки для запрещения:" + +msgid "Select codecs to enable:" +msgstr "Выберите кодеки для разрешения:" diff --git a/po/tr.po b/po/tr.po new file mode 100644 index 0000000..f4f0e30 --- /dev/null +++ b/po/tr.po @@ -0,0 +1,2182 @@ +# translation of ksquirrel.po to +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# +# Serdar Soytetir , 2007. +msgid "" +msgstr "" +"Project-Id-Version: ksquirrel\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2007-08-07 09:34+0300\n" +"PO-Revision-Date: 2007-11-04 16:35+0200\n" +"Last-Translator: Serdar Soytetir \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: KBabel 1.11.4\n" + +#: sq_filters.ui.h:56 sq_filters.ui.h:58 sq_externaltools.cpp:67 +#: sq_externaltools.cpp:194 sidebar/sq_mountview.cpp:64 sq_viewcache.cpp:47 +#: sq_viewcache.cpp:105 sq_filters.cpp:123 sq_filters.cpp:196 +msgid "Name" +msgstr "İsim" + +#: sq_externaltool.cpp:102 sq_externaltool.cpp:162 sq_externaltool.cpp:170 +msgid "No file selected" +msgstr "Dosya seçilmedi" + +#: sq_kipimanager.cpp:68 +msgid "No Plugins" +msgstr "Eklenti Yok" + +#: sq_kipimanager.cpp:125 +msgid "Image actions" +msgstr "Resim Eylemleri" + +#: sq_kipimanager.cpp:126 +msgid "Effects" +msgstr "Efektler" + +#: sq_kipimanager.cpp:127 +msgid "Tools" +msgstr "Araçlar" + +#: sq_kipimanager.cpp:130 +msgid "Batch processing" +msgstr "Eşleme işlemi" + +#: sq_kipimanager.cpp:131 +msgid "Collections" +msgstr "Koleksiyonlar" + +#: sq_libraryhandler.cpp:148 +msgid "All files" +msgstr "Tüm dosyalar" + +#: sq_navigatordropmenu.cpp:40 +msgid "Copy here" +msgstr "Buraya kopyala" + +#: sq_navigatordropmenu.cpp:43 +msgid "Move here" +msgstr "Buraya taşı" + +#: sq_navigatordropmenu.cpp:46 +msgid "Link here" +msgstr "Buraya bağ koy" + +#: sq_glinfo.cpp:45 sq_glinfo.cpp:92 +msgid "Parameter" +msgstr "Parametre" + +#: sq_glinfo.cpp:46 sq_glinfo.cpp:93 sq_imageproperties.cpp:321 +#: sq_imageproperties.cpp:408 imageedit/sq_imagefilter.cpp:487 +msgid "Value" +msgstr "Değer" + +#: sq_glinfo.cpp:91 +msgid "OpenGL information" +msgstr "OpenGL bilgisi" + +#: sq_externaltools.cpp:66 sq_externaltools.cpp:193 +msgid "Pixmap" +msgstr "Pixmap" + +#: sq_externaltools.cpp:68 sq_externaltools.cpp:195 +msgid "Command" +msgstr "Komut" + +#: sq_externaltools.cpp:190 +msgid "Adjust external tools" +msgstr "Dış araçları ayarla" + +#: sq_externaltools.cpp:192 sq_filters.cpp:182 +msgid "OK" +msgstr "TAMAM" + +#: sq_externaltools.cpp:196 sq_externaltools.ui.h:146 +#, c-format +msgid "Command can contain
    • %f: one file
    • %F: multiple files
    " +msgstr "Komut şöyle olabilir
    • %f: bir dosya
    • %F: çok sayıda dosya
    " + +#: sq_externaltools.cpp:199 +msgid "New tool" +msgstr "Yeni araç" + +#: sq_externaltools.cpp:206 +msgid "Move tool up" +msgstr "Aracı yukarı taşı" + +#: sq_externaltools.cpp:208 +msgid "Move tool down" +msgstr "Aracı aşağı taşı" + +#: sq_kipiinterface.cpp:72 +msgid "Root directory" +msgstr "Kök dizin" + +#: sq_kipiinterface.cpp:144 +msgid "Folder content" +msgstr "Dizin içeriği" + +#: sq_kipiinterface.cpp:161 +msgid "Selected images" +msgstr "Seçilen resimler" + +#: sq_kipiinterface.cpp:175 ksquirrel.cpp:513 +msgid "Image basket" +msgstr "Resim sepeti" + +#: main.cpp:40 +msgid "File to be opened at startup." +msgstr "Başlangıçta açılacak resim." + +#: main.cpp:41 +msgid "Print found libraries and exit." +msgstr "Bulunan kütüphaneleri yazdır ve çık." + +#: main.cpp:57 +msgid "KSquirrel - image viewer for KDE" +msgstr "KSquirrel - KDE için resim gösterici" + +#: main.cpp:66 +msgid "Bug reports, patches" +msgstr "Hata raporları, yamalar" + +#: main.cpp:67 +msgid "Bug reports" +msgstr "Hata raporları" + +#: main.cpp:68 +msgid "Translation help" +msgstr "Çeviri yardımı" + +#: main.cpp:69 +msgid "TiamaT" +msgstr "TiamaT" + +#: main.cpp:69 +msgid "Initial artwork for edit tools" +msgstr "Düzenleme araçları için sanatsal çalışmalar" + +#: main.cpp:70 +msgid "Fera" +msgstr "Fera" + +#: main.cpp:70 +msgid "Great artwork for edit tools" +msgstr "Düzenleme araçları için mükemmel sanatsal çalışmalar" + +#: main.cpp:71 +msgid "OpenGL forum at" +msgstr "OpenGL forumu" + +#: main.cpp:72 +msgid "GameDev forum at" +msgstr "GameDev forumu" + +#: sq_imageproperties.cpp:320 sq_imageproperties.cpp:407 +msgid "Group" +msgstr "Grup" + +#: sq_imageproperties.cpp:359 sq_glwidget.cpp:350 +msgid "Image properties" +msgstr "Resim özellikleri" + +#: sq_imageproperties.cpp:361 +msgid "Attributes" +msgstr "Nitelikler" + +#: sq_imageproperties.cpp:362 +msgid "Owner:" +msgstr "Sahibi:" + +#: sq_imageproperties.cpp:363 +msgid "Group:" +msgstr "Grubu:" + +#: sq_imageproperties.cpp:365 +msgid "Permissions:" +msgstr "İzinler:" + +#: sq_imageproperties.cpp:368 +msgid "Time" +msgstr "Zaman" + +#: sq_imageproperties.cpp:369 +msgid "Created:" +msgstr "Oluşturulma zamanı:" + +#: sq_imageproperties.cpp:370 +msgid "Last read:" +msgstr "Son okunma zamanı:" + +#: sq_imageproperties.cpp:371 +msgid "Last modified:" +msgstr "Son düzenlenme zamanı:" + +#: sq_imageproperties.cpp:375 sq_helpwidget.cpp:181 sq_options.ui.h:134 +msgid "General" +msgstr "Genel" + +#: sq_imageproperties.cpp:376 +msgid "File:" +msgstr "Dosya:" + +#: sq_imageproperties.cpp:378 sq_pluginsinfo.cpp:137 sq_slideshow.cpp:211 +msgid "Directory:" +msgstr "Dizin:" + +#: sq_imageproperties.cpp:379 +msgid "Size:" +msgstr "Boyut:" + +#: sq_imageproperties.cpp:381 +msgid "Type:" +msgstr "Tip:" + +#: sq_imageproperties.cpp:382 +msgid "Number of frames:" +msgstr "Çerçeve sayısı:" + +#: sq_imageproperties.cpp:383 +msgid "Current frame" +msgstr "Geçerli çerçeve" + +#: sq_imageproperties.cpp:384 sq_slideshow.cpp:219 +msgid "Delay:" +msgstr "Gecikme:" + +#: sq_imageproperties.cpp:385 +msgid "Dimensions:" +msgstr "Boyutlar:" + +#: sq_imageproperties.cpp:386 +msgid "Bits per pixel:" +msgstr "Her nokta için bit:" + +#: sq_imageproperties.cpp:387 +msgid "Color space:" +msgstr "Renk düzlemi:" + +#: sq_imageproperties.cpp:388 +msgid "Compression:" +msgstr "Sıkıştırma:" + +#: sq_imageproperties.cpp:389 +msgid "Uncompressed size:" +msgstr "Açılmış boyut:" + +#: sq_imageproperties.cpp:390 +msgid "Compression ratio:" +msgstr "Sıkıştırma oranı:" + +#: sq_imageproperties.cpp:391 +msgid "Interlaced:" +msgstr "Karıştırılmış:" + +#: sq_imageproperties.cpp:392 +msgid "Status:" +msgstr "Durum:" + +#: sq_imageproperties.cpp:406 sq_glwidget.cpp:2662 sq_options.cpp:816 +msgid "Image" +msgstr "Resim" + +#: sq_imageproperties.cpp:409 +msgid "Metadata" +msgstr "Meta verisi" + +#: sq_pluginsinfo.cpp:55 sq_pluginsinfo.cpp:129 +msgid "..." +msgstr "..." + +#: sq_pluginsinfo.cpp:56 sq_pluginsinfo.cpp:130 +msgid "Icon" +msgstr "Simge" + +#: sq_pluginsinfo.cpp:57 sq_pluginsinfo.cpp:131 +msgid "Library" +msgstr "Kütüphane" + +#: sq_pluginsinfo.cpp:58 sq_pluginsinfo.cpp:132 +msgid "Version" +msgstr "Sürüm" + +#: sq_pluginsinfo.cpp:59 sq_pluginsinfo.cpp:133 sq_viewcache.cpp:48 +#: sq_viewcache.cpp:106 +msgid "MIME" +msgstr "MIME" + +#: sq_pluginsinfo.cpp:128 +msgid "Codec information and settings" +msgstr "Kodlayıcı bilgileri ve ayarları" + +#: sq_pluginsinfo.cpp:138 +msgid "Total found:" +msgstr "Toplam bulunan:" + +#: sq_errorstring.cpp:34 +msgid "cannot open file for reading" +msgstr "dosya okumak için açılamıyor" + +#: sq_errorstring.cpp:35 +msgid "file corrupted" +msgstr "bozuk dosya" + +#: sq_errorstring.cpp:36 +msgid "no memory" +msgstr "bellek yok" + +#: sq_errorstring.cpp:37 +msgid "file type not supported" +msgstr "dosya tipi desteklenmiyor" + +#: sq_errorstring.cpp:38 +msgid "wrong image dimensions" +msgstr "Yanlış resim boyutu" + +#: sq_errorstring.cpp:39 +msgid "cannot open file for writing" +msgstr "dosya yazılmak için açılamıyor" + +#: sq_errorstring.cpp:40 +msgid "write feature is not supported" +msgstr "yazma özelliği desteklenmiyor" + +#: sq_errorstring.cpp:41 +msgid "write error (check free space)" +msgstr "yazma hatası" + +#: sq_errorstring.cpp:42 +msgid "wrong parameters" +msgstr "yanlış parametre" + +#: sq_errorstring.cpp:43 +msgid "Editing process is not finished yet" +msgstr "Düzenleme süreci henüz tamamlanmadı" + +#: sq_selectdeselectgroup.cpp:83 +msgid "Filename or mask:" +msgstr "Dosya adı ya da maskesi:" + +#: sidebar/sq_treeview.cpp:89 +msgid "root" +msgstr "kök" + +#: sidebar/sq_categoriesview.cpp:95 ksquirrel.cpp:512 +msgid "Categories" +msgstr "Kategoriler" + +#: sidebar/sq_categoriesview.cpp:115 sidebar/sq_categoriesview.cpp:166 +msgid "New category" +msgstr "Yeni kategori" + +#: sidebar/sq_categoriesview.cpp:153 sidebar/sq_categoriesview.cpp:218 +msgid "New Category" +msgstr "Yeni Kategori" + +#: sidebar/sq_categoriesview.cpp:169 sidebar/sq_categoriesview.cpp:198 +msgid "Create default categories" +msgstr "Öntanımlı kategorileri oluştur" + +#: sidebar/sq_categoriesview.cpp:197 +msgid "" +"This will create default categories: Concerts, Pets, Home, Friends, Free time, " +"Travelling and Nature. Continue?" +msgstr "" +"Bu öntanımlı kategorileri oluşturur: Konserler, Hayvanlar, Ev, Arkadaşlar, Boş zaman, " +"Seyahat, Doğa. Devam edilsin mi?" + +#: sidebar/sq_categoriesview.cpp:218 +msgid "Create new category:" +msgstr "Yeni kategori oluştur:" + +#: sidebar/sq_mountview.cpp:43 +msgid "Mount" +msgstr "Bağla" + +#: sidebar/sq_mountview.cpp:45 +msgid "Unmount" +msgstr "Ayır" + +#: sidebar/sq_mountview.cpp:47 +msgid "Refresh" +msgstr "Yenile" + +#: sidebar/sq_mountview.cpp:170 +msgid "Device" +msgstr "Aygıt" + +#: sidebar/sq_mountview.cpp:173 +msgid "FS Type" +msgstr "Dosya Sistemi Tipi" + +#: sidebar/sq_imagebasket.cpp:244 +msgid "Synchronize" +msgstr "Eşzamanla" + +#: sidebar/sq_previewwidget.cpp:60 +msgid "Background color..." +msgstr "Arkaplan rengi..." + +#: sidebar/sq_categorybrowsermenu.cpp:137 +#: sidebar/sq_categorybrowsermenu.cpp:146 +msgid "Failed to Read Folder" +msgstr "Dizin Okunamadı" + +#: sidebar/sq_categorybrowsermenu.cpp:154 +msgid "Not Authorized to Read Folder" +msgstr "Dizini Okuma Yetkisi Yok" + +#: sidebar/sq_categorybrowsermenu.cpp:167 +msgid "Add here" +msgstr "Buraya ekle" + +#: sidebar/sq_categorybrowsermenu.cpp:310 +msgid "More..." +msgstr "Daha fazla..." + +#: sq_thumbnailcachemaster.cpp:143 +msgid "Thumbnail cache" +msgstr "Önizleme önbelleği" + +#: sq_thumbnailcachemaster.cpp:144 +msgid "Calculate cache size on disk" +msgstr "Diskteki önbelleği hesapla" + +#: sq_thumbnailcachemaster.cpp:146 +msgid "Clear cache on disk" +msgstr "Diskteki önbelleği temizle" + +#: sq_thumbnailcachemaster.cpp:147 +msgid "View memory cache" +msgstr "Bellek önbelleğini göster" + +#: sq_thumbnailcachemaster.cpp:148 +msgid "Clear cache in memory" +msgstr "Bellekteki önbelleği temizle" + +#: sq_thumbnailcachemaster.cpp:150 +msgid "Sync cache to disk" +msgstr "Önbelleği disk ile eşzamanla" + +#: sq_thumbnailcachemaster.cpp:151 +msgid "Calculate cache size in memory" +msgstr "Bellekteki önbelleği hesapla" + +#: sq_diroperator.cpp:138 +msgid "remote filesystem" +msgstr "yerel olmayan dosya sistemi" + +#: sq_diroperator.cpp:158 +msgid "" +"
    Mount point:%1
    Total size:%" +"2
    Used:%3
    Available:%4
    " +msgstr "" +"
    Bağlantı noktası:%1
    Toplam boyut:%" +"2
    Kullanılan:%3
    Kullanılabilir:%4
    " + +#: sq_diroperator.cpp:245 +msgid "no files selected" +msgstr "dosya seçilmedi" + +#: sq_diroperator.cpp:306 +msgid "Edit file type" +msgstr "Dosya tipini düzenle" + +#: sq_diroperator.cpp:307 +msgid "Add to Basket" +msgstr "Sepete Ekle" + +#: sq_diroperator.cpp:309 sq_diroperator.cpp:889 +msgid "File actions" +msgstr "Dosya eylemleri" + +#: sq_diroperator.cpp:327 +msgid "Copy to..." +msgstr "Buraya kopyala..." + +#: sq_diroperator.cpp:328 +msgid "Move to..." +msgstr "Buraya taşı..." + +#: sq_diroperator.cpp:329 +msgid "Link to..." +msgstr "Buraya bağ koy..." + +#: sq_diroperator.cpp:331 +msgid "Run" +msgstr "Çalıştır" + +#: sq_diroperator.cpp:333 +msgid "Recreate selected thumbnails" +msgstr "Seçilen önizlemeleri yeniden oluştur" + +#: sq_diroperator.cpp:336 +msgid "Convert..." +msgstr "Dönüştür..." + +#: sq_diroperator.cpp:439 +msgid "Total %1 in %2 (%3, %4)" +msgstr "Toplam %1 burada %2 (%3, %4)" + +#: sq_diroperator.cpp:441 +msgid "1 item" +msgstr "1 öge" + +#: sq_diroperator.cpp:442 +msgid "1 folder" +msgstr "1 dizin" + +#: sq_diroperator.cpp:443 +msgid "1 file" +msgstr "1 dosya" + +#: sq_diroperator.cpp:627 +#, c-format +msgid "Command cannot contain both \"%f\" and \"%F\"" +msgstr "Komut bunların ikisini de içeremez \"%f\" ve \"%F\"" + +#: sq_diroperator.cpp:627 sq_diroperator.cpp:632 +msgid "Error processing command" +msgstr "Komut uygulanırken hata oluştu" + +#: sq_diroperator.cpp:632 +#, c-format +msgid "Command should contain \"%f\" or \"%F\"" +msgstr "Komut bunların birisini içermelidir \"%f\" ya da \"%F\"" + +#: sq_diroperator.cpp:741 +msgid "Unsupported format \"%1\"" +msgstr "Desteklenmeyen biçim \"%1\"" + +#: sq_diroperator.cpp:886 +msgid "Add to &Category" +msgstr "Kategoriye &Ekle" + +#: sq_diroperator.cpp:890 +msgid "&External tools" +msgstr "&Dış araçlar" + +#: sq_slideshowwidget.cpp:345 +msgid "" +"
    Enter, Escape, Returnstop " +"slideshow
    Pause, Spacepause/unpause " +"slideshow
    Page Upprevious image
    Page Downnext image
    Mshow/hide onscreen messages
    " +msgstr "" +"
    Enter, Esc, Returnslayt gösterisini " +"durdur
    Pause, Spaceslayt gösterisini " +"duraklat/devam ettir
    Page Upönceki resim
    Page Downsonraki resim
    Mekran iletilerini göster/gizle
    " + +#: sq_codecsettingsskeleton.ui.h:28 +msgid "" +"Error loading widget from %1. Please check your installation or " +"contact ksquirrel.iv@gmail.com" +msgstr "" +"%1 konumundan parçacık yüklenirken hata oluştu. Lütfen kurulumunuzu kontrol edin " +"ya da ksquirrel.iv@gmail.com adresine bildirin" + +#: sq_widgetstack.cpp:473 sq_widgetstack.cpp:507 +msgid "No files to copy or move" +msgstr "Kopyalanacak ya da taşınacak dosya yok" + +#: sq_widgetstack.cpp:607 +msgid "Select a group of files" +msgstr "Bir grup dosya seç" + +#: sq_widgetstack.cpp:607 +msgid "Deselect a group of files" +msgstr "Bir grup dosyanın seçimini bırak" + +#: sq_widgetstack.cpp:608 +msgid "Select!" +msgstr "Seç!" + +#: sq_widgetstack.cpp:608 +msgid "Deselect!" +msgstr "Seçimi Bırak!" + +#: sq_filethumbview.cpp:370 +msgid "" +"%3%4" +msgstr "" +"
    File:%1
    Size:%2
    %3%4" + +#: sq_filethumbview.cpp:373 +msgid "" +msgstr "" + +#: imageedit/sq_writeoption.cpp:108 +msgid "RLE compression" +msgstr "RLE sıkıştırması" + +#: imageedit/sq_writeoption.cpp:109 +msgid "Compression level" +msgstr "Sıkıştırma düzeyi" + +#: imageedit/sq_writeoption.cpp:110 +msgid "Interlaced" +msgstr "Karıştırılmış" + +#: imageedit/sq_writeoption.cpp:112 +msgid "No special options available for this format" +msgstr "Bu biçim için özel seçenek yok" + +#: imageedit/sq_converter.cpp:47 +msgid "internal error" +msgstr "iç hata" + +#: imageedit/sq_converter.cpp:48 +msgid "failed" +msgstr "başarısız" + +#: imageedit/sq_converter.cpp:50 +msgid "Converting" +msgstr "Dönüştürülüyor" + +#: imageedit/sq_converter.cpp:68 +msgid "Select files to edit" +msgstr "Düzenlemek için dosya seç" + +#: imageedit/sq_converter.cpp:73 +msgid "" +"Converter cannot work with remote files.\n" +"Sorry" +msgstr "" +"Dönüştürücü yerel olmayan bu dosyalarla çalışmaz.\n" +"Üzgünüm" + +#: imageedit/sq_converter.cpp:160 +msgid "Temporary file creation failed" +msgstr "Geçici dosya oluşturma hatası" + +#: imageedit/sq_converter.cpp:243 sq_imageproperties.ui.h:72 +msgid "1 error" +msgstr "1 hata" + +#: imageedit/sq_converter.cpp:250 +msgid "Removing" +msgstr "Kaldırılıyor" + +#: imageedit/sq_converter.cpp:436 +msgid "Convert 1 file" +msgstr "1 dosya dönüştür" + +#: imageedit/sq_imageeditoptions.cpp:134 +msgid "Edit options" +msgstr "Seçenekleri düzenle" + +#: imageedit/sq_imageeditoptions.cpp:135 +msgid "New files" +msgstr "Yeni dosyalar" + +#: imageedit/sq_imageeditoptions.cpp:136 +msgid "Place here" +msgstr "Buraya koy" + +#: imageedit/sq_imageeditoptions.cpp:137 +msgid "Replace original files" +msgstr "Dosyanın aslını kaldır" + +#: imageedit/sq_imageeditoptions.cpp:138 +msgid "Place files in current directory, renaming them if necessary" +msgstr "Dosyaları geçerli dizine yerleştir, eğer gerekli ise yeniden adlandır" + +#: imageedit/sq_imageeditoptions.cpp:139 +msgid "Place files in current directory, replacing existing files" +msgstr "Dosyaları geçerli dizine yerleştir, varolan dosyaların üzerine yaz" + +#: imageedit/sq_imageeditoptions.cpp:140 +msgid "Close, when all operations succeeded" +msgstr "Tüm işlemler tamamlanınca kapat" + +#: imageedit/sq_imagebcg.ui.h:17 imageedit/sq_imagebcg.ui.h:31 +#: imageedit/sq_imagebcg.cpp:382 +msgid "Brightness" +msgstr "Parlaklık" + +#: imageedit/sq_imagebcg.ui.h:18 imageedit/sq_imagebcg.ui.h:31 +#: imageedit/sq_imagebcg.cpp:383 +msgid "Contrast" +msgstr "Karşıtlık" + +#: imageedit/sq_imagebcg.ui.h:19 imageedit/sq_imagebcg.ui.h:31 +#: imageedit/sq_imagebcg.cpp:384 +msgid "Gamma" +msgstr "Gamma" + +#: imageedit/sq_imagebcg.ui.h:20 imageedit/sq_imagebcg.ui.h:32 +#: imageedit/sq_imagebcg.cpp:390 +msgid "Red" +msgstr "Kırmızı" + +#: imageedit/sq_imagebcg.ui.h:20 +msgid "Cyan" +msgstr "Cyan" + +#: imageedit/sq_imagebcg.ui.h:21 imageedit/sq_imagebcg.ui.h:32 +#: imageedit/sq_imagebcg.cpp:389 +msgid "Green" +msgstr "Yeşil" + +#: imageedit/sq_imagebcg.ui.h:21 +msgid "Magenta" +msgstr "Magenta" + +#: imageedit/sq_imagebcg.ui.h:22 imageedit/sq_imagebcg.ui.h:32 +#: imageedit/sq_imagebcg.cpp:388 +msgid "Blue" +msgstr "Mavi" + +#: imageedit/sq_imagebcg.ui.h:22 +msgid "Yellow" +msgstr "Sarı" + +#: imageedit/sq_imagefilter.cpp:473 imageedit/sq_imagefilter.cpp:539 +msgid "Filter" +msgstr "Filtre" + +#: imageedit/sq_imagefilter.cpp:474 imageedit/sq_imagefilter.cpp:486 +msgid "Color:" +msgstr "Renk:" + +#: imageedit/sq_imagefilter.cpp:476 +msgid "Opacity" +msgstr "Matlık" + +#: imageedit/sq_imagefilter.cpp:477 imageedit/sq_imagefilter.cpp:482 +#: imageedit/sq_imagefilter.cpp:505 +msgid "Sigma" +msgstr "Sigma" + +#: imageedit/sq_imagefilter.cpp:478 imageedit/sq_imagefilter.cpp:481 +#: imageedit/sq_imagefilter.cpp:483 imageedit/sq_imagefilter.cpp:501 +#: imageedit/sq_imagefilter.cpp:506 +msgid "Radius" +msgstr "Yarıçap" + +#: imageedit/sq_imagefilter.cpp:479 imageedit/sq_imagefilter.cpp:492 +#: imageedit/sq_imagefilter.cpp:507 +msgid "Factor" +msgstr "Çarpan" + +#: imageedit/sq_imagefilter.cpp:480 imageedit/sq_imagefilter.cpp:484 +#: imageedit/sq_imagefilter.cpp:493 imageedit/sq_imagefilter.cpp:514 +msgid "" +"There are no special options available for this filter. Just click \"Filter" +"\"." +msgstr "Bu filtre için özel seçenek yok. Sadece \"Filtre\" ögesine tıklayın." + +#: imageedit/sq_imagefilter.cpp:490 +msgid "Color 1:" +msgstr "Renk 1:" + +#: imageedit/sq_imagefilter.cpp:491 +msgid "Color 2:" +msgstr "Renk 2:" + +#: imageedit/sq_imagefilter.cpp:494 +msgid "Noise type" +msgstr "Gürültü tipi" + +#: imageedit/sq_imagefilter.cpp:495 +msgid "Uniform" +msgstr "Tektip" + +#: imageedit/sq_imagefilter.cpp:496 +msgid "Impulse" +msgstr "İtme" + +#: imageedit/sq_imagefilter.cpp:497 +msgid "Multiplicative Gaussian" +msgstr "Multiplicative Gaussian" + +#: imageedit/sq_imagefilter.cpp:498 +msgid "Poisson" +msgstr "Poisson" + +#: imageedit/sq_imagefilter.cpp:499 +msgid "Gaussian" +msgstr "Gussian" + +#: imageedit/sq_imagefilter.cpp:500 +msgid "Laplacian" +msgstr "Laplacian" + +#: imageedit/sq_imagefilter.cpp:502 +msgid "Color" +msgstr "Renk" + +#: imageedit/sq_imagefilter.cpp:503 +msgid "Elevation" +msgstr "Yükseltme" + +#: imageedit/sq_imagefilter.cpp:504 +msgid "Azimuth" +msgstr "Güney açısı" + +#: imageedit/sq_imagefilter.cpp:508 +msgid "Amount" +msgstr "Toplam" + +#: imageedit/sq_imagefilter.cpp:509 +msgid "Type" +msgstr "Tip" + +#: imageedit/sq_imagefilter.cpp:510 +msgid "GBR" +msgstr "GBR" + +#: imageedit/sq_imagefilter.cpp:511 +msgid "BRG" +msgstr "BRG" + +#: imageedit/sq_imagefilter.cpp:512 +msgid "Degrees" +msgstr "Derece" + +#: imageedit/sq_imagefilter.cpp:513 imageedit/sq_imagefilter.cpp:515 +#: imageedit/sq_imagefilter.cpp:536 +msgid "Threshold" +msgstr "Eşik" + +#: imageedit/sq_imagefilter.cpp:517 +msgid "Blend" +msgstr "Harmanla" + +#: imageedit/sq_imagefilter.cpp:518 +msgid "Blur" +msgstr "Bulanıklaştır" + +#: imageedit/sq_imagefilter.cpp:519 +msgid "Desaturate" +msgstr "Solgunlaştır" + +#: imageedit/sq_imagefilter.cpp:520 +msgid "Despeckle" +msgstr "Despeckle" + +#: imageedit/sq_imagefilter.cpp:521 +msgid "Edge" +msgstr "Kenar" + +#: imageedit/sq_imagefilter.cpp:522 +msgid "Emboss" +msgstr "Kabart" + +#: imageedit/sq_imagefilter.cpp:523 +msgid "Equalize" +msgstr "Eşitle" + +#: imageedit/sq_imagefilter.cpp:524 +msgid "Fade" +msgstr "Sarart" + +#: imageedit/sq_imagefilter.cpp:525 +msgid "Flatten" +msgstr "Düzleştir" + +#: imageedit/sq_imagefilter.cpp:526 +msgid "Implode" +msgstr "İçeriye patlama" + +#: imageedit/sq_imagefilter.cpp:527 +msgid "Negative" +msgstr "Negatif" + +#: imageedit/sq_imagefilter.cpp:528 +msgid "Noise" +msgstr "Gürültü" + +#: imageedit/sq_imagefilter.cpp:529 +msgid "Oil" +msgstr "Yağlı boya" + +#: imageedit/sq_imagefilter.cpp:530 +msgid "Shade" +msgstr "Gölge" + +#: imageedit/sq_imagefilter.cpp:531 +msgid "Sharpen" +msgstr "Keskinleştir" + +#: imageedit/sq_imagefilter.cpp:532 +msgid "Solarize" +msgstr "Güneş ışığı ver" + +#: imageedit/sq_imagefilter.cpp:533 +msgid "Spread" +msgstr "Yay" + +#: imageedit/sq_imagefilter.cpp:534 +msgid "Swap colors" +msgstr "Takas renkeri" + +#: imageedit/sq_imagefilter.cpp:535 +msgid "Swirl" +msgstr "Girdap" + +#: imageedit/sq_imagefilter.cpp:537 +msgid "Grayscale" +msgstr "Grileştir" + +#: imageedit/sq_imagefilter.cpp:538 +msgid "Redeye" +msgstr "Kırmızı göz" + +#: imageedit/sq_imagefilter.cpp:541 +msgid "Image after filtering:" +msgstr "Filtre uygulanmış resim:" + +#: imageedit/sq_imagefilter.cpp:542 imageedit/sq_imagebcg.cpp:397 +msgid "Original image:" +msgstr "Resmin aslı:" + +#: imageedit/sq_imagebcg.cpp:378 +msgid "Color balance" +msgstr "Renk dengesi" + +#: imageedit/sq_imagebcg.cpp:394 +msgid "Colorize" +msgstr "Renklendir" + +#: imageedit/sq_imagebcg.cpp:396 +msgid "Image after colorizing:" +msgstr "Renklendirme sonrası resim:" + +#: imageedit/sq_imageconvert.cpp:167 +msgid "Convert" +msgstr "Dönüştür" + +#: imageedit/sq_imageconvert.cpp:172 +msgid "Conversion options" +msgstr "Dönüştürme seçenekleri" + +#: sq_viewcache.cpp:49 sq_viewcache.cpp:107 +msgid "Parameters" +msgstr "Parametreler" + +#: sq_viewcache.cpp:103 +msgid "Memory cache" +msgstr "Bellek önbelleği" + +#: sq_viewcache.cpp:108 +msgid "Total:" +msgstr "Toplam:" + +#: sq_imageproperties.ui.h:29 +msgid "Copy entry" +msgstr "Girdiyi kopyala" + +#: sq_imageproperties.ui.h:30 +msgid "Copy all entries" +msgstr "Tüm girdileri kopyala" + +#: sq_imageproperties.ui.h:95 +msgid "EXIF" +msgstr "EXIF" + +#: sq_imageproperties.ui.h:105 +msgid "Simple" +msgstr "Basit" + +#: sq_imageproperties.ui.h:108 +msgid "Full" +msgstr "Tam" + +#: sq_imageproperties.ui.h:127 +msgid "EXIF (no)" +msgstr "EXIF (yok)" + +#: sq_imageproperties.ui.h:177 +msgid "Metadata (no)" +msgstr "Meta verisi (yok)" + +#: _translatorinfo.cpp:1 +msgid "" +"_: NAME OF TRANSLATORS\n" +"Your names" +msgstr "Serdar Soytetir" + +#: _translatorinfo.cpp:3 +msgid "" +"_: EMAIL OF TRANSLATORS\n" +"Your emails" +msgstr "tulliana@gmail.com" + +#: sq_glwidget.cpp:233 +msgid "Rectangle" +msgstr "Dikdörtgen" + +#: sq_glwidget.cpp:234 +msgid "Ellipse" +msgstr "Elips" + +#: sq_glwidget.cpp:239 +msgid "Fit width" +msgstr "Genişliğe uydur" + +#: sq_glwidget.cpp:240 +msgid "Fit height" +msgstr "Yüksekliğe uydur" + +#: sq_glwidget.cpp:241 +msgid "Fit image" +msgstr "Resmi uydur" + +#: sq_glwidget.cpp:242 +msgid "Zoom 100%" +msgstr "%100 Büyüt" + +#: sq_glwidget.cpp:243 +msgid "Leave previous zoom" +msgstr "Önceki büyütmeyi bırak" + +#: sq_glwidget.cpp:244 +msgid "Ignore, if image is smaller than window" +msgstr "Resim pencereden az ise yoksay" + +#: sq_glwidget.cpp:318 +msgid "Go to first image" +msgstr "İlk resime git" + +#: sq_glwidget.cpp:319 +msgid "Previous image" +msgstr "Önceki resim" + +#: sq_glwidget.cpp:321 +msgid "Next image" +msgstr "Sonraki resim" + +#: sq_glwidget.cpp:323 +msgid "Go to last image" +msgstr "Son resime git" + +#: sq_glwidget.cpp:326 sq_glwidget.cpp:2685 +msgid "Zoom +" +msgstr "Büyüt +" + +#: sq_glwidget.cpp:328 sq_glwidget.cpp:2686 +msgid "Zoom -" +msgstr "Küçült -" + +#: sq_glwidget.cpp:332 sq_glwidget.cpp:2677 +msgid "Rotate left" +msgstr "Sola döndür" + +#: sq_glwidget.cpp:334 sq_glwidget.cpp:2678 +msgid "Rotate right" +msgstr "Sağa döndür" + +#: sq_glwidget.cpp:336 sq_glwidget.cpp:2707 +msgid "Flip vertically" +msgstr "Dikey olarak çevir" + +#: sq_glwidget.cpp:338 sq_glwidget.cpp:2708 +msgid "Flip horizontally" +msgstr "Yatay olarak çevir" + +#: sq_glwidget.cpp:340 +msgid "Normalize" +msgstr "Normalleştir" + +#: sq_glwidget.cpp:342 sq_glwidget.cpp:2723 +msgid "Fullscreen" +msgstr "Tam Ekran" + +#: sq_glwidget.cpp:344 +msgid "Select image" +msgstr "Resmi seç" + +#: sq_glwidget.cpp:346 +msgid "Selection" +msgstr "Seçim" + +#: sq_glwidget.cpp:348 sq_glwidget.cpp:2717 sq_codecsettingsskeleton.cpp:128 +msgid "Codec settings" +msgstr "Kodlayıcı ayarları" + +#: sq_glwidget.cpp:351 +msgid "Show navigator" +msgstr "Gezgini göster" + +#: sq_glwidget.cpp:1024 +msgid "yes" +msgstr "evet" + +#: sq_glwidget.cpp:1024 +msgid "no" +msgstr "hayır" + +#: sq_glwidget.cpp:1485 +msgid "Codec for %1 format not found" +msgstr "%1 biçimi için kodlayıcı bulunamadı" + +#: sq_glwidget.cpp:1729 +msgid "Memory allocation failed for %1 of memory" +msgstr "Belleğin %1 kadarı için bellek konumlandırma hatası oluştu" + +#: sq_glwidget.cpp:1741 +msgid "Memory allocation failed" +msgstr "Bellek konumlandırma hatası oluştu" + +#: sq_glwidget.cpp:1747 +msgid "Decoding failed" +msgstr "Açma başarısız oldu" + +#: sq_glwidget.cpp:1849 +msgid " ms." +msgstr "ms." + +#: sq_glwidget.cpp:2363 +msgid "" +"Sorry, could not perform write operation\n" +"for codec \"%1\"" +msgstr "" +"Üzgünüm yazma işlemi yapılamadı\n" +"kullanılan kodlayıcı \"%1\"" + +#: sq_glwidget.cpp:2382 sq_glwidget.cpp:2390 sq_glwidget.cpp:2412 +msgid "Error writing image" +msgstr "Resim yazma hatası" + +#: sq_glwidget.cpp:2433 +msgid "Try another location?" +msgstr "Başka bir konum denensin mi?" + +#: sq_glwidget.cpp:2658 +msgid "Rotate" +msgstr "Döndür" + +#: sq_glwidget.cpp:2661 sq_options.cpp:803 +msgid "Window" +msgstr "Pencere" + +#: sq_glwidget.cpp:2670 +msgid "Next" +msgstr "Sonraki" + +#: sq_glwidget.cpp:2671 +msgid "Previous" +msgstr "Önceki" + +#: sq_glwidget.cpp:2672 +msgid "First" +msgstr "İlk" + +#: sq_glwidget.cpp:2673 +msgid "Last" +msgstr "Son" + +#: sq_glwidget.cpp:2680 +msgid "Rotate 180'" +msgstr "180' Döndür" + +#: sq_glwidget.cpp:2682 +msgid "Rotate 1' left" +msgstr "1' Sola Döndür" + +#: sq_glwidget.cpp:2683 +msgid "Rotate 1' right" +msgstr "1' Sağa Döndür" + +#: sq_glwidget.cpp:2687 +msgid "Zoom 2x" +msgstr "2x Büyüt" + +#: sq_glwidget.cpp:2688 +msgid "Zoom 1/2x" +msgstr "1/2x Büyüt" + +#: sq_glwidget.cpp:2698 +msgid "Move left" +msgstr "Sola taşı" + +#: sq_glwidget.cpp:2699 +msgid "Move right" +msgstr "Sağa taşı" + +#: sq_glwidget.cpp:2700 +msgid "Move up" +msgstr "Yukarı taşı" + +#: sq_glwidget.cpp:2701 +msgid "Move down" +msgstr "Aşağı taşı" + +#: sq_glwidget.cpp:2703 +msgid "Start/stop animation" +msgstr "Canlandırmayı başlat / durdur" + +#: sq_glwidget.cpp:2704 +msgid "Hide/show background" +msgstr "Arkaplanı gizle / göster" + +#: sq_glwidget.cpp:2705 +msgid "Hide/show tickmarks" +msgstr "Seçme işaretlerini gizle / göster" + +#: sq_glwidget.cpp:2710 +msgid "First page" +msgstr "İlk sayfa" + +#: sq_glwidget.cpp:2711 +msgid "Previous page" +msgstr "Önceki sayfa" + +#: sq_glwidget.cpp:2712 +msgid "Next page" +msgstr "Sonraki sayfa" + +#: sq_glwidget.cpp:2713 +msgid "Last page" +msgstr "Son sayfa" + +#: sq_glwidget.cpp:2715 +msgid "To clipboard" +msgstr "Panoya" + +#: sq_glwidget.cpp:2720 +msgid "Color balance..." +msgstr "Renk dengesi..." + +#: sq_glwidget.cpp:2721 +msgid "Apply filter..." +msgstr "Filtreyi uygula..." + +#: sq_glwidget.cpp:2724 +msgid "Hide/show toolbar" +msgstr "Araç çubuğunu göster / gizle" + +#: sq_glwidget.cpp:2725 +msgid "Hide/show statusbar" +msgstr "Durum çubuğunu göster / gizle" + +#: sq_glwidget.cpp:2728 +msgid "Reset" +msgstr "Sıfırla" + +#: sq_glwidget.cpp:2731 sq_helpwidget.cpp:174 +msgid "Hotkeys" +msgstr "Kısayollar" + +#: sq_glview.cpp:84 +msgid "Loading time" +msgstr "Yükleme zamanı" + +#: sq_options.cpp:746 +msgid "The main options" +msgstr "Ana seçenekler" + +#: sq_options.cpp:748 +msgid "Write configuration file to disk, when I press \"OK\"" +msgstr "\"TAMAM\" düğmesine basınca, yapılandırma ayarlarını diske yaz" + +#: sq_options.cpp:749 +msgid "Minimize to tray after closing" +msgstr "Kapatılınca sistem çekmecesine küçült" + +#: sq_options.cpp:750 +msgid "Show splash screen at startup" +msgstr "Başlangıçta açılış resmini göster" + +#: sq_options.cpp:751 +msgid "Don't show animated logo in toolbar" +msgstr "Araç çubuğunda hareketli logoyu gösterme" + +#: sq_options.cpp:752 +msgid "Apply codec settings to" +msgstr "Kodlayıcı ayarlarını buna uygula" + +#: sq_options.cpp:753 +msgid "Thumbnail loader" +msgstr "Önizleme yükleyici" + +#: sq_options.cpp:754 +msgid "Image viewer (also preview window)" +msgstr "Resim gösterici (aynı zamanda önizleme penceresi)" + +#: sq_options.cpp:755 sq_options.cpp:773 +msgid "Both" +msgstr "İkisi de" + +#: sq_options.cpp:756 +msgid "RunTime" +msgstr "Çalışma Zamanı" + +#: sq_options.cpp:757 +msgid "Treat unknown mime types as unsupported" +msgstr "Bilinmeyen mime tiplerini desteklenmeyen olarak değerlendir" + +#: sq_options.cpp:758 +msgid "Load KIPI plugins on demand (for slow machines)" +msgstr "KIPI eklentilerini istenildiği zaman yükle (yavaş makineler için)" + +#: sq_options.cpp:759 +msgid "Disk navigator" +msgstr "Disk gezgini" + +#: sq_options.cpp:760 +msgid "On starting open..." +msgstr "Başlarken aç..." + +#: sq_options.cpp:762 +msgid "Custom directory:" +msgstr "Özel dizin:" + +#: sq_options.cpp:763 +msgid "Last visited directory" +msgstr "Son gezilen dizin" + +#: sq_options.cpp:764 +msgid "Current directory, where KSquirrel starts" +msgstr "Geçerli dizin, KSquirrel uygulamasının başladığı dizin" + +#: sq_options.cpp:765 +msgid "Run unknown file formats separately (with default application)" +msgstr "Bilinmeyen dosya biçimlerini çalıştır (öntanımlı uygulama ile)" + +#: sq_options.cpp:767 +msgid "Save history" +msgstr "Geçmişi kaydet" + +#: sq_options.cpp:768 +msgid "Jump into archives" +msgstr "Arşivlere atla" + +#: sq_options.cpp:769 +msgid "Jump to first image" +msgstr "İlk resime atla" + +#: sq_options.cpp:770 +msgid "Don't show directories" +msgstr "Dizinleri gösterme" + +#: sq_options.cpp:771 +msgid "Main" +msgstr "Ana" + +#: sq_options.cpp:772 +msgid "Synchronization" +msgstr "Eşzamanlama" + +#: sq_options.cpp:774 +msgid "Tree -> Navigator" +msgstr "Ağaç -> Gezgin" + +#: sq_options.cpp:775 +msgid "Tree <- Navigator" +msgstr "Ağaç <- Gezgin" + +#: sq_options.cpp:776 +msgid "Clicking" +msgstr "Tıklama" + +#: sq_options.cpp:777 +msgid "Thumbnails" +msgstr "Önizlemeler" + +#: sq_options.cpp:779 +msgid "Do not write thumbnails on disk" +msgstr "Önizlemeleri diske yazma" + +#: sq_options.cpp:780 +msgid "Show tooltips with file information" +msgstr "Dosya bilgisi ile birlikte ipuçlarını da göster" + +#: sq_options.cpp:781 +msgid "Margin between thumbnails" +msgstr "Önizlemeler arasında bırakılacak boşluk" + +#: sq_options.cpp:782 sq_options.cpp:815 +msgid " pixels" +msgstr "piksel" + +#: sq_options.cpp:783 +msgid "Don't show tooltips when the main window is inactive" +msgstr "Ana pencere etkin değilse ipuçlarını gösterme" + +#: sq_options.cpp:784 +msgid "Mark supported image formats with clock icon (slow)" +msgstr "Desteklenen resim biçimlerini saat simgesi ile işaretle (yavaş)" + +#: sq_options.cpp:785 +msgid "Maximum cache size (in memory)" +msgstr "En büyük önbellek boyutu (bellek için)" + +#: sq_options.cpp:786 +msgid " Kb" +msgstr "kb" + +#: sq_options.cpp:787 +msgid "No cache" +msgstr "Önbellek yok" + +#: sq_options.cpp:788 +msgid "On scroll event" +msgstr "Kaydırma hareketinde" + +#: sq_options.cpp:789 +msgid "Zoom the scene" +msgstr "Ekranı büyüt" + +#: sq_options.cpp:790 +msgid "Load next/previous file" +msgstr "Önceki / Sonraki dosyayı yükle" + +#: sq_options.cpp:791 +msgid "Background" +msgstr "Arkaplan" + +#: sq_options.cpp:792 +msgid "Custom texture" +msgstr "Özel doku" + +#: sq_options.cpp:793 +msgid "Custom color" +msgstr "Özel renk" + +#: sq_options.cpp:794 +msgid "System color" +msgstr "Sistem rengi" + +#: sq_options.cpp:798 +msgid "Validate" +msgstr "Doğrula" + +#: sq_options.cpp:802 +msgid "Show images progressively" +msgstr "Resimleri derecelendirerek göster" + +#: sq_options.cpp:804 +msgid "Image pages" +msgstr "Resim sayfaları" + +#: sq_options.cpp:805 +msgid "Load all pages" +msgstr "Tüm sayfaları yükle" + +#: sq_options.cpp:806 +msgid "Load only first page" +msgstr "Sadece ilk sayfayı yükle" + +#: sq_options.cpp:807 +msgid "Load no more than" +msgstr "Daha fazla yükleme" + +#: sq_options.cpp:808 +msgid " pages" +msgstr "sayfa" + +#: sq_options.cpp:809 +msgid "Loader" +msgstr "Yükleyici" + +#: sq_options.cpp:810 +msgid "Draw tickmarks around the image" +msgstr "Resimlerin etrafında seçme işaretleri oluştur" + +#: sq_options.cpp:811 +msgid "Draw background for transparent images" +msgstr "Saydam resimler için arkaplan oluştur" + +#: sq_options.cpp:812 +msgid "Rotating" +msgstr "Döndüme" + +#: sq_options.cpp:813 +msgid " degrees" +msgstr "derece" + +#: sq_options.cpp:814 sq_helpwidget.cpp:183 +msgid "Moving" +msgstr "Taşıma" + +#: sq_options.cpp:817 +msgid "Zoom limit" +msgstr "Büyütme sınırı" + +#: sq_options.cpp:818 +msgid "Minimum: 1%, maximum: 10,000%" +msgstr "En az: 1%, en çok: 10,000%" + +#: sq_options.cpp:819 +msgid "Custom" +msgstr "Özel" + +#: sq_options.cpp:821 +msgid "minimum" +msgstr "en düşük" + +#: sq_options.cpp:822 sq_options.cpp:824 +msgid " %" +msgstr "%" + +#: sq_options.cpp:823 +msgid "maximum" +msgstr "en büyük" + +#: sq_options.cpp:825 +msgid "No limit" +msgstr "Sınırsız" + +#: sq_options.cpp:826 +msgid "Zoom coefficient" +msgstr "Büyütme destekçisi" + +#: sq_options.cpp:827 +msgid "%" +msgstr "%" + +#: sq_options.cpp:828 +msgid "None" +msgstr "Hiçbiri" + +#: sq_options.cpp:830 +msgid "Customize OpenGL widget" +msgstr "OpenGL parçacığını özelleştir" + +#: sq_options.cpp:831 +msgid "Recursion" +msgstr "Özyineleme" + +#: sq_options.cpp:832 +msgid "No recursion" +msgstr "Özyineleme yok" + +#: sq_options.cpp:833 +msgid "Show number of files" +msgstr "Dosya sayılarını göster" + +#: sq_options.cpp:834 +msgid "Show number of subfolders and files" +msgstr "Alt dizin ve dosya sayılarını göster" + +#: sq_options.cpp:835 +msgid "Show number of subfolders" +msgstr "Alt dizin sayılarını göster" + +#: sq_options.cpp:836 +msgid "Treeview" +msgstr "Ağaç Görünümü" + +#: sq_options.cpp:837 +msgid "Show device path" +msgstr "Aygıt yolunu göster" + +#: sq_options.cpp:838 +msgid "Show mount options" +msgstr "Bağlantı seçeneklerini göster" + +#: sq_options.cpp:839 +msgid "Show filesystem type" +msgstr "Dosya sistemini göster" + +#: sq_options.cpp:840 +msgid "Mount view" +msgstr "Bağlantı görünümü" + +#: sq_options.cpp:841 +msgid "Enable preview window" +msgstr "Önizleme penceresini etkinleştir" + +#: sq_options.cpp:843 +msgid "Delay before image loading" +msgstr "Resim yüklenmeden önceki gecikme" + +#: sq_options.cpp:844 sq_slideshow.cpp:218 +msgid " ms" +msgstr "ms" + +#: sq_options.cpp:845 +msgid "Background color for preview widget:" +msgstr "Önizleme parçacığı için arkaplan rengi:" + +#: sq_options.cpp:847 +msgid "Don't load preview image on file execution" +msgstr "Dosya açılırken önizleme resmini yükleme" + +#: sq_options.cpp:848 +msgid "Disables loading preview image when user launches image with mouse" +msgstr "Kullanıcı resmi fare ile açmışsa önizleme yüklemesini pasifleştirir" + +#: sq_options.cpp:849 +msgid "Image preview" +msgstr "Resim önizlemesi" + +#: sq_options.cpp:850 +msgid "Sidebar settings" +msgstr "Yan Çubuk Ayarları" + +#: sq_options.cpp:851 +msgid "KIPI Configuration" +msgstr "KIPI Yapılandırması" + +#: sq_slideshow.cpp:205 +msgid "Slideshow options" +msgstr "Slayt gösterisi seçenekleri" + +#: sq_slideshow.cpp:206 +msgid "Start" +msgstr "Başla" + +#: sq_slideshow.cpp:209 +msgid "Set directory to current" +msgstr "Dizini geçerli dizine ayarla" + +#: sq_slideshow.cpp:210 +msgid "Last visited directories" +msgstr "Son gezilen dizinler" + +#: sq_slideshow.cpp:220 +msgid "Repeats:" +msgstr "Tekrarlayan:" + +#: sq_slideshow.cpp:221 +msgid "Background color:" +msgstr "Arkaplan rengi:" + +#: sq_slideshow.cpp:222 +msgid "Onscreen messages" +msgstr "Ekran iletileri" + +#: sq_slideshow.cpp:223 +msgid "Show current index" +msgstr "Geçerli indeksi göster" + +#: sq_slideshow.cpp:224 +msgid "Show file name" +msgstr "Dosya adını göster" + +#: sq_slideshow.cpp:225 +msgid "Show file size" +msgstr "Dosya boyutunu göster" + +#: sq_slideshow.cpp:226 +msgid "Recursively" +msgstr "Özyinelemeli olarak" + +#: ksquirrel.cpp:288 +msgid "Clear history" +msgstr "Geçmişi temizle" + +#: ksquirrel.cpp:289 +msgid "Clear address" +msgstr "Adresi temizle" + +#: ksquirrel.cpp:294 +msgid "Go!" +msgstr "Git!" + +#: ksquirrel.cpp:341 +msgid "Libraries' filters" +msgstr "Kütüphane filtreleri" + +#: ksquirrel.cpp:364 +msgid "All supported formats" +msgstr "Desteklenen tüm biçimler" + +#: ksquirrel.cpp:374 +msgid "User's filters" +msgstr "Kullanıcı filtreleri" + +#: ksquirrel.cpp:510 +msgid "Folder tree" +msgstr "Dizin ağacı" + +#: ksquirrel.cpp:511 +msgid "Mount points" +msgstr "Bağlanma noktaları" + +#: ksquirrel.cpp:628 +msgid "&Navigator" +msgstr "&Gezgin" + +#: ksquirrel.cpp:630 +msgid "&Action" +msgstr "&Eylem" + +#: ksquirrel.cpp:633 +msgid "&KIPI Plugins" +msgstr "&KIPI Eklentileri" + +#: ksquirrel.cpp:661 +msgid "Fi<er" +msgstr "&Filtrele" + +#: ksquirrel.cpp:720 +msgid "Thumbnail size" +msgstr "Önizleme boyutu" + +#: ksquirrel.cpp:723 sq_options.ui.h:137 +msgid "Image window" +msgstr "Resim Penceresi" + +#: ksquirrel.cpp:725 +msgid "Reload codecs from disk" +msgstr "Kodlayıcıları diskten geri yükle" + +#: ksquirrel.cpp:726 +msgid "Configure external tools..." +msgstr "Dış araçları yapılandır..." + +#: ksquirrel.cpp:727 +msgid "Configure filters..." +msgstr "Filtreleri yapılandır..." + +#: ksquirrel.cpp:728 +msgid "Go to tray" +msgstr "Sistem çekmecesine git" + +#: ksquirrel.cpp:729 +msgid "Open file and change directory" +msgstr "Dosyayı aç ve dizini değiştir" + +#: ksquirrel.cpp:730 +msgid "Open file" +msgstr "Dosya aç" + +#: ksquirrel.cpp:731 +msgid "Thumbnail cache manager..." +msgstr "Önizleme önbelleği yöneticisi..." + +#: ksquirrel.cpp:735 +msgid "List" +msgstr "Liste" + +#: ksquirrel.cpp:736 +msgid "Icons" +msgstr "Simgeler" + +#: ksquirrel.cpp:737 +msgid "Details" +msgstr "Ayrıntılar" + +#: ksquirrel.cpp:738 sq_options.ui.h:136 +msgid "Thumbnails" +msgstr "Önizlemeler" + +#: ksquirrel.cpp:740 +msgid "Show URL box" +msgstr "Adres Kutusunu göster" + +#: ksquirrel.cpp:742 +msgid "Built-in image window" +msgstr "İç resim penceresi" + +#: ksquirrel.cpp:745 +msgid "Slideshow" +msgstr "Slayt Gösterisi" + +#: ksquirrel.cpp:746 +msgid "Slideshow advanced" +msgstr "Gelişmiş slayt gösterisi" + +#: ksquirrel.cpp:748 +msgid "Codec information..." +msgstr "Kodlayıcı bilgileri..." + +#: ksquirrel.cpp:749 +msgid "OpenGL information..." +msgstr "OpenGL bilgileri..." + +#: ksquirrel.cpp:751 +msgid "Medium thumbnails" +msgstr "Normal önizlemeler" + +#: ksquirrel.cpp:752 +msgid "Large thumbnails" +msgstr "Büyük önizlemeler" + +#: ksquirrel.cpp:753 +msgid "Huge thumbnails" +msgstr "Çok büyük önizlemeler" + +#: ksquirrel.cpp:755 +msgid "Select group" +msgstr "Grubu seç" + +#: ksquirrel.cpp:756 +msgid "Deselect group" +msgstr "Grubu bırak" + +#: ksquirrel.cpp:776 +msgid "Extended thumbnails" +msgstr "Genişletilmiş önizlemeler" + +#: ksquirrel.cpp:1085 +msgid " writing settings and thumbnails... " +msgstr "ayarlar ve küçük resimler yazılıyor... " + +#: sq_filters.cpp:124 sq_filters.cpp:197 +msgid "Extensions" +msgstr "Eklentiler" + +#: sq_filters.cpp:181 +msgid "Adjust filters" +msgstr "Filtreleri ayarla" + +#: sq_filters.cpp:186 +msgid "New filter" +msgstr "Yeni filtre" + +#: sq_filters.cpp:193 +msgid "Move filter up" +msgstr "Filtreyi yukarı taşı" + +#: sq_filters.cpp:195 +msgid "Move filter down" +msgstr "Filtreyi aşağı taşı" + +#: sq_filters.cpp:198 +msgid "Menu item contains both name and extension" +msgstr "Menü ögesi isim ve eklentiyi içerir" + +#: sq_helpwidget.cpp:175 +msgid "" +"

    Dosya:%1
    Boyut:%2
    Link destination:%1
    Bağlantı hedefi:%1
    " +"" +"" +"" +"" +"" +"

    Esc,X,Return

    close

    Middle click, F

    fullscreen

    Z

    show 'Zoom' menu

    /

    show this help

    Right click, M, " +"ContextMenu

    show context menu

    N

    toggle filter

    Shift + Left button

    select a region

    Shift + Left

    previous tab

    Shift + Right

    next tab

    W

    close tab

    " +msgstr "" +"

    " +"" +"" +"" +"" +"" +"

    Esc,X,Return

    close

    Middle click, F

    fullscreen

    Z

    show 'Zoom' menu

    /

    show this help

    Right click, M, " +"ContextMenu

    show context menu

    N

    toggle filter

    Shift + Left button

    select a region

    Shift + Left

    previous tab

    Shift + Right

    next tab

    W

    close tab

    " + +#: sq_helpwidget.cpp:176 +msgid "" +"

    Space, Page Down

    next image

    Backspace, Page Up

    previous image

    Home

    first image

    End

    last image

    " +msgstr "" +"

    Space, Page Down

    next image

    Backspace, Page Up

    previous image

    Home

    first image

    End

    last image

    " + +#: sq_helpwidget.cpp:177 +msgid "" +"

    " +msgstr "" +"

    Left, Right," +" Up, Down

    move the image

    Ctrl + Left

    rotate left

    Ctrl + Right

    rotate " +"right

    Ctrl + Up/Down

    rotate for 180 degrees up/down

    Alt + Left/Right

    rotate for 1 degree " +"left/right
    " + +#: sq_helpwidget.cpp:178 +msgid "" +"

    Sola, Sağa," +" Yukarı, Aşağı

    resmi taşı

    Ctrl + Left

    sola döndür

    Ctrl + Right

    sağa " +"döndür

    Ctrl + Up/Down

    180 derece döndür yukarı/aşağı

    Alt + Left/Right

    1 derece döndür " +"sola/sağa
    " +msgstr "" +"

    +/-

    zoom " +"Nx

    Ctrl + +/-

    zoom " +"2x/0.5x

    Scroll

    load next/" +"prev file OR zoom+/zoom-

    Shift + Scroll

    zoom+/zoom-

    Ctrl + Scroll

    zoom+ 2x/zoom- 2x

    1..9

    zoom 1..9x

    0

    zoom 10x

    comma

    fit " +"width

    period

    fit height

    *

    fit image
    " + +#: sq_helpwidget.cpp:179 +msgid "" +"

    +/-

    zoom " +"Nx

    Ctrl + +/-

    zoom " +"2x/0.5x

    Scroll

    load next/" +"prev file OR zoom+/zoom-

    Shift + Scroll

    zoom+/zoom-

    Ctrl + Scroll

    zoom+ 2x/zoom- 2x

    1..9

    zoom 1..9x

    0

    zoom 10x

    comma

    fit " +"width

    period

    fit height

    *

    fit image
    " +"

    S

    save as

    V

    flip vertically

    H

    flip horizontally

    R

    reset

    P

    image properties

    C

    codec settings

    L

    ignore zoom if image is smaller than " +"window

    I

    menu with " +"images

    A

    stop/start " +"animation

    B

    toggle " +"drawing background for transparent images

    K

    toggle drawing tickmarks

    E

    show menu with external " +"tools

    Y

    crop

    F1

    first image in " +"multi-paged image

    F2

    previous

    F3

    next

    F4

    last
    " +msgstr "" +"

    S

    farklı kaydet

    V

    yatay olarak çevir

    H

    dikey olarak çevir

    R

    sıfırla

    P

    resim özellikleri

    C

    kodlayıcı ayarları

    L

    ignore zoom if image is smaller than " +"window

    I

    resimlerle birlikte menü" +"

    A

    canlandırmayı başlat/durdur" +"

    B

    toggle " +"drawing background for transparent images

    K

    toggle drawing tickmarks

    E

    menüyü dış araçlarla birlikte göster" +"

    Y

    crop

    F1

    first image in " +"multi-paged image

    F2

    önceki

    F3

    sonraki

    F4

    son
    " + +#: sq_helpwidget.cpp:182 sq_options.ui.h:135 +msgid "Filing" +msgstr "Doldurma" + +#: sq_helpwidget.cpp:184 +msgid "Current image" +msgstr "Geçerli Resim" + +#: sq_options.ui.h:138 +msgid "Sidebar" +msgstr "Yan Çubuk" + +#: sq_options.ui.h:141 +msgid "KIPI" +msgstr "KIPI" + +#: sq_options.ui.h:260 +msgid "Wrong dimensions: %1x%2." +msgstr "Yanlış boyutlar: %1x%2." + +#: sq_slideshowlisting.cpp:87 +msgid "Listing" +msgstr "Listeleniyor" + +#: ksquirrel.cpp:751 +msgid "Rename" +msgstr "Yeniden Adlandır" + +#: ksquirrel.cpp:1951 +msgid "Renaming File" +msgstr "Dosya Yeniden Adlandırılıyor" + +#: ksquirrel.cpp:1952 +msgid "

    Rename file %1 to:

    " +msgstr "

    Dosyayı bu şekilde yeniden adlandır %1:

    " + +msgid "Calculate directory size" +msgstr "Dizin boyutunu hesapla" + +msgid "New folder..." +msgstr "Yeni dizin..." + +msgid "Create Subfolder" +msgstr "Alt Dizin Oluştur" + +msgid "

    Create new folder in %1:

    " +msgstr "

    Burada yeni dizin oluştur %1:

    " + +msgid "Rename Folder" +msgstr "Dizini Yeniden Adlandır" + +msgid "

    Rename folder %1 to:

    " +msgstr "

    Dizini bu şekilde yeniden adlandır %1:

    " + +msgid "Are you sure you want to delete %1?" +msgstr "%1 ögesini silmek istediğinizden emin misiniz?" + +msgid "Copy to last folder" +msgstr "Son dizine kopyala" + +msgid "Move to last folder" +msgstr "Son dizine taşı" + +msgid "Message text color:" +msgstr "İleti metni rengi:" + +msgid "Total" +msgstr "Toplam" + +msgid "Visualize drag operation" +msgstr "Sürükleme işlemini görselleştir" + +msgid "Testing" +msgstr "Test ediliyor" + +msgid "Lazy thumbnail generation" +msgstr "Tembel önizleme oluşturması kullan" + +msgid "Delay" +msgstr "Gecikme" + +msgid "Interface" +msgstr "Arayüz" + +msgid "Number of text lines" +msgstr "Metin satırlarının sayısı" + +msgid "Show file preview" +msgstr "Dosya önizlemesini göster" + +msgid "Number of additionally generated rows" +msgstr "Ek olarak oluşturulacak satır sayısı" + +msgid "Repeat (copy to %1)" +msgstr "Tekrarla (%1 konumuna kopyala)" + +msgid "Repeat (move to %1)" +msgstr "Tekrarla (%1 konumuna taşı)" + +msgid "Repeat (link to %1)" +msgstr "Tekrarla (%1 konumuna bağ koy)" + +msgid "Repeat (nothing to repeat)" +msgstr "Tekrarla (tekrarlanacak eylem yok)" + +msgid "Clear contents" +msgstr "İçeriği temizle" + +msgid "Are you sure you want to delete contents of %1?" +msgstr "%1 konumunun içeriğini silmek istediğinizden emin misiniz?" + +msgid "Add to Folder Basket" +msgstr "Dizin sepetine ekle" + +msgid "Folder basket" +msgstr "Dizin sepeti" + +msgid "Change icon" +msgstr "Simgeyi değiştir" + +msgid "

    Rename item %1 to:

    " +msgstr "

    Ögeyi bu şekilde yeniden adlandır %1 :

    " + +msgid "Copy file path" +msgstr "Dosya yolunu kopyala" + +msgid "Copy file url" +msgstr "Dosya adresini kopyala" + +msgid "Text color:" +msgstr "Metin rengi:" + +msgid "Show image dimensions" +msgstr "Resim boyutlarını göster" + +msgid "Text color..." +msgstr "Metin rengi..." + +msgid "Double click" +msgstr "Çift tıkla" + +msgid "Close window" +msgstr "Pencereyi kapat" + +msgid "Crop" +msgstr "Kes" + +msgid "Tabs" +msgstr "Sekmeler" + +msgid "Enable tabs" +msgstr "Sekmeleri etkinleştir" + +msgid "Ask what to do when opening new image" +msgstr "Yeni resim açılırken ne yapılacağını sor" + +msgid "Show close buttons" +msgstr "Kapatma düğmesini göster" + +msgid "Open in a new tab" +msgstr "Yeni sekmede aç" + +msgid "Replace current tab" +msgstr "Geçerli sekmeyi kapat" + +msgid "Close all and open in a new tab" +msgstr "Tümünü kapat ve yeni bir sekmede aç" + +msgid "Opening..." +msgstr "Açılıyor..." + +msgid "Previous tab" +msgstr "Önceki sekme" + +msgid "Next tab" +msgstr "Sonraki sekme" + +msgid "Close tab" +msgstr "Sekmeyi kapat" + +msgid "Do nothing" +msgstr "Hiçbirşey yapma" + +msgid "Print available DCOP parameters" +msgstr "" + +msgid "Downloading..." +msgstr "" + +msgid "Close all tabs" +msgstr "" + +msgid "Close all opened images when closing window" +msgstr "" + +msgid "Select codecs to disable:" +msgstr "" + +msgid "Select codecs to enable:" +msgstr "" + +msgid "Codec manager..." +msgstr "" diff --git a/po/uk.po b/po/uk.po new file mode 100644 index 0000000..ec10fc5 --- /dev/null +++ b/po/uk.po @@ -0,0 +1,2170 @@ +# translation of uk.po to Ukrainian +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# +# Yuri Chornoivan , 2007. +msgid "" +msgstr "" +"Project-Id-Version: uk\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2007-08-07 09:34+0300\n" +"PO-Revision-Date: 2007-11-17 07:41+0200\n" +"Last-Translator: Yuri Chornoivan \n" +"Language-Team: Ukrainian \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: KBabel 1.11.4\n" +"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n" + +#: sq_filters.ui.h:56 sq_filters.ui.h:58 sq_externaltools.cpp:67 +#: sq_externaltools.cpp:194 sidebar/sq_mountview.cpp:64 sq_viewcache.cpp:47 +#: sq_viewcache.cpp:105 sq_filters.cpp:123 sq_filters.cpp:196 +msgid "Name" +msgstr "Назва" + +#: sq_externaltool.cpp:102 sq_externaltool.cpp:162 sq_externaltool.cpp:170 +msgid "No file selected" +msgstr "Не обрано жодного файла" + +#: sq_kipimanager.cpp:68 +msgid "No Plugins" +msgstr "Додатки відсутні" + +#: sq_kipimanager.cpp:125 +msgid "Image actions" +msgstr "Дії з зображеннями" + +#: sq_kipimanager.cpp:126 +msgid "Effects" +msgstr "Ефекти" + +#: sq_kipimanager.cpp:127 +msgid "Tools" +msgstr "Інструменти" + +#: sq_kipimanager.cpp:130 +msgid "Batch processing" +msgstr "Пакетна обробка" + +#: sq_kipimanager.cpp:131 +msgid "Collections" +msgstr "Колекції" + +#: sq_libraryhandler.cpp:148 +msgid "All files" +msgstr "Всі файли" + +#: sq_navigatordropmenu.cpp:40 +msgid "Copy here" +msgstr "Копіювати сюди" + +#: sq_navigatordropmenu.cpp:43 +msgid "Move here" +msgstr "Перемістити сюди" + +#: sq_navigatordropmenu.cpp:46 +msgid "Link here" +msgstr "Приєднати сюди" + +#: sq_glinfo.cpp:45 sq_glinfo.cpp:92 +msgid "Parameter" +msgstr "Параметр" + +#: sq_glinfo.cpp:46 sq_glinfo.cpp:93 sq_imageproperties.cpp:321 +#: sq_imageproperties.cpp:408 imageedit/sq_imagefilter.cpp:487 +msgid "Value" +msgstr "Значення" + +#: sq_glinfo.cpp:91 +msgid "OpenGL information" +msgstr "Інформація щодо OpenGL" + +#: sq_externaltools.cpp:66 sq_externaltools.cpp:193 +msgid "Pixmap" +msgstr "Растрове зображення" + +#: sq_externaltools.cpp:68 sq_externaltools.cpp:195 +msgid "Command" +msgstr "Команда" + +#: sq_externaltools.cpp:190 +msgid "Adjust external tools" +msgstr "Налаштувати зовнішні інструменти" + +#: sq_externaltools.cpp:192 sq_filters.cpp:182 +msgid "OK" +msgstr "Гаразд" + +#: sq_externaltools.cpp:196 sq_externaltools.ui.h:146 +#, c-format +msgid "Command can contain
    • %f: one file
    • %F: multiple files
    " +msgstr "Команда може містити
    • %f: один файл
    • %F: декілька файлів
    " + +#: sq_externaltools.cpp:199 +msgid "New tool" +msgstr "Створити інструмент" + +#: sq_externaltools.cpp:206 +msgid "Move tool up" +msgstr "Перемістити інструмент вище" + +#: sq_externaltools.cpp:208 +msgid "Move tool down" +msgstr "Перемістити інструмент нижче" + +#: sq_kipiinterface.cpp:72 +msgid "Root directory" +msgstr "Коренева тека" + +#: sq_kipiinterface.cpp:144 +msgid "Folder content" +msgstr "Вміст теки" + +#: sq_kipiinterface.cpp:161 +msgid "Selected images" +msgstr "Обрані зображення" + +#: sq_kipiinterface.cpp:175 ksquirrel.cpp:513 +msgid "Image basket" +msgstr "Кошик з зображеннями" + +#: main.cpp:40 +msgid "File to be opened at startup." +msgstr "Файл, що відкриватиметься після запуску" + +#: main.cpp:41 +msgid "Print found libraries and exit." +msgstr "Відобразити знайдені бібліотеки та вийти." + +#: main.cpp:57 +msgid "KSquirrel - image viewer for KDE" +msgstr "KSquirrel - переглядач зображень для KDE" + +#: main.cpp:66 +msgid "Bug reports, patches" +msgstr "Звіти про помилки, латки" + +#: main.cpp:67 +msgid "Bug reports" +msgstr "Звіти про помилки" + +#: main.cpp:68 +msgid "Translation help" +msgstr "Допомога з перекладу" + +#: main.cpp:69 +msgid "TiamaT" +msgstr "TiamaT" + +#: main.cpp:69 +msgid "Initial artwork for edit tools" +msgstr "Початкова графічна робота над засобами редагування" + +#: main.cpp:70 +msgid "Fera" +msgstr "Fera" + +#: main.cpp:70 +msgid "Great artwork for edit tools" +msgstr "Чудові картинки для інструментів редагування" + +#: main.cpp:71 +msgid "OpenGL forum at" +msgstr "Форум OpenGL за адресою" + +#: main.cpp:72 +msgid "GameDev forum at" +msgstr "Форум GameDev за адресою" + +#: sq_imageproperties.cpp:320 sq_imageproperties.cpp:407 +msgid "Group" +msgstr "Група" + +#: sq_imageproperties.cpp:359 sq_glwidget.cpp:350 +msgid "Image properties" +msgstr "Властивості зображення" + +#: sq_imageproperties.cpp:361 +msgid "Attributes" +msgstr "Атрибути" + +#: sq_imageproperties.cpp:362 +msgid "Owner:" +msgstr "Власник:" + +#: sq_imageproperties.cpp:363 +msgid "Group:" +msgstr "Група:" + +#: sq_imageproperties.cpp:365 +msgid "Permissions:" +msgstr "Дозволи:" + +#: sq_imageproperties.cpp:368 +msgid "Time" +msgstr "Час" + +#: sq_imageproperties.cpp:369 +msgid "Created:" +msgstr "Створено:" + +#: sq_imageproperties.cpp:370 +msgid "Last read:" +msgstr "Востаннє прочитано:" + +#: sq_imageproperties.cpp:371 +msgid "Last modified:" +msgstr "Востаннє змінено:" + +#: sq_imageproperties.cpp:375 sq_helpwidget.cpp:181 sq_options.ui.h:134 +msgid "General" +msgstr "Загальне" + +#: sq_imageproperties.cpp:376 +msgid "File:" +msgstr "Файл:" + +#: sq_imageproperties.cpp:378 sq_pluginsinfo.cpp:137 sq_slideshow.cpp:211 +msgid "Directory:" +msgstr "Тека:" + +#: sq_imageproperties.cpp:379 +msgid "Size:" +msgstr "Розмір:" + +#: sq_imageproperties.cpp:381 +msgid "Type:" +msgstr "Тип:" + +#: sq_imageproperties.cpp:382 +msgid "Number of frames:" +msgstr "Кількість кадрів:" + +#: sq_imageproperties.cpp:383 +msgid "Current frame" +msgstr "Поточний кадр" + +#: sq_imageproperties.cpp:384 sq_slideshow.cpp:219 +msgid "Delay:" +msgstr "Затримка:" + +#: sq_imageproperties.cpp:385 +msgid "Dimensions:" +msgstr "Розміри:" + +#: sq_imageproperties.cpp:386 +msgid "Bits per pixel:" +msgstr "Бітів на точку" + +#: sq_imageproperties.cpp:387 +msgid "Color space:" +msgstr "Кількість кольорів:" + +#: sq_imageproperties.cpp:388 +msgid "Compression:" +msgstr "Стиснення:" + +#: sq_imageproperties.cpp:389 +msgid "Uncompressed size:" +msgstr "Розмір розпакованого:" + +#: sq_imageproperties.cpp:390 +msgid "Compression ratio:" +msgstr "Рівень стиснення:" + +#: sq_imageproperties.cpp:391 +msgid "Interlaced:" +msgstr "Черезрядкове:" + +#: sq_imageproperties.cpp:392 +msgid "Status:" +msgstr "Статус:" + +#: sq_imageproperties.cpp:406 sq_glwidget.cpp:2662 sq_options.cpp:816 +msgid "Image" +msgstr "Зображення" + +#: sq_imageproperties.cpp:409 +msgid "Metadata" +msgstr "Метадані" + +#: sq_pluginsinfo.cpp:55 sq_pluginsinfo.cpp:129 +msgid "..." +msgstr "..." + +#: sq_pluginsinfo.cpp:56 sq_pluginsinfo.cpp:130 +msgid "Icon" +msgstr "Значок" + +#: sq_pluginsinfo.cpp:57 sq_pluginsinfo.cpp:131 +msgid "Library" +msgstr "Бібліотека" + +#: sq_pluginsinfo.cpp:58 sq_pluginsinfo.cpp:132 +msgid "Version" +msgstr "Версія" + +#: sq_pluginsinfo.cpp:59 sq_pluginsinfo.cpp:133 sq_viewcache.cpp:48 +#: sq_viewcache.cpp:106 +msgid "MIME" +msgstr "MIME" + +#: sq_pluginsinfo.cpp:128 +msgid "Codec information and settings" +msgstr "Параметри та інформація про кодеки" + +#: sq_pluginsinfo.cpp:138 +msgid "Total found:" +msgstr "Загалом знайдено:" + +#: sq_errorstring.cpp:34 +msgid "cannot open file for reading" +msgstr "неможливо відкрити файл для читання" + +#: sq_errorstring.cpp:35 +msgid "file corrupted" +msgstr "файл пошкоджено" + +#: sq_errorstring.cpp:36 +msgid "no memory" +msgstr "закінчилася пам'ять" + +#: sq_errorstring.cpp:37 +msgid "file type not supported" +msgstr "тип файлів не підтримується" + +#: sq_errorstring.cpp:38 +msgid "wrong image dimensions" +msgstr "невірні розміри зображення" + +#: sq_errorstring.cpp:39 +msgid "cannot open file for writing" +msgstr "неможливо відкрити файл для запису" + +#: sq_errorstring.cpp:40 +msgid "write feature is not supported" +msgstr "запис не підтримується" + +#: sq_errorstring.cpp:41 +msgid "write error (check free space)" +msgstr "помилка під час запису (перевірте наявність вільного місця)" + +#: sq_errorstring.cpp:42 +msgid "wrong parameters" +msgstr "невірні параметри" + +#: sq_errorstring.cpp:43 +msgid "Editing process is not finished yet" +msgstr "Процес редагування ще не завершено" + +#: sq_selectdeselectgroup.cpp:83 +msgid "Filename or mask:" +msgstr "Назва файла або маска:" + +#: sidebar/sq_treeview.cpp:89 +msgid "root" +msgstr "корінь" + +#: sidebar/sq_categoriesview.cpp:95 ksquirrel.cpp:512 +msgid "Categories" +msgstr "Категорії" + +#: sidebar/sq_categoriesview.cpp:115 sidebar/sq_categoriesview.cpp:166 +msgid "New category" +msgstr "Створити категорію" + +#: sidebar/sq_categoriesview.cpp:153 sidebar/sq_categoriesview.cpp:218 +msgid "New Category" +msgstr "Нова категорія" + +#: sidebar/sq_categoriesview.cpp:169 sidebar/sq_categoriesview.cpp:198 +msgid "Create default categories" +msgstr "Створити типові категорії" + +#: sidebar/sq_categoriesview.cpp:197 +msgid "" +"This will create default categories: Concerts, Pets, Home, Friends, Free time, " +"Travelling and Nature. Continue?" +msgstr "Таким чином буде створено типові категорії: Концерти, Тварини, Домівка, Друзі, Вільний час, Подорожі та Природа. Продовжувати?" + +#: sidebar/sq_categoriesview.cpp:218 +msgid "Create new category:" +msgstr "Створити нову категорію:" + +#: sidebar/sq_mountview.cpp:43 +msgid "Mount" +msgstr "Змонтувати" + +#: sidebar/sq_mountview.cpp:45 +msgid "Unmount" +msgstr "Розмонтувати" + +#: sidebar/sq_mountview.cpp:47 +msgid "Refresh" +msgstr "Оновити" + +#: sidebar/sq_mountview.cpp:170 +msgid "Device" +msgstr "Пристрій" + +#: sidebar/sq_mountview.cpp:173 +msgid "FS Type" +msgstr "Тип ФС" + +#: sidebar/sq_imagebasket.cpp:244 +msgid "Synchronize" +msgstr "Синхронізувати" + +#: sidebar/sq_previewwidget.cpp:60 +msgid "Background color..." +msgstr "Колір тла..." + +#: sidebar/sq_categorybrowsermenu.cpp:137 +#: sidebar/sq_categorybrowsermenu.cpp:146 +msgid "Failed to Read Folder" +msgstr "Не вдалося прочитати теку" + +#: sidebar/sq_categorybrowsermenu.cpp:154 +msgid "Not Authorized to Read Folder" +msgstr "Відсутні права на читання теки" + +#: sidebar/sq_categorybrowsermenu.cpp:167 +msgid "Add here" +msgstr "Додати тут" + +#: sidebar/sq_categorybrowsermenu.cpp:310 +msgid "More..." +msgstr "Більше..." + +#: sq_thumbnailcachemaster.cpp:143 +msgid "Thumbnail cache" +msgstr "Буфер мініатюр" + +#: sq_thumbnailcachemaster.cpp:144 +msgid "Calculate cache size on disk" +msgstr "Підрахувати розмір буфера на диску" + +#: sq_thumbnailcachemaster.cpp:146 +msgid "Clear cache on disk" +msgstr "Очистити буфер на диску" + +#: sq_thumbnailcachemaster.cpp:147 +msgid "View memory cache" +msgstr "Переглянути буфер пам'яті" + +#: sq_thumbnailcachemaster.cpp:148 +msgid "Clear cache in memory" +msgstr "Очистити буфер у пам'яті" + +#: sq_thumbnailcachemaster.cpp:150 +msgid "Sync cache to disk" +msgstr "Синхронізувати буфер на диску" + +#: sq_thumbnailcachemaster.cpp:151 +msgid "Calculate cache size in memory" +msgstr "Підрахувати розмір буфера у пам'яті" + +#: sq_diroperator.cpp:138 +msgid "remote filesystem" +msgstr "віддалена файлова система" + +#: sq_diroperator.cpp:158 +msgid "" +"
    Mount point:%1
    Total size:%" +"2
    Used:%3
    Available:%4
    " +msgstr "" +"
    Точка монтування:%1
    Загальний об'єм:%" +"2
    Використано:%3
    Доступно:%4
    " + +#: sq_diroperator.cpp:245 +msgid "no files selected" +msgstr "не обрано файлів" + +#: sq_diroperator.cpp:306 +msgid "Edit file type" +msgstr "Редагувати тип файла" + +#: sq_diroperator.cpp:307 +msgid "Add to Basket" +msgstr "Додати до кошика" + +#: sq_diroperator.cpp:309 sq_diroperator.cpp:889 +msgid "File actions" +msgstr "Дії з файлом" + +#: sq_diroperator.cpp:327 +msgid "Copy to..." +msgstr "Копіювати до..." + +#: sq_diroperator.cpp:328 +msgid "Move to..." +msgstr "Пересунути до..." + +#: sq_diroperator.cpp:329 +msgid "Link to..." +msgstr "Посилання на..." + +#: sq_diroperator.cpp:331 +msgid "Run" +msgstr "Запуск" + +#: sq_diroperator.cpp:333 +msgid "Recreate selected thumbnails" +msgstr "Створити знову обрані піктограми" + +#: sq_diroperator.cpp:336 +msgid "Convert..." +msgstr "Перетворення..." + +#: sq_diroperator.cpp:439 +msgid "Total %1 in %2 (%3, %4)" +msgstr "Загалом %1 у %2 (%3, %4)" + +#: sq_diroperator.cpp:441 +msgid "1 item" +msgstr "1 елемент" + +#: sq_diroperator.cpp:442 +msgid "1 folder" +msgstr "1 тека" + +#: sq_diroperator.cpp:443 +msgid "1 file" +msgstr "1 файл" + +#: sq_diroperator.cpp:627 +#, c-format +msgid "Command cannot contain both \"%f\" and \"%F\"" +msgstr "Команда не може одночасно містити \"%f\" та \"%F\"" + +#: sq_diroperator.cpp:627 sq_diroperator.cpp:632 +msgid "Error processing command" +msgstr "Помилка під час виконання команди" + +#: sq_diroperator.cpp:632 +#, c-format +msgid "Command should contain \"%f\" or \"%F\"" +msgstr "команда має містити \"%f\" або \"%F\"" + +#: sq_diroperator.cpp:741 +msgid "Unsupported format \"%1\"" +msgstr "Непідтримуваний формат \"%1\"" + +#: sq_diroperator.cpp:886 +msgid "Add to &Category" +msgstr "Додати до &Категорії" + +#: sq_diroperator.cpp:890 +msgid "&External tools" +msgstr "&Зовнішні інструменти" + +#: sq_slideshowwidget.cpp:345 +msgid "" +"
    Enter, Escape, Returnstop " +"slideshow
    Pause, Spacepause/unpause " +"slideshow
    Page Upprevious image
    Page Downnext image
    Mshow/hide onscreen messages
    " +msgstr "" +"
    Enter, Escape, Returnприпинити показ слайдів
    Pause, Spaceзупинити/поновити показ слайдів
    Page Upпопереднє зображення
    Page Downнаступне зображення
    Mпоказувати/не показувати екранні повідомлення
    " + +#: sq_codecsettingsskeleton.ui.h:28 +msgid "" +"Error loading widget from %1. Please check your installation or " +"contact ksquirrel.iv@gmail.com" +msgstr "Помилка під час завантаження віджета з %1. Будь ласка, перевірте встановлене або напишіть про помилку за адресою ksquirrel.iv@gmail.com" + +#: sq_widgetstack.cpp:473 sq_widgetstack.cpp:507 +msgid "No files to copy or move" +msgstr "Відсутні файли для копіювання чи пересування" + +#: sq_widgetstack.cpp:607 +msgid "Select a group of files" +msgstr "Обрати групу файлів" + +#: sq_widgetstack.cpp:607 +msgid "Deselect a group of files" +msgstr "Скасувати вибір групи файлів" + +#: sq_widgetstack.cpp:608 +msgid "Select!" +msgstr "Обрати!" + +#: sq_widgetstack.cpp:608 +msgid "Deselect!" +msgstr "Скасувати вибір!" + +#: sq_filethumbview.cpp:370 +msgid "" +"%3%4" +msgstr "" +"
    File:%1
    Size:%2
    %3%4" + +#: sq_filethumbview.cpp:373 +msgid "" +msgstr "" + +#: imageedit/sq_writeoption.cpp:108 +msgid "RLE compression" +msgstr "Стиснення RLE" + +#: imageedit/sq_writeoption.cpp:109 +msgid "Compression level" +msgstr "Рівень стиснення" + +#: imageedit/sq_writeoption.cpp:110 +msgid "Interlaced" +msgstr "Черезрядкове" + +#: imageedit/sq_writeoption.cpp:112 +msgid "No special options available for this format" +msgstr "Для цього формату відсутні особливі параметри" + +#: imageedit/sq_converter.cpp:47 +msgid "internal error" +msgstr "внутрішня помилка" + +#: imageedit/sq_converter.cpp:48 +msgid "failed" +msgstr "не вдалося" + +#: imageedit/sq_converter.cpp:50 +msgid "Converting" +msgstr "Перетворення" + +#: imageedit/sq_converter.cpp:68 +msgid "Select files to edit" +msgstr "Оберіть файли для редагування" + +#: imageedit/sq_converter.cpp:73 +msgid "" +"Converter cannot work with remote files.\n" +"Sorry" +msgstr "" +"Конвертер не може працювати з нелокальними файлами.\n" +"Вибачте" + +#: imageedit/sq_converter.cpp:160 +msgid "Temporary file creation failed" +msgstr "Створення тимчасового файла зазнало невдачі" + +#: imageedit/sq_converter.cpp:243 sq_imageproperties.ui.h:72 +msgid "1 error" +msgstr "1 помилка" + +#: imageedit/sq_converter.cpp:250 +msgid "Removing" +msgstr "Вилучення" + +#: imageedit/sq_converter.cpp:436 +msgid "Convert 1 file" +msgstr "Перетворити 1 файл" + +#: imageedit/sq_imageeditoptions.cpp:134 +msgid "Edit options" +msgstr "Редагувати параметри" + +#: imageedit/sq_imageeditoptions.cpp:135 +msgid "New files" +msgstr "Нові файли" + +#: imageedit/sq_imageeditoptions.cpp:136 +msgid "Place here" +msgstr "Розмістити тут" + +#: imageedit/sq_imageeditoptions.cpp:137 +msgid "Replace original files" +msgstr "Замістити початкові файли" + +#: imageedit/sq_imageeditoptions.cpp:138 +msgid "Place files in current directory, renaming them if necessary" +msgstr "Розмістити файли у поточній теці, перейменувавши їх у разі потреби" + +#: imageedit/sq_imageeditoptions.cpp:139 +msgid "Place files in current directory, replacing existing files" +msgstr "Розмістити файли у поточній теці, замінивши існуючі файли" + +#: imageedit/sq_imageeditoptions.cpp:140 +msgid "Close, when all operations succeeded" +msgstr "Закрити після виконання всіх операцій" + +#: imageedit/sq_imagebcg.ui.h:17 imageedit/sq_imagebcg.ui.h:31 +#: imageedit/sq_imagebcg.cpp:382 +msgid "Brightness" +msgstr "Яскравість" + +#: imageedit/sq_imagebcg.ui.h:18 imageedit/sq_imagebcg.ui.h:31 +#: imageedit/sq_imagebcg.cpp:383 +msgid "Contrast" +msgstr "Контраст" + +#: imageedit/sq_imagebcg.ui.h:19 imageedit/sq_imagebcg.ui.h:31 +#: imageedit/sq_imagebcg.cpp:384 +msgid "Gamma" +msgstr "Гама" + +#: imageedit/sq_imagebcg.ui.h:20 imageedit/sq_imagebcg.ui.h:32 +#: imageedit/sq_imagebcg.cpp:390 +msgid "Red" +msgstr "Червоний" + +#: imageedit/sq_imagebcg.ui.h:20 +msgid "Cyan" +msgstr "Блакитний" + +#: imageedit/sq_imagebcg.ui.h:21 imageedit/sq_imagebcg.ui.h:32 +#: imageedit/sq_imagebcg.cpp:389 +msgid "Green" +msgstr "Зелений" + +#: imageedit/sq_imagebcg.ui.h:21 +msgid "Magenta" +msgstr "Малиновий" + +#: imageedit/sq_imagebcg.ui.h:22 imageedit/sq_imagebcg.ui.h:32 +#: imageedit/sq_imagebcg.cpp:388 +msgid "Blue" +msgstr "Синій" + +#: imageedit/sq_imagebcg.ui.h:22 +msgid "Yellow" +msgstr "Жовтий" + +#: imageedit/sq_imagefilter.cpp:473 imageedit/sq_imagefilter.cpp:539 +msgid "Filter" +msgstr "Фільтр" + +#: imageedit/sq_imagefilter.cpp:474 imageedit/sq_imagefilter.cpp:486 +msgid "Color:" +msgstr "Колір:" + +#: imageedit/sq_imagefilter.cpp:476 +msgid "Opacity" +msgstr "Непрозорість" + +#: imageedit/sq_imagefilter.cpp:477 imageedit/sq_imagefilter.cpp:482 +#: imageedit/sq_imagefilter.cpp:505 +msgid "Sigma" +msgstr "Сигма" + +#: imageedit/sq_imagefilter.cpp:478 imageedit/sq_imagefilter.cpp:481 +#: imageedit/sq_imagefilter.cpp:483 imageedit/sq_imagefilter.cpp:501 +#: imageedit/sq_imagefilter.cpp:506 +msgid "Radius" +msgstr "Радіус" + +#: imageedit/sq_imagefilter.cpp:479 imageedit/sq_imagefilter.cpp:492 +#: imageedit/sq_imagefilter.cpp:507 +msgid "Factor" +msgstr "Множник" + +#: imageedit/sq_imagefilter.cpp:480 imageedit/sq_imagefilter.cpp:484 +#: imageedit/sq_imagefilter.cpp:493 imageedit/sq_imagefilter.cpp:514 +msgid "" +"There are no special options available for this filter. Just click \"Filter" +"\"." +msgstr "" +"Для цього фільтра не існує особливих параметрів. Просто натисніть \"Фільтрувати" +"\"." + +#: imageedit/sq_imagefilter.cpp:490 +msgid "Color 1:" +msgstr "Колір 1:" + +#: imageedit/sq_imagefilter.cpp:491 +msgid "Color 2:" +msgstr "Колір 2:" + +#: imageedit/sq_imagefilter.cpp:494 +msgid "Noise type" +msgstr "Тип шуму" + +#: imageedit/sq_imagefilter.cpp:495 +msgid "Uniform" +msgstr "Однорідний" + +#: imageedit/sq_imagefilter.cpp:496 +msgid "Impulse" +msgstr "Імпульсний" + +#: imageedit/sq_imagefilter.cpp:497 +msgid "Multiplicative Gaussian" +msgstr "Багаторазове гаусове" + +#: imageedit/sq_imagefilter.cpp:498 +msgid "Poisson" +msgstr "Пуассона" + +#: imageedit/sq_imagefilter.cpp:499 +msgid "Gaussian" +msgstr "Гаусове" + +#: imageedit/sq_imagefilter.cpp:500 +msgid "Laplacian" +msgstr "Лапласа" + +#: imageedit/sq_imagefilter.cpp:502 +msgid "Color" +msgstr "Колір" + +#: imageedit/sq_imagefilter.cpp:503 +msgid "Elevation" +msgstr "Сходження" + +#: imageedit/sq_imagefilter.cpp:504 +msgid "Azimuth" +msgstr "Азимут" + +#: imageedit/sq_imagefilter.cpp:508 +msgid "Amount" +msgstr "Величина" + +#: imageedit/sq_imagefilter.cpp:509 +msgid "Type" +msgstr "Тип" + +#: imageedit/sq_imagefilter.cpp:510 +msgid "GBR" +msgstr "GBR" + +#: imageedit/sq_imagefilter.cpp:511 +msgid "BRG" +msgstr "BRG" + +#: imageedit/sq_imagefilter.cpp:512 +msgid "Degrees" +msgstr "Градусів" + +#: imageedit/sq_imagefilter.cpp:513 imageedit/sq_imagefilter.cpp:515 +#: imageedit/sq_imagefilter.cpp:536 +msgid "Threshold" +msgstr "Поріг" + +#: imageedit/sq_imagefilter.cpp:517 +msgid "Blend" +msgstr "Змішування" + +#: imageedit/sq_imagefilter.cpp:518 +msgid "Blur" +msgstr "Розмиття" + +#: imageedit/sq_imagefilter.cpp:519 +msgid "Desaturate" +msgstr "Зменшити насиченість" + +#: imageedit/sq_imagefilter.cpp:520 +msgid "Despeckle" +msgstr "Очистити від сміття" + +#: imageedit/sq_imagefilter.cpp:521 +msgid "Edge" +msgstr "Край" + +#: imageedit/sq_imagefilter.cpp:522 +msgid "Emboss" +msgstr "Рельєф" + +#: imageedit/sq_imagefilter.cpp:523 +msgid "Equalize" +msgstr "Вирівнювання" + +#: imageedit/sq_imagefilter.cpp:524 +msgid "Fade" +msgstr "Зробити тьмянішим" + +#: imageedit/sq_imagefilter.cpp:525 +msgid "Flatten" +msgstr "Згладжування" + +#: imageedit/sq_imagefilter.cpp:526 +msgid "Implode" +msgstr "Концентрація" + +#: imageedit/sq_imagefilter.cpp:527 +msgid "Negative" +msgstr "Негатив" + +#: imageedit/sq_imagefilter.cpp:528 +msgid "Noise" +msgstr "Шум" + +#: imageedit/sq_imagefilter.cpp:529 +msgid "Oil" +msgstr "Масло" + +#: imageedit/sq_imagefilter.cpp:530 +msgid "Shade" +msgstr "Тінь" + +#: imageedit/sq_imagefilter.cpp:531 +msgid "Sharpen" +msgstr "Різкість" + +#: imageedit/sq_imagefilter.cpp:532 +msgid "Solarize" +msgstr "Вигоряння" + +#: imageedit/sq_imagefilter.cpp:533 +msgid "Spread" +msgstr "Поширення" + +#: imageedit/sq_imagefilter.cpp:534 +msgid "Swap colors" +msgstr "Зміна кольорів" + +#: imageedit/sq_imagefilter.cpp:535 +msgid "Swirl" +msgstr "Вихор" + +#: imageedit/sq_imagefilter.cpp:537 +msgid "Grayscale" +msgstr "Відтінки сірого" + +#: imageedit/sq_imagefilter.cpp:538 +msgid "Redeye" +msgstr "Червоні очі" + +#: imageedit/sq_imagefilter.cpp:541 +msgid "Image after filtering:" +msgstr "Зображення після фільтрування:" + +#: imageedit/sq_imagefilter.cpp:542 imageedit/sq_imagebcg.cpp:397 +msgid "Original image:" +msgstr "Початкове зображення:" + +#: imageedit/sq_imagebcg.cpp:378 +msgid "Color balance" +msgstr "Баланс кольорів" + +#: imageedit/sq_imagebcg.cpp:394 +msgid "Colorize" +msgstr "Розфарбувати" + +#: imageedit/sq_imagebcg.cpp:396 +msgid "Image after colorizing:" +msgstr "Зображення після розфарбовування:" + +#: imageedit/sq_imageconvert.cpp:167 +msgid "Convert" +msgstr "Перетворити" + +#: imageedit/sq_imageconvert.cpp:172 +msgid "Conversion options" +msgstr "Параметри перетворення" + +#: sq_viewcache.cpp:49 sq_viewcache.cpp:107 +msgid "Parameters" +msgstr "Параметри" + +#: sq_viewcache.cpp:103 +msgid "Memory cache" +msgstr "Буфер у пам'яті" + +#: sq_viewcache.cpp:108 +msgid "Total:" +msgstr "Загалом:" + +#: sq_imageproperties.ui.h:29 +msgid "Copy entry" +msgstr "Копіювати елемент" + +#: sq_imageproperties.ui.h:30 +msgid "Copy all entries" +msgstr "Копіювати всі елементи" + +#: sq_imageproperties.ui.h:95 +msgid "EXIF" +msgstr "EXIF" + +#: sq_imageproperties.ui.h:105 +msgid "Simple" +msgstr "Простий" + +#: sq_imageproperties.ui.h:108 +msgid "Full" +msgstr "Повний" + +#: sq_imageproperties.ui.h:127 +msgid "EXIF (no)" +msgstr "EXIF (відсутнє)" + +#: sq_imageproperties.ui.h:177 +msgid "Metadata (no)" +msgstr "Метадані (відсутні)" + +#: _translatorinfo.cpp:1 +msgid "" +"_: NAME OF TRANSLATORS\n" +"Your names" +msgstr "Юрій Чорноіван" + +#: _translatorinfo.cpp:3 +msgid "" +"_: EMAIL OF TRANSLATORS\n" +"Your emails" +msgstr "yurchor@ukr.net" + +#: sq_glwidget.cpp:233 +msgid "Rectangle" +msgstr "Прямокутник" + +#: sq_glwidget.cpp:234 +msgid "Ellipse" +msgstr "Еліпс" + +#: sq_glwidget.cpp:239 +msgid "Fit width" +msgstr "Підібрати ширину" + +#: sq_glwidget.cpp:240 +msgid "Fit height" +msgstr "Підібрати висоту" + +#: sq_glwidget.cpp:241 +msgid "Fit image" +msgstr "Підібрати по зображенню" + +#: sq_glwidget.cpp:242 +msgid "Zoom 100%" +msgstr "Масштаб 100%" + +#: sq_glwidget.cpp:243 +msgid "Leave previous zoom" +msgstr "Залишити попередній масштаб" + +#: sq_glwidget.cpp:244 +msgid "Ignore, if image is smaller than window" +msgstr "Нічого не робити, якщо зображення менше за вікно" + +#: sq_glwidget.cpp:318 +msgid "Go to first image" +msgstr "Перейти до першого зображення" + +#: sq_glwidget.cpp:319 +msgid "Previous image" +msgstr "Попереднє зображення" + +#: sq_glwidget.cpp:321 +msgid "Next image" +msgstr "Наступне зображення" + +#: sq_glwidget.cpp:323 +msgid "Go to last image" +msgstr "Перейти до останнього зображення" + +#: sq_glwidget.cpp:326 sq_glwidget.cpp:2685 +msgid "Zoom +" +msgstr "Збільшити" + +#: sq_glwidget.cpp:328 sq_glwidget.cpp:2686 +msgid "Zoom -" +msgstr "Зменшити" + +#: sq_glwidget.cpp:332 sq_glwidget.cpp:2677 +msgid "Rotate left" +msgstr "Повернути ліворуч" + +#: sq_glwidget.cpp:334 sq_glwidget.cpp:2678 +msgid "Rotate right" +msgstr "Повернути праворуч" + +#: sq_glwidget.cpp:336 sq_glwidget.cpp:2707 +msgid "Flip vertically" +msgstr "Віддзеркалити вертикально" + +#: sq_glwidget.cpp:338 sq_glwidget.cpp:2708 +msgid "Flip horizontally" +msgstr "Віддзеркалити горизонтально" + +#: sq_glwidget.cpp:340 +msgid "Normalize" +msgstr "Нормалізувати" + +#: sq_glwidget.cpp:342 sq_glwidget.cpp:2723 +msgid "Fullscreen" +msgstr "На повний екран" + +#: sq_glwidget.cpp:344 +msgid "Select image" +msgstr "Обрати зображення" + +#: sq_glwidget.cpp:346 +msgid "Selection" +msgstr "Вибір" + +#: sq_glwidget.cpp:348 sq_glwidget.cpp:2717 sq_codecsettingsskeleton.cpp:128 +msgid "Codec settings" +msgstr "Параметри кодека" + +#: sq_glwidget.cpp:351 +msgid "Show navigator" +msgstr "Показати навігатор" + +#: sq_glwidget.cpp:1024 +msgid "yes" +msgstr "так" + +#: sq_glwidget.cpp:1024 +msgid "no" +msgstr "ні" + +#: sq_glwidget.cpp:1485 +msgid "Codec for %1 format not found" +msgstr "Кодек для формату %1 не знайдено" + +#: sq_glwidget.cpp:1729 +msgid "Memory allocation failed for %1 of memory" +msgstr "Помилка під час виділення %1 пам'яті" + +#: sq_glwidget.cpp:1741 +msgid "Memory allocation failed" +msgstr "Помилка під час виділення пам'яті" + +#: sq_glwidget.cpp:1747 +msgid "Decoding failed" +msgstr "Помилка декодування" + +#: sq_glwidget.cpp:1849 +msgid " ms." +msgstr " мс." + +#: sq_glwidget.cpp:2363 +msgid "" +"Sorry, could not perform write operation\n" +"for codec \"%1\"" +msgstr "" +"Вибачте, операцію запису неможливо виконати\n" +"для кодека \"%1\"" + +#: sq_glwidget.cpp:2382 sq_glwidget.cpp:2390 sq_glwidget.cpp:2412 +msgid "Error writing image" +msgstr "Помилка під час запису зображення" + +#: sq_glwidget.cpp:2433 +msgid "Try another location?" +msgstr "Спробувати інше розташування?" + +#: sq_glwidget.cpp:2658 +msgid "Rotate" +msgstr "Повернути" + +#: sq_glwidget.cpp:2661 sq_options.cpp:803 +msgid "Window" +msgstr "Вікно" + +#: sq_glwidget.cpp:2670 +msgid "Next" +msgstr "Наступна" + +#: sq_glwidget.cpp:2671 +msgid "Previous" +msgstr "Попередня" + +#: sq_glwidget.cpp:2672 +msgid "First" +msgstr "Перше" + +#: sq_glwidget.cpp:2673 +msgid "Last" +msgstr "Останнє" + +#: sq_glwidget.cpp:2680 +msgid "Rotate 180'" +msgstr "Повернути на 180'" + +#: sq_glwidget.cpp:2682 +msgid "Rotate 1' left" +msgstr "Повернути на 1' ліворуч" + +#: sq_glwidget.cpp:2683 +msgid "Rotate 1' right" +msgstr "Повернути на 1' праворуч" + +#: sq_glwidget.cpp:2687 +msgid "Zoom 2x" +msgstr "Збільшити вдвічі" + +#: sq_glwidget.cpp:2688 +msgid "Zoom 1/2x" +msgstr "Зменшити вдвічі" + +#: sq_glwidget.cpp:2698 +msgid "Move left" +msgstr "Пересунути ліворуч" + +#: sq_glwidget.cpp:2699 +msgid "Move right" +msgstr "Пересунути праворуч" + +#: sq_glwidget.cpp:2700 +msgid "Move up" +msgstr "Пересунути догори" + +#: sq_glwidget.cpp:2701 +msgid "Move down" +msgstr "Пересунути донизу" + +#: sq_glwidget.cpp:2703 +msgid "Start/stop animation" +msgstr "Почати/зупинити анімацію" + +#: sq_glwidget.cpp:2704 +msgid "Hide/show background" +msgstr "Сховати/показати тло" + +#: sq_glwidget.cpp:2705 +msgid "Hide/show tickmarks" +msgstr "Сховати/показати хрести" + +#: sq_glwidget.cpp:2710 +msgid "First page" +msgstr "Перша сторінка" + +#: sq_glwidget.cpp:2711 +msgid "Previous page" +msgstr "Попередня сторінка" + +#: sq_glwidget.cpp:2712 +msgid "Next page" +msgstr "Наступна сторінка" + +#: sq_glwidget.cpp:2713 +msgid "Last page" +msgstr "Остання сторінка" + +#: sq_glwidget.cpp:2715 +msgid "To clipboard" +msgstr "До буфера" + +#: sq_glwidget.cpp:2720 +msgid "Color balance..." +msgstr "Баланс кольорів..." + +#: sq_glwidget.cpp:2721 +msgid "Apply filter..." +msgstr "Застосувати фільтр..." + +#: sq_glwidget.cpp:2724 +msgid "Hide/show toolbar" +msgstr "Сховати/показати панель інструментів" + +#: sq_glwidget.cpp:2725 +msgid "Hide/show statusbar" +msgstr "Сховати/показати панель статусу" + +#: sq_glwidget.cpp:2728 +msgid "Reset" +msgstr "Повернутися до попереднього" + +#: sq_glwidget.cpp:2731 sq_helpwidget.cpp:174 +msgid "Hotkeys" +msgstr "Гарячі клавіші" + +#: sq_glview.cpp:84 +msgid "Loading time" +msgstr "Час завантаження" + +#: sq_options.cpp:746 +msgid "The main options" +msgstr "Головні параметри" + +#: sq_options.cpp:748 +msgid "Write configuration file to disk, when I press \"OK\"" +msgstr "Записати файл конфігурації на диск, коли я натисну \"Гаразд\"" + +#: sq_options.cpp:749 +msgid "Minimize to tray after closing" +msgstr "Мінімізувати до лотка після закриття" + +#: sq_options.cpp:750 +msgid "Show splash screen at startup" +msgstr "Показувати вікно привітання на початку" + +#: sq_options.cpp:751 +msgid "Don't show animated logo in toolbar" +msgstr "Не показувати живий логотип на панелі інструментів" + +#: sq_options.cpp:752 +msgid "Apply codec settings to" +msgstr "Застосувати налаштування кодека до" + +#: sq_options.cpp:753 +msgid "Thumbnail loader" +msgstr "Завантажувач мініатюр" + +#: sq_options.cpp:754 +msgid "Image viewer (also preview window)" +msgstr "Переглядач зображення (також вікно попереднього перегляду)" + +#: sq_options.cpp:755 sq_options.cpp:773 +msgid "Both" +msgstr "Обидва" + +#: sq_options.cpp:756 +msgid "RunTime" +msgstr "RunTime" + +#: sq_options.cpp:757 +msgid "Treat unknown mime types as unsupported" +msgstr "Вважати невідомі mime типи непідтримуваними" + +#: sq_options.cpp:758 +msgid "Load KIPI plugins on demand (for slow machines)" +msgstr "Завантажувати додатки KIPI лише за потреби (для слабких машин)" + +#: sq_options.cpp:759 +msgid "Disk navigator" +msgstr "Дисковий навігатор" + +#: sq_options.cpp:760 +msgid "On starting open..." +msgstr "Після запуску відкрити..." + +#: sq_options.cpp:762 +msgid "Custom directory:" +msgstr "Нетипову теку:" + +#: sq_options.cpp:763 +msgid "Last visited directory" +msgstr "Останню відвідану теку" + +#: sq_options.cpp:764 +msgid "Current directory, where KSquirrel starts" +msgstr "Поточну теку, де запущено KSquirrel" + +#: sq_options.cpp:765 +msgid "Run unknown file formats separately (with default application)" +msgstr "Виконувати дію для невідомого формату файлів окремо (за допомогою типової програми)" + +#: sq_options.cpp:767 +msgid "Save history" +msgstr "Зберегти журнал" + +#: sq_options.cpp:768 +msgid "Jump into archives" +msgstr "Відкривати архіви" + +#: sq_options.cpp:769 +msgid "Jump to first image" +msgstr "Перейти до першого зображення" + +#: sq_options.cpp:770 +msgid "Don't show directories" +msgstr "Не показувати теки" + +#: sq_options.cpp:771 +msgid "Main" +msgstr "Головне" + +#: sq_options.cpp:772 +msgid "Synchronization" +msgstr "Синхронізація" + +#: sq_options.cpp:774 +msgid "Tree -> Navigator" +msgstr "Дерево -> Навігатор" + +#: sq_options.cpp:775 +msgid "Tree <- Navigator" +msgstr "Ієрархія <- Навігатор" + +#: sq_options.cpp:776 +msgid "Clicking" +msgstr "Клацання" + +#: sq_options.cpp:777 +msgid "Thumbnails" +msgstr "Піктограми" + +#: sq_options.cpp:779 +msgid "Do not write thumbnails on disk" +msgstr "Не записувати піктограми на диск" + +#: sq_options.cpp:780 +msgid "Show tooltips with file information" +msgstr "Показувати підказки з інформацією про файл" + +#: sq_options.cpp:781 +msgid "Margin between thumbnails" +msgstr "Поле між мініатюрами" + +#: sq_options.cpp:782 sq_options.cpp:815 +msgid " pixels" +msgstr " пікселів" + +#: sq_options.cpp:783 +msgid "Don't show tooltips when the main window is inactive" +msgstr "Не показувати підказок, якщо головне вікно неактивне" + +#: sq_options.cpp:784 +msgid "Mark supported image formats with clock icon (slow)" +msgstr "Позначати підтримувані формати зображень піктограмою годинника (повільно)" + +#: sq_options.cpp:785 +msgid "Maximum cache size (in memory)" +msgstr "Максимальний розмір буфера (у пам'яті)" + +#: sq_options.cpp:786 +msgid " Kb" +msgstr " Кб" + +#: sq_options.cpp:787 +msgid "No cache" +msgstr "Без буферу" + +#: sq_options.cpp:788 +msgid "On scroll event" +msgstr "Подія при прокручуванні" + +#: sq_options.cpp:789 +msgid "Zoom the scene" +msgstr "Масштабувати сцену" + +#: sq_options.cpp:790 +msgid "Load next/previous file" +msgstr "Завантажити наступний/попередній файл" + +#: sq_options.cpp:791 +msgid "Background" +msgstr "Тло" + +#: sq_options.cpp:792 +msgid "Custom texture" +msgstr "Нетипова текстура" + +#: sq_options.cpp:793 +msgid "Custom color" +msgstr "Нетиповий колір" + +#: sq_options.cpp:794 +msgid "System color" +msgstr "Системний колір" + +#: sq_options.cpp:798 +msgid "Validate" +msgstr "Перевірити" + +#: sq_options.cpp:802 +msgid "Show images progressively" +msgstr "Показувати зображення поступально" + +#: sq_options.cpp:804 +msgid "Image pages" +msgstr "Сторінки зображення" + +#: sq_options.cpp:805 +msgid "Load all pages" +msgstr "Завантажити всі сторінки" + +#: sq_options.cpp:806 +msgid "Load only first page" +msgstr "Завантажити тільки першу сторінку" + +#: sq_options.cpp:807 +msgid "Load no more than" +msgstr "Завантажувати не більше ніж" + +#: sq_options.cpp:808 +msgid " pages" +msgstr " сторінок" + +#: sq_options.cpp:809 +msgid "Loader" +msgstr "Завантажувач" + +#: sq_options.cpp:810 +msgid "Draw tickmarks around the image" +msgstr "Малювати хрести навколо зображення" + +#: sq_options.cpp:811 +msgid "Draw background for transparent images" +msgstr "Малювати тло для прозорих зображень" + +#: sq_options.cpp:812 +msgid "Rotating" +msgstr "Поворот" + +#: sq_options.cpp:813 +msgid " degrees" +msgstr " градусів" + +#: sq_options.cpp:814 sq_helpwidget.cpp:183 +msgid "Moving" +msgstr "Пересування" + +#: sq_options.cpp:817 +msgid "Zoom limit" +msgstr "Обмеження масштабу" + +#: sq_options.cpp:818 +msgid "Minimum: 1%, maximum: 10,000%" +msgstr "Мінімум: 1%, максимум: 10,000%" + +#: sq_options.cpp:819 +msgid "Custom" +msgstr "Нетипове" + +#: sq_options.cpp:821 +msgid "minimum" +msgstr "мінімум" + +#: sq_options.cpp:822 sq_options.cpp:824 +msgid " %" +msgstr " %" + +#: sq_options.cpp:823 +msgid "maximum" +msgstr "Максимальний" + +#: sq_options.cpp:825 +msgid "No limit" +msgstr "Не обмежувати" + +#: sq_options.cpp:826 +msgid "Zoom coefficient" +msgstr "Коефіцієнт зміни масштабу" + +#: sq_options.cpp:827 +msgid "%" +msgstr "%" + +#: sq_options.cpp:828 +msgid "None" +msgstr "Відсутнє" + +#: sq_options.cpp:830 +msgid "Customize OpenGL widget" +msgstr "Налаштувати OpenGL widget" + +#: sq_options.cpp:831 +msgid "Recursion" +msgstr "Рекурсія" + +#: sq_options.cpp:832 +msgid "No recursion" +msgstr "Без рекурсії" + +#: sq_options.cpp:833 +msgid "Show number of files" +msgstr "Показати кількість файлів" + +#: sq_options.cpp:834 +msgid "Show number of subfolders and files" +msgstr "Показати кількість підтек та файлів" + +#: sq_options.cpp:835 +msgid "Show number of subfolders" +msgstr "Показати кількість підтек" + +#: sq_options.cpp:836 +msgid "Treeview" +msgstr "Ієрархічний показ" + +#: sq_options.cpp:837 +msgid "Show device path" +msgstr "Показувати шлях на пристрою" + +#: sq_options.cpp:838 +msgid "Show mount options" +msgstr "Показати точки монтування" + +#: sq_options.cpp:839 +msgid "Show filesystem type" +msgstr "Показати тип файлової системи" + +#: sq_options.cpp:840 +msgid "Mount view" +msgstr "Перегляд точок монтування" + +#: sq_options.cpp:841 +msgid "Enable preview window" +msgstr "Дозволити вікно попереднього перегляду" + +#: sq_options.cpp:843 +msgid "Delay before image loading" +msgstr "Затримка перед завантаженням зображення" + +#: sq_options.cpp:844 sq_slideshow.cpp:218 +msgid " ms" +msgstr " мс" + +#: sq_options.cpp:845 +msgid "Background color for preview widget:" +msgstr "Колір тла для віджета попереднього перегляду:" + +#: sq_options.cpp:847 +msgid "Don't load preview image on file execution" +msgstr "Не завантажувати зображення для попереднього перегляду під час виконання файла" + +#: sq_options.cpp:848 +msgid "Disables loading preview image when user launches image with mouse" +msgstr "Забороняє завантаження зображення попереднього перегляду, якщо користувач запустив зображення мишкою" + +#: sq_options.cpp:849 +msgid "Image preview" +msgstr "Попередні перегляд зображення" + +#: sq_options.cpp:850 +msgid "Sidebar settings" +msgstr "Налаштування бічної панелі" + +#: sq_options.cpp:851 +msgid "KIPI Configuration" +msgstr "Налаштування KIPI" + +#: sq_slideshow.cpp:205 +msgid "Slideshow options" +msgstr "Параметри показу слайдів" + +#: sq_slideshow.cpp:206 +msgid "Start" +msgstr "Запуск" + +#: sq_slideshow.cpp:209 +msgid "Set directory to current" +msgstr "Зробити теку поточною" + +#: sq_slideshow.cpp:210 +msgid "Last visited directories" +msgstr "Останні відвідані теки" + +#: sq_slideshow.cpp:220 +msgid "Repeats:" +msgstr "Повторень:" + +#: sq_slideshow.cpp:221 +msgid "Background color:" +msgstr "Колір тла:" + +#: sq_slideshow.cpp:222 +msgid "Onscreen messages" +msgstr "Екранні повідомлення" + +#: sq_slideshow.cpp:223 +msgid "Show current index" +msgstr "Показати поточний покажчик" + +#: sq_slideshow.cpp:224 +msgid "Show file name" +msgstr "Показати назву файла" + +#: sq_slideshow.cpp:225 +msgid "Show file size" +msgstr "Показати розмір файла" + +#: sq_slideshow.cpp:226 +msgid "Recursively" +msgstr "Рекурсивно" + +#: ksquirrel.cpp:288 +msgid "Clear history" +msgstr "Очистити журнал" + +#: ksquirrel.cpp:289 +msgid "Clear address" +msgstr "Очистити адресу" + +#: ksquirrel.cpp:294 +msgid "Go!" +msgstr "Поїхали!" + +#: ksquirrel.cpp:341 +msgid "Libraries' filters" +msgstr "Фільтри бібліотек" + +#: ksquirrel.cpp:364 +msgid "All supported formats" +msgstr "Всі підтримувані формати" + +#: ksquirrel.cpp:374 +msgid "User's filters" +msgstr "Фільтри користувача" + +#: ksquirrel.cpp:510 +msgid "Folder tree" +msgstr "Дерево тек" + +#: ksquirrel.cpp:511 +msgid "Mount points" +msgstr "Точки монтування" + +#: ksquirrel.cpp:628 +msgid "&Navigator" +msgstr "&Навігатор" + +#: ksquirrel.cpp:630 +msgid "&Action" +msgstr "&Дія" + +#: ksquirrel.cpp:633 +msgid "&KIPI Plugins" +msgstr "Додатки &KIPI" + +#: ksquirrel.cpp:661 +msgid "Fi<er" +msgstr "Філь&тр" + +#: ksquirrel.cpp:720 +msgid "Thumbnail size" +msgstr "Розмір піктограми" + +#: ksquirrel.cpp:723 sq_options.ui.h:137 +msgid "Image window" +msgstr "Вікно зображення" + +#: ksquirrel.cpp:725 +msgid "Reload codecs from disk" +msgstr "Перезавантажити кодеки з диску" + +#: ksquirrel.cpp:726 +msgid "Configure external tools..." +msgstr "Налаштувати зовнішні інструменти..." + +#: ksquirrel.cpp:727 +msgid "Configure filters..." +msgstr "Налаштувати фільтри..." + +#: ksquirrel.cpp:728 +msgid "Go to tray" +msgstr "Згорнути у лоток" + +#: ksquirrel.cpp:729 +msgid "Open file and change directory" +msgstr "Відкрити файл та змінити теку" + +#: ksquirrel.cpp:730 +msgid "Open file" +msgstr "Відкрити файл" + +#: ksquirrel.cpp:731 +msgid "Thumbnail cache manager..." +msgstr "Керування буферу мініатюр..." + +#: ksquirrel.cpp:735 +msgid "List" +msgstr "Список" + +#: ksquirrel.cpp:736 +msgid "Icons" +msgstr "Значки" + +#: ksquirrel.cpp:737 +msgid "Details" +msgstr "Докладно" + +#: ksquirrel.cpp:738 sq_options.ui.h:136 +msgid "Thumbnails" +msgstr "Піктограми" + +#: ksquirrel.cpp:740 +msgid "Show URL box" +msgstr "Показати поле адреси" + +#: ksquirrel.cpp:742 +msgid "Built-in image window" +msgstr "Вбудоване віконечко зображення" + +#: ksquirrel.cpp:745 +msgid "Slideshow" +msgstr "Показ слайдів" + +#: ksquirrel.cpp:746 +msgid "Slideshow advanced" +msgstr "Розширений показ слайдів" + +#: ksquirrel.cpp:748 +msgid "Codec information..." +msgstr "Інформація про кодек..." + +#: ksquirrel.cpp:749 +msgid "OpenGL information..." +msgstr "Інформація про OpenGL..." + +#: ksquirrel.cpp:751 +msgid "Medium thumbnails" +msgstr "Середні піктограми" + +#: ksquirrel.cpp:752 +msgid "Large thumbnails" +msgstr "Великі піктограми" + +#: ksquirrel.cpp:753 +msgid "Huge thumbnails" +msgstr "Величезні піктограми" + +#: ksquirrel.cpp:755 +msgid "Select group" +msgstr "Обрати групу" + +#: ksquirrel.cpp:756 +msgid "Deselect group" +msgstr "Скасувати вибір групи" + +#: ksquirrel.cpp:776 +msgid "Extended thumbnails" +msgstr "Збільшені піктограми" + +#: ksquirrel.cpp:1085 +msgid " writing settings and thumbnails... " +msgstr " Налаштування запису та піктограм... " + +#: sq_filters.cpp:124 sq_filters.cpp:197 +msgid "Extensions" +msgstr "Розширення" + +#: sq_filters.cpp:181 +msgid "Adjust filters" +msgstr "Налаштувати фільтри" + +#: sq_filters.cpp:186 +msgid "New filter" +msgstr "Створити фільтр" + +#: sq_filters.cpp:193 +msgid "Move filter up" +msgstr "Перемістити фільтр вище" + +#: sq_filters.cpp:195 +msgid "Move filter down" +msgstr "Перемістити фільтр нижче" + +#: sq_filters.cpp:198 +msgid "Menu item contains both name and extension" +msgstr "Пункт меню містить назву і розширення" + +#: sq_helpwidget.cpp:175 +msgid "" +"

    Файл:%1
    Розмір:%2
    Link destination:%1
    Посилання на:%1
    " +"" +"" +"" +"" +"" +"

    Esc,X,Return

    close

    Middle click, F

    fullscreen

    Z

    show 'Zoom' menu

    /

    show this help

    Right click, M, " +"ContextMenu

    show context menu

    N

    toggle filter

    Shift + Left button

    select a region

    Shift + Left

    previous tab

    Shift + Right

    next tab

    W

    close tab

    " +msgstr "" +"

    " +"" +"" +"" +"" +"" +"

    Esc,X,Return

    закрити

    Клацання середньою, F

    на весь екран

    Z

    показати меню 'Масштабування'

    /

    показати цю довідку

    Клацання правою, M, " +"ContextMenu

    показати контекстне меню

    N

    перемкнути фільтр

    Shift + Клацання лівою

    обрати область

    Shift + Стрілка ліворуч

    попередня сторінка

    Shift + Стрілка праворуч

    наступна сторінка

    W

    закрити сторінку

    " + +#: sq_helpwidget.cpp:176 +msgid "" +"

    Space, Page Down

    next image

    Backspace, Page Up

    previous image

    Home

    first image

    End

    last image

    " +msgstr "" +"

    Space, Page Down

    наступне зображення

    Backspace, Page Up

    попереднє зображення

    Home

    перше зображення

    End

    останнє зображення

    " + +#: sq_helpwidget.cpp:177 +msgid "" +"

    " +msgstr "" +"

    Left, Right," +" Up, Down

    move the image

    Ctrl + Left

    rotate left

    Ctrl + Right

    rotate " +"right

    Ctrl + Up/Down

    rotate for 180 degrees up/down

    Alt + Left/Right

    rotate for 1 degree " +"left/right
    " + +#: sq_helpwidget.cpp:178 +msgid "" +"

    Ліворуч, Праворуч," +" Вгору, Вниз

    пересунути зображення

    Ctrl + Ліворуч

    повернути проти годинникової стрілки

    Ctrl + Праворуч

    повернути за годинниковою стрілку

    Ctrl + Вгору/Вниз

    повернути на 180 градусів вгору або вниз

    Alt + Ліворуч/Праворуч

    повернути на 1 градус " +"ліворуч/праворуч
    " +msgstr "" +"

    +/-

    zoom " +"Nx

    Ctrl + +/-

    zoom " +"2x/0.5x

    Scroll

    load next/" +"prev file OR zoom+/zoom-

    Shift + Scroll

    zoom+/zoom-

    Ctrl + Scroll

    zoom+ 2x/zoom- 2x

    1..9

    zoom 1..9x

    0

    zoom 10x

    comma

    fit " +"width

    period

    fit height

    *

    fit image
    " + +#: sq_helpwidget.cpp:179 +msgid "" +"

    +/-

    масштаб " +"Nx

    Ctrl + +/-

    масштаб " +"2x/0.5x

    Scroll

    завантажити наступний/попередній файл або збільшити/зменшити

    Shift + Scroll

    збільшити/зменшити

    Ctrl + Scroll

    збільшити/зменшити удвічі

    1..9

    збільшити у 1..9 разів

    0

    збільшити удесятеро

    кома

    підібрати ширину

    точка

    підібрати висоту

    *

    за розміром зображення
    " +"

    S

    save as

    V

    flip vertically

    H

    flip horizontally

    R

    reset

    P

    image properties

    C

    codec settings

    L

    ignore zoom if image is smaller than " +"window

    I

    menu with " +"images

    A

    stop/start " +"animation

    B

    toggle " +"drawing background for transparent images

    K

    toggle drawing tickmarks

    E

    show menu with external " +"tools

    Y

    crop

    F1

    first image in " +"multi-paged image

    F2

    previous

    F3

    next

    F4

    last
    " +msgstr "" +"

    S

    зберегти як

    V

    віддзеркалити вертикально

    H

    віддзеркалити горизонтально

    R

    відновити

    P

    властивості зображення

    C

    параметри кодека

    L

    ігнорувати зміну масштабу, якщо зображення менше за вікно

    I

    меню з зображеннями

    A

    зупинити/почати анімацію

    B

    перемкнути відображення тла для прозорих зображень

    K

    перемкнути відображення хрестів

    E

    показати меню з зовнішніми інструментами

    Y

    crop

    F1

    перше зображення у картинці з багатьма сторінками

    F2

    попереднє

    F3

    наступне

    F4

    останнє
    " + +#: sq_helpwidget.cpp:182 sq_options.ui.h:135 +msgid "Filing" +msgstr "Заповнення" + +#: sq_helpwidget.cpp:184 +msgid "Current image" +msgstr "Поточне зображення" + +#: sq_options.ui.h:138 +msgid "Sidebar" +msgstr "Бічна панель" + +#: sq_options.ui.h:141 +msgid "KIPI" +msgstr "KIPI" + +#: sq_options.ui.h:260 +msgid "Wrong dimensions: %1x%2." +msgstr "Некоректні виміри: %1x%2." + +#: sq_slideshowlisting.cpp:87 +msgid "Listing" +msgstr "Формування списку" + +#: ksquirrel.cpp:751 +msgid "Rename" +msgstr "Перейменувати" + +#: ksquirrel.cpp:1951 +msgid "Renaming File" +msgstr "Перейменування файла" + +#: ksquirrel.cpp:1952 +msgid "

    Rename file %1 to:

    " +msgstr "

    Перейменувати файл %1 на:

    " + +msgid "Calculate directory size" +msgstr "Обчислити розмір теки" + +msgid "New folder..." +msgstr "Створити теку..." + +msgid "Create Subfolder" +msgstr "Створити підтеку" + +msgid "

    Create new folder in %1:

    " +msgstr "

    Створити нову теку у %1:

    " + +msgid "Rename Folder" +msgstr "Перейменувати теку" + +msgid "

    Rename folder %1 to:

    " +msgstr "

    Перейменувати теку %1 на:

    " + +msgid "Are you sure you want to delete %1?" +msgstr "Ви справді бажаєте вилучити %1?" + +msgid "Copy to last folder" +msgstr "Копіювати до останньої теки" + +msgid "Move to last folder" +msgstr "Перейти до останньої теки" + +msgid "Message text color:" +msgstr "Колір тексту повідомлень:" + +msgid "Total" +msgstr "Загалом" + +msgid "Visualize drag operation" +msgstr "Візуалізація операції перетягування" + +msgid "Testing" +msgstr "Тестування" + +msgid "Lazy thumbnail generation" +msgstr "Ліниве створення мініатюр" + +msgid "Delay" +msgstr "Затримка" + +msgid "Interface" +msgstr "Інтерфейс" + +msgid "Number of text lines" +msgstr "Кількість текстових рядків" + +msgid "Show file preview" +msgstr "Показати попередній перегляд файла" + +msgid "Number of additionally generated rows" +msgstr "Кількість додатково створених рядків" + +msgid "Repeat (copy to %1)" +msgstr "Повторити (копіювати до %1)" + +msgid "Repeat (move to %1)" +msgstr "Повторити (перемістити до %1)" + +msgid "Repeat (link to %1)" +msgstr "Повторити (створити посилання у %1)" + +msgid "Repeat (nothing to repeat)" +msgstr "Повторити (дії відсутні)" + +msgid "Clear contents" +msgstr "Очистити вміст" + +msgid "Are you sure you want to delete contents of %1?" +msgstr "Ви справді бажаєте вилучити вміст %1?" + +msgid "Add to Folder Basket" +msgstr "Додати до кошика тек" + +msgid "Folder basket" +msgstr "Кошик тек" + +msgid "Change icon" +msgstr "Змінити піктограму" + +msgid "

    Rename item %1 to:

    " +msgstr "

    Перейменувати пункт %1 на:

    " + +msgid "Copy file path" +msgstr "Копіювати шлях до файла" + +msgid "Copy file url" +msgstr "Копіювати адресу файла" + +msgid "Text color:" +msgstr "Колір тексту:" + +msgid "Show image dimensions" +msgstr "Показати розміри зображення" + +msgid "Text color..." +msgstr "Колір тексту..." + +msgid "Double click" +msgstr "Подвійне клацання" + +msgid "Close window" +msgstr "Закрити вікно" + +msgid "Crop" +msgstr "Обрізати" + +msgid "Tabs" +msgstr "Сторінки" + +msgid "Enable tabs" +msgstr "Дозволити сторінки" + +msgid "Ask what to do when opening new image" +msgstr "Питати про наступні дії під час відкриття нового зображення" + +msgid "Show close buttons" +msgstr "Показати кнопки закриття" + +msgid "Open in a new tab" +msgstr "Відкрити на новій сторінці" + +msgid "Replace current tab" +msgstr "Замінити поточну сторінку" + +msgid "Close all and open in a new tab" +msgstr "Закрити всі і відкрити на новій сторінці" + +msgid "Opening..." +msgstr "Відкриття..." + +msgid "Previous tab" +msgstr "Попередня сторінка" + +msgid "Next tab" +msgstr "Наступна сторінка" + +msgid "Close tab" +msgstr "Закрити сторінку" + +msgid "Do nothing" +msgstr "Нічого не робити" + +msgid "Print available DCOP parameters" +msgstr "Показати доступні параметри DCOP" + +msgid "Downloading..." +msgstr "Завантаження..." + +msgid "Close all tabs" +msgstr "Закрити всі сторінки..." + +msgid "Close all opened images when closing window" +msgstr "" + +msgid "Select codecs to disable:" +msgstr "" + +msgid "Select codecs to enable:" +msgstr "" + +msgid "Codec manager..." +msgstr "" diff --git a/reconfigure b/reconfigure new file mode 100755 index 0000000..3127601 --- /dev/null +++ b/reconfigure @@ -0,0 +1,3 @@ +#!/bin/sh + +make -f Makefile.dist && ./configure.gnu \ No newline at end of file diff --git a/required-etch b/required-etch new file mode 100755 index 0000000..39e4747 --- /dev/null +++ b/required-etch @@ -0,0 +1,9 @@ +#!/bin/sh + +# +# Install required packages in Debian Etch +# +# Run this as root before ./configure.gnu +# + +aptitude install kde-devel libkexif1 libkexif1-dev kipi-plugins libkipi0 libkipi0-dev \ No newline at end of file diff --git a/stamp-h.in b/stamp-h.in new file mode 100644 index 0000000..e69de29 diff --git a/start b/start new file mode 100755 index 0000000..bfda1c4 --- /dev/null +++ b/start @@ -0,0 +1,6 @@ +#!/bin/sh + +tst=`cat ./ksquirrel/sq_version` +tst=`expr $tst + 1` +echo $tst > ./ksquirrel/sq_version +make $* diff --git a/subdirs b/subdirs new file mode 100644 index 0000000..a671acc --- /dev/null +++ b/subdirs @@ -0,0 +1,4 @@ +doc +ksquirrel +pics +po