]> git.donarmstrong.com Git - xournal.git/blob - src/xo-misc.h
e8f1d118f417cd6413ec4b5b705e74d1911cfc61
[xournal.git] / src / xo-misc.h
1 // data manipulation misc functions
2
3 struct Page *new_page(struct Page *template);
4 struct Page *new_page_with_bg(struct Background *bg, double width, double height);
5 void realloc_cur_path(int n);
6 void clear_redo_stack(void);
7 void clear_undo_stack(void);
8 void prepare_new_undo(void);
9 void delete_journal(struct Journal *j);
10 void delete_page(struct Page *pg);
11 void delete_layer(struct Layer *l);
12
13 // referenced strings
14
15 struct Refstring *new_refstring(const char *s);
16 struct Refstring *refstring_ref(struct Refstring *rs);
17 void refstring_unref(struct Refstring *rs);
18
19 // helper functions
20
21 void get_pointer_coords(GdkEvent *event, double *ret);
22 void fix_xinput_coords(GdkEvent *event);
23 void update_item_bbox(struct Item *item);
24 void make_page_clipbox(struct Page *pg);
25 void make_canvas_items(void);
26 void make_canvas_item_one(GnomeCanvasGroup *group, struct Item *item);
27 void update_canvas_bg(struct Page *pg);
28 gboolean is_visible(struct Page *pg);
29 void rescale_bg_pixmaps(void);
30
31 gboolean have_intersect(struct BBox *a, struct BBox *b);
32 void lower_canvas_item_to(GnomeCanvasGroup *g, GnomeCanvasItem *item, GnomeCanvasItem *after);
33
34 void rgb_to_gdkcolor(guint rgba, GdkColor *color);
35
36 // interface misc functions
37
38 void update_thickness_buttons(void);
39 void update_color_buttons(void);
40 void update_tool_buttons(void);
41 void update_tool_menu(void);
42 void update_ruler_indicator(void);
43 void update_color_menu(void);
44 void update_pen_props_menu(void);
45 void update_eraser_props_menu(void);
46 void update_highlighter_props_menu(void);
47 void update_mappings_menu_linkings(void);
48 void update_mappings_menu(void);
49 void update_page_stuff(void);
50 void update_toolbar_and_menu(void);
51 void update_file_name(char *filename);
52 void update_undo_redo_enabled(void);
53 void update_copy_paste_enabled(void);
54 void update_vbox_order(int *order);
55
56 gchar *make_cur_font_name(void);
57 void update_font_button(void);
58
59 void update_mapping_linkings(int toolno);
60 void do_switch_page(int pg, gboolean rescroll, gboolean refresh_all);
61 void set_cur_color(int color);
62 void recolor_temp_text(int color_no, guint color_rgba);
63 void process_color_activate(GtkMenuItem *menuitem, int color);
64 void process_thickness_activate(GtkMenuItem *menuitem, int tool, int val);
65 void process_papercolor_activate(GtkMenuItem *menuitem, int color);
66 void process_paperstyle_activate(GtkMenuItem *menuitem, int style);
67
68 gboolean ok_to_close(void);
69 gboolean page_ops_forbidden(void);
70
71 void reset_focus(void);
72
73 // selection / clipboard stuff
74
75 void reset_selection(void);
76 void move_journal_items_by(GList *itemlist, double dx, double dy,
77                            struct Layer *l1, struct Layer *l2, GList *depths);
78
79 // switch between mappings
80
81 void switch_mapping(int m);
82 void process_mapping_activate(GtkMenuItem *menuitem, int m, int tool);
83
84 // always allow accels
85 void allow_all_accels(void);
86 gboolean can_accel(GtkWidget *widget, guint id, gpointer data);
87 void add_scroll_bindings(void);
88
89 gboolean is_event_within_textview(GdkEventButton *event);
90
91 // defines for paper rulings
92
93 #define RULING_MARGIN_COLOR 0xff0080ff
94 #define RULING_COLOR 0x40a0ffff
95 #define RULING_THICKNESS 0.5
96 #define RULING_LEFTMARGIN 72.0
97 #define RULING_TOPMARGIN 80.0
98 #define RULING_SPACING 24.0
99 #define RULING_BOTTOMMARGIN RULING_SPACING
100 #define RULING_GRAPHSPACING 14.17