nit.git
7 years agorta: fast fix to avoid resolving illegal types.
Jean Privat [Tue, 9 Aug 2016 00:44:00 +0000 (20:44 -0400)]
rta: fast fix to avoid resolving illegal types.

This requires a more in-depth work to improve the model.
Another improvement can also to teach RTA the context of object mechanism
so that only legal receivers are attempted.

Signed-off-by: Jean Privat <jean@pryen.org>

7 years agomodel: MVirtualType fast resolution for the special type `SELF`
Jean Privat [Mon, 8 Aug 2016 17:39:00 +0000 (13:39 -0400)]
model: MVirtualType fast resolution for the special type `SELF`

Signed-off-by: Jean Privat <jean@pryen.org>

7 years agomodel: lookup_definitions gains an *iterate the classdefs* strategy
Jean Privat [Mon, 8 Aug 2016 17:37:18 +0000 (13:37 -0400)]
model: lookup_definitions gains an *iterate the classdefs* strategy

Signed-off-by: Jean Privat <jean@pryen.org>

7 years agomodel: MClassDef register property definitions by its associated property
Jean Privat [Mon, 8 Aug 2016 17:35:38 +0000 (13:35 -0400)]
model: MClassDef register property definitions by its associated property

Signed-off-by: Jean Privat <jean@pryen.org>

7 years agoMerge: app.nit: improve apps life-cycle
Jean Privat [Wed, 3 Aug 2016 16:38:46 +0000 (12:38 -0400)]
Merge: app.nit: improve apps life-cycle

Modify the _app.nit_ life-cycle callbacks to add `on_restart`, and to remove `on_start` and `on_destroy`. `on_restart` is called when the app goes comes back from a `on_stop`. `on_start` duplicated other callbacks (`on_create` and the new `on_restart`), plus it didn't have a direct equivalent  in iOS. `on_destroy` also didn't have an iOS equivalent. These changes simplify the life-cycle and use only callbacks existing on both platforms.

This PR also improves the documentation of the _app.nit_ life-cycle with a nice little graph and references to the platform specific triggers.

Pull-Request: #2229
Reviewed-by: Ait younes Mehdi Adel <overpex@gmail.com>

7 years agoMerge: app.nit: Intro the `app_files` annotation, and use it in calculator
Jean Privat [Wed, 3 Aug 2016 16:38:43 +0000 (12:38 -0400)]
Merge: app.nit: Intro the `app_files` annotation, and use it in calculator

Intro `app_files`, an annotation to specify where to find more Android and iOS specific files. This effectively associates resources to a specific Nit module. It can be used to have different icons per branding, or to package graphical assets with a module from the lib.

It is used in the calculator to assign a different icon to the scientific calculator variant.

Pull-Request: #2228
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>
Reviewed-by: Romain Chanoir <romain.chanoir@viacesi.fr>

7 years agoMerge: Android: import the R class
Jean Privat [Wed, 3 Aug 2016 16:38:33 +0000 (12:38 -0400)]
Merge: Android: import the R class

The R class is generated by the Android toolchain and acts as a static way to identify resources in Java code. The ID of each values from the `android/res` folder is sorted in a category and accessible through a static field. An example of a generated R class is shown at the bottom of this description.

This PR import the R class in all Java classes generated from the Java FFI. This creates a similar effect as having the R class in the same package. Previously, the user could not reliably import the R class manually as the package name changes between the debug and release version.

~~~
/* AUTO-GENERATED FILE.  DO NOT MODIFY.
 *
 * This class was automatically generated by the
 * aapt tool from the resource data it found.  It
 * should not be modified by hand.
 */

package net.xymus.benitlux_debug;

public final class R {
    public static final class attr {
    }
    public static final class color {
        public static final int item_background=0x7f050000;
    }
    public static final class drawable {
        public static final int ic_launcher=0x7f020000;
        public static final int icon=0x7f020001;
        public static final int notif=0x7f020002;
    }
    public static final class layout {
        public static final int main=0x7f030000;
    }
    public static final class string {
        public static final int app_name=0x7f040000;
    }
}

~~~

Pull-Request: #2227
Reviewed-by: Ait younes Mehdi Adel <overpex@gmail.com>
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>

