]> git.tdb.fi Git - libs/gltk.git/log
libs/gltk.git
15 months agoMinor refactoring
Mikko Rasa [Mon, 21 Aug 2023 08:23:42 +0000 (11:23 +0300)]
Minor refactoring

15 months agoUse size_t to represent counts and indices
Mikko Rasa [Mon, 21 Aug 2023 08:22:43 +0000 (11:22 +0300)]
Use size_t to represent counts and indices

15 months agoConvert all list containers to vectors
Mikko Rasa [Sun, 20 Aug 2023 21:06:05 +0000 (00:06 +0300)]
Convert all list containers to vectors

15 months agoMake sure classes follow the rule of 0/3/5
Mikko Rasa [Sun, 20 Aug 2023 20:51:25 +0000 (23:51 +0300)]
Make sure classes follow the rule of 0/3/5

15 months agoClear saved input focus if the widget is removed from the container
Mikko Rasa [Sun, 20 Aug 2023 20:25:02 +0000 (23:25 +0300)]
Clear saved input focus if the widget is removed from the container

Checking the saved focus widget's parent in focus_in can lead to use
after free if the widget was deleted in the meantime.

15 months agoRename some get functions as find because they can return null
Mikko Rasa [Sun, 20 Aug 2023 20:07:04 +0000 (23:07 +0300)]
Rename some get functions as find because they can return null

15 months agoUse the override specifier when overriding a virtual function
Mikko Rasa [Sun, 20 Aug 2023 10:00:21 +0000 (13:00 +0300)]
Use the override specifier when overriding a virtual function

15 months agoRemove unnecessary destructors from exception classes
Mikko Rasa [Sun, 20 Aug 2023 09:57:30 +0000 (12:57 +0300)]
Remove unnecessary destructors from exception classes

15 months agoUse nullptr instead of 0 for pointers
Mikko Rasa [Sun, 20 Aug 2023 09:55:01 +0000 (12:55 +0300)]
Use nullptr instead of 0 for pointers

15 months agoSimplify constructors with C++11
Mikko Rasa [Sun, 20 Aug 2023 09:10:32 +0000 (12:10 +0300)]
Simplify constructors with C++11

Use default member initializers, defaulted constructors and constructor
delegation.

15 months agoConvert loops and iterators to use C++11 features
Mikko Rasa [Sun, 20 Aug 2023 07:48:39 +0000 (10:48 +0300)]
Convert loops and iterators to use C++11 features

15 months agoFix an uninitialized variable
Mikko Rasa [Fri, 18 Aug 2023 21:23:37 +0000 (00:23 +0300)]
Fix an uninitialized variable

15 months agoAdd API declarations
Mikko Rasa [Fri, 18 Aug 2023 21:22:14 +0000 (00:22 +0300)]
Add API declarations

15 months agoRemove deprecated and unmaintained interfaces
Mikko Rasa [Fri, 18 Aug 2023 20:54:47 +0000 (23:54 +0300)]
Remove deprecated and unmaintained interfaces

15 months agoBump version
Mikko Rasa [Thu, 17 Aug 2023 12:04:35 +0000 (15:04 +0300)]
Bump version

The parameterless render() function got removed from Root, breaking
source compatibility.  More changes to come.

15 months agoAdjust things to conform to changes in other libraries
Mikko Rasa [Thu, 17 Aug 2023 08:40:03 +0000 (11:40 +0300)]
Adjust things to conform to changes in other libraries

5 years agoEmit rebuild_needed from a container when a child is added
Mikko Rasa [Wed, 16 Oct 2019 11:15:34 +0000 (14:15 +0300)]
Emit rebuild_needed from a container when a child is added

Otherwise the flag won't properly propagate if the container itself is
already parented.

5 years agoAdd a signal for selection changes in Entry
Mikko Rasa [Fri, 27 Sep 2019 11:29:46 +0000 (14:29 +0300)]
Add a signal for selection changes in Entry

5 years agoFix a bug in selection handling when deleting text
Mikko Rasa [Fri, 27 Sep 2019 11:29:09 +0000 (14:29 +0300)]
Fix a bug in selection handling when deleting text

5 years agoAdd a progress bar widget
Mikko Rasa [Fri, 27 Sep 2019 11:27:49 +0000 (14:27 +0300)]
Add a progress bar widget

5 years agoRefactor edit position adjustments from Entry::insert and delete
Mikko Rasa [Wed, 25 Sep 2019 19:10:27 +0000 (22:10 +0300)]
Refactor edit position adjustments from Entry::insert and delete

