Commit c775906e4a1bf45e5c9dc4a810b1ca15d0235d97

  • avatar
  • Carlos Garcia Campos <carlosgc @gn…e.org>
  • Fri Aug 07 09:42:03 CEST 2009
Add gtk_print_operation_get_n_pages_to_print()

It returns the number of pages that will be printed to allow tracking
the progress of a print operation. Fixes bgo#582964.
  
7272 PROP_CUSTOM_TAB_LABEL,
7373 PROP_EMBED_PAGE_SETUP,
7474 PROP_HAS_SELECTION,
75 PROP_SUPPORT_SELECTION
75 PROP_SUPPORT_SELECTION,
76 PROP_N_PAGES_TO_PRINT
7677};
7778
7879static guint signals[LAST_SIGNAL] = { 0 };
402402 case PROP_SUPPORT_SELECTION:
403403 g_value_set_boolean (value, priv->support_selection);
404404 break;
405 case PROP_N_PAGES_TO_PRINT:
406 g_value_set_int (value, priv->nr_of_pages_to_print);
407 break;
405408 default:
406409 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
407410 break;
12701270 P_("TRUE if page setup combos are embedded in GtkPrintDialog"),
12711271 FALSE,
12721272 GTK_PARAM_READWRITE));
1273 /**
1274 * GtkPrintOperation:n-pages-to-print:
1275 *
1276 * The number of pages that will be printed.
1277 *
1278 * Note that this value is set during print preparation phase
1279 * (%GTK_PRINT_STATUS_PREPARING), so this value should never be
1280 * get before the data generation phase (%GTK_PRINT_STATUS_GENERATING_DATA).
1281 * You can connect to the #GtkPrintOperation::status-changed signal
1282 * and call gtk_print_operation_get_n_pages_to_print() when
1283 * print status is %GTK_PRINT_STATUS_GENERATING_DATA.
1284 * This is typically used to track the progress of print operation.
1285 *
1286 * Since: 2.18
1287 */
1288 g_object_class_install_property (gobject_class,
1289 PROP_N_PAGES_TO_PRINT,
1290 g_param_spec_int ("n-pages-to-print",
1291 P_("Number of Pages To Print"),
1292 P_("The number of pages that will be printed."),
1293 -1,
1294 G_MAXINT,
1295 -1,
1296 GTK_PARAM_READABLE));
12731297}
12741298
12751299/**
32153215 g_return_val_if_fail (GTK_IS_PRINT_OPERATION (op), FALSE);
32163216
32173217 return op->priv->has_selection;
3218}
3219
3220/**
3221 * gtk_print_operation_get_n_pages_to_print:
3222 * @op: a #GtkPrintOperation
3223 *
3224 * Returns the number of pages that will be printed.
3225 *
3226 * Note that this value is set during print preparation phase
3227 * (%GTK_PRINT_STATUS_PREPARING), so this function should never be
3228 * called before the data generation phase (%GTK_PRINT_STATUS_GENERATING_DATA).
3229 * You can connect to the #GtkPrintOperation::status-changed signal
3230 * and call gtk_print_operation_get_n_pages_to_print() when
3231 * print status is %GTK_PRINT_STATUS_GENERATING_DATA.
3232 * This is typically used to track the progress of print operation.
3233 *
3234 * Returns: the number of pages that will be printed
3235 *
3236 * Since: 2.18
3237 **/
3238gint
3239gtk_print_operation_get_n_pages_to_print (GtkPrintOperation *op)
3240{
3241 g_return_if_fail (GTK_IS_PRINT_OPERATION (op));
3242
3243 return op->priv->nr_of_pages_to_print;
32183244}
32193245
32203246#define __GTK_PRINT_OPERATION_C__
  
187187void gtk_print_operation_set_embed_page_setup (GtkPrintOperation *op,
188188 gboolean embed);
189189gboolean gtk_print_operation_get_embed_page_setup (GtkPrintOperation *op);
190gint gtk_print_operation_get_n_pages_to_print (GtkPrintOperation *op);
190191
191192GtkPageSetup *gtk_print_run_page_setup_dialog (GtkWindow *parent,
192193 GtkPageSetup *page_setup,