Skip to content

lib/app: Initial support for marks

Logan Rathbone requested to merge marks into master

Non-exhaustive summary of changes:

  • widget: Use GPtrArray rather than custom linked lists for highlights

  • Add HexWidgetMark object type and use throughout

    This needs to be a GObject unlike other boxed types we use for e.g., highlighting, because we make extensive use of binding via GtkExpression.

    Internally, HexWidgetMark's use highlights behind the scenes to render themselves.

  • Add various public and private API to add, remove and manipulate marks, both in the libgtkhex code and the app

    One noteworthy item is that in order to maintain flexibility, there is no API to track marks through the libgtkhex library, in terms of obtaining an internal index number, etc. Once a mark is created, a non-owned pointer to the HexWidgetMark GObject is returned, and it is up to the application to track these objects in its own way.

    In the app, the way we do this is through key-value pairs, which are stored within the state of the app. In the future, we may want to extend this by, eg, allowing the user to give a mark a customized name as opposed to a number.

    Note that there is no support presently for persistence or saving of marks. This may be revisited in the future.

  • Add MarkDialog, a subclass of PaneDialog, and integrate with the app window. Marks can be set using the dialog, and custom colors can be set through the dialog if desired.

Merge request reports