doc • release • 3.2.0

Gambas 3.2.0

What's new

This new release fixes more than 100 bugs and adds more than 100 new features.

All Gambas 3.x versions will be backward-compatible, i.e. a program written in Gambas 3.0 version will be able to run unchanged with any Gambas 3.x version. But the contrary is false: a program written with a specific Gambas 3.x version will not run with an older version.

The main new feature of Gambas 3.2 is the new just-in-time compiler made by Emil Lenngren, that can make a function or an entire class up to 100 times faster.

Otherwise the other main changes are:

  • gb.gtk.opengl is a new component that allows to use OpenGL in GTK+ applications.

  • gb.media is a new component based on GStreamer.

  • gb.ncurses is a new component based on the ncurses library made by Tobias Boege.

  • gb.xml has been entirely rewritten from scratch by Adrien Prokopowicz.

  • gb.xml.html is a new HTML generator component based on gb.xml.

  • The IDE now has an integrated profiler.

  • The IDE packager is more robust.

  • SidePanel now can be transparent.

  • New ON GOTO and ON GOSUB instructions.

  • New Base64() and UnBase64() conversion functions.

  • A new real-time Mandelbrot fractal generator that uses the JIT compiler.

  • Almost all gb.gtk controls are now transparent as in gb.qt4.

  • A new MediaPlayer example based on the gb.media component.

Enjoy it!

ChangeLog

[CONFIGURATION]
* BUG: Fix component TEMPLATE directory.
* BUG: Adapt to the verbosity output when a pkg-config component isn't
  available.
* NEW: Support for new gb.xml component family.
* NEW: Update *.component files to the new format.
* NEW: Replace the old "INCLUDES" directive by "xxx_CPPFLAGS" in all
  Makefile.am files.
* NEW: Print disabled components individually.
* NEW: Add more verbosity about the failing pkg-config requirement.

[DEVELOPMENT ENVIRONMENT]
* BUG: Fix a possible crash when refreshing project tree inheritance.
* BUG: Correctly import translations whose original string begins or ends
  with spaces.
* BUG: Correctly show error tooltip in splitted editors.
* BUG: Do not fail when a library is not found.
* BUG: The packager now generates correct dependencies on libraries whose
  major and minor version are both zero.
* BUG: Fix dependencies on libraries in the packager.
* BUG: When creating dependencies on libraries, the packager now takes into
  account if the library package name is prefixed with the vendor name.
* BUG: Now always use the release version number in the package name,
  otherwise the Debian/Ubuntu packager cannot compare versions reliably.
* BUG: Fix XML component names.
* BUG: Do not handle Data event of controls in the form editor, because the
  signature of the event handler depends on the control type.
* BUG: Packager: Replace spaces with underscores when using the vendor name
  as package name prefix.
* BUG: Packager: Fix "make uninstall" in autoconf packages.
* BUG: Don't crash if there is a compilation error in a form file.
* BUG: Autotools packager "make uninstall" should be definitely fixed.
* BUG: The report border dialog works well now.
* BUG: Do not display a spurious message anymore when clicking in a void
  part of the project tree view with the right mouse button.
* BUG: CFlt() is now replaced by CFloat() when converting a Gambas 2
  project.
* BUG: Toolbars and popup-menus are correctly updated at first load form
  text, source and form editors.
* BUG: Do not show or hide toolbars buttons outside of the toolbar
  'Configure' event.
* BUG: Fix generation of action and toolbar information so that the IDE
  does not crash anymore when having no custom toolbar definition.
* BUG: Autotools packager now respects the vendor name prefix option.
* NEW: Support for new gb.xml component family.
* NEW: Add a "project type" option in the project properties dialog. It
  makes the difference between a normal project, a library project, and a
  component project.
* NEW: The packager takes the project type into account. A library and a
  component do not install a *.desktop file, has no icon and has no menu
  entry. But a library has the same package name than a normal project.
