Skip to content

Instantly share code, notes, and snippets.

View onlyshk's full-sized avatar

Kuleshov Alexander onlyshk

View GitHub Profile
static void draw_page (GtkPrintOperation * oper, GtkPrintContext * context,
gint nr, gpointer user_data)
{
GList* list;
int n = g_list_length (list);
MainWin* mw = (MainWin*)user_data;
GdkPixbuf* pixbuf = gdk_pixbuf_new_from_file(image_list_get_current_file_path (mw->img_list),NULL);
void print_pixbuf(GtkWidget* widget, MainWin* mw)
{
GtkPrintOperation *op;
GtkPrintOperationResult res;
GtkPrintSettings *settings;
op = gtk_print_operation_new ();
gtk_print_operation_set_n_pages (op, g_list_length (mw->img_list->list));
gtk_print_operation_set_unit (op, GTK_UNIT_MM);
static void draw_page (GtkPrintOperation * oper, GtkPrintContext * context,
gint nr, gpointer user_data)
{
//GList* list = NULL;
GdkPixbuf* pixbuf = NULL;
MainWin* mw = (MainWin*)user_data;
int n = g_list_length (mw->img_list);
int i = 0;
/***************************************************************************
* Copyright (C) 2007 by PCMan (Hong Jen Yee) pcman.tw@gmail.com *
* 2010 by shk (Kuleshov Alexander kuleshovmail@gmail.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 *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
/***************************************************************************
* Copyright (C) 2007 by PCMan (Hong Jen Yee) pcman.tw@gmail.com *
* 2010 by shk (Kuleshov Alexander kuleshovmail@gmail.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 *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
GdkPixbuf* sub_pixbuf = NULL;
int i = 0;
int j = 0;
int k = 0;
int n = 0;
guint width = 0;
guint height = 0;
guint width1 = 0;
cairo_rectangle(cr, 1,1,100,190);
cairo_clip (cr);
gdk_cairo_set_source_pixbuf(cr, pixbuf, 0 , 0);
cairo_paint (cr);
/***************************************************************************
* Copyright (C) 2007 by PCMan (Hong Jen Yee) pcman.tw@gmail.com *
* 2010 by shk (Kuleshov Alexander kuleshovmail@gmail.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 *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
#include "printing.h"
static GList* list;
static GtkPrintSettings *settings = NULL;
static void begin_print (GtkPrintOperation * oper, GtkPrintContext * context,
gint nr, gpointer user_data)
{
cairo_t *cr = gtk_print_context_get_cairo_context (context);
GtkPrintSettings* settings = gtk_print_operation_get_print_settings(oper);
int i = 0;
int j = 0;
for (i; i < nr + 1; i++)
{
gdk_cairo_set_source_pixbuf(cr, pixbuf, j, 0);
j += 100;
}