# Encoding: UTF-8

[{beforeRunningCommand: "nop",
  command: "${TM_RUBY:-ruby} \"$TM_BUNDLE_SUPPORT/bin/add_file.rb\"",
  fallbackInput: "word",
  input: "selection",
  keyEquivalent: "@u",
  name: "Add File",
  output: "replaceSelectedText",
  scope: "source.qmake",
  uuid: "82073EA0-7D10-4A6C-AF49-54B29FA3AF1E"},
 {beforeRunningCommand: "nop",
  command: "\"${TM_BUNDLE_SUPPORT}/bin/build_qt_project.rb\"",
  input: "none",
  keyEquivalent: "@b",
  name: "Build",
  output: "showAsHTML",
  scope: "source.c++.qt, source.qmake",
  uuid: "AAAD64D1-8C69-4645-853E-B6DD3D04AC67"},
 {beforeRunningCommand: "nop",
  command: 
   "#!/bin/sh\n\"${TM_BUNDLE_SUPPORT}/bin/build_qt_project.rb\" && \"${TM_BUNDLE_SUPPORT}/bin/run_qt_project.rb\"",
  input: "none",
  keyEquivalent: "@R",
  name: "Build & Run",
  output: "showAsHTML",
  scope: "source.c++.qt, source.qmake",
  uuid: "22F431D0-0CB5-4CAB-951F-8C0E7396891F"},
 {beforeRunningCommand: "nop",
  command: "${TM_RUBY:-ruby} \"$TM_BUNDLE_SUPPORT/bin/insert_class.rb\"",
  input: "none",
  name: "Class",
  output: "insertAsSnippet",
  scope: "source.c++.qt",
  tabTrigger: "qclass",
  uuid: "1DB2A2E8-5E25-4442-9DE1-335E09854C9F"},
 {beforeRunningCommand: "nop",
  command: 
   "${TM_RUBY:-ruby} \"$TM_BUNDLE_SUPPORT/bin/insert_class.rb\" doxygen",
  input: "none",
  name: "Class (with Doxygen)",
  output: "insertAsSnippet",
  scope: "source.c++.qt",
  tabTrigger: "qclassdoxy",
  uuid: "BFD08AAF-3AB2-4C55-9A57-2EB75ECD9CD1"},
 {beforeRunningCommand: "nop",
  command: 
   "# Converts method declarations to their\n# out-of-class-declaration implementations.\n#\n# Could be applied to bunch of methods in\n# selection.\n\n${TM_RUBY:-ruby} \"$TM_BUNDLE_SUPPORT/bin/declaration_to_implementation.rb\"",
  fallbackInput: "line",
  input: "selection",
  keyEquivalent: "@u",
  name: "Declaration to Implementation",
  output: "insertAsSnippet",
  scope: "source.c++.qt",
  uuid: "C4517F03-DB1A-434E-BF29-F13DA337B20F"},
 {beforeRunningCommand: "nop",
  command: 
   "# Converts method declarations to their\n# out-of-class-declaration implementations\n# with Doxygen placeholders in place.\n#\n# Could be applied to bunch of methods in\n# selection.\n#\n# It's possible to override Doxygen placeholders\n# after specifying name of the class.\n\n${TM_RUBY:-ruby} \"$TM_BUNDLE_SUPPORT/bin/declaration_to_implementation.rb\" doxygen",
  fallbackInput: "line",
  input: "selection",
  keyEquivalent: "@u",
  name: "Declaration to Implementation (with Doxygen)",
  output: "insertAsSnippet",
  scope: "source.c++.qt",
  uuid: "97D13B6C-9CC2-4CAD-8CD3-80DC9CBC1968"},
 {beforeRunningCommand: "nop",
  command: "${TM_RUBY:-ruby} \"$TM_BUNDLE_SUPPORT/bin/search.rb\" input",
  fallbackInput: "word",
  input: "selection",
  keyEquivalent: "^@h",
  name: "Display Documentation",
  output: "showAsHTML",
  scope: "source.c++.qt",
  uuid: "D4885A64-9FF5-43BA-8D5E-AEB71E9E08C2"},
 {beforeRunningCommand: "nop",
  command: "${TM_RUBY:-ruby} \"$TM_BUNDLE_SUPPORT/bin/search.rb\" fuzzy input",
  fallbackInput: "word",
  input: "selection",
  keyEquivalent: "^~@h",
  name: "Display Fuzzy Documentation",
  output: "showAsHTML",
  scope: "source.c++.qt",
  uuid: "F34F4BC0-C09C-4DAC-9B0C-EE7173964090"},
 {beforeRunningCommand: "nop",
  command: 
   "#!/usr/bin/env ruby\nrequire ENV['TM_SUPPORT_PATH']+'/lib/exit_codes'\n\nword = (ENV['TM_SELECTED_TEXT'] or ENV['TM_CURRENT_WORD'] or '')\ndir  = (ENV['TM_QT_DOC_DIR'] or '/usr/local/Trolltech/Qt-4.2.0/doc/html')\n\nword.strip! unless word.frozen?\n\nif word.nil?\n  puts \"Nothing given to search for.\"\n  \nelse\n  doc_file = \"\#{dir}/\#{word.downcase}.html\"\n  \n  if File.exists? doc_file\n    TextMate::exit_show_html \"<meta http-equiv='Refresh' content='0;URL=tm-file://\#{doc_file}'>\"\n  else\n    spotted = `mdfind \#{word}`\n    files   = spotted.grep %r{^\#{Regexp::escape dir}/.+\\.html$}\n    \n    unless files.any?\n      puts \"No Documentation found for '\#{word}'.\"\n    else\n      puts %{\n      <html>\n      <head><title>Spotlight results for '\#{word}'</title>\n      <style>\n        a:link { color: #004faf; text-decoration: none }\n        a:visited { color: #672967; text-decoration: none }\n        h1 { text-align: center }\n        span.intro { color: #999 }\n        div.navi img {\n          vertical-align: -35%;\n          margin-right: 4px;\n        }\n      </style>\n      <body>\n      \n      <div class=\"navi\">\n        <img src=\"tm-file://\#{dir}/images/qt-logo.png\">\n        <a href=\"tm-file://\#{dir}/index.html\">Home</a> &middot;\n        <a href=\"tm-file://\#{dir}/classes.html\">All Classes</a> &middot;\n        <a href=\"tm-file://\#{dir}/mainclasses.html\">Main Classes</a> &middot;\n        <a href=\"tm-file://\#{dir}/groups.html\">Grouped Classes</a> &middot;\n        <a href=\"tm-file://\#{dir}/modules.html\">Modules</a> &middot;\n        <a href=\"tm-file://\#{dir}/functions.html\">Functions</a>\n      </div>\n      \n      <h1>Spotlight results for '\#{word}'</h1><ul>}\n      \n      files.each do |file|\n        head  = File.open(file.chop).read(4000)\n        title = head.scan(/<title>Qt \\d\\.\\d: (.+)<\\/title>/).first.first\n        intro = head.scan(/<p>(.{16,})<\\/p>/).first\n        \n        unless intro.nil?\n          intro = intro.first.gsub(/<.+?>/, '')[0..(107-title.size)]+'&hellip;'\n        end\n        \n        puts %{<li><a href=\"tm-file://\#{file.chop}\">\#{title}</a>\n               <span class=\"intro\">\#{intro}</span></li>}\n      end\n      puts \"</ul></body></html>\"\n      \n      TextMate::exit_show_html\n    end\n  end\n  \nend",
  input: "none",
  keyEquivalent: "^h",
  name: "Doc Lookup",
  output: "showAsTooltip",
  scope: "source.c++.qt",
  uuid: "D663259E-0526-11DB-A7A9-0011242E4184"},
 {beforeRunningCommand: "nop",
  command: 
   "# Similiar to entering query in the Qt Assistant's\n# \"Look For:\" field, and pressing enter. If \n# there are multiple matches, there's an option\n# to select one of them.\n\n${TM_RUBY:-ruby} \"$TM_BUNDLE_SUPPORT/bin/search.rb\"",
  fallbackInput: "word",
  input: "selection",
  keyEquivalent: "^h",
  name: "Documentation for Word / Selection",
  output: "showAsHTML",
  scope: "source.c++.qt",
  uuid: "DAD33E78-4FEF-43EB-A672-790E7140855A"},
 {beforeRunningCommand: "nop",
  command: 
   "# Similiar to entering query in the Qt Assistant's\n# \"Look For:\" field, then collecting topics for\n# each displayed method, and then displaying an\n# option to pick one of them using text box.\n\n${TM_RUBY:-ruby} \"$TM_BUNDLE_SUPPORT/bin/search.rb\" fuzzy",
  fallbackInput: "word",
  input: "selection",
  keyEquivalent: "^~h",
  name: "Fuzzy Documentation for Word / Selection",
  output: "showAsHTML",
  scope: "source.c++.qt",
  uuid: "C6BD2114-7620-4C35-A9B5-F44CA3291004"},
 {beforeRunningCommand: "nop",
  command: 
   "${TM_RUBY:-ruby} \"$TM_BUNDLE_SUPPORT/bin/implementation_to_declaration.rb\"",
  fallbackInput: "line",
  input: "selection",
  keyEquivalent: "@u",
  name: "Implementation to Declaration",
  output: "insertAsSnippet",
  scope: "source.c++.qt",
  uuid: "CC1A1191-7451-4806-B326-459416C8894A"},
 {beforeRunningCommand: "nop",
  command: 
   "# Inserts a call to the same metod of superclass.\n# Since figuring a superclass is a bit tricky, it \n# only works when class declaration exists in the \n# same file, and prior to the current line. If \n# it's unable to find superclass, QWidget is used.\n\n${TM_RUBY:-ruby} \"$TM_BUNDLE_SUPPORT/bin/insert_super.rb\"",
  input: "document",
  name: "Insert Call to Super",
  output: "insertAsSnippet",
  scope: "source.c++.qt",
  tabTrigger: "super",
  uuid: "02131A74-BB30-4A92-B8D0-BDD96FF9CD88"},
 {beforeRunningCommand: "nop",
  command: 
   "#!/usr/bin/env ruby\n# By Allan Odgaard: \n# http://macromates.com/blog/archives/2006/04/12/customization-screencast/\n\ntxt = STDIN.read.gsub(%r{\\A/|\\*/\\z}, '')\ntxt = txt.gsub(/^[ \\t]*\\*[ \\t]*/, '')\ntxt = %x{ fmt <<< '\#{txt.gsub(/'/, \"'\\\\\\\\''\")}' }.chomp\ntxt = txt.gsub(/[$`\\\\]/, '\\\\\\\\\\0')\ntxt = txt.sub(/(\\n(?=\\n))?(\\n*)\\z/, '\\1$0\\2')\nprint \"/* \" + txt.to_a.join(' * ') + \" */\"",
  fallbackInput: "scope",
  input: "selection",
  keyEquivalent: "^q",
  name: "Reformat Block Comment",
  output: "insertAsSnippet",
  scope: "source.c++.qt comment.block.c",
  uuid: "68EA4D87-31FA-4492-9645-925128AB6C43"},
 {beforeRunningCommand: "nop",
  command: "\"${TM_BUNDLE_SUPPORT}/bin/run_qt_project.rb\"",
  input: "none",
  keyEquivalent: "@r",
  name: "Run",
  output: "showAsTooltip",
  scope: "source.c++.qt, source.qmake",
  uuid: "97FDD49E-0E1B-4B68-9614-E57A5804C247"},
 {beforeRunningCommand: "nop",
  command: 
   "echo \"<meta http-equiv='Refresh' content='0;URL=tm-file://${TM_QT_DOC_DIR:=/usr/local/Trolltech/Qt-4.2.0/doc/html}/qmake-manual.html'>\"",
  input: "none",
  keyEquivalent: "^h",
  name: "Show qmake Manual",
  output: "showAsHTML",
  scope: "source.qmake",
  uuid: "E91A719F-109D-4243-B943-A85F9FECEBE0"}]
