Commit Graph

1170 Commits

Author SHA1 Message Date
David Capello
5380877c4a Refactor Editor class to use a state design pattern.
+ Added EditorState and derived classes (StandByState, DrawingState, etc.)
+ Added StatusBarListener.
2011-04-10 20:15:17 -03:00
David Capello
ef0cbf0e94 Fix bug in Editor::drawMaskSafe() where mask in hidden editors were drawn. 2011-04-06 22:09:01 -03:00
David Capello
8a40228ab3 Change default screen scale to 2x2 by default in all platforms. 2011-04-06 20:15:36 -03:00
David Capello
18fa17c5a9 Remove "using namespace tools;" from editor.cpp. 2011-04-03 16:23:09 -03:00
David Capello
db4fc75f2a Set minifont for "Edit Pal" button and convert it to check-box behavior. 2011-04-02 23:10:02 -03:00
David Capello
e7d12f9062 Change the title of mini-editor from "Preview" to "Mini-Editor". 2011-04-02 21:00:08 -03:00
David Capello
b9f8c201c4 Better support for different zoom levels in the mini-editor. 2011-04-02 20:58:51 -03:00
David Capello
536d67566f Add support to resize the pinned popup frames. 2011-04-02 20:43:31 -03:00
David Capello
0bcb44c491 The mini-editor cannot be the current editor. 2011-04-02 20:43:19 -03:00
David Capello
70e76380aa Add mini-editor to see 1px preview when you zoom in.
+ Added EditorView widget.
2011-04-02 18:12:41 -03:00
David Capello
d547a05f4d Add EditorListeners. 2011-04-02 15:47:44 -03:00
David Capello
d6181d838d Rename ITabsHandler to TabsDelegate. 2011-04-02 14:57:40 -03:00
David Capello
ff897fea34 Remove JMessage and jmessage union, use Message* and Message instead. 2011-04-02 13:14:07 -03:00
David Capello
19ea79b41e Add minifont in SkinTheme for color buttons. 2011-04-02 11:45:43 -03:00
David Capello
450e97ef92 Move data/skins/default_skin to data/skins/default. 2011-04-02 10:53:52 -03:00
David Capello
c5801760b6 Use PNG for fonts instead of PCX. 2011-04-02 10:50:59 -03:00
David Capello
1fd011c20b Move everything related to tools in "tools" namespace.
+ Splitted tools/tool.h|cpp in several files (ink.h, intertwine.h, etc.).
2011-04-02 10:47:03 -03:00
David Capello
82f5345ace Add ToolLoopManager::Pointer abstraction to avoid using JMessage in src/tools/ dir. 2011-04-01 22:48:58 -03:00
David Capello
9d744504a6 Rename some Editor's member functions to camelCase. 2011-04-01 22:23:38 -03:00
David Capello
4e567d72c7 Remove Editor's decorators (they were never used). 2011-04-01 22:11:07 -03:00
David Capello
f3b3664148 Add Widget::broadcastMouseMessage() to customize the list of targets
to receive mouse messages.
2011-03-31 00:18:28 -03:00
David Capello
dc58651f79 Remove UndoHistory::undo_* member functions to use Undoers directly
and to avoid undo-lib <-> undoers circular dependency.
2011-03-30 18:27:52 -07:00
David Capello
5576ea7e7c Remove "typename" from get_neighboring_pixels() params. 2011-03-30 16:41:49 -07:00
David Capello
d57677d80b Remove jwidget_find_name() function. 2011-03-29 21:42:21 -03:00
David Capello
0bd6e19093 Replace jwidget_add_child/remove_child/replace_child with Widget's methods. 2011-03-29 21:35:17 -03:00
David Capello
c7bf667f0d Add VBox, HBox, and BoxFiller micro-classes. 2011-03-29 21:13:08 -03:00
David Capello
3ad44e3004 Add a "pin" in color selectors to make the popup window floating.
+ Added Frame::hitTest() and Frame::onHitTest().
+ Added LookType enum for SkinProperty.
2011-03-29 21:07:37 -03:00
David Capello
236ee6bb7b Implement duplicate sprite with all layers (it was removed
temporally with the introduction of Document class).
2011-03-28 23:31:16 -03:00
David Capello
4aa039d40b Fix reversed logic in Document::duplicate(). 2011-03-28 23:20:03 -03:00
David Capello
a17c767e65 Remove all public fields of Cel adding accessors. 2011-03-28 00:24:27 -03:00
David Capello
9077ab8357 Implement duplicate sprite with flatten layers (it was removed
temporally with the introduction of Document class).
2011-03-27 23:21:22 -03:00
David Capello
341e298a6e Fix problems showing incorrect values in RGB/HSB entries in color selector. 2011-03-27 22:15:33 -03:00
David Capello
92266b2a68 Implement duplicate layer (it was removed temporally with the introduction
of Document class).
2011-03-27 22:08:19 -03:00
David Capello
e2a6ab7501 Show HSB instead of HSV in color selectors. 2011-03-27 22:02:59 -03:00
David Capello
da491a601b Fix showing layer buttons in the status-bar overlapped by the
transparent-color selector when we're moving pixels.
2011-03-27 21:19:26 -03:00
David Capello
363f753929 Fix bug #3050538 avoiding using the global "window_action" flag. 2011-03-27 21:15:56 -03:00
David Capello
df01255b51 Use OVERRIDE macro in more member functions (onProcessMessage, etc.). 2011-03-27 20:42:16 -03:00
David Capello
682e7152b7 Replace UndoHistory::undo_int/data/double methods with new safe-undoers.
+ Added SetCelFrame/Opacity/Position, SetMaskPosition, SetStockImgType,
  and SetLayerFlags undoers.
