Mxx_ru 1.4.7 → 1.4.8

Sign up to get free protection for your applications and to get access to all the features.
data/COPYING CHANGED
@@ -1,6 +1,6 @@
1
1
  Copyright (c) 1996-2004, Yauheni Akhotnikau
2
2
  Copyright (c) 2004-2006, JSC Intervale
3
- Copyright (c) 2006 The Mxx_ru Project
3
+ Copyright (c) 2006-2009 The Mxx_ru Project
4
4
  All rights reserved.
5
5
 
6
6
  Redistribution and use in source and binary forms, with or without modification,
data/README CHANGED
@@ -2,7 +2,7 @@ Copyright (c) 1996-2005, Yauheni Akhotnikau
2
2
 
3
3
  Copyright (c) 2004-2006, JSC Intervale
4
4
 
5
- Copyright (c) 2006 The Mxx_ru Project
5
+ Copyright (c) 2006-2009 The Mxx_ru Project
6
6
 
7
7
  All rights reserved.
8
8
 
@@ -0,0 +1,68 @@
1
+ #--
2
+ # Copyright (c) 1996-2004, Yauheni Akhotnikau
3
+ # Copyright (c) 2004-2006, JSC Intervale
4
+ # Copyright (c) 2006-2009, The Mxx_ru Project
5
+ # All rights reserved.
6
+ #
7
+ # Redistribution and use in source and binary forms, with or without modification,
8
+ # are permitted provided that the following conditions are met:
9
+ #
10
+ # 1. Redistributions of source code must retain the above copyright notice,
11
+ # this list of conditions and the following disclaimer.
12
+ # 2. Redistributions in binary form must reproduce the above copyright notice,
13
+ # this list of conditions and the following disclaimer in the documentation
14
+ # and/or other materials provided with the distribution.
15
+ # 3. The name of the author may not be used to endorse or promote products derived
16
+ # from this software without specific prior written permission.
17
+ #
18
+ # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
19
+ # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
20
+ # AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE
21
+ # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22
+ # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
23
+ # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24
+ # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
25
+ # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
26
+ # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
+ #++
28
+
29
+ require 'pathname'
30
+ require 'rexml/document'
31
+ require 'set'
32
+
33
+ require 'mxx_ru/cpp/qt4'
34
+
35
+ module MxxRu
36
+ module Cpp
37
+
38
+ begin
39
+ IO.popen( 'pkg-config --version' ) do |file|
40
+ # A special modification for the case when configuration of Qt4
41
+ # is detected via 'pkg-config' command. For example on Debian Linux.
42
+ # (This case is detected and used by Mikhail Lyossin).
43
+ #
44
+ # Method use_module is redefined to make two calls to pkg-config:
45
+ # - the first call with argument '--cflags' to detect include path and
46
+ # necessary defines;
47
+ # - the second call with argument '--libs' to detect libraries path and
48
+ # names of necessry libraries.
49
+ #
50
+ class Qt4
51
+ def use_module( a_module )
52
+ @target.define a_module.define
53
+
54
+ IO.popen( "pkg-config #{a_module.library} --cflags" ) { |file|
55
+ @target.compiler_option( file.gets.chop )
56
+ }
57
+ IO.popen( "pkg-config #{a_module.library} --libs" ) { |file|
58
+ @target.linker_option( file.gets.chop )
59
+ }
60
+ end
61
+ end
62
+ end
63
+ rescue
64
+ end
65
+
66
+ end # module Cpp
67
+ end # module MxxRu
68
+
@@ -1,7 +1,7 @@
1
1
  #--
2
2
  # Copyright (c) 1996-2004, Yauheni Akhotnikau
3
3
  # Copyright (c) 2004-2006, JSC Intervale
4
- # Copyright (c) 2006-2008, The Mxx_ru Project
4
+ # Copyright (c) 2006-2009, The Mxx_ru Project
5
5
  # All rights reserved.
6
6
  #
7
7
  # Redistribution and use in source and binary forms, with or without modification,
@@ -38,65 +38,78 @@ module Cpp
38
38
  # Auxilary module with classes and constants for Qt4 modules support
39
39
  #
40
40
  module Qt4Modules
