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.
Files changed (87) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +405 -259
  3. data/bin/libui_message +7 -0
  4. data/doc/README.gen +356 -131
  5. data/doc/todo/todo.md +14 -5
  6. data/lib/libui_paradise/autoinclude.rb +2 -1
  7. data/lib/libui_paradise/base/base.rb +51 -62
  8. data/lib/libui_paradise/base_module/base_module.rb +1514 -0
  9. data/lib/libui_paradise/colours/colours.rb +14 -2
  10. data/lib/libui_paradise/domain_specific_language/README.md +6 -0
  11. data/lib/libui_paradise/examples/complex/002_tabs_example.rb +1 -2
  12. data/lib/libui_paradise/examples/complex/003_open_file_button_example.rb +3 -5
  13. data/lib/libui_paradise/examples/complex/006_coloured_boxes_example.rb +2 -2
  14. data/lib/libui_paradise/examples/complex/007_slider_example.rb +10 -4
  15. data/lib/libui_paradise/examples/complex/008_radio_button_example.rb +2 -2
  16. data/lib/libui_paradise/examples/complex/009_separator_example.rb +2 -2
  17. data/lib/libui_paradise/examples/complex/010_table_example.rb +139 -49
  18. data/lib/libui_paradise/examples/complex/011_two_buttons_showing_how_to_enable_and_disable_them.rb +2 -1
  19. data/lib/libui_paradise/examples/complex/012_password_entry_example.rb +1 -1
  20. data/lib/libui_paradise/examples/complex/013_form_example.rb +1 -1
  21. data/lib/libui_paradise/examples/complex/014_text_example.rb +1 -1
  22. data/lib/libui_paradise/examples/complex/015_text_view_example.rb +4 -4
  23. data/lib/libui_paradise/examples/complex/016_grid_example.rb +20 -11
  24. data/lib/libui_paradise/examples/complex/017_unicode_text_example.rb +2 -2
  25. data/lib/libui_paradise/examples/complex/018_spinbutton_example.rb +1 -1
  26. data/lib/libui_paradise/examples/complex/019_combo_box_example.rb +1 -1
  27. data/lib/libui_paradise/examples/complex/020_checkbox_example.rb +5 -5
  28. data/lib/libui_paradise/examples/complex/021_font_example.rb +4 -3
  29. data/lib/libui_paradise/examples/complex/022_simple_notepad_example.rb +3 -3
  30. data/lib/libui_paradise/examples/complex/023_msg_box_error.rb +5 -5
  31. data/lib/libui_paradise/examples/complex/024_parse_config_file_example.rb +2 -2
  32. data/lib/libui_paradise/examples/complex/025_colour_button.rb +1 -1
  33. data/lib/libui_paradise/examples/complex/026_basic_table_image.rb +5 -8
  34. data/lib/libui_paradise/examples/complex/027_basic_button_example.rb +3 -3
  35. data/lib/libui_paradise/examples/complex/028_try_for_automatic_button_press_event_after_a_delay.rb +4 -5
  36. data/lib/libui_paradise/examples/complex/029_progressbar_example.rb +4 -5
  37. data/lib/libui_paradise/examples/complex/030_entry_responds_to_comment_as_synonymous_to_the_enter_key_pressed_example.rb +5 -6
  38. data/lib/libui_paradise/examples/complex/031_notification_functionality_example.rb +3 -2
  39. data/lib/libui_paradise/examples/complex/032_simple_window_example.rb +2 -1
  40. data/lib/libui_paradise/examples/complex/033_daemonize_and_exit_after_delay_example.rb +3 -2
  41. data/lib/libui_paradise/examples/complex/034_bold_text_example.rb +115 -0
  42. data/lib/libui_paradise/examples/complex/035_parse_into_table_example.rb +109 -0
  43. data/lib/libui_paradise/examples/simple/001_open_file_example.rb +1 -1
  44. data/lib/libui_paradise/examples/simple/002_histogram_example.rb +6 -6
  45. data/lib/libui_paradise/examples/simple/003_fancy_text_example.rb +80 -43
  46. data/lib/libui_paradise/examples/simple/005_text_drawing_example.rb +11 -11
  47. data/lib/libui_paradise/examples/simple/007_control_gallery.rb +21 -14
  48. data/lib/libui_paradise/examples/simple/009_spectrum.rb +7 -1
  49. data/lib/libui_paradise/examples/simple/010_font_button.rb +31 -0
  50. data/lib/libui_paradise/examples/simple/011_simple_notepad.rb +24 -0
  51. data/lib/libui_paradise/examples/simple/012_table_example.rb +71 -0
  52. data/lib/libui_paradise/examples/simple/013_scrolling_pane_example.rb +28 -0
  53. data/lib/libui_paradise/examples/simple/014_simple_entry_example.rb +30 -0
  54. data/lib/libui_paradise/examples/simple/015_slider_example.rb +32 -0
  55. data/lib/libui_paradise/fiddle/{pointer.rb → fiddle.rb} +768 -615
  56. data/lib/libui_paradise/generic_window/generic_window.rb +1 -1
  57. data/lib/libui_paradise/images/README.md +5 -2
  58. data/lib/libui_paradise/libui_classes/button.rb +31 -0
  59. data/lib/libui_paradise/libui_classes/entry.rb +35 -0
  60. data/lib/libui_paradise/libui_classes/grid.rb +14 -23
  61. data/lib/libui_paradise/libui_classes/hbox.rb +39 -0
  62. data/lib/libui_paradise/libui_classes/libui_classes.rb +9 -1595
  63. data/lib/libui_paradise/libui_classes/msg_box.rb +121 -0
  64. data/lib/libui_paradise/libui_classes/msg_box_error.rb +41 -0
  65. data/lib/libui_paradise/libui_classes/slider.rb +28 -0
  66. data/lib/libui_paradise/libui_classes/spinbox.rb +48 -0
  67. data/lib/libui_paradise/libui_classes/vbox.rb +38 -0
  68. data/lib/libui_paradise/project/project.rb +6 -1
  69. data/lib/libui_paradise/prototype/prototype.rb +8 -10
  70. data/lib/libui_paradise/requires/require_the_libui_classes.rb +2 -2
  71. data/lib/libui_paradise/requires/require_the_libui_paradise_project.rb +5 -3
  72. data/lib/libui_paradise/toplevel_methods/add_to_the_registered_widgets.rb +70 -0
  73. data/lib/libui_paradise/toplevel_methods/hash_fiddle_pointer_widgets.rb +37 -0
  74. data/lib/libui_paradise/toplevel_methods/toplevel_counters.rb +83 -0
  75. data/lib/libui_paradise/toplevel_methods/toplevel_methods.rb +792 -0
  76. data/lib/libui_paradise/version/version.rb +2 -2
  77. data/lib/libui_paradise.rb +0 -0
  78. data/libui_paradise.gemspec +5 -4
  79. data/test/testing_generic_window.rb +2 -0
  80. metadata +35 -30
  81. data/doc/SNIPPETS.md +0 -94
  82. data/lib/libui_paradise/extensions/counters.rb +0 -58
  83. data/lib/libui_paradise/extensions/extensions.rb +0 -29
  84. data/lib/libui_paradise/extensions/hash_fiddle_pointer_widgets.rb +0 -150
  85. data/lib/libui_paradise/extensions/misc.rb +0 -754
  86. data/lib/libui_paradise/libui_classes/box.rb +0 -156
  87. data/lib/libui_paradise/toplevel_methods/misc.rb +0 -13
