libui_paradise 0.2.49 → 0.4.13
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +405 -259
- data/bin/libui_message +7 -0
- data/doc/README.gen +356 -131
- data/doc/todo/todo.md +14 -5
- data/lib/libui_paradise/autoinclude.rb +2 -1
- data/lib/libui_paradise/base/base.rb +51 -62
- data/lib/libui_paradise/base_module/base_module.rb +1514 -0
- data/lib/libui_paradise/colours/colours.rb +14 -2
- data/lib/libui_paradise/domain_specific_language/README.md +6 -0
- data/lib/libui_paradise/examples/complex/002_tabs_example.rb +1 -2
- data/lib/libui_paradise/examples/complex/003_open_file_button_example.rb +3 -5
- data/lib/libui_paradise/examples/complex/006_coloured_boxes_example.rb +2 -2
- data/lib/libui_paradise/examples/complex/007_slider_example.rb +10 -4
- data/lib/libui_paradise/examples/complex/008_radio_button_example.rb +2 -2
- data/lib/libui_paradise/examples/complex/009_separator_example.rb +2 -2
- data/lib/libui_paradise/examples/complex/010_table_example.rb +139 -49
- data/lib/libui_paradise/examples/complex/011_two_buttons_showing_how_to_enable_and_disable_them.rb +2 -1
- data/lib/libui_paradise/examples/complex/012_password_entry_example.rb +1 -1
- data/lib/libui_paradise/examples/complex/013_form_example.rb +1 -1
- data/lib/libui_paradise/examples/complex/014_text_example.rb +1 -1
- data/lib/libui_paradise/examples/complex/015_text_view_example.rb +4 -4
- data/lib/libui_paradise/examples/complex/016_grid_example.rb +20 -11
- data/lib/libui_paradise/examples/complex/017_unicode_text_example.rb +2 -2
- data/lib/libui_paradise/examples/complex/018_spinbutton_example.rb +1 -1
- data/lib/libui_paradise/examples/complex/019_combo_box_example.rb +1 -1
- data/lib/libui_paradise/examples/complex/020_checkbox_example.rb +5 -5
- data/lib/libui_paradise/examples/complex/021_font_example.rb +4 -3
- data/lib/libui_paradise/examples/complex/022_simple_notepad_example.rb +3 -3
- data/lib/libui_paradise/examples/complex/023_msg_box_error.rb +5 -5
- data/lib/libui_paradise/examples/complex/024_parse_config_file_example.rb +2 -2
- data/lib/libui_paradise/examples/complex/025_colour_button.rb +1 -1
- data/lib/libui_paradise/examples/complex/026_basic_table_image.rb +5 -8
- data/lib/libui_paradise/examples/complex/027_basic_button_example.rb +3 -3
- data/lib/libui_paradise/examples/complex/028_try_for_automatic_button_press_event_after_a_delay.rb +4 -5
- data/lib/libui_paradise/examples/complex/029_progressbar_example.rb +4 -5
- data/lib/libui_paradise/examples/complex/030_entry_responds_to_comment_as_synonymous_to_the_enter_key_pressed_example.rb +5 -6
- data/lib/libui_paradise/examples/complex/031_notification_functionality_example.rb +3 -2
- data/lib/libui_paradise/examples/complex/032_simple_window_example.rb +2 -1
- data/lib/libui_paradise/examples/complex/033_daemonize_and_exit_after_delay_example.rb +3 -2
- data/lib/libui_paradise/examples/complex/034_bold_text_example.rb +115 -0
- data/lib/libui_paradise/examples/complex/035_parse_into_table_example.rb +109 -0
- data/lib/libui_paradise/examples/simple/001_open_file_example.rb +1 -1
- data/lib/libui_paradise/examples/simple/002_histogram_example.rb +6 -6
- data/lib/libui_paradise/examples/simple/003_fancy_text_example.rb +80 -43
- data/lib/libui_paradise/examples/simple/005_text_drawing_example.rb +11 -11
- data/lib/libui_paradise/examples/simple/007_control_gallery.rb +21 -14
- data/lib/libui_paradise/examples/simple/009_spectrum.rb +7 -1
- data/lib/libui_paradise/examples/simple/010_font_button.rb +31 -0
- data/lib/libui_paradise/examples/simple/011_simple_notepad.rb +24 -0
- data/lib/libui_paradise/examples/simple/012_table_example.rb +71 -0
- data/lib/libui_paradise/examples/simple/013_scrolling_pane_example.rb +28 -0
- data/lib/libui_paradise/examples/simple/014_simple_entry_example.rb +30 -0
- data/lib/libui_paradise/examples/simple/015_slider_example.rb +32 -0
- data/lib/libui_paradise/fiddle/{pointer.rb → fiddle.rb} +768 -615
- data/lib/libui_paradise/generic_window/generic_window.rb +1 -1
- data/lib/libui_paradise/images/README.md +5 -2
- data/lib/libui_paradise/libui_classes/button.rb +31 -0
- data/lib/libui_paradise/libui_classes/entry.rb +35 -0
- data/lib/libui_paradise/libui_classes/grid.rb +14 -23
- data/lib/libui_paradise/libui_classes/hbox.rb +39 -0
- data/lib/libui_paradise/libui_classes/libui_classes.rb +9 -1595
- data/lib/libui_paradise/libui_classes/msg_box.rb +121 -0
- data/lib/libui_paradise/libui_classes/msg_box_error.rb +41 -0
- data/lib/libui_paradise/libui_classes/slider.rb +28 -0
- data/lib/libui_paradise/libui_classes/spinbox.rb +48 -0
- data/lib/libui_paradise/libui_classes/vbox.rb +38 -0
- data/lib/libui_paradise/project/project.rb +6 -1
- data/lib/libui_paradise/prototype/prototype.rb +8 -10
- data/lib/libui_paradise/requires/require_the_libui_classes.rb +2 -2
- data/lib/libui_paradise/requires/require_the_libui_paradise_project.rb +5 -3
- data/lib/libui_paradise/toplevel_methods/add_to_the_registered_widgets.rb +70 -0
- data/lib/libui_paradise/toplevel_methods/hash_fiddle_pointer_widgets.rb +37 -0
- data/lib/libui_paradise/toplevel_methods/toplevel_counters.rb +83 -0
- data/lib/libui_paradise/toplevel_methods/toplevel_methods.rb +792 -0
- data/lib/libui_paradise/version/version.rb +2 -2
- data/lib/libui_paradise.rb +0 -0
- data/libui_paradise.gemspec +5 -4
- data/test/testing_generic_window.rb +2 -0
- metadata +35 -30
- data/doc/SNIPPETS.md +0 -94
- data/lib/libui_paradise/extensions/counters.rb +0 -58
- data/lib/libui_paradise/extensions/extensions.rb +0 -29
- data/lib/libui_paradise/extensions/hash_fiddle_pointer_widgets.rb +0 -150
- data/lib/libui_paradise/extensions/misc.rb +0 -754
- data/lib/libui_paradise/libui_classes/box.rb +0 -156
- data/lib/libui_paradise/toplevel_methods/misc.rb +0 -13
@@ -1,2 +1,5 @@
|
|
1
|
-
This directory
|
2
|
-
|
1
|
+
This directory contains the libui_paradise logo that was created on
|
2
|
+
27.08.2021 via cfdg, gimp, kolourpaint and pngquant.
|
3
|
+
|
4
|
+
Additional images may also be stored here, in regards to documentation
|
5
|
+
for the libui_paradise gem.
|
@@ -0,0 +1,31 @@
|
|
1
|
+
#!/usr/bin/ruby -w
|
2
|
+
# Encoding: UTF-8
|
3
|
+
# frozen_string_literal: true
|
4
|
+
# =========================================================================== #
|
5
|
+
# require 'libui_paradise/libui_classes/button.rb'
|
6
|
+
# =========================================================================== #
|
7
|
+
module LibuiParadise
|
8
|
+
|
9
|
+
require 'libui_paradise/toplevel_methods/add_to_the_registered_widgets.rb'
|
10
|
+
|
11
|
+
# ========================================================================= #
|
12
|
+
# === LibuiParadise.button (button tag)
|
13
|
+
#
|
14
|
+
# The upstream API for buttons, in C, can be found here at the
|
15
|
+
# following github repository for libui-ng:
|
16
|
+
#
|
17
|
+
# https://github.com/libui-ng/libui-ng/blob/master/unix/button.c
|
18
|
+
#
|
19
|
+
# ========================================================================= #
|
20
|
+
def self.button(text)
|
21
|
+
text = text.to_s.dup.strip
|
22
|
+
if text.start_with? '_'
|
23
|
+
text[0,1] = '' # Right now we do not support accelerators.
|
24
|
+
end
|
25
|
+
_ = ::LibUI.new_button(text) # Create the button here, by delegating towards LibUI.
|
26
|
+
register_this_fiddle_pointer_widget(_, __method__)
|
27
|
+
return _ # Last but not least, always return the button.
|
28
|
+
end; self.instance_eval { alias ui_button button } # === LibuiParadise.ui_button
|
29
|
+
self.instance_eval { alias create_button button } # === LibuiParadise.create_button
|
30
|
+
|
31
|
+
end
|
@@ -0,0 +1,35 @@
|
|
1
|
+
#!/usr/bin/ruby -w
|
2
|
+
# Encoding: UTF-8
|
3
|
+
# frozen_string_literal: true
|
4
|
+
# =========================================================================== #
|
5
|
+
# require 'libui_paradise/libui_classes/entry.rb'
|
6
|
+
# =========================================================================== #
|
7
|
+
module LibuiParadise
|
8
|
+
|
9
|
+
# ========================================================================= #
|
10
|
+
# === LibuiParadise.entry (entry tag)
|
11
|
+
#
|
12
|
+
# The upstream C API for libui-entry can be found here:
|
13
|
+
#
|
14
|
+
# https://github.com/andlabs/libui/blob/master/unix/entry.c
|
15
|
+
#
|
16
|
+
# This method is tapping into LibUI.new_entry.
|
17
|
+
#
|
18
|
+
# Usage example:
|
19
|
+
#
|
20
|
+
# entry1 = LibUI.entry('ATG')
|
21
|
+
#
|
22
|
+
# ========================================================================= #
|
23
|
+
def self.entry(
|
24
|
+
optional_text = ''
|
25
|
+
)
|
26
|
+
optional_text = optional_text.to_s
|
27
|
+
entry = ::LibUI.new_entry # Create the new entry here.
|
28
|
+
unless optional_text.empty?
|
29
|
+
::LibUI.entry_set_text(entry, optional_text)
|
30
|
+
end
|
31
|
+
add_to_the_registered_widgets(entry, __method__)
|
32
|
+
return entry
|
33
|
+
end; self.instance_eval { alias ui_entry entry } # === LibuiParadise.ui_entry
|
34
|
+
|
35
|
+
end
|
@@ -2,14 +2,17 @@
|
|
2
2
|
# Encoding: UTF-8
|
3
3
|
# frozen_string_literal: true
|
4
4
|
# =========================================================================== #
|
5
|
-
# require 'libui_paradise/libui_classes/grid.rb
|
5
|
+
# require 'libui_paradise/libui_classes/grid.rb'
|
6
6
|
# =========================================================================== #
|
7
7
|
module LibuiParadise
|
8
8
|
|
9
|
-
|
9
|
+
require 'libui_paradise/toplevel_methods/toplevel_counters.rb'
|
10
10
|
|
11
11
|
# ========================================================================= #
|
12
|
-
# === LibuiParadise
|
12
|
+
# === LibuiParadise.grid (grid tag)
|
13
|
+
#
|
14
|
+
# This method will create a new grid, via LibUI.new_grid(), and then
|
15
|
+
# return this widget object.
|
13
16
|
#
|
14
17
|
# To insert into a grid, try to use this API:
|
15
18
|
#
|
@@ -30,26 +33,14 @@ module Extensions # === LibuiParadise::Extensions
|
|
30
33
|
#
|
31
34
|
# ========================================================================= #
|
32
35
|
def self.grid
|
33
|
-
_ = ::LibUI.new_grid
|
36
|
+
_ = ::LibUI.new_grid # Create the grid here.
|
37
|
+
# ======================================================================= #
|
38
|
+
# Register it at once:
|
39
|
+
# ======================================================================= #
|
34
40
|
add_to_the_registered_widgets(_, __method__)
|
35
41
|
return _
|
36
|
-
end; self.instance_eval { alias ui_grid
|
37
|
-
|
38
|
-
|
39
|
-
# === grid
|
40
|
-
# ========================================================================= #
|
41
|
-
def grid
|
42
|
-
::LibuiParadise::Extensions.grid
|
43
|
-
end; alias ui_grid grid # === ui_grid
|
44
|
-
|
45
|
-
# ========================================================================= #
|
46
|
-
# === ui_padded_grid
|
47
|
-
# ========================================================================= #
|
48
|
-
def ui_padded_grid
|
49
|
-
_ = ui_grid # This is defined in the method above ^^^ this method.
|
50
|
-
_.is_padded
|
51
|
-
return _
|
52
|
-
end; alias padded_grid ui_padded_grid # === padded_grid
|
53
|
-
alias default_grid ui_padded_grid # === default_grid
|
42
|
+
end; self.instance_eval { alias ui_grid grid } # === LibuiParadise.ui_grid
|
43
|
+
self.instance_eval { alias create_grid grid } # === LibuiParadise.create_grid
|
44
|
+
self.instance_eval { alias create_default_grid create_grid } # === LibuiParadise.create_default_grid
|
54
45
|
|
55
|
-
end
|
46
|
+
end
|
@@ -0,0 +1,39 @@
|
|
1
|
+
#!/usr/bin/ruby -w
|
2
|
+
# Encoding: UTF-8
|
3
|
+
# frozen_string_literal: true
|
4
|
+
# =========================================================================== #
|
5
|
+
# require 'libui_paradise/libui_classes/hbox.rb'
|
6
|
+
# =========================================================================== #
|
7
|
+
module LibuiParadise
|
8
|
+
|
9
|
+
# ========================================================================= #
|
10
|
+
# === LibuiParadise.hbox (hbox tag)
|
11
|
+
#
|
12
|
+
# This toplevel-method can be used to create a horizontal box.
|
13
|
+
# ========================================================================= #
|
14
|
+
def self.hbox(*optional_widgets)
|
15
|
+
_ = ::LibUI.new_horizontal_box
|
16
|
+
add_to_the_registered_widgets(_, __method__)
|
17
|
+
optional_widgets.flatten!
|
18
|
+
if optional_widgets and !optional_widgets.empty?
|
19
|
+
optional_widgets.flatten.each {|this_widget| _ << this_widget }
|
20
|
+
end
|
21
|
+
return _
|
22
|
+
end; self.instance_eval { alias horizontal_box hbox } # === LibuiParadise.horizontal_box
|
23
|
+
self.instance_eval { alias ui_hbox hbox } # === LibuiParadise.ui_hbox
|
24
|
+
self.instance_eval { alias create_hbox hbox } # === LibuiParadise.create_hbox
|
25
|
+
|
26
|
+
# ========================================================================= #
|
27
|
+
# === LibuiParadise.ui_padded_hbox
|
28
|
+
#
|
29
|
+
# This method will call .is_padded on the hbox after it has been
|
30
|
+
# initialized.
|
31
|
+
# ========================================================================= #
|
32
|
+
def self.ui_padded_hbox(*optional_widgets)
|
33
|
+
_ = ::LibUI.ui_hbox(optional_widgets)
|
34
|
+
_.is_padded
|
35
|
+
return _
|
36
|
+
end; self.instance_eval { alias padded_hbox ui_padded_hbox } # === LibuiParadise.padded_hbox
|
37
|
+
self.instance_eval { alias libui_padded_hbox ui_padded_hbox } # === LibuiParadise.libui_padded_hbox
|
38
|
+
|
39
|
+
end
|