Commit Graph

51 Commits

Author SHA1 Message Date
David Capello 881667f01b Replaced app::skin::ThemeColor with app::gen::SkinTheme::Colors
Generate app::gen::SkinFile class from skin.xml to automate creation
of ID references.
2015-02-15 15:29:16 -03:00
David Capello f3974002d5 Fix int <-> double <-> float casts
It looks like allegro includes several implicit conversions between
float and double.
2015-02-14 22:37:56 -03:00
David Capello 2c6067f7e4 Update license of app/ module to GPLv2 2015-02-12 12:16:25 -03:00
David Capello 22f35ab249 Independent scroll/zoom in Preview window (part of issue #407) 2015-02-10 12:59:43 -03:00
David Capello 15c6ee9046 Remove old layer icons from skin sprite sheet 2015-01-18 22:45:58 -03:00
David Capello ca9df1a05e Rename ui::jguiscale() to ui::guiscale()
* Change Theme::guiscale member to Theme::m_guiscale
2014-11-25 22:33:45 -03:00
David Capello d9ed3c2348 Rename jmouse_[gs]et_cursor() to ui::[gs]et_mouse_cursor() 2014-11-25 21:30:56 -03:00
David Capello 5e2cefe212 Merge branch '1.0'
Conflicts:
	src/app/commands/cmd_sprite_size.cpp
	src/app/document_exporter.cpp
2014-11-07 19:30:39 -03:00
David Capello dc29942384 Fix SkinTheme::paintMenuItem() for non AppMenuItem items (e.g. app::NotificationItem) 2014-11-06 18:41:18 -03:00
David Capello 39b8e034b5 Merge branch '1.0'
Conflicts:
	.gitmodules
	CMakeLists.txt
	src/CMakeLists.txt
	src/app/app.h
	src/app/app_menus.cpp
	src/app/commands/cmd_move_mask.cpp
	src/app/commands/cmd_rotate.cpp
	src/app/modules/gui.cpp
	src/doc/resize_image_tests.cpp
	src/ui/accelerator.cpp
	third_party/CMakeLists.txt
2014-10-30 01:06:27 -03:00
David Capello f939ef5f02 Add keyboard shortcuts customization (close #253)
Changes:
* Add KeyboardShortcutsCommand and window
* Add SelectAccelerator window
* Replace modules/gui.cpp functions with app::KeyboardShortcuts and
  app::Key with the logic to load/save/handle keyboard shortcuts
* Change ui::Accelerator concept: now it represent just one keyboard
  shortcut, not a set of shortcuts
* Remove ui::Accelerator from ui::MenuItem, now the key is associated
  in app::AppMenuItem and it's a app::Key
* Add Command::onGetFriendlyName() to get a user friendly name of the
  command depending on its parameters
2014-10-29 11:58:03 -03:00
David Capello 5d3d96d2d9 Minor changes: remove unnecessary dependencies with allegro.h 2014-09-21 11:59:39 -03:00
David Capello d14a0fe075 Add "Size" options in CanvasSizeCommand to specify width/height
- Added canvas icons to change the expansion direction in CanvasSizeCommand
- Added Widget::at() and Widget::offerCapture() member functions
- Improved ButtonSet widget
2014-09-08 02:27:41 -03:00
David Capello 5075c1f86f Remove unused variables/code 2014-08-17 20:37:12 -03:00
David Capello 6824570c4b Remove base/override.h (use override keyword directly) 2014-08-14 23:07:47 -03:00
David Capello 1c324c9b14 Add experimental option to use native mouse cursors (and some renames of cursor names) 2014-08-10 19:51:14 -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 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 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 c639b4dba3 Add "dots" freehand algorithm (change to ButtonSet the selection of FreehandAlgorithm) 2014-06-15 04:14:53 -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 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 e266089368 Make IntersectClip non-copyable 2014-05-04 21:51:52 -03:00
David Capello 6414e37f9a Use IntersectClip when possible 2014-05-04 16:59:11 -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 4ea41e1024 Fix problem rendering underlined characters 2014-04-26 16:19:05 -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 5d824512c2 Fix SkinTheme::paintMenuItem() painting code 2014-04-25 08:59:00 -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 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 7989cd81bb Avoid drawing text over widget borders in SkinTheme::drawTextString() 2014-04-17 16:24:04 -03:00
David Capello 8ae3b3075d Simplify ResourceFinder API 2014-04-12 13:35:55 -03:00
David Capello 04f3c522ba Replace jwidget_get_text_length/height with Widget::getTextWidth/Height
Renamed Widget::getTextSize to Widget::getTextLength as now getTextSize
returns a gfx::Size() (not the strlen() of the text)
2014-03-21 19:45:35 -03:00
David Capello 04a0845a62 SkinTheme: paint windows using styles 2014-03-21 00:28:01 -03:00
David Capello eee1719109 Implemented issue 260: Scroll-bars for sprite editor 2014-01-26 13:28:11 -03:00
David Capello 9423b967ab Change selection behavior: left-click replace the selection
With this patch we replace the "unique/odd" behavior of Aseprite where
you add selection regions with left-click and remove with right-click.
Now by default you replace the selection with left-click (as in regular
gfx programs). Also you can change the selection tool behavior with
buttons/icons at the context bar (to select between replace/add/subtract).
2014-01-25 17:58:29 -03:00
David Capello f8e8657093 Move kPaintMessage code to onPaint() event for some widgets
The affected widgets are: ColorBar::ScrollableView, ColorButton, and
StatusBar.

* Added Graphics::drawLine()
* Moved rectgrid and draw_color to modules/gfx.cpp
2013-12-29 21:12:23 -03:00
David Capello ccb24cad35 Timeline: fix minor details in padding drawing code 2013-12-15 17:49:46 -03:00
David Capello 4e917fc81c Add padding to text style 2013-12-11 01:35:40 -03:00
David Capello 4bd4aac429 Add styles to the Timeline widget
- Added support for styles to SkinTheme and skin.xml.
- Added app::skin::Style/Rule/BackgroundRule/IconRule/TextRule classes.
- Added app::skin::SkinPart class to refer to one part (BITMAP) of
  the skin sheet.
- Renamed app::skin::SkinPart to SkinParts as now SkinPart is a class.
2013-12-11 00:34:16 -03:00
David Capello e0a28c1d46 Minor refactor in skin properties
- Add get_skin_property(ui::Widget*) function to avoid duplicating code
  to create a SkinProperty.
- A SkinSliderProperty is not a SkinProperty: now it has its own name.
2013-12-05 01:19:46 -03:00
David Capello dbf4d0d490 Replace JRect/jrect struct with gfx::Rect
- Replaced Widget::rc -> Widget::m_bounds private member.
- Added Widget::offsetWidgets() method.
- Removed View::displaceWidgets().
2013-10-26 12:50:55 -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 cde54f3682 Change BSD license to MIT in sublibraries and fix headers 2013-08-08 21:01:20 -03:00