data/doc/todo/todo.md CHANGED
@@ -1,16 +1,25 @@
1
+ ------------------------------------------------------------------------------------
1
2
  - Make sure that each component has a screenshot. It's ok to
2
3
  re-use existing screenshots from other projects.
4
+ Perhaps also look at the examples again to show how this
5
+ can be used.
3
6
 
4
- - Make sure the project is API compatible to glimmer-libui.
5
-
7
+ What is missing still?
8
+
9
+
10
+ ------------------------------------------------------------------------------------
6
11
  - Rewrite the project from the get-go. Also integrate
7
12
  @main_window into the main hash, rather than have it
8
13
  standalone. ^^^ this should be fixed ASAP - it is not
9
14
  elegant to have a separate @main_window ... but for
10
15
  now we'll keep it as-is.
11
-
16
+ As we rewrite it, improve the documentation.
17
+ ------------------------------------------------------------------------------------
18
+ - Make sure the project is API compatible to glimmer-libui.
19
+ ------------------------------------------------------------------------------------
12
20
  - Re-organize the examples, perhaps starting with another
13
21
  one.
14
-
22
+ ------------------------------------------------------------------------------------
15
23
  - Check for image and font support again. Something isn't
16
- working!
24
+ working there!
25
+ ------------------------------------------------------------------------------------
@@ -6,4 +6,5 @@
6
6
  # =========================================================================== #
7
7
  require 'libui_paradise/requires/require_the_libui_paradise_project.rb'
8
8
 
9
- include LibuiParadise::Extensions
9
+ include LibuiParadise::BaseModule
10
+ ::LibUI.init
@@ -3,6 +3,11 @@
3
3
  # frozen_string_literal: true
4
4
  # =========================================================================== #
5
5
  # === LibuiParadise::Base
6
+ #
7
+ # Usage example:
8
+ #
9
+ # LibuiParadise::Base.new(ARGV)
10
+ #
6
11
  # =========================================================================== #
7
12
  # require 'libui_paradise/base/base.rb'
8
13
  # < LibuiParadise::Base
@@ -11,10 +16,10 @@ module LibuiParadise
11
16
 