41
- # Class for objects whose purpose is setting up an appropriate
42
- # define and a library for target.
41
+ # Description of Qt4 module.
43
42
  #
44
43
  # Usage:
45
- # QT_GUI = ModuleBinder.new( 'QT_GUI_LIB', 'QtGui4' )
44
+ # QT_GUI = ModuleDescription.new( 'QT_GUI_LIB', 'QtGui' )
46
45
  # ...
47
- # QT_GUI.setup( target )
48
46
  #
49
- class ModuleBinder
50
- def initialize( a_define, a_library )
51
- @define = a_define
52
- @library = a_library
53
- end
54
-
55
- def setup( a_target )
56
- a_target.define @define
57
- a_target.lib @library
58
- end
59
- end
47
+ ModuleDescription = Struct.new( :define, :library )
60
48
 
61
49
  # Qt3Support component.
62
- QT_QT3SUPPORT = ModuleBinder.new( 'QT_QT3SUPPORT_LIB', 'Qt3Support4' )
50
+ QT_QT3SUPPORT = ModuleDescription.new(
51
+ 'QT_QT3SUPPORT_LIB',
52
+ 'Qt3Support' )
63
53
  # QtCore component.
64
- QT_CORE = ModuleBinder.new( 'QT_CORE_LIB', 'QtCore4' )
54
+ QT_CORE = ModuleDescription.new(
55
+ 'QT_CORE_LIB',
56
+ 'QtCore' )
65
57
  # QtDesigner component.
66
- QT_DESIGNER = ModuleBinder.new( 'QT_DESIGNER_LIB', 'QtDesigner4' )
58
+ QT_DESIGNER = ModuleDescription.new(
59
+ 'QT_DESIGNER_LIB',
60
+ 'QtDesigner' )
67
61
  # QtDesignerComponents component.
68
- QT_DESIGNER_COMPONENTS = ModuleBinder.new(
69
- 'QT_DESIGNERCOMPONENTS_LIB', 'QtDesignerComponents4' )
62
+ QT_DESIGNER_COMPONENTS = ModuleDescription.new(
63
+ 'QT_DESIGNERCOMPONENTS_LIB',
64
+ 'QtDesignerComponents' )
70
65
  # QtGui component.
71
- QT_GUI = ModuleBinder.new( 'QT_GUI_LIB', 'QtGui4' )
66
+ QT_GUI = ModuleDescription.new(
67
+ 'QT_GUI_LIB',
68
+ 'QtGui' )
72
69
  # QtHelp component.
73
- QT_HELP = ModuleBinder.new( 'QT_HELP_LIB', 'QtHelp4' )
70
+ QT_HELP = ModuleDescription.new(
71
+ 'QT_HELP_LIB',
72
+ 'QtHelp' )
74
73
  # Network component.
75
- QT_NETWORK = ModuleBinder.new( 'QT_NETWORK_LIB', 'QtNetwork4' )
74
+ QT_NETWORK = ModuleDescription.new(
75
+ 'QT_NETWORK_LIB',
76
+ 'QtNetwork' )
76
77
  # QtOpenGL component.
77
- QT_OPENGL = ModuleBinder.new( 'QT_OPENGL_LIB', 'QtOpenGL4' )
78
+ QT_OPENGL = ModuleDescription.new(
79
+ 'QT_OPENGL_LIB',
80
+ 'QtOpenGL' )
78
81
  # QtScript component.
79
- QT_SCRIPT = ModuleBinder.new( 'QT_SCRIPT_LIB', 'QtScript4' )
82
+ QT_SCRIPT = ModuleDescription.new(
83
+ 'QT_SCRIPT_LIB',
84
+ 'QtScript' )
80
85
  # QtSql component.
81
- QT_SQL = ModuleBinder.new( 'QT_SQL_LIB', 'QtSql4' )
86
+ QT_SQL = ModuleDescription.new(
87
+ 'QT_SQL_LIB',
88
+ 'QtSql' )
82
89
  # QtSvg component.
83
- QT_SVG = ModuleBinder.new( 'QT_SVG_LIB', 'QtSvg4' )
90
+ QT_SVG = ModuleDescription.new(
91
+ 'QT_SVG_LIB',
92
+ 'QtSvg' )
84
93
  # QtTest component.
