qtbindings 4.6.3.1-x86-mingw32 → 4.6.3.2-x86-mingw32

Sign up to get free protection for your applications and to get access to all the features.
Files changed (89) hide show
  1. data/CHANGELOG.txt +14 -0
  2. data/KNOWN_ISSUES.txt +5 -11
  3. data/bin/1.8/rbrcc.exe +0 -0
  4. data/bin/1.8/rbuic4.exe +0 -0
  5. data/bin/1.8/smokeapi.exe +0 -0
  6. data/bin/1.8/smokedeptool.exe +0 -0
  7. data/bin/1.9/rbrcc.exe +0 -0
  8. data/bin/1.9/rbuic4.exe +0 -0
  9. data/bin/1.9/smokeapi.exe +0 -0
  10. data/bin/1.9/smokedeptool.exe +0 -0
  11. data/examples/itemviews/chart/pieview.rb +1 -1
  12. data/examples/network/ftp/ftpwindow.rb +8 -3
  13. data/examples/network/http/httpwindow.rb +1 -1
  14. data/examples/painting/fontsampler/mainwindow.rb +14 -13
  15. data/examples/painting/fontsampler/previewdialog.rb +40 -39
  16. data/examples/painting/fontsampler/previewlabel.rb +2 -2
  17. data/examples/painting/svgviewer/svgwindow.rb +2 -2
  18. data/ext/cmake/modules/FindQt4.cmake +1 -0
  19. data/ext/generator/generatorpreprocessor.cpp +43 -1
  20. data/ext/generator/generators/smoke/generator_smoke.cpp +8 -1
  21. data/ext/generator/generators/smoke/helpers.cpp +5 -5
  22. data/ext/generator/generators/smoke/writeClasses.cpp +1 -1
  23. data/ext/generator/parser/lexer.cpp +1 -0
  24. data/ext/generator/parser/parser.cpp +4 -2
  25. data/ext/generator/parser/rpp/chartools.cpp +20 -0
  26. data/ext/generator/parser/rpp/chartools.h +7 -0
  27. data/ext/generator/parser/rpp/pp-macro-expander.cpp +3 -3
  28. data/ext/generator/parser/tokens.cpp +3 -0
  29. data/ext/generator/parser/tokens.h +1 -0
  30. data/ext/generator/type_compiler.cpp +1 -1
  31. data/ext/ruby/qtruby/src/handlers.cpp +13 -3
  32. data/ext/smoke/CMakeLists.txt +1 -0
  33. data/ext/smoke/qtcore/smokeconfig.xml +2 -0
  34. data/ext/smoke/qtdeclarative/smokeconfig.xml +1 -0
  35. data/ext/smoke/qthelp/CMakeLists.txt +45 -0
  36. data/ext/smoke/qthelp/config.xml.cmake +13 -0
  37. data/ext/smoke/qthelp/qthelp_includes.h +3 -0
  38. data/ext/smoke/qthelp/smokeconfig.xml +53 -0
  39. data/ext/smoke/qthelp_smoke.h +16 -0
  40. data/ext/smoke/qtopengl/config.xml.cmake +1 -0
  41. data/ext/smoke/qtxmlpatterns/smokeconfig.xml +1 -1
  42. data/extconf.rb +60 -58
  43. data/lib/1.8/libqtruby4shared.dll +0 -0
  44. data/lib/1.8/libsmokebase.dll +0 -0
  45. data/lib/1.8/libsmokeqtcore.dll +0 -0
  46. data/lib/1.8/libsmokeqtgui.dll +0 -0
  47. data/lib/1.8/libsmokeqthelp.dll +0 -0
  48. data/lib/1.8/libsmokeqtmultimedia.dll +0 -0
  49. data/lib/1.8/libsmokeqtnetwork.dll +0 -0
  50. data/lib/1.8/libsmokeqtopengl.dll +0 -0
  51. data/lib/1.8/libsmokeqtscript.dll +0 -0
  52. data/lib/1.8/libsmokeqtsql.dll +0 -0
  53. data/lib/1.8/libsmokeqtsvg.dll +0 -0
  54. data/lib/1.8/libsmokeqttest.dll +0 -0
  55. data/lib/1.8/libsmokeqtuitools.dll +0 -0
  56. data/lib/1.8/libsmokeqtwebkit.dll +0 -0
  57. data/lib/1.8/libsmokeqtxml.dll +0 -0
  58. data/lib/1.8/libsmokeqtxmlpatterns.dll +0 -0
  59. data/lib/1.8/qtruby4.so +0 -0
  60. data/lib/1.8/qtscript.so +0 -0
  61. data/lib/1.8/qttest.so +0 -0
  62. data/lib/1.8/qtuitools.so +0 -0
  63. data/lib/1.8/qtwebkit.so +0 -0
  64. data/lib/1.9/libqtruby4shared.dll +0 -0
  65. data/lib/1.9/libsmokebase.dll +0 -0
  66. data/lib/1.9/libsmokeqtcore.dll +0 -0
  67. data/lib/1.9/libsmokeqtgui.dll +0 -0
  68. data/lib/1.9/libsmokeqthelp.dll +0 -0
  69. data/lib/1.9/libsmokeqtmultimedia.dll +0 -0
  70. data/lib/1.9/libsmokeqtnetwork.dll +0 -0
  71. data/lib/1.9/libsmokeqtopengl.dll +0 -0
  72. data/lib/1.9/libsmokeqtscript.dll +0 -0
  73. data/lib/1.9/libsmokeqtsql.dll +0 -0
  74. data/lib/1.9/libsmokeqtsvg.dll +0 -0
  75. data/lib/1.9/libsmokeqttest.dll +0 -0
  76. data/lib/1.9/libsmokeqtuitools.dll +0 -0
  77. data/lib/1.9/libsmokeqtwebkit.dll +0 -0
  78. data/lib/1.9/libsmokeqtxml.dll +0 -0
  79. data/lib/1.9/libsmokeqtxmlpatterns.dll +0 -0
  80. data/lib/1.9/qtruby4.so +0 -0
  81. data/lib/1.9/qtscript.so +0 -0
  82. data/lib/1.9/qttest.so +0 -0
  83. data/lib/1.9/qtuitools.so +0 -0
  84. data/lib/1.9/qtwebkit.so +0 -0
  85. data/lib/Qt/qtruby4.rb +12 -15
  86. data/lib/qtbindings_version.rb +2 -2
  87. metadata +11 -6
  88. data/examples/textedit/textedit.rb +0 -150
  89. data/ext/ruby/qtruby/src/extconf.rb +0 -11
