Skip to content

Commit

Permalink
Implement transform via ipptransform command in libcups3.
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelrsweet committed Nov 5, 2023
1 parent b4eaf8a commit 875164a
Show file tree
Hide file tree
Showing 3 changed files with 562 additions and 1 deletion.
1 change: 1 addition & 0 deletions daemon/cups-locald.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ extern void *LocalDBusService(void *data);

extern const char *LocalDriverAutoAdd(const char *device_info, const char *device_uri, const char *device_id, void *data);
extern bool LocalDriverCallback(pappl_system_t *system, const char *driver_name, const char *device_uri, const char *device_id, pappl_pr_driver_data_t *driver_data, ipp_t **driver_attrs, void *data);
extern bool LocalTransformFilter(pappl_job_t *job, pappl_device_t *device, void *data);


#endif // !CUPS_LOCALD_H
12 changes: 11 additions & 1 deletion daemon/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -213,12 +213,22 @@ main(int argc, // I - Number of command-line arguments

papplSystemSetSaveCallback(system, (pappl_save_cb_t)papplSystemSaveState, (void *)LocalStateFile);

// Setup domain socket listener
// Setup domain socket and loopback listeners
papplSystemAddListeners(system, LocalSocket);
papplSystemAddListeners(system, "localhsot");

// Setup the generic drivers...
papplSystemSetPrinterDrivers(system, sizeof(LocalDrivers) / sizeof(LocalDrivers[0]), LocalDrivers, LocalDriverAutoAdd, /* create_cb */NULL, LocalDriverCallback, NULL);

papplSystemAddMIMEFilter(system, "application/pdf", "application/pdf", LocalTransformFilter, NULL);
papplSystemAddMIMEFilter(system, "application/pdf", "image/pwg-raster", LocalTransformFilter, NULL);
papplSystemAddMIMEFilter(system, "application/pdf", "image/urf", LocalTransformFilter, NULL);
papplSystemAddMIMEFilter(system, "image/jpeg", "application/pdf", LocalTransformFilter, NULL);
papplSystemAddMIMEFilter(system, "image/png", "application/pdf", LocalTransformFilter, NULL);
papplSystemAddMIMEFilter(system, "text/plain", "application/pdf", LocalTransformFilter, NULL);
papplSystemAddMIMEFilter(system, "text/plain", "image/pwg-raster", LocalTransformFilter, NULL);
papplSystemAddMIMEFilter(system, "text/plain", "image/urf", LocalTransformFilter, NULL);

#ifdef HAVE_DBUS
// Start a background thread for D-Bus...
dbus = cupsThreadCreate(LocalDBusService, /*arg*/NULL);
Expand Down
Loading

0 comments on commit 875164a

Please sign in to comment.