mirror of
https://github.com/aseprite/aseprite.git
synced 2025-01-30 06:32:42 +00:00
Merge branch 'dev' of git@github.com:dacap/aseprite.git into dev
Conflicts: src/ui/popup_window.cpp src/ui/tooltips.cpp src/ui/tooltips.h src/ui/window.cpp
This commit is contained in:
commit
95a0c6d0f4
@ -349,7 +349,7 @@ int app_get_color_to_clear_layer(Layer* layer)
|
||||
app::Color color = app::Color::fromMask();
|
||||
|
||||
/* the `Background' is erased with the `Background Color' */
|
||||
if (layer != NULL && layer->is_background())
|
||||
if (layer != NULL && layer->isBackground())
|
||||
color = ColorBar::instance()->getBgColor();
|
||||
|
||||
return color_utils::color_for_layer(color, layer);
|
||||
|
@ -20,6 +20,8 @@
|
||||
|
||||
#include "app/color.h"
|
||||
|
||||
using namespace app;
|
||||
|
||||
inline std::ostream& operator<<(std::ostream& os, const Color& color) {
|
||||
return os << color.toString();
|
||||
}
|
||||
|
@ -191,7 +191,7 @@ int color_utils::color_for_layer(const app::Color& color, Layer* layer)
|
||||
|
||||
int color_utils::fixup_color_for_layer(Layer *layer, int color)
|
||||
{
|
||||
if (layer->is_background())
|
||||
if (layer->isBackground())
|
||||
return fixup_color_for_background(layer->getSprite()->getPixelFormat(), color);
|
||||
else
|
||||
return color;
|
||||
|
@ -84,7 +84,7 @@ public:
|
||||
m_editor->backToPreviousState();
|
||||
}
|
||||
|
||||
bool pressedOk() { return get_killer() == m_ok; }
|
||||
bool pressedOk() { return getKiller() == m_ok; }
|
||||
|
||||
int getLeft() const { return m_left->getTextInt(); }
|
||||
int getRight() const { return m_right->getTextInt(); }
|
||||
@ -176,8 +176,8 @@ void CanvasSizeCommand::onExecute(Context* context)
|
||||
// load the window widget
|
||||
UniquePtr<CanvasSizeWindow> window(new CanvasSizeWindow(0, 0, 0, 0));
|
||||
|
||||
window->remap_window();
|
||||
window->center_window();
|
||||
window->remapWindow();
|
||||
window->centerWindow();
|
||||
|
||||
load_window_pos(window, "CanvasSize");
|
||||
window->setVisible(true);
|
||||
|
@ -83,7 +83,7 @@ void CelPropertiesCommand::onExecute(Context* context)
|
||||
setup_mini_look(slider_opacity);
|
||||
|
||||
/* if the layer isn't writable */
|
||||
if (!layer->is_writable()) {
|
||||
if (!layer->isWritable()) {
|
||||
button_ok->setText("Locked");
|
||||
button_ok->setEnabled(false);
|
||||
}
|
||||
@ -109,7 +109,7 @@ void CelPropertiesCommand::onExecute(Context* context)
|
||||
|
||||
// Opacity
|
||||
slider_opacity->setValue(cel->getOpacity());
|
||||
if (layer->is_background()) {
|
||||
if (layer->isBackground()) {
|
||||
slider_opacity->setEnabled(false);
|
||||
tooltipManager->addTooltipFor(slider_opacity,
|
||||
"The `Background' layer is opaque,\n"
|
||||
@ -126,7 +126,7 @@ void CelPropertiesCommand::onExecute(Context* context)
|
||||
|
||||
window->openWindowInForeground();
|
||||
|
||||
if (window->get_killer() == button_ok) {
|
||||
if (window->getKiller() == button_ok) {
|
||||
DocumentWriter document_writer(document);
|
||||
Sprite* sprite_writer = document_writer->getSprite();
|
||||
Layer* layer_writer = sprite_writer->getCurrentLayer();
|
||||
|
@ -199,7 +199,7 @@ static void on_current_tool_change()
|
||||
if (rect->y2 > JI_SCREEN_H)
|
||||
jrect_displace(rect, 0, JI_SCREEN_H - rect->y2);
|
||||
|
||||
window->move_window(rect);
|
||||
window->moveWindow(rect);
|
||||
jrect_free(rect);
|
||||
}
|
||||
else
|
||||
@ -385,8 +385,8 @@ void ConfigureTools::onExecute(Context* context)
|
||||
on_current_tool_change();
|
||||
|
||||
// Default position
|
||||
window->remap_window();
|
||||
window->center_window();
|
||||
window->remapWindow();
|
||||
window->centerWindow();
|
||||
|
||||
// Load window configuration
|
||||
load_window_pos(window, "ConfigureTool");
|
||||
|
@ -39,8 +39,8 @@ public:
|
||||
m_vbox.addChild(&m_docs);
|
||||
addChild(&m_vbox);
|
||||
|
||||
remap_window();
|
||||
center_window();
|
||||
remapWindow();
|
||||
centerWindow();
|
||||
}
|
||||
|
||||
void updateDocuments(Context* context)
|
||||
|
@ -86,9 +86,9 @@ void DuplicateLayerCommand::onExecute(Context* context)
|
||||
// Add the new layer in the sprite.
|
||||
if (undo.isEnabled())
|
||||
undo.pushUndoer(new undoers::AddLayer(undo.getObjects(),
|
||||
sourceLayer->get_parent(), newLayerPtr));
|
||||
sourceLayer->getParent(), newLayerPtr));
|
||||
|
||||
sourceLayer->get_parent()->addLayer(newLayerPtr);
|
||||
sourceLayer->getParent()->addLayer(newLayerPtr);
|
||||
|
||||
// Release the pointer as it is owned by the sprite now
|
||||
Layer* newLayer = newLayerPtr.release();
|
||||
@ -100,7 +100,7 @@ void DuplicateLayerCommand::onExecute(Context* context)
|
||||
|
||||
undo.commit();
|
||||
|
||||
sourceLayer->get_parent()->stackLayer(newLayer, sourceLayer);
|
||||
sourceLayer->getParent()->stackLayer(newLayer, sourceLayer);
|
||||
sprite->setCurrentLayer(newLayer);
|
||||
|
||||
update_screen_for_document(document);
|
||||
|
@ -84,7 +84,7 @@ void DuplicateSpriteCommand::onExecute(Context* context)
|
||||
/* open the window */
|
||||
window->openWindowInForeground();
|
||||
|
||||
if (window->get_killer() == window->findChild("ok")) {
|
||||
if (window->getKiller() == window->findChild("ok")) {
|
||||
set_config_bool("DuplicateSprite", "Flatten", flatten->isSelected());
|
||||
|
||||
// make a copy of the document
|
||||
|
@ -113,7 +113,7 @@ protected:
|
||||
|
||||
gfx::Size reqSize = getPreferredSize();
|
||||
JRect rect = jrect_new(rc->x1, rc->y1, rc->x1+reqSize.w, rc->y1+reqSize.h);
|
||||
move_window(rect);
|
||||
moveWindow(rect);
|
||||
jrect_free(rect);
|
||||
|
||||
invalidate();
|
||||
@ -182,7 +182,7 @@ protected:
|
||||
resultCel.release();
|
||||
|
||||
// Copy the list of layers (because we will modify it in the iteration).
|
||||
LayerList layers = sprite->getFolder()->get_layers_list();
|
||||
LayerList layers = sprite->getFolder()->getLayersList();
|
||||
|
||||
// Remove all other layers
|
||||
for (LayerIterator it=layers.begin(), end=layers.end(); it!=end; ++it) {
|
||||
|
@ -117,7 +117,7 @@ void FramePropertiesCommand::onExecute(Context* context)
|
||||
frlen->setTextf("%d", sprite->getFrameDuration(sprite->getCurrentFrame()));
|
||||
|
||||
window->openWindowInForeground();
|
||||
if (window->get_killer() == ok) {
|
||||
if (window->getKiller() == ok) {
|
||||
int num = strtol(frlen->getText(), NULL, 10);
|
||||
|
||||
if (m_target == ALL_FRAMES) {
|
||||
|
@ -242,7 +242,7 @@ void GotoFrameCommand::onExecute(Context* context)
|
||||
frame->setTextf("%d", context->getActiveDocument()->getSprite()->getCurrentFrame()+1);
|
||||
|
||||
window->openWindowInForeground();
|
||||
if (window->get_killer() != ok)
|
||||
if (window->getKiller() != ok)
|
||||
return;
|
||||
|
||||
m_frame = strtol(frame->getText(), NULL, 10);
|
||||
|
@ -150,7 +150,7 @@ void GridSettingsCommand::onExecute(Context* context)
|
||||
|
||||
window->openWindowInForeground();
|
||||
|
||||
if (window->get_killer() == button_ok) {
|
||||
if (window->getKiller() == button_ok) {
|
||||
bounds.x = grid_x->getTextInt();
|
||||
bounds.y = grid_y->getTextInt();
|
||||
bounds.w = grid_w->getTextInt();
|
||||
|
@ -204,7 +204,7 @@ protected:
|
||||
}
|
||||
|
||||
// Copy the list of layers (because we will modify it in the iteration).
|
||||
LayerList layers = sprite->getFolder()->get_layers_list();
|
||||
LayerList layers = sprite->getFolder()->getLayersList();
|
||||
|
||||
// Remove all other layers
|
||||
for (LayerIterator it=layers.begin(), end=layers.end(); it!=end; ++it) {
|
||||
|
@ -92,7 +92,7 @@ void LayerPropertiesCommand::onExecute(Context* context)
|
||||
|
||||
window->openWindowInForeground();
|
||||
|
||||
if (window->get_killer() == button_ok) {
|
||||
if (window->getKiller() == button_ok) {
|
||||
DocumentWriter documentWriter(document);
|
||||
|
||||
const_cast<Layer*>(layer)->setName(entry_name->getText());
|
||||
|
@ -65,11 +65,11 @@ bool MergeDownLayerCommand::onEnabled(Context* context)
|
||||
return false;
|
||||
|
||||
Layer* src_layer = sprite->getCurrentLayer();
|
||||
if (!src_layer || !src_layer->is_image())
|
||||
if (!src_layer || !src_layer->isImage())
|
||||
return false;
|
||||
|
||||
Layer* dst_layer = sprite->getCurrentLayer()->get_prev();
|
||||
if (!dst_layer || !dst_layer->is_image())
|
||||
Layer* dst_layer = sprite->getCurrentLayer()->getPrevious();
|
||||
if (!dst_layer || !dst_layer->isImage())
|
||||
return false;
|
||||
|
||||
return true;
|
||||
@ -86,7 +86,7 @@ void MergeDownLayerCommand::onExecute(Context* context)
|
||||
int index;
|
||||
|
||||
src_layer = sprite->getCurrentLayer();
|
||||
dst_layer = sprite->getCurrentLayer()->get_prev();
|
||||
dst_layer = sprite->getCurrentLayer()->getPrevious();
|
||||
|
||||
for (FrameNumber frpos(0); frpos<sprite->getTotalFrames(); ++frpos) {
|
||||
// Get frames
|
||||
@ -135,7 +135,7 @@ void MergeDownLayerCommand::onExecute(Context* context)
|
||||
Image *new_image;
|
||||
|
||||
/* merge down in the background layer */
|
||||
if (dst_layer->is_background()) {
|
||||
if (dst_layer->isBackground()) {
|
||||
x1 = 0;
|
||||
y1 = 0;
|
||||
x2 = sprite->getWidth();
|
||||
@ -185,7 +185,7 @@ void MergeDownLayerCommand::onExecute(Context* context)
|
||||
}
|
||||
|
||||
sprite->setCurrentLayer(dst_layer);
|
||||
src_layer->get_parent()->removeLayer(src_layer);
|
||||
src_layer->getParent()->removeLayer(src_layer);
|
||||
|
||||
delete src_layer;
|
||||
|
||||
|
@ -129,7 +129,7 @@ void NewFileCommand::onExecute(Context* context)
|
||||
// Open the window
|
||||
window->openWindowInForeground();
|
||||
|
||||
if (window->get_killer() == ok) {
|
||||
if (window->getKiller() == ok) {
|
||||
bool ok = false;
|
||||
|
||||
// Get the options
|
||||
@ -180,7 +180,7 @@ void NewFileCommand::onExecute(Context* context)
|
||||
if (color.getType() != app::Color::MaskType) {
|
||||
Sprite* sprite = document->getSprite();
|
||||
|
||||
ASSERT(sprite->getCurrentLayer() && sprite->getCurrentLayer()->is_image());
|
||||
ASSERT(sprite->getCurrentLayer() && sprite->getCurrentLayer()->isImage());
|
||||
|
||||
static_cast<LayerImage*>(sprite->getCurrentLayer())->configureAsBackground();
|
||||
image_clear(sprite->getCurrentImage(), color_utils::color_for_image(color, format));
|
||||
|
@ -102,7 +102,7 @@ void NewLayerCommand::onExecute(Context* context)
|
||||
|
||||
window->openWindowInForeground();
|
||||
|
||||
if (window->get_killer() != window->findChild("ok"))
|
||||
if (window->getKiller() != window->findChild("ok"))
|
||||
return;
|
||||
|
||||
name = window->findChild("name")->getText();
|
||||
@ -135,9 +135,9 @@ static int get_max_layer_num(Layer* layer)
|
||||
if (strncmp(layer->getName().c_str(), "Layer ", 6) == 0)
|
||||
max = strtol(layer->getName().c_str()+6, NULL, 10);
|
||||
|
||||
if (layer->is_folder()) {
|
||||
LayerIterator it = static_cast<LayerFolder*>(layer)->get_layer_begin();
|
||||
LayerIterator end = static_cast<LayerFolder*>(layer)->get_layer_end();
|
||||
if (layer->isFolder()) {
|
||||
LayerIterator it = static_cast<LayerFolder*>(layer)->getLayerBegin();
|
||||
LayerIterator end = static_cast<LayerFolder*>(layer)->getLayerEnd();
|
||||
|
||||
for (; it != end; ++it) {
|
||||
int tmp = get_max_layer_num(*it);
|
||||
|
@ -67,7 +67,7 @@ void NewLayerSetCommand::onExecute(Context* context)
|
||||
|
||||
window->openWindowInForeground();
|
||||
|
||||
if (window->get_killer() == window->findChild("ok")) {
|
||||
if (window->getKiller() == window->findChild("ok")) {
|
||||
const char *name = window->findChild("name")->getText();
|
||||
Layer* layer = new LayerFolder(sprite);
|
||||
|
||||
|
@ -143,7 +143,7 @@ void OptionsCommand::onExecute(Context* context)
|
||||
// Show the window and wait the user to close it
|
||||
window->openWindowInForeground();
|
||||
|
||||
if (window->get_killer() == button_ok) {
|
||||
if (window->getKiller() == button_ok) {
|
||||
int undo_size_limit_value;
|
||||
|
||||
Editor::set_cursor_color(cursor_color->getColor());
|
||||
|
@ -213,7 +213,7 @@ void PaletteEditorCommand::onExecute(Context* context)
|
||||
if (m_switch || m_open) {
|
||||
if (!g_window->isVisible()) {
|
||||
// Default bounds
|
||||
g_window->remap_window();
|
||||
g_window->remapWindow();
|
||||
|
||||
int width = MAX(jrect_w(g_window->rc), JI_SCREEN_W/2);
|
||||
g_window->setBounds(Rect(JI_SCREEN_W - width - jrect_w(ToolBar::instance()->rc),
|
||||
@ -496,7 +496,7 @@ void PaletteEntryEditor::onMoreOptionsClick(Event& ev)
|
||||
{
|
||||
JRect rect = jrect_new(rc->x1, rc->y1,
|
||||
rc->x2, rc->y2 - reqSize.h);
|
||||
move_window(rect);
|
||||
moveWindow(rect);
|
||||
jrect_free(rect);
|
||||
}
|
||||
}
|
||||
@ -516,7 +516,7 @@ void PaletteEntryEditor::onMoreOptionsClick(Event& ev)
|
||||
if (rect->y2 > JI_SCREEN_H)
|
||||
jrect_displace(rect, 0, JI_SCREEN_H - rect->y2);
|
||||
|
||||
move_window(rect);
|
||||
moveWindow(rect);
|
||||
jrect_free(rect);
|
||||
}
|
||||
else
|
||||
|
@ -131,14 +131,14 @@ void SpritePropertiesCommand::onExecute(Context* context)
|
||||
}
|
||||
}
|
||||
|
||||
window->remap_window();
|
||||
window->center_window();
|
||||
window->remapWindow();
|
||||
window->centerWindow();
|
||||
|
||||
load_window_pos(window, "SpriteProperties");
|
||||
window->setVisible(true);
|
||||
window->openWindowInForeground();
|
||||
|
||||
if (window->get_killer() == ok) {
|
||||
if (window->getKiller() == ok) {
|
||||
if (color_button) {
|
||||
ActiveDocumentWriter document(context);
|
||||
Sprite* sprite(document->getSprite());
|
||||
|
@ -219,15 +219,15 @@ void SpriteSizeCommand::onExecute(Context* context)
|
||||
method->addItem("Bilinear");
|
||||
method->setSelectedItem(get_config_int("SpriteSize", "Method", RESIZE_METHOD_NEAREST_NEIGHBOR));
|
||||
|
||||
window->remap_window();
|
||||
window->center_window();
|
||||
window->remapWindow();
|
||||
window->centerWindow();
|
||||
|
||||
load_window_pos(window, "SpriteSize");
|
||||
window->setVisible(true);
|
||||
window->openWindowInForeground();
|
||||
save_window_pos(window, "SpriteSize");
|
||||
|
||||
if (window->get_killer() == ok) {
|
||||
if (window->getKiller() == ok) {
|
||||
int new_width = m_widthPx->getTextInt();
|
||||
int new_height = m_heightPx->getTextInt();
|
||||
ResizeMethod resize_method =
|
||||
|
@ -359,7 +359,7 @@ int ColorCurveEditor::editNodeManually(gfx::Point& point)
|
||||
|
||||
window->openWindowInForeground();
|
||||
|
||||
if (window->get_killer() == button_ok) {
|
||||
if (window->getKiller() == button_ok) {
|
||||
point.x = entry_x->getTextDouble();
|
||||
point.y = entry_y->getTextDouble();
|
||||
res = true;
|
||||
|
@ -96,7 +96,7 @@ void FilterManagerImpl::setTarget(int target)
|
||||
|
||||
/* the alpha channel of the background layer can't be modified */
|
||||
if (m_sprite->getCurrentLayer() &&
|
||||
m_sprite->getCurrentLayer()->is_background())
|
||||
m_sprite->getCurrentLayer()->isBackground())
|
||||
m_target &= ~TARGET_ALPHA_CHANNEL;
|
||||
}
|
||||
|
||||
@ -346,7 +346,7 @@ void FilterManagerImpl::init(const Layer* layer, Image* image, int offset_x, int
|
||||
m_target = m_targetOrig;
|
||||
|
||||
/* the alpha channel of the background layer can't be modified */
|
||||
if (layer->is_background())
|
||||
if (layer->isBackground())
|
||||
m_target &= ~TARGET_ALPHA_CHANNEL;
|
||||
}
|
||||
|
||||
|
@ -93,8 +93,8 @@ bool FilterWindow::doModal()
|
||||
bool result = false;
|
||||
|
||||
// Default position
|
||||
remap_window();
|
||||
center_window();
|
||||
remapWindow();
|
||||
centerWindow();
|
||||
|
||||
// Load window configuration
|
||||
load_window_pos(this, m_cfgSection);
|
||||
@ -106,7 +106,7 @@ bool FilterWindow::doModal()
|
||||
openWindowInForeground();
|
||||
|
||||
// Did the user press OK?
|
||||
if (get_killer() == &m_okButton) {
|
||||
if (getKiller() == &m_okButton) {
|
||||
m_preview.stop();
|
||||
|
||||
// Apply the filter in background
|
||||
|
@ -131,9 +131,9 @@ void Console::printf(const char *format, ...)
|
||||
|
||||
wid_view->setVisible(true);
|
||||
|
||||
wid_console->remap_window();
|
||||
wid_console->remapWindow();
|
||||
jwidget_set_rect(wid_console, rect);
|
||||
wid_console->center_window();
|
||||
wid_console->centerWindow();
|
||||
wid_console->invalidate();
|
||||
|
||||
jrect_free(rect);
|
||||
|
@ -58,16 +58,16 @@ void ContextFlags::update(Context* context)
|
||||
if (layer) {
|
||||
m_flags |= HasActiveLayer;
|
||||
|
||||
if (layer->is_background())
|
||||
if (layer->isBackground())
|
||||
m_flags |= ActiveLayerIsBackground;
|
||||
|
||||
if (layer->is_readable())
|
||||
if (layer->isReadable())
|
||||
m_flags |= ActiveLayerIsReadable;
|
||||
|
||||
if (layer->is_writable())
|
||||
if (layer->isWritable())
|
||||
m_flags |= ActiveLayerIsWritable;
|
||||
|
||||
if (layer->is_image()) {
|
||||
if (layer->isImage()) {
|
||||
m_flags |= ActiveLayerIsImage;
|
||||
|
||||
Cel* cel = static_cast<LayerImage*>(layer)->getCel(sprite->getCurrentFrame());
|
||||
|
@ -185,7 +185,7 @@ void switch_between_animation_and_sprite_editor()
|
||||
current_anieditor = anieditor;
|
||||
|
||||
window->addChild(anieditor);
|
||||
window->remap_window();
|
||||
window->remapWindow();
|
||||
|
||||
anieditor->centerCurrentCel();
|
||||
|
||||
@ -261,7 +261,7 @@ bool AnimationEditor::onProcessMessage(Message* msg)
|
||||
// Get the first CelIterator to be drawn (it is the first cel with cel->frame >= first_frame)
|
||||
CelIterator it, end;
|
||||
Layer* layerPtr = m_layers[layer];
|
||||
if (layerPtr->is_image()) {
|
||||
if (layerPtr->isImage()) {
|
||||
it = static_cast<LayerImage*>(layerPtr)->getCelBegin();
|
||||
end = static_cast<LayerImage*>(layerPtr)->getCelEnd();
|
||||
for (; it != end && (*it)->getFrame() < first_frame; ++it)
|
||||
@ -270,7 +270,7 @@ bool AnimationEditor::onProcessMessage(Message* msg)
|
||||
|
||||
// Draw every visible cel for each layer.
|
||||
for (frame=first_frame; frame<=last_frame; ++frame) {
|
||||
Cel* cel = (layerPtr->is_image() && it != end && (*it)->getFrame() == frame ? *it: NULL);
|
||||
Cel* cel = (layerPtr->isImage() && it != end && (*it)->getFrame() == frame ? *it: NULL);
|
||||
|
||||
drawCel(clip, layer, frame, cel);
|
||||
|
||||
@ -580,7 +580,7 @@ bool AnimationEditor::onProcessMessage(Message* msg)
|
||||
m_hot_layer < m_nlayers &&
|
||||
m_hot_layer != m_clk_layer &&
|
||||
m_hot_layer != m_clk_layer+1) {
|
||||
if (!m_layers[m_clk_layer]->is_background()) {
|
||||
if (!m_layers[m_clk_layer]->isBackground()) {
|
||||
// move the clicked-layer after the hot-layer
|
||||
try {
|
||||
const DocumentReader document(const_cast<Document*>(m_document));
|
||||
@ -615,7 +615,7 @@ bool AnimationEditor::onProcessMessage(Message* msg)
|
||||
m_hot_layer < m_nlayers) {
|
||||
Layer* layer = m_layers[m_clk_layer];
|
||||
ASSERT(layer != NULL);
|
||||
layer->set_readable(!layer->is_readable());
|
||||
layer->setReadable(!layer->isReadable());
|
||||
}
|
||||
break;
|
||||
case A_PART_LAYER_LOCK_ICON:
|
||||
@ -625,7 +625,7 @@ bool AnimationEditor::onProcessMessage(Message* msg)
|
||||
m_hot_layer < m_nlayers) {
|
||||
Layer* layer = m_layers[m_clk_layer];
|
||||
ASSERT(layer != NULL);
|
||||
layer->set_writable(!layer->is_writable());
|
||||
layer->setWritable(!layer->isWritable());
|
||||
}
|
||||
break;
|
||||
case A_PART_CEL: {
|
||||
@ -834,7 +834,7 @@ void AnimationEditor::setCursor(int x, int y)
|
||||
m_clk_part == A_PART_LAYER &&
|
||||
m_hot_part == A_PART_LAYER &&
|
||||
m_clk_layer != m_hot_layer) {
|
||||
if (m_layers[m_clk_layer]->is_background())
|
||||
if (m_layers[m_clk_layer]->isBackground())
|
||||
jmouse_set_cursor(kForbiddenCursor);
|
||||
else
|
||||
jmouse_set_cursor(kMoveCursor);
|
||||
@ -1019,10 +1019,10 @@ void AnimationEditor::drawLayer(JRect clip, int layer_index)
|
||||
(is_clk ? ThemeColor::Selected:
|
||||
ThemeColor::Face)));
|
||||
ui::Color fg = theme->getColor(selected_layer ? ThemeColor::Background: ThemeColor::Text);
|
||||
BITMAP* icon1 = theme->get_part(layer->is_readable() ? PART_LAYER_VISIBLE: PART_LAYER_HIDDEN);
|
||||
BITMAP* icon2 = theme->get_part(layer->is_writable() ? PART_LAYER_EDITABLE: PART_LAYER_LOCKED);
|
||||
BITMAP* icon1_selected = theme->get_part(layer->is_readable() ? PART_LAYER_VISIBLE_SELECTED: PART_LAYER_HIDDEN_SELECTED);
|
||||
BITMAP* icon2_selected = theme->get_part(layer->is_writable() ? PART_LAYER_EDITABLE_SELECTED: PART_LAYER_LOCKED_SELECTED);
|
||||
BITMAP* icon1 = theme->get_part(layer->isReadable() ? PART_LAYER_VISIBLE: PART_LAYER_HIDDEN);
|
||||
BITMAP* icon2 = theme->get_part(layer->isWritable() ? PART_LAYER_EDITABLE: PART_LAYER_LOCKED);
|
||||
BITMAP* icon1_selected = theme->get_part(layer->isReadable() ? PART_LAYER_VISIBLE_SELECTED: PART_LAYER_HIDDEN_SELECTED);
|
||||
BITMAP* icon2_selected = theme->get_part(layer->isWritable() ? PART_LAYER_EDITABLE_SELECTED: PART_LAYER_LOCKED_SELECTED);
|
||||
int x1, y1, x2, y2, y_mid;
|
||||
int cx1, cy1, cx2, cy2;
|
||||
int u;
|
||||
@ -1092,7 +1092,7 @@ void AnimationEditor::drawLayer(JRect clip, int layer_index)
|
||||
fg, bg, true, jguiscale());
|
||||
|
||||
// The background should be underlined.
|
||||
if (layer->is_background()) {
|
||||
if (layer->isBackground()) {
|
||||
hline(ji_screen,
|
||||
u,
|
||||
y_mid - ji_font_get_size(this->getFont())/2 + ji_font_get_size(this->getFont()) + 1,
|
||||
@ -1249,7 +1249,7 @@ bool AnimationEditor::drawPart(int part, int layer, FrameNumber frame)
|
||||
case A_PART_CEL:
|
||||
if (layer >= 0 && layer < m_nlayers &&
|
||||
frame >= 0 && frame < m_sprite->getTotalFrames()) {
|
||||
Cel* cel = (m_layers[layer]->is_image() ? static_cast<LayerImage*>(m_layers[layer])->getCel(frame): NULL);
|
||||
Cel* cel = (m_layers[layer]->isImage() ? static_cast<LayerImage*>(m_layers[layer])->getCel(frame): NULL);
|
||||
|
||||
drawCel(this->rc, layer, frame, cel);
|
||||
return true;
|
||||
|
@ -125,8 +125,8 @@ void dialogs_mask_color(Document* document)
|
||||
box4->addChild(button_cancel);
|
||||
|
||||
// Default position
|
||||
window->remap_window();
|
||||
window->center_window();
|
||||
window->remapWindow();
|
||||
window->centerWindow();
|
||||
|
||||
// Mask first preview
|
||||
mask_preview(documentReader);
|
||||
@ -137,7 +137,7 @@ void dialogs_mask_color(Document* document)
|
||||
// Open the window
|
||||
window->openWindowInForeground();
|
||||
|
||||
if (window->get_killer() == button_ok) {
|
||||
if (window->getKiller() == button_ok) {
|
||||
DocumentWriter documentWriter(documentReader);
|
||||
UndoTransaction undo(document, "Mask by Color", undo::DoesntModifyDocument);
|
||||
|
||||
|
@ -332,7 +332,7 @@ void Document::copyLayerContent(const Layer* sourceLayer0, Document* destDoc, La
|
||||
// Copy the layer name
|
||||
destLayer0->setName(sourceLayer0->getName());
|
||||
|
||||
if (sourceLayer0->is_image() && destLayer0->is_image()) {
|
||||
if (sourceLayer0->isImage() && destLayer0->isImage()) {
|
||||
const LayerImage* sourceLayer = static_cast<const LayerImage*>(sourceLayer0);
|
||||
LayerImage* destLayer = static_cast<LayerImage*>(destLayer0);
|
||||
|
||||
@ -363,22 +363,22 @@ void Document::copyLayerContent(const Layer* sourceLayer0, Document* destDoc, La
|
||||
newCel.release();
|
||||
}
|
||||
}
|
||||
else if (sourceLayer0->is_folder() && destLayer0->is_folder()) {
|
||||
else if (sourceLayer0->isFolder() && destLayer0->isFolder()) {
|
||||
const LayerFolder* sourceLayer = static_cast<const LayerFolder*>(sourceLayer0);
|
||||
LayerFolder* destLayer = static_cast<LayerFolder*>(destLayer0);
|
||||
|
||||
LayerConstIterator it = sourceLayer->get_layer_begin();
|
||||
LayerConstIterator end = sourceLayer->get_layer_end();
|
||||
LayerConstIterator it = sourceLayer->getLayerBegin();
|
||||
LayerConstIterator end = sourceLayer->getLayerEnd();
|
||||
|
||||
for (; it != end; ++it) {
|
||||
Layer* sourceChild = *it;
|
||||
UniquePtr<Layer> destChild(NULL);
|
||||
|
||||
if (sourceChild->is_image()) {
|
||||
if (sourceChild->isImage()) {
|
||||
destChild.reset(new LayerImage(destLayer->getSprite()));
|
||||
copyLayerContent(sourceChild, destDoc, destChild);
|
||||
}
|
||||
else if (sourceChild->is_folder()) {
|
||||
else if (sourceChild->isFolder()) {
|
||||
destChild.reset(new LayerFolder(destLayer->getSprite()));
|
||||
copyLayerContent(sourceChild, destDoc, destChild);
|
||||
}
|
||||
|
@ -310,8 +310,8 @@ bool AseFormat::onSave(FileOp *fop)
|
||||
|
||||
/* write extra chunks in the first frame */
|
||||
if (frame == 0) {
|
||||
LayerIterator it = sprite->getFolder()->get_layer_begin();
|
||||
LayerIterator end = sprite->getFolder()->get_layer_end();
|
||||
LayerIterator it = sprite->getFolder()->getLayerBegin();
|
||||
LayerIterator end = sprite->getFolder()->getLayerEnd();
|
||||
|
||||
/* write layer chunks */
|
||||
for (; it != end; ++it)
|
||||
@ -467,9 +467,9 @@ static void ase_file_write_layers(FILE *f, Layer *layer)
|
||||
{
|
||||
ase_file_write_layer_chunk(f, layer);
|
||||
|
||||
if (layer->is_folder()) {
|
||||
LayerIterator it = static_cast<LayerFolder*>(layer)->get_layer_begin();
|
||||
LayerIterator end = static_cast<LayerFolder*>(layer)->get_layer_end();
|
||||
if (layer->isFolder()) {
|
||||
LayerIterator it = static_cast<LayerFolder*>(layer)->getLayerBegin();
|
||||
LayerIterator end = static_cast<LayerFolder*>(layer)->getLayerEnd();
|
||||
|
||||
for (; it != end; ++it)
|
||||
ase_file_write_layers(f, *it);
|
||||
@ -478,7 +478,7 @@ static void ase_file_write_layers(FILE *f, Layer *layer)
|
||||
|
||||
static void ase_file_write_cels(FILE *f, Sprite *sprite, Layer *layer, FrameNumber frame)
|
||||
{
|
||||
if (layer->is_image()) {
|
||||
if (layer->isImage()) {
|
||||
Cel* cel = static_cast<LayerImage*>(layer)->getCel(frame);
|
||||
if (cel) {
|
||||
/* fop_error(fop, "New cel in frame %d, in layer %d\n", */
|
||||
@ -488,9 +488,9 @@ static void ase_file_write_cels(FILE *f, Sprite *sprite, Layer *layer, FrameNumb
|
||||
}
|
||||
}
|
||||
|
||||
if (layer->is_folder()) {
|
||||
LayerIterator it = static_cast<LayerFolder*>(layer)->get_layer_begin();
|
||||
LayerIterator end = static_cast<LayerFolder*>(layer)->get_layer_end();
|
||||
if (layer->isFolder()) {
|
||||
LayerIterator it = static_cast<LayerFolder*>(layer)->getLayerBegin();
|
||||
LayerIterator end = static_cast<LayerFolder*>(layer)->getLayerEnd();
|
||||
|
||||
for (; it != end; ++it)
|
||||
ase_file_write_cels(f, sprite, *it, frame);
|
||||
@ -667,11 +667,11 @@ static Layer *ase_file_read_layer_chunk(FILE *f, Sprite *sprite, Layer **previou
|
||||
|
||||
// child level...
|
||||
if (child_level == *current_level)
|
||||
(*previous_layer)->get_parent()->addLayer(layer);
|
||||
(*previous_layer)->getParent()->addLayer(layer);
|
||||
else if (child_level > *current_level)
|
||||
static_cast<LayerFolder*>(*previous_layer)->addLayer(layer);
|
||||
else if (child_level < *current_level)
|
||||
(*previous_layer)->get_parent()->get_parent()->addLayer(layer);
|
||||
(*previous_layer)->getParent()->getParent()->addLayer(layer);
|
||||
|
||||
*previous_layer = layer;
|
||||
*current_level = child_level;
|
||||
@ -688,21 +688,21 @@ static void ase_file_write_layer_chunk(FILE *f, Layer *layer)
|
||||
fputw(layer->getFlags(), f);
|
||||
|
||||
/* layer type */
|
||||
fputw(layer->is_image() ? 0: (layer->is_folder() ? 1: -1), f);
|
||||
fputw(layer->isImage() ? 0: (layer->isFolder() ? 1: -1), f);
|
||||
|
||||
/* layer child level */
|
||||
LayerFolder* parent = layer->get_parent();
|
||||
LayerFolder* parent = layer->getParent();
|
||||
int child_level = -1;
|
||||
while (parent != NULL) {
|
||||
child_level++;
|
||||
parent = parent->get_parent();
|
||||
parent = parent->getParent();
|
||||
}
|
||||
fputw(child_level, f);
|
||||
|
||||
/* default width & height, and blend mode */
|
||||
fputw(0, f);
|
||||
fputw(0, f);
|
||||
fputw(layer->is_image() ? static_cast<LayerImage*>(layer)->getBlendMode(): 0, f);
|
||||
fputw(layer->isImage() ? static_cast<LayerImage*>(layer)->getBlendMode(): 0, f);
|
||||
|
||||
/* padding */
|
||||
ase_file_write_padding(f, 4);
|
||||
@ -999,7 +999,7 @@ static Cel *ase_file_read_cel_chunk(FILE *f, Sprite *sprite, FrameNumber frame,
|
||||
(int)frame, layer_index);
|
||||
return NULL;
|
||||
}
|
||||
if (!layer->is_image()) {
|
||||
if (!layer->isImage()) {
|
||||
fop_error(fop, "Invalid .ase file (frame %d in layer %d which does not contain images\n",
|
||||
(int)frame, layer_index);
|
||||
return NULL;
|
||||
|
@ -295,7 +295,7 @@ FileOp* fop_to_save_document(Document* document)
|
||||
}
|
||||
|
||||
// layers support
|
||||
if (fop->document->getSprite()->getFolder()->get_layers_count() > 1) {
|
||||
if (fop->document->getSprite()->getFolder()->getLayersCount() > 1) {
|
||||
if (!(fop->format->support(FILE_SUPPORT_LAYERS))) {
|
||||
usprintf(buf+ustrlen(buf), "<<- Layers");
|
||||
}
|
||||
@ -650,8 +650,8 @@ void fop_post_load(FileOp* fop)
|
||||
|
||||
if (fop->document->getSprite() != NULL) {
|
||||
// Select the last layer
|
||||
if (fop->document->getSprite()->getFolder()->get_layers_count() > 0) {
|
||||
LayerIterator last_layer = --fop->document->getSprite()->getFolder()->get_layer_end();
|
||||
if (fop->document->getSprite()->getFolder()->getLayersCount() > 0) {
|
||||
LayerIterator last_layer = --fop->document->getSprite()->getFolder()->getLayerEnd();
|
||||
fop->document->getSprite()->setCurrentLayer(*last_layer);
|
||||
}
|
||||
|
||||
|
@ -374,7 +374,7 @@ SharedPtr<FormatOptions> JpegFormat::onGetFormatOptions(FileOp* fop)
|
||||
|
||||
window->openWindowInForeground();
|
||||
|
||||
if (window->get_killer() == ok) {
|
||||
if (window->getKiller() == ok) {
|
||||
jpeg_options->quality = slider_quality->getValue() / 10.0f;
|
||||
set_config_float("JPEG", "Quality", jpeg_options->quality);
|
||||
}
|
||||
|
@ -66,7 +66,7 @@ LayerImage* create_flatten_layer_copy(Sprite* dstSprite, const Layer* srcLayer,
|
||||
// in the given "frame".
|
||||
static bool has_cels(const Layer* layer, FrameNumber frame)
|
||||
{
|
||||
if (!layer->is_readable())
|
||||
if (!layer->isReadable())
|
||||
return false;
|
||||
|
||||
switch (layer->getType()) {
|
||||
@ -75,8 +75,8 @@ static bool has_cels(const Layer* layer, FrameNumber frame)
|
||||
return static_cast<const LayerImage*>(layer)->getCel(frame) ? true: false;
|
||||
|
||||
case GFXOBJ_LAYER_FOLDER: {
|
||||
LayerConstIterator it = static_cast<const LayerFolder*>(layer)->get_layer_begin();
|
||||
LayerConstIterator end = static_cast<const LayerFolder*>(layer)->get_layer_end();
|
||||
LayerConstIterator it = static_cast<const LayerFolder*>(layer)->getLayerBegin();
|
||||
LayerConstIterator end = static_cast<const LayerFolder*>(layer)->getLayerEnd();
|
||||
|
||||
for (; it != end; ++it) {
|
||||
if (has_cels(*it, frame))
|
||||
|
@ -79,7 +79,7 @@ bool GfxMode::setGfxMode() const
|
||||
// Redraw top window
|
||||
MainWindow* mainWindow = App::instance()->getMainWindow();
|
||||
if (mainWindow) {
|
||||
mainWindow->remap_window();
|
||||
mainWindow->remapWindow();
|
||||
ui::Manager::getDefault()->invalidate();
|
||||
}
|
||||
|
||||
|
@ -45,7 +45,7 @@
|
||||
using namespace ui;
|
||||
|
||||
#define FIXUP_TOP_WINDOW() \
|
||||
App::instance()->getMainWindow()->remap_window(); \
|
||||
App::instance()->getMainWindow()->remapWindow(); \
|
||||
App::instance()->getMainWindow()->invalidate();
|
||||
|
||||
class EditorItem
|
||||
@ -181,8 +181,8 @@ public:
|
||||
// Create mini-editor
|
||||
MiniEditorWindow() : Window(false, "Mini-Editor") {
|
||||
child_spacing = 0;
|
||||
set_autoremap(false);
|
||||
set_wantfocus(false);
|
||||
setAutoRemap(false);
|
||||
setWantFocus(false);
|
||||
}
|
||||
|
||||
protected:
|
||||
|
@ -323,7 +323,7 @@ void gui_feedback()
|
||||
if (!manager->getDisplay()->flip()) {
|
||||
// In case that the display was resized.
|
||||
gui_setup_screen(false);
|
||||
App::instance()->getMainWindow()->remap_window();
|
||||
App::instance()->getMainWindow()->remapWindow();
|
||||
manager->invalidate();
|
||||
}
|
||||
else
|
||||
@ -768,7 +768,7 @@ bool CustomizedGuiManager::onProcessMessage(Message* msg)
|
||||
// If there is a foreground window as top level...
|
||||
if (toplevel_window &&
|
||||
toplevel_window != App::instance()->getMainWindow() &&
|
||||
toplevel_window->is_foreground()) {
|
||||
toplevel_window->isForeground()) {
|
||||
// We just do not process keyboard shortcuts for menus and tools
|
||||
break;
|
||||
}
|
||||
@ -835,11 +835,11 @@ bool CustomizedGuiManager::onProcessMessage(Message* msg)
|
||||
Window* child = static_cast<Window*>(*it);
|
||||
|
||||
// There are a foreground window executing?
|
||||
if (child->is_foreground()) {
|
||||
if (child->isForeground()) {
|
||||
break;
|
||||
}
|
||||
// Is it the desktop and the top-window=
|
||||
else if (child->is_desktop() && child == App::instance()->getMainWindow()) {
|
||||
else if (child->isDesktop() && child == App::instance()->getMainWindow()) {
|
||||
// OK, so we can execute the command represented
|
||||
// by the pressed-key in the message...
|
||||
UIContext::instance()->executeCommand(command, shortcut->params);
|
||||
|
@ -40,10 +40,10 @@ void ImagesCollector::collectFromLayer(Layer* layer)
|
||||
{
|
||||
const Sprite* sprite = layer->getSprite();
|
||||
|
||||
if (!layer->is_readable())
|
||||
if (!layer->isReadable())
|
||||
return;
|
||||
|
||||
if (m_forWrite && !layer->is_writable())
|
||||
if (m_forWrite && !layer->isWritable())
|
||||
return;
|
||||
|
||||
switch (layer->getType()) {
|
||||
@ -66,8 +66,8 @@ void ImagesCollector::collectFromLayer(Layer* layer)
|
||||
}
|
||||
|
||||
case GFXOBJ_LAYER_FOLDER: {
|
||||
LayerIterator it = static_cast<LayerFolder*>(layer)->get_layer_begin();
|
||||
LayerIterator end = static_cast<LayerFolder*>(layer)->get_layer_end();
|
||||
LayerIterator it = static_cast<LayerFolder*>(layer)->getLayerBegin();
|
||||
LayerIterator end = static_cast<LayerFolder*>(layer)->getLayerEnd();
|
||||
|
||||
for (; it != end; ++it)
|
||||
collectFromLayer(*it);
|
||||
|
@ -55,18 +55,15 @@ int Layer::getMemSize() const
|
||||
return sizeof(Layer);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the previous layer of "layer" that are in the parent set.
|
||||
*/
|
||||
Layer* Layer::get_prev() const
|
||||
Layer* Layer::getPrevious() const
|
||||
{
|
||||
if (m_parent != NULL) {
|
||||
LayerConstIterator it =
|
||||
std::find(m_parent->get_layer_begin(),
|
||||
m_parent->get_layer_end(), this);
|
||||
std::find(m_parent->getLayerBegin(),
|
||||
m_parent->getLayerEnd(), this);
|
||||
|
||||
if (it != m_parent->get_layer_end() &&
|
||||
it != m_parent->get_layer_begin()) {
|
||||
if (it != m_parent->getLayerEnd() &&
|
||||
it != m_parent->getLayerBegin()) {
|
||||
it--;
|
||||
return *it;
|
||||
}
|
||||
@ -74,16 +71,16 @@ Layer* Layer::get_prev() const
|
||||
return NULL;
|
||||
}
|
||||
|
||||
Layer* Layer::get_next() const
|
||||
Layer* Layer::getNext() const
|
||||
{
|
||||
if (m_parent != NULL) {
|
||||
LayerConstIterator it =
|
||||
std::find(m_parent->get_layer_begin(),
|
||||
m_parent->get_layer_end(), this);
|
||||
std::find(m_parent->getLayerBegin(),
|
||||
m_parent->getLayerEnd(), this);
|
||||
|
||||
if (it != m_parent->get_layer_end()) {
|
||||
if (it != m_parent->getLayerEnd()) {
|
||||
it++;
|
||||
if (it != m_parent->get_layer_end())
|
||||
if (it != m_parent->getLayerEnd())
|
||||
return *it;
|
||||
}
|
||||
}
|
||||
@ -206,8 +203,8 @@ void LayerImage::configureAsBackground()
|
||||
ASSERT(getSprite() != NULL);
|
||||
ASSERT(getSprite()->getBackgroundLayer() == NULL);
|
||||
|
||||
set_moveable(false);
|
||||
set_background(true);
|
||||
setMoveable(false);
|
||||
setBackground(true);
|
||||
setName("Background");
|
||||
|
||||
getSprite()->getFolder()->stackLayer(this, NULL);
|
||||
@ -229,8 +226,8 @@ LayerFolder::~LayerFolder()
|
||||
|
||||
void LayerFolder::destroyAllLayers()
|
||||
{
|
||||
LayerIterator it = get_layer_begin();
|
||||
LayerIterator end = get_layer_end();
|
||||
LayerIterator it = getLayerBegin();
|
||||
LayerIterator end = getLayerEnd();
|
||||
|
||||
for (; it != end; ++it) {
|
||||
Layer* layer = *it;
|
||||
@ -242,8 +239,8 @@ void LayerFolder::destroyAllLayers()
|
||||
int LayerFolder::getMemSize() const
|
||||
{
|
||||
int size = sizeof(LayerFolder);
|
||||
LayerConstIterator it = get_layer_begin();
|
||||
LayerConstIterator end = get_layer_end();
|
||||
LayerConstIterator it = getLayerBegin();
|
||||
LayerConstIterator end = getLayerEnd();
|
||||
|
||||
for (; it != end; ++it) {
|
||||
const Layer* layer = *it;
|
||||
@ -255,8 +252,8 @@ int LayerFolder::getMemSize() const
|
||||
|
||||
void LayerFolder::getCels(CelList& cels)
|
||||
{
|
||||
LayerIterator it = get_layer_begin();
|
||||
LayerIterator end = get_layer_end();
|
||||
LayerIterator it = getLayerBegin();
|
||||
LayerIterator end = getLayerEnd();
|
||||
|
||||
for (; it != end; ++it)
|
||||
(*it)->getCels(cels);
|
||||
@ -265,7 +262,7 @@ void LayerFolder::getCels(CelList& cels)
|
||||
void LayerFolder::addLayer(Layer* layer)
|
||||
{
|
||||
m_layers.push_back(layer);
|
||||
layer->set_parent(this);
|
||||
layer->setParent(this);
|
||||
}
|
||||
|
||||
void LayerFolder::removeLayer(Layer* layer)
|
||||
@ -274,7 +271,7 @@ void LayerFolder::removeLayer(Layer* layer)
|
||||
ASSERT(it != m_layers.end());
|
||||
m_layers.erase(it);
|
||||
|
||||
layer->set_parent(NULL);
|
||||
layer->setParent(NULL);
|
||||
}
|
||||
|
||||
void LayerFolder::stackLayer(Layer* layer, Layer* after)
|
||||
@ -303,7 +300,7 @@ void LayerFolder::stackLayer(Layer* layer, Layer* after)
|
||||
|
||||
void layer_render(const Layer* layer, Image* image, int x, int y, FrameNumber frame)
|
||||
{
|
||||
if (!layer->is_readable())
|
||||
if (!layer->isReadable())
|
||||
return;
|
||||
|
||||
switch (layer->getType()) {
|
||||
@ -331,8 +328,8 @@ void layer_render(const Layer* layer, Image* image, int x, int y, FrameNumber fr
|
||||
}
|
||||
|
||||
case GFXOBJ_LAYER_FOLDER: {
|
||||
LayerConstIterator it = static_cast<const LayerFolder*>(layer)->get_layer_begin();
|
||||
LayerConstIterator end = static_cast<const LayerFolder*>(layer)->get_layer_end();
|
||||
LayerConstIterator it = static_cast<const LayerFolder*>(layer)->getLayerBegin();
|
||||
LayerConstIterator end = static_cast<const LayerFolder*>(layer)->getLayerEnd();
|
||||
|
||||
for (; it != end; ++it)
|
||||
layer_render(*it, image, x, y, frame);
|
||||
|
@ -56,22 +56,24 @@ public:
|
||||
void setName(const std::string& name) { m_name = name; }
|
||||
|
||||
Sprite* getSprite() const { return m_sprite; }
|
||||
LayerFolder* get_parent() const { return m_parent; }
|
||||
void set_parent(LayerFolder* folder) { m_parent = folder; }
|
||||
Layer* get_prev() const;
|
||||
Layer* get_next() const;
|
||||
LayerFolder* getParent() const { return m_parent; }
|
||||
void setParent(LayerFolder* folder) { m_parent = folder; }
|
||||
|
||||
bool is_image() const { return getType() == GFXOBJ_LAYER_IMAGE; }
|
||||
bool is_folder() const { return getType() == GFXOBJ_LAYER_FOLDER; }
|
||||
bool is_background() const { return (m_flags & LAYER_IS_BACKGROUND) == LAYER_IS_BACKGROUND; }
|
||||
bool is_moveable() const { return (m_flags & LAYER_IS_LOCKMOVE) == 0; }
|
||||
bool is_readable() const { return (m_flags & LAYER_IS_READABLE) == LAYER_IS_READABLE; }
|
||||
bool is_writable() const { return (m_flags & LAYER_IS_WRITABLE) == LAYER_IS_WRITABLE; }
|
||||
// Gets the previous sibling of this layer.
|
||||
Layer* getPrevious() const;
|
||||
Layer* getNext() const;
|
||||
|
||||
void set_background(bool b) { if (b) m_flags |= LAYER_IS_BACKGROUND; else m_flags &= ~LAYER_IS_BACKGROUND; }
|
||||
void set_moveable(bool b) { if (b) m_flags &= ~LAYER_IS_LOCKMOVE; else m_flags |= LAYER_IS_LOCKMOVE; }
|
||||
void set_readable(bool b) { if (b) m_flags |= LAYER_IS_READABLE; else m_flags &= ~LAYER_IS_READABLE; }
|
||||
void set_writable(bool b) { if (b) m_flags |= LAYER_IS_WRITABLE; else m_flags &= ~LAYER_IS_WRITABLE; }
|
||||
bool isImage() const { return getType() == GFXOBJ_LAYER_IMAGE; }
|
||||
bool isFolder() const { return getType() == GFXOBJ_LAYER_FOLDER; }
|
||||
bool isBackground() const { return (m_flags & LAYER_IS_BACKGROUND) == LAYER_IS_BACKGROUND; }
|
||||
bool isMoveable() const { return (m_flags & LAYER_IS_LOCKMOVE) == 0; }
|
||||
bool isReadable() const { return (m_flags & LAYER_IS_READABLE) == LAYER_IS_READABLE; }
|
||||
bool isWritable() const { return (m_flags & LAYER_IS_WRITABLE) == LAYER_IS_WRITABLE; }
|
||||
|
||||
void setBackground(bool b) { if (b) m_flags |= LAYER_IS_BACKGROUND; else m_flags &= ~LAYER_IS_BACKGROUND; }
|
||||
void setMoveable(bool b) { if (b) m_flags &= ~LAYER_IS_LOCKMOVE; else m_flags |= LAYER_IS_LOCKMOVE; }
|
||||
void setReadable(bool b) { if (b) m_flags |= LAYER_IS_READABLE; else m_flags &= ~LAYER_IS_READABLE; }
|
||||
void setWritable(bool b) { if (b) m_flags |= LAYER_IS_WRITABLE; else m_flags &= ~LAYER_IS_WRITABLE; }
|
||||
|
||||
uint32_t getFlags() const { return m_flags; }
|
||||
void setFlags(uint32_t flags) { m_flags = flags; }
|
||||
@ -133,12 +135,12 @@ public:
|
||||
|
||||
int getMemSize() const;
|
||||
|
||||
const LayerList& get_layers_list() { return m_layers; }
|
||||
LayerIterator get_layer_begin() { return m_layers.begin(); }
|
||||
LayerIterator get_layer_end() { return m_layers.end(); }
|
||||
LayerConstIterator get_layer_begin() const { return m_layers.begin(); }
|
||||
LayerConstIterator get_layer_end() const { return m_layers.end(); }
|
||||
int get_layers_count() const { return m_layers.size(); }
|
||||
const LayerList& getLayersList() { return m_layers; }
|
||||
LayerIterator getLayerBegin() { return m_layers.begin(); }
|
||||
LayerIterator getLayerEnd() { return m_layers.end(); }
|
||||
LayerConstIterator getLayerBegin() const { return m_layers.begin(); }
|
||||
LayerConstIterator getLayerEnd() const { return m_layers.end(); }
|
||||
int getLayersCount() const { return m_layers.size(); }
|
||||
|
||||
void addLayer(Layer* layer);
|
||||
void removeLayer(Layer* layer);
|
||||
|
@ -70,11 +70,11 @@ void write_layer(std::ostream& os, LayerSubObjectsSerializer* subObjects, Layer*
|
||||
}
|
||||
|
||||
case GFXOBJ_LAYER_FOLDER: {
|
||||
LayerIterator it = static_cast<LayerFolder*>(layer)->get_layer_begin();
|
||||
LayerIterator end = static_cast<LayerFolder*>(layer)->get_layer_end();
|
||||
LayerIterator it = static_cast<LayerFolder*>(layer)->getLayerBegin();
|
||||
LayerIterator end = static_cast<LayerFolder*>(layer)->getLayerEnd();
|
||||
|
||||
// Number of sub-layers
|
||||
write16(os, static_cast<LayerFolder*>(layer)->get_layers_count());
|
||||
write16(os, static_cast<LayerFolder*>(layer)->getLayersCount());
|
||||
|
||||
for (; it != end; ++it)
|
||||
subObjects->write_layer(os, *it);
|
||||
|
@ -156,11 +156,11 @@ LayerFolder* Sprite::getFolder() const
|
||||
|
||||
LayerImage* Sprite::getBackgroundLayer() const
|
||||
{
|
||||
if (getFolder()->get_layers_count() > 0) {
|
||||
Layer* bglayer = *getFolder()->get_layer_begin();
|
||||
if (getFolder()->getLayersCount() > 0) {
|
||||
Layer* bglayer = *getFolder()->getLayerBegin();
|
||||
|
||||
if (bglayer->is_background()) {
|
||||
ASSERT(bglayer->is_image());
|
||||
if (bglayer->isBackground()) {
|
||||
ASSERT(bglayer->isImage());
|
||||
return static_cast<LayerImage*>(bglayer);
|
||||
}
|
||||
}
|
||||
@ -179,7 +179,7 @@ void Sprite::setCurrentLayer(Layer* layer)
|
||||
|
||||
LayerIndex Sprite::countLayers() const
|
||||
{
|
||||
return LayerIndex(getFolder()->get_layers_count());
|
||||
return LayerIndex(getFolder()->getLayersCount());
|
||||
}
|
||||
|
||||
Layer* Sprite::indexToLayer(LayerIndex index) const
|
||||
@ -366,7 +366,7 @@ Image* Sprite::getCurrentImage(int* x, int* y, int* opacity) const
|
||||
Image* image = NULL;
|
||||
|
||||
if (getCurrentLayer() != NULL &&
|
||||
getCurrentLayer()->is_image()) {
|
||||
getCurrentLayer()->isImage()) {
|
||||
const Cel* cel = static_cast<const LayerImage*>(getCurrentLayer())->getCel(getCurrentFrame());
|
||||
if (cel) {
|
||||
ASSERT((cel->getImage() >= 0) &&
|
||||
@ -448,11 +448,11 @@ static Layer* index2layer(const Layer* layer, const LayerIndex& index, int* inde
|
||||
else {
|
||||
(*index_count)++;
|
||||
|
||||
if (layer->is_folder()) {
|
||||
if (layer->isFolder()) {
|
||||
Layer *found;
|
||||
|
||||
LayerConstIterator it = static_cast<const LayerFolder*>(layer)->get_layer_begin();
|
||||
LayerConstIterator end = static_cast<const LayerFolder*>(layer)->get_layer_end();
|
||||
LayerConstIterator it = static_cast<const LayerFolder*>(layer)->getLayerBegin();
|
||||
LayerConstIterator end = static_cast<const LayerFolder*>(layer)->getLayerEnd();
|
||||
|
||||
for (; it != end; ++it) {
|
||||
if ((found = index2layer(*it, index, index_count)))
|
||||
@ -471,11 +471,11 @@ static LayerIndex layer2index(const Layer* layer, const Layer* find_layer, int*
|
||||
else {
|
||||
(*index_count)++;
|
||||
|
||||
if (layer->is_folder()) {
|
||||
if (layer->isFolder()) {
|
||||
int found;
|
||||
|
||||
LayerConstIterator it = static_cast<const LayerFolder*>(layer)->get_layer_begin();
|
||||
LayerConstIterator end = static_cast<const LayerFolder*>(layer)->get_layer_end();
|
||||
LayerConstIterator it = static_cast<const LayerFolder*>(layer)->getLayerBegin();
|
||||
LayerConstIterator end = static_cast<const LayerFolder*>(layer)->getLayerEnd();
|
||||
|
||||
for (; it != end; ++it) {
|
||||
if ((found = layer2index(*it, find_layer, index_count)) >= 0)
|
||||
|
@ -755,7 +755,7 @@ void SkinTheme::initWidget(Widget* widget)
|
||||
break;
|
||||
|
||||
case JI_WINDOW:
|
||||
if (!static_cast<Window*>(widget)->is_desktop()) {
|
||||
if (!static_cast<Window*>(widget)->isDesktop()) {
|
||||
if (widget->hasText()) {
|
||||
BORDER4(6 * scale, (4+6) * scale, 6 * scale, 6 * scale);
|
||||
widget->border_width.t += jwidget_get_text_height(widget);
|
||||
@ -1626,7 +1626,7 @@ void SkinTheme::paintWindow(PaintEvent& ev)
|
||||
JRect pos = jwidget_get_rect(window);
|
||||
JRect cpos = jwidget_get_child_rect(window);
|
||||
|
||||
if (!window->is_desktop()) {
|
||||
if (!window->isDesktop()) {
|
||||
// window frame
|
||||
if (window->hasText()) {
|
||||
draw_bounds_nw(ji_screen,
|
||||
|
@ -88,7 +88,7 @@ int Alert::show(const char* format, ...)
|
||||
|
||||
// Check the killer
|
||||
int ret = 0;
|
||||
if (Widget* killer = window->get_killer()) {
|
||||
if (Widget* killer = window->getKiller()) {
|
||||
for (int i=0; i<(int)buttons.size(); ++i) {
|
||||
if (killer == buttons[i]) {
|
||||
ret = i+1;
|
||||
|
@ -303,7 +303,7 @@ bool ComboBox::onProcessMessage(Message* msg)
|
||||
case JM_WINMOVE:
|
||||
if (m_window) {
|
||||
JRect rc = getListBoxPos();
|
||||
m_window->move_window(rc);
|
||||
m_window->moveWindow(rc);
|
||||
jrect_free(rc);
|
||||
}
|
||||
break;
|
||||
@ -449,7 +449,7 @@ void ComboBox::openListBox()
|
||||
m_listbox->addChild(new ListBox::Item(item->text.c_str()));
|
||||
}
|
||||
|
||||
m_window->set_ontop(true);
|
||||
m_window->setOnTop(true);
|
||||
jwidget_noborders(m_window);
|
||||
|
||||
Widget* viewport = view->getViewport();
|
||||
@ -466,10 +466,10 @@ void ComboBox::openListBox()
|
||||
|
||||
m_listbox->selectIndex(m_selected);
|
||||
|
||||
m_window->remap_window();
|
||||
m_window->remapWindow();
|
||||
|
||||
JRect rc = getListBoxPos();
|
||||
m_window->position_window(rc->x1, rc->y1);
|
||||
m_window->positionWindow(rc->x1, rc->y1);
|
||||
jrect_free(rc);
|
||||
|
||||
getManager()->addMessageFilter(JM_BUTTONPRESSED, this);
|
||||
|
@ -63,7 +63,7 @@ void _ji_reinit_theme_in_all_widgets()
|
||||
for (std::list<Widget*>::iterator it=widgets->begin(), end=widgets->end();
|
||||
it != end; ++it) {
|
||||
if ((*it)->type == JI_WINDOW)
|
||||
static_cast<Window*>(*it)->remap_window();
|
||||
static_cast<Window*>(*it)->remapWindow();
|
||||
}
|
||||
|
||||
// Redraw the whole screen
|
||||
|
@ -355,22 +355,22 @@ bool Manager::generateMessages()
|
||||
|
||||
if ((window) &&
|
||||
// We cannot change Z-order of desktop windows
|
||||
(!window->is_desktop()) &&
|
||||
(!window->isDesktop()) &&
|
||||
// We cannot change Z order of foreground windows because a
|
||||
// foreground window can launch other background windows
|
||||
// which should be kept on top of the foreground one.
|
||||
(!window->is_foreground()) &&
|
||||
(!window->isForeground()) &&
|
||||
// If the window is not already the top window of the manager.
|
||||
(window != win_manager->getTopWindow())) {
|
||||
// Put it in the top of the list
|
||||
win_manager->removeChild(window);
|
||||
|
||||
if (window->is_ontop())
|
||||
if (window->isOnTop())
|
||||
win_manager->insertChild(0, window);
|
||||
else {
|
||||
int pos = (int)win_manager->getChildren().size();
|
||||
UI_FOREACH_WIDGET_BACKWARD(win_manager->getChildren(), it) {
|
||||
if (static_cast<Window*>(*it)->is_ontop())
|
||||
if (static_cast<Window*>(*it)->isOnTop())
|
||||
break;
|
||||
|
||||
--pos;
|
||||
@ -509,8 +509,8 @@ Window* Manager::getForegroundWindow()
|
||||
{
|
||||
UI_FOREACH_WIDGET(getChildren(), it) {
|
||||
Window* window = static_cast<Window*>(*it);
|
||||
if (window->is_foreground() ||
|
||||
window->is_desktop())
|
||||
if (window->isForeground() ||
|
||||
window->isDesktop())
|
||||
return window;
|
||||
}
|
||||
return NULL;
|
||||
@ -803,7 +803,7 @@ void Manager::removeMessageFilterFor(Widget* widget)
|
||||
void Manager::_openWindow(Window* window)
|
||||
{
|
||||
// Free all widgets of special states.
|
||||
if (window->is_wantfocus()) {
|
||||
if (window->isWantFocus()) {
|
||||
freeCapture();
|
||||
freeMouse();
|
||||
freeFocus();
|
||||
@ -833,7 +833,7 @@ void Manager::_closeWindow(Window* window, bool redraw_background)
|
||||
window->getRegion(reg1);
|
||||
|
||||
// Close all windows to this desktop
|
||||
if (window->is_desktop()) {
|
||||
if (window->isDesktop()) {
|
||||
while (!getChildren().empty()) {
|
||||
Window* child = static_cast<Window*>(getChildren().front());
|
||||
if (child == window)
|
||||
@ -902,8 +902,8 @@ bool Manager::onProcessMessage(Message* msg)
|
||||
if ((*it2)->sendMessage(msg))
|
||||
return true;
|
||||
|
||||
if (w->is_foreground() ||
|
||||
w->is_desktop())
|
||||
if (w->isForeground() ||
|
||||
w->isDesktop())
|
||||
break;
|
||||
}
|
||||
|
||||
@ -1125,7 +1125,7 @@ void Manager::invalidateDisplayRegion(const gfx::Region& region)
|
||||
window->invalidateRegion(reg1);
|
||||
|
||||
// There is desktop?
|
||||
if (window->is_desktop()) {
|
||||
if (window->isDesktop()) {
|
||||
withDesktop = true;
|
||||
break; // Work done
|
||||
}
|
||||
|
@ -78,9 +78,9 @@ public:
|
||||
CustomizedWindowForMenuBox(MenuBox* menubox)
|
||||
: Window(false, NULL)
|
||||
{
|
||||
set_moveable(false); // Can't move the window
|
||||
setMoveable(false); // Can't move the window
|
||||
addChild(menubox);
|
||||
remap_window();
|
||||
remapWindow();
|
||||
}
|
||||
|
||||
protected:
|
||||
@ -266,17 +266,17 @@ void Menu::showPopup(int x, int y)
|
||||
base->is_filtering = true;
|
||||
Manager::getDefault()->addMessageFilter(JM_BUTTONPRESSED, menubox);
|
||||
|
||||
window->set_moveable(false); // Can't move the window
|
||||
window->setMoveable(false); // Can't move the window
|
||||
|
||||
// Set children
|
||||
menubox->setMenu(this);
|
||||
window->addChild(menubox);
|
||||
|
||||
window->remap_window();
|
||||
window->remapWindow();
|
||||
|
||||
// Menubox position
|
||||
window->position_window(MID(0, x, JI_SCREEN_W-jrect_w(window->rc)),
|
||||
MID(0, y, JI_SCREEN_H-jrect_h(window->rc)));
|
||||
window->positionWindow(MID(0, x, JI_SCREEN_W-jrect_w(window->rc)),
|
||||
MID(0, y, JI_SCREEN_H-jrect_h(window->rc)));
|
||||
|
||||
// Set the focus to the new menubox
|
||||
Manager::getDefault()->setFocus(menubox);
|
||||
@ -771,7 +771,7 @@ bool MenuItem::onProcessMessage(Message* msg)
|
||||
jrect_moveto(pos, x, y);
|
||||
}
|
||||
|
||||
window->position_window(pos->x1, pos->y1);
|
||||
window->positionWindow(pos->x1, pos->y1);
|
||||
jrect_free(pos);
|
||||
|
||||
// Set the focus to the new menubox
|
||||
|
@ -25,9 +25,9 @@ PopupWindow::PopupWindow(const char* text, bool close_on_buttonpressed)
|
||||
m_close_on_buttonpressed = close_on_buttonpressed;
|
||||
m_filtering = false;
|
||||
|
||||
set_sizeable(false);
|
||||
set_moveable(false);
|
||||
set_wantfocus(false);
|
||||
setSizeable(false);
|
||||
setMoveable(false);
|
||||
setWantFocus(false);
|
||||
setAlign(JI_LEFT | JI_TOP);
|
||||
|
||||
removeDecorativeWidgets();
|
||||
@ -55,13 +55,13 @@ void PopupWindow::setHotRegion(const gfx::Region& region)
|
||||
void PopupWindow::makeFloating()
|
||||
{
|
||||
stopFilteringMessages();
|
||||
set_moveable(true);
|
||||
setMoveable(true);
|
||||
}
|
||||
|
||||
void PopupWindow::makeFixed()
|
||||
{
|
||||
startFilteringMessages();
|
||||
set_moveable(false);
|
||||
setMoveable(false);
|
||||
}
|
||||
|
||||
bool PopupWindow::onProcessMessage(Message* msg)
|
||||
@ -73,7 +73,7 @@ bool PopupWindow::onProcessMessage(Message* msg)
|
||||
break;
|
||||
|
||||
case JM_MOUSELEAVE:
|
||||
if (m_hotRegion.isEmpty() && !is_moveable())
|
||||
if (m_hotRegion.isEmpty() && !isMoveable())
|
||||
closeWindow(NULL);
|
||||
break;
|
||||
|
||||
@ -109,7 +109,7 @@ bool PopupWindow::onProcessMessage(Message* msg)
|
||||
break;
|
||||
|
||||
case JM_MOTION:
|
||||
if (!is_moveable() &&
|
||||
if (!isMoveable() &&
|
||||
!m_hotRegion.isEmpty() &&
|
||||
getManager()->getCapture() == NULL) {
|
||||
// If the mouse is outside the hot-region we have to close the
|
||||
|
@ -95,7 +95,7 @@ void TooltipManager::onTick()
|
||||
int w, h;
|
||||
|
||||
m_tipWindow->setArrowAlign(m_target.tipInfo.arrowAlign);
|
||||
m_tipWindow->remap_window();
|
||||
m_tipWindow->remapWindow();
|
||||
|
||||
w = jrect_w(m_tipWindow->rc);
|
||||
h = jrect_h(m_tipWindow->rc);
|
||||
@ -140,8 +140,8 @@ void TooltipManager::onTick()
|
||||
// y = jmouse_y(0);
|
||||
// }
|
||||
|
||||
m_tipWindow->position_window(MID(0, x, JI_SCREEN_W-w),
|
||||
MID(0, y, JI_SCREEN_H-h));
|
||||
m_tipWindow->positionWindow(MID(0, x, JI_SCREEN_W-w),
|
||||
MID(0, y, JI_SCREEN_H-h));
|
||||
m_tipWindow->openWindow();
|
||||
}
|
||||
m_timer->stop();
|
||||
@ -156,9 +156,9 @@ TipWindow::TipWindow(const char *text, bool close_on_buttonpressed)
|
||||
m_filtering = false;
|
||||
m_arrowAlign = 0;
|
||||
|
||||
set_sizeable(false);
|
||||
set_moveable(false);
|
||||
set_wantfocus(false);
|
||||
setSizeable(false);
|
||||
setMoveable(false);
|
||||
setWantFocus(false);
|
||||
setAlign(JI_LEFT | JI_TOP);
|
||||
|
||||
removeDecorativeWidgets();
|
||||
|
@ -37,13 +37,13 @@ Window::Window(bool desktop, const char* text)
|
||||
: Widget(JI_WINDOW)
|
||||
{
|
||||
m_killer = NULL;
|
||||
m_is_desktop = desktop;
|
||||
m_is_moveable = !desktop;
|
||||
m_is_sizeable = !desktop;
|
||||
m_is_ontop = false;
|
||||
m_is_wantfocus = true;
|
||||
m_is_foreground = false;
|
||||
m_is_autoremap = true;
|
||||
m_isDesktop = desktop;
|
||||
m_isMoveable = !desktop;
|
||||
m_isSizeable = !desktop;
|
||||
m_isOnTop = false;
|
||||
m_isWantFocus = true;
|
||||
m_isForeground = false;
|
||||
m_isAutoRemap = true;
|
||||
|
||||
setVisible(false);
|
||||
setText(text);
|
||||
@ -57,34 +57,34 @@ Window::~Window()
|
||||
getManager()->_closeWindow(this, false);
|
||||
}
|
||||
|
||||
Widget* Window::get_killer()
|
||||
Widget* Window::getKiller()
|
||||
{
|
||||
return m_killer;
|
||||
}
|
||||
|
||||
void Window::set_autoremap(bool state)
|
||||
void Window::setAutoRemap(bool state)
|
||||
{
|
||||
m_is_autoremap = state;
|
||||
m_isAutoRemap = state;
|
||||
}
|
||||
|
||||
void Window::set_moveable(bool state)
|
||||
void Window::setMoveable(bool state)
|
||||
{
|
||||
m_is_moveable = state;
|
||||
m_isMoveable = state;
|
||||
}
|
||||
|
||||
void Window::set_sizeable(bool state)
|
||||
void Window::setSizeable(bool state)
|
||||
{
|
||||
m_is_sizeable = state;
|
||||
m_isSizeable = state;
|
||||
}
|
||||
|
||||
void Window::set_ontop(bool state)
|
||||
void Window::setOnTop(bool state)
|
||||
{
|
||||
m_is_ontop = state;
|
||||
m_isOnTop = state;
|
||||
}
|
||||
|
||||
void Window::set_wantfocus(bool state)
|
||||
void Window::setWantFocus(bool state)
|
||||
{
|
||||
m_is_wantfocus = state;
|
||||
m_isWantFocus = state;
|
||||
}
|
||||
|
||||
HitTest Window::hitTest(const gfx::Point& point)
|
||||
@ -110,7 +110,7 @@ void Window::onHitTest(HitTestEvent& ev)
|
||||
{
|
||||
HitTest ht = HitTestNowhere;
|
||||
|
||||
if (!m_is_moveable) {
|
||||
if (!m_isMoveable) {
|
||||
ev.setHit(ht);
|
||||
return;
|
||||
}
|
||||
@ -129,7 +129,7 @@ void Window::onHitTest(HitTestEvent& ev)
|
||||
ht = HitTestCaption;
|
||||
}
|
||||
// Resize
|
||||
else if (m_is_sizeable) {
|
||||
else if (m_isSizeable) {
|
||||
if ((x >= pos->x1) && (x < cpos->x1)) {
|
||||
if ((y >= pos->y1) && (y < cpos->y1))
|
||||
ht = HitTestBorderNW;
|
||||
@ -174,13 +174,13 @@ void Window::onHitTest(HitTestEvent& ev)
|
||||
ev.setHit(ht);
|
||||
}
|
||||
|
||||
void Window::remap_window()
|
||||
void Window::remapWindow()
|
||||
{
|
||||
Size reqSize;
|
||||
JRect rect;
|
||||
|
||||
if (m_is_autoremap) {
|
||||
m_is_autoremap = false;
|
||||
if (m_isAutoRemap) {
|
||||
m_isAutoRemap = false;
|
||||
this->setVisible(true);
|
||||
}
|
||||
|
||||
@ -198,23 +198,23 @@ void Window::remap_window()
|
||||
invalidate();
|
||||
}
|
||||
|
||||
void Window::center_window()
|
||||
void Window::centerWindow()
|
||||
{
|
||||
Widget* manager = getManager();
|
||||
|
||||
if (m_is_autoremap)
|
||||
this->remap_window();
|
||||
if (m_isAutoRemap)
|
||||
this->remapWindow();
|
||||
|
||||
position_window(jrect_w(manager->rc)/2 - jrect_w(this->rc)/2,
|
||||
jrect_h(manager->rc)/2 - jrect_h(this->rc)/2);
|
||||
positionWindow(jrect_w(manager->rc)/2 - jrect_w(this->rc)/2,
|
||||
jrect_h(manager->rc)/2 - jrect_h(this->rc)/2);
|
||||
}
|
||||
|
||||
void Window::position_window(int x, int y)
|
||||
void Window::positionWindow(int x, int y)
|
||||
{
|
||||
JRect rect;
|
||||
|
||||
if (m_is_autoremap)
|
||||
remap_window();
|
||||
if (m_isAutoRemap)
|
||||
remapWindow();
|
||||
|
||||
rect = jrect_new(x, y, x+jrect_w(this->rc), y+jrect_h(this->rc));
|
||||
jwidget_set_rect(this, rect);
|
||||
@ -223,16 +223,16 @@ void Window::position_window(int x, int y)
|
||||
invalidate();
|
||||
}
|
||||
|
||||
void Window::move_window(JRect rect)
|
||||
void Window::moveWindow(JRect rect)
|
||||
{
|
||||
move_window(rect, true);
|
||||
moveWindow(rect, true);
|
||||
}
|
||||
|
||||
void Window::openWindow()
|
||||
{
|
||||
if (!getParent()) {
|
||||
if (m_is_autoremap)
|
||||
center_window();
|
||||
if (m_isAutoRemap)
|
||||
centerWindow();
|
||||
|
||||
Manager::getDefault()->_openWindow(this);
|
||||
}
|
||||
@ -244,12 +244,12 @@ void Window::openWindowInForeground()
|
||||
|
||||
MessageLoop loop(getManager());
|
||||
|
||||
m_is_foreground = true;
|
||||
m_isForeground = true;
|
||||
|
||||
while (!(this->flags & JI_HIDDEN))
|
||||
loop.pumpMessages();
|
||||
|
||||
m_is_foreground = false;
|
||||
m_isForeground = false;
|
||||
}
|
||||
|
||||
void Window::closeWindow(Widget* killer)
|
||||
@ -263,7 +263,7 @@ void Window::closeWindow(Widget* killer)
|
||||
onClose(ev);
|
||||
}
|
||||
|
||||
bool Window::is_toplevel()
|
||||
bool Window::isTopLevel()
|
||||
{
|
||||
Widget* manager = getManager();
|
||||
if (!manager->getChildren().empty())
|
||||
@ -277,7 +277,7 @@ bool Window::onProcessMessage(Message* msg)
|
||||
switch (msg->type) {
|
||||
|
||||
case JM_SETPOS:
|
||||
this->window_set_position(&msg->setpos.rect);
|
||||
windowSetPosition(&msg->setpos.rect);
|
||||
return true;
|
||||
|
||||
case JM_OPEN:
|
||||
@ -289,7 +289,7 @@ bool Window::onProcessMessage(Message* msg)
|
||||
break;
|
||||
|
||||
case JM_BUTTONPRESSED: {
|
||||
if (!m_is_moveable)
|
||||
if (!m_isMoveable)
|
||||
break;
|
||||
|
||||
press_x = msg->mouse.x;
|
||||
@ -326,7 +326,7 @@ bool Window::onProcessMessage(Message* msg)
|
||||
break;
|
||||
|
||||
case JM_MOTION:
|
||||
if (!m_is_moveable)
|
||||
if (!m_isMoveable)
|
||||
break;
|
||||
|
||||
// Does it have the mouse captured?
|
||||
@ -338,7 +338,7 @@ bool Window::onProcessMessage(Message* msg)
|
||||
JRect rect = jrect_new(x, y,
|
||||
x+jrect_w(this->rc),
|
||||
y+jrect_h(this->rc));
|
||||
this->move_window(rect, true);
|
||||
moveWindow(rect, true);
|
||||
jrect_free(rect);
|
||||
}
|
||||
else {
|
||||
@ -374,7 +374,7 @@ bool Window::onProcessMessage(Message* msg)
|
||||
h += (msg->mouse.y - press_y);
|
||||
}
|
||||
|
||||
this->limit_size(&w, &h);
|
||||
limitSize(&w, &h);
|
||||
|
||||
if ((jrect_w(this->rc) != w) ||
|
||||
(jrect_h(this->rc) != h)) {
|
||||
@ -390,7 +390,7 @@ bool Window::onProcessMessage(Message* msg)
|
||||
|
||||
{
|
||||
JRect rect = jrect_new(x, y, x+w, y+h);
|
||||
this->move_window(rect, false);
|
||||
moveWindow(rect, false);
|
||||
jrect_free(rect);
|
||||
|
||||
invalidate();
|
||||
@ -401,7 +401,7 @@ bool Window::onProcessMessage(Message* msg)
|
||||
break;
|
||||
|
||||
case JM_SETCURSOR:
|
||||
if (m_is_moveable) {
|
||||
if (m_isMoveable) {
|
||||
HitTest ht = hitTest(gfx::Point(msg->mouse.x, msg->mouse.y));
|
||||
CursorType cursor = kArrowCursor;
|
||||
|
||||
@ -459,7 +459,7 @@ void Window::onPreferredSize(PreferredSizeEvent& ev)
|
||||
{
|
||||
Widget* manager = getManager();
|
||||
|
||||
if (m_is_desktop) {
|
||||
if (m_isDesktop) {
|
||||
Rect cpos = manager->getChildrenBounds();
|
||||
ev.setPreferredSize(cpos.w, cpos.h);
|
||||
}
|
||||
@ -497,7 +497,7 @@ void Window::onBroadcastMouseMessage(WidgetsList& targets)
|
||||
|
||||
// Continue sending the message to siblings windows until a desktop
|
||||
// or foreground window.
|
||||
if (is_foreground() || is_desktop())
|
||||
if (isForeground() || isDesktop())
|
||||
return;
|
||||
|
||||
Widget* sibling = getNextSibling();
|
||||
@ -511,7 +511,7 @@ void Window::onSetText()
|
||||
initTheme();
|
||||
}
|
||||
|
||||
void Window::window_set_position(JRect rect)
|
||||
void Window::windowSetPosition(JRect rect)
|
||||
{
|
||||
// Copy the new position rectangle
|
||||
jrect_copy(this->rc, rect);
|
||||
@ -528,13 +528,13 @@ void Window::window_set_position(JRect rect)
|
||||
}
|
||||
}
|
||||
|
||||
void Window::limit_size(int *w, int *h)
|
||||
void Window::limitSize(int *w, int *h)
|
||||
{
|
||||
*w = MAX(*w, this->border_width.l+this->border_width.r);
|
||||
*h = MAX(*h, this->border_width.t+this->border_width.b);
|
||||
}
|
||||
|
||||
void Window::move_window(JRect rect, bool use_blit)
|
||||
void Window::moveWindow(JRect rect, bool use_blit)
|
||||
{
|
||||
#define FLAGS (DrawableRegionFlags)(kCutTopWindows | kUseChildArea)
|
||||
|
||||
@ -568,7 +568,7 @@ void Window::move_window(JRect rect, bool use_blit)
|
||||
jrect_h(old_pos) != jrect_h(rect)) {
|
||||
// We have to change the whole positions sending JM_SETPOS
|
||||
// messages...
|
||||
window_set_position(rect);
|
||||
windowSetPosition(rect);
|
||||
}
|
||||
else {
|
||||
// We can just displace all the widgets by a delta (new_position -
|
||||
|
@ -20,32 +20,32 @@ namespace ui {
|
||||
class Window : public Widget
|
||||
{
|
||||
public:
|
||||
Window(bool is_desktop, const char* text);
|
||||
Window(bool isDesktop, const char* text);
|
||||
~Window();
|
||||
|
||||
Widget* get_killer();
|
||||
Widget* getKiller();
|
||||
|
||||
void set_autoremap(bool state);
|
||||
void set_moveable(bool state);
|
||||
void set_sizeable(bool state);
|
||||
void set_ontop(bool state);
|
||||
void set_wantfocus(bool state);
|
||||
void setAutoRemap(bool state);
|
||||
void setMoveable(bool state);
|
||||
void setSizeable(bool state);
|
||||
void setOnTop(bool state);
|
||||
void setWantFocus(bool state);
|
||||
|
||||
void remap_window();
|
||||
void center_window();
|
||||
void position_window(int x, int y);
|
||||
void move_window(JRect rect);
|
||||
void remapWindow();
|
||||
void centerWindow();
|
||||
void positionWindow(int x, int y);
|
||||
void moveWindow(JRect rect);
|
||||
|
||||
void openWindow();
|
||||
void openWindowInForeground();
|
||||
void closeWindow(Widget* killer);
|
||||
|
||||
bool is_toplevel();
|
||||
bool is_foreground() const { return m_is_foreground; }
|
||||
bool is_desktop() const { return m_is_desktop; }
|
||||
bool is_ontop() const { return m_is_ontop; }
|
||||
bool is_wantfocus() const { return m_is_wantfocus; }
|
||||
bool is_moveable() const { return m_is_moveable; }
|
||||
bool isTopLevel();
|
||||
bool isForeground() const { return m_isForeground; }
|
||||
bool isDesktop() const { return m_isDesktop; }
|
||||
bool isOnTop() const { return m_isOnTop; }
|
||||
bool isWantFocus() const { return m_isWantFocus; }
|
||||
bool isMoveable() const { return m_isMoveable; }
|
||||
|
||||
HitTest hitTest(const gfx::Point& point);
|
||||
|
||||
@ -66,19 +66,19 @@ namespace ui {
|
||||
virtual void onHitTest(HitTestEvent& ev);
|
||||
|
||||
private:
|
||||
void window_set_position(JRect rect);
|
||||
int get_action(int x, int y);
|
||||
void limit_size(int* w, int* h);
|
||||
void move_window(JRect rect, bool use_blit);
|
||||
void windowSetPosition(JRect rect);
|
||||
int getAction(int x, int y);
|
||||
void limitSize(int* w, int* h);
|
||||
void moveWindow(JRect rect, bool use_blit);
|
||||
|
||||
Widget* m_killer;
|
||||
bool m_is_desktop : 1;
|
||||
bool m_is_moveable : 1;
|
||||
bool m_is_sizeable : 1;
|
||||
bool m_is_ontop : 1;
|
||||
bool m_is_wantfocus : 1;
|
||||
bool m_is_foreground : 1;
|
||||
bool m_is_autoremap : 1;
|
||||
bool m_isDesktop : 1;
|
||||
bool m_isMoveable : 1;
|
||||
bool m_isSizeable : 1;
|
||||
bool m_isOnTop : 1;
|
||||
bool m_isWantFocus : 1;
|
||||
bool m_isForeground : 1;
|
||||
bool m_isAutoRemap : 1;
|
||||
int m_hitTest;
|
||||
};
|
||||
|
||||
|
@ -409,7 +409,7 @@ void UndoTransaction::removeLayer(Layer* layer)
|
||||
DocumentEvent ev(m_document, m_sprite, layer);
|
||||
m_document->notifyObservers<DocumentEvent&>(&DocumentObserver::onRemoveLayer, ev);
|
||||
|
||||
LayerFolder* parent = layer->get_parent();
|
||||
LayerFolder* parent = layer->getParent();
|
||||
|
||||
// if the layer to be removed is the selected layer
|
||||
if (layer == m_sprite->getCurrentLayer()) {
|
||||
@ -417,10 +417,10 @@ void UndoTransaction::removeLayer(Layer* layer)
|
||||
|
||||
// select: previous layer, or next layer, or parent(if it is not the
|
||||
// main layer of sprite set)
|
||||
if (layer->get_prev())
|
||||
layer_select = layer->get_prev();
|
||||
else if (layer->get_next())
|
||||
layer_select = layer->get_next();
|
||||
if (layer->getPrevious())
|
||||
layer_select = layer->getPrevious();
|
||||
else if (layer->getNext())
|
||||
layer_select = layer->getNext();
|
||||
else if (parent != m_sprite->getFolder())
|
||||
layer_select = parent;
|
||||
|
||||
@ -444,7 +444,7 @@ void UndoTransaction::restackLayerAfter(Layer* layer, Layer* afterThis)
|
||||
if (isEnabled())
|
||||
m_undo->pushUndoer(new undoers::MoveLayer(m_undo->getObjects(), layer));
|
||||
|
||||
layer->get_parent()->stackLayer(layer, afterThis);
|
||||
layer->getParent()->stackLayer(layer, afterThis);
|
||||
|
||||
DocumentEvent ev(m_document, m_sprite, layer);
|
||||
m_document->notifyObservers<DocumentEvent&>(&DocumentObserver::onLayerRestacked, ev);
|
||||
@ -452,10 +452,10 @@ void UndoTransaction::restackLayerAfter(Layer* layer, Layer* afterThis)
|
||||
|
||||
void UndoTransaction::cropLayer(Layer* layer, int x, int y, int w, int h, int bgcolor)
|
||||
{
|
||||
if (!layer->is_image())
|
||||
if (!layer->isImage())
|
||||
return;
|
||||
|
||||
if (!layer->is_background())
|
||||
if (!layer->isBackground())
|
||||
bgcolor = 0;
|
||||
|
||||
CelIterator it = ((LayerImage*)layer)->getCelBegin();
|
||||
@ -482,8 +482,8 @@ void UndoTransaction::displaceLayers(Layer* layer, int dx, int dy)
|
||||
}
|
||||
|
||||
case GFXOBJ_LAYER_FOLDER: {
|
||||
LayerIterator it = ((LayerFolder*)layer)->get_layer_begin();
|
||||
LayerIterator end = ((LayerFolder*)layer)->get_layer_end();
|
||||
LayerIterator it = ((LayerFolder*)layer)->getLayerBegin();
|
||||
LayerIterator end = ((LayerFolder*)layer)->getLayerEnd();
|
||||
for (; it != end; ++it)
|
||||
displaceLayers(*it, dx, dy);
|
||||
break;
|
||||
@ -495,9 +495,9 @@ void UndoTransaction::displaceLayers(Layer* layer, int dx, int dy)
|
||||
void UndoTransaction::backgroundFromLayer(LayerImage* layer, int bgcolor)
|
||||
{
|
||||
ASSERT(layer);
|
||||
ASSERT(layer->is_image());
|
||||
ASSERT(layer->is_readable());
|
||||
ASSERT(layer->is_writable());
|
||||
ASSERT(layer->isImage());
|
||||
ASSERT(layer->isReadable());
|
||||
ASSERT(layer->isWritable());
|
||||
ASSERT(layer->getSprite() == m_sprite);
|
||||
ASSERT(m_sprite->getBackgroundLayer() == NULL);
|
||||
|
||||
@ -567,18 +567,18 @@ void UndoTransaction::layerFromBackground()
|
||||
{
|
||||
ASSERT(m_sprite->getBackgroundLayer() != NULL);
|
||||
ASSERT(m_sprite->getCurrentLayer() != NULL);
|
||||
ASSERT(m_sprite->getCurrentLayer()->is_image());
|
||||
ASSERT(m_sprite->getCurrentLayer()->is_readable());
|
||||
ASSERT(m_sprite->getCurrentLayer()->is_writable());
|
||||
ASSERT(m_sprite->getCurrentLayer()->is_background());
|
||||
ASSERT(m_sprite->getCurrentLayer()->isImage());
|
||||
ASSERT(m_sprite->getCurrentLayer()->isReadable());
|
||||
ASSERT(m_sprite->getCurrentLayer()->isWritable());
|
||||
ASSERT(m_sprite->getCurrentLayer()->isBackground());
|
||||
|
||||
if (isEnabled()) {
|
||||
m_undo->pushUndoer(new undoers::SetLayerFlags(m_undo->getObjects(), m_sprite->getCurrentLayer()));
|
||||
m_undo->pushUndoer(new undoers::SetLayerName(m_undo->getObjects(), m_sprite->getCurrentLayer()));
|
||||
}
|
||||
|
||||
m_sprite->getCurrentLayer()->set_background(false);
|
||||
m_sprite->getCurrentLayer()->set_moveable(true);
|
||||
m_sprite->getCurrentLayer()->setBackground(false);
|
||||
m_sprite->getCurrentLayer()->setMoveable(true);
|
||||
m_sprite->getCurrentLayer()->setName("Layer 0");
|
||||
}
|
||||
|
||||
@ -659,7 +659,7 @@ void UndoTransaction::flattenLayers(int bgcolor)
|
||||
}
|
||||
|
||||
// Remove old layers.
|
||||
LayerList layers = m_sprite->getFolder()->get_layers_list();
|
||||
LayerList layers = m_sprite->getFolder()->getLayersList();
|
||||
LayerIterator it = layers.begin();
|
||||
LayerIterator end = layers.end();
|
||||
|
||||
@ -727,8 +727,8 @@ void UndoTransaction::newFrameForLayer(Layer* layer, FrameNumber frame)
|
||||
break;
|
||||
|
||||
case GFXOBJ_LAYER_FOLDER: {
|
||||
LayerIterator it = static_cast<LayerFolder*>(layer)->get_layer_begin();
|
||||
LayerIterator end = static_cast<LayerFolder*>(layer)->get_layer_end();
|
||||
LayerIterator it = static_cast<LayerFolder*>(layer)->getLayerBegin();
|
||||
LayerIterator end = static_cast<LayerFolder*>(layer)->getLayerEnd();
|
||||
|
||||
for (; it != end; ++it)
|
||||
newFrameForLayer(*it, frame);
|
||||
@ -777,8 +777,8 @@ void UndoTransaction::removeFrameOfLayer(Layer* layer, FrameNumber frame)
|
||||
break;
|
||||
|
||||
case GFXOBJ_LAYER_FOLDER: {
|
||||
LayerIterator it = static_cast<LayerFolder*>(layer)->get_layer_begin();
|
||||
LayerIterator end = static_cast<LayerFolder*>(layer)->get_layer_end();
|
||||
LayerIterator it = static_cast<LayerFolder*>(layer)->getLayerBegin();
|
||||
LayerIterator end = static_cast<LayerFolder*>(layer)->getLayerEnd();
|
||||
|
||||
for (; it != end; ++it)
|
||||
removeFrameOfLayer(*it, frame);
|
||||
@ -992,8 +992,8 @@ void UndoTransaction::moveFrameBeforeLayer(Layer* layer, FrameNumber frame, Fram
|
||||
}
|
||||
|
||||
case GFXOBJ_LAYER_FOLDER: {
|
||||
LayerIterator it = static_cast<LayerFolder*>(layer)->get_layer_begin();
|
||||
LayerIterator end = static_cast<LayerFolder*>(layer)->get_layer_end();
|
||||
LayerIterator it = static_cast<LayerFolder*>(layer)->getLayerBegin();
|
||||
LayerIterator end = static_cast<LayerFolder*>(layer)->getLayerEnd();
|
||||
|
||||
for (; it != end; ++it)
|
||||
moveFrameBeforeLayer(*it, frame, beforeFrame);
|
||||
@ -1005,7 +1005,7 @@ void UndoTransaction::moveFrameBeforeLayer(Layer* layer, FrameNumber frame, Fram
|
||||
|
||||
Cel* UndoTransaction::getCurrentCel()
|
||||
{
|
||||
if (m_sprite->getCurrentLayer() && m_sprite->getCurrentLayer()->is_image())
|
||||
if (m_sprite->getCurrentLayer() && m_sprite->getCurrentLayer()->isImage())
|
||||
return static_cast<LayerImage*>(m_sprite->getCurrentLayer())->getCel(m_sprite->getCurrentFrame());
|
||||
else
|
||||
return NULL;
|
||||
@ -1051,7 +1051,7 @@ void UndoTransaction::clearMask(int bgcolor)
|
||||
// entire image in the cel.
|
||||
if (!m_document->isMaskVisible()) {
|
||||
// If the layer is the background then we clear the image.
|
||||
if (m_sprite->getCurrentLayer()->is_background()) {
|
||||
if (m_sprite->getCurrentLayer()->isBackground()) {
|
||||
if (isEnabled())
|
||||
m_undo->pushUndoer(new undoers::ImageArea(m_undo->getObjects(),
|
||||
image, 0, 0, image->w, image->h));
|
||||
@ -1139,9 +1139,9 @@ void UndoTransaction::pasteImage(const Image* src_image, int x, int y, int opaci
|
||||
const Layer* layer = m_sprite->getCurrentLayer();
|
||||
|
||||
ASSERT(layer);
|
||||
ASSERT(layer->is_image());
|
||||
ASSERT(layer->is_readable());
|
||||
ASSERT(layer->is_writable());
|
||||
ASSERT(layer->isImage());
|
||||
ASSERT(layer->isReadable());
|
||||
ASSERT(layer->isWritable());
|
||||
|
||||
Cel* cel = ((LayerImage*)layer)->getCel(m_sprite->getCurrentFrame());
|
||||
ASSERT(cel);
|
||||
|
@ -28,10 +28,10 @@ using namespace undo;
|
||||
using namespace undoers;
|
||||
|
||||
MoveLayer::MoveLayer(ObjectsContainer* objects, Layer* layer)
|
||||
: m_folderId(objects->addObject(layer->get_parent()))
|
||||
: m_folderId(objects->addObject(layer->getParent()))
|
||||
, m_layerId(objects->addObject(layer))
|
||||
{
|
||||
Layer* after = layer->get_prev();
|
||||
Layer* after = layer->getPrevious();
|
||||
|
||||
m_afterId = (after ? objects->addObject(after): 0);
|
||||
}
|
||||
|
@ -88,9 +88,9 @@ private:
|
||||
};
|
||||
|
||||
RemoveLayer::RemoveLayer(ObjectsContainer* objects, Layer* layer)
|
||||
: m_folderId(objects->addObject(layer->get_parent()))
|
||||
: m_folderId(objects->addObject(layer->getParent()))
|
||||
{
|
||||
Layer* after = layer->get_prev();
|
||||
Layer* after = layer->getPrevious();
|
||||
|
||||
m_afterId = (after ? objects->addObject(after): 0);
|
||||
|
||||
|
@ -71,7 +71,7 @@ void move_cel(DocumentWriter& document)
|
||||
ASSERT(src_frame >= 0 && src_frame < sprite->getTotalFrames());
|
||||
ASSERT(dst_frame >= 0 && dst_frame < sprite->getTotalFrames());
|
||||
|
||||
if (src_layer->is_background()) {
|
||||
if (src_layer->isBackground()) {
|
||||
copy_cel(document);
|
||||
return;
|
||||
}
|
||||
@ -90,7 +90,7 @@ void move_cel(DocumentWriter& document)
|
||||
|
||||
/* remove the 'dst_cel' (if it exists) because it must be
|
||||
replaced with 'src_cel' */
|
||||
if ((dst_cel != NULL) && (!dst_layer->is_background() || src_cel != NULL))
|
||||
if ((dst_cel != NULL) && (!dst_layer->isBackground() || src_cel != NULL))
|
||||
remove_cel(sprite, undo, static_cast<LayerImage*>(dst_layer), dst_cel);
|
||||
|
||||
/* move the cel in the same layer */
|
||||
@ -112,8 +112,8 @@ void move_cel(DocumentWriter& document)
|
||||
/* if we are moving a cel from a transparent layer to the
|
||||
background layer, we have to clear the background of the
|
||||
image */
|
||||
if (!src_layer->is_background() &&
|
||||
dst_layer->is_background()) {
|
||||
if (!src_layer->isBackground() &&
|
||||
dst_layer->isBackground()) {
|
||||
Image *src_image = sprite->getStock()->getImage(src_cel->getImage());
|
||||
Image *dst_image = image_crop(src_image,
|
||||
-src_cel->getX(),
|
||||
@ -174,7 +174,7 @@ void copy_cel(DocumentWriter& document)
|
||||
|
||||
/* remove the 'dst_cel' (if it exists) because it must be
|
||||
replaced with 'src_cel' */
|
||||
if ((dst_cel != NULL) && (!dst_layer->is_background() || src_cel != NULL))
|
||||
if ((dst_cel != NULL) && (!dst_layer->isBackground() || src_cel != NULL))
|
||||
remove_cel(sprite, undo, static_cast<LayerImage*>(dst_layer), dst_cel);
|
||||
|
||||
/* move the cel in the same layer */
|
||||
@ -189,8 +189,8 @@ void copy_cel(DocumentWriter& document)
|
||||
/* if we are moving a cel from a transparent layer to the
|
||||
background layer, we have to clear the background of the
|
||||
image */
|
||||
if (!src_layer->is_background() &&
|
||||
dst_layer->is_background()) {
|
||||
if (!src_layer->isBackground() &&
|
||||
dst_layer->isBackground()) {
|
||||
dst_image = image_crop(src_image,
|
||||
-src_cel->getX(),
|
||||
-src_cel->getY(),
|
||||
@ -239,7 +239,7 @@ static void remove_cel(Sprite* sprite, UndoTransaction& undo, LayerImage *layer,
|
||||
Cel *it;
|
||||
bool used;
|
||||
|
||||
if (sprite != NULL && layer->is_image() && cel != NULL) {
|
||||
if (sprite != NULL && layer->isImage() && cel != NULL) {
|
||||
/* find if the image that use the cel to remove, is used by
|
||||
another cels */
|
||||
used = false;
|
||||
|
@ -45,7 +45,7 @@ ExpandCelCanvas::ExpandCelCanvas(Document* document, Sprite* sprite, Layer* laye
|
||||
, m_committed(false)
|
||||
, m_undo(undo)
|
||||
{
|
||||
if (m_layer->is_image()) {
|
||||
if (m_layer->isImage()) {
|
||||
m_cel = static_cast<LayerImage*>(layer)->getCel(m_sprite->getCurrentFrame());
|
||||
if (m_cel)
|
||||
m_celImage = m_sprite->getStock()->getImage(m_cel->getImage());
|
||||
|
@ -375,7 +375,7 @@ Image* RenderEngine::renderSprite(const Document* document,
|
||||
{
|
||||
void (*zoomed_func)(Image*, const Image*, const Palette*, int, int, int, int, int);
|
||||
const LayerImage* background = sprite->getBackgroundLayer();
|
||||
bool need_checked_bg = (background != NULL ? !background->is_readable(): true);
|
||||
bool need_checked_bg = (background != NULL ? !background->isReadable(): true);
|
||||
uint32_t bg_color = 0;
|
||||
Image *image;
|
||||
|
||||
@ -559,14 +559,14 @@ void RenderEngine::renderLayer(const Document* document,
|
||||
bool render_transparent)
|
||||
{
|
||||
// we can't read from this layer
|
||||
if (!layer->is_readable())
|
||||
if (!layer->isReadable())
|
||||
return;
|
||||
|
||||
switch (layer->getType()) {
|
||||
|
||||
case GFXOBJ_LAYER_IMAGE: {
|
||||
if ((!render_background && layer->is_background()) ||
|
||||
(!render_transparent && !layer->is_background()))
|
||||
if ((!render_background && layer->isBackground()) ||
|
||||
(!render_transparent && !layer->isBackground()))
|
||||
break;
|
||||
|
||||
const Cel* cel = static_cast<const LayerImage*>(layer)->getCel(frame);
|
||||
@ -606,8 +606,8 @@ void RenderEngine::renderLayer(const Document* document,
|
||||
}
|
||||
|
||||
case GFXOBJ_LAYER_FOLDER: {
|
||||
LayerConstIterator it = static_cast<const LayerFolder*>(layer)->get_layer_begin();
|
||||
LayerConstIterator end = static_cast<const LayerFolder*>(layer)->get_layer_end();
|
||||
LayerConstIterator it = static_cast<const LayerFolder*>(layer)->getLayerBegin();
|
||||
LayerConstIterator end = static_cast<const LayerFolder*>(layer)->getLayerEnd();
|
||||
|
||||
for (; it != end; ++it) {
|
||||
renderLayer(document, sprite, *it, image,
|
||||
|
@ -88,7 +88,7 @@ BITMAP* generate_thumbnail(const Layer* layer, const Cel* cel, const Sprite *spr
|
||||
|
||||
thumbnail_render(bmp,
|
||||
sprite->getStock()->getImage(cel->getImage()),
|
||||
!layer->is_background(),
|
||||
!layer->isBackground(),
|
||||
sprite->getPalette(cel->getFrame()));
|
||||
|
||||
thumbnail = new Thumbnail(cel, bmp);
|
||||
|
@ -224,7 +224,7 @@ void ColorButton::onClick(Event& ev)
|
||||
// Open it
|
||||
openSelectorDialog();
|
||||
}
|
||||
else if (!m_window->is_moveable()) {
|
||||
else if (!m_window->isMoveable()) {
|
||||
// If it is visible, close it
|
||||
closeSelectorDialog();
|
||||
}
|
||||
@ -249,7 +249,7 @@ void ColorButton::openSelectorDialog()
|
||||
else
|
||||
y = MAX(0, this->rc->y1-jrect_h(m_window->rc));
|
||||
|
||||
m_window->position_window(x, y);
|
||||
m_window->positionWindow(x, y);
|
||||
|
||||
m_window->getManager()->dispatchMessages();
|
||||
m_window->layout();
|
||||
|
@ -265,7 +265,7 @@ void Editor::editor_draw_cursor(int x, int y, bool refresh)
|
||||
// or when the FG color is mask and we are not in the background layer
|
||||
(UIContext::instance()->getSettings()->getFgColor().getType() == app::Color::MaskType &&
|
||||
(m_sprite->getCurrentLayer() != NULL &&
|
||||
!m_sprite->getCurrentLayer()->is_background()))) {
|
||||
!m_sprite->getCurrentLayer()->isBackground()))) {
|
||||
cursor_type = CURSOR_BOUNDS;
|
||||
}
|
||||
else {
|
||||
|
@ -1103,9 +1103,9 @@ bool Editor::canDraw()
|
||||
return
|
||||
(m_sprite != NULL &&
|
||||
m_sprite->getCurrentLayer() != NULL &&
|
||||
m_sprite->getCurrentLayer()->is_image() &&
|
||||
m_sprite->getCurrentLayer()->is_readable() &&
|
||||
m_sprite->getCurrentLayer()->is_writable() /* && */
|
||||
m_sprite->getCurrentLayer()->isImage() &&
|
||||
m_sprite->getCurrentLayer()->isReadable() &&
|
||||
m_sprite->getCurrentLayer()->isWritable() /* && */
|
||||
/* layer_get_cel(m_sprite->layer, m_sprite->frame) != NULL */
|
||||
);
|
||||
}
|
||||
|
@ -38,7 +38,7 @@ MovingCelState::MovingCelState(Editor* editor, Message* msg)
|
||||
Document* document = editor->getDocument();
|
||||
Sprite* sprite = editor->getSprite();
|
||||
|
||||
ASSERT(sprite->getCurrentLayer()->is_image());
|
||||
ASSERT(sprite->getCurrentLayer()->isImage());
|
||||
|
||||
LayerImage* layer = static_cast<LayerImage*>(sprite->getCurrentLayer());
|
||||
|
||||
|
@ -159,12 +159,12 @@ bool StandbyState::onMouseDown(Editor* editor, Message* msg)
|
||||
if ((sprite->getCurrentLayer()) &&
|
||||
(sprite->getCurrentLayer()->getType() == GFXOBJ_LAYER_IMAGE)) {
|
||||
// TODO you can move the `Background' with tiled mode
|
||||
if (sprite->getCurrentLayer()->is_background()) {
|
||||
if (sprite->getCurrentLayer()->isBackground()) {
|
||||
Alert::show(PACKAGE
|
||||
"<<You can't move the `Background' layer."
|
||||
"||&Close");
|
||||
}
|
||||
else if (!sprite->getCurrentLayer()->is_moveable()) {
|
||||
else if (!sprite->getCurrentLayer()->isMoveable()) {
|
||||
Alert::show(PACKAGE "<<The layer movement is locked.||&Close");
|
||||
}
|
||||
else {
|
||||
@ -189,7 +189,7 @@ bool StandbyState::onMouseDown(Editor* editor, Message* msg)
|
||||
int x, y, opacity;
|
||||
Image* image = sprite->getCurrentImage(&x, &y, &opacity);
|
||||
if (image) {
|
||||
if (!sprite->getCurrentLayer()->is_writable()) {
|
||||
if (!sprite->getCurrentLayer()->isWritable()) {
|
||||
Alert::show(PACKAGE "<<The layer is locked.||&Close");
|
||||
return true;
|
||||
}
|
||||
@ -208,7 +208,7 @@ bool StandbyState::onMouseDown(Editor* editor, Message* msg)
|
||||
int x, y, opacity;
|
||||
Image* image = sprite->getCurrentImage(&x, &y, &opacity);
|
||||
if (image) {
|
||||
if (!sprite->getCurrentLayer()->is_writable()) {
|
||||
if (!sprite->getCurrentLayer()->isWritable()) {
|
||||
Alert::show(PACKAGE "<<The layer is locked.||&Close");
|
||||
return true;
|
||||
}
|
||||
|
@ -258,7 +258,7 @@ tools::ToolLoop* create_tool_loop(Editor* editor, Context* context, Message* msg
|
||||
}
|
||||
|
||||
// If the active layer is not visible.
|
||||
if (!layer->is_readable()) {
|
||||
if (!layer->isReadable()) {
|
||||
Alert::show(PACKAGE
|
||||
"<<The current layer is hidden,"
|
||||
"<<make it visible and try again"
|
||||
@ -266,7 +266,7 @@ tools::ToolLoop* create_tool_loop(Editor* editor, Context* context, Message* msg
|
||||
return NULL;
|
||||
}
|
||||
// If the active layer is read-only.
|
||||
else if (!layer->is_writable()) {
|
||||
else if (!layer->isWritable()) {
|
||||
Alert::show(PACKAGE
|
||||
"<<The current layer is locked,"
|
||||
"<<unlock it and try again"
|
||||
|
@ -276,8 +276,8 @@ base::string FileSelector::show(const base::string& title,
|
||||
PRINTF("start_folder_path = %s (%p)\n", start_folder_path.c_str(), start_folder);
|
||||
|
||||
jwidget_set_min_size(this, JI_SCREEN_W*9/10, JI_SCREEN_H*9/10);
|
||||
remap_window();
|
||||
center_window();
|
||||
remapWindow();
|
||||
centerWindow();
|
||||
|
||||
m_fileList->setExtensions(showExtensions.c_str());
|
||||
if (start_folder)
|
||||
@ -318,8 +318,8 @@ base::string FileSelector::show(const base::string& title,
|
||||
// open the window and run... the user press ok?
|
||||
again:
|
||||
openWindowInForeground();
|
||||
if (get_killer() == ok ||
|
||||
get_killer() == m_fileList) {
|
||||
if (getKiller() == ok ||
|
||||
getKiller() == m_fileList) {
|
||||
// open the selected file
|
||||
IFileItem* folder = m_fileList->getCurrentFolder();
|
||||
ASSERT(folder);
|
||||
|
@ -97,7 +97,7 @@ MainWindow::MainWindow()
|
||||
if (box_tabsbar) box_tabsbar->addChild(m_tabsBar);
|
||||
|
||||
// Prepare the window
|
||||
remap_window();
|
||||
remapWindow();
|
||||
|
||||
// Initialize editors.
|
||||
init_module_editors();
|
||||
|
@ -342,11 +342,11 @@ void StatusBar::showTip(int msecs, const char *format, ...)
|
||||
m_tipwindow->closeWindow(NULL);
|
||||
|
||||
m_tipwindow->openWindow();
|
||||
m_tipwindow->remap_window();
|
||||
m_tipwindow->remapWindow();
|
||||
|
||||
x = this->rc->x2 - jrect_w(m_tipwindow->rc);
|
||||
y = this->rc->y1 - jrect_h(m_tipwindow->rc);
|
||||
m_tipwindow->position_window(x, y);
|
||||
m_tipwindow->positionWindow(x, y);
|
||||
|
||||
m_tipwindow->startTimer();
|
||||
|
||||
@ -613,9 +613,9 @@ bool StatusBar::onProcessMessage(Message* msg)
|
||||
}
|
||||
|
||||
const LayerFolder* folder = sprite->getFolder();
|
||||
LayerConstIterator it = folder->get_layer_begin();
|
||||
LayerConstIterator end = folder->get_layer_end();
|
||||
int count = folder->get_layers_count();
|
||||
LayerConstIterator it = folder->getLayerBegin();
|
||||
LayerConstIterator end = folder->getLayerEnd();
|
||||
int count = folder->getLayersCount();
|
||||
char buf[256];
|
||||
|
||||
for (int c=0; it != end; ++it, ++c) {
|
||||
@ -724,9 +724,9 @@ bool StatusBar::onProcessMessage(Message* msg)
|
||||
// Check which sprite's layer has the mouse over
|
||||
if (sprite) {
|
||||
const LayerFolder* folder = sprite->getFolder();
|
||||
LayerConstIterator it = folder->get_layer_begin();
|
||||
LayerConstIterator end = folder->get_layer_end();
|
||||
int count = folder->get_layers_count();
|
||||
LayerConstIterator it = folder->getLayerBegin();
|
||||
LayerConstIterator end = folder->getLayerEnd();
|
||||
int count = folder->getLayersCount();
|
||||
|
||||
for (int c=0; it != end; ++it, ++c) {
|
||||
int x1 = rc->x2-width + c*width/count;
|
||||
@ -842,7 +842,7 @@ static void slider_change_hook(Slider* slider)
|
||||
Sprite* sprite(document ? document->getSprite(): NULL);
|
||||
if (sprite) {
|
||||
if ((sprite->getCurrentLayer()) &&
|
||||
(sprite->getCurrentLayer()->is_image())) {
|
||||
(sprite->getCurrentLayer()->isImage())) {
|
||||
Cel* cel = ((LayerImage*)sprite->getCurrentLayer())->getCel(sprite->getCurrentFrame());
|
||||
if (cel) {
|
||||
// Update the opacity
|
||||
@ -886,8 +886,8 @@ void StatusBar::updateFromLayer()
|
||||
// Opacity layer
|
||||
if (sprite &&
|
||||
sprite->getCurrentLayer() &&
|
||||
sprite->getCurrentLayer()->is_image() &&
|
||||
!sprite->getCurrentLayer()->is_background() &&
|
||||
sprite->getCurrentLayer()->isImage() &&
|
||||
!sprite->getCurrentLayer()->isBackground() &&
|
||||
(cel = ((LayerImage*)sprite->getCurrentLayer())->getCel(sprite->getCurrentFrame()))) {
|
||||
m_slider->setValue(MID(0, cel->getOpacity(), 255));
|
||||
m_slider->setEnabled(true);
|
||||
|
@ -415,7 +415,7 @@ void ToolBar::openPopupWindow(int group_index, ToolGroup* tool_group)
|
||||
rgn.createUnion(rgn, Region(getBounds()));
|
||||
m_popupWindow->setHotRegion(rgn);
|
||||
|
||||
m_popupWindow->set_autoremap(false);
|
||||
m_popupWindow->setAutoRemap(false);
|
||||
m_popupWindow->setBounds(rc);
|
||||
toolstrip->setBounds(rc);
|
||||
m_popupWindow->openWindow();
|
||||
@ -511,7 +511,7 @@ void ToolBar::openTipWindow(int group_index, Tool* tool)
|
||||
|
||||
m_tipWindow = new TipWindow(tooltip.c_str(), true);
|
||||
m_tipWindow->setArrowAlign(JI_TOP | JI_RIGHT);
|
||||
m_tipWindow->remap_window();
|
||||
m_tipWindow->remapWindow();
|
||||
|
||||
Rect toolrc = getToolGroupBounds(group_index);
|
||||
Point arrow = tool ? getToolPositionInGroup(group_index, tool): Point(0, 0);
|
||||
@ -520,8 +520,8 @@ void ToolBar::openTipWindow(int group_index, Tool* tool)
|
||||
int x = toolrc.x - w + (tool && m_popupWindow && m_popupWindow->isVisible() ? arrow.x-m_popupWindow->getBounds().w: 0);
|
||||
int y = toolrc.y + toolrc.h;
|
||||
|
||||
m_tipWindow->position_window(MID(0, x, JI_SCREEN_W-w),
|
||||
MID(0, y, JI_SCREEN_H-h));
|
||||
m_tipWindow->positionWindow(MID(0, x, JI_SCREEN_W-w),
|
||||
MID(0, y, JI_SCREEN_H-h));
|
||||
|
||||
if (m_tipOpened)
|
||||
m_tipWindow->openWindow();
|
||||
|
Loading…
x
Reference in New Issue
Block a user