data/CHANGELOG.txt CHANGED
@@ -1,5 +1,6 @@
1
1
  qtbindings Changelog:
2
2
  -----------------
3
+ v4.6.3.0
3
4
  2010/07/27 - Apply Ryan Melton's patches to build on Windows
4
5
  2010/07/27 - Apply Ryan Melton's patch to fix ExtraSelection
5
6
  2010/07/28 - Sync with kde-bindings trunk rev 1156258
@@ -7,6 +8,19 @@ qtbindings Changelog:
7
8
  2010/07/28 - Apply Paolo Capriotti's patch for deferred objects
8
9
  2010/07/28 - Apply Paolo Capriotti's patch for marking QGraphicsEffect
9
10
  2010/07/28 - Sync with kde-bindings trunk rev 1156329
11
+
12
+ v4.6.3.1
10
13
  2010/09/21 - Update examples to work with Ruby 1.9.2
11
14
  2010/09/21 - Fix 4 examples
12
15
  2010/09/21 - Sync with kde-bindings trunk rev 1178034
16
+
17
+ v4.6.3.2
18
+ 2010/10/14 - Handle ambiguous results with method lookup
19
+ 2010/10/15 - Fix bug with UTF-8 support
20
+ 2010/10/17 - Sync with kde-bindings trunk rev 1186952
21
+ 2010/10/19 - Fix Http example
22
+ 2010/11/04 - Fix chart example and all methods returning QFlags&
23
+ 2010/12/03 - Add framework support on Mac OSX which also fixes the OpenGl example
24
+ 2010/12/05 - Make smokegen not parse stdio.h as a workaround for FreeBSD based systems
25
+ 2010/12/05 - Minor changes to support Qt 4.7 on various platforms including Ubuntu 10.10
26
+
data/KNOWN_ISSUES.txt CHANGED
@@ -1,11 +1,5 @@
1
- 1. chart example fails - can't handle QFlags as return type
2
- 2. broadcastsender example fails - undefined method writeDatagram
3
- 3. fortuneserver example fails - undefined method seek
4
- 4. ftp example fails - undefined method icon=
5
- 5. http example fails - undefined method empty? for nil
6
- 6. textures example fails - Cannot handle Gluint
7
- 7. fontsample example fails - undefined method checkState for nil
8
- 8. svgviewer example fails - undefined method rx= for Qt::Point
9
- 9. passivepopup example fails - seg fault
10
- 10. textedit example fails - undefined method setTextFormat
11
- 11. digitalclock example fails - unresolved constructor call DigitalClock
1
+ 1. broadcastsender example fails - undefined method writeDatagram
2
+ 2. fortuneserver example fails - undefined method seek
3
+ 3. ftp example fails - undefined method icon=
4
+ 4. fontsampler example fails - undefined method checkState for nil
5
+ 5. passivepopup example fails - seg fault
data/bin/1.8/rbrcc.exe CHANGED
Binary file
data/bin/1.8/rbuic4.exe CHANGED
Binary file
data/bin/1.8/smokeapi.exe CHANGED
Binary file
Binary file
data/bin/1.9/rbrcc.exe CHANGED
Binary file
data/bin/1.9/rbuic4.exe CHANGED
Binary file
data/bin/1.9/smokeapi.exe CHANGED
Binary file
Binary file
@@ -261,7 +261,7 @@ class PieView < Qt::AbstractItemView
261
261
  selections = selectionModel()
262
262
  option = viewOptions()
263
263
  state = option.state
264
-
264
+
265
265
  background = option.palette.base()
266
266
  foreground = Qt::Pen.new(option.palette.color(Qt::Palette::Foreground))
267
267
  textPen = Qt::Pen.new(option.palette.color(Qt::Palette::Text))
@@ -38,6 +38,7 @@ class FtpWindow < Qt::Dialog
38
38
  super(parent)
39
39
  @ftp = nil
40
40
  @isDirectory = {}
41
+ @currentPath = ""
41
42
  @ftpServerLabel = Qt::Label.new(tr("Ftp &server:"))
42
43
  @ftpServerLineEdit = Qt::LineEdit.new("ftp.trolltech.com")
43
44
  @ftpServerLabel.buddy = @ftpServerLineEdit
