54209 Commits

Author SHA1 Message Date
Julian Harnath
3d12d3a832 app_server: special handling for opaque/invisible layers
* Opaque layers (opacity = 255) don't need to use an intermediate
  bitmap (and everything that comes with it) for drawing at all,
  they can just directly draw onto the underlying canvas or layer.
  (WebKit likes to use plenty of opaque layers)

* Invisible layers (opacity = 0) can simply be ignored.
2015-08-03 18:50:58 +02:00
Julian Harnath
d727d0743b app_server: fix clearing user clipping from BPicture
* Clipping was set to an empty region instead of being cleared
  when inside a BPicture
2015-07-31 21:02:50 +02:00
Julian Harnath
551438b9be app_server: add new BView layers API
* Add new methods
    BView::BeginLayer(uint8 opacity)
    BView::EndLayer()

* All drawing between begin and end of a layer is redirected onto an
  intermediate bitmap. When ending the layer, this bitmap is
  composited onto the view with the opacity given when the layer was
  started.

* Layers can be nested arbitrarily and will be blended onto each
  other in order. There can also be any arbitrary interleaving of
  layer begin/end and drawing operations.

* Internally, drawing commands are redirected into a BPicture between
  BeginLayer and EndLayer (but client code need not know or care
  about this). Client code can also start/end other BPictures while
  inside a layer.

* Uses the PictureBoundingBoxPlayer to determine the size of the
  layer bitmap before allocating and drawing into it, so it does not
  allocate more memory than necessary and -- more importantly -- it
  will not alpha-composite more pixels than necessary.

* Drawing mode is always set to B_OP_ALPHA, blend mode to
  (B_PIXEL_ALPHA, B_ALPHA_COMPOSITE) while inside layers. This is
  necessary for (a) correct compositing output and (b) for
  redirection of drawing into the intermediate bitmap, which uses the
  renderer_region offset (in B_OP_COPY, the Painter does not use the
  AGG renderer methods, it directly accesses the pixel data. This
  would access out-of-bounds without the offset, so B_OP_COPY cannot
  be allowed.)
  To ensure these modes aren't changed, BView::SetDrawingMode()
  and BView::SetBlendingMode() are ignored while inside a layer.

* The main motivation behind this new API is WebKit, which internally
  expects such a layers functionality to be present. A performant and
  reusable implementation of this functionality can only be done
  server-side in app_server.
2015-07-25 16:35:52 +02:00
Julian Harnath
d56beda4d8 app_server: optional coordinate shifting in renderer_region
* agg::renderer_region gets an extra feature which allows to
  optionally shift the coordinates by a specified offset.

* This allows to shift coordinates at the lowest level, even below
  the transformations done by BAffineTransform (which happen in the
  painter, right before rasterization).

  Needed for layers support: shifts the origin of the layer bitmaps
  to their position in the view while keeping all transformations
  (BView origin/scale transforms as well as BAffineTransforms)
  intact. The offset for the layer bitmaps within their parent view
  is determined by the bounding box and is then fixed, it must not
  be altered while the layer's BPicture is played into the bitmap.

  If this offset were added to the BView origin or as translation in
  the BAffineTransform, it would be further transformed by the BView
  scale or the other affine transform parameters. Thus, we need
  another low-level offset mechanism which is even below
  BAffineTransform's transformations.
2015-07-25 16:31:20 +02:00
Julian Harnath
cd621b9585 app_server: add method to shift alpha masks
* Allow shifting the offset of alpha masks without changing the size.
  Ideally, we only need to reattach the buffer in the shifted
  position, saving the work of reallocating and redrawing the mask
  picture. Needed for layers support.
2015-07-25 16:31:20 +02:00
Julian Harnath
6ac468ef24 app_server: add support for uniform opacity alpha masks
* Another constructor for AlphaMask allows creating a mask with no
  picture, it will simply be a single uniform alpha value over the
  whole mask.

* No need to even allocate a buffer in this case, we can just use
  the feature of clipped_alpha_mask to define an opacity for outside
  the mask, and set the buffer size to zero.
2015-07-25 16:31:20 +02:00
Julian Harnath
edc0b5e9db app_server: allow disabling affine transforms in DrawState
* New method DrawState::SetTransformEnabled allows to temporarily
  disable all BAffineTransforms in the state stack (up to 'this').
  Later, the same method can be used to reenable the transforms.

  Needed for layers support: when drawing the finished layer bitmap
  onto the view, the affine transforms must not be applied again --
  they have already been applied while drawing the bitmap's contents.
2015-07-25 16:31:20 +02:00
Julian Harnath
65a54d2892 app_server: implement setting BAffineTransforms in BPicture
* Add a simple callback for the picture command
2015-07-25 16:31:20 +02:00
Julian Harnath
b5c7f936de app_server: allow replacing the DrawState in a Canvas
* Needed for layers support. The previously set DrawState and its
  stack predecessors are not freed, so take care to not leak memory
  when using this.
2015-07-25 16:31:20 +02:00
Julian Harnath
c34cbf2878 app_server: fix PicturePlayer dummy function table
* With the support for BAffineTransform, it needs to have 49 entries
2015-07-25 16:31:20 +02:00
Julian Harnath
ae0468762f app_server: add Canvas::PenToLocalTransform 2015-07-25 16:31:20 +02:00
Julian Harnath
8511f6ac9b app_server: fix ServerPicture::SyncState pen size
* Should use the unscaled pen size here because we also write down
  the current scale, and we don't want to scale the pen twice.
2015-07-25 16:31:20 +02:00
Julian Harnath
1b4dba929d app_server: add picture player for determining bounding box
* Add PictureBoundingBoxPlayer, a new player for BPictures. Instead
  of drawing the picture, it determines an approximate bounding box
  of its contained drawing operations.

* To increase performance, the resulting bounding box is an
  approximation: it guarantees to always enclose all pixels of the
  picture, however not necessarily tightly.

* PictureBoundingBoxPlayer::Play() gets a DrawState which is the
  initial state used when playing the picture. The player does not
  modify this state (it uses a copy internally), so the method is
  idempotent.
2015-07-25 16:31:20 +02:00
Julian Harnath
ccaee9e818 app_server: add Squash method in DrawState
* New method DrawState::Squash() uses the combined scale, origin and
  transform as the state's own scale, origin, transform.

  This can be used when making copies of DrawStates which have
  previous states below them in the state stack. The top of stack
  DrawState can be copied, squashed and then used just like the
  original one with the whole stack below it (except of course
  when trying to pop off any earlier state).
2015-07-25 16:31:19 +02:00
Julian Harnath
ad53a0d999 app_server: add unit test add-on, test for SimpleTransform
* app_server currently does not have any real unit tests, making
  changes more difficult and riskier. A new directory unit_tests with
  a test add-on is added in app_server's tetsts directory to hold
  future unit tests.

* Add test for SimpleTransform class
2015-07-25 16:31:19 +02:00
Julian Harnath
6f2a446e2e app_server: extract coordinate conversion class
* Move coordinate conversion into a new class SimpleTransform. It
  supports scaling and translation which is sufficient for conversion
  between screen, local and pen (drawing) coordinates.

* Because all the overloaded methods for converting
  BPoint/BRect/BRegion/etc are now within the single SimpleTransform
  class, the interfaces of Canvas, View, DrawState, etc. are slimmed
  down. These classes have too many responsibilities, so some will be
  factored out into separate classes, this being the first.
2015-07-25 16:31:19 +02:00
Julian Harnath
ab1bd2fd07 app_server: rename DrawingContext to Canvas
* Better reflects the purpose of the class: an interface for things
  in which we can draw (e.g. a View)

* Accordingly rename OffscreenContext to OffscreenCanvas
2015-07-25 16:30:29 +02:00
autonielx
5d8a237146 Update translations from Pootle hrev49453 2015-07-25 06:38:39 +02:00
Rene Gollent
3bb17aa98a Debugger: Minor refactoring.
VariablesView:
- Factor out setting up a variable edit request into a helper function.
Adjust table node invocation accordingly.
- Add Edit variable context menu item if appropriate.
hrev49452
2015-07-24 23:38:04 -04:00
Rene Gollent
af92957fd9 Debugger: Minor tweak to enumeration editor.
- Don't return result of SelectOptionFor(). It's possible to attempt
to edit an enum value that hasn't yet been initialized, in which case
its current value might not map to any of the defined enumerations, and
the resulting error would prevent editing from being allowed.
2015-07-24 23:37:50 -04:00
Rene Gollent
410b38b5c5 libroot: Fix strto{i,u}max.
- According to POSIX, these functions should map to whatever's appropriate
  for the platform's intmax_t size, which in our case is a 64-bit integer.
  Our (2004) implementation, however, was calling the 32-bit variations of
  strto*(), leading to truncation for larger values.
hrev49451
2015-07-24 21:57:11 -04:00
Rene Gollent
f5d564a1d3 Debugger: Implement float value editor.
FloatValueFormatter:
- Implement parsing/validation hooks.

FloatValueHandler:
- Implement GetTableCellValueEditor() to accordingly return a
  (newly implemented) TableCellFloatEditor. This allows variable
  value editing for float/double variables.
hrev49450
2015-07-24 19:22:08 -04:00
Rene Gollent
5c5c25163d Debugger: Tweaks for float values.
FloatValue:
- Store value as variant rather than double so as to be able to
  later differentiate between float vs double.

PrimitiveValueNode:
- Construct float nodes with variant value.
2015-07-24 19:20:52 -04:00
Rene Gollent
d88d941c90 Debugger: Finish variable edit support.
VariablesView:
- Intercept table node invocations. If the invocation corresponds to
  a writable variable, request a corresponding editor and bring up a
  an edit window for it.
- Handle requests from the edit window to write the final updated value
  of the variable.

This implements the last missing piece for ticket #9708, except for an
editor for floats.
hrev49449
2015-07-24 17:09:08 -04:00
Rene Gollent
473b2c6ac9 Debugger: Add VariablesView listener hook.
VariablesView::Listener:
- Add hook for requesting value node value updates.

TeamWindow:
- Implement VariablesView listener hook and forward accordingly to
  TeamDebugger.
2015-07-24 17:08:53 -04:00
Rene Gollent
7d25ab995d Debugger: Add hook for variable value writing.
WriteValueNodeJob:
- Implement async job that creates a ValueWriter to update a variable
  value on request.

UserInterfaceListener:
- Add hook for requesting that a node be updated with a new value.
  Implement in TeamDebugger by scheduling a WriteValueNodeJob.
2015-07-24 17:08:53 -04:00
Rene Gollent
9b0d97576d Debugger: Add variable editing utility window.
VariableEditWindow:
- Implement container window for variable value editors. While
  not as ideal as initially intended, this will handle presenting value
  editing to the user until more work is done on the table cell editing
  aspect of things.
2015-07-24 17:08:52 -04:00
Rene Gollent
55d4f9ff18 Debugger: Implement value editor hook for more handlers.
{Bool,Enumeration}ValueHandler:
- Implement GetTableCellValueEditor() hook.
2015-07-24 17:08:52 -04:00
Rene Gollent
1f3db0d0d6 Debugger: Flesh out option-based value editors.
TableCellOptionPopUpEditor:
- Add virtual hook for retrieving the final selected value. Implement
  accordingly in Bool and Enumeration editor subclasses.
- Implement calling the edit completion hook upon value changes.
2015-07-24 17:08:51 -04:00
Rene Gollent
1f8d1f68ce Debugger: Slight tweak to text control editor.
- Trigger a caller update on modification as well.
2015-07-24 17:08:50 -04:00
Dario Casalinuovo
2303600a81 TimedEventQueuePrivate: Remove debugger call hrev49448 2015-07-24 20:44:24 +02:00
Dario Casalinuovo
6d2f2ec177 Rework nodes to call Run() only after registration
* While it should not be a big problem the
  bebook specify to do it after custom operations,
  most nodes also follow this way, this commit restore
  consistency.
2015-07-24 20:09:15 +02:00
Dario Casalinuovo
d009f28613 media_kit: Fix style as suggested in ml 2015-07-24 20:09:08 +02:00
Axel Dörfler
3108062744 Added PostInstallScript to the image.
* Somehow it didn't make it.
* This fixes the last part of #12227.
hrev49447
2015-07-24 19:45:38 +02:00
Axel Dörfler
5e541a6042 launch_daemon: Added /system/data/user_launch directory.
* This directory is for services that are launched per user (in a user
  context), but installed globally.
* This is now used for the default "user" configuration; before this was
  put into ~/config/non-packaged/data/launch, which didn't really fit,
  and has the huge disadvantage that it cannot be updated.
* Fixes part of #12227.
hrev49446
2015-07-24 17:25:13 +02:00
Dario Casalinuovo
4a99aae9e4 media_server: Check BMessenger validity
* Check BMessenger::IsValid on the instance
  used to query the nodes so that crashed
  teams are identified as soon as possible.
hrev49445
2015-07-24 12:19:35 +02:00
Dario Casalinuovo
61a59e87d8 MediaPlayer: add new media services notification service 2015-07-24 12:19:34 +02:00
Dario Casalinuovo
733709121a media_server: watch for media services status
* It's now calling CleanupDormantInfos when
  media_addon_server die.
2015-07-24 12:19:34 +02:00
Dario Casalinuovo
b43b20d38f Media: Add support for media services notifications 2015-07-24 12:19:34 +02:00
Dario Casalinuovo
92ab0a8c3a VolumeControl: Add support for media services notifications 2015-07-24 12:19:33 +02:00
Dario Casalinuovo
32afe10ab2 BMediaRoster: Add B_MEDIA_SERVER_STARTED and B_MEDIA_SERVER_QUIT
* This is done by watching to registrar notifications
  and providing a minimal service to contact the
  media roster in private API. The roster use this
  service to automatically reconnect to the media_server.
2015-07-24 12:19:33 +02:00
Dario Casalinuovo
e57acc3a99 BMediaRoster: Fix initialization and destruction
* Improve consistency by adding a BMediaRosterEx destructor
  and using it for the specular functionality of ctor instead
  to use the father's class destructor.
* Avoid double initialization of MediaInitializer that
  becomes MediaRosterUndertaker.
* Remove superfluos call to BMediaRoster::Quit()
  in media_addon_server.
2015-07-24 12:19:32 +02:00
Dario Casalinuovo
6cd18b575c BMediaRosterEx: cleanup and fix style in the header 2015-07-24 12:19:32 +02:00
Dario Casalinuovo
41f5b3fc35 launch_media_server: correctly handle media services start
* Handle when the media_addon_server is not
  running.
* Fix #5621.
2015-07-24 12:19:31 +02:00
Dario Casalinuovo
67483edabd Add BMediaRoster::IsRunning
* This function is provided to check
  if media services are running.
2015-07-24 12:19:31 +02:00
Axel Dörfler
239f85731e libbe: ui_color() now works without UI connection.
* Since the app_server is a BApplication, too, now, Workspaces would
  trigger this problem.
* Now it checks whether the shared memory is actually set, and only
  uses it in this case. This will also fix using ui_color() in any
  BServer without UI connection.
hrev49444
2015-07-24 12:15:53 +02:00
Humdinger
4fbe048e4c Update cdrtools to cdrtools-3.01~a30-1.
gcc2 only. gcc4 build fails. x86_64 has strangely a policy error.
hrev49443
2015-07-24 06:51:08 +02:00
Augustin Cavalier
00ac71aa79 Fix build after DVB removal.
Apparently, the files were included in the image.
hrev49442
2015-07-23 15:45:15 -04:00
Augustin Cavalier
10f255b925 data/artwork/icons: Tweaks/fixes.
Re-centering, fix clipped edges, etc.
hrev49441
2015-07-23 15:37:26 -04:00
Augustin Cavalier
bfa8608fa7 dvb channels: Delete from tree.
Not included in the build, and this is isn't the place for such datafiles.
TV channels in Germany have probably changed since 2007 anyway.
hrev49440
2015-07-23 15:16:33 -04:00