1 /*
2 * Copyright (c) 2008-2009 Christian Hammond
3 * Copyright (c) 2008-2009 David Trowbridge
4 *
5 * Permission is hereby granted, free of charge, to any person obtaining a
6 * copy of this software and associated documentation files (the "Software"),
7 * to deal in the Software without restriction, including without limitation
8 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
9 * and/or sell copies of the Software, and to permit persons to whom the
10 * Software is furnished to do so, subject to the following conditions:
11 *
12 * The above copyright notice and this permission notice shall be included
13 * in all copies or substantial portions of the Software.
14 *
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 * THE SOFTWARE.
22 */
23 #include <glib.h>
24
25 #include "init.h"
26
27 #include "actions.h"
28 #include "cellrenderergraph.h"
29 #include "css-editor.h"
30 #include "css-node-tree.h"
31 #include "data-list.h"
32 #include "general.h"
33 #include "gestures.h"
34 #include "graphdata.h"
35 #include "magnifier.h"
36 #include "menu.h"
37 #include "misc-info.h"
38 #include "object-hierarchy.h"
39 #include "object-tree.h"
40 #include "prop-list.h"
41 #include "resource-list.h"
42 #include "selector.h"
43 #include "signals-list.h"
44 #include "size-groups.h"
45 #include "statistics.h"
46 #include "visual.h"
47 #include "window.h"
48 #include "gtkstackcombo.h"
49
50 #include "gtkmagnifierprivate.h"
51
52 #include "gtkmodulesprivate.h"
53
54 void
gtk_inspector_init(void)55 gtk_inspector_init (void)
56 {
57 static GIOExtensionPoint *extension_point = NULL;
58
59 g_type_ensure (GTK_TYPE_CELL_RENDERER_GRAPH);
60 g_type_ensure (GTK_TYPE_GRAPH_DATA);
61 g_type_ensure (GTK_TYPE_INSPECTOR_ACTIONS);
62 g_type_ensure (GTK_TYPE_INSPECTOR_CSS_EDITOR);
63 g_type_ensure (GTK_TYPE_INSPECTOR_CSS_NODE_TREE);
64 g_type_ensure (GTK_TYPE_INSPECTOR_DATA_LIST);
65 g_type_ensure (GTK_TYPE_INSPECTOR_GENERAL);
66 g_type_ensure (GTK_TYPE_INSPECTOR_GESTURES);
67 g_type_ensure (GTK_TYPE_MAGNIFIER);
68 g_type_ensure (GTK_TYPE_INSPECTOR_MAGNIFIER);
69 g_type_ensure (GTK_TYPE_INSPECTOR_MENU);
70 g_type_ensure (GTK_TYPE_INSPECTOR_MISC_INFO);
71 g_type_ensure (GTK_TYPE_INSPECTOR_OBJECT_HIERARCHY);
72 g_type_ensure (GTK_TYPE_INSPECTOR_OBJECT_TREE);
73 g_type_ensure (GTK_TYPE_INSPECTOR_PROP_LIST);
74 g_type_ensure (GTK_TYPE_INSPECTOR_RESOURCE_LIST);
75 g_type_ensure (GTK_TYPE_INSPECTOR_SELECTOR);
76 g_type_ensure (GTK_TYPE_INSPECTOR_SIGNALS_LIST);
77 g_type_ensure (GTK_TYPE_INSPECTOR_SIZE_GROUPS);
78 g_type_ensure (GTK_TYPE_INSPECTOR_STATISTICS);
79 g_type_ensure (GTK_TYPE_INSPECTOR_VISUAL);
80 g_type_ensure (GTK_TYPE_INSPECTOR_WINDOW);
81 g_type_ensure (GTK_TYPE_STACK_COMBO);
82
83 if (extension_point == NULL)
84 {
85 GIOModuleScope *scope;
86 gchar **paths;
87 int i;
88
89 extension_point = g_io_extension_point_register ("gtk-inspector-page");
90 g_io_extension_point_set_required_type (extension_point, GTK_TYPE_WIDGET);
91
92 paths = _gtk_get_module_path ("inspector");
93 scope = g_io_module_scope_new (G_IO_MODULE_SCOPE_BLOCK_DUPLICATES);
94
95 for (i = 0; paths[i] != NULL; i++)
96 g_io_modules_load_all_in_directory_with_scope (paths[i], scope);
97
98 g_strfreev (paths);
99 g_io_module_scope_free (scope);
100 }
101 }
102
103 // vim: set et sw=2 ts=2:
104