NS_IMETHODIMP nsPrintSettingsGTK::SetupSilentPrinting() { // We have to get a printer here, rather than when the print settings are constructed. // This is because when we request sync, GTK makes us wait in the *event loop* while waiting // for the enumeration to finish. We must do this when event loop runs are expected. gtk_enumerate_printers(printer_enumerator, this, nullptr, TRUE); // XXX If no default printer set, get the first one. if (!GTK_IS_PRINTER(mGTKPrinter)) gtk_enumerate_printers(ref_printer, this, nullptr, TRUE); return NS_OK; }
static VALUE rg_s_each(int argc, VALUE *argv, VALUE self) { VALUE wait, block; rb_scan_args(argc, argv, "01", &wait); block = rb_block_proc(); G_CHILD_ADD(mGtk, block); gtk_enumerate_printers(each_printer, (gpointer)block, remove_callback_reference, RVAL2CBOOL(wait)); return self; }