Main Page   Compound List   File List   Compound Members   File Members  

lib/gobj/view.h File Reference

View implementation. More...

#include <gobjconfig.h>
#include <gobj/decls.h>
#include <gobj/id.h>
#include <gobj/context.h>
#include <gobj/object.h>
#include <gobj/nativemgr.h>
#include <stdio.h>

Go to the source code of this file.

Compounds

struct  gj_Parameter_struct
struct  Gj_View_struct

Typedefs

typedef struct gj_Parameter_struct  gj_Parameter
 The view parameter structure. More...


Functions

Gj_ViewGj_view_new (Gj_Ctx* ctx, char* name, Gj_Id* id, Gj_Id* type, Gj_Path* nativefunc)
 Create a new view structure. More...

Gj_ViewGj_view_create (Gj_Ctx* ctx, Gj_Stream* stream)
 Create a view form a stream. More...

int Gj_view_delete (Gj_Ctx* ctx, Gj_View* ptr)
 Delete a view structure. More...

int Gj_view_write (Gj_Ctx* ctx, Gj_View* view, Gj_Stream* stream)
 Write a view to a stream. More...

void Gj_view_register (Gj_Ctx* ctx, Gj_View* view)
 Register a view. More...

void Gj_view_finish (Gj_Ctx* ctx, Gj_View* view)
 Finish a view. More...

Gj_Bool Gj_view_isRegistered (Gj_View* view)
 Checks whether a view has been registered.

Gj_Bool Gj_view_isFinished (Gj_View* view)
 Checks whether a view has been finished.

char* Gj_view_getName (Gj_View* view)
 Get the name of the view. More...

Gj_IdGj_view_getId (Gj_Ctx* ctx, Gj_View* view)
 Get the id of a view. More...

int Gj_view_addParameter (Gj_Ctx* ctx, Gj_View* view, char* name, Gj_Id* type)
 Add a parameter. More...

int Gj_view_getParameterCount (Gj_View* view)
 Get the parameter count.

int Gj_view_getParameterNumber (Gj_Ctx* ctx, Gj_View* view, char* name)
 Get the number of a parameter given by its name. More...

int Gj_view_setDefinition (Gj_Ctx* ctx, Gj_View* view, Gj_Object* def)
 Set the definition of the view. More...

Gj_IdGj_view_getType (Gj_View* view)
 Get the return type of the view. More...

void Gj_view_dump (Gj_Ctx* ctx, Gj_View* view, FILE* stream, int* indent)
 Dump the view onto a given stream. More...


Detailed Description

View implementation.


Typedef Documentation

typedef struct gj_Parameter_struct gj_Parameter
 

The view parameter structure.

For internal use only.


Function Documentation

Gj_View * Gj_view_new ( Gj_Ctx * ctx,
char * name,
Gj_Id * id,
Gj_Id * type,
Gj_Path * nativefunc )
 

Create a new view structure.

Name may be 0. Id may be 0, in this case a new id is assigned. Nativefunc may be 0. Nativefunc will not be NOT DUPLICATED, the view will overtake the OWNERSHIP of the path.

Returns:
The pointer to the structure on success, 0 otherwise.

Gj_View * Gj_view_create ( Gj_Ctx * ctx,
Gj_Stream * stream )
 

Create a view form a stream.

Returns:
The pointer to the view on success, 0 otherwise.

int Gj_view_delete ( Gj_Ctx * ctx,
Gj_View * ptr )
 

Delete a view structure.

Returns:
0 on success, -1 otherwise.

int Gj_view_write ( Gj_Ctx * ctx,
Gj_View * view,
Gj_Stream * stream )
 

Write a view to a stream.

Returns:
0 on success, -1 otherwise.

void Gj_view_register ( Gj_Ctx * ctx,
Gj_View * view )
 

Register a view.

A locally unique id is assigned if no other set.

void Gj_view_finish ( Gj_Ctx * ctx,
Gj_View * view )
 

Finish a view.

The/a global unique id is assigned. The view cannot be changed anymore.

char * Gj_view_getName ( Gj_View * view )
 

Get the name of the view.

Return value 0 means no name is set.

Gj_Id * Gj_view_getId ( Gj_Ctx * ctx,
Gj_View * view )
 

Get the id of a view.

The id is STILL OWNED by the view.

Returns:
The pointer to the id on success, 0 otherwise.

int Gj_view_addParameter ( Gj_Ctx * ctx,
Gj_View * view,
char * name,
Gj_Id * type )
 

Add a parameter.

Returns:
0 on success, -1 otherwise.

int Gj_view_getParameterNumber ( Gj_Ctx * ctx,
Gj_View * view,
char * name )
 

Get the number of a parameter given by its name.

Returns:
The number of the parameter on success, -1 otherwise.

int Gj_view_setDefinition ( Gj_Ctx * ctx,
Gj_View * view,
Gj_Object * def )
 

Set the definition of the view.

This functions should be called AFTER all needed calls to Gj_view_addParameter() were made. The object is NOT duplicated.

Returns:
0 on success, -1 otherwise.

Gj_Id * Gj_view_getType ( Gj_View * view )
 

Get the return type of the view.

The returned id is STILL OWNED by the view.

void Gj_view_dump ( Gj_Ctx * ctx,
Gj_View * view,
FILE * stream,
int * indent )
 

Dump the view onto a given stream.

If you call this function yourself *indent should be 0.


Generated at Fri Aug 17 18:28:58 2001 for Gobj by doxygen1.2.1 written by Dimitri van Heesch, © 1997-2000