diff options
author | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2011-12-05 15:55:57 -0600 |
---|---|---|
committer | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2011-12-05 15:55:57 -0600 |
commit | 9ba04742771370f59740e32e11c5f3a1e6a1b70a (patch) | |
tree | c81c34dae2b3b1ea73801bf18a960265dc4207f7 /qtruby/bin/rbqtapi | |
parent | 1a96c45b22d01378202d9dc7ed9c47acd30f966e (diff) | |
download | tdebindings-9ba04742771370f59740e32e11c5f3a1e6a1b70a.tar.gz tdebindings-9ba04742771370f59740e32e11c5f3a1e6a1b70a.zip |
Initial TQt conversion
Diffstat (limited to 'qtruby/bin/rbqtapi')
-rwxr-xr-x | qtruby/bin/rbqtapi | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/qtruby/bin/rbqtapi b/qtruby/bin/rbqtapi index 4540b3c6..9f18841f 100755 --- a/qtruby/bin/rbqtapi +++ b/qtruby/bin/rbqtapi @@ -3,19 +3,19 @@ # Note: this program is part of qtruby and makes use of its internal functions. # You should not rely on those in your own programs. -require 'getopts' +retquire 'getopts' getopts('r:hvimp') case File.basename $0 when "rbqtapi" - require 'Qt' + retquire 'Qt' when "rbkdeapi" - require 'Korundum' + retquire 'Korundum' end if $OPT_v - # TODO add and use version number #{Qt::VERSION} - print "qtruby using Qt-#{Qt::version}\n" + # TODO add and use version number #{TQt::VERSION} + print "qtruby using Qt-#{TQt::version}\n" exit 0 elsif $OPT_h print $usage @@ -25,21 +25,21 @@ end if $OPT_m while 1 line = STDIN.readline.chomp - line.gsub!(/^Q(?=[A-Z])/,'Qt::') + line.gsub!(/^Q(?=[A-Z])/,'TQt::') line.gsub!(/^K/,'KDE::') unless line =~ /^(KDE)|(KIO)|(KParts)|(KNS)/ - classid = Qt::Internal::find_pclassid($_) + classid = TQt::Internal::find_pclassid($_) puts "__START__" if classid - a = Qt::Internal::findAllMethods(classid) + a = TQt::Internal::findAllMethods(classid) ids = (a.keys.sort.map{|k|a[k]}).flatten - candidates = Qt::dumpCandidates(ids) + candidates = TQt::dumpCandidates(ids) sup = [] - Qt::Internal::getAllParents(classid, sup) + TQt::Internal::getAllParents(classid, sup) sup.each { |sup_item| - a = Qt::Internal::findAllMethods(sup_item) + a = TQt::Internal::findAllMethods(sup_item) ids = (a.keys.sort.map{|k|a[k]}).flatten - candidates << Qt::Internal::dumpCandidates(ids) + candidates << TQt::Internal::dumpCandidates(ids) } candidates.gsub("\t","") # erm. whats the "s" mean on s/\t//gs ? print candidates @@ -49,10 +49,10 @@ if $OPT_m end search_string = ARGV[0] ? ARGV[0].dup : nil -search_string.gsub!(/^Q(?=[A-Z])/,'Qt::') if search_string +search_string.gsub!(/^Q(?=[A-Z])/,'TQt::') if search_string # search_string.gsub!(/^K(?=[^D][^E])/,'KDE::') if search_string search_string.gsub!(/^K/,'KDE::') unless search_string.nil? or search_string =~ /^(KDE)|(KIO)|(KParts)|(KNS)/ -classid = search_string ? Qt::Internal::find_pclassid(search_string) : 1 +classid = search_string ? TQt::Internal::find_pclassid(search_string) : 1 if classid == 0 puts "Class #{search_string} not found" exit 1 @@ -61,18 +61,18 @@ regexp = nil regexp = ( $OPT_i ? Regexp.new($OPT_r, Regexp::IGNORECASE) : Regexp.new($OPT_r) ) if $OPT_r candidates = "" while true - a = Qt::Internal::findAllMethods(classid) + a = TQt::Internal::findAllMethods(classid) break if a.nil? ids = (a.keys.sort.map{|k|a[k]}).flatten - candidates = Qt::Internal::dumpCandidates(ids) + candidates = TQt::Internal::dumpCandidates(ids) if $OPT_p and !search_string.empty? and classid sup = [] - Qt::Internal::getAllParents(classid, sup) + TQt::Internal::getAllParents(classid, sup) sup.each { |sup_item| - a = Qt::Internal::findAllMethods(sup_item) + a = TQt::Internal::findAllMethods(sup_item) ids = (a.keys.sort.map{|k|a[k]}).flatten - candidates << Qt::Internal::dumpCandidates(ids) + candidates << TQt::Internal::dumpCandidates(ids) } end if regexp |