History log of /haiku/src/kits/app/Roster.cpp
Revision Date Author Comments
# feeb4b5d 21-Dec-2019 Jérôme Duval <jerome.duval@gmail.com>

RosterPrivate: add IsShutDownInProgress()

enable to check whether a shutdown process is in progress.

Change-Id: I8efdddb3caa80e9fd188f202b6e92a888a7608e5
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2042
Reviewed-by: waddlesplash <waddlesplash@gmail.com>


# 4eaa1f35 24-Aug-2019 Adrien Destugues <pulkomandy@pulkomandy.tk>

BRoster: preserve symlink as "app" if given one

Symlink name or attributes may be relevant to the launched app, so it's
important that we pass the unresolved symlink as argv[0] when running
it.

Change-Id: Ie1d73bc4e9d5c3d0476f205ce635aafd9203e553
Reviewed-on: https://review.haiku-os.org/c/haiku/+/1739
Reviewed-by: waddlesplash <waddlesplash@gmail.com>


# 6faf979d 24-Aug-2019 Adrien Destugues <pulkomandy@pulkomandy.tk>

BRoster: Fix infinite loop when trying to launch app with missing libraries.

Fixes #14986.

Change-Id: I727fde0c475f0684567a46be5af616cad56a9b4c
Reviewed-on: https://review.haiku-os.org/c/haiku/+/1738
Reviewed-by: waddlesplash <waddlesplash@gmail.com>


# 5f48948f 05-Mar-2019 Murai Takashi <tmurai01@gmail.com>

Roster: Fix PVS 460

Replace do...while(false) loop with while(true)... loop,
so that 'continue' at line 1968 can continue loop.

Change-Id: I4d64ff2699ad0837f29d49c63b683b134c4ccc1e
Reviewed-on: https://review.haiku-os.org/c/1149
Reviewed-by: Fredrik Holmqvist <fredrik.holmqvist@gmail.com>
Reviewed-by: Barrett17 <b.vitruvio@gmail.com>


# ab6bcb08 25-Dec-2018 Murai Takashi <tmurai01@gmail.com>

Roster: Fix PVS 456-459

Remove unneed if condition, since 'error' is initialized to B_OK.

Change-Id: I2fd0edb99a3d055beafaf15f1140071a31140892
Reviewed-on: https://review.haiku-os.org/798
Reviewed-by: Barrett17 <b.vitruvio@gmail.com>


# 9effbd7e 15-Dec-2018 Augustin Cavalier <waddlesplash@gmail.com>

Remove some unused cruft from the early days.

These lines were added in 2002...


# 27bba9c3 17-Mar-2018 Jérôme Duval <jerome.duval@gmail.com>

registrar: flat_app_info size was arch dependent.

copy each member of app_info instead.

Change-Id: Ica8d0a195b2dbaaf57d28f2fe2f7efd73c37b2c4


# 09320f38 10-Mar-2018 Jérôme Duval <jerome.duval@gmail.com>

Roster: fix debug build on x86_64.


# 9e73b627 11-Nov-2015 Axel Dörfler <axeld@pinc-software.de>

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).


# e3d73948 15-Aug-2015 Julian Harnath <julian.harnath@rwth-aachen.de>

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.


# 5b9f6b54 28-Aug-2015 Michael Lotz <mmlr@mlotz.ch>

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.


# ee5575d9 26-Aug-2015 Michael Lotz <mmlr@mlotz.ch>

BRoster: Apply no-registrar mode in a few more cases.

Avoids some more attempts at communicating with the registrar if the
no-registrar flag has been set.


# 811f0164 21-Aug-2015 Michael Lotz <mmlr@mlotz.ch>

BRoster: Make sure we aren't the registrar when initializing.

This fixes a regression introduced in 9bfc833, where the old way of
getting the roster port was replaced with its launch_daemon counterpart.

The previous method of finding the roster did always fail when running
from the registrar, as at the time of initialization (initialize_before
of libbe) the registrar looper doesn't exist yet. This commit restores
the previous behaviour by checking if the returned registrar team is the
current team and avoiding initialization in that case.

The regression caused a 5 second boot delay when later BApplication
initialization of the registrar tried to communicate with itself with a
reply timeout of that length.

Fixes #12258 at least partially and might affect #12237.


# fb7dad2b 07-Jun-2015 Axel Dörfler <axeld@pinc-software.de>

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.


# 78e39852 17-Jun-2015 Axel Dörfler <axeld@pinc-software.de>

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).


# 1f9826a7 17-Jun-2015 Axel Dörfler <axeld@pinc-software.de>

BRoster: minor cleanup.


# 9bfc8331 15-Apr-2015 Axel Dörfler <axeld@pinc-software.de>

BRoster: find the registrar port via launch roster.


# 85f43155 28-Jan-2015 Axel Dörfler <axeld@pinc-software.de>

BRoster: added missing const in Launch() variant.

* The argument array passed in is never touched.


# d53fe46d 08-Aug-2014 François Revol <revol@free.fr>

Add a non-const compatibility BRoster::Launch() call

BartLAuncher needs this one...


# 3aeed660 07-Aug-2014 Jérôme Duval <jerome.duval@gmail.com>

include strings.h where appriopriate...

instead or additionally to string.h, in preparation for functions move.
* moves str[n]casecmp() functions and others to strings.h.
* strings.h doesn't include string.h anymore.
* this solves #10949


# b43baaba 26-Jun-2014 John Scipione <jscipione@gmail.com>

BRoster: Remove brief desc comments

As per discussion, you'll just have to look in the Haiku Book for this.
Thanks Axel


# e4652fba 26-Jun-2014 John Scipione <jscipione@gmail.com>

BRoster: small doc fix


# 1909b63b 26-Jun-2014 John Scipione <jscipione@gmail.com>

BRoster: whitespace


# 807a7aa0 25-Jun-2014 John Scipione <jscipione@gmail.com>

Roster: print when sending B_READY_TO_RUN


# 732c5797 25-Jun-2014 John Scipione <jscipione@gmail.com>

Roster: style fixes.

* Check if == NULL or == 0 explicitily
* Use NULL instead of 0 as default value for pointers in header.
* other little stuff, new lines, comments


# e0016ffd 24-Jun-2014 John Scipione <jscipione@gmail.com>

Style fixes to BRoster, move docs to doxygen.

Keep the brief description as a regular comment above each public method.

Leave the docs of private methods.

Some variable renaming mostly because of abbreviations.

Add documentation for all the public methods and app_info members and defines
that didn't have docs in the cpp file.


# 9be774b5 30-Jul-2012 Alex Smith <alex@alex-smith.me.uk>

Compilation and 64-bit fixes to libbe.so sources.

Fixed the usual issues - printf format strings, uint32 instead of
addr_t, etc. One thing that isn't so nice is several places where
BList is used to store (u)int32, these require a double cast to addr_t
then void* to silence a warning on x86_64.


# 323b6546 21-Nov-2011 Oliver Tappe <zooey@hirschkaefer.de>

Filtered flat import of Oliver's svn package management branch

Bring the changes that aren't package management related and the ones
that are but don't take effect as long as they are ignored by the build
system into the master.

Summary of changes:
* Introduce private header <directories.h> with constants for a good
deal of paths that should usually be retrieved via find_directory().
* Replace hard-coded paths by using find_directory() or the
<directories.h> constants (e.g. in drivers and the kernel).
* Add find_directory() constants needed for package management.
* Add __HAIKU_ABI_NAME and B_HAIKU_ABI_NAME macros.
* src/apps/deskbar: BeMenu.* -> DeskbarMenu.*,
DeskBarUtils.* -> DeskbarUtils.*
* Change deskbar menu settings directory from ~/config/be to
~/config/settings/deskbar.
* Other smaller cleanups, changes, and fixes.


# 279ca67d 02-Nov-2011 Adrien Destugues <pulkomandy@pulkomandy.ath.cx>

Missing from previous commit. The files for notifications are quite scattered all around...


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@43115 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 3dfd9cb9 16-Jun-2011 Oliver Tappe <zooey@hirschkaefer.de>

Flat commit of all changes from package-management branch in svn


# 70da0d86 24-Feb-2011 Jonas Sundström <jonas@kirilla.com>

CID 6331, 6333, 6334, 6335 SECURE_CODING

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40677 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 17e54d27 04-Dec-2010 Rene Gollent <anevilyak@gmail.com>

r39419 accidentally introduced an additional local variable that shadowed the one used to return errors from _LaunchApp. This had the net effect that errors were never returned correctly.

Fixes #6956.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39723 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 954c60cb 14-Nov-2010 Axel Dörfler <axeld@pinc-software.de>

* _wasDocument may be NULL.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39425 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 4697f6ac 13-Nov-2010 Axel Dörfler <axeld@pinc-software.de>

* _LaunchApp() will now retry launching the app if the initial try ended with
an invalid META:PPATH attribute.
* _ResolveApp() now also sets the _wasDocument variable correctly for the
_TranslateType() case. This lets _LaunchApp() properly detected invalid
META:PPATH attributes.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39419 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 08ac2a49 25-Sep-2010 Stephan Aßmus <superstippi@gmx.de>

