Commit Graph

403 Commits

Author SHA1 Message Date
Fredrik Holmqvist 9edb207fab Fix for bug 6991, replace registrars timer tick
Registrar schedules an event every second to do
fRoster-CheckSanity(). This uses 2.5% cpu on my machine
when idle. Changing it to five seconds lowers it to 0.1%

waddlesplash then pointed me to this bug which changes it
to watch for team deletion and call fRoster->CheckSanity()

As I know little in this area, it's mostly based on what
LaunchDaemon does in MessageRecieved.

Change-Id: Ie69f9399cab41d2d492d469b5d3dc88e6080c15c
Reviewed-on: https://review.haiku-os.org/c/876
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-01-24 18:57:50 +00:00
Fredrik Holmqvist ffbedf6088 Revert "Fix for bug 6991, replace registrars timer tick"
Unintentional commit, still not used to gerrit things

This reverts commit a02e4534f5.
2019-01-16 21:17:48 +01:00
Fredrik Holmqvist a02e4534f5 Fix for bug 6991, replace registrars timer tick
Registrar schedules an event every second to do
fRoster-CheckSanity(). This uses 2.5% cpu on my machine
when idle. Changing it to five seconds lowers it to 0.1%

waddlesplash then pointed me to this bug which changes it
to watch for team deletion and call fRoster->CheckSanity()

As I know little in this area, it's mostly based on what
LaunchDaemon does in MessageRecieved.
2019-01-16 21:13:04 +01:00
Augustin Cavalier 5dd66afb7d headers: Remove some extra semicolons.
Spotted by Clang.
2018-12-09 23:00:47 -05:00
Jérôme Duval 630e3f1410 View: move BAffineTransform out of ViewSetStateInfo.
the size of BAffineTransform is architecture dependent, so we transmit
its contents in a standard array instead.

Change-Id: I907110742168846a869a48bb2d116cc5292ec7d0
2018-05-07 07:02:57 +00:00
Jérôme Duval 27bba9c3fe registrar: flat_app_info size was arch dependent.
copy each member of app_info instead.

Change-Id: Ica8d0a195b2dbaaf57d28f2fe2f7efd73c37b2c4
2018-05-05 09:30:08 +00:00
Axel Dörfler a77aa747ea launch_daemon: Added basic logging facility
* The daemon now stores many events in am internal log.
* You can use "launch_roster log" to retrieve it.
2018-04-25 10:10:43 +02:00
Axel Dörfler e96835a9a4 Added simple test_launch_daemon.
* Expects its config files in /boot/home/test_launch.
* Uses standard I/O, and is always in user mode.
* Also added test_launch_roster command that is able to talk to the test
  server like it does to the real thing.
2017-11-29 17:19:46 +01:00
Adrien Destugues 3a2b67b5ae Support for configuring screen backlight
Accelerant interface:
Introduce new hooks B_SET_BRIGHTNESS and B_GET_BRIGHTNESS. Brightness is
a float in the 0..1 range.

App_server:
Forward brightness things between BScreen and the accelerant.

intel_extreme:
Implement the hooks. Note that this only works for laptop panels, but
the driver will pretend to support it in other cases as well.

Screen preferences:
If the accelerant supports the B_GET_BRIGHTNESS hook, allow to set
brightness with a slider. Otherwise, the slidere is hidden and these
changes aren't visible.
2017-11-21 09:12:18 +01:00
dsizzle 9b6b158b88 Implementation of BFont::Blocks
BFont::Blocks is now implemented in ServerFont, via a call through the
app_server.  It uses fontconfig to iterate through a charset of a font
and stores the defined blocks in a bitmap.

A new API was added, BFont::IncludesBlock, that will allow for arbitrary
testing of a given Unicode block. Since nothing is cached, searching
through an entire charset for a series of Unicode blocks can be quite
slow. In a given block there may be only 1 or 2 characters actually
defined so every character within a block needs to be checked until one
is found, which in a degenerate case will mean the entire block is
checked.

Signed-off-by: Axel Dörfler <axeld@pinc-software.de>
2017-05-08 22:17:53 +02:00
Axel Dörfler 852e09d61f launch_daemon: Added stop target ability.
* Before, you had to stop each job by itself.
2016-11-29 23:14:36 +01:00
Janus 586734d609 Fixes Success/Failure colors in Appearance
* Fixes the mapping function index_to_color_which
* Fixes #13073
2016-11-14 19:47:29 +01:00
John Scipione 4c25397c41 AppMisc: correct param name in docs, silences warning 2016-04-27 11:10:33 -07:00
Augustin Cavalier 80bc632afd BStatusBar: Restore the old blue-ish color from before the Set*Color changes. 2016-03-07 16:08:00 -05:00
Axel Dörfler 90fd6af0b6 launch_daemon: Added ability to enable/disable a job.
* Instead of just starting/stopping it.
* Also available via the launch_roster command.
2016-01-12 16:22:47 +01:00
looncraz 7f9368cae5 Set*UIColor, etc.
The inseparable changes necessary to support live color updating across the
system in a sane, safe, and performant manner.

