10 #ifndef AW_DEVICE_CLICK_HXX
20 #define awt_assert(cond) arb_assert(cond)
70 #define STANDARD_PADDING 10
109 unsigned int refresh : 1;
110 unsigned int resize : 1;
111 unsigned int zoom_reset : 1;
112 unsigned int supdate : 1;
113 unsigned int save : 1;
121 #if defined(UNIT_TESTS)
122 friend class fake_AWT_graphic_tree;
168 default_padding.
t = t;
169 default_padding.
b = b;
170 default_padding.
l = l;
171 default_padding.
r = r;
173 padding = default_padding;
180 padding.
t = default_padding.
t + text_padding.
t;
181 padding.
b = default_padding.
b + text_padding.
b;
182 padding.
l = default_padding.
l + text_padding.
l;
183 padding.
r = default_padding.
r + text_padding.
r;
208 AW_device_click *click_dev;
214 M_key_modifier(event.keymodifier),
215 M_key_code(event.keycode),
216 M_key_char(event.character),
218 mousepos(event.x, event.
y),
219 click_dev(click_dev_)
234 return click_dev ? click_dev->best_click(prefer) :
NULp;
243 bool detect_drag_target;
291 #define EPS 0.0001 // div zero check
292 #define CLIP_OVERLAP 15
293 #define AWT_ZOOM_OUT_STEP 40 // (pixel) rand um screen
294 #define AWT_MIN_WIDTH 100 // Minimum center screen (= screen-offset)
299 bool consider_text_for_size;
353 #if defined(ASSERTION_USED)
359 #define assert_no_auto_refresh_for(CANVAS) awt_assert(!(CANVAS)->inside_auto_refresh())
384 void scroll(
int delta_x,
int delta_y,
bool dont_update_scrollbars =
false);
386 scroll(
int(delta.
x()),
int(delta.
y()), dont_update_scrollbars);
417 if (exports.modifying++ == 0) {
424 if (--exports.modifying <= 0) {
449 awt_assert(!zoom_reset && !resize && refresh);
456 if (refresh && perform_refresh) {
void zoom(AW_device *device, bool zoomIn, const AW::Rectangle &wanted_part, const AW::Rectangle ¤t_part, int percent)
void set_equilateral_default_padding(int pad)
void push_transaction() const
AW_key_code key_code() const
bool inside_auto_refresh() const
virtual GB_ERROR load_from_DB(GBDATA *gb_main, const char *name)=0
AWT_auto_refresh(AWT_canvas *scr_)
void request_zoom_reset()
void set_extra_text_padding(const AW_borders &text_padding)
void set_horizontal_scrollbar_position(AW_window *aww, int pos)
void suppress_update_and_refresh()
void request_structure_update()
void AWT_resize_cb(UNFIXED, AWT_canvas *scr)
void update_display_as_requested(AWT_canvas *scr, bool perform_refresh)
void request_zoom_reset()
AW_key_mod key_modifier() const
void clear_resize_request()
virtual GB_ERROR save_to_DB(GBDATA *gb_main, const char *name)=0
bool inside_auto_refresh() const
int get_left_padding() const
virtual void update_structure()=0
void scroll(const AW::Vector &delta, bool dont_update_scrollbars=false)
void clear_save_request()
int get_y_padding() const
AWT_graphic_event(AWT_COMMAND_MODE cmd_, const AW_event &event, bool is_drag, AW_device_click *click_dev_)
void sync_DB_model_and_view(bool perform_refresh)
void set_standard_default_padding()
void announce_screen_update()
const AW_clicked_element * best_click(AW_device_click::ClickPreference prefer=AW_device_click::PREFER_NEARER)
void instant_zoom_reset()
AWT_canvas(GBDATA *gb_main_, AW_window *aww_, const char *gc_base_name_, AWT_graphic *gfx_)
AW_MouseButton button() const
bool needs_structure_update() const
void(* screen_update_callback)(AWT_canvas *, AW_CL cd)
struct Unfixed_cb_parameter * UNFIXED
bool flags_writeable() const
void clear_structure_update_request()
int get_top_padding() const
void clear_refresh_request()
const AW::Position & position() const
virtual AW_gc_manager * init_devices(AW_window *, AW_device *, AWT_canvas *scr)=0
void drag_target_detection(bool detect)
void clear_zoom_reset_request()
const char * get_gc_base_name() const
GB_ERROR save_to_DB(GBDATA *gb_main, const char *name) OVERRIDE __ATTR__USERESULT
void set_dragEndpoint(int x, int y)
void request_save_and_zoom_reset()
void set_vertical_scrollbar_position(AW_window *aww, int pos)
screen_update_callback announce_update_cb
void check_for_DB_update(GBDATA *gb_main) OVERRIDE
virtual void notify_synchronized(GBDATA *gb_main)=0
GB_ERROR load_from_DB(GBDATA *gb_main, const char *name) OVERRIDE __ATTR__USERESULT
bool inside_update() const
virtual void handle_command(AW_device *device, AWT_graphic_event &event)=0
void set_default_padding(int t, int b, int l, int r)
void AWT_popup_tree_export_window(AW_window *parent_win, AWT_canvas *scr)
void AWT_popup_sec_export_window(AW_window *parent_win, AWT_canvas *scr)
void set_mode(AWT_COMMAND_MODE mo)
bool wants_drag_target() const
void scroll(int delta_x, int delta_y, bool dont_update_scrollbars=false)
void request_save_and_zoom_reset()
void request_structure_update()
AW_gc_manager * gc_manager
AW::Vector zoomVector(double transToFit) const
AWT_COMMAND_MODE cmd() const
#define __ATTR__USERESULT
int get_x_padding() const
bool handleWheelEvent(AW_device *device, const AW_event &event)
AWT_graphic_exports exports
void init_device(AW_device *device)
#define assert_no_auto_refresh_for(CANVAS)
void AWT_expose_cb(UNFIXED, AWT_canvas *scr)
AW_event_type type() const
~AWT_nonDB_graphic() OVERRIDE
int & get_modifying_flag_ref()
bool flags_clearable() const
void pop_transaction() const
void instant_resize(bool adjust_scrollbars)
virtual void check_for_DB_update(GBDATA *gb_main)=0
void set_consider_text_for_zoom_reset(bool consider)
void AWT_popup_print_window(AW_window *parent_win, AWT_canvas *scr)
void notify_synchronized(GBDATA *gb_main) OVERRIDE
void AWT_GC_changed_cb(GcChange whatChanged, AWT_canvas *scr)
virtual void show(AW_device *device)=0