85
- QT_TEST = ModuleBinder.new( 'QT_TEST_LIB', 'QtTest4' )
94
+ QT_TEST = ModuleDescription.new(
95
+ 'QT_TEST_LIB',
96
+ 'QtTest' )
86
97
  # QtXml component.
87
- QT_XML = ModuleBinder.new( 'QT_XML_LIB', 'QtXml4' )
98
+ QT_XML = ModuleDescription.new(
99
+ 'QT_XML_LIB',
100
+ 'QtXml' )
88
101
  # QtXmlPatterns component.
89
- QT_XML_PATTERNS = ModuleBinder.new(
90
- 'QT_XMLPATTERNS_LIB',
91
- 'QtXmlPatterns4' )
102
+ QT_XML_PATTERNS = ModuleDescription.new(
103
+ 'QT_XMLPATTERNS_LIB',
104
+ 'QtXmlPatterns' )
92
105
  # QtWebKit component.
93
- QT_WEB_KIT = ModuleBinder.new(
94
- 'QT_WEBKIT_LIB',
95
- 'QtWebKit4' )
106
+ QT_WEB_KIT = ModuleDescription.new(
107
+ 'QT_WEBKIT_LIB',
108
+ 'QtWebKit' )
96
109
  # Phonon component.
97
- QT_PHONON = ModuleBinder.new(
98
- 'QT_PHONON_LIB',
99
- 'phonon4' )
110
+ QT_PHONON = ModuleDescription.new(
111
+ 'QT_PHONON_LIB',
112
+ 'phonon' )
100
113
  end
101
114
 
102
115
  # Files generator for Qt4 class.
@@ -266,14 +279,15 @@ module Cpp
266
279
 
267
280
  # Add a Qt4 module to target.
268
281
  #
269
- # a_module -- an instance of Qt4Modules::ModuleBinder.
282
+ # a_module -- an instance of Qt4Modules::ModuleDescription.
270
283
  def use_module( a_module )
271
- a_module.setup( @target )
284
+ @target.define a_module.define
285
+ @target.lib a_module.library + '4'
272
286
  end
273
287
 
274
288
  # Add some Qt4 modules to target.
275
289
  #
276
- # a_modules -- an enumeration of Qt4Modules::ModuleBinder instances.
290
+ # a_modules -- an enumeration of Qt4Modules::ModuleDescription instances.
277
291
  #
278
292
  def use_modules( *a_modules )
279
293
  a_modules.each { |m| use_module( m ) }
@@ -1,7 +1,7 @@
1
1
  #--
2
2
  # Copyright (c) 1996-2004, Yauheni Akhotnikau
3
3
  # Copyright (c) 2004-2006, JSC Intervale
4
- # Copyright (c) 2006-2008, The Mxx_ru Project
4
+ # Copyright (c) 2006-2009, The Mxx_ru Project
5
5
  # All rights reserved.
6
6
  #
7
7
  # Redistribution and use in source and binary forms, with or without modification,
@@ -34,5 +34,5 @@
34
34
  #
35
35
  # puts 'Mxx_ru version is: ' + MXX_RU_VERSION
36
36
  #
37
- MXX_RU_VERSION = '1.4.7'
37
+ MXX_RU_VERSION = '1.4.8'
38
38
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: Mxx_ru
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.7
4
+ version: 1.4.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - The Mxx_ru Project
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2008-12-09 00:00:00 +03:00
12
+ date: 2009-02-15 00:00:00 +03:00
13
13
  default_executable:
14
14
  dependencies: []
15
15
 
@@ -336,6 +336,7 @@ files:
336
336
  - lib/mxx_ru/cpp/qt.rb
337
337
  - lib/mxx_ru/cpp/qt4.rb
338
338
  - lib/mxx_ru/cpp/qt4details.rb
339
+ - lib/mxx_ru/cpp/qt4_via_pkg_config.rb
339
340
  - lib/mxx_ru/cpp/rucodegen.rb
340
341
  - lib/mxx_ru/cpp/source_file.rb
341
342
  - lib/mxx_ru/cpp/target.rb