glimmer-dsl-swt 4.18.7.3 → 4.19.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (47) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +44 -0
  3. data/README.md +126 -20
  4. data/RUBY_VERSION +1 -1
  5. data/VERSION +1 -1
  6. data/bin/girb +10 -9
  7. data/bin/girb_runner.rb +8 -3
  8. data/bin/glimmer +10 -1
  9. data/bin/glimmer-setup +58 -0
  10. data/bin/glimmer_runner.rb +4 -0
  11. data/docs/reference/GLIMMER_COMMAND.md +98 -32
  12. data/docs/reference/GLIMMER_GUI_DSL_SYNTAX.md +9 -7
  13. data/docs/reference/GLIMMER_PACKAGING_AND_DISTRIBUTION.md +7 -1
  14. data/docs/reference/GLIMMER_SAMPLES.md +25 -0
  15. data/glimmer-dsl-swt.gemspec +0 -0
  16. data/lib/glimmer-dsl-swt.rb +8 -0
  17. data/lib/glimmer/data_binding/widget_binding.rb +1 -1
  18. data/lib/glimmer/dsl/swt/c_tab_item_expression.rb +58 -0
  19. data/lib/glimmer/dsl/swt/combo_selection_data_binding_expression.rb +2 -1
  20. data/lib/glimmer/dsl/swt/tab_item_expression.rb +7 -3
  21. data/lib/glimmer/dsl/swt/widget_expression.rb +1 -1
  22. data/lib/glimmer/launcher.rb +27 -51
  23. data/lib/glimmer/rake_task.rb +37 -7
  24. data/lib/glimmer/rake_task/list.rb +8 -0
  25. data/lib/glimmer/rake_task/package.rb +7 -2
  26. data/lib/glimmer/rake_task/scaffold.rb +283 -207
  27. data/lib/glimmer/swt/c_tab_item_proxy.rb +53 -0
  28. data/lib/glimmer/swt/custom/code_text.rb +19 -3
  29. data/lib/glimmer/swt/custom/shape.rb +22 -4
  30. data/lib/glimmer/swt/image_proxy.rb +5 -1
  31. data/lib/glimmer/swt/sash_form_proxy.rb +6 -0
  32. data/lib/glimmer/swt/shell_proxy.rb +3 -1
  33. data/lib/glimmer/swt/tab_folder_proxy.rb +1 -0
  34. data/lib/glimmer/swt/tab_item_proxy.rb +17 -18
  35. data/lib/glimmer/swt/widget_proxy.rb +9 -0
  36. data/samples/elaborate/mandelbrot_fractal.rb +1 -1
  37. data/samples/elaborate/tetris.rb +1 -4
  38. data/samples/elaborate/tetris/view/bevel.rb +4 -1
  39. data/samples/elaborate/tetris/view/block.rb +1 -3
  40. data/samples/hello/hello_c_combo.rb +68 -0
  41. data/samples/hello/hello_c_tab.rb +271 -0
  42. data/samples/hello/hello_code_text.rb +141 -73
  43. data/samples/hello/hello_tab.rb +2 -0
  44. data/vendor/swt/linux/swt.jar +0 -0
  45. data/vendor/swt/mac/swt.jar +0 -0
  46. data/vendor/swt/windows/swt.jar +0 -0
  47. metadata +45 -15
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 98ad3496a7f7eec9bebe867be21b6fefd3764baf67b8336a2177086826fc6e0c
4
- data.tar.gz: 6093daa8c240d0e02f43078590f84eb77c9cdba070c2c8ba5c7e665fb4455338
3
+ metadata.gz: 2a6d3f8e7bb2a7212ba94580c1293d23205f7eba98da2dacc2be280546f8a048
4
+ data.tar.gz: 56e3d8a75782146d32d3c59eecbb1528d53879c41ac5754dd3afe95809f9a566
5
5
  SHA512:
6
- metadata.gz: 43d3ffa17ae9ad9fae4f867d483439116d0e08055614f83c2ef59f87a38268472ace3821ee6b2521588d02fda8da6a6f009ff9ea93085dc60170835cb6aa4aff
7
- data.tar.gz: 0f4bb8712916ddb9ee5cd25ded0bdce6b5fc008f2ab23a53ccac07f19eac556daf4eb3594944e91c3a47efd3df3794012abd572fb6ea17ed74357622a67a5253
6
+ metadata.gz: e3ec40fd6f34affc274aab6de90f9ae7798de2292a687adca7655298b46c87130b72aabe222c7aac1b585ec3ed5675638a11fc12084900891914077aec593f74
7
+ data.tar.gz: 4d312fd5501bac1cebeeeaa04c61113be221a28cc3a812c3d9adc20b650f2c5dd3ef4c0a95d617f903bd1cdc64193b754bbde8facee2367acf7f592f0e6f8803
data/CHANGELOG.md CHANGED
@@ -1,5 +1,49 @@
1
1
  # Change Log