5 years agoImprove Dialog staleness checks
Mikko Rasa [Wed, 25 Sep 2019 18:44:04 +0000 (21:44 +0300)]
Improve Dialog staleness checks

Buttons may be activated by a navigation event.  There's now a protected
function that derived classes can call if they implement custom mechanisms
for producing a response.

5 years agoAdd a page size feature to Slider
Mikko Rasa [Mon, 23 Sep 2019 22:26:30 +0000 (01:26 +0300)]
Add a page size feature to Slider

5 years agoRefactor all slider logic into the Slider class
Mikko Rasa [Mon, 23 Sep 2019 22:10:45 +0000 (01:10 +0300)]
Refactor all slider logic into the Slider class

Having to write the same logic twice is annoying and more prone to
errors.

5 years agoMark Entry for rebuild when cursor starts or stops blinking
Mikko Rasa [Mon, 23 Sep 2019 21:00:06 +0000 (00:00 +0300)]
Mark Entry for rebuild when cursor starts or stops blinking

5 years agoDefer widget rebuild to just before they are rendered
Mikko Rasa [Mon, 23 Sep 2019 20:59:24 +0000 (23:59 +0300)]
Defer widget rebuild to just before they are rendered

This improves performance especially with complex widgets like Entry.

5 years agoMark List::Item as receiving navigation input
Mikko Rasa [Mon, 23 Sep 2019 18:53:35 +0000 (21:53 +0300)]
Mark List::Item as receiving navigation input

To make it consistent with the fact that it can receive focus.

5 years agoRebuild Entry when the slider is moved
Mikko Rasa [Mon, 23 Sep 2019 18:37:10 +0000 (21:37 +0300)]
Rebuild Entry when the slider is moved

5 years agoAdjust protections of list item base classes
Mikko Rasa [Mon, 23 Sep 2019 18:36:18 +0000 (21:36 +0300)]
Adjust protections of list item base classes

5 years agoAdjust a pointer check in Container
Mikko Rasa [Mon, 23 Sep 2019 18:26:00 +0000 (21:26 +0300)]
Adjust a pointer check in Container

This is semantically equivalent but more intuitive and more tolerant to
mistakes.

5 years agoImprove pointer grab handling
Mikko Rasa [Mon, 23 Sep 2019 18:23:08 +0000 (21:23 +0300)]
Improve pointer grab handling

This fixes a bug where hiding a widget with active pointer grab would
leave the grab flag set, preventing pointer events from being sent
anywere.

5 years agoImplement a grid view mode for List
Mikko Rasa [Thu, 19 Sep 2019 21:47:43 +0000 (00:47 +0300)]
Implement a grid view mode for List

5 years agoAdd a level of indirection to decouple list rows from items
Mikko Rasa [Thu, 19 Sep 2019 21:01:53 +0000 (00:01 +0300)]
Add a level of indirection to decouple list rows from items

This is required to support different kinds of views like grid and
possibly tree.

5 years agoCache the items part in List
Mikko Rasa [Thu, 19 Sep 2019 19:04:41 +0000 (22:04 +0300)]
Cache the items part in List

5 years agoRename Widget::on_geometry_change to on_size_change
Mikko Rasa [Thu, 19 Sep 2019 16:33:30 +0000 (19:33 +0300)]
Rename Widget::on_geometry_change to on_size_change

The new name better represents its actual function.

5 years agoAdd a helper class for single-child list items
Mikko Rasa [Thu, 19 Sep 2019 08:25:00 +0000 (11:25 +0300)]
Add a helper class for single-child list items

5 years agoUse the maximum item height for autosizing List
Mikko Rasa [Thu, 19 Sep 2019 06:21:56 +0000 (09:21 +0300)]
Use the maximum item height for autosizing List

5 years agoUse a LoadableTypeRegistry to manage child types for Panel
Mikko Rasa [Tue, 17 Sep 2019 21:03:02 +0000 (00:03 +0300)]
Use a LoadableTypeRegistry to manage child types for Panel

5 years agoEnsure Text always has at least one line
Mikko Rasa [Tue, 17 Sep 2019 19:48:56 +0000 (22:48 +0300)]
Ensure Text always has at least one line

Otherwise coords_to_geometry may access bogus data.

5 years agoAdd page up/down navigation to Entry
Mikko Rasa [Tue, 17 Sep 2019 19:46:16 +0000 (22:46 +0300)]
Add page up/down navigation to Entry

5 years agoImplement next/previous navigation in Panel
Mikko Rasa [Tue, 17 Sep 2019 19:38:04 +0000 (22:38 +0300)]
Implement next/previous navigation in Panel

The order is the one widgets were added in, which I think should produce
a sensible result in common scenarios.

