gtk3 3.0.8-x86-mingw32 → 3.0.9-x86-mingw32

Sign up to get free protection for your applications and to get access to all the features.
Files changed (86) hide show
  1. checksums.yaml +4 -4
  2. data/ext/gtk3/rb-gtk3.c +17 -0
  3. data/lib/2.2/gtk3.so +0 -0
  4. data/lib/2.3/gtk3.so +0 -0
  5. data/lib/gtk3/container.rb +0 -7
  6. data/lib/gtk3/deprecated.rb +3 -3
  7. data/lib/gtk3/image.rb +7 -7
  8. data/lib/gtk3/loader.rb +11 -5
  9. data/lib/gtk3/text-buffer.rb +33 -12
  10. data/lib/gtk3/text-view.rb +53 -0
  11. data/lib/gtk3/tree-model.rb +5 -0
  12. data/lib/gtk3/tree-view.rb +25 -0
  13. data/lib/gtk3/widget.rb +0 -5
  14. data/sample/gtk-demo/TODO +10 -6
  15. data/sample/gtk-demo/application.ui +93 -70
  16. data/sample/gtk-demo/appmenu.ui +19 -0
  17. data/sample/gtk-demo/assistant.rb +1 -0
  18. data/sample/gtk-demo/css_accordion.css +8 -8
  19. data/sample/gtk-demo/css_accordion.rb +2 -2
  20. data/sample/gtk-demo/css_basics.css +1 -1
  21. data/sample/gtk-demo/css_basics.rb +2 -2
  22. data/sample/gtk-demo/css_multiplebgs.rb +2 -2
  23. data/sample/gtk-demo/css_pixbufs.css +2 -2
  24. data/sample/gtk-demo/css_pixbufs.rb +2 -2
  25. data/sample/gtk-demo/css_shadows.css +5 -5
  26. data/sample/gtk-demo/css_shadows.rb +2 -2
  27. data/sample/gtk-demo/cssview.css +5 -5
  28. data/sample/gtk-demo/data/16x16/gtk3-demo-symbolic.symbolic.png +0 -0
  29. data/sample/gtk-demo/data/16x16/gtk3-demo.png +0 -0
  30. data/sample/gtk-demo/data/22x22/gtk3-demo-symbolic.symbolic.png +0 -0
  31. data/sample/gtk-demo/data/22x22/gtk3-demo.png +0 -0
  32. data/sample/gtk-demo/data/24x24/gtk3-demo-symbolic.symbolic.png +0 -0
  33. data/sample/gtk-demo/data/24x24/gtk3-demo.png +0 -0
  34. data/sample/gtk-demo/data/256x256/gtk3-demo-symbolic.symbolic.png +0 -0
  35. data/sample/gtk-demo/data/256x256/gtk3-demo.png +0 -0
  36. data/sample/gtk-demo/data/32x32/gtk3-demo-symbolic.symbolic.png +0 -0
  37. data/sample/gtk-demo/data/32x32/gtk3-demo.png +0 -0
  38. data/sample/gtk-demo/data/48x48/gtk3-demo-symbolic.symbolic.png +0 -0
  39. data/sample/gtk-demo/data/48x48/gtk3-demo.png +0 -0
  40. data/sample/gtk-demo/data/512x512/gtk3-demo-symbolic.symbolic.png +0 -0
  41. data/sample/gtk-demo/data/512x512/gtk3-demo.png +0 -0
  42. data/sample/gtk-demo/data/source.svg +2886 -0
  43. data/sample/gtk-demo/data/symbolic-source.svg +29 -0
  44. data/sample/gtk-demo/demo.gresource.xml +16 -5
  45. data/sample/gtk-demo/demo.ui +1 -0
  46. data/sample/gtk-demo/font_features.rb +1 -1
  47. data/sample/gtk-demo/main.rb +2 -2
  48. data/sample/gtk-demo/main.ui +18 -36
  49. data/sample/gtk-demo/markup.rb +53 -8
  50. data/sample/gtk-demo/markup.txt +2 -2
  51. data/sample/gtk-demo/org.gtk.Demo.gschema.xml +9 -0
  52. data/sample/gtk-demo/pixbufs.rb +105 -145
  53. data/sample/gtk-demo/reset.css +1 -58
  54. data/sample/gtk-demo/rotated_text.rb +119 -55
  55. data/sample/gtk-demo/shortcuts-boxes.ui +167 -0
  56. data/sample/gtk-demo/shortcuts-builder.ui +547 -0
  57. data/sample/gtk-demo/shortcuts-clocks.ui +166 -0
  58. data/sample/gtk-demo/shortcuts-gedit.ui +172 -0
  59. data/sample/gtk-demo/shortcuts.ui +65 -0
  60. data/sample/gtk-demo/stack.ui +5 -5
  61. data/sample/gtk-demo/textscroll.rb +106 -0
  62. data/sample/gtk-demo/theming.ui +58 -22
  63. data/sample/gtk-demo/theming_style_classes.rb +5 -4
  64. data/sample/gtk-demo/transparent.rb +143 -0
  65. data/sample/misc/aboutdialog.rb +1 -1
  66. data/sample/misc/bindings.rb +36 -15
  67. data/sample/misc/combobox.rb +1 -1
  68. data/sample/misc/dnd.rb +3 -3
  69. data/sample/misc/icons-theme-viewer.rb +1 -1
  70. data/sample/misc/iconview.rb +2 -2
  71. data/sample/misc/textbuffer-serialize.rb +18 -14
  72. data/sample/misc/to-drawable.rb +2 -2
  73. data/sample/misc/tooltips.rb +1 -0
  74. data/sample/misc/treeview.rb +1 -1
  75. data/sample/tutorial/README.md +18 -18
  76. data/test/test-gtk-clipboard.rb +1 -1
  77. data/test/test-gtk-combo-box.rb +2 -2
  78. data/test/test-gtk-icon-view.rb +2 -2
  79. data/test/test-gtk-image.rb +1 -1
  80. data/test/test-gtk-list-store.rb +9 -3
  81. data/test/test-gtk-text-view.rb +64 -0
  82. data/test/test-gtk-tree-path.rb +1 -3
  83. data/test/test-gtk-tree-view.rb +97 -0
  84. data/test/test-gtk-window.rb +2 -2
  85. data/test/test-pango-context.rb +56 -0
  86. metadata +46 -19
