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.
This commit is contained in:
Oliver Tappe 2011-11-22 02:44:32 +01:00 committed by Ingo Weinhold
parent cb050a33be
commit 323b65468e
119 changed files with 965 additions and 445 deletions

View File

@ -360,8 +360,9 @@ AddDirectoryToHaikuImage home mail draft ;
AddDirectoryToHaikuImage home mail in ;
AddDirectoryToHaikuImage home mail out ;
AddSymlinkToHaikuImage home config settings : deskbar : be ;
# Deskbar Application links
AddDirectoryToHaikuImage home config be Applications ;
AddDirectoryToHaikuImage home config settings deskbar Applications ;
DESKBAR_APPLICATIONS = ActivityMonitor CharacterMap CodyCam CDPlayer DeskCalc
Devices DiskProbe DriveSetup DiskUsage Expander Icon-O-Matic Installer
Magnify Mail MediaConverter MediaPlayer MidiPlayer People PoorMan
@ -369,32 +370,33 @@ DESKBAR_APPLICATIONS = ActivityMonitor CharacterMap CodyCam CDPlayer DeskCalc
;
local linkTarget ;
for linkTarget in $(DESKBAR_APPLICATIONS) {
AddSymlinkToHaikuImage home config be Applications
AddSymlinkToHaikuImage home config settings deskbar Applications
: /boot/system/apps/$(linkTarget) : $(linkTarget) ;
}
# Deskbar Desktop applets links
AddDirectoryToHaikuImage home config be Desktop\ applets ;
AddDirectoryToHaikuImage home config settings deskbar Desktop\ applets ;
DESKBAR_DESKTOP_APPLETS = LaunchBox NetworkStatus PowerStatus ProcessController
Workspaces
;
for linkTarget in $(DESKBAR_DESKTOP_APPLETS) {
AddSymlinkToHaikuImage home config be Desktop\ applets
AddSymlinkToHaikuImage home config settings deskbar Desktop\ applets
: /boot/system/apps/$(linkTarget) : $(linkTarget) ;
}
# Deskbar Preferences links
AddDirectoryToHaikuImage home config be Preferences ;
AddDirectoryToHaikuImage home config settings deskbar Preferences ;
DESKBAR_PREFERENCES = $(SYSTEM_PREFERENCES:B) ;
for linkTarget in $(DESKBAR_PREFERENCES) {
AddSymlinkToHaikuImage home config be Preferences
: /boot/system/preferences/$(linkTarget) : $(linkTarget) ;
AddSymlinkToHaikuImage home config settings deskbar Preferences
: /boot/system/preferences/$(linkTarget)
: $(linkTarget) ;
}
# Deskbar Demo links
AddDirectoryToHaikuImage home config be Demos ;
AddDirectoryToHaikuImage home config settings deskbar Demos ;
for linkTarget in $(SYSTEM_DEMOS) {
AddSymlinkToHaikuImage home config be Demos
AddSymlinkToHaikuImage home config settings deskbar Demos
: /boot/system/demos/$(linkTarget) : $(linkTarget) ;
}

View File

@ -672,6 +672,8 @@ rule AddSymlinkToHaikuImage directoryTokens : linkTarget : linkName
{
# AddSymlinkToHaikuImage <directory> : <link target> [ : <link name> ] ;
linkTarget = $(linkTarget:J=/) ;
AddSymlinkToContainer $(HAIKU_IMAGE_CONTAINER_NAME) : $(directoryTokens)
: $(linkTarget) : $(linkName) ;
}
@ -917,7 +919,8 @@ rule AddExpanderRuleToHaikuImage mimetype : extension : list : extract
Exit "Invalid expander rule specification passed to AddExpanderRule." ;
}
local entry = "\\\"$(mimetype)\\\"\\\t$(extension)\\\t\\\"$(list)\\\"\\\t\\\"$(extract)\\\"" ;
local entry
= "\\\"$(mimetype)\\\"\\\t$(extension)\\\t\\\"$(list)\\\"\\\t\\\"$(extract)\\\"" ;
AddEntryToHaikuImageExpanderRuleFile <haiku-image>expander.rules
: $(entry) ;
}

View File

@ -9,6 +9,7 @@
/* Determine the architecture and define macros for some fundamental
properties:
__HAIKU_ARCH - short name of the architecture (used in paths)
__HAIKU_ARCH_ABI - name of ABI (as in package architecture)
__HAIKU_ARCH_<arch> - defined to 1 for the respective architecture
__HAIKU_ARCH_BITS - defined to 32/64 on 32/64 bit architectures
(defaults to 32)
@ -19,25 +20,35 @@
*/
#ifdef __INTEL__
# define __HAIKU_ARCH x86
# if __GNUC__ == 2
# define __HAIKU_ARCH_ABI "x86_gcc2"
# else
# define __HAIKU_ARCH_ABI "x86"
# endif
# define __HAIKU_ARCH_X86 1
# define __HAIKU_ARCH_PHYSICAL_BITS 64
#elif __x86_64__
# define __HAIKU_ARCH x86_64
# define __HAIKU_ARCH_ABI "x86_64"
# define __HAIKU_ARCH_X86_64 1
# define __HAIKU_ARCH_BITS 64
#elif __POWERPC__
# define __HAIKU_ARCH ppc
# define __HAIKU_ARCH_ABI "ppc"
# define __HAIKU_ARCH_PPC 1
# define __HAIKU_BIG_ENDIAN 1
#elif __M68K__
# define __HAIKU_ARCH m68k
# define __HAIKU_ARCH_ABI "m68k"
# define __HAIKU_ARCH_M68K 1
# define __HAIKU_BIG_ENDIAN 1
#elif __MIPSEL__
# define __HAIKU_ARCH mipsel
# define __HAIKU_ARCH_ABI "mipsel"
# define __HAIKU_ARCH_MIPSEL 1
#elif __ARM__
# define __HAIKU_ARCH arm
# define __HAIKU_ARCH_ABI "arm"
# define __HAIKU_ARCH_ARM 1
#else
# error Unsupported architecture!

View File

@ -39,6 +39,8 @@
#define B_HAIKU_ABI_GCC_2_BEOS 0x00020001
#define B_HAIKU_ABI_GCC_2_HAIKU 0x00020002
#define B_HAIKU_ABI_NAME __HAIKU_ARCH_ABI
#if __GNUC__ == 2
# define B_HAIKU_ABI B_HAIKU_ABI_GCC_2_HAIKU
#elif __GNUC__ == 4

View File

