1 | /* |
2 | * Copyright © 2018 Benjamin Otte |
3 | * |
4 | * This library is free software; you can redistribute it and/or |
5 | * modify it under the terms of the GNU Lesser General Public |
6 | * License as published by the Free Software Foundation; either |
7 | * version 2.1 of the License, or (at your option) any later version. |
8 | * |
9 | * This library is distributed in the hope that it will be useful, |
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
12 | * Lesser General Public License for more details. |
13 | * |
14 | * You should have received a copy of the GNU Lesser General Public |
15 | * License along with this library. If not, see <http://www.gnu.org/licenses/>. |
16 | * |
17 | * Authors: Benjamin Otte <otte@gnome.org> |
18 | */ |
19 | |
20 | #include "config.h" |
21 | |
22 | #include "inspectoroverlay.h" |
23 | |
24 | #include "gtkintl.h" |
25 | |
26 | G_DEFINE_ABSTRACT_TYPE (GtkInspectorOverlay, gtk_inspector_overlay, G_TYPE_OBJECT) |
27 | |
28 | static void |
29 | gtk_inspector_overlay_default_snapshot (GtkInspectorOverlay *self, |
30 | GtkSnapshot *snapshot, |
31 | GskRenderNode *node, |
32 | GtkWidget *widget) |
33 | { |
34 | } |
35 | |
36 | static void |
37 | gtk_inspector_overlay_default_queue_draw (GtkInspectorOverlay *self) |
38 | { |
39 | } |
40 | |
41 | static void |
42 | gtk_inspector_overlay_class_init (GtkInspectorOverlayClass *class) |
43 | { |
44 | class->snapshot = gtk_inspector_overlay_default_snapshot; |
45 | class->queue_draw = gtk_inspector_overlay_default_queue_draw; |
46 | } |
47 | |
48 | static void |
49 | gtk_inspector_overlay_init (GtkInspectorOverlay *self) |
50 | { |
51 | } |
52 | |
53 | void |
54 | gtk_inspector_overlay_snapshot (GtkInspectorOverlay *self, |
55 | GtkSnapshot *snapshot, |
56 | GskRenderNode *node, |
57 | GtkWidget *widget) |
58 | { |
59 | gtk_snapshot_push_debug (snapshot, message: "%s %p" , G_OBJECT_TYPE_NAME (self), self); |
60 | |
61 | GTK_INSPECTOR_OVERLAY_GET_CLASS (ptr: self)->snapshot (self, snapshot, node, widget); |
62 | |
63 | gtk_snapshot_pop (snapshot); |
64 | } |
65 | |
66 | void |
67 | gtk_inspector_overlay_queue_draw (GtkInspectorOverlay *self) |
68 | { |
69 | GTK_INSPECTOR_OVERLAY_GET_CLASS (ptr: self)->queue_draw (self); |
70 | } |
71 | |
72 | |