Commit Graph

2122 Commits

Author SHA1 Message Date
David Capello
21e9078fd7 Fix asserts in file/gif_tests 2014-07-30 01:45:59 -03:00
David Capello
91b0c2d071 Refactor: Remove "get" part for member functions that act like a simple getter
Additional change:
- Added Cel::image() to get the related image of the cel directly
2014-07-30 01:28:15 -03:00
David Capello
03a085d1e5 Fix problem deleting app::Document that are inside a Context 2014-07-29 01:29:04 -03:00
David Capello
81ffb0c5bd Refactor: Create doc::Context and move some logic from app::Document to doc::Document
The objective of these changes is to create a more testable doc/logic API.

Included changes:
- Added doc::Context, doc::Documents (the old app::Documents),
  and doc::Sprites (and observers for each)
- Added raster::Sprite::createBasicSprite()
- Added doc::ColorMode (equal to raster::PixelFormat)
- Added some methods to doc::Document: context(), sprites(), sprite()
  (to replace app::Document::getSprite()), width/height(), colorMode(),
  name(), and close()
- Moved app::DocumentObserver/Event to doc::DocumentObserver/Event
- Replaced app::ContextObserver with doc::DocumentsObserver and a couple
  of signals.
- Renamed app::Context::getActiveDocument() with
  doc::Context::activeDocument()
- Renamed app::Context::getActiveLocation() with
  app::Context::activeLocation()
- Removed app::ContextObserverList
- Removed app::DocumentId (now we can use doc::ObjectId)
- Removed app::Context::getSettings()
2014-07-29 00:53:24 -03:00
David Capello
a20bb2d4d7 Change Timeline logic to work with LayerIndex instead of inverted UI indexes
This is a work-in-progress, dropRange() must be reimplemented. Now that
the Timeline uses LayerIndex, we could change Timeline::Range to
DocumentRange and create unit tests for the logic side.
2014-07-24 23:50:45 -03:00
David Capello
9bea45f4ec Add UI to fix issue 433 (we cannot drop frames at the end or layers at the bottom)
The logic is not ready.
2014-07-21 22:59:45 -03:00
David Capello
8e55432cca Avoid warning about undefined dtor for UniquePtr<Resource> 2014-07-21 22:49:59 -03:00
David Capello
ce77a38303 Fix base::Observers impl: Copy the whole list of observers before we start iterating them (fix issue 427)
There are cases where we need to modify the list of observers of certain
entity when we are in a notification loop (i.e. iterating its observers).
E.g. A general update notification about the current document to all its
observers could create the mini editor, which is a DocumentObserver, so
a new observer is added to the list in the same notification loop.

Anyway, as we cannot modify the observer list (std::vector) when we are
notifying them (any modification in the std::vector invalidates
its iterators), the fix is quite easy (but not optimal): we can create
a copy of the observers list so we can iterate the list.

Note: If we have performance issues about this, we could try a std::list,
but at the moment this fix is quite enough.
2014-07-21 01:39:01 -03:00
David Capello
411ceda0e7 Add options to save GIF files (how to quantize palettes mainly)
* Added "context" parameter to save/load routines so we can test them.
2014-07-19 22:01:39 -03:00
David Capello
b9a1fa8e17 Put batck the "Pixel perfect" checkbox in the contextbar
The new UI will be available in v1.1, and it's better if we don't modify
the v1.0 interface too much at this moment.
2014-07-17 09:54:04 -03:00
David Capello
31e565a2b0 Add "gen" utility to generate UI widget wrappers from XML files 2014-07-13 13:24:57 -03:00
David Capello
958d8f922f Merge branch 'next' into dev 2014-07-11 01:15:30 -03:00
David Capello
e09bb7d3f2 Fix file_tests 2014-07-06 22:10:48 -03:00
David Capello
c004fb6bcd Set palette when the frame of the current editor changes 2014-07-06 22:10:30 -03:00
David Capello
4a17ee351c Minor changes in cmd_goto_frame.cpp 2014-07-06 21:48:46 -03:00
David Capello
fa760d8a21 Restore filename if "save as" fails 2014-07-06 21:29:36 -03:00
David Capello
b1d27d66e2 Fix issue 414 for WinXP in classic theme: unable to resize window from bottom/right edges
On WinXP classic theme we receive a WM_NCHITTEST messages for the
scrollbars, and as they overlap the resize borders (see WM_NCCALCSIZE
handler) we have to return a proper value as if they really were the
borders of the window.