+ Finally removed the Layer::flags_addr() atrocity.
+ Removed RawData undoer.
+ Renamed SetImgType to SetSpriteImgType.
2011-03-27 18:15:00 -03:00
David Capello
b40a20e8aa Move src/widgets/editor.h to src/widgets/editor/editor.h. 2011-03-27 14:54:37 -03:00
David Capello
8b19d36e51 Add ContextFlags to simplify Command::onEnabled() implementations. 2011-03-27 14:51:02 -03:00
David Capello
a21d15b4ef Improve Document::lock() with an enum as parameter instead of a bool. 2011-03-27 00:15:08 -03:00
David Capello
eee8e17fcf Fix problems drawing the editor cursor when several JM_DRAWs messages were received. 2011-03-27 00:02:20 -03:00
David Capello
be7aa1009d Fix bug in ink_hline8_blur(). 2011-03-26 23:55:59 -03:00
David Capello
cb0e3e9db1 Fix bug in BlurGetPixelsDelegateIndexed::operator() in ink_processing.h. 2011-03-26 23:51:55 -03:00
David Capello
6395ad3817 Write-lock the Document only when we press OK button
in LayerProperties, CanvasSize, LoadMask, and SaveFile commands.
2011-03-26 23:41:37 -03:00
David Capello
e6b1b1ffa8 Remove LayerImage(const LayerImage*, Sprite*) ctor. 2011-03-26 23:23:50 -03:00
David Capello
687e2a0f4f Fix UndoHistory to adjust m_diffCount correctly. 2011-03-26 23:20:45 -03:00
David Capello
ef1a3194f0 Minor changes in UndoTransaction to avoid throwing exceptions from its dtor. 2011-03-26 23:05:24 -03:00
David Capello
74c21c3abb Move FilterManagerImpl::apply() to private section. 2011-03-26 22:34:12 -03:00
David Capello
d95919beb5 Add a simple DeveloperConsole for debugging purposes (F11 key). 2011-03-26 20:43:43 -03:00
David Capello
7dd873b1a7 Mask and palettes do not need to be serialized with IDs because
they are not referenced by IDs in any other place.
2011-03-26 20:13:49 -03:00
David Capello
98c306f587 Fix bug using incorrect states as the "saved one" in UndoHistory. 2011-03-26 20:04:20 -03:00
David Capello
f854c7acf5 Fix bug #14, don't ask for saving changes when read-only commands are used.
+ Added a new attribute for each undo item (undo::Modification).
+ Each item now modifies or does not modify the document (e.g. selection
  actions do not modify the document).
