Libagar Versions Save

Cross-Platform GUI Toolkit (stable)

v1.7.0

1 year ago

Added

  • sdl2fb: New driver for SDL 2.0 (single-window; frame-buffer mode).
  • sdl2gl: New driver for SDL 2.0 (single-window; OpenGL mode).
  • sdl2mw: New driver for SDL 2.0 (multi-window; OpenGL mode).
  • glx: Added support for X Input Methods. Thanks sr20det!
  • AG_Button: New option AG_BUTTON_CROP (crop label surface to fit contents). Useful for condensing or removing typographical spacings so that individual glyphs (for example "Geometrical Shapes") can be made to align precisely.
  • AG_Color: Added compression / decompression macros for 4/12/24/48-bit values.
  • AG_Driver: New operation: setMouseAutoCapture (enable, disable or reset mouse auto-capture on button-down).
  • AG_DriverSw: New option clampOnResize (clamp active Agar windows against new display size).
  • AG_Error: New function AG_Debug2() (output debug message when debug level is >= 2).
  • AG_FontBf: New bitmap font engine for the .agbf font format.
  • AG_Menu: Implemented keyboard shortcuts. Added AG_MENU_NO_BOOL_MSG and AG_MENU_FAST_BOOL_MSG options.
  • AG_Menu: Improved the performance of the AG_MenuView renderer by caching state-dependent opaque labels (embedding any icons), so blending is no longer required by draw(). Improved appearance of AG_MenuView.
  • AG_Object: Introduce numerical class IDs and *_ISA() macros.
  • AG_Object: New function AG_ObjectFreeChildrenOfType().
  • AG_Radio: New HOMOGENOUS option to divide space equally between items. Thanks Stephen!
  • AG_StyleSheet: New CSS selectors E > F. Child widgets are now addressable by instance name (e.g., AG_Combo > "trigger") or class name (e.g., AG_Combo > AG_Button).
  • AG_StyleSheet: New CSS selector conditionals width, height and zoom. Widgets can be styled based on their current geometry or zoom level.
  • AG_Surface: New field Lpadding (scaline start padding). Allows fast cropping of lines from the left.
  • AG_Surface: Make it possible to increment the pixels pointer to fast crop lines from the top. Added pixelsBase pointer.
  • AG_Surface: Added standard palettes for 1/2/4/8-bit modes. New Indexed surfaces are now initialized with a standard palette by default.
  • AG_Surface: Added support for 40- and 48-bpp surfaces.
  • AG_Surface: Introduce optimized blitter tables.
  • AG_Surface: New function AG_PixelFormatMaximum() to return the maximum possible pixel value for a given format.
  • AG_Surface: New function AG_SurfaceBlend8() for blending 1/2/4/8-bpp surfaces against an AG_Color using the closest approximation available.
  • AG_Surface: Embed 4 general-purpose 16-bit guides. Guides are useful for typography, graphics and other applications.
  • AG_Surface: Make the AG_SURFACE_TRACE flag useful for tracing surface operations such as blits, copies / conversions and mapping to widgets (needs --enable-debug-surfaces).
  • AG_Text: Expand the list of standard font sizes to 32 sizes. Added fractional sizes between 7.0 and 13.0.
  • AG_Text: Expanded font adjustments to include subpixel alignment corrections for all 32 standard sizes. The table now covers over 150 popular open-source fonts. Adjustments allow different fonts to align with pixel-perfect accuracy.
  • AG_Text: Added OS/2 metrics and Unicode range information to the AG_Font structure.
  • AG_Text: Utilize OS/2 metrics typoAscender and typoDescender where available.
  • AG_Text: New macros AGSI_IS_*(c) for testing whether a character lies within a given Unicode range.
  • AG_Text: New macros AG_FONT_HAS_*() for testing the Unicode coverage of a font.
  • AG_Text: New structure AG_UnicodeRange and full table of Unicode ranges agUnicodeRanges[].
  • AG_Text: New table agUnicodeRangeFromOS2[] for mapping OS/2 Unicode coverage bits to indexes into agUnicodeRanges[].
  • AG_Text: New functions AG_FontGetStandardSize() and AG_FontGetStandardSizeIndex() for finding the standard point size closest to a given point size.
  • AG_Text: The surface returned by AG_TextRender() now includes Ascent information under Guide 0.
  • AG_Text: New function AG_TextRenderRTL() for rendering text right-to-left.
  • AG_Text: New function AG_FetchFontFromList() for loading the first available font from a comma-separated list.
  • AG_Text: New functions AG_FontGetStyleName() and AG_FontGetStyleByName(). Convert between the Uint and string representations of font styles (including styles, weights and width variants).
  • AG_Text: New function AG_FontGetFamilyStyles(). Return an array of AG_Font style flags describing every style, weight and width variant available in a given font's family.
  • AG_Text: New function AG_TextRenderCropped(). Crops the returned surface to fit the rendered text contents. This fast crop operation leaves the cropped (all-transparent) pixels in memory. It can be used for condensing or removing typographical spacings so that individual glyphs (for example "Geometrical Shapes") can be aligned precisely inside widget controls.
  • AG_Textbox / AG_Editable: Implement Undo/Redo functionality.
  • AG_Textbox / AG_Editable: Let AG_Textbox (and other containers) manage clipping so that text can be allowed to overflow out of the AG_Editable and out over the padding of its container widget.
  • AG_Editable: New option NO_CLIPPING to allow overflow beyond the widget's allocated area (for container widgets which implement their own clipping).
  • AG_Tlist: Draw lines to express the relationship between tree items.
  • AG_Tlist: New function AG_TlistScrollToSelection().
  • AG_Tlist: New option AG_TLIST_EXPAND_NODES. Display nodes (items with children) initially in expanded state.
  • AG_Tlist: New option AG_TLIST_NO_SCALE_ICON. Disable icon scaling when the icon width exceeds the standard width.
  • AG_Tlist: New option AG_TLIST_FIXED_HEIGHT. Don't reset the item height on "font-changed".
  • AG_Tlist: New options AG_TLIST_NO_LINES and AG_TLIST_NO_BGLINES. Disable lines connecting nodes or background lines.
  • AG_Tlist: New item flag AG_TLIST_ITEM_DISABLED. Disable the item individually (prevent selection and display in "disabled" state).
  • AG_Tlist: Improve keyboard navigation. Allow RIGHT/LEFT keys to Expand/Collapse node items.
  • AG_Event: New macro AG_EVENT_DUMP to produce a listing of argv[] arguments on the console.
  • AG_Widget: New flag AG_WIDGET_DISABLE_ON_ATTACH and functions AG_PushDisabledState() and AG_PopDisabledState. Make attached child widgets start in DISABLED mode (without raising "widget-disabled").
  • AG_Widget: New event "padding-changed". Generated by the style compiler to signal that the padding attribute of a widget has changed.
  • MAP: Introduce dynamic Map Objects with MAP_Object. Map Objects coexist with static Map elements and are embedded with the serialized MAP. Nodes refer to MAP_Object instances using an intermediate MAP_Location structure (which adds per-node flags, z-coordinate, height, layer and neighbor information). More than one MAP node may refer to a given MAP_Object.
  • MAP: New Insert Object (InsertObj) tool.
  • MAP: New functions MAP_DuplicateLocation(), MAP_NodeDelLocation(), MAP_NodeDelLocationAtIndex().
  • MAP: Added height (h) and z-coordinate (z) attributes to MAP_Item. Introduce MAP_Item classes.
  • MAP: Added Undo/Redo and History Buffer to Map Editor. New function MAP_ClearHistory().
  • MAP: Added validity tests to MAP_Node and MAP_Item.
  • MAP: Added persistent Library to the Map Editor. The pLibs pointer of MAP may be used to specify an alternate AG_Object as VFS Root for the Library. Similarly, pMaps may be used to specify an alternate VFS Root for loaded Maps.
  • agartest: New test/benchmark module surface for testing conversions and pixel/surface operations between surfaces in different modes and formats.
  • agartest: New command-line option -D (enable debugging).
  • agartest: New installer install-agartest.exe for Windows.
  • Provide copies of the OFL as separate files (OFL11.txt and LICENSE.ofl).
  • Install a copy of the generated Makefile.config as ${DATADIR}/agar.mk.
  • Install a copy of the generated configure.lua as ${DATADIR}/agar.lua.
  • Added DEBUG_MOUSE build option (debug delivery of mouse events to widgets).
  • Added Vim syntax files (under the syntax/ directory) complete with all types and constants.
  • New bitmap fonts: Agar Minimal and Agar Ideograms.

