~ubuntu-branches/ubuntu/trusty/ruby1.9/trusty

« back to all changes in this revision

Viewing changes to ext/tk/lib/tkextlib/tile.rb

  • Committer: Bazaar Package Importer
  • Author(s): Stephan Hermann
  • Date: 2008-01-24 11:42:29 UTC
  • mfrom: (1.1.9 upstream)
  • Revision ID: james.westby@ubuntu.com-20080124114229-jw2f87rdxlq6gp11
Tags: 1.9.0.0-2ubuntu1
* Merge from debian unstable, remaining changes:
  - Robustify check for target_os, fixing build failure on lpia.

Show diffs side-by-side

added added

removed removed

Lines of Context:
15
15
# TkPackage.require('tile', '0.4')
16
16
# TkPackage.require('tile', '0.6')
17
17
# TkPackage.require('tile', '0.7')
18
 
verstr = TkPackage.require('tile')
 
18
if Tk::TK_MAJOR_VERSION > 8 || 
 
19
    (Tk::TK_MAJOR_VERSION == 8 && Tk::TK_MINOR_VERSION >= 5)
 
20
  begin
 
21
    verstr = TkPackage.require('Ttk')
 
22
  rescue RuntimeError
 
23
    verstr = TkPackage.require('tile')
 
24
  end
 
25
else
 
26
  verstr = TkPackage.require('tile')
 
27
end
 
28
 
19
29
ver = verstr.split('.')
20
 
if ver[0].to_i == 0 && ver[1].to_i <= 4
21
 
  # version 0.4 or former
22
 
  module Tk
23
 
    module Tile
24
 
      USE_TILE_NAMESPACE = true
25
 
      USE_TTK_NAMESPACE  = false
26
 
      TILE_SPEC_VERSION_ID = 0
 
30
if ver[0].to_i == 0
 
31
  # Tile extension package
 
32
  if ver[1].to_i <= 4
 
33
    # version 0.4 or former
 
34
    module Tk
 
35
      module Tile
 
36
        USE_TILE_NAMESPACE = true
 
37
        USE_TTK_NAMESPACE  = false
 
38
        TILE_SPEC_VERSION_ID = 0
 
39
      end
 
40
    end
 
41
  elsif ver[1].to_i <= 6
 
42
    # version 0.5 -- version 0.6
 
43
    module Tk
 
44
      module Tile
 
45
        USE_TILE_NAMESPACE = true
 
46
        USE_TTK_NAMESPACE  = true
 
47
        TILE_SPEC_VERSION_ID = 5
 
48
      end
 
49
    end
 
50
  elsif ver[1].to_i <= 7
 
51
    module Tk
 
52
      module Tile
 
53
        USE_TILE_NAMESPACE = false
 
54
        USE_TTK_NAMESPACE  = true
 
55
        TILE_SPEC_VERSION_ID = 7
 
56
      end
 
57
    end
 
58
  else
 
59
    # version 0.8 or later
 
60
    module Tk
 
61
      module Tile
 
62
        USE_TILE_NAMESPACE = false
 
63
        USE_TTK_NAMESPACE  = true
 
64
        TILE_SPEC_VERSION_ID = 8
 
65
      end
27
66
    end
28
67
  end
29
 
elsif ver[0].to_i == 0 && ver[1].to_i <= 6
30
 
  # version 0.5 -- version 0.6
31
 
  module Tk
32
 
    module Tile
33
 
      USE_TILE_NAMESPACE = true
34
 
      USE_TTK_NAMESPACE  = true
35
 
      TILE_SPEC_VERSION_ID = 5
36
 
    end
 
68
 
 
69
  module Tk::Tile
 
70
    PACKAGE_NAME = 'tile'.freeze
37
71
  end
38
72
else
39
 
  # version 0.7 or later
 
73
  # Ttk package merged Tcl/Tk core (Tcl/Tk 8.5+)
40
74
  module Tk
41
75
    module Tile
42
76
      USE_TILE_NAMESPACE = false
43
77
      USE_TTK_NAMESPACE  = true
44
 
      TILE_SPEC_VERSION_ID = 7
 
78
      TILE_SPEC_VERSION_ID = 8
 
79
 
 
80
      PACKAGE_NAME = 'Ttk'.freeze
45
81
    end
46
82
  end
47
83
end
51
87
  module Tile
52
88
    TkComm::TkExtlibAutoloadModule.unshift(self)
53
89
 
54
 
    PACKAGE_NAME = 'tile'.freeze
55
90
    def self.package_name
56
91
      PACKAGE_NAME
57
92
    end
58
93
 
59
94
    def self.package_version
60
95
      begin
61
 
        TkPackage.require('tile')
 
96
        TkPackage.require(PACKAGE_NAME)
62
97
      rescue
63
98
        ''
64
99
      end
200
235
 
201
236
    autoload :TPaned,        'tkextlib/tile/tpaned'
202
237
    autoload :Paned,         'tkextlib/tile/tpaned'
 
238
    autoload :PanedWindow,   'tkextlib/tile/tpaned'
 
239
    autoload :Panedwindow,   'tkextlib/tile/tpaned'
203
240
 
204
241
    autoload :TProgressbar,  'tkextlib/tile/tprogressbar'
205
242
    autoload :Progressbar,   'tkextlib/tile/tprogressbar'
216
253
 
217
254
    autoload :TScrollbar,    'tkextlib/tile/tscrollbar'
218
255
    autoload :Scrollbar,     'tkextlib/tile/tscrollbar'
 
256
    autoload :XScrollbar,    'tkextlib/tile/tscrollbar'
 
257
    autoload :YScrollbar,    'tkextlib/tile/tscrollbar'
219
258
 
220
259
    autoload :TSeparator,    'tkextlib/tile/tseparator'
221
260
    autoload :Separator,     'tkextlib/tile/tseparator'
228
267
    autoload :Style,         'tkextlib/tile/style'
229
268
  end
230
269
end
 
270
 
 
271
Ttk = Tk::Tile