+ Added an asterisk in tabs when the document is modified.
2011-03-26 19:58:52 -03:00
David Capello
4fcbc7b6df Improve AnimationEditor::drawCel() to avoid calling LayerImage::getCel()
for each Cel to be drawn (getCel() is O(N)).
2011-03-26 19:05:09 -03:00
David Capello
a524fae9ba Implement LayerImage::getCel() in terms of LayerImage::getCel() const. 2011-03-26 18:49:29 -03:00
David Capello
3e8e3b397a Convert the animation editor to a C++ class (AnimationEditor derived
from Widget).
2011-03-26 18:28:27 -03:00
David Capello
e6bfe37a7c Fix bug in FilterManagerImpl::begin(), it was not checking the
new Document::isMaskVisible() flag.
2011-03-26 17:48:51 -03:00
David Capello
8e5c950df8 Refactored the entire Undo system in several layers.
+ Added "undo" library (undo namespace).
+ Moved UndoHistory to undo namespace.
+ Added Undoer and UndoersCollector interfaces.
+ Converted old UndoStream to UndoersStack class.
+ Added new "undoers" namespace and moved each Undoer implementation
  (classes to undo different actions) to "undoers" directory.
+ Added IO operations to "raster" objects (image, cel, layer, palette,
  mask).
2011-03-26 17:40:55 -03:00
David Capello
daf7abfa68 Use <iosfwd> instead of <iostream> in base/serialization.h. 2011-03-26 15:09:44 -03:00
David Capello
bc86d0afd7 Add OVERRIDE macro as wrapper for MSVC "override" keyword. 2011-03-25 14:22:53 -03:00
David Capello
be955de1da Fix definition of read8/write8 in base::serialization namespace. 2011-03-25 14:21:55 -03:00
David Capello
69dff9b5d0 Use C99 uint*_t instead of ase_uint*. 2011-03-24 18:36:19 -03:00
David Capello
f816425d5d Add ObjectsContainer interface in src/undo/ so UndoHistory has a way to
obtain any kind of objects (not just GfxObj).
+ Removed GfxObjId.
+ Added ObjectsContainerImpl.
+ Use UniquePtr for each member in Document to avoid memory leaks in
  Document() ctor.
+ Removed RasterModule class.
2011-03-24 18:03:38 -03:00
David Capello
d77c639c57 UndoTransaction does not need document wrappers. 2011-03-24 14:43:00 -03:00
David Capello
bf3232c640 Rename Layer::destroy_all_cels() to destroyAllCels(). 2011-03-24 13:15:09 -03:00
David Capello
5ff24c794c Minor fixes to #include directives in raster/ dir. 2011-03-24 13:10:48 -03:00
David Capello
a2e0f32987 No more pimpl idiom for Sprite class (because the biggest dependencies
are now part of Document class).
2011-03-24 13:06:40 -03:00
David Capello
82476db988 Remove deprecated file cmd_new_cel.cpp. 2011-03-24 11:50:09 -03:00
David Capello
9182f0f14a Move UndoHistory from raster/ to undo/ directory. 2011-03-24 11:50:00 -03:00
David Capello
44bee62e51 Modify PixelsMovementImpl to avoid write-locking the document
in the whole operation.
2011-03-24 11:37:41 -03:00
David Capello
93f0caae79 Rename DocumentWriter::unlock_writter() to unlockWriter(). 2011-03-24 10:26:40 -03:00
David Capello
0b495085cc Move the active mask from Sprite class to Document.
+ Removed masks and paths repositories.
+ Added Document::isMaskVisible and Document::setMaskVisible methods.
2011-03-23 00:06:43 -03:00
David Capello
f412c8450b Fix warning abouts undefined dtor of FormatOptions in file_formats_manager.cpp. 2011-03-22 23:19:38 -03:00
David Capello
f08d049ab6 Rename Undoable to UndoTransaction. 2011-03-22 21:22:13 -03:00
David Capello
6e60d3200d Add Document class, to remove app specific properties from Sprite.
+ Moved some properties from Sprite to Document: lock/unlock/mutex,
  filename, isModified flag, undo history, mask boundaries, file
  format options, preferred editor settings, extra cel.
+ A Context now has an active document (instead of an active sprite).
+ Renamed all sprite wrappers to be document wrappers (as the mutex is
  in the Document now).
