]> git.donarmstrong.com Git - xournal.git/blob - src/xo-misc.h
focus and other patches
[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 realloc_cur_widths(int n);
7 void clear_redo_stack(void);
8 void clear_undo_stack(void);
9 void prepare_new_undo(void);
10 void delete_journal(struct Journal *j);
11 void delete_page(struct Page *pg);
12 void delete_layer(struct Layer *l);
13
14 // referenced strings
15
16 struct Refstring *new_refstring(const char *s);
17 struct Refstring *refstring_ref(struct Refstring *rs);
18 void refstring_unref(struct Refstring *rs);
19
20 // helper functions
21
22 void get_pointer_coords(GdkEvent *event, double *ret);
23 double get_pressure_multiplier(GdkEvent *event);
24 void fix_xinput_coords(GdkEvent *event);
25 void update_item_bbox(struct Item *item);
26 void make_page_clipbox(struct Page *pg);
27 void make_canvas_items(void);
28 void make_canvas_item_one(GnomeCanvasGroup *group, struct Item *item);
29 void update_canvas_bg(struct Page *pg);
30 gboolean is_visible(struct Page *pg);
31 void rescale_bg_pixmaps(void);
32
33 gboolean have_intersect(struct BBox *a, struct BBox *b);
34 void lower_canvas_item_to(GnomeCanvasGroup *g, GnomeCanvasItem *item, GnomeCanvasItem *after);
35
36 void rgb_to_gdkcolor(guint rgba, GdkColor *color);
37 guint32 gdkcolor_to_rgba(GdkColor gdkcolor, guint16 alpha);
38
39 // interface misc functions
40
41 void update_thickness_buttons(void);
42 void update_color_buttons(void);
43 void update_tool_buttons(void);
44 void update_tool_menu(void);
45 void update_ruler_indicator(void);
46 void update_color_menu(void);
47 void update_pen_props_menu(void);
48 void update_eraser_props_menu(void);
49 void update_highlighter_props_menu(void);
50 void update_mappings_menu_linkings(void);
51 void update_mappings_menu(void);
52 void update_page_stuff(void);
53 void update_toolbar_and_menu(void);
54 void update_file_name(char *filename);
55 void update_undo_redo_enabled(void);
56 void update_copy_paste_enabled(void);
57 void update_vbox_order(int *order);
58
59 gchar *make_cur_font_name(void);
60 void update_font_button(void);
61
62 void update_mapping_linkings(int toolno);
63 void do_switch_page(int pg, gboolean rescroll, gboolean refresh_all);
64 void set_cur_color(int color_no, guint color_rgba);
65 void recolor_temp_text(int color_no, guint color_rgba);
66 void process_color_activate(GtkMenuItem *menuitem, int color_no, guint color_rgba);
67 void process_thickness_activate(GtkMenuItem *menuitem, int tool, int val);
68 void process_papercolor_activate(GtkMenuItem *menuitem, int color);
69 void process_paperstyle_activate(GtkMenuItem *menuitem, int style);
70
71 gboolean ok_to_close(void);
72
73 void reset_focus(void);
74
75 // selection / clipboard stuff
76
77 void reset_selection(void);
78 void move_journal_items_by(GList *itemlist, double dx, double dy,
79                            struct Layer *l1, struct Layer *l2, GList *depths);
80 void resize_journal_items_by(GList *itemlist, double scaling_x, double scaling_y,
81                              double offset_x, double offset_y);
82
83
84 // switch between mappings
85
86 void switch_mapping(int m);
87 void process_mapping_activate(GtkMenuItem *menuitem, int m, int tool);
88
89 // always allow accels
90 void allow_all_accels(void);
91 gboolean can_accel(GtkWidget *widget, guint id, gpointer data);
92 void add_scroll_bindings(void);
93
94 gboolean is_event_within_textview(GdkEventButton *event);
95
96 void hide_unimplemented(void);
97
98 void do_fullscreen(gboolean active);
99
100 // fix GTK+ 2.16/2.17 issues with XInput events
101 gboolean filter_extended_events(GtkWidget *widget, GdkEvent *event, gpointer user_data);
102 // gboolean fix_extended_events(GtkWidget *widget, GdkEvent *event, gpointer user_data);
103 gboolean combobox_popup_disable_xinput(GtkWidget *widget, GdkEvent *event, gpointer user_data);
104
105 // help with focus
106 gboolean handle_activate_signal(GtkWidget *widget, gpointer user_data);
107 void unset_flags(GtkWidget *w, gpointer flag);
108
109 // defines for paper rulings
110
111 #define RULING_MARGIN_COLOR 0xff0080ff
112 #define RULING_COLOR 0x40a0ffff
113 #define RULING_THICKNESS 0.5
114 #define RULING_LEFTMARGIN 72.0
115 #define RULING_TOPMARGIN 80.0
116 #define RULING_SPACING 24.0
117 #define RULING_BOTTOMMARGIN RULING_SPACING
118 #define RULING_GRAPHSPACING 14.17