00001 00002 00003 00004 00005 00006 00007 00008 00009 00010 00011 00012 00013 00014 00015 00016
00017
00025 #include <gobjconfig.h>
00026
00027 #ifndef gobj_lib_object_h
00028 #define gobj_lib_object_h
00029
00030 #include <gobj/decls.h>
00031 #include <gobj/id.h>
00032 #include <gobj/context.h>
00033 #include <gobj/nativetypes.h>
00034
00035 #ifdef __cplusplus
00036 extern "C" {
00037 #endif
00038 #if 0
00039 }
00040 #endif
00041
00042
00053 Gj_Object* Gj_object_new(Gj_Ctx* ctx, Gj_Id* type, char* name);
00054
00055
00065 Gj_Object* Gj_object_duplicate(Gj_Ctx* ctx, Gj_Object* obj);
00066
00067
00068 00069 00070 00071 00072 00073 00074
00075
00076
00077
00088 Gj_Object* Gj_object_create(Gj_Ctx* ctx, Gj_Stream* stream, Gj_Object* update);
00089
00090
00100 int Gj_object_delete(Gj_Ctx* ctx, Gj_Object* ptr);
00101
00102
00112 int Gj_object_deleteLocal(Gj_Ctx* ctx, Gj_Object* ptr);
00113
00114
00125 int Gj_object_write(Gj_Ctx* ctx, Gj_Object* obj, Gj_Stream* stream);
00126
00127
00134 #ifdef GJ_LOCKING
00135 void gj_object_initLocks(Gj_Object* obj);
00136 #else
00137 #define gj_object_initLocks(a)
00138 #endif
00139
00140
00147 #ifdef GJ_LOCKING
00148 void gj_object_finalizeLocks(Gj_Object* obj);
00149 #else
00150 #define gj_object_finalizeLocks(a)
00151 #endif
00152
00153
00154 00155 00156 00157
00158
00159
00160
00167 #ifdef GJ_LOCKING
00168 void gj_object_lockShared(Gj_Object* obj);
00169 #else
00170 #define gj_object_lockShared(a)
00171 #endif
00172
00173
00182 #ifdef GJ_LOCKING
00183 void Gj_object_unlockShared(Gj_Object* obj);
00184 #else
00185 #define Gj_object_unlockShared(a)
00186 #endif
00187
00188
00201 int Gj_object_release(Gj_Ctx* ctx, Gj_Object* obj);
00202
00203
00212 #ifdef GJ_LOCKING
00213 void Gj_object_lockExcl(Gj_Object* obj);
00214 #else
00215 #define Gj_object_lockExcl(a)
00216 #endif
00217
00218
00225 #ifdef GJ_LOCKING
00226 void Gj_object_unlockExcl(Gj_Object* obj);
00227 #else
00228 #define Gj_object_unlockExcl(a)
00229 #endif
00230
00231
00232 00233 00234 00235 00236
00237
00238
00239
00240 00241 00242 00243 00244 00245
00246
00247
00248
00258 Gj_Id* Gj_object_assignId(Gj_Ctx* ctx, Gj_Object* obj);
00259
00260
00269 void Gj_object_markTemp(Gj_Object* obj);
00270
00271
00280 Gj_Bool Gj_object_isTemp(Gj_Object* obj);
00281
00282
00291 int Gj_object_getName(Gj_Ctx* ctx, Gj_Object* obj, char** name);
00292
00293
00294 00295 00296 00297 00298 00299 00300
00301 int Gj_object_setName(Gj_Ctx* ctx, Gj_Object* obj, char* name);
00302
00303
00304 00305 00306 00307 00308
00309 Gj_Nativetype Gj_object_getNativetype(Gj_Ctx* ctx, Gj_Object* obj);
00310
00311
00312 00313 00314 00315 00316 00317
00318 int Gj_object_setByName(Gj_Ctx* ctx, Gj_Object* obj, char* name, Gj_Object* value);
00319
00320
00321 00322 00323 00324 00325 00326
00327 int Gj_object_setByNumber(Gj_Ctx* ctx, Gj_Object* obj, int index, Gj_Object* value);
00328
00329
00330 00331 00332 00333 00334 00335 00336
00337 int Gj_object_getByName(Gj_Ctx* ctx, Gj_Object* obj, char* name, Gj_Object** value, Gj_Bool convert);
00338
00339
00340 00341 00342 00343 00344 00345 00346
00347 int Gj_object_getByNumber(Gj_Ctx* ctx, Gj_Object* obj, int index, Gj_Object** value, Gj_Bool convert);
00348
00349
00350 00351 00352 00353 00354 00355 00356 00357 00358
00359 int Gj_object_nextChild(Gj_Ctx* ctx, Gj_Object* obj, Gj_Object** last, Gj_Bool convert);
00360
00361
00362 00363 00364 00365 00366
00367 int Gj_object_getChildCount(Gj_Ctx* ctx, Gj_Object* obj);
00368
00369
00370 00371 00372 00373 00374 00375
00376 int Gj_object_add(Gj_Ctx* ctx, Gj_Object* obj, Gj_Object* value);
00377
00378
00379 00380 00381 00382 00383 00384
00385 int gj_object_add(Gj_Ctx* ctx, Gj_Object* obj, Gj_Object* value);
00386
00387
00388 00389 00390 00391 00392 00393
00394
00395
00396
00397 00398 00399 00400 00401 00402
00403 int Gj_object_removeByNumber(Gj_Ctx* ctx, Gj_Object* obj, int index);
00404
00405
00406 00407 00408 00409 00410 00411 00412
00413 Gj_Object* Gj_object_convert(Gj_Ctx* ctx, Gj_Object* obj, Gj_Id* type);
00414
00415
00416 00417 00418 00419 00420 00421
00422 int Gj_object_addViewer(Gj_Ctx* ctx, Gj_Object* obj, Gj_Viewer* viewer);
00423
00424
00425 00426 00427 00428 00429
00430 int Gj_object_deleteViewers(Gj_Ctx* ctx, Gj_Object* obj);
00431
00432
00433 #ifdef GJ_STDIO
00434 #include <stdio.h>
00435 00436 00437 00438 00439
00440 void Gj_object_dump(Gj_Ctx* ctx, Gj_Object* obj, FILE* s, int* indent);
00441 #endif
00442
00443
00449 struct Gj_Object_struct {
00450
00451 char* name;
00452
00453 Gj_Model* model;
00454
00455 Gj_Object* parent;
00456 Gj_Object* update;
00457
00458 Gj_Viewer* viewers;
00459
00460 Gj_Bool fixedProperties;
00461 Gj_Bool vaccess;
00462 Gj_Bool temp;
00463 Gj_Bool link;
00464
00465 #ifdef GJ_LOCKING
00466 Gj_Bool exclLock;
00467 int sharedLocks;
00468 #endif
00469
00470 union {
00471 Gj_Object** fix;
00472
00473 struct {
00474 Gj_Object* first;
00475 Gj_Object* last;
00476 } notfix;
00477 } children;
00478
00479 Gj_Object* next;
00480
00481 };
00482
00483
00484 00485 00486 00487
00488 struct gj_Linkrecord_struct {
00489
00490 Gj_Object* obj;
00491
00492 Gj_Viewer* viewer;
00493
00494 };
00495
00496
00497 #ifdef __cplusplus
00498 }
00499 #endif
00500
00501 #endif
00502