GtkRuler is right now deprecated for the reason that it seems to be covering a too special use cases. Although there are quite a few apps using it. Some even forked the widget to make it more useful. Instead of removing it, we could also make it better.
1. Use Cases
- use with images
- use for plots as axis labels
2. Forks and other implementations
2.1. Ardour
gtk-custom-ruler.c, gtk-custom-ruler.h, gtk-custom-hruler.c, gtk-custom-hruler.h
"show_position" property (no need for GTK_RULER_GET_CLASS(ruler)->draw_pos = NULL; hack)
callback based GtkRulerMetric replacement
2.2. GtkDatabox
gtkdatabox_ruler.c gtkdatabox_ruler.h
- supports linear and logarithmic scales
- in the vertical orientation, the labels are rotated 90°
- it works for very small and very large value ranges
3. Things we should change
- add "show_position" property
have something smarter for GtkRulerMetric as current API is broken:
GtkRulerMetric is public, but there is no API using it
GtkMetricType is an enum of 3 values with no way of registering own GtkRulerMetric
- it does not cover non-linear rulers (e.g. Log), that could be solved with a callback
get rid of gtk_ruler_{s,g}et_range and use a GtkAdjustment instead
that'd allow to sync a GtkRuler with a GtkScale and a GtkViewport (share the GtkAdjustment)
- we could add gtk_ruler_{s,g}et_adjustment
- ideally we'd have the same constructors like Gtk{H,V}Scale
- the rulers look not nice
- add more padding between ticks and numbers
- use half-color for minor ticks