*
* Copyright (C) 2006 Alexander Larsson <alexl@redhat.com>
*
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
+ * This library is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation; either version 2.1 of the License, or
* (at your option) any later version.
*
- * This program is distributed in the hope that it will be useful,
+ * This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
+ * GNU Lesser General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
+ * You should have received a copy of the GNU General Public Lesser
+ * License along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include <config.h>
-#include "gtk/gtkprintoperation.h"
+#include "config.h"
#include <math.h>
+#include "gtk/gtk.h"
static void
draw_page (GtkPrintOperation *operation,
/* Font Fill */
cairo_set_source_rgb (cr, 0, 0.0, 1.0);
cairo_fill (cr);
-
+
g_object_unref (layout);
}
int
main (int argc, char **argv)
{
- GMainLoop *loop;
GtkPrintOperation *print;
- GtkPrintOperationResult res;
GtkPrintSettings *settings;
- g_type_init ();
-
- loop = g_main_loop_new (NULL, TRUE);
+ g_type_init ();
settings = gtk_print_settings_new ();
/* gtk_print_settings_set_printer (settings, "printer"); */
-
+
print = gtk_print_operation_new ();
gtk_print_operation_set_print_settings (print, settings);
gtk_print_operation_set_n_pages (print, 1);
gtk_print_operation_set_unit (print, GTK_UNIT_MM);
g_signal_connect (print, "draw_page", G_CALLBACK (draw_page), NULL);
- res = gtk_print_operation_run (print, GTK_PRINT_OPERATION_ACTION_PRINT, NULL, NULL);
+ gtk_print_operation_run (print, GTK_PRINT_OPERATION_ACTION_PRINT, NULL, NULL);
return 0;
}