2
2
 
3
+ ### 4.19.0.0
4
+
5
+ - Upgrade to SWT 4.19
6
+ - Upgrade to JRuby 9.2.16.0
7
+ - Speed up glimmer command startup time by not spawning a jruby a second time for handling Mac-specific options (cutting down glimmer app startup time to half)
8
+ - glimmer-setup command configures `glimmer` and `girb` for the Mac with `-X-JstartOnFirstThread` in a `JRUBY_OPTS` environment variable
9
+ - Switch all scaffolded models/views to `Model::` and `View::` namespacing instead of the namespaceless 'models' and 'views' directories (new scheme was originally introduced in the Tetris sample)
10
+ - Make sure that scaffolded shell/app uses new custom shell built-in `.launch` method instead of custom written `.open` method
11
+ - Make `scaffold:desktopify` generated app window shell fill the screen by default
12
+ - Support `c_tab_folder` and `c_tab_item`
13
+ - Support `c_combo` (`org.eclipse.swt.custom.CCombo` SWT widget) data-binding
14
+ - Hello, CCombo!
15
+ - Hello, C Tab!
16
+ - Shape#clear_shapes just like that of Drawable in WidgetProxy
17
+ - Set default background of `rgb(230, 230, 230)` on sash_form to make it more spottable to resize the sash
18
+ - Fix issue with processing arguments for the `glimmer package` command.
19
+ - Fix mandelbrot fractal sample on Windows (added missing `jruby-win32ole` gem for use with `concurrent-ruby` gem)
20
+ - Fix this `glimmer package` message, which comes out even with the right Java version: `WARNING! Glimmer Packaging Pre-Requisite Java Version 1.8.0_241 Is Not Found!`
21
+
22
+ ### 4.18.7.7
23
+
24
+ - Upgrade to glimmer v1.3.0
25
+ - Handle `code_text` encountering errors in adding observation request
26
+ - Always notify widget binding observer on `async_exec: true` data-bindings
27
+
28
+ ### 4.18.7.6
29
+
30
+ - Update the Hello, Code Text! sample to use data-binding
31
+ - Upgrade `puts_debuggerer` gem dependency to version 0.12.0
32
+ - Fix issue with `code_text` data-binding
33
+
34
+ ### 4.18.7.5
35
+
36
+ - Update `ImageProxy` with missing methods `#size`, `#parent_proxy`, and `#parent`, needed for a better "Shapes in an Image" support.
37
+
38
+ ### 4.18.7.4
39
+
40
+ - Add `glimmer scaffold:customshape[name,namespace]` command
41
+ - Add `glimmer scaffold:gem:customshape[name,namespace]` command
42
+ - Add `glimmer list:gems:customshape[keyword]` command
43
+ - Support automatic inference of `fill: true` for `path` just like other shapes
44
+ - Support `filled: true` alternative for `fill: true` Canvas Shape DSL option
45
+ - Fix issue with having to pass base_color to `bevel` custom shape in Tetris before data-binding instead of data-binding being sufficient
46
+
3
47
  ### 4.18.7.3
4
48
 
5
49
  - Support the ability for nested shapes to override their parent `shape` common shared properties
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # [<img src="https://raw.githubusercontent.com/AndyObtiva/glimmer/master/images/glimmer-logo-hi-res.png" height=85 />](https://github.com/AndyObtiva/glimmer) Glimmer DSL for SWT 4.18.7.3
1
+ # [<img src="https://raw.githubusercontent.com/AndyObtiva/glimmer/master/images/glimmer-logo-hi-res.png" height=85 />](https://github.com/AndyObtiva/glimmer) Glimmer DSL for SWT 4.19.0.0
2
2
  ## JRuby Desktop Development GUI Framework
