]> Pileus Git - ~andy/gtk/blobdiff - gtk/gtkprintoperationpreview.c
Popdown the bubble window when text view is scrolled
[~andy/gtk] / gtk / gtkprintoperationpreview.c
index 776fb362026ad80cdc0895e80051025cc5e68081..b996d35df4c9d467c906e0a03aa394b2bc17109e 100644 (file)
@@ -13,9 +13,7 @@
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
+ * License along with this library. If not, see <http://www.gnu.org/licenses/>.
  */
 
 #include "config.h"
@@ -23,7 +21,6 @@
 #include "gtkprintoperationpreview.h"
 #include "gtkmarshalers.h"
 #include "gtkintl.h"
-#include "gtkalias.h"
 
 
 static void gtk_print_operation_preview_base_init (gpointer g_iface);
@@ -35,7 +32,7 @@ gtk_print_operation_preview_get_type (void)
 
   if (!print_operation_preview_type)
     {
-      static const GTypeInfo print_operation_preview_info =
+      const GTypeInfo print_operation_preview_info =
       {
         sizeof (GtkPrintOperationPreviewIface), /* class_size */
        gtk_print_operation_preview_base_init,   /* base_init */
@@ -65,6 +62,16 @@ gtk_print_operation_preview_base_init (gpointer g_iface)
 
   if (!initialized)
     {
+      /**
+       * GtkPrintOperationPreview::ready:
+       * @preview: the object on which the signal is emitted
+       * @context: the current #GtkPrintContext
+       *
+       * The ::ready signal gets emitted once per preview operation,
+       * before the first page is rendered.
+       * 
+       * A handler for this signal can be used for setup tasks.
+       */
       g_signal_new (I_("ready"),
                    GTK_TYPE_PRINT_OPERATION_PREVIEW,
                    G_SIGNAL_RUN_LAST,
@@ -74,6 +81,19 @@ gtk_print_operation_preview_base_init (gpointer g_iface)
                    G_TYPE_NONE, 1,
                    GTK_TYPE_PRINT_CONTEXT);
 
+      /**
+       * GtkPrintOperationPreview::got-page-size:
+       * @preview: the object on which the signal is emitted
+       * @context: the current #GtkPrintContext
+       * @page_setup: the #GtkPageSetup for the current page
+       *
+       * The ::got-page-size signal is emitted once for each page
+       * that gets rendered to the preview. 
+       *
+       * A handler for this signal should update the @context
+       * according to @page_setup and set up a suitable cairo
+       * context, using gtk_print_context_set_cairo_context().
+       */
       g_signal_new (I_("got-page-size"),
                    GTK_TYPE_PRINT_OPERATION_PREVIEW,
                    G_SIGNAL_RUN_LAST,
@@ -88,7 +108,23 @@ gtk_print_operation_preview_base_init (gpointer g_iface)
     }
 }
 
-
+/**
+ * gtk_print_operation_preview_render_page:
+ * @preview: a #GtkPrintOperationPreview
+ * @page_nr: the page to render
+ *
+ * Renders a page to the preview, using the print context that
+ * was passed to the #GtkPrintOperation::preview handler together
+ * with @preview.
+ *
+ * A custom iprint preview should use this function in its ::expose
+ * handler to render the currently selected page.
+ * 
+ * Note that this function requires a suitable cairo context to 
+ * be associated with the print context. 
+ *
+ * Since: 2.10 
+ */
 void    
 gtk_print_operation_preview_render_page (GtkPrintOperationPreview *preview,
                                         gint                      page_nr)
@@ -99,6 +135,16 @@ gtk_print_operation_preview_render_page (GtkPrintOperationPreview *preview,
                                                                page_nr);
 }
 
+/**
+ * gtk_print_operation_preview_end_preview:
+ * @preview: a #GtkPrintOperationPreview
+ *
+ * Ends a preview. 
+ *
+ * This function must be called to finish a custom print preview.
+ *
+ * Since: 2.10
+ */
 void
 gtk_print_operation_preview_end_preview (GtkPrintOperationPreview *preview)
 {
@@ -107,6 +153,18 @@ gtk_print_operation_preview_end_preview (GtkPrintOperationPreview *preview)
   GTK_PRINT_OPERATION_PREVIEW_GET_IFACE (preview)->end_preview (preview);
 }
 
+/**
+ * gtk_print_operation_preview_is_selected:
+ * @preview: a #GtkPrintOperationPreview
+ * @page_nr: a page number
+ *
+ * Returns whether the given page is included in the set of pages that
+ * have been selected for printing.
+ * 
+ * Returns: %TRUE if the page has been selected for printing
+ *
+ * Since: 2.10
+ */
 gboolean
 gtk_print_operation_preview_is_selected (GtkPrintOperationPreview *preview,
                                         gint                      page_nr)
@@ -115,7 +173,3 @@ gtk_print_operation_preview_is_selected (GtkPrintOperationPreview *preview,
 
   return GTK_PRINT_OPERATION_PREVIEW_GET_IFACE (preview)->is_selected (preview, page_nr);
 }
-
-
-#define __GTK_PRINT_OPERATION_PREVIEW_C__
-#include "gtkaliasdef.c"