client

client — Client connection to FEP server

Functions

Types and Values

Description

Functions

FepEventFilter ()

int
(*FepEventFilter) (FepEvent *event,
                   void *data);

fep_client_open ()

FepClient *
fep_client_open (const char *address);

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]

Returns

a new FepClient.


fep_client_get_poll_fd ()

int
fep_client_get_poll_fd (FepClient *client);

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

Parameters

client

a FepClient

 

Returns

a file descriptor


fep_client_set_cursor_text ()

void
fep_client_set_cursor_text (FepClient *client,
                            const char *text,
                            FepAttribute *attr);

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

Parameters

client

a FepClient

 

text

a cursor text

 

attr

a FepAttribute

 

fep_client_set_status_text ()

void
fep_client_set_status_text (FepClient *client,
                            const char *text,
                            FepAttribute *attr);

Request to display text at the bottom of the terminal.

Parameters

client

a FepClient

 

text

a status text

 

attr

a FepAttribute

 

fep_client_send_text ()

void
fep_client_send_text (FepClient *client,
                      const char *text);

Request to send text 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 FepClient

 

text

text to be sent

 

fep_client_send_data ()

void
fep_client_send_data (FepClient *client,
                      const char *data,
                      size_t length);

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

Parameters

client

a FepClient

 

data

data to be sent

 

length

length of data

 

fep_client_forward_key_event ()

void
fep_client_forward_key_event (FepClient *client,
                              unsigned int keyval,
                              FepModifierType modifiers);

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

Parameters

client

a FepClient

 

keyval

keysym value

 

modifiers

modifiers

 

fep_client_set_event_filter ()

void
fep_client_set_event_filter (FepClient *client,
                             FepEventFilter filter,
                             void *data);

Set a key event filter which will be called when client receives key events.

Parameters

client

a FepClient

 

filter

a filter function

 

data

user supplied data

 

fep_client_dispatch ()

int
fep_client_dispatch (FepClient *client);

Dispatch a request from server.

Parameters

client

a FepClient

 

Returns

0 on success, -1 on failure.


fep_client_close ()

void
fep_client_close (FepClient *client);

Close the control socket and release the memory allocated for client .

Parameters

client

a FepClient

 

Types and Values

enum FepEventType

Members

FEP_NOTHING

Nothing happend; used to indicate error

 

FEP_KEY_PRESS

Key is pressed

 

FEP_RESIZED

Window is resized

 

FepEvent

typedef struct {
  FepEventType type;
} FepEvent;

Members

FepEventType type;

type of the event

 

FepEventKey

typedef struct {
  FepEvent event;
  unsigned int keyval;
  FepModifierType modifiers;
  char *source;
  size_t source_length;
} FepEventKey;

Members

FepEvent event;

base event struct

 

unsigned int keyval;

keysym value

 

FepModifierType modifiers;

modifier mask

 

char *source;

original string which generated the event

 

size_t source_length;

length of source

 

FepEventResize

typedef struct {
  FepEvent event;
  unsigned int cols;
  unsigned int rows;
} FepEventResize;

Members

FepEvent event;

base event struct

 

unsigned int cols;

number of columns

 

unsigned int rows;

number of rows

 

FepClient

typedef struct _FepClient FepClient;