Commit Graph

4118 Commits

Author SHA1 Message Date
David Capello
0c9fb6b22b Remove src/pen directory
It's not required anymore after 1c94dda072
2016-04-27 12:47:55 -03:00
David Capello
ea80b4ad96 Remove unused include files 2016-04-26 11:15:30 -03:00
David Capello
97ebd70048 Update the status bar depending on the Editor text when the tool changes
It fixes a problem were PaletteView was clearing the StatusBar set by
the Editor when a quicktool keyboard shortcut was pressed.
2016-04-25 16:17:30 -03:00
David Capello
93c616cd7b Don't change two times the status bar text when the selected tool changes 2016-04-25 15:29:06 -03:00
David Capello
fc0cebc0dd Redraw editor only when selection handles must be redrawn 2016-04-25 15:26:46 -03:00
David Capello
a09b00dba8 Fix synchronization of different UI elements depending on the active tool
With this patch now the context bar shows the real active tool
preferences. For example, if we choose the option to use the Eraser
tool with right-click, now right-clicking will draw with the Eraser
brush size (instead of using the selected tool/left-click tool brush
size).

Changes:
* Removed the toolBox.activeTool() field from preferences
  (as the option isn't persisted between sessions)
* Added an observable app::tools::ActiveToolManager class to sync all
  UI elements that depend on the active tool and ink.
* Moved a lot of "active tool" logic from app::Editor to the
  new ActiveToolManager
* Moved app::tools::ToolLoopManager::Pointer as an indepedent
  app::tools::Pointer class
2016-04-25 15:20:53 -03:00
David Capello
f87cf93a55 Merge branch 'master' 2016-04-25 14:05:48 -03:00
David Capello
34d4489599 Merge pull request #924 from TheKK/brush_value_set
Apply brush size when clicking on brush icon
2016-04-25 14:04:06 -03:00
David Capello
d363f29840 Fix timeout in StatusBar::showTool() 2016-04-25 13:26:39 -03:00
Azamat H. Hackimov
eda468b272 Fix compilation on MSVC for 32bit profile.
Option "/SUBSYSTEM:WINDOWS,5.01" cause failing compilation checkings.
It is near to impossible compile current cmake-project on Windows XP,
and since this statement doing nothing else than CMake can do
themself, let's just delete them.

Tested on Windows 10 / MSVC 2015 on 32 and 64 bit profiles. Fixes
issue #1086.
2016-04-25 20:06:40 +05:00
David Capello
5f90ef7c9b Add properties in App to access directly to timeline/contextBar/workspace 2016-04-22 13:19:06 -03:00
David Capello
350cc2df2d Show text on console too when TRACE() is used on Windows 2016-04-22 12:27:00 -03:00
Azamat H. Hackimov
e7883b7d64 Fixing underlinking for gcc 4.9
Allegro4 backend uses XGrabPointer() from libX11.
Added ${X11_LIBRARIES} for she to resolve underlinking.
2016-04-22 13:42:26 +05:00
David Capello
59773e104e Update context bar when the pointer type changes
With this when we change between the stylus pen and eraser, the context
bar is updated with the correct brush settings for the tool.
2016-04-21 15:33:18 -03:00
David Capello
8e233878b6 Fix compilation error introduced in 119c87873f 2016-04-21 14:52:16 -03:00
David Capello
ac6d930d08 Missing PointerType in regular mouse movement events on OS X 2016-04-21 13:40:18 -03:00
David Capello
f447b457db Fix crash on OS X
This is strange because it didn’t happen before, I’m not sure if we
can call (or is “legal” to call) setURI() in this case.
2016-04-21 13:33:24 -03:00
David Capello
7c2786164d Remove unused variable 2016-04-21 13:31:24 -03:00
David Capello
56e663bca4 Merge branch 'eraser-support' 2016-04-21 13:22:23 -03:00
David Capello
9b05d2e8ef Add Wacom eraser support on OS X 2016-04-21 13:13:15 -03:00
David Capello
119c87873f Add she::PointerType::Cursor to identify puck like devices 2016-04-21 13:12:03 -03:00
David Capello
c5f7e9618b Use the real current tool preferences to draw and in the brush preview
The "real" current tool is the one in the editor returned by
getCurrentEditorTool() (which depends on quicktool modifiers
and right-click configuration).
2016-04-21 01:20:59 -03:00
David Capello
4198003446 Update context bar correctly when right-click changes the current tool
E.g. When right-click is configured with the Eraser tool, we must update
the context bar with the Eraser options in the context bar.
2016-04-21 00:57:06 -03:00
David Capello
7b4511a5df Unify she::InputDevice and ui::PointerType 2016-04-20 22:49:03 -03:00
David Capello
a58cbfbc1c Enable eraser support for Wacom tablets on Skia/Win back-end
Related to #610
2016-04-20 22:33:10 -03:00
David Capello
47708a6826 Include device in double-click event on Skia/Win 2016-04-20 22:30:45 -03:00
David Capello
955f86fc9e Add pressure and input device (mouse/stylus/eraser) info to mouse events
This is a first step to implement #610 and #710
2016-04-20 15:44:15 -03:00
David Capello
1c94dda072 Merge pen library into she library
This is the first step to add pen information to mouse events
(e.g. to known if a event came from the eraser or the regular tip).
2016-04-20 12:48:49 -03:00
David Capello
e723426214 Minor fix at pen_win.h
WTInfo is a macro defined as WTInfoW so anyway WTInfoW function was
being used.
2016-04-20 11:25:03 -03:00
David Capello
4be68ab5f0 Default folder for new files must be the latest used folder (fix #1068)
To behave in this way, the open/save dialog must receive a document
filename with an empty path.
2016-04-20 10:22:01 -03:00
David Capello
9cc8d43f0a Show color on status bar when mouse is over ColorTintShadeTone (and not captured) 2016-04-20 09:37:49 -03:00
David Capello
33003fb6f9 Show current grid tile in status bar when the grid is visible (fix #1075) 2016-04-19 15:51:34 -03:00
David Capello
fcca96d6a3 Add missing text in StatusBar::showColor() 2016-04-19 15:43:12 -03:00
David Capello
6661c0a32a Include RGB decimal values when we pick HSV colors (fix #1013) 2016-04-19 15:21:54 -03:00
David Capello
0993069e0b Add line length in status bar (fix #915) 2016-04-19 15:08:36 -03:00
David Capello
065188aea3 Include <cstring> needed in standby_state.cpp 2016-04-19 14:24:27 -03:00
David Capello
231b17615a Merge branch 'cmake-optima' of https://github.com/winterheart/aseprite into cmake-optima 2016-04-19 14:19:21 -03:00
David Capello
c9c4838641 Fix gfx::SizeT::createUnion() function 2016-04-19 14:09:18 -03:00
David Capello
75d545c976 Fix initial size indicator in status bar when we move pixels 2016-04-19 13:45:37 -03:00
David Capello
87ef48b50b Improve status bar with icons/automatically generated and re-used parts (fix #752) 2016-04-19 13:45:23 -03:00
Azamat H. Hackimov
b5f63d428c Refactoring CMake invocations
Using built-in function and modules for checking.
2016-04-19 20:56:04 +05:00
David Capello
af0267de03 Improve error reporting in gen utility when an invalid XML is used 2016-04-18 19:10:10 -03:00
David Capello
8de18946f8 Copy frame duration when we copy frames between two different sprites (fix #1023) 2016-04-18 16:53:07 -03:00
David Capello
fca32900bb Make base::string_to_lower/upper() use tolower/upper() for each Unicode char
It fixes issue #1065 because now UTF-8 strings are not destroyed by
these base::string_to_*() routines. This issue appears when we use
std::setlocale(), which was introduced in 27b55030e2
2016-04-18 16:38:37 -03:00
David Capello
63243f7dba Minor change remove include base/string.h from app.h 2016-04-18 15:23:01 -03:00
David Capello
6c148c9bb6 Update version to 1.1.5-dev 2016-04-18 13:29:04 -03:00
David Capello
8775604e56 Make Aseprite a DPI-aware application (fix #1041) 2016-04-18 13:27:36 -03:00
David Capello
84d8a7a4ec Add SpriteWrap::commitImages() to commit changes to images
This might be useful to use before we execute commands like Sprite.resize
or Sprite.crop, which they need all images in the most updated state.
2016-04-16 21:29:57 -03:00
David Capello
573f68451a Add more scripting functions
* App.open
* Sprite.save and saveAs
* Sprite.filename property
2016-04-15 19:59:25 -03:00
Romain Giraud
ea06140be8 Fix error when decoding GPL file
Color without name are not added to the palette.
2016-04-13 17:26:57 +02:00
David Capello
b0f53324a7 Extra checks for an initialized SkiaDisplay for GPU support on OS X 2016-04-13 10:17:59 -03:00
David Capello
99d7eb5391 Fix crash using an non-fully initialized SkiaDisplay on SkiaWindow::Impl::paintGC() on OS X 2016-04-13 10:16:06 -03:00
David Capello
2636401c1c Remove gui.xml version check on release
This is sometimes useful on Debug builds, but it brings more problems
on Steam when we want to release a fix for a specific platform with
a modified version number.
2016-04-13 09:02:04 -03:00
David Capello
25a24a93d8 Avoid using an uninitialized m_surface pointer in SkiaDisplay
This should fix problems launching Aseprite on OS X (e.g. #1059).
2016-04-13 09:00:29 -03:00
David Capello
a76a1117f1 Fix crash using RotSprite with width/height == 0 (fix #1056) 2016-04-12 17:29:23 -03:00
David Capello
7c9ba13321 Add double-click support on Skia/OS X port (fix #1057) 2016-04-12 17:27:01 -03:00
David Capello
44fadbc275 Fix key modifiers on Alleg4/Windows back-end 2016-04-12 11:33:48 -03:00
David Capello
221e9bf4fc Add base::normalize_path() 2016-04-11 19:17:39 -03:00
David Capello
e4c46a761a Fix loading two times a file specified in the command line on OS X
To avoid receiving a she::DropFiles event (from application:openFiles:)
when we're loading files specified in the command line (i.e. when we are
showing the progress bar/processing "ui" layer events/CustomizedGuiManager
is listening for kDropFilesMessages) we call NSApp finishLauching after
we've processed the whole command line.
2016-04-11 19:15:42 -03:00
David Capello
63c723d327 Change OSXAppDelegate base type to avoid an opaque id type 2016-04-11 17:28:19 -03:00
David Capello
5ef931b7d4 Override application:openFiles: instead of application:openFile: 2016-04-11 17:27:34 -03:00
David Capello
49f11648b3 Fix opening files from Finder on the Skia/OS X port 2016-04-11 17:25:54 -03:00
David Capello
c900e4aa3c Don't call app_main() from OSXApp 2016-04-11 16:19:32 -03:00
David Capello
4acf12a478 Make Ctrl+Tab work on Skia/OS X port 2016-04-11 15:30:16 -03:00
David Capello
ed4b26b2c8 Add get_unicodechar_from_nsevent() to she/osx/view.mm 2016-04-11 15:30:16 -03:00
David Capello
8e06d61f74 Use NSWindow noResponseFor: to avoid beeps on Skia/OSX fork 2016-04-11 15:30:15 -03:00
David Capello
df9c555c87 Minor changes in she/osx/ 2016-04-11 15:30:02 -03:00
David Capello
49b068cccc Fix warning on updater/check_update.cpp about undefined UPDATE_URL 2016-04-11 13:05:15 -03:00
David Capello
16ae88b6d9 Add comment in she::Event::preciseWheel() 2016-04-11 13:04:44 -03:00
David Capello
81fcbdab3d Update version to v1.1.4-dev 2016-04-11 13:02:49 -03:00
David Capello
519f11e81d Fix open in folder on Linux 2016-04-11 13:00:39 -03:00
David Capello
2a007bffb9 Update Editor::onMouseWheel() to use precise wheel as a touch device (scroll by default)
On OS X, when we receive a precise wheel event, it means that the user
has pressed a touch-like device (trackpad, magic mouse, wacom tablet),
so he can scroll by default with the device (it's not a real mouse wheel).
The zoom can be done with the pinch gesture.
2016-04-11 12:59:51 -03:00
David Capello
951bc1b4b0 Avoid scrolling and zooming at the same time on Skia/OSX back-end 2016-04-08 18:20:18 -03:00
David Capello
1b28c8e482 Fix Alt+key on Linux (fix #83 and #191) 2016-04-08 18:19:07 -03:00
David Capello
00be81dfa8 Fix compilation problems on OS X with skia back-end 2016-04-08 13:08:34 -03:00
David Capello
8a5de088e2 Add scaling from center/pivot (fix #576) and with flipping (fix #579) 2016-04-08 11:55:40 -03:00
David Capello
7d185d1543 Fix base_trace() to avoid double \n\n at the end of line 2016-04-07 16:12:33 -03:00
David Capello
495a645917 Add possibility to recover raw images from a session (as a sequence of frames or layers)
This might be useful in extreme cases where the normal restoration
procedure doesn't work/restore the whole sprite structure correctly.
2016-04-07 16:12:03 -03:00
David Capello
52dd13c9a0 Add Sprite.saveAs() method in scripting API 2016-04-06 19:28:49 -03:00
David Capello
956349f87b Add Image class to scripting
With this change we introduce SpriteWrap and ImageWrap to keep track
of modifications made by the script in one transaction. So we can undo
the script action as one simple action.
2016-04-06 19:05:06 -03:00
David Capello
7f31bbef26 Add const to src argument in cmd::CopyRegion ctor 2016-04-06 18:30:00 -03:00
David Capello
5bd2a01446 Avoid leaving an extra item in the stack when getThis() is used 2016-04-06 17:18:54 -03:00
David Capello
de8ef623a6 Avoid printing the last script result when we run a script from UI 2016-04-06 16:56:10 -03:00
David Capello
21921fdfd5 Refactor scripting code 2016-04-06 15:37:13 -03:00
David Capello
2ce09c53dd Add customization for square aspect, draw from center, and move origin keys (fix #1028)
Some changes:
- Now ui::Keys aren't processed in app::tools side, they are processed
  in Editor side and converted to ToolLoopModifiers flags.
- Replace ToolLoop::getSelectionMode -> ToolLoop::getModifiers()
2016-04-04 18:46:48 -03:00
David Capello
5847624d0e Merge branch 'cli-options-for-thumbnails' 2016-04-04 13:12:30 -03:00
David Capello
e28881ff65 Better error reporting for --shrink-to, --frame-range, --crop options 2016-04-04 13:09:50 -03:00
David Capello
019e6b3b28 Use , separator in --shrink-to and --frame-range 2016-04-04 13:09:47 -03:00
David Capello
e353a2f79d Minor format changes in app/app.cpp 2016-04-04 13:09:45 -03:00
David Capello
c6482da761 Merge branch range-and-shrink-command-line-options
# Conflicts:
#	third_party/libpng
#	third_party/zlib
2016-04-04 13:09:32 -03:00
David Capello
8338784735 Fix crash using RotSprite algorithm on Sprite Size command 2016-04-04 11:39:32 -03:00
David Capello
f25c030a20 Fix issues compiling base/fs_unix.h on FreeBSD (close #1016) 2016-04-04 11:11:57 -03:00
David Capello
4fc0060b79 Fix linking she library with freetype 2016-04-04 10:51:43 -03:00
David Capello
8028cf64db Merge branch 'unicode-text'
# Conflicts:
#	third_party/libpng
#	third_party/zlib
2016-04-04 10:26:57 -03:00
David Capello
e4bb2ec45b Initial commit for a new Skia/X11 port 2016-04-04 10:17:14 -03:00
David Capello
79c2033a67 SkiaSurface::applyScale() uses the same color/alpha-type to resize the image 2016-04-04 10:08:04 -03:00
David Capello
939e86f5e4 SkiaSurface::create() creates opaque images (alpha isn't needed) 2016-04-04 10:07:22 -03:00
David Capello
677fe41316 Throw exceptions if a SkBitmap cannot be created on SkiaSurface
Maybe in the future we might avoid throwing exceptions from the "she"
layer and just return an error code.
2016-03-29 20:04:49 -03:00
David Capello
0430fe998c Rename cmake/Find-tests.cmake to cmake/FindTests.cmake 2016-03-29 19:07:43 -03:00
David Capello
cb4b45e58b Merge branch 'optional-tests' of https://github.com/winterheart/aseprite into optional-tests 2016-03-29 19:07:36 -03:00
David Capello
0605166cc6 Move clock/tick from "she" to "base" library and switch to uint64_t type 2016-03-29 16:19:23 -03:00
David Capello
3cd7d273d9 Update she/CMakeLists.txt for Skia branch 'chrome/m50' 2016-03-29 14:36:03 -03:00
David Capello
554885b83e Avoid warning about multiline comment on gcc 2016-03-29 12:53:16 -03:00
Azamat H. Hackimov
7964f1feb1 Make building tests optional
Added new option ENABLE_TESTS in CMake (ON by default)
2016-03-29 15:06:59 +05:00
David Capello
64449ffba8 Avoid signed/unsigned comparison in gcc/debug compilation 2016-03-28 18:59:35 -03:00
David Capello
27b55030e2 Fix bug pressing warning icon to add palette color when active locale is non-English
It looks like Allegro library was changing the locale to the active
one, and it can break things like strtod() (which is used to convert
colors from string format in AddColor command). In this case, if we added
a HSV color with double floating-point precision, it was added incorrectly
because strtod() wasn't taking the decimal part.
2016-03-28 15:30:00 -03:00
David Capello
f2ba51f1be Fix double-click in Allegro back-end when she_mouse_callback() is used 2016-03-28 10:36:06 -03:00
David Capello
799803d582 Add DrawingState::destroyLoopIfCanceled() to avoid duplicated code 2016-03-26 10:56:20 -03:00
David Capello
fde573d8db Merge branch 'master' of https://github.com/HunterNN/aseprite into HunterNN-master 2016-03-26 10:49:36 -03:00
David Capello
cf6be7349b Revert 6a63dc5aad as app already depends on net-lib 2016-03-26 10:17:12 -03:00
Azamat H. Hackimov
1a682f82eb Replaced LIBCURL_* to CURL_* in CMakeList
According to find_package() variables.
2016-03-26 16:01:45 +05:00
Azamat H. Hackimov
6a63dc5aad Adding ${CURL_LIBRARIES} to application linking
Fixing compilation underlinking with system curl.
2016-03-26 15:22:57 +05:00
Azamat H. Hackimov
3e9de78fa2 Using FOO_LIBRARIES and FOO_HEADERS from system cmake.
Fixes issue #864 (FREETYPE_INCLUDE_DIRS has not been added to search path)
2016-03-26 15:17:12 +05:00
Hunter99
edb2f971e5 Added cancel drawing loop on key release (fix #1002) 2016-03-25 14:32:36 +01:00
David Capello
7934c975ca Fix bug painting selection edges when zoom < 100% (fix #905) 2016-03-24 18:24:32 -03:00
David Capello
f696d895b4 Do not remap indexes between palette entries that are equal (fix #914) 2016-03-24 17:37:04 -03:00
David Capello
b4ce12beb4 Simplify hidden brush preview style 2016-03-24 14:51:57 -03:00
David Capello
8b161dac0a Add ShowBrushPreview command so the user can hide the brush preview with a keyboard shortcut (fix #792) 2016-03-24 14:45:28 -03:00
David Capello
9face9458e Add an option to change the "brush preview" style (related to #792) 2016-03-24 14:29:15 -03:00
David Capello
2af47fe907 Add option to toggle the selection edges visibility (fix #861) 2016-03-24 13:04:35 -03:00
Gabriel Rauter
34c1af0a1b New cmdl parameters --range and --shrink-to
--frame-range <from:to> lets the user define a range from frame to frame
instead of a frame tag. example --frame-range "0:1" exports 2 frame. frame 0
and frame 1.

--shrink-to <widthxheight> shrinks the sprite into the boundarys of
width and height keeping the original aspect ratio.
2016-03-23 22:32:21 +01:00
David Capello
d4faf04946 Add a rgba_blender_normal() version without opacity
This can be used to speed up text rendering and rotation algorithm.
2016-03-22 18:40:47 -03:00
David Capello
ce02a31c01 Improve image_scale_tpl() performance using an iterator for source image 2016-03-22 18:23:03 -03:00
David Capello
14262c270c Fix crash on image_scale_tpl() and rotsprite_image() 2016-03-22 17:05:45 -03:00
David Capello
66e3cacbd0 Add RotSprite as a resize algorithm on Sprite > Resize Sprite menu 2016-03-22 17:02:41 -03:00
David Capello
7841ec82f3 Flip mask when the whole canvas is flipped (fix #561) 2016-03-21 14:51:43 -03:00
David Capello
f51de0bd73 Merge pull request #1000 from sirblackheart/native-gtk3-file-dialog
Experimental native gtk3 file dialog
2016-03-19 12:24:43 -03:00
David Capello
417e431a32 Add different selection modes to SelectTile command
Now we can add a tile using Shift+double click or substract one with
Shift+Alt+double click.
2016-03-19 12:09:03 -03:00
David Capello
e62f80842c Avoid enter to tool loop after we select the tile 2016-03-19 12:04:39 -03:00
David Capello
30f4e995a3 Select a tile by double clicking over it (fix #939) 2016-03-19 11:33:05 -03:00
David Capello
497cfa61a4 Implement app::IColorSource in color selectors 2016-03-18 23:35:23 -03:00
David Capello
07b67a66f7 Add app::IColorSource interface to get pixels from widgets from mouse pos
This is consumed by ColorButton which can be dragged to use a eyedropper
in different widgets.
2016-03-17 17:16:35 -03:00
David Capello
2d3ee0c802 Rotate foreground color hue by default with mouse wheel above ColorSelector 2016-03-17 16:42:50 -03:00
David Capello
99803c07ba Add mouse wheel behavior in color selector to rotate hue (fix #1012) 2016-03-17 16:40:34 -03:00
David Capello
449ae1d9e4 Add new app::ColorSelector to share behavior between ColorTintShadeTone/ColorSpectrum/ColorWheel 2016-03-17 16:37:31 -03:00
David Capello
1209037b02 Rename app::ColorSelector -> app::ColorPopup 2016-03-17 16:08:08 -03:00
David Capello
6d3c09d088 Use bearingX adjustment to render FreeType glyphs correctly 2016-03-17 11:11:08 -03:00
David Capello
f626837cb5 New command to add foreground/background color in the palette 2016-03-17 10:47:50 -03:00
David Capello
fdde32b808 Don't use UI to warn about sequences when --batch and --save-as are used
Fix #1018 introduced in 978145ba7a
2016-03-17 10:31:33 -03:00
David Capello
8304b7511d Fix FreeType2 font rendering and font height calculation
We need to catch the glyph's bearingY value to render each glyph
correctly.
2016-03-15 18:43:36 -03:00
David Capello
e0135d6f57 Add fixes for gcc/clang in ft::FaceFT 2016-03-15 17:45:55 -03:00
David Capello
fb10cf1d36 Simplify code in generic_surface.h for gcc/clang 2016-03-15 16:34:41 -03:00
David Capello
9784c0d455 Minor change to fix gcc/clang compilation errors 2016-03-15 16:33:11 -03:00
David Capello
2fd94ed884 Simplify ft::Face API
Changes:
* Added ft::FaceBase to create a future Face impl with HarfBuzz as text
  shaping engine
* Define ft::FaceBase::Glyph as the parameter given to the forEachGlyph
  parameter
* forEachGlyph and calcTextBounds
* Remove operator FT_Face (we can use FaceBase::isValid() to know if the
  face isn't null)
2016-03-15 15:15:37 -03:00
David Capello
6f0819fa30 Fix crash in GenericDrawTextSurface::drawChar() when a TTF is used with Unicode text 2016-03-15 15:10:56 -03:00
David Capello
cb4b4f8b4d Minor change don't use drawUIString() in FileList::onPaint() 2016-03-15 12:56:44 -03:00
Gabriel Rauter
90b1c243b0 Revert make use of aseprite thumbnail-generator"
Revert to basic native behavior.

This reverts commit b64ba236d3.
2016-03-15 14:32:05 +01:00
David Capello
8de92df6cc Minor fix to show text caret on ui::Entry when it's at the end 2016-03-14 16:52:44 -03:00
David Capello
eec2d64f57 Replace FreeTypeFont::height() impl 2016-03-14 12:40:28 -03:00
David Capello
69a1161f69 Fix Entry bugs handling the text caret
Added more checks and improve performance in Entry::setCaretPos()
2016-03-14 12:39:45 -03:00