+ Modifications to SharedPtr<> to be more like C++0x shared_ptr<>.
2011-03-22 21:11:25 -03:00
David Capello
42dbe7d026 Add reset(pointer,deleter_type) member function to UniquePtr. 2011-03-20 17:58:19 -03:00
David Capello
775357d04f Remove deprecated vectmap code. 2011-03-20 16:40:44 -03:00
David Capello
afd5ade856 Add find_unittests() in src/CMakeLists.txt to avoid compiling unittests
with all libraries as dependencies.
2011-03-18 00:26:08 -03:00
David Capello
cbf5c721f4 Add UniquePtr class. 2011-03-17 23:28:33 -03:00
David Capello
55c611c08b Convert Documents from std::list<> to a class. 2011-03-13 19:41:59 -03:00
David Capello
8d53d10a77 Renamed SpriteList to Documents. 2011-03-13 17:40:37 -03:00
David Capello
9b32ebdad6 Rename Undo class to UndoHistory. 2011-03-13 17:33:42 -03:00
David Capello
27cf3f2f63 Add explicit to CurrentSprite/Reader/Writer(Context*). 2011-03-13 16:38:26 -03:00
David Capello
a8d9636467 Refactor filters (effects).
+ Added Filter, FilterManager, and FilterIndexedData interfaces.
+ Moved all widgets related to filters to src/commands/filters.
+ Added the filters library.
+ Added FilterWindow and one derived window for each filter.
2011-03-13 15:50:31 -03:00
David Capello
d20bd1a31b Add <colorpicker> element for XML widgets. 2011-03-13 15:33:04 -03:00
David Capello
654d14eede Console::showException() does not modify the exception (added "const"). 2011-03-09 00:18:43 -03:00
David Capello
69a3070018 Minor changes in gui.cpp. 2011-03-08 23:25:06 -03:00
David Capello
e0edf5625f Use Widget::layout() instead of Widget::setBounds(getBounds). 2011-03-08 23:23:13 -03:00
David Capello
f36a0f22b1 Fix bug of hidden widgets when the frame is shown.
This is (probably) a fix for bug #3050538 in sf.net tracker.
2011-03-08 23:21:37 -03:00
David Capello
bd69a216bb Remove unreferenced local variable warning. 2011-03-08 23:18:18 -03:00
David Capello
bb7d3a0b71 Move jwidget_relayout() to Widget::layout(). 2011-03-08 23:18:04 -03:00
David Capello
0401f4abd4 Remove gui/base.h from sprite.cpp 2011-03-08 15:23:29 -03:00
David Capello
47669fe6f1 Add SpriteReader wrapper to lock the sprite when Editor paints it.
+ Fixed critical bugs using "sprite resize" command and drawing
  the current editor (fixed usage of invalid memory pointers).
  It happens because the resize command is executed in a background
  thread, and at the same time the user can cancel or move a progress
  dialog (generating redraw events to the editor).
+ Anyway this change incorporates some other problems with effects
  where they keep locked the sprite in the whole command execution,
  so the effect preview cannot be visualized. This will be fixed with
  a refactor of the entire effect/preview stuff.
2011-03-08 01:25:46 -03:00
David Capello
6319af1676 Fix problems restoring preferred scroll in selected sprite. 2011-03-06 18:23:57 -03:00
David Capello
cea3ade78a Minor changes: comments to C++ style. 2011-03-06 16:55:26 -03:00
David Capello
6d5531b998 Replace old gfx-data with graphics from the skin sheet.
+ Removed gfxdata.cpp file.
+ Removed get_gfx() from modules/gfx.h/cpp.
+ Added skin parts for each removed graphics of gfxdata.
+ Added IButtonIcon interface and an implementation for skin theme.
+ Removed "icon_buttons" from gui.cpp.
+ Now icons in button are set through set_gfxicon_to_button function.
+ Removed from Theme class check/radio_icon_size member variables
  (they are replaced with the new IButtonIcon interface).
+ Removed jdraw_inverted_sprite(), now each icon has it normal/selected
  version in the skin sheet.