@@ -95,6 +96,9 @@ class FtpWindow < Qt::Dialog
95
96
  end
96
97
 
97
98
  def connectOrDisconnect()
99
+ @currentPath = ""
100
+ @isDirectory = {}
101
+
98
102
  if !@ftp.nil?
99
103
  @ftp.abort
100
104
  @ftp.deleteLater
@@ -134,7 +138,7 @@ class FtpWindow < Qt::Dialog
134
138
  return
135
139
  end
136
140
 
137
- @file = Qt::File.new(fileName)
141
+ @file = Qt::File.new(@fileName)
138
142
  if !@file.open(Qt::IODevice::WriteOnly)
139
143
  Qt::MessageBox.information(self, tr("FTP"),
140
144
  tr("Unable to save the @file %s: %s." %
@@ -143,7 +147,7 @@ class FtpWindow < Qt::Dialog
143
147
  return
144
148
  end
145
149
 
146
- @ftp.get(@fileList.currentItem.text, file)
150
+ @ftp.get(@fileList.currentItem.text, @file)
147
151
 
148
152
  @progressDialog.labelText = tr("Downloading %s..." % @fileName)
149
153
  @progressDialog.show()
@@ -199,7 +203,8 @@ class FtpWindow < Qt::Dialog
199
203
  item = Qt::ListWidgetItem.new
200
204
  item.text = urlInfo.name()
201
205
  pixmap = Qt::Pixmap.new(urlInfo.dir? ? "images/dir.png" : "images/file.png")
202
- item.icon = pixmap
206
+
207
+ item.icon = Qt::Icon.new(pixmap)
203
208
 
204
209
  @isDirectory[urlInfo.name()] = urlInfo.isDir()
205
210
  @fileList.addItem(item)
@@ -106,7 +106,7 @@ class HttpWindow < Qt::Dialog
106
106
  end
107
107
 
108
108
  @http.setHost(url.host, url.port != -1 ? url.port : 80)
109
- if !url.userName.empty?
109
+ if url.userName and !url.userName.empty?
110
110
  @http.user = url.userName(url.password)
111
111
  end
112
112
 
@@ -34,7 +34,7 @@ class MainWindow < Qt::MainWindow
34
34
  'on_printAction_triggered()',
35
35
  'on_printPreviewAction_triggered()',
36
36
  'on_unmarkAction_triggered()',
37
- 'printPage(int, QPainter &, QPrinter &)',
37
+ 'printPage(int, QPainter*, QPrinter*)',
38
38
  'showFont(QTreeWidgetItem *)',
39
39
  'updateStyles(QTreeWidgetItem *, int)'
40
40
 
@@ -88,7 +88,7 @@ class MainWindow < Qt::MainWindow
88
88
  def on_clearAction_triggered()
89
89
  currentItem = @ui.fontTree.currentItem()
90
90
  @ui.fontTree.selectedItems.each do |item|
91
- fontTree.setItemSelected(item, false)
91
+ @ui.fontTree.setItemSelected(item, false)
92
92
  end
93
93
  @ui.fontTree.setItemSelected(currentItem, true)
94
94
  end
@@ -169,7 +169,7 @@ class MainWindow < Qt::MainWindow
169
169
  elsif state == Qt::Unchecked &&
170
170
  parent.checkState(0) == Qt::Checked
171
171
  marked = false
172
- for row in 0..parent.childCount
172
+ for row in 0..(parent.childCount - 1)
173
173
  if parent.child(row).checkState(0) == Qt::Checked
174
174
  marked = true
175
175
  break
@@ -183,7 +183,7 @@ class MainWindow < Qt::MainWindow
183
183
  else
184
184
  row
185
185
  number = 0
186
- for row in 0..item.childCount
186
+ for row in 0..(item.childCount - 1)
187
187
  if item.child(row).checkState(0) == Qt::Checked
188
188
  number += 1
189
189
  end
@@ -192,13 +192,13 @@ class MainWindow < Qt::MainWindow
192
192
  # Mark/unmark all child items when marking/unmarking top-level
193
193
  # items.
194
194
  if state == Qt::Checked && number == 0
195
- for row in 0..item.childCount
195
+ for row in 0..(item.childCount - 1)
196
196
  if item.child(row).checkState(0) == Qt::Unchecked
197
197
  item.child(row).setCheckState(0, Qt::Checked)
198
198
  end
199
199
  end
200
200
  elsif state == Qt::Unchecked && number > 0
201
- for row in 0..item.childCount
201
+ for row in 0..(item.childCount - 1)
202
202
  if item.child(row).checkState(0) == Qt::Checked
203
203
  item.child(row).setCheckState(0, Qt::Unchecked)
204
204
  end
@@ -268,18 +268,18 @@ class MainWindow < Qt::MainWindow
268
268
 
269
269
  preview = PreviewDialog.new(printer, self)
270
270
  connect(preview,
271
- SIGNAL('pageRequested(int, QPainter &, QPrinter &)'),
272
- self, SLOT('printPage(int, QPainter &, QPrinter &)'),
271
+ SIGNAL('pageRequested(int, QPainter*, QPrinter*)'),
272
+ self, SLOT('printPage(int, QPainter*, QPrinter*)'),
273
273
  Qt::DirectConnection)
274
274
 
275
- preview.numberOfPages = @pageMap.length
275
+ preview.setNumberOfPages = @pageMap.length
276
276
  preview.exec()
277
277
  end
278
278
 
279
279
  def currentPageMap()
280
280
  pageMap = {}
281
281
 
282
- for row in 0..@ui.fontTree.topLevelItemCount
282
+ for row in 0..(@ui.fontTree.topLevelItemCount - 1)
283
283
  familyItem = @ui.fontTree.topLevelItem(row)
284
284
 
285
285
  if familyItem.checkState(0) == Qt::Checked
@@ -287,10 +287,10 @@ class MainWindow < Qt::MainWindow
287
287
  pageMap[family] = []
288
288
  end
289
289
 
290
- for childRow in 0..familyItem.childCount
290
+ for childRow in 0..(familyItem.childCount - 1)
291
291
  styleItem = familyItem.child(childRow)
292
292
  if styleItem.checkState(0) == Qt::Checked
293
- pageMap[family].append(styleItem)
293
+ pageMap[family] << styleItem
294
294
  end
295
295
  end
296
296
  end
@@ -304,6 +304,7 @@ class MainWindow < Qt::MainWindow
304
304
  end
305
305
 
306
306
  def printPage(index, painter, printer)
307
+ pageMap = currentPageMap()
307
308
  family = pageMap.keys()[index]
308
309
  items = pageMap[family]
309
310
 
@@ -356,7 +357,7 @@ class MainWindow < Qt::MainWindow
356
357
  rect = fontMetrics.boundingRect("%s %s" % [font.family(), style])
357
358
  y += rect.height()
358
359
  painter.font = font
359
- painter.drawText(Qt::PointF.neew(x, y),
360
+ painter.drawText(Qt::PointF.new(x, y),
360
361
  "%s %s" % [family, style])
361
362
  y += interLineHeight
362
363
  end
@@ -31,7 +31,7 @@ class PreviewDialog < Qt::Dialog
31
31
  SmallPreviewLength = 200
32
32
  LargePreviewLength = 400
33
33
 
34
- signals 'pageRequested(int, QPainter &, QPrinter &)'
34
+ signals 'pageRequested(int, QPainter*, QPrinter*)'
35
35
 
36
36
  slots 'accept()',
37
37
  'addPage()',
@@ -49,7 +49,7 @@ class PreviewDialog < Qt::Dialog
49
49
 
50
50
  @currentPage = 0
51
51
  @pageCount = 0
52
- @ui.pageList.setIconSize(Qt::Size(SmallPreviewLength, SmallPreviewLength))
52
+ @ui.pageList.setIconSize(Qt::Size.new(SmallPreviewLength, SmallPreviewLength))
53
53
  @ui.pageList.header().hide()
54
54
  @previewLabel = PreviewLabel.new
55
55
  @printer = Qt::Printer.new
@@ -60,40 +60,40 @@ class PreviewDialog < Qt::Dialog
60
60
  end
61
61
 
62
62
  def setupComboBoxes()
63
- @ui.paperSizeCombo.addItem(tr("A0 (841 x 1189 mm)"), Qt::Printer::A0)
64
- @ui.paperSizeCombo.addItem(tr("A1 (594 x 841 mm)"), Qt::Printer::A1)
65
- @ui.paperSizeCombo.addItem(tr("A2 (420 x 594 mm)"), Qt::Printer::A2)
66
- @ui.paperSizeCombo.addItem(tr("A3 (297 x 420 mm)"), Qt::Printer::A3)
67
- @ui.paperSizeCombo.addItem(tr("A4 (210 x 297 mm, 8.26 x 11.7 inches)"), Qt::Printer::A4)
68
- @ui.paperSizeCombo.addItem(tr("A5 (148 x 210 mm)"), Qt::Printer::A5)
69
- @ui.paperSizeCombo.addItem(tr("A6 (105 x 148 mm)"), Qt::Printer::A6)
70
- @ui.paperSizeCombo.addItem(tr("A7 (74 x 105 mm)"), Qt::Printer::A7)
71
- @ui.paperSizeCombo.addItem(tr("A8 (52 x 74 mm)"), Qt::Printer::A8)
72
- @ui.paperSizeCombo.addItem(tr("A9 (37 x 52 mm)"), Qt::Printer::A9)
73
- @ui.paperSizeCombo.addItem(tr("B0 (1000 x 1414 mm)"), Qt::Printer::B0)
74
- @ui.paperSizeCombo.addItem(tr("B1 (707 x 1000 mm)"), Qt::Printer::B1)
75
- @ui.paperSizeCombo.addItem(tr("B2 (500 x 707 mm)"), Qt::Printer::B2)
76
- @ui.paperSizeCombo.addItem(tr("B3 (353 x 500 mm)"), Qt::Printer::B3)
77
- @ui.paperSizeCombo.addItem(tr("B4 (250 x 353 mm)"), Qt::Printer::B4)
78
- @ui.paperSizeCombo.addItem(tr("B5 (176 x 250 mm, 6.93 x 9.84 inches)"), Qt::Printer::B5)
79
- @ui.paperSizeCombo.addItem(tr("B6 (125 x 176 mm)"), Qt::Printer::B6)
80
- @ui.paperSizeCombo.addItem(tr("B7 (88 x 125 mm)"), Qt::Printer::B7)
81
- @ui.paperSizeCombo.addItem(tr("B8 (62 x 88 mm)"), Qt::Printer::B8)
82
- @ui.paperSizeCombo.addItem(tr("B9 (44 x 62 mm)"), Qt::Printer::B9)
83
- @ui.paperSizeCombo.addItem(tr("B10 (31 x 44 mm)"), Qt::Printer::B10)
84
- @ui.paperSizeCombo.addItem(tr("C5E (163 x 229 mm)"), Qt::Printer::C5E)
85
- @ui.paperSizeCombo.addItem(tr("DLE (110 x 220 mm)"), Qt::Printer::DLE)
86
- @ui.paperSizeCombo.addItem(tr("Executive (7.5 x 10 inches, 191 x 254 mm)"), Qt::Printer::Executive)
87
- @ui.paperSizeCombo.addItem(tr("Folio (210 x 330 mm)"), Qt::Printer::Folio)
88
- @ui.paperSizeCombo.addItem(tr("Ledger (432 x 279 mm)"), Qt::Printer::Ledger)
89
- @ui.paperSizeCombo.addItem(tr("Legal (8.5 x 14 inches, 216 x 356 mm)"), Qt::Printer::Legal)
90
- @ui.paperSizeCombo.addItem(tr("Letter (8.5 x 11 inches, 216 x 279 mm)"), Qt::Printer::Letter)
91
- @ui.paperSizeCombo.addItem(tr("Tabloid (279 x 432 mm)"), Qt::Printer::Tabloid)
92
- @ui.paperSizeCombo.addItem(tr("US Common #10 Envelope (105 x 241 mm)"), Qt::Printer::Comm10E)
93
- @ui.paperSizeCombo.currentIndex = @ui.paperSizeCombo.findData(Qt::Printer::A4)
94
-
95
- @ui.paperOrientationCombo.addItem(tr("Portrait"), Qt::Printer::Portrait)
96
- @ui.paperOrientationCombo.addItem(tr("Landscape"), Qt::Printer::Landscape)
63
+ @ui.paperSizeCombo.addItem(tr("A0 (841 x 1189 mm)"), Qt::Variant.new(Qt::Printer::A0))
64
+ @ui.paperSizeCombo.addItem(tr("A1 (594 x 841 mm)"), Qt::Variant.new(Qt::Printer::A1))
65
+ @ui.paperSizeCombo.addItem(tr("A2 (420 x 594 mm)"), Qt::Variant.new(Qt::Printer::A2))
66
+ @ui.paperSizeCombo.addItem(tr("A3 (297 x 420 mm)"), Qt::Variant.new(Qt::Printer::A3))
67
+ @ui.paperSizeCombo.addItem(tr("A4 (210 x 297 mm, 8.26 x 11.7 inches)"), Qt::Variant.new(Qt::Printer::A4))
68
+ @ui.paperSizeCombo.addItem(tr("A5 (148 x 210 mm)"), Qt::Variant.new(Qt::Printer::A5))
69
+ @ui.paperSizeCombo.addItem(tr("A6 (105 x 148 mm)"), Qt::Variant.new(Qt::Printer::A6))
70
+ @ui.paperSizeCombo.addItem(tr("A7 (74 x 105 mm)"), Qt::Variant.new(Qt::Printer::A7))
71
+ @ui.paperSizeCombo.addItem(tr("A8 (52 x 74 mm)"), Qt::Variant.new(Qt::Printer::A8))
72
+ @ui.paperSizeCombo.addItem(tr("A9 (37 x 52 mm)"), Qt::Variant.new(Qt::Printer::A9))
73
+ @ui.paperSizeCombo.addItem(tr("B0 (1000 x 1414 mm)"), Qt::Variant.new(Qt::Printer::B0))
74
+ @ui.paperSizeCombo.addItem(tr("B1 (707 x 1000 mm)"), Qt::Variant.new(Qt::Printer::B1))
75
+ @ui.paperSizeCombo.addItem(tr("B2 (500 x 707 mm)"), Qt::Variant.new(Qt::Printer::B2))
76
+ @ui.paperSizeCombo.addItem(tr("B3 (353 x 500 mm)"), Qt::Variant.new(Qt::Printer::B3))
77
+ @ui.paperSizeCombo.addItem(tr("B4 (250 x 353 mm)"), Qt::Variant.new(Qt::Printer::B4))
78
+ @ui.paperSizeCombo.addItem(tr("B5 (176 x 250 mm, 6.93 x 9.84 inches)"), Qt::Variant.new(Qt::Printer::B5))
79
+ @ui.paperSizeCombo.addItem(tr("B6 (125 x 176 mm)"), Qt::Variant.new(Qt::Printer::B6))
80
+ @ui.paperSizeCombo.addItem(tr("B7 (88 x 125 mm)"), Qt::Variant.new(Qt::Printer::B7))
81
+ @ui.paperSizeCombo.addItem(tr("B8 (62 x 88 mm)"), Qt::Variant.new(Qt::Printer::B8))
82
+ @ui.paperSizeCombo.addItem(tr("B9 (44 x 62 mm)"), Qt::Variant.new(Qt::Printer::B9))
83
+ @ui.paperSizeCombo.addItem(tr("B10 (31 x 44 mm)"), Qt::Variant.new(Qt::Printer::B10))
84
+ @ui.paperSizeCombo.addItem(tr("C5E (163 x 229 mm)"), Qt::Variant.new(Qt::Printer::C5E))
85
+ @ui.paperSizeCombo.addItem(tr("DLE (110 x 220 mm)"), Qt::Variant.new(Qt::Printer::DLE))
86
+ @ui.paperSizeCombo.addItem(tr("Executive (7.5 x 10 inches, 191 x 254 mm)"), Qt::Variant.new(Qt::Printer::Executive))
87
+ @ui.paperSizeCombo.addItem(tr("Folio (210 x 330 mm)"), Qt::Variant.new(Qt::Printer::Folio))
88
+ @ui.paperSizeCombo.addItem(tr("Ledger (432 x 279 mm)"), Qt::Variant.new(Qt::Printer::Ledger))
89
+ @ui.paperSizeCombo.addItem(tr("Legal (8.5 x 14 inches, 216 x 356 mm)"), Qt::Variant.new(Qt::Printer::Legal))
90
+ @ui.paperSizeCombo.addItem(tr("Letter (8.5 x 11 inches, 216 x 279 mm)"), Qt::Variant.new(Qt::Printer::Letter))
91
+ @ui.paperSizeCombo.addItem(tr("Tabloid (279 x 432 mm)"), Qt::Variant.new(Qt::Printer::Tabloid))
92
+ @ui.paperSizeCombo.addItem(tr("US Common #10 Envelope (105 x 241 mm)"), Qt::Variant.new(Qt::Printer::Comm10E))
93
+ @ui.paperSizeCombo.currentIndex = @ui.paperSizeCombo.findData(Qt::Variant.new(Qt::Printer::A4))
94
+
95
+ @ui.paperOrientationCombo.addItem(tr("Portrait"), Qt::Variant.new(Qt::Printer::Portrait))
96
+ @ui.paperOrientationCombo.addItem(tr("Landscape"), Qt::Variant.new(Qt::Printer::Landscape))
97
97
  end
98
98
 
99
99
  def addPage()
@@ -131,8 +131,8 @@ class PreviewDialog < Qt::Dialog
131
131
  @printer.paperRect().height()].max
132
132
  width = pixmap.width() * @printer.paperRect().width() / longestSide
133
133
  height = pixmap.height() * @printer.paperRect().height() / longestSide
134
-
135
- pixmap.fill(qRgb(224,224,224))
134
+
135
+ pixmap.fill(Qt::Color.new(qRgb(224,224,224)))
136
136
  painter = Qt::Painter.new
137
137
  painter.begin(pixmap)
138
138
  painter.renderHint = Qt::Painter::Antialiasing
@@ -235,7 +235,8 @@ class PreviewDialog < Qt::Dialog
235
235
  end
236
236
 
237
237
  def on_paperSizeCombo_activated(index)
238
- @printer.pageSize = @ui.paperSizeCombo.itemData(index.to_i)
238
+ Qt.debug_level = 100
239
+ @printer.paperSize = @ui.paperSizeCombo.itemData(index.to_i).value
239
240
 
240
241
  for index in 0..@ui.pageList.topLevelItemCount
241
242
  paintItem(@ui.pageList.topLevelItem(index), index)
@@ -25,7 +25,7 @@
25
25
 
26
26
  class PreviewLabel < Qt::Widget
27
27
 
28
- def initialize(parent)
28
+ def initialize(parent = nil)
29
29
  super(parent)
30
30
  end
31
31
 
@@ -33,7 +33,7 @@ class PreviewLabel < Qt::Widget
33
33
  painter = Qt::Painter.new
34
34
  painter.begin(self)
35
35
  painter.fillRect(event.rect(), Qt::Color.new(224,224,224))
36
- painter.drawPixmap(0, 0, @pixmap)
36
+ painter.drawPixmap(0, 0, @pixmap) if @pixmap
37
37
  painter.end()
38
38
  end
39
39
 
@@ -62,8 +62,8 @@ class SvgWindow < Qt::ScrollArea
62
62
 
63
63
  def mousePressEvent(event)
64
64
  @mousePressPos = event.pos
65
- @scrollBarValuesOnMousePress.rx = horizontalScrollBar.value
66
- @scrollBarValuesOnMousePress.ry = verticalScrollBar.value
65
+ @scrollBarValuesOnMousePress.x = horizontalScrollBar.value
66
+ @scrollBarValuesOnMousePress.y = verticalScrollBar.value
67
67
  event.accept
68
68
  end
69
69
 
@@ -785,6 +785,7 @@ IF (QT4_QMAKE_FOUND)
785
785
  FIND_PATH(QT_QT_INCLUDE_DIR qglobal.h
786
786
  PATHS
787
787
  ${QT_HEADERS_DIR}/Qt
788
+ ${QT_HEADERS_DIR}/QtCore
788
789
  ${QT_LIBRARY_DIR}/QtCore.framework/Headers
789
790
  NO_DEFAULT_PATH
790
791
  )
@@ -201,16 +201,58 @@ rpp::Stream* Preprocessor::sourceNeeded(QString& fileName, rpp::Preprocessor::In
201
201
  }
202
202
  if (path.isEmpty()) {
203
203
  foreach (QDir dir, m_includeDirs) {
204
+ #if 0
205
+ if (dir.absolutePath().endsWith(".framework"))
206
+ {
207
+ dir.setPath(dir.absolutePath() + "/Headers");
208
+ }
209
+ #endif
210
+ // qWarning("Searching in %s", qPrintable(dir.absolutePath()));
204
211
  info.setFile(dir, fileName);
205
212
  if (info.isFile()) {
206
213
  path = info.absoluteFilePath();
214
+ // qWarning("Found #include<%s>", qPrintable(fileName));
207
215
  break;
208
216
  }
209
217
  }
210
218
  }
211
-
219
+
220
+ #if defined(Q_OS_DARWIN)
221
+ /* Try searching for frameworks in default locations */
222
+ if (path.isEmpty()) {
223
+ QStringList splitString = fileName.split("/");
224
+ if (splitString.size() >= 2) {
225
+ QString frameworkName = splitString.takeFirst();
226
+ QString remainingFileName = splitString.join("/");
227
+ QDir dir1 = QDir(("/System/Library/Frameworks/" + frameworkName) + ".framework/Headers");
228
+ QDir dir2 = QDir(("/Library/Frameworks/" + frameworkName) + ".framework/Headers");
229
+ info.setFile(dir1, remainingFileName);
230
+ if (info.isFile()) {
231
+ path = info.absoluteFilePath();
232
+ // qWarning("Found #include<%s>", qPrintable(fileName));
233
+ }
234
+ else {
235
+ info.setFile(dir2, remainingFileName);
236
+ if (info.isFile()) {
237
+ path = info.absoluteFilePath();
238
+ // qWarning("Found #include<%s>", qPrintable(fileName));
239
+ }
240
+ }
241
+ }
242
+ }
243
+ #endif
244
+
245
+ if (fileName == "stdio.h")
246
+ {
247
+ qWarning("Not parsing stdio.h because it is not handled correctly by smokegen on FreeBSD based systems");
248
+ return 0;
249
+ }
250
+
212
251
  if (path.isEmpty())
252
+ {
253
+ qWarning("Couldn't find file for #include<%s>", qPrintable(fileName));
213
254
  return 0;
255
+ }
214
256
 
215
257
  QFile file(path);
216
258
  file.open(QFile::ReadOnly);
@@ -213,13 +213,20 @@ int generate()
213
213
  Options::qtMode = ParserOptions::qtMode;
214
214
 
215
215
  Options::voidpTypes << "long long" << "long long int" << "unsigned long long" << "unsigned long long int";
216
+ Options::scalarTypes << "long long" << "long long int" << "unsigned long long" << "unsigned long long int";
216
217
 
217
218
  // Fill the type map. It maps some long integral types to shorter forms as used in SMOKE.
218
219
  Util::typeMap["long int"] = "long";
219
220
  Util::typeMap["short int"] = "short";
220
221
  Util::typeMap["long double"] = "double";
221
222
  Util::typeMap["wchar_t"] = "int"; // correct?
222
-
223
+
224
+ if (sizeof(unsigned int) == sizeof(size_t)) {
225
+ Util::typeMap["size_t"] = "uint";
226
+ } else if (sizeof(unsigned long) == sizeof(size_t)) {
227
+ Util::typeMap["size_t"] = "ulong";
228
+ }
229
+
223
230
  qDebug() << "Generating SMOKE sources...";
224
231
 
225
232
  SmokeDataFile smokeData;
@@ -244,7 +244,7 @@ bool Util::canClassBeInstanciated(const Class* klass)
244
244
  if (meth.isConstructor()) {
245
245
  ctorFound = true;
246
246
  if (meth.access() != Access_private) {
247
- // this class can be instanciated
247
+ // this class can be instanstiated
248
248
  publicCtorFound = true;
249
249
  }
250
250
  } else if ((meth.flags() & Method::PureVirtual) && meth.access() == Access_private) {
@@ -252,9 +252,9 @@ bool Util::canClassBeInstanciated(const Class* klass)
252
252
  }
253
253
  }
254
254
 
255
- // The class can be instanciated if it has a public constructor or no constructor at all
255
+ // The class can be instanstiated if it has a public constructor or no constructor at all
256
256
  // because then it has a default one generated by the compiler.
257
- // If it has private pure virtuals, then it can't be instanciated either.
257
+ // If it has private pure virtuals, then it can't be instanstiated either.
258
258
  bool ret = ((publicCtorFound || !ctorFound) && !privatePureVirtualsFound);
259
259
  cache[klass] = ret;
260
260
  return ret;
@@ -375,7 +375,7 @@ void Util::checkForAbstractClass(Class* klass)
375
375
  list << &meth;
376
376
  }
