Printing stuff is not public

master
Yevgen Muntyan 2006-05-07 13:15:58 -05:00
parent 014f35d88c
commit b5a4bfd70d
4 changed files with 34 additions and 37 deletions

View File

@ -292,16 +292,16 @@
</kdevdoctreeview>
<kdevfilecreate>
<filetypes>
<type icon="source" ext="g" create="template" name="GAP source" >
<type icon="source" ext="g" name="GAP source" create="template" >
<descr>A new empty GAP source file</descr>
</type>
<type icon="source_cpp" ext="cpp" create="template" name="C++ Source" >
<type icon="source_cpp" ext="cpp" name="C++ Source" create="template" >
<descr>A new empty C++ file.</descr>
</type>
<type icon="source_h" ext="h" create="template" name="C/C++ Header" >
<type icon="source_h" ext="h" name="C/C++ Header" create="template" >
<descr>A new empty header file for C/C++.</descr>
</type>
<type icon="source_c" ext="c" create="template" name="C Source" >
<type icon="source_c" ext="c" name="C Source" create="template" >
<descr>A new empty C file.</descr>
</type>
</filetypes>

View File

@ -1158,7 +1158,7 @@ static void
moo_edit_window_page_setup (MooEditWindow *window)
{
gpointer doc = moo_edit_window_get_active_doc (window);
moo_edit_page_setup (doc, GTK_WIDGET (window));
_moo_edit_page_setup (doc, GTK_WIDGET (window));
}
@ -1167,7 +1167,7 @@ moo_edit_window_print (MooEditWindow *window)
{
gpointer doc = moo_edit_window_get_active_doc (window);
g_return_if_fail (doc != NULL);
moo_edit_print (doc, GTK_WIDGET (window));
_moo_edit_print (doc, GTK_WIDGET (window));
}
#endif

View File

