Update contrib.
2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
4 * This component and the accompanying materials are made available
5 * under the terms of "Eclipse Public License v1.0"
6 * which accompanies this distribution, and is available
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
24 #include "gobject_wsd.h"
28 #include <pls.h> // For emulator WSD API
29 const TUid KLibgobjectUid3 = {0x10281F39}; // This is the UID of the library
32 extern const GTypeInfo temp_info;
33 extern const GTypeInfo gobject_info;
34 extern const GParamSpecTypeInfo temp_pspec_info;
35 extern const GBSearchConfig temp_g_signal_hlbsa_bconfig;
36 extern const GBSearchConfig temp_g_class_closure_bconfig;
37 extern const GSourceCallbackFuncs temp_closure_callback_funcs;
38 extern const GBSearchConfig gtype_instance_real_class_bconfig;
39 extern const GBSearchConfig temp_transform_bconfig;
41 void InitializeGlobalStaticMutexes(struct global_struct* g)
43 GStaticMutex temp_init_mutex = { NULL, PTHREAD_MUTEX_INITIALIZER };
44 GStaticRWLock temp_init_lock = {G_STATIC_MUTEX_INIT, NULL, NULL, 0, FALSE, 0, 0};
46 //variable initialisation for gobject.c
47 memcpy(&(g->VARIABLE_NAME_MACRO(construction_mutex, gobject)), &temp_init_mutex, sizeof(GStaticMutex));
49 memcpy(&(g->VARIABLE_NAME_MACRO(debug_objects, gobject)), &temp_init_mutex, sizeof(GStaticMutex));
50 #endif /* G_ENABLE_DEBUG */
52 //variable initialisation for gparam.c
53 memcpy(&(g->VARIABLE_NAME(init_smutex, g_param_spec_pool_new)), &temp_init_mutex, sizeof(GStaticMutex));
55 //variable initialisation for gsignal.c
56 memcpy(&(g->VARIABLE_NAME_MACRO(g_signal_mutex,gsignal)), &temp_init_mutex, sizeof(GStaticMutex));
58 //variable initialisation for gtype.c
59 memcpy(&(g->VARIABLE_NAME_MACRO(instance_real_class,gtype)), &temp_init_mutex, sizeof(GStaticMutex));
60 memcpy(&(g->VARIABLE_NAME_MACRO(type_init_lock,g_type_init_with_debug_flags)), &temp_init_mutex, sizeof(GStaticMutex));
61 memcpy(&(g->VARIABLE_NAME(type_rw_lock,gtype)), &temp_init_lock, sizeof(GStaticRWLock));
64 int InitializeWsd(struct global_struct* g)
66 memset(g,0,sizeof(struct global_struct));
68 //initialization of genums.c data
69 memcpy(&(g->VARIABLE_NAME(info,g_enum_types_init)),&temp_info,sizeof(GTypeInfo));
71 //initialization of gobject.c data
72 memcpy(&(g->VARIABLE_NAME(info,g_object_type_init)),&gobject_info,sizeof(GTypeInfo));
73 g->VARIABLE_NAME(floating_flag_handler,gobject) = object_floating_flag_handler;
75 //initialization of gparamspec.c
76 memcpy(&(g->VARIABLE_NAME(pspec_info,g_param_spec_types_init)),&temp_pspec_info,sizeof(GParamSpecTypeInfo));
78 //initialization of gsignal.c data
79 memcpy(&(g->VARIABLE_NAME(g_signal_hlbsa_bconfig,gsignal)),&temp_g_signal_hlbsa_bconfig,sizeof(GBSearchConfig));
80 memcpy(&(g->VARIABLE_NAME(g_class_closure_bconfig,gsignal)),&temp_g_class_closure_bconfig,sizeof(GBSearchConfig));
81 g->VARIABLE_NAME(g_handler_sequential_number ,gsignal) = 1;
82 g->VARIABLE_NAME(seq_hook_id ,g_signal_add_emission_hook) = 1;
84 //initialization of gsourceclosure.c data
85 memcpy(&(g->VARIABLE_NAME(closure_callback_funcs,gsourceclosure)),&temp_closure_callback_funcs,sizeof(GSourceCallbackFuncs));
87 //initialization of gtype.c data
88 g->VARIABLE_NAME(static_fundamental_next,gtype) = G_TYPE_RESERVED_USER_FIRST;
89 memcpy(&(g->VARIABLE_NAME(instance_real_class_bconfig,gtype)),>ype_instance_real_class_bconfig,sizeof(GBSearchConfig));
90 (g->VARIABLE_NAME(debug_keys,g_type_init_with_debug_flags)[0]).key = "objects";
91 (g->VARIABLE_NAME(debug_keys,g_type_init_with_debug_flags)[0]).value = G_TYPE_DEBUG_OBJECTS ;
92 (g->VARIABLE_NAME(debug_keys,g_type_init_with_debug_flags)[1]).key = "signals";
93 (g->VARIABLE_NAME(debug_keys,g_type_init_with_debug_flags)[1]).value = G_TYPE_DEBUG_SIGNALS ;
95 //initialization of gvalue.c data
96 memcpy(&(g->VARIABLE_NAME(transform_bconfig,gvalue)),&temp_transform_bconfig,sizeof(GBSearchConfig));
98 InitializeGlobalStaticMutexes(g);
103 struct global_struct *Gobject_ImpurePtr()
105 #if defined(__WINSCW__) || defined(__WINS__)
107 // Access the PLS of this process
108 struct global_struct* p = Pls<struct global_struct>(KLibgobjectUid3, &InitializeWsd);
119 #endif /* EMULATOR */