libui_paradise 0.2.47 → 0.2.48

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of libui_paradise might be problematic. Click here for more details.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fab1c58cac6e317237a99b41a688b30ac2608af85c59e875f833d686d73e9f7f
4
- data.tar.gz: 2dfb6e810f4f36228210903f025626d8f9c67b54f24abed0614c27250b80ced9
3
+ metadata.gz: 015e2bdf5347c46f0626f2c85986c1ff78a6ba012bdc93bcd155ec03d0119fd4
4
+ data.tar.gz: ec220a3ab72d23b380f13514385b77c0502ca2551307319c616323c607d6814c
5
5
  SHA512:
6
- metadata.gz: fc594f56cf0510b19988aed6478fad45b10dd4d272780e75dfded90e845faf440002f98842151b55d2a4e418ed20f684f944892c45a746497b0839195e991acb
7
- data.tar.gz: 7a15dd21e92dbb412d8cffbc47b0dfd8396596917ea4887c298a9a1ff66fad37beb072d1307060a9472986f5731ac45a3044b97aad6d5369a0fda581659f714d
6
+ metadata.gz: 63ac2173d296097061f9acc5785de0a7023312e4e5d8aa8397536c388059a8d6ffaa4b4f087374f1ef540d5d0ce99000fe410f450d8637ecc84fd56015a54302
7
+ data.tar.gz: 9d427d5b2f98585eb5960b14d070ace27ff802f2c09abda741a7c110f27ef9b5e6d2435240985ad92556b1648a040deaed608d5c0cbd25b672c95dae5c07e917
data/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
  [![forthebadge](https://forthebadge.com/images/badges/made-with-ruby.svg)](https://www.ruby-lang.org/en/)
3
3
  [![Gem Version](https://badge.fury.io/rb/libui_paradise.svg)](https://badge.fury.io/rb/libui_paradise)
4
4
 
5
- This gem was <b>last updated</b> on the <span style="color: darkblue; font-weight: bold">04.09.2022</span> (dd.mm.yyyy notation), at <span style="color: steelblue; font-weight: bold">19:16:10</span> o'clock.
5
+ This gem was <b>last updated</b> on the <span style="color: darkblue; font-weight: bold">09.09.2022</span> (dd.mm.yyyy notation), at <span style="color: steelblue; font-weight: bold">15:44:15</span> o'clock.
6
6
 
7
7
  ## The libui_paradise project
8
8
 
@@ -749,6 +749,29 @@ not necessarily recommending this be done, but **if** you ever have
749
749
  such a use case then you can use it - which is another reason why
750
750
  I added this screenshot, so that I don't forget. :)
751
751
 
752
+ ## Padding elements in LibUI
753
+
754
+ The general API for setting padding to a container in LibUI
755
+ goes via:
756
+
757
+ LibUI.box_set_padded(box, 1) # The value is usually either 0 or 1.
758
+
759
+ The alignment value may be as follows:
760
+
761
+ 0: Fill
762
+ 1: Start
763
+ 2: Center
764
+ 3: End
765
+
766
+ Positioning values may typically be:
767
+
768
+ 0: Left
769
+ 1: Top
770
+ 2: Right
771
+
772
+ Have a look at the example file <b>libui_paradise/examples/simple/007_control_gallery.rb</b>
773
+ to see how this could be used.
774
+
752
775
  ## LibUI::FFI::DrawTextLayoutParams.malloc
753
776
 
754
777
  LibUI::FFI::DrawTextLayoutParams.malloc can be used to draw
@@ -1087,19 +1110,6 @@ subsequently removed one day.
1087
1110
  UI.control_show(main_window)
1088
1111
  main_window.show_the_controls # Or use this one here.
1089
1112
 
1090
- # How to set a padded box:
1091
-
1092
- UI.box_set_padded(box, 1) # The value is either 0 or 1.
1093
-
1094
- Alignment may be:
1095
- 0: Fill
1096
- 1: Start
1097
- 2: Center
1098
- 3: End
1099
- Positioning:
1100
- 0: Left
1101
- 1: Top
1102
- 2: Right
1103
1113
 
1104
1114
  # Add a checkbox (checkbox tag, checkbutton)
1105
1115
 
@@ -1553,6 +1563,15 @@ Use the following API for this:
1553
1563
 
1554
1564
  image = LibUI.new_image(width, height)
1555
1565
 
1566
+ You can use external libraries to determine the width
1567
+ and height of an image, such as ChunkyPNG.
1568
+
1569
+ Example for this:
1570
+
1571
+ canvas = ChunkyPNG::Canvas.from_io(this_file)
1572
+ width = canvas.width
1573
+ height = canvas.height
1574
+
1556
1575
  ## Horizontal boxes
1557
1576
 
1558
1577
  A HBox represents a horizontal box. The API for putting
data/doc/README.gen CHANGED
@@ -746,6 +746,29 @@ not necessarily recommending this be done, but **if** you ever have
746
746
  such a use case then you can use it - which is another reason why
747
747
  I added this screenshot, so that I don't forget. :)
748
748
 
749
+ ## Padding elements in LibUI
750
+
751
+ The general API for setting padding to a container in LibUI
752
+ goes via:
753
+
754
+ LibUI.box_set_padded(box, 1) # The value is usually either 0 or 1.
755
+
756
+ The alignment value may be as follows:
757
+
758
+ 0: Fill
759
+ 1: Start
760
+ 2: Center
761
+ 3: End
762
+
763
+ Positioning values may typically be:
764
+
765
+ 0: Left
766
+ 1: Top
767
+ 2: Right
768
+
769
+ Have a look at the example file <b>libui_paradise/examples/simple/007_control_gallery.rb</b>
770
+ to see how this could be used.
771
+
749
772
  ## LibUI::FFI::DrawTextLayoutParams.malloc
750
773
 
751
774
  LibUI::FFI::DrawTextLayoutParams.malloc can be used to draw
@@ -1439,6 +1462,15 @@ Use the following API for this:
1439
1462
 
1440
1463
  image = LibUI.new_image(width, height)
1441
1464
 
1465
+ You can use external libraries to determine the width
1466
+ and height of an image, such as ChunkyPNG.
1467
+
1468
+ Example for this:
1469
+
1470
+ canvas = ChunkyPNG::Canvas.from_io(this_file)
1471
+ width = canvas.width
1472
+ height = canvas.height
1473
+
1442
1474
  ## Horizontal boxes
1443
1475
 
1444
1476
  A HBox represents a horizontal box. The API for putting
data/doc/SNIPPETS.md CHANGED
@@ -26,19 +26,6 @@
26
26
  UI.control_show(main_window)
27
27
  main_window.show_the_controls # Or use this one here.
28
28
 
29
- # How to set a padded box:
30
-
31
- UI.box_set_padded(box, 1) # The value is either 0 or 1.
32
-
33
- Alignment may be:
34
- 0: Fill
35
- 1: Start
36
- 2: Center
37
- 3: End
38
- Positioning:
39
- 0: Left
40
- 1: Top
41
- 2: Right
42
29
 
43
30
  # Add a checkbox (checkbox tag, checkbutton)
44
31
 
@@ -113,6 +113,16 @@ class Base # === LibuiParadise::Base
113
113
  # ======================================================================= #
114
114
  outer_vbox.add_hsep
115
115
  i.flatten.each {|this_widget|
116
+ # ===================================================================== #
117
+ # Some symbols exist as special keywords:
118
+ # ===================================================================== #
119
+ case this_widget
120
+ # ===================================================================== #
121
+ # === :create_a_quit_button
122
+ # ===================================================================== #
123
+ when :create_a_quit_button
124
+ this_widget = quit_button
125
+ end
116
126
  outer_vbox.minimal(this_widget)
117
127
  }
118
128
  @window.add(outer_vbox)
@@ -28,24 +28,26 @@ main_window.child = hbox
28
28
  # =========================================================================== #
29
29
  IMAGES = []
30
30
 
31
- N_TIMES.times do |i|
31
+ N_TIMES.times { |i|
32
32
  url = format(REMOTE_URL, (i + 1))
33
33
  this_file = URI.open(url)
34
+ # =========================================================================== #
34
35
  # Use ChunkyPNG::Canvas to get information about the image at hand.
36
+ # =========================================================================== #
35
37
  canvas = ChunkyPNG::Canvas.from_io(this_file)
36
38
  this_file.close
37
39
  data = canvas.to_rgba_stream
38
40
  width = canvas.width
39
41
  height = canvas.height
40
42
  # ========================================================================= #
41
- # Add a new image here:
43
+ # Add a new image next:
42
44
  # ========================================================================= #
43
45
  image = UI.new_image(width, height)
44
46
  UI.image_append(image, data, width, height, width * 4)
45
47
  IMAGES << image # Store all images in the following area.
46
48
  rescue StandardError => error
47
49
  warn url, error.message
48
- end
50
+ }
49
51
 
50
52
  # =========================================================================== #
51
53
  # Protects BlockCaller objects from garbage collection.
@@ -61,18 +63,18 @@ def rbcallback(*args, &block)
61
63
  blockcaller
62
64
  end
63
65
 
64
- model_handler = UI::FFI::TableModelHandler.malloc
66
+ model_handler = LibUI::FFI::TableModelHandler.malloc
65
67
  model_handler.NumColumns = rbcallback(4) { 1 }
66
68
  model_handler.ColumnType = rbcallback(4) { 1 } # Image
67
69
  model_handler.NumRows = rbcallback(4) { IMAGES.size }
68
70
  model_handler.CellValue = rbcallback(1, [1, 1, 4, 4]) do |_, _, row, _column|
69
- UI.new_table_value_image(IMAGES[row])
71
+ LibUI.new_table_value_image(IMAGES[row])
70
72
  end
71
73
  model_handler.SetCellValue = rbcallback(0, [0]) {}
72
74
 
73
- model = UI.new_table_model(model_handler)
75
+ model = LibUI.new_table_model(model_handler)
74
76
 
75
- table_params = UI::FFI::TableParams.malloc
77
+ table_params = LibUI::FFI::TableParams.malloc
76
78
  table_params.Model = model
77
79
  table_params.RowBackgroundColorModelColumn = -1
78
80
 
@@ -7,11 +7,11 @@ module LibuiParadise
7
7
  # ========================================================================= #
8
8
  # === VERSION
9
9
  # ========================================================================= #
10
- VERSION = '0.2.47'
10
+ VERSION = '0.2.48'
11
11
 
12
12
  # ========================================================================= #
13
13
  # === LAST_UPDATE
14
14
  # ========================================================================= #
15
- LAST_UPDATE = '04.09.2022'
15
+ LAST_UPDATE = '09.09.2022'
16
16
 
17
17
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: libui_paradise
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.47
4
+ version: 0.2.48
5
5
  platform: ruby
6
6
  authors:
7
7
  - Robert A. Heiler
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-09-04 00:00:00.000000000 Z
11
+ date: 2022-09-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: libui
@@ -139,9 +139,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
139
139
  requirements:
140
140
  - - ">="
141
141
  - !ruby/object:Gem::Version
142
- version: 3.3.20
142
+ version: 3.3.22
143
143
  requirements: []
144
- rubygems_version: 3.3.20
144
+ rubygems_version: 3.3.22
145
145
  signing_key:
146
146
  specification_version: 4
147
147
  summary: 'This project bundles together some custom bindings and code to the official