377
377
 
378
- // abstract classes can't be instanciated - remove the constructors
378
+ // abstract classes can't be instanstiated - remove the constructors
379
379
  if (hasPrivatePureVirtuals) {
380
380
  foreach (const Method* ctor, list) {
381
381
  klass->methodsRef().removeOne(*ctor);
@@ -714,7 +714,7 @@ QList<const Method*> Util::virtualMethodsForClass(const Class* klass)
714
714
  {
715
715
  static QHash<const Class*, QList<const Method*> > cache;
716
716
 
717
- // virtual method callbacks for classes that can't be instanciated aren't useful
717
+ // virtual method callbacks for classes that can't be instanstiated aren't useful
718
718
  if (!Util::canClassBeInstanciated(klass))
719
719
  return QList<const Method*>();
720
720
 
@@ -469,7 +469,7 @@ void SmokeClassFiles::writeClass(QTextStream& out, const Class* klass, const QSt
469
469
  }
470
470
 
471
471
  // destructor
472
- // if the class can't be instanciated, a callback when it's deleted is unnecessary
472
+ // if the class can't be instanstiated, a callback when it's deleted is unnecessary
473
473
  if (Util::canClassBeInstanciated(klass)) {
474
474
  out << " ~" << smokeClassName << "() ";
475
475
  if (destructor && destructor->hasExceptionSpec()) {
@@ -205,6 +205,7 @@ KDevVarLengthArray<KDevVarLengthArray<QPair<uint, TOKEN_KIND>, 10 >, index_size
205
205
  ADD_TOKEN(virtual);
206
206
  ADD_TOKEN(void);
207
207
  ADD_TOKEN(volatile);
208
+ ADD_TOKEN(size_t);
208
209
  ADD_TOKEN(wchar_t);
209
210
  ADD_TOKEN(while);
210
211
  ADD_TOKEN(xor);
@@ -369,9 +369,8 @@ void Parser::reportError(const QString& msg)
369
369
  Problem *p = new Problem;
370
370
  p->file = session->url().str();
371
371
  p->position = position;
372
- p->description = msg;
372
+ p->description = msg + " : " + QString::fromUtf8(lineFromContents(session->contents(), p->position.line));
373
373
  p->source = Problem::Source_Parser;
374
-
375
374
  control->reportProblem(p);
376
375
  }
377
376
  else if (_M_hold_errors)
@@ -411,6 +410,7 @@ bool Parser::skipUntilDeclaration()
411
410
  case Token_identifier:
412
411
  case Token_operator:
413
412
  case Token_char:
413
+ case Token_size_t:
414
414
  case Token_wchar_t:
415
415
  case Token_bool:
416
416
  case Token_short:
@@ -476,6 +476,7 @@ bool Parser::skipUntilStatement()
476
476
  case Token_catch:
477
477
  case Token_throw:
478
478
  case Token_char:
479
+ case Token_size_t:
479
480
  case Token_wchar_t:
480
481
  case Token_bool:
481
482
  case Token_short:
@@ -1199,6 +1200,7 @@ bool Parser::parseSimpleTypeSpecifier(TypeSpecifierAST *&node,
1199
1200
  switch(session->token_stream->lookAhead())
1200
1201
  {
1201
1202
  case Token_char:
1203
+ case Token_size_t:
1202
1204
  case Token_wchar_t:
1203
1205
  case Token_bool:
1204
1206
  case Token_short:
@@ -36,6 +36,26 @@ QByteArray stringFromContents(const PreprocessedContents& contents, int offset,
36
36
  return ret;
37
37
  }
38
38
 
39
+ #include <stdio.h>
40
+
41
+ QByteArray lineFromContents(const uint* contents, int lineNumber) {
42
+ int a1 = 0;
43
+ int lineCount = 0;
44
+ while (lineCount < lineNumber) {
45
+ if (isNewline(contents[a1])) {
46
+ lineCount++;
47
+ }
48
+ a1++;
49
+ }
50
+
51
+ int a2 = a1;
52
+ while (!isNewline(contents[a2])) {
53
+ a2++;
54
+ }
55
+
56
+ return stringFromContents(contents + a1, a2 - a1);
57
+ }
58
+
39
59
  QByteArray stringFromContents(const uint* contents, int count) {
40
60
  QByteArray ret;
41
61
  for(int a = 0; a < count; ++a) {
@@ -72,12 +72,19 @@ inline bool isNumber(unsigned int c) {
72
72
  return isCharacter(c) && QChar(characterFromIndex(c)).isNumber();
73
73
  }
74
74
 
75
+ inline bool isNewline(unsigned int c) {
76
+ return isCharacter(c) && characterFromIndex(c) == '\n';
77
+ }
78
+
75
79
  ///Opposite of convertFromByteArray
76
80
  CPPPARSER_EXPORT QByteArray stringFromContents(const PreprocessedContents& contents, int offset = 0, int count = 0);
77
81
 
78
82
  ///Opposite of convertFromByteArray
79
83
  CPPPARSER_EXPORT QByteArray stringFromContents(const uint* contents, int count);
80
84
 
85
+ ///Return the line at the given line number from the contents
86
+ CPPPARSER_EXPORT QByteArray lineFromContents(const uint* contents, int lineNumber);
87
+
81
88
  ///Returns a string that has a gap inserted between the tokens(for debugging)
82
89
  CPPPARSER_EXPORT QByteArray stringFromContentsWithGaps(const PreprocessedContents& contents, int offset = 0, int count = 0);
83
90
 
@@ -268,10 +268,10 @@ void pp_macro_expander::operator()(Stream& input, Stream& output)
268
268
  output << '\"';
269
269
 
270
270
  while (!is.atEnd()) {
271
- if (input == '"') {
271
+ if (is == '"') {
272
272
  output << '\\' << is;
273
273
 
274
- } else if (input == '\n') {
274
+ } else if (is == '\n') {
275
275
  output << '"' << is << '"';
276
276
 
277
277
  } else {
@@ -338,7 +338,7 @@ void pp_macro_expander::operator()(Stream& input, Stream& output)
338
338
 
339
339
  skip_blanks(input, devnull());
340
340
  //Omit paste tokens behind empty used actuals, else we will merge with the previous text
341
- if(input == '#' && (++input) == '#') {
341
+ if(!input.atEnd() && input == '#' && !(++input).atEnd() && input == '#') {
342
342
  ++input;
343
343
  //We have skipped a paste token
344
344
  }else{