Removed

  • AG_Surface: Removed the fn argument from the AG_SurfaceBlend*() family of functions. Different blending arithmetic can be implemented using separate functions.
  • AG_Object: Removed AG_ObjectPage{In,Out}() and unused flags AG_OBJECT_FLOATING_VARS, AG_OBJECT_NON_PERSISTENT, AG_OBJECT_RESIDENT, AG_OBJECT_REOPEN_ONLOAD, AG_OBJECT_REMAIN_DATA and AG_OBJECT_CHLD_AUTOSAVE.
  • AG_Text: Removed AG_UnusedFont() and the reference counter in AG_Font.

Changed

  • Ctrl + Mouse Wheel may now be used to change the zoom level on a window.
  • Updated the build system. BSDBuild configure scripts are smaller and no longer emit unnecessary defines such as foo_cflags.h for dependent libraries. Such definitions are always available from ${DATADIR}/agar.mk.
  • Don't install headers from libraries disabled from the build (by --disable-foo).
  • AG_Color: Handle rgb16() format in AG_ColorFromString().
  • AG_Combo: Make combo expansion windows detachable and resizable.
  • AG_Combo: Make sub-elements style-addressable as input and trigger.
  • AG_FontSelector: Add Unicode range information and more metrics under the "Metrics" tab.
  • AG_FontSelector: The preview function now includes text in different scripts. It is now possible to set a user-defined preview function.
  • AG_Object: Improve the object validity test by using a pseudo-random signature generated on initialization. Make validity and class-membership testing possible outside of Debug builds.
  • AG_Object: Event argument accessor macros of the form AG_CONST_FOO_PTR() are now defined as AG_cFOO_PTR().
  • AG_Object: In AG_ObjectGenName(), convert the prefix (class name) to lowercase in its entirety.
  • AG_Object: With the AG_OBJECT_NAME_ONATTACH option, do not generate a name if the object has a non-empty name set.
  • AG_Printf: When formatting floating-point, handle positive and negative infinity.
  • AG_Surface: Replaced the PixelsPerByte field by PixelsPerByteShift to allow for more efficient arithmetic when handling < 8-bpp surfaces.
  • AG_Surface: In AG_SurfaceCopy(), handle 8-bpp copies to same-format surfaces using block copy.
  • AG_Surface: In AG_SurfaceCopy(), add an optimized case for sources surfaces in <= 8-bpp.
  • AG_Surface: In AG_SurfaceCopy(), add an optimized case for grayscale source surfaces.
  • AG_Tlist: Improved appearance and typography fixes. Improved performance of the renderer using state-dependent opaque labels to avoid the need for blending in draw().
  • AG_Tlist: Now applies the "padding" attribute on a per-item basis.
  • AG_Tlist: AG_TlistSetCompareFn() now returns a pointer to the previous compare function.
  • AG_Tlist: Make the comparison function of AG_TlistSort() ANSI-aware. Ignore SGR sequences as well as ideogram-range Unicodes.
  • AG_UCombo: Make combo expansion windows detachable and resizable.
  • AG_UCombo: Make the button style-addressable as trigger.
  • AG_Widget: In AG_WidgetSensitive(), use the window pointer to avoid an unnecessary traversal of parent objects.
  • AG_Widget: Prevent delivery of redundant "widget-shown" or "widget-hidden" events if AG_WidgetShow() and AG_WidgetHide() are called multiple times.
  • MAP: Performance improvements in threaded mode. Decoupled the memory allocation of nodes from the MAP thread in MAP_AllocNodes(). Removed redundant lock operations. Removed lock in MAP_NodeCopy().
  • MAP: Replaced MAP_NodeRemoveAll() by MAP_NodeClear(). Added fast path when clearing nodes with layer = -1.
  • MAP: MAP_NodeSwapLayers() now requires the map to be locked.