3
3
  [![Gem Version](https://badge.fury.io/rb/glimmer-dsl-swt.svg)](http://badge.fury.io/rb/glimmer-dsl-swt)
4
4
  [![Travis CI](https://travis-ci.com/AndyObtiva/glimmer-dsl-swt.svg?branch=master)](https://travis-ci.com/github/AndyObtiva/glimmer-dsl-swt)
@@ -8,12 +8,14 @@
8
8
 
9
9
  **[Contributors Wanted! (Submit a Glimmer App Sample to Get Started)](#contributing)**
10
10
 
11
- [Glimmer](https://github.com/AndyObtiva/glimmer) DSL for SWT is a native-GUI cross-platform desktop development library written in [JRuby](https://www.jruby.org/), an OS-threaded faster JVM version of [Ruby](https://www.ruby-lang.org/en/). [Glimmer](https://github.com/AndyObtiva/glimmer)'s main innovation is a declarative [Ruby DSL](docs/reference/GLIMMER_GUI_DSL_SYNTAX.md#glimmer-dsl-syntax) that enables productive and efficient authoring of desktop application user-interfaces by relying on the robust [Eclipse SWT library](https://www.eclipse.org/swt/). [Glimmer](https://rubygems.org/gems/glimmer) additionally innovates by having built-in [data-binding](docs/reference/GLIMMER_GUI_DSL_SYNTAX.md#data-binding) support, which greatly facilitates synchronizing the GUI with domain models, thus achieving true decoupling of object oriented components and enabling developers to solve business problems (test-first) without worrying about GUI concerns, or alternatively drive development GUI-first, and then write clean business models (test-first) afterwards. Not only does Glimmer provide a large set of GUI [widgets](docs/reference/GLIMMER_GUI_DSL_SYNTAX.md#widgets), but it also supports drawing Canvas Graphics like [Shapes](docs/reference/GLIMMER_GUI_DSL_SYNTAX.md#canvas-shape-dsl) and [Animations](docs/reference/GLIMMER_GUI_DSL_SYNTAX.md#canvas-animation-dsl). To get started quickly, [Glimmer](https://rubygems.org/gems/glimmer) offers [scaffolding](docs/reference/GLIMMER_COMMAND.md#scaffolding) options for [Apps](#in-production), [Gems](docs/reference/GLIMMER_COMMAND.md#custom-shell-gem), and [Custom Widgets](docs/reference/GLIMMER_GUI_DSL_SYNTAX.md#custom-widgets). [Glimmer](https://rubygems.org/gems/glimmer) also includes native-executable [packaging](docs/reference/GLIMMER_PACKAGING_AND_DISTRIBUTION.md) support, sorely lacking in other libraries, thus enabling the delivery of desktop apps written in [Ruby](https://www.ruby-lang.org/en/) as truly native DMG/PKG/APP files on the [Mac](https://www.apple.com/ca/macos) + [App Store](https://developer.apple.com/macos/distribution/), MSI/EXE files on [Windows](https://www.microsoft.com/en-ca/windows), and [Gem Packaged Shell Scripts](docs/reference/GLIMMER_COMMAND.md#packaging) on [Linux](https://www.linux.org/).
11
+ **(The Original Glimmer Library Handling the World’s Ruby GUI Needs Since 2007. Beware of Imitators!)**
12
+
13
+ [Glimmer](https://github.com/AndyObtiva/glimmer) DSL for SWT is a native-GUI cross-platform desktop development library written in [JRuby](https://www.jruby.org/), an OS-threaded faster JVM version of [Ruby](https://www.ruby-lang.org/en/). [Glimmer](https://github.com/AndyObtiva/glimmer) was the [first Ruby gem](https://rubygems.org/gems/glimmer) to bring [SWT](https://www.eclipse.org/swt/) (Standard Widget Toolkit) to [Ruby](https://www.ruby-lang.org/en/), thanks to its creator [Andy Maleh](https://andymaleh.blogspot.com/), an EclipseCon/EclipseWorld/RubyConf speaker and expert. [Glimmer](https://github.com/AndyObtiva/glimmer)'s main innovation is a declarative [Ruby DSL](docs/reference/GLIMMER_GUI_DSL_SYNTAX.md#glimmer-dsl-syntax) that enables productive and efficient authoring of desktop application user-interfaces by relying on the robust [Eclipse SWT library](https://www.eclipse.org/swt/). [Glimmer](https://rubygems.org/gems/glimmer) additionally innovates by having built-in [data-binding](docs/reference/GLIMMER_GUI_DSL_SYNTAX.md#data-binding) support, which greatly facilitates synchronizing the GUI with domain models, thus achieving true decoupling of object oriented components and enabling developers to solve business problems (test-first) without worrying about GUI concerns, or alternatively drive development GUI-first, and then write clean business models (test-first) afterwards. Not only does Glimmer provide a large set of GUI [widgets](docs/reference/GLIMMER_GUI_DSL_SYNTAX.md#widgets), but it also supports drawing Canvas Graphics like [Shapes](docs/reference/GLIMMER_GUI_DSL_SYNTAX.md#canvas-shape-dsl) and [Animations](docs/reference/GLIMMER_GUI_DSL_SYNTAX.md#canvas-animation-dsl). To get started quickly, [Glimmer](https://rubygems.org/gems/glimmer) offers [scaffolding](docs/reference/GLIMMER_COMMAND.md#scaffolding) options for [Apps](#in-production), [Gems](docs/reference/GLIMMER_COMMAND.md#custom-shell-gem), and [Custom Widgets](docs/reference/GLIMMER_GUI_DSL_SYNTAX.md#custom-widgets). [Glimmer](https://rubygems.org/gems/glimmer) also includes native-executable [packaging](docs/reference/GLIMMER_PACKAGING_AND_DISTRIBUTION.md) support, sorely lacking in other libraries, thus enabling the delivery of desktop apps written in [Ruby](https://www.ruby-lang.org/en/) as truly native DMG/PKG/APP files on the [Mac](https://www.apple.com/ca/macos) + [App Store](https://developer.apple.com/macos/distribution/), MSI/EXE files on [Windows](https://www.microsoft.com/en-ca/windows), and [Gem Packaged Shell Scripts](docs/reference/GLIMMER_COMMAND.md#packaging) on [Linux](https://www.linux.org/).
12
14
 
13
15
  [<img src="https://covers.oreillystatic.com/images/9780596519650/lrg.jpg" width=105 /><br />
14
16
  Featured in JRuby Cookbook](http://shop.oreilly.com/product/9780596519650.do) and [Chalmers/Gothenburg University Software Engineering Master's Lecture Material](http://www.cse.chalmers.se/~bergert/slides/guest_lecture_DSLs.pdf)
15
17
 
16
- [Glimmer DSL for SWT](https://rubygems.org/gems/glimmer-dsl-swt) 4.18.7.3 includes [SWT 4.18](https://download.eclipse.org/eclipse/downloads/drops4/R-4.18-202012021800/), which was released on December 2, 2020. Gem version numbers are in sync with the SWT library versions. The first two digits represent the SWT version number. The last two digits represent the minor and patch versions of Glimmer DSL for SWT.
18
+ [Glimmer DSL for SWT](https://rubygems.org/gems/glimmer-dsl-swt) 4.19.0.0 includes [SWT 4.19](https://download.eclipse.org/eclipse/downloads/drops4/R-4.19-202103031800/), which was released on March 3, 2021. Gem version numbers are in sync with the SWT library versions. The first two digits represent the SWT version number. The last two digits represent the minor and patch versions of Glimmer DSL for SWT.
17
19
 
18
20
  [Glimmer DSL for SWT receives two updates per month](https://rubygems.org/gems/glimmer-dsl-swt/versions). You can trust [Glimmer DSL for SWT](https://rubygems.org/gems/glimmer-dsl-swt) with your Ruby desktop GUI development needs! [Glimmer DSL for SWT](https://rubygems.org/gems/glimmer-dsl-swt) brings great ideas to the table, such as declarative programming via domain specific languages, currently under-utilized in the GUI domain. That said, it may not be feature complete enough for everybody's needs, so please help make [Glimmer DSL for SWT](https://rubygems.org/gems/glimmer-dsl-swt) even better by providing feedback and [contributing](#contributing) when possible. The project is very active, so any feature suggestions that are accepted could be implemented within weeks if not days. Also, you are welcome to [hire me](#hire-me) full-time if you want long-term development of [Glimmer DSL for SWT](https://rubygems.org/gems/glimmer-dsl-swt) for your project needs.
19
21
 
@@ -306,14 +308,14 @@ https://www.eclipse.org/swt/faq.php
306
308
  ## Pre-requisites
307
309
 
308
310
  - JDK 8u241 (1.8.0_241) (find at https://www.oracle.com/java/technologies/javase/javase8u211-later-archive-downloads.html / On Windows, ensure PATH includes Java bin directory like C:\Program Files\Java\jdk1.8.0_241\bin for javapackager to work during packaging Glimmer applications)
309
- - JRuby 9.2.14.0 (supporting Ruby 2.5.x syntax) (get via [RVM](http://rvm.io) on Mac and Linux or find at [https://www.jruby.org/download](https://www.jruby.org/download) for Windows)
310
- - SWT 4.18 (already included in the [glimmer-dsl-swt](https://rubygems.org/gems/glimmer-dsl-swt) gem)
311
+ - JRuby 9.2.16.0 (supporting Ruby 2.5.x syntax) (get via [RVM](http://rvm.io) on Mac and Linux or find at [https://www.jruby.org/download](https://www.jruby.org/download) for Windows)
312
+ - SWT 4.19 (already included in the [glimmer-dsl-swt](https://rubygems.org/gems/glimmer-dsl-swt) gem)
311
313
  - Git (comes with Mac and Linux. Install on Windows: https://git-scm.com/download/win )
312
314
 
313
315
  To obtain JRuby through [RVM](http://rvm.io), you may run:
314
316
 
315
317
  ```bash
316
- rvm install jruby-9.2.14.0
318
+ rvm install jruby-9.2.16.0
317
319
  ```
318
320
 
319
321
  Glimmer might still work on other versions of Java, JRuby and SWT, but there are no guarantees, so it is best to stick to the pre-requisites outlined above.
@@ -340,13 +342,23 @@ jgem install glimmer-dsl-swt
340
342
 
341
343
  Or this command if you want a specific version:
342
344
  ```
343
- jgem install glimmer-dsl-swt -v 4.18.7.3
345
+ jgem install glimmer-dsl-swt -v 4.19.0.0
344
346
  ```
345
347
 
346
348
  `jgem` is JRuby's version of `gem` command.
347
349
  RVM allows running `gem install` directly as an alias.
348
350
  Otherwise, you may also run `jruby -S gem install ...`
349
351
 
352
+ Afterwards, you can use `glimmer` and `girb` commands.
353
+
354
+ On the Mac, you also have to run:
355
+
356
+ ```
357
+ glimmer-setup
358
+ ```
359
+
360
+ This ensures configuring extra required Mac options before using `glimmer` and `girb` commands.
361
+
350
362
  If you are new to Glimmer and would like to continue learning the basics, you may continue to the [Glimmer Command](https://github.com/AndyObtiva/glimmer#glimmer-command) section.
351
363
 
352
364
  Otherwise, if you are ready to build a Glimmer app, you can jump to the [Glimmer Scaffolding](https://github.com/AndyObtiva/glimmer-dsl-swt/blob/master/docs/reference/GLIMMER_COMMAND.md#scaffolding) section next.
@@ -358,7 +370,7 @@ Note: if you're using activerecord or activesupport, keep in mind that Glimmer u
358
370
 
359
371
  Add the following to `Gemfile`:
360
372
  ```
361
- gem 'glimmer-dsl-swt', '~> 4.18.7.3'
373
+ gem 'glimmer-dsl-swt', '~> 4.19.0.0'
362
374
  ```
363
375
 
364
376
  And, then run:
@@ -374,27 +386,115 @@ You may learn more about other Glimmer related gems ([`glimmer-dsl-opal`](https:
374
386
 
375
387
  You can use the glimmer command to scaffold new apps, run apps & samples, package native executables, and list Glimmer community gems.
376
388
 
377
- [docs/reference/GLIMMER_COMMAND.md](docs/reference/GLIMMER_COMMAND.md)
389
+ ```
390
+ glimmer
391
+ ```
392
+
393
+ ```
394
+ Glimmer (JRuby Desktop Development GUI Framework) - JRuby Gem: glimmer-dsl-swt v4.19.0.0
395
+
396
+ Usage: glimmer [--bundler] [--pd] [--quiet] [--debug] [--log-level=VALUE] [[ENV_VAR=VALUE]...] [[-jruby-option]...] (application.rb or task[task_args]) [[application2.rb]...]
397
+
398
+ Runs Glimmer applications and tasks.
399
+
400
+ When applications are specified, they are run using JRuby,
401
+ automatically preloading the glimmer Ruby gem and SWT jar dependency.
402
+
403
+ Optionally, extra Glimmer options, JRuby options, and/or environment variables may be passed in.
404
+
405
+ Glimmer options:
406
+ - "--bundler=GROUP" : Activates gems in Bundler default group in Gemfile
407
+ - "--pd=BOOLEAN" : Requires puts_debuggerer to enable pd method
408
+ - "--quiet=BOOLEAN" : Does not announce file path of Glimmer application being launched
409
+ - "--debug" : Displays extra debugging information, passes "--debug" to JRuby, and enables debug logging
410
+ - "--log-level=VALUE" : Sets Glimmer's Ruby logger level ("ERROR" / "WARN" / "INFO" / "DEBUG"; default is none)
411
+
412
+ Tasks are run via rake. Some tasks take arguments in square brackets.
413
+
414
+ Available tasks are below (if you do not see any, please add `require 'glimmer/rake_task'` to Rakefile and rerun or run rake -T):
415
+
416
+ Select a Glimmer task to run: (Press ↑/↓ arrow to move, Enter to select and letters to filter)
417
+ glimmer list:gems:customshape[query] # List Glimmer custom shape gems available at rubygems.org (query is optional) [alt: list:gems:cp]
418
+ ‣ glimmer list:gems:customshell[query] # List Glimmer custom shell gems available at rubygems.org (query is optional) [alt: list:gems:cs]
419
+ glimmer list:gems:customwidget[query] # List Glimmer custom widget gems available at rubygems.org (query is optional) [alt: list:gems:cw]
420
+ glimmer list:gems:dsl[query] # List Glimmer DSL gems available at rubygems.org (query is optional)
421
+ glimmer package[type] # Package app for distribution (generating config, jar, and native files) (type is optional)
422
+ glimmer package:clean # Clean by removing "dist" and "packages" directories
423
+ glimmer package:config # Generate JAR config file
424
+ glimmer package:gem # Generate gem under pkg directory
425
+ glimmer package:gemspec # Generate gemspec
426
+ glimmer package:jar # Generate JAR file
427
+ glimmer package:lock_jars # Lock JARs
428
+ glimmer package:native[type] # Generate Native files
429
+ glimmer run[app_path] # Runs Glimmer app or custom shell gem in the current directory, unless app_path is specified, then runs it instead (app_path is optional)
430
+ glimmer samples # Brings up the Glimmer Meta-Sample app to allow browsing, running, and viewing code of Glimmer samples
431
+ glimmer scaffold[app_name] # Scaffold Glimmer application directory structure to build a new app
432
+ glimmer scaffold:customshape[name,namespace] # Scaffold Glimmer::UI::CustomShape subclass (part of a view) under app/views (namespace is optional) [alt: scaffold:cp]
433
+ glimmer scaffold:customshell[name,namespace] # Scaffold Glimmer::UI::CustomShell subclass (full window view) under app/views (namespace is optional) [alt: scaffold:cs]
434
+ glimmer scaffold:customwidget[name,namespace] # Scaffold Glimmer::UI::CustomWidget subclass (part of a view) under app/views (namespace is optional) [alt: scaffold:cw]
435
+ glimmer scaffold:desktopify[app_name,website] # Desktopify a web app
436
+ glimmer scaffold:gem:customshape[name,namespace] # Scaffold Glimmer::UI::CustomShape subclass (part of a view) under its own Ruby gem project (namespace is required) [alt: scaffold:gem:cp]
437
+ glimmer scaffold:gem:customshell[name,namespace] # Scaffold Glimmer::UI::CustomShell subclass (full window view) under its own Ruby gem + app project (namespace is required) [alt: scaffold:ge...
438
+ glimmer scaffold:gem:customwidget[name,namespace] # Scaffold Glimmer::UI::CustomWidget subclass (part of a view) under its own Ruby gem project (namespace is required) [alt: scaffold:gem:cw]
439
+ ```
440
+
441
+ Learn more at: [docs/reference/GLIMMER_COMMAND.md](docs/reference/GLIMMER_COMMAND.md)
378
442
 
379
443
  ## Girb (Glimmer irb) Command
380
444
 
381
445
  You can use `girb` as an alternative to `irb` when prototyping Glimmer DSL for SWT GUI DSL code.
382
446
 
383
- [docs/reference/GLIMMER_GIRB.md](docs/reference/GLIMMER_GIRB.md)
447
+ ```
448
+ girb
449
+ ```
450
+
451
+ ![GIRB](/images/glimmer-girb.png)
452
+
453
+ Learn more at: [docs/reference/GLIMMER_GIRB.md](docs/reference/GLIMMER_GIRB.md)
384
454
 
385
455
  ## Glimmer GUI DSL Syntax
386
456
 
387
- This guide should help you get started with Glimmer DSL for SWT.
457
+ Here is a listing of supported widgets taken from the [SWT website](https://www.eclipse.org/swt/widgets/):
388
458
 
389
- [docs/reference/GLIMMER_GUI_DSL_SYNTAX.md](docs/reference/GLIMMER_GUI_DSL_SYNTAX.md)
459
+ [![SWT Widgets](/images/glimmer-swt-widgets.png)](https://www.eclipse.org/swt/widgets/)
390
460
 
391
- For more advanced SWT details, please refer to the [SWT Reference](#swt-reference).
461
+ In a nutshell, the Glimmer GUI DSL syntax consists mainly of:
462
+
463
+ 1. Keywords
464
+
465
+ Example of a keyword representing a table widget:
466
+
467
+ ```ruby
468
+ table
469
+ ```
470
+
471
+ 2. Style/Args
472
+
473
+ Example of a multi-line selection table widget:
474
+
475
+ ```ruby
476
+ table(:multi)
477
+ ```
478
+
479
+ 3. Content/Properties
480
+
481
+ Example of a multi-line selection table widget with a table column as content that has a header `text` property as 'Name'.
482
+
483
+ ```ruby
484
+ table(:multi) {
485
+ table_column {
486
+ text 'Name'
487
+ }
488
+ }
489
+ ```
490
+
491
+ Learn more at: [docs/reference/GLIMMER_GUI_DSL_SYNTAX.md](docs/reference/GLIMMER_GUI_DSL_SYNTAX.md)
392
492
 
393
493
  ## Glimmer Configuration
394
494
 
395
495
  Glimmer configuration may be done via the `Glimmer::Config` module.
396
496
 
397
- [docs/reference/GLIMMER_CONFIGURATION.md](docs/reference/GLIMMER_CONFIGURATION.md)
497
+ Learn more at: [docs/reference/GLIMMER_CONFIGURATION.md](docs/reference/GLIMMER_CONFIGURATION.md)
398
498
 
399
499
  ## Glimmer Style Guide
400
500
 
@@ -402,10 +502,6 @@ Glimmer configuration may be done via the `Glimmer::Config` module.
402
502
 
403
503
  ## Samples
404
504
 
405
- See a listing of samples over here, including screenshots and explanations of what each sample demonstrates:
406
-
407
- [docs/reference/GLIMMER_SAMPLES.md](docs/reference/GLIMMER_SAMPLES.md)
408
-
409
505
  Check the [samples](samples) directory in [glimmer-dsl-swt](https://github.com/AndyObtiva/glimmer-dsl-swt) for examples on how to write Glimmer applications. To run a sample, make sure to install the `glimmer-dsl-swt` gem first and then run:
410
506
  ```
411
507
  glimmer samples
@@ -415,6 +511,8 @@ glimmer samples
415
511
 
416
512
  ![Glimmer Meta-Sample](/images/glimmer-meta-sample.png)
417
513
 
514
+ See a listing of samples including screenshots and explanations at: [docs/reference/GLIMMER_SAMPLES.md](docs/reference/GLIMMER_SAMPLES.md)
515
+
418
516
  ## In Production
419
517
 
420
518
  The following production apps have been built with Glimmer.
@@ -441,11 +539,19 @@ If you have a Glimmer app you would like referenced here, please mention in a Pu
441
539
 
442
540
  [<img alt="Connector Logo" src="https://raw.githubusercontent.com/AndyObtiva/connector/master/package/linux/Connector.png" height=40 /> Connector](https://github.com/AndyObtiva/connector): A minimalist open-source multi-engine web browser
443
541
 
542
+ ### The DCR Programming Language
543
+
544
+ [<img alt="Connector Logo" src="https://raw.githubusercontent.com/AndyObtiva/dcr/f31cd45a8503051e899ed8e831fd03654d38e418/package/linux/Draw%20Color%20Repeat.png" height=40 /> Draw Color Repeat](https://github.com/AndyObtiva/dcr): A young boy programming language for Drawing and Coloring with Repetition
545
+
444
546
  ## Packaging & Distribution
445
547
 
446
- Glimmer simplifies the process of native-executable packaging and distribution on Mac and Windows via a single `glimmer package` command:
548
+ Glimmer simplifies the process of native-executable packaging and distribution on Mac and Windows via a single command:
549
+
550
+ ```
551
+ glimmer package
552
+ ```
447
553
 
448
- [docs/reference/GLIMMER_PACKAGING_AND_DISTRIBUTION.md](docs/reference/GLIMMER_PACKAGING_AND_DISTRIBUTION.md)
554
+ Learn more at: [docs/reference/GLIMMER_PACKAGING_AND_DISTRIBUTION.md](docs/reference/GLIMMER_PACKAGING_AND_DISTRIBUTION.md)
449
555
 
450
556
  ## App Updates
451
557
 
data/RUBY_VERSION CHANGED
@@ -1 +1 @@
1
- jruby-9.2.14.0
1
+ jruby-9.2.16.0
data/VERSION CHANGED
@@ -1 +1 @@
1
- 4.18.7.3
1
+ 4.19.0.0
data/bin/girb CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env jruby
2
2
 
3
3
  # Copyright (c) 2007-2021 Andy Maleh
4
- #
4
+ #
5
5
  # Permission is hereby granted, free of charge, to any person obtaining
6
6
  # a copy of this software and associated documentation files (the
7
7
  # "Software"), to deal in the Software without restriction, including
@@ -9,10 +9,10 @@
9
9
  # distribute, sublicense, and/or sell copies of the Software, and to
10
10
  # permit persons to whom the Software is furnished to do so, subject to
11
11
  # the following conditions:
12
- #
12
+ #
13
13
  # The above copyright notice and this permission notice shall be
14
14
  # included in all copies or substantial portions of the Software.
15
- #
15
+ #
16
16
  # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
17
  # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
18
  # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
@@ -21,11 +21,12 @@
21
21
  # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
22
  # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23
23
 
24
- trap "SIGINT" do
25
- # No Op for irb
26
- end
24
+ # This script was written for Windows and Linux only
27
25
 
28
- require_relative '../lib/glimmer/launcher'
26
+ ENV['JRUBY_OPTS'] = ARGV.select {|arg| arg.start_with?('-')}.join(' ')
29
27
 
30
- girb_runner = File.expand_path('../girb_runner.rb', __FILE__)
31
- Glimmer::Launcher.new(["irb -r #{girb_runner}"] + ARGV).launch
28
+ require_relative 'girb_runner'
29
+
30
+ require 'irb'
31
+
32
+ IRB.start('.')
data/bin/girb_runner.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # Copyright (c) 2007-2021 Andy Maleh
2
- #
2
+ #
3
3
  # Permission is hereby granted, free of charge, to any person obtaining
4
4
  # a copy of this software and associated documentation files (the
5
5
  # "Software"), to deal in the Software without restriction, including
@@ -7,10 +7,10 @@
7
7
  # distribute, sublicense, and/or sell copies of the Software, and to
8
8
  # permit persons to whom the Software is furnished to do so, subject to
9
9
  # the following conditions:
10
- #
10
+ #
11
11
  # The above copyright notice and this permission notice shall be
12
12
  # included in all copies or substantial portions of the Software.
13
- #
13
+ #
14
14
  # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
15
  # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
16
  # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
@@ -20,6 +20,11 @@
20
20
  # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21
21
 
22
22
  require 'puts_debuggerer'
23
+ require_relative '../lib/glimmer-dsl-swt'
24
+
25
+ trap "SIGINT" do
26
+ # No Op for irb
27
+ end
23
28
 
24
29
  include Glimmer
25
30
 
data/bin/glimmer CHANGED
@@ -21,6 +21,15 @@
21
21
  # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
22
  # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23
23
 
24
+ # This script was written for Windows and Linux only
25
+
26
+ require_relative '../lib/glimmer-dsl-swt'
24
27
  require_relative '../lib/glimmer/launcher'
25
28
 
26
- Glimmer::Launcher.new(ARGV).launch
29
+ # Initialize launcher, consuming ARGV args that are for Glimmer only
30
+ launcher = Glimmer::Launcher.new(ARGV)
31
+
32
+ # Set remaining ARGV args (starting with `-`) as JRuby options
33
+ ENV['JRUBY_OPTS'] = ARGV.select {|arg| arg.start_with?('-')}.join(' ')
34
+
35
+ launcher.launch
data/bin/glimmer-setup ADDED
@@ -0,0 +1,58 @@
1
+ #!/usr/bin/env jruby
2
+
3
+ # Copyright (c) 2020-2021 Andy Maleh
4
+ #
5
+ # Permission is hereby granted, free of charge, to any person obtaining
6
+ # a copy of this software and associated documentation files (the
7
+ # "Software"), to deal in the Software without restriction, including
8
+ # without limitation the rights to use, copy, modify, merge, publish,
9
+ # distribute, sublicense, and/or sell copies of the Software, and to
10
+ # permit persons to whom the Software is furnished to do so, subject to
11
+ # the following conditions:
12
+ #
13
+ # The above copyright notice and this permission notice shall be
14
+ # included in all copies or substantial portions of the Software.
15
+ #
16
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23
+
24
+ require 'os'
25
+
26
+ if OS.mac?
27
+ require 'fileutils'
28
+ home_dir = `echo ~`.strip
29
+
30
+ [
31
+ ['.bash_profile', '.bashrc'],
32
+ ['.zprofile', '.zshrc']
33
+ ].each do |profile_and_fallback|
34
+ shell_profile_file_name = profile_and_fallback.first
35
+ shell_profile_file_name = profile_and_fallback.last if !File.exist?("#{home_dir}/#{shell_profile_file_name}")
36
+ shell_profile_file = "#{home_dir}/#{shell_profile_file_name}"
37
+ FileUtils.touch(shell_profile_file)
38
+ shell_profile = File.read(shell_profile_file)
39
+ glimmer_source_statement = 'export JRUBY_OPTS="$JRUBY_OPTS -J-XstartOnFirstThread"'
40
+ unless shell_profile.split("\n").detect {|line| line.include?(glimmer_source_statement) }
41
+ File.write(shell_profile_file, "#{shell_profile}\n#{glimmer_source_statement}")
42
+ end
43
+ puts "~/#{shell_profile_file_name} has been modified"
44
+ end
45
+
46
+ puts <<~OUTPUT
47
+
48
+ Before using `glimmer` or `girb`, start a new shell session in the same directory (open a new terminal tab and go to the same directory) or run the following command:
49
+
50
+ export JRUBY_OPTS="$JRUBY_OPTS -J-XstartOnFirstThread"
51
+
52
+ Afterwards, you may run the following commands:
53
+
54
+ glimmer
55
+ girb
56
+
57
+ OUTPUT
58
+ end