~kubuntu-members/korundum/4.11

« back to all changes in this revision

Viewing changes to plasma/src/lib/KDE/plasma.rb

  • Committer: Ian Monroe
  • Date: 2010-11-21 15:55:01 UTC
  • Revision ID: git-v1:c37670e4e3c59f5eb2ba112f5341a5e706217f6f
Split up Smoke into Qt and KDE directories. 
Move libsmoke stuff into the generator directory
Split up Ruby into qtruby and korundum directories

svn path=/trunk/KDE/kdebindings/ruby/; revision=1199320

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
=begin
2
 
/***************************************************************************
3
 
                          plasma.rb  -  Plasma applet helper code
4
 
                             -------------------
5
 
    begin                : Sat April 5 2008
6
 
    copyright            : (C) 2008 by Richard Dale
7
 
    email                : richard.j.dale@gmail.com
8
 
 ***************************************************************************/
9
 
 
10
 
/***************************************************************************
11
 
 *                                                                         *
12
 
 *   This program is free software; you can redistribute it and/or modify  *
13
 
 *   it under the terms of the GNU General Public License as published by  *
14
 
 *   the Free Software Foundation; either version 2 of the License, or     *
15
 
 *   (at your option) any later version.                                   *
16
 
 *                                                                         *
17
 
 ***************************************************************************/
18
 
=end
19
 
 
20
 
require 'qtwebkit'
21
 
 
22
 
module Plasma
23
 
 
24
 
  module Internal
25
 
    def self.init_all_classes
26
 
      Qt::Internal::add_normalize_proc(Proc.new do |classname|
27
 
        if classname =~ /^Plasma/
28
 
          now = classname
29
 
        end
30
 
        now
31
 
      end)
32
 
      getClassList.each do |c|
33
 
        classname = Qt::Internal::normalize_classname(c)
34
 
        id = Qt::Internal::findClass(c);
35
 
        Qt::Internal::insert_pclassid(classname, id)
36
 
        Qt::Internal::cpp_names[classname] = c
37
 
        klass = Qt::Internal::isQObject(c) ? Qt::Internal::create_qobject_class(classname, Plasma) \
38
 
                                           : Qt::Internal::create_qt_class(classname, Plasma)
39
 
        Qt::Internal::classes[classname] = klass unless klass.nil?
40
 
      end
41
 
    end
42
 
  end
43
 
 
44
 
  class Applet < Qt::Base
45
 
    def type(*args)
46
 
      method_missing(:type, *args)
47
 
    end
48
 
 
49
 
    def id(*args)
50
 
      method_missing(:id, *args)
51
 
    end
52
 
  end
53
 
 
54
 
  class Containment < Qt::Base
55
 
    def type(*args)
56
 
      method_missing(:type, *args)
57
 
    end
58
 
  end
59
 
 
60
 
  class PackageMetadata < Qt::Base
61
 
    def type(*args)
62
 
      method_missing(:type, *args)
63
 
    end
64
 
  end
65
 
 
66
 
  class PackageStructure < Qt::Base
67
 
    def type(*args)
68
 
      method_missing(:type, *args)
69
 
    end
70
 
  end
71
 
 
72
 
  class Slider < Qt::Base
73
 
    def range=(arg)
74
 
      if arg.kind_of? Range
75
 
        return super(arg.begin, arg.exclude_end?  ? arg.end - 1 : arg.end)
76
 
      else
77
 
        return super(arg)
78
 
      end
79
 
    end
80
 
  end
81
 
 
82
 
end