Fixed

  • Define GL_SILENCE_DEPRECATION under MacOS. Thanks Gaetan Brouilles!
  • Fixed outdated test for Cygwin. Thanks Walter!
  • Fixed compilation problem with core/dir.c under NetBSD.
  • Fixed compilation problem with core/inline_byteswap.h and core/cpuinfo.c on powerpc64. Thanks Mark Linimon!
  • Fixed double <-> long conversion warnings in math/m_sparse*.
  • wgl: Fixed a bug in cursor handling. When showing a window initially, perform size allocation after having initialized the cursors so that the initial cursor-change areas are correctly established.
  • install-sdk.exe now installs include files in include\x86 or include\x64.
  • AG_Console: Garbage-collect generated textures more efficiently.
  • AG_HSVPal: Fixed color not updating on agcolor binding change.
  • AG_Menu: When an AG_MenuView is detached, immediately invalidate the view pointers of its AG_MenuItem.
  • AG_Menu: Fixed styling errors. Honor the #disabled state.
  • AG_Numerical: Fixed styling errors. Use AG_BUTTON_CROP to align the arrows. Make the buttons style-addressable. Thanks Kristof!
  • AG_Surface: Fixed loading of PNG files in 16bpc format (the surface was not being initialized with the correct 64-bit masks). Fix transparency to colorkey translation when loading a PNG in an Indexed format.
  • AG_Surface: Fixed conversion between Indexed/Grayscale and other modes.
  • AG_Surface: Fixed conversion between 64-bpp and other modes.
  • AG_Surface: Honor surface padding in AG_SurfaceFromPixelsRGB() and AG_SurfaceFromPixelsRGBA().
  • AG_Surface: AG_MapPixelIndexed() now uses the Euclidean distance method.
  • AG_Table: Fixed an off-by-one which caused a missing cursor-change area for column resize.
  • AG_Text: AG_SetDefaultFont() now takes effect immediately.
  • AG_Textbox, AG_Editable and AG_Console: Fix horizontal scrolling (Shift + Mouse Wheel) behavior.
  • AG_Titlebar: Use AG_BUTTON_CROP to align the window button labels precisely.
  • AG_Widget: Fixed non-delivery of mouse-button-down events to hidden and subsequently re-shown widgets (e.g., widgets under a Notebook). Thanks Walter!
  • AG_Widget: Deliver widget-hidden when detaching a widget from a visible window.
  • AG_Widget: In AG_WidgetSizeAlloc(), set the UNDERSIZE flag correctly on return in the case where size_allocate() is inherited from a parent class.
  • AG_Window: Fix a memory leak in single-window mode (the Resize cursors).
  • AG_Window: Fixed a visual off-by-one pixel error with the left-side window-resize controls in single-window mode.
  • MAP: Added missing lock operations in MAP_AddCamera(), MAP_PushLayer() and MAP_PopLayer(). Fixed multiple memory leaks.
  • MAP: Fixed crash when pushing new layers in Editor.

