├── Support ├── AddFile │ ├── build │ │ └── Release │ │ │ └── AddFile.app │ │ │ └── Contents │ │ │ ├── PkgInfo │ │ │ ├── MacOS │ │ │ └── AddFile │ │ │ ├── Resources │ │ │ ├── English.lproj │ │ │ │ ├── MainMenu.nib │ │ │ │ └── InfoPlist.strings │ │ │ ├── rb_main.rb │ │ │ └── AppController.rb │ │ │ └── Info.plist │ ├── English.lproj │ │ ├── InfoPlist.strings │ │ └── MainMenu.xib │ ├── main.m │ ├── rb_main.rb │ ├── Info.plist │ ├── AppController.rb │ ├── AddFile.xcodeproj │ │ ├── mblsha.pbxuser │ │ └── project.pbxproj │ └── Rakefile ├── lib │ ├── assistant_search │ │ ├── assistant_search.pro │ │ ├── assistant_search │ │ └── main.cpp │ ├── rails_bundle_tools.rb │ ├── camelcase.rb │ ├── rails │ │ ├── unobtrusive_logger.rb │ │ ├── text_mate.rb │ │ └── misc.rb │ ├── common.rb │ ├── run_helper.rb │ ├── ctags.rb │ └── Builder.rb └── bin │ ├── add_file.rb │ ├── run_qt_project.rb │ ├── insert_super.rb │ ├── implementation_to_declaration.rb │ ├── insert_class.rb │ ├── declaration_to_implementation.rb │ ├── find_qt_project.rb │ ├── search.rb │ └── build_qt_project.rb ├── Snippets ├── qDebug.tmSnippet ├── Block Comment.tmSnippet ├── toUtf8()_data().tmSnippet ├── qSort(___).tmSnippet ├── toLatin1().data() (latin).tmSnippet ├── Block Comment Newline.tmSnippet ├── foreach.tmSnippet ├── qWarning (warn).tmSnippet ├── connect.tmSnippet ├── QTimer::singleShot(___).tmSnippet ├── disconnect.tmSnippet ├── main (qmain).tmSnippet ├── Q_PROPERTY.tmSnippet └── qmake Project template stub.tmSnippet ├── Preferences ├── qmake Typing Pairs.tmPreferences ├── qmake Comments.tmPreferences ├── Qt C++ Folding.tmPreferences ├── Qt C++ Indentation Rules.tmPreferences ├── qmake Completitions.tmPreferences └── Qt C++ Completitions.tmPreferences ├── Commands ├── Class Declaration.tmCommand ├── Class Declaration with Doxygen.tmCommand ├── Add File.tmCommand ├── Display Documentation.tmCommand ├── qmake Manual.tmCommand ├── Display Fuzzy Documentation.tmCommand ├── Implementation to Declaration.tmCommand ├── Declaration to Implementation.tmCommand ├── Insert Call to Super.tmCommand ├── Documentation for Word : Selection (fuzzy).tmCommand ├── Build & Run.tmCommand ├── Build.tmCommand ├── Run Application.tmCommand ├── Declaration to Implementation (with Doxygen).tmCommand ├── Reformat Block Comment.tmCommand ├── Documentation for Word : Selection.tmCommand └── Doc Lookup.tmCommand ├── README.mdown ├── Macros └── Class Declaration with Q_OBJECT.plist ├── info.plist └── Syntaxes ├── Qt C++.tmLanguage └── qmake Project.tmLanguage /Support/AddFile/build/Release/AddFile.app/Contents/PkgInfo: -------------------------------------------------------------------------------- 1 | APPL???? -------------------------------------------------------------------------------- /Support/lib/assistant_search/assistant_search.pro: -------------------------------------------------------------------------------- 1 | TEMPLATE = app 2 | CONFIG += qt 3 | CONFIG -= app_bundle 4 | SOURCES += main.cpp -------------------------------------------------------------------------------- /Support/lib/assistant_search/assistant_search: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/textmate/cpp-qt.tmbundle/master/Support/lib/assistant_search/assistant_search -------------------------------------------------------------------------------- /Support/AddFile/English.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/textmate/cpp-qt.tmbundle/master/Support/AddFile/English.lproj/InfoPlist.strings -------------------------------------------------------------------------------- /Support/AddFile/build/Release/AddFile.app/Contents/MacOS/AddFile: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/textmate/cpp-qt.tmbundle/master/Support/AddFile/build/Release/AddFile.app/Contents/MacOS/AddFile -------------------------------------------------------------------------------- /Support/AddFile/build/Release/AddFile.app/Contents/Resources/English.lproj/MainMenu.nib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/textmate/cpp-qt.tmbundle/master/Support/AddFile/build/Release/AddFile.app/Contents/Resources/English.lproj/MainMenu.nib -------------------------------------------------------------------------------- /Support/AddFile/build/Release/AddFile.app/Contents/Resources/English.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/textmate/cpp-qt.tmbundle/master/Support/AddFile/build/Release/AddFile.app/Contents/Resources/English.lproj/InfoPlist.strings -------------------------------------------------------------------------------- /Support/bin/add_file.rb: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby18 2 | require ENV['TM_BUNDLE_SUPPORT'] + '/lib/rails_bundle_tools' 3 | $add_file = ENV['TM_BUNDLE_SUPPORT'] + '/AddFile/build/Release/AddFile.app/Contents/MacOS/AddFile' 4 | 5 | if __FILE__ == $0 6 | puts `"#$add_file"` 7 | end 8 | -------------------------------------------------------------------------------- /Support/lib/rails_bundle_tools.rb: -------------------------------------------------------------------------------- 1 | bundle_lib = ENV['TM_BUNDLE_SUPPORT'] + '/lib' 2 | $LOAD_PATH.unshift(bundle_lib) if ENV['TM_BUNDLE_SUPPORT'] and !$LOAD_PATH.include?(bundle_lib) 3 | 4 | require ENV['TM_SUPPORT_PATH'] + '/lib/ui' 5 | 6 | require 'rails/text_mate' 7 | require 'rails/unobtrusive_logger' 8 | require 'rails/misc' 9 | require 'camelcase' -------------------------------------------------------------------------------- /Support/bin/run_qt_project.rb: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby18 2 | 3 | require ENV['TM_BUNDLE_SUPPORT'] + "/bin/find_qt_project" 4 | require ENV['TM_BUNDLE_SUPPORT'] + "/lib/run_helper" 5 | 6 | begin 7 | project = QtProjectSearch.find_project 8 | dir = File.dirname(project) 9 | Runner.run(Runner.target(dir), dir) 10 | rescue Exception => e 11 | puts e.message 12 | end -------------------------------------------------------------------------------- /Support/AddFile/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // AddFile 4 | // 5 | // Created by Michail Pishchagin on 27.10.07. 6 | // Copyright (c) 2007 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | int main(int argc, const char *argv[]) 13 | { 14 | return RBApplicationMain("rb_main.rb", argc, argv); 15 | } 16 | -------------------------------------------------------------------------------- /Snippets/qDebug.tmSnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | qDebug() << $1; 7 | name 8 | qDebug 9 | scope 10 | source.c++.qt 11 | tabTrigger 12 | debug 13 | uuid 14 | DDDE4415-9B12-4F03-81CE-CB9ACA62CFD2 15 | 16 | 17 | -------------------------------------------------------------------------------- /Snippets/Block Comment.tmSnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | /* 7 | * $0 8 | */ 9 | name 10 | Block Comment 11 | scope 12 | source.c++.qt 13 | tabTrigger 14 | /* 15 | uuid 16 | 2FC991AF-86B9-4227-838A-30164B4923A1 17 | 18 | 19 | -------------------------------------------------------------------------------- /Snippets/toUtf8()_data().tmSnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | toUtf8().data() 7 | name 8 | toUtf8().data() 9 | scope 10 | source.c++.qt 11 | tabTrigger 12 | utf8 13 | uuid 14 | 84CF7C01-9208-453D-8254-DCD17D0A7500 15 | 16 | 17 | -------------------------------------------------------------------------------- /Snippets/qSort(___).tmSnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | qSort(${1:list}.begin(), ${1}.end()) 7 | name 8 | qSort(...) 9 | scope 10 | source.c++.qt 11 | tabTrigger 12 | qSort 13 | uuid 14 | D05EDFB2-D456-420B-87EB-BD4CBEDAA58E 15 | 16 | 17 | -------------------------------------------------------------------------------- /Snippets/toLatin1().data() (latin).tmSnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | toLatin1().data() 7 | name 8 | toLatin1().data() 9 | scope 10 | source.c++.qt 11 | tabTrigger 12 | latin 13 | uuid 14 | 9CC7A8E5-1EDD-4795-A1A9-3432D535F4C4 15 | 16 | 17 | -------------------------------------------------------------------------------- /Snippets/Block Comment Newline.tmSnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | 7 | * 8 | keyEquivalent 9 | 10 | name 11 | Block Comment Newline 12 | scope 13 | source.c++.qt comment.block.c 14 | uuid 15 | 9CD2DCE1-C4FE-46CF-BE35-D38041740C5D 16 | 17 | 18 | -------------------------------------------------------------------------------- /Snippets/foreach.tmSnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | foreach( ${1:variable}, ${2:container} ) 7 | { 8 | ${3:doSomething();} 9 | }$0 10 | name 11 | foreach 12 | scope 13 | source.c++.qt 14 | tabTrigger 15 | fe 16 | uuid 17 | 90F2231F-959B-4CA7-9CAF-7165E5160D04 18 | 19 | 20 | -------------------------------------------------------------------------------- /Snippets/qWarning (warn).tmSnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | qWarning("$1"${1/[^%]*(%)?.*/(?1:, :\);)/}$2${1/[^%]*(%)?.*/(?1:\);)/} 7 | name 8 | qWarning(...) 9 | scope 10 | source.c++.qt 11 | tabTrigger 12 | warn 13 | uuid 14 | 611BEDBC-30B4-4019-B29C-A91ECD480051 15 | 16 | 17 | -------------------------------------------------------------------------------- /Support/AddFile/rb_main.rb: -------------------------------------------------------------------------------- 1 | # 2 | # rb_main.rb 3 | # AddFile 4 | # 5 | # Created by Michail Pishchagin on 27.10.07. 6 | # Copyright (c) 2007 __MyCompanyName__. All rights reserved. 7 | # 8 | 9 | require 'osx/cocoa' 10 | 11 | def rb_main_init 12 | path = OSX::NSBundle.mainBundle.resourcePath.fileSystemRepresentation 13 | rbfiles = Dir.entries(path).select {|x| /\.rb\z/ =~ x} 14 | rbfiles -= [ File.basename(__FILE__) ] 15 | rbfiles.each do |path| 16 | require( File.basename(path) ) 17 | end 18 | end 19 | 20 | if $0 == __FILE__ then 21 | rb_main_init 22 | OSX.NSApplicationMain(0, nil) 23 | end 24 | -------------------------------------------------------------------------------- /Snippets/connect.tmSnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | connect( ${1:sender}, SIGNAL(${2:signal}(${3})), ${4:reciever}, ${5:SLOT}(${6:slot}($3)) );$0 7 | name 8 | connect 9 | scope 10 | source.c++.qt 11 | tabTrigger 12 | con 13 | uuid 14 | 8D9D10AE-0531-11DB-8509-0011242E4184 15 | 16 | 17 | -------------------------------------------------------------------------------- /Snippets/QTimer::singleShot(___).tmSnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | QTimer::singleShot(${1:0}, ${2:this}, SLOT(${3:slotName()})) 7 | name 8 | QTimer::singleShot(...) 9 | scope 10 | source.c++.qt 11 | tabTrigger 12 | singleShot 13 | uuid 14 | 466A5E55-F2E9-4542-8CE7-5799B4DC9BF8 15 | 16 | 17 | -------------------------------------------------------------------------------- /Snippets/disconnect.tmSnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | disconnect( ${1:sender}, SIGNAL(${2:signal}(${3})), ${4:reciever}, ${5:SLOT}(${6:slot}($3)) );$0 7 | name 8 | disconnect 9 | scope 10 | source.c++.qt 11 | tabTrigger 12 | dis 13 | uuid 14 | 48A79C21-0832-11DB-9495-0011242E4184 15 | 16 | 17 | -------------------------------------------------------------------------------- /Support/AddFile/build/Release/AddFile.app/Contents/Resources/rb_main.rb: -------------------------------------------------------------------------------- 1 | # 2 | # rb_main.rb 3 | # AddFile 4 | # 5 | # Created by Michail Pishchagin on 27.10.07. 6 | # Copyright (c) 2007 __MyCompanyName__. All rights reserved. 7 | # 8 | 9 | require 'osx/cocoa' 10 | 11 | def rb_main_init 12 | path = OSX::NSBundle.mainBundle.resourcePath.fileSystemRepresentation 13 | rbfiles = Dir.entries(path).select {|x| /\.rb\z/ =~ x} 14 | rbfiles -= [ File.basename(__FILE__) ] 15 | rbfiles.each do |path| 16 | require( File.basename(path) ) 17 | end 18 | end 19 | 20 | if $0 == __FILE__ then 21 | rb_main_init 22 | OSX.NSApplicationMain(0, nil) 23 | end 24 | -------------------------------------------------------------------------------- /Preferences/qmake Typing Pairs.tmPreferences: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | name 6 | qmake Typing Pairs 7 | scope 8 | source.qmake 9 | settings 10 | 11 | smartTypingPairs 12 | 13 | 14 | " 15 | " 16 | 17 | 18 | 19 | uuid 20 | 2669156F-0951-4BF3-AD31-DC390F6B0632 21 | 22 | 23 | -------------------------------------------------------------------------------- /Snippets/main (qmain).tmSnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | #include <QApplication> 7 | 8 | int main (int argc, char *argv[]) 9 | { 10 | QApplication app(argc, argv); 11 | $0 12 | return app.exec(); 13 | } 14 | name 15 | main() 16 | scope 17 | source.c++.qt 18 | tabTrigger 19 | qmain 20 | uuid 21 | 1BE36C25-5F22-45EE-9339-C0A3D1EACEA2 22 | 23 | 24 | -------------------------------------------------------------------------------- /Snippets/Q_PROPERTY.tmSnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | Q_PROPERTY( ${1:type} ${2:name} READ ${3:$2} ${4:WRITE ${5:${2/.*/set\u$0/}} ${6:RESET ${7:${2/.*/reset\u$0/}} DESIGNABLE ${8:true} SCRIPTABLE ${9:true} STORED ${10:true} }})$0 7 | name 8 | Q_PROPERTY 9 | scope 10 | source.c++.qt 11 | tabTrigger 12 | qp 13 | uuid 14 | 204E5213-CAF7-47FD-B272-34997632832D 15 | 16 | 17 | -------------------------------------------------------------------------------- /Preferences/qmake Comments.tmPreferences: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | name 6 | qmake Comments 7 | scope 8 | source.qmake 9 | settings 10 | 11 | shellVariables 12 | 13 | 14 | name 15 | TM_COMMENT_START 16 | value 17 | # 18 | 19 | 20 | 21 | uuid 22 | 1252E454-CFC7-4FB1-80C3-33A267BFB3FF 23 | 24 | 25 | -------------------------------------------------------------------------------- /Support/lib/camelcase.rb: -------------------------------------------------------------------------------- 1 | # copied from "Source -> Toggle CamelCase / underscore_delimited" command 2 | 3 | # [hH]otFlamingCats -> hot_flaming_cats 4 | def camelcase_to_underscore(word) 5 | word[0] = word[0].chr.downcase 6 | word.gsub(/([A-Z])/, "_\\1").downcase 7 | end 8 | 9 | # hot_flaming_cats -> hotFlamingCats 10 | def underscore_to_camelcase(word) 11 | word.gsub(/\_(.)/) {|c| c[1].chr.upcase} 12 | end 13 | 14 | # hot_flaming_cats.cpp -> HotFlamingCats 15 | def underscore_to_classname(word) 16 | word = underscore_to_camelcase(word) 17 | word[0] = word[0].chr.upcase 18 | word.split('.')[0..-2].join('.') 19 | end 20 | 21 | def is_camel(word) 22 | word.match(/[A-Z]/) ? true : false 23 | end 24 | -------------------------------------------------------------------------------- /Preferences/Qt C++ Folding.tmPreferences: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | name 6 | C++ Qt Folding 7 | scope 8 | source.c++.qt 9 | settings 10 | 11 | foldingStartMarker 12 | (?x) 13 | /\*\*(?!\*) 14 | |^(?![^{]*?//|[^{]*?/\*(?!.*?\*/.*?\{)).*?\{\s*($|//|/\*(?!.*?\*/.*\S)) 15 | 16 | foldingStopMarker 17 | (?<!\*)\*\*/|^\s*\} 18 | 19 | uuid 20 | D64B58B1-E356-4A9B-A3F5-7296B518A2B8 21 | 22 | 23 | -------------------------------------------------------------------------------- /Commands/Class Declaration.tmCommand: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beforeRunningCommand 6 | nop 7 | command 8 | ruby18 "$TM_BUNDLE_SUPPORT/bin/insert_class.rb" 9 | input 10 | none 11 | name 12 | Class 13 | output 14 | insertAsSnippet 15 | scope 16 | source.c++.qt 17 | tabTrigger 18 | qclass 19 | uuid 20 | 1DB2A2E8-5E25-4442-9DE1-335E09854C9F 21 | 22 | 23 | -------------------------------------------------------------------------------- /Support/lib/rails/unobtrusive_logger.rb: -------------------------------------------------------------------------------- 1 | # Copyright: 2 | # (c) 2006 syncPEOPLE, LLC. 3 | # Visit us at http://syncpeople.com/ 4 | # Author: Duane Johnson (duane.johnson@gmail.com) 5 | # Description: 6 | # Simple delegate class for Logger. Its purpose is to prevent littering the 7 | # home directory with log files. Useful for testing / development of bundles. 8 | 9 | require 'logger' 10 | 11 | class UnobtrusiveLogger 12 | attr_accessor :filename, :logger 13 | def initialize(filename) 14 | @filename = filename 15 | @logger = nil 16 | end 17 | def method_missing(method, *args) 18 | @logger = Logger.new(@filename) unless @logger 19 | @logger.send(method, *args) 20 | end 21 | end 22 | 23 | $logger = UnobtrusiveLogger.new("/tmp/textmate_qt_bundle.log") 24 | -------------------------------------------------------------------------------- /Commands/Class Declaration with Doxygen.tmCommand: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beforeRunningCommand 6 | nop 7 | command 8 | ruby18 "$TM_BUNDLE_SUPPORT/bin/insert_class.rb" doxygen 9 | input 10 | none 11 | name 12 | Class (with Doxygen) 13 | output 14 | insertAsSnippet 15 | scope 16 | source.c++.qt 17 | tabTrigger 18 | qclassdoxy 19 | uuid 20 | BFD08AAF-3AB2-4C55-9A57-2EB75ECD9CD1 21 | 22 | 23 | -------------------------------------------------------------------------------- /Commands/Add File.tmCommand: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beforeRunningCommand 6 | nop 7 | command 8 | ruby18 "$TM_BUNDLE_SUPPORT/bin/add_file.rb" 9 | fallbackInput 10 | word 11 | input 12 | selection 13 | keyEquivalent 14 | @u 15 | name 16 | Add File 17 | output 18 | replaceSelectedText 19 | scope 20 | source.qmake 21 | uuid 22 | 82073EA0-7D10-4A6C-AF49-54B29FA3AF1E 23 | 24 | 25 | -------------------------------------------------------------------------------- /Preferences/Qt C++ Indentation Rules.tmPreferences: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | name 6 | C++ Qt Indentation Rules 7 | scope 8 | source.c++.qt 9 | settings 10 | 11 | decreaseIndentPattern 12 | ^(.*\*/)?\s*\}([^}{"']*\{)?[;\s]*$|^\s*((public|private|protected)(\s+slots)?|signals):\s*$ 13 | increaseIndentPattern 14 | ^.*\{[^}"']*$|^\s*((public|private|protected)(\s+slots)?|signals):\s*$ 15 | 16 | uuid 17 | 26796298-41FC-40F6-8B8F-D896A0EF2BDC 18 | 19 | 20 | -------------------------------------------------------------------------------- /Commands/Display Documentation.tmCommand: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beforeRunningCommand 6 | nop 7 | command 8 | ruby18 "$TM_BUNDLE_SUPPORT/bin/search.rb" input 9 | fallbackInput 10 | word 11 | input 12 | selection 13 | keyEquivalent 14 | ^@h 15 | name 16 | Display Documentation 17 | output 18 | showAsHTML 19 | scope 20 | source.c++.qt 21 | uuid 22 | D4885A64-9FF5-43BA-8D5E-AEB71E9E08C2 23 | 24 | 25 | -------------------------------------------------------------------------------- /Commands/qmake Manual.tmCommand: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beforeRunningCommand 6 | nop 7 | command 8 | echo "<meta http-equiv='Refresh' content='0;URL=file://${TM_QT_DOC_DIR:=/usr/local/Trolltech/Qt-4.2.0/doc/html}/qmake-manual.html'>" 9 | input 10 | none 11 | keyEquivalent 12 | ^h 13 | name 14 | Show qmake Manual 15 | output 16 | showAsHTML 17 | scope 18 | source.qmake 19 | uuid 20 | E91A719F-109D-4243-B943-A85F9FECEBE0 21 | 22 | 23 | -------------------------------------------------------------------------------- /Commands/Display Fuzzy Documentation.tmCommand: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beforeRunningCommand 6 | nop 7 | command 8 | ruby18 "$TM_BUNDLE_SUPPORT/bin/search.rb" fuzzy input 9 | fallbackInput 10 | word 11 | input 12 | selection 13 | keyEquivalent 14 | ^~@h 15 | name 16 | Display Fuzzy Documentation 17 | output 18 | showAsHTML 19 | scope 20 | source.c++.qt 21 | uuid 22 | F34F4BC0-C09C-4DAC-9B0C-EE7173964090 23 | 24 | 25 | -------------------------------------------------------------------------------- /Commands/Implementation to Declaration.tmCommand: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beforeRunningCommand 6 | nop 7 | command 8 | ruby18 "$TM_BUNDLE_SUPPORT/bin/implementation_to_declaration.rb" 9 | fallbackInput 10 | line 11 | input 12 | selection 13 | keyEquivalent 14 | @u 15 | name 16 | Implementation to Declaration 17 | output 18 | insertAsSnippet 19 | scope 20 | source.c++.qt 21 | uuid 22 | CC1A1191-7451-4806-B326-459416C8894A 23 | 24 | 25 | -------------------------------------------------------------------------------- /Support/AddFile/build/Release/AddFile.app/Contents/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | AddFile 9 | CFBundleIdentifier 10 | com.apple.rubycocoa.AddFileApp 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundlePackageType 14 | APPL 15 | CFBundleShortVersionString 16 | 1.0 17 | CFBundleSignature 18 | ???? 19 | CFBundleVersion 20 | 1.0 21 | NSMainNibFile 22 | MainMenu 23 | NSPrincipalClass 24 | NSApplication 25 | 26 | 27 | -------------------------------------------------------------------------------- /Support/AddFile/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | AddFile 9 | CFBundleIconFile 10 | 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundlePackageType 14 | APPL 15 | CFBundleSignature 16 | ???? 17 | CFBundleVersion 18 | 1.0 19 | NSMainNibFile 20 | MainMenu 21 | NSPrincipalClass 22 | NSApplication 23 | CFBundleIdentifier 24 | com.apple.rubycocoa.AddFileApp 25 | CFBundleShortVersionString 26 | 1.0 27 | 28 | 29 | -------------------------------------------------------------------------------- /Snippets/qmake Project template stub.tmSnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | TEMPLATE = app 7 | CONFIG += qt 8 | QT += gui 9 | SOURCES += ${1:main.cpp} 10 | 11 | windows { 12 | # otherwise we would get 'unresolved external _WinMainCRTStartup' 13 | # when compiling with MSVC 14 | MOC_DIR = _moc 15 | OBJECTS_DIR = _obj 16 | UI_DIR = _ui 17 | RCC_DIR = _rcc 18 | } 19 | !windows { 20 | MOC_DIR = .moc 21 | OBJECTS_DIR = .obj 22 | UI_DIR = .ui 23 | RCC_DIR = .rcc 24 | } 25 | 26 | $0 27 | name 28 | qmake Project template stub 29 | scope 30 | source.qmake 31 | tabTrigger 32 | stub 33 | uuid 34 | C129BDA0-E887-4404-B8B5-3F6086468A5E 35 | 36 | 37 | -------------------------------------------------------------------------------- /Commands/Declaration to Implementation.tmCommand: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beforeRunningCommand 6 | nop 7 | command 8 | # Converts method declarations to their 9 | # out-of-class-declaration implementations. 10 | # 11 | # Could be applied to bunch of methods in 12 | # selection. 13 | 14 | ruby18 "$TM_BUNDLE_SUPPORT/bin/declaration_to_implementation.rb" 15 | fallbackInput 16 | line 17 | input 18 | selection 19 | keyEquivalent 20 | @u 21 | name 22 | Declaration to Implementation 23 | output 24 | insertAsSnippet 25 | scope 26 | source.c++.qt 27 | uuid 28 | C4517F03-DB1A-434E-BF29-F13DA337B20F 29 | 30 | 31 | -------------------------------------------------------------------------------- /Commands/Insert Call to Super.tmCommand: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beforeRunningCommand 6 | nop 7 | command 8 | # Inserts a call to the same metod of superclass. 9 | # Since figuring a superclass is a bit tricky, it 10 | # only works when class declaration exists in the 11 | # same file, and prior to the current line. If 12 | # it's unable to find superclass, QWidget is used. 13 | 14 | ruby18 "$TM_BUNDLE_SUPPORT/bin/insert_super.rb" 15 | input 16 | document 17 | name 18 | Insert Call to Super 19 | output 20 | insertAsSnippet 21 | scope 22 | source.c++.qt 23 | tabTrigger 24 | super 25 | uuid 26 | 02131A74-BB30-4A92-B8D0-BDD96FF9CD88 27 | 28 | 29 | -------------------------------------------------------------------------------- /Commands/Documentation for Word : Selection (fuzzy).tmCommand: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beforeRunningCommand 6 | nop 7 | command 8 | # Similiar to entering query in the Qt Assistant's 9 | # "Look For:" field, then collecting topics for 10 | # each displayed method, and then displaying an 11 | # option to pick one of them using text box. 12 | 13 | ruby18 "$TM_BUNDLE_SUPPORT/bin/search.rb" fuzzy 14 | fallbackInput 15 | word 16 | input 17 | selection 18 | keyEquivalent 19 | ^~h 20 | name 21 | Fuzzy Documentation for Word / Selection 22 | output 23 | showAsHTML 24 | scope 25 | source.c++.qt 26 | uuid 27 | C6BD2114-7620-4C35-A9B5-F44CA3291004 28 | 29 | 30 | -------------------------------------------------------------------------------- /Commands/Build & Run.tmCommand: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beforeRunningCommand 6 | nop 7 | command 8 | #!/bin/sh 9 | "${TM_BUNDLE_SUPPORT}/bin/build_qt_project.rb" && "${TM_BUNDLE_SUPPORT}/bin/run_qt_project.rb" 10 | input 11 | none 12 | inputFormat 13 | text 14 | keyEquivalent 15 | @R 16 | name 17 | Build & Run 18 | outputCaret 19 | afterOutput 20 | outputFormat 21 | html 22 | outputLocation 23 | newWindow 24 | scope 25 | source.c++.qt, source.qmake 26 | semanticClass 27 | process.build-and-run.qt 28 | uuid 29 | 22F431D0-0CB5-4CAB-951F-8C0E7396891F 30 | version 31 | 2 32 | 33 | 34 | -------------------------------------------------------------------------------- /Commands/Build.tmCommand: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beforeRunningCommand 6 | nop 7 | command 8 | #!/usr/bin/env bash 9 | [[ -f "${TM_SUPPORT_PATH}/lib/bash_init.sh" ]] && . "${TM_SUPPORT_PATH}/lib/bash_init.sh" 10 | 11 | "${TM_BUNDLE_SUPPORT}/bin/build_qt_project.rb" 12 | input 13 | none 14 | inputFormat 15 | text 16 | keyEquivalent 17 | @b 18 | name 19 | Build 20 | outputCaret 21 | afterOutput 22 | outputFormat 23 | html 24 | outputLocation 25 | newWindow 26 | scope 27 | source.c++.qt, source.qmake 28 | semanticClass 29 | process.build.c++.qt 30 | uuid 31 | AAAD64D1-8C69-4645-853E-B6DD3D04AC67 32 | version 33 | 2 34 | 35 | 36 | -------------------------------------------------------------------------------- /Commands/Run Application.tmCommand: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beforeRunningCommand 6 | nop 7 | command 8 | #!/usr/bin/env bash 9 | [[ -f "${TM_SUPPORT_PATH}/lib/bash_init.sh" ]] && . "${TM_SUPPORT_PATH}/lib/bash_init.sh" 10 | 11 | "${TM_BUNDLE_SUPPORT}/bin/run_qt_project.rb" 12 | input 13 | none 14 | inputFormat 15 | text 16 | keyEquivalent 17 | @r 18 | name 19 | Run 20 | outputCaret 21 | afterOutput 22 | outputFormat 23 | text 24 | outputLocation 25 | toolTip 26 | scope 27 | source.c++.qt, source.qmake 28 | semanticClass 29 | process.run.c++.qt 30 | uuid 31 | 97FDD49E-0E1B-4B68-9614-E57A5804C247 32 | version 33 | 2 34 | 35 | 36 | -------------------------------------------------------------------------------- /Support/bin/insert_super.rb: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby18 2 | require ENV['TM_BUNDLE_SUPPORT'] + '/lib/rails_bundle_tools' 3 | require ENV['TM_BUNDLE_SUPPORT'] + '/lib/ctags' 4 | require ENV['TM_BUNDLE_SUPPORT'] + '/lib/common' 5 | 6 | def closest_function_tag(tags, line_number) 7 | functions = [] 8 | tags.functions.each_value do |f| 9 | f.each do |t| 10 | next if !t.path.nil? 11 | functions << t 12 | end 13 | end 14 | return closest_tag(functions, line_number) 15 | end 16 | 17 | def parse_signature(signature) 18 | args = signature_to_arguments(signature) 19 | 20 | index = 2 # first argument will get index 3 21 | args.split(",").map do |a| 22 | index += 1 23 | "\${#{index}:#{a.strip}}" 24 | end.join(", ") 25 | end 26 | 27 | def insert_super(tags) 28 | tag = closest_function_tag(tags, TextMate.line_number) 29 | klass = tags.class_parent(tag ? tag.klass : nil) || "Class" 30 | method = tag ? tag.name : nil || "method" 31 | signature = tag ? tag.signature : nil || "()" 32 | signature = parse_signature(signature) 33 | return "\${1:#{klass}::}\${2:#{method}}(#{signature})" 34 | end 35 | 36 | if __FILE__ == $0 37 | print insert_super(CTags.run) 38 | end 39 | -------------------------------------------------------------------------------- /README.mdown: -------------------------------------------------------------------------------- 1 | # Installation 2 | 3 | You can install this bundle in TextMate by opening the preferences and going to the bundles tab. After installation it will be automatically updated for you. 4 | 5 | # General 6 | 7 | * [Bundle Styleguide](http://kb.textmate.org/bundle_styleguide) — _before you make changes_ 8 | * [Commit Styleguide](http://kb.textmate.org/commit_styleguide) — _before you send a pull request_ 9 | * [Writing Bug Reports](http://kb.textmate.org/writing_bug_reports) — _before you report an issue_ 10 | 11 | # License 12 | 13 | If not otherwise specified (see below), files in this repository fall under the following license: 14 | 15 | Permission to copy, use, modify, sell and distribute this 16 | software is granted. This software is provided "as is" without 17 | express or implied warranty, and with no claim as to its 18 | suitability for any purpose. 19 | 20 | An exception is made for files in readable text which contain their own license information, or files where an accompanying file exists (in the same directory) with a “-license” suffix added to the base-name name of the original file, and an extension of txt, html, or similar. For example “tidy” is accompanied by “tidy-license.txt”. -------------------------------------------------------------------------------- /Commands/Declaration to Implementation (with Doxygen).tmCommand: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beforeRunningCommand 6 | nop 7 | command 8 | # Converts method declarations to their 9 | # out-of-class-declaration implementations 10 | # with Doxygen placeholders in place. 11 | # 12 | # Could be applied to bunch of methods in 13 | # selection. 14 | # 15 | # It's possible to override Doxygen placeholders 16 | # after specifying name of the class. 17 | 18 | ruby18 "$TM_BUNDLE_SUPPORT/bin/declaration_to_implementation.rb" doxygen 19 | fallbackInput 20 | line 21 | input 22 | selection 23 | keyEquivalent 24 | @u 25 | name 26 | Declaration to Implementation (with Doxygen) 27 | output 28 | insertAsSnippet 29 | scope 30 | source.c++.qt 31 | uuid 32 | 97D13B6C-9CC2-4CAD-8CD3-80DC9CBC1968 33 | 34 | 35 | -------------------------------------------------------------------------------- /Commands/Reformat Block Comment.tmCommand: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beforeRunningCommand 6 | nop 7 | command 8 | #!/usr/bin/env ruby18 9 | # By Allan Odgaard: 10 | # http://macromates.com/blog/archives/2006/04/12/customization-screencast/ 11 | 12 | txt = STDIN.read.gsub(%r{\A/|\*/\z}, '') 13 | txt = txt.gsub(/^[ \t]*\*[ \t]*/, '') 14 | txt = %x{ fmt <<< '#{txt.gsub(/'/, "'\\\\''")}' }.chomp 15 | txt = txt.gsub(/[$`\\]/, '\\\\\0') 16 | txt = txt.sub(/(\n(?=\n))?(\n*)\z/, '\1$0\2') 17 | print "/* " + txt.to_a.join(' * ') + " */" 18 | fallbackInput 19 | scope 20 | input 21 | selection 22 | keyEquivalent 23 | ^q 24 | name 25 | Reformat Block Comment 26 | output 27 | insertAsSnippet 28 | scope 29 | source.c++.qt comment.block.c 30 | uuid 31 | 68EA4D87-31FA-4492-9645-925128AB6C43 32 | 33 | 34 | -------------------------------------------------------------------------------- /Support/bin/implementation_to_declaration.rb: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby18 2 | require ENV['TM_BUNDLE_SUPPORT'] + '/lib/rails_bundle_tools' 3 | require ENV['TM_BUNDLE_SUPPORT'] + '/lib/ctags' 4 | require ENV['TM_BUNDLE_SUPPORT'] + '/lib/common' 5 | 6 | input = $stdin.readlines 7 | 8 | $indent = "" 9 | $indent = $1 if input[0] =~ /^(\s+)[^\s]?/ 10 | 11 | if input.length <= 1 and (input[0].nil? or input[0] =~ /^\s*$/) 12 | input += `pbpaste`.split("\n") 13 | end 14 | 15 | $cpp_mode = TextMate.scope =~ /source\.(c|objc)\+\+/ 16 | 17 | input = input.map do |line| 18 | line 19 | end.join("\n") 20 | 21 | def print_function(tag) 22 | r = [] 23 | 24 | if !tag.result_type.nil? 25 | r << "#$indent#{tag.result_type}#{tag.name}#{signature_to_implementation_signature(tag.signature)};" 26 | end 27 | return r 28 | end 29 | 30 | def implementation_to_declaration(tags) 31 | r = [] 32 | functions = [] 33 | tags.functions.each_value do |f| 34 | f.each { |t| functions << t } 35 | end 36 | functions.sort! { |a, b| a.line <=> b.line } 37 | functions.each do |e| 38 | r += print_function(e) 39 | end 40 | return r 41 | end 42 | 43 | if __FILE__ == $0 44 | process_ctags_function(input) do |inp| 45 | implementation_to_declaration(inp) 46 | end 47 | end 48 | -------------------------------------------------------------------------------- /Preferences/qmake Completitions.tmPreferences: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | name 6 | qmake Completitions 7 | scope 8 | source.qmake 9 | settings 10 | 11 | completions 12 | 13 | CONFIG 14 | DEFINES 15 | DEF_FILE 16 | DESTDIR 17 | DISTFILES 18 | DLLDESTDIR 19 | FORMS 20 | FORMS3 21 | HEADERS 22 | INCLUDEPATH 23 | LEXSOURCES 24 | LIBS 25 | MOC_DIR 26 | OBJECTS_DIR 27 | RCC_DIR 28 | REQUIRES 29 | SOURCES 30 | SUBDIRS 31 | TARGET 32 | TEMPLATE 33 | TRANSLATIONS 34 | UI_DIR 35 | UI_HEADERS_DIR 36 | UI_SOURCES_DIR 37 | VERSION 38 | YACCSOURCES 39 | 40 | 41 | uuid 42 | 8B8C14B7-9E15-448E-AE1B-BE87E6069F40 43 | 44 | 45 | -------------------------------------------------------------------------------- /Support/lib/common.rb: -------------------------------------------------------------------------------- 1 | def signature_to_arguments(signature) 2 | sig = signature_to_implementation_signature(signature) 3 | if sig =~ /\((.+)\)/ 4 | $1.split(",").map do |e| 5 | e.split(" ")[-1].gsub(/[*&]/, '') 6 | end.join(", ") 7 | else 8 | "" 9 | end 10 | end 11 | 12 | def signature_to_implementation_signature(signature) 13 | if signature =~ /\((.*)\)(.*)$/ 14 | suffix = $2.strip 15 | signature = $1.split(",").map do |a| 16 | a.gsub(/\s+/, " ").gsub(/=.+/, "").strip 17 | end.join(", ") 18 | 19 | "(#{signature}) #{suffix}".strip 20 | else 21 | "" 22 | end 23 | end 24 | 25 | def closest_tag(tags, line_number) 26 | tag = nil 27 | tags.each do |t| 28 | next if (line_number - t.line) < 0 29 | tag = t if tag.nil? || (line_number - t.line) < (line_number - tag.line) 30 | end 31 | return tag 32 | end 33 | 34 | def temp_file(name) 35 | temp = `mktemp -t #{name}`.chomp 36 | File.delete(temp) 37 | return temp 38 | end 39 | 40 | def process_ctags_function(input) 41 | # Due to the way TextMate passes strings, if it passed 42 | # only one string without newline, but thought that it 43 | # selected the entire line (Input: Selected Text or Line), 44 | # then it will append additonal newline to the end 45 | extra_newline = "" 46 | input.each { |line| extra_newline = "\n" if line.chomp != line } 47 | 48 | print yield(CTags.parse_data(input)).join("\n").chomp + extra_newline 49 | end -------------------------------------------------------------------------------- /Support/lib/rails/text_mate.rb: -------------------------------------------------------------------------------- 1 | # Copyright: 2 | # (c) 2006 syncPEOPLE, LLC. 3 | # Visit us at http://syncpeople.com/ 4 | # Author: Duane Johnson (duane.johnson@gmail.com) 5 | # Description: 6 | # Helper module for accesing TextMate facilities such as environment variables. 7 | 8 | module TextMate 9 | class < 2 | 3 | 4 | 5 | beforeRunningCommand 6 | nop 7 | command 8 | #!/usr/bin/env bash 9 | [[ -f "${TM_SUPPORT_PATH}/lib/bash_init.sh" ]] && . "${TM_SUPPORT_PATH}/lib/bash_init.sh" 10 | 11 | # Similiar to entering query in the Qt Assistant's 12 | # "Look For:" field, and pressing enter. If 13 | # there are multiple matches, there's an option 14 | # to select one of them. 15 | 16 | ruby18 "$TM_BUNDLE_SUPPORT/bin/search.rb" 17 | fallbackInput 18 | word 19 | input 20 | selection 21 | inputFormat 22 | text 23 | keyEquivalent 24 | ^h 25 | name 26 | Documentation for Word / Selection 27 | outputCaret 28 | afterOutput 29 | outputFormat 30 | html 31 | outputLocation 32 | newWindow 33 | scope 34 | source.c++.qt 35 | semanticClass 36 | lookup.define.c++.qt 37 | uuid 38 | DAD33E78-4FEF-43EB-A672-790E7140855A 39 | version 40 | 2 41 | 42 | 43 | -------------------------------------------------------------------------------- /Macros/Class Declaration with Q_OBJECT.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | commands 6 | 7 | 8 | command 9 | moveToBeginningOfLine: 10 | 11 | 12 | command 13 | selectBlock: 14 | 15 | 16 | command 17 | moveToEndOfDocumentAndModifySelection: 18 | 19 | 20 | argument 21 | 22 | command 23 | insert_class.rb q_object 24 | input 25 | selection 26 | output 27 | insertAsSnippet 28 | 29 | command 30 | executeCommandWithOptions: 31 | 32 | 33 | command 34 | centerSelectionInVisibleArea: 35 | 36 | 37 | keyEquivalent 38 | 39 | name 40 | Class Declaration with Q_OBJECT 41 | scope 42 | source.c++.qt 43 | scopeType 44 | local 45 | tabTrigger 46 | [press tab twice to generate Q_OBJECT] 47 | uuid 48 | 04CD802D-9EFD-49D3-B4A3-7AF6A6BA1430 49 | 50 | 51 | -------------------------------------------------------------------------------- /Support/lib/run_helper.rb: -------------------------------------------------------------------------------- 1 | class Runner 2 | def self.target(dir = ".") 3 | if not File.exists? "#{dir}/Makefile" 4 | raise "No Makefile found in #{dir}." 5 | end 6 | 7 | if not File.readlines("#{dir}/Makefile").find { |i| i =~ /^TARGET\s+\=\s+([^\s][\w\-\.\/\s]+)\s*$/ } 8 | raise "Unable to find TARGET in #{dir}/Makefile." 9 | end 10 | 11 | $1 12 | end 13 | 14 | def self.__shell_escape(str) 15 | str.gsub(/[{}()`'"\\; $<>&]/, '\\\\\&') 16 | end 17 | 18 | # :no_terminal -- runs stand alone 19 | # :pre_cmd -- command that runs prior to target 20 | # :post_cmd -- runs after target 21 | def self.run(target, dir, options = {}) 22 | dir = __shell_escape(File.expand_path(dir)) 23 | file = __shell_escape(target) 24 | env = "env DYLD_FRAMEWORK_PATH=#{dir} DYLD_LIBRARY_PATH=#{dir}" 25 | 26 | if options[:no_terminal] 27 | cmd = "cd #{dir}; #{env} open ./#{file}" 28 | %x{#{cmd}} 29 | else 30 | pre = options[:pre_cmd] || "" 31 | post = options[:post_cmd] || "" 32 | cmd = "clear; cd #{dir}; #{pre}; #{env} ./#{file}; #{post};" 33 | cmd += "echo -ne \\\\n\\\\nPress RETURN to Continue...; read foo;" 34 | 35 | # Executes after target is terminated 36 | cmd += 'osascript &>/dev/null' 37 | cmd += ' -e "tell app \"TextMate\" to activate"' 38 | cmd += ' -e "tell app \"Terminal\" to close first window" &' 39 | 40 | # This is run before the first command finishes 41 | %x{osascript \ 42 | -e 'tell app "Terminal"' \ 43 | -e 'activate' \ 44 | -e 'do script "#{cmd.gsub(/[\\"]/, '\\\\\\0')}"' \ 45 | -e 'set position of first window to { 100, 100 }' \ 46 | -e 'set custom title of first window to "#{file}"' \ 47 | -e 'end tell' 48 | } 49 | end 50 | end 51 | end 52 | -------------------------------------------------------------------------------- /Support/lib/rails/misc.rb: -------------------------------------------------------------------------------- 1 | class String 2 | # Gets the line number of character +i+ (0-base index) 3 | def line_from_index(i) 4 | slice(0..i).count("\n") 5 | end 6 | 7 | # Gets the index of the beginning of line number +l+ (0-base index) 8 | def index_from_line(l) 9 | to_a.slice(0...l).join.length 10 | end 11 | 12 | # Temporarily replace "strings" with (parens) and :symbols with .notation. 13 | # Useful before a find_nearest_string_or_symbol search when method calls have 14 | # special meaning for lists of strings or symbols (e.g. javascript_include_tag) 15 | def unstringify_hash_arguments 16 | gsub(/'([^']+?)'(?=\s*=>)/, '(\1)'). 17 | gsub(/"([^"]+?)"(?=\s*=>)/, '(\1)'). 18 | gsub(/:(\w+)(?=\s*=>)/, '.\1'). 19 | gsub(/(=>\s*)'([^']+?)'/, '\1(\2)'). 20 | gsub(/(=>\s*)"([^"]+?)"/, '\1(\2)'). 21 | gsub(/(=>\s*):(\w+)/, '\1.\2') 22 | end 23 | 24 | # Finds the nearest "string" or :symbol to +column_number+ 25 | def find_nearest_string_or_symbol(column_number) 26 | re = /'([^']+?)'|"([^"]+)"|:([a-zA-Z0-9_]+)\b/ 27 | matching_tokens = scan(re).flatten.compact 28 | # Which token is nearest to column_number? 29 | nearest_token = nearest_index = distance = nil 30 | matching_tokens.each do |token| 31 | i = index(token, column_number) 32 | if i and (distance.nil? or (column_number - i).abs < distance) 33 | nearest_token = token 34 | nearest_index = i 35 | distance = (column_number - i).abs 36 | end 37 | 38 | i = rindex(token, column_number) 39 | if i and (distance.nil? or ((column_number - i).abs - token.length) < distance) 40 | nearest_token = token 41 | nearest_index = i 42 | distance = (column_number - i).abs - token.length 43 | end 44 | end 45 | (nearest_token.nil?) ? nil : [nearest_token, nearest_index] 46 | end 47 | end 48 | 49 | -------------------------------------------------------------------------------- /Support/bin/insert_class.rb: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby18 2 | require ENV['TM_BUNDLE_SUPPORT'] + '/lib/rails_bundle_tools' 3 | 4 | # TODO: camel-case the file name. So 'foo_bar.h' would name the class as 'FooBar' 5 | 6 | q_object = ARGV.find { |a| a == "q_object" } 7 | 8 | if q_object 9 | input = $stdin.readlines 10 | input.insert(1, "\tQ_OBJECT") 11 | input.insert(2, "\n") 12 | 13 | found_include = false 14 | include_file = nil 15 | # add #include "file_name.moc" 16 | file_name = ENV['TM_FILEPATH'].split("/").last if ENV['TM_FILEPATH'] 17 | if !file_name.nil? and file_name.split(".").last == "cpp" 18 | moc_file = file_name.gsub(/\.cpp$/, ".moc") 19 | include_file = "\#include \"#{moc_file}\"" 20 | else 21 | include_file = "" 22 | end 23 | 24 | curly_brackets = 0 25 | output = Array.new 26 | input.each_with_index do |line, index| 27 | line.gsub("{") { curly_brackets += 1 } 28 | line.gsub("}") { curly_brackets -= 1 } 29 | if curly_brackets == 0 30 | curly_brackets = 666 31 | output[index-1] = "\${0:#{output[index-1]}}" 32 | end 33 | 34 | found_include = true if line =~ /#{Regexp.quote(include_file)}/ 35 | line.gsub!("[press tab twice to generate Q_OBJECT]", "") 36 | output << line.chomp 37 | end 38 | 39 | output << "" << include_file << "" if !found_include 40 | 41 | print output.join("\n") 42 | exit 0 43 | end 44 | 45 | doxygen = ARGV.find { |a| a == "doxygen" } 46 | 47 | r = Array.new 48 | if doxygen 49 | r << "/*" + TextMate.doxygen_style 50 | r << " * \\class \${1}" 51 | r << " * \\brief " 52 | r << " */" 53 | end 54 | 55 | r << "class \${1:ClassName} : public \${2:QObject}" 56 | r << "{" 57 | r << " public:" 58 | r << " \${1}(\${3:QObject *parent = 0});" 59 | r << " ~\${1}();" 60 | r << "" 61 | r << " private:" 62 | r << "};\${9: [press tab twice to generate Q_OBJECT]}" 63 | 64 | print r.join("\n") -------------------------------------------------------------------------------- /Support/bin/declaration_to_implementation.rb: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby18 2 | require ENV['TM_BUNDLE_SUPPORT'] + '/lib/rails_bundle_tools' 3 | require ENV['TM_BUNDLE_SUPPORT'] + '/lib/ctags' 4 | require ENV['TM_BUNDLE_SUPPORT'] + '/lib/common' 5 | 6 | input = $stdin.readlines 7 | 8 | $indent = "" 9 | $indent = $1 if input[0] =~ /^(\s+)[^\s]?/ 10 | 11 | if input.length <= 1 and (input[0].nil? or input[0] =~ /^\s*$/) 12 | input += `pbpaste`.split("\n") 13 | end 14 | 15 | $cpp_mode = TextMate.scope =~ /source\.(c|objc)\+\+/ 16 | $doxygen = ARGV.find { |a| a == "doxygen" } 17 | 18 | input = input.map do |line| 19 | line.gsub!(/^\s+/, "") 20 | line.gsub!(/\b(virtual|static)\b\s*/, "") 21 | line.gsub!(/(=\s*0)?;/, "{}") 22 | # line.gsub!(/$/, "{}") 23 | end.join("\n") 24 | 25 | $doxygen_index = 10 26 | def print_function(tags, tag) 27 | r = [] 28 | if $doxygen 29 | r << "#$indent/*" + TextMate.doxygen_style 30 | r << "#$indent * \${#{$doxygen_index}:TODO}" 31 | r << "#$indent */" 32 | $doxygen_index += 1 33 | end 34 | 35 | class_regexp = "/([\\w\\d_]+::)*([\\w\\d_]+)::/$2/" 36 | 37 | if !tag.result_type.nil? 38 | t = closest_tag(tags.tags, TextMate.line_number) 39 | klass = t ? t.klass : nil 40 | class_name = "Class" 41 | class_name = underscore_to_classname(TextMate.filename) if TextMate.env(:filename) 42 | class_name = !klass.nil? ? klass : class_name 43 | class_name = "\${1:#{class_name}::}" 44 | class_name = "" if !$cpp_mode 45 | 46 | r << "#$indent#{tag.result_type}#{class_name}#{tag.name}#{signature_to_implementation_signature(tag.signature)}" 47 | elsif tag.name[0] != ?~ 48 | # Constructor 49 | parent = tags.class_parent(tag.name) || "Parent" 50 | r << "#$indent\${1:#{tag.name}::}\${1#{class_regexp}}#{signature_to_implementation_signature(tag.signature)}" 51 | r << "#$indent\t: \${2:#{parent}(#{signature_to_arguments(tag.signature)})}" 52 | else 53 | # Destructor 54 | r << "#$indent\${1:#{tag.name[1..-1]}::}~\${1#{class_regexp}}()" 55 | end 56 | r << "#$indent{" 57 | r << "#$indent\t\$0" 58 | r << "#$indent}" 59 | r << "" 60 | return r 61 | end 62 | 63 | def declaration_to_implementation(tags) 64 | global_tags = CTags.run 65 | r = [] 66 | functions = [] 67 | tags.functions.each_value do |f| 68 | f.each { |t| functions << t } 69 | end 70 | functions.sort! { |a, b| a.line <=> b.line } 71 | functions.each do |e| 72 | r += print_function(global_tags, e) 73 | end 74 | return r 75 | end 76 | 77 | if __FILE__ == $0 78 | process_ctags_function(input) do |inp| 79 | declaration_to_implementation(inp) 80 | end 81 | end 82 | -------------------------------------------------------------------------------- /Support/bin/find_qt_project.rb: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby18 2 | # Based on find_xcode_project.rb by Chris Thomas. 3 | require 'pathname' 4 | 5 | class QtProjectSearch 6 | 7 | private 8 | # FIXME Assumes the directory only contains one Qt project 9 | def self.project_in_dir(path) 10 | entries = Dir.entries(path) 11 | 12 | project = entries.detect {|entry| entry =~ /.pro$/} 13 | 14 | project ? path + "/" + project : nil 15 | end 16 | 17 | def self.project_by_walking_up( start_dir = Dir.pwd ) 18 | project = nil 19 | save_dir = start_dir 20 | current_dir = save_dir 21 | 22 | Dir.chdir( current_dir ) 23 | begin 24 | until current_dir == '/' 25 | project = project_in_dir(current_dir) 26 | break unless project.nil? 27 | 28 | Dir.chdir '..' 29 | current_dir = Dir.pwd 30 | end 31 | ensure 32 | Dir.chdir(save_dir) 33 | end 34 | 35 | project 36 | end 37 | 38 | public 39 | def self.find_project 40 | qt_project = ENV['TM_QT_PROJECT'] 41 | active_file_dir = ENV['TM_DIRECTORY'] 42 | active_project_dir = ENV['TM_PROJECT_DIRECTORY'] 43 | 44 | # Allow paths relative to TM_PROJECT_DIRECTORY 45 | if qt_project && !qt_project[%r{^/}] 46 | qt_project = active_project_dir + "/" + qt_project 47 | end 48 | 49 | # user-specified TM_QT_PROJECT overrides everything else 50 | if (qt_project.nil?) or (qt_project.empty?) 51 | 52 | # If we didn't find an qt project in the project directoy, search from current dir and upwards 53 | if (qt_project.nil?) or (qt_project.empty?) 54 | qt_project = project_by_walking_up(active_file_dir) 55 | end 56 | 57 | # If we have an open file in a saved project (or a scratch project) 58 | if ((qt_project.nil?) or (qt_project.empty?)) and 59 | ((not active_project_dir.nil?) and (not active_project_dir.empty?)) 60 | qt_project = project_in_dir(active_project_dir) 61 | end 62 | 63 | end 64 | 65 | if qt_project.nil? or qt_project.empty? 66 | raise "Didn't find a Qt project file.\nYou may want to set TM_QT_PROJECT." 67 | end 68 | 69 | qt_project 70 | end 71 | end 72 | 73 | # 74 | # if this file is executed as a shell command (i.e. not serving as a Ruby library via require), 75 | # print the file name and cd to the parent directory of the Qt project so that make 76 | # works properly. 77 | # 78 | if __FILE__ == $0 79 | begin 80 | project = QtProjectSearch.find_project 81 | Dir.chdir File.dirname(project) 82 | puts project 83 | rescue Exception => e 84 | puts e.message 85 | end 86 | end 87 | -------------------------------------------------------------------------------- /Support/bin/search.rb: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby18 2 | require ENV['TM_BUNDLE_SUPPORT'] + '/lib/rails_bundle_tools' 3 | 4 | # NOTE: In order to use this script, you must 5 | # have already run Qt Assistant application, 6 | # because assistant_search does not regenerate 7 | # indices on its own - it relies on the ones 8 | # built by Qt Assistant. 9 | 10 | # Displays Qt help in TextMate's HTML window. 11 | # 12 | # When "fuzzy" is passed on command line, fuzzy 13 | # search is performed - i.e. it displays all 14 | # topics relevant to search string, not only 15 | # the most relevant one. 16 | # 17 | # When "input" is passed on command line, 18 | # input dialog appears, and you can input 19 | # query string in it. Useful for opening documentation 20 | # on some specific topic. 21 | # 22 | # If there were error, assistant_search writes them 23 | # to stderr, which is passed directly to HTML window, 24 | # so this script only parses assistant topics. 25 | 26 | # apparently, sometimes, if there are several TextMate HTML 27 | # windows open, this function has no visible effect. 28 | # maybe I should report that to Allan. 29 | def close_browser 30 | puts '' 31 | end 32 | 33 | def redirect(url) 34 | puts "" 35 | end 36 | 37 | do_fuzzy = ARGV.find { |a| a == "fuzzy" } 38 | do_input = ARGV.find { |a| a == "input" } 39 | 40 | begin 41 | query = STDIN.readline.chomp # TextMate.selected_text || TextMate.current_word 42 | rescue 43 | query = nil 44 | end 45 | query = TextMate::UI.request_string( 46 | :title => "Documentation Search", 47 | :default => query ? query : "", 48 | :prompt => "Input search word:", 49 | :button1 => 'Search' 50 | ) if do_input 51 | 52 | if query.nil? or query.length < 1 53 | close_browser 54 | exit 55 | end 56 | 57 | text = `"#{ENV['TM_BUNDLE_SUPPORT']}/lib/assistant_search/assistant_search" "#{query}" #{do_fuzzy}` 58 | 59 | results = [] 60 | text.each_line do |line| 61 | results << [$1, $2] if line =~ /\* ([^\|]+)\|file\:(.+)$/ 62 | end 63 | 64 | def select_item(query, items) 65 | items.map! { |i| i.gsub("\"", "\\\"") } 66 | items.map! { |i| "\"#{i}\"" } 67 | o = IO.popen("/usr/bin/osascript", "w+") 68 | o.puts 'tell app "TextMate"' 69 | o.puts " choose from list { #{items.join(", ")} } " + 70 | ' with title "Choose Topic" ' + 71 | " with prompt \"Choose a topic for '#{query}'\"" 72 | o.puts 'end tell' 73 | o.close_write 74 | o.gets.chomp 75 | end 76 | 77 | if results.length == 1 78 | redirect(results[0][1]) 79 | elsif results.length > 1 80 | topic = select_item(query, results.map { |i| i[0] }) 81 | link = results.find { |i| topic == i[0] } 82 | if !link.nil? 83 | redirect(link[1]) 84 | else 85 | close_browser 86 | end 87 | end -------------------------------------------------------------------------------- /Support/AddFile/AppController.rb: -------------------------------------------------------------------------------- 1 | require 'osx/cocoa' 2 | 3 | class FileItem 4 | attr_accessor :file_name 5 | def initialize(file_name) 6 | @file_name = file_name 7 | end 8 | end 9 | 10 | class AppController < OSX::NSObject 11 | include OSX 12 | ib_outlets :search_field, :close_button, :file_list 13 | 14 | def initialize 15 | @files = [] 16 | # @file_list.window.makeKeyAndOrderFront(this) 17 | # SelectWindow(WindowRef) 18 | # makeMainWindow: 19 | end 20 | 21 | def add_pressed(sender) 22 | puts @file_list.selectedRowIndexes.to_a.map {|i| @files[i].file_name }.join(" ") 23 | quit_application 24 | end 25 | ib_action :add_pressed 26 | 27 | def close_dialog(sender) 28 | quit_application 29 | end 30 | ib_action :close_dialog 31 | 32 | # NSSearchField delegate 33 | def controlTextDidChange(aNotification) 34 | update_file_list 35 | end 36 | 37 | # NSTableView data source 38 | def numberOfRowsInTableView(tblView) 39 | @files.size 40 | end 41 | 42 | def tableView_objectValueForTableColumn_row(tblView, col, row) 43 | identifier = col.identifier 44 | file = @files[row] 45 | file.send(identifier.to_s.intern) 46 | end 47 | 48 | def tableView_setObjectValue_forTableColumn_row(tblView, obj, col, row) 49 | identifier = col.identifier 50 | file = @files[row] 51 | if obj.isKindOfClass?(NSDecimalNumber) then 52 | obj = obj.to_f 53 | else 54 | obj = obj.to_s 55 | end 56 | file.send("#{identifier}=".intern, obj) 57 | updateChangeCount(NSChangeDone) 58 | end 59 | 60 | # NSTableView delegate 61 | def tableViewSelectionDidChange(aNotification) 62 | # @deleteButton.setEnabled(@employees.size > 0 && @tableView.selectedRow != -1) 63 | end 64 | 65 | private 66 | def quit_application 67 | OSX::NSApplication.sharedApplication.terminate(self) 68 | end 69 | 70 | def update_file_list 71 | @files = matching_files 72 | @file_list.reloadData 73 | end 74 | 75 | def search_string 76 | @search_field.stringValue.to_ruby 77 | end 78 | 79 | def matching_files 80 | files = [] 81 | 82 | dir = '.' 83 | if search_string.length > 0 84 | dir = search_string.gsub(/^((?:\$\$)PWD)/, tm_directory) 85 | end 86 | 87 | dir = File.dirname(dir) if !File.directory?(dir) 88 | dir = tm_directory if dir == '.' 89 | 90 | # puts "dir = '#{dir}'" 91 | 92 | ignore = %w(.svn _darcs .obj .moc) 93 | find_cmd = "find '#{dir}' -maxdepth 1" # | " + ignore.map { |e| "grep -v #{e}" }.join("|") 94 | output = `#{find_cmd}`.split("\n") 95 | output.each do |e| 96 | # next if File.directory?(e) 97 | e.gsub!(tm_directory, '$$PWD') 98 | # puts "e = '#{e}', search_string = '#{search_string}'" 99 | next if Regexp.new(Regexp.escape(search_string)) !~ e 100 | files << FileItem.new(e) 101 | end 102 | 103 | return files 104 | end 105 | 106 | def tm_directory 107 | ENV['TM_DIRECTORY'] 108 | end 109 | end 110 | -------------------------------------------------------------------------------- /Support/AddFile/build/Release/AddFile.app/Contents/Resources/AppController.rb: -------------------------------------------------------------------------------- 1 | require 'osx/cocoa' 2 | 3 | class FileItem 4 | attr_accessor :file_name 5 | def initialize(file_name) 6 | @file_name = file_name 7 | end 8 | end 9 | 10 | class AppController < OSX::NSObject 11 | include OSX 12 | ib_outlets :search_field, :close_button, :file_list 13 | 14 | def initialize 15 | @files = [] 16 | # @file_list.window.makeKeyAndOrderFront(this) 17 | # SelectWindow(WindowRef) 18 | # makeMainWindow: 19 | end 20 | 21 | def add_pressed(sender) 22 | puts @file_list.selectedRowIndexes.to_a.map {|i| @files[i].file_name }.join(" ") 23 | quit_application 24 | end 25 | ib_action :add_pressed 26 | 27 | def close_dialog(sender) 28 | quit_application 29 | end 30 | ib_action :close_dialog 31 | 32 | # NSSearchField delegate 33 | def controlTextDidChange(aNotification) 34 | update_file_list 35 | end 36 | 37 | # NSTableView data source 38 | def numberOfRowsInTableView(tblView) 39 | @files.size 40 | end 41 | 42 | def tableView_objectValueForTableColumn_row(tblView, col, row) 43 | identifier = col.identifier 44 | file = @files[row] 45 | file.send(identifier.to_s.intern) 46 | end 47 | 48 | def tableView_setObjectValue_forTableColumn_row(tblView, obj, col, row) 49 | identifier = col.identifier 50 | file = @files[row] 51 | if obj.isKindOfClass?(NSDecimalNumber) then 52 | obj = obj.to_f 53 | else 54 | obj = obj.to_s 55 | end 56 | file.send("#{identifier}=".intern, obj) 57 | updateChangeCount(NSChangeDone) 58 | end 59 | 60 | # NSTableView delegate 61 | def tableViewSelectionDidChange(aNotification) 62 | # @deleteButton.setEnabled(@employees.size > 0 && @tableView.selectedRow != -1) 63 | end 64 | 65 | private 66 | def quit_application 67 | OSX::NSApplication.sharedApplication.terminate(self) 68 | end 69 | 70 | def update_file_list 71 | @files = matching_files 72 | @file_list.reloadData 73 | end 74 | 75 | def search_string 76 | @search_field.stringValue.to_ruby 77 | end 78 | 79 | def matching_files 80 | files = [] 81 | 82 | dir = '.' 83 | if search_string.length > 0 84 | dir = search_string.gsub(/^((?:\$\$)PWD)/, tm_directory) 85 | end 86 | 87 | dir = File.dirname(dir) if !File.directory?(dir) 88 | dir = tm_directory if dir == '.' 89 | 90 | # puts "dir = '#{dir}'" 91 | 92 | ignore = %w(.svn _darcs .obj .moc) 93 | find_cmd = "find '#{dir}' -maxdepth 1" # | " + ignore.map { |e| "grep -v #{e}" }.join("|") 94 | output = `#{find_cmd}`.split("\n") 95 | output.each do |e| 96 | # next if File.directory?(e) 97 | e.gsub!(tm_directory, '$$PWD') 98 | # puts "e = '#{e}', search_string = '#{search_string}'" 99 | next if Regexp.new(Regexp.escape(search_string)) !~ e 100 | files << FileItem.new(e) 101 | end 102 | 103 | return files 104 | end 105 | 106 | def tm_directory 107 | ENV['TM_DIRECTORY'] 108 | end 109 | end 110 | -------------------------------------------------------------------------------- /Support/AddFile/AddFile.xcodeproj/mblsha.pbxuser: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | 29B97313FDCFA39411CA2CEA /* Project object */ = { 4 | activeArchitecture = i386; 5 | activeBuildConfigurationName = Release; 6 | activeExecutable = 7962FE5F0CD3964100292820 /* AddFile */; 7 | activeTarget = 4DDCA7030ACC9A6100E082CE /* AddFile */; 8 | addToTargets = ( 9 | 4DDCA7030ACC9A6100E082CE /* AddFile */, 10 | ); 11 | codeSenseManager = 7962FE670CD3964B00292820 /* Code sense */; 12 | executables = ( 13 | 7962FE5F0CD3964100292820 /* AddFile */, 14 | ); 15 | perUserDictionary = { 16 | PBXConfiguration.PBXFileTableDataSource3.PBXFileTableDataSource = { 17 | PBXFileTableDataSourceColumnSortingDirectionKey = "-1"; 18 | PBXFileTableDataSourceColumnSortingKey = PBXFileDataSource_Filename_ColumnID; 19 | PBXFileTableDataSourceColumnWidthsKey = ( 20 | 20, 21 | 243, 22 | 20, 23 | 48, 24 | 43, 25 | 43, 26 | 20, 27 | ); 28 | PBXFileTableDataSourceColumnsKey = ( 29 | PBXFileDataSource_FiletypeID, 30 | PBXFileDataSource_Filename_ColumnID, 31 | PBXFileDataSource_Built_ColumnID, 32 | PBXFileDataSource_ObjectSize_ColumnID, 33 | PBXFileDataSource_Errors_ColumnID, 34 | PBXFileDataSource_Warnings_ColumnID, 35 | PBXFileDataSource_Target_ColumnID, 36 | ); 37 | }; 38 | PBXPerProjectTemplateStateSaveDate = 221792622; 39 | PBXWorkspaceStateSaveDate = 221792622; 40 | }; 41 | sourceControlManager = 7962FE660CD3964B00292820 /* Source Control */; 42 | userBuildSettings = { 43 | }; 44 | }; 45 | 4DDCA7030ACC9A6100E082CE /* AddFile */ = { 46 | activeExec = 0; 47 | executables = ( 48 | 7962FE5F0CD3964100292820 /* AddFile */, 49 | ); 50 | }; 51 | 7962FE5F0CD3964100292820 /* AddFile */ = { 52 | isa = PBXExecutable; 53 | activeArgIndices = ( 54 | ); 55 | argumentStrings = ( 56 | ); 57 | autoAttachOnCrash = 1; 58 | breakpointsEnabled = 0; 59 | configStateDict = { 60 | }; 61 | customDataFormattersEnabled = 1; 62 | debuggerPlugin = GDBDebugging; 63 | disassemblyDisplayState = 0; 64 | dylibVariantSuffix = ""; 65 | enableDebugStr = 1; 66 | environmentEntries = ( 67 | ); 68 | executableSystemSymbolLevel = 0; 69 | executableUserSymbolLevel = 0; 70 | libgmallocEnabled = 0; 71 | name = AddFile; 72 | savedGlobals = { 73 | }; 74 | sourceDirectories = ( 75 | ); 76 | }; 77 | 7962FE660CD3964B00292820 /* Source Control */ = { 78 | isa = PBXSourceControlManager; 79 | fallbackIsa = XCSourceControlManager; 80 | isSCMEnabled = 0; 81 | scmConfiguration = { 82 | }; 83 | }; 84 | 7962FE670CD3964B00292820 /* Code sense */ = { 85 | isa = PBXCodeSenseManager; 86 | indexTemplatePath = ""; 87 | }; 88 | 7962FE6A0CD399FD00292820 /* AppController.rb */ = { 89 | uiCtxt = { 90 | sepNavIntBoundsRect = "{{0, 0}, {717, 1568}}"; 91 | sepNavSelRange = "{2543, 0}"; 92 | sepNavVisRange = "{1557, 986}"; 93 | sepNavWindowFrame = "{{975, 23}, {776, 662}}"; 94 | }; 95 | }; 96 | E8F5E25803AEB7C803A81C6F /* rb_main.rb */ = { 97 | uiCtxt = { 98 | sepNavIntBoundsRect = "{{0, 0}, {683, 677}}"; 99 | sepNavSelRange = "{0, 0}"; 100 | sepNavVisRange = "{0, 493}"; 101 | sepNavWindowFrame = "{{38, 403}, {742, 749}}"; 102 | }; 103 | }; 104 | } 105 | -------------------------------------------------------------------------------- /Commands/Doc Lookup.tmCommand: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beforeRunningCommand 6 | nop 7 | command 8 | #!/usr/bin/env ruby18 9 | require ENV['TM_SUPPORT_PATH']+'/lib/exit_codes' 10 | 11 | word = (ENV['TM_SELECTED_TEXT'] or ENV['TM_CURRENT_WORD'] or '') 12 | dir = (ENV['TM_QT_DOC_DIR'] or '/usr/local/Trolltech/Qt-4.2.0/doc/html') 13 | 14 | word.strip! unless word.frozen? 15 | 16 | if word.nil? 17 | puts "Nothing given to search for." 18 | 19 | else 20 | doc_file = "#{dir}/#{word.downcase}.html" 21 | 22 | if File.exists? doc_file 23 | TextMate::exit_show_html "<meta http-equiv='Refresh' content='0;URL=file://#{doc_file}'>" 24 | else 25 | spotted = `mdfind #{word}` 26 | files = spotted.grep %r{^#{Regexp::escape dir}/.+\.html$} 27 | 28 | unless files.any? 29 | puts "No Documentation found for '#{word}'." 30 | else 31 | puts %{ 32 | <html> 33 | <head><title>Spotlight results for '#{word}'</title> 34 | <style> 35 | a:link { color: #004faf; text-decoration: none } 36 | a:visited { color: #672967; text-decoration: none } 37 | h1 { text-align: center } 38 | span.intro { color: #999 } 39 | div.navi img { 40 | vertical-align: -35%; 41 | margin-right: 4px; 42 | } 43 | </style> 44 | <body> 45 | 46 | <div class="navi"> 47 | <img src="file://#{dir}/images/qt-logo.png"> 48 | <a href="file://#{dir}/index.html">Home</a> &middot; 49 | <a href="file://#{dir}/classes.html">All Classes</a> &middot; 50 | <a href="file://#{dir}/mainclasses.html">Main Classes</a> &middot; 51 | <a href="file://#{dir}/groups.html">Grouped Classes</a> &middot; 52 | <a href="file://#{dir}/modules.html">Modules</a> &middot; 53 | <a href="file://#{dir}/functions.html">Functions</a> 54 | </div> 55 | 56 | <h1>Spotlight results for '#{word}'</h1><ul>} 57 | 58 | files.each do |file| 59 | head = File.open(file.chop).read(4000) 60 | title = head.scan(/<title>Qt \d\.\d: (.+)<\/title>/).first.first 61 | intro = head.scan(/<p>(.{16,})<\/p>/).first 62 | 63 | unless intro.nil? 64 | intro = intro.first.gsub(/<.+?>/, '')[0..(107-title.size)]+'&hellip;' 65 | end 66 | 67 | puts %{<li><a href="file://#{file.chop}">#{title}</a> 68 | <span class="intro">#{intro}</span></li>} 69 | end 70 | puts "</ul></body></html>" 71 | 72 | TextMate::exit_show_html 73 | end 74 | end 75 | 76 | end 77 | input 78 | none 79 | keyEquivalent 80 | ^h 81 | name 82 | Doc Lookup 83 | output 84 | showAsTooltip 85 | scope 86 | source.c++.qt 87 | uuid 88 | D663259E-0526-11DB-A7A9-0011242E4184 89 | 90 | 91 | -------------------------------------------------------------------------------- /Support/lib/ctags.rb: -------------------------------------------------------------------------------- 1 | def replace_extension(filename, ext) 2 | f = filename.split(".") 3 | f[-1] = ext 4 | new_name = f.join(".") 5 | File.exists?(new_name) ? new_name : nil 6 | end 7 | 8 | class CTags 9 | class Tag < Struct.new(:name, :path, :pattern, :kind, :line, :klass, :inherits, :signature, :result_type) 10 | def initialize(*args) 11 | # when pattern = 'virtual bool operator<(const ContactListItem& other) const', 12 | # the name is 'operator <', which is not the same 13 | # probably we should correct this here 14 | self.name = args[0].gsub(/\s+/, '') 15 | self.path = args[1] 16 | self.pattern = args[2] 17 | self.kind = f(args, "kind") { |k| k.to_sym } 18 | self.line = f(args, "line") { |l| l.to_i } 19 | case kind 20 | when :class 21 | self.klass = name 22 | self.inherits = f(args, "inherits") { |p| p.chomp.split(",") } 23 | self.signature = nil 24 | when :function 25 | self.klass = f(args, "class") || "" 26 | self.inherits = nil 27 | self.signature = f(args, "signature") { |s| s.chomp } || "" 28 | self.result_type = $1 if pattern =~ /^\/\^\s*(.+?)(#{Regexp.escape(klass)}::)?#{Regexp.escape(name)}\s*\(/ 29 | end 30 | end 31 | 32 | private 33 | def f(args, name) 34 | f = args.find { |e| e =~ /^#{name}:/ } 35 | return nil if f.nil? 36 | val = f.split(":")[1..-1].join(":") 37 | if block_given? 38 | yield val 39 | else 40 | val 41 | end 42 | end 43 | end 44 | 45 | class Tags < Hash 46 | def <<(tag) 47 | if has_key?(tag.name) 48 | self[tag.name] << tag 49 | else 50 | self[tag.name] = [tag] 51 | end 52 | end 53 | end 54 | 55 | attr_reader :tags, :classes, :functions 56 | 57 | def initialize(tags) 58 | @tags = tags 59 | @classes = Tags.new 60 | @functions = Tags.new 61 | 62 | tags.each do |tag| 63 | @classes << tag if tag.kind == :class 64 | @functions << tag if tag.kind == :function 65 | end 66 | end 67 | 68 | def self.create(lines) 69 | tags = Array.new 70 | 71 | lines.reject! { |e| e =~ /^!_/ } 72 | tags = lines.map do |line| 73 | Tag.new(*line.split("\t").find_all { |e| !e.empty? }) 74 | end 75 | 76 | return CTags.new(tags) 77 | end 78 | 79 | def +(other) 80 | CTags.new(self.tags + other.tags) 81 | end 82 | 83 | def class_parent(class_name) 84 | return nil if class_name.nil? 85 | return nil if !@classes.has_key?(class_name) 86 | tag = @classes[class_name].find { |e| !e.inherits.nil? } 87 | tag.nil? ? nil : tag.inherits.first 88 | end 89 | 90 | def self.parse(files) 91 | ctags = ENV['TM_BUNDLE_SUPPORT'] + '/../../CTags.tmbundle/Support/bin/ctags' 92 | flags = "--language-force=C++ --fields=KnisSafmz --excmd=pattern" 93 | temp = temp_file("ctags") 94 | begin 95 | system("\"#{ctags}\" -f \"#{temp}\" #{flags} #{files.map{|f| "\"#{f}\""}.join(' ')}") 96 | tags = CTags.create(File.readlines(temp)) 97 | ensure 98 | File.delete(temp) 99 | end 100 | return tags 101 | end 102 | 103 | def self.parse_data(lines) 104 | temp = temp_file("ctags") 105 | begin 106 | File.open(temp, "w+") { |f| f << lines } 107 | tags = CTags.parse(temp) 108 | tags.tags.each { |t| t.path = nil } 109 | return tags 110 | ensure 111 | File.delete(temp) 112 | end 113 | end 114 | 115 | def self.run 116 | eof = $stdin.eof? 117 | tags = parse_data($stdin.readlines) 118 | file = ENV['TM_FILEPATH'] 119 | if !file.nil? 120 | files = [ "h", "cpp" ].map { |e| replace_extension(file, e) }.compact 121 | files -= [file] if !eof 122 | tags += CTags.parse(files) if !files.empty? 123 | end 124 | return tags 125 | end 126 | end 127 | -------------------------------------------------------------------------------- /Support/AddFile/Rakefile: -------------------------------------------------------------------------------- 1 | # -*- mode:ruby; indent-tabs-mode:nil; coding:utf-8 -*- 2 | # vim:ts=2:sw=2:expandtab: 3 | require 'rubygems' 4 | require 'rake' 5 | require 'rake/clean' 6 | require 'rake/testtask' 7 | require 'pathname' 8 | 9 | # Application own Settings 10 | APPNAME = "«PROJECTNAME»" 11 | TARGET = "#{APPNAME}.app" 12 | #APPVERSION = "rev#{`svn info`[/Revision: (\d+)/, 1]}" 13 | APPVERSION = Time.now.strftime("%Y-%m-%d") 14 | PUBLISH = 'yourname@yourhost:path' 15 | DEFAULT_TARGET = APPNAME 16 | DEFAULT_CONFIGURATION = 'Release' 17 | RELEASE_CONFIGURATION = 'Release' 18 | 19 | # Tasks 20 | task :default => [:run] 21 | 22 | desc "Build the default and run it." 23 | task :run => [:build] do 24 | sh %{open "build/Release/#{APPNAME}.app"} 25 | end 26 | 27 | desc 'Build the default target using the default configuration' 28 | task :build => "xcode:build:#{DEFAULT_TARGET}:#{DEFAULT_CONFIGURATION}" 29 | 30 | desc 'Deep clean of everything' 31 | task :clean do 32 | puts %x{ xcodebuild -alltargets clean } 33 | end 34 | 35 | desc "Add files to Xcode project" 36 | task :add do |t| 37 | files = ARGV[1..-1] 38 | project = %x{ xcodebuild -list }[/Information about project "([^"]+)":/, 1] 39 | files << "#{project}.xcodeproj" 40 | exec("rubycocoa", "add", *files) 41 | end 42 | 43 | desc "Create ruby skelton and add to Xcode project" 44 | task :create do |t| 45 | args = ARGV[1..-1] 46 | if system("rubycocoa", "create", *args) 47 | project = %x{ xcodebuild -list }[/Information about project "([^"]+)":/, 1] 48 | exec("rubycocoa", "add", args.last + ".rb", "#{project}.xcodeproj") 49 | end 50 | end 51 | 52 | desc "Update nib with ruby file" 53 | task :update do |t| 54 | args = ARGV[1..-1] 55 | args.unshift("English.lproj/MainMenu.nib") 56 | exec("rubycocoa", "update", *args) 57 | end 58 | 59 | desc "Package the application" 60 | task :package => ["xcode:build:#{DEFAULT_TARGET}:#{RELEASE_CONFIGURATION}", "pkg"] do 61 | name = "#{APPNAME}.#{APPVERSION}" 62 | mkdir "image" 63 | sh %{rubycocoa standaloneify "build/#{DEFAULT_CONFIGURATION}/#{APPNAME}.app" "image/#{APPNAME}.app"} 64 | puts 'Creating Image...' 65 | sh %{ 66 | hdiutil create -volname '#{name}' -srcfolder image '#{name}'.dmg 67 | rm -rf image 68 | mv '#{name}.dmg' pkg 69 | } 70 | end 71 | 72 | directory 'pkg' 73 | 74 | desc 'Make Localized nib from English.lproj and Lang.lproj/nib.strings' 75 | rule(/.nib$/ => [proc {|tn| File.dirname(tn) + '/nib.strings' }]) do |t| 76 | p t.name 77 | lproj = File.dirname(t.name) 78 | target = File.basename(t.name) 79 | rm_rf t.name 80 | sh %{ 81 | nibtool -d #{lproj}/nib.strings -w #{t.name} English.lproj/#{target} 82 | } 83 | end 84 | 85 | # [Rubycocoa-devel 906] dynamically xcode rake tasks 86 | # [Rubycocoa-devel 907] 87 | # 88 | def xcode_targets 89 | out = %x{ xcodebuild -list } 90 | out.scan(/.*Targets:\s+(.*)Build Configurations:.*/m) 91 | 92 | targets = [] 93 | $1.each_line do |l| 94 | l = l.strip.sub(' (Active)', '') 95 | targets << l unless l.nil? or l.empty? 96 | end 97 | targets 98 | end 99 | 100 | def xcode_configurations 101 | out = %x{ xcodebuild -list } 102 | out.scan(/.*Build Configurations:\s+(.*)If no build configuration.*/m) 103 | 104 | configurations = [] 105 | $1.each_line do |l| 106 | l = l.strip.sub(' (Active)', '') 107 | configurations << l unless l.nil? or l.empty? 108 | end 109 | configurations 110 | end 111 | 112 | namespace :xcode do 113 | targets = xcode_targets 114 | configs = xcode_configurations 115 | 116 | %w{build clean}.each do |action| 117 | namespace "#{action}" do 118 | 119 | targets.each do |target| 120 | desc "#{action} #{target}" 121 | task "#{target}" do |t| 122 | puts %x{ xcodebuild -target '#{target}' #{action} } 123 | end 124 | 125 | # alias the task above using a massaged name 126 | massaged_target = target.downcase.gsub(/[\s*|\-]/, '_') 127 | task "#{massaged_target}" => "xcode:#{action}:#{target}" 128 | 129 | 130 | namespace "#{target}" do 131 | configs.each do |config| 132 | desc "#{action} #{target} #{config}" 133 | task "#{config}" do |t| 134 | puts %x{ xcodebuild -target '#{target}' -configuration '#{config}' #{action} } 135 | end 136 | end 137 | end 138 | 139 | # namespace+task aliases of the above using massaged names 140 | namespace "#{massaged_target}" do 141 | configs.each { |conf| task "#{conf.downcase.gsub(/[\s*|\-]/, '_')}" => "xcode:#{action}:#{target}:#{conf}" } 142 | end 143 | 144 | end 145 | 146 | end 147 | end 148 | end 149 | 150 | 151 | if ["update", "add", "create"].include? ARGV[0] 152 | # dupe rake 153 | ARGV.map! {|a| a.sub(/^\+/, "-") } 154 | Rake.application[ARGV[0].to_sym].invoke 155 | exit # will not reach 156 | end 157 | -------------------------------------------------------------------------------- /Preferences/Qt C++ Completitions.tmPreferences: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | name 6 | C++ Qt Completitions 7 | scope 8 | source.c++.qt 9 | settings 10 | 11 | completions 12 | 13 | Q_CLASSINFO 14 | Q_ENUMS 15 | Q_FLAGS 16 | Q_INTERFACES 17 | Q_OBJECT 18 | Q_PROPERTY 19 | qobject_cast 20 | QAbstractItemDelegate 21 | QAbstractItemModel 22 | QAbstractItemView 23 | QAccessible 24 | QAction 25 | QApplication 26 | QButtonGroup 27 | QByteArray 28 | QCache 29 | QCheckBox 30 | QClipboard 31 | QColor 32 | QColorDialog 33 | QComboBox 34 | QCoreApplication 35 | QCursor 36 | QDataStream 37 | QDate 38 | QDateEdit 39 | QDateTime 40 | QDateTimeEdit 41 | QDesktopWidget 42 | QDial 43 | QDialog 44 | QDir 45 | QDomDocument 46 | QDomNode 47 | QDoubleSpinBox 48 | QFile 49 | QFileDialog 50 | QFlags 51 | QFocusFrame 52 | QFont 53 | QFontDialog 54 | QFrame 55 | QFtp 56 | QGLWidget 57 | QGraphicsScene 58 | QGraphicsView 59 | QGridLayout 60 | QGroupBox 61 | QHBoxLayout 62 | QHash 63 | QHeaderView 64 | QHttp 65 | QIcon 66 | QImage 67 | QInputDialog 68 | QItemDelegate 69 | QKeySequence 70 | QLCDNumber 71 | QLabel 72 | QLibrary 73 | QLibraryInfo 74 | QLineEdit 75 | QLinkedList 76 | QList 77 | QListView 78 | QListWidget 79 | QLocale 80 | QMainWindow 81 | QMap 82 | QMenu 83 | QMenuBar 84 | QMessageBox 85 | QModelIndex 86 | QMultiHash 87 | QMultiMap 88 | QMutex 89 | QObject 90 | QPainter 91 | QPalette 92 | QPen 93 | QPicture 94 | QPixmap 95 | QPluginLoader 96 | QPointer 97 | QPrinter 98 | QProcess 99 | QProgressBar 100 | QProgressDialog 101 | QPushButton 102 | QQueue 103 | QRadioButton 104 | QRegExp 105 | QResource 106 | QRubberBand 107 | QScrollArea 108 | QSet 109 | QSettings 110 | QSharedDataPointer 111 | QShortcut 112 | QSignalMapper 113 | QSlider 114 | QSound 115 | QSpinBox 116 | QSplashScreen 117 | QSplitter 118 | QSqlDatabase 119 | QSqlQuery 120 | QStack 121 | QStackedLayout 122 | QStackedWidget 123 | QStatusBar 124 | QString 125 | QStringList 126 | QStringListModel 127 | QTabBar 128 | QTabWidget 129 | QTableView 130 | QTableWidget 131 | QTemporaryFile 132 | QTextCursor 133 | QTextDocument 134 | QTextEdit 135 | QThread 136 | QThreadStorage 137 | QTime 138 | QTimeEdit 139 | QTimer 140 | QToolBar 141 | QToolBox 142 | QToolButton 143 | QToolTip 144 | QTranslator 145 | QTreeView 146 | QTreeWidget 147 | QUrl 148 | QVBoxLayout 149 | QValidator 150 | QVariant 151 | QVector 152 | QWhatsThis 153 | QWidget 154 | QWidgetAction 155 | QXmlSimpleReader 156 | 157 | 158 | uuid 159 | 8BEB2DA8-C015-463B-929F-FAB4FAF17414 160 | 161 | 162 | -------------------------------------------------------------------------------- /info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | contactEmailRot13 6 | zoyfun@tznvy.pbz 7 | contactName 8 | Michail Pishchagin 9 | description 10 | <a href="http://www.trolltech.com/products/qt/">Qt</a> is a platform independent C++ library/framework for application development. It started out as a GUI framework. 11 | mainMenu 12 | 13 | excludedItems 14 | 15 | 04CD802D-9EFD-49D3-B4A3-7AF6A6BA1430 16 | 17 | items 18 | 19 | 97FDD49E-0E1B-4B68-9614-E57A5804C247 20 | AAAD64D1-8C69-4645-853E-B6DD3D04AC67 21 | 22F431D0-0CB5-4CAB-951F-8C0E7396891F 22 | ------------------------------------ 23 | 82073EA0-7D10-4A6C-AF49-54B29FA3AF1E 24 | ------------------------------------ 25 | 3FE38320-EB78-4AE7-A607-B1AB43AD813C 26 | E67FC7C6-B1EB-411B-A6D3-BC1078FD859F 27 | 460AF393-91E6-4626-8A69-61352495D46A 28 | 4AEA3F51-00AA-407A-90CC-68C5F9EB18E1 29 | 30 | submenus 31 | 32 | 3FE38320-EB78-4AE7-A607-B1AB43AD813C 33 | 34 | items 35 | 36 | 8D9D10AE-0531-11DB-8509-0011242E4184 37 | 48A79C21-0832-11DB-9495-0011242E4184 38 | 90F2231F-959B-4CA7-9CAF-7165E5160D04 39 | 204E5213-CAF7-47FD-B272-34997632832D 40 | ------------------------------------ 41 | 611BEDBC-30B4-4019-B29C-A91ECD480051 42 | 9CC7A8E5-1EDD-4795-A1A9-3432D535F4C4 43 | ------------------------------------ 44 | C129BDA0-E887-4404-B8B5-3F6086468A5E 45 | 1BE36C25-5F22-45EE-9339-C0A3D1EACEA2 46 | 1DB2A2E8-5E25-4442-9DE1-335E09854C9F 47 | BFD08AAF-3AB2-4C55-9A57-2EB75ECD9CD1 48 | 5146EF51-BFB3-4342-94B8-D14DC3A6CB69 49 | 50 | name 51 | Snippets 52 | 53 | 460AF393-91E6-4626-8A69-61352495D46A 54 | 55 | items 56 | 57 | D663259E-0526-11DB-A7A9-0011242E4184 58 | E91A719F-109D-4243-B943-A85F9FECEBE0 59 | ------------------------------------ 60 | DAD33E78-4FEF-43EB-A672-790E7140855A 61 | D4885A64-9FF5-43BA-8D5E-AEB71E9E08C2 62 | C6BD2114-7620-4C35-A9B5-F44CA3291004 63 | F34F4BC0-C09C-4DAC-9B0C-EE7173964090 64 | 65 | name 66 | Documentation 67 | 68 | 4AEA3F51-00AA-407A-90CC-68C5F9EB18E1 69 | 70 | items 71 | 72 | 2FC991AF-86B9-4227-838A-30164B4923A1 73 | 9CD2DCE1-C4FE-46CF-BE35-D38041740C5D 74 | ------------------------------------ 75 | 68EA4D87-31FA-4492-9645-925128AB6C43 76 | 77 | name 78 | Comments 79 | 80 | 5146EF51-BFB3-4342-94B8-D14DC3A6CB69 81 | 82 | items 83 | 84 | DDDE4415-9B12-4F03-81CE-CB9ACA62CFD2 85 | D05EDFB2-D456-420B-87EB-BD4CBEDAA58E 86 | 84CF7C01-9208-453D-8254-DCD17D0A7500 87 | 466A5E55-F2E9-4542-8CE7-5799B4DC9BF8 88 | 89 | name 90 | Misc 91 | 92 | E67FC7C6-B1EB-411B-A6D3-BC1078FD859F 93 | 94 | items 95 | 96 | 02131A74-BB30-4A92-B8D0-BDD96FF9CD88 97 | ------------------------------------ 98 | C4517F03-DB1A-434E-BF29-F13DA337B20F 99 | 97D13B6C-9CC2-4CAD-8CD3-80DC9CBC1968 100 | CC1A1191-7451-4806-B326-459416C8894A 101 | 102 | name 103 | Insert 104 | 105 | 106 | 107 | name 108 | C++ Qt 109 | ordering 110 | 111 | C0D24A46-0534-11DB-8949-0011242E4184 112 | 8BEB2DA8-C015-463B-929F-FAB4FAF17414 113 | 26796298-41FC-40F6-8B8F-D896A0EF2BDC 114 | 3D54A8F9-17CA-422A-A1D6-DE5F98B9DEF4 115 | 8B8C14B7-9E15-448E-AE1B-BE87E6069F40 116 | 1252E454-CFC7-4FB1-80C3-33A267BFB3FF 117 | 2669156F-0951-4BF3-AD31-DC390F6B0632 118 | 97FDD49E-0E1B-4B68-9614-E57A5804C247 119 | AAAD64D1-8C69-4645-853E-B6DD3D04AC67 120 | 22F431D0-0CB5-4CAB-951F-8C0E7396891F 121 | D663259E-0526-11DB-A7A9-0011242E4184 122 | E91A719F-109D-4243-B943-A85F9FECEBE0 123 | 8D9D10AE-0531-11DB-8509-0011242E4184 124 | 48A79C21-0832-11DB-9495-0011242E4184 125 | 90F2231F-959B-4CA7-9CAF-7165E5160D04 126 | 1BE36C25-5F22-45EE-9339-C0A3D1EACEA2 127 | 204E5213-CAF7-47FD-B272-34997632832D 128 | C129BDA0-E887-4404-B8B5-3F6086468A5E 129 | 611BEDBC-30B4-4019-B29C-A91ECD480051 130 | 9CC7A8E5-1EDD-4795-A1A9-3432D535F4C4 131 | 2FC991AF-86B9-4227-838A-30164B4923A1 132 | 9CD2DCE1-C4FE-46CF-BE35-D38041740C5D 133 | 1DB2A2E8-5E25-4442-9DE1-335E09854C9F 134 | BFD08AAF-3AB2-4C55-9A57-2EB75ECD9CD1 135 | 04CD802D-9EFD-49D3-B4A3-7AF6A6BA1430 136 | C4517F03-DB1A-434E-BF29-F13DA337B20F 137 | CC1A1191-7451-4806-B326-459416C8894A 138 | 97D13B6C-9CC2-4CAD-8CD3-80DC9CBC1968 139 | D4885A64-9FF5-43BA-8D5E-AEB71E9E08C2 140 | F34F4BC0-C09C-4DAC-9B0C-EE7173964090 141 | DAD33E78-4FEF-43EB-A672-790E7140855A 142 | C6BD2114-7620-4C35-A9B5-F44CA3291004 143 | 02131A74-BB30-4A92-B8D0-BDD96FF9CD88 144 | 68EA4D87-31FA-4492-9645-925128AB6C43 145 | 466A5E55-F2E9-4542-8CE7-5799B4DC9BF8 146 | D05EDFB2-D456-420B-87EB-BD4CBEDAA58E 147 | 84CF7C01-9208-453D-8254-DCD17D0A7500 148 | DDDE4415-9B12-4F03-81CE-CB9ACA62CFD2 149 | 82073EA0-7D10-4A6C-AF49-54B29FA3AF1E 150 | 151 | uuid 152 | 6ED4A84B-3953-408E-B09B-6BF38C73D958 153 | 154 | 155 | -------------------------------------------------------------------------------- /Syntaxes/Qt C++.tmLanguage: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | fileTypes 6 | 7 | firstLineMatch 8 | -\*- C\+\+ -\*- 9 | foldingStartMarker 10 | (?x) 11 | /\*\*(?!\*) 12 | |^(?![^{]*?//|[^{]*?/\*(?!.*?\*/.*?\{)).*?\{\s*($|//|/\*(?!.*?\*/.*\S)) 13 | 14 | foldingStopMarker 15 | (?<!\*)\*\*/|^\s*\} 16 | keyEquivalent 17 | ^~Q 18 | name 19 | C++ Qt 20 | patterns 21 | 22 | 23 | match 24 | \bQ_(CLASSINFO|ENUMS|FLAGS|INTERFACES|OBJECT|PROPERTY)\b 25 | name 26 | support.other.macro.qt 27 | 28 | 29 | match 30 | \b((dis)?connect|emit|fore(ach|ver)|tr(Utf8)?|qobject_cast)\b 31 | name 32 | support.function.qt 33 | 34 | 35 | match 36 | \bQ(Abstract(Button|EventDispatcher|Extension(Factory|Manager)|FileEngine(Handler)?|FormBuilder|GraphicsShapeItem|Item(Delegate|Model|View)|ListModel|PrintDialog|ProxyModel|ScrollArea|Slider|Socket|SpinBox|TableModel|TextDocumentLayout)|Accessible(Bridge|BridgePlugin|Event|Interface|Object|Plugin|Widget)?|Action(Event|Group)?|(Core)?Application|AssistantClient|Ax(Aggregated|Base|Bindable|Factory|Object|Script|ScriptEngine|ScriptManager|Widget)|BasicTimer|Bit(Array|map)|BoxLayout|Brush|Buffer|ButtonBox|ButtonGroup|ByteArray(Matcher)?|(CDE|Windows(XP)?|Cleanlooks|Common|Mac|Plastique|Motif)Style|Cache|CalendarWidget|Char|CheckBox|ChildEvent|Clipboard|CloseEvent|Color(Dialog|map)?|ComboBox|Completer|ConicalGradient|ContextMenuEvent|CopChannel|Cursor|CustomRasterPaintDevice|DBus(AbstractAdaptor|AbstractInterface|Argument|Connection(Interface)?|Error|Interface|Message|ObjectPath|Reply|Server|Signature|Variant)|Data(Stream|WidgetMapper)|Date((Time)?(Edit)?)|Decoration(Factory|Plugin)?|Designer(ActionEditorInterface|ContainerExtension|CustomWidgetCollectionInterface|CustomWidgetInterface|FormEditorInterface|FormWindowCursorInterface|FormWindowInterface|FormWindowManagerInterface|MemberSheetExtension|ObjectInspectorInterface|PropertyEditorInterface|PropertySheetExtension|TaskMenuExtension|WidgetBoxInterface)|Desktop(Services|Widget)|Dial(og|ogButtonBox)?|Dir(Model|ectPainter)?|DockWidget|Dom(Attr|CDATASection|CharacterData|Comment|Document|DocumentFragment|DocumentType|Element|Entity|EntityReference|Implementation|NamedNodeMap|Node|NodeList|Notation|ProcessingInstruction|Text)|Double(SpinBox|Validator)|Drag((Enter|Leave|Move)Event)?|(Drop|DynamicPropertyChange)Event|ErrorMessage|Event(Loop)?|Extension(Factory|Manager)|FSFileEngine|File(Dialog|IconProvider|Info|OpenEvent|SystemWatcher)?|Flags?|Focus(Event|Frame)|Font(ComboBox|Database|Dialog|Info|MetricsF?)?|FormBuilder|Frame|Ftp|GL(Colormap|Context|Format|FramebufferObject|PixelBuffer|Widget)|Generic(Return)?Argument|Gradient|Graphics(EllipseItem|Item|ItemAnimation|ItemGroup|LineItem|PathItem|PixmapItem|PolygonItem|RectItem|Scene((ContextMenu|Hover|Mouse|Wheel)?Event)?|SimpleTextItem|SvgItem|TextItem|View)|GridLayout|GroupBox|HBoxLayout|Hash(Iterator)?|HeaderView|(Help|Hide|Hover)Event|Host(Address|Info)|Http((Response|Request)?Header)?|IODevice|Icon(DragEvent|Engine(Plugin)?)?|Image(IO(Handler|Plugin)|Reader|Writer)?|Input(Context(Factory|Plugin)?|Dialog|Event|MethodEvent)|IntValidator|Item(Delegate|Editor(CreatorBase|Factory)|Selection(Model|Range)?)|KbdDriver(Factory|Plugin)|Key(Event|Sequence)|LCDNumber|Label|Latin1(Char|String)|Layout(Item)?|Library(Info)?|Line(Edit|F)?|LinearGradient|LinkedList(Iterator)?|LinuxFbScreen|List(View|Iterator|Widget(Item)?)?|Locale|MacPasteboardMime|MainWindow|Map(Iterator)?|Matrix|Menu(Bar)?|MessageBox|Meta(ClassInfo|Enum|Method|Object|Property|Type)|Mime(Data|Source)|ModelIndex|MouseDriver(Factory|Plugin)|(Move|Mouse)Event|Movie|Multi(Hash|Map)|Mutable(Hash|(Linked)?List|Map|Set|Vector)Iterator|Mutex(Locker)?|Network(AddressEntry|Interface|Proxy)|Object(CleanupHandler)?|PageSetupDialog|Paint(Device|Engine(State)?|Event|er(Path(Stroker)?)?)|Pair|Palette|Pen|PersistentModelIndex|Picture(FormatPlugin|IO)?|Pixmap(Cache)?|PluginLoader|PointF?|Pointer|PolygonF?|Print(Dialog|Engine|er)|Process|Progress(Bar|Dialog)|ProxyModel|PushButton|Queue|RadialGradient|RadioButton|RasterPaintEngine|ReadLocker|ReadWriteLock|RectF?|RegExp(Validator)?|Region|ResizeEvent|Resource|RubberBand|Screen(Cursor|Driver(Factory|Plugin))?|Scroll(Area|Bar)|Semaphore|SessionManager|Set(Iterator)?|Settings|SharedData(Pointer)?|Shortcut(Event)?|ShowEvent|Signal(Mapper|Spy)|Size(Grip|Policy|F)?|Slider|SocketNotifier|SortFilterProxyModel|Sound|SpacerItem|SpinBox|SplashScreen|Splitter(Handle)?|Sql(Database|Driver(Creator(Base)?|Plugin)?|Error|Field|Index|Query(Model)?|Record|Relation|Relational(Delegate|TableModel)|Result|TableModel)|Stack(ed(Layout|Widget))?|StandardItem(EditorCreator|Model)?|Status(Bar|TipEvent)|String(List(Model)?|Matcher)?|Style(Factory|HintReturn(Mask)?|Option(Button|ComboBox|Complex|DockWidget|FocusRect|Frame(V2)?|GraphicsItem|GroupBox|Header|MenuItem|ProgressBar(V2)?|Q3(DockWindow|ListView|ListViewItem)|RubberBand|SizeGrip|Slider|SpinBox|Tab(BarBase|V2|WidgetFrame)?|TitleBar|Tool(Bar|Box|Button)|ViewItem(V2)?)?|Painter|Plugin)?|Svg(Renderer|Widget)|SyntaxHighlighter|SysInfo|System(Locale|TrayIcon)|Tab(Bar|Widget)|Table(Widget(Item|SelectionRange)?|View)|TabletEvent|Tcp(Server|Socket)|TemporaryFile|TestEventList|Text(Block(Format|Group|UserData)?|Browser|CharFormat|Codec(Plugin)?|Cursor|(De|En)coder|Document(Fragment)?|Edit|Fragment|Frame(Format)?|(Image)?Format|InlineObject|Layout|Length|Line|List(Format)?|Object|Option|Stream|Table(Cell|Format)?)|Thread(Storage)?|Time(Edit|Line)?|Timer(Event)?|Tool(Bar|Box|Button|Tip)|TransformedScreen|Translator|Tree(Widget(Item(Iterator)?)?|View)|UdpSocket|UiLoader|Undo(Command|Group|Stack|View)|Url(Info)?|Uuid|VBoxLayout|(VNC|VFb)Screen|Validator|VarLengthArray|Variant|Vector(Iterator)?|WS(Client|EmbedWidget|Event|InputMethod|(Keyboard|(Tslib|Calibrated)?Mouse)Handler|PointerCalibrationData|ScreenSaver|Server|Window(Surface)?)|WaitCondition|WhatsThis(ClickedEvent)?|WheelEvent|Widget(Action|Item)?|Window(StateChangeEvent|sMime)|Workspace|WriteLocker|X11Embed(Container|Widget)|X11Info|Xml(Attributes|(Content|DTD|Decl|Default|Error|Lexical)Handler|EntityResolver|InputSource|Locator|NamespaceSupport|ParseException|Reader|SimpleReader))\b 37 | name 38 | support.class.qt 39 | 40 | 41 | match 42 | \b(q(int8|int16|int32|int64|longlong|real|uint8|uint16|uint32|uint64|ulonglong)|u(char|int|long|short))\b 43 | name 44 | storage.type.qt 45 | 46 | 47 | match 48 | \b((public|private|protected) slots|signals)\b 49 | name 50 | storage.modifier.qt 51 | 52 | 53 | include 54 | source.c++ 55 | 56 | 57 | scopeName 58 | source.c++.qt 59 | uuid 60 | C0D24A46-0534-11DB-8949-0011242E4184 61 | 62 | 63 | -------------------------------------------------------------------------------- /Syntaxes/qmake Project.tmLanguage: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | fileTypes 6 | 7 | pro 8 | pri 9 | 10 | keyEquivalent 11 | ^~Q 12 | name 13 | qmake Project file 14 | patterns 15 | 16 | 17 | begin 18 | (TEMPLATE)\s*(=) 19 | captures 20 | 21 | 1 22 | 23 | name 24 | variable.language.qmake 25 | 26 | 2 27 | 28 | name 29 | punctuation.separator.key-value.qmake 30 | 31 | 32 | end 33 | $\n? 34 | name 35 | markup.other.template.qmake 36 | patterns 37 | 38 | 39 | match 40 | \b(app|lib|subdirs|vcapp|vclib)\b 41 | name 42 | keyword.other.qmake 43 | 44 | 45 | 46 | 47 | begin 48 | (CONFIG)\s*(\+|\-)?(=) 49 | captures 50 | 51 | 1 52 | 53 | name 54 | variable.language.qmake 55 | 56 | 3 57 | 58 | name 59 | punctuation.separator.key-value.qmake 60 | 61 | 62 | end 63 | $\n? 64 | name 65 | markup.other.config.qmake 66 | patterns 67 | 68 | 69 | match 70 | \b(release|debug|warn_(on|off)|qt|opengl|thread|x11|windows|console|dll|staticlib|plugin|designer|uic3|no_lflags_merge|exceptions|rtti|stl|flat|app_bundle|no_batch|qtestlib|ppc|x86)\b 71 | name 72 | keyword.other.qmake 73 | 74 | 75 | 76 | 77 | begin 78 | (QT)\s*(\+|\-)?(=) 79 | captures 80 | 81 | 1 82 | 83 | name 84 | variable.language.qmake 85 | 86 | 3 87 | 88 | name 89 | punctuation.separator.key-value.qmake 90 | 91 | 92 | end 93 | $\n? 94 | name 95 | markup.other.qt.qmake 96 | patterns 97 | 98 | 99 | match 100 | \b(core|gui|network|opengl|sql|svg|xml|qt3support)\b 101 | name 102 | keyword.other.qmake 103 | 104 | 105 | 106 | 107 | match 108 | \b(R(C(C_DIR|_FILE)|E(S_FILE|QUIRES))|M(OC_DIR|AKE(_MAKEFILE|FILE(_GENERATOR)?))|S(RCMOC|OURCES|UBDIRS)|HEADERS|YACC(SOURCES|IMPLS|OBJECTS)|CONFIG|T(RANSLATIONS|ARGET(_(EXT|\d+(\.\d+\.\d+)?))?)|INCLUDEPATH|OBJ(MOC|ECTS(_DIR)?)|D(SP_TEMPLATE|ISTFILES|E(STDIR(_TARGET)?|PENDPATH|F(_FILE|INES))|LLDESTDIR)|UI(C(IMPLS|OBJECTS)|_(SOURCES_DIR|HEADERS_DIR|DIR))|P(RE(COMPILED_HEADER|_TARGETDEPS)|OST_TARGETDEPS)|V(PATH|ER(SION|_(M(IN|AJ)|PAT)))|Q(MAKE(SPEC|_(RUN_C(XX(_IMP)?|C(_IMP)?)|MOC_SRC|C(XXFLAGS_(RELEASE|MT(_D(BG|LL(DBG)?))?|SHLIB|THREAD|DEBUG|WARN_O(N|FF))|FLAGS_(RELEASE|MT(_D(BG|LL(DBG)?))?|SHLIB|THREAD|DEBUG|WARN_O(N|FF))|LEAN)|TARGET|IN(CDIR(_(X|THREAD|OPENGL|QT))?|FO_PLIST)|UIC|P(RE_LINK|OST_LINK)|EXT(_(MOC|H|CPP|YACC|OBJ|UI|PRL|LEX)|ENSION_SHLIB)|Q(MAKE|T_DLL)|F(ILETAGS|AILED_REQUIREMENTS)|L(N_SHLIB|I(B(S(_(RT(MT)?|X|CONSOLE|THREAD|OPENGL(_QT)?|QT(_(OPENGL|DLL))?|WINDOWS))?|_FLAG|DIR(_(X|OPENGL|QT|FLAGS))?)|NK_SHLIB_CMD)|FLAGS(_(RELEASE|S(H(LIB|APP)|ONAME)|CONSOLE(_DLL)?|THREAD|DEBUG|PLUGIN|QT_DLL|WINDOWS(_DLL)?))?)|A(R_CMD|PP_(OR_DLL|FLAG))))?|T_THREAD)|FORMS|L(IBS|EX(SOURCES|IMPLS|OBJECTS)))\b 109 | name 110 | variable.language.qmake 111 | 112 | 113 | begin 114 | (\b([\w\d_]+\.[\w\d_]+|[A-Z_]+))?\s*(\+|\-)?(=) 115 | captures 116 | 117 | 1 118 | 119 | name 120 | variable.other.qmake 121 | 122 | 4 123 | 124 | name 125 | punctuation.separator.key-value.qmake 126 | 127 | 128 | end 129 | $\n? 130 | name 131 | markup.other.assignment.qmake 132 | patterns 133 | 134 | 135 | captures 136 | 137 | 1 138 | 139 | name 140 | punctuation.definition.variable.qmake 141 | 142 | 143 | match 144 | (\$\$)([A-Z_]+|[\w\d_]+\.[\w\d_]+)|\$\([\w\d_]+\) 145 | name 146 | variable.other.qmake 147 | 148 | 149 | match 150 | [\w\d\/_\-\.\:]+ 151 | name 152 | constant.other.filename.qmake 153 | 154 | 155 | begin 156 | " 157 | beginCaptures 158 | 159 | 0 160 | 161 | name 162 | punctuation.definition.string.begin.qmake 163 | 164 | 165 | end 166 | " 167 | endCaptures 168 | 169 | 0 170 | 171 | name 172 | punctuation.definition.string.end.qmake 173 | 174 | 175 | name 176 | string.quoted.double.qmake 177 | 178 | 179 | begin 180 | ` 181 | beginCaptures 182 | 183 | 0 184 | 185 | name 186 | punctuation.definition.string.begin.qmake 187 | 188 | 189 | end 190 | ` 191 | endCaptures 192 | 193 | 0 194 | 195 | name 196 | punctuation.definition.string.end.qmake 197 | 198 | 199 | name 200 | string.interpolated.qmake 201 | 202 | 203 | begin 204 | (\\) 205 | captures 206 | 207 | 1 208 | 209 | name 210 | string.regexp.qmake 211 | 212 | 213 | end 214 | ^[^#] 215 | name 216 | markup.other.assignment.continuation.qmake 217 | patterns 218 | 219 | 220 | captures 221 | 222 | 1 223 | 224 | name 225 | punctuation.definition.comment.qmake 226 | 227 | 228 | match 229 | (#).*$\n? 230 | name 231 | comment.line.number-sign.qmake 232 | 233 | 234 | 235 | 236 | begin 237 | (^[ \t]+)?(?=#) 238 | beginCaptures 239 | 240 | 1 241 | 242 | name 243 | punctuation.whitespace.comment.leading.qmake 244 | 245 | 246 | end 247 | (?!\G) 248 | patterns 249 | 250 | 251 | begin 252 | # 253 | beginCaptures 254 | 255 | 0 256 | 257 | name 258 | punctuation.definition.comment.qmake 259 | 260 | 261 | end 262 | \n 263 | name 264 | comment.line.number-sign.qmake 265 | 266 | 267 | 268 | 269 | 270 | 271 | begin 272 | \b(basename|CONFIG|contains|count|dirname|error|exists|find|for|include|infile|isEmpty|join|member|message|prompt|quote|sprintf|system|unique|warning)\s*(\() 273 | beginCaptures 274 | 275 | 1 276 | 277 | name 278 | entity.name.function.qmake 279 | 280 | 2 281 | 282 | name 283 | punctuation.definition.parameters.qmake 284 | 285 | 286 | comment 287 | entity.name.function.qmake 288 | contentName 289 | variable.parameter.qmake 290 | end 291 | (\)) 292 | endCaptures 293 | 294 | 1 295 | 296 | name 297 | punctuation.definition.parameters.qmake 298 | 299 | 300 | 301 | 302 | match 303 | \b(unix|win32|mac|debug|release)\b 304 | name 305 | keyword.other.scope.qmake 306 | 307 | 308 | begin 309 | (^[ \t]+)?(?=#) 310 | beginCaptures 311 | 312 | 1 313 | 314 | name 315 | punctuation.whitespace.comment.leading.qmake 316 | 317 | 318 | end 319 | (?!\G) 320 | patterns 321 | 322 | 323 | begin 324 | # 325 | beginCaptures 326 | 327 | 0 328 | 329 | name 330 | punctuation.definition.comment.qmake 331 | 332 | 333 | end 334 | \n 335 | name 336 | comment.line.number-sign.qmake 337 | 338 | 339 | 340 | 341 | scopeName 342 | source.qmake 343 | uuid 344 | 3D54A8F9-17CA-422A-A1D6-DE5F98B9DEF4 345 | 346 | 347 | -------------------------------------------------------------------------------- /Support/lib/assistant_search/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | struct ContentItem { 9 | ContentItem() 10 | : title( QString() ), reference( QString() ), depth( 0 ) {} 11 | ContentItem( const QString &t, const QString &r, int d ) 12 | : title( t ), reference( r ), depth( d ) {} 13 | QString title; 14 | QString reference; 15 | int depth; 16 | Q_DUMMY_COMPARISON_OPERATOR(ContentItem) 17 | }; 18 | 19 | QDataStream &operator>>(QDataStream &s, ContentItem &ci) 20 | { 21 | s >> ci.title; 22 | s >> ci.reference; 23 | s >> ci.depth; 24 | return s; 25 | } 26 | 27 | QDataStream &operator<<(QDataStream &s, const ContentItem &ci) 28 | { 29 | s << ci.title; 30 | s << ci.reference; 31 | s << ci.depth; 32 | return s; 33 | } 34 | 35 | struct IndexItem { 36 | IndexItem( const QString &k, const QString &r ) 37 | : keyword( k ), reference( r ) {} 38 | QString keyword; 39 | QString reference; 40 | }; 41 | 42 | 43 | struct IndexKeyword { 44 | IndexKeyword(const QString &kw, const QString &l) 45 | : keyword(kw), link(l) {} 46 | IndexKeyword() : keyword(QString()), link(QString()) {} 47 | bool operator<(const IndexKeyword &ik) const { 48 | return keyword.toLower() < ik.keyword.toLower(); 49 | } 50 | bool operator<=(const IndexKeyword &ik) const { 51 | return keyword.toLower() <= ik.keyword.toLower(); 52 | } 53 | bool operator>(const IndexKeyword &ik) const { 54 | return keyword.toLower() > ik.keyword.toLower(); 55 | } 56 | Q_DUMMY_COMPARISON_OPERATOR(IndexKeyword) 57 | QString keyword; 58 | QString link; 59 | }; 60 | 61 | QDataStream &operator>>(QDataStream &s, IndexKeyword &ik) 62 | { 63 | s >> ik.keyword; 64 | s >> ik.link; 65 | return s; 66 | } 67 | 68 | QDataStream &operator<<(QDataStream &s, const IndexKeyword &ik) 69 | { 70 | s << ik.keyword; 71 | s << ik.link; 72 | return s; 73 | } 74 | 75 | class IndexListModel: public QStringListModel 76 | { 77 | public: 78 | IndexListModel(QObject *parent = 0) 79 | : QStringListModel(parent) {} 80 | 81 | void clear() { contents.clear(); setStringList(QStringList()); } 82 | 83 | QString description(int index) const { return stringList().at(index); } 84 | QStringList links(int index) const { return contents.values(stringList().at(index)); } 85 | void addLink(const QString &description, const QString &link) { contents.insert(description, link); } 86 | 87 | void publish() { filter(QString(), QString()); } 88 | 89 | QModelIndex filter(const QString &s, const QString &real); 90 | 91 | virtual Qt::ItemFlags flags(const QModelIndex &index) const 92 | { return QStringListModel::flags(index) & ~Qt::ItemIsEditable; } 93 | 94 | private: 95 | QMultiMap contents; 96 | }; 97 | 98 | bool caseInsensitiveLessThan(const QString &as, const QString &bs) 99 | { 100 | const QChar *a = as.unicode(); 101 | const QChar *b = bs.unicode(); 102 | if (a == 0) 103 | return true; 104 | if (b == 0) 105 | return false; 106 | if (a == b) 107 | return false; 108 | int l=qMin(as.length(),bs.length()); 109 | while (l-- && a->toLower() == b->toLower()) 110 | a++,b++; 111 | if (l==-1) 112 | return (as.length() < bs.length()); 113 | return a->toLower().unicode() < b->toLower().unicode(); 114 | } 115 | 116 | /** 117 | * \a real is kinda a hack for the smart search, need a way to match a regexp to an item 118 | * How would you say the best match for Q.*Wiget is QWidget? 119 | */ 120 | QModelIndex IndexListModel::filter(const QString &s, const QString &real) 121 | { 122 | QStringList list; 123 | 124 | int goodMatch = -1; 125 | int perfectMatch = -1; 126 | if (s.isEmpty()) 127 | perfectMatch = 0; 128 | 129 | const QRegExp regExp(s); 130 | QMultiMap::iterator it = contents.begin(); 131 | QString lastKey; 132 | for (; it != contents.end(); ++it) { 133 | if (it.key() == lastKey) 134 | continue; 135 | lastKey = it.key(); 136 | const QString key = it.key(); 137 | if (key.contains(regExp) || key.contains(s, Qt::CaseInsensitive)) { 138 | list.append(key); 139 | //qDebug() << regExp << regExp.indexIn(s) << s << key << regExp.matchedLength(); 140 | if (perfectMatch == -1 && (key.startsWith(real, Qt::CaseInsensitive))) { 141 | if (goodMatch == -1) 142 | goodMatch = list.count() - 1; 143 | if (real.length() == key.length()) 144 | perfectMatch = list.count() - 1; 145 | } else if (perfectMatch > -1 && s == key) { 146 | perfectMatch = list.count() - 1; 147 | } 148 | } 149 | } 150 | 151 | int bestMatch = perfectMatch; 152 | if (bestMatch == -1) 153 | bestMatch = goodMatch; 154 | 155 | bestMatch = qMax(0, bestMatch); 156 | 157 | // sort the new list 158 | QString match; 159 | if (bestMatch >= 0 && list.count() > bestMatch) 160 | match = list[bestMatch]; 161 | qSort(list.begin(), list.end(), caseInsensitiveLessThan); 162 | setStringList(list); 163 | for (int i = 0; i < list.size(); ++i) { 164 | if (list.at(i) == match){ 165 | bestMatch = i; 166 | break; 167 | } 168 | } 169 | return index(bestMatch, 0, QModelIndex()); 170 | } 171 | 172 | class AssistantIndex 173 | { 174 | private: 175 | QString cacheFilesPath; 176 | IndexListModel *indexModel; 177 | QModelIndex currentIndex; 178 | bool _indexLoaded; 179 | bool fuzzySearch; 180 | 181 | typedef QList ContentList; 182 | QList > contentList; 183 | QMap titleMap; 184 | 185 | bool loadIndex() 186 | { 187 | QFile indexFile(cacheFilesPath + QDir::separator() + "indexdb40.default"); 188 | if (!indexFile.open(QFile::ReadOnly)) { 189 | qWarning("Unable to open index file %s", indexFile.fileName().toLatin1().data()); 190 | return false; 191 | } 192 | 193 | QDataStream ds(&indexFile); 194 | quint32 fileAges; 195 | ds >> fileAges; 196 | QList lst; 197 | ds >> lst; 198 | indexFile.close(); 199 | 200 | foreach (IndexKeyword idx, lst) 201 | indexModel->addLink(idx.keyword, idx.link); 202 | 203 | return true; 204 | } 205 | 206 | bool loadTitles() 207 | { 208 | QFile contentFile(cacheFilesPath + QDir::separator() + "contentdb40.default"); 209 | if (!contentFile.open(QFile::ReadOnly)) { 210 | qWarning("Unable to open content file %s", contentFile.fileName().toLatin1().data()); 211 | return false; 212 | } 213 | 214 | QDataStream ds(&contentFile); 215 | quint32 fileAges; 216 | ds >> fileAges; 217 | QString key; 218 | QList lst; 219 | while (!ds.atEnd()) { 220 | ds >> key; 221 | ds >> lst; 222 | contentList += qMakePair(key, QList(lst)); 223 | } 224 | contentFile.close(); 225 | 226 | //titleMapDone = true; 227 | titleMap.clear(); 228 | for(QList >::Iterator it = contentList.begin(); it != contentList.end(); ++it) { 229 | ContentList lst = (*it).second; 230 | foreach (ContentItem item, lst) { 231 | titleMap[item.reference] = item.title.trimmed(); 232 | } 233 | } 234 | return true; 235 | } 236 | 237 | QString removeAnchorFromLink(const QString &link) 238 | { 239 | int i = link.length(); 240 | int j = link.lastIndexOf('/'); 241 | int l = link.lastIndexOf(QDir::separator()); 242 | if (l > j) 243 | j = l; 244 | if (j > -1) { 245 | QString fileName = link.mid(j+1); 246 | int k = fileName.lastIndexOf('#'); 247 | if (k > -1) 248 | i = j + k + 1; 249 | } 250 | return link.left(i); 251 | } 252 | 253 | QString titleOfLink(const QString &link, const QString &description) 254 | { 255 | QString s = removeAnchorFromLink(link); 256 | s = titleMap[s]; 257 | if (s.isEmpty()) 258 | return link; 259 | 260 | if (!description.isEmpty()) 261 | s += " (" + description + ")"; 262 | else { 263 | QString anchor = link.mid(removeAnchorFromLink(link).length() + 1); 264 | if (anchor.length() > 1) 265 | s += " (" + anchor + ")"; 266 | } 267 | return s; 268 | } 269 | 270 | QModelIndex getCurrentIndex(QString searchString) 271 | { 272 | QModelIndex currentIndex; 273 | 274 | QRegExp atoz("[A-Z]"); 275 | int matches = searchString.count(atoz); 276 | 277 | if (matches > 0 && !searchString.contains(".*")) { 278 | int start = 0; 279 | QString newSearch; 280 | for (; matches > 0; --matches) { 281 | int match = searchString.indexOf(atoz, start+1); 282 | if (match <= start) 283 | continue; 284 | newSearch += searchString.mid(start, match-start); 285 | newSearch += ".*"; 286 | start = match; 287 | } 288 | newSearch += searchString.mid(start); 289 | currentIndex = indexModel->filter(newSearch, searchString); 290 | } 291 | else 292 | currentIndex = indexModel->filter(searchString, searchString); 293 | 294 | return currentIndex; 295 | } 296 | 297 | void _displayResults(QStringList linkList, QStringList linkNames) 298 | { 299 | for (int i = 0; i < linkList.count(); i++) { 300 | printf("* %s|%s\n", linkNames[i].toLatin1().data(), linkList[i].toLatin1().data()); 301 | } 302 | } 303 | 304 | public: 305 | AssistantIndex(bool fuzzy) { 306 | fuzzySearch = fuzzy; 307 | cacheFilesPath = QDir::homePath() + QLatin1String("/.assistant"); 308 | indexModel = new IndexListModel; 309 | _indexLoaded = loadIndex(); 310 | loadTitles(); 311 | } 312 | 313 | ~AssistantIndex() { 314 | delete indexModel; 315 | } 316 | 317 | bool indexLoaded() { return _indexLoaded; } 318 | 319 | bool search(QString searchString) { 320 | currentIndex = getCurrentIndex(searchString); 321 | int row = currentIndex.row(); 322 | if (row == -1 || row >= indexModel->rowCount()) { 323 | qWarning("No matches found for query '%s'", searchString.toLatin1().data()); 324 | return false; 325 | } 326 | return true; 327 | } 328 | 329 | void displayResults() { 330 | QStringList linkList; 331 | QStringList linkNames; 332 | 333 | if (fuzzySearch) { 334 | for (int i = 0; i < indexModel->stringList().count(); i++) { 335 | QStringList links = indexModel->links(i); 336 | foreach (QString link, links) { 337 | linkList << link; 338 | linkNames << titleOfLink(link, indexModel->stringList()[i]); 339 | } 340 | } 341 | } 342 | else { 343 | int row = currentIndex.row(); 344 | QString description = indexModel->description(row); 345 | QStringList links = indexModel->links(row); 346 | 347 | if (links.count() == 1) { 348 | linkList << links.first(); 349 | linkNames << titleOfLink(links.first(), description); 350 | } 351 | else { 352 | qSort(links); 353 | foreach (QString link, links) { 354 | linkList << link; 355 | linkNames << titleOfLink(link, description); 356 | } 357 | } 358 | } 359 | _displayResults(linkList, linkNames); 360 | } 361 | }; 362 | 363 | int main (int argc, char *argv[]) 364 | { 365 | if (argc < 2) { 366 | qWarning("USAGE: %s search_string [fuzzy]", argv[0]); 367 | return 1; 368 | } 369 | 370 | AssistantIndex assistant(argc == 3 && QString(argv[2]) == "fuzzy"); 371 | if (!assistant.indexLoaded()) 372 | return 1; 373 | 374 | if (!assistant.search(argv[1])) 375 | return 1; 376 | 377 | assistant.displayResults(); 378 | return 0; 379 | } -------------------------------------------------------------------------------- /Support/AddFile/AddFile.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 44; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 4DDCA7070ACC9A6100E082CE /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */; }; 11 | 4DDCA7080ACC9A6100E082CE /* rb_main.rb in Resources */ = {isa = PBXBuildFile; fileRef = E8F5E25803AEB7C803A81C6F /* rb_main.rb */; }; 12 | 4DDCA70A0ACC9A6100E082CE /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.m */; settings = {ATTRIBUTES = (); }; }; 13 | 4DDCA70C0ACC9A6100E082CE /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */; }; 14 | 4DDCA70D0ACC9A6100E082CE /* RubyCocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E8F5E24E03AEB6EC03A81C6F /* RubyCocoa.framework */; }; 15 | 792E225B0D387ACC00200F3A /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 792E22590D387ACC00200F3A /* MainMenu.xib */; }; 16 | 7962FE6B0CD399FD00292820 /* AppController.rb in Resources */ = {isa = PBXBuildFile; fileRef = 7962FE6A0CD399FD00292820 /* AppController.rb */; }; 17 | /* End PBXBuildFile section */ 18 | 19 | /* Begin PBXFileReference section */ 20 | 089C165DFE840E0CC02AAC07 /* English */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/InfoPlist.strings; sourceTree = ""; }; 21 | 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = ""; }; 22 | 29B97316FDCFA39411CA2CEA /* main.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 23 | 29B97324FDCFA39411CA2CEA /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = ""; }; 24 | 29B97325FDCFA39411CA2CEA /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = ""; }; 25 | 4DDCA7110ACC9A6100E082CE /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.xml; path = Info.plist; sourceTree = ""; }; 26 | 4DDCA7120ACC9A6100E082CE /* AddFile.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = AddFile.app; sourceTree = BUILT_PRODUCTS_DIR; }; 27 | 792E225A0D387ACC00200F3A /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = English.lproj/MainMenu.xib; sourceTree = ""; }; 28 | 7962FE6A0CD399FD00292820 /* AppController.rb */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.ruby; path = AppController.rb; sourceTree = ""; }; 29 | E8F5E24E03AEB6EC03A81C6F /* RubyCocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = RubyCocoa.framework; path = /System/Library/Frameworks/RubyCocoa.framework; sourceTree = ""; }; 30 | E8F5E25803AEB7C803A81C6F /* rb_main.rb */ = {isa = PBXFileReference; lastKnownFileType = text.script.ruby; path = rb_main.rb; sourceTree = ""; }; 31 | /* End PBXFileReference section */ 32 | 33 | /* Begin PBXFrameworksBuildPhase section */ 34 | 4DDCA70B0ACC9A6100E082CE /* Frameworks */ = { 35 | isa = PBXFrameworksBuildPhase; 36 | buildActionMask = 2147483647; 37 | files = ( 38 | 4DDCA70C0ACC9A6100E082CE /* Cocoa.framework in Frameworks */, 39 | 4DDCA70D0ACC9A6100E082CE /* RubyCocoa.framework in Frameworks */, 40 | ); 41 | runOnlyForDeploymentPostprocessing = 0; 42 | }; 43 | /* End PBXFrameworksBuildPhase section */ 44 | 45 | /* Begin PBXGroup section */ 46 | 080E96DDFE201D6D7F000001 /* Classes */ = { 47 | isa = PBXGroup; 48 | children = ( 49 | 7962FE6A0CD399FD00292820 /* AppController.rb */, 50 | ); 51 | name = Classes; 52 | sourceTree = ""; 53 | }; 54 | 1058C7A0FEA54F0111CA2CBB /* Linked Frameworks */ = { 55 | isa = PBXGroup; 56 | children = ( 57 | 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */, 58 | E8F5E24E03AEB6EC03A81C6F /* RubyCocoa.framework */, 59 | ); 60 | name = "Linked Frameworks"; 61 | sourceTree = ""; 62 | }; 63 | 1058C7A2FEA54F0111CA2CBB /* Other Frameworks */ = { 64 | isa = PBXGroup; 65 | children = ( 66 | 29B97325FDCFA39411CA2CEA /* Foundation.framework */, 67 | 29B97324FDCFA39411CA2CEA /* AppKit.framework */, 68 | ); 69 | name = "Other Frameworks"; 70 | sourceTree = ""; 71 | }; 72 | 19C28FACFE9D520D11CA2CBB /* Products */ = { 73 | isa = PBXGroup; 74 | children = ( 75 | 4DDCA7120ACC9A6100E082CE /* AddFile.app */, 76 | ); 77 | name = Products; 78 | sourceTree = ""; 79 | }; 80 | 29B97314FDCFA39411CA2CEA /* AddFile */ = { 81 | isa = PBXGroup; 82 | children = ( 83 | 080E96DDFE201D6D7F000001 /* Classes */, 84 | 29B97315FDCFA39411CA2CEA /* Other Sources */, 85 | 29B97317FDCFA39411CA2CEA /* Resources */, 86 | 29B97323FDCFA39411CA2CEA /* Frameworks */, 87 | 19C28FACFE9D520D11CA2CBB /* Products */, 88 | 4DDCA7110ACC9A6100E082CE /* Info.plist */, 89 | ); 90 | name = AddFile; 91 | sourceTree = ""; 92 | }; 93 | 29B97315FDCFA39411CA2CEA /* Other Sources */ = { 94 | isa = PBXGroup; 95 | children = ( 96 | 29B97316FDCFA39411CA2CEA /* main.m */, 97 | E8F5E25803AEB7C803A81C6F /* rb_main.rb */, 98 | ); 99 | name = "Other Sources"; 100 | sourceTree = ""; 101 | }; 102 | 29B97317FDCFA39411CA2CEA /* Resources */ = { 103 | isa = PBXGroup; 104 | children = ( 105 | 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */, 106 | 792E22590D387ACC00200F3A /* MainMenu.xib */, 107 | ); 108 | name = Resources; 109 | sourceTree = ""; 110 | }; 111 | 29B97323FDCFA39411CA2CEA /* Frameworks */ = { 112 | isa = PBXGroup; 113 | children = ( 114 | 1058C7A0FEA54F0111CA2CBB /* Linked Frameworks */, 115 | 1058C7A2FEA54F0111CA2CBB /* Other Frameworks */, 116 | ); 117 | name = Frameworks; 118 | sourceTree = ""; 119 | }; 120 | /* End PBXGroup section */ 121 | 122 | /* Begin PBXHeadersBuildPhase section */ 123 | 4DDCA7040ACC9A6100E082CE /* Headers */ = { 124 | isa = PBXHeadersBuildPhase; 125 | buildActionMask = 2147483647; 126 | files = ( 127 | ); 128 | runOnlyForDeploymentPostprocessing = 0; 129 | }; 130 | /* End PBXHeadersBuildPhase section */ 131 | 132 | /* Begin PBXNativeTarget section */ 133 | 4DDCA7030ACC9A6100E082CE /* AddFile */ = { 134 | isa = PBXNativeTarget; 135 | buildConfigurationList = 4DDCA70E0ACC9A6100E082CE /* Build configuration list for PBXNativeTarget "AddFile" */; 136 | buildPhases = ( 137 | 4DDCA7040ACC9A6100E082CE /* Headers */, 138 | 4DDCA7050ACC9A6100E082CE /* Resources */, 139 | 4DDCA7090ACC9A6100E082CE /* Sources */, 140 | 4DDCA70B0ACC9A6100E082CE /* Frameworks */, 141 | ); 142 | buildRules = ( 143 | ); 144 | dependencies = ( 145 | ); 146 | name = AddFile; 147 | productInstallPath = "$(HOME)/Applications"; 148 | productName = AddFile; 149 | productReference = 4DDCA7120ACC9A6100E082CE /* AddFile.app */; 150 | productType = "com.apple.product-type.application"; 151 | }; 152 | /* End PBXNativeTarget section */ 153 | 154 | /* Begin PBXProject section */ 155 | 29B97313FDCFA39411CA2CEA /* Project object */ = { 156 | isa = PBXProject; 157 | buildConfigurationList = 4D7A7B570ABF745500C2D4C0 /* Build configuration list for PBXProject "AddFile" */; 158 | compatibilityVersion = "Xcode 3.0"; 159 | hasScannedForEncodings = 0; 160 | mainGroup = 29B97314FDCFA39411CA2CEA /* AddFile */; 161 | projectDirPath = ""; 162 | projectRoot = ""; 163 | targets = ( 164 | 4DDCA7030ACC9A6100E082CE /* AddFile */, 165 | ); 166 | }; 167 | /* End PBXProject section */ 168 | 169 | /* Begin PBXResourcesBuildPhase section */ 170 | 4DDCA7050ACC9A6100E082CE /* Resources */ = { 171 | isa = PBXResourcesBuildPhase; 172 | buildActionMask = 2147483647; 173 | files = ( 174 | 4DDCA7070ACC9A6100E082CE /* InfoPlist.strings in Resources */, 175 | 4DDCA7080ACC9A6100E082CE /* rb_main.rb in Resources */, 176 | 7962FE6B0CD399FD00292820 /* AppController.rb in Resources */, 177 | 792E225B0D387ACC00200F3A /* MainMenu.xib in Resources */, 178 | ); 179 | runOnlyForDeploymentPostprocessing = 0; 180 | }; 181 | /* End PBXResourcesBuildPhase section */ 182 | 183 | /* Begin PBXSourcesBuildPhase section */ 184 | 4DDCA7090ACC9A6100E082CE /* Sources */ = { 185 | isa = PBXSourcesBuildPhase; 186 | buildActionMask = 2147483647; 187 | files = ( 188 | 4DDCA70A0ACC9A6100E082CE /* main.m in Sources */, 189 | ); 190 | runOnlyForDeploymentPostprocessing = 0; 191 | }; 192 | /* End PBXSourcesBuildPhase section */ 193 | 194 | /* Begin PBXVariantGroup section */ 195 | 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */ = { 196 | isa = PBXVariantGroup; 197 | children = ( 198 | 089C165DFE840E0CC02AAC07 /* English */, 199 | ); 200 | name = InfoPlist.strings; 201 | sourceTree = ""; 202 | }; 203 | 792E22590D387ACC00200F3A /* MainMenu.xib */ = { 204 | isa = PBXVariantGroup; 205 | children = ( 206 | 792E225A0D387ACC00200F3A /* English */, 207 | ); 208 | name = MainMenu.xib; 209 | sourceTree = ""; 210 | }; 211 | /* End PBXVariantGroup section */ 212 | 213 | /* Begin XCBuildConfiguration section */ 214 | 4D7A7B580ABF745500C2D4C0 /* Debug */ = { 215 | isa = XCBuildConfiguration; 216 | buildSettings = { 217 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 218 | GCC_WARN_UNUSED_VARIABLE = YES; 219 | PREBINDING = NO; 220 | SDKROOT = "$(DEVELOPER_SDK_DIR)/MacOSX10.5.sdk"; 221 | }; 222 | name = Debug; 223 | }; 224 | 4D7A7B590ABF745500C2D4C0 /* Release */ = { 225 | isa = XCBuildConfiguration; 226 | buildSettings = { 227 | ARCHS = ( 228 | ppc, 229 | i386, 230 | ); 231 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 232 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 233 | GCC_WARN_UNUSED_VARIABLE = YES; 234 | PREBINDING = NO; 235 | SDKROOT = "$(DEVELOPER_SDK_DIR)/MacOSX10.5.sdk"; 236 | }; 237 | name = Release; 238 | }; 239 | 4DDCA70F0ACC9A6100E082CE /* Debug */ = { 240 | isa = XCBuildConfiguration; 241 | buildSettings = { 242 | COPY_PHASE_STRIP = NO; 243 | GCC_DYNAMIC_NO_PIC = NO; 244 | GCC_ENABLE_FIX_AND_CONTINUE = YES; 245 | GCC_MODEL_TUNING = G5; 246 | GCC_OPTIMIZATION_LEVEL = 0; 247 | INFOPLIST_FILE = Info.plist; 248 | INSTALL_PATH = "$(HOME)/Applications"; 249 | PRODUCT_NAME = AddFile; 250 | WRAPPER_EXTENSION = app; 251 | ZERO_LINK = YES; 252 | }; 253 | name = Debug; 254 | }; 255 | 4DDCA7100ACC9A6100E082CE /* Release */ = { 256 | isa = XCBuildConfiguration; 257 | buildSettings = { 258 | ARCHS = ( 259 | ppc, 260 | i386, 261 | ); 262 | GCC_MODEL_TUNING = G5; 263 | INFOPLIST_FILE = Info.plist; 264 | INSTALL_PATH = "$(HOME)/Applications"; 265 | PRODUCT_NAME = AddFile; 266 | WRAPPER_EXTENSION = app; 267 | }; 268 | name = Release; 269 | }; 270 | /* End XCBuildConfiguration section */ 271 | 272 | /* Begin XCConfigurationList section */ 273 | 4D7A7B570ABF745500C2D4C0 /* Build configuration list for PBXProject "AddFile" */ = { 274 | isa = XCConfigurationList; 275 | buildConfigurations = ( 276 | 4D7A7B580ABF745500C2D4C0 /* Debug */, 277 | 4D7A7B590ABF745500C2D4C0 /* Release */, 278 | ); 279 | defaultConfigurationIsVisible = 0; 280 | defaultConfigurationName = Release; 281 | }; 282 | 4DDCA70E0ACC9A6100E082CE /* Build configuration list for PBXNativeTarget "AddFile" */ = { 283 | isa = XCConfigurationList; 284 | buildConfigurations = ( 285 | 4DDCA70F0ACC9A6100E082CE /* Debug */, 286 | 4DDCA7100ACC9A6100E082CE /* Release */, 287 | ); 288 | defaultConfigurationIsVisible = 0; 289 | defaultConfigurationName = Release; 290 | }; 291 | /* End XCConfigurationList section */ 292 | }; 293 | rootObject = 29B97313FDCFA39411CA2CEA /* Project object */; 294 | } 295 | -------------------------------------------------------------------------------- /Support/bin/build_qt_project.rb: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby18 2 | 3 | $bundle = ENV['TM_BUNDLE_SUPPORT'] 4 | $support = ENV['TM_SUPPORT_PATH'] 5 | 6 | require $bundle + "/bin/find_qt_project" 7 | require $bundle + "/lib/run_helper" 8 | require $support + "/lib/tm_parser" 9 | require $bundle + "/lib/Builder" 10 | 11 | SCRIPT = <&1") 172 | o.each_line do |line| 173 | yield line.chop 174 | end 175 | o.close 176 | end 177 | 178 | class Formatter 179 | attr_reader :mup 180 | 181 | def initialize 182 | @mup = Builder::XmlMarkup.new(:target => STDOUT) 183 | class << @mup 184 | attr_writer :div_stack # stack of nested div classes 185 | attr_accessor :div_count # absolute count of divs 186 | attr_accessor :accumulated_prefix # prefix text to insert in next div 187 | 188 | def borrow_xcode_icon(icon_name, background=false) 189 | image( :class => background ? "backgroundicon" : "icon", 190 | :src => "file:///Applications/Xcode.app/Contents/OtherFrameworks/DevToolsInterface.framework/Versions/A/Resources/#{icon_name}" ) 191 | end 192 | 193 | def div_stack 194 | @div_stack = Array.new unless defined?(@div_stack) 195 | @div_stack 196 | end 197 | 198 | def current_div 199 | div_stack.last 200 | end 201 | 202 | def start_tag!(tag) 203 | _start_tag( tag, nil ) 204 | end 205 | 206 | def end_tag!(tag) 207 | _end_tag(tag) 208 | end 209 | 210 | def _start_tag( tag, thing, thingtwo = nil ) 211 | # puts "[start:#{tag}]" 212 | super 213 | end 214 | 215 | def _end_tag(tag) 216 | # puts "[end:#{tag}]" 217 | super 218 | STDOUT.flush 219 | end 220 | 221 | def a_textmate!( path, line_number ) 222 | line_number = 1 if line_number.nil? 223 | a( "href" => "txmt://open?url=file://#{path}&line=#{line_number}" ) { 224 | text!( File.basename(path) + ":" + line_number.to_s ) 225 | } 226 | end 227 | 228 | # accumulate content that will prefix the next div 229 | def accumulate!(content) 230 | @accumulated_prefix = '' unless defined?(@accumulated_prefix) 231 | @accumulated_prefix << content 232 | end 233 | 234 | # div hierarchy: 235 | # 1. target; target (BUILD NATIVE TARGET "Frobozz" .*) 236 | # 2. command; build commands (CompileC .*) 237 | # 3. details; build details (g++-3.3 .*) 238 | # 4. info, warning, error; build warnings/errors -- actually a sibling of the build commands, so that they default to visible but are still hidden with the target. 239 | # Note that the client is partly responsible for maintaining the hierarchy. 240 | 241 | STACK_LEVEL_TOP = 1 242 | STACK_LEVEL_COMMAND_AND_ERRORS = 2 243 | STACK_LEVEL_DETAILS = 3 244 | 245 | STACK_LEVEL_TABLE = {'target' => 1, 246 | 'command' => 2, 247 | 'details' => 3, 248 | 'info' => 2, 249 | 'error' => 2, 250 | 'warning' => 2} 251 | 252 | def stacklevel_for_class(newclass) 253 | 254 | stacklevel = STACK_LEVEL_TABLE[newclass] 255 | stacklevel = 0 if stacklevel.nil? 256 | stacklevel 257 | end 258 | 259 | # pop appropriate divs for newclass 260 | def autopop(newclass) 261 | new_level = stacklevel_for_class(newclass) 262 | current_level = stacklevel_for_class(current_div) 263 | 264 | case 265 | # top level replaces top level on the stack 266 | when new_level == current_level 267 | end_div!(current_div) 268 | 269 | when new_level > current_level 270 | # only commands have details; errors do not. 271 | if (newclass == 'details') and 272 | (current_div != 'command') and 273 | (current_level == STACK_LEVEL_COMMAND_AND_ERRORS) 274 | end_div_count!(1) 275 | end 276 | 277 | when new_level < current_level 278 | end_div_count!(current_level - new_level) 279 | # and recurse to check for equal level 280 | autopop(newclass) 281 | end 282 | 283 | end 284 | 285 | # accumulative div -- block yields the div title 286 | # visibility can be :visible, :hidden, :always_visible 287 | def new_div!( nclass, content = "", visibility = :show, &block ) 288 | div_id = nil 289 | 290 | @div_count = 0 unless defined?(@div_count) 291 | @accumulated_prefix = '' unless defined?(@accumulated_prefix) 292 | 293 | unless nclass === current_div 294 | @div_count += 1 295 | div_id = "z_" + @div_count.to_s 296 | 297 | # end the old div 298 | autopop(nclass) 299 | 300 | # start the new div and the inner content div 301 | div_stack.push nclass 302 | 303 | _start_tag( "div", "class" => nclass, "id" => div_id ) 304 | 305 | # visibility = :show_always # debugging 306 | if (visibility == :hide) or (visibility == :show) then 307 | 308 | hide_if_hidden_style = (visibility == :hide) ? "display: none;" : ""; 309 | show_if_hidden_style = (visibility == :hide) ? "" : "display: none;"; 310 | 311 | # add show/hide toggle above the inner content div 312 | div( "class" => "showhide" ) { 313 | 314 | a( "Hide Details", 'href' => "javascript:hideElement('#{div_id}')", 'id' => div_id + '_hide', 'style' => hide_if_hidden_style ) 315 | a( "Show Details", 'href' => "javascript:showElement('#{div_id}')", 'id' => div_id + '_show', 'style' => show_if_hidden_style ) 316 | } 317 | end 318 | 319 | block.call unless block.nil? 320 | 321 | # show the user at least the title of the div 322 | STDOUT.flush 323 | 324 | _start_tag( "div", "class" => "inner", "id" => div_id + "_c", 'style' => hide_if_hidden_style ) 325 | 326 | end 327 | 328 | # output the div prefix for error/message boxes 329 | unless @accumulated_prefix.empty? || current_div == 'target' 330 | 331 | @accumulated_prefix.each_line do |prefixline| 332 | 333 | # process any file paths 334 | match = /(\/.+?):(\d+)?/.match(prefixline) 335 | 336 | if match.nil? then 337 | text!( prefixline ) 338 | else 339 | first = match.begin(1) 340 | last = match.end(2) 341 | last = match.end(1) if last.nil? 342 | 343 | text!(prefixline[0...(first)]) 344 | 345 | a_textmate!( match[1], match[2] ) 346 | 347 | text!(prefixline[last...(prefixline.length - 1)]) 348 | end 349 | br 350 | end 351 | 352 | @accumulated_prefix = '' 353 | end 354 | 355 | text! content 356 | 357 | div_id 358 | end 359 | 360 | # wrap up any loose ends 361 | def end_div!( popdiv ) 362 | if div_stack.include?(popdiv) 363 | loop do 364 | # puts "pop #{div_stack.last}: #{div_stack.inspect}" 365 | _end_tag("div") # inner 366 | _end_tag("div") # outer 367 | break if (@div_stack.pop == popdiv || @div_stack.size == 0) 368 | end 369 | end 370 | end 371 | 372 | def end_div_count!( count ) 373 | count.times do 374 | # puts "pop #{div_stack.last}: #{div_stack.inspect}" 375 | div_stack.pop 376 | _end_tag("div") # inner 377 | _end_tag("div") # outer 378 | end 379 | end 380 | 381 | def normal!(string) 382 | # build noise, either part of the toplevel target info or part of the details of a build command 383 | divclass = (stacklevel_for_class(current_div) > STACK_LEVEL_TOP) ? "details" : "target" 384 | new_div!( divclass, string, (divclass == "target") ? :show : :always_show ) 385 | br 386 | end 387 | 388 | end 389 | 390 | start 391 | end 392 | 393 | private 394 | def start 395 | @mup.start_tag!("html") 396 | @mup.head { 397 | @mup.title("Building Qt Project") 398 | @mup.style( STYLE, "type" => "text/css") 399 | @mup.script( SCRIPT, "language" => "JavaScript" ) 400 | } 401 | @mup.start_tag!("body") 402 | 403 | @mup.p( :class => "backgroundtext" ) do 404 | @mup.borrow_xcode_icon("build-32.tiff", true) # true -> background icon 405 | @mup.text("Building Qt Project") 406 | end 407 | STDOUT.flush 408 | end 409 | 410 | def play_sound(sound) 411 | if ENV['TM_MUTE'].nil? then 412 | %x{cd "#{$support}"; bin/play Sounds/#{sound} &>/dev/null &} 413 | end 414 | end 415 | 416 | public 417 | # text that is part of a message to appear later 418 | def message_prefix( line ) 419 | @mup.accumulate!( line ) 420 | end 421 | 422 | def build_noise( line ) 423 | @mup.normal!( line ) 424 | end 425 | 426 | def error_message(cssclass, path, line, error_desc) 427 | cssclass = cssclass.downcase 428 | cssclass, icon = case cssclass 429 | when "", "error" 430 | ["error", "XCBuildErrorIcon.tiff"] 431 | when "message", "info" 432 | ["info", "globe.tiff"] 433 | when "warning" 434 | ["warning", "XCBuildWarningIcon.tiff"] 435 | else 436 | [cssclass, "globe.tiff"] 437 | end 438 | 439 | @mup.new_div!(cssclass) do 440 | @mup.h2 do 441 | @mup.borrow_xcode_icon(icon) 442 | @mup.text(cssclass) 443 | end 444 | end 445 | 446 | @mup.p { 447 | @mup.a_textmate!(path, line) 448 | @mup.text!(":" + error_desc) 449 | } 450 | end 451 | 452 | def success(message) 453 | @mup.new_div!("info", "", :hide) do 454 | @mup.h2 do 455 | @mup.borrow_xcode_icon("globe.tiff", true) 456 | @mup.text(message.split(" ").collect { |word| word.capitalize }.join(" ") ) 457 | end 458 | end 459 | play_sound 'Harp.wav' 460 | end 461 | 462 | def failure 463 | @mup.new_div!("error", "", :show) do 464 | @mup.h2 do 465 | @mup.borrow_xcode_icon("XCBuildErrorIcon.tiff") 466 | @mup.text("Build Failed") 467 | end 468 | end 469 | play_sound 'Whistle.wav' 470 | end 471 | 472 | def complete 473 | # wrap up any loose ends 474 | @mup.end_div!("target") 475 | 476 | @mup.end_tag!("body") 477 | @mup.end_tag!("html") 478 | end 479 | end 480 | 481 | $f = Formatter.new 482 | 483 | $num_errors = 0 484 | def parse_errors(name, cmd) 485 | $f.mup.new_div!("target") do 486 | $f.mup.h2(name) 487 | end 488 | 489 | run_command(cmd) do |line| 490 | case line 491 | # Error prefix text 492 | when /^\s*((In file included from)|from)(\s*)(\/.*?):/ 493 | formatter.message_prefix( line ) 494 | 495 | # :: error description 496 | when /^(.*?):(?:(\d+):)\s*(.*?)$/ 497 | rfile, no, error = $1, $2, $3 498 | $num_errors += 1 if error =~ /error/ 499 | file = File.expand_path(rfile, $pwd) 500 | if File.exists?(file) 501 | if error =~ /^\s*(error|warning|info|message)/i 502 | cssclass = $1 503 | else 504 | cssclass = "" 505 | end 506 | 507 | $f.error_message(cssclass, file, no, error) 508 | else 509 | $f.build_noise(line) 510 | end 511 | 512 | # some random file path as the first element of a line 513 | when /^\s*(\s*)(\/.*?):/ 514 | if File.exist?($2) 515 | formatter.message_prefix( line ) 516 | else 517 | formatter.build_noise( line ) 518 | end 519 | else 520 | $f.build_noise(line) 521 | end 522 | STDOUT.flush 523 | end 524 | 525 | $f.mup.end_div!("target") 526 | end 527 | 528 | begin 529 | project = QtProjectSearch.find_project 530 | $pwd = File.dirname(project) 531 | Dir.chdir($pwd) 532 | 533 | if not File.exists? "Makefile" 534 | # Make sure qmake is in PATH 535 | parse_errors("Running qmake...", "qmake") 536 | end 537 | 538 | if File.exists? "Makefile" 539 | parse_errors("Running make...", "make") 540 | end 541 | 542 | if $num_errors > 0 543 | $f.failure 544 | else 545 | $f.success("Project was successfully compiled") 546 | end 547 | rescue Exception => e 548 | $f.error_message("", "", nil, e.message) 549 | $f.failure 550 | ensure 551 | $f.complete 552 | end 553 | 554 | exit 1 if $num_errors > 0 555 | -------------------------------------------------------------------------------- /Support/lib/Builder.rb: -------------------------------------------------------------------------------- 1 | # This is a single-file version of Jim Weirich's Builder suite version 1.2.3, 2 | # including some very minor tweaks required to make it work with Ruby 1.6.8. 3 | # Copyright 2004 by Jim Weirich (jim@weirichhouse.org). 4 | # All rights reserved. 5 | # 6 | # Create XML markup easily. All (well, almost all) methods sent to 7 | # an XmlMarkup object will be translated to the equivalent XML 8 | # markup. Any method with a block will be treated as an XML markup 9 | # tag with nested markup in the block. 10 | # 11 | # Examples will demonstrate this easier than words. In the 12 | # following, +xm+ is an +XmlMarkup+ object. 13 | # 14 | # xm.em("emphasized") # => emphasized 15 | # xm.em { xmm.b("emp & bold") } # => emph & bold 16 | # xm.a("A Link", "href"=>"http://onestepback.org") 17 | # # => A Link 18 | # xm.div { br } # =>