@ -11,6 +11,7 @@
* See COPYING file that comes with this distribution.
*/
#define MOOEDIT_COMPILATION
#include "mooedit/mootextprint.h"
@ -38,7 +39,7 @@ static void moo_print_operation_end_print (GtkPrintOperation *operation,
GtkPrintContext *context);
G_DEFINE_TYPE(MooPrintOperation, moo_print_operation, GTK_TYPE_PRINT_OPERATION)
G_DEFINE_TYPE(MooPrintOperation, _moo_print_operation, GTK_TYPE_PRINT_OPERATION)
enum {
PROP_0,
@ -62,7 +63,7 @@ moo_print_operation_finalize (GObject *object)
if (print->buffer)
g_object_unref (print->buffer);
G_OBJECT_CLASS(moo_print_operation_parent_class)->finalize (object);
G_OBJECT_CLASS(_moo_print_operation_parent_class)->finalize (object);
}
@ -77,11 +78,11 @@ moo_print_operation_set_property (GObject *object,
switch (prop_id)
{
case PROP_DOC:
moo_print_operation_set_doc (print, g_value_get_object (value));
_moo_print_operation_set_doc (print, g_value_get_object (value));
break;
case PROP_BUFFER:
moo_print_operation_set_buffer (print, g_value_get_object (value));
_moo_print_operation_set_buffer (print, g_value_get_object (value));
break;
case PROP_WRAP:
@ -161,7 +162,7 @@ moo_print_operation_get_property (GObject *object,
static void
moo_print_operation_class_init (MooPrintOperationClass *klass)
_moo_print_operation_class_init (MooPrintOperationClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
GtkPrintOperationClass *print_class = GTK_PRINT_OPERATION_CLASS (klass);
@ -234,7 +235,7 @@ moo_print_operation_class_init (MooPrintOperationClass *klass)
static void
moo_print_operation_init (MooPrintOperation *print)
_moo_print_operation_init (MooPrintOperation *print)
{
load_default_settings ();
@ -254,8 +255,8 @@ moo_print_operation_init (MooPrintOperation *print)
void
moo_print_operation_set_doc (MooPrintOperation *print,
GtkTextView *doc)
_moo_print_operation_set_doc (MooPrintOperation *print,
GtkTextView *doc)
{
g_return_if_fail (MOO_IS_PRINT_OPERATION (print));
g_return_if_fail (!doc || GTK_IS_TEXT_VIEW (doc));
@ -289,8 +290,8 @@ moo_print_operation_set_doc (MooPrintOperation *print,
void
moo_print_operation_set_buffer (MooPrintOperation *print,
GtkTextBuffer *buffer)
_moo_print_operation_set_buffer (MooPrintOperation *print,
GtkTextBuffer *buffer)
{
g_return_if_fail (MOO_IS_PRINT_OPERATION (print));
g_return_if_fail (!buffer || GTK_IS_TEXT_BUFFER (buffer));
@ -322,8 +323,8 @@ load_default_settings (void)
void
moo_edit_page_setup (GtkTextView *view,
GtkWidget *parent)
_moo_edit_page_setup (GtkTextView *view,
GtkWidget *parent)
{
GtkPageSetup *new_page_setup;
GtkWindow *parent_window = NULL;
@ -358,11 +359,7 @@ moo_print_operation_begin_print (GtkPrintOperation *operation,
{
MooPrintOperation *print = MOO_PRINT_OPERATION (operation);
PangoFontDescription *font = NULL;
PangoLayoutLine *layout_line;
double page_height;
GList *page_breaks;
int num_lines;
int line;
GtkTextIter iter, print_end;
GTimer *timer;
@ -504,9 +501,6 @@ static GSList *
iter_get_attrs (GtkTextIter *iter,
const GtkTextIter *limit)
{
GtkTextIter end;
GtkTextAttributes values;
gboolean has_attributes = FALSE;
GSList *attrs = NULL, *tags;
PangoAttribute *bg = NULL, *fg = NULL, *style = NULL, *ul = NULL;
PangoAttribute *weight = NULL, *st = NULL;
@ -722,14 +716,13 @@ moo_print_operation_draw_page (GtkPrintOperation *operation,
{
cairo_t *cr;
GtkTextIter start, end;
char *text;
MooPrintOperation *print = MOO_PRINT_OPERATION (operation);
GTimer *timer;
g_return_if_fail (print->buffer != NULL);
g_return_if_fail (print->pages != NULL);
g_return_if_fail (print->layout != NULL);
g_return_if_fail (page_nr < print->pages->len);
g_return_if_fail (page_nr < (int) print->pages->len);
timer = g_timer_new ();
@ -737,7 +730,7 @@ moo_print_operation_draw_page (GtkPrintOperation *operation,
start = g_array_index (print->pages, GtkTextIter, page_nr);
if (page_nr + 1 < print->pages->len)
if (page_nr + 1 < (int) print->pages->len)
end = g_array_index (print->pages, GtkTextIter, page_nr + 1);
else
gtk_text_buffer_get_end_iter (print->buffer, &end);
@ -751,7 +744,7 @@ moo_print_operation_draw_page (GtkPrintOperation *operation,
static void
moo_print_operation_end_print (GtkPrintOperation *operation,
GtkPrintContext *context)
G_GNUC_UNUSED GtkPrintContext *context)
{
MooPrintOperation *print = MOO_PRINT_OPERATION (operation);
@ -766,8 +759,8 @@ moo_print_operation_end_print (GtkPrintOperation *operation,
void
moo_edit_print (GtkTextView *view,
GtkWidget *parent)
_moo_edit_print (GtkTextView *view,
GtkWidget *parent)
{
GtkWindow *parent_window = NULL;
GtkWidget *error_dialog;

View File

@ -11,6 +11,10 @@
* See COPYING file that comes with this distribution.
*/
#ifndef MOOEDIT_COMPILATION
#error "This file may not be used directly"
#endif
#ifndef __MOO_TEXT_PRINT_H__
#define __MOO_TEXT_PRINT_H__
@ -19,7 +23,7 @@
G_BEGIN_DECLS
#define MOO_TYPE_PRINT_OPERATION (moo_print_operation_get_type ())
#define MOO_TYPE_PRINT_OPERATION (_moo_print_operation_get_type ())
#define MOO_PRINT_OPERATION(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), MOO_TYPE_PRINT_OPERATION, MooPrintOperation))
#define MOO_PRINT_OPERATION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MOO_TYPE_PRINT_OPERATION, MooPrintOperationClass))
#define MOO_IS_PRINT_OPERATION(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), MOO_TYPE_PRINT_OPERATION))
@ -63,16 +67,16 @@ struct _MooPrintOperationClass
};
GType moo_print_operation_get_type (void) G_GNUC_CONST;
GType _moo_print_operation_get_type (void) G_GNUC_CONST;
void moo_print_operation_set_doc (MooPrintOperation *print,
void _moo_print_operation_set_doc (MooPrintOperation *print,
GtkTextView *doc);
void moo_print_operation_set_buffer (MooPrintOperation *print,
void _moo_print_operation_set_buffer (MooPrintOperation *print,
GtkTextBuffer *buffer);
void moo_edit_page_setup (GtkTextView *view,
void _moo_edit_page_setup (GtkTextView *view,
GtkWidget *parent);
void moo_edit_print (GtkTextView *view,
void _moo_edit_print (GtkTextView *view,
GtkWidget *parent);