Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kodekote/gtkregextester
a regex testing utility for GTK 3
https://github.com/kodekote/gtkregextester
c custom-drawing gtk gtk3 libcairo regex-matcher regex-validator
Last synced: 26 days ago
JSON representation
a regex testing utility for GTK 3
- Host: GitHub
- URL: https://github.com/kodekote/gtkregextester
- Owner: kodekote
- License: gpl-3.0
- Created: 2023-09-02T15:32:15.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2023-09-02T23:38:40.000Z (about 1 year ago)
- Last Synced: 2024-10-10T22:02:39.882Z (about 1 month ago)
- Topics: c, custom-drawing, gtk, gtk3, libcairo, regex-matcher, regex-validator
- Language: C
- Homepage:
- Size: 43 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# gtkregextester (GTK Regex Tester)
## A tool to test regular expressions against target strings for Linux operating systems (or any system that supports GTK 3).### Synposis:
Aside from being useful, this code showcases several poorly-documented features of _GTK 3_
that may be of interest to some. Namely:
1. the API to implement custom drawing (including
geometry management and invoking _libcairo_)
1. how to set attributes on widgets that are ignored by the CSS styler (letter-spacing, for example)
1. which properties are allowed on what widget and how to write an XML UI definition file
1. examples of queueing draw operations on a widget manually to keep all widgets up-to-dateThe most interesting take-away is probably this: the `GtkStyleProvider` in the form of a CSS styler works
*very* poorly. For serious applications, using _libpango_ is a must. Also, for anyone who wishes to implement
anything beyond the most basic user interfaces, custom drawing (and associated _libcairo_) is another must.
Therefore, the GTK 3 documentation is as good as useless beyond being a reference for function declarations,
signal declarations, and property lists.### Usage:
Type a regular expression into the top text widget. The status box will turn green for valid regular expressions (as defined by POSIX)
and red for invalid regular expressions.Type a target string into the bottom box. All matches, as computed by `regexec`, will be highlighted in a green box with a blue border.
The empty string is never matched.### TODO:
- Add a list view that allows saving regular expressions of interest. Allow output to a text file.
- Add a Java mode which runs a Java program in daemon mode that tests regular expressions as defined in java.util.regex.
- Write a custom `regcomp`--one that does not allow nonsense regular expressions like "ab+*".![Screenshot](/gtkregextester.png)