Stability Level

Unstable, unless otherwise indicated

Synopsis

struct              NtdSource;
struct              NtdSourceClass;
const GValue *      ntd_source_get                      (NtdSource *source);
const NtdAddress *  ntd_source_get_address              (NtdSource *source);
NtdProtocol *       ntd_source_get_protocol             (NtdSource *source);
const gchar*        ntd_source_get_symbolic_description (NtdSource *source);
const gchar *       ntd_source_get_symbolic_name        (NtdSource *source);
NtdSource *         ntd_source_new                      (NtdProtocol *protocol);
NtdSource *         ntd_source_new_with_data            (NtdProtocol *protocol,
                                                         NtdSourceType type,
                                                         const gchar *id);
void                ntd_source_read                     (NtdSource *source);
void                ntd_source_set                      (NtdSource *source,
                                                         const GValue *value);
void                ntd_source_set_address              (NtdSource *source,
                                                         const NtdAddress *address);
void                ntd_source_set_address_with_data    (NtdSource *source,
                                                         NtdSourceType type,
                                                         const gchar *id);
void                ntd_source_set_protocol             (NtdSource *source,
                                                         NtdProtocol *protocol);
void                ntd_source_set_symbolic             (NtdSource *source,
                                                         const gchar *name,
                                                         const gchar *description);
void                ntd_source_write                    (NtdSource *source);

Object Hierarchy

  GObject
   +----NtdSource

Properties

  "address"                  NtdAddress*           : Read / Write / Construct
  "protocol"                 NtdProtocol*          : Read / Write / Construct
  "symbolic-description"     gchar*                : Read / Write
  "symbolic-name"            gchar*                : Read / Write

Signals

  "set"                                            : No Hooks

Description

This class provides a common interface to the NtD system for all external data.

Details

struct NtdSource

struct NtdSource;

struct NtdSourceClass

struct NtdSourceClass {
    GObjectClass   parent_class;

    /* Signals */
    void          (* set)                         (NtdSource*        source,
            const GValue*     value);
};

ntd_source_get ()

const GValue *      ntd_source_get                      (NtdSource *source);

Returns the internal pointer to the GValue structure storing the content of source.

source :

an NtdSource object

Returns :

a pointer to the internal GValue or NULL on errors.

ntd_source_get_address ()

const NtdAddress *  ntd_source_get_address              (NtdSource *source);

Gets the address (type and id) of the source object.

source :

an NtdSource object

Returns :

a pointer to the internal NtdAddress structure or NULL on errors.

ntd_source_get_protocol ()

NtdProtocol *       ntd_source_get_protocol             (NtdSource *source);

Gets the protocol to be used by the source object to read from or write to the host its content.

source :

an NtdSource object

Returns :

the protocol used by source or NULL on errors.

ntd_source_get_symbolic_description ()

const gchar*        ntd_source_get_symbolic_description (NtdSource *source);

Gets the symbolic description for source.

source :

an NtdSource object

Returns :

the requested symbolic description or NULL if there is no symbolic data for source.

ntd_source_get_symbolic_name ()

const gchar *       ntd_source_get_symbolic_name        (NtdSource *source);

Gets the symbolic name for source.

source :

an NtdSource object

Returns :

the requested symbolic name or NULL if there is no symbolic data for source.

ntd_source_new ()

NtdSource *         ntd_source_new                      (NtdProtocol *protocol);

Creates a new NtdSource object.

protocol :

an NtdProtocol derived object

Returns :

the newly created object or NULL on errors.

ntd_source_new_with_data ()

NtdSource *         ntd_source_new_with_data            (NtdProtocol *protocol,
                                                         NtdSourceType type,
                                                         const gchar *id);

ntd_source_read ()

void                ntd_source_read                     (NtdSource *source);

Reads the source content from the host and store the result in the internal GValue structure.

source :

an NtdSource object

ntd_source_set ()

void                ntd_source_set                      (NtdSource *source,
                                                         const GValue *value);

Sets the content of source to the specified value. Emits a "set" signal with the new content.

source :

an NtdSource object

value :

the new content

ntd_source_set_address ()

void                ntd_source_set_address              (NtdSource *source,
                                                         const NtdAddress *address);

Sets the address to be used in reading or writing source.

source :

an NtdSource object

address :

the NtdAddress to set

ntd_source_set_address_with_data ()

void                ntd_source_set_address_with_data    (NtdSource *source,
                                                         NtdSourceType type,
                                                         const gchar *id);

Sets the address to be used in reading or writing source. It does the same job as ntd_source_set_address(), but allows to specify the address in a more direct way. Consult the documentation of the protocol used by this NtdSource object to know how id and type should be used.

source :

an NtdSource object

type :

the source type, protocol dependent

id :

the source id, protocol dependent

ntd_source_set_protocol ()

void                ntd_source_set_protocol             (NtdSource *source,
                                                         NtdProtocol *protocol);

Sets the protocol to be used by the source object to read from or write to the host its content.

source :

an NtdSource object

protocol :

an NtdProtocol derived protocol

ntd_source_set_symbolic ()

void                ntd_source_set_symbolic             (NtdSource *source,
                                                         const gchar *name,
                                                         const gchar *description);

Sets the symbolic data on source. name and description are treated separately: the "notify" signal is emitted only if a value is changed, and only on the modified property.

source :

an NtdSource object

name :

the symbolic name

description :

the symbolic description

ntd_source_write ()

void                ntd_source_write                    (NtdSource *source);

Writes the content of the specified source object to the host. This is a simply wrapper function to avoid calling directly the protocol methods.

source :

an NtdSource object

Property Details

The "address" property

  "address"                  NtdAddress*           : Read / Write / Construct

Full address, containing source type and identification string. The format of this parameter is protocol dependent and should be described by the protocol documentation.


The "protocol" property

  "protocol"                 NtdProtocol*          : Read / Write / Construct

Protocol to use while reading from or writing to the host this source object.


The "symbolic-description" property

  "symbolic-description"     gchar*                : Read / Write

Description of this source as specified in the symbolic table or NULL if no symbolic table is used.

Default value: NULL


The "symbolic-name" property

  "symbolic-name"            gchar*                : Read / Write

Name as specified in the symbolic table or NULL if no symbolic table is used.

Default value: NULL

Signal Details

The "set" signal

void                user_function                      (NtdSource *source,
                                                        GValue    *value,
                                                        gpointer   user_data)      : No Hooks

Emitted whenever a NtdSource content has to be modified. Notice that also rewriting the same content in a source object emits a "set" signal.

source :

an NtdSource object

value :

the new GValue content to set

user_data :

user data set when the signal handler was connected.