5 years agoProperly handle multibyte UTF-8 in Entry and Text
Mikko Rasa [Tue, 17 Sep 2019 16:06:34 +0000 (19:06 +0300)]
Properly handle multibyte UTF-8 in Entry and Text

5 years agoEmit signal_text_changed from Entry::set_text
Mikko Rasa [Tue, 17 Sep 2019 15:49:04 +0000 (18:49 +0300)]
Emit signal_text_changed from Entry::set_text

5 years agoUse RAII to ensure consistent PartCache state
Mikko Rasa [Tue, 17 Sep 2019 12:42:19 +0000 (15:42 +0300)]
Use RAII to ensure consistent PartCache state

end_rebuild needs to be called even if an exception is thrown during
rebuilding.

5 years agoFix an unsigned overflow error in Text
Mikko Rasa [Tue, 17 Sep 2019 12:36:33 +0000 (15:36 +0300)]
Fix an unsigned overflow error in Text

5 years agoSelect list items upon navigation by default
Mikko Rasa [Tue, 17 Sep 2019 11:55:09 +0000 (14:55 +0300)]
Select list items upon navigation by default

With control pressed, only the focus is moved.

5 years agoMake sure Entry::first_row stays consistent
Mikko Rasa [Mon, 16 Sep 2019 17:25:30 +0000 (20:25 +0300)]
Make sure Entry::first_row stays consistent

Shrinking and then enlarging an Entry caused first_row to first be set to
the edit position, but would never be reset to zero due to the check in
slider_value_changed.  Yet the visual result was correct thanks to Text
clamping first_row independently.

5 years agoAdd a signal for Entry widget text changes
Mikko Rasa [Mon, 16 Sep 2019 16:40:24 +0000 (19:40 +0300)]
Add a signal for Entry widget text changes

5 years agoAdd a set_modal function for Dialog
Mikko Rasa [Mon, 16 Sep 2019 16:33:29 +0000 (19:33 +0300)]
Add a set_modal function for Dialog

5 years agoDo not navigate out of a widget holding the pointer grab
Mikko Rasa [Mon, 16 Sep 2019 16:32:26 +0000 (19:32 +0300)]
Do not navigate out of a widget holding the pointer grab

5 years agoUse separate widget class for Dialog
Mikko Rasa [Mon, 16 Sep 2019 16:31:18 +0000 (19:31 +0300)]
Use separate widget class for Dialog

5 years agoRemember the last input focus of a Container and restore it when focused
Mikko Rasa [Mon, 16 Sep 2019 16:30:45 +0000 (19:30 +0300)]
Remember the last input focus of a Container and restore it when focused

5 years agoSome more interfaces to support integrating Entry with other components
Mikko Rasa [Thu, 12 Sep 2019 13:46:07 +0000 (16:46 +0300)]
Some more interfaces to support integrating Entry with other components

5 years agoAvoid duplicating the logic in Entry::get_selection
Mikko Rasa [Thu, 12 Sep 2019 12:03:10 +0000 (15:03 +0300)]
Avoid duplicating the logic in Entry::get_selection

5 years agoCollapse the two implementations of Entry::set_edit_position
Mikko Rasa [Thu, 12 Sep 2019 11:15:08 +0000 (14:15 +0300)]
Collapse the two implementations of Entry::set_edit_position

5 years agoUse the public functions also in internal edit operations of Entry
Mikko Rasa [Thu, 12 Sep 2019 11:05:33 +0000 (14:05 +0300)]
Use the public functions also in internal edit operations of Entry

5 years agoRefactor visible height calculation in Entry and Text
Mikko Rasa [Thu, 12 Sep 2019 10:55:11 +0000 (13:55 +0300)]
Refactor visible height calculation in Entry and Text

It's now contained in a common function to ensure it's calculated the
same way in both.

5 years agoImprove vertical positioning of text
Mikko Rasa [Thu, 12 Sep 2019 09:11:39 +0000 (12:11 +0300)]
Improve vertical positioning of text

Applying alignment to only the number of lines that fit in the widget
results in a more consistent position.

5 years agoAdd some editing functions to Entry
Mikko Rasa [Wed, 11 Sep 2019 15:53:54 +0000 (18:53 +0300)]
Add some editing functions to Entry

5 years agoInterpret shift+tab as NAV_PREVIOUS
Mikko Rasa [Wed, 11 Sep 2019 15:43:11 +0000 (18:43 +0300)]
Interpret shift+tab as NAV_PREVIOUS

5 years agoAdd modifier state enum
Mikko Rasa [Wed, 11 Sep 2019 15:42:44 +0000 (18:42 +0300)]
Add modifier state enum

