FepGClient

FepGClient — Client connection to FEP server

Synopsis

struct              FepGClient;
struct              FepGClientClass;
gboolean            fep_g_client_dispatch               (FepGClient *client);
gint                fep_g_client_get_poll_fd            (FepGClient *client);
FepGClient *        fep_g_client_new                    (const char *address,
                                                         GCancellable *cancellable,
                                                         GError **error);
void                fep_g_client_send_data              (FepGClient *client,
                                                         const char *data,
                                                         gsize length);
void                fep_g_client_send_text              (FepGClient *client,
                                                         const char *text);
void                fep_g_client_set_cursor_text        (FepGClient *client,
                                                         const char *text,
                                                         FepGAttribute *attr);
void                fep_g_client_set_status_text        (FepGClient *client,
                                                         const char *text,
                                                         FepGAttribute *attr);

Object Hierarchy

  GObject
   +----FepGClient

Implemented Interfaces

FepGClient implements GInitable.

Properties

  "address"                  gchar*                : Read / Write / Construct Only

Signals

  "filter-key-event"                               : Run Last
  "resized"                                        : Run Last

Description

Details

struct FepGClient

struct FepGClient;

struct FepGClientClass

struct FepGClientClass {
  /* signals */
  gboolean (*filter_key_event) (FepGClient *client,
                                guint       keyval,
                                guint       modifiers);
  void     (*resized)          (FepGClient *client,
                                guint       cols,
                                guint       rows);
};

filter_key_event ()

class handler for "filter-key-event"

resized ()

class handler for "resized"

fep_g_client_dispatch ()

gboolean            fep_g_client_dispatch               (FepGClient *client);

Dispatch a key event.

client :

a FepGClient

Returns :

TRUE if success, FALSE on error.

fep_g_client_get_poll_fd ()

gint                fep_g_client_get_poll_fd            (FepGClient *client);

Get the file descriptor of the control socket which can be used by poll().

client :

a FepGClient

Returns :

a file descriptor

fep_g_client_new ()

FepGClient *        fep_g_client_new                    (const char *address,
                                                         GCancellable *cancellable,
                                                         GError **error);

Connect to the FEP server running at address. If address is NULL, it gets the address from the environment variable `LIBFEP_CONTROL_SOCK`.

address :

socket address of the FEP server. [allow-none]

cancellable :

a GCancellable or NULL

error :

a pointer to a NULL GError, or NULL

Returns :

a new FepGClient.

fep_g_client_send_data ()

void                fep_g_client_send_data              (FepGClient *client,
                                                         const char *data,
                                                         gsize length);

Request to send data to the child process of the FEP server.

client :

a FepGClient

data :

data to be sent

length :

length of data

fep_g_client_send_text ()

void                fep_g_client_send_text              (FepGClient *client,
                                                         const char *text);

Request to send data to the child process of the FEP server. text will be converted from UTF-8 to the local encoding in the server.

client :

a FepGClient

text :

text to be sent

fep_g_client_set_cursor_text ()

void                fep_g_client_set_cursor_text        (FepGClient *client,
                                                         const char *text,
                                                         FepGAttribute *attr);

Request to display text at the cursor position on the terminal.

client :

a FepGClient

text :

a cursor text

attr :

a FepGAttribute. [allow-none]

fep_g_client_set_status_text ()

void                fep_g_client_set_status_text        (FepGClient *client,
                                                         const char *text,
                                                         FepGAttribute *attr);

Request to display text at the bottom of the terminal.

client :

a FepGClient

text :

a status text

attr :

a FepGAttribute. [allow-none]

Property Details

The "address" property

  "address"                  gchar*                : Read / Write / Construct Only

FEP control socket address.

Default value: NULL

Signal Details

The "filter-key-event" signal

gboolean            user_function                      (FepGClient *client,
                                                        guint       keyval,
                                                        guint       modifiers,
                                                        gpointer    user_data)      : Run Last

The ::filter-key-event signal is emitted when key event is dispatched.

client :

a FepGClient

keyval :

a keyval

modifiers :

modifier mask

user_data :

user data set when the signal handler was connected.

The "resized" signal

void                user_function                      (FepGClient *client,
                                                        guint       cols,
                                                        guint       rows,
                                                        gpointer    user_data)      : Run Last

The ::resized signal is emitted when terminal is resized.

client :

a FepGClient

cols :

number of columns

rows :

number of rows

user_data :

user data set when the signal handler was connected.