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