This was supposed to be in 6e5db3e

5 years agoImplement a selection feature in Entry widget
Mikko Rasa [Wed, 11 Sep 2019 07:49:15 +0000 (10:49 +0300)]
Implement a selection feature in Entry widget

5 years agoHandle home and end keys in Entry widget
Mikko Rasa [Wed, 11 Sep 2019 06:26:38 +0000 (09:26 +0300)]
Handle home and end keys in Entry widget

5 years agoPass modifier state to key_press and key_release functions
Mikko Rasa [Tue, 10 Sep 2019 08:40:37 +0000 (11:40 +0300)]
Pass modifier state to key_press and key_release functions

5 years agoAdd an event handler to allow containers to reach to focus changes
Mikko Rasa [Sun, 8 Sep 2019 15:32:19 +0000 (18:32 +0300)]
Add an event handler to allow containers to reach to focus changes

5 years agoOnly focus widgets if the container is focused
Mikko Rasa [Sun, 8 Sep 2019 15:28:21 +0000 (18:28 +0300)]
Only focus widgets if the container is focused

This prevents issues where a widget could be focused before it's added
to a rooted hierarchy, presenting inconsistent focus state.

5 years agoMake the entry widget cursor blink
Mikko Rasa [Sun, 8 Sep 2019 14:25:56 +0000 (17:25 +0300)]
Make the entry widget cursor blink

If the cursor part has different graphics for normal and active states,
it will toggle between those every half a second while the widget is
focused.

5 years agoAdd a system for animating widgets
Mikko Rasa [Sun, 8 Sep 2019 14:17:02 +0000 (17:17 +0300)]
Add a system for animating widgets

5 years agoAdd a flag to make widgets in a LinearArrangement the same size
Mikko Rasa [Thu, 5 Sep 2019 21:08:08 +0000 (00:08 +0300)]
Add a flag to make widgets in a LinearArrangement the same size

5 years agoUpdate deprecated things
Mikko Rasa [Thu, 5 Sep 2019 16:56:06 +0000 (19:56 +0300)]
Update deprecated things

7 years agoChange Root::render to use the passed in Renderer
Mikko Rasa [Thu, 29 Dec 2016 17:21:24 +0000 (19:21 +0200)]
Change Root::render to use the passed in Renderer

7 years agoAdd nameless child keywords for Panel
Mikko Rasa [Mon, 28 Nov 2016 00:35:12 +0000 (02:35 +0200)]
Add nameless child keywords for Panel

Additionally, use a template specialization rather than separate function
for a child which is itself a Panel.

7 years agoAllow overriding the spacing between two widgets in LinearArrangement
Mikko Rasa [Sat, 26 Nov 2016 11:39:26 +0000 (13:39 +0200)]
Allow overriding the spacing between two widgets in LinearArrangement

7 years agoChange the Resources reference in Root to non-const
Mikko Rasa [Sat, 26 Nov 2016 11:38:42 +0000 (13:38 +0200)]
Change the Resources reference in Root to non-const

It might be necessary to load textures on the fly.

7 years agoAdd a datafile statement to set an icon for an Image
Mikko Rasa [Sat, 26 Nov 2016 11:38:02 +0000 (13:38 +0200)]
Add a datafile statement to set an icon for an Image

8 years agoUpdate Renderer matrix manipulation calls
Mikko Rasa [Sat, 19 Nov 2016 12:43:31 +0000 (14:43 +0200)]
Update Renderer matrix manipulation calls

8 years agoExplicitly require sigc++-2.0
Mikko Rasa [Fri, 16 Sep 2016 22:39:29 +0000 (01:39 +0300)]
Explicitly require sigc++-2.0

8 years agoInherit Root from GL::Renderable
Mikko Rasa [Thu, 15 Sep 2016 21:46:32 +0000 (00:46 +0300)]
Inherit Root from GL::Renderable

This allows better integration with GL::Pipeline and the new GL::View
class.

8 years agoFocus entry widget on touch press
Mikko Rasa [Thu, 15 Sep 2016 14:54:15 +0000 (17:54 +0300)]
Focus entry widget on touch press

8 years agoAdd lexical conversion for the centering constraints
Mikko Rasa [Thu, 15 Sep 2016 14:53:27 +0000 (17:53 +0300)]
Add lexical conversion for the centering constraints

8 years agoRewrite Panel navigation logic so it makes more sense
Mikko Rasa [Mon, 12 Sep 2016 15:34:12 +0000 (18:34 +0300)]
Rewrite Panel navigation logic so it makes more sense