@@ -7,62 +7,5 @@
7
7
  */
8
8
 
9
9
  * {
10
- color: inherit;
11
- font-size: inherit;
12
- background-color: initial;
13
- font-family: inherit;
14
- font-style: inherit;
15
- font-variant: inherit;
16
- font-weight: inherit;
17
- text-shadow: inherit;
18
- icon-shadow: inherit;
19
- box-shadow: initial;
20
- margin-top: initial;
21
- margin-left: initial;
22
- margin-bottom: initial;
23
- margin-right: initial;
24
- padding-top: initial;
25
- padding-left: initial;
26
- padding-bottom: initial;
27
- padding-right: initial;
28
- border-top-style: initial;
29
- border-top-width: initial;
30
- border-left-style: initial;
31
- border-left-width: initial;
32
- border-bottom-style: initial;
33
- border-bottom-width: initial;
34
- border-right-style: initial;
35
- border-right-width: initial;
36
- border-top-left-radius: initial;
37
- border-top-right-radius: initial;
38
- border-bottom-right-radius: initial;
39
- border-bottom-left-radius: initial;
40
- outline-style: initial;
41
- outline-width: initial;
42
- outline-offset: initial;
43
- background-clip: initial;
44
- background-origin: initial;
45
- background-size: initial;
46
- background-position: initial;
47
- border-top-color: initial;
48
- border-right-color: initial;
49
- border-bottom-color: initial;
50
- border-left-color: initial;
51
- outline-color: initial;
52
- background-repeat: initial;
53
- background-image: initial;
54
- border-image-source: initial;
55
- border-image-repeat: initial;
56
- border-image-slice: initial;
57
- border-image-width: initial;
58
- transition-property: initial;
59
- transition-duration: initial;
60
- transition-timing-function: initial;
61
- transition-delay: initial;
62
- engine: initial;
63
- gtk-key-bindings: initial;
64
-
65
- -GtkWidget-focus-line-width: 0;
66
- -GtkWidget-focus-padding: 0;
67
- -GtkNotebook-initial-gap: 0;
10
+ all: unset;
68
11
  }
@@ -1,72 +1,136 @@
1
- # Copyright (c) 2005-2014 Ruby-GNOME2 Project Team
1
+ # Copyright (c) 2016 Ruby-GNOME2 Project Team
2
2
  # This program is licenced under the same licence as Ruby-GNOME2.
3
3
  #
4
- # $Id: rotated_text.rb,v 1.2 2005/03/05 15:01:16 mutoh Exp $
5
4
  =begin
6
- = Rotated Text
5
+ = Pango/Rotated Text
7
6
 
8
- This demo shows how to use Cairo and Pango to draw rotated and transformed text.
7
+ This demo shows how to use PangoCairo to draw rotated and transformed
8
+ text. The right pane shows a rotated GtkLabel widget.
9
+
10
+ In both cases, a custom PangoCairo shape renderer is installed to draw
11
+ a red heard using cairo drawing operations instead of the Unicode heart
12
+ character.
9
13
  =end