12
17
  class Base # === LibuiParadise::Base
13
18
 
14
- alias e puts
19
+ require 'libui_paradise/base_module/base_module.rb'
20
+ include ::LibuiParadise::BaseModule
15
21
 
16
- require 'libui_paradise'
17
- include LibuiParadise::Extensions
22
+ ::LibUI.init
18
23
 
19
24
  # ========================================================================= #
20
25
  # === TITLE
@@ -22,14 +27,17 @@ class Base # === LibuiParadise::Base
22
27
  TITLE = 'Generic Title'
23
28
 
24
29
  # ========================================================================= #
25
- # === WIDTH
26
- # ========================================================================= #
27
- WIDTH = 800
28
-
29
- # ========================================================================= #
30
- # === HEIGHT
30
+ # === reset (reset tag)
31
31
  # ========================================================================= #
32
- HEIGHT = 640
32
+ def reset
33
+ title_width_height(TITLE, WIDTH, HEIGHT)
34
+ # ======================================================================= #
35
+ # === @window
36
+ # ======================================================================= #
37
+ set_window(
38
+ return_default_window
39
+ )
40
+ end
33
41
 
34
42
  # ========================================================================= #
35
43
  # === default_title_width_height
@@ -46,54 +54,6 @@ class Base # === LibuiParadise::Base
46
54
  )
47
55
  end
48
56
 
49
- # ========================================================================= #
50
- # === reset (reset tag)
51
- # ========================================================================= #
52
- def reset
53
- title_width_height(TITLE, WIDTH, HEIGHT)
54
- # ======================================================================= #
55
- # === @window
56
- # ======================================================================= #
57
- set_window(
58
- return_default_window
59
- )
60
- end
61
-
62
- # ======================================================================= #
63
- # === update_the_main_window
64
- # ======================================================================= #
65
- def update_the_main_window
66
- set_window(
67
- return_default_window
68
- )
69
- end
70
-
71
- # ======================================================================= #
72
- # === return_default_window
73
- # ======================================================================= #
74
- def return_default_window(
75
- title = title?,
76
- width = width?,
77
- height = height?
78
- )
79
- return ui_padded_main_window(title, width, height, 0)
80
- end
81
-
82
- # ======================================================================= #
83
- # === set_window
84
- #
85
- # Simply assign to @window here.
86
- # ======================================================================= #
87
- def set_window(i = return_default_window)
88
- @window = i
89
- end
90
-
91
- # ========================================================================= #
92
- # === create_skeleton (create tag, skeleton tag)
93
- # ========================================================================= #
94
- def create_skeleton
95
- end
96
-
97
57
  # ========================================================================= #
98
58
  # === add_these_widgets_to_the_main_window
99
59
  #
@@ -125,7 +85,10 @@ class Base # === LibuiParadise::Base
125
85
  end
126
86
  outer_vbox.minimal(this_widget)
127
87
  }
128
- @window.add(outer_vbox)
88
+ # ======================================================================= #
89
+ # Next add them to the main-window:
90
+ # ======================================================================= #
91
+ window?.add(outer_vbox)
129
92
  if i.size > 0
130
93
  Thread.new {
131
94
  sleep 5
@@ -134,9 +97,18 @@ class Base # === LibuiParadise::Base
134
97
  exit
135
98
  }
136
99
  end
137
- @window.intelligent_exit
100
+ window?.intelligent_exit
138
101
  end; alias add_these_widgets add_these_widgets_to_the_main_window # === add_these_widgets
139
102
 
103
+ # ======================================================================= #
104
+ # === update_the_main_window
105
+ # ======================================================================= #
106
+ def update_the_main_window
107
+ set_window(
108
+ return_default_window
109
+ )
110
+ end
111
+
140
112
  # ========================================================================= #
141
113
  # === run_in_the_background
142
114
  # ========================================================================= #
@@ -145,10 +117,27 @@ class Base # === LibuiParadise::Base
145
117
  end
146
118
 
147
119
  # ========================================================================= #
148
- # === run
120
+ # === run (run tag)
149
121
  # ========================================================================= #
150
122
  def run
151
123
  create_skeleton_then_connect_skeleton
152
124
  end
153
125
 
154
- end; end
126
+ # ========================================================================= #
127
+ # === create_the_skeleton (create tag, skeleton tag)
128
+ # ========================================================================= #
129
+ def create_the_skeleton
130
+ end; alias create_skeleton create_the_skeleton # === create_skeleton
131
+
132
+ # ========================================================================= #
133
+ # === LibuiParadise::Base[]
134
+ # ========================================================================= #
135
+ def self.[](i = ARGV)
136
+ new(i)
137
+ end
138
+
139
+ end; end
140
+
141
+ if __FILE__ == $PROGRAM_NAME
142
+ LibuiParadise::Base.new(ARGV)
143
+ end # base.rb