v1.6.0

3 years ago

Added

  • Integrated Style Editor tool. It allows a developer to inspect a live VFS of widgets, to pick elements, to add/edit style attributes and look at the results in real time.
  • Integrated GUI Debugger utility. Inspect a live VFS of widgets in real time. Available in Debug builds only.
  • AG_Button: New functions AG_ButtonGetState(), AG_ButtonSetState and atomic AG_ButtonToggle(). New option flag SET to force initial "state" to 1). New option flag RETURN_BUTTON to embed a "Return" button which raises "textbox-return" when pressed.
  • AG_Checkbox: Display a check mark (U+2713). Thanks Federico!
  • AG_Checkbox: New option flag INVERT.
  • AG_Config: New settings: "Tab Width", "Cursor Blink Rate", "Mouse Scroll Interval", "Enable GL_DEBUG_OUTPUT" and "NPOT (non power of two) textures".
  • AG_Console: Handle multiline entries. AG_ConsoleMsg() will now split multiline strings into multiple, grouped lines that are displayed in an indented style. Thanks Chuck!
  • AG_Console: Introduce event sink-based file monitoring features. New functions AG_ConsoleOpenFile, AG_ConsoleOpenFD, AG_ConsoleOpenStream() and AG_ConsoleClose().
  • AG_Console: New function AG_ConsoleBinary() to produce data in canonical (hex + ASCII) format. New function AG_ConsoleMsgCatS() for appending to an existing entry.
  • AG_Console: New function AG_ConsoleExportBuffer() for exporting entire buffer contents. Added "Selected Lines Only" option in "Export to file". Added menu function "Clear All". Added image types under "Export to file" for exporting screenshots.
  • AG_DataSource: New fixed-length string encoding functions AG_CopyStringPadded(), AG_WriteStringPadded() and AG_SkipStringPadded().
  • AG_Driver: New operations: putPixel64(), putPixelRGB16(), drawTriangle(), drawPolygon(), drawPolygonSti32(), drawLineW(), drawLineW_Sti16(), getClipboardText() and setClipboardText().
  • AG_Editable & AG_Textbox: Implement basic support for ANSI SGR attributes.
  • AG_Editable & AG_Textbox: Added autocomplete feature. New functions AG_EditableAutocomplete() and AG_EditableCloseAutocomplete().
  • AG_Editable & AG_Textbox: New property "placeholder" to specify a text label to show whenever the buffer is empty. Thanks Federico for the suggestion!
  • AG_Editable & AG_Textbox: New options UPPERCASE and LOWERCASE.
  • AG_FileDlg: Added AG_FileDlgAddImageTypes().
  • AG_FileDlg: New COMPACT option. In this mode, the widget becomes a single-line ( Textbox & Button ). The Button triggers the FileDlg to instantiate a clone of itself in a new window. New constructors AG_FileDlgNewCompact() and AG_FileDlgNewCompactMRU().
  • AG_FileDlg: Added special syntaxes to AG_FileType item. "<-x>" tests whether a file is executable by the effective user. "<=FILENAME>" matches filenames exactly. "<=FILENAME/i>" performs case-insensitive matching.
  • AG_FileDlg: New functions AG_FileDlgGetDirectory(), AG_FileDlgGetFilename(), AG_FileDlgCopyDirectory(), AG_FileDlgCopyFilename() and AG_FileDlgCopyTypes().
  • AG_Graph: Add support for directed graphs. Edges now include distinct types UNDIRECTED and DIRECTED. Thanks Chuck!
  • AG_HSVPal: New functions AG_HSVPalUpdateHue() and AG_HSVPalUpdateSV().
  • AG_Notebook: New functions AG_NotebookGetByID() and AG_NotebookSelectByID() for referencing tabs by integer ID.
  • AG_Object: New run-time object validity and class-membership tests. In Debug builds, passing an invalid object pointer to any Agar API call should now trigger "Illegal access" assertions. Additional tests are done when traversing linked lists in order to detect memory errors.
  • AG_Object: New functions AG_CreateClass() and AG_DestroyClass(). Provide an auto-allocated alternative to AG_RegisterClass() interface (which takes a pre-initialized argument). Added AG_ClassSetInit(), AG_ClassSetReset(), AG_ClassSetDestroy(), AG_ClassSetLoad(), AG_ClassSetSave() and AG_ClassSetEdit() for setting and overriding function pointers dynamically.
  • AG_Object: New property "archive-path". Deprecate AG_ObjectGetArchivePath() and AG_ObjectSetArchivePath().
  • AG_Pixmap: New function AG_PixmapGetSurface() to return a copy of surface at a given index.
  • AG_Radio: Handle multiline items. Implement key repeat.
  • AG_Radio: Implement horizontal layout. New function AG_RadioSetDisposition(). Thanks Federico!
  • AG_Separator: New function AG_SeparatorSetLength() to set a requisition when placing separators in containers of indeterminate size.
  • AG_Surface: Add support for 48- and 64-bit surfaces (under LARGE memory model).
  • AG_Surface: Add support for 1-bit (monochrome), 2-bit (4-color), and 4-bit (16 color) palettized modes. Cache PixelsPerByte in format field.
  • AG_Surface: Add support for Grayscale+Alpha modes (32-bit and 64-bit).
  • AG_Text: Add support for ANSI SGR attributes in AG_TextSize() and AG_TextRender(). Map the SGR Alternative Fonts to our core fonts.
  • AG_Text: New functions AG_TextFontPctFlags() and AG_CopyTextState().
  • AG_Timer: New functions AG_ExecTimer() & AG_DelTimers().
  • AG_Tlist: Implement per-item alternate colors and font flags. New functions AG_TlistSetColor() and AG_TlistSetFont() to style items individually.
  • AG_Widget: New function AG_SetStyleF().
  • AG_Widget: New events "font-changed" and "palette-changed". They are generated by the style compiler to signal whenever a widget's font or any entries in its palette (pal) have been changed.
  • AG_Widget: New functions AG_PushBlendingMode() & AG_PopBlendingMode().
  • AG_Window: New function AG_WindowMove() for moving windows more efficiently when no resize is required.
  • New color manipulation routines AG_ColorDarken(), AG_ColorLighten() and AG_ColorInterpolate().
  • New size hinting functions AG_PixmapSizeHint(), AG_BoxSizeHint(), AG_RadioSizeHint() and AG_FixedSizeHint(), for specifying explicit size requisitions in pixels.
  • New functions AG_ClipLine() for clipping lines to rectangular bounding boxes, AG_ClipLineCircle() for clipping lines to circular regions. New function AG_GetLineIntersection() for computing the intersection of two line segments. Thanks Chuck!
  • New function AG_DrawArrowhead() for drawing arrowheads of arbitrary size and angle aligned to arbitrary vectors. New function AG_DrawArrowLine() for drawing lines with arrowheads. Thanks Chuck!
  • New function AG_About() to generate a simple "About Agar" dialog with license text.
  • dummy: A new no-op driver which prints out calls and arguments to the console. In agartest, use the "-C" option to see the output (e.g., "agartest -C -d dummy").
  • glx: New driver option "xsync" to enable synchronous X events (e.g., "-d glx(xsync)"). This is useful when debugging issues involving any call into the X Window system.
  • New style attributes for colors. Primaries are "color", "background-color", "text-color", "line-color", "high-color", "low-color" and "selection-color". States are #unfocused, #disabled, #focused and #hover.
  • New style attributes "font-family", "font-size", "font-weight", "font-style" and "font-stretch".
  • New style attribute "padding". Allowed syntaxes are "padding: X" (set all paddings) and "padding: T R B L" (set Top, Right, Bottom & Left separately). For example, the padding of an AG_Button sets the space in pixels between the text label and the button's outer edges. The padding of an AG_Box sets the padding around the entire set of attached child widgets.
  • New style attribute "spacing". Allowed syntaxes are "spacing: X" (set both spacings) and "spacing: H V" (set horizontal and vertical spacings separately). In a vertical AG_Radio for example, H sets the horizontal space between the radio button and its label and V sets the vertical space in pixels between radio items. The spacing of an AG_Box sets the spacing between its child widgets.
  • New fonts. The distribution now includes a set of OFL 1.1 licensed core fonts in order to help improve cross-platform typography:
    • #0: Algue (not a RFN. Latin & graphical icons. Baked into ag_gui).
    • #1: Unialgue (not a RFN. Latin Extended, Arabic, Armenian, Canadian Aboriginal, Cyrillic, Devanagari, Georgian, Greek Extended, Gujarati, Gurmukhi, Hebrew, Lao, Lisu, Nko, Ogham, Tamil, Thai, Tibetan & Tifinagh).
    • #2: An unused slot.
    • #3: Computer Modern Unicode Sans (Latin Extended, Greek & Cyrillic).
    • #4: Computer Modern Unicode Serif (Latin Extended, Greek & Cyrillic).
    • #5: Computer Modern Unicode Typewriter (Latin Extended, Greek & Cyrillic).
    • #6: Bitstream Charter (Latin).
    • #7: Courier Prime (Latin).
    • #8: Source Han Sans (Latin, Chinese, Japanese & Korean).
    • #9: League Spartan (Latin).
    • #10: League Gothic (Latin).
    • #11: Unifraktur Maguntia (Latin).
  • Clipboard integration (currently implemented in glx). Added new AG_Driver operations getClipboardText() and setClipboardText().
  • Provide dlsym()mable copies of inline functions in lowercase form. For example, the symbol AG_LengthUTF8() is now guaranteed to have a dlsymmable copy called ag_length_utf8(). This helps avoid the need for glue code in language bindings. Thanks Brian and Federico!
  • Nullability: Introduce _Nullable and _Nonnull pointer annotations to help prevent programming mistakes and make prototypes more expressive.
  • Define special nullability annotations for thread types which require special handling since they may or may not be pointer types depending on the platform. Define _{Nullable,Nonnull,Null_unspecified}_{Mutex,Cond,Thread}.
  • New pointer-type-safe accessor macros for event handlers. Instead of using the generic pointer accessors AG_SELF(), AG_PTR() or AG_PTR_NAMED() to retrieve an object pointer from an event handler, one can now use the more specific AG_OBJECT_SELF(), AG_OBJECT_PTR() and AG_OBJECT_PTR_NAMED() macros. In a Debug build, such macros will perform a run-time validity and class-membership test. In a Release build, no tests are done. Class-specific accessor macros are also provided, for example AG_Button defines AG_BUTTON_SELF(), AG_BUTTON_PTR() and AG_BUTTON_PTR_NAMED().
  • New build option --enable-type-safety (implied by --enable-debug).
  • New build option --with-memory-model. SMALL targets 8-bit machines (for ag_micro only). MEDIUM has a smaller memory footprint and can handle up to 24-bit "True Color" surfaces (the default on non 64-bit hosts). The LARGE model adds support for 48-bit "Deep Color" surfaces (the default on 64-bit hosts). Either MEDIUM or LARGE will work on both 32-bit and 64-bit hosts (the choice comes down to performance tuning). Introduce AG_Size and AG_Offset types.
  • New build option --disable-widgets build with base framework, but without the standard widget library.
  • ag_core: Import rxi's type-safe dynamic arrays vec. Thanks Chuck for the suggestion!
  • ag_core: Colorize debugging output. Added --disable-ansi-color build option.
  • ag_core: New AG_SetErrorS() function variant.
  • ag_math: New functions AG_Square(), AG_HaveQuadraticSolution(), AG_QuadraticPositive(), AG_QuadraticNegative() & AG_Distance(). Thanks Chuck!
  • ag_math: New M_Bezier module for computing Bézier curves. Thanks Chuck!
  • ag_net: Introduce AG_Web, a multiprocess HTTP/1.1 application server. It handles authentication, session/process management, push events and templates (not in default build, must use --enable-web).
  • ag_vg: Make VG an AG_Object class since we may wish to subclass it or set variables and events on it.
  • ag_vg: Introduce vgedit, a basic editor for VG object files. It is also a good demonstration of VG_View widget usage.