19 | # xm.target("name"=>"compile", "option"=>"fast") 20 | # # => 21 | # # NOTE: order of attributes is not specified. 22 | # 23 | # xm.instruct! # 24 | # xm.html { # 25 | # xm.head { # 26 | # xm.title("History") # History 27 | # } # 28 | # xm.body { # 29 | # xm.comment! "HI" # 30 | # xm.h1("Header") #

Header

31 | # xm.p("paragraph") #

paragraph

32 | # } # 33 | # } # 34 | # 35 | 36 | 37 | # blankslate.rb: 38 | 39 | #!/usr/bin/env ruby 40 | #-- 41 | # Copyright 2004 by Jim Weirich (jim@weirichhouse.org). 42 | # All rights reserved. 43 | 44 | # Permission is granted for use, copying, modification, distribution, 45 | # and distribution of modified versions of this work as long as the 46 | # above copyright notice is included. 47 | #++ 48 | 49 | module Builder 50 | 51 | # BlankSlate provides an abstract base class with no predefined 52 | # methods (except for \_\_send__ and \_\_id__). 53 | # BlankSlate is useful as a base class when writing classes that 54 | # depend upon method_missing (e.g. dynamic proxies). 55 | class BlankSlate 56 | class << self 57 | def hide(name) 58 | undef_method name if 59 | instance_methods.include?(name.to_s) and 60 | name !~ /^(__|instance_eval)/ 61 | end 62 | end 63 | 64 | instance_methods.each { |m| hide(m) } 65 | end 66 | end 67 | 68 | # Since Ruby is very dynamic, methods added to the ancestors of 69 | # BlankSlate after BlankSlate is defined will show up in the 70 | # list of available BlankSlate methods. We handle this by defining a hook in the Object and Kernel classes that will hide any defined 71 | module Kernel 72 | class << self 73 | alias_method :blank_slate_method_added, :method_added 74 | def method_added(name) 75 | blank_slate_method_added(name) 76 | return if self != Kernel 77 | Builder::BlankSlate.hide(name) 78 | end 79 | end 80 | end 81 | 82 | class Object 83 | class << self 84 | alias_method :blank_slate_method_added, :method_added 85 | def method_added(name) 86 | blank_slate_method_added(name) 87 | return if self != Object 88 | Builder::BlankSlate.hide(name) 89 | end 90 | end 91 | end 92 | 93 | # xmlbase.rb 94 | module Builder 95 | 96 | # Generic error for builder 97 | class IllegalBlockError < RuntimeError; end 98 | 99 | # XmlBase is a base class for building XML builders. See 100 | # Builder::XmlMarkup and Builder::XmlEvents for examples. 101 | class XmlBase < BlankSlate 102 | 103 | # Create an XML markup builder. 104 | # 105 | # out:: Object receiving the markup.1 +out+ must respond to 106 | # <<. 107 | # indent:: Number of spaces used for indentation (0 implies no 108 | # indentation and no line breaks). 109 | # initial:: Level of initial indentation. 110 | # 111 | def initialize(indent=0, initial=0) 112 | @indent = indent 113 | @level = initial 114 | @self = nil 115 | end 116 | 117 | # Create a tag named +sym+. Other than the first argument which 118 | # is the tag name, the arguements are the same as the tags 119 | # implemented via method_missing. 120 | def tag!(sym, *args, &block) 121 | self.__send__(sym, *args, &block) 122 | end 123 | 124 | # Create XML markup based on the name of the method. This method 125 | # is never invoked directly, but is called for each markup method 126 | # in the markup block. 127 | def method_missing(sym, *args, &block) 128 | text = nil 129 | attrs = nil 130 | sym = "#{sym}:#{args.shift}" if args.first.kind_of?(Symbol) 131 | args.each do |arg| 132 | case arg 133 | when Hash 134 | attrs ||= {} 135 | attrs.update(arg) # was merge!, which ruby 1.6.8 doesn't support 136 | else 137 | text ||= '' 138 | text << arg.to_s 139 | end 140 | end 141 | if block 142 | unless text.nil? 143 | raise ArgumentError, "XmlMarkup cannot mix a text argument with a block" 144 | end 145 | _capture_outer_self(block) if @self.nil? 146 | _indent 147 | _start_tag(sym, attrs) 148 | _newline 149 | _nested_structures(block) 150 | _indent 151 | _end_tag(sym) 152 | _newline 153 | elsif text.nil? 154 | _indent 155 | _start_tag(sym, attrs, true) 156 | _newline 157 | else 158 | _indent 159 | _start_tag(sym, attrs) 160 | text! text 161 | _end_tag(sym) 162 | _newline 163 | end 164 | @target 165 | end 166 | 167 | # Append text to the output target. Escape any markup. May be 168 | # used within the markup brakets as: 169 | # 170 | # builder.p { |b| b.br; b.text! "HI" } #=>


