diff --git a/src/commands/cmd_advanced_mode.cpp b/src/commands/cmd_advanced_mode.cpp index d6959d189..8536283f0 100644 --- a/src/commands/cmd_advanced_mode.cpp +++ b/src/commands/cmd_advanced_mode.cpp @@ -61,7 +61,7 @@ void AdvancedModeCommand::onExecute(Context* context) app_get_tabsbar()->setVisible(!advanced_mode); app_get_top_window()->remap_window(); - app_get_top_window()->dirty(); + app_get_top_window()->invalidate(); if (advanced_mode && get_config_bool("AdvancedMode", "Warning", true)) { diff --git a/src/commands/cmd_configure_tools.cpp b/src/commands/cmd_configure_tools.cpp index 529b31a50..8ca726adb 100644 --- a/src/commands/cmd_configure_tools.cpp +++ b/src/commands/cmd_configure_tools.cpp @@ -78,7 +78,7 @@ static void on_pen_size_after_change() brush_size->setValue(tool_settings->getPen()->getSize()); // Regenerate the preview - brush_preview->dirty(); + brush_preview->invalidate(); } static void on_current_tool_change() @@ -114,7 +114,7 @@ static void on_current_tool_change() group_button_select(brush_type, tool_settings->getPen()->getType()); // Regenerate the preview - brush_preview->dirty(); + brush_preview->invalidate(); // True if the current tool needs opacity options bool hasOpacity = (current_tool->getInk(0)->isPaint() || @@ -157,7 +157,7 @@ static void on_current_tool_change() window->setBounds(window->getBounds()); // TODO layout() method is missing // Redraw the window - window->dirty(); + window->invalidate(); } ////////////////////////////////////////////////////////////////////// @@ -405,7 +405,7 @@ static bool brush_type_change_hook(JWidget widget, void *data) ->getPen() ->setType(type); - jwidget_dirty((JWidget)data); + ((Widget*)data)->invalidate(); app_get_statusbar() ->setStatusText(250, @@ -429,7 +429,7 @@ void ConfigureTools::onBrushSizeSliderChange(Widget* brush_preview) ->getPen() ->setSize(m_brushSize->getValue()); - brush_preview->dirty(); + brush_preview->invalidate(); } void ConfigureTools::onBrushAngleSliderChange(Widget* brush_preview) @@ -444,7 +444,7 @@ void ConfigureTools::onBrushAngleSliderChange(Widget* brush_preview) ->getPen() ->setAngle(m_brushAngle->getValue()); - brush_preview->dirty(); + brush_preview->invalidate(); } void ConfigureTools::onOpacitySliderChange() diff --git a/src/commands/cmd_new_layer.cpp b/src/commands/cmd_new_layer.cpp index 1f501334c..3fe5f9fce 100644 --- a/src/commands/cmd_new_layer.cpp +++ b/src/commands/cmd_new_layer.cpp @@ -112,7 +112,7 @@ void NewLayerCommand::onExecute(Context* context) layer->setName(name); update_screen_for_sprite(sprite); - app_get_statusbar()->dirty(); + app_get_statusbar()->invalidate(); app_get_statusbar()->showTip(1000, "Layer `%s' created", name.c_str()); } diff --git a/src/commands/cmd_palette_editor.cpp b/src/commands/cmd_palette_editor.cpp index 3b70e8976..32dea1299 100644 --- a/src/commands/cmd_palette_editor.cpp +++ b/src/commands/cmd_palette_editor.cpp @@ -582,8 +582,8 @@ static bool insert_criteria_hook(Widget* widget, void* _data) // Relayout data->available_criteria->setBounds(data->available_criteria->getBounds()); // TODO layout() data->selected_criteria->setBounds(data->selected_criteria->getBounds()); // TODO layout() - data->available_criteria->dirty(); - data->selected_criteria->dirty(); + data->available_criteria->invalidate(); + data->selected_criteria->invalidate(); } return true; @@ -618,8 +618,8 @@ static bool remove_criteria_hook(Widget* widget, void* _data) // Relayout data->available_criteria->setBounds(data->available_criteria->getBounds()); // TODO layout() data->selected_criteria->setBounds(data->selected_criteria->getBounds()); // TODO layout() - data->available_criteria->dirty(); - data->selected_criteria->dirty(); + data->available_criteria->invalidate(); + data->selected_criteria->invalidate(); } return true; @@ -928,7 +928,7 @@ static void update_current_sprite_palette(const char* operationName) } } - jwidget_dirty(palette_editor); + palette_editor->invalidate(); if (!jmanager_timer_is_running(redraw_timer_id)) jmanager_start_timer(redraw_timer_id); @@ -937,7 +937,7 @@ static void update_current_sprite_palette(const char* operationName) static void update_colorbar() { - app_get_colorbar()->dirty(); + app_get_colorbar()->invalidate(); } static void update_sliders_from_color(const Color& color) @@ -996,7 +996,7 @@ static bool select_rgb_hook(JWidget widget, void *data) V_entry->setVisible(false); window->setBounds(window->getBounds()); - window->dirty(); + window->invalidate(); return true; } @@ -1024,7 +1024,7 @@ static bool select_hsv_hook(JWidget widget, void *data) V_entry->setVisible(true); window->setBounds(window->getBounds()); - window->dirty(); + window->invalidate(); return true; } @@ -1073,7 +1073,7 @@ static bool expand_button_select_hook(JWidget widget, void *data) } // Redraw the window - window->dirty(); + window->invalidate(); return true; } diff --git a/src/commands/cmd_remove_layer.cpp b/src/commands/cmd_remove_layer.cpp index 8564ebedc..078c227f7 100644 --- a/src/commands/cmd_remove_layer.cpp +++ b/src/commands/cmd_remove_layer.cpp @@ -73,7 +73,7 @@ void RemoveLayerCommand::onExecute(Context* context) } update_screen_for_sprite(sprite); - app_get_statusbar()->dirty(); + app_get_statusbar()->invalidate(); app_get_statusbar() ->showTip(1000, "Layer `%s' removed", layer_name.c_str()); diff --git a/src/console.cpp b/src/console.cpp index 001fe2b07..ac031fe3e 100644 --- a/src/console.cpp +++ b/src/console.cpp @@ -131,7 +131,7 @@ void Console::printf(const char *format, ...) wid_console->remap_window(); jwidget_set_rect(wid_console, rect); wid_console->center_window(); - wid_console->dirty(); + wid_console->invalidate(); jrect_free(rect); } diff --git a/src/dialogs/aniedit.cpp b/src/dialogs/aniedit.cpp index 59aad1acf..617aed8d1 100644 --- a/src/dialogs/aniedit.cpp +++ b/src/dialogs/aniedit.cpp @@ -326,7 +326,7 @@ static bool anieditor_msg_proc(JWidget widget, JMessage msg) SpriteWriter sprite_writer(sprite); sprite_writer->setCurrentFrame(anieditor->clk_frame); } - jwidget_dirty(widget); /* TODO replace this by redrawing old current frame and new current frame */ + widget->invalidate(); // TODO Replace this by redrawing old current frame and new current frame widget->captureMouse(); anieditor->state = STATE_MOVING_FRAME; break; @@ -431,7 +431,7 @@ static bool anieditor_msg_proc(JWidget widget, JMessage msg) else if (anieditor->clk_part == A_PART_SEPARATOR) { hot_part = anieditor->clk_part; anieditor->separator_x = mx; - jwidget_dirty(widget); + widget->invalidate(); return true; } } @@ -528,7 +528,7 @@ static bool anieditor_msg_proc(JWidget widget, JMessage msg) jmenu_popup(popup_menu, msg->mouse.x, msg->mouse.y); destroy_thumbnails(); - jwidget_dirty(widget); + widget->invalidate(); } } } @@ -551,7 +551,7 @@ static bool anieditor_msg_proc(JWidget widget, JMessage msg) undoable.moveFrameBefore(anieditor->clk_frame, anieditor->hot_frame); undoable.commit(); } - jwidget_dirty(widget); + widget->invalidate(); } } } @@ -565,7 +565,7 @@ static bool anieditor_msg_proc(JWidget widget, JMessage msg) jmenu_popup(popup_menu, msg->mouse.x, msg->mouse.y); destroy_thumbnails(); - jwidget_dirty(widget); + widget->invalidate(); anieditor_regenerate_layers(widget); } } @@ -593,7 +593,7 @@ static bool anieditor_msg_proc(JWidget widget, JMessage msg) Console::showException(e); } - jwidget_dirty(widget); + widget->invalidate(); anieditor_regenerate_layers(widget); } else { @@ -648,7 +648,7 @@ static bool anieditor_msg_proc(JWidget widget, JMessage msg) destroy_thumbnails(); anieditor_regenerate_layers(widget); - jwidget_dirty(widget); + widget->invalidate(); } } /* move the cel */ @@ -662,7 +662,7 @@ static bool anieditor_msg_proc(JWidget widget, JMessage msg) destroy_thumbnails(); anieditor_regenerate_layers(widget); - jwidget_dirty(widget); + widget->invalidate(); } } break; @@ -705,7 +705,7 @@ static bool anieditor_msg_proc(JWidget widget, JMessage msg) destroy_thumbnails(); anieditor_regenerate_layers(widget); anieditor_show_current_cel(widget); - jwidget_dirty(widget); + widget->invalidate(); } return true; } @@ -720,7 +720,7 @@ static bool anieditor_msg_proc(JWidget widget, JMessage msg) destroy_thumbnails(); anieditor_regenerate_layers(widget); anieditor_show_current_cel(widget); - jwidget_dirty(widget); + widget->invalidate(); } return true; } @@ -740,7 +740,7 @@ static bool anieditor_msg_proc(JWidget widget, JMessage msg) UIContext::instance()->executeCommand(command); anieditor_show_current_cel(widget); - jwidget_dirty(widget); + widget->invalidate(); return true; } @@ -751,7 +751,7 @@ static bool anieditor_msg_proc(JWidget widget, JMessage msg) anieditor_regenerate_layers(widget); anieditor_show_current_cel(widget); - jwidget_dirty(widget); + widget->invalidate(); return true; } } diff --git a/src/effect/effect.cpp b/src/effect/effect.cpp index 7077c3ccc..3b7bbf45b 100644 --- a/src/effect/effect.cpp +++ b/src/effect/effect.cpp @@ -287,7 +287,7 @@ void effect_flush(Effect *effect) jregion_intersect(reg1, reg1, reg2); jregion_free(reg2); - jwidget_invalidate_region(editor, reg1); + editor->invalidateRegion(reg1); jregion_free(reg1); } } diff --git a/src/gui/button.cpp b/src/gui/button.cpp index 0e7ca6bb6..121382de1 100644 --- a/src/gui/button.cpp +++ b/src/gui/button.cpp @@ -47,13 +47,13 @@ ButtonBase::~ButtonBase() void ButtonBase::setButtonIcon(BITMAP* icon) { m_icon = icon; - dirty(); + invalidate(); } void ButtonBase::setButtonIconAlign(int iconAlign) { m_iconAlign = iconAlign; - dirty(); + invalidate(); } BITMAP* ButtonBase::getButtonIcon() @@ -106,7 +106,7 @@ bool ButtonBase::onProcessMessage(JMessage msg) } /* TODO theme specific stuff */ - dirty(); + invalidate(); } break; @@ -158,7 +158,7 @@ bool ButtonBase::onProcessMessage(JMessage msg) // Signal jwidget_emit_signal(this, JI_SIGNAL_CHECK_CHANGE); - dirty(); + invalidate(); } else if (m_behaviorType == JI_RADIO) { if (!this->isSelected()) { @@ -238,7 +238,7 @@ bool ButtonBase::onProcessMessage(JMessage msg) Event ev(this); onClick(ev); - dirty(); + invalidate(); } break; @@ -285,7 +285,7 @@ bool ButtonBase::onProcessMessage(JMessage msg) case JM_MOUSELEAVE: // TODO theme stuff if (this->isEnabled()) - dirty(); + invalidate(); break; } diff --git a/src/gui/entry.cpp b/src/gui/entry.cpp index ba0d9a9fc..92c367a76 100644 --- a/src/gui/entry.cpp +++ b/src/gui/entry.cpp @@ -88,13 +88,13 @@ void Entry::setPassword(bool state) void Entry::showCaret() { m_hidden = false; - dirty(); + invalidate(); } void Entry::hideCaret() { m_hidden = true; - dirty(); + invalidate(); } void Entry::setCaretPos(int pos) @@ -124,7 +124,7 @@ void Entry::setCaretPos(int pos) jmanager_start_timer(m_timer_id); m_state = true; - dirty(); + invalidate(); } void Entry::selectText(int from, int to) @@ -135,13 +135,13 @@ void Entry::selectText(int from, int to) setCaretPos(from); // to move scroll setCaretPos((to >= 0)? to: end+to+1); - dirty(); + invalidate(); } void Entry::deselectText() { m_select = -1; - dirty(); + invalidate(); } void Entry::getEntryThemeInfo(int* scroll, int* caret, int* state, @@ -175,7 +175,7 @@ bool Entry::onProcessMessage(JMessage msg) msg->timer.timer_id == m_timer_id) { // Blinking caret m_state = m_state ? false: true; - dirty(); + invalidate(); } break; @@ -183,14 +183,14 @@ bool Entry::onProcessMessage(JMessage msg) jmanager_start_timer(m_timer_id); m_state = true; - dirty(); + invalidate(); selectText(0, -1); m_recent_focused = true; break; case JM_FOCUSLEAVE: - dirty(); + invalidate(); jmanager_stop_timer(m_timer_id); @@ -290,7 +290,7 @@ bool Entry::onProcessMessage(JMessage msg) m_caret = --m_scroll; move = false; is_dirty = true; - dirty(); + invalidate(); } } /* forward scroll */ @@ -311,7 +311,7 @@ bool Entry::onProcessMessage(JMessage msg) m_caret = c; move = false; is_dirty = true; - dirty(); + invalidate(); } } @@ -322,7 +322,7 @@ bool Entry::onProcessMessage(JMessage msg) if (m_caret != c) { m_caret = c; is_dirty = true; - dirty(); + invalidate(); } } @@ -353,14 +353,14 @@ bool Entry::onProcessMessage(JMessage msg) forwardWord(); m_select = m_caret; backwardWord(); - dirty(); + invalidate(); return true; case JM_MOUSEENTER: case JM_MOUSELEAVE: /* TODO theme stuff */ if (this->isEnabled()) - dirty(); + invalidate(); break; } @@ -588,7 +588,7 @@ void Entry::executeCmd(EntryCmd::Type cmd, int ascii, bool shift_pressed) } setCaretPos(m_caret); - dirty(); + invalidate(); } #define IS_WORD_CHAR(ch) \ diff --git a/src/gui/frame.cpp b/src/gui/frame.cpp index d890364c2..6f4776519 100644 --- a/src/gui/frame.cpp +++ b/src/gui/frame.cpp @@ -111,7 +111,7 @@ void Frame::remap_window() jrect_free(rect); jwidget_emit_signal(this, JI_SIGNAL_WINDOW_RESIZE); - jwidget_dirty(this); + invalidate(); } void Frame::center_window() @@ -141,7 +141,7 @@ void Frame::position_window(int x, int y) window_action = old_action; - dirty(); + invalidate(); } void Frame::move_window(JRect rect) @@ -329,7 +329,7 @@ bool Frame::onProcessMessage(JMessage msg) jrect_free(rect); jwidget_emit_signal(this, JI_SIGNAL_WINDOW_RESIZE); - jwidget_dirty(this); + invalidate(); } } } @@ -629,7 +629,7 @@ void Frame::move_window(JRect rect, bool use_blit) } jmanager_invalidate_region(manager, manager_refresh_region); - jwidget_invalidate_region(this, window_refresh_region); + this->invalidateRegion(window_refresh_region); jregion_free(old_drawable_region); jregion_free(new_drawable_region); diff --git a/src/gui/jlink_label.cpp b/src/gui/jlink_label.cpp index ef2b46bcf..ac75ae0e5 100644 --- a/src/gui/jlink_label.cpp +++ b/src/gui/jlink_label.cpp @@ -41,7 +41,7 @@ bool LinkLabel::onProcessMessage(JMessage msg) case JM_MOUSELEAVE: // TODO theme stuff if (isEnabled()) - jwidget_dirty(this); + invalidate(); break; case JM_DRAW: diff --git a/src/gui/jlistbox.cpp b/src/gui/jlistbox.cpp index 0fe7b6149..7b154e689 100644 --- a/src/gui/jlistbox.cpp +++ b/src/gui/jlistbox.cpp @@ -352,7 +352,7 @@ static void listbox_dirty_children(JWidget widget) if (!view) { JI_LIST_FOR_EACH(widget->children, link) - jwidget_dirty(reinterpret_cast(link->data)); + reinterpret_cast(link->data)->invalidate(); } else { vp = jview_get_viewport_position(view); @@ -365,7 +365,7 @@ static void listbox_dirty_children(JWidget widget) else if (child->rc->y1 >= vp->y2) break; - jwidget_dirty(child); + child->invalidate(); } jrect_free(vp); diff --git a/src/gui/jmanager.cpp b/src/gui/jmanager.cpp index 2de4c0c5c..4cebfac7a 100644 --- a/src/gui/jmanager.cpp +++ b/src/gui/jmanager.cpp @@ -272,7 +272,7 @@ bool jmanager_generate_messages(JWidget manager) window = reinterpret_cast(link->data); /* dirty the entire window and show it */ - jwidget_dirty(window); + window->invalidate(); window->setVisible(true); /* attract the focus to the magnetic widget... */ @@ -432,7 +432,7 @@ bool jmanager_generate_messages(JWidget manager) } generate_proc_windows_list(); - jwidget_dirty(window); + window->invalidate(); } /* put the focus */ @@ -917,7 +917,7 @@ void jmanager_remove_messages_for(JWidget widget) void jmanager_refresh_screen() { if (default_manager) - jwidget_invalidate(default_manager); + default_manager->invalidate(); } void jmanager_add_msg_filter(int message, JWidget widget) @@ -1047,7 +1047,7 @@ void _jmanager_close_window(JWidget manager, Frame* window, bool redraw_backgrou /* redraw background */ if (reg1) { - jwidget_invalidate_region(manager, reg1); + manager->invalidateRegion(reg1); jregion_free(reg1); } @@ -1309,7 +1309,7 @@ void jmanager_invalidate_region(JWidget widget, JRegion region) window = (Frame*)link->data; // invalidate regions of this window - jwidget_invalidate_region(window, reg1); + window->invalidateRegion(reg1); /* there is desktop? */ if (window->is_desktop()) @@ -1324,7 +1324,7 @@ void jmanager_invalidate_region(JWidget widget, JRegion region) // invalidate areas outside windows (only when there are not a desktop window) if (link == widget->children->end) - jwidget_invalidate_region(widget, reg1); + widget->invalidateRegion(reg1); jregion_free(reg1); jregion_free(reg2); diff --git a/src/gui/jmenu.cpp b/src/gui/jmenu.cpp index bf79511b7..adf41d950 100644 --- a/src/gui/jmenu.cpp +++ b/src/gui/jmenu.cpp @@ -849,7 +849,7 @@ static bool menuitem_msg_proc(Widget* widget, JMessage msg) case JM_MOUSEENTER: // TODO theme specific!! - jwidget_dirty(widget); + widget->invalidate(); // When a menu item receives the mouse, start a timer to open the submenu... if (widget->isEnabled() && HAS_SUBMENU(widget)) { @@ -862,7 +862,7 @@ static bool menuitem_msg_proc(Widget* widget, JMessage msg) case JM_MOUSELEAVE: // TODO theme specific!! - jwidget_dirty(widget); + widget->invalidate(); // Stop timer to open the popup if (menuitem->submenu_timer >= 0) { @@ -1171,7 +1171,7 @@ static void set_highlight(Widget* menu, Widget* menuitem, bool click, bool open_ // Is it? if (MITEM(child)->highlight) { MITEM(child)->highlight = false; - jwidget_dirty(child); + child->invalidate(); } } } @@ -1179,7 +1179,7 @@ static void set_highlight(Widget* menu, Widget* menuitem, bool click, bool open_ if (menuitem) { if (!MITEM(menuitem)->highlight) { MITEM(menuitem)->highlight = true; - jwidget_dirty(menuitem); + menuitem->invalidate(); } // Highlight parents diff --git a/src/gui/jpanel.cpp b/src/gui/jpanel.cpp index 89aafb1bd..4762dc062 100644 --- a/src/gui/jpanel.cpp +++ b/src/gui/jpanel.cpp @@ -53,7 +53,7 @@ void jpanel_set_pos(JWidget widget, double pos) panel->pos = MID(0, pos, 100); - jwidget_dirty(widget); + widget->invalidate(); } static bool panel_msg_proc(JWidget widget, JMessage msg) @@ -139,7 +139,7 @@ static bool panel_msg_proc(JWidget widget, JMessage msg) panel->pos = MID(0, panel->pos, 100); jwidget_set_rect(widget, widget->rc); - jwidget_dirty(widget); + widget->invalidate(); return true; } break; diff --git a/src/gui/jsystem.cpp b/src/gui/jsystem.cpp index 5154f3d09..a481db27f 100644 --- a/src/gui/jsystem.cpp +++ b/src/gui/jsystem.cpp @@ -252,7 +252,7 @@ void jmouse_draw_cursor() x+sprite_cursor->w, y+sprite_cursor->h); - jwidget_invalidate_rect(ji_get_default_manager(), rect); + ji_get_default_manager()->invalidateRect(rect); /* rectfill(ji_screen, rect->x1, rect->y1, rect->x2-1, rect->y2-1, makecol(0, 0, 255)); */ draw_sprite(ji_screen, sprite_cursor, x, y); diff --git a/src/gui/jview.cpp b/src/gui/jview.cpp index f796b8a92..46fb54fe3 100644 --- a/src/gui/jview.cpp +++ b/src/gui/jview.cpp @@ -196,7 +196,7 @@ void jview_set_size(JWidget widget, int w, int h) } /* setup viewport */ - jwidget_dirty(widget); + widget->invalidate(); jwidget_set_rect(view->viewport, pos); jview_set_scroll(widget, view->scroll_x, view->scroll_y); @@ -222,7 +222,7 @@ void jview_set_scroll(JWidget widget, int x, int y) return; jwidget_set_rect(view->viewport, view->viewport->rc); - jwidget_dirty(widget); + widget->invalidate(); } void jview_get_scroll(JWidget widget, int *x, int *y) @@ -582,8 +582,8 @@ static bool scrollbar_msg_proc(JWidget widget, JMessage msg) case JM_MOUSEENTER: case JM_MOUSELEAVE: - /* TODO add something to avoid this (theme specific stuff) */ - jwidget_invalidate(widget); + // TODO add something to avoid this (theme specific stuff) + widget->invalidate(); break; case JM_DRAW: diff --git a/src/gui/slider.cpp b/src/gui/slider.cpp index 4ab6262bd..fe97de757 100644 --- a/src/gui/slider.cpp +++ b/src/gui/slider.cpp @@ -39,7 +39,7 @@ void Slider::setRange(int min, int max) m_max = max; m_value = MID(min, m_value, max); - dirty(); + invalidate(); } void Slider::setValue(int value) @@ -49,7 +49,7 @@ void Slider::setValue(int value) m_value = MID(m_min, value, m_max); if (m_value != old_value) - dirty(); + invalidate(); // It DOES NOT emit CHANGE signal! to avoid recursive calls. } @@ -77,7 +77,7 @@ bool Slider::onProcessMessage(JMessage msg) case JM_FOCUSENTER: case JM_FOCUSLEAVE: if (isEnabled()) - dirty(); + invalidate(); break; case JM_BUTTONPRESSED: @@ -169,7 +169,7 @@ bool Slider::onProcessMessage(JMessage msg) /* TODO theme stuff */ if (isEnabled()) - dirty(); + invalidate(); break; case JM_KEYPRESSED: diff --git a/src/gui/widget.cpp b/src/gui/widget.cpp index fb65ea312..cf6d8280a 100644 --- a/src/gui/widget.cpp +++ b/src/gui/widget.cpp @@ -263,7 +263,7 @@ void Widget::setText(const char *text) this->setTextQuiet(text); jwidget_emit_signal(this, JI_SIGNAL_SET_TEXT); - dirty(); + invalidate(); } void Widget::setTextf(const char *format, ...) @@ -307,7 +307,7 @@ void Widget::setFont(FONT* f) m_font = f; jwidget_emit_signal(this, JI_SIGNAL_SET_FONT); - dirty(); + invalidate(); } void Widget::setTheme(Theme* theme) @@ -392,19 +392,13 @@ bool jwidget_is_focusrest(JWidget widget) /**********************************************************************/ /* status properties */ -void jwidget_dirty(JWidget widget) -{ - ASSERT_VALID_WIDGET(widget); - jwidget_invalidate(widget); -} - void Widget::setVisible(bool state) { if (state) { if (this->flags & JI_HIDDEN) { this->flags &= ~JI_HIDDEN; + invalidate(); - jwidget_dirty(this); jwidget_emit_signal(this, JI_SIGNAL_SHOW); } } @@ -423,7 +417,7 @@ void Widget::setEnabled(bool state) if (state) { if (this->flags & JI_DISABLED) { this->flags &= ~JI_DISABLED; - jwidget_dirty(this); + invalidate(); jwidget_emit_signal(this, JI_SIGNAL_ENABLE); } @@ -433,7 +427,7 @@ void Widget::setEnabled(bool state) jmanager_free_widget(this); // Free from the manager this->flags |= JI_DISABLED; - jwidget_dirty(this); + invalidate(); jwidget_emit_signal(this, JI_SIGNAL_DISABLE); } @@ -445,7 +439,7 @@ void Widget::setSelected(bool state) if (state) { if (!(this->flags & JI_SELECTED)) { this->flags |= JI_SELECTED; - jwidget_dirty(this); + invalidate(); jwidget_emit_signal(this, JI_SIGNAL_SELECT); } @@ -453,7 +447,7 @@ void Widget::setSelected(bool state) else { if (this->flags & JI_SELECTED) { this->flags &= ~JI_SELECTED; - jwidget_dirty(this); + invalidate(); jwidget_emit_signal(this, JI_SIGNAL_DESELECT); } @@ -685,7 +679,7 @@ void Widget::setBounds(const Rect& rc) void jwidget_relayout(JWidget widget) { jwidget_set_rect(widget, widget->rc); - jwidget_dirty(widget); + widget->invalidate(); } /* gets the position of the widget */ @@ -975,7 +969,7 @@ void jwidget_noborders(JWidget widget) widget->border_width.b = 0; widget->child_spacing = 0; - jwidget_dirty(widget); + widget->invalidate(); } void jwidget_set_border(JWidget widget, int value) @@ -987,7 +981,7 @@ void jwidget_set_border(JWidget widget, int value) widget->border_width.r = value; widget->border_width.b = value; - jwidget_dirty(widget); + widget->invalidate(); } void jwidget_set_border(JWidget widget, int l, int t, int r, int b) @@ -999,7 +993,7 @@ void jwidget_set_border(JWidget widget, int l, int t, int r, int b) widget->border_width.r = r; widget->border_width.b = b; - jwidget_dirty(widget); + widget->invalidate(); } void jwidget_set_rect(JWidget widget, JRect rect) @@ -1100,56 +1094,50 @@ void jwidget_flush_redraw(JWidget widget) } } -void jwidget_invalidate(JWidget widget) +void Widget::invalidate() { - ASSERT_VALID_WIDGET(widget); - - if (widget->isVisible()) { - JRegion reg1 = jwidget_get_drawable_region(widget, JI_GDR_CUTTOPWINDOWS); + if (isVisible()) { + JRegion reg1 = jwidget_get_drawable_region(this, JI_GDR_CUTTOPWINDOWS); JLink link; - jregion_copy(widget->update_region, reg1); + jregion_copy(this->update_region, reg1); jregion_free(reg1); - mark_dirty_flag(widget); + mark_dirty_flag(this); - JI_LIST_FOR_EACH(widget->children, link) - jwidget_invalidate(reinterpret_cast(link->data)); + JI_LIST_FOR_EACH(this->children, link) + reinterpret_cast(link->data)->invalidate(); } } -void jwidget_invalidate_rect(JWidget widget, const JRect rect) +void Widget::invalidateRect(const JRect rect) { - ASSERT_VALID_WIDGET(widget); - - if (widget->isVisible()) { + if (isVisible()) { JRegion reg1 = jregion_new(rect, 1); - jwidget_invalidate_region(widget, reg1); + invalidateRegion(reg1); jregion_free(reg1); } } -void jwidget_invalidate_region(JWidget widget, const JRegion region) +void Widget::invalidateRegion(const JRegion region) { - ASSERT_VALID_WIDGET(widget); - - if (widget->isVisible() && - jregion_rect_in(region, widget->rc) != JI_RGNOUT) { + if (isVisible() && + jregion_rect_in(region, this->rc) != JI_RGNOUT) { JRegion reg1 = jregion_new(NULL, 0); - JRegion reg2 = jwidget_get_drawable_region(widget, + JRegion reg2 = jwidget_get_drawable_region(this, JI_GDR_CUTTOPWINDOWS); JLink link; - jregion_union(reg1, widget->update_region, region); - jregion_intersect(widget->update_region, reg1, reg2); + jregion_union(reg1, this->update_region, region); + jregion_intersect(this->update_region, reg1, reg2); jregion_free(reg2); - jregion_subtract(reg1, region, widget->update_region); + jregion_subtract(reg1, region, this->update_region); - mark_dirty_flag(widget); + mark_dirty_flag(this); - JI_LIST_FOR_EACH(widget->children, link) - jwidget_invalidate_region(reinterpret_cast(link->data), reg1); + JI_LIST_FOR_EACH(this->children, link) + reinterpret_cast(link->data)->invalidateRegion(reg1); jregion_free(reg1); } @@ -1492,7 +1480,7 @@ bool Widget::onProcessMessage(JMessage msg) JLink link; JI_LIST_FOR_EACH(widget->children, link) - jwidget_dirty(reinterpret_cast(link->data)); + reinterpret_cast(link->data)->invalidate(); return true; } diff --git a/src/gui/widget.h b/src/gui/widget.h index 741c58624..4d294fb15 100644 --- a/src/gui/widget.h +++ b/src/gui/widget.h @@ -53,10 +53,6 @@ bool jwidget_is_expansive(JWidget widget); bool jwidget_is_decorative(JWidget widget); bool jwidget_is_focusrest(JWidget widget); -/* status properties */ - -void jwidget_dirty(JWidget widget); - /* children handle */ void jwidget_add_child(JWidget widget, JWidget child); @@ -90,9 +86,6 @@ void jwidget_set_bg_color(JWidget widget, int color); /* drawing methods */ void jwidget_flush_redraw(JWidget widget); -void jwidget_invalidate(JWidget widget); -void jwidget_invalidate_rect(JWidget widget, const JRect rect); -void jwidget_invalidate_region(JWidget widget, const JRegion region); void jwidget_scroll(JWidget widget, JRegion region, int dx, int dy); /* signal handle */ @@ -162,8 +155,9 @@ public: /* for user */ void *user_data[4]; - ////////////////////////////////////////////////////////////////////// - // Methods + // =============================================================== + // CTOR & DTOR + // =============================================================== Widget(int type); virtual ~Widget(); @@ -225,8 +219,9 @@ public: Theme* getTheme() const { return m_theme; } void setTheme(Theme* theme); - ////////////////////////////////////////////////////////////////////// - // parents and children + // =============================================================== + // PARENTS & CHILDREN + // =============================================================== Widget* getRoot(); Widget* getParent(); @@ -245,18 +240,24 @@ public: return dynamic_cast(findChild(name)); } - void dirty() { - jwidget_dirty(this); - } - - ////////////////////////////////////////////////////////////////////// - // position and geometry + // =============================================================== + // POSITION & GEOMETRY + // =============================================================== gfx::Rect getBounds() const; void setBounds(const gfx::Rect& rc); - ////////////////////////////////////////////////////////////////////// - // manager handler + // =============================================================== + // REFRESH ISSUES + // =============================================================== + + void invalidate(); + void invalidateRect(const JRect rect); + void invalidateRegion(const JRegion region); + + // =============================================================== + // GUI MANAGER + // =============================================================== bool sendMessage(JMessage msg); void closeWindow(); diff --git a/src/modules/editors.cpp b/src/modules/editors.cpp index 5de372e87..def5a1123 100644 --- a/src/modules/editors.cpp +++ b/src/modules/editors.cpp @@ -36,7 +36,7 @@ #define FIXUP_TOP_WINDOW() \ app_get_top_window()->remap_window(); \ - app_get_top_window()->dirty(); + app_get_top_window()->invalidate(); typedef std::vector EditorList; @@ -84,7 +84,7 @@ void remove_editor(Editor* editor) void refresh_all_editors() { for (EditorList::iterator it = editors.begin(); it != editors.end(); ++it) { - jwidget_dirty(*it); + (*it)->invalidate(); } } @@ -198,11 +198,11 @@ void set_current_editor(Editor* editor) { if (current_editor != editor) { if (current_editor) - jwidget_dirty(jwidget_get_view(current_editor)); + jwidget_get_view(current_editor)->invalidate(); current_editor = editor; - jwidget_dirty(jwidget_get_view(current_editor)); + jwidget_get_view(current_editor)->invalidate(); UIContext* context = UIContext::instance(); Sprite* sprite = current_editor->getSprite(); @@ -224,7 +224,7 @@ void set_sprite_in_current_editor(Sprite *sprite) current_editor->editor_set_sprite(sprite); - jwidget_dirty(jwidget_get_view(current_editor)); + jwidget_get_view(current_editor)->invalidate(); app_refresh_screen(sprite); app_realloc_sprite_list(); diff --git a/src/modules/gui.cpp b/src/modules/gui.cpp index 559f5b5a8..01eabf269 100644 --- a/src/modules/gui.cpp +++ b/src/modules/gui.cpp @@ -860,7 +860,7 @@ void set_gfxicon_in_button(ButtonBase* button, int gfx_id) button->setButtonIcon(get_gfx(gfx_id)); - jwidget_dirty(button); + button->invalidate(); } static bool button_with_icon_msg_proc(JWidget widget, JMessage msg) diff --git a/src/modules/rootmenu.cpp b/src/modules/rootmenu.cpp index 5175f22c2..d686b7e8f 100644 --- a/src/modules/rootmenu.cpp +++ b/src/modules/rootmenu.cpp @@ -231,7 +231,7 @@ static int load_root_menu() if (app_get_menubar()) { jmenubar_set_menu(app_get_menubar(), root_menu); app_get_top_window()->remap_window(); - jwidget_dirty(app_get_top_window()); + app_get_top_window()->invalidate(); } return 0; diff --git a/src/util/clipboard.cpp b/src/util/clipboard.cpp index 81734e2b7..f294db8bd 100644 --- a/src/util/clipboard.cpp +++ b/src/util/clipboard.cpp @@ -503,7 +503,7 @@ static bool interactive_transform(Editor* editor, jmouse_control_infinite_scroll(vp); - jwidget_dirty(view); + view->invalidate(); jwidget_flush_redraw(view); UPDATE(); diff --git a/src/util/misc.cpp b/src/util/misc.cpp index 0897851b1..ed6ae463a 100644 --- a/src/util/misc.cpp +++ b/src/util/misc.cpp @@ -118,7 +118,7 @@ int interactive_move_layer(int mode, bool use_undo, int (*callback)()) cel->y = begin_y - start_y + new_y; /* update layer-bounds */ - jwidget_dirty(editor); + editor->invalidate(); /* update status bar */ app_get_statusbar()->setStatusText diff --git a/src/widgets/color_bar.cpp b/src/widgets/color_bar.cpp index c3d051821..8c452effe 100644 --- a/src/widgets/color_bar.cpp +++ b/src/widgets/color_bar.cpp @@ -112,7 +112,7 @@ ColorBar::~ColorBar() void ColorBar::setFgColor(const Color& color) { m_fgcolor = color; - dirty(); + invalidate(); updateStatusBar(m_fgcolor, 100); FgColorChange(m_fgcolor); @@ -121,7 +121,7 @@ void ColorBar::setFgColor(const Color& color) void ColorBar::setBgColor(const Color& color) { m_bgcolor = color; - dirty(); + invalidate(); updateStatusBar(m_bgcolor, 100); BgColorChange(m_bgcolor); @@ -310,7 +310,7 @@ bool ColorBar::onProcessMessage(JMessage msg) // Redraw 'hot' color if (m_hot != old_hot) { - dirty(); + invalidate(); // Open the new hot-color to be edited if ((m_hot != HOTCOLOR_NONE) && @@ -327,7 +327,7 @@ bool ColorBar::onProcessMessage(JMessage msg) case JM_MOUSELEAVE: if (m_hot != HOTCOLOR_NONE) { m_hot = HOTCOLOR_NONE; - dirty(); + invalidate(); } app_get_statusbar()->clearText(); break; @@ -384,12 +384,12 @@ bool ColorBar::onProcessMessage(JMessage msg) if (get_config_bool("ColorBar", "CanGrow", false) || (old_columns == 1 || m_columns == 1)) { app_get_top_window()->remap_window(); - app_get_top_window()->dirty(); + app_get_top_window()->invalidate(); } } // Redraw the whole widget - dirty(); + invalidate(); // Update the status bar updateStatusBar(getColorByPosition(jmouse_x(0), jmouse_y(0)), 0); @@ -404,7 +404,7 @@ bool ColorBar::onProcessMessage(JMessage msg) Color color = getHotColor(m_hot_drag); setHotColor(m_hot_drop, color); } - dirty(); + invalidate(); } /* pick the color */ else if (m_hot != HOTCOLOR_NONE) { diff --git a/src/widgets/color_button.cpp b/src/widgets/color_button.cpp index d1c09f59b..23c274dae 100644 --- a/src/widgets/color_button.cpp +++ b/src/widgets/color_button.cpp @@ -70,7 +70,7 @@ Color ColorButton::getColor() const void ColorButton::setColor(const Color& color) { m_color = color; - dirty(); + invalidate(); } bool ColorButton::onProcessMessage(JMessage msg) diff --git a/src/widgets/colview.cpp b/src/widgets/colview.cpp index 71570003e..201c255df 100644 --- a/src/widgets/colview.cpp +++ b/src/widgets/colview.cpp @@ -87,7 +87,7 @@ void colorviewer_set_color(JWidget widget, const Color& color) ColorViewer *colorviewer = colorviewer_data(widget); colorviewer->color = color; - jwidget_dirty(widget); + widget->invalidate(); } static ColorViewer *colorviewer_data(JWidget widget) diff --git a/src/widgets/curvedit.cpp b/src/widgets/curvedit.cpp index 1c1c5a32a..20135c206 100644 --- a/src/widgets/curvedit.cpp +++ b/src/widgets/curvedit.cpp @@ -175,7 +175,7 @@ static bool curve_editor_msg_proc(JWidget widget, JMessage msg) /* TODO undo? */ curve_add_point(curve_editor->curve, point); - jwidget_dirty(widget); + widget->invalidate(); jwidget_emit_signal(widget, SIGNAL_CURVE_EDITOR_CHANGE); break; } @@ -190,7 +190,7 @@ static bool curve_editor_msg_proc(JWidget widget, JMessage msg) /* TODO undo? */ curve_remove_point(curve_editor->curve, point); - jwidget_dirty(widget); + widget->invalidate(); jwidget_emit_signal(widget, SIGNAL_CURVE_EDITOR_CHANGE); break; } @@ -280,14 +280,14 @@ static bool curve_editor_msg_proc(JWidget widget, JMessage msg) SCR2EDIT_Y(msg->mouse.y), NULL, NULL); if (curve_editor->edit_point) { - jwidget_dirty(widget); + widget->invalidate(); jwidget_flush_redraw(widget); if (edit_node_manual(curve_editor->edit_point)) jwidget_emit_signal(widget, SIGNAL_CURVE_EDITOR_CHANGE); curve_editor->edit_point = NULL; - jwidget_dirty(widget); + widget->invalidate(); } return true; @@ -373,7 +373,7 @@ static bool curve_editor_msg_proc(JWidget widget, JMessage msg) /* TODO this should be optional */ jwidget_emit_signal(widget, SIGNAL_CURVE_EDITOR_CHANGE); - jwidget_dirty(widget); + widget->invalidate(); } break; } @@ -408,7 +408,7 @@ static bool curve_editor_msg_proc(JWidget widget, JMessage msg) jwidget_emit_signal(widget, SIGNAL_CURVE_EDITOR_CHANGE); curve_editor->edit_point = NULL; - jwidget_dirty(widget); + widget->invalidate(); break; } diff --git a/src/widgets/editor/editor.cpp b/src/widgets/editor/editor.cpp index e69f57810..83481b604 100644 --- a/src/widgets/editor/editor.cpp +++ b/src/widgets/editor/editor.cpp @@ -170,7 +170,7 @@ void Editor::editor_set_sprite(Sprite* sprite) } // Redraw the entire editor (because we have a new sprite to draw) - dirty(); + invalidate(); } // Sets the scroll position of the editor diff --git a/src/widgets/fileview.cpp b/src/widgets/fileview.cpp index bfdb7b48a..83047cab5 100644 --- a/src/widgets/fileview.cpp +++ b/src/widgets/fileview.cpp @@ -160,7 +160,7 @@ void fileview_set_current_folder(JWidget widget, IFileItem* folder) jwidget_emit_signal(widget, SIGNAL_FILEVIEW_CURRENT_FOLDER_CHANGED); - jwidget_dirty(widget); + widget->invalidate(); jview_update(jwidget_get_view(widget)); } @@ -411,7 +411,7 @@ static bool fileview_msg_proc(JWidget widget, JMessage msg) if (old_selected != fileview->selected) { fileview_generate_preview_of_selected_item(widget); - jwidget_dirty(widget); + widget->invalidate(); jwidget_emit_signal(widget, SIGNAL_FILEVIEW_FILE_SELECTED); } } @@ -676,7 +676,7 @@ static void fileview_select_index(JWidget widget, int index) if (old_selected != fileview->selected) { fileview_make_selected_fileitem_visible(widget); - jwidget_dirty(widget); + widget->invalidate(); jwidget_emit_signal(widget, SIGNAL_FILEVIEW_FILE_SELECTED); } @@ -732,7 +732,7 @@ static bool fileview_generate_thumbnail(JWidget widget, IFileItem* fileitem) monitor_free_thumbnail_generation, data); fileview_data(widget)->monitors.push_back(data->monitor); - jwidget_dirty(widget); + widget->invalidate(); } else { fop_free(fop); @@ -843,14 +843,14 @@ static void monitor_thumbnail_generation(void *_data) /* is the selected file-item the one that now has a thumbnail? */ if (fileview_get_selected(data->fileview) == data->fileitem) { /* we have to dirty the file-view to show the thumbnail */ - jwidget_dirty(data->fileview); + data->fileview->invalidate(); } } remove_gui_monitor(data->monitor); } else { - jwidget_dirty(data->fileview); + data->fileview->invalidate(); } } diff --git a/src/widgets/paledit.cpp b/src/widgets/paledit.cpp index 9cdd7519f..5e3f3a9fa 100644 --- a/src/widgets/paledit.cpp +++ b/src/widgets/paledit.cpp @@ -86,7 +86,7 @@ void PalEdit::setColumns(int columns) if (view) jview_update(view); - jwidget_dirty(this); + invalidate(); } } @@ -109,7 +109,7 @@ void PalEdit::selectColor(int index) if ((index >= 0) && (index <= 255)) update_scroll(index); - jwidget_dirty(this); + invalidate(); } } @@ -123,7 +123,7 @@ void PalEdit::selectRange(int begin, int end, int range_type) m_range_type = range_type; update_scroll(end); - jwidget_dirty(this); + invalidate(); } static void swap_color(Palette* palette, int i1, int i2) diff --git a/src/widgets/statebar.cpp b/src/widgets/statebar.cpp index 619243124..45470a8aa 100644 --- a/src/widgets/statebar.cpp +++ b/src/widgets/statebar.cpp @@ -200,7 +200,7 @@ bool StatusBar::setStatusText(int msecs, const char *format, ...) m_state = SHOW_TEXT; this->setText(buf); - this->dirty(); + this->invalidate(); return true; } @@ -245,7 +245,7 @@ void StatusBar::showTip(int msecs, const char *format, ...) // Set the text in status-bar (with inmediate timeout) m_timeout = ji_clock; this->setText(buf); - this->dirty(); + this->invalidate(); } void StatusBar::showColor(int msecs, const char* text, const Color& color, int alpha) @@ -285,7 +285,7 @@ void StatusBar::showMovePixelsOptions() { if (!this->hasChild(m_movePixelsBox)) { jwidget_add_child(this, m_movePixelsBox); - jwidget_dirty(this); + invalidate(); } } @@ -293,7 +293,7 @@ void StatusBar::hideMovePixelsOptions() { if (this->hasChild(m_movePixelsBox)) { jwidget_remove_child(this, m_movePixelsBox); - jwidget_dirty(this); + invalidate(); } } @@ -309,7 +309,7 @@ Progress* StatusBar::addProgress() { Progress* progress = new Progress(this); jlist_append(m_progress, progress); - jwidget_dirty(this); + invalidate(); return progress; } @@ -318,7 +318,7 @@ void StatusBar::removeProgress(Progress* progress) ASSERT(progress->m_statusbar == this); jlist_remove(m_progress, progress); - jwidget_dirty(this); + invalidate(); } Progress::Progress(StatusBar* statusbar) @@ -339,7 +339,7 @@ void Progress::setPos(float pos) { if (m_pos != pos) { m_pos = pos; - m_statusbar->dirty(); + m_statusbar->invalidate(); } } @@ -588,7 +588,7 @@ bool StatusBar::onProcessMessage(JMessage msg) updateFromLayer(); jwidget_add_child(this, m_commandsBox); - jwidget_dirty(this); + invalidate(); } else { // Status text for donations @@ -649,7 +649,7 @@ bool StatusBar::onProcessMessage(JMessage msg) if (m_hot_layer != hot_layer) { m_hot_layer = hot_layer; - dirty(); + invalidate(); } } catch (LockedSpriteException&) { @@ -677,7 +677,7 @@ bool StatusBar::onProcessMessage(JMessage msg) current_editor->flashCurrentLayer(); // Redraw the status-bar - dirty(); + invalidate(); } } else { @@ -704,12 +704,12 @@ bool StatusBar::onProcessMessage(JMessage msg) jmanager_free_focus(); // TODO Review this code jwidget_remove_child(this, m_commandsBox); - jwidget_dirty(this); + invalidate(); } if (m_hot_layer >= 0) { m_hot_layer = -1; - dirty(); + invalidate(); } } break; diff --git a/src/widgets/tabs.cpp b/src/widgets/tabs.cpp index 242b5d8ef..0fc080df7 100644 --- a/src/widgets/tabs.cpp +++ b/src/widgets/tabs.cpp @@ -111,7 +111,7 @@ void Tabs::addTab(const char* text, void* data) setScrollX(m_scrollX); startAni(ANI_ADDING_TAB); - //jwidget_dirty(this); + //invalidate(); } void Tabs::removeTab(void* data) @@ -162,7 +162,7 @@ void Tabs::setTabText(const char* text, void* data) if (m_selected == tab) makeTabVisible(tab); - jwidget_dirty(this); + invalidate(); } } @@ -173,7 +173,7 @@ void Tabs::selectTab(void* data) if (tab != NULL) { m_selected = tab; makeTabVisible(tab); - jwidget_dirty(this); + invalidate(); } } @@ -297,7 +297,7 @@ bool Tabs::onProcessMessage(JMessage msg) case JM_MOUSELEAVE: if (m_hot != NULL) { m_hot = NULL; - jwidget_dirty(this); + invalidate(); } return true; @@ -305,7 +305,7 @@ bool Tabs::onProcessMessage(JMessage msg) if (m_hot != NULL) { if (m_selected != m_hot) { m_selected = m_hot; - jwidget_dirty(this); + invalidate(); } if (m_selected && m_handler) @@ -363,13 +363,13 @@ bool Tabs::onProcessMessage(JMessage msg) case ANI_ADDING_TAB: { if (m_ani_t == ANI_ADDING_TAB_TICKS) stopAni(); - dirty(); + invalidate(); break; } case ANI_REMOVING_TAB: { if (m_ani_t == ANI_REMOVING_TAB_TICKS) stopAni(); - dirty(); + invalidate(); break; } } @@ -516,7 +516,7 @@ void Tabs::setScrollX(int scroll_x) if (m_scrollX != scroll_x) { m_scrollX = scroll_x; calculateHot(); - jwidget_dirty(this); + invalidate(); } // We need scroll buttons? @@ -525,7 +525,7 @@ void Tabs::setScrollX(int scroll_x) if (!HAS_ARROWS(this)) { jwidget_add_child(this, m_button_left); jwidget_add_child(this, m_button_right); - jwidget_dirty(this); + invalidate(); } /* disable/enable buttons */ @@ -550,7 +550,7 @@ void Tabs::setScrollX(int scroll_x) else if (HAS_ARROWS(this)) { jwidget_remove_child(this, m_button_left); jwidget_remove_child(this, m_button_right); - jwidget_dirty(this); + invalidate(); } } @@ -581,7 +581,7 @@ void Tabs::calculateHot() if (m_handler) m_handler->mouseOverTab(this, m_hot ? m_hot->data: NULL); - jwidget_dirty(this); + invalidate(); } jrect_free(rect); diff --git a/src/widgets/toolbar.cpp b/src/widgets/toolbar.cpp index 0f49c4106..b261dbd9a 100644 --- a/src/widgets/toolbar.cpp +++ b/src/widgets/toolbar.cpp @@ -268,7 +268,7 @@ bool ToolBar::onProcessMessage(JMessage msg) toolrc = getToolGroupBounds(c); if (msg->mouse.y >= toolrc.y && msg->mouse.y < toolrc.y+toolrc.h) { UIContext::instance()->getSettings()->setCurrentTool(tool); - dirty(); + invalidate(); openPopupWindow(c, tool_group); } @@ -320,7 +320,7 @@ bool ToolBar::onProcessMessage(JMessage msg) m_hot_conf != hot_conf) { m_hot_tool = hot_tool; m_hot_conf = hot_conf; - dirty(); + invalidate(); if (m_hot_tool || m_hot_conf) openTipWindow(tip_index, m_hot_tool); @@ -341,7 +341,7 @@ bool ToolBar::onProcessMessage(JMessage msg) m_hot_tool = NULL; m_hot_conf = false; - dirty(); + invalidate(); app_get_statusbar()->clearText(); break; @@ -421,7 +421,7 @@ void ToolBar::openPopupWindow(int group_index, ToolGroup* tool_group) // Redraw the overlapped area and save it to use it in the ToolStrip::onProcessMessage(JM_DRAW) { JRect rcTemp = jrect_new(rc.x, rc.y, rc.x+rc.w, rc.y+rc.h); - jwidget_invalidate_rect(ji_get_default_manager(), rcTemp); + ji_get_default_manager()->invalidateRect(rcTemp); jrect_free(rcTemp); // Flush JM_DRAW messages and send them @@ -524,7 +524,7 @@ void ToolBar::selectTool(Tool* tool) m_selected_in_group[tool->getGroup()] = tool; UIContext::instance()->getSettings()->setCurrentTool(tool); - dirty(); + invalidate(); } void ToolBar::onClosePopup() @@ -536,7 +536,7 @@ void ToolBar::onClosePopup() m_open_on_hot = false; m_hot_tool = NULL; - dirty(); + invalidate(); } ////////////////////////////////////////////////////////////////////// @@ -665,7 +665,7 @@ bool ToolStrip::onProcessMessage(JMessage msg) // Hot button changed if (m_hot_tool != hot_tool) { m_hot_tool = hot_tool; - dirty(); + invalidate(); // Show the tooltip for the hot tool if (m_hot_tool)