1 /* GObject - GLib Type, Object, Parameter and Signal Library
2 * testmodule.c: Dummy dynamic type module
3 * Copyright (C) 2003 Red Hat, Inc.
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the
17 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 * Boston, MA 02111-1307, USA.
21 #include "testmodule.h"
22 #include "testcommon.h"
24 static gboolean test_module_load (GTypeModule *module);
25 static void test_module_unload (GTypeModule *module);
28 test_module_class_init (TestModuleClass *class)
30 GTypeModuleClass *module_class = G_TYPE_MODULE_CLASS (class);
32 module_class->load = test_module_load;
33 module_class->unload = test_module_unload;
36 DEFINE_TYPE (TestModule, test_module,
37 test_module_class_init, NULL, NULL,
41 test_module_load (GTypeModule *module)
43 TestModule *test_module = TEST_MODULE (module);
45 test_module->register_func (module);
51 test_module_unload (GTypeModule *module)
56 test_module_new (TestModuleRegisterFunc register_func)
58 TestModule *test_module = g_object_new (TEST_TYPE_MODULE, NULL);
59 GTypeModule *module = G_TYPE_MODULE (test_module);
61 test_module->register_func = register_func;
63 /* Register the types initially */
64 g_type_module_use (module);
65 g_type_module_unuse (module);
67 return G_TYPE_MODULE (module);