7 years agoMerge: nitweb: show metrics
Jean Privat [Wed, 3 Aug 2016 16:38:26 +0000 (12:38 -0400)]
Merge: nitweb: show metrics

This PR introduce the metrics displaying in nitweb.

For now, only classes and modules metrics are shown (mclass_metrics.nit, mmodules_metrics.nit, inheritance_metrics.nit).

Some examples (may be long to load on my little server):
* [core::Array](http://nitweb.moz-code.org/doc/core::Array)
* [core::array](http://nitweb.moz-code.org/doc/core::array)
* [core>collection>](http://nitweb.moz-code.org/doc/core%3Ecollection%3E)
* [core](http://nitweb.moz-code.org/doc/core)

Pull-Request: #2219
Reviewed-by: Jean Privat <jean@pryen.org>

7 years agolinux: update lifecycle
Alexis Laferrière [Fri, 29 Jul 2016 18:38:38 +0000 (14:38 -0400)]
linux: update lifecycle

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

7 years agoapp.nit: document platform specific triggers for each app.nit callbacks
Alexis Laferrière [Fri, 29 Jul 2016 15:49:24 +0000 (11:49 -0400)]
app.nit: document platform specific triggers for each app.nit callbacks

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

7 years agoapp.nit: update README and add graph image
Alexis Laferrière [Fri, 29 Jul 2016 13:18:36 +0000 (09:18 -0400)]
app.nit: update README and add graph image

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

7 years agolib & contrib: remove references to on_start and on_destroy
Alexis Laferrière [Thu, 28 Jul 2016 20:14:04 +0000 (16:14 -0400)]
lib & contrib: remove references to on_start and on_destroy

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

7 years agoandroid: call on_restart
Alexis Laferrière [Fri, 29 Jul 2016 12:59:29 +0000 (08:59 -0400)]
android: call on_restart

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

7 years agolib/ios: update lifecycle
Alexis Laferrière [Thu, 28 Jul 2016 20:14:39 +0000 (16:14 -0400)]
lib/ios: update lifecycle

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

7 years agoapp.nit: intro `on_restart`
Alexis Laferrière [Fri, 29 Jul 2016 12:55:00 +0000 (08:55 -0400)]
app.nit: intro `on_restart`

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

7 years agoapp.nit & android: move on_create & on_destroy to Android only
Alexis Laferrière [Thu, 28 Jul 2016 20:13:23 +0000 (16:13 -0400)]
app.nit & android: move on_create & on_destroy to Android only

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

7 years agobenitlux: fix typo in `ItemView::set_background`
Alexis Laferrière [Fri, 22 Jul 2016 17:12:07 +0000 (13:12 -0400)]
benitlux: fix typo in `ItemView::set_background`

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

7 years agocalculator: separate Android variants between the simple calc and the sci one
Alexis Laferrière [Fri, 22 Jul 2016 13:37:27 +0000 (09:37 -0400)]
calculator: separate Android variants between the simple calc and the sci one

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

7 years agocalculator: have a different icon and app name for the scientific variant
Alexis Laferrière [Fri, 22 Jul 2016 13:29:28 +0000 (09:29 -0400)]
calculator: have a different icon and app name for the scientific variant

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

7 years agocalculator: shorter name and bump up the version number
Alexis Laferrière [Fri, 22 Jul 2016 13:36:11 +0000 (09:36 -0400)]
calculator: shorter name and bump up the version number

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

7 years agocalculator: name icon rules to real files
Alexis Laferrière [Fri, 22 Jul 2016 13:08:50 +0000 (09:08 -0400)]
calculator: name icon rules to real files

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

7 years agocalculator: move `scientific_calculator` to its own folder `scientific`
Alexis Laferrière [Fri, 22 Jul 2016 13:07:42 +0000 (09:07 -0400)]
calculator: move `scientific_calculator` to its own folder `scientific`

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

7 years agoiOS: use `app_files`
Alexis Laferrière [Fri, 22 Jul 2016 03:22:20 +0000 (23:22 -0400)]
iOS: use `app_files`

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

7 years agoAndroid: use `app_files` to find android specific files
Alexis Laferrière [Fri, 22 Jul 2016 03:09:47 +0000 (23:09 -0400)]
Android: use `app_files` to find android specific files

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

7 years agoAndroid: move up assets and resources logic
Alexis Laferrière [Fri, 22 Jul 2016 01:51:59 +0000 (21:51 -0400)]
Android: move up assets and resources logic

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

7 years agoAndroid & iOS: collect the arguments from the `app_files` annotation
Alexis Laferrière [Fri, 22 Jul 2016 01:53:29 +0000 (21:53 -0400)]
Android & iOS: collect the arguments from the `app_files` annotation

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

7 years agolib: intro and doc the `app_files` annotation
Alexis Laferrière [Fri, 22 Jul 2016 01:52:47 +0000 (21:52 -0400)]
lib: intro and doc the `app_files` annotation

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

7 years agobenitlux: use the R class
Alexis Laferrière [Thu, 21 Jul 2016 22:52:54 +0000 (18:52 -0400)]
benitlux: use the R class

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

7 years agoAndroid support: import the R class at the top of all java files from the FFI
Alexis Laferrière [Thu, 21 Jul 2016 22:42:49 +0000 (18:42 -0400)]
Android support: import the R class at the top of all java files from the FFI

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

7 years agoJava FFI: make `MModule::java_file` public
Alexis Laferrière [Thu, 21 Jul 2016 22:51:55 +0000 (18:51 -0400)]
Java FFI: make `MModule::java_file` public

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

7 years agonitweb/angular: add metrics tab for packages, groups, modules and classes
Alexandre Terrasa [Mon, 4 Jul 2016 23:32:12 +0000 (19:32 -0400)]
nitweb/angular: add metrics tab for packages, groups, modules and classes

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

7 years agonitweb/angular: add metrics directives
Alexandre Terrasa [Mon, 4 Jul 2016 23:31:50 +0000 (19:31 -0400)]
nitweb/angular: add metrics directives

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

7 years agonitweb/angular: import d3pie js lib
Alexandre Terrasa [Mon, 4 Jul 2016 23:31:27 +0000 (19:31 -0400)]
nitweb/angular: import d3pie js lib

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

7 years agonitweb/angular: model load metrics
Alexandre Terrasa [Mon, 4 Jul 2016 23:27:11 +0000 (19:27 -0400)]
nitweb/angular: model load metrics

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

7 years agonitweb: introduce metrics API
Alexandre Terrasa [Mon, 4 Jul 2016 23:26:29 +0000 (19:26 -0400)]
nitweb: introduce metrics API

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

7 years agomodel_collect: collect accessible methods and VTs
Alexandre Terrasa [Mon, 4 Jul 2016 23:23:01 +0000 (19:23 -0400)]
model_collect: collect accessible methods and VTs

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

7 years agotests: update nitmetrics output
Alexandre Terrasa [Wed, 20 Jul 2016 16:04:26 +0000 (12:04 -0400)]
tests: update nitmetrics output

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

7 years agometrics: add metric about abstract class inheritance
Alexandre Terrasa [Mon, 4 Jul 2016 23:22:45 +0000 (19:22 -0400)]
metrics: add metric about abstract class inheritance

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

7 years agometrics: add Number of Accessible Definition metric for mmodule
Alexandre Terrasa [Mon, 4 Jul 2016 23:22:09 +0000 (19:22 -0400)]
metrics: add Number of Accessible Definition metric for mmodule

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

7 years agometrics: add metrics about class content kind
Alexandre Terrasa [Mon, 4 Jul 2016 23:21:34 +0000 (19:21 -0400)]
metrics: add metrics about class content kind

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

7 years agometrics: factorize `mainmodule` and `model_view` for all MModule metrics
Alexandre Terrasa [Mon, 4 Jul 2016 22:01:26 +0000 (18:01 -0400)]
metrics: factorize `mainmodule` and `model_view` for all MModule metrics

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

7 years agometrics: factorize `mainmodule` and `model_view` attributes for all MClass metrics
Alexandre Terrasa [Mon, 4 Jul 2016 22:00:39 +0000 (18:00 -0400)]
metrics: factorize `mainmodule` and `model_view` attributes for all MClass metrics

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

7 years agoMerge: Improve (and fix) Docker
Jean Privat [Mon, 11 Jul 2016 17:02:48 +0000 (13:02 -0400)]
Merge: Improve (and fix) Docker

#2181 broke the initial bootstrap because nitc was not found to build nitmd thus failed the `make man`

This PR also cleanup the dockerfiles so the root/ directory is not more used (this cause issue for non-root users)

Pull-Request: #2226
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>

7 years agodocker: do not install in /root as it is not accessible to unprivileged user
Jean Privat [Mon, 11 Jul 2016 14:21:31 +0000 (10:21 -0400)]
docker: do not install in /root as it is not accessible to unprivileged user

Signed-off-by: Jean Privat <jean@pryen.org>

7 years agofix nitc path when making manpages
Jean Privat [Mon, 11 Jul 2016 14:19:52 +0000 (10:19 -0400)]
fix nitc path when making manpages

This broke Docker

Signed-off-by: Jean Privat <jean@pryen.org>

7 years agoMerge: global_compiler: Write errors to stderr
Jean Privat [Mon, 11 Jul 2016 13:48:50 +0000 (09:48 -0400)]
Merge: global_compiler: Write errors to stderr

Signed-off-by: Jean-Christophe Beaupré <jcbrinfo@users.noreply.github.com>

Pull-Request: #2225

7 years agoMerge: separate_compiler: Write errors to stderr
Jean Privat [Mon, 11 Jul 2016 13:48:48 +0000 (09:48 -0400)]
Merge: separate_compiler: Write errors to stderr

Signed-off-by: Jean-Christophe Beaupré <jcbrinfo@users.noreply.github.com>

Pull-Request: #2224
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>

7 years agoMerge: gamnit: add tileset and bitmap font support
Jean Privat [Mon, 11 Jul 2016 13:48:43 +0000 (09:48 -0400)]
Merge: gamnit: add tileset and bitmap font support

This PR intro `TileSet, TileSetFont and TextSprites` to gamnit, allowing to draw text from bitmap fonts via sprites. The new module reuse some code from `mnit::tileset` and Action Nitro.

Pull-Request: #2222
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>

7 years agoMerge: NOTICE: Fix years
Jean Privat [Mon, 11 Jul 2016 13:48:41 +0000 (09:48 -0400)]
Merge: NOTICE: Fix years

There is at least one commit from @calestar in 2008.

Signed-off-by: Jean-Christophe Beaupré <jcbrinfo@users.noreply.github.com>

Pull-Request: #2221

7 years agoglobal_compiler: Write errors to stderr
Jean-Christophe Beaupré [Fri, 8 Jul 2016 22:02:37 +0000 (18:02 -0400)]
global_compiler: Write errors to stderr

Signed-off-by: Jean-Christophe Beaupré <jcbrinfo@users.noreply.github.com>

7 years agoseparate_compiler: Write errors to stderr
Jean-Christophe Beaupré [Fri, 8 Jul 2016 22:02:15 +0000 (18:02 -0400)]
separate_compiler: Write errors to stderr

Signed-off-by: Jean-Christophe Beaupré <jcbrinfo@users.noreply.github.com>

7 years agolib/gamnit: intro tileset (partial copy of mnit::tileset)
Alexis Laferrière [Mon, 4 Jan 2016 00:42:41 +0000 (19:42 -0500)]
lib/gamnit: intro tileset (partial copy of mnit::tileset)

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

7 years agoNOTICE: Fix years
Jean-Christophe Beaupré [Thu, 30 Jun 2016 13:46:53 +0000 (09:46 -0400)]
NOTICE: Fix years

There is at least one commit from @calestar in 2008.

Signed-off-by: Jean-Christophe Beaupré <jcbrinfo@users.noreply.github.com>

7 years agoMerge: tests: add sav/Darwin/test_loader_args5.res
Jean Privat [Wed, 6 Jul 2016 13:23:12 +0000 (09:23 -0400)]
Merge: tests: add sav/Darwin/test_loader_args5.res

because /lib does not exists

Signed-off-by: Jean Privat <jean@pryen.org>

Pull-Request: #2218
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>

7 years agotests: add sav/Darwin/test_loader_args5.res
Jean Privat [Mon, 4 Jul 2016 20:18:44 +0000 (16:18 -0400)]
tests: add sav/Darwin/test_loader_args5.res

because /lib does not exists

Signed-off-by: Jean Privat <jean@pryen.org>

7 years agoMerge: model: Fix a spelling mistake
Jean Privat [Mon, 4 Jul 2016 19:16:55 +0000 (15:16 -0400)]
Merge: model: Fix a spelling mistake

Signed-off-by: Jean-Christophe Beaupré <jcbrinfo@users.noreply.github.com>

Pull-Request: #2217
Reviewed-by: Jean Privat <jean@pryen.org>

7 years agoMerge: model: Write errors to stderr
Jean Privat [Mon, 4 Jul 2016 19:16:54 +0000 (15:16 -0400)]
Merge: model: Write errors to stderr

Signed-off-by: Jean-Christophe Beaupré <jcbrinfo@users.noreply.github.com>

Pull-Request: #2216
Reviewed-by: Jean Privat <jean@pryen.org>

7 years agoMerge: nitweb: stars rating system
Jean Privat [Mon, 4 Jul 2016 19:16:52 +0000 (15:16 -0400)]
Merge: nitweb: stars rating system

Add discrete stars rating system in top right corner of each documentation card.

Can be seen here: http://nitweb.moz-code.org/doc/core::Array

Pull-Request: #2215
Reviewed-by: Jean Privat <jean@pryen.org>

7 years agonitweb/angular: do not use intro mdoc
Alexandre Terrasa [Thu, 30 Jun 2016 02:35:41 +0000 (22:35 -0400)]
nitweb/angular: do not use intro mdoc

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

7 years agonitweb/angular: display stars
Alexandre Terrasa [Thu, 30 Jun 2016 02:35:24 +0000 (22:35 -0400)]
nitweb/angular: display stars

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

7 years agoMerge: nitwebcrawl: add a simple crawler for nitweb
Jean Privat [Mon, 4 Jul 2016 15:26:31 +0000 (11:26 -0400)]
Merge: nitwebcrawl: add a simple crawler for nitweb

I do not remember why I developed this, but it works so why not publish it.

This can be a base to bench IO-bound parallel problem, or something to test nitweb.
For information, if I crawl a nitweb server on lib/core. I get 5209 entities in 1m51s real time (0m50s user time)

Pull-Request: #2214
Reviewed-by: Romain Chanoir <romain.chanoir@viacesi.fr>
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>

7 years agoMerge: model: Fix a minor documentation mistake
Jean Privat [Mon, 4 Jul 2016 15:26:30 +0000 (11:26 -0400)]
Merge: model: Fix a minor documentation mistake

Signed-off-by: Jean-Christophe Beaupré <jcbrinfo@users.noreply.github.com>

Pull-Request: #2213

7 years agoMerge: model_collect: Fix a spelling mistake
Jean Privat [Mon, 4 Jul 2016 15:26:28 +0000 (11:26 -0400)]
Merge: model_collect: Fix a spelling mistake

Signed-off-by: Jean-Christophe Beaupré <jcbrinfo@users.noreply.github.com>

Pull-Request: #2212
Reviewed-by: Jean Privat <jean@pryen.org>

7 years agonitwebcrawl: add a simple crawler for nitweb
Jean Privat [Mon, 4 Jul 2016 15:25:02 +0000 (11:25 -0400)]
nitwebcrawl: add a simple crawler for nitweb

Signed-off-by: Jean Privat <jean@pryen.org>

7 years agomodel: Fix a spelling mistake
Jean-Christophe Beaupré [Mon, 4 Jul 2016 15:14:35 +0000 (11:14 -0400)]
model: Fix a spelling mistake

Signed-off-by: Jean-Christophe Beaupré <jcbrinfo@users.noreply.github.com>

7 years agomodel: Write errors to stderr
Jean-Christophe Beaupré [Mon, 4 Jul 2016 14:13:31 +0000 (10:13 -0400)]
model: Write errors to stderr

Signed-off-by: Jean-Christophe Beaupré <jcbrinfo@users.noreply.github.com>

7 years agomodel: Fix an error message
Jean-Christophe Beaupré [Mon, 4 Jul 2016 14:12:03 +0000 (10:12 -0400)]
model: Fix an error message

Signed-off-by: Jean-Christophe Beaupré <jcbrinfo@users.noreply.github.com>

7 years agomodel: Fix a minor documentation mistake
Jean-Christophe Beaupré [Thu, 30 Jun 2016 16:53:51 +0000 (12:53 -0400)]
model: Fix a minor documentation mistake

Signed-off-by: Jean-Christophe Beaupré <jcbrinfo@users.noreply.github.com>

7 years agomodel_collect: Fix a spelling mistake
Jean-Christophe Beaupré [Thu, 30 Jun 2016 15:36:13 +0000 (11:36 -0400)]
model_collect: Fix a spelling mistake

Signed-off-by: Jean-Christophe Beaupré <jcbrinfo@users.noreply.github.com>

7 years agoMerge: modelize_class: Fix a verb tense
Jean Privat [Thu, 30 Jun 2016 14:31:54 +0000 (10:31 -0400)]
Merge: modelize_class: Fix a verb tense

Signed-off-by: Jean-Christophe Beaupré <jcbrinfo@users.noreply.github.com>

Pull-Request: #2210
Reviewed-by: Jean Privat <jean@pryen.org>

7 years agoMerge: model: Fix minor documentation mistakes
Jean Privat [Thu, 30 Jun 2016 14:31:51 +0000 (10:31 -0400)]
Merge: model: Fix minor documentation mistakes

Signed-off-by: Jean-Christophe Beaupré <jcbrinfo@users.noreply.github.com>

Pull-Request: #2209
Reviewed-by: Jean Privat <jean@pryen.org>

7 years agoMerge: lib/core: Push rope maxlen to 512 instead of 64
Jean Privat [Thu, 30 Jun 2016 14:31:13 +0000 (10:31 -0400)]
Merge: lib/core: Push rope maxlen to 512 instead of 64

As discussed in my thesis, 512 bytes/leaf is a nice compromise for most uses of Ropes, therefore, the current threshold is updated to better reflect this.

Pull-Request: #2208

7 years agomodelize_class: Fix a verb tense
Jean-Christophe Beaupré [Thu, 30 Jun 2016 14:30:14 +0000 (10:30 -0400)]
modelize_class: Fix a verb tense

Signed-off-by: Jean-Christophe Beaupré <jcbrinfo@users.noreply.github.com>

7 years agomodel: Fix minor documentation mistakes
Jean-Christophe Beaupré [Thu, 30 Jun 2016 14:17:49 +0000 (10:17 -0400)]
model: Fix minor documentation mistakes

Signed-off-by: Jean-Christophe Beaupré <jcbrinfo@users.noreply.github.com>

7 years agonitweb: introduce feedback API for star rating system
Alexandre Terrasa [Thu, 30 Jun 2016 02:34:53 +0000 (22:34 -0400)]
nitweb: introduce feedback API for star rating system

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

7 years agoweb: rename `model_api` into `api_model`
Alexandre Terrasa [Thu, 30 Jun 2016 00:43:35 +0000 (20:43 -0400)]
web: rename `model_api` into `api_model`

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

7 years agolib/core: Push rope maxlen to 512 instead of 64
Lucas Bajolet [Wed, 29 Jun 2016 17:20:34 +0000 (13:20 -0400)]
lib/core: Push rope maxlen to 512 instead of 64

Signed-off-by: Lucas Bajolet <r4pass@hotmail.com>

7 years agoMerge: Lighter strings
Jean Privat [Wed, 29 Jun 2016 13:57:48 +0000 (09:57 -0400)]
Merge: Lighter strings

This is an attempt to make text variants substantially lighter by adding cost to certain rare operations.
With this PR:

* `to_cstring` is not cached anymore, this induces more freedom on the FFI-side of things since the copy will be done on site, therefore the `char*` is now mutable on this side.
* `chars` and `bytes` are not attributes anymore, since they are only seldom used, they brought too much of a weight to the string envelope to justify such a spatial overhead
* the `is_dirty` flag was also removed from `FlatBuffer` since it no longer served any purpose
* the `flat_cache_last_pos` attribute is also removed from `Concat` and replaced by a direct access to the length of the underlying cached flat string

The sum of these removals make the envelope of a string lighter, from 104 bytes to 56 bytes.
This proves effective to reduce spatial use and (theoretically) reduces the pressure put on the garbage collector as well as improve caching (64 bytes per line, now a string envelope should fit in completely !).

As an example, passing the JSON parser on a 100 Mio string gives a memory use of:

* Before: 945 Mio
* After: 810 Mio

Pull-Request: #2183
Reviewed-by: Jean Privat <jean@pryen.org>

7 years agotests: Added rope substring test with potential corruption if substring is mishandled
Lucas Bajolet [Tue, 28 Jun 2016 20:42:03 +0000 (16:42 -0400)]
tests: Added rope substring test with potential corruption if substring is mishandled

Signed-off-by: Lucas Bajolet <r4pass@hotmail.com>

7 years agolib/core: Removed some abusive `chars` use in lib
Lucas Bajolet [Wed, 15 Jun 2016 17:43:53 +0000 (13:43 -0400)]
lib/core: Removed some abusive `chars` use in lib

Signed-off-by: Lucas Bajolet <r4pass@hotmail.com>

7 years agolib: Update mpi to support new buffer API
Lucas Bajolet [Mon, 13 Jun 2016 19:34:38 +0000 (15:34 -0400)]
lib: Update mpi to support new buffer API

Signed-off-by: Lucas Bajolet <r4pass@hotmail.com>

7 years agolib/core: Made more attributes fun since they are not used frequently
Lucas Bajolet [Mon, 13 Jun 2016 18:02:37 +0000 (14:02 -0400)]
lib/core: Made more attributes fun since they are not used frequently

Signed-off-by: Lucas Bajolet <r4pass@hotmail.com>

7 years agoMerge: math: Intro `Comparable::clamp`
Jean Privat [Mon, 27 Jun 2016 21:58:42 +0000 (17:58 -0400)]
Merge: math: Intro `Comparable::clamp`

The `clamp` service restricts a value within a given range. It is a common service in GLSL and it is especially useful for games. Even though the alternative is short: `x = x.min(1.0).max(0.0)`, it is quite confusing and the simple `x = x.clamp(0.0, 1.0)` is easier to read.

Pull-Request: #2207
Reviewed-by: Jean Privat <jean@pryen.org>
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>

7 years agoMerge: app.nit: intro `Text::open_in_browser` and example for the UI API
Jean Privat [Mon, 27 Jun 2016 21:58:40 +0000 (17:58 -0400)]
Merge: app.nit: intro `Text::open_in_browser` and example for the UI API

This PR intro a service to open a URL using the platform default browser, and an example for the UI API. The example uses most of the available controls, multiple windows and the new `open_in_browser` feature.

The changes to `core::exec` are updates for compatibility with `Text`, and some minor improvements to its doc.

Pull-Request: #2206
Reviewed-by: Jean Privat <jean@pryen.org>

7 years agoMerge: gamnit: intro selection services using pixel picking
Jean Privat [Mon, 27 Jun 2016 21:58:29 +0000 (17:58 -0400)]
Merge: gamnit: intro selection services using pixel picking

Intro the selection services for gamnit. It uses a simple color picking algorithm, drawing all the actors to the buffer, each with a unique color used to identify which actor is visible at any pixel.

This algorithm is slow, but it works out of the box with any program. It is recommended for the clients to implement their own optimized alternative adapted to their program for better performances.

The changes to the OpenGL ES wrapper let us use glGet* functions that return a vector of values.
The use of an offset may require more than one call to get the full values, but it's quite simple.

In the future, it should be extended with support for the sprites of the _flat_ API.

Pull-Request: #2205
Reviewed-by: Jean Privat <jean@pryen.org>

7 years agoMerge: gamnit & model_viewer: use full model dimensions and show many custom models
Jean Privat [Mon, 27 Jun 2016 21:58:27 +0000 (17:58 -0400)]
Merge: gamnit & model_viewer: use full model dimensions and show many custom models

This PR improves gamnit with new attributes on `Model`: `center, dimensions, min & max`, and a rewrite of the same services on `Mesh`. These are used to better center the model in model_viewer.

model_viewer has also been improved with support for loading many custom models, and fixes to the VR variant.

Pull-Request: #2204
Reviewed-by: Jean Privat <jean@pryen.org>

7 years agoMerge: Filter isa adaptation
Jean Privat [Mon, 27 Jun 2016 21:58:24 +0000 (17:58 -0400)]
Merge: Filter isa adaptation

`isa` used to always adapt a local variable, even if there was strict information loss (a warning was shown but the adaptation was effective).

This caused issues for the adaptive typing system since there was no way to retrieve the original type information.

~~~nit
var a: A
a = new B
# a is now a B
if a isa A then
   # warning, but a is now a A
else
  # nothing here, so a is still a B
end
# merge type information of both branches: a isa A or B, thus a isa A
~~~

The change is now that `a isa A` still cause a warning but not more do the adaptation.
Thus in the *then* branch, `a` is still a `B`.
Thus in the merge at the end of the `if`, `a` remains a `B`.

close #2202

Pull-Request: #2203
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>

7 years agoapp.nit: intro example for app::ui
Alexis Laferrière [Thu, 23 Jun 2016 22:05:43 +0000 (18:05 -0400)]
app.nit: intro example for app::ui

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

7 years agoandroid, ios & linux: implement `open_in_browser`
Alexis Laferrière [Thu, 23 Jun 2016 16:13:42 +0000 (12:13 -0400)]
android, ios & linux: implement `open_in_browser`

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

7 years agoapp.nit: intro `Text::open_in_browser`
Alexis Laferrière [Thu, 23 Jun 2016 16:12:58 +0000 (12:12 -0400)]
app.nit: intro `Text::open_in_browser`

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

7 years agoapp.nit: use a ListLayout in http_request example, it looks better on mobile
Alexis Laferrière [Sun, 26 Jun 2016 15:28:51 +0000 (11:28 -0400)]
app.nit: use a ListLayout in http_request example, it looks better on mobile

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

7 years agoapp.nit: add metadata to http_request example for mobile versions
Alexis Laferrière [Thu, 23 Jun 2016 16:03:34 +0000 (12:03 -0400)]
app.nit: add metadata to http_request example for mobile versions

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

7 years agocontrib: update games to use clamp
Alexis Laferrière [Mon, 27 Jun 2016 13:25:44 +0000 (09:25 -0400)]
contrib: update games to use clamp

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

7 years agolib/core/math: intro clamp
Alexis Laferrière [Mon, 27 Jun 2016 02:36:14 +0000 (22:36 -0400)]
lib/core/math: intro clamp

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

7 years agolib/core/exec: improve doc a bin and clean up some commented code
Alexis Laferrière [Fri, 24 Jun 2016 01:09:29 +0000 (21:09 -0400)]
lib/core/exec: improve doc a bin and clean up some commented code

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

7 years agolib/core/exec: accept Text instead of String
Alexis Laferrière [Thu, 23 Jun 2016 16:06:45 +0000 (12:06 -0400)]
lib/core/exec: accept Text instead of String

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

7 years agogamnit: intro selection services, `visible_at` and `visible_in_center`
Alexis Laferrière [Fri, 20 May 2016 18:57:40 +0000 (14:57 -0400)]
gamnit: intro selection services, `visible_at` and `visible_in_center`

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

7 years agogamnit: update users of glGet* functions
Alexis Laferrière [Sun, 26 Jun 2016 13:00:22 +0000 (09:00 -0400)]
gamnit: update users of glGet* functions

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

7 years agoglesv2: intro parameter `offset` to glGet* function wrappers
Alexis Laferrière [Sun, 26 Jun 2016 12:57:34 +0000 (08:57 -0400)]
glesv2: intro parameter `offset` to glGet* function wrappers

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

7 years agomodel_viewer: use a permalink to reach the old cardboard.jar
Alexis Laferrière [Sat, 25 Jun 2016 23:46:11 +0000 (19:46 -0400)]
model_viewer: use a permalink to reach the old cardboard.jar

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>