Removed

  • AG_Event: In AG_PostEvent(), remove the mandatory "sender" first argument. Sender objects can be passed instead as regular arguments.
  • AG_Event: Removed the ASYNC and PROPAGATE option flags. Both behaviors can be implemented more flexibly in the event handler routine itself.
  • AG_Event: Removed the child-attached and child-detached events.
  • AG_Object: Removed the AG_ObjectDep structure and linkage. Dependencies are now represented with less overhead using AG_Variables.
  • AG_Object: Removed the save_pfx and archivePath fields (replaced by the "archive-path" property).
  • AG_Object: Remove typed virtual functions. This improves performance and allows AG_Get*() functions to be declared pure in unthreaded builds.
  • AG_Widget: Removed the options NOSPACING and TABLE_EMBEDDABLE which are no longer relevant.

Changed

  • AG_Button: Renamed AG_ButtonInvertState() -> AG_ButtonSetInverted().
  • AG_Button, AG_Checkbox & AG_Textbox: Implement rendering of text labels internally to avoid the cost of embedding AG_Labels widgets.
  • AG_Color: Handle web keywords ("AliceBlue", "antiquewhite", etc). They can now be used in widget color attributes and stylesheets. Keywords are case-insensitive.
  • AG_Color: Handle shortened "#RGB" and "#RGBA" formats in AG_ColorFromString().
  • AG_Combo & AG_UCombo: Cache generated windows to improve response time under multi-window drivers.
  • AG_Console: Rendering optimizations. Avoid redundant blending in draw() by pre-caching lines against an opaque background.
  • AG_Config: New functions AG_ConfigFind(), AG_ConfigAddPath(), AG_ConfigDelPath() and AG_ConfigSetPath(). Replaces former colon-separated "load-path", "save-path", "font-path", and "tmp-path" attributes. Define standard path groups PATH_DATA, PATH_FONTS and PATH_TEMP.
  • AG_Editable & AG_Textbox: Improve keyboard handling. Use 4 independent keyrepeat timers for the direction keys.
  • AG_Editable & AG_Textbox: Improvements to the word-selection behavior (triggered by ALT or double-click followed by mouse motion).
  • AG_FontSelector: Include Agar core fonts and user fonts in the listing (scanning "font-path" for files with supported extensions). Add "pixel64" binding in Large mode. Embed a color picker to preview fonts in different colors. Add Upright Italic and width variants. Add an alternate sample phrase.
  • AG_FileDlg: Refresh automatically when directory contents change when running on platforms with support for filesystem notifications (using an event sink of type FSEVENT).
  • AG_Menu: Improve responsiveness of menu expansions. Draw a rectangular outline to avoid blending into the background.
  • AG_Notebook: Legibility and rendering fixes. Render a stripe in "selected-color" over the selected tab. Handle multiline text correctly in tab labels.
  • AG_Object: Make AG_Variables of type P_FLAG* mutable to INT and UINT* types. In AG_CompareVariables(), compare discrete STRING variables by string value as opposed to comparing by reference. The AG_GetVariableLocked() function was renamed AG_AccessVariable(). Dependencies are now represented more compactly as AG_Variables of type P_OBJECT and P_VARIABLE.
  • AG_Scrollbar: Enhance contrast when control bar is squished below a constant threshold. Adjust the size requisition based on the zoom level (as opposed to the font size). Added SMOOTH option to produce a progressive motion towards the target for clicks outside of the control bar (as opposed to jumping which is the default).
  • AG_StyleSheet: The stylesheet parser now handles C-style comments. Improved validation and error messages.
  • AG_Surface: Pack AG_PixelFormat in the AG_Surface structure itself (so format is no longer a pointer).
  • AG_Surface: Set the MAPPED bit on surfaces that have been mapped with AG_WidgetMapSurface(). Detect attempts at freeing surfaces without first unmapping them.
  • AG_Text: Inner-loop optimizations in AG_TextSize() and AG_TextRender() backends. Reorganized code to use jump tables and allow new types of font engines to be used. Safety improvements in the backend of AG_{Push,Pop}TextState().
  • AG_Text: Handle fractional (floating-point) font sizes. This affords the style engine greater precision whenever "font-size" is expressed in "%".
  • AG_Widget: Store GL state data in a separate auto-allocated structure AG_WidgetGL to reduce overhead in the non-USE_OPENGL case.
  • AG_WidgetPrimitives: Produce smoother transitions between edges and corners of 3D-style primitives such as AG_DrawBox() and AG_DrawBoxRounded().
  • Pass AG_Color and AG_Rect by reference in public APIs.
  • Use the const, pure, noreturn, malloc_like and warn_unused_result attributes when they are available. Introduce _Pure_Attribute_If_Unthreaded.
  • Optimize the case where a window contains no widgets that make use of text rendering and therefore require no push/popping of the text state. Cache the result under AG_WINDOW_USE_TEXT in parent window.
  • Improvements, fixes and optimizations in the sizing routines of widgets in general.
  • Moved AG_Net code from ag_core to a separate library called ag_net. This prevents network-call-related security warnings on some platforms and packaging systems from affecting programs which do not use network calls.
  • glx: Obtain initial keyboard repeat delay and interval settings from XKB. Fallback to legacy XF86MISC if XKB is not available.
  • sdlfb & sdlgl: Handle "width" and "height" parameters in % (relative to available desktop space). Added "!bgPopup" option to disable background popup menu. Handle "R/G/B" format in "bgColor" parameter.
  • sdlfb & sdlgl: Allow windows (including minimized window icons) to move past view boundaries.
  • Build system updates. Fix endianness test for mingw and darwin hosts. It is no longer necessary to pass --byte-order when cross-compiling to mingw. The build system now handles Windows DLL files as regular binaries. We no longer use libtool. Added auto-generation of pkg-config .pc modules.
  • New build options --without-inline to disable inlining entirely and --without-inline-* to disable selectively.
  • Manual page improvements (clarity, wording, examples).
  • New Ada bindings (in ada/). Updated bindings are variable-thickness and offer the ability to implement new Agar object classes in pure Ada.
  • Mat's Perl bindings (in p5-Agar/) have been updated. Fixed bootstrapping code to work with recent perls.
  • ag_core: The "posix" module of AG_User uses getpwent() which may incur some startup overhead for applications under some platforms. Introduce a new module getenv, which avoids the call and obtains the information instead from the $USER, $[E]UID, $HOME and $TMPDIR environment variables. It is now the default unless AG_POSIX_USERS is passed to AG_InitCore().
  • ag_core: Compile cleanly on small C compilers such as cc65 and sdcc.
  • ag_core: Make AG_GetVariable() a non-variadic function. This may cause some new compiler warnings which can be avoided by casting the argument to (void *).

