sl@0: /* GObject - GLib Type, Object, Parameter and Signal Library sl@0: * testmodule.c: Dummy dynamic type module sl@0: * Copyright (C) 2003 Red Hat, Inc. sl@0: * sl@0: * This library is free software; you can redistribute it and/or sl@0: * modify it under the terms of the GNU Lesser General Public sl@0: * License as published by the Free Software Foundation; either sl@0: * version 2 of the License, or (at your option) any later version. sl@0: * sl@0: * This library is distributed in the hope that it will be useful, sl@0: * but WITHOUT ANY WARRANTY; without even the implied warranty of sl@0: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU sl@0: * Lesser General Public License for more details. sl@0: * sl@0: * You should have received a copy of the GNU Lesser General Public sl@0: * License along with this library; if not, write to the sl@0: * Free Software Foundation, Inc., 59 Temple Place - Suite 330, sl@0: * Boston, MA 02111-1307, USA. sl@0: */ sl@0: sl@0: #include "testmodule.h" sl@0: #include "testcommon.h" sl@0: sl@0: static gboolean test_module_load (GTypeModule *module); sl@0: static void test_module_unload (GTypeModule *module); sl@0: sl@0: static void sl@0: test_module_class_init (TestModuleClass *class) sl@0: { sl@0: GTypeModuleClass *module_class = G_TYPE_MODULE_CLASS (class); sl@0: sl@0: module_class->load = test_module_load; sl@0: module_class->unload = test_module_unload; sl@0: } sl@0: sl@0: DEFINE_TYPE (TestModule, test_module, sl@0: test_module_class_init, NULL, NULL, sl@0: G_TYPE_TYPE_MODULE) sl@0: sl@0: static gboolean sl@0: test_module_load (GTypeModule *module) sl@0: { sl@0: TestModule *test_module = TEST_MODULE (module); sl@0: sl@0: test_module->register_func (module); sl@0: sl@0: return TRUE; sl@0: } sl@0: sl@0: static void sl@0: test_module_unload (GTypeModule *module) sl@0: { sl@0: } sl@0: sl@0: GTypeModule * sl@0: test_module_new (TestModuleRegisterFunc register_func) sl@0: { sl@0: TestModule *test_module = g_object_new (TEST_TYPE_MODULE, NULL); sl@0: GTypeModule *module = G_TYPE_MODULE (test_module); sl@0: sl@0: test_module->register_func = register_func; sl@0: sl@0: /* Register the types initially */ sl@0: g_type_module_use (module); sl@0: g_type_module_unuse (module); sl@0: sl@0: return G_TYPE_MODULE (module); sl@0: } sl@0: