X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=src%2Fxournal.h;h=3ef9b27b873593c54b16a17444710ae376dd6e97;hb=69037d6ddbe7e90d13d8a7a088d8c209a926190e;hp=6254932ded10375809d7c36d045c14ca386b2c44;hpb=1ae71daaf4eb179352791670ac7460aa09069af6;p=xournal.git diff --git a/src/xournal.h b/src/xournal.h index 6254932..3ef9b27 100644 --- a/src/xournal.h +++ b/src/xournal.h @@ -1,3 +1,18 @@ +/* + * 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 software 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 . + */ + #include #include #include @@ -8,9 +23,9 @@ of output (redirect to a file). */ // #define ENABLE_XINPUT_BUGFIX -/* comment out this line if you are experiencing calibration problems with - XInput and want to try things differently. This will probably break - on-the-fly display rotation after application startup, though. */ +/* uncomment this line if you are experiencing calibration problems with + XInput and want to try things differently. Especially useful on older + distributions (up to around 2010). */ #define FILE_DIALOG_SIZE_BUGFIX /* ugly, but should help users with versions of GTK+ that suffer from the @@ -128,8 +143,9 @@ extern guint predef_bgcolors_rgba[COLOR_MAX]; #define TOOL_SELECTRECT 5 #define TOOL_VERTSPACE 6 #define TOOL_HAND 7 +#define TOOL_IMAGE 8 #define NUM_STROKE_TOOLS 3 -#define NUM_TOOLS 8 +#define NUM_TOOLS 9 #define NUM_BUTTONS 3 #define TOOLOPT_ERASER_STANDARD 0 @@ -158,6 +174,10 @@ typedef struct Item { gchar *font_name; gdouble font_size; GtkWidget *widget; // the widget while text is being edited (ITEM_TEMP_TEXT) + // the following fields for ITEM_IMAGE: + GdkPixbuf *image; // the image + gchar *image_png; // PNG of original image, for save and clipboard + gsize image_png_len; } Item; // item type values for Item.type, UndoItem.type, ui.cur_item_type ... @@ -186,6 +206,8 @@ typedef struct Item { #define ITEM_TEXT_ATTRIB 21 #define ITEM_RESIZESEL 22 #define ITEM_RECOGNIZER 23 +#define ITEM_IMAGE 24 +#define ITEM_SELECTREGION 25 typedef struct Layer { GList *items; // the items on the layer, from bottom to top @@ -209,7 +231,7 @@ typedef struct Journal { } Journal; typedef struct Selection { - int type; // ITEM_SELECTRECT, ITEM_MOVESEL_VERT + int type; // ITEM_SELECTRECT, ITEM_MOVESEL_VERT, ITEM_SELECTREGION BBox bbox; // the rectangle bbox of the selection struct Layer *layer; // the layer on which the selection lives double anchor_x, anchor_y, last_x, last_y; // for selection motion @@ -260,10 +282,12 @@ typedef struct UIData { gboolean hand_scrollto_pending; char *filename; gchar *default_path; // default path for new notes + gchar *default_image; // path for previous image gboolean view_continuous, fullscreen, maximize_at_start; gboolean in_update_page_stuff; // semaphore to avoid scrollbar retroaction struct Selection *selection; GdkCursor *cursor; + GdkPixbuf *pen_cursor_pix, *hiliter_cursor_pix; gboolean progressive_bg; // update PDF bg's one at a time char *mrufile, *configfile; // file names for MRU & config char *mru[MRU_SIZE]; // MRU data @@ -311,8 +335,8 @@ typedef struct UndoErasureData { typedef struct UndoItem { int type; - struct Item *item; // for ITEM_STROKE, ITEM_TEXT, ITEM_TEXT_EDIT, ITEM_TEXT_ATTRIB - struct Layer *layer; // for ITEM_STROKE, ITEM_ERASURE, ITEM_PASTE, ITEM_NEW_LAYER, ITEM_DELETE_LAYER, ITEM_MOVESEL, ITEM_TEXT, ITEM_TEXT_EDIT, ITEM_RECOGNIZER + struct Item *item; // for ITEM_STROKE, ITEM_TEXT, ITEM_TEXT_EDIT, ITEM_TEXT_ATTRIB, ITEM_IMAGE + struct Layer *layer; // for ITEM_STROKE, ITEM_ERASURE, ITEM_PASTE, ITEM_NEW_LAYER, ITEM_DELETE_LAYER, ITEM_MOVESEL, ITEM_TEXT, ITEM_TEXT_EDIT, ITEM_RECOGNIZER, ITEM_IMAGE struct Layer *layer2; // for ITEM_DELETE_LAYER with val=-1, ITEM_MOVESEL struct Page *page; // for ITEM_NEW_BG_ONE/RESIZE, ITEM_NEW_PAGE, ITEM_NEW_LAYER, ITEM_DELETE_LAYER, ITEM_DELETE_PAGE GList *erasurelist; // for ITEM_ERASURE, ITEM_RECOGNIZER