BView gains:

HasSystemColors()
HasDefaultColors()
AdoptSystemColors()
AdoptParentColors()
AdoptViewColor(BView*)
SetViewUIColor(color_which, float tint)
SetHighUIColor(...
SetLowUIColor(...
ViewUIColor(float* tint)
HighUIColor(...
LowUIColor(...
DelayedInvalidate()

BWindow gains a simple helper method:
IsOffscreenWindow()

BMessage gains:

AddColor()
FindColor()
GetColor()
HasColor()            * allegedly this API is deprecated, but I implemented it anyway
ReplaceColor()
SetColor()

Previous private ColorTools methods are made public and moved into GraphicsDefs:

mix_color, blend_color, disable_color

These are fully compatible with BeOS dan0 R5.1 methods and are just code cleanup
of BeOS example code under the OpenTracker license.

In addition, four new colors are created:
B_LINK_TEXT_COLOR
B_LINK_HOVER_COLOR
B_LINK_ACTIVE_COLOR
B_LINK_VISITED_COLOR

These changes are documented in their proper user documentation files.

In addition, due to a history rewrite, B_FOLLOW_LEFT_TOP has been defined and
used in lieu of B_FOLLOW_TOP | B_FOLLOW_LEFT and is included in this commit.

On the app_server side, the following has changed:

Add DelayedMessage - a system by which messages can be sent at a scheduled time,
and can also be merged according to set rules.  A single thread is used to service the
message queue and multiple recipients can be set for each message.
Desktop gains the ability to add message ports to a DelayedMessage so that
said messages can target either all applications or all windows, as needed.

Desktop maintains a BMessage which is used to queue up all pending color changes
and the delayed messaging system is used to enact these changes after a short
period of time has passed.  This prevents abuse and allows the system to merge
repeated set_ui_color events into one event for client applications, improving
performance drastically.

In addition, B_COLORS_UPDATED is sent to the BApplication, which forwards the message
to each BWindow.  This is done to improve performance over having the app_server
independently informing each window.

Decorator changes are live now, which required some reworking.

Signed-off-by: Augustin Cavalier <waddlesplash@gmail.com>
2016-01-04 06:48:22 -05:00
Axel Dörfler 9e73b62749 launch_daemon: Fixed preregister consequences.
* Since the last change, the user launch_daemon would talk to the
  registrar again.
* However, this also caused BRoster::Launch() to preregister the app,
  which messed up our preallocated port.
* BRoster::Private::Launch() now allows to get the port that the
  registrar created in such a case, and the launch_daemon will now just
  use that one as default port.
* This lets us talk to the Deskbar again, and should fix #12455, as
  well as #12454 (again).
2015-11-11 16:04:02 +01:00
Julian Harnath 25dbf74b8e BView: add methods for affine translation/scaling/rotation
* BView::TranslateBy(), BView::ScaleBy() and BView::RotateBy()
  allow to conveniently modify the current affine transformation.
  This makes it unnecessary to first read the current transform,
  modify it, and then set it again.
  Uses the new Pre...() methods of BAffineTransform.

* Also, remove setting the transform "through" to the BView even
  while recording a BPicture, as this now results in transforms
  being applied more than once.
2015-11-10 23:34:08 +01:00
Julian Harnath 4bd6f322bb app_server/Interface Kit: add new clipping API
* Add new clipping API for rectangles (ClipToRect, ClipToInverseRect)
  and shapes (ClipToShape, ClipToInverseShape)

* Works with affine transforms and automatically switches from fast
  region-based clipping to alpha-mask based clipping as necessary.

* Always self-intersecting, i.e. no state push required to further
  narrow down the clipping region. All of the 4 new methods can be
  mixed in any order.
2015-11-10 23:33:54 +01:00
Julian Harnath 6109a2086d Merge branch 'app_server'
Conflicts:
	src/kits/interface/PicturePlayer.cpp
	src/servers/app/ServerPicture.cpp

In addition, the following files were also adapted to master branch
BPicture changes during the merge:
	src/kits/interface/PicturePlayer.h
	src/servers/app/PictureBoundingBoxPlayer.cpp
2015-11-10 23:09:54 +01:00
Axel Dörfler 5860caae39 launch_daemon: Added basic ability to stop/start jobs via API.
* Stopping a job is very simplistic right now, and will have to be
  extended considerably, probably with its own job.
2015-11-07 21:58:12 +01:00
Axel Dörfler 3282b758b0 launch_daemon: Add API to get information on jobs.
* Ie. a listing of all targets/jobs, as well as specific (basic) info
  on each.
* Also added a bit of optional debug output.
* Moved translating the path to launch time -- we should take the job's
  environment into account here at some point.
2015-11-06 22:47:56 +01:00
Axel Dörfler 2e17b6504f BLaunchRoster::ResetStickyEvent() added.
* Used to unflag sticky events that already have been triggered once.
2015-10-25 14:41:17 +01:00
Axel Dörfler 7cd19b7e5c launch_daemon: Implemented sticky events, and registration.
* Sticky events are events that keep their signal raised, ie. even if
  a job is initialized afterwards, it will still be triggered.
* Consolidated naming for external events.
* Events are now registered once they are actually being used. This
  allows them to allocate the resources they need to do their thing.
2015-10-17 14:16:26 +02:00
Michael Lotz d64c7086d5 Various whitespace cleanup only. 2015-09-05 16:09:33 +02:00
Julian Harnath 71cc4d4998 Merge branch 'master' into app_server
Conflicts:
	src/kits/app/Roster.cpp
2015-09-01 20:07:21 +02:00
Michael Lotz 5b9f6b5485 BRoster: Add launchSuspended option to _LaunchApp().
It allows to launch the app, but keep its main thread suspended instead
of automatically resuming it.

Also add appThread argument which allows to retrieve the main thread of
the launched team.
2015-08-28 22:52:50 +02:00
Julian Harnath e3d7394869 app_server: fix test-app_server for launch_daemon changes
* Make test-app_server work again in a launch_daemon environment

* test_registrar gets a separate signature and port name again so the
  host system can distinguish it from the system registrar

* AppServer is normally a BServer now, however, there can't be two
  BApplications in one team. A class TestServerLoopAdapter is added,
  which becomes the base class of AppServer instead of BServer when
  compiling for libbe_test. It's an adapter class which looks towards
  AppServer as it if was a BServer, but internally it is derived from
  MessageLooper (like the old AppServer before the transition to
  BServer).

  This way, AppServer can stay a BServer in normal builds and it also
  avoids having to use too many #ifdefs to distinguish the two
  versions.
2015-08-23 01:00:32 +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
Axel Dörfler 326e03f721 BLaunchRoster: removed be_launch_roster again.
* Not implemented, an unused -- no need for a global instance.
2015-07-22 20:45:33 +02:00
Axel Dörfler d94e9c97d2 launch_daemon: Added support for external events.
* Other apps can register events, and the launch_daemon can act on them
  when they are triggered.
2015-07-22 20:45:24 +02:00
Axel Dörfler fb7dad2b49 BRoster: Added ability to pass env on launch.
* Added BRoster::Private::Launch() that adds an additional parameter
  to pass a pointer to the environment of the launched app.
2015-07-22 20:44:03 +02:00
Axel Dörfler 06e0f8079f registrar: Fixed app_server detection.
* This also fixes the shutdown process, as the registrar no longer
  kills the app_server.
* Removed SERVER_PORT_NAME definition as it has no use anymore.
2015-07-22 20:43:58 +02:00
Axel Dörfler 4c67f79c2c FirstBootPrompt: launch installer/desktop targets directly.
* No need for shell scripting here.
2015-07-22 20:43:44 +02:00
Axel Dörfler 560119c9a4 launch_daemon: Don't verify passwords.
* Instead, the caller should have done this already. This is really
  outside of the scope of the launch_daemon.
* Fixed Login with empty passwords; removed the (unused) test login
  feature along the way.
2015-07-22 20:43:22 +02:00
Axel Dörfler 78e39852fa launch_daemon: Use BRoster::Launch() without registrar.
* BRoster now allows settings a "no-registrar" mode that is currently
  only honored in _LaunchApp(), though.
* Job::Launch() is now using this, which also allows launching
  applications by signature (ie. if the job name matches the
  signature, you can omit the "launch" option).
2015-07-22 20:42:13 +02:00
Axel Dörfler c086a1834b launch_daemon: Improved target support.
* You can now put jobs/services into a target.
* Instead of having Login started as part of the normal boot process,
  it's now in the "login" target.
* The app_server now launches the login target when a login becomes
  available (ie. during startup, but that could be improved later on).
2015-07-22 20:41:51 +02:00
Axel Dörfler ac0a462fba launch_daemon: Basic user session implementation.
* Instead of launching Tracker/Deskbar directly, we now launch the
  Login application.
* This will now start a new session for the selected user (the password
  is currently ignored).
* When a user session is started, the launch_daemon forks, and the
  child then restarts the LaunchDaemon application in user mode.
* It then registers itself with its parent, in order to resolve user
  dependent services.
* Added a user launch file that will cause Tracker, and Deskbar to
  start in the new session.
2015-07-22 20:41:37 +02:00
Axel Dörfler bea38cb711 registrar: implemented auth port via launch_daemon.
* get_roster_port_name() is no longer needed.
* This also removes the app_server restart code from the debug
  server -- this will be done by the launch_daemon in the future.
2015-07-22 20:41:01 +02:00
Axel Dörfler 43aec2c726 launch_daemon: added support for arbitrary ports.
* Dropped "create_port" -- this is now the default for services.
* Additionally (or alternatively, if you use the "legacy" mode), you can
  now create named ports, and specify their capacity.
* Added convenience methods to BLaunchRoster that automatically use the
  signature of the current be_app.
2015-07-22 20:40:38 +02:00
Axel Dörfler 592ffe6461 The app_server is now a regular BServer. 2015-07-22 20:40:29 +02:00
Axel Dörfler d482c7ca5b launch_daemon: actually launch the jobs.
* BRoster::Launch() cannot be used (yet), as it pre-registers the
  application we're launching, and that won't work for the registrar or
  anything else until the registrar is up and running.
* Renamed B_GET_LAUNCH_CONNECTIONS to B_GET_LAUNCH_DATA.
* Add the team ID to the get-launch-data reply.
* Added BLaunchRoster::GetPort() for convenience.
* Removed some superfluous debug output, but temporarily dump all stdio
  to /dev/dprintf (ie. the syslog).
* Made job matching case insensitive (as MIME types should be).
2015-07-22 20:40:01 +02:00
Axel Dörfler 1480e5da6f The beginnings of a launch_daemon for Haiku.
* This will be heavily inspired by Apple's launchd, as well as
  systemd -- for now it really doesn't do a whole lot, though.
* What works so far: the configuration files are read, parsed, and
  the jobs created.
* The jobs are even initialized, and their message ports created.
* BApplication now retrieves a previously created port from the
  launch_daemon for use with BServer.
* Only the registrar actually uses this for now.
2015-07-22 20:39:47 +02:00
Axel Dörfler 8a86ad7593 libbe: Fixed current_team() to work after a fork.
* This allows to start a valid looper in the forked child, for example.
2015-06-12 10:43:15 +02:00
Axel Dörfler 5ce80a78c9 BMessage: implemented KMessage reply.
* When you receive a message from a KMessage, and reply to it,
  it will automatically reply as KMessage, too.
* This allows to communicate with BLoopers from within the kernel
  or libroot.so.
2015-05-13 23:06:51 +02:00
Axel Dörfler 4d50aa327c MessageAdapter: cleanup, no functional change. 2015-05-13 23:06:49 +02:00
Axel Dörfler 0690387cd2 BServer/BApplication: added constructor for looper name.
* Added an extra looperName argument to the private BApplication
  constructor that BServer is using.
* This is now used to fix the ugliness that gave the registrar
  a different looper name, and even saves a string comparison.
2015-03-26 21:47:24 +00:00
Ingo Weinhold 5c9672edeb Add watching support for installation location package changes
Can be requested/stopped via BPackageRoster::{Start,Stop}Watching().
The notification message has the what code B_PACKAGE_UPDATE and contains
fields "event", "location", and "change count".
2014-06-17 20:32:26 +02:00
Stephan Aßmus 244796701b app_server: store and restore fill rule...
...when sending the whole view state over the link.
Also inherit the fill rule when pushing states (DrawState
copy constructor). A somewhat sloppy oversight, I must add.
2014-03-17 22:55:47 +01:00
Adrien Destugues eb43166326 app_server & interface kit: support fill rules.
* BView gets SetFillRule/FillRule methods. The fill rule is part of the
view state.
* The B_NONZERO rule is the default. This is what we implemented before.
* The B_EVEN_ODD rule is the other common possibility for this, and
we need to support it to help WebKit to render properly.
2014-03-11 17:27:42 +01:00