*/
static GVariant *
create_attributes (const gchar *printer_uri,
- gchar **additional_attrs,
- gchar **additional_labels)
+ const char **additional_attrs,
+ const char **additional_labels)
{
GVariantBuilder *attr_builder = NULL;
GVariant *ret = NULL;
GVariant *attributes = NULL,
*properties = NULL,
*secret = NULL;
- gchar **additional_attrs = NULL,
+ const char **additional_attrs = NULL,
**additional_labels = NULL,
*password = NULL;
SecretsServiceData *task_data = g_task_get_task_data (task);
length = g_strv_length (task_data->auth_info_labels);
- additional_attrs = g_new0 (gchar *, length + 1);
- additional_labels = g_new0 (gchar *, length + 1);
+ additional_attrs = g_new0 (const char *, length + 1);
+ additional_labels = g_new0 (const char *, length + 1);
/* The labels user and server are chosen to be compatible with
the attributes used by system-config-printer */
for (i = 0; task_data->auth_info_labels[i] != NULL; i++)
get_secret_cb,
task);
break;
+ default:
+ ;
}
}
get_secret_cb,
task);
break;
+ default:
+ ;
}
}
g_variant_unref (output);
get_secret_cb,
task);
break;
+ default:
+ ;
}
}
task);
break;
}
+ default:
+ ;
}
}
static GObjectClass *backend_parent_class;
-static void gtk_print_backend_cups_class_init (GtkPrintBackendCupsClass *class);
-static void gtk_print_backend_cups_init (GtkPrintBackendCups *impl);
static void gtk_print_backend_cups_finalize (GObject *object);
static void gtk_print_backend_cups_dispose (GObject *object);
static void cups_get_printer_list (GtkPrintBackend *print_backend);
g_io_module_query (void)
{
char *eps[] = {
- GTK_PRINT_BACKEND_EXTENSION_POINT_NAME,
+ (char *)GTK_PRINT_BACKEND_EXTENSION_POINT_NAME,
NULL
};
* if available.
*/
static GtkPrinterOption *
-setup_ipp_option (gchar *ipp_option_name,
- gchar *ipp_choice_default,
+setup_ipp_option (const char *ipp_option_name,
+ const char *ipp_choice_default,
GList *ipp_choices,
GtkPrinterOptionSet *set)
{
{
gtk_printer_option_choices_from_array (option,
length,
- choices,
- choices_display);
+ (const char **)choices,
+ (const char **)choices_display);
}
option_set_is_ipp_option (option, TRUE);
gtk_printer_option_set_add (set, option);
- g_free (choices);
- g_free (choices_display);
+ g_strfreev (choices);
+ g_strfreev (choices_display);
}
/* The option exists. Set its default value if available. */
GtkPrinterOption *option;
ppd_file_t *ppd_file;
int i;
- char *print_at[] = { "now", "at", "on-hold" };
- char *n_up[] = {"1", "2", "4", "6", "9", "16" };
- char *prio[] = {"100", "80", "50", "30" };
+ const char *print_at[] = { "now", "at", "on-hold" };
+ const char *n_up[] = {"1", "2", "4", "6", "9", "16" };
+ const char *prio[] = {"100", "80", "50", "30" };
/* Translators: These strings name the possible values of the
* job priority option in the print dialog
*/
- char *prio_display[] = {N_("Urgent"), N_("High"), N_("Medium"), N_("Low") };
- char *n_up_layout[] = { "lrtb", "lrbt", "rltb", "rlbt", "tblr", "tbrl", "btlr", "btrl" };
+ const char *prio_display[] = {N_("Urgent"), N_("High"), N_("Medium"), N_("Low") };
+ const char *n_up_layout[] = { "lrtb", "lrbt", "rltb", "rlbt", "tblr", "tbrl", "btlr", "btrl" };
/* Translators: These strings name the possible arrangements of
* multiple pages on a sheet when printing
*/
- char *n_up_layout_display[] = { N_("Left to right, top to bottom"), N_("Left to right, bottom to top"),
- N_("Right to left, top to bottom"), N_("Right to left, bottom to top"),
- N_("Top to bottom, left to right"), N_("Top to bottom, right to left"),
- N_("Bottom to top, left to right"), N_("Bottom to top, right to left") };
+ const char *n_up_layout_display[] = { N_("Left to right, top to bottom"), N_("Left to right, bottom to top"),
+ N_("Right to left, top to bottom"), N_("Right to left, bottom to top"),
+ N_("Top to bottom, left to right"), N_("Top to bottom, right to left"),
+ N_("Bottom to top, left to right"), N_("Bottom to top, right to left") };
char *name;
int num_opts;
cups_option_t *opts = NULL;
if (backend != NULL && printer != NULL)
{
- char *cover_default[] = {
+ const char *cover_default[] = {
"none",
"classified",
"confidential",
"topsecret",
"unclassified"
};
- char *cover_display_default[] = {
+ const char *cover_display_default[] = {
/* Translators, these strings are names for various 'standard' cover
* pages that the printing system may support.
*/
char **cover_display = NULL;
char **cover_display_translated = NULL;
gint num_of_covers = 0;
- gpointer value;
+ gconstpointer value;
gint j;
/* Translators, this string is used to label the pages-per-sheet option
*/
option = gtk_printer_option_new ("gtk-cover-before", C_("printer option", "Before"), GTK_PRINTER_OPTION_TYPE_PICKONE);
gtk_printer_option_choices_from_array (option, num_of_covers,
- cover, cover_display_translated);
+ (const char **)cover, (const char **)cover_display_translated);
if (cups_printer->default_cover_before != NULL)
gtk_printer_option_set (option, cups_printer->default_cover_before);
*/
option = gtk_printer_option_new ("gtk-cover-after", C_("printer option", "After"), GTK_PRINTER_OPTION_TYPE_PICKONE);
gtk_printer_option_choices_from_array (option, num_of_covers,
- cover, cover_display_translated);
+ (const char **)cover, (const char **)cover_display_translated);
if (cups_printer->default_cover_after != NULL)
gtk_printer_option_set (option, cups_printer->default_cover_after);
else
switch (gtk_page_setup_get_orientation (page_setup))
{
- case GTK_PAGE_ORIENTATION_PORTRAIT:
- break;
case GTK_PAGE_ORIENTATION_LANDSCAPE:
if (layout < 4)
layout = layout + 2 + 4 * (1 - layout / 2);
else
layout = layout - 6 + 4 * (1 - (layout - 4) / 2);
break;
+
+ case GTK_PAGE_ORIENTATION_PORTRAIT:
+ default:
+ break;
}
enum_class = g_type_class_ref (GTK_TYPE_NUMBER_UP_LAYOUT);
static GObjectClass *backend_parent_class;
-static void gtk_print_backend_file_class_init (GtkPrintBackendFileClass *class);
-static void gtk_print_backend_file_init (GtkPrintBackendFile *impl);
static void file_printer_get_settings_from_options (GtkPrinter *printer,
GtkPrinterOptionSet *options,
GtkPrintSettings *settings);
g_io_module_query (void)
{
char *eps[] = {
- GTK_PRINT_BACKEND_EXTENSION_POINT_NAME,
+ (char *)GTK_PRINT_BACKEND_EXTENSION_POINT_NAME,
NULL
};
switch (format)
{
default:
+ case N_FORMATS:
case FORMAT_PDF:
extension = "pdf";
break;
switch (format)
{
default:
+ case N_FORMATS:
case FORMAT_PDF:
surface = cairo_pdf_surface_create_for_stream (_cairo_write, cache_io, width, height);
break;
{
GtkPrinterOptionSet *set;
GtkPrinterOption *option;
- const gchar *n_up[] = {"1", "2", "4", "6", "9", "16" };
- const gchar *pages_per_sheet = NULL;
- const gchar *format_names[N_FORMATS] = { N_("PDF"), N_("PostScript"), N_("SVG") };
- const gchar *supported_formats[N_FORMATS];
- gchar *display_format_names[N_FORMATS];
+ const char *n_up[] = {"1", "2", "4", "6", "9", "16" };
+ const char *pages_per_sheet = NULL;
+ const char *format_names[N_FORMATS] = { N_("PDF"), N_("PostScript"), N_("SVG") };
+ const char *supported_formats[N_FORMATS];
+ const char *display_format_names[N_FORMATS];
gint n_formats = 0;
OutputFormat format;
- gchar *uri;
+ char *uri;
gint current_format = 0;
_OutputFormatChangedData *format_changed_data;
option = gtk_printer_option_new ("gtk-n-up", _("Pages per _sheet:"), GTK_PRINTER_OPTION_TYPE_PICKONE);
gtk_printer_option_choices_from_array (option, G_N_ELEMENTS (n_up),
- (char **) n_up, (char **) n_up /* FIXME i18n (localised digits)! */);
+ n_up, n_up /* FIXME i18n (localised digits)! */);
if (settings)
pages_per_sheet = gtk_print_settings_get (settings, GTK_PRINT_SETTINGS_NUMBER_UP);
if (pages_per_sheet)
switch (format)
{
default:
+ case N_FORMATS:
case FORMAT_PDF:
current_format = FORMAT_PDF;
break;
option->group = g_strdup ("GtkPrintDialogExtension");
gtk_printer_option_choices_from_array (option, n_formats,
- (char **) supported_formats,
- display_format_names);
+ supported_formats,
+ display_format_names);
gtk_printer_option_set (option, supported_formats[current_format]);
gtk_printer_option_set_add (set, option);
switch (format)
{
case FORMAT_PDF:
+ case N_FORMATS:
gtk_print_job_set_rotate (print_job, FALSE);
break;
default: