62 Commits

Author SHA1 Message Date
David Capello
bf9994387d Add some gfx::Region operators 2016-01-04 17:48:56 -03:00
David Capello
1aaeacc460 Refactor several "getNoun()" getters to "noun()"
This is a work-in-progress to create a consistent API and finally
separate the whole Aseprite base/gfx/ui libs into a reusable C++ library.

Classes:
app::IFileItem, app::AppMenuItem, app::skin::SkinPart,
gfx::Rect, gfx::Border, she::FileDialog,
ui::IButtonIcon, ui::Graphics, ui::Overlay, ui::Widget,
ui::ScrollableViewDelegate, and UI events
2015-12-04 14:39:04 -03:00
David Capello
cf7c4754cc Convert InkShadesField in a combobox-like widget to store several shades (#85)
Changes:
* Added new ui::IconButton widget to create widgets with one skin icon
  that is colored depending on the button state.
* ContextBar::InkShadesField was divided into a couple widgets (ShadeWidget
  and IconButton to drop-down a little menu with saved shades)
* Fixed CommonLockedSurface::drawColoredRgbaSurface() impl.
* Removed invalid gfx::setr/g/b/a() functions.
2015-11-24 18:37:13 -03:00
David Capello
1bb0bca361 doc and gfx libraries depends on fixmath (fix #817) 2015-09-24 10:02:52 -03:00
David Capello
56de0fe989 Fix rotation in straight angle (fix #592) 2015-08-14 10:57:40 -03:00
David Capello
35229e99a6 Add opaque/transparent mode in context bar for transformations (fix #546)
With this change now we add a "mask" image/parameter in rotation
functions. In this way we can identify which specific pixels are
inside the original mask/selection, and in opaque mode we can
include/scale/rotate all those pixels inside the mask, whatever
value they are, even if they are the mask color.

Fixes #730
2015-07-23 22:42:14 -03:00
David Capello
55f90d8b8b Add target_link_libraries() for sublibraries
With this change we remove some internal variables/lists like sys_libs,
libs3rdparty, etc. And we fix dependencies problems between targets.
2015-07-13 12:16:55 -03:00
David Capello
adc4050201 Improve PixelsMovement::redrawCurrentMask() performance 2015-06-25 16:51:41 -03:00
David Capello
a2538628c7 Convert ui::Widget::border_width/child_spacing to private fields 2015-06-23 19:20:49 -03:00
David Capello
4d055a7170 Rename gfx::Rect::createIntersect -> createIntersection 2015-06-09 16:22:47 -03:00
David Capello
cea0970d9d Fix several bugs with tooltip arrows/location
The tooltip arrow is now aligned to the target. And the tooltip is
relocated to the other side if it intersects its target bounds.
2015-05-09 13:20:57 -03:00
David Capello
a37fd89404 Fix compilation problem in gfx::Rect with clang (related to #618 too) 2015-03-26 08:03:53 -03:00
David Capello
e3565946b4 Fix compilation of gfx::Rect on gcc 4.8.2 (part of #618) 2015-03-25 16:41:14 -03:00
David Capello
62b9f30f92 Add operator| and operator& to gfx::Rect 2015-03-19 10:10:29 -03:00
David Capello
f5e9d3fe15 Add gfx::Rect::inflate(int) member function 2015-03-19 10:10:06 -03:00
David Capello
b23194dfae Fix several warnings in MSVC, clang, and gcc 2015-03-05 15:19:00 -03:00
David Capello
7da6f3e857 Minor changes to some #include header files 2015-03-05 12:40:47 -03:00
David Capello
2c7fe41d6d Fix minor problems with clang 2015-03-04 22:57:55 -03:00
David Capello
ad856b2a55 Use std:: when necessary, and std::numeric_limits instead of INT_MAX 2015-03-04 21:35:11 -03:00
David Capello
da1358c5dc Unify all render code in one library
Changes:
* Create render library (move util/render.cpp to render/render.cpp)
* Move app::Zoom class to render::Zoom
* Remove doc::Image::merge() member function
* Add gfx::Clip helper class (to clip dst/src rectangles before a blit)
* Move doc::composite_image() to render::composite_image()
* Remove doc::Sprite::render()
* Replace Sprite::getPixel() with render::get_sprite_pixel()
* Remove doc::layer_render() function
* Convert DitheringMethod to a enum class
* Add AppRender to configure a render::Render with the app configuration
* Move checked background preferences as document-specific configuration
* Add doc::Sprite::layer() and palette() member functions
* Add doc::Layer::cel() member function
* Add doc::Palette::entry() member function()
* Add doc::frame_t type
* Move create_palette_from_rgb/convert_pixel_format to render library
* ExportSpriteSheet doesn't need a temporary image now that we can specify
  the source rectangle in the render routine
2014-12-28 11:06:11 -03:00
David Capello
c0d35b16e0 Add gfx::PackingRects class for packing multiple rectangles in a texture 2014-11-07 10:32:14 -03:00
David Capello
9df732e27b Add gfx/rect_io.h 2014-11-07 10:30:02 -03:00
David Capello
24e0939ad2 Add static_assert() to check that Pixman constants match gfx::Region::Overlap 2014-11-07 10:29:17 -03:00
David Capello
ec99866a23 Fix region_tests compilation (as now it depends on pixman library) 2014-10-29 10:37:44 -03:00
David Capello
0cf597c0f4 Add dependency with pixman library 2014-10-25 22:22:58 -03:00
David Capello
7080d0fa83 Fix uninitialize variable warning 2014-08-17 20:42:12 -03:00
David Capello
76a26802e0 Fix tests compilation in clang 2014-08-17 20:40:10 -03:00
David Capello
5075c1f86f Remove unused variables/code 2014-08-17 20:37:12 -03:00
David Capello
f5b5250482 Remove use of "register" modifier (it's deprecated) 2014-08-14 23:26:52 -03:00
David Capello
df3c16b802 Add more options to export sprite sheet (e.g. best fit for texture) 2014-08-11 11:33:17 -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
738d6ec4ee Rename _unittest.cpp files to _tests.cpp 2014-06-28 10:49:38 -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
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
David Capello
a66d24d631 Fix compilation errors with G++ 2013-03-27 23:11:29 -03:00
David Capello
e0f6b2fed4 Fix warning in msvc11 (UINT32_MAX is already defined) 2013-01-16 21:59:05 -03:00
David Capello
6332b1a6e5 Add gfx::Region class
This class will be used to replace JRegion in ui lib.
2013-01-13 21:49:17 -03:00
David Capello
0496f38ed3 Fix a typo in all files distributed under BSD-like and Allegro licenses
Thanks to Tobias Hansen.
2012-09-23 23:24:43 -03:00
David Capello
95a9524ec2 Avoid duplicated code to flip the image.
- Added raster::algorithm::FlipType enum and flip_image function.
- Added gfx/fwd.h for forward declarations.
2012-02-19 16:25:07 -03:00
David Capello
b8fbaad7fb Replace Allegro Sprite Editor or ASE with ASEPRITE in all files. 2012-01-06 01:12:57 -03:00
David Capello
02a9d50524 Update copyright year to 2012. 2012-01-06 00:52:11 -03:00
David Capello
ed6090bc36 Convert all newline to LF style and remove all tabs.
This was done to avoid mixed files (CRLF & LF) in the repository.
2012-01-05 19:45:03 -03:00
David Capello
ea3570796a Fix errors detected with gcc. 2012-01-01 23:37:32 -03:00
David Capello
07edcdb1e2 Add transformation support (scale/rotate) to the selected area.
+ Added support to rotate images of IMAGE_BITMAP type.
+ Added transformation_handle & pivot_handle parts in sheet.png.
+ Added rotation cursors in sheet.png.
+ Added gfx::Transformation class and Document::m_transformation field.
+ Added StandbyState::Decorator and TransformHandles class to draw
  transformation handles.
+ Modified PixelsMovement class to support transformation handles.
+ Added new Linear Algebra library with Vector2d class.
2012-01-01 23:08:25 -03:00
David Capello
181c75bb93 Convert Point/Size/Rect/Border in PointT/SizeT/RectT/BorderT templates. 2012-01-01 14:37:03 -03:00
David Capello
344faeff00 Add Border(int) constructor. 2011-02-20 20:25:57 -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
a7ea661ad0 Overload gfx::Border class operators to increment/decrement border size. 2011-01-30 23:18:52 -03:00