Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gtk+3 port #42

Open
wants to merge 12 commits into
base: master
Choose a base branch
from

Conversation

GeorgesStavracas
Copy link
Contributor

This is an attempt to port the word trellis visualizer to Gtk+ 3. Comments are more than welcomed.

[#41]

@GeorgesStavracas GeorgesStavracas force-pushed the wip/gtk3-port branch 3 times, most recently from 8050816 to 831f94d Compare September 6, 2016 16:26
When compiling Julius with Gtk+ support for visualization, it
needs some structures from libjulius that are conditionally
compiled based on VISUALIZE define.

To try and define it at compile time, Julius uses --enable-visualize
flag. Libjulius, however, doesn't use that flag and ends up
not defining this variable, which causes compilation errors
with --enable-visualize.

Fix that by adding a configure flag for --enable-visualize.
GTK is now called Gtk+, and it works on Wayland as well.
Just like libjulius received an --enable-visualize flag, this
commit readds Gtk+ support in Julius by properly checking for
Gtk+ with pkg-config.

Warning: this commit makes Julius unbuildable. The build issue
will be fixed in the next commit.
After properly reintroducing the --enable-visualize flag
to configure, this commit updates the code of visual.c to
work on Gtk+ >= 3.16.

This rework involved the following things:
 - Drop GdkGC usage and use GtkStyleContext instead
 - Drop GdkPixbuf and use cairo_t
 - Use CSS styles rather than GdkColors
 - Adapt some other minor things to work with new Gtk+ internals
 - Add a headerbar to the window
By moving the bottom texts to labels, we're able to simplify
the drawing code a little bit and completely get rid of the
draw_background() function.
Instead of using a set of pre-defined zoom levels that are not
based on the visible area of the window, the zooming action was
very confusing and had some weird behaviors, e.g. when zooming 8x
and the tree actually shrinks.

Fix this misbehavior by adding a set of buttons at the headerbar
and using relative zooming rather than absolute zooming.
Using CALLBACK_EVENT_SEGMENT_END doesn't give us a valid
backtrellis pointer and causes segmentation faults when
searching.
To make it more visually appealing, do the following changes:

 - Improve the side widgets to be more like a list.
 - Move the search bar to the header.
 - Reorganize side widgets.
For the sake of sanity, the drawing code omits
some words from being rendered, otherwise it'd
be too hard to understand the backtrellis.

The problem with that approach is that we don't
know where some branchs point to, since some words
are not rendered.

Fix that by showing a sidebar with the words, in
the order they're displayed in the graph.
The view area is the most important piece of graph
here, thus we should make it the most visually
recognizable section of the window.
To improve the rendering and ease the visualization
of the word trellis, this patch adds the following
changes:
 - Render small dots at the end of each line
 - Show horizontal stripes, so we can easily detect
   which word each line is related to.
Instead of always showing the GUI when compiling with
visualization support, add a new flag '-visualize' so
we can still run Julius like before (without an actual
user interface).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant