Commit Graph

8448 Commits

Author SHA1 Message Date
Markus Himmel
52c0749723 BLayoutBuilder: Add support for BCardLayout
Signed-off-by: Augustin Cavalier <waddlesplash@gmail.com>
2015-12-26 20:13:25 -05:00
Markus Himmel
5f2db70ffb Interface Kit: Add BCardView
Signed-off-by: Augustin Cavalier <waddlesplash@gmail.com>
2015-12-26 20:13:22 -05:00
Augustin Cavalier
6984b8554c Revert "libroot: Undefine constants for unsupported POSIX features"
This reverts commit 7aebec8db1.
As per the discussion on the mailing list.
2015-12-21 12:16:33 -05:00
Simon South
7aebec8db1 libroot: Undefine constants for unsupported POSIX features
Haiku does not yet support certain features related to POSIX threads.
Constants used to test for the presence of these features should
therefore be left undefined, according to the POSIX spec, but are
currently set to -1. This can cause software built on Haiku to
incorrectly detect the presence of these features.

* unistd.h: Undefine _POSIX_THREAD_ATTR_STACKADDR,
  _POSIX_THREAD_PRIORITY_SCHEDULING feature constants.
* conf.cpp: __sysconf: Return -1 for unsupported features.

Signed-off-by: Augustin Cavalier <waddlesplash@gmail.com>
2015-12-21 11:09:34 -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
ec7d3b4053 Move old launch_media_server to deprecated file 2015-12-06 15:09:12 +01:00
Dario Casalinuovo
1acc73c437 Deprecate media_realtime_init_* functions 2015-12-06 15:03:49 +01:00
Dario Casalinuovo
226be01113 media_kit: General maintainance
* Move !missing_symbols.cpp in the legacy directory.
* Move useless methods in a Deprecated.cpp file.
* SetRealtimeFlags / GetRealtimeFlags are useless, they
don't make sense nowadays.
* The symbols are anyway preserved.
2015-12-05 18:59:38 +01: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
Dario Casalinuovo
05962bb1e1 Add a way to register loopers for quit
* BApplication can now take the job to quit a BLooper at
the application quit. It's rejecting requests from windows too.
* BMediaRoster is using now this service in conjunction with the
MediaRosterUndertaker.
* The BeBook specify that we should have a valid BApplication
before to instantiate the BMediaRoster. While in theory we should
add a debugger call when this situation happens, in pratice this
might lead to more problems. For example libraries might use the
media_kit and create a BApplication object, but they aren't
applications, this is a design problem. So I decided to replace it
with a TRACE call for the moment.
2015-11-28 16:35:03 +01:00
Jérôme Duval
95c8163a16 Add Hangul and Hangul_Hanja keycodes for korean keyboards.
* map both keys on USB keyboards. Untested.
2015-11-23 20:04:22 +01:00
Simon South
dbf060a3f7 libroot: Add brk() and sbrk().
This commit replaces the placeholder implementation of sbrk(), which
operated on a process' heap, with real implementations of brk() and
sbrk() that adjust a process' program break.

* unistd.h: Add standard definitions of brk() and sbrk(); include
  stdint.h for intptr_t.
* thread.cpp: Recognize RLIMIT_AS and RLIMIT_DATA resource limits
  (both currently unlimited); order limit identifiers alphabetically.
* arch-specific.cpp: Remove sbrk_hook().
* malloc_debug_api.cpp: Remove sbrk_hook().
* unistd/Jamfile: Build brk.c instead of sbrk.c.
* unistd/brk.c: Add.
* unistd/sbrk.c: Delete (placeholder implementation).
* libroot_stubs.c: Remove sbrk_hook().
* libroot_stubs_legacy.c: Remove sbrk_hook().
* src/tests/.../posix/Jamfile: Build brk_test.c.
* brk_test.c: Add (simple unit test that demonstrates behaviour of
  sbrk()).

Signed-off-by: Jérôme Duval <jerome.duval@gmail.com>
2015-11-22 17:59:22 +01:00
Axel Dörfler
62eec60079 SMTP works again.
* The message to send the mails never made it to the add-on looper.
* Mail protocol threads now have names.
* Added a "public" BOutboundMailProtocol::SendMessages() call that sends
  itself a message (even the correct one this time).
2015-11-22 11:35:17 +01:00
Jérôme Duval
af585d0361 pkgman search: Add --requirements option 2015-11-20 20:55:12 +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
be741f6ec1 Minor cleanup of translator roster commit, updated copyright. 2015-11-13 11:37:15 +01:00
Markus Himmel
a1eccae96f Make sure images containing BTranslators are not unloaded early
When a translator is uninstalled, BTranslatorPrivate::_RemoveTranslators is
called. This method used to unload the image containing the translator after
calling Release() on it resulting in several problems:

- If the translator was still busy, e.g. translating something while being
  installed, it crashed since the image was unloaded even though its refcount
  was larger than 0.
