CAPS Universe documentation
1.0.4
All you need to know to be successful
|
Client side DBUS CAPS printing cooordinator connection for printing client. More...
Data Structures | |
struct | dbus_method_list |
Functions | |
static DBusHandlerResult | dbus_report_error (DBusConnection *connection, DBusMessage *message, const char *error_name, const char *error_message) |
static DBusHandlerResult | dbus_report_unknown_pr_id (DBusConnection *connection, DBusMessage *message) |
static void | dbus_job_user_complete_notifier (DBusConnection *connection, caps_identifier pr_id, caps_identifier job_id) |
static DBusHandlerResult | dbus_cancel_printing_job (DBusConnection *connection, DBusMessage *message, struct caps_coordinator *database) |
static DBusHandlerResult | dbus_get_printing_job_state (DBusConnection *connection, DBusMessage *message, struct caps_coordinator *database) |
static DBusHandlerResult | dbus_commit_printing_job (DBusConnection *connection, DBusMessage *message, struct caps_coordinator *database) |
static DBusHandlerResult | dbus_get_printers_state_dispatch (DBusConnection *connection, DBusMessage *message, struct caps_coordinator *database) |
static DBusHandlerResult | dbus_printing_job_progression_get (DBusConnection *connection, DBusMessage *message, struct caps_coordinator *database) |
static DBusHandlerResult | dbus_get_printers_PPD_dispatch (DBusConnection *connection, DBusMessage *message, struct caps_coordinator *database) |
static DBusHandlerResult | dbus_get_printers_info_dispatch (DBusConnection *connection, DBusMessage *message, struct caps_coordinator *database) |
static DBusHandlerResult | dbus_get_printer_list_dispatch (DBusConnection *connection, DBusMessage *message, struct caps_coordinator *database) |
static int | check_compatibility (int cmajor, int cminor, int cmicro) |
static DBusHandlerResult | dbus_client_introduction_dispatch (DBusConnection *connection, DBusMessage *message, struct caps_coordinator *database) |
void | dbus_client_send_provider_change_notifier (DBusConnection *connection, caps_identifier pr_id, const struct object_state_prn *pstate) |
void | dbus_client_send_job_change_notifier (DBusConnection *connection, caps_identifier pr_id, caps_identifier job_id, const struct object_state_job *jstate, const struct object_progression_job *jprog) |
static DBusHandlerResult | distribute_client_messages (DBusConnection *connection, DBusMessage *message, struct caps_coordinator *database) |
DBusHandlerResult | caps_dbus_client_dispatch (DBusConnection *connection, DBusMessage *message, void *data) |
Variables | |
static const struct dbus_method_list | client_rpc_method_list [] |
static const char * | introspect_xml_client_config |
This is the DBUS interface for printing clients.
|
static |
Convenience function to report an error via DBUS
[in] | connection | DBUS connection |
[in] | message | DBUS message (already pre-processed for this method) |
[in] | error_name | A DBUS conform path (...strange thing) |
[in] | error_message | The error messagte itself |
|
static |
|
static |
Notify clients about a job cancellation and completion, made by the user
[in] | connection | DBUS connection |
[in] | pr_id | Corresponding printer ID the job was finished on |
[in] | job_id | The ID of the finished job |
Separate function just for easier maintenance.
It first sends the cancellation notifier and after that the completion notifier to cover all required state changes according to Print Job States and Notifiers.
|
static |
DBUS printing client RPC: cancel an already committed specific printing job
[in] | connection | DBUS connection |
[in] | message | DBUS message (already pre-processed for this method) |
[in] | database | Our local database (printing providers, jobs, ...) |
DBUS_HANDLER_RESULT_HANDLED | If an answer to the client was sent |
DBUS_HANDLER_RESULT_NOT_YET_HANDLED | If the received parameters were invalid |
Related to CANCEL_PRINTING_JOB_METHOD and CANCEL_PRINTING_JOB_XML
Related to the job notifier state changes. Calling this functions deals with the state transistions:
|
static |
DBUS printing client RPC: get the processing state of a specific job
[in] | connection | DBUS connection |
[in] | message | DBUS message (already pre-processed for this method) |
[in] | database | Our local database (printing providers, jobs, ...) |
DBUS_HANDLER_RESULT_HANDLED | If an answer to the client was sent |
DBUS_HANDLER_RESULT_NOT_YET_HANDLED | If the received parameters were invalid |
Related to GET_PRINTING_JOB_STATE_METHOD and GET_PRINTING_JOB_STATE_XML
|
static |
DBUS printing client RPC: commit a new printing job to the printing coordinator
[in] | connection | DBUS connection |
[in] | message | DBUS message (already pre-processed for this method) |
[in] | database | Our local database (printing providers, jobs, ...) |
DBUS_HANDLER_RESULT_HANDLED | If an answer to the client was sent |
DBUS_HANDLER_RESULT_NOT_YET_HANDLED | If the received parameters were invalid |
Related to DBUS method COMMIT_PRINTING_JOB_METHOD and introspection COMMIT_PRINTING_JOB_METHOD_XML.
Counterpart in libcapsclient is caps_cl_job_commit()
|
static |
DBUS printing client RPC: get the working state of a specific printing provider
[in] | connection | DBUS connection |
[in] | message | DBUS message (already pre-processed for this method) |
[in] | database | Our local database (printing providers, jobs, ...) |
DBUS_HANDLER_RESULT_HANDLED | If an answer to the client was sent |
DBUS_HANDLER_RESULT_NOT_YET_HANDLED | If the received parameters were invalid |
Related to DBUS method GET_PRINTERS_STATE_METHOD and introspection GET_PRINTERS_STATE_XML
Counterpart in libcapsclient is caps_cl_printer_state_get()
|
static |
DBUS printing client RPC: get the printing progression info for a specified job
[in] | connection | DBUS connection |
[in] | message | DBUS message (already pre-processed for this method) |
[in] | database | Our local database (printing providers, jobs, ...) |
DBUS_HANDLER_RESULT_HANDLED | If an answer to the client was sent |
DBUS_HANDLER_RESULT_NOT_YET_HANDLED | If the received parameters were invalid |
Related to GET_PRINTING_JOB_PROGRESSION_METHOD and GET_PRINTING_JOB_PROGRESSION_XML
Counterpart is caps_cl_job_progression_get()
|
static |
DBUS printing client RPC: get the PPD information a specific printing provider
[in] | connection | DBUS connection |
[in] | message | DBUS message (already pre-processed for this method) |
[in] | database | Our local database (printing providers, jobs, ...) |
DBUS_HANDLER_RESULT_HANDLED | If an answer to the client was sent |
DBUS_HANDLER_RESULT_NOT_YET_HANDLED | If the received parameters were invalid |
Related to GET_PRINTERS_PPD_METHOD and GET_PRINTERS_PPD_XML
Counterpart is caps_cl_printer_PPD_get()
|
static |
DBUS printing client RPC: get generic information about a specific printing provider
[in] | connection | DBUS connection |
[in] | message | DBUS message (already pre-processed for this method) |
[in] | database | Our local database (printing providers, jobs, ...) |
DBUS_HANDLER_RESULT_HANDLED | If an answer to the client was sent |
DBUS_HANDLER_RESULT_NOT_YET_HANDLED | If the received parameters were invalid |
Related to GET_PRINTERS_INFO_METHOD and GET_PRINTERS_INFO_XML
Counterpart is caps_cl_printer_info_get() in libcapsclient.c
|
static |
DBUS printing client RPC: get a list of currently available printing providers
[in] | connection | DBUS connection |
[in] | message | DBUS message (already pre-processed for this method) |
[in] | database | Our local database (printing providers, jobs, ...) |
DBUS_HANDLER_RESULT_HANDLED | If an answer to the client was sent |
DBUS_HANDLER_RESULT_NOT_YET_HANDLED | If the received parameters were invalid |
Related to GET_PRINTER_LIST_METHOD and GET_PRINTER_LIST_XML parameters
Counterpart is caps_cl_printer_list_get()
|
static |
Check if this version can service callers libcapsclient version
[in] | cmajor | Client's libcapsclient major version |
[in] | cminor | Client's libcapsclient minor version |
[in] | cmicro | Client's libcapsclient micro version |
0 | Callers libcapsclient version can be served |
-ENOSYS | No way to service callers libcapsclient version |
If we are called by an older libcapsclient we must reject the connection, if the expected (by the client) and currently used dbus interface cannot work together.
|
static |
DBUS printing client RPC: the client introduces itself
[in] | connection | DBUS connection |
[in] | message | DBUS message (already pre-processed for this method) |
[in] | database | Our local database (printing providers, jobs, ...) |
DBUS_HANDLER_RESULT_HANDLED | If an answer to the client was sent |
DBUS_HANDLER_RESULT_NOT_YET_HANDLED | If the received parameters were invalid |
Currently we ignore the content of the message. In future releases it may help to be backward compatible.
Related to DBUS method CL_INTRODUCTION_METHOD and introspection CL_INTRODUCTION_XML parameters
Counterpart in libcapsclient is client_introduction()
void dbus_client_send_provider_change_notifier | ( | DBusConnection * | connection, |
caps_identifier | pr_id, | ||
const struct object_state_prn * | pstate | ||
) |
DBUS printing client RPC: notify clients about a change in the available printing provider list
[in] | connection | DBUS connection |
[in] | pr_id | Printer identifier which has changed (to be discussed!) |
[in] | pstate | Current printer state (can be NULL) |
A printing provider change event can be of:
pstate
is NULL, only the base information is availablevoid dbus_client_send_job_change_notifier | ( | DBusConnection * | connection, |
caps_identifier | pr_id, | ||
caps_identifier | job_id, | ||
const struct object_state_job * | jstate, | ||
const struct object_progression_job * | jprog | ||
) |
DBUS printing client RPC: notify clients about a change in a job status
[in] | connection | DBUS connection |
[in] | pr_id | Printer identifier where the job state has changed |
[in] | job_id | Job identifier where something has changed |
[in] | jstate | New job's state description (can be NULL) |
[in] | jprog | New job's progression description (can be NULL) |
A job change can be of:
|
static |
DBUS printing client RPC: process method calls from the printing client side by passing it to a corresponding function
[in] | connection | The DBUS connection info |
[in] | message | The message to process |
[in,out] | database | The internal printer database |
DBUS_HANDLER_RESULT_HANDLED | If an answer to the client was sent |
DBUS_HANDLER_RESULT_NOT_YET_HANDLED | If the received parameters were invalid or the called method is unknown |
DBusHandlerResult caps_dbus_client_dispatch | ( | DBusConnection * | connection, |
DBusMessage * | message, | ||
void * | data | ||
) |
DBUS printing client RPC: central callback for the client side of the DBUS interface
[in] | connection | DBUS connection |
[in] | message | DBUS message |
[in] | data | Our local database (printing providers, jobs, ...) |
DBUS_HANDLER_RESULT_HANDLED | If an answer to the client was sent |
DBUS_HANDLER_RESULT_NOT_YET_HANDLED | If the received parameters were invalid or the called method is unknown or the data parameter was NULL |
It seems the data is NULL, if the message is for the introspective interface! WTF? At least one time the assert() matches when I had used the d-feet tool to view the introspection data
|
static |
|
static |