![]() |
![]() |
![]() |
urfkill Reference Manual | ![]() |
---|---|---|---|---|
Top | Description | Object Hierarchy | Properties | Signals |
#include <urfkill.h> #define URF_CLIENT_ERROR #define URF_CLIENT_TYPE_ERROR UrfClient; UrfClientClass; enum UrfClientError; UrfClient * urf_client_new (void
); GQuark urf_client_error_quark (void
); GType urf_client_error_get_type (void
); gboolean urf_client_enumerate_devices_sync (UrfClient *client
,GCancellable *cancellable
,GError **error
); GList * urf_client_get_devices (UrfClient *client
); gboolean urf_client_set_block (UrfClient *client
,UrfSwitchType type
,const gboolean block
,GCancellable *cancellable
,GError **error
); gboolean urf_client_set_block_idx (UrfClient *client
,const guint index
,const gboolean block
,GCancellable *cancellable
,GError **error
); gboolean urf_client_is_inhibited (UrfClient *client
,GError **error
); guint urf_client_inhibit (UrfClient *client
,const char *reason
,GError **error
); void urf_client_uninhibit (UrfClient *client
,const guint cookie
); gboolean urf_client_set_wlan_block (UrfClient *client
,const gboolean block
); gboolean urf_client_set_bluetooth_block (UrfClient *client
,const gboolean block
); gboolean urf_client_set_wwan_block (UrfClient *client
,const gboolean block
); const char * urf_client_get_daemon_version (UrfClient *client
);
"device-added" : Run Last "device-changed" : Run Last "device-removed" : Run Last "rf-key-pressed" : Run Last
A helper GObject to use for accessing urfkill information, and to be notified when it is changed.
typedef struct _UrfClient UrfClient;
The UrfClient struct contains only private fields and should not be directly accessed.
typedef enum { URF_CLIENT_ERROR_GENERAL, URF_CLIENT_NUM_ERRORS } UrfClientError;
UrfClient * urf_client_new (void
);
Creates a new UrfClient object.
Returns : |
a new UrfClient object. |
gboolean urf_client_enumerate_devices_sync (UrfClient *client
,GCancellable *cancellable
,GError **error
);
Enumerate the devices from the daemon.
|
a UrfClient instance |
|
a GCancellable or NULL
|
|
a GError, or NULL
|
Returns : |
TRUE for success, else FALSE and error is used
|
Since 0.3.0
GList * urf_client_get_devices (UrfClient *client
);
Get a list of the device objects.
You must have called urf_client_enumerate_devices_sync before calling this function.
|
a UrfClient instance |
Returns : |
a list of UrfDevice objects. [element-type UrfDevice][transfer none UrfDevice] |
Since 0.2.0
gboolean urf_client_set_block (UrfClient *client
,UrfSwitchType type
,const gboolean block
,GCancellable *cancellable
,GError **error
);
Block or unblock the devices belonging to the type.
This function only changes soft block. Hard block is controlled by BIOS or the hardware and there is no way to change the state of hard block through kernel functions.
|
a UrfClient instance |
|
the type of the devices |
|
TRUE to block the devices or FALSE to unblock
|
|
a GCancellable or NULL
|
|
a GError, or NULL
|
Returns : |
TRUE for success, else FALSE and error is used
|
Since 0.2.0
gboolean urf_client_set_block_idx (UrfClient *client
,const guint index
,const gboolean block
,GCancellable *cancellable
,GError **error
);
Block or unblock the device by the index.
This function only changes soft block. Hard block is controlled by BIOS or the hardware and there is no way to change the state of hard block through kernel functions.
|
a UrfClient instance |
|
the index of the device |
|
TRUE to block the device or FALSE to unblock
|
|
a GCancellable or NULL
|
|
a GError, or NULL
|
Returns : |
TRUE for success, else FALSE and error is used
|
Since 0.2.0
gboolean urf_client_is_inhibited (UrfClient *client
,GError **error
);
Get whether the key control is inhibited or not,
|
a UrfClient instance |
|
a GError, or NULL
|
Returns : |
TRUE if the key control is inhibited |
Since 0.2.0
guint urf_client_inhibit (UrfClient *client
,const char *reason
,GError **error
);
Inhibit the rfkill key handling function for this session.
|
a UrfClient instance |
|
the reason to inhibit the key control |
|
a GError, or NULL
|
Returns : |
the cookie and error is used
|
Since 0.2.0
void urf_client_uninhibit (UrfClient *client
,const guint cookie
);
Cancel a previous call to urf_client_inhibit identified by the cookie.
|
a UrfClient instance |
|
the cookie |
Since 0.2.0
gboolean urf_client_set_wlan_block (UrfClient *client
,const gboolean block
);
Block or unblock the WLAN devices. This is a convenient function and the underlying function is urf_client_set_block.
|
a UrfClient instance |
|
TRUE to block the WLAN devices or FALSE to unblock
|
Returns : |
TRUE for success, else FALSE |
Since 0.2.0
gboolean urf_client_set_bluetooth_block (UrfClient *client
,const gboolean block
);
Block or unblock the bluetooth devices. This is a convenient function and the underlying function is urf_client_set_block.
|
a UrfClient instance |
|
TRUE to block the bluetooth devices or FALSE to unblock
|
Returns : |
TRUE for success, else FALSE |
Since 0.2.0
gboolean urf_client_set_wwan_block (UrfClient *client
,const gboolean block
);
Block or unblock the wireless WAN devices. This is a convenient function and the underlying function is urf_client_set_block.
|
a UrfClient instance |
|
TRUE to block the WWAN devices or FALSE to unblock
|
Returns : |
TRUE for success, else FALSE |
Since 0.2.0
"daemon-version"
property"daemon-version" gchar* : Read
The running daemon version.
Default value: NULL
Since 0.2.0
"key-control"
property"key-control" gboolean : Read
Whether the key control in the daemon is enabled or not
Default value: FALSE
Since 0.2.0
"device-added"
signalvoid user_function (UrfClient *client, UrfDevice *device, gpointer user_data) : Run Last
The device-added signal is emitted when a rfkill device is added.
Since 0.2.0
"device-changed"
signalvoid user_function (UrfClient *client, UrfDevice *device, gpointer user_data) : Run Last
The device-changed signal is emitted when a rfkill device is changed.
Since 0.2.0
"device-removed"
signalvoid user_function (UrfClient *client, UrfDevice *device, gpointer user_data) : Run Last
The device-removed signal is emitted when a rfkill device is removed.
Since 0.2.0
"rf-key-pressed"
signalvoid user_function (UrfClient *client, gint keycode, gpointer user_data) : Run Last
The rf-key-pressed signal is emitted when a rfkill key is pressed.
Since 0.2.0
|
the UrfClient instance that emitted the signal |
|
the keycode from the input device |
|
user data set when the signal handler was connected. |