@ -29,6 +29,9 @@ typedef enum {
B_SYSTEM_MEDIA_NODES_DIRECTORY,
B_SYSTEM_SOUNDS_DIRECTORY,
B_SYSTEM_DATA_DIRECTORY,
B_SYSTEM_DEVELOP_DIRECTORY,
B_SYSTEM_PACKAGES_DIRECTORY,
B_SYSTEM_HEADERS_DIRECTORY,
/* Common directories, shared among all users. */
B_COMMON_DIRECTORY = 2000,
@ -52,6 +55,19 @@ typedef enum {
B_COMMON_SOUNDS_DIRECTORY,
B_COMMON_DATA_DIRECTORY,
B_COMMON_CACHE_DIRECTORY,
B_COMMON_PACKAGES_DIRECTORY,
B_COMMON_HEADERS_DIRECTORY,
B_COMMON_NONPACKAGED_DIRECTORY,
B_COMMON_NONPACKAGED_ADDONS_DIRECTORY,
B_COMMON_NONPACKAGED_TRANSLATORS_DIRECTORY,
B_COMMON_NONPACKAGED_MEDIA_NODES_DIRECTORY,
B_COMMON_NONPACKAGED_BIN_DIRECTORY,
B_COMMON_NONPACKAGED_DATA_DIRECTORY,
B_COMMON_NONPACKAGED_FONTS_DIRECTORY,
B_COMMON_NONPACKAGED_SOUNDS_DIRECTORY,
B_COMMON_NONPACKAGED_DOCUMENTATION_DIRECTORY,
B_COMMON_NONPACKAGED_LIB_DIRECTORY,
B_COMMON_NONPACKAGED_HEADERS_DIRECTORY,
/* User directories. These are interpreted in the context
of the user making the find_directory call. */
@ -69,11 +85,25 @@ typedef enum {
B_USER_SOUNDS_DIRECTORY,
B_USER_DATA_DIRECTORY,
B_USER_CACHE_DIRECTORY,
B_USER_PACKAGES_DIRECTORY,
B_USER_HEADERS_DIRECTORY,
B_USER_NONPACKAGED_DIRECTORY,
B_USER_NONPACKAGED_ADDONS_DIRECTORY,
B_USER_NONPACKAGED_TRANSLATORS_DIRECTORY,
B_USER_NONPACKAGED_MEDIA_NODES_DIRECTORY,
B_USER_NONPACKAGED_BIN_DIRECTORY,
B_USER_NONPACKAGED_DATA_DIRECTORY,
B_USER_NONPACKAGED_FONTS_DIRECTORY,
B_USER_NONPACKAGED_SOUNDS_DIRECTORY,
B_USER_NONPACKAGED_DOCUMENTATION_DIRECTORY,
B_USER_NONPACKAGED_LIB_DIRECTORY,
B_USER_NONPACKAGED_HEADERS_DIRECTORY,
/* Global directories. */
B_APPS_DIRECTORY = 4000,
B_PREFERENCES_DIRECTORY,
B_UTILITIES_DIRECTORY,
B_PACKAGE_LINKS_DIRECTORY,
/* Obsolete: Legacy BeOS definition to be phased out */
B_BEOS_DIRECTORY = 1000,

View File

@ -0,0 +1,68 @@
/*
* Copyright 2011, Oliver Tappe <zooey@hirschkaefer.de>
* Distributed under the terms of the MIT License.
*/
#ifndef _LIBROOT_DIRECTORIES_H
#define _LIBROOT_DIRECTORIES_H
#define kGlobalBinDirectory "/bin"
#define kGlobalEtcDirectory "/etc"
#define kGlobalPackageLinksDirectory "/package-links"
#define kGlobalSystemDirectory "/system"
#define kGlobalTempDirectory "/tmp"
#define kGlobalVarDirectory "/var"
#define kAppsDirectory "/boot/apps"
#define kPreferencesDirectory "/boot/preferences"
#define kAppLocalAddonsDirectory "%A/add-ons"
#define kAppLocalLibDirectory "%A/lib"
#define kVolumeLocalSystemKernelAddonsDirectory "system/add-ons/kernel"
#define kVolumeLocalCommonNonpackagedKernelAddonsDirectory \
"common/non-packaged/add-ons/kernel"
#define kVolumeLocalCommonKernelAddonsDirectory "common/add-ons/kernel"
#define kVolumeLocalUserNonpackagedKernelAddonsDirectory \
"home/config/non-packaged/add-ons/kernel"
#define kVolumeLocalUserKernelAddonsDirectory "home/config/add-ons/kernel"
#define kSystemDirectory "/boot/system"
#define kSystemAddonsDirectory "/boot/system/add-ons"
#define kSystemAppsDirectory "/boot/system/apps"
#define kSystemBinDirectory "/boot/system/bin"
#define kSystemDataDirectory "/boot/system/data"
#define kSystemDevelopDirectory "/boot/develop"
#define kSystemLibDirectory "/boot/system/lib"
#define kSystemPackagesDirectory "/boot/system/packages"
#define kSystemPreferencesDirectory "/boot/system/preferences"
#define kSystemServersDirectory "/boot/system/servers"
#define kCommonDirectory "/boot/common"
#define kCommonAddonsDirectory "/boot/common/add-ons"
#define kCommonBinDirectory "/boot/common/bin"
#define kCommonDevelopToolsBinDirectory "/boot/develop/tools/current/bin"
#define kCommonEtcDirectory "/boot/common/settings/etc"
#define kCommonLibDirectory "/boot/common/lib"
#define kCommonPackagesDirectory "/boot/common/packages"
#define kCommonSettingsDirectory "/boot/common/settings"
#define kCommonTempDirectory "/boot/common/cache/tmp"
#define kCommonVarDirectory "/boot/common/var"
#define kCommonLogDirectory "/boot/common/var/log"
#define kCommonNonpackagedAddonsDirectory "/boot/common/non-packaged/add-ons"
#define kCommonNonpackagedBinDirectory "/boot/common/non-packaged/bin"
#define kCommonNonpackagedLibDirectory "/boot/common/non-packaged/lib"
#define kUserDirectory "/boot/home"
#define kUserConfigDirectory "/boot/home/config"
#define kUserAddonsDirectory "/boot/home/config/add-ons"
#define kUserBinDirectory "/boot/home/config/bin"
#define kUserLibDirectory "/boot/home/config/lib"
#define kUserPackagesDirectory "/boot/home/config/packages"
#define kUserSettingsDirectory "/boot/home/config/settings"
#define kUserNonpackagedAddonsDirectory "/boot/home/config/non-packaged/add-ons"
#define kUserNonpackagedBinDirectory "/boot/home/config/non-packaged/bin"
#define kUserNonpackagedLibDirectory "/boot/home/config/non-packaged/lib"
#endif // _LIBROOT_DIRECTORIES_H

View File

@ -191,7 +191,7 @@ ScreenSaverFilter::_Invoke()
BPath path;
if (find_directory(B_SYSTEM_BIN_DIRECTORY, &path) != B_OK
|| path.Append("screen_blanker") != B_OK)
path.SetTo("/boot/system/bin/screen_blanker");
path.SetTo("/bin/screen_blanker");
BEntry entry(path.Path());
entry_ref ref;
if (entry.GetRef(&ref) == B_OK

View File

@ -16,16 +16,19 @@
#include <string.h>
#include <Roster.h>
#include <List.h>
#include <Entry.h>
#include <Directory.h>
#include <Entry.h>
#include <FindDirectory.h>
#include <List.h>
#include <Path.h>
#include <Roster.h>
#include <String.h>
#include <SupportKit.h>
// This char is used to hold words together into single words...
#define GUNK_CHAR 0x01
#define PATHTOTRACKER "/boot/system/Tracker"
#define PATHTOTRACKER "/system/Tracker"
// Turn all spaces that are not-to-be-counted-as-spaces into GUNK_CHAR chars.
static void
@ -299,11 +302,14 @@ LaunchCommand(char** argv, int32 argc)
// Hack way to do this--really I should be able to do this by
// sending a BMessage. But how? When I finally get my copy of the
// BeOS Bible, maybe then I'll find out.
const char* trackerFile = PATHTOTRACKER;
char* temp = new char[strlen(trackerFile) + strlen(argv[0]) + 10];
sprintf(temp, "%s '%s'", trackerFile, argv[0]);
system(temp);
delete [] temp;
BPath trackerPath;
if (find_directory(B_SYSTEM_DIRECTORY, &trackerPath) != B_OK
|| trackerPath.Append("Tracker") != B_OK) {
return B_ENTRY_NOT_FOUND;
}
BString cmd(trackerPath.Path());
cmd << " '" << argv[0] << "'";
system(cmd.String());
return B_NO_ERROR;
} else {
// It's not a directory. Must be a file.

View File

@ -5,6 +5,7 @@
# include <debug.h>
#endif
#include <directories.h>
#include <OS.h>
#include <image.h>
#include <ctype.h>
@ -26,7 +27,7 @@
#define MAX_FAILS_BEFORE_BSOD 0
#ifdef __HAIKU__
# define FORTUNE_FILE "/boot/system/data/fortunes/Fortunes"
# define FORTUNE_FILE kSystemDataDirectory "/fortunes/Fortunes"
#else
# define FORTUNE_FILE "/etc/fortunes/default"
#endif

View File

@ -1,7 +1,7 @@
SubDir HAIKU_TOP src add-ons kernel drivers audio ac97 auich ;
SetSubDirSupportedPlatformsBeOSCompatible ;
UsePrivateHeaders media ;
UsePrivateHeaders libroot media ;
SubDirHdrs [ FDirName $(SUBDIR) $(DOTDOT) ] ;
SEARCH_SOURCE += [ FDirName $(SUBDIR) $(DOTDOT) ] ;

View File

@ -28,23 +28,32 @@
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
#include <KernelExport.h>
#include <stdio.h>
#include <fcntl.h>
#include <unistd.h>
#include <directories.h>
#include <OS.h>
#include "debug.h"
#include "auich.h"
#if DEBUG > 0
static const char * logfile="/boot/home/auich.log";
static const char *logfile = kCommonLogDirectory "/auich.log";
static sem_id loglock;
#endif
void debug_printf(const char *text,...);
void log_printf(const char *text,...);
void log_create(void);
void debug_printf(const char *text,...)
{
char buf[1024];
@ -57,6 +66,7 @@ void debug_printf(const char *text,...)
dprintf(DRIVER_NAME ": %s",buf);
}
void log_create()
{
#if DEBUG > 0
@ -68,6 +78,7 @@ void log_create()
#endif
}
void log_printf(const char *text,...)
{
#if DEBUG > 0
@ -92,4 +103,3 @@ void log_printf(const char *text,...)
#endif
#endif
}

View File

@ -1,7 +1,7 @@
SubDir HAIKU_TOP src add-ons kernel drivers audio ac97 auvia ;
SetSubDirSupportedPlatformsBeOSCompatible ;
UsePrivateHeaders media ;
UsePrivateHeaders libroot media ;
SubDirHdrs [ FDirName $(SUBDIR) $(DOTDOT) ] ;
SEARCH_SOURCE += [ FDirName $(SUBDIR) $(DOTDOT) ] ;

View File

@ -28,23 +28,32 @@
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
#include <KernelExport.h>
#include <stdio.h>
#include <fcntl.h>
#include <unistd.h>
#include <directories.h>
#include <OS.h>
#include "debug.h"
#include "auvia.h"
#if DEBUG > 0
static const char * logfile="/boot/home/auvia.log";
static const char *logfile = kCommonLogDirectory "/auvia.log";
static sem_id loglock;
#endif
void debug_printf(const char *text,...);
void log_printf(const char *text,...);
void log_create(void);
void debug_printf(const char *text,...)
{
char buf[1024];
@ -57,6 +66,7 @@ void debug_printf(const char *text,...)
dprintf(DRIVER_NAME ": %s",buf);
}
void log_create()
{
#if DEBUG > 0
@ -68,6 +78,7 @@ void log_create()
#endif
}
void log_printf(const char *text,...)
{
#if DEBUG > 0
@ -92,4 +103,3 @@ void log_printf(const char *text,...)
#endif
#endif
}

View File

@ -1,7 +1,7 @@
SubDir HAIKU_TOP src add-ons kernel drivers audio ac97 es1370 ;
SetSubDirSupportedPlatformsBeOSCompatible ;
UsePrivateHeaders media ;
UsePrivateHeaders libroot media ;
SubDirHdrs [ FDirName $(SUBDIR) $(DOTDOT) ] ;
KernelAddon es1370 :

View File

@ -8,24 +8,33 @@
* Marcus Overhagen, marcus@overhagen.de
* Jerome Duval, jerome.duval@free.fr
*/
#include <KernelExport.h>
#include <stdio.h>
#include <string.h>
#include <fcntl.h>
#include <unistd.h>
#include <directories.h>
#include <OS.h>
#include "debug.h"
#include "es1370.h"
#if DEBUG > 0
static const char * logfile="/boot/home/es1370.log";
static const char *logfile = kCommonLogDirectory "/es1370.log";
static sem_id loglock;
#endif
void debug_printf(const char *text,...);
void log_printf(const char *text,...);
void log_create(void);
void debug_printf(const char *text,...)
{
char buf[1024];
@ -38,6 +47,7 @@ void debug_printf(const char *text,...)
dprintf(DRIVER_NAME ": %s",buf);
}
void log_create()
{
#if DEBUG > 0
@ -49,6 +59,7 @@ void log_create()
#endif
}
void log_printf(const char *text,...)
{
#if DEBUG > 0
@ -73,4 +84,3 @@ void log_printf(const char *text,...)
#endif
#endif
}

View File

@ -2,7 +2,7 @@ SubDir HAIKU_TOP src add-ons kernel drivers audio ac97 ich ;
SetSubDirSupportedPlatformsBeOSCompatible ;
UsePrivateHeaders media ;
UsePrivateHeaders libroot media ;
KernelAddon ich_ac97 :
ac97_multi.c

View File

@ -25,14 +25,21 @@
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
#include <KernelExport.h>
#include <stdio.h>
#include <fcntl.h>
#include <unistd.h>
#include <directories.h>
#include <OS.h>
#include "debug.h"
#include "ich.h"
void debug_printf(const char *text,...)
{
char buf[1024];
@ -45,11 +52,12 @@ void debug_printf(const char *text,...)
dprintf(DRIVER_NAME ": %s",buf);
}
#if DEBUG > 0
static const char * logfile="/boot/home/ich_ac97.log";
#if DEBUG > 0
static const char *logfile = kCommonLogDirectory "/ich_ac97.log";
static sem_id loglock;
void log_create(void)
{
int fd = open(logfile, O_WRONLY | O_CREAT | O_TRUNC, 0666);
@ -59,6 +67,7 @@ void log_create(void)
close(fd);
}
void log_printf(const char *text,...)
{
int fd;
@ -81,5 +90,4 @@ void log_printf(const char *text,...)
snooze(150000);
#endif
}
#endif

View File

@ -13,7 +13,7 @@ SubDirHdrs $(HAIKU_TOP) src add-ons kernel drivers audio echo generic DSP ;
SubDirHdrs $(HAIKU_TOP) src add-ons kernel drivers audio echo generic ASIC ;
UsePrivateHeaders [ FDirName kernel ] # For kernel_cpp.cpp
media ;
libroot media ;
# set some additional defines
SubDirCcFlags -DECHO_BEOS -DECHO24_FAMILY ;

View File

@ -13,7 +13,7 @@ SubDirHdrs $(HAIKU_TOP) src add-ons kernel drivers audio echo generic DSP ;
SubDirHdrs $(HAIKU_TOP) src add-ons kernel drivers audio echo generic ASIC ;
UsePrivateHeaders [ FDirName kernel ] # For kernel_cpp.cpp
media ;
libroot media ;
# set some additional defines
SubDirCcFlags -DECHO_BEOS -DECHO3G_FAMILY ;

View File

@ -28,21 +28,30 @@
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
#include <KernelExport.h>
#include <stdio.h>
#include <fcntl.h>
#include <unistd.h>
#include <directories.h>
#include <OS.h>
#include "debug.h"
#if DEBUG > 0
static const char * logfile="/boot/home/"DRIVER_NAME".log";
static const char *logfile = kCommonLogDirectory "/" DRIVER_NAME ".log";
static sem_id loglock;
#endif
void debug_printf(const char *text,...);
void log_printf(const char *text,...);
void debug_printf(const char *text,...)
{
char buf[1024];
@ -55,6 +64,7 @@ void debug_printf(const char *text,...)
dprintf(DRIVER_NAME ": %s",buf);
}
void log_create()
{
#if DEBUG > 0
@ -66,6 +76,7 @@ void log_create()
#endif
}
void log_printf(const char *text,...)
{
#if DEBUG > 0
@ -90,4 +101,3 @@ void log_printf(const char *text,...)
#endif
#endif
}

View File

@ -13,7 +13,7 @@ SubDirHdrs $(HAIKU_TOP) src add-ons kernel drivers audio echo generic DSP ;
SubDirHdrs $(HAIKU_TOP) src add-ons kernel drivers audio echo generic ASIC ;
UsePrivateHeaders [ FDirName kernel ] # For kernel_cpp.cpp
media ;
libroot media ;
# set some additional defines
SubDirCcFlags -DECHO_BEOS -DECHOGALS_FAMILY ;

View File

@ -13,7 +13,7 @@ SubDirHdrs $(HAIKU_TOP) src add-ons kernel drivers audio echo generic DSP ;
SubDirHdrs $(HAIKU_TOP) src add-ons kernel drivers audio echo generic ASIC ;
UsePrivateHeaders [ FDirName kernel ] # For kernel_cpp.cpp
media ;
libroot media ;
# set some additional defines
SubDirCcFlags -DECHO_BEOS -DINDIGO_FAMILY -DCARDBUS ;

View File

@ -2,7 +2,7 @@ SubDir HAIKU_TOP src add-ons kernel drivers audio emuxki ;
SetSubDirSupportedPlatformsBeOSCompatible ;
UsePrivateHeaders media ;
UsePrivateHeaders libroot media ;
KernelAddon emuxki :
ac97.c

View File

@ -28,23 +28,32 @@
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
#include <KernelExport.h>
#include <stdio.h>
#include <fcntl.h>
#include <unistd.h>
#include <directories.h>
#include <OS.h>
#include "debug.h"
#include "emuxki.h"
#if DEBUG > 0
static const char * logfile="/boot/home/emuxki.log";
static const char *logfile = kCommonLogDirectory "/emuxki.log";
static sem_id loglock;
#endif
void debug_printf(const char *text,...);
void log_printf(const char *text,...);
void log_create(void);
void debug_printf(const char *text,...)
{
char buf[1024];
@ -57,6 +66,7 @@ void debug_printf(const char *text,...)
dprintf(DRIVER_NAME ": %s",buf);
}
void log_create()
{
#if DEBUG > 0
@ -68,6 +78,7 @@ void log_create()
#endif
}
void log_printf(const char *text,...)
{
#if DEBUG > 0
@ -92,4 +103,3 @@ void log_printf(const char *text,...)
#endif
#endif
}

View File

@ -1,6 +1,6 @@
SubDir HAIKU_TOP src add-ons kernel drivers audio module_driver ;
UsePrivateHeaders media ;
UsePrivateHeaders libroot media ;
KernelAddon audio_module_driver :
audio_module_driver.c

View File

@ -8,15 +8,20 @@
*
*/
#include <KernelExport.h>
#include <directories.h>
#include <Drivers.h>
#include <Errors.h>
#include <OS.h>
#include <malloc.h>
#include <fcntl.h>
#include <image.h>
#include "audio_module.h"
int32 api_version = B_CUR_DRIVER_API_VERSION;
#define DRIVER_NAME "audio_module_driver"
@ -29,6 +34,7 @@ void republish_devices(void);
extern image_id load_kernel_addon(const char *path);
extern status_t unload_kernel_addon(image_id imid);
status_t
init_hardware(void)
{
@ -36,6 +42,7 @@ init_hardware(void)
return B_OK;
}
status_t
init_driver(void)
{
@ -44,8 +51,9 @@ init_driver(void)
status_t rv;
void (*print_hello_world)(void);
id = load_kernel_addon("/boot/home/config/add-ons/kernel/media/audio/ich");
get_image_symbol(id, "print_hello_world", B_SYMBOL_TYPE_TEXT, (void **) &print_hello_world);
id = load_kernel_addon(kUserAddonsDirectory "/kernel/media/audio/ich");
get_image_symbol(id, "print_hello_world", B_SYMBOL_TYPE_TEXT,
(void **) &print_hello_world);
print_hello_world();
unload_kernel_addon(id);
if (rv != B_OK)
@ -71,12 +79,14 @@ init_driver(void)
return B_OK;
}
void
uninit_driver(void)
{
dprintf("audio_module_driver: uninit_driver\n");
}
static status_t
audio_module_driver_open(const char *name, uint32 flags, void **cookie)
{
@ -84,6 +94,7 @@ audio_module_driver_open(const char *name, uint32 flags, void **cookie)
return B_OK;
}
static status_t
audio_module_driver_close(void *cookie)
{
@ -91,6 +102,7 @@ audio_module_driver_close(void *cookie)
return B_OK;
}
static status_t
audio_module_driver_free(void *cookie)
{
@ -98,6 +110,7 @@ audio_module_driver_free(void *cookie)
return B_OK;
}
static status_t
audio_module_driver_control(void *cookie, uint32 op, void *arg, size_t len)
{
@ -108,22 +121,28 @@ audio_module_driver_control(void *cookie, uint32 op, void *arg, size_t len)
}
}
static status_t
audio_module_driver_read(void *cookie, off_t position, void *buf, size_t *num_bytes)
audio_module_driver_read(void *cookie, off_t position, void *buf,
size_t *num_bytes)
{
*num_bytes = 0;
return B_IO_ERROR;
}
static status_t
audio_module_driver_write(void *cookie, off_t position, const void *buffer, size_t *num_bytes)
audio_module_driver_write(void *cookie, off_t position, const void *buffer,
size_t *num_bytes)
{
static int keep_open_fd = -1;
if (*num_bytes >= 5 && 0 == memcmp("start", buffer, 5) && keep_open_fd == -1) {
if (*num_bytes >= 5 && 0 == memcmp("start", buffer, 5)
&& keep_open_fd == -1) {
keep_open_fd = open("/dev/audio/audio_module_driver", O_RDWR);
return B_OK;
}
if (*num_bytes >= 4 && 0 == memcmp("stop", buffer, 4) && keep_open_fd != -1) {
if (*num_bytes >= 4 && 0 == memcmp("stop", buffer, 4)
&& keep_open_fd != -1) {
close(keep_open_fd);
keep_open_fd = -1;
return B_OK;
@ -136,6 +155,7 @@ audio_module_driver_write(void *cookie, off_t position, const void *buffer, size
return B_IO_ERROR;
}
static const char *ich_name[] = {
"audio/" DRIVER_NAME,
"audio/modules/foobar/1",
@ -145,6 +165,7 @@ static const char *ich_name[] = {
NULL
};
device_hooks audio_module_driver_hooks = {
audio_module_driver_open,
audio_module_driver_close,
@ -158,6 +179,7 @@ device_hooks audio_module_driver_hooks = {
NULL
};
const char**
publish_devices(void)
{
@ -165,6 +187,7 @@ publish_devices(void)
return ich_name;
}
device_hooks*
find_device(const char *name)
{

View File

@ -2,7 +2,7 @@ SubDir HAIKU_TOP src add-ons kernel drivers graphics matrox ;
SetSubDirSupportedPlatformsBeOSCompatible ;
UsePrivateHeaders graphics ;
UsePrivateHeaders graphics libroot ;
UsePrivateHeaders [ FDirName graphics matrox ] ;
KernelAddon matrox :

View File

@ -11,6 +11,7 @@
#include <KernelExport.h>
#include <PCI.h>
#include <OS.h>
#include <directories.h>
#include <driver_settings.h>
#include <malloc.h>
#include <stdlib.h> // for strtoXX
@ -142,7 +143,7 @@ static void dumprom (void *rom, size_t size, pci_info pcii)
char fname[64];
/* determine the romfile name: we need split-up per card in the system */
sprintf (fname, "/boot/home/" DRIVER_PREFIX "." DEVICE_FORMAT ".rom",
sprintf (fname, kUserDirectory "/" DRIVER_PREFIX "." DEVICE_FORMAT ".rom",
pcii.vendor_id, pcii.device_id, pcii.bus, pcii.device, pcii.function);
fd = open (fname, O_WRONLY | O_CREAT, 0666);

View File

@ -2,7 +2,7 @@ SubDir HAIKU_TOP src add-ons kernel drivers graphics neomagic ;
SetSubDirSupportedPlatformsBeOSCompatible ;
UsePrivateHeaders graphics ;
UsePrivateHeaders graphics libroot ;
UsePrivateHeaders [ FDirName graphics neomagic ] ;
KernelAddon neomagic :

View File

@ -13,6 +13,7 @@
#include <ISA.h>
#include <PCI.h>
#include <OS.h>
#include <directories.h>
#include <driver_settings.h>
#include <malloc.h>
#include <stdlib.h> // for strtoXX
@ -138,7 +139,8 @@ static void dumprom (void *rom, uint32 size)
int fd;
uint32 cnt;
fd = open ("/boot/home/" DRIVER_PREFIX ".rom", O_WRONLY | O_CREAT, 0666);
fd = open (kUserDirectory "/" DRIVER_PREFIX ".rom",
O_WRONLY | O_CREAT, 0666);
if (fd < 0) return;
/* apparantly max. 32kb may be written at once;

View File

@ -2,7 +2,7 @@ SubDir HAIKU_TOP src add-ons kernel drivers graphics nvidia ;
SetSubDirSupportedPlatformsBeOSCompatible ;
UsePrivateHeaders graphics ;
UsePrivateHeaders graphics libroot ;
UsePrivateHeaders [ FDirName graphics nvidia ] ;
UsePrivateHeaders [ FDirName graphics common ] ;

View File

@ -17,6 +17,7 @@
#include <ISA.h>
#include <PCI.h>
#include <OS.h>
#include <directories.h>
#include <driver_settings.h>
#include <stdlib.h>
@ -400,7 +401,7 @@ dumprom(void *rom, uint32 size, pci_info pcii)
char fname[64];
/* determine the romfile name: we need split-up per card in the system */
sprintf (fname, "/boot/home/" DRIVER_PREFIX "." DEVICE_FORMAT ".rom",
sprintf (fname, kUserDirectory "//" DRIVER_PREFIX "." DEVICE_FORMAT ".rom",
pcii.vendor_id, pcii.device_id, pcii.bus, pcii.device, pcii.function);
fd = open (fname, O_WRONLY | O_CREAT, 0666);

View File

@ -2,7 +2,7 @@ SubDir HAIKU_TOP src add-ons kernel drivers graphics nvidia_gpgpu ;
SetSubDirSupportedPlatformsBeOSCompatible ;
UsePrivateHeaders graphics ;
UsePrivateHeaders graphics libroot ;
UsePrivateHeaders [ FDirName graphics nvidia_gpgpu ] ;
KernelAddon nvidia_gpgpu :

View File

@ -16,6 +16,7 @@
#include <ISA.h>
#include <PCI.h>
#include <OS.h>
#include <directories.h>
#include <driver_settings.h>
#include <stdlib.h>
@ -160,7 +161,7 @@ dumprom(void *rom, uint32 size, pci_info pcii)
char fname[64];
/* determine the romfile name: we need split-up per card in the system */
sprintf (fname, "/boot/home/" DRIVER_PREFIX "." DEVICE_FORMAT ".rom",
sprintf (fname, kUserDirectory "/" DRIVER_PREFIX "." DEVICE_FORMAT ".rom",
pcii.vendor_id, pcii.device_id, pcii.bus, pcii.device, pcii.function);
fd = open (fname, O_WRONLY | O_CREAT, 0666);

View File

@ -2,7 +2,7 @@ SubDir HAIKU_TOP src add-ons kernel drivers graphics skeleton ;
SetSubDirSupportedPlatformsBeOSCompatible ;
UsePrivateHeaders graphics ;
UsePrivateHeaders graphics libroot ;
UsePrivateHeaders [ FDirName graphics skeleton ] ;
KernelAddon skel.driver :

View File

@ -12,6 +12,7 @@
#include <ISA.h>
#include <PCI.h>
#include <OS.h>
#include <directories.h>
#include <driver_settings.h>
#include <malloc.h>
#include <stdlib.h> // for strtoXX
@ -130,7 +131,8 @@ static void dumprom (void *rom, uint32 size)
int fd;
uint32 cnt;
fd = open ("/boot/home/" DRIVER_PREFIX ".rom", O_WRONLY | O_CREAT, 0666);
fd = open (kUserDirectory "/" DRIVER_PREFIX ".rom",
O_WRONLY | O_CREAT, 0666);
if (fd < 0) return;
/* apparantly max. 32kb may be written at once;

View File

@ -2,7 +2,7 @@ SubDir HAIKU_TOP src add-ons kernel drivers graphics via ;
SetSubDirSupportedPlatformsBeOSCompatible ;
UsePrivateHeaders graphics ;
UsePrivateHeaders graphics libroot ;
UsePrivateHeaders [ FDirName graphics via ] ;
KernelAddon via :

View File

@ -12,6 +12,7 @@
#include <ISA.h>
#include <PCI.h>
#include <OS.h>
#include <directories.h>
#include <driver_settings.h>
#include <malloc.h>
#include <stdlib.h> // for strtoXX
@ -135,7 +136,8 @@ static void dumprom (void *rom, uint32 size)
int fd;
uint32 cnt;
fd = open ("/boot/home/" DRIVER_PREFIX ".rom", O_WRONLY | O_CREAT, 0666);
fd = open (kUserDirectory "/" DRIVER_PREFIX ".rom",
O_WRONLY | O_CREAT, 0666);
if (fd < 0) return;
/* apparantly max. 32kb may be written at once;

View File

@ -4,7 +4,7 @@ SetSubDirSupportedPlatformsBeOSCompatible ;
# For ether_driver.h
UsePrivateHeaders net ;
UsePrivateHeaders libroot net ;
KernelAddon sis900 :
driver.c

View File

@ -11,6 +11,7 @@
#include "interface.h"
#include "sis900.h"
#include <directories.h>
#include <driver_settings.h>
#include <stdlib.h>
@ -63,7 +64,8 @@ bug(const char *format, ...)
int i;
int file;
if ((file = open("/boot/home/sis900-driver.log", O_RDWR | O_APPEND | O_CREAT)) >= 0) {
if ((file = open(kCommonLogDirectory "/sis900-driver.log",
O_RDWR | O_APPEND | O_CREAT)) >= 0) {
// time_t timer = time(NULL);
// strftime(c, 2048, "%H:%M:S: ", localtime(&timer));

View File

@ -26,15 +26,18 @@
#include <stdlib.h>
#include <stdio.h>
#include <directories.h>
#include <util/kernel_cpp.h>
#define DRIVER_NAME "usb_beceemwmx"
#define MAX_DEVICES 8
#define FIRM_BIN "/boot/system/data/firmware/macxvi200/macxvi200.bin"
#define FIRM_BIN \
kSystemDataDirectory "/firmware/macxvi200/macxvi200.bin"
// location on file system of device firmware
#define FIRM_CFG "/boot/system/data/firmware/macxvi200/macxvi.cfg"
#define FIRM_CFG \
kSystemDataDirectory "/firmware/macxvi200/macxvi.cfg"
// location on file system of vendor configuration
#define SYS_CFG 0x0F000C00

View File

@ -2,7 +2,7 @@ SubDir HAIKU_TOP src add-ons kernel drivers network wwan usb_beceemwmx ;
SetSubDirSupportedPlatformsBeOSCompatible ;
UsePrivateHeaders kernel net ;
UsePrivateHeaders kernel libroot net ;
KernelAddon usb_beceemwmx :
Driver.cpp

View File

@ -3,6 +3,7 @@ SubDir HAIKU_TOP src add-ons kernel drivers ports pc_serial ;
SetSubDirSupportedPlatformsBeOSCompatible ;
if $(TARGET_PLATFORM_HAIKU_COMPATIBLE) {
UsePrivateHeaders libroot ;
UsePrivateKernelHeaders ;
UseHeaders [ FDirName $(HAIKU_TOP) headers os drivers tty ] : true ;
}

View File

@ -11,6 +11,7 @@
#include <stdio.h> //sprintf
#include <unistd.h> //posix file i/o - create, write, close
#include <Drivers.h>
#include <directories.h>
#include <driver_settings.h>
@ -26,7 +27,7 @@ bool gLogFunctionCalls = false;
bool gLogFunctionReturns = false;
bool gLogFunctionResults = false;
static const char *sLogFilePath="/boot/home/"DRIVER_NAME".log";
static const char *sLogFilePath = kCommonLogDirectory "/" DRIVER_NAME ".log";
static sem_id sLogLock;
@ -187,4 +188,4 @@ trace_tty(struct tty *tty)
}
#endif /* __BEOS__ */
#endif /* __BEOS__ */

View File

@ -1,6 +1,7 @@
SubDir HAIKU_TOP src add-ons kernel drivers ports usb_serial ;
UsePrivateKernelHeaders ;
UsePrivateHeaders libroot ;
UseHeaders [ FDirName $(HAIKU_TOP) headers os drivers tty ] : true ;
SubDirC++Flags -fno-rtti ;

View File

@ -12,6 +12,7 @@
#include <stdio.h> //sprintf
#include <unistd.h> //posix file i/o - create, write, close
#include <Drivers.h>
#include <directories.h>
#include <driver_settings.h>
@ -27,7 +28,7 @@ bool gLogFunctionCalls = true;
bool gLogFunctionReturns = true;
bool gLogFunctionResults = true;
static const char *sLogFilePath="/boot/home/"DRIVER_NAME".log";
static const char *sLogFilePath = kCommonLogDirectory "/" DRIVER_NAME ".log";
static sem_id sLogLock;

View File

@ -2,7 +2,7 @@ SubDir HAIKU_TOP src add-ons kernel drivers video usb_vision ;
SetSubDirSupportedPlatformsBeOSCompatible ;
UsePrivateHeaders usb_vision ;
UsePrivateHeaders libroot usb_vision ;
#local defines = [ FDefines DB_USB_USE_V2_MODULE ] ;
#SubDirCcFlags $(defines) ;

View File

@ -12,6 +12,7 @@
#include <stdio.h> //sprintf
#include <string.h> //strcpy
#include <unistd.h> //posix file i/o - create, write, close
#include <directories.h>
#include <driver_settings.h>
#include "usb_vision.h"
@ -30,7 +31,8 @@ bool b_log_funcres = false;
bool b_log_settings_loaded = false;
static const char *private_log_path="/boot/home/"DRIVER_NAME".log";
static const char *private_log_path
= kCommonLogDirectory "/" DRIVER_NAME ".log";
static sem_id loglock;
void load_setting(void){

View File

@ -4,7 +4,7 @@ local userlandFSTop = [ FDirName $(HAIKU_TOP) src add-ons kernel file_systems
userlandfs ] ;
local userlandFSIncludes = [ PrivateHeaders userlandfs ] ;
UsePrivateHeaders shared ;
UsePrivateHeaders libroot shared ;
UsePrivateKernelHeaders ;
SubDirHdrs [ FDirName $(userlandFSIncludes) private ] ;
SubDirHdrs [ FDirName $(userlandFSIncludes) shared ] ;

View File

@ -6,6 +6,7 @@
#include <OS.h>
#include <directories.h>
#include <driver_settings.h>
#include <stdlib.h>
@ -37,7 +38,7 @@ strlcat(char *dst, char const *src, size_t s)
return j + i + strlen(src + i);
}
#define SETTINGS_DIRECTORY "/boot/home/config/settings/kernel/drivers/"
#define SETTINGS_DIRECTORY kUserSettingsDirectory "/kernel/drivers/"
#define SETTINGS_MAGIC 'DrvS'
// Those maximum values are independent from the implementation - they

View File

@ -1,5 +1,7 @@
SubDir HAIKU_TOP src add-ons kernel generic mpu401 ;
UsePrivateHeaders libroot ;
KernelAddon mpu401 :
mpu401.c
debug.c

View File

@ -25,17 +25,25 @@
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
#include <KernelExport.h>
#include <OS.h>
#include <stdio.h>
#include <fcntl.h>
#include <unistd.h>
#include <OS.h>
#include <string.h>
#include <unistd.h>
#include <directories.h>
#include "debug.h"
#define DRIVER_NAME "mpu401"
#define VERSION "0.2"
void debug_printf(const char *text,...)
{
char buf[1024];
@ -48,11 +56,12 @@ void debug_printf(const char *text,...)
dprintf(DRIVER_NAME ": %s",buf);
}
#if DEBUG > 0
static const char * logfile="/boot/home/mpu401.log";
#if DEBUG > 0
static const char *logfile = kCommonLogDirectory "/mpu401.log";
static sem_id loglock;
void log_create(void)
{
int fd = open(logfile, O_WRONLY | O_CREAT | O_TRUNC, 0666);
@ -62,6 +71,7 @@ void log_create(void)
close(fd);
}
void log_printf(const char *text,...)
{
int fd;
@ -84,5 +94,4 @@ void log_printf(const char *text,...)
snooze(150000);
#endif
}
#endif

View File

@ -10,7 +10,7 @@ if $(TARGET_PLATFORM) != haiku {
# Unfortunately we get more than we want, namely all POSIX headers.
}
UsePrivateHeaders net ;
UsePrivateHeaders libroot net ;
UsePrivateHeaders [ FDirName kernel ] ;
UsePrivateHeaders [ FDirName kernel util ] ;
UseHeaders [ FDirName $(HAIKU_TOP) src add-ons kernel network ppp shared

View File

@ -8,6 +8,8 @@
#include <SupportDefs.h>
#include <directories.h>
#include "net_module.h"
@ -37,10 +39,10 @@ typedef uint32 ppp_interface_id;
// path defines
#define PPP_MODULES_PATH NETWORK_MODULES_ROOT "ppp"
#define PTP_INTERFACE_SETTINGS_PATH \
"/boot/home/config/settings/kernel/drivers/ptpnet"
kUserSettingsDirectory "/kernel/drivers/ptpnet"
// TODO: should be: /etc/ptpnet
#define PTP_SETTINGS_PATH \
"/boot/home/config/settings/kernel/drivers/ptpnet.settings"
kUserSettingsDirectory "/kernel/drivers/ptpnet.settings"
// TODO: should be: /etc/ptpnet.settings
// built-in protocols

View File

@ -56,7 +56,7 @@ All rights reserved.
#include "BarApp.h"
#include "BarView.h"
#include "BarWindow.h"
#include "DeskBarUtils.h"
#include "DeskbarUtils.h"
#include "FSUtils.h"
#include "PublicCommands.h"
#include "ResourceSet.h"
@ -69,7 +69,7 @@ BList TBarApp::sBarTeamInfoList;
BList TBarApp::sSubscribers;
const uint32 kShowBeMenu = 'BeMn';
const uint32 kShowDeskbarMenu = 'BeMn';
const uint32 kShowTeamMenu = 'TmMn';
@ -340,9 +340,9 @@ TBarApp::MessageReceived(BMessage* message)
fPreferencesWindow->PostMessage(kStateChanged);
break;
case kShowBeMenu:
case kShowDeskbarMenu:
if (fBarWindow->Lock()) {
fBarWindow->ShowBeMenu();
fBarWindow->ShowDeskbarMenu();
fBarWindow->Unlock();
}
break;

View File

@ -45,8 +45,8 @@ All rights reserved.
#include "icons.h"
#include "icons_logo.h"
#include "BarWindow.h"
#include "BeMenu.h"
#include "DeskBarUtils.h"
#include "DeskbarMenu.h"
#include "DeskbarUtils.h"
#include "ResourceSet.h"
#include "TeamMenu.h"
@ -58,12 +58,12 @@ TBarMenuBar::TBarMenuBar(TBarView* bar, BRect frame, const char* name)
{
SetItemMargins(0.0f, 0.0f, 0.0f, 0.0f);
TBeMenu* beMenu = new TBeMenu(bar);
TBarWindow::SetBeMenu(beMenu);
TDeskbarMenu* beMenu = new TDeskbarMenu(bar);
TBarWindow::SetDeskbarMenu(beMenu);
fBeMenuItem = new TBarMenuTitle(frame.Width(), frame.Height(),
fDeskbarMenuItem = new TBarMenuTitle(frame.Width(), frame.Height(),
AppResSet()->FindBitmap(B_MESSAGE_TYPE, R_LeafLogoBitmap), beMenu);
AddItem(fBeMenuItem);
AddItem(fDeskbarMenuItem);
}
@ -85,8 +85,8 @@ TBarMenuBar::SmartResize(float width, float height)
width -= 1;
int32 count = CountItems();
if (fBeMenuItem)
fBeMenuItem->SetWidthHeight(width / count, height);
if (fDeskbarMenuItem)
fDeskbarMenuItem->SetWidthHeight(width / count, height);
if (fAppListMenuItem)
fAppListMenuItem->SetWidthHeight(width / count, height);
@ -195,10 +195,10 @@ TBarMenuBar::InitTrackingHook(bool (*hookFunction)(BMenu*, void*),
uint32 buttons;
GetMouse(&loc, &buttons);
// set the hook functions for the two menus
// will always have the be menu
// will always have the deskbar menu
// may have the app menu as well (mini mode)
if (fBeMenuItem->Frame().Contains(loc) || both)
init_tracking_hook(fBeMenuItem, hookFunction, state);
if (fDeskbarMenuItem->Frame().Contains(loc) || both)
init_tracking_hook(fDeskbarMenuItem, hookFunction, state);
if (fAppListMenuItem && (fAppListMenuItem->Frame().Contains(loc) || both))
init_tracking_hook(fAppListMenuItem, hookFunction, state);

View File

@ -67,7 +67,7 @@ class TBarMenuBar : public BMenuBar {
private:
TBarView* fBarView;
TBarMenuTitle* fBeMenuItem;
TBarMenuTitle* fDeskbarMenuItem;
TBarMenuTitle* fAppListMenuItem;
};

View File

@ -200,8 +200,8 @@ TBarMenuTitle::Invoke(BMessage* message)
if (barview) {
BLooper* looper = barview->Looper();
if (looper->Lock()) {
// tell barview to add the refs to the be menu
barview->HandleBeMenu(NULL);
// tell barview to add the refs to the deskbar menu
barview->HandleDeskbarMenu(NULL);
looper->Unlock();
}
}

View File

@ -53,8 +53,8 @@ All rights reserved.
#include "BarApp.h"
#include "BarMenuBar.h"
#include "BarWindow.h"
#include "BeMenu.h"
#include "DeskBarUtils.h"
#include "DeskbarMenu.h"
#include "DeskbarUtils.h"
#include "ExpandoMenuBar.h"
#include "FSUtils.h"
#include "ResourceSet.h"
@ -160,7 +160,7 @@ TBarView::MessageReceived(BMessage* message)
case B_REFS_RECEIVED:
// received when an item is selected during DnD
// message is targeted here from Be menu
HandleBeMenu(message);
HandleDeskbarMenu(message);
break;
case B_ARCHIVED_OBJECT:
@ -264,7 +264,7 @@ TBarView::MouseDown(BPoint where)
void
TBarView::PlaceBeMenu()
TBarView::PlaceDeskbarMenu()
{
// top or bottom, full
if (!fVertical && fBarMenuBar) {
@ -305,7 +305,7 @@ TBarView::PlaceBeMenu()
width = floorf(width) / 2;
loc = Bounds().LeftTop();
} else {
// mini mode, BeMenu next to team menu
// mini mode, DeskbarMenu next to team menu
fBarMenuBar->AddTeamMenu();
}
@ -528,7 +528,7 @@ TBarView::ChangeState(int32 state, bool vertical, bool left, bool top)
BRect screenFrame = (BScreen(Window())).Frame();
PlaceBeMenu();
PlaceDeskbarMenu();
PlaceTray(vertSwap, leftSwap, screenFrame);
// Keep track of which apps are expanded
@ -821,12 +821,12 @@ TBarView::MenuTrackingHook(BMenu* menu, void* castToThis)
// keep tracking
endMenu = false;
} else {
// see if the mouse is in the team/be menu item
// see if the mouse is in the team/deskbar menu item
menu->ConvertToScreen(&location);
if (barview->LockLooper()) {
TExpandoMenuBar* expando = barview->ExpandoMenuBar();
TBeMenu* bemenu
= (dynamic_cast<TBarWindow*>(barview->Window()))->BeMenu();
TDeskbarMenu* bemenu
= (dynamic_cast<TBarWindow*>(barview->Window()))->DeskbarMenu();
if (bemenu && bemenu->LockLooper()) {
bemenu->ConvertFromScreen(&location);
@ -987,7 +987,7 @@ TBarView::InvokeItem(const char* signature)
void
TBarView::HandleBeMenu(BMessage* messagewithdestination)
TBarView::HandleDeskbarMenu(BMessage* messagewithdestination)
{
if (!Dragging())
return;
@ -1011,13 +1011,13 @@ TBarView::HandleBeMenu(BMessage* messagewithdestination)
if (entry.IsDirectory()) {
// if the ref received (should only be 1) is a directory
// then add the drag refs to the directory
AddRefsToBeMenu(DragMessage(), &ref);
AddRefsToDeskbarMenu(DragMessage(), &ref);
} else
SendDragMessage(NULL, &ref);
}
} else {
// adds drag refs to top level in be menu
AddRefsToBeMenu(DragMessage(), NULL);
// adds drag refs to top level in deskbar menu
AddRefsToDeskbarMenu(DragMessage(), NULL);
}
// clean up drag message and types list

View File

@ -114,7 +114,7 @@ class TBarView : public BView {
bool DragOverride();
bool InvokeItem(const char* signature);
void HandleBeMenu(BMessage* targetmessage);
void HandleDeskbarMenu(BMessage* targetmessage);
status_t ItemInfo(int32 id, const char** name, DeskbarShelf* shelf);
status_t ItemInfo(const char* name, int32* id, DeskbarShelf* shelf);
@ -145,12 +145,12 @@ class TBarView : public BView {
void AddExpandedItem(const char* signature);
private:
friend class TBeMenu;
friend class TDeskbarMenu;
friend class PreferencesWindow;
status_t SendDragMessage(const char* signature, entry_ref* ref = NULL);
void PlaceBeMenu();
void PlaceDeskbarMenu();
void PlaceTray(bool vertSwap, bool leftSwap, BRect screenFrame);
void PlaceApplicationBar(BRect screenFrame);
void SaveExpandedItems();

View File

@ -52,7 +52,7 @@ All rights reserved.
#include "BarApp.h"
#include "BarMenuBar.h"
#include "BarView.h"
#include "BeMenu.h"
#include "DeskbarMenu.h"
#include "PublicCommands.h"
#include "StatusView.h"
#include "tracker_private.h"
@ -80,7 +80,7 @@ extern "C" void
BMenuBar_StartMenuBar_Hack(BMenuBar*, int32, bool, bool, BRect*);
TBeMenu* TBarWindow::sBeMenu = NULL;
TDeskbarMenu* TBarWindow::sDeskbarMenu = NULL;
TBarWindow::TBarWindow()
@ -118,18 +118,18 @@ TBarWindow::MenusBeginning()
if (entry.InitCheck() == B_OK && entry.IsDirectory()) {
// need the entry_ref to the actual item
entry.GetRef(&ref);
// set the nav directory to the be folder
sBeMenu->SetNavDir(&ref);
// set the nav directory to the deskbar folder
sDeskbarMenu->SetNavDir(&ref);
} else if (!entry.Exists()) {
// the Be folder does not exist
// the deskbar folder does not exist
// create one now
BDirectory dir;
if (entry.GetParent(&dir) == B_OK) {
BDirectory bedir;
dir.CreateDirectory("be", &bedir);
if (bedir.GetEntry(&entry) == B_OK
BDirectory deskbarDir;
dir.CreateDirectory("deskbar", &deskbarDir);
if (deskbarDir.GetEntry(&entry) == B_OK
&& entry.GetRef(&ref) == B_OK)
sBeMenu->SetNavDir(&ref);
sDeskbarMenu->SetNavDir(&ref);
}
} else {
// this really should never happen
@ -137,8 +137,8 @@ TBarWindow::MenusBeginning()
return;
}
sBeMenu->NeedsToRebuild();
sBeMenu->ResetTargets();
sDeskbarMenu->NeedsToRebuild();
sDeskbarMenu->ResetTargets();
fBarView->SetEventMask(0);
// This works around a BeOS bug - the menu is quit with every
@ -153,10 +153,10 @@ TBarWindow::MenusEnded()
{
BWindow::MenusEnded();
if (sBeMenu->LockLooper()) {
if (sDeskbarMenu->LockLooper()) {
// TODO: is this ok?
sBeMenu->RemoveItems(0, sBeMenu->CountItems(), true);
sBeMenu->UnlockLooper();
sDeskbarMenu->RemoveItems(0, sDeskbarMenu->CountItems(), true);
sDeskbarMenu->UnlockLooper();
}
fBarView->UpdateEventMask();
@ -273,21 +273,21 @@ TBarWindow::ScreenChanged(BRect size, color_space depth)
void
TBarWindow::SetBeMenu(TBeMenu* menu)
TBarWindow::SetDeskbarMenu(TDeskbarMenu* menu)
{
sBeMenu = menu;
sDeskbarMenu = menu;
}
TBeMenu*
TBarWindow::BeMenu()
TDeskbarMenu*
TBarWindow::DeskbarMenu()
{
return sBeMenu;
return sDeskbarMenu;
}
void
TBarWindow::ShowBeMenu()
TBarWindow::ShowDeskbarMenu()
{
BMenuBar* menuBar = fBarView->BarMenuBar();
if (menuBar == NULL)

View File

@ -40,7 +40,7 @@ All rights reserved.
#include <Window.h>
class TBeMenu;
class TDeskbarMenu;
class TBarView;
@ -59,10 +59,10 @@ public:
void SaveSettings();
TBarView* BarView() const { return fBarView; };
static void SetBeMenu(TBeMenu* menu);
TBeMenu* BeMenu();
static void SetDeskbarMenu(TDeskbarMenu* menu);
TDeskbarMenu* DeskbarMenu();
void ShowBeMenu();
void ShowDeskbarMenu();
void ShowTeamMenu();
void GetLocation(BMessage* message);
@ -88,7 +88,7 @@ private:
bool _IsFocusMessage(BMessage* message);
private:
static TBeMenu* sBeMenu;
static TDeskbarMenu* sDeskbarMenu;
TBarView* fBarView;
};

View File

@ -42,10 +42,14 @@ All rights reserved.
#include <MenuItem.h>
#include <Roster.h>
#include "BeMenu.h"
#include "DeskbarMenu.h"
#include "BarApp.h"
#include "BarView.h"
#include "DeskBarUtils.h"
#include "DeskbarUtils.h"
#include "IconMenuItem.h"
#include "MountMenu.h"
#include "IconMenuItem.h"
#include "MountMenu.h"
#include "IconMenuItem.h"
#include "MountMenu.h"
#include "PublicCommands.h"
@ -54,7 +58,7 @@ All rights reserved.
#include "tracker_private.h"
#undef B_TRANSLATE_CONTEXT
#define B_TRANSLATE_CONTEXT "BeMenu"
#define B_TRANSLATE_CONTEXT "DeskbarMenu"
#define ROSTER_SIG "application/x-vnd.Be-ROST"
@ -81,8 +85,8 @@ using namespace BPrivate;
// #pragma mark -
TBeMenu::TBeMenu(TBarView* barView)
: BNavMenu("BeMenu", B_REFS_RECEIVED, DefaultTarget()),
TDeskbarMenu::TDeskbarMenu(TBarView* barView)
: BNavMenu("DeskbarMenu", B_REFS_RECEIVED, DefaultTarget()),
fAddState(kStart),
fBarView(barView)
{
@ -90,7 +94,7 @@ TBeMenu::TBeMenu(TBarView* barView)
void
TBeMenu::AttachedToWindow()
TDeskbarMenu::AttachedToWindow()
{
if (fBarView && fBarView->LockLooper()) {
if (fBarView->Dragging()) {
@ -113,7 +117,7 @@ TBeMenu::AttachedToWindow()
void
TBeMenu::DetachedFromWindow()
TDeskbarMenu::DetachedFromWindow()
{
if (fBarView) {
BLooper* looper = fBarView->Looper();
@ -130,7 +134,7 @@ TBeMenu::DetachedFromWindow()
bool
TBeMenu::StartBuildingItemList()
TDeskbarMenu::StartBuildingItemList()
{
RemoveItems(0, CountItems(), true);
fAddState = kStart;
@ -139,11 +143,11 @@ TBeMenu::StartBuildingItemList()
void
TBeMenu::DoneBuildingItemList()
TDeskbarMenu::DoneBuildingItemList()
{
if (fItemList->CountItems() <= 0) {
BMenuItem* item = new BMenuItem(B_TRANSLATE("<Be folder is empty>"),
0);
BMenuItem* item
= new BMenuItem(B_TRANSLATE("<Deskbar folder is empty>"), 0);
item->SetEnabled(false);
AddItem(item);
} else
@ -152,10 +156,10 @@ TBeMenu::DoneBuildingItemList()
bool
TBeMenu::AddNextItem()
TDeskbarMenu::AddNextItem()
{
if (fAddState == kStart)
return AddStandardBeMenuItems();
return AddStandardDeskbarMenuItems();
TrackingHookData* data = fBarView->GetTrackingHookData();
if (fAddState == kAddingRecents) {
@ -199,11 +203,11 @@ TBeMenu::AddNextItem()
}
AddSeparatorItem();
fAddState = kAddingBeMenu;
fAddState = kAddingDeskbarMenu;
return true;
}
if (fAddState == kAddingBeMenu) {
if (fAddState == kAddingDeskbarMenu) {
// keep reentering and adding items
// until this returns false
bool done = BNavMenu::AddNextItem();
@ -229,7 +233,7 @@ TBeMenu::AddNextItem()
bool
TBeMenu::AddStandardBeMenuItems()
TDeskbarMenu::AddStandardDeskbarMenuItems()
{
bool dragging = false;
if (fBarView)
@ -341,7 +345,7 @@ TBeMenu::AddStandardBeMenuItems()
void
TBeMenu::ClearMenuBuildingState()
TDeskbarMenu::ClearMenuBuildingState()
{
fAddState = kDone;
fMenuBuilt = false;
@ -351,7 +355,7 @@ TBeMenu::ClearMenuBuildingState()
void
TBeMenu::ResetTargets()
TDeskbarMenu::ResetTargets()
{
// This method does not recurse into submenus
// and does not affect menu items in submenus.
@ -396,7 +400,7 @@ TBeMenu::ResetTargets()
BPoint
TBeMenu::ScreenLocation()
TDeskbarMenu::ScreenLocation()
{
bool vertical = fBarView->Vertical();
int32 expando = (fBarView->State() == kExpandoState);
@ -420,7 +424,7 @@ TBeMenu::ScreenLocation()
/*static*/
BMessenger
TBeMenu::DefaultTarget()
TDeskbarMenu::DefaultTarget()
{
// if Tracker is not available we target the BarApp
BMessenger target(kTrackerSignature);
@ -436,7 +440,7 @@ TBeMenu::DefaultTarget()
TRecentsMenu::TRecentsMenu(const char* name, TBarView* bar, int32 which,
const char* signature, entry_ref* appRef)
: BNavMenu(name, B_REFS_RECEIVED, TBeMenu::DefaultTarget()),
: BNavMenu(name, B_REFS_RECEIVED, TDeskbarMenu::DefaultTarget()),
fWhich(which),
fAppRef(NULL),
fSignature(NULL),
@ -640,7 +644,7 @@ TRecentsMenu::ResetTargets()
// if we are dragging, set the target to whatever was set
// else set it to the default (Tracker)
if (!fBarView->Dragging())
SetTarget(TBeMenu::DefaultTarget());
SetTarget(TDeskbarMenu::DefaultTarget());
// now set the target for the menuitems to the currently
// set target, which may or may not be tracker

View File

@ -33,8 +33,8 @@ holders.
All rights reserved.
*/
#ifndef _BE_MENU_H_
#define _BE_MENU_H_
#ifndef _DESKBAR_MENU_H_
#define _DESKBAR_MENU_H_
#include "NavMenu.h"
@ -96,9 +96,9 @@ TRecentsMenu::RecentsEnabled()
}
class TBeMenu : public BNavMenu {
class TDeskbarMenu : public BNavMenu {
public:
TBeMenu(TBarView* bar);
TDeskbarMenu(TBarView* bar);
void AttachedToWindow();
void DetachedFromWindow();
@ -111,13 +111,13 @@ class TBeMenu : public BNavMenu {
enum State {
kStart,
kAddingRecents,
kAddingBeMenu,
kAddingDeskbarMenu,
kDone
};
protected:
BPoint ScreenLocation();
bool AddStandardBeMenuItems();
bool AddStandardDeskbarMenuItems();
private:
virtual bool StartBuildingItemList();
@ -130,5 +130,5 @@ class TBeMenu : public BNavMenu {
TBarView* fBarView;
};
#endif /* _BE_MENU_H_ */
#endif /* _DESKBAR_MENU_H_ */

View File

@ -51,11 +51,11 @@ All rights reserved.
#include <SymLink.h>
#include "BarMenuBar.h"
#include "DeskBarUtils.h"
#include "DeskbarUtils.h"
#include "ExpandoMenuBar.h"
void
AddRefsToBeMenu(const BMessage* m, entry_ref* subdirectory)
AddRefsToDeskbarMenu(const BMessage* m, entry_ref* subdirectory)
{
if (m) {
int32 count = 0;

View File

@ -39,7 +39,7 @@ All rights reserved.
#include "tracker_private.h"
void AddRefsToBeMenu(const BMessage* m, entry_ref* subdirectory);
void AddRefsToDeskbarMenu(const BMessage* m, entry_ref* subdirectory);
#endif /* DB_UTILS_H */

View File

@ -49,8 +49,8 @@ All rights reserved.
#include "BarApp.h"
#include "BarMenuTitle.h"
#include "BarView.h"
#include "BeMenu.h"
#include "DeskBarUtils.h"
#include "DeskbarMenu.h"
#include "DeskbarUtils.h"
#include "ExpandoMenuBar.h"
#include "ResourceSet.h"
#include "ShowHideMenuItem.h"
@ -59,7 +59,7 @@ All rights reserved.
#include "WindowMenu.h"
#include "WindowMenuItem.h"
const float kDefaultBeMenuWidth = 50.0f;
const float kDefaultDeskbarMenuWidth = 50.0f;
const float kSepItemWidth = 5.0f;
const uint32 kMinimizeTeam = 'mntm';
@ -82,7 +82,7 @@ TExpandoMenuBar::TExpandoMenuBar(TBarView* bar, BRect frame, const char* name,
fIsScrolling(false),
fShowTeamExpander(static_cast<TBarApp*>(be_app)->Settings()->superExpando),
fExpandNewTeams(static_cast<TBarApp*>(be_app)->Settings()->expandNewTeams),
fBeMenuWidth(kDefaultBeMenuWidth),
fDeskbarMenuWidth(kDefaultDeskbarMenuWidth),
fBarView(bar),
fFirstApp(0),
fPreviousDragTargetItem(NULL),
@ -111,24 +111,25 @@ TExpandoMenuBar::AttachedToWindow()
float width = fVertical ? Frame().Width() : sMinimumWindowWidth;
float height = -1.0f;
// top or bottom mode, add be menu and sep for menubar tracking consistency
// top or bottom mode, add deskbar menu and sep for menubar tracking
// consistency
if (!fVertical) {
TBeMenu* beMenu = new TBeMenu(fBarView);
TBarWindow::SetBeMenu(beMenu);
TDeskbarMenu* beMenu = new TDeskbarMenu(fBarView);
TBarWindow::SetDeskbarMenu(beMenu);
const BBitmap* logoBitmap = AppResSet()->FindBitmap(B_MESSAGE_TYPE,
R_LeafLogoBitmap);
if (logoBitmap != NULL)
fBeMenuWidth = logoBitmap->Bounds().Width() + 16;
fBeMenuItem = new TBarMenuTitle(fBeMenuWidth, Frame().Height(),
fDeskbarMenuWidth = logoBitmap->Bounds().Width() + 16;
fDeskbarMenuItem = new TBarMenuTitle(fDeskbarMenuWidth, Frame().Height(),
logoBitmap, beMenu, true);
AddItem(fBeMenuItem);
AddItem(fDeskbarMenuItem);
fSeparatorItem = new TTeamMenuItem(kSepItemWidth, height, fVertical);
AddItem(fSeparatorItem);
fSeparatorItem->SetEnabled(false);
fFirstApp = 2;
} else {
fBeMenuItem = NULL;
fDeskbarMenuItem = NULL;
fSeparatorItem = NULL;
}
@ -438,21 +439,21 @@ TExpandoMenuBar::MouseUp(BPoint where)
bool
TExpandoMenuBar::InBeMenu(BPoint loc) const
TExpandoMenuBar::InDeskbarMenu(BPoint loc) const
{
if (!fVertical) {
if (fBeMenuItem && fBeMenuItem->Frame().Contains(loc))
if (fDeskbarMenuItem && fDeskbarMenuItem->Frame().Contains(loc))
return true;
} else {
TBarWindow* window = dynamic_cast<TBarWindow*>(Window());
if (window) {
if (TBeMenu* bemenu = window->BeMenu()) {
bool inBeMenu = false;
if (TDeskbarMenu* bemenu = window->DeskbarMenu()) {
bool inDeskbarMenu = false;
if (bemenu->LockLooper()) {
inBeMenu = bemenu->Frame().Contains(loc);
inDeskbarMenu = bemenu->Frame().Contains(loc);
bemenu->UnlockLooper();
}
return inBeMenu;
return inDeskbarMenu;
}
}
}
@ -617,8 +618,8 @@ TExpandoMenuBar::CheckItemSizes(int32 delta)
// - The Be Menu
// - The little separator item
fullWidth = fullWidth - (sMinimumWindowWidth * 2)
+ (fBeMenuWidth + kSepItemWidth);
width -= (fBeMenuWidth + kSepItemWidth);
+ (fDeskbarMenuWidth + kSepItemWidth);
width -= (fDeskbarMenuWidth + kSepItemWidth);
count -= 2;
}

View File

@ -52,7 +52,7 @@ class TTeamMenuItem;
enum drag_and_drop_selection {
kNoSelection,
kBeMenuSelection,
kDeskbarMenuSelection,
kAppMenuSelection,
kAnyMenuSelection
};
@ -74,7 +74,7 @@ class TExpandoMenuBar : public BMenuBar {
TTeamMenuItem* TeamItemAtPoint(BPoint location,
BMenuItem** _item = NULL);
bool InBeMenu(BPoint) const;
bool InDeskbarMenu(BPoint) const;
void CheckItemSizes(int32 delta);
@ -100,12 +100,12 @@ class TExpandoMenuBar : public BMenuBar {
bool fShowTeamExpander : 1;
bool fExpandNewTeams : 1;
float fBeMenuWidth;
float fDeskbarMenuWidth;
TBarView* fBarView;
int32 fFirstApp;
TBarMenuTitle* fBeMenuItem;
TBarMenuTitle* fDeskbarMenuItem;
TTeamMenuItem* fSeparatorItem;
TTeamMenuItem* fPreviousDragTargetItem;

View File

@ -24,8 +24,8 @@ Application Deskbar :
BarMenuTitle.cpp
BarView.cpp
BarWindow.cpp
BeMenu.cpp
DeskBarUtils.cpp
DeskbarMenu.cpp
DeskbarUtils.cpp
ExpandoMenuBar.cpp
PreferencesWindow.cpp
ShowHideMenuItem.cpp
@ -46,7 +46,7 @@ DoCatalogs Deskbar :
x-vnd.Be-TSKB
:
BarWindow.cpp
BeMenu.cpp
DeskbarMenu.cpp
LocalizedFolders.h
PreferencesWindow.cpp
StatusView.cpp

View File

@ -66,7 +66,7 @@ All rights reserved.
#include "icons_logo.h"
#include "BarApp.h"
#include "DeskBarUtils.h"
#include "DeskbarUtils.h"
#include "ResourceSet.h"
#include "StatusView.h"
#include "StatusViewShelf.h"

View File

@ -41,7 +41,7 @@ All rights reserved.
#include "BarApp.h"
#include "BarMenuBar.h"
#include "DeskBarUtils.h"
#include "DeskbarUtils.h"
#include "TeamMenuItem.h"
#include "TeamMenu.h"

View File

@ -30,6 +30,8 @@
#include <Application.h>
#include <Catalog.h>
#include <Deskbar.h>
#include <FindDirectory.h>
#include <Path.h>
#include <Roster.h>
#include <stdio.h>
@ -139,8 +141,16 @@ PCApplication::ArgvReceived(int32 argc, char **argv)
snooze(10000);
} while (be_roster->IsRunning(kTrackerSig) && k-- > 0);
}
remove("/boot/home/config/settings/Tracker/tracker_shelf");
launch(kTrackerSig, "/boot/system/Tracker");
BPath shelfPath;
if (find_directory(B_USER_SETTINGS_DIRECTORY, &shelfPath) == B_OK
&& shelfPath.Append("Tracker/tracker_shelf") == B_OK) {
remove(shelfPath.Path());
}
BPath trackerPath;
if (find_directory(B_SYSTEM_DIRECTORY, &trackerPath) == B_OK
&& trackerPath.Append("Tracker") == B_OK) {
launch(kTrackerSig, trackerPath.Path());
}
} else if (argc == 2 && strcmp(argv[1], "-deskbar") == 0) {
BDeskbar deskbar;
if (!gInDeskbar && !deskbar.HasItem(kDeskbarItemName))

View File

@ -345,21 +345,45 @@ ProcessController::MessageReceived(BMessage *message)
break;
case 'Trac':
launch(kTrackerSig, "/boot/system/Tracker");
{
BPath trackerPath;
if (find_directory(B_SYSTEM_DIRECTORY, &trackerPath) == B_OK
&& trackerPath.Append("Tracker") == B_OK) {
launch(kTrackerSig, trackerPath.Path());
}
break;
}
case 'Dbar':
launch(kDeskbarSig, "/boot/system/Deskbar");
{
BPath deskbarPath;
if (find_directory(B_SYSTEM_DIRECTORY, &deskbarPath) == B_OK
&& deskbarPath.Append("Deskbar") == B_OK) {
launch(kDeskbarSig, deskbarPath.Path());
}
break;
}
case 'Term':
launch(kTerminalSig, "/boot/system/apps/Terminal");
{
BPath terminalPath;
if (find_directory(B_SYSTEM_APPS_DIRECTORY, &terminalPath) == B_OK
&& terminalPath.Append("Deskbar") == B_OK) {
launch(kTerminalSig, terminalPath.Path());
}
launch(kTerminalSig, terminalPath.Path());
break;
}
case 'AlDb':
{
if (!be_roster->IsRunning(kDeskbarSig))
launch(kDeskbarSig, "/boot/system/Deskbar");
if (!be_roster->IsRunning(kDeskbarSig)) {
BPath deskbarPath;
if (find_directory(B_SYSTEM_DIRECTORY, &deskbarPath) == B_OK
&& deskbarPath.Append("Deskbar") == B_OK) {
launch(kDeskbarSig, deskbarPath.Path());
}
}
BDeskbar deskbar;
if (gInDeskbar || deskbar.HasItem (kDeskbarItemName))
deskbar.RemoveItem (kDeskbarItemName);

View File

@ -7,6 +7,8 @@
*/
#include <Application.h>
#include <FindDirectory.h>
#include <Path.h>
#include <Screen.h>
#include <Window.h>
@ -40,7 +42,6 @@ main(int argc, char *argv[])
bool listenOnly = false;
uint32 listenPort = 10900;
uint32 sshPort = 22;
const char *command = "/system/apps/Terminal";
for (int32 i = 2; i < argc; i++) {
if (strcmp(argv[i], "-p") == 0) {
@ -85,10 +86,21 @@ main(int argc, char *argv[])
pid_t sshPID = -1;
if (!listenOnly) {
BPath terminalPath;
if (find_directory(B_SYSTEM_APPS_DIRECTORY, &terminalPath) != B_OK) {
printf("failed to determine system-apps directory\n");
return 3;
}
if (terminalPath.Append("Terminal") != B_OK) {
printf("failed to append to system-apps path\n");
return 3;
}
char shellCommand[4096];
snprintf(shellCommand, sizeof(shellCommand),
"echo connected; export TARGET_SCREEN=localhost:%lu; %s\n",
listenPort, command);
listenPort, terminalPath.Path());
int pipes[4];
if (pipe(&pipes[0]) != 0 || pipe(&pipes[2]) != 0) {

View File

@ -54,7 +54,10 @@
/* The default value of the PATH variable. */
#ifndef DEFAULT_PATH_VALUE
#define DEFAULT_PATH_VALUE \
".:/boot/home/config/bin:/bin:/boot/apps:/boot/preferences:/boot/system/apps:/boot/system/preferences:/boot/develop/bin"
".:/boot/home/config/bin:/bin:/boot/apps:/boot/preferences" \
":/boot/system/apps" \
":/boot/system/preferences" \
":/boot/common/settings/develop/tools/current/bin"
#endif
/* The value for PATH when invoking `command -p'. This is only used when

View File

@ -28,6 +28,7 @@
#define SYS_PROFILE "/etc/profile"
/* The default location of the bash debugger initialization/startup file. */
#define DEBUGGER_START_FILE "/boot/common/share/bashdb/bashdb-main.inc"
#define DEBUGGER_START_FILE \
"/boot/common/share/bashdb/bashdb-main.inc"
#endif /* _PATHNAMES_H */

View File

@ -17,7 +17,9 @@
#include <string>
#include <debugger.h>
#include <FindDirectory.h>
#include <OS.h>
#include <Path.h>
#include <String.h>
#include <syscalls.h>
@ -454,7 +456,13 @@ private:
BString name = imageInfo.name;
if (name.FindFirst('/') == -1) {
// modules without a path are likely to be boot modules
name.Prepend("/system/add-ons/kernel/boot/");
BPath bootAddonPath;
if (find_directory(B_SYSTEM_ADDONS_DIRECTORY,
&bootAddonPath) == B_OK
&& bootAddonPath.Append("kernel") == B_OK
&& bootAddonPath.Append("boot") == B_OK) {
name = BString(bootAddonPath.Path()) << "/" << name;
}
}
error = sharedImage->Init(name.String());

View File

@ -28,6 +28,7 @@ directoryType directoryTypes[] = {
KEYVALUE_PAIR(B_DESKTOP_DIRECTORY),
KEYVALUE_PAIR(B_TRASH_DIRECTORY),
KEYVALUE_PAIR(B_APPS_DIRECTORY),
KEYVALUE_PAIR(B_PACKAGE_LINKS_DIRECTORY),
KEYVALUE_PAIR(B_PREFERENCES_DIRECTORY),
KEYVALUE_PAIR(B_UTILITIES_DIRECTORY),
@ -46,6 +47,9 @@ directoryType directoryTypes[] = {
KEYVALUE_PAIR(B_SYSTEM_MEDIA_NODES_DIRECTORY),
KEYVALUE_PAIR(B_SYSTEM_SOUNDS_DIRECTORY),
KEYVALUE_PAIR(B_SYSTEM_DATA_DIRECTORY),
KEYVALUE_PAIR(B_SYSTEM_DEVELOP_DIRECTORY),
KEYVALUE_PAIR(B_SYSTEM_PACKAGES_DIRECTORY),
KEYVALUE_PAIR(B_SYSTEM_HEADERS_DIRECTORY),
// Common directories
KEYVALUE_PAIR(B_COMMON_DIRECTORY),
@ -69,6 +73,19 @@ directoryType directoryTypes[] = {
KEYVALUE_PAIR(B_COMMON_SOUNDS_DIRECTORY),
KEYVALUE_PAIR(B_COMMON_DATA_DIRECTORY),
KEYVALUE_PAIR(B_COMMON_CACHE_DIRECTORY),
KEYVALUE_PAIR(B_COMMON_PACKAGES_DIRECTORY),
KEYVALUE_PAIR(B_COMMON_HEADERS_DIRECTORY),
KEYVALUE_PAIR(B_COMMON_NONPACKAGED_DIRECTORY),
KEYVALUE_PAIR(B_COMMON_NONPACKAGED_ADDONS_DIRECTORY),
KEYVALUE_PAIR(B_COMMON_NONPACKAGED_TRANSLATORS_DIRECTORY),
KEYVALUE_PAIR(B_COMMON_NONPACKAGED_MEDIA_NODES_DIRECTORY),
KEYVALUE_PAIR(B_COMMON_NONPACKAGED_BIN_DIRECTORY),
KEYVALUE_PAIR(B_COMMON_NONPACKAGED_DATA_DIRECTORY),
KEYVALUE_PAIR(B_COMMON_NONPACKAGED_FONTS_DIRECTORY),
KEYVALUE_PAIR(B_COMMON_NONPACKAGED_SOUNDS_DIRECTORY),
KEYVALUE_PAIR(B_COMMON_NONPACKAGED_DOCUMENTATION_DIRECTORY),
KEYVALUE_PAIR(B_COMMON_NONPACKAGED_LIB_DIRECTORY),
KEYVALUE_PAIR(B_COMMON_NONPACKAGED_HEADERS_DIRECTORY),
// User directories
KEYVALUE_PAIR(B_USER_DIRECTORY),
@ -85,6 +102,19 @@ directoryType directoryTypes[] = {
KEYVALUE_PAIR(B_USER_SOUNDS_DIRECTORY),
KEYVALUE_PAIR(B_USER_DATA_DIRECTORY),
KEYVALUE_PAIR(B_USER_CACHE_DIRECTORY),
KEYVALUE_PAIR(B_USER_PACKAGES_DIRECTORY),
KEYVALUE_PAIR(B_USER_HEADERS_DIRECTORY),
KEYVALUE_PAIR(B_USER_NONPACKAGED_DIRECTORY),
KEYVALUE_PAIR(B_USER_NONPACKAGED_ADDONS_DIRECTORY),
KEYVALUE_PAIR(B_USER_NONPACKAGED_TRANSLATORS_DIRECTORY),
KEYVALUE_PAIR(B_USER_NONPACKAGED_MEDIA_NODES_DIRECTORY),
KEYVALUE_PAIR(B_USER_NONPACKAGED_BIN_DIRECTORY),
KEYVALUE_PAIR(B_USER_NONPACKAGED_DATA_DIRECTORY),
KEYVALUE_PAIR(B_USER_NONPACKAGED_FONTS_DIRECTORY),
KEYVALUE_PAIR(B_USER_NONPACKAGED_SOUNDS_DIRECTORY),
KEYVALUE_PAIR(B_USER_NONPACKAGED_DOCUMENTATION_DIRECTORY),
KEYVALUE_PAIR(B_USER_NONPACKAGED_LIB_DIRECTORY),
KEYVALUE_PAIR(B_USER_NONPACKAGED_HEADERS_DIRECTORY),
// Legacy system directories
KEYVALUE_PAIR(B_BEOS_DIRECTORY),

View File

@ -149,9 +149,7 @@ struct PackageContentListHandler : BPackageContentHandler {
break;
case B_PACKAGE_INFO_VERSION:
printf("\tversion: %s.%s.%s-%d\n", value.version.major,
value.version.minor, value.version.micro,
value.version.release);
_PrintPackageVersion(value.version);
break;
case B_PACKAGE_INFO_COPYRIGHTS:

View File

@ -41,6 +41,7 @@
#include <Path.h>
#include <Query.h>
#include <RegistrarDefs.h>
#include <String.h>
#include <Volume.h>
#include <VolumeRoster.h>
@ -242,13 +243,15 @@ compare_queried_apps(const entry_ref* app1, const entry_ref* app2)
}
}
// Check system folder
// Check system servers folder
BPath path;
find_directory(B_SYSTEM_SERVERS_DIRECTORY, &path);
BString serverPath(path.Path());
serverPath << '/';
size_t length = serverPath.Length();
static const char* kSystemPath = "/boot/system/servers/";
size_t length = strlen(kSystemPath);
bool inSystem1 = !strncmp(kSystemPath, path1.Path(), length);
bool inSystem2 = !strncmp(kSystemPath, path2.Path(), length);
bool inSystem1 = !strncmp(serverPath.String(), path1.Path(), length);
bool inSystem2 = !strncmp(serverPath.String(), path2.Path(), length);
if (inSystem1 != inSystem2)
return inSystem1 ? 1 : -1;

View File

@ -361,15 +361,15 @@ RosterData::_InitializeCatalogAddOns()
fCatalogAddOnInfos.AddItem((void*)defaultCatalogAddOnInfo);
directory_which folders[] = {
B_USER_ADDONS_DIRECTORY,
B_COMMON_ADDONS_DIRECTORY,
B_SYSTEM_ADDONS_DIRECTORY,
static_cast<directory_which>(-1)
};
BPath addOnPath;
BDirectory addOnFolder;
char buf[4096];
status_t err;
for (int f = 0; folders[f]>=0; ++f) {
for (uint32 f = 0; f < sizeof(folders) / sizeof(directory_which); ++f) {
find_directory(folders[f], &addOnPath);
BString addOnFolderName(addOnPath.Path());
addOnFolderName << "/locale/catalogs";

View File

@ -109,10 +109,10 @@ GLRendererRoster::AddDefaultPaths()
const directory_which paths[] = {
B_USER_ADDONS_DIRECTORY,
B_COMMON_ADDONS_DIRECTORY,
B_BEOS_ADDONS_DIRECTORY,
B_SYSTEM_ADDONS_DIRECTORY,
};
for (uint32 i = fSafeMode ? 2 : 0; i < sizeof(paths) / sizeof(paths[0]); i++) {
for (uint32 i = fSafeMode ? 4 : 0; i < sizeof(paths) / sizeof(paths[0]); i++) {
BPath path;
status_t status = find_directory(paths[i], &path, true);
if (status == B_OK && path.Append("opengl") == B_OK)

View File

@ -67,6 +67,8 @@ public:
private:
struct Token;
struct ListElementParser;
friend struct ListElementParser;
Token _NextToken();
void _RewindTo(const Token& token);
@ -77,6 +79,7 @@ private:
BPackageArchitecture* value);
void _ParseVersionValue(BPackageVersion* value,
bool releaseIsOptional);
void _ParseList(ListElementParser& elementParser);
void _ParseStringList(BObjectList<BString>* value,
bool allowQuotedStrings = true);
void _ParseResolvableList(
@ -139,6 +142,11 @@ struct BPackageInfo::Parser::Token {
};
struct BPackageInfo::Parser::ListElementParser {
virtual void operator()(const Token& token) = 0;
};
BPackageInfo::ParseErrorListener::~ParseErrorListener()
{
}
@ -277,7 +285,7 @@ BPackageInfo::Parser::_NextToken()
{
const char* start = fPos;
while (isalnum(*fPos) || *fPos == '.' || *fPos == '-'
|| *fPos == '_' || *fPos == ':') {
|| *fPos == '_' || *fPos == ':' || *fPos == '+') {
fPos++;
}
if (fPos == start)
@ -384,8 +392,7 @@ BPackageInfo::Parser::_ParseVersionValue(BPackageVersion* value,
void
BPackageInfo::Parser::_ParseStringList(BObjectList<BString>* value, bool
allowQuotedStrings)
BPackageInfo::Parser::_ParseList(ListElementParser& elementParser)
{
Token openBracket = _NextToken();
if (openBracket.type != TOKEN_OPEN_BRACKET)
@ -401,12 +408,41 @@ BPackageInfo::Parser::_ParseStringList(BObjectList<BString>* value, bool
if (token.type != TOKEN_COMMA)
throw ParseError("expected comma", token.pos);
token = _NextToken();
if (token.type == TOKEN_CLOSE_BRACKET) {
// silently skip trailing comma at end of list
return;
}
} else
needComma = true;
elementParser(token);
}
}
void
BPackageInfo::Parser::_ParseStringList(BObjectList<BString>* value,
bool allowQuotedStrings)
{
struct StringParser : public ListElementParser {
BObjectList<BString>* value;
bool allowQuotedStrings;
StringParser(BObjectList<BString>* value_, bool allowQuotedStrings_)
:
value(value_),
allowQuotedStrings(allowQuotedStrings_)
{
}
virtual void operator()(const Token& token)
{
if (allowQuotedStrings) {
if (token.type != TOKEN_QUOTED_STRING && token.type != TOKEN_WORD)
throw ParseError("expected quoted-string or word", token.pos);
if (token.type != TOKEN_QUOTED_STRING
&& token.type != TOKEN_WORD) {
throw ParseError("expected quoted-string or word",
token.pos);
}
} else {
if (token.type != TOKEN_WORD)
throw ParseError("expected word", token.pos);
@ -414,31 +450,26 @@ BPackageInfo::Parser::_ParseStringList(BObjectList<BString>* value, bool
value->AddItem(new BString(token.text));
}
} stringParser(value, allowQuotedStrings);
_ParseList(stringParser);
}
uint32
BPackageInfo::Parser::_ParseFlags()
{
uint32 flags = 0;
struct FlagParser : public ListElementParser {
uint32 flags;
Token openBracket = _NextToken();
if (openBracket.type != TOKEN_OPEN_BRACKET)
throw ParseError("expected start of list ('[')", openBracket.pos);
bool needComma = false;
while (true) {
Token token = _NextToken();
if (token.type == TOKEN_CLOSE_BRACKET)
break;
if (needComma) {
if (token.type != TOKEN_COMMA)
throw ParseError("expected comma", token.pos);
token = _NextToken();
} else
needComma = true;
FlagParser()
:
flags(0)
{
}
virtual void operator()(const Token& token)
{
if (token.type != TOKEN_WORD)
throw ParseError("expected word (a flag)", token.pos);
@ -447,12 +478,16 @@ BPackageInfo::Parser::_ParseFlags()
else if (token.text.ICompare("system_package") == 0)
flags |= B_PACKAGE_FLAG_SYSTEM_PACKAGE;
else {
throw ParseError("expected 'approve_license' or 'system_package'",
throw ParseError(
"expected 'approve_license' or 'system_package'",
token.pos);
}
}
} flagParser;
return flags;
_ParseList(flagParser);
return flagParser.flags;
}
@ -460,60 +495,63 @@ void
BPackageInfo::Parser::_ParseResolvableList(
BObjectList<BPackageResolvable>* value)
{
Token openBracket = _NextToken();
if (openBracket.type != TOKEN_OPEN_BRACKET)
throw ParseError("expected start of list ('[')", openBracket.pos);
struct ResolvableParser : public ListElementParser {
Parser& parser;
BObjectList<BPackageResolvable>* value;
bool needComma = false;
while (true) {
BPackageResolvableType type = B_PACKAGE_RESOLVABLE_TYPE_DEFAULT;
ResolvableParser(Parser& parser_,
BObjectList<BPackageResolvable>* value_)
:
parser(parser_),
value(value_)
{
}
Token word = _NextToken();
if (word.type == TOKEN_CLOSE_BRACKET)
return;
virtual void operator()(const Token& token)
{
if (token.type != TOKEN_WORD) {
throw ParseError("expected word (a resolvable name)",
token.pos);
}
if (needComma) {
if (word.type != TOKEN_COMMA)
throw ParseError("expected comma", word.pos);
word = _NextToken();
} else
needComma = true;
if (word.type != TOKEN_WORD)
throw ParseError("expected word (a resolvable name)", word.pos);
int32 colonPos = word.text.FindFirst(':');
BPackageResolvableType type = B_PACKAGE_RESOLVABLE_TYPE_DEFAULT;
int32 colonPos = token.text.FindFirst(':');
if (colonPos >= 0) {
BString typeName(word.text, colonPos);
BString typeName(token.text, colonPos);
for (int i = 0; i < B_PACKAGE_RESOLVABLE_TYPE_ENUM_COUNT; ++i) {
if (typeName.ICompare(BPackageResolvable::kTypeNames[i]) == 0) {
if (typeName.ICompare(BPackageResolvable::kTypeNames[i])
== 0) {
type = (BPackageResolvableType)i;
break;
}
}
if (type == B_PACKAGE_RESOLVABLE_TYPE_DEFAULT) {
BString error("resolvable type (<type>:) must be one of [");
for (int i = 1; i < B_PACKAGE_RESOLVABLE_TYPE_ENUM_COUNT; ++i) {
for (int i = 1; i < B_PACKAGE_RESOLVABLE_TYPE_ENUM_COUNT;
++i) {
if (i > 1)
error << ",";
error << BPackageResolvable::kTypeNames[i];
}
error << "]";
throw ParseError(error, word.pos);
throw ParseError(error, token.pos);
}
}
BPackageVersion version;
Token op = _NextToken();
Token op = parser._NextToken();
if (op.type == TOKEN_OPERATOR_ASSIGN)
_ParseVersionValue(&version, true);
parser._ParseVersionValue(&version, true);
else if (op.type == TOKEN_COMMA || op.type == TOKEN_CLOSE_BRACKET)
_RewindTo(op);
parser._RewindTo(op);
else
throw ParseError("expected '=', comma or ']'", op.pos);
value->AddItem(new BPackageResolvable(word.text, type, version));
value->AddItem(new BPackageResolvable(token.text, type, version));
}
} resolvableParser(*this, value);
_ParseList(resolvableParser);
}
@ -521,37 +559,36 @@ void
BPackageInfo::Parser::_ParseResolvableExprList(
BObjectList<BPackageResolvableExpression>* value)
{
Token openBracket = _NextToken();
if (openBracket.type != TOKEN_OPEN_BRACKET)
throw ParseError("expected start of list ('[')", openBracket.pos);
struct ResolvableExpressionParser : public ListElementParser {
Parser& parser;
BObjectList<BPackageResolvableExpression>* value;
bool needComma = false;
while (true) {
Token name = _NextToken();
if (name.type == TOKEN_CLOSE_BRACKET)
return;
ResolvableExpressionParser(Parser& parser_,
BObjectList<BPackageResolvableExpression>* value_)
:
parser(parser_),
value(value_)
{
}
if (needComma) {
if (name.type != TOKEN_COMMA)
throw ParseError("expected comma", name.pos);
name = _NextToken();
} else
needComma = true;
if (name.type != TOKEN_WORD)
throw ParseError("expected word (a resolvable name)", name.pos);
virtual void operator()(const Token& token)
{
if (token.type != TOKEN_WORD) {
throw ParseError("expected word (a resolvable name)",
token.pos);
}
BPackageVersion version;
Token op = _NextToken();
Token op = parser._NextToken();
if (op.type == TOKEN_OPERATOR_LESS
|| op.type == TOKEN_OPERATOR_LESS_EQUAL
|| op.type == TOKEN_OPERATOR_EQUAL
|| op.type == TOKEN_OPERATOR_NOT_EQUAL
|| op.type == TOKEN_OPERATOR_GREATER_EQUAL
|| op.type == TOKEN_OPERATOR_GREATER)
_ParseVersionValue(&version, true);
parser._ParseVersionValue(&version, true);
else if (op.type == TOKEN_COMMA || op.type == TOKEN_CLOSE_BRACKET)
_RewindTo(op);
parser._RewindTo(op);
else {
throw ParseError(
"expected '<', '<=', '==', '!=', '>=', '>', comma or ']'",
@ -561,9 +598,12 @@ BPackageInfo::Parser::_ParseResolvableExprList(
BPackageResolvableOperator resolvableOperator
= (BPackageResolvableOperator)(op.type - TOKEN_OPERATOR_LESS);
value->AddItem(new BPackageResolvableExpression(name.text,
value->AddItem(new BPackageResolvableExpression(token.text,
resolvableOperator, version));
}
} resolvableExpressionParser(*this, value);
_ParseList(resolvableExpressionParser);
}
@ -665,6 +705,11 @@ BPackageInfo::Parser::_Parse(BPackageInfo* packageInfo)
_ParseVersionValue(&version, false);
packageInfo->SetVersion(version);
seen[B_PACKAGE_INFO_VERSION] = true;
} else if (t.text.ICompare("copyright") == 0) {
BString copyright;
_ParseStringValue(&copyright);
packageInfo->AddCopyright(copyright);
seen[B_PACKAGE_INFO_COPYRIGHTS] = true;
} else if (t.text.ICompare(names[B_PACKAGE_INFO_COPYRIGHTS]) == 0) {
if (seen[B_PACKAGE_INFO_COPYRIGHTS]) {
BString error = BString(names[B_PACKAGE_INFO_COPYRIGHTS])
@ -678,6 +723,11 @@ BPackageInfo::Parser::_Parse(BPackageInfo* packageInfo)
for (int i = 0; i < count; ++i)
packageInfo->AddCopyright(*(copyrightList.ItemAt(i)));
seen[B_PACKAGE_INFO_COPYRIGHTS] = true;
} else if (t.text.ICompare("license") == 0) {
BString license;
_ParseStringValue(&license);
packageInfo->AddLicense(license);
seen[B_PACKAGE_INFO_LICENSES] = true;
} else if (t.text.ICompare(names[B_PACKAGE_INFO_LICENSES]) == 0) {
if (seen[B_PACKAGE_INFO_LICENSES]) {
BString error = BString(names[B_PACKAGE_INFO_LICENSES])
@ -769,8 +819,7 @@ BPackageInfo::Parser::_Parse(BPackageInfo* packageInfo)
for (int i = 0; i < count; ++i)
packageInfo->AddReplaces(*(replacesList.ItemAt(i)));
seen[B_PACKAGE_INFO_REPLACES] = true;
} else if (t.text.ICompare(names[B_PACKAGE_INFO_FLAGS])
== 0) {
} else if (t.text.ICompare(names[B_PACKAGE_INFO_FLAGS]) == 0) {
if (seen[B_PACKAGE_INFO_FLAGS]) {
BString error = BString(names[B_PACKAGE_INFO_FLAGS])
<< " already seen!";

View File

@ -70,19 +70,20 @@ status_t PrintTransport::Open(BNode* printerFolder)
return B_ERROR;
}
// try first in user add-ons directory
const directory_which paths[] = {
B_USER_ADDONS_DIRECTORY,
B_COMMON_ADDONS_DIRECTORY,
B_SYSTEM_ADDONS_DIRECTORY,
};
BPath path;
find_directory(B_USER_ADDONS_DIRECTORY, &path);
for (uint32 i = 0; i < sizeof(paths) / sizeof(paths[0]); ++i) {
if (find_directory(paths[i], &path) != B_OK)
continue;
path.Append("Print/transport");
path.Append(transportName.String());
fAddOnID = load_add_on(path.Path());
if (fAddOnID < 0) {
// on failure try in system add-ons directory
find_directory(B_BEOS_ADDONS_DIRECTORY, &path);
path.Append("Print/transport");
path.Append(transportName.String());
fAddOnID = load_add_on(path.Path());
if (fAddOnID >= 0)
break;
}
if (fAddOnID < 0) {

View File

@ -403,13 +403,16 @@ BPrinter::_DriverPath() const
if (driverName.Length() <= 0)
return BPath();
directory_which directorys[] = { B_USER_ADDONS_DIRECTORY,
B_COMMON_ADDONS_DIRECTORY, B_BEOS_ADDONS_DIRECTORY };
directory_which directories[] = {
B_USER_ADDONS_DIRECTORY,
B_COMMON_ADDONS_DIRECTORY,
B_SYSTEM_ADDONS_DIRECTORY
};
BPath path;
driverName.Prepend("Print/");
for (int32 i = 0; i < 3; ++i) {
if (find_directory(directorys[i], &path) == B_OK) {
for (int32 i = 0; i < sizeof(directories) / sizeof(directories[0]); ++i) {
if (find_directory(directories[i], &path) == B_OK) {
path.Append(driverName.String());
BEntry driver(path.Path());

View File

@ -169,7 +169,7 @@ PrinterDriverAddOn::FindPathToDriver(const char* driver, BPath* path)
if (result == B_OK)
return B_OK;
result = ::TestForAddonExistence(driver, B_BEOS_ADDONS_DIRECTORY,
result = ::TestForAddonExistence(driver, B_SYSTEM_ADDONS_DIRECTORY,
kPrinterDriverFolderName, *path);
return result;
}

View File

@ -117,8 +117,11 @@ ScreenSaverRunner::_LoadAddOn()
// try all directories until the first one succeeds
directory_which which[] = {B_BEOS_ADDONS_DIRECTORY, B_COMMON_ADDONS_DIRECTORY,
B_USER_ADDONS_DIRECTORY};
directory_which which[] = {
B_USER_ADDONS_DIRECTORY,
B_COMMON_ADDONS_DIRECTORY,
B_SYSTEM_ADDONS_DIRECTORY,
};
BPath path;
for (uint32 i = 0; i < sizeof(which) / sizeof(which[0]); i++) {

View File

@ -38,7 +38,7 @@
static const directory_which kAddOnDirs[] = {
B_USER_ADDONS_DIRECTORY,
B_COMMON_ADDONS_DIRECTORY,
B_BEOS_ADDONS_DIRECTORY
B_SYSTEM_ADDONS_DIRECTORY,
};
/*! \brief Size of the kAddOnDirs array. */
static const int32 kAddOnDirCount

View File

@ -116,7 +116,7 @@ DiskSystemAddOnManager::LoadDiskSystems()
error = _LoadAddOns(alreadyLoaded, B_COMMON_ADDONS_DIRECTORY);
if (error == B_OK)
error = _LoadAddOns(alreadyLoaded, B_BEOS_ADDONS_DIRECTORY);
error = _LoadAddOns(alreadyLoaded, B_SYSTEM_ADDONS_DIRECTORY);
if (error != B_OK)
UnloadDiskSystems();

View File

@ -175,9 +175,9 @@ BDeskWindow::Init(const BMessage *)
// watch add-on directories so that we can track the addons with
// corresponding shortcuts
WatchAddOnDir(B_BEOS_ADDONS_DIRECTORY, this);
WatchAddOnDir(B_USER_ADDONS_DIRECTORY, this);
WatchAddOnDir(B_COMMON_ADDONS_DIRECTORY, this);
WatchAddOnDir(B_SYSTEM_ADDONS_DIRECTORY, this);
_inherited::Init();
}

View File

@ -332,10 +332,10 @@ BTranslatorRoster::Private::AddDefaultPaths()
const directory_which paths[] = {
B_USER_ADDONS_DIRECTORY,
B_COMMON_ADDONS_DIRECTORY,
B_BEOS_ADDONS_DIRECTORY,
B_SYSTEM_ADDONS_DIRECTORY,
};
for (uint32 i = fSafeMode ? 1 : 0; i < sizeof(paths) / sizeof(paths[0]);
for (uint32 i = fSafeMode ? 4 : 0; i < sizeof(paths) / sizeof(paths[0]);
i++) {
BPath path;
status_t status = find_directory(paths[i], &path, true);

View File

@ -150,7 +150,7 @@
#define PACKAGE_BUGREPORT "gimp-print-devel@lists.sourceforge.net"
/* */
#define PACKAGE_DATA_DIR "/boot/common/data/gutenprint"
#define PACKAGE_DATA_DIR "/system/data/gutenprint"
/* */
#define PACKAGE_LIB_DIR "/boot/common/lib/gutenprint"
@ -174,7 +174,7 @@
#define PKGMODULEDIR "/boot/common/lib/gutenprint/5.2/modules"
/* */
#define PKGXMLDATADIR "/boot/common/data/gutenprint"
#define PKGXMLDATADIR "/system/data/gutenprint"
/* Package release date. */
#define RELEASE_DATE "01 May 2011"

View File

@ -41,22 +41,21 @@ Transport::Transport(const PrinterData *printerData)
fDataStream(0),
fAbort(false)
{
const directory_which paths[] = {
B_USER_ADDONS_DIRECTORY,
B_COMMON_ADDONS_DIRECTORY,
B_BEOS_ADDONS_DIRECTORY,
};
BPath path;
if (B_OK == find_directory(B_USER_ADDONS_DIRECTORY, &path)) {
for (uint32 i = 0; i < sizeof(paths) / sizeof(paths[0]); ++i) {
if (find_directory(paths[i], &path) != B_OK)
continue;
path.Append("Print/transport");
path.Append(printerData->GetTransport().c_str());
DBGMSG(("load_add_on: %s\n", path.Path()));
fImage = load_add_on(path.Path());
}
if (fImage < 0) {
if (B_OK == find_directory(B_BEOS_ADDONS_DIRECTORY, &path)) {
path.Append("Print/transport");
path.Append(printerData->GetTransport().c_str());
DBGMSG(("load_add_on: %s\n", path.Path()));
fImage = load_add_on(path.Path());
}
if (fImage >= 0)
break;
}
if (fImage < 0) {

View File

@ -285,9 +285,9 @@ AddPrinterDialog::_BuildGUI(int stage)
static directory_which gAddonDirs[] = {
B_BEOS_ADDONS_DIRECTORY,
B_USER_ADDONS_DIRECTORY,
B_COMMON_ADDONS_DIRECTORY,
B_USER_ADDONS_DIRECTORY
B_SYSTEM_ADDONS_DIRECTORY,
};

View File

@ -383,7 +383,7 @@ ModulesView::MessageReceived(BMessage* message)
BPath path;
if (find_directory(B_SYSTEM_BIN_DIRECTORY, &path) != B_OK
|| path.Append("screen_blanker") != B_OK)
path.SetTo("/boot/system/bin/screen_blanker");
path.SetTo("/bin/screen_blanker");
BEntry entry(path.Path());
entry_ref ref;
@ -442,7 +442,10 @@ ModulesView::PopulateScreenSaverList()
// Iterate over add-on directories, and add their files to the list view
directory_which which[] = {
B_BEOS_ADDONS_DIRECTORY, B_USER_ADDONS_DIRECTORY};
B_USER_ADDONS_DIRECTORY,
B_COMMON_ADDONS_DIRECTORY,
B_SYSTEM_ADDONS_DIRECTORY,
};
ScreenSaverItem* selectItem = NULL;
for (uint32 i = 0; i < sizeof(which) / sizeof(which[0]); i++) {

View File

@ -25,8 +25,10 @@
#include <debugger.h>
#include <DirectWindow.h>
#include <Entry.h>
#include <FindDirectory.h>
#include <Message.h>
#include <MessageFilter.h>
#include <Path.h>
#include <Region.h>
#include <Roster.h>
@ -2370,7 +2372,12 @@ Desktop::_LaunchInputServer()
// Could not load input_server by signature, try well-known location
BEntry entry("/system/servers/input_server");
BEntry entry;
BPath systemServersDir;
if (find_directory(B_SYSTEM_SERVERS_DIRECTORY, &systemServersDir) == B_OK)
entry.SetTo(systemServersDir.Path());
else
entry.SetTo("/system/servers/input_server");
entry_ref ref;
status_t entryStatus = entry.GetRef(&ref);
if (entryStatus == B_OK)

View File

@ -274,12 +274,12 @@ AccelerantHWInterface::_OpenAccelerant(int device)
const static directory_which dirs[] = {
B_USER_ADDONS_DIRECTORY,
B_COMMON_ADDONS_DIRECTORY,
B_BEOS_ADDONS_DIRECTORY
B_SYSTEM_ADDONS_DIRECTORY
};
fAccelerantImage = -1;
for (int32 i = 0; i < 3; i++) {
for (uint32 i = 0; i < sizeof(dirs) / sizeof(directory_which); i++) {
char path[PATH_MAX];
if (find_directory(dirs[i], -1, false, path, PATH_MAX) != B_OK)
continue;

View File

@ -467,12 +467,12 @@ DWindowHWInterface::_OpenAccelerant(int device)
const static directory_which dirs[] = {
B_USER_ADDONS_DIRECTORY,
B_COMMON_ADDONS_DIRECTORY,
B_BEOS_ADDONS_DIRECTORY
B_SYSTEM_ADDONS_DIRECTORY
};
fAccelerantImage = -1;
for (int32 i = 0; i < 3; i++) {
for (uint32 i = 0; i < sizeof(dirs) / sizeof(directory_which); i++) {
char path[PATH_MAX];
if (find_directory(dirs[i], -1, false, path, PATH_MAX) != B_OK)
continue;

View File

@ -19,8 +19,10 @@
#include <Catalog.h>
#include <debug_support.h>
#include <Entry.h>
#include <FindDirectory.h>
#include <Invoker.h>
#include <Locale.h>
#include <Path.h>
#include <RegistrarDefs.h>
#include <RosterPrivate.h>
@ -52,14 +54,6 @@ using std::nothrow;
static const char *kSignature = "application/x-vnd.Haiku-debug_server";
// paths to the apps used for debugging
static const char *kConsoledPath = "/bin/consoled";
static const char *kTerminalPath = "/boot/system/apps/Terminal";
static const char *kGDBPath = "/bin/gdb";
#ifdef HANDOVER_USE_DEBUGGER
static const char *kDebuggerPath = "/boot/system/apps/Debugger";
#endif
static void
KillTeam(team_id team, const char *appName = NULL)
@ -448,9 +442,37 @@ TeamDebugHandler::_SetupGDBArguments(const char **argv, int &argc,
// prepare the argument vector
snprintf(teamString, teamStringSize, "--pid=%ld", fTeam);
const char *terminal = (usingConsoled ? kConsoledPath : kTerminalPath);
status_t error;
BPath terminalPath;
if (usingConsoled) {
error = find_directory(B_SYSTEM_BIN_DIRECTORY, &terminalPath);
if (error != B_OK) {
debug_printf("debug_server: can't find system-bin directory: %s\n",
strerror(error));
return;
}
error = terminalPath.Append("consoled");
if (error != B_OK) {
debug_printf("debug_server: can't append to system-bin path: %s\n",
strerror(error));
return;
}
} else {
error = find_directory(B_SYSTEM_APPS_DIRECTORY, &terminalPath);
if (error != B_OK) {
debug_printf("debug_server: can't find system-apps directory: %s\n",
strerror(error));
return;
}
error = terminalPath.Append("Terminal");
if (error != B_OK) {
debug_printf("debug_server: can't append to system-apps path: %s\n",
strerror(error));
return;
}
}
argv[argc++] = terminal;
argv[argc++] = terminalPath.Path();
if (!usingConsoled) {
char windowTitle[64];
@ -460,7 +482,21 @@ TeamDebugHandler::_SetupGDBArguments(const char **argv, int &argc,
argv[argc++] = windowTitle;
}
argv[argc++] = kGDBPath;
BPath gdbPath;
error = find_directory(B_SYSTEM_BIN_DIRECTORY, &gdbPath);
if (error != B_OK) {
debug_printf("debug_server: can't find system-bin directory: %s\n",
strerror(error));
return;
}
error = gdbPath.Append("gdb");
if (error != B_OK) {
debug_printf("debug_server: can't append to system-bin path: %s\n",
strerror(error));
return;
}
argv[argc++] = gdbPath.Path();
argv[argc++] = teamString;
if (strlen(fExecutablePath) > 0)
argv[argc++] = fExecutablePath;
@ -507,7 +543,21 @@ TeamDebugHandler::_EnterDebugger()
// prepare the argument vector
snprintf(teamString, sizeof(teamString), "%ld", fTeam);
argv[argc++] = kDebuggerPath;
BPath debuggerPath;
error = find_directory(B_SYSTEM_APPS_DIRECTORY, &debuggerPath);
if (error != B_OK) {
debug_printf("debug_server: can't find system-apps directory: %s\n",
strerror(error));
return error;
}
error = debuggerPath.Append("Debugger");
if (error != B_OK) {
debug_printf("debug_server: can't append to system-apps path: %s\n",
strerror(error));
return error;
}
argv[argc++] = debuggerPath.Path();
argv[argc++] = "--team";
argv[argc++] = teamString;
argv[argc] = NULL;

View File

@ -334,11 +334,11 @@ IndexServer::_StartWatchingAddOns()
const directory_which directories[] = {
B_USER_ADDONS_DIRECTORY,
B_COMMON_ADDONS_DIRECTORY,
B_BEOS_ADDONS_DIRECTORY
B_SYSTEM_ADDONS_DIRECTORY
};
// when safemode, only B_BEOS_ADDONS_DIRECTORY is used
for (uint32 i = safeMode ? 2 : 0;
// when safemode, only B_SYSTEM_ADDONS_DIRECTORY is used
for (uint32 i = safeMode ? 4 : 0;
i < sizeof(directories) / sizeof(directory_which); i++) {
BDirectory directory;
node_ref nodeRef;

Some files were not shown because too many files have changed in this diff Show More