* NEW: Define the 'Exec' preprocessor constant when making an executable.
* NEW: Add some debugging options directly in the 'Debug' menu.
* NEW: A new option to activate the profiling of the debugged project.
* NEW: Profiling windows.
* NEW: Adapt GUI to the new SidePanel look.
* NEW: Handle the FAST keyword in function declaration.
* NEW: ReportLabel and ReportTextLabel show a blue dashed border, so they
  are more easy to find.
* NEW: Add global packaging identity preferences.
* NEW: Do not set the APPMENU_DISPLAY_BOTH environmental variable anymore.
  It seems to work now.
* NEW: The gb.form.stock component now can be explicitely checked in the
  project property dialog.
* NEW: The IDE now depends on gb.form.stock.
* OPT: Use Stream.Lines enumeration instead of LINE INPUT. It is a little bit
  faster.
* OPT: Use JIT compiler to speed-up the loading of profile files.
* OPT: Use Application.Busy earlier when opening a project.

[WIKI CGI SCRIPT]
* BUG: Handle public variables like properties.
* BUG: Fix links with explicit version.
* NEW: Add "@since" special keyword.

[EXAMPLES]
* BUG: MediaPlayer: Forgot to add a picture.
* NEW: A new PhotoTouch example I made so that my father can edit its photo
  with a simple software.
* NEW: Move Sound and Video examples to a new Multimedia folder.
* NEW: Remove Sound and Video folders.
* NEW: New MediaPlayer example based on the new gb.media GStreamer
  component.
* NEW: A new Fractal example that draws the Mandelbrot set with an option
  to enable just-in-time compilation.
* OPT: Little optimization in GameOfLife example.

[INTERPRETER]
* BUG: Freeing any Stream object now automatically closes it.
* BUG: Stream.ReadLine() with no second argument does not crash anymore.
* BUG: gb.MediumTime does not try to use AM/PM if AM/PM is not supported
  by the current language.
* BUG: Remove the use and the definition of long double mathematic
  functions. They are not used anymore.
* BUG: Ignore non-significant decimal digits when converting a String to a
  Float. In other words, now 2.0 = 2.
* BUG: Fix precision in both string to Float and Float to string
  conversions.
* BUG: The byte position to utf-8 position caching routine now works in all
  cases.
* BUG: Allow to override native array classes without crashing.
* BUG: Fix a crash when using 'gb.Like' comparison flag.
* BUG: Fix a crash in the &/ operator.
* BUG: Fix a crash that could occur if a error is raised inside an event
  handler.
* BUG: Fix a crash that could occur if a error is raised inside a signal
  callback.
* BUG: Html$() works correctly again.
* BUG: GP must be NULL for new void stack frames.
* BUG: Fix IIf() function when its arguments have different types.
* BUG: Enumerating the Param class does not leak memory in some cases
  anymore.
* BUG: Fix use of static classes as extern function argument.
* BUG: Fix class loading so that circular dependencies between class
  initialization is possible.
* BUG: "Read ... As String"  now correctly returns a void string instead
  of NULL, if it reads an empty string.
* BUG: If there is an error, wake up the debugger on the current stack
  position. Return to the last encountered line break after, not before.
* BUG: Correctly load the "npvar" field for Gambas functions.
* BUG: Add a check to not create array classes when reimplementing or
  inheriting native array classes. Hope that check is not wrong...
* BUG: Correctly release or keep the return value of a function when
  destructors are called during epilogue.
* BUG: Fix Format$() when using "AM/PM" just after a date formatting
  character.
* BUG: Fix race conditions in signals management routines.
* NEW: Do not raise an error when a file path cannot be converted to the
  local charset. Just do not make the conversion.
* NEW: Change the 'main' hook syntax. Add a macro to call the previous
  'main' hook, so that several hooks can be declared.
* NEW: Rename all API related to components, and fix components using them.
* NEW: New signal API that allows to catch signals from the event loop.
* NEW: Support for profiling.
* NEW: gb.ShortDate and gb.MediumDate predefined date formats now always
  display years with four digits.
