163 Commits

Author SHA1 Message Date
David Capello
c38c784772 We don't have std::bind() available in Mac OS X SDK 10.4u 2014-09-04 09:07:23 -03:00
David Capello
eed23803a8 Fix base::move_file() for Unix-like systems 2014-08-24 09:00:55 -03:00
David Capello
035acf2670 Add tests for fs::make_directory/all_directories 2014-08-24 00:13:35 -03:00
David Capello
b3b33fbc3d Add base::move_file() function to rename/move files 2014-08-24 00:13:11 -03:00
David Capello
62c5bdbb8f Fix base::get_app_path() for Mac OS X 2014-08-23 23:54:27 -03:00
David Capello
622e966a8c Fix base::open_folder() for files in Mac OS X 2014-08-23 23:53:31 -03:00
David Capello
87857f5a95 Add base::make_all_directories function 2014-08-23 20:26:59 -03:00
David Capello
9135461627 Fix #455 - fix command line processing when the app is in a bundle 2014-08-22 09:36:40 -03:00
David Capello
e8d4388061 Add base::file_size() function 2014-08-22 01:12:12 -03:00
David Capello
5abcf7a296 Add missing virtual destructors 2014-08-17 20:42:55 -03:00
David Capello
76a26802e0 Fix tests compilation in clang 2014-08-17 20:40:10 -03:00
David Capello
a1912d38bd Avoid unused variable warnings when we compile in release mode 2014-08-17 20:33:32 -03:00
David Capello
9d675b6864 Use static_assert() 2014-08-15 00:24:59 -03:00
David Capello
dfc1ecd2da Use #pragma warning only in MSC compiler 2014-08-14 23:38:06 -03:00
David Capello
6824570c4b Remove base/override.h (use override keyword directly) 2014-08-14 23:07:47 -03:00
David Capello
918368b5a4 Add support to open folders in Mac OS X 2014-08-13 00:35:34 -03:00
David Capello
a9721b63a8 Undefine major/minor macros if they are defined (as in clang) for base::Version 2014-08-13 00:31:56 -03:00
David Capello
1f900eda26 Fix compilation error detected by clang 2014-08-13 00:22:48 -03:00
David Capello
dfaf097b88 Rename base/compiler_specific.h to base/override.h 2014-08-09 08:08:20 -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
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
738d6ec4ee Rename _unittest.cpp files to _tests.cpp 2014-06-28 10:49:38 -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
1d8d39fc13 Add support to modify observers list when we are inside a notification 2014-05-25 23:54:56 -03:00
David Capello
263f4b5479 Add flag to debug observers 2014-05-17 21:04:55 -03:00
David Capello
0cd9bf21f3 Fix memory leak detector for Windows with MSVC compiler 2014-05-02 23:03:40 -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
2e9751fef1 Rename base::file/directory_exists() to base::is_file/directory() 2014-04-17 17:12:55 -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
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
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
1ab782b85d Fix base::trim_string() algorithm for empty input 2014-04-12 14:29:37 -03:00
David Capello
78ce233756 Fix header of files distributed under the terms of the MIT license 2014-03-29 20:08:05 -03:00
David Capello
f4b2b47a2c Add #pragma once 2014-03-29 19:40:17 -03:00
David Capello
395be62b03 Fix issue #310 - crash on export sprite sheet
The timeline wasn't being added as a Document observer, so it wasn't
getting notifications about layers modifications. In this way the timeline
wasn't able to update its m_layers[] internal field and was accessing to
removed layers/invalid memory.
2014-03-29 16:31:39 -03:00
David Capello
45f0166508 Fix issue 366: Crash (uncaught exception) on closing application 2014-03-08 21:15:48 -03:00
David Capello
1b86d613bf Fix issue 360: Cannot save gif files
* SaveFile and SaveFileAs commands ask for removing read-only attribute
* Fixed base::open_file_descriptor_with_exception() to create new files
* Added internal base::Win32Exception
* Added unit tests for the creation of file descriptors
* Added base::delete_file, has_readonly_attr, remove_readonly_attr functions
2014-03-02 20:47:34 -03:00
David Capello
4b88e90dc6 Fix file_handle.cpp compilation error on Unix-like systems 2014-02-24 08:20:42 -03:00
David Capello
f2bdf38cc6 Fix bug loading/saving .gif files with Unicode file names 2014-02-17 21:43:20 -03:00
David Capello
6197054a3c Add base::to/from_utf8 impl for Unix-like platforms 2014-01-05 15:33:09 -03:00
David Capello
d5dbf72fca Fix license in some files of base library 2013-12-15 12:48:37 -03:00
David Capello
83ba85ff09 Fix get_app_path() impl for Linux and Mac OS X 2013-11-25 10:42:08 -03:00
Joel Madigan
dabcad1807 Add string::c_str() to several functions.
There were a number of places where a std::string was being used in a function calls that expected a c string.  These instances were trivally fixed by adding a call to string::c_str().

Note, I'm not sure if this is a GCC specific issue, however even if it is a case of MSVC simply letting these usages slide it can't hurt to be explicit.
2013-11-24 01:35:55 -05:00
David Capello
86dab97cac Fix for GCC in string.h 2013-11-23 19:01:28 -03:00
David Capello
e5ba8e0922 Encapsulate Image implementation (private members, accessors, iterators, etc.)
- Rename _rgba/_graya to raster::rgba()/graya()
- Add raster::color_t type (alias for uint32_t)
- Rename raster::GfxObj to Object. And GfxObj::getType() to Object::type()
- Move conversion from raster::Image/Palette to Allegro BITMAP/RGB
  to raster/conversion_alleg.h file
- Add raster/color_scales.h
- Rename image_* functions to raster/primitives.h
- Reimplement ink processing with templates instead of macros
2013-11-09 19:59:05 -03:00
David Capello
7657461162 Merge branch 'dev' of git@github.com:dacap/aseprite.git into dev 2013-10-14 20:06:00 -03:00
David Capello
5b252c30f5 Add support for Unicode file names on Windows
- Fixed issue #46: open .png files with Unicode chars
- Fixed issue #150: ability to uncompress program in folders w/Unicode chars
- Added base::utf8_iterator
- Added base::FileHandle
- Added base::get_app_path()
- Modified ui::KeyMessage::ascii() -> unicodeChar()
- Removed JI_NOTEXT flag
- Added app::XmlDocumentRef class and app::open_xml() function
- Added support for Unicode text exchange with Win32 clipboard
2013-10-14 19:58:11 -03:00
David Capello
5d0c25b0da Modify base::convert_to() undefined implementation
GCC shows divide-by-zero warnings, so it is better in this way.
2013-09-21 20:40:54 -03:00
David Capello
cde54f3682 Change BSD license to MIT in sublibraries and fix headers 2013-08-08 21:01:20 -03:00
David Capello
c88f9b172b Refactor: Move app files to src/app subdirectory inside app namespace
- Add HAVE_CONFIG_H wrapper to #include "config.h"
- Removed widgets namespace (it's in app now)
- Move some functions from src/file/file.h to src/base/cfile.h
- Move Vector2d to base library
- Rename MenuItem2 to AppMenuItem
2013-08-05 21:20:19 -03:00