File: drawing.h

package info (click to toggle)
gpaint 0.3.3-6.1
  • links: PTS, VCS
  • area: main
  • in suites: buster, jessie, jessie-kfreebsd, stretch
  • size: 3,948 kB
  • ctags: 1,332
  • sloc: ansic: 9,472; sh: 8,180; makefile: 101; perl: 57
file content (63 lines) | stat: -rw-r--r-- 2,507 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
/* $Id: drawing.h,v 1.5 2005/01/07 02:50:52 meffie Exp $
 *
 * GNU Paint 
 * Copyright 2000-2003, 2007  Li-Cheng (Andy) Tai
 *
 * Authors: Li-Cheng (Andy) Tai <atai@gnu.org>
 *          Michael A. Meffie III <meffiem@neo.rr.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 3
 * of the License, or (at your option) any later version.
 *
 * This program 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.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

#ifndef __DRAWING_H__
#define __DRAWING_H__

#include "image.h"
#include "selection.h"
#include <gtk/gtk.h>


/*
 * Drawing
 */
typedef struct _gpaint_drawing
{
    GtkWidget        *top_level;      /* reference to the top level window */
    GdkDrawable      *window;         /* reference to the drawing area window */
    GdkPixmap        *backing_pixmap; /* stored in X server memory */
    gboolean          modified;      
    GdkGC            *gc;             /* reference to the gc */
    GString          *filename;
    gboolean          untitled;       /* false if the filename has been set by the user */
    gint              width;      
    gint              height;
} gpaint_drawing;


gpaint_drawing* drawing_new_blank(GtkDrawingArea *drawing_area, GdkGC *gc, gint width, gint height);
gpaint_drawing* drawing_new_from_file(GtkDrawingArea *drawing_area, GdkGC *gc, const gchar* filename);
gpaint_drawing* drawing_new_from_desktop(GtkDrawingArea *drawing_area, GdkGC *gc);
void drawing_destroy(gpaint_drawing *drawing);
int drawing_in_bounds(gpaint_drawing *drawing, int x, int y);
int drawing_save(gpaint_drawing *drawing);
int drawing_save_as(gpaint_drawing *drawing, const gchar *filename);
void drawing_modified(gpaint_drawing *drawing);
void drawing_copy_to_desktop(gpaint_drawing *drawing);
gpaint_image *drawing_create_image(gpaint_drawing *drawing);
void drawing_clear(gpaint_drawing *drawing);
void drawing_clear_selection(gpaint_drawing *drawing, gpaint_point_array *points);
gboolean drawing_prompt_to_save(gpaint_drawing *drawing);
void drawing_rotate(gpaint_drawing *drawing, int degrees);

#endif