* NEW: Base64() is a new function to encode a string in Base64.
* NEW: UnBase64() is a new function to decode a Base64 string.
* NEW: ON ... GOTO and ON ... GOSUB instructions.
* NEW: System.Profile is a new property to deactivate the instruction
  profiling at runtime. Function calls keep being profiled.
* NEW: Switch to JIT compiler if available, and make it able to talk to
  gb.jit.
* NEW: Support for variable number of arguments in extern functions.
* NEW: Exported classes are now completely initialized at startup. It may
  break some things...
* NEW: Always put a space between international currency symbol and amount
  when formatting a currency.
* OPT: Make API arrays constant.
* OPT: Don't allocate array for jit functions if not necessary.

[COMPILER]
* BUG: Display the right line number if there was a parser error inside a
  form class file.
* BUG: Fix CASE LIKE syntax. Now all CASE LIKE arguments are compared with
  the LIKE operator. Not just the first one.
* BUG: The token following a CONST keyword is now assumed to always be an
  identifier.
* BUG: ByRef keyword is now correctly forbidden in extern functions now.
* BUG: '...' syntax is now correctly forbidden in event description.
* BUG: Make the internal "$load" form method private. Why was it public?
* BUG: Write correct disassembly for PUSH INTEGER.
* NEW: New '-x' option to define the 'Exec' preprocessor constant.
* NEW: Base64() is a new function to encode a string in Base64.
* NEW: UnBase64() is a new function to decode a Base64 string.
* NEW: ON ... GOTO and ON ... GOSUB instructions.
* NEW: 'Fast' keyword means the class should be JIT-compiled.
* NEW: Each function can be declared individually FAST. The keyword must be
  the first one on the line.
* NEW: Support for variable number of arguments in extern functions.

[SCRIPTER]
* BUG: Do not crash when compiling a program again.

[GB.COMPRESS]
* BUG: Fix internal structure of Uncompress object.

[GB.DB.FORM]
* BUG: Fix use of old GridView property in DataComboView.

[GB.DEBUG]
* NEW: Support for profiling.
* NEW: GB_PROFILE_MAX environment variable now can take the maximum size of
  a profile file in megabytes. The default value is 512 Mb. The minimum
  value is 128 Mb, and the maximum value is 4096 Mb.

[GB.DRAW]
* BUG: Fix Draw.Picture() when using the transformation matrix and not
  specifying height or width.

[GB.EVAL]
* BUG: Highlight.TextAfter returns the code as it should be displayed, even
  if the Rewrite argument of Highlight.Analyze() is FALSE.
* NEW: Handle the FAST keyword in function declaration.

[GB.FORM]
* BUG: GridView.SelectAll() now works correctly.
* BUG: The GridView headers now use the Button foreground color so that
  they are visible with a dark color theme.
* BUG: The last column of a GridView with AutoResize set is not frozen
  anymore when the number of columns grows.
* BUG: GridView: The WordWrap property is now correctly taken into account
  for cells having normal text.
* BUG: IconView: Item text is ellipsized without printing GTK+ warnings
  anymore.
* BUG: Fix a crash when changing the IconPanel Count property.
* BUG: GridView.AutoResize property now works correctly.
* BUG: GridView: Automatic column widths now take the sorted indicator into
  account.
* BUG: Movement keys are not eaten by the GridView anymore.
* NEW: IconView.Key is now writable, so that we can define the current
  item.
* NEW: GridView row and column width now can be set to zero so that they
  are completely hidden.
* NEW: GridView now raises a Sort event when the sort properties are
  changed.
* NEW: GridView: Add a Scroll() method.
* NEW: FileChooser now can handle *.tgz archives.
* NEW: GridView: If the Grid property is FALSE, do not draw row and column
  separators.
* NEW: Hidden SidePanel now has two toggle buttons that appear when the
  mouse moves on the two ends of the hidden panel.
* NEW: SidePanel has a new Transparent property to define if the SidePanel
  has a border handle or not. By default, SidePanel are not transparent as
  before.
* NEW: GridView: Setting the height of a row to -1 now makes it fit its
  contents.
* NEW: FileChooser and DirChooser: It is now possible to move up one
  directory even if we are on the root of the current bookmark.