10
- require "common"
11
-
12
- module Demo
13
- class RotatedText < BasicWindow
14
- RADIUS = 150
15
- N_WORDS = 10
16
- FONT = "Sans Bold 27"
17
-
18
- def initialize
19
- super("Rotated Text")
20
-
21
- drawing_area = Gtk::DrawingArea.new
22
- add(drawing_area)
23
- drawing_area.override_background_color(:normal, Gdk::RGBA.new(1.0,
24
- 1.0,
25
- 1.0,
26
- 0.0))
27
-
28
- drawing_area.signal_connect("draw") do |_drawing_area, cairo_context|
29
- cairo_context.set_source_rgb(1.0, 1.0, 1.0)
30
- cairo_context.paint
31
- cairo_context.save do
32
- width, height = size
33
- cairo_context.scale(width.to_f / (RADIUS * 2),
34
- height.to_f / (RADIUS * 2))
35
- draw_text(cairo_context)
36
- end
37
- end
38
- end
14
+ module RotatedTextDemo
15
+ HEART = "♥"
16
+ RADIUS = 150
17
+ N_WORDS = 5
18
+ FONT = "Serif 18"
19
+ TEXT = "I ♥ GTK+"
39
20
 
40
- private
41
- def draw_text(cairo_context)
42
- # Center coordinates on the middle of the region we are drawing
43
- cairo_context.translate(RADIUS, RADIUS)
21
+ def self.run_demo(main_window)
22
+ window = Gtk::Window.new(:toplevel)
23
+ window.screen = main_window.screen
24
+ window.title = "Rotated Text"
25
+ window.set_default_size(4 * RADIUS, 2 * RADIUS)
44
26
 
45
- # Create a PangoLayout, set the font and text
46
- layout = cairo_context.create_pango_layout
27
+ box = Gtk::Box.new(:horizontal, 0)
28
+ box.homogeneous = true
29
+ window.add(box)
47
30
 
48
- layout.text = "Text"
49
- layout.font_description = Pango::FontDescription.new(FONT)
31
+ # Add adrawing area
32
+ drawing_area = Gtk::DrawingArea.new
33
+ box.add(drawing_area)
34
+ drawing_area.style_context.add_class("view")
50
35
 
51
- # Draw the layout N_WORDS times in a circle
52
- N_WORDS.times do |i|
53
- angle = (360.0 * i) / N_WORDS
36
+ drawing_area.signal_connect "draw" do |widget, cr|
37
+ # Create a cairo context and set up a transformation matrix so that the
38
+ # user space coordinates for the centered square where we draw are
39
+ # [-RADIUS, RADIUS], [-RADIUS, RADIUS].
40
+ # We first center, then change the scale.
41
+ width = widget.allocated_width
42
+ height = widget.allocated_width
43
+ device_radius = [width, height].min / 2
44
+ cr.translate(device_radius + (width - 2 * device_radius) / 2,
45
+ device_radius + (height - 2 * device_radius) / 2)
46
+ cr.scale(device_radius / RADIUS, device_radius / RADIUS)
47
+
48
+ # Create a subtle gradient source and use it
49
+ pattern = Cairo::LinearPattern.new(-RADIUS, -RADIUS, RADIUS, RADIUS)
50
+ pattern.add_color_stop_rgb(0, 0.5, 0, 0)
51
+ pattern.add_color_stop_rgb(1, 0, 0, 0.5)
52
+ cr.set_source(pattern)
54
53
 
55
- cairo_context.save do
56
- # Gradient from red at angle == 60 to blue at angle == 240
57
- red = (1 + Math.cos((angle - 60) * Math::PI / 180.0)) / 2
58
- cairo_context.set_source_rgb(red, 0.0, 1.0 - red)
54
+ # Create a PangoContext and set up our shape renderer
55
+ context = widget.create_pango_context
56
+ context.set_shape_renderer do |cairo, attr, do_path|
57
+ fancy_shape_renderer(cairo, attr, do_path)
58
+ end
59
59
 
60
- cairo_context.rotate(angle * Math::PI / 180.0)
60
+ # Create a PangoLayout, set the text, font and attributes
61
+ layout = Pango::Layout.new(context)
62
+ layout.text = TEXT
63
+ desc = Pango::FontDescription.new(FONT)
64
+ layout.font_description = desc
61
65
 
62
- # Inform Pango to re-layout the text with the new transformation
63
- cairo_context.update_pango_layout(layout)
66
+ attrs = create_fancy_attr_list_for_layout(layout)
67
+ layout.attributes = attrs
64
68
 
