mirror of
https://github.com/aseprite/aseprite.git
synced 2025-03-28 05:37:19 +00:00
Replace jwidget_dirty/invalidate and Widget::dirty functions with new Widget::invalidate* member functions.
This commit is contained in:
parent
86e145f0ed
commit
cb6d70521f
@ -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)) {
|
||||
|
@ -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()
|
||||
|
@ -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());
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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());
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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) \
|
||||
|
@ -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);
|
||||
|
@ -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:
|
||||
|
@ -352,7 +352,7 @@ static void listbox_dirty_children(JWidget widget)
|
||||
|
||||
if (!view) {
|
||||
JI_LIST_FOR_EACH(widget->children, link)
|
||||
jwidget_dirty(reinterpret_cast<JWidget>(link->data));
|
||||
reinterpret_cast<JWidget>(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);
|
||||
|
@ -272,7 +272,7 @@ bool jmanager_generate_messages(JWidget manager)
|
||||
window = reinterpret_cast<JWidget>(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);
|
||||
|
@ -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
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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:
|
||||
|
@ -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:
|
||||
|
@ -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<JWidget>(link->data));
|
||||
JI_LIST_FOR_EACH(this->children, link)
|
||||
reinterpret_cast<JWidget>(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<JWidget>(link->data), reg1);
|
||||
JI_LIST_FOR_EACH(this->children, link)
|
||||
reinterpret_cast<JWidget>(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<JWidget>(link->data));
|
||||
reinterpret_cast<JWidget>(link->data)->invalidate();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -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<T*>(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();
|
||||
|
@ -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<Editor*> 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();
|
||||
|
@ -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)
|
||||
|
@ -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;
|
||||
|
@ -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();
|
||||
|
||||
|
@ -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
|
||||
|
@ -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) {
|
||||
|
@ -70,7 +70,7 @@ Color ColorButton::getColor() const
|
||||
void ColorButton::setColor(const Color& color)
|
||||
{
|
||||
m_color = color;
|
||||
dirty();
|
||||
invalidate();
|
||||
}
|
||||
|
||||
bool ColorButton::onProcessMessage(JMessage msg)
|
||||
|
@ -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)
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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
|
||||
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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)
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
|
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user