summaryrefslogtreecommitdiffstats
path: root/katapult
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-02-03 02:45:19 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-02-03 02:45:19 +0000
commit4e1a5c3eebf50657629e2b4eba13649c2b599598 (patch)
tree7757743b67ed172d113dad73a3daa5b8aa6f871a /katapult
downloadkatapult-4e1a5c3eebf50657629e2b4eba13649c2b599598.tar.gz
katapult-4e1a5c3eebf50657629e2b4eba13649c2b599598.zip
Added abandoned KDE3 version of katapult
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/katapult@1084407 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'katapult')
-rw-r--r--katapult/COPYING-DOCS397
-rw-r--r--katapult/Doxyfile248
-rw-r--r--katapult/Makefile.am5
-rw-r--r--katapult/NEWS1
-rw-r--r--katapult/common/Makefile.am19
-rw-r--r--katapult/common/actionregistry.cpp64
-rw-r--r--katapult/common/actionregistry.h48
-rw-r--r--katapult/common/cachedcatalog.cpp175
-rw-r--r--katapult/common/cachedcatalog.h55
-rw-r--r--katapult/common/imagedisplay.cpp453
-rw-r--r--katapult/common/imagedisplay.h96
-rw-r--r--katapult/common/imagedisplaysettings.ui213
-rw-r--r--katapult/common/katapultaction.cpp44
-rw-r--r--katapult/common/katapultaction.h44
-rw-r--r--katapult/common/katapultcatalog.cpp90
-rw-r--r--katapult/common/katapultcatalog.desktop24
-rw-r--r--katapult/common/katapultcatalog.h67
-rw-r--r--katapult/common/katapultdisplay.cpp116
-rw-r--r--katapult/common/katapultdisplay.desktop23
-rw-r--r--katapult/common/katapultdisplay.h78
-rw-r--r--katapult/common/katapultitem.cpp44
-rw-r--r--katapult/common/katapultitem.h47
-rw-r--r--katapult/common/match.cpp59
-rw-r--r--katapult/common/match.h46
-rw-r--r--katapult/common/status.h24
-rw-r--r--katapult/configure.files2
-rw-r--r--katapult/configure.in.in6
-rw-r--r--katapult/katapult.kdevelop221
-rw-r--r--katapult/katapult.kdevses33
-rw-r--r--katapult/katapult/Makefile.am23
-rw-r--r--katapult/katapult/confcatalogs.ui39
-rw-r--r--katapult/katapult/confdisplay.ui64
-rw-r--r--katapult/katapult/confgeneral.ui250
-rw-r--r--katapult/katapult/hi128-app-katapult.pngbin0 -> 10762 bytes
-rw-r--r--katapult/katapult/hi16-app-katapult.pngbin0 -> 710 bytes
-rw-r--r--katapult/katapult/hi22-app-katapult.pngbin0 -> 1055 bytes
-rw-r--r--katapult/katapult/hi32-app-katapult.pngbin0 -> 1773 bytes
-rw-r--r--katapult/katapult/hi48-app-katapult.pngbin0 -> 2970 bytes
-rw-r--r--katapult/katapult/hi64-app-katapult.pngbin0 -> 4362 bytes
-rw-r--r--katapult/katapult/hisc-app-katapult.svgzbin0 -> 7275 bytes
-rw-r--r--katapult/katapult/katapult.cpp360
-rw-r--r--katapult/katapult/katapult.desktop30
-rw-r--r--katapult/katapult/katapult.h94
-rw-r--r--katapult/katapult/katapultconfigdlg.cpp181
-rw-r--r--katapult/katapult/katapultconfigdlg.h64
-rw-r--r--katapult/katapult/katapultiface.h38
-rw-r--r--katapult/katapult/katapultsettings.cpp377
-rw-r--r--katapult/katapult/katapultsettings.h120
-rw-r--r--katapult/katapult/main.cpp73
-rw-r--r--katapult/katapult/settings.cpp106
-rw-r--r--katapult/plugins/Makefile.am1
-rw-r--r--katapult/plugins/catalogs/Makefile.am1
-rw-r--r--katapult/plugins/catalogs/amarokcatalog/Makefile.am15
-rw-r--r--katapult/plugins/catalogs/amarokcatalog/actionplaysong.cpp58
-rw-r--r--katapult/plugins/catalogs/amarokcatalog/actionplaysong.h42
-rw-r--r--katapult/plugins/catalogs/amarokcatalog/amarokcatalog.cpp342
-rw-r--r--katapult/plugins/catalogs/amarokcatalog/amarokcatalog.h62
-rw-r--r--katapult/plugins/catalogs/amarokcatalog/coverimage.cpp106
-rw-r--r--katapult/plugins/catalogs/amarokcatalog/coverimage.h54
-rw-r--r--katapult/plugins/catalogs/amarokcatalog/katapult_amarokcatalog.desktop44
-rw-r--r--katapult/plugins/catalogs/amarokcatalog/settings.ui80
-rw-r--r--katapult/plugins/catalogs/amarokcatalog/song.cpp91
-rw-r--r--katapult/plugins/catalogs/amarokcatalog/song.h56
-rw-r--r--katapult/plugins/catalogs/bookmarkcatalog/Makefile.am17
-rw-r--r--katapult/plugins/catalogs/bookmarkcatalog/actionopenbookmark.cpp60
-rw-r--r--katapult/plugins/catalogs/bookmarkcatalog/actionopenbookmark.h43
-rw-r--r--katapult/plugins/catalogs/bookmarkcatalog/bookmark.cpp48
-rw-r--r--katapult/plugins/catalogs/bookmarkcatalog/bookmark.h46
-rw-r--r--katapult/plugins/catalogs/bookmarkcatalog/bookmarkcatalog.cpp212
-rw-r--r--katapult/plugins/catalogs/bookmarkcatalog/bookmarkcatalog.h71
-rw-r--r--katapult/plugins/catalogs/bookmarkcatalog/katapult_bookmarkcatalog.desktop44
-rw-r--r--katapult/plugins/catalogs/bookmarkcatalog/mozillabookmark.cpp51
-rw-r--r--katapult/plugins/catalogs/bookmarkcatalog/mozillabookmark.h46
-rw-r--r--katapult/plugins/catalogs/bookmarkcatalog/settings.ui117
-rw-r--r--katapult/plugins/catalogs/calculatorcatalog/Makefile.am20
-rw-r--r--katapult/plugins/catalogs/calculatorcatalog/actionevalexpr.cpp161
-rw-r--r--katapult/plugins/catalogs/calculatorcatalog/actionevalexpr.h51
-rw-r--r--katapult/plugins/catalogs/calculatorcatalog/calculatorcatalog.cpp360
-rw-r--r--katapult/plugins/catalogs/calculatorcatalog/calculatorcatalog.h122
-rw-r--r--katapult/plugins/catalogs/calculatorcatalog/expression.cpp94
-rw-r--r--katapult/plugins/catalogs/calculatorcatalog/expression.h60
-rw-r--r--katapult/plugins/catalogs/calculatorcatalog/hi128-action-checkmark.pngbin0 -> 11420 bytes
-rw-r--r--katapult/plugins/catalogs/calculatorcatalog/hi128-action-no.pngbin0 -> 11268 bytes
-rw-r--r--katapult/plugins/catalogs/calculatorcatalog/hi128-app-xcalc.pngbin0 -> 10583 bytes
-rw-r--r--katapult/plugins/catalogs/calculatorcatalog/katapult_calculatorcatalog.desktop44
-rw-r--r--katapult/plugins/catalogs/calculatorcatalog/parser.cpp1387
-rw-r--r--katapult/plugins/catalogs/calculatorcatalog/parser.y120
-rw-r--r--katapult/plugins/catalogs/calculatorcatalog/settings.ui219
-rw-r--r--katapult/plugins/catalogs/documentcatalog/Makefile.am16
-rw-r--r--katapult/plugins/catalogs/documentcatalog/actionopendocument.cpp58
-rw-r--r--katapult/plugins/catalogs/documentcatalog/actionopendocument.h41
-rw-r--r--katapult/plugins/catalogs/documentcatalog/directory.cpp36
-rw-r--r--katapult/plugins/catalogs/documentcatalog/directory.h38
-rw-r--r--katapult/plugins/catalogs/documentcatalog/document.cpp86
-rw-r--r--katapult/plugins/catalogs/documentcatalog/document.h52
-rw-r--r--katapult/plugins/catalogs/documentcatalog/documentcatalog.cpp229
-rw-r--r--katapult/plugins/catalogs/documentcatalog/documentcatalog.h71
-rw-r--r--katapult/plugins/catalogs/documentcatalog/katapult_documentcatalog.desktop44
-rw-r--r--katapult/plugins/catalogs/documentcatalog/settings.ui82
-rw-r--r--katapult/plugins/catalogs/execcatalog/Makefile.am20
-rw-r--r--katapult/plugins/catalogs/execcatalog/actionrun.cpp75
-rw-r--r--katapult/plugins/catalogs/execcatalog/actionrun.h51
-rw-r--r--katapult/plugins/catalogs/execcatalog/command.cpp66
-rw-r--r--katapult/plugins/catalogs/execcatalog/command.h59
-rw-r--r--katapult/plugins/catalogs/execcatalog/execcatalog.cpp122
-rw-r--r--katapult/plugins/catalogs/execcatalog/execcatalog.h76
-rw-r--r--katapult/plugins/catalogs/execcatalog/katapult_execcatalog.desktop8
-rw-r--r--katapult/plugins/catalogs/execcatalog/settings.ui65
-rw-r--r--katapult/plugins/catalogs/googlecatalog/Makefile.am20
-rw-r--r--katapult/plugins/catalogs/googlecatalog/actionsearch.cpp83
-rw-r--r--katapult/plugins/catalogs/googlecatalog/actionsearch.h51
-rw-r--r--katapult/plugins/catalogs/googlecatalog/googlecatalog.cpp122
-rw-r--r--katapult/plugins/catalogs/googlecatalog/googlecatalog.h76
-rw-r--r--katapult/plugins/catalogs/googlecatalog/katapult_googlecatalog.desktop8
-rw-r--r--katapult/plugins/catalogs/googlecatalog/query.cpp66
-rw-r--r--katapult/plugins/catalogs/googlecatalog/query.h59
-rw-r--r--katapult/plugins/catalogs/googlecatalog/settings.ui65
-rw-r--r--katapult/plugins/catalogs/programcatalog/Makefile.am15
-rw-r--r--katapult/plugins/catalogs/programcatalog/actionrunprogram.cpp65
-rw-r--r--katapult/plugins/catalogs/programcatalog/actionrunprogram.h44
-rw-r--r--katapult/plugins/catalogs/programcatalog/katapult_programcatalog.desktop43
-rw-r--r--katapult/plugins/catalogs/programcatalog/program.cpp55
-rw-r--r--katapult/plugins/catalogs/programcatalog/program.h48
-rw-r--r--katapult/plugins/catalogs/programcatalog/programcatalog.cpp153
-rw-r--r--katapult/plugins/catalogs/programcatalog/programcatalog.h62
-rw-r--r--katapult/plugins/catalogs/programcatalog/settings.ui101
-rw-r--r--katapult/plugins/catalogs/spellcatalog/Makefile.am19
-rw-r--r--katapult/plugins/catalogs/spellcatalog/actioncopyspelling.cpp80
-rw-r--r--katapult/plugins/catalogs/spellcatalog/actioncopyspelling.h51
-rw-r--r--katapult/plugins/catalogs/spellcatalog/cr128-action-katapultspellcheck.pngbin0 -> 8211 bytes
-rw-r--r--katapult/plugins/catalogs/spellcatalog/crsc-action-katapultspellcheck.svgzbin0 -> 1396 bytes
-rw-r--r--katapult/plugins/catalogs/spellcatalog/katapult_spellcatalog.desktop43
-rw-r--r--katapult/plugins/catalogs/spellcatalog/settings.ui65
-rw-r--r--katapult/plugins/catalogs/spellcatalog/spellcatalog.cpp122
-rw-r--r--katapult/plugins/catalogs/spellcatalog/spellcatalog.h73
-rw-r--r--katapult/plugins/catalogs/spellcatalog/spelling.cpp133
-rw-r--r--katapult/plugins/catalogs/spellcatalog/spelling.h74
-rw-r--r--katapult/plugins/display/Makefile.am1
-rw-r--r--katapult/plugins/display/glassdisplay/Makefile.am15
-rw-r--r--katapult/plugins/display/glassdisplay/doublebg.pngbin0 -> 3040 bytes
-rw-r--r--katapult/plugins/display/glassdisplay/glassdisplay.cpp60
-rw-r--r--katapult/plugins/display/glassdisplay/glassdisplay.h36
-rw-r--r--katapult/plugins/display/glassdisplay/katapult_glassdisplay.desktop42
-rw-r--r--katapult/plugins/display/glassdisplay/qembed_images.h8019
-rw-r--r--katapult/plugins/display/glassdisplay/singlebg.pngbin0 -> 2807 bytes
-rw-r--r--katapult/plugins/display/o2display/Makefile.am15
-rw-r--r--katapult/plugins/display/o2display/doublebg.pngbin0 -> 1618 bytes
-rw-r--r--katapult/plugins/display/o2display/katapult_o2display.desktop14
-rw-r--r--katapult/plugins/display/o2display/o2display.cpp63
-rw-r--r--katapult/plugins/display/o2display/o2display.h36
-rw-r--r--katapult/plugins/display/o2display/qembed_images.h9796
-rw-r--r--katapult/plugins/display/o2display/singlebg.pngbin0 -> 1352 bytes
-rw-r--r--katapult/plugins/display/puredisplay/Makefile.am15
-rw-r--r--katapult/plugins/display/puredisplay/doublebg.pngbin0 -> 3181 bytes
-rw-r--r--katapult/plugins/display/puredisplay/katapult_puredisplay.desktop41
-rw-r--r--katapult/plugins/display/puredisplay/puredisplay.cpp63
-rw-r--r--katapult/plugins/display/puredisplay/puredisplay.h36
-rw-r--r--katapult/plugins/display/puredisplay/qembed_images.h9796
-rw-r--r--katapult/plugins/display/puredisplay/singlebg.pngbin0 -> 2886 bytes
159 files changed, 40045 insertions, 0 deletions
diff --git a/katapult/COPYING-DOCS b/katapult/COPYING-DOCS
new file mode 100644
index 0000000..4a0fe1c
--- /dev/null
+++ b/katapult/COPYING-DOCS
@@ -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/katapult/Doxyfile b/katapult/Doxyfile
new file mode 100644
index 0000000..db55f90
--- /dev/null
+++ b/katapult/Doxyfile
@@ -0,0 +1,248 @@
+# Doxyfile 1.3.5-KDevelop
+
+#---------------------------------------------------------------------------
+# Project related configuration options
+#---------------------------------------------------------------------------
+PROJECT_NAME = katapult.kdevelop
+PROJECT_NUMBER = 0.1
+OUTPUT_DIRECTORY =
+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 = NO
+STRIP_FROM_PATH = /home/doros/src/local/kde/katapult/debug/src/
+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
+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
+#---------------------------------------------------------------------------
+# configuration options related to warning and progress messages
+#---------------------------------------------------------------------------
+QUIET = NO
+WARNINGS = YES
+WARN_IF_UNDOCUMENTED = YES
+WARN_IF_DOC_ERROR = YES
+WARN_FORMAT = "$file:$line: $text"
+WARN_LOGFILE =
+#---------------------------------------------------------------------------
+# configuration options related to the input files
+#---------------------------------------------------------------------------
+INPUT = /home/doros/src/local/kde/katapult
+FILE_PATTERNS = *.c \
+ *.cc \
+ *.cxx \
+ *.cpp \
+ *.c++ \
+ *.java \
+ *.ii \
+ *.ixx \
+ *.ipp \
+ *.i++ \
+ *.inl \
+ *.h \
+ *.hh \
+ *.hxx \
+ *.hpp \
+ *.h++ \
+ *.idl \
+ *.odl \
+ *.cs \
+ *.php \
+ *.php3 \
+ *.inc \
+ *.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_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 =
+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
+UML_LOOK = NO
+TEMPLATE_RELATIONS = NO
+INCLUDE_GRAPH = YES
+INCLUDED_BY_GRAPH = YES
+CALL_GRAPH = NO
+GRAPHICAL_HIERARCHY = YES
+DOT_IMAGE_FORMAT = png
+DOT_PATH =
+DOTFILE_DIRS =
+MAX_DOT_GRAPH_WIDTH = 1024
+MAX_DOT_GRAPH_HEIGHT = 1024
+MAX_DOT_GRAPH_DEPTH = 1000
+GENERATE_LEGEND = YES
+DOT_CLEANUP = YES
+#---------------------------------------------------------------------------
+# Configuration::additions related to the search engine
+#---------------------------------------------------------------------------
+SEARCHENGINE = NO
diff --git a/katapult/Makefile.am b/katapult/Makefile.am
new file mode 100644
index 0000000..4a01686
--- /dev/null
+++ b/katapult/Makefile.am
@@ -0,0 +1,5 @@
+SUBDIRS = common plugins katapult
+
+messages: rc.cpp
+ $(EXTRACTRC) `find . -name "*.ui"` >> ./rc.cpp
+ $(XGETTEXT) `find . -name "*.cpp"` -o $(podir)/katapult.pot
diff --git a/katapult/NEWS b/katapult/NEWS
new file mode 100644
index 0000000..8d1c8b6
--- /dev/null
+++ b/katapult/NEWS
@@ -0,0 +1 @@
+
diff --git a/katapult/common/Makefile.am b/katapult/common/Makefile.am
new file mode 100644
index 0000000..5f57229
--- /dev/null
+++ b/katapult/common/Makefile.am
@@ -0,0 +1,19 @@
+# set the include path for X, qt and KDE
+INCLUDES = $(all_includes)
+
+# these are the headers for your project
+noinst_HEADERS = status.h katapultdisplay.h katapultcatalog.h katapultaction.h \
+ katapultitem.h cachedcatalog.h actionregistry.h match.h imagedisplay.h
+
+# let automoc handle all of the meta source files (moc)
+METASOURCES = AUTO
+
+lib_LTLIBRARIES = libkatapult.la
+
+# common library
+libkatapult_la_SOURCES = katapultitem.cpp katapultaction.cpp actionregistry.cpp katapultcatalog.cpp cachedcatalog.cpp match.cpp katapultdisplay.cpp imagedisplay.cpp imagedisplaysettings.ui
+libkatapult_la_LDFLAGS = $(all_libraries) -version-info 2:0:0
+libkatapult_la_LIBADD = $(LIB_QT) $(LIB_KDECORE) -lDCOP -lkdefx $(LIB_KDEUI)
+
+# this is where the service type files will go
+kde_servicetypes_DATA = katapultdisplay.desktop katapultcatalog.desktop
diff --git a/katapult/common/actionregistry.cpp b/katapult/common/actionregistry.cpp
new file mode 100644
index 0000000..82f10f5
--- /dev/null
+++ b/katapult/common/actionregistry.cpp
@@ -0,0 +1,64 @@
+/***************************************************************************
+ * Copyright (C) 2005 by Joe Ferris *
+ * jferris@optimistictech.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. *
+ * *
+ * 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. *
+ ***************************************************************************/
+
+#include "actionregistry.h"
+#include "katapultaction.h"
+#include "katapultitem.h"
+
+static ActionRegistry * actionRegistryInstance = 0;
+
+ActionRegistry::ActionRegistry()
+{
+ actions.setAutoDelete(TRUE);
+}
+
+ActionRegistry::~ActionRegistry()
+{
+}
+
+ActionRegistry * ActionRegistry::self()
+{
+ if(actionRegistryInstance == 0)
+ actionRegistryInstance = new ActionRegistry();
+ return actionRegistryInstance;
+}
+
+void ActionRegistry::registerAction(const KatapultAction *action)
+{
+ actions.append(action);
+}
+
+QPtrList<KatapultAction> ActionRegistry::actionsForItem(const KatapultItem *item) const
+{
+ QPtrList<KatapultAction> result;
+ QPtrListIterator<KatapultAction> it(actions);
+ KatapultAction *action;
+ while((action = it.current()) != 0) {
+ ++it;
+ if(action->accepts(item))
+ result.append(action);
+ }
+ return result;
+}
+
+void ActionRegistry::clear()
+{
+ actions.clear();
+}
diff --git a/katapult/common/actionregistry.h b/katapult/common/actionregistry.h
new file mode 100644
index 0000000..479837d
--- /dev/null
+++ b/katapult/common/actionregistry.h
@@ -0,0 +1,48 @@
+/***************************************************************************
+ * Copyright (C) 2005 by Joe Ferris *
+ * jferris@optimistictech.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. *
+ * *
+ * 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 ACTIONREGISTRY_H
+#define ACTIONREGISTRY_H
+
+#include <qptrlist.h>
+
+class KatapultItem;
+class KatapultAction;
+
+/**
+@author Joe Ferris
+*/
+class ActionRegistry{
+public:
+ ~ActionRegistry();
+
+ void registerAction(const KatapultAction *);
+ QPtrList<KatapultAction> actionsForItem(const KatapultItem *) const;
+ void clear();
+
+ static ActionRegistry * self();
+
+private:
+ ActionRegistry();
+
+ QPtrList<KatapultAction> actions;
+
+};
+
+#endif
diff --git a/katapult/common/cachedcatalog.cpp b/katapult/common/cachedcatalog.cpp
new file mode 100644
index 0000000..bf34b87
--- /dev/null
+++ b/katapult/common/cachedcatalog.cpp
@@ -0,0 +1,175 @@
+/***************************************************************************
+ * Copyright (C) 2005 by Joe Ferris *
+ * jferris@optimistictech.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. *
+ * *
+ * 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. *
+ ***************************************************************************/
+
+#include "cachedcatalog.moc"
+
+#include <qstringlist.h>
+#include <qstring.h>
+
+#include "cachedcatalog.h"
+#include "katapultitem.h"
+#include "match.h"
+#include "status.h"
+
+CachedCatalog::CachedCatalog()
+ : KatapultCatalog()
+{
+ cache.setAutoDelete(TRUE);
+ results.setAutoDelete(FALSE);
+}
+
+CachedCatalog::~CachedCatalog()
+{
+}
+
+unsigned int CachedCatalog::minQueryLen() const
+{
+ return 3;
+}
+
+void CachedCatalog::queryChanged()
+{
+ int newStatus = 0;
+ if(query() == "")
+ {
+ results.clear();
+ setBestMatch(Match());
+ } else {
+ if(query().length() >= minQueryLen())
+ {
+ Match newBestMatch;
+
+ if(status() & S_Active)
+ {
+ QPtrListIterator<KatapultItem> it(results);
+ KatapultItem *item;
+
+ while((item = it.current())!=0)
+ {
+ ++it;
+ Match match = queryItem(item, query());
+ if(match.isNull())
+ results.removeRef(item);
+ else if(newBestMatch.isNull() || match.rank() > newBestMatch.rank())
+ newBestMatch = match;
+ }
+ } else {
+ results.clear();
+
+ QPtrListIterator<KatapultItem> it(cache);
+ KatapultItem *item;
+ while((item=it.current())!=0)
+ {
+ ++it;
+ Match match = queryItem(item, query());
+ if(!match.isNull()) {
+ results.append(item);
+ if(newBestMatch.isNull() || match.rank() > newBestMatch.rank())
+ newBestMatch = match;
+ }
+ }
+ }
+
+ newStatus |= S_Active;
+ if(results.count() > 0)
+ {
+ newStatus |= S_HasResults;
+ if(results.count() > 1)
+ newStatus |= S_Multiple;
+ } else
+ newStatus |= S_NoResults;
+
+ setBestMatch(newBestMatch);
+ }
+ }
+ setStatus(newStatus);
+}
+
+Match CachedCatalog::queryItem(const KatapultItem *item, QString query) const
+{
+ int wordNo = 0;
+ int _rank = 0;
+ unsigned int _matched = 0;
+ QString text = item->text().lower();
+ QStringList queryWords = QStringList::split(" ", query.lower());
+ int wordMax = queryWords.count()-1;
+ QStringList words = QStringList::split(" ", text);
+ QStringList::Iterator wit = words.begin();
+ for(QStringList::Iterator qit = queryWords.begin(); qit != queryWords.end(); ++qit) {
+ QString queryWord = *qit;
+ bool didMatch = FALSE;
+ for(; wit != words.end(); ++wit) {
+ QString word = *wit;
+ if(word.startsWith(queryWord)) {
+ if(_matched != 0)
+ _matched++;
+ if(wordNo == wordMax) {
+ _matched += queryWord.length();
+ } else {
+ _matched += word.length();
+ }
+ didMatch = TRUE;
+ break;
+ }
+ if(wordNo == 0) {
+ if(_matched != 0)
+ _matched++;
+ _matched += word.length();
+ }
+ }
+ if(didMatch == FALSE) {
+ return Match();
+ }
+ wordNo++;
+ }
+
+ if(_matched > text.length())
+ return Match();
+
+ _rank = 100*query.length()/text.length();
+
+ if(_rank == 0)
+ return Match();
+ else
+ return Match(item, _rank, _matched);
+}
+
+const KatapultItem * CachedCatalog::findExact(QString text) const
+{
+ text = text.lower();
+ KatapultItem *item;
+ QPtrListIterator<KatapultItem> it(cache);
+ while((item=it.current())!=0)
+ {
+ ++it;
+ if(item->text().lower() == text)
+ return item;
+ }
+ return 0;
+}
+
+void CachedCatalog::addItem(KatapultItem *item)
+{
+ if(findExact(item->text())) {
+ qDebug("Ignored duplicate item: %s", item->text().ascii());
+ delete item;
+ } else
+ cache.append(item);
+}
diff --git a/katapult/common/cachedcatalog.h b/katapult/common/cachedcatalog.h
new file mode 100644
index 0000000..0653c5d
--- /dev/null
+++ b/katapult/common/cachedcatalog.h
@@ -0,0 +1,55 @@
+/***************************************************************************
+ * Copyright (C) 2005 by Joe Ferris *
+ * jferris@optimistictech.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. *
+ * *
+ * 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 CACHEDCATALOG_H
+#define CACHEDCATALOG_H
+
+#include <qptrlist.h>
+
+#include "katapultcatalog.h"
+
+class Match;
+class KatapultItem;
+
+/**
+@author Joe Ferris
+*/
+class CachedCatalog : public KatapultCatalog
+{
+ Q_OBJECT
+public:
+ CachedCatalog();
+ virtual ~CachedCatalog();
+
+ const KatapultItem * findExact(QString text) const;
+
+protected:
+ virtual void queryChanged();
+ virtual unsigned int minQueryLen() const;
+
+ void addItem(KatapultItem *);
+
+private:
+ Match queryItem(const KatapultItem *, QString) const;
+
+ QPtrList<KatapultItem> cache, results;
+
+};
+
+#endif
diff --git a/katapult/common/imagedisplay.cpp b/katapult/common/imagedisplay.cpp
new file mode 100644
index 0000000..7832198
--- /dev/null
+++ b/katapult/common/imagedisplay.cpp
@@ -0,0 +1,453 @@
+/***************************************************************************
+ * Copyright (C) 2005 by Joe Ferris *
+ * jferris@optimistictech.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. *
+ * *
+ * 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. *
+ ***************************************************************************/
+
+#include <imagedisplay.moc>
+
+#include <kglobal.h>
+#include <kglobalsettings.h>
+#include <kiconloader.h>
+#include <kwin.h>
+#include <kimageeffect.h>
+#include <kgenericfactory.h>
+#include <kconfig.h>
+#include <kfontcombo.h>
+#include <klocale.h>
+
+#include <qpainter.h>
+#include <qapplication.h>
+#include <qimage.h>
+#include <qbitmap.h>
+#include <qslider.h>
+#include <qspinbox.h>
+#include <qcursor.h>
+
+#include <status.h>
+
+#include "imagedisplay.h"
+#include "imagedisplaysettings.h"
+
+#define FADEINTERVAL 20
+#define FADECONST 2000
+
+ImageDisplay::ImageDisplay(QObject *, const char *name, const QStringList&)
+ : KatapultDisplay(name, WType_TopLevel | WStyle_Customize | WStyle_NoBorder | WStyle_StaysOnTop | WNoAutoErase | WDestructiveClose)
+{
+ KWin::setType(winId(), NET::Dock);
+ setBackgroundMode(NoBackground);
+ setFocusPolicy(QWidget::StrongFocus);
+
+ singlebg = 0;
+ doublebg = 0;
+
+ singlesize[0] = 0;
+ singlesize[1] = 0;
+ doublesize[0] = 0;
+ doublesize[1] = 0;
+ padding = 0;
+ margin[0] = 0;
+ margin[1] = 0;
+ margin[2] = 0;
+ margin[3] = 0;
+ iconsize = 0;
+
+ bgSngl = 0;
+ bgDbl = 0;
+
+ fadeImg = 0;
+
+ alpha = 0;
+ fadeTimer = new QTimer(this);
+ connect(fadeTimer, SIGNAL(timeout()), this, SLOT(continueFade()));
+
+ desktopSize = qApp->desktop()->availableGeometry(QCursor::pos());
+
+ fadeTime = 250;
+ updateFadeStep();
+}
+
+ImageDisplay::~ImageDisplay()
+{
+ if(singlebg != 0)
+ delete singlebg;
+ if(doublebg != 0)
+ delete doublebg;
+ if(bgSngl != 0)
+ delete bgSngl;
+ if(bgDbl != 0)
+ delete bgDbl;
+ if(fadeImg != 0)
+ delete fadeImg;
+}
+
+void ImageDisplay::continueFade()
+{
+ if(fadeOut)
+ {
+ if(fadeStep == 0)
+ alpha = 0;
+ else
+ alpha -= fadeStep;
+ if(alpha <= 0)
+ {
+ alpha = 0;
+ fadeTimer->stop();
+ hide();
+ }
+ } else {
+ if(fadeStep == 0)
+ alpha = 100;
+ else
+ alpha += fadeStep;
+ if(alpha > 100)
+ {
+ alpha = 100;
+ fadeTimer->stop();
+ if(fadeImg != 0)
+ {
+ delete fadeImg;
+ fadeImg = 0;
+ }
+ }
+ }
+ update();
+}
+
+void ImageDisplay::showEvent(QShowEvent *)
+{
+ // set back the display-size, because if it wouldn't be done this could be a problem-source.
+ displaySize = 0;
+
+ if(bgSngl != 0)
+ delete bgSngl;
+ if(bgDbl != 0)
+ delete bgDbl;
+
+ bgSngl = new QPixmap(QPixmap::grabWindow(qt_xrootwin(), (desktopSize.width() - singlesize[0])/2 + desktopSize.left(), (desktopSize.height() - singlesize[1])/2 + desktopSize.top(), singlesize[0], singlesize[1]));
+ bgDbl = new QPixmap(QPixmap::grabWindow(qt_xrootwin(), (desktopSize.width() - doublesize[0])/2 + desktopSize.left(), (desktopSize.height() - doublesize[1])/2 + desktopSize.top(), doublesize[0], doublesize[1]));
+
+ if(fadeImg != 0)
+ delete fadeImg;
+
+ if(fadeTime <= 1) {
+ alpha = 100;
+ placeWindow(1);
+ } else {
+ fadeOut = false;
+ alpha = 0;
+ fadeImg = new QImage(getDisplay().convertToImage());
+ fadeTimer->start(FADEINTERVAL, FALSE);
+ }
+}
+
+void ImageDisplay::hide()
+{
+ if(alpha == 0)
+ {
+ if(fadeImg != 0)
+ {
+ delete fadeImg;
+ fadeImg = 0;
+ }
+ KatapultDisplay::hide();
+ } else {
+ if(fadeImg != 0)
+ delete fadeImg;
+ fadeImg = new QImage(getDisplay().convertToImage());
+ fadeOut = TRUE;
+ if(!fadeTimer->isActive())
+ fadeTimer->start(FADEINTERVAL, FALSE);
+ }
+}
+
+void ImageDisplay::drawText(QPixmap & pixmap, int x, int width, QString text, int hilight) const
+{
+ int fontSize = maxFontSize;
+ QFont font(fontFace, fontSize);
+ QFontMetrics metrics(font);
+
+ while(fontSize > minFontSize && metrics.width(text) > width) {
+ fontSize--;
+ font.setPointSize(fontSize);
+ metrics = QFontMetrics(font);
+ }
+
+ while(hilight > 1 && metrics.width(text) > width) {
+ text = text.remove(0, 1);
+ hilight--;
+ }
+
+ int useChars = text.length();
+
+ while(metrics.width(text, useChars) > width) {
+ useChars--;
+ }
+ text = text.left(useChars);
+
+ QString hilighted = text.left(hilight);
+ QString remaining = text.right(text.length() - hilighted.length());
+
+ x += (width-metrics.width(text))/2;
+
+ QPainter painter(&pixmap);
+ painter.setFont(font);
+
+ painter.setPen(colorGroup().color(QColorGroup::Link));
+ painter.drawText(x, singlesize[1]-offset[3], hilighted);
+ painter.setPen(QColor(255, 255, 255));
+ painter.drawText(x+metrics.width(hilighted), singlesize[1]-offset[3], remaining);
+}
+
+QPixmap ImageDisplay::getDisplay()
+{
+ if(status() & S_HasResults)
+ {
+ // show best match
+ QPixmap pixmap(*bgDbl);
+ QPainter painter(&pixmap);
+
+ painter.drawPixmap(0, 0, *doublebg);
+
+ QFontMetrics metrics = painter.fontMetrics();
+ QRect bounds;
+ QPixmap icon;
+
+ int itemSpace = (doublesize[0]-offset[0]-offset[2]-padding)/2;
+
+ const KatapultItem *_item = item();
+ if(_item != 0)
+ {
+ icon = _item->icon(iconsize);
+ painter.drawPixmap(offset[0]+(itemSpace-iconsize)/2, offset[1], icon);
+ drawText(pixmap, offset[0], itemSpace, _item->text(), selected());
+ }
+
+ const KatapultAction *_action = action();
+ if(_action != 0)
+ {
+ int x = offset[0]+itemSpace+padding+padding;
+ icon = _action->icon(iconsize);
+ painter.drawPixmap(x+(itemSpace-iconsize)/2, offset[1], icon);
+ drawText(pixmap, x, itemSpace, _action->text(), 0);
+ }
+ painter.end();
+
+ if(displaySize != 2)
+ {
+ placeWindow(2);
+ displaySize = 2;
+ }
+
+ return pixmap;
+ } else {
+ // show splash or error
+ QPixmap pixmap(*bgSngl);
+ QPainter painter(&pixmap);
+
+ painter.drawPixmap(0, 0, *singlebg);
+
+ QString label;
+ QPixmap icon;
+
+ if(status() & S_Active)
+ {
+ icon = KGlobal::iconLoader()->loadIcon("unknown", KIcon::NoGroup, 128);
+ if(query().isEmpty())
+ label = i18n("No items matched.");
+ else
+ label = query();
+ } else {
+ icon = KGlobal::iconLoader()->loadIcon("katapult", KIcon::NoGroup, 128);
+ if(query().isEmpty())
+ label = "Katapult";
+ else {
+ label = query();
+ painter.setPen(QColor(16, 48, 254));
+ }
+ }
+
+ painter.drawPixmap(offset[0]+(singlesize[0]-offset[0]-offset[2]-128)/2, offset[1], icon);
+
+ drawText(pixmap, offset[0], singlesize[0]-offset[0]-offset[2], label, 0);
+
+/* painter.drawText(offset[0], singlesize[1]-offset[3]-30, singlesize[0]-offset[0]-offset[2], 30,
+ Qt::AlignHCenter | Qt::AlignBottom | Qt::SingleLine, label);*/
+ painter.end();
+
+ if(displaySize != 1)
+ {
+ placeWindow(1);
+ displaySize = 1;
+ }
+
+ return pixmap;
+ }
+}
+
+void ImageDisplay::placeWindow(int size)
+{
+ if(size == 2) {
+ move((desktopSize.width() - doublesize[0])/2 + desktopSize.left(), (desktopSize.height() - doublesize[1])/2 + desktopSize.top());
+ resize(doublesize[0], doublesize[1]);
+ } else {
+ move((desktopSize.width() - singlesize[0])/2 + desktopSize.left(), (desktopSize.height() - singlesize[1])/2 + desktopSize.top());
+ resize(singlesize[0], singlesize[1]);
+ }
+}
+
+void ImageDisplay::paintEvent(QPaintEvent *)
+{
+ if(alpha == 0)
+ {
+ if(displaySize == 2)
+ bitBlt(this, 0, 0, bgDbl);
+ else
+ bitBlt(this, 0, 0, bgSngl);
+ } else if(fadeImg != 0) {
+ QImage buffer;
+ if(displaySize == 2)
+ buffer = bgDbl->convertToImage();
+ else
+ buffer = bgSngl->convertToImage();
+
+ KImageEffect::blend(*fadeImg, buffer, (float)alpha/100);
+ bitBlt(this, 0, 0, &buffer);
+ } else {
+ QPixmap pixmap = getDisplay();
+ bitBlt(this, 0, 0, &pixmap);
+ }
+}
+
+void ImageDisplay::setSingleBG(QPixmap *singlebg)
+{
+ this->singlebg = singlebg;
+}
+
+void ImageDisplay::setDoubleBG(QPixmap *doublebg)
+{
+ this->doublebg = doublebg;
+}
+
+void ImageDisplay::setSingleSize(int width, int height)
+{
+ singlesize[0] = width;
+ singlesize[1] = height;
+}
+
+void ImageDisplay::setDoubleSize(int width, int height)
+{
+ doublesize[0] = width;
+ doublesize[1] = height;
+}
+
+void ImageDisplay::setMargin(int left, int top, int right, int bottom)
+{
+ margin[0] = left;
+ margin[1] = top;
+ margin[2] = right;
+ margin[3] = bottom;
+ updateOffset();
+}
+
+void ImageDisplay::setPadding(int padding)
+{
+ this->padding = padding;
+ updateOffset();
+}
+
+void ImageDisplay::setIconSize(int iconsize)
+{
+ this->iconsize = iconsize;
+}
+
+void ImageDisplay::updateOffset()
+{
+ offset[0] = margin[0] + padding;
+ offset[1] = margin[1] + padding;
+ offset[2] = margin[2] + padding;
+ offset[3] = margin[3] + padding;
+}
+
+void ImageDisplay::readSettings(KConfigBase *config)
+{
+ fadeTime = config->readUnsignedNumEntry("FadeTime", 250);
+ updateFadeStep();
+// fadeStep = fadeTime/FADEINTERVAL;
+ QFont defaultFont = KGlobalSettings::generalFont();
+ fontFace = config->readEntry("FontFace", defaultFont.family());
+ minFontSize = config->readUnsignedNumEntry("MinFontSize", 7);
+ maxFontSize = config->readUnsignedNumEntry("MaxFontSize", 14);
+}
+
+void ImageDisplay::writeSettings(KConfigBase *config)
+{
+ config->writeEntry("FadeTime", fadeTime);
+ config->writeEntry("FontFace", fontFace);
+ config->writeEntry("MinFontSize", minFontSize);
+ config->writeEntry("MaxFontSize", maxFontSize);
+}
+
+QWidget * ImageDisplay::configure()
+{
+ ImageDisplaySettings *settings = new ImageDisplaySettings();
+
+ settings->fadeTime->setValue(fadeTime);
+ connect(settings->fadeTime, SIGNAL(valueChanged(int)), this, SLOT(setFadeOut(int)));
+
+ settings->displayFont->setCurrentFont(fontFace);
+ connect(settings->displayFont, SIGNAL(textChanged(const QString &)), this, SLOT(setFont(const QString &)));
+
+ settings->minFontSize->setValue(minFontSize);
+ connect(settings->minFontSize, SIGNAL(valueChanged(int)), this, SLOT(setMinFontSize(int)));
+
+ settings->maxFontSize->setValue(maxFontSize);
+ connect(settings->maxFontSize, SIGNAL(valueChanged(int)), this, SLOT(setMaxFontSize(int)));
+
+ return settings;
+}
+
+void ImageDisplay::setFont(const QString &font)
+{
+ fontFace = font;
+}
+
+void ImageDisplay::setMinFontSize(int size)
+{
+ minFontSize = size;
+}
+
+void ImageDisplay::setMaxFontSize(int size)
+{
+ maxFontSize = size;
+}
+
+void ImageDisplay::setFadeOut(int fadeTime)
+{
+ this->fadeTime = fadeTime;
+ updateFadeStep();
+}
+
+void ImageDisplay::updateFadeStep()
+{
+ if(fadeTime == 0)
+ fadeTime = 1;
+ fadeStep = FADECONST/fadeTime;
+ if(fadeStep > 100)
+ fadeStep = 100;
+}
diff --git a/katapult/common/imagedisplay.h b/katapult/common/imagedisplay.h
new file mode 100644
index 0000000..e0d4fc7
--- /dev/null
+++ b/katapult/common/imagedisplay.h
@@ -0,0 +1,96 @@
+/***************************************************************************
+ * Copyright (C) 2005 by Joe Ferris *
+ * jferris@optimistictech.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. *
+ * *
+ * 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 IMAGEDISPLAY_H
+#define IMAGEDISPLAY_H
+
+#include <qevent.h>
+#include <qpixmap.h>
+#include <qtimer.h>
+#include <qimage.h>
+
+#include "katapultdisplay.h"
+
+class Katapult;
+class QFont;
+
+/**
+@author Joe Ferris, Bastian Holst
+*/
+class ImageDisplay : public KatapultDisplay
+{
+ Q_OBJECT
+public:
+ ImageDisplay(QObject *, const char *, const QStringList&);
+ virtual ~ImageDisplay();
+
+public slots:
+ void continueFade();
+ virtual void hide();
+
+ virtual void readSettings(KConfigBase *);
+ virtual void writeSettings(KConfigBase *);
+ virtual QWidget * configure();
+
+ void setFont(const QString &);
+ void setMinFontSize(int);
+ void setMaxFontSize(int);
+ void setFadeOut(int);
+ void updateFadeStep();
+
+protected:
+ virtual void showEvent(QShowEvent *);
+ virtual void paintEvent(QPaintEvent *);
+
+ void setSingleBG(QPixmap *);
+ void setDoubleBG(QPixmap *);
+ void setSingleSize(int width, int height);
+ void setDoubleSize(int width, int heught);
+ void setMargin(int left, int top, int right, int bottom);
+ void setPadding(int);
+ void setIconSize(int);
+
+ QPixmap getDisplay();
+ void drawText(QPixmap &, int, int, QString, int) const;
+ void placeWindow(int);
+
+private:
+ void updateOffset();
+
+ QPixmap *bgSngl, *bgDbl, *singlebg, *doublebg;
+ QRect desktopSize;
+ QImage *fadeImg;
+ QTimer *fadeTimer;
+ QString fontFace;
+ int minFontSize, maxFontSize;
+ int alpha;
+ bool fadeOut;
+ int fadeTime, fadeStep;
+ int displaySize;
+ // 0: left, 1: top, 2: right, 3: bottom
+ int margin[4];
+ int offset[4];
+ // 0: width, 1: height
+ int singlesize[2];
+ int doublesize[2];
+ int padding;
+ int iconsize;
+};
+
+#endif
diff --git a/katapult/common/imagedisplaysettings.ui b/katapult/common/imagedisplaysettings.ui
new file mode 100644
index 0000000..c78d2a4
--- /dev/null
+++ b/katapult/common/imagedisplaysettings.ui
@@ -0,0 +1,213 @@
+<!DOCTYPE UI><UI version="3.2" stdsetdef="1">
+<class>ImageDisplaySettings</class>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>ImageDisplaySettings</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>411</width>
+ <height>385</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Settings</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>textLabel1</cstring>
+ </property>
+ <property name="text">
+ <string>Length of fade-in/fade-out:</string>
+ </property>
+ </widget>
+ <widget class="QSlider">
+ <property name="name">
+ <cstring>fadeTime</cstring>
+ </property>
+ <property name="maxValue">
+ <number>2000</number>
+ </property>
+ <property name="lineStep">
+ <number>100</number>
+ </property>
+ <property name="pageStep">
+ <number>250</number>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="tickmarks">
+ <enum>NoMarks</enum>
+ </property>
+ <property name="tickInterval">
+ <number>1000</number>
+ </property>
+ </widget>
+ <widget class="QButtonGroup">
+ <property name="name">
+ <cstring>autoFontSize</cstring>
+ </property>
+ <property name="title">
+ <string>Display Font</string>
+ </property>
+ <property name="checkable">
+ <bool>false</bool>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout6</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>textLabel2</cstring>
+ </property>
+ <property name="text">
+ <string>Font face:</string>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>spacer2</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>91</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="KFontCombo">
+ <property name="name">
+ <cstring>displayFont</cstring>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout7</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>textLabel1_2</cstring>
+ </property>
+ <property name="text">
+ <string>Minimum font size:</string>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>spacer3</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>181</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QSpinBox">
+ <property name="name">
+ <cstring>minFontSize</cstring>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout8</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>textLabel1_2_2</cstring>
+ </property>
+ <property name="text">
+ <string>Maximum font size:</string>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>spacer4</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>191</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QSpinBox">
+ <property name="name">
+ <cstring>maxFontSize</cstring>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ </vbox>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>spacer1</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>160</height>
+ </size>
+ </property>
+ </spacer>
+ </vbox>
+</widget>
+<layoutdefaults spacing="6" margin="11"/>
+<includehints>
+ <includehint>kfontcombo.h</includehint>
+ <includehint>klineedit.h</includehint>
+</includehints>
+</UI>
diff --git a/katapult/common/katapultaction.cpp b/katapult/common/katapultaction.cpp
new file mode 100644
index 0000000..d0dd13f
--- /dev/null
+++ b/katapult/common/katapultaction.cpp
@@ -0,0 +1,44 @@
+/***************************************************************************
+ * Copyright (C) 2005 by Joe Ferris *
+ * jferris@optimistictech.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. *
+ * *
+ * 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. *
+ ***************************************************************************/
+
+#include <qpixmap.h>
+
+#include "katapultaction.h"
+
+KatapultAction::~KatapultAction(){}
+
+QString KatapultAction::text() const
+{
+ return QString::null;
+}
+
+QPixmap KatapultAction::icon(int size) const
+{
+ return QPixmap(size, size);
+}
+
+void KatapultAction::execute(const KatapultItem *) const
+{
+}
+
+bool KatapultAction::accepts(const KatapultItem *) const
+{
+ return false;
+}
diff --git a/katapult/common/katapultaction.h b/katapult/common/katapultaction.h
new file mode 100644
index 0000000..9198920
--- /dev/null
+++ b/katapult/common/katapultaction.h
@@ -0,0 +1,44 @@
+/***************************************************************************
+ * Copyright (C) 2005 by Joe Ferris *
+ * jferris@optimistictech.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. *
+ * *
+ * 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 KATAPULTACTION_H
+#define KATAPULTACTION_H
+
+#include <qstring.h>
+#include <qptrlist.h>
+
+class QPixmap;
+class KatapultItem;
+
+/**
+@author Joe Ferris
+*/
+class KatapultAction {
+
+public:
+ virtual ~KatapultAction();
+
+ virtual void execute(const KatapultItem *) const;
+ virtual bool accepts(const KatapultItem *) const;
+ virtual QString text() const;
+ virtual QPixmap icon(int) const;
+
+};
+
+#endif
diff --git a/katapult/common/katapultcatalog.cpp b/katapult/common/katapultcatalog.cpp
new file mode 100644
index 0000000..f90420a
--- /dev/null
+++ b/katapult/common/katapultcatalog.cpp
@@ -0,0 +1,90 @@
+/***************************************************************************
+ * Copyright (C) 2005 by Joe Ferris *
+ * jferris@optimistictech.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. *
+ * *
+ * 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. *
+ ***************************************************************************/
+
+#include "katapultcatalog.moc"
+#include "katapultcatalog.h"
+#include "match.h"
+
+KatapultCatalog::KatapultCatalog()
+{
+ _bestMatch = Match();
+ _status = 0;
+ _query = "";
+}
+
+
+KatapultCatalog::~KatapultCatalog()
+{
+}
+
+void KatapultCatalog::queryChanged()
+{
+}
+
+void KatapultCatalog::initialize()
+{
+}
+
+void KatapultCatalog::setQuery(QString _query)
+{
+ if(this->_query != _query) {
+ this->_query = _query;
+ queryChanged();
+ }
+}
+
+void KatapultCatalog::setStatus(int _status)
+{
+ this->_status = _status;
+}
+
+void KatapultCatalog::setBestMatch(Match _bestMatch)
+{
+ this->_bestMatch = _bestMatch;
+}
+
+QString KatapultCatalog::query() const
+{
+ return _query;
+}
+
+int KatapultCatalog::status() const
+{
+ return _status;
+}
+
+Match KatapultCatalog::bestMatch() const
+{
+ return _bestMatch;
+}
+
+void KatapultCatalog::readSettings(KConfigBase *)
+{
+}
+
+void KatapultCatalog::writeSettings(KConfigBase *)
+{
+}
+
+QWidget * KatapultCatalog::configure()
+{
+ return 0;
+}
+
diff --git a/katapult/common/katapultcatalog.desktop b/katapult/common/katapultcatalog.desktop
new file mode 100644
index 0000000..d66385f
--- /dev/null
+++ b/katapult/common/katapultcatalog.desktop
@@ -0,0 +1,24 @@
+[Desktop Entry]
+Type=ServiceType
+X-KDE-ServiceType=Katapult/Catalog
+Comment=A Katapult catalog plugin
+Comment[ar]=بريمج مستعرض Katapult
+Comment[bg]=Приставка за каталог на Katapult
+Comment[br]=Ul lugent katalog evit Katapult
+Comment[da]=Et mappe-plugin for Katapult
+Comment[de]=Ein Katapult-Katalog-Modul
+Comment[el]=Ένα πρόσθετο καταλόγου Katapult
+Comment[es]=Una extensión del catálogo Katapult
+Comment[et]=Katapulti kataloogiplugin
+Comment[fr]=Un module externe de catalogue pour Katapult
+Comment[gl]=Plugin de catálogo de Katapult
+Comment[it]=Un plugin per i cataloghi di Katapult
+Comment[ja]=Katapult カタログプラグイン
+Comment[nb]=Et programtillegg for Katapult-katalog
+Comment[nl]=Een Katapult-catalogusplugin
+Comment[pt]=Um 'plugin' de catálogo do Katapult
+Comment[pt_BR]=Um 'plugin' de catálogo do Katapult
+Comment[sv]=Ett katalogiseringsinsticksprogram för Katapult
+Comment[tr]=Bir Katapult katalog eklentisi
+Comment[uk]=Втулок каталогів для Катапульти
+
diff --git a/katapult/common/katapultcatalog.h b/katapult/common/katapultcatalog.h
new file mode 100644
index 0000000..9576a8a
--- /dev/null
+++ b/katapult/common/katapultcatalog.h
@@ -0,0 +1,67 @@
+/***************************************************************************
+ * Copyright (C) 2005 by Joe Ferris *
+ * jferris@optimistictech.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. *
+ * *
+ * 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 KATAPULTCATALOG_H
+#define KATAPULTCATALOG_H
+
+#include <qobject.h>
+#include <qstring.h>
+#include <qptrlist.h>
+
+#include "match.h"
+
+class QWidget;
+class KConfigBase;
+
+/**
+@author Joe Ferris
+*/
+class KatapultCatalog : public QObject {
+ Q_OBJECT
+
+public:
+ KatapultCatalog();
+ virtual ~KatapultCatalog();
+
+ void setQuery(QString);
+
+ int status() const;
+ Match bestMatch() const;
+
+ virtual void initialize();
+ virtual void readSettings(KConfigBase *);
+ virtual void writeSettings(KConfigBase *);
+ virtual QWidget * configure();
+
+protected:
+ QString query() const;
+
+ void setStatus(int);
+ void setBestMatch(Match);
+
+ virtual void queryChanged();
+
+private:
+ QString _query;
+ int _status;
+ Match _bestMatch;
+
+};
+
+#endif
diff --git a/katapult/common/katapultdisplay.cpp b/katapult/common/katapultdisplay.cpp
new file mode 100644
index 0000000..2dbe460
--- /dev/null
+++ b/katapult/common/katapultdisplay.cpp
@@ -0,0 +1,116 @@
+/***************************************************************************
+ * Copyright (C) 2005 by Joe Ferris *
+ * jferris@optimistictech.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. *
+ * *
+ * 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. *
+ ***************************************************************************/
+
+#include "katapultdisplay.moc"
+
+#include "katapultdisplay.h"
+
+KatapultDisplay::KatapultDisplay(const char *name, WFlags f)
+ : QWidget(0, name, f)
+{
+ _query = "";
+ _item = 0;
+ _action = 0;
+ _status = 0;
+ _selectionLength = 0;
+}
+
+KatapultDisplay::~KatapultDisplay()
+{
+}
+
+void KatapultDisplay::focusOutEvent(QFocusEvent *)
+{
+ emit focusOut();
+}
+
+void KatapultDisplay::keyPressEvent(QKeyEvent *e)
+{
+ emit keyReleased(e);
+}
+
+// Deprecated - added for backwards compatibility
+void KatapultDisplay::keyReleaseEvent(QKeyEvent *e)
+{
+}
+
+void KatapultDisplay::setQuery(QString _query)
+{
+ this->_query = _query;
+}
+
+void KatapultDisplay::setSelected(unsigned int length)
+{
+ _selectionLength = length;
+}
+
+unsigned int KatapultDisplay::selected() const
+{
+ return _selectionLength;
+}
+
+void KatapultDisplay::setItem(const KatapultItem *_item)
+{
+ this->_item = _item;
+}
+
+void KatapultDisplay::setAction(const KatapultAction *_action)
+{
+ this->_action = _action;
+}
+
+void KatapultDisplay::setStatus(int _status)
+{
+ this->_status = _status;
+}
+
+QString KatapultDisplay::query() const
+{
+ return _query;
+}
+
+const KatapultItem * KatapultDisplay::item() const
+{
+ return _item;
+}
+
+const KatapultAction * KatapultDisplay::action() const
+{
+ return _action;
+}
+
+int KatapultDisplay::status() const
+{
+ return _status;
+}
+
+void KatapultDisplay::readSettings(KConfigBase *)
+{
+}
+
+void KatapultDisplay::writeSettings(KConfigBase *)
+{
+}
+
+QWidget * KatapultDisplay::configure()
+{
+ return 0;
+}
+
diff --git a/katapult/common/katapultdisplay.desktop b/katapult/common/katapultdisplay.desktop
new file mode 100644
index 0000000..335cdf1
--- /dev/null
+++ b/katapult/common/katapultdisplay.desktop
@@ -0,0 +1,23 @@
+[Desktop Entry]
+Type=ServiceType
+X-KDE-ServiceType=Katapult/Display
+Comment=A Katapult display plugin
+Comment[ar]=بريمج عارض Katapult
+Comment[bg]=Приставка за показване на Katapult
+Comment[da]=Et visningsplugin for Katapult
+Comment[de]=Ein Katapult-Anzeige-Modul
+Comment[el]=Ένα πρόσθετο εμφάνισης Katapult
+Comment[es]=Una extensión para mostrar Katapult
+Comment[et]=Katapulti vaateplugin
+Comment[fr]=Un module externe d'affichage pour Katapult
+Comment[gl]=Plugin de visión de Katapult
+Comment[it]=Un plugin per i display di Katapult
+Comment[ja]=Katapult 表示プラグイン
+Comment[nb]=Et Katapult-programtillegg for visning
+Comment[nl]=Een Katapult-displayplugin
+Comment[pt]=Um 'plugin' de visualização do Katapult
+Comment[pt_BR]=Um 'plugin' de visualização do Katapult
+Comment[sv]=Ett visningsinsticksprogram för Katapult
+Comment[tr]=Bir Katapult gösterim eklentisi
+Comment[uk]=Втулок дисплея для Катапульти
+
diff --git a/katapult/common/katapultdisplay.h b/katapult/common/katapultdisplay.h
new file mode 100644
index 0000000..286238c
--- /dev/null
+++ b/katapult/common/katapultdisplay.h
@@ -0,0 +1,78 @@
+/***************************************************************************
+ * Copyright (C) 2005 by Joe Ferris *
+ * jferris@optimistictech.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. *
+ * *
+ * 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 KATAPULTDISPLAY_H
+#define KATAPULTDISPLAY_H
+
+#include <qwidget.h>
+#include <qstring.h>
+#include <qevent.h>
+
+#include "katapultitem.h"
+#include "katapultaction.h"
+
+class Katapult;
+class KConfigBase;
+
+/**
+@author Joe Ferris
+*/
+class KatapultDisplay : public QWidget
+{
+ Q_OBJECT
+
+public:
+ KatapultDisplay(const char *, WFlags);
+ virtual ~KatapultDisplay();
+
+ void setQuery(QString);
+ void setSelected(unsigned int);
+ void setItem(const KatapultItem *);
+ void setAction(const KatapultAction *);
+ void setStatus(int);
+
+ virtual void readSettings(KConfigBase *);
+ virtual void writeSettings(KConfigBase *);
+ virtual QWidget * configure();
+
+signals:
+ void keyReleased(QKeyEvent *);
+ void focusOut();
+
+protected:
+ virtual void keyPressEvent(QKeyEvent *);
+ virtual void keyReleaseEvent(QKeyEvent *);
+ virtual void focusOutEvent(QFocusEvent *);
+
+ QString query() const;
+ unsigned int selected() const;
+ const KatapultItem * item() const;
+ const KatapultAction * action() const;
+ int status() const;
+
+private:
+ QString _query;
+ unsigned int _selectionLength;
+ const KatapultItem *_item;
+ const KatapultAction *_action;
+ int _status;
+ Katapult *app;
+};
+
+#endif
diff --git a/katapult/common/katapultitem.cpp b/katapult/common/katapultitem.cpp
new file mode 100644
index 0000000..7ac00f1
--- /dev/null
+++ b/katapult/common/katapultitem.cpp
@@ -0,0 +1,44 @@
+/***************************************************************************
+ * Copyright (C) 2005 by Joe Ferris *
+ * jferris@optimistictech.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. *
+ * *
+ * 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. *
+ ***************************************************************************/
+
+#include "katapultitem.moc"
+
+#include <qpixmap.h>
+#include <qstring.h>
+
+#include "katapultitem.h"
+
+KatapultItem::KatapultItem()
+{
+}
+
+KatapultItem::~KatapultItem()
+{
+}
+
+QString KatapultItem::text() const
+{
+ return QString::null;
+}
+
+QPixmap KatapultItem::icon(int) const
+{
+ return QSize(0, 0);
+}
diff --git a/katapult/common/katapultitem.h b/katapult/common/katapultitem.h
new file mode 100644
index 0000000..f38422d
--- /dev/null
+++ b/katapult/common/katapultitem.h
@@ -0,0 +1,47 @@
+/***************************************************************************
+ * Copyright (C) 2005 by Joe Ferris *
+ * jferris@optimistictech.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. *
+ * *
+ * 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 KATAPULTITEM_H
+#define KATAPULTITEM_H
+
+#include <qobject.h>
+
+#include "katapultaction.h"
+
+class QPixmap;
+class QString;
+
+/**
+@author Joe Ferris
+*/
+class KatapultItem : public QObject {
+ Q_OBJECT
+public:
+
+ KatapultItem();
+ virtual ~KatapultItem();
+
+ virtual QString text() const;
+ virtual QPixmap icon(int) const;
+
+signals:
+ void itemChanged();
+};
+
+#endif
diff --git a/katapult/common/match.cpp b/katapult/common/match.cpp
new file mode 100644
index 0000000..5a346b3
--- /dev/null
+++ b/katapult/common/match.cpp
@@ -0,0 +1,59 @@
+/***************************************************************************
+ * Copyright (C) 2005 by Joe Ferris *
+ * jferris@optimistictech.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. *
+ * *
+ * 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. *
+ ***************************************************************************/
+
+#include <qobject.h>
+
+#include "match.h"
+
+Match::Match()
+{
+ this->_rank = 0;
+ this->_item = 0;
+ this->_matched = 0;
+ this->_null = TRUE;
+}
+
+Match::Match(const KatapultItem *_item, int _rank, unsigned int _matched)
+{
+ this->_rank = _rank;
+ this->_item = _item;
+ this->_matched = _matched;
+ this->_null = FALSE;
+}
+
+int Match::rank() const
+{
+ return _rank;
+}
+
+unsigned int Match::matched() const
+{
+ return _matched;
+}
+
+const KatapultItem * Match::item() const
+{
+ return _item;
+}
+
+bool Match::isNull() const
+{
+ return _null;
+}
diff --git a/katapult/common/match.h b/katapult/common/match.h
new file mode 100644
index 0000000..818158b
--- /dev/null
+++ b/katapult/common/match.h
@@ -0,0 +1,46 @@
+/***************************************************************************
+ * Copyright (C) 2005 by Joe Ferris *
+ * jferris@optimistictech.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. *
+ * *
+ * 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 MATCH_H
+#define MATCH_H
+
+class KatapultItem;
+
+/**
+@author Joe Ferris
+*/
+class Match {
+public:
+ Match();
+ Match(const KatapultItem *, int, unsigned int);
+
+ int rank() const;
+ const KatapultItem * item() const;
+ bool isNull() const;
+ unsigned int matched() const;
+
+private:
+ bool _null;
+ int _rank;
+ unsigned int _matched;
+ const KatapultItem *_item;
+
+};
+
+#endif
diff --git a/katapult/common/status.h b/katapult/common/status.h
new file mode 100644
index 0000000..a7aba0d
--- /dev/null
+++ b/katapult/common/status.h
@@ -0,0 +1,24 @@
+/***************************************************************************
+ * Copyright (C) 2005 by Joe Ferris *
+ * jferris@optimistictech.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. *
+ * *
+ * 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. *
+ ***************************************************************************/
+
+#define S_Active 1
+#define S_NoResults 2
+#define S_HasResults 4
+#define S_Multiple 8
diff --git a/katapult/configure.files b/katapult/configure.files
new file mode 100644
index 0000000..030bce8
--- /dev/null
+++ b/katapult/configure.files
@@ -0,0 +1,2 @@
+./admin/configure.in.min
+configure.in.in
diff --git a/katapult/configure.in.in b/katapult/configure.in.in
new file mode 100644
index 0000000..37132ff
--- /dev/null
+++ b/katapult/configure.in.in
@@ -0,0 +1,6 @@
+#MIN_CONFIG(3.0.0)
+
+AM_INIT_AUTOMAKE(katapult, 0.1)
+AC_C_BIGENDIAN
+AC_CHECK_KDEMAXPATHLEN
+
diff --git a/katapult/katapult.kdevelop b/katapult/katapult.kdevelop
new file mode 100644
index 0000000..ef7aa84
--- /dev/null
+++ b/katapult/katapult.kdevelop
@@ -0,0 +1,221 @@
+<?xml version = '1.0'?>
+<kdevelop>
+ <general>
+ <author>Joe Ferris</author>
+ <email>jferris@optimistictech.com</email>
+ <version>0.1</version>
+ <projectmanagement>KDevKDEAutoProject</projectmanagement>
+ <primarylanguage>C++</primarylanguage>
+ <keywords>
+ <keyword>C++</keyword>
+ <keyword>Code</keyword>
+ <keyword>Qt</keyword>
+ <keyword>KDE</keyword>
+ </keywords>
+ <projectdirectory>.</projectdirectory>
+ <absoluteprojectpath>false</absoluteprojectpath>
+ <description/>
+ <ignoreparts>
+ <part>KDevVisualBoyAdvance</part>
+ </ignoreparts>
+ <secondaryLanguages/>
+ </general>
+ <kdevautoproject>
+ <general>
+ <activetarget>katapult/katapult</activetarget>
+ <useconfiguration>default</useconfiguration>
+ <useactivetarget>true</useactivetarget>
+ </general>
+ <run>
+ <mainprogram>katapult</mainprogram>
+ <directoryradio>executable</directoryradio>
+ <customdirectory>/usr/bin/</customdirectory>
+ <programargs/>
+ <terminal>false</terminal>
+ <autocompile>true</autocompile>
+ <envvars/>
+ </run>
+ <configurations>
+ <optimized>
+ <builddir>optimized</builddir>
+ <ccompiler>kdevgccoptions</ccompiler>
+ <cxxcompiler>kdevgppoptions</cxxcompiler>
+ <f77compiler>kdevg77options</f77compiler>
+ <cxxflags>-O2 -g0</cxxflags>
+ </optimized>
+ <debug>
+ <configargs>--enable-debug=full --prefix=/usr</configargs>
+ <builddir>debug</builddir>
+ <ccompiler>kdevgccoptions</ccompiler>
+ <cxxcompiler>kdevgppoptions</cxxcompiler>
+ <f77compiler>kdevg77options</f77compiler>
+ <cxxflags>-O0 -g3</cxxflags>
+ <envvars/>
+ <topsourcedir/>
+ <cppflags/>
+ <ldflags/>
+ <ccompilerbinary/>
+ <cxxcompilerbinary/>
+ <f77compilerbinary/>
+ <cflags/>
+ <f77flags/>
+ </debug>
+ <default>
+ <configargs>--prefix=/usr</configargs>
+ <builddir/>
+ <topsourcedir/>
+ <cppflags/>
+ <ldflags/>
+ <ccompiler>kdevgccoptions</ccompiler>
+ <cxxcompiler>kdevgppoptions</cxxcompiler>
+ <f77compiler>kdevpgf77options</f77compiler>
+ <ccompilerbinary/>
+ <cxxcompilerbinary/>
+ <f77compilerbinary/>
+ <cflags/>
+ <cxxflags/>
+ <f77flags/>
+ </default>
+ </configurations>
+ <make>
+ <envvars>
+ <envvar value="1" name="WANT_AUTOCONF_2_5" />
+ <envvar value="1" name="WANT_AUTOMAKE_1_6" />
+ </envvars>
+ <abortonerror>false</abortonerror>
+ <numberofjobs>1</numberofjobs>
+ <dontact>false</dontact>
+ <makebin/>
+ <prio>0</prio>
+ </make>
+ </kdevautoproject>
+ <kdevfileview>
+ <groups>
+ <group pattern="*.cpp;*.cxx;*.h" name="Sources" />
+ <group pattern="*.ui" name="User Interface" />
+ <group pattern="*.png" name="Icons" />
+ <group pattern="*.po;*.ts" name="Translations" />
+ <group pattern="*" name="Others" />
+ <hidenonprojectfiles>false</hidenonprojectfiles>
+ <hidenonlocation>false</hidenonlocation>
+ </groups>
+ <tree>
+ <hidepatterns>*.o,*.lo,CVS</hidepatterns>
+ <hidenonprojectfiles>false</hidenonprojectfiles>
+ </tree>
+ </kdevfileview>
+ <kdevdoctreeview>
+ <ignoretocs>
+ <toc>ada</toc>
+ <toc>ada_bugs_gcc</toc>
+ <toc>bash</toc>
+ <toc>bash_bugs</toc>
+ <toc>clanlib</toc>
+ <toc>w3c-dom-level2-html</toc>
+ <toc>fortran_bugs_gcc</toc>
+ <toc>gnome1</toc>
+ <toc>gnustep</toc>
+ <toc>gtk</toc>
+ <toc>gtk_bugs</toc>
+ <toc>haskell</toc>
+ <toc>haskell_bugs_ghc</toc>
+ <toc>java_bugs_gcc</toc>
+ <toc>java_bugs_sun</toc>
+ <toc>pascal_bugs_fp</toc>
+ <toc>php</toc>
+ <toc>php_bugs</toc>
+ <toc>perl</toc>
+ <toc>perl_bugs</toc>
+ <toc>python</toc>
+ <toc>python_bugs</toc>
+ <toc>ruby</toc>
+ <toc>ruby_bugs</toc>
+ <toc>sdl</toc>
+ <toc>w3c-svg</toc>
+ <toc>sw</toc>
+ <toc>w3c-uaag10</toc>
+ <toc>wxwidgets_bugs</toc>
+ </ignoretocs>
+ <ignoreqt_xml>
+ <toc>qmake User Guide</toc>
+ </ignoreqt_xml>
+ </kdevdoctreeview>
+ <kdevdebugger>
+ <general>
+ <dbgshell>libtool</dbgshell>
+ <programargs/>
+ <gdbpath/>
+ <configGdbScript/>
+ <runShellScript/>
+ <runGdbScript/>
+ <breakonloadinglibs>true</breakonloadinglibs>
+ <separatetty>false</separatetty>
+ <floatingtoolbar>false</floatingtoolbar>
+ </general>
+ <display>
+ <staticmembers>false</staticmembers>
+ <demanglenames>true</demanglenames>
+ <outputradix>10</outputradix>
+ </display>
+ </kdevdebugger>
+ <kdevfilecreate>
+ <filetypes/>
+ <useglobaltypes>
+ <type ext="ui" />
+ <type ext="cpp" />
+ <type ext="h" />
+ </useglobaltypes>
+ </kdevfilecreate>
+ <kdevcppsupport>
+ <references/>
+ <codecompletion>
+ <includeGlobalFunctions>true</includeGlobalFunctions>
+ <includeTypes>true</includeTypes>
+ <includeEnums>true</includeEnums>
+ <includeTypedefs>false</includeTypedefs>
+ <automaticCodeCompletion>true</automaticCodeCompletion>
+ <automaticArgumentsHint>true</automaticArgumentsHint>
+ <automaticHeaderCompletion>true</automaticHeaderCompletion>
+ <codeCompletionDelay>250</codeCompletionDelay>
+ <argumentsHintDelay>400</argumentsHintDelay>
+ <headerCompletionDelay>250</headerCompletionDelay>
+ </codecompletion>
+ </kdevcppsupport>
+ <cppsupportpart>
+ <filetemplates>
+ <interfacesuffix>.h</interfacesuffix>
+ <implementationsuffix>.cpp</implementationsuffix>
+ </filetemplates>
+ </cppsupportpart>
+ <dist>
+ <custom>false</custom>
+ <bzip>false</bzip>
+ <archname/>
+ <appname>katapult.kdevelop</appname>
+ <version>0.1</version>
+ <release/>
+ <vendor/>
+ <licence/>
+ <summary/>
+ <group/>
+ <packager/>
+ <description/>
+ <changelog/>
+ <devpackage>false</devpackage>
+ <docspackage>false</docspackage>
+ <appicon>false</appicon>
+ <arch>0</arch>
+ <genHTML>false</genHTML>
+ <useRPM>false</useRPM>
+ <ftpkde>false</ftpkde>
+ <appskde>false</appskde>
+ <url/>
+ </dist>
+ <kdevdocumentation>
+ <projectdoc>
+ <docsystem/>
+ <docurl/>
+ <usermanualurl/>
+ </projectdoc>
+ </kdevdocumentation>
+</kdevelop>
diff --git a/katapult/katapult.kdevses b/katapult/katapult.kdevses
new file mode 100644
index 0000000..1b4f6ed
--- /dev/null
+++ b/katapult/katapult.kdevses
@@ -0,0 +1,33 @@
+<?xml version = '1.0' encoding = 'UTF-8'?>
+<!DOCTYPE KDevPrjSession>
+<KDevPrjSession>
+ <DocsAndViews NumberOfDocuments="3" >
+ <Doc0 NumberOfViews="1" URL="file:///home/bastian/programmieren/katapult/trunk/katapult/katapult/katapult.cpp" >
+ <View0 Type="Source" />
+ </Doc0>
+ <Doc1 NumberOfViews="1" URL="file:///home/bastian/programmieren/katapult/trunk/katapult/katapult/katapult.h" >
+ <View0 line="58" Type="Source" />
+ </Doc1>
+ <Doc2 NumberOfViews="1" URL="file:///home/bastian/programmieren/katapult/trunk/katapult/katapult/main.cpp" >
+ <View0 line="57" Type="Source" />
+ </Doc2>
+ </DocsAndViews>
+ <pluginList>
+ <kdevdebugger>
+ <breakpointList/>
+ </kdevdebugger>
+ <kdevbookmarks>
+ <bookmarks/>
+ </kdevbookmarks>
+ <kdevrbdebugger>
+ <breakpointList/>
+ <watchExpressions/>
+ </kdevrbdebugger>
+ <kdevvalgrind>
+ <executable path="" params="" />
+ <valgrind path="" params="" />
+ <calltree path="" params="" />
+ <kcachegrind path="" />
+ </kdevvalgrind>
+ </pluginList>
+</KDevPrjSession>
diff --git a/katapult/katapult/Makefile.am b/katapult/katapult/Makefile.am
new file mode 100644
index 0000000..2eac818
--- /dev/null
+++ b/katapult/katapult/Makefile.am
@@ -0,0 +1,23 @@
+# set the include path for X, qt and KDE
+INCLUDES = -I$(top_srcdir)/katapult/common $(all_includes)
+
+# these are the headers for your project
+noinst_HEADERS = katapult.h katapultsettings.h katapultconfigdlg.h \
+ katapultiface.h
+
+
+# let automoc handle all of the meta source files (moc)
+METASOURCES = AUTO
+
+KDE_ICON = katapult
+
+bin_PROGRAMS = katapult
+
+# the application source, library search path, and link libraries
+katapult_SOURCES = confgeneral.ui confcatalogs.ui confdisplay.ui main.cpp \
+ katapult.cpp katapultsettings.cpp katapultconfigdlg.cpp katapultiface.skel
+katapult_LDFLAGS = $(KDE_RPATH) $(all_libraries)
+katapult_LDADD = $(LIB_QT) $(LIB_KDECORE) $(LIB_KDEUI) $(LIB_KIO) $(top_builddir)/katapult/common/libkatapult.la
+
+# this is where the desktop file will go
+xdg_apps_DATA = katapult.desktop
diff --git a/katapult/katapult/confcatalogs.ui b/katapult/katapult/confcatalogs.ui
new file mode 100644
index 0000000..a62e070
--- /dev/null
+++ b/katapult/katapult/confcatalogs.ui
@@ -0,0 +1,39 @@
+<!DOCTYPE UI><UI version="3.2" stdsetdef="1">
+<class>ConfCatalogs</class>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>ConfCatalogs</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>300</width>
+ <height>211</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Catalogs</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="KActionSelector">
+ <property name="name">
+ <cstring>catalogs</cstring>
+ </property>
+ <property name="selectedInsertionPolicy">
+ <enum>Sorted</enum>
+ </property>
+ <property name="showUpDownButtons">
+ <bool>false</bool>
+ </property>
+ </widget>
+ </vbox>
+</widget>
+<layoutdefaults spacing="6" margin="11"/>
+<includehints>
+ <includehint>kactionselector.h</includehint>
+</includehints>
+</UI>
diff --git a/katapult/katapult/confdisplay.ui b/katapult/katapult/confdisplay.ui
new file mode 100644
index 0000000..164fefc
--- /dev/null
+++ b/katapult/katapult/confdisplay.ui
@@ -0,0 +1,64 @@
+<!DOCTYPE UI><UI version="3.2" stdsetdef="1">
+<class>ConfDisplay</class>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>ConfDisplay</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>299</width>
+ <height>216</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Display</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="KComboBox">
+ <property name="name">
+ <cstring>displayName</cstring>
+ </property>
+ <property name="duplicatesEnabled">
+ <bool>false</bool>
+ </property>
+ </widget>
+ <widget class="QFrame">
+ <property name="name">
+ <cstring>displaySettings</cstring>
+ </property>
+ <property name="frameShape">
+ <enum>StyledPanel</enum>
+ </property>
+ <property name="frameShadow">
+ <enum>Raised</enum>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>spacer1</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>80</height>
+ </size>
+ </property>
+ </spacer>
+ </vbox>
+</widget>
+<layoutdefaults spacing="6" margin="11"/>
+<includehints>
+ <includehint>kcombobox.h</includehint>
+</includehints>
+</UI>
diff --git a/katapult/katapult/confgeneral.ui b/katapult/katapult/confgeneral.ui
new file mode 100644
index 0000000..2c4d839
--- /dev/null
+++ b/katapult/katapult/confgeneral.ui
@@ -0,0 +1,250 @@
+<!DOCTYPE UI><UI version="3.2" stdsetdef="1">
+<class>ConfGeneral</class>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>ConfGeneral</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>543</width>
+ <height>669</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>General Settings</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QButtonGroup">
+ <property name="name">
+ <cstring>buttonGroup2</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>3</hsizetype>
+ <vsizetype>1</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="title">
+ <string>Executing Actions</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>HideDelayLabel</cstring>
+ </property>
+ <property name="text">
+ <string>Delay before hiding &amp;launcher:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>hideDelay</cstring>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>How long Katapult waits before hiding the launcher</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>After an action is performed or no results were found, the Katapult launcher will be hidden.
+
+This sets how long Katapult will wait before hiding the launcher.</string>
+ </property>
+ </widget>
+ <widget class="QSlider">
+ <property name="name">
+ <cstring>hideDelay</cstring>
+ </property>
+ <property name="maxValue">
+ <number>5000</number>
+ </property>
+ <property name="lineStep">
+ <number>100</number>
+ </property>
+ <property name="pageStep">
+ <number>1000</number>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="tickmarks">
+ <enum>Below</enum>
+ </property>
+ <property name="tickInterval">
+ <number>1000</number>
+ </property>
+ </widget>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>autoExec</cstring>
+ </property>
+ <property name="text">
+ <string>Automatically perform &amp;default action</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Whether to wait for confirmation or automatically execute actions</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>If enabled, Katapult will automatically perform the default action once all items but one have been eliminated. This avoids the extra keystroke after there is only one possibility.</string>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ <widget class="QButtonGroup">
+ <property name="name">
+ <cstring>noResultOptions</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>1</hsizetype>
+ <vsizetype>1</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="title">
+ <string>No Results</string>
+ </property>
+ <property name="selectedId" stdset="0">
+ <number>-1</number>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>textLabel1</cstring>
+ </property>
+ <property name="text">
+ <string>When there are no results:</string>
+ </property>
+ </widget>
+ <widget class="QRadioButton">
+ <property name="name">
+ <cstring>nrClearQuery</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Clear the query after a delay</string>
+ </property>
+ </widget>
+ <widget class="QRadioButton">
+ <property name="name">
+ <cstring>nrHideDisplay</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Hide the display after a delay</string>
+ </property>
+ </widget>
+ <widget class="QRadioButton">
+ <property name="name">
+ <cstring>nrDoNothing</cstring>
+ </property>
+ <property name="text">
+ <string>Do &amp;nothing</string>
+ </property>
+ </widget>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>textLabel2</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Delay before clearing or hiding:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>noResultsDelay</cstring>
+ </property>
+ </widget>
+ <widget class="QSlider">
+ <property name="name">
+ <cstring>noResultsDelay</cstring>
+ </property>
+ <property name="maxValue">
+ <number>5000</number>
+ </property>
+ <property name="lineStep">
+ <number>100</number>
+ </property>
+ <property name="pageStep">
+ <number>1000</number>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="tickmarks">
+ <enum>Below</enum>
+ </property>
+ <property name="tickInterval">
+ <number>1000</number>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ <widget class="QButtonGroup">
+ <property name="name">
+ <cstring>buttonGroup3</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>3</hsizetype>
+ <vsizetype>1</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="title">
+ <string>System Tray</string>
+ </property>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>systrayIcon</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>10</x>
+ <y>30</y>
+ <width>280</width>
+ <height>24</height>
+ </rect>
+ </property>
+ <property name="mouseTracking">
+ <bool>false</bool>
+ </property>
+ <property name="text">
+ <string>&amp;Show an icon in the systray</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>If activated, katapult shows an icon in the System Tray when running</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>If enabled, Katapult will automatically show an Icon in the System Tray.</string>
+ </property>
+ </widget>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>spacer3_2</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>62</height>
+ </size>
+ </property>
+ </spacer>
+ </vbox>
+</widget>
+<layoutdefaults spacing="6" margin="11"/>
+</UI>
diff --git a/katapult/katapult/hi128-app-katapult.png b/katapult/katapult/hi128-app-katapult.png
new file mode 100644
index 0000000..88234a0
--- /dev/null
+++ b/katapult/katapult/hi128-app-katapult.png
Binary files differ
diff --git a/katapult/katapult/hi16-app-katapult.png b/katapult/katapult/hi16-app-katapult.png
new file mode 100644
index 0000000..e4b2cf2
--- /dev/null
+++ b/katapult/katapult/hi16-app-katapult.png
Binary files differ
diff --git a/katapult/katapult/hi22-app-katapult.png b/katapult/katapult/hi22-app-katapult.png
new file mode 100644
index 0000000..e8ec188
--- /dev/null
+++ b/katapult/katapult/hi22-app-katapult.png
Binary files differ
diff --git a/katapult/katapult/hi32-app-katapult.png b/katapult/katapult/hi32-app-katapult.png
new file mode 100644
index 0000000..d7ab85b
--- /dev/null
+++ b/katapult/katapult/hi32-app-katapult.png
Binary files differ
diff --git a/katapult/katapult/hi48-app-katapult.png b/katapult/katapult/hi48-app-katapult.png
new file mode 100644
index 0000000..c7e71d9
--- /dev/null
+++ b/katapult/katapult/hi48-app-katapult.png
Binary files differ
diff --git a/katapult/katapult/hi64-app-katapult.png b/katapult/katapult/hi64-app-katapult.png
new file mode 100644
index 0000000..b11b16c
--- /dev/null
+++ b/katapult/katapult/hi64-app-katapult.png
Binary files differ
diff --git a/katapult/katapult/hisc-app-katapult.svgz b/katapult/katapult/hisc-app-katapult.svgz
new file mode 100644
index 0000000..894e2f5
--- /dev/null
+++ b/katapult/katapult/hisc-app-katapult.svgz
Binary files differ
diff --git a/katapult/katapult/katapult.cpp b/katapult/katapult/katapult.cpp
new file mode 100644
index 0000000..b0d2756
--- /dev/null
+++ b/katapult/katapult/katapult.cpp
@@ -0,0 +1,360 @@
+/***************************************************************************
+ * Copyright (C) 2005 by Joe Ferris *
+ * jferris@optimistictech.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. *
+ * *
+ * 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. *
+ ***************************************************************************/
+
+#include <kapp.h>
+#include <kiconloader.h>
+#include <kglobal.h>
+#include <kwin.h>
+#include <kkeydialog.h>
+#include <kaction.h>
+#include <kparts/componentfactory.h>
+#include <kpassivepopup.h>
+#include <kpopupmenu.h>
+#include <klocale.h>
+#include <kaboutapplication.h>
+#include <dcopclient.h>
+
+#include <qpopupmenu.h>
+#include <qmenudata.h>
+#include <qcursor.h>
+
+#include "katapult.h"
+#include "actionregistry.h"
+#include "katapultcatalog.h"
+#include "katapultdisplay.h"
+#include "katapultsettings.h"
+#include "status.h"
+
+Katapult::Katapult()
+ : DCOPObject("Katapult"),
+ KSystemTray(0, "katapultSysTray")
+{
+ // Register with DCOP
+ kapp->dcopClient()->registerAs("katapult", false);
+ kapp->dcopClient()->setDefaultObject(objId());
+
+ setPixmap(KGlobal::iconLoader()->loadIcon("katapult", KIcon::Small));
+
+ display = 0;
+ globalAccel = 0;
+ actions = 0;
+ action = 0;
+ executing = FALSE;
+ _query = "";
+
+ settings = new KatapultSettings();
+
+ hideTimer = new QTimer(this);
+ connect(hideTimer, SIGNAL(timeout()), this, SLOT(hideLauncher()));
+ clearTimer = new QTimer(this);
+ connect(clearTimer, SIGNAL(timeout()), this, SLOT(clearQuery()));
+
+ connect(settings, SIGNAL(catalogsChanged()), this, SLOT(loadCatalogPlugins()));
+ connect(settings, SIGNAL(displayChanged()), this, SLOT(initDisplay()));
+ connect(settings, SIGNAL(systrayChanged()), this, SLOT(updateSystray()));
+
+ loadCatalogPlugins();
+ initDisplay();
+
+ if(settings->systrayIcon())
+ {
+ show();
+ }
+
+ //show popup (unless we're session restored)
+ if (!settings->hideNotification()) {
+ QString msg = i18n("Application successfully started !\nPress %1 to use it...")
+ .arg(globalAccel->shortcut("show_katapult").toString());
+ KPassivePopup::message(i18n("Katapult Notification"), msg, kapp->miniIcon(), this, 0, settings->notificationTimeout());
+ }
+}
+
+Katapult::~Katapult()
+{
+ if(globalAccel != 0)
+ delete globalAccel;
+ if(actions != 0)
+ delete actions;
+ delete settings;
+}
+
+void Katapult::loadCatalogPlugins()
+{
+ catalogs = settings->activeCatalogs();
+}
+
+void Katapult::initDisplay()
+{
+ display = settings->display();
+ if(display == 0) {
+ initAccel(this);
+ } else {
+ initAccel(display);
+ setQuery("");
+ connect(display, SIGNAL(keyReleased(QKeyEvent *)), this, SLOT(keyReleased(QKeyEvent *)));
+ connect(display, SIGNAL(focusOut()), this, SLOT(hideLauncher()));
+ }
+}
+
+void Katapult::initAccel(QWidget *parent)
+{
+ globalAccel = new KGlobalAccel(parent);
+ globalAccel->insert("show_katapult", i18n("Show Launcher"), i18n("Shows the Katapult launcher"), ALT+Key_Space, ALT+Key_Space,
+ this, SLOT(showLauncher()));
+ globalAccel->readSettings();
+ globalAccel->updateConnections();
+
+ actions = new KActionCollection(parent);
+ actionCollection()->clear();
+
+ contextMenu()->clear();
+
+ new KAction(i18n("Execute"), "exec", Key_Return, this, SLOT(execute()), actions, "execute");
+ new KAction(i18n("Clear"), "editclear", Key_Left, this, SLOT(clearQuery()), actions, "clear");
+ new KAction(i18n("Close"), "fileclose", Key_Escape, this, SLOT(hideLauncher()), actions, "close");
+ new KAction(i18n("Complete Query"), "next", Key_Right, this, SLOT(completeQuery()), actions, "complete_query");
+ new KAction(i18n("Show Context Menu"), "menu", CTRL+Key_C, this, SLOT(showContextMenu()), actions, "show_menu");
+
+ KAction *actGlobAccel = KStdAction::keyBindings(this, SLOT(showGlobalShortcutsDialog()), actions);
+ actGlobAccel->setText(i18n("Configure &Global Shortcuts..."));
+ actGlobAccel->plug((QWidget *) contextMenu());
+
+ KStdAction::keyBindings(this, SLOT(showShortcutsDialog()), actions)->plug((QWidget *) contextMenu());
+ KStdAction::preferences(settings, SLOT(configure()), actions)->plug((QWidget *) contextMenu());
+
+ contextMenu()->insertSeparator();
+ KStdAction::aboutApp(this, SLOT(showAboutDialog()), actions)->plug((QWidget *) contextMenu());
+ contextMenu()->insertSeparator();
+
+ KStdAction::quit(this, SLOT(close()), actions)->plug((QWidget *) contextMenu());
+
+ actions->readShortcutSettings();
+}
+
+void Katapult::completeQuery()
+{
+ if(!bestMatch.isNull()) {
+ QString newQuery = bestMatch.item()->text();
+ setQuery("");
+ setQuery(newQuery);
+ }
+}
+
+void Katapult::clearQuery()
+{
+ setQuery("");
+}
+
+void Katapult::setQuery(QString _query)
+{
+ allStatus=0;
+ bestMatch = Match();
+
+ this->_query = _query;
+ if(display != 0)
+ display->setQuery(_query);
+ if(_query == "")
+ {
+ QDictIterator<KatapultCatalog> it(catalogs);
+ KatapultCatalog *catalog;
+ while((catalog = it.current()) != 0)
+ {
+ ++it;
+ catalog->setQuery("");
+ }
+ display->setItem(0);
+ display->setAction(0);
+ display->setStatus(0);
+ display->setSelected(0);
+ action = 0;
+ } else if(catalogs.count() == 0) {
+ allStatus = S_Active | S_NoResults;
+ display->setStatus(allStatus);
+ } else {
+ QDictIterator<KatapultCatalog> it(catalogs);
+ KatapultCatalog *catalog;
+ int status;
+
+ while((catalog = it.current()) != 0)
+ {
+ ++it;
+ catalog->setQuery(_query);
+
+ status = catalog->status();
+ if(status & S_HasResults)
+ {
+ if(allStatus & S_HasResults)
+ allStatus |= S_Multiple;
+ Match match = catalog->bestMatch();
+ if(!match.isNull())
+ {
+ if(bestMatch.isNull() || bestMatch.rank() < match.rank())
+ bestMatch = match;
+ }
+ }
+ allStatus |= status;
+ }
+ if(bestMatch.isNull() || bestMatch.rank() == 0)
+ bestMatch = Match();
+ if(!bestMatch.isNull()) {
+ QPtrList<KatapultAction> itemActions = ActionRegistry::self()->actionsForItem(bestMatch.item());
+ action = itemActions.at(0);
+ connect(bestMatch.item(), SIGNAL(itemChanged()), this, SLOT(updateDisplay()));
+ }
+ }
+ if(!(allStatus & S_HasResults) && allStatus & S_Active) {
+ // no results
+ switch(settings->noResultsAction()) {
+ case KatapultSettings::NR_HideDisplay:
+ hideTimer->start(settings->noResultsDelay(), TRUE);
+ break;
+ case KatapultSettings::NR_ClearQuery:
+ clearTimer->start(settings->noResultsDelay(), TRUE);
+ break;
+ default:
+ break;
+ }
+ } else {
+ //stop timers if a catalog has suddenly realized it
+ //does accept the input after all.
+ if (hideTimer->isActive())
+ hideTimer->stop();
+ if (clearTimer->isActive())
+ clearTimer->stop();
+ }
+
+ if(!executing && settings->isAutoExecute() && allStatus & S_HasResults && !(allStatus & S_Multiple)) {
+ execute();
+ }
+
+ updateDisplay();
+}
+
+void Katapult::showAboutDialog()
+{
+ KAboutApplication *aboutDialog = new KAboutApplication(this);
+ aboutDialog->exec();
+ delete aboutDialog;
+}
+
+void Katapult::updateDisplay()
+{
+ if(display != 0 && executing == FALSE)
+ {
+ display->setItem(bestMatch.item());
+ if(bestMatch.isNull()) {
+ display->setAction(0);
+ display->setSelected(0);
+ } else {
+ display->setAction(action);
+ display->setSelected(bestMatch.matched());
+ }
+ display->setStatus(allStatus);
+ display->update();
+ }
+}
+
+void Katapult::showLauncher()
+{
+ if(!settings->isConfiguring() && display != 0)
+ {
+ setQuery("");
+ display->setStatus(0);
+ display->setQuery("");
+ display->show();
+ display->update();
+ KWin::forceActiveWindow(display->winId());
+ }
+}
+
+void Katapult::hideLauncher()
+{
+ if(display != 0)
+ display->hide();
+ setQuery("");
+}
+
+void Katapult::showShortcutsDialog()
+{
+ KKeyDialog::configure(actions);
+}
+
+void Katapult::showGlobalShortcutsDialog()
+{
+ KKeyDialog::configure(globalAccel);
+}
+
+void Katapult::execute()
+{
+ executing = TRUE;
+ if(action == 0)
+ {
+ display->setStatus(S_Active | S_NoResults);
+ display->update();
+ hideTimer->start(settings->hideDelay(), TRUE);
+ } else {
+ completeQuery();
+ if(!bestMatch.isNull())
+ action->execute(bestMatch.item());
+ hideTimer->start(settings->hideDelay(), TRUE);
+ }
+ executing = FALSE;
+}
+
+void Katapult::updateSystray()
+{
+ if(settings->systrayIcon())
+ show();
+ else
+ hide();
+}
+
+void Katapult::showContextMenu()
+{
+ contextMenu()->popup(QCursor::pos());
+}
+
+void Katapult::keyReleased(QKeyEvent *e)
+{
+ if(e->key() == Key_BackSpace) {
+ if(hideTimer->isActive())
+ hideTimer->stop();
+ if(clearTimer->isActive())
+ clearTimer->stop();
+ QString newQuery = _query.left(_query.length()-1);
+ setQuery("");
+ setQuery(newQuery);
+ } else {
+ QString t = e->text();
+ if ( !t.isEmpty() && (!e->ascii() || e->ascii()>=32) &&
+ e->key() != Key_Delete)
+ setQuery(_query + t);
+ }
+}
+
+void Katapult::mousePressEvent(QMouseEvent *e)
+{
+ if(e->button() == LeftButton)
+ showLauncher();
+ else
+ KSystemTray::mousePressEvent(e);
+}
+
+#include "katapult.moc"
diff --git a/katapult/katapult/katapult.desktop b/katapult/katapult/katapult.desktop
new file mode 100644
index 0000000..1e86939
--- /dev/null
+++ b/katapult/katapult/katapult.desktop
@@ -0,0 +1,30 @@
+[Desktop Entry]
+Encoding=UTF-8
+Name=Katapult
+Name[uk]=Катапульта
+Exec=katapult
+Icon=katapult
+GenericName=KDE launcher
+GenericName[ar]=مقلع KDE
+GenericName[bg]=Стартиране на KDE
+GenericName[br]=Loc'her KDE
+GenericName[da]=KDE-startværktøj
+GenericName[de]=KDE-Starter
+GenericName[el]=Εκτελεστής του KDE
+GenericName[es]=Iniciador KDE
+GenericName[et]=KDE käivitaja
+GenericName[fr]=Lanceur pour KDE
+GenericName[ga]=Tosaitheoir KDE
+GenericName[gl]=Iniciador de aplicazóns para KDE
+GenericName[it]=Avviatore per KDE
+GenericName[ja]=KDE ランチャー
+GenericName[nb]=KDE oppstarter
+GenericName[nl]=KDE-starter
+GenericName[pt]=Lançador do KDE
+GenericName[pt_BR]=Lançador do KDE
+GenericName[sv]=KDE-startverktyg
+GenericName[tr]=KDE Başlatıcısı
+GenericName[uk]=KDE пускач
+Terminal=false
+Type=Application
+Categories=Qt;KDE;Utility;
diff --git a/katapult/katapult/katapult.h b/katapult/katapult/katapult.h
new file mode 100644
index 0000000..6ba20d6
--- /dev/null
+++ b/katapult/katapult/katapult.h
@@ -0,0 +1,94 @@
+/***************************************************************************
+ * Copyright (C) 2005 by Joe Ferris *
+ * jferris@optimistictech.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. *
+ * *
+ * 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 _KATAPULT_H_
+#define _KATAPULT_H_
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <ksystemtray.h>
+#include <kglobalaccel.h>
+#include <kactioncollection.h>
+#include <dcopobject.h>
+
+#include <qstring.h>
+#include <qptrlist.h>
+#include <qevent.h>
+#include <qtimer.h>
+#include <qdict.h>
+
+#include <match.h>
+
+#include "katapultdisplay.h"
+#include "katapultcatalog.h"
+#include "katapultaction.h"
+#include "katapultiface.h"
+
+class KatapultSettings;
+
+class Katapult : public KSystemTray, virtual public KatapultIface
+{
+ Q_OBJECT
+public:
+ Katapult();
+ ~Katapult();
+
+ void setQuery(QString);
+ QString query() const;
+
+public slots:
+ void updateDisplay();
+ void showLauncher();
+ void hideLauncher();
+ void completeQuery();
+ void clearQuery();
+ void showShortcutsDialog();
+ void showGlobalShortcutsDialog();
+ void showAboutDialog();
+ void loadCatalogPlugins();
+ void initDisplay();
+ virtual void keyReleased(QKeyEvent *);
+ void execute();
+ void updateSystray();
+ void showContextMenu();
+
+protected:
+ virtual void mousePressEvent(QMouseEvent *);
+
+private:
+ void initAccel(QWidget *);
+
+ bool executing;
+ int allStatus;
+ KatapultDisplay *display;
+ KGlobalAccel *globalAccel;
+ KActionCollection *actions;
+ KatapultSettings *settings;
+ Match bestMatch;
+ const KatapultAction *action;
+ QString _query;
+ QDict<KatapultCatalog> catalogs;
+ QTimer *hideTimer;
+ QTimer *clearTimer;
+};
+
+#endif // _KATAPULT_H_
diff --git a/katapult/katapult/katapultconfigdlg.cpp b/katapult/katapult/katapultconfigdlg.cpp
new file mode 100644
index 0000000..26b275e
--- /dev/null
+++ b/katapult/katapult/katapultconfigdlg.cpp
@@ -0,0 +1,181 @@
+/***************************************************************************
+ * Copyright (C) 2005 by Joe Ferris *
+ * jferris@optimistictech.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. *
+ * *
+ * 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. *
+ ***************************************************************************/
+
+#include <kactionselector.h>
+#include <kconfig.h>
+#include <kapplication.h>
+#include <kcombobox.h>
+#include <klocale.h>
+
+#include <qframe.h>
+#include <qlayout.h>
+#include <qslider.h>
+#include <qcheckbox.h>
+#include <qstringlist.h>
+#include <qradiobutton.h>
+
+#include "katapultconfigdlg.h"
+#include "katapultsettings.h"
+#include "katapultcatalog.h"
+#include "katapultdisplay.h"
+
+#include "confgeneral.h"
+#include "confcatalogs.h"
+#include "confdisplay.h"
+
+KatapultConfigDlg::KatapultConfigDlg(KatapultSettings *settings)
+ : KDialogBase(TreeList, "Configure", Ok|Cancel, Ok)
+{
+ this->settings = settings;
+ setTreeListAutoResize(TRUE);
+
+ // general settings
+ QFrame *fConfGeneral = addPage(QString("Katapult"), i18n("General Settings"));
+ general = new ConfGeneral(fConfGeneral);
+ (new QVBoxLayout(fConfGeneral, 0, KDialog::spacingHint()))->addWidget(general);
+
+ general->hideDelay->setValue(settings->hideDelay());
+ general->autoExec->setChecked(settings->isAutoExecute());
+ general->noResultsDelay->setValue(settings->noResultsDelay());
+ general->systrayIcon->setChecked(settings->systrayIcon());
+ switch(settings->noResultsAction()) {
+ case KatapultSettings::NR_DoNothing: general->nrDoNothing->setChecked(TRUE); break;
+ case KatapultSettings::NR_HideDisplay: general->nrHideDisplay->setChecked(TRUE); break;
+ default: general->nrClearQuery->setChecked(TRUE); break;
+ }
+ connect(general->nrDoNothing, SIGNAL(toggled(bool)), this, SLOT(nrDoNothingToggled(bool)));
+ general->noResultsDelay->setEnabled(!general->nrDoNothing->isChecked());
+
+ // catalog settings
+ QFrame *fConfCatalogs = addPage(i18n("Catalogs"), i18n("Enabled Catalogs"));
+ catalogConf = new ConfCatalogs(fConfCatalogs);
+ (new QVBoxLayout(fConfCatalogs, 0, KDialog::spacingHint()))->addWidget(catalogConf);
+
+ catalogConf->catalogs->selectedListBox()->insertStringList(settings->activeCatalogNames());
+ catalogConf->catalogs->availableListBox()->insertStringList(settings->inactiveCatalogNames());
+
+ catalogPages.setAutoDelete(TRUE);
+ QDict<KatapultCatalog> catalogs;
+ catalogs = settings->activeCatalogs();
+ QDictIterator<KatapultCatalog> it(catalogs);
+ KatapultCatalog *catalog;
+ while((catalog = it.current()) != 0)
+ {
+ QString catalogName = it.currentKey();
+ addCatalogPage(catalogName, catalog);
+ ++it;
+ }
+
+ // display settings
+ QFrame *fConfDisplay = addPage(i18n("Display"), i18n("Display"));
+ display = new ConfDisplay(fConfDisplay);
+ (new QVBoxLayout(fConfDisplay, 0, KDialog::spacingHint()))->addWidget(display);
+ new QVBoxLayout((QWidget *) display->displaySettings, 0, KDialog::spacingHint());
+
+ QStringList displays = settings->displayNames();
+ display->displayName->insertStringList(displays);
+ display->displayName->setCurrentItem(settings->displayNumber());
+ displayConfig = 0;
+ addDisplaySettings();
+
+ unfoldTreeList(TRUE);
+
+ // connect signals
+ connect(catalogConf->catalogs, SIGNAL(added(QListBoxItem *)), this, SLOT(activateCatalog(QListBoxItem* )));
+ connect(catalogConf->catalogs, SIGNAL(removed(QListBoxItem *)), this, SLOT(deactivateCatalog(QListBoxItem* )));
+ connect(display->displayName, SIGNAL(activated(int)), this, SLOT(activateDisplay(int)));
+ connect(this, SIGNAL(okClicked()), this, SLOT(saveSettings()));
+}
+
+KatapultConfigDlg::~KatapultConfigDlg()
+{
+}
+
+void KatapultConfigDlg::nrDoNothingToggled(bool on)
+{
+ general->noResultsDelay->setEnabled(!on);
+}
+
+void KatapultConfigDlg::saveSettings()
+{
+ settings->setHideDelay(general->hideDelay->value());
+ settings->setAutoExecute(general->autoExec->isChecked());
+ settings->setNoResultsDelay(general->noResultsDelay->value());
+ settings->setSystrayIcon(general->systrayIcon->isChecked());
+ if (general->nrDoNothing->isChecked()) {
+ settings->setNoResultsAction(KatapultSettings::NR_DoNothing);
+ } else if (general->nrHideDisplay->isChecked()) {
+ settings->setNoResultsAction(KatapultSettings::NR_HideDisplay);
+ } else {
+ settings->setNoResultsAction(KatapultSettings::NR_ClearQuery);
+ }
+}
+
+void KatapultConfigDlg::activateCatalog(QListBoxItem *i)
+{
+ settings->activateCatalog(i->text());
+ KatapultCatalog *catalog = settings->catalog(i->text());
+ if(catalog != 0)
+ addCatalogPage(i->text(), catalog);
+}
+
+void KatapultConfigDlg::deactivateCatalog(QListBoxItem *i)
+{
+ catalogPages.remove(i->text());
+ settings->deactivateCatalog(i->text());
+}
+
+void KatapultConfigDlg::activateDisplay(int index)
+{
+ settings->setDisplayName(settings->displayIds()[index]);
+ addDisplaySettings();
+}
+
+void KatapultConfigDlg::addCatalogPage(QString name, KatapultCatalog *catalog)
+{
+ QWidget *catalogConfig = catalog->configure();
+ if(catalogConfig != 0)
+ {
+ QStringList path;
+ path << i18n("Catalogs") << name;
+ QFrame *fCatalog = addPage(path, name);
+ catalogConfig->reparent(fCatalog, QPoint(0, 0));
+ (new QVBoxLayout(fCatalog, 0, KDialog::spacingHint()))->addWidget(catalogConfig);
+ catalogPages.insert(name, fCatalog);
+ }
+}
+
+void KatapultConfigDlg::addDisplaySettings()
+{
+ if(displayConfig != 0)
+ {
+ delete displayConfig;
+ displayConfig = 0;
+ }
+ displayConfig = settings->display()->configure();
+ if(displayConfig != 0)
+ {
+ displayConfig->reparent((QWidget *) display->displaySettings, QPoint(0, 0));
+ display->displaySettings->layout()->add(displayConfig);
+ displayConfig->show();
+ }
+}
+
+#include "katapultconfigdlg.moc"
diff --git a/katapult/katapult/katapultconfigdlg.h b/katapult/katapult/katapultconfigdlg.h
new file mode 100644
index 0000000..6b164ab
--- /dev/null
+++ b/katapult/katapult/katapultconfigdlg.h
@@ -0,0 +1,64 @@
+/***************************************************************************
+ * Copyright (C) 2005 by Joe Ferris *
+ * jferris@optimistictech.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. *
+ * *
+ * 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 KATAPULTCONFIGDLG_H
+#define KATAPULTCONFIGDLG_H
+
+#include <kdialogbase.h>
+
+#include <qdict.h>
+
+class KatapultSettings;
+class KatapultCatalog;
+class ConfGeneral;
+class ConfCatalogs;
+class ConfDisplay;
+class QListBoxItem;
+class QFrame;
+
+/**
+@author Joe Ferris
+*/
+class KatapultConfigDlg : public KDialogBase
+{
+Q_OBJECT
+public:
+ KatapultConfigDlg(KatapultSettings *settings);
+ ~KatapultConfigDlg();
+
+public slots:
+ void saveSettings();
+ void activateCatalog(QListBoxItem *);
+ void deactivateCatalog(QListBoxItem *);
+ void activateDisplay(int);
+ void nrDoNothingToggled(bool);
+
+private:
+ void addCatalogPage(QString name, KatapultCatalog *catalog);
+ void addDisplaySettings();
+
+ KatapultSettings *settings;
+ ConfGeneral *general;
+ ConfCatalogs *catalogConf;
+ ConfDisplay *display;
+ QWidget *displayConfig;
+ QDict<QFrame> catalogPages;
+};
+
+#endif
diff --git a/katapult/katapult/katapultiface.h b/katapult/katapult/katapultiface.h
new file mode 100644
index 0000000..9595246
--- /dev/null
+++ b/katapult/katapult/katapultiface.h
@@ -0,0 +1,38 @@
+/***************************************************************************
+ * Copyright (C) 2005 by Bastian Holst *
+ * bastianholst@gmx.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. *
+ ***************************************************************************/
+// -*- c++ -*-
+
+#ifndef KATAPULTDCOPIFACE_H
+#define KATAPULTDCOPIFACE_H
+
+#include <dcopobject.h>
+
+class KatapultIface : virtual public DCOPObject
+{
+ K_DCOP
+ k_dcop:
+
+ virtual void showLauncher() = 0;
+ virtual void hideLauncher() = 0;
+ virtual void setQuery(QString) = 0;
+ virtual void execute() = 0;
+};
+
+#endif // KATAPULTDCOPIFACE_H
diff --git a/katapult/katapult/katapultsettings.cpp b/katapult/katapult/katapultsettings.cpp
new file mode 100644
index 0000000..ae316f5
--- /dev/null
+++ b/katapult/katapult/katapultsettings.cpp
@@ -0,0 +1,377 @@
+/***************************************************************************
+ * Copyright (C) 2007 Martin Meredith *
+ * mez@ubuntu.com *
+ * *
+ * Copyright (C) 2005 by Joe Ferris *
+ * jferris@optimistictech.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. *
+ * *
+ * 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. *
+ ***************************************************************************/
+
+#include <kapplication.h>
+#include <kconfig.h>
+#include <kparts/componentfactory.h>
+#include <klocale.h>
+
+#include <qstring.h>
+#include <qstringlist.h>
+
+#include "katapultsettings.h"
+#include "katapultcatalog.h"
+#include "katapultconfigdlg.h"
+#include "katapultdisplay.h"
+#include "actionregistry.h"
+
+KatapultSettings::KatapultSettings()
+{
+ _forceWrite = FALSE;
+ readSettings();
+ _isConfiguring = FALSE;
+ _activeCatalogs.setAutoDelete(TRUE);
+ _display = 0;
+
+ loadCatalogPlugins();
+ loadDisplayPlugins();
+}
+
+
+KatapultSettings::~KatapultSettings()
+{
+ if (_forceWrite)
+ writeSettings();
+
+ if(_display != 0)
+ delete _display;
+}
+
+void KatapultSettings::readSettings()
+{
+ KConfig *config = kapp->config();
+ _hideSessionNotification = config->readNumEntry("HideSessionNotification", 1);
+ _hideUserNotification = config->readNumEntry("HideUserNotification", 0);
+ _notificationTimeout = config->readNumEntry("NotificationTimeout", 5000);
+ _hideDelay = config->readUnsignedNumEntry("HideDelay", 1000);
+ _noResultsDelay = config->readUnsignedNumEntry("NoResultsDelay", 2500);
+ _noResultsAction = (NRAction) config->readUnsignedNumEntry("NoResultsAction", NR_ClearQuery);
+ _systrayIcon = config->readBoolEntry("SystrayIcon", TRUE);
+ _autoExec = config->readBoolEntry("AutoExec", FALSE);
+ _displayName = config->readEntry("Display", "Pure Display");
+
+ QStringList defCatalogs;
+ defCatalogs << "Program Catalog" << "Bookmark Catalog" << "Document Catalog" << "Calculator Catalog" << "Amarok Catalog" << "Spell Catalog" << "Google Catalog" << "Execution Catalog";
+ _activeCatalogNames = config->readListEntry("Catalogs", defCatalogs);
+
+ // Force a config write if notification is to be shown once.
+ // (in writeSettings(), _hideSessionNotification or _hideUserNotification
+ // is changed before writing [if necessary]).
+ _forceWrite = ((kapp->isSessionRestored() && _hideSessionNotification == 1) ||
+ (!kapp->isSessionRestored() && _hideUserNotification == 1));
+}
+
+void KatapultSettings::writeSettings()
+{
+ KConfig *config = kapp->config();
+ int hideSession = _hideSessionNotification;
+ int hideUser = _hideUserNotification;
+
+ // If notification had to be shown once, set it to hide always.
+ if (kapp->isSessionRestored()) {
+ if (hideSession == 1) hideSession = 2;
+ } else {
+ if (hideUser == 1) hideUser = 2;
+ }
+
+ config->writeEntry("HideSessionNotification", hideSession);
+ config->writeEntry("HideUserNotification", hideUser);
+ config->writeEntry("NotificationTimeout", _notificationTimeout);
+ config->writeEntry("HideDelay", _hideDelay);
+ config->writeEntry("NoResultsDelay", _noResultsDelay);
+ config->writeEntry("NoResultsAction", (int) _noResultsAction);
+ config->writeEntry("SystrayIcon", _systrayIcon);
+ config->writeEntry("AutoExec", _autoExec);
+ config->writeEntry("Catalogs", _activeCatalogNames);
+ config->writeEntry("Display", _displayName);
+
+ QDictIterator<KatapultCatalog> it(_activeCatalogs);
+ KatapultCatalog *catalog;
+ while((catalog = it.current()) != 0)
+ {
+ KConfigGroup group(config, QString("Catalogs/%1").arg(it.currentKey()));
+ catalog->writeSettings(&group);
+ ++it;
+ }
+
+ if(_display != 0)
+ {
+ KConfigGroup group(config, QString("Displays/%1").arg(_displayName));
+ _display->writeSettings(&group);
+ }
+
+ config->sync();
+}
+
+void KatapultSettings::configure()
+{
+ if(!_isConfiguring)
+ {
+ _isConfiguring = TRUE;
+
+ KatapultConfigDlg *dlg = new KatapultConfigDlg(this);
+ if(dlg->exec() == QDialog::Accepted) {
+ writeSettings();
+ emit systrayChanged();
+ loadCatalogPlugins();
+ emit catalogsChanged();
+
+ } else {
+ readSettings();
+ loadCatalogPlugins();
+ loadDisplayPlugins();
+ emit catalogsChanged();
+ emit displayChanged();
+ }
+ delete dlg;
+
+ _isConfiguring = FALSE;
+ }
+}
+
+bool KatapultSettings::isConfiguring() const
+{
+ return _isConfiguring;
+}
+
+bool KatapultSettings::isAutoExecute() const
+{
+ return _autoExec;
+}
+
+void KatapultSettings::setAutoExecute(bool _autoExec)
+{
+ this->_autoExec = _autoExec;
+}
+
+int KatapultSettings::hideDelay() const
+{
+ return _hideDelay;
+}
+
+void KatapultSettings::setHideDelay(int _hideDelay)
+{
+ this->_hideDelay = _hideDelay;
+}
+
+int KatapultSettings::noResultsDelay() const
+{
+ return _noResultsDelay;
+}
+
+void KatapultSettings::setNoResultsDelay(int _noResultsDelay)
+{
+ this->_noResultsDelay = _noResultsDelay;
+}
+
+KatapultSettings::NRAction KatapultSettings::noResultsAction() const
+{
+ return _noResultsAction;
+}
+
+void KatapultSettings::setNoResultsAction(NRAction _noResultsAction)
+{
+ this->_noResultsAction = _noResultsAction;
+}
+
+bool KatapultSettings::systrayIcon() const
+{
+ return _systrayIcon;
+}
+
+void KatapultSettings::setSystrayIcon(bool _systrayIcon)
+{
+ this->_systrayIcon = _systrayIcon;
+}
+
+bool KatapultSettings::hideNotification() const
+{
+ int hide = kapp->isSessionRestored() ? _hideSessionNotification : _hideUserNotification;
+ return (hide != 0 && hide != 1);
+}
+
+int KatapultSettings::notificationTimeout() const
+{
+ return _notificationTimeout;
+}
+
+QString KatapultSettings::displayName() const
+{
+ return _displayName;
+}
+
+QStringList KatapultSettings::displayNames() const
+{
+ return _displayNames;
+}
+
+QStringList KatapultSettings::displayIds() const
+{
+ return _displayIds;
+}
+
+int KatapultSettings::displayNumber() const
+{
+ return _displayIds.findIndex(_displayName);
+}
+
+KatapultDisplay * KatapultSettings::display() const
+{
+ return _display;
+}
+
+void KatapultSettings::setDisplayName(QString name)
+{
+ _displayName = name;
+ loadDisplayPlugins();
+ emit displayChanged();
+}
+
+QStringList KatapultSettings::catalogNames() const
+{
+ return _catalogNames;
+}
+
+QStringList KatapultSettings::catalogIds() const
+{
+ return _catalogIds;
+}
+
+QStringList KatapultSettings::activeCatalogNames() const
+{
+ return _activeCatalogNames;
+}
+
+QStringList KatapultSettings::inactiveCatalogNames() const
+{
+ QStringList inactiveCatalogs, catalogs = _catalogIds;
+ for(QStringList::Iterator it = catalogs.begin(); it != catalogs.end(); ++it)
+ {
+ if(!_activeCatalogNames.contains(*it))
+ inactiveCatalogs.append(*it);
+ }
+ return inactiveCatalogs;
+}
+
+QDict<KatapultCatalog> KatapultSettings::activeCatalogs() const
+{
+ return _activeCatalogs;
+}
+
+void KatapultSettings::activateCatalog(QString catalogName)
+{
+ _activeCatalogNames.append(catalogName);
+ loadCatalogPlugins();
+ emit catalogsChanged();
+}
+
+void KatapultSettings::deactivateCatalog(QString catalogName)
+{
+ _activeCatalogNames.remove(catalogName);
+ loadCatalogPlugins();
+ emit catalogsChanged();
+}
+
+void KatapultSettings::loadCatalogPlugins()
+{
+ _activeCatalogs.clear();
+ _catalogNames.clear();
+ _catalogIds.clear();
+ ActionRegistry::self()->clear();
+
+ KTrader::OfferList offers = KTrader::self()->query("Katapult/Catalog");
+ KTrader::OfferList::ConstIterator it;
+ for(it = offers.begin(); it != offers.end(); ++it)
+ {
+ QString id;
+
+ KService::Ptr service = *it;
+ KatapultCatalog *catalog;
+
+ if(!service->property("X-Katapult-ID", QVariant::String).toString().isEmpty())
+ id = service->property("X-Katapult-ID", QVariant::String).toString();
+ else
+ id = service->name();
+
+ _catalogNames.append(service->name());
+ _catalogIds.append(id);
+
+ if(_activeCatalogNames.contains(id))
+ {
+ int errCode = 0;
+ catalog = KParts::ComponentFactory::createInstanceFromService<KatapultCatalog>
+ (service, 0, 0, QStringList(), &errCode);
+ if(catalog != 0)
+ {
+ KConfigGroup group(kapp->config(), QString("Catalogs/%1").arg(id));
+ catalog->readSettings(&group);
+ catalog->initialize();
+ _activeCatalogs.insert(id, catalog);
+ }
+ }
+ }
+}
+
+void KatapultSettings::loadDisplayPlugins()
+{
+ if(_display != 0)
+ {
+ delete _display;
+ _display = 0;
+ }
+
+ _displayNames.clear();
+ _displayIds.clear();
+
+ KTrader::OfferList offers = KTrader::self()->query("Katapult/Display");
+ KTrader::OfferList::ConstIterator it;
+ for(it = offers.begin(); it != offers.end(); ++it)
+ {
+ KService::Ptr service = *it;
+
+ _displayNames.append(service->name());
+ if(!service->property("X-Katapult-ID", QVariant::String).toString().isEmpty())
+ _displayIds.append(service->property("X-Katapult-ID", QVariant::String).toString());
+ else
+ _displayIds.append(service->name());
+
+ if(_displayIds.last() == _displayName)
+ {
+ int errCode = 0;
+ _display = KParts::ComponentFactory::createInstanceFromService<KatapultDisplay>
+ (service, 0, 0, QStringList(), &errCode);
+ }
+ }
+ if(_display != 0)
+ {
+ KConfigGroup group(kapp->config(), QString("Displays/%1").arg(_displayName));
+ _display->readSettings(&group);
+ }
+}
+
+KatapultCatalog * KatapultSettings::catalog(QString catalogName) const
+{
+ return _activeCatalogs.find(catalogName);
+}
+
+#include "katapultsettings.moc"
diff --git a/katapult/katapult/katapultsettings.h b/katapult/katapult/katapultsettings.h
new file mode 100644
index 0000000..079ea2b
--- /dev/null
+++ b/katapult/katapult/katapultsettings.h
@@ -0,0 +1,120 @@
+/***************************************************************************
+ * Copyright (C) 2005 by Joe Ferris *
+ * jferris@optimistictech.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. *
+ * *
+ * 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 KATAPULTSETTINGS_H
+#define KATAPULTSETTINGS_H
+
+#include <qobject.h>
+#include <qptrlist.h>
+#include <qdict.h>
+
+class KatapultCatalog;
+class KatapultDisplay;
+class QStringList;
+class QString;
+
+/**
+@author Joe Ferris
+*/
+class KatapultSettings : public QObject
+{
+ Q_OBJECT
+public:
+ enum NRAction {
+ NR_DoNothing = 0,
+ NR_ClearQuery = 1,
+ NR_HideDisplay = 2
+ };
+
+ KatapultSettings();
+ ~KatapultSettings();
+
+ bool isConfiguring() const;
+
+ // general settings
+ bool isAutoExecute() const;
+ void setAutoExecute(bool);
+ int hideDelay() const;
+ void setHideDelay(int);
+ int noResultsDelay() const;
+ void setNoResultsDelay(int);
+ NRAction noResultsAction() const;
+ void setNoResultsAction(NRAction);
+ bool systrayIcon() const;
+ void setSystrayIcon(bool);
+ bool hideNotification() const;
+ int notificationTimeout() const;
+
+ // display settings
+ QString displayName() const;
+ QStringList displayNames() const;
+ QStringList displayIds() const;
+ int displayNumber() const;
+ KatapultDisplay * display() const;
+ void setDisplayName(QString name);
+
+ // catalog settings
+ QStringList catalogNames() const;
+ QStringList catalogIds() const;
+ QStringList activeCatalogNames() const;
+ QStringList inactiveCatalogNames() const;
+ QDict<KatapultCatalog> activeCatalogs() const;
+ void activateCatalog(QString catalogName);
+ void deactivateCatalog(QString catalogName);
+ KatapultCatalog * catalog(QString catalogName) const;
+
+public slots:
+ void readSettings();
+ void writeSettings();
+ void configure();
+
+signals:
+ void systrayChanged();
+ void displayChanged();
+ void catalogsChanged();
+
+private:
+ void loadCatalogPlugins();
+ void loadDisplayPlugins();
+
+ bool _isConfiguring;
+ bool _forceWrite;
+
+ // general settings
+ int _hideSessionNotification; // Hide Katapult Notification? (session restore / manual start)
+ int _hideUserNotification; // if 0: show always, if 1: show once, else: show never
+ int _notificationTimeout; // Delay before notification hides.
+ bool _autoExec;
+ int _hideDelay;
+ int _noResultsDelay;
+ NRAction _noResultsAction;
+ bool _systrayIcon;
+
+ // display settings
+ QString _displayName;
+ QStringList _displayNames;
+ QStringList _displayIds;
+ KatapultDisplay *_display;
+
+ // catalog settings
+ QStringList _catalogNames, _catalogIds, _activeCatalogNames;
+ QDict<KatapultCatalog> _activeCatalogs;
+};
+
+#endif
diff --git a/katapult/katapult/main.cpp b/katapult/katapult/main.cpp
new file mode 100644
index 0000000..0fc993d
--- /dev/null
+++ b/katapult/katapult/main.cpp
@@ -0,0 +1,73 @@
+/***************************************************************************
+ * Copyright (C) 2005 by Joe Ferris *
+ * jferris@optimistictech.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. *
+ * *
+ * 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. *
+ ***************************************************************************/
+
+#include <kapplication.h>
+#include <kaboutdata.h>
+#include <kcmdlineargs.h>
+#include <klocale.h>
+#include <kapp.h>
+#include <dcopclient.h>
+
+#include "katapult.h"
+
+static const char description[] =
+ I18N_NOOP("A plugin-driven utility that can launch applications, bookmarks, or anything else that you can find a plugin for.");
+
+static const char version[] = "0.3.2.1";
+
+static KCmdLineOptions options[] =
+{
+ KCmdLineLastOption
+};
+
+int main(int argc, char **argv)
+{
+ KAboutData about("katapult", I18N_NOOP("Katapult"), version, description,
+ KAboutData::License_GPL, I18N_NOOP("(C) until 2005, Joe Ferris\n(C) 2005, the Katapult development team"), 0, 0, "dev@thekatapult.org.uk");
+ about.addAuthor( "Martin Meredith" , I18N_NOOP("Project Manager"), "mez@thekatapult.org.uk");
+ about.addAuthor( "Bastian Holst", I18N_NOOP("Lead Developer"), "oculus@thekatapult.org.uk" );
+ about.addAuthor( "Tobi Vollebregt", I18N_NOOP("Developer"), "tobi@thekatapult.org.uk" );
+ about.addAuthor( "Lee Olson", I18N_NOOP("Graphics"), "clearbeast@gmail.com" );
+ about.addAuthor( "Jean-Remy Falleri", 0, "jr.falleri@gmail.com" );
+ about.addAuthor( "Jonathan Riddell", 0, "jriddell@ubuntu.com" );
+ about.addAuthor( "Joe Ferris", I18N_NOOP("Original Author"), "jferris@optimistictech.com" );
+ KCmdLineArgs::init(argc, argv, &about);
+ KCmdLineArgs::addCmdLineOptions( options );
+ KApplication app;
+
+ if(kapp->dcopClient()->isApplicationRegistered("katapult")) {
+ kapp->dcopClient()->send("katapult", "Katapult", "showLauncher()", QByteArray());
+ app.setStartupId("");
+ return(0);
+ }
+
+ Katapult mainWin;
+
+ KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
+
+ app.setMainWidget( &mainWin );
+
+ args->clear();
+
+ app.setStartupId("");
+
+ return app.exec();
+}
+
diff --git a/katapult/katapult/settings.cpp b/katapult/katapult/settings.cpp
new file mode 100644
index 0000000..a659e42
--- /dev/null
+++ b/katapult/katapult/settings.cpp
@@ -0,0 +1,106 @@
+#include <klocale.h>
+/****************************************************************************
+** Form implementation generated from reading ui file '/home/doros/src/local/kde/katapult/katapult/settings.ui'
+**
+** Created: Fri Feb 18 12:48:28 2005
+** by: The User Interface Compiler ($Id: qt/main.cpp 3.3.3 edited Nov 24 2003 $)
+**
+** WARNING! All changes made in this file will be lost!
+****************************************************************************/
+
+#include "settings.h"
+
+#include <qvariant.h>
+#include <qlistbox.h>
+#include <qtabwidget.h>
+#include <qwidget.h>
+#include <qpushbutton.h>
+#include <qlayout.h>
+#include <qtooltip.h>
+#include <qwhatsthis.h>
+
+/*
+ * Constructs a MyDialog1 as a child of 'parent', with the
+ * name 'name' and widget flags set to 'f'.
+ *
+ * The dialog will by default be modeless, unless you set 'modal' to
+ * TRUE to construct a modal dialog.
+ */
+MyDialog1::MyDialog1( QWidget* parent, const char* name, bool modal, WFlags fl )
+ : QDialog( parent, name, modal, fl )
+{
+ if ( !name )
+ setName( "MyDialog1" );
+ setSizeGripEnabled( TRUE );
+ MyDialog1Layout = new QGridLayout( this, 1, 1, 11, 6, "MyDialog1Layout");
+
+ listBox = new QListBox( this, "listBox" );
+ listBox->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)7, 0, 0, listBox->sizePolicy().hasHeightForWidth() ) );
+
+ MyDialog1Layout->addWidget( listBox, 0, 0 );
+
+ tabWidget = new QTabWidget( this, "tabWidget" );
+
+ Widget2 = new QWidget( tabWidget, "Widget2" );
+ tabWidget->insertTab( Widget2, QString("") );
+
+ Widget3 = new QWidget( tabWidget, "Widget3" );
+ tabWidget->insertTab( Widget3, QString("") );
+
+ MyDialog1Layout->addWidget( tabWidget, 0, 1 );
+
+ Layout1 = new QHBoxLayout( 0, 0, 6, "Layout1");
+
+ buttonHelp = new QPushButton( this, "buttonHelp" );
+ buttonHelp->setAutoDefault( TRUE );
+ Layout1->addWidget( buttonHelp );
+ Horizontal_Spacing2 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
+ Layout1->addItem( Horizontal_Spacing2 );
+
+ buttonOk = new QPushButton( this, "buttonOk" );
+ buttonOk->setAutoDefault( TRUE );
+ buttonOk->setDefault( TRUE );
+ Layout1->addWidget( buttonOk );
+
+ buttonCancel = new QPushButton( this, "buttonCancel" );
+ buttonCancel->setAutoDefault( TRUE );
+ Layout1->addWidget( buttonCancel );
+
+ MyDialog1Layout->addMultiCellLayout( Layout1, 1, 1, 0, 1 );
+ languageChange();
+ resize( QSize(597, 364).expandedTo(minimumSizeHint()) );
+ clearWState( WState_Polished );
+
+ // signals and slots connections
+ connect( buttonOk, SIGNAL( clicked() ), this, SLOT( accept() ) );
+ connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( reject() ) );
+}
+
+/*
+ * Destroys the object and frees any allocated resources
+ */
+MyDialog1::~MyDialog1()
+{
+ // no need to delete child widgets, Qt does it all for us
+}
+
+/*
+ * Sets the strings of the subwidgets using the current
+ * language.
+ */
+void MyDialog1::languageChange()
+{
+ setCaption( tr2i18n( "MyDialog1" ) );
+ listBox->clear();
+ listBox->insertItem( tr2i18n( "New Item" ) );
+ tabWidget->changeTab( Widget2, tr2i18n( "Tab" ) );
+ tabWidget->changeTab( Widget3, tr2i18n( "Tab" ) );
+ buttonHelp->setText( tr2i18n( "&Help" ) );
+ buttonHelp->setAccel( QKeySequence( tr2i18n( "F1" ) ) );
+ buttonOk->setText( tr2i18n( "&OK" ) );
+ buttonOk->setAccel( QKeySequence( QString::null ) );
+ buttonCancel->setText( tr2i18n( "&Cancel" ) );
+ buttonCancel->setAccel( QKeySequence( QString::null ) );
+}
+
+#include "settings.moc"
diff --git a/katapult/plugins/Makefile.am b/katapult/plugins/Makefile.am
new file mode 100644
index 0000000..5c96c18
--- /dev/null
+++ b/katapult/plugins/Makefile.am
@@ -0,0 +1 @@
+SUBDIRS = catalogs display
diff --git a/katapult/plugins/catalogs/Makefile.am b/katapult/plugins/catalogs/Makefile.am
new file mode 100644
index 0000000..575538f
--- /dev/null
+++ b/katapult/plugins/catalogs/Makefile.am
@@ -0,0 +1 @@
+SUBDIRS = programcatalog bookmarkcatalog documentcatalog calculatorcatalog amarokcatalog spellcatalog googlecatalog execcatalog
diff --git a/katapult/plugins/catalogs/amarokcatalog/Makefile.am b/katapult/plugins/catalogs/amarokcatalog/Makefile.am
new file mode 100644
index 0000000..24de402
--- /dev/null
+++ b/katapult/plugins/catalogs/amarokcatalog/Makefile.am
@@ -0,0 +1,15 @@
+# set the include path for X, qt and KDE
+INCLUDES = -I$(top_srcdir)/katapult/common $(all_includes)
+
+# header files
+noinst_HEADERS = coverimage.h song.h amarokcatalog.h actionplaysong.h
+
+# use automoc
+METASOURCES = AUTO
+
+# our plugin
+kde_module_LTLIBRARIES = katapult_amarokcatalog.la
+katapult_amarokcatalog_la_SOURCES = settings.ui amarokcatalog.cpp coverimage.cpp song.cpp actionplaysong.cpp
+katapult_amarokcatalog_la_LDFLAGS = -module $(KDE_RPATH) $(KDE_PLUGIN) $(all_libraries)
+katapult_amarokcatalog_la_LIBADD = $(LIB_QT) $(LIB_KDECORE) -lDCOP $(LIB_KDEUI) $(LIB_KIO) $(top_builddir)/katapult/common/libkatapult.la
+kde_services_DATA = katapult_amarokcatalog.desktop
diff --git a/katapult/plugins/catalogs/amarokcatalog/actionplaysong.cpp b/katapult/plugins/catalogs/amarokcatalog/actionplaysong.cpp
new file mode 100644
index 0000000..43fdc2b
--- /dev/null
+++ b/katapult/plugins/catalogs/amarokcatalog/actionplaysong.cpp
@@ -0,0 +1,58 @@
+/***************************************************************************
+ * Copyright (C) 2005 by Bastian Holst *
+ * bastianholst@gmx.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. *
+ ***************************************************************************/
+
+#include <kglobal.h>
+#include <kiconloader.h>
+#include <qpixmap.h>
+#include <qstring.h>
+#include <qcstring.h>
+#include <qdatastream.h>
+#include <kapp.h>
+#include <dcopclient.h>
+#include <klocale.h>
+
+#include <katapultitem.h>
+
+#include "actionplaysong.h"
+#include "song.h"
+
+QPixmap ActionPlaySong::icon(int size) const
+{
+ return KGlobal::iconLoader()->loadIcon("amarok", KIcon::NoGroup, size);
+}
+
+QString ActionPlaySong::text() const
+{
+ return i18n("Play Song");
+}
+
+bool ActionPlaySong::accepts(const KatapultItem *item) const
+{
+ return strcmp(item->className(), "Song") == 0;
+}
+
+void ActionPlaySong::execute(const KatapultItem *item) const
+{
+ const Song *song = (const Song *) item;
+ QByteArray buffer;
+ QDataStream stream(buffer, IO_WriteOnly);
+ stream << song->url();
+ kapp->dcopClient()->send("amarok", "playlist", "playMedia(KURL)", buffer);
+}
diff --git a/katapult/plugins/catalogs/amarokcatalog/actionplaysong.h b/katapult/plugins/catalogs/amarokcatalog/actionplaysong.h
new file mode 100644
index 0000000..bd2f0af
--- /dev/null
+++ b/katapult/plugins/catalogs/amarokcatalog/actionplaysong.h
@@ -0,0 +1,42 @@
+/***************************************************************************
+ * Copyright (C) 2005 by Bastian Holst *
+ * bastianholst@gmx.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. *
+ ***************************************************************************/
+
+#ifndef ACTIONPLAYSONG_H
+#define ACTIONPLAYSONG_H
+
+#include "katapultaction.h"
+
+class KatapultItem;
+class QPixmap;
+class QString;
+
+/**
+@author Bastian Holst
+*/
+class ActionPlaySong : public KatapultAction
+{
+public:
+ virtual QPixmap icon(int) const;
+ virtual QString text() const;
+ virtual bool accepts(const KatapultItem *) const;
+ virtual void execute(const KatapultItem *) const;
+};
+
+#endif //ACTIONPLAYSONG_H
diff --git a/katapult/plugins/catalogs/amarokcatalog/amarokcatalog.cpp b/katapult/plugins/catalogs/amarokcatalog/amarokcatalog.cpp
new file mode 100644
index 0000000..f924c6d
--- /dev/null
+++ b/katapult/plugins/catalogs/amarokcatalog/amarokcatalog.cpp
@@ -0,0 +1,342 @@
+/***************************************************************************
+ * Copyright (C) 2005 by Bastian Holst *
+ * bastianholst@gmx.de *
+ * Copyright (C) 2006 by Martin Meredith *
+ * mez@thekatapult.org.uk *
+ * *
+ * 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. *
+ ***************************************************************************/
+
+#include <kapplication.h>
+#include <ksycocaentry.h>
+#include <ksycocatype.h>
+#include <knuminput.h>
+#include <kurl.h>
+#include <kapp.h>
+#include <qstring.h>
+#include <qcstring.h>
+#include <qstringlist.h>
+#include <qdatastream.h>
+#include <dcopclient.h>
+#include <qregexp.h>
+
+#include "actionplaysong.h"
+#include "song.h"
+#include "amarokcatalog.h"
+#include "actionregistry.h"
+#include "status.h"
+#include "settings.h"
+
+K_EXPORT_COMPONENT_FACTORY( katapult_amarokcatalog,
+ KGenericFactory<AmarokCatalog>( "katapult_amarokcatalog" ) )
+
+AmarokCatalog::AmarokCatalog(QObject*, const char*, const QStringList&): _result(QString::null)
+{
+ _minQueryLen = 3;
+ ActionRegistry::self()->registerAction(new ActionPlaySong());
+ _gotCollectionStatus = false;
+ _dynamicCollection = false;
+ checkCollectionType();
+
+}
+AmarokCatalog::~AmarokCatalog()
+{
+}
+
+void AmarokCatalog::queryChanged()
+{
+ int newStatus = 0;
+ QString queryString = query();
+
+ if((QString(queryString).remove(':').remove('\"').remove(' ').isEmpty()) || (queryString.length() < _minQueryLen)) {
+ reset();
+ setBestMatch(Match());
+ setStatus(0);
+ } else {
+
+ if ( _gotCollectionStatus)
+ {
+
+ if (!_dynamicCollection)
+ {
+
+ // Stuff for Amarok < 1.4.2
+
+ QStringList queryList;
+ //prepares SQL-queryQRegExp
+ QString sqlQuery(
+ "SELECT artist.name, tags.title, tags.url, images.path, album.name "
+ "FROM tags"
+ "INNER JOIN album ON (tags.album = album.id) "
+ "INNER JOIN artist ON (tags.artist = artist.id) "
+ "LEFT JOIN statistics ON (tags.url = statistics.url) "
+ "LEFT JOIN images ON (artist.name = images.artist AND album.name = images.album) "
+ "WHERE 1=1 "
+ );// AND
+
+ queryList = QStringList::split ( QString(" "), QString(queryString).replace(QChar(':')," ").replace(QChar('\''), " ").replace(QChar('\''), "%") );
+ for(QStringList::Iterator it = queryList.begin(); it != queryList.end(); ++it) {
+ sqlQuery.append(QString(" AND (t.title LIKE '\%%1\%'").arg(*it));
+ sqlQuery.append(QString(" OR a.name LIKE '\%%1\%')").arg(*it));
+ }
+ sqlQuery.append(" ORDER BY a.name, t.title, s.percentage DESC");
+
+ //sending SQL-query to ararok via dcop
+ QByteArray sqlQueryData, replyData;
+ QCString replyType;
+ QDataStream arg(sqlQueryData, IO_WriteOnly);
+ arg << sqlQuery;
+ if (!kapp->dcopClient()->call("amarok", "collection", "query(QString)",
+ sqlQueryData, replyType, replyData)) {
+ newStatus = 0;
+ } else {
+ QDataStream reply(replyData, IO_ReadOnly);
+ if (replyType == "QStringList") {
+ QStringList sqlResult;
+ reply >> sqlResult;
+
+ if(sqlResult.isEmpty()) {
+ newStatus = 0;
+ } else {
+ reset();
+ //Reads information from SQL-Query
+ _result.setArtist(sqlResult[0]);
+ _result.setName(sqlResult[1]);
+ _result.setURL(KURL(sqlResult[2]));
+ _result.setAlbum(sqlResult[4]);
+
+ //_result.setIcon(QString());
+ if ( !sqlResult[3].isEmpty() ) {
+ _result.setIcon(sqlResult[3]);
+ }
+
+ //counts the matched charecters
+ int i = queryString.find( ':' );
+ if ( i != -1 ) {
+ if ( queryString[i+1] != ' ' )
+ queryString.insert(i+1, ' ');
+ if ( queryString[i-1] != ' ' )
+ queryString.insert(i, ' ');
+ }
+ queryList = QStringList::split ( " ", queryString );
+ unsigned int matched = 0;
+ for(QStringList::Iterator it = queryList.begin(); it != queryList.end(); ++it) {
+ if(matched < (_result.text().find(*it, matched, false) + (*it).length()))
+ matched = _result.text().find(*it, matched, false) + (*it).length();
+ }
+ setBestMatch(Match(&_result, 100*queryString.length()/_result.text().length(), matched));
+
+ //Checks if there are multiple results
+ if( !sqlResult[5].isEmpty() )
+ newStatus = S_HasResults | S_Multiple;
+ else
+ newStatus = S_HasResults;
+ }
+ } else {
+ newStatus = 0;
+ }
+ }
+
+ } else { // Dynamic Collection
+
+ // Do same as above here again but with dyn collection stuff
+
+ QStringList queryList;
+ //prepares SQL-queryQRegExp
+ QString sqlQuery("SELECT a.name, t.title, t.deviceid, d.lastmountpoint, t.url, i.path, album.name FROM tags t LEFT JOIN statistics s ON (t.url = s.url AND t.deviceid = s.deviceid) LEFT JOIN artist a ON (t.artist = a.id) LEFT JOIN album ON (t.album = album.id) LEFT JOIN images i ON ( a.name = i.artist AND album.name = i.album) LEFT JOIN devices d ON (t.deviceid = d.id) WHERE ");
+ queryList = QStringList::split ( QString(" "), QString(queryString).replace(QChar(':')," ").replace(QChar('\''), " ").replace(QChar('\''), "%") );
+
+ // Let's build each of these clauses
+ QStringList clauses;
+ for(QStringList::Iterator it = queryList.begin(); it != queryList.end(); ++it) {
+
+ clauses += QString(" (t.title LIKE '\%%1\%'").arg(*it) +
+ QString(" OR a.name LIKE '\%%1\%')").arg(*it);
+ }
+ sqlQuery.append(clauses.join(QString(" AND ")));
+ sqlQuery.append(" ORDER BY a.name, t.title, s.percentage DESC");
+
+ //sending SQL-query to ararok via dcop
+ QByteArray sqlQueryData, replyData;
+ QCString replyType;
+ QDataStream arg(sqlQueryData, IO_WriteOnly);
+ arg << sqlQuery;
+ if (!kapp->dcopClient()->call("amarok", "collection", "query(QString)",
+ sqlQueryData, replyType, replyData)) {
+ newStatus = 0;
+ } else {
+ QDataStream reply(replyData, IO_ReadOnly);
+ if (replyType == "QStringList") {
+ QStringList sqlResult;
+ reply >> sqlResult;
+
+ if(sqlResult.isEmpty()) {
+ newStatus = 0;
+ } else {
+ reset();
+ //Reads information from SQL-Query
+ _result.setArtist(sqlResult[0]);
+ _result.setName(sqlResult[1]);
+ if (sqlResult[2]!="-1") {
+ KURL absolutePath;
+ absolutePath.setPath( sqlResult[3] );
+ absolutePath.addPath( sqlResult[4] );
+ absolutePath.cleanPath();
+
+ _result.setURL( absolutePath );
+ } else {
+ KURL absolutePath;
+ absolutePath.setPath( "/" );
+ absolutePath.addPath( sqlResult[4] );
+ absolutePath.cleanPath();
+
+ _result.setURL( absolutePath );
+ }
+
+ _result.setAlbum(sqlResult[6]);
+
+ //_result.setIcon(QString());
+ if ( !sqlResult[3].isEmpty() ) {
+ _result.setIcon(sqlResult[5]);
+ }
+
+ //counts the matched charecters
+ int i = queryString.find( ':' );
+ if ( i != -1 ) {
+ if ( queryString[i+1] != ' ' )
+ queryString.insert(i+1, ' ');
+ if ( queryString[i-1] != ' ' )
+ queryString.insert(i, ' ');
+ }
+ queryList = QStringList::split ( " ", queryString );
+ unsigned int matched = 0;
+ for(QStringList::Iterator it = queryList.begin(); it != queryList.end(); ++it) {
+ if(matched < (_result.text().find(*it, matched, false) + (*it).length()))
+ matched = _result.text().find(*it, matched, false) + (*it).length();
+ }
+ setBestMatch(Match(&_result, 100*queryString.length()/_result.text().length(), matched));
+
+ //Checks if there are multiple results
+ if( !sqlResult[7].isEmpty() )
+ newStatus = S_HasResults | S_Multiple;
+ else
+ newStatus = S_HasResults;
+ }
+ } else {
+ newStatus = 0;
+ }
+ }
+
+
+ } //end of >1.4.2 section
+ setStatus(newStatus);
+
+ } else { //We haven't got the collection status
+
+ checkCollectionType();
+ reset();
+ setBestMatch(Match());
+ setStatus(0);
+ }
+
+
+ } //dont go after this while fixing
+
+}
+
+void AmarokCatalog::reset()
+{
+ _result.setName(QString::null);
+ _result.setArtist(QString::null);
+ _result.setAlbum(QString::null);
+ _result.setIcon(QString::null);
+}
+
+void AmarokCatalog::checkCollectionType()
+{
+ QString sqlQuery("SELECT COUNT(*) FROM admin WHERE noption = 'Database Devices Version'");
+
+ QByteArray sqlQueryData, replyData;
+ QCString replyType;
+ QDataStream arg(sqlQueryData, IO_WriteOnly);
+ arg << sqlQuery;
+ if (!kapp->dcopClient()->call("amarok", "collection", "query(QString)", sqlQueryData, replyType, replyData))
+ {
+ _gotCollectionStatus = false;
+
+ }
+ else
+ {
+ QDataStream reply(replyData, IO_ReadOnly);
+ if (replyType == "QStringList")
+ {
+ QStringList sqlResult;
+ reply >> sqlResult;
+
+ if (sqlResult[0] == "1")
+ {
+ _dynamicCollection = true;
+
+ }
+ else
+ {
+ _dynamicCollection = false;
+
+ }
+ _gotCollectionStatus = true;
+ }
+ else
+ {
+ _gotCollectionStatus = false;
+ }
+ }
+}
+
+
+/*
+void AmarokCatalog::initialize()
+{
+}
+*/
+
+unsigned int AmarokCatalog::minQueryLen() const
+{
+ return _minQueryLen;
+}
+
+QWidget * AmarokCatalog::configure()
+{
+ AmarokCatalogSettings *settings = new AmarokCatalogSettings();
+
+ settings->minQueryLen->setValue(_minQueryLen);
+ connect(settings->minQueryLen, SIGNAL(valueChanged(int)), this, SLOT(minQueryLenChanged(int)));
+ return settings;
+}
+
+void AmarokCatalog::minQueryLenChanged(int _minQueryLen)
+{
+ this->_minQueryLen = _minQueryLen;
+}
+
+void AmarokCatalog::readSettings(KConfigBase *config)
+{
+ _minQueryLen = config->readUnsignedNumEntry("MinQueryLen", 3);
+}
+
+void AmarokCatalog::writeSettings(KConfigBase *config)
+{
+ config->writeEntry("MinQueryLen", _minQueryLen);
+}
diff --git a/katapult/plugins/catalogs/amarokcatalog/amarokcatalog.h b/katapult/plugins/catalogs/amarokcatalog/amarokcatalog.h
new file mode 100644
index 0000000..bd735a3
--- /dev/null
+++ b/katapult/plugins/catalogs/amarokcatalog/amarokcatalog.h
@@ -0,0 +1,62 @@
+/***************************************************************************
+ * Copyright (C) 2005 by Bastian Holst *
+ * bastianholst@gmx.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. *
+ ***************************************************************************/
+#ifndef AMAROKCATALOG_H
+#define AMAROKCATALOG_H
+
+#include <katapultcatalog.h>
+#include <kgenericfactory.h>
+#include <kconfigbase.h>
+#include "song.h"
+
+class QWidget;
+class QString;
+
+/**
+@author Bastian Holst
+*/
+class AmarokCatalog : public KatapultCatalog
+{
+ Q_OBJECT
+public:
+ AmarokCatalog(QObject*, const char*, const QStringList&);
+ virtual ~AmarokCatalog();
+
+ unsigned int minQueryLen() const;
+ void readSettings(KConfigBase *);
+ void writeSettings(KConfigBase *);
+ QWidget * configure();
+ //virtual void initialize();
+
+public slots:
+ void minQueryLenChanged(int);
+
+protected:
+ void queryChanged();
+ void reset();
+ void checkCollectionType();
+
+private:
+ unsigned int _minQueryLen;
+ bool _dynamicCollection;
+ bool _gotCollectionStatus;
+ Song _result;
+};
+
+#endif //AMAROkCATALOG_H
diff --git a/katapult/plugins/catalogs/amarokcatalog/coverimage.cpp b/katapult/plugins/catalogs/amarokcatalog/coverimage.cpp
new file mode 100644
index 0000000..4ea3f24
--- /dev/null
+++ b/katapult/plugins/catalogs/amarokcatalog/coverimage.cpp
@@ -0,0 +1,106 @@
+/***************************************************************************
+ * Copyright (C) 2005 by Bastian Holst *
+ * bastianholst@gmx.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. *
+ ***************************************************************************/
+
+#include <kmdcodec.h>
+#include <qimage.h>
+#include <qdir.h>
+
+#include "coverimage.h"
+
+CoverImage::CoverImage()
+{
+ setArtist(QString());
+ setAlbum(QString());
+ setURL(QString());
+
+ _coverfolder = QDir::homeDirPath();
+ _coverfolder.append("/.kde/share/apps/amarok/albumcovers/");
+ _largefolder = QString(_coverfolder).append("large/");
+ _cachefolder = QString(_coverfolder).append("cache/");
+
+ QDir foldertest;
+ foldertest.setPath(_coverfolder);
+ if ( !foldertest.exists() )
+ foldertest.mkdir(_coverfolder);
+ if ( !foldertest.exists(_largefolder) )
+ foldertest.mkdir(_largefolder);
+ if ( !foldertest.exists(_cachefolder) )
+ foldertest.mkdir(_cachefolder);
+}
+
+QImage CoverImage::load(int size) const
+{
+ QString imagepath(_cachefolder);
+ KMD5 md5sum(artist().lower().utf8()+album().lower().utf8());
+ imagepath.append(QString::number ( size )).append("@").append(md5sum.hexDigest());
+ QImage image( imagepath );
+ if ( image.isNull() )
+ {
+ if ( !url().isEmpty() ) {
+ image.load(url());
+ } else {
+ imagepath = _largefolder;
+ imagepath.append(md5sum.hexDigest());
+ image.load( imagepath );
+ }
+
+ if ( !image.isNull() ) {
+ QString savepath(_cachefolder);
+ savepath.append(QString::number ( size )).append("@").append(md5sum.hexDigest());
+ image = image.smoothScale(size, size, QImage::ScaleMin);
+ if ( !url().isEmpty() ) {
+ image.save( savepath, QImage::imageFormat ( url() ));
+ } else {
+ image.save( savepath, QImage::imageFormat ( imagepath ));
+ }
+ }
+ }
+ return image;
+}
+
+QString CoverImage::artist() const
+{
+ return _artist;
+}
+
+QString CoverImage::album() const
+{
+ return _album;
+}
+
+QString CoverImage::url() const
+{
+ return _url;
+}
+
+void CoverImage::setArtist(const QString& artist)
+{
+ _artist = artist;
+}
+
+void CoverImage::setAlbum(const QString& album)
+{
+ _album = album;
+}
+
+void CoverImage::setURL(const QString& url)
+{
+ _url = url;
+}
diff --git a/katapult/plugins/catalogs/amarokcatalog/coverimage.h b/katapult/plugins/catalogs/amarokcatalog/coverimage.h
new file mode 100644
index 0000000..c7982c3
--- /dev/null
+++ b/katapult/plugins/catalogs/amarokcatalog/coverimage.h
@@ -0,0 +1,54 @@
+/***************************************************************************
+ * Copyright (C) 2005 by Bastian Holst *
+ * bastianholst@gmx.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. *
+ ***************************************************************************/
+#ifndef COVERIMAGE_H
+#define COVERIMAGE_H
+
+#include<qstring.h>
+#include<qimage.h>
+
+/**
+@author Bastian Holst
+*/
+class CoverImage
+{
+public:
+ CoverImage();
+
+ QImage load(int) const;
+
+ virtual QString artist() const;
+ virtual QString album() const;
+ virtual QString url() const;
+
+ void setArtist(const QString&);
+ void setAlbum(const QString&);
+ void setURL(const QString&);
+private:
+ QString _artist;
+ QString _album;
+ QString _url;
+
+ QString _coverfolder;
+ QString _largefolder;
+ QString _cachefolder;
+};
+
+#endif // COVERIMAGE_H
+
diff --git a/katapult/plugins/catalogs/amarokcatalog/katapult_amarokcatalog.desktop b/katapult/plugins/catalogs/amarokcatalog/katapult_amarokcatalog.desktop
new file mode 100644
index 0000000..deceddf
--- /dev/null
+++ b/katapult/plugins/catalogs/amarokcatalog/katapult_amarokcatalog.desktop
@@ -0,0 +1,44 @@
+[Desktop Entry]
+Name=Amarok Catalog
+Name[ar]=مستعرض ( Catalog ) Amarok
+Name[bg]=Каталог на Amarok
+Name[br]=Katalog Amarok
+Name[da]=Katalogisér Amarok
+Name[de]=amaroK-Katalog
+Name[el]=Κατάλογος Amarok
+Name[es]=Catálogo Amarok
+Name[et]=Amaroki kataloog
+Name[fr]=Catalogue Amarok
+Name[ga]=Catalóg Amarok
+Name[gl]=Catálogo de Amarok
+Name[it]=Catalogo Amarok
+Name[ja]=Amarok カタログ
+Name[nb]=Amarok-katalog
+Name[nl]=Amarok-catalogus
+Name[pt]=Catálogo do Amarok
+Name[pt_BR]=Catálogo do Amarok
+Name[sv]=Katalogisera Amarok
+Name[tr]=Amarok Kataloğu
+Name[uk]=Каталог Amarok
+Comment=Catalogs your KDE programs for easy launching through Katapult
+Comment[ar]=يستعرض برامجك كي دي أي ( KDE ) كي تستطيع اقلاعها بسهولة مستخدما Katapult
+Comment[bg]=Каталогизира с Katapult програмите в KDE за лесно стартиране
+Comment[da]=Katalogiserer dine KDE-programmer for nem start via Katapult
+Comment[de]=Katalogisiert Ihre KDE-Programme, um sie bequem mit Katapult zu starten
+Comment[el]=Δημιουργεί κατάλογο των προγραμμάτων σας του KDE για την εύκολη εκτέλεσή τους μέσω του Katapult
+Comment[es]=Cataloga sus programas de KDE para iniciarlos con facilidad a través de Katapult
+Comment[et]=Kataloogib sinu KDE programmid hõlpsaks käivitamiseks Katapultiga
+Comment[fr]=Cataloguer vos programmes KDE pour un lancement facile via Katapult
+Comment[gl]=Cataloga os seus programas de KDE para seren iniciados mediante Katapult
+Comment[it]=Cataloga in tuoi programmi KDE per avviarli facilmente attraverso Katapult
+Comment[ja]=Katapult から簡単に起動できるように KDE のプログラムをカタログ化
+Comment[nb]=Katalogiserer KDE-programmene for lettvint oppstart med Katapult
+Comment[nl]=Catalogiseert uw KDE-programma's voor eenvoudige opstart via Katapult
+Comment[pt]=Cataloga os seus programas do KDE para lançá-los facilmente através do Katapult
+Comment[pt_BR]=Cataloga os seus programas do KDE para lançá-los facilmente através do Katapult
+Comment[sv]=Katalogiserar dina KDE-program för enkel start via Katapult
+Comment[uk]=Робить каталог з програм KDE для легкого запуску через Катапульту
+ServiceTypes=Katapult/Catalog
+Type=Service
+X-KDE-Library=katapult_amarokcatalog
+X-Katapult-ID=Amarok Catalog
diff --git a/katapult/plugins/catalogs/amarokcatalog/settings.ui b/katapult/plugins/catalogs/amarokcatalog/settings.ui
new file mode 100644
index 0000000..70bb3ab
--- /dev/null
+++ b/katapult/plugins/catalogs/amarokcatalog/settings.ui
@@ -0,0 +1,80 @@
+<!DOCTYPE UI><UI version="3.2" stdsetdef="1">
+<class>AmarokCatalogSettings</class>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>AmarokCatalogSettings</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>376</width>
+ <height>519</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Settings</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout1</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>textLabel1</cstring>
+ </property>
+ <property name="text">
+ <string>Number of characters before searching:</string>
+ </property>
+ </widget>
+ <widget class="KIntSpinBox">
+ <property name="name">
+ <cstring>minQueryLen</cstring>
+ </property>
+ <property name="maxValue">
+ <number>10</number>
+ </property>
+ <property name="minValue">
+ <number>1</number>
+ </property>
+ <property name="value">
+ <number>3</number>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Katapult will not search for programs until you have typed at least this many characters in the Katapult launcher.</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>spacer1</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>370</height>
+ </size>
+ </property>
+ </spacer>
+ </vbox>
+</widget>
+<layoutdefaults spacing="6" margin="11"/>
+<includehints>
+ <includehint>knuminput.h</includehint>
+</includehints>
+</UI>
diff --git a/katapult/plugins/catalogs/amarokcatalog/song.cpp b/katapult/plugins/catalogs/amarokcatalog/song.cpp
new file mode 100644
index 0000000..78b69fb
--- /dev/null
+++ b/katapult/plugins/catalogs/amarokcatalog/song.cpp
@@ -0,0 +1,91 @@
+/***************************************************************************
+ * Copyright (C) 2005 by Bastian Holst *
+ * bastianholst@gmx.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. *
+ ***************************************************************************/
+
+#include <kglobal.h>
+#include <kiconloader.h>
+#include <kurl.h>
+#include <qpixmap.h>
+#include <qimage.h>
+#include <qstring.h>
+#include <amarokcatalog.h>
+
+#include "song.h"
+
+Song::Song(const QString&)
+ : KatapultItem()
+{
+ setName(QString());
+ setArtist(QString());
+ setURL(KURL());
+ setIcon(QString());
+ setAlbum(QString::null);
+}
+
+void Song::setArtist(const QString& artist)
+{
+ _artist = artist;
+ cover.setArtist(artist);
+}
+
+void Song::setName(const QString& name)
+{
+ _name = name;
+}
+
+void Song::setAlbum(const QString& album)
+{
+ cover.setAlbum(album);
+}
+
+void Song::setURL(const KURL url)
+{
+ _url = url;
+}
+
+void Song::setIcon(const QString icon)
+{
+ cover.setURL(icon);
+}
+
+QPixmap Song::icon(int size) const
+{
+ QImage image = cover.load(size);
+ if ( image.isNull() )
+ return KGlobal::iconLoader()->loadIcon("multimedia", KIcon::NoGroup, size);
+ return QPixmap(image);
+}
+
+QString Song::text() const
+{
+ QString text;
+ if( !_artist.isEmpty() ) {
+ text.append(_artist);
+ text.append(": ");
+ }
+ text.append(_name);
+ return text;
+}
+
+KURL Song::url() const
+{
+ return _url;
+}
+
+#include "song.moc"
diff --git a/katapult/plugins/catalogs/amarokcatalog/song.h b/katapult/plugins/catalogs/amarokcatalog/song.h
new file mode 100644
index 0000000..90e4819
--- /dev/null
+++ b/katapult/plugins/catalogs/amarokcatalog/song.h
@@ -0,0 +1,56 @@
+/***************************************************************************
+ * Copyright (C) 2005 by Bastian Holst *
+ * bastianholst@gmx.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. *
+ ***************************************************************************/
+#ifndef SONG_H
+#define SONG_H
+
+#include "katapultitem.h"
+#include "coverimage.h"
+#include <kurl.h>
+#include <qstring.h>
+#include <qpixmap.h>
+
+/**
+@author Bastian Holst
+*/
+class Song : public KatapultItem
+{
+ Q_OBJECT
+public:
+ Song(const QString&);
+
+ virtual QPixmap icon(int) const;
+ virtual QString text() const;
+ virtual KURL url() const;
+
+ void setArtist(const QString&);
+ void setName(const QString&);
+ void setURL(const KURL);
+ void setIcon(const QString);
+ void setAlbum(const QString&);
+
+protected:
+ QString _artist;
+ QString _name;
+ KURL _url;
+
+ CoverImage cover;
+};
+
+#endif //SONG_H
diff --git a/katapult/plugins/catalogs/bookmarkcatalog/Makefile.am b/katapult/plugins/catalogs/bookmarkcatalog/Makefile.am
new file mode 100644
index 0000000..ef289e3
--- /dev/null
+++ b/katapult/plugins/catalogs/bookmarkcatalog/Makefile.am
@@ -0,0 +1,17 @@
+# set the include path for X, qt and KDE
+INCLUDES = -I$(top_srcdir)/katapult/common $(all_includes)
+
+# header files
+noinst_HEADERS = bookmarkcatalog.h bookmark.h actionopenbookmark.h \
+ mozillabookmark.h
+
+# use automoc
+METASOURCES = AUTO
+
+# our plugin
+kde_module_LTLIBRARIES = katapult_bookmarkcatalog.la
+katapult_bookmarkcatalog_la_SOURCES = settings.ui bookmarkcatalog.cpp \
+ bookmark.cpp actionopenbookmark.cpp mozillabookmark.cpp
+katapult_bookmarkcatalog_la_LDFLAGS = -module $(KDE_RPATH) $(KDE_PLUGIN) $(all_libraries)
+katapult_bookmarkcatalog_la_LIBADD = $(LIB_QT) $(LIB_KDECORE) $(LIB_KDEUI) $(LIB_KIO) $(top_builddir)/katapult/common/libkatapult.la
+kde_services_DATA = katapult_bookmarkcatalog.desktop
diff --git a/katapult/plugins/catalogs/bookmarkcatalog/actionopenbookmark.cpp b/katapult/plugins/catalogs/bookmarkcatalog/actionopenbookmark.cpp
new file mode 100644
index 0000000..bd31782
--- /dev/null
+++ b/katapult/plugins/catalogs/bookmarkcatalog/actionopenbookmark.cpp
@@ -0,0 +1,60 @@
+/***************************************************************************
+ * Copyright (C) 2005 by Joe Ferris *
+ * jferris@optimistictech.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. *
+ * *
+ * 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. *
+ ***************************************************************************/
+
+#include <kbookmark.h>
+#include <kglobal.h>
+#include <kiconloader.h>
+#include <krun.h>
+#include <kurl.h>
+#include <klocale.h>
+
+#include <qstring.h>
+#include <qpixmap.h>
+
+#include "actionopenbookmark.h"
+#include "katapultitem.h"
+#include "bookmark.h"
+#include "mozillabookmark.h"
+
+QPixmap ActionOpenBookmark::icon(int size) const
+{
+ return KGlobal::iconLoader()->loadIcon("fileopen", KIcon::NoGroup, size);
+}
+
+QString ActionOpenBookmark::text() const
+{
+ return i18n("Open Bookmark");
+}
+
+void ActionOpenBookmark::execute(const KatapultItem *item) const
+{
+ if(strcmp(item->className(), "Bookmark") == 0) {
+ const Bookmark *bookmark = (const Bookmark *) item;
+ new KRun(bookmark->bookmark().url());
+ } else if(strcmp(item->className(), "MozillaBookmark") == 0) {
+ const MozillaBookmark *bookmark = (const MozillaBookmark *) item;
+ new KRun(bookmark->url());
+ }
+}
+
+bool ActionOpenBookmark::accepts(const KatapultItem *item) const
+{
+ return strcmp(item->className(), "Bookmark") == 0 || strcmp(item->className(), "MozillaBookmark") == 0;
+}
diff --git a/katapult/plugins/catalogs/bookmarkcatalog/actionopenbookmark.h b/katapult/plugins/catalogs/bookmarkcatalog/actionopenbookmark.h
new file mode 100644
index 0000000..9068753
--- /dev/null
+++ b/katapult/plugins/catalogs/bookmarkcatalog/actionopenbookmark.h
@@ -0,0 +1,43 @@
+/***************************************************************************
+ * Copyright (C) 2005 by Joe Ferris *
+ * jferris@optimistictech.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. *
+ * *
+ * 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 ACTIONOPENBOOKMARK_H
+#define ACTIONOPENBOOKMARK_H
+
+#include <katapultaction.h>
+
+class KatapultItem;
+class QPixmap;
+class QString;
+
+/**
+@author Joe Ferris
+*/
+class ActionOpenBookmark : public KatapultAction
+{
+
+public:
+ virtual QPixmap icon(int) const;
+ virtual QString text() const;
+ virtual void execute(const KatapultItem *) const;
+ virtual bool accepts(const KatapultItem *) const;
+
+};
+
+#endif
diff --git a/katapult/plugins/catalogs/bookmarkcatalog/bookmark.cpp b/katapult/plugins/catalogs/bookmarkcatalog/bookmark.cpp
new file mode 100644
index 0000000..e5d65db
--- /dev/null
+++ b/katapult/plugins/catalogs/bookmarkcatalog/bookmark.cpp
@@ -0,0 +1,48 @@
+/***************************************************************************
+ * Copyright (C) 2005 by Joe Ferris *
+ * jferris@optimistictech.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. *
+ * *
+ * 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. *
+ ***************************************************************************/
+
+#include <kbookmark.h>
+#include <kglobal.h>
+#include <kiconloader.h>
+
+#include "bookmark.h"
+
+Bookmark::Bookmark(KBookmark _bookmark)
+ : KatapultItem()
+{
+ this->_bookmark = _bookmark;
+}
+
+QPixmap Bookmark::icon(int size) const
+{
+ return KGlobal::iconLoader()->loadIcon(_bookmark.icon(), KIcon::NoGroup, size);
+}
+
+KBookmark Bookmark::bookmark() const
+{
+ return _bookmark;
+}
+
+QString Bookmark::text() const
+{
+ return _bookmark.text();
+}
+
+#include "bookmark.moc"
diff --git a/katapult/plugins/catalogs/bookmarkcatalog/bookmark.h b/katapult/plugins/catalogs/bookmarkcatalog/bookmark.h
new file mode 100644
index 0000000..fba7fec
--- /dev/null
+++ b/katapult/plugins/catalogs/bookmarkcatalog/bookmark.h
@@ -0,0 +1,46 @@
+/***************************************************************************
+ * Copyright (C) 2005 by Joe Ferris *
+ * jferris@optimistictech.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. *
+ * *
+ * 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 BOOKMARK_H
+#define BOOKMARK_H
+
+#include <kbookmark.h>
+
+#include <katapultitem.h>
+
+/**
+@author Joe Ferris
+*/
+class Bookmark : public KatapultItem
+{
+ Q_OBJECT
+public:
+ Bookmark(KBookmark);
+
+ virtual QPixmap icon(int) const;
+ virtual QString text() const;
+
+ KBookmark bookmark() const;
+
+private:
+ KBookmark _bookmark;
+
+};
+
+#endif
diff --git a/katapult/plugins/catalogs/bookmarkcatalog/bookmarkcatalog.cpp b/katapult/plugins/catalogs/bookmarkcatalog/bookmarkcatalog.cpp
new file mode 100644
index 0000000..e70d65f
--- /dev/null
+++ b/katapult/plugins/catalogs/bookmarkcatalog/bookmarkcatalog.cpp
@@ -0,0 +1,212 @@
+/***************************************************************************
+ * Copyright (C) 2005 by Joe Ferris *
+ * jferris@optimistictech.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. *
+ * *
+ * 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. *
+ ***************************************************************************/
+
+#include <kservicegroup.h>
+#include <ksycocaentry.h>
+#include <ksycocatype.h>
+#include <kapplication.h>
+#include <kbookmarkmanager.h>
+#include <kbookmark.h>
+#include <knuminput.h>
+#include <kurlrequester.h>
+
+#include <qstring.h>
+#include <qradiobutton.h>
+#include <qbuttongroup.h>
+#include <qdir.h>
+#include <qregexp.h>
+#include <qfile.h>
+
+#include "bookmarkcatalog.h"
+#include "bookmark.h"
+#include "mozillabookmark.h"
+#include "settings.h"
+#include "actionregistry.h"
+#include "actionopenbookmark.h"
+
+K_EXPORT_COMPONENT_FACTORY( katapult_bookmarkcatalog,
+ KGenericFactory<BookmarkCatalog>( "katapult_bookmarkcatalog" ) )
+
+BookmarkCatalog::BookmarkCatalog(QObject *, const char *, const QStringList&)
+ : CachedCatalog()
+{
+ manager = KBookmarkManager::userBookmarksManager();
+ _minQueryLen = 1;
+ ActionRegistry::self()->registerAction(new ActionOpenBookmark());
+}
+
+
+BookmarkCatalog::~BookmarkCatalog()
+{
+}
+
+void BookmarkCatalog::initialize()
+{
+ if(manager != 0)
+ cacheBookmarkList(manager->root());
+ if(_mozEnabled)
+ cacheMozillaBookmarks();
+}
+
+void BookmarkCatalog::cacheBookmarkList(KBookmarkGroup group)
+{
+ KBookmark bookmark = group.first();
+ while(!bookmark.isNull()) {
+ if (bookmark.isGroup()) {
+ cacheBookmarkList(bookmark.toGroup());
+ } else {
+ addItem(new Bookmark(bookmark));
+ }
+ bookmark = group.next(bookmark);
+ }
+}
+
+void BookmarkCatalog::cacheMozillaBookmarks()
+{
+ if(_mozAuto)
+ _mozFile = detectMozillaFile();
+
+ if(_mozFile.isEmpty())
+ return;
+
+ QFile bmFile(_mozFile);
+ if(!bmFile.open(IO_ReadOnly))
+ return;
+
+ QString contents = bmFile.readAll();
+ QRegExp rx("<A HREF=\"([^\"]+)\" [^>]+>([^<]+)</A>");
+ int pos = 0;
+ while(pos > -1) {
+ pos = rx.search(contents, pos);
+ if(pos > -1) {
+ addItem(new MozillaBookmark(rx.cap(1), rx.cap(2), QPixmap()));
+ pos += rx.matchedLength();
+ }
+ }
+}
+
+QString BookmarkCatalog::detectMozillaFile()
+{
+ QStringList testDirs;
+ testDirs << ".firefox" << ".mozilla" << ".phoenix" << ".netscape";
+ QDir home = QDir::home();
+ for(QStringList::Iterator it = testDirs.begin(); it != testDirs.end(); ++it) {
+ QString testDir = *it;
+ if(home.exists(testDir)) {
+ QDir mozDir = QDir(home.path()+"/"+testDir).canonicalPath();
+ if(mozDir.dirName() != testDir && testDirs.contains(mozDir.dirName()))
+ continue;
+ QString path = searchMozDir(mozDir.path());
+ if(!path.isEmpty())
+ return path;
+ }
+ }
+
+ return "";
+}
+
+QString BookmarkCatalog::searchMozDir(QString path)
+{
+ QDir dir(path);
+ if(dir.exists("bookmarks.html")) {
+ return path+"/bookmarks.html";
+ }
+ QStringList entries = dir.entryList(QDir::Dirs | QDir::NoSymLinks);
+ for(QStringList::Iterator it = entries.begin(); it != entries.end(); ++it) {
+ if(*it != "." && *it != ".."){
+ QString result = searchMozDir(path + "/" + *it);
+ if(!result.isEmpty())
+ return result;
+ }
+ }
+ return QString::null;
+}
+
+unsigned int BookmarkCatalog::minQueryLen() const
+{
+ return _minQueryLen;
+}
+
+void BookmarkCatalog::readSettings(KConfigBase *config)
+{
+ _minQueryLen = config->readUnsignedNumEntry("MinQueryLen", 3);
+ _mozEnabled = config->readBoolEntry("MozEnabled", TRUE);
+ _mozAuto = config->readBoolEntry("MozAuto", TRUE);
+ _mozFile = config->readEntry("MozFile", "");
+}
+
+void BookmarkCatalog::writeSettings(KConfigBase *config)
+{
+ config->writeEntry("MinQueryLen", _minQueryLen);
+ config->writeEntry("MozEnabled", _mozEnabled);
+ config->writeEntry("MozAuto", _mozAuto);
+ config->writeEntry("MozFile", _mozFile);
+}
+
+QWidget * BookmarkCatalog::configure()
+{
+ settings = new BookmarkCatalogSettings();
+
+ settings->minQueryLen->setValue(_minQueryLen);
+ connect(settings->minQueryLen, SIGNAL(valueChanged(int)), this, SLOT(minQueryLenChanged(int)));
+
+ settings->mozEnabled->setChecked(_mozEnabled);
+ connect(settings->mozEnabled, SIGNAL(toggled(bool)), this, SLOT(toggleMozEnabled(bool)));
+
+ settings->mozAuto->setChecked(_mozAuto);
+ connect(settings->mozAuto, SIGNAL(toggled(bool)), this, SLOT(toggleMozAuto(bool)));
+
+ settings->mozManual->setChecked(!_mozAuto);
+
+ settings->mozFile->setURL(_mozFile);
+ connect(settings->mozFile, SIGNAL(urlSelected(const QString &)), this, SLOT(changeMozFile(const QString &)));
+
+ settings->mozAuto->setEnabled(_mozEnabled);
+ settings->mozManual->setEnabled(_mozEnabled);
+ settings->mozFile->setEnabled(_mozEnabled && !_mozAuto);
+
+ return settings;
+}
+
+void BookmarkCatalog::minQueryLenChanged(int _minQueryLen)
+{
+ this->_minQueryLen = _minQueryLen;
+}
+
+void BookmarkCatalog::toggleMozEnabled(bool _mozEnabled)
+{
+ this->_mozEnabled = _mozEnabled;
+ settings->mozAuto->setEnabled(_mozEnabled);
+ settings->mozManual->setEnabled(_mozEnabled);
+ settings->mozFile->setEnabled(_mozEnabled && !_mozAuto);
+}
+
+void BookmarkCatalog::toggleMozAuto(bool _mozAuto)
+{
+ this->_mozAuto = _mozAuto;
+ settings->mozFile->setEnabled(!_mozAuto);
+}
+
+void BookmarkCatalog::changeMozFile(const QString & _mozFile)
+{
+ this->_mozFile = _mozFile;
+}
+
+#include "bookmarkcatalog.moc"
diff --git a/katapult/plugins/catalogs/bookmarkcatalog/bookmarkcatalog.h b/katapult/plugins/catalogs/bookmarkcatalog/bookmarkcatalog.h
new file mode 100644
index 0000000..b0e5736
--- /dev/null
+++ b/katapult/plugins/catalogs/bookmarkcatalog/bookmarkcatalog.h
@@ -0,0 +1,71 @@
+/***************************************************************************
+ * Copyright (C) 2005 by Joe Ferris *
+ * jferris@optimistictech.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. *
+ * *
+ * 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 PROGRAMCATALOG_H
+#define PROGRAMCATALOG_H
+
+#include <kgenericfactory.h>
+
+#include <qptrlist.h>
+
+#include "cachedcatalog.h"
+
+class QWidget;
+class QString;
+class KBookmarkManager;
+class KBookmarkGroup;
+class BookmarkCatalogSettings;
+
+/**
+@author Joe Ferris
+*/
+class BookmarkCatalog : public CachedCatalog
+{
+ Q_OBJECT
+public:
+ BookmarkCatalog(QObject *, const char *, const QStringList&);
+ virtual ~BookmarkCatalog();
+
+ virtual void initialize();
+ virtual void readSettings(KConfigBase *);
+ virtual void writeSettings(KConfigBase *);
+ virtual unsigned int minQueryLen() const;
+ virtual QWidget * configure();
+
+public slots:
+ void minQueryLenChanged(int);
+ void toggleMozEnabled(bool);
+ void toggleMozAuto(bool);
+ void changeMozFile(const QString &);
+ QString searchMozDir(QString);
+
+private:
+ void cacheBookmarkList(KBookmarkGroup);
+ void cacheMozillaBookmarks();
+ QString detectMozillaFile();
+
+ KBookmarkManager *manager;
+ int _minQueryLen;
+ bool _mozEnabled;
+ bool _mozAuto;
+ QString _mozFile;
+ BookmarkCatalogSettings *settings;
+};
+
+#endif
diff --git a/katapult/plugins/catalogs/bookmarkcatalog/katapult_bookmarkcatalog.desktop b/katapult/plugins/catalogs/bookmarkcatalog/katapult_bookmarkcatalog.desktop
new file mode 100644
index 0000000..bea99f0
--- /dev/null
+++ b/katapult/plugins/catalogs/bookmarkcatalog/katapult_bookmarkcatalog.desktop
@@ -0,0 +1,44 @@
+[Desktop Entry]
+Name=Bookmark Catalog
+Name[ar]=مستغرض علامات المواقع ( Bookmark Catalog )
+Name[bg]=Каталог с отметки
+Name[br]=Katalog sined
+Name[da]=Katalogisér bogmærker
+Name[de]=Lesezeichen-Katalog
+Name[el]=Κατάλογος σελιδοδεικτών
+Name[es]=Catálogo de marcadores
+Name[et]=Järjehoidjakataloog
+Name[fr]=Catalogue de signets
+Name[ga]=Catalóg Leabharmharcanna
+Name[gl]=Catálogo de Favoritos
+Name[it]=Catologo segnalibri
+Name[ja]=ブックマークカタログ
+Name[nb]=Bokmerke-katalog
+Name[nl]=Bladwijzercatalogus
+Name[pt]=Catálogo de Favoritos
+Name[pt_BR]=Catálogo de Favoritos
+Name[sv]=Katalogisera bokmärken
+Name[tr]=Yer imi Kataloğu
+Name[uk]=Каталог закладок
+Comment=Catalogs your KDE bookmarks for easy launching through Katapult
+Comment[ar]=يستعرض علامات مواقعك كي دي أي ( KDE ) كي تستطيع اقلاعها عن طريق Katapult
+Comment[bg]=Каталогизира с Katapult отметките на KDE за лесно стартиране
+Comment[da]=Katalogiserer dine KDE-bogmærker for nem start via Katapult
+Comment[de]=Katalogisiert Ihre KDE-Lesezeichen, um sie bequem mit Katapult aufzurufen
+Comment[el]=Δημιουργεί κατάλογο με τους σελιδοδείκτες σας του KDE για την εύκολη εκτέλεσή τους μέσω του Katapult
+Comment[es]=Cataloga sus marcadores de KDE para iniciarlos con facilidad a través de Katapult
+Comment[et]=Kataloogib sinu KDE järjehoidjad hõlpsaks käivitamiseks Katapultiga
+Comment[fr]=Cataloguer vos signets KDE pour un lancement facile via Katapult
+Comment[gl]=Cataloga os seus favoritos de KDE para seren iniciados mediante Katapult
+Comment[it]=Cataloga i tuoi segnalibri di KDE per aprirli facilmente attraverso Katapult
+Comment[ja]=Katapult から簡単に開けるように KDE のブックマークをカタログ化
+Comment[nb]=Katalogiserer KDE-bokmerkene for lettvint oppstart med Katapult
+Comment[nl]=Catalogiseert uw KDE-bladwijzers voor eenvoudige opstart via Katapult
+Comment[pt]=Cataloga os seus favoritos do KDE para lançá-los facilmente através do Katapult
+Comment[pt_BR]=Cataloga os seus favoritos do KDE para lançá-los facilmente através do Katapult
+Comment[sv]=Katalogiserar dina KDE-bokmärken för enkel start via Katapult
+Comment[uk]=Робить каталог закладок KDE для легкого запуску через Катапульту
+ServiceTypes=Katapult/Catalog
+Type=Service
+X-KDE-Library=katapult_bookmarkcatalog
+X-Katapult-ID=Bookmark Catalog
diff --git a/katapult/plugins/catalogs/bookmarkcatalog/mozillabookmark.cpp b/katapult/plugins/catalogs/bookmarkcatalog/mozillabookmark.cpp
new file mode 100644
index 0000000..eb55751
--- /dev/null
+++ b/katapult/plugins/catalogs/bookmarkcatalog/mozillabookmark.cpp
@@ -0,0 +1,51 @@
+/***************************************************************************
+ * Copyright (C) 2005 by Joe Ferris *
+ * jferris@optimistictech.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. *
+ * *
+ * 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. *
+ ***************************************************************************/
+
+#include <kiconloader.h>
+#include <kglobal.h>
+
+#include <qpixmap.h>
+
+#include "mozillabookmark.h"
+
+MozillaBookmark::MozillaBookmark(QString _url, QString _title, QPixmap _icon)
+ : KatapultItem()
+{
+ this->_url = _url;
+ this->_icon = _icon;
+ this->_title = _title;
+}
+
+QPixmap MozillaBookmark::icon(int size) const
+{
+ return KGlobal::iconLoader()->loadIcon("bookmark", KIcon::NoGroup, size);
+}
+
+QString MozillaBookmark::url() const
+{
+ return _url;
+}
+
+QString MozillaBookmark::text() const
+{
+ return _title;
+}
+
+#include "mozillabookmark.moc"
diff --git a/katapult/plugins/catalogs/bookmarkcatalog/mozillabookmark.h b/katapult/plugins/catalogs/bookmarkcatalog/mozillabookmark.h
new file mode 100644
index 0000000..f1e25fb
--- /dev/null
+++ b/katapult/plugins/catalogs/bookmarkcatalog/mozillabookmark.h
@@ -0,0 +1,46 @@
+/***************************************************************************
+ * Copyright (C) 2005 by Joe Ferris *
+ * jferris@optimistictech.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. *
+ * *
+ * 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 MOZILLABOOKMARK_H
+#define MOZILLABOOKMARK_H
+
+#include <qpixmap.h>
+
+#include "katapultitem.h"
+
+/**
+@author Joe Ferris
+*/
+class MozillaBookmark : public KatapultItem
+{
+ Q_OBJECT
+public:
+ MozillaBookmark(QString, QString, QPixmap);
+
+ virtual QPixmap icon(int) const;
+ virtual QString text() const;
+
+ QString url() const;
+
+private:
+ QString _url, _title;
+ QPixmap _icon;
+};
+
+#endif
diff --git a/katapult/plugins/catalogs/bookmarkcatalog/settings.ui b/katapult/plugins/catalogs/bookmarkcatalog/settings.ui
new file mode 100644
index 0000000..7a8121d
--- /dev/null
+++ b/katapult/plugins/catalogs/bookmarkcatalog/settings.ui
@@ -0,0 +1,117 @@
+<!DOCTYPE UI><UI version="3.2" stdsetdef="1">
+<class>BookmarkCatalogSettings</class>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>BookmarkCatalogSettings</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>401</width>
+ <height>280</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Settings</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout1</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>textLabel1</cstring>
+ </property>
+ <property name="text">
+ <string>Number of characters before searching:</string>
+ </property>
+ </widget>
+ <widget class="KIntSpinBox">
+ <property name="name">
+ <cstring>minQueryLen</cstring>
+ </property>
+ <property name="maxValue">
+ <number>10</number>
+ </property>
+ <property name="minValue">
+ <number>1</number>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Katapult will not search for programs until you have typed at least this many characters in the Katapult launcher.</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="QButtonGroup">
+ <property name="name">
+ <cstring>mozEnabled</cstring>
+ </property>
+ <property name="title">
+ <string>Import Mozilla bookmarks</string>
+ </property>
+ <property name="checkable">
+ <bool>true</bool>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QRadioButton">
+ <property name="name">
+ <cstring>mozAuto</cstring>
+ </property>
+ <property name="text">
+ <string>Automatically detect bookmark file</string>
+ </property>
+ </widget>
+ <widget class="QRadioButton">
+ <property name="name">
+ <cstring>mozManual</cstring>
+ </property>
+ <property name="text">
+ <string>Use the following file:</string>
+ </property>
+ </widget>
+ <widget class="KURLRequester">
+ <property name="name">
+ <cstring>mozFile</cstring>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>spacer1</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>100</height>
+ </size>
+ </property>
+ </spacer>
+ </vbox>
+</widget>
+<layoutdefaults spacing="6" margin="11"/>
+<includehints>
+ <includehint>knuminput.h</includehint>
+ <includehint>kurlrequester.h</includehint>
+ <includehint>klineedit.h</includehint>
+ <includehint>kpushbutton.h</includehint>
+</includehints>
+</UI>
diff --git a/katapult/plugins/catalogs/calculatorcatalog/Makefile.am b/katapult/plugins/catalogs/calculatorcatalog/Makefile.am
new file mode 100644
index 0000000..c0753c2
--- /dev/null
+++ b/katapult/plugins/catalogs/calculatorcatalog/Makefile.am
@@ -0,0 +1,20 @@
+# Copyright (C) 2005 Tobi Vollebregt
+
+# set the include path for X, qt and KDE
+INCLUDES = -I$(top_srcdir)/katapult/common $(all_includes)
+
+# header files
+noinst_HEADERS = calculatorcatalog.h expression.h actionevalexpr.h
+
+# use automoc
+METASOURCES = AUTO
+
+# install xcalc icon
+KDE_ICON = xcalc checkmark no
+
+# our plugin
+kde_module_LTLIBRARIES = katapult_calculatorcatalog.la
+katapult_calculatorcatalog_la_SOURCES = settings.ui calculatorcatalog.cpp expression.cpp actionevalexpr.cpp parser.cpp
+katapult_calculatorcatalog_la_LDFLAGS = -module $(KDE_RPATH) $(KDE_PLUGIN) $(all_libraries)
+katapult_calculatorcatalog_la_LIBADD = $(LIB_QT) $(LIB_KDECORE) $(LIB_KDEUI) $(LIB_KIO) $(top_builddir)/katapult/common/libkatapult.la
+kde_services_DATA = katapult_calculatorcatalog.desktop
diff --git a/katapult/plugins/catalogs/calculatorcatalog/actionevalexpr.cpp b/katapult/plugins/catalogs/calculatorcatalog/actionevalexpr.cpp
new file mode 100644
index 0000000..2a786f9
--- /dev/null
+++ b/katapult/plugins/catalogs/calculatorcatalog/actionevalexpr.cpp
@@ -0,0 +1,161 @@
+/***************************************************************************
+ * Copyright (C) 2005 Tobi Vollebregt *
+ * tobivollebregt@gmail.com *
+ * *
+ * Copyright (C) 2005 by Joe Ferris *
+ * jferris@optimistictech.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. *
+ * *
+ * 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. *
+ ***************************************************************************/
+
+#include <kapplication.h>
+#include <kglobal.h>
+#include <kiconloader.h>
+#include <krun.h>
+#include <kurl.h>
+#include <klocale.h>
+
+#include <qclipboard.h>
+
+#include "calculatorcatalog.h"
+#include "expression.h"
+#include "katapultitem.h"
+#include "actionevalexpr.h"
+
+
+// Conditional compilation to not bloat the lib if
+// KDE already has the following functions.
+// Prevents a deprecated function warning too.
+
+#if !KDE_IS_VERSION(3, 5, 0)
+
+// Copied some code from KDE 3.5 to make it compile on 3.4.
+
+// insert (thousands)-"separator"s into the non-fractional part of str
+static void _insertSeparator(QString &str, const QString &separator, const QString &decimalSymbol)
+{
+ // leave fractional part untouched
+ QString mainPart = str.section(decimalSymbol, 0, 0);
+ QString fracPart = str.section(decimalSymbol, 1, 1, QString::SectionIncludeLeadingSep);
+ if (fracPart==decimalSymbol) fracPart=QString();
+ for (int pos = mainPart.length() - 3; pos > 0; pos -= 3)
+ mainPart.insert(pos, separator);
+ str = mainPart + fracPart;
+}
+
+// This was KLocale::formatNumber(const QString&, bool, int)
+
+static QString formatNumber(const QString &numStr)
+{
+ QString tmpString = numStr;
+
+ // Skip the sign (for now)
+ bool neg = (tmpString[0] == '-');
+ if (neg || tmpString[0] == '+') tmpString.remove(0, 1);
+
+ // Split off exponential part (including 'e'-symbol)
+ QString mantString = tmpString.section('e', 0, 0, QString::SectionCaseInsensitiveSeps);
+ QString expString = tmpString.section('e', 1, 1, QString::SectionCaseInsensitiveSeps | QString::SectionIncludeLeadingSep);
+ if (expString.length()==1) expString=QString();
+
+ // Replace dot with locale decimal separator
+ mantString.replace(QChar('.'), KGlobal::locale()->decimalSymbol());
+
+ // Insert the thousand separators
+ _insertSeparator(mantString, KGlobal::locale()->thousandsSeparator(), KGlobal::locale()->decimalSymbol());
+
+ // How can we know where we should put the sign?
+ mantString.prepend(neg?KGlobal::locale()->negativeSign():KGlobal::locale()->positiveSign());
+
+ return mantString + expString;
+}
+
+#else
+// KDE_VERSION >= 3.5.0
+
+static QString formatNumber(const QString& numStr)
+{
+ return KGlobal::locale()->formatNumber(numStr, false, 0);
+}
+
+#endif
+
+
+ActionEvaluateExpression::ActionEvaluateExpression()
+ : KatapultAction(), _expr(0)
+{
+}
+
+ActionEvaluateExpression::~ActionEvaluateExpression()
+{
+}
+
+QString ActionEvaluateExpression::text() const
+{
+ if (_expr->parseError()) {
+ return i18n("Evaluate Expression");
+ } else {
+ // Format result.
+ int digits = _expr->catalog()->fracDigits();
+ QChar f = _expr->catalog()->scientific() ? 'g' : 'f';
+ QString num = QString::number(_expr->result(), f, digits);
+ // Strip trailing zeroes.
+ if (f == 'f' && digits != 0) {
+ while (num.endsWith("0")) {
+ num = num.left(num.length() - 1);
+ }
+ if (num.endsWith(".")) {
+ num = num.left(num.length() - 1);
+ }
+ }
+ // Localize (choose right implementation based on KDE version, see above).
+ return formatNumber(num);
+ }
+}
+
+QPixmap ActionEvaluateExpression::icon(int size) const
+{
+ return KGlobal::iconLoader()->loadIcon("xcalc", KIcon::NoGroup, size);
+}
+
+bool ActionEvaluateExpression::accepts(const KatapultItem* item) const
+{
+ bool accept = strcmp(item->className(), "Expression") == 0;
+ if (accept) {
+ _expr = (const Expression*)item;
+ }
+ return accept;
+}
+
+void ActionEvaluateExpression::execute(const KatapultItem* item) const
+{
+ if (strcmp(item->className(), "Expression") == 0) {
+ _expr = (const Expression*)item;
+
+ //evaluate expression with assignments enabled
+ _expr->evaluate(true);
+
+ // Copy calculation and result into clipboard (unless there's a parse error).
+ if (!_expr->parseError()) {
+ QClipboard *cb = QApplication::clipboard();
+ QString s = _expr->catalog()->formatString();
+ s.replace("%1", _expr->text());
+ s.replace("%2", text());
+ cb->setText(s, QClipboard::Clipboard);
+ cb->setText(s, QClipboard::Selection);
+ }
+ }
+}
diff --git a/katapult/plugins/catalogs/calculatorcatalog/actionevalexpr.h b/katapult/plugins/catalogs/calculatorcatalog/actionevalexpr.h
new file mode 100644
index 0000000..6cf23bf
--- /dev/null
+++ b/katapult/plugins/catalogs/calculatorcatalog/actionevalexpr.h
@@ -0,0 +1,51 @@
+/***************************************************************************
+ * Copyright (C) 2005 Tobi Vollebregt *
+ * tobivollebregt@gmail.com *
+ * *
+ * Copyright (C) 2005 by Joe Ferris *
+ * jferris@optimistictech.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. *
+ * *
+ * 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 ACTIONEVALEXPR_H
+#define ACTIONEVALEXPR_H
+
+#include "katapultaction.h"
+
+class KatapultItem;
+class Expression;
+
+/**
+@author Tobi Vollebregt
+*/
+class ActionEvaluateExpression : public KatapultAction
+{
+ public:
+ ActionEvaluateExpression();
+ ~ActionEvaluateExpression();
+
+ virtual void execute(const KatapultItem*) const;
+ virtual bool accepts(const KatapultItem*) const;
+ virtual QString text() const;
+ virtual QPixmap icon(int) const;
+
+ private:
+ //_expr needs to be mutable because accepts() is const.
+ mutable const Expression* _expr;
+
+};
+
+#endif
diff --git a/katapult/plugins/catalogs/calculatorcatalog/calculatorcatalog.cpp b/katapult/plugins/catalogs/calculatorcatalog/calculatorcatalog.cpp
new file mode 100644
index 0000000..c3c5f6d
--- /dev/null
+++ b/katapult/plugins/catalogs/calculatorcatalog/calculatorcatalog.cpp
@@ -0,0 +1,360 @@
+/***************************************************************************
+ * Copyright (C) 2005 Tobi Vollebregt *
+ * tobivollebregt@gmail.com *
+ * *
+ * Copyright (C) 2005 by Joe Ferris *
+ * jferris@optimistictech.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. *
+ * *
+ * 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. *
+ ***************************************************************************/
+
+#include <kservicegroup.h>
+#include <ksycocaentry.h>
+#include <ksycocatype.h>
+#include <kapplication.h>
+#include <knuminput.h>
+#include <kcombobox.h>
+
+#include <qcheckbox.h>
+#include <qbuttongroup.h>
+#include <qradiobutton.h>
+#include <qregexp.h>
+
+#include <math.h>
+
+#include "settings.h"
+#include "calculatorcatalog.h"
+#include "expression.h"
+#include "actionregistry.h"
+#include "actionevalexpr.h"
+#include "status.h"
+
+
+#ifndef M_PI
+#define M_PI 3.14159265358979323846
+#endif
+
+#ifndef M_E
+#define M_E 2.7182818284590452354
+#endif
+
+
+static double frac(double x)
+{
+ double nowhere;
+ return modf(x, &nowhere);
+}
+
+
+static double deg_sin(double x) { return sin(x * (M_PI / 180.0)); }
+static double deg_cos(double x) { return cos(x * (M_PI / 180.0)); }
+static double deg_tan(double x) { return tan(x * (M_PI / 180.0)); }
+static double deg_asin(double x) { return asin(x) * (180.0 / M_PI); }
+static double deg_acos(double x) { return acos(x) * (180.0 / M_PI); }
+static double deg_atan(double x) { return atan(x) * (180.0 / M_PI); }
+static double deg_sinh(double x) { return sinh(x * (M_PI / 180.0)); }
+static double deg_cosh(double x) { return cosh(x * (M_PI / 180.0)); }
+static double deg_tanh(double x) { return tanh(x * (M_PI / 180.0)); }
+static double deg_asinh(double x) { return asinh(x) * (180.0 / M_PI); }
+static double deg_acosh(double x) { return acosh(x) * (180.0 / M_PI); }
+static double deg_atanh(double x) { return atanh(x) * (180.0 / M_PI); }
+
+
+const CalculatorCatalog::Function CalculatorCatalog::radiansFunctionTable[] =
+{
+ { "sin", 3, sin },
+ { "cos", 3, cos },
+ { "tan", 3, tan },
+ { "asin", 4, asin },
+ { "acos", 4, acos },
+ { "atan", 4, atan },
+ { "sinh", 4, sinh },
+ { "cosh", 4, cosh },
+ { "tanh", 4, tanh },
+ { "asinh", 5, asinh },
+ { "acosh", 5, acosh },
+ { "atanh", 5, atanh },
+ { "sqrt", 4, sqrt },
+ { "log", 3, log10 },
+ { "ln", 2, log },
+ { "exp", 3, exp },
+ { "abs", 3, fabs },
+ { "frac", 4, frac },
+ { "round", 5, round },
+ { "int", 3, trunc },
+ { 0, 0, 0 }
+};
+
+const CalculatorCatalog::Function CalculatorCatalog::degreesFunctionTable[] =
+{
+ { "sin", 3, deg_sin },
+ { "cos", 3, deg_cos },
+ { "tan", 3, deg_tan },
+ { "asin", 4, deg_asin },
+ { "acos", 4, deg_acos },
+ { "atan", 4, deg_atan },
+ { "sinh", 4, deg_sinh },
+ { "cosh", 4, deg_cosh },
+ { "tanh", 4, deg_tanh },
+ { "asinh", 5, deg_asinh },
+ { "acosh", 5, deg_acosh },
+ { "atanh", 5, deg_atanh },
+ { "sqrt", 4, sqrt },
+ { "log", 3, log10 },
+ { "ln", 2, log },
+ { "exp", 3, exp },
+ { "abs", 3, fabs },
+ { "frac", 4, frac },
+ { "round", 5, round },
+ { "int", 3, trunc },
+ { 0, 0, 0 }
+};
+
+
+K_EXPORT_COMPONENT_FACTORY( katapult_calculatorcatalog,
+ KGenericFactory<CalculatorCatalog>( "katapult_calculatorcatalog" ) )
+
+CalculatorCatalog::CalculatorCatalog(QObject*, const char*, const QStringList&): _result(this, QString::null)
+{
+ ActionRegistry::self()->registerAction(new ActionEvaluateExpression());
+
+ setVar(getVarID("pi"), M_PI);
+ setVar(getVarID("e"), M_E);
+}
+
+CalculatorCatalog::~CalculatorCatalog()
+{
+}
+
+void CalculatorCatalog::queryChanged()
+{
+ int newStatus = 0;
+ QString cmd = query();
+
+ if (cmd.isEmpty()) {
+ reset();
+ setBestMatch(Match());
+ } else {
+ if (accepts(cmd)) {
+ int i, origLength = cmd.length(), length = origLength;
+ //autocomplete functions
+ cmd = cmd.lower();
+ for (i = length - 1; i >= 0 && cmd[i].isLetter(); --i) { }
+ if (i != length - 1) {
+ QString start = cmd.mid(i + 1);
+ int lengthOfShortest = 9999, shortest = -1;
+ for (int j = 0; radiansFunctionTable[j].name; ++j) {
+ if (QString(radiansFunctionTable[j].name).startsWith(start)) {
+ if (radiansFunctionTable[j].length < lengthOfShortest) {
+ lengthOfShortest = radiansFunctionTable[j].length;
+ shortest = j;
+ }
+ }
+ }
+ if (shortest != -1) {
+ cmd = cmd.left(i + 1).append(radiansFunctionTable[shortest].name).append("(");
+ length = cmd.length();
+ }
+ }
+ //fix parse errors at end of expression,
+ //ie. close open parentheses, convert operators into NOPs
+ for (i = length - 1; i >= 0 && (cmd[i] == '(' || cmd[i] == ' '); --i) { }
+ if (i < 0 || cmd[i] == '+' || cmd[i] == '-') {
+ cmd.append("0");
+ ++length;
+ } else if (cmd[i] == '*' || cmd[i] == '/' || cmd[i] == '^') {
+ cmd.append("1");
+ ++length;
+ } else if (cmd[i].isLetter() && (i < length - 1 && cmd[i + 1] == '(')) {
+ //just add a 0 if it's a function: we don't bother to backpropagate
+ //through the parse tree (if it existed at all) to figure out a NOP value
+ //for this particular (chain of) function(s).
+ cmd.append("0");
+ ++length;
+ }
+ int openParen = 0;
+ //use cmd.length() here, it may be > than length.
+ for (i = 0; i < length; ++i) {
+ if (cmd[i] == '(') ++openParen;
+ if (cmd[i] == ')') --openParen;
+ }
+ if (openParen > 0) {
+ char* closeParen = new char[openParen + 1];
+ memset(closeParen, ')', openParen);
+ closeParen[openParen] = 0;
+ cmd.append(closeParen);
+ delete[] closeParen;
+ }
+ _result.setText(cmd);
+ setBestMatch(Match(&_result, _result.parseError() ? 10 : 100, origLength));
+ //set status.
+ //add S_Multiple to make sure katapult doesn't auto-exec and close the window
+ //add S_Active to make sure katapult doesn't start the hideTimer or clearTimer
+ newStatus = S_HasResults | S_Multiple | S_Active;
+ } else {
+ newStatus = 0;
+ }
+ }
+ setStatus(newStatus);
+}
+
+void CalculatorCatalog::reset()
+{
+ _result.setText(QString::null);
+}
+
+bool CalculatorCatalog::accepts(const QString& str) const
+{
+ //Heuristic to determine whether the string is an expression or not.
+ //Accept anything containing [()+\\-/*^=.,0-9].
+ return QRegExp("[()+\\-/*^=.,0-9]").search(str) >= 0;
+}
+
+int CalculatorCatalog::getVarID(const char* name)
+{
+ VarNameToIdMap::iterator it = varNameToId.find(QString(name));
+ if (it == varNameToId.end()) {
+ _pendingVarName = QString(name);
+ return -1;
+ }
+ return *it;
+}
+
+double CalculatorCatalog::getVar(int id) const
+{
+ return varIdToValue[id];
+}
+
+double CalculatorCatalog::setVar(int id, double value)
+{
+ if (id == -1) {
+ id = varIdToValue.count();
+ varNameToId.insert(_pendingVarName, id);
+ varIdToValue.push_back(value);
+ } else {
+ varIdToValue[id] = value;
+ }
+ return value;
+}
+
+/*
+void CalculatorCatalog::initialize()
+{
+}
+*/
+
+void CalculatorCatalog::readSettings(KConfigBase* config)
+{
+ _fracDigits = config->readUnsignedNumEntry("FracDigits", 2);
+ _bScientific = config->readBoolEntry("Scientific", false);
+ _bDegrees = config->readBoolEntry("Degrees", false);
+ _bClipboard = config->readBoolEntry("Clipboard", true);
+ _formatString = config->readEntry("FormatString", "%1 = %2");
+}
+
+void CalculatorCatalog::writeSettings(KConfigBase* config)
+{
+ config->writeEntry("FracDigits", fracDigits());
+ config->writeEntry("Scientific", scientific());
+ config->writeEntry("Degrees", degrees());
+ config->writeEntry("Clipboard", clipboard());
+ config->writeEntry("FormatString", formatString());
+}
+
+QWidget * CalculatorCatalog::configure()
+{
+ CalculatorCatalogSettings* settings = new CalculatorCatalogSettings();
+
+ settings->fracDigits->setValue(_fracDigits);
+ connect(settings->fracDigits, SIGNAL(valueChanged(int)), this, SLOT(fracDigitsChanged(int)));
+
+ settings->normal->setChecked(!scientific());
+ settings->scientific->setChecked(scientific());
+ connect(settings->scientific, SIGNAL(toggled(bool)), this, SLOT(scientificChanged(bool)));
+
+ settings->radians->setChecked(!degrees());
+ settings->degrees->setChecked(degrees());
+ connect(settings->degrees, SIGNAL(toggled(bool)), this, SLOT(degreesChanged(bool)));
+
+ settings->clipboard->setChecked(clipboard());
+ connect(settings->clipboard, SIGNAL(toggled(bool)), this, SLOT(clipboardChanged(bool)));
+
+ settings->formatString->setText(formatString());
+ connect(settings->formatString, SIGNAL(textChanged(const QString&)), this, SLOT(formatStringChanged(const QString&)));
+
+ return settings;
+}
+
+void CalculatorCatalog::fracDigitsChanged(int n)
+{
+ _fracDigits = n;
+}
+
+int CalculatorCatalog::fracDigits() const
+{
+ return _fracDigits;
+}
+
+void CalculatorCatalog::scientificChanged(bool en)
+{
+ _bScientific = en;
+}
+
+bool CalculatorCatalog::scientific() const
+{
+ return _bScientific;
+}
+
+void CalculatorCatalog::degreesChanged(bool en)
+{
+ _bDegrees = en;
+}
+
+bool CalculatorCatalog::degrees() const
+{
+ return _bDegrees;
+}
+
+void CalculatorCatalog::formatStringChanged(const QString& fmt)
+{
+ _formatString = fmt;
+}
+
+QString CalculatorCatalog::formatString() const
+{
+ return _formatString;
+}
+
+void CalculatorCatalog::clipboardChanged(bool en)
+{
+ _bClipboard = en;
+}
+
+bool CalculatorCatalog::clipboard() const
+{
+ return _bClipboard;
+}
+
+const CalculatorCatalog::Function* CalculatorCatalog::functionTable() const
+{
+ if (degrees()) {
+ return degreesFunctionTable;
+ } else {
+ return radiansFunctionTable;
+ }
+}
+
+#include "calculatorcatalog.moc"
diff --git a/katapult/plugins/catalogs/calculatorcatalog/calculatorcatalog.h b/katapult/plugins/catalogs/calculatorcatalog/calculatorcatalog.h
new file mode 100644
index 0000000..88f03cc
--- /dev/null
+++ b/katapult/plugins/catalogs/calculatorcatalog/calculatorcatalog.h
@@ -0,0 +1,122 @@
+/***************************************************************************
+ * Copyright (C) 2005 Tobi Vollebregt *
+ * tobivollebregt@gmail.com *
+ * *
+ * Copyright (C) 2005 by Joe Ferris *
+ * jferris@optimistictech.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. *
+ * *
+ * 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 CALCULATORCATALOG_H
+#define CALCULATORCATALOG_H
+
+#include <kgenericfactory.h>
+
+#include <qmap.h>
+#include <qptrlist.h>
+#include <qstring.h>
+#include <qvaluevector.h>
+
+#include "expression.h"
+#include "katapultcatalog.h"
+
+class QWidget;
+
+typedef double (*FunPtr)(double);
+
+/**
+@author Tobi Vollebregt
+ */
+class CalculatorCatalog : public KatapultCatalog
+{
+ Q_OBJECT
+
+ public:
+
+ struct ParserControl {
+ const char* expression;
+ CalculatorCatalog* catalog;
+ bool assignments; //are assignments enabled?
+ double result;
+ };
+
+ struct Function {
+ const char* name;
+ int length;
+ FunPtr fptr;
+ };
+
+ CalculatorCatalog(QObject*, const char*, const QStringList&);
+ virtual ~CalculatorCatalog();
+
+ //virtual void initialize();
+ virtual void readSettings(KConfigBase*);
+ virtual void writeSettings(KConfigBase*);
+ virtual QWidget* configure();
+
+ int getVarID(const char*);
+ double getVar(int) const;
+ double setVar(int, double);
+
+ int fracDigits() const;
+ bool scientific() const;
+ bool degrees() const;
+ bool clipboard() const;
+ QString formatString() const;
+ const Function* functionTable() const;
+
+ protected:
+
+ virtual void queryChanged();
+
+ private:
+
+ typedef QMap<QString, int> VarNameToIdMap;
+ typedef QValueVector<double> VarIdToValueVector;
+
+ static const Function radiansFunctionTable[];
+ static const Function degreesFunctionTable[];
+
+ void reset();
+ bool accepts(const QString&) const;
+
+ Expression _result; // The one result (there's always one).
+
+ VarNameToIdMap varNameToId; // Maps strings to IDs.
+ VarIdToValueVector varIdToValue; // Maps IDs to values.
+ QString _pendingVarName; // Pending while rest of assignment is parsed.
+
+ int _fracDigits; // Number of fractional digits.
+ bool _bScientific; // Normal or scientific mode?
+ bool _bDegrees; // Radians or degrees?
+ bool _bClipboard; // Copy to clipboard?
+ QString _formatString; // for clipboard copy
+
+ private slots:
+
+ void fracDigitsChanged(int);
+ void scientificChanged(bool);
+ void degreesChanged(bool);
+ void clipboardChanged(bool);
+ void formatStringChanged(const QString&);
+
+};
+
+
+/* from parser.y / parser.cpp: */
+int yyparse(CalculatorCatalog::ParserControl*);
+
+#endif
diff --git a/katapult/plugins/catalogs/calculatorcatalog/expression.cpp b/katapult/plugins/catalogs/calculatorcatalog/expression.cpp
new file mode 100644
index 0000000..37e80bc
--- /dev/null
+++ b/katapult/plugins/catalogs/calculatorcatalog/expression.cpp
@@ -0,0 +1,94 @@
+/***************************************************************************
+ * Copyright (C) 2005 Tobi Vollebregt *
+ * tobivollebregt@gmail.com *
+ * *
+ * Copyright (C) 2005 by Joe Ferris *
+ * jferris@optimistictech.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. *
+ * *
+ * 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. *
+ ***************************************************************************/
+
+#include <kservice.h>
+#include <kglobal.h>
+#include <kiconloader.h>
+
+#include "calculatorcatalog.h"
+#include "expression.h"
+
+
+Expression::Expression(CalculatorCatalog* catalog, const QString& text): KatapultItem(), _catalog(catalog), _text(text)
+{
+ evaluate();
+}
+
+QPixmap Expression::icon(int size) const
+{
+ const char* icon = "checkmark";
+ if (_parseError) {
+ icon = "no";
+ }
+ return KGlobal::iconLoader()->loadIcon(icon, KIcon::NoGroup, size);
+}
+
+QString Expression::text() const
+{
+ return _text;
+}
+
+void Expression::setText(const QString& text)
+{
+ _text = text;
+ evaluate();
+}
+
+double Expression::result() const
+{
+ return _result;
+}
+
+bool Expression::parseError() const
+{
+ return _parseError;
+}
+
+CalculatorCatalog* Expression::catalog() const
+{
+ return _catalog;
+}
+
+void Expression::evaluate(bool assignments) const
+{
+ if (!_text.isEmpty()) {
+ QString t = _text;
+ CalculatorCatalog::ParserControl cntrl;
+ cntrl.expression = t.replace(',', '.').ascii();
+ cntrl.catalog = _catalog;
+ cntrl.assignments = assignments;
+ if (yyparse(&cntrl) == 0) {
+ _result = cntrl.result;
+ _parseError = false;
+ if (assignments) {
+ _catalog->setVar(_catalog->getVarID("ans"), _result);
+ }
+ } else {
+ _parseError = true;
+ }
+ } else {
+ _parseError = true;
+ }
+}
+
+#include "expression.moc"
diff --git a/katapult/plugins/catalogs/calculatorcatalog/expression.h b/katapult/plugins/catalogs/calculatorcatalog/expression.h
new file mode 100644
index 0000000..6d736f9
--- /dev/null
+++ b/katapult/plugins/catalogs/calculatorcatalog/expression.h
@@ -0,0 +1,60 @@
+/***************************************************************************
+ * Copyright (C) 2005 Tobi Vollebregt *
+ * tobivollebregt@gmail.com *
+ * *
+ * Copyright (C) 2005 by Joe Ferris *
+ * jferris@optimistictech.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. *
+ * *
+ * 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 EXPRESSION_H
+#define EXPRESSION_H
+
+#include <katapultitem.h>
+
+class CalculatorCatalog;
+
+/**
+@author Tobi Vollebregt
+*/
+class Expression : public KatapultItem
+{
+ Q_OBJECT
+ public:
+ Expression(CalculatorCatalog*, const QString&);
+
+ virtual QPixmap icon(int) const;
+ virtual QString text() const;
+
+ void setText(const QString&);
+ double result() const;
+ bool parseError() const;
+
+ //evaluate() must be const, or ActionEvaluateExpression::execute() can't call it.
+ //It makes sense because evaluate() does _not_ change the expression,
+ //it just calculates the result and remembers that.
+ void evaluate(bool assignments = false) const;
+
+ CalculatorCatalog* catalog() const;
+
+ private:
+ CalculatorCatalog* const _catalog;
+ QString _text;
+ mutable double _result;
+ mutable bool _parseError;
+};
+
+#endif
diff --git a/katapult/plugins/catalogs/calculatorcatalog/hi128-action-checkmark.png b/katapult/plugins/catalogs/calculatorcatalog/hi128-action-checkmark.png
new file mode 100644
index 0000000..9854f79
--- /dev/null
+++ b/katapult/plugins/catalogs/calculatorcatalog/hi128-action-checkmark.png
Binary files differ
diff --git a/katapult/plugins/catalogs/calculatorcatalog/hi128-action-no.png b/katapult/plugins/catalogs/calculatorcatalog/hi128-action-no.png
new file mode 100644
index 0000000..dae60fe
--- /dev/null
+++ b/katapult/plugins/catalogs/calculatorcatalog/hi128-action-no.png
Binary files differ
diff --git a/katapult/plugins/catalogs/calculatorcatalog/hi128-app-xcalc.png b/katapult/plugins/catalogs/calculatorcatalog/hi128-app-xcalc.png
new file mode 100644
index 0000000..9330ae7
--- /dev/null
+++ b/katapult/plugins/catalogs/calculatorcatalog/hi128-app-xcalc.png
Binary files differ
diff --git a/katapult/plugins/catalogs/calculatorcatalog/katapult_calculatorcatalog.desktop b/katapult/plugins/catalogs/calculatorcatalog/katapult_calculatorcatalog.desktop
new file mode 100644
index 0000000..c528b32
--- /dev/null
+++ b/katapult/plugins/catalogs/calculatorcatalog/katapult_calculatorcatalog.desktop
@@ -0,0 +1,44 @@
+# Copyright (C) 2005 Tobi Vollebregt
+[Desktop Entry]
+Name=Calculator Catalog
+Name[ar]=مستعرض الآلة الحاسبة ( Calculator Catalog )
+Name[bg]=Каталог на калкулатора
+Name[br]=Katalog jederez
+Name[da]=Katalogisér beregninger
+Name[de]=Rechner-Katalog
+Name[el]=Κατάλογος υπολογισμών
+Name[es]=Catalogador de calculadora
+Name[et]=Kalkulaatorikataloog
+Name[fr]=Catalogue calculatrice
+Name[gl]=Catálogo de Calculadora
+Name[it]=Catalogo calcolatrice
+Name[ja]=計算機カタログ
+Name[nb]=Kalkulatorkatalog
+Name[nl]=Rekenmachinecatalogus
+Name[pt]=Catálogo da Calculadora
+Name[pt_BR]=Catálogo da Calculadora
+Name[sv]=Katalogisera beräkningar
+Name[tr]=Hesap Makinesi Kataloğu
+Name[uk]=Каталог калькулятора
+Comment=Catalogs the set of real numbers for easy calculation through katapult.
+Comment[ar]=يستعرض مجموعة ارقامك الحقيقية لعملية الحساب عن طريق katapult.
+Comment[bg]=Каталогизира с Katapult набора от числа с цел лесно пресмятане.
+Comment[da]=Katalogiserer mængden af reelle tal for nem beregning via Katapult.
+Comment[de]=Katalogisiert den Satz reeller Zahlen für einfaches Rechnen mit Katapult
+Comment[el]=Δημιουργεί κατάλογο με πραγματικούς αριθμούς για εύκολους υπολογισμούς μέσω του katapult.
+Comment[es]=Cataloga un conjunto de números reales para realizar con facilidad cálculos a través de katapult.
+Comment[et]=Kataloogib reaalarvud hõlpsaks arvutamiseks Katapulti abil.
+Comment[fr]=Cataloguer un ensemble de valeurs pour un calcul facile via Katapult
+Comment[gl]=Cataloga os números reais para seren calculados mediante katapult.
+Comment[it]=Cataloga l'insieme dei numeri reali per effettuare calcoli facilmente attraverso Katapult.
+Comment[ja]=Katapult から簡単に計算できるように実数のセットをカタログ化
+Comment[nb]=Katalogiserer mengden av reelle tall for enkel beregning via Katapult.
+Comment[nl]=Catalogiseert een set echte getallen voor eenvoudige berekening via katapult.
+Comment[pt]=Cataloga o conjunto de números reais para um cálculo simples através do Katapult.
+Comment[pt_BR]=Cataloga o conjunto de números reais para um cálculo simples através do Katapult.
+Comment[sv]=Katalogiserar mängden reella tal för enkel beräkning via Katapult.
+Comment[uk]=Робить каталог простих чисел для легких підрахунків через Катапульту.
+ServiceTypes=Katapult/Catalog
+Type=Service
+X-KDE-Library=katapult_calculatorcatalog
+X-Katapult-ID=Calculator Catalog
diff --git a/katapult/plugins/catalogs/calculatorcatalog/parser.cpp b/katapult/plugins/catalogs/calculatorcatalog/parser.cpp
new file mode 100644
index 0000000..995cbb2
--- /dev/null
+++ b/katapult/plugins/catalogs/calculatorcatalog/parser.cpp
@@ -0,0 +1,1387 @@
+/* A Bison parser, made by GNU Bison 2.0. */
+
+/* Skeleton parser for Yacc-like parsing with Bison,
+ Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
+
+ 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, 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, when this file is copied by Bison into a
+ Bison output file, you may use that output file without restriction.
+ This special exception was added by the Free Software Foundation
+ in version 1.24 of Bison. */
+
+/* Written by Richard Stallman by simplifying the original so called
+ ``semantic'' parser. */
+
+/* All symbols defined below should begin with yy or YY, to avoid
+ infringing on user name space. This should be done even for local
+ variables, as they might otherwise be expanded by user macros.
+ There are some unavoidable exceptions within include files to
+ define necessary library symbols; they are noted "INFRINGES ON
+ USER NAME SPACE" below. */
+
+/* Identify Bison output. */
+#define YYBISON 1
+
+/* Skeleton name. */
+#define YYSKELETON_NAME "yacc.c"
+
+/* Pure parsers. */
+#define YYPURE 1
+
+/* Using locations. */
+#define YYLSP_NEEDED 0
+
+
+
+/* Tokens. */
+#ifndef YYTOKENTYPE
+# define YYTOKENTYPE
+ /* Put the tokens into the symbol table, so that GDB and other debuggers
+ know about them. */
+ enum yytokentype {
+ NUM = 258,
+ FUN = 259,
+ VAR = 260,
+ NEG = 261
+ };
+#endif
+#define NUM 258
+#define FUN 259
+#define VAR 260
+#define NEG 261
+
+
+
+
+/* Copy the first part of user declarations. */
+#line 5 "plugins/catalogs/calculatorcatalog/parser.y"
+
+#define YYLEX_PARAM parsercontrol
+
+#include <math.h>
+#include <stdio.h>
+#include "calculatorcatalog.h"
+
+//void yyerror(char const *);
+#define yyerror(a,b)
+
+
+/* Enabling traces. */
+#ifndef YYDEBUG
+# define YYDEBUG 0
+#endif
+
+/* Enabling verbose error messages. */
+#ifdef YYERROR_VERBOSE
+# undef YYERROR_VERBOSE
+# define YYERROR_VERBOSE 1
+#else
+# define YYERROR_VERBOSE 0
+#endif
+
+#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
+#line 22 "plugins/catalogs/calculatorcatalog/parser.y"
+typedef union YYSTYPE {
+ double val; /* For returning numbers. */
+ FunPtr fptr; /* For returning function pointers. */
+ int id; /* For returning variables. */
+} YYSTYPE;
+/* Line 190 of yacc.c. */
+#line 105 "plugins/catalogs/calculatorcatalog/parser.cpp"
+# define yystype YYSTYPE /* obsolescent; will be withdrawn */
+# define YYSTYPE_IS_DECLARED 1
+# define YYSTYPE_IS_TRIVIAL 1
+#endif
+
+
+
+/* Copy the second part of user declarations. */
+#line 39 "plugins/catalogs/calculatorcatalog/parser.y"
+
+static int yylex(YYSTYPE* lvalp, CalculatorCatalog::ParserControl* parsercontrol);
+
+
+/* Line 213 of yacc.c. */
+#line 120 "plugins/catalogs/calculatorcatalog/parser.cpp"
+
+#if ! defined (yyoverflow) || YYERROR_VERBOSE
+
+# ifndef YYFREE
+# define YYFREE free
+# endif
+# ifndef YYMALLOC
+# define YYMALLOC malloc
+# endif
+
+/* The parser invokes alloca or malloc; define the necessary symbols. */
+
+# ifdef YYSTACK_USE_ALLOCA
+# if YYSTACK_USE_ALLOCA
+# ifdef __GNUC__
+# define YYSTACK_ALLOC __builtin_alloca
+# else
+# define YYSTACK_ALLOC alloca
+# endif
+# endif
+# endif
+
+# ifdef YYSTACK_ALLOC
+ /* Pacify GCC's `empty if-body' warning. */
+# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
+# else
+# if defined (__STDC__) || defined (__cplusplus)
+# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
+# define YYSIZE_T size_t
+# endif
+# define YYSTACK_ALLOC YYMALLOC
+# define YYSTACK_FREE YYFREE
+# endif
+#endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */
+
+
+#if (! defined (yyoverflow) \
+ && (! defined (__cplusplus) \
+ || (defined (YYSTYPE_IS_TRIVIAL) && YYSTYPE_IS_TRIVIAL)))
+
+/* A type that is properly aligned for any stack member. */
+union yyalloc
+{
+ short int yyss;
+ YYSTYPE yyvs;
+ };
+
+/* The size of the maximum gap between one aligned stack and the next. */
+# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
+
+/* The size of an array large to enough to hold all stacks, each with
+ N elements. */
+# define YYSTACK_BYTES(N) \
+ ((N) * (sizeof (short int) + sizeof (YYSTYPE)) \
+ + YYSTACK_GAP_MAXIMUM)
+
+/* Copy COUNT objects from FROM to TO. The source and destination do
+ not overlap. */
+# ifndef YYCOPY
+# if defined (__GNUC__) && 1 < __GNUC__
+# define YYCOPY(To, From, Count) \
+ __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
+# else
+# define YYCOPY(To, From, Count) \
+ do \
+ { \
+ register YYSIZE_T yyi; \
+ for (yyi = 0; yyi < (Count); yyi++) \
+ (To)[yyi] = (From)[yyi]; \
+ } \
+ while (0)
+# endif
+# endif
+
+/* Relocate STACK from its old location to the new one. The
+ local variables YYSIZE and YYSTACKSIZE give the old and new number of
+ elements in the stack, and YYPTR gives the new location of the
+ stack. Advance YYPTR to a properly aligned location for the next
+ stack. */
+# define YYSTACK_RELOCATE(Stack) \
+ do \
+ { \
+ YYSIZE_T yynewbytes; \
+ YYCOPY (&yyptr->Stack, Stack, yysize); \
+ Stack = &yyptr->Stack; \
+ yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
+ yyptr += yynewbytes / sizeof (*yyptr); \
+ } \
+ while (0)
+
+#endif
+
+#if defined (__STDC__) || defined (__cplusplus)
+ typedef signed char yysigned_char;
+#else
+ typedef short int yysigned_char;
+#endif
+
+/* YYFINAL -- State number of the termination state. */
+#define YYFINAL 13
+/* YYLAST -- Last index in YYTABLE. */
+#define YYLAST 47
+
+/* YYNTOKENS -- Number of terminals. */
+#define YYNTOKENS 15
+/* YYNNTS -- Number of nonterminals. */
+#define YYNNTS 3
+/* YYNRULES -- Number of rules. */
+#define YYNRULES 13
+/* YYNRULES -- Number of states. */
+#define YYNSTATES 28
+
+/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
+#define YYUNDEFTOK 2
+#define YYMAXUTOK 261
+
+#define YYTRANSLATE(YYX) \
+ ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
+
+/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
+static const unsigned char yytranslate[] =
+{
+ 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 13, 14, 9, 8, 2, 7, 2, 10, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 6, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 12, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
+ 5, 11
+};
+
+#if YYDEBUG
+/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
+ YYRHS. */
+static const unsigned char yyprhs[] =
+{
+ 0, 0, 3, 5, 9, 11, 15, 19, 23, 27,
+ 30, 34, 38, 43
+};
+
+/* YYRHS -- A `-1'-separated list of the rules' RHS. */
+static const yysigned_char yyrhs[] =
+{
+ 16, 0, -1, 17, -1, 5, 6, 17, -1, 3,
+ -1, 17, 8, 17, -1, 17, 7, 17, -1, 17,
+ 9, 17, -1, 17, 10, 17, -1, 7, 17, -1,
+ 17, 12, 17, -1, 13, 17, 14, -1, 4, 13,
+ 17, 14, -1, 5, -1
+};
+
+/* YYRLINE[YYN] -- source line where rule number YYN was defined. */
+static const unsigned char yyrline[] =
+{
+ 0, 45, 45, 46, 49, 50, 51, 52, 53, 54,
+ 55, 56, 57, 58
+};
+#endif
+
+#if YYDEBUG || YYERROR_VERBOSE
+/* YYTNME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
+ First, the terminals, then, starting at YYNTOKENS, nonterminals. */
+static const char *const yytname[] =
+{
+ "$end", "error", "$undefined", "NUM", "FUN", "VAR", "'='", "'-'", "'+'",
+ "'*'", "'/'", "NEG", "'^'", "'('", "')'", "$accept", "line", "exp", 0
+};
+#endif
+
+# ifdef YYPRINT
+/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
+ token YYLEX-NUM. */
+static const unsigned short int yytoknum[] =
+{
+ 0, 256, 257, 258, 259, 260, 61, 45, 43, 42,
+ 47, 261, 94, 40, 41
+};
+# endif
+
+/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
+static const unsigned char yyr1[] =
+{
+ 0, 15, 16, 16, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17
+};
+
+/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
+static const unsigned char yyr2[] =
+{
+ 0, 2, 1, 3, 1, 3, 3, 3, 3, 2,
+ 3, 3, 4, 1
+};
+
+/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
+ STATE-NUM when YYTABLE doesn't specify something else to do. Zero
+ means the default is an error. */
+static const unsigned char yydefact[] =
+{
+ 0, 4, 0, 13, 0, 0, 0, 2, 0, 0,
+ 13, 9, 0, 1, 0, 0, 0, 0, 0, 0,
+ 3, 11, 6, 5, 7, 8, 10, 12
+};
+
+/* YYDEFGOTO[NTERM-NUM]. */
+static const yysigned_char yydefgoto[] =
+{
+ -1, 6, 7
+};
+
+/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
+ STATE-NUM. */
+#define YYPACT_NINF -12
+static const yysigned_char yypact[] =
+{
+ 12, -12, -11, 2, 17, 17, 3, 35, 17, 17,
+ -12, 6, 19, -12, 17, 17, 17, 17, 17, 27,
+ 35, -12, -3, -3, 6, 6, 6, -12
+};
+
+/* YYPGOTO[NTERM-NUM]. */
+static const yysigned_char yypgoto[] =
+{
+ -12, -12, -4
+};
+
+/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
+ positive, shift that token. If negative, reduce the rule which
+ number is the opposite. If zero, do what YYDEFACT says.
+ If YYTABLE_NINF, syntax error. */
+#define YYTABLE_NINF -1
+static const unsigned char yytable[] =
+{
+ 11, 12, 8, 13, 19, 20, 16, 17, 9, 18,
+ 22, 23, 24, 25, 26, 1, 2, 3, 18, 4,
+ 1, 2, 10, 0, 4, 5, 14, 15, 16, 17,
+ 5, 18, 0, 21, 14, 15, 16, 17, 0, 18,
+ 0, 27, 14, 15, 16, 17, 0, 18
+};
+
+static const yysigned_char yycheck[] =
+{
+ 4, 5, 13, 0, 8, 9, 9, 10, 6, 12,
+ 14, 15, 16, 17, 18, 3, 4, 5, 12, 7,
+ 3, 4, 5, -1, 7, 13, 7, 8, 9, 10,
+ 13, 12, -1, 14, 7, 8, 9, 10, -1, 12,
+ -1, 14, 7, 8, 9, 10, -1, 12
+};
+
+/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
+ symbol of state STATE-NUM. */
+static const unsigned char yystos[] =
+{
+ 0, 3, 4, 5, 7, 13, 16, 17, 13, 6,
+ 5, 17, 17, 0, 7, 8, 9, 10, 12, 17,
+ 17, 14, 17, 17, 17, 17, 17, 14
+};
+
+#if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
+# define YYSIZE_T __SIZE_TYPE__
+#endif
+#if ! defined (YYSIZE_T) && defined (size_t)
+# define YYSIZE_T size_t
+#endif
+#if ! defined (YYSIZE_T)
+# if defined (__STDC__) || defined (__cplusplus)
+# include <stddef.h> /* INFRINGES ON USER NAME SPACE */
+# define YYSIZE_T size_t
+# endif
+#endif
+#if ! defined (YYSIZE_T)
+# define YYSIZE_T unsigned int
+#endif
+
+#define yyerrok (yyerrstatus = 0)
+#define yyclearin (yychar = YYEMPTY)
+#define YYEMPTY (-2)
+#define YYEOF 0
+
+#define YYACCEPT goto yyacceptlab
+#define YYABORT goto yyabortlab
+#define YYERROR goto yyerrorlab
+
+
+/* Like YYERROR except do call yyerror. This remains here temporarily
+ to ease the transition to the new meaning of YYERROR, for GCC.
+ Once GCC version 2 has supplanted version 1, this can go. */
+
+#define YYFAIL goto yyerrlab
+
+#define YYRECOVERING() (!!yyerrstatus)
+
+#define YYBACKUP(Token, Value) \
+do \
+ if (yychar == YYEMPTY && yylen == 1) \
+ { \
+ yychar = (Token); \
+ yylval = (Value); \
+ yytoken = YYTRANSLATE (yychar); \
+ YYPOPSTACK; \
+ goto yybackup; \
+ } \
+ else \
+ { \
+ yyerror (parsercontrol, "syntax error: cannot back up");\
+ YYERROR; \
+ } \
+while (0)
+
+
+#define YYTERROR 1
+#define YYERRCODE 256
+
+
+/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
+ If N is 0, then set CURRENT to the empty location which ends
+ the previous symbol: RHS[0] (always defined). */
+
+#define YYRHSLOC(Rhs, K) ((Rhs)[K])
+#ifndef YYLLOC_DEFAULT
+# define YYLLOC_DEFAULT(Current, Rhs, N) \
+ do \
+ if (N) \
+ { \
+ (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
+ (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
+ (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
+ (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
+ } \
+ else \
+ { \
+ (Current).first_line = (Current).last_line = \
+ YYRHSLOC (Rhs, 0).last_line; \
+ (Current).first_column = (Current).last_column = \
+ YYRHSLOC (Rhs, 0).last_column; \
+ } \
+ while (0)
+#endif
+
+
+/* YY_LOCATION_PRINT -- Print the location on the stream.
+ This macro was not mandated originally: define only if we know
+ we won't break user code: when these are the locations we know. */
+
+#ifndef YY_LOCATION_PRINT
+# if YYLTYPE_IS_TRIVIAL
+# define YY_LOCATION_PRINT(File, Loc) \
+ fprintf (File, "%d.%d-%d.%d", \
+ (Loc).first_line, (Loc).first_column, \
+ (Loc).last_line, (Loc).last_column)
+# else
+# define YY_LOCATION_PRINT(File, Loc) ((void) 0)
+# endif
+#endif
+
+
+/* YYLEX -- calling `yylex' with the right arguments. */
+
+#ifdef YYLEX_PARAM
+# define YYLEX yylex (&yylval, YYLEX_PARAM)
+#else
+# define YYLEX yylex (&yylval)
+#endif
+
+/* Enable debugging if requested. */
+#if YYDEBUG
+
+# ifndef YYFPRINTF
+# include <stdio.h> /* INFRINGES ON USER NAME SPACE */
+# define YYFPRINTF fprintf
+# endif
+
+# define YYDPRINTF(Args) \
+do { \
+ if (yydebug) \
+ YYFPRINTF Args; \
+} while (0)
+
+# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
+do { \
+ if (yydebug) \
+ { \
+ YYFPRINTF (stderr, "%s ", Title); \
+ yysymprint (stderr, \
+ Type, Value); \
+ YYFPRINTF (stderr, "\n"); \
+ } \
+} while (0)
+
+/*------------------------------------------------------------------.
+| yy_stack_print -- Print the state stack from its BOTTOM up to its |
+| TOP (included). |
+`------------------------------------------------------------------*/
+
+#if defined (__STDC__) || defined (__cplusplus)
+static void
+yy_stack_print (short int *bottom, short int *top)
+#else
+static void
+yy_stack_print (bottom, top)
+ short int *bottom;
+ short int *top;
+#endif
+{
+ YYFPRINTF (stderr, "Stack now");
+ for (/* Nothing. */; bottom <= top; ++bottom)
+ YYFPRINTF (stderr, " %d", *bottom);
+ YYFPRINTF (stderr, "\n");
+}
+
+# define YY_STACK_PRINT(Bottom, Top) \
+do { \
+ if (yydebug) \
+ yy_stack_print ((Bottom), (Top)); \
+} while (0)
+
+
+/*------------------------------------------------.
+| Report that the YYRULE is going to be reduced. |
+`------------------------------------------------*/
+
+#if defined (__STDC__) || defined (__cplusplus)
+static void
+yy_reduce_print (int yyrule)
+#else
+static void
+yy_reduce_print (yyrule)
+ int yyrule;
+#endif
+{
+ int yyi;
+ unsigned int yylno = yyrline[yyrule];
+ YYFPRINTF (stderr, "Reducing stack by rule %d (line %u), ",
+ yyrule - 1, yylno);
+ /* Print the symbols being reduced, and their result. */
+ for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++)
+ YYFPRINTF (stderr, "%s ", yytname [yyrhs[yyi]]);
+ YYFPRINTF (stderr, "-> %s\n", yytname [yyr1[yyrule]]);
+}
+
+# define YY_REDUCE_PRINT(Rule) \
+do { \
+ if (yydebug) \
+ yy_reduce_print (Rule); \
+} while (0)
+
+/* Nonzero means print parse trace. It is left uninitialized so that
+ multiple parsers can coexist. */
+int yydebug;
+#else /* !YYDEBUG */
+# define YYDPRINTF(Args)
+# define YY_SYMBOL_PRINT(Title, Type, Value, Location)
+# define YY_STACK_PRINT(Bottom, Top)
+# define YY_REDUCE_PRINT(Rule)
+#endif /* !YYDEBUG */
+
+
+/* YYINITDEPTH -- initial size of the parser's stacks. */
+#ifndef YYINITDEPTH
+# define YYINITDEPTH 200
+#endif
+
+/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
+ if the built-in stack extension method is used).
+
+ Do not make this value too large; the results are undefined if
+ SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH)
+ evaluated with infinite-precision integer arithmetic. */
+
+#ifndef YYMAXDEPTH
+# define YYMAXDEPTH 10000
+#endif
+
+
+
+#if YYERROR_VERBOSE
+
+# ifndef yystrlen
+# if defined (__GLIBC__) && defined (_STRING_H)
+# define yystrlen strlen
+# else
+/* Return the length of YYSTR. */
+static YYSIZE_T
+# if defined (__STDC__) || defined (__cplusplus)
+yystrlen (const char *yystr)
+# else
+yystrlen (yystr)
+ const char *yystr;
+# endif
+{
+ register const char *yys = yystr;
+
+ while (*yys++ != '\0')
+ continue;
+
+ return yys - yystr - 1;
+}
+# endif
+# endif
+
+# ifndef yystpcpy
+# if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
+# define yystpcpy stpcpy
+# else
+/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
+ YYDEST. */
+static char *
+# if defined (__STDC__) || defined (__cplusplus)
+yystpcpy (char *yydest, const char *yysrc)
+# else
+yystpcpy (yydest, yysrc)
+ char *yydest;
+ const char *yysrc;
+# endif
+{
+ register char *yyd = yydest;
+ register const char *yys = yysrc;
+
+ while ((*yyd++ = *yys++) != '\0')
+ continue;
+
+ return yyd - 1;
+}
+# endif
+# endif
+
+#endif /* !YYERROR_VERBOSE */
+
+
+
+#if YYDEBUG
+/*--------------------------------.
+| Print this symbol on YYOUTPUT. |
+`--------------------------------*/
+
+#if defined (__STDC__) || defined (__cplusplus)
+static void
+yysymprint (FILE *yyoutput, int yytype, YYSTYPE *yyvaluep)
+#else
+static void
+yysymprint (yyoutput, yytype, yyvaluep)
+ FILE *yyoutput;
+ int yytype;
+ YYSTYPE *yyvaluep;
+#endif
+{
+ /* Pacify ``unused variable'' warnings. */
+ (void) yyvaluep;
+
+ if (yytype < YYNTOKENS)
+ YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
+ else
+ YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
+
+
+# ifdef YYPRINT
+ if (yytype < YYNTOKENS)
+ YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
+# endif
+ switch (yytype)
+ {
+ default:
+ break;
+ }
+ YYFPRINTF (yyoutput, ")");
+}
+
+#endif /* ! YYDEBUG */
+/*-----------------------------------------------.
+| Release the memory associated to this symbol. |
+`-----------------------------------------------*/
+
+#if defined (__STDC__) || defined (__cplusplus)
+static void
+yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
+#else
+static void
+yydestruct (yymsg, yytype, yyvaluep)
+ const char *yymsg;
+ int yytype;
+ YYSTYPE *yyvaluep;
+#endif
+{
+ /* Pacify ``unused variable'' warnings. */
+ (void) yyvaluep;
+
+ if (!yymsg)
+ yymsg = "Deleting";
+ YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
+
+ switch (yytype)
+ {
+
+ default:
+ break;
+ }
+}
+
+
+/* Prevent warnings from -Wmissing-prototypes. */
+
+#ifdef YYPARSE_PARAM
+# if defined (__STDC__) || defined (__cplusplus)
+int yyparse (void *YYPARSE_PARAM);
+# else
+int yyparse ();
+# endif
+#else /* ! YYPARSE_PARAM */
+#if defined (__STDC__) || defined (__cplusplus)
+int yyparse (CalculatorCatalog::ParserControl* parsercontrol);
+#else
+int yyparse ();
+#endif
+#endif /* ! YYPARSE_PARAM */
+
+
+
+
+
+
+/*----------.
+| yyparse. |
+`----------*/
+
+#ifdef YYPARSE_PARAM
+# if defined (__STDC__) || defined (__cplusplus)
+int yyparse (void *YYPARSE_PARAM)
+# else
+int yyparse (YYPARSE_PARAM)
+ void *YYPARSE_PARAM;
+# endif
+#else /* ! YYPARSE_PARAM */
+#if defined (__STDC__) || defined (__cplusplus)
+int
+yyparse (CalculatorCatalog::ParserControl* parsercontrol)
+#else
+int
+yyparse (parsercontrol)
+ CalculatorCatalog::ParserControl* parsercontrol;
+#endif
+#endif
+{
+ /* The look-ahead symbol. */
+int yychar;
+
+/* The semantic value of the look-ahead symbol. */
+YYSTYPE yylval;
+
+/* Number of syntax errors so far. */
+int yynerrs;
+
+ register int yystate;
+ register int yyn;
+ int yyresult;
+ /* Number of tokens to shift before error messages enabled. */
+ int yyerrstatus;
+ /* Look-ahead token as an internal (translated) token number. */
+ int yytoken = 0;
+
+ /* Three stacks and their tools:
+ `yyss': related to states,
+ `yyvs': related to semantic values,
+ `yyls': related to locations.
+
+ Refer to the stacks thru separate pointers, to allow yyoverflow
+ to reallocate them elsewhere. */
+
+ /* The state stack. */
+ short int yyssa[YYINITDEPTH];
+ short int *yyss = yyssa;
+ register short int *yyssp;
+
+ /* The semantic value stack. */
+ YYSTYPE yyvsa[YYINITDEPTH];
+ YYSTYPE *yyvs = yyvsa;
+ register YYSTYPE *yyvsp;
+
+
+
+#define YYPOPSTACK (yyvsp--, yyssp--)
+
+ YYSIZE_T yystacksize = YYINITDEPTH;
+
+ /* The variables used to return semantic value and location from the
+ action routines. */
+ YYSTYPE yyval;
+
+
+ /* When reducing, the number of symbols on the RHS of the reduced
+ rule. */
+ int yylen;
+
+ YYDPRINTF ((stderr, "Starting parse\n"));
+
+ yystate = 0;
+ yyerrstatus = 0;
+ yynerrs = 0;
+ yychar = YYEMPTY; /* Cause a token to be read. */
+
+ /* Initialize stack pointers.
+ Waste one element of value and location stack
+ so that they stay on the same level as the state stack.
+ The wasted elements are never initialized. */
+
+ yyssp = yyss;
+ yyvsp = yyvs;
+
+
+ yyvsp[0] = yylval;
+
+ goto yysetstate;
+
+/*------------------------------------------------------------.
+| yynewstate -- Push a new state, which is found in yystate. |
+`------------------------------------------------------------*/
+ yynewstate:
+ /* In all cases, when you get here, the value and location stacks
+ have just been pushed. so pushing a state here evens the stacks.
+ */
+ yyssp++;
+
+ yysetstate:
+ *yyssp = yystate;
+
+ if (yyss + yystacksize - 1 <= yyssp)
+ {
+ /* Get the current used size of the three stacks, in elements. */
+ YYSIZE_T yysize = yyssp - yyss + 1;
+
+#ifdef yyoverflow
+ {
+ /* Give user a chance to reallocate the stack. Use copies of
+ these so that the &'s don't force the real ones into
+ memory. */
+ YYSTYPE *yyvs1 = yyvs;
+ short int *yyss1 = yyss;
+
+
+ /* Each stack pointer address is followed by the size of the
+ data in use in that stack, in bytes. This used to be a
+ conditional around just the two extra args, but that might
+ be undefined if yyoverflow is a macro. */
+ yyoverflow ("parser stack overflow",
+ &yyss1, yysize * sizeof (*yyssp),
+ &yyvs1, yysize * sizeof (*yyvsp),
+
+ &yystacksize);
+
+ yyss = yyss1;
+ yyvs = yyvs1;
+ }
+#else /* no yyoverflow */
+# ifndef YYSTACK_RELOCATE
+ goto yyoverflowlab;
+# else
+ /* Extend the stack our own way. */
+ if (YYMAXDEPTH <= yystacksize)
+ goto yyoverflowlab;
+ yystacksize *= 2;
+ if (YYMAXDEPTH < yystacksize)
+ yystacksize = YYMAXDEPTH;
+
+ {
+ short int *yyss1 = yyss;
+ union yyalloc *yyptr =
+ (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
+ if (! yyptr)
+ goto yyoverflowlab;
+ YYSTACK_RELOCATE (yyss);
+ YYSTACK_RELOCATE (yyvs);
+
+# undef YYSTACK_RELOCATE
+ if (yyss1 != yyssa)
+ YYSTACK_FREE (yyss1);
+ }
+# endif
+#endif /* no yyoverflow */
+
+ yyssp = yyss + yysize - 1;
+ yyvsp = yyvs + yysize - 1;
+
+
+ YYDPRINTF ((stderr, "Stack size increased to %lu\n",
+ (unsigned long int) yystacksize));
+
+ if (yyss + yystacksize - 1 <= yyssp)
+ YYABORT;
+ }
+
+ YYDPRINTF ((stderr, "Entering state %d\n", yystate));
+
+ goto yybackup;
+
+/*-----------.
+| yybackup. |
+`-----------*/
+yybackup:
+
+/* Do appropriate processing given the current state. */
+/* Read a look-ahead token if we need one and don't already have one. */
+/* yyresume: */
+
+ /* First try to decide what to do without reference to look-ahead token. */
+
+ yyn = yypact[yystate];
+ if (yyn == YYPACT_NINF)
+ goto yydefault;
+
+ /* Not known => get a look-ahead token if don't already have one. */
+
+ /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */
+ if (yychar == YYEMPTY)
+ {
+ YYDPRINTF ((stderr, "Reading a token: "));
+ yychar = YYLEX;
+ }
+
+ if (yychar <= YYEOF)
+ {
+ yychar = yytoken = YYEOF;
+ YYDPRINTF ((stderr, "Now at end of input.\n"));
+ }
+ else
+ {
+ yytoken = YYTRANSLATE (yychar);
+ YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
+ }
+
+ /* If the proper action on seeing token YYTOKEN is to reduce or to
+ detect an error, take that action. */
+ yyn += yytoken;
+ if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
+ goto yydefault;
+ yyn = yytable[yyn];
+ if (yyn <= 0)
+ {
+ if (yyn == 0 || yyn == YYTABLE_NINF)
+ goto yyerrlab;
+ yyn = -yyn;
+ goto yyreduce;
+ }
+
+ if (yyn == YYFINAL)
+ YYACCEPT;
+
+ /* Shift the look-ahead token. */
+ YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
+
+ /* Discard the token being shifted unless it is eof. */
+ if (yychar != YYEOF)
+ yychar = YYEMPTY;
+
+ *++yyvsp = yylval;
+
+
+ /* Count tokens shifted since error; after three, turn off error
+ status. */
+ if (yyerrstatus)
+ yyerrstatus--;
+
+ yystate = yyn;
+ goto yynewstate;
+
+
+/*-----------------------------------------------------------.
+| yydefault -- do the default action for the current state. |
+`-----------------------------------------------------------*/
+yydefault:
+ yyn = yydefact[yystate];
+ if (yyn == 0)
+ goto yyerrlab;
+ goto yyreduce;
+
+
+/*-----------------------------.
+| yyreduce -- Do a reduction. |
+`-----------------------------*/
+yyreduce:
+ /* yyn is the number of a rule to reduce with. */
+ yylen = yyr2[yyn];
+
+ /* If YYLEN is nonzero, implement the default value of the action:
+ `$$ = $1'.
+
+ Otherwise, the following line sets YYVAL to garbage.
+ This behavior is undocumented and Bison
+ users should not rely upon it. Assigning to YYVAL
+ unconditionally makes the parser a bit smaller, and it avoids a
+ GCC warning that YYVAL may be used uninitialized. */
+ yyval = yyvsp[1-yylen];
+
+
+ YY_REDUCE_PRINT (yyn);
+ switch (yyn)
+ {
+ case 2:
+#line 45 "plugins/catalogs/calculatorcatalog/parser.y"
+ { parsercontrol->result = (yyvsp[0].val); ;}
+ break;
+
+ case 3:
+#line 46 "plugins/catalogs/calculatorcatalog/parser.y"
+ { if (parsercontrol->assignments) parsercontrol->catalog->setVar((yyvsp[-2].id), (yyvsp[0].val)); ;}
+ break;
+
+ case 4:
+#line 49 "plugins/catalogs/calculatorcatalog/parser.y"
+ { (yyval.val) = (yyvsp[0].val); ;}
+ break;
+
+ case 5:
+#line 50 "plugins/catalogs/calculatorcatalog/parser.y"
+ { (yyval.val) = (yyvsp[-2].val) + (yyvsp[0].val); ;}
+ break;
+
+ case 6:
+#line 51 "plugins/catalogs/calculatorcatalog/parser.y"
+ { (yyval.val) = (yyvsp[-2].val) - (yyvsp[0].val); ;}
+ break;
+
+ case 7:
+#line 52 "plugins/catalogs/calculatorcatalog/parser.y"
+ { (yyval.val) = (yyvsp[-2].val) * (yyvsp[0].val); ;}
+ break;
+
+ case 8:
+#line 53 "plugins/catalogs/calculatorcatalog/parser.y"
+ { (yyval.val) = (yyvsp[-2].val) / (yyvsp[0].val); ;}
+ break;
+
+ case 9:
+#line 54 "plugins/catalogs/calculatorcatalog/parser.y"
+ { (yyval.val) = -(yyvsp[0].val); ;}
+ break;
+
+ case 10:
+#line 55 "plugins/catalogs/calculatorcatalog/parser.y"
+ { (yyval.val) = pow((yyvsp[-2].val), (yyvsp[0].val)); ;}
+ break;
+
+ case 11:
+#line 56 "plugins/catalogs/calculatorcatalog/parser.y"
+ { (yyval.val) = (yyvsp[-1].val); ;}
+ break;
+
+ case 12:
+#line 57 "plugins/catalogs/calculatorcatalog/parser.y"
+ { (yyval.val) = (*(yyvsp[-3].fptr))((yyvsp[-1].val)); ;}
+ break;
+
+ case 13:
+#line 58 "plugins/catalogs/calculatorcatalog/parser.y"
+ { if ((yyvsp[0].id) == -1) {yyerror(parsercontrol, "undeclared variable"); YYABORT;} (yyval.val) = parsercontrol->catalog->getVar((yyvsp[0].id)); ;}
+ break;
+
+
+ }
+
+/* Line 1037 of yacc.c. */
+#line 1098 "plugins/catalogs/calculatorcatalog/parser.cpp"
+
+ yyvsp -= yylen;
+ yyssp -= yylen;
+
+
+ YY_STACK_PRINT (yyss, yyssp);
+
+ *++yyvsp = yyval;
+
+
+ /* Now `shift' the result of the reduction. Determine what state
+ that goes to, based on the state we popped back to and the rule
+ number reduced by. */
+
+ yyn = yyr1[yyn];
+
+ yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
+ if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
+ yystate = yytable[yystate];
+ else
+ yystate = yydefgoto[yyn - YYNTOKENS];
+
+ goto yynewstate;
+
+
+/*------------------------------------.
+| yyerrlab -- here on detecting error |
+`------------------------------------*/
+yyerrlab:
+ /* If not already recovering from an error, report this error. */
+ if (!yyerrstatus)
+ {
+ ++yynerrs;
+#if YYERROR_VERBOSE
+ yyn = yypact[yystate];
+
+ if (YYPACT_NINF < yyn && yyn < YYLAST)
+ {
+ YYSIZE_T yysize = 0;
+ int yytype = YYTRANSLATE (yychar);
+ const char* yyprefix;
+ char *yymsg;
+ int yyx;
+
+ /* Start YYX at -YYN if negative to avoid negative indexes in
+ YYCHECK. */
+ int yyxbegin = yyn < 0 ? -yyn : 0;
+
+ /* Stay within bounds of both yycheck and yytname. */
+ int yychecklim = YYLAST - yyn;
+ int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
+ int yycount = 0;
+
+ yyprefix = ", expecting ";
+ for (yyx = yyxbegin; yyx < yyxend; ++yyx)
+ if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
+ {
+ yysize += yystrlen (yyprefix) + yystrlen (yytname [yyx]);
+ yycount += 1;
+ if (yycount == 5)
+ {
+ yysize = 0;
+ break;
+ }
+ }
+ yysize += (sizeof ("syntax error, unexpected ")
+ + yystrlen (yytname[yytype]));
+ yymsg = (char *) YYSTACK_ALLOC (yysize);
+ if (yymsg != 0)
+ {
+ char *yyp = yystpcpy (yymsg, "syntax error, unexpected ");
+ yyp = yystpcpy (yyp, yytname[yytype]);
+
+ if (yycount < 5)
+ {
+ yyprefix = ", expecting ";
+ for (yyx = yyxbegin; yyx < yyxend; ++yyx)
+ if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
+ {
+ yyp = yystpcpy (yyp, yyprefix);
+ yyp = yystpcpy (yyp, yytname[yyx]);
+ yyprefix = " or ";
+ }
+ }
+ yyerror (parsercontrol, yymsg);
+ YYSTACK_FREE (yymsg);
+ }
+ else
+ yyerror (parsercontrol, "syntax error; also virtual memory exhausted");
+ }
+ else
+#endif /* YYERROR_VERBOSE */
+ yyerror (parsercontrol, "syntax error");
+ }
+
+
+
+ if (yyerrstatus == 3)
+ {
+ /* If just tried and failed to reuse look-ahead token after an
+ error, discard it. */
+
+ if (yychar <= YYEOF)
+ {
+ /* If at end of input, pop the error token,
+ then the rest of the stack, then return failure. */
+ if (yychar == YYEOF)
+ for (;;)
+ {
+
+ YYPOPSTACK;
+ if (yyssp == yyss)
+ YYABORT;
+ yydestruct ("Error: popping",
+ yystos[*yyssp], yyvsp);
+ }
+ }
+ else
+ {
+ yydestruct ("Error: discarding", yytoken, &yylval);
+ yychar = YYEMPTY;
+ }
+ }
+
+ /* Else will try to reuse look-ahead token after shifting the error
+ token. */
+ goto yyerrlab1;
+
+
+/*---------------------------------------------------.
+| yyerrorlab -- error raised explicitly by YYERROR. |
+`---------------------------------------------------*/
+yyerrorlab:
+
+#ifdef __GNUC__
+ /* Pacify GCC when the user code never invokes YYERROR and the label
+ yyerrorlab therefore never appears in user code. */
+ if (0)
+ goto yyerrorlab;
+#endif
+
+yyvsp -= yylen;
+ yyssp -= yylen;
+ yystate = *yyssp;
+ goto yyerrlab1;
+
+
+/*-------------------------------------------------------------.
+| yyerrlab1 -- common code for both syntax error and YYERROR. |
+`-------------------------------------------------------------*/
+yyerrlab1:
+ yyerrstatus = 3; /* Each real token shifted decrements this. */
+
+ for (;;)
+ {
+ yyn = yypact[yystate];
+ if (yyn != YYPACT_NINF)
+ {
+ yyn += YYTERROR;
+ if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
+ {
+ yyn = yytable[yyn];
+ if (0 < yyn)
+ break;
+ }
+ }
+
+ /* Pop the current state because it cannot handle the error token. */
+ if (yyssp == yyss)
+ YYABORT;
+
+
+ yydestruct ("Error: popping", yystos[yystate], yyvsp);
+ YYPOPSTACK;
+ yystate = *yyssp;
+ YY_STACK_PRINT (yyss, yyssp);
+ }
+
+ if (yyn == YYFINAL)
+ YYACCEPT;
+
+ *++yyvsp = yylval;
+
+
+ /* Shift the error token. */
+ YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
+
+ yystate = yyn;
+ goto yynewstate;
+
+
+/*-------------------------------------.
+| yyacceptlab -- YYACCEPT comes here. |
+`-------------------------------------*/
+yyacceptlab:
+ yyresult = 0;
+ goto yyreturn;
+
+/*-----------------------------------.
+| yyabortlab -- YYABORT comes here. |
+`-----------------------------------*/
+yyabortlab:
+ yydestruct ("Error: discarding lookahead",
+ yytoken, &yylval);
+ yychar = YYEMPTY;
+ yyresult = 1;
+ goto yyreturn;
+
+#ifndef yyoverflow
+/*----------------------------------------------.
+| yyoverflowlab -- parser overflow comes here. |
+`----------------------------------------------*/
+yyoverflowlab:
+ yyerror (parsercontrol, "parser stack overflow");
+ yyresult = 2;
+ /* Fall through. */
+#endif
+
+yyreturn:
+#ifndef yyoverflow
+ if (yyss != yyssa)
+ YYSTACK_FREE (yyss);
+#endif
+ return yyresult;
+}
+
+
+#line 61 "plugins/catalogs/calculatorcatalog/parser.y"
+
+
+/* The lexical analyzer returns a double floating point
+number on the stack and the token NUM, or the numeric code
+of the character read if not a number. It skips all blanks
+and tabs, and returns 0 for end-of-input. */
+
+#include <ctype.h>
+#include <string.h>
+
+#define exp (parsercontrol->expression)
+
+static int yylex(YYSTYPE* lvalp, CalculatorCatalog::ParserControl* parsercontrol)
+{
+ int c;
+
+ /* Skip white space. */
+ while ((c = *(exp++)) == ' ') {
+ }
+ /* Return end-of-input. */
+ if (c == EOF) {
+ return 0;
+ }
+ /* Process numbers. */
+ if (c == '.' || isdigit(c)) {
+ char *endptr = 0;
+ lvalp->val = strtod(exp - 1, &endptr);
+ exp = endptr;
+ return NUM;
+ }
+ /* Process IDs. */
+ if (isalpha(c)) {
+ int length = 0;
+ char f[128];
+
+ --exp;
+ do {
+ f[length] = tolower(c);
+ ++length;
+ } while ((c = exp[length]) != 0 && isalpha(c));
+ f[length] = 0;
+
+ /* Process functions. */
+ const CalculatorCatalog::Function* const functions = parsercontrol->catalog->functionTable();
+ for (int i = 0; functions[i].name; ++i) {
+ if (length == functions[i].length && strcmp(f, functions[i].name) == 0) {
+ lvalp->fptr = functions[i].fptr;
+ exp += length;
+ return FUN;
+ }
+ }
+
+ /* Process variables. */
+ lvalp->id = parsercontrol->catalog->getVarID(f);
+ exp += length;
+ return VAR;
+ }
+ /* Return a single char. */
+ return c;
+}
+
+
diff --git a/katapult/plugins/catalogs/calculatorcatalog/parser.y b/katapult/plugins/catalogs/calculatorcatalog/parser.y
new file mode 100644
index 0000000..b614a70
--- /dev/null
+++ b/katapult/plugins/catalogs/calculatorcatalog/parser.y
@@ -0,0 +1,120 @@
+/* Author: Tobi Vollebregt */
+
+/* Infix notation calculator. */
+
+%{
+#define YYLEX_PARAM parsercontrol
+
+#include <math.h>
+#include <stdio.h>
+#include "calculatorcatalog.h"
+
+//void yyerror(char const *);
+#define yyerror(a,b)
+%}
+
+/* Be a reentrant parser. */
+%pure_parser
+
+%parse-param {CalculatorCatalog::ParserControl* parsercontrol}
+
+/* Bison declarations. */
+%union {
+ double val; /* For returning numbers. */
+ FunPtr fptr; /* For returning function pointers. */
+ int id; /* For returning variables. */
+}
+
+%token <val> NUM /* Simple double precision number. */
+%token <fptr> FUN /* Function. */
+%token <id> VAR /* Variable. */
+%type <val> exp
+
+%right '=' /* assignment */
+%left '-' '+'
+%left '*' '/'
+%left NEG /* negation--unary minus */
+%right '^' /* exponentiation */
+
+%{
+static int yylex(YYSTYPE* lvalp, CalculatorCatalog::ParserControl* parsercontrol);
+%}
+
+%% /* The grammar follows. */
+
+line: exp { parsercontrol->result = $1; }
+| VAR '=' exp { if (parsercontrol->assignments) parsercontrol->catalog->setVar($1, $3); }
+;
+
+exp: NUM { $$ = $1; }
+| exp '+' exp { $$ = $1 + $3; }
+| exp '-' exp { $$ = $1 - $3; }
+| exp '*' exp { $$ = $1 * $3; }
+| exp '/' exp { $$ = $1 / $3; }
+| '-' exp %prec NEG { $$ = -$2; }
+| exp '^' exp { $$ = pow($1, $3); }
+| '(' exp ')' { $$ = $2; }
+| FUN '(' exp ')' { $$ = (*$1)($3); }
+| VAR { if ($1 == -1) {yyerror(parsercontrol, "undeclared variable"); YYABORT;} $$ = parsercontrol->catalog->getVar($1); }
+;
+
+%%
+
+/* The lexical analyzer returns a double floating point
+number on the stack and the token NUM, or the numeric code
+of the character read if not a number. It skips all blanks
+and tabs, and returns 0 for end-of-input. */
+
+#include <ctype.h>
+#include <string.h>
+
+#define exp (parsercontrol->expression)
+
+static int yylex(YYSTYPE* lvalp, CalculatorCatalog::ParserControl* parsercontrol)
+{
+ int c;
+
+ /* Skip white space. */
+ while ((c = *(exp++)) == ' ') {
+ }
+ /* Return end-of-input. */
+ if (c == EOF) {
+ return 0;
+ }
+ /* Process numbers. */
+ if (c == '.' || isdigit(c)) {
+ char *endptr = 0;
+ lvalp->val = strtod(exp - 1, &endptr);
+ exp = endptr;
+ return NUM;
+ }
+ /* Process IDs. */
+ if (isalpha(c)) {
+ int length = 0;
+ char f[128];
+
+ --exp;
+ do {
+ f[length] = tolower(c);
+ ++length;
+ } while ((c = exp[length]) != 0 && isalpha(c));
+ f[length] = 0;
+
+ /* Process functions. */
+ const CalculatorCatalog::Function* const functions = parsercontrol->catalog->functionTable();
+ for (int i = 0; functions[i].name; ++i) {
+ if (length == functions[i].length && strcmp(f, functions[i].name) == 0) {
+ lvalp->fptr = functions[i].fptr;
+ exp += length;
+ return FUN;
+ }
+ }
+
+ /* Process variables. */
+ lvalp->id = parsercontrol->catalog->getVarID(f);
+ exp += length;
+ return VAR;
+ }
+ /* Return a single char. */
+ return c;
+}
diff --git a/katapult/plugins/catalogs/calculatorcatalog/settings.ui b/katapult/plugins/catalogs/calculatorcatalog/settings.ui
new file mode 100644
index 0000000..67c0faa
--- /dev/null
+++ b/katapult/plugins/catalogs/calculatorcatalog/settings.ui
@@ -0,0 +1,219 @@
+<!DOCTYPE UI><UI version="3.2" stdsetdef="1">
+<class>CalculatorCatalogSettings</class>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>CalculatorCatalogSettings</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>336</width>
+ <height>299</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Settings</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout13</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>textLabel1</cstring>
+ </property>
+ <property name="text">
+ <string>Number of fractional digits:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>fracDigits</cstring>
+ </property>
+ </widget>
+ <widget class="KIntSpinBox">
+ <property name="name">
+ <cstring>fracDigits</cstring>
+ </property>
+ <property name="maxValue">
+ <number>10</number>
+ </property>
+ <property name="minValue">
+ <number>0</number>
+ </property>
+ <property name="lineStep">
+ <number>1</number>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Katapult will show this number of fractional digits.</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout6</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QButtonGroup">
+ <property name="name">
+ <cstring>buttonGroup2</cstring>
+ </property>
+ <property name="title">
+ <string></string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QRadioButton">
+ <property name="name">
+ <cstring>normal</cstring>
+ </property>
+ <property name="text">
+ <string>Normal</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>In normal mode, katapult will never show an exponent on a number.</string>
+ </property>
+ </widget>
+ <widget class="QRadioButton">
+ <property name="name">
+ <cstring>scientific</cstring>
+ </property>
+ <property name="text">
+ <string>Scientific</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>In scientific mode, katapult will show an exponent on very large or very small numbers.</string>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ <widget class="QButtonGroup">
+ <property name="name">
+ <cstring>buttonGroup3</cstring>
+ </property>
+ <property name="title">
+ <string></string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QRadioButton">
+ <property name="name">
+ <cstring>radians</cstring>
+ </property>
+ <property name="text">
+ <string>Radians</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Trigonometric functions expect and return angles in radians (2 pi radians is a full circle).</string>
+ </property>
+ </widget>
+ <widget class="QRadioButton">
+ <property name="name">
+ <cstring>degrees</cstring>
+ </property>
+ <property name="text">
+ <string>Degrees</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Trigonometric functions expect and return angles in degrees (360 degrees is a full circle).</string>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="QButtonGroup">
+ <property name="name">
+ <cstring>clipboard</cstring>
+ </property>
+ <property name="title">
+ <string>Copy to clipboard on execute</string>
+ </property>
+ <property name="checkable">
+ <bool>true</bool>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>katapult can copy the expression or the result of the expression to the clipboard if you press the key assigned to "execute action" (by default, this is Enter).</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout8</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>textLabel1_2</cstring>
+ </property>
+ <property name="text">
+ <string>Copied text:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>formatString</cstring>
+ </property>
+ </widget>
+ <widget class="QLineEdit">
+ <property name="name">
+ <cstring>formatString</cstring>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>textLabel1_3</cstring>
+ </property>
+ <property name="text">
+ <string>&lt;i&gt;Hint:&lt;/i&gt; %1 is replaced by the expression, %2 is replaced by the result</string>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>spacer3</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>40</height>
+ </size>
+ </property>
+ </spacer>
+ </vbox>
+</widget>
+<tabstops>
+ <tabstop>fracDigits</tabstop>
+</tabstops>
+<layoutdefaults spacing="6" margin="11"/>
+<includehints>
+ <includehint>knuminput.h</includehint>
+</includehints>
+</UI>
diff --git a/katapult/plugins/catalogs/documentcatalog/Makefile.am b/katapult/plugins/catalogs/documentcatalog/Makefile.am
new file mode 100644
index 0000000..ddcad1a
--- /dev/null
+++ b/katapult/plugins/catalogs/documentcatalog/Makefile.am
@@ -0,0 +1,16 @@
+# set the include path for X, qt and KDE
+INCLUDES = -I$(top_srcdir)/katapult/common $(all_includes)
+
+# header files
+noinst_HEADERS = documentcatalog.h directory.h document.h actionopendocument.h
+
+# use automoc
+METASOURCES = AUTO
+
+# our plugin
+kde_module_LTLIBRARIES = katapult_documentcatalog.la
+katapult_documentcatalog_la_SOURCES = settings.ui documentcatalog.cpp \
+ directory.cpp document.cpp actionopendocument.cpp
+katapult_documentcatalog_la_LDFLAGS = -module $(KDE_RPATH) $(KDE_PLUGIN) $(all_libraries)
+katapult_documentcatalog_la_LIBADD = $(LIB_QT) $(LIB_KDECORE) $(LIB_KDEUI) $(LIB_KIO) $(top_builddir)/katapult/common/libkatapult.la
+kde_services_DATA = katapult_documentcatalog.desktop
diff --git a/katapult/plugins/catalogs/documentcatalog/actionopendocument.cpp b/katapult/plugins/catalogs/documentcatalog/actionopendocument.cpp
new file mode 100644
index 0000000..70f91a7
--- /dev/null
+++ b/katapult/plugins/catalogs/documentcatalog/actionopendocument.cpp
@@ -0,0 +1,58 @@
+/***************************************************************************
+ * Copyright (C) 2005 by Joe Ferris *
+ * jferris@optimistictech.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. *
+ * *
+ * 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. *
+ ***************************************************************************/
+
+#include <kglobal.h>
+#include <kiconloader.h>
+#include <krun.h>
+#include <klocale.h>
+
+#include "actionopendocument.h"
+#include "document.h"
+#include "directory.h"
+
+ActionOpenDocument::ActionOpenDocument()
+ : KatapultAction()
+{
+}
+
+bool ActionOpenDocument::accepts(const KatapultItem* item) const
+{
+ return strcmp(item->className(), "Document") == 0 || strcmp(item->className(), "Directory") == 0;
+}
+
+QPixmap ActionOpenDocument::icon(int size) const
+{
+ return KGlobal::iconLoader()->loadIcon("fileopen", KIcon::NoGroup, size);
+}
+
+QString ActionOpenDocument::text() const
+{
+ return i18n("Open");
+}
+
+void ActionOpenDocument::execute(const KatapultItem* item) const
+{
+ if(strcmp(item->className(), "Document") == 0 || strcmp(item->className(), "Directory") == 0) {
+ const Document *document = (const Document *) item;
+ qDebug("%s", QString("Running: %1").arg(document->path()).latin1());
+ new KRun(document->path());
+ }
+}
+
diff --git a/katapult/plugins/catalogs/documentcatalog/actionopendocument.h b/katapult/plugins/catalogs/documentcatalog/actionopendocument.h
new file mode 100644
index 0000000..c6a8bf7
--- /dev/null
+++ b/katapult/plugins/catalogs/documentcatalog/actionopendocument.h
@@ -0,0 +1,41 @@
+/***************************************************************************
+ * Copyright (C) 2005 by Joe Ferris *
+ * jferris@optimistictech.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. *
+ * *
+ * 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 ACTIONOPENDOCUMENT_H
+#define ACTIONOPENDOCUMENT_H
+
+#include <katapultaction.h>
+
+/**
+@author Joe Ferris
+*/
+class ActionOpenDocument : public KatapultAction
+{
+
+public:
+ ActionOpenDocument();
+
+ virtual bool accepts(const KatapultItem*) const;
+ virtual QPixmap icon(int) const;
+ virtual QString text() const;
+ virtual void execute(const KatapultItem*) const;
+
+};
+
+#endif
diff --git a/katapult/plugins/catalogs/documentcatalog/directory.cpp b/katapult/plugins/catalogs/documentcatalog/directory.cpp
new file mode 100644
index 0000000..3d3bc54
--- /dev/null
+++ b/katapult/plugins/catalogs/documentcatalog/directory.cpp
@@ -0,0 +1,36 @@
+/***************************************************************************
+ * Copyright (C) 2005 by Joe Ferris *
+ * jferris@optimistictech.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. *
+ * *
+ * 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. *
+ ***************************************************************************/
+
+#include <kglobal.h>
+#include <kiconloader.h>
+
+#include "directory.h"
+
+Directory::Directory(QString _path, QString _absPath)
+ : Document(_path, _absPath, false)
+{
+}
+
+QPixmap Directory::icon(int size) const
+{
+ return KGlobal::iconLoader()->loadIcon("folder", KIcon::NoGroup, size);
+}
+
+#include "directory.moc"
diff --git a/katapult/plugins/catalogs/documentcatalog/directory.h b/katapult/plugins/catalogs/documentcatalog/directory.h
new file mode 100644
index 0000000..2f37f20
--- /dev/null
+++ b/katapult/plugins/catalogs/documentcatalog/directory.h
@@ -0,0 +1,38 @@
+/***************************************************************************
+ * Copyright (C) 2005 by Joe Ferris *
+ * jferris@optimistictech.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. *
+ * *
+ * 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 DIRECTORY_H
+#define DIRECTORY_H
+
+#include "document.h"
+
+/**
+@author Joe Ferris
+*/
+class Directory : public Document
+{
+Q_OBJECT
+public:
+ Directory(QString, QString);
+
+ virtual QPixmap icon(int) const;
+
+};
+
+#endif
diff --git a/katapult/plugins/catalogs/documentcatalog/document.cpp b/katapult/plugins/catalogs/documentcatalog/document.cpp
new file mode 100644
index 0000000..96024cc
--- /dev/null
+++ b/katapult/plugins/catalogs/documentcatalog/document.cpp
@@ -0,0 +1,86 @@
+/***************************************************************************
+ * Copyright (C) 2005 by Joe Ferris *
+ * jferris@optimistictech.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. *
+ * *
+ * 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. *
+ ***************************************************************************/
+
+#include <qfileinfo.h>
+#include <kmimetype.h>
+#include <kiconloader.h>
+#include <kio/previewjob.h>
+
+#include "document.h"
+
+Document::Document(QString _path, QString _absPath, bool _showPreview)
+ : KatapultItem()
+{
+ this->_path = _path;
+ this->_absPath = _absPath;
+ this->_gotpix = false;
+ this->_showPreview=_showPreview;
+
+ QFileInfo file(_absPath);
+ _name = file.fileName();
+}
+
+Document::~Document()
+{
+}
+
+QPixmap Document::icon(int size) const
+{
+ KURL u;
+ KIO::PreviewJob *doc;
+ u.setPath(_absPath);
+ if (this->_showPreview)
+ {
+
+ doc=KIO::filePreview(u,size);
+ connect(doc, SIGNAL(gotPreview(const KFileItem*, const QPixmap&)),
+ SLOT(gotPreview(const KFileItem*, const QPixmap&)));
+
+ if(this->_gotpix)return this->_pix;
+ return KMimeType::pixmapForURL(u,0, KIcon::NoGroup, size, KIcon::DefaultState, 0L);
+ }
+ else
+ {
+ return KMimeType::pixmapForURL(u,0, KIcon::NoGroup, size, KIcon::DefaultState, 0L);
+ }
+}
+
+void Document::gotPreview(const KFileItem *item, const QPixmap& pixmap )
+{
+ this->_pix = pixmap; this->_gotpix=true;
+ emit itemChanged();
+}
+
+QString Document::text() const
+{
+ return _path;
+}
+
+QString Document::path() const
+{
+ return _absPath;
+}
+
+QString Document::name() const
+{
+ return _name;
+}
+
+#include "document.moc"
diff --git a/katapult/plugins/catalogs/documentcatalog/document.h b/katapult/plugins/catalogs/documentcatalog/document.h
new file mode 100644
index 0000000..6d09d99
--- /dev/null
+++ b/katapult/plugins/catalogs/documentcatalog/document.h
@@ -0,0 +1,52 @@
+/***************************************************************************
+ * Copyright (C) 2005 by Joe Ferris *
+ * jferris@optimistictech.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. *
+ * *
+ * 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 DOCUMENT_H
+#define DOCUMENT_H
+
+#include <katapultitem.h>
+#include <kfileitem.h>
+
+/**
+@author Joe Ferris
+*/
+class Document : public KatapultItem
+{
+ Q_OBJECT
+public:
+ Document(QString, QString, bool);
+ virtual ~Document();
+
+ virtual QPixmap icon(int) const;
+ virtual QString text() const;
+
+ QString path() const;
+ QString name() const;
+
+public slots:
+ void gotPreview(const KFileItem*,const QPixmap& );
+
+private:
+ QString _path, _absPath, _name;
+ QPixmap _pix;
+ bool _gotpix;
+ bool _showPreview;
+};
+
+#endif
diff --git a/katapult/plugins/catalogs/documentcatalog/documentcatalog.cpp b/katapult/plugins/catalogs/documentcatalog/documentcatalog.cpp
new file mode 100644
index 0000000..883ac23
--- /dev/null
+++ b/katapult/plugins/catalogs/documentcatalog/documentcatalog.cpp
@@ -0,0 +1,229 @@
+/***************************************************************************
+ * Copyright (C) 2005 by Joe Ferris *
+ * jferris@optimistictech.com *
+ * *
+ * This document 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 document 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 document; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
+ ***************************************************************************/
+
+#include <kservicegroup.h>
+#include <ksycocaentry.h>
+#include <ksycocatype.h>
+#include <kapplication.h>
+#include <knuminput.h>
+#include <kcombobox.h>
+
+#include <qcheckbox.h>
+
+#include <actionregistry.h>
+
+#include "settings.h"
+#include "documentcatalog.h"
+#include "document.h"
+#include "directory.h"
+#include "status.h"
+#include "match.h"
+#include "actionopendocument.h"
+
+K_EXPORT_COMPONENT_FACTORY( katapult_documentcatalog,
+ KGenericFactory<DocumentCatalog>( "katapult_documentcatalog" ) )
+
+DocumentCatalog::DocumentCatalog(QObject *, const char *, const QStringList&)
+ : KatapultCatalog()
+{
+ _minQueryLen = 1;
+ currentPath = "";
+ currentDirDoc = 0;
+ queryMatched = 0;
+ filesListed = FALSE;
+ files.setAutoDelete(TRUE);
+ ActionRegistry::self()->registerAction(new ActionOpenDocument());
+}
+
+DocumentCatalog::~DocumentCatalog()
+{
+}
+
+void DocumentCatalog::initialize()
+{
+ dir = QDir::home();
+ refreshFolders();
+ refreshFiles();
+}
+
+void DocumentCatalog::refreshFolders()
+{
+ folders.clear();
+ files.clear();
+ currentDirDoc = 0;
+ filesListed = FALSE;
+ QStringList folderNames = dir.entryList(QDir::Dirs);
+ for(QStringList::Iterator it = folderNames.begin(); it != folderNames.end(); ++it) {
+ QString dirname = *it;
+ if(!dirname.startsWith("."))
+ folders.append(dirname);
+ }
+}
+
+void DocumentCatalog::refreshFiles()
+{
+ const QFileInfoList *fileList = dir.entryInfoList();
+ Directory *item = new Directory(currentPath, dir.absPath());
+ currentDirDoc = item;
+ files.append(item);
+
+ for(QPtrListStdIterator<QFileInfo> it = fileList->begin(); it != fileList->end(); ++it) {
+ const QFileInfo *file = *it;
+ if(!file->fileName().startsWith(".")) {
+ if(file->isDir())
+ files.append(new Directory(currentPath+file->fileName(), file->absFilePath()));
+ else
+ files.append(new Document(currentPath+file->fileName(), file->absFilePath(), _showPreview));
+ }
+ }
+ filesListed = TRUE;
+}
+
+void DocumentCatalog::queryChanged()
+{
+ int newStatus = 0;
+ if(query() == "")
+ {
+ // reset query
+ dir = QDir::home();
+ currentPath = "";
+ queryMatched = 0;
+ refreshFolders();
+ } else {
+ if(query().length() >= minQueryLen())
+ {
+ QString path = query().lower().remove(0, queryMatched);
+
+ int index;
+ while((index = path.find('/')) != -1) {
+ QString folderQuery = path.left(index);
+ QString guess = QString::null;
+
+ for(QStringList::Iterator it = folders.begin(); it != folders.end(); ++it) {
+ QString folderName = *it;
+ if(folderName.lower().startsWith(folderQuery) && (guess.isNull() || folderName.length() < guess.length()))
+ guess = folderName;
+ }
+
+ if(guess == QString::null) {
+ path = QString::null;
+ break;
+ }
+
+ if(!dir.cd(guess)) {
+ path = QString::null;
+ break;
+ }
+ refreshFolders();
+
+ queryMatched += folderQuery.length() + 1;
+ currentPath += guess + "/";
+ path = path.remove(0, index+1);
+ }
+
+ Match newBestMatch;
+
+ if(path.isNull()) {
+ files.clear();
+ } else {
+ if(!filesListed) {
+ refreshFiles();
+ }
+ if(!path.isEmpty()) {
+ if(currentDirDoc != 0) {
+ files.removeRef(currentDirDoc);
+ currentDirDoc = 0;
+ }
+ QPtrListIterator<Document> it(files);
+ Document *document;
+ while((document = it.current()) != 0) {
+ ++it;
+ if(document->name().lower().startsWith(path)) {
+ int rank = 100*query().length()/document->text().length();
+ if(newBestMatch.isNull() || rank > newBestMatch.rank())
+ newBestMatch = Match(document, rank, currentPath.length() + path.length());
+ } else {
+ files.removeRef(document);
+ }
+ }
+ }
+ }
+
+ if(currentDirDoc != 0 && path.isEmpty())
+ newBestMatch = Match(currentDirDoc, 100, currentPath.length());
+
+ newStatus |= S_Active;
+ if(files.count() > 0)
+ {
+ newStatus |= S_HasResults;
+ if(files.count() > 1 || files.at(0)->className() == "Directory")
+ newStatus |= S_Multiple;
+ } else
+ newStatus |= S_NoResults;
+
+ setBestMatch(newBestMatch);
+ } else {
+ setBestMatch(Match());
+ }
+ }
+ setStatus(newStatus);
+}
+
+unsigned int DocumentCatalog::minQueryLen() const
+{
+ return _minQueryLen;
+}
+
+void DocumentCatalog::readSettings(KConfigBase *config)
+{
+ _minQueryLen = config->readUnsignedNumEntry("MinQueryLen", 1);
+ _showPreview = config->readBoolEntry("showPreview", FALSE);
+}
+
+void DocumentCatalog::writeSettings(KConfigBase *config)
+{
+ config->writeEntry("MinQueryLen", _minQueryLen);
+ config->writeEntry("showPreview", _showPreview);
+}
+
+QWidget * DocumentCatalog::configure()
+{
+ DocumentCatalogSettings *settings = new DocumentCatalogSettings();
+
+ settings->minQueryLen->setValue(_minQueryLen);
+ connect(settings->minQueryLen, SIGNAL(valueChanged(int)), this, SLOT(minQueryLenChanged(int)));
+
+ settings->showPreview->setChecked(_showPreview);
+ connect(settings->showPreview, SIGNAL(toggled(bool)), this, SLOT(toggleshowPreview(bool)));
+
+ return settings;
+}
+
+void DocumentCatalog::minQueryLenChanged(int _minQueryLen)
+{
+ this->_minQueryLen = _minQueryLen;
+}
+
+void DocumentCatalog::toggleshowPreview(bool _showPreview)
+{
+ this->_showPreview = _showPreview;
+
+}
+#include "documentcatalog.moc"
diff --git a/katapult/plugins/catalogs/documentcatalog/documentcatalog.h b/katapult/plugins/catalogs/documentcatalog/documentcatalog.h
new file mode 100644
index 0000000..e153729
--- /dev/null
+++ b/katapult/plugins/catalogs/documentcatalog/documentcatalog.h
@@ -0,0 +1,71 @@
+/***************************************************************************
+ * Copyright (C) 2005 by Joe Ferris *
+ * jferris@optimistictech.com *
+ * *
+ * This document 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 document 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 document; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
+ ***************************************************************************/
+#ifndef DOCUMENTCATALOG_H
+#define DOCUMENTCATALOG_H
+
+#include <kgenericfactory.h>
+
+#include <qstring.h>
+#include <qstringlist.h>
+#include <qptrlist.h>
+#include <qdir.h>
+
+#include "katapultcatalog.h"
+
+class QWidget;
+class Document;
+
+/**
+@author Joe Ferris
+*/
+class DocumentCatalog : public KatapultCatalog
+{
+ Q_OBJECT
+public:
+ DocumentCatalog(QObject *, const char *, const QStringList&);
+ virtual ~DocumentCatalog();
+
+ virtual void initialize();
+ virtual void queryChanged();
+ virtual void readSettings(KConfigBase *);
+ virtual void writeSettings(KConfigBase *);
+ virtual unsigned int minQueryLen() const;
+ virtual QWidget * configure();
+
+public slots:
+ void minQueryLenChanged(int);
+ void toggleshowPreview(bool);
+
+private:
+ void refreshFolders();
+ void refreshFiles();
+
+ QPtrList<Document> files;
+ Document *currentDirDoc;
+ QStringList folders;
+ QString currentPath;
+ QDir dir;
+ bool filesListed;
+ int _minQueryLen;
+ int queryMatched;
+ bool _showPreview;
+};
+
+#endif
diff --git a/katapult/plugins/catalogs/documentcatalog/katapult_documentcatalog.desktop b/katapult/plugins/catalogs/documentcatalog/katapult_documentcatalog.desktop
new file mode 100644
index 0000000..451e52e
--- /dev/null
+++ b/katapult/plugins/catalogs/documentcatalog/katapult_documentcatalog.desktop
@@ -0,0 +1,44 @@
+[Desktop Entry]
+Name=Document Catalog
+Name[ar]=مستعرض المستندات ( Document Catalog)
+Name[bg]=Каталог с документи
+Name[br]=Katalog teul
+Name[da]=Katalogisér dokument
+Name[de]=Dokumenten-Katalog
+Name[el]=Κατάλογος εγγράφων
+Name[es]=Catalogador de documentos
+Name[et]=Dokumendikataloog
+Name[fr]=Catalogue des documents
+Name[ga]=Catalóg Cáipéisí
+Name[gl]=Catálogo de Documentos
+Name[it]=Catalogo documenti
+Name[ja]=ドキュメントカタログ
+Name[nb]=Dokumentkatalog
+Name[nl]=Documentcatalogus
+Name[pt]=Catálogo de Documentos
+Name[pt_BR]=Catálogo de Documentos
+Name[sv]=Katalogisera dokument
+Name[tr]=Belge Kataloğu
+Name[uk]=Каталог документів
+Comment=Catalogs your documents for easy launching through Katapult
+Comment[ar]=يستعرض مستنداتك كي تستطيع اقلاعها بسهولة عن طريق Katapult
+Comment[bg]=Каталогизира с Katapult документите с цел лесно стартиране
+Comment[da]=Katalogiserer dine dokumenter for nem start via Katapult
+Comment[de]=Katalogisiert Ihre Dokumente, um sie bequem mit Katapult aufzurufen
+Comment[el]=Δημιουργεί κατάλογο των εγγράφων σας για την εύκολη εκτέλεσή τους μέσω του Katapult
+Comment[es]=Cataloga sus documentos para iniciarlos con facilidad a través de Katapult
+Comment[et]=Kataloogib sinu dokumendid hõlpsaks käivitamiseks Katapultiga
+Comment[fr]=Cataloguer vos documents pour une ouverture facile via Katapult
+Comment[gl]=Cataloga os seus documentos para seren iniciados mediante Katapult
+Comment[it]=Cataloga i tuoi documenti per aprirli facilmente attraverso Katapult
+Comment[ja]=Katapult から簡単に開けるようにドキュメントをカタログ化
+Comment[nb]=Katalogiserer dine dokumenter for lett oppstart via Katapult
+Comment[nl]=Catalogiseert uw documenten voor eenvoudige opstart via Katapult
+Comment[pt]=Cataloga os seus documentos para lançá-los facilmente através do Katapult
+Comment[pt_BR]=Cataloga os seus documentos para lançá-los facilmente através do Katapult
+Comment[sv]=Katalogiserar dina dokument för enkel start via Katapult
+Comment[uk]=Робить каталог документів для простого запуску через Катапульту
+ServiceTypes=Katapult/Catalog
+Type=Service
+X-KDE-Library=katapult_documentcatalog
+X-Katapult-ID=Document Catalog
diff --git a/katapult/plugins/catalogs/documentcatalog/settings.ui b/katapult/plugins/catalogs/documentcatalog/settings.ui
new file mode 100644
index 0000000..9f11cb9
--- /dev/null
+++ b/katapult/plugins/catalogs/documentcatalog/settings.ui
@@ -0,0 +1,82 @@
+<!DOCTYPE UI><UI version="3.2" stdsetdef="1">
+<class>DocumentCatalogSettings</class>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>DocumentCatalogSettings</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>376</width>
+ <height>519</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Settings</string>
+ </property>
+ <vbox>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout1</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>textLabel1</cstring>
+ </property>
+ <property name="text">
+ <string>Number of characters before searching:</string>
+ </property>
+ </widget>
+ <widget class="KIntSpinBox">
+ <property name="name">
+ <cstring>minQueryLen</cstring>
+ </property>
+ <property name="maxValue">
+ <number>10</number>
+ </property>
+ <property name="minValue">
+ <number>1</number>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Katapult will not search for programs until you have typed at least this many characters in the Katapult launcher.</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>showPreview</cstring>
+ </property>
+ <property name="text">
+ <string>Show Preview for Documents?</string>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>spacer1</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>410</height>
+ </size>
+ </property>
+ </spacer>
+</vbox>
+</widget>
+<layoutdefaults spacing="6" margin="11"/>
+<includehints>
+ <includehint>knuminput.h</includehint>
+</includehints>
+</UI>
diff --git a/katapult/plugins/catalogs/execcatalog/Makefile.am b/katapult/plugins/catalogs/execcatalog/Makefile.am
new file mode 100644
index 0000000..ffc4753
--- /dev/null
+++ b/katapult/plugins/catalogs/execcatalog/Makefile.am
@@ -0,0 +1,20 @@
+# Copyright (C) 2007 Martin Meredith
+# Copyright (C) 2006 Jonathan Riddell
+
+# set the include path for X, qt and KDE
+INCLUDES = -I$(top_srcdir)/katapult/common $(all_includes)
+
+# header files
+noinst_HEADERS = actionrun.h execcatalog.h command.h
+
+# use automoc
+METASOURCES = AUTO
+
+KDE_ICON = AUTO
+
+# our plugin
+kde_module_LTLIBRARIES = katapult_execcatalog.la
+katapult_execcatalog_la_SOURCES = settings.ui execcatalog.cpp command.cpp actionrun.cpp
+katapult_execcatalog_la_LDFLAGS = -module $(KDE_RPATH) $(KDE_PLUGIN) $(all_libraries)
+katapult_execcatalog_la_LIBADD = $(LIB_QT) $(LIB_KDECORE) $(LIB_KDEUI) $(LIB_KIO) $(top_builddir)/katapult/common/libkatapult.la
+kde_services_DATA = katapult_execcatalog.desktop
diff --git a/katapult/plugins/catalogs/execcatalog/actionrun.cpp b/katapult/plugins/catalogs/execcatalog/actionrun.cpp
new file mode 100644
index 0000000..a1e5e7b
--- /dev/null
+++ b/katapult/plugins/catalogs/execcatalog/actionrun.cpp
@@ -0,0 +1,75 @@
+/***************************************************************************
+ * Copyright (C) 2007 Martin Meredith *
+ * mez@ubuntu.com *
+ * *
+ * Copyright (C) 2006 Jonathan Riddell *
+ * jriddell@ubuntu.com *
+ * *
+ * Copyright (C) 2005 by Joe Ferris *
+ * jferris@optimistictech.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. *
+ * *
+ * 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. *
+ ***************************************************************************/
+
+#include <kapplication.h>
+#include <kglobal.h>
+#include <kiconloader.h>
+#include <klocale.h>
+#include <krun.h>
+
+#include "execcatalog.h"
+#include "command.h"
+#include "katapultitem.h"
+#include "actionrun.h"
+
+ActionRun::ActionRun()
+ : KatapultAction(), _command(0)
+{
+}
+
+ActionRun::~ActionRun()
+{
+}
+
+QString ActionRun::text() const
+{
+ return i18n("Execute");
+}
+
+QPixmap ActionRun::icon(int size) const
+{
+ return KGlobal::iconLoader()->loadIcon("exec", KIcon::NoGroup, size);
+}
+
+bool ActionRun::accepts(const KatapultItem* item) const
+{
+ bool accept = strcmp(item->className(), "Command") == 0;
+ if (accept) {
+ _command = (const Command*)item;
+ }
+ return accept;
+}
+
+void ActionRun::execute(const KatapultItem* item) const
+{
+ if (strcmp(item->className(), "Command") == 0) {
+ _command = (const Command*)item;
+
+ KRun::runCommand(_command->text().mid(_command->catalog()->triggerWordLength() + 1));
+
+
+ }
+}
diff --git a/katapult/plugins/catalogs/execcatalog/actionrun.h b/katapult/plugins/catalogs/execcatalog/actionrun.h
new file mode 100644
index 0000000..d81f103
--- /dev/null
+++ b/katapult/plugins/catalogs/execcatalog/actionrun.h
@@ -0,0 +1,51 @@
+/***************************************************************************
+ * Copyright (C) 2007 Martin Meredith *
+ * mez@ubuntu.com *
+ * *
+ * Copyright (C) 2006 Jonathan Riddell *
+ * jriddell@ubuntu.com *
+ * *
+ * Copyright (C) 2005 by Joe Ferris *
+ * jferris@optimistictech.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. *
+ * *
+ * 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 ACTIONRUN_H
+#define ACTIONRUN_H
+
+#include "katapultaction.h"
+
+class KatapultItem;
+class Command;
+
+class ActionRun : public KatapultAction
+{
+ public:
+ ActionRun();
+ ~ActionRun();
+
+ virtual void execute(const KatapultItem*) const;
+ virtual bool accepts(const KatapultItem*) const;
+ virtual QString text() const;
+ virtual QPixmap icon(int) const;
+
+ private:
+ //_expr needs to be mutable because accepts() is const.
+ mutable const Command* _command;
+
+};
+
+#endif
diff --git a/katapult/plugins/catalogs/execcatalog/command.cpp b/katapult/plugins/catalogs/execcatalog/command.cpp
new file mode 100644
index 0000000..0057bf8
--- /dev/null
+++ b/katapult/plugins/catalogs/execcatalog/command.cpp
@@ -0,0 +1,66 @@
+/***************************************************************************
+ * Copyright (C) 2007 Martin Meredith *
+ * mez@ubuntu.com *
+ * *
+ * Copyright (C) 2006 Jonathan Riddell *
+ * jriddell@ubuntu.com *
+ * *
+ * Copyright (C) 2005 by Joe Ferris *
+ * jferris@optimistictech.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. *
+ * *
+ * 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. *
+ ***************************************************************************/
+
+#include <kservice.h>
+#include <kglobal.h>
+#include <kiconloader.h>
+#include <kapplication.h>
+
+#include <qclipboard.h>
+
+#include "execcatalog.h"
+#include "command.h"
+
+
+Command::Command(ExecCatalog* catalog, const QString& text): KatapultItem(), _catalog(catalog), _text(text)
+{
+}
+
+Command::~Command() {
+}
+
+QPixmap Command::icon(int size) const
+{
+ return KGlobal::iconLoader()->loadIcon("konsole", KIcon::NoGroup, size);
+}
+
+QString Command::text() const
+{
+ return _text;
+}
+
+void Command::setText(const QString& text)
+{
+ _text = text;
+}
+
+ExecCatalog* Command::catalog() const
+{
+ return _catalog;
+}
+
+
+#include "command.moc"
diff --git a/katapult/plugins/catalogs/execcatalog/command.h b/katapult/plugins/catalogs/execcatalog/command.h
new file mode 100644
index 0000000..7e649bf
--- /dev/null
+++ b/katapult/plugins/catalogs/execcatalog/command.h
@@ -0,0 +1,59 @@
+/***************************************************************************
+ * Copyright (C) 2007 Martin Meredith *
+ * mez@ubuntu.com *
+ * *
+ * Copyright (C) 2006 Jonathan Riddell *
+ * jriddell@ubuntu.com *
+ * *
+ * Copyright (C) 2005 by Joe Ferris *
+ * jferris@optimistictech.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. *
+ * *
+ * 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 COMMAND_H
+#define COMMAND_H
+
+#include <kspell.h>
+
+#include <katapultitem.h>
+
+class ExecCatalog;
+
+/**
+@author Tobi Vollebregt
+*/
+class Command : public KatapultItem
+{
+ Q_OBJECT
+ public:
+ Command(ExecCatalog*, const QString&);
+ ~Command();
+
+ virtual QPixmap icon(int) const;
+ virtual QString text() const;
+
+ void setText(const QString&);
+
+ ExecCatalog* catalog() const;
+
+ private:
+ ExecCatalog* const _catalog;
+ QString _text;
+
+
+};
+
+#endif
diff --git a/katapult/plugins/catalogs/execcatalog/execcatalog.cpp b/katapult/plugins/catalogs/execcatalog/execcatalog.cpp
new file mode 100644
index 0000000..177df77
--- /dev/null
+++ b/katapult/plugins/catalogs/execcatalog/execcatalog.cpp
@@ -0,0 +1,122 @@
+/***************************************************************************
+ * Copyright (C) 2007 Martin Meredith *
+ * mez@ubuntu.com *
+ * *
+ * Copyright (C) 2006 Jonathan Riddell *
+ * jriddell@ubuntu.com *
+ * *
+ * Copyright (C) 2005 by Joe Ferris *
+ * jferris@optimistictech.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. *
+ * *
+ * 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. *
+ ***************************************************************************/
+
+#include <kservicegroup.h>
+#include <ksycocaentry.h>
+#include <ksycocatype.h>
+#include <kapplication.h>
+
+#include <qlineedit.h>
+#include <qlabel.h>
+
+#include "settings.h"
+#include "execcatalog.h"
+#include "actionregistry.h"
+#include "actionrun.h"
+#include "status.h"
+
+K_EXPORT_COMPONENT_FACTORY( katapult_execcatalog,
+ KGenericFactory<ExecCatalog>( "katapult_execcatalog" ) )
+
+ExecCatalog::ExecCatalog(QObject*, const char*, const QStringList&): _result(this, QString::null)
+{
+ ActionRegistry::self()->registerAction(new ActionRun());
+}
+
+ExecCatalog::~ExecCatalog()
+{
+}
+
+void ExecCatalog::queryChanged()
+{
+ int newStatus = 0;
+ QString cmd = query();
+ int origLength = cmd.length();
+
+ if (cmd.isEmpty()) {
+ reset();
+ setBestMatch(Match());
+ } else {
+ if (accepts(cmd)) {
+ _result.setText(cmd);
+
+ setBestMatch(Match(&_result, 100, origLength));
+ //set status.
+ //add S_Multiple to make sure katapult doesn't auto-exec and close the window
+ //add S_Active to make sure katapult doesn't start the hideTimer or clearTimer
+ newStatus = S_HasResults | S_Multiple | S_Active;
+ } else {
+ newStatus = 0;
+ }
+ }
+ setStatus(newStatus);
+}
+
+bool ExecCatalog::accepts(const QString& str) const
+{
+ //accept if we begin with the triggerWord
+ int length = _triggerWord.length();
+ return str.left(length + 1) == _triggerWord + " ";
+}
+
+void ExecCatalog::readSettings(KConfigBase* config)
+{
+ _triggerWord = config->readEntry("TriggerWord", i18n("Should be short, easy and quick to type", "exec"));
+}
+
+void ExecCatalog::writeSettings(KConfigBase* config)
+{
+ config->writeEntry("TriggerWord", _triggerWord);
+}
+
+QWidget * ExecCatalog::configure()
+{
+ ExecCatalogSettings* settings = new ExecCatalogSettings();
+
+ settings->triggerWordLE->setText(_triggerWord);
+ connect(settings->triggerWordLE, SIGNAL(textChanged(const QString&)), this, SLOT(triggerWordChanged(const QString&)));
+
+ settings->introLabel->setText(i18n("Use with \"%1 exec query\"").arg(_triggerWord));
+
+ return settings;
+}
+
+void ExecCatalog::triggerWordChanged(const QString& triggerWord)
+{
+ _triggerWord = QString(triggerWord);
+}
+
+int ExecCatalog::triggerWordLength()
+{
+ return _triggerWord.length();
+}
+
+void ExecCatalog::reset()
+{
+ _result.setText(QString::null);
+}
+
+#include "execcatalog.moc"
diff --git a/katapult/plugins/catalogs/execcatalog/execcatalog.h b/katapult/plugins/catalogs/execcatalog/execcatalog.h
new file mode 100644
index 0000000..df550ee
--- /dev/null
+++ b/katapult/plugins/catalogs/execcatalog/execcatalog.h
@@ -0,0 +1,76 @@
+/***************************************************************************
+ * Copyright (C) 2007 Martin Meredith *
+ * mez@ubuntu.com *
+ * *
+ * Copyright (C) 2006 Jonathan Riddell *
+ * jriddell@ubuntu.com *
+ * *
+ * Copyright (C) 2005 Tobi Vollebregt *
+ * tobivollebregt@gmail.com *
+ * *
+ * Copyright (C) 2005 by Joe Ferris *
+ * jferris@optimistictech.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. *
+ * *
+ * 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 EXECCATALOG_H
+#define EXECCATALOG_H
+
+#include <kgenericfactory.h>
+
+#include <qstring.h>
+
+#include "command.h"
+#include "katapultcatalog.h"
+
+class QWidget;
+
+/**
+@author Jonathan Riddell
+ */
+class ExecCatalog : public KatapultCatalog
+{
+ Q_OBJECT
+
+ public:
+
+ ExecCatalog(QObject*, const char*, const QStringList&);
+ virtual ~ExecCatalog();
+
+ virtual void readSettings(KConfigBase*);
+ virtual void writeSettings(KConfigBase*);
+ virtual QWidget* configure();
+ int triggerWordLength();
+
+ protected:
+
+ virtual void queryChanged();
+
+ private:
+ bool accepts(const QString&) const;
+
+ QString _triggerWord;
+
+ Command _result; // The one result (there's always one).
+
+ void reset();
+
+ protected slots:
+ void triggerWordChanged(const QString& triggerWord);
+
+};
+
+#endif
diff --git a/katapult/plugins/catalogs/execcatalog/katapult_execcatalog.desktop b/katapult/plugins/catalogs/execcatalog/katapult_execcatalog.desktop
new file mode 100644
index 0000000..d1fbe93
--- /dev/null
+++ b/katapult/plugins/catalogs/execcatalog/katapult_execcatalog.desktop
@@ -0,0 +1,8 @@
+# Copyright (C) 2007 Martin Meredith
+[Desktop Entry]
+Name=Execution Catalog
+Comment=Execute commands
+ServiceTypes=Katapult/Catalog
+Type=Service
+X-KDE-Library=katapult_execcatalog
+X-Katapult-ID=Execution Catalog
diff --git a/katapult/plugins/catalogs/execcatalog/settings.ui b/katapult/plugins/catalogs/execcatalog/settings.ui
new file mode 100644
index 0000000..6186013
--- /dev/null
+++ b/katapult/plugins/catalogs/execcatalog/settings.ui
@@ -0,0 +1,65 @@
+<!DOCTYPE UI><UI version="3.2" stdsetdef="1">
+<class>ExecCatalogSettings</class>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>ExecCatalogSettings</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>356</width>
+ <height>265</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Settings</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLineEdit" row="1" column="1">
+ <property name="name">
+ <cstring>triggerWordLE</cstring>
+ </property>
+ </widget>
+ <widget class="QLabel" row="1" column="0">
+ <property name="name">
+ <cstring>triggerWordLabel</cstring>
+ </property>
+ <property name="text">
+ <string>Trigger Word:</string>
+ </property>
+ </widget>
+ <widget class="QLabel" row="0" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>introLabel</cstring>
+ </property>
+ <property name="text">
+ <string>Use with: "run command"</string>
+ </property>
+ </widget>
+ <spacer row="2" column="1">
+ <property name="name">
+ <cstring>spacer2</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>150</height>
+ </size>
+ </property>
+ </spacer>
+ </grid>
+</widget>
+<tabstops>
+</tabstops>
+<layoutdefaults spacing="6" margin="11"/>
+</UI>
diff --git a/katapult/plugins/catalogs/googlecatalog/Makefile.am b/katapult/plugins/catalogs/googlecatalog/Makefile.am
new file mode 100644
index 0000000..a632da7
--- /dev/null
+++ b/katapult/plugins/catalogs/googlecatalog/Makefile.am
@@ -0,0 +1,20 @@
+# Copyright (C) 2007 Martin Meredith
+# Copyright (C) 2006 Jonathan Riddell
+
+# set the include path for X, qt and KDE
+INCLUDES = -I$(top_srcdir)/katapult/common $(all_includes)
+
+# header files
+noinst_HEADERS = actionsearch.h googlecatalog.h query.h
+
+# use automoc
+METASOURCES = AUTO
+
+KDE_ICON = AUTO
+
+# our plugin
+kde_module_LTLIBRARIES = katapult_googlecatalog.la
+katapult_googlecatalog_la_SOURCES = settings.ui googlecatalog.cpp query.cpp actionsearch.cpp
+katapult_googlecatalog_la_LDFLAGS = -module $(KDE_RPATH) $(KDE_PLUGIN) $(all_libraries)
+katapult_googlecatalog_la_LIBADD = $(LIB_QT) $(LIB_KDECORE) $(LIB_KDEUI) $(LIB_KIO) $(top_builddir)/katapult/common/libkatapult.la
+kde_services_DATA = katapult_googlecatalog.desktop
diff --git a/katapult/plugins/catalogs/googlecatalog/actionsearch.cpp b/katapult/plugins/catalogs/googlecatalog/actionsearch.cpp
new file mode 100644
index 0000000..b9af97e
--- /dev/null
+++ b/katapult/plugins/catalogs/googlecatalog/actionsearch.cpp
@@ -0,0 +1,83 @@
+/***************************************************************************
+ * Copyright (C) 2007 Martin Meredith *
+ * mez@ubuntu.com *
+ * *
+ * Copyright (C) 2006 Jonathan Riddell *
+ * jriddell@ubuntu.com *
+ * *
+ * Copyright (C) 2005 by Joe Ferris *
+ * jferris@optimistictech.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. *
+ * *
+ * 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. *
+ ***************************************************************************/
+
+#include <kapplication.h>
+#include <kglobal.h>
+#include <kiconloader.h>
+#include <klocale.h>
+#include <kurl.h>
+#include <krun.h>
+
+#include "googlecatalog.h"
+#include "query.h"
+#include "katapultitem.h"
+#include "actionsearch.h"
+
+ActionSearch::ActionSearch()
+ : KatapultAction(), _searchquery(0)
+{
+}
+
+ActionSearch::~ActionSearch()
+{
+}
+
+QString ActionSearch::text() const
+{
+ return i18n("Search Google");
+}
+
+QPixmap ActionSearch::icon(int size) const
+{
+ return KGlobal::iconLoader()->loadIcon("viewmag", KIcon::NoGroup, size);
+}
+
+bool ActionSearch::accepts(const KatapultItem* item) const
+{
+ bool accept = strcmp(item->className(), "SearchQuery") == 0;
+ if (accept) {
+ _searchquery = (const SearchQuery*)item;
+ }
+ return accept;
+}
+
+void ActionSearch::execute(const KatapultItem* item) const
+{
+ if (strcmp(item->className(), "SearchQuery") == 0) {
+ _searchquery = (const SearchQuery*)item;
+
+ KURL _gotourl;
+ _gotourl.setProtocol("http");
+ _gotourl.setHost("www.google.com");
+ _gotourl.setPath("/search");
+ _gotourl.addQueryItem("q", _searchquery->text().mid(_searchquery->catalog()->triggerWordLength() + 1));
+ _gotourl.addQueryItem("ie", "UTF-8");
+ _gotourl.addQueryItem("oe", "UTF-8");
+ new KRun(_gotourl);
+
+
+ }
+}
diff --git a/katapult/plugins/catalogs/googlecatalog/actionsearch.h b/katapult/plugins/catalogs/googlecatalog/actionsearch.h
new file mode 100644
index 0000000..c35b394
--- /dev/null
+++ b/katapult/plugins/catalogs/googlecatalog/actionsearch.h
@@ -0,0 +1,51 @@
+/***************************************************************************
+ * Copyright (C) 2007 Martin Meredith *
+ * mez@ubuntu.com *
+ * *
+ * Copyright (C) 2006 Jonathan Riddell *
+ * jriddell@ubuntu.com *
+ * *
+ * Copyright (C) 2005 by Joe Ferris *
+ * jferris@optimistictech.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. *
+ * *
+ * 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 ACTIONSEARCH_H
+#define ACTIONSEARCH_H
+
+#include "katapultaction.h"
+
+class KatapultItem;
+class SearchQuery;
+
+class ActionSearch : public KatapultAction
+{
+ public:
+ ActionSearch();
+ ~ActionSearch();
+
+ virtual void execute(const KatapultItem*) const;
+ virtual bool accepts(const KatapultItem*) const;
+ virtual QString text() const;
+ virtual QPixmap icon(int) const;
+
+ private:
+ //_expr needs to be mutable because accepts() is const.
+ mutable const SearchQuery* _searchquery;
+
+};
+
+#endif
diff --git a/katapult/plugins/catalogs/googlecatalog/googlecatalog.cpp b/katapult/plugins/catalogs/googlecatalog/googlecatalog.cpp
new file mode 100644
index 0000000..a180a30
--- /dev/null
+++ b/katapult/plugins/catalogs/googlecatalog/googlecatalog.cpp
@@ -0,0 +1,122 @@
+/***************************************************************************
+ * Copyright (C) 2007 Martin Meredith *
+ * mez@ubuntu.com *
+ * *
+ * Copyright (C) 2006 Jonathan Riddell *
+ * jriddell@ubuntu.com *
+ * *
+ * Copyright (C) 2005 by Joe Ferris *
+ * jferris@optimistictech.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. *
+ * *
+ * 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. *
+ ***************************************************************************/
+
+#include <kservicegroup.h>
+#include <ksycocaentry.h>
+#include <ksycocatype.h>
+#include <kapplication.h>
+
+#include <qlineedit.h>
+#include <qlabel.h>
+
+#include "settings.h"
+#include "googlecatalog.h"
+#include "actionregistry.h"
+#include "actionsearch.h"
+#include "status.h"
+
+K_EXPORT_COMPONENT_FACTORY( katapult_googlecatalog,
+ KGenericFactory<GoogleCatalog>( "katapult_googlecatalog" ) )
+
+GoogleCatalog::GoogleCatalog(QObject*, const char*, const QStringList&): _result(this, QString::null)
+{
+ ActionRegistry::self()->registerAction(new ActionSearch());
+}
+
+GoogleCatalog::~GoogleCatalog()
+{
+}
+
+void GoogleCatalog::queryChanged()
+{
+ int newStatus = 0;
+ QString cmd = query();
+ int origLength = cmd.length();
+
+ if (cmd.isEmpty()) {
+ reset();
+ setBestMatch(Match());
+ } else {
+ if (accepts(cmd)) {
+ _result.setText(cmd);
+
+ setBestMatch(Match(&_result, 100, origLength));
+ //set status.
+ //add S_Multiple to make sure katapult doesn't auto-exec and close the window
+ //add S_Active to make sure katapult doesn't start the hideTimer or clearTimer
+ newStatus = S_HasResults | S_Multiple | S_Active;
+ } else {
+ newStatus = 0;
+ }
+ }
+ setStatus(newStatus);
+}
+
+bool GoogleCatalog::accepts(const QString& str) const
+{
+ //accept if we begin with the triggerWord
+ int length = _triggerWord.length();
+ return str.left(length + 1) == _triggerWord + " ";
+}
+
+void GoogleCatalog::readSettings(KConfigBase* config)
+{
+ _triggerWord = config->readEntry("TriggerWord", i18n("Should be short, easy and quick to type", "google"));
+}
+
+void GoogleCatalog::writeSettings(KConfigBase* config)
+{
+ config->writeEntry("TriggerWord", _triggerWord);
+}
+
+QWidget * GoogleCatalog::configure()
+{
+ GoogleCatalogSettings* settings = new GoogleCatalogSettings();
+
+ settings->triggerWordLE->setText(_triggerWord);
+ connect(settings->triggerWordLE, SIGNAL(textChanged(const QString&)), this, SLOT(triggerWordChanged(const QString&)));
+
+ settings->introLabel->setText(i18n("Use with \"%1 search query\"").arg(_triggerWord));
+
+ return settings;
+}
+
+void GoogleCatalog::triggerWordChanged(const QString& triggerWord)
+{
+ _triggerWord = QString(triggerWord);
+}
+
+int GoogleCatalog::triggerWordLength()
+{
+ return _triggerWord.length();
+}
+
+void GoogleCatalog::reset()
+{
+ _result.setText(QString::null);
+}
+
+#include "googlecatalog.moc"
diff --git a/katapult/plugins/catalogs/googlecatalog/googlecatalog.h b/katapult/plugins/catalogs/googlecatalog/googlecatalog.h
new file mode 100644
index 0000000..3dfd342
--- /dev/null
+++ b/katapult/plugins/catalogs/googlecatalog/googlecatalog.h
@@ -0,0 +1,76 @@
+/***************************************************************************
+ * Copyright (C) 2007 Martin Meredith *
+ * mez@ubuntu.com *
+ * *
+ * Copyright (C) 2006 Jonathan Riddell *
+ * jriddell@ubuntu.com *
+ * *
+ * Copyright (C) 2005 Tobi Vollebregt *
+ * tobivollebregt@gmail.com *
+ * *
+ * Copyright (C) 2005 by Joe Ferris *
+ * jferris@optimistictech.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. *
+ * *
+ * 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 GOOGLECATALOG_H
+#define GOOGLECATALOG_H
+
+#include <kgenericfactory.h>
+
+#include <qstring.h>
+
+#include "query.h"
+#include "katapultcatalog.h"
+
+class QWidget;
+
+/**
+@author Jonathan Riddell
+ */
+class GoogleCatalog : public KatapultCatalog
+{
+ Q_OBJECT
+
+ public:
+
+ GoogleCatalog(QObject*, const char*, const QStringList&);
+ virtual ~GoogleCatalog();
+
+ virtual void readSettings(KConfigBase*);
+ virtual void writeSettings(KConfigBase*);
+ virtual QWidget* configure();
+ int triggerWordLength();
+
+ protected:
+
+ virtual void queryChanged();
+
+ private:
+ bool accepts(const QString&) const;
+
+ QString _triggerWord;
+
+ SearchQuery _result; // The one result (there's always one).
+
+ void reset();
+
+ protected slots:
+ void triggerWordChanged(const QString& triggerWord);
+
+};
+
+#endif
diff --git a/katapult/plugins/catalogs/googlecatalog/katapult_googlecatalog.desktop b/katapult/plugins/catalogs/googlecatalog/katapult_googlecatalog.desktop
new file mode 100644
index 0000000..d7cc211
--- /dev/null
+++ b/katapult/plugins/catalogs/googlecatalog/katapult_googlecatalog.desktop
@@ -0,0 +1,8 @@
+# Copyright (C) 2007 Martin Meredith
+[Desktop Entry]
+Name=Google Catalog
+Comment=Search Google
+ServiceTypes=Katapult/Catalog
+Type=Service
+X-KDE-Library=katapult_googlecatalog
+X-Katapult-ID=Google Catalog
diff --git a/katapult/plugins/catalogs/googlecatalog/query.cpp b/katapult/plugins/catalogs/googlecatalog/query.cpp
new file mode 100644
index 0000000..c97f00e
--- /dev/null
+++ b/katapult/plugins/catalogs/googlecatalog/query.cpp
@@ -0,0 +1,66 @@
+/***************************************************************************
+ * Copyright (C) 2007 Martin Meredith *
+ * mez@ubuntu.com *
+ * *
+ * Copyright (C) 2006 Jonathan Riddell *
+ * jriddell@ubuntu.com *
+ * *
+ * Copyright (C) 2005 by Joe Ferris *
+ * jferris@optimistictech.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. *
+ * *
+ * 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. *
+ ***************************************************************************/
+
+#include <kservice.h>
+#include <kglobal.h>
+#include <kiconloader.h>
+#include <kapplication.h>
+
+#include <qclipboard.h>
+
+#include "googlecatalog.h"
+#include "query.h"
+
+
+SearchQuery::SearchQuery(GoogleCatalog* catalog, const QString& text): KatapultItem(), _catalog(catalog), _text(text)
+{
+}
+
+SearchQuery::~SearchQuery() {
+}
+
+QPixmap SearchQuery::icon(int size) const
+{
+ return KGlobal::iconLoader()->loadIcon("help", KIcon::NoGroup, size);
+}
+
+QString SearchQuery::text() const
+{
+ return _text;
+}
+
+void SearchQuery::setText(const QString& text)
+{
+ _text = text;
+}
+
+GoogleCatalog* SearchQuery::catalog() const
+{
+ return _catalog;
+}
+
+
+#include "query.moc"
diff --git a/katapult/plugins/catalogs/googlecatalog/query.h b/katapult/plugins/catalogs/googlecatalog/query.h
new file mode 100644
index 0000000..6759f13
--- /dev/null
+++ b/katapult/plugins/catalogs/googlecatalog/query.h
@@ -0,0 +1,59 @@
+/***************************************************************************
+ * Copyright (C) 2007 Martin Meredith *
+ * mez@ubuntu.com *
+ * *
+ * Copyright (C) 2006 Jonathan Riddell *
+ * jriddell@ubuntu.com *
+ * *
+ * Copyright (C) 2005 by Joe Ferris *
+ * jferris@optimistictech.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. *
+ * *
+ * 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 QUERY_H
+#define QUERY_H
+
+#include <kspell.h>
+
+#include <katapultitem.h>
+
+class GoogleCatalog;
+
+/**
+@author Tobi Vollebregt
+*/
+class SearchQuery : public KatapultItem
+{
+ Q_OBJECT
+ public:
+ SearchQuery(GoogleCatalog*, const QString&);
+ ~SearchQuery();
+
+ virtual QPixmap icon(int) const;
+ virtual QString text() const;
+
+ void setText(const QString&);
+
+ GoogleCatalog* catalog() const;
+
+ private:
+ GoogleCatalog* const _catalog;
+ QString _text;
+
+
+};
+
+#endif
diff --git a/katapult/plugins/catalogs/googlecatalog/settings.ui b/katapult/plugins/catalogs/googlecatalog/settings.ui
new file mode 100644
index 0000000..5549c3b
--- /dev/null
+++ b/katapult/plugins/catalogs/googlecatalog/settings.ui
@@ -0,0 +1,65 @@
+<!DOCTYPE UI><UI version="3.2" stdsetdef="1">
+<class>GoogleCatalogSettings</class>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>GoogleCatalogSettings</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>356</width>
+ <height>265</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Settings</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLineEdit" row="1" column="1">
+ <property name="name">
+ <cstring>triggerWordLE</cstring>
+ </property>
+ </widget>
+ <widget class="QLabel" row="1" column="0">
+ <property name="name">
+ <cstring>triggerWordLabel</cstring>
+ </property>
+ <property name="text">
+ <string>Trigger Word:</string>
+ </property>
+ </widget>
+ <widget class="QLabel" row="0" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>introLabel</cstring>
+ </property>
+ <property name="text">
+ <string>Use with: "google Search Query"</string>
+ </property>
+ </widget>
+ <spacer row="2" column="1">
+ <property name="name">
+ <cstring>spacer2</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>150</height>
+ </size>
+ </property>
+ </spacer>
+ </grid>
+</widget>
+<tabstops>
+</tabstops>
+<layoutdefaults spacing="6" margin="11"/>
+</UI>
diff --git a/katapult/plugins/catalogs/programcatalog/Makefile.am b/katapult/plugins/catalogs/programcatalog/Makefile.am
new file mode 100644
index 0000000..1e0fdf6
--- /dev/null
+++ b/katapult/plugins/catalogs/programcatalog/Makefile.am
@@ -0,0 +1,15 @@
+# set the include path for X, qt and KDE
+INCLUDES = -I$(top_srcdir)/katapult/common $(all_includes)
+
+# header files
+noinst_HEADERS = programcatalog.h program.h actionrunprogram.h
+
+# our plugin
+kde_module_LTLIBRARIES = katapult_programcatalog.la
+katapult_programcatalog_la_SOURCES = settings.ui programcatalog.cpp program.cpp actionrunprogram.cpp
+katapult_programcatalog_la_LDFLAGS = -module $(KDE_RPATH) $(KDE_PLUGIN) $(all_libraries)
+katapult_programcatalog_la_LIBADD = $(LIB_QT) $(LIB_KDECORE) $(LIB_KDEUI) $(LIB_KIO) $(top_builddir)/katapult/common/libkatapult.la
+kde_services_DATA = katapult_programcatalog.desktop
+
+# use automoc
+METASOURCES = AUTO
diff --git a/katapult/plugins/catalogs/programcatalog/actionrunprogram.cpp b/katapult/plugins/catalogs/programcatalog/actionrunprogram.cpp
new file mode 100644
index 0000000..97ca084
--- /dev/null
+++ b/katapult/plugins/catalogs/programcatalog/actionrunprogram.cpp
@@ -0,0 +1,65 @@
+/***************************************************************************
+ * Copyright (C) 2005 by Joe Ferris *
+ * jferris@optimistictech.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. *
+ * *
+ * 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. *
+ ***************************************************************************/
+
+#include <kglobal.h>
+#include <kiconloader.h>
+#include <krun.h>
+#include <kurl.h>
+#include <klocale.h>
+
+#include "program.h"
+#include "katapultitem.h"
+#include "actionrunprogram.h"
+
+ActionRunProgram::ActionRunProgram()
+ : KatapultAction()
+{
+}
+
+
+ActionRunProgram::~ActionRunProgram()
+{
+}
+
+QString ActionRunProgram::text() const
+{
+ return i18n("Run Program");
+}
+
+QPixmap ActionRunProgram::icon(int size) const
+{
+ return KGlobal::iconLoader()->loadIcon("exec", KIcon::NoGroup, size);
+}
+
+void ActionRunProgram::execute(const KatapultItem *item) const
+{
+ if(strcmp(item->className(), "Program") == 0) {
+ const Program *program = (const Program *) item;
+ KService *service = program->service();
+ if(service != 0)
+ KRun::run(*service, KURL::List());
+ //TODO: report error running program
+ }
+}
+
+bool ActionRunProgram::accepts(const KatapultItem *item) const
+{
+ return strcmp(item->className(), "Program") == 0;
+}
diff --git a/katapult/plugins/catalogs/programcatalog/actionrunprogram.h b/katapult/plugins/catalogs/programcatalog/actionrunprogram.h
new file mode 100644
index 0000000..1ee2e30
--- /dev/null
+++ b/katapult/plugins/catalogs/programcatalog/actionrunprogram.h
@@ -0,0 +1,44 @@
+/***************************************************************************
+ * Copyright (C) 2005 by Joe Ferris *
+ * jferris@optimistictech.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. *
+ * *
+ * 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 ACTIONRUNPROGRAM_H
+#define ACTIONRUNPROGRAM_H
+
+#include "katapultaction.h"
+
+class KatapultItem;
+
+/**
+@author Joe Ferris
+*/
+class ActionRunProgram : public KatapultAction
+{
+
+public:
+ ActionRunProgram();
+ ~ActionRunProgram();
+
+ virtual void execute(const KatapultItem *) const;
+ virtual bool accepts(const KatapultItem *) const;
+ virtual QString text() const;
+ virtual QPixmap icon(int) const;
+
+};
+
+#endif
diff --git a/katapult/plugins/catalogs/programcatalog/katapult_programcatalog.desktop b/katapult/plugins/catalogs/programcatalog/katapult_programcatalog.desktop
new file mode 100644
index 0000000..cf45514
--- /dev/null
+++ b/katapult/plugins/catalogs/programcatalog/katapult_programcatalog.desktop
@@ -0,0 +1,43 @@
+[Desktop Entry]
+Name=Program Catalog
+Name[ar]=مستعرض البرامج ( Program Catalog )
+Name[bg]=Каталог с програми
+Name[br]=Katalog program
+Name[da]=Katalogisér program
+Name[de]=Programm-Katalog
+Name[el]=Κατάλογος προγραμμάτων
+Name[es]=Catalogador de programas
+Name[et]=Programmikataloog
+Name[fr]=Catalogue des programmes
+Name[gl]=Catálogo de Programas
+Name[it]=Catalogo programmi
+Name[ja]=プログラムカタログ
+Name[nb]=Programkatalog
+Name[nl]=Programmacatalogus
+Name[pt]=Catálogo do Programa
+Name[pt_BR]=Catálogo de Programa
+Name[sv]=Katalogisera program
+Name[tr]=Program Kataloğu
+Name[uk]=Каталог програм
+Comment=Catalogs your KDE programs for easy launching through Katapult
+Comment[ar]=يستعرض برامجك كي دي أي ( KDE ) كي تستطيع اقلاعها بسهولة مستخدما Katapult
+Comment[bg]=Каталогизира с Katapult програмите в KDE за лесно стартиране
+Comment[da]=Katalogiserer dine KDE-programmer for nem start via Katapult
+Comment[de]=Katalogisiert Ihre KDE-Programme, um sie bequem mit Katapult zu starten
+Comment[el]=Δημιουργεί κατάλογο των προγραμμάτων σας του KDE για την εύκολη εκτέλεσή τους μέσω του Katapult
+Comment[es]=Cataloga sus programas de KDE para iniciarlos con facilidad a través de Katapult
+Comment[et]=Kataloogib sinu KDE programmid hõlpsaks käivitamiseks Katapultiga
+Comment[fr]=Cataloguer vos programmes KDE pour un lancement facile via Katapult
+Comment[gl]=Cataloga os seus programas de KDE para seren iniciados mediante Katapult
+Comment[it]=Cataloga in tuoi programmi KDE per avviarli facilmente attraverso Katapult
+Comment[ja]=Katapult から簡単に起動できるように KDE のプログラムをカタログ化
+Comment[nb]=Katalogiserer KDE-programmene for lettvint oppstart med Katapult
+Comment[nl]=Catalogiseert uw KDE-programma's voor eenvoudige opstart via Katapult
+Comment[pt]=Cataloga os seus programas do KDE para lançá-los facilmente através do Katapult
+Comment[pt_BR]=Cataloga os seus programas do KDE para lançá-los facilmente através do Katapult
+Comment[sv]=Katalogiserar dina KDE-program för enkel start via Katapult
+Comment[uk]=Робить каталог з програм KDE для легкого запуску через Катапульту
+ServiceTypes=Katapult/Catalog
+Type=Service
+X-KDE-Library=katapult_programcatalog
+X-Katapult-ID=Program Catalog
diff --git a/katapult/plugins/catalogs/programcatalog/program.cpp b/katapult/plugins/catalogs/programcatalog/program.cpp
new file mode 100644
index 0000000..dad529d
--- /dev/null
+++ b/katapult/plugins/catalogs/programcatalog/program.cpp
@@ -0,0 +1,55 @@
+/***************************************************************************
+ * Copyright (C) 2005 by Joe Ferris *
+ * jferris@optimistictech.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. *
+ * *
+ * 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. *
+ ***************************************************************************/
+
+#include <kservice.h>
+#include <kglobal.h>
+#include <kiconloader.h>
+
+#include "program.h"
+
+Program::Program(KService::Ptr s, bool useExecName)
+ : KatapultItem()
+{
+ if(useExecName)
+ _name = s->exec();
+ else
+ _name = s->name();
+ _icon = s->icon();
+ if(_icon == "")
+ _icon = s->name().lower();
+ _service = s;
+}
+
+QPixmap Program::icon(int size) const
+{
+ return KGlobal::iconLoader()->loadIcon(_icon, KIcon::NoGroup, size);
+}
+
+QString Program::text() const
+{
+ return _name;
+}
+
+KService * Program::service() const
+{
+ return _service;
+}
+
+#include "program.moc"
diff --git a/katapult/plugins/catalogs/programcatalog/program.h b/katapult/plugins/catalogs/programcatalog/program.h
new file mode 100644
index 0000000..f316042
--- /dev/null
+++ b/katapult/plugins/catalogs/programcatalog/program.h
@@ -0,0 +1,48 @@
+/***************************************************************************
+ * Copyright (C) 2005 by Joe Ferris *
+ * jferris@optimistictech.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. *
+ * *
+ * 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 PROGRAM_H
+#define PROGRAM_H
+
+#include <kservice.h>
+
+#include <katapultitem.h>
+
+/**
+@author Joe Ferris
+*/
+class Program : public KatapultItem
+{
+ Q_OBJECT
+public:
+
+ Program(KService::Ptr, bool);
+
+ virtual QPixmap icon(int) const;
+ virtual QString text() const;
+
+ KService * service() const;
+
+protected:
+ KService::Ptr _service;
+ QString _icon, _name;
+
+};
+
+#endif
diff --git a/katapult/plugins/catalogs/programcatalog/programcatalog.cpp b/katapult/plugins/catalogs/programcatalog/programcatalog.cpp
new file mode 100644
index 0000000..1c83394
--- /dev/null
+++ b/katapult/plugins/catalogs/programcatalog/programcatalog.cpp
@@ -0,0 +1,153 @@
+/***************************************************************************
+ * Copyright (C) 2005 by Joe Ferris *
+ * jferris@optimistictech.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. *
+ * *
+ * 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. *
+ ***************************************************************************/
+
+#include <kservicegroup.h>
+#include <ksycocaentry.h>
+#include <ksycocatype.h>
+#include <kapplication.h>
+#include <knuminput.h>
+#include <kcombobox.h>
+
+#include <qcheckbox.h>
+
+#include "settings.h"
+#include "programcatalog.h"
+#include "program.h"
+#include "actionregistry.h"
+#include "actionrunprogram.h"
+
+K_EXPORT_COMPONENT_FACTORY( katapult_programcatalog,
+ KGenericFactory<ProgramCatalog>( "katapult_programcatalog" ) )
+
+ProgramCatalog::ProgramCatalog(QObject *, const char *, const QStringList&)
+ : CachedCatalog()
+{
+ _minQueryLen = 1;
+ _ignoreIconless = TRUE;
+ _ignoreTerminal = TRUE;
+ _useExecName = FALSE;
+ ActionRegistry::self()->registerAction(new ActionRunProgram());
+}
+
+ProgramCatalog::~ProgramCatalog()
+{
+}
+
+void ProgramCatalog::initialize()
+{
+ cacheProgramList(QString::null);
+}
+
+void ProgramCatalog::cacheProgramList(QString relPath)
+{
+ KServiceGroup::Ptr group = KServiceGroup::group(relPath);
+ if(!group || !group->isValid())
+ return;
+
+ KServiceGroup::List list = group->entries();
+ if(list.isEmpty())
+ return;
+
+ KServiceGroup::List::ConstIterator it = list.begin();
+ for(; it != list.end(); ++it)
+ {
+ KSycocaEntry *e = *it;
+
+ if(e != 0) {
+ if(e->isType(KST_KServiceGroup))
+ {
+ KServiceGroup::Ptr g(static_cast<KServiceGroup *>(e));
+ if(!g->noDisplay())
+ cacheProgramList(g->relPath());
+ } else if(e->isType(KST_KService))
+ {
+ KService::Ptr s(static_cast<KService *>(e));
+ if(s->type() == "Application" &&
+ (!_ignoreIconless || !s->icon().isEmpty()) &&
+ (!_ignoreTerminal || !s->terminal()) && !s->noDisplay()
+ ) {
+ addItem(new Program(s, _useExecName));
+ }
+ }
+ }
+ }
+}
+
+unsigned int ProgramCatalog::minQueryLen() const
+{
+ return _minQueryLen;
+}
+
+void ProgramCatalog::readSettings(KConfigBase *config)
+{
+ _minQueryLen = config->readUnsignedNumEntry("MinQueryLen", 1);
+ _ignoreIconless = config->readBoolEntry("IgnoreIconless", TRUE);
+ _useExecName = config->readBoolEntry("UseExecName", FALSE);
+ _ignoreTerminal = config->readBoolEntry("IgnoreTerminal", TRUE);
+}
+
+void ProgramCatalog::writeSettings(KConfigBase *config)
+{
+ config->writeEntry("MinQueryLen", _minQueryLen);
+ config->writeEntry("IgnoreIconless", _ignoreIconless);
+ config->writeEntry("UseExecName", _useExecName);
+ config->writeEntry("IgnoreTerminal", _ignoreTerminal);
+}
+
+QWidget * ProgramCatalog::configure()
+{
+ ProgramCatalogSettings *settings = new ProgramCatalogSettings();
+
+ settings->minQueryLen->setValue(_minQueryLen);
+ connect(settings->minQueryLen, SIGNAL(valueChanged(int)), this, SLOT(minQueryLenChanged(int)));
+
+ settings->ignoreIconless->setChecked(_ignoreIconless);
+ connect(settings->ignoreIconless, SIGNAL(toggled(bool)), this, SLOT(toggleIgnoreIconless(bool)));
+
+ settings->useExecName->setChecked(_useExecName);
+ connect(settings->useExecName, SIGNAL(toggled(bool)), this, SLOT(toggleUseExecName(bool)));
+
+ settings->ignoreTerminal->setChecked(_ignoreTerminal);
+ connect(settings->ignoreTerminal, SIGNAL(toggled(bool)), this, SLOT(toggleIgnoreTerminal(bool)));
+
+ return settings;
+}
+
+void ProgramCatalog::minQueryLenChanged(int _minQueryLen)
+{
+ this->_minQueryLen = _minQueryLen;
+}
+
+void ProgramCatalog::toggleIgnoreIconless(bool _ignoreIconless)
+{
+ this->_ignoreIconless = _ignoreIconless;
+}
+
+void ProgramCatalog::toggleUseExecName(bool _useExecName)
+{
+ this->_useExecName = _useExecName;
+}
+
+void ProgramCatalog::toggleIgnoreTerminal(bool _ignoreTerminal)
+{
+ this->_ignoreTerminal = _ignoreTerminal;
+}
+
+#include "programcatalog.moc"
diff --git a/katapult/plugins/catalogs/programcatalog/programcatalog.h b/katapult/plugins/catalogs/programcatalog/programcatalog.h
new file mode 100644
index 0000000..ed00536
--- /dev/null
+++ b/katapult/plugins/catalogs/programcatalog/programcatalog.h
@@ -0,0 +1,62 @@
+/***************************************************************************
+ * Copyright (C) 2005 by Joe Ferris *
+ * jferris@optimistictech.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. *
+ * *
+ * 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 PROGRAMCATALOG_H
+#define PROGRAMCATALOG_H
+
+#include <kgenericfactory.h>
+
+#include <qptrlist.h>
+#include <qstring.h>
+
+#include "cachedcatalog.h"
+
+class QWidget;
+
+/**
+@author Joe Ferris
+*/
+class ProgramCatalog : public CachedCatalog
+{
+ Q_OBJECT
+public:
+ ProgramCatalog(QObject *, const char *, const QStringList&);
+ virtual ~ProgramCatalog();
+
+ virtual void initialize();
+ virtual void readSettings(KConfigBase *);
+ virtual void writeSettings(KConfigBase *);
+ virtual unsigned int minQueryLen() const;
+ virtual QWidget * configure();
+
+public slots:
+ void minQueryLenChanged(int);
+ void toggleIgnoreIconless(bool);
+ void toggleUseExecName(bool);
+ void toggleIgnoreTerminal(bool);
+
+private:
+ void cacheProgramList(QString);
+ int _minQueryLen;
+ bool _ignoreIconless;
+ bool _useExecName;
+ bool _ignoreTerminal;
+};
+
+#endif
diff --git a/katapult/plugins/catalogs/programcatalog/settings.ui b/katapult/plugins/catalogs/programcatalog/settings.ui
new file mode 100644
index 0000000..9e963f6
--- /dev/null
+++ b/katapult/plugins/catalogs/programcatalog/settings.ui
@@ -0,0 +1,101 @@
+<!DOCTYPE UI><UI version="3.2" stdsetdef="1">
+<class>ProgramCatalogSettings</class>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>ProgramCatalogSettings</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>308</width>
+ <height>519</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Settings</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout1</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>textLabel1</cstring>
+ </property>
+ <property name="text">
+ <string>Number of characters before searching:</string>
+ </property>
+ </widget>
+ <widget class="KIntSpinBox">
+ <property name="name">
+ <cstring>minQueryLen</cstring>
+ </property>
+ <property name="maxValue">
+ <number>10</number>
+ </property>
+ <property name="minValue">
+ <number>1</number>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Katapult will not search for programs until you have typed at least this many characters in the Katapult launcher.</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>ignoreIconless</cstring>
+ </property>
+ <property name="text">
+ <string>Ignore applications without icons</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>ignoreTerminal</cstring>
+ </property>
+ <property name="text">
+ <string>Ignore terminal applications</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>useExecName</cstring>
+ </property>
+ <property name="text">
+ <string>Catalog applications by executable name</string>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>spacer1</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>370</height>
+ </size>
+ </property>
+ </spacer>
+ </vbox>
+</widget>
+<layoutdefaults spacing="6" margin="11"/>
+<includehints>
+ <includehint>knuminput.h</includehint>
+</includehints>
+</UI>
diff --git a/katapult/plugins/catalogs/spellcatalog/Makefile.am b/katapult/plugins/catalogs/spellcatalog/Makefile.am
new file mode 100644
index 0000000..eb07f58
--- /dev/null
+++ b/katapult/plugins/catalogs/spellcatalog/Makefile.am
@@ -0,0 +1,19 @@
+# Copyright (C) 2006 Jonathan Riddell
+
+# set the include path for X, qt and KDE
+INCLUDES = -I$(top_srcdir)/katapult/common $(all_includes)
+
+# header files
+noinst_HEADERS = actioncopyspelling.h spellcatalog.h spelling.h
+
+# use automoc
+METASOURCES = AUTO
+
+KDE_ICON = AUTO
+
+# our plugin
+kde_module_LTLIBRARIES = katapult_spellcatalog.la
+katapult_spellcatalog_la_SOURCES = settings.ui spellcatalog.cpp spelling.cpp actioncopyspelling.cpp
+katapult_spellcatalog_la_LDFLAGS = -module $(KDE_RPATH) $(KDE_PLUGIN) $(all_libraries)
+katapult_spellcatalog_la_LIBADD = $(LIB_QT) $(LIB_KDECORE) $(LIB_KDEUI) $(LIB_KIO) $(top_builddir)/katapult/common/libkatapult.la
+kde_services_DATA = katapult_spellcatalog.desktop
diff --git a/katapult/plugins/catalogs/spellcatalog/actioncopyspelling.cpp b/katapult/plugins/catalogs/spellcatalog/actioncopyspelling.cpp
new file mode 100644
index 0000000..87857d3
--- /dev/null
+++ b/katapult/plugins/catalogs/spellcatalog/actioncopyspelling.cpp
@@ -0,0 +1,80 @@
+/***************************************************************************
+ * Copyright (C) 2006 Jonathan Riddell *
+ * jriddell@ubuntu.com *
+ * *
+ * Copyright (C) 2005 by Joe Ferris *
+ * jferris@optimistictech.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. *
+ * *
+ * 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. *
+ ***************************************************************************/
+
+#include <kapplication.h>
+#include <kglobal.h>
+#include <kiconloader.h>
+#include <klocale.h>
+
+#include <qclipboard.h>
+
+#include "spellcatalog.h"
+#include "spelling.h"
+#include "katapultitem.h"
+#include "actioncopyspelling.h"
+
+ActionCopySpelling::ActionCopySpelling()
+ : KatapultAction(), _spelling(0)
+{
+}
+
+ActionCopySpelling::~ActionCopySpelling()
+{
+}
+
+QString ActionCopySpelling::text() const
+{
+ if (_spelling->parseError()) {
+ return i18n("Parse Error");
+ } else {
+ return _spelling->result();
+ }
+}
+
+QPixmap ActionCopySpelling::icon(int size) const
+{
+ return KGlobal::iconLoader()->loadIcon("katapultspellcheck", KIcon::NoGroup, size);
+}
+
+bool ActionCopySpelling::accepts(const KatapultItem* item) const
+{
+ bool accept = strcmp(item->className(), "Spelling") == 0;
+ if (accept) {
+ _spelling = (const Spelling*)item;
+ }
+ return accept;
+}
+
+void ActionCopySpelling::execute(const KatapultItem* item) const
+{
+ if (strcmp(item->className(), "Spelling") == 0) {
+ _spelling = (const Spelling*)item;
+
+ _spelling->evaluate();
+
+ // Copy calculation and result into clipboard (unless there's a parse error).
+ if (!_spelling->parseError()) {
+ _spelling->copyToClipboard();
+ }
+ }
+}
diff --git a/katapult/plugins/catalogs/spellcatalog/actioncopyspelling.h b/katapult/plugins/catalogs/spellcatalog/actioncopyspelling.h
new file mode 100644
index 0000000..e15c3d9
--- /dev/null
+++ b/katapult/plugins/catalogs/spellcatalog/actioncopyspelling.h
@@ -0,0 +1,51 @@
+/***************************************************************************
+ * Copyright (C) 2006 Jonathan Riddell *
+ * jriddell@ubuntu.com *
+ * *
+ * Copyright (C) 2005 by Joe Ferris *
+ * jferris@optimistictech.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. *
+ * *
+ * 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 ACTIONCOPYSPELLING_H
+#define ACTIONCOPYSPELLING_H
+
+#include "katapultaction.h"
+
+class KatapultItem;
+class Spelling;
+
+/**
+@author Tobi Vollebregt
+*/
+class ActionCopySpelling : public KatapultAction
+{
+ public:
+ ActionCopySpelling();
+ ~ActionCopySpelling();
+
+ virtual void execute(const KatapultItem*) const;
+ virtual bool accepts(const KatapultItem*) const;
+ virtual QString text() const;
+ virtual QPixmap icon(int) const;
+
+ private:
+ //_expr needs to be mutable because accepts() is const.
+ mutable const Spelling* _spelling;
+
+};
+
+#endif
diff --git a/katapult/plugins/catalogs/spellcatalog/cr128-action-katapultspellcheck.png b/katapult/plugins/catalogs/spellcatalog/cr128-action-katapultspellcheck.png
new file mode 100644
index 0000000..f11344d
--- /dev/null
+++ b/katapult/plugins/catalogs/spellcatalog/cr128-action-katapultspellcheck.png
Binary files differ
diff --git a/katapult/plugins/catalogs/spellcatalog/crsc-action-katapultspellcheck.svgz b/katapult/plugins/catalogs/spellcatalog/crsc-action-katapultspellcheck.svgz
new file mode 100644
index 0000000..2105fa5
--- /dev/null
+++ b/katapult/plugins/catalogs/spellcatalog/crsc-action-katapultspellcheck.svgz
Binary files differ
diff --git a/katapult/plugins/catalogs/spellcatalog/katapult_spellcatalog.desktop b/katapult/plugins/catalogs/spellcatalog/katapult_spellcatalog.desktop
new file mode 100644
index 0000000..035ee06
--- /dev/null
+++ b/katapult/plugins/catalogs/spellcatalog/katapult_spellcatalog.desktop
@@ -0,0 +1,43 @@
+# Copyright (C) 2006 Jonathan Riddell
+[Desktop Entry]
+Name=Spell Catalog
+Name[ar]=مستعرض التدقيق الأملائي ( Spell Catalog )
+Name[bg]=Каталог за проверка на правописа
+Name[da]=Katalogisér stavning
+Name[de]=Rechtschreibung-Katalog
+Name[el]=Κατάλογος ορθογραφίας
+Name[es]=Catalogador de ortografía
+Name[et]=Õigekirjakataloog
+Name[fr]=Catalogue orthographique
+Name[ga]=Catalóg Litrithe
+Name[gl]=Catálogo de Ortografia
+Name[it]=Catalogo controllo ortografico
+Name[ja]=スペルカタログ
+Name[nb]=Stavekatalog
+Name[nl]=Spelcatalogus
+Name[pt]=Catálogo de Ortografia
+Name[pt_BR]=Catálogo de Ortografia
+Name[sv]=Stavningskatalog
+Name[uk]=Каталог правопису
+Comment=Check the spelling of a word
+Comment[ar]=دقًق املائيا في الكلمة
+Comment[bg]=Проверка правописа на дума
+Comment[da]=Tjek stavning af et ord
+Comment[de]=Die Schreibweise eines Wortes überprüfen
+Comment[el]=Ορθογραφικός έλεγχος μιας λέξης
+Comment[es]=Comprueba la ortografía de una palabra
+Comment[et]=Sõna õigekirja kontroll
+Comment[fr]=Vérifier l'orthographe d'un mot
+Comment[gl]=Verifica a ortografia dunha palabra
+Comment[it]=Controllo ortografico di una parola
+Comment[ja]=単語のスペルをチェック
+Comment[nb]=Sjekk skrivemåten for et ord
+Comment[nl]=Controleert de spelling van een woord
+Comment[pt]=Verificar a ortografia de uma palavra
+Comment[pt_BR]=Verificar a ortografia de uma palavra
+Comment[sv]=Kontrollera stavningen av ett ord
+Comment[uk]=Перевірити правопис слова
+ServiceTypes=Katapult/Catalog
+Type=Service
+X-KDE-Library=katapult_spellcatalog
+X-Katapult-ID=Spell Catalog
diff --git a/katapult/plugins/catalogs/spellcatalog/settings.ui b/katapult/plugins/catalogs/spellcatalog/settings.ui
new file mode 100644
index 0000000..402b416
--- /dev/null
+++ b/katapult/plugins/catalogs/spellcatalog/settings.ui
@@ -0,0 +1,65 @@
+<!DOCTYPE UI><UI version="3.2" stdsetdef="1">
+<class>SpellCatalogSettings</class>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>SpellCatalogSettings</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>356</width>
+ <height>265</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Settings</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLineEdit" row="1" column="1">
+ <property name="name">
+ <cstring>triggerWordLE</cstring>
+ </property>
+ </widget>
+ <widget class="QLabel" row="1" column="0">
+ <property name="name">
+ <cstring>triggerWordLabel</cstring>
+ </property>
+ <property name="text">
+ <string>Trigger Word:</string>
+ </property>
+ </widget>
+ <widget class="QLabel" row="0" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>introLabel</cstring>
+ </property>
+ <property name="text">
+ <string>Use with: "spell myword"</string>
+ </property>
+ </widget>
+ <spacer row="2" column="1">
+ <property name="name">
+ <cstring>spacer2</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>150</height>
+ </size>
+ </property>
+ </spacer>
+ </grid>
+</widget>
+<tabstops>
+</tabstops>
+<layoutdefaults spacing="6" margin="11"/>
+</UI>
diff --git a/katapult/plugins/catalogs/spellcatalog/spellcatalog.cpp b/katapult/plugins/catalogs/spellcatalog/spellcatalog.cpp
new file mode 100644
index 0000000..5cbdbed
--- /dev/null
+++ b/katapult/plugins/catalogs/spellcatalog/spellcatalog.cpp
@@ -0,0 +1,122 @@
+/***************************************************************************
+ * Copyright (C) 2006 Jonathan Riddell *
+ * jriddell@ubuntu.com *
+ * *
+ * Copyright (C) 2005 Tobi Vollebregt *
+ * tobivollebregt@gmail.com *
+ * *
+ * Copyright (C) 2005 by Joe Ferris *
+ * jferris@optimistictech.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. *
+ * *
+ * 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. *
+ ***************************************************************************/
+
+#include <kservicegroup.h>
+#include <ksycocaentry.h>
+#include <ksycocatype.h>
+#include <kapplication.h>
+
+#include <qlineedit.h>
+#include <qlabel.h>
+
+#include "settings.h"
+#include "spellcatalog.h"
+#include "actionregistry.h"
+#include "actioncopyspelling.h"
+#include "status.h"
+
+K_EXPORT_COMPONENT_FACTORY( katapult_spellcatalog,
+ KGenericFactory<SpellCatalog>( "katapult_spellcatalog" ) )
+
+SpellCatalog::SpellCatalog(QObject*, const char*, const QStringList&): _result(this, QString::null)
+{
+ ActionRegistry::self()->registerAction(new ActionCopySpelling());
+}
+
+SpellCatalog::~SpellCatalog()
+{
+}
+
+void SpellCatalog::queryChanged()
+{
+ int newStatus = 0;
+ QString cmd = query();
+ int origLength = cmd.length();
+
+ if (cmd.isEmpty()) {
+ reset();
+ setBestMatch(Match());
+ } else {
+ if (accepts(cmd)) {
+ _result.setText(cmd);
+
+ setBestMatch(Match(&_result, _result.parseError() ? 10 : 100, origLength));
+ //set status.
+ //add S_Multiple to make sure katapult doesn't auto-exec and close the window
+ //add S_Active to make sure katapult doesn't start the hideTimer or clearTimer
+ newStatus = S_HasResults | S_Multiple | S_Active;
+ } else {
+ newStatus = 0;
+ }
+ }
+ setStatus(newStatus);
+}
+
+bool SpellCatalog::accepts(const QString& str) const
+{
+ //accept if we begin with the triggerWord
+ int length = _triggerWord.length();
+ return str.left(length + 1) == _triggerWord + " ";
+}
+
+void SpellCatalog::readSettings(KConfigBase* config)
+{
+ _triggerWord = config->readEntry("TriggerWord", i18n("Should be short, easy and quick to type", "spell"));
+}
+
+void SpellCatalog::writeSettings(KConfigBase* config)
+{
+ config->writeEntry("TriggerWord", _triggerWord);
+}
+
+QWidget * SpellCatalog::configure()
+{
+ SpellCatalogSettings* settings = new SpellCatalogSettings();
+
+ settings->triggerWordLE->setText(_triggerWord);
+ connect(settings->triggerWordLE, SIGNAL(textChanged(const QString&)), this, SLOT(triggerWordChanged(const QString&)));
+
+ settings->introLabel->setText(i18n("Use with \"%1 myword\"").arg(_triggerWord));
+
+ return settings;
+}
+
+void SpellCatalog::triggerWordChanged(const QString& triggerWord)
+{
+ _triggerWord = QString(triggerWord);
+}
+
+int SpellCatalog::triggerWordLength()
+{
+ return _triggerWord.length();
+}
+
+void SpellCatalog::reset()
+{
+ _result.setText(QString::null);
+}
+
+#include "spellcatalog.moc"
diff --git a/katapult/plugins/catalogs/spellcatalog/spellcatalog.h b/katapult/plugins/catalogs/spellcatalog/spellcatalog.h
new file mode 100644
index 0000000..86181dc
--- /dev/null
+++ b/katapult/plugins/catalogs/spellcatalog/spellcatalog.h
@@ -0,0 +1,73 @@
+/***************************************************************************
+ * Copyright (C) 2006 Jonathan Riddell *
+ * jriddell@ubuntu.com *
+ * *
+ * Copyright (C) 2005 Tobi Vollebregt *
+ * tobivollebregt@gmail.com *
+ * *
+ * Copyright (C) 2005 by Joe Ferris *
+ * jferris@optimistictech.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. *
+ * *
+ * 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 SPELLCATALOG_H
+#define SPELLCATALOG_H
+
+#include <kgenericfactory.h>
+
+#include <qstring.h>
+
+#include "spelling.h"
+#include "katapultcatalog.h"
+
+class QWidget;
+
+/**
+@author Jonathan Riddell
+ */
+class SpellCatalog : public KatapultCatalog
+{
+ Q_OBJECT
+
+ public:
+
+ SpellCatalog(QObject*, const char*, const QStringList&);
+ virtual ~SpellCatalog();
+
+ virtual void readSettings(KConfigBase*);
+ virtual void writeSettings(KConfigBase*);
+ virtual QWidget* configure();
+ int triggerWordLength();
+
+ protected:
+
+ virtual void queryChanged();
+
+ private:
+ bool accepts(const QString&) const;
+
+ QString _triggerWord;
+
+ Spelling _result; // The one result (there's always one).
+
+ void reset();
+
+ protected slots:
+ void triggerWordChanged(const QString& triggerWord);
+
+};
+
+#endif
diff --git a/katapult/plugins/catalogs/spellcatalog/spelling.cpp b/katapult/plugins/catalogs/spellcatalog/spelling.cpp
new file mode 100644
index 0000000..fe08355
--- /dev/null
+++ b/katapult/plugins/catalogs/spellcatalog/spelling.cpp
@@ -0,0 +1,133 @@
+/***************************************************************************
+ * Copyright (C) 2006 Jonathan Riddell *
+ * jriddell@ubuntu.com *
+ * *
+ * Copyright (C) 2005 by Joe Ferris *
+ * jferris@optimistictech.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. *
+ * *
+ * 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. *
+ ***************************************************************************/
+
+#include <kservice.h>
+#include <kglobal.h>
+#include <kiconloader.h>
+#include <kapplication.h>
+
+#include <qclipboard.h>
+
+#include "spellcatalog.h"
+#include "spelling.h"
+
+
+Spelling::Spelling(SpellCatalog* catalog, const QString& text): KatapultItem(), _catalog(catalog), _text(text)
+{
+ spellChecker = new KSpell( 0, "caption", this, SLOT(spellCheckerReady()) );
+
+ connect( spellChecker, SIGNAL(misspelling(const QString&, const QStringList&, unsigned int)),
+ this, SLOT(spellCheckerMisspelling(const QString&, const QStringList&, unsigned int)) );
+
+ connect( spellChecker, SIGNAL(corrected(const QString&, const QString&, unsigned int)),
+ this, SLOT(spellCheckerCorrected(const QString&, const QString&, unsigned int)) );
+
+ evaluate();
+}
+
+Spelling::~Spelling() {
+ delete spellChecker;
+}
+
+void Spelling::spellCheckerReady() {
+}
+
+void Spelling::spellCheckerCorrected(const QString& /*originalword*/, const QString& /*newword*/, unsigned int /*pos*/) {
+ corrected = true;
+}
+
+void Spelling::spellCheckerMisspelling(const QString& /*originalword*/, const QStringList& suggestions, unsigned int /*pos*/) {
+ misspelt = true;
+ suggestedWords = suggestions.join(",");
+}
+
+QPixmap Spelling::icon(int size) const
+{
+ const char* icon = "checkmark";
+ if (_parseError || misspelt) {
+ icon = "no";
+ }
+ return KGlobal::iconLoader()->loadIcon(icon, KIcon::NoGroup, size);
+}
+
+QString Spelling::text() const
+{
+ return _text;
+}
+
+void Spelling::setText(const QString& text)
+{
+ _text = text;
+ evaluate();
+}
+
+QString Spelling::result() const
+{
+ return _result;
+}
+
+bool Spelling::parseError() const
+{
+ return _parseError;
+}
+
+SpellCatalog* Spelling::catalog() const
+{
+ return _catalog;
+}
+
+void Spelling::evaluate() const
+{
+ int length = catalog()->triggerWordLength();
+
+ QString text = _text.mid(length + 1); // + 1 for space
+
+ misspelt = false;
+ corrected = false;
+
+ _parseError = false;
+ if (!_text.isEmpty()) {
+ _result = "my result";
+ spellChecker->checkWord(text);
+
+ while (corrected == false) {
+ kapp->processEvents();
+ }
+
+ if (misspelt) {
+ _result = suggestedWords;
+ } else {
+ _result = "Correct";
+ }
+ } else {
+ _parseError = true;
+ }
+}
+
+void Spelling::copyToClipboard() const {
+ QClipboard* clipBoard = QApplication::clipboard();
+ clipBoard->setText(suggestedWords, QClipboard::Clipboard);
+ clipBoard->setText(suggestedWords, QClipboard::Selection);
+}
+
+#include "spelling.moc"
diff --git a/katapult/plugins/catalogs/spellcatalog/spelling.h b/katapult/plugins/catalogs/spellcatalog/spelling.h
new file mode 100644
index 0000000..ea4b846
--- /dev/null
+++ b/katapult/plugins/catalogs/spellcatalog/spelling.h
@@ -0,0 +1,74 @@
+/***************************************************************************
+ * Copyright (C) 2006 Jonathan Riddell *
+ * jriddell@ubuntu.com *
+ * *
+ * Copyright (C) 2005 by Joe Ferris *
+ * jferris@optimistictech.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. *
+ * *
+ * 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 SPELLING_H
+#define SPELLING_H
+
+#include <kspell.h>
+
+#include <katapultitem.h>
+
+class SpellCatalog;
+
+/**
+@author Tobi Vollebregt
+*/
+class Spelling : public KatapultItem
+{
+ Q_OBJECT
+ public:
+ Spelling(SpellCatalog*, const QString&);
+ ~Spelling();
+
+ virtual QPixmap icon(int) const;
+ virtual QString text() const;
+
+ void setText(const QString&);
+ QString result() const;
+ bool parseError() const;
+
+ //evaluate() must be const, or ActionEvaluateSpelling::execute() can't call it.
+ //It makes sense because evaluate() does _not_ change the expression,
+ //it just calculates the result and remembers that.
+ void evaluate() const;
+
+ SpellCatalog* catalog() const;
+
+ void copyToClipboard() const;
+
+ private:
+ SpellCatalog* const _catalog;
+ QString _text;
+ mutable QString _result;
+ mutable bool _parseError;
+ KSpell* spellChecker;
+ mutable bool misspelt;
+ mutable bool corrected;
+ QString suggestedWords;
+
+ protected slots:
+ void spellCheckerReady();
+ void spellCheckerCorrected(const QString& originalword, const QString& newword, unsigned int pos);
+ void spellCheckerMisspelling(const QString& originalword, const QStringList& suggestions, unsigned int pos);
+};
+
+#endif
diff --git a/katapult/plugins/display/Makefile.am b/katapult/plugins/display/Makefile.am
new file mode 100644
index 0000000..45328c4
--- /dev/null
+++ b/katapult/plugins/display/Makefile.am
@@ -0,0 +1 @@
+SUBDIRS = glassdisplay puredisplay o2display
diff --git a/katapult/plugins/display/glassdisplay/Makefile.am b/katapult/plugins/display/glassdisplay/Makefile.am
new file mode 100644
index 0000000..a7ff719
--- /dev/null
+++ b/katapult/plugins/display/glassdisplay/Makefile.am
@@ -0,0 +1,15 @@
+# set the include path for X, qt and KDE
+INCLUDES = -I$(top_srcdir)/katapult/common $(all_includes)
+
+# header files
+noinst_HEADERS = glassdisplay.h
+
+# use automoc
+METASOURCES = AUTO
+
+# our plugin
+kde_module_LTLIBRARIES = katapult_glassdisplay.la
+katapult_glassdisplay_la_SOURCES = glassdisplay.cpp
+katapult_glassdisplay_la_LDFLAGS = -module $(KDE_RPATH) $(KDE_PLUGIN) $(all_libraries)
+katapult_glassdisplay_la_LIBADD = $(LIB_QT) $(LIB_KDECORE) $(LIB_KDEUI) $(top_builddir)/katapult/common/libkatapult.la
+kde_services_DATA = katapult_glassdisplay.desktop
diff --git a/katapult/plugins/display/glassdisplay/doublebg.png b/katapult/plugins/display/glassdisplay/doublebg.png
new file mode 100644
index 0000000..77d8583
--- /dev/null
+++ b/katapult/plugins/display/glassdisplay/doublebg.png
Binary files differ
diff --git a/katapult/plugins/display/glassdisplay/glassdisplay.cpp b/katapult/plugins/display/glassdisplay/glassdisplay.cpp
new file mode 100644
index 0000000..278d67f
--- /dev/null
+++ b/katapult/plugins/display/glassdisplay/glassdisplay.cpp
@@ -0,0 +1,60 @@
+/***************************************************************************
+ * Copyright (C) 2005 by Bastian Holst *
+ * bastianholst@gmx.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. *
+ ***************************************************************************/
+
+#include <kiconloader.h>
+#include <kgenericfactory.h>
+#include <qpixmap.h>
+
+#include "glassdisplay.h"
+#include "qembed_images.h"
+
+K_EXPORT_COMPONENT_FACTORY( katapult_glassdisplay,
+ KGenericFactory<GlassDisplay>( "katapult_glassdisplay" ) )
+
+#define WIDTH 295
+#define HEIGHT 189
+#define PADDING 6
+#define ICONSIZE 128
+
+#define LEFTMARGIN 1
+#define TOPMARGIN 1
+#define RIGHTMARGIN 8
+#define BOTTOMMARGIN 8
+
+GlassDisplay::GlassDisplay(QObject *parent, const char *name, const QStringList& list)
+ : ImageDisplay(parent, name, list)
+{
+ setSingleBG(new QPixmap(qembed_findImage("singlebg")));
+ setDoubleBG(new QPixmap(qembed_findImage("doublebg")));
+
+ setSingleSize(WIDTH, HEIGHT);
+ setDoubleSize(WIDTH, HEIGHT);
+
+ setMargin(LEFTMARGIN, TOPMARGIN, RIGHTMARGIN, BOTTOMMARGIN);
+ setPadding(PADDING);
+ setIconSize(ICONSIZE);
+}
+
+GlassDisplay::~GlassDisplay()
+{
+}
+
+
+#include "glassdisplay.moc"
diff --git a/katapult/plugins/display/glassdisplay/glassdisplay.h b/katapult/plugins/display/glassdisplay/glassdisplay.h
new file mode 100644
index 0000000..166ed99
--- /dev/null
+++ b/katapult/plugins/display/glassdisplay/glassdisplay.h
@@ -0,0 +1,36 @@
+/***************************************************************************
+ * Copyright (C) 2005 by Bastian Holst *
+ * bastianholst@gmx.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. *
+ ***************************************************************************/
+#ifndef GLASSDISPLAY_H
+#define GLASSDISPLAY_H
+
+#include <imagedisplay.h>
+
+/**
+@author Bastian Holst
+*/
+class GlassDisplay : public ImageDisplay
+{
+ Q_OBJECT
+public:
+ GlassDisplay(QObject *, const char *, const QStringList&);
+ virtual ~GlassDisplay();
+};
+
+#endif
diff --git a/katapult/plugins/display/glassdisplay/katapult_glassdisplay.desktop b/katapult/plugins/display/glassdisplay/katapult_glassdisplay.desktop
new file mode 100644
index 0000000..b611b17
--- /dev/null
+++ b/katapult/plugins/display/glassdisplay/katapult_glassdisplay.desktop
@@ -0,0 +1,42 @@
+[Desktop Entry]
+Name=Glass Display
+Name[ar]=عرض بلًوري ( Glass Display )
+Name[bg]=Стъклен изглед
+Name[da]=Glasskærm
+Name[de]=Glas-Anzeige
+Name[el]=Γυάλινη εμφάνιση
+Name[es]=Mostrar cristal
+Name[et]=Klaasivaade
+Name[fr]=Affichage Glass
+Name[gl]=Pantalla Cristal
+Name[ja]=半透明表示
+Name[nb]=Glass-visning
+Name[nl]=Glass-display
+Name[pt]=Visualização por Vidro
+Name[pt_BR]=Visualização Vitrificada
+Name[sv]=Glasskärm
+Name[tr]=Cam Gösterimi
+Name[uk]=Скляний дисплей
+Comment=Glass display plugin for Katapult
+Comment[ar]=بريمج عرض بلًوري ل- Katapult
+Comment[bg]=Приставка за стъклен изглед в Katapult
+Comment[da]=Plugin med glasskærm for Katapult
+Comment[de]=Glas-Anzeige-Modul für Katapult
+Comment[el]=Πρόσθετο γυάλινης εμφάνισης για το Katapult
+Comment[es]=Extensión para mostrar cristal para Katapult
+Comment[et]=Katapulti klaasivaate plugin
+Comment[fr]=Module externe d'affichage Glass pour Katapult
+Comment[gl]=Plugin Glass display para Katapult
+Comment[it]=Plugin Glass display per Katapult
+Comment[ja]=Katapult のための半透明表示プラグイン
+Comment[nb]=Programttillegg for Glassvisning i Katapult
+Comment[nl]=Glass-display-plugin voor Katapult
+Comment[pt]=Um 'plugin' de visualização por vidro para o Katapult
+Comment[pt_BR]=Um 'plugin' de visualização vitrificada para o Katapult
+Comment[sv]=Insticksprogram med glasskärm för Katapult
+Comment[tr]=Katapult için Cam gösterimi eklentisi
+Comment[uk]=Втулок скляного дисплея для Катапульти
+ServiceTypes=Katapult/Display
+Type=Service
+X-KDE-Library=katapult_glassdisplay
+X-Katapult-ID=Name=Glass Display
diff --git a/katapult/plugins/display/glassdisplay/qembed_images.h b/katapult/plugins/display/glassdisplay/qembed_images.h
new file mode 100644
index 0000000..a8e5b3a
--- /dev/null
+++ b/katapult/plugins/display/glassdisplay/qembed_images.h
@@ -0,0 +1,8019 @@
+#ifndef _QEMBED_1804289383
+#define _QEMBED_1804289383
+#include <qimage.h>
+#include <qdict.h>
+static const QRgb singlebg_data[] = {
+ 0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,
+ 0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,
+ 0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,
+ 0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,
+ 0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,
+ 0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,
+ 0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,
+ 0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,
+ 0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,
+ 0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,
+ 0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,
+ 0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,
+ 0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,
+ 0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,
+ 0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,
+ 0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,
+ 0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,
+ 0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,
+ 0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,
+ 0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,
+ 0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,0xffffff,
+ 0xffffff,0x0,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,
+ 0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,
+ 0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,
+ 0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,
+ 0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,
+ 0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,
+ 0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,
+ 0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,
+ 0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,
+ 0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,
+ 0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,
+ 0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,
+ 0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,
+ 0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,
+ 0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,
+ 0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,
+ 0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,
+ 0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,
+ 0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,
+ 0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,
+ 0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0x6000000,0x5000000,0x4000000,0x3000000,0x1000000,0x1000000,
+ 0x0,0xffffff,0x1000000,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,
+ 0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,
+ 0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,
+ 0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,
+ 0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,
+ 0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,
+ 0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,
+ 0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,
+ 0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,
+ 0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,
+ 0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,
+ 0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,
+ 0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,
+ 0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,
+ 0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,
+ 0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,
+ 0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,
+ 0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,
+ 0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,
+ 0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,
+ 0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0xd9181818,0x13000000,0x11000000,0xd000000,0x9000000,0x5000000,
+ 0x2000000,0x1000000,0xffffff,0x1000000,0xd9181818,0xd9181818,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0xd9181818,0xd9181818,0x28000000,0x22000000,0x1b000000,0x12000000,
+ 0xa000000,0x5000000,0x1000000,0xffffff,0x3000000,0xd9181818,0xd9181818,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0xd9181818,0xd9181818,0x43000000,0x3a000000,0x2e000000,
+ 0x1e000000,0x12000000,0x9000000,0x3000000,0xffffff,0x4000000,0xd9181818,0xd9181818,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0xd9181818,0xd9181818,0x64000000,0x57000000,
+ 0x44000000,0x2e000000,0x1b000000,0xd000000,0x4000000,0xffffff,0x5000000,0xd9181818,0xd9181818,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0xd9181818,0xd9181818,0x7f000000,
+ 0x6e000000,0x57000000,0x3a000000,0x22000000,0x11000000,0x5000000,0xffffff,0x6000000,0xd9181818,0xd9181818,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0xd9181818,0xd9181818,
+ 0x94000000,0x7f000000,0x64000000,0x43000000,0x28000000,0x13000000,0x6000000,0xffffff,0x7000000,0xd9181818,0xd9181818,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0xd9181818,
+ 0xd9181818,0xa1000000,0x8b000000,0x6d000000,0x49000000,0x2b000000,0x16000000,0x7000000,0xffffff,0x7000000,0xd9181818,0xd9181818,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0xd9181818,0xd9181818,0xa8000000,0x91000000,0x73000000,0x4c000000,0x2e000000,0x16000000,0x7000000,0xffffff,0x7000000,0xd9181818,0xd9181818,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0xd9181818,0xd9181818,0xa8000000,0x91000000,0x73000000,0x4c000000,0x2e000000,0x16000000,0x7000000,0xffffff,0x7000000,0xd9181818,0xd9181818,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0xd9181818,0xd9181818,0xa8000000,0x91000000,0x73000000,0x4c000000,0x2e000000,0x16000000,0x7000000,0xffffff,0x7000000,0xd9181818,
+ 0xd9181818,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0xd9181818,0xd9181818,0xa8000000,0x91000000,0x73000000,0x4c000000,0x2e000000,0x16000000,0x7000000,0xffffff,0x7000000,
+ 0xd9181818,0xd9181818,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0xd9181818,0xd9181818,0xa8000000,0x91000000,0x73000000,0x4c000000,0x2e000000,0x16000000,0x7000000,0xffffff,
+ 0x7000000,0xd9181818,0xd9181818,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0xd9181818,0xd9181818,0xa8000000,0x91000000,0x73000000,0x4c000000,0x2e000000,0x16000000,0x7000000,
+ 0xffffff,0x7000000,0xd9181818,0xd9181818,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0xd9181818,0xd9181818,0xa8000000,0x91000000,0x73000000,0x4c000000,0x2e000000,0x16000000,
+ 0x7000000,0xffffff,0x7000000,0xd9181818,0xd9181818,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0xd9181818,0xd9181818,0xa8000000,0x91000000,0x73000000,0x4c000000,0x2e000000,
+ 0x16000000,0x7000000,0xffffff,0x7000000,0xd9181818,0xd9181818,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0xd9181818,0xd9181818,0xa8000000,0x91000000,0x73000000,0x4c000000,
+ 0x2e000000,0x16000000,0x7000000,0xffffff,0x7000000,0xd9181818,0xd9181818,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0xd9181818,0xd9181818,0xa8000000,0x91000000,0x73000000,
+ 0x4c000000,0x2e000000,0x16000000,0x7000000,0xffffff,0x7000000,0xd9181818,0xd9181818,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0xd9181818,0xd9181818,0xa8000000,0x91000000,
+ 0x73000000,0x4c000000,0x2e000000,0x16000000,0x7000000,0xffffff,0x7000000,0xd9181818,0xd9181818,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0xd9181818,0xd9181818,0xa8000000,
+ 0x91000000,0x73000000,0x4c000000,0x2e000000,0x16000000,0x7000000,0xffffff,0x7000000,0xd9181818,0xd9181818,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0xd9181818,0xd9181818,
+ 0xa8000000,0x91000000,0x73000000,0x4c000000,0x2e000000,0x16000000,0x7000000,0xffffff,0x7000000,0xd9181818,0xd9181818,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0xd9181818,
+ 0xd9181818,0xa8000000,0x91000000,0x73000000,0x4c000000,0x2e000000,0x16000000,0x7000000,0xffffff,0x7000000,0xd9181818,0xd9181818,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0xd9181818,0xd9181818,0xa8000000,0x91000000,0x73000000,0x4c000000,0x2e000000,0x16000000,0x7000000,0xffffff,0x7000000,0xd9181818,0xd9181818,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0xd9181818,0xd9181818,0xa8000000,0x91000000,0x73000000,0x4c000000,0x2e000000,0x16000000,0x7000000,0xffffff,0x7000000,0xd9181818,0xd9181818,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0xd9181818,0xd9181818,0xa8000000,0x91000000,0x73000000,0x4c000000,0x2e000000,0x16000000,0x7000000,0xffffff,0x7000000,0xd9181818,
+ 0xd9181818,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0xd9181818,0xd9181818,0xa8000000,0x91000000,0x73000000,0x4c000000,0x2e000000,0x16000000,0x7000000,0xffffff,0x7000000,
+ 0xd9181818,0xd9181818,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0xd9181818,0xd9181818,0xa8000000,0x91000000,0x73000000,0x4c000000,0x2e000000,0x16000000,0x7000000,0xffffff,
+ 0x7000000,0xd9181818,0xd9181818,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0xd9181818,0xd9181818,0xa8000000,0x91000000,0x73000000,0x4c000000,0x2e000000,0x16000000,0x7000000,
+ 0xffffff,0x7000000,0xd9181818,0xd9181818,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0xd9181818,0xd9181818,0xa8000000,0x91000000,0x73000000,0x4c000000,0x2e000000,0x16000000,
+ 0x7000000,0xffffff,0x7000000,0xd9181818,0xd9181818,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0xd9181818,0xd9181818,0xa8000000,0x91000000,0x73000000,0x4c000000,0x2e000000,
+ 0x16000000,0x7000000,0xffffff,0x7000000,0xd9181818,0xd9181818,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0xd9181818,0xd9181818,0xa8000000,0x91000000,0x73000000,0x4c000000,
+ 0x2e000000,0x16000000,0x7000000,0xffffff,0x7000000,0xd9181818,0xd9181818,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0xd9181818,0xd9181818,0xa8000000,0x91000000,0x73000000,
+ 0x4c000000,0x2e000000,0x16000000,0x7000000,0xffffff,0x7000000,0xd9181818,0xd9181818,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0xd9181818,0xd9181818,0xa8000000,0x91000000,
+ 0x73000000,0x4c000000,0x2e000000,0x16000000,0x7000000,0xffffff,0x7000000,0xd9181818,0xd9181818,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0xd9181818,0xd9181818,0xa8000000,
+ 0x91000000,0x73000000,0x4c000000,0x2e000000,0x16000000,0x7000000,0xffffff,0x7000000,0xd9181818,0xd9181818,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0xd9181818,0xd9181818,
+ 0xa8000000,0x91000000,0x73000000,0x4c000000,0x2e000000,0x16000000,0x7000000,0xffffff,0x7000000,0xd9181818,0xd9181818,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0xd9181818,
+ 0xd9181818,0xa8000000,0x91000000,0x73000000,0x4c000000,0x2e000000,0x16000000,0x7000000,0xffffff,0x7000000,0xd9181818,0xd9181818,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0xd9181818,0xd9181818,0xa8000000,0x91000000,0x73000000,0x4c000000,0x2e000000,0x16000000,0x7000000,0xffffff,0x7000000,0xd9181818,0xd9181818,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0xd9181818,0xd9181818,0xa8000000,0x91000000,0x73000000,0x4c000000,0x2e000000,0x16000000,0x7000000,0xffffff,0x7000000,0xd9181818,0xd9181818,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0xd9181818,0xd9181818,0xa8000000,0x91000000,0x73000000,0x4c000000,0x2e000000,0x16000000,0x7000000,0xffffff,0x7000000,0xd9181818,
+ 0xd9181818,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0xd9181818,0xd9181818,0xa8000000,0x91000000,0x73000000,0x4c000000,0x2e000000,0x16000000,0x7000000,0xffffff,0x7000000,
+ 0xd9181818,0xd9181818,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0xd9181818,0xd9181818,0xa8000000,0x91000000,0x73000000,0x4c000000,0x2e000000,0x16000000,0x7000000,0xffffff,
+ 0x7000000,0xd9181818,0xd9181818,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0xd9181818,0xd9181818,0xa8000000,0x91000000,0x73000000,0x4c000000,0x2e000000,0x16000000,0x7000000,
+ 0xffffff,0x7000000,0xd9181818,0xd9181818,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0xd9181818,0xd9181818,0xa8000000,0x91000000,0x73000000,0x4c000000,0x2e000000,0x16000000,
+ 0x7000000,0xffffff,0x7000000,0xd9181818,0xd9181818,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0xd9181818,0xd9181818,0xa8000000,0x91000000,0x73000000,0x4c000000,0x2e000000,
+ 0x16000000,0x7000000,0xffffff,0x7000000,0xd9181818,0xd9181818,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0xd9181818,0xd9181818,0xa8000000,0x91000000,0x73000000,0x4c000000,
+ 0x2e000000,0x16000000,0x7000000,0xffffff,0x7000000,0xd9181818,0xd9181818,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0xd9181818,0xd9181818,0xa8000000,0x91000000,0x73000000,
+ 0x4c000000,0x2e000000,0x16000000,0x7000000,0xffffff,0x7000000,0xd9181818,0xd9181818,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0xd9181818,0xd9181818,0xa8000000,0x91000000,
+ 0x73000000,0x4c000000,0x2e000000,0x16000000,0x7000000,0xffffff,0x7000000,0xd9181818,0xd9181818,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0xd9181818,0xd9181818,0xa8000000,
+ 0x91000000,0x73000000,0x4c000000,0x2e000000,0x16000000,0x7000000,0xffffff,0x7000000,0xd9181818,0xd9181818,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0xd9181818,0xd9181818,
+ 0xa8000000,0x91000000,0x73000000,0x4c000000,0x2e000000,0x16000000,0x7000000,0xffffff,0x7000000,0xd9181818,0xd9181818,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,
+ 0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x99191919,0x991