I'm pleased to announce the release of Agar v1.6.0. The source code
and binary packages are now available for download at

https://libagar.org/download.html

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() & 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 AG_NotebookGetByID() & 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().
  Provides 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 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 Ext, Greek, Cyrillic).
    #5: Computer Modern Unicode Typewriter (Latin Ext, 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). Introduced 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 attribute macro
  _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!

===

If you find libagar useful, please consider supporting my work on the
new LibAgar Patreon (https://www.patreon.com/libagar) or GitHub Sponsors
(https://github.com/sponsors/JulNadeauCA) where I will be posting series
of how-to articles, demos and tutorials.

There is a new Discord channel for both Agar users and developers at:
https://libagar.org/discord. It's linked to the #libagar on Freenode.

- Julien
_______________________________________________
Agar mailing list
[email protected]
http://libagar.org/lists.html

Reply via email to