FepGClient

FepGClient — Client connection to FEP server

Functions

Properties

gchar * address Read / Write / Construct Only

Signals

gboolean filter-event Run Last
gboolean filter-key-event Run Last
void resized Run Last

Types and Values

Object Hierarchy

    GObject
    ╰── FepGClient

Description

Functions

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.

Parameters

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_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.

Parameters

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.

Parameters

client

a FepGClient

 

text

a status text

 

attr

a FepGAttribute.

[allow-none]

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.

Parameters

client

a FepGClient

 

text

text to be sent

 

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.

Parameters

client

a FepGClient

 

data

data to be sent

 

length

length of data

 

fep_g_client_forward_key_event ()

void
fep_g_client_forward_key_event (FepGClient *client,
                                guint keyval,
                                guint modifiers);

Request to send a key event to the child process of the FEP server.

Parameters

client

a FepGClient

 

keyval

keysym value

 

modifiers

modifiers

 

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().

Parameters

client

a FepGClient

 

Returns

a file descriptor


fep_g_client_dispatch ()

gboolean
fep_g_client_dispatch (FepGClient *client);

Dispatch a key event.

Parameters

client

a FepGClient

 

Returns

TRUE if success, FALSE on error.

Types and Values

struct FepGClientClass

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

Members

filter_key_event ()

class handler for “filter-key-event”

 

resized ()

class handler for “resized”

 

filter_event ()

   

Property Details

The “address” property

  “address”                  gchar *

FEP control socket address.

Flags: Read / Write / Construct Only

Default value: NULL

Signal Details

The “filter-event” signal

gboolean
user_function (FepGClient *client,
               gpointer    event,
               gpointer    user_data)

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

Parameters

client

a FepGClient

 

event

a FepGEvent

 

user_data

user data set when the signal handler was connected.

 

Flags: Run Last


The “filter-key-event” signal

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

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

Parameters

client

a FepGClient

 

keyval

a keyval

 

modifiers

modifier mask

 

source

original string which generated the event

 

source_length

length of source

 

user_data

user data set when the signal handler was connected.

 

Flags: Run Last


The “resized” signal

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

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

Parameters

client

a FepGClient

 

cols

number of columns

 

rows

number of rows

 

user_data

user data set when the signal handler was connected.

 

Flags: Run Last