* NEW: ButtonBox use the new Style.BoxFrameWidth and Style.BoxFrameHeight
  properties to draw itself.
* NEW: Ignore errors when loading the gb.form.stock component. Display a
  warning message on the standard error output and use a dummy icon
  instead.
* NEW: SidePanel: Add a popup menu to show or hide the panel, and to toggle
  the panel transparency.
* NEW: SidePanel: Transparency is stored in SidePanel settings now.

[GB.FORM.MDI]
* NEW: Configured toolbars are drawn with a red frame.
* NEW: Do not disable toolbars when they are configured. Otherwise drag &
  drop does not work with gb.gtk.
* NEW: Toolbar: You can add a space element between buttons now.
* NEW: Toolbar: New layout for the configuration dialog.

[GB.FORM.STOCK]
* BUG: Add the 'earth' icon in the stock.
* NEW: Some icons have been updated.

[GB.GTK]
* BUG: Fix timer management so that it is compatible with the GB.Every()
  interpreter API.
* BUG: Utility windows are make transient the same way as in gb.qt4.
* BUG: Use g_object_unref() instead of rsvg_handle_free() now.
* BUG: ScrollBars are correctly initalized now.
* BUG: Container.Find() does not take hidden controls into account anymore.
* BUG: Window state (Minimized, Maximized and FullScreen properties) is now
  accurately returned.
* BUG: Fix ScreenX and ScreenY properties for Window controls.
* BUG: Windows with a menu bar work correctly again.
* BUG: Fix the Font.Copy() method.
* BUG: Automatic pointer grab on mouse events now do not confuse TreeView
  and ColumnView controls anymore.
* BUG: Fix cached drawing areas.
* BUG: Fix mouse event management for controls having scrollbars.
* BUG: Fix cursor management for DrawingArea.
* BUG: Screen geometry and available geometry is now computed the same way
  as in gb.qt4. In other words, it is screen based, and does not crash
  with Xinerama anymore.
* BUG: 'Default' or 'Cancel' buttons now take the focus when they are
  activated by the ENTER key.
* BUG: Remove warnings displayed by the Control Raise() and Lower()
  methods.
* BUG: Draw.Style methods now are correctly clipped.
* BUG: Fix drag & drop management, so that it behaves as in gb.qt4 as much
  as possible. At the moment, disable controls cannot be a drop target,
  contrary to gb.qt4.
* BUG: The DrawingArea draw event is raised before other internal drawing
  events now, not after.
* BUG: Workaround GTK+ limitations and make containers clip their children
  like in gb.qt4. Not perfect yet, as Enter and Leave events may not take
  the clipping into account, and some GTK+ widgets like TextBox cannot be
  clipped as they still have their own X11 window (why???).
* BUG: Splitter children coordinates are accurate now.
* BUG: Control.Hovered now works the same way as in gb.qt4.
* NEW: Allows multiple 'main' hooks.
* NEW: A new interface to allow gb.gtk.opengl to create its GLArea widget.
* NEW: Make GTK+ controls borderless, so that they are "transparent" like
  gb.qt4 controls. The PhotoTouch example now works correctly with gb.gtk,
  the brightness dialog excepted.
* NEW: Implement the _NET_MOVERESIZE_WINDOW way of moving windows.
* NEW: MovieBox is not opaque anymore.
* NEW: Desktop.HasSystemTray is a new property that returns if a system
  tray has been detected.
* NEW: Profile time spent waiting for events.
* NEW: Draw.Tile() does not transform pixbufs into a pixmaps anymore.
* NEW: Style.BoxFrameWidth and Style.BoxFrameHeight are two new properties
  that replace Style.TextBoxFrameWidth.
* NEW: Mouse.Forward is a new property that returns if Mouse.Delta is
  positive.
* NEW: Mouse.Inside() is a new method that returns if the mouse cursor is
  inside a specific control.
* OPT: Optimize GTK+ widget -> gb.gtk control lookup everywhere.