Fixed

  • AG_Console: Fixed memory leaks. Handle empty lines more efficiently.
  • AG_DSO: In OSX Lion (10.7) and later, prefer dlopen() over dyld() method.
  • AG_HSVPal: Fixed rendering issues. Scale the different features better under different sizes. Avoid overdraw in the transparency preview. If displaying an RGB or HSV text label, select a sensible text color based on HSV parameters. Short-circuit the cases where s or v are close to 0 (according to AG_SATURATION_EPSILON and AG_VALUE_EPSILON).
  • AG_Menu: Fixed collapse behavior when closing hierarchies of opened menus. Fixed incorrect alignment of submenus in some circumstances. Fix modal behavior of menu expansions in multi-window drivers.
  • AG_Label: In POLLED mode, obtain better size requisitions by processing the format string earlier in size_request(). This prevents the need for manual size hinting in common cases.
  • AG_Surface: Fix the PNG loader and exporter. PNG files with 16-bit per channel are now supported. Handle indexed-mode images correctly.
  • AG_Text: Fix a rendering problem with certain fonts where glyphs would blend incorrectly with the previously rendered glyphs.
  • AG_Tlist: Make AG_TlistSort() thread-safe.
  • AG_Tlist: When right-clicking, select the target item before triggering popup menus.
  • glx: If the initial glXChooseVisual() attempt fails, fallback to an 8-bit depth.
  • glx: Use XGrabPointer() to handle windows with MODAL flag. Thanks Chuck!
  • Fixed some pixel off-by-one errors in widget primitives.
  • Fixed an unwanted side effect when passing an argument of NULL or agWindowFocused to AG_WindowFocus(). It would cause any previous focus request to be cancelled. It is now a proper no-op.
  • Thread-safety and efficiency improvements. Removed many unnecessary lock operations.
  • Fixed 32-bit MSYS build (include missing header file). Thanks Varialus!
  • ag_core: It is now safe for Event Sink routines to call AG_DelEventSink() on themselves.
  • ag_core: It is now safe for an Event Epilogue routine to call AG_DelEventEpilogue() on itself. Thanks Walter Zambotti!