17493
|
1 |
diff -urN gtk+-2.18.5/modules/printbackends/papi/gtkprintbackendpapi.c ../../SUNWgtk2-2.18.5.hacked/i386/gtk+-2.18.5/modules/printbackends/papi/gtkprintbackendpapi.c
|
|
2 |
--- gtk+-2.18.5/modules/printbackends/papi/gtkprintbackendpapi.c 2010-01-29 10:17:03.373625542 +0000
|
|
3 |
+++ ../../SUNWgtk2-2.18.5.hacked/i386/gtk+-2.18.5/modules/printbackends/papi/gtkprintbackendpapi.c 2010-01-29 10:20:00.173396452 +0000
|
|
4 |
@@ -26,6 +26,7 @@
|
|
5 |
#include <fcntl.h>
|
|
6 |
#include <stdlib.h>
|
|
7 |
#include <string.h>
|
|
8 |
+#include <libscf.h>
|
|
9 |
#include <papi.h>
|
|
10 |
|
|
11 |
#include <config.h>
|
|
12 |
@@ -124,6 +125,33 @@
|
|
13 |
&print_backend_papi_info, 0);
|
|
14 |
}
|
|
15 |
|
|
16 |
+/*
|
|
17 |
+ * Test to see if CUPS is the "active" print service on Solaris by looking for
|
|
18 |
+ * a special "general/active" boolean property in the CUPS service instance
|
|
19 |
+ * svc:/application/cups/scheduler:default. If it exists and is true, CUPS
|
|
20 |
+ * is the active print service.
|
|
21 |
+ */
|
|
22 |
+static int
|
|
23 |
+cups_is_active()
|
|
24 |
+{
|
|
25 |
+ int active = 0;
|
|
26 |
+
|
|
27 |
+ scf_simple_prop_t *prop = scf_simple_prop_get(NULL,
|
|
28 |
+ "svc:/application/cups/scheduler:default",
|
|
29 |
+ "general", "active");
|
|
30 |
+
|
|
31 |
+ if ((prop != NULL) && (scf_simple_prop_numvalues(prop) > 0)) {
|
|
32 |
+ uint8_t *value = scf_simple_prop_next_boolean(prop);
|
|
33 |
+
|
|
34 |
+ if (value != NULL)
|
|
35 |
+ active = *value;
|
|
36 |
+ }
|
|
37 |
+
|
|
38 |
+ scf_simple_prop_free(prop);
|
|
39 |
+
|
|
40 |
+ return (active);
|
|
41 |
+}
|
|
42 |
+
|
|
43 |
G_MODULE_EXPORT void
|
|
44 |
pb_module_init (GTypeModule *module)
|
|
45 |
{
|
|
46 |
@@ -142,6 +170,9 @@
|
|
47 |
{
|
|
48 |
static gboolean loaded = FALSE;
|
|
49 |
|
|
50 |
+ if (cups_is_active ())
|
|
51 |
+ return NULL;
|
|
52 |
+
|
|
53 |
if (!loaded)
|
|
54 |
{
|
|
55 |
GModule *papi;
|