- Applications using code from one of the translators (e.g. its config view)
  would crash when the translator is uninstalled (this is bug #12005).

This problem is now fixed. The roster keeps track of all translators whose
image it manages (even if the translator was already removed from the roster).
It also keeps a refcount to all images. When a translator's refcount drops to
zero and it belonged to a roster at some point, it does not delete itself, but
notifies the roster that it is ready to destruct, which then removes it from
the roster if the translator is still in it, destroys the translator, decrements
the refcount of the image and if the new refcount is zero, unloads the image.
All of this is done in a message handler, since if the translator called
TranslatorDeleted like before, the unloaded image would be referenced when
the stack is walked up.

Finally, the DataTranslations preflet is required to Acquire() the translator
whose config view it is showing, because otherwise its refcount could be reduced
to 0 and the image unloaded. BTranslatorRoster now enables users to acquire a
translator by ID. By the time the translator has to be released, it might not
be part of the roster anymore though. Since BTranslatorRoster tries not to give
out raw pointers to the translators it manages, users who acquire a translator
through a roster now are given a BTranslatorReleaseDelegate, which allows for
releasing the BTranslator exactly once and then self-destructs.

Signed-off-by: Axel Dörfler <axeld@pinc-software.de>
2015-11-13 11:26:53 +01:00
Markus Himmel
fdfc54b571 Remove unnecessary whitespace in AppDefs.h
Signed-off-by: Axel Dörfler <axeld@pinc-software.de>
2015-11-13 11:26:41 +01:00
Adrien Destugues
691e517bbd build fix.
* can't use min here, this header is not supposed to #include
  <algorithm>.
2015-11-12 22:24:16 +01:00
Adrien Destugues
4e3137c085 Add another missing string::compare method
* Makes our gcc2 slightly more C++98 compliant...
2015-11-12 22:08:23 +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
Adrien Destugues
c614961364 Implement CONNECT pass-through for HTTPS proxy
* When using a proxy, HTTPS connexion must still go directly to the
  target website. The proxy can then act as a TCP stream relay and just
  transmit the raw SSL stream between the client and website.
* For this, we ask the proxy sending an HTTP request with the CONNECT
  method. If the proxy supports this, we can then send anything as the
  payload and it will be forwarded.
* Untested, as the network here in Dusseldorf doesn't let me use a
  proxy.

ticket : #10973
2015-11-11 01:16:38 +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
4721524cb5 BAffineTransform: add PreTranslate/PreScale/PreRotate
* The existing methods TranslateBy(), ScaleBy() and RotateBy()
  transform the transformation. For a transform A, a point p,
  and the temporary transform B (being applied by the methods),
  this results in p' = B*(A*p) = (B*A)*p
  This is not necessarily the desired result. Suppose A is a
  translation and B a rotation, added by RotateBy(). Then B*A
  means that the translation itself is rotated, so B moves the
  coordinate origin itself, by rotating it around the original
  origin of the coordinate system (top left view corner).

  If we want to translate and then rotate around that *new* origin,
  we need to multiply the transforms the other way around: A*B.

  Three new methods PreTranslateBy(), PreScaleBy() and PreRotateBy()
  implement this. They are later used as a base to add translatation/
  scaling/rotation methods to BView which behave in the expected
  ordering, similar to other graphic APIs.
2015-11-10 23:34:03 +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
08135223ce Affine transforms: add method to test for dilation
* Add IsDilation() to BAffineTransform and Transformable which check
  whether the transform is a dilation, i.e. consists of only
  translation and/or scaling
2015-11-10 23:12:28 +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
Jonathan Schleifer
82f5db2e26
More libunwind compilation fixes 2015-11-09 20:00:06 +01:00
Jonathan Schleifer
18941b085c
Import libc++ 2015-11-09 18:02:17 +01:00
Jonathan Schleifer
f2c0917eea
Import libcxxrt 2015-11-09 18:01:58 +01:00
Jonathan Schleifer
d77787f2a4
Import libunwind 2015-11-09 18:01:42 +01:00
Jonathan Schleifer
0e2547a80d
Import lib/Headers from Clang 2015-11-09 18:01:18 +01:00
Adrien Destugues
4849ab6c8b BHttpRequest: add SSL certificate exception management.
When an HTTPS request uses an SSL certificate that OpenSSL considers
untrusted, and the user decides to continue anyway, add the certificate
to an exception list. Match certificates against this list and don't ask
the user again if they are already there.

Fixes #12004. Thanks to markh for the initial patch and peeking into the
WebKit code!
2015-11-09 10:46:58 +01:00
Adrien Destugues
6c32f50a64 BCertificate: fixup the API
* Add an operator== and a copy constructor
* Make the getters const so they are easier to use
2015-11-08 23:47:29 +01:00
Jérôme Duval
7ccbb2f03f Add operator delete(void *, size_t) for C++14. 2015-11-08 00:38:20 +01:00
Jonathan Schleifer
456150599a
Add __clang__ to a few #ifdefs 2015-11-07 23:02:53 +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
d8c022250d BMailAccountSettings: use BPathFinder.
* This allows to put add-ons in non-packaged folders, too.
* Also, Set{In|Out}boundAddOn() only ever looked in the system dir.
2015-11-07 20:55:14 +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
Simon South
e3616ca108 system: Provide elf.h to applications
Make a version of elf.h (assembled from the private header files
elf_common.h, elf32.h and elf64.h, and including Haiku's extensions for
C++) available to applications ported from UNIX.

Signed-off-by: Jessica Hamilton <jessica.l.hamilton@gmail.com>
2015-11-07 11:49:53 +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