summaryrefslogtreecommitdiff
path: root/plugins/python/cglimpse/method.py
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/python/cglimpse/method.py')
-rw-r--r--plugins/python/cglimpse/method.py43
1 files changed, 43 insertions, 0 deletions
diff --git a/plugins/python/cglimpse/method.py b/plugins/python/cglimpse/method.py
new file mode 100644
index 0000000..f2e9fdb
--- /dev/null
+++ b/plugins/python/cglimpse/method.py
@@ -0,0 +1,43 @@
+
+class GlimpseMethod():
+ """Abstract class for gimpses."""
+
+
+ def __init__(self, builder):
+ """Populate the class with its attributes."""
+
+ self._builder = builder
+
+ self._v_legend = None
+ self._h_legend = None
+
+ self._x_range = None
+ self._y_range = None
+
+
+ def switch(self):
+ """Switch the panel labels to the method ones."""
+
+ lbl = self._builder.get_object('v_legend')
+ lbl.set_text(self._v_legend)
+
+ lbl = self._builder.get_object('h_legend')
+ lbl.set_text(self._h_legend)
+
+
+ def setup_rendering(self):
+ """Provide information useful for drawing the grid."""
+
+ return self._x_range, self._y_range
+
+
+ def format_legend(self, value, vert):
+ """Build the label used for a rule."""
+
+ return str(value)
+
+
+ def render(self, cr, area):
+ """Draw the bytes distribution for the current binary, if any."""
+
+ pass