Note: Scrollbars are still visible in classic theme, that is just ugly,
but at least the user can resize the window from bottom and right edges.
2014-07-06 20:37:13 -03:00
David Capello
d3aa22ac12 Mac OS X: Hide native mouse cursor (related to issue 350) 2014-06-29 16:10:12 -03:00
David Capello
5c4c155dea Missing #include <stdexcept> to use std::runtime_error exception 2014-06-29 16:07:43 -03:00
David Capello
619cca7dfd Fix passing non-POD type to printf-like function 2014-06-29 16:07:24 -03:00
David Capello
950a9fe82f Add button to create new folders in FileSelector (issue 233) 2014-06-28 18:01:32 -03:00
David Capello
4b7bf5b835 Merge she::Color and ui::Color types in gfx::Color 2014-06-28 16:10:39 -03:00
David Capello
901b2acc06 Remove some references to <allegro.h> 2014-06-28 11:17:22 -03:00
David Capello
b37ec489f6 Remove ui::Widget::isScancodeMnemonic() member function 2014-06-28 11:14:03 -03:00
David Capello
2fa7ee5a77 Fix tests/test.h 2014-06-28 10:49:47 -03:00
David Capello
738d6ec4ee Rename _unittest.cpp files to _tests.cpp 2014-06-28 10:49:38 -03:00
David Capello
7ebc90678f Use ui::Graphics instead of Allegro in Editor's brush preview routines
* Remove color_utils::color_for_allegro()
* Rename editor_draw/move/clear_cursor() -> draw/move/clearBrushPreview()
* Rename Editor::get_raw_cursor_color() and Editor::is_cursor_mask()
* Add Graphics::get/putPixel() and Graphics::width/height()
* Add SetClip class
2014-06-28 10:33:58 -03:00
David Capello
0b8d88d6ee Add "slice" ink and tool (it is not yet implemented) 2014-06-27 22:58:38 -03:00
David Capello
9fe53de8eb Fix regression bug in SkinTheme::sliceSheet() introduced in dbad153698
The skin's sprite sheet is loaded as an RGBA surface, and slices must be
created as RGBA sub-surfaces.
2014-06-26 23:53:41 -03:00
David Capello
5bbff161b9 Now ui::Graphics uses she::Surface instead of Allegro BITMAP 2014-06-26 22:14:39 -03:00
David Capello
331688bd86 Add "Zoom with Scroll Wheel" option (on/true by default) 2014-06-22 22:35:51 -03:00
David Capello
0c250df97a Separate Options dialog in different sections
* Add ui::Panel widget
2014-06-22 21:56:04 -03:00
David Capello
1f5ae8d75b Remove <allegro.h> from resource_finder.cpp 2014-06-22 18:59:19 -03:00
David Capello
10bd7142eb Change ui::ImageView to use she::Surface instead of Allegro BITMAP 2014-06-22 18:57:30 -03:00
David Capello
dbad153698 Add she::Font class (wrapper of Allegro FONT)
This is an huge refactor to avoid handling Allegro FONT directly. Some
changes:
* Add she::System::defaultDisplay/Font, createRgbaSurface, loadSurface,
  and loadRgbaSurface.