I don't quite understand why the preferred handler of
the super type is only regarded for "installed" MIME types.
The comment says that uninstalled MIME types are assumed
to be application MIME types, but this is clearly not always
the case. Initializing the secondary signature regardless
fixes the problem that unkown document MIME types open in
a random application, even though their super type has a
preferred handler. If the type is indeed an application
itself, I suppose no harm is done, since the primary
signature takes precedence anyway. Closes ticket #4501.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38810 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 0250598f 25-Aug-2010 Axel Dörfler <axeld@pinc-software.de>

* Forgot to update copyright for the last change.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38369 a95241bf-73f2-0310-859d-f6bbb57e9c96


# d3e85ecc 25-Aug-2010 Axel Dörfler <axeld@pinc-software.de>

* LaunchApp() now removes an existing app hint if load_image() returned an
error. It could even try again in the case of launch-by-signature to make
it more robust.
* _ResolveApp() now only updates the MIME type's app hint if there is no hint
already. This means that only the first app launch will update the hint, not
the ones after that; ie. if you had two installations of an app, launching
it by signature will now always launch the first app, not the one started
last.
* This is done since the app hint is written before its known whether or not
the app could be started at all. Now, if an app could not be started, the
hint is removed, which means it can be reset on next try.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38368 a95241bf-73f2-0310-859d-f6bbb57e9c96


# f33637d9 27-May-2010 Stephan Aßmus <superstippi@gmx.de>

* Improved BNotification API.
- No more manual memory management.
- Make it clear who keeps or releases ownership of arguments passed.
- Copy icon, arguments and entry_refs.
- Do not expose implementation details (What do the BLists contain?!).
- BRoster takes const BNotification& and bigtime_t timeout.

* BRoster::Notify():
- Proper error handling.
- Fixed documentation.

* Adjusted notify:
- Renamed fOk to fHasGoodArguments.
- The "const char*" members were really "char*" members (self-managed).
- free() is NULL-safe.
- fRefs contains BEntries, so passing void* to delete does no good.
- Adjustments to the changed API.
- Coding style fixes.

* notification_server:
- Adjustment to the new type for timeout.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36952 a95241bf-73f2-0310-859d-f6bbb57e9c96


# de9dcd41 27-May-2010 Stephan Aßmus <superstippi@gmx.de>

Patch by plfiorini: Integration of InfoPopper as a system service. See ticket
#1245. There are some TODOs outlined in the ticket, but they will be much
easier to review as individual patches against trunk, versus as a new version
of the huge patch.

I've messed a lot with src/servers/notification/NotificationsView.cpp in order
to resolve a crash I was getting when testing this thing (rewrote line
wrapping). I've also replaced the icons with the one that zuMi did long ago.

Thanks, plfiorini, for working on this code as much as you did!


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36949 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 6e1c9c64 27-Apr-2010 Stephan Aßmus <superstippi@gmx.de>

Adjusted the resolving algorithm such that when the preferred handler of the
super type is among the handlers with direct support for the sub-type, that this
handler is at the beginning of the list of fall-back handlers.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36507 a95241bf-73f2-0310-859d-f6bbb57e9c96


# da72ff26 27-Apr-2010 Stephan Aßmus <superstippi@gmx.de>

Changed the resolving of the best handler for a MIME type to consider other
supporting apps of the sub-type only when there is a preferred handler for the
sub-type configured at all. In this case, it is assumed that the super-type
preferred handler is not really suitable. In the case when no sub-type
preferred handler is configured, the super-type preferred handler will always
get precedence, even if there are applications installed that declare direct
support for the sub-type. This makes the behavior more consistent/deterministic
and the "Open With" menu that Tracker displays will have the checkmark at
the app again that will really be used to open the type by default. Should
fix #5821 for good, as suggested by Axel.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36500 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 713c42c5 26-Apr-2010 Stephan Aßmus <superstippi@gmx.de>

Adapted BRoster::FindApp() documentation which outlines the retrieval process
of preferred and supporting applications to the new behavior. Other methods
affected by the new behavior already refer to the documentation for FindApp().


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36478 a95241bf-73f2-0310-859d-f6bbb57e9c96


# da24e53c 25-Apr-2010 Stephan Aßmus <superstippi@gmx.de>

Changed the behavior for BRoster::FindApp(), Launch() and related functionality:
Instead of only checking the preferred applications of a given MIME type and its
super type (i.e. "text/html" and "text"), build a list of all supporting apps,
where the preferred types of the sub and super type lead the respective
sections of the list. Then try to find the first valid application in the list.

This makes it possible to double click "Welcome" on the Desktop, even though
the text/html MIME type still has BeZillaBrowser set as preferred application.
Previously it would launch StyledEdit, even though WebPositive was readily
available.

The previous behavior was probably implementing exactly the BeOS behavior, but
I can't see a good reason why we should be compatible here. Until now, my
testing has also not revealed any regression.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36471 a95241bf-73f2-0310-859d-f6bbb57e9c96


# cfbd7554 12-Mar-2010 Alexandre Deckner <alex@zappotek.com>

* When launching an app by signature, check against the correct device trash when checking if an executable is in the trash.

When using find_directory(B_TRASH_DIRECTORY... to check if an entry is in the trash one should always pass the entry's volume otherwise you might be checking in the wrong trash.
Might happen elsewhere in the tree, will have an opengrok look.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35826 a95241bf-73f2-0310-859d-f6bbb57e9c96


# f8ec4c04 01-Dec-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

Initialize BRoster's MIME messenger lazily.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34402 a95241bf-73f2-0310-859d-f6bbb57e9c96


# b9d85c12 27-Nov-2009 Axel Dörfler <axeld@pinc-software.de>

* Increased reply timeout considerably: with the amount of debug output the
registrar currently spits out, the net_server, and the debug_server sometimes
didn't receive a reply in time, causing them not to start.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34304 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 534a4df1 22-Oct-2009 Axel Dörfler <axeld@pinc-software.de>

* Minor cleanup, no functional change.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33727 a95241bf-73f2-0310-859d-f6bbb57e9c96


# d0276ac8 11-Oct-2009 Axel Dörfler <axeld@pinc-software.de>

* Changed the way BRoster launches apps by signature: before, only the version
info would decide which one to start. Now, this is only the last comparison
taken into account: first, the search path will be checked, then, any apps
in the /system folder are selected. Only after that, the version check will
be performed.
* This should improve the choices made, especially when you have a second set
of binaries around due to having built Haiku.
* This therefore also fixes that Haiku would wait for the wrong input_server on
shutdown, as the registrar didn't (and rightly so) recognize the input_server
as a system app since the wrong one had been started.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33528 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 41983084 09-Oct-2009 Axel Dörfler <axeld@pinc-software.de>

* Style cleanups, no functional change.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33493 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 4d8f5338 12-May-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

When sending a B_ARGV_RECEIVED message also add a "cwd" field.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30717 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 81f82c54 04-May-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

* Renamed _SniffFile() to _GetFileType() and change its semantics slightly. It
does now try to get the file type from the given node info first.
* _TranslateRef(): Added special handling for executable files that aren't
applications and have a preferred application set. In such a case we return
the preferred application instead of the given file. This mimics BeOS
behavior.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30624 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 0cc382e8 04-May-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

* BRoster::_TranslateRef(): Changed error handling style. No functional change.
* Automatic white space cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30623 a95241bf-73f2-0310-859d-f6bbb57e9c96


# b15e2008 26-Apr-2009 Bruno G. Albuquerque <bga@bug-br.org.br>

Removed some left over debug output.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30439 a95241bf-73f2-0310-859d-f6bbb57e9c96


# f3c32c1b 26-Apr-2009 Bruno G. Albuquerque <bga@bug-br.org.br>

If a preferred app was manually set but it is not found anymore (say, it was
deleted) try to handle it as if there was no preferred app set and if a
handler for its type exists, use it to open the file.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30438 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 2272b5db 16-Aug-2007 Jérôme Duval <korli@users.berlios.de>

actually don't send B_SILENT_RELAUNCH for any message in the initial message list


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@21990 a95241bf-73f2-0310-859d-f6bbb57e9c96


# a3192bf3 16-Aug-2007 Jérôme Duval <korli@users.berlios.de>

Tracker seems to launch applications with a B_REFS_RECEIVED message in the initial message list.
Now checks if such a message is present and avoids sending B_SILENT_RELAUNCH in this case, and also in the standard case with a ref.
This fixes bug #1387


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@21987 a95241bf-73f2-0310-859d-f6bbb57e9c96


# ca615cfc 17-Apr-2007 Ingo Weinhold <ingo_weinhold@gmx.de>

BRoster::Launch() didn't send a B_SILENT_RELAUNCH message to an already
running app. Fixes bug #1162.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20743 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 7b95cc63 16-Feb-2007 Ingo Weinhold <ingo_weinhold@gmx.de>

The BRoster initialization (contacting the registrar) can now time out
(generous 1s for delivery and for reply). This allows for the registrar
main thread to be debugged. Before the libbe initialization in gdb would
block, since it constructed the global be_roster which waited forever for
a reply from the registrar.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20144 a95241bf-73f2-0310-859d-f6bbb57e9c96


# f91bf83f 29-Jan-2007 Axel Dörfler <axeld@pinc-software.de>

We must not wait for the reply of the registrar - this fixes a deadlock between
the registrar and the app_server.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20013 a95241bf-73f2-0310-859d-f6bbb57e9c96


# e30afed4 19-Jan-2007 Axel Dörfler <axeld@pinc-software.de>

As per Ingo's request, I moved calling BRoster::Private::UpdateActiveApp() into
the app_server (and updated all comments that said otherwise).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19865 a95241bf-73f2-0310-859d-f6bbb57e9c96


# c2f641f2 18-Jan-2007 Axel Dörfler <axeld@pinc-software.de>

Turns out the whole "active app" mechanism in the registrar wasn't used at all; the
Switcher now works as expected.
* Renamed TRoster::ActivateApp() to UpdateActiveApp(), as the app is already activated
at that point (the registrar only keeps track of it).
* BWindow::DispatchMessage() now calls the new BRoster::Private::UpdateActiveApp()
method when it receives a B_WINDOW_ACTIVATED message.
* Added BRoster::_UpdateActiveApp() which calls the new B_REG_UPDATE_ACTIVE_APP.
* Removed now unused B_REG_ACTIVATE_APP.
* Minor cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19857 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 6bfd06d1 31-Aug-2006 Ingo Weinhold <ingo_weinhold@gmx.de>

BRoster::Launch() eventually launches the application in question
in several steps:
1. early pre-registration with the registrar ("I wanna launch the
app, make sure noone interferes.")
2. load the app image
3. finish pre-registration with the registrar ("I have launched
the app, here is its team ID.")
4. start app main thread
5. send "on launch" messages to the app (argv, refs, others)

If the app is already running or being launched, 1. fails with a
conclusive error code and returns the team ID and the pre-registration
token of the app. Steps 2 - 4 are skipped and only the messages are
delivered using the team ID returned by 1.

This change fixes a race condition: The failed early pre-registration
request obviously cannot return the team ID, if the other thread
launching the app has not finished step 3 yet. Thus the argv/refs
message would not get delivered and Launch() would not return the
correct team ID.

Now we wait for the pre-registration to be finished in this case, using
the former _IsAppPreRegistered() mechanism, which already provided
such a waiting feature for one request. It has been extended to
accomodate an arbitrary number of waiting requests and renamed to
_IsAppRegistered().

This fixed bug #763.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18728 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 1c1c6688 30-Aug-2006 Axel Dörfler <axeld@pinc-software.de>

Make sure "otherTeam" is -1 when it's not found in the reply.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18709 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 82584ab9 09-Jun-2006 Axel Dörfler <axeld@pinc-software.de>

* Implemented AS_DIRECT_WINDOW_SET_FULLSCREEN so that it sets kWindowScreenFeel
when enabled, and B_NORMAL_WINDOW_FEEL when disabled. IOW when enabled, no
other windows can interfere.
* Therefore, it's no longer necessary to have the screen_blanker window
use kWindowScreenFeel - it will set its window to full screen as long
as the blanker runs.
* Added a AS_APP_CRASHED notification in the app_server that will remove
all kWindowScreenFeels from the windows of the crashed app.
* This is now used by the debugger to ensure that the debugger alert will
be visible.
* Factored out a DesktopLink class out of the BRoster::_ActivateApp()
method. This class is now also used in the new BRoster::_ApplicationCrashed()
method as used in the debug_server (via BRoster::Private).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17785 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 82c410dc 02-Jun-2006 Axel Dörfler <axeld@pinc-software.de>

Tracker no longer wants to remove the executable bits from the kernel or the
runtime_loader when trying to start them.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17708 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 3df4580e 24-May-2006 Axel Dörfler <axeld@pinc-software.de>

Made the registrar communication more robust (would have cured the symptoms of
bug #513 as well).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17585 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 04b15907 16-May-2006 Axel Dörfler <axeld@pinc-software.de>

docRef can be NULL - this fixes the crash of the media server I introduced yesterday...


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17478 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 81d6346e 15-May-2006 Axel Dörfler <axeld@pinc-software.de>

Launching scripts via the Roster is now actually working (there were some app
registering stuff left that prevented that before).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17475 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 973582ac 15-May-2006 Axel Dörfler <axeld@pinc-software.de>

_LaunchApp() no longer registers scripts.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17474 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 90a8acbf 06-Apr-2006 Axel Dörfler <axeld@pinc-software.de>

BRoster::Launch() no longer replace B_NOT_AN_EXECUTABLE with B_LAUNCH_FAILED_EXECUTABLE
for everything - they now do that only for document files.
Also, I extended _TranslateRef() to not report anything that has the executable bit
set as executable - it now only does this if the BEOS:TYPE attribute says it's an
executable.
This fixes the error message Tracker was giving when trying to launch a shared library
("This file was mistakenly set as executable...").


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17023 a95241bf-73f2-0310-859d-f6bbb57e9c96


# ac1f397e 02-Apr-2006 Axel Dörfler <axeld@pinc-software.de>

Rewrote the private query_for_app() function to search on all mounted volumes
instead of just the boot volume.
It now also has a second pass in case nothing could be found. The second pass
does a case insensitive query for the application's signature, and fixes the
problem that some apps couldn't be started by signature until they were launched
once (because the MIME database is always case insensitive).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16967 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 2297a36b 22-Mar-2006 Stephan Aßmus <superstippi@gmx.de>

* added functions to improve binary compatibility with old apps
-> Guido (for which there is source available though) is now
running fine on Haiku.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16860 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 39e26f61 02-Mar-2006 Axel Dörfler <axeld@pinc-software.de>

Fixed a bug in the previous commit that prevented the Roster to find an
app if the type had no preferred application at all.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16566 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 0bad0dd0 02-Mar-2006 Axel Dörfler <axeld@pinc-software.de>

_TranslateType() now falls back to the preferred app of the super type in
case the preferred app of the type itself is not available or valid.
Ie. if you have deleted an application that was the preferred app for
"image/png", the system will now try to open the file with the preferred
app for "image".


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16565 a95241bf-73f2-0310-859d-f6bbb57e9c96


# bc2f09bb 01-Mar-2006 Axel Dörfler <axeld@pinc-software.de>

* Fixed a possible endless loop: when the calling team should receive the B_REFS_RECEIVED
message, we no longer send a message. This seems to be what BeOS does, and it prevents
Tracker from playing ping-pong when trying opening generic files.
* Eliminated superfluous otherTeam & targetTeam variables in _LaunchApp().
* Minor cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16564 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 91fe5e6e 16-Feb-2006 Axel Dörfler <axeld@pinc-software.de>

Minor cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16431 a95241bf-73f2-0310-859d-f6bbb57e9c96


# eb797182 16-Feb-2006 Axel Dörfler <axeld@pinc-software.de>

Cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16430 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 1ba1f4be 30-Jan-2006 Ingo Weinhold <ingo_weinhold@gmx.de>

If the "if" block is more than one line long, braces should be used, even
if it doesn't make a semantical difference. I can't believe I've written
that code.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16162 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 6700022a 22-Dec-2005 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Looks like the fix didn't work

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15658 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 291540f5 22-Dec-2005 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Signatures are case insensitive. This should allow Clock to start.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15654 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 4ceb1e51 20-Nov-2005 Axel Dörfler <axeld@pinc-software.de>

* reverted Adi's premature changes to BWindow and restored _DetermineTarget() and
task_looper() again.
* removed BMessenger::fPreferred - whenever you had to specify "usePreferred" separately,
you don't have to do that anymore - use B_PREFERRED_TOKEN instead.
* fixed BTokenSpace::GetToken() semantics: it will no longer touch the "object" argument
in case of failure.
* Introduced a BWindow::_DistributeMessage() that will be part of the event dispatcher
counterpart to the app_server (the other will be _DetermineTarget()).
* Made it easier to use Michael's Message4 implementation: just add the following line
to your UserBuildConfig:
AppendToConfigVar DEFINES : HAIKU_TOP src : USING_MESSAGE4 : global ;
* Introduced ServerWindow::HandlerMessenger() and FocusMessenger() - the first will
target the client handler, while the other will target the preferred handler of the
client looper (usually the view having focus).
* Fixed dano message unflattening in the Message4 code.
* Changed BMessage::PrintToStream() to no longer use macros in the Message4 implementation.
* I hope that's all - it's a huge change, but it's all connected.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15046 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 4f86bb69 31-Oct-2005 Axel Dörfler <axeld@pinc-software.de>

BRoster::ActivateApp() now talks to the Desktop, not the app_server anymore.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14600 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 18b5424c 24-Jul-2005 Ingo Weinhold <ingo_weinhold@gmx.de>

* Implemented BRoster::ActivateApp().
* Added the respective case statement in AppServer::DispatchMessage().
The code that actually activates the app is still missing.
* Removed the remnants of the old way of notifying the registrar about
what app got activated (the activated client window did that).



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13820 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 1771f7ae 18-Jul-2005 Axel Dörfler <axeld@pinc-software.de>

Signatures are case insensitive - I hope I fixed all occurences now... (but probably not)


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13731 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 2fd4a041 17-Jul-2005 Ingo Weinhold <ingo_weinhold@gmx.de>

Added a boolean "synchronous" parameter to BRoster::Shutdown(). Used in the
Deskbar to initiate the shutdown process asynchronously. Couldn't test it,
because opening the Be menu doesn't work:
***PANIC: BW: Can't find view with ID: 19 !***



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13722 a95241bf-73f2-0310-859d-f6bbb57e9c96


# a13df0dc 09-Jul-2005 Ingo Weinhold <ingo_weinhold@gmx.de>

Added a "confirm" parameter to BRoster::Shutdown() which causes the registrar
to ask the user to confirm shutting down the system.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13563 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 925d069d 03-Jul-2005 Ingo Weinhold <ingo_weinhold@gmx.de>

* Added BRoster::ShutDown().
* Adjusted the shutdown command to use BRoster::ShutDown(). Removed
the alert.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13416 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 4b8aafea 25-Jan-2005 Ingo Weinhold <ingo_weinhold@gmx.de>

BMessenger has no friends besides Private anymore.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@11023 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 289adc04 17-Jan-2005 Ingo Weinhold <ingo_weinhold@gmx.de>

Changed due to moving RegistrarDefs.h stuff into the BPrivate namespace and replacing kRosterPortName.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10813 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 2d36bfd6 15-Jan-2005 Ingo Weinhold <ingo_weinhold@gmx.de>

* Added support for the DEBUG_PRINTF macro.
* More debugging output in error cases.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10763 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 17e6de7a 03-Aug-2003 shadow303 <shadow303@nowhere.fake>

gcc 3 fixes


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4227 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 99966f78 26-Jun-2003 haydentech <haydentech@nowhere.fake>

Namespace/gcc3 fixes


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@3671 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 1847fb9c 05-Apr-2003 Ingo Weinhold <ingo_weinhold@gmx.de>

Always save before checking in. UpdateActiveApp() comment has been changed slightly.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@3054 a95241bf-73f2-0310-859d-f6bbb57e9c96


# c99847b4 05-Apr-2003 Ingo Weinhold <ingo_weinhold@gmx.de>

Unimplemented ActivateApp(); it has to ask the app server instead. Moved its code to UpdateActiveApp(), which has exactly the matching semantics. :-)


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@3053 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 2ed834e3 08-Feb-2003 Ingo Weinhold <ingo_weinhold@gmx.de>

Cleaned up BRoster's friends mess. All access to private BRoster functionality is now done through the newly added BRoster::Private class, which is BRoster's only friend (poor BRoster ;-).


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2664 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 1bde02ae 08-Nov-2002 Tyler Dauwalder <tylerdauwalder@nowhere.fake>

Fleshed out any missing pieces of BRoster::
- ClearRecent{Docs,Folders,Apps}
- AddToRecentApps()
- {Load,Save}RecentLists()


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1878 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 44db8a08 27-Oct-2002 Tyler Dauwalder <tylerdauwalder@nowhere.fake>

+ Added {Get,Add,Clear}Recent{Apps,Documents,Folders} framework
+ Fleshed out {Get,Add}RecentApps calls
+ Updated argument names for GetRecent{Documents,Folders} to
versions used in R5 release notes in the Be Book.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1715 a95241bf-73f2-0310-859d-f6bbb57e9c96


# edb7407e 18-Oct-2002 Ingo Weinhold <ingo_weinhold@gmx.de>

Implemented {Start,Stop}Watching().


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1577 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 8c7ccd0b 15-Oct-2002 Ingo Weinhold <ingo_weinhold@gmx.de>

Implemented BRoster::Broadcast().


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1541 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 8c7b7c86 07-Oct-2002 Ingo Weinhold <ingo_weinhold@gmx.de>

* resolve_app() and translate_ref() do now traverse the supplied ref and
set it to the resolved entry. Fixed bug causing non-traversal of app
links. Unset the app meta MIME type's app hint, if it is invalid.
* resolve_app(): Fixed incorrect behavior in case the signature of the
found app is not the signature of the preferred app.
* Implemented SetSignature(). It is indeed needed and I finally found out.
:-)
* xLaunchAppPrivate(): The document ref is always resolved.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1436 a95241bf-73f2-0310-859d-f6bbb57e9c96


# f2d61cef 06-Oct-2002 Ingo Weinhold <ingo_weinhold@gmx.de>

Implemented the Launch() methods and their helpers.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1413 a95241bf-73f2-0310-859d-f6bbb57e9c96


# c0aa02a8 04-Oct-2002 Ingo Weinhold <ingo_weinhold@gmx.de>

Added doxygen documentation for BRoster::Launch(). Implementation tomorrow. :-)


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1373 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 92a1f241 21-Sep-2002 Ingo Weinhold <ingo_weinhold@gmx.de>

Implemented BRoster::FindApp() and a bunch of helper functions needed for it. Tweaked some of the helpers signatures.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1110 a95241bf-73f2-0310-859d-f6bbb57e9c96


# bbab11ba 09-Aug-2002 Ingo Weinhold <ingo_weinhold@gmx.de>

Changed BRoster::GetRunningAppInfo() return value back to B_BAD_TEAM_ID in case the team ID is < 0. I thought R5 returns B_ERROR, but it does only for -1, otherwise it also returns B_BAD_TEAM_ID. We don't mimic this slightly insane behavior.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@680 a95241bf-73f2-0310-859d-f6bbb57e9c96


# ca3e9dba 09-Aug-2002 Ingo Weinhold <ingo_weinhold@gmx.de>

Fixed the return value in case of team ID < 0. R5 returns B_ERROR instead of B_BAD_TEAM_ID and so do we now.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@677 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 8cd29201 28-Jul-2002 Ingo Weinhold <ingo_weinhold@gmx.de>

Added _send_to_roster_() and _is_valid_roster_mess_().


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@512 a95241bf-73f2-0310-859d-f6bbb57e9c96


# d958d047 28-Jul-2002 Ingo Weinhold <ingo_weinhold@gmx.de>

Added doxygen comments for the implemented methods and fixed some smaller issues.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@493 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 92cf4c75 27-Jul-2002 Ingo Weinhold <ingo_weinhold@gmx.de>

Implemented IsRunning(), TeamFor(), GetAppList(),
Get{Running,Active,}AppInfo() and ActivateApp().


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@482 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 496ffb0a 26-Jul-2002 Ingo Weinhold <ingo_weinhold@gmx.de>

* Changed return type of some private methods from void to status_t.
AddApplication() returns the token via reference parameter and
additionally returns the team ID of the already running app (if any).
* Implemented AddApplication(), SetThreadAndTeam(), CompleteRegistration(),
IsAppPreRegistered(), RemovePreRegApp(), RemoveApp(), or to to say it
briefly the complete set of app registration helper functions.
* Implemented GetRunningAppInfo() and GetActiveAppInfo().


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@454 a95241bf-73f2-0310-859d-f6bbb57e9c96


# caf7e04f 23-Jul-2002 Ingo Weinhold <ingo_weinhold@gmx.de>

Implemented missing app_info constructor and destructor.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@411 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 17c00872 23-Jul-2002 Ingo Weinhold <ingo_weinhold@gmx.de>

Implemented _init_roster_() and added _delete_roster_() which are now responsible for be_roster.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@399 a95241bf-73f2-0310-859d-f6bbb57e9c96


# cef079ab 21-Jul-2002 Ingo Weinhold <ingo_weinhold@gmx.de>

Added a minimal BRoster implementation, i.e. constructor + InitMessengers().


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@377 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 5b9f6b5485af065913bc747f5c6a21001b275b7f 28-Aug-2015 Michael Lotz <mmlr@mlotz.ch>

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.


# ee5575d9b34ba547c0677a9b90bda2ebc066acee 26-Aug-2015 Michael Lotz <mmlr@mlotz.ch>

BRoster: Apply no-registrar mode in a few more cases.

Avoids some more attempts at communicating with the registrar if the
no-registrar flag has been set.


# 811f0164a0edc6c7be1fa43f4e16234cfaa2f70a 21-Aug-2015 Michael Lotz <mmlr@mlotz.ch>

BRoster: Make sure we aren't the registrar when initializing.

This fixes a regression introduced in 9bfc833, where the old way of
getting the roster port was replaced with its launch_daemon counterpart.

The previous method of finding the roster did always fail when running
from the registrar, as at the time of initialization (initialize_before
of libbe) the registrar looper doesn't exist yet. This commit restores
the previous behaviour by checking if the returned registrar team is the
current team and avoiding initialization in that case.

The regression caused a 5 second boot delay when later BApplication
initialization of the registrar tried to communicate with itself with a
reply timeout of that length.

Fixes #12258 at least partially and might affect #12237.


# fb7dad2b496333a96cf82d51c7deb41857e22321 07-Jun-2015 Axel Dörfler <axeld@pinc-software.de>

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.


# 78e39852fad37b7ce43c29d0f22c41405513c119 17-Jun-2015 Axel Dörfler <axeld@pinc-software.de>

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).