[GB.GTK.OPENGL]
* NEW: New component that allows to do OpenGL with GTK+. It is based on the
  gtkglext library.

[GB.GUI.OPENGL]
* NEW: That new switcher component chooses between gb.gtk.opengl and
  gb.qt4.opengl according to the current desktop in use.

[GB.IMAGE]
* NEW: Image.Opacity() is a new method that changes the opacity of an
  image.

[GB.JIT]
* NEW: JIT Compiler.
* NEW: If GB_JIT environment variable is set to "info", LLVM code dumps
  will be printed to stderr.
* NEW: If LLVM version is lesser than 3.1, a warning message is printed.
  Normally, a crash should occur just after. :-)

[GB.LIBXML]
* NEW: Rename the gb.xml component as gb.libxml.
* NEW: Remove gb.libxml.xslt component. It is unneeded.
* NEW: Remove gb.libxml.rpc component. It is unneeded.
* NEW: Keep gb.libxml only, for compatibility reasons, as an equivalent of
  gb.xml based on libxml.

[GB.MEDIA]
* NEW: New multimedia component based on GStreamer.

[GB.NCURSES]
* NEW: New component based on the NCurses library made by Tobias Boege.

[GB.NET]
* BUG: ServerSocket: Do not use the static string returned by inet_ntoa()
  for the Connection event argument. It can be erased by ohter calls to
  inet_ntoa()!

[GB.NET.CURL]
* BUG: Initialize the curl library correctly now.

[GB.OPENGL]
* BUG: Initialize GLEW once.

[GB.PDF]
* BUG: Fix building with poppler-0.20.x

[GB.QT4]
* BUG: Fix first drawing of a cached DrawingArea.
* BUG: Fix Foreground property for TreeView, ListView, ColumnView and
  ListBox controls.
* BUG: Fix Background property of ListBox,ListView,TreeView and ColumnView
  controls.
* BUG: Fix Makefile.am.
* BUG: ComboBox background color is correctly handled now.
* BUG: If there is no system tray, showing a TrayIcon now raises an error
  instead of crashing.
* BUG: Using Draw on a DrawingArea correctly initializes the drawing
  properties from the control colors.
* BUG: Background color of cached DrawingArea is correctly initialized now.
* BUG: Control.Hovered does no computation anymore, it returns an internal
  flag set when the Enter event is raised, and unset when the Leave event
  is raised.
* BUG: 'Default' or 'Cancel' buttons now take the focus when they are
  activated by the ENTER key.
* BUG: Setting the Text property of a TextArea control takes the foreground
  color into account now.
* BUG: Postpone enter and leave events when a popup is displayed, like in
  gb.gtk.
* NEW: Allows multiple 'main' hooks.
* NEW: Desktop.HasSystemTray is a new property that returns if a system
  tray has been detected.
* NEW: Profile time spent waiting for events.
* NEW: Style.BoxFrameWidth and Style.BoxFrameHeight are two new properties
  that replace Style.TextBoxFrameWidth.
* NEW: Mouse.Forward is a new property that returns if Mouse.Delta is
  positive.
* NEW: Mouse.Inside() is a new method that returns if the mouse cursor is
  inside a specific control.
* OPT: A little optimization when using Draw.Begin() on a cached
  DrawingArea.

[GB.QT4.EXT]
* NEW: Editor: Add a ScrollBar property.
* NEW: Editor: Add ScrollX and ScrollY properties.
* NEW: Editor: Add a Scroll method.
* NEW: Procedures are folded or unfolded on mouse button release now, not
  on mouse button press.
* NEW: Editor: Line numbers are not drawn behind a procedure separator.
* NEW: Editor.NoFolding is a new flag to disable procedure folding support.
* NEW: Editor.LineOffset is a new property to define the line number just
  before the first displayed line (zero by default).

[GB.QT4.OPENGL]
* NEW: Remove the Update() and the Select() methods.

[GB.REPORT]
* OPT: Remove an unused function.

[GB.SETTINGS]
* NEW: Setting.Clear() without arguments now entirely clears all settings.

