3
Copyright 2000 Li-Cheng (Andy) Tai
5
This program is free software; you can redistribute it and/or modify
6
it under the terms of the GNU General Public License as published by
7
the Free Software Foundation; either version 2 of the License, or
8
(at your option) any later version.
10
This program is distributed in the hope that it will be useful,
11
but WITHOUT ANY WARRANTY; without even the implied warranty of
12
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
GNU General Public License for more details.
15
You should have received a copy of the GNU General Public License
16
along with this program; if not, write to the Free Software
17
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
24
#include "image_buf.h"
27
#define DEFAULT_WIDTH 640
28
#define DEFAULT_HEIGHT 480
30
extern GdkCursor *busy_cursor, *arrow_cursor;
32
#define PROCESSING_GTK_EVENTS while (gtk_events_pending()) gtk_main_iteration();
34
GtkWidget *widget_get_toplevel_parent(GtkWidget *widget);
36
image_buf *widget_get_image(GtkWidget *widget);
40
GtkWidget *create_scroll_frame_widget(void);
41
GtkWidget *create_scroll_frame_widget_content(GtkWidget *, GtkWidget *);
43
void open_canvas(image_buf *ibuf);
45
void save_canvas(image_buf *ibuf, int saveas);
48
void set_button_pixmap(GtkButton *button, unsigned char **pixmap);
50
void set_drawing_tool(image_buf *, DRAWING_TOOL);
52
void select_toolbar_toggle_button(GtkToggleButton *selected, int setmode);
57
void handle_button_press(image_buf *, int x, int y);
58
void handle_button_move(image_buf *, int x, int y);
59
void handle_button_release(image_buf *, int x, int y);
61
void handle_key_release(image_buf *, GdkEventKey *);
63
int handle_timeout(image_buf * );
65
void image_buf_set_tool(image_buf *ibuf, DRAWING_TOOL tool);
67
void image_buf_set_fill(image_buf *ibuf, int filled);
69
void image_buf_clear_flash(image_buf *ibuf);
71
void image_buf_select_all(image_buf *ibuf);
73
void spreadimage(image_buf * input, image_buf *output);
75
void GdkColor_to_rgb(const GdkColor *color, unsigned char *r, unsigned char *g, unsigned char *b);
77
void image_buf_clear(image_buf *ibuf);
79
void draw_rectangle(GdkDrawable *d, GdkGC *gc, gint filled, gint x1, gint y1, gint x2, gint y2);
81
void draw_palette_entry(image_buf *ibuf, GtkWidget *palette_entry);
84
void image_buf_save_tool(image_buf *);
85
void image_buf_restore_tool(image_buf *);
87
void image_buf_enter_paste_mode(image_buf *);
88
void image_buf_leave_paste_mode(image_buf *);
90
void image_buf_put_region_image(image_buf *, int, int);
92
void image_buf_draw_dynamic_image(image_buf *, GdkPixbuf *, int, int);
93
void image_buf_erase_dynamic_image(image_buf *, GdkPixbuf *, int, int);
95
void image_buf_flip_x_region(image_buf *);
96
void image_buf_flip_y_region(image_buf *);
97
void image_buf_rotate_region(image_buf *, double rad);
99
GdkRectangle compute_cover_rect(GdkPoint *pts, int num_pts);
101
void image_buf_adjust_according_to_points(image_buf *ibuf, int *, int *);
103
void image_buf_get_desktop(image_buf *);
105
void image_buf_set_desktop_background(image_buf*, int);
107
void pts_flip_x(GdkPoint *, int);
108
void pts_flip_y(GdkPoint *, int);
109
void pixbuf_flip_x(GdkPixbuf**);
110
void pixbuf_flip_y(GdkPixbuf**);
111
void pixbuf_apply_matrix22(GdkPixbuf **pixbuf, double matrix[2][2]);
112
void pts_apply_matrix22(GdkPoint *pts, int num_pts, double matrix[2][2]);
114
void image_buf_force_select_region(image_buf *ibuf);
116
void image_buf_paint_interpolate(image_buf *ibuf, int x, int y);