* Rename she::CreateSystem/Instance to she::create_system/instance.
* Remove ui/font.cpp and move ui/fontbmp.cpp to she library.
* ui::IButtonIcon uses she::Surface instead of BITMAP.
* Rename she::LockedSurface::drawAlphaSurface -> drawRgbaSurface
* Rename ui::SetDisplay -> set_display
* Rename _ji_font_text_len -> ui::Graphics::measureUIStringLength
2014-06-22 18:53:14 -03:00
David Capello
b7dca01532 Win: Use MessageBoxW instead of allegro_message() in she::error_message() 2014-06-18 01:00:18 -03:00
David Capello
1ff5e82cef Use she::error_message() in app_main() 2014-06-18 00:59:50 -03:00
David Capello
7d0e0f4b4a Remove references to allegro_message() from outside of she library 2014-06-18 00:53:15 -03:00
David Capello
76ec93ea80 Add ResourcesListBox as a generic version of PalettesListBox 2014-06-15 23:05:14 -03:00
David Capello
abe957f037 Update version to 1.0.2 2014-06-15 12:03:23 -03:00
David Capello
c639b4dba3 Add "dots" freehand algorithm (change to ButtonSet the selection of FreehandAlgorithm) 2014-06-15 04:14:53 -03:00
David Capello
12b30248bf Fix ase_parallelogram_map_standard for RGB/Grayscale for mask with alpha=0
If the transparent/mask color has alpha = 0, we cannot filter by
RGB/Grayscale values, we have to blend all colors anyway. Only when
the mask has alpha > 0 we can check if the RGB values are different to
the mask RGB values. In other words, comparing the source color with the
mask, makes sense only when the mask has alpha > 0.
2014-06-14 21:30:01 -03:00
David Capello
9ac51fd0be Rename raster::Pen -> raster::Brush 2014-06-14 15:09:43 -03:00
David Capello
153071f082 Fix issue 406: persist ISelectionSettings 2014-06-14 01:35:04 -03:00
David Capello
095d31a91d Fix SkinTheme::paintMenuItem() to paint check boxes correctly in 1:1 screen scale 2014-06-14 00:58:15 -03:00
David Capello
a21340cbf7 Update src/README.md 2014-06-14 00:50:10 -03:00
David Capello
07aaa78ea9 Minor fix in she::Event::type() return type 2014-06-14 00:49:06 -03:00
David Capello
5db6feef89 Fix RotSprite for RGB and Grayscale images 2014-06-14 00:46:33 -03:00
David Capello
8996827249 Use ColorPicker in ColorButton 2014-06-14 00:42:50 -03:00
David Capello
47cdd4af67 Fix ase_parallelogram_map_standard() for RGB and Grayscale images with customized transparent color 2014-06-14 00:42:30 -03:00
David Capello
1d3854c670 Change default location of aseprite.ini on Windows platform
The new default location is %AppData%/Aseprite folder. This will be useful
for a future setup program. So if aseprite.ini is located in aseprite.exe
directory, it acts like a portable program, in other case it acts like
an installed program.
2014-06-13 23:04:00 -03:00
David Capello
3c959233b6 Add link label in Options dialog to locate the configuration file 2014-06-13 23:00:49 -03:00
David Capello
b54ed9cfe7 Minor change in About dialog 2014-06-13 22:56:21 -03:00
David Capello
be817c515c Fix issue 410: Unexpected drawing behaviour on empty layer with Transparent Color index set to non-0
When we create a new image for the sprite, we've to adjust the image mask
color to the sprite mask color (as the image isn't in the Stock yet).
This problem appears in v1.0.1 (9dfec919e4)
because now we don't change the mask color of sprite images in the
rendering process. This kind of bug can be detected running on debug
mode with an assert in the render procedure.
2014-06-12 23:44:34 -03:00
David Capello
b1843f8f7a Fix issue 409: Infinite loop upon creating new sprite with a loop section set
Fix app::calculate_next_frame() to check that the loop section is correctly
inside the available sprite frames range [0, nframes)
2014-06-12 23:27:38 -03:00
David Capello
712d48245b Fix crash when Esc key is pressed in drag-and-drop of frames in Timeline 2014-06-12 23:12:15 -03:00
David Capello
6924990992 Simplify slot disconnections with the new Connection and ScopedConnection classes 2014-06-12 22:29:19 -03:00
David Capello
9dfec919e4 Fix issue merging frames that weren't rendered on any editor at least once
This bug is because the mask color of cel images were fixed when they
were used in the rendering process. Now, the mask color is fixed when the
image is added to the raster::Stock structure.
2014-06-09 22:36:42 -03:00
David Capello
47b5a973e9 Fix issue #405 - crash after merge down
We were deleting the destination cel if there weren't a source cel.
2014-06-09 22:07:24 -03:00
David Capello
d8d637a056 New version 1.0.1 in dev 2014-06-09 22:05:19 -03:00
David Capello
786ae48ffa Add ASEPRITE1.0 block to .gif files 2014-06-04 00:27:34 -03:00
David Capello
289b729e3e ExpandCelCanvas: Fix problems generating Dirty area for cels with origin != 0,0 2014-06-03 20:23:53 -03:00
David Capello
badbb7ad32 Minor changes in ExpandCelCanvas 2014-06-03 20:22:50 -03:00
David Capello
7017332d62 Fix conversion of Indexed images to RGB when the layer is transparent 2014-06-03 00:05:57 -03:00
David Capello
df3b87c409 Update giflib to 5.1.0 2014-06-02 22:10:08 -03:00
David Capello
7ffce344bd Add CUSTOM_WEBSITE_URL option to test a local webserver 2014-06-02 21:31:44 -03:00
David Capello
ed6c0f986d ColorSelector: Add WarningIcon to add colors to the palette
Simplified the color selector UI. Now RGB/HSV colors are shown correctly
and a new warning icon/button is visible when the color is not part of
the current palette. This button can be used to quickly add the new entry
to the palette.
2014-06-01 18:15:11 -03:00
David Capello
f91f41a425 NewFile command: Don't change palette in grayscale images 2014-06-01 18:10:52 -03:00
David Capello
76afcfedac Change current palette after undo/redo 2014-06-01 18:10:26 -03:00
David Capello
c56d3d1170 Fix for PaletteView: redraw it when the palette is changed 2014-06-01 18:09:19 -03:00
David Capello
cf0df20a13 Fix warning message on debug 2014-06-01 18:08:47 -03:00
David Capello
f99423dec4 Add Palette::findExactMatch() member function 2014-06-01 18:08:31 -03:00
David Capello
dc5a019c13 ContextBar: Add buttons to drop the selection or cancel the whole operation
- Add ContextBarObserver (and MovingPixelsState implements this interface)
- PixelMovements::discardImage() receives a "commit" flag to do a rollback
  of the operation if the user needs it.
2014-05-26 00:20:16 -03:00
David Capello
b05f2da0b2 ButtonSet: Add deselectItems() member function 2014-05-25 23:57:51 -03:00
David Capello
e5e4423730 ButtonSet: fix a bug using setSelectedItem() when there are no selected items 2014-05-25 23:57:31 -03:00
David Capello
1d8d39fc13 Add support to modify observers list when we are inside a notification 2014-05-25 23:54:56 -03:00
David Capello
1a07472824 Fix issue loading negative splitter position 2014-05-25 16:34:26 -03:00
David Capello
47b6df19ee Fix problems generating mouse messages with pos=0,0 2014-05-25 16:22:48 -03:00
David Capello
cbb70c8279 Timeline: make selected range outline a little bigger 2014-05-25 13:32:19 -03:00
David Capello
88ccba6da8 Fix thumbnails for transparent images 2014-05-25 12:06:55 -03:00
David Capello
08fb98d40d New notifications area at the top-right corner 2014-05-25 11:21:10 -03:00
David Capello
d18b9a403b Fix Onionskin_Merge type 2014-05-18 21:21:02 -03:00
David Capello
fc7e4123b4 Change default onionskin opacity step setting 2014-05-18 18:03:29 -03:00
David Capello
a15aea5ed7 Add timeline options for onion skin, loop section, and animation direction
- Add red/blue onion skin type
- Add app::calculate_next_frame() function to calculate the next frame
  depending of the timeline configuration (loop range, animation direction)
- Add app::finder() to simplify the access to widgets loaded from xml files
2014-05-17 21:27:44 -03:00
David Capello
263f4b5479 Add flag to debug observers 2014-05-17 21:04:55 -03:00
David Capello
3c2e01b5d8 Replace the dummy developer "console" with a WorkspaceView
This is completely experimental stuff. Just added this because the previous
window doesn't make sense.
2014-05-09 01:01:59 -03:00
David Capello
695243006f Don't show onion skin in the mini editor 2014-05-08 08:50:21 -03:00
David Capello
391a5c0bf4 Add command to switch onion skin visibility 2014-05-08 08:47:45 -03:00
David Capello
a6d900fc2c Fix several old issues with indexed images and transparent color
- If we use a RGB color in a background layer (indexed image),
  and the first palette entry (transparent color) matches that RGB color,
  we can use that entry, because this is the background (the transparent
  color isn't transparent at all in the background layer).
- If we use the same RGB color in a transparent color, we've to avoid the
  transparent color, because the user want to paint with that specific
  solid color.
- Palette::findBestfit() receives a mask_index now, so we can find what
  color best matches a specific RGB avoiding that specific mask color,
  or we can use -1 to use any color (e.g. for background layers).
- Added app::ColorTarget() to simplify and fix color_utils::color_for_layer
  and app_get_color_to_clear_layer(), so now we can use the new findBestfit
  to return the transparent color for background layers (if a RGB color
  matches the transparent color RGB values).
- Removed fixup_color_for_layer/background() functions in color_utils
- Fix NewImageFromMask() to use the mask color to clear the image
- Improve the Editor pen preview (cursor.cpp) to draw the bounds of the
  pen when it will paint with the transparent color.
2014-05-08 00:30:36 -03:00
David Capello
5a45d1ec23 Remove the number of colors entry field from "New Sprite" dialog
This field is disabled, and the program isn't ready to support less than
256 colors in Indexed mode, so it's better if we remove this field to avoid
confusion.
2014-05-06 00:08:43 -03:00
David Capello
81d30fb24d Detect HTHSCROLL/HTVSCROLL as HTCLIENT in WM_NCHITTEST message
In this way we fix a bug where (sometimes) the mouse is not detected
as in the client area because it's over a system scrollbar.
2014-05-05 21:37:20 -03:00
David Capello
fa204baf42 Easier way to reference the program website in commands 2014-05-05 21:28:58 -03:00
David Capello
cd4e3aa122 Rename "Put Alpha" to "Set Alpha" 2014-05-04 22:20:33 -03:00
David Capello
ce7bb1b9dc Add "Lock Alpha" ink (issue #155) 2014-05-04 22:16:30 -03:00
David Capello
e266089368 Make IntersectClip non-copyable 2014-05-04 21:51:52 -03:00
David Capello
778578b210 Fix Editor scroll issues: we cannot process several WM_MOUSEMOVE in one UI loop-cycle
We have to wait to validate not-scrolled regions before we can use
Widget::scrollRegion() or Window::moveWindow() again. This is an issue
to see in the future (to avoid lossing mouse move messages). At the moment,
one solution is to use the last received mouse move message.
2014-05-04 21:40:46 -03:00
David Capello
94b2fb6dde Translate Widget::m_updateRegion field when the widget is moved 2014-05-04 21:32:43 -03:00
David Capello
b45cd3e07e Minor changes in Widget::scrollRegion() 2014-05-04 21:32:13 -03:00
David Capello
41863f9d3d Minor changes in Window::moveWindow() 2014-05-04 21:31:59 -03:00
David Capello
4035c6fc13 Fix call to update_mouse_position() when Allegro mouse position is used 2014-05-04 21:18:43 -03:00
David Capello
81d10f1c4f Add DEBUG_PAINT_EVENTS to manager.cpp 2014-05-04 21:17:45 -03:00
David Capello
ddf894867a Fix ToolBar behavior to avoid changing tools unintentionally
- Avoid opening other groups if the user is not with the mouse down
- A second MouseUp closes the group
2014-05-04 20:56:36 -03:00
David Capello
6414e37f9a Use IntersectClip when possible 2014-05-04 16:59:11 -03:00
David Capello
df3cb694ae Add she::Display::setMousePosition() 2014-05-04 16:05:35 -03:00
David Capello
507819a26f win32: hide scrollbars changing client area in WM_NCCALCSIZE 2014-05-03 20:40:57 -03:00
David Capello
774a36efc9 Fix crash using deleted concurrent queue of event when Alleg4Display() is being destroyed 2014-05-03 18:02:27 -03:00
David Capello
9dff641855 Update win32 resource file 2014-05-03 17:04:49 -03:00
David Capello
7b9f8ce355 Update website URL in config.h 2014-05-03 17:04:33 -03:00
David Capello
b991f3b42e Rename cmd_change_image_type.cpp to cmd_change_pixel_format.cpp 2014-05-03 16:27:11 -03:00
David Capello
0eb8e344bb If the save process fails, mark the document as modified 2014-05-03 16:25:39 -03:00
David Capello
a04119eeb4 Fix several reported memory leaks 2014-05-02 23:55:45 -03:00
David Capello
9af8440ba6 Delete all css::Styles when the skin::StyleSheet is destroyed 2014-05-02 23:30:17 -03:00
David Capello
456bdaa20a Avoid memory leak information about color_mapping in skin_theme.cpp 2014-05-02 23:07:11 -03:00
David Capello
5b62a55a0a Avoid memory leaks information of FileFormatsManager 2014-05-02 23:04:04 -03:00
David Capello
0cd9bf21f3 Fix memory leak detector for Windows with MSVC compiler 2014-05-02 23:03:40 -03:00
David Capello
cb0f89ea3a Fix issue with Timeline scroll: when clicking with mouse wheel the scroll jumps to other location 2014-05-02 21:10:19 -03:00
David Capello
a5b1bd1875 Check invalid values of m_clk_layer in Timeline::dropLayers() 2014-05-02 21:08:10 -03:00
David Capello
c34ee7ef6b Fix compilation error in ase_parallelogram_map() 2014-05-02 20:22:39 -03:00
David Capello
e006d8322f Use strtol instead of ustrtol in widget_loader.cpp 2014-05-02 20:21:57 -03:00
David Capello
cfa061e014 Fix sprite properties dialog size when jguiscale() = 1 (problem referenced in issue #197) 2014-05-02 20:19:43 -03:00
David Capello
02a8ea779a Add missing *jguiscale() in Entry and ColorButton widgets 2014-05-02 20:08:59 -03:00
David Capello
3e70c5316d Add undo information when the sprite transparent color is modified 2014-05-02 20:00:26 -03:00
David Capello
c879d114e0 Version 1.0.0 2014-05-02 19:58:34 -03:00
David Capello
e36aaa5dfc Fix issue #197 - Index 0 is made transparent, even when it is not the transparent color
Now image_scale and ase_parallelogram_map_standard functions use the image
mask color.
2014-05-02 19:44:26 -03:00
David Capello
66564e354f Fix issue #394 - crash when we cancel the file save operation
There were problems calling a pure virtual function (IFileOpProgress
implemented by OpenFileJob) when we are already in ~Job() dtor. So we've
to wait the background thread (added Job::waitJob() function) to join
the thread so it can use IFileOpProgress safely.

Also the save process of .ase files now can be cancelled (it wasn't
possible before).
2014-05-02 17:04:55 -03:00
David Capello
33753ccde8 .ase format: remove static members to save chunks 2014-05-02 14:59:20 -03:00
David Capello
d0c2107278 .ase format: write the header at the beginning of the process
This is a common issue when the save process fails, we get an .ase file
without header. So basically with this change we save the most important
information of the header first, and then save the rest of frames/layers
info. At the end we can save the file size.

- Other change: removed "current_frame_header" static variable.
2014-05-02 14:38:35 -03:00
David Capello
aaa662cf23 Implement CelProperties commands using DocumentApi::setCelOpacity 2014-05-02 12:10:29 -03:00
David Capello
049affae65 Timeline: Fix bug start cels movement with right-click 2014-05-02 11:56:18 -03:00
David Capello
f60d1c5c4f Add "Cancel" option to cel_movement_popup (popup when you move cels in the Timeline) 2014-05-02 11:55:44 -03:00
David Capello
7a15f1c909 Merge remote-tracking branch 'origin/dev' into dev 2014-05-02 11:29:24 -03:00
David Capello
4946dd5ebb Timeline: Fix problem clicking first and second frame 2014-05-02 11:28:44 -03:00
David Capello
d76f6f6716 Add DocumentApi::setCelOpacity() 2014-05-02 11:28:21 -03:00
David Capello
09027fdee4 Fix issue #258 - bug moving a cel from a transparent layer to background
The problem was in DocumentApi::moveCel(). We cannot move a Cel between
layers and frames at the same time easily (it's not possible to do it
without being in a temporal invalid state, e.g. where two cels are in the
same frame position). It's better if we create completely new cel for
the target and remove the previous one in all cases (undoers are already
prepared to do those operations correctly).

- Add Sprite::getImageRefs() member function.
2014-05-02 11:28:03 -03:00
David Capello
bee4dff5a8 Merge branch 'dev' of git@github.com:aseprite/aseprite.git into dev 2014-04-29 23:08:20 -03:00
David Capello
6edf02765a Fix Graphics::fillAreaBetweenRects() 2014-04-29 23:07:25 -03:00
David Capello
62c5d5222f Redraw editors when all layers are hidden/shown 2014-04-29 23:04:57 -03:00
David Capello
e363577e65 Better double-click: remove DoubleClickeable and make ui::Widget default behavior to convert double-clicks into mouse downs 2014-04-29 23:02:27 -03:00
David Capello
62fc42c24d Timeline: Add icons to lock/unlock and hide/show all layers 2014-04-29 22:51:14 -03:00
David Capello
be13633d44 Merge branch 'dev' of git@github.com:aseprite/aseprite.git into dev 2014-04-29 01:21:43 -03:00
David Capello
d470a6b78a Fix Clear command to delete the selection first when the range is enabled in one frame/one layer 2014-04-29 01:19:39 -03:00
David Capello
0120ef58e1 AppMenuItem: fix updating enabled/checked state in popup menus (in timeline popups mainly) 2014-04-29 01:11:50 -03:00
David Capello
4d48e40484 Fix RemoveLayer command so it's disabled when we have no more layers to remove 2014-04-29 01:01:25 -03:00
David Capello
5601b07df6 Fix NewFrame command so it's enabled even when we don't have layers 2014-04-29 01:00:15 -03:00
David Capello
05d0eaee6d Timeline: fix painting code for paddings area when we've removed all layers 2014-04-29 00:51:42 -03:00
David Capello
870a435cb6 Timeline: fix crash when we remove all layers (issue #393) 2014-04-29 00:51:08 -03:00
David Capello
17e59bc9e5 And fix mouse wheel from Allegro 4.4 data 2014-04-28 22:07:01 -03:00
David Capello
a21febf6e8 Merge branch 'dev' of git@github.com:aseprite/aseprite.git into dev 2014-04-28 22:03:25 -03:00
David Capello
ec61c6b972 Add support for horizontal mouse wheel and scroll bar notifications (better support for trackpads)
WM_HSCROLL/WM_VSCROLL messages are used by some trackpads drivers to
notify about horizontal/vertical pan gestures.
2014-04-28 22:02:56 -03:00
David Capello
58720851c4 Update MiniEditor scroll properly when EditorView scroll changes 2014-04-28 01:45:22 -03:00
David Capello
4ea41e1024 Fix problem rendering underlined characters 2014-04-26 16:19:05 -03:00
David Capello
3935b10467 Merge remote-tracking branch 'origin/dev' into dev 2014-04-26 16:05:55 -03:00
David Capello
9fa0f4077b Fix default MiniEditorWindow position 2014-04-26 16:05:29 -03:00
David Capello
5584424b79 Adjust windows position when ui::Manager (the main windows/display) is resized 2014-04-26 16:04:25 -03:00
David Capello
75591fa491 Fix animation playback in MiniEditor: now it handles frame duration correctly 2014-04-26 12:06:11 -03:00
David Capello
a411cd88d9 Merge branch 'dev' of git@github.com:aseprite/aseprite.git into dev 2014-04-26 11:34:46 -03:00
David Capello
99ca9f175e Add View::attachedWidget() member function 2014-04-26 11:33:29 -03:00
David Capello
a6a383ebc8 Fix SkinTheme::paintView() to avoid the little white square in ListBox's bottom-right corner 2014-04-26 11:33:05 -03:00
David Capello
b7de0a9547 Don't reload the theme when the palette is modified
This was needed in the old days for 8bpp screens.
2014-04-26 11:22:21 -03:00
David Capello
6fa7abb812 Fix EditorView scrollbar painting code for the little square in the bottom-right corner 2014-04-26 11:16:49 -03:00
David Capello
15a3b6ac2c Fix double-click issues
- Fix double-click behavior when double-clicks are generated from
  Manager::generateMouseMessages().
- Add Widget::setDoubleClickeable/isDoubleClickeable() member functions
  for widgets that accept double-clicks.
2014-04-26 11:09:59 -03:00
David Capello
5d824512c2 Fix SkinTheme::paintMenuItem() painting code 2014-04-25 08:59:00 -03:00
David Capello
af299eecc8 Hide mouse when it leaves the display 2014-04-25 08:58:19 -03:00
David Capello
95fbfd9fe7 Add a mutex to access to the FileSystemModule 2014-04-24 08:51:59 -03:00
David Capello
b467e57ba3 Update the PaletteListBox view to show the scrollbar when palettes are added 2014-04-24 08:49:52 -03:00
David Capello
a711c8be17 Fix throw of exceptions in FileSystemModule ctor 2014-04-21 23:30:04 -03:00
David Capello
6634c12ad2 Fix problem selecting Default Ink each time we want to show other ink type 2014-04-21 22:23:22 -03:00
David Capello
3c4bbbe30c Replace jwidget_set_min/max_size() with Width::setMin/MaxSize() 2014-04-21 22:15:29 -03:00
David Capello
b33357ed46 Remove base::string (std::string is good enough for utf8 strings) 2014-04-20 19:53:27 -03:00
David Capello
3322396357 Minor fixes 2014-04-20 17:41:59 -03:00
David Capello
47ee01c1a0 Proper handling of HRESULTs 2014-04-20 17:41:49 -03:00
David Capello
a35cb0d34d Fix compilation errors (gcc) 2014-04-19 21:06:58 -03:00
David Capello
b36cff8d75 Add missing #include <string> 2014-04-19 21:06:35 -03:00
David Capello
019c7c9f1f she_alleg4: Define unique_display and display_scale on all platforms 2014-04-19 21:06:07 -03:00
David Capello
bc32c18dbb Fix PalettePopup::showPopup signature 2014-04-19 21:03:50 -03:00
David Capello
bf03d10b03 Remove extra elements in #endif directives 2014-04-19 21:03:20 -03:00
David Capello
bc3d3e9413 Load a better palette by default 2014-04-19 20:52:56 -03:00
David Capello
5ba85c01dc Improve "Load" button label in PalettePopup to know what it does when there is no active document 2014-04-19 20:52:36 -03:00
David Capello
2c0642d1f1 It's better if mouse wheel doesn't center the scroll on zoom-in/out 2014-04-19 20:43:23 -03:00
David Capello
223988d7ff Center on zoom (fixed issue #385) 2014-04-19 20:09:14 -03:00
David Capello
4c706afb90 New zoom tool 2014-04-19 20:08:21 -03:00
David Capello
1ab7de6668 Adjust some skin colors in filelist and selected background 2014-04-19 19:04:45 -03:00
David Capello
3738774efc Do not apply jguiscale() to Splitter layouts that are handled ByPercentage 2014-04-19 18:57:42 -03:00
David Capello
a34d181530 Add Widget::is/setTransparent property to paint a widget merged with its background
This fixes problems with tooltips, toolbar popups and context bar popups.
It fixes issue #297 (undo notifications rendering problems).
2014-04-19 18:51:42 -03:00
David Capello
2b3a4d1668 Paint PopupWindow as popup menus 2014-04-19 16:07:01 -03:00
David Capello
af4e714360 More painting code from ji_screen to ui::Graphics
We planned to migrate everything to ui::Graphics to port the program to
other back-end (e.g. SDL or Allegro5). This is one step forward to that
direction.

Changes:
- Delete a lot of deprecated functions from src/ui/draw.h/cpp and SkinTheme
  that used BITMAP/ji_screen.
- Rename ui::ji_move_region to ui::_move_region
- Move ui::jwidget_get_texticon_info to ui::Widget::getTextIconInfo.
  Now the member function returns client coordinate instead of absolute
  ones.
- ui::drawTextBox() now receives a ui::Graphics instead of a BITMAP
- Add ui::Graphics::drawChar/measureChar() member functions.
- Replace ui::jrectexclude() with with ui::Graphics::fillAreaBetweenRects()
2014-04-19 15:18:16 -03:00
David Capello
4beff46e02 We were calling dispatchMessages() on openPopupWindow(), which produces some messages that were deleting the toolstrip
We cannot use the "overlapped area" trick to draw the background of the
window. It's better to add a new "composite" kind of window.
2014-04-17 22:52:26 -03:00
David Capello
9ad86ef0ed Toolbar: Remove slot before the popup window is deleted
This fix some strange scenario/bug where slots iterators where invalidated
in the middle of the signaling process. (The whole signal/slot impl needs
a review/simplification.)
2014-04-17 22:30:07 -03:00
David Capello
dd2ce20e25 Win32: Add support to convert mouse messages (WM_) to ui::Messages (using she::Events)
On Windows, instead of polling Allegro mouse position/buttons we can use
the mouse messages (WM_*) directly to generate she::Events. Those events
are received by the ui::Manager and converted to ui::Messages.
Maybe this is a possible fix for issue #133 (Wacom tablets don't work
properly).

Changes:
- Don't use jmouse_z() directly (new ui::MouseMessage::wheelDelta() member)
- Add ui::_internal_set_mouse_position() to change the jmouse_x/y(0)
  from the new mouse position received in she::Events. The same for
  ui::_internal_set_mouse_buttons().
- Modify the ui::Manager to generate mouse events in any case: using old
  Allegro 4 polling method, or from she::Events.
2014-04-17 22:23:12 -03:00
David Capello
2e9751fef1 Rename base::file/directory_exists() to base::is_file/directory() 2014-04-17 17:12:55 -03:00
David Capello
138d2f1db8 Fix mouse buttons on kMouseDown/UpMessages
This fixes a problem reported on issue #388 where a tool loop couldn't
be canceled pressing left button when it was iniciated with right button.
2014-04-17 17:06:15 -03:00
David Capello
d3591ffdf7 Merge branch 'dev' of git@github.com:aseprite/aseprite.git into dev 2014-04-17 16:24:53 -03:00
David Capello
7989cd81bb Avoid drawing text over widget borders in SkinTheme::drawTextString() 2014-04-17 16:24:04 -03:00
David Capello
330602a78c ColorBar: change default FG/BG colors to white and black (RGB) 2014-04-17 16:22:46 -03:00
David Capello
e63831c87f ColorBar: Show 8 columns by default 2014-04-17 16:22:21 -03:00
David Capello
50369242ee Change the style of scroll bars in ColorBar 2014-04-17 16:21:52 -03:00
David Capello
f9612eb666 Merge branch 'dev' of git@github.com:aseprite/aseprite.git into gfx 2014-04-17 16:13:55 -03:00
David Capello
3dfc07b724 Remove ui::jwidget_set_border() function 2014-04-17 15:55:55 -03:00
David Capello
ff277dccf7 Add Widget::onSetColor() 2014-04-17 15:46:01 -03:00
David Capello
ed5a2d9570 Replace jwidget_noborders() with Widget::noBorderNoChildSpacing() 2014-04-17 15:44:33 -03:00
David Capello
c16ea3e8a2 Use Graphics object in ImageView::onPaint() 2014-04-17 15:27:45 -03:00
David Capello
6ca003feb0 Do not show empty tabs area in Tabs widget 2014-04-17 14:47:28 -03:00
David Capello
6ad54689dd PaletteView: Apply jguiscale() to initial m_boxsize 2014-04-17 14:46:23 -03:00
David Capello
defc703208 Fix Splitter::onLoad/SaveLayout() to support jguiscale() changes 2014-04-17 14:44:21 -03:00
David Capello
ab53c81a75 Minor fix in Tabs when close button in each tab is enabled
Anyway the close button doesn't work at this moment.
2014-04-17 14:39:29 -03:00
David Capello
f04bca8553 Fix DropDownButton::m_button style (left-align text and expansive widget) 2014-04-17 14:38:48 -03:00
David Capello
3466d17d27 Drop down button in ColorBar switches (open/close) the PalettePopup 2014-04-17 14:38:21 -03:00
David Capello
9ee1da15db Rename she::NotDisposableSurface to she::NonDisposableSurface 2014-04-17 14:23:43 -03:00
David Capello
6b53e46108 Do not fail if the default palette cannot be loaded 2014-04-17 13:48:33 -03:00
David Capello
a2753fd898 Add missing OVERRIDE modifier to OpenFileCommand member functions 2014-04-17 01:35:31 -03:00
David Capello
c8c8738ef8 Add PalettePopup in ColorBar to load predefined palettes from data/palette/
- Add PalettesLoader helper class to load palettes in background
- Add PaletteListBox widget
- Add PalettePopup widget
2014-04-17 01:35:02 -03:00
David Capello
283d883d37 Add SetPaletteCommand 2014-04-17 01:29:58 -03:00
David Capello
2b7bd3e831 Add base::concurrent_queue: a really simple concurrent queue
- Add base::scoped_unlock
2014-04-17 01:25:09 -03:00
David Capello
a8d39e588a Add raster::Palette::addEntry() and load .gpl files using this addEntry
At the moment the program doesn't support palettes with less than 256
colors. But at the future the idea is to load the number of colors that
the palette says.
2014-04-17 01:20:46 -03:00
David Capello
50a10a9056 Add filename to raster::Palette (this will be useful to know the original location of a palette) 2014-04-17 01:19:22 -03:00
David Capello
811a530013 base::open_folder: add support to open a folder/directory
Before this we were capable to open/locate a file inside a folder.
2014-04-17 01:18:24 -03:00
David Capello
ad4e08c8f5 Fix issue 98: The mini editor blacks out part of the screen when viewing an animation 2014-04-13 22:57:59 -03:00
David Capello
17adf56337 Fix issue 356: tooltips cause selecting tools require 1 or more extra mouse clicks
This is an old bug in the ui::Manager. We don't need to "free" (release)
the mouse widget when we re-stack windows order (e.g. because the user
clicked the non top-most window).
2014-04-13 22:47:40 -03:00
David Capello
4e7a084ced Remove unnecessary calls in TipWindow 2014-04-13 22:17:36 -03:00
David Capello
b00a187fba Free the right widget in removeChild() (we've to free "child" instead of "this") 2014-04-13 22:17:00 -03:00
David Capello
39e6f2dbe6 Report Manager::setMouse() calls if REPORT_EVENTS is defined 2014-04-13 22:16:20 -03:00
David Capello
0274e13075 Improve REPORT_EVENTS in manager.cpp to show the Widget type (using typeid) 2014-04-13 21:33:09 -03:00
David Capello
c387d330e6 Make hot-region bigger for ToolStrip popup 2014-04-13 21:20:32 -03:00
David Capello
cd464f6694 Fix tooltip flicker on ToolBar 2014-04-13 21:20:06 -03:00
David Capello
31e1b4e387 Close all TipWindow automatically on click 2014-04-13 20:40:44 -03:00
David Capello
47c92fb755 Fix REPORT_EVENTS in manager.cpp 2014-04-13 20:39:59 -03:00
David Capello
c9bda7b329 Implement TipWindow in terms of PopupWindow 2014-04-13 19:35:15 -03:00
David Capello
312aca755e Fix issue 333: Tool Selection Icons Flicker
- Add PopupWindow::ClickBehavior
2014-04-13 19:25:06 -03:00
David Capello
49844267a5 ToolBar: Now we can press-move-release mouse to select tools over different ToolStrips 2014-04-13 17:34:02 -03:00
David Capello
8dc869e1de Move drawing code of PaletteView widget from kPaintMessage to onPaint() 2014-04-13 16:26:00 -03:00
David Capello
b41841ddd2 Move drawing code of EditorView from kPaintMessage to onPaint() 2014-04-13 15:08:24 -03:00
David Capello
a0e403b6a6 Move drawing code of FileList from kPaintMessage to onPaint() 2014-04-13 15:06:30 -03:00
David Capello
f964b020dd Don't hide the MiniEditorWindow automatically if zoom is 1:1
As now the mini editor has an animation preview, it makes sense to
have the mini editor whatever the current editor zoom is.
2014-04-13 14:29:54 -03:00
David Capello
23292edf0c Move drawing code of ToolBar from kPaintMessage to onPaint() 2014-04-13 14:16:29 -03:00
David Capello
e310ef1428 Change StatusBar colors 2014-04-13 13:51:28 -03:00
David Capello
44c9bb520d Fix borders in ColorBar 2014-04-13 13:40:33 -03:00
David Capello
3313735936 app.cpp: Minor format change 2014-04-12 14:32:45 -03:00
David Capello
6aa4149dec Fix .gpl loader to ignore extra properties in the file 2014-04-12 14:30:19 -03:00
David Capello
1ab782b85d Fix base::trim_string() algorithm for empty input 2014-04-12 14:29:37 -03:00
David Capello
8ae3b3075d Simplify ResourceFinder API 2014-04-12 13:35:55 -03:00
David Capello
852aba87f8 Minor change in src/CMakeLists.txt to see if a unit test needs she library 2014-04-12 12:29:55 -03:00
David Capello
71b7000c8a Update links 2014-04-12 12:28:34 -03:00
David Capello
30af4e2620 Add trial-mode without save functionality 2014-04-10 00:33:28 -03:00
David Capello
942dba36fd Timeline: add support to move/copy ranges (multiple cels/frames/layers)
- Merge Timeline::STATE_MOVING_LAYER/CEL/FRAME to STATE_MOVING_RANGE.
- Remove celmove.h/cpp and move_cel/copy_cel functions. Now they are
  in the Timeline as dropRange/Cels/Frames/Layers member functions.
- Add DocumentApi::copyFrame/moveCel/copyCel member functions.
- Add timeline_drop_layer_deco and timeline_drop_frame_deco skin parts.
- Move code from DuplicateLayerCommand::onExecute() to new member
  function DocumentApi::duplicateLayer().
- Fix a bug changing Cel's frame number: we weren't updating the Cel
  position properly inside the LayerImage::m_cels collection. Now we use
  LayerImage::moveCel() to change the Cel frame number.
- Other fixes to DocumentApi: Change bgcolor from int to color_t.
2014-04-09 21:56:06 -03:00
David Capello
cb2c094212 Timeline: use mini font for frame numbers 2014-04-02 17:39:19 -03:00
David Capello
7ea7521f6a TimeLine: add range outline and hot state
This is the first step to improve the copy/move of ranges in the timeline.
2014-03-30 12:53:57 -03:00
David Capello
875301cb82 TimeLine: disable the selected range when a sprite editor is clicked
With this we can avoid confusion in the execution of commands like
Clear, that depending on the enable/disable state of the timeline range
it affects the timeline (clearing the whole range) or the sprite editor
(clearing the selected area). So now, when a sprite editor is clicked
we disable the range in the timeline, it's a way to say "as you clicked
this editor, commands will affect the editor, if you click the timeline
again, commands will affect the timeline".
2014-03-30 01:43:33 -03:00
David Capello
896fb27fd5 Move copy/paste of clipboard text from "ui" to "she" library 2014-03-29 22:12:01 -03:00
David Capello
c1e26d0ac0 Fix image conversion from Indexed to Indexed mapping colors (related to issue #267 and #195) 2014-03-29 21:31:27 -03:00
David Capello
6262366e91 Fix copy & paste from Indexed to RGB (use the clipboard palette) 2014-03-29 20:55:40 -03:00