Rather than calculating distances between widget centers it now considers
the closeness of their edges.  It's not perfect but better than before.

8 years agoAdd centering constraints to Layout
Mikko Rasa [Sun, 11 Sep 2016 13:28:49 +0000 (16:28 +0300)]
Add centering constraints to Layout

8 years agoAdd support for displaying named icons in an Image widget
Mikko Rasa [Sun, 11 Sep 2016 13:27:46 +0000 (16:27 +0300)]
Add support for displaying named icons in an Image widget

8 years agoOnly pass key and navigation events to enabled widgets
Mikko Rasa [Fri, 2 Sep 2016 22:08:37 +0000 (01:08 +0300)]
Only pass key and navigation events to enabled widgets

It would be even better to not allow them to be focused in the first
place, but that raises issues such as where to put the focus if the
focused widget gets disabled.  So this will have to do.

8 years agoPass List::focus_in to base class
Mikko Rasa [Fri, 2 Sep 2016 22:07:33 +0000 (01:07 +0300)]
Pass List::focus_in to base class

It sets the FOCUS flag in state, which is then checked to determine
whether to focus items.

8 years agoImplement touch interactions for List
Mikko Rasa [Thu, 1 Sep 2016 16:46:44 +0000 (19:46 +0300)]
Implement touch interactions for List

It wasn't working on touchscreens at all because the touch events were
passed to the list items by Container and not converted into mouse events
for the list itself to process.

8 years agoFix an incorrectly positioned graphic
Mikko Rasa [Thu, 1 Sep 2016 16:46:11 +0000 (19:46 +0300)]
Fix an incorrectly positioned graphic

8 years agoImprove list focus management
Mikko Rasa [Thu, 1 Sep 2016 16:42:41 +0000 (19:42 +0300)]
Improve list focus management

Now that containers no longer get an implicit navigation event when
focused, list must take care of focusing the correct item itself.

8 years agoMove navigation logic from Container to Panel
Mikko Rasa [Thu, 1 Sep 2016 07:46:57 +0000 (10:46 +0300)]
Move navigation logic from Container to Panel

A number of widgets inherit from Container because they have internal
sub-widgets, but have their own navigation logic.  Panel is the user-
visible generic container.

8 years agoDon't pass events to an invisible root widget
Mikko Rasa [Wed, 31 Aug 2016 09:56:06 +0000 (12:56 +0300)]
Don't pass events to an invisible root widget

8 years agoImplement keyboard navigation for most widgets
Mikko Rasa [Wed, 31 Aug 2016 08:52:45 +0000 (11:52 +0300)]
Implement keyboard navigation for most widgets

8 years agoAdd a border around the focused widget in the basic skin
Mikko Rasa [Wed, 31 Aug 2016 08:34:40 +0000 (11:34 +0300)]
Add a border around the focused widget in the basic skin

8 years agoAllow an empty graphic to be specified in part definitions
Mikko Rasa [Wed, 31 Aug 2016 08:30:26 +0000 (11:30 +0300)]
Allow an empty graphic to be specified in part definitions

It can be used to cancel out a graphic for specific states.

8 years agoRefactor the traversal logic out of List::check_view_range
Mikko Rasa [Wed, 31 Aug 2016 08:17:33 +0000 (11:17 +0300)]
Refactor the traversal logic out of List::check_view_range

It'll be useful for other things as well.

8 years agoAdd an input method subsystem
Mikko Rasa [Tue, 30 Aug 2016 13:26:57 +0000 (16:26 +0300)]
Add an input method subsystem

It's necessary for implementing keyboard navigation and virtual keyboards.

8 years agoMake keyboard event handlers indicate whether the event was handled
Mikko Rasa [Tue, 30 Aug 2016 13:12:22 +0000 (16:12 +0300)]
Make keyboard event handlers indicate whether the event was handled

8 years agoReorder event handling functions
Mikko Rasa [Tue, 30 Aug 2016 12:51:16 +0000 (15:51 +0300)]
Reorder event handling functions

8 years agoUse a larger font for the basic skin
Mikko Rasa [Fri, 26 Aug 2016 11:32:02 +0000 (14:32 +0300)]
Use a larger font for the basic skin

A 10-pixel font is rather tiny.  The old font file was also lacking some
metrics.

8 years agoAdd another example application to demonstrate various widgets
Mikko Rasa [Fri, 26 Aug 2016 11:17:27 +0000 (14:17 +0300)]
Add another example application to demonstrate various widgets

8 years agoMake sure gravity can't overpower expand
Mikko Rasa [Thu, 25 Aug 2016 21:23:05 +0000 (00:23 +0300)]
Make sure gravity can't overpower expand