diff options
author | toma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-11-25 17:56:58 +0000 |
---|---|---|
committer | toma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-11-25 17:56:58 +0000 |
commit | ce4a32fe52ef09d8f5ff1dd22c001110902b60a2 (patch) | |
tree | 5ac38a06f3dde268dc7927dc155896926aaf7012 /kate/tests/highlight.pb | |
download | tdelibs-ce4a32fe52ef09d8f5ff1dd22c001110902b60a2.tar.gz tdelibs-ce4a32fe52ef09d8f5ff1dd22c001110902b60a2.zip |
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdelibs@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kate/tests/highlight.pb')
-rw-r--r-- | kate/tests/highlight.pb | 87 |
1 files changed, 87 insertions, 0 deletions
diff --git a/kate/tests/highlight.pb b/kate/tests/highlight.pb new file mode 100644 index 000000000..556023334 --- /dev/null +++ b/kate/tests/highlight.pb @@ -0,0 +1,87 @@ +; This is a test file for kate's PureBasic highlighting. + +; BMP2x Converter by Sven Langenkamp + +UseJPEGImageEncoder() +UsePNGImageEncoder() + +Declare Convert(JPEG) + +Enumeration 1 + #JPEG + #PNG +EndEnumeration + +; BEGIN section + + +; END + +Global Count +Global file.s +Global filename.s +Global fileext.s +Global OutputFormat +Global JPEGQuality + +Count = 0 +OutputFormat = 1 +JPEGQuality = -1 + +; MAIN PROGRAM------------------------------------------------------------------ + +;Request Options +PrintN("Output Format") +PrintN(" [1] JPEG") +PrintN(" [2] PNG") +Print ("> ") +OutputFormat = Int(Input()) + +Select OutputFormat + Case #JPEG: + fileext = ".jpg" + ;Request JPEG Quality + PrintN("") + PrintN("JPEG Quality") + PrintN(" [0-10]") + Print ("> ") + JPEGQuality = Int(Input()) + + Case #PNG: + fileext = ".png" +EndSelect + +;Convert all BMP files in the current directory +ExamineDirectory(0, "", "*.bmp") +While NextDirectoryEntry() + file = DirectoryEntryName() + filename = GetFilePart(file) + + If LoadImage(0, file) + Select OutputFormat + Case #JPEG: + Convert(JPEGQuality) + + Case #PNG: + Convert(-1) + EndSelect + Count = Count +1 + EndIf + +Wend + +PrintN(Str(Count) + " files converted") +CloseConsole() + +; PROCUDURES-------------------------------------------------------------------- + +Procedure Convert(JPEG) + Shared filename, fileext + + If JPEG > -1 + SaveImage(0, filename + fileext, #PB_ImagePlugin_JPEG, JPEG) + Else + SaveImage(0, filename + fileext, #PB_ImagePlugin_PNG) + EndIf + PrintN(file + " converted to " + filename + fileext) +EndProcedure
\ No newline at end of file |