2011-03-06 16:15:05 -03:00
David Capello
de47c6ff59 Rewritten palette editor using ColorSliders and HexColorEntry widgets. 2011-03-03 22:17:25 -03:00
David Capello
d7458bc78f Add ColorSlidersChangeEvent so ColorSliders::ColorChange signal
can receive the modified channel.
2011-03-03 22:16:54 -03:00
David Capello
bb1151c0ac Rewrite the entire color selector as C++ class.
+ Added ColorSliders widget for RGB, HSV, and Grayscale sliders.
+ Added HexColorEntry to show a color in HTML format.
2011-03-01 22:50:49 -03:00
David Capello
2ac1d38d62 Avoid sending keys to gui manager when a popup frame is visible. 2011-03-01 22:37:00 -03:00
David Capello
fd7e95035b Add degree symbol in string representation of HSV colors. 2011-03-01 22:36:18 -03:00
David Capello
a2eab0553c Fix critical bug using "thumbnails" dead-pointer after calling "destroy_thumbnails". 2011-03-01 21:07:28 -03:00
David Capello
824c309c8f Fix issue #8: saving .gif files with transparent backgrounds
does not clear the previous frame.
2011-03-01 19:22:17 -03:00
David Capello
26715e1a08 Add Slider::getMinValue and getMaxValue. 2011-02-24 18:13:00 -03:00
David Capello
b0ff50ec0e New color-bar with scrollable palette-view.
+ Removed palette-view from Palette Editor.
+ Fixed problems pasting RGB values in #hex format and HSV sliders.
2011-02-23 19:29:57 -03:00
David Capello
22a45a9acb Include system.h because we need JI_CURSORS in skin_theme.h. 2011-02-20 20:29:34 -03:00
David Capello
344faeff00 Add Border(int) constructor. 2011-02-20 20:25:57 -03:00
David Capello
95fd6c697c Change SIGNAL_COLORBUTTON_CHANGE to ColorButton::Change signal. 2011-02-20 19:37:42 -03:00
David Capello
716aa05294 Change drawing code of ColorButton from JM_DRAW to onPaint(). 2011-02-20 19:01:34 -03:00
David Capello
4e0ad7f839 Modify short color format in Color::toFormalString(). 2011-02-20 18:59:41 -03:00
David Capello
dea3962502 Remove deprecated colorviewer widget. 2011-02-20 18:40:16 -03:00
David Capello
ad12af7c8b Refactor the entire view widget to View, Viewport, and ScrollBar C++ classes. 2011-02-20 18:35:21 -03:00
David Capello
88112b7ffe Add some operators+(Border) to Border class and Border::getSize() member function. 2011-02-19 23:44:48 -03:00
David Capello
e2848f1f55 Add support for vertical-scrolling with mouse wheel in PaletteView widget. 2011-02-19 23:44:17 -03:00
David Capello
b2ff34909f Remove quick-menu stuff (used only in old jinete examples): 2011-02-19 23:11:40 -03:00
David Capello
d1baef1555 Add text-color to Label widget. 2011-02-19 23:08:15 -03:00
David Capello
96095159bb Include new src/gui/*.h header files in src/gui/gui.h. 2011-02-19 22:50:54 -03:00
David Capello
9b2cf15e94 Remove COLOR_SIZE macro in palette_view.cpp. 2011-02-19 22:41:09 -03:00
David Capello
e309656737 Add PaletteView::IndexChange signal (to replace SIGNAL_PALETTE_EDITOR_CHANGE). 2011-02-19 22:40:46 -03:00
David Capello
d72909e130 Change "images" variable in ji_move_region() from JList to std::vector. 2011-02-16 00:13:18 -03:00
David Capello
3617ae9242 Change "thumbnails" variable in src/util/thmbnail.cpp from JList to std::vector<> type. 2011-02-16 00:07:09 -03:00
David Capello
69b7e2f8f7 Change StatusBar::m_progress from JList to std::vector<> type. 2011-02-16 00:03:56 -03:00
David Capello
9e687d84b0 Add shortcut in the tool-tip of ToolBar. 2011-02-15 09:55:44 -03:00
David Capello
82931688ad Fix position of tool tip in tool-bar. 2011-02-15 09:50:53 -03:00
David Capello
9658fc3747 Fix problem painting a new tip window (with alpha) over a dirty (non-validated) area in tool-bar. 2011-02-15 09:50:14 -03:00
David Capello
cb2eb74ff0 Add ArrowAlign to TipWindow so the tip is pointing to some widget. 2011-02-15 09:02:51 -03:00
David Capello
f96d1f7fa3 Move jwidget_init_theme() to Widget::initTheme(). 2011-02-15 09:00:29 -03:00
David Capello
5de5cfc8e1 Add Them::paintTooltip and changed the tooltip skin with rounded borders and shadow.
+ Move all parts definition to src/skin_parts.h.
2011-02-14 22:50:39 -03:00
David Capello
01f3f9ffab Use Graphics pointer in PopupFrame/TipWindow::onPreferredSize/onPaint events.
+ Add Graphics::drawString/fitString/drawStringAlgorithm.
2011-02-13 23:16:10 -03:00
David Capello
deae4d820a Setup the widget's font in Graphics created for PaintEvents. 2011-02-12 21:33:14 -03:00
David Capello
a33f10373c Add ScreenGraphics to get a "Graphics" to draw directly onto the screen. 2011-02-12 21:32:43 -03:00
David Capello
fe50b6a30a Change painting code of some widgets from JM_DRAW to onPaint().
This need future work to avoid using ji_screen and access to the
drawable area only through Graphics pointer inside the PaintEvent.
2011-02-12 09:32:57 -03:00
David Capello
890ec324f9 Add Widget::setDoubleBuffered(bool) to use double-buffering method
automatically when ji_screen == real screen. Activate this attribute
for palette editor sliders.
2011-02-05 16:26:01 -03:00
David Capello
86fb4c0f90 Change Slider paint code from JM_DRAW message handler to onPaint() method.
+ Rename Theme::draw_slider -> paintSlider(PaintEvent&)
+ Add methods in Graphics to draw images, rectangles, and text.
+ Add IntersectClip class.
+ Add Widget::getClientBounds().
+ Modify ISliderBgPainter::paint to receive a Graphics instead of BITMAP.
+ Add more methods in SkinTheme to draw theme parts in Graphics.
2011-02-05 12:03:22 -03:00
David Capello
56c8d34237 Minor changes in font.h (format). 2011-02-02 00:42:19 -03:00
David Capello
a7ea661ad0 Overload gfx::Border class operators to increment/decrement border size. 2011-01-30 23:18:52 -03:00
David Capello
f8e940d7a4 Sort #include lines in gui.h. 2011-01-30 20:38:07 -03:00
David Capello
e1e4adf68d Add unit tests for gfx::Rect class. 2011-01-30 20:03:25 -03:00
David Capello
7273b95b68 Rename Rect::inflate() -> enlarge() and Rect::deflate -> shrink(). 2011-01-30 20:03:10 -03:00
David Capello
2baa342a65 Remove "j" prefix from some files in gui library. 2011-01-30 19:12:10 -03:00
David Capello
69fa03dcd7 Avoid deprecated allegro functions. 2011-01-28 04:55:55 -08:00
David Capello
6ef082ad7f Rename PalEdit to PaletteView widget to avoid confusion with the palette editor command. 2011-01-28 09:28:54 -03:00
David Capello
ed2c870059 Replace draw_bounds_template() macro with SkinTheme::draw_bounds_template member function. 2011-01-28 09:13:43 -03:00
David Capello
1738a93fca Add Widget::get/setBorder(). 2011-01-27 23:30:11 -03:00
David Capello
034a943a0c Add gfx::Border class. 2011-01-27 23:29:46 -03:00
David Capello
40df2e1d73 Minor change in event.h. 2011-01-27 18:38:27 -03:00
David Capello
85203205b8 Add PaintEvent and Graphics (future replacement of JM_DRAW message). 2011-01-27 18:38:16 -03:00
David Capello
5eba876fce Minor changes in jintern.h 2011-01-27 17:21:43 -03:00
David Capello
5a9d991219 Convert jalert to Alert C++ class. 2011-01-27 17:21:33 -03:00
David Capello
f558666056 Move src/gui/jalert.h to src/gui/alert.h. 2011-01-27 00:29:54 -03:00