# 1f9826a7784b0335afd89e9e0a06ad92a4b6dfeb 17-Jun-2015 Axel Dörfler <axeld@pinc-software.de>

BRoster: minor cleanup.


# 9bfc8331bb5e79bbf0506b89102d65c58feac77a 15-Apr-2015 Axel Dörfler <axeld@pinc-software.de>

BRoster: find the registrar port via launch roster.


# 85f43155fe09aef03da5de75dd82a7b3fb8dd101 28-Jan-2015 Axel Dörfler <axeld@pinc-software.de>

BRoster: added missing const in Launch() variant.

* The argument array passed in is never touched.


# d53fe46d17d17c1f93f671be65f9ccb36d7f4cca 08-Aug-2014 François Revol <revol@free.fr>

Add a non-const compatibility BRoster::Launch() call

BartLAuncher needs this one...


# 3aeed6607cd07762c0e709633c012b3a632dbad9 07-Aug-2014 Jérôme Duval <jerome.duval@gmail.com>

include strings.h where appriopriate...

instead or additionally to string.h, in preparation for functions move.
* moves str[n]casecmp() functions and others to strings.h.
* strings.h doesn't include string.h anymore.
* this solves #10949


# b43baaba36575ba91ff09d7576d7377c82395c20 26-Jun-2014 John Scipione <jscipione@gmail.com>