HI

171 | def text!(text) 172 | _text(_escape(text)) 173 | end 174 | 175 | # Append text to the output target without escaping any markup. 176 | # May be used within the markup brakets as: 177 | # 178 | # builder.p { |x| x << "
HI" } #=>


HI

179 | # 180 | # This is useful when using non-builder enabled software that 181 | # generates strings. Just insert the string directly into the 182 | # builder without changing the inserted markup. 183 | # 184 | # It is also useful for stacking builder objects. Builders only 185 | # use << to append to the target, so by supporting this 186 | # method/operation builders can use other builders as their 187 | # targets. 188 | def <<(text) 189 | _text(text) 190 | end 191 | 192 | # For some reason, nil? is sent to the XmlMarkup object. If nil? 193 | # is not defined and method_missing is invoked, some strange kind 194 | # of recursion happens. Since nil? won't ever be an XML tag, it 195 | # is pretty safe to define it here. (Note: this is an example of 196 | # cargo cult programming, 197 | # cf. http://fishbowl.pastiche.org/2004/10/13/cargo_cult_programming). 198 | def nil? 199 | false 200 | end 201 | 202 | private 203 | 204 | def _escape(text) 205 | text. 206 | gsub(%r{&}, '&'). 207 | gsub(%r{<}, '<'). 208 | gsub(%r{>}, '>') 209 | end 210 | 211 | def _capture_outer_self(block) 212 | @self = eval("self", block) 213 | end 214 | 215 | def _newline 216 | return if @indent == 0 217 | text! "\n" 218 | end 219 | 220 | def _indent 221 | return if @indent == 0 || @level == 0 222 | text!(" " * (@level * @indent)) 223 | end 224 | 225 | def _nested_structures(block) 226 | @level += 1 227 | block.call(self) 228 | ensure 229 | @level -= 1 230 | end 231 | end 232 | end 233 | 234 | # xmlmarkup.rb 235 | module Builder 236 | 237 | # Create XML markup easily. All (well, almost all) methods sent to 238 | # an XmlMarkup object will be translated to the equivalent XML 239 | # markup. Any method with a block will be treated as an XML markup 240 | # tag with nested markup in the block. 241 | # 242 | # Examples will demonstrate this easier than words. In the 243 | # following, +xm+ is an +XmlMarkup+ object. 244 | # 245 | # xm.em("emphasized") # => emphasized 246 | # xm.em { xmm.b("emp & bold") } # => emph & bold 247 | # xm.a("A Link", "href"=>"http://onestepback.org") 248 | # # => A Link 249 | # xm.div { br } # =>