65
- width, height = layout.size
66
- cairo_context.move_to(-(width / Pango::SCALE) / 2, -RADIUS)
67
- cairo_context.show_pango_layout(layout)
68
- end
69
+ # Draw the layout N_WORDS times in a circle
70
+ N_WORDS.times do
71
+ # inform Pango to re-layout the text with the new transformation matrix
72
+ cr.update_pango_layout(layout)
73
+ w, = layout.pixel_size
74
+ cr.move_to(- w / 2, - RADIUS * 0.9)
75
+ cr.show_pango_layout(layout)
76
+ cr.rotate(Math::PI * 2 / N_WORDS)
69
77
  end
78
+
79
+ false
80
+ end
81
+
82
+ # And a label
83
+ label = Gtk::Label.new(TEXT)
84
+ box.add(label)
85
+ label.angle = 45
86
+
87
+ # Set up fancy stuff on the label
88
+ layout = label.layout
89
+ layout.context.set_shape_renderer do |cr, attr, do_path|
90
+ fancy_shape_renderer(cr, attr, do_path)
70
91
  end
92
+
93
+ layout.attributes = create_fancy_attr_list_for_layout(layout)
94
+
95
+ if !window.visible?
96
+ window.show_all
97
+ else
98
+ window.destroy
99
+ end
100
+ window
101
+ end
102
+
103
+ def self.fancy_shape_renderer(cr, attr, do_path)
104
+ x, y = cr.current_point
105
+ cr.translate(x, y)
106
+ cr.scale(attr.ink_rect.width / Pango::SCALE,
107
+ attr.ink_rect.height / Pango::SCALE)
108
+
109
+ if attr.data == HEART
110
+ cr.move_to(0.5, 0)
111
+ cr.line_to(0.9, -0.4)
112
+ cr.curve_to(1.1, -0.8, 0.5, -0.9, 0.5, -0.5)
113
+ cr.curve_to(0.5, -0.9, -0.1, -0.8, 0.1, -0.4)
114
+ cr.close_path
115
+ end
116
+
117
+ unless do_path
118
+ cr.set_source_rgb(1, 0, 0)
119
+ cr.fill
120
+ end
121
+ end
122
+
123
+ def self.create_fancy_attr_list_for_layout(layout)
124
+ metrics = layout.context.get_metrics(layout.font_description)
125
+ ascent = metrics.ascent
126
+ logical_rect = Pango::Rectangle.new(0, -ascent, ascent, ascent)
127
+ ink_rect = logical_rect.dup
128
+
129
+ attrs = Pango::AttrList.new
130
+ attr = Pango::AttrShape.new(ink_rect, logical_rect, HEART)
131
+ attr.start_index = TEXT[0, TEXT.index(HEART)].bytesize
132
+ attr.end_index = attr.start_index + HEART.bytesize
133
+ attrs.insert(attr)
134
+ attrs
71
135
  end
72
136
  end