BRoster: Remove brief desc comments

As per discussion, you'll just have to look in the Haiku Book for this.
Thanks Axel


# e4652fbaaecdc2af551187532e9a39827c2ee44b 26-Jun-2014 John Scipione <jscipione@gmail.com>

BRoster: small doc fix


# 1909b63babeb64314462f057644c782c19e1c86c 26-Jun-2014 John Scipione <jscipione@gmail.com>

BRoster: whitespace


# 807a7aa09a7259302f46c99e30962d5c38660d94 25-Jun-2014 John Scipione <jscipione@gmail.com>

Roster: print when sending B_READY_TO_RUN


# 732c579702e8601d9838249652cc8b1d425ce0c5 25-Jun-2014 John Scipione <jscipione@gmail.com>

Roster: style fixes.

* Check if == NULL or == 0 explicitily
* Use NULL instead of 0 as default value for pointers in header.
* other little stuff, new lines, comments


# e0016ffde98b1ee1a641e51fc8d6e7c55133e22c 24-Jun-2014 John Scipione <jscipione@gmail.com>

Style fixes to BRoster, move docs to doxygen.

Keep the brief description as a regular comment above each public method.

Leave the docs of private methods.

Some variable renaming mostly because of abbreviations.

Add documentation for all the public methods and app_info members and defines
that didn't have docs in the cpp file.


# 9be774b553296a712704078314f2291ae5fc352c 30-Jul-2012 Alex Smith <alex@alex-smith.me.uk>

Compilation and 64-bit fixes to libbe.so sources.

Fixed the usual issues - printf format strings, uint32 instead of
addr_t, etc. One thing that isn't so nice is several places where
BList is used to store (u)int32, these require a double cast to addr_t
then void* to silence a warning on x86_64.


# 323b65468e5836bb27a5e373b14027d902349437 21-Nov-2011 Oliver Tappe <zooey@hirschkaefer.de>

Filtered flat import of Oliver's svn package management branch

Bring the changes that aren't package management related and the ones
that are but don't take effect as long as they are ignored by the build
system into the master.

Summary of changes:
* Introduce private header <directories.h> with constants for a good
deal of paths that should usually be retrieved via find_directory().
* Replace hard-coded paths by using find_directory() or the
<directories.h> constants (e.g. in drivers and the kernel).
* Add find_directory() constants needed for package management.
* Add __HAIKU_ABI_NAME and B_HAIKU_ABI_NAME macros.
* src/apps/deskbar: BeMenu.* -> DeskbarMenu.*,
DeskBarUtils.* -> DeskbarUtils.*
* Change deskbar menu settings directory from ~/config/be to
~/config/settings/deskbar.
* Other smaller cleanups, changes, and fixes.


# 279ca67d6ec2b305465354a9c337fddb951568c3 02-Nov-2011 Adrien Destugues <pulkomandy@pulkomandy.ath.cx>

Missing from previous commit. The files for notifications are quite scattered all around...


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@43115 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 3dfd9cb95ce45f59160d50975210bc55e3fc0709 16-Jun-2011 Oliver Tappe <zooey@hirschkaefer.de>

Flat commit of all changes from package-management branch in svn


# 70da0d86398701af9fbe516a4de1aafe8a03144a 24-Feb-2011 Jonas Sundström <jonas@kirilla.com>

CID 6331, 6333, 6334, 6335 SECURE_CODING

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40677 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 17e54d27dc824598f56f7fc07596bca553d14efc 04-Dec-2010 Rene Gollent <anevilyak@gmail.com>

r39419 accidentally introduced an additional local variable that shadowed the one used to return errors from _LaunchApp. This had the net effect that errors were never returned correctly.

Fixes #6956.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39723 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 954c60cb56b8b5486115cf5b722a6121249e8345 14-Nov-2010 Axel Dörfler <axeld@pinc-software.de>

* _wasDocument may be NULL.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39425 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 4697f6ac33140f983fd382dd6a9eec539436629f 13-Nov-2010 Axel Dörfler <axeld@pinc-software.de>

* _LaunchApp() will now retry launching the app if the initial try ended with
an invalid META:PPATH attribute.
* _ResolveApp() now also sets the _wasDocument variable correctly for the
_TranslateType() case. This lets _LaunchApp() properly detected invalid
META:PPATH attributes.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39419 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 08ac2a498771fd46a05f1f557823b9e2fbdb1a3a 25-Sep-2010 Stephan Aßmus <superstippi@gmx.de>

I don't quite understand why the preferred handler of
the super type is only regarded for "installed" MIME types.
The comment says that uninstalled MIME types are assumed
to be application MIME types, but this is clearly not always
the case. Initializing the secondary signature regardless
fixes the problem that unkown document MIME types open in
a random application, even though their super type has a
preferred handler. If the type is indeed an application
itself, I suppose no harm is done, since the primary
signature takes precedence anyway. Closes ticket #4501.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38810 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 0250598f79e168c4d70068e515591fcc2022d1b1 25-Aug-2010 Axel Dörfler <axeld@pinc-software.de>

* Forgot to update copyright for the last change.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38369 a95241bf-73f2-0310-859d-f6bbb57e9c96


# d3e85ecc1a37e095de7783750cc3e3755434508b 25-Aug-2010 Axel Dörfler <axeld@pinc-software.de>

* LaunchApp() now removes an existing app hint if load_image() returned an
error. It could even try again in the case of launch-by-signature to make
it more robust.
* _ResolveApp() now only updates the MIME type's app hint if there is no hint
already. This means that only the first app launch will update the hint, not
the ones after that; ie. if you had two installations of an app, launching
it by signature will now always launch the first app, not the one started
last.
* This is done since the app hint is written before its known whether or not
the app could be started at all. Now, if an app could not be started, the
hint is removed, which means it can be reset on next try.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38368 a95241bf-73f2-0310-859d-f6bbb57e9c96


# f33637d9a8d0a6c080d85d375c8143cd13277d83 27-May-2010 Stephan Aßmus <superstippi@gmx.de>

* Improved BNotification API.
- No more manual memory management.
- Make it clear who keeps or releases ownership of arguments passed.
- Copy icon, arguments and entry_refs.
- Do not expose implementation details (What do the BLists contain?!).
- BRoster takes const BNotification& and bigtime_t timeout.

* BRoster::Notify():
- Proper error handling.
- Fixed documentation.

* Adjusted notify:
- Renamed fOk to fHasGoodArguments.
- The "const char*" members were really "char*" members (self-managed).
- free() is NULL-safe.
- fRefs contains BEntries, so passing void* to delete does no good.
- Adjustments to the changed API.
- Coding style fixes.

* notification_server:
- Adjustment to the new type for timeout.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36952 a95241bf-73f2-0310-859d-f6bbb57e9c96


# de9dcd41f8865290849ce03385126dca1cd43a49 27-May-2010 Stephan Aßmus <superstippi@gmx.de>

Patch by plfiorini: Integration of InfoPopper as a system service. See ticket
#1245. There are some TODOs outlined in the ticket, but they will be much
easier to review as individual patches against trunk, versus as a new version
of the huge patch.

I've messed a lot with src/servers/notification/NotificationsView.cpp in order
to resolve a crash I was getting when testing this thing (rewrote line
wrapping). I've also replaced the icons with the one that zuMi did long ago.

