![]() |
![]() |
![]() |
Unique Reference Manual | ![]() |
---|---|---|---|---|
UniqueBackend; UniqueBackendClass; UniqueBackend* unique_backend_create (void); const gchar* unique_backend_get_name (UniqueBackend *backend); void unique_backend_set_name (UniqueBackend *backend, const gchar *name); const gchar* unique_backend_get_startup_id (UniqueBackend *backend); void unique_backend_set_startup_id (UniqueBackend *backend, const gchar *startup_id); GdkScreen* unique_backend_get_screen (UniqueBackend *backend); void unique_backend_set_screen (UniqueBackend *backend, GdkScreen *screen); gboolean unique_backend_request_name (UniqueBackend *backend); UniqueResponse unique_backend_send_message (UniqueBackend *backend, gint command_id, UniqueMessageData *message_data, guint time_);
UniqueBackend is the base, abstract class implemented by the different IPC mechanisms used by Unique. Each UniqueApp instance creates a UniqueBackend to request the name or to send messages.
typedef struct _UniqueBackend UniqueBackend;
The UniqueBackend structure contains only private data and should only be accessed using the provided functions.
typedef struct { /* vtable, not signals */ gboolean (* request_name) (UniqueBackend *backend); UniqueResponse (* send_message) (UniqueBackend *backend, gint command_id, UniqueMessageData *message_data, guint time_); } UniqueBackendClass;
The class that should be implemented by every backend for UniqueApp.
request_name () |
This method should be used to request the name for the
instance set using unique_backend_set_name()
|
send_message () |
This method should be used to send a message to a running instance |
UniqueBackend* unique_backend_create (void);
Creates a UniqueBackend using the default backend defined at
compile time. You can override the default backend by setting the
UNIQUE_BACKEND
environment variable with the
name of the desired backend.
Returns : | the newly created UniqueBackend instance |
const gchar* unique_backend_get_name (UniqueBackend *backend);
FIXME
backend : |
FIXME |
Returns : | FIXME |
void unique_backend_set_name (UniqueBackend *backend, const gchar *name);
FIXME
backend : |
FIXME |
name : |
FIXME |
const gchar* unique_backend_get_startup_id (UniqueBackend *backend);
FIXME
backend : |
FIXME |
Returns : | FIXME |
void unique_backend_set_startup_id (UniqueBackend *backend, const gchar *startup_id);
FIXME
backend : |
FIXME |
startup_id : |
FIXME |
GdkScreen* unique_backend_get_screen (UniqueBackend *backend);
FIXME
backend : |
FIXME |
Returns : | FIXME |
void unique_backend_set_screen (UniqueBackend *backend, GdkScreen *screen);
FIXME
backend : |
FIXME |
screen : |
FIXME |
gboolean unique_backend_request_name (UniqueBackend *backend);
Requests the name set using unique_backend_set_name()
using backend
.
backend : |
a UniqueBackend |
Returns : | TRUE if the name was assigned to us, FALSE if there
already is a registered name
|
UniqueResponse unique_backend_send_message (UniqueBackend *backend, gint command_id, UniqueMessageData *message_data, guint time_);
Sends command_id
, and optionally message_data
, to a running instance
using backend
.
backend : |
a UniqueBackend |
command_id : |
command to send |
message_data : |
message to send, or NULL
|
time_ : |
time of the command emission, or 0 for the current time |
Returns : | a UniqueResponse value sent by the running instance |