250 | # xm.target("name"=>"compile", "option"=>"fast") 251 | # # => 252 | # # NOTE: order of attributes is not specified. 253 | # 254 | # xm.instruct! # 255 | # xm.html { # 256 | # xm.head { # 257 | # xm.title("History") # History 258 | # } # 259 | # xm.body { # 260 | # xm.comment! "HI" # 261 | # xm.h1("Header") #

Header

262 | # xm.p("paragraph") #

paragraph

263 | # } # 264 | # } # 265 | # 266 | # == Notes: 267 | # 268 | # * The order that attributes are inserted in markup tags is 269 | # undefined. 270 | # 271 | # * Sometimes you wish to insert text without enclosing tags. Use 272 | # the text! method to accomplish this. 273 | # 274 | # Example: 275 | # 276 | # xm.div { #
277 | # xm.text! "line"; xm.br # line
278 | # xm.text! "another line"; xmbr # another line
279 | # } #
280 | # 281 | # * The special XML characters <, >, and & are converted to <, 282 | # > and & automatically. Use the << operation to 283 | # insert text without modification. 284 | # 285 | # * Sometimes tags use special characters not allowed in ruby 286 | # identifiers. Use the tag! method to handle these 287 | # cases. 288 | # 289 | # Example: 290 | # 291 | # xml.tag!("SOAP:Envelope") { ... } 292 | # 293 | # will produce ... 294 | # 295 | # ... " 296 | # 297 | # tag! will also take text and attribute arguments (after 298 | # the tag name) like normal markup methods. (But see the next 299 | # bullet item for a better way to handle XML namespaces). 300 | # 301 | # * Direct support for XML namespaces is now available. If the 302 | # first argument to a tag call is a symbol, it will be joined to 303 | # the tag to produce a namespace:tag combination. It is easier to 304 | # show this than describe it. 305 | # 306 | # xml.SOAP :Envelope do ... end 307 | # 308 | # Just put a space before the colon in a namespace to produce the 309 | # right form for builder (e.g. "SOAP:Envelope" => 310 | # "xml.SOAP :Envelope") 311 | # 312 | # * XmlMarkup builds the markup in any object (called a _target_) 313 | # that accepts the << method. If no target is given, 314 | # then XmlMarkup defaults to a string target. 315 | # 316 | # Examples: 317 | # 318 | # xm = Builder::XmlMarkup.new 319 | # result = xm.title("yada") 320 | # # result is a string containing the markup. 321 | # 322 | # buffer = "" 323 | # xm = Builder::XmlMarkup.new(buffer) 324 | # # The markup is appended to buffer (using <<) 325 | # 326 | # xm = Builder::XmlMarkup.new(STDOUT) 327 | # # The markup is written to STDOUT (using <<) 328 | # 329 | # xm = Builder::XmlMarkup.new 330 | # x2 = Builder::XmlMarkup.new(:target=>xm) 331 | # # Markup written to +x2+ will be send to +xm+. 332 | # 333 | # * Indentation is enabled by providing the number of spaces to 334 | # indent for each level as a second argument to XmlBuilder.new. 335 | # Initial indentation may be specified using a third parameter. 336 | # 337 | # Example: 338 | # 339 | # xm = Builder.new(:ident=>2) 340 | # # xm will produce nicely formatted and indented XML. 341 | # 342 | # xm = Builder.new(:indent=>2, :margin=>4) 343 | # # xm will produce nicely formatted and indented XML with 2 344 | # # spaces per indent and an over all indentation level of 4. 345 | # 346 | # builder = Builder::XmlMarkup.new(:target=>$stdout, :indent=>2) 347 | # builder.name { |b| b.first("Jim"); b.last("Weirich) } 348 | # # prints: 349 | # # 350 | # # Jim 351 | # # Weirich 352 | # # 353 | # 354 | # * The instance_eval implementation which forces self to refer to 355 | # the message receiver as self is now obsolete. We now use normal 356 | # block calls to execute the markup block. This means that all 357 | # markup methods must now be explicitly send to the xml builder. 358 | # For instance, instead of 359 | # 360 | # xml.div { strong("text") } 361 | # 362 | # you need to write: 363 | # 364 | # xml.div { xml.strong("text") } 365 | # 366 | # Although more verbose, the subtle change in semantics within the 367 | # block was found to be prone to error. To make this change a 368 | # little less cumbersome, the markup block now gets the markup 369 | # object sent as an argument, allowing you to use a shorter alias 370 | # within the block. 371 | # 372 | # For example: 373 | # 374 | # xml_builder = Builder::XmlMarkup.new 375 | # xml_builder.div { |xml| 376 | # xml.stong("text") 377 | # } 378 | # 379 | class XmlMarkup < XmlBase 380 | 381 | # Create an XML markup builder. Parameters are specified by an 382 | # option hash. 383 | # 384 | # :target=>target_object:: 385 | # Object receiving the markup. +out+ must respond to the 386 | # << operator. The default is a plain string target. 387 | # :indent=>indentation:: 388 | # Number of spaces used for indentation. The default is no 389 | # indentation and no line breaks. 390 | # :margin=>initial_indentation_level:: 391 | # Amount of initial indentation (specified in levels, not 392 | # spaces). 393 | # 394 | def initialize(options={}) 395 | indent = options[:indent] || 0 396 | margin = options[:margin] || 0 397 | super(indent, margin) 398 | @target = options[:target] || "" 399 | end 400 | 401 | # Return the target of the builder. 402 | def target! 403 | @target 404 | end 405 | 406 | def comment!(comment_text) 407 | _ensure_no_block block_given? 408 | _special("", comment_text, nil) 409 | end 410 | 411 | # Insert an XML declaration into the XML markup. 412 | # 413 | # For example: 414 | # 415 | # xml.declare! :ELEMENT, :blah, "yada" 416 | # # => 417 | def declare!(inst, *args, &block) 418 | _indent 419 | @target << "" 435 | _newline 436 | end 437 | 438 | # Insert a processing instruction into the XML markup. E.g. 439 | # 440 | # For example: 441 | # 442 | # xml.instruct! 443 | # #=> 444 | # xml.instruct! :aaa, :bbb=>"ccc" 445 | # #=> 446 | # 447 | def instruct!(directive_tag=:xml, attrs={}) 448 | _ensure_no_block block_given? 449 | if directive_tag == :xml 450 | a = { :version=>"1.0", :encoding=>"UTF-8" } 451 | attrs = a.dup.update attrs # was merge, which isn't available with ruby 1.6.8 452 | end 453 | _special( 454 | "", 456 | nil, 457 | attrs, 458 | [:version, :encoding, :standalone]) 459 | end 460 | 461 | private 462 | 463 | # NOTE: All private methods of a builder object are prefixed when 464 | # a "_" character to avoid possible conflict with XML tag names. 465 | 466 | # Insert text directly in to the builder's target. 467 | def _text(text) 468 | @target << text 469 | end 470 | 471 | # Insert special instruction. 472 | def _special(open, close, data=nil, attrs=nil, order=[]) 473 | _indent 474 | @target << open 475 | @target << data if data 476 | _insert_attributes(attrs, order) if attrs 477 | @target << close 478 | _newline 479 | end 480 | 481 | # Start an XML tag. If end_too is true, then the start 482 | # tag is also the end tag (e.g.
483 | def _start_tag(sym, attrs, end_too=false) 484 | @target << "<#{sym}" 485 | _insert_attributes(attrs) 486 | @target << "/" if end_too 487 | @target << ">" 488 | end 489 | 490 | # Insert an ending tag. 491 | def _end_tag(sym) 492 | @target << "" 493 | end 494 | 495 | # Insert the attributes (given in the hash). 496 | def _insert_attributes(attrs, order=[]) 497 | return if attrs.nil? 498 | order.each do |k| 499 | v = attrs[k] 500 | @target << %{ #{k}="#{v}"} if v 501 | end 502 | attrs.each do |k, v| 503 | @target << %{ #{k}="#{v}"} unless order.member?(k) 504 | end 505 | end 506 | 507 | def _ensure_no_block(got_block) 508 | if got_block 509 | fail IllegalBlockError, 510 | "Blocks are not allowed on XML instructions" 511 | end 512 | end 513 | 514 | end 515 | 516 | end 517 | 518 | -------------------------------------------------------------------------------- /Support/AddFile/English.lproj/MainMenu.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 1050 5 | 9B18 6 | 629 7 | 949 8 | 343.00 9 | 10 | YES 11 | 12 | 13 | 14 | YES 15 | com.apple.InterfaceBuilderKit 16 | com.apple.InterfaceBuilder.CocoaPlugin 17 | 18 | 19 | YES 20 | 21 | NSApplication 22 | 23 | 24 | FirstResponder 25 | 26 | 27 | 28 | 29 | 30 | 9 31 | 2 32 | {{840, 498}, {241, 273}} 33 | 1886913536 34 | Add Files to Project 35 | NSWindow 36 | 37 | View 38 | 39 | {10000, 10000} 40 | {213, 107} 41 | 42 | 43 | 256 44 | 45 | YES 46 | 47 | 48 | 4370 49 | 50 | YES 51 | 52 | 53 | 2304 54 | 55 | YES 56 | 57 | 58 | 4352 59 | {241, 202} 60 | 61 | 62 | YES 63 | 64 | 65 | 256 66 | {{185, 0}, {16, 17}} 67 | 68 | 69 | YES 70 | 71 | file_name 72 | 2.380000e+02 73 | 4.000000e+01 74 | 1.000000e+03 75 | 76 | 75628032 77 | 0 78 | File Name 79 | 80 | LucidaGrande 81 | 1.100000e+01 82 | 3100 83 | 84 | 85 | 3 86 | MC4zMzMzMzI5OQA 87 | 88 | 89 | 6 90 | System 91 | headerTextColor 92 | 93 | 3 94 | MAA 95 | 96 | 97 | 98 | 99 | 337772096 100 | 2048 101 | Text Cell 102 | 103 | 104 | 1.300000e+01 105 | 1044 106 | 107 | 108 | 109 | 6 110 | 111 | controlBackgroundColor 112 | 113 | 3 114 | MC42NjY2NjY2OQA 115 | 116 | 117 | 118 | 6 119 | 120 | controlTextColor 121 | 122 | 123 | 124 | 3 125 | YES 126 | 127 | 128 | 129 | 3.000000e+00 130 | 2.000000e+00 131 | 132 | 3 133 | MQA 134 | 135 | 136 | 6 137 | 138 | gridColor 139 | 140 | 3 141 | MC41AA 142 | 143 | 144 | 1.700000e+01 145 | -1707081728 146 | 4 147 | 15 148 | 0 149 | YES 150 | 151 | 152 | {{1, 1}, {241, 202}} 153 | 154 | 155 | 156 | 157 | 158 | 4 159 | 160 | 161 | 162 | -2147483392 163 | {{225, 1}, {15, 200}} 164 | 165 | 166 | 167 | _doScroller: 168 | 9.842106e-01 169 | 170 | 171 | 172 | 256 173 | {{-100, -100}, {224, 15}} 174 | 175 | 176 | 1 177 | 178 | 179 | 9.904762e-01 180 | 181 | 182 | {{-1, 33}, {243, 204}} 183 | 184 | 185 | 186 | 530 187 | 188 | 189 | 190 | QSAAAEEgAABBmAAAQZgAAA 191 | 192 | 193 | 194 | 266 195 | {{7, 245}, {227, 22}} 196 | 197 | 198 | YES 199 | 200 | 343014976 201 | 268436480 202 | 203 | 204 | 205 | YES 206 | 1 207 | 208 | 6 209 | 210 | textBackgroundColor 211 | 212 | 213 | 214 | 215 | 130560 216 | 0 217 | search 218 | _searchFieldSearch: 219 | 220 | 221 | 138690815 222 | 0 223 | 224 | 400 225 | 75 226 | 227 | 228 | 130560 229 | 0 230 | clear 231 | 232 | YES 233 | 234 | YES 235 | 236 | YES 237 | AXDescription 238 | NSAccessibilityEncodedAttributesValueType 239 | 240 | 241 | YES 242 | cancel 243 | 244 | 245 | 246 | 247 | _searchFieldCancel: 248 | 249 | 250 | 138690815 251 | 0 252 | 253 | 400 254 | 75 255 | 256 | 255 257 | 258 | 259 | 260 | 261 | 289 262 | {{64, 2}, {82, 28}} 263 | 264 | 265 | YES 266 | 267 | 67239424 268 | 134348800 269 | Cancel 270 | 271 | 272 | -2034876161 273 | 129 274 | 275 | 549650432 276 | {1, 1} 277 | 278 | YES 279 | 280 | YES 281 | 282 | 283 | 284 | TU0AKgAAAAoAAAANAQAAAwAAAAEAAQAAAQEAAwAAAAEAAQAAAQIAAwAAAAIACAAIAQMAAwAAAAEAAQAA 285 | AQYAAwAAAAEAAQAAAREABAAAAAEAAAAIARIAAwAAAAEAAQAAARUAAwAAAAEAAgAAARYAAwAAAAEgAAAA 286 | ARcABAAAAAEAAAACARwAAwAAAAEAAQAAAVIAAwAAAAEAAQAAAVMAAwAAAAIAAQABAAAAAA 287 | 288 | 289 | 290 | 291 | 292 | 3 293 | MCAwAA 294 | 295 | 296 | 297 | Gw 298 | 200 299 | 25 300 | 301 | 302 | 303 | 304 | 289 305 | {{144, 2}, {82, 28}} 306 | 307 | 308 | YES 309 | 310 | 67239424 311 | 134348800 312 | Add 313 | 314 | 315 | -2034876161 316 | 129 317 | 318 | 319 | 1.100000e+01 320 | 16 321 | 322 | 323 | DQ 324 | 200 325 | 25 326 | 327 | 328 | 329 | {241, 273} 330 | 331 | 332 | 333 | {{0, 0}, {1920, 1178}} 334 | {213, 129} 335 | 336 | 337 | AppController 338 | 339 | 340 | 341 | 342 | YES 343 | 344 | 345 | file_list 346 | 347 | 348 | 349 | 389 350 | 351 | 352 | 353 | search_field 354 | 355 | 356 | 357 | 390 358 | 359 | 360 | 361 | delegate 362 | 363 | 364 | 365 | 396 366 | 367 | 368 | 369 | dataSource 370 | 371 | 372 | 373 | 397 374 | 375 | 376 | 377 | 378 | 379 | 380 | 381 | 398 382 | 383 | 384 | 385 | close_dialog: 386 | 387 | 388 | 389 | 401 390 | 391 | 392 | 393 | add_pressed: 394 | 395 | 396 | 397 | 402 398 | 399 | 400 | 401 | 402 | YES 403 | 404 | 0 405 | 406 | YES 407 | 408 | 409 | 410 | 411 | 412 | -2 413 | 414 | 415 | RmlsZSdzIE93bmVyA 416 | 417 | 418 | -1 419 | 420 | 421 | First Responder 422 | 423 | 424 | -3 425 | 426 | 427 | Application 428 | 429 | 430 | 373 431 | 432 | 433 | YES 434 | 435 | 436 | 437 | Window 438 | 439 | 440 | 374 441 | 442 | 443 | YES 444 | 445 | 446 | 447 | 448 | 449 | 450 | 451 | 452 | 376 453 | 454 | 455 | YES 456 | 457 | 458 | 459 | 460 | 461 | 378 462 | 463 | 464 | YES 465 | 466 | 467 | 468 | 469 | 470 | 471 | 472 | 379 473 | 474 | 475 | 476 | 477 | 380 478 | 479 | 480 | 481 | 482 | 381 483 | 484 | 485 | YES 486 | 487 | 488 | 489 | 490 | 491 | 382 492 | 493 | 494 | YES 495 | 496 | 497 | 498 | 499 | 500 | 383 501 | 502 | 503 | 504 | 505 | 385 506 | 507 | 508 | 509 | 510 | 387 511 | 512 | 513 | 514 | 515 | 516 | 391 517 | 518 | 519 | YES 520 | 521 | 522 | 523 | 524 | 525 | 392 526 | 527 | 528 | 529 | 530 | 399 531 | 532 | 533 | YES 534 | 535 | 536 | 537 | 538 | 539 | 400 540 | 541 | 542 | 543 | 544 | 545 | 546 | YES 547 | 548 | YES 549 | -1.IBPluginDependency 550 | -2.IBPluginDependency 551 | -3.IBPluginDependency 552 | 373.IBPluginDependency 553 | 373.IBWindowTemplateEditedContentRect 554 | 373.ImportedFromIB2 555 | 373.NSWindowTemplate.visibleAtLaunch 556 | 373.editorWindowContentRectSynchronizationRect 557 | 373.windowTemplate.hasMaxSize 558 | 373.windowTemplate.hasMinSize 559 | 373.windowTemplate.maxSize 560 | 373.windowTemplate.minSize 561 | 374.IBPluginDependency 562 | 374.ImportedFromIB2 563 | 376.IBPluginDependency 564 | 376.ImportedFromIB2 565 | 378.IBPluginDependency 566 | 378.ImportedFromIB2 567 | 379.IBShouldRemoveOnLegacySave 568 | 380.IBShouldRemoveOnLegacySave 569 | 381.IBPluginDependency 570 | 381.ImportedFromIB2 571 | 382.IBPluginDependency 572 | 382.ImportedFromIB2 573 | 383.IBShouldRemoveOnLegacySave 574 | 387.IBPluginDependency 575 | 391.IBPluginDependency 576 | 392.IBPluginDependency 577 | 399.IBPluginDependency 578 | 400.IBPluginDependency 579 | 580 | 581 | YES 582 | 583 | 584 | 585 | 586 | {{1166, 797}, {241, 273}} 587 | 588 | 589 | 590 | 591 | 592 | {3.40282e+38, 3.40282e+38} 593 | {213, 107} 594 | 595 | 596 | 597 | 598 | 599 | 600 | 601 | 602 | 603 | 604 | 605 | 606 | 607 | 608 | 609 | 610 | 611 | 612 | 613 | 614 | 615 | YES 616 | 617 | YES 618 | 619 | 620 | YES 621 | 622 | 623 | 624 | 625 | YES 626 | 627 | YES 628 | 629 | 630 | YES 631 | 632 | 633 | 634 | 402 635 | 636 | 637 | 638 | YES 639 | 640 | 641 | 642 | 643 | 644 | id 645 | 646 | 647 | YES 648 | 649 | YES 650 | 651 | 652 | YES 653 | 654 | 655 | 656 | IBUserSource 657 | 658 | 659 | 660 | 661 | 662 | NSObject 663 | 664 | 665 | id 666 | 667 | 668 | YES 669 | 670 | YES 671 | close_button 672 | 673 | 674 | 675 | 676 | YES 677 | 678 | 679 | 680 | 681 | 682 | 683 | IBProjectSource 684 | AppController.rb 685 | 686 | 687 | 688 | 689 | 0 690 | ../../AddFile.xcodeproj 691 | 3 692 | 693 | YnBsaXN0MDDUAAE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 833 | FtgW2hbcFt4W4BbpFusW7Rb7FwQXDRcUFysXOhdLF00XTxdRF1MXXhdvF3EXcxd1F3cXhReOF5UXrRe+ 834 | F8AXwhfEF8YX1xfZF9sX3RffF+wX/Rf/GAEYAxgFGA8YIBgiGCQYJhgoGDUYPhhAGGMYZRhnGGkYaxht 835 | GG8YcRhzGHUYdxh5GHsYfRh/GIEYgxiMGI4YkBiZGJsYvhjAGMIYxBjGGMgYyhjMGM4Y0BjSGNQY1hjY 836 | GNoY3BjeGOcY6RkOGRAZEhkUGRYZGBkaGRwZHhkgGSIZJBkmGSgZKhksGS4ZMBk5GTsZYBliGWQZZhlo 837 | GWoZbBluGXAZchl0GXYZeBl6GXwZfhmAGYIZmRmmGboZ0BnkGesZ/xoLGiYaPRpKGmgadRqOGpoarhq3 838 | GrkauhrDGsUaxhrPGtEbBBsGGwgbChsMGw4bEBsSGxQbFhsYGxobHBseGyAbIhskGyYbKBsqGywbLhsw 839 | GzIbNBs9Gz8bcht0G3YbeBt6G3wbfhuAG4IbhBuGG4gbihuMG44bkBuSG5QblhuYG5obnBueG6Abohul 840 | G6gbqxuuG7EbtBu3G7obvRvAG8kbzBvPG9Ib1RvYG9sb3hvhG+Qb5xvqG+0b9hv4G/kcAhwEHAUcDhwQ 841 | HBEcGhwfAAAAAAAAAgIAAAAAAAADRAAAAAAAAAAAAAAAAAAAHC4 842 | 843 | 844 | 845 | --------------------------------------------------------------------------------