Thanks, plfiorini, for working on this code as much as you did!


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36949 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 6e1c9c648a431226d248b7163afd18ae0fdd6273 27-Apr-2010 Stephan Aßmus <superstippi@gmx.de>

Adjusted the resolving algorithm such that when the preferred handler of the
super type is among the handlers with direct support for the sub-type, that this
handler is at the beginning of the list of fall-back handlers.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36507 a95241bf-73f2-0310-859d-f6bbb57e9c96


# da72ff26726b28d1c3fe99d1413305f218a48c65 27-Apr-2010 Stephan Aßmus <superstippi@gmx.de>

Changed the resolving of the best handler for a MIME type to consider other
supporting apps of the sub-type only when there is a preferred handler for the
sub-type configured at all. In this case, it is assumed that the super-type
preferred handler is not really suitable. In the case when no sub-type
preferred handler is configured, the super-type preferred handler will always
get precedence, even if there are applications installed that declare direct
support for the sub-type. This makes the behavior more consistent/deterministic
and the "Open With" menu that Tracker displays will have the checkmark at
the app again that will really be used to open the type by default. Should
fix #5821 for good, as suggested by Axel.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36500 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 713c42c5231c96b64499baf0625f5293e644e7e8 26-Apr-2010 Stephan Aßmus <superstippi@gmx.de>

Adapted BRoster::FindApp() documentation which outlines the retrieval process
of preferred and supporting applications to the new behavior. Other methods
affected by the new behavior already refer to the documentation for FindApp().


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36478 a95241bf-73f2-0310-859d-f6bbb57e9c96


# da24e53cf8e071a1bf41e6bffdffdf07e2a2cf4c 25-Apr-2010 Stephan Aßmus <superstippi@gmx.de>

Changed the behavior for BRoster::FindApp(), Launch() and related functionality:
Instead of only checking the preferred applications of a given MIME type and its
super type (i.e. "text/html" and "text"), build a list of all supporting apps,
where the preferred types of the sub and super type lead the respective
sections of the list. Then try to find the first valid application in the list.

This makes it possible to double click "Welcome" on the Desktop, even though
the text/html MIME type still has BeZillaBrowser set as preferred application.
Previously it would launch StyledEdit, even though WebPositive was readily
available.

The previous behavior was probably implementing exactly the BeOS behavior, but
I can't see a good reason why we should be compatible here. Until now, my
testing has also not revealed any regression.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36471 a95241bf-73f2-0310-859d-f6bbb57e9c96


# cfbd7554437455c0b246d879381a517a886558f8 12-Mar-2010 Alexandre Deckner <alex@zappotek.com>

* When launching an app by signature, check against the correct device trash when checking if an executable is in the trash.