[GB.SIGNAL]
* NEW: Call previous signal handlers automatically when a specific signal
  is catched.

[GB.XML]
* NEW: New XML component written from scratch by Adrien Prokopowicz.

[GB.XML.HTML]
* NEW: New HTML component based on gb.xml written from scratch by Adrien
  Prokopowicz.

[GB.XML.RPC]
* BUG: Fix component requirements.

[GB.XML.XSLT]
* NEW: When output document is invalid, shows the error message on the
  standard error output.
* BUG: Solved an 'undefined symbol' error.
* BUG: XSLT document parsing now correctly works.
* BUG: No more excessive line-breaks and spaces added to the output
  document.

Requirements

To compile Gambas, you must install the following libraries on your system :

Component

Requirements
Compilation gcc g++ automake autoconf libtool > 2.4
(See requirements on autotools versions below)
Interpreter libffi
gb.compress.bzlib2 libbz2.so
gb.compress.zlib libz.so
gb.cairo cairo
gb.crypt libcrypt.so
gb.db.mysql libmysqlclient.so, libz.so
gb.db.odbc libodbc.so
gb.db.postgresql libpq.so
gb.db.sqlite2 libsqlite.so
gb.db.sqlite3 libsqlite3.so
gb.desktop libXtst.so
gb.gsl libgsl.so libgslcblas.so
gb.gtk All GTK+ libraries >= 2.14 librsvg2.so cairo
gb.image.io gdk-pixbuf
gb.image.imlib imlib
gb.net.curl libcurl.so
gb.opengl gb.opengl.glsl libGL.so, libGLEW.so
gb.opengl.glu libGLU.so
gb.pcre libpcre.so
gb.pdf libpoppler.so
gb.qt4 gb.qt4.ext gb.qt4.opengl gb.qt4.webkit All qt 4 libraries >= Qt 4.5
gb.sdl libSDL.so, libSDL_ttf.so, libGL.so, libGLEW.so
gb.sdl.sound libSDL.so, libSDL_mixer.so
gb.v4l libjpeg.so, libpng.so,Video4Linux >= 2.0
gb.xml libxml-2.0
gb.xml.xslt libxslt

And do not forget to install all related development packages!

Try to always use a recent version of these libraries.

In order to compile the development environment, you have to compile the following components:

You must have the right to write to /tmp, otherwise Gambas will not work.

This package was done with the following versions of GNU tools on Ubuntu 11.10:

  • automake 1.11.1

  • autoconf 2.68

  • libtool 2.4

Compiling with older version may or may not work!

Compilation & Installation

Check installation

First, check that you installed all the needed libraries, and especially all the development packages.

Do not forget to look at the Compilation & Installation page. Maybe you will find important information specific to your distribution.

Source package configuration

When you are sure that everything is installed, type the following magic sentences in a shell.

'$' represents your shell prompt, and '...' are the messages printed during the configuration and compilation.

First, type that to create the configuration scripts.

$ ./reconf-all

Then type that to analyze the current system and configure the package:

$ ./configure -C
...

If a library or a development package is missing, then you will be warned that some components are disabled.

There are more 'configure' specific explanations in the INSTALL file located in the top-level source directory. I invite you to read them.

Compilation

If everything is configured without error, then run this command to compile the program:

$ make
...

Installation

If everything compiles without error, then enter this command to install everything:

You must be root to install Gambas on your system.

$ su -c "make install"
Password: <Type the root password here>
...

or

$ sudo make install
Password: <Type your password here>
...

Troubleshooting

If you did several successive compilations, after having updated the source from the subversion repository for example, and if something fails during all this process, you can try to "reconfigure" the configuration scripts by typing the following command:

$ ./reconf-all

Then you can run ./configure -C again

If it does not work, I need to know what happened exactly. To do so, type the following command :

$ ( ./configure -C; make; make install ) > output.txt 2>&1

And send me the file "output.txt" by mail, with every other detail about your computer and your distribution you find useful.

Running Gambas

If everything was fine, type "gambas3" to run the development environment.

Enjoy it !

See also