Commit Graph

5275 Commits

Author SHA1 Message Date
Dario Casalinuovo
2a2e352a4a BMediaRecorder: Rework to allow external connections
* This required to review various parts of the code, and
isn't probably still perfect. The main problem was an attributes
hell where redondance created a lot of problems, all this data
is now controlled mostly by the node.
* Header indentation changes needed too.
2016-02-09 13:33:09 +01:00
Rudolf Cornelissen
0fa7d5c4df VIA gfx driver: overlay engine on K8M800 responds now, wip. 2016-01-23 23:46:22 +01:00
Axel Dörfler
618cc43b64 IMAP: New folders will now adopt default mail attributes.
* Added a function CopyMailFolderAttributes() that copies the attribute
  layout from the text/x-email default query folder.
* This using the new CopyAttributes() method in libshared that is pretty
  much a copy of a similar method from copyattr. However, I did not
  replace the latter, as that one allows for more fine grained error
  reporting (and attribute filtering).
* Closes ticket #3498.
2016-01-14 21:00:38 +01:00
Rudolf Cornelissen
14de50bad7 VIA gfx driver:K8M800 now works (fixed PLL), fixed info in GetDeviceInfo 2016-01-13 01:01:32 +01: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
f9f16ddb2c BAbstractSpinner Colors
Adopted parent colors for the text view - should not have done so.
Disabled colors were incorrect, so I also corrected those in this patch.

Fixes #12574.

Signed-off-by: Jessica Hamilton <jessica.l.hamilton@gmail.com>
2016-01-10 18:51:04 +13:00
Augustin Cavalier
1d11475790 BAboutWindow: Put the AboutView and StripeView into BPrivate.
To avoid name clashes. Possibly fixes the HaikuDepot crashes.
2016-01-06 15:08:34 -05:00
Rudolf Cornelissen
b0c69e8490 nVidia driver: added option to block EDID resolution restrictions (check_edid) 2016-01-05 23:49:00 +01:00
RudolfC
063436816d nVidia driver: Added basic dualhead support for native Haiku ScreenPrefs app 2016-01-04 22:17:48 +00: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
Augustin Cavalier
485f533935 RWLocker: Move to kits/shared.
As requested by looncraz. A lot of stuff in IOM/MediaPlayer's
'support' directories probably should be moved to 'shared' anyway.
2015-12-15 21:15:06 -05:00
Dario Casalinuovo
2b51499295 Initial implementation of BMediaEncoder
* People interested, please review!
* This is based on the patch from Fredrik Moden which was based on
the Oleg Krysenkov one.
* The original patch has been reworked by myself.
* Adapted the code to work with the new PluginManager API which
differently than before doesn't need to contact the media_server.
2015-12-02 16:08:06 +01:00
Dario Casalinuovo
67060664c9 Allow BMediaRoster to log local nodes
* BMediaRoster is now capable to know which nodes are
instantiated in this team. This is also a first step to make
them survive after media_server crashes.
* A control at BMediaRoster::Quit can notify if all nodes
were correctly released. Ideally at this point the local nodes
list should be empty.
2015-11-28 16:35:04 +01:00
Julian Harnath
b54b3ae511 app_server: add a cache for AlphaMasks
* If the same shape alpha mask is set again and again, we now keep
  the rendered masks in a cache. On certain websites, WebKit sets
  the same shape for clipping hundreds of times, which uses a lot
  of time to render the masks.

* When a shape mask was generated, we put it into AlphaMaskCache.
  The constructor for ShapeAlphaMask is made private and a factory
  method is used for instantiation instead, which transparently
  looks up in the cache whether a suitable mask was already generated
  before (so the entire caching is encapsulated inside the AlphaMask
  class).

* When taking a mask out of the cache, we still create a new
  AlphaMask instance. However, the new instance will share the
  mask bitmap with the previously generated instance (aside from
  the rendering of their bitmap, AlphaMask instances are pretty
  lightweight). Shape masks are only seen as identical when
  their shape is the same, the inverse flag, and they have the
  same parent mask.

* Cache is limited to a fixed size of currently 8 MiB, using a
  simple random replacement scheme. An LRU scheme can be added in
  the future if necessary. Counting of bytes for the cache size
  includes parent masks of masks in the cache, even if the parent
  itself is not cached. A reference counter for "indirect" cache
  references keeps track of which masks are not part of the cache,
  but still need to be added to the cache byte size.

* For now, only for ShapeAlphaMasks, other mask types can be added
  as necessary.