When using find_directory(B_TRASH_DIRECTORY... to check if an entry is in the trash one should always pass the entry's volume otherwise you might be checking in the wrong trash.
Might happen elsewhere in the tree, will have an opengrok look.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35826 a95241bf-73f2-0310-859d-f6bbb57e9c96


# f8ec4c04a0a67d134cff464125af6fc4b2fbbb58 01-Dec-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

Initialize BRoster's MIME messenger lazily.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34402 a95241bf-73f2-0310-859d-f6bbb57e9c96


# b9d85c12709186363b213335dd8d96a321067823 27-Nov-2009 Axel Dörfler <axeld@pinc-software.de>

* Increased reply timeout considerably: with the amount of debug output the
registrar currently spits out, the net_server, and the debug_server sometimes
didn't receive a reply in time, causing them not to start.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34304 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 534a4df19489acc34a66cc37955f40f45069d85e 22-Oct-2009 Axel Dörfler <axeld@pinc-software.de>

* Minor cleanup, no functional change.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33727 a95241bf-73f2-0310-859d-f6bbb57e9c96


# d0276ac85a7f857ab9bf46596b0f527bc5c7e8c5 11-Oct-2009 Axel Dörfler <axeld@pinc-software.de>

* Changed the way BRoster launches apps by signature: before, only the version
info would decide which one to start. Now, this is only the last comparison
taken into account: first, the search path will be checked, then, any apps
in the /system folder are selected. Only after that, the version check will
be performed.
* This should improve the choices made, especially when you have a second set
of binaries around due to having built Haiku.
* This therefore also fixes that Haiku would wait for the wrong input_server on
shutdown, as the registrar didn't (and rightly so) recognize the input_server
as a system app since the wrong one had been started.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33528 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 41983084e26c19394aa84eac9fa6895099637ea7 09-Oct-2009 Axel Dörfler <axeld@pinc-software.de>

* Style cleanups, no functional change.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33493 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 4d8f5338bd4480c255474b6fcc3643eba175ca93 12-May-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

When sending a B_ARGV_RECEIVED message also add a "cwd" field.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30717 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 81f82c549bb850def972680a5a376d2459d5f3ba 04-May-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

* Renamed _SniffFile() to _GetFileType() and change its semantics slightly. It
does now try to get the file type from the given node info first.
* _TranslateRef(): Added special handling for executable files that aren't
applications and have a preferred application set. In such a case we return
the preferred application instead of the given file. This mimics BeOS
behavior.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30624 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 0cc382e8d10948d8cf5c8894156812d6dda04ce5 04-May-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

* BRoster::_TranslateRef(): Changed error handling style. No functional change.
* Automatic white space cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30623 a95241bf-73f2-0310-859d-f6bbb57e9c96


# b15e2008a605324c63feec1a6566f70e5a254be6 26-Apr-2009 Bruno G. Albuquerque <bga@bug-br.org.br>

Removed some left over debug output.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30439 a95241bf-73f2-0310-859d-f6bbb57e9c96


# f3c32c1b8a1bf3a56ea10395a48635c36599ca44 26-Apr-2009 Bruno G. Albuquerque <bga@bug-br.org.br>

If a preferred app was manually set but it is not found anymore (say, it was
deleted) try to handle it as if there was no preferred app set and if a
handler for its type exists, use it to open the file.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30438 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 2272b5dbbded9afbe334f5458ccd27a3906a5120 16-Aug-2007 Jérôme Duval <korli@users.berlios.de>

actually don't send B_SILENT_RELAUNCH for any message in the initial message list


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@21990 a95241bf-73f2-0310-859d-f6bbb57e9c96


# a3192bf3a7e43ae2028758cc6b632f3157d032b6 16-Aug-2007 Jérôme Duval <korli@users.berlios.de>

Tracker seems to launch applications with a B_REFS_RECEIVED message in the initial message list.
Now checks if such a message is present and avoids sending B_SILENT_RELAUNCH in this case, and also in the standard case with a ref.
This fixes bug #1387


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@21987 a95241bf-73f2-0310-859d-f6bbb57e9c96


# ca615cfc7aa2b5e80badc674e37d99f9d03ff40d 17-Apr-2007 Ingo Weinhold <ingo_weinhold@gmx.de>

BRoster::Launch() didn't send a B_SILENT_RELAUNCH message to an already
running app. Fixes bug #1162.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20743 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 7b95cc638bd53cfd7840ada63eb02000ca8ca02e 16-Feb-2007 Ingo Weinhold <ingo_weinhold@gmx.de>

The BRoster initialization (contacting the registrar) can now time out
(generous 1s for delivery and for reply). This allows for the registrar
main thread to be debugged. Before the libbe initialization in gdb would
block, since it constructed the global be_roster which waited forever for
a reply from the registrar.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20144 a95241bf-73f2-0310-859d-f6bbb57e9c96


# f91bf83feb0c541935e92dd1d82889d27aaffe67 29-Jan-2007 Axel Dörfler <axeld@pinc-software.de>

We must not wait for the reply of the registrar - this fixes a deadlock between
the registrar and the app_server.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20013 a95241bf-73f2-0310-859d-f6bbb57e9c96


# e30afed4394414aa6ca3163de20901c0b3b367c6 19-Jan-2007 Axel Dörfler <axeld@pinc-software.de>

As per Ingo's request, I moved calling BRoster::Private::UpdateActiveApp() into
the app_server (and updated all comments that said otherwise).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19865 a95241bf-73f2-0310-859d-f6bbb57e9c96


# c2f641f2e51127c2318b5c4201919ec14ae9fe56 18-Jan-2007 Axel Dörfler <axeld@pinc-software.de>

Turns out the whole "active app" mechanism in the registrar wasn't used at all; the
Switcher now works as expected.
* Renamed TRoster::ActivateApp() to UpdateActiveApp(), as the app is already activated
at that point (the registrar only keeps track of it).
* BWindow::DispatchMessage() now calls the new BRoster::Private::UpdateActiveApp()
method when it receives a B_WINDOW_ACTIVATED message.
* Added BRoster::_UpdateActiveApp() which calls the new B_REG_UPDATE_ACTIVE_APP.
* Removed now unused B_REG_ACTIVATE_APP.
* Minor cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19857 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 6bfd06d1ff129f4db4445b978fa3ee9257f239c9 31-Aug-2006 Ingo Weinhold <ingo_weinhold@gmx.de>

BRoster::Launch() eventually launches the application in question
in several steps:
1. early pre-registration with the registrar ("I wanna launch the
app, make sure noone interferes.")
2. load the app image
3. finish pre-registration with the registrar ("I have launched
the app, here is its team ID.")
4. start app main thread
5. send "on launch" messages to the app (argv, refs, others)

If the app is already running or being launched, 1. fails with a
conclusive error code and returns the team ID and the pre-registration
token of the app. Steps 2 - 4 are skipped and only the messages are
delivered using the team ID returned by 1.

This change fixes a race condition: The failed early pre-registration
request obviously cannot return the team ID, if the other thread
launching the app has not finished step 3 yet. Thus the argv/refs
message would not get delivered and Launch() would not return the
correct team ID.

Now we wait for the pre-registration to be finished in this case, using
the former _IsAppPreRegistered() mechanism, which already provided
such a waiting feature for one request. It has been extended to
accomodate an arbitrary number of waiting requests and renamed to
_IsAppRegistered().

This fixed bug #763.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18728 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 1c1c6688d13c8fd458381a462d1047605a5d4d13 30-Aug-2006 Axel Dörfler <axeld@pinc-software.de>

Make sure "otherTeam" is -1 when it's not found in the reply.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18709 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 82584ab9c2996ff4dec740d64eb78c7c0b74c900 09-Jun-2006 Axel Dörfler <axeld@pinc-software.de>

* Implemented AS_DIRECT_WINDOW_SET_FULLSCREEN so that it sets kWindowScreenFeel
when enabled, and B_NORMAL_WINDOW_FEEL when disabled. IOW when enabled, no
other windows can interfere.
* Therefore, it's no longer necessary to have the screen_blanker window
use kWindowScreenFeel - it will set its window to full screen as long
as the blanker runs.
* Added a AS_APP_CRASHED notification in the app_server that will remove
all kWindowScreenFeels from the windows of the crashed app.
* This is now used by the debugger to ensure that the debugger alert will
be visible.
* Factored out a DesktopLink class out of the BRoster::_ActivateApp()
method. This class is now also used in the new BRoster::_ApplicationCrashed()
method as used in the debug_server (via BRoster::Private).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17785 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 82c410dc127775da0e1642751a5174e952b29e32 02-Jun-2006 Axel Dörfler <axeld@pinc-software.de>

Tracker no longer wants to remove the executable bits from the kernel or the
runtime_loader when trying to start them.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17708 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 3df4580e9a17072906234357aa0463c81beeacd6 24-May-2006 Axel Dörfler <axeld@pinc-software.de>

Made the registrar communication more robust (would have cured the symptoms of
bug #513 as well).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17585 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 04b1590767a85ff2d540db3f6bbbd1e960403ad0 16-May-2006 Axel Dörfler <axeld@pinc-software.de>

docRef can be NULL - this fixes the crash of the media server I introduced yesterday...


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17478 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 81d6346e7b0edcb4d2c5eb5f3647e22a88a174a0 15-May-2006 Axel Dörfler <axeld@pinc-software.de>

Launching scripts via the Roster is now actually working (there were some app
registering stuff left that prevented that before).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17475 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 973582ac0cb124017b9e4047eb53381d22e9c82a 15-May-2006 Axel Dörfler <axeld@pinc-software.de>

_LaunchApp() no longer registers scripts.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17474 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 90a8acbfe73f192c0e8317f8cc5e30eb05e88a86 06-Apr-2006 Axel Dörfler <axeld@pinc-software.de>

BRoster::Launch() no longer replace B_NOT_AN_EXECUTABLE with B_LAUNCH_FAILED_EXECUTABLE
for everything - they now do that only for document files.
Also, I extended _TranslateRef() to not report anything that has the executable bit
set as executable - it now only does this if the BEOS:TYPE attribute says it's an
executable.
This fixes the error message Tracker was giving when trying to launch a shared library
("This file was mistakenly set as executable...").


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17023 a95241bf-73f2-0310-859d-f6bbb57e9c96


# ac1f397e60f051907568322e1e1fb984de390d97 02-Apr-2006 Axel Dörfler <axeld@pinc-software.de>

Rewrote the private query_for_app() function to search on all mounted volumes
instead of just the boot volume.
It now also has a second pass in case nothing could be found. The second pass
does a case insensitive query for the application's signature, and fixes the
problem that some apps couldn't be started by signature until they were launched
once (because the MIME database is always case insensitive).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16967 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 2297a36b5b36a171c118b68e740c8c6a2b06003d 22-Mar-2006 Stephan Aßmus <superstippi@gmx.de>

* added functions to improve binary compatibility with old apps
-> Guido (for which there is source available though) is now
running fine on Haiku.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16860 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 39e26f6113393498c0d278ad8f4361ff47c8c949 02-Mar-2006 Axel Dörfler <axeld@pinc-software.de>

Fixed a bug in the previous commit that prevented the Roster to find an
app if the type had no preferred application at all.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16566 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 0bad0dd05ea11d961ebf1b7dad85ea481ad33d15 02-Mar-2006 Axel Dörfler <axeld@pinc-software.de>

_TranslateType() now falls back to the preferred app of the super type in
case the preferred app of the type itself is not available or valid.
Ie. if you have deleted an application that was the preferred app for
"image/png", the system will now try to open the file with the preferred
app for "image".


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16565 a95241bf-73f2-0310-859d-f6bbb57e9c96


# bc2f09bb77c642a3a4ed9fa93f11e5efbe44106b 01-Mar-2006 Axel Dörfler <axeld@pinc-software.de>

* Fixed a possible endless loop: when the calling team should receive the B_REFS_RECEIVED
message, we no longer send a message. This seems to be what BeOS does, and it prevents
Tracker from playing ping-pong when trying opening generic files.
* Eliminated superfluous otherTeam & targetTeam variables in _LaunchApp().
* Minor cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16564 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 91fe5e6e58f047fd8c300bdc2a83a6277c9fe28a 16-Feb-2006 Axel Dörfler <axeld@pinc-software.de>

Minor cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16431 a95241bf-73f2-0310-859d-f6bbb57e9c96


# eb797182dfa82004d795c2c9939217053ce81421 16-Feb-2006 Axel Dörfler <axeld@pinc-software.de>

Cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16430 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 1ba1f4be4a7722fabf981195241bb2d1bcf88f0c 30-Jan-2006 Ingo Weinhold <ingo_weinhold@gmx.de>

If the "if" block is more than one line long, braces should be used, even
if it doesn't make a semantical difference. I can't believe I've written
that code.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16162 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 6700022a753b1c74a9062d86aa85c943aeb95311 22-Dec-2005 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Looks like the fix didn't work

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15658 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 291540f51a271b88a314236afbc8421e77161160 22-Dec-2005 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Signatures are case insensitive. This should allow Clock to start.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15654 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 4ceb1e519c0447147b1d8b54a324bb7fedd3a606 20-Nov-2005 Axel Dörfler <axeld@pinc-software.de>

* reverted Adi's premature changes to BWindow and restored _DetermineTarget() and
task_looper() again.
* removed BMessenger::fPreferred - whenever you had to specify "usePreferred" separately,
you don't have to do that anymore - use B_PREFERRED_TOKEN instead.
* fixed BTokenSpace::GetToken() semantics: it will no longer touch the "object" argument
in case of failure.
* Introduced a BWindow::_DistributeMessage() that will be part of the event dispatcher
counterpart to the app_server (the other will be _DetermineTarget()).
* Made it easier to use Michael's Message4 implementation: just add the following line
to your UserBuildConfig:
AppendToConfigVar DEFINES : HAIKU_TOP src : USING_MESSAGE4 : global ;
* Introduced ServerWindow::HandlerMessenger() and FocusMessenger() - the first will
target the client handler, while the other will target the preferred handler of the
client looper (usually the view having focus).
* Fixed dano message unflattening in the Message4 code.
* Changed BMessage::PrintToStream() to no longer use macros in the Message4 implementation.
* I hope that's all - it's a huge change, but it's all connected.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15046 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 4f86bb69c57929cc4b914982f338c5146233bcfe 31-Oct-2005 Axel Dörfler <axeld@pinc-software.de>

BRoster::ActivateApp() now talks to the Desktop, not the app_server anymore.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14600 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 18b5424c5f12197d3979cf38dc69149c5e98150c 24-Jul-2005 Ingo Weinhold <ingo_weinhold@gmx.de>

* Implemented BRoster::ActivateApp().
* Added the respective case statement in AppServer::DispatchMessage().
The code that actually activates the app is still missing.
* Removed the remnants of the old way of notifying the registrar about
what app got activated (the activated client window did that).



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13820 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 1771f7ae7951384f1c270fde2dfbc62304a819de 18-Jul-2005 Axel Dörfler <axeld@pinc-software.de>

Signatures are case insensitive - I hope I fixed all occurences now... (but probably not)


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13731 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 2fd4a0411b7a0a98d8099ef3ec8e52ee75a1d3a1 17-Jul-2005 Ingo Weinhold <ingo_weinhold@gmx.de>

Added a boolean "synchronous" parameter to BRoster::Shutdown(). Used in the
Deskbar to initiate the shutdown process asynchronously. Couldn't test it,
because opening the Be menu doesn't work:
***PANIC: BW: Can't find view with ID: 19 !***



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13722 a95241bf-73f2-0310-859d-f6bbb57e9c96


# a13df0dc01b4f961be77fbb11ed08d177a4bae43 09-Jul-2005 Ingo Weinhold <ingo_weinhold@gmx.de>

Added a "confirm" parameter to BRoster::Shutdown() which causes the registrar
to ask the user to confirm shutting down the system.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13563 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 925d069d2345f9a7923cc3f1ff6e982a526dc844 03-Jul-2005 Ingo Weinhold <ingo_weinhold@gmx.de>

* Added BRoster::ShutDown().
* Adjusted the shutdown command to use BRoster::ShutDown(). Removed
the alert.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13416 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 4b8aafea9fea87431ca453d510fc619fac2a30fc 25-Jan-2005 Ingo Weinhold <ingo_weinhold@gmx.de>

BMessenger has no friends besides Private anymore.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@11023 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 289adc045d3aa7860aae3b1959d28a4d4c440ae2 17-Jan-2005 Ingo Weinhold <ingo_weinhold@gmx.de>

Changed due to moving RegistrarDefs.h stuff into the BPrivate namespace and replacing kRosterPortName.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10813 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 2d36bfd68311803045d1e697339a9dea0ffd643f 15-Jan-2005 Ingo Weinhold <ingo_weinhold@gmx.de>

* Added support for the DEBUG_PRINTF macro.
* More debugging output in error cases.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10763 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 17e6de7a37c5c61f45eb724de108daa70905cb8f 03-Aug-2003 shadow303 <shadow303@nowhere.fake>

gcc 3 fixes


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4227 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 99966f7887cfbed8fcd26ab5980e713d65f37eec 26-Jun-2003 haydentech <haydentech@nowhere.fake>

Namespace/gcc3 fixes


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@3671 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 1847fb9c71412e5ec6b06bd6ed9f497fc84544de 05-Apr-2003 Ingo Weinhold <ingo_weinhold@gmx.de>

Always save before checking in. UpdateActiveApp() comment has been changed slightly.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@3054 a95241bf-73f2-0310-859d-f6bbb57e9c96


# c99847b4cdac02f5cd3a4b7834172b769625d01d 05-Apr-2003 Ingo Weinhold <ingo_weinhold@gmx.de>

Unimplemented ActivateApp(); it has to ask the app server instead. Moved its code to UpdateActiveApp(), which has exactly the matching semantics. :-)


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@3053 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 2ed834e3f6f94d48d8671f8379040f4e8cc70238 08-Feb-2003 Ingo Weinhold <ingo_weinhold@gmx.de>

Cleaned up BRoster's friends mess. All access to private BRoster functionality is now done through the newly added BRoster::Private class, which is BRoster's only friend (poor BRoster ;-).


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2664 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 1bde02ae7b639be0ec8595ecec3577d7926a1f39 08-Nov-2002 Tyler Dauwalder <tylerdauwalder@nowhere.fake>

Fleshed out any missing pieces of BRoster::
- ClearRecent{Docs,Folders,Apps}
- AddToRecentApps()
- {Load,Save}RecentLists()


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1878 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 44db8a0885bf0092212b3901c0b9988ed660eea7 27-Oct-2002 Tyler Dauwalder <tylerdauwalder@nowhere.fake>

+ Added {Get,Add,Clear}Recent{Apps,Documents,Folders} framework
+ Fleshed out {Get,Add}RecentApps calls
+ Updated argument names for GetRecent{Documents,Folders} to
versions used in R5 release notes in the Be Book.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1715 a95241bf-73f2-0310-859d-f6bbb57e9c96


# edb7407e80af94a416c58b70c40c84465dc979f9 18-Oct-2002 Ingo Weinhold <ingo_weinhold@gmx.de>

Implemented {Start,Stop}Watching().


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1577 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 8c7ccd0bda03e73d6a26bee946e4c8503fc41d20 15-Oct-2002 Ingo Weinhold <ingo_weinhold@gmx.de>

Implemented BRoster::Broadcast().


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1541 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 8c7b7c869de2c67fd64cf12627ad235b878b82f4 07-Oct-2002 Ingo Weinhold <ingo_weinhold@gmx.de>

* resolve_app() and translate_ref() do now traverse the supplied ref and
set it to the resolved entry. Fixed bug causing non-traversal of app
links. Unset the app meta MIME type's app hint, if it is invalid.
* resolve_app(): Fixed incorrect behavior in case the signature of the
found app is not the signature of the preferred app.
* Implemented SetSignature(). It is indeed needed and I finally found out.
:-)
* xLaunchAppPrivate(): The document ref is always resolved.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1436 a95241bf-73f2-0310-859d-f6bbb57e9c96


# f2d61cef5e077fc1288f2d52e609aef432a4167f 06-Oct-2002 Ingo Weinhold <ingo_weinhold@gmx.de>

Implemented the Launch() methods and their helpers.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1413 a95241bf-73f2-0310-859d-f6bbb57e9c96


# c0aa02a83c30d1a837481a2a04b3f2335307fe96 04-Oct-2002 Ingo Weinhold <ingo_weinhold@gmx.de>

Added doxygen documentation for BRoster::Launch(). Implementation tomorrow. :-)


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1373 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 92a1f2416711e301fa09ec8806ed953c4711fd78 21-Sep-2002 Ingo Weinhold <ingo_weinhold@gmx.de>

Implemented BRoster::FindApp() and a bunch of helper functions needed for it. Tweaked some of the helpers signatures.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1110 a95241bf-73f2-0310-859d-f6bbb57e9c96


# bbab11ba30a8e0dd6995aaee550bb8006eea51a1 09-Aug-2002 Ingo Weinhold <ingo_weinhold@gmx.de>

Changed BRoster::GetRunningAppInfo() return value back to B_BAD_TEAM_ID in case the team ID is < 0. I thought R5 returns B_ERROR, but it does only for -1, otherwise it also returns B_BAD_TEAM_ID. We don't mimic this slightly insane behavior.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@680 a95241bf-73f2-0310-859d-f6bbb57e9c96


# ca3e9dba80720b4056f157e0c33656098ae7a0ec 09-Aug-2002 Ingo Weinhold <ingo_weinhold@gmx.de>

Fixed the return value in case of team ID < 0. R5 returns B_ERROR instead of B_BAD_TEAM_ID and so do we now.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@677 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 8cd292013baf44e4afdaff63d0e3f51e6ee39301 28-Jul-2002 Ingo Weinhold <ingo_weinhold@gmx.de>

Added _send_to_roster_() and _is_valid_roster_mess_().


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@512 a95241bf-73f2-0310-859d-f6bbb57e9c96


# d958d047936b335e0914b67f0b06c06a0dd34a71 28-Jul-2002 Ingo Weinhold <ingo_weinhold@gmx.de>

Added doxygen comments for the implemented methods and fixed some smaller issues.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@493 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 92cf4c75321eaf5a880f951eb29f13bc53caed64 27-Jul-2002 Ingo Weinhold <ingo_weinhold@gmx.de>

Implemented IsRunning(), TeamFor(), GetAppList(),
Get{Running,Active,}AppInfo() and ActivateApp().


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@482 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 496ffb0aa7b65d8cdc7da078d55cc337459938ba 26-Jul-2002 Ingo Weinhold <ingo_weinhold@gmx.de>

* Changed return type of some private methods from void to status_t.
AddApplication() returns the token via reference parameter and
additionally returns the team ID of the already running app (if any).
* Implemented AddApplication(), SetThreadAndTeam(), CompleteRegistration(),
IsAppPreRegistered(), RemovePreRegApp(), RemoveApp(), or to to say it
briefly the complete set of app registration helper functions.
* Implemented GetRunningAppInfo() and GetActiveAppInfo().


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@454 a95241bf-73f2-0310-859d-f6bbb57e9c96


# caf7e04f7f09d8cc367d911dedeb270f8217f1cd 23-Jul-2002 Ingo Weinhold <ingo_weinhold@gmx.de>

Implemented missing app_info constructor and destructor.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@411 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 17c00872bbc2a23c29364e2717e9ce8be4e775f8 23-Jul-2002 Ingo Weinhold <ingo_weinhold@gmx.de>

Implemented _init_roster_() and added _delete_roster_() which are now responsible for be_roster.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@399 a95241bf-73f2-0310-859d-f6bbb57e9c96


# cef079abd99a25b99fff4ed1c715e8ac8d0e366f 21-Jul-2002 Ingo Weinhold <ingo_weinhold@gmx.de>

Added a minimal BRoster implementation, i.e. constructor + InitMessengers().


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@377 a95241bf-73f2-0310-859d-f6bbb57e9c96