summaryrefslogtreecommitdiff
path: root/plugins/python/cglimpse/method.py
blob: f2e9fdbf962acad5ea7e7087826e5b11653712d3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
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