2015-11-14 16:09:52 +01: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
ab12093685 BShape: move bounding box method to shape_data
* Makes it easier to get the bounding box from inside app_server
2015-11-10 23:12:30 +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
93c0a5d790 Reworked little endian bitfields a bit.
* Added B_ prefix.
* Renamed 16 bit variants to B_LENDIAN16_*.
* Added 32 bit variants (albeit only 16 of them for now).
* Adjusted headers that were using them.
2015-11-10 08:47:48 +01:00
Jérôme Duval
7ccbb2f03f Add operator delete(void *, size_t) for C++14. 2015-11-08 00:38:20 +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
Jonathan Schleifer
617793f41b Add back declarations to kernel_cpp.h for GCC
Signed-off-by: Axel Dörfler <axeld@pinc-software.de>
2015-11-07 20:53:13 +01:00
Jonathan Schleifer
71e0324992
Move new / delete kernel_cpp.h -> kernel_cpp.cpp
new and delete may not be defined as inline, as Clang loudly complains.
The same is true for static.
2015-11-07 18:16:23 +01:00
Simon South
75c31ae28d system: Build using public elf.h header
Reduce duplication of code by

* Removing from elf_common.h definitions available in os/kernel/elf.h
* Deleting elf32.h and elf64.h
* Renaming elf_common.h to elf_private.h
* Updating source to build using public and private ELF header files
  together

Signed-off-by: Jessica Hamilton <jessica.l.hamilton@gmail.com>
2015-11-07 11:49:56 +13: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
Simon South
078b88b12d runtime_loader: Randomly position only relocatable code
The use of an unreliable test for relocatability effectively broke
runtime_loader's support for non-position-independent executables, as it
would insist on randomly positioning these files' segments in memory
anyway causing the program to quickly crash.

With this change runtime_loader uses the object type specified in the
file's header to determine whether its segments can be safely relocated,
restoring support for non-PI executables.

Fixes #12427.

Signed-off-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2015-10-26 21:19:25 +01:00
Murai Takashi
949cf6ac85 Fix GCC 5 build.
* Add -fgnu89-inline flag for libroot/posix/glibc
* Change __GNUC__ == 4 to __GNUC__ >= 4

Signed-off-by: Adrien Destugues <pulkomandy@pulkomandy.tk>

Fixes #11990, most of the changes had already been done.
2015-10-26 19:05:24 +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
c80084b025 JobQueue: fixed incorrect requeuing.
* A dependent job was requeued even if it wasn't part of the queue
  before. The code relied on dependent jobs being already enqueued;
  but that cannot be guaranteed.
* If a job failed, its dependent jobs are now also set to failed, so
  that they won't be requeued at a later point.
* This caused some of the "Launching xxx failed: Operation not allowed"
  messages in the boot process. Those actually weren't harmless, and
  could mess up the natural job order.
2015-10-18 13:11:26 +02: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
Alexander von Gluck IV
97aa078ef4 intel_extreme: Intial work for ValleyView support
* No impact to non-ValleyView chipsets
* Bump some register locations for VLV
* Only have HDMI port to test with on my ValleyView GPU
  and our driver seems to be missing all HDMI and
  sideband functionality.
* As ValleyView chipsets seem to be UEFI only, we don't
  have VESA fallback, so this shouldn't cause regressions.
  (unless we get UEFI framebuffer support)
2015-10-15 23:39:31 -05:00
Alexander von Gluck IV
a1ed294ff9 AHCI: Rework port reset and control
* Move to more standardized functions matching AHCI spec
* Don't perform unnecessary double port resets
* Begin implementing a software reset to try first per spec.
  Software reset needs more work, falls through to port reset
  for the moment which is stable.
* Don't duplicate ATA defines, use what we already provide.
* Tested working on VirtualBox 1-16 AHCI ports, Intel C200,
  and AMD FCH.
2015-10-05 19:46:03 -05:00
Axel Dörfler
6adf7a0c75 VFS: prevent FD inheritance for the kernel completely.
* Each io_context now has a "inherit_fds" member that decides whether
  or not this context allows to inherit FDs to its children.
* This replaces the former O_CLOEXEC mechanism.
2015-09-11 17:08:35 +02:00
Stefano Ceccherini
ce27f9612e Implement ClipToPicture inside a BPicture. Not working yet.
BView::ClipToPicture doesn't work anymore, when nested inside a BPicture,
This happened when its implementation was moved server-side.
2015-09-05 21:35:54 +02:00
Michael Lotz
d64c7086d5 Various whitespace cleanup only. 2015-09-05 16:09:33 +02:00
Michael Lotz
eec73693e0 PicturePlayer: Rework to be more safe against corrupted data.
This introduces a more sane API (currently private) that allows for
safer and possibly more efficient implementations:

* It uses a struct of named and typed function pointers instead of just
  a void pointer array. This adds type safety to the callbacks so the
  compiler can figure out if things match up before subtle bugs get
  introduced.
* It provides bounds for all strings/buffers passed to the callbacks.
* It uses const references instead of implicitly copying arguments.
* It folds stroke_x/fill_x pairs into draw_x functions with a fill
  argument to reduce the amount of functions needed.
* It uses unsigned values where negative values make no sense.

The old API has been implemented on top of the new one using adapter
functions. It makes copies of all data passed to the callbacks which
effectively keeps the picture data from being modified. This matches
with the R5 behaviour.

This also reimplements the buffer parsing to be safe against corrupted
data by validating that the types actually fit in the provided sizes
and buffers (using a templated reader).

Since this class is used from the app_server with user provided data,
making it more safe is important even though it comes with a slight
overhead (replicating R5 behaviour, i.e. crashing the app_server when
corrupted data is fed, doesn't seem very appropriate here).
2015-09-05 16:09:31 +02:00
Axel Dörfler
6b8712663a BToolBar: made FindButton() public. 2015-09-04 17:33:46 +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
Dario Casalinuovo
7d337b23b7 BMediaRoster: Reintroduce the undertaker class
* This has been necessary due to the undefined call order of
of static objects. Fixes #12315.
* The bug has been caused by the linker which free unused resources,
making the BMediaRoster to run in a zombie state. In this state
anything such as a message could make the looper to crash.
* The class is reintroduced with some differences though, we are
going to protect it from another thread calling Roster() while the
BMediaRoster is quitting and implement BMediaRosterEx::Quit.
* Unregister registrar notifications before we quit our thread. Avoid
to uninitialize anything from QuitRequested as it may cause problems.
2015-09-01 15:08:57 +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
Stefano Ceccherini
d6039d2b23 Midi: Remove some duplicated code
Introduced new private read/write_midi_settings() and used them
in MidiSettingsView and SoftSynth.
2015-08-27 11:51:57 +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
John Scipione
a0ba79fbff Split BSpinner into BAbstractSpinner and...
2 concrete classes which are currently implemented:
* BSpinner (works on int32s)
* BDecimalSpinner (works on doubles)

In addition BAbstractSpinner now inherits from BControl instead of
BView/BInvoker. This allowed for code simplification at the cost of needing to
cast for the decimal version because SetValue(int32 value) comes from BControl.

Also, add a spinner_button_style enum with 3 options:
* SPINNER_BUTTON_HORIZONTAL_ARROWS
* SPINNER_BUTTON_VERTICAL_ARROWS
* SPINNER_BUTTON_PLUS_MINUS

which sets the spinner arrows to either use horizontal arrows (left/right)
vertical arrows, (up/down), or +/- symbols (the default).

If the spinner button is using horizontal arrows you can decrement and increment
the spinner value by pushing control+left/right, otherwise you can increment and
decrement by pushing up or down. The reason for needing control is so that you
can move the cursor in the textbox otherwise.

Switch the 3 apps that are currently using BSpinners to use the integer variety
in Deskbar preferences, WebPostive preferences, and Screen preferences.
2015-08-22 15:15:08 -07:00
John Scipione
d122938346 Spinner: Generalize actions into methods
Add an Increment(), Decrement(), and SetValueFromText() method.

These can be overridden by derived classes.
2015-08-22 15:15:07 -07:00
John Scipione
a9385e8e2e Spinner: Move ValueChanged up
... along with the other hook methods
2015-08-22 15:15:06 -07:00
John Scipione
adba4ce988 Add BSpinner class based on GCI2013 work 2015-08-22 15:15:03 -07:00
Michael Lotz
5d4501aa01 Assorted whitespace cleanup and typo fixes. 2015-08-20 21:54:41 +02:00
Michael Lotz
efb0a3a853 EntryCache: Add entry_cache_add_missing() for negative caching.
It provides a way for filesystems to cache a lookup failure and
therefore prevents repeated lookups of missing entries. This is a
common scenario for example in command lookup and compiling, where
each directory in PATH or each include directory is searched for the
given entry.
2015-08-20 21:25:56 +02:00
Julian Harnath
2a58d5432d Merge branch 'master' into app_server 2015-08-15 11:12:35 +02:00