[gtksourceview/wip/minimap] minimap: add some documentation on private struct fields
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtksourceview/wip/minimap] minimap: add some documentation on private struct fields
- Date: Thu, 7 May 2015 19:59:11 +0000 (UTC)
commit 104cfd9607c6e11204859d49e05b54e7e9dc8ee3
Author: Christian Hergert <christian hergert me>
Date: Thu May 7 12:59:05 2015 -0700
minimap: add some documentation on private struct fields
Just some more background information on the current implementation.
gtksourceview/gtksourcemap.c | 29 +++++++++++++++++++++++++++++
1 files changed, 29 insertions(+), 0 deletions(-)
---
diff --git a/gtksourceview/gtksourcemap.c b/gtksourceview/gtksourcemap.c
index d92374f..b3c9543 100644
--- a/gtksourceview/gtksourcemap.c
+++ b/gtksourceview/gtksourcemap.c
@@ -100,12 +100,41 @@ typedef struct
{
PangoFontDescription *font_desc;
+ /*
+ * We use a separate CSS provider for the view (controlling the font)
+ * and the overlay box due to the inability to get both styled
+ * correctly from the same CSS provider. If someone can determine
+ * the cause of this, we should merge them into a single provider.
+ */
GtkCssProvider *view_css_provider;
GtkCssProvider *box_css_provider;
+ /*
+ * We use an overlay to place the scrubber above the source view.
+ * Doing so allows us to composite the two widgets together instead
+ * invalidating the child_view's pixel cache by rendering during its
+ * draw_layer() vfunc.
+ */
GtkOverlay *overlay;
+
+ /*
+ * This is our minimap widget. We adjust the font to be a 1pt font
+ * but otherwise try to render things as close to the same as the
+ * view we are providing a map of. We do not render the background
+ * grid as it requires a lot of cpu time and isn't visible anyway.
+ * The width of the view is controlled by "right-margin-position"
+ * multiplied by the size of a single character. Content that wraps
+ * beyond right-margin-position is not displayed.
+ */
GtkSourceView *child_view;
+
+ /*
+ * overlay_box is our scrubber widget. It is the translucent overlay
+ * that the user can grab and drag to perform an accelerated scroll.
+ */
GtkEventBox *overlay_box;
+
+ /* The GtkSourceView we are providing a map of */
GtkSourceView *view;
gboolean in_press : 1;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]