Merge branch 'master' into sam460ex
This commit is contained in:
commit
cbabdc1731
2
3rdparty/vmware/haiku-alpha.vmx
vendored
2
3rdparty/vmware/haiku-alpha.vmx
vendored
@ -1,6 +1,6 @@
|
||||
#!/usr/bin/vmware
|
||||
config.version = "8"
|
||||
virtualHW.version = "3"
|
||||
virtualHW.version = "6"
|
||||
|
||||
MemAllowAutoScaleDown = "false"
|
||||
MemTrimRate = "-1"
|
||||
|
2
3rdparty/vmware/haiku-nightly.vmx
vendored
2
3rdparty/vmware/haiku-nightly.vmx
vendored
@ -1,6 +1,6 @@
|
||||
#!/usr/bin/vmware
|
||||
config.version = "8"
|
||||
virtualHW.version = "3"
|
||||
virtualHW.version = "6"
|
||||
|
||||
MemAllowAutoScaleDown = "false"
|
||||
MemTrimRate = "-1"
|
||||
|
2
3rdparty/vmware/haiku.vmx
vendored
2
3rdparty/vmware/haiku.vmx
vendored
@ -1,6 +1,6 @@
|
||||
#!/usr/bin/vmware
|
||||
config.version = "8"
|
||||
virtualHW.version = "3"
|
||||
virtualHW.version = "6"
|
||||
|
||||
MemAllowAutoScaleDown = "false"
|
||||
MemTrimRate = "-1"
|
||||
|
4
Jamfile
4
Jamfile
@ -135,13 +135,13 @@ if $(HAIKU_ADD_OPTIONAL_PACKAGES) {
|
||||
}
|
||||
|
||||
# Prepare the optional build features before parsing the Jamfile tree.
|
||||
include [ FDirName $(HAIKU_BUILD_RULES_DIR) OptionalBuildFeatures ] ;
|
||||
include [ FDirName $(HAIKU_BUILD_RULES_DIR) BuildFeatures ] ;
|
||||
|
||||
# Include packages that are required by all images.
|
||||
AddOptionalHaikuImagePackages MandatoryPackages ;
|
||||
|
||||
# If enabled, make sure that OpenSSL is added to the image.
|
||||
if $(HAIKU_OPENSSL_ENABLED) {
|
||||
if $(HAIKU_BUILD_FEATURE_OPENSSL_ENABLED) {
|
||||
AddOptionalHaikuImagePackages OpenSSL ;
|
||||
}
|
||||
|
||||
|
@ -56,8 +56,10 @@ This is the Haiku project's development tracker.
|
||||
{OpenGrok
|
||||
---------
|
||||
http://haiku.it.su.se:8180/source
|
||||
http://grok.bikemonkey.org/source
|
||||
http://code.metager.de/source/xref/haiku
|
||||
|
||||
Graciously provided by <name>.
|
||||
Graciously provided by Janne Johansson, Landon Fuller and MetaGer respectively.
|
||||
This allows you to quickly and easily search Haiku's source code.
|
||||
|
||||
|
||||
|
@ -1,6 +1,12 @@
|
||||
# This file contains setup for features that can optionally be used for the
|
||||
# build. For features that require downloading a zip file from somewhere it is
|
||||
# likely the same file use for an optional package.
|
||||
# This file contains setup for build features that are not available for all
|
||||
# architectures/setups or that are optional for the build. For features that
|
||||
# require downloading a zip file from somewhere it is likely the same file used
|
||||
# for an optional package.
|
||||
|
||||
|
||||
# Add the target architecture as a build feature.
|
||||
EnableBuildFeatures $(HAIKU_ARCH) ;
|
||||
|
||||
|
||||
# Detect a hybrid GCC2/GCC4 image and disable the checks for unavailable GCC4
|
||||
# packages. (It does not matter if a package was built with either compiler,
|
||||
@ -56,9 +62,10 @@ if $(HAIKU_BUILD_FEATURE_SSL) {
|
||||
: extracted-openssl
|
||||
] ;
|
||||
|
||||
HAIKU_OPENSSL_ENABLED = 1 ;
|
||||
HAIKU_OPENSSL_HEADERS
|
||||
= [ FDirName $(HAIKU_OPENSSL_DIR) common include ] ;
|
||||
|
||||
EnableBuildFeatures openssl ;
|
||||
}
|
||||
}
|
||||
|
||||
@ -72,7 +79,7 @@ HAIKU_ICU_PPC_PACKAGE = icu-4.8.1-ppc-2011-08-20.zip ;
|
||||
HAIKU_ICU_ARM_PACKAGE = icu-4.8.1.1-arm-2012-11-21.zip ;
|
||||
HAIKU_ICU_X86_64_PACKAGE = icu-4.8.1.1-x86_64-2012-07-30.zip ;
|
||||
|
||||
if $(TARGET_ARCH) = ppc || $(TARGET_ARCH) = x86 || $(TARGET_ARCH) = arm || $(TARGET_ARCH) = x86_64 {
|
||||
if $(TARGET_ARCH) in arm ppc x86 x86_64 {
|
||||
local icu_package ;
|
||||
if $(TARGET_ARCH) = ppc {
|
||||
icu_package = $(HAIKU_ICU_PPC_PACKAGE) ;
|
||||
@ -140,6 +147,8 @@ if $(TARGET_ARCH) = ppc || $(TARGET_ARCH) = x86 || $(TARGET_ARCH) = arm || $(TAR
|
||||
|
||||
HAIKU_ICU_HEADERS
|
||||
= [ FDirName $(HAIKU_ICU_DEVEL_DIR) develop headers 3rdparty ] ;
|
||||
|
||||
EnableBuildFeatures icu ;
|
||||
} else {
|
||||
Echo "ICU not available for $(TARGET_ARCH)" ;
|
||||
}
|
||||
@ -184,6 +193,8 @@ if $(HAIKU_BUILD_FEATURE_CLUCENE) {
|
||||
|
||||
HAIKU_CLUCENE_HEADERS
|
||||
= [ FDirName $(HAIKU_CLUCENE_DIR) common include ] ;
|
||||
|
||||
EnableBuildFeatures clucene ;
|
||||
}
|
||||
}
|
||||
|
||||
@ -206,6 +217,8 @@ if $(TARGET_ARCH) = x86 {
|
||||
HAIKU_GLU_LIBS = [ ExtractArchive $(HAIKU_GLU_DIR)
|
||||
: system/lib/libGLU.a : $(zipFile) : extracted-glu ] ;
|
||||
HAIKU_GLU_HEADERS = [ FDirName $(HAIKU_GLU_DIR) develop headers os opengl ] ;
|
||||
|
||||
EnableBuildFeatures glu ;
|
||||
} else {
|
||||
Echo "GLU not yet available on $(TARGET_ARCH)" ;
|
||||
}
|
||||
@ -247,6 +260,7 @@ if $(TARGET_ARCH) = x86 {
|
||||
Depends $(HAIKU_MESA_HEADERS_DEPENDENCY) : $(HAIKU_GLU_HEADERS_DEPENDENCY) ;
|
||||
Depends $(HAIKU_MESA_LIBS) : $(HAIKU_GLU_LIBS) ;
|
||||
|
||||
EnableBuildFeatures mesa ;
|
||||
} else {
|
||||
Echo "Mesa 3D rendering support not available on $(TARGET_ARCH)" ;
|
||||
}
|
||||
@ -369,6 +383,7 @@ if $(TARGET_ARCH) = x86 {
|
||||
HAIKU_LIBOGG_HEADERS = [ FDirName $(HAIKU_LIBOGG_DIR) common include ] ;
|
||||
HAIKU_LIBVPX_HEADERS = [ FDirName $(HAIKU_LIBVPX_DIR) common include ] ;
|
||||
|
||||
EnableBuildFeatures ffmpeg ;
|
||||
} else {
|
||||
Echo "FFMpeg support not available on $(TARGET_ARCH)" ;
|
||||
}
|
||||
@ -401,6 +416,7 @@ if $(TARGET_ARCH) = x86 {
|
||||
|
||||
HAIKU_MIKMOD_HEADERS = [ FDirName $(HAIKU_MIKMOD_DIR) common include ] ;
|
||||
|
||||
EnableBuildFeatures mikmod ;
|
||||
} else {
|
||||
Echo "MikMod support not available on $(TARGET_ARCH)" ;
|
||||
}
|
||||
@ -448,6 +464,8 @@ if $(TARGET_ARCH) = ppc || $(TARGET_ARCH) = x86 || $(TARGET_ARCH) = x86_64 || $(
|
||||
HAIKU_FREETYPE_HEADERS = [ FDirName $(HAIKU_FREETYPE_DIR) develop
|
||||
headers 3rdparty ] [ FDirName $(HAIKU_FREETYPE_DIR) develop
|
||||
headers 3rdparty freetype2 ] ;
|
||||
|
||||
EnableBuildFeatures freetype ;
|
||||
} else {
|
||||
Echo "Freetype support not available on $(TARGET_ARCH)" ;
|
||||
}
|
||||
@ -492,6 +510,8 @@ if $(HAIKU_BUILD_FEATURE_TAGLIB) {
|
||||
|
||||
HAIKU_TAGLIB_HEADERS
|
||||
= [ FDirName $(HAIKU_TAGLIB_DIR) common include taglib ] ;
|
||||
|
||||
EnableBuildFeatures taglib ;
|
||||
}
|
||||
}
|
||||
|
||||
@ -535,6 +555,8 @@ if $(HAIKU_BUILD_FEATURE_WEBKIT) {
|
||||
] ;
|
||||
|
||||
HAIKU_WEBKIT_HEADERS = [ FDirName $(HAIKU_WEBKIT_DIR) include ] ;
|
||||
|
||||
EnableBuildFeatures webkit ;
|
||||
}
|
||||
}
|
||||
|
||||
@ -578,13 +600,15 @@ if $(TARGET_ARCH) = ppc || $(TARGET_ARCH) = x86 || $(TARGET_ARCH) = x86_64 || $(
|
||||
HAIKU_LIBPNG_CURRENT_LINK = libpng15.so.15 ;
|
||||
|
||||
HAIKU_LIBPNG_HEADERS = [ FDirName $(HAIKU_LIBPNG_DIR) common include ] ;
|
||||
|
||||
EnableBuildFeatures libpng ;
|
||||
} else {
|
||||
Echo "libpng support not available on $(TARGET_ARCH)" ;
|
||||
}
|
||||
|
||||
# jpeg
|
||||
local jpegBaseURL = $(baseURL)/lib ;
|
||||
if $(TARGET_ARCH) = ppc || $(TARGET_ARCH) = x86 || $(TARGET_ARCH) = x86_64 || $(TARGET_ARCH) = arm {
|
||||
if $(TARGET_ARCH) in arm ppc x86 x86_64 {
|
||||
if $(TARGET_ARCH) = arm {
|
||||
HAIKU_JPEG_FILE = jpeg-8d-arm-2012-11-21.zip ;
|
||||
} else if $(TARGET_ARCH) = ppc {
|
||||
@ -622,6 +646,8 @@ if $(TARGET_ARCH) = ppc || $(TARGET_ARCH) = x86 || $(TARGET_ARCH) = x86_64 || $(
|
||||
HAIKU_JPEG_CURRENT_LINK = libjpeg.so.8 ;
|
||||
|
||||
HAIKU_JPEG_HEADERS = [ FDirName $(HAIKU_JPEG_DIR) common include ] ;
|
||||
|
||||
EnableBuildFeatures libjpeg ;
|
||||
} else {
|
||||
Echo "jpeg support not available on $(TARGET_ARCH)" ;
|
||||
}
|
||||
@ -666,6 +692,23 @@ if $(TARGET_ARCH) = ppc || $(TARGET_ARCH) = x86 || $(TARGET_ARCH) = x86_64 || $(
|
||||
HAIKU_ZLIB_CURRENT_LINK = libz.so.1 ;
|
||||
|
||||
HAIKU_ZLIB_HEADERS = [ FDirName $(HAIKU_ZLIB_DIR) common include ] ;
|
||||
|
||||
EnableBuildFeatures zlib ;
|
||||
} else {
|
||||
Echo "zlib support not available on $(TARGET_ARCH)" ;
|
||||
}
|
||||
|
||||
|
||||
# GPL add-ons
|
||||
if $(HAIKU_INCLUDE_GPL_ADDONS) = 1 {
|
||||
EnableBuildFeatures gpl ;
|
||||
}
|
||||
|
||||
|
||||
# ATA vs. IDE
|
||||
#HACK: remove when old ide code is removed!
|
||||
if $(HAIKU_ATA_STACK) = 1 {
|
||||
EnableBuildFeatures ata ;
|
||||
} else {
|
||||
EnableBuildFeatures ide ;
|
||||
}
|
@ -1,32 +1,8 @@
|
||||
# This file defines what ends up in the floppy boot image and it executes the
|
||||
# rules building the image.
|
||||
|
||||
local X86_ONLY = ;
|
||||
local PPC_ONLY = ;
|
||||
local ARM_ONLY = ;
|
||||
if $(TARGET_ARCH) = x86 || $(TARGET_ARCH) = x86_64 {
|
||||
X86_ONLY = "" ;
|
||||
} else if $(TARGET_ARCH) = ppc {
|
||||
X86_ONLY = ;
|
||||
} else if $(TARGET_ARCH) = m68k {
|
||||
X86_ONLY = ;
|
||||
} else if $(TARGET_ARCH) = arm {
|
||||
ARM_ONLY = "" ;
|
||||
}
|
||||
|
||||
local GPL_ONLY = ;
|
||||
if $(HAIKU_INCLUDE_GPL_ADDONS) = 1 {
|
||||
GPL_ONLY = "" ;
|
||||
}
|
||||
|
||||
#HACK: remove when old ide code is removed!
|
||||
local ATA_ONLY = ;
|
||||
local IDE_ONLY = ;
|
||||
if $(HAIKU_ATA_STACK) = 1 {
|
||||
ATA_ONLY = "" ;
|
||||
} else {
|
||||
IDE_ONLY = "" ;
|
||||
}
|
||||
|
||||
local NET_BOOT = 0 ;
|
||||
local USB_BOOT = 1 ;
|
||||
@ -49,9 +25,10 @@ if $(NET_BOOT) = 1 {
|
||||
;
|
||||
}
|
||||
|
||||
SYSTEM_ADD_ONS_BUS_MANAGERS = $(X86_ONLY)acpi $(ATA_ONLY)ata config_manager dpc pci
|
||||
$(IDE_ONLY)ide $(X86_ONLY)isa scsi $(USB_ONLY)usb
|
||||
;
|
||||
SYSTEM_ADD_ONS_BUS_MANAGERS = [ FFilterByBuildFeatures
|
||||
acpi@x86 ata@ata config_manager dpc pci
|
||||
ide@ide isa@x86 scsi $(USB_ONLY)usb
|
||||
] ;
|
||||
SYSTEM_ADD_ONS_FILE_SYSTEMS = bfs iso9660 attribute_overlay write_overlay ;
|
||||
|
||||
|
||||
@ -87,11 +64,11 @@ if $(TARGET_ARCH) = x86_64 {
|
||||
|
||||
if $(HAIKU_ATA_STACK) = 1 {
|
||||
AddFilesToFloppyBootArchive system add-ons kernel busses ata
|
||||
: generic_ide_pci $(X86_ONLY)ide_isa silicon_image_3112 legacy_sata
|
||||
: generic_ide_pci ide_isa@x86 silicon_image_3112 legacy_sata
|
||||
it8211 ;
|
||||
} else {
|
||||
AddFilesToFloppyBootArchive system add-ons kernel busses ide
|
||||
: generic_ide_pci $(X86_ONLY)ide_isa silicon_image_3112 legacy_sata
|
||||
: generic_ide_pci ide_isa@x86 silicon_image_3112 legacy_sata
|
||||
it8211 ;
|
||||
}
|
||||
|
||||
@ -101,11 +78,11 @@ if $(TARGET_ARCH) = x86_64 {
|
||||
AddFilesToFloppyBootArchive system add-ons kernel file_systems
|
||||
: $(SYSTEM_ADD_ONS_FILE_SYSTEMS) ;
|
||||
AddFilesToFloppyBootArchive system add-ons kernel generic
|
||||
: $(ATA_ONLY)ata_adapter $(IDE_ONLY)ide_adapter locked_pool scsi_periph ;
|
||||
: ata_adapter@ata ide_adapter@ide locked_pool scsi_periph ;
|
||||
AddFilesToFloppyBootArchive system add-ons kernel partitioning_systems
|
||||
: intel session ;
|
||||
AddFilesToFloppyBootArchive system add-ons kernel interrupt_controllers
|
||||
: $(PPC_ONLY)openpic ;
|
||||
: openpic@ppc ;
|
||||
|
||||
if $(USB_BOOT) = 1 {
|
||||
AddFilesToFloppyBootArchive system add-ons kernel busses usb
|
||||
@ -118,7 +95,7 @@ if $(TARGET_ARCH) = x86_64 {
|
||||
|
||||
# drivers
|
||||
AddNewDriversToFloppyBootArchive disk scsi : scsi_cd scsi_disk ;
|
||||
AddNewDriversToFloppyBootArchive disk : $(ARM_ONLY)norflash ;
|
||||
AddNewDriversToFloppyBootArchive disk : norflash@arm ;
|
||||
if $(USB_BOOT) = 1 {
|
||||
AddDriversToFloppyBootArchive disk usb : usb_disk ;
|
||||
}
|
||||
@ -166,13 +143,13 @@ if $(TARGET_ARCH) = x86_64 {
|
||||
} else {
|
||||
AddBootModuleSymlinksToFloppyBootArchive
|
||||
$(SYSTEM_ADD_ONS_BUS_MANAGERS)
|
||||
$(PPC_ONLY)openpic
|
||||
$(ATA_ONLY)ata_adapter $(IDE_ONLY)ide_adapter locked_pool scsi_periph
|
||||
$(X86_ONLY)generic_x86
|
||||
ahci generic_ide_pci $(X86_ONLY)ide_isa silicon_image_3112 legacy_sata
|
||||
openpic@ppc
|
||||
ata_adapter@ata ide_adapter@ide locked_pool scsi_periph
|
||||
generic_x86@x86
|
||||
ahci generic_ide_pci ide_isa@x86 silicon_image_3112 legacy_sata
|
||||
it8211
|
||||
$(USB_ONLY)<usb>uhci $(USB_ONLY)<usb>ohci $(USB_ONLY)<usb>ehci
|
||||
scsi_cd scsi_disk $(USB_ONLY)usb_disk $(ARM_ONLY)norflash
|
||||
scsi_cd scsi_disk $(USB_ONLY)usb_disk norflash@arm
|
||||
intel session
|
||||
$(SYSTEM_ADD_ONS_FILE_SYSTEMS)
|
||||
$(BOOT_ADD_ONS_NET)
|
||||
|
@ -5,26 +5,13 @@
|
||||
# This is only temporary while x86_64 is still a work in progress, so I can
|
||||
# easily add things to the image as I port them.
|
||||
|
||||
local GPL_ONLY = ;
|
||||
if $(HAIKU_INCLUDE_GPL_ADDONS) = 1 {
|
||||
GPL_ONLY = "" ;
|
||||
}
|
||||
|
||||
#HACK: remove when old ide code is removed!
|
||||
local ATA_ONLY = ;
|
||||
local IDE_ONLY = ;
|
||||
if $(HAIKU_ATA_STACK) = 1 {
|
||||
ATA_ONLY = "" ;
|
||||
} else {
|
||||
IDE_ONLY = "" ;
|
||||
}
|
||||
|
||||
SYSTEM_BIN = "[" addattr base64 basename bash beep cal cat catattr checkfs
|
||||
chgrp chmod chown chroot cksum clear clockconfig cmp collectcatkeys comm
|
||||
compress copyattr cp csplit cut date dd diff diff3 dircolors dirname df du
|
||||
dumpcatalog echo eject env error expand expr factor false find finddir
|
||||
fmt fold fortune gawk gdb gzip gzexe getlimits grep groups head hostname id
|
||||
ifconfig <bin>install isvolume join kernel_debugger kill less lessecho
|
||||
fmt fold fortune ftp gawk gdb gzip gzexe getlimits grep groups head hostname
|
||||
id ifconfig <bin>install isvolume join kernel_debugger kill less lessecho
|
||||
lesskey link linkcatkeys listdev ln locale locate logger logname ls
|
||||
makebootable md5sum mimeset mkdir mkfifo mkfs mktemp mount mountvolume
|
||||
mv nl nohup notify nproc od paste patch pathchk ping pr printenv printf
|
||||
@ -47,8 +34,8 @@ SYSTEM_PREFERENCES = Appearance Backgrounds <preference>Deskbar FileTypes
|
||||
|
||||
SYSTEM_DEMOS = Sudoku ;
|
||||
|
||||
SYSTEM_LIBS = libbe.so libbnetapi.so libdebug.so libmedia.so libnetwork.so
|
||||
<revisioned>libroot.so libroot-addon-icu.so
|
||||
SYSTEM_LIBS = libbe.so libbsd.so libbnetapi.so libdebug.so libmedia.so
|
||||
libnetwork.so <revisioned>libroot.so libroot-addon-icu.so
|
||||
libtextencoding.so libtiff.so libtracker.so libtranslation.so
|
||||
$(HAIKU_SHARED_LIBSTDC++) $(HAIKU_SHARED_LIBSUPC++)
|
||||
;
|
||||
@ -85,8 +72,9 @@ SYSTEM_ADD_ONS_DRIVERS_NET = 3com atheros813x ar81xx attansic_l1 attansic_l2
|
||||
via_rhine wb840
|
||||
;
|
||||
|
||||
SYSTEM_ADD_ONS_BUS_MANAGERS = $(ATA_ONLY)ata pci ps2 isa scsi config_manager
|
||||
usb ;
|
||||
SYSTEM_ADD_ONS_BUS_MANAGERS = [ FFilterByBuildFeatures
|
||||
ata@ata pci ps2 isa scsi config_manager usb
|
||||
] ;
|
||||
SYSTEM_ADD_ONS_FILE_SYSTEMS = bfs iso9660 attribute_overlay write_overlay ;
|
||||
|
||||
# modules
|
||||
@ -107,7 +95,7 @@ AddFilesToHaikuImage system add-ons kernel debugger
|
||||
AddFilesToHaikuImage system add-ons kernel file_systems
|
||||
: $(SYSTEM_ADD_ONS_FILE_SYSTEMS) ;
|
||||
AddFilesToHaikuImage system add-ons kernel generic
|
||||
: $(ATA_ONLY)ata_adapter bios dpc locked_pool scsi_periph <module>tty ;
|
||||
: ata_adapter@ata bios dpc locked_pool scsi_periph <module>tty ;
|
||||
AddFilesToHaikuImage system add-ons kernel partitioning_systems
|
||||
: intel session ;
|
||||
|
||||
@ -174,7 +162,7 @@ AddFilesToHaikuImage system bin : install-wifi-firmwares.sh ;
|
||||
|
||||
# Add the files to be used by installoptionalpackage.
|
||||
AddDirectoryToHaikuImage common data optional-packages ;
|
||||
local optional-pkg-files = OptionalBuildFeatures OptionalPackageDependencies
|
||||
local optional-pkg-files = BuildFeatures OptionalPackageDependencies
|
||||
OptionalPackages OptionalLibPackages ;
|
||||
for name in $(optional-pkg-files) {
|
||||
local file = [ FDirName $(HAIKU_TOP) build jam $(name) ] ;
|
||||
@ -358,7 +346,7 @@ AddFilesToHaikuImage system : haiku_loader ;
|
||||
|
||||
# boot module links
|
||||
AddBootModuleSymlinksToHaikuImage
|
||||
$(ATA_ONLY)ata pci config_manager dpc scsi usb $(ATA_ONLY)ata_adapter
|
||||
ata@ata pci config_manager dpc scsi usb ata_adapter@ata
|
||||
locked_pool scsi_periph ahci generic_ide_pci legacy_sata
|
||||
<usb>uhci <usb>ohci <usb>ehci
|
||||
scsi_cd scsi_disk usb_disk
|
||||
|
@ -2,35 +2,9 @@
|
||||
# installation directory) and it executes the rules building the image
|
||||
# (respectively installing the files in the installation directory).
|
||||
|
||||
local X86_ONLY = ;
|
||||
local PPC_ONLY = ;
|
||||
local M68K_ONLY = ;
|
||||
local ARM_ONLY = ;
|
||||
if $(TARGET_ARCH) = x86 {
|
||||
X86_ONLY = "" ;
|
||||
} else if $(TARGET_ARCH) = ppc {
|
||||
PPC_ONLY = "" ;
|
||||
} else if $(TARGET_ARCH) = m68k {
|
||||
M68K_ONLY = "" ;
|
||||
} else if $(TARGET_ARCH) = arm {
|
||||
ARM_ONLY = "" ;
|
||||
}
|
||||
|
||||
local GPL_ONLY = ;
|
||||
if $(HAIKU_INCLUDE_GPL_ADDONS) = 1 {
|
||||
GPL_ONLY = "" ;
|
||||
}
|
||||
|
||||
#HACK: remove when old ide code is removed!
|
||||
local ATA_ONLY = ;
|
||||
local IDE_ONLY = ;
|
||||
if $(HAIKU_ATA_STACK) = 1 {
|
||||
ATA_ONLY = "" ;
|
||||
} else {
|
||||
IDE_ONLY = "" ;
|
||||
}
|
||||
|
||||
SYSTEM_BIN = "[" addattr alert arp base64 basename bash bc beep bfsinfo
|
||||
SYSTEM_BIN = [ FFilterByBuildFeatures
|
||||
"[" addattr alert arp base64 basename bash bc beep bfsinfo
|
||||
cal cat catattr checkfs checkitout chgrp chmod chop chown chroot cksum clear
|
||||
clockconfig cmp collectcatkeys comm compress copyattr CortexAddOnHost cp
|
||||
csplit cut date dc dd desklink df diff diff3 dircolors dirname
|
||||
@ -38,10 +12,10 @@ SYSTEM_BIN = "[" addattr alert arp base64 basename bash bc beep bfsinfo
|
||||
echo eject env error expand expr
|
||||
factor false fdinfo ffm filepanel find finddir fmt fold fortune frcode
|
||||
ftp ftpd funzip fwcontrol
|
||||
gawk $(X86_ONLY)gdb getlimits grep groups gzip gzexe
|
||||
gawk gdb@x86 getlimits grep groups gzip gzexe
|
||||
hd head hey hostname
|
||||
id ident ifconfig <bin>install installsound iroster isvolume
|
||||
$(IDE_ONLY)ideinfo $(IDE_ONLY)idestatus
|
||||
ideinfo@ide idestatus@ide
|
||||
join kernel_debugger keymap kill
|
||||
less lessecho lesskey link linkcatkeys listarea listattr listimage listdev
|
||||
listport listres listsem listusb ln locale locate logger login logname ls
|
||||
@ -64,38 +38,41 @@ SYSTEM_BIN = "[" addattr alert arp base64 basename bash bc beep bfsinfo
|
||||
uname unchop unexpand unmount uniq unlink unrar unshar unzip unzipsfx
|
||||
<bin>updatedb uptime urlwrapper useradd uudecode uuencode
|
||||
vdir version vmstat
|
||||
waitfor watch wc wget whoami $(X86_ONLY)writembr xargs xres yes
|
||||
waitfor watch wc wget whoami writembr@x86 xargs xres yes
|
||||
zdiff zforce zgrep zip zipcloak <bin>zipgrep zipnote zipsplit zmore znew
|
||||
;
|
||||
] ;
|
||||
|
||||
SYSTEM_APPS = AboutSystem ActivityMonitor $(X86_ONLY)BootManager CharacterMap
|
||||
SYSTEM_APPS = [ FFilterByBuildFeatures
|
||||
AboutSystem ActivityMonitor BootManager@x86 CharacterMap
|
||||
CodyCam DeskCalc Devices DiskProbe DiskUsage DriveSetup CDPlayer Expander
|
||||
$(X86_ONLY)GLInfo Icon-O-Matic Installer LaunchBox Magnify Mail
|
||||
GLInfo@x86 Icon-O-Matic Installer LaunchBox Magnify Mail
|
||||
MediaConverter MediaPlayer MidiPlayer NetworkStatus PackageInstaller People
|
||||
PoorMan PowerStatus ProcessController Screenshot ShowImage SoundRecorder
|
||||
StyledEdit Terminal TextSearch TV WebWatch Workspaces
|
||||
;
|
||||
SYSTEM_PREFERENCES = Appearance Backgrounds CPUFrequency DataTranslations
|
||||
] ;
|
||||
SYSTEM_PREFERENCES = [ FFilterByBuildFeatures
|
||||
Appearance Backgrounds CPUFrequency DataTranslations
|
||||
<preference>Deskbar E-mail FileTypes Keyboard Keymap Locale Media
|
||||
Mouse Network Notifications Printers Screen ScreenSaver
|
||||
Shortcuts Sounds Time Touchpad <preference>Tracker VirtualMemory
|
||||
;
|
||||
SYSTEM_DEMOS = BSnow Chart Clock Cortex FontDemo $(X86_ONLY)GLTeapot
|
||||
$(HAIKU_INCLUDE_TRADEMARKS)$(X86_ONLY)Haiku3d Mandelbrot OverlayImage Pairs
|
||||
] ;
|
||||
SYSTEM_DEMOS = [ FFilterByBuildFeatures
|
||||
BSnow Chart Clock Cortex FontDemo GLTeapot@x86
|
||||
$(HAIKU_INCLUDE_TRADEMARKS)Haiku3d@x86 Mandelbrot OverlayImage Pairs
|
||||
Playground Pulse Sudoku
|
||||
;
|
||||
SYSTEM_LIBS =
|
||||
] ;
|
||||
SYSTEM_LIBS = [ FFilterByBuildFeatures
|
||||
libbe.so libbsd.so libbnetapi.so
|
||||
libdebug.so libdevice.so
|
||||
libgame.so $(X86_ONLY)libGL.so $(X86_ONLY)libglut.so
|
||||
libgame.so libGL.so@x86 libglut.so@x86
|
||||
libgnu.so libmail.so libmedia.so libmidi.so libmidi2.so
|
||||
libnetwork.so
|
||||
<revisioned>libroot.so libroot-addon-icu.so
|
||||
libscreensaver.so
|
||||
libtextencoding.so libtiff.so libtracker.so libtranslation.so
|
||||
$(HAIKU_SHARED_LIBSTDC++) $(HAIKU_SHARED_LIBSUPC++)
|
||||
;
|
||||
PRIVATE_SYSTEM_LIBS =
|
||||
] ;
|
||||
PRIVATE_SYSTEM_LIBS = [ FFilterByBuildFeatures
|
||||
$(HAIKU_JPEG_CURRENT_LIB)
|
||||
$(HAIKU_LIBPNG_CURRENT_LIB)
|
||||
$(HAIKU_ZLIB_CURRENT_LIB)
|
||||
@ -103,11 +80,13 @@ PRIVATE_SYSTEM_LIBS =
|
||||
libalm.so
|
||||
libfluidsynth.so
|
||||
libilmimf.so
|
||||
;
|
||||
SYSTEM_SERVERS = app_server cddb_daemon debug_server input_server mail_daemon
|
||||
] ;
|
||||
SYSTEM_SERVERS = [ FFilterByBuildFeatures
|
||||
app_server cddb_daemon debug_server input_server mail_daemon
|
||||
media_addon_server media_server midi_server mount_server net_server
|
||||
notification_server power_daemon print_server print_addon_server registrar syslog_daemon
|
||||
;
|
||||
notification_server power_daemon print_server print_addon_server registrar
|
||||
syslog_daemon
|
||||
] ;
|
||||
|
||||
SYSTEM_NETWORK_DEVICES = ethernet loopback ;
|
||||
SYSTEM_NETWORK_DATALINK_PROTOCOLS = ethernet_frame <module>arp loopback_frame
|
||||
@ -115,17 +94,14 @@ SYSTEM_NETWORK_DATALINK_PROTOCOLS = ethernet_frame <module>arp loopback_frame
|
||||
#SYSTEM_NETWORK_PPP = ipcp modem pap pppoe ;
|
||||
SYSTEM_NETWORK_PROTOCOLS = ipv4 tcp udp icmp unix icmp6 ipv6 ;
|
||||
|
||||
SYSTEM_ADD_ONS_ACCELERANTS = $(X86_ONLY)radeon.accelerant
|
||||
$(X86_ONLY)nvidia.accelerant $(X86_ONLY)matrox.accelerant
|
||||
$(X86_ONLY)neomagic.accelerant $(X86_ONLY)intel_extreme.accelerant
|
||||
$(X86_ONLY)s3.accelerant $(X86_ONLY)vesa.accelerant
|
||||
$(X86_ONLY)ati.accelerant
|
||||
$(X86_ONLY)3dfx.accelerant
|
||||
$(X86_ONLY)radeon_hd.accelerant
|
||||
$(X86_ONLY)intel_810.accelerant
|
||||
#$(X86_ONLY)via.accelerant
|
||||
#$(X86_ONLY)vmware.accelerant
|
||||
;
|
||||
SYSTEM_ADD_ONS_ACCELERANTS = [ FFilterByBuildFeatures
|
||||
x86 @{
|
||||
3dfx.accelerant ati.accelerant matrox.accelerant neomagic.accelerant
|
||||
nvidia.accelerant intel_810.accelerant intel_extreme.accelerant
|
||||
radeon.accelerant radeon_hd.accelerant s3.accelerant vesa.accelerant
|
||||
#via.accelerant vmware.accelerant
|
||||
}@ # x86
|
||||
] ;
|
||||
SYSTEM_ADD_ONS_TRANSLATORS = BMPTranslator EXRTranslator GIFTranslator
|
||||
HVIFTranslator ICOTranslator JPEGTranslator JPEG2000Translator
|
||||
PCXTranslator PNGTranslator PPMTranslator
|
||||
@ -133,9 +109,10 @@ SYSTEM_ADD_ONS_TRANSLATORS = BMPTranslator EXRTranslator GIFTranslator
|
||||
TIFFTranslator WebPTranslator WonderBrushTranslator ICNSTranslator
|
||||
;
|
||||
SYSTEM_ADD_ONS_LOCALE_CATALOGS = <catalog-addon>plaintext ;
|
||||
SYSTEM_ADD_ONS_MEDIA = cortex_audioadapter.media_addon
|
||||
SYSTEM_ADD_ONS_MEDIA = [ FFilterByBuildFeatures
|
||||
cortex_audioadapter.media_addon
|
||||
cortex_flanger.media_addon
|
||||
$(X86_ONLY)dvb.media_addon
|
||||
dvb.media_addon@x86
|
||||
hmulti_audio.media_addon
|
||||
mixer.media_addon
|
||||
opensound.media_addon
|
||||
@ -147,8 +124,10 @@ SYSTEM_ADD_ONS_MEDIA = cortex_audioadapter.media_addon
|
||||
#legacy.media_addon
|
||||
equalizer.media_addon
|
||||
vst_host.media_addon
|
||||
;
|
||||
SYSTEM_ADD_ONS_MEDIA_PLUGINS = $(X86_ONLY)ffmpeg raw_decoder ;
|
||||
] ;
|
||||
SYSTEM_ADD_ONS_MEDIA_PLUGINS = [ FFilterByBuildFeatures
|
||||
ffmpeg@ffmpeg raw_decoder
|
||||
] ;
|
||||
SYSTEM_ADD_ONS_PRINT =
|
||||
Canon\ LIPS3\ Compatible
|
||||
Canon\ LIPS4\ Compatible
|
||||
@ -163,40 +142,45 @@ SYSTEM_ADD_ONS_PRINT_TRANSPORT = HP\ JetDirect IPP LPR
|
||||
# Parallel\ Port
|
||||
Print\ To\ File Serial\ Port USB\ Port
|
||||
;
|
||||
SYSTEM_ADD_ONS_SCREENSAVERS = Butterfly DebugNow $(X86_ONLY)Flurry
|
||||
$(X86_ONLY)GLife $(HAIKU_INCLUDE_TRADEMARKS)Haiku Icons IFS Leaves
|
||||
Message Spider ;
|
||||
SYSTEM_ADD_ONS_SCREENSAVERS = [ FFilterByBuildFeatures
|
||||
Butterfly DebugNow Flurry@x86
|
||||
GLife@x86 $(HAIKU_INCLUDE_TRADEMARKS)Haiku Icons IFS Leaves
|
||||
Message Spider
|
||||
] ;
|
||||
SYSTEM_ADD_ONS_DRIVERS_AUDIO = auich auvia echo3g emuxki hda ice1712 sis7018 ;
|
||||
SYSTEM_ADD_ONS_DRIVERS_AUDIO_OLD = ; #cmedia usb_audio ;
|
||||
SYSTEM_ADD_ONS_DRIVERS_GRAPHICS = $(X86_ONLY)radeon $(X86_ONLY)nvidia
|
||||
$(X86_ONLY)neomagic $(X86_ONLY)matrox $(X86_ONLY)intel_extreme
|
||||
$(X86_ONLY)s3 $(X86_ONLY)vesa #$(X86_ONLY)via #$(X86_ONLY)vmware
|
||||
$(X86_ONLY)ati $(X86_ONLY)3dfx $(X86_ONLY)radeon_hd
|
||||
$(X86_ONLY)intel_810
|
||||
;
|
||||
SYSTEM_ADD_ONS_DRIVERS_GRAPHICS = [ FFilterByBuildFeatures
|
||||
x86 @{
|
||||
ati 3dfx intel_810 intel_extreme matrox neomagic nvidia radeon radeon_hd
|
||||
s3 vesa #via vmware
|
||||
}@ # x86
|
||||
] ;
|
||||
SYSTEM_ADD_ONS_DRIVERS_MIDI = emuxki ice1712 usb_midi ;
|
||||
SYSTEM_ADD_ONS_DRIVERS_NET = $(X86_ONLY)3com $(X86_ONLY)atheros813x
|
||||
$(X86_ONLY)ar81xx $(X86_ONLY)attansic_l1 $(X86_ONLY)attansic_l2
|
||||
$(X86_ONLY)broadcom440x $(X86_ONLY)broadcom570x $(X86_ONLY)dec21xxx etherpci
|
||||
$(X86_ONLY)ipro100 $(X86_ONLY)ipro1000 $(X86_ONLY)jmicron2x0
|
||||
$(X86_ONLY)marvell_yukon $(X86_ONLY)nforce $(X86_ONLY)pcnet pegasus
|
||||
$(X86_ONLY)rtl8139 $(X86_ONLY)rtl81xx $(X86_ONLY)sis19x sis900
|
||||
$(X86_ONLY)syskonnect usb_davicom usb_asix usb_ecm $(X86_ONLY)via_rhine
|
||||
$(X86_ONLY)vt612x wb840
|
||||
SYSTEM_ADD_ONS_DRIVERS_NET = [ FFilterByBuildFeatures
|
||||
x86 @{
|
||||
3com atheros813x ar81xx attansic_l1 attansic_l2 broadcom440x
|
||||
broadcom570x dec21xxx ipro100 ipro1000 jmicron2x0 marvell_yukon nforce
|
||||
pcnet rtl8139 rtl81xx sis19x syskonnect via_rhine vt612x
|
||||
}@ # x86
|
||||
|
||||
etherpci pegasus sis900 usb_davicom usb_asix usb_ecm wb840
|
||||
|
||||
# WLAN drivers
|
||||
$(X86_ONLY)aironetwifi $(X86_ONLY)atheroswifi $(X86_ONLY)broadcom43xx
|
||||
$(X86_ONLY)iprowifi2100 $(X86_ONLY)iprowifi2200 $(X86_ONLY)iprowifi3945
|
||||
$(X86_ONLY)iprowifi4965 $(X86_ONLY)marvell88w8363 $(X86_ONLY)marvell88w8335
|
||||
$(X86_ONLY)ralink2860 $(X86_ONLY)ralinkwifi $(X86_ONLY)wavelanwifi
|
||||
x86 @{
|
||||
aironetwifi atheroswifi broadcom43xx
|
||||
iprowifi2100 iprowifi2200 iprowifi3945
|
||||
iprowifi4965 marvell88w8363 marvell88w8335
|
||||
ralink2860 ralinkwifi wavelanwifi
|
||||
}@ # x86
|
||||
|
||||
# WWAN drivers
|
||||
#$(GPL_ONLY)usb_beceemwmx
|
||||
;
|
||||
SYSTEM_ADD_ONS_DRIVERS_POWER = $(X86_ONLY)acpi_button ;
|
||||
SYSTEM_ADD_ONS_BUS_MANAGERS = $(ATA_ONLY)ata pci $(X86_ONLY)ps2 $(X86_ONLY)isa
|
||||
$(IDE_ONLY)ide scsi config_manager agp_gart usb firewire $(X86_ONLY)acpi
|
||||
;
|
||||
#usb_beceemwmx@gpl
|
||||
] ;
|
||||
SYSTEM_ADD_ONS_DRIVERS_POWER = [ FFilterByBuildFeatures acpi_button@x86 ] ;
|
||||
SYSTEM_ADD_ONS_BUS_MANAGERS = [ FFilterByBuildFeatures
|
||||
ata@ata pci ps2@x86 isa@x86
|
||||
ide@ide scsi config_manager agp_gart usb firewire acpi@x86
|
||||
] ;
|
||||
SYSTEM_ADD_ONS_FILE_SYSTEMS = bfs btrfs cdda exfat ext2 fat iso9660 nfs
|
||||
attribute_overlay write_overlay ntfs reiserfs udf googlefs ;
|
||||
|
||||
@ -223,16 +207,14 @@ for driver in $(SYSTEM_ADD_ONS_DRIVERS_NET) {
|
||||
AddFilesToHaikuImage system add-ons kernel bus_managers
|
||||
: $(SYSTEM_ADD_ONS_BUS_MANAGERS) ;
|
||||
AddFilesToHaikuImage system add-ons kernel busses agp_gart
|
||||
: $(X86_ONLY)<agp_gart>intel ;
|
||||
: <agp_gart>intel@x86 ;
|
||||
|
||||
if $(HAIKU_ATA_STACK) = 1 {
|
||||
AddFilesToHaikuImage system add-ons kernel busses ata
|
||||
: generic_ide_pci it8211 legacy_sata silicon_image_3112
|
||||
$(X86_ONLY)ide_isa ;
|
||||
: generic_ide_pci it8211 legacy_sata silicon_image_3112 ide_isa@x86 ;
|
||||
} else {
|
||||
AddFilesToHaikuImage system add-ons kernel busses ide
|
||||
: generic_ide_pci it8211 legacy_sata silicon_image_3112
|
||||
$(X86_ONLY)ide_isa ;
|
||||
: generic_ide_pci it8211 legacy_sata silicon_image_3112 ide_isa@x86 ;
|
||||
}
|
||||
|
||||
AddFilesToHaikuImage system add-ons kernel busses scsi
|
||||
@ -241,18 +223,18 @@ AddFilesToHaikuImage system add-ons kernel busses usb
|
||||
: <usb>uhci <usb>ohci <usb>ehci ;
|
||||
AddFilesToHaikuImage system add-ons kernel console : vga_text ;
|
||||
AddFilesToHaikuImage system add-ons kernel debugger
|
||||
: <kdebug>demangle $(X86_ONLY)<kdebug>disasm <kdebug>hangman
|
||||
: <kdebug>demangle <kdebug>disasm@x86 <kdebug>hangman
|
||||
<kdebug>invalidate_on_exit <kdebug>usb_keyboard <kdebug>qrencode
|
||||
<kdebug>run_on_exit ;
|
||||
AddFilesToHaikuImage system add-ons kernel file_systems
|
||||
: $(SYSTEM_ADD_ONS_FILE_SYSTEMS) ;
|
||||
AddFilesToHaikuImage system add-ons kernel generic
|
||||
: $(ATA_ONLY)ata_adapter $(X86_ONLY)bios dpc $(IDE_ONLY)ide_adapter
|
||||
locked_pool mpu401 scsi_periph <module>tty ; #$(X86_ONLY)cpuidle ;
|
||||
: ata_adapter@ata bios@x86 dpc ide_adapter@ide
|
||||
locked_pool mpu401 scsi_periph <module>tty ; #cpuidle@x86 ;
|
||||
AddFilesToHaikuImage system add-ons kernel partitioning_systems
|
||||
: amiga_rdb apple efi_gpt intel session ;
|
||||
AddFilesToHaikuImage system add-ons kernel interrupt_controllers
|
||||
: $(PPC_ONLY)openpic ;
|
||||
: openpic@ppc ;
|
||||
|
||||
if $(TARGET_ARCH) = x86 {
|
||||
AddFilesToHaikuImage system add-ons kernel cpu : generic_x86 ;
|
||||
@ -260,9 +242,9 @@ if $(TARGET_ARCH) = x86 {
|
||||
|
||||
# drivers
|
||||
AddNewDriversToHaikuImage disk scsi : scsi_cd scsi_disk ;
|
||||
AddNewDriversToHaikuImage power : $(X86_ONLY)enhanced_speedstep ;
|
||||
AddNewDriversToHaikuImage power : $(X86_ONLY)acpi_battery ;
|
||||
#AddNewDriversToHaikuImage power : $(X86_ONLY)x86_cpuidle ;
|
||||
AddNewDriversToHaikuImage power : enhanced_speedstep@x86 ;
|
||||
AddNewDriversToHaikuImage power : acpi_battery@x86 ;
|
||||
#AddNewDriversToHaikuImage power : x86_cpuidle@x86 ;
|
||||
|
||||
# legacy drivers
|
||||
AddDriversToHaikuImage : console dprintf null
|
||||
@ -271,7 +253,7 @@ AddDriversToHaikuImage audio hmulti : $(SYSTEM_ADD_ONS_DRIVERS_AUDIO) ;
|
||||
AddDriversToHaikuImage audio old : $(SYSTEM_ADD_ONS_DRIVERS_AUDIO_OLD) ;
|
||||
AddDriversToHaikuImage midi : $(SYSTEM_ADD_ONS_DRIVERS_MIDI) ;
|
||||
AddDriversToHaikuImage bus : usb_raw fw_raw ;
|
||||
AddDriversToHaikuImage disk floppy : $(X86_ONLY)pc_floppy ;
|
||||
AddDriversToHaikuImage disk floppy : pc_floppy@x86 ;
|
||||
AddDriversToHaikuImage disk usb : usb_disk ;
|
||||
AddDriversToHaikuImage disk usb : usb_floppy ;
|
||||
AddDriversToHaikuImage printer usb : usb_printer ;
|
||||
@ -393,7 +375,7 @@ AddSymlinkToHaikuImage home Desktop
|
||||
|
||||
# Add the files to be used by installoptionalpackage.
|
||||
AddDirectoryToHaikuImage common data optional-packages ;
|
||||
local optional-pkg-files = OptionalBuildFeatures OptionalPackageDependencies
|
||||
local optional-pkg-files = BuildFeatures OptionalPackageDependencies
|
||||
OptionalPackages OptionalLibPackages ;
|
||||
for name in $(optional-pkg-files) {
|
||||
local file = [ FDirName $(HAIKU_TOP) build jam $(name) ] ;
|
||||
@ -622,12 +604,12 @@ AddFilesToHaikuImage system : haiku_loader ;
|
||||
|
||||
# boot module links
|
||||
AddBootModuleSymlinksToHaikuImage
|
||||
$(X86_ONLY)acpi $(ATA_ONLY)ata pci $(X86_ONLY)isa config_manager dpc
|
||||
$(IDE_ONLY)ide scsi usb
|
||||
$(PPC_ONLY)openpic
|
||||
$(ATA_ONLY)ata_adapter $(IDE_ONLY)ide_adapter locked_pool scsi_periph
|
||||
acpi@x86 ata@ata pci isa@x86 config_manager dpc
|
||||
ide@ide scsi usb
|
||||
openpic@ppc
|
||||
ata_adapter@ata ide_adapter@ide locked_pool scsi_periph
|
||||
ahci generic_ide_pci it8211 legacy_sata silicon_image_3112
|
||||
$(X86_ONLY)ide_isa
|
||||
ide_isa@x86
|
||||
<usb>uhci <usb>ohci <usb>ehci
|
||||
scsi_cd scsi_disk usb_disk
|
||||
efi_gpt
|
||||
|
@ -96,6 +96,62 @@ rule FSplitPath
|
||||
return $(components) ;
|
||||
}
|
||||
|
||||
|
||||
rule FSetConditionsHold conditions : set
|
||||
{
|
||||
# FSetConditionsHold <conditions> : <set> ;
|
||||
# Checks whether the conditions <conditions> are satisfied by the list of
|
||||
# elements <set> and returns a respective result (if so: "1", if not: empty
|
||||
# list). The conditions are satisfied when <conditions> is not empty and
|
||||
# * none of the negative conditions it contains hold and
|
||||
# * if <conditions> contains any positive conditions, at least one one of
|
||||
# those holds.
|
||||
# A positive condition is an element not starting with a "!". It holds when
|
||||
# the element is contained in <set>.
|
||||
# A negative condition is an element that starts with a "!". It holds when
|
||||
# the string resulting from removing the leading "!" is not contained in
|
||||
# <set>.
|
||||
#
|
||||
# <conditions> - The list of conditions.
|
||||
# <set> - The elements against which the conditions are tested.
|
||||
#
|
||||
# Examples:
|
||||
# For set { a b c } the following conditions hold:
|
||||
# { a }, { a d }, { !d }, { !d !e }, { a !d }, { b !e !f }
|
||||
# The following conditions don't hold:
|
||||
# { }, { d }, { d e }, { !a }, { !a b }, { !d e } { a b !c !d }
|
||||
|
||||
local hasPositive ;
|
||||
local hasNegative ;
|
||||
local positiveMatch ;
|
||||
local condition ;
|
||||
for condition in $(conditions) {
|
||||
switch $(condition) {
|
||||
case !* :
|
||||
{
|
||||
hasNegative = 1 ;
|
||||
condition = [ Match "!(.*)" : $(condition) ] ;
|
||||
if $(condition) in $(set) {
|
||||
return ;
|
||||
}
|
||||
}
|
||||
case * :
|
||||
{
|
||||
hasPositive = 1 ;
|
||||
if $(condition) in $(set) {
|
||||
positiveMatch = 1 ;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if $(hasPositive) {
|
||||
return $(positiveMatch) ;
|
||||
}
|
||||
return $(hasNegative) ;
|
||||
}
|
||||
|
||||
|
||||
rule SetPlatformCompatibilityFlagVariables
|
||||
{
|
||||
# SetPlatformCompatibilityFlagVariables <platform var> : <var prefix>
|
||||
|
@ -160,6 +160,8 @@ rule AddFilesToContainer container : directoryTokens : targets : destName
|
||||
: $(directoryTokens) ] ;
|
||||
local containerGrist = [ on $(container) return $(HAIKU_CONTAINER_GRIST) ] ;
|
||||
|
||||
targets = [ FFilterByBuildFeatures $(targets) ] ;
|
||||
|
||||
# If the image shall only be updated, we filter out all targets not marked
|
||||
# accordingly.
|
||||
if [ on $(container) return $(HAIKU_CONTAINER_UPDATE_ONLY) ]
|
||||
@ -303,6 +305,8 @@ rule AddDriversToContainer container : relativeDirectoryTokens : targets
|
||||
local directoryTokens = system add-ons kernel drivers dev
|
||||
$(relativeDirectoryTokens) ;
|
||||
|
||||
targets = [ FFilterByBuildFeatures $(targets) ] ;
|
||||
|
||||
AddFilesToContainer $(container) : system add-ons kernel drivers bin
|
||||
: $(targets) ;
|
||||
|
||||
@ -335,6 +339,8 @@ rule AddNewDriversToContainer container : relativeDirectoryTokens
|
||||
local directoryTokens = system add-ons kernel drivers
|
||||
$(relativeDirectoryTokens) ;
|
||||
|
||||
targets = [ FFilterByBuildFeatures $(targets) ] ;
|
||||
|
||||
AddFilesToContainer $(container) : $(directoryTokens)
|
||||
: $(targets) ;
|
||||
}
|
||||
@ -350,6 +356,8 @@ rule AddBootModuleSymlinksToContainer container : targets
|
||||
return ;
|
||||
}
|
||||
|
||||
targets = [ FFilterByBuildFeatures $(targets) ] ;
|
||||
|
||||
# add the symlinks
|
||||
local installTargetsVar
|
||||
= [ on $(container) return $(HAIKU_INSTALL_TARGETS_VAR) ] ;
|
||||
@ -1272,6 +1280,8 @@ rule AddLibrariesToHaikuHybridImage directory : libs
|
||||
# Installs libraries with the appropriate links onto the image.
|
||||
#
|
||||
|
||||
libs = [ FFilterByBuildFeatures $(libs) ] ;
|
||||
|
||||
local lib ;
|
||||
for lib in $(libs) {
|
||||
local abiVersion = [ on $(lib) return $(HAIKU_LIB_ABI_VERSION) ] ;
|
||||
|
@ -417,3 +417,166 @@ rule DefineBuildProfile name : type : path {
|
||||
|
||||
return 1 ;
|
||||
}
|
||||
|
||||
|
||||
# pragma mark - Build Features
|
||||
|
||||
|
||||
rule FIsBuildFeatureEnabled feature
|
||||
{
|
||||
# FIsBuildFeatureEnabled <feature> ;
|
||||
# Returns whether the given build feature <feature> is enabled (if so: "1",
|
||||
# if not: empty list).
|
||||
#
|
||||
# <feature> - The name of the build feature (all lower case).
|
||||
|
||||
if $(feature) in $(HAIKU_BUILD_FEATURES) {
|
||||
return 1 ;
|
||||
}
|
||||
|
||||
return ;
|
||||
}
|
||||
|
||||
|
||||
rule FMatchesBuildFeatures specification
|
||||
{
|
||||
# FMatchesBuildFeatures <specification> ;
|
||||
# Returns whether the given build feature specification <specification>
|
||||
# holds. <specification> consists of positive and negative build feature
|
||||
# conditions. Conditions can be individual list elements and multiple
|
||||
# conditions can be joined, separated by ",", in a single list element. The
|
||||
# effect is the same; they are considered as single set of conditions.
|
||||
# A positive condition does not start with a "!". It holds when the build
|
||||
# feature named by the element is enabled.
|
||||
# A negative condition starts with a "!". It holds when the build feature
|
||||
# named by the string resulting from removing the leading "!" is not
|
||||
# enabled.
|
||||
# <specification> holds when it is not empty and
|
||||
# * none of the negative conditions it contains hold and
|
||||
# * if it contains any positive conditions, at least one one of them holds.
|
||||
#
|
||||
# <specification> - The build feature specification. A list of individual
|
||||
# conditions or conditions joined by ",".
|
||||
|
||||
local splitSpecification ;
|
||||
local element ;
|
||||
for element in $(specification) {
|
||||
splitSpecification += [ FSplitString $(element) : "," ] ;
|
||||
}
|
||||
return [ FSetConditionsHold $(splitSpecification)
|
||||
: $(HAIKU_BUILD_FEATURES) ] ;
|
||||
}
|
||||
|
||||
|
||||
rule FFilterByBuildFeatures list
|
||||
{
|
||||
# FFilterByBuildFeatures <list> ;
|
||||
# Filters the list annotated by build feature specifications and returns the
|
||||
# resulting list. The list can be annotated in two different ways:
|
||||
# * A single list element can be annotated by appending "@<specification>"
|
||||
# to it, with <specification> being a build feature specification (a
|
||||
# single comma-separated string). The element appears in the resulting
|
||||
# list, only if <specification> holds.
|
||||
# * A sublist can be annotated by enclosing it in "<specification> @{" (two
|
||||
# separate list elements) and "}@", with <specification> being a build
|
||||
# feature specification (a single comma-separated string). The enclosed
|
||||
# sublist appears in the resulting list, only if <specification> holds.
|
||||
# The sublist annotations can be nested. The annotations themselves don't
|
||||
# appear in the resulting list.
|
||||
#
|
||||
# <list> - A list annotated with build feature specifications.
|
||||
|
||||
local filteredList ;
|
||||
|
||||
# Since we must look ahead one element to be able to decide whether an
|
||||
# element is a regular list element or a features specification for a
|
||||
# subsequent "@{". Hence we always process an element other than "@{" and
|
||||
# "}@" in the next iteration. We append a dummy element to the list so we
|
||||
# don't need special handling for the last element.
|
||||
local evaluationStack = 1 ;
|
||||
local previousElement ;
|
||||
local element ;
|
||||
for element in $(list) dummy {
|
||||
local stackTop = $(evaluationStack[1]) ;
|
||||
local processElement = $(previousElement) ;
|
||||
switch $(element) {
|
||||
case }@ :
|
||||
{
|
||||
# Pop the topmost specificaton off the stack.
|
||||
evaluationStack = $(evaluationStack[2-]) ;
|
||||
if ! $(evaluationStack) {
|
||||
Exit "FFilterByBuildFeatures: Unbalanced @( in: " $(list) ;
|
||||
}
|
||||
|
||||
processElement = $(previousElement) ;
|
||||
previousElement = ;
|
||||
}
|
||||
case @{ :
|
||||
{
|
||||
if ! $(previousElement) {
|
||||
Exit "FFilterByBuildFeatures: No feature specification"
|
||||
"after )@ in: " $(list) ;
|
||||
}
|
||||
|
||||
if $(evaluationStack[1]) = 1
|
||||
&& [ FMatchesBuildFeatures $(previousElement) ] {
|
||||
evaluationStack = 1 $(evaluationStack) ;
|
||||
} else {
|
||||
evaluationStack = 0 $(evaluationStack) ;
|
||||
}
|
||||
|
||||
processElement = ;
|
||||
previousElement = ;
|
||||
}
|
||||
case * :
|
||||
{
|
||||
processElement = $(previousElement) ;
|
||||
previousElement = $(element) ;
|
||||
}
|
||||
}
|
||||
|
||||
if $(processElement) && $(stackTop) = 1 {
|
||||
local splitElement = [ Match "(.*)@([^@]*)" : $(processElement) ] ;
|
||||
if $(splitElement) {
|
||||
if [ FMatchesBuildFeatures $(splitElement[2]) ] {
|
||||
filteredList += $(splitElement[1]) ;
|
||||
}
|
||||
} else {
|
||||
filteredList += $(processElement) ;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if $(evaluationStack[2-]) {
|
||||
Exit "FFilterByBuildFeatures: Unbalanced )@ in: " $(list) ;
|
||||
}
|
||||
|
||||
return $(filteredList) ;
|
||||
}
|
||||
|
||||
|
||||
rule EnableBuildFeatures features : specification
|
||||
{
|
||||
# EnableBuildFeatures <features> : <specification> ;
|
||||
# Enables the build features <features>, if the build features specification
|
||||
# <specification> holds. If <specification> is omitted, the features are
|
||||
# enabled unconditionally.
|
||||
# The rule enables a build feature by adding its given lower case name to
|
||||
# the build variable HAIKU_BUILD_FEATURES and defining a build variable
|
||||
# HAIKU_BUILD_FEATURE_<FEATURE>_ENABLED (<FEATURE> being the upper case name
|
||||
# of the build feature) to "1".
|
||||
#
|
||||
# <features> - A list of build feature names (lower case).
|
||||
# <specification> - An optional build features specification (cf.
|
||||
# FMatchesBuildFeatures).
|
||||
|
||||
if ! $(specification)
|
||||
|| [ FMatchesBuildFeatures $(specification)
|
||||
: $(HAIKU_BUILD_FEATURES) ] {
|
||||
local feature ;
|
||||
for feature in $(features) {
|
||||
HAIKU_BUILD_FEATURES += $(feature) ;
|
||||
HAIKU_BUILD_FEATURE_$(feature:U)_ENABLED = 1 ;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,43 +1,28 @@
|
||||
# This file defines what ends up in the network boot archive and it executes the
|
||||
# rules building the archive.
|
||||
|
||||
local X86_ONLY = ;
|
||||
local PPC_ONLY = ;
|
||||
if $(TARGET_ARCH) = x86 {
|
||||
X86_ONLY = "" ;
|
||||
} else if $(TARGET_ARCH) = ppc {
|
||||
X86_ONLY = ;
|
||||
}
|
||||
|
||||
local GPL_ONLY = ;
|
||||
if $(HAIKU_INCLUDE_GPL_ADDONS) = 1 {
|
||||
GPL_ONLY = "" ;
|
||||
}
|
||||
|
||||
#HACK: remove when old ide code is removed!
|
||||
local ATA_ONLY = ;
|
||||
local IDE_ONLY = ;
|
||||
if $(HAIKU_ATA_STACK) = 1 {
|
||||
ATA_ONLY = "" ;
|
||||
} else {
|
||||
IDE_ONLY = "" ;
|
||||
}
|
||||
|
||||
SYSTEM_NETWORK_DEVICES = ethernet loopback ;
|
||||
SYSTEM_NETWORK_DATALINK_PROTOCOLS = ethernet_frame <module>arp loopback_frame ;
|
||||
SYSTEM_NETWORK_PROTOCOLS = ipv4 tcp udp icmp unix ;
|
||||
|
||||
SYSTEM_ADD_ONS_DRIVERS_NET = $(X86_ONLY)3com $(X86_ONLY)atheros813x
|
||||
$(X86_ONLY)broadcom440x $(X86_ONLY)broadcom570x etherpci $(X86_ONLY)ipro1000
|
||||
pegasus $(X86_ONLY)rtl8139 rtl8169 $(X86_ONLY)rtl81xx sis900
|
||||
$(X86_ONLY)via_rhine wb840 $(X86_ONLY)ipro100 $(X86_ONLY)nforce
|
||||
SYSTEM_ADD_ONS_DRIVERS_NET = [ FFilterByBuildFeatures
|
||||
x86 @{
|
||||
3com atheros813x
|
||||
broadcom440x broadcom570x ipro1000
|
||||
rtl8139 rtl81xx
|
||||
via_rhine ipro100 nforce
|
||||
marvell_yukon syskonnect
|
||||
attansic_l2 ar81xx
|
||||
}@ # x86
|
||||
|
||||
etherpci pegasus rtl8169 sis900 usb_ecm wb840
|
||||
#vlance
|
||||
$(X86_ONLY)marvell_yukon $(X86_ONLY)syskonnect
|
||||
$(X86_ONLY)attansic_l2 $(X86_ONLY)ar81xx usb_ecm
|
||||
;
|
||||
SYSTEM_ADD_ONS_BUS_MANAGERS = pci $(X86_ONLY)isa $(IDE_ONLY)ide $(ATA_ONLY)ata
|
||||
] ;
|
||||
SYSTEM_ADD_ONS_BUS_MANAGERS = [ FFilterByBuildFeatures
|
||||
pci isa@x86 ide@ide ata@ata
|
||||
scsi config_manager agp_gart
|
||||
;
|
||||
] ;
|
||||
SYSTEM_ADD_ONS_FILE_SYSTEMS = bfs fat iso9660 ;
|
||||
|
||||
|
||||
@ -45,20 +30,20 @@ SYSTEM_ADD_ONS_FILE_SYSTEMS = bfs fat iso9660 ;
|
||||
AddFilesToNetBootArchive system add-ons kernel bus_managers
|
||||
: $(SYSTEM_ADD_ONS_BUS_MANAGERS) ;
|
||||
AddFilesToNetBootArchive system add-ons kernel busses agp_gart
|
||||
: $(X86_ONLY)<agp_gart>intel ;
|
||||
: <agp_gart>intel@x86 ;
|
||||
AddFilesToNetBootArchive system add-ons kernel busses ide
|
||||
: generic_ide_pci $(X86_ONLY)ide_isa silicon_image_3112 ;
|
||||
: generic_ide_pci ide_isa@x86 silicon_image_3112 ;
|
||||
AddFilesToNetBootArchive system add-ons kernel busses scsi
|
||||
: ahci ;
|
||||
AddFilesToNetBootArchive system add-ons kernel console : vga_text ;
|
||||
AddFilesToNetBootArchive system add-ons kernel file_systems
|
||||
: $(SYSTEM_ADD_ONS_FILE_SYSTEMS) ;
|
||||
AddFilesToNetBootArchive system add-ons kernel generic
|
||||
: $(IDE_ONLY)ide_adapter $(ATA_ONLY)ata_adapter locked_pool scsi_periph ;
|
||||
: ide_adapter@ide ata_adapter@ata locked_pool scsi_periph ;
|
||||
AddFilesToNetBootArchive system add-ons kernel partitioning_systems
|
||||
: intel session ;
|
||||
AddFilesToNetBootArchive system add-ons kernel interrupt_controllers
|
||||
: $(PPC_ONLY)openpic ;
|
||||
: openpic@ppc ;
|
||||
|
||||
if $(TARGET_ARCH) = x86 {
|
||||
AddFilesToNetBootArchive system add-ons kernel cpu : generic_x86 ;
|
||||
@ -96,12 +81,12 @@ AddFilesToNetBootArchive system add-ons kernel network protocols
|
||||
# boot module links
|
||||
AddBootModuleSymlinksToNetBootArchive
|
||||
$(SYSTEM_ADD_ONS_BUS_MANAGERS)
|
||||
ahci generic_ide_pci $(X86_ONLY)ide_isa silicon_image_3112
|
||||
ahci generic_ide_pci ide_isa@x86 silicon_image_3112
|
||||
$(SYSTEM_ADD_ONS_FILE_SYSTEMS)
|
||||
$(IDE_ONLY)ide_adapter $(ATA_ONLY)ata_adapter locked_pool scsi_periph
|
||||
ide_adapter@ide ata_adapter@ata locked_pool scsi_periph
|
||||
intel session
|
||||
$(PPC_ONLY)openpic
|
||||
$(X86_ONLY)generic_x86
|
||||
openpic@ppc
|
||||
generic_x86@x86
|
||||
# nbd
|
||||
remote_disk
|
||||
$(SYSTEM_ADD_ONS_DRIVERS_NET)
|
||||
|
@ -124,36 +124,50 @@ if [ IsOptionalHaikuImagePackageAdded ABI-compliance-checker ] {
|
||||
|
||||
# APR
|
||||
if [ IsOptionalHaikuImagePackageAdded APR ] {
|
||||
if $(TARGET_ARCH) != x86 {
|
||||
Echo "No optional package APR available for $(TARGET_ARCH)" ;
|
||||
} else if $(HAIKU_GCC_VERSION[1]) >= 4 {
|
||||
if $(TARGET_ARCH) = x86 {
|
||||
if $(HAIKU_GCC_VERSION[1]) >= 4 {
|
||||
InstallOptionalHaikuImagePackage
|
||||
apr-1.4.6-r1a4-x86-gcc4-2012-08-30.zip
|
||||
: $(baseURL)/apr-1.4.6-r1a4-x86-gcc4-2012-08-30.zip
|
||||
: : true ;
|
||||
} else {
|
||||
InstallOptionalHaikuImagePackage
|
||||
apr-1.4.6-r1a4-x86-gcc2-2012-08-27.zip
|
||||
: $(baseURL)/apr-1.4.6-r1a4-x86-gcc2-2012-08-27.zip
|
||||
: : true ;
|
||||
}
|
||||
} else if $(TARGET_ARCH) = x86_64 {
|
||||
InstallOptionalHaikuImagePackage
|
||||
apr-1.4.6-r1a4-x86-gcc4-2012-08-30.zip
|
||||
: $(baseURL)/apr-1.4.6-r1a4-x86-gcc4-2012-08-30.zip
|
||||
apr-1.4.6-x86_64-2012-12-08.zip
|
||||
: $(baseURL)/apr-1.4.6-x86_64-2012-12-08.zip
|
||||
: : true ;
|
||||
} else {
|
||||
InstallOptionalHaikuImagePackage
|
||||
apr-1.4.6-r1a4-x86-gcc2-2012-08-27.zip
|
||||
: $(baseURL)/apr-1.4.6-r1a4-x86-gcc2-2012-08-27.zip
|
||||
: : true ;
|
||||
Echo "No optional package APR available for $(TARGET_ARCH)" ;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
# APR-util
|
||||
if [ IsOptionalHaikuImagePackageAdded APR-util ] {
|
||||
if $(TARGET_ARCH) != x86 {
|
||||
Echo "No optional package APR-util available for $(TARGET_ARCH)" ;
|
||||
} else if $(HAIKU_GCC_VERSION[1]) >= 4 {
|
||||
if $(TARGET_ARCH) = x86 {
|
||||
if $(HAIKU_GCC_VERSION[1]) >= 4 {
|
||||
InstallOptionalHaikuImagePackage
|
||||
apr-util-1.4.1-r1a4-x86-gcc4-2012-08-30.zip
|
||||
: $(baseURL)/apr-util-1.4.1-r1a4-x86-gcc4-2012-08-30.zip
|
||||
: : true ;
|
||||
} else {
|
||||
InstallOptionalHaikuImagePackage
|
||||
apr-util-1.4.1-r1a4-x86-gcc2-2012-08-27.zip
|
||||
: $(baseURL)/apr-util-1.4.1-r1a4-x86-gcc2-2012-08-27.zip
|
||||
: : true ;
|
||||
}
|
||||
} else if $(TARGET_ARCH) = x86_64 {
|
||||
InstallOptionalHaikuImagePackage
|
||||
apr-util-1.4.1-r1a4-x86-gcc4-2012-08-30.zip
|
||||
: $(baseURL)/apr-util-1.4.1-r1a4-x86-gcc4-2012-08-30.zip
|
||||
apr-util-1.4.1-x86_64-2012-12-08.zip
|
||||
: $(baseURL)/apr-util-1.4.1-x86_64-2012-12-08.zip
|
||||
: : true ;
|
||||
} else {
|
||||
InstallOptionalHaikuImagePackage
|
||||
apr-util-1.4.1-r1a4-x86-gcc2-2012-08-27.zip
|
||||
: $(baseURL)/apr-util-1.4.1-r1a4-x86-gcc2-2012-08-27.zip
|
||||
: : true ;
|
||||
Echo "No optional package APR-util available for $(TARGET_ARCH)" ;
|
||||
}
|
||||
}
|
||||
|
||||
@ -410,16 +424,22 @@ if [ IsOptionalHaikuImagePackageAdded Caya ] {
|
||||
|
||||
# CCache
|
||||
if [ IsOptionalHaikuImagePackageAdded CCache ] {
|
||||
if $(TARGET_ARCH) != x86 {
|
||||
Echo "No optional package CCache available for $(TARGET_ARCH)" ;
|
||||
} else if $(HAIKU_GCC_VERSION[1]) >= 4 {
|
||||
if $(TARGET_ARCH) = x86 {
|
||||
if $(HAIKU_GCC_VERSION[1]) >= 4 {
|
||||
InstallOptionalHaikuImagePackage
|
||||
ccache-3.0.1-r1a4-x86-gcc4-2012-08-30.zip
|
||||
: $(baseURL)/ccache-3.0.1-r1a4-x86-gcc4-2012-08-30.zip ;
|
||||
} else {
|
||||
InstallOptionalHaikuImagePackage
|
||||
ccache-3.0.1-r1a4-x86-gcc2-2012-08-27.zip
|
||||
: $(baseURL)/ccache-3.0.1-r1a4-x86-gcc2-2012-08-27.zip ;
|
||||
}
|
||||
} else if $(TARGET_ARCH) = x86_64 {
|
||||
InstallOptionalHaikuImagePackage
|
||||
ccache-3.0.1-r1a4-x86-gcc4-2012-08-30.zip
|
||||
: $(baseURL)/ccache-3.0.1-r1a4-x86-gcc4-2012-08-30.zip ;
|
||||
ccache-3.0.1-x86_64-2012-12-08.zip
|
||||
: $(baseURL)/ccache-3.0.1-x86_64-2012-12-08.zip ;
|
||||
} else {
|
||||
InstallOptionalHaikuImagePackage
|
||||
ccache-3.0.1-r1a4-x86-gcc2-2012-08-27.zip
|
||||
: $(baseURL)/ccache-3.0.1-r1a4-x86-gcc2-2012-08-27.zip ;
|
||||
Echo "No optional package CCache available for $(TARGET_ARCH)" ;
|
||||
}
|
||||
}
|
||||
|
||||
@ -531,9 +551,7 @@ if [ IsOptionalHaikuImagePackageAdded Colors! ] {
|
||||
|
||||
# Ctags
|
||||
if [ IsOptionalHaikuImagePackageAdded Ctags ] {
|
||||
if $(TARGET_ARCH) != x86 {
|
||||
Echo "No optional package Ctags available for $(TARGET_ARCH)" ;
|
||||
} else {
|
||||
if $(TARGET_ARCH) = x86 {
|
||||
if $(HAIKU_GCC_VERSION[1]) >= 4 {
|
||||
InstallOptionalHaikuImagePackage
|
||||
ctags-5.8-r1a4-x86-gcc4-2012-08-30.zip
|
||||
@ -545,6 +563,13 @@ if [ IsOptionalHaikuImagePackageAdded Ctags ] {
|
||||
: $(baseURL)/ctags-5.8-r1a4-x86-gcc2-2012-09-03.zip
|
||||
: : true ;
|
||||
}
|
||||
} else if $(TARGET_ARCH) = x86_64 {
|
||||
InstallOptionalHaikuImagePackage
|
||||
ctags-5.8-x86_64-2012-12-08.zip
|
||||
: $(baseURL)/ctags-5.8-x86_64-2012-12-08.zip
|
||||
: : true ;
|
||||
} else {
|
||||
Echo "No optional package Ctags available for $(TARGET_ARCH)" ;
|
||||
}
|
||||
}
|
||||
|
||||
@ -996,9 +1021,7 @@ if [ IsOptionalHaikuImagePackageAdded Droid ] {
|
||||
|
||||
# Expat
|
||||
if [ IsOptionalHaikuImagePackageAdded Expat ] {
|
||||
if $(TARGET_ARCH) != x86 {
|
||||
Echo "No optional package Expat available for $(TARGET_ARCH)" ;
|
||||
} else {
|
||||
if $(TARGET_ARCH) = x86 {
|
||||
if $(HAIKU_GCC_VERSION[1]) >= 4 {
|
||||
InstallOptionalHaikuImagePackage
|
||||
expat-2.0.1-r1a4-x86-gcc4-2012-08-30.zip
|
||||
@ -1010,22 +1033,35 @@ if [ IsOptionalHaikuImagePackageAdded Expat ] {
|
||||
: $(baseURL)/expat-2.0.1-r1a4-x86-gcc2-2012-08-28.zip
|
||||
: : true ;
|
||||
}
|
||||
} else if $(TARGET_ARCH) = x86_64 {
|
||||
InstallOptionalHaikuImagePackage
|
||||
expat-2.0.1-x86_64-2012-12-08.zip
|
||||
: $(baseURL)/expat-2.0.1-x86_64-2012-12-08.zip
|
||||
: : true ;
|
||||
} else {
|
||||
Echo "No optional package Expat available for $(TARGET_ARCH)" ;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
# Fastdep
|
||||
if [ IsOptionalHaikuImagePackageAdded Fastdep ] {
|
||||
if $(TARGET_ARCH) != x86 {
|
||||
Echo "No optional package Fastdep available for $(TARGET_ARCH)" ;
|
||||
} else if $(HAIKU_GCC_VERSION[1]) >= 4 {
|
||||
if $(TARGET_ARCH) = x86 {
|
||||
if $(HAIKU_GCC_VERSION[1]) >= 4 {
|
||||
InstallOptionalHaikuImagePackage
|
||||
fastdep-0.16-r1a4-x86-gcc4-2012-08-30.zip
|
||||
: $(baseURL)/fastdep-0.16-r1a4-x86-gcc4-2012-08-30.zip ;
|
||||
} else {
|
||||
InstallOptionalHaikuImagePackage
|
||||
fastdep-0.16-r1a4-x86-gcc2-2012-08-28.zip
|
||||
: $(baseURL)/fastdep-0.16-r1a4-x86-gcc2-2012-08-28.zip ;
|
||||
}
|
||||
} else if $(TARGET_ARCH) = x86_64 {
|
||||
InstallOptionalHaikuImagePackage
|
||||
fastdep-0.16-r1a4-x86-gcc4-2012-08-30.zip
|
||||
: $(baseURL)/fastdep-0.16-r1a4-x86-gcc4-2012-08-30.zip ;
|
||||
fastdep-0.16-x86_64-2012-12-08.zip
|
||||
: $(baseURL)/fastdep-0.16-x86_64-2012-12-08.zip ;
|
||||
} else {
|
||||
InstallOptionalHaikuImagePackage
|
||||
fastdep-0.16-r1a4-x86-gcc2-2012-08-28.zip
|
||||
: $(baseURL)/fastdep-0.16-r1a4-x86-gcc2-2012-08-28.zip ;
|
||||
Echo "No optional package Fastdep available for $(TARGET_ARCH)" ;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1117,9 +1153,7 @@ if [ IsOptionalHaikuImagePackageAdded GitDoc ] {
|
||||
|
||||
# GPerf
|
||||
if [ IsOptionalHaikuImagePackageAdded GPerf ] {
|
||||
if $(TARGET_ARCH) != x86 {
|
||||
Echo "No optional package GPerf available for $(TARGET_ARCH)" ;
|
||||
} else {
|
||||
if $(TARGET_ARCH) = x86 {
|
||||
if $(HAIKU_GCC_VERSION[1]) >= 4 {
|
||||
InstallOptionalHaikuImagePackage
|
||||
gperf-3.0.4-r1a4-x86-gcc4-2012-08-30.zip
|
||||
@ -1131,15 +1165,20 @@ if [ IsOptionalHaikuImagePackageAdded GPerf ] {
|
||||
: $(baseURL)/gperf-3.0.4-r1a4-x86-gcc2-2012-08-28.zip
|
||||
: : true ;
|
||||
}
|
||||
} else if $(TARGET_ARCH) = x86_64 {
|
||||
InstallOptionalHaikuImagePackage
|
||||
gperf-3.0.4-x86_64-2012-12-08.zip
|
||||
: $(baseURL)/gperf-3.0.4-x86_64-2012-12-08.zip
|
||||
: : true ;
|
||||
} else {
|
||||
Echo "No optional package GPerf available for $(TARGET_ARCH)" ;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
# Groff
|
||||
if [ IsOptionalHaikuImagePackageAdded Groff ] {
|
||||
if $(TARGET_ARCH) != x86 {
|
||||
Echo "No optional package Groff available for $(TARGET_ARCH)" ;
|
||||
} else {
|
||||
if $(TARGET_ARCH) = x86 {
|
||||
if $(HAIKU_GCC_VERSION[1]) >= 4 {
|
||||
InstallOptionalHaikuImagePackage
|
||||
groff-1.20.1-r1a4-x86-gcc4-2012-08-30.zip
|
||||
@ -1151,6 +1190,13 @@ if [ IsOptionalHaikuImagePackageAdded Groff ] {
|
||||
: $(baseURL)/groff-1.20.1-r1a4-x86-gcc2-2012-08-28.zip
|
||||
: : true ;
|
||||
}
|
||||
} else if $(TARGET_ARCH) = x86_64 {
|
||||
InstallOptionalHaikuImagePackage
|
||||
groff-1.20.1-x86_64-2012-12-08.zip
|
||||
: $(baseURL)/groff-1.20.1-x86_64-2012-12-08.zip
|
||||
: : true ;
|
||||
} else {
|
||||
Echo "No optional package Groff available for $(TARGET_ARCH)" ;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1266,9 +1312,7 @@ if [ IsOptionalHaikuImagePackageAdded LGrep ] {
|
||||
|
||||
# LibEvent
|
||||
if [ IsOptionalHaikuImagePackageAdded LibEvent ] {
|
||||
if $(TARGET_ARCH) != x86 {
|
||||
Echo "No optional package LibEvent available for $(TARGET_ARCH)" ;
|
||||
} else {
|
||||
if $(TARGET_ARCH) = x86 {
|
||||
if $(HAIKU_GCC_VERSION[1]) >= 4 {
|
||||
InstallOptionalHaikuImagePackage
|
||||
libevent-2.0.10-r1a4-x86-gcc4-2012-08-30.zip
|
||||
@ -1280,6 +1324,13 @@ if [ IsOptionalHaikuImagePackageAdded LibEvent ] {
|
||||
: $(baseURL)/libevent-2.0.10-r1a4-x86-gcc2-2012-08-28.zip
|
||||
: : true ;
|
||||
}
|
||||
} else if $(TARGET_ARCH) = x86_64 {
|
||||
InstallOptionalHaikuImagePackage
|
||||
libevent-2.0.10-x86_64-2012-12-08.zip
|
||||
: $(baseURL)/libevent-2.0.10-x86_64-2012-12-08.zip
|
||||
: : true ;
|
||||
} else {
|
||||
Echo "No optional package LibEvent available for $(TARGET_ARCH)" ;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1334,9 +1385,7 @@ if [ IsOptionalHaikuImagePackageAdded Libmng ] {
|
||||
|
||||
# LibXML2
|
||||
if [ IsOptionalHaikuImagePackageAdded LibXML2 ] {
|
||||
if $(TARGET_ARCH) != x86 {
|
||||
Echo "No optional package LibXML2 available for $(TARGET_ARCH)" ;
|
||||
} else {
|
||||
if $(TARGET_ARCH) = x86 {
|
||||
if $(HAIKU_GCC_VERSION[1]) >= 4 {
|
||||
InstallOptionalHaikuImagePackage
|
||||
libxml2-2.8.0-r1a4-x86-gcc4-2012-08-28.zip
|
||||
@ -1346,6 +1395,12 @@ if [ IsOptionalHaikuImagePackageAdded LibXML2 ] {
|
||||
libxml2-2.8.0-r1a4-x86-gcc2-2012-08-30.zip
|
||||
: $(baseURL)/libxml2-2.8.0-r1a4-x86-gcc2-2012-08-30.zip ;
|
||||
}
|
||||
} else if $(TARGET_ARCH) = x86_64 {
|
||||
InstallOptionalHaikuImagePackage
|
||||
libxml2-2.8.0-x86_64-2012-12-08.zip
|
||||
: $(baseURL)/libxml2-2.8.0-x86_64-2012-12-08.zip ;
|
||||
} else {
|
||||
Echo "No optional package LibXML2 available for $(TARGET_ARCH)" ;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1622,23 +1677,29 @@ if [ IsOptionalHaikuImagePackageAdded OpenSSL ] {
|
||||
|
||||
# P7zip
|
||||
if [ IsOptionalHaikuImagePackageAdded P7zip ] {
|
||||
if $(TARGET_ARCH) != x86 {
|
||||
Echo "No optional package P7zip available for $(TARGET_ARCH)" ;
|
||||
} else {
|
||||
if $(HAIKU_GCC_VERSION[1]) >= 4 {
|
||||
if $(TARGET_ARCH) = x86 || $(TARGET_ARCH) = x86_64 {
|
||||
if $(TARGET_ARCH) = x86 {
|
||||
if $(HAIKU_GCC_VERSION[1]) >= 4 {
|
||||
InstallOptionalHaikuImagePackage
|
||||
p7zip-9.20.1-r1a4-x86-gcc4-2012-08-30.zip
|
||||
: $(baseURL)/p7zip-9.20.1-r1a4-x86-gcc4-2012-08-30.zip ;
|
||||
} else {
|
||||
InstallOptionalHaikuImagePackage
|
||||
p7zip-9.20.1-r1a4-x86-gcc2-2012-08-29.zip
|
||||
: $(baseURL)/p7zip-9.20.1-r1a4-x86-gcc2-2012-08-29.zip ;
|
||||
}
|
||||
} else if $(TARGET_ARCH) = x86_64 {
|
||||
InstallOptionalHaikuImagePackage
|
||||
p7zip-9.20.1-r1a4-x86-gcc4-2012-08-30.zip
|
||||
: $(baseURL)/p7zip-9.20.1-r1a4-x86-gcc4-2012-08-30.zip ;
|
||||
} else {
|
||||
InstallOptionalHaikuImagePackage
|
||||
p7zip-9.20.1-r1a4-x86-gcc2-2012-08-29.zip
|
||||
: $(baseURL)/p7zip-9.20.1-r1a4-x86-gcc2-2012-08-29.zip ;
|
||||
p7zip-9.20.1-x86_64-2012-12-08.zip
|
||||
: $(baseURL)/p7zip-9.20.1-x86_64-2012-12-08.zip ;
|
||||
}
|
||||
|
||||
AddExpanderRuleToHaikuImage "application/x-7z-compressed" : .7z
|
||||
: "7za l \\0045s"
|
||||
: "7za x -y \\0045s"
|
||||
;
|
||||
|
||||
} else {
|
||||
Echo "No optional package P7zip available for $(TARGET_ARCH)" ;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1832,9 +1893,7 @@ if [ IsOptionalHaikuImagePackageAdded Sed ] {
|
||||
|
||||
# SQLite
|
||||
if [ IsOptionalHaikuImagePackageAdded SQLite ] {
|
||||
if $(TARGET_ARCH) != x86 {
|
||||
Echo "No optional package SQLite available for $(TARGET_ARCH)" ;
|
||||
} else {
|
||||
if $(TARGET_ARCH) = x86 {
|
||||
if $(HAIKU_GCC_VERSION[1]) >= 4 {
|
||||
InstallOptionalHaikuImagePackage
|
||||
sqlite-3.7.13-r1a4-x86-gcc4-2012-08-30.zip
|
||||
@ -1844,6 +1903,12 @@ if [ IsOptionalHaikuImagePackageAdded SQLite ] {
|
||||
sqlite-3.7.13-r1a4-x86-gcc2-2012-08-27.zip
|
||||
: $(baseURL)/sqlite-3.7.13-r1a4-x86-gcc2-2012-08-27.zip ;
|
||||
}
|
||||
} else if $(TARGET_ARCH) = x86_64 {
|
||||
InstallOptionalHaikuImagePackage
|
||||
sqlite-3.7.13-x86_64-2012-12-08.zip
|
||||
: $(baseURL)/sqlite-3.7.13-x86_64-2012-12-08.zip ;
|
||||
} else {
|
||||
Echo "No optional package SQLite available for $(TARGET_ARCH)" ;
|
||||
}
|
||||
}
|
||||
|
||||
@ -2205,15 +2270,21 @@ if [ IsOptionalHaikuImagePackageAdded XZ-Utils ] {
|
||||
|
||||
# Yasm
|
||||
if [ IsOptionalHaikuImagePackageAdded Yasm ] {
|
||||
if $(TARGET_ARCH) != x86 {
|
||||
Echo "No optional package Yasm available for $(TARGET_ARCH)" ;
|
||||
} else if $(HAIKU_GCC_VERSION[1]) >= 4 {
|
||||
if $(TARGET_ARCH) = x86 {
|
||||
if $(HAIKU_GCC_VERSION[1]) >= 4 {
|
||||
InstallOptionalHaikuImagePackage
|
||||
yasm-1.2.0-r1a4-x86-gcc4-2012-08-29.zip
|
||||
: $(baseURL)/yasm-1.2.0-r1a4-x86-gcc4-2012-08-29.zip ;
|
||||
} else {
|
||||
InstallOptionalHaikuImagePackage
|
||||
yasm-1.2.0-r1a4-x86-gcc2-2012-08-27.zip
|
||||
: $(baseURL)/yasm-1.2.0-r1a4-x86-gcc2-2012-08-27.zip ;
|
||||
}
|
||||
} else if $(TARGET_ARCH) = x86_64 {
|
||||
InstallOptionalHaikuImagePackage
|
||||
yasm-1.2.0-r1a4-x86-gcc4-2012-08-29.zip
|
||||
: $(baseURL)/yasm-1.2.0-r1a4-x86-gcc4-2012-08-29.zip ;
|
||||
yasm-1.2.0-x86_64-2012-12-08.zip
|
||||
: $(baseURL)/yasm-1.2.0-x86_64-2012-12-08.zip ;
|
||||
} else {
|
||||
InstallOptionalHaikuImagePackage
|
||||
yasm-1.2.0-r1a4-x86-gcc2-2012-08-27.zip
|
||||
: $(baseURL)/yasm-1.2.0-r1a4-x86-gcc2-2012-08-27.zip ;
|
||||
Echo "No optional package Yasm available for $(TARGET_ARCH)" ;
|
||||
}
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
1 belarusian x-vnd.Haiku-Expander 2398100010
|
||||
1 belarusian x-vnd.Haiku-Expander 282517174
|
||||
Expand ExpanderMenu Распакаваць
|
||||
Close window when done expanding ExpanderPreferences Закрыць вакно пасля распакоўкі
|
||||
Set destination… ExpanderMenu Задаць прызначэнне…
|
||||
@ -17,7 +17,6 @@ Automatically expand files ExpanderPreferences Распакоўваць фай
|
||||
Creating listing for '%s' ExpanderWindow Стварэнне спіса для '%s'
|
||||
Continue ExpanderWindow Працягваць
|
||||
Destination folder ExpanderPreferences Тэчка прызначэння
|
||||
The destination folder does not exist. ExpanderWindow Тэчка прызначэння не існуе.
|
||||
Other ExpanderPreferences Іншы
|
||||
Cancel ExpanderPreferences Адмена
|
||||
Expansion ExpanderPreferences Пашырэньне
|
||||
|
@ -1,4 +1,4 @@
|
||||
1 german x-vnd.Haiku-Expander 2398100010
|
||||
1 german x-vnd.Haiku-Expander 282517174
|
||||
Expand ExpanderMenu Entpacken
|
||||
Close window when done expanding ExpanderPreferences Fenster nach dem Entpacken schließen
|
||||
Set destination… ExpanderMenu Ziel wählen…
|
||||
@ -17,7 +17,6 @@ Automatically expand files ExpanderPreferences Archiv automatisch entpacken
|
||||
Creating listing for '%s' ExpanderWindow Dateiliste für '%s' wird erstellt
|
||||
Continue ExpanderWindow Fortsetzen
|
||||
Destination folder ExpanderPreferences Zielordner
|
||||
The destination folder does not exist. ExpanderWindow Der Zielordner existiert nicht.
|
||||
Other ExpanderPreferences Allgemeines
|
||||
Cancel ExpanderPreferences Abbrechen
|
||||
Expansion ExpanderPreferences Entpacken
|
||||
|
@ -1,4 +1,4 @@
|
||||
1 greek, modern (1453-) x-vnd.Haiku-Expander 386826896
|
||||
1 greek, modern (1453-) x-vnd.Haiku-Expander 2566211356
|
||||
Expand ExpanderMenu Επέκταση
|
||||
Close window when done expanding ExpanderPreferences Κλείσιμο παραθύρου μετά το πέρας
|
||||
Set destination… ExpanderMenu Ορισμός προορισμού...
|
||||
@ -15,7 +15,6 @@ Cancel ExpanderWindow Άκυρο
|
||||
Automatically expand files ExpanderPreferences Αυτόματη επέκταση αρχείων
|
||||
Creating listing for '%s' ExpanderWindow Δημιούργησε την καταχώρηση για '%s'
|
||||
Continue ExpanderWindow Συνέχεια
|
||||
The destination folder does not exist. ExpanderWindow Ο φάκελος προορισμού δεν υπάρχει.
|
||||
Cancel ExpanderPreferences Άκυρο
|
||||
Are you sure you want to stop expanding this\narchive? The expanded items may not be complete. ExpanderWindow Είστε σίγουρος ότι θέλετε να σταματήσετε την επέκταση αυτού του \nαρχείου; Τα επεκταμένα στοιχεία μπορεί να μην είναι ολοκληρωμένα.
|
||||
Select DirectoryFilePanel Επιλογή
|
||||
|
@ -1,4 +1,4 @@
|
||||
1 finnish x-vnd.Haiku-Expander 2398100010
|
||||
1 finnish x-vnd.Haiku-Expander 282517174
|
||||
Expand ExpanderMenu Laajenna
|
||||
Close window when done expanding ExpanderPreferences Sulje ikkuna kun laajentaminen on tehty
|
||||
Set destination… ExpanderMenu Aseta kohde…
|
||||
@ -17,7 +17,6 @@ Automatically expand files ExpanderPreferences Laajenna tiedostot automaattises
|
||||
Creating listing for '%s' ExpanderWindow Luodaan luettelo kohteelle ’%s’
|
||||
Continue ExpanderWindow Jatka
|
||||
Destination folder ExpanderPreferences Kohdekansio
|
||||
The destination folder does not exist. ExpanderWindow Kohdekansiota ei ole olemassa.
|
||||
Other ExpanderPreferences Muut
|
||||
Cancel ExpanderPreferences Peru
|
||||
Expansion ExpanderPreferences Laajentaminen
|
||||
|
@ -1,4 +1,4 @@
|
||||
1 french x-vnd.Haiku-Expander 2398100010
|
||||
1 french x-vnd.Haiku-Expander 282517174
|
||||
Expand ExpanderMenu Décompresser
|
||||
Close window when done expanding ExpanderPreferences Fermer la fenêtre après l'extraction
|
||||
Set destination… ExpanderMenu Choisir la destination…
|
||||
@ -17,7 +17,6 @@ Automatically expand files ExpanderPreferences Décompresser les fichiers autom
|
||||
Creating listing for '%s' ExpanderWindow Créer un inventaire pour « %s »
|
||||
Continue ExpanderWindow Continuer
|
||||
Destination folder ExpanderPreferences Dossier de destination
|
||||
The destination folder does not exist. ExpanderWindow Le dossier de destination n'existe pas.
|
||||
Other ExpanderPreferences Autre
|
||||
Cancel ExpanderPreferences Annuler
|
||||
Expansion ExpanderPreferences Décompression
|
||||
|
@ -1,4 +1,4 @@
|
||||
1 hindi x-vnd.Haiku-Expander 386826896
|
||||
1 hindi x-vnd.Haiku-Expander 2566211356
|
||||
Expand ExpanderMenu विस्तार
|
||||
Close window when done expanding ExpanderPreferences विस्तार करने के बाद विंडो बंद करें
|
||||
Set destination… ExpanderMenu गंतव्य सेट कीजिए...
|
||||
@ -15,7 +15,6 @@ Cancel ExpanderWindow रद्द
|
||||
Automatically expand files ExpanderPreferences अपने आप फाइलें विस्तार करें
|
||||
Creating listing for '%s' ExpanderWindow '%s' के लिए सूचीकरण बना रहा है
|
||||
Continue ExpanderWindow जारी रखें
|
||||
The destination folder does not exist. ExpanderWindow गंतव्य फ़ोल्डर मौजूद नहीं है.
|
||||
Cancel ExpanderPreferences रद्द करे
|
||||
Are you sure you want to stop expanding this\narchive? The expanded items may not be complete. ExpanderWindow आप सुनिश्चित हैं कि आप इस आरकाइव के विस्तार को बंद करना चाहते हैं?\nविस्तारित आइटम सम्भव्तीय पूरे नहीं हो
|
||||
Select DirectoryFilePanel चुनें
|
||||
|
@ -1,4 +1,4 @@
|
||||
1 hungarian x-vnd.Haiku-Expander 2398100010
|
||||
1 hungarian x-vnd.Haiku-Expander 2603318510
|
||||
Expand ExpanderMenu Kicsomagol
|
||||
Close window when done expanding ExpanderPreferences A kicsomagolás végeztével zárja be az ablakot
|
||||
Set destination… ExpanderMenu Célmappa megadása…
|
||||
@ -17,12 +17,12 @@ Automatically expand files ExpanderPreferences Fájlok automatikus kicsomagolá
|
||||
Creating listing for '%s' ExpanderWindow '%s' lista létrehozása
|
||||
Continue ExpanderWindow Folytatás
|
||||
Destination folder ExpanderPreferences Célmappa
|
||||
The destination folder does not exist. ExpanderWindow A célmappa nem létezik.
|
||||
Other ExpanderPreferences Egyéb
|
||||
Cancel ExpanderPreferences Mégse
|
||||
Expansion ExpanderPreferences Kicsomagolás
|
||||
Are you sure you want to stop expanding this\narchive? The expanded items may not be complete. ExpanderWindow Biztosan le szeretné állítani?\nA kicsomagolás még nem fejeződött be.
|
||||
Select DirectoryFilePanel Kiválaszt
|
||||
Destination folder doesn't exist. Would you like to create it? ExpanderWindow A célmappa nem létezik. Létre szeretné hozni?
|
||||
Same directory as source (archive) file ExpanderPreferences A mappa amiben a forrásfájl (archívum) van
|
||||
Expanding '%s' ExpanderWindow '%s' kicsomagolása
|
||||
Settings ExpanderMenu Beállítások
|
||||
@ -33,6 +33,8 @@ Show contents ExpanderWindow Tartalom megjelenítése
|
||||
Automatically show contents listing ExpanderPreferences Tartalom listázása automatikusan
|
||||
OK ExpanderPreferences Rendben
|
||||
Leave destination folder path empty ExpanderPreferences Hagyja üresen a célmappa útvonalát
|
||||
Failed to create the destination folder. ExpanderWindow Nem sikerült létrehozni a célmappát.
|
||||
Create ExpanderWindow Létrehozás
|
||||
The folder was either moved, renamed or not\nsupported. ExpanderWindow A mappa el lett mozgatva, át lett nevezve vagy nem\ntámogatott.
|
||||
The file doesn't exist ExpanderWindow A fájl nem létezik
|
||||
Stop ExpanderMenu Leállítás
|
||||
|
@ -1,4 +1,4 @@
|
||||
1 japanese x-vnd.Haiku-Expander 2398100010
|
||||
1 japanese x-vnd.Haiku-Expander 282517174
|
||||
Expand ExpanderMenu 解凍
|
||||
Close window when done expanding ExpanderPreferences 解凍終了後ウィンドウを閉じる
|
||||
Set destination… ExpanderMenu 解凍先を指定…
|
||||
@ -17,7 +17,6 @@ Automatically expand files ExpanderPreferences 自動的にファイルを解
|
||||
Creating listing for '%s' ExpanderWindow '%s' のリストを作成中
|
||||
Continue ExpanderWindow 続ける
|
||||
Destination folder ExpanderPreferences 解凍先フォルダー
|
||||
The destination folder does not exist. ExpanderWindow 解凍先フォルダーは存在しません。
|
||||
Other ExpanderPreferences その他
|
||||
Cancel ExpanderPreferences キャンセル
|
||||
Expansion ExpanderPreferences 解凍
|
||||
|
@ -1,4 +1,4 @@
|
||||
1 lithuanian x-vnd.Haiku-Expander 2398100010
|
||||
1 lithuanian x-vnd.Haiku-Expander 282517174
|
||||
Expand ExpanderMenu Išskleisti
|
||||
Close window when done expanding ExpanderPreferences Viską išskleidus, užverti langą
|
||||
Set destination… ExpanderMenu Paskirties vieta…
|
||||
@ -17,7 +17,6 @@ Automatically expand files ExpanderPreferences Automatiškai išskleisti failus
|
||||
Creating listing for '%s' ExpanderWindow Generuojamas „%s“ turinio sąrašas
|
||||
Continue ExpanderWindow Tęsti
|
||||
Destination folder ExpanderPreferences Paskirties aplankas
|
||||
The destination folder does not exist. ExpanderWindow Paskirties aplankas neegzistuoja.
|
||||
Other ExpanderPreferences Kita
|
||||
Cancel ExpanderPreferences Atsisakyti
|
||||
Expansion ExpanderPreferences Išskleidimas
|
||||
|
@ -1,4 +1,4 @@
|
||||
1 dutch; flemish x-vnd.Haiku-Expander 2398100010
|
||||
1 dutch; flemish x-vnd.Haiku-Expander 282517174
|
||||
Expand ExpanderMenu Uitpakken
|
||||
Close window when done expanding ExpanderPreferences Sluit dit venster wanneer het uitpakken klaar is
|
||||
Set destination… ExpanderMenu Bepaal doel…
|
||||
@ -17,7 +17,6 @@ Automatically expand files ExpanderPreferences Bestanden automatisch uitpakken
|
||||
Creating listing for '%s' ExpanderWindow Creëren van een overzicht voor '%s'
|
||||
Continue ExpanderWindow Doorgaan
|
||||
Destination folder ExpanderPreferences Doelmap
|
||||
The destination folder does not exist. ExpanderWindow De doelmap bestaat niet.
|
||||
Other ExpanderPreferences Andere
|
||||
Cancel ExpanderPreferences Annuleren
|
||||
Expansion ExpanderPreferences Uitpakken
|
||||
|
@ -1,4 +1,4 @@
|
||||
1 polish x-vnd.Haiku-Expander 2398100010
|
||||
1 polish x-vnd.Haiku-Expander 282517174
|
||||
Expand ExpanderMenu Rozpakuj
|
||||
Close window when done expanding ExpanderPreferences Zamknij okno po zakończeniu rozpakowywania
|
||||
Set destination… ExpanderMenu Wybierz miejsce docelowe…
|
||||
@ -17,7 +17,6 @@ Automatically expand files ExpanderPreferences Automatycznie rozpakuj pliki
|
||||
Creating listing for '%s' ExpanderWindow Tworzenie listy dla '%s'
|
||||
Continue ExpanderWindow Kontynuuj
|
||||
Destination folder ExpanderPreferences Katalog docelowy
|
||||
The destination folder does not exist. ExpanderWindow Folder docelowy nie istnieje.
|
||||
Other ExpanderPreferences Inne
|
||||
Cancel ExpanderPreferences Anuluj
|
||||
Expansion ExpanderPreferences Rozpakowywanie
|
||||
|
@ -1,4 +1,4 @@
|
||||
1 portuguese (brazil) x-vnd.Haiku-Expander 2398100010
|
||||
1 portuguese (brazil) x-vnd.Haiku-Expander 282517174
|
||||
Expand ExpanderMenu Expandir
|
||||
Close window when done expanding ExpanderPreferences Fechar a janela quando concluída a expansão
|
||||
Set destination… ExpanderMenu Selecionar destino…
|
||||
@ -17,7 +17,6 @@ Automatically expand files ExpanderPreferences Expandir arquivos automaticament
|
||||
Creating listing for '%s' ExpanderWindow Criando lista para '%s'
|
||||
Continue ExpanderWindow Continuar
|
||||
Destination folder ExpanderPreferences Pasta de destino
|
||||
The destination folder does not exist. ExpanderWindow A pasta de destino não existe.
|
||||
Other ExpanderPreferences Outro
|
||||
Cancel ExpanderPreferences Cancelar
|
||||
Expansion ExpanderPreferences Expansão
|
||||
|
@ -1,4 +1,4 @@
|
||||
1 romanian x-vnd.Haiku-Expander 386826896
|
||||
1 romanian x-vnd.Haiku-Expander 2566211356
|
||||
Expand ExpanderMenu Extinde
|
||||
Close window when done expanding ExpanderPreferences Închide fereastra atunci când s-a încheiat extinderea
|
||||
Set destination… ExpanderMenu Setează destinația…
|
||||
@ -15,7 +15,6 @@ Cancel ExpanderWindow Renunță
|
||||
Automatically expand files ExpanderPreferences Extinde fișiere automat
|
||||
Creating listing for '%s' ExpanderWindow Se creează enumerarea pentru „%s”
|
||||
Continue ExpanderWindow Continuă
|
||||
The destination folder does not exist. ExpanderWindow Dosarul destinație nu există.
|
||||
Cancel ExpanderPreferences Anulează
|
||||
Are you sure you want to stop expanding this\narchive? The expanded items may not be complete. ExpanderWindow Ești sigur că vrei să oprești extinderea\nacestei arhive? Elementele dezarhivate pot fi incomplete.
|
||||
Select DirectoryFilePanel Selectează
|
||||
|
@ -1,4 +1,4 @@
|
||||
1 russian x-vnd.Haiku-Expander 2398100010
|
||||
1 russian x-vnd.Haiku-Expander 282517174
|
||||
Expand ExpanderMenu Распаковать
|
||||
Close window when done expanding ExpanderPreferences Закрывать окно после распаковки
|
||||
Set destination… ExpanderMenu Путь назначения для извлечения…
|
||||
@ -17,7 +17,6 @@ Automatically expand files ExpanderPreferences Автоматически ра
|
||||
Creating listing for '%s' ExpanderWindow Создается список файлов для '%s'
|
||||
Continue ExpanderWindow Продолжить
|
||||
Destination folder ExpanderPreferences Путь для извлечения
|
||||
The destination folder does not exist. ExpanderWindow Папка назначения не существует.
|
||||
Other ExpanderPreferences Другое
|
||||
Cancel ExpanderPreferences Отмена
|
||||
Expansion ExpanderPreferences Извлечение
|
||||
|
@ -1,4 +1,4 @@
|
||||
1 slovak x-vnd.Haiku-Expander 2398100010
|
||||
1 slovak x-vnd.Haiku-Expander 282517174
|
||||
Expand ExpanderMenu Rozbaliť
|
||||
Close window when done expanding ExpanderPreferences Zatvoriť okno po dokončení rozbaľovania
|
||||
Set destination… ExpanderMenu Nastaviť cieľ…
|
||||
@ -17,7 +17,6 @@ Automatically expand files ExpanderPreferences Automaticky rozbaľovať súbory
|
||||
Creating listing for '%s' ExpanderWindow Vytvára sa zoznam pre „%s“
|
||||
Continue ExpanderWindow Pokračovať
|
||||
Destination folder ExpanderPreferences Cieľový priečinok
|
||||
The destination folder does not exist. ExpanderWindow Cieľový priečinok neexistuje.
|
||||
Other ExpanderPreferences Ďalšie
|
||||
Cancel ExpanderPreferences Zrušiť
|
||||
Expansion ExpanderPreferences Rozpínanie
|
||||
|
@ -1,4 +1,4 @@
|
||||
1 swedish x-vnd.Haiku-Expander 2398100010
|
||||
1 swedish x-vnd.Haiku-Expander 282517174
|
||||
Expand ExpanderMenu Expandera
|
||||
Close window when done expanding ExpanderPreferences Stäng fönstret när expandering är klar
|
||||
Set destination… ExpanderMenu Ange mål…
|
||||
@ -17,7 +17,6 @@ Automatically expand files ExpanderPreferences Expandera filer automatiskt
|
||||
Creating listing for '%s' ExpanderWindow Skapar innehållslista för '%s'
|
||||
Continue ExpanderWindow Fortsätt
|
||||
Destination folder ExpanderPreferences Målmapp
|
||||
The destination folder does not exist. ExpanderWindow Målmappen existerar inte.
|
||||
Other ExpanderPreferences Andra
|
||||
Cancel ExpanderPreferences Avbryt
|
||||
Expansion ExpanderPreferences Expansion
|
||||
|
@ -1,4 +1,4 @@
|
||||
1 ukrainian x-vnd.Haiku-Expander 386826896
|
||||
1 ukrainian x-vnd.Haiku-Expander 2566211356
|
||||
Expand ExpanderMenu Розпакувати
|
||||
Close window when done expanding ExpanderPreferences Закрити вікно після розпаковки
|
||||
Set destination… ExpanderMenu Встановити ціль…
|
||||
@ -15,7 +15,6 @@ Cancel ExpanderWindow Відмінити
|
||||
Automatically expand files ExpanderPreferences Автоматично розпакувати файли
|
||||
Creating listing for '%s' ExpanderWindow Створення списку для '%s'
|
||||
Continue ExpanderWindow Продовжити
|
||||
The destination folder does not exist. ExpanderWindow Цільова папка відсутня.
|
||||
Cancel ExpanderPreferences Відміна
|
||||
Are you sure you want to stop expanding this\narchive? The expanded items may not be complete. ExpanderWindow Ви впевнені, що хочете зупинити розпаковку цього архіва? Розпаковка елементів може бути неповною.
|
||||
Select DirectoryFilePanel Вибрати
|
||||
|
@ -1,4 +1,4 @@
|
||||
1 english x-vnd.Haiku-Expander 2398100010
|
||||
1 english x-vnd.Haiku-Expander 282517174
|
||||
Expand ExpanderMenu 解压缩
|
||||
Close window when done expanding ExpanderPreferences 完成解压后,关闭窗口。
|
||||
Set destination… ExpanderMenu 目标文件…
|
||||
@ -17,7 +17,6 @@ Automatically expand files ExpanderPreferences 自动解压文件
|
||||
Creating listing for '%s' ExpanderWindow 为 '%s' 创建列表
|
||||
Continue ExpanderWindow 继续
|
||||
Destination folder ExpanderPreferences 目标目录
|
||||
The destination folder does not exist. ExpanderWindow 目标文件夹不存在。
|
||||
Other ExpanderPreferences 其他
|
||||
Cancel ExpanderPreferences 取消
|
||||
Expansion ExpanderPreferences 展开
|
||||
|
@ -1,37 +1,37 @@
|
||||
1 hungarian x-vnd.Haiku-PowerStatus 3224068645
|
||||
Design capacity low warning: PowerStatus Figyelmeztetés alacsony tervezett kapacitásnál:
|
||||
Design capacity low warning: PowerStatus Figyelmeztetés alacsony tervezett kapacitásnál:
|
||||
Show percent PowerStatus Százalék megjelenítése
|
||||
Design capacity: PowerStatus Tervezett kapacitás:
|
||||
mW PowerStatus mW
|
||||
Type: PowerStatus Típus:
|
||||
Design capacity: PowerStatus Tervezett kapacitás:
|
||||
mW PowerStatus mW
|
||||
Type: PowerStatus Típus:
|
||||
non-rechargeable PowerStatus Nem újratölthető
|
||||
Empty battery slot PowerStatus Nincs akku behelyezve
|
||||
mV PowerStatus mV
|
||||
mV PowerStatus mV
|
||||
Run in window PowerStatus Futtatás ablakban
|
||||
PowerStatus System name Energiaállapot
|
||||
mWh PowerStatus mWh
|
||||
mWh PowerStatus mWh
|
||||
Battery info… PowerStatus Akku infó…
|
||||
Damaged battery PowerStatus Sérült akku
|
||||
Show time PowerStatus Idő kijelzése
|
||||
Last full charge: PowerStatus Utolsó teljes feltöltés:
|
||||
Last full charge: PowerStatus Utolsó teljes feltöltés:
|
||||
Battery unused PowerStatus Használatlan akku
|
||||
Extended battery info PowerStatus Bővebb akku információ
|
||||
mA PowerStatus mA
|
||||
Current rate: PowerStatus Jelenlegi gyakoriság:
|
||||
mA PowerStatus mA
|
||||
Current rate: PowerStatus Jelenlegi gyakoriság:
|
||||
discharging PowerStatus használatban
|
||||
Show text label PowerStatus Szöveges címke megjelenítése
|
||||
About… PowerStatus Névjegy…
|
||||
Model number: PowerStatus Típusszám:
|
||||
Model number: PowerStatus Típusszám:
|
||||
Install in Deskbar PowerStatus Telepítés az Asztalsávra
|
||||
mAh PowerStatus mAh
|
||||
Capacity: PowerStatus Kapacitás:
|
||||
mAh PowerStatus mAh
|
||||
Capacity: PowerStatus Kapacitás:
|
||||
Battery discharging PowerStatus Akku használatban
|
||||
Serial number: PowerStatus Szériaszám:
|
||||
Capacity granularity 1: PowerStatus Kapacitás granularitás 1:
|
||||
OEM info: PowerStatus OEM információk:
|
||||
Design voltage: PowerStatus Tervezett feszültség:
|
||||
Serial number: PowerStatus Szériaszám:
|
||||
Capacity granularity 1: PowerStatus Kapacitás granularitás 1:
|
||||
OEM info: PowerStatus OEM információk:
|
||||
Design voltage: PowerStatus Tervezett feszültség:
|
||||
Battery charging PowerStatus Akku töltődik
|
||||
Design capacity warning: PowerStatus Tervezett kapacitás figyelmeztetés:
|
||||
Design capacity warning: PowerStatus Tervezett kapacitás figyelmeztetés:
|
||||
Battery info PowerStatus Akku infó
|
||||
Quit PowerStatus Kilépés
|
||||
rechargeable PowerStatus újratölthető
|
||||
@ -39,6 +39,6 @@ charging PowerStatus töltődik
|
||||
You can run PowerStatus in a window or install it in the Deskbar. PowerStatus Futatthatja az Energiaállapotot egy ablakban, vagy az Asztalsávra telepítheti azt.
|
||||
Power status box PowerStatus Energiaállapot doboza
|
||||
Show status icon PowerStatus Állapotikon megjelenítése
|
||||
Capacity granularity 2: PowerStatus Kapacitás granularitás 2:
|
||||
Capacity granularity 2: PowerStatus Kapacitás granularitás 2:
|
||||
Technology: PowerStatus Technológia:
|
||||
no battery PowerStatus nincs akku
|
||||
|
@ -28,11 +28,11 @@
|
||||
</p>
|
||||
<p>
|
||||
It resides in the first first 1024 bytes of a BFS disk which usually refers to the
|
||||
first two sectors of the partition in question. Since the BFS super block is located
|
||||
first two sectors of the partition in question. Since the BFS superblock is located
|
||||
at byte offset 512, and about 170 bytes large, this section is already reserved,
|
||||
and thus cannot be used by the loader itself.<br>
|
||||
The MBR only loads the first sector of a partition into memory, so it has to load
|
||||
the super block (and the rest of its implementation) by itself.
|
||||
the superblock (and the rest of its implementation) by itself.
|
||||
</p>
|
||||
<p>
|
||||
The loader must be able to load the real boot loader from a certain path, and
|
||||
|
@ -900,6 +900,7 @@ status_t nv_general_powerup()
|
||||
break;
|
||||
case 0x029010de: /* Nvidia Geforce 7900 GTX */
|
||||
case 0x029110de: /* Nvidia Geforce 7900 GT */
|
||||
case 0x029210de: /* Nvidia Geforce 7900 GS */
|
||||
case 0x029310de: /* Nvidia Geforce 7900 GX2 */
|
||||
si->ps.card_type = G71;
|
||||
si->ps.card_arch = NV40A;
|
||||
|
@ -484,14 +484,30 @@ usb_disk_inquiry(device_lun *lun)
|
||||
return result;
|
||||
}
|
||||
|
||||
TRACE("peripherial_device_type 0x%02x\n", parameter.peripherial_device_type);
|
||||
TRACE("peripherial_qualifier 0x%02x\n", parameter.peripherial_qualifier);
|
||||
TRACE("removable_medium %s\n", parameter.removable_medium ? "yes" : "no");
|
||||
TRACE("peripherial_device_type 0x%02x\n",
|
||||
parameter.peripherial_device_type);
|
||||
TRACE("peripherial_qualifier 0x%02x\n",
|
||||
parameter.peripherial_qualifier);
|
||||
TRACE("removable_medium %s\n",
|
||||
parameter.removable_medium ? "yes" : "no");
|
||||
TRACE("version 0x%02x\n", parameter.version);
|
||||
TRACE("response_data_format 0x%02x\n", parameter.response_data_format);
|
||||
TRACE_ALWAYS("vendor_identification \"%.8s\"\n", parameter.vendor_identification);
|
||||
TRACE_ALWAYS("product_identification \"%.16s\"\n", parameter.product_identification);
|
||||
TRACE_ALWAYS("product_revision_level \"%.4s\"\n", parameter.product_revision_level);
|
||||
TRACE_ALWAYS("vendor_identification \"%.8s\"\n",
|
||||
parameter.vendor_identification);
|
||||
TRACE_ALWAYS("product_identification \"%.16s\"\n",
|
||||
parameter.product_identification);
|
||||
TRACE_ALWAYS("product_revision_level \"%.4s\"\n",
|
||||
parameter.product_revision_level);
|
||||
|
||||
memcpy(lun->vendor_name, parameter.vendor_identification,
|
||||
MIN(sizeof(lun->vendor_name), sizeof(parameter.vendor_identification)));
|
||||
memcpy(lun->product_name, parameter.product_identification,
|
||||
MIN(sizeof(lun->product_name),
|
||||
sizeof(parameter.product_identification)));
|
||||
memcpy(lun->product_revision, parameter.product_revision_level,
|
||||
MIN(sizeof(lun->product_revision),
|
||||
sizeof(parameter.product_revision_level)));
|
||||
|
||||
lun->device_type = parameter.peripherial_device_type; /* 1:1 mapping */
|
||||
lun->removable = (parameter.removable_medium == 1);
|
||||
return B_OK;
|
||||
@ -992,6 +1008,27 @@ usb_disk_free(void *cookie)
|
||||
}
|
||||
|
||||
|
||||
static inline void
|
||||
normalize_name(char *name, size_t nameLength)
|
||||
{
|
||||
bool wasSpace = false;
|
||||
size_t insertIndex = 0;
|
||||
for (size_t i = 0; i < nameLength; i++) {
|
||||
bool isSpace = name[i] == ' ';
|
||||
if (isSpace && wasSpace)
|
||||
continue;
|
||||
|
||||
name[insertIndex++] = name[i];
|
||||
wasSpace = isSpace;
|
||||
}
|
||||
|
||||
if (insertIndex > 0 && name[insertIndex - 1] == ' ')
|
||||
insertIndex--;
|
||||
|
||||
name[insertIndex] = 0;
|
||||
}
|
||||
|
||||
|
||||
static status_t
|
||||
usb_disk_ioctl(void *cookie, uint32 op, void *buffer, size_t length)
|
||||
{
|
||||
@ -1005,6 +1042,19 @@ usb_disk_ioctl(void *cookie, uint32 op, void *buffer, size_t length)
|
||||
|
||||
status_t result = B_DEV_INVALID_IOCTL;
|
||||
switch (op) {
|
||||
case B_GET_DEVICE_SIZE: {
|
||||
if (lun->media_changed) {
|
||||
result = usb_disk_update_capacity(lun);
|
||||
if (result != B_OK)
|
||||
break;
|
||||
}
|
||||
|
||||
size_t size = lun->block_size * lun->block_count;
|
||||
result = user_memcpy(buffer, &size, sizeof(size));
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case B_GET_MEDIA_STATUS: {
|
||||
*(status_t *)buffer = usb_disk_test_unit_ready(lun);
|
||||
TRACE("B_GET_MEDIA_STATUS: 0x%08lx\n", *(status_t *)buffer);
|
||||
@ -1100,6 +1150,25 @@ usb_disk_ioctl(void *cookie, uint32 op, void *buffer, size_t length)
|
||||
result = user_memcpy(buffer, &iconData, sizeof(device_icon));
|
||||
break;
|
||||
}
|
||||
|
||||
case B_GET_DEVICE_NAME:
|
||||
{
|
||||
size_t nameLength = sizeof(lun->vendor_name)
|
||||
+ sizeof(lun->product_name) + sizeof(lun->product_revision) + 3;
|
||||
|
||||
char name[nameLength];
|
||||
snprintf(name, nameLength, "%.8s %.16s %.4s", lun->vendor_name,
|
||||
lun->product_name, lun->product_revision);
|
||||
|
||||
normalize_name(name, nameLength);
|
||||
|
||||
result = user_strlcpy((char *)buffer, name, length);
|
||||
if (result > 0)
|
||||
result = B_OK;
|
||||
|
||||
TRACE_ALWAYS("got device name: \"%s\" = %s\n", name, strerror(result));
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
|
||||
default:
|
||||
|
@ -78,6 +78,10 @@ struct device_lun_s {
|
||||
uint8 device_type;
|
||||
bool removable;
|
||||
bool write_protected;
|
||||
|
||||
char vendor_name[8];
|
||||
char product_name[16];
|
||||
char product_revision[4];
|
||||
};
|
||||
|
||||
|
||||
|
@ -256,6 +256,7 @@ static uint16 nvidia_device_list[] = {
|
||||
0x028c, /* Nvidia Quadro4 700 GoGL */
|
||||
0x0290, /* Nvidia Geforce 7900 GTX */
|
||||
0x0291, /* Nvidia Geforce 7900 GT */
|
||||
0x0292, /* Nvidia Geforce 7900 GS */
|
||||
0x0293, /* Nvidia Geforce 7900 GX2 */
|
||||
0x0294, /* Nvidia Geforce 7950 GX2 */
|
||||
0x0295, /* Nvidia Geforce 7950 GT */
|
||||
|
@ -597,7 +597,7 @@ BlockAllocator::InitializeAndClearBitmap(Transaction& transaction)
|
||||
memset(buffer, 0, numBits >> 3);
|
||||
|
||||
off_t offset = 1;
|
||||
// the bitmap starts directly after the super block
|
||||
// the bitmap starts directly after the superblock
|
||||
|
||||
// initialize the AllocationGroup objects and clear the on-disk bitmap
|
||||
|
||||
@ -926,7 +926,7 @@ BlockAllocator::AllocateBlocks(Transaction& transaction, int32 groupIndex,
|
||||
|
||||
fVolume->SuperBlock().used_blocks
|
||||
= HOST_ENDIAN_TO_BFS_INT64(fVolume->UsedBlocks() + bestLength);
|
||||
// We are not writing back the disk's super block - it's
|
||||
// We are not writing back the disk's superblock - it's
|
||||
// either done by the journaling code, or when the disk
|
||||
// is unmounted.
|
||||
// If the value is not correct at mount time, it will be
|
||||
|
@ -2556,7 +2556,7 @@ Inode::Remove(Transaction& transaction, const char* name, ino_t* _id,
|
||||
adds the created inode to that parent directory. If an attribute directory
|
||||
is created, it will also automatically be added to the \a parent inode as
|
||||
such. However, the indices root node, and the regular root node won't be
|
||||
added to the super block.
|
||||
added to the superblock.
|
||||
It will also create the initial B+tree for the inode if it's a directory
|
||||
of any kind.
|
||||
\a name may be \c NULL, but only if no \a parent is given.
|
||||
|
@ -499,10 +499,10 @@ Journal::_ReplayRunArray(int32* _start)
|
||||
// TODO: eventually check other well known offsets, like the
|
||||
// root and index dirs
|
||||
if (offset == 0) {
|
||||
// This log entry writes over the super block - check if
|
||||
// This log entry writes over the superblock - check if
|
||||
// it's valid!
|
||||
if (Volume::CheckSuperBlock(data) != B_OK) {
|
||||
FATAL(("Log contains invalid super block!\n"));
|
||||
FATAL(("Log contains invalid superblock!\n"));
|
||||
RETURN_ERROR(B_BAD_DATA);
|
||||
}
|
||||
}
|
||||
@ -663,7 +663,7 @@ Journal::_TransactionWritten(int32 transactionID, int32 event, void* _logEntry)
|
||||
|
||||
delete logEntry;
|
||||
|
||||
// update the super block, and change the disk's state, if necessary
|
||||
// update the superblock, and change the disk's state, if necessary
|
||||
|
||||
if (update) {
|
||||
if (superBlock.log_start == superBlock.log_end)
|
||||
@ -671,7 +671,7 @@ Journal::_TransactionWritten(int32 transactionID, int32 event, void* _logEntry)
|
||||
|
||||
status_t status = journal->fVolume->WriteSuperBlock();
|
||||
if (status != B_OK) {
|
||||
FATAL(("_TransactionWritten: could not write back super block: %s\n",
|
||||
FATAL(("_TransactionWritten: could not write back superblock: %s\n",
|
||||
strerror(status)));
|
||||
}
|
||||
|
||||
@ -864,7 +864,7 @@ Journal::_WriteTransactionToLog()
|
||||
logEntry->SetTransactionID(fTransactionID);
|
||||
#endif
|
||||
|
||||
// Update the log end pointer in the super block
|
||||
// Update the log end pointer in the superblock
|
||||
|
||||
fVolume->SuperBlock().flags = SUPER_BLOCK_DISK_DIRTY;
|
||||
fVolume->SuperBlock().log_end = HOST_ENDIAN_TO_BFS_INT64(logPosition);
|
||||
|
@ -4,7 +4,7 @@
|
||||
*/
|
||||
|
||||
|
||||
//! super block, mounting, etc.
|
||||
//! superblock, mounting, etc.
|
||||
|
||||
|
||||
#include "Attribute.h"
|
||||
@ -342,13 +342,13 @@ Volume::Mount(const char* deviceName, uint32 flags)
|
||||
if (opener.IsReadOnly())
|
||||
fFlags |= VOLUME_READ_ONLY;
|
||||
|
||||
// read the super block
|
||||
// read the superblock
|
||||
if (Identify(fDevice, &fSuperBlock) != B_OK) {
|
||||
FATAL(("invalid super block!\n"));
|
||||
FATAL(("invalid superblock!\n"));
|
||||
return B_BAD_VALUE;
|
||||
}
|
||||
|
||||
// initialize short hands to the super block (to save byte swapping)
|
||||
// initialize short hands to the superblock (to save byte swapping)
|
||||
fBlockSize = fSuperBlock.BlockSize();
|
||||
fBlockShift = fSuperBlock.BlockShift();
|
||||
fAllocationGroupShift = fSuperBlock.AllocationGroupShift();
|
||||
@ -633,7 +633,7 @@ Volume::CheckSuperBlock(const uint8* data, uint32* _offset)
|
||||
}
|
||||
|
||||
#ifndef BFS_LITTLE_ENDIAN_ONLY
|
||||
// For PPC, the super block might be located at offset 0
|
||||
// For PPC, the superblock might be located at offset 0
|
||||
superBlock = (disk_super_block*)data;
|
||||
if (superBlock->IsValid()) {
|
||||
if (_offset != NULL)
|
||||
@ -692,11 +692,11 @@ Volume::Initialize(int fd, const char* name, uint32 blockSize,
|
||||
|
||||
off_t numBlocks = deviceSize / blockSize;
|
||||
|
||||
// create valid super block
|
||||
// create valid superblock
|
||||
|
||||
fSuperBlock.Initialize(name, numBlocks, blockSize);
|
||||
|
||||
// initialize short hands to the super block (to save byte swapping)
|
||||
// initialize short hands to the superblock (to save byte swapping)
|
||||
fBlockSize = fSuperBlock.BlockSize();
|
||||
fBlockShift = fSuperBlock.BlockShift();
|
||||
fAllocationGroupShift = fSuperBlock.AllocationGroupShift();
|
||||
|
@ -5,7 +5,7 @@
|
||||
*/
|
||||
|
||||
|
||||
//! Super block, mounting, etc.
|
||||
//! Superblock, mounting, etc.
|
||||
|
||||
|
||||
#include "Volume.h"
|
||||
@ -270,7 +270,7 @@ Volume::Mount(const char* deviceName, uint32 flags)
|
||||
if (opener.IsReadOnly())
|
||||
fFlags |= VOLUME_READ_ONLY;
|
||||
|
||||
// read the super block
|
||||
// read the superblock
|
||||
status_t status = Identify(fDevice, &fSuperBlock);
|
||||
if (status != B_OK) {
|
||||
ERROR("Volume::Mount(): Identify() failed\n");
|
||||
@ -526,7 +526,7 @@ Volume::Identify(int fd, btrfs_super_block* superBlock)
|
||||
return B_IO_ERROR;
|
||||
|
||||
if (!superBlock->IsValid()) {
|
||||
ERROR("invalid super block!\n");
|
||||
ERROR("invalid superblock!\n");
|
||||
return B_BAD_VALUE;
|
||||
}
|
||||
|
||||
|
@ -5,7 +5,7 @@
|
||||
*/
|
||||
|
||||
|
||||
//! Super block, mounting, etc.
|
||||
//! Superblock, mounting, etc.
|
||||
|
||||
|
||||
#include "Volume.h"
|
||||
@ -310,7 +310,7 @@ Volume::Mount(const char* deviceName, uint32 flags)
|
||||
if (opener.IsReadOnly())
|
||||
fFlags |= VOLUME_READ_ONLY;
|
||||
|
||||
// read the super block
|
||||
// read the superblock
|
||||
status_t status = Identify(fDevice, &fSuperBlock);
|
||||
if (status != B_OK) {
|
||||
ERROR("Volume::Mount(): Identify() failed\n");
|
||||
@ -502,7 +502,7 @@ Volume::Identify(int fd, exfat_super_block* superBlock)
|
||||
return B_IO_ERROR;
|
||||
|
||||
if (!superBlock->IsValid()) {
|
||||
ERROR("invalid super block!\n");
|
||||
ERROR("invalid superblock!\n");
|
||||
return B_BAD_VALUE;
|
||||
}
|
||||
|
||||
|
@ -114,7 +114,7 @@ Journal::Journal(Volume* fsVolume, Volume* jVolume)
|
||||
fInitStatus = B_NO_MEMORY;
|
||||
else {
|
||||
fInitStatus = revokeManager->Init();
|
||||
|
||||
|
||||
if (fInitStatus == B_OK) {
|
||||
fRevokeManager = revokeManager;
|
||||
fInitStatus = _LoadSuperBlock();
|
||||
@ -270,7 +270,7 @@ Journal::Unlock(Transaction* owner, bool success)
|
||||
{
|
||||
TRACE("Journal::Unlock(): Lock recursion: %ld\n",
|
||||
recursive_lock_get_recursion(&fLock));
|
||||
if (fSeparateSubTransactions
|
||||
if (fSeparateSubTransactions
|
||||
|| recursive_lock_get_recursion(&fLock) == 1) {
|
||||
// we only end the transaction if we unlock it
|
||||
if (owner != NULL) {
|
||||
@ -309,7 +309,7 @@ Journal::MapBlock(off_t logical, fsblock_t& physical)
|
||||
{
|
||||
TRACE("Journal::MapBlock()\n");
|
||||
physical = logical;
|
||||
|
||||
|
||||
return B_OK;
|
||||
}
|
||||
|
||||
@ -340,7 +340,7 @@ Journal::TransactionID() const
|
||||
|
||||
|
||||
status_t
|
||||
Journal::_WritePartialTransactionToLog(JournalHeader* descriptorBlock,
|
||||
Journal::_WritePartialTransactionToLog(JournalHeader* descriptorBlock,
|
||||
bool detached, uint8** _escapedData, uint32 &logBlock, off_t& blockNumber,
|
||||
long& cookie, ArrayDeleter<uint8>& escapedDataDeleter, uint32& blockCount,
|
||||
bool& finished)
|
||||
@ -353,7 +353,7 @@ Journal::_WritePartialTransactionToLog(JournalHeader* descriptorBlock,
|
||||
JournalBlockTag* tag = (JournalBlockTag*)descriptorBlock->data;
|
||||
JournalBlockTag* lastTag = (JournalBlockTag*)((uint8*)descriptorBlock
|
||||
+ fBlockSize - sizeof(JournalHeader));
|
||||
|
||||
|
||||
finished = false;
|
||||
status_t status = B_OK;
|
||||
|
||||
@ -430,11 +430,11 @@ Journal::_WritePartialTransactionToLog(JournalHeader* descriptorBlock,
|
||||
}
|
||||
|
||||
finished = status != B_OK;
|
||||
|
||||
|
||||
// Write descriptor block
|
||||
--tag;
|
||||
tag->SetLastTagFlag();
|
||||
|
||||
|
||||
fsblock_t physicalBlock;
|
||||
status = MapBlock(descriptorBlockPos, physicalBlock);
|
||||
if (status != B_OK)
|
||||
@ -493,14 +493,14 @@ Journal::_WriteTransactionToLog()
|
||||
if (size > FreeLogBlocks()) {
|
||||
TRACE("Journal::_WriteTransactionToLog(): Syncing block cache\n");
|
||||
cache_sync_transaction(fFilesystemBlockCache, fTransactionID);
|
||||
|
||||
|
||||
if (size > FreeLogBlocks()) {
|
||||
panic("Transaction fits, but sync didn't result in enough"
|
||||
"free space.\n\tGot %ld when at least %ld was expected.",
|
||||
FreeLogBlocks(), size);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
TRACE("Journal::_WriteTransactionToLog(): finished managing space for "
|
||||
"the transaction\n");
|
||||
|
||||
@ -511,7 +511,7 @@ Journal::_WriteTransactionToLog()
|
||||
// Prepare Descriptor block
|
||||
TRACE("Journal::_WriteTransactionToLog(): attempting to allocate space for "
|
||||
"the descriptor block, block size %lu\n", fBlockSize);
|
||||
JournalHeader* descriptorBlock =
|
||||
JournalHeader* descriptorBlock =
|
||||
(JournalHeader*)new(std::nothrow) uint8[fBlockSize];
|
||||
if (descriptorBlock == NULL) {
|
||||
TRACE("Journal::_WriteTransactionToLog(): Failed to allocate a buffer "
|
||||
@ -525,7 +525,7 @@ Journal::_WriteTransactionToLog()
|
||||
// Prepare Commit block
|
||||
TRACE("Journal::_WriteTransactionToLog(): attempting to allocate space for "
|
||||
"the commit block, block size %lu\n", fBlockSize);
|
||||
JournalHeader* commitBlock =
|
||||
JournalHeader* commitBlock =
|
||||
(JournalHeader*)new(std::nothrow) uint8[fBlockSize];
|
||||
if (descriptorBlock == NULL) {
|
||||
TRACE("Journal::_WriteTransactionToLog(): Failed to allocate a buffer "
|
||||
@ -555,7 +555,7 @@ Journal::_WriteTransactionToLog()
|
||||
uint32 blockCount = 0;
|
||||
|
||||
uint32 logBlock = _WrapAroundLog(fLogEnd);
|
||||
|
||||
|
||||
bool finished = false;
|
||||
|
||||
status = _WritePartialTransactionToLog(descriptorBlock, detached,
|
||||
@ -574,10 +574,10 @@ Journal::_WriteTransactionToLog()
|
||||
blockCount, finished);
|
||||
if (!finished && status != B_OK)
|
||||
return status;
|
||||
|
||||
|
||||
// It is okay to write the commit blocks of the partial transactions
|
||||
// as long as the commit block of the first partial transaction isn't
|
||||
// written. When it recovery reaches where the first commit should be
|
||||
// written. When it recovery reaches where the first commit should be
|
||||
// and doesn't find it, it considers it found the end of the log.
|
||||
|
||||
fsblock_t physicalBlock;
|
||||
@ -586,7 +586,7 @@ Journal::_WriteTransactionToLog()
|
||||
return status;
|
||||
|
||||
off_t logOffset = physicalBlock * fBlockSize;
|
||||
|
||||
|
||||
TRACE("Journal::_WriteTransactionToLog(): Writting commit block to "
|
||||
"%lld\n", logOffset);
|
||||
off_t written = write_pos(fJournalVolume->Device(), logOffset,
|
||||
@ -598,7 +598,7 @@ Journal::_WriteTransactionToLog()
|
||||
|
||||
commitBlock->IncrementSequence();
|
||||
blockCount++;
|
||||
|
||||
|
||||
logBlock = _WrapAroundLog(logBlock + 1);
|
||||
}
|
||||
|
||||
@ -617,7 +617,7 @@ Journal::_WriteTransactionToLog()
|
||||
TRACE("Failed to write journal commit block.\n");
|
||||
return B_IO_ERROR;
|
||||
}
|
||||
|
||||
|
||||
blockCount++;
|
||||
fLogEnd = _WrapAroundLog(fLogEnd + blockCount);
|
||||
|
||||
@ -670,7 +670,7 @@ Journal::_SaveSuperBlock()
|
||||
off_t superblockPos = physicalBlock * fBlockSize;
|
||||
|
||||
JournalSuperBlock superblock;
|
||||
size_t bytesRead = read_pos(fJournalVolume->Device(), superblockPos,
|
||||
size_t bytesRead = read_pos(fJournalVolume->Device(), superblockPos,
|
||||
&superblock, sizeof(superblock));
|
||||
|
||||
if (bytesRead != sizeof(superblock))
|
||||
@ -678,7 +678,7 @@ Journal::_SaveSuperBlock()
|
||||
|
||||
superblock.SetFirstCommitID(fFirstCommitID);
|
||||
superblock.SetLogStart(fLogStart);
|
||||
|
||||
|
||||
TRACE("Journal::SaveSuperBlock(): Write to %lld\n", superblockPos);
|
||||
size_t bytesWritten = write_pos(fJournalVolume->Device(), superblockPos,
|
||||
&superblock, sizeof(superblock));
|
||||
@ -701,10 +701,10 @@ Journal::_LoadSuperBlock()
|
||||
status_t status = MapBlock(0, superblockPos);
|
||||
if (status != B_OK)
|
||||
return status;
|
||||
|
||||
TRACE("Journal::_LoadSuperBlock(): super block physical block: %llu\n",
|
||||
|
||||
TRACE("Journal::_LoadSuperBlock(): superblock physical block: %llu\n",
|
||||
superblockPos);
|
||||
|
||||
|
||||
JournalSuperBlock superblock;
|
||||
size_t bytesRead = read_pos(fJournalVolume->Device(), superblockPos
|
||||
* fJournalVolume->BlockSize(), &superblock, sizeof(superblock));
|
||||
@ -803,7 +803,7 @@ Journal::_CountTags(JournalHeader* descriptorBlock)
|
||||
|
||||
if ((tags->Flags() & JOURNAL_FLAG_LAST_TAG) != 0)
|
||||
count++;
|
||||
|
||||
|
||||
TRACE("Journal::_CountTags(): counted tags: %lu\n", count);
|
||||
|
||||
return count;
|
||||
@ -824,7 +824,7 @@ Journal::Recover()
|
||||
status_t status = _RecoverPassScan(lastCommitID);
|
||||
if (status != B_OK)
|
||||
return status;
|
||||
|
||||
|
||||
status = _RecoverPassRevoke(lastCommitID);
|
||||
if (status != B_OK)
|
||||
return status;
|
||||
@ -978,7 +978,7 @@ Journal::_RecoverPassReplay(uint32 lastCommitID)
|
||||
"data\n");
|
||||
return B_NO_MEMORY;
|
||||
}
|
||||
|
||||
|
||||
ArrayDeleter<uint8> dataDeleter(data);
|
||||
|
||||
while (nextCommitID < lastCommitID) {
|
||||
@ -994,7 +994,7 @@ Journal::_RecoverPassReplay(uint32 lastCommitID)
|
||||
JournalBlockTag* last_tag = (JournalBlockTag*)((uint8*)header
|
||||
+ fBlockSize - sizeof(JournalBlockTag));
|
||||
|
||||
for (JournalBlockTag* tag = (JournalBlockTag*)header->data;
|
||||
for (JournalBlockTag* tag = (JournalBlockTag*)header->data;
|
||||
tag <= last_tag; ++tag) {
|
||||
nextBlock = _WrapAroundLog(nextBlock + 1);
|
||||
|
||||
@ -1002,7 +1002,7 @@ Journal::_RecoverPassReplay(uint32 lastCommitID)
|
||||
if (status != B_OK)
|
||||
return status;
|
||||
|
||||
if (!fRevokeManager->Lookup(tag->BlockNumber(),
|
||||
if (!fRevokeManager->Lookup(tag->BlockNumber(),
|
||||
nextCommitID)) {
|
||||
// Block isn't revoked
|
||||
size_t read = read_pos(fJournalVolume->Device(),
|
||||
@ -1111,7 +1111,7 @@ Journal::_FlushLog(bool canWait, bool flushBlocks)
|
||||
TRACE("Journal::_FlushLog(): Finished. Releasing lock\n");
|
||||
|
||||
recursive_lock_unlock(&fLock);
|
||||
|
||||
|
||||
TRACE("Journal::_FlushLog(): Done, final status: %s\n", strerror(status));
|
||||
return status;
|
||||
}
|
||||
@ -1160,9 +1160,9 @@ Journal::_FullTransactionSize() const
|
||||
|
||||
size_t count = cache_blocks_in_transaction(fFilesystemBlockCache,
|
||||
fTransactionID);
|
||||
|
||||
|
||||
TRACE("\tFull transaction size: %ld\n", count);
|
||||
|
||||
|
||||
return count;
|
||||
}
|
||||
|
||||
@ -1174,9 +1174,9 @@ Journal::_MainTransactionSize() const
|
||||
|
||||
size_t count = cache_blocks_in_main_transaction(fFilesystemBlockCache,
|
||||
fTransactionID);
|
||||
|
||||
|
||||
TRACE("\tMain transaction size: %ld\n", count);
|
||||
|
||||
|
||||
return count;
|
||||
}
|
||||
|
||||
@ -1200,7 +1200,7 @@ Journal::_TransactionDone(bool success)
|
||||
TRACE("Journal::_TransactionDone(): returning B_OK\n");
|
||||
return B_OK;
|
||||
}
|
||||
|
||||
|
||||
// If possible, delay flushing the transaction
|
||||
uint32 size = _FullTransactionSize();
|
||||
TRACE("Journal::_TransactionDone(): full transaction size: %lu, max "
|
||||
@ -1209,11 +1209,11 @@ Journal::_TransactionDone(bool success)
|
||||
if (fMaxTransactionSize > 0 && size < fMaxTransactionSize) {
|
||||
TRACE("Journal::_TransactionDone(): delaying flush of transaction "
|
||||
"%ld\n", fTransactionID);
|
||||
|
||||
|
||||
// Make sure the transaction fits in the log
|
||||
if (size < FreeLogBlocks())
|
||||
cache_sync_transaction(fFilesystemBlockCache, fTransactionID);
|
||||
|
||||
|
||||
fUnwrittenTransactions++;
|
||||
TRACE("Journal::_TransactionDone(): returning B_OK\n");
|
||||
return B_OK;
|
||||
@ -1253,7 +1253,7 @@ Journal::_TransactionWritten(int32 transactionID, int32 event, void* _logEntry)
|
||||
if (journal->_SaveSuperBlock() != B_OK)
|
||||
panic("ext2: Failed to write journal superblock\n");
|
||||
}
|
||||
|
||||
|
||||
TRACE("Journal::_TransactionWritten(): Removing log entry\n");
|
||||
journal->fLogEntries.Remove(logEntry);
|
||||
|
||||
|
@ -5,7 +5,7 @@
|
||||
*/
|
||||
|
||||
|
||||
//! Super block, mounting, etc.
|
||||
//! Superblock, mounting, etc.
|
||||
|
||||
|
||||
#include "Volume.h"
|
||||
@ -300,7 +300,7 @@ Volume::Mount(const char* deviceName, uint32 flags)
|
||||
fSuperBlock.CompatibleFeatures(), fSuperBlock.IncompatibleFeatures(),
|
||||
fSuperBlock.ReadOnlyFeatures());
|
||||
|
||||
// read the super block
|
||||
// read the superblock
|
||||
status_t status = Identify(fDevice, &fSuperBlock);
|
||||
if (status != B_OK) {
|
||||
FATAL("Volume::Mount(): Identify() failed\n");
|
||||
@ -311,7 +311,7 @@ Volume::Mount(const char* deviceName, uint32 flags)
|
||||
if (!IsReadOnly() && _UnsupportedReadOnlyFeatures(fSuperBlock) != 0)
|
||||
return B_UNSUPPORTED;
|
||||
|
||||
// initialize short hands to the super block (to save byte swapping)
|
||||
// initialize short hands to the superblock (to save byte swapping)
|
||||
fBlockShift = fSuperBlock.BlockShift();
|
||||
if (fBlockShift < 10 || fBlockShift > 16)
|
||||
return B_ERROR;
|
||||
@ -930,7 +930,7 @@ Volume::Identify(int fd, ext2_super_block* superBlock)
|
||||
return B_IO_ERROR;
|
||||
|
||||
if (!superBlock->IsValid()) {
|
||||
FATAL("invalid super block!\n");
|
||||
FATAL("invalid superblock!\n");
|
||||
return B_BAD_VALUE;
|
||||
}
|
||||
|
||||
|
@ -30,12 +30,12 @@ using std::nothrow;
|
||||
|
||||
/*!
|
||||
\class DirEntry
|
||||
\brief Represents the on-disk structure for super block of the FS.
|
||||
\brief Represents the on-disk structure for superblock of the FS.
|
||||
|
||||
There exist two versions of the structure and this class can deal with both
|
||||
of them. This class can also handle a very old layout that puts the super
|
||||
block in a different location. The Init() methods tries to find and read
|
||||
the super block from disk.
|
||||
the superblock from disk.
|
||||
*/
|
||||
|
||||
// read_super_block
|
||||
@ -47,13 +47,13 @@ read_super_block(int device, off_t offset, const char *magic,
|
||||
{
|
||||
super_block_t *superBlock = NULL;
|
||||
status_t error = B_OK;
|
||||
// allocate memory for the super block
|
||||
// allocate memory for the superblock
|
||||
if (error == B_OK) {
|
||||
superBlock = new(nothrow) super_block_t;
|
||||
if (!superBlock)
|
||||
error = B_NO_MEMORY;
|
||||
}
|
||||
// read the super block
|
||||
// read the superblock
|
||||
if (error == B_OK) {
|
||||
size_t size = sizeof(super_block_t);
|
||||
if (read_pos(device, offset, superBlock, size) != (int32)size)
|
||||
|
@ -57,7 +57,7 @@ static inline C max(const C &a, const C &b) { return (a > b ? a : b); }
|
||||
\brief Represents a volume.
|
||||
|
||||
The Volume class bundles all functionality related to a volume.
|
||||
It knows the super block and has some basic functionality needed
|
||||
It knows the superblock and has some basic functionality needed
|
||||
for handling VNodes. Actually it should be the layer that provides the
|
||||
abstraction from VNodes. The design is not strict in this respect
|
||||
(the whole thing evolved while I was in the process of understanding
|
||||
@ -97,7 +97,7 @@ Volume::Identify(int fd, partition_data *partition)
|
||||
if (fDevice < 0)
|
||||
return B_ERROR;
|
||||
|
||||
// read and analyze super block
|
||||
// read and analyze superblock
|
||||
return _ReadSuperBlock();
|
||||
}
|
||||
|
||||
@ -130,7 +130,7 @@ Volume::Mount(fs_volume *fsVolume, const char *path)
|
||||
if (fDevice < 0)
|
||||
SET_ERROR(error, errno);
|
||||
}
|
||||
// read and analyze super block
|
||||
// read and analyze superblock
|
||||
if (error == B_OK)
|
||||
error = _ReadSuperBlock();
|
||||
|
||||
@ -534,12 +534,12 @@ Volume::_ReadSuperBlock()
|
||||
error = B_NO_MEMORY;
|
||||
// check FS state
|
||||
if (error == B_OK && fSuperBlock->GetState() != REISERFS_VALID_FS) {
|
||||
FATAL(("The super block indicates a non-valid FS! Bailing out."));
|
||||
FATAL(("The superblock indicates a non-valid FS! Bailing out."));
|
||||
error = B_ERROR;
|
||||
}
|
||||
// check FS version
|
||||
if (error == B_OK && fSuperBlock->GetVersion() > REISERFS_VERSION_2) {
|
||||
FATAL(("The super block indicates a version greater than 2 (%u)! "
|
||||
FATAL(("The superblock indicates a version greater than 2 (%u)! "
|
||||
"Bailing out.", fSuperBlock->GetVersion()));
|
||||
error = B_ERROR;
|
||||
}
|
||||
|
@ -220,7 +220,7 @@ struct reiserfs_de_head
|
||||
//
|
||||
|
||||
//
|
||||
// super block's field values
|
||||
// superblock's field values
|
||||
//
|
||||
#define REISERFS_VERSION_0 0 /* undistributed bitmap */
|
||||
#define REISERFS_VERSION_1 1 /* distributed bitmap and resizer*/
|
||||
@ -232,7 +232,7 @@ struct reiserfs_de_head
|
||||
#define R5_HASH 3
|
||||
#define DEFAULT_HASH R5_HASH
|
||||
|
||||
/* this is the on disk super block */
|
||||
/* this is the on disk superblock */
|
||||
|
||||
struct reiserfs_super_block
|
||||
{
|
||||
|
@ -39,7 +39,7 @@ file_system obfs {
|
||||
is_buffer false
|
||||
}
|
||||
|
||||
# dump super block
|
||||
# dump superblock
|
||||
ioctl 56743 {
|
||||
buffer_size 0
|
||||
write_buffer_size 0
|
||||
|
@ -31,7 +31,7 @@ local sources =
|
||||
|
||||
AddResources IMAP : IMAP.rdef ;
|
||||
|
||||
if $(HAIKU_OPENSSL_ENABLED) {
|
||||
if $(HAIKU_BUILD_FEATURE_OPENSSL_ENABLED) {
|
||||
SubDirC++Flags -DUSE_SSL ;
|
||||
SetupFeatureObjectsDir ssl ;
|
||||
} else {
|
||||
|
@ -17,7 +17,7 @@ local sources =
|
||||
;
|
||||
|
||||
# use OpenSSL, if enabled
|
||||
if $(HAIKU_OPENSSL_ENABLED) {
|
||||
if $(HAIKU_BUILD_FEATURE_OPENSSL_ENABLED) {
|
||||
SubDirC++Flags -DUSE_SSL ;
|
||||
SubDirSysHdrs $(HAIKU_OPENSSL_HEADERS) ;
|
||||
Includes [ FGristFiles $(sources) ] : $(HAIKU_OPENSSL_HEADERS_DEPENDENCY) ;
|
||||
|
@ -13,7 +13,7 @@ local sources =
|
||||
;
|
||||
|
||||
# use OpenSSL, if enabled
|
||||
if $(HAIKU_OPENSSL_ENABLED) {
|
||||
if $(HAIKU_BUILD_FEATURE_OPENSSL_ENABLED) {
|
||||
SubDirC++Flags -DUSE_SSL ;
|
||||
SubDirSysHdrs $(HAIKU_OPENSSL_HEADERS) ;
|
||||
Includes [ FGristFiles $(sources) ] : $(HAIKU_OPENSSL_HEADERS_DEPENDENCY) ;
|
||||
|
@ -26,13 +26,9 @@ extern "C" {
|
||||
#include "state_tracker/st_gl_api.h"
|
||||
#include "state_tracker/st_manager.h"
|
||||
#include "state_tracker/sw_winsys.h"
|
||||
#include "softpipe/sp_context.h"
|
||||
#include "softpipe/sp_public.h"
|
||||
#include "softpipe/sp_texture.h"
|
||||
#ifdef USE_LLVMPIPE
|
||||
#include "llvmpipe/lp_context.h"
|
||||
#ifdef HAVE_LLVM
|
||||
#include "llvmpipe/lp_public.h"
|
||||
#include "llvmpipe/lp_texture.h"
|
||||
#endif
|
||||
}
|
||||
|
||||
@ -209,7 +205,7 @@ GalliumContext::CreateScreen()
|
||||
return B_ERROR;
|
||||
}
|
||||
|
||||
#if USE_LLVMPIPE
|
||||
#ifdef HAVE_LLVM
|
||||
fScreen = llvmpipe_create_screen(winsys);
|
||||
#endif
|
||||
|
||||
@ -223,7 +219,7 @@ GalliumContext::CreateScreen()
|
||||
}
|
||||
|
||||
const char* driverName = fScreen->get_name(fScreen);
|
||||
TRACE("%s: Using %s driver.\n", __func__, driverName);
|
||||
ERROR("%s: Using %s driver.\n", __func__, driverName);
|
||||
|
||||
return B_OK;
|
||||
}
|
||||
|
@ -15,8 +15,10 @@ local sources =
|
||||
|
||||
if $(HAIKU_LLVM_PRESENT) {
|
||||
# TODO: Add LLVM OptionalBuildPackage
|
||||
SubDirC++Flags [ FDefines USE_LLVMPIPE ] ;
|
||||
SubDirSysHdrs $(HAIKU_LLVM_HEADERS) ;
|
||||
SubDirC++Flags [ FDefines HAVE_LLVM=0x0302 ] ;
|
||||
|
||||
# TODO: This is a hack for now
|
||||
SubDirSysHdrs /boot/common/include ;
|
||||
}
|
||||
|
||||
|
||||
|
@ -174,9 +174,10 @@ SoftwareRenderer::SwapBuffers(bool vsync)
|
||||
|
||||
// check the bitmap size still matches the size
|
||||
if (fInfo->window_bounds.bottom - fInfo->window_bounds.top
|
||||
!= fBitmap->Bounds().IntegerHeight() + 1
|
||||
!= fBitmap->Bounds().IntegerHeight()
|
||||
|| fInfo->window_bounds.right - fInfo->window_bounds.left
|
||||
!= fBitmap->Bounds().IntegerWidth() + 1) {
|
||||
!= fBitmap->Bounds().IntegerWidth()) {
|
||||
ERROR("%s: Bitmap size doesn't match size!\n", __func__);
|
||||
return;
|
||||
}
|
||||
uint8 bytesPerPixel = fInfo->bits_per_pixel / 8;
|
||||
|
@ -22,15 +22,15 @@ extern "C" {
|
||||
}
|
||||
|
||||
|
||||
#define TRACE_CONTEXT
|
||||
#ifdef TRACE_CONTEXT
|
||||
# define TRACE(x...) printf("GalliumContext: " x)
|
||||
#define TRACE_WINSYS
|
||||
#ifdef TRACE_WINSYS
|
||||
# define TRACE(x...) printf("GalliumWinsys: " x)
|
||||
# define CALLED() TRACE("CALLED: %s\n", __PRETTY_FUNCTION__)
|
||||
#else
|
||||
# define TRACE(x...)
|
||||
# define CALLED()
|
||||
#endif
|
||||
#define ERROR(x...) printf("GalliumContext: " x)
|
||||
#define ERROR(x...) printf("GalliumWinsys: " x)
|
||||
|
||||
|
||||
// Cast
|
||||
@ -209,4 +209,4 @@ winsys_connect_hooks()
|
||||
winsys->displaytarget_destroy = hook_winsys_displaytarget_destroy;
|
||||
|
||||
return winsys;
|
||||
}
|
||||
}
|
||||
|
@ -263,6 +263,7 @@ Application Debugger :
|
||||
ValueLoader.cpp
|
||||
ValueNode.cpp
|
||||
ValueNodeContainer.cpp
|
||||
ValueNodeManager.cpp
|
||||
|
||||
# value/type_handlers
|
||||
BListTypeHandler.cpp
|
||||
|
@ -26,15 +26,27 @@
|
||||
#include "StringUtils.h"
|
||||
#include "Team.h"
|
||||
#include "Thread.h"
|
||||
#include "Type.h"
|
||||
#include "UiUtils.h"
|
||||
#include "UserInterface.h"
|
||||
#include "Value.h"
|
||||
#include "ValueLoader.h"
|
||||
#include "ValueLocation.h"
|
||||
#include "ValueNode.h"
|
||||
#include "ValueNodeManager.h"
|
||||
|
||||
|
||||
DebugReportGenerator::DebugReportGenerator(::Team* team)
|
||||
DebugReportGenerator::DebugReportGenerator(::Team* team,
|
||||
UserInterfaceListener* listener)
|
||||
:
|
||||
BLooper("DebugReportGenerator"),
|
||||
fTeam(team),
|
||||
fArchitecture(team->GetArchitecture()),
|
||||
fTeamDataSem(-1)
|
||||
fTeamDataSem(-1),
|
||||
fNodeManager(NULL),
|
||||
fListener(listener),
|
||||
fWaitingNode(NULL),
|
||||
fTraceWaitingThread(NULL)
|
||||
{
|
||||
fTeam->AddListener(this);
|
||||
fArchitecture->AcquireReference();
|
||||
@ -45,6 +57,10 @@ DebugReportGenerator::~DebugReportGenerator()
|
||||
{
|
||||
fTeam->RemoveListener(this);
|
||||
fArchitecture->ReleaseReference();
|
||||
if (fNodeManager != NULL) {
|
||||
fNodeManager->RemoveListener(this);
|
||||
fNodeManager->ReleaseReference();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -55,6 +71,12 @@ DebugReportGenerator::Init()
|
||||
if (fTeamDataSem < B_OK)
|
||||
return fTeamDataSem;
|
||||
|
||||
fNodeManager = new(std::nothrow) ValueNodeManager();
|
||||
if (fNodeManager == NULL)
|
||||
return B_NO_MEMORY;
|
||||
|
||||
fNodeManager->AddListener(this);
|
||||
|
||||
Run();
|
||||
|
||||
return B_OK;
|
||||
@ -62,9 +84,9 @@ DebugReportGenerator::Init()
|
||||
|
||||
|
||||
DebugReportGenerator*
|
||||
DebugReportGenerator::Create(::Team* team)
|
||||
DebugReportGenerator::Create(::Team* team, UserInterfaceListener* listener)
|
||||
{
|
||||
DebugReportGenerator* self = new DebugReportGenerator(team);
|
||||
DebugReportGenerator* self = new DebugReportGenerator(team, listener);
|
||||
|
||||
try {
|
||||
self->Init();
|
||||
@ -132,7 +154,20 @@ DebugReportGenerator::MessageReceived(BMessage* message)
|
||||
void
|
||||
DebugReportGenerator::ThreadStackTraceChanged(const ::Team::ThreadEvent& event)
|
||||
{
|
||||
release_sem(fTeamDataSem);
|
||||
if (fTraceWaitingThread == event.GetThread()) {
|
||||
fTraceWaitingThread = NULL;
|
||||
release_sem(fTeamDataSem);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
DebugReportGenerator::ValueNodeValueChanged(ValueNode* node)
|
||||
{
|
||||
if (node == fWaitingNode) {
|
||||
fWaitingNode = NULL;
|
||||
release_sem(fTeamDataSem);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -267,6 +302,7 @@ DebugReportGenerator::_DumpDebuggedThreadInfo(BString& _output,
|
||||
break;
|
||||
|
||||
locker.Unlock();
|
||||
fTraceWaitingThread = thread;
|
||||
status_t result = acquire_sem(fTeamDataSem);
|
||||
if (result != B_OK)
|
||||
return result;
|
||||
@ -285,6 +321,26 @@ DebugReportGenerator::_DumpDebuggedThreadInfo(BString& _output,
|
||||
sizeof(functionName)));
|
||||
|
||||
_output << data;
|
||||
if (frame->CountParameters() == 0
|
||||
&& frame->CountLocalVariables() == 0) {
|
||||
continue;
|
||||
}
|
||||
|
||||
_output << "\t\t\tVariables:\n";
|
||||
status_t result = fNodeManager->SetStackFrame(thread, frame);
|
||||
if (result != B_OK)
|
||||
continue;
|
||||
|
||||
ValueNodeContainer* container = fNodeManager->GetContainer();
|
||||
AutoLocker<ValueNodeContainer> containerLocker(container);
|
||||
for (int32 i = 0; i < container->CountChildren(); i++) {
|
||||
ValueNodeChild* child = container->ChildAt(i);
|
||||
containerLocker.Unlock();
|
||||
_ResolveValueIfNeeded(child->Node(), frame, 1);
|
||||
containerLocker.Lock();
|
||||
UiUtils::PrintValueNodeGraph(_output, frame, child, 3, 1);
|
||||
}
|
||||
_output << "\n";
|
||||
}
|
||||
|
||||
_output << "\n\t\tRegisters:\n";
|
||||
@ -304,3 +360,60 @@ DebugReportGenerator::_DumpDebuggedThreadInfo(BString& _output,
|
||||
|
||||
return B_OK;
|
||||
}
|
||||
|
||||
|
||||
status_t
|
||||
DebugReportGenerator::_ResolveValueIfNeeded(ValueNode* node, StackFrame* frame,
|
||||
int32 maxDepth)
|
||||
{
|
||||
status_t result = B_OK;
|
||||
if (node->LocationAndValueResolutionState() == VALUE_NODE_UNRESOLVED) {
|
||||
fWaitingNode = node;
|
||||
fListener->ValueNodeValueRequested(frame->GetCpuState(),
|
||||
fNodeManager->GetContainer(), node);
|
||||
result = acquire_sem(fTeamDataSem);
|
||||
}
|
||||
|
||||
if (node->LocationAndValueResolutionState() == B_OK && maxDepth > 0) {
|
||||
AutoLocker<ValueNodeContainer> containerLocker(
|
||||
fNodeManager->GetContainer());
|
||||
for (int32 i = 0; i < node->CountChildren(); i++) {
|
||||
ValueNodeChild* child = node->ChildAt(i);
|
||||
containerLocker.Unlock();
|
||||
result = _ResolveLocationIfNeeded(child, frame);
|
||||
if (result != B_OK)
|
||||
continue;
|
||||
|
||||
result = fNodeManager->AddChildNodes(child);
|
||||
if (result != B_OK)
|
||||
continue;
|
||||
|
||||
// since in the case of a pointer to a compound we hide
|
||||
// the intervening compound, don't consider the hidden node
|
||||
// a level for the purposes of depth traversal
|
||||
if (node->GetType()->Kind() == TYPE_ADDRESS
|
||||
&& child->GetType()->Kind() == TYPE_COMPOUND) {
|
||||
_ResolveValueIfNeeded(child->Node(), frame, maxDepth);
|
||||
} else
|
||||
_ResolveValueIfNeeded(child->Node(), frame, maxDepth - 1);
|
||||
containerLocker.Lock();
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
status_t
|
||||
DebugReportGenerator::_ResolveLocationIfNeeded(ValueNodeChild* child,
|
||||
StackFrame* frame)
|
||||
{
|
||||
ValueLocation* location = NULL;
|
||||
ValueLoader loader(fTeam->GetArchitecture(), fTeam->GetTeamMemory(),
|
||||
fTeam->GetTeamTypeInformation(), frame->GetCpuState());
|
||||
status_t result = child->ResolveLocation(&loader, location);
|
||||
child->SetLocation(location, result);
|
||||
if (location != NULL)
|
||||
location->ReleaseReference();
|
||||
return result;
|
||||
}
|
||||
|
@ -3,35 +3,47 @@
|
||||
* Distributed under the terms of the MIT License.
|
||||
*/
|
||||
#ifndef DEBUG_REPORT_GENERATOR_H
|
||||
#define DEBUG_GENERATOR_H
|
||||
#define DEBUG_REPORT_GENERATOR_H
|
||||
|
||||
|
||||
#include <Looper.h>
|
||||
|
||||
#include "Team.h"
|
||||
#include "ValueNodeContainer.h"
|
||||
|
||||
|
||||
class entry_ref;
|
||||
class Architecture;
|
||||
class BString;
|
||||
class StackFrame;
|
||||
class Team;
|
||||
class Thread;
|
||||
class UserInterfaceListener;
|
||||
class Value;
|
||||
class ValueNode;
|
||||
class ValueNodeChild;
|
||||
class ValueNodeManager;
|
||||
|
||||
|
||||
class DebugReportGenerator : public BLooper, public Team::Listener {
|
||||
class DebugReportGenerator : public BLooper, private Team::Listener,
|
||||
private ValueNodeContainer::Listener {
|
||||
public:
|
||||
DebugReportGenerator(::Team* team);
|
||||
DebugReportGenerator(::Team* team,
|
||||
UserInterfaceListener* listener);
|
||||
~DebugReportGenerator();
|
||||
|
||||
status_t Init();
|
||||
|
||||
static DebugReportGenerator* Create(::Team* team);
|
||||
static DebugReportGenerator* Create(::Team* team,
|
||||
UserInterfaceListener* listener);
|
||||
|
||||
virtual void MessageReceived(BMessage* message);
|
||||
|
||||
virtual void ThreadStackTraceChanged(
|
||||
const Team::ThreadEvent& event);
|
||||
|
||||
virtual void ValueNodeValueChanged(ValueNode* node);
|
||||
|
||||
private:
|
||||
status_t _GenerateReport(const entry_ref& outputPath);
|
||||
status_t _GenerateReportHeader(BString& output);
|
||||
@ -40,10 +52,19 @@ private:
|
||||
status_t _DumpDebuggedThreadInfo(BString& output,
|
||||
::Thread* thread);
|
||||
|
||||
status_t _ResolveLocationIfNeeded(ValueNodeChild* child,
|
||||
StackFrame* frame);
|
||||
status_t _ResolveValueIfNeeded(ValueNode* node,
|
||||
StackFrame* frame, int32 maxDepth);
|
||||
|
||||
private:
|
||||
::Team* fTeam;
|
||||
Architecture* fArchitecture;
|
||||
sem_id fTeamDataSem;
|
||||
ValueNodeManager* fNodeManager;
|
||||
UserInterfaceListener* fListener;
|
||||
ValueNode* fWaitingNode;
|
||||
::Thread* fTraceWaitingThread;
|
||||
};
|
||||
|
||||
#endif // DEBUG_REPORT_GENERATOR_H
|
||||
|
@ -277,13 +277,17 @@ TeamDebugger::~TeamDebugger()
|
||||
thread = next;
|
||||
}
|
||||
}
|
||||
|
||||
if (fReportGenerator != NULL) {
|
||||
fReportGenerator->Lock();
|
||||
fReportGenerator->Quit();
|
||||
}
|
||||
|
||||
delete fImageInfoPendingThreads;
|
||||
|
||||
delete fBreakpointManager;
|
||||
delete fWatchpointManager;
|
||||
delete fMemoryBlockManager;
|
||||
fReportGenerator->Lock();
|
||||
fReportGenerator->Quit();
|
||||
delete fWorker;
|
||||
delete fTeam;
|
||||
delete fFileManager;
|
||||
@ -412,7 +416,7 @@ TeamDebugger::Init(team_id teamID, thread_id threadID, bool stopInMain)
|
||||
return error;
|
||||
|
||||
// create the debug report generator
|
||||
fReportGenerator = new(std::nothrow) DebugReportGenerator(fTeam);
|
||||
fReportGenerator = new(std::nothrow) DebugReportGenerator(fTeam, this);
|
||||
if (fReportGenerator == NULL)
|
||||
return B_NO_MEMORY;
|
||||
|
||||
|
233
src/apps/debugger/debug_managers/ValueNodeManager.cpp
Normal file
233
src/apps/debugger/debug_managers/ValueNodeManager.cpp
Normal file
@ -0,0 +1,233 @@
|
||||
/*
|
||||
* Copyright 2012, Rene Gollent, rene@gollent.com.
|
||||
* Copyright 2009, Ingo Weinhold, ingo_weinhold@gmx.de.
|
||||
* Distributed under the terms of the MIT License.
|
||||
*/
|
||||
|
||||
#include "ValueNodeManager.h"
|
||||
|
||||
#include "AutoLocker.h"
|
||||
|
||||
#include "StackFrame.h"
|
||||
#include "Thread.h"
|
||||
#include "TypeHandlerRoster.h"
|
||||
#include "ValueNode.h"
|
||||
#include "Variable.h"
|
||||
#include "VariableValueNodeChild.h"
|
||||
|
||||
|
||||
ValueNodeManager::ValueNodeManager()
|
||||
:
|
||||
fContainer(NULL),
|
||||
fStackFrame(NULL),
|
||||
fThread(NULL)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
ValueNodeManager::~ValueNodeManager()
|
||||
{
|
||||
SetStackFrame(NULL, NULL);
|
||||
}
|
||||
|
||||
|
||||
status_t
|
||||
ValueNodeManager::SetStackFrame(Thread* thread,
|
||||
StackFrame* stackFrame)
|
||||
{
|
||||
if (fContainer != NULL) {
|
||||
AutoLocker<ValueNodeContainer> containerLocker(fContainer);
|
||||
|
||||
fContainer->RemoveListener(this);
|
||||
|
||||
fContainer->RemoveAllChildren();
|
||||
containerLocker.Unlock();
|
||||
fContainer->ReleaseReference();
|
||||
fContainer = NULL;
|
||||
}
|
||||
|
||||
fStackFrame = stackFrame;
|
||||
fThread = thread;
|
||||
|
||||
if (fStackFrame != NULL) {
|
||||
fContainer = new(std::nothrow) ValueNodeContainer;
|
||||
if (fContainer == NULL)
|
||||
return B_NO_MEMORY;
|
||||
|
||||
status_t error = fContainer->Init();
|
||||
if (error != B_OK) {
|
||||
delete fContainer;
|
||||
fContainer = NULL;
|
||||
return error;
|
||||
}
|
||||
|
||||
AutoLocker<ValueNodeContainer> containerLocker(fContainer);
|
||||
|
||||
fContainer->AddListener(this);
|
||||
|
||||
for (int32 i = 0; Variable* variable = fStackFrame->ParameterAt(i);
|
||||
i++) {
|
||||
_AddNode(variable);
|
||||
}
|
||||
|
||||
for (int32 i = 0; Variable* variable
|
||||
= fStackFrame->LocalVariableAt(i); i++) {
|
||||
_AddNode(variable);
|
||||
}
|
||||
}
|
||||
|
||||
return B_OK;
|
||||
}
|
||||
|
||||
|
||||
bool
|
||||
ValueNodeManager::AddListener(ValueNodeContainer::Listener* listener)
|
||||
{
|
||||
return fListeners.AddItem(listener);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
ValueNodeManager::RemoveListener(ValueNodeContainer::Listener* listener)
|
||||
{
|
||||
fListeners.RemoveItem(listener);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
ValueNodeManager::ValueNodeChanged(ValueNodeChild* nodeChild,
|
||||
ValueNode* oldNode, ValueNode* newNode)
|
||||
{
|
||||
if (fContainer == NULL)
|
||||
return;
|
||||
|
||||
AutoLocker<ValueNodeContainer> containerLocker(fContainer);
|
||||
|
||||
if (oldNode != NULL)
|
||||
newNode->CreateChildren();
|
||||
|
||||
for (int32 i = fListeners.CountItems() - 1; i >= 0; i--)
|
||||
fListeners.ItemAt(i)->ValueNodeChanged(nodeChild, oldNode, newNode);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
ValueNodeManager::ValueNodeChildrenCreated(ValueNode* node)
|
||||
{
|
||||
if (fContainer == NULL)
|
||||
return;
|
||||
|
||||
for (int32 i = fListeners.CountItems() - 1; i >= 0; i--)
|
||||
fListeners.ItemAt(i)->ValueNodeChildrenCreated(node);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
ValueNodeManager::ValueNodeChildrenDeleted(ValueNode* node)
|
||||
{
|
||||
if (fContainer == NULL)
|
||||
return;
|
||||
|
||||
for (int32 i = fListeners.CountItems() - 1; i >= 0; i--)
|
||||
fListeners.ItemAt(i)->ValueNodeChildrenDeleted(node);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
ValueNodeManager::ValueNodeValueChanged(ValueNode* valueNode)
|
||||
{
|
||||
if (fContainer == NULL)
|
||||
return;
|
||||
|
||||
AutoLocker<ValueNodeContainer> containerLocker(fContainer);
|
||||
|
||||
// check whether we know the node
|
||||
ValueNodeChild* nodeChild = valueNode->NodeChild();
|
||||
if (nodeChild == NULL)
|
||||
return;
|
||||
|
||||
if (valueNode->ChildCreationNeedsValue()
|
||||
&& !valueNode->ChildrenCreated()) {
|
||||
status_t error = valueNode->CreateChildren();
|
||||
if (error == B_OK) {
|
||||
for (int32 i = 0; i < valueNode->CountChildren(); i++) {
|
||||
ValueNodeChild* child = valueNode->ChildAt(i);
|
||||
_CreateValueNode(child);
|
||||
AddChildNodes(child);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (int32 i = fListeners.CountItems() - 1; i >= 0; i--)
|
||||
fListeners.ItemAt(i)->ValueNodeValueChanged(valueNode);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
ValueNodeManager::_AddNode(Variable* variable)
|
||||
{
|
||||
// create the node child for the variable
|
||||
ValueNodeChild* nodeChild = new (std::nothrow) VariableValueNodeChild(
|
||||
variable);
|
||||
BReference<ValueNodeChild> nodeChildReference(nodeChild, true);
|
||||
if (nodeChild == NULL || !fContainer->AddChild(nodeChild)) {
|
||||
delete nodeChild;
|
||||
return;
|
||||
}
|
||||
|
||||
// automatically add child nodes for the top level nodes
|
||||
AddChildNodes(nodeChild);
|
||||
}
|
||||
|
||||
|
||||
status_t
|
||||
ValueNodeManager::_CreateValueNode(ValueNodeChild* nodeChild)
|
||||
{
|
||||
if (nodeChild->Node() != NULL)
|
||||
return B_OK;
|
||||
|
||||
// create the node
|
||||
ValueNode* valueNode;
|
||||
status_t error;
|
||||
if (nodeChild->IsInternal()) {
|
||||
error = nodeChild->CreateInternalNode(valueNode);
|
||||
} else {
|
||||
error = TypeHandlerRoster::Default()->CreateValueNode(nodeChild,
|
||||
nodeChild->GetType(), valueNode);
|
||||
}
|
||||
|
||||
if (error != B_OK)
|
||||
return error;
|
||||
|
||||
nodeChild->SetNode(valueNode);
|
||||
valueNode->ReleaseReference();
|
||||
|
||||
return B_OK;
|
||||
}
|
||||
|
||||
|
||||
status_t
|
||||
ValueNodeManager::AddChildNodes(ValueNodeChild* nodeChild)
|
||||
{
|
||||
AutoLocker<ValueNodeContainer> containerLocker(fContainer);
|
||||
|
||||
// create a value node for the value node child, if doesn't have one yet
|
||||
ValueNode* valueNode = nodeChild->Node();
|
||||
if (valueNode == NULL) {
|
||||
status_t error = _CreateValueNode(nodeChild);
|
||||
if (error != B_OK)
|
||||
return error;
|
||||
valueNode = nodeChild->Node();
|
||||
}
|
||||
|
||||
// check if this node requires child creation
|
||||
// to be deferred until after its location/value have been resolved
|
||||
if (valueNode->ChildCreationNeedsValue())
|
||||
return B_OK;
|
||||
|
||||
// create the children, if not done yet
|
||||
if (valueNode->ChildrenCreated())
|
||||
return B_OK;
|
||||
|
||||
return valueNode->CreateChildren();
|
||||
}
|
54
src/apps/debugger/debug_managers/ValueNodeManager.h
Normal file
54
src/apps/debugger/debug_managers/ValueNodeManager.h
Normal file
@ -0,0 +1,54 @@
|
||||
/*
|
||||
* Copyright 2012, Rene Gollent, rene@gollent.com.
|
||||
* Distributed under the terms of the MIT License.
|
||||
*/
|
||||
#ifndef VALUE_NODE_MANAGER_H
|
||||
#define VALUE_NODE_MANAGER_H
|
||||
|
||||
#include <Referenceable.h>
|
||||
|
||||
#include "ValueNodeContainer.h"
|
||||
|
||||
class StackFrame;
|
||||
class Thread;
|
||||
class Variable;
|
||||
|
||||
|
||||
class ValueNodeManager : public BReferenceable,
|
||||
private ValueNodeContainer::Listener {
|
||||
public:
|
||||
ValueNodeManager();
|
||||
virtual ~ValueNodeManager();
|
||||
|
||||
status_t SetStackFrame(Thread* thread,
|
||||
StackFrame* frame);
|
||||
|
||||
bool AddListener(
|
||||
ValueNodeContainer::Listener* listener);
|
||||
void RemoveListener(
|
||||
ValueNodeContainer::Listener* listener);
|
||||
|
||||
virtual void ValueNodeChanged(ValueNodeChild* nodeChild,
|
||||
ValueNode* oldNode, ValueNode* newNode);
|
||||
virtual void ValueNodeChildrenCreated(ValueNode* node);
|
||||
virtual void ValueNodeChildrenDeleted(ValueNode* node);
|
||||
virtual void ValueNodeValueChanged(ValueNode* node);
|
||||
|
||||
ValueNodeContainer* GetContainer() const { return fContainer; };
|
||||
|
||||
status_t AddChildNodes(ValueNodeChild* nodeChild);
|
||||
|
||||
private:
|
||||
typedef BObjectList<ValueNodeContainer::Listener> ListenerList;
|
||||
|
||||
void _AddNode(Variable* variable);
|
||||
status_t _CreateValueNode(ValueNodeChild* nodeChild);
|
||||
|
||||
private:
|
||||
ValueNodeContainer* fContainer;
|
||||
StackFrame* fStackFrame;
|
||||
Thread* fThread;
|
||||
ListenerList fListeners;
|
||||
};
|
||||
|
||||
#endif // VALUE_NODE_MANAGER_H
|
@ -28,6 +28,7 @@ BreakpointsView::BreakpointsView(Team* team, Listener* listener)
|
||||
BGroupView(B_HORIZONTAL, 4.0f),
|
||||
fTeam(team),
|
||||
fBreakpoint(NULL),
|
||||
fWatchpoint(NULL),
|
||||
fListView(NULL),
|
||||
fToggleBreakpointButton(NULL),
|
||||
fRemoveBreakpointButton(NULL),
|
||||
|
@ -50,7 +50,7 @@
|
||||
#include "ValueHandlerRoster.h"
|
||||
#include "ValueLocation.h"
|
||||
#include "ValueNode.h"
|
||||
#include "ValueNodeContainer.h"
|
||||
#include "ValueNodeManager.h"
|
||||
#include "Variable.h"
|
||||
#include "VariableValueNodeChild.h"
|
||||
#include "VariablesViewState.h"
|
||||
@ -451,17 +451,10 @@ private:
|
||||
ValueNodeChild* nodeChild,
|
||||
bool isPresentationNode = false,
|
||||
bool isOnlyChild = false);
|
||||
void _AddNode(Variable* variable);
|
||||
status_t _CreateValueNode(ValueNodeChild* nodeChild);
|
||||
status_t _AddChildNodes(ValueNodeChild* nodeChild);
|
||||
|
||||
// ModelNode* _GetNode(Variable* variable,
|
||||
// TypeComponentPath* path) const;
|
||||
|
||||
private:
|
||||
Thread* fThread;
|
||||
StackFrame* fStackFrame;
|
||||
ValueNodeContainer* fContainer;
|
||||
ValueNodeManager* fNodeManager;
|
||||
ContainerListener* fContainerListener;
|
||||
NodeList fNodes;
|
||||
NodeTable fNodeTable;
|
||||
@ -841,8 +834,8 @@ VariablesView::ContainerListener::ModelNodeRestoreViewStateRequested(
|
||||
|
||||
VariablesView::VariableTableModel::VariableTableModel()
|
||||
:
|
||||
fStackFrame(NULL),
|
||||
fContainer(NULL),
|
||||
fThread(NULL),
|
||||
fNodeManager(NULL),
|
||||
fContainerListener(NULL),
|
||||
fNodeTable()
|
||||
{
|
||||
@ -851,13 +844,18 @@ VariablesView::VariableTableModel::VariableTableModel()
|
||||
|
||||
VariablesView::VariableTableModel::~VariableTableModel()
|
||||
{
|
||||
SetStackFrame(NULL, NULL);
|
||||
if (fNodeManager != NULL)
|
||||
fNodeManager->ReleaseReference();
|
||||
}
|
||||
|
||||
|
||||
status_t
|
||||
VariablesView::VariableTableModel::Init()
|
||||
{
|
||||
fNodeManager = new(std::nothrow) ValueNodeManager();
|
||||
if (fNodeManager == NULL)
|
||||
return B_NO_MEMORY;
|
||||
|
||||
return fNodeTable.Init();
|
||||
}
|
||||
|
||||
@ -870,10 +868,8 @@ VariablesView::VariableTableModel::SetContainerListener(
|
||||
return;
|
||||
|
||||
if (fContainerListener != NULL) {
|
||||
if (fContainer != NULL) {
|
||||
AutoLocker<ValueNodeContainer> containerLocker(fContainer);
|
||||
fContainer->RemoveListener(fContainerListener);
|
||||
}
|
||||
if (fNodeManager != NULL)
|
||||
fNodeManager->RemoveListener(fContainerListener);
|
||||
|
||||
fContainerListener->SetModel(NULL);
|
||||
}
|
||||
@ -883,10 +879,8 @@ VariablesView::VariableTableModel::SetContainerListener(
|
||||
if (fContainerListener != NULL) {
|
||||
fContainerListener->SetModel(this);
|
||||
|
||||
if (fContainer != NULL) {
|
||||
AutoLocker<ValueNodeContainer> containerLocker(fContainer);
|
||||
fContainer->AddListener(fContainerListener);
|
||||
}
|
||||
if (fNodeManager != NULL)
|
||||
fNodeManager->AddListener(fContainerListener);
|
||||
}
|
||||
}
|
||||
|
||||
@ -895,17 +889,9 @@ void
|
||||
VariablesView::VariableTableModel::SetStackFrame(Thread* thread,
|
||||
StackFrame* stackFrame)
|
||||
{
|
||||
if (fContainer != NULL) {
|
||||
AutoLocker<ValueNodeContainer> containerLocker(fContainer);
|
||||
fThread = thread;
|
||||
|
||||
if (fContainerListener != NULL)
|
||||
fContainer->RemoveListener(fContainerListener);
|
||||
|
||||
fContainer->RemoveAllChildren();
|
||||
containerLocker.Unlock();
|
||||
fContainer->ReleaseReference();
|
||||
fContainer = NULL;
|
||||
}
|
||||
fNodeManager->SetStackFrame(thread, stackFrame);
|
||||
|
||||
fNodeTable.Clear(true);
|
||||
|
||||
@ -917,38 +903,19 @@ VariablesView::VariableTableModel::SetStackFrame(Thread* thread,
|
||||
NotifyNodesRemoved(TreeTablePath(), 0, count);
|
||||
}
|
||||
|
||||
fStackFrame = stackFrame;
|
||||
fThread = thread;
|
||||
if (stackFrame == NULL)
|
||||
return;
|
||||
|
||||
if (fStackFrame != NULL) {
|
||||
fContainer = new(std::nothrow) ValueNodeContainer;
|
||||
if (fContainer == NULL)
|
||||
return;
|
||||
ValueNodeContainer* container = fNodeManager->GetContainer();
|
||||
AutoLocker<ValueNodeContainer> containerLocker(container);
|
||||
|
||||
status_t error = fContainer->Init();
|
||||
if (error != B_OK) {
|
||||
delete fContainer;
|
||||
fContainer = NULL;
|
||||
return;
|
||||
}
|
||||
|
||||
AutoLocker<ValueNodeContainer> containerLocker(fContainer);
|
||||
|
||||
if (fContainerListener != NULL)
|
||||
fContainer->AddListener(fContainerListener);
|
||||
|
||||
for (int32 i = 0; Variable* variable = fStackFrame->ParameterAt(i);
|
||||
i++) {
|
||||
_AddNode(variable);
|
||||
}
|
||||
|
||||
for (int32 i = 0; Variable* variable
|
||||
= fStackFrame->LocalVariableAt(i); i++) {
|
||||
_AddNode(variable);
|
||||
}
|
||||
|
||||
// if (!fNodes.IsEmpty())
|
||||
// NotifyNodesAdded(TreeTablePath(), 0, fNodes.CountItems());
|
||||
for (int32 i = 0; i < container->CountChildren(); i++) {
|
||||
VariableValueNodeChild* child = dynamic_cast<VariableValueNodeChild *>(
|
||||
container->ChildAt(i));
|
||||
_AddNode(child->GetVariable(), NULL, child);
|
||||
// top level nodes get their children added immediately
|
||||
// so those won't invoke our callback hook. Add them directly here.
|
||||
ValueNodeChildrenCreated(child->Node());
|
||||
}
|
||||
}
|
||||
|
||||
@ -957,19 +924,14 @@ void
|
||||
VariablesView::VariableTableModel::ValueNodeChanged(ValueNodeChild* nodeChild,
|
||||
ValueNode* oldNode, ValueNode* newNode)
|
||||
{
|
||||
if (fContainer == NULL)
|
||||
return;
|
||||
|
||||
AutoLocker<ValueNodeContainer> containerLocker(fContainer);
|
||||
AutoLocker<ValueNodeContainer> containerLocker(
|
||||
fNodeManager->GetContainer());
|
||||
ModelNode* modelNode = fNodeTable.Lookup(nodeChild);
|
||||
if (modelNode == NULL)
|
||||
return;
|
||||
|
||||
if (oldNode != NULL) {
|
||||
ValueNodeChildrenDeleted(oldNode);
|
||||
newNode->CreateChildren();
|
||||
if (oldNode != NULL)
|
||||
NotifyNodeChanged(modelNode);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -977,10 +939,8 @@ void
|
||||
VariablesView::VariableTableModel::ValueNodeChildrenCreated(
|
||||
ValueNode* valueNode)
|
||||
{
|
||||
if (fContainer == NULL)
|
||||
return;
|
||||
|
||||
AutoLocker<ValueNodeContainer> containerLocker(fContainer);
|
||||
AutoLocker<ValueNodeContainer> containerLocker(
|
||||
fNodeManager->GetContainer());
|
||||
|
||||
// check whether we know the node
|
||||
ValueNodeChild* nodeChild = valueNode->NodeChild();
|
||||
@ -1016,10 +976,8 @@ VariablesView::VariableTableModel::ValueNodeChildrenCreated(
|
||||
void
|
||||
VariablesView::VariableTableModel::ValueNodeChildrenDeleted(ValueNode* node)
|
||||
{
|
||||
if (fContainer == NULL)
|
||||
return;
|
||||
|
||||
AutoLocker<ValueNodeContainer> containerLocker(fContainer);
|
||||
AutoLocker<ValueNodeContainer> containerLocker(
|
||||
fNodeManager->GetContainer());
|
||||
|
||||
// check whether we know the node
|
||||
ValueNodeChild* nodeChild = node->NodeChild();
|
||||
@ -1058,10 +1016,8 @@ VariablesView::VariableTableModel::ValueNodeChildrenDeleted(ValueNode* node)
|
||||
void
|
||||
VariablesView::VariableTableModel::ValueNodeValueChanged(ValueNode* valueNode)
|
||||
{
|
||||
if (fContainer == NULL)
|
||||
return;
|
||||
|
||||
AutoLocker<ValueNodeContainer> containerLocker(fContainer);
|
||||
AutoLocker<ValueNodeContainer> containerLocker(
|
||||
fNodeManager->GetContainer());
|
||||
|
||||
// check whether we know the node
|
||||
ValueNodeChild* nodeChild = valueNode->NodeChild();
|
||||
@ -1072,19 +1028,6 @@ VariablesView::VariableTableModel::ValueNodeValueChanged(ValueNode* valueNode)
|
||||
if (modelNode == NULL)
|
||||
return;
|
||||
|
||||
if (valueNode->ChildCreationNeedsValue()
|
||||
&& !valueNode->ChildrenCreated()) {
|
||||
status_t error = valueNode->CreateChildren();
|
||||
if (error != B_OK)
|
||||
return;
|
||||
|
||||
for (int32 i = 0; i < valueNode->CountChildren(); i++) {
|
||||
ValueNodeChild* child = valueNode->ChildAt(i);
|
||||
_CreateValueNode(child);
|
||||
_AddChildNodes(child);
|
||||
}
|
||||
}
|
||||
|
||||
// check whether the value actually changed
|
||||
Value* value = valueNode->GetValue();
|
||||
if (value == modelNode->GetValue())
|
||||
@ -1196,7 +1139,7 @@ VariablesView::VariableTableModel::GetValueAt(void* object, int32 columnIndex,
|
||||
if (piece.type != VALUE_PIECE_LOCATION_MEMORY)
|
||||
return false;
|
||||
|
||||
data.SetToFormat("[@ 0x%llx]", piece.address);
|
||||
data.SetToFormat("[@ %#" B_PRIx64 "]", piece.address);
|
||||
_value.SetTo(data);
|
||||
return true;
|
||||
}
|
||||
@ -1214,11 +1157,8 @@ VariablesView::VariableTableModel::GetValueAt(void* object, int32 columnIndex,
|
||||
void
|
||||
VariablesView::VariableTableModel::NodeExpanded(ModelNode* node)
|
||||
{
|
||||
if (fContainer == NULL)
|
||||
return;
|
||||
|
||||
AutoLocker<ValueNodeContainer> containerLocker(fContainer);
|
||||
|
||||
AutoLocker<ValueNodeContainer> containerLocker(
|
||||
fNodeManager->GetContainer());
|
||||
// add children of all children
|
||||
|
||||
// If the node only has a hidden child, add the child's children instead.
|
||||
@ -1230,7 +1170,7 @@ VariablesView::VariableTableModel::NodeExpanded(ModelNode* node)
|
||||
|
||||
// add the children
|
||||
for (int32 i = 0; ModelNode* child = node->ChildAt(i); i++)
|
||||
_AddChildNodes(child->NodeChild());
|
||||
fNodeManager->AddChildNodes(child->NodeChild());
|
||||
}
|
||||
|
||||
|
||||
@ -1272,13 +1212,13 @@ VariablesView::VariableTableModel::GetToolTipForTablePath(
|
||||
BString pieceData;
|
||||
switch (piece.type) {
|
||||
case VALUE_PIECE_LOCATION_MEMORY:
|
||||
pieceData.SetToFormat("(%ld): Address: 0x%llx, Size: "
|
||||
"%lld bytes", i, piece.address, piece.size);
|
||||
pieceData.SetToFormat("(%" B_PRId32 "): Address: %#" B_PRIx64
|
||||
", Size: %" B_PRId64 " bytes", i, piece.address, piece.size);
|
||||
break;
|
||||
case VALUE_PIECE_LOCATION_REGISTER:
|
||||
{
|
||||
Architecture* architecture = fThread->GetTeam()->GetArchitecture();
|
||||
pieceData.SetToFormat("(%ld): Register (%s)",
|
||||
pieceData.SetToFormat("(%" B_PRId32 "): Register (%s)",
|
||||
i, architecture->Registers()[piece.reg].Name());
|
||||
|
||||
break;
|
||||
@ -1365,150 +1305,12 @@ VariablesView::VariableTableModel::_AddNode(Variable* variable,
|
||||
|
||||
// if the node is hidden, add its children
|
||||
if (node->IsHidden())
|
||||
_AddChildNodes(nodeChild);
|
||||
fNodeManager->AddChildNodes(nodeChild);
|
||||
|
||||
return B_OK;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
VariablesView::VariableTableModel::_AddNode(Variable* variable)
|
||||
{
|
||||
// create the node child for the variable
|
||||
ValueNodeChild* nodeChild = new (std::nothrow) VariableValueNodeChild(
|
||||
variable);
|
||||
BReference<ValueNodeChild> nodeChildReference(nodeChild, true);
|
||||
if (nodeChild == NULL || !fContainer->AddChild(nodeChild)) {
|
||||
delete nodeChild;
|
||||
return;
|
||||
}
|
||||
|
||||
// create the model node
|
||||
status_t error = _AddNode(variable, NULL, nodeChild, false);
|
||||
if (error != B_OK)
|
||||
return;
|
||||
|
||||
// automatically add child nodes for the top level nodes
|
||||
_AddChildNodes(nodeChild);
|
||||
}
|
||||
|
||||
|
||||
status_t
|
||||
VariablesView::VariableTableModel::_CreateValueNode(ValueNodeChild* nodeChild)
|
||||
{
|
||||
if (nodeChild->Node() != NULL)
|
||||
return B_OK;
|
||||
|
||||
// create the node
|
||||
ValueNode* valueNode;
|
||||
status_t error;
|
||||
if (nodeChild->IsInternal()) {
|
||||
error = nodeChild->CreateInternalNode(valueNode);
|
||||
} else {
|
||||
error = TypeHandlerRoster::Default()->CreateValueNode(nodeChild,
|
||||
nodeChild->GetType(), valueNode);
|
||||
}
|
||||
|
||||
if (error != B_OK)
|
||||
return error;
|
||||
|
||||
nodeChild->SetNode(valueNode);
|
||||
valueNode->ReleaseReference();
|
||||
|
||||
return B_OK;
|
||||
}
|
||||
|
||||
|
||||
status_t
|
||||
VariablesView::VariableTableModel::_AddChildNodes(ValueNodeChild* nodeChild)
|
||||
{
|
||||
// create a value node for the value node child, if doesn't have one yet
|
||||
ValueNode* valueNode = nodeChild->Node();
|
||||
if (valueNode == NULL) {
|
||||
status_t error = _CreateValueNode(nodeChild);
|
||||
if (error != B_OK)
|
||||
return error;
|
||||
valueNode = nodeChild->Node();
|
||||
}
|
||||
|
||||
// check if this node requires child creation
|
||||
// to be deferred until after its location/value have been resolved
|
||||
if (valueNode->ChildCreationNeedsValue())
|
||||
return B_OK;
|
||||
|
||||
// create the children, if not done yet
|
||||
if (valueNode->ChildrenCreated())
|
||||
return B_OK;
|
||||
|
||||
return valueNode->CreateChildren();
|
||||
}
|
||||
|
||||
|
||||
//VariablesView::ModelNode*
|
||||
//VariablesView::VariableTableModel::_GetNode(Variable* variable,
|
||||
// TypeComponentPath* path) const
|
||||
//{
|
||||
// // find the variable node
|
||||
// ModelNode* node;
|
||||
// for (int32 i = 0; (node = fNodes.ItemAt(i)) != NULL; i++) {
|
||||
// if (node->GetVariable() == variable)
|
||||
// break;
|
||||
// }
|
||||
// if (node == NULL)
|
||||
// return NULL;
|
||||
//
|
||||
// // Now walk along the path, finding the respective child node for each
|
||||
// // component (might be several components at once).
|
||||
// int32 componentCount = path->CountComponents();
|
||||
// for (int32 i = 0; i < componentCount;) {
|
||||
// ModelNode* childNode = NULL;
|
||||
//
|
||||
// for (int32 k = 0; (childNode = node->ChildAt(k)) != NULL; k++) {
|
||||
// TypeComponentPath* childPath = childNode->Path();
|
||||
// int32 childComponentCount = childPath->CountComponents();
|
||||
// if (childComponentCount > componentCount)
|
||||
// continue;
|
||||
//
|
||||
// for (int32 componentIndex = i;
|
||||
// componentIndex < childComponentCount; componentIndex++) {
|
||||
// TypeComponent childComponent
|
||||
// = childPath->ComponentAt(componentIndex);
|
||||
// TypeComponent pathComponent
|
||||
// = path->ComponentAt(componentIndex);
|
||||
// if (childComponent != pathComponent) {
|
||||
// if (componentIndex + 1 == childComponentCount
|
||||
// && pathComponent.HasPrefix(childComponent)) {
|
||||
// // The last child component is a prefix of the
|
||||
// // corresponding path component. We consider this a
|
||||
// // match, but need to recheck the component with the
|
||||
// // next node level.
|
||||
// childComponentCount--;
|
||||
// break;
|
||||
// }
|
||||
//
|
||||
// // mismatch -- skip the child
|
||||
// childNode = NULL;
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// if (childNode != NULL) {
|
||||
// // got a match -- skip the matched children components
|
||||
// i = childComponentCount;
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// if (childNode == NULL)
|
||||
// return NULL;
|
||||
//
|
||||
// node = childNode;
|
||||
// }
|
||||
//
|
||||
// return node;
|
||||
//}
|
||||
|
||||
|
||||
bool
|
||||
VariablesView::VariableTableModel::GetTreePath(ModelNode* node,
|
||||
TreeTablePath& _path) const
|
||||
|
@ -11,6 +11,7 @@
|
||||
|
||||
#include <DateTime.h>
|
||||
#include <Path.h>
|
||||
#include <String.h>
|
||||
#include <Variant.h>
|
||||
|
||||
#include "FunctionInstance.h"
|
||||
@ -18,6 +19,9 @@
|
||||
#include "StackFrame.h"
|
||||
#include "Team.h"
|
||||
#include "Thread.h"
|
||||
#include "Type.h"
|
||||
#include "Value.h"
|
||||
#include "ValueNode.h"
|
||||
|
||||
|
||||
/*static*/ const char*
|
||||
@ -156,3 +160,68 @@ UiUtils::ReportNameForTeam(::Team* team, char* buffer, size_t bufferSize)
|
||||
return buffer;
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*static*/ void
|
||||
UiUtils::PrintValueNodeGraph(BString& _output, StackFrame* frame,
|
||||
ValueNodeChild* child, int32 indentLevel, int32 maxDepth)
|
||||
{
|
||||
_output.Append('\t', indentLevel);
|
||||
_output << child->Name();
|
||||
|
||||
ValueNode* node = child->Node();
|
||||
if (node == NULL) {
|
||||
_output << ": Unavailable\n";
|
||||
return;
|
||||
}
|
||||
|
||||
if (node->GetType()->Kind() != TYPE_COMPOUND) {
|
||||
_output << ": ";
|
||||
status_t resolutionState = node->LocationAndValueResolutionState();
|
||||
if (resolutionState == VALUE_NODE_UNRESOLVED)
|
||||
_output << "Unresolved";
|
||||
else if (resolutionState == B_OK) {
|
||||
Value* value = node->GetValue();
|
||||
if (value != NULL) {
|
||||
BString valueData;
|
||||
value->ToString(valueData);
|
||||
_output << valueData;
|
||||
} else
|
||||
_output << "Unavailable";
|
||||
} else
|
||||
_output << strerror(resolutionState);
|
||||
}
|
||||
|
||||
if (maxDepth == 0 || node->CountChildren() == 0) {
|
||||
_output << "\n";
|
||||
return;
|
||||
}
|
||||
|
||||
if (node->CountChildren() == 1
|
||||
&& node->GetType()->Kind() == TYPE_ADDRESS
|
||||
&& node->ChildAt(0)->GetType()->Kind() == TYPE_COMPOUND) {
|
||||
// for the case of a pointer to a compound type,
|
||||
// we want to hide the intervening compound node and print
|
||||
// the children directly.
|
||||
node = node->ChildAt(0)->Node();
|
||||
}
|
||||
|
||||
if (node != NULL) {
|
||||
_output << " {\n";
|
||||
|
||||
for (int32 i = 0; i < node->CountChildren(); i++) {
|
||||
// don't dump compound nodes if our depth limit won't allow
|
||||
// us to traverse into their children anyways, and the top
|
||||
// level node contains no data of intereest.
|
||||
if (node->ChildAt(i)->GetType()->Kind() != TYPE_COMPOUND
|
||||
|| maxDepth > 1) {
|
||||
PrintValueNodeGraph(_output, frame, node->ChildAt(i),
|
||||
indentLevel + 1, maxDepth - 1);
|
||||
}
|
||||
}
|
||||
_output.Append('\t', indentLevel);
|
||||
_output << "}\n";
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
@ -10,10 +10,11 @@
|
||||
#include <image.h>
|
||||
|
||||
|
||||
class BString;
|
||||
class BVariant;
|
||||
class StackFrame;
|
||||
class Team;
|
||||
|
||||
class ValueNodeChild;
|
||||
|
||||
class UiUtils {
|
||||
public:
|
||||
@ -29,6 +30,13 @@ public:
|
||||
|
||||
static const char* ReportNameForTeam(::Team* team,
|
||||
char* buffer, size_t bufferSize);
|
||||
|
||||
// this function assumes the value nodes have already been resolved
|
||||
// (if possible).
|
||||
static void PrintValueNodeGraph(BString& _output,
|
||||
StackFrame* frame,
|
||||
ValueNodeChild* child,
|
||||
int32 indentLevel, int32 maxDepth);
|
||||
};
|
||||
|
||||
|
||||
|
@ -307,6 +307,9 @@ BListValueNode::CreateChildren()
|
||||
if (fChildrenCreated)
|
||||
return B_OK;
|
||||
|
||||
if (fLocationResolutionState != B_OK)
|
||||
return fLocationResolutionState;
|
||||
|
||||
if (fItemCountType != NULL) {
|
||||
BListItemCountNodeChild* countChild = new(std::nothrow)
|
||||
BListItemCountNodeChild(fItemCountLocation, this, fItemCountType);
|
||||
|
@ -183,66 +183,62 @@ BMessageValueNode::ResolvedLocationAndValue(ValueLoader* valueLoader,
|
||||
if (strcmp(member->Name(), "fHeader") == 0) {
|
||||
error = baseType->ResolveDataMemberLocation(member,
|
||||
*location, memberLocation);
|
||||
BReference<ValueLocation> locationRef(memberLocation, true);
|
||||
if (error != B_OK) {
|
||||
TRACE_LOCALS(
|
||||
"BMessageValueNode::ResolvedLocationAndValue(): "
|
||||
"failed to resolve location of header member: %s\n",
|
||||
strerror(error));
|
||||
delete memberLocation;
|
||||
return error;
|
||||
}
|
||||
|
||||
error = valueLoader->LoadValue(memberLocation, valueType,
|
||||
false, headerAddress);
|
||||
delete memberLocation;
|
||||
if (error != B_OK)
|
||||
return error;
|
||||
} else if (strcmp(member->Name(), "what") == 0) {
|
||||
error = baseType->ResolveDataMemberLocation(member,
|
||||
*location, memberLocation);
|
||||
BReference<ValueLocation> locationRef(memberLocation, true);
|
||||
if (error != B_OK) {
|
||||
TRACE_LOCALS(
|
||||
"BMessageValueNode::ResolvedLocationAndValue(): "
|
||||
"failed to resolve location of header member: %s\n",
|
||||
strerror(error));
|
||||
delete memberLocation;
|
||||
return error;
|
||||
}
|
||||
error = valueLoader->LoadValue(memberLocation, valueType,
|
||||
false, what);
|
||||
delete memberLocation;
|
||||
if (error != B_OK)
|
||||
return error;
|
||||
} else if (strcmp(member->Name(), "fFields") == 0) {
|
||||
error = baseType->ResolveDataMemberLocation(member,
|
||||
*location, memberLocation);
|
||||
BReference<ValueLocation> locationRef(memberLocation, true);
|
||||
if (error != B_OK) {
|
||||
TRACE_LOCALS(
|
||||
"BMessageValueNode::ResolvedLocationAndValue(): "
|
||||
"failed to resolve location of field member: %s\n",
|
||||
strerror(error));
|
||||
delete memberLocation;
|
||||
return error;
|
||||
}
|
||||
error = valueLoader->LoadValue(memberLocation, valueType,
|
||||
false, fieldAddress);
|
||||
delete memberLocation;
|
||||
if (error != B_OK)
|
||||
return error;
|
||||
} else if (strcmp(member->Name(), "fData") == 0) {
|
||||
error = baseType->ResolveDataMemberLocation(member,
|
||||
*location, memberLocation);
|
||||
BReference<ValueLocation> locationRef(memberLocation, true);
|
||||
if (error != B_OK) {
|
||||
TRACE_LOCALS(
|
||||
"BMessageValueNode::ResolvedLocationAndValue(): "
|
||||
"failed to resolve location of data member: %s\n",
|
||||
strerror(error));
|
||||
delete memberLocation;
|
||||
return error;
|
||||
}
|
||||
error = valueLoader->LoadValue(memberLocation, valueType,
|
||||
false, fDataLocation);
|
||||
delete memberLocation;
|
||||
if (error != B_OK)
|
||||
return error;
|
||||
}
|
||||
|
@ -84,6 +84,12 @@ CStringValueNode::ResolvedLocationAndValue(ValueLoader* valueLoader,
|
||||
ValuePieceLocation piece;
|
||||
piece.SetToMemory(addressData.ToUInt64());
|
||||
|
||||
error = valueLoader->LoadStringValue(addressData, maxSize, valueData);
|
||||
if (error != B_OK)
|
||||
return error;
|
||||
|
||||
piece.size = valueData.Length();
|
||||
|
||||
ValueLocation* stringLocation = new(std::nothrow) ValueLocation(
|
||||
valueLoader->GetArchitecture()->IsBigEndian(), piece);
|
||||
|
||||
|
@ -21,6 +21,8 @@ public:
|
||||
virtual Type* GetType() const;
|
||||
virtual ValueNode* Parent() const;
|
||||
|
||||
Variable* GetVariable() const { return fVariable; };
|
||||
|
||||
virtual status_t ResolveLocation(ValueLoader* valueLoader,
|
||||
ValueLocation*& _location);
|
||||
|
||||
|
@ -43,6 +43,8 @@ const uint32 MSG_SOURCETEXT = 'mSTX';
|
||||
const uint32 MSG_DESTTEXT = 'mDTX';
|
||||
const uint32 MSG_SHOWCONTENTS = 'mSCT';
|
||||
|
||||
const int32 MAX_STATUS_LENGTH = 35;
|
||||
|
||||
|
||||
#undef B_TRANSLATION_CONTEXT
|
||||
#define B_TRANSLATION_CONTEXT "ExpanderWindow"
|
||||
@ -92,6 +94,12 @@ ExpanderWindow::ExpanderWindow(BRect frame, const entry_ref* ref,
|
||||
BScrollView* scrollView = new BScrollView("", fListingText,
|
||||
B_INVALIDATE_AFTER_LAYOUT, true, true);
|
||||
|
||||
// workaround to let the layout manager estimate
|
||||
// the width of status view and fix the #5289
|
||||
// we assume that spaces are twice narrower than normal chars
|
||||
BString statusPlaceholderString;
|
||||
statusPlaceholderString.SetTo(' ', MAX_STATUS_LENGTH * 2);
|
||||
|
||||
BView* topView = layout->View();
|
||||
const float spacing = be_control_look->DefaultItemSpacing();
|
||||
topView->AddChild(BGroupLayoutBuilder(B_VERTICAL, spacing)
|
||||
@ -110,7 +118,8 @@ ExpanderWindow::ExpanderWindow(BRect frame, const entry_ref* ref,
|
||||
.Add(fShowContents = new BCheckBox(
|
||||
B_TRANSLATE("Show contents"),
|
||||
new BMessage(MSG_SHOWCONTENTS)))
|
||||
.Add(fStatusView = new BStringView(NULL, NULL))
|
||||
.Add(fStatusView = new BStringView(NULL,
|
||||
statusPlaceholderString))
|
||||
.End()
|
||||
.End()
|
||||
.End()
|
||||
@ -412,7 +421,7 @@ ExpanderWindow::MessageReceived(BMessage* msg)
|
||||
// thread has finished (finished, quit, killed, we don't know)
|
||||
// reset window state
|
||||
if (fExpandingStarted) {
|
||||
fStatusView->SetText(B_TRANSLATE("File expanded"));
|
||||
SetStatus(B_TRANSLATE("File expanded"));
|
||||
StopExpanding();
|
||||
OpenDestFolder();
|
||||
CloseWindowOrKeepOpen();
|
||||
@ -421,13 +430,13 @@ ExpanderWindow::MessageReceived(BMessage* msg)
|
||||
StopListing();
|
||||
_ExpandListingText();
|
||||
} else
|
||||
fStatusView->SetText("");
|
||||
SetStatus("");
|
||||
break;
|
||||
|
||||
case 'exrr': // thread has finished
|
||||
// reset window state
|
||||
|
||||
fStatusView->SetText(B_TRANSLATE("Error when expanding archive"));
|
||||
SetStatus(B_TRANSLATE("Error when expanding archive"));
|
||||
CloseWindowOrKeepOpen();
|
||||
break;
|
||||
|
||||
@ -614,7 +623,7 @@ ExpanderWindow::StartExpanding()
|
||||
BPath path(&entry);
|
||||
BString text(B_TRANSLATE("Expanding '%s'"));
|
||||
text.ReplaceFirst("%s", path.Leaf());
|
||||
fStatusView->SetText(text.String());
|
||||
SetStatus(text.String());
|
||||
|
||||
fExpandingThread = new ExpanderThread(&message, new BMessenger(this));
|
||||
fExpandingThread->Start();
|
||||
@ -713,6 +722,18 @@ ExpanderWindow::_UpdateWindowSize(bool showContents)
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
ExpanderWindow::SetStatus(BString text)
|
||||
{
|
||||
if (text.Length() >= MAX_STATUS_LENGTH) {
|
||||
text.Truncate(MAX_STATUS_LENGTH - 1);
|
||||
text << B_UTF8_ELLIPSIS;
|
||||
}
|
||||
|
||||
fStatusView->SetText(text);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
ExpanderWindow::StartListing()
|
||||
{
|
||||
@ -750,7 +771,7 @@ ExpanderWindow::StartListing()
|
||||
BPath path(&entry);
|
||||
BString text(B_TRANSLATE("Creating listing for '%s'"));
|
||||
text.ReplaceFirst("%s", path.Leaf());
|
||||
fStatusView->SetText(text.String());
|
||||
SetStatus(text.String());
|
||||
fListingText->SetText("");
|
||||
|
||||
fListingThread = new ExpanderThread(&message, new BMessenger(this));
|
||||
@ -781,7 +802,7 @@ ExpanderWindow::StopListing(void)
|
||||
fSourceButton->SetEnabled(true);
|
||||
fDestButton->SetEnabled(true);
|
||||
fExpandButton->SetEnabled(true);
|
||||
fStatusView->SetText("");
|
||||
SetStatus("");
|
||||
}
|
||||
|
||||
|
||||
|
@ -54,6 +54,7 @@ private:
|
||||
void _ExpandListingText();
|
||||
void StartListing();
|
||||
void StopListing();
|
||||
void SetStatus(BString text);
|
||||
bool ValidateDest();
|
||||
|
||||
private:
|
||||
|
@ -145,11 +145,13 @@ App::_StoreSettingsIfNeeded()
|
||||
BMessage settings('sett');
|
||||
for (int32 i = 0; BWindow* window = WindowAt(i); i++) {
|
||||
if (MainWindow* padWindow = dynamic_cast<MainWindow*>(window)) {
|
||||
BMessage* windowSettings = padWindow->Settings();
|
||||
if (windowSettings && padWindow->Lock()) {
|
||||
padWindow->SaveSettings(windowSettings);
|
||||
if (padWindow->Lock()) {
|
||||
BMessage* windowSettings = padWindow->Settings();
|
||||
if (windowSettings) {
|
||||
padWindow->SaveSettings(windowSettings);
|
||||
settings.AddMessage("window", windowSettings);
|
||||
}
|
||||
padWindow->Unlock();
|
||||
settings.AddMessage("window", windowSettings);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -90,19 +90,21 @@ MainWindow::QuitRequested()
|
||||
if (dynamic_cast<MainWindow*>(window))
|
||||
padWindowCount++;
|
||||
}
|
||||
bool canClose = true;
|
||||
|
||||
if (padWindowCount == 1) {
|
||||
be_app->PostMessage(B_QUIT_REQUESTED);
|
||||
return false;
|
||||
canClose = false;
|
||||
} else {
|
||||
BAlert* alert = new BAlert(B_TRANSLATE("last chance"),
|
||||
B_TRANSLATE("Really close this pad?\n"
|
||||
"(The pad will not be remembered.)"),
|
||||
"(The pad will not be remembered.)"),
|
||||
B_TRANSLATE("Close"), B_TRANSLATE("Cancel"), NULL);
|
||||
alert->SetShortcut(1, B_ESCAPE);
|
||||
if (alert->Go() == 1)
|
||||
return false;
|
||||
canClose = false;
|
||||
}
|
||||
return true;
|
||||
return canClose;
|
||||
}
|
||||
|
||||
|
||||
|
@ -1691,6 +1691,8 @@ TMailWindow::QuitRequested()
|
||||
|| strlen(fHeaderView->fSubject->Text())
|
||||
|| (fHeaderView->fCc && strlen(fHeaderView->fCc->Text()))
|
||||
|| (fHeaderView->fBcc && strlen(fHeaderView->fBcc->Text()))
|
||||
|| (fContentView->fTextView
|
||||
&& strlen(fContentView->fTextView->Text()))
|
||||
|| (fEnclosuresView != NULL
|
||||
&& fEnclosuresView->fList->CountItems()))) {
|
||||
if (fResending) {
|
||||
@ -2548,15 +2550,16 @@ TMailWindow::SaveAsDraft()
|
||||
return status;
|
||||
case B_OK:
|
||||
{
|
||||
char fileName[512], *eofn;
|
||||
int32 i;
|
||||
|
||||
char fileName[B_FILE_NAME_LENGTH];
|
||||
// save as some version of the message's subject
|
||||
strncpy(fileName, fHeaderView->fSubject->Text(),
|
||||
sizeof(fileName)-10);
|
||||
fileName[sizeof(fileName)-10]='\0';
|
||||
// terminate like strncpy doesn't
|
||||
eofn = fileName + strlen(fileName);
|
||||
if (strlen(fHeaderView->fSubject->Text()) == 0)
|
||||
strlcpy(fileName, B_TRANSLATE("Untitled"),
|
||||
sizeof(fileName));
|
||||
else
|
||||
strlcpy(fileName, fHeaderView->fSubject->Text(),
|
||||
sizeof(fileName));
|
||||
|
||||
uint32 originalLength = strlen(fileName);
|
||||
|
||||
// convert /, \ and : to -
|
||||
for (char *bad = fileName; (bad = strchr(bad, '/')) != NULL;
|
||||
@ -2568,12 +2571,19 @@ TMailWindow::SaveAsDraft()
|
||||
|
||||
// Create the file; if the name exists, find a unique name
|
||||
flags = B_WRITE_ONLY | B_CREATE_FILE | B_FAIL_IF_EXISTS;
|
||||
for (i = 1; (status = draft.SetTo(&dir, fileName, flags))
|
||||
!= B_OK; i++) {
|
||||
if (status != B_FILE_EXISTS)
|
||||
return status;
|
||||
sprintf(eofn, "%ld", i);
|
||||
}
|
||||
int32 i = 1;
|
||||
do {
|
||||
status = draft.SetTo(&dir, fileName, flags);
|
||||
if (status == B_OK)
|
||||
break;
|
||||
char appendix[B_FILE_NAME_LENGTH];
|
||||
sprintf(appendix, " %ld", i++);
|
||||
int32 pos = min_c(sizeof(fileName) - strlen(appendix),
|
||||
originalLength);
|
||||
sprintf(fileName + pos, "%s", appendix);
|
||||
} while (status == B_FILE_EXISTS);
|
||||
if (status != B_OK)
|
||||
return status;
|
||||
|
||||
// Cache the ref
|
||||
if (fRef == NULL)
|
||||
@ -2645,6 +2655,8 @@ TMailWindow::SaveAsDraft()
|
||||
fDraft = true;
|
||||
fChanged = false;
|
||||
|
||||
fSaveButton->SetEnabled(false);
|
||||
|
||||
return B_OK;
|
||||
}
|
||||
|
||||
|
@ -2713,6 +2713,7 @@ ls( httpd_conn* hc )
|
||||
send_mime(
|
||||
hc, 200, ok200title, "", "", "text/html; charset=%s", (off_t) -1,
|
||||
hc->sb.st_mtime );
|
||||
free(de);
|
||||
}
|
||||
else if ( hc->method == METHOD_GET )
|
||||
{
|
||||
@ -2947,7 +2948,6 @@ ls( httpd_conn* hc )
|
||||
free(de);
|
||||
return -1;
|
||||
}
|
||||
free(de);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -25,7 +25,7 @@ const uint32 MENU_NEW = 'MFnw';
|
||||
const uint32 MENU_OPEN = 'MFop';
|
||||
const uint32 MENU_SAVE = 'MSav';
|
||||
const uint32 MENU_SAVEAS = 'MEsa';
|
||||
const uint32 MENU_REVERT = 'MFre';
|
||||
const uint32 MENU_RELOAD = 'MFrl';
|
||||
const uint32 MENU_CLOSE = 'MFcl';
|
||||
const uint32 MENU_PAGESETUP = 'MFps';
|
||||
const uint32 MENU_PRINT = 'MFpr';
|
||||
|
@ -73,8 +73,11 @@ StyledEditView::SetSuppressChanges(bool suppressChanges)
|
||||
|
||||
|
||||
status_t
|
||||
StyledEditView::GetStyledText(BPositionIO* stream)
|
||||
StyledEditView::GetStyledText(BPositionIO* stream, const char* forceEncoding)
|
||||
{
|
||||
if (forceEncoding != NULL)
|
||||
fEncoding = strcmp(forceEncoding, "auto") != 0 ? forceEncoding : "";
|
||||
|
||||
fSuppressChanges = true;
|
||||
status_t result = BTranslationUtils::GetStyledText(stream, this,
|
||||
fEncoding.String());
|
||||
@ -85,24 +88,25 @@ StyledEditView::GetStyledText(BPositionIO* stream)
|
||||
|
||||
BNode* node = dynamic_cast<BNode*>(stream);
|
||||
if (node != NULL) {
|
||||
// get encoding
|
||||
if (node->ReadAttrString("be:encoding", &fEncoding) != B_OK) {
|
||||
// try to read as "int32"
|
||||
int32 encoding;
|
||||
ssize_t bytesRead = node->ReadAttr("be:encoding", B_INT32_TYPE, 0,
|
||||
&encoding, sizeof(encoding));
|
||||
if (bytesRead == (ssize_t)sizeof(encoding)) {
|
||||
if (encoding == 65535) {
|
||||
fEncoding = "UTF-8";
|
||||
} else {
|
||||
const BCharacterSet* characterSet
|
||||
= BCharacterSetRoster::GetCharacterSetByConversionID(encoding);
|
||||
if (characterSet != NULL)
|
||||
fEncoding = characterSet->GetName();
|
||||
if (forceEncoding == NULL) {
|
||||
// get encoding
|
||||
if (node->ReadAttrString("be:encoding", &fEncoding) != B_OK) {
|
||||
// try to read as "int32"
|
||||
int32 encoding;
|
||||
ssize_t bytesRead = node->ReadAttr("be:encoding", B_INT32_TYPE, 0,
|
||||
&encoding, sizeof(encoding));
|
||||
if (bytesRead == (ssize_t)sizeof(encoding)) {
|
||||
if (encoding == 65535) {
|
||||
fEncoding = "UTF-8";
|
||||
} else {
|
||||
const BCharacterSet* characterSet
|
||||
= BCharacterSetRoster::GetCharacterSetByConversionID(encoding);
|
||||
if (characterSet != NULL)
|
||||
fEncoding = characterSet->GetName();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: move those into BTranslationUtils::GetStyledText() as well?
|
||||
|
||||
// restore alignment
|
||||
|
@ -34,7 +34,8 @@ class StyledEditView : public BTextView {
|
||||
|
||||
void Reset();
|
||||
void SetSuppressChanges(bool suppressChanges);
|
||||
status_t GetStyledText(BPositionIO* stream);
|
||||
status_t GetStyledText(BPositionIO* stream,
|
||||
const char* forceEncoding = NULL);
|
||||
status_t WriteStyledEditFile(BFile* file);
|
||||
|
||||
void SetEncoding(uint32 encoding);
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2010, Haiku, Inc. All Rights Reserved.
|
||||
* Copyright 2002-2012, Haiku, Inc. All Rights Reserved.
|
||||
* Distributed under the terms of the MIT License.
|
||||
*
|
||||
* Authors:
|
||||
@ -8,6 +8,8 @@
|
||||
* Philippe Saint-Pierre
|
||||
* Jonas Sundström
|
||||
* Ryan Leavengood
|
||||
* Vlad Slepukhin
|
||||
* Sarzhuk Zharski
|
||||
*/
|
||||
|
||||
|
||||
@ -33,6 +35,7 @@
|
||||
#include <Menu.h>
|
||||
#include <MenuBar.h>
|
||||
#include <MenuItem.h>
|
||||
#include <NodeMonitor.h>
|
||||
#include <Path.h>
|
||||
#include <PrintJob.h>
|
||||
#include <Rect.h>
|
||||
@ -107,6 +110,8 @@ StyledEditWindow::~StyledEditWindow()
|
||||
void
|
||||
StyledEditWindow::Quit()
|
||||
{
|
||||
_SwitchNodeMonitor(false);
|
||||
|
||||
_SaveAttrs();
|
||||
if (StyledEditApp* app = dynamic_cast<StyledEditApp*>(be_app))
|
||||
app->CloseDocument();
|
||||
@ -124,6 +129,9 @@ StyledEditWindow::QuitRequested()
|
||||
if (fClean)
|
||||
return true;
|
||||
|
||||
if (fTextView->TextLength() == 0 && fSaveMessage == NULL)
|
||||
return true;
|
||||
|
||||
BString alertText;
|
||||
bs_printf(&alertText,
|
||||
B_TRANSLATE("Save changes to the document \"%s\"? "), Title());
|
||||
@ -179,8 +187,8 @@ StyledEditWindow::MessageReceived(BMessage* message)
|
||||
Quit();
|
||||
break;
|
||||
|
||||
case MENU_REVERT:
|
||||
_RevertToSaved();
|
||||
case MENU_RELOAD:
|
||||
_ReloadDocument(message);
|
||||
break;
|
||||
|
||||
case MENU_CLOSE:
|
||||
@ -294,6 +302,10 @@ StyledEditWindow::MessageReceived(BMessage* message)
|
||||
break;
|
||||
}
|
||||
|
||||
case B_NODE_MONITOR:
|
||||
_HandleNodeMonitorEvent(message);
|
||||
break;
|
||||
|
||||
// Font menu
|
||||
|
||||
case FONT_SIZE:
|
||||
@ -485,12 +497,12 @@ StyledEditWindow::MessageReceived(BMessage* message)
|
||||
fRedoFlag = false;
|
||||
}
|
||||
if (fClean) {
|
||||
fRevertItem->SetEnabled(false);
|
||||
fSaveItem->SetEnabled(fSaveMessage == NULL);
|
||||
} else {
|
||||
fRevertItem->SetEnabled(fSaveMessage != NULL);
|
||||
fSaveItem->SetEnabled(true);
|
||||
}
|
||||
fReloadItem->SetEnabled(fSaveMessage != NULL);
|
||||
fEncodingItem->SetEnabled(fSaveMessage != NULL);
|
||||
break;
|
||||
|
||||
case SAVE_AS_ENCODING:
|
||||
@ -646,6 +658,21 @@ StyledEditWindow::MenusBeginning()
|
||||
fAlignRight->SetMarked(true);
|
||||
break;
|
||||
}
|
||||
|
||||
// text encoding
|
||||
const BCharacterSet* charset
|
||||
= BCharacterSetRoster::GetCharacterSetByFontID(fTextView->GetEncoding());
|
||||
BMenu* encodingMenu = fEncodingItem->Submenu();
|
||||
if (charset != NULL && encodingMenu != NULL) {
|
||||
const char* mime = charset->GetMIMEName();
|
||||
BString name(charset->GetPrintName());
|
||||
if (mime)
|
||||
name << " (" << mime << ")";
|
||||
|
||||
BMenuItem* item = encodingMenu->FindItem(name);
|
||||
if (item != NULL)
|
||||
item->SetMarked(true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -656,6 +683,8 @@ StyledEditWindow::MenusBeginning()
|
||||
status_t
|
||||
StyledEditWindow::Save(BMessage* message)
|
||||
{
|
||||
_NodeMonitorSuspender nodeMonitorSuspender(this);
|
||||
|
||||
if (!message)
|
||||
message = fSaveMessage;
|
||||
|
||||
@ -722,10 +751,11 @@ StyledEditWindow::Save(BMessage* message)
|
||||
|
||||
// clear clean modes
|
||||
fSaveItem->SetEnabled(false);
|
||||
fRevertItem->SetEnabled(false);
|
||||
fUndoCleans = false;
|
||||
fRedoCleans = false;
|
||||
fClean = true;
|
||||
fNagOnNodeChange = true;
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
@ -811,6 +841,11 @@ StyledEditWindow::OpenFile(entry_ref* ref)
|
||||
|
||||
_LoadAttrs();
|
||||
}
|
||||
|
||||
_SwitchNodeMonitor(true, ref);
|
||||
|
||||
fReloadItem->SetEnabled(fSaveMessage != NULL);
|
||||
fEncodingItem->SetEnabled(fSaveMessage != NULL);
|
||||
fTextView->Select(0, 0);
|
||||
}
|
||||
|
||||
@ -841,7 +876,7 @@ StyledEditWindow::Print(const char* documentName)
|
||||
printJob.SetSettings(new BMessage(*fPrintSettings));
|
||||
|
||||
if (printJob.ConfigJob() != B_OK)
|
||||
return;
|
||||
return;
|
||||
|
||||
delete fPrintSettings;
|
||||
fPrintSettings = printJob.Settings();
|
||||
@ -890,7 +925,9 @@ StyledEditWindow::Print(const char* documentName)
|
||||
while (printLine <= lastLine) {
|
||||
float currentHeight = 0;
|
||||
int32 firstLineOnPage = printLine;
|
||||
while (currentHeight < printableRect.Height() && printLine <= lastLine) {
|
||||
while (currentHeight < printableRect.Height()
|
||||
&& printLine <= lastLine)
|
||||
{
|
||||
currentHeight += fTextView->LineHeight(printLine);
|
||||
if (currentHeight < printableRect.Height())
|
||||
printLine++;
|
||||
@ -993,6 +1030,8 @@ StyledEditWindow::_InitWindow(uint32 encoding)
|
||||
fWrapAround = false;
|
||||
fBackSearch = false;
|
||||
|
||||
fNagOnNodeChange = true;
|
||||
|
||||
// add menubar
|
||||
fMenuBar = new BMenuBar(BRect(0, 0, 0, 0), "menubar");
|
||||
AddChild(fMenuBar);
|
||||
@ -1043,10 +1082,11 @@ StyledEditWindow::_InitWindow(uint32 encoding)
|
||||
menuItem->SetShortcut('S', B_SHIFT_KEY);
|
||||
menuItem->SetEnabled(true);
|
||||
|
||||
menu->AddItem(fRevertItem
|
||||
= new BMenuItem(B_TRANSLATE("Revert to saved" B_UTF8_ELLIPSIS),
|
||||
new BMessage(MENU_REVERT)));
|
||||
fRevertItem->SetEnabled(false);
|
||||
menu->AddItem(fReloadItem
|
||||
= new BMenuItem(B_TRANSLATE("Reload" B_UTF8_ELLIPSIS),
|
||||
new BMessage(MENU_RELOAD), 'L'));
|
||||
fReloadItem->SetEnabled(false);
|
||||
|
||||
menu->AddItem(new BMenuItem(B_TRANSLATE("Close"),
|
||||
new BMessage(MENU_CLOSE), 'W'));
|
||||
|
||||
@ -1107,7 +1147,7 @@ StyledEditWindow::_InitWindow(uint32 encoding)
|
||||
fFontMenu = new BMenu(B_TRANSLATE("Font"));
|
||||
fMenuBar->AddItem(fFontMenu);
|
||||
|
||||
//"Size"-subMenu
|
||||
// "Size"-subMenu
|
||||
fFontSizeMenu = new BMenu(B_TRANSLATE("Size"));
|
||||
fFontSizeMenu->SetRadioMode(true);
|
||||
fFontMenu->AddItem(fFontSizeMenu);
|
||||
@ -1210,6 +1250,9 @@ StyledEditWindow::_InitWindow(uint32 encoding)
|
||||
fWrapItem->SetMarked(true);
|
||||
fWrapItem->SetShortcut('W', B_OPTION_KEY);
|
||||
|
||||
menu->AddItem(fEncodingItem = _MakeEncodingMenuItem());
|
||||
fEncodingItem->SetEnabled(false);
|
||||
|
||||
menu->AddSeparatorItem();
|
||||
menu->AddItem(new BMenuItem(B_TRANSLATE("Statistics" B_UTF8_ELLIPSIS),
|
||||
new BMessage(SHOW_STATISTICS)));
|
||||
@ -1286,7 +1329,7 @@ StyledEditWindow::_SaveAttrs()
|
||||
|
||||
|
||||
status_t
|
||||
StyledEditWindow::_LoadFile(entry_ref* ref)
|
||||
StyledEditWindow::_LoadFile(entry_ref* ref, const char* forceEncoding)
|
||||
{
|
||||
BEntry entry(ref, true);
|
||||
// traverse an eventual link
|
||||
@ -1299,7 +1342,7 @@ StyledEditWindow::_LoadFile(entry_ref* ref)
|
||||
if (status == B_OK)
|
||||
status = file.SetTo(&entry, B_READ_ONLY);
|
||||
if (status == B_OK)
|
||||
status = fTextView->GetStyledText(&file);
|
||||
status = fTextView->GetStyledText(&file, forceEncoding);
|
||||
|
||||
if (status == B_ENTRY_NOT_FOUND) {
|
||||
// Treat non-existing files consideratley; we just want to get an
|
||||
@ -1351,11 +1394,14 @@ StyledEditWindow::_LoadFile(entry_ref* ref)
|
||||
|
||||
|
||||
void
|
||||
StyledEditWindow::_RevertToSaved()
|
||||
StyledEditWindow::_ReloadDocument(BMessage* message)
|
||||
{
|
||||
entry_ref ref;
|
||||
const char* name;
|
||||
|
||||
if (fSaveMessage == NULL || message == NULL)
|
||||
return;
|
||||
|
||||
fSaveMessage->FindRef("directory", &ref);
|
||||
fSaveMessage->FindString("name", &name);
|
||||
|
||||
@ -1376,15 +1422,40 @@ StyledEditWindow::_RevertToSaved()
|
||||
return;
|
||||
}
|
||||
|
||||
BString alertText;
|
||||
bs_printf(&alertText,
|
||||
B_TRANSLATE("Revert to the last version of \"%s\"? "), Title());
|
||||
if (_ShowAlert(alertText, B_TRANSLATE("Cancel"), B_TRANSLATE("OK"),
|
||||
"", B_WARNING_ALERT) != 1)
|
||||
return;
|
||||
if (!fClean) {
|
||||
BString alertText;
|
||||
bs_printf(&alertText,
|
||||
B_TRANSLATE("\"%s\" has unsaved changes.\n"
|
||||
"Revert it to the last saved version? "), Title());
|
||||
if (_ShowAlert(alertText, B_TRANSLATE("Cancel"), B_TRANSLATE("OK"),
|
||||
"", B_WARNING_ALERT) != 1)
|
||||
return;
|
||||
}
|
||||
|
||||
const char* forceEncoding = NULL;
|
||||
if (message->FindString("encoding", &forceEncoding) != B_OK) {
|
||||
const BCharacterSet* charset
|
||||
= BCharacterSetRoster::GetCharacterSetByFontID(
|
||||
fTextView->GetEncoding());
|
||||
if (charset != NULL)
|
||||
forceEncoding = charset->GetName();
|
||||
}
|
||||
|
||||
BScrollBar* vertBar = fScrollView->ScrollBar(B_VERTICAL);
|
||||
float vertPos = vertBar != NULL ? vertBar->Value() : 0.f;
|
||||
|
||||
DisableUpdates();
|
||||
|
||||
fTextView->Reset();
|
||||
if (_LoadFile(&ref) != B_OK)
|
||||
|
||||
status = _LoadFile(&ref, forceEncoding);
|
||||
|
||||
if (vertBar != NULL)
|
||||
vertBar->SetValue(vertPos);
|
||||
|
||||
EnableUpdates();
|
||||
|
||||
if (status != B_OK)
|
||||
return;
|
||||
|
||||
#undef B_TRANSLATION_CONTEXT
|
||||
@ -1400,10 +1471,12 @@ StyledEditWindow::_RevertToSaved()
|
||||
|
||||
// clear clean modes
|
||||
fSaveItem->SetEnabled(false);
|
||||
fRevertItem->SetEnabled(false);
|
||||
|
||||
fUndoCleans = false;
|
||||
fRedoCleans = false;
|
||||
fClean = true;
|
||||
|
||||
fNagOnNodeChange = true;
|
||||
}
|
||||
|
||||
|
||||
@ -1599,7 +1672,7 @@ StyledEditWindow::_SetFontStyle(const char* fontFamily, const char* fontStyle)
|
||||
|
||||
font.SetFace(face);
|
||||
|
||||
fTextView->SetFontAndColor(&font);
|
||||
fTextView->SetFontAndColor(&font, B_FONT_FAMILY_AND_STYLE);
|
||||
|
||||
BMenuItem* superItem;
|
||||
superItem = fFontMenu->FindItem(fontFamily);
|
||||
@ -1656,7 +1729,8 @@ StyledEditWindow::_UpdateCleanUndoRedoSaveRevert()
|
||||
fClean = false;
|
||||
fUndoCleans = false;
|
||||
fRedoCleans = false;
|
||||
fRevertItem->SetEnabled(fSaveMessage != NULL);
|
||||
fReloadItem->SetEnabled(fSaveMessage != NULL);
|
||||
fEncodingItem->SetEnabled(fSaveMessage != NULL);
|
||||
fSaveItem->SetEnabled(true);
|
||||
fUndoItem->SetLabel(B_TRANSLATE("Can't undo"));
|
||||
fUndoItem->SetEnabled(false);
|
||||
@ -1686,3 +1760,234 @@ StyledEditWindow::_ShowAlert(const BString& text, const BString& label,
|
||||
|
||||
return alert->Go();
|
||||
}
|
||||
|
||||
|
||||
BMenuItem*
|
||||
StyledEditWindow::_MakeEncodingMenuItem()
|
||||
{
|
||||
BMenu* menu = new BMenu(B_TRANSLATE("Text encoding"));
|
||||
|
||||
BCharacterSetRoster roster;
|
||||
BCharacterSet charset;
|
||||
while (roster.GetNextCharacterSet(&charset) == B_OK) {
|
||||
const char* mime = charset.GetMIMEName();
|
||||
BString name(charset.GetPrintName());
|
||||
|
||||
if (mime)
|
||||
name << " (" << mime << ")";
|
||||
|
||||
BMessage *message = new BMessage(MENU_RELOAD);
|
||||
if (message != NULL) {
|
||||
message->AddString("encoding", charset.GetName());
|
||||
menu->AddItem(new BMenuItem(name, message));
|
||||
}
|
||||
}
|
||||
|
||||
menu->AddSeparatorItem();
|
||||
BMessage *message = new BMessage(MENU_RELOAD);
|
||||
message->AddString("encoding", "auto");
|
||||
menu->AddItem(new BMenuItem(B_TRANSLATE("Autodetect"), message));
|
||||
|
||||
menu->SetRadioMode(true);
|
||||
|
||||
return new BMenuItem(menu, new BMessage(MENU_RELOAD));
|
||||
}
|
||||
|
||||
|
||||
#undef B_TRANSLATION_CONTEXT
|
||||
#define B_TRANSLATION_CONTEXT "NodeMonitorAlerts"
|
||||
|
||||
|
||||
void
|
||||
StyledEditWindow::_ShowNodeChangeAlert(const char* name, bool removed)
|
||||
{
|
||||
if (!fNagOnNodeChange)
|
||||
return;
|
||||
|
||||
BString alertText(removed ? B_TRANSLATE("File \"%file%\" was removed by "
|
||||
"another application, recover it?")
|
||||
: B_TRANSLATE("File \"%file%\" was modified by "
|
||||
"another application, reload it?"));
|
||||
alertText.ReplaceAll("%file%", name);
|
||||
|
||||
if (_ShowAlert(alertText, removed ? B_TRANSLATE("Recover")
|
||||
: B_TRANSLATE("Reload"), B_TRANSLATE("Ignore"), "",
|
||||
B_WARNING_ALERT) == 0)
|
||||
{
|
||||
if (!removed) {
|
||||
// supress the warning - user has already agreed
|
||||
fClean = true;
|
||||
BMessage msg(MENU_RELOAD);
|
||||
_ReloadDocument(&msg);
|
||||
} else
|
||||
Save();
|
||||
} else
|
||||
fNagOnNodeChange = false;
|
||||
|
||||
fSaveItem->SetEnabled(!fClean);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
StyledEditWindow::_HandleNodeMonitorEvent(BMessage *message)
|
||||
{
|
||||
int32 opcode = 0;
|
||||
if (message->FindInt32("opcode", &opcode) != B_OK)
|
||||
return;
|
||||
|
||||
if (opcode != B_ENTRY_CREATED
|
||||
&& message->FindInt64("node") != fNodeRef.node)
|
||||
// bypass foreign nodes' event
|
||||
return;
|
||||
|
||||
switch (opcode) {
|
||||
case B_STAT_CHANGED:
|
||||
{
|
||||
int32 fields = 0;
|
||||
if (message->FindInt32("fields", &fields) == B_OK
|
||||
&& (fields & (B_STAT_SIZE | B_STAT_MODIFICATION_TIME)) == 0)
|
||||
break;
|
||||
|
||||
const char* name = NULL;
|
||||
if (fSaveMessage->FindString("name", &name) != B_OK)
|
||||
break;
|
||||
|
||||
_ShowNodeChangeAlert(name, false);
|
||||
}
|
||||
break;
|
||||
|
||||
case B_ENTRY_MOVED:
|
||||
{
|
||||
int32 device = 0;
|
||||
int64 srcFolder = 0;
|
||||
int64 dstFolder = 0;
|
||||
const char* name = NULL;
|
||||
if (message->FindInt32("device", &device) != B_OK
|
||||
|| message->FindInt64("to directory", &dstFolder) != B_OK
|
||||
|| message->FindInt64("from directory", &srcFolder) != B_OK
|
||||
|| message->FindString("name", &name) != B_OK)
|
||||
break;
|
||||
|
||||
entry_ref newRef(device, dstFolder, name);
|
||||
BEntry entry(&newRef);
|
||||
|
||||
BEntry dirEntry;
|
||||
entry.GetParent(&dirEntry);
|
||||
|
||||
entry_ref ref;
|
||||
dirEntry.GetRef(&ref);
|
||||
fSaveMessage->ReplaceRef("directory", &ref);
|
||||
fSaveMessage->ReplaceString("name", name);
|
||||
|
||||
// store previous name - it may be useful in case
|
||||
// we have just moved to temporary copy of file (vim case)
|
||||
const char* sourceName = NULL;
|
||||
if (message->FindString("from name", &sourceName) == B_OK) {
|
||||
fSaveMessage->RemoveName("org.name");
|
||||
fSaveMessage->AddString("org.name", sourceName);
|
||||
fSaveMessage->RemoveName("move time");
|
||||
fSaveMessage->AddInt64("move time", system_time());
|
||||
}
|
||||
|
||||
SetTitle(name);
|
||||
be_roster->AddToRecentDocuments(&newRef, APP_SIGNATURE);
|
||||
|
||||
if (srcFolder != dstFolder) {
|
||||
_SwitchNodeMonitor(false);
|
||||
_SwitchNodeMonitor(true);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case B_ENTRY_REMOVED:
|
||||
{
|
||||
_SwitchNodeMonitor(false);
|
||||
|
||||
fClean = false;
|
||||
|
||||
// some editors like vim save files in following way:
|
||||
// 1) move t.txt -> t.txt~
|
||||
// 2) re-create t.txt and write data to it
|
||||
// 3) remove t.txt~
|
||||
// go to catch this case
|
||||
int32 device = 0;
|
||||
int64 directory = 0;
|
||||
BString orgName;
|
||||
if (fSaveMessage->FindString("org.name", &orgName) == B_OK
|
||||
&& message->FindInt32("device", &device) == B_OK
|
||||
&& message->FindInt64("directory", &directory) == B_OK)
|
||||
{
|
||||
// reuse the source name if it is not too old
|
||||
bigtime_t time = fSaveMessage->FindInt64("move time");
|
||||
if ((system_time() - time) < 1000000) {
|
||||
entry_ref ref(device, directory, orgName);
|
||||
BEntry entry(&ref);
|
||||
if (entry.InitCheck() == B_OK) {
|
||||
_SwitchNodeMonitor(true, &ref);
|
||||
}
|
||||
|
||||
fSaveMessage->ReplaceString("name", orgName);
|
||||
fSaveMessage->RemoveName("org.name");
|
||||
fSaveMessage->RemoveName("move time");
|
||||
|
||||
SetTitle(orgName);
|
||||
_ShowNodeChangeAlert(orgName, false);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
const char* name = NULL;
|
||||
if (message->FindString("name", &name) != B_OK
|
||||
&& fSaveMessage->FindString("name", &name) != B_OK)
|
||||
name = "Unknown";
|
||||
|
||||
_ShowNodeChangeAlert(name, true);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
StyledEditWindow::_SwitchNodeMonitor(bool on, entry_ref* ref)
|
||||
{
|
||||
if (!on) {
|
||||
watch_node(&fNodeRef, B_STOP_WATCHING, this);
|
||||
watch_node(&fFolderNodeRef, B_STOP_WATCHING, this);
|
||||
fNodeRef = node_ref();
|
||||
fFolderNodeRef = node_ref();
|
||||
return;
|
||||
}
|
||||
|
||||
BEntry entry, folderEntry;
|
||||
|
||||
if (ref != NULL) {
|
||||
entry.SetTo(ref, true);
|
||||
entry.GetParent(&folderEntry);
|
||||
|
||||
} else if (fSaveMessage != NULL) {
|
||||
entry_ref ref;
|
||||
const char* name = NULL;
|
||||
if (fSaveMessage->FindRef("directory", &ref) != B_OK
|
||||
|| fSaveMessage->FindString("name", &name) != B_OK)
|
||||
return;
|
||||
|
||||
BDirectory dir(&ref);
|
||||
entry.SetTo(&dir, name);
|
||||
folderEntry.SetTo(&ref);
|
||||
|
||||
} else
|
||||
return;
|
||||
|
||||
if (entry.InitCheck() != B_OK || folderEntry.InitCheck() != B_OK)
|
||||
return;
|
||||
|
||||
entry.GetNodeRef(&fNodeRef);
|
||||
folderEntry.GetNodeRef(&fFolderNodeRef);
|
||||
|
||||
watch_node(&fNodeRef, B_WATCH_STAT, this);
|
||||
watch_node(&fFolderNodeRef, B_WATCH_DIRECTORY, this);
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2010, Haiku, Inc. All Rights Reserved.
|
||||
* Copyright 2002-2012, Haiku, Inc. All Rights Reserved.
|
||||
* Distributed under the terms of the MIT License.
|
||||
*
|
||||
* Authors:
|
||||
@ -15,15 +15,15 @@
|
||||
#include <Window.h>
|
||||
#include <String.h>
|
||||
#include <Message.h>
|
||||
|
||||
#include <Node.h>
|
||||
|
||||
struct entry_ref;
|
||||
|
||||
class BFilePanel;
|
||||
class BMenu;
|
||||
class BMessage;
|
||||
class BMenuBar;
|
||||
class BMenuItem;
|
||||
class BFilePanel;
|
||||
class BMessage;
|
||||
class BScrollView;
|
||||
class StyledEditView;
|
||||
|
||||
@ -52,10 +52,12 @@ public:
|
||||
|
||||
private:
|
||||
void _InitWindow(uint32 encoding = 0);
|
||||
BMenuItem* _MakeEncodingMenuItem();
|
||||
void _LoadAttrs();
|
||||
void _SaveAttrs();
|
||||
status_t _LoadFile(entry_ref* ref);
|
||||
void _RevertToSaved();
|
||||
status_t _LoadFile(entry_ref* ref,
|
||||
const char* forceEncoding = NULL);
|
||||
void _ReloadDocument(BMessage *message);
|
||||
bool _Search(BString searchFor, bool caseSensitive,
|
||||
bool wrap, bool backSearch,
|
||||
bool scrollToOccurence = true);
|
||||
@ -76,6 +78,27 @@ private:
|
||||
const BString& label3,
|
||||
alert_type type) const;
|
||||
|
||||
// node monitoring helper
|
||||
class _NodeMonitorSuspender {
|
||||
StyledEditWindow *fWindow;
|
||||
public:
|
||||
_NodeMonitorSuspender(StyledEditWindow *w) : fWindow(w) {
|
||||
fWindow->_SwitchNodeMonitor(false);
|
||||
}
|
||||
|
||||
~_NodeMonitorSuspender() {
|
||||
fWindow->_SwitchNodeMonitor(true);
|
||||
}
|
||||
};
|
||||
|
||||
friend class _NodeMonitorSuspender;
|
||||
|
||||
void _HandleNodeMonitorEvent(BMessage *message);
|
||||
void _ShowNodeChangeAlert(const char* name,
|
||||
bool removed);
|
||||
void _SwitchNodeMonitor(bool on,
|
||||
entry_ref* ref = NULL);
|
||||
|
||||
private:
|
||||
BMenuBar* fMenuBar;
|
||||
BMessage* fPrintSettings;
|
||||
@ -89,7 +112,7 @@ private:
|
||||
BMenuItem* fCurrentStyleItem;
|
||||
|
||||
BMenuItem* fSaveItem;
|
||||
BMenuItem* fRevertItem;
|
||||
BMenuItem* fReloadItem;
|
||||
|
||||
BMenuItem* fUndoItem;
|
||||
BMenuItem* fCutItem;
|
||||
@ -113,6 +136,7 @@ private:
|
||||
BMenuItem* fAlignLeft;
|
||||
BMenuItem* fAlignCenter;
|
||||
BMenuItem* fAlignRight;
|
||||
BMenuItem* fEncodingItem;
|
||||
|
||||
BString fStringToFind;
|
||||
BString fReplaceString;
|
||||
@ -139,6 +163,10 @@ private:
|
||||
|
||||
BFilePanel* fSavePanel;
|
||||
BMenu* fSavePanelEncodingMenu;
|
||||
// node monitoring
|
||||
node_ref fNodeRef;
|
||||
node_ref fFolderNodeRef;
|
||||
bool fNagOnNodeChange;
|
||||
};
|
||||
|
||||
|
||||
|
@ -75,8 +75,8 @@ AppearancePrefView::AppearancePrefView(const char* name,
|
||||
const char* kColorTable[] = {
|
||||
B_TRANSLATE("Text"),
|
||||
B_TRANSLATE("Background"),
|
||||
B_TRANSLATE("Cursor text"),
|
||||
B_TRANSLATE("Cursor background"),
|
||||
B_TRANSLATE("Cursor"),
|
||||
B_TRANSLATE("Text under cursor"),
|
||||
B_TRANSLATE("Selected text"),
|
||||
B_TRANSLATE("Selected background"),
|
||||
NULL
|
||||
@ -93,12 +93,7 @@ AppearancePrefView::AppearancePrefView(const char* name,
|
||||
BMenu* fontMenu = _MakeFontMenu(MSG_HALF_FONT_CHANGED,
|
||||
PrefHandler::Default()->getString(PREF_HALF_FONT_FAMILY),
|
||||
PrefHandler::Default()->getString(PREF_HALF_FONT_STYLE));
|
||||
|
||||
BMenu* sizeMenu = _MakeSizeMenu(MSG_HALF_SIZE_CHANGED,
|
||||
PrefHandler::Default()->getInt32(PREF_HALF_FONT_SIZE));
|
||||
|
||||
fFont = new BMenuField(B_TRANSLATE("Font:"), fontMenu);
|
||||
fFontSize = new BMenuField(B_TRANSLATE("Size:"), sizeMenu);
|
||||
fFontField = new BMenuField(B_TRANSLATE("Font:"), fontMenu);
|
||||
|
||||
BPopUpMenu* schemesPopUp = _MakeColorSchemeMenu(MSG_COLOR_SCHEME_CHANGED,
|
||||
gPredefinedColorSchemes, gPredefinedColorSchemes[0]);
|
||||
@ -108,8 +103,7 @@ AppearancePrefView::AppearancePrefView(const char* name,
|
||||
BPopUpMenu* colorsPopUp = _MakeMenu(MSG_COLOR_FIELD_CHANGED, kColorTable,
|
||||
kColorTable[0]);
|
||||
|
||||
fColorField = new BMenuField(B_TRANSLATE("Color:"),
|
||||
colorsPopUp);
|
||||
fColorField = new BMenuField(B_TRANSLATE("Color:"), colorsPopUp);
|
||||
fColorField->SetEnabled(false);
|
||||
|
||||
fTabTitle = new BTextControl("tabTitle", B_TRANSLATE("Tab title:"), "",
|
||||
@ -135,14 +129,12 @@ AppearancePrefView::AppearancePrefView(const char* name,
|
||||
.Add(fTabTitle->CreateTextViewLayoutItem(), 1, 0)
|
||||
.Add(fWindowTitle->CreateLabelLayoutItem(), 0, 1)
|
||||
.Add(fWindowTitle->CreateTextViewLayoutItem(), 1, 1)
|
||||
.Add(fFont->CreateLabelLayoutItem(), 0, 2)
|
||||
.Add(fFont->CreateMenuBarLayoutItem(), 1, 2)
|
||||
.Add(fFontSize->CreateLabelLayoutItem(), 0, 3)
|
||||
.Add(fFontSize->CreateMenuBarLayoutItem(), 1, 3)
|
||||
.Add(fColorSchemeField->CreateLabelLayoutItem(), 0, 4)
|
||||
.Add(fColorSchemeField->CreateMenuBarLayoutItem(), 1, 4)
|
||||
.Add(fColorField->CreateLabelLayoutItem(), 0, 5)
|
||||
.Add(fColorField->CreateMenuBarLayoutItem(), 1, 5)
|
||||
.Add(fFontField->CreateLabelLayoutItem(), 0, 2)
|
||||
.Add(fFontField->CreateMenuBarLayoutItem(), 1, 2)
|
||||
.Add(fColorSchemeField->CreateLabelLayoutItem(), 0, 3)
|
||||
.Add(fColorSchemeField->CreateMenuBarLayoutItem(), 1, 3)
|
||||
.Add(fColorField->CreateLabelLayoutItem(), 0, 4)
|
||||
.Add(fColorField->CreateMenuBarLayoutItem(), 1, 4)
|
||||
.End()
|
||||
.AddGlue()
|
||||
.Add(fColorControl = new BColorControl(BPoint(10, 10),
|
||||
@ -152,8 +144,7 @@ AppearancePrefView::AppearancePrefView(const char* name,
|
||||
|
||||
fTabTitle->SetAlignment(B_ALIGN_RIGHT, B_ALIGN_LEFT);
|
||||
fWindowTitle->SetAlignment(B_ALIGN_RIGHT, B_ALIGN_LEFT);
|
||||
fFont->SetAlignment(B_ALIGN_RIGHT);
|
||||
fFontSize->SetAlignment(B_ALIGN_RIGHT);
|
||||
fFontField->SetAlignment(B_ALIGN_RIGHT);
|
||||
fColorField->SetAlignment(B_ALIGN_RIGHT);
|
||||
fColorSchemeField->SetAlignment(B_ALIGN_RIGHT);
|
||||
|
||||
@ -191,20 +182,23 @@ AppearancePrefView::GetPreferredSize(float* _width, float* _height)
|
||||
void
|
||||
AppearancePrefView::Revert()
|
||||
{
|
||||
fTabTitle->SetText(PrefHandler::Default()->getString(PREF_TAB_TITLE));
|
||||
fWindowTitle->SetText(PrefHandler::Default()->getString(PREF_WINDOW_TITLE));
|
||||
PrefHandler* pref = PrefHandler::Default();
|
||||
|
||||
fWarnOnExit->SetValue(PrefHandler::Default()->getBool(
|
||||
fTabTitle->SetText(pref->getString(PREF_TAB_TITLE));
|
||||
fWindowTitle->SetText(pref->getString(PREF_WINDOW_TITLE));
|
||||
|
||||
fWarnOnExit->SetValue(pref->getBool(
|
||||
PREF_WARN_ON_EXIT));
|
||||
|
||||
fColorSchemeField->Menu()->ItemAt(0)->SetMarked(true);
|
||||
fColorControl->SetValue(PrefHandler::Default()->
|
||||
fColorControl->SetValue(pref->
|
||||
getRGB(PREF_TEXT_FORE_COLOR));
|
||||
|
||||
fFont->Menu()->FindItem(PrefHandler::Default()->getString(
|
||||
PREF_HALF_FONT_FAMILY))->SetMarked(true);
|
||||
fFontSize->Menu()->FindItem(PrefHandler::Default()->getString(
|
||||
PREF_HALF_FONT_FAMILY))->SetMarked(true);
|
||||
const char* family = pref->getString(PREF_HALF_FONT_FAMILY);
|
||||
const char* style = pref->getString(PREF_HALF_FONT_STYLE);
|
||||
const char* size = pref->getString(PREF_HALF_FONT_SIZE);
|
||||
|
||||
_MarkSelectedFont(family, style, size);
|
||||
}
|
||||
|
||||
|
||||
@ -216,8 +210,14 @@ AppearancePrefView::AttachedToWindow()
|
||||
fBlinkCursor->SetTarget(this);
|
||||
fWarnOnExit->SetTarget(this);
|
||||
|
||||
fFontSize->Menu()->SetTargetForItems(this);
|
||||
fFont->Menu()->SetTargetForItems(this);
|
||||
fFontField->Menu()->SetTargetForItems(this);
|
||||
for (int32 i = 0; i < fFontField->Menu()->CountItems(); i++) {
|
||||
BMenu* fontSizeMenu = fFontField->Menu()->SubmenuAt(i);
|
||||
if (fontSizeMenu == NULL)
|
||||
continue;
|
||||
|
||||
fontSizeMenu->SetTargetForItems(this);
|
||||
}
|
||||
|
||||
fColorControl->SetTarget(this);
|
||||
fColorField->Menu()->SetTargetForItems(this);
|
||||
@ -233,6 +233,7 @@ AppearancePrefView::AttachedToWindow()
|
||||
|
||||
|
||||
void
|
||||
|
||||
AppearancePrefView::MessageReceived(BMessage* msg)
|
||||
{
|
||||
bool modified = false;
|
||||
@ -242,51 +243,51 @@ AppearancePrefView::MessageReceived(BMessage* msg)
|
||||
{
|
||||
const char* family = NULL;
|
||||
const char* style = NULL;
|
||||
msg->FindString("font_family", &family);
|
||||
msg->FindString("font_style", &style);
|
||||
const char* size = NULL;
|
||||
if (msg->FindString("font_family", &family) != B_OK
|
||||
|| msg->FindString("font_style", &style) != B_OK
|
||||
|| msg->FindString("font_size", &size) != B_OK) {
|
||||
break;
|
||||
}
|
||||
|
||||
PrefHandler* pref = PrefHandler::Default();
|
||||
const char* currentFamily
|
||||
= pref->getString(PREF_HALF_FONT_FAMILY);
|
||||
const char* currentStyle
|
||||
= pref->getString(PREF_HALF_FONT_STYLE);
|
||||
const char* currentSize
|
||||
= pref->getString(PREF_HALF_FONT_SIZE);
|
||||
|
||||
if (currentFamily == NULL || strcmp(currentFamily, family) != 0
|
||||
|| currentStyle == NULL || strcmp(currentStyle, style) != 0) {
|
||||
|| currentStyle == NULL || strcmp(currentStyle, style) != 0
|
||||
|| currentSize == NULL || strcmp(currentSize, size) != 0) {
|
||||
pref->setString(PREF_HALF_FONT_FAMILY, family);
|
||||
pref->setString(PREF_HALF_FONT_STYLE, style);
|
||||
pref->setString(PREF_HALF_FONT_SIZE, size);
|
||||
_MarkSelectedFont(family, style, size);
|
||||
modified = true;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case MSG_HALF_SIZE_CHANGED:
|
||||
if (strcmp(PrefHandler::Default()->getString(PREF_HALF_FONT_SIZE),
|
||||
fFontSize->Menu()->FindMarked()->Label()) != 0) {
|
||||
PrefHandler::Default()->setString(PREF_HALF_FONT_SIZE,
|
||||
fFontSize->Menu()->FindMarked()->Label());
|
||||
modified = true;
|
||||
}
|
||||
break;
|
||||
|
||||
case MSG_COLOR_CHANGED:
|
||||
{
|
||||
rgb_color oldColor = PrefHandler::Default()->getRGB(
|
||||
fColorField->Menu()->FindMarked()->Label());
|
||||
if (oldColor != fColorControl->ValueAsColor()) {
|
||||
PrefHandler::Default()->setRGB(
|
||||
fColorField->Menu()->FindMarked()->Label(),
|
||||
fColorControl->ValueAsColor());
|
||||
modified = true;
|
||||
}
|
||||
if (oldColor != fColorControl->ValueAsColor()) {
|
||||
PrefHandler::Default()->setRGB(
|
||||
fColorField->Menu()->FindMarked()->Label(),
|
||||
fColorControl->ValueAsColor());
|
||||
modified = true;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case MSG_COLOR_SCHEME_CHANGED:
|
||||
{
|
||||
color_scheme* newScheme = NULL;
|
||||
if (msg->FindPointer("color_scheme",
|
||||
(void**)&newScheme) == B_OK) {
|
||||
|
||||
(void**)&newScheme) == B_OK) {
|
||||
if (newScheme == &gCustomColorScheme)
|
||||
_EnableCustomColors(true);
|
||||
else
|
||||
@ -431,13 +432,17 @@ AppearancePrefView::_MakeFontMenu(uint32 command,
|
||||
font.SetFamilyAndStyle(family, style);
|
||||
if (IsFontUsable(font)) {
|
||||
BMessage* message = new BMessage(command);
|
||||
const char* size
|
||||
= PrefHandler::Default()->getString(PREF_HALF_FONT_SIZE);
|
||||
message->AddString("font_family", family);
|
||||
message->AddString("font_style", style);
|
||||
char itemLabel[134];
|
||||
snprintf(itemLabel, sizeof(itemLabel),
|
||||
message->AddString("font_size", size);
|
||||
char fontMenuLabel[134];
|
||||
snprintf(fontMenuLabel, sizeof(fontMenuLabel),
|
||||
"%s - %s", family, style);
|
||||
BMenuItem* item = new BMenuItem(itemLabel,
|
||||
message);
|
||||
BMenu* fontSizeMenu = _MakeFontSizeMenu(fontMenuLabel,
|
||||
MSG_HALF_FONT_CHANGED, family, style, size);
|
||||
BMenuItem* item = new BMenuItem(fontSizeMenu, message);
|
||||
menu->AddItem(item);
|
||||
if (strcmp(defaultFamily, family) == 0
|
||||
&& strcmp(defaultStyle, style) == 0)
|
||||
@ -456,32 +461,42 @@ AppearancePrefView::_MakeFontMenu(uint32 command,
|
||||
|
||||
|
||||
/*static*/ BMenu*
|
||||
AppearancePrefView::_MakeSizeMenu(uint32 command, uint8 defaultSize)
|
||||
AppearancePrefView::_MakeFontSizeMenu(const char* label, uint32 command,
|
||||
const char* family, const char* style, const char* size)
|
||||
{
|
||||
BPopUpMenu* menu = new BPopUpMenu("size");
|
||||
int32 sizes[] = {9, 10, 11, 12, 14, 16, 18, 0};
|
||||
BMenu* menu = new BMenu(label);
|
||||
menu->SetRadioMode(true);
|
||||
menu->SetLabelFromMarked(false);
|
||||
|
||||
int32 sizes[] = {
|
||||
8, 9, 10, 11, 12, 14, 16, 18, 20, 22, 24, 28, 32, 36, 0
|
||||
};
|
||||
|
||||
bool found = false;
|
||||
|
||||
for (uint32 i = 0; sizes[i]; i++) {
|
||||
BString string;
|
||||
string << sizes[i];
|
||||
|
||||
BMenuItem* item = new BMenuItem(string.String(), new BMessage(command));
|
||||
BString fontSize;
|
||||
fontSize << sizes[i];
|
||||
BMessage* message = new BMessage(command);
|
||||
message->AddString("font_family", family);
|
||||
message->AddString("font_style", style);
|
||||
message->AddString("font_size", fontSize.String());
|
||||
BMenuItem* item = new BMenuItem(fontSize.String(), message);
|
||||
menu->AddItem(item);
|
||||
|
||||
if (sizes[i] == defaultSize) {
|
||||
if (sizes[i] == atoi(size)) {
|
||||
item->SetMarked(true);
|
||||
found = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (!found) {
|
||||
for (uint32 i = 0; sizes[i]; i++) {
|
||||
if (sizes[i] > defaultSize) {
|
||||
BString string;
|
||||
string << defaultSize;
|
||||
BMenuItem* item = new BMenuItem(string.String(),
|
||||
new BMessage(command));
|
||||
if (sizes[i] > atoi(size)) {
|
||||
BMessage* message = new BMessage(command);
|
||||
message->AddString("font_family", family);
|
||||
message->AddString("font_style", style);
|
||||
message->AddString("font_size", size);
|
||||
BMenuItem* item = new BMenuItem(size, message);
|
||||
item->SetMarked(true);
|
||||
menu->AddItem(item, i);
|
||||
break;
|
||||
@ -541,3 +556,28 @@ AppearancePrefView::_MakeColorSchemeMenu(uint32 msg, const color_scheme** items,
|
||||
}
|
||||
return menu;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
AppearancePrefView::_MarkSelectedFont(const char* family, const char* style,
|
||||
const char* size)
|
||||
{
|
||||
char fontMenuLabel[134];
|
||||
snprintf(fontMenuLabel, sizeof(fontMenuLabel), "%s - %s", family, style);
|
||||
|
||||
// mark the selected font
|
||||
BMenuItem* selectedFont = fFontField->Menu()->FindItem(fontMenuLabel);
|
||||
if (selectedFont != NULL)
|
||||
selectedFont->SetMarked(true);
|
||||
|
||||
// mark the selected font size on all font menus
|
||||
for (int32 i = 0; i < fFontField->Menu()->CountItems(); i++) {
|
||||
BMenu* fontSizeMenu = fFontField->Menu()->SubmenuAt(i);
|
||||
if (fontSizeMenu == NULL)
|
||||
continue;
|
||||
|
||||
BMenuItem* item = fontSizeMenu->FindItem(size);
|
||||
if (item != NULL)
|
||||
item->SetMarked(true);
|
||||
}
|
||||
}
|
||||
|
@ -62,8 +62,11 @@ private:
|
||||
static BMenu* _MakeFontMenu(uint32 command,
|
||||
const char* defaultFamily,
|
||||
const char* defaultStyle);
|
||||
static BMenu* _MakeSizeMenu(uint32 command,
|
||||
uint8 defaultSize);
|
||||
static BMenu* _MakeFontSizeMenu(const char* label,
|
||||
uint32 command,
|
||||
const char* family,
|
||||
const char* style,
|
||||
const char* size);
|
||||
|
||||
static BPopUpMenu* _MakeMenu(uint32 msg, const char** items,
|
||||
const char* defaultItem);
|
||||
@ -72,10 +75,12 @@ private:
|
||||
const color_scheme** schemes,
|
||||
const color_scheme* defaultItemName);
|
||||
|
||||
void _MarkSelectedFont(const char* family,
|
||||
const char* style, const char* size);
|
||||
|
||||
BCheckBox* fBlinkCursor;
|
||||
BCheckBox* fWarnOnExit;
|
||||
BMenuField* fFont;
|
||||
BMenuField* fFontSize;
|
||||
BMenuField* fFontField;
|
||||
|
||||
BMenuField* fColorSchemeField;
|
||||
BMenuField* fColorField;
|
||||
|
@ -103,8 +103,8 @@ static const char* const PREF_HALF_FONT_SIZE = "Half Font Size";
|
||||
|
||||
static const char* const PREF_TEXT_FORE_COLOR = "Text";
|
||||
static const char* const PREF_TEXT_BACK_COLOR = "Background";
|
||||
static const char* const PREF_CURSOR_FORE_COLOR = "Cursor text";
|
||||
static const char* const PREF_CURSOR_BACK_COLOR = "Cursor background";
|
||||
static const char* const PREF_CURSOR_FORE_COLOR = "Text under cursor";
|
||||
static const char* const PREF_CURSOR_BACK_COLOR = "Cursor";
|
||||
static const char* const PREF_SELECT_FORE_COLOR = "Selected text";
|
||||
static const char* const PREF_SELECT_BACK_COLOR = "Selected background";
|
||||
|
||||
|
@ -945,8 +945,8 @@ TermView::SetTermFont(const BFont *font)
|
||||
fHalfFont.SetSpacing(B_FIXED_SPACING);
|
||||
|
||||
// calculate half font's max width
|
||||
// Not Bounding, check only A-Z(For case of fHalfFont is KanjiFont. )
|
||||
for (int c = 0x20 ; c <= 0x7e; c++){
|
||||
// Not Bounding, check only A-Z (For case of fHalfFont is KanjiFont.)
|
||||
for (int c = 0x20; c <= 0x7e; c++) {
|
||||
char buf[4];
|
||||
sprintf(buf, "%c", c);
|
||||
int tmpWidth = (int)fHalfFont.StringWidth(buf);
|
||||
|
@ -11,6 +11,7 @@
|
||||
|
||||
#include <new>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <time.h>
|
||||
|
||||
@ -58,6 +59,9 @@
|
||||
const static int32 kMaxTabs = 6;
|
||||
const static int32 kTermViewOffset = 3;
|
||||
|
||||
const static int32 kMinimumFontSize = 8;
|
||||
const static int32 kMaximumFontSize = 36;
|
||||
|
||||
// messages constants
|
||||
static const uint32 kNewTab = 'NTab';
|
||||
static const uint32 kCloseView = 'ClVw';
|
||||
@ -402,8 +406,8 @@ TermWindow::MenusBeginning()
|
||||
|
||||
float size = font.Size();
|
||||
|
||||
fDecreaseFontSizeMenuItem->SetEnabled(size > 9);
|
||||
fIncreaseFontSizeMenuItem->SetEnabled(size < 18);
|
||||
fDecreaseFontSizeMenuItem->SetEnabled(size > kMinimumFontSize);
|
||||
fIncreaseFontSizeMenuItem->SetEnabled(size < kMaximumFontSize);
|
||||
|
||||
BWindow::MenusBeginning();
|
||||
}
|
||||
@ -449,6 +453,16 @@ TermWindow::_MakeEncodingMenu()
|
||||
void
|
||||
TermWindow::_SetupMenu()
|
||||
{
|
||||
fFontSizeMenu = _MakeFontSizeMenu(MSG_HALF_SIZE_CHANGED,
|
||||
PrefHandler::Default()->getInt32(PREF_HALF_FONT_SIZE));
|
||||
fIncreaseFontSizeMenuItem = new BMenuItem(B_TRANSLATE("Increase"),
|
||||
new BMessage(kIncreaseFontSize), '+', B_COMMAND_KEY);
|
||||
fDecreaseFontSizeMenuItem = new BMenuItem(B_TRANSLATE("Decrease"),
|
||||
new BMessage(kDecreaseFontSize), '-', B_COMMAND_KEY);
|
||||
fFontSizeMenu->AddSeparatorItem();
|
||||
fFontSizeMenu->AddItem(fIncreaseFontSizeMenuItem);
|
||||
fFontSizeMenu->AddItem(fDecreaseFontSizeMenuItem);
|
||||
|
||||
BLayoutBuilder::Menu<>(fMenuBar = new BMenuBar(Bounds(), "mbar"))
|
||||
// Terminal
|
||||
.AddMenu(B_TRANSLATE_SYSTEM_NAME("Terminal"))
|
||||
@ -491,14 +505,7 @@ TermWindow::_SetupMenu()
|
||||
.AddMenu(B_TRANSLATE("Settings"))
|
||||
.AddItem(_MakeWindowSizeMenu())
|
||||
.AddItem(fEncodingMenu = _MakeEncodingMenu())
|
||||
.AddMenu(B_TRANSLATE("Text size"))
|
||||
.AddItem(B_TRANSLATE("Increase"), kIncreaseFontSize, '+',
|
||||
B_COMMAND_KEY)
|
||||
.GetItem(fIncreaseFontSizeMenuItem)
|
||||
.AddItem(B_TRANSLATE("Decrease"), kDecreaseFontSize, '-',
|
||||
B_COMMAND_KEY)
|
||||
.GetItem(fDecreaseFontSizeMenuItem)
|
||||
.End()
|
||||
.AddItem(fFontSizeMenu)
|
||||
.AddSeparator()
|
||||
.AddItem(B_TRANSLATE("Settings" B_UTF8_ELLIPSIS), MENU_PREF_OPEN)
|
||||
.AddSeparator()
|
||||
@ -613,15 +620,25 @@ TermWindow::_GetPreferredFont(BFont& font)
|
||||
// Default to be_fixed_font
|
||||
font = be_fixed_font;
|
||||
|
||||
const char* family = PrefHandler::Default()->getString(PREF_HALF_FONT_FAMILY);
|
||||
const char* style = PrefHandler::Default()->getString(PREF_HALF_FONT_STYLE);
|
||||
const char* family
|
||||
= PrefHandler::Default()->getString(PREF_HALF_FONT_FAMILY);
|
||||
const char* style
|
||||
= PrefHandler::Default()->getString(PREF_HALF_FONT_STYLE);
|
||||
const char* size = PrefHandler::Default()->getString(PREF_HALF_FONT_SIZE);
|
||||
|
||||
font.SetFamilyAndStyle(family, style);
|
||||
font.SetSize(atoi(size));
|
||||
|
||||
float size = PrefHandler::Default()->getFloat(PREF_HALF_FONT_SIZE);
|
||||
if (size < 6.0f)
|
||||
size = 6.0f;
|
||||
font.SetSize(size);
|
||||
// mark the font size menu item
|
||||
for (int32 i = 0; i < fFontSizeMenu->CountItems(); i++) {
|
||||
BMenuItem* item = fFontSizeMenu->ItemAt(i);
|
||||
if (item == NULL)
|
||||
continue;
|
||||
|
||||
item->SetMarked(false);
|
||||
if (strcmp(item->Label(), size) == 0)
|
||||
item->SetMarked(true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -771,24 +788,60 @@ TermWindow::MessageReceived(BMessage *message)
|
||||
case MSG_COLS_CHANGED:
|
||||
{
|
||||
int32 columns, rows;
|
||||
message->FindInt32("columns", &columns);
|
||||
message->FindInt32("rows", &rows);
|
||||
if (message->FindInt32("columns", &columns) != B_OK
|
||||
|| message->FindInt32("rows", &rows) != B_OK) {
|
||||
break;
|
||||
}
|
||||
|
||||
_ActiveTermView()->SetTermSize(rows, columns);
|
||||
|
||||
_ResizeView(_ActiveTermView());
|
||||
for (int32 i = 0; i < fTabView->CountTabs(); i++) {
|
||||
TermView* view = _TermViewAt(i);
|
||||
view->SetTermSize(rows, columns);
|
||||
_ResizeView(view);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case MSG_HALF_FONT_CHANGED:
|
||||
case MSG_FULL_FONT_CHANGED:
|
||||
case MSG_HALF_SIZE_CHANGED:
|
||||
case MSG_FULL_SIZE_CHANGED:
|
||||
{
|
||||
BFont font;
|
||||
_GetPreferredFont(font);
|
||||
_ActiveTermView()->SetTermFont(&font);
|
||||
for (int32 i = 0; i < fTabView->CountTabs(); i++) {
|
||||
TermView* view = _TermViewAt(i);
|
||||
view->SetTermFont(&font);
|
||||
_ResizeView(view);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
_ResizeView(_ActiveTermView());
|
||||
case MSG_HALF_SIZE_CHANGED:
|
||||
case MSG_FULL_SIZE_CHANGED:
|
||||
{
|
||||
const char* size = NULL;
|
||||
if (message->FindString("font_size", &size) != B_OK)
|
||||
break;
|
||||
|
||||
// mark the font size menu item
|
||||
for (int32 i = 0; i < fFontSizeMenu->CountItems(); i++) {
|
||||
BMenuItem* item = fFontSizeMenu->ItemAt(i);
|
||||
if (item == NULL)
|
||||
continue;
|
||||
|
||||
item->SetMarked(false);
|
||||
if (strcmp(item->Label(), size) == 0)
|
||||
item->SetMarked(true);
|
||||
}
|
||||
|
||||
BFont font;
|
||||
_ActiveTermView()->GetTermFont(&font);
|
||||
font.SetSize(atoi(size));
|
||||
PrefHandler::Default()->setInt32(PREF_HALF_FONT_SIZE,
|
||||
(int32)atoi(size));
|
||||
for (int32 i = 0; i < fTabView->CountTabs(); i++) {
|
||||
TermView* view = _TermViewAt(i);
|
||||
_TermViewAt(i)->SetTermFont(&font);
|
||||
_ResizeView(view);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
@ -957,27 +1010,50 @@ TermWindow::MessageReceived(BMessage *message)
|
||||
case kIncreaseFontSize:
|
||||
case kDecreaseFontSize:
|
||||
{
|
||||
TermView* view = _ActiveTermView();
|
||||
BFont font;
|
||||
view->GetTermFont(&font);
|
||||
|
||||
_ActiveTermView()->GetTermFont(&font);
|
||||
float size = font.Size();
|
||||
if (message->what == kIncreaseFontSize)
|
||||
size += 1;
|
||||
else
|
||||
size -= 1;
|
||||
|
||||
// limit the font size
|
||||
if (size < 9)
|
||||
size = 9;
|
||||
if (size > 18)
|
||||
size = 18;
|
||||
if (message->what == kIncreaseFontSize) {
|
||||
if (size < 12)
|
||||
size += 1;
|
||||
else if (size < 24)
|
||||
size += 2;
|
||||
else
|
||||
size += 4;
|
||||
} else {
|
||||
if (size <= 12)
|
||||
size -= 1;
|
||||
else if (size <= 24)
|
||||
size -= 2;
|
||||
else
|
||||
size -= 4;
|
||||
}
|
||||
|
||||
// constrain the font size
|
||||
if (size < kMinimumFontSize)
|
||||
size = kMinimumFontSize;
|
||||
if (size > kMaximumFontSize)
|
||||
size = kMaximumFontSize;
|
||||
|
||||
// mark the font size menu item
|
||||
for (int32 i = 0; i < fFontSizeMenu->CountItems(); i++) {
|
||||
BMenuItem* item = fFontSizeMenu->ItemAt(i);
|
||||
if (item == NULL)
|
||||
continue;
|
||||
|
||||
item->SetMarked(false);
|
||||
if (atoi(item->Label()) == size)
|
||||
item->SetMarked(true);
|
||||
}
|
||||
|
||||
font.SetSize(size);
|
||||
view->SetTermFont(&font);
|
||||
PrefHandler::Default()->setInt32(PREF_HALF_FONT_SIZE, (int32)size);
|
||||
|
||||
_ResizeView(view);
|
||||
for (int32 i = 0; i < fTabView->CountTabs(); i++) {
|
||||
TermView* view = _TermViewAt(i);
|
||||
_TermViewAt(i)->SetTermFont(&font);
|
||||
_ResizeView(view);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
@ -1144,10 +1220,12 @@ TermWindow::_AddTab(Arguments* args, const BString& currentDirectory)
|
||||
view->GetFontSize(&width, &height);
|
||||
|
||||
float minimumHeight = -1;
|
||||
if (fMenuBar)
|
||||
if (fMenuBar != NULL)
|
||||
minimumHeight += fMenuBar->Bounds().Height() + 1;
|
||||
if (fTabView && fTabView->CountTabs() > 0)
|
||||
|
||||
if (fTabView != NULL && fTabView->CountTabs() > 0)
|
||||
minimumHeight += fTabView->TabHeight() + 1;
|
||||
|
||||
SetSizeLimits(MIN_COLS * width - 1, MAX_COLS * width - 1,
|
||||
minimumHeight + MIN_ROWS * height - 1,
|
||||
minimumHeight + MAX_ROWS * height - 1);
|
||||
@ -1155,7 +1233,7 @@ TermWindow::_AddTab(Arguments* args, const BString& currentDirectory)
|
||||
// the terminal can be resized smaller than MIN_ROWS/MIN_COLS!
|
||||
|
||||
// If it's the first time we're called, setup the window
|
||||
if (fTabView->CountTabs() == 0) {
|
||||
if (fTabView != NULL && fTabView->CountTabs() == 0) {
|
||||
float viewWidth, viewHeight;
|
||||
containerView->GetPreferredSize(&viewWidth, &viewHeight);
|
||||
|
||||
@ -1523,9 +1601,10 @@ TermWindow::_ResizeView(TermView *view)
|
||||
view->GetFontSize(&fontWidth, &fontHeight);
|
||||
|
||||
float minimumHeight = -1;
|
||||
if (fMenuBar)
|
||||
if (fMenuBar != NULL)
|
||||
minimumHeight += fMenuBar->Bounds().Height() + 1;
|
||||
if (fTabView && fTabView->CountTabs() > 1)
|
||||
|
||||
if (fTabView != NULL && fTabView->CountTabs() > 1)
|
||||
minimumHeight += fTabView->TabHeight() + 1;
|
||||
|
||||
SetSizeLimits(MIN_COLS * fontWidth - 1, MAX_COLS * fontWidth - 1,
|
||||
@ -1535,19 +1614,21 @@ TermWindow::_ResizeView(TermView *view)
|
||||
float width;
|
||||
float height;
|
||||
view->Parent()->GetPreferredSize(&width, &height);
|
||||
|
||||
width += B_V_SCROLL_BAR_WIDTH;
|
||||
// NOTE: Width is one pixel too small, since the scroll view
|
||||
// is one pixel wider than its parent.
|
||||
height += fMenuBar->Bounds().Height() + 1;
|
||||
if (fMenuBar != NULL)
|
||||
height += fMenuBar->Bounds().Height() + 1;
|
||||
if (fTabView != NULL && fTabView->CountTabs() > 1)
|
||||
height += fTabView->TabHeight() + 1;
|
||||
|
||||
ResizeTo(width, height);
|
||||
|
||||
view->Invalidate();
|
||||
}
|
||||
|
||||
|
||||
/* static */
|
||||
BMenu*
|
||||
/* static */ BMenu*
|
||||
TermWindow::_MakeWindowSizeMenu()
|
||||
{
|
||||
BMenu* menu = new (std::nothrow) BMenu(B_TRANSLATE("Window size"));
|
||||
@ -1581,6 +1662,51 @@ TermWindow::_MakeWindowSizeMenu()
|
||||
}
|
||||
|
||||
|
||||
/*static*/ BMenu*
|
||||
TermWindow::_MakeFontSizeMenu(uint32 command, uint8 defaultSize)
|
||||
{
|
||||
BMenu* menu = new (std::nothrow) BMenu(B_TRANSLATE("Font size"));
|
||||
if (menu == NULL)
|
||||
return NULL;
|
||||
|
||||
int32 sizes[] = {
|
||||
8, 9, 10, 11, 12, 14, 16, 18, 20, 22, 24, 28, 32, 36, 0
|
||||
};
|
||||
|
||||
bool found = false;
|
||||
|
||||
for (uint32 i = 0; sizes[i]; i++) {
|
||||
BString string;
|
||||
string << sizes[i];
|
||||
BMessage* message = new BMessage(command);
|
||||
message->AddString("font_size", string);
|
||||
BMenuItem* item = new BMenuItem(string.String(), message);
|
||||
menu->AddItem(item);
|
||||
if (sizes[i] == defaultSize) {
|
||||
item->SetMarked(true);
|
||||
found = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (!found) {
|
||||
for (uint32 i = 0; sizes[i]; i++) {
|
||||
if (sizes[i] > defaultSize) {
|
||||
BString string;
|
||||
string << defaultSize;
|
||||
BMessage* message = new BMessage(command);
|
||||
message->AddString("font_size", string);
|
||||
BMenuItem* item = new BMenuItem(string.String(), message);
|
||||
item->SetMarked(true);
|
||||
menu->AddItem(item, i);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return menu;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
TermWindow::_UpdateSwitchTerminalsMenuItem()
|
||||
{
|
||||
|
@ -136,6 +136,8 @@ private:
|
||||
void _SetupMenu();
|
||||
static BMenu* _MakeEncodingMenu();
|
||||
static BMenu* _MakeWindowSizeMenu();
|
||||
static BMenu* _MakeFontSizeMenu(uint32 command,
|
||||
uint8 defaultSize);
|
||||
void _UpdateSwitchTerminalsMenuItem();
|
||||
|
||||
status_t _GetWindowPositionFile(BFile* file,
|
||||
@ -198,6 +200,7 @@ private:
|
||||
BMenuBar* fMenuBar;
|
||||
BMenuItem* fSwitchTerminalsMenuItem;
|
||||
BMenu* fEncodingMenu;
|
||||
BMenu* fFontSizeMenu;
|
||||
|
||||
BMessage* fPrintSettings;
|
||||
PrefWindow* fPrefWindow;
|
||||
@ -212,7 +215,7 @@ private:
|
||||
// Saved search parameters
|
||||
BString fFindString;
|
||||
BMenuItem* fFindNextMenuItem;
|
||||
BMenuItem * fFindPreviousMenuItem;
|
||||
BMenuItem* fFindPreviousMenuItem;
|
||||
BMenuItem* fIncreaseFontSizeMenuItem;
|
||||
BMenuItem* fDecreaseFontSizeMenuItem;
|
||||
|
||||
|
@ -28,6 +28,7 @@
|
||||
|
||||
#include "BrowserApp.h"
|
||||
|
||||
#include <AboutWindow.h>
|
||||
#include <Alert.h>
|
||||
#include <Autolock.h>
|
||||
#include <Catalog.h>
|
||||
@ -75,7 +76,8 @@ BrowserApp::BrowserApp()
|
||||
fCookies(NULL),
|
||||
fCookieJar(NULL),
|
||||
fDownloadWindow(NULL),
|
||||
fSettingsWindow(NULL)
|
||||
fSettingsWindow(NULL),
|
||||
fAboutWindow(NULL)
|
||||
{
|
||||
}
|
||||
|
||||
@ -86,25 +88,45 @@ BrowserApp::~BrowserApp()
|
||||
delete fSettings;
|
||||
delete fCookies;
|
||||
delete fCookieJar;
|
||||
|
||||
if (fAboutWindow != NULL)
|
||||
fAboutWindow->Quit();
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
BrowserApp::AboutRequested()
|
||||
{
|
||||
BString aboutText("WebPositive\n\nby Ryan Leavengood, Andrea Anzani, "
|
||||
"Maxime Simon, Michael Lotz, Rene Gollent, Stephan Aßmus and "
|
||||
"Alexandre Deckner");
|
||||
aboutText << "\n\nWebPositive 1.1";
|
||||
aboutText << "\n\nHaikuWebKit " << WebKitInfo::HaikuWebKitVersion();
|
||||
aboutText << " (" << WebKitInfo::HaikuWebKitRevision() << ")";
|
||||
aboutText << "\nWebKit " << WebKitInfo::WebKitVersion();
|
||||
aboutText << " (" << WebKitInfo::WebKitRevision() << ")";
|
||||
if (fAboutWindow == NULL) {
|
||||
// create the about window
|
||||
|
||||
BAlert* alert = new BAlert("About WebPositive", aboutText.String(),
|
||||
"Sweet!");
|
||||
alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE);
|
||||
alert->Go(NULL);
|
||||
const char* authors[] = {
|
||||
"Andrea Anzani",
|
||||
"Stephan Aßmus",
|
||||
"Alexandre Deckner",
|
||||
"Rene Gollent",
|
||||
"Ryan Leavengood",
|
||||
"Michael Lotz",
|
||||
"Maxime Simon",
|
||||
NULL
|
||||
};
|
||||
|
||||
BString aboutText("");
|
||||
aboutText << "HaikuWebKit " << WebKitInfo::HaikuWebKitVersion();
|
||||
aboutText << " (" << WebKitInfo::HaikuWebKitRevision() << ")";
|
||||
aboutText << "\nWebKit " << WebKitInfo::WebKitVersion();
|
||||
aboutText << " (" << WebKitInfo::WebKitRevision() << ")";
|
||||
|
||||
fAboutWindow = new BAboutWindow(kApplicationName,
|
||||
kApplicationSignature);
|
||||
fAboutWindow->AddCopyright(2007, "Haiku, Inc.");
|
||||
fAboutWindow->AddAuthors(authors);
|
||||
fAboutWindow->AddExtraInfo(aboutText.String());
|
||||
fAboutWindow->Show();
|
||||
} else if (fAboutWindow->IsHidden())
|
||||
fAboutWindow->Show();
|
||||
else
|
||||
fAboutWindow->Activate();
|
||||
}
|
||||
|
||||
|
||||
|
@ -33,6 +33,8 @@
|
||||
#include <Catalog.h>
|
||||
#include <Rect.h>
|
||||
|
||||
|
||||
class BAboutWindow;
|
||||
class BNetworkCookieJar;
|
||||
class DownloadWindow;
|
||||
class BrowserWindow;
|
||||
@ -77,6 +79,8 @@ private:
|
||||
|
||||
DownloadWindow* fDownloadWindow;
|
||||
SettingsWindow* fSettingsWindow;
|
||||
|
||||
BAboutWindow* fAboutWindow;
|
||||
};
|
||||
|
||||
|
||||
|
@ -652,11 +652,10 @@ BrowserWindow::MessageReceived(BMessage* message)
|
||||
BString url;
|
||||
if (message->FindString("url", &url) != B_OK)
|
||||
url = fURLInputGroup->Text();
|
||||
|
||||
_SetPageIcon(CurrentWebView(), NULL);
|
||||
BString newUrl = _SmartURLHandler(url);
|
||||
if (newUrl != url)
|
||||
fURLInputGroup->TextView()->SetText(newUrl);
|
||||
CurrentWebView()->LoadURL(newUrl.String());
|
||||
_SmartURLHandler(url);
|
||||
|
||||
break;
|
||||
}
|
||||
case GO_BACK:
|
||||
@ -2148,19 +2147,115 @@ BrowserWindow::_NewTabURL(bool isNewWindow) const
|
||||
return url;
|
||||
}
|
||||
|
||||
|
||||
BString
|
||||
BrowserWindow::_SmartURLHandler(const BString& url) const
|
||||
BrowserWindow::_EncodeURIComponent(const BString& search)
|
||||
{
|
||||
BString result = url;
|
||||
const BString escCharList = " $&`:<>[]{}\"+#%@/;=?\\^|~\',";
|
||||
BString result = search;
|
||||
char hexcode[4];
|
||||
|
||||
for (int32 i = 0; i < result.Length(); i++) {
|
||||
if (escCharList.FindFirst(result[i]) != B_ERROR) {
|
||||
sprintf(hexcode, "%02X", (unsigned int)result[i]);
|
||||
result[i] = '%';
|
||||
result.Insert(hexcode, i + 1);
|
||||
i += 2;
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
BrowserWindow::_VisitURL(const BString& url)
|
||||
{
|
||||
//fURLInputGroup->TextView()->SetText(url);
|
||||
CurrentWebView()->LoadURL(url.String());
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
BrowserWindow::_VisitSearchEngine(const BString& search)
|
||||
{
|
||||
// TODO: Google Code-In Task to make default search
|
||||
// engine modifiable from Settings? :)
|
||||
|
||||
BString engine = "http://www.google.com/search?q=";
|
||||
engine += _EncodeURIComponent(search);
|
||||
// We have to take care of some of the escaping before
|
||||
// we hand over the string to WebKit, if we want queries
|
||||
// like "4+3" to not be searched as "4 3".
|
||||
|
||||
_VisitURL(engine);
|
||||
}
|
||||
|
||||
|
||||
inline bool
|
||||
BrowserWindow::_IsValidDomainChar(char ch)
|
||||
{
|
||||
// TODO: Currenlty, only a whitespace character
|
||||
// breaks a domain name. It might be
|
||||
// a good idea (or a bad one) to make
|
||||
// character filtering based on the
|
||||
// IDNA 2008 standard.
|
||||
|
||||
return ch != ' ';
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
BrowserWindow::_SmartURLHandler(const BString& url)
|
||||
{
|
||||
// Only process if this doesn't look like a full URL (http:// or
|
||||
// file://, etc.)
|
||||
if (url.FindFirst("://") == B_ERROR) {
|
||||
if (url.FindFirst(".") == B_ERROR || url.FindFirst(" ") != B_ERROR)
|
||||
result.Prepend("http://www.google.com/search?q=");
|
||||
|
||||
BString temp;
|
||||
int32 at = url.FindFirst(":");
|
||||
|
||||
if (at != B_ERROR) {
|
||||
BString proto;
|
||||
url.CopyInto(proto, 0, at);
|
||||
|
||||
if (proto == "http" || proto == "https" || proto == "file")
|
||||
_VisitURL(url);
|
||||
else {
|
||||
temp = "application/x-vnd.Be.URL.";
|
||||
temp += proto;
|
||||
|
||||
char* argv[1] = { (char*)url.String() };
|
||||
|
||||
if (be_roster->Launch(temp.String(), 1, argv) != B_OK)
|
||||
_VisitSearchEngine(url);
|
||||
}
|
||||
} else if (url == "localhost")
|
||||
_VisitURL("http://localhost/");
|
||||
else {
|
||||
const char* localhostPrefix = "localhost/";
|
||||
|
||||
if(url.Compare(localhostPrefix, strlen(localhostPrefix)) == 0)
|
||||
_VisitURL(url);
|
||||
else {
|
||||
bool isURL = false;
|
||||
|
||||
for (int32 i = 0; i < url.CountChars(); i++) {
|
||||
if (url[i] == '.')
|
||||
isURL = true;
|
||||
else if (url[i] == '/')
|
||||
break;
|
||||
else if (!_IsValidDomainChar(url[i])) {
|
||||
isURL = false;
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (isURL)
|
||||
_VisitURL(url);
|
||||
else
|
||||
_VisitSearchEngine(url);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
|
@ -190,7 +190,12 @@ private:
|
||||
void _InvokeButtonVisibly(BButton* button);
|
||||
|
||||
BString _NewTabURL(bool isNewWindow) const;
|
||||
BString _SmartURLHandler(const BString& url) const;
|
||||
|
||||
BString _EncodeURIComponent(const BString& search);
|
||||
void _VisitURL(const BString& url);
|
||||
void _VisitSearchEngine(const BString& search);
|
||||
inline bool _IsValidDomainChar(char ch);
|
||||
void _SmartURLHandler(const BString& url);
|
||||
|
||||
void _HandlePageSourceResult(
|
||||
const BMessage* message);
|
||||
|
@ -50,7 +50,6 @@ local sources =
|
||||
URLInputGroup.cpp
|
||||
;
|
||||
|
||||
|
||||
Includes [ FGristFiles $(sources) ] : $(HAIKU_WEBKIT_HEADERS_DEPENDENCY) ;
|
||||
# Dependency needed to trigger downloading/unzipping the package before
|
||||
# compiling the files.
|
||||
@ -60,12 +59,14 @@ Includes [ FGristFiles $(sources) ] : $(HAIKU_WEBKIT_HEADERS_DEPENDENCY) ;
|
||||
#MakeLocate $(svnRevisionFile) : $(LOCATE_TARGET) ;
|
||||
#CreateSVNRevisionFile $(svnRevisionFile) ;
|
||||
|
||||
UsePrivateHeaders shared ;
|
||||
|
||||
Application WebPositive :
|
||||
$(sources)
|
||||
:
|
||||
$(HAIKU_WEBKIT_LIBS)
|
||||
$(TARGET_LIBSTDC++) $(HAIKU_LOCALE_LIBS)
|
||||
be network tracker translation
|
||||
be libshared.a network tracker translation
|
||||
:
|
||||
WebPositive.rdef
|
||||
;
|
||||
|
@ -1,13 +1,13 @@
|
||||
resource app_signature "application/x-vnd.Haiku-WebPositive";
|
||||
|
||||
resource app_version {
|
||||
major = 0,
|
||||
middle = 0,
|
||||
minor = 1,
|
||||
major = 1,
|
||||
middle = 1,
|
||||
minor = 0,
|
||||
variety = B_APPV_ALPHA,
|
||||
internal = 0,
|
||||
short_info = "WebPositive",
|
||||
long_info = "WebPositive ©2007-2010 The WebKit Haiku Project"
|
||||
long_info = "WebPositive ©2007-2012 The WebKit Haiku Project"
|
||||
};
|
||||
|
||||
resource app_flags B_SINGLE_LAUNCH;
|
||||
|
@ -118,7 +118,7 @@ main(int argc, char **argv)
|
||||
if (argc < 2 || !strcmp(argv[1], "--help")) {
|
||||
char *filename = strrchr(argv[0],'/');
|
||||
fprintf(stderr,"usage: %s [-srib] <device> [allocation_group start]\n"
|
||||
"\t-s\tdump super block\n"
|
||||
"\t-s\tdump superblock\n"
|
||||
"\t-r\tdump root node\n"
|
||||
" the following options need the allocation_group/start "
|
||||
"parameters:\n"
|
||||
@ -214,7 +214,7 @@ main(int argc, char **argv)
|
||||
}
|
||||
|
||||
if (disk.ValidateSuperBlock() < B_OK) {
|
||||
fprintf(stderr, "The disk's super block is corrupt (or it's not a BFS "
|
||||
fprintf(stderr, "The disk's superblock is corrupt (or it's not a BFS "
|
||||
"device)!\n");
|
||||
return 0;
|
||||
}
|
||||
|
@ -286,7 +286,7 @@ main(int argc, char** argv)
|
||||
}
|
||||
|
||||
if (disk.ValidateSuperBlock() != B_OK) {
|
||||
fprintf(stderr, "The disk's super block is corrupt!\n");
|
||||
fprintf(stderr, "The disk's superblock is corrupt!\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
@ -307,7 +307,7 @@ main(int argc, char** argv)
|
||||
disk.Log().allocation_group, disk.Log().start,
|
||||
disk.Log().length);
|
||||
} else if (block < 1) {
|
||||
printf("Super Block intersects\n");
|
||||
printf("Superblock intersects\n");
|
||||
} else if (block < 1 + disk.BitmapSize()) {
|
||||
printf("Block bitmap intersects (start %d, end %lu)\n", 1,
|
||||
disk.BitmapSize());
|
||||
|
@ -52,10 +52,10 @@ class BlockRunHashtable : public Hashtable
|
||||
return false;
|
||||
|
||||
memcpy(value,&run,sizeof(block_run));
|
||||
|
||||
|
||||
if (Hashtable::Put(value,value))
|
||||
return true;
|
||||
|
||||
|
||||
free(value);
|
||||
return false;
|
||||
}
|
||||
@ -133,7 +133,7 @@ collectFiles(Disk &disk)
|
||||
return;
|
||||
}
|
||||
collectFiles(disk,root);
|
||||
|
||||
|
||||
printf(" %7Ld files found.\n",gCount);
|
||||
|
||||
delete root;
|
||||
@ -201,7 +201,7 @@ checkFiles(Disk &disk,BPlusTree &tree,char *attribute)
|
||||
{
|
||||
runs[index++] = *run;
|
||||
}
|
||||
|
||||
|
||||
// sort array to speed up disk access
|
||||
qsort(runs,index,sizeof(block_run),(int (*)(const void *,const void *))compareBlockRuns);
|
||||
|
||||
@ -227,7 +227,7 @@ checkFiles(Disk &disk,BPlusTree &tree,char *attribute)
|
||||
delete inode;
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
// check indices not based on standard attributes
|
||||
if (sizeIndex)
|
||||
{
|
||||
@ -422,7 +422,7 @@ main(int argc,char **argv)
|
||||
printUsage(toolName);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
while (*++argv)
|
||||
{
|
||||
char *arg = *argv;
|
||||
@ -447,7 +447,7 @@ main(int argc,char **argv)
|
||||
else
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
char *attribute = argv[0];
|
||||
if (!gCheckAll && attribute == NULL)
|
||||
{
|
||||
@ -476,13 +476,13 @@ main(int argc,char **argv)
|
||||
fprintf(stderr,"Could not open device or file \"%s\": %s\n",info.device_name,strerror(status));
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
if (disk.ValidateSuperBlock() < B_OK)
|
||||
{
|
||||
fprintf(stderr,"The disk's super block is corrupt!\n");
|
||||
fprintf(stderr,"The disk's superblock is corrupt!\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
Directory *indices = (Directory *)Inode::Factory(&disk,disk.Indices());
|
||||
if (indices == NULL || (status = indices->InitCheck()) < B_OK)
|
||||
{
|
||||
@ -497,7 +497,7 @@ main(int argc,char **argv)
|
||||
delete indices;
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
block_run run;
|
||||
|
||||
if (gCheckAll)
|
||||
@ -515,7 +515,7 @@ main(int argc,char **argv)
|
||||
fprintf(stderr," Could not find index directory for \"%s\"!\n",attribute);
|
||||
|
||||
delete indices;
|
||||
|
||||
|
||||
gHashtable.MakeEmpty(HASH_EMPTY_NONE,HASH_EMPTY_FREE);
|
||||
|
||||
return 0;
|
||||
|
@ -2,7 +2,7 @@
|
||||
* Copyright (c) 2001-2008 pinc Software. All Rights Reserved.
|
||||
*/
|
||||
|
||||
//! Handles BFS super block, disk access etc.
|
||||
//! Handles BFS superblock, disk access etc.
|
||||
|
||||
#include "Disk.h"
|
||||
#include "dump.h"
|
||||
@ -157,7 +157,7 @@ Disk::Disk(const char *deviceName, bool rawMode, off_t start, off_t stop)
|
||||
|
||||
if (fBufferedFile->ReadAt(512 + fRawDiskOffset, &fSuperBlock,
|
||||
sizeof(disk_super_block)) < 1)
|
||||
fprintf(stderr,"Disk: Could not read super block\n");
|
||||
fprintf(stderr,"Disk: Could not read superblock\n");
|
||||
|
||||
//dump_super_block(&fSuperBlock);
|
||||
}
|
||||
@ -277,21 +277,21 @@ Disk::ScanForSuperBlock(off_t start, off_t stop)
|
||||
printf("\n(%ld) *** BFS superblock found at: %Ld\n",superBlocks.CountItems() + 1,offset);
|
||||
dump_super_block(super);
|
||||
|
||||
// add a copy of the super block to the list
|
||||
// add a copy of the superblock to the list
|
||||
bfs_disk_info *info = (bfs_disk_info *)malloc(sizeof(bfs_disk_info));
|
||||
if (info == NULL)
|
||||
return B_NO_MEMORY;
|
||||
|
||||
memcpy(&info->super_block, super, sizeof(disk_super_block));
|
||||
info->offset = offset + i - 512;
|
||||
/* location off the BFS super block is 512 bytes after the partition start */
|
||||
/* location off the BFS superblock is 512 bytes after the partition start */
|
||||
superBlocks.AddItem(info);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (superBlocks.CountItems() == 0) {
|
||||
puts("\nCouldn't find any BFS super blocks!");
|
||||
puts("\nCouldn't find any BFS superblocks!");
|
||||
return B_ENTRY_NOT_FOUND;
|
||||
}
|
||||
|
||||
@ -411,7 +411,7 @@ Disk::RecreateSuperBlock()
|
||||
bfs_inode indexDir;
|
||||
bfs_inode rootDir;
|
||||
if (ScanForIndexAndRoot(&indexDir,&rootDir) < B_OK) {
|
||||
fprintf(stderr,"ERROR: Could not find root directory! Trying to recreate the super block will have no effect!\n\tSetting standard values for the root dir.\n");
|
||||
fprintf(stderr,"ERROR: Could not find root directory! Trying to recreate the superblock will have no effect!\n\tSetting standard values for the root dir.\n");
|
||||
rootDir.inode_num.allocation_group = 8;
|
||||
rootDir.inode_num.start = 0;
|
||||
rootDir.inode_num.length = 1;
|
||||
|
@ -1,6 +1,6 @@
|
||||
#ifndef DISK_H
|
||||
#define DISK_H
|
||||
/* Disk - handles BFS super block, disk access etc.
|
||||
/* Disk - handles BFS superblock, disk access etc.
|
||||
**
|
||||
** Copyright (c) 2001-2003 pinc Software. All Rights Reserved.
|
||||
*/
|
||||
|
@ -709,7 +709,7 @@ usage(char *name)
|
||||
"\t-i\trecreate indices on target disk\n"
|
||||
"\t-d\tdump missing and recreated i-nodes\n"
|
||||
"\t-r\tdisk access in raw mode (use only if the partition table is invalid)\n"
|
||||
"\t-s\trecreate super block and exit (for experts only, don't use this\n"
|
||||
"\t-s\trecreate superblock and exit (for experts only, don't use this\n"
|
||||
"\t\tif you don't know what you're doing)\n"
|
||||
"\t-v\tverbose output\n", name);
|
||||
exit(-1);
|
||||
@ -804,15 +804,15 @@ main(int argc, char **argv)
|
||||
bool recreatedSuperBlock = false;
|
||||
|
||||
if (disk.ValidateSuperBlock() < B_OK) {
|
||||
fprintf(stderr, "The disk's super block is corrupt!\n");
|
||||
fprintf(stderr, "The disk's superblock is corrupt!\n");
|
||||
if (disk.RecreateSuperBlock() < B_OK) {
|
||||
fprintf(stderr, "Can't recreate the disk's super block, sorry!\n");
|
||||
fprintf(stderr, "Can't recreate the disk's superblock, sorry!\n");
|
||||
return -1;
|
||||
}
|
||||
recreatedSuperBlock = true;
|
||||
}
|
||||
if (gVerbose) {
|
||||
puts("\n*** The super block:\n");
|
||||
puts("\n*** The superblock:\n");
|
||||
dump_super_block(disk.SuperBlock());
|
||||
}
|
||||
|
||||
@ -825,7 +825,7 @@ main(int argc, char **argv)
|
||||
status_t status = disk.WriteAt(512, disk.SuperBlock(),
|
||||
sizeof(disk_super_block));
|
||||
if (status < B_OK) {
|
||||
fprintf(stderr, "Could not write super block: %s!\n",
|
||||
fprintf(stderr, "Could not write superblock: %s!\n",
|
||||
strerror(status));
|
||||
return 1;
|
||||
}
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user