@@ -0,0 +1,167 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <interface>
3
+ <!-- interface-requires gtk+ 3.17 -->
4
+
5
+ <object class="GtkShortcutsWindow" id="shortcuts-boxes">
6
+ <property name="modal">1</property>
7
+
8
+ <child>
9
+ <object class="GtkShortcutsSection">
10
+ <property name="visible">1</property>
11
+ <property name="section-name">shortcuts</property>
12
+ <property name="max-height">12</property>
13
+
14
+ <!-- Overview shortcuts -->
15
+ <child>
16
+ <object class="GtkShortcutsGroup">
17
+ <property name="visible">1</property>
18
+ <property name="title" translatable="yes">Overview</property>
19
+ <property name="view">overview</property>
20
+
21
+ <child>
22
+ <object class="GtkShortcutsShortcut">
23
+ <property name="visible">1</property>
24
+ <property name="accelerator">F1</property>
25
+ <property name="title" translatable="yes">Help</property>
26
+ </object>
27
+ </child>
28
+
29
+ <child>
30
+ <object class="GtkShortcutsShortcut">
31
+ <property name="visible">1</property>
32
+ <property name="accelerator">&lt;Ctrl&gt;n</property>
33
+ <property name="title" translatable="yes">Create a new box</property>
34
+ </object>
35
+ </child>
36
+
37
+ <child>
38
+ <object class="GtkShortcutsShortcut">
39
+ <property name="visible">1</property>
40
+ <property name="accelerator">&lt;Ctrl&gt;f</property>
41
+ <property name="title" translatable="yes">Search</property>
42
+ </object>
43
+ </child>
44
+
45
+ <child>
46
+ <object class="GtkShortcutsShortcut">
47
+ <property name="visible">1</property>
48
+ <property name="accelerator">&lt;Ctrl&gt;k</property>
49
+ <property name="title" translatable="yes">Keyboard shortcuts</property>
50
+ </object>
51
+ </child>
52
+
53
+ <child>
54
+ <object class="GtkShortcutsShortcut">
55
+ <property name="visible">1</property>
56
+ <property name="accelerator">&lt;Ctrl&gt;q</property>
57
+ <property name="title" translatable="yes">Close Window/Quit Boxes</property>
58
+ </object>
59
+ </child>
60
+ </object>
61
+ </child>
62
+
63
+ <!-- Wizard and Properties shortcuts -->
64
+ <child>
65
+ <object class="GtkShortcutsGroup">
66
+ <property name="visible">1</property>
67
+ <property name="title" translatable="yes">Box Creation and Properties</property>
68
+ <property name="view">wizard</property>
69
+
70
+ <!-- LTR -->
71
+ <child>
72
+ <object class="GtkShortcutsShortcut">
73
+ <property name="visible">1</property>
74
+ <property name="direction">ltr</property>
75
+ <property name="accelerator">&lt;Alt&gt;Right</property>
76
+ <property name="title" translatable="yes">Switch to the next page</property>
77
+ </object>
78
+ </child>
79
+
80
+ <child>
81
+ <object class="GtkShortcutsShortcut">
82
+ <property name="visible">1</property>
83
+ <property name="direction">ltr</property>
84
+ <property name="accelerator">&lt;Alt&gt;Left</property>
85
+ <property name="title" translatable="yes">Switch to the previous page</property>
86
+ </object>
87
+ </child>
88
+
89
+ <!-- RTL -->
90
+ <child>
91
+ <object class="GtkShortcutsShortcut">
92
+ <property name="visible">1</property>
93
+ <property name="direction">rtl</property>
94
+ <property name="accelerator">&lt;Alt&gt;Left</property>
95
+ <property name="title" translatable="yes">Switch to the next page</property>
96
+ </object>
97
+ </child>
98
+
99
+ <child>
100
+ <object class="GtkShortcutsShortcut">
101
+ <property name="visible">1</property>
102
+ <property name="direction">rtl</property>
103
+ <property name="accelerator">&lt;Alt&gt;Right</property>
104
+ <property name="title" translatable="yes">Switch to the previous page</property>
105
+ </object>
106
+ </child>
107
+ </object>
108
+ </child>
109
+
110
+ <!-- Display shortcuts -->
111
+ <child>
112
+ <object class="GtkShortcutsGroup">
113
+ <property name="visible">1</property>
114
+ <property name="title" translatable="yes">Box Display</property>
115
+ <property name="view">display</property>
116
+
117
+ <child>
118
+ <object class="GtkShortcutsShortcut">
119
+ <property name="visible">1</property>
120
+ <property name="accelerator">Control_L+Alt_L</property>
121
+ <property name="title" translatable="yes">Grab/Ungrab keyboard</property>
122
+ </object>
123
+ </child>
124
+
125
+ <!-- LTR -->
126
+ <child>
127
+ <object class="GtkShortcutsShortcut">
128
+ <property name="visible">1</property>
129
+ <property name="direction">ltr</property>
130
+ <property name="accelerator">&lt;Alt&gt;Left</property>
131
+ <property name="title" translatable="yes">Back to overview</property>
132
+ </object>
133
+ </child>
134
+
135
+ <!-- RTL -->
136
+ <child>
137
+ <object class="GtkShortcutsShortcut">
138
+ <property name="visible">1</property>
139
+ <property name="direction">rtl</property>
140
+ <property name="accelerator">&lt;Alt&gt;Right</property>
141
+ <property name="title" translatable="yes">Back to overview</property>
142
+ </object>
143
+ </child>
144
+
145
+ <child>
146
+ <object class="GtkShortcutsShortcut">
147
+ <property name="visible">1</property>
148
+ <property name="accelerator">&lt;Ctrl&gt;q</property>
149
+ <property name="title" translatable="yes">Close window/Quit Boxes</property>
150
+ </object>
151
+ </child>
152
+
153
+ <child>
154
+ <object class="GtkShortcutsShortcut">
155
+ <property name="visible">1</property>
156
+ <property name="accelerator">F11</property>
157
+ <property name="title" translatable="yes">Fullscreen/Restore from fullscreen</property>
158
+ </object>
159
+ </child>
160
+ </object>
161
+ </child>
162
+
163
+ </object>